This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2540, Keyfobdemo : Adding Notify option to Battery profile; Overlap in characteristic values



I am trying to add a notify option to the Battery service in the keyfobdemo sample application. Here is what i have done till now. 

- Declared a new BATTERY_NOTIFY_UUID in the battery.h file as 0xFFB3.

- In battery.c, added profile attribute variables, and added entries in the profile attribute table.

- Added cases for BATTERY_ATTR_NOTIFY in the SetParameter, GetParameter and ReadAttributCB functions

- In battery.h, I initialised a variable called BATTERY_NOTIFY_ENABLE to 1 (this is the attribute value)

 

After doing this, I compiled the code and downloaded it to the keyfob.

As I can see, reading using UUID 0xFFB3 returns ATTR_NOT_FOUND,but reading UUID 0xFFB2 returns 04 01 (which is expected to be 04 00, the BATTERY_STATE value)

If I hard-change value of BATTERY_NOTIFY_ENABLE in the code to 0, the value read using 0xFFB2 is now 04 00 (as expected), but the UUID 0xFFB3 is still not readable. 

 

Why the overlap between attribute values? What am I doing wrong here? 

Why is the attribute 0xFFB3 not initialised?