Trident IoT Zigbee SDK
Loading...
Searching...
No Matches
tr_on_off_server.h
Go to the documentation of this file.
1
10#ifndef TR_ON_OFF_SERVER_H
11#define TR_ON_OFF_SERVER_H
12
13#include "tr_af.h"
14
15// on off server states
23
27#if defined(TR_ON_OFF_SERVER_PLUGIN_PRINT_ENABLE) && (TR_ON_OFF_SERVER_PLUGIN_PRINT_ENABLE == 1)
28#define tr_on_off_server_printf(...) tr_zcl_printf(__VA_ARGS__)
29#define tr_on_off_server_println(...) tr_zcl_println(__VA_ARGS__)
30#else
31#define tr_on_off_server_printf(...)
32#define tr_on_off_server_println(...)
33#endif
34
40
44
48zb_bool_t tr_on_off_server_command_received_cb(zb_zcl_parsed_hdr_t *cmd_info);
49
56 zb_uint16_t attr_id,
57 zb_uint8_t *new_value,
58 zb_uint16_t manuf_code);
59
64zb_bool_t tr_on_off_server_off_cb(zb_zcl_parsed_hdr_t *cmd_info,
65 zb_uint8_t endpoint);
66
71zb_bool_t tr_on_off_server_on_cb(zb_zcl_parsed_hdr_t *cmd_info,
72 zb_uint8_t endpoint);
73
79zb_bool_t tr_on_off_server_toggle_cb(zb_zcl_parsed_hdr_t *cmd_info,
80 zb_uint8_t endpoint,
81 zb_uint8_t current_on_off_state);
82
89zb_bool_t tr_on_off_server_off_with_effect_cb(zb_zcl_parsed_hdr_t *cmd_info,
90 zb_uint8_t endpoint,
91 zb_uint8_t effect_id,
92 zb_uint8_t effect_variant);
93
97zb_bool_t tr_on_off_server_on_with_recall_global_scene_cb(zb_zcl_parsed_hdr_t *cmd_info,
98 zb_uint8_t endpoint);
99
107zb_bool_t tr_on_off_server_on_with_timed_off_cb(zb_zcl_parsed_hdr_t *cmd_info,
108 zb_uint8_t endpoint,
109 zb_uint8_t on_off_control,
110 zb_uint16_t on_time,
111 zb_uint16_t off_wait_time);
112
114
120
124
128
132
134
139
140// function that is called from ZCL common when attr are ready to be used
142
143#endif // TR_ON_OFF_SERVER_H
zb_uint8_t on_off_control
Definition tr_zcl_cmd_structs.h:276
zb_uint16_t off_wait_time
Definition tr_zcl_cmd_structs.h:278
zb_uint8_t effect_variant
Definition tr_zcl_cmd_structs.h:37
zb_uint8_t effect_id
Definition tr_zcl_cmd_structs.h:36
zb_uint16_t on_time
Definition tr_zcl_cmd_structs.h:277
void tr_on_off_server_turn_on(zb_uint8_t endpoint)
API to handle local turn on. It will call the user tr_on_off_server_off_cb() callback and update attr...
void tr_on_off_server_init_endpoint(zb_uint8_t endpoint)
API to handle endpoint initialization. It will take care of the startup attribute if it is implemente...
void tr_on_off_server_turn_off(zb_uint8_t endpoint)
API to handle local turn off. It will call the user tr_on_off_server_off_cb() callback and update att...
void tr_on_off_server_init_cb(zb_uint8_t endpoint)
Callback fires when the On/off server cluster plugin is initialized.
zb_bool_t tr_on_off_server_command_received_cb(zb_zcl_parsed_hdr_t *cmd_info)
Callback that user can declare to handle any On/off server commands.
void tr_on_off_server_write_attr_cb(zb_uint8_t endpoint, zb_uint16_t attr_id, zb_uint8_t *new_value, zb_uint16_t manuf_code)
Callback fires when an On/off server attribute is about to be written.
zb_bool_t tr_on_off_server_on_cb(zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint)
Callback that user can declare to handle on/off cluster on command.
zb_bool_t tr_on_off_server_on_with_recall_global_scene_cb(zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint)
Callback that user can declare to handle on/off cluster on with recall global scene command.
zb_bool_t tr_on_off_server_off_cb(zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint)
Callback that user can declare to handle on/off cluster off command.
zb_bool_t tr_on_off_server_on_with_timed_off_cb(zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint8_t on_off_control, zb_uint16_t on_time, zb_uint16_t off_wait_time)
Callback that user can declare to handle on/off cluster on with timed off command.
zb_bool_t tr_on_off_server_toggle_cb(zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint8_t current_on_off_state)
Callback that user can declare to handle on/off cluster toggle command.
zb_bool_t tr_on_off_server_off_with_effect_cb(zb_zcl_parsed_hdr_t *cmd_info, zb_uint8_t endpoint, zb_uint8_t effect_id, zb_uint8_t effect_variant)
Callback that user can declare to handle on/off cluster off with effect command.
Trident application framework include.
zb_uint8_t endpoint
Definition tr_nvram_attr.h:176
zb_uint16_t manuf_code
Definition tr_nvram_attr.h:180
zb_uint16_t attr_id
Definition tr_nvram_attr.h:178
void tr_on_off_server_attributes_ready(void)
tr_on_off_server_states_t
Definition tr_on_off_server.h:17
@ TR_ON_OFF_SERVER_STATE_ON
Definition tr_on_off_server.h:19
@ TR_ON_OFF_SERVER_STATE_DELAYED_OFF
Definition tr_on_off_server.h:21
@ TR_ON_OFF_SERVER_STATE_TIMED_ON
Definition tr_on_off_server.h:20
@ TR_ON_OFF_SERVER_STATE_OFF
Definition tr_on_off_server.h:18
void tr_on_off_server_init(void)