Keep advertising in connection

6 posts / 0 new
Last post
meriororen
Offline
Last seen:3 years 8 months ago
加入:2015-08-12 13:45
Keep advertising in connection

Hi,

Is it possible to keep advertising when there is a connection going? If it is possible, how do I set this up?

Thanks

Device:
MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
嗨meriororen,

嗨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

ankitdaf
Offline
Last seen:2 years 9 months ago
加入:2015-09-03 20:14
Hi

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,

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi ankitdaf,

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

ankitdaf
Offline
Last seen:2 years 9 months ago
加入:2015-09-03 20:14
谢谢!我试着我t

谢谢!我试着我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.

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi ankitdaf,

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