Project

General

Profile

Statistics
| Revision:

root / branches / slam / code / projects / colonet / DataRequests / test / robot / robot_test.c @ 294

History | View | Annotate | Download (674 Bytes)

1
#include <dragonfly_lib.h>
2
#include <wireless.h>
3
#include <wl_token_ring.h>
4
#define TEST_CODE 12
5

    
6
void  handle_receive(char type, int source, unsigned char *packet, int length);
7

    
8

    
9
int main(void){
10
  
11
  wl_init();
12
 PacketGroupHandler pgh;
13

    
14
  pgh.groupCode=TEST_CODE;
15
  pgh.timeout_handler=NULL;
16
  pgh.handle_response=NULL;
17
  pgh.handle_receive=handle_receive;
18
  pgh.unregister=NULL;
19

    
20
  wl_register_packet_group(&pgh);
21
  
22
  wl_token_ring_register(); 
23
  wl_token_ring_join();
24
  
25
  while(1){
26
    wl_do();
27
  }
28
  return -1;
29
}
30

    
31
void  handle_receive (char type, int source, unsigned char *packet, int length){
32
    wl_send_robot_to_robot_global_packet (12, 0, NULL, 0, source, 0); 
33
}