X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=client%2Fsds.c;h=06d67a2b1f3ed8cc2e29b29c5e007862ed7480c6;hb=7d9088b54956fe56c36ca8d01ec386b48f0a1c47;hp=2570017c8738ef35cd6552a0d9a7f50736b3dd94;hpb=5bb47d85ee13e4c0907a82971a907657511211cc;p=mTask.git diff --git a/client/sds.c b/client/sds.c index 2570017..06d67a2 100644 --- 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){ - 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); @@ -111,7 +124,6 @@ void sds_publish(int id) } write_byte('\n'); return; - } else { debug("SDS identifier unknown: %d", id); die("");