Tool/software:
Hi, Ti
*SDK version: 9.11.00.18 ,example: car_node
I'm currently debugging the Connection Monitor. After the Connection_ConnEventHandler received the BLEAPPUTIL_LINK_ESTABLISHED_EVENT, an attempt to retrieve connection data via CMS_GetConnData failed, returning error code 0x05(CM_INVALID_PARAMS).
static void Connection_ConnEventHandler(uint32 event, BLEAppUtil_msgHdr_t *pMsgData)
{
#ifdef FII_CM
cmsConnDataParams_t cm_data;
uint16_t cm_data_size;
cmErrorCodes_e status;
#endif
if (pMsgData != NULL)
{
switch (event)
{
case BLEAPPUTIL_LINK_ESTABLISHED_EVENT:
{
gapEstLinkReqEvent_t *pGapEstMsg = (gapEstLinkReqEvent_t *)pMsgData;
// Add the connection to the connected device list
Connection_addConnInfo(pGapEstMsg->connectionHandle, pGapEstMsg->devAddr);
PHSCA_ESELOG_PRINTF("%s", "Conn status: Established\r\n");
#if defined(RANGING_CLIENT) && !defined(RANGING_CLIENT_EXTCTRL_APP)
// Call MTU exchange
AppGATT_exchangeMTU(pGapEstMsg->connectionHandle, MAX_PDU_SIZE);
#endif
BLEAppUtil_registerConnNotifHandler(pGapEstMsg->connectionHandle,GAP_CB_CONN_EVENT_ALL);
#ifdef FII_CM
status = CMS_InitConnDataParams(&cm_data);
if(status == CM_SUCCESS)
{
cm_data_size = CMS_GetConnDataSize();
status = CMS_GetConnData(pGapEstMsg->connectionHandle, &cm_data);
if(status == CM_SUCCESS)
{
PHSCA_ESELOG_PRINTF("CMS_GetConnData success! Data size[0x%4x]\r\n", cm_data_size);
}
else
{
PHSCA_ESELOG_PRINTF("CMS_GetConnData fail![0x%2x]\r\n", status);
}
}
else
{
PHSCA_ESELOG_PRINTF("%s\r\n", "CMS_InitConnDataParams fail!");
}
#endif
break;
}
}
log:
Is my workflow correct? Why did it fail?
Best regards!
Preston