This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Question ) zigbee send,receive (zc_light, zc_switch)

I am a student studying zigbee. We succeeded in turning on/off the LEDs of zc_light using examples of zc_light and zc_switch.
The question here is, where do you send and receive packets?

In 'zc_switch', 'static zb_void_t light_switch_send_on_off(zb_bufid_t bufid, zb_uint16_t on_off)' function have

" ZB_ZCL_ON_OFF_SEND_REQ(bufid,
m_device_ctx.bulb_params.short_addr,
ZB_APS_ADDR_MODE_16_ENDP_PRESENT,
m_device_ctx.bulb_params.endpoint,
LIGHT_SWITCH_ENDPOINT,
ZB_AF_HA_PROFILE_ID,
ZB_ZCL_DISABLE_DEFAULT_RESPONSE,
cmd_id,
NULL);"

I don't know where the zc_light receive it.
So my question is as follows!

1. Can you tell me where you receive from zc_light?
2. Can you tell me where the zc_switch is sending if it's not the function above?


I'd appreciate it if you could let me know.

  • Hi,

    Q1

    The stack implements the default handling of all the ZCL commands for all supported clusters, which means that, by default, the stack handles when the light receive the on/off command from the switch, and that this happens "in the background" so to say. In other words, you can't find the code where this is done, as it's implemented in the stack and not in the code available in the SDK. However, you can create a custom handler to override this and intercept the ZCL command. You can read about how to do this here. You can also find more information about sending ZCL commands here.

    Q2

    It is sent when ZB_ZCL_ON_OFF_SEND_REQ is called.

    Best regards,

    Marte

Related