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.

LP-EM-CC2340R5: How do I get a channel id?

Part Number: LP-EM-CC2340R5

Tool/software:

Hi, Ti

I need to send data through l2cap after reporting the BLEAPPUTIL_PAIRING_STATE_ENCRYPTED event.

How do I get the current channel id in app_pairing.c?

Best regards,

Preston

  • Hi, Ti

    I tried referencing the CID here

    void L2CAPCOC_signalHandler(uint32 event, BLEAppUtil_msgHdr_t *pMsgData)
    {
      if (!pMsgData)
      {
        // Caller needs to figure out by himself that pMsg is NULL
        return;
      }
    
      /*Handle the l2cap event */
      switch (event)
      {
        case BLEAPPUTIL_L2CAP_CHANNEL_ESTABLISHED_EVT:
        {
          l2capChannelEstEvt_t *pConnEvt = &((l2capSignalEvent_t *)pMsgData)->cmd.channelEstEvt;
          gL2CAPCOC_AppData.CID        = pConnEvt->CID;
          gL2CAPCOC_AppData.peerCID    = pConnEvt->info.peerCID;

    However, it appears that the CID is obtained only after reporting the BLEAPPUTIL_L2CAP_CHANNEL_ESTABLISHED_EVT event.

    The log shows that this happens after BLEAPPUTIL_PAIRING_STATE_ENCRYPTED

    When BLEAPPUTIL_PAIRING_STATE_ENCRYPTED reports, how do I get the CID I need to send data through l2cap?

    Best regards,

    Preston