bugfix: support option length > 255

This commit is contained in:
Olaf Bergmann committed 2012-07-04 15:56:01 +02:00
1 parent aebd41b54a
commit dc04333820
1 file changed
+2 -2
+2 -2
View File
@@ -39,11 +39,11 @@ typedef unsigned char coap_opt_t;
: (*PCHAR(opt) & 0x0f)))
#define COAP_OPT_SETLENGTH(opt,val) \
if ( ((val) & 0xff) < 15 ) \
if ((val) < 15) \
*PCHAR(opt) = ((*PCHAR(opt) & 0xf0) | ((val) & 0x0f)); \
else { \
*PCHAR(opt) |= 0x0f; \
*(PCHAR(opt) + 1) = ((val) & 0xff) - 15; \
*(PCHAR(opt) + 1) = ((val) - 15) & 0xff; \
}
#define COAP_OPT_VALUE(opt) \