beaconPeriod should be converted to adv_duration_units only before calling setAdvertisingInterval()

This commit is contained in:
Rohit Grover 2014-12-01 08:38:10 +00:00
parent 25eebd68ef
commit eaf31a3941

View file

@ -66,7 +66,7 @@ public:
flags(flagsIn),
effectiveTxPower(effectiveTxPowerIn),
powerLevels(),
beaconPeriod(Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(beaconPeriodIn)),
beaconPeriod(beaconPeriodIn),
lockedStateChar(lockedStateCharUUID, reinterpret_cast<uint8_t *>(&lockedState), 1, 1, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ),
uriDataChar(uriDataCharUUID,
uriData,
@ -182,7 +182,7 @@ private:
ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_16BIT_SERVICE_IDS, BEACON_UUID, sizeof(BEACON_UUID));
ble.accumulateAdvertisingPayload(GapAdvertisingData::SERVICE_DATA, serviceDataPayload, encodedBytes + 4);
ble.setAdvertisingInterval(beaconPeriod);
ble.setAdvertisingInterval(Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(beaconPeriod));
ble.setTxPower(effectiveTxPower);
}