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.

cc2540 simpleBLEcentral

Other Parts Discussed in Thread: CC2541

Hello everyone,

I need to know how notification or indication is handled in simpleBLEcentral project. All I have found is this function,  GATT_RegisterForInd( simpleBLETaskId );  // Register to receive incoming ATT Indications/Notifications. I have to make use of the data sent through notification.

Can anyone tell me how to access notification data?

Regards,

maharjanbk

  • Hi Maharjanbk,

    Have a look at the simpleBLECentralProcessGATTMsg function, found in simpleBLECentral. That's where you'll fetch your GATT messages, such as notifications and indications. 

    Best Regards

  • Hi Nick,

    Thank you for your prompt response.

    I could see there is a value assignment statement  uint8 valueRead = pMsg->msg.readRsp.value[0];  in the function you described. This is just one byte data but notifications could be several bytes long.

    Just wanted to know your opinion, is it that if I am sending multiple byte notification, the size should be fixed and I need to keep track of bytes that I have received?

    Please look into my I2C slave on cc2541 post also when you have time.

    Regards,

    maharjanbk

  • Hi,

    So, you can check the length of the notification with pMsg->msg.handleValueNoti.len and access the data by pMsg->msg.handleValueNoti.value for example. Might be that looping through value[i] until i=len is you solution.

    Best Regards

  • Hi Nick,

    Thank you very much for the response. I will try out this suggestion.

    Regards,
    maharjanbk 

  • hii...

    can i register for single characteristic's notification..??? plz tell me which api shud i use??/

  • Hi thereMaharjanbk ,

    I am newbie to ble and RTOS ! ,so please bear with me on this. In BlEperipheral we have configured notification for Characteristic 4 right? and in the periodic event the value gets updated( correct me if i am wrong ) .But why are we unable to see the change in central? Or why is it not getting printed in the LCD???