47 #ifndef CHAMELEON_MODULE
48 #ifdef CHAMELEON_CONF_MODULE
49 #define CHAMELEON_MODULE CHAMELEON_CONF_MODULE
51 #define CHAMELEON_MODULE chameleon_bitopt
55 extern const struct chameleon_module CHAMELEON_MODULE;
60 #define PRINTF(...) printf(__VA_ARGS__)
74 printbin(
int n,
int digits)
79 for(i = 0; i < digits; ++i) {
80 output[digits - i - 1] = (n & 1) +
'0';
89 printhdr(uint8_t *hdr,
int len)
94 for(i = 0; i < len; ++i) {
96 printf(
" (0x%0x), ", hdr[i]);
111 chameleon_parse(
void)
113 struct channel *c =
NULL;
114 PRINTF(
"%d.%d: chameleon_input\n",
119 c = CHAMELEON_MODULE.input();
121 PRINTF(
"%d.%d: chameleon_input channel %d\n",
124 packetbuf_set_attr(PACKETBUF_ATTR_CHANNEL, c->channelno);
126 PRINTF(
"%d.%d: chameleon_input channel not found for incoming packet\n",
133 chameleon_create(
struct channel *c)
137 PRINTF(
"%d.%d: chameleon_output channel %d\n",
141 ret = CHAMELEON_MODULE.output(c);
142 packetbuf_set_attr(PACKETBUF_ATTR_CHANNEL, c->channelno);
153 chameleon_hdrsize(
const struct packetbuf_attrlist attrlist[])
155 return CHAMELEON_MODULE.hdrsize(attrlist);
Linked list manipulation routines.
linkaddr_t linkaddr_node_addr
The Rime address of the node.
Header file for Chameleon, Rime's header processing module
#define NULL
The null pointer.
Header file for Rime's channel abstraction
uint8_t packetbuf_hdrlen(void)
Get the length of the header in the packetbuf.
Header file for the Rime stack
uint16_t packetbuf_datalen(void)
Get the length of the data in the packetbuf.
void * packetbuf_hdrptr(void)
Get a pointer to the header in the packetbuf, for outbound packets.
void * packetbuf_dataptr(void)
Get a pointer to the data in the packetbuf.