Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / libwireless / lib / wl_token_ring.h @ 159

History | View | Annotate | Download (2.09 KB)

1
/**
2
 * @file wl_token_ring.h
3
 * @brief Declarations for the token ring packet group
4
 * 
5
 * Contains declarations for the token ring packet group.
6
 *
7
 * @author Brian Coltin, Colony Project, CMU Robotics Club
8
 **/
9

    
10
#ifndef WL_TOKEN_RING_H
11
#define WL_TOKEN_RING_H
12

    
13
/**
14
 * @defgroup tokenring Token Ring
15
 * @brief Wireless library token ring implementation
16
 *
17
 * This packet group is used to form a token ring, which
18
 * keeps track of the relative directions of the robots
19
 * from one another.
20
 *
21
 * @{
22
 **/
23

    
24
/**@brief Register the token ring group with the wireless library.**/
25
void wl_token_ring_register(void);
26
/**@brief Unregister the token ring group with the wirelss library.**/
27
void wl_token_ring_unregister(void);
28
/**@brief Set the functions called to turn the bom on and off.**/
29
void wl_token_ring_set_bom_functions(void (*on_function) (void), 
30
                void (*off_function) (void), int (*max_bom_function) (void));
31

    
32
/**@brief Join the token ring **/
33
void wl_token_ring_join(void);
34
/**@brief Leave the token ring **/
35
void wl_token_ring_leave(void);
36
/**@brief Request a BOM flash from the specified robot **/
37
void wl_token_request(int robot);
38

    
39
/**@brief Return the number of robots in the token ring **/
40
int wl_token_get_robots_in_ring(void);
41
/**@brief Return whether a given robot is in the token ring **/
42
int wl_token_is_robot_in_ring(int robot);
43

    
44
/**@brief Begin iterating through robots in the token ring **/
45
void wl_token_iterator_begin(void);
46
/**@brief Returns whether there are more robots to iterate through **/
47
int wl_token_iterator_has_next(void);
48
/**@brief Returns the ID of the next robot in the token ring **/
49
int wl_token_iterator_next(void);
50

    
51
/**@brief Return the latest BOM reading between two robots **/
52
int wl_token_get_sensor_reading(int source, int dest);
53
/**@brief Return the latest BOM reading between us and another robot **/
54
int wl_token_get_my_sensor_reading(int dest);
55
/**@brief Return the number of robots in the sensor matrix.*/
56
int wl_token_get_num_robots(void);
57
/**@brief Return the number of non-null elements in the sensor matrix*/
58
int wl_token_get_matrix_size(void);
59

    
60
/** @} **/ //end token ring group
61

    
62
#endif