Hi,
Is it possible to keep advertising when there is a connection going? If it is possible, how do I set this up?
Thanks
Keywords:
Device:
Hi,
Is it possible to keep advertising when there is a connection going? If it is possible, how do I set this up?
Thanks
嗨meriororen,
Yes it is possible. Please have a look at this FAQ and try to implement with the proximity sensor just ti get startedhttp://support.dialog-semiconductor.com/faq/how-advertise-while-connected
Thanks MT_dialog
Hi
I tried to implement this based on the FAQ but the screenshots seem outdated. The functions mentioned in the FAQ don't exist in SDK 5.0.2.1 or the examples.
Can you possibly share an updated version ?
Thanks,
Hi ankitdaf,
Lets take for example the ble_app_peripheral project.
1. In the user_on_connection you can change the default_app_on_connection with your custom function, but for just a test you can alter the default_app_on_connection. Comment out the default_advertise_stop_operation() and place the gapm_env.connections = 0; and the app_easy_gap_undirected_advertise_start();.
2. Place the test flag wherever needed.
3. In the gapc_disconnect_ind_handler() place the gapm_env.connections = 0;
4. In the user_on_disconnect place the app_easy_gap_advertise_stop() and the test_flag = true.
5. And the in swicth case GAPM_ADV_UNDIRECT, place the snippet as indicated by the picture, and you should be ready to go.
Thanks MT_dialog
谢谢!我试着我t worked.
I did not create a test flag or use it. I understand that in the steps you suggested, you are stopping and restarting advertising on disconnect. Is that necessary ? Or is it safe to skip that ? I am restarting advertising without timeout when connection is made.
Hi ankitdaf,
Its just a safe way to do it, if you dont want that, you can try without stopping advertising when disconnected your device will continue to advertise.
Thanks MT_dialog