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:
嗨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!
嗨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
请让我分享一个建议的实施。您可以启动广告并设置计时器。在计时器的到期时,您应该停止广告,一旦停止您可以开始扫描,等待扫描完成(如果您在GAP_GEN_DISCOVERY中扫描或设置额外的计时器并取消扫描过程)。扫描完成后,再次启动广告。请检查下面的步骤以执行角色切换。SDK的BLE_APP_PERIALAL示例在我的侧面使用。
- 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.
嗨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