Project

General

Profile

Statistics
| Revision:

root / branches / diagnosticStation / stationCode / v1 / main.c @ 1031

History | View | Annotate | Download (811 Bytes)

1 16 bcoltin
#include <dragonfly_lib.h>
2 967 alevkoy
#include <wireless.h>
3
#include <encoders.h>
4 16 bcoltin
5 967 alevkoy
#define CHAN 0xE        /* channel to use for wireless communication */
6
#define TEST 1                /* group and type numbers for sending test packets */
7
8
void packet_receive(char type, int source, unsigned char* packet, int length);
9
10 857 bcoltin
int main(void)
11
{
12 967 alevkoy
        /* initialize components, set wireless channel */
13 857 bcoltin
        dragonfly_init(ALL_ON);
14 967 alevkoy
        wl_init();
15
        wl_set_channel(CHAN);
16
        orb_enable();
17
18
        /* set up a packet group (or something) to receive packets */
19
        wl_register_packet_group(&packet_receive);
20
21
        while (1)
22
        {
23
                wl_do();
24
25
                /* send a packet with no usefull info for testing */
26
                wl_send_global_packet(TEST, TEST, NULL, 0, 0);
27
        }
28
29
        wl_terminate();
30
31
        return 0;
32 16 bcoltin
}
33 773 kwoo
34 967 alevkoy
void packet_receive(char type, int source, unsigned char* packet, int length)
35
{
36
        orb_set_color(type);
37
}