Hi Support,
When starting a new project based on the multi-link demo, i am currently fine with one master BLE device and 3 other peripheral devices connected via BLE.
The master device advertises for 100ms and scans for 1 sec. For stop the API functionble_gap_adv_stopis called, and it returns with status 0 (OK). But sometimes, the return value is OK but the internal status of Advertising is still signaling active, meansble_dev_params->advertising仍然TRUE. This can remain up to 100ms, then theble_gap_adv_stopcommand gives back 5 (not allowed). This seems to be OK, since two times stop makes no sense.
Question: What can be the reason thatble_gap_adv_stopdoes not stop advertising (ble_dev_params->advertising= TRUE)?
BR Stefan
Device:
Hi Stefan_Dialog,
I dont quite get the question, you mean that you issue the ble_gap_adv_stop() and you get the return value of the ble_gap_adv_stop() itself, the function just sends the command, the code doesn't block and doesn't wait until the stack executes the command. The ble_gap_adv_stop() sends the stop request and the actual advertising stops when there is a reply from the stack, the replies from the stack can be captured in the main BLE task of the application, for example in the multilink project the completion of the advertising will occur as soon as the BLE manager will notify the task for a BLE_EVT_GAP_ADV_COMPLETED and the handle_evt_gap_adv_completed() function gets executed.
Thanks MT_dialog