You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libosdp-sys/src/bindings.rs
+84-15Lines changed: 84 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -338,6 +338,14 @@ pub type osdp_read_fn_t = ::core::option::Option<
338
338
maxlen:::core::ffi::c_int,
339
339
) -> ::core::ffi::c_int,
340
340
>;
341
+
#[doc = " @brief Pointer to function used to receive a full packet buffer.\n The callee returns a pointer and a max_len up to which LibOSDP may\n access the buffer. The caller must invoke release_pkt() when done.\n\n @param data for use by underlying layers. osdp_channel::data is passed\n @param buf output pointer to the packet buffer\n @param max_len output maximum length LibOSDP may touch in this buffer\n @return 0 when a complete packet is available; non-zero otherwise"]
#[doc = " @brief pointer to function that sends byte array into some channel. This\n function should be non-blocking.\n\n @param data for use by underlying layers. osdp_channel::data is passed\n @param buf byte array to be sent\n @param len number of bytes in `buf`\n\n @retval +ve: number of bytes sent. must be <= `len`\n @retval -ve on errors\n\n @note For now, LibOSDP expects method to write/queue all or no bytes over\n the channel per-invocation; ie., it does not support partial writes and is a\n known limitation. Since an OSDP packet isn't so large, and typical TX\n buffers are much larger than that, it's not as bad as it sounds and hence\n not on the priority list to be fixed."]
342
350
pubtypeosdp_write_fn_t = ::core::option::Option<
343
351
unsafeextern"C"fn(
@@ -352,6 +360,9 @@ pub type osdp_flush_fn_t =
352
360
#[doc = " @brief pointer to function that closes the underlying channel. This call is\n made when LibOSDP is terminating, once per PD.\n\n @param data for use by underlying layers. osdp_channel::data is passed"]
#[doc = " @brief Pointer to function used to release a buffer returned by recv_pkt().\n\n @param data for use by underlying layers. osdp_channel::data is passed\n @param buf pointer that was returned by recv_pkt()"]
#[doc = " @brief User defined communication channel abstraction for OSDP devices.\n The methods for read/write/flush are expected to be non-blocking."]
356
367
#[repr(C)]
357
368
#[derive(Debug,Copy,Clone)]
@@ -362,25 +373,33 @@ pub struct osdp_channel {
362
373
pubid:::core::ffi::c_int,
363
374
#[doc = " Pointer to function used to receive osdp packet data"]
364
375
pubrecv:osdp_read_fn_t,
376
+
#[doc = " Pointer to function used to receive a full packet buffer (optional)"]
377
+
pubrecv_pkt:osdp_read_pkt_fn_t,
365
378
#[doc = " Pointer to function used to send osdp packet data"]
366
379
pubsend:osdp_write_fn_t,
367
380
#[doc = " Pointer to function used to flush the channel (optional)"]
368
381
pubflush:osdp_flush_fn_t,
382
+
#[doc = " Pointer to function used to release recv_pkt() data (optional)"]
383
+
pubrelease_pkt:osdp_release_pkt_fn_t,
369
384
#[doc = " Pointer to function used to close the channel (optional)"]
#[doc = " @brief To keep the OSDP internal data structures from polluting the exposed\n headers, they are typedefed to void before sending them to the upper layers.\n This level of abstraction looked reasonable as _technically_ no one should\n attempt to modify it outside of the LibOSDP and their definition may change\n at any time."]
#[doc = " @brief Queue linkage node; layout-compatible with node_t from list.h.\n Embedded as @c _node in osdp_cmd and osdp_event. Do not read or write this\n field — it is reserved for internal use by the library."]
["Size of osdp_event"][::core::mem::size_of::<osdp_event>() - 144usize];
975
-
["Alignment of osdp_event"][::core::mem::align_of::<osdp_event>() - 4usize];
976
-
["Offset of field: osdp_event::type_"][::core::mem::offset_of!(osdp_event, type_) - 0usize];
977
-
["Offset of field: osdp_event::flags"][::core::mem::offset_of!(osdp_event, flags) - 4usize];
1015
+
["Size of osdp_event"][::core::mem::size_of::<osdp_event>() - 160usize];
1016
+
["Alignment of osdp_event"][::core::mem::align_of::<osdp_event>() - 8usize];
1017
+
["Offset of field: osdp_event::_node"][::core::mem::offset_of!(osdp_event, _node) - 0usize];
1018
+
["Offset of field: osdp_event::type_"][::core::mem::offset_of!(osdp_event, type_) - 16usize];
1019
+
["Offset of field: osdp_event::flags"][::core::mem::offset_of!(osdp_event, flags) - 20usize];
978
1020
};
979
1021
#[doc = " @brief Callback for PD command notifications. After it has been registered\n with `osdp_pd_set_command_callback`, this method is invoked when the PD\n receives a command from the CP.\n\n @param arg pointer that will was passed to the arg param of\n `osdp_pd_set_command_callback`.\n @param cmd pointer to the received command.\n\n @retval 0 if LibOSDP must send a `osdp_ACK` response\n @retval -ve if LibOSDP must send a `osdp_NAK` response\n @retval +ve and modify the passed `struct osdp_cmd *cmd` if LibOSDP must\n send a specific response. This is useful for sending manufacturer specific\n reply `osdp_MFGREP`."]
#[doc = " @brief This method is used to setup a device in PD mode. Application must\n store the returned context pointer and pass it back to all OSDP functions\n intact.\n\n @param info Pointer to info struct populated by application.\n\n @retval OSDP Context on success\n @retval NULL on errors"]
#[doc = " @brief Adds more PD devices in the CP control list.\n\n @param num_pd Number of PDs connected to this CP. The `osdp_pd_info_t *` is\n treated as an array of length num_pd.\n @param info Pointer to info struct populated by application.\n\n @retval 0 on success\n @retval -1 on failure"]
1101
+
#[doc = " @brief Adds more PD devices in the CP control list.\n\n @param ctx OSDP context\n @param num_pd Number of PDs connected to this CP. The `osdp_pd_info_t *` is\n treated as an array of length num_pd.\n @param info Pointer to info struct populated by application.\n\n @retval 0 on success\n @retval -1 on failure"]
0 commit comments