Features are addressed using a four byte identifier 'xxxx'. For string features, the last byte has to be '=', so all string feature id look like 'xxx=' followed by the string in the eeprom.
The feature data is stored in the EEPROM of the device. The first implementation supports Int32 and strings (len <= 16) feature data.
To create such a feature ID, you can use the macro FOURCC(a,b,c,d) that takes four characters and creates a 4 char constant. The simple use of 'abcd' is deprecated.
#include <io.h>
Defines | |
#define | BTN_EEPROMDB_ID_SIZE 4 |
#define | BTN_EEPROMDB_INT_SIZE 4 |
#define | BTN_EEPROMDB_STRING_SIZE 16 |
#define | FOURCC(a, b, c, d) ( (u_long) a << 24 | (u_long) b << 16 | (u_long) c << 8 | (u_long) d ) |
Create a 32 constant from 4 single characters. | |
Functions | |
u_char | btn_eepromdb_delete (u_long id) |
Delete a value in the eeprom database in the EEPROM of the BTnode. | |
u_short | btn_eepromdb_get (u_long id, u_short size, void *data) |
Get a value in the eeprom database in the EEPROM of the BTnode. | |
u_long | btn_eepromdb_get_by_index (u_short index) |
Get the value id of value nr index. This is used to enumerate the eeprom database. | |
u_short | btn_eepromdb_store (u_long id, u_short size, void *data) |
Stores into the eepromdb on the EEPROM of the BTnode. |
#define FOURCC | ( | a, | |||
b, | |||||
c, | |||||
d | ) | ( (u_long) a << 24 | (u_long) b << 16 | (u_long) c << 8 | (u_long) d ) |
Create a 32 constant from 4 single characters.
a,b,c,d | id characters |
Delete a value in the eeprom database in the EEPROM of the BTnode.
id | 32 bit value id. String features have to be 'xxx='" |
Get a value in the eeprom database in the EEPROM of the BTnode.
id | 32 bit value id. String value have to be 'xxx='" | |
size | Max size of the data buffer. Only used for strings. | |
data | Pointer the data buffer |
Get the value id of value nr index. This is used to enumerate the eeprom database.
index | Index of value id to get |
Stores into the eepromdb on the EEPROM of the BTnode.
id | 32 bit Feature id. String id have to be 'xxx='" | |
size | Size of the data to store. (Only relevant with string values, maximal BTN_EEPROMDB_STRING_SIZE bytes | |
data | Pointer the data to be stored (string or pointer of long) |