Closed mrquincle closed 5 years ago
The code:
void Nrf51822BluetoothStack::updateAdvertisement() {
// Why disabled?
// if (!_advertising)
// return;
uint32_t err;
err = ble_advdata_set(&_advdata, &_scan_resp);
switch(err) {
//case NRF_ERROR_INVALID_PARAMETER:
case 0x07:
LOGi("Invalid advertisement configuration");
break;
default:
// BLE_CALL(sd_ble_gap_adv_stop, ());
BLE_CALL(ble_advdata_set, (&_advdata, &_scan_resp));
// BLE_CALL(sd_ble_gap_adv_start, (&adv_params));
}
}
This needs still some love.
This should be fixed by the advertising refactor e1df303b51c5d937e3998d20e4fe74ecda98f4da
The
updateAdvertisement
function at https://github.com/crownstone/bluenet/blob/sdk_11/src/ble/cs_Stack.cpp#L634-L652 does not respect the fact that the device might NOT be advertising there.As a workaround I'm not stopping the program if
ble_advdata_set
returnsNRF_ERROR_INVALID_PARAMETER
(0x07), but it should just not enter that function if it's not advertising.The other functions are organized like this:
Bug: it shouldn't be possible to raise a softdevice error calling
updateAdvertisement
.