Question

I am new to BLE communication and as for now I am working on an android
to communicate against the TI CC2541 keyfob device.
My problem however is that I want to know when the user clicks on the Keyfob right side
button (the one which is normally used to transmit a discovery signal) after I am connected to the device
I have used Steven Rudenko's Github project to understand the communication basics
But I CANT FIND NO WHERE (Not even on TI's official Documents) how I can tell (On the client side)
If the right button is pressed.
Is it a service? do I have to register for some notification from the device? In case someone have a general guidance I would really appreciate the help.

Was it helpful?

Solution

BLE uses service-based architecture and can communicate using an attribute protocol (GATT Generic Attribute Profile). Service is a collection of characteristics, where a characteristic is an attribute which you can read, write, register for notifications and more.

The keys on the keyfob are represented by a service and there is a characteristic that hold the status of the buttons. I you should be able to register for notifications on this characteristic. (enable the Sensor for notification)

Checkout class TiKeysSensor in Steven Rudenko's project

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top