You are here

Data stored in CYBLE_EVT_GATTC_HANDLE_VALUE_NTF | Cypress Semiconductor

Data stored in CYBLE_EVT_GATTC_HANDLE_VALUE_NTF

Summary: 2 Replies, Latest post by Dharav Sarang on 04 Nov 2016 01:45 PM PDT
Verified Answers: 1
Last post
Log in to post new comments.
Dharav Sarang's picture
User
2 posts

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
 

jrow's picture
Cypress Employee
37 posts

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.

Dharav Sarang's picture
User
2 posts

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

Dharav

Log in to post new comments.