LCM
Loading...
Searching...
No Matches
lcm
lcm.h
1
#ifndef __lightweight_communications_h__
2
#define __lightweight_communications_h__
3
4
#include <stdint.h>
5
6
#include "lcm_c_namespace.h"
7
#include "lcm_version.h"
8
9
#ifdef LCM_PYTHON
10
#define LCM_EXPORT
11
#else
12
#include "lcm_export.h"
13
#endif
14
15
#include "eventlog.h"
16
17
#define LCM_MAX_MESSAGE_SIZE (1 << 28)
18
19
#define LCM_MAX_CHANNEL_NAME_LENGTH 63
20
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
25
#define lcm_create LCM_C_NAMESPACED(create)
26
#define lcm_destroy LCM_C_NAMESPACED(destroy)
27
#define lcm_get_fileno LCM_C_NAMESPACED(get_fileno)
28
#define lcm_subscribe LCM_C_NAMESPACED(subscribe)
29
#define lcm_unsubscribe LCM_C_NAMESPACED(unsubscribe)
30
#define lcm_publish LCM_C_NAMESPACED(publish)
31
#define lcm_handle LCM_C_NAMESPACED(handle)
32
#define lcm_handle_timeout LCM_C_NAMESPACED(handle_timeout)
33
#define lcm_subscription_set_queue_capacity LCM_C_NAMESPACED(subscription_set_queue_capacity)
34
#define lcm_subscription_get_queue_size LCM_C_NAMESPACED(subscription_get_queue_size)
35
62
typedef
struct
_lcm_t
lcm_t
;
63
67
typedef
struct
_lcm_subscription_t
lcm_subscription_t
;
68
73
typedef
struct
_lcm_recv_buf_t
lcm_recv_buf_t;
74
struct
_lcm_recv_buf_t
{
78
void
*
data
;
82
uint32_t
data_size
;
87
int64_t
recv_utime
;
91
lcm_t
*
lcm
;
92
};
93
103
typedef
void (*
lcm_msg_handler_t
)(
const
lcm_recv_buf_t *rbuf,
const
char
*channel,
void
*user_data);
104
202
LCM_EXPORT
203
lcm_t
*lcm_create(
const
char
*provider);
204
208
LCM_EXPORT
209
void
lcm_destroy(
lcm_t
*lcm);
210
224
LCM_EXPORT
225
int
lcm_get_fileno(
lcm_t
*lcm);
226
252
LCM_EXPORT
253
lcm_subscription_t
*lcm_subscribe(
lcm_t
*lcm,
const
char
*channel,
lcm_msg_handler_t
handler,
254
void
*userdata);
255
271
LCM_EXPORT
272
int
lcm_unsubscribe(
lcm_t
*lcm,
lcm_subscription_t
*handler);
273
289
LCM_EXPORT
290
int
lcm_publish(
lcm_t
*lcm,
const
char
*channel,
const
void
*data,
unsigned
int
datalen);
291
310
LCM_EXPORT
311
int
lcm_handle(
lcm_t
*lcm);
312
334
LCM_EXPORT
335
int
lcm_handle_timeout(
lcm_t
*lcm,
int
timeout_millis);
336
355
LCM_EXPORT
356
int
lcm_subscription_set_queue_capacity(
lcm_subscription_t
*handler,
int
num_messages);
357
361
LCM_EXPORT
362
int
lcm_subscription_get_queue_size(
lcm_subscription_t
*handler);
363
368
#ifdef __cplusplus
369
}
370
#endif
371
372
#endif
lcm_msg_handler_t
void(* lcm_msg_handler_t)(const lcm_recv_buf_t *rbuf, const char *channel, void *user_data)
Callback function prototype.
Definition
lcm.h:103
lcm_subscription_t
struct _lcm_subscription_t lcm_subscription_t
Definition
lcm.h:67
lcm_t
struct _lcm_t lcm_t
Definition
lcm.h:62
_lcm_recv_buf_t
Definition
lcm.h:74
_lcm_recv_buf_t::recv_utime
int64_t recv_utime
Definition
lcm.h:87
_lcm_recv_buf_t::lcm
lcm_t * lcm
Definition
lcm.h:91
_lcm_recv_buf_t::data_size
uint32_t data_size
Definition
lcm.h:82
_lcm_recv_buf_t::data
void * data
Definition
lcm.h:78
Generated on Wed Mar 19 2025 14:13:40 for LCM by
1.9.8