The ZCL says what to do if maxInterval is 0.
Adding a reportableChange check to the reportAttrs(void) function fixes the issue.
for(u8 i = 0; i < ZCL_REPORTING_TABLE_NUM; i++){
pEntry = &reportingTab.reportCfgInfo;
if(pEntry->used && (pEntry->maxInterval != 0xFFFF) &&
zb_bindingTblSearched(pEntry->clusterID, pEntry->endPoint)){
pAttrEntry = zcl_findAttribute(pEntry->endPoint, pEntry->clusterID, pEntry->attrID);
if(pAttrEntry){
bool valid = 0;
u8 dataLen = zcl_getAttrSize(pAttrEntry->type, pAttrEntry->data);
if(!pEntry->maxIntCnt){
if((!zcl_analogDataType(pAttrEntry->type) && memcmp(pEntry->prevData, pAttrEntry->data, dataLen)) ||
(zcl_analogDataType(pAttrEntry->type) && reportableChangeValueChk(pAttrEntry->type, pAttrEntry->data,
pEntry->prevData, pEntry->reportableChange))){
valid = 1;
}
}else if(!pEntry->minIntCnt){
if((!zcl_analogDataType(pAttrEntry->type) && memcmp(pEntry->prevData, pAttrEntry->data, dataLen)) ||
(zcl_analogDataType(pAttrEntry->type) && reportableChangeValueChk(pAttrEntry->type, pAttrEntry->data,
pEntry->prevData, pEntry->reportableChange))){
valid = 1;
}else{
pEntry->minIntCnt = pEntry->minInterval;
}
}
|