repositories
/
mTask.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add memory reset when resetting, add debug for share writes and add live share changi...
[mTask.git]
/
client
/
sds.c
diff --git
a/client/sds.c
b/client/sds.c
index
2570017
..
06d67a2
100644
(file)
--- a/
client/sds.c
+++ b/
client/sds.c
@@
-76,7
+76,20
@@
bool sds_update(uint8_t id)
//Read identifier
struct sds *s = sds_get(id);
if(s != NULL){
//Read identifier
struct sds *s = sds_get(id);
if(s != NULL){
- s->value = read16();
+ switch(read_byte()){
+ //Long
+ case 'l':
+ //Int
+ case 'i':
+ s->value = read16();
+ break;
+ case 'b': //Bool
+ case 'c': //Character
+ case 'B': //Button
+ case 'L': //UserLED
+ s->value = read_byte();
+ break;
+ }
debug("Received sds update %d: %d", s->id, s->value);
write_byte('u');
write16(s->id);
debug("Received sds update %d: %d", s->id, s->value);
write_byte('u');
write16(s->id);
@@
-111,7
+124,6
@@
void sds_publish(int id)
}
write_byte('\n');
return;
}
write_byte('\n');
return;
-
} else {
debug("SDS identifier unknown: %d", id);
die("");
} else {
debug("SDS identifier unknown: %d", id);
die("");