When using Read Attributes, the response is fine:
Command: Read Attributes Response (0x01)
Status Record, Uint: 500
Attribute: Client: Functional Notification Flags / Server: Current Summation Delivered (0x0000)
Status: Success (0x00)
Data Type: 48-Bit Unsigned Integer (0x25)
Uint48: 500 (0x00000000000001f4)
But when the same attribute is reported along with the Inlet temperature, "random" data gets added from the 5th byte upwards:
Command: Report Attributes (0x0a)
Attribute Field, Int24: 2358
Attribute: Inlet Temperature (0x0017)
Data Type: 24-Bit Signed Integer (0x2a)
Int24: 2358
Attribute Field, Uint: 17179869684
Attribute: Client: Functional Notification Flags / Server: Current Summation Delivered (0x0000)
Data Type: 48-Bit Unsigned Integer (0x25)
Uint48: 17179869684 (0x00000004000001f4)
Other unique invalid values over a short period of time are:
Uint48: 17179869684 (0x00000004000001f4)
Uint48: 390842024436 (0x0000005b000001f4)
Uint48: 880468296180 (0x000000cd000001f4)
Uint48: 93458488361460 (0x00005500000001f4)
Uint48: 94227287507444 (0x000055b3000001f4)
Uint48: 94373316395508 (0x000055d5000001f4)
Uint48: 94386201297396 (0x000055d8000001f4)
I inspected data memory where the 48 bit value is located (pointed to in the attribute definition), and it is always correcly showing the "500" value.
This value was reported with normal values prior to adding the Inlet temperature to the reportables. I guess something is wrong in the BDB reporting code.
{
ZCL_CLUSTER_ID_SE_METERING, // Cluster IDs - defined in the foundation (ie. zcl.h) - Smart Energy (SE) Clusters
{ // Attribute record
ATTRID_SE_METERING_CURR_SUMM_DLVD, // 0x0000
ZCL_DATATYPE_UINT48,
ACCESS_CONTROL_READ | ACCESS_REPORTABLE,
(void *)&meterInfo.Wh_meter
}
},
{
ZCL_CLUSTER_ID_SE_METERING,
{ // Attribute record
ATTRID_SE_METERING_INLET_TEMP, // 0x0017
ZCL_DATATYPE_INT24, // Strangely enough int24, but as in ZCL
ACCESS_CONTROL_READ | ACCESS_REPORTABLE,
(void *)&inletTemperature
}
},
And, the following code is placed in appropriate locations to notify about changes:
uint8 status = bdb_RepChangedAttrValue(
APP_ENDPOINT,
ZCL_CLUSTER_ID_SE_METERING,
ATTRID_SE_METERING_INLET_TEMP
);
uint8 status = bdb_RepChangedAttrValue(
APP_ENDPOINT,
ZCL_CLUSTER_ID_SE_METERING,
ATTRID_SE_METERING_INST_DMD
);
And they are set up during initialisation:
bdb_RepAddAttrCfgRecordDefaultToList(APP_ENDPOINT, ZCL_CLUSTER_ID_SE_METERING, ATTRID_SE_METERING_INST_DMD, REP_INTERVAL_60S, REP_INTERVAL_5M, reportableChange1);
bdb_RepAddAttrCfgRecordDefaultToList(APP_ENDPOINT, ZCL_CLUSTER_ID_SE_METERING, ATTRID_SE_METERING_CURR_SUMM_DLVD, REP_INTERVAL_60S, REP_INTERVAL_5M, reportableChange50);
bdb_RepAddAttrCfgRecordDefaultToList(APP_ENDPOINT, ZCL_CLUSTER_ID_SE_METERING, ATTRID_SE_METERING_INLET_TEMP, REP_INTERVAL_60S, REP_INTERVAL_5M, reportableChange50);
What are your suggestions to fix this?
I am on the latest ZSTACK 3.0.2 with patches.
