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.

CC2541 ADVANCED REMOTE CONTROL

Other Parts Discussed in Thread: CC2541

Hi,

I have CC2541 ADVANCED REMOTE CONTROL.

I want battery notifications from REMOTE.I am enabling the CCCD of battery service using gatttool .

But I am not getting any battery notification on value battery level value changed.


What might be the reason?

Thanks and Regards,

  • Hi Harshad,

    It should work. When debugging, put a breakpoint in battservice.c::battMeasure() on the line starting with 'adc = ', and connect via BTool or similar and enable the notification.
    You will then see that it breaks there, and if you press F10 to step, that there is an ADC value. If this value is more than 'max' then it will be set to 100%. Further, this function is called from BattMeasure() which will only send a notification if the current value is lower than the previous value.

    You could force a notification for fun by changing the resetvalue of static uint8 battLevel = 100; which is what BattMeasure measues against, to something more than 100. After enabling notification for battery, this notification should appear after 15 seconds.

    BR,
    Aslak
  • Hi Aslak,

    Thanks for the answer.. :)
    Currently I am not having the source code for remote control ..So not able to debug it..Also I am working on linux platform..
    But I got the battService.c file and I was going through it.
    I could see the notifications will be sent from ' bStatus_t Batt_MeasLevel( void ) ' function .
    But how this function will be called? Is it a callback? because, I didn't find call to this function from battService.c file.. If it's a call back where is that functionality implemented..

    Thanks and Regards,
    Harshad
  • Hi,

    You can download the BLE SDK which includes our advremote example from ti.com/ble-stack.

    The measurement function in our example is called from a periodic event that's scheduled once connected and this notification is enabled.

    BR,
    Aslak