X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=client%2Fsds.c;h=06d67a2b1f3ed8cc2e29b29c5e007862ed7480c6;hb=3fe035b92e9bc0b745c57db64e78461b2f36b6d1;hp=56f5895500520d14a10610b6a014e090c407af0e;hpb=61dffbc509a02622642a6eb7c17cb20b46b93619;p=mTask.git diff --git a/client/sds.c b/client/sds.c index 56f5895..06d67a2 100644 --- a/client/sds.c +++ b/client/sds.c @@ -1,15 +1,11 @@ #include #include -#include #include "interface.h" #include "sds.h" #include "mem.h" -extern uint8_t *mem_top; -extern uint8_t *mem_bottom; -extern uint8_t *mem_task; -extern uint8_t *mem_sds; +extern uint8_t *mem_top, *mem_bottom, *mem_task, *mem_sds; struct sds *sds_head(void) { @@ -80,7 +76,20 @@ bool sds_update(uint8_t id) //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); @@ -115,7 +124,6 @@ void sds_publish(int id) } write_byte('\n'); return; - } else { debug("SDS identifier unknown: %d", id); die("");