Project

General

Profile

Statistics
| Revision:

root / branches / autonomous_recharging / code / projects / libwireless / test / test.c @ 743

History | View | Annotate | Download (696 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(int argc, char** argv)
12
{
13
        char c = argv[1][0];
14
        int robot = atoi(argv[2]);
15
        wl_set_com_port("/dev/ttyUSB0");
16
        wl_init();
17
        wl_set_channel(0xE);
18
        printf("Wireless initialized.\n");
19
        printf("Packet groups initialized.\n");
20

    
21
        if (c == 'g') { //command robot to requet charge
22
            wl_send_robot_to_robot_global_packet(3, 9, NULL, 0, robot, 0);
23
        }
24
        if (c == 'd') { // command robot to depart station
25
        wl_send_robot_to_robot_global_packet(3, 10, NULL, 0, robot, 0);
26
        }
27
        wl_terminate();
28
        
29
        return 0;
30
}
31