Sorting Bonded Devices

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I am developing a BLE Peripheral device.  This device can be bonded with 2 different centrals.  Say, for instance, I bond with a tablet as one device and a PC as the other.  When I power down the device, and pull it back up, if I read the stored bond infor, what would be a good way to flag one bond as the tablet, and one as the PC?  What are some stored bond data types that are unique enough I can compare to a "Device Type" struct saved to flash in order to flag the bonded device as a Tablet or a PC?

0 Likes
1 Solution
GyanC_36
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

Hello David,

  Every Bonded device will be assigned a unique bdHandle.

For Example: When first time your Peripheral device Connects and Bonds to the Tablet, The Tablet will be assigned a bdHandle (cyBle_connHandle.bdHandle=4  ) equal to 4 . Now when you Connects and Bonds to the PC , then the PC will be assigned a bdHandle=3.

Now, When next time you  connects to a tablet ,as soon as you connect , You can check the 'bdHandle' if the bdHandle is 4 which means your connected device is tablet.

-Gyan

View solution in original post

0 Likes
2 Replies
Anonymous
Not applicable

Wouldn't you just save metadata such as you describe with the bond information when you save it to flash?

Otherwise, bond data in-and-of-itself is too generic to use as a logic comparison imo.

0 Likes
GyanC_36
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

Hello David,

  Every Bonded device will be assigned a unique bdHandle.

For Example: When first time your Peripheral device Connects and Bonds to the Tablet, The Tablet will be assigned a bdHandle (cyBle_connHandle.bdHandle=4  ) equal to 4 . Now when you Connects and Bonds to the PC , then the PC will be assigned a bdHandle=3.

Now, When next time you  connects to a tablet ,as soon as you connect , You can check the 'bdHandle' if the bdHandle is 4 which means your connected device is tablet.

-Gyan

0 Likes