Other Parts Discussed in Thread: Z-STACK,
Tool/software:
Hello,
I am working with the CC2674P10 microcontroller using Z-Stack from the SimpleLink CC13xx/CC26xx SDK version 7.40.00.77.
In my project, I am trying to enable reporting from an end device to a coordinator. I have added the ZCL_CLUSTER_ID_MS_ELECTRICAL_MEASUREMENT = 0x0b04 cluster, with several reportable attributes. I created the binding between the end device and the coordinator, but I do not see any reporting happening on the coordinator.
When debugging in the bdb_event_loop
, specifically in the bdb_RepReport
function (from bdb_reporting.c
), I noticed that I am periodically sending reporting commands via the function:
zcl_StackSendReportCmd(clusterEndpointItem->endpoint, &dstAddr, clusterEndpointItem->cluster, pReportCmd, ZCL_FRAME_SERVER_CLIENT_DIR, BDB_REPORTING_DISABLE_DEFAULT_RSP, zcl_getFrameCounter());
However, nothing is received on the coordinator side.
Digging further into the AF_DataRequest
function (in af.c
), I see the following code:
if (len > afDataReqMTU(&mtu)) { if (apsfSendFragmented) { stat = (*apsfSendFragmented)(&req); } else { stat = afStatus_INVALID_PARAMETER; } } else { stat = APSDE_DataReq(&req); }
When I calculate the reporting payload size for the Electrical Measurement cluster (ZCL_CLUSTER_ID_MS_ELECTRICAL_MEASUREMENT), (which is the ∑(of all reportable attribute data types' lengths) +
(2 bytes for attribute ID + 1 byte for data type) * number of reportable attributes
), it reaches about 90 bytes. The afDataReqMTU(&mtu)
function returns a maximum size of 82 bytes, so it always calls the (*apsfSendFragmented)(&req)
function (whose source code I cannot access), which returns stat = 0x02 (ZInvalidParameter)
.I suspected the issue might be related to fragmentation. I tried adding the ZIGBEE_FRAGMENTATION
compile option, but unfortunately, the issue persists.
When I reduce the number of reportable attributes to keep the size below afDataReqMTU(&mtu)
, it goes through the APSDE_DataReq(&req)
function, and everything works as expected, with the coordinator successfully receiving the reporting message.
I am looking for a solution to enable reporting even with large message sizes. How can I resolve this fragmentation issue or allow larger reporting messages to be sent?
Any help or suggestions would be greatly appreciated!