You are here

Connection Handles | Cypress Semiconductor

Connection Handles

Summary: 1 Reply, Latest post by roit on 22 Aug 2015 05:27 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
user_516327008's picture
11 posts

From what I've seen, for connection handles, you simply declare something along the lines of:

CYBLE_CONN_HANDLE_T  connectionHandle;

and it stores the connection handle when connected. My question is how do you differentiate connection handles? If I want to, for example, send a write request to another device, how do I put in the correct connection handle? 

roit's picture
Cypress Employee
221 posts

That is not true. Simply declaring the connection handle will not store a value to it.

If you declare something like 'CYBLE_CONN_HANDLE_T  connectionHandle' and want to use 'connectionHandle', then you need to assign the connection handle value at every connection under 'CYBLE_EVT_GATT_CONNECT_IND' event in Event Handler function of BLE.


            connectionHandle = *(CYBLE_CONN_HANDLE_T *)eventParam;


Rather assigning the value in application and using it, you can use the stack variable 'cyBle_connHandle' directly as it is automatically updated by stack whenever a new connection is made.

Log in to post new comments.