Advanced Computer Systems - Bluetooth Clicker Project

Adel Zoabi - 305141418

Karim Mahamed - 302383682

What We Did

At first we did research about the HID over GATT Profile according to Bluetooth Docs.

This in order to list down all profiles that we needed to include into the project before putting down the design.

Our project was based on the ProjectZero template that we imported from SimpleLinkAcademy repos. We had to add the following profile dependencies:

Having added the above-mentioned profiles it was necessary to implement the HID Keyboard Service by registering and linking GATT attributes to the GATT server (in this case, the CC2650 chip)

The implementation of the HID Keyboard Service is composed of:

The HID Keyboard Service works with a specific message type and these specs we found in this link

The message structure is defined in a struct object defined in the GATT Profile, which we included in our project.

For a short summary of the Keyboard Service implementation:

  1. Initiation of GAP Role parameters
  2. Starting the HID Keyboad Service
  3. Registeration of the HID callback function (to listen for incoming events)
  4. Initiate the HID

Additionally, we had to initiate the board key handlers. The KeyPress handler sends HID reports containing the following:

We have used the App Event Struct as defined in the util common function declarations. The use of this struct is to enqueue incoming press events in a message queue to keep track of all events.

Then, we created a Task with an infinite loop that operates as message queue processor to handle each KeyPress event. This handler knows how to translate press events to keyboard recognized characters.

As an initial proof of concept, we have registered the two existing buttons on the CC2650 to be translated into the characters 'A' and 'B' when clicking the Left and Right buttons accordingly.

EXTRA: We designed an extension to overcome the limitation of existing physical buttons on the board. To do so, we added the PIN_DIO22 to the board events handlers, and we handled the PIN pullup as a key press. From this point, we can enqueue the event to the message queue. The design of the handler is abstract, meaning that the rest of the translation fits in the above-mentioned procedure. (Regardless of how the event was registered).

Use Case

 We went even further by connecting a physical button to a breadboard that closes a circuit between the DIO22 PIN and the 5 volts PIN. This recreated a physical button, and equivalently could add more buttons (up to the amount of available pins).

This setup (3 physical buttons) motivated us to implement a simple binary keyboard. The two buttons on the CC2650 will be utilized as the 0 and 1 binary inputs. The third button will be the RETURN. The app will receive a binary input from the Chip and evaluate the ASCI value of an octet of bits, and append them to some output.

Demonstration on live.

Problems & Solutions

The project was of fairly moderate difficulty and definitely put to use all theoretical and practical material that we learned in class. In addition, We learned many other project related things on the individual aspect from difficulties that we faced while developing.