Microchip® Advanced Software Framework

simple-udp.c File Reference
#include "contiki-net.h"
#include "net/ip/simple-udp.h"
#include <string.h>

Macros

#define UIP_IP_BUF   ((struct uip_udpip_hdr *)&uip_buf[UIP_LLH_LEN])
 

Functions

static void init_simple_udp (void)
 
 PROCESS (simple_udp_process,"Simple UDP process")
 
 PROCESS_THREAD (simple_udp_process, ev, data)
 
int simple_udp_register (struct simple_udp_connection *c, uint16_t local_port, uip_ipaddr_t *remote_addr, uint16_t remote_port, simple_udp_callback receive_callback)
 Register a UDP connection. More...
 
int simple_udp_send (struct simple_udp_connection *c, const void *data, uint16_t datalen)
 Send a UDP packet. More...
 
int simple_udp_sendto (struct simple_udp_connection *c, const void *data, uint16_t datalen, const uip_ipaddr_t *to)
 Send a UDP packet to a specified IP address. More...
 
int simple_udp_sendto_port (struct simple_udp_connection *c, const void *data, uint16_t datalen, const uip_ipaddr_t *to, uint16_t port)
 Send a UDP packet to a specified IP address and UDP port. More...
 

Variables

static uint8_t databuffer [UIP_BUFSIZE]
 
static uint8_t started = 0