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-CC2652RB:ZCL_CMD_CONFIG_REPORT 消息无法到达端点

Guru**** 1810440 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1393905/lp-cc2652rb-zcl_cmd_config_report-messages-do-not-reach-endpoint

器件型号:LP-CC2652RB

工具与软件:

你好。 我试图捕获一些报告时间配置以有效地采样传感器、我似乎在解析这些消息时遇到了问题。

我定义了 ZCL_REPORT 、为定义了一个函数  ZCL_CMD_CONFIG_REPORT  但无法到达断点 zclSampleTemperatskirtaku Sensor_Process ConfigReportCmd 并检查我的函数实现。 但是、即使我看不到消息、协调器也始终会发出报告已成功配置的消息。

static uint8_t zclSampleTemperatureSensor_ProcessIncomingMsg(
        zclIncoming_t *pInMsg)
{
    uint8_t handled = FALSE;
    switch (pInMsg->hdr.commandID)
    {
#ifdef ZCL_READ
    case ZCL_CMD_READ_RSP:
        zclSampleTemperatureSensor_ProcessInReadRspCmd(pInMsg);
        handled = TRUE;
        break;
#endif
#ifdef ZCL_WRITE
    case ZCL_CMD_WRITE_RSP:
        zclSampleTemperatureSensor_ProcessInWriteRspCmd(pInMsg);
        handled = TRUE;
        break;
#endif
#ifdef ZCL_REPORT
    // See ZCL Test Applicaiton (zcl_testapp.c) for sample code on Attribute Reporting
    case ZCL_CMD_CONFIG_REPORT:
      zclSampleTemperatureSensor_ProcessInConfigReportCmd( pInMsg );
      break;
      
      case ZCL_CMD_READ_REPORT_CFG:
      //zclSampleTemperatureSensor_ProcessInReadReportCfgCmd( pInMsg );
      break;
    case ZCL_CMD_CONFIG_REPORT_RSP:
      //zclSampleTemperatureSensor_ProcessInConfigReportRspCmd( pInMsg );
      break;
    case ZCL_CMD_READ_REPORT_CFG_RSP:
      //zclSampleTemperatureSensor_ProcessInReadReportCfgRspCmd( pInMsg );
      break;

    case ZCL_CMD_REPORT:
      //zclSampleTemperatureSensor_ProcessInReportCmd( pInMsg );
      break;
#endif
    case ZCL_CMD_DEFAULT_RSP:
        zclSampleTemperatureSensor_ProcessInDefaultRspCmd(pInMsg);
        handled = TRUE;
        break;
#ifdef ZCL_DISCOVER
    case ZCL_CMD_DISCOVER_CMDS_RECEIVED_RSP:
        zclSampleTemperatureSensor_ProcessInDiscCmdsRspCmd(pInMsg);
        handled = TRUE;
        break;

    case ZCL_CMD_DISCOVER_CMDS_GEN_RSP:
        zclSampleTemperatureSensor_ProcessInDiscCmdsRspCmd(pInMsg);
        handled = TRUE;
        break;

    case ZCL_CMD_DISCOVER_ATTRS_RSP:
        zclSampleTemperatureSensor_ProcessInDiscAttrsRspCmd(pInMsg);
        handled = TRUE;
        break;

    case ZCL_CMD_DISCOVER_ATTRS_EXT_RSP:
        zclSampleTemperatureSensor_ProcessInDiscAttrsExtRspCmd(pInMsg);
        handled = TRUE;
        break;
#endif
    default:
        break;
    }

    return handled;
}

我的功能是解析报告时间并获取采样时间

static uint8_t zclSampleTemperatureSensor_ProcessInConfigReportCmd(zclIncoming_t* pInMsg )
{
    zclReportCmd_t *pReportCmd = pInMsg->attrCmd;
    uint16_t minReportingTime = 1000;

    for (int i = 0; i < pReportCmd->numAttr; i++)
    {
        if (minReportingTime > *(uint16_t*)pReportCmd->attrList[i].attrData)
        {
            minReportingTime = *(uint16_t*)pReportCmd->attrList[i].attrData;
        }
    }

    if (minReportingTime)
    {
        gMeasurementSleepMS = minReportingTime * 1000;
    }

    return (TRUE);
}