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;
86output(
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);
linkaddr_t linkaddr_node_addr
The link-layer address of the node.
const linkaddr_t linkaddr_null
The null link-layer address.
void nullnet_set_input_callback(nullnet_input_callback callback)
Set input callback for NullNet.
void(* nullnet_input_callback)(const void *data, uint16_t len, const linkaddr_t *src, const linkaddr_t *dest)
Function prototype for NullNet input callback.
uint8_t * nullnet_buf
Buffer used by the output function.
void * packetbuf_dataptr(void)
Get a pointer to the data in the packetbuf.
uint16_t packetbuf_datalen(void)
Get the length of the data in the packetbuf.
int packetbuf_copyfrom(const void *from, uint16_t len)
Copy from external data into the packetbuf.
void packetbuf_clear(void)
Clear and reset the packetbuf.
Header file for the logging system.
Include file for the Contiki low-layer network stack (NETSTACK)
NullNet, a minimal network layer.
Header file for the Packet buffer (packetbuf) management.
void(* send)(mac_callback_t sent_callback, void *ptr)
Send a packet from the packetbuf
The structure of a network driver in Contiki.
void(* input)(void)
Callback for getting notified of incoming packet in packetbuf.
uint8_t(* output)(const linkaddr_t *localdest)
Output funtion, sends from uipbuf.
void(* init)(void)
Initialize the network driver.