Hi,
When sending a command using Zigbee, I understand the best method to use is by using:
zb_buf_get_out_delayed_ext
So when calling light_switch_send_step, I use:
zb_err_code = zb_buf_get_out_delayed_ext(light_switch_send_step, cmd_id, 0);
Which in turn calls below function when the buffer is available. In above function it is possible to add only two parameters. Logically I would need to change more parameters when calling the function, like change the short_addr, per call, change the stepSize and transactiontime. What is the best practise to make above, or below function call more flexible?
static void light_switch_send_step(zb_bufid_t bufid, zb_uint16_t cmd_id)
{
LOG_INF("Send step level command: %d", cmd_id);
ZB_ZCL_LEVEL_CONTROL_SEND_STEP_REQ(bufid,
bulb_ctx.short_addr,
ZB_APS_ADDR_MODE_16_ENDP_PRESENT,
bulb_ctx.endpoint,
LIGHT_SWITCH_ENDPOINT,
ZB_AF_HA_PROFILE_ID,
ZB_ZCL_DISABLE_DEFAULT_RESPONSE,
NULL,
cmd_id,
StepSize,
DIMM_TRANSACTION_TIME);
}