diff --git a/libs/bluetooth/bluetooth.cpp b/libs/bluetooth/bluetooth.cpp index e1f2db3e..75622de9 100644 --- a/libs/bluetooth/bluetooth.cpp +++ b/libs/bluetooth/bluetooth.cpp @@ -120,6 +120,7 @@ namespace bluetooth { registerWithDal(MICROBIT_ID_BLE, MICROBIT_BLE_EVT_DISCONNECTED, body); } + const int8_t CALIBRATED_POWERS[] = {-49, -37, -33, -28, -25, -20, -15, -10}; /** * Advertise an Eddystone URL * @param url the url to transmit. Must be no longer than the supported eddystone url length, eg: "https://pxt.io/" @@ -131,7 +132,7 @@ namespace bluetooth { //% help=bluetooth/advertise-url blockExternalInputs=1 void advertiseUrl(StringData* url, int power, bool connectable) { power = min(MICROBIT_BLE_POWER_LEVELS-1, max(0, power)); - int8_t level = MICROBIT_BLE_POWER_LEVEL[power]; + int8_t level = CALIBRATED_POWERS[power]; uBit.bleManager.advertiseEddystoneUrl(ManagedString(url), level, connectable); uBit.bleManager.setTransmitPower(power); }