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.

Write BATTERY_CHECK_PERIOD on BTool

Other Parts Discussed in Thread: CC2541

Hi,

I'm using the cc2541 DK-MINI. I set the Keyfob as a slave and I would like to configure on BTool the value of the interval measurement as it seems possible in the thermometer service. It's already possible by changing the constant BATTERY_CHECK_PERIOD  within  "KeyfobDemo.c" but I would like to not come back on the soft each time I have to change the interval measurement. Thank you for helping.

Best Regards,

Boris NOMERTIN

  • The battery service is not designed to work that way; however it should be possible to make this with some modification. You would need to add a new characteristic to the battery service, and then every time a value is written to that characteristic you would change the OSAL timer to use the new value.

    You can find similar examples of this in the SensorTag application. If you look at the accelerometer service there is a characteristic "sensorPeriod". When this value is changed remotely (e.g. from BTool), a callback to the application changes the timing for the next sensor reading.

  • Thank you for your help,

    I added a new "period" characteristic to the battery service but the problem remains. The parameter which changes the period is BATTERY_CHECK_PERIOD an it is already set in the code (# define BATTERY_CHECK_PERIOD  10000) so even if you try to overwrite it on BTool, the period remains the same as defined in the code.