diff --git a/inc/bluetooth/MicroBitBLEManager.h b/inc/bluetooth/MicroBitBLEManager.h index 6110a9c..60c1cef 100644 --- a/inc/bluetooth/MicroBitBLEManager.h +++ b/inc/bluetooth/MicroBitBLEManager.h @@ -267,24 +267,6 @@ class MicroBitBLEManager : MicroBitComponent * More information can be found at https://github.com/google/eddystone/tree/master/eddystone-uid#tx-power */ int advertiseEddystoneUid(const char* uid_namespace, const char* uid_instance, int8_t calibratedPower = MICROBIT_BLE_EDDYSTONE_DEFAULT_POWER, bool connectable = true, uint16_t interval = MICROBIT_BLE_EDDYSTONE_ADV_INTERVAL); - - /** - * Set the content of Eddystone UID frames, but accepts a ManagedString as a namespace and instance. - * - * @param uid_namespace The namespace of the UID. - * - * @param uid_instance The value within the namespace. - * - * @param calibratedPower the transmission range of the beacon (Defaults to: 0xF0 ~10m). - * - * @param connectable true to keep bluetooth connectable for other services, false otherwise. (Defaults to true) - * - * @param interval the rate at which the micro:bit will advertise url frames. (Defaults to MICROBIT_BLE_EDDYSTONE_ADV_INTERVAL) - * - * @note The calibratedPower value ranges from -100 to +20 to a resolution of 1. The calibrated power should be binary encoded. - * More information can be found at https://github.com/google/eddystone/tree/master/eddystone-uid#tx-power - */ - int advertiseEddystoneUid(ManagedString uid_namespace, ManagedString uid_instance, int8_t calibratedPower = MICROBIT_BLE_EDDYSTONE_DEFAULT_POWER, bool connectable = true, uint16_t interval = MICROBIT_BLE_EDDYSTONE_ADV_INTERVAL); #endif private: diff --git a/inc/bluetooth/MicroBitEddystone.h b/inc/bluetooth/MicroBitEddystone.h index 41d9a70..981ccfb 100644 --- a/inc/bluetooth/MicroBitEddystone.h +++ b/inc/bluetooth/MicroBitEddystone.h @@ -79,9 +79,9 @@ class MicroBitEddystone /** * Set the content of Eddystone UID frames * - * @param uid_namespace: the uid namespace. Must 10 bytes long. + * @param uid_namespace the uid namespace. Must 10 bytes long. * - * @param uid_instance: the uid instance value. Must 6 bytes long. + * @param uid_instance the uid instance value. Must 6 bytes long. * * @param calibratedPower the transmission range of the beacon (Defaults to: 0xF0 ~10m). * @@ -89,21 +89,6 @@ class MicroBitEddystone * More information can be found at https://github.com/google/eddystone/tree/master/eddystone-uid#tx-power */ int setUID(BLEDevice* ble, const char* uid_namespace, const char* uid_instance, int8_t calibratedPower = 0xF0); - - /** - * Set the content of Eddystone UID frames, but accepts a ManagedString as a namespace and instance. - * - * @param uid_namespace The namespace of the UID. - * - * @param uid_instance The value within the namespace. - * - * @param calibratedPower the transmission range of the beacon (Defaults to: 0xF0 ~10m). - * - * @note The calibratedPower value ranges from -100 to +20 to a resolution of 1. The calibrated power should be binary encoded. - * More information can be found at https://github.com/google/eddystone/tree/master/eddystone-uid#tx-power - */ - int setUID(BLEDevice* ble, ManagedString uid_namespace, ManagedString uid_instance, int8_t calibratedPower = 0xF0); - #endif private: diff --git a/source/bluetooth/MicroBitBLEManager.cpp b/source/bluetooth/MicroBitBLEManager.cpp index e9d5889..92f56e6 100644 --- a/source/bluetooth/MicroBitBLEManager.cpp +++ b/source/bluetooth/MicroBitBLEManager.cpp @@ -595,27 +595,6 @@ int MicroBitBLEManager::advertiseEddystoneUid(const char* uid_namespace, const c return ret; } - -/** - * Set the content of Eddystone UID frames, but accepts a ManagedString as a namespace and instance. - * - * @param uid_namespace The namespace of the UID. - * - * @param uid_instance The value within the namespace. - * - * @param calibratedPower the transmission range of the beacon (Defaults to: 0xF0 ~10m). - * - * @param connectable true to keep bluetooth connectable for other services, false otherwise. (Defaults to true) - * - * @param interval the rate at which the micro:bit will advertise url frames. (Defaults to MICROBIT_BLE_EDDYSTONE_ADV_INTERVAL) - * - * @note The calibratedPower value ranges from -100 to +20 to a resolution of 1. The calibrated power should be binary encoded. - * More information can be found at https://github.com/google/eddystone/tree/master/eddystone-uid#tx-power - */ -int MicroBitBLEManager::advertiseEddystoneUid(ManagedString uid_namespace, ManagedString uid_instance, int8_t calibratedPower, bool connectable, uint16_t interval) -{ - return advertiseEddystoneUid((char *)uid_namespace.toCharArray(), (char *)uid_instance.toCharArray(), calibratedPower, connectable, interval); -} #endif /** diff --git a/source/bluetooth/MicroBitEddystone.cpp b/source/bluetooth/MicroBitEddystone.cpp index d067f61..4d5c1c0 100644 --- a/source/bluetooth/MicroBitEddystone.cpp +++ b/source/bluetooth/MicroBitEddystone.cpp @@ -176,9 +176,9 @@ int MicroBitEddystone::setURL(BLEDevice* ble, ManagedString url, int8_t calibrat /** * Set the content of Eddystone UID frames * - * @param uid_namespace: the uid namespace. Must 10 bytes long. + * @param uid_namespace the uid namespace. Must 10 bytes long. * - * @param uid_instance: the uid instance value. Must 6 bytes long. + * @param uid_instance the uid instance value. Must 6 bytes long. * * @param calibratedPower the transmission range of the beacon (Defaults to: 0xF0 ~10m). * @@ -187,7 +187,7 @@ int MicroBitEddystone::setURL(BLEDevice* ble, ManagedString url, int8_t calibrat */ int MicroBitEddystone::setUID(BLEDevice* ble, const char* uid_namespace, const char* uid_instance, int8_t calibratedPower) { - if (uid_namespace == NULL || strlen(uid_namespace) == 0 || uid_instance == NULL || strlen(uid_instance) == 0) + if (uid_namespace == NULL || uid_instance == NULL) return MICROBIT_INVALID_PARAMETER; char uidData[EDDYSTONE_UID_NAMESPACE_MAX_LENGTH + EDDYSTONE_UID_INSTANCE_MAX_LENGTH]; @@ -212,21 +212,4 @@ int MicroBitEddystone::setUID(BLEDevice* ble, const char* uid_namespace, const c return MICROBIT_OK; } -/** - * Set the content of Eddystone UID frames, but accepts a ManagedString as a namespace and instance. - * - * @param uid_namespace The namespace of the UID. - * - * @param uid_instance The value within the namespace. - * - * @param calibratedPower the transmission range of the beacon (Defaults to: 0xF0 ~10m). - * - * @note The calibratedPower value ranges from -100 to +20 to a resolution of 1. The calibrated power should be binary encoded. - * More information can be found at https://github.com/google/eddystone/tree/master/eddystone-uid#tx-power - */ -int MicroBitEddystone::setUID(BLEDevice* ble, ManagedString uid_namespace, ManagedString uid_instance, int8_t calibratedPower) -{ - return setUID(ble, (char *)uid_namespace.toCharArray(), (char *)uid_instance.toCharArray(), calibratedPower); -} - #endif