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.

Compiler: Modify the battery value of the battery service

Other Parts Discussed in Thread: CC2640, BLE-STACK

Tool/software: TI C/C++ Compiler

Hi All

The cc2640 is mount on my customer’s board.

So, I need to use command to get battery value with customer’s mcu.

Then replace the value of battery service.

But I don't know how to do.

Environment
BLE 4.2
SDK 2.2.2

Process
<glucose.c>
GlucoseSensor_init()
{
      ......
      Batt_AddService();
      Batt_Register(BattCB)
      ......
}
void BattCB(uint8_t event)
{
      if (event == BATT_LEVEL_NOTI_ENABLED<==========  I hope to get event when user press "read" on phone app. (event == BATT_READ????)
      {
            // send command to get battery value from customer's mcu
            send_cmd(&batt_value);
      }
}
void get_packetCB()
{
      //use uart to get data from customer's mcu.
      //uart data --> batt_value;
}

<battservice.c>
static bStatus_t battReadAttrCB(........)
{
      ......
      pValue[0] = batt_value;   <=========== Replace the battery value.
      ......
}