#include <strings.h>
Go to the source code of this file.
#define COAP_PSEUDOFP_DECODE_8_4 |
( |
|
r | ) |
(r < HIBIT ? r : (r & MMASK) << (r & EMASK)) |
#define COAP_PSEUDOFP_ENCODE_8_4_DOWN |
( |
|
v, |
|
|
|
ls |
|
) |
| (v < HIBIT ? v : (ls = coap_fls(v) - Nn, (v >> ls) & MMASK) + ls) |
#define COAP_PSEUDOFP_ENCODE_8_4_UP |
( |
|
v, |
|
|
|
ls, |
|
|
|
s |
|
) |
| (v < HIBIT ? v : (ls = coap_fls(v) - Nn, (s = (((v + ((1<<E<<ls)-1)) >> ls) & MMASK)), s == 0 ? HIBIT + ls + 1 : s + ls)) |
#define EMASK ((1 << E) - 1) |
#define HIBIT (1 << (Nn - 1)) |
#define MAX_VALUE ( (1 << Nn) - (1 << E) ) * (1 << ((1 << E) - 1)) |
#define MMASK ((1 << Nn) - 1 - EMASK) |
#define Nn 8 /* duplicate definition of N if built on sky motes */ |
unsigned int coap_decode_var_bytes |
( |
unsigned char * |
buf, |
|
|
unsigned int |
len |
|
) |
| |
Decodes multiple-length byte sequences.
buf points to an input byte sequence of length len. Returns the decoded value.
Definition at line 25 of file encode.c.
unsigned int coap_encode_var_bytes |
( |
unsigned char * |
buf, |
|
|
unsigned int |
val |
|
) |
| |
Encodes multiple-length byte sequences.
buf points to an output buffer of sufficient length to store the encoded bytes. val is the value to encode. Returns the number of bytes used to encode val or 0 on error.
Definition at line 34 of file encode.c.
int coap_fls |
( |
unsigned int |
i | ) |
|