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

Example for combined HID/UART XML (nRF8001-Arduino)

Hi all,

I have been trying to combine the UART and hID Keyboard examples into a single application. I want to use the HID part to send specific keystrokes using buttons on my Arduino. I want to use the UART part for a fairly limited command/control connection.

What I have done: Merged both XML definition files into a single one. Merged all arduino code into a single project. Commented out unused code sections Added my own button handling for the HID part (which works)

Where am I stuck: If I follow the HID example, my HID part works perfectly. Trying to add the UART part of the XML doesn't change anything, and doesn't seem to expose any additional services (ex. the nRF app doesn't work)

If I follow the UART example, I can't get pairing to function properly. (Android: Unable to communicate with device) This happens when I change SecurityLevel to 1.

I refrained myself from pasting large portions of the examples here. The critical part of the XML seems to be the Gapsettings section.

Ex. HID defines SecurityLevel=1, while UART defines SecurityLevel=0. The reverse is for IoCapabilities. There are several other minor differences between the two xml examples. I have tried many combinations.

I have googled a lot on the subject, but no other examples seem to exist besides the ones from Nordic, and any link to the nordic or bluetooth web pages seem to be out of date (and no longer available).

I could use a small push in the right direction generating a working XML file with arduino code.

With kind regards, Rory

Related