2 * Copyright (c) 2011, Olivier MATZ <zer0@droids-corp.org>
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the University of California, Berkeley nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #include <aversive/pgmspace.h>
34 #include "xbee_atcmd.h"
36 static const char PROGMEM atcmd0_name[] = "WR";
37 static const char PROGMEM atcmd0_desc[] = "write-param";
38 static const char PROGMEM atcmd0_help[] =
39 "Write parameter values to non-volatile memory.";
41 static const char PROGMEM atcmd1_name[] = "RE";
42 static const char PROGMEM atcmd1_desc[] = "restore-defaults";
43 static const char PROGMEM atcmd1_help[] =
44 "Restore module parameters to factory defaults.";
46 static const char PROGMEM atcmd2_name[] = "FR";
47 static const char PROGMEM atcmd2_desc[] = "soft-reset";
48 static const char PROGMEM atcmd2_help[] =
49 "Software Reset. Responds with 'OK' then performs a "
52 static const char PROGMEM atcmd3_name[] = "AC";
53 static const char PROGMEM atcmd3_desc[] = "apply-changes";
54 static const char PROGMEM atcmd3_help[] =
55 "Apply Changes without exiting command mode.";
57 static const char PROGMEM atcmd4_name[] = "R1";
58 static const char PROGMEM atcmd4_desc[] = "restore-compiled";
59 static const char PROGMEM atcmd4_help[] =
60 "Restore module parameters to compiled defaults.";
62 static const char PROGMEM atcmd5_name[] = "VL";
63 static const char PROGMEM atcmd5_desc[] = "version-long";
64 static const char PROGMEM atcmd5_help[] =
65 "Shows detailed version information including"
66 "application build date and time.";
68 static const char PROGMEM atcmd6_name[] = "DH";
69 static const char PROGMEM atcmd6_desc[] = "dst-addr-high";
70 static const char PROGMEM atcmd6_help[] =
71 "Upper 32 bits of the 64-bit destination address (0 "
72 "to 0xFFFFFFFF, default is 0x0000FFFF).";
74 static const char PROGMEM atcmd7_name[] = "DL";
75 static const char PROGMEM atcmd7_desc[] = "dst-addr-low";
76 static const char PROGMEM atcmd7_help[] =
77 "Lower 32 bits of the 64-bit destination address (0 "
78 "to 0xFFFFFFFF, default is 0x0000FFFF).";
80 static const char PROGMEM atcmd8_name[] = "DD";
81 static const char PROGMEM atcmd8_desc[] = "device-type-id";
82 static const char PROGMEM atcmd8_help[] =
83 "Device Type Identifier, it can be used to differentiate "
84 "multiple XBee-based products (0 to 0xFFFFFFFF, read-only, "
85 "default is 0x40000).";
87 static const char PROGMEM atcmd9_name[] = "SH";
88 static const char PROGMEM atcmd9_desc[] = "src-addr-high";
89 static const char PROGMEM atcmd9_help[] =
90 "Upper 32 bits of the 64-bit source address (read-only).";
92 static const char PROGMEM atcmd10_name[] = "SL";
93 static const char PROGMEM atcmd10_desc[] = "src-addr-low";
94 static const char PROGMEM atcmd10_help[] =
95 "Lower 32 bits of the 64-bit source address (read-only).";
97 static const char PROGMEM atcmd11_name[] = "SE";
98 static const char PROGMEM atcmd11_desc[] = "src-endpoint";
99 static const char PROGMEM atcmd11_help[] =
100 "The application source endpoint for all data transmissions "
101 "(0 to 0xFF, default is 0xE8).";
103 static const char PROGMEM atcmd12_name[] = "DE";
104 static const char PROGMEM atcmd12_desc[] = "dst-endpoint";
105 static const char PROGMEM atcmd12_help[] =
106 "The application destination endpoint for all data "
107 "transmissions (0 to 0xFF, default is 0xE8).";
109 static const char PROGMEM atcmd13_name[] = "CI";
110 static const char PROGMEM atcmd13_desc[] = "cluster-id";
111 static const char PROGMEM atcmd13_help[] =
112 "Cluster Identifier for all data transmissions (0 to 0xFFFF, "
115 static const char PROGMEM atcmd14_name[] = "NP";
116 static const char PROGMEM atcmd14_desc[] = "max-rf-payload";
117 static const char PROGMEM atcmd14_help[] =
118 "Maximum RF Payload Bytes that can be sent in a unicast "
119 "transmission based on the current configuration (0 to "
122 static const char PROGMEM atcmd15_name[] = "CE";
123 static const char PROGMEM atcmd15_desc[] = "coord-end-device";
124 static const char PROGMEM atcmd15_help[] =
125 "Coordinator/End Device, messaging mode of the module "
126 "(0 - Normal, 1 - Indirect coordinator, 2 - Polling, default "
129 static const char PROGMEM atcmd16_name[] = "AP";
130 static const char PROGMEM atcmd16_desc[] = "api-mode";
131 static const char PROGMEM atcmd16_help[] =
132 "API mode (0 - off, 1 - on, 2 - on with escape sequences).";
134 static const char PROGMEM atcmd17_name[] = "AO";
135 static const char PROGMEM atcmd17_desc[] = "api-output-format";
136 static const char PROGMEM atcmd17_help[] =
137 "API Output Format (0 - standard [0x90 for RX], 1 - explicit "
138 "addressing [0x91 for RX]).";
140 static const char PROGMEM atcmd18_name[] = "BD";
141 static const char PROGMEM atcmd18_desc[] = "baud-rate";
142 static const char PROGMEM atcmd18_help[] =
143 "Baud rate of serial interface (0-8 select preset standard "
144 "rates, and 0x39 to 0x1c9c38 select baud rate).";
146 static const char PROGMEM atcmd19_name[] = "RO";
147 static const char PROGMEM atcmd19_desc[] = "packetization-timeout";
148 static const char PROGMEM atcmd19_help[] =
149 "Packetization Timeout: the inter-character silence required "
150 "before packetization specified in character times (0 to 0xFF, "
153 static const char PROGMEM atcmd20_name[] = "FT";
154 static const char PROGMEM atcmd20_desc[] = "flow-control-thres";
155 static const char PROGMEM atcmd20_help[] =
156 "Flow Control Threshhold. De-assert CTS and/or send XOFF when "
157 "FT bytes are in the UART receive buffer. Re-assert CTS when "
158 "less than FT - 16 bytes are in the UART receive buffer (0x11 "
159 "to 0xEE, default is 0xBE).";
161 static const char PROGMEM atcmd21_name[] = "NB";
162 static const char PROGMEM atcmd21_desc[] = "parity";
163 static const char PROGMEM atcmd21_help[] =
164 "Parity (0 - no parity, 1 - even parity, 2 - odd parity, 3 - "
165 "forced high parity, 4 - forced low parity). Default is 0.";
167 static const char PROGMEM atcmd22_name[] = "D7";
168 static const char PROGMEM atcmd22_desc[] = "dio7";
169 static const char PROGMEM atcmd22_help[] =
170 "DIO7 Configuration (0 - unmonitored input, 1 - CTS, 3 - "
171 "digital input, 4 - digital output low, 5 - digital output "
172 "high, 6 - RS-485 low Tx, 7 - RS-485 high Tx). Default is "
175 static const char PROGMEM atcmd23_name[] = "D6";
176 static const char PROGMEM atcmd23_desc[] = "dio6";
177 static const char PROGMEM atcmd23_help[] =
178 "DIO6 Configuration (0 - unmonitored input, 1 - RTS, 3 - "
179 "digital input, 4 - digital output low, 5 - digital output "
180 "high). Default is 0.";
182 static const char PROGMEM atcmd24_name[] = "P0";
183 static const char PROGMEM atcmd24_desc[] = "dio10-pwm0";
184 static const char PROGMEM atcmd24_help[] =
185 "DIO10/PWM0 Configuration. (0 - unmonitored input, 1 - RSSI, 2 "
186 "- PWM0, 3 - digital input, 4 - digital output low, 5 - "
187 "digital output high). Default is 1.";
189 static const char PROGMEM atcmd25_name[] = "P1";
190 static const char PROGMEM atcmd25_desc[] = "dio11-pwm1";
191 static const char PROGMEM atcmd25_help[] =
192 "DIO11/PWM1 Configuration. (0 - unmonitored input, 2 "
193 "- PWM1, 3 - digital input, 4 - digital output low, 5 - "
194 "digital output high). Default is 0.";
196 static const char PROGMEM atcmd26_name[] = "P2";
197 static const char PROGMEM atcmd26_desc[] = "dio12";
198 static const char PROGMEM atcmd26_help[] =
199 "DIO12 Configuration. (0 - unmonitored input, "
200 "3 - digital input, 4 - digital output low, 5 - "
201 "digital output high). Default is 0.";
203 static const char PROGMEM atcmd27_name[] = "RP";
204 static const char PROGMEM atcmd27_desc[] = "rssi-pwm";
205 static const char PROGMEM atcmd27_help[] =
206 "Time RSSI signal will be output after last transmission. "
207 "When RP[] = 0xFF, output will always be on (0 - 0xFF, default "
208 "is 0x28[] = 4 seconds).";
210 static const char PROGMEM atcmd28_name[] = "1S";
211 static const char PROGMEM atcmd28_desc[] = "sensor-sample";
212 static const char PROGMEM atcmd28_help[] =
213 "Forces a sample to be taken on an XBee Sensor device.";
215 static const char PROGMEM atcmd29_name[] = "D0";
216 static const char PROGMEM atcmd29_desc[] = "dio0-ad0";
217 static const char PROGMEM atcmd29_help[] =
218 "AD0/DIO0 Configuration. (0 - unmonitored input, 1 - "
219 "commission button enabled, 2 - analog input, 3 - digital "
220 "input, 4 - digital output low, 5 - digital output high). "
223 static const char PROGMEM atcmd30_name[] = "D1";
224 static const char PROGMEM atcmd30_desc[] = "dio1-ad1";
225 static const char PROGMEM atcmd30_help[] =
226 "AD1/DIO1 Configuration. (0 - unmonitored input, "
227 "2 - analog input, 3 - digital input, 4 - digital output "
228 "low, 5 - digital output high). Default is 0.";
230 static const char PROGMEM atcmd31_name[] = "D2";
231 static const char PROGMEM atcmd31_desc[] = "dio2-ad2";
232 static const char PROGMEM atcmd31_help[] =
233 "AD2/DIO2 Configuration. (0 - unmonitored input, "
234 "2 - analog input, 3 - digital input, 4 - digital output "
235 "low, 5 - digital output high). Default is 0.";
237 static const char PROGMEM atcmd32_name[] = "D3";
238 static const char PROGMEM atcmd32_desc[] = "dio3-ad3";
239 static const char PROGMEM atcmd32_help[] =
240 "AD3/DIO3 Configuration. (0 - unmonitored input, "
241 "2 - analog input, 3 - digital input, 4 - digital output "
242 "low, 5 - digital output high). Default is 0.";
244 static const char PROGMEM atcmd33_name[] = "D4";
245 static const char PROGMEM atcmd33_desc[] = "dio4-ad4";
246 static const char PROGMEM atcmd33_help[] =
247 "AD4/DIO4 Configuration. (0 - unmonitored input, "
248 "2 - analog input, 3 - digital input, 4 - digital output "
249 "low, 5 - digital output high). Default is 0.";
251 static const char PROGMEM atcmd34_name[] = "D5";
252 static const char PROGMEM atcmd34_desc[] = "dio5-ad5";
253 static const char PROGMEM atcmd34_help[] =
254 "AD4/DIO4 Configuration. (0 - unmonitored input, 1 - LED, "
255 "2 - analog input, 3 - digital input, 4 - digital output "
256 "low, 5 - digital output high). Default is 1.";
258 static const char PROGMEM atcmd35_name[] = "D8";
259 static const char PROGMEM atcmd35_desc[] = "dio8-sleep-rq";
260 static const char PROGMEM atcmd35_help[] =
261 "DIO8/SLEEP_RQ Configuration. (0 - unmonitored input, 1 - LED, "
262 "2 - analog input, 3 - digital input, 4 - digital output "
263 "low, 5 - digital output high). Default is 0. When used as "
264 "SLEEP_RQ, the D8 parameter should be configured in mode 0 "
267 static const char PROGMEM atcmd36_name[] = "D9";
268 static const char PROGMEM atcmd36_desc[] = "dio9-on-sleep";
269 static const char PROGMEM atcmd36_help[] =
270 "DIO9/ON_SLEEP Configuration. (0 - unmonitored input, 1 - "
271 "ON/SLEEP, 2 - analog input, 3 - digital input, 4 - digital "
272 "output low, 5 - digital output high). Default is ?.";
274 static const char PROGMEM atcmd37_name[] = "PR";
275 static const char PROGMEM atcmd37_desc[] = "pull-up-resistor";
276 static const char PROGMEM atcmd37_help[] =
277 "Pull-up Resistor. Bit field that configures the internal "
278 "pull-up resistors for the I/O lines (bit set = pull-up "
279 "enabled). Range is from 0 to 0x1FFF, default is 0x1FFF.";
281 static const char PROGMEM atcmd38_name[] = "M0";
282 static const char PROGMEM atcmd38_desc[] = "pwm0-out-level";
283 static const char PROGMEM atcmd38_help[] =
284 "PWM0 Output Level. The line should be configured as a PWM "
285 "output using the P0 command (0 to 0x3FF, default is 0).";
287 static const char PROGMEM atcmd39_name[] = "M1";
288 static const char PROGMEM atcmd39_desc[] = "pwm1-out-level";
289 static const char PROGMEM atcmd39_help[] =
290 "PWM1 Output Level. The line should be configured as a PWM "
291 "output using the P1 command (0 to 0x3FF, default is 0).";
293 static const char PROGMEM atcmd40_name[] = "LT";
294 static const char PROGMEM atcmd40_desc[] = "led-blink-time";
295 static const char PROGMEM atcmd40_help[] =
296 "Associate LED Blink Time (should be enabled through D5 ";
298 static const char PROGMEM atcmd41_name[] = "IS";
299 static const char PROGMEM atcmd41_desc[] = "force-sample";
300 static const char PROGMEM atcmd41_help[] =
301 "Forces a read of all enabled digital and "
302 "analog input lines.";
304 static const char PROGMEM atcmd42_name[] = "IC";
305 static const char PROGMEM atcmd42_desc[] = "digital-change-detect";
306 static const char PROGMEM atcmd42_help[] =
307 "I/O Digital Change Detection. If a pin is enabled as a "
308 "digital input/output, the IC command can be used to "
309 "force an immediate I/O sample transmission when the DIO "
310 "state changes. IC is a bitmask, range is 0 to 0xFFFF, "
313 static const char PROGMEM atcmd43_name[] = "IR";
314 static const char PROGMEM atcmd43_desc[] = "io-sample-rate";
315 static const char PROGMEM atcmd43_help[] =
316 "IO Sample Rate for periodic sampling. If zero, periodic "
317 "sampling is disabled. Else the value is in milliseconds "
318 "(range 0 to 0xFFFF, default is 0).";
320 static const char PROGMEM atcmd44_name[] = "CB";
321 static const char PROGMEM atcmd44_desc[] = "comissioning-button";
322 static const char PROGMEM atcmd44_help[] =
323 "Commissioning Pushbutton, simulate commissioning button "
324 "in software. The parameter value should be set to the number "
325 "of button presses to be simulated (range is 0 to 4).";
327 static const char PROGMEM atcmd45_name[] = "VR";
328 static const char PROGMEM atcmd45_desc[] = "firmware-version";
329 static const char PROGMEM atcmd45_help[] =
330 "Firmware version of the module (read only).";
332 static const char PROGMEM atcmd46_name[] = "HV";
333 static const char PROGMEM atcmd46_desc[] = "hardware-version";
334 static const char PROGMEM atcmd46_help[] =
335 "Hardware version of the module (read only).";
337 static const char PROGMEM atcmd47_name[] = "CK";
338 static const char PROGMEM atcmd47_desc[] = "config-code";
339 static const char PROGMEM atcmd47_help[] =
340 "Configuration Code, that can be used as a quick "
341 "check to determine if a node has been configured as "
342 "desired (read-only, 0-0xFFFFFFFF).";
344 static const char PROGMEM atcmd48_name[] = "ER";
345 static const char PROGMEM atcmd48_desc[] = "rf-errors";
346 static const char PROGMEM atcmd48_help[] =
347 "Number of times a packet was received which contained errors "
348 "of some sort. Read-only, saturate at 0xFFFF.";
350 static const char PROGMEM atcmd49_name[] = "GD";
351 static const char PROGMEM atcmd49_desc[] = "good-packets";
352 static const char PROGMEM atcmd49_help[] =
353 "Number of good received frames. Read-only, saturate at "
356 static const char PROGMEM atcmd50_name[] = "RP";
357 static const char PROGMEM atcmd50_desc[] = "rssi-pwm-timer";
358 static const char PROGMEM atcmd50_help[] =
359 "RSSI PWM timer, the time in tenth of seconds that the RSSI "
360 "output indicating signal strength will remain active after "
361 "the last reception (1 to 0xff, default is 0x20 = 3.2 secs).";
363 static const char PROGMEM atcmd51_name[] = "TR";
364 static const char PROGMEM atcmd51_desc[] = "tx-errors";
365 static const char PROGMEM atcmd51_help[] =
366 "Transmission Errors, the number of MAC frames that "
367 "exhaust MAC retries without ever receiving a MAC "
368 "acknowledgement message. Read-only, saturate at 0xFFFF.";
370 static const char PROGMEM atcmd52_name[] = "TP";
371 static const char PROGMEM atcmd52_desc[] = "temperature";
372 static const char PROGMEM atcmd52_help[] =
373 "Temperature. Read module temperature in (tenths of ?) "
374 "Celsius. Negatives temperatures can be returned (read-only, "
375 "from 0xff74 [-140] to 0x0258 [600]).";
377 static const char PROGMEM atcmd53_name[] = "DB";
378 static const char PROGMEM atcmd53_desc[] = "rx-signal-strength";
379 static const char PROGMEM atcmd53_help[] =
380 "Received Signal Strength of the last received RF data "
381 "packet measured in -dBm. For example if DB returns 0x60, "
382 "then the RSSI of the last packet received was -96dBm "
385 static const char PROGMEM atcmd54_name[] = "DC";
386 static const char PROGMEM atcmd54_desc[] = "duty-cycle";
387 static const char PROGMEM atcmd54_help[] =
388 "Duty Cycle. Returns a current usage percentage of the "
389 "10% duty cycle measured over the period of 1 hour "
390 "(read-only, from 0 to 0x64).";
392 static const char PROGMEM atcmd55_name[] = "RC";
393 static const char PROGMEM atcmd55_desc[] = "rssi-for-channel";
394 static const char PROGMEM atcmd55_help[] =
395 "Reads the dBm level (RSSI) of the designated "
398 static const char PROGMEM atcmd56_name[] = "R#";
399 static const char PROGMEM atcmd56_desc[] = "reset-number";
400 static const char PROGMEM atcmd56_help[] =
401 "Tells the reason for the last module reset (0 - Power up "
402 "reset, 2 - Watchdog reset, 3 - Software reset, 4 - Reset "
403 "line reset, 5 - Brownout reset). Read-only.";
405 static const char PROGMEM atcmd57_name[] = "TA";
406 static const char PROGMEM atcmd57_desc[] = "tx-ack-errors";
407 static const char PROGMEM atcmd57_help[] =
408 "Transmit Acknowlegement Errors. Incremented once for "
409 "each failed ack retry (read-only, from 0 to 0xFFFF).";
411 static const char PROGMEM atcmd58_name[] = "%V";
412 static const char PROGMEM atcmd58_desc[] = "supply-voltage";
413 static const char PROGMEM atcmd58_help[] =
414 "Voltage on the Vcc pin in mV (read-only, from 0 to 0xF00).";
416 static const char PROGMEM atcmd59_name[] = "CT";
417 static const char PROGMEM atcmd59_desc[] = "cmd-mode-timeout";
418 static const char PROGMEM atcmd59_help[] =
419 "Command Mode Timeout: the period of inactivity (no valid "
420 "commands received) after which the RF module automatically "
421 "exits AT Command Mode and returns to Idle Mode (2 to 0x1770, "
424 static const char PROGMEM atcmd60_name[] = "CN";
425 static const char PROGMEM atcmd60_desc[] = "exit-cmd-mode";
426 static const char PROGMEM atcmd60_help[] =
427 "Exit Command Mode.";
429 static const char PROGMEM atcmd61_name[] = "GT";
430 static const char PROGMEM atcmd61_desc[] = "guard-times";
431 static const char PROGMEM atcmd61_help[] =
432 "Guard Times: period of silence in ms before and after the "
433 "Command Sequence Characters of the AT Command Mode Sequence, "
434 "used to prevent inadvertent entrance into AT Command Mode "
435 "(0 to 0xFFFF, default is 0x3E8).";
437 static const char PROGMEM atcmd62_name[] = "CC";
438 static const char PROGMEM atcmd62_desc[] = "command-chars";
439 static const char PROGMEM atcmd62_help[] =
440 "Command Character used between guard times of the AT Command "
441 "Mode Sequence (0 to 0xFF, default is 0x2B).";
443 static const char PROGMEM atcmd63_name[] = "ID";
444 static const char PROGMEM atcmd63_desc[] = "network-id";
445 static const char PROGMEM atcmd63_help[] =
446 "Network ID. Nodes must have the same network identifier "
447 "to communicate (0 to 0x7FFF, default is 0x7FFF).";
449 static const char PROGMEM atcmd64_name[] = "NT";
450 static const char PROGMEM atcmd64_desc[] = "ndisc-timeout";
451 static const char PROGMEM atcmd64_help[] =
452 "Node Discover Timeout, time in tenth of secs a node will "
453 "spend discovering other nodes when ND or DN is issued (0 "
454 "to 0xFC, default is 0x82).";
456 static const char PROGMEM atcmd65_name[] = "NI";
457 static const char PROGMEM atcmd65_desc[] = "node-id";
458 static const char PROGMEM atcmd65_help[] =
459 "Node Identifier in printable ASCII characters. This string is "
460 "returned as part of the ATND (Network Discover) command. This "
461 "identifier is also used with the ATDN (Destination Node) "
462 "command. The string contains up to 20 byte ASCII string, "
463 "default is a space character.";
465 static const char PROGMEM atcmd66_name[] = "DN";
466 static const char PROGMEM atcmd66_desc[] = "disc-node";
467 static const char PROGMEM atcmd66_help[] = /* XXX */
468 "Resolves a Node Identifier string to a physical address "
469 "(case sensitive). 0xFFFE and the 64bits extended address are "
472 static const char PROGMEM atcmd67_name[] = "ND";
473 static const char PROGMEM atcmd67_desc[] = "network-discover";
474 static const char PROGMEM atcmd67_help[] = "Network Discovery, see doc"; /* XXX */
476 static const char PROGMEM atcmd68_name[] = "NO";
477 static const char PROGMEM atcmd68_desc[] = "ndisc-options";
478 static const char PROGMEM atcmd68_help[] =
479 "Network Discovery Options, a bitfield value that changes the "
480 "behavior of the ND command (bit0 - Append DD value, bit1 - "
481 "Local device sends ND response frame when ND is issued). "
484 static const char PROGMEM atcmd69_name[] = "EE";
485 static const char PROGMEM atcmd69_desc[] = "security enable";
486 static const char PROGMEM atcmd69_help[] =
487 "Enable or disable 128-bit AES encryption (0 or 1, 0 is the "
490 static const char PROGMEM atcmd70_name[] = "KY"; /* XXX */;
491 static const char PROGMEM atcmd70_desc[] = "security-key";
492 static const char PROGMEM atcmd70_help[] =
493 "The 128bits security key (the command is write-only).";
495 static const char PROGMEM atcmd71_name[] = "MT";
496 static const char PROGMEM atcmd71_desc[] = "bcast-multi-xmit";
497 static const char PROGMEM atcmd71_help[] =
498 "Number of additional MAC-level broadcast transmissions. All "
499 "broadcast packets are transmitted MT+1 times to ensure "
500 "it is received (0 to 0xF, default is 3).";
502 static const char PROGMEM atcmd72_name[] = "RR";
503 static const char PROGMEM atcmd72_desc[] = "unicast-retries";
504 static const char PROGMEM atcmd72_help[] =
505 "Number of additional MAC-level packet delivery attempts for "
506 "unicast transactions. If RR is non-zero, packets sent from "
507 "the radio will request an acknowledgement, and can be resent "
508 "up to RR times if no acknowledgement is received. (0 to 0xF, "
511 static const char PROGMEM atcmd73_name[] = "PL";
512 static const char PROGMEM atcmd73_desc[] = "power-level";
513 static const char PROGMEM atcmd73_help[] =
514 "Power Level of RF transmitter (0 - 1mW, 1 - 23mW, 2 - 100mW, "
515 "3 - 158 mW, 4 - 316 mW). Default is 4.";
517 static const char PROGMEM atcmd74_name[] = "SM";
518 static const char PROGMEM atcmd74_desc[] = "sleep-mode";
519 static const char PROGMEM atcmd74_help[] =
520 "Sleep Mode (0 - disabled, 1 - pin sleep, 4 - async cyclic "
521 "sleep, 5 - async cyclic sleep with pin wakeup). Default "
524 static const char PROGMEM atcmd75_name[] = "SO";
525 static const char PROGMEM atcmd75_desc[] = "sleep-options";
526 static const char PROGMEM atcmd75_help[] =
527 "Sleep Options bitmask (bit8 - always wake for ST time). "
530 static const char PROGMEM atcmd76_name[] = "ST";
531 static const char PROGMEM atcmd76_desc[] = "wake-time";
532 static const char PROGMEM atcmd76_help[] =
533 "Wake Time: the amount of time in ms that the module will stay "
534 "awake after receiving RF or serial data (from 0x45 to "
535 "0x36EE80, default is 0x7D0 = 2 secs).";
537 static const char PROGMEM atcmd77_name[] = "SP";
538 static const char PROGMEM atcmd77_desc[] = "sleep-period";
539 static const char PROGMEM atcmd77_help[] =
540 "Sleep Period: the amount of time in 10ms unit the module will "
541 "sleep per cycle. For a node operating as an Indirect "
542 "Messaging Coordinator, this command defines the amount of "
543 "time that it will hold an indirect message for an end device. "
544 "The coordinator will hold the message for (2.5 * SP). Range "
545 "is from 1 to 1440000, default is 200 (2 secs).";
547 static const char PROGMEM atcmd78_name[] = "SN";
548 static const char PROGMEM atcmd78_desc[] = "num-sleep-periods";
549 static const char PROGMEM atcmd78_help[] =
550 "Number of Sleep Periods that must elapse between assertions "
551 "of the ON_SLEEP line during the wake time of asynchronous "
552 "cyclic sleep (1 to 0xFFFF, default is 1).";
554 static const char PROGMEM atcmd79_name[] = "WH";
555 static const char PROGMEM atcmd79_desc[] = "wake-host";
556 static const char PROGMEM atcmd79_help[] = "Wake Host time. If it is set to a non-zero value, it "
557 "specifies the time in ms that the device should allow after "
558 "waking from sleep before sending data out the UART or "
559 "transmitting an I/O sample. If serial characters are "
560 "received, the WH timer is stopped immediately. Range is "
561 "from 0 to 0xFFFF, default is 0.";
563 const struct xbee_atcmd PROGMEM xbee_atcmd_list[] = {
568 XBEE_ATCMD_F_PARAM_NONE | XBEE_ATCMD_F_WRITE,
575 XBEE_ATCMD_F_PARAM_NONE | XBEE_ATCMD_F_WRITE,
582 XBEE_ATCMD_F_PARAM_NONE | XBEE_ATCMD_F_WRITE,
589 XBEE_ATCMD_F_PARAM_NONE | XBEE_ATCMD_F_WRITE,
596 XBEE_ATCMD_F_PARAM_NONE | XBEE_ATCMD_F_WRITE,
603 XBEE_ATCMD_F_PARAM_NONE | XBEE_ATCMD_F_WRITE,
610 XBEE_ATCMD_F_PARAM_U32 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
617 XBEE_ATCMD_F_PARAM_U32 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
624 XBEE_ATCMD_F_PARAM_U32 | XBEE_ATCMD_F_READ,
631 XBEE_ATCMD_F_PARAM_U32 | XBEE_ATCMD_F_READ,
638 XBEE_ATCMD_F_PARAM_U32 | XBEE_ATCMD_F_READ,
645 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
652 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
659 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
666 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ,
673 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
680 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
687 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
694 XBEE_ATCMD_F_PARAM_U32 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
701 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
708 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
715 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
722 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
729 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
736 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
743 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
750 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
757 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
764 XBEE_ATCMD_F_PARAM_NONE | XBEE_ATCMD_F_WRITE,
771 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
778 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
785 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
792 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
799 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
806 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
813 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
820 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
827 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
834 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
841 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
848 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
855 XBEE_ATCMD_F_PARAM_NONE | XBEE_ATCMD_F_WRITE,
862 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
869 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
876 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
883 XBEE_ATCMD_F_PARAM_U32 | XBEE_ATCMD_F_READ,
890 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ,
897 XBEE_ATCMD_F_PARAM_U32 | XBEE_ATCMD_F_READ,
904 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ,
911 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ,
918 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
925 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ,
932 XBEE_ATCMD_F_PARAM_S16 | XBEE_ATCMD_F_READ,
939 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ,
946 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ,
953 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ,
960 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ,
967 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ,
974 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ,
981 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
988 XBEE_ATCMD_F_PARAM_NONE | XBEE_ATCMD_F_WRITE,
995 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1002 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1009 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1016 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1023 XBEE_ATCMD_F_PARAM_STRING_20B | XBEE_ATCMD_F_READ |
1031 XBEE_ATCMD_F_PARAM_STRING_20B | XBEE_ATCMD_F_READ |
1039 XBEE_ATCMD_F_PARAM_NONE | XBEE_ATCMD_F_WRITE,
1046 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1053 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1060 XBEE_ATCMD_F_PARAM_HEXBUF_16B | XBEE_ATCMD_F_WRITE,
1067 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1074 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1081 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1088 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1095 XBEE_ATCMD_F_PARAM_U8 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1102 XBEE_ATCMD_F_PARAM_U32 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1109 XBEE_ATCMD_F_PARAM_U32 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1116 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1123 XBEE_ATCMD_F_PARAM_U16 | XBEE_ATCMD_F_READ | XBEE_ATCMD_F_WRITE,
1134 const struct xbee_atcmd *xbee_atcmd_lookup_name(const char *atcmd_str)
1136 const struct xbee_atcmd *cmd;
1137 struct xbee_atcmd copy;
1139 for (cmd = &xbee_atcmd_list[0], memcpy_P(©, cmd, sizeof(copy));
1141 cmd++, memcpy_P(©, cmd, sizeof(copy))) {
1143 if (!strcmp_P(atcmd_str, copy.name))
1147 if (copy.name == NULL) /* not found */
1153 const struct xbee_atcmd *xbee_atcmd_lookup_desc(const char *desc)
1155 const struct xbee_atcmd *cmd;
1156 struct xbee_atcmd copy;
1158 for (cmd = &xbee_atcmd_list[0], memcpy_P(©, cmd, sizeof(copy));
1160 cmd++, memcpy_P(©, cmd, sizeof(copy))) {
1161 if (!strcmp_P(desc, copy.desc))
1164 if (copy.name == NULL) /* not found */