I want to start adverting at the push of a button.

Hello 

SDK starts adverting when reset.
I want to start adverting at the push of a button.

SDK version : 17.0.0

SWDevide : s112 

When the button is pressed as above, ble_advertising_start(&advertising, BLE_ADV_MODE_FAST); called but it doesn't work
error code: 8
please tell me what to do

Parents
  • Hi , 

    Error 8 means NRF_ERROR_INVALID_STATE. You can find this information if you look at the ble_advertising_start description. 

    This happened most probably because the device is already advertising and you call ble_advertising_start() again, or if the softdevice is not initialized. 
    Please try to add a flag, if the device is already advertising you shouldn't call ble_advertising_start() again. 

Reply
  • Hi , 

    Error 8 means NRF_ERROR_INVALID_STATE. You can find this information if you look at the ble_advertising_start description. 

    This happened most probably because the device is already advertising and you call ble_advertising_start() again, or if the softdevice is not initialized. 
    Please try to add a flag, if the device is already advertising you shouldn't call ble_advertising_start() again. 

Children
No Data
Related