53 #define LOG_MODULE "NullNet" 54 #define LOG_LEVEL LOG_LEVEL_NULLNET 64 current_callback = NULL;
70 if(current_callback != NULL) {
72 LOG_INFO_LLADDR(packetbuf_addr(PACKETBUF_ADDR_SENDER));
75 packetbuf_addr(PACKETBUF_ADDR_SENDER), packetbuf_addr(PACKETBUF_ADDR_RECEIVER));
82 current_callback = callback;
86 output(
const linkaddr_t *dest)
91 packetbuf_set_addr(PACKETBUF_ADDR_RECEIVER, dest);
97 LOG_INFO_LLADDR(packetbuf_addr(PACKETBUF_ADDR_RECEIVER));
99 NETSTACK_MAC.
send(NULL, NULL);
void * packetbuf_dataptr(void)
Get a pointer to the data in the packetbuf.
void packetbuf_clear(void)
Clear and reset the packetbuf.
NullNet, a minimal network layer.
const linkaddr_t linkaddr_null
The null link-layer address.
static uint8_t output(const linkaddr_t *localdest)
Take an IP packet and format it to be sent on an 802.15.4 network using 6lowpan.
uint16_t packetbuf_datalen(void)
Get the length of the data in the packetbuf.
linkaddr_t linkaddr_node_addr
The link-layer address of the node.
uint8_t * nullnet_buf
Buffer used by the output function.
void(* nullnet_input_callback)(const void *data, uint16_t len, const linkaddr_t *src, const linkaddr_t *dest)
Function prototype for NullNet input callback.
The structure of a network driver in Contiki.
int packetbuf_copyfrom(const void *from, uint16_t len)
Copy from external data into the packetbuf.
void(* init)(void)
Initialize the network driver.
void(* send)(mac_callback_t sent_callback, void *ptr)
Send a packet from the packetbuf.
void nullnet_set_input_callback(nullnet_input_callback callback)
Set input callback for NullNet.
Header file for the Packet buffer (packetbuf) management
Include file for the Contiki low-layer network stack (NETSTACK)
Header file for the logging system
static void input(void)
Process a received 6lowpan packet.