找回密码
 立即注册

微信扫码登录

查看: 201|回复: 5

Reporting crashed, when maxInterval is 0! Cyclic reboot.

[复制链接]

9

主题

23

回帖

241

积分

华贵铂金

积分
241
发表于 2025-6-12 03:18:44 | 显示全部楼层 |阅读模式 来自 俄罗斯
information
说明:   建议参照本版块置顶帖内容输入必要信息
芯片型号: tlsr8258
SDK及版本: V3.7.1.2_Patch_0001(PR)

Hi.

sharex-08-22-32-307.jpg


Bug in function reportAttrs()


sharex-22-17-42-693.jpg

9

主题

23

回帖

241

积分

华贵铂金

积分
241
 楼主| 发表于 2025-6-12 03:25:25 | 显示全部楼层 来自 俄罗斯
Sorry. Cyclic reboot, if watch_dog enabled. If disabled, no return from reportAttrs().

13

主题

63

回帖

375

积分

流光翡翠

积分
375
发表于 2025-6-12 05:35:47 | 显示全部楼层 来自 澳大利亚
本帖最后由 wes58 于 2025-6-12 05:39 编辑
Slacky 发表于 2025-6-12 03:25
Sorry. Cyclic reboot, if watch_dog enabled. If disabled, no return from reportAttrs().

Did you try to find in the source code where the problem is?
You say that there is "no return from reportAttrs()"
If you look in the source code, the only way it stays in the "do while" loop is when again = 1.
And it is set twice in this function.
  1. }else if((clusterID != pEntry->clusterID) || (profileID != pEntry->profileID) || (endpoint != pEntry->endPoint)){
  2.            again = 1;
  3.            continue;
  4. }
复制代码

or
  1. if(report.numAttr >= 2){
  2.          again = 1;
  3.          break;
  4. }
复制代码

It is easy for you to check it, because you have this problem. You can add some variables in the code and see what is happening or use some LEDs to have visual indication etc.
Otherwise post all your project code so someone can check it.

That is my advice to you, otherwise you may be waiting for a long time.

9

主题

23

回帖

241

积分

华贵铂金

积分
241
 楼主| 发表于 2025-6-12 23:02:18 | 显示全部楼层 来自 俄罗斯

The ZCL says what to do if maxInterval is 0.

sharex-17-48-46-840.jpg


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;
                                                }
                                        }


9

主题

23

回帖

241

积分

华贵铂金

积分
241
 楼主| 发表于 2025-6-14 00:42:41 | 显示全部楼层 来自 俄罗斯
本帖最后由 Slacky 于 2025-6-14 00:49 编辑

It seems that this is correct.



            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 (!pEntry->maxInterval) {
                            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 {
                            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;
                        }
                    }

                    if (valid) {



27

主题

300

回帖

953

积分

版主

积分
953
发表于 2025-6-20 15:16:35 | 显示全部楼层 来自 上海
Slacky 发表于 2025-6-14 00:42
It seems that this is correct.


Thank you for your feedback. I will synchronize this issue to the next version.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Telink forum ( 沪ICP备17008231号-1 )

GMT+8, 2025-7-2 00:09 , Processed in 0.101302 second(s), 24 queries .

Powered by Telink 隐私政策

泰凌微电子版权所有 © 。保留所有权利。 2024

快速回复 返回顶部 返回列表