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.

关于“Configure Reporting Command ”配置上报的问题

各位TI工程师:

       大家好!最近在做一个可配置的电池电量上报周期的功能,在“ZCL”文档中也看了相关配置的功能。但是对“minimum reporting interval ”,“maximum reporting interval ”和“reportable change ”这几个参数,怎么确定“reporting”上报的间隔时间还是存在疑问。“ZCL”文档也没有说具体。请指导一下!谢谢!

  • 这个可以对应bdb  report 的设置去看一下。

    #ifdef BDB_REPORTING
      //Adds the default configuration values for the temperature attribute of the ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT cluster, for endpoint SAMPLETEMPERATURESENSOR_ENDPOINT
      //Default maxReportingInterval value is 10 seconds
      //Default minReportingInterval value is 3 seconds
      //Default reportChange value is 300 (3 degrees)
      Req.attrID = ATTRID_MS_TEMPERATURE_MEASURED_VALUE;
      Req.cluster = ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT;
      Req.endpoint = SAMPLETEMPERATURESENSOR_ENDPOINT;
      Req.maxReportInt = 10;
      Req.minReportInt = 3;
      memcpy(Req.reportableChange,reportableChange,BDBREPORTING_MAX_ANALOG_ATTR_SIZE);
    
      Zstackapi_bdbRepAddAttrCfgRecordDefaultToListReq(appServiceTaskId,&Req);

  • 如果你想解析这个command 我们有专门的函数:
    * @fn zclParseInConfigReportCmd * * @brief Parse the "Profile" Configure Reporting Command * * NOTE: THIS FUNCTION ALLOCATES THE RETURN BUFFER, SO THE CALLING * FUNCTION IS RESPONSIBLE TO FREE THE MEMORY. * * @param pCmd - pointer to incoming data to parse * * @return pointer to the parsed command structure */ void *zclParseInConfigReportCmd( zclParseCmd_t *pCmd )

  • 这三个参数分别是:
    uint16 minReportInt; //!< minimum reporting interval
    uint16 maxReportInt; //!< maximum reporting interval, 0xFFFF=off

    uint8 *reportableChange; //!< reportable change (only applicable to analog data type)
    //!< - the size depends on the attribute data type
  • void bdb_RepProcessEvent( void )
    {
      bdb_clusterEndpointArrayIncrementAll( bdb_reportingNextEventTimeout, BDBREPORTING_FALSE );
      uint8 minIndex =  bdb_clusterEndpointArrayGetMin( );
      if( minIndex == BDBREPORTING_INVALIDINDEX )
      {
        return;
      }
       uint16 minVal = bdb_reportingClusterEndpointArray[minIndex].consolidatedMaxReportInt - bdb_reportingClusterEndpointArray[minIndex].timeSinceLastReport;
       if( minVal>0 )
       { 
         bdb_reportingNextEventTimeout = minVal;
       }
       else
       {
         //Something was triggered, report clusterEndpoint with minIndex 
         bdb_reportingNextClusterEndpointIndex = minIndex;
         bdb_RepReport( BDBREPORTING_INVALIDINDEX );
         bdb_clusterEndpointArrayUpdateAt( minIndex, 0, BDBREPORTING_IGNORE, BDBREPORTING_IGNORE );
         bdb_reportingNextEventTimeout = 0;  
       }
       bdb_RepRestartNextEventTimer( );
    }

    如果你说的每次上传时间间隔的决定如下:

  • 谢谢!那我需要用“ZStatus_t zcl_SendConfigReportCmd( uint8 srcEP, afAddrType_t *dstAddr,
    uint16 clusterID, zclCfgReportCmd_t *cfgReportCmd,
    uint8 direction, uint8 disableDefaultRsp, uint8 seqNum )”函数去设置这些参数的时候,*reportableChange的值该是多少?
  • zcl_SendConfigReportCmd中的reportableChange你只改变间隔不需要去填写,除非你要改变。
    如果你要填写就去炒一下sensor 那个demo里面的写法。