Skip to main content

zigbee_ezsp/
ids.rs

1//! EZSP frame ids and the ids of configuration values, policies, decisions,
2//! values and manufacturing tokens, as Silicon Labs documents them (UG100
3//! and the EmberZNet `ezsp-enum.h`).
4
5/// Frame ids (commands, their responses, and callbacks).
6pub mod frame {
7    #![allow(missing_docs)]
8    pub const VERSION: u16 = 0x0000;
9    pub const ADD_ENDPOINT: u16 = 0x0002;
10    pub const NOP: u16 = 0x0005;
11    pub const NO_CALLBACKS: u16 = 0x0007;
12    pub const GET_MFG_TOKEN: u16 = 0x000B;
13    pub const SET_MFG_TOKEN: u16 = 0x000C;
14    pub const STACK_TOKEN_CHANGED_HANDLER: u16 = 0x000D;
15    pub const SET_CONCENTRATOR: u16 = 0x0010;
16    pub const SET_MANUFACTURER_CODE: u16 = 0x0015;
17    pub const NETWORK_INIT: u16 = 0x0017;
18    pub const NETWORK_STATE: u16 = 0x0018;
19    pub const STACK_STATUS_HANDLER: u16 = 0x0019;
20    pub const START_SCAN: u16 = 0x001A;
21    pub const NETWORK_FOUND_HANDLER: u16 = 0x001B;
22    pub const SCAN_COMPLETE_HANDLER: u16 = 0x001C;
23    pub const FORM_NETWORK: u16 = 0x001E;
24    pub const LEAVE_NETWORK: u16 = 0x0020;
25    pub const PERMIT_JOINING: u16 = 0x0022;
26    pub const CHILD_JOIN_HANDLER: u16 = 0x0023;
27    pub const TRUST_CENTER_JOIN_HANDLER: u16 = 0x0024;
28    pub const GET_EUI64: u16 = 0x0026;
29    pub const GET_NODE_ID: u16 = 0x0027;
30    pub const GET_NETWORK_PARAMETERS: u16 = 0x0028;
31    pub const SEND_UNICAST: u16 = 0x0034;
32    pub const SEND_BROADCAST: u16 = 0x0036;
33    pub const MESSAGE_SENT_HANDLER: u16 = 0x003F;
34    pub const INCOMING_MESSAGE_HANDLER: u16 = 0x0045;
35    pub const ENERGY_SCAN_RESULT_HANDLER: u16 = 0x0048;
36    pub const GET_CONFIGURATION_VALUE: u16 = 0x0052;
37    pub const SET_CONFIGURATION_VALUE: u16 = 0x0053;
38    pub const SET_POLICY: u16 = 0x0055;
39    pub const INVALID_COMMAND: u16 = 0x0058;
40    pub const INCOMING_ROUTE_RECORD_HANDLER: u16 = 0x0059;
41    pub const SET_SOURCE_ROUTE_DISCOVERY_MODE: u16 = 0x005A;
42    pub const LOOKUP_EUI64_BY_NODE_ID: u16 = 0x0061;
43    pub const SET_INITIAL_SECURITY_STATE: u16 = 0x0068;
44    pub const CLEAR_TRANSIENT_LINK_KEYS: u16 = 0x006B;
45    pub const ERASE_KEY_TABLE_ENTRY: u16 = 0x0076;
46    pub const ID_CONFLICT_HANDLER: u16 = 0x007C;
47    pub const INCOMING_MANY_TO_ONE_ROUTE_REQUEST_HANDLER: u16 = 0x007D;
48    pub const INCOMING_ROUTE_ERROR_HANDLER: u16 = 0x0080;
49    pub const ECHO: u16 = 0x0081;
50    pub const SET_RADIO_POWER: u16 = 0x0099;
51    pub const ZIGBEE_KEY_ESTABLISHMENT_HANDLER: u16 = 0x009B;
52    pub const GET_VALUE: u16 = 0x00AA;
53    pub const SET_VALUE: u16 = 0x00AB;
54    pub const CLEAR_KEY_TABLE: u16 = 0x00B1;
55    pub const INCOMING_NETWORK_STATUS_HANDLER: u16 = 0x00C4;
56    pub const IMPORT_LINK_KEY: u16 = 0x010E;
57    pub const EXPORT_LINK_KEY_BY_INDEX: u16 = 0x010F;
58    pub const IMPORT_TRANSIENT_KEY: u16 = 0x0111;
59    pub const EXPORT_KEY: u16 = 0x0114;
60    pub const GET_NETWORK_KEY_INFO: u16 = 0x0116;
61}
62
63/// Configuration ids (`setConfigurationValue`), set before the network starts.
64pub mod config {
65    #![allow(missing_docs)]
66    pub const PACKET_BUFFER_HEAP_SIZE: u8 = 0x01;
67    pub const NEIGHBOR_TABLE_SIZE: u8 = 0x02;
68    pub const APS_UNICAST_MESSAGE_COUNT: u8 = 0x03;
69    pub const BINDING_TABLE_SIZE: u8 = 0x04;
70    pub const ADDRESS_TABLE_SIZE: u8 = 0x05;
71    pub const MULTICAST_TABLE_SIZE: u8 = 0x06;
72    pub const ROUTE_TABLE_SIZE: u8 = 0x07;
73    pub const DISCOVERY_TABLE_SIZE: u8 = 0x08;
74    pub const STACK_PROFILE: u8 = 0x0C;
75    pub const SECURITY_LEVEL: u8 = 0x0D;
76    pub const MAX_HOPS: u8 = 0x10;
77    pub const MAX_END_DEVICE_CHILDREN: u8 = 0x11;
78    pub const INDIRECT_TRANSMISSION_TIMEOUT: u8 = 0x12;
79    pub const END_DEVICE_POLL_TIMEOUT: u8 = 0x13;
80    pub const TRUST_CENTER_ADDRESS_CACHE_SIZE: u8 = 0x19;
81    pub const SOURCE_ROUTE_TABLE_SIZE: u8 = 0x1A;
82    pub const KEY_TABLE_SIZE: u8 = 0x1E;
83    pub const SUPPORTED_NETWORKS: u8 = 0x2D;
84    pub const TRANSIENT_KEY_TIMEOUT_S: u8 = 0x36;
85}
86
87/// Policy ids (`setPolicy`).
88pub mod policy {
89    #![allow(missing_docs)]
90    pub const TRUST_CENTER: u8 = 0x00;
91    pub const BINDING_MODIFICATION: u8 = 0x01;
92    pub const UNICAST_REPLIES: u8 = 0x02;
93    pub const POLL_HANDLER: u8 = 0x03;
94    pub const MESSAGE_CONTENTS_IN_CALLBACK: u8 = 0x04;
95    pub const TC_KEY_REQUEST: u8 = 0x05;
96    pub const APP_KEY_REQUEST: u8 = 0x06;
97}
98
99/// Decision ids for the policies above.
100pub mod decision {
101    #![allow(missing_docs)]
102    pub const CHECK_BINDING_MODIFICATIONS_ARE_VALID_ENDPOINT_CLUSTERS: u8 = 0x12;
103    pub const HOST_WILL_NOT_SUPPLY_REPLY: u8 = 0x20;
104    pub const MESSAGE_TAG_ONLY_IN_CALLBACK: u8 = 0x40;
105    pub const DENY_TC_KEY_REQUESTS: u8 = 0x50;
106    pub const ALLOW_TC_KEY_REQUESTS_AND_SEND_CURRENT_KEY: u8 = 0x51;
107    pub const ALLOW_TC_KEY_REQUEST_AND_GENERATE_NEW_KEY: u8 = 0x52;
108    pub const DENY_APP_KEY_REQUESTS: u8 = 0x60;
109    pub const ALLOW_APP_KEY_REQUESTS: u8 = 0x61;
110}
111
112/// Bits of the trust center policy decision.
113pub mod tc_decision {
114    #![allow(missing_docs)]
115    pub const ALLOW_JOINS: u8 = 0x01;
116    pub const ALLOW_UNSECURED_REJOINS: u8 = 0x02;
117    pub const SEND_KEY_IN_CLEAR: u8 = 0x04;
118    pub const IGNORE_UNSECURED_REJOINS: u8 = 0x08;
119    pub const JOINS_USE_INSTALL_CODE_KEY: u8 = 0x10;
120    pub const DEFER_JOINS: u8 = 0x20;
121}
122
123/// Value ids (`getValue` / `setValue`).
124pub mod value {
125    #![allow(missing_docs)]
126    pub const STACK_TOKEN_WRITING: u8 = 0x07;
127    pub const EXTENDED_SECURITY_BITMASK: u8 = 0x0A;
128    pub const VERSION_INFO: u8 = 0x11;
129    pub const NWK_FRAME_COUNTER: u8 = 0x23;
130    pub const APS_FRAME_COUNTER: u8 = 0x24;
131}
132
133/// Manufacturing token ids (`getMfgToken` / `setMfgToken`).
134pub mod mfg_token {
135    #![allow(missing_docs)]
136    pub const STRING: u8 = 0x01;
137    pub const BOARD_NAME: u8 = 0x02;
138    pub const MANUF_ID: u8 = 0x03;
139    pub const CUSTOM_EUI_64: u8 = 0x0C;
140}
141
142/// Bits of `EmberInitialSecurityState.bitmask`.
143pub mod security {
144    #![allow(missing_docs)]
145    pub const TRUST_CENTER_GLOBAL_LINK_KEY: u16 = 0x0004;
146    pub const TRUST_CENTER_USES_HASHED_LINK_KEY: u16 = 0x0084;
147    pub const HAVE_PRECONFIGURED_KEY: u16 = 0x0100;
148    pub const HAVE_NETWORK_KEY: u16 = 0x0200;
149    pub const REQUIRE_ENCRYPTED_KEY: u16 = 0x0800;
150    pub const NO_FRAME_COUNTER_RESET: u16 = 0x1000;
151}
152
153/// Bits of the extended security bitmask (`EXTENDED_SECURITY_BITMASK` value).
154pub mod ext_security {
155    #![allow(missing_docs)]
156    pub const JOINER_GLOBAL_LINK_KEY: u16 = 0x0010;
157    pub const NWK_LEAVE_REQUEST_NOT_ALLOWED: u16 = 0x0100;
158}
159
160/// `EmberNetworkStatus`.
161pub mod network_status {
162    #![allow(missing_docs)]
163    pub const NO_NETWORK: u8 = 0;
164    pub const JOINING_NETWORK: u8 = 1;
165    pub const JOINED_NETWORK: u8 = 2;
166    pub const JOINED_NETWORK_NO_PARENT: u8 = 3;
167    pub const LEAVING_NETWORK: u8 = 6;
168}
169
170/// `EmberNodeType`.
171pub mod node_type {
172    #![allow(missing_docs)]
173    pub const UNKNOWN: u8 = 0;
174    pub const COORDINATOR: u8 = 1;
175    pub const ROUTER: u8 = 2;
176    pub const END_DEVICE: u8 = 3;
177    pub const SLEEPY_END_DEVICE: u8 = 4;
178}
179
180/// `EmberOutgoingMessageType`.
181pub mod outgoing {
182    #![allow(missing_docs)]
183    pub const DIRECT: u8 = 0;
184    pub const VIA_ADDRESS_TABLE: u8 = 1;
185    pub const VIA_BINDING: u8 = 2;
186    pub const MULTICAST: u8 = 3;
187    pub const BROADCAST: u8 = 6;
188}
189
190/// `EmberIncomingMessageType`.
191pub mod incoming {
192    #![allow(missing_docs)]
193    pub const UNICAST: u8 = 0;
194    pub const UNICAST_REPLY: u8 = 1;
195    pub const MULTICAST: u8 = 2;
196    pub const MULTICAST_LOOPBACK: u8 = 3;
197    pub const BROADCAST: u8 = 4;
198    pub const BROADCAST_LOOPBACK: u8 = 5;
199}
200
201/// `EmberApsOption` bits.
202pub mod aps_option {
203    #![allow(missing_docs)]
204    pub const NONE: u16 = 0x0000;
205    pub const ENCRYPTION: u16 = 0x0020;
206    pub const RETRY: u16 = 0x0040;
207    pub const ENABLE_ROUTE_DISCOVERY: u16 = 0x0100;
208    pub const FORCE_ROUTE_DISCOVERY: u16 = 0x0200;
209    pub const SOURCE_EUI64: u16 = 0x0400;
210    pub const DESTINATION_EUI64: u16 = 0x0800;
211    pub const ENABLE_ADDRESS_DISCOVERY: u16 = 0x1000;
212    pub const ZDO_RESPONSE_REQUIRED: u16 = 0x4000;
213}
214
215/// `EmberDeviceUpdate`, the status in `trustCenterJoinHandler`.
216pub mod device_update {
217    #![allow(missing_docs)]
218    pub const SECURED_REJOIN: u8 = 0;
219    pub const UNSECURED_JOIN: u8 = 1;
220    pub const DEVICE_LEFT: u8 = 2;
221    pub const UNSECURED_REJOIN: u8 = 3;
222}
223
224/// `EmberJoinDecision`.
225pub mod join_decision {
226    #![allow(missing_docs)]
227    pub const USE_PRECONFIGURED_KEY: u8 = 0;
228    pub const SEND_KEY_IN_THE_CLEAR: u8 = 1;
229    pub const DENY_JOIN: u8 = 2;
230    pub const NO_ACTION: u8 = 3;
231    pub const ALLOW_REJOINS_ONLY: u8 = 4;
232}
233
234/// `EmberKeyStatus`, from `zigbeeKeyEstablishmentHandler`.
235pub mod key_status {
236    #![allow(missing_docs)]
237    pub const TRUST_CENTER_LINK_KEY_ESTABLISHED: u8 = 0x03;
238    pub const TC_RESPONDED_TO_KEY_REQUEST: u8 = 0x06;
239    pub const TC_FAILED_TO_SEND_TC_KEY: u8 = 0x13;
240    pub const VERIFY_LINK_KEY_SUCCESS: u8 = 0x65;
241}
242
243/// `sl_zb_sec_man_key_type_t`.
244pub mod key_type {
245    #![allow(missing_docs)]
246    pub const NONE: u8 = 0;
247    pub const NETWORK: u8 = 1;
248    pub const TC_LINK: u8 = 2;
249    pub const APP_LINK: u8 = 4;
250}
251
252/// `EmberNetworkInitBitmask`.
253pub mod network_init {
254    #![allow(missing_docs)]
255    pub const PARENT_INFO_IN_TOKEN: u16 = 0x0001;
256    pub const END_DEVICE_REJOIN_ON_REBOOT: u16 = 0x0002;
257}
258
259/// Scan types for `startScan`.
260pub mod scan_type {
261    #![allow(missing_docs)]
262    pub const ENERGY: u8 = 0;
263    pub const ACTIVE: u8 = 1;
264}
265
266/// The concentrator types for `setConcentrator`.
267pub mod concentrator {
268    #![allow(missing_docs)]
269    pub const LOW_RAM: u16 = 0xFFF8;
270    pub const HIGH_RAM: u16 = 0xFFF9;
271}
272
273/// The stack type the `version` command reports for a Zigbee mesh stack.
274pub const STACK_TYPE_MESH: u8 = 0x02;
275/// Zigbee PRO stack profile.
276pub const STACK_PROFILE_ZIGBEE_PRO: u16 = 0x02;
277/// Security level 5 (Zigbee 3.0).
278pub const SECURITY_LEVEL_Z3: u16 = 0x05;