33 #include "dev/button-sensor.h"
36 #include "net/uaodv.h"
41 #define COOJA_PORT 1234
43 PROCESS(test_uaodv_process,
"uIP uAODV test process");
44 AUTOSTART_PROCESSES(&uaodv_process, &test_uaodv_process);
51 static uip_ipaddr_t addr;
55 printf(
"uIP uAODV test process started\n");
64 button_sensor.configure(SENSORS_ACTIVE, 1);
69 if(ev == sensors_event && data == &button_sensor) {
70 struct uaodv_rt_entry *route;
73 route = uaodv_rt_lookup_any(&addr);
74 if (route ==
NULL || route->is_bad) {
76 uaodv_request_route_to(&addr);
87 printf(
"data received from %d.%d.%d.%d: %s\n",
90 leds_toggle(LEDS_ALL);
#define PROCESS_WAIT_UNTIL(c)
Wait for a condition to occur.
#define PROCESS_BEGIN()
Define the beginning of a process.
Header file for the uIP TCP/IP stack.
CCIF struct uip_udp_conn * udp_new(const uip_ipaddr_t *ripaddr, uint16_t port, void *appstate)
Create a new UDP connection.
CCIF void uip_send(const void *data, int len)
Send data on the current connection.
#define uip_newdata()
Is new incoming data available?
#define uip_udp_bind(conn, port)
Bind a UDP connection to a local port.
#define NULL
The null pointer.
#define uip_poll()
Is the connection being polled by uIP?
#define UIP_HTONS(n)
Convert 16-bit quantity from host byte order to network byte order.
CCIF void tcpip_poll_udp(struct uip_udp_conn *conn)
Cause a specified UDP connection to be polled.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
#define PROCESS_END()
Define the end of a process.
#define UIP_LLH_LEN
The link level header length.
#define uip_ipaddr_to_quad(a)
Convert an IP address to four bytes separated by commas.
#define PROCESS_WAIT_EVENT()
Wait for an event to be posted to the process.
#define PROCESS(name, strname)
Declare a process.
#define uip_datalen()
The length of any incoming data that is currently available (if available) in the uip_appdata buffer...
process_event_t tcpip_event
The uIP event.
Routing tables for the micro implementation of the AODV ad hoc routing protocol ...
Representation of a uIP UDP connection.
#define uip_ipaddr(addr, addr0, addr1, addr2, addr3)
Construct an IP address from four bytes.
uip_appdata
Pointer to the application data in the packet buffer.