root / branches / colonetmk2 / code / projects / swarm / includes / colonet_wireless.h @ 1456
History | View | Annotate | Download (1.03 KB)
1 |
/** @file colonet_wireless.h
|
---|---|
2 |
*
|
3 |
* @brief Wireless library for communicating with colony robots
|
4 |
*
|
5 |
* @author Eugene Marinelli
|
6 |
* @date 10/10/07
|
7 |
*/
|
8 |
|
9 |
#ifndef COLONET_WIRELESS_H_
|
10 |
#define COLONET_WIRELESS_H_
|
11 |
|
12 |
/** @brief Initializes colonet wireless library
|
13 |
*
|
14 |
* @param wl_port Either SERIAL_PORT or USB_PORT (as defined in COLONET_DEFS)
|
15 |
* @param msg_handler Function to be called when a packet is received.
|
16 |
* Must take a ColonetPacket as an argument (see defn of MsgHandlerFunction)
|
17 |
*
|
18 |
* @return new ColonetWireless object
|
19 |
*/
|
20 |
int colonet_wl_init(char* wl_port); |
21 |
|
22 |
/** @brief Spawns a thread which reads data from the hardware interface
|
23 |
* with the colony (either a dongle or a robot programmed to relay data)
|
24 |
* and runs msg_handler when a full packet is received
|
25 |
*
|
26 |
* @return pointer to the thread
|
27 |
*/
|
28 |
int colonet_wl_run_listener_thread(void); |
29 |
|
30 |
void colonet_wl_kill_listener_thread(void); |
31 |
|
32 |
void colonet_wl_join();
|
33 |
|
34 |
int colonet_get_num_robots(void); |
35 |
|
36 |
void colonet_get_sensor_matrix(int* ids, int** matrix); |
37 |
void colonet_get_xbee_ids(int ids[]); |
38 |
|
39 |
#endif
|