44 #include "contiki-net.h"
45 #include "net/simple-udp.h"
50 PROCESS(simple_udp_process,
"Simple UDP process");
51 static uint8_t started = 0;
54 #define UIP_IP_BUF ((struct uip_udpip_hdr *)&uip_buf[UIP_LLH_LEN])
81 const void *data, uint16_t datalen)
83 if(c->udp_conn !=
NULL) {
84 uip_udp_packet_sendto(c->udp_conn, data, datalen,
85 &c->remote_addr,
UIP_HTONS(c->remote_port));
106 const void *data, uint16_t datalen,
109 if(c->udp_conn !=
NULL) {
110 uip_udp_packet_sendto(c->udp_conn, data, datalen,
139 uint16_t remote_port,
140 simple_udp_callback receive_callback)
145 c->local_port = local_port;
146 c->remote_port = remote_port;
147 if(remote_addr !=
NULL) {
150 c->receive_callback = receive_callback;
154 if(c->udp_conn !=
NULL) {
159 if(c->udp_conn ==
NULL) {
167 struct simple_udp_connection *c;
179 c = (
struct simple_udp_connection *)data;
196 if(c->receive_callback !=
NULL) {
198 c->receive_callback(c,