X-Git-Url: http://git.droids-corp.org/?p=protos%2Fxbee-avr.git;a=blobdiff_plain;f=xbee_atcmd.c;h=426a80894570a54241b6ee7497e8eab1f17eac66;hp=25757868f74c708035e4c6d84e25b014d713b9ab;hb=57895b3bb2fe0582c589685b7df34f3968b346ec;hpb=9a9b64112aee5ab26398b46cb13b7e49c292a355 diff --git a/xbee_atcmd.c b/xbee_atcmd.c index 2575786..426a808 100644 --- a/xbee_atcmd.c +++ b/xbee_atcmd.c @@ -33,510 +33,510 @@ #include "xbee_atcmd.h" -prog_char atcmd0_name[] = "WR"; -prog_char atcmd0_desc[] = "write-param"; -prog_char atcmd0_help[] = +static const char PROGMEM atcmd0_name[] = "WR"; +static const char PROGMEM atcmd0_desc[] = "write-param"; +static const char PROGMEM atcmd0_help[] = "Write parameter values to non-volatile memory."; -prog_char atcmd1_name[] = "RE"; -prog_char atcmd1_desc[] = "restore-defaults"; -prog_char atcmd1_help[] = +static const char PROGMEM atcmd1_name[] = "RE"; +static const char PROGMEM atcmd1_desc[] = "restore-defaults"; +static const char PROGMEM atcmd1_help[] = "Restore module parameters to factory defaults."; -prog_char atcmd2_name[] = "FR"; -prog_char atcmd2_desc[] = "soft-reset"; -prog_char atcmd2_help[] = +static const char PROGMEM atcmd2_name[] = "FR"; +static const char PROGMEM atcmd2_desc[] = "soft-reset"; +static const char PROGMEM atcmd2_help[] = "Software Reset. Responds with 'OK' then performs a " "reset 100ms later."; -prog_char atcmd3_name[] = "AC"; -prog_char atcmd3_desc[] = "apply-changes"; -prog_char atcmd3_help[] = +static const char PROGMEM atcmd3_name[] = "AC"; +static const char PROGMEM atcmd3_desc[] = "apply-changes"; +static const char PROGMEM atcmd3_help[] = "Apply Changes without exiting command mode."; -prog_char atcmd4_name[] = "R1"; -prog_char atcmd4_desc[] = "restore-compiled"; -prog_char atcmd4_help[] = +static const char PROGMEM atcmd4_name[] = "R1"; +static const char PROGMEM atcmd4_desc[] = "restore-compiled"; +static const char PROGMEM atcmd4_help[] = "Restore module parameters to compiled defaults."; -prog_char atcmd5_name[] = "VL"; -prog_char atcmd5_desc[] = "version-long"; -prog_char atcmd5_help[] = +static const char PROGMEM atcmd5_name[] = "VL"; +static const char PROGMEM atcmd5_desc[] = "version-long"; +static const char PROGMEM atcmd5_help[] = "Shows detailed version information including" "application build date and time."; -prog_char atcmd6_name[] = "DH"; -prog_char atcmd6_desc[] = "dst-addr-high"; -prog_char atcmd6_help[] = +static const char PROGMEM atcmd6_name[] = "DH"; +static const char PROGMEM atcmd6_desc[] = "dst-addr-high"; +static const char PROGMEM atcmd6_help[] = "Upper 32 bits of the 64-bit destination address (0 " "to 0xFFFFFFFF, default is 0x0000FFFF)."; -prog_char atcmd7_name[] = "DL"; -prog_char atcmd7_desc[] = "dst-addr-low"; -prog_char atcmd7_help[] = +static const char PROGMEM atcmd7_name[] = "DL"; +static const char PROGMEM atcmd7_desc[] = "dst-addr-low"; +static const char PROGMEM atcmd7_help[] = "Lower 32 bits of the 64-bit destination address (0 " "to 0xFFFFFFFF, default is 0x0000FFFF)."; -prog_char atcmd8_name[] = "DD"; -prog_char atcmd8_desc[] = "device-type-id"; -prog_char atcmd8_help[] = +static const char PROGMEM atcmd8_name[] = "DD"; +static const char PROGMEM atcmd8_desc[] = "device-type-id"; +static const char PROGMEM atcmd8_help[] = "Device Type Identifier, it can be used to differentiate " "multiple XBee-based products (0 to 0xFFFFFFFF, read-only, " "default is 0x40000)."; -prog_char atcmd9_name[] = "SH"; -prog_char atcmd9_desc[] = "src-addr-high"; -prog_char atcmd9_help[] = +static const char PROGMEM atcmd9_name[] = "SH"; +static const char PROGMEM atcmd9_desc[] = "src-addr-high"; +static const char PROGMEM atcmd9_help[] = "Upper 32 bits of the 64-bit source address (read-only)."; -prog_char atcmd10_name[] = "SL"; -prog_char atcmd10_desc[] = "src-addr-low"; -prog_char atcmd10_help[] = +static const char PROGMEM atcmd10_name[] = "SL"; +static const char PROGMEM atcmd10_desc[] = "src-addr-low"; +static const char PROGMEM atcmd10_help[] = "Lower 32 bits of the 64-bit source address (read-only)."; -prog_char atcmd11_name[] = "SE"; -prog_char atcmd11_desc[] = "src-endpoint"; -prog_char atcmd11_help[] = +static const char PROGMEM atcmd11_name[] = "SE"; +static const char PROGMEM atcmd11_desc[] = "src-endpoint"; +static const char PROGMEM atcmd11_help[] = "The application source endpoint for all data transmissions " "(0 to 0xFF, default is 0xE8)."; -prog_char atcmd12_name[] = "DE"; -prog_char atcmd12_desc[] = "dst-endpoint"; -prog_char atcmd12_help[] = +static const char PROGMEM atcmd12_name[] = "DE"; +static const char PROGMEM atcmd12_desc[] = "dst-endpoint"; +static const char PROGMEM atcmd12_help[] = "The application destination endpoint for all data " "transmissions (0 to 0xFF, default is 0xE8)."; -prog_char atcmd13_name[] = "CI"; -prog_char atcmd13_desc[] = "cluster-id"; -prog_char atcmd13_help[] = +static const char PROGMEM atcmd13_name[] = "CI"; +static const char PROGMEM atcmd13_desc[] = "cluster-id"; +static const char PROGMEM atcmd13_help[] = "Cluster Identifier for all data transmissions (0 to 0xFFFF, " "default is 0x11)."; -prog_char atcmd14_name[] = "NP"; -prog_char atcmd14_desc[] = "max-rf-payload"; -prog_char atcmd14_help[] = +static const char PROGMEM atcmd14_name[] = "NP"; +static const char PROGMEM atcmd14_desc[] = "max-rf-payload"; +static const char PROGMEM atcmd14_help[] = "Maximum RF Payload Bytes that can be sent in a unicast " "transmission based on the current configuration (0 to " "0xFFFF)."; -prog_char atcmd15_name[] = "CE"; -prog_char atcmd15_desc[] = "coord-end-device"; -prog_char atcmd15_help[] = +static const char PROGMEM atcmd15_name[] = "CE"; +static const char PROGMEM atcmd15_desc[] = "coord-end-device"; +static const char PROGMEM atcmd15_help[] = "Coordinator/End Device, messaging mode of the module " "(0 - Normal, 1 - Indirect coordinator, 2 - Polling, default " "is 0)."; -prog_char atcmd16_name[] = "AP"; -prog_char atcmd16_desc[] = "api-mode"; -prog_char atcmd16_help[] = +static const char PROGMEM atcmd16_name[] = "AP"; +static const char PROGMEM atcmd16_desc[] = "api-mode"; +static const char PROGMEM atcmd16_help[] = "API mode (0 - off, 1 - on, 2 - on with escape sequences)."; -prog_char atcmd17_name[] = "AO"; -prog_char atcmd17_desc[] = "api-output-format"; -prog_char atcmd17_help[] = +static const char PROGMEM atcmd17_name[] = "AO"; +static const char PROGMEM atcmd17_desc[] = "api-output-format"; +static const char PROGMEM atcmd17_help[] = "API Output Format (0 - standard [0x90 for RX], 1 - explicit " "addressing [0x91 for RX])."; -prog_char atcmd18_name[] = "BD"; -prog_char atcmd18_desc[] = "baud-rate"; -prog_char atcmd18_help[] = +static const char PROGMEM atcmd18_name[] = "BD"; +static const char PROGMEM atcmd18_desc[] = "baud-rate"; +static const char PROGMEM atcmd18_help[] = "Baud rate of serial interface (0-8 select preset standard " "rates, and 0x39 to 0x1c9c38 select baud rate)."; -prog_char atcmd19_name[] = "RO"; -prog_char atcmd19_desc[] = "packetization-timeout"; -prog_char atcmd19_help[] = +static const char PROGMEM atcmd19_name[] = "RO"; +static const char PROGMEM atcmd19_desc[] = "packetization-timeout"; +static const char PROGMEM atcmd19_help[] = "Packetization Timeout: the inter-character silence required " "before packetization specified in character times (0 to 0xFF, " "default is 3)."; -prog_char atcmd20_name[] = "FT"; -prog_char atcmd20_desc[] = "flow-control-thres"; -prog_char atcmd20_help[] = +static const char PROGMEM atcmd20_name[] = "FT"; +static const char PROGMEM atcmd20_desc[] = "flow-control-thres"; +static const char PROGMEM atcmd20_help[] = "Flow Control Threshhold. De-assert CTS and/or send XOFF when " "FT bytes are in the UART receive buffer. Re-assert CTS when " "less than FT - 16 bytes are in the UART receive buffer (0x11 " "to 0xEE, default is 0xBE)."; -prog_char atcmd21_name[] = "NB"; -prog_char atcmd21_desc[] = "parity"; -prog_char atcmd21_help[] = +static const char PROGMEM atcmd21_name[] = "NB"; +static const char PROGMEM atcmd21_desc[] = "parity"; +static const char PROGMEM atcmd21_help[] = "Parity (0 - no parity, 1 - even parity, 2 - odd parity, 3 - " "forced high parity, 4 - forced low parity). Default is 0."; -prog_char atcmd22_name[] = "D7"; -prog_char atcmd22_desc[] = "dio7"; -prog_char atcmd22_help[] = +static const char PROGMEM atcmd22_name[] = "D7"; +static const char PROGMEM atcmd22_desc[] = "dio7"; +static const char PROGMEM atcmd22_help[] = "DIO7 Configuration (0 - unmonitored input, 1 - CTS, 3 - " "digital input, 4 - digital output low, 5 - digital output " "high, 6 - RS-485 low Tx, 7 - RS-485 high Tx). Default is " "0."; -prog_char atcmd23_name[] = "D6"; -prog_char atcmd23_desc[] = "dio6"; -prog_char atcmd23_help[] = +static const char PROGMEM atcmd23_name[] = "D6"; +static const char PROGMEM atcmd23_desc[] = "dio6"; +static const char PROGMEM atcmd23_help[] = "DIO6 Configuration (0 - unmonitored input, 1 - RTS, 3 - " "digital input, 4 - digital output low, 5 - digital output " "high). Default is 0."; -prog_char atcmd24_name[] = "P0"; -prog_char atcmd24_desc[] = "dio10-pwm0"; -prog_char atcmd24_help[] = +static const char PROGMEM atcmd24_name[] = "P0"; +static const char PROGMEM atcmd24_desc[] = "dio10-pwm0"; +static const char PROGMEM atcmd24_help[] = "DIO10/PWM0 Configuration. (0 - unmonitored input, 1 - RSSI, 2 " "- PWM0, 3 - digital input, 4 - digital output low, 5 - " "digital output high). Default is 1."; -prog_char atcmd25_name[] = "P1"; -prog_char atcmd25_desc[] = "dio11-pwm1"; -prog_char atcmd25_help[] = +static const char PROGMEM atcmd25_name[] = "P1"; +static const char PROGMEM atcmd25_desc[] = "dio11-pwm1"; +static const char PROGMEM atcmd25_help[] = "DIO11/PWM1 Configuration. (0 - unmonitored input, 2 " "- PWM1, 3 - digital input, 4 - digital output low, 5 - " "digital output high). Default is 0."; -prog_char atcmd26_name[] = "P2"; -prog_char atcmd26_desc[] = "dio12"; -prog_char atcmd26_help[] = +static const char PROGMEM atcmd26_name[] = "P2"; +static const char PROGMEM atcmd26_desc[] = "dio12"; +static const char PROGMEM atcmd26_help[] = "DIO12 Configuration. (0 - unmonitored input, " "3 - digital input, 4 - digital output low, 5 - " "digital output high). Default is 0."; -prog_char atcmd27_name[] = "RP"; -prog_char atcmd27_desc[] = "rssi-pwm"; -prog_char atcmd27_help[] = +static const char PROGMEM atcmd27_name[] = "RP"; +static const char PROGMEM atcmd27_desc[] = "rssi-pwm"; +static const char PROGMEM atcmd27_help[] = "Time RSSI signal will be output after last transmission. " "When RP[] = 0xFF, output will always be on (0 - 0xFF, default " "is 0x28[] = 4 seconds)."; -prog_char atcmd28_name[] = "1S"; -prog_char atcmd28_desc[] = "sensor-sample"; -prog_char atcmd28_help[] = +static const char PROGMEM atcmd28_name[] = "1S"; +static const char PROGMEM atcmd28_desc[] = "sensor-sample"; +static const char PROGMEM atcmd28_help[] = "Forces a sample to be taken on an XBee Sensor device."; -prog_char atcmd29_name[] = "D0"; -prog_char atcmd29_desc[] = "dio0-ad0"; -prog_char atcmd29_help[] = +static const char PROGMEM atcmd29_name[] = "D0"; +static const char PROGMEM atcmd29_desc[] = "dio0-ad0"; +static const char PROGMEM atcmd29_help[] = "AD0/DIO0 Configuration. (0 - unmonitored input, 1 - " "commission button enabled, 2 - analog input, 3 - digital " "input, 4 - digital output low, 5 - digital output high). " "Default is 1."; -prog_char atcmd30_name[] = "D1"; -prog_char atcmd30_desc[] = "dio1-ad1"; -prog_char atcmd30_help[] = +static const char PROGMEM atcmd30_name[] = "D1"; +static const char PROGMEM atcmd30_desc[] = "dio1-ad1"; +static const char PROGMEM atcmd30_help[] = "AD1/DIO1 Configuration. (0 - unmonitored input, " "2 - analog input, 3 - digital input, 4 - digital output " "low, 5 - digital output high). Default is 0."; -prog_char atcmd31_name[] = "D2"; -prog_char atcmd31_desc[] = "dio2-ad2"; -prog_char atcmd31_help[] = +static const char PROGMEM atcmd31_name[] = "D2"; +static const char PROGMEM atcmd31_desc[] = "dio2-ad2"; +static const char PROGMEM atcmd31_help[] = "AD2/DIO2 Configuration. (0 - unmonitored input, " "2 - analog input, 3 - digital input, 4 - digital output " "low, 5 - digital output high). Default is 0."; -prog_char atcmd32_name[] = "D3"; -prog_char atcmd32_desc[] = "dio3-ad3"; -prog_char atcmd32_help[] = +static const char PROGMEM atcmd32_name[] = "D3"; +static const char PROGMEM atcmd32_desc[] = "dio3-ad3"; +static const char PROGMEM atcmd32_help[] = "AD3/DIO3 Configuration. (0 - unmonitored input, " "2 - analog input, 3 - digital input, 4 - digital output " "low, 5 - digital output high). Default is 0."; -prog_char atcmd33_name[] = "D4"; -prog_char atcmd33_desc[] = "dio4-ad4"; -prog_char atcmd33_help[] = +static const char PROGMEM atcmd33_name[] = "D4"; +static const char PROGMEM atcmd33_desc[] = "dio4-ad4"; +static const char PROGMEM atcmd33_help[] = "AD4/DIO4 Configuration. (0 - unmonitored input, " "2 - analog input, 3 - digital input, 4 - digital output " "low, 5 - digital output high). Default is 0."; -prog_char atcmd34_name[] = "D5"; -prog_char atcmd34_desc[] = "dio5-ad5"; -prog_char atcmd34_help[] = +static const char PROGMEM atcmd34_name[] = "D5"; +static const char PROGMEM atcmd34_desc[] = "dio5-ad5"; +static const char PROGMEM atcmd34_help[] = "AD4/DIO4 Configuration. (0 - unmonitored input, 1 - LED, " "2 - analog input, 3 - digital input, 4 - digital output " "low, 5 - digital output high). Default is 1."; -prog_char atcmd35_name[] = "D8"; -prog_char atcmd35_desc[] = "dio8-sleep-rq"; -prog_char atcmd35_help[] = +static const char PROGMEM atcmd35_name[] = "D8"; +static const char PROGMEM atcmd35_desc[] = "dio8-sleep-rq"; +static const char PROGMEM atcmd35_help[] = "DIO8/SLEEP_RQ Configuration. (0 - unmonitored input, 1 - LED, " "2 - analog input, 3 - digital input, 4 - digital output " "low, 5 - digital output high). Default is 0. When used as " "SLEEP_RQ, the D8 parameter should be configured in mode 0 " "or 3."; -prog_char atcmd36_name[] = "D9"; -prog_char atcmd36_desc[] = "dio9-on-sleep"; -prog_char atcmd36_help[] = +static const char PROGMEM atcmd36_name[] = "D9"; +static const char PROGMEM atcmd36_desc[] = "dio9-on-sleep"; +static const char PROGMEM atcmd36_help[] = "DIO9/ON_SLEEP Configuration. (0 - unmonitored input, 1 - " "ON/SLEEP, 2 - analog input, 3 - digital input, 4 - digital " "output low, 5 - digital output high). Default is ?."; -prog_char atcmd37_name[] = "PR"; -prog_char atcmd37_desc[] = "pull-up-resistor"; -prog_char atcmd37_help[] = +static const char PROGMEM atcmd37_name[] = "PR"; +static const char PROGMEM atcmd37_desc[] = "pull-up-resistor"; +static const char PROGMEM atcmd37_help[] = "Pull-up Resistor. Bit field that configures the internal " "pull-up resistors for the I/O lines (bit set = pull-up " "enabled). Range is from 0 to 0x1FFF, default is 0x1FFF."; -prog_char atcmd38_name[] = "M0"; -prog_char atcmd38_desc[] = "pwm0-out-level"; -prog_char atcmd38_help[] = +static const char PROGMEM atcmd38_name[] = "M0"; +static const char PROGMEM atcmd38_desc[] = "pwm0-out-level"; +static const char PROGMEM atcmd38_help[] = "PWM0 Output Level. The line should be configured as a PWM " "output using the P0 command (0 to 0x3FF, default is 0)."; -prog_char atcmd39_name[] = "M1"; -prog_char atcmd39_desc[] = "pwm1-out-level"; -prog_char atcmd39_help[] = +static const char PROGMEM atcmd39_name[] = "M1"; +static const char PROGMEM atcmd39_desc[] = "pwm1-out-level"; +static const char PROGMEM atcmd39_help[] = "PWM1 Output Level. The line should be configured as a PWM " "output using the P1 command (0 to 0x3FF, default is 0)."; -prog_char atcmd40_name[] = "LT"; -prog_char atcmd40_desc[] = "led-blink-time"; -prog_char atcmd40_help[] = +static const char PROGMEM atcmd40_name[] = "LT"; +static const char PROGMEM atcmd40_desc[] = "led-blink-time"; +static const char PROGMEM atcmd40_help[] = "Associate LED Blink Time (should be enabled through D5 "; -prog_char atcmd41_name[] = "IS"; -prog_char atcmd41_desc[] = "force-sample"; -prog_char atcmd41_help[] = +static const char PROGMEM atcmd41_name[] = "IS"; +static const char PROGMEM atcmd41_desc[] = "force-sample"; +static const char PROGMEM atcmd41_help[] = "Forces a read of all enabled digital and " "analog input lines."; -prog_char atcmd42_name[] = "IC"; -prog_char atcmd42_desc[] = "digital-change-detect"; -prog_char atcmd42_help[] = +static const char PROGMEM atcmd42_name[] = "IC"; +static const char PROGMEM atcmd42_desc[] = "digital-change-detect"; +static const char PROGMEM atcmd42_help[] = "I/O Digital Change Detection. If a pin is enabled as a " "digital input/output, the IC command can be used to " "force an immediate I/O sample transmission when the DIO " "state changes. IC is a bitmask, range is 0 to 0xFFFF, " "default is 0"; -prog_char atcmd43_name[] = "IR"; -prog_char atcmd43_desc[] = "io-sample-rate"; -prog_char atcmd43_help[] = +static const char PROGMEM atcmd43_name[] = "IR"; +static const char PROGMEM atcmd43_desc[] = "io-sample-rate"; +static const char PROGMEM atcmd43_help[] = "IO Sample Rate for periodic sampling. If zero, periodic " "sampling is disabled. Else the value is in milliseconds " "(range 0 to 0xFFFF, default is 0)."; -prog_char atcmd44_name[] = "CB"; -prog_char atcmd44_desc[] = "comissioning-button"; -prog_char atcmd44_help[] = +static const char PROGMEM atcmd44_name[] = "CB"; +static const char PROGMEM atcmd44_desc[] = "comissioning-button"; +static const char PROGMEM atcmd44_help[] = "Commissioning Pushbutton, simulate commissioning button " "in software. The parameter value should be set to the number " "of button presses to be simulated (range is 0 to 4)."; -prog_char atcmd45_name[] = "VR"; -prog_char atcmd45_desc[] = "firmware-version"; -prog_char atcmd45_help[] = +static const char PROGMEM atcmd45_name[] = "VR"; +static const char PROGMEM atcmd45_desc[] = "firmware-version"; +static const char PROGMEM atcmd45_help[] = "Firmware version of the module (read only)."; -prog_char atcmd46_name[] = "HV"; -prog_char atcmd46_desc[] = "hardware-version"; -prog_char atcmd46_help[] = +static const char PROGMEM atcmd46_name[] = "HV"; +static const char PROGMEM atcmd46_desc[] = "hardware-version"; +static const char PROGMEM atcmd46_help[] = "Hardware version of the module (read only)."; -prog_char atcmd47_name[] = "CK"; -prog_char atcmd47_desc[] = "config-code"; -prog_char atcmd47_help[] = +static const char PROGMEM atcmd47_name[] = "CK"; +static const char PROGMEM atcmd47_desc[] = "config-code"; +static const char PROGMEM atcmd47_help[] = "Configuration Code, that can be used as a quick " "check to determine if a node has been configured as " "desired (read-only, 0-0xFFFFFFFF)."; -prog_char atcmd48_name[] = "ER"; -prog_char atcmd48_desc[] = "rf-errors"; -prog_char atcmd48_help[] = +static const char PROGMEM atcmd48_name[] = "ER"; +static const char PROGMEM atcmd48_desc[] = "rf-errors"; +static const char PROGMEM atcmd48_help[] = "Number of times a packet was received which contained errors " "of some sort. Read-only, saturate at 0xFFFF."; -prog_char atcmd49_name[] = "GD"; -prog_char atcmd49_desc[] = "good-packets"; -prog_char atcmd49_help[] = +static const char PROGMEM atcmd49_name[] = "GD"; +static const char PROGMEM atcmd49_desc[] = "good-packets"; +static const char PROGMEM atcmd49_help[] = "Number of good received frames. Read-only, saturate at " "0xFFFF."; -prog_char atcmd50_name[] = "RP"; -prog_char atcmd50_desc[] = "rssi-pwm-timer"; -prog_char atcmd50_help[] = +static const char PROGMEM atcmd50_name[] = "RP"; +static const char PROGMEM atcmd50_desc[] = "rssi-pwm-timer"; +static const char PROGMEM atcmd50_help[] = "RSSI PWM timer, the time in tenth of seconds that the RSSI " "output indicating signal strength will remain active after " "the last reception (1 to 0xff, default is 0x20 = 3.2 secs)."; -prog_char atcmd51_name[] = "TR"; -prog_char atcmd51_desc[] = "tx-errors"; -prog_char atcmd51_help[] = +static const char PROGMEM atcmd51_name[] = "TR"; +static const char PROGMEM atcmd51_desc[] = "tx-errors"; +static const char PROGMEM atcmd51_help[] = "Transmission Errors, the number of MAC frames that " "exhaust MAC retries without ever receiving a MAC " "acknowledgement message. Read-only, saturate at 0xFFFF."; -prog_char atcmd52_name[] = "TP"; -prog_char atcmd52_desc[] = "temperature"; -prog_char atcmd52_help[] = +static const char PROGMEM atcmd52_name[] = "TP"; +static const char PROGMEM atcmd52_desc[] = "temperature"; +static const char PROGMEM atcmd52_help[] = "Temperature. Read module temperature in (tenths of ?) " "Celsius. Negatives temperatures can be returned (read-only, " "from 0xff74 [-140] to 0x0258 [600])."; -prog_char atcmd53_name[] = "DB"; -prog_char atcmd53_desc[] = "rx-signal-strength"; -prog_char atcmd53_help[] = +static const char PROGMEM atcmd53_name[] = "DB"; +static const char PROGMEM atcmd53_desc[] = "rx-signal-strength"; +static const char PROGMEM atcmd53_help[] = "Received Signal Strength of the last received RF data " "packet measured in -dBm. For example if DB returns 0x60, " "then the RSSI of the last packet received was -96dBm " "(read-only)."; -prog_char atcmd54_name[] = "DC"; -prog_char atcmd54_desc[] = "duty-cycle"; -prog_char atcmd54_help[] = +static const char PROGMEM atcmd54_name[] = "DC"; +static const char PROGMEM atcmd54_desc[] = "duty-cycle"; +static const char PROGMEM atcmd54_help[] = "Duty Cycle. Returns a current usage percentage of the " "10% duty cycle measured over the period of 1 hour " "(read-only, from 0 to 0x64)."; -prog_char atcmd55_name[] = "RC"; -prog_char atcmd55_desc[] = "rssi-for-channel"; -prog_char atcmd55_help[] = +static const char PROGMEM atcmd55_name[] = "RC"; +static const char PROGMEM atcmd55_desc[] = "rssi-for-channel"; +static const char PROGMEM atcmd55_help[] = "Reads the dBm level (RSSI) of the designated " "channel."; -prog_char atcmd56_name[] = "R#"; -prog_char atcmd56_desc[] = "reset-number"; -prog_char atcmd56_help[] = +static const char PROGMEM atcmd56_name[] = "R#"; +static const char PROGMEM atcmd56_desc[] = "reset-number"; +static const char PROGMEM atcmd56_help[] = "Tells the reason for the last module reset (0 - Power up " "reset, 2 - Watchdog reset, 3 - Software reset, 4 - Reset " "line reset, 5 - Brownout reset). Read-only."; -prog_char atcmd57_name[] = "TA"; -prog_char atcmd57_desc[] = "tx-ack-errors"; -prog_char atcmd57_help[] = +static const char PROGMEM atcmd57_name[] = "TA"; +static const char PROGMEM atcmd57_desc[] = "tx-ack-errors"; +static const char PROGMEM atcmd57_help[] = "Transmit Acknowlegement Errors. Incremented once for " "each failed ack retry (read-only, from 0 to 0xFFFF)."; -prog_char atcmd58_name[] = "%V"; -prog_char atcmd58_desc[] = "supply-voltage"; -prog_char atcmd58_help[] = +static const char PROGMEM atcmd58_name[] = "%V"; +static const char PROGMEM atcmd58_desc[] = "supply-voltage"; +static const char PROGMEM atcmd58_help[] = "Voltage on the Vcc pin in mV (read-only, from 0 to 0xF00)."; -prog_char atcmd59_name[] = "CT"; -prog_char atcmd59_desc[] = "cmd-mode-timeout"; -prog_char atcmd59_help[] = +static const char PROGMEM atcmd59_name[] = "CT"; +static const char PROGMEM atcmd59_desc[] = "cmd-mode-timeout"; +static const char PROGMEM atcmd59_help[] = "Command Mode Timeout: the period of inactivity (no valid " "commands received) after which the RF module automatically " "exits AT Command Mode and returns to Idle Mode (2 to 0x1770, " "default is 0x64)."; -prog_char atcmd60_name[] = "CN"; -prog_char atcmd60_desc[] = "exit-cmd-mode"; -prog_char atcmd60_help[] = +static const char PROGMEM atcmd60_name[] = "CN"; +static const char PROGMEM atcmd60_desc[] = "exit-cmd-mode"; +static const char PROGMEM atcmd60_help[] = "Exit Command Mode."; -prog_char atcmd61_name[] = "GT"; -prog_char atcmd61_desc[] = "guard-times"; -prog_char atcmd61_help[] = +static const char PROGMEM atcmd61_name[] = "GT"; +static const char PROGMEM atcmd61_desc[] = "guard-times"; +static const char PROGMEM atcmd61_help[] = "Guard Times: period of silence in ms before and after the " "Command Sequence Characters of the AT Command Mode Sequence, " "used to prevent inadvertent entrance into AT Command Mode " "(0 to 0xFFFF, default is 0x3E8)."; -prog_char atcmd62_name[] = "CC"; -prog_char atcmd62_desc[] = "command-chars"; -prog_char atcmd62_help[] = +static const char PROGMEM atcmd62_name[] = "CC"; +static const char PROGMEM atcmd62_desc[] = "command-chars"; +static const char PROGMEM atcmd62_help[] = "Command Character used between guard times of the AT Command " "Mode Sequence (0 to 0xFF, default is 0x2B)."; -prog_char atcmd63_name[] = "ID"; -prog_char atcmd63_desc[] = "network-id"; -prog_char atcmd63_help[] = +static const char PROGMEM atcmd63_name[] = "ID"; +static const char PROGMEM atcmd63_desc[] = "network-id"; +static const char PROGMEM atcmd63_help[] = "Network ID. Nodes must have the same network identifier " "to communicate (0 to 0x7FFF, default is 0x7FFF)."; -prog_char atcmd64_name[] = "NT"; -prog_char atcmd64_desc[] = "ndisc-timeout"; -prog_char atcmd64_help[] = +static const char PROGMEM atcmd64_name[] = "NT"; +static const char PROGMEM atcmd64_desc[] = "ndisc-timeout"; +static const char PROGMEM atcmd64_help[] = "Node Discover Timeout, time in tenth of secs a node will " "spend discovering other nodes when ND or DN is issued (0 " "to 0xFC, default is 0x82)."; -prog_char atcmd65_name[] = "NI"; -prog_char atcmd65_desc[] = "node-id"; -prog_char atcmd65_help[] = +static const char PROGMEM atcmd65_name[] = "NI"; +static const char PROGMEM atcmd65_desc[] = "node-id"; +static const char PROGMEM atcmd65_help[] = "Node Identifier in printable ASCII characters. This string is " "returned as part of the ATND (Network Discover) command. This " "identifier is also used with the ATDN (Destination Node) " "command. The string contains up to 20 byte ASCII string, " "default is a space character."; -prog_char atcmd66_name[] = "DN"; -prog_char atcmd66_desc[] = "disc-node"; -prog_char atcmd66_help[] = /* XXX */ +static const char PROGMEM atcmd66_name[] = "DN"; +static const char PROGMEM atcmd66_desc[] = "disc-node"; +static const char PROGMEM atcmd66_help[] = /* XXX */ "Resolves a Node Identifier string to a physical address " "(case sensitive). 0xFFFE and the 64bits extended address are " "returned."; -prog_char atcmd67_name[] = "ND"; -prog_char atcmd67_desc[] = "network-discover"; -prog_char atcmd67_help[] = "Network Discovery, see doc"; /* XXX */ +static const char PROGMEM atcmd67_name[] = "ND"; +static const char PROGMEM atcmd67_desc[] = "network-discover"; +static const char PROGMEM atcmd67_help[] = "Network Discovery, see doc"; /* XXX */ -prog_char atcmd68_name[] = "NO"; -prog_char atcmd68_desc[] = "ndisc-options"; -prog_char atcmd68_help[] = +static const char PROGMEM atcmd68_name[] = "NO"; +static const char PROGMEM atcmd68_desc[] = "ndisc-options"; +static const char PROGMEM atcmd68_help[] = "Network Discovery Options, a bitfield value that changes the " "behavior of the ND command (bit0 - Append DD value, bit1 - " "Local device sends ND response frame when ND is issued). " "Default is 0."; -prog_char atcmd69_name[] = "EE"; -prog_char atcmd69_desc[] = "security enable"; -prog_char atcmd69_help[] = +static const char PROGMEM atcmd69_name[] = "EE"; +static const char PROGMEM atcmd69_desc[] = "security enable"; +static const char PROGMEM atcmd69_help[] = "Enable or disable 128-bit AES encryption (0 or 1, 0 is the " "default)."; -prog_char atcmd70_name[] = "KY"; /* XXX */; -prog_char atcmd70_desc[] = "security-key"; -prog_char atcmd70_help[] = +static const char PROGMEM atcmd70_name[] = "KY"; /* XXX */; +static const char PROGMEM atcmd70_desc[] = "security-key"; +static const char PROGMEM atcmd70_help[] = "The 128bits security key (the command is write-only)."; -prog_char atcmd71_name[] = "MT"; -prog_char atcmd71_desc[] = "bcast-multi-xmit"; -prog_char atcmd71_help[] = +static const char PROGMEM atcmd71_name[] = "MT"; +static const char PROGMEM atcmd71_desc[] = "bcast-multi-xmit"; +static const char PROGMEM atcmd71_help[] = "Number of additional MAC-level broadcast transmissions. All " "broadcast packets are transmitted MT+1 times to ensure " "it is received (0 to 0xF, default is 3)."; -prog_char atcmd72_name[] = "RR"; -prog_char atcmd72_desc[] = "unicast-retries"; -prog_char atcmd72_help[] = +static const char PROGMEM atcmd72_name[] = "RR"; +static const char PROGMEM atcmd72_desc[] = "unicast-retries"; +static const char PROGMEM atcmd72_help[] = "Number of additional MAC-level packet delivery attempts for " "unicast transactions. If RR is non-zero, packets sent from " "the radio will request an acknowledgement, and can be resent " "up to RR times if no acknowledgement is received. (0 to 0xF, " "default is 10)."; -prog_char atcmd73_name[] = "PL"; -prog_char atcmd73_desc[] = "power-level"; -prog_char atcmd73_help[] = +static const char PROGMEM atcmd73_name[] = "PL"; +static const char PROGMEM atcmd73_desc[] = "power-level"; +static const char PROGMEM atcmd73_help[] = "Power Level of RF transmitter (0 - 1mW, 1 - 23mW, 2 - 100mW, " "3 - 158 mW, 4 - 316 mW). Default is 4."; -prog_char atcmd74_name[] = "SM"; -prog_char atcmd74_desc[] = "sleep-mode"; -prog_char atcmd74_help[] = +static const char PROGMEM atcmd74_name[] = "SM"; +static const char PROGMEM atcmd74_desc[] = "sleep-mode"; +static const char PROGMEM atcmd74_help[] = "Sleep Mode (0 - disabled, 1 - pin sleep, 4 - async cyclic " "sleep, 5 - async cyclic sleep with pin wakeup). Default " "is 0."; -prog_char atcmd75_name[] = "SO"; -prog_char atcmd75_desc[] = "sleep-options"; -prog_char atcmd75_help[] = +static const char PROGMEM atcmd75_name[] = "SO"; +static const char PROGMEM atcmd75_desc[] = "sleep-options"; +static const char PROGMEM atcmd75_help[] = "Sleep Options bitmask (bit8 - always wake for ST time). " "Default is 0."; -prog_char atcmd76_name[] = "ST"; -prog_char atcmd76_desc[] = "wake-time"; -prog_char atcmd76_help[] = +static const char PROGMEM atcmd76_name[] = "ST"; +static const char PROGMEM atcmd76_desc[] = "wake-time"; +static const char PROGMEM atcmd76_help[] = "Wake Time: the amount of time in ms that the module will stay " "awake after receiving RF or serial data (from 0x45 to " "0x36EE80, default is 0x7D0 = 2 secs)."; -prog_char atcmd77_name[] = "SP"; -prog_char atcmd77_desc[] = "sleep-period"; -prog_char atcmd77_help[] = +static const char PROGMEM atcmd77_name[] = "SP"; +static const char PROGMEM atcmd77_desc[] = "sleep-period"; +static const char PROGMEM atcmd77_help[] = "Sleep Period: the amount of time in 10ms unit the module will " "sleep per cycle. For a node operating as an Indirect " "Messaging Coordinator, this command defines the amount of " @@ -544,23 +544,23 @@ prog_char atcmd77_help[] = "The coordinator will hold the message for (2.5 * SP). Range " "is from 1 to 1440000, default is 200 (2 secs)."; -prog_char atcmd78_name[] = "SN"; -prog_char atcmd78_desc[] = "num-sleep-periods"; -prog_char atcmd78_help[] = +static const char PROGMEM atcmd78_name[] = "SN"; +static const char PROGMEM atcmd78_desc[] = "num-sleep-periods"; +static const char PROGMEM atcmd78_help[] = "Number of Sleep Periods that must elapse between assertions " "of the ON_SLEEP line during the wake time of asynchronous " "cyclic sleep (1 to 0xFFFF, default is 1)."; -prog_char atcmd79_name[] = "WH"; -prog_char atcmd79_desc[] = "wake-host"; -prog_char atcmd79_help[] = "Wake Host time. If it is set to a non-zero value, it " +static const char PROGMEM atcmd79_name[] = "WH"; +static const char PROGMEM atcmd79_desc[] = "wake-host"; +static const char PROGMEM atcmd79_help[] = "Wake Host time. If it is set to a non-zero value, it " "specifies the time in ms that the device should allow after " "waking from sleep before sending data out the UART or " "transmitting an I/O sample. If serial characters are " "received, the WH timer is stopped immediately. Range is " "from 0 to 0xFFFF, default is 0."; -struct xbee_atcmd_pgm xbee_atcmd_list[] = { +const struct xbee_atcmd PROGMEM xbee_atcmd_list[] = { { /* "WR" */ atcmd0_name, @@ -1131,9 +1131,9 @@ struct xbee_atcmd_pgm xbee_atcmd_list[] = { }, }; -struct xbee_atcmd_pgm *xbee_atcmd_lookup_name(const char *atcmd_str) +const struct xbee_atcmd *xbee_atcmd_lookup_name(const char *atcmd_str) { - struct xbee_atcmd_pgm *cmd; + const struct xbee_atcmd *cmd; struct xbee_atcmd copy; for (cmd = &xbee_atcmd_list[0], memcpy_P(©, cmd, sizeof(copy)); @@ -1150,9 +1150,9 @@ struct xbee_atcmd_pgm *xbee_atcmd_lookup_name(const char *atcmd_str) return cmd; } -struct xbee_atcmd_pgm *xbee_atcmd_lookup_desc(const char *desc) +const struct xbee_atcmd *xbee_atcmd_lookup_desc(const char *desc) { - struct xbee_atcmd_pgm *cmd; + const struct xbee_atcmd *cmd; struct xbee_atcmd copy; for (cmd = &xbee_atcmd_list[0], memcpy_P(©, cmd, sizeof(copy));