查看: 2521|回复: 6

Reporting crashed, when maxInterval is 0! Cyclic reboot.

[复制链接]

10

主题

27

回帖

360

积分

积分
360
发表于 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

10

主题

27

回帖

360

积分

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

22

主题

113

回帖

587

积分

积分
587
发表于 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.

10

主题

27

回帖

360

积分

积分
360
 楼主| 发表于 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;
                                                }
                                        }


10

主题

27

回帖

360

积分

积分
360
 楼主| 发表于 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) {



30

主题

372

回帖

1188

积分

积分
1188
发表于 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.

0

主题

1

回帖

10

积分

积分
10
发表于 2025-7-10 19:26:18 | 显示全部楼层 来自 江苏
What problems would arise with the following modification?

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

                    dataLen = (dataLen > REPORTABLE_CHANGE_MAX_ANALOG_SIZE) ? (REPORTABLE_CHANGE_MAX_ANALOG_SIZE) : (dataLen);
                    if (!pEntry->maxIntCnt && pEntry->maxInterval) {
                        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) {

本版积分规则

关注公众号
隐私政策|Telink forum

相关侵权、举报、投诉及建议等,请发 E-mail:forum@telink-semi.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|沪ICP备17008231号-1 |沪公网安备31011502403548号

在本版发帖返回顶部
公告×