Skip to main content

libosdp_sys/
bindings.rs

1/* automatically generated by rust-bindgen 0.72.1 */
2
3pub const _STDINT_H: u32 = 1;
4pub const _FEATURES_H: u32 = 1;
5pub const _DEFAULT_SOURCE: u32 = 1;
6pub const __GLIBC_USE_ISOC2Y: u32 = 0;
7pub const __GLIBC_USE_ISOC23: u32 = 0;
8pub const __USE_ISOC11: u32 = 1;
9pub const __USE_ISOC99: u32 = 1;
10pub const __USE_ISOC95: u32 = 1;
11pub const __USE_POSIX_IMPLICITLY: u32 = 1;
12pub const _POSIX_SOURCE: u32 = 1;
13pub const _POSIX_C_SOURCE: u32 = 200809;
14pub const __USE_POSIX: u32 = 1;
15pub const __USE_POSIX2: u32 = 1;
16pub const __USE_POSIX199309: u32 = 1;
17pub const __USE_POSIX199506: u32 = 1;
18pub const __USE_XOPEN2K: u32 = 1;
19pub const __USE_XOPEN2K8: u32 = 1;
20pub const _ATFILE_SOURCE: u32 = 1;
21pub const __WORDSIZE: u32 = 64;
22pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
23pub const __SYSCALL_WORDSIZE: u32 = 64;
24pub const __TIMESIZE: u32 = 64;
25pub const __USE_TIME_BITS64: u32 = 1;
26pub const __USE_MISC: u32 = 1;
27pub const __USE_ATFILE: u32 = 1;
28pub const __USE_FORTIFY_LEVEL: u32 = 0;
29pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
30pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
31pub const __GLIBC_USE_C23_STRTOL: u32 = 0;
32pub const _STDC_PREDEF_H: u32 = 1;
33pub const __STDC_IEC_559__: u32 = 1;
34pub const __STDC_IEC_60559_BFP__: u32 = 201404;
35pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
36pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404;
37pub const __STDC_ISO_10646__: u32 = 201706;
38pub const __GNU_LIBRARY__: u32 = 6;
39pub const __GLIBC__: u32 = 2;
40pub const __GLIBC_MINOR__: u32 = 41;
41pub const _SYS_CDEFS_H: u32 = 1;
42pub const __glibc_c99_flexarr_available: u32 = 1;
43pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0;
44pub const __HAVE_GENERIC_SELECTION: u32 = 1;
45pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
46pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
47pub const __GLIBC_USE_IEC_60559_BFP_EXT_C23: u32 = 0;
48pub const __GLIBC_USE_IEC_60559_EXT: u32 = 0;
49pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
50pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C23: u32 = 0;
51pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
52pub const _BITS_TYPES_H: u32 = 1;
53pub const _BITS_TYPESIZES_H: u32 = 1;
54pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
55pub const __INO_T_MATCHES_INO64_T: u32 = 1;
56pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
57pub const __STATFS_MATCHES_STATFS64: u32 = 1;
58pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1;
59pub const __FD_SETSIZE: u32 = 1024;
60pub const _BITS_TIME64_H: u32 = 1;
61pub const _BITS_WCHAR_H: u32 = 1;
62pub const _BITS_STDINT_INTN_H: u32 = 1;
63pub const _BITS_STDINT_UINTN_H: u32 = 1;
64pub const _BITS_STDINT_LEAST_H: u32 = 1;
65pub const INT8_MIN: i32 = -128;
66pub const INT16_MIN: i32 = -32768;
67pub const INT32_MIN: i32 = -2147483648;
68pub const INT8_MAX: u32 = 127;
69pub const INT16_MAX: u32 = 32767;
70pub const INT32_MAX: u32 = 2147483647;
71pub const UINT8_MAX: u32 = 255;
72pub const UINT16_MAX: u32 = 65535;
73pub const UINT32_MAX: u32 = 4294967295;
74pub const INT_LEAST8_MIN: i32 = -128;
75pub const INT_LEAST16_MIN: i32 = -32768;
76pub const INT_LEAST32_MIN: i32 = -2147483648;
77pub const INT_LEAST8_MAX: u32 = 127;
78pub const INT_LEAST16_MAX: u32 = 32767;
79pub const INT_LEAST32_MAX: u32 = 2147483647;
80pub const UINT_LEAST8_MAX: u32 = 255;
81pub const UINT_LEAST16_MAX: u32 = 65535;
82pub const UINT_LEAST32_MAX: u32 = 4294967295;
83pub const INT_FAST8_MIN: i32 = -128;
84pub const INT_FAST16_MIN: i64 = -9223372036854775808;
85pub const INT_FAST32_MIN: i64 = -9223372036854775808;
86pub const INT_FAST8_MAX: u32 = 127;
87pub const INT_FAST16_MAX: u64 = 9223372036854775807;
88pub const INT_FAST32_MAX: u64 = 9223372036854775807;
89pub const UINT_FAST8_MAX: u32 = 255;
90pub const UINT_FAST16_MAX: i32 = -1;
91pub const UINT_FAST32_MAX: i32 = -1;
92pub const INTPTR_MIN: i64 = -9223372036854775808;
93pub const INTPTR_MAX: u64 = 9223372036854775807;
94pub const UINTPTR_MAX: i32 = -1;
95pub const PTRDIFF_MIN: i64 = -9223372036854775808;
96pub const PTRDIFF_MAX: u64 = 9223372036854775807;
97pub const SIG_ATOMIC_MIN: i32 = -2147483648;
98pub const SIG_ATOMIC_MAX: u32 = 2147483647;
99pub const SIZE_MAX: i32 = -1;
100pub const WINT_MIN: u32 = 0;
101pub const WINT_MAX: u32 = 4294967295;
102pub const __bool_true_false_are_defined: u32 = 1;
103pub const true_: u32 = 1;
104pub const false_: u32 = 0;
105pub const OSDP_FLAG_ENFORCE_SECURE: u32 = 65536;
106pub const OSDP_FLAG_INSTALL_MODE: u32 = 131072;
107pub const OSDP_FLAG_IGN_UNSOLICITED: u32 = 262144;
108pub const OSDP_FLAG_ENABLE_NOTIFICATION: u32 = 524288;
109pub const OSDP_FLAG_CAPTURE_PACKETS: u32 = 1048576;
110pub const OSDP_FLAG_ALLOW_EMPTY_ENCRYPTED_DATA_BLOCK: u32 = 2097152;
111pub const OSDP_STATUS_REPORT_MAX_LEN: u32 = 64;
112pub const OSDP_CMD_TEXT_MAX_LEN: u32 = 32;
113pub const OSDP_CMD_KEYSET_KEY_MAX_LEN: u32 = 32;
114pub const OSDP_CMD_MFG_MAX_DATALEN: u32 = 64;
115pub const OSDP_CMD_FILE_TX_FLAG_CANCEL: u32 = 2147483648;
116pub const OSDP_CMD_FLAG_BROADCAST: u32 = 1;
117pub const OSDP_EVENT_CARDREAD_MAX_DATALEN: u32 = 64;
118pub const OSDP_EVENT_KEYPRESS_MAX_DATALEN: u32 = 64;
119pub const OSDP_EVENT_MFGREP_MAX_DATALEN: u32 = 128;
120pub type __u_char = ::core::ffi::c_uchar;
121pub type __u_short = ::core::ffi::c_ushort;
122pub type __u_int = ::core::ffi::c_uint;
123pub type __u_long = ::core::ffi::c_ulong;
124pub type __int8_t = ::core::ffi::c_schar;
125pub type __uint8_t = ::core::ffi::c_uchar;
126pub type __int16_t = ::core::ffi::c_short;
127pub type __uint16_t = ::core::ffi::c_ushort;
128pub type __int32_t = ::core::ffi::c_int;
129pub type __uint32_t = ::core::ffi::c_uint;
130pub type __int64_t = ::core::ffi::c_long;
131pub type __uint64_t = ::core::ffi::c_ulong;
132pub type __int_least8_t = __int8_t;
133pub type __uint_least8_t = __uint8_t;
134pub type __int_least16_t = __int16_t;
135pub type __uint_least16_t = __uint16_t;
136pub type __int_least32_t = __int32_t;
137pub type __uint_least32_t = __uint32_t;
138pub type __int_least64_t = __int64_t;
139pub type __uint_least64_t = __uint64_t;
140pub type __quad_t = ::core::ffi::c_long;
141pub type __u_quad_t = ::core::ffi::c_ulong;
142pub type __intmax_t = ::core::ffi::c_long;
143pub type __uintmax_t = ::core::ffi::c_ulong;
144pub type __dev_t = ::core::ffi::c_ulong;
145pub type __uid_t = ::core::ffi::c_uint;
146pub type __gid_t = ::core::ffi::c_uint;
147pub type __ino_t = ::core::ffi::c_ulong;
148pub type __ino64_t = ::core::ffi::c_ulong;
149pub type __mode_t = ::core::ffi::c_uint;
150pub type __nlink_t = ::core::ffi::c_ulong;
151pub type __off_t = ::core::ffi::c_long;
152pub type __off64_t = ::core::ffi::c_long;
153pub type __pid_t = ::core::ffi::c_int;
154#[repr(C)]
155#[derive(Debug, Copy, Clone)]
156pub struct __fsid_t {
157    pub __val: [::core::ffi::c_int; 2usize],
158}
159#[allow(clippy::unnecessary_operation, clippy::identity_op)]
160const _: () = {
161    ["Size of __fsid_t"][::core::mem::size_of::<__fsid_t>() - 8usize];
162    ["Alignment of __fsid_t"][::core::mem::align_of::<__fsid_t>() - 4usize];
163    ["Offset of field: __fsid_t::__val"][::core::mem::offset_of!(__fsid_t, __val) - 0usize];
164};
165pub type __clock_t = ::core::ffi::c_long;
166pub type __rlim_t = ::core::ffi::c_ulong;
167pub type __rlim64_t = ::core::ffi::c_ulong;
168pub type __id_t = ::core::ffi::c_uint;
169pub type __time_t = ::core::ffi::c_long;
170pub type __useconds_t = ::core::ffi::c_uint;
171pub type __suseconds_t = ::core::ffi::c_long;
172pub type __suseconds64_t = ::core::ffi::c_long;
173pub type __daddr_t = ::core::ffi::c_int;
174pub type __key_t = ::core::ffi::c_int;
175pub type __clockid_t = ::core::ffi::c_int;
176pub type __timer_t = *mut ::core::ffi::c_void;
177pub type __blksize_t = ::core::ffi::c_long;
178pub type __blkcnt_t = ::core::ffi::c_long;
179pub type __blkcnt64_t = ::core::ffi::c_long;
180pub type __fsblkcnt_t = ::core::ffi::c_ulong;
181pub type __fsblkcnt64_t = ::core::ffi::c_ulong;
182pub type __fsfilcnt_t = ::core::ffi::c_ulong;
183pub type __fsfilcnt64_t = ::core::ffi::c_ulong;
184pub type __fsword_t = ::core::ffi::c_long;
185pub type __ssize_t = ::core::ffi::c_long;
186pub type __syscall_slong_t = ::core::ffi::c_long;
187pub type __syscall_ulong_t = ::core::ffi::c_ulong;
188pub type __loff_t = __off64_t;
189pub type __caddr_t = *mut ::core::ffi::c_char;
190pub type __intptr_t = ::core::ffi::c_long;
191pub type __socklen_t = ::core::ffi::c_uint;
192pub type __sig_atomic_t = ::core::ffi::c_int;
193pub type int_least8_t = __int_least8_t;
194pub type int_least16_t = __int_least16_t;
195pub type int_least32_t = __int_least32_t;
196pub type int_least64_t = __int_least64_t;
197pub type uint_least8_t = __uint_least8_t;
198pub type uint_least16_t = __uint_least16_t;
199pub type uint_least32_t = __uint_least32_t;
200pub type uint_least64_t = __uint_least64_t;
201pub type int_fast8_t = ::core::ffi::c_schar;
202pub type int_fast16_t = ::core::ffi::c_long;
203pub type int_fast32_t = ::core::ffi::c_long;
204pub type int_fast64_t = ::core::ffi::c_long;
205pub type uint_fast8_t = ::core::ffi::c_uchar;
206pub type uint_fast16_t = ::core::ffi::c_ulong;
207pub type uint_fast32_t = ::core::ffi::c_ulong;
208pub type uint_fast64_t = ::core::ffi::c_ulong;
209pub type intmax_t = __intmax_t;
210pub type uintmax_t = __uintmax_t;
211#[doc = " Dummy."]
212pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_UNUSED: osdp_pd_cap_function_code_e = 0;
213#[doc = " This function indicates the ability to monitor the status of a switch\n using a two-wire electrical connection between the PD and the switch.\n The on/off position of the switch indicates the state of an external\n device.\n\n The PD may simply resolve all circuit states to an open/closed\n status, or it may implement supervision of the monitoring circuit. A\n supervised circuit is able to indicate circuit fault status in\n addition to open/closed status."]
214pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_CONTACT_STATUS_MONITORING:
215    osdp_pd_cap_function_code_e = 1;
216#[doc = " This function provides a switched output, typically in the form of a\n relay. The Output has two states: active or inactive. The Control\n Panel (CP) can directly set the Output's state, or, if the PD\n supports timed operations, the CP can specify a time period for the\n activation of the Output."]
217pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_OUTPUT_CONTROL: osdp_pd_cap_function_code_e = 2;
218#[doc = " This capability indicates the form of the card data is presented to\n the Control Panel."]
219pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_CARD_DATA_FORMAT: osdp_pd_cap_function_code_e = 3;
220#[doc = " This capability indicates the presence of and type of LEDs."]
221pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_READER_LED_CONTROL: osdp_pd_cap_function_code_e =
222    4;
223#[doc = " This capability indicates the presence of and type of an Audible\n Annunciator (buzzer or similar tone generator)"]
224pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_READER_AUDIBLE_OUTPUT:
225    osdp_pd_cap_function_code_e = 5;
226#[doc = " This capability indicates that the PD supports a text display\n emulating character-based display terminals."]
227pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_READER_TEXT_OUTPUT: osdp_pd_cap_function_code_e =
228    6;
229#[doc = " This capability indicates that the type of date and time awareness\n or time keeping ability of the PD."]
230pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_TIME_KEEPING: osdp_pd_cap_function_code_e = 7;
231#[doc = " All PDs must be able to support the checksum mode. This capability\n indicates if the PD is capable of supporting CRC mode."]
232pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_CHECK_CHARACTER_SUPPORT:
233    osdp_pd_cap_function_code_e = 8;
234#[doc = " This capability indicates the extent to which the PD supports\n communication security (Secure Channel Communication)"]
235pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_COMMUNICATION_SECURITY:
236    osdp_pd_cap_function_code_e = 9;
237#[doc = " This capability indicates the maximum size single message the PD can\n receive."]
238pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_RECEIVE_BUFFERSIZE: osdp_pd_cap_function_code_e =
239    10;
240#[doc = " This capability indicates the maximum size multi-part message which\n the PD can handle."]
241pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_LARGEST_COMBINED_MESSAGE_SIZE:
242    osdp_pd_cap_function_code_e = 11;
243#[doc = " This capability indicates whether the PD supports the transparent\n mode used for communicating directly with a smart card."]
244pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_SMART_CARD_SUPPORT: osdp_pd_cap_function_code_e =
245    12;
246#[doc = " This capability indicates the number of credential reader devices\n present. Compliance levels are bit fields to be assigned as needed."]
247pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_READERS: osdp_pd_cap_function_code_e = 13;
248#[doc = " This capability indicates the ability of the reader to handle\n biometric input"]
249pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_BIOMETRICS: osdp_pd_cap_function_code_e = 14;
250#[doc = " This capability indicates if the reader is capable of supporting\n Secure Pin Entry (SPE) for smart cards"]
251pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_SECURE_PIN_ENTRY: osdp_pd_cap_function_code_e =
252    15;
253#[doc = " This capability indicates the version of OSDP the PD supports\n\n Compliance Levels:\n   0 - Unspecified\n   1 - IEC 60839-11-5\n   2 - SIA OSDP 2.2"]
254pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_OSDP_VERSION: osdp_pd_cap_function_code_e = 16;
255#[doc = " Capability Sentinel"]
256pub const osdp_pd_cap_function_code_e_OSDP_PD_CAP_SENTINEL: osdp_pd_cap_function_code_e = 17;
257#[doc = " @brief Various PD capability function codes."]
258pub type osdp_pd_cap_function_code_e = ::core::ffi::c_uchar;
259#[doc = "< No error"]
260pub const osdp_pd_nak_code_e_OSDP_PD_NAK_NONE: osdp_pd_nak_code_e = 0;
261#[doc = "< Message check character(s) error (bad cksum/crc)"]
262pub const osdp_pd_nak_code_e_OSDP_PD_NAK_MSG_CHK: osdp_pd_nak_code_e = 1;
263#[doc = "< Command length error"]
264pub const osdp_pd_nak_code_e_OSDP_PD_NAK_CMD_LEN: osdp_pd_nak_code_e = 2;
265#[doc = "< Unknown Command Code – Command not implemented by PD"]
266pub const osdp_pd_nak_code_e_OSDP_PD_NAK_CMD_UNKNOWN: osdp_pd_nak_code_e = 3;
267#[doc = "< Sequence number error"]
268pub const osdp_pd_nak_code_e_OSDP_PD_NAK_SEQ_NUM: osdp_pd_nak_code_e = 4;
269#[doc = "< Secure Channel is not supported by PD"]
270pub const osdp_pd_nak_code_e_OSDP_PD_NAK_SC_UNSUP: osdp_pd_nak_code_e = 5;
271#[doc = "< unsupported security block or security conditions not met"]
272pub const osdp_pd_nak_code_e_OSDP_PD_NAK_SC_COND: osdp_pd_nak_code_e = 6;
273#[doc = "< BIO_TYPE not supported"]
274pub const osdp_pd_nak_code_e_OSDP_PD_NAK_BIO_TYPE: osdp_pd_nak_code_e = 7;
275#[doc = "< BIO_FORMAT not supported"]
276pub const osdp_pd_nak_code_e_OSDP_PD_NAK_BIO_FMT: osdp_pd_nak_code_e = 8;
277#[doc = "< Unable to process command record"]
278pub const osdp_pd_nak_code_e_OSDP_PD_NAK_RECORD: osdp_pd_nak_code_e = 9;
279#[doc = "< NAK codes max value"]
280pub const osdp_pd_nak_code_e_OSDP_PD_NAK_SENTINEL: osdp_pd_nak_code_e = 10;
281#[doc = " @brief OSDP specified NAK codes"]
282pub type osdp_pd_nak_code_e = ::core::ffi::c_uchar;
283#[doc = " @brief PD capability structure. Each PD capability has a 3 byte\n representation."]
284#[repr(C)]
285#[derive(Debug, Copy, Clone)]
286pub struct osdp_pd_cap {
287    #[doc = " Capability function code. See @ref osdp_pd_cap_function_code_e"]
288    pub function_code: u8,
289    #[doc = " A function_code dependent number that indicates what the PD can do\n with this capability."]
290    pub compliance_level: u8,
291    #[doc = " Number of such capability entities in PD"]
292    pub num_items: u8,
293}
294#[allow(clippy::unnecessary_operation, clippy::identity_op)]
295const _: () = {
296    ["Size of osdp_pd_cap"][::core::mem::size_of::<osdp_pd_cap>() - 3usize];
297    ["Alignment of osdp_pd_cap"][::core::mem::align_of::<osdp_pd_cap>() - 1usize];
298    ["Offset of field: osdp_pd_cap::function_code"]
299        [::core::mem::offset_of!(osdp_pd_cap, function_code) - 0usize];
300    ["Offset of field: osdp_pd_cap::compliance_level"]
301        [::core::mem::offset_of!(osdp_pd_cap, compliance_level) - 1usize];
302    ["Offset of field: osdp_pd_cap::num_items"]
303        [::core::mem::offset_of!(osdp_pd_cap, num_items) - 2usize];
304};
305#[doc = " @brief PD ID information advertised by the PD."]
306#[repr(C)]
307#[derive(Debug, Copy, Clone)]
308pub struct osdp_pd_id {
309    #[doc = "< 1-Byte Manufacturer's version number"]
310    pub version: ::core::ffi::c_int,
311    #[doc = "< 1-byte Manufacturer's model number"]
312    pub model: ::core::ffi::c_int,
313    #[doc = "< 3-bytes IEEE assigned OUI"]
314    pub vendor_code: u32,
315    #[doc = "< 4-byte serial number for the PD"]
316    pub serial_number: u32,
317    #[doc = "< 3-byte version (major, minor, build)"]
318    pub firmware_version: u32,
319}
320#[allow(clippy::unnecessary_operation, clippy::identity_op)]
321const _: () = {
322    ["Size of osdp_pd_id"][::core::mem::size_of::<osdp_pd_id>() - 20usize];
323    ["Alignment of osdp_pd_id"][::core::mem::align_of::<osdp_pd_id>() - 4usize];
324    ["Offset of field: osdp_pd_id::version"][::core::mem::offset_of!(osdp_pd_id, version) - 0usize];
325    ["Offset of field: osdp_pd_id::model"][::core::mem::offset_of!(osdp_pd_id, model) - 4usize];
326    ["Offset of field: osdp_pd_id::vendor_code"]
327        [::core::mem::offset_of!(osdp_pd_id, vendor_code) - 8usize];
328    ["Offset of field: osdp_pd_id::serial_number"]
329        [::core::mem::offset_of!(osdp_pd_id, serial_number) - 12usize];
330    ["Offset of field: osdp_pd_id::firmware_version"]
331        [::core::mem::offset_of!(osdp_pd_id, firmware_version) - 16usize];
332};
333#[doc = " @brief pointer to function that copies received bytes into buffer. 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 copy incoming data\n @param maxlen sizeof `buf`. Can copy utmost `maxlen` bytes into `buf`\n\n @retval +ve: number of bytes copied on to `buf`. Must be <= `len`\n @retval -ve on errors"]
334pub type osdp_read_fn_t = ::core::option::Option<
335    unsafe extern "C" fn(
336        data: *mut ::core::ffi::c_void,
337        buf: *mut u8,
338        maxlen: ::core::ffi::c_int,
339    ) -> ::core::ffi::c_int,
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"]
342pub type osdp_read_pkt_fn_t = ::core::option::Option<
343    unsafe extern "C" fn(
344        data: *mut ::core::ffi::c_void,
345        buf: *mut *const u8,
346        max_len: *mut ::core::ffi::c_int,
347    ) -> ::core::ffi::c_int,
348>;
349#[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."]
350pub type osdp_write_fn_t = ::core::option::Option<
351    unsafe extern "C" fn(
352        data: *mut ::core::ffi::c_void,
353        buf: *mut u8,
354        len: ::core::ffi::c_int,
355    ) -> ::core::ffi::c_int,
356>;
357#[doc = " @brief pointer to function that drops all bytes in TX/RX fifo. This\n function should be non-blocking.\n\n @param data for use by underlying layers. osdp_channel::data is passed"]
358pub type osdp_flush_fn_t =
359    ::core::option::Option<unsafe extern "C" fn(data: *mut ::core::ffi::c_void)>;
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"]
361pub type osdp_close_fn_t =
362    ::core::option::Option<unsafe extern "C" fn(data: *mut ::core::ffi::c_void)>;
363#[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()"]
364pub type osdp_release_pkt_fn_t =
365    ::core::option::Option<unsafe extern "C" fn(data: *mut ::core::ffi::c_void, buf: *const u8)>;
366#[doc = " @brief User defined communication channel abstraction for OSDP devices.\n The methods for read/write/flush are expected to be non-blocking."]
367#[repr(C)]
368#[derive(Debug, Copy, Clone)]
369pub struct osdp_channel {
370    #[doc = " pointer to a block of memory that will be passed to the\n send/receive/flush method. This is optional (can be set to NULL)"]
371    pub data: *mut ::core::ffi::c_void,
372    #[doc = " channel_id; On multi-drop networks, more than one PD can share the\n same channel (read/write/flush pointers). On such networks, the\n channel_id is used to lock a PD to a channel. On multi-drop\n networks, this `id` must non-zero and be unique for each bus."]
373    pub id: ::core::ffi::c_int,
374    #[doc = " Pointer to function used to receive osdp packet data"]
375    pub recv: osdp_read_fn_t,
376    #[doc = " Pointer to function used to receive a full packet buffer (optional)"]
377    pub recv_pkt: osdp_read_pkt_fn_t,
378    #[doc = " Pointer to function used to send osdp packet data"]
379    pub send: osdp_write_fn_t,
380    #[doc = " Pointer to function used to flush the channel (optional)"]
381    pub flush: osdp_flush_fn_t,
382    #[doc = " Pointer to function used to release recv_pkt() data (optional)"]
383    pub release_pkt: osdp_release_pkt_fn_t,
384    #[doc = " Pointer to function used to close the channel (optional)"]
385    pub close: osdp_close_fn_t,
386}
387#[allow(clippy::unnecessary_operation, clippy::identity_op)]
388const _: () = {
389    ["Size of osdp_channel"][::core::mem::size_of::<osdp_channel>() - 64usize];
390    ["Alignment of osdp_channel"][::core::mem::align_of::<osdp_channel>() - 8usize];
391    ["Offset of field: osdp_channel::data"][::core::mem::offset_of!(osdp_channel, data) - 0usize];
392    ["Offset of field: osdp_channel::id"][::core::mem::offset_of!(osdp_channel, id) - 8usize];
393    ["Offset of field: osdp_channel::recv"][::core::mem::offset_of!(osdp_channel, recv) - 16usize];
394    ["Offset of field: osdp_channel::recv_pkt"]
395        [::core::mem::offset_of!(osdp_channel, recv_pkt) - 24usize];
396    ["Offset of field: osdp_channel::send"][::core::mem::offset_of!(osdp_channel, send) - 32usize];
397    ["Offset of field: osdp_channel::flush"]
398        [::core::mem::offset_of!(osdp_channel, flush) - 40usize];
399    ["Offset of field: osdp_channel::release_pkt"]
400        [::core::mem::offset_of!(osdp_channel, release_pkt) - 48usize];
401    ["Offset of field: osdp_channel::close"]
402        [::core::mem::offset_of!(osdp_channel, close) - 56usize];
403};
404#[doc = " @brief OSDP PD Information. This struct is used to describe a PD to LibOSDP."]
405#[repr(C)]
406#[derive(Debug, Copy, Clone)]
407pub struct osdp_pd_info_t {
408    #[doc = " User provided name for this PD (log messages include this name)"]
409    pub name: *const ::core::ffi::c_char,
410    #[doc = " Can be one of 9600/19200/38400/57600/115200/230400"]
411    pub baud_rate: ::core::ffi::c_int,
412    #[doc = " 7 bit PD address. the rest of the bits are ignored. The special\n address 0x7F is used for broadcast. So there can be 2^7-1 devices on\n a multi-drop channel"]
413    pub address: ::core::ffi::c_int,
414    #[doc = " Used to modify the way the context is setup. See `OSDP_FLAG_*`\n macros."]
415    pub flags: ::core::ffi::c_int,
416    #[doc = " Static information that the PD reports to the CP when it received a\n `CMD_ID`. These information must be populated by a PD application."]
417    pub id: osdp_pd_id,
418    #[doc = " This is a pointer to an array of structures containing the PD'\n capabilities. Use { -1, 0, 0 } to terminate the array. This is used\n only PD mode of operation"]
419    pub cap: *const osdp_pd_cap,
420    #[doc = " Communication channel ops structure, containing send/recv function\n pointers"]
421    pub channel: osdp_channel,
422    #[doc = " Pointer to 16 bytes of Secure Channel Base Key for the PD. If\n non-null, this is used to set-up the secure channel."]
423    pub scbk: *const u8,
424}
425#[allow(clippy::unnecessary_operation, clippy::identity_op)]
426const _: () = {
427    ["Size of osdp_pd_info_t"][::core::mem::size_of::<osdp_pd_info_t>() - 120usize];
428    ["Alignment of osdp_pd_info_t"][::core::mem::align_of::<osdp_pd_info_t>() - 8usize];
429    ["Offset of field: osdp_pd_info_t::name"]
430        [::core::mem::offset_of!(osdp_pd_info_t, name) - 0usize];
431    ["Offset of field: osdp_pd_info_t::baud_rate"]
432        [::core::mem::offset_of!(osdp_pd_info_t, baud_rate) - 8usize];
433    ["Offset of field: osdp_pd_info_t::address"]
434        [::core::mem::offset_of!(osdp_pd_info_t, address) - 12usize];
435    ["Offset of field: osdp_pd_info_t::flags"]
436        [::core::mem::offset_of!(osdp_pd_info_t, flags) - 16usize];
437    ["Offset of field: osdp_pd_info_t::id"][::core::mem::offset_of!(osdp_pd_info_t, id) - 20usize];
438    ["Offset of field: osdp_pd_info_t::cap"]
439        [::core::mem::offset_of!(osdp_pd_info_t, cap) - 40usize];
440    ["Offset of field: osdp_pd_info_t::channel"]
441        [::core::mem::offset_of!(osdp_pd_info_t, channel) - 48usize];
442    ["Offset of field: osdp_pd_info_t::scbk"]
443        [::core::mem::offset_of!(osdp_pd_info_t, scbk) - 112usize];
444};
445#[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."]
446pub type osdp_t = ::core::ffi::c_void;
447#[doc = " @brief Status report of the inputs attached the PD"]
448pub const osdp_status_report_type_OSDP_STATUS_REPORT_INPUT: osdp_status_report_type = 0;
449#[doc = " @brief Status report of the output attached the PD"]
450pub const osdp_status_report_type_OSDP_STATUS_REPORT_OUTPUT: osdp_status_report_type = 1;
451#[doc = " @brief Local tamper and power status report\n\n Bit-0: tamper\n Bit-1: power"]
452pub const osdp_status_report_type_OSDP_STATUS_REPORT_LOCAL: osdp_status_report_type = 2;
453#[doc = " @brief Remote tamper and power status report\n\n Bit-0: tamper\n Bit-1: power"]
454pub const osdp_status_report_type_OSDP_STATUS_REPORT_REMOTE: osdp_status_report_type = 3;
455#[doc = " @brief OSDP Status report types"]
456pub type osdp_status_report_type = ::core::ffi::c_uchar;
457#[doc = " @brief Status report structure. Used by OSDP_CMD_STATUS and\n OSDP_EVENT_STATUS. In case of command, it is used to send a query to the PD\n while in the case of events, the PD responds back with this structure.\n\n This can is used by the PD to indicate various status change reports. Upto a\n maximum of 32 statuses can be reported using this API."]
458#[repr(C)]
459#[derive(Debug, Copy, Clone)]
460pub struct osdp_status_report {
461    #[doc = " The kind of event to report see `enum osdp_event_status_type_e`"]
462    pub type_: osdp_status_report_type,
463    #[doc = " Number of valid bits in `status`"]
464    pub nr_entries: ::core::ffi::c_int,
465    #[doc = " Status report"]
466    pub report: [u8; 64usize],
467}
468#[allow(clippy::unnecessary_operation, clippy::identity_op)]
469const _: () = {
470    ["Size of osdp_status_report"][::core::mem::size_of::<osdp_status_report>() - 72usize];
471    ["Alignment of osdp_status_report"][::core::mem::align_of::<osdp_status_report>() - 4usize];
472    ["Offset of field: osdp_status_report::type_"]
473        [::core::mem::offset_of!(osdp_status_report, type_) - 0usize];
474    ["Offset of field: osdp_status_report::nr_entries"]
475        [::core::mem::offset_of!(osdp_status_report, nr_entries) - 4usize];
476    ["Offset of field: osdp_status_report::report"]
477        [::core::mem::offset_of!(osdp_status_report, report) - 8usize];
478};
479#[doc = " @brief Command sent from CP to Control digital output of PD."]
480#[repr(C)]
481#[derive(Debug, Copy, Clone)]
482pub struct osdp_cmd_output {
483    #[doc = " 0 = First Output, 1 = Second Output, etc."]
484    pub output_no: u8,
485    #[doc = " One of the following:\n    0 - NOP – do not alter this output\n    1 - set the permanent state to OFF, abort timed operation (if any)\n    2 - set the permanent state to ON, abort timed operation (if any)\n    3 - set the permanent state to OFF, allow timed operation to complete\n    4 - set the permanent state to ON, allow timed operation to complete\n    5 - set the temporary state to ON, resume perm state on timeout\n    6 - set the temporary state to OFF, resume permanent state on timeout"]
486    pub control_code: u8,
487    #[doc = " Time in units of 100 ms"]
488    pub timer_count: u16,
489}
490#[allow(clippy::unnecessary_operation, clippy::identity_op)]
491const _: () = {
492    ["Size of osdp_cmd_output"][::core::mem::size_of::<osdp_cmd_output>() - 4usize];
493    ["Alignment of osdp_cmd_output"][::core::mem::align_of::<osdp_cmd_output>() - 2usize];
494    ["Offset of field: osdp_cmd_output::output_no"]
495        [::core::mem::offset_of!(osdp_cmd_output, output_no) - 0usize];
496    ["Offset of field: osdp_cmd_output::control_code"]
497        [::core::mem::offset_of!(osdp_cmd_output, control_code) - 1usize];
498    ["Offset of field: osdp_cmd_output::timer_count"]
499        [::core::mem::offset_of!(osdp_cmd_output, timer_count) - 2usize];
500};
501#[doc = "< No color"]
502pub const osdp_led_color_e_OSDP_LED_COLOR_NONE: osdp_led_color_e = 0;
503#[doc = "< Red"]
504pub const osdp_led_color_e_OSDP_LED_COLOR_RED: osdp_led_color_e = 1;
505#[doc = "< Green"]
506pub const osdp_led_color_e_OSDP_LED_COLOR_GREEN: osdp_led_color_e = 2;
507#[doc = "< Amber"]
508pub const osdp_led_color_e_OSDP_LED_COLOR_AMBER: osdp_led_color_e = 3;
509#[doc = "< Blue"]
510pub const osdp_led_color_e_OSDP_LED_COLOR_BLUE: osdp_led_color_e = 4;
511#[doc = "< Magenta"]
512pub const osdp_led_color_e_OSDP_LED_COLOR_MAGENTA: osdp_led_color_e = 5;
513#[doc = "< Cyan"]
514pub const osdp_led_color_e_OSDP_LED_COLOR_CYAN: osdp_led_color_e = 6;
515#[doc = "< White"]
516pub const osdp_led_color_e_OSDP_LED_COLOR_WHITE: osdp_led_color_e = 7;
517#[doc = "< Max value"]
518pub const osdp_led_color_e_OSDP_LED_COLOR_SENTINEL: osdp_led_color_e = 8;
519#[doc = " @brief LED Colors as specified in OSDP for the on_color/off_color\n parameters."]
520pub type osdp_led_color_e = ::core::ffi::c_uchar;
521#[doc = " @brief LED params sub-structure. Part of LED command. See @ref osdp_cmd_led."]
522#[repr(C)]
523#[derive(Debug, Copy, Clone)]
524pub struct osdp_cmd_led_params {
525    #[doc = " Control code.\n\n Temporary Control Code:\n - 0 - NOP - do not alter this LED's temporary settings.\n - 1 - Cancel any temporary operation and display this LED's\n       permanent state immediately.\n - 2 - Set the temporary state as given and start timer immediately.\n\n Permanent Control Code:\n - 0 - NOP - do not alter this LED's permanent settings.\n - 1 - Set the permanent state as given."]
526    pub control_code: u8,
527    #[doc = " The ON duration of the flash, in units of 100 ms."]
528    pub on_count: u8,
529    #[doc = " The OFF duration of the flash, in units of 100 ms."]
530    pub off_count: u8,
531    #[doc = " Color to set during the ON timer (see @ref osdp_led_color_e)."]
532    pub on_color: u8,
533    #[doc = " Color to set during the OFF timer (see @ref osdp_led_color_e)."]
534    pub off_color: u8,
535    #[doc = " Time in units of 100 ms (only for temporary mode)."]
536    pub timer_count: u16,
537}
538#[allow(clippy::unnecessary_operation, clippy::identity_op)]
539const _: () = {
540    ["Size of osdp_cmd_led_params"][::core::mem::size_of::<osdp_cmd_led_params>() - 8usize];
541    ["Alignment of osdp_cmd_led_params"][::core::mem::align_of::<osdp_cmd_led_params>() - 2usize];
542    ["Offset of field: osdp_cmd_led_params::control_code"]
543        [::core::mem::offset_of!(osdp_cmd_led_params, control_code) - 0usize];
544    ["Offset of field: osdp_cmd_led_params::on_count"]
545        [::core::mem::offset_of!(osdp_cmd_led_params, on_count) - 1usize];
546    ["Offset of field: osdp_cmd_led_params::off_count"]
547        [::core::mem::offset_of!(osdp_cmd_led_params, off_count) - 2usize];
548    ["Offset of field: osdp_cmd_led_params::on_color"]
549        [::core::mem::offset_of!(osdp_cmd_led_params, on_color) - 3usize];
550    ["Offset of field: osdp_cmd_led_params::off_color"]
551        [::core::mem::offset_of!(osdp_cmd_led_params, off_color) - 4usize];
552    ["Offset of field: osdp_cmd_led_params::timer_count"]
553        [::core::mem::offset_of!(osdp_cmd_led_params, timer_count) - 6usize];
554};
555#[doc = " @brief Sent from CP to PD to control the behaviour of it's on-board LEDs"]
556#[repr(C)]
557#[derive(Debug, Copy, Clone)]
558pub struct osdp_cmd_led {
559    #[doc = " Reader number. 0 = First Reader, 1 = Second Reader, etc."]
560    pub reader: u8,
561    #[doc = " LED number. 0 = first LED, 1 = second LED, etc."]
562    pub led_number: u8,
563    #[doc = " Ephemeral LED status descriptor."]
564    pub temporary: osdp_cmd_led_params,
565    #[doc = " Permanent LED status descriptor."]
566    pub permanent: osdp_cmd_led_params,
567}
568#[allow(clippy::unnecessary_operation, clippy::identity_op)]
569const _: () = {
570    ["Size of osdp_cmd_led"][::core::mem::size_of::<osdp_cmd_led>() - 18usize];
571    ["Alignment of osdp_cmd_led"][::core::mem::align_of::<osdp_cmd_led>() - 2usize];
572    ["Offset of field: osdp_cmd_led::reader"]
573        [::core::mem::offset_of!(osdp_cmd_led, reader) - 0usize];
574    ["Offset of field: osdp_cmd_led::led_number"]
575        [::core::mem::offset_of!(osdp_cmd_led, led_number) - 1usize];
576    ["Offset of field: osdp_cmd_led::temporary"]
577        [::core::mem::offset_of!(osdp_cmd_led, temporary) - 2usize];
578    ["Offset of field: osdp_cmd_led::permanent"]
579        [::core::mem::offset_of!(osdp_cmd_led, permanent) - 10usize];
580};
581#[doc = " @brief Sent from CP to control the behaviour of a buzzer in the PD."]
582#[repr(C)]
583#[derive(Debug, Copy, Clone)]
584pub struct osdp_cmd_buzzer {
585    #[doc = " Reader number. 0 = First Reader, 1 = Second Reader, etc."]
586    pub reader: u8,
587    #[doc = " Control code.\n - 0 - no tone\n - 1 - off\n - 2 - default tone\n - 3+ - TBD"]
588    pub control_code: u8,
589    #[doc = " The ON duration of the sound, in units of 100 ms."]
590    pub on_count: u8,
591    #[doc = " The OFF duration of the sound, in units of 100 ms."]
592    pub off_count: u8,
593    #[doc = " The number of times to repeat the ON/OFF cycle; 0: forever."]
594    pub rep_count: u8,
595}
596#[allow(clippy::unnecessary_operation, clippy::identity_op)]
597const _: () = {
598    ["Size of osdp_cmd_buzzer"][::core::mem::size_of::<osdp_cmd_buzzer>() - 5usize];
599    ["Alignment of osdp_cmd_buzzer"][::core::mem::align_of::<osdp_cmd_buzzer>() - 1usize];
600    ["Offset of field: osdp_cmd_buzzer::reader"]
601        [::core::mem::offset_of!(osdp_cmd_buzzer, reader) - 0usize];
602    ["Offset of field: osdp_cmd_buzzer::control_code"]
603        [::core::mem::offset_of!(osdp_cmd_buzzer, control_code) - 1usize];
604    ["Offset of field: osdp_cmd_buzzer::on_count"]
605        [::core::mem::offset_of!(osdp_cmd_buzzer, on_count) - 2usize];
606    ["Offset of field: osdp_cmd_buzzer::off_count"]
607        [::core::mem::offset_of!(osdp_cmd_buzzer, off_count) - 3usize];
608    ["Offset of field: osdp_cmd_buzzer::rep_count"]
609        [::core::mem::offset_of!(osdp_cmd_buzzer, rep_count) - 4usize];
610};
611#[doc = " @brief Command to manipulate any display units that the PD supports."]
612#[repr(C)]
613#[derive(Debug, Copy, Clone)]
614pub struct osdp_cmd_text {
615    #[doc = " Reader number. 0 = First Reader, 1 = Second Reader, etc."]
616    pub reader: u8,
617    #[doc = " Control code.\n - 1 - permanent text, no wrap\n - 2 - permanent text, with wrap\n - 3 - temp text, no wrap\n - 4 - temp text, with wrap"]
618    pub control_code: u8,
619    #[doc = " Duration to display temporary text, in seconds"]
620    pub temp_time: u8,
621    #[doc = " Row to display the first character (1-indexed)"]
622    pub offset_row: u8,
623    #[doc = " Column to display the first character (1-indexed)"]
624    pub offset_col: u8,
625    #[doc = " Number of characters in the string"]
626    pub length: u8,
627    #[doc = " The string to display"]
628    pub data: [u8; 32usize],
629}
630#[allow(clippy::unnecessary_operation, clippy::identity_op)]
631const _: () = {
632    ["Size of osdp_cmd_text"][::core::mem::size_of::<osdp_cmd_text>() - 38usize];
633    ["Alignment of osdp_cmd_text"][::core::mem::align_of::<osdp_cmd_text>() - 1usize];
634    ["Offset of field: osdp_cmd_text::reader"]
635        [::core::mem::offset_of!(osdp_cmd_text, reader) - 0usize];
636    ["Offset of field: osdp_cmd_text::control_code"]
637        [::core::mem::offset_of!(osdp_cmd_text, control_code) - 1usize];
638    ["Offset of field: osdp_cmd_text::temp_time"]
639        [::core::mem::offset_of!(osdp_cmd_text, temp_time) - 2usize];
640    ["Offset of field: osdp_cmd_text::offset_row"]
641        [::core::mem::offset_of!(osdp_cmd_text, offset_row) - 3usize];
642    ["Offset of field: osdp_cmd_text::offset_col"]
643        [::core::mem::offset_of!(osdp_cmd_text, offset_col) - 4usize];
644    ["Offset of field: osdp_cmd_text::length"]
645        [::core::mem::offset_of!(osdp_cmd_text, length) - 5usize];
646    ["Offset of field: osdp_cmd_text::data"][::core::mem::offset_of!(osdp_cmd_text, data) - 6usize];
647};
648#[doc = " @brief Sent in response to a COMSET command. Set communication parameters to\n PD. Must be stored in PD non-volatile memory."]
649#[repr(C)]
650#[derive(Debug, Copy, Clone)]
651pub struct osdp_cmd_comset {
652    #[doc = " Unit ID to which this PD will respond after the change takes effect."]
653    pub address: u8,
654    #[doc = " Baud rate.\n\n Valid values: 9600, 19200, 38400, 115200, 230400."]
655    pub baud_rate: u32,
656}
657#[allow(clippy::unnecessary_operation, clippy::identity_op)]
658const _: () = {
659    ["Size of osdp_cmd_comset"][::core::mem::size_of::<osdp_cmd_comset>() - 8usize];
660    ["Alignment of osdp_cmd_comset"][::core::mem::align_of::<osdp_cmd_comset>() - 4usize];
661    ["Offset of field: osdp_cmd_comset::address"]
662        [::core::mem::offset_of!(osdp_cmd_comset, address) - 0usize];
663    ["Offset of field: osdp_cmd_comset::baud_rate"]
664        [::core::mem::offset_of!(osdp_cmd_comset, baud_rate) - 4usize];
665};
666#[doc = " @brief This command transfers an encryption key from the CP to a PD."]
667#[repr(C)]
668#[derive(Debug, Copy, Clone)]
669pub struct osdp_cmd_keyset {
670    #[doc = " Type of keys:\n - 0x01 – Secure Channel Base Key"]
671    pub type_: u8,
672    #[doc = " Number of bytes of key data - (Key Length in bits + 7) / 8"]
673    pub length: u8,
674    #[doc = " Key data"]
675    pub data: [u8; 32usize],
676}
677#[allow(clippy::unnecessary_operation, clippy::identity_op)]
678const _: () = {
679    ["Size of osdp_cmd_keyset"][::core::mem::size_of::<osdp_cmd_keyset>() - 34usize];
680    ["Alignment of osdp_cmd_keyset"][::core::mem::align_of::<osdp_cmd_keyset>() - 1usize];
681    ["Offset of field: osdp_cmd_keyset::type_"]
682        [::core::mem::offset_of!(osdp_cmd_keyset, type_) - 0usize];
683    ["Offset of field: osdp_cmd_keyset::length"]
684        [::core::mem::offset_of!(osdp_cmd_keyset, length) - 1usize];
685    ["Offset of field: osdp_cmd_keyset::data"]
686        [::core::mem::offset_of!(osdp_cmd_keyset, data) - 2usize];
687};
688#[doc = " @brief Manufacturer Specific Commands"]
689#[repr(C)]
690#[derive(Debug, Copy, Clone)]
691pub struct osdp_cmd_mfg {
692    #[doc = " 3-byte IEEE assigned OUI. Most Significant 8-bits are unused"]
693    pub vendor_code: u32,
694    #[doc = " Command data"]
695    pub data: [u8; 64usize],
696    #[doc = " Length of the data (internal use)"]
697    pub length: u8,
698}
699#[allow(clippy::unnecessary_operation, clippy::identity_op)]
700const _: () = {
701    ["Size of osdp_cmd_mfg"][::core::mem::size_of::<osdp_cmd_mfg>() - 72usize];
702    ["Alignment of osdp_cmd_mfg"][::core::mem::align_of::<osdp_cmd_mfg>() - 4usize];
703    ["Offset of field: osdp_cmd_mfg::vendor_code"]
704        [::core::mem::offset_of!(osdp_cmd_mfg, vendor_code) - 0usize];
705    ["Offset of field: osdp_cmd_mfg::data"][::core::mem::offset_of!(osdp_cmd_mfg, data) - 4usize];
706    ["Offset of field: osdp_cmd_mfg::length"]
707        [::core::mem::offset_of!(osdp_cmd_mfg, length) - 68usize];
708};
709#[doc = " @brief File transfer start command"]
710#[repr(C)]
711#[derive(Debug, Copy, Clone)]
712pub struct osdp_cmd_file_tx {
713    #[doc = " Pre-agreed file ID between CP and PD"]
714    pub id: ::core::ffi::c_int,
715    #[doc = " Reserved and set to zero by OSDP spec.\n\n @note: The upper bits are used by libosdp internally (IOW, not sent\n over the OSDP bus). Currently the following flags are defined:\n\n - @ref OSDP_CMD_FILE_TX_FLAG_CANCEL"]
716    pub flags: u32,
717}
718#[allow(clippy::unnecessary_operation, clippy::identity_op)]
719const _: () = {
720    ["Size of osdp_cmd_file_tx"][::core::mem::size_of::<osdp_cmd_file_tx>() - 8usize];
721    ["Alignment of osdp_cmd_file_tx"][::core::mem::align_of::<osdp_cmd_file_tx>() - 4usize];
722    ["Offset of field: osdp_cmd_file_tx::id"]
723        [::core::mem::offset_of!(osdp_cmd_file_tx, id) - 0usize];
724    ["Offset of field: osdp_cmd_file_tx::flags"]
725        [::core::mem::offset_of!(osdp_cmd_file_tx, flags) - 4usize];
726};
727#[doc = "< Output control command"]
728pub const osdp_cmd_e_OSDP_CMD_OUTPUT: osdp_cmd_e = 1;
729#[doc = "< Reader LED control command"]
730pub const osdp_cmd_e_OSDP_CMD_LED: osdp_cmd_e = 2;
731#[doc = "< Reader buzzer control command"]
732pub const osdp_cmd_e_OSDP_CMD_BUZZER: osdp_cmd_e = 3;
733#[doc = "< Reader text output command"]
734pub const osdp_cmd_e_OSDP_CMD_TEXT: osdp_cmd_e = 4;
735#[doc = "< Encryption Key Set Command"]
736pub const osdp_cmd_e_OSDP_CMD_KEYSET: osdp_cmd_e = 5;
737#[doc = "< PD communication configuration command"]
738pub const osdp_cmd_e_OSDP_CMD_COMSET: osdp_cmd_e = 6;
739#[doc = "< Manufacturer specific command"]
740pub const osdp_cmd_e_OSDP_CMD_MFG: osdp_cmd_e = 7;
741#[doc = "< File transfer command"]
742pub const osdp_cmd_e_OSDP_CMD_FILE_TX: osdp_cmd_e = 8;
743#[doc = "< Status report command"]
744pub const osdp_cmd_e_OSDP_CMD_STATUS: osdp_cmd_e = 9;
745#[doc = "< Comset completed; Alias for OSDP_CMD_COMSET"]
746pub const osdp_cmd_e_OSDP_CMD_COMSET_DONE: osdp_cmd_e = 10;
747#[doc = "< Max command value"]
748pub const osdp_cmd_e_OSDP_CMD_SENTINEL: osdp_cmd_e = 11;
749#[doc = " @brief OSDP application exposed commands"]
750pub type osdp_cmd_e = ::core::ffi::c_uchar;
751#[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."]
752pub type osdp_queue_node_t = osdp_queue_node_s;
753#[repr(C)]
754#[derive(Debug, Copy, Clone)]
755pub struct osdp_queue_node_s {
756    pub next: *mut osdp_queue_node_t,
757    pub prev: *mut osdp_queue_node_t,
758}
759#[allow(clippy::unnecessary_operation, clippy::identity_op)]
760const _: () = {
761    ["Size of osdp_queue_node_s"][::core::mem::size_of::<osdp_queue_node_s>() - 16usize];
762    ["Alignment of osdp_queue_node_s"][::core::mem::align_of::<osdp_queue_node_s>() - 8usize];
763    ["Offset of field: osdp_queue_node_s::next"]
764        [::core::mem::offset_of!(osdp_queue_node_s, next) - 0usize];
765    ["Offset of field: osdp_queue_node_s::prev"]
766        [::core::mem::offset_of!(osdp_queue_node_s, prev) - 8usize];
767};
768#[doc = " @brief OSDP Command Structure. This is a wrapper for all individual OSDP\n commands."]
769#[repr(C)]
770#[derive(Copy, Clone)]
771pub struct osdp_cmd {
772    #[doc = "< Reserved: internal queue linkage"]
773    pub _node: osdp_queue_node_t,
774    #[doc = "< Command ID. Used to select specific commands in union"]
775    pub id: osdp_cmd_e,
776    #[doc = "< Flags; see OSDP_CMD_FLAG_* flags for possibilities"]
777    pub flags: u32,
778    pub __bindgen_anon_1: osdp_cmd__bindgen_ty_1,
779}
780#[doc = " Command"]
781#[repr(C)]
782#[derive(Copy, Clone)]
783pub union osdp_cmd__bindgen_ty_1 {
784    #[doc = "< LED command structure"]
785    pub led: osdp_cmd_led,
786    #[doc = "< Buzzer command structure"]
787    pub buzzer: osdp_cmd_buzzer,
788    #[doc = "< Text command structure"]
789    pub text: osdp_cmd_text,
790    #[doc = "< Output command structure"]
791    pub output: osdp_cmd_output,
792    #[doc = "< Comset command structure"]
793    pub comset: osdp_cmd_comset,
794    #[doc = "< Keyset command structure"]
795    pub keyset: osdp_cmd_keyset,
796    #[doc = "< Manufacturer specific command structure"]
797    pub mfg: osdp_cmd_mfg,
798    #[doc = "< File transfer command structure"]
799    pub file_tx: osdp_cmd_file_tx,
800    #[doc = "< Status report command structure"]
801    pub status: osdp_status_report,
802}
803#[allow(clippy::unnecessary_operation, clippy::identity_op)]
804const _: () = {
805    ["Size of osdp_cmd__bindgen_ty_1"][::core::mem::size_of::<osdp_cmd__bindgen_ty_1>() - 72usize];
806    ["Alignment of osdp_cmd__bindgen_ty_1"]
807        [::core::mem::align_of::<osdp_cmd__bindgen_ty_1>() - 4usize];
808    ["Offset of field: osdp_cmd__bindgen_ty_1::led"]
809        [::core::mem::offset_of!(osdp_cmd__bindgen_ty_1, led) - 0usize];
810    ["Offset of field: osdp_cmd__bindgen_ty_1::buzzer"]
811        [::core::mem::offset_of!(osdp_cmd__bindgen_ty_1, buzzer) - 0usize];
812    ["Offset of field: osdp_cmd__bindgen_ty_1::text"]
813        [::core::mem::offset_of!(osdp_cmd__bindgen_ty_1, text) - 0usize];
814    ["Offset of field: osdp_cmd__bindgen_ty_1::output"]
815        [::core::mem::offset_of!(osdp_cmd__bindgen_ty_1, output) - 0usize];
816    ["Offset of field: osdp_cmd__bindgen_ty_1::comset"]
817        [::core::mem::offset_of!(osdp_cmd__bindgen_ty_1, comset) - 0usize];
818    ["Offset of field: osdp_cmd__bindgen_ty_1::keyset"]
819        [::core::mem::offset_of!(osdp_cmd__bindgen_ty_1, keyset) - 0usize];
820    ["Offset of field: osdp_cmd__bindgen_ty_1::mfg"]
821        [::core::mem::offset_of!(osdp_cmd__bindgen_ty_1, mfg) - 0usize];
822    ["Offset of field: osdp_cmd__bindgen_ty_1::file_tx"]
823        [::core::mem::offset_of!(osdp_cmd__bindgen_ty_1, file_tx) - 0usize];
824    ["Offset of field: osdp_cmd__bindgen_ty_1::status"]
825        [::core::mem::offset_of!(osdp_cmd__bindgen_ty_1, status) - 0usize];
826};
827#[allow(clippy::unnecessary_operation, clippy::identity_op)]
828const _: () = {
829    ["Size of osdp_cmd"][::core::mem::size_of::<osdp_cmd>() - 96usize];
830    ["Alignment of osdp_cmd"][::core::mem::align_of::<osdp_cmd>() - 8usize];
831    ["Offset of field: osdp_cmd::_node"][::core::mem::offset_of!(osdp_cmd, _node) - 0usize];
832    ["Offset of field: osdp_cmd::id"][::core::mem::offset_of!(osdp_cmd, id) - 16usize];
833    ["Offset of field: osdp_cmd::flags"][::core::mem::offset_of!(osdp_cmd, flags) - 20usize];
834};
835#[doc = "< Unspecified card format"]
836pub const osdp_event_cardread_format_e_OSDP_CARD_FMT_RAW_UNSPECIFIED: osdp_event_cardread_format_e =
837    0;
838#[doc = "< Wiegand card format"]
839pub const osdp_event_cardread_format_e_OSDP_CARD_FMT_RAW_WIEGAND: osdp_event_cardread_format_e = 1;
840#[doc = "< ASCII card format (deprecated; don't use)"]
841pub const osdp_event_cardread_format_e_OSDP_CARD_FMT_ASCII: osdp_event_cardread_format_e = 2;
842#[doc = "< Max card format value"]
843pub const osdp_event_cardread_format_e_OSDP_CARD_FMT_SENTINEL: osdp_event_cardread_format_e = 3;
844#[doc = " @brief Various card formats that a PD can support. This is sent to CP\n when a PD must report a card read."]
845pub type osdp_event_cardread_format_e = ::core::ffi::c_uchar;
846#[doc = " @brief OSDP event cardread"]
847#[repr(C)]
848#[derive(Debug, Copy, Clone)]
849pub struct osdp_event_cardread {
850    #[doc = " Reader number. 0 = First Reader, 1 = Second Reader, etc."]
851    pub reader_no: ::core::ffi::c_int,
852    #[doc = " Format of the card being read."]
853    pub format: osdp_event_cardread_format_e,
854    #[doc = " Direction of data in @a data array.\n - 0 - Forward\n - 1 - Backward"]
855    pub direction: ::core::ffi::c_int,
856    #[doc = " Length of card data in bits"]
857    pub length: ::core::ffi::c_int,
858    #[doc = " Card data of @a length bytes or bits bits depending on @a format"]
859    pub data: [u8; 64usize],
860}
861#[allow(clippy::unnecessary_operation, clippy::identity_op)]
862const _: () = {
863    ["Size of osdp_event_cardread"][::core::mem::size_of::<osdp_event_cardread>() - 80usize];
864    ["Alignment of osdp_event_cardread"][::core::mem::align_of::<osdp_event_cardread>() - 4usize];
865    ["Offset of field: osdp_event_cardread::reader_no"]
866        [::core::mem::offset_of!(osdp_event_cardread, reader_no) - 0usize];
867    ["Offset of field: osdp_event_cardread::format"]
868        [::core::mem::offset_of!(osdp_event_cardread, format) - 4usize];
869    ["Offset of field: osdp_event_cardread::direction"]
870        [::core::mem::offset_of!(osdp_event_cardread, direction) - 8usize];
871    ["Offset of field: osdp_event_cardread::length"]
872        [::core::mem::offset_of!(osdp_event_cardread, length) - 12usize];
873    ["Offset of field: osdp_event_cardread::data"]
874        [::core::mem::offset_of!(osdp_event_cardread, data) - 16usize];
875};
876#[doc = " @brief OSDP Event Keypad"]
877#[repr(C)]
878#[derive(Debug, Copy, Clone)]
879pub struct osdp_event_keypress {
880    #[doc = " Reader number in context of sub-readers attached to current PD; this\n number indicates the number of that reader. This is not supported by\n LibOSDP."]
881    pub reader_no: ::core::ffi::c_int,
882    #[doc = " Length of keypress data in bytes"]
883    pub length: ::core::ffi::c_int,
884    #[doc = " Keypress data of @a length bytes"]
885    pub data: [u8; 64usize],
886}
887#[allow(clippy::unnecessary_operation, clippy::identity_op)]
888const _: () = {
889    ["Size of osdp_event_keypress"][::core::mem::size_of::<osdp_event_keypress>() - 72usize];
890    ["Alignment of osdp_event_keypress"][::core::mem::align_of::<osdp_event_keypress>() - 4usize];
891    ["Offset of field: osdp_event_keypress::reader_no"]
892        [::core::mem::offset_of!(osdp_event_keypress, reader_no) - 0usize];
893    ["Offset of field: osdp_event_keypress::length"]
894        [::core::mem::offset_of!(osdp_event_keypress, length) - 4usize];
895    ["Offset of field: osdp_event_keypress::data"]
896        [::core::mem::offset_of!(osdp_event_keypress, data) - 8usize];
897};
898#[doc = " @brief OSDP Event Manufacturer Specific Command\n\n @note OSDP spec v2.2 makes this structure fixed at 4 bytes (3-byte vendor\n code and 1-byte data). LibOSDP allows for some additional data to be passed\n in this command using the @a data and @a length fields while using the\n 1-byte data (as specified in the specification) as @a command. To be fully\n compliant with the specification, you can set @a length to 0."]
899#[repr(C)]
900#[derive(Debug, Copy, Clone)]
901pub struct osdp_event_mfgrep {
902    #[doc = " 3-bytes IEEE assigned OUI of manufacturer"]
903    pub vendor_code: u32,
904    #[doc = " Length of manufacturer data in bytes (optional)"]
905    pub length: u8,
906    #[doc = " Manufacturer data of `length` bytes (optional)"]
907    pub data: [u8; 128usize],
908}
909#[allow(clippy::unnecessary_operation, clippy::identity_op)]
910const _: () = {
911    ["Size of osdp_event_mfgrep"][::core::mem::size_of::<osdp_event_mfgrep>() - 136usize];
912    ["Alignment of osdp_event_mfgrep"][::core::mem::align_of::<osdp_event_mfgrep>() - 4usize];
913    ["Offset of field: osdp_event_mfgrep::vendor_code"]
914        [::core::mem::offset_of!(osdp_event_mfgrep, vendor_code) - 0usize];
915    ["Offset of field: osdp_event_mfgrep::length"]
916        [::core::mem::offset_of!(osdp_event_mfgrep, length) - 4usize];
917    ["Offset of field: osdp_event_mfgrep::data"]
918        [::core::mem::offset_of!(osdp_event_mfgrep, data) - 5usize];
919};
920#[doc = " Application command outcome report.\n\n arg0: The command ID\n arg1: outcome -- 0: success; -1: failure;"]
921pub const osdp_event_notification_type_OSDP_EVENT_NOTIFICATION_COMMAND:
922    osdp_event_notification_type = 0;
923#[doc = " Secure Channel state change\n\n arg0: status -- 0: inactive; 1: active\n arg1: scbk type -- 0: scbk; 1: scbk-d"]
924pub const osdp_event_notification_type_OSDP_EVENT_NOTIFICATION_SC_STATUS:
925    osdp_event_notification_type = 1;
926#[doc = " PD state change\n\n arg0: status -- 0: offline; 1: online"]
927pub const osdp_event_notification_type_OSDP_EVENT_NOTIFICATION_PD_STATUS:
928    osdp_event_notification_type = 2;
929#[doc = " @brief LibOSDP event notification type"]
930pub type osdp_event_notification_type = ::core::ffi::c_uchar;
931#[doc = " @brief LibOSDP event notification\n\n These are events generated by LibOSDP for the application to indicate various\n status such as external command outcomes, SC state change notifications, etc.\n The app can use these events to perform housekeeping activities as needed.\n\n Each notification event type can use the provided additional data members\n @a arg0, @a arg1, ... in custom ways. See @ref osdp_event_notification_type\n for documentation on how to use them."]
932#[repr(C)]
933#[derive(Debug, Copy, Clone)]
934pub struct osdp_event_notification {
935    #[doc = "< Notification type"]
936    pub type_: osdp_event_notification_type,
937    #[doc = "< Additional data member"]
938    pub arg0: ::core::ffi::c_int,
939    #[doc = "< Additional data member"]
940    pub arg1: ::core::ffi::c_int,
941}
942#[allow(clippy::unnecessary_operation, clippy::identity_op)]
943const _: () = {
944    ["Size of osdp_event_notification"]
945        [::core::mem::size_of::<osdp_event_notification>() - 12usize];
946    ["Alignment of osdp_event_notification"]
947        [::core::mem::align_of::<osdp_event_notification>() - 4usize];
948    ["Offset of field: osdp_event_notification::type_"]
949        [::core::mem::offset_of!(osdp_event_notification, type_) - 0usize];
950    ["Offset of field: osdp_event_notification::arg0"]
951        [::core::mem::offset_of!(osdp_event_notification, arg0) - 4usize];
952    ["Offset of field: osdp_event_notification::arg1"]
953        [::core::mem::offset_of!(osdp_event_notification, arg1) - 8usize];
954};
955#[doc = "< Card read event"]
956pub const osdp_event_type_OSDP_EVENT_CARDREAD: osdp_event_type = 1;
957#[doc = "< Keypad press event"]
958pub const osdp_event_type_OSDP_EVENT_KEYPRESS: osdp_event_type = 2;
959#[doc = "< Manufacturer specific reply event"]
960pub const osdp_event_type_OSDP_EVENT_MFGREP: osdp_event_type = 3;
961#[doc = "< Status event"]
962pub const osdp_event_type_OSDP_EVENT_STATUS: osdp_event_type = 4;
963#[doc = "< LibOSDP notification event"]
964pub const osdp_event_type_OSDP_EVENT_NOTIFICATION: osdp_event_type = 5;
965#[doc = "< Max event value"]
966pub const osdp_event_type_OSDP_EVENT_SENTINEL: osdp_event_type = 6;
967#[doc = " @brief OSDP PD Events"]
968pub type osdp_event_type = ::core::ffi::c_uchar;
969#[doc = " @brief OSDP Event structure."]
970#[repr(C)]
971#[derive(Copy, Clone)]
972pub struct osdp_event {
973    #[doc = "< Reserved: internal queue linkage"]
974    pub _node: osdp_queue_node_t,
975    #[doc = "< Event type. Used to select specific event in union"]
976    pub type_: osdp_event_type,
977    #[doc = "< Flags; reserved, set to zero"]
978    pub flags: u32,
979    pub __bindgen_anon_1: osdp_event__bindgen_ty_1,
980}
981#[doc = " Event"]
982#[repr(C)]
983#[derive(Copy, Clone)]
984pub union osdp_event__bindgen_ty_1 {
985    #[doc = "< Keypress event structure"]
986    pub keypress: osdp_event_keypress,
987    #[doc = "< Card read event structure"]
988    pub cardread: osdp_event_cardread,
989    #[doc = "< Manufacturer specific response event struture"]
990    pub mfgrep: osdp_event_mfgrep,
991    #[doc = "< Status report event structure"]
992    pub status: osdp_status_report,
993    #[doc = "< Notification event structure"]
994    pub notif: osdp_event_notification,
995}
996#[allow(clippy::unnecessary_operation, clippy::identity_op)]
997const _: () = {
998    ["Size of osdp_event__bindgen_ty_1"]
999        [::core::mem::size_of::<osdp_event__bindgen_ty_1>() - 136usize];
1000    ["Alignment of osdp_event__bindgen_ty_1"]
1001        [::core::mem::align_of::<osdp_event__bindgen_ty_1>() - 4usize];
1002    ["Offset of field: osdp_event__bindgen_ty_1::keypress"]
1003        [::core::mem::offset_of!(osdp_event__bindgen_ty_1, keypress) - 0usize];
1004    ["Offset of field: osdp_event__bindgen_ty_1::cardread"]
1005        [::core::mem::offset_of!(osdp_event__bindgen_ty_1, cardread) - 0usize];
1006    ["Offset of field: osdp_event__bindgen_ty_1::mfgrep"]
1007        [::core::mem::offset_of!(osdp_event__bindgen_ty_1, mfgrep) - 0usize];
1008    ["Offset of field: osdp_event__bindgen_ty_1::status"]
1009        [::core::mem::offset_of!(osdp_event__bindgen_ty_1, status) - 0usize];
1010    ["Offset of field: osdp_event__bindgen_ty_1::notif"]
1011        [::core::mem::offset_of!(osdp_event__bindgen_ty_1, notif) - 0usize];
1012};
1013#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1014const _: () = {
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];
1020};
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`."]
1022pub type pd_command_callback_t = ::core::option::Option<
1023    unsafe extern "C" fn(arg: *mut ::core::ffi::c_void, cmd: *mut osdp_cmd) -> ::core::ffi::c_int,
1024>;
1025#[doc = " @brief Callback for CP event notifications. After it has been registered\n with `osdp_cp_set_event_callback`, this method is invoked when the CP\n receives an event from the PD.\n\n @param arg Opaque pointer provided by the application during callback\n registration.\n @param pd PD offset (0-indexed) of this PD in `osdp_pd_info_t *` passed to\n osdp_cp_setup()\n @param ev pointer to osdp_event struct (filled by libosdp).\n\n @retval 0 on handling the event successfully.\n @retval -ve on errors."]
1026pub type cp_event_callback_t = ::core::option::Option<
1027    unsafe extern "C" fn(
1028        arg: *mut ::core::ffi::c_void,
1029        pd: ::core::ffi::c_int,
1030        ev: *mut osdp_event,
1031    ) -> ::core::ffi::c_int,
1032>;
1033#[doc = "< Successfully completed"]
1034pub const osdp_completion_status_OSDP_COMPLETION_OK: osdp_completion_status = 0;
1035#[doc = "< Transport/protocol failure"]
1036pub const osdp_completion_status_OSDP_COMPLETION_FAILED: osdp_completion_status = 1;
1037#[doc = "< Removed by flush API"]
1038pub const osdp_completion_status_OSDP_COMPLETION_FLUSHED: osdp_completion_status = 2;
1039#[doc = "< Removed during teardown"]
1040pub const osdp_completion_status_OSDP_COMPLETION_ABORTED: osdp_completion_status = 3;
1041#[doc = " @brief Terminal status of a submitted command/event object."]
1042pub type osdp_completion_status = ::core::ffi::c_uchar;
1043#[doc = " @brief Callback for CP command completion notifications."]
1044pub type cp_command_completion_callback_t = ::core::option::Option<
1045    unsafe extern "C" fn(
1046        arg: *mut ::core::ffi::c_void,
1047        pd: ::core::ffi::c_int,
1048        cmd: *const osdp_cmd,
1049        status: osdp_completion_status,
1050    ),
1051>;
1052#[doc = " @brief Callback for PD event completion notifications."]
1053pub type pd_event_completion_callback_t = ::core::option::Option<
1054    unsafe extern "C" fn(
1055        arg: *mut ::core::ffi::c_void,
1056        ev: *const osdp_event,
1057        status: osdp_completion_status,
1058    ),
1059>;
1060unsafe extern "C" {
1061    #[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"]
1062    pub fn osdp_pd_setup(info: *const osdp_pd_info_t) -> *mut osdp_t;
1063}
1064unsafe extern "C" {
1065    #[doc = " @brief Periodic refresh method. Must be called by the application at least\n once every 50ms to meet OSDP timing requirements.\n\n @param ctx OSDP context"]
1066    pub fn osdp_pd_refresh(ctx: *mut osdp_t);
1067}
1068unsafe extern "C" {
1069    #[doc = " @brief Cleanup all osdp resources. The context pointer is no longer valid\n after this call.\n\n @param ctx OSDP context"]
1070    pub fn osdp_pd_teardown(ctx: *mut osdp_t);
1071}
1072unsafe extern "C" {
1073    #[doc = " @brief Set PD's capabilities\n\n @param ctx OSDP context\n @param cap pointer to array of cap (`struct osdp_pd_cap`) terminated by a\n capability with cap->function_code set to 0."]
1074    pub fn osdp_pd_set_capabilities(ctx: *mut osdp_t, cap: *const osdp_pd_cap);
1075}
1076unsafe extern "C" {
1077    #[doc = " @brief Set callback method for PD command notification. This callback is\n invoked when the PD receives a command from the CP.\n\n @param ctx OSDP context\n @param cb The callback function's pointer\n @param arg A pointer that will be passed as the first argument of `cb`"]
1078    pub fn osdp_pd_set_command_callback(
1079        ctx: *mut osdp_t,
1080        cb: pd_command_callback_t,
1081        arg: *mut ::core::ffi::c_void,
1082    );
1083}
1084unsafe extern "C" {
1085    #[doc = " @brief API to notify PD events to CP. These events are sent to the CP as an\n alternate response to a POLL command.\n\n @param ctx OSDP context\n @param event pointer to event struct. Must be filled by application.\n\n @retval 0 on success\n @retval -1 on failure"]
1086    pub fn osdp_pd_notify_event(ctx: *mut osdp_t, event: *const osdp_event) -> ::core::ffi::c_int;
1087}
1088unsafe extern "C" {
1089    #[doc = " @brief Submit PD events to CP. These events are delivered to the CP as a\n response to a future POLL command. A successful return does not mean CP\n received it, it only means LibOSDP accepted this submission.\n\n @param ctx OSDP context\n @param event pointer to event struct. Must be filled by application.\n\n @retval 0 on success\n @retval -1 on failure"]
1090    pub fn osdp_pd_submit_event(ctx: *mut osdp_t, event: *const osdp_event) -> ::core::ffi::c_int;
1091}
1092unsafe extern "C" {
1093    #[doc = " @brief Deletes all events from the PD's event queue.\n\n @param ctx OSDP context\n @return int Count of events dequeued."]
1094    pub fn osdp_pd_flush_events(ctx: *mut osdp_t) -> ::core::ffi::c_int;
1095}
1096unsafe extern "C" {
1097    #[doc = " @brief This method is used to setup a device in CP mode. Application must\n store the returned context pointer and pass it back to all OSDP functions\n intact.\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 OSDP Context on success\n @retval NULL on errors"]
1098    pub fn osdp_cp_setup(num_pd: ::core::ffi::c_int, info: *const osdp_pd_info_t) -> *mut osdp_t;
1099}
1100unsafe extern "C" {
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"]
1102    pub fn osdp_cp_add_pd(
1103        ctx: *mut osdp_t,
1104        num_pd: ::core::ffi::c_int,
1105        info: *const osdp_pd_info_t,
1106    ) -> ::core::ffi::c_int;
1107}
1108unsafe extern "C" {
1109    #[doc = " @brief Periodic refresh method. Must be called by the application at least\n once every 50ms to meet OSDP timing requirements.\n\n @param ctx OSDP context"]
1110    pub fn osdp_cp_refresh(ctx: *mut osdp_t);
1111}
1112unsafe extern "C" {
1113    #[doc = " @brief Cleanup all osdp resources. The context pointer is no longer valid\n after this call.\n\n @param ctx OSDP context"]
1114    pub fn osdp_cp_teardown(ctx: *mut osdp_t);
1115}
1116unsafe extern "C" {
1117    #[doc = " @brief Generic command enqueue API.\n\n @param ctx OSDP context\n @param pd PD offset (0-indexed) of this PD in `osdp_pd_info_t *` passed to\n osdp_cp_setup()\n @param cmd command pointer. Must be filled by application.\n\n @retval 0 on success\n @retval -1 on failure\n\n @note This method only adds the command on to a particular PD's command\n queue. The command itself can fail due to various reasons."]
1118    pub fn osdp_cp_send_command(
1119        ctx: *mut osdp_t,
1120        pd: ::core::ffi::c_int,
1121        cmd: *const osdp_cmd,
1122    ) -> ::core::ffi::c_int;
1123}
1124unsafe extern "C" {
1125    #[doc = " @brief Submit CP commands to PD. These commands are queued to be sent to the\n PD at the next available opportunity. A successful return does not mean PD\n received it, it only means LibOSDP accepted this submission.\n\n @param ctx OSDP context\n @param pd PD offset (0-indexed) of this PD in `osdp_pd_info_t *` passed to\n osdp_cp_setup()\n @param cmd command pointer. Must be filled by application.\n\n @retval 0 on success\n @retval -1 on failure\n\n @note This method only adds the command on to a particular PD's command\n queue. The command itself can fail due to various reasons."]
1126    pub fn osdp_cp_submit_command(
1127        ctx: *mut osdp_t,
1128        pd: ::core::ffi::c_int,
1129        cmd: *const osdp_cmd,
1130    ) -> ::core::ffi::c_int;
1131}
1132unsafe extern "C" {
1133    #[doc = " @brief Deletes all commands queued for a give PD\n\n @param ctx OSDP context\n @param pd PD offset (0-indexed) of this PD in `osdp_pd_info_t *` passed to\n osdp_cp_setup()\n @return int Count of events dequeued"]
1134    pub fn osdp_cp_flush_commands(ctx: *mut osdp_t, pd: ::core::ffi::c_int) -> ::core::ffi::c_int;
1135}
1136unsafe extern "C" {
1137    #[doc = " @brief Get PD ID information as reported by the PD. Calling this method\n before the CP has had a the chance to get this information will return\n invalid/stale results.\n\n @param ctx OSDP context\n @param pd PD offset (0-indexed) of this PD in `osdp_pd_info_t *` passed to\n osdp_cp_setup()\n @param id A pointer to struct osdp_pd_id that will be filled with the\n PD ID information that the PD last returned.\n\n @retval 0 on success\n @retval -1 on failure"]
1138    pub fn osdp_cp_get_pd_id(
1139        ctx: *const osdp_t,
1140        pd: ::core::ffi::c_int,
1141        id: *mut osdp_pd_id,
1142    ) -> ::core::ffi::c_int;
1143}
1144unsafe extern "C" {
1145    #[doc = " @brief Get capability associated to a function_code that the PD reports in\n response to osdp_CAP(0x62) command. Calling this method before the CP has\n had a the chance to get this information will return invalid/stale results.\n\n @param ctx OSDP context\n @param pd PD offset (0-indexed) of this PD in `osdp_pd_info_t *` passed to\n osdp_cp_setup()\n @param cap in/out; struct osdp_pd_cap pointer with osdp_pd_cap::function_code\n set to the function code to get data for.\n\n @retval 0 on success\n @retval -1 on failure"]
1146    pub fn osdp_cp_get_capability(
1147        ctx: *const osdp_t,
1148        pd: ::core::ffi::c_int,
1149        cap: *mut osdp_pd_cap,
1150    ) -> ::core::ffi::c_int;
1151}
1152unsafe extern "C" {
1153    #[doc = " @brief Set callback method for CP event notification. This callback is\n invoked when the CP receives an event from the PD.\n\n @param ctx OSDP context\n @param cb The callback function's pointer\n @param arg A pointer that will be passed as the first argument of `cb`"]
1154    pub fn osdp_cp_set_event_callback(
1155        ctx: *mut osdp_t,
1156        cb: cp_event_callback_t,
1157        arg: *mut ::core::ffi::c_void,
1158    );
1159}
1160unsafe extern "C" {
1161    #[doc = " @brief Set or clear OSDP public flags\n\n @param ctx OSDP context\n @param pd PD offset (0-indexed) of this PD in `osdp_pd_info_t *` passed to\n osdp_cp_setup()\n @param flags One or more of the public flags (OSDP_FLAG_XXX) exported from\n osdp.h. Any other bits will cause this method to fail.\n @param do_set when true: set `flags` in ctx; when false: clear `flags` in ctx\n\n @retval 0 on success\n @retval -1 on failure\n\n @note It doesn't make sense to call some initialization time flags during\n runtime. This method is for dynamic flags that can be turned on/off at runtime."]
1162    pub fn osdp_cp_modify_flag(
1163        ctx: *mut osdp_t,
1164        pd: ::core::ffi::c_int,
1165        flags: u32,
1166        do_set: bool,
1167    ) -> ::core::ffi::c_int;
1168}
1169unsafe extern "C" {
1170    #[doc = " @brief Disable a PD managed by the CP. Disabled PDs are brought to a safe\n state and will not process commands or generate events.\n\n @param ctx OSDP context\n @param pd PD offset (0-indexed) of this PD in `osdp_pd_info_t *` passed to\n osdp_cp_setup()\n\n @retval 0 on success\n @retval -1 on failure"]
1171    pub fn osdp_cp_disable_pd(ctx: *mut osdp_t, pd: ::core::ffi::c_int) -> ::core::ffi::c_int;
1172}
1173unsafe extern "C" {
1174    #[doc = " @brief Enable a previously disabled PD. The PD will start up as it would\n during initial setup.\n\n @param ctx OSDP context\n @param pd PD offset (0-indexed) of this PD in `osdp_pd_info_t *` passed to\n osdp_cp_setup()\n\n @retval 0 on success\n @retval -1 on failure"]
1175    pub fn osdp_cp_enable_pd(ctx: *mut osdp_t, pd: ::core::ffi::c_int) -> ::core::ffi::c_int;
1176}
1177unsafe extern "C" {
1178    #[doc = " @brief Check if a PD is currently enabled.\n\n @param ctx OSDP context\n @param pd PD offset (0-indexed) of this PD in `osdp_pd_info_t *` passed to\n osdp_cp_setup()\n\n @retval true if PD is enabled\n @retval false if PD is disabled or on error"]
1179    pub fn osdp_cp_is_pd_enabled(ctx: *const osdp_t, pd: ::core::ffi::c_int) -> bool;
1180}
1181#[doc = "< Log level Emergency"]
1182pub const osdp_log_level_e_OSDP_LOG_EMERG: osdp_log_level_e = 0;
1183#[doc = "< Log level Alert"]
1184pub const osdp_log_level_e_OSDP_LOG_ALERT: osdp_log_level_e = 1;
1185#[doc = "< Log level Critical"]
1186pub const osdp_log_level_e_OSDP_LOG_CRIT: osdp_log_level_e = 2;
1187#[doc = "< Log level Error"]
1188pub const osdp_log_level_e_OSDP_LOG_ERROR: osdp_log_level_e = 3;
1189#[doc = "< Log level Warning"]
1190pub const osdp_log_level_e_OSDP_LOG_WARNING: osdp_log_level_e = 4;
1191#[doc = "< Log level Notice"]
1192pub const osdp_log_level_e_OSDP_LOG_NOTICE: osdp_log_level_e = 5;
1193#[doc = "< Log level Info"]
1194pub const osdp_log_level_e_OSDP_LOG_INFO: osdp_log_level_e = 6;
1195#[doc = "< Log level Debug"]
1196pub const osdp_log_level_e_OSDP_LOG_DEBUG: osdp_log_level_e = 7;
1197#[doc = "< Log level max value"]
1198pub const osdp_log_level_e_OSDP_LOG_MAX_LEVEL: osdp_log_level_e = 8;
1199#[doc = " @brief Different levels of log messages; based on importance of the message\n with LOG_EMERG being most critical to LOG_DEBUG being the least."]
1200pub type osdp_log_level_e = ::core::ffi::c_uchar;
1201#[doc = " @brief Puts a string to the logging medium\n\n @param msg a null-terminated char buffer.\n\n @retval 0 on success; -ve on errors"]
1202pub type osdp_log_puts_fn_t = ::core::option::Option<
1203    unsafe extern "C" fn(msg: *const ::core::ffi::c_char) -> ::core::ffi::c_int,
1204>;
1205#[doc = " @brief A callback function to be used with external loggers\n\n @param log_level A syslog style log level. See `enum osdp_log_level_e`\n @param file Relative path to file which produced the log message\n @param line Line number in `file` which produced the log message\n @param msg The log message"]
1206pub type osdp_log_callback_fn_t = ::core::option::Option<
1207    unsafe extern "C" fn(
1208        log_level: ::core::ffi::c_int,
1209        file: *const ::core::ffi::c_char,
1210        line: ::core::ffi::c_ulong,
1211        msg: *const ::core::ffi::c_char,
1212    ),
1213>;
1214unsafe extern "C" {
1215    #[doc = " @brief Configure OSDP Logging.\n\n @param name A soft name for this module; will appear in all the log lines.\n @param log_level OSDP log levels of type `enum osdp_log_level_e`. Default is\n LOG_INFO.\n @param puts_fn A puts() like function that will be invoked to write the log\n buffer. Can be handy if you want to log to file on a UART device without\n putchar redirection. See `osdp_log_puts_fn_t` definition to see the\n behavioral expectations. When this is set to NULL, LibOSDP will log to\n stderr.\n\n Note: This function has to be called before osdp_{cp,pd}_setup(). Otherwise\n       it will be ignored."]
1216    pub fn osdp_logger_init(
1217        name: *const ::core::ffi::c_char,
1218        log_level: ::core::ffi::c_int,
1219        puts_fn: osdp_log_puts_fn_t,
1220    );
1221}
1222unsafe extern "C" {
1223    #[doc = " @brief A callback function that gets called when LibOSDP wants to emit a log\n line. All messages (of all log levels) are passed on to this callback\n without any log formatting. This API is for users who may already have a\n logger configured in their application.\n\n @param cb The callback function. See `osdp_log_callback_fn_t` for more\n details.\n\n @note This function has to be called before osdp_{cp,pd}_setup(). Otherwise\n it will be ignored."]
1224    pub fn osdp_set_log_callback(cb: osdp_log_callback_fn_t);
1225}
1226unsafe extern "C" {
1227    #[doc = " @brief Get LibOSDP version as a `const char *`. Used in diagnostics.\n\n @retval version string"]
1228    pub fn osdp_get_version() -> *const ::core::ffi::c_char;
1229}
1230unsafe extern "C" {
1231    #[doc = " @brief Get LibOSDP source identifier as a `const char *`. This string has\n info about the source tree from which this version of LibOSDP was built.\n Used in diagnostics.\n\n @retval source identifier string"]
1232    pub fn osdp_get_source_info() -> *const ::core::ffi::c_char;
1233}
1234unsafe extern "C" {
1235    #[doc = " @brief Get a bit mask of number of PD that are online currently.\n\n @param ctx OSDP context\n @param bitmask pointer to an array of bytes. must be as large as\n (num_pds + 7 / 8)."]
1236    pub fn osdp_get_status_mask(ctx: *const osdp_t, bitmask: *mut u8);
1237}
1238unsafe extern "C" {
1239    #[doc = " @brief Get a bit mask of number of PD that are online and have an active\n secure channel currently.\n\n @param ctx OSDP context\n @param bitmask pointer to an array of bytes. must be as large as\n (num_pds + 7 / 8)."]
1240    pub fn osdp_get_sc_status_mask(ctx: *const osdp_t, bitmask: *mut u8);
1241}
1242#[doc = " @brief Open a pre-agreed file\n\n @param arg Opaque pointer that was provided in @ref osdp_file_ops when the\n ops struct was registered.\n @param file_id File ID of pre-agreed file between this CP and PD\n @param size Size of the file that was opened (to be populated by sender). In\n case of receiver, this value is just just input to indicate the incoming file\n size.\n\n @retval 0 on success\n @retval -1 on errors"]
1243pub type osdp_file_open_fn_t = ::core::option::Option<
1244    unsafe extern "C" fn(
1245        arg: *mut ::core::ffi::c_void,
1246        file_id: ::core::ffi::c_int,
1247        size: *mut ::core::ffi::c_int,
1248    ) -> ::core::ffi::c_int,
1249>;
1250#[doc = " @brief Read a chunk of file data into buffer\n\n @param arg Opaque pointer that was provided in @ref osdp_file_ops when the\n ops struct was registered.\n @param buf Buffer to store file data read\n @param size Number of bytes to read from file into buffer\n @param offset Number of bytes from the beginning of the file to\n start reading from.\n\n @retval Number of bytes read\n @retval 0 on EOF\n @retval -ve on errors.\n\n @note LibOSDP will guarantee that size and offset params are always\n positive and size is always greater than or equal to offset."]
1251pub type osdp_file_read_fn_t = ::core::option::Option<
1252    unsafe extern "C" fn(
1253        arg: *mut ::core::ffi::c_void,
1254        buf: *mut ::core::ffi::c_void,
1255        size: ::core::ffi::c_int,
1256        offset: ::core::ffi::c_int,
1257    ) -> ::core::ffi::c_int,
1258>;
1259#[doc = " @brief Write a chunk of file data from buffer to disk.\n\n @param arg Opaque pointer that was provided in @ref osdp_file_ops when the\n ops struct was registered.\n @param buf Buffer with file data to be stored to disk\n @param size Number of bytes to write to disk\n @param offset Number of bytes from the beginning of the file to\n start writing too.\n\n @retval Number of bytes written\n @retval 0 on EOF\n @retval -ve on errors.\n\n @note LibOSDP will guarantee that size and offset params are always\n positive and size is always greater than or equal to offset."]
1260pub type osdp_file_write_fn_t = ::core::option::Option<
1261    unsafe extern "C" fn(
1262        arg: *mut ::core::ffi::c_void,
1263        buf: *const ::core::ffi::c_void,
1264        size: ::core::ffi::c_int,
1265        offset: ::core::ffi::c_int,
1266    ) -> ::core::ffi::c_int,
1267>;
1268#[doc = " @brief Close file that corresponds to a given file descriptor\n\n @param arg Opaque pointer that was provided in @ref osdp_file_ops when the\n ops struct was registered.\n\n @retval 0 on success\n @retval -1 on errors."]
1269pub type osdp_file_close_fn_t = ::core::option::Option<
1270    unsafe extern "C" fn(arg: *mut ::core::ffi::c_void) -> ::core::ffi::c_int,
1271>;
1272#[doc = " @brief OSDP File operations struct that needs to be filled by the CP/PD\n application and registered with LibOSDP using osdp_file_register_ops()\n before a file transfer command can be initiated."]
1273#[repr(C)]
1274#[derive(Debug, Copy, Clone)]
1275pub struct osdp_file_ops {
1276    #[doc = " @brief A opaque pointer to private data that can be filled by the\n application which will be passed as the first argument for each of\n the below functions. Applications can keep their file context info\n such as the open file descriptors or any other private data here."]
1277    pub arg: *mut ::core::ffi::c_void,
1278    #[doc = "< open handler function"]
1279    pub open: osdp_file_open_fn_t,
1280    #[doc = "< read handler function"]
1281    pub read: osdp_file_read_fn_t,
1282    #[doc = "< write handler function"]
1283    pub write: osdp_file_write_fn_t,
1284    #[doc = "< close handler function"]
1285    pub close: osdp_file_close_fn_t,
1286}
1287#[allow(clippy::unnecessary_operation, clippy::identity_op)]
1288const _: () = {
1289    ["Size of osdp_file_ops"][::core::mem::size_of::<osdp_file_ops>() - 40usize];
1290    ["Alignment of osdp_file_ops"][::core::mem::align_of::<osdp_file_ops>() - 8usize];
1291    ["Offset of field: osdp_file_ops::arg"][::core::mem::offset_of!(osdp_file_ops, arg) - 0usize];
1292    ["Offset of field: osdp_file_ops::open"][::core::mem::offset_of!(osdp_file_ops, open) - 8usize];
1293    ["Offset of field: osdp_file_ops::read"]
1294        [::core::mem::offset_of!(osdp_file_ops, read) - 16usize];
1295    ["Offset of field: osdp_file_ops::write"]
1296        [::core::mem::offset_of!(osdp_file_ops, write) - 24usize];
1297    ["Offset of field: osdp_file_ops::close"]
1298        [::core::mem::offset_of!(osdp_file_ops, close) - 32usize];
1299};
1300unsafe extern "C" {
1301    #[doc = " @brief Register a global file operations struct with OSDP. Both CP and PD\n modes should have done so already before CP can sending a OSDP_CMD_FILE_TX.\n\n @param ctx OSDP context\n @param pd PD number in case of CP. This param is ignored in PD mode\n @param ops Populated file operations struct\n\n @retval 0 on success. -1 on errors."]
1302    pub fn osdp_file_register_ops(
1303        ctx: *mut osdp_t,
1304        pd: ::core::ffi::c_int,
1305        ops: *const osdp_file_ops,
1306    ) -> ::core::ffi::c_int;
1307}
1308unsafe extern "C" {
1309    #[doc = " @brief Query file transfer status if one is in progress. Calling this method\n when there is no file transfer progressing will return error.\n\n @param ctx OSDP context\n @param pd PD number in case of CP. This param is ignored in PD mode\n @param size Total size of the file (as obtained from file_ops->open())\n @param offset Offset into the file that has been sent/received (CP/PD)\n @retval 0 on success. -1 on errors."]
1310    pub fn osdp_get_file_tx_status(
1311        ctx: *const osdp_t,
1312        pd: ::core::ffi::c_int,
1313        size: *mut ::core::ffi::c_int,
1314        offset: *mut ::core::ffi::c_int,
1315    ) -> ::core::ffi::c_int;
1316}