Connecting to a specific bonded Host

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
FriehoffT
 
Posts: 56
Joined: Wed Sep 11, 2019 7:30 am

Connecting to a specific bonded Host

Post by FriehoffT »

I am pretty much done with building a BLE HID Keyboard and Mouse using an ItsyBitsy nRF52840.

The keyboard code works great and does all that I wanted to achieve.
Also reconnecting to a paired/bonded host works flawlessly.

Now I want to enhance my code to be able to switch from the keyboard to the host the keyboard is connected to.

Imagine a scenario where the keyboard is bonded to a PC, an IPad, and an iPhone.
All three hosts are on the same table / in the same room and the user wants to direct the keys temporarily at one time to the PC and at another time to the iPad or iPhone.

Can anyone give me a hint where to find something about this in the documentation or on how to achieve this or point me to sample code where it can be seen how this is coded?

Thanks

User avatar
danhalbert
 
Posts: 4651
Joined: Tue Aug 08, 2017 12:37 pm

Re: Connecting to a specific bonded Host

Post by danhalbert »

Normally, the peripheral sends "undirected" advertisements, and accepts connections from any central. You can have multiple peripheral connections at once (but not many: 2 or 3). You can also send "directed" advertisements, which send an address, asking that a particular central connect. Use the `directed_to` argument in `start_advertising`.

A few people have tried these multiple connections, and I think have had varying success. It's not well tested.

[moving to CircuitPython forum]

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”