I'm trying to write a temperature measurement value from an end node to a Zigbee router. I've tried to follow some of the examples for how the OnOff toggle command is sent. A similar API is not provided for the TemperatureMeasurement cluster. Here is what I am trying to do:
float temp_F;
tsZCL_Address sDestinationAddress;
teZCL_Status eStatus;
uint8 u8seqNo;
int16 zero = 0;
int16 ninety_nine = 9900;
int16 temp_F_16;
temp_F = get_temp_F();
DBG_vPrintf(TRUE, "\r\n\r\n\r\n");
DBG_vPrintf(TRUE, "*** current temp: %d.%d F\r\n\r\n", (uint8)temp_F, (uint8)(temp_F * 10) % 10);
// send the temperature
sDestinationAddress.eAddressMode = E_ZCL_AM_BOUND_NON_BLOCKING;
temp_F_16 = (int16)(100 * temp_F);
tsZCL_TxPayloadItem asPayloadDefinition[] =
{
{1, E_ZCL_INT16, &temp_F_16},
{1, E_ZCL_INT16, &zero},
{1, E_ZCL_INT16, &ninety_nine},
};
eStatus = eZCL_CustomCommandSend(
COORDINATOR_APPLICATION_ENDPOINT,
0,
&sDestinationAddress,
HA_TEMPERATUREMEASUREMENT_CLUSTER_ID,
FALSE,
E_CLD_TEMPMEAS_ATTR_ID_MEASURED_VALUE,
&u8seqNo,
asPayloadDefinition,
FALSE,
0,
sizeof(asPayloadDefinition) / sizeof(tsZCL_TxPayloadItem)
);
When I check the value of eStatus, it's E_ZCL_ERR_CLUSTER_NOT_FOUND. I believe I've setup the clusters correctly in the .zpscfg file. Does it look like I'm doing something wrong in the custom command send API, or should I look elsewhere?