diff options
Diffstat (limited to 'path/path_ctrl_t.h')
-rw-r--r-- | path/path_ctrl_t.h | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/path/path_ctrl_t.h b/path/path_ctrl_t.h new file mode 100644 index 0000000..3e629eb --- /dev/null +++ b/path/path_ctrl_t.h | |||
@@ -0,0 +1,143 @@ | |||
1 | // THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT MODIFY | ||
2 | // BY HAND!! | ||
3 | // | ||
4 | // Generated by lcm-gen | ||
5 | |||
6 | #include <stdint.h> | ||
7 | #include <stdlib.h> | ||
8 | #include <lcm/lcm_coretypes.h> | ||
9 | #include <lcm/lcm.h> | ||
10 | |||
11 | #ifndef _path_ctrl_t_h | ||
12 | #define _path_ctrl_t_h | ||
13 | |||
14 | #ifdef __cplusplus | ||
15 | extern "C" { | ||
16 | #endif | ||
17 | |||
18 | typedef struct _path_ctrl_t path_ctrl_t; | ||
19 | struct _path_ctrl_t | ||
20 | { | ||
21 | int8_t cmd; | ||
22 | int8_t speed; | ||
23 | }; | ||
24 | |||
25 | /** | ||
26 | * Create a deep copy of a path_ctrl_t. | ||
27 | * When no longer needed, destroy it with path_ctrl_t_destroy() | ||
28 | */ | ||
29 | path_ctrl_t* path_ctrl_t_copy(const path_ctrl_t* to_copy); | ||
30 | |||
31 | /** | ||
32 | * Destroy an instance of path_ctrl_t created by path_ctrl_t_copy() | ||
33 | */ | ||
34 | void path_ctrl_t_destroy(path_ctrl_t* to_destroy); | ||
35 | |||
36 | /** | ||
37 | * Identifies a single subscription. This is an opaque data type. | ||
38 | */ | ||
39 | typedef struct _path_ctrl_t_subscription_t path_ctrl_t_subscription_t; | ||
40 | |||
41 | /** | ||
42 | * Prototype for a callback function invoked when a message of type | ||
43 | * path_ctrl_t is received. | ||
44 | */ | ||
45 | typedef void(*path_ctrl_t_handler_t)(const lcm_recv_buf_t *rbuf, | ||
46 | const char *channel, const path_ctrl_t *msg, void *userdata); | ||
47 | |||
48 | /** | ||
49 | * Publish a message of type path_ctrl_t using LCM. | ||
50 | * | ||
51 | * @param lcm The LCM instance to publish with. | ||
52 | * @param channel The channel to publish on. | ||
53 | * @param msg The message to publish. | ||
54 | * @return 0 on success, <0 on error. Success means LCM has transferred | ||
55 | * responsibility of the message data to the OS. | ||
56 | */ | ||
57 | int path_ctrl_t_publish(lcm_t *lcm, const char *channel, const path_ctrl_t *msg); | ||
58 | |||
59 | /** | ||
60 | * Subscribe to messages of type path_ctrl_t using LCM. | ||
61 | * | ||
62 | * @param lcm The LCM instance to subscribe with. | ||
63 | * @param channel The channel to subscribe to. | ||
64 | * @param handler The callback function invoked by LCM when a message is received. | ||
65 | * This function is invoked by LCM during calls to lcm_handle() and | ||
66 | * lcm_handle_timeout(). | ||
67 | * @param userdata An opaque pointer passed to @p handler when it is invoked. | ||
68 | * @return 0 on success, <0 if an error occured | ||
69 | */ | ||
70 | path_ctrl_t_subscription_t* path_ctrl_t_subscribe(lcm_t *lcm, const char *channel, path_ctrl_t_handler_t handler, void *userdata); | ||
71 | |||
72 | /** | ||
73 | * Removes and destroys a subscription created by path_ctrl_t_subscribe() | ||
74 | */ | ||
75 | int path_ctrl_t_unsubscribe(lcm_t *lcm, path_ctrl_t_subscription_t* hid); | ||
76 | |||
77 | /** | ||
78 | * Sets the queue capacity for a subscription. | ||
79 | * Some LCM providers (e.g., the default multicast provider) are implemented | ||
80 | * using a background receive thread that constantly revceives messages from | ||
81 | * the network. As these messages are received, they are buffered on | ||
82 | * per-subscription queues until dispatched by lcm_handle(). This function | ||
83 | * how many messages are queued before dropping messages. | ||
84 | * | ||
85 | * @param subs the subscription to modify. | ||
86 | * @param num_messages The maximum number of messages to queue | ||
87 | * on the subscription. | ||
88 | * @return 0 on success, <0 if an error occured | ||
89 | */ | ||
90 | int path_ctrl_t_subscription_set_queue_capacity(path_ctrl_t_subscription_t* subs, | ||
91 | int num_messages); | ||
92 | |||
93 | /** | ||
94 | * Encode a message of type path_ctrl_t into binary form. | ||
95 | * | ||
96 | * @param buf The output buffer. | ||
97 | * @param offset Encoding starts at this byte offset into @p buf. | ||
98 | * @param maxlen Maximum number of bytes to write. This should generally | ||
99 | * be equal to path_ctrl_t_encoded_size(). | ||
100 | * @param msg The message to encode. | ||
101 | * @return The number of bytes encoded, or <0 if an error occured. | ||
102 | */ | ||
103 | int path_ctrl_t_encode(void *buf, int offset, int maxlen, const path_ctrl_t *p); | ||
104 | |||
105 | /** | ||
106 | * Decode a message of type path_ctrl_t from binary form. | ||
107 | * When decoding messages containing strings or variable-length arrays, this | ||
108 | * function may allocate memory. When finished with the decoded message, | ||
109 | * release allocated resources with path_ctrl_t_decode_cleanup(). | ||
110 | * | ||
111 | * @param buf The buffer containing the encoded message | ||
112 | * @param offset The byte offset into @p buf where the encoded message starts. | ||
113 | * @param maxlen The maximum number of bytes to read while decoding. | ||
114 | * @param msg Output parameter where the decoded message is stored | ||
115 | * @return The number of bytes decoded, or <0 if an error occured. | ||
116 | */ | ||
117 | int path_ctrl_t_decode(const void *buf, int offset, int maxlen, path_ctrl_t *msg); | ||
118 | |||
119 | /** | ||
120 | * Release resources allocated by path_ctrl_t_decode() | ||
121 | * @return 0 | ||
122 | */ | ||
123 | int path_ctrl_t_decode_cleanup(path_ctrl_t *p); | ||
124 | |||
125 | /** | ||
126 | * Check how many bytes are required to encode a message of type path_ctrl_t | ||
127 | */ | ||
128 | int path_ctrl_t_encoded_size(const path_ctrl_t *p); | ||
129 | |||
130 | // LCM support functions. Users should not call these | ||
131 | int64_t __path_ctrl_t_get_hash(void); | ||
132 | uint64_t __path_ctrl_t_hash_recursive(const __lcm_hash_ptr *p); | ||
133 | int __path_ctrl_t_encode_array(void *buf, int offset, int maxlen, const path_ctrl_t *p, int elements); | ||
134 | int __path_ctrl_t_decode_array(const void *buf, int offset, int maxlen, path_ctrl_t *p, int elements); | ||
135 | int __path_ctrl_t_decode_array_cleanup(path_ctrl_t *p, int elements); | ||
136 | int __path_ctrl_t_encoded_array_size(const path_ctrl_t *p, int elements); | ||
137 | int __path_ctrl_t_clone_array(const path_ctrl_t *p, path_ctrl_t *q, int elements); | ||
138 | |||
139 | #ifdef __cplusplus | ||
140 | } | ||
141 | #endif | ||
142 | |||
143 | #endif | ||