1 of 1 people found this helpful
Yes. There is a confusion in the PDL. Please find the correction below.
Calling the API Cy_BLE_GetBatteryLevel(); generates the event CY_BLE_EVT_RADIO_VOLTAGE_LEVEL and the event parameter is the pointer of the type uint16_t. The user has to type cast the event param to uint16_t pointer and deference it to get voltage level in millivolts.
battery_level = (uint16_t *)eventParam;
The event CY_BLE_EVT_SET_SLAVE_LATENCY_MODE_COMPLETE will not be generated by calling Cy_BLE_GetBatteryLevel(). This is the typo in the PDL.
Thank you for pointing this out.
Thank you for the clarification. The attached is a very simple project that just trying to get the battery level. Do you know why is it returning 0x2700, 0x0600, 0x0000 values occasionally?
I am using a CYBLE-416045-02 prototyping kit, where 0x2700 = 9984 mV does not make quite much sense. Thanks!
That's strange. Please tell us how frequently you are reading the temperature and battery values.
Also please tell us how many times you are getting error values out of 100 times.