33 #include "dev/button-sensor.h"
38 #define COOJA_PORT 1234
40 PROCESS(test_uip_process,
"uIP test process");
41 AUTOSTART_PROCESSES(&test_uip_process);
49 printf(
"uIP test process started\n");
52 button_sensor.configure(SENSORS_ACTIVE, 1);
56 printf(
"An event occured: ");
58 if(ev == PROCESS_EVENT_EXIT) {
59 printf(
"shutting down\n");
63 if(ev == sensors_event && data == &button_sensor) {
64 printf(
"button clicked, sending packet\n");
69 }
else if(ev == sensors_event) {
70 printf(
"unknown sensor event: %s\n", ((
struct sensors_sensor *)data)->type);
72 printf(
"a packet was received, toggling leds\n");
74 leds_toggle(LEDS_ALL);
76 printf(
"unknown event: %d\n", ev);
#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 void uip_send(const void *data, int len)
Send data on the current connection.
#define uip_newdata()
Is new incoming data available?
#define NULL
The null pointer.
#define uip_poll()
Is the connection being polled by uIP?
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.
struct uip_udp_conn * udp_broadcast_new(uint16_t port, void *appstate)
Create a new UDP broadcast connection.
#define PROCESS_WAIT_EVENT()
Wait for an event to be posted to the process.
#define PROCESS(name, strname)
Declare a process.
process_event_t tcpip_event
The uIP event.
Representation of a uIP UDP connection.
uip_appdata
Pointer to the application data in the packet buffer.