This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Where is the code of reading battery level?

Hi Nordic team, I print logs at each function in ble_bas.c. I used the App of nRF connect to test BAS. I can see on_connect, on_disconnect and on_write at enabling/disabling notification. I cannot see the code of reading battery level when I pressed the button of reading battery level on APP. But I got the battery level correctly. I want to know where the source code of reading battery level is? Screenshot1.png

Parents Reply Children
  • I am tracing the source code of ble_bas.c in SDK11. I can get battery level correctly when I press the button (read battery level, please see the attach file in red circle) on APP. But I cannot see the source code of reading battery level in ble_bas.c. I want to know where it it. Enabling/disabling notification will run the function of on_write. Which function will be run if I read the battery level from APP? Thanks you very much.

Related