fix parsing of xmit status in sendmsg command
[protos/xbee-avr.git] / eeprom_config.h
1 /*
2  *  Copyright 2013 Olivier Matz <zer0@droids-corp.org>
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  *
18  */
19
20 #ifndef _EEPROM_CONFIG_H_
21 #define _EEPROM_CONFIG_H_
22
23 #define EEPROM_CONFIG_MAGIC 0x666bea57
24 #define EEPROM_CMD_SIZE 64
25 #define EEPROM_N_CMD_MAX 16
26
27 struct eeprom_cmd {
28         char buf[EEPROM_CMD_SIZE];
29 };
30
31 struct eeprom_config
32 {
33         uint32_t magic;
34         uint8_t ncmds;
35         struct eeprom_cmd cmds[EEPROM_N_CMD_MAX];
36 };
37
38 int8_t eeprom_load_config(void);
39 uint8_t eeprom_get_ncmds(void);
40 void eeprom_set_ncmds(uint8_t ncmds);
41 void eeprom_get_cmd(struct eeprom_cmd *cmd, uint8_t n);
42 void eeprom_set_cmd(struct eeprom_cmd *cmd, uint8_t n);
43 void eeprom_dump_cmds(void);
44 int8_t eeprom_insert_cmd_before(const char *str, uint8_t n);
45 int8_t eeprom_append_cmd(const char *str);
46 int8_t eeprom_delete_cmd(uint8_t n);
47
48 #endif