ble_gap_adv_stop不工作

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
Stefan_Dialog
Offline
Last seen:3 years 8 months ago
加入:2017-02-28 13:06
ble_gap_adv_stop不工作

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:
MT_dialog
Offline
Last seen:2 months 6 days ago
Staff
加入:2015-06-08 11:34
Hi Stefan_Dialog,

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