This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can we connect directly to BT device with MAC ID only

Hello Everyone,

Scenario is i am getting some commands from Master(Android based Mobile App) to start some function , After i get the commands i disconnect from master with this function sd_ble_gap_disconnect () and stops advertising and then i expect no other BT device will able to connect me until and unless i start advertising .

But the case is even though my device is not advertising master device is able to connect my device with the help of MAC ID it has stored before.

So now , how can i prevent my device from connecting to the master if i am not advertising.

Thanks & Regards Asma

Parents
  • It is impossible to connect to a device that is not advertising, so I think that your problem is that you are still advertising after calling sd_ble_gap_disconnect.

    Calling sd_ble_gap_disconnect does not (as far as I know) ensure that advertisement is stopped.

    You need to call sd_ble_gap_adv_stop() to ensure that nothing is able to connect to your device.

Reply
  • It is impossible to connect to a device that is not advertising, so I think that your problem is that you are still advertising after calling sd_ble_gap_disconnect.

    Calling sd_ble_gap_disconnect does not (as far as I know) ensure that advertisement is stopped.

    You need to call sd_ble_gap_adv_stop() to ensure that nothing is able to connect to your device.

Children
Related