24 if (
next == DATADICT_KEYVALUE_PAIRS)
return false;
31 for(
int i=0;i<DATADICT_KEYVALUE_PAIRS;i++){
37 #ifdef DATADICT_USE_MALLOC
38 record[i].
key = (
char*)extmem_malloc(DATADICT_MAX_KEY_LEN+1);
49 while (c = (*
s++)){h = ((h << 5) + h) + c;}
54 if (!
copyKey(key))
return false;
64 if (!
copyKey(key))
return false;
75 if (!
copyKey(key))
return false;
88 for(
int i=0;i<DATADICT_KEYVALUE_PAIRS;i++){
99 for(
int i=0;i<DATADICT_KEYVALUE_PAIRS;i++){
111 for(
int i=0;i<DATADICT_KEYVALUE_PAIRS;i++){
113 if (
record[i].key_hash == h){
123 return create(key, val, owner);
130 for(
int i=0;i<DATADICT_KEYVALUE_PAIRS;i++){
132 if (
record[i].key_hash == h){
142 return create(key, val, owner);
149 for(
int i=0;i<DATADICT_KEYVALUE_PAIRS;i++){
151 if (
record[i].key_hash == h){
168 for(
int i=0;i<DATADICT_KEYVALUE_PAIRS;i++){
170 if (
record[i].key_hash == h){
188 for(
int i=0;i<DATADICT_KEYVALUE_PAIRS;i++){
190 if (
record[i].key_hash == h){
197 if (!
create(key,(int32_t)0))
return false;
217 sci->print(F(
"DD {"));
226 for(
int i=from;i<to;i++){
232 if (i != to-1)
sci->print(
",");
SvcSerialCommandInterface sci
const char PROGMEM s[][16]
bool safer_strncpy(char *dest, const char *source, uint16_t dest_size)
a safer strncpy
Data Dictionary service provides an interface to a data dictionary service the service shall provide ...
int32_t read(const char *key)
returns the int32_t value of the record
uint16_t dd_transmitt_block
bool create(const char *key, int32_t val, uint32_t *owner)
create a record with ownership
svcDataDictionaryRecord record[DATADICT_KEYVALUE_PAIRS]
bool copyKey(const char *key)
float32_t readf(const char *key)
returns the float32_t value of the record
bool increment(const char *key)
increments the value of a global record creates a new record if one does not exist and initializes ...
bool update(const char *key, int32_t val, uint32_t *owner)
update the value of an owned record creates a new record if one does not exist and initializes its ...
uint32_t hash(const char *s)
hashing function used to accelerate searches
void printStats()
printStats function
void printDictionary(SvcSerialCommandInterface *sci)
prints the dictionary to the SvcSerialCommandInterface
bool requestStartLZ4Message()
request to start a lz4 compressed message starts the message and returns true if available returns f...
void sendLZ4Message()
Calling this function signals the end of a compressed message. The txBuffer contents are lz4 compres...
Serial communication service and interface Serial commands (rx): .
svcDataDictionaryRecordType record_type
svcDataDictionaryDataType data_type