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");
56 printf(
"An event occured: ");
58 if(ev == PROCESS_EVENT_EXIT) {
59 printf(
"shutting down\n");
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");
76 printf(
"unknown event: %d\n", ev);
SENSORS & button_sensor
Exports global symbols for the sensor API.
#define PROCESS(name, strname)
Declare a process.
void tcpip_poll_udp(struct uip_udp_conn *conn)
Cause a specified UDP connection to be polled.
#define PROCESS_WAIT_EVENT()
Wait for an event to be posted to the process.
#define PROCESS_BEGIN()
Define the beginning of a process.
#define PROCESS_END()
Define the end of a process.
process_event_t tcpip_event
The uIP event.
struct uip_udp_conn * udp_broadcast_new(uint16_t port, void *appstate)
Create a new UDP broadcast connection.
#define LEDS_ALL
The OR mask representation of all device LEDs.
#define uip_newdata()
Is new incoming data available?
void uip_send(const void *data, int len)
Send data on the current connection.
Header file for the uIP TCP/IP stack.
void leds_toggle(unsigned char leds)
Toggle multiple LEDs.
#define uip_poll()
Is the connection being polled by uIP?
PROCESS_THREAD(cc2538_rf_process, ev, data)
Implementation of the cc2538 RF driver process.
Header file for the LED HAL.
#define PROCESS_WAIT_UNTIL(c)
Wait for a condition to occur.
void * uip_appdata
Pointer to the application data in the packet buffer.
Representation of a uIP UDP connection.