- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
case CYBLE_EVT_GATT_CONNECT_IND:
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
case CYBLE_EVT_GATT_CONNECT_IND:
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.