root / trunk / code / projects / libwireless / lib / wl_token_ring.h @ 60
History | View | Annotate | Download (2.04 KB)
1 | 17 | bcoltin | /**
|
---|---|---|---|
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 | /**
|
||
11 | * @defgroup tokenring Token Ring
|
||
12 | * @brief Wireless library token ring implementation
|
||
13 | *
|
||
14 | * This packet group is used to form a token ring, which
|
||
15 | * keeps track of the relative directions of the robots
|
||
16 | * from one another.
|
||
17 | *
|
||
18 | * @{
|
||
19 | **/
|
||
20 | |||
21 | /**@brief Register the token ring group with the wireless library.**/
|
||
22 | void wl_token_ring_register(void); |
||
23 | /**@brief Unregister the token ring group with the wirelss library.**/
|
||
24 | void wl_token_ring_unregister(void); |
||
25 | /**@brief Set the functions called to turn the bom on and off.**/
|
||
26 | void wl_token_ring_set_bom_functions(void (*on_function) (void), |
||
27 | void (*off_function) (void), int (*max_bom_function) (void)); |
||
28 | 60 | bcoltin | |
29 | 17 | bcoltin | /**@brief Join the token ring **/
|
30 | void wl_token_ring_join(void); |
||
31 | /**@brief Leave the token ring **/
|
||
32 | void wl_token_ring_leave(void); |
||
33 | /**@brief Request a BOM flash from the specified robot **/
|
||
34 | void wl_token_request(int robot); |
||
35 | 52 | bcoltin | |
36 | /**@brief Return the number of robots in the token ring **/
|
||
37 | int wl_token_get_robots_in_ring(void); |
||
38 | /**@brief Return whether a given robot is in the token ring **/
|
||
39 | int wl_token_is_robot_in_ring(int robot); |
||
40 | |||
41 | /**@brief Begin iterating through robots in the token ring **/
|
||
42 | void wl_token_iterator_begin(void); |
||
43 | /**@brief Returns whether there are more robots to iterate through **/
|
||
44 | int wl_token_iterator_has_next(void); |
||
45 | /**@brief Returns the ID of the next robot in the token ring **/
|
||
46 | int wl_token_iterator_next(void); |
||
47 | |||
48 | 17 | bcoltin | /**@brief Return the latest BOM reading between two robots **/
|
49 | int wl_token_get_sensor_reading(int source, int dest); |
||
50 | /**@brief Return the latest BOM reading between us and another robot **/
|
||
51 | int wl_token_get_my_sensor_reading(int dest); |
||
52 | 48 | jscheine | /**@brief Return the number of robots in the sensor matrix.*/
|
53 | int wl_token_get_num_robots(void); |
||
54 | /**@brief Return the number of non-null elements in the sensor matrix*/
|
||
55 | int wl_token_get_matrix_size(void); |
||
56 | 17 | bcoltin | |
57 | /** @} **/ //end token ring group |