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.

How to Enable Battery Profile Notification

Hello,

I need to Enable Notification for Battery Profile in my cc2650 Device.
I saw some PDf and Found that the handle to read is 0x2f and to write is 0x30.
So when i used them i am getting Value 
Read RSP: 67
and write error: 03

I tried this using CC2541 and I am able to read the Value correctly and Write is also Happening but the Problem is its not able to Enable Notification.

Can someone please help me out to make it Work.

  • Hello Pradeep,

    Handles are only relative to a given server configuration, so you can't reference a handle from one document and apply to a different server. To enable Notifications, you need to write to the Client Characteristic Config Descriptor (CCCD) for the Battery Service UUID (0x180F).

    Best wishes
  • Hey JXS,

    I am able to read Battery Level using UUID i.e 0x180F
    But the problem is i need to enable Notification.
    Can u guide me in doing the Same.

    Thanks
  • Hi Pradeep,

    Sure. Please see the "SimpleLink Academy" overview page on the TI BLE Wiki. There is a task under BLE Fundamentals entitled "Get Notified". This can serve as a guide for enabling Notifications.

    I encourage you to complete the entire SimpleLink Academy workshop since you are new to BLE.


    Best wishes

  • Hey JXS,

    Thank you very much. It was very helpful for me.

    I got the Handle values and While using Ble device Monitor i am able to activate notification.

    I tried the same into central code to activate the Notification

    these are the details:

    0x1F 31 0x2902 Client Characteristic Configuration

    0x1E 30 0x2A19 Battery Level

    So using the sample code which was given in the Central code i developed this code









    attWriteReq_t pWReq; attReadReq_t pRReq; char status; // Start or cancel RSSI polling if (state == BLE_STATE_CONNECTED) { pWReq.pValue = GATT_bm_alloc(connHandle, ATT_WRITE_REQ, 1, NULL); if ( pWReq.pValue != NULL ) { delay_ms(200); pWReq.handle =0x001F; pWReq.len = 2; pWReq.pValue[0] = 0x01; pWReq.pValue[1]=0x00; pWReq.sig = 0; pWReq.cmd = 0; status = GATT_WriteCharValue(connHandle, &pWReq, selfEntity); if ( status != SUCCESS ) { GATT_bm_free((gattMsg_t *)&pWReq, ATT_WRITE_REQ); } delay_ms(500); // LCD_WRITE_STRING("RSSI Cancelled", LCD_PAGE4); pRReq.handle=0x001E; VOID GATT_ReadCharValue(connHandle, &pRReq, selfEntity); } }

    I am able to read the Battery Level which is correct.
    and Write is also happening as its getting increased every time when write happen but i'am not able to get the notified data which i am getting properly in phone and BLE Device Monitor.

    So can u please guide me where i am going wrong??

    Thanks

  • Hi Pradeep,

    Since you have a good working reference (BLE Dev Monitor), I would suggest taking a BLE air packet sniffer trace of the good case and compare it to your case. That should give you a clue as to if the notifications are being sent and drive the next steps.

    Best wishes