1#![allow(non_camel_case_types)]
2#![allow(non_upper_case_globals)]
3#![allow(non_snake_case)]
4pub const ECAL_ALLOCATE_4ME: u32 = 0;
7pub const ECAL_VERSION_MAJOR: u32 = 5;
8pub const ECAL_VERSION_MINOR: u32 = 5;
9pub const ECAL_VERSION_PATCH: u32 = 5;
10pub const ECAL_VERSION: &[u8; 18usize] = b"v5.5.5-3-gb779f09\0";
11pub const ECAL_DATE: &[u8; 11usize] = b"07.05.2020\0";
12pub const ECAL_PLATFORMTOOLSET: &[u8; 1usize] = b"\0";
13pub const eCAL_Init_Publisher: u32 = 1;
14pub const eCAL_Init_Subscriber: u32 = 2;
15pub const eCAL_Init_Service: u32 = 4;
16pub const eCAL_Init_Monitoring: u32 = 8;
17pub const eCAL_Init_Logging: u32 = 16;
18pub const eCAL_Init_TimeSync: u32 = 32;
19pub const eCAL_Init_RPC: u32 = 64;
20pub const eCAL_Init_ProcessReg: u32 = 128;
21pub const eCAL_Init_All: u32 = 255;
22pub const eCAL_Init_Default: u32 = 183;
23#[doc = " @brief Common handle for eCAL C API function calls."]
24pub type ECAL_HANDLE = *mut ::std::os::raw::c_void;
25extern "C" {
26 #[doc = " @brief Get eCAL version string."]
27 #[doc = ""]
28 #[doc = " @return Full eCAL version string."]
29 pub fn eCAL_GetVersionString() -> *const ::std::os::raw::c_char;
30}
31extern "C" {
32 #[doc = " @brief Get eCAL version date."]
33 #[doc = ""]
34 #[doc = " @return Full eCAL version date string."]
35 pub fn eCAL_GetVersionDateString() -> *const ::std::os::raw::c_char;
36}
37extern "C" {
38 #[doc = " @brief Get eCAL version as separated integer values."]
39 #[doc = ""]
40 #[doc = " @param [out] major_ The eCAL major version number."]
41 #[doc = " @param [out] minor_ The eCAL minor version number."]
42 #[doc = " @param [out] patch_ The eCAL patch version number."]
43 #[doc = ""]
44 #[doc = " @return Zero if succeeded."]
45 pub fn eCAL_GetVersion(
46 major_: *mut ::std::os::raw::c_int,
47 minor_: *mut ::std::os::raw::c_int,
48 patch_: *mut ::std::os::raw::c_int,
49 ) -> ::std::os::raw::c_int;
50}
51extern "C" {
52 #[doc = " @brief Initialize eCAL API."]
53 #[doc = ""]
54 #[doc = " @param argc_ Number of command line arguments."]
55 #[doc = " @param argv_ Array of command line arguments."]
56 #[doc = " @param unit_name_ Defines the name of the eCAL unit."]
57 #[doc = " @param components_ Defines which component to initialize."]
58 #[doc = ""]
59 #[doc = " @return Zero if succeeded, 1 if already initialized, -1 if failed."]
60 pub fn eCAL_Initialize(
61 argc_: ::std::os::raw::c_int,
62 argv_: *mut *mut ::std::os::raw::c_char,
63 unit_name_: *const ::std::os::raw::c_char,
64 components_: ::std::os::raw::c_uint,
65 ) -> ::std::os::raw::c_int;
66}
67extern "C" {
68 #[doc = " @brief Set/change the unit name of current module."]
69 #[doc = ""]
70 #[doc = " @param unit_name_ Defines the name of the eCAL unit."]
71 #[doc = ""]
72 #[doc = " @return Zero if succeeded."]
73 pub fn eCAL_SetUnitName(unit_name_: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
74}
75extern "C" {
76 #[doc = " @brief Finalize eCAL API."]
77 #[doc = ""]
78 #[doc = " @param components_ Defines which component to initialize (not yet supported)."]
79 #[doc = ""]
80 #[doc = " @return Zero if succeeded, 1 if already finalized, -1 if failed."]
81 pub fn eCAL_Finalize(components_: ::std::os::raw::c_uint) -> ::std::os::raw::c_int;
82}
83extern "C" {
84 #[doc = " @brief Check eCAL initialize state."]
85 #[doc = ""]
86 #[doc = " @param component_ Check specific component or 0 for general state of eCAL core."]
87 #[doc = ""]
88 #[doc = " @return None zero if eCAL is initialized."]
89 pub fn eCAL_IsInitialized(component_: ::std::os::raw::c_uint) -> ::std::os::raw::c_int;
90}
91extern "C" {
92 #[doc = " @brief Return the eCAL process state."]
93 #[doc = ""]
94 #[doc = " @return None zero if eCAL is in proper state."]
95 pub fn eCAL_Ok() -> ::std::os::raw::c_int;
96}
97extern "C" {
98 #[doc = " @brief Free an eCAL memory block allocated by functions like"]
99 #[doc = " eCAL_Monitoring_GetMonitoring, eCAL_Monitoring_GetLogging,"]
100 #[doc = " eCAL_Sub_Receive ... that use 'ECAL_ALLOCATE_4ME' as"]
101 #[doc = " buffer length parameter and let eCAL allocate"]
102 #[doc = " the memory internally."]
103 #[doc = ""]
104 #[doc = " @code"]
105 #[doc = " // let eCAL allocate memory for the subscriber buffer and return the pointer to 'buf'"]
106 #[doc = " long long time = 0;"]
107 #[doc = " int time_out = 100; // ms"]
108 #[doc = " void* buf = NULL;"]
109 #[doc = " int buf_len = eCAL_Sub_Receive(subscriber_handle, &buf, ECAL_ALLOCATE_4ME, &time, timeout);"]
110 #[doc = " if(buf_len > 0)"]
111 #[doc = " {"]
112 #[doc = " ..."]
113 #[doc = " // PROCESS THE BUFFER CONTENT HERE"]
114 #[doc = " ..."]
115 #[doc = " // finally free the allocated memory"]
116 #[doc = " eCAL_FreeMem(buf);"]
117 #[doc = " }"]
118 #[doc = " @endcode"]
119 pub fn eCAL_FreeMem(mem_: *mut ::std::os::raw::c_void);
120}
121extern "C" {
122 #[doc = " @brief Open a named or unnamed event."]
123 #[doc = ""]
124 #[doc = " @param event_name_ Event name (\"\" == unnamed)."]
125 #[doc = ""]
126 #[doc = " @return Handle to opened event or NULL if failed."]
127 pub fn eCAL_Event_gOpenEvent(event_name_: *const ::std::os::raw::c_char) -> ECAL_HANDLE;
128}
129extern "C" {
130 #[doc = " @brief Close an event."]
131 #[doc = ""]
132 #[doc = " @param handle_ Event handle."]
133 #[doc = ""]
134 #[doc = " @return None zero if succeeded."]
135 pub fn eCAL_Event_gCloseEvent(handle_: ECAL_HANDLE) -> ::std::os::raw::c_int;
136}
137extern "C" {
138 #[doc = " @brief Set an event active."]
139 #[doc = ""]
140 #[doc = " @param handle_ Event handle."]
141 #[doc = ""]
142 #[doc = " @return None zero if succeeded."]
143 pub fn eCAL_Event_gSetEvent(handle_: ECAL_HANDLE) -> ::std::os::raw::c_int;
144}
145extern "C" {
146 #[doc = " @brief Wait for an event with timeout."]
147 #[doc = ""]
148 #[doc = " @param handle_ Event handle."]
149 #[doc = " @param timeout_ Timeout in ms (-1 == infinite)."]
150 #[doc = ""]
151 #[doc = " @return None zero if succeeded."]
152 pub fn eCAL_Event_gWaitForEvent(
153 handle_: ECAL_HANDLE,
154 timeout_: ::std::os::raw::c_long,
155 ) -> ::std::os::raw::c_int;
156}
157extern "C" {
158 #[doc = " @brief Check whether an event is valid or not."]
159 #[doc = ""]
160 #[doc = " @param handle_ Event handle."]
161 #[doc = ""]
162 #[doc = " @return None zero if event is valid."]
163 pub fn eCAL_Event_gEventIsValid(handle_: ECAL_HANDLE) -> ::std::os::raw::c_int;
164}
165#[repr(i32)]
166#[doc = " @brief Values that represent different log level to filter on monitoring."]
167#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
168pub enum eCAL_Logging_eLogLevel {
169 log_level_none = 0,
170 log_level_all = 255,
171 log_level_info = 1,
172 log_level_warning = 2,
173 log_level_error = 4,
174 log_level_fatal = 8,
175 log_level_debug1 = 16,
176 log_level_debug2 = 32,
177 log_level_debug3 = 64,
178 log_level_debug4 = 128,
179}
180extern "C" {
181 #[doc = " @brief Sets the log level."]
182 #[doc = ""]
183 #[doc = " @param level_ The level."]
184 pub fn eCAL_Logging_SetLogLevel(level_: eCAL_Logging_eLogLevel);
185}
186extern "C" {
187 #[doc = " @brief Get the current log level."]
188 #[doc = ""]
189 #[doc = " @return The current log level."]
190 pub fn eCAL_Logging_GetLogLevel() -> eCAL_Logging_eLogLevel;
191}
192extern "C" {
193 #[doc = " @brief Log a message (with current log level)."]
194 #[doc = ""]
195 #[doc = " @param msg_ The log message string."]
196 pub fn eCAL_Logging_Log(msg_: *const ::std::os::raw::c_char);
197}
198extern "C" {
199 #[doc = " @brief Mark the start of the user core process."]
200 pub fn eCAL_Logging_StartCoreTimer();
201}
202extern "C" {
203 #[doc = " @brief Mark the stop of the user core process."]
204 pub fn eCAL_Logging_StopCoreTimer();
205}
206extern "C" {
207 #[doc = " @brief Set the current measured core time in s (for user implemented measuring)."]
208 #[doc = ""]
209 #[doc = " @param time_ The core time."]
210 pub fn eCAL_Logging_SetCoreTime(time_: f64);
211}
212extern "C" {
213 #[doc = " @brief Returns the current measured core time in s."]
214 pub fn eCAL_Logging_GetCoreTime() -> f64;
215}
216extern "C" {
217 #[doc = " @brief Set topics filter blacklist regular expression."]
218 #[doc = ""]
219 #[doc = " @param filter_ Topic filter as regular expression."]
220 #[doc = ""]
221 #[doc = " @return Zero if succeeded."]
222 pub fn eCAL_Monitoring_SetExclFilter(
223 filter_: *const ::std::os::raw::c_char,
224 ) -> ::std::os::raw::c_int;
225}
226extern "C" {
227 #[doc = " @brief Set topics filter whitelist regular expression."]
228 #[doc = ""]
229 #[doc = " @param filter_ Topic filter as regular expression."]
230 #[doc = ""]
231 #[doc = " @return Zero if succeeded."]
232 pub fn eCAL_Monitoring_SetInclFilter(
233 filter_: *const ::std::os::raw::c_char,
234 ) -> ::std::os::raw::c_int;
235}
236extern "C" {
237 #[doc = " @brief Switch topics filter using regular expression on/off."]
238 #[doc = ""]
239 #[doc = " @param state_ Filter on / off state."]
240 #[doc = ""]
241 #[doc = " @return Zero if succeeded."]
242 pub fn eCAL_Monitoring_SetFilterState(state_: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
243}
244extern "C" {
245 #[doc = " @brief Get monitoring protobuf string."]
246 #[doc = ""]
247 #[doc = " @param [out] buf_ Pointer to store the monitoring information."]
248 #[doc = " @param buf_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if"]
249 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
250 #[doc = ""]
251 #[doc = " @return Monitoring buffer length or zero if failed."]
252 #[doc = " @code"]
253 #[doc = " // let eCAL allocate memory for the monitoring buffer and return the pointer to 'buf'"]
254 #[doc = " void* buf = NULL;"]
255 #[doc = " int buf_len = eCAL_Monitoring_GetLogging(subscriber_handle, &buf, ECAL_ALLOCATE_4ME);"]
256 #[doc = " if(buf_len > 0)"]
257 #[doc = " {"]
258 #[doc = " ..."]
259 #[doc = " // PROCESS THE BUFFER CONTENT HERE"]
260 #[doc = " ..."]
261 #[doc = " // finally free the allocated memory"]
262 #[doc = " eCAL_FreeMem(buf);"]
263 #[doc = " }"]
264 #[doc = " @endcode"]
265 pub fn eCAL_Monitoring_GetMonitoring(
266 buf_: *mut ::std::os::raw::c_void,
267 buf_len_: ::std::os::raw::c_int,
268 ) -> ::std::os::raw::c_int;
269}
270extern "C" {
271 #[doc = " @brief Get logging string."]
272 #[doc = ""]
273 #[doc = " @param [out] buf_ Pointer to store the logging information."]
274 #[doc = " @param buf_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if"]
275 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
276 #[doc = ""]
277 #[doc = " @return Logging buffer length or zero if failed."]
278 pub fn eCAL_Monitoring_GetLogging(
279 buf_: *mut ::std::os::raw::c_void,
280 buf_len_: ::std::os::raw::c_int,
281 ) -> ::std::os::raw::c_int;
282}
283extern "C" {
284 #[doc = " @brief Publish monitoring protobuf message."]
285 #[doc = ""]
286 #[doc = " @param state_ Switch publishing on/off."]
287 #[doc = " @param name_ Monitoring topic name."]
288 #[doc = ""]
289 #[doc = " @return Zero if succeeded."]
290 pub fn eCAL_Monitoring_PubMonitoring(
291 state_: ::std::os::raw::c_int,
292 name_: *const ::std::os::raw::c_char,
293 ) -> ::std::os::raw::c_int;
294}
295extern "C" {
296 #[doc = " @brief Publish logging protobuf message."]
297 #[doc = ""]
298 #[doc = " @param state_ Switch publishing on/off."]
299 #[doc = " @param name_ Logging topic name."]
300 #[doc = ""]
301 #[doc = " @return Zero if succeeded."]
302 pub fn eCAL_Monitoring_PubLogging(
303 state_: ::std::os::raw::c_int,
304 name_: *const ::std::os::raw::c_char,
305 ) -> ::std::os::raw::c_int;
306}
307#[repr(i32)]
308#[doc = " @brief Process start mode (StartProcess)"]
309#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
310pub enum eCAL_Process_eStartMode {
311 #[doc = "< 0 == start mode normal"]
312 proc_smode_normal = 0,
313 #[doc = "< 1 == start mode hidden"]
314 proc_smode_hidden = 1,
315 #[doc = "< 2 == start mode minimized"]
316 proc_smode_minimized = 2,
317 #[doc = "< 3 == start mode maximized"]
318 proc_smode_maximized = 3,
319}
320#[repr(i32)]
321#[doc = " @brief Process severity"]
322#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
323pub enum eCAL_Process_eSeverity {
324 #[doc = "< 0 == condition unknown"]
325 proc_sev_unknown = 0,
326 #[doc = "< 1 == process healthy"]
327 proc_sev_healthy = 1,
328 #[doc = "< 2 == process warning level"]
329 proc_sev_warning = 2,
330 #[doc = "< 3 == process critical"]
331 proc_sev_critical = 3,
332 #[doc = "< 4 == process failed"]
333 proc_sev_failed = 4,
334}
335#[repr(i32)]
336#[doc = " @brief Process Severity Level"]
337#[doc = ""]
338#[doc = " enumerations for ECAL_API::SetState functionality"]
339#[doc = " where the lowest process severity is generally proc_sev_level1"]
340#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
341pub enum eCAL_Process_eSeverity_Level {
342 #[doc = "< default severity level 1"]
343 proc_sev_level1 = 1,
344 #[doc = "< severity level 2"]
345 proc_sev_level2 = 2,
346 #[doc = "< severity level 3"]
347 proc_sev_level3 = 3,
348 #[doc = "< severity level 4"]
349 proc_sev_level4 = 4,
350 #[doc = "< severity level 5"]
351 proc_sev_level5 = 5,
352}
353extern "C" {
354 #[doc = " @brief Dump configuration to console."]
355 pub fn eCAL_Process_DumpConfig();
356}
357extern "C" {
358 #[doc = " @brief Get current host name."]
359 #[doc = ""]
360 #[doc = " @param [out] name_ Pointer to store the host name."]
361 #[doc = " @param name_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if"]
362 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
363 #[doc = ""]
364 #[doc = " @return Buffer length or zero if failed."]
365 pub fn eCAL_Process_GetHostName(
366 name_: *mut ::std::os::raw::c_void,
367 name_len_: ::std::os::raw::c_int,
368 ) -> ::std::os::raw::c_int;
369}
370extern "C" {
371 #[doc = " @brief Get unique host id."]
372 #[doc = ""]
373 #[doc = " @return The host id."]
374 pub fn eCAL_Process_GetHostID() -> ::std::os::raw::c_int;
375}
376extern "C" {
377 #[doc = " @brief Get process unit name (defined with eCAL_Initialize)."]
378 #[doc = ""]
379 #[doc = " @param [out] name_ Pointer to store the unit name."]
380 #[doc = " @param name_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if"]
381 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
382 #[doc = ""]
383 #[doc = " @return Buffer length or zero if failed."]
384 pub fn eCAL_Process_GetUnitName(
385 name_: *mut ::std::os::raw::c_void,
386 name_len_: ::std::os::raw::c_int,
387 ) -> ::std::os::raw::c_int;
388}
389extern "C" {
390 #[doc = " @brief Get current process parameter (defined via eCAL_Initialize(argc_, arg_v)."]
391 #[doc = ""]
392 #[doc = " @param [out] par_ Pointer to store the process parameter."]
393 #[doc = " @param par_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if"]
394 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
395 #[doc = " @param sep_ Separator."]
396 #[doc = ""]
397 #[doc = " @return Buffer length or zero if failed."]
398 pub fn eCAL_Process_GetTaskParameter(
399 par_: *mut ::std::os::raw::c_void,
400 par_len_: ::std::os::raw::c_int,
401 sep_: *const ::std::os::raw::c_char,
402 ) -> ::std::os::raw::c_int;
403}
404extern "C" {
405 #[doc = " @brief Sleep current thread."]
406 #[doc = ""]
407 #[doc = " @param time_ms_ Time to sleep in ms."]
408 pub fn eCAL_Process_SleepMS(time_ms_: ::std::os::raw::c_long);
409}
410extern "C" {
411 #[doc = " @brief Get current process id."]
412 #[doc = ""]
413 #[doc = " @return The process id."]
414 pub fn eCAL_Process_GetProcessID() -> ::std::os::raw::c_int;
415}
416extern "C" {
417 #[doc = " @brief Get current process name."]
418 #[doc = ""]
419 #[doc = " @param [out] name_ Pointer to store the process name."]
420 #[doc = " @param name_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if"]
421 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
422 #[doc = ""]
423 #[doc = " @return Process name length or zero if failed."]
424 pub fn eCAL_Process_GetProcessName(
425 name_: *mut ::std::os::raw::c_void,
426 name_len_: ::std::os::raw::c_int,
427 ) -> ::std::os::raw::c_int;
428}
429extern "C" {
430 #[doc = " @brief Get current process parameter as string."]
431 #[doc = ""]
432 #[doc = " @param [out] par_ Pointer to store the process parameter."]
433 #[doc = " @param par_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if"]
434 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
435 #[doc = ""]
436 #[doc = " @return Process parameter length or zero if failed."]
437 pub fn eCAL_Process_GetProcessParameter(
438 par_: *mut ::std::os::raw::c_void,
439 par_len_: ::std::os::raw::c_int,
440 ) -> ::std::os::raw::c_int;
441}
442extern "C" {
443 #[doc = " @brief Get CPU usage of current process."]
444 #[doc = ""]
445 #[doc = " @return The CPU usage in percent."]
446 pub fn eCAL_Process_GetProcessCpuUsage() -> f32;
447}
448extern "C" {
449 #[doc = " @brief Get memory usage of current process."]
450 #[doc = ""]
451 #[doc = " @return The memory usage in bytes."]
452 pub fn eCAL_Process_GetProcessMemory() -> ::std::os::raw::c_ulong;
453}
454extern "C" {
455 #[doc = " @deprecated Use the function eCAL_Process_GetWClock() instead"]
456 pub fn eCAL_Process_GetSClock() -> ::std::os::raw::c_longlong;
457}
458extern "C" {
459 #[doc = " @deprecated Use the function eCAL_Process_GetWBytes() instead"]
460 pub fn eCAL_Process_GetSBytes() -> ::std::os::raw::c_longlong;
461}
462extern "C" {
463 #[doc = " @brief Get the write clock of the current process."]
464 #[doc = ""]
465 #[doc = " @return The message write count per second."]
466 pub fn eCAL_Process_GetWClock() -> ::std::os::raw::c_longlong;
467}
468extern "C" {
469 #[doc = " @brief Get the write bytes of the current process."]
470 #[doc = ""]
471 #[doc = " @return The message write bytes per second."]
472 pub fn eCAL_Process_GetWBytes() -> ::std::os::raw::c_longlong;
473}
474extern "C" {
475 #[doc = " @brief Get the read clock of the current process."]
476 #[doc = ""]
477 #[doc = " @return The message read count per second."]
478 pub fn eCAL_Process_GetRClock() -> ::std::os::raw::c_longlong;
479}
480extern "C" {
481 #[doc = " @brief Get the read bytes of the current process."]
482 #[doc = ""]
483 #[doc = " @return The message read bytes per second."]
484 pub fn eCAL_Process_GetRBytes() -> ::std::os::raw::c_longlong;
485}
486extern "C" {
487 #[doc = " @brief Set process state info."]
488 #[doc = ""]
489 #[doc = " @param severity_ Severity."]
490 #[doc = " @param level_ Severity level."]
491 #[doc = " @param info_ Info message."]
492 #[doc = ""]
493 pub fn eCAL_Process_SetState(
494 severity_: eCAL_Process_eSeverity,
495 level_: eCAL_Process_eSeverity_Level,
496 info_: *const ::std::os::raw::c_char,
497 );
498}
499extern "C" {
500 #[doc = " @brief Start specified process (windows only)."]
501 #[doc = ""]
502 #[doc = " @param proc_name_ Process name."]
503 #[doc = " @param proc_args_ Process argument string."]
504 #[doc = " @param working_dir_ Working directory."]
505 #[doc = " @param create_console_ Start process in own console window (Windows only)."]
506 #[doc = " @param process_mode_ Start normal, hidden, minimized, maximized (Windows only)."]
507 #[doc = " @param block_ Block until process finished."]
508 #[doc = ""]
509 #[doc = " @return Process id or zero if failed."]
510 pub fn eCAL_Process_StartProcess(
511 proc_name_: *const ::std::os::raw::c_char,
512 proc_args_: *const ::std::os::raw::c_char,
513 working_dir_: *const ::std::os::raw::c_char,
514 create_console_: ::std::os::raw::c_int,
515 process_mode_: eCAL_Process_eStartMode,
516 block_: ::std::os::raw::c_int,
517 ) -> ::std::os::raw::c_int;
518}
519extern "C" {
520 #[doc = " @brief Stop specified process (windows only)."]
521 #[doc = ""]
522 #[doc = " @param proc_name_ Process name."]
523 #[doc = ""]
524 #[doc = " @return None zero if successful."]
525 pub fn eCAL_Process_StopProcessName(
526 proc_name_: *const ::std::os::raw::c_char,
527 ) -> ::std::os::raw::c_int;
528}
529extern "C" {
530 #[doc = " @brief Stop specified process (windows only)."]
531 #[doc = ""]
532 #[doc = " @param proc_id_ Process id."]
533 #[doc = ""]
534 #[doc = " @return None zero if successful."]
535 pub fn eCAL_Process_StopProcessID(proc_id_: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
536}
537#[repr(i32)]
538#[doc = " @brief eCAL subscriber event callback struct."]
539#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
540pub enum eCAL_Subscriber_Event {
541 sub_event_none = 0,
542 sub_event_connected = 1,
543 sub_event_disconnected = 2,
544 sub_event_dropped = 3,
545 sub_event_timeout = 4,
546 sub_event_corrupted = 5,
547}
548#[repr(i32)]
549#[doc = " @brief eCAL publisher event callback struct."]
550#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
551pub enum eCAL_Publisher_Event {
552 pub_event_none = 0,
553 pub_event_connected = 1,
554 pub_event_disconnected = 2,
555 pub_event_dropped = 3,
556}
557#[repr(i32)]
558#[doc = " @brief eCAL registration event type."]
559#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
560pub enum eCAL_Registration_Event {
561 reg_event_none = 0,
562 reg_event_publisher = 1,
563 reg_event_subscriber = 2,
564 reg_event_service = 3,
565 reg_event_process = 4,
566}
567#[doc = " @brief eCAL subscriber receive callback struct (C variant)."]
568#[repr(C)]
569#[derive(Debug, Copy, Clone, PartialEq, Eq)]
570pub struct SReceiveCallbackDataC {
571 #[doc = "!< payload buffer"]
572 pub buf: *mut ::std::os::raw::c_void,
573 #[doc = "!< payload buffer size"]
574 pub size: ::std::os::raw::c_long,
575 #[doc = "!< source id"]
576 pub id: ::std::os::raw::c_longlong,
577 #[doc = "!< source time stamp"]
578 pub time: ::std::os::raw::c_longlong,
579 #[doc = "!< source write clock"]
580 pub clock: ::std::os::raw::c_longlong,
581}
582#[test]
583fn bindgen_test_layout_SReceiveCallbackDataC() {
584 assert_eq!(
585 ::std::mem::size_of::<SReceiveCallbackDataC>(),
586 40usize,
587 concat!("Size of: ", stringify!(SReceiveCallbackDataC))
588 );
589 assert_eq!(
590 ::std::mem::align_of::<SReceiveCallbackDataC>(),
591 8usize,
592 concat!("Alignment of ", stringify!(SReceiveCallbackDataC))
593 );
594 assert_eq!(
595 unsafe { &(*(::std::ptr::null::<SReceiveCallbackDataC>())).buf as *const _ as usize },
596 0usize,
597 concat!(
598 "Offset of field: ",
599 stringify!(SReceiveCallbackDataC),
600 "::",
601 stringify!(buf)
602 )
603 );
604 assert_eq!(
605 unsafe { &(*(::std::ptr::null::<SReceiveCallbackDataC>())).size as *const _ as usize },
606 8usize,
607 concat!(
608 "Offset of field: ",
609 stringify!(SReceiveCallbackDataC),
610 "::",
611 stringify!(size)
612 )
613 );
614 assert_eq!(
615 unsafe { &(*(::std::ptr::null::<SReceiveCallbackDataC>())).id as *const _ as usize },
616 16usize,
617 concat!(
618 "Offset of field: ",
619 stringify!(SReceiveCallbackDataC),
620 "::",
621 stringify!(id)
622 )
623 );
624 assert_eq!(
625 unsafe { &(*(::std::ptr::null::<SReceiveCallbackDataC>())).time as *const _ as usize },
626 24usize,
627 concat!(
628 "Offset of field: ",
629 stringify!(SReceiveCallbackDataC),
630 "::",
631 stringify!(time)
632 )
633 );
634 assert_eq!(
635 unsafe { &(*(::std::ptr::null::<SReceiveCallbackDataC>())).clock as *const _ as usize },
636 32usize,
637 concat!(
638 "Offset of field: ",
639 stringify!(SReceiveCallbackDataC),
640 "::",
641 stringify!(clock)
642 )
643 );
644}
645impl Default for SReceiveCallbackDataC {
646 fn default() -> Self {
647 unsafe { ::std::mem::zeroed() }
648 }
649}
650#[doc = " @brief eCAL receive callback function"]
651#[doc = ""]
652#[doc = " @param topic_name_ Topic name of the data source (publisher)."]
653#[doc = " @param data_ Data payload struct."]
654#[doc = " @param par_ Forwarded user defined parameter."]
655pub type ReceiveCallbackCT = ::std::option::Option<
656 unsafe extern "C" fn(
657 topic_name_: *const ::std::os::raw::c_char,
658 data_: *const SReceiveCallbackDataC,
659 par_: *mut ::std::os::raw::c_void,
660 ),
661>;
662#[doc = " @brief eCAL timer callback function"]
663#[doc = ""]
664#[doc = " @param par_ Forwarded user defined parameter."]
665pub type TimerCallbackCT =
666 ::std::option::Option<unsafe extern "C" fn(par_: *mut ::std::os::raw::c_void)>;
667#[doc = " @brief eCAL publisher event callback struct (C variant)."]
668#[repr(C)]
669#[derive(Debug, Copy, Clone, PartialEq, Eq)]
670pub struct SPubEventCallbackDataC {
671 #[doc = "!< event type"]
672 pub type_: eCAL_Publisher_Event,
673 #[doc = "!< event time stamp"]
674 pub time: ::std::os::raw::c_longlong,
675 #[doc = "!< event clock"]
676 pub clock: ::std::os::raw::c_longlong,
677}
678#[test]
679fn bindgen_test_layout_SPubEventCallbackDataC() {
680 assert_eq!(
681 ::std::mem::size_of::<SPubEventCallbackDataC>(),
682 24usize,
683 concat!("Size of: ", stringify!(SPubEventCallbackDataC))
684 );
685 assert_eq!(
686 ::std::mem::align_of::<SPubEventCallbackDataC>(),
687 8usize,
688 concat!("Alignment of ", stringify!(SPubEventCallbackDataC))
689 );
690 assert_eq!(
691 unsafe { &(*(::std::ptr::null::<SPubEventCallbackDataC>())).type_ as *const _ as usize },
692 0usize,
693 concat!(
694 "Offset of field: ",
695 stringify!(SPubEventCallbackDataC),
696 "::",
697 stringify!(type_)
698 )
699 );
700 assert_eq!(
701 unsafe { &(*(::std::ptr::null::<SPubEventCallbackDataC>())).time as *const _ as usize },
702 8usize,
703 concat!(
704 "Offset of field: ",
705 stringify!(SPubEventCallbackDataC),
706 "::",
707 stringify!(time)
708 )
709 );
710 assert_eq!(
711 unsafe { &(*(::std::ptr::null::<SPubEventCallbackDataC>())).clock as *const _ as usize },
712 16usize,
713 concat!(
714 "Offset of field: ",
715 stringify!(SPubEventCallbackDataC),
716 "::",
717 stringify!(clock)
718 )
719 );
720}
721impl Default for SPubEventCallbackDataC {
722 fn default() -> Self {
723 unsafe { ::std::mem::zeroed() }
724 }
725}
726#[doc = " @brief eCAL subscriber event callback struct (C variant)."]
727#[repr(C)]
728#[derive(Debug, Copy, Clone, PartialEq, Eq)]
729pub struct SSubEventCallbackDataC {
730 #[doc = "!< event type"]
731 pub type_: eCAL_Subscriber_Event,
732 #[doc = "!< event time stamp"]
733 pub time: ::std::os::raw::c_longlong,
734 #[doc = "!< event clock"]
735 pub clock: ::std::os::raw::c_longlong,
736}
737#[test]
738fn bindgen_test_layout_SSubEventCallbackDataC() {
739 assert_eq!(
740 ::std::mem::size_of::<SSubEventCallbackDataC>(),
741 24usize,
742 concat!("Size of: ", stringify!(SSubEventCallbackDataC))
743 );
744 assert_eq!(
745 ::std::mem::align_of::<SSubEventCallbackDataC>(),
746 8usize,
747 concat!("Alignment of ", stringify!(SSubEventCallbackDataC))
748 );
749 assert_eq!(
750 unsafe { &(*(::std::ptr::null::<SSubEventCallbackDataC>())).type_ as *const _ as usize },
751 0usize,
752 concat!(
753 "Offset of field: ",
754 stringify!(SSubEventCallbackDataC),
755 "::",
756 stringify!(type_)
757 )
758 );
759 assert_eq!(
760 unsafe { &(*(::std::ptr::null::<SSubEventCallbackDataC>())).time as *const _ as usize },
761 8usize,
762 concat!(
763 "Offset of field: ",
764 stringify!(SSubEventCallbackDataC),
765 "::",
766 stringify!(time)
767 )
768 );
769 assert_eq!(
770 unsafe { &(*(::std::ptr::null::<SSubEventCallbackDataC>())).clock as *const _ as usize },
771 16usize,
772 concat!(
773 "Offset of field: ",
774 stringify!(SSubEventCallbackDataC),
775 "::",
776 stringify!(clock)
777 )
778 );
779}
780impl Default for SSubEventCallbackDataC {
781 fn default() -> Self {
782 unsafe { ::std::mem::zeroed() }
783 }
784}
785#[doc = " @brief eCAL publisher event callback function"]
786#[doc = ""]
787#[doc = " @param topic_name_ Topic name of the data connection (subscriber)."]
788#[doc = " @param data_ Event type struct."]
789#[doc = " @param par_ Forwarded user defined parameter."]
790pub type SubEventCallbackCT = ::std::option::Option<
791 unsafe extern "C" fn(
792 topic_name_: *const ::std::os::raw::c_char,
793 data_: *const SSubEventCallbackDataC,
794 par_: *mut ::std::os::raw::c_void,
795 ),
796>;
797#[doc = " @brief eCAL subscriber event callback function"]
798#[doc = ""]
799#[doc = " @param topic_name_ Topic name of the data connection (publisher)."]
800#[doc = " @param data_ Event type struct."]
801#[doc = " @param par_ Forwarded user defined parameter."]
802pub type PubEventCallbackCT = ::std::option::Option<
803 unsafe extern "C" fn(
804 topic_name_: *const ::std::os::raw::c_char,
805 data_: *const SPubEventCallbackDataC,
806 par_: *mut ::std::os::raw::c_void,
807 ),
808>;
809#[repr(i32)]
810#[doc = " @brief eCAL QOS history kind mode."]
811#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
812pub enum eQOSPolicy_HistoryKindC {
813 #[doc = "< Keep only a number of samples, default value."]
814 keep_last_history_qos = 0,
815 #[doc = "< Keep all samples until the ResourceLimitsQosPolicy are exhausted."]
816 keep_all_history_qos = 1,
817}
818#[repr(i32)]
819#[doc = " @brief eCAL QOS reliability mode."]
820#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
821pub enum eQOSPolicy_ReliabilityC {
822 #[doc = "< Best Effort reliability (default for Subscribers)."]
823 best_effort_reliability_qos = 0,
824 #[doc = "< Reliable reliability (default for Publishers)."]
825 reliable_reliability_qos = 1,
826}
827#[doc = " @brief eCAL data writer QOS settings."]
828#[repr(C)]
829#[derive(Debug, Copy, Clone, PartialEq, Eq)]
830pub struct SWriterQOSC {
831 #[doc = "< qos history kind mode"]
832 pub history_kind: eQOSPolicy_HistoryKindC,
833 #[doc = "< qos history kind mode depth"]
834 pub history_kind_depth: ::std::os::raw::c_int,
835 #[doc = "< qos reliability mode"]
836 pub reliability: eQOSPolicy_ReliabilityC,
837}
838#[test]
839fn bindgen_test_layout_SWriterQOSC() {
840 assert_eq!(
841 ::std::mem::size_of::<SWriterQOSC>(),
842 12usize,
843 concat!("Size of: ", stringify!(SWriterQOSC))
844 );
845 assert_eq!(
846 ::std::mem::align_of::<SWriterQOSC>(),
847 4usize,
848 concat!("Alignment of ", stringify!(SWriterQOSC))
849 );
850 assert_eq!(
851 unsafe { &(*(::std::ptr::null::<SWriterQOSC>())).history_kind as *const _ as usize },
852 0usize,
853 concat!(
854 "Offset of field: ",
855 stringify!(SWriterQOSC),
856 "::",
857 stringify!(history_kind)
858 )
859 );
860 assert_eq!(
861 unsafe { &(*(::std::ptr::null::<SWriterQOSC>())).history_kind_depth as *const _ as usize },
862 4usize,
863 concat!(
864 "Offset of field: ",
865 stringify!(SWriterQOSC),
866 "::",
867 stringify!(history_kind_depth)
868 )
869 );
870 assert_eq!(
871 unsafe { &(*(::std::ptr::null::<SWriterQOSC>())).reliability as *const _ as usize },
872 8usize,
873 concat!(
874 "Offset of field: ",
875 stringify!(SWriterQOSC),
876 "::",
877 stringify!(reliability)
878 )
879 );
880}
881impl Default for SWriterQOSC {
882 fn default() -> Self {
883 unsafe { ::std::mem::zeroed() }
884 }
885}
886#[doc = " @brief eCAL data reader QOS settings."]
887#[repr(C)]
888#[derive(Debug, Copy, Clone, PartialEq, Eq)]
889pub struct SReaderQOSC {
890 #[doc = "< qos history kind mode"]
891 pub history_kind: eQOSPolicy_HistoryKindC,
892 #[doc = "< qos history kind mode depth"]
893 pub history_kind_depth: ::std::os::raw::c_int,
894 #[doc = "< qos reliability mode"]
895 pub reliability: eQOSPolicy_ReliabilityC,
896}
897#[test]
898fn bindgen_test_layout_SReaderQOSC() {
899 assert_eq!(
900 ::std::mem::size_of::<SReaderQOSC>(),
901 12usize,
902 concat!("Size of: ", stringify!(SReaderQOSC))
903 );
904 assert_eq!(
905 ::std::mem::align_of::<SReaderQOSC>(),
906 4usize,
907 concat!("Alignment of ", stringify!(SReaderQOSC))
908 );
909 assert_eq!(
910 unsafe { &(*(::std::ptr::null::<SReaderQOSC>())).history_kind as *const _ as usize },
911 0usize,
912 concat!(
913 "Offset of field: ",
914 stringify!(SReaderQOSC),
915 "::",
916 stringify!(history_kind)
917 )
918 );
919 assert_eq!(
920 unsafe { &(*(::std::ptr::null::<SReaderQOSC>())).history_kind_depth as *const _ as usize },
921 4usize,
922 concat!(
923 "Offset of field: ",
924 stringify!(SReaderQOSC),
925 "::",
926 stringify!(history_kind_depth)
927 )
928 );
929 assert_eq!(
930 unsafe { &(*(::std::ptr::null::<SReaderQOSC>())).reliability as *const _ as usize },
931 8usize,
932 concat!(
933 "Offset of field: ",
934 stringify!(SReaderQOSC),
935 "::",
936 stringify!(reliability)
937 )
938 );
939}
940impl Default for SReaderQOSC {
941 fn default() -> Self {
942 unsafe { ::std::mem::zeroed() }
943 }
944}
945#[repr(i32)]
946#[doc = " @brief eCAL transport layer types."]
947#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
948pub enum eTransportLayerC {
949 tlayer_none = 0,
950 tlayer_udp_mc = 1,
951 tlayer_shm = 4,
952 tlayer_inproc = 42,
953 tlayer_all = 255,
954}
955#[repr(i32)]
956#[doc = " @brief eCAL transport layer modes."]
957#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
958pub enum eSendModeC {
959 smode_none = -1,
960 smode_off = 0,
961 smode_on = 1,
962 smode_auto = 2,
963}
964extern "C" {
965 #[doc = " @brief Instance a publisher."]
966 #[doc = ""]
967 #[doc = " @return Handle to new publisher or NULL if failed."]
968 pub fn eCAL_Pub_New() -> ECAL_HANDLE;
969}
970extern "C" {
971 #[doc = " @brief Create a publisher."]
972 #[doc = ""]
973 #[doc = " @param handle_ Publisher handle."]
974 #[doc = " @param topic_name_ Unique topic name."]
975 #[doc = " @param topic_type_ Topic type name."]
976 #[doc = " @param topic_desc_ Topic type description."]
977 #[doc = " @param topic_desc_len_ Topic type description length."]
978 #[doc = ""]
979 #[doc = " @return None zero if succeeded."]
980 pub fn eCAL_Pub_Create(
981 handle_: ECAL_HANDLE,
982 topic_name_: *const ::std::os::raw::c_char,
983 topic_type_: *const ::std::os::raw::c_char,
984 topic_desc_: *const ::std::os::raw::c_char,
985 topic_desc_len_: ::std::os::raw::c_int,
986 ) -> ::std::os::raw::c_int;
987}
988extern "C" {
989 #[doc = " @brief Destroy a publisher."]
990 #[doc = ""]
991 #[doc = " @param handle_ Publisher handle."]
992 #[doc = ""]
993 #[doc = " @return None zero if succeeded."]
994 pub fn eCAL_Pub_Destroy(handle_: ECAL_HANDLE) -> ::std::os::raw::c_int;
995}
996extern "C" {
997 #[doc = " @brief Setup topic type description."]
998 #[doc = ""]
999 #[doc = " @param handle_ Publisher handle."]
1000 #[doc = " @param topic_desc_ Topic type description."]
1001 #[doc = " @param topic_desc_len_ Topic type description length."]
1002 #[doc = ""]
1003 #[doc = " @return None zero if succeeded."]
1004 pub fn eCAL_Pub_SetDescription(
1005 handle_: ECAL_HANDLE,
1006 topic_desc_: *const ::std::os::raw::c_char,
1007 topic_desc_len_: ::std::os::raw::c_int,
1008 ) -> ::std::os::raw::c_int;
1009}
1010extern "C" {
1011 #[doc = " @brief Share topic type."]
1012 #[doc = ""]
1013 #[doc = " @param handle_ Publisher handle."]
1014 #[doc = " @param state_ Set type share mode (none zero == share type)."]
1015 #[doc = ""]
1016 #[doc = " @return None zero if succeeded."]
1017 pub fn eCAL_Pub_ShareType(
1018 handle_: ECAL_HANDLE,
1019 state_: ::std::os::raw::c_int,
1020 ) -> ::std::os::raw::c_int;
1021}
1022extern "C" {
1023 #[doc = " @brief Share topic description."]
1024 #[doc = ""]
1025 #[doc = " @param handle_ Publisher handle."]
1026 #[doc = " @param state_ Set description share mode (none zero == share description)."]
1027 #[doc = ""]
1028 #[doc = " @return None zero if succeeded."]
1029 pub fn eCAL_Pub_ShareDescription(
1030 handle_: ECAL_HANDLE,
1031 state_: ::std::os::raw::c_int,
1032 ) -> ::std::os::raw::c_int;
1033}
1034extern "C" {
1035 #[doc = " @brief Set publisher quality of service attributes."]
1036 #[doc = ""]
1037 #[doc = " @param handle_ Publisher handle."]
1038 #[doc = " @param qos_ Quality of service policies."]
1039 #[doc = ""]
1040 #[doc = " @return None zero if succeeded."]
1041 pub fn eCAL_Pub_SetQOS(handle_: ECAL_HANDLE, qos_: SWriterQOSC) -> ::std::os::raw::c_int;
1042}
1043extern "C" {
1044 #[doc = " @brief Get publisher quality of service attributes."]
1045 #[doc = ""]
1046 #[doc = " @param handle_ Publisher handle."]
1047 #[doc = " @param qos_ Quality of service policies."]
1048 #[doc = ""]
1049 #[doc = " @return None zero if succeeded."]
1050 pub fn eCAL_Pub_GetQOS(handle_: ECAL_HANDLE, qos_: *mut SWriterQOSC) -> ::std::os::raw::c_int;
1051}
1052extern "C" {
1053 #[doc = " @brief Set publisher send mode for specific transport layer."]
1054 #[doc = ""]
1055 #[doc = " @param handle_ Publisher handle."]
1056 #[doc = " @param layer_ Transport layer."]
1057 #[doc = " @param mode_ Send mode."]
1058 #[doc = ""]
1059 #[doc = " @return True if it succeeds, false if it fails."]
1060 pub fn eCAL_Pub_SetLayerMode(
1061 handle_: ECAL_HANDLE,
1062 layer_: eTransportLayerC,
1063 mode_: eSendModeC,
1064 ) -> ::std::os::raw::c_int;
1065}
1066extern "C" {
1067 #[doc = " @brief Set publisher maximum transmit bandwidth for the udp layer."]
1068 #[doc = ""]
1069 #[doc = " @param handle_ Publisher handle."]
1070 #[doc = " @param bandwidth_ Maximum bandwidth in bytes/s (-1 == unlimited)."]
1071 #[doc = ""]
1072 #[doc = " @return True if it succeeds, false if it fails."]
1073 pub fn eCAL_Pub_SetMaxBandwidthUDP(
1074 handle_: ECAL_HANDLE,
1075 bandwidth_: ::std::os::raw::c_long,
1076 ) -> ::std::os::raw::c_int;
1077}
1078extern "C" {
1079 #[doc = " @brief Set publisher maximum transmit bandwidth for the udp layer."]
1080 #[doc = ""]
1081 #[doc = " @param handle_ Publisher handle."]
1082 #[doc = " @param id_ The topic id for subscriber side filtering (0 == no id)."]
1083 #[doc = ""]
1084 #[doc = " @return True if it succeeds, false if it fails."]
1085 pub fn eCAL_Pub_SetID(
1086 handle_: ECAL_HANDLE,
1087 id_: ::std::os::raw::c_longlong,
1088 ) -> ::std::os::raw::c_int;
1089}
1090extern "C" {
1091 #[doc = " @brief Set publisher maximum number of used shared memory buffers."]
1092 #[doc = ""]
1093 #[doc = " @param handle_ Publisher handle."]
1094 #[doc = " @param buffering_ Maximum number of used buffers (needs to be greater than 1, default = 1)."]
1095 #[doc = ""]
1096 #[doc = " @return True if it succeeds, false if it fails."]
1097 pub fn eCAL_Pub_ShmSetBufferCount(
1098 handle_: ECAL_HANDLE,
1099 buffering_: ::std::os::raw::c_long,
1100 ) -> ::std::os::raw::c_int;
1101}
1102extern "C" {
1103 #[doc = " @brief Query if the publisher is subscribed."]
1104 #[doc = ""]
1105 #[doc = " @param handle_ Publisher handle."]
1106 #[doc = ""]
1107 #[doc = " @return None zero if subscribed."]
1108 pub fn eCAL_Pub_IsSubscribed(handle_: ECAL_HANDLE) -> ::std::os::raw::c_int;
1109}
1110extern "C" {
1111 #[doc = " @brief Send a message to all subscribers."]
1112 #[doc = ""]
1113 #[doc = " @param handle_ Publisher handle."]
1114 #[doc = " @param buf_ Buffer that contains content to send."]
1115 #[doc = " @param buf_len_ Send buffer length."]
1116 #[doc = " @param time_ Send time (-1 = use eCAL system time in us, default = -1)."]
1117 #[doc = ""]
1118 #[doc = " @return Number of bytes sent."]
1119 pub fn eCAL_Pub_Send(
1120 handle_: ECAL_HANDLE,
1121 buf_: *const ::std::os::raw::c_void,
1122 buf_len_: ::std::os::raw::c_int,
1123 time_: ::std::os::raw::c_longlong,
1124 ) -> ::std::os::raw::c_int;
1125}
1126extern "C" {
1127 #[doc = " @brief Add callback function for publisher events."]
1128 #[doc = ""]
1129 #[doc = " @param handle_ Publisher handle."]
1130 #[doc = " @param type_ The event type to react on."]
1131 #[doc = " @param callback_ The callback function to add."]
1132 #[doc = " @param par_ User defined context that will be forwarded to the callback function."]
1133 #[doc = ""]
1134 #[doc = " @return None zero if succeeded."]
1135 pub fn eCAL_Pub_AddEventCallbackC(
1136 handle_: ECAL_HANDLE,
1137 type_: eCAL_Publisher_Event,
1138 callback_: PubEventCallbackCT,
1139 par_: *mut ::std::os::raw::c_void,
1140 ) -> ::std::os::raw::c_int;
1141}
1142extern "C" {
1143 #[doc = " @brief Remove callback function for publisher events."]
1144 #[doc = ""]
1145 #[doc = " @param handle_ Publisher handle."]
1146 #[doc = " @param type_ The event type to remove."]
1147 #[doc = ""]
1148 #[doc = " @return None zero if succeeded."]
1149 pub fn eCAL_Pub_RemEventCallback(
1150 handle_: ECAL_HANDLE,
1151 type_: eCAL_Publisher_Event,
1152 ) -> ::std::os::raw::c_int;
1153}
1154extern "C" {
1155 #[doc = " @brief Dump the whole class state into a string buffer."]
1156 #[doc = ""]
1157 #[doc = " @param handle_ Publisher handle."]
1158 #[doc = " @param [out] buf_ Pointer to store the monitoring information."]
1159 #[doc = " @param buf_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if"]
1160 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
1161 #[doc = ""]
1162 #[doc = " @return Dump buffer length or zero if failed."]
1163 pub fn eCAL_Pub_Dump(
1164 handle_: ECAL_HANDLE,
1165 buf_: *mut ::std::os::raw::c_void,
1166 buf_len_: ::std::os::raw::c_int,
1167 ) -> ::std::os::raw::c_int;
1168}
1169#[repr(i32)]
1170#[doc = " @brief Service call state."]
1171#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1172pub enum eCallState {
1173 #[doc = "!< undefined"]
1174 call_state_none = 0,
1175 #[doc = "!< executed (successfully)"]
1176 call_state_executed = 1,
1177 #[doc = "!< failed"]
1178 call_state_failed = 2,
1179}
1180#[doc = " @brief eCAL service info struct returned as service response (C API)."]
1181#[repr(C)]
1182#[derive(Debug, Copy, Clone, PartialEq, Eq)]
1183pub struct SServiceInfoC {
1184 #[doc = "!< service host"]
1185 pub host_name: *const ::std::os::raw::c_char,
1186 #[doc = "!< service name"]
1187 pub service_name: *const ::std::os::raw::c_char,
1188 #[doc = "!< method name"]
1189 pub method_name: *const ::std::os::raw::c_char,
1190 #[doc = "!< error message in case of failure"]
1191 pub error_msg: *const ::std::os::raw::c_char,
1192 #[doc = "!< return state from method callback"]
1193 pub ret_state: ::std::os::raw::c_int,
1194 #[doc = "!< service call state"]
1195 pub call_state: eCallState,
1196}
1197#[test]
1198fn bindgen_test_layout_SServiceInfoC() {
1199 assert_eq!(
1200 ::std::mem::size_of::<SServiceInfoC>(),
1201 40usize,
1202 concat!("Size of: ", stringify!(SServiceInfoC))
1203 );
1204 assert_eq!(
1205 ::std::mem::align_of::<SServiceInfoC>(),
1206 8usize,
1207 concat!("Alignment of ", stringify!(SServiceInfoC))
1208 );
1209 assert_eq!(
1210 unsafe { &(*(::std::ptr::null::<SServiceInfoC>())).host_name as *const _ as usize },
1211 0usize,
1212 concat!(
1213 "Offset of field: ",
1214 stringify!(SServiceInfoC),
1215 "::",
1216 stringify!(host_name)
1217 )
1218 );
1219 assert_eq!(
1220 unsafe { &(*(::std::ptr::null::<SServiceInfoC>())).service_name as *const _ as usize },
1221 8usize,
1222 concat!(
1223 "Offset of field: ",
1224 stringify!(SServiceInfoC),
1225 "::",
1226 stringify!(service_name)
1227 )
1228 );
1229 assert_eq!(
1230 unsafe { &(*(::std::ptr::null::<SServiceInfoC>())).method_name as *const _ as usize },
1231 16usize,
1232 concat!(
1233 "Offset of field: ",
1234 stringify!(SServiceInfoC),
1235 "::",
1236 stringify!(method_name)
1237 )
1238 );
1239 assert_eq!(
1240 unsafe { &(*(::std::ptr::null::<SServiceInfoC>())).error_msg as *const _ as usize },
1241 24usize,
1242 concat!(
1243 "Offset of field: ",
1244 stringify!(SServiceInfoC),
1245 "::",
1246 stringify!(error_msg)
1247 )
1248 );
1249 assert_eq!(
1250 unsafe { &(*(::std::ptr::null::<SServiceInfoC>())).ret_state as *const _ as usize },
1251 32usize,
1252 concat!(
1253 "Offset of field: ",
1254 stringify!(SServiceInfoC),
1255 "::",
1256 stringify!(ret_state)
1257 )
1258 );
1259 assert_eq!(
1260 unsafe { &(*(::std::ptr::null::<SServiceInfoC>())).call_state as *const _ as usize },
1261 36usize,
1262 concat!(
1263 "Offset of field: ",
1264 stringify!(SServiceInfoC),
1265 "::",
1266 stringify!(call_state)
1267 )
1268 );
1269}
1270impl Default for SServiceInfoC {
1271 fn default() -> Self {
1272 unsafe { ::std::mem::zeroed() }
1273 }
1274}
1275#[doc = " @brief eCAL service method callback function (server side)"]
1276#[doc = ""]
1277#[doc = " @param method_ Method name."]
1278#[doc = " @param req_type_ Type of the request message."]
1279#[doc = " @param resp_type_ Type of the response message."]
1280#[doc = " @param request_ Request payload."]
1281#[doc = " @param request_len_ Request payload length."]
1282#[doc = " @param [out] reponse_ Method response payload."]
1283#[doc = " @param [out] reponse_len_ Method response payload length."]
1284#[doc = " @param par_ Forwarded user defined parameter."]
1285pub type MethodCallbackCT = ::std::option::Option<
1286 unsafe extern "C" fn(
1287 method_: *const ::std::os::raw::c_char,
1288 req_type_: *const ::std::os::raw::c_char,
1289 resp_type_: *const ::std::os::raw::c_char,
1290 request_: *const ::std::os::raw::c_char,
1291 request_len_: ::std::os::raw::c_int,
1292 response_: *mut *mut ::std::os::raw::c_void,
1293 response_len_: *mut ::std::os::raw::c_int,
1294 par_: *mut ::std::os::raw::c_void,
1295 ) -> ::std::os::raw::c_int,
1296>;
1297#[doc = " @brief eCAL service response callback function (client side)"]
1298#[doc = ""]
1299#[doc = " @param service_info_ Service info struct."]
1300#[doc = " @param reponse_ Method response payload."]
1301#[doc = " @param reponse_len_ Method response payload length."]
1302#[doc = " @param par_ Forwarded user defined parameter."]
1303pub type ResponseCallbackCT = ::std::option::Option<
1304 unsafe extern "C" fn(
1305 service_info_: *const SServiceInfoC,
1306 response_: *const ::std::os::raw::c_char,
1307 response_len_: ::std::os::raw::c_int,
1308 par_: *mut ::std::os::raw::c_void,
1309 ),
1310>;
1311extern "C" {
1312 #[doc = " @brief Create a server."]
1313 #[doc = ""]
1314 #[doc = " @param service_name_ Service name."]
1315 #[doc = ""]
1316 #[doc = " @return Handle to created server or NULL if failed."]
1317 pub fn eCAL_Server_Create(service_name_: *const ::std::os::raw::c_char) -> ECAL_HANDLE;
1318}
1319extern "C" {
1320 #[doc = " @brief Destroy a server."]
1321 #[doc = ""]
1322 #[doc = " @param handle_ Server handle."]
1323 #[doc = ""]
1324 #[doc = " @return None zero if succeeded."]
1325 pub fn eCAL_Server_Destroy(handle_: ECAL_HANDLE) -> ::std::os::raw::c_int;
1326}
1327extern "C" {
1328 #[doc = " @brief Add server method callback."]
1329 #[doc = ""]
1330 #[doc = " @param handle_ Server handle."]
1331 #[doc = " @param method_ Service method name."]
1332 #[doc = " @param req_type_ Method request type (default = \"\")."]
1333 #[doc = " @param resp_type_ Method response type (default = \"\")."]
1334 #[doc = " @param callback_ Callback function for server request."]
1335 #[doc = " @param par_ User defined context that will be forwarded to the request function."]
1336 #[doc = ""]
1337 #[doc = " @return None zero if succeeded."]
1338 pub fn eCAL_Server_AddMethodCallbackC(
1339 handle_: ECAL_HANDLE,
1340 method_: *const ::std::os::raw::c_char,
1341 req_type_: *const ::std::os::raw::c_char,
1342 resp_type_: *const ::std::os::raw::c_char,
1343 callback_: MethodCallbackCT,
1344 par_: *mut ::std::os::raw::c_void,
1345 ) -> ::std::os::raw::c_int;
1346}
1347extern "C" {
1348 #[doc = " @brief Remove server method callback."]
1349 #[doc = ""]
1350 #[doc = " @param handle_ Server handle."]
1351 #[doc = " @param method_ Service method name."]
1352 #[doc = ""]
1353 #[doc = " @return None zero if succeeded."]
1354 pub fn eCAL_Server_RemMethodCallbackC(
1355 handle_: ECAL_HANDLE,
1356 method_: *const ::std::os::raw::c_char,
1357 ) -> ::std::os::raw::c_int;
1358}
1359extern "C" {
1360 #[doc = " @brief Retrieve the service name."]
1361 #[doc = ""]
1362 #[doc = " @param handle_ Server handle."]
1363 #[doc = " @param [out] buf_ Pointer to store the server service string."]
1364 #[doc = " @param buf_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if"]
1365 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
1366 #[doc = ""]
1367 #[doc = " @return Description buffer length or zero if failed."]
1368 pub fn eCAL_Server_GetServiceName(
1369 handle_: ECAL_HANDLE,
1370 buf_: *mut ::std::os::raw::c_void,
1371 buf_len_: ::std::os::raw::c_int,
1372 ) -> ::std::os::raw::c_int;
1373}
1374extern "C" {
1375 #[doc = " @brief Create a client."]
1376 #[doc = ""]
1377 #[doc = " @param service_name_ Service name."]
1378 #[doc = ""]
1379 #[doc = " @return Handle to created client or NULL if failed."]
1380 pub fn eCAL_Client_Create(service_name_: *const ::std::os::raw::c_char) -> ECAL_HANDLE;
1381}
1382extern "C" {
1383 #[doc = " @brief Destroy a client."]
1384 #[doc = ""]
1385 #[doc = " @param handle_ Client handle."]
1386 #[doc = ""]
1387 #[doc = " @return None zero if succeeded."]
1388 pub fn eCAL_Client_Destroy(handle_: ECAL_HANDLE) -> ::std::os::raw::c_int;
1389}
1390extern "C" {
1391 #[doc = " @brief Change the host name filter for that client instance"]
1392 #[doc = ""]
1393 #[doc = " @param handle_ Client handle."]
1394 #[doc = " @param host_name_ Host name filter (empty or \"*\" == all hosts)"]
1395 #[doc = ""]
1396 #[doc = " @return None zero if succeeded."]
1397 pub fn eCAL_Client_SetHostName(
1398 handle_: ECAL_HANDLE,
1399 host_name_: *const ::std::os::raw::c_char,
1400 ) -> ::std::os::raw::c_int;
1401}
1402extern "C" {
1403 #[doc = " @brief Call method of this service (none blocking variant with callback)."]
1404 #[doc = ""]
1405 #[doc = " @param handle_ Client handle."]
1406 #[doc = " @param method_name_ Method name."]
1407 #[doc = " @param request_ Request message buffer."]
1408 #[doc = " @param request_len_ Request message length."]
1409 #[doc = ""]
1410 #[doc = " @return None zero if succeeded."]
1411 pub fn eCAL_Client_Call(
1412 handle_: ECAL_HANDLE,
1413 method_name_: *const ::std::os::raw::c_char,
1414 request_: *const ::std::os::raw::c_char,
1415 request_len_: ::std::os::raw::c_int,
1416 ) -> ::std::os::raw::c_int;
1417}
1418extern "C" {
1419 #[doc = " @brief Call method of this service (blocking variant with timeout)."]
1420 #[doc = ""]
1421 #[doc = " @param handle_ Client handle."]
1422 #[doc = " @param host_name_ Host name."]
1423 #[doc = " @param method_name_ Method name."]
1424 #[doc = " @param request_ Request message buffer."]
1425 #[doc = " @param request_len_ Request message length."]
1426 #[doc = " @param [out] service_info_ Service info struct with additional infos like call state and"]
1427 #[doc = " error message."]
1428 #[doc = " @param [out] response_ Pointer to the allocated buffer for the response message."]
1429 #[doc = " @param response_len_ Response message buffer length or ECAL_ALLOCATE_4ME if"]
1430 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
1431 #[doc = ""]
1432 #[doc = " @return Size of response buffer if succeeded, otherwise zero."]
1433 pub fn eCAL_Client_Call_Wait(
1434 handle_: ECAL_HANDLE,
1435 host_name_: *const ::std::os::raw::c_char,
1436 method_name_: *const ::std::os::raw::c_char,
1437 request_: *const ::std::os::raw::c_char,
1438 request_len_: ::std::os::raw::c_int,
1439 service_info_: *mut SServiceInfoC,
1440 response_: *mut ::std::os::raw::c_void,
1441 response_len_: ::std::os::raw::c_int,
1442 ) -> ::std::os::raw::c_int;
1443}
1444extern "C" {
1445 #[doc = " @brief Add server response callback."]
1446 #[doc = ""]
1447 #[doc = " @param handle_ Client handle."]
1448 #[doc = " @param callback_ Callback function for server response."]
1449 #[doc = " @param par_ User defined context that will be forwarded to the callback function."]
1450 #[doc = ""]
1451 #[doc = " @return None zero if succeeded."]
1452 pub fn eCAL_Client_AddResponseCallbackC(
1453 handle_: ECAL_HANDLE,
1454 callback_: ResponseCallbackCT,
1455 par_: *mut ::std::os::raw::c_void,
1456 ) -> ::std::os::raw::c_int;
1457}
1458extern "C" {
1459 #[doc = " @brief Remove server response callback."]
1460 #[doc = ""]
1461 #[doc = " @param handle_ Client handle."]
1462 #[doc = ""]
1463 #[doc = " @return None zero if succeeded."]
1464 pub fn eCAL_Client_RemResponseCallback(handle_: ECAL_HANDLE) -> ::std::os::raw::c_int;
1465}
1466extern "C" {
1467 #[doc = " @brief Instance a subscriber."]
1468 #[doc = ""]
1469 #[doc = " @return Handle to new subscriber or NULL if failed."]
1470 pub fn eCAL_Sub_New() -> ECAL_HANDLE;
1471}
1472extern "C" {
1473 #[doc = " @brief Create a subscriber."]
1474 #[doc = ""]
1475 #[doc = " @param handle_ Subscriber handle."]
1476 #[doc = " @param topic_name_ Unique topic name."]
1477 #[doc = " @param topic_type_ Topic type name."]
1478 #[doc = " @param topic_desc_ Topic description."]
1479 #[doc = " @param topic_desc_len_ Topic type description length."]
1480 #[doc = ""]
1481 #[doc = " @return None zero if succeeded."]
1482 pub fn eCAL_Sub_Create(
1483 handle_: ECAL_HANDLE,
1484 topic_name_: *const ::std::os::raw::c_char,
1485 topic_type_: *const ::std::os::raw::c_char,
1486 topic_desc_: *const ::std::os::raw::c_char,
1487 topic_desc_len_: ::std::os::raw::c_int,
1488 ) -> ::std::os::raw::c_int;
1489}
1490extern "C" {
1491 #[doc = " @brief Destroy a subscriber."]
1492 #[doc = ""]
1493 #[doc = " @param handle_ Subscriber handle."]
1494 #[doc = ""]
1495 #[doc = " @return None zero if succeeded."]
1496 pub fn eCAL_Sub_Destroy(handle_: ECAL_HANDLE) -> ::std::os::raw::c_int;
1497}
1498extern "C" {
1499 #[doc = " @brief Set subscriber quality of service attributes."]
1500 #[doc = ""]
1501 #[doc = " @param handle_ Subscriber handle."]
1502 #[doc = " @param qos_ Quality of service policies."]
1503 #[doc = ""]
1504 #[doc = " @return None zero if succeeded."]
1505 pub fn eCAL_Sub_SetQOS(handle_: ECAL_HANDLE, qos_: SReaderQOSC) -> ::std::os::raw::c_int;
1506}
1507extern "C" {
1508 #[doc = " @brief Get subscriber quality of service attributes."]
1509 #[doc = ""]
1510 #[doc = " @param handle_ Subscriber handle."]
1511 #[doc = " @param qos_ Quality of service policies."]
1512 #[doc = ""]
1513 #[doc = " @return None zero if succeeded."]
1514 pub fn eCAL_Sub_GetQOS(handle_: ECAL_HANDLE, qos_: *mut SReaderQOSC) -> ::std::os::raw::c_int;
1515}
1516extern "C" {
1517 #[doc = " @brief Set a set of id's to prefiltering topics (see eCAL_Pub_SetID)."]
1518 #[doc = ""]
1519 #[doc = " @param handle_ Subscriber handle."]
1520 #[doc = " @param id_array_ Array of id's (Use nullptr to reset id's)."]
1521 #[doc = " @param id_num_ Number of id's."]
1522 #[doc = ""]
1523 #[doc = " @return None zero if succeeded."]
1524 pub fn eCAL_Sub_SetID(
1525 handle_: ECAL_HANDLE,
1526 id_array_: *const ::std::os::raw::c_longlong,
1527 id_num_: ::std::os::raw::c_int,
1528 ) -> ::std::os::raw::c_int;
1529}
1530extern "C" {
1531 #[doc = " @brief Receive a message from the publisher."]
1532 #[doc = ""]
1533 #[doc = " @param handle_ Subscriber handle."]
1534 #[doc = " @param [out] buf_ Buffer to store the received message content."]
1535 #[doc = " @param buf_len_ Length of the receive buffer or ECAL_ALLOCATE_4ME if"]
1536 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
1537 #[doc = " @param [out] time_ Time from publisher in us."]
1538 #[doc = " @param rcv_timeout_ Maximum time before receive operation returns (in milliseconds, -1 means infinite)."]
1539 #[doc = ""]
1540 #[doc = " @return Length of received buffer."]
1541 pub fn eCAL_Sub_Receive(
1542 handle_: ECAL_HANDLE,
1543 buf_: *mut *mut ::std::os::raw::c_void,
1544 buf_len_: ::std::os::raw::c_int,
1545 time_: *mut ::std::os::raw::c_longlong,
1546 rcv_timeout_: ::std::os::raw::c_int,
1547 ) -> ::std::os::raw::c_int;
1548}
1549extern "C" {
1550 #[doc = " @brief Add callback function for incoming receives."]
1551 #[doc = ""]
1552 #[doc = " @param handle_ Subscriber handle."]
1553 #[doc = " @param callback_ The callback function to add."]
1554 #[doc = " @param par_ User defined context that will be forwarded to the callback function."]
1555 #[doc = ""]
1556 #[doc = " @return None zero if succeeded."]
1557 pub fn eCAL_Sub_AddReceiveCallbackC(
1558 handle_: ECAL_HANDLE,
1559 callback_: ReceiveCallbackCT,
1560 par_: *mut ::std::os::raw::c_void,
1561 ) -> ::std::os::raw::c_int;
1562}
1563extern "C" {
1564 #[doc = " @brief Remove callback function for incoming receives."]
1565 #[doc = ""]
1566 #[doc = " @param handle_ Subscriber handle."]
1567 #[doc = ""]
1568 #[doc = " @return None zero if succeeded."]
1569 pub fn eCAL_Sub_RemReceiveCallback(handle_: ECAL_HANDLE) -> ::std::os::raw::c_int;
1570}
1571extern "C" {
1572 #[doc = " @brief Add callback function for subscriber events."]
1573 #[doc = ""]
1574 #[doc = " @param handle_ Subscriber handle."]
1575 #[doc = " @param type_ The event type to react on."]
1576 #[doc = " @param callback_ The callback function to add."]
1577 #[doc = " @param par_ User defined context that will be forwarded to the callback function."]
1578 #[doc = ""]
1579 #[doc = " @return None zero if succeeded."]
1580 pub fn eCAL_Sub_AddEventCallbackC(
1581 handle_: ECAL_HANDLE,
1582 type_: eCAL_Subscriber_Event,
1583 callback_: SubEventCallbackCT,
1584 par_: *mut ::std::os::raw::c_void,
1585 ) -> ::std::os::raw::c_int;
1586}
1587extern "C" {
1588 #[doc = " @brief Remove callback function for subscriber events."]
1589 #[doc = ""]
1590 #[doc = " @param handle_ Subscriber handle."]
1591 #[doc = " @param type_ The event type to remove."]
1592 #[doc = ""]
1593 #[doc = " @return None zero if succeeded."]
1594 pub fn eCAL_Sub_RemEventCallback(
1595 handle_: ECAL_HANDLE,
1596 type_: eCAL_Subscriber_Event,
1597 ) -> ::std::os::raw::c_int;
1598}
1599extern "C" {
1600 #[doc = " @brief Gets description of the connected topic."]
1601 #[doc = ""]
1602 #[doc = " @param handle_ Subscriber handle."]
1603 #[doc = " @param [out] buf_ Pointer to store the subscriber description string."]
1604 #[doc = " @param buf_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if"]
1605 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
1606 #[doc = ""]
1607 #[doc = " @return Description buffer length or zero if failed."]
1608 pub fn eCAL_Sub_GetDescription(
1609 handle_: ECAL_HANDLE,
1610 buf_: *mut ::std::os::raw::c_void,
1611 buf_len_: ::std::os::raw::c_int,
1612 ) -> ::std::os::raw::c_int;
1613}
1614extern "C" {
1615 #[doc = " @brief Set the timeout parameter for triggering"]
1616 #[doc = " the timeout callback."]
1617 #[doc = ""]
1618 #[doc = " @param handle_ Subscriber handle."]
1619 #[doc = " @param timeout_ The timeout in milliseconds."]
1620 #[doc = ""]
1621 #[doc = " @return True if succeeded, false if not."]
1622 pub fn eCAL_Sub_SetTimeout(
1623 handle_: ECAL_HANDLE,
1624 timeout_: ::std::os::raw::c_int,
1625 ) -> ::std::os::raw::c_int;
1626}
1627extern "C" {
1628 #[doc = " @brief Dump the whole class state into a string buffer."]
1629 #[doc = ""]
1630 #[doc = " @param handle_ Publisher handle."]
1631 #[doc = " @param [out] buf_ Pointer to store the monitoring information."]
1632 #[doc = " @param buf_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if"]
1633 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
1634 #[doc = ""]
1635 #[doc = " @return Dump buffer length or zero if failed."]
1636 pub fn eCAL_Sub_Dump(
1637 handle_: ECAL_HANDLE,
1638 buf_: *mut ::std::os::raw::c_void,
1639 buf_len_: ::std::os::raw::c_int,
1640 ) -> ::std::os::raw::c_int;
1641}
1642extern "C" {
1643 #[doc = " @brief Create a subscriber."]
1644 #[doc = ""]
1645 #[doc = " @param topic_name_ Unique topic name."]
1646 #[doc = ""]
1647 #[doc = " @return Handle to created subscriber or NULL if failed."]
1648 pub fn eCAL_Proto_Dyn_JSON_Sub_Create(
1649 topic_name_: *const ::std::os::raw::c_char,
1650 ) -> ECAL_HANDLE;
1651}
1652extern "C" {
1653 #[doc = " @brief Destroy a subscriber."]
1654 #[doc = ""]
1655 #[doc = " @param handle_ Subscriber handle."]
1656 #[doc = ""]
1657 #[doc = " @return None zero if succeeded."]
1658 pub fn eCAL_Proto_Dyn_JSON_Sub_Destroy(handle_: ECAL_HANDLE) -> ::std::os::raw::c_int;
1659}
1660extern "C" {
1661 #[doc = " @brief Add callback function for incoming receives."]
1662 #[doc = ""]
1663 #[doc = " @param handle_ Subscriber handle."]
1664 #[doc = " @param callback_ The callback function to add."]
1665 #[doc = " @param par_ User defined context that will be forwarded to the callback function."]
1666 #[doc = ""]
1667 #[doc = " @return None zero if succeeded."]
1668 pub fn eCAL_Proto_Dyn_JSON_Sub_AddReceiveCallbackC(
1669 handle_: ECAL_HANDLE,
1670 callback_: ReceiveCallbackCT,
1671 par_: *mut ::std::os::raw::c_void,
1672 ) -> ::std::os::raw::c_int;
1673}
1674extern "C" {
1675 #[doc = " @brief Remove callback function for incoming receives."]
1676 #[doc = ""]
1677 #[doc = " @param handle_ Subscriber handle."]
1678 #[doc = ""]
1679 #[doc = " @return None zero if succeeded."]
1680 pub fn eCAL_Proto_Dyn_JSON_Sub_RemReceiveCallback(
1681 handle_: ECAL_HANDLE,
1682 ) -> ::std::os::raw::c_int;
1683}
1684extern "C" {
1685 #[doc = " @brief Get interface name."]
1686 #[doc = ""]
1687 #[doc = " @return Get time sync interface name."]
1688 pub fn eCAL_Time_GetName(
1689 name_: *mut ::std::os::raw::c_void,
1690 name_len_: ::std::os::raw::c_int,
1691 ) -> ::std::os::raw::c_int;
1692}
1693extern "C" {
1694 #[doc = " @brief Get current time"]
1695 #[doc = ""]
1696 #[doc = " @return current time in us."]
1697 pub fn eCAL_Time_GetMicroSeconds() -> ::std::os::raw::c_longlong;
1698}
1699extern "C" {
1700 #[doc = " @brief Get current time"]
1701 #[doc = ""]
1702 #[doc = " @return current time in ns."]
1703 pub fn eCAL_Time_GetNanoSeconds() -> ::std::os::raw::c_longlong;
1704}
1705extern "C" {
1706 #[doc = " @brief Set current time in nano seconds if host is time master."]
1707 #[doc = ""]
1708 #[doc = " @param time_ Current time in ns."]
1709 #[doc = ""]
1710 #[doc = " @return Zero if succeeded non zero otherwise."]
1711 pub fn eCAL_Time_SetNanoSeconds(time_: ::std::os::raw::c_longlong) -> ::std::os::raw::c_int;
1712}
1713extern "C" {
1714 #[doc = " @brief Returns time synchronization state."]
1715 #[doc = ""]
1716 #[doc = " @return Non zero if process is time synchronized."]
1717 pub fn eCAL_Time_IsTimeSynchronized() -> ::std::os::raw::c_int;
1718}
1719extern "C" {
1720 #[doc = " @brief Checks whether this host is time master."]
1721 #[doc = ""]
1722 #[doc = " @return Non zero if host is time master."]
1723 pub fn eCAL_Time_IsTimeMaster() -> ::std::os::raw::c_int;
1724}
1725extern "C" {
1726 #[doc = " @brief Blocks for the given amount of nanoseconds."]
1727 #[doc = ""]
1728 #[doc = " The actual amount of (real-) time is influenced by the current rate at"]
1729 #[doc = " which the time is proceeding."]
1730 #[doc = " It is not guaranteed, that the precision of this function actually is in"]
1731 #[doc = " nanoseconds. Limitations of the operating system might reduce the accuracy."]
1732 #[doc = ""]
1733 #[doc = " @param duration_nsecs_ the duration in nanoseconds"]
1734 pub fn eCAL_Time_SleepForNanoseconds(duration_nsecs_: ::std::os::raw::c_longlong);
1735}
1736extern "C" {
1737 #[doc = " @brief Get the current error code and status message"]
1738 #[doc = ""]
1739 #[doc = " An error code of 0 is considered to be OK. Any other error code is"]
1740 #[doc = " considered to indicate a problem. Time Adapters may use a set of error"]
1741 #[doc = " codes to indicate specific problems."]
1742 #[doc = " The status message may be a nullpointer. If the user is not interested in"]
1743 #[doc = " the status message, max_len_ has to be < 0."]
1744 #[doc = " If max_len_ is ECAL_ALLOCATE_4ME, memory will be allocated. The calling"]
1745 #[doc = " function has to free it."]
1746 #[doc = ""]
1747 #[doc = " @param error_ [out] The error code"]
1748 #[doc = " @param status_message_ [out] A pointer to a char array for the status message. The message will NOT be null-terminated."]
1749 #[doc = " @param max_len_ [in] The length of the allocated memory for the status_message_, ECAL_ALOCATE_4ME if the function has to allocate memory or -1 if not interested in the message."]
1750 #[doc = " @return"]
1751 pub fn eCAL_Time_GetStatus(
1752 error_: *mut ::std::os::raw::c_int,
1753 status_message_: *mut *mut ::std::os::raw::c_char,
1754 max_len_: ::std::os::raw::c_int,
1755 ) -> ::std::os::raw::c_int;
1756}
1757extern "C" {
1758 #[doc = " @brief Create a timer."]
1759 #[doc = ""]
1760 #[doc = " @return Handle to created timer or NULL if failed."]
1761 pub fn eCAL_Timer_Create() -> ECAL_HANDLE;
1762}
1763extern "C" {
1764 #[doc = " @brief Create a timer."]
1765 #[doc = ""]
1766 #[doc = " @param handle_ Timer handle."]
1767 #[doc = ""]
1768 #[doc = " @return Handle to created timer or NULL if failed."]
1769 pub fn eCAL_Timer_Destroy(handle_: ECAL_HANDLE) -> ::std::os::raw::c_int;
1770}
1771extern "C" {
1772 #[doc = " @brief Start the timer."]
1773 #[doc = ""]
1774 #[doc = " @param handle_ Timer handle."]
1775 #[doc = " @param timeout_ Timer callback loop time in ms."]
1776 #[doc = " @param callback_ The callback function."]
1777 #[doc = " @param delay_ Timer callback delay for first call in ms."]
1778 #[doc = " @param par_ User defined context that will be forwarded to the callback function."]
1779 #[doc = ""]
1780 #[doc = " @return None zero if succeeded."]
1781 pub fn eCAL_Timer_Start(
1782 handle_: ECAL_HANDLE,
1783 timeout_: ::std::os::raw::c_int,
1784 callback_: TimerCallbackCT,
1785 delay_: ::std::os::raw::c_int,
1786 par_: *mut ::std::os::raw::c_void,
1787 ) -> ::std::os::raw::c_int;
1788}
1789extern "C" {
1790 #[doc = " @brief Stop the timer."]
1791 #[doc = ""]
1792 #[doc = " @param handle_ Timer handle."]
1793 #[doc = ""]
1794 #[doc = " @return None zero if succeeded."]
1795 pub fn eCAL_Timer_Stop(handle_: ECAL_HANDLE) -> ::std::os::raw::c_int;
1796}
1797extern "C" {
1798 #[doc = " @brief Send shutdown event to specified local user process using it's unit name."]
1799 #[doc = ""]
1800 #[doc = " @param unit_name_ Process unit name."]
1801 pub fn eCAL_Util_ShutdownUnitName(unit_name_: *const ::std::os::raw::c_char);
1802}
1803extern "C" {
1804 #[doc = " @brief Send shutdown event to specified local user process using it's process id."]
1805 #[doc = ""]
1806 #[doc = " @param process_id_ Process id."]
1807 pub fn eCAL_Util_ShutdownProcessID(process_id_: ::std::os::raw::c_int);
1808}
1809extern "C" {
1810 #[doc = " @brief Send shutdown event to all local user processes."]
1811 pub fn eCAL_Util_ShutdownProcesses();
1812}
1813extern "C" {
1814 #[doc = " @brief Send shutdown event to all local core components."]
1815 pub fn eCAL_Util_ShutdownCore();
1816}
1817extern "C" {
1818 #[doc = " @brief Enable eCAL message loop back,"]
1819 #[doc = " that means subscriber will receive messages from"]
1820 #[doc = " publishers of the same process (default == false)."]
1821 #[doc = ""]
1822 #[doc = " @param state_ Switch on message loop back.."]
1823 pub fn eCAL_Util_EnableLoopback(state_: ::std::os::raw::c_int);
1824}
1825extern "C" {
1826 #[doc = " @brief Gets type name of the specified topic."]
1827 #[doc = ""]
1828 #[doc = " @param topic_name_ Topic name."]
1829 #[doc = " @param [out] topic_type_ Pointer to store the type name information."]
1830 #[doc = " @param topic_type_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if"]
1831 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
1832 #[doc = ""]
1833 #[doc = " @return Type name buffer length or zero if failed."]
1834 pub fn eCAL_Util_GetTypeName(
1835 topic_name_: *const ::std::os::raw::c_char,
1836 topic_type_: *mut ::std::os::raw::c_void,
1837 topic_type_len_: ::std::os::raw::c_int,
1838 ) -> ::std::os::raw::c_int;
1839}
1840extern "C" {
1841 #[doc = " @brief Gets type description of the specified topic."]
1842 #[doc = ""]
1843 #[doc = " @param topic_name_ Topic name."]
1844 #[doc = " @param [out] topic_desc_ Pointer to store the type description information."]
1845 #[doc = " @param topic_desc_len_ Length of allocated buffer or ECAL_ALLOCATE_4ME if"]
1846 #[doc = " eCAL should allocate the buffer for you (see eCAL_FreeMem)."]
1847 #[doc = ""]
1848 #[doc = " @return Type description buffer length or zero if failed."]
1849 pub fn eCAL_Util_GetDescription(
1850 topic_name_: *const ::std::os::raw::c_char,
1851 topic_desc_: *mut ::std::os::raw::c_void,
1852 topic_desc_len_: ::std::os::raw::c_int,
1853 ) -> ::std::os::raw::c_int;
1854}