root / trunk / code / projects / colonet / lib / colonet_dragonfly / colonet_dragonfly.h @ 150
History | View | Annotate | Download (744 Bytes)
1 | 11 | emarinel | /** @file colonet.h
|
---|---|---|---|
2 | * @brief Colonet library for colony robots
|
||
3 | * @author Eugene Marinelli
|
||
4 | * @date 10/26/06
|
||
5 | */
|
||
6 | |||
7 | #ifndef COLONET_DRAGONFLY_H_
|
||
8 | 149 | emarinel | #define COLONET_DRAGONFLY_H_
|
9 | 11 | emarinel | |
10 | #include <colonet_defs.h> |
||
11 | |||
12 | 149 | emarinel | /**
|
13 | 11 | emarinel | */
|
14 | 149 | emarinel | int colonet_init(void); |
15 | 11 | emarinel | |
16 | /** @brief Registers a new colonet message handler function. If a message
|
||
17 | * with msgId is received, then handler will be called.
|
||
18 | 149 | emarinel | *
|
19 | 11 | emarinel | * @param msgId The message id of the handler to be registered. Must be
|
20 | * between USER_DEFINED_MSG_ID_START and USER_DEFINED_MSG_ID_END
|
||
21 | * @param handler The function to be called if a colonet packet with message
|
||
22 | * id msgId is received
|
||
23 | 149 | emarinel | *
|
24 | 11 | emarinel | * @return -1 on error (invalid msgId), 0 on success
|
25 | */
|
||
26 | int colonet_add_message(unsigned char msgId, void (*handler)(void)); |
||
27 | |||
28 | #endif |