各位TI工程师:
大家好!最近在做一个可配置的电池电量上报周期的功能,在“ZCL”文档中也看了相关配置的功能。但是对“minimum reporting interval ”,“maximum reporting interval ”和“reportable change ”这几个参数,怎么确定“reporting”上报的间隔时间还是存在疑问。“ZCL”文档也没有说具体。请指导一下!谢谢!
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.
各位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 )
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( ); }
如果你说的每次上传时间间隔的决定如下: