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

Passkey security for particular services.

Hi,

I am Working on a BLE application in which I do not want to expose certain services until I am securely paired/bonded to a valid device. The problem is that during discovery, it seems that all primary services are exposed to the client in order for it to finalize the connection. Is there any way to hide some services until a later time?

I have gone through this link developer.mbed.org/.../HeartRateSecService.h and followed the way to find out the solution but still not succeeded.

Please help me.

Parents Reply Children
  • To add to this, the Bluetooth spec mandates that all services, characteristics and descriptors should be discoverable. You are allowed to protect attributes from being read or written to, but not allowed to hide services. The idea is that a device should be able to connect with your device, perform a discovery, then decide if there is something interesting there. If not, it might disconnect before even attempting to pair or bond. To me, it sounds like you want to protect your service, using the macros written in the answer above. Having a "secret" service that pops out after certain criteria is met will lead to much work if you want to stay compliant to the Bluetooth specification. Namely by forcing any device that connects to rediscover your whole database every time, and again after encryption.

Related