Zigbee - checking link status after a send

I am at the final stage in the current project but the send status is not updating correctly when

an attribute value is sent. For example in the following code:

zcl_status = zb_zcl_set_attr_val(NTEX, ZB_ZCL_CLUSTER_ID_NTEX,

ZB_ZCL_SERVER_ROLE, ZB_ZCL_ATTR_TEMP_VALUE_ID, (zb_uint8_t *)*temp, ZB_FALSE);

if (zcl_status != ZB_ZCL_SUCCESS)

 { /* report data sent */ }

else { /* report data not sent */ }

The above code always reports as if the message is sent even when the ZC is powered down.

Is there a very simple way to check that the link to the coordinator is ok so I can set a flag to

force a rejoin ? Or if not what is the easiest way to check the data has arrived ?

Regards

Rob

  • Hi Rob,

    The above code always reports as if the message is sent even when the ZC is powered down.

    This is because zb_zcl_set_attr_val() is not used to send the attribute value to another device, but to set the attribute value on the current device. So when for example a temperature sensor is reading a new temperature value you can use zb_zcl_set_attr_val() to update the measured value attribute from the temperature measurement cluster to the new value locally on the device. The return value, zcl_status, indicates whether the attribute value was successfully updated on the local device or not. 

    Is there a very simple way to check that the link to the coordinator is ok so I can set a flag to

    force a rejoin ? Or if not what is the easiest way to check the data has arrived ?

    If the device is an end device and the coordinator is the parent device, then it should automatically try to rejoin the network after the communication fails. Any device should also discover that something is wrong if it sends packets expecting a response without receiving one. This can be any sort of response, such as a response specific to the packet, default ZCL response, ACK, etc. 

    Best regards,

    Marte

Related