This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how make my keyfob reconnect to the master

Other Parts Discussed in Thread: CC2540

I use keyfob for my CC2540. I want to make my device reconnect to the master after a connect timeout initiatively. How can i do with it?Thanks!

  • Have the keyfob auto broadcast on start. There is a bool for this in the startup function evt. The remainder of this is done in the master. When it senses a disconnect , it must rescan for any broadcasting devices and try to reconnect. 

    If you are developing in ios, apple keeps track of the recent peripherals you connected to in a cache, so your going to want to scan for those as well when trying to reconnect. 

  • Hi Jonathan:

       Thanks for your replay.

        May the peripheral initiate the reconnect after a disconnect? We plan to make 2540 initiate the reconect, is it feasible?

  • It is to my understanding that the peripheral only broadcasts its advertisement packets and the master must initiate the connection, but I could be wrong.

  •  Hi,

    A Peripheral device is essentially link-layer slave, so it is not expected to initiate connections. If device that implements both Peripheral and Central roles is required, it is possible to switch roles while program runs.

    Basically, if you want Peripheral device to control whether it permits connection or not, you have such option as altering whitelist, or just disabling advertising altogether (you can disable/enable it as you want, at any time).

    BR, 

    Oleg