This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2640R2F: How to retrieve Connection Handle ID on ICall events

Part Number: CC2640R2F


Hello guys ,

on a Multirole Project (sdk_3_20_00_68) I need to manage multiple connections .

I need to get the connection handle , or any other useful info linked to the connection handle , of the Master who wrote a characteristic value . 

multi_role_processAppMsg(...) is sourced with pMsg  that does not contain any reference to the Connection Handle .

How I can workaround ?

Thank you,

Paolo

  • Hi Paolo,

    Assigning an expert to comment. Stay tuned.

  • Hi Paolo,

    You're right, the ATT_WRITE_REQ event (attWriteReq_t) does not contain a connection handle for the peer device. However when it's passed to the application it is packaged in a gattMsgEvent_t :

    /**
     * @brief GATT @ref GATT_MSG_EVENT message format.
     *
     * This message is used to forward an
     * incoming attribute protocol/profile message up to upper layer application.
     */
    typedef struct
    {
      osal_event_hdr_t hdr; //!< GATT_MSG_EVENT and status
      uint16 connHandle;    //!< Connection message was received on
      uint8 method;         //!< Type of message
      gattMsg_t msg;        //!< Attribute protocol/profile message
    } gattMsgEvent_t;

    So, when you are receiving the event in multi_role_processGATTMsg() you should be able to get the connection handle:

    pMsg->connHandle