Zigbee: Problem using eZCL_CustomCommandSend for TemperatureMeasurement cluster

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Zigbee: Problem using eZCL_CustomCommandSend for TemperatureMeasurement cluster

1,381 次查看
anthony_r_myers
Contributor I

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?

0 项奖励
回复
5 回复数

1,304 次查看
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @anthony_r_myers,

Please look at the JN-AN-1246 JN5189/88 This example implements a temperature sensor.

Loot at the documentation included in the zip file. 6.6 Light, Temperature and Occupancy Sensor Application Code

Let me know if you have any further questions.

Regards,

Mario

 

 

0 项奖励
回复

1,350 次查看
anthony_r_myers
Contributor I

Hi Mario,

Yes.  I am trying to implement this in the 1243 Coordinator, talking to the 1244 Router.  The value of HA_TEMPERATUREMEASUREMENT_CLUSTER_ID is 0x0402, and is defined in zps_gen.h.

Thanks,
Anthony

0 项奖励
回复

1,332 次查看
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @anthony_r_myers,

What is the MCU that you are working on?

You could also send this temperature following the next community post. How to send Data from SED to Coordinator on JN5168 Module

You could use the same function in the coordinator.

Regards,

Mario

 

 

0 项奖励
回复

1,313 次查看
anthony_r_myers
Contributor I

Hi Mario,

Thanks for the response.  The MCU is the JN5189.  I could try using that other API, but is there a reason that what I am trying isn't working?

Thanks,
Anthony

0 项奖励
回复

1,367 次查看
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Antony,

I hope you are doing great.

I am assuming that you follow the next community post to add a new cluster. ZigBee 3.0: Adding Clusters

What is the application note that you are using to implement this?

You are getting the next value, it is because the next validation

        if(eZCL_SearchForClusterEntry(u8SourceEndPointId, u16ClusterId, bDirection, &psZCL_ClusterInstance) != E_ZCL_SUCCESS)
        {
            return(E_ZCL_ERR_CLUSTER_NOT_FOUND);
        }

What is the value of the HA_TEMPERATUREMEASUREMENT_CLUSTER_ID?

Regards,

Mario

0 项奖励
回复