X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fconnectivity%2Flib%2Flibcoap-4.1.1%2Fencode.c;h=a310008ad8bb6a35be2879c7f1ce08dc0d0450bb;hb=17c68b2fd1e74586f85e552eeab4e32dc121f8a0;hp=86a5b896da73e4d7cb0638e53d50cbaf29a50e66;hpb=8c01dff2c5bc5496f7dc1632c498943ec6ecb015;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/connectivity/lib/libcoap-4.1.1/encode.c b/resource/csdk/connectivity/lib/libcoap-4.1.1/encode.c index 86a5b89..a310008 100644 --- a/resource/csdk/connectivity/lib/libcoap-4.1.1/encode.c +++ b/resource/csdk/connectivity/lib/libcoap-4.1.1/encode.c @@ -6,12 +6,19 @@ * README for terms of use. */ +#include "config.h" + +#if defined(HAVE_ASSERT_H) && !defined(assert) +# include +#endif + #ifndef NDEBUG # include #endif #include "config.h" #include "encode.h" +#include "option.h" /* Carsten suggested this when fls() is not available: */ int coap_fls(unsigned int i) @@ -48,3 +55,16 @@ unsigned int coap_encode_var_bytes(unsigned char *buf, unsigned int val) return n; } +bool coap_is_var_bytes(coap_option_def_t* def) +{ + assert (def); + + if('u' == def->type) + { + return 1; + } + else + { + return 0; + } +}