Project

General

Profile

Statistics
| Revision:

root / branches / analog / code / projects / colonet / server / manual_control / manualControlServer / wireless.h @ 1390

History | View | Annotate | Download (837 Bytes)

1 13 emarinel
#ifndef WIRELESS_H
2
#define WIRELESS_H
3
4
/*
5
Wireless - wireless functions for Colony
6

7
Eugene Marinelli
8
7/22/06
9
*/
10
11
#define WL_MSG_MAX_LEN 16
12
#define WL_PACKET_MAX_LEN (WL_MSG_MAX_LEN+5)
13
14
#define GLOBAL_DEST 200
15
16
typedef struct {
17
  char prefix[2];
18
  char src;
19
  char dest;
20
  char msg[WL_MSG_MAX_LEN];
21
  char checksum;
22
} WL_Packet;
23
24
/* wl_init
25
   msg_len (< WL_MSG_MAX_LEN) is the length of the messages sent
26
   in the packets.
27
   listener_address is the address to listen on
28
*/
29
int wl_init(int msg_len, char listener_address);
30
31
int wl_send(char* msg, char dest);
32
int wl_recv(char* msgbuf, char* src, char* dest);
33
// get most recent valid message - implement message queue later
34
35
int wl_create_packet(char* msg, char src, char dest, WL_Packet* packet);
36
char wl_get_checksum(WL_Packet* packet);
37
38
#endif