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

How the Service Discovery Works?

Hi, What will happen when we press the service discovery button in the master control panel? do we get any event like BLE_GAP_EVT_CONNECTED? I couldn't find any detail regarding this in the documents i have. Please provide me some information on this. I need to implement one logic, when i get service discovery request, which may consume 10 to 20 sec time. Is it possible?

Regards, Balaji

Parents
  • You don't get any events on a service discovery being done from a Central device, since there isn't anything you can do about it anyway. The GATT Table is entirely contained inside the softdevice's memory, and hence there shouldn't be any reason to notify the application about it.

    You should therefore either trigger your action on the CONNECTED event, or on a write to a particular characteristic. Is there any specific reason this won't work for your use case?

  • It sounds as if you should rather use this button press to start advertising. If your device is not advertising, it's not possible to connect to it.

    If you use bonding, you could also use whitelisting to normally only make the device connectable for known Centrals, but when the button is pressed also allow new devices to connect.

Reply Children
No Data
Related