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

battery level service on Custom Profile

Hi

I'm trying to implement battery level on my custom profile. So I used battery.c and ble_bas.c files for the battery service from nodic's sdk nrf51822_v4.4.1.31827. I've made the modifications in main.c and attached the file below (MODIFICATIONS FOR BATTERY SERVICE ONLY)

But the issue is battery level always reports 100percent (ie; 64 as value in service) even-though I varied the input power between 2.5-3.6v on P1 header

Any thoughts??

Regards HPC

addition_in_main.c

  • Hi HPC,

    Your code looks okay to me. Just to get the basic stuff out of the way, have you disconnected the evaluation board from the PC form which you flashed your app before you connected your supply to P1 Header? And also has the battery been removed from the battery holder? My suspicion is that it is still sourcing power from the PC or the battery.

    Cheers, Balaji

  • Hi Balaji

    The problem was I didn't gave dispatcher for battery service events , that solved my problem

    Regards HPC

  • alright.. good to know you have it under control.

    Cheers, Balaji

  • Hello HPC , could you please let me know what modification you have made to rectify the error so that i can able to understand your problem because the question you posted is not clear to me am new tot his BLE so i am trying to understand your solutions