1 Reply Latest reply on Aug 22, 2015 5:27 AM by rohitk_

    Connection Handles

      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? 

        • 1. Re: Connection Handles

          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.