Can DA14585 scan or broadcast the Bluetooth information around without disconnecting the connection (active connection of the mobile phone). If there is a reference routine or related documents or interfaces to check it? Thank you! addtion:why the DA14580 cannot implement this function, is it the reason for the protocol stack version?
Device:
Hi moiify,
According to your description, I assume that the DA14585 is acting as a Peripheral because it is connected with a Mobile phone (Central). Keep in mind that according to Bluetooth LE specifications, the device cannot act both as Peripheral and as Central at the same time. If my understanding is right and the DA14585 is configured as Peripheral, it is possible to advertise while it is in connected state. I am not sure which SDK example are you using or if you have a custom code, but when a connection is established with a peer device (the mobile phone in your case), the user_app_connection() callback is triggered. To do so, when this callback is triggered, you should restart advertising by calling user_app_adv_start().
Thanks, PM_Dialog
I am very appreciate for your answer! I am using the 14858 SDK 6.0.10.I find the call and structure : cmd = app_gapm_configure_msg_create(); cmd->role = GAP_ROLE_ALL; I don't know if this works... Addition,Can I use 14585 to advertise while scanning?I am searching for the answer to the question,thank you!
Hi moiify,
根据蓝牙LE规范体制m is not allowed to act both as a Central and as a Peripheral at the same time. Since you are using DA14585, you should perform role switching from Peripheral to Central GAP configuration and vice versa. By setting the role to GAP_ROLE_ALL, this means that you can either advertise (peripheral role) or scan (central role). It’s not possible to do both simultaneously
Please let me share a suggested implementation for this. You can start advertising and set up a timer. Upon timer’s expiration, you should stop advertising and as soon as it stops you can start scanning and either wait for the scan to complete (if you are scanning in GAP_GEN_DISCOVERY or set an additional timer and cancel the scanning procedure). When the scanning is completed, start the advertising again. Please check the steps below in order to perform role switching. The ble_app_peripheral example of the SDK is used in my side.
- Change in the user_config.h file the .role member of the user_gapm_conf to GAP_ROLE_ALL.
- Create a user_scan_start() function in order for the device to start scanning:
- In the user_app_adv_start() function there is a timer that starts up in order to stop the advertising after about 30 seconds, so we are going to use that in order to stop the advertising.
- So in the callback of the timer adv_data_update_timer_cb() instead of updating of the advertising string,invoke the app_easy_gap_advertise_stop() function.
- In the user_app_adv_undirect_complete() function invoke the user_scan_start() function, so that when the device stops advertising to start scanning.
- In order to stop scanning i won’t use an additional timer in order to cancel the command, but i will use the timeout of the scanning itself.
- To start advertising as soon as the scanning ends create a function user_on_scanning_completed() and from that function invoke the user_app_adv_start();
Thanks, PM_Dialog
thank you for your answer! It really helped me。 thank you again.
Hi moiify,
Glad that my answer was helpful and thanks for accepting it. If you have any follow up question, please create a new forum thread.
Thanks, PM_Dialog