root / branches / simulator / projects / libwireless / test / test.c @ 1128
History | View | Annotate | Download (631 Bytes)
1 |
#include "stdlib.h" |
---|---|
2 |
#include "stdio.h" |
3 |
|
4 |
#include "../lib/wireless.h" |
5 |
#include "../lib/wl_error_group.h" |
6 |
#include "../lib/wl_token_ring.h" |
7 |
//#include "../lib/xbee.h"
|
8 |
|
9 |
#include <time.h> |
10 |
|
11 |
int main()
|
12 |
{ |
13 |
printf("Beginning.\n");
|
14 |
wl_set_com_port("/dev/ttyUSB0");
|
15 |
wl_init(); |
16 |
wl_set_channel(0xF);
|
17 |
printf("Wireless initialized.\n");
|
18 |
wl_error_register(); |
19 |
wl_token_ring_register(); |
20 |
wl_token_ring_join(); |
21 |
printf("Packet groups initialized.\n");
|
22 |
|
23 |
struct timespec delay;
|
24 |
delay.tv_sec = 0;
|
25 |
delay.tv_nsec = 100000000;
|
26 |
while (1) |
27 |
{ |
28 |
//wl_error_send_string("s");
|
29 |
wl_do(); |
30 |
nanosleep(&delay, 0);
|
31 |
} |
32 |
|
33 |
wl_terminate(); |
34 |
|
35 |
return 0; |
36 |
} |
37 |
|