Data stored in CYBLE_EVT_GATTC_HANDLE_VALUE_NTF

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable


I have been using CYBL10161-56LQXI where currently I am working over the BLE v4.2.
I have a question about the data that we store in CYBLE_EVT_GATTC_HANDLE_VALUE_NTF. 

   


What I know till now is about CyBle_GattsNotification() that it is a non-blocking function and what it does. 
I have save the data to be sent to the client over, CYBLE_GATTS_HANDLE_VALUE_NTF_T  my_variable; // my declaration
 

   

and  in some function this is what I use,
 my_variable.value.val           = MyData;
 my_variable.value.actualLen = length;
 my_variable.value.len           = length;
 my_variable.attrHandle         = charAttrHandle;
So, my question is, do we need the memory that we are using to set up the descriptor(my_variable)  to exist after my call returns? As right now I am saving it on the stack, which means at some point I am going to lose it. 

Dharav
 

0 Likes
1 Solution
Anonymous
Not applicable

Hello Dharav,

   

Once you call the CyBle_GattsNotification() function and it returns with a 0 (success) result, the data to be transmitted has already been stored in the BLE stack's internal packet buffers. Unless your application needs to do something else with it, there is no need to retain it separately.

View solution in original post

0 Likes
2 Replies
Anonymous
Not applicable

Hello Dharav,

   

Once you call the CyBle_GattsNotification() function and it returns with a 0 (success) result, the data to be transmitted has already been stored in the BLE stack's internal packet buffers. Unless your application needs to do something else with it, there is no need to retain it separately.

0 Likes
Anonymous
Not applicable

Alright. Thanks for the quick reply. I really appreciate it.

   

Dharav

0 Likes