X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=client%2Fsds.c;h=e6bf3b560d04b54fc06db50350cdf836d96d5da1;hb=09b207a39b7791098daafd7d87c3ad9d3db3e19f;hp=c2fdbdea251778bb878b79f4506d5f8bc737c171;hpb=55afb005ced3bba3813163596cdc7288a318a3c2;p=mTask.git diff --git a/client/sds.c b/client/sds.c index c2fdbde..e6bf3b5 100644 --- a/client/sds.c +++ b/client/sds.c @@ -32,6 +32,7 @@ void sds_register(void) //Read identifier sdss[cs].id = read16(); //Read value + sdss[cs].type = read_byte(); sdss[cs].value = read16(); debug("Received sds %d: %d", sdss[cs].id, sdss[cs].value); @@ -83,7 +84,22 @@ void sds_publish(int id) debug("Publish %d=%d", sdss[cs].id, sdss[cs].value); write_byte('p'); write16(sdss[cs].id); - write16(sdss[cs].value); + write_byte(sdss[cs].type); + + switch(sdss[cs].type){ + //Long + case 'l': + //Int + case 'i': + write16(sdss[cs].value); + break; + case 'b': //Bool + case 'c': //Character + case 'B': //Button + case 'L': //UserLED + write_byte(sdss[cs].value); + break; + } write_byte('\n'); return; }