Skip to main content

opendaq/generated/
device.rs

1// Generated by tools/generate_bindings.py -- do not edit by hand.
2
3// Mechanical output: lint findings here are the generator's business.
4#![allow(clippy::all, unused_imports, rustdoc::bare_urls)]
5
6use crate::error::{check, Error, Result};
7use crate::object::{BaseObject, Interface, Ref};
8use crate::sys;
9use crate::value::{Complex, Ratio, Value};
10use crate::generated::*;
11use std::ffi::c_char;
12
13/// @ingroup opendaq_server_capability
14/// @addtogroup opendaq_address_info Address info
15/// Wrapper over the openDAQ `daqAddressInfo` interface.
16#[repr(transparent)]
17#[derive(Clone, Debug)]
18pub struct AddressInfo(pub(crate) PropertyObject);
19
20impl std::ops::Deref for AddressInfo {
21    type Target = PropertyObject;
22    fn deref(&self) -> &PropertyObject { &self.0 }
23}
24impl crate::sealed::Sealed for AddressInfo {}
25unsafe impl Interface for AddressInfo {
26    const NAME: &'static str = "daqAddressInfo";
27    fn interface_id() -> Option<crate::IntfID> {
28        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
29        unsafe { (crate::sys::api().daqAddressInfo_getInterfaceId)(&mut id) };
30        Some(id)
31    }
32    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
33        Ref::from_owned(ptr).map(Self::__from_ref)
34    }
35    fn as_base_object(&self) -> &BaseObject { &self.0 }
36}
37impl AddressInfo {
38    #[doc(hidden)]
39    pub(crate) fn __from_ref(r: Ref) -> Self { AddressInfo(PropertyObject::__from_ref(r)) }
40}
41impl std::fmt::Display for AddressInfo {
42    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
43        std::fmt::Display::fmt(self.as_base_object(), f)
44    }
45}
46impl From<&AddressInfo> for Value {
47    fn from(value: &AddressInfo) -> Value { Value::Object(value.to_base_object()) }
48}
49impl From<AddressInfo> for Value {
50    fn from(value: AddressInfo) -> Value { Value::Object(value.to_base_object()) }
51}
52impl crate::value::FromDaqOwned for AddressInfo {
53    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
54        crate::value::cast_owned(ptr, op)
55    }
56}
57
58/// @ingroup opendaq_server_capability
59/// @addtogroup opendaq_address_info Address info
60/// Wrapper over the openDAQ `daqAddressInfoBuilder` interface.
61#[repr(transparent)]
62#[derive(Clone, Debug)]
63pub struct AddressInfoBuilder(pub(crate) BaseObject);
64
65impl std::ops::Deref for AddressInfoBuilder {
66    type Target = BaseObject;
67    fn deref(&self) -> &BaseObject { &self.0 }
68}
69impl crate::sealed::Sealed for AddressInfoBuilder {}
70unsafe impl Interface for AddressInfoBuilder {
71    const NAME: &'static str = "daqAddressInfoBuilder";
72    fn interface_id() -> Option<crate::IntfID> {
73        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
74        unsafe { (crate::sys::api().daqAddressInfoBuilder_getInterfaceId)(&mut id) };
75        Some(id)
76    }
77    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
78        Ref::from_owned(ptr).map(Self::__from_ref)
79    }
80    fn as_base_object(&self) -> &BaseObject { &self.0 }
81}
82impl AddressInfoBuilder {
83    #[doc(hidden)]
84    pub(crate) fn __from_ref(r: Ref) -> Self { AddressInfoBuilder(BaseObject(r)) }
85}
86impl std::fmt::Display for AddressInfoBuilder {
87    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
88        std::fmt::Display::fmt(self.as_base_object(), f)
89    }
90}
91impl From<&AddressInfoBuilder> for Value {
92    fn from(value: &AddressInfoBuilder) -> Value { Value::Object(value.to_base_object()) }
93}
94impl From<AddressInfoBuilder> for Value {
95    fn from(value: AddressInfoBuilder) -> Value { Value::Object(value.to_base_object()) }
96}
97impl crate::value::FromDaqOwned for AddressInfoBuilder {
98    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
99        crate::value::cast_owned(ptr, op)
100    }
101}
102
103/// Wrapper over the openDAQ `daqAddressInfoPrivate` interface.
104#[repr(transparent)]
105#[derive(Clone, Debug)]
106pub struct AddressInfoPrivate(pub(crate) BaseObject);
107
108impl std::ops::Deref for AddressInfoPrivate {
109    type Target = BaseObject;
110    fn deref(&self) -> &BaseObject { &self.0 }
111}
112impl crate::sealed::Sealed for AddressInfoPrivate {}
113unsafe impl Interface for AddressInfoPrivate {
114    const NAME: &'static str = "daqAddressInfoPrivate";
115    fn interface_id() -> Option<crate::IntfID> {
116        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
117        unsafe { (crate::sys::api().daqAddressInfoPrivate_getInterfaceId)(&mut id) };
118        Some(id)
119    }
120    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
121        Ref::from_owned(ptr).map(Self::__from_ref)
122    }
123    fn as_base_object(&self) -> &BaseObject { &self.0 }
124}
125impl AddressInfoPrivate {
126    #[doc(hidden)]
127    pub(crate) fn __from_ref(r: Ref) -> Self { AddressInfoPrivate(BaseObject(r)) }
128}
129impl std::fmt::Display for AddressInfoPrivate {
130    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
131        std::fmt::Display::fmt(self.as_base_object(), f)
132    }
133}
134impl From<&AddressInfoPrivate> for Value {
135    fn from(value: &AddressInfoPrivate) -> Value { Value::Object(value.to_base_object()) }
136}
137impl From<AddressInfoPrivate> for Value {
138    fn from(value: AddressInfoPrivate) -> Value { Value::Object(value.to_base_object()) }
139}
140impl crate::value::FromDaqOwned for AddressInfoPrivate {
141    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
142        crate::value::cast_owned(ptr, op)
143    }
144}
145
146/// @ingroup opendaq_server_capability
147/// @addtogroup opendaq_connected_client_info Connected client info
148/// Wrapper over the openDAQ `daqConnectedClientInfo` interface.
149#[repr(transparent)]
150#[derive(Clone, Debug)]
151pub struct ConnectedClientInfo(pub(crate) PropertyObject);
152
153impl std::ops::Deref for ConnectedClientInfo {
154    type Target = PropertyObject;
155    fn deref(&self) -> &PropertyObject { &self.0 }
156}
157impl crate::sealed::Sealed for ConnectedClientInfo {}
158unsafe impl Interface for ConnectedClientInfo {
159    const NAME: &'static str = "daqConnectedClientInfo";
160    fn interface_id() -> Option<crate::IntfID> {
161        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
162        unsafe { (crate::sys::api().daqConnectedClientInfo_getInterfaceId)(&mut id) };
163        Some(id)
164    }
165    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
166        Ref::from_owned(ptr).map(Self::__from_ref)
167    }
168    fn as_base_object(&self) -> &BaseObject { &self.0 }
169}
170impl ConnectedClientInfo {
171    #[doc(hidden)]
172    pub(crate) fn __from_ref(r: Ref) -> Self { ConnectedClientInfo(PropertyObject::__from_ref(r)) }
173}
174impl std::fmt::Display for ConnectedClientInfo {
175    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
176        std::fmt::Display::fmt(self.as_base_object(), f)
177    }
178}
179impl From<&ConnectedClientInfo> for Value {
180    fn from(value: &ConnectedClientInfo) -> Value { Value::Object(value.to_base_object()) }
181}
182impl From<ConnectedClientInfo> for Value {
183    fn from(value: ConnectedClientInfo) -> Value { Value::Object(value.to_base_object()) }
184}
185impl crate::value::FromDaqOwned for ConnectedClientInfo {
186    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
187        crate::value::cast_owned(ptr, op)
188    }
189}
190
191/// Provides access to private methods for managing the Device's connection statuses.
192/// Enables adding, removing, and updating statuses stored in the connection status container.
193/// Statuses are identified by unique connection strings and can be accessed via
194/// IComponentStatusContainer using name aliases. A configuration status, accessible via alias "ConfigurationStatus",
195/// is unique per container and cannot be removed if added.
196/// On the other hand, multiple streaming statuses are supported, one per each streaming source attached to the device.
197/// Aliases for these follow the pattern "StreamingStatus_n," with optional protocol-based prefixes (e.g.,
198/// "OpenDAQNativeStreamingStatus_1", "OpenDAQLTStreamingStatus_2", "StreamingStatus_3" etc.).
199/// "ConnectionStatusChanged" Core events are triggered whenever there is a change in the connection status of the openDAQ Device,
200/// including parameters such as status name alias, value, protocol type, connection string, and streaming
201/// object (nullptr for configuration statuses). Removing streaming statuses also triggers said Core event with
202/// "Removed" as the value and nullptr for the streaming object parameters.
203/// Wrapper over the openDAQ `daqConnectionStatusContainerPrivate` interface.
204#[repr(transparent)]
205#[derive(Clone, Debug)]
206pub struct ConnectionStatusContainerPrivate(pub(crate) BaseObject);
207
208impl std::ops::Deref for ConnectionStatusContainerPrivate {
209    type Target = BaseObject;
210    fn deref(&self) -> &BaseObject { &self.0 }
211}
212impl crate::sealed::Sealed for ConnectionStatusContainerPrivate {}
213unsafe impl Interface for ConnectionStatusContainerPrivate {
214    const NAME: &'static str = "daqConnectionStatusContainerPrivate";
215    fn interface_id() -> Option<crate::IntfID> {
216        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
217        unsafe { (crate::sys::api().daqConnectionStatusContainerPrivate_getInterfaceId)(&mut id) };
218        Some(id)
219    }
220    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
221        Ref::from_owned(ptr).map(Self::__from_ref)
222    }
223    fn as_base_object(&self) -> &BaseObject { &self.0 }
224}
225impl ConnectionStatusContainerPrivate {
226    #[doc(hidden)]
227    pub(crate) fn __from_ref(r: Ref) -> Self { ConnectionStatusContainerPrivate(BaseObject(r)) }
228}
229impl std::fmt::Display for ConnectionStatusContainerPrivate {
230    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
231        std::fmt::Display::fmt(self.as_base_object(), f)
232    }
233}
234impl From<&ConnectionStatusContainerPrivate> for Value {
235    fn from(value: &ConnectionStatusContainerPrivate) -> Value { Value::Object(value.to_base_object()) }
236}
237impl From<ConnectionStatusContainerPrivate> for Value {
238    fn from(value: ConnectionStatusContainerPrivate) -> Value { Value::Object(value.to_base_object()) }
239}
240impl crate::value::FromDaqOwned for ConnectionStatusContainerPrivate {
241    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
242        crate::value::cast_owned(ptr, op)
243    }
244}
245
246/// Represents an openDAQ device. The device contains a list of signals and physical channels. Some devices support adding function blocks, or connecting to devices. The list of available function blocks/devices can be obtained via the `getAvailable` functions, and added via the `add` functions.
247/// Devices can be split up into three different types, with each devices supporting one or more:
248/// 1. Physical devices
249/// Physical devices provide access to physical channels. They measure real-world data and send
250/// it via packets through output signals of channels. The list of channels can be obtained via
251/// `getChannels` as a flat list.
252/// 2. Client devices
253/// Client devices can connect to other devices via their supported connection protocol. openDAQ
254/// natively supports connecting to TMS devices via its openDAQ OpcUa Client Module. A list of available
255/// devices a client device can connect to can be obtained via `getAvailableDevices`. The
256/// `addDevice` is used to connect to/add a device.
257/// 3. Function block devices
258/// Function block devices provide a dictionary of available function block types that can be added to them
259/// and configured. The calculation of function blocks is done on the device itself. The dictionary
260/// of available function block types can be obtained via `getAvailableFunctionBlockTypes`. They
261/// can then be added via `addFunctionBlock`.
262/// All devices also provide access to their Device information, containing metadata such as the
263/// device's serial number, location... They can also be queried for their current domain values
264/// (time) through its device domain.
265/// As each device is a property object, a device has access to all Property object methods, allowing
266/// each device to expose a list of custom properties such as sample rate, scaling factor and many
267/// others. By default, openDAQ devices have the UserName and Location string Properties.
268/// Wrapper over the openDAQ `daqDevice` interface.
269#[repr(transparent)]
270#[derive(Clone, Debug)]
271pub struct Device(pub(crate) Folder);
272
273impl std::ops::Deref for Device {
274    type Target = Folder;
275    fn deref(&self) -> &Folder { &self.0 }
276}
277impl crate::sealed::Sealed for Device {}
278unsafe impl Interface for Device {
279    const NAME: &'static str = "daqDevice";
280    fn interface_id() -> Option<crate::IntfID> {
281        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
282        unsafe { (crate::sys::api().daqDevice_getInterfaceId)(&mut id) };
283        Some(id)
284    }
285    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
286        Ref::from_owned(ptr).map(Self::__from_ref)
287    }
288    fn as_base_object(&self) -> &BaseObject { &self.0 }
289}
290impl Device {
291    #[doc(hidden)]
292    pub(crate) fn __from_ref(r: Ref) -> Self { Device(Folder::__from_ref(r)) }
293}
294impl std::fmt::Display for Device {
295    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
296        std::fmt::Display::fmt(self.as_base_object(), f)
297    }
298}
299impl From<&Device> for Value {
300    fn from(value: &Device) -> Value { Value::Object(value.to_base_object()) }
301}
302impl From<Device> for Value {
303    fn from(value: Device) -> Value { Value::Object(value.to_base_object()) }
304}
305impl crate::value::FromDaqOwned for Device {
306    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
307        crate::value::cast_owned(ptr, op)
308    }
309}
310
311/// Contains information about the domain of the device.
312/// The device domain contains a general view into the device's domain data. While devices most often operate
313/// in the time domain, this interface allows for description of any other domain commonly used in signal processing.
314/// For example, common domains include the angle domain, frequency domain, the spatial domain, and the wavelet domain.
315/// The device domain allows for users to query a device for its current domain value via `getTicksSinceOrigin`
316/// and convert that into its domain unit by multiplying the tick count with the resolution. To get the absolute
317/// domain value, we can then also add the value to the Origin, which is most often provided
318/// as a time epoch in the ISO 8601 format.
319/// Note that all devices might note provide a device domain implementation. Such devices cannot be directly queried
320/// for their domain data. In such a case, the domain data can be obtained through the device's output signals.
321/// Wrapper over the openDAQ `daqDeviceDomain` interface.
322#[repr(transparent)]
323#[derive(Clone, Debug)]
324pub struct DeviceDomain(pub(crate) BaseObject);
325
326impl std::ops::Deref for DeviceDomain {
327    type Target = BaseObject;
328    fn deref(&self) -> &BaseObject { &self.0 }
329}
330impl crate::sealed::Sealed for DeviceDomain {}
331unsafe impl Interface for DeviceDomain {
332    const NAME: &'static str = "daqDeviceDomain";
333    fn interface_id() -> Option<crate::IntfID> {
334        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
335        unsafe { (crate::sys::api().daqDeviceDomain_getInterfaceId)(&mut id) };
336        Some(id)
337    }
338    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
339        Ref::from_owned(ptr).map(Self::__from_ref)
340    }
341    fn as_base_object(&self) -> &BaseObject { &self.0 }
342}
343impl DeviceDomain {
344    #[doc(hidden)]
345    pub(crate) fn __from_ref(r: Ref) -> Self { DeviceDomain(BaseObject(r)) }
346}
347impl std::fmt::Display for DeviceDomain {
348    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
349        std::fmt::Display::fmt(self.as_base_object(), f)
350    }
351}
352impl From<&DeviceDomain> for Value {
353    fn from(value: &DeviceDomain) -> Value { Value::Object(value.to_base_object()) }
354}
355impl From<DeviceDomain> for Value {
356    fn from(value: DeviceDomain) -> Value { Value::Object(value.to_base_object()) }
357}
358impl crate::value::FromDaqOwned for DeviceDomain {
359    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
360        crate::value::cast_owned(ptr, op)
361    }
362}
363
364/// Contains standard information about an openDAQ device and device type. The Device Info object is a Property Object, allowing for custom String, Int, Bool, or Float-type properties to be added.
365/// The getter methods represent a standardized set of Device properties according to the
366/// OPC UA: Devices standard. Any additional String, Int, Bool, or Float-type properties can be added, using the
367/// appropriate Property Object "add property" method. Any other types of properties are invalid.
368/// Although Integer-type properties are valid additions, Selection properties cannot be added to
369/// Device Info.
370/// As the Device Info object adheres to the OPC UA: Devices standard, it behaves differently than
371/// standard Property Objects. No metadata except the Value Type and Default Value are published
372/// via OPC UA, and this only said Property metadata is visible to any clients.
373/// All fields - default (e.g. platform, manufacturer...) and custom are represented as either:
374/// - String-type properties
375/// - Integer-type properties
376/// - Bool-type properties
377/// - Float type properties
378/// As such, listing all properties via Property Object methods, will return both the
379/// names of the default and custom properties. All default properties are initialized to an empty
380/// string except for RevisionCounter and Position that are integer properties and are
381/// thus initialized to '0'. The names of the properties are written in camelCase - for
382/// example "systemUuid", "parentMacAddress", "manufacturerUri".
383/// If the DeviceInfo object is obtained from a device, or when listing available devices, the
384/// object is frozen (immutable). As such, Property Object setter methods cannot be used
385/// and will fail when called.
386/// Wrapper over the openDAQ `daqDeviceInfo` interface.
387#[repr(transparent)]
388#[derive(Clone, Debug)]
389pub struct DeviceInfo(pub(crate) PropertyObject);
390
391impl std::ops::Deref for DeviceInfo {
392    type Target = PropertyObject;
393    fn deref(&self) -> &PropertyObject { &self.0 }
394}
395impl crate::sealed::Sealed for DeviceInfo {}
396unsafe impl Interface for DeviceInfo {
397    const NAME: &'static str = "daqDeviceInfo";
398    fn interface_id() -> Option<crate::IntfID> {
399        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
400        unsafe { (crate::sys::api().daqDeviceInfo_getInterfaceId)(&mut id) };
401        Some(id)
402    }
403    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
404        Ref::from_owned(ptr).map(Self::__from_ref)
405    }
406    fn as_base_object(&self) -> &BaseObject { &self.0 }
407}
408impl DeviceInfo {
409    #[doc(hidden)]
410    pub(crate) fn __from_ref(r: Ref) -> Self { DeviceInfo(PropertyObject::__from_ref(r)) }
411}
412impl std::fmt::Display for DeviceInfo {
413    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
414        std::fmt::Display::fmt(self.as_base_object(), f)
415    }
416}
417impl From<&DeviceInfo> for Value {
418    fn from(value: &DeviceInfo) -> Value { Value::Object(value.to_base_object()) }
419}
420impl From<DeviceInfo> for Value {
421    fn from(value: DeviceInfo) -> Value { Value::Object(value.to_base_object()) }
422}
423impl crate::value::FromDaqOwned for DeviceInfo {
424    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
425        crate::value::cast_owned(ptr, op)
426    }
427}
428
429/// Configuration component of Device info objects. Contains setter methods that are available until the object is frozen.
430/// Device info config contains functions that allow for the configuration of Device info objects.
431/// The implementation of `config` also implements the `freeze` function that freezes the object making it
432/// immutable. Once frozen, the setter methods fail as the object can no longer be modified.
433/// Wrapper over the openDAQ `daqDeviceInfoConfig` interface.
434#[repr(transparent)]
435#[derive(Clone, Debug)]
436pub struct DeviceInfoConfig(pub(crate) DeviceInfo);
437
438impl std::ops::Deref for DeviceInfoConfig {
439    type Target = DeviceInfo;
440    fn deref(&self) -> &DeviceInfo { &self.0 }
441}
442impl crate::sealed::Sealed for DeviceInfoConfig {}
443unsafe impl Interface for DeviceInfoConfig {
444    const NAME: &'static str = "daqDeviceInfoConfig";
445    fn interface_id() -> Option<crate::IntfID> {
446        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
447        unsafe { (crate::sys::api().daqDeviceInfoConfig_getInterfaceId)(&mut id) };
448        Some(id)
449    }
450    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
451        Ref::from_owned(ptr).map(Self::__from_ref)
452    }
453    fn as_base_object(&self) -> &BaseObject { &self.0 }
454}
455impl DeviceInfoConfig {
456    #[doc(hidden)]
457    pub(crate) fn __from_ref(r: Ref) -> Self { DeviceInfoConfig(DeviceInfo::__from_ref(r)) }
458}
459impl std::fmt::Display for DeviceInfoConfig {
460    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
461        std::fmt::Display::fmt(self.as_base_object(), f)
462    }
463}
464impl From<&DeviceInfoConfig> for Value {
465    fn from(value: &DeviceInfoConfig) -> Value { Value::Object(value.to_base_object()) }
466}
467impl From<DeviceInfoConfig> for Value {
468    fn from(value: DeviceInfoConfig) -> Value { Value::Object(value.to_base_object()) }
469}
470impl crate::value::FromDaqOwned for DeviceInfoConfig {
471    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
472        crate::value::cast_owned(ptr, op)
473    }
474}
475
476/// @ingroup opendaq_devices
477/// @addtogroup opendaq_device_info Device info internal
478/// Wrapper over the openDAQ `daqDeviceInfoInternal` interface.
479#[repr(transparent)]
480#[derive(Clone, Debug)]
481pub struct DeviceInfoInternal(pub(crate) BaseObject);
482
483impl std::ops::Deref for DeviceInfoInternal {
484    type Target = BaseObject;
485    fn deref(&self) -> &BaseObject { &self.0 }
486}
487impl crate::sealed::Sealed for DeviceInfoInternal {}
488unsafe impl Interface for DeviceInfoInternal {
489    const NAME: &'static str = "daqDeviceInfoInternal";
490    fn interface_id() -> Option<crate::IntfID> {
491        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
492        unsafe { (crate::sys::api().daqDeviceInfoInternal_getInterfaceId)(&mut id) };
493        Some(id)
494    }
495    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
496        Ref::from_owned(ptr).map(Self::__from_ref)
497    }
498    fn as_base_object(&self) -> &BaseObject { &self.0 }
499}
500impl DeviceInfoInternal {
501    #[doc(hidden)]
502    pub(crate) fn __from_ref(r: Ref) -> Self { DeviceInfoInternal(BaseObject(r)) }
503}
504impl std::fmt::Display for DeviceInfoInternal {
505    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
506        std::fmt::Display::fmt(self.as_base_object(), f)
507    }
508}
509impl From<&DeviceInfoInternal> for Value {
510    fn from(value: &DeviceInfoInternal) -> Value { Value::Object(value.to_base_object()) }
511}
512impl From<DeviceInfoInternal> for Value {
513    fn from(value: DeviceInfoInternal) -> Value { Value::Object(value.to_base_object()) }
514}
515impl crate::value::FromDaqOwned for DeviceInfoInternal {
516    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
517        crate::value::cast_owned(ptr, op)
518    }
519}
520
521/// Interface for managing device network configuration information and settings.
522/// The interface is typically used by the discovery server, if present, to obtain the necessary
523/// information for advertising the device's network configuration capabilities and handling related requests.
524/// The device must be designated as the root device to enable the use of this interface's methods.
525/// Wrapper over the openDAQ `daqDeviceNetworkConfig` interface.
526#[repr(transparent)]
527#[derive(Clone, Debug)]
528pub struct DeviceNetworkConfig(pub(crate) BaseObject);
529
530impl std::ops::Deref for DeviceNetworkConfig {
531    type Target = BaseObject;
532    fn deref(&self) -> &BaseObject { &self.0 }
533}
534impl crate::sealed::Sealed for DeviceNetworkConfig {}
535unsafe impl Interface for DeviceNetworkConfig {
536    const NAME: &'static str = "daqDeviceNetworkConfig";
537    fn interface_id() -> Option<crate::IntfID> {
538        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
539        unsafe { (crate::sys::api().daqDeviceNetworkConfig_getInterfaceId)(&mut id) };
540        Some(id)
541    }
542    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
543        Ref::from_owned(ptr).map(Self::__from_ref)
544    }
545    fn as_base_object(&self) -> &BaseObject { &self.0 }
546}
547impl DeviceNetworkConfig {
548    #[doc(hidden)]
549    pub(crate) fn __from_ref(r: Ref) -> Self { DeviceNetworkConfig(BaseObject(r)) }
550}
551impl std::fmt::Display for DeviceNetworkConfig {
552    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
553        std::fmt::Display::fmt(self.as_base_object(), f)
554    }
555}
556impl From<&DeviceNetworkConfig> for Value {
557    fn from(value: &DeviceNetworkConfig) -> Value { Value::Object(value.to_base_object()) }
558}
559impl From<DeviceNetworkConfig> for Value {
560    fn from(value: DeviceNetworkConfig) -> Value { Value::Object(value.to_base_object()) }
561}
562impl crate::value::FromDaqOwned for DeviceNetworkConfig {
563    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
564        crate::value::cast_owned(ptr, op)
565    }
566}
567
568/// @ingroup opendaq_devices
569/// @addtogroup opendaq_device Device private
570/// Wrapper over the openDAQ `daqDevicePrivate` interface.
571#[repr(transparent)]
572#[derive(Clone, Debug)]
573pub struct DevicePrivate(pub(crate) BaseObject);
574
575impl std::ops::Deref for DevicePrivate {
576    type Target = BaseObject;
577    fn deref(&self) -> &BaseObject { &self.0 }
578}
579impl crate::sealed::Sealed for DevicePrivate {}
580unsafe impl Interface for DevicePrivate {
581    const NAME: &'static str = "daqDevicePrivate";
582    fn interface_id() -> Option<crate::IntfID> {
583        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
584        unsafe { (crate::sys::api().daqDevicePrivate_getInterfaceId)(&mut id) };
585        Some(id)
586    }
587    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
588        Ref::from_owned(ptr).map(Self::__from_ref)
589    }
590    fn as_base_object(&self) -> &BaseObject { &self.0 }
591}
592impl DevicePrivate {
593    #[doc(hidden)]
594    pub(crate) fn __from_ref(r: Ref) -> Self { DevicePrivate(BaseObject(r)) }
595}
596impl std::fmt::Display for DevicePrivate {
597    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
598        std::fmt::Display::fmt(self.as_base_object(), f)
599    }
600}
601impl From<&DevicePrivate> for Value {
602    fn from(value: &DevicePrivate) -> Value { Value::Object(value.to_base_object()) }
603}
604impl From<DevicePrivate> for Value {
605    fn from(value: DevicePrivate) -> Value { Value::Object(value.to_base_object()) }
606}
607impl crate::value::FromDaqOwned for DevicePrivate {
608    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
609        crate::value::cast_owned(ptr, op)
610    }
611}
612
613/// Provides information on what device type can be created by a given module. Can be used to obtain the default configuration used when either adding/creating a new device.
614/// Wrapper over the openDAQ `daqDeviceType` interface.
615#[repr(transparent)]
616#[derive(Clone, Debug)]
617pub struct DeviceType(pub(crate) ComponentType);
618
619impl std::ops::Deref for DeviceType {
620    type Target = ComponentType;
621    fn deref(&self) -> &ComponentType { &self.0 }
622}
623impl crate::sealed::Sealed for DeviceType {}
624unsafe impl Interface for DeviceType {
625    const NAME: &'static str = "daqDeviceType";
626    fn interface_id() -> Option<crate::IntfID> {
627        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
628        unsafe { (crate::sys::api().daqDeviceType_getInterfaceId)(&mut id) };
629        Some(id)
630    }
631    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
632        Ref::from_owned(ptr).map(Self::__from_ref)
633    }
634    fn as_base_object(&self) -> &BaseObject { &self.0 }
635}
636impl DeviceType {
637    #[doc(hidden)]
638    pub(crate) fn __from_ref(r: Ref) -> Self { DeviceType(ComponentType::__from_ref(r)) }
639}
640impl std::fmt::Display for DeviceType {
641    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
642        std::fmt::Display::fmt(self.as_base_object(), f)
643    }
644}
645impl From<&DeviceType> for Value {
646    fn from(value: &DeviceType) -> Value { Value::Object(value.to_base_object()) }
647}
648impl From<DeviceType> for Value {
649    fn from(value: DeviceType) -> Value { Value::Object(value.to_base_object()) }
650}
651impl crate::value::FromDaqOwned for DeviceType {
652    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
653        crate::value::cast_owned(ptr, op)
654    }
655}
656
657/// Function blocks perform calculations on inputs/generate data, outputting new data in its output signals as packets.
658/// Each function block describes its behaviour and identifiers in its FunctionBlockType structure. It
659/// provides a list of input ports that can be connected to signals that the input port accepts, as well as a
660/// list of output signals that carry the function block's output data.
661/// Additionally, as each function block is a property object, it can define its own set of properties, providing
662/// user-configurable settings. In example, a FFT function block would expose a `blockSize` property, defining the
663/// amount of samples to be used for calculation in each block.
664/// Function blocks also provide a status signal, through which a status packet is sent whenever a connection to a
665/// new input port is formed, or when the status changes.
666/// Wrapper over the openDAQ `daqFunctionBlock` interface.
667#[repr(transparent)]
668#[derive(Clone, Debug)]
669pub struct FunctionBlock(pub(crate) Folder);
670
671impl std::ops::Deref for FunctionBlock {
672    type Target = Folder;
673    fn deref(&self) -> &Folder { &self.0 }
674}
675impl crate::sealed::Sealed for FunctionBlock {}
676unsafe impl Interface for FunctionBlock {
677    const NAME: &'static str = "daqFunctionBlock";
678    fn interface_id() -> Option<crate::IntfID> {
679        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
680        unsafe { (crate::sys::api().daqFunctionBlock_getInterfaceId)(&mut id) };
681        Some(id)
682    }
683    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
684        Ref::from_owned(ptr).map(Self::__from_ref)
685    }
686    fn as_base_object(&self) -> &BaseObject { &self.0 }
687}
688impl FunctionBlock {
689    #[doc(hidden)]
690    pub(crate) fn __from_ref(r: Ref) -> Self { FunctionBlock(Folder::__from_ref(r)) }
691}
692impl std::fmt::Display for FunctionBlock {
693    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
694        std::fmt::Display::fmt(self.as_base_object(), f)
695    }
696}
697impl From<&FunctionBlock> for Value {
698    fn from(value: &FunctionBlock) -> Value { Value::Object(value.to_base_object()) }
699}
700impl From<FunctionBlock> for Value {
701    fn from(value: FunctionBlock) -> Value { Value::Object(value.to_base_object()) }
702}
703impl crate::value::FromDaqOwned for FunctionBlock {
704    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
705        crate::value::cast_owned(ptr, op)
706    }
707}
708
709/// Acts as a container for channels and other io folders.
710/// Every device has an IO folder, which allows only other IO folders and
711/// channels as children.
712/// Wrapper over the openDAQ `daqIoFolderConfig` interface.
713#[repr(transparent)]
714#[derive(Clone, Debug)]
715pub struct IoFolderConfig(pub(crate) FolderConfig);
716
717impl std::ops::Deref for IoFolderConfig {
718    type Target = FolderConfig;
719    fn deref(&self) -> &FolderConfig { &self.0 }
720}
721impl crate::sealed::Sealed for IoFolderConfig {}
722unsafe impl Interface for IoFolderConfig {
723    const NAME: &'static str = "daqIoFolderConfig";
724    fn interface_id() -> Option<crate::IntfID> {
725        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
726        unsafe { (crate::sys::api().daqIoFolderConfig_getInterfaceId)(&mut id) };
727        Some(id)
728    }
729    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
730        Ref::from_owned(ptr).map(Self::__from_ref)
731    }
732    fn as_base_object(&self) -> &BaseObject { &self.0 }
733}
734impl IoFolderConfig {
735    #[doc(hidden)]
736    pub(crate) fn __from_ref(r: Ref) -> Self { IoFolderConfig(FolderConfig::__from_ref(r)) }
737}
738impl std::fmt::Display for IoFolderConfig {
739    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
740        std::fmt::Display::fmt(self.as_base_object(), f)
741    }
742}
743impl From<&IoFolderConfig> for Value {
744    fn from(value: &IoFolderConfig) -> Value { Value::Object(value.to_base_object()) }
745}
746impl From<IoFolderConfig> for Value {
747    fn from(value: IoFolderConfig) -> Value { Value::Object(value.to_base_object()) }
748}
749impl crate::value::FromDaqOwned for IoFolderConfig {
750    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
751        crate::value::cast_owned(ptr, op)
752    }
753}
754
755/// @ingroup opendaq_log_file_info
756/// @addtogroup opendaq_log_file_info log_file_info
757/// Wrapper over the openDAQ `daqLogFileInfo` interface.
758#[repr(transparent)]
759#[derive(Clone, Debug)]
760pub struct LogFileInfo(pub(crate) BaseObject);
761
762impl std::ops::Deref for LogFileInfo {
763    type Target = BaseObject;
764    fn deref(&self) -> &BaseObject { &self.0 }
765}
766impl crate::sealed::Sealed for LogFileInfo {}
767unsafe impl Interface for LogFileInfo {
768    const NAME: &'static str = "daqLogFileInfo";
769    fn interface_id() -> Option<crate::IntfID> {
770        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
771        unsafe { (crate::sys::api().daqLogFileInfo_getInterfaceId)(&mut id) };
772        Some(id)
773    }
774    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
775        Ref::from_owned(ptr).map(Self::__from_ref)
776    }
777    fn as_base_object(&self) -> &BaseObject { &self.0 }
778}
779impl LogFileInfo {
780    #[doc(hidden)]
781    pub(crate) fn __from_ref(r: Ref) -> Self { LogFileInfo(BaseObject(r)) }
782}
783impl std::fmt::Display for LogFileInfo {
784    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
785        std::fmt::Display::fmt(self.as_base_object(), f)
786    }
787}
788impl From<&LogFileInfo> for Value {
789    fn from(value: &LogFileInfo) -> Value { Value::Object(value.to_base_object()) }
790}
791impl From<LogFileInfo> for Value {
792    fn from(value: LogFileInfo) -> Value { Value::Object(value.to_base_object()) }
793}
794impl crate::value::FromDaqOwned for LogFileInfo {
795    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
796        crate::value::cast_owned(ptr, op)
797    }
798}
799
800/// @ingroup opendaq_log_file_info
801/// @addtogroup opendaq_log_file_info log_file_info_builder
802/// Wrapper over the openDAQ `daqLogFileInfoBuilder` interface.
803#[repr(transparent)]
804#[derive(Clone, Debug)]
805pub struct LogFileInfoBuilder(pub(crate) BaseObject);
806
807impl std::ops::Deref for LogFileInfoBuilder {
808    type Target = BaseObject;
809    fn deref(&self) -> &BaseObject { &self.0 }
810}
811impl crate::sealed::Sealed for LogFileInfoBuilder {}
812unsafe impl Interface for LogFileInfoBuilder {
813    const NAME: &'static str = "daqLogFileInfoBuilder";
814    fn interface_id() -> Option<crate::IntfID> {
815        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
816        unsafe { (crate::sys::api().daqLogFileInfoBuilder_getInterfaceId)(&mut id) };
817        Some(id)
818    }
819    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
820        Ref::from_owned(ptr).map(Self::__from_ref)
821    }
822    fn as_base_object(&self) -> &BaseObject { &self.0 }
823}
824impl LogFileInfoBuilder {
825    #[doc(hidden)]
826    pub(crate) fn __from_ref(r: Ref) -> Self { LogFileInfoBuilder(BaseObject(r)) }
827}
828impl std::fmt::Display for LogFileInfoBuilder {
829    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
830        std::fmt::Display::fmt(self.as_base_object(), f)
831    }
832}
833impl From<&LogFileInfoBuilder> for Value {
834    fn from(value: &LogFileInfoBuilder) -> Value { Value::Object(value.to_base_object()) }
835}
836impl From<LogFileInfoBuilder> for Value {
837    fn from(value: LogFileInfoBuilder) -> Value { Value::Object(value.to_base_object()) }
838}
839impl crate::value::FromDaqOwned for LogFileInfoBuilder {
840    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
841        crate::value::cast_owned(ptr, op)
842    }
843}
844
845/// Provides an interface to manipulate the configuration of a device's (server's) network interface. Offers methods to update the IP configuration and retrieve the currently active one, if the corresponding feature supported by the device. Additionally, includes a helper method to create a prebuilt property object with valid default configuration.
846/// The configuration property object, passed as a parameter to said methods, should include the following properties:
847/// - **"dhcp4"**: A boolean property indicating whether DHCP is enabled for IPv4. Defaults to `True` (DHCP enabled).
848/// If set to `False` (DHCP disabled), non-empty static configuration properties are required.
849/// - **"address4"**: A string property specifying the statically assigned IPv4 address in the format `address/netmask` (e.g. 192.168.1.2/24).
850/// This property is ignored when DHCP is enabled for IPv4. However, if DHCP is disabled, the list must include at least one address. Defaults to an empty string.
851/// - **"gateway4"**: A string property specifying the IPv4 gateway address. This is required if DHCP is disabled and ignored otherwise. Defaults to an empty string.
852/// - **"dhcp6"**, **"address6"**, **"gateway6"**: These properties follow the same format and rules as their IPv4 counterparts but apply to IPv6 configuration.
853/// Wrapper over the openDAQ `daqNetworkInterface` interface.
854#[repr(transparent)]
855#[derive(Clone, Debug)]
856pub struct NetworkInterface(pub(crate) BaseObject);
857
858impl std::ops::Deref for NetworkInterface {
859    type Target = BaseObject;
860    fn deref(&self) -> &BaseObject { &self.0 }
861}
862impl crate::sealed::Sealed for NetworkInterface {}
863unsafe impl Interface for NetworkInterface {
864    const NAME: &'static str = "daqNetworkInterface";
865    fn interface_id() -> Option<crate::IntfID> {
866        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
867        unsafe { (crate::sys::api().daqNetworkInterface_getInterfaceId)(&mut id) };
868        Some(id)
869    }
870    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
871        Ref::from_owned(ptr).map(Self::__from_ref)
872    }
873    fn as_base_object(&self) -> &BaseObject { &self.0 }
874}
875impl NetworkInterface {
876    #[doc(hidden)]
877    pub(crate) fn __from_ref(r: Ref) -> Self { NetworkInterface(BaseObject(r)) }
878}
879impl std::fmt::Display for NetworkInterface {
880    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
881        std::fmt::Display::fmt(self.as_base_object(), f)
882    }
883}
884impl From<&NetworkInterface> for Value {
885    fn from(value: &NetworkInterface) -> Value { Value::Object(value.to_base_object()) }
886}
887impl From<NetworkInterface> for Value {
888    fn from(value: NetworkInterface) -> Value { Value::Object(value.to_base_object()) }
889}
890impl crate::value::FromDaqOwned for NetworkInterface {
891    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
892        crate::value::cast_owned(ptr, op)
893    }
894}
895
896/// If set, gives additional information about the reference domain.
897/// Wrapper over the openDAQ `daqReferenceDomainInfo` interface.
898#[repr(transparent)]
899#[derive(Clone, Debug)]
900pub struct ReferenceDomainInfo(pub(crate) BaseObject);
901
902impl std::ops::Deref for ReferenceDomainInfo {
903    type Target = BaseObject;
904    fn deref(&self) -> &BaseObject { &self.0 }
905}
906impl crate::sealed::Sealed for ReferenceDomainInfo {}
907unsafe impl Interface for ReferenceDomainInfo {
908    const NAME: &'static str = "daqReferenceDomainInfo";
909    fn interface_id() -> Option<crate::IntfID> {
910        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
911        unsafe { (crate::sys::api().daqReferenceDomainInfo_getInterfaceId)(&mut id) };
912        Some(id)
913    }
914    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
915        Ref::from_owned(ptr).map(Self::__from_ref)
916    }
917    fn as_base_object(&self) -> &BaseObject { &self.0 }
918}
919impl ReferenceDomainInfo {
920    #[doc(hidden)]
921    pub(crate) fn __from_ref(r: Ref) -> Self { ReferenceDomainInfo(BaseObject(r)) }
922}
923impl std::fmt::Display for ReferenceDomainInfo {
924    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
925        std::fmt::Display::fmt(self.as_base_object(), f)
926    }
927}
928impl From<&ReferenceDomainInfo> for Value {
929    fn from(value: &ReferenceDomainInfo) -> Value { Value::Object(value.to_base_object()) }
930}
931impl From<ReferenceDomainInfo> for Value {
932    fn from(value: ReferenceDomainInfo) -> Value { Value::Object(value.to_base_object()) }
933}
934impl crate::value::FromDaqOwned for ReferenceDomainInfo {
935    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
936        crate::value::cast_owned(ptr, op)
937    }
938}
939
940/// Represents a server. The server provides access to the openDAQ device. Depend of the implementation, it can support configuring the device, reading configuration, and data streaming.
941/// We do not make the server directly. But through the instance and module manager. For that reason, the server must be uniquely
942/// defined with "ServerType". The server is then created with the current root device, context and configuration object.
943/// Configuration of the server can be done with custom property object.
944/// The configuration object is created with the corresponding ServerType object (IServerType::createDefaultConfig method).
945/// For example, with a configuration object, we can define connection timeout.
946/// Wrapper over the openDAQ `daqServer` interface.
947#[repr(transparent)]
948#[derive(Clone, Debug)]
949pub struct Server(pub(crate) Folder);
950
951impl std::ops::Deref for Server {
952    type Target = Folder;
953    fn deref(&self) -> &Folder { &self.0 }
954}
955impl crate::sealed::Sealed for Server {}
956unsafe impl Interface for Server {
957    const NAME: &'static str = "daqServer";
958    fn interface_id() -> Option<crate::IntfID> {
959        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
960        unsafe { (crate::sys::api().daqServer_getInterfaceId)(&mut id) };
961        Some(id)
962    }
963    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
964        Ref::from_owned(ptr).map(Self::__from_ref)
965    }
966    fn as_base_object(&self) -> &BaseObject { &self.0 }
967}
968impl Server {
969    #[doc(hidden)]
970    pub(crate) fn __from_ref(r: Ref) -> Self { Server(Folder::__from_ref(r)) }
971}
972impl std::fmt::Display for Server {
973    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
974        std::fmt::Display::fmt(self.as_base_object(), f)
975    }
976}
977impl From<&Server> for Value {
978    fn from(value: &Server) -> Value { Value::Object(value.to_base_object()) }
979}
980impl From<Server> for Value {
981    fn from(value: Server) -> Value { Value::Object(value.to_base_object()) }
982}
983impl crate::value::FromDaqOwned for Server {
984    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
985        crate::value::cast_owned(ptr, op)
986    }
987}
988
989/// Represents standard information about a server's capability to support various protocols. The Server Capability object functions as a Property Object, facilitating the inclusion of custom properties of String, Int, Bool, or Float types. This interface serves to store essential details regarding the supported protocol by a device. It adheres to a standardized set of properties, including methods to retrieve information such as the connection string, protocol name, protocol type, connection type, and core events enabled.
990/// Additional String, Int, Bool, or Float-type properties can be added using the appropriate Property Object "add property" method.
991/// However, other property types are considered invalid for this interface.
992/// The Server Capability object conforms to a standardized format, ensuring compatibility with communication standards.
993/// For instance, it provides methods to retrieve details like
994/// - the connection string (URL),
995/// - protocol name (e.g., "OpenDAQNativeStreaming", "OpenDAQOPCUA"),
996/// - protocol type (e.g., "Configuration&Streaming", "Streaming"),
997/// - connection type (e.g., IPv4, IPv6),
998/// - core events enabled (indicating communication mode).
999/// Wrapper over the openDAQ `daqServerCapability` interface.
1000#[repr(transparent)]
1001#[derive(Clone, Debug)]
1002pub struct ServerCapability(pub(crate) PropertyObject);
1003
1004impl std::ops::Deref for ServerCapability {
1005    type Target = PropertyObject;
1006    fn deref(&self) -> &PropertyObject { &self.0 }
1007}
1008impl crate::sealed::Sealed for ServerCapability {}
1009unsafe impl Interface for ServerCapability {
1010    const NAME: &'static str = "daqServerCapability";
1011    fn interface_id() -> Option<crate::IntfID> {
1012        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
1013        unsafe { (crate::sys::api().daqServerCapability_getInterfaceId)(&mut id) };
1014        Some(id)
1015    }
1016    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
1017        Ref::from_owned(ptr).map(Self::__from_ref)
1018    }
1019    fn as_base_object(&self) -> &BaseObject { &self.0 }
1020}
1021impl ServerCapability {
1022    #[doc(hidden)]
1023    pub(crate) fn __from_ref(r: Ref) -> Self { ServerCapability(PropertyObject::__from_ref(r)) }
1024}
1025impl std::fmt::Display for ServerCapability {
1026    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1027        std::fmt::Display::fmt(self.as_base_object(), f)
1028    }
1029}
1030impl From<&ServerCapability> for Value {
1031    fn from(value: &ServerCapability) -> Value { Value::Object(value.to_base_object()) }
1032}
1033impl From<ServerCapability> for Value {
1034    fn from(value: ServerCapability) -> Value { Value::Object(value.to_base_object()) }
1035}
1036impl crate::value::FromDaqOwned for ServerCapability {
1037    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
1038        crate::value::cast_owned(ptr, op)
1039    }
1040}
1041
1042/// Wrapper over the openDAQ `daqServerCapabilityConfig` interface.
1043#[repr(transparent)]
1044#[derive(Clone, Debug)]
1045pub struct ServerCapabilityConfig(pub(crate) ServerCapability);
1046
1047impl std::ops::Deref for ServerCapabilityConfig {
1048    type Target = ServerCapability;
1049    fn deref(&self) -> &ServerCapability { &self.0 }
1050}
1051impl crate::sealed::Sealed for ServerCapabilityConfig {}
1052unsafe impl Interface for ServerCapabilityConfig {
1053    const NAME: &'static str = "daqServerCapabilityConfig";
1054    fn interface_id() -> Option<crate::IntfID> {
1055        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
1056        unsafe { (crate::sys::api().daqServerCapabilityConfig_getInterfaceId)(&mut id) };
1057        Some(id)
1058    }
1059    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
1060        Ref::from_owned(ptr).map(Self::__from_ref)
1061    }
1062    fn as_base_object(&self) -> &BaseObject { &self.0 }
1063}
1064impl ServerCapabilityConfig {
1065    #[doc(hidden)]
1066    pub(crate) fn __from_ref(r: Ref) -> Self { ServerCapabilityConfig(ServerCapability::__from_ref(r)) }
1067}
1068impl std::fmt::Display for ServerCapabilityConfig {
1069    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1070        std::fmt::Display::fmt(self.as_base_object(), f)
1071    }
1072}
1073impl From<&ServerCapabilityConfig> for Value {
1074    fn from(value: &ServerCapabilityConfig) -> Value { Value::Object(value.to_base_object()) }
1075}
1076impl From<ServerCapabilityConfig> for Value {
1077    fn from(value: ServerCapabilityConfig) -> Value { Value::Object(value.to_base_object()) }
1078}
1079impl crate::value::FromDaqOwned for ServerCapabilityConfig {
1080    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
1081        crate::value::cast_owned(ptr, op)
1082    }
1083}
1084
1085/// Represents the client-side part of a streaming service responsible for initiating communication with the openDAQ device streaming server and processing the received data. Wraps the client-side implementation details of the particular data transfer protocol used by openDAQ to send processed/acquired data from devices running an openDAQ Server to an openDAQ Client.
1086/// The Streaming is used as a selectable data source for mirrored signals. For this, it
1087/// provides methods, allowing mirrored signals to be added/removed dynamically,
1088/// to enable/disable the use of Streaming as a data source of these signals.
1089/// Forwarding of packets received from the remote device through the data transfer protocol down to
1090/// the signal path is enabled when the following conditions are met:
1091/// - Streaming object itself is in active state.
1092/// - Streaming is selected as an active source of the corresponding signal.
1093/// Usually, the data transfer protocol provides information about the signals whose data can be sent
1094/// over the protocol. It allows the implementation to reject unsupported signals from being added to
1095/// the streaming. Each Streaming object provides the string representation of a connection address
1096/// used to connect to the streaming service of the device. This string representation is used as
1097/// a unique ID to determine the streaming source for the mirrored signal.
1098/// When the generalized client-to-device streaming mechanism is employed, however, the roles are effectively switched:
1099/// the server becomes a consumer of signal data, while the client-side Streaming object acts as
1100/// the producer, sending signal data over the protocol. In this context, Streaming objects are expected
1101/// to exist on the server side as well to interact with mirrored copies of client signals.
1102/// In context of client-to-device streaming, in addition to signals, mirrored input ports can also be added or removed
1103/// dynamically through the corresponding methods of the Streaming interface, similarly to mirrored signals.
1104/// The support for client-to-device streaming can be checked via `getClientToDeviceStreamingEnabled`.
1105/// If it is not enabled or not supported by the protocol, the method provides `false` value, and adding or removing
1106/// mirrored input ports is not allowed, therefore disabling any client-to-device streaming operations.
1107/// Wrapper over the openDAQ `daqStreaming` interface.
1108#[repr(transparent)]
1109#[derive(Clone, Debug)]
1110pub struct Streaming(pub(crate) BaseObject);
1111
1112impl std::ops::Deref for Streaming {
1113    type Target = BaseObject;
1114    fn deref(&self) -> &BaseObject { &self.0 }
1115}
1116impl crate::sealed::Sealed for Streaming {}
1117unsafe impl Interface for Streaming {
1118    const NAME: &'static str = "daqStreaming";
1119    fn interface_id() -> Option<crate::IntfID> {
1120        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
1121        unsafe { (crate::sys::api().daqStreaming_getInterfaceId)(&mut id) };
1122        Some(id)
1123    }
1124    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
1125        Ref::from_owned(ptr).map(Self::__from_ref)
1126    }
1127    fn as_base_object(&self) -> &BaseObject { &self.0 }
1128}
1129impl Streaming {
1130    #[doc(hidden)]
1131    pub(crate) fn __from_ref(r: Ref) -> Self { Streaming(BaseObject(r)) }
1132}
1133impl std::fmt::Display for Streaming {
1134    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1135        std::fmt::Display::fmt(self.as_base_object(), f)
1136    }
1137}
1138impl From<&Streaming> for Value {
1139    fn from(value: &Streaming) -> Value { Value::Object(value.to_base_object()) }
1140}
1141impl From<Streaming> for Value {
1142    fn from(value: Streaming) -> Value { Value::Object(value.to_base_object()) }
1143}
1144impl crate::value::FromDaqOwned for Streaming {
1145    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
1146        crate::value::cast_owned(ptr, op)
1147    }
1148}
1149
1150/// Interface representing a Synchronization Component in a Test & Measurement system. A SynchronizationComponent ensures synchronization among measurement devices in the system. It can act as a sync source and/or as a sync output, with each component having one sync input and 0 to n sync outputs.
1151/// SynchronizationComponents are configured via interfaces, which can include PTP, IRIQ, GPS,
1152/// and CLK sync interfaces, among others.
1153///
1154/// # Notes
1155/// Every SynchronizationComponent has at least one interface. Only one interface can be set as an input, while others can be used as sync outputs to synchronize other devices. The configuration of these interfaces and the reading of their status is defined in Part 4.
1156/// Depending on the setup, some interfaces may be switched off, and some interfaces may act as sync sources or outputs.
1157/// A CLK interface can be used to let a device run in Fre-Run mode, where the device syncs internally to an internal quartz.
1158/// Wrapper over the openDAQ `daqSyncComponent` interface.
1159#[repr(transparent)]
1160#[derive(Clone, Debug)]
1161pub struct SyncComponent(pub(crate) Component);
1162
1163impl std::ops::Deref for SyncComponent {
1164    type Target = Component;
1165    fn deref(&self) -> &Component { &self.0 }
1166}
1167impl crate::sealed::Sealed for SyncComponent {}
1168unsafe impl Interface for SyncComponent {
1169    const NAME: &'static str = "daqSyncComponent";
1170    fn interface_id() -> Option<crate::IntfID> {
1171        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
1172        unsafe { (crate::sys::api().daqSyncComponent_getInterfaceId)(&mut id) };
1173        Some(id)
1174    }
1175    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
1176        Ref::from_owned(ptr).map(Self::__from_ref)
1177    }
1178    fn as_base_object(&self) -> &BaseObject { &self.0 }
1179}
1180impl SyncComponent {
1181    #[doc(hidden)]
1182    pub(crate) fn __from_ref(r: Ref) -> Self { SyncComponent(Component::__from_ref(r)) }
1183}
1184impl std::fmt::Display for SyncComponent {
1185    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1186        std::fmt::Display::fmt(self.as_base_object(), f)
1187    }
1188}
1189impl From<&SyncComponent> for Value {
1190    fn from(value: &SyncComponent) -> Value { Value::Object(value.to_base_object()) }
1191}
1192impl From<SyncComponent> for Value {
1193    fn from(value: SyncComponent) -> Value { Value::Object(value.to_base_object()) }
1194}
1195impl crate::value::FromDaqOwned for SyncComponent {
1196    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
1197        crate::value::cast_owned(ptr, op)
1198    }
1199}
1200
1201/// This class manages the lock state of an object, usually a device. A device can be locked either with a specific user or without one. If the device is locked with a specific user, only that user can unlock it. If the device is locked without a user, any user can unlock it.
1202/// Wrapper over the openDAQ `daqUserLock` interface.
1203#[repr(transparent)]
1204#[derive(Clone, Debug)]
1205pub struct UserLock(pub(crate) BaseObject);
1206
1207impl std::ops::Deref for UserLock {
1208    type Target = BaseObject;
1209    fn deref(&self) -> &BaseObject { &self.0 }
1210}
1211impl crate::sealed::Sealed for UserLock {}
1212unsafe impl Interface for UserLock {
1213    const NAME: &'static str = "daqUserLock";
1214    fn interface_id() -> Option<crate::IntfID> {
1215        let mut id = crate::IntfID { Data1: 0, Data2: 0, Data3: 0, Data4: 0 };
1216        unsafe { (crate::sys::api().daqUserLock_getInterfaceId)(&mut id) };
1217        Some(id)
1218    }
1219    unsafe fn from_raw(ptr: *mut std::ffi::c_void) -> Option<Self> {
1220        Ref::from_owned(ptr).map(Self::__from_ref)
1221    }
1222    fn as_base_object(&self) -> &BaseObject { &self.0 }
1223}
1224impl UserLock {
1225    #[doc(hidden)]
1226    pub(crate) fn __from_ref(r: Ref) -> Self { UserLock(BaseObject(r)) }
1227}
1228impl std::fmt::Display for UserLock {
1229    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1230        std::fmt::Display::fmt(self.as_base_object(), f)
1231    }
1232}
1233impl From<&UserLock> for Value {
1234    fn from(value: &UserLock) -> Value { Value::Object(value.to_base_object()) }
1235}
1236impl From<UserLock> for Value {
1237    fn from(value: UserLock) -> Value { Value::Object(value.to_base_object()) }
1238}
1239impl crate::value::FromDaqOwned for UserLock {
1240    unsafe fn from_daq_owned(ptr: *mut std::ffi::c_void, op: &'static str) -> Result<Self> {
1241        crate::value::cast_owned(ptr, op)
1242    }
1243}
1244
1245impl AddressInfoBuilder {
1246    /// Builds the address.
1247    ///
1248    /// # Returns
1249    /// - `address`: The address.
1250    ///
1251    /// Calls the openDAQ C function `daqAddressInfoBuilder_build()`.
1252    pub fn build(&self) -> Result<Option<AddressInfo>> {
1253        let mut __address: *mut sys::daqAddressInfo = std::ptr::null_mut();
1254        let __code = unsafe { (crate::sys::api().daqAddressInfoBuilder_build)(self.as_raw() as *mut _, &mut __address) };
1255        check(__code, "daqAddressInfoBuilder_build")?;
1256        Ok(unsafe { crate::marshal::take_object::<AddressInfo>(__address as *mut _) })
1257    }
1258
1259    /// Creates an Address builder with no parameters configured.
1260    ///
1261    /// Calls the openDAQ C function `daqAddressInfoBuilder_createAddressInfoBuilder()`.
1262    pub fn new() -> Result<AddressInfoBuilder> {
1263        let mut __obj: *mut sys::daqAddressInfoBuilder = std::ptr::null_mut();
1264        let __code = unsafe { (crate::sys::api().daqAddressInfoBuilder_createAddressInfoBuilder)(&mut __obj) };
1265        check(__code, "daqAddressInfoBuilder_createAddressInfoBuilder")?;
1266        Ok(unsafe { crate::marshal::require_object::<AddressInfoBuilder>(__obj as *mut _, "daqAddressInfoBuilder_createAddressInfoBuilder") }?)
1267    }
1268
1269    /// Gets the server address as a string.
1270    ///
1271    /// # Returns
1272    /// - `address`: The server address as a string.
1273    ///
1274    /// Calls the openDAQ C function `daqAddressInfoBuilder_getAddress()`.
1275    pub fn address(&self) -> Result<String> {
1276        let mut __address: *mut sys::daqString = std::ptr::null_mut();
1277        let __code = unsafe { (crate::sys::api().daqAddressInfoBuilder_getAddress)(self.as_raw() as *mut _, &mut __address) };
1278        check(__code, "daqAddressInfoBuilder_getAddress")?;
1279        Ok(unsafe { crate::marshal::take_string(__address) })
1280    }
1281
1282    /// Gets the connection string corresponding to the address.
1283    ///
1284    /// # Returns
1285    /// - `connection_string`: The connection string.
1286    ///
1287    /// Calls the openDAQ C function `daqAddressInfoBuilder_getConnectionString()`.
1288    pub fn connection_string(&self) -> Result<String> {
1289        let mut __connection_string: *mut sys::daqString = std::ptr::null_mut();
1290        let __code = unsafe { (crate::sys::api().daqAddressInfoBuilder_getConnectionString)(self.as_raw() as *mut _, &mut __connection_string) };
1291        check(__code, "daqAddressInfoBuilder_getConnectionString")?;
1292        Ok(unsafe { crate::marshal::take_string(__connection_string) })
1293    }
1294
1295    /// Gets the reachability status of the address.
1296    ///
1297    /// # Parameters
1298    /// - `address_reachability`: The reachability status of the address. This status is set to "Unknown" by default. For IPv4 address types, the module manager checks reachability when querying for available devices.
1299    ///
1300    /// Calls the openDAQ C function `daqAddressInfoBuilder_getReachabilityStatus()`.
1301    pub fn reachability_status(&self) -> Result<AddressReachabilityStatus> {
1302        let mut __address_reachability: u32 = 0;
1303        let __code = unsafe { (crate::sys::api().daqAddressInfoBuilder_getReachabilityStatus)(self.as_raw() as *mut _, &mut __address_reachability) };
1304        check(__code, "daqAddressInfoBuilder_getReachabilityStatus")?;
1305        Ok(crate::marshal::enum_out(AddressReachabilityStatus::from_raw(__address_reachability), "daqAddressInfoBuilder_getReachabilityStatus")?)
1306    }
1307
1308    /// Gets the type of the address.
1309    ///
1310    /// # Returns
1311    /// - `type`: The type the address. Currently available address types in the main openDAQ modules are: IPv4 and IPv6.
1312    ///
1313    /// Calls the openDAQ C function `daqAddressInfoBuilder_getType()`.
1314    pub fn type_(&self) -> Result<String> {
1315        let mut __type_: *mut sys::daqString = std::ptr::null_mut();
1316        let __code = unsafe { (crate::sys::api().daqAddressInfoBuilder_getType)(self.as_raw() as *mut _, &mut __type_) };
1317        check(__code, "daqAddressInfoBuilder_getType")?;
1318        Ok(unsafe { crate::marshal::take_string(__type_) })
1319    }
1320
1321    /// Sets the server address as a string.
1322    ///
1323    /// # Parameters
1324    /// - `address`: The server address as a string.
1325    ///
1326    /// Calls the openDAQ C function `daqAddressInfoBuilder_setAddress()`.
1327    pub fn set_address(&self, address: &str) -> Result<()> {
1328        let __address = crate::marshal::make_string(address)?;
1329        let __code = unsafe { (crate::sys::api().daqAddressInfoBuilder_setAddress)(self.as_raw() as *mut _, __address.as_ptr() as *mut _) };
1330        check(__code, "daqAddressInfoBuilder_setAddress")?;
1331        Ok(())
1332    }
1333
1334    /// Sets the connection string corresponding to the address.
1335    ///
1336    /// # Parameters
1337    /// - `connection_string`: The connection string.
1338    ///
1339    /// Calls the openDAQ C function `daqAddressInfoBuilder_setConnectionString()`.
1340    pub fn set_connection_string(&self, connection_string: &str) -> Result<()> {
1341        let __connection_string = crate::marshal::make_string(connection_string)?;
1342        let __code = unsafe { (crate::sys::api().daqAddressInfoBuilder_setConnectionString)(self.as_raw() as *mut _, __connection_string.as_ptr() as *mut _) };
1343        check(__code, "daqAddressInfoBuilder_setConnectionString")?;
1344        Ok(())
1345    }
1346
1347    /// Sets the reachability status of the address.
1348    ///
1349    /// # Parameters
1350    /// - `address_reachability`: The reachability status of the address. This status is set to "Unknown" by default. For IPv4 address types, the module manager checks reachability when querying for available devices.
1351    ///
1352    /// Calls the openDAQ C function `daqAddressInfoBuilder_setReachabilityStatus()`.
1353    pub fn set_reachability_status(&self, address_reachability: AddressReachabilityStatus) -> Result<()> {
1354        let __code = unsafe { (crate::sys::api().daqAddressInfoBuilder_setReachabilityStatus)(self.as_raw() as *mut _, address_reachability as u32) };
1355        check(__code, "daqAddressInfoBuilder_setReachabilityStatus")?;
1356        Ok(())
1357    }
1358
1359    /// Sets the type of the address.
1360    ///
1361    /// # Parameters
1362    /// - `type`: The type the address. Currently available address types in the main openDAQ modules are: IPv4 and IPv6.
1363    ///
1364    /// Calls the openDAQ C function `daqAddressInfoBuilder_setType()`.
1365    pub fn set_type(&self, type_: &str) -> Result<()> {
1366        let __type_ = crate::marshal::make_string(type_)?;
1367        let __code = unsafe { (crate::sys::api().daqAddressInfoBuilder_setType)(self.as_raw() as *mut _, __type_.as_ptr() as *mut _) };
1368        check(__code, "daqAddressInfoBuilder_setType")?;
1369        Ok(())
1370    }
1371
1372}
1373
1374impl AddressInfoPrivate {
1375    /// Sets the reachability status of the address, ignoring the "Frozen" status of the address.
1376    ///
1377    /// # Parameters
1378    /// - `address_reachability`: The reachability status of the address. This status is set to "Unknown" by default. For IPv4 address types, the module manager checks reachability when querying for available devices.
1379    ///
1380    /// Calls the openDAQ C function `daqAddressInfoPrivate_setReachabilityStatusPrivate()`.
1381    pub fn set_reachability_status_private(&self, address_reachability: AddressReachabilityStatus) -> Result<()> {
1382        let __code = unsafe { (crate::sys::api().daqAddressInfoPrivate_setReachabilityStatusPrivate)(self.as_raw() as *mut _, address_reachability as u32) };
1383        check(__code, "daqAddressInfoPrivate_setReachabilityStatusPrivate")?;
1384        Ok(())
1385    }
1386
1387}
1388
1389impl AddressInfo {
1390    /// Creates an Address with no parameters configured.
1391    ///
1392    /// Calls the openDAQ C function `daqAddressInfo_createAddressInfo()`.
1393    pub fn new() -> Result<AddressInfo> {
1394        let mut __obj: *mut sys::daqAddressInfo = std::ptr::null_mut();
1395        let __code = unsafe { (crate::sys::api().daqAddressInfo_createAddressInfo)(&mut __obj) };
1396        check(__code, "daqAddressInfo_createAddressInfo")?;
1397        Ok(unsafe { crate::marshal::require_object::<AddressInfo>(__obj as *mut _, "daqAddressInfo_createAddressInfo") }?)
1398    }
1399
1400    /// Creates an Address using the builder's configuration parameters.
1401    ///
1402    /// # Parameters
1403    /// - `builder`: The address info builder.
1404    ///
1405    /// Calls the openDAQ C function `daqAddressInfo_createAddressInfoFromBuilder()`.
1406    pub fn from_builder(builder: &AddressInfoBuilder) -> Result<AddressInfo> {
1407        let mut __obj: *mut sys::daqAddressInfo = std::ptr::null_mut();
1408        let __code = unsafe { (crate::sys::api().daqAddressInfo_createAddressInfoFromBuilder)(&mut __obj, builder.as_raw() as *mut _) };
1409        check(__code, "daqAddressInfo_createAddressInfoFromBuilder")?;
1410        Ok(unsafe { crate::marshal::require_object::<AddressInfo>(__obj as *mut _, "daqAddressInfo_createAddressInfoFromBuilder") }?)
1411    }
1412
1413    /// Gets the server address as a string.
1414    ///
1415    /// # Returns
1416    /// - `address`: The server address as a string.
1417    ///
1418    /// Calls the openDAQ C function `daqAddressInfo_getAddress()`.
1419    pub fn address(&self) -> Result<String> {
1420        let mut __address: *mut sys::daqString = std::ptr::null_mut();
1421        let __code = unsafe { (crate::sys::api().daqAddressInfo_getAddress)(self.as_raw() as *mut _, &mut __address) };
1422        check(__code, "daqAddressInfo_getAddress")?;
1423        Ok(unsafe { crate::marshal::take_string(__address) })
1424    }
1425
1426    /// Gets the connection string corresponding to the address.
1427    ///
1428    /// # Returns
1429    /// - `connection_string`: The connection string.
1430    ///
1431    /// Calls the openDAQ C function `daqAddressInfo_getConnectionString()`.
1432    pub fn connection_string(&self) -> Result<String> {
1433        let mut __connection_string: *mut sys::daqString = std::ptr::null_mut();
1434        let __code = unsafe { (crate::sys::api().daqAddressInfo_getConnectionString)(self.as_raw() as *mut _, &mut __connection_string) };
1435        check(__code, "daqAddressInfo_getConnectionString")?;
1436        Ok(unsafe { crate::marshal::take_string(__connection_string) })
1437    }
1438
1439    /// Gets the reachability status of the address.
1440    ///
1441    /// # Parameters
1442    /// - `address_reachability`: The reachability status of the address. This status is set to "Unknown" by default. For IPv4 address types, the module manager checks reachability when querying for available devices.
1443    ///
1444    /// Calls the openDAQ C function `daqAddressInfo_getReachabilityStatus()`.
1445    pub fn reachability_status(&self) -> Result<AddressReachabilityStatus> {
1446        let mut __address_reachability: u32 = 0;
1447        let __code = unsafe { (crate::sys::api().daqAddressInfo_getReachabilityStatus)(self.as_raw() as *mut _, &mut __address_reachability) };
1448        check(__code, "daqAddressInfo_getReachabilityStatus")?;
1449        Ok(crate::marshal::enum_out(AddressReachabilityStatus::from_raw(__address_reachability), "daqAddressInfo_getReachabilityStatus")?)
1450    }
1451
1452    /// Gets the type of the address.
1453    ///
1454    /// # Parameters
1455    /// - `type`: The type the address. Currently available address types in the main openDAQ modules are: IPv4 and IPv6.
1456    ///
1457    /// Calls the openDAQ C function `daqAddressInfo_getType()`.
1458    pub fn type_(&self) -> Result<String> {
1459        let mut __type_: *mut sys::daqString = std::ptr::null_mut();
1460        let __code = unsafe { (crate::sys::api().daqAddressInfo_getType)(self.as_raw() as *mut _, &mut __type_) };
1461        check(__code, "daqAddressInfo_getType")?;
1462        Ok(unsafe { crate::marshal::take_string(__type_) })
1463    }
1464
1465}
1466
1467impl ConnectedClientInfo {
1468    /// Creates a Connected client with no parameters configured.
1469    ///
1470    /// Calls the openDAQ C function `daqConnectedClientInfo_createConnectedClientInfo()`.
1471    pub fn new() -> Result<ConnectedClientInfo> {
1472        let mut __obj: *mut sys::daqConnectedClientInfo = std::ptr::null_mut();
1473        let __code = unsafe { (crate::sys::api().daqConnectedClientInfo_createConnectedClientInfo)(&mut __obj) };
1474        check(__code, "daqConnectedClientInfo_createConnectedClientInfo")?;
1475        Ok(unsafe { crate::marshal::require_object::<ConnectedClientInfo>(__obj as *mut _, "daqConnectedClientInfo_createConnectedClientInfo") }?)
1476    }
1477
1478    /// Creates a Connected client info using the provided parameters.
1479    ///
1480    /// # Parameters
1481    /// - `address`: The address of connected client.
1482    /// - `protocol_type`: The type of the protocol type used by the client.
1483    /// - `protocol_name`: The name of the protocol name used by the client.
1484    /// - `client_type`: The configuration connection client type name.
1485    /// - `host_name`: The host name of connected client.
1486    ///
1487    /// Calls the openDAQ C function `daqConnectedClientInfo_createConnectedClientInfoWithParams()`.
1488    pub fn with_params(address: &str, protocol_type: ProtocolType, protocol_name: &str, client_type: &str, host_name: &str) -> Result<ConnectedClientInfo> {
1489        let __address = crate::marshal::make_string(address)?;
1490        let __protocol_name = crate::marshal::make_string(protocol_name)?;
1491        let __client_type = crate::marshal::make_string(client_type)?;
1492        let __host_name = crate::marshal::make_string(host_name)?;
1493        let mut __obj: *mut sys::daqConnectedClientInfo = std::ptr::null_mut();
1494        let __code = unsafe { (crate::sys::api().daqConnectedClientInfo_createConnectedClientInfoWithParams)(&mut __obj, __address.as_ptr() as *mut _, protocol_type as u32, __protocol_name.as_ptr() as *mut _, __client_type.as_ptr() as *mut _, __host_name.as_ptr() as *mut _) };
1495        check(__code, "daqConnectedClientInfo_createConnectedClientInfoWithParams")?;
1496        Ok(unsafe { crate::marshal::require_object::<ConnectedClientInfo>(__obj as *mut _, "daqConnectedClientInfo_createConnectedClientInfoWithParams") }?)
1497    }
1498
1499    /// Gets the client address string.
1500    ///
1501    /// # Returns
1502    /// - `address`: The client address string.
1503    ///
1504    /// Calls the openDAQ C function `daqConnectedClientInfo_getAddress()`.
1505    pub fn address(&self) -> Result<String> {
1506        let mut __address: *mut sys::daqString = std::ptr::null_mut();
1507        let __code = unsafe { (crate::sys::api().daqConnectedClientInfo_getAddress)(self.as_raw() as *mut _, &mut __address) };
1508        check(__code, "daqConnectedClientInfo_getAddress")?;
1509        Ok(unsafe { crate::marshal::take_string(__address) })
1510    }
1511
1512    /// Gets the type of connected configuration connection client.
1513    ///
1514    /// # Returns
1515    /// - `type`: The string representation of client type ("Control", "ExclusiveControl", "ViewOnly").
1516    ///
1517    /// Calls the openDAQ C function `daqConnectedClientInfo_getClientTypeName()`.
1518    pub fn client_type_name(&self) -> Result<String> {
1519        let mut __type_: *mut sys::daqString = std::ptr::null_mut();
1520        let __code = unsafe { (crate::sys::api().daqConnectedClientInfo_getClientTypeName)(self.as_raw() as *mut _, &mut __type_) };
1521        check(__code, "daqConnectedClientInfo_getClientTypeName")?;
1522        Ok(unsafe { crate::marshal::take_string(__type_) })
1523    }
1524
1525    /// Gets the client host name.
1526    ///
1527    /// # Returns
1528    /// - `host_name`: The client host name.
1529    ///
1530    /// Calls the openDAQ C function `daqConnectedClientInfo_getHostName()`.
1531    pub fn host_name(&self) -> Result<String> {
1532        let mut __host_name: *mut sys::daqString = std::ptr::null_mut();
1533        let __code = unsafe { (crate::sys::api().daqConnectedClientInfo_getHostName)(self.as_raw() as *mut _, &mut __host_name) };
1534        check(__code, "daqConnectedClientInfo_getHostName")?;
1535        Ok(unsafe { crate::marshal::take_string(__host_name) })
1536    }
1537
1538    /// Gets the name of the protocol used by the client.
1539    ///
1540    /// # Returns
1541    /// - `protocol_name`: The name of the protocol (e.g., "OpenDAQNativeStreaming", "OpenDAQOPCUA", "OpenDAQLTStreaming").
1542    ///
1543    /// Calls the openDAQ C function `daqConnectedClientInfo_getProtocolName()`.
1544    pub fn protocol_name(&self) -> Result<String> {
1545        let mut __protocol_name: *mut sys::daqString = std::ptr::null_mut();
1546        let __code = unsafe { (crate::sys::api().daqConnectedClientInfo_getProtocolName)(self.as_raw() as *mut _, &mut __protocol_name) };
1547        check(__code, "daqConnectedClientInfo_getProtocolName")?;
1548        Ok(unsafe { crate::marshal::take_string(__protocol_name) })
1549    }
1550
1551    /// Gets the type of protocol used by the client.
1552    ///
1553    /// # Returns
1554    /// - `type`: The type of protocol (Enumeration value reflecting protocol type: "ConfigurationAndStreaming", "Configuration", "Streaming", "Unknown").
1555    ///
1556    /// Calls the openDAQ C function `daqConnectedClientInfo_getProtocolType()`.
1557    pub fn protocol_type(&self) -> Result<ProtocolType> {
1558        let mut __type_: u32 = 0;
1559        let __code = unsafe { (crate::sys::api().daqConnectedClientInfo_getProtocolType)(self.as_raw() as *mut _, &mut __type_) };
1560        check(__code, "daqConnectedClientInfo_getProtocolType")?;
1561        Ok(crate::marshal::enum_out(ProtocolType::from_raw(__type_), "daqConnectedClientInfo_getProtocolType")?)
1562    }
1563
1564}
1565
1566impl ConnectionStatusContainerPrivate {
1567    /// Adds a new configuration connection status with the specified connection string and initial value.
1568    ///
1569    /// # Parameters
1570    /// - `connection_string`: The connection string identifying the status.
1571    /// - `initial_value`: The initial value of the status.
1572    ///
1573    /// Calls the openDAQ C function `daqConnectionStatusContainerPrivate_addConfigurationConnectionStatus()`.
1574    pub fn add_configuration_connection_status(&self, connection_string: &str, initial_value: &Enumeration) -> Result<()> {
1575        let __connection_string = crate::marshal::make_string(connection_string)?;
1576        let __code = unsafe { (crate::sys::api().daqConnectionStatusContainerPrivate_addConfigurationConnectionStatus)(self.as_raw() as *mut _, __connection_string.as_ptr() as *mut _, initial_value.as_raw() as *mut _) };
1577        check(__code, "daqConnectionStatusContainerPrivate_addConfigurationConnectionStatus")?;
1578        Ok(())
1579    }
1580
1581    /// Adds a new streaming connection status with the specified connection string, initial value, and streaming object.
1582    ///
1583    /// # Parameters
1584    /// - `connection_string`: The connection string identifying the status.
1585    /// - `initial_value`: The initial value of the status.
1586    /// - `streaming_object`: The streaming object associated with the status.
1587    ///
1588    /// Calls the openDAQ C function `daqConnectionStatusContainerPrivate_addStreamingConnectionStatus()`.
1589    pub fn add_streaming_connection_status(&self, connection_string: &str, initial_value: &Enumeration, streaming_object: &Streaming) -> Result<()> {
1590        let __connection_string = crate::marshal::make_string(connection_string)?;
1591        let __code = unsafe { (crate::sys::api().daqConnectionStatusContainerPrivate_addStreamingConnectionStatus)(self.as_raw() as *mut _, __connection_string.as_ptr() as *mut _, initial_value.as_raw() as *mut _, streaming_object.as_raw() as *mut _) };
1592        check(__code, "daqConnectionStatusContainerPrivate_addStreamingConnectionStatus")?;
1593        Ok(())
1594    }
1595
1596    /// Removes a streaming connection status associated with the specified connection string.
1597    ///
1598    /// # Parameters
1599    /// - `connection_string`: The connection string identifying the status to remove.
1600    ///
1601    /// Calls the openDAQ C function `daqConnectionStatusContainerPrivate_removeStreamingConnectionStatus()`.
1602    pub fn remove_streaming_connection_status(&self, connection_string: &str) -> Result<()> {
1603        let __connection_string = crate::marshal::make_string(connection_string)?;
1604        let __code = unsafe { (crate::sys::api().daqConnectionStatusContainerPrivate_removeStreamingConnectionStatus)(self.as_raw() as *mut _, __connection_string.as_ptr() as *mut _) };
1605        check(__code, "daqConnectionStatusContainerPrivate_removeStreamingConnectionStatus")?;
1606        Ok(())
1607    }
1608
1609    /// Updates the value of an existing connection status.
1610    ///
1611    /// # Parameters
1612    /// - `connection_string`: The connection string identifying the status to update.
1613    /// - `value`: The new value of the status.
1614    /// - `streaming_object`: The streaming object associated with the connection, used in triggered Core events. Set to nullptr for configuration connections.
1615    ///
1616    /// Calls the openDAQ C function `daqConnectionStatusContainerPrivate_updateConnectionStatus()`.
1617    pub fn update_connection_status(&self, connection_string: &str, value: &Enumeration, streaming_object: &Streaming) -> Result<()> {
1618        let __connection_string = crate::marshal::make_string(connection_string)?;
1619        let __code = unsafe { (crate::sys::api().daqConnectionStatusContainerPrivate_updateConnectionStatus)(self.as_raw() as *mut _, __connection_string.as_ptr() as *mut _, value.as_raw() as *mut _, streaming_object.as_raw() as *mut _) };
1620        check(__code, "daqConnectionStatusContainerPrivate_updateConnectionStatus")?;
1621        Ok(())
1622    }
1623
1624    /// Updates the value of an existing connection status with a message.
1625    ///
1626    /// # Parameters
1627    /// - `connection_string`: The connection string identifying the status to update.
1628    /// - `value`: The new value of the status.
1629    /// - `streaming_object`: The streaming object associated with the connection, used in triggered Core events. Set to nullptr for configuration connections.
1630    /// - `message`: The new message of the connection status. Usually describes last reconnect attempt failure.
1631    ///
1632    /// Calls the openDAQ C function `daqConnectionStatusContainerPrivate_updateConnectionStatusWithMessage()`.
1633    pub fn update_connection_status_with_message(&self, connection_string: &str, value: &Enumeration, streaming_object: &Streaming, message: &str) -> Result<()> {
1634        let __connection_string = crate::marshal::make_string(connection_string)?;
1635        let __message = crate::marshal::make_string(message)?;
1636        let __code = unsafe { (crate::sys::api().daqConnectionStatusContainerPrivate_updateConnectionStatusWithMessage)(self.as_raw() as *mut _, __connection_string.as_ptr() as *mut _, value.as_raw() as *mut _, streaming_object.as_raw() as *mut _, __message.as_ptr() as *mut _) };
1637        check(__code, "daqConnectionStatusContainerPrivate_updateConnectionStatusWithMessage")?;
1638        Ok(())
1639    }
1640
1641}
1642
1643impl DeviceDomain {
1644    /// Calls the openDAQ C function `daqDeviceDomain_createDeviceDomain()`.
1645    pub fn new(tick_resolution: Ratio, origin: &str, unit: &Unit) -> Result<DeviceDomain> {
1646        let __tick_resolution = crate::value::ratio_to_ref(tick_resolution)?;
1647        let __origin = crate::marshal::make_string(origin)?;
1648        let mut __obj: *mut sys::daqDeviceDomain = std::ptr::null_mut();
1649        let __code = unsafe { (crate::sys::api().daqDeviceDomain_createDeviceDomain)(&mut __obj, __tick_resolution.as_ptr() as *mut _, __origin.as_ptr() as *mut _, unit.as_raw() as *mut _) };
1650        check(__code, "daqDeviceDomain_createDeviceDomain")?;
1651        Ok(unsafe { crate::marshal::require_object::<DeviceDomain>(__obj as *mut _, "daqDeviceDomain_createDeviceDomain") }?)
1652    }
1653
1654    /// Calls the openDAQ C function `daqDeviceDomain_createDeviceDomainWithReferenceDomainInfo()`.
1655    pub fn with_reference_domain_info(tick_resolution: Ratio, origin: &str, unit: &Unit, reference_domain_info: &ReferenceDomainInfo) -> Result<DeviceDomain> {
1656        let __tick_resolution = crate::value::ratio_to_ref(tick_resolution)?;
1657        let __origin = crate::marshal::make_string(origin)?;
1658        let mut __obj: *mut sys::daqDeviceDomain = std::ptr::null_mut();
1659        let __code = unsafe { (crate::sys::api().daqDeviceDomain_createDeviceDomainWithReferenceDomainInfo)(&mut __obj, __tick_resolution.as_ptr() as *mut _, __origin.as_ptr() as *mut _, unit.as_raw() as *mut _, reference_domain_info.as_raw() as *mut _) };
1660        check(__code, "daqDeviceDomain_createDeviceDomainWithReferenceDomainInfo")?;
1661        Ok(unsafe { crate::marshal::require_object::<DeviceDomain>(__obj as *mut _, "daqDeviceDomain_createDeviceDomainWithReferenceDomainInfo") }?)
1662    }
1663
1664    /// Gets the device's absolute origin. Most often this is a time epoch in the ISO 8601 format.
1665    ///
1666    /// # Returns
1667    /// - `origin`: The origin.
1668    ///
1669    /// Calls the openDAQ C function `daqDeviceDomain_getOrigin()`.
1670    pub fn origin(&self) -> Result<String> {
1671        let mut __origin: *mut sys::daqString = std::ptr::null_mut();
1672        let __code = unsafe { (crate::sys::api().daqDeviceDomain_getOrigin)(self.as_raw() as *mut _, &mut __origin) };
1673        check(__code, "daqDeviceDomain_getOrigin")?;
1674        Ok(unsafe { crate::marshal::take_string(__origin) })
1675    }
1676
1677    /// Gets the Reference Domain Info.
1678    ///
1679    /// # Returns
1680    /// - `reference_domain_info`: The Reference Domain Info. If set, gives additional information about the reference domain.
1681    ///
1682    /// Calls the openDAQ C function `daqDeviceDomain_getReferenceDomainInfo()`.
1683    pub fn reference_domain_info(&self) -> Result<Option<ReferenceDomainInfo>> {
1684        let mut __reference_domain_info: *mut sys::daqReferenceDomainInfo = std::ptr::null_mut();
1685        let __code = unsafe { (crate::sys::api().daqDeviceDomain_getReferenceDomainInfo)(self.as_raw() as *mut _, &mut __reference_domain_info) };
1686        check(__code, "daqDeviceDomain_getReferenceDomainInfo")?;
1687        Ok(unsafe { crate::marshal::take_object::<ReferenceDomainInfo>(__reference_domain_info as *mut _) })
1688    }
1689
1690    /// Gets domain (usually time) between two consecutive ticks. Resolution is provided in a domain unit.
1691    ///
1692    /// # Returns
1693    /// - `tick_resolution`: The device's resolution.
1694    ///
1695    /// Calls the openDAQ C function `daqDeviceDomain_getTickResolution()`.
1696    pub fn tick_resolution(&self) -> Result<Option<Ratio>> {
1697        let mut __tick_resolution: *mut sys::daqRatio = std::ptr::null_mut();
1698        let __code = unsafe { (crate::sys::api().daqDeviceDomain_getTickResolution)(self.as_raw() as *mut _, &mut __tick_resolution) };
1699        check(__code, "daqDeviceDomain_getTickResolution")?;
1700        Ok(unsafe { crate::value::take_ratio(__tick_resolution, "daqDeviceDomain_getTickResolution") }?)
1701    }
1702
1703    /// Gets the domain unit (eg. seconds, hours, degrees...)
1704    ///
1705    /// # Returns
1706    /// - `unit`: The domain unit.
1707    ///
1708    /// Calls the openDAQ C function `daqDeviceDomain_getUnit()`.
1709    pub fn unit(&self) -> Result<Option<Unit>> {
1710        let mut __unit: *mut sys::daqUnit = std::ptr::null_mut();
1711        let __code = unsafe { (crate::sys::api().daqDeviceDomain_getUnit)(self.as_raw() as *mut _, &mut __unit) };
1712        check(__code, "daqDeviceDomain_getUnit")?;
1713        Ok(unsafe { crate::marshal::take_object::<Unit>(__unit as *mut _) })
1714    }
1715
1716}
1717
1718impl DeviceInfoConfig {
1719    /// Calls the openDAQ C function `daqDeviceInfoConfig_createDeviceInfoConfig()`.
1720    pub fn new(name: &str, connection_string: &str) -> Result<DeviceInfoConfig> {
1721        let __name = crate::marshal::make_string(name)?;
1722        let __connection_string = crate::marshal::make_string(connection_string)?;
1723        let mut __obj: *mut sys::daqDeviceInfoConfig = std::ptr::null_mut();
1724        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_createDeviceInfoConfig)(&mut __obj, __name.as_ptr() as *mut _, __connection_string.as_ptr() as *mut _) };
1725        check(__code, "daqDeviceInfoConfig_createDeviceInfoConfig")?;
1726        Ok(unsafe { crate::marshal::require_object::<DeviceInfoConfig>(__obj as *mut _, "daqDeviceInfoConfig_createDeviceInfoConfig") }?)
1727    }
1728
1729    /// Calls the openDAQ C function `daqDeviceInfoConfig_createDeviceInfoConfigWithCustomSdkVersion()`.
1730    pub fn with_custom_sdk_version(name: &str, connection_string: &str, sdk_version: &str) -> Result<DeviceInfoConfig> {
1731        let __name = crate::marshal::make_string(name)?;
1732        let __connection_string = crate::marshal::make_string(connection_string)?;
1733        let __sdk_version = crate::marshal::make_string(sdk_version)?;
1734        let mut __obj: *mut sys::daqDeviceInfoConfig = std::ptr::null_mut();
1735        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_createDeviceInfoConfigWithCustomSdkVersion)(&mut __obj, __name.as_ptr() as *mut _, __connection_string.as_ptr() as *mut _, __sdk_version.as_ptr() as *mut _) };
1736        check(__code, "daqDeviceInfoConfig_createDeviceInfoConfigWithCustomSdkVersion")?;
1737        Ok(unsafe { crate::marshal::require_object::<DeviceInfoConfig>(__obj as *mut _, "daqDeviceInfoConfig_createDeviceInfoConfigWithCustomSdkVersion") }?)
1738    }
1739
1740    /// Sets the asset ID of the device. Represents a user writable alphanumeric character sequence uniquely identifying a component.
1741    ///
1742    /// # Parameters
1743    /// - `id`: The asset ID of the device. The ID is provided by the integrator or user of the device. It contains typically an identifier in a branch, use case or user specific naming scheme. This could be for example a reference to an electric scheme.
1744    ///
1745    /// Calls the openDAQ C function `daqDeviceInfoConfig_setAssetId()`.
1746    pub fn set_asset_id(&self, id: &str) -> Result<()> {
1747        let __id = crate::marshal::make_string(id)?;
1748        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setAssetId)(self.as_raw() as *mut _, __id.as_ptr() as *mut _) };
1749        check(__code, "daqDeviceInfoConfig_setAssetId")?;
1750        Ok(())
1751    }
1752
1753    /// Sets the string representation of a connection address used to connect to the device.
1754    ///
1755    /// # Parameters
1756    /// - `connection_string`: The string used to connect to the device.
1757    ///
1758    /// Calls the openDAQ C function `daqDeviceInfoConfig_setConnectionString()`.
1759    pub fn set_connection_string(&self, connection_string: &str) -> Result<()> {
1760        let __connection_string = crate::marshal::make_string(connection_string)?;
1761        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setConnectionString)(self.as_raw() as *mut _, __connection_string.as_ptr() as *mut _) };
1762        check(__code, "daqDeviceInfoConfig_setConnectionString")?;
1763        Ok(())
1764    }
1765
1766    /// Sets the purpose of the device. For example "TestMeasurementDevice".
1767    ///
1768    /// # Parameters
1769    /// - `device_class`: The class of the device.
1770    ///
1771    /// Calls the openDAQ C function `daqDeviceInfoConfig_setDeviceClass()`.
1772    pub fn set_device_class(&self, device_class: &str) -> Result<()> {
1773        let __device_class = crate::marshal::make_string(device_class)?;
1774        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setDeviceClass)(self.as_raw() as *mut _, __device_class.as_ptr() as *mut _) };
1775        check(__code, "daqDeviceInfoConfig_setDeviceClass")?;
1776        Ok(())
1777    }
1778
1779    /// Sets the address of the user manual. It may be a pathname in the file system or a URL (Web address)
1780    ///
1781    /// # Parameters
1782    /// - `device_manual`: The manual of the device.
1783    ///
1784    /// Calls the openDAQ C function `daqDeviceInfoConfig_setDeviceManual()`.
1785    pub fn set_device_manual(&self, device_manual: &str) -> Result<()> {
1786        let __device_manual = crate::marshal::make_string(device_manual)?;
1787        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setDeviceManual)(self.as_raw() as *mut _, __device_manual.as_ptr() as *mut _) };
1788        check(__code, "daqDeviceInfoConfig_setDeviceManual")?;
1789        Ok(())
1790    }
1791
1792    /// Sets the revision level of the device.
1793    ///
1794    /// # Parameters
1795    /// - `device_revision`: The device revision level.
1796    ///
1797    /// Calls the openDAQ C function `daqDeviceInfoConfig_setDeviceRevision()`.
1798    pub fn set_device_revision(&self, device_revision: &str) -> Result<()> {
1799        let __device_revision = crate::marshal::make_string(device_revision)?;
1800        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setDeviceRevision)(self.as_raw() as *mut _, __device_revision.as_ptr() as *mut _) };
1801        check(__code, "daqDeviceInfoConfig_setDeviceRevision")?;
1802        Ok(())
1803    }
1804
1805    /// Sets a device type as an object providing type id, name, short description and default device configuration.
1806    ///
1807    /// # Returns
1808    /// - `device_type`: The device type object
1809    ///
1810    /// Calls the openDAQ C function `daqDeviceInfoConfig_setDeviceType()`.
1811    pub fn set_device_type(&self, device_type: &DeviceType) -> Result<()> {
1812        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setDeviceType)(self.as_raw() as *mut _, device_type.as_raw() as *mut _) };
1813        check(__code, "daqDeviceInfoConfig_setDeviceType")?;
1814        Ok(())
1815    }
1816
1817    /// Sets the revision level of the hardware
1818    ///
1819    /// # Parameters
1820    /// - `hardware_revision`: The hardware revision of the device.
1821    ///
1822    /// Calls the openDAQ C function `daqDeviceInfoConfig_setHardwareRevision()`.
1823    pub fn set_hardware_revision(&self, hardware_revision: &str) -> Result<()> {
1824        let __hardware_revision = crate::marshal::make_string(hardware_revision)?;
1825        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setHardwareRevision)(self.as_raw() as *mut _, __hardware_revision.as_ptr() as *mut _) };
1826        check(__code, "daqDeviceInfoConfig_setHardwareRevision")?;
1827        Ok(())
1828    }
1829
1830    /// Sets the location of the device.
1831    ///
1832    /// # Returns
1833    /// - `location`: The location of the device.
1834    ///
1835    /// Calls the openDAQ C function `daqDeviceInfoConfig_setLocation()`.
1836    pub fn set_location(&self, location: &str) -> Result<()> {
1837        let __location = crate::marshal::make_string(location)?;
1838        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setLocation)(self.as_raw() as *mut _, __location.as_ptr() as *mut _) };
1839        check(__code, "daqDeviceInfoConfig_setLocation")?;
1840        Ok(())
1841    }
1842
1843    /// Sets the Mac address of the device.
1844    ///
1845    /// # Parameters
1846    /// - `mac_address`: The Mac address.
1847    ///
1848    /// Calls the openDAQ C function `daqDeviceInfoConfig_setMacAddress()`.
1849    pub fn set_mac_address(&self, mac_address: &str) -> Result<()> {
1850        let __mac_address = crate::marshal::make_string(mac_address)?;
1851        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setMacAddress)(self.as_raw() as *mut _, __mac_address.as_ptr() as *mut _) };
1852        check(__code, "daqDeviceInfoConfig_setMacAddress")?;
1853        Ok(())
1854    }
1855
1856    /// Sets the company that manufactured the device
1857    ///
1858    /// # Parameters
1859    /// - `manufacturer`: The manufacturer of the device.
1860    ///
1861    /// Calls the openDAQ C function `daqDeviceInfoConfig_setManufacturer()`.
1862    pub fn set_manufacturer(&self, manufacturer: &str) -> Result<()> {
1863        let __manufacturer = crate::marshal::make_string(manufacturer)?;
1864        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setManufacturer)(self.as_raw() as *mut _, __manufacturer.as_ptr() as *mut _) };
1865        check(__code, "daqDeviceInfoConfig_setManufacturer")?;
1866        Ok(())
1867    }
1868
1869    /// Sets the unique identifier of the company that manufactured the device. This identifier should be a fully qualified domain name; however, it may be a GUID or similar construct that ensures global uniqueness.
1870    ///
1871    /// # Parameters
1872    /// - `manufacturer_uri`: The manufacturer uri of the device.
1873    ///
1874    /// Calls the openDAQ C function `daqDeviceInfoConfig_setManufacturerUri()`.
1875    pub fn set_manufacturer_uri(&self, manufacturer_uri: &str) -> Result<()> {
1876        let __manufacturer_uri = crate::marshal::make_string(manufacturer_uri)?;
1877        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setManufacturerUri)(self.as_raw() as *mut _, __manufacturer_uri.as_ptr() as *mut _) };
1878        check(__code, "daqDeviceInfoConfig_setManufacturerUri")?;
1879        Ok(())
1880    }
1881
1882    /// Sets the model of the device
1883    ///
1884    /// # Parameters
1885    /// - `model`: The model of the device.
1886    ///
1887    /// Calls the openDAQ C function `daqDeviceInfoConfig_setModel()`.
1888    pub fn set_model(&self, model: &str) -> Result<()> {
1889        let __model = crate::marshal::make_string(model)?;
1890        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setModel)(self.as_raw() as *mut _, __model.as_ptr() as *mut _) };
1891        check(__code, "daqDeviceInfoConfig_setModel")?;
1892        Ok(())
1893    }
1894
1895    /// Sets the name of the device
1896    ///
1897    /// # Parameters
1898    /// - `name`: The name of the device.
1899    ///
1900    /// Calls the openDAQ C function `daqDeviceInfoConfig_setName()`.
1901    pub fn set_name(&self, name: &str) -> Result<()> {
1902        let __name = crate::marshal::make_string(name)?;
1903        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setName)(self.as_raw() as *mut _, __name.as_ptr() as *mut _) };
1904        check(__code, "daqDeviceInfoConfig_setName")?;
1905        Ok(())
1906    }
1907
1908    /// Sets the Mac address of the device's parent.
1909    ///
1910    /// # Parameters
1911    /// - `mac_address`: The parent's Mac address.
1912    ///
1913    /// Calls the openDAQ C function `daqDeviceInfoConfig_setParentMacAddress()`.
1914    pub fn set_parent_mac_address(&self, mac_address: &str) -> Result<()> {
1915        let __mac_address = crate::marshal::make_string(mac_address)?;
1916        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setParentMacAddress)(self.as_raw() as *mut _, __mac_address.as_ptr() as *mut _) };
1917        check(__code, "daqDeviceInfoConfig_setParentMacAddress")?;
1918        Ok(())
1919    }
1920
1921    /// Sets the platform of the device. The platform specifies whether real hardware is used or if the device is simulated.
1922    ///
1923    /// # Parameters
1924    /// - `platform`: The platform of the device.
1925    ///
1926    /// Calls the openDAQ C function `daqDeviceInfoConfig_setPlatform()`.
1927    pub fn set_platform(&self, platform: &str) -> Result<()> {
1928        let __platform = crate::marshal::make_string(platform)?;
1929        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setPlatform)(self.as_raw() as *mut _, __platform.as_ptr() as *mut _) };
1930        check(__code, "daqDeviceInfoConfig_setPlatform")?;
1931        Ok(())
1932    }
1933
1934    /// Sets the position of the device. The position specifies the position within a given system. For example in which slot or slice the device is in.
1935    ///
1936    /// # Parameters
1937    /// - `position`: The position of the device.
1938    ///
1939    /// Calls the openDAQ C function `daqDeviceInfoConfig_setPosition()`.
1940    pub fn set_position(&self, position: i64) -> Result<()> {
1941        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setPosition)(self.as_raw() as *mut _, position) };
1942        check(__code, "daqDeviceInfoConfig_setPosition")?;
1943        Ok(())
1944    }
1945
1946    /// Sets the unique combination of numbers and letters used to identify the device.
1947    ///
1948    /// # Parameters
1949    /// - `product_code`: The product code of the device.
1950    ///
1951    /// Calls the openDAQ C function `daqDeviceInfoConfig_setProductCode()`.
1952    pub fn set_product_code(&self, product_code: &str) -> Result<()> {
1953        let __product_code = crate::marshal::make_string(product_code)?;
1954        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setProductCode)(self.as_raw() as *mut _, __product_code.as_ptr() as *mut _) };
1955        check(__code, "daqDeviceInfoConfig_setProductCode")?;
1956        Ok(())
1957    }
1958
1959    /// Sets the globally unique resource identifier provided by the manufacturer. The recommended syntax of the ProductInstanceUri is: \<ManufacturerUri\>/\<any string\> where \<any string\> is unique among all instances using the same ManufacturerUri.
1960    ///
1961    /// # Parameters
1962    /// - `product_instance_uri`: The product instance uri of the device.
1963    ///
1964    /// Calls the openDAQ C function `daqDeviceInfoConfig_setProductInstanceUri()`.
1965    pub fn set_product_instance_uri(&self, product_instance_uri: &str) -> Result<()> {
1966        let __product_instance_uri = crate::marshal::make_string(product_instance_uri)?;
1967        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setProductInstanceUri)(self.as_raw() as *mut _, __product_instance_uri.as_ptr() as *mut _) };
1968        check(__code, "daqDeviceInfoConfig_setProductInstanceUri")?;
1969        Ok(())
1970    }
1971
1972    /// Sets the incremental counter indicating the number of times the configuration data has been modified.
1973    ///
1974    /// # Parameters
1975    /// - `revision_counter`: The revision counter of the device.
1976    ///
1977    /// Calls the openDAQ C function `daqDeviceInfoConfig_setRevisionCounter()`.
1978    pub fn set_revision_counter(&self, revision_counter: i64) -> Result<()> {
1979        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setRevisionCounter)(self.as_raw() as *mut _, revision_counter) };
1980        check(__code, "daqDeviceInfoConfig_setRevisionCounter")?;
1981        Ok(())
1982    }
1983
1984    /// Sets the serial number of the device
1985    ///
1986    /// # Parameters
1987    /// - `serial_number`: The serial number of the device.
1988    ///
1989    /// Calls the openDAQ C function `daqDeviceInfoConfig_setSerialNumber()`.
1990    pub fn set_serial_number(&self, serial_number: &str) -> Result<()> {
1991        let __serial_number = crate::marshal::make_string(serial_number)?;
1992        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setSerialNumber)(self.as_raw() as *mut _, __serial_number.as_ptr() as *mut _) };
1993        check(__code, "daqDeviceInfoConfig_setSerialNumber")?;
1994        Ok(())
1995    }
1996
1997    /// sets the revision level of the software component
1998    ///
1999    /// # Parameters
2000    /// - `software_revision`: The software revision of the device.
2001    ///
2002    /// Calls the openDAQ C function `daqDeviceInfoConfig_setSoftwareRevision()`.
2003    pub fn set_software_revision(&self, software_revision: &str) -> Result<()> {
2004        let __software_revision = crate::marshal::make_string(software_revision)?;
2005        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setSoftwareRevision)(self.as_raw() as *mut _, __software_revision.as_ptr() as *mut _) };
2006        check(__code, "daqDeviceInfoConfig_setSoftwareRevision")?;
2007        Ok(())
2008    }
2009
2010    /// Sets the system type. The system type can, for example, be LayeredSystem, StandaloneSystem, or RackSystem.
2011    ///
2012    /// # Parameters
2013    /// - `type`: The system type of the device.
2014    ///
2015    /// Calls the openDAQ C function `daqDeviceInfoConfig_setSystemType()`.
2016    pub fn set_system_type(&self, type_: &str) -> Result<()> {
2017        let __type_ = crate::marshal::make_string(type_)?;
2018        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setSystemType)(self.as_raw() as *mut _, __type_.as_ptr() as *mut _) };
2019        check(__code, "daqDeviceInfoConfig_setSystemType")?;
2020        Ok(())
2021    }
2022
2023    /// Sets the system UUID that represents a unique ID of a system. All devices in a system share this UUID.
2024    ///
2025    /// # Parameters
2026    /// - `uuid`: The unique ID of a system.
2027    ///
2028    /// Calls the openDAQ C function `daqDeviceInfoConfig_setSystemUuid()`.
2029    pub fn set_system_uuid(&self, uuid: &str) -> Result<()> {
2030        let __uuid = crate::marshal::make_string(uuid)?;
2031        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setSystemUuid)(self.as_raw() as *mut _, __uuid.as_ptr() as *mut _) };
2032        check(__code, "daqDeviceInfoConfig_setSystemUuid")?;
2033        Ok(())
2034    }
2035
2036    /// Sets the name of the current user of the device.
2037    ///
2038    /// # Returns
2039    /// - `user_name`: The location of the device. If the info object is obtained from a device that is already added (not through discovery), the username string value matches that of the device's "userName" property.
2040    ///
2041    /// Calls the openDAQ C function `daqDeviceInfoConfig_setUserName()`.
2042    pub fn set_user_name(&self, user_name: &str) -> Result<()> {
2043        let __user_name = crate::marshal::make_string(user_name)?;
2044        let __code = unsafe { (crate::sys::api().daqDeviceInfoConfig_setUserName)(self.as_raw() as *mut _, __user_name.as_ptr() as *mut _) };
2045        check(__code, "daqDeviceInfoConfig_setUserName")?;
2046        Ok(())
2047    }
2048
2049}
2050
2051impl DeviceInfoInternal {
2052    /// Registers a newly connected client or re-registers a reconnected client.
2053    ///
2054    /// # Parameters
2055    /// - `client_number`: If provided, represents the original ordinal number of the re-registered client. If unassigned or exceeding the total number of clients ever registered (including those that were later deregistered), it is set to the incremented total count; otherwise, the client is registered under the specified number.
2056    /// - `client_info`: The connected client information object.
2057    ///
2058    /// # Returns
2059    /// OPENDAQ_ERR_ALREADYEXISTS if a client with the specified number already registered.
2060    ///
2061    /// Calls the openDAQ C function `daqDeviceInfoInternal_addConnectedClient()`.
2062    pub fn add_connected_client(&self, client_info: &ConnectedClientInfo) -> Result<usize> {
2063        let mut __client_number: usize = Default::default();
2064        let __code = unsafe { (crate::sys::api().daqDeviceInfoInternal_addConnectedClient)(self.as_raw() as *mut _, &mut __client_number, client_info.as_raw() as *mut _) };
2065        check(__code, "daqDeviceInfoInternal_addConnectedClient")?;
2066        Ok(__client_number)
2067    }
2068
2069    /// Adds a network interface to the dictionary of available interfaces.
2070    ///
2071    /// # Parameters
2072    /// - `network_interface`: The available interface to add.
2073    /// - `name`: The name of available interface to add. The provided name should be unique within the device info as used as the key in the dictionary of available interfaces.
2074    ///
2075    /// Calls the openDAQ C function `daqDeviceInfoInternal_addNetworkInteface()`.
2076    pub fn add_network_inteface(&self, name: &str, network_interface: &NetworkInterface) -> Result<()> {
2077        let __name = crate::marshal::make_string(name)?;
2078        let __code = unsafe { (crate::sys::api().daqDeviceInfoInternal_addNetworkInteface)(self.as_raw() as *mut _, __name.as_ptr() as *mut _, network_interface.as_raw() as *mut _) };
2079        check(__code, "daqDeviceInfoInternal_addNetworkInteface")?;
2080        Ok(())
2081    }
2082
2083    /// Adds a protocol to the list of supported capabilities.
2084    ///
2085    /// # Parameters
2086    /// - `server_capability`: The supported protocol to add.
2087    ///
2088    /// Calls the openDAQ C function `daqDeviceInfoInternal_addServerCapability()`.
2089    pub fn add_server_capability(&self, server_capability: &ServerCapability) -> Result<()> {
2090        let __code = unsafe { (crate::sys::api().daqDeviceInfoInternal_addServerCapability)(self.as_raw() as *mut _, server_capability.as_raw() as *mut _) };
2091        check(__code, "daqDeviceInfoInternal_addServerCapability")?;
2092        Ok(())
2093    }
2094
2095    /// Removes all server streaming capabilities from the list of supported capabilities.
2096    ///
2097    /// Calls the openDAQ C function `daqDeviceInfoInternal_clearServerStreamingCapabilities()`.
2098    pub fn clear_server_streaming_capabilities(&self) -> Result<()> {
2099        let __code = unsafe { (crate::sys::api().daqDeviceInfoInternal_clearServerStreamingCapabilities)(self.as_raw() as *mut _) };
2100        check(__code, "daqDeviceInfoInternal_clearServerStreamingCapabilities")?;
2101        Ok(())
2102    }
2103
2104    /// Unregisters a previously connected client upon disconnection.
2105    ///
2106    /// # Parameters
2107    /// - `client_number`: The number identifying the disconnected client.
2108    ///
2109    /// Calls the openDAQ C function `daqDeviceInfoInternal_removeConnectedClient()`.
2110    pub fn remove_connected_client(&self, client_number: usize) -> Result<()> {
2111        let __code = unsafe { (crate::sys::api().daqDeviceInfoInternal_removeConnectedClient)(self.as_raw() as *mut _, client_number) };
2112        check(__code, "daqDeviceInfoInternal_removeConnectedClient")?;
2113        Ok(())
2114    }
2115
2116    /// Removes a protocol from the list of supported capabilities.
2117    ///
2118    /// # Parameters
2119    /// - `protocol_id`: The ID of the protocol to remove.
2120    ///
2121    /// Calls the openDAQ C function `daqDeviceInfoInternal_removeServerCapability()`.
2122    pub fn remove_server_capability(&self, protocol_id: &str) -> Result<()> {
2123        let __protocol_id = crate::marshal::make_string(protocol_id)?;
2124        let __code = unsafe { (crate::sys::api().daqDeviceInfoInternal_removeServerCapability)(self.as_raw() as *mut _, __protocol_id.as_ptr() as *mut _) };
2125        check(__code, "daqDeviceInfoInternal_removeServerCapability")?;
2126        Ok(())
2127    }
2128
2129}
2130
2131impl DeviceInfo {
2132    /// Gets the asset ID of the device. Represents a user writable alphanumeric character sequence uniquely identifying a component.
2133    ///
2134    /// # Returns
2135    /// - `id`: The asset ID of the device. The ID is provided by the integrator or user of the device. It contains typically an identifier in a branch, use case or user specific naming scheme. This could be for example a reference to an electric scheme. The ID must be a string representation of an Int32 number.
2136    ///
2137    /// Calls the openDAQ C function `daqDeviceInfo_getAssetId()`.
2138    pub fn asset_id(&self) -> Result<String> {
2139        let mut __id: *mut sys::daqString = std::ptr::null_mut();
2140        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getAssetId)(self.as_raw() as *mut _, &mut __id) };
2141        check(__code, "daqDeviceInfo_getAssetId")?;
2142        Ok(unsafe { crate::marshal::take_string(__id) })
2143    }
2144
2145    /// Retrieves the configuration connection information of the server to which the client is connected.
2146    ///
2147    /// # Returns
2148    /// - `connection_info`: The server capability with the configuration connection information. This method returns the configuration connection information of the server to which the client is connected. If the connection to the server is not established, the fields of the server capability object are empty.
2149    ///
2150    /// Calls the openDAQ C function `daqDeviceInfo_getConfigurationConnectionInfo()`.
2151    pub fn configuration_connection_info(&self) -> Result<Option<ServerCapability>> {
2152        let mut __connection_info: *mut sys::daqServerCapability = std::ptr::null_mut();
2153        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getConfigurationConnectionInfo)(self.as_raw() as *mut _, &mut __connection_info) };
2154        check(__code, "daqDeviceInfo_getConfigurationConnectionInfo")?;
2155        Ok(unsafe { crate::marshal::take_object::<ServerCapability>(__connection_info as *mut _) })
2156    }
2157
2158    /// Gets the list of connected client information objects.
2159    ///
2160    /// # Returns
2161    /// - `connected_clients_info`: The list of connected client information objects.
2162    ///
2163    /// Calls the openDAQ C function `daqDeviceInfo_getConnectedClientsInfo()`.
2164    pub fn connected_clients_info(&self) -> Result<Vec<ConnectedClientInfo>> {
2165        let mut __connected_clients_info: *mut sys::daqList = std::ptr::null_mut();
2166        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getConnectedClientsInfo)(self.as_raw() as *mut _, &mut __connected_clients_info) };
2167        check(__code, "daqDeviceInfo_getConnectedClientsInfo")?;
2168        Ok(unsafe { crate::marshal::take_list::<ConnectedClientInfo>(__connected_clients_info as *mut _, "daqDeviceInfo_getConnectedClientsInfo") }?)
2169    }
2170
2171    /// Gets the string representation of a connection address used to connect to the device.
2172    ///
2173    /// # Returns
2174    /// - `connection_string`: The string used to connect to the device.
2175    ///
2176    /// Calls the openDAQ C function `daqDeviceInfo_getConnectionString()`.
2177    pub fn connection_string(&self) -> Result<String> {
2178        let mut __connection_string: *mut sys::daqString = std::ptr::null_mut();
2179        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getConnectionString)(self.as_raw() as *mut _, &mut __connection_string) };
2180        check(__code, "daqDeviceInfo_getConnectionString")?;
2181        Ok(unsafe { crate::marshal::take_string(__connection_string) })
2182    }
2183
2184    /// Gets the list of property names that are not in the default set of Device info properties. Default properties are all info properties that have a corresponding getter method.
2185    ///
2186    /// # Returns
2187    /// - `custom_info_names`: The list of names of custom properties.
2188    ///
2189    /// Calls the openDAQ C function `daqDeviceInfo_getCustomInfoPropertyNames()`.
2190    pub fn custom_info_property_names(&self) -> Result<Vec<String>> {
2191        let mut __custom_info_names: *mut sys::daqList = std::ptr::null_mut();
2192        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getCustomInfoPropertyNames)(self.as_raw() as *mut _, &mut __custom_info_names) };
2193        check(__code, "daqDeviceInfo_getCustomInfoPropertyNames")?;
2194        Ok(unsafe { crate::marshal::take_list::<String>(__custom_info_names as *mut _, "daqDeviceInfo_getCustomInfoPropertyNames") }?)
2195    }
2196
2197    /// Gets the purpose of the device. For example "TestMeasurementDevice".
2198    ///
2199    /// # Returns
2200    /// - `device_class`: The class of the device.
2201    ///
2202    /// Calls the openDAQ C function `daqDeviceInfo_getDeviceClass()`.
2203    pub fn device_class(&self) -> Result<String> {
2204        let mut __device_class: *mut sys::daqString = std::ptr::null_mut();
2205        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getDeviceClass)(self.as_raw() as *mut _, &mut __device_class) };
2206        check(__code, "daqDeviceInfo_getDeviceClass")?;
2207        Ok(unsafe { crate::marshal::take_string(__device_class) })
2208    }
2209
2210    /// Gets the address of the user manual. It may be a pathname in the file system or a URL (Web address)
2211    ///
2212    /// # Returns
2213    /// - `device_manual`: The manual of the device.
2214    ///
2215    /// Calls the openDAQ C function `daqDeviceInfo_getDeviceManual()`.
2216    pub fn device_manual(&self) -> Result<String> {
2217        let mut __device_manual: *mut sys::daqString = std::ptr::null_mut();
2218        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getDeviceManual)(self.as_raw() as *mut _, &mut __device_manual) };
2219        check(__code, "daqDeviceInfo_getDeviceManual")?;
2220        Ok(unsafe { crate::marshal::take_string(__device_manual) })
2221    }
2222
2223    /// Gets the revision level of the device.
2224    ///
2225    /// # Returns
2226    /// - `device_revision`: The device revision level.
2227    ///
2228    /// Calls the openDAQ C function `daqDeviceInfo_getDeviceRevision()`.
2229    pub fn device_revision(&self) -> Result<String> {
2230        let mut __device_revision: *mut sys::daqString = std::ptr::null_mut();
2231        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getDeviceRevision)(self.as_raw() as *mut _, &mut __device_revision) };
2232        check(__code, "daqDeviceInfo_getDeviceRevision")?;
2233        Ok(unsafe { crate::marshal::take_string(__device_revision) })
2234    }
2235
2236    /// Gets a device type as an object providing type id, name, short description and default device configuration. By using default config object as a starting point, users can easily modify the preset properties to tailor the configuration of the client device accordingly.
2237    ///
2238    /// # Returns
2239    /// - `device_type`: The device type object
2240    ///
2241    /// Calls the openDAQ C function `daqDeviceInfo_getDeviceType()`.
2242    pub fn device_type(&self) -> Result<Option<DeviceType>> {
2243        let mut __device_type: *mut sys::daqDeviceType = std::ptr::null_mut();
2244        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getDeviceType)(self.as_raw() as *mut _, &mut __device_type) };
2245        check(__code, "daqDeviceInfo_getDeviceType")?;
2246        Ok(unsafe { crate::marshal::take_object::<DeviceType>(__device_type as *mut _) })
2247    }
2248
2249    /// Gets the revision level of the hardware.
2250    ///
2251    /// # Returns
2252    /// - `hardware_revision`: The hardware revision of the device.
2253    ///
2254    /// Calls the openDAQ C function `daqDeviceInfo_getHardwareRevision()`.
2255    pub fn hardware_revision(&self) -> Result<String> {
2256        let mut __hardware_revision: *mut sys::daqString = std::ptr::null_mut();
2257        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getHardwareRevision)(self.as_raw() as *mut _, &mut __hardware_revision) };
2258        check(__code, "daqDeviceInfo_getHardwareRevision")?;
2259        Ok(unsafe { crate::marshal::take_string(__hardware_revision) })
2260    }
2261
2262    /// Gets the location of the device.
2263    ///
2264    /// # Returns
2265    /// - `location`: The location of the device. If the info object is obtained from a device that is already added (not through discovery), the location string value matches that of the device's "location" property.
2266    ///
2267    /// Calls the openDAQ C function `daqDeviceInfo_getLocation()`.
2268    pub fn location(&self) -> Result<String> {
2269        let mut __location: *mut sys::daqString = std::ptr::null_mut();
2270        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getLocation)(self.as_raw() as *mut _, &mut __location) };
2271        check(__code, "daqDeviceInfo_getLocation")?;
2272        Ok(unsafe { crate::marshal::take_string(__location) })
2273    }
2274
2275    /// Gets the Mac address of the device.
2276    ///
2277    /// # Returns
2278    /// - `mac_address`: The Mac address.
2279    ///
2280    /// Calls the openDAQ C function `daqDeviceInfo_getMacAddress()`.
2281    pub fn mac_address(&self) -> Result<String> {
2282        let mut __mac_address: *mut sys::daqString = std::ptr::null_mut();
2283        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getMacAddress)(self.as_raw() as *mut _, &mut __mac_address) };
2284        check(__code, "daqDeviceInfo_getMacAddress")?;
2285        Ok(unsafe { crate::marshal::take_string(__mac_address) })
2286    }
2287
2288    /// Gets the company that manufactured the device
2289    ///
2290    /// # Returns
2291    /// - `manufacturer`: The manufacturer of the device.
2292    ///
2293    /// Calls the openDAQ C function `daqDeviceInfo_getManufacturer()`.
2294    pub fn manufacturer(&self) -> Result<String> {
2295        let mut __manufacturer: *mut sys::daqString = std::ptr::null_mut();
2296        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getManufacturer)(self.as_raw() as *mut _, &mut __manufacturer) };
2297        check(__code, "daqDeviceInfo_getManufacturer")?;
2298        Ok(unsafe { crate::marshal::take_string(__manufacturer) })
2299    }
2300
2301    /// Gets the unique identifier of the company that manufactured the device This identifier should be a fully qualified domain name; however, it may be a GUID or similar construct that ensures global uniqueness.
2302    ///
2303    /// # Returns
2304    /// - `manufacturer_uri`: The manufacturer uri of the device.
2305    ///
2306    /// Calls the openDAQ C function `daqDeviceInfo_getManufacturerUri()`.
2307    pub fn manufacturer_uri(&self) -> Result<String> {
2308        let mut __manufacturer_uri: *mut sys::daqString = std::ptr::null_mut();
2309        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getManufacturerUri)(self.as_raw() as *mut _, &mut __manufacturer_uri) };
2310        check(__code, "daqDeviceInfo_getManufacturerUri")?;
2311        Ok(unsafe { crate::marshal::take_string(__manufacturer_uri) })
2312    }
2313
2314    /// Gets the model of the device
2315    ///
2316    /// # Returns
2317    /// - `model`: The model of the device.
2318    ///
2319    /// Calls the openDAQ C function `daqDeviceInfo_getModel()`.
2320    pub fn model(&self) -> Result<String> {
2321        let mut __model: *mut sys::daqString = std::ptr::null_mut();
2322        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getModel)(self.as_raw() as *mut _, &mut __model) };
2323        check(__code, "daqDeviceInfo_getModel")?;
2324        Ok(unsafe { crate::marshal::take_string(__model) })
2325    }
2326
2327    /// Gets the name of the device
2328    ///
2329    /// # Returns
2330    /// - `name`: The name of the device. If the info object is obtained from a device that is already added (not through discovery), the name string value matches that of the device's "Name" attribute.
2331    ///
2332    /// Calls the openDAQ C function `daqDeviceInfo_getName()`.
2333    pub fn name(&self) -> Result<String> {
2334        let mut __name: *mut sys::daqString = std::ptr::null_mut();
2335        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getName)(self.as_raw() as *mut _, &mut __name) };
2336        check(__code, "daqDeviceInfo_getName")?;
2337        Ok(unsafe { crate::marshal::take_string(__name) })
2338    }
2339
2340    /// Gets the network interface with a given name.
2341    ///
2342    /// # Parameters
2343    /// - `interface_name`: The name of the device network interface.
2344    ///
2345    /// # Returns
2346    /// - `intf`: The device network interface with the given name.
2347    ///
2348    /// # Errors
2349    /// - `OPENDAQ_ERR_NOTFOUND`: if the network interface with the given name is not available.
2350    ///
2351    /// Calls the openDAQ C function `daqDeviceInfo_getNetworkInterface()`.
2352    pub fn network_interface(&self, interface_name: &str) -> Result<Option<NetworkInterface>> {
2353        let __interface_name = crate::marshal::make_string(interface_name)?;
2354        let mut __intf: *mut sys::daqNetworkInterface = std::ptr::null_mut();
2355        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getNetworkInterface)(self.as_raw() as *mut _, __interface_name.as_ptr() as *mut _, &mut __intf) };
2356        check(__code, "daqDeviceInfo_getNetworkInterface")?;
2357        Ok(unsafe { crate::marshal::take_object::<NetworkInterface>(__intf as *mut _) })
2358    }
2359
2360    /// Gets the dictionary of network interfaces stored in device info.
2361    ///
2362    /// # Returns
2363    /// - `interfaces`: The dictionary of device network interfaces. Obtained dictionary contains INetworkInterface objects, representing the available network interfaces and allowing to manage their configurations. The dictionary key corresponds to interface identifier (e.g. "eth0").
2364    ///
2365    /// Calls the openDAQ C function `daqDeviceInfo_getNetworkInterfaces()`.
2366    pub fn network_interfaces(&self) -> Result<std::collections::HashMap<String, NetworkInterface>> {
2367        let mut __interfaces: *mut sys::daqDict = std::ptr::null_mut();
2368        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getNetworkInterfaces)(self.as_raw() as *mut _, &mut __interfaces) };
2369        check(__code, "daqDeviceInfo_getNetworkInterfaces")?;
2370        Ok(unsafe { crate::marshal::take_dict::<String, NetworkInterface>(__interfaces as *mut _, "daqDeviceInfo_getNetworkInterfaces") }?)
2371    }
2372
2373    /// Gets the Mac address of the device's parent.
2374    ///
2375    /// # Returns
2376    /// - `mac_address`: The parent's Mac address.
2377    ///
2378    /// Calls the openDAQ C function `daqDeviceInfo_getParentMacAddress()`.
2379    pub fn parent_mac_address(&self) -> Result<String> {
2380        let mut __mac_address: *mut sys::daqString = std::ptr::null_mut();
2381        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getParentMacAddress)(self.as_raw() as *mut _, &mut __mac_address) };
2382        check(__code, "daqDeviceInfo_getParentMacAddress")?;
2383        Ok(unsafe { crate::marshal::take_string(__mac_address) })
2384    }
2385
2386    /// Gets the platform of the device. The platform specifies whether real hardware is used or if the device is simulated.
2387    ///
2388    /// # Returns
2389    /// - `platform`: The platform of the device.
2390    ///
2391    /// Calls the openDAQ C function `daqDeviceInfo_getPlatform()`.
2392    pub fn platform(&self) -> Result<String> {
2393        let mut __platform: *mut sys::daqString = std::ptr::null_mut();
2394        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getPlatform)(self.as_raw() as *mut _, &mut __platform) };
2395        check(__code, "daqDeviceInfo_getPlatform")?;
2396        Ok(unsafe { crate::marshal::take_string(__platform) })
2397    }
2398
2399    /// Gets the position of the device. The position specifies the position within a given system. For example in which slot or slice the device is in.
2400    ///
2401    /// # Returns
2402    /// - `position`: The position of the device. The Position should be a positive integer in the range supported by the UInt16 data type.
2403    ///
2404    /// Calls the openDAQ C function `daqDeviceInfo_getPosition()`.
2405    pub fn position(&self) -> Result<i64> {
2406        let mut __position: i64 = Default::default();
2407        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getPosition)(self.as_raw() as *mut _, &mut __position) };
2408        check(__code, "daqDeviceInfo_getPosition")?;
2409        Ok(__position)
2410    }
2411
2412    /// Gets the unique combination of numbers and letters used to identify the device.
2413    ///
2414    /// # Returns
2415    /// - `product_code`: The product code of the device.
2416    ///
2417    /// Calls the openDAQ C function `daqDeviceInfo_getProductCode()`.
2418    pub fn product_code(&self) -> Result<String> {
2419        let mut __product_code: *mut sys::daqString = std::ptr::null_mut();
2420        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getProductCode)(self.as_raw() as *mut _, &mut __product_code) };
2421        check(__code, "daqDeviceInfo_getProductCode")?;
2422        Ok(unsafe { crate::marshal::take_string(__product_code) })
2423    }
2424
2425    /// Gets the globally unique resource identifier provided by the manufacturer. The recommended syntax of the ProductInstanceUri is: \<ManufacturerUri\>/\<any string\> where \<any string\> is unique among all instances using the same ManufacturerUri.
2426    ///
2427    /// # Returns
2428    /// - `product_instance_uri`: The product instance uri of the device.
2429    ///
2430    /// Calls the openDAQ C function `daqDeviceInfo_getProductInstanceUri()`.
2431    pub fn product_instance_uri(&self) -> Result<String> {
2432        let mut __product_instance_uri: *mut sys::daqString = std::ptr::null_mut();
2433        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getProductInstanceUri)(self.as_raw() as *mut _, &mut __product_instance_uri) };
2434        check(__code, "daqDeviceInfo_getProductInstanceUri")?;
2435        Ok(unsafe { crate::marshal::take_string(__product_instance_uri) })
2436    }
2437
2438    /// Gets the incremental counter indicating the number of times the configuration data has been modified.
2439    ///
2440    /// # Returns
2441    /// - `revision_counter`: The revision counter of the device.
2442    ///
2443    /// Calls the openDAQ C function `daqDeviceInfo_getRevisionCounter()`.
2444    pub fn revision_counter(&self) -> Result<i64> {
2445        let mut __revision_counter: i64 = Default::default();
2446        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getRevisionCounter)(self.as_raw() as *mut _, &mut __revision_counter) };
2447        check(__code, "daqDeviceInfo_getRevisionCounter")?;
2448        Ok(__revision_counter)
2449    }
2450
2451    /// Gets the version of the SDK used to build said device. Can be empty if the device does not use the SDK as its firmware/is implemented at a protocol-level.
2452    ///
2453    /// # Returns
2454    /// - `version`: The SDK version.
2455    ///
2456    /// Calls the openDAQ C function `daqDeviceInfo_getSdkVersion()`.
2457    pub fn sdk_version(&self) -> Result<String> {
2458        let mut __version: *mut sys::daqString = std::ptr::null_mut();
2459        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getSdkVersion)(self.as_raw() as *mut _, &mut __version) };
2460        check(__code, "daqDeviceInfo_getSdkVersion")?;
2461        Ok(unsafe { crate::marshal::take_string(__version) })
2462    }
2463
2464    /// Gets the unique production number provided by the manufacturer
2465    ///
2466    /// # Returns
2467    /// - `serial_number`: The serial number of the device.
2468    ///
2469    /// Calls the openDAQ C function `daqDeviceInfo_getSerialNumber()`.
2470    pub fn serial_number(&self) -> Result<String> {
2471        let mut __serial_number: *mut sys::daqString = std::ptr::null_mut();
2472        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getSerialNumber)(self.as_raw() as *mut _, &mut __serial_number) };
2473        check(__code, "daqDeviceInfo_getSerialNumber")?;
2474        Ok(unsafe { crate::marshal::take_string(__serial_number) })
2475    }
2476
2477    /// Gets the list of server capabilities stored in device info.
2478    ///
2479    /// # Returns
2480    /// - `server_capabilities`: The list of device supported protocols (List containing IServerCapability objects, representing the supported protocols along with their properties).
2481    ///
2482    /// Calls the openDAQ C function `daqDeviceInfo_getServerCapabilities()`.
2483    pub fn server_capabilities(&self) -> Result<Vec<ServerCapability>> {
2484        let mut __server_capabilities: *mut sys::daqList = std::ptr::null_mut();
2485        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getServerCapabilities)(self.as_raw() as *mut _, &mut __server_capabilities) };
2486        check(__code, "daqDeviceInfo_getServerCapabilities")?;
2487        Ok(unsafe { crate::marshal::take_list::<ServerCapability>(__server_capabilities as *mut _, "daqDeviceInfo_getServerCapabilities") }?)
2488    }
2489
2490    /// Gets the server capability with a given ID.
2491    ///
2492    /// # Parameters
2493    /// - `protocol_id`: The ID of the server capability protocol.
2494    ///
2495    /// # Returns
2496    /// - `server_capability`: The server capability with the given ID.
2497    ///
2498    /// # Errors
2499    /// - `OPENDAQ_ERR_NOTFOUND`: if the server capability is not available.
2500    ///
2501    /// Calls the openDAQ C function `daqDeviceInfo_getServerCapability()`.
2502    pub fn server_capability(&self, protocol_id: &str) -> Result<Option<ServerCapability>> {
2503        let __protocol_id = crate::marshal::make_string(protocol_id)?;
2504        let mut __server_capability: *mut sys::daqServerCapability = std::ptr::null_mut();
2505        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getServerCapability)(self.as_raw() as *mut _, __protocol_id.as_ptr() as *mut _, &mut __server_capability) };
2506        check(__code, "daqDeviceInfo_getServerCapability")?;
2507        Ok(unsafe { crate::marshal::take_object::<ServerCapability>(__server_capability as *mut _) })
2508    }
2509
2510    /// Gets the revision level of the software component.
2511    ///
2512    /// # Returns
2513    /// - `software_revision`: The software revision of the device.
2514    ///
2515    /// Calls the openDAQ C function `daqDeviceInfo_getSoftwareRevision()`.
2516    pub fn software_revision(&self) -> Result<String> {
2517        let mut __software_revision: *mut sys::daqString = std::ptr::null_mut();
2518        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getSoftwareRevision)(self.as_raw() as *mut _, &mut __software_revision) };
2519        check(__code, "daqDeviceInfo_getSoftwareRevision")?;
2520        Ok(unsafe { crate::marshal::take_string(__software_revision) })
2521    }
2522
2523    /// Gets the system type. The system type can, for example, be LayeredSystem, StandaloneSystem, or RackSystem.
2524    ///
2525    /// # Returns
2526    /// - `type`: The system type of the device.
2527    ///
2528    /// Calls the openDAQ C function `daqDeviceInfo_getSystemType()`.
2529    pub fn system_type(&self) -> Result<String> {
2530        let mut __type_: *mut sys::daqString = std::ptr::null_mut();
2531        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getSystemType)(self.as_raw() as *mut _, &mut __type_) };
2532        check(__code, "daqDeviceInfo_getSystemType")?;
2533        Ok(unsafe { crate::marshal::take_string(__type_) })
2534    }
2535
2536    /// Gets the system UUID that represents a unique ID of a system. All devices in a system share this UUID.
2537    ///
2538    /// # Returns
2539    /// - `uuid`: The unique ID of a system.
2540    ///
2541    /// Calls the openDAQ C function `daqDeviceInfo_getSystemUuid()`.
2542    pub fn system_uuid(&self) -> Result<String> {
2543        let mut __uuid: *mut sys::daqString = std::ptr::null_mut();
2544        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getSystemUuid)(self.as_raw() as *mut _, &mut __uuid) };
2545        check(__code, "daqDeviceInfo_getSystemUuid")?;
2546        Ok(unsafe { crate::marshal::take_string(__uuid) })
2547    }
2548
2549    /// Gets the name of the current user of the device.
2550    ///
2551    /// # Returns
2552    /// - `user_name`: The name of the current user of the device. If the info object is obtained from a device that is already added (not through discovery), the username string value matches that of the device's "userName" property.
2553    ///
2554    /// Calls the openDAQ C function `daqDeviceInfo_getUserName()`.
2555    pub fn user_name(&self) -> Result<String> {
2556        let mut __user_name: *mut sys::daqString = std::ptr::null_mut();
2557        let __code = unsafe { (crate::sys::api().daqDeviceInfo_getUserName)(self.as_raw() as *mut _, &mut __user_name) };
2558        check(__code, "daqDeviceInfo_getUserName")?;
2559        Ok(unsafe { crate::marshal::take_string(__user_name) })
2560    }
2561
2562    /// Checks whether the server capability with a given ID is available.
2563    ///
2564    /// # Parameters
2565    /// - `protocol_id`: The ID of the server capability protocol.
2566    ///
2567    /// # Returns
2568    /// - `has_capability`: True if the protocol is available; False otherwise.
2569    ///
2570    /// Calls the openDAQ C function `daqDeviceInfo_hasServerCapability()`.
2571    pub fn has_server_capability(&self, protocol_id: &str) -> Result<bool> {
2572        let __protocol_id = crate::marshal::make_string(protocol_id)?;
2573        let mut __has_capability: u8 = 0;
2574        let __code = unsafe { (crate::sys::api().daqDeviceInfo_hasServerCapability)(self.as_raw() as *mut _, __protocol_id.as_ptr() as *mut _, &mut __has_capability) };
2575        check(__code, "daqDeviceInfo_hasServerCapability")?;
2576        Ok(__has_capability != 0)
2577    }
2578
2579}
2580
2581impl DeviceNetworkConfig {
2582    /// Checks if the device supports network configuration management.
2583    ///
2584    /// # Returns
2585    /// - `enabled`: A flag indicating whether the device supports managing network configurations.
2586    ///
2587    /// Calls the openDAQ C function `daqDeviceNetworkConfig_getNetworkConfigurationEnabled()`.
2588    pub fn network_configuration_enabled(&self) -> Result<bool> {
2589        let mut __enabled: u8 = 0;
2590        let __code = unsafe { (crate::sys::api().daqDeviceNetworkConfig_getNetworkConfigurationEnabled)(self.as_raw() as *mut _, &mut __enabled) };
2591        check(__code, "daqDeviceNetworkConfig_getNetworkConfigurationEnabled")?;
2592        Ok(__enabled != 0)
2593    }
2594
2595    /// Gets the names of all configurable network interfaces on the device.
2596    ///
2597    /// # Returns
2598    /// - `iface_names`: A list containing the names of network interface adapters available for configuration.
2599    ///
2600    /// # Errors
2601    /// - `OPENDAQ_ERR_NOTIMPLEMENTED`: if the device does not support network configuration management.
2602    ///
2603    /// Calls the openDAQ C function `daqDeviceNetworkConfig_getNetworkInterfaceNames()`.
2604    pub fn network_interface_names(&self) -> Result<Vec<String>> {
2605        let mut __iface_names: *mut sys::daqList = std::ptr::null_mut();
2606        let __code = unsafe { (crate::sys::api().daqDeviceNetworkConfig_getNetworkInterfaceNames)(self.as_raw() as *mut _, &mut __iface_names) };
2607        check(__code, "daqDeviceNetworkConfig_getNetworkInterfaceNames")?;
2608        Ok(unsafe { crate::marshal::take_list::<String>(__iface_names as *mut _, "daqDeviceNetworkConfig_getNetworkInterfaceNames") }?)
2609    }
2610
2611    /// Retrieves the currently active configuration of a specified network interface.
2612    ///
2613    /// # Parameters
2614    /// - `iface_name`: The name of the network interface adapter as registered in the operating system. Typically, this is a short symbolic identifier for the adapter, e.g. "eth0".
2615    ///
2616    /// # Returns
2617    /// - `config`: The property object containing the active configuration of the network interface.
2618    ///
2619    /// # Errors
2620    /// - `OPENDAQ_ERR_NOTIMPLEMENTED`: if the device does not support retrieving network configurations.
2621    ///
2622    /// Calls the openDAQ C function `daqDeviceNetworkConfig_retrieveNetworkConfiguration()`.
2623    pub fn retrieve_network_configuration(&self, iface_name: &str) -> Result<Option<PropertyObject>> {
2624        let __iface_name = crate::marshal::make_string(iface_name)?;
2625        let mut __config: *mut sys::daqPropertyObject = std::ptr::null_mut();
2626        let __code = unsafe { (crate::sys::api().daqDeviceNetworkConfig_retrieveNetworkConfiguration)(self.as_raw() as *mut _, __iface_name.as_ptr() as *mut _, &mut __config) };
2627        check(__code, "daqDeviceNetworkConfig_retrieveNetworkConfiguration")?;
2628        Ok(unsafe { crate::marshal::take_object::<PropertyObject>(__config as *mut _) })
2629    }
2630
2631    /// Submits a new configuration parameters to a specified network interface.
2632    ///
2633    /// # Parameters
2634    /// - `iface_name`: The name of the network interface adapter as registered in the operating system. Typically, this is a short symbolic identifier for the adapter, e.g. "eth0".
2635    /// - `config`: The property object with new configuration parameters to submit. The format of the properties matches that used in INetworkInterface.
2636    ///
2637    /// # Errors
2638    /// - `OPENDAQ_ERR_NOTIMPLEMENTED`: if the device does not support network configuration management.
2639    ///
2640    /// Calls the openDAQ C function `daqDeviceNetworkConfig_submitNetworkConfiguration()`.
2641    pub fn submit_network_configuration(&self, iface_name: &str, config: &PropertyObject) -> Result<()> {
2642        let __iface_name = crate::marshal::make_string(iface_name)?;
2643        let __code = unsafe { (crate::sys::api().daqDeviceNetworkConfig_submitNetworkConfiguration)(self.as_raw() as *mut _, __iface_name.as_ptr() as *mut _, config.as_raw() as *mut _) };
2644        check(__code, "daqDeviceNetworkConfig_submitNetworkConfiguration")?;
2645        Ok(())
2646    }
2647
2648}
2649
2650impl DevicePrivate {
2651    /// Calls the openDAQ C function `daqDevicePrivate_forceUnlock()`.
2652    pub fn force_unlock(&self) -> Result<()> {
2653        let __code = unsafe { (crate::sys::api().daqDevicePrivate_forceUnlock)(self.as_raw() as *mut _) };
2654        check(__code, "daqDevicePrivate_forceUnlock")?;
2655        Ok(())
2656    }
2657
2658    /// Calls the openDAQ C function `daqDevicePrivate_getDeviceConfig()`.
2659    pub fn device_config(&self) -> Result<Option<PropertyObject>> {
2660        let mut __config: *mut sys::daqPropertyObject = std::ptr::null_mut();
2661        let __code = unsafe { (crate::sys::api().daqDevicePrivate_getDeviceConfig)(self.as_raw() as *mut _, &mut __config) };
2662        check(__code, "daqDevicePrivate_getDeviceConfig")?;
2663        Ok(unsafe { crate::marshal::take_object::<PropertyObject>(__config as *mut _) })
2664    }
2665
2666    /// Calls the openDAQ C function `daqDevicePrivate_isLockedInternal()`.
2667    pub fn is_locked_internal(&self) -> Result<bool> {
2668        let mut __locked: u8 = 0;
2669        let __code = unsafe { (crate::sys::api().daqDevicePrivate_isLockedInternal)(self.as_raw() as *mut _, &mut __locked) };
2670        check(__code, "daqDevicePrivate_isLockedInternal")?;
2671        Ok(__locked != 0)
2672    }
2673
2674    /// Calls the openDAQ C function `daqDevicePrivate_lock()`.
2675    pub fn lock(&self, user: &User) -> Result<()> {
2676        let __code = unsafe { (crate::sys::api().daqDevicePrivate_lock)(self.as_raw() as *mut _, user.as_raw() as *mut _) };
2677        check(__code, "daqDevicePrivate_lock")?;
2678        Ok(())
2679    }
2680
2681    /// Calls the openDAQ C function `daqDevicePrivate_setAsRoot()`.
2682    pub fn set_as_root(&self) -> Result<()> {
2683        let __code = unsafe { (crate::sys::api().daqDevicePrivate_setAsRoot)(self.as_raw() as *mut _) };
2684        check(__code, "daqDevicePrivate_setAsRoot")?;
2685        Ok(())
2686    }
2687
2688    /// Calls the openDAQ C function `daqDevicePrivate_setDeviceConfig()`.
2689    pub fn set_device_config(&self, config: &PropertyObject) -> Result<()> {
2690        let __code = unsafe { (crate::sys::api().daqDevicePrivate_setDeviceConfig)(self.as_raw() as *mut _, config.as_raw() as *mut _) };
2691        check(__code, "daqDevicePrivate_setDeviceConfig")?;
2692        Ok(())
2693    }
2694
2695    /// Calls the openDAQ C function `daqDevicePrivate_unlock()`.
2696    pub fn unlock(&self, user: &User) -> Result<()> {
2697        let __code = unsafe { (crate::sys::api().daqDevicePrivate_unlock)(self.as_raw() as *mut _, user.as_raw() as *mut _) };
2698        check(__code, "daqDevicePrivate_unlock")?;
2699        Ok(())
2700    }
2701
2702}
2703
2704impl DeviceType {
2705    /// Creates a Device type object, with the id, name, description and optional defaultConfig.
2706    ///
2707    /// # Parameters
2708    /// - `id`: The unique type ID of the device.
2709    /// - `name`: The name of the device type.
2710    /// - `description`: A short description of the device type.
2711    /// - `default_config`: The property object, to be cloned and returned, each time user creates default configuration object. This way each instance of the device has its own configuration object.
2712    ///
2713    /// Calls the openDAQ C function `daqDeviceType_createDeviceType()`.
2714    pub fn new(id: &str, name: &str, description: &str, default_config: &PropertyObject, prefix: &str) -> Result<DeviceType> {
2715        let __id = crate::marshal::make_string(id)?;
2716        let __name = crate::marshal::make_string(name)?;
2717        let __description = crate::marshal::make_string(description)?;
2718        let __prefix = crate::marshal::make_string(prefix)?;
2719        let mut __obj: *mut sys::daqDeviceType = std::ptr::null_mut();
2720        let __code = unsafe { (crate::sys::api().daqDeviceType_createDeviceType)(&mut __obj, __id.as_ptr() as *mut _, __name.as_ptr() as *mut _, __description.as_ptr() as *mut _, default_config.as_raw() as *mut _, __prefix.as_ptr() as *mut _) };
2721        check(__code, "daqDeviceType_createDeviceType")?;
2722        Ok(unsafe { crate::marshal::require_object::<DeviceType>(__obj as *mut _, "daqDeviceType_createDeviceType") }?)
2723    }
2724
2725    /// Calls the openDAQ C function `daqDeviceType_getConnectionStringPrefix()`.
2726    pub fn connection_string_prefix(&self) -> Result<String> {
2727        let mut __prefix: *mut sys::daqString = std::ptr::null_mut();
2728        let __code = unsafe { (crate::sys::api().daqDeviceType_getConnectionStringPrefix)(self.as_raw() as *mut _, &mut __prefix) };
2729        check(__code, "daqDeviceType_getConnectionStringPrefix")?;
2730        Ok(unsafe { crate::marshal::take_string(__prefix) })
2731    }
2732
2733}
2734
2735impl Device {
2736    /// Connects to a device at the given connection string and returns it.
2737    ///
2738    /// # Parameters
2739    /// - `connection_string`: The connection string containing the address of the device. In example an IPv4/IPv6 address. The connection string can be found in the Device Info objects returned by `getAvailableDevices`.
2740    /// - `config`: A config object to configure a client device. This object can contain properties like max sample rate, port to use for 3rd party communication, number of channels to generate, or other device specific settings. Can be created from its corresponding Device type object. In case of a null value, it will use the default configuration.
2741    ///
2742    /// # Returns
2743    /// - `device`: The added device.
2744    ///
2745    /// Calls the openDAQ C function `daqDevice_addDevice()`.
2746    pub fn add_device(&self, connection_string: &str) -> Result<Option<Device>> {
2747        let __connection_string = crate::marshal::make_string(connection_string)?;
2748        let mut __device: *mut sys::daqDevice = std::ptr::null_mut();
2749        let __code = unsafe { (crate::sys::api().daqDevice_addDevice)(self.as_raw() as *mut _, &mut __device, __connection_string.as_ptr() as *mut _, std::ptr::null_mut()) };
2750        check(__code, "daqDevice_addDevice")?;
2751        Ok(unsafe { crate::marshal::take_object::<Device>(__device as *mut _) })
2752    }
2753
2754    /// Connects to a device at the given connection string and returns it.
2755    ///
2756    /// # Parameters
2757    /// - `connection_string`: The connection string containing the address of the device. In example an IPv4/IPv6 address. The connection string can be found in the Device Info objects returned by `getAvailableDevices`.
2758    /// - `config`: A config object to configure a client device. This object can contain properties like max sample rate, port to use for 3rd party communication, number of channels to generate, or other device specific settings. Can be created from its corresponding Device type object. In case of a null value, it will use the default configuration.
2759    ///
2760    /// # Returns
2761    /// - `device`: The added device.
2762    ///
2763    /// Calls the openDAQ C function `daqDevice_addDevice()`.
2764    pub fn add_device_with(&self, connection_string: &str, config: Option<&PropertyObject>) -> Result<Option<Device>> {
2765        let __connection_string = crate::marshal::make_string(connection_string)?;
2766        let mut __device: *mut sys::daqDevice = std::ptr::null_mut();
2767        let __code = unsafe { (crate::sys::api().daqDevice_addDevice)(self.as_raw() as *mut _, &mut __device, __connection_string.as_ptr() as *mut _, config.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
2768        check(__code, "daqDevice_addDevice")?;
2769        Ok(unsafe { crate::marshal::take_object::<Device>(__device as *mut _) })
2770    }
2771
2772    /// Connects to multiple devices in parallel using the provided connection strings and returns the connected devices. Each connection is established concurrently to improve performance when handling multiple devices. The additions, in turn, are performed sequentially in the order specified by connectionArgs.
2773    ///
2774    /// # Parameters
2775    /// - `connection_args`: A dictionary where each key is a connection string identifying the target device (e.g., IPv4/IPv6), and each value is a configuration object that customizes the connection. The configuration may specify parameters such as maximum sample rate, communication port, number of channels, or other device-specific settings. A `nullptr` value indicates that the default configuration should be used.
2776    /// - `err_codes`: An optional dictionary used to populate error codes for failed connection or addition attempts. For each failed attempt, the key is the connection string, and the value contains the error code.
2777    /// - `error_infos`: An optional dictionary used to populate detailed error info for failed connection or addition attempts. For each failed attempt, the key is the connection string, and the value contains the error info object.
2778    ///
2779    /// # Returns
2780    /// OPENDAQ_PARTIAL_SUCCESS if at least one device was successfully created and added, but not all of them; OPENDAQ_ERR_GENERALERROR if no devices were created or added; OPENDAQ_IGNORED if adding the devices from modules is not allowed within the device.
2781    /// - `devices`: A dictionary that maps each connection string to the corresponding added device object. If a device connection or addition attempt fails, the value will be `nullptr` for that entry.
2782    ///
2783    /// Calls the openDAQ C function `daqDevice_addDevices()`.
2784    pub fn add_devices(&self, connection_args: impl Into<Value>) -> Result<std::collections::HashMap<String, Device>> {
2785        let __connection_args = crate::value::to_daq(&connection_args.into())?;
2786        let mut __devices: *mut sys::daqDict = std::ptr::null_mut();
2787        let __code = unsafe { (crate::sys::api().daqDevice_addDevices)(self.as_raw() as *mut _, &mut __devices, crate::value::opt_ref_ptr(&__connection_args) as *mut _, std::ptr::null_mut(), std::ptr::null_mut()) };
2788        check(__code, "daqDevice_addDevices")?;
2789        Ok(unsafe { crate::marshal::take_dict::<String, Device>(__devices as *mut _, "daqDevice_addDevices") }?)
2790    }
2791
2792    /// Connects to multiple devices in parallel using the provided connection strings and returns the connected devices. Each connection is established concurrently to improve performance when handling multiple devices. The additions, in turn, are performed sequentially in the order specified by connectionArgs.
2793    ///
2794    /// # Parameters
2795    /// - `connection_args`: A dictionary where each key is a connection string identifying the target device (e.g., IPv4/IPv6), and each value is a configuration object that customizes the connection. The configuration may specify parameters such as maximum sample rate, communication port, number of channels, or other device-specific settings. A `nullptr` value indicates that the default configuration should be used.
2796    /// - `err_codes`: An optional dictionary used to populate error codes for failed connection or addition attempts. For each failed attempt, the key is the connection string, and the value contains the error code.
2797    /// - `error_infos`: An optional dictionary used to populate detailed error info for failed connection or addition attempts. For each failed attempt, the key is the connection string, and the value contains the error info object.
2798    ///
2799    /// # Returns
2800    /// OPENDAQ_PARTIAL_SUCCESS if at least one device was successfully created and added, but not all of them; OPENDAQ_ERR_GENERALERROR if no devices were created or added; OPENDAQ_IGNORED if adding the devices from modules is not allowed within the device.
2801    /// - `devices`: A dictionary that maps each connection string to the corresponding added device object. If a device connection or addition attempt fails, the value will be `nullptr` for that entry.
2802    ///
2803    /// Calls the openDAQ C function `daqDevice_addDevices()`.
2804    pub fn add_devices_with(&self, connection_args: impl Into<Value>, err_codes: impl Into<Value>, error_infos: impl Into<Value>) -> Result<std::collections::HashMap<String, Device>> {
2805        let __connection_args = crate::value::to_daq(&connection_args.into())?;
2806        let __err_codes = crate::value::to_daq(&err_codes.into())?;
2807        let __error_infos = crate::value::to_daq(&error_infos.into())?;
2808        let mut __devices: *mut sys::daqDict = std::ptr::null_mut();
2809        let __code = unsafe { (crate::sys::api().daqDevice_addDevices)(self.as_raw() as *mut _, &mut __devices, crate::value::opt_ref_ptr(&__connection_args) as *mut _, crate::value::opt_ref_ptr(&__err_codes) as *mut _, crate::value::opt_ref_ptr(&__error_infos) as *mut _) };
2810        check(__code, "daqDevice_addDevices")?;
2811        Ok(unsafe { crate::marshal::take_dict::<String, Device>(__devices as *mut _, "daqDevice_addDevices") }?)
2812    }
2813
2814    /// Creates and adds a function block to the device with the provided unique ID and returns it.
2815    ///
2816    /// # Parameters
2817    /// - `type_id`: The unique ID of the function block. Can be obtained from its corresponding Function Block Info object.
2818    /// - `config`: A config object to configure a function block with custom settings specific to that function block type.
2819    ///
2820    /// # Returns
2821    /// - `function_block`: The added function block.
2822    ///
2823    /// Calls the openDAQ C function `daqDevice_addFunctionBlock()`.
2824    pub fn add_function_block(&self, type_id: &str) -> Result<Option<FunctionBlock>> {
2825        let __type_id = crate::marshal::make_string(type_id)?;
2826        let mut __function_block: *mut sys::daqFunctionBlock = std::ptr::null_mut();
2827        let __code = unsafe { (crate::sys::api().daqDevice_addFunctionBlock)(self.as_raw() as *mut _, &mut __function_block, __type_id.as_ptr() as *mut _, std::ptr::null_mut()) };
2828        check(__code, "daqDevice_addFunctionBlock")?;
2829        Ok(unsafe { crate::marshal::take_object::<FunctionBlock>(__function_block as *mut _) })
2830    }
2831
2832    /// Creates and adds a function block to the device with the provided unique ID and returns it.
2833    ///
2834    /// # Parameters
2835    /// - `type_id`: The unique ID of the function block. Can be obtained from its corresponding Function Block Info object.
2836    /// - `config`: A config object to configure a function block with custom settings specific to that function block type.
2837    ///
2838    /// # Returns
2839    /// - `function_block`: The added function block.
2840    ///
2841    /// Calls the openDAQ C function `daqDevice_addFunctionBlock()`.
2842    pub fn add_function_block_with(&self, type_id: &str, config: Option<&PropertyObject>) -> Result<Option<FunctionBlock>> {
2843        let __type_id = crate::marshal::make_string(type_id)?;
2844        let mut __function_block: *mut sys::daqFunctionBlock = std::ptr::null_mut();
2845        let __code = unsafe { (crate::sys::api().daqDevice_addFunctionBlock)(self.as_raw() as *mut _, &mut __function_block, __type_id.as_ptr() as *mut _, config.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
2846        check(__code, "daqDevice_addFunctionBlock")?;
2847        Ok(unsafe { crate::marshal::take_object::<FunctionBlock>(__function_block as *mut _) })
2848    }
2849
2850    /// Creates and adds to the device a server with the provided unique type ID and returns it.
2851    ///
2852    /// # Parameters
2853    /// - `type_id`: The unique type ID of the server. Can be obtained from its corresponding Server type object.
2854    /// - `config`: A config object to configure a server with custom settings specific to that server type.
2855    ///
2856    /// # Returns
2857    /// - `server`: The added server.
2858    ///
2859    /// Calls the openDAQ C function `daqDevice_addServer()`.
2860    pub fn add_server(&self, type_id: &str, config: &PropertyObject) -> Result<Option<Server>> {
2861        let __type_id = crate::marshal::make_string(type_id)?;
2862        let mut __server: *mut sys::daqServer = std::ptr::null_mut();
2863        let __code = unsafe { (crate::sys::api().daqDevice_addServer)(self.as_raw() as *mut _, __type_id.as_ptr() as *mut _, config.as_raw() as *mut _, &mut __server) };
2864        check(__code, "daqDevice_addServer")?;
2865        Ok(unsafe { crate::marshal::take_object::<Server>(__server as *mut _) })
2866    }
2867
2868    /// Connects to a streaming at the given connection string, adds it as a streaming source of device and returns created streaming object.
2869    ///
2870    /// # Parameters
2871    /// - `connection_string`: The connection string containing the address of the streaming. In example an IPv4/IPv6 address. The connection string can be found in the Server Capability objects returned by `getInfo().getServerCapabilities()`.
2872    /// - `config`: A config object to configure a streaming connection. This object can contain properties like various connection timeouts or other streaming protocol specific settings. Can be created from its corresponding Streaming type object. In case of a null value, it will use the default configuration.
2873    ///
2874    /// # Returns
2875    /// - `streaming`: The added streaming source.
2876    ///
2877    /// Calls the openDAQ C function `daqDevice_addStreaming()`.
2878    pub fn add_streaming(&self, connection_string: &str) -> Result<Option<Streaming>> {
2879        let __connection_string = crate::marshal::make_string(connection_string)?;
2880        let mut __streaming: *mut sys::daqStreaming = std::ptr::null_mut();
2881        let __code = unsafe { (crate::sys::api().daqDevice_addStreaming)(self.as_raw() as *mut _, &mut __streaming, __connection_string.as_ptr() as *mut _, std::ptr::null_mut()) };
2882        check(__code, "daqDevice_addStreaming")?;
2883        Ok(unsafe { crate::marshal::take_object::<Streaming>(__streaming as *mut _) })
2884    }
2885
2886    /// Connects to a streaming at the given connection string, adds it as a streaming source of device and returns created streaming object.
2887    ///
2888    /// # Parameters
2889    /// - `connection_string`: The connection string containing the address of the streaming. In example an IPv4/IPv6 address. The connection string can be found in the Server Capability objects returned by `getInfo().getServerCapabilities()`.
2890    /// - `config`: A config object to configure a streaming connection. This object can contain properties like various connection timeouts or other streaming protocol specific settings. Can be created from its corresponding Streaming type object. In case of a null value, it will use the default configuration.
2891    ///
2892    /// # Returns
2893    /// - `streaming`: The added streaming source.
2894    ///
2895    /// Calls the openDAQ C function `daqDevice_addStreaming()`.
2896    pub fn add_streaming_with(&self, connection_string: &str, config: Option<&PropertyObject>) -> Result<Option<Streaming>> {
2897        let __connection_string = crate::marshal::make_string(connection_string)?;
2898        let mut __streaming: *mut sys::daqStreaming = std::ptr::null_mut();
2899        let __code = unsafe { (crate::sys::api().daqDevice_addStreaming)(self.as_raw() as *mut _, &mut __streaming, __connection_string.as_ptr() as *mut _, config.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
2900        check(__code, "daqDevice_addStreaming")?;
2901        Ok(unsafe { crate::marshal::take_object::<Streaming>(__streaming as *mut _) })
2902    }
2903
2904    /// Creates an openDAQ client.
2905    ///
2906    /// # Parameters
2907    /// - `ctx`: The context object.
2908    /// - `local_id`: The localID of the client.
2909    /// - `default_device_info`: The DeviceInfo to be used by the client device.
2910    /// - `parent`: The parent component of the client.
2911    ///
2912    /// Calls the openDAQ C function `daqDevice_createClient()`.
2913    pub fn client(ctx: &Context, local_id: &str, default_device_info: &DeviceInfo, parent: &Component) -> Result<Device> {
2914        let __local_id = crate::marshal::make_string(local_id)?;
2915        let mut __obj: *mut sys::daqDevice = std::ptr::null_mut();
2916        let __code = unsafe { (crate::sys::api().daqDevice_createClient)(&mut __obj, ctx.as_raw() as *mut _, __local_id.as_ptr() as *mut _, default_device_info.as_raw() as *mut _, parent.as_raw() as *mut _) };
2917        check(__code, "daqDevice_createClient")?;
2918        Ok(unsafe { crate::marshal::require_object::<Device>(__obj as *mut _, "daqDevice_createClient") }?)
2919    }
2920
2921    /// Creates config object that can be used when adding a device. Contains Device and Streaming default configuration for all available Device/Streaming types. Also contains general add-device configuration settings.
2922    ///
2923    /// # Returns
2924    /// - `default_config`: The configuration object containing default settings for adding a device. The default config object is organized to always have 3 object-type properties: - "General" Contains general properties such as "AutomaticallyConnectStreaming" - "Device": Contains a child object-type property for each available device type, with the key of each property being the ID of the device type. These can be configured to customize the `addDevice` call when using connecting to the selected device type (eg. via the native or OPC UA protocols). - "Streaming": Same as device, but used to configure each individual streaming connection established when calling `addDevice`.
2925    ///
2926    /// Calls the openDAQ C function `daqDevice_createDefaultAddDeviceConfig()`.
2927    pub fn create_default_add_device_config(&self) -> Result<Option<PropertyObject>> {
2928        let mut __default_config: *mut sys::daqPropertyObject = std::ptr::null_mut();
2929        let __code = unsafe { (crate::sys::api().daqDevice_createDefaultAddDeviceConfig)(self.as_raw() as *mut _, &mut __default_config) };
2930        check(__code, "daqDevice_createDefaultAddDeviceConfig")?;
2931        Ok(unsafe { crate::marshal::take_object::<PropertyObject>(__default_config as *mut _) })
2932    }
2933
2934    /// Get a dictionary of available device types as \<IString, IDeviceType\> pairs
2935    ///
2936    /// # Returns
2937    /// - `device_types`: The dictionary of available device types.
2938    ///
2939    /// Calls the openDAQ C function `daqDevice_getAvailableDeviceTypes()`.
2940    pub fn available_device_types(&self) -> Result<std::collections::HashMap<String, DeviceType>> {
2941        let mut __device_types: *mut sys::daqDict = std::ptr::null_mut();
2942        let __code = unsafe { (crate::sys::api().daqDevice_getAvailableDeviceTypes)(self.as_raw() as *mut _, &mut __device_types) };
2943        check(__code, "daqDevice_getAvailableDeviceTypes")?;
2944        Ok(unsafe { crate::marshal::take_dict::<String, DeviceType>(__device_types as *mut _, "daqDevice_getAvailableDeviceTypes") }?)
2945    }
2946
2947    /// Gets a list of available devices, containing their Device Info.
2948    ///
2949    /// # Returns
2950    /// - `available_devices`: The list of available devices. The getAvailableDevices most often runs a discovery client, querying for available devices that a device module can connect to. The replies are formed into Device Info objects and inserted to the list of available devices.
2951    ///
2952    /// Calls the openDAQ C function `daqDevice_getAvailableDevices()`.
2953    pub fn available_devices(&self) -> Result<Vec<DeviceInfo>> {
2954        let mut __available_devices: *mut sys::daqList = std::ptr::null_mut();
2955        let __code = unsafe { (crate::sys::api().daqDevice_getAvailableDevices)(self.as_raw() as *mut _, &mut __available_devices) };
2956        check(__code, "daqDevice_getAvailableDevices")?;
2957        Ok(unsafe { crate::marshal::take_list::<DeviceInfo>(__available_devices as *mut _, "daqDevice_getAvailableDevices") }?)
2958    }
2959
2960    /// Gets all function block types that are supported by the device, containing their description.
2961    ///
2962    /// # Returns
2963    /// - `function_block_types`: A dictionary of available function block types.
2964    ///
2965    /// Calls the openDAQ C function `daqDevice_getAvailableFunctionBlockTypes()`.
2966    pub fn available_function_block_types(&self) -> Result<std::collections::HashMap<String, FunctionBlockType>> {
2967        let mut __function_block_types: *mut sys::daqDict = std::ptr::null_mut();
2968        let __code = unsafe { (crate::sys::api().daqDevice_getAvailableFunctionBlockTypes)(self.as_raw() as *mut _, &mut __function_block_types) };
2969        check(__code, "daqDevice_getAvailableFunctionBlockTypes")?;
2970        Ok(unsafe { crate::marshal::take_dict::<String, FunctionBlockType>(__function_block_types as *mut _, "daqDevice_getAvailableFunctionBlockTypes") }?)
2971    }
2972
2973    /// Gets a list of available operation modes for the device.
2974    ///
2975    /// # Returns
2976    /// - `available_op_modes`: The list of available operation modes.
2977    ///
2978    /// Calls the openDAQ C function `daqDevice_getAvailableOperationModes()`.
2979    pub fn available_operation_modes(&self) -> Result<Vec<i64>> {
2980        let mut __available_op_modes: *mut sys::daqList = std::ptr::null_mut();
2981        let __code = unsafe { (crate::sys::api().daqDevice_getAvailableOperationModes)(self.as_raw() as *mut _, &mut __available_op_modes) };
2982        check(__code, "daqDevice_getAvailableOperationModes")?;
2983        Ok(unsafe { crate::marshal::take_list::<i64>(__available_op_modes as *mut _, "daqDevice_getAvailableOperationModes") }?)
2984    }
2985
2986    /// Gets a flat list of the device's physical channels.
2987    ///
2988    /// # Parameters
2989    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
2990    ///
2991    /// # Returns
2992    /// - `channels`: The flat list of channels. If searchFilter is not provided, the returned list contains only visible channels and does not include those of child devices.
2993    ///
2994    /// Calls the openDAQ C function `daqDevice_getChannels()`.
2995    pub fn channels(&self) -> Result<Vec<Channel>> {
2996        let mut __channels: *mut sys::daqList = std::ptr::null_mut();
2997        let __code = unsafe { (crate::sys::api().daqDevice_getChannels)(self.as_raw() as *mut _, &mut __channels, std::ptr::null_mut()) };
2998        check(__code, "daqDevice_getChannels")?;
2999        Ok(unsafe { crate::marshal::take_list::<Channel>(__channels as *mut _, "daqDevice_getChannels") }?)
3000    }
3001
3002    /// Gets a flat list of the device's physical channels.
3003    ///
3004    /// # Parameters
3005    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3006    ///
3007    /// # Returns
3008    /// - `channels`: The flat list of channels. If searchFilter is not provided, the returned list contains only visible channels and does not include those of child devices.
3009    ///
3010    /// Calls the openDAQ C function `daqDevice_getChannels()`.
3011    pub fn channels_with(&self, search_filter: Option<&SearchFilter>) -> Result<Vec<Channel>> {
3012        let mut __channels: *mut sys::daqList = std::ptr::null_mut();
3013        let __code = unsafe { (crate::sys::api().daqDevice_getChannels)(self.as_raw() as *mut _, &mut __channels, search_filter.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
3014        check(__code, "daqDevice_getChannels")?;
3015        Ok(unsafe { crate::marshal::take_list::<Channel>(__channels as *mut _, "daqDevice_getChannels") }?)
3016    }
3017
3018    /// Gets a flat list of the device's physical channels. Also finds all visible channels of visible child devices
3019    ///
3020    /// # Parameters
3021    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3022    ///
3023    /// # Returns
3024    /// - `channels`: The flat list of channels.
3025    ///
3026    /// Calls the openDAQ C function `daqDevice_getChannelsRecursive()`.
3027    pub fn channels_recursive(&self) -> Result<Vec<Channel>> {
3028        let mut __channels: *mut sys::daqList = std::ptr::null_mut();
3029        let __code = unsafe { (crate::sys::api().daqDevice_getChannelsRecursive)(self.as_raw() as *mut _, &mut __channels, std::ptr::null_mut()) };
3030        check(__code, "daqDevice_getChannelsRecursive")?;
3031        Ok(unsafe { crate::marshal::take_list::<Channel>(__channels as *mut _, "daqDevice_getChannelsRecursive") }?)
3032    }
3033
3034    /// Gets a flat list of the device's physical channels. Also finds all visible channels of visible child devices
3035    ///
3036    /// # Parameters
3037    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3038    ///
3039    /// # Returns
3040    /// - `channels`: The flat list of channels.
3041    ///
3042    /// Calls the openDAQ C function `daqDevice_getChannelsRecursive()`.
3043    pub fn channels_recursive_with(&self, search_filter: Option<&SearchFilter>) -> Result<Vec<Channel>> {
3044        let mut __channels: *mut sys::daqList = std::ptr::null_mut();
3045        let __code = unsafe { (crate::sys::api().daqDevice_getChannelsRecursive)(self.as_raw() as *mut _, &mut __channels, search_filter.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
3046        check(__code, "daqDevice_getChannelsRecursive")?;
3047        Ok(unsafe { crate::marshal::take_list::<Channel>(__channels as *mut _, "daqDevice_getChannelsRecursive") }?)
3048    }
3049
3050    /// Gets the container holding the statuses of device configuration and streaming connections.
3051    ///
3052    /// # Returns
3053    /// - `status_container`: The container for the device connection statuses.
3054    ///
3055    /// Calls the openDAQ C function `daqDevice_getConnectionStatusContainer()`.
3056    pub fn connection_status_container(&self) -> Result<Option<ComponentStatusContainer>> {
3057        let mut __status_container: *mut sys::daqComponentStatusContainer = std::ptr::null_mut();
3058        let __code = unsafe { (crate::sys::api().daqDevice_getConnectionStatusContainer)(self.as_raw() as *mut _, &mut __status_container) };
3059        check(__code, "daqDevice_getConnectionStatusContainer")?;
3060        Ok(unsafe { crate::marshal::take_object::<ComponentStatusContainer>(__status_container as *mut _) })
3061    }
3062
3063    /// Gets a list of all components/folders in a device that are not titled 'IO', 'Sig', 'Dev', 'Synchronization' or 'FB'
3064    ///
3065    /// # Returns
3066    /// - `custom_components`: The list of custom components.
3067    ///
3068    /// Calls the openDAQ C function `daqDevice_getCustomComponents()`.
3069    pub fn custom_components(&self) -> Result<Vec<Component>> {
3070        let mut __custom_components: *mut sys::daqList = std::ptr::null_mut();
3071        let __code = unsafe { (crate::sys::api().daqDevice_getCustomComponents)(self.as_raw() as *mut _, &mut __custom_components) };
3072        check(__code, "daqDevice_getCustomComponents")?;
3073        Ok(unsafe { crate::marshal::take_list::<Component>(__custom_components as *mut _, "daqDevice_getCustomComponents") }?)
3074    }
3075
3076    /// Gets a list of child devices that the device is connected to.
3077    ///
3078    /// # Parameters
3079    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3080    ///
3081    /// # Returns
3082    /// - `devices`: The list of devices. If searchFilter is not provided, the returned list contains only visible devices and does not include those of child devices.
3083    ///
3084    /// Calls the openDAQ C function `daqDevice_getDevices()`.
3085    pub fn devices(&self) -> Result<Vec<Device>> {
3086        let mut __devices: *mut sys::daqList = std::ptr::null_mut();
3087        let __code = unsafe { (crate::sys::api().daqDevice_getDevices)(self.as_raw() as *mut _, &mut __devices, std::ptr::null_mut()) };
3088        check(__code, "daqDevice_getDevices")?;
3089        Ok(unsafe { crate::marshal::take_list::<Device>(__devices as *mut _, "daqDevice_getDevices") }?)
3090    }
3091
3092    /// Gets a list of child devices that the device is connected to.
3093    ///
3094    /// # Parameters
3095    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3096    ///
3097    /// # Returns
3098    /// - `devices`: The list of devices. If searchFilter is not provided, the returned list contains only visible devices and does not include those of child devices.
3099    ///
3100    /// Calls the openDAQ C function `daqDevice_getDevices()`.
3101    pub fn devices_with(&self, search_filter: Option<&SearchFilter>) -> Result<Vec<Device>> {
3102        let mut __devices: *mut sys::daqList = std::ptr::null_mut();
3103        let __code = unsafe { (crate::sys::api().daqDevice_getDevices)(self.as_raw() as *mut _, &mut __devices, search_filter.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
3104        check(__code, "daqDevice_getDevices")?;
3105        Ok(unsafe { crate::marshal::take_list::<Device>(__devices as *mut _, "daqDevice_getDevices") }?)
3106    }
3107
3108    /// Gets the device's domain data. It allows for querying the device for its domain (time) values.
3109    ///
3110    /// # Returns
3111    /// - `domain`: The device domain.
3112    ///
3113    /// Calls the openDAQ C function `daqDevice_getDomain()`.
3114    pub fn domain(&self) -> Result<Option<DeviceDomain>> {
3115        let mut __domain: *mut sys::daqDeviceDomain = std::ptr::null_mut();
3116        let __code = unsafe { (crate::sys::api().daqDevice_getDomain)(self.as_raw() as *mut _, &mut __domain) };
3117        check(__code, "daqDevice_getDomain")?;
3118        Ok(unsafe { crate::marshal::take_object::<DeviceDomain>(__domain as *mut _) })
3119    }
3120
3121    /// Gets the list of added function blocks.
3122    ///
3123    /// # Parameters
3124    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3125    ///
3126    /// # Returns
3127    /// - `function_blocks`: The list of added function blocks. If searchFilter is not provided, the returned list contains only visible function blocks and does not include those of child function blocks, devices, or channels.
3128    ///
3129    /// Calls the openDAQ C function `daqDevice_getFunctionBlocks()`.
3130    pub fn function_blocks(&self) -> Result<Vec<FunctionBlock>> {
3131        let mut __function_blocks: *mut sys::daqList = std::ptr::null_mut();
3132        let __code = unsafe { (crate::sys::api().daqDevice_getFunctionBlocks)(self.as_raw() as *mut _, &mut __function_blocks, std::ptr::null_mut()) };
3133        check(__code, "daqDevice_getFunctionBlocks")?;
3134        Ok(unsafe { crate::marshal::take_list::<FunctionBlock>(__function_blocks as *mut _, "daqDevice_getFunctionBlocks") }?)
3135    }
3136
3137    /// Gets the list of added function blocks.
3138    ///
3139    /// # Parameters
3140    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3141    ///
3142    /// # Returns
3143    /// - `function_blocks`: The list of added function blocks. If searchFilter is not provided, the returned list contains only visible function blocks and does not include those of child function blocks, devices, or channels.
3144    ///
3145    /// Calls the openDAQ C function `daqDevice_getFunctionBlocks()`.
3146    pub fn function_blocks_with(&self, search_filter: Option<&SearchFilter>) -> Result<Vec<FunctionBlock>> {
3147        let mut __function_blocks: *mut sys::daqList = std::ptr::null_mut();
3148        let __code = unsafe { (crate::sys::api().daqDevice_getFunctionBlocks)(self.as_raw() as *mut _, &mut __function_blocks, search_filter.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
3149        check(__code, "daqDevice_getFunctionBlocks")?;
3150        Ok(unsafe { crate::marshal::take_list::<FunctionBlock>(__function_blocks as *mut _, "daqDevice_getFunctionBlocks") }?)
3151    }
3152
3153    /// Gets the device info. It contains data about the device such as the device's serial number, location, and connection string.
3154    ///
3155    /// # Returns
3156    /// - `info`: The device info.
3157    ///
3158    /// Calls the openDAQ C function `daqDevice_getInfo()`.
3159    pub fn info(&self) -> Result<Option<DeviceInfo>> {
3160        let mut __info: *mut sys::daqDeviceInfo = std::ptr::null_mut();
3161        let __code = unsafe { (crate::sys::api().daqDevice_getInfo)(self.as_raw() as *mut _, &mut __info) };
3162        check(__code, "daqDevice_getInfo")?;
3163        Ok(unsafe { crate::marshal::take_object::<DeviceInfo>(__info as *mut _) })
3164    }
3165
3166    /// Gets a folder containing channels.
3167    ///
3168    /// # Returns
3169    /// - `inputs_outputs_folder`: The folder that contains channels. The InputsOutputs folder can contain other folders that themselves contain channels.
3170    ///
3171    /// Calls the openDAQ C function `daqDevice_getInputsOutputsFolder()`.
3172    pub fn inputs_outputs_folder(&self) -> Result<Option<Folder>> {
3173        let mut __inputs_outputs_folder: *mut sys::daqFolder = std::ptr::null_mut();
3174        let __code = unsafe { (crate::sys::api().daqDevice_getInputsOutputsFolder)(self.as_raw() as *mut _, &mut __inputs_outputs_folder) };
3175        check(__code, "daqDevice_getInputsOutputsFolder")?;
3176        Ok(unsafe { crate::marshal::take_object::<Folder>(__inputs_outputs_folder as *mut _) })
3177    }
3178
3179    /// Retrieves a chunk of the log file with the provided ID.
3180    /// This function extracts a specified portion (or the entire content) of the log file, starting at the given offset.
3181    /// If the size and offset are not specified, it will attempt to return the entire log file by default.
3182    ///
3183    /// # Parameters
3184    /// - `id`: Rhe ID of the log file to retrieve.
3185    /// - `size`: The size of the log chunk to retrieve in bytes. Defaults to -1, which means it will return all remaining bytes from the offset.
3186    /// - `offset`: The offset, in bytes, from where the log chunk should be read. Defaults to 0 (start of the file). If size is set to -1, and offset is 0, the entire log file will be returned.
3187    ///
3188    /// # Returns
3189    /// - `log`: A string which stores requested log chunk.
3190    ///
3191    /// Calls the openDAQ C function `daqDevice_getLog()`.
3192    pub fn log(&self, id: &str) -> Result<String> {
3193        let __id = crate::marshal::make_string(id)?;
3194        let mut __log: *mut sys::daqString = std::ptr::null_mut();
3195        let __code = unsafe { (crate::sys::api().daqDevice_getLog)(self.as_raw() as *mut _, &mut __log, __id.as_ptr() as *mut _, -1, 0) };
3196        check(__code, "daqDevice_getLog")?;
3197        Ok(unsafe { crate::marshal::take_string(__log) })
3198    }
3199
3200    /// Retrieves a chunk of the log file with the provided ID.
3201    /// This function extracts a specified portion (or the entire content) of the log file, starting at the given offset.
3202    /// If the size and offset are not specified, it will attempt to return the entire log file by default.
3203    ///
3204    /// # Parameters
3205    /// - `id`: Rhe ID of the log file to retrieve.
3206    /// - `size`: The size of the log chunk to retrieve in bytes. Defaults to -1, which means it will return all remaining bytes from the offset.
3207    /// - `offset`: The offset, in bytes, from where the log chunk should be read. Defaults to 0 (start of the file). If size is set to -1, and offset is 0, the entire log file will be returned.
3208    ///
3209    /// # Returns
3210    /// - `log`: A string which stores requested log chunk.
3211    ///
3212    /// Calls the openDAQ C function `daqDevice_getLog()`.
3213    pub fn log_with(&self, id: &str, size: i64, offset: i64) -> Result<String> {
3214        let __id = crate::marshal::make_string(id)?;
3215        let mut __log: *mut sys::daqString = std::ptr::null_mut();
3216        let __code = unsafe { (crate::sys::api().daqDevice_getLog)(self.as_raw() as *mut _, &mut __log, __id.as_ptr() as *mut _, size, offset) };
3217        check(__code, "daqDevice_getLog")?;
3218        Ok(unsafe { crate::marshal::take_string(__log) })
3219    }
3220
3221    /// Gets a list of available log files.
3222    ///
3223    /// # Returns
3224    /// - `log_file_infos`: The list of available log files.
3225    ///
3226    /// Calls the openDAQ C function `daqDevice_getLogFileInfos()`.
3227    pub fn log_file_infos(&self) -> Result<Vec<LogFileInfo>> {
3228        let mut __log_file_infos: *mut sys::daqList = std::ptr::null_mut();
3229        let __code = unsafe { (crate::sys::api().daqDevice_getLogFileInfos)(self.as_raw() as *mut _, &mut __log_file_infos) };
3230        check(__code, "daqDevice_getLogFileInfos")?;
3231        Ok(unsafe { crate::marshal::take_list::<LogFileInfo>(__log_file_infos as *mut _, "daqDevice_getLogFileInfos") }?)
3232    }
3233
3234    /// Get list of added servers.
3235    ///
3236    /// # Returns
3237    /// - `servers`: List of added servers.
3238    ///
3239    /// Calls the openDAQ C function `daqDevice_getServers()`.
3240    pub fn servers(&self) -> Result<Vec<Server>> {
3241        let mut __servers: *mut sys::daqList = std::ptr::null_mut();
3242        let __code = unsafe { (crate::sys::api().daqDevice_getServers)(self.as_raw() as *mut _, &mut __servers) };
3243        check(__code, "daqDevice_getServers")?;
3244        Ok(unsafe { crate::marshal::take_list::<Server>(__servers as *mut _, "daqDevice_getServers") }?)
3245    }
3246
3247    /// Gets a list of the device's signals.
3248    ///
3249    /// # Parameters
3250    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3251    ///
3252    /// # Returns
3253    /// - `signals`: The flat list of signals. If searchFilter is not provided, the returned list contains only visible signals and does not include those of child function blocks, devices, or channels. Device signals are most often domain signals shared by other signals that belong to channels and/or function blocks.
3254    ///
3255    /// Calls the openDAQ C function `daqDevice_getSignals()`.
3256    pub fn signals(&self) -> Result<Vec<Signal>> {
3257        let mut __signals: *mut sys::daqList = std::ptr::null_mut();
3258        let __code = unsafe { (crate::sys::api().daqDevice_getSignals)(self.as_raw() as *mut _, &mut __signals, std::ptr::null_mut()) };
3259        check(__code, "daqDevice_getSignals")?;
3260        Ok(unsafe { crate::marshal::take_list::<Signal>(__signals as *mut _, "daqDevice_getSignals") }?)
3261    }
3262
3263    /// Gets a list of the device's signals.
3264    ///
3265    /// # Parameters
3266    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3267    ///
3268    /// # Returns
3269    /// - `signals`: The flat list of signals. If searchFilter is not provided, the returned list contains only visible signals and does not include those of child function blocks, devices, or channels. Device signals are most often domain signals shared by other signals that belong to channels and/or function blocks.
3270    ///
3271    /// Calls the openDAQ C function `daqDevice_getSignals()`.
3272    pub fn signals_with(&self, search_filter: Option<&SearchFilter>) -> Result<Vec<Signal>> {
3273        let mut __signals: *mut sys::daqList = std::ptr::null_mut();
3274        let __code = unsafe { (crate::sys::api().daqDevice_getSignals)(self.as_raw() as *mut _, &mut __signals, search_filter.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
3275        check(__code, "daqDevice_getSignals")?;
3276        Ok(unsafe { crate::marshal::take_list::<Signal>(__signals as *mut _, "daqDevice_getSignals") }?)
3277    }
3278
3279    /// Gets a list of the signals that belong to the device.
3280    ///
3281    /// # Parameters
3282    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3283    ///
3284    /// # Returns
3285    /// - `signals`: The flat list of signals. The list includes visible signals that belong to visible channels, function blocks, or sub devices of the device.
3286    ///
3287    /// Calls the openDAQ C function `daqDevice_getSignalsRecursive()`.
3288    pub fn signals_recursive(&self) -> Result<Vec<Signal>> {
3289        let mut __signals: *mut sys::daqList = std::ptr::null_mut();
3290        let __code = unsafe { (crate::sys::api().daqDevice_getSignalsRecursive)(self.as_raw() as *mut _, &mut __signals, std::ptr::null_mut()) };
3291        check(__code, "daqDevice_getSignalsRecursive")?;
3292        Ok(unsafe { crate::marshal::take_list::<Signal>(__signals as *mut _, "daqDevice_getSignalsRecursive") }?)
3293    }
3294
3295    /// Gets a list of the signals that belong to the device.
3296    ///
3297    /// # Parameters
3298    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3299    ///
3300    /// # Returns
3301    /// - `signals`: The flat list of signals. The list includes visible signals that belong to visible channels, function blocks, or sub devices of the device.
3302    ///
3303    /// Calls the openDAQ C function `daqDevice_getSignalsRecursive()`.
3304    pub fn signals_recursive_with(&self, search_filter: Option<&SearchFilter>) -> Result<Vec<Signal>> {
3305        let mut __signals: *mut sys::daqList = std::ptr::null_mut();
3306        let __code = unsafe { (crate::sys::api().daqDevice_getSignalsRecursive)(self.as_raw() as *mut _, &mut __signals, search_filter.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
3307        check(__code, "daqDevice_getSignalsRecursive")?;
3308        Ok(unsafe { crate::marshal::take_list::<Signal>(__signals as *mut _, "daqDevice_getSignalsRecursive") }?)
3309    }
3310
3311    /// Gets the sync component of the device.
3312    ///
3313    /// # Returns
3314    /// - `sync`: The sync component.
3315    ///
3316    /// Calls the openDAQ C function `daqDevice_getSyncComponent()`.
3317    pub fn sync_component(&self) -> Result<Option<SyncComponent>> {
3318        let mut __sync: *mut sys::daqSyncComponent = std::ptr::null_mut();
3319        let __code = unsafe { (crate::sys::api().daqDevice_getSyncComponent)(self.as_raw() as *mut _, &mut __sync) };
3320        check(__code, "daqDevice_getSyncComponent")?;
3321        Ok(unsafe { crate::marshal::take_object::<SyncComponent>(__sync as *mut _) })
3322    }
3323
3324    /// Gets the number of ticks passed since the device's absolute origin.
3325    ///
3326    /// # Returns
3327    /// - `ticks`: The number of ticks. To scale the ticks into a domain unit, the Device's Domain should be used.
3328    ///
3329    /// Calls the openDAQ C function `daqDevice_getTicksSinceOrigin()`.
3330    pub fn ticks_since_origin(&self) -> Result<u64> {
3331        let mut __ticks: u64 = Default::default();
3332        let __code = unsafe { (crate::sys::api().daqDevice_getTicksSinceOrigin)(self.as_raw() as *mut _, &mut __ticks) };
3333        check(__code, "daqDevice_getTicksSinceOrigin")?;
3334        Ok(__ticks)
3335    }
3336
3337    /// Returns true if device is locked. Once locked, no properties of the device can be changed via the protocol layer.
3338    ///
3339    /// # Returns
3340    /// - `locked`: True if device is locked.
3341    ///
3342    /// Calls the openDAQ C function `daqDevice_isLocked()`.
3343    pub fn is_locked(&self) -> Result<bool> {
3344        let mut __locked: u8 = 0;
3345        let __code = unsafe { (crate::sys::api().daqDevice_isLocked)(self.as_raw() as *mut _, &mut __locked) };
3346        check(__code, "daqDevice_isLocked")?;
3347        Ok(__locked != 0)
3348    }
3349
3350    /// Loads the configuration of the device from string.
3351    ///
3352    /// # Parameters
3353    /// - `configuration`: Serialized configuration of the device.
3354    ///
3355    /// Calls the openDAQ C function `daqDevice_loadConfiguration()`.
3356    pub fn load_configuration(&self, configuration: &str) -> Result<()> {
3357        let __configuration = crate::marshal::make_string(configuration)?;
3358        let __code = unsafe { (crate::sys::api().daqDevice_loadConfiguration)(self.as_raw() as *mut _, __configuration.as_ptr() as *mut _, std::ptr::null_mut()) };
3359        check(__code, "daqDevice_loadConfiguration")?;
3360        Ok(())
3361    }
3362
3363    /// Loads the configuration of the device from string.
3364    ///
3365    /// # Parameters
3366    /// - `configuration`: Serialized configuration of the device.
3367    ///
3368    /// Calls the openDAQ C function `daqDevice_loadConfiguration()`.
3369    pub fn load_configuration_with(&self, configuration: &str, config: Option<&UpdateParameters>) -> Result<()> {
3370        let __configuration = crate::marshal::make_string(configuration)?;
3371        let __code = unsafe { (crate::sys::api().daqDevice_loadConfiguration)(self.as_raw() as *mut _, __configuration.as_ptr() as *mut _, config.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
3372        check(__code, "daqDevice_loadConfiguration")?;
3373        Ok(())
3374    }
3375
3376    /// Lock a device with a session user. Once locked, no properties of the device can be changed via the protocol layer. Only the same user who locked the device can unlock it. If no user was specified when the device was locked, any user will be able to unlock it.
3377    ///
3378    /// Calls the openDAQ C function `daqDevice_lock()`.
3379    pub fn lock(&self) -> Result<()> {
3380        let __code = unsafe { (crate::sys::api().daqDevice_lock)(self.as_raw() as *mut _) };
3381        check(__code, "daqDevice_lock")?;
3382        Ok(())
3383    }
3384
3385    /// Disconnects from the device provided as argument and removes it from the internal list of devices.
3386    ///
3387    /// # Parameters
3388    /// - `device`: The device to be removed.
3389    ///
3390    /// Calls the openDAQ C function `daqDevice_removeDevice()`.
3391    pub fn remove_device(&self, device: &Device) -> Result<()> {
3392        let __code = unsafe { (crate::sys::api().daqDevice_removeDevice)(self.as_raw() as *mut _, device.as_raw() as *mut _) };
3393        check(__code, "daqDevice_removeDevice")?;
3394        Ok(())
3395    }
3396
3397    /// Removes the function block provided as argument, disconnecting its signals and input ports.
3398    ///
3399    /// # Parameters
3400    /// - `function_block`: The function block to be removed.
3401    ///
3402    /// Calls the openDAQ C function `daqDevice_removeFunctionBlock()`.
3403    pub fn remove_function_block(&self, function_block: &FunctionBlock) -> Result<()> {
3404        let __code = unsafe { (crate::sys::api().daqDevice_removeFunctionBlock)(self.as_raw() as *mut _, function_block.as_raw() as *mut _) };
3405        check(__code, "daqDevice_removeFunctionBlock")?;
3406        Ok(())
3407    }
3408
3409    /// Removes the server provided as argument.
3410    ///
3411    /// # Parameters
3412    /// - `server`: The server to be removed.
3413    ///
3414    /// Calls the openDAQ C function `daqDevice_removeServer()`.
3415    pub fn remove_server(&self, server: &Server) -> Result<()> {
3416        let __code = unsafe { (crate::sys::api().daqDevice_removeServer)(self.as_raw() as *mut _, server.as_raw() as *mut _) };
3417        check(__code, "daqDevice_removeServer")?;
3418        Ok(())
3419    }
3420
3421    /// Saves the configuration of the device to string.
3422    ///
3423    /// # Returns
3424    /// - `configuration`: Serialized configuration of the device.
3425    ///
3426    /// Calls the openDAQ C function `daqDevice_saveConfiguration()`.
3427    pub fn save_configuration(&self) -> Result<String> {
3428        let mut __configuration: *mut sys::daqString = std::ptr::null_mut();
3429        let __code = unsafe { (crate::sys::api().daqDevice_saveConfiguration)(self.as_raw() as *mut _, &mut __configuration) };
3430        check(__code, "daqDevice_saveConfiguration")?;
3431        Ok(unsafe { crate::marshal::take_string(__configuration) })
3432    }
3433
3434    /// Sets the operation mode of the device subtree excluding the sub-devices.
3435    ///
3436    /// # Parameters
3437    /// - `mode_type`: The operation mode to set.
3438    ///
3439    /// Calls the openDAQ C function `daqDevice_setOperationMode()`.
3440    pub fn set_operation_mode(&self, mode_type: OperationModeType) -> Result<()> {
3441        let __code = unsafe { (crate::sys::api().daqDevice_setOperationMode)(self.as_raw() as *mut _, mode_type as u32) };
3442        check(__code, "daqDevice_setOperationMode")?;
3443        Ok(())
3444    }
3445
3446    /// Sets the operation mode of the device subtree including the sub-devices.
3447    ///
3448    /// # Parameters
3449    /// - `mode_type`: The operation mode to set.
3450    ///
3451    /// Calls the openDAQ C function `daqDevice_setOperationModeRecursive()`.
3452    pub fn set_operation_mode_recursive(&self, mode_type: OperationModeType) -> Result<()> {
3453        let __code = unsafe { (crate::sys::api().daqDevice_setOperationModeRecursive)(self.as_raw() as *mut _, mode_type as u32) };
3454        check(__code, "daqDevice_setOperationModeRecursive")?;
3455        Ok(())
3456    }
3457
3458    /// Unlock a device with a session user. A device can only be unlocked by the same user who locked it. If no user was specified when the device was locked, any user will be able to unlock it.
3459    ///
3460    /// Calls the openDAQ C function `daqDevice_unlock()`.
3461    pub fn unlock(&self) -> Result<()> {
3462        let __code = unsafe { (crate::sys::api().daqDevice_unlock)(self.as_raw() as *mut _) };
3463        check(__code, "daqDevice_unlock")?;
3464        Ok(())
3465    }
3466
3467}
3468
3469impl FunctionBlock {
3470    /// Creates and adds a function block as the nested of current function block with the provided unique ID and returns it.
3471    ///
3472    /// # Parameters
3473    /// - `type_id`: The unique ID of the function block. Can be obtained from its corresponding Function Block Info object.
3474    /// - `config`: A config object to configure a function block with custom settings specific to that function block type.
3475    ///
3476    /// # Returns
3477    /// - `function_block`: The added function block.
3478    ///
3479    /// Calls the openDAQ C function `daqFunctionBlock_addFunctionBlock()`.
3480    pub fn add_function_block(&self, type_id: &str) -> Result<Option<FunctionBlock>> {
3481        let __type_id = crate::marshal::make_string(type_id)?;
3482        let mut __function_block: *mut sys::daqFunctionBlock = std::ptr::null_mut();
3483        let __code = unsafe { (crate::sys::api().daqFunctionBlock_addFunctionBlock)(self.as_raw() as *mut _, &mut __function_block, __type_id.as_ptr() as *mut _, std::ptr::null_mut()) };
3484        check(__code, "daqFunctionBlock_addFunctionBlock")?;
3485        Ok(unsafe { crate::marshal::take_object::<FunctionBlock>(__function_block as *mut _) })
3486    }
3487
3488    /// Creates and adds a function block as the nested of current function block with the provided unique ID and returns it.
3489    ///
3490    /// # Parameters
3491    /// - `type_id`: The unique ID of the function block. Can be obtained from its corresponding Function Block Info object.
3492    /// - `config`: A config object to configure a function block with custom settings specific to that function block type.
3493    ///
3494    /// # Returns
3495    /// - `function_block`: The added function block.
3496    ///
3497    /// Calls the openDAQ C function `daqFunctionBlock_addFunctionBlock()`.
3498    pub fn add_function_block_with(&self, type_id: &str, config: Option<&PropertyObject>) -> Result<Option<FunctionBlock>> {
3499        let __type_id = crate::marshal::make_string(type_id)?;
3500        let mut __function_block: *mut sys::daqFunctionBlock = std::ptr::null_mut();
3501        let __code = unsafe { (crate::sys::api().daqFunctionBlock_addFunctionBlock)(self.as_raw() as *mut _, &mut __function_block, __type_id.as_ptr() as *mut _, config.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
3502        check(__code, "daqFunctionBlock_addFunctionBlock")?;
3503        Ok(unsafe { crate::marshal::take_object::<FunctionBlock>(__function_block as *mut _) })
3504    }
3505
3506    /// Gets all nested function block types that are supported, containing their description.
3507    ///
3508    /// # Returns
3509    /// - `function_block_types`: A dictionary of available function block types.
3510    ///
3511    /// Calls the openDAQ C function `daqFunctionBlock_getAvailableFunctionBlockTypes()`.
3512    pub fn available_function_block_types(&self) -> Result<std::collections::HashMap<String, FunctionBlockType>> {
3513        let mut __function_block_types: *mut sys::daqDict = std::ptr::null_mut();
3514        let __code = unsafe { (crate::sys::api().daqFunctionBlock_getAvailableFunctionBlockTypes)(self.as_raw() as *mut _, &mut __function_block_types) };
3515        check(__code, "daqFunctionBlock_getAvailableFunctionBlockTypes")?;
3516        Ok(unsafe { crate::marshal::take_dict::<String, FunctionBlockType>(__function_block_types as *mut _, "daqFunctionBlock_getAvailableFunctionBlockTypes") }?)
3517    }
3518
3519    /// Gets an information structure contain metadata of the function block type.
3520    ///
3521    /// # Returns
3522    /// - `type`: The Function block type object.
3523    ///
3524    /// Calls the openDAQ C function `daqFunctionBlock_getFunctionBlockType()`.
3525    pub fn function_block_type(&self) -> Result<Option<FunctionBlockType>> {
3526        let mut __type_: *mut sys::daqFunctionBlockType = std::ptr::null_mut();
3527        let __code = unsafe { (crate::sys::api().daqFunctionBlock_getFunctionBlockType)(self.as_raw() as *mut _, &mut __type_) };
3528        check(__code, "daqFunctionBlock_getFunctionBlockType")?;
3529        Ok(unsafe { crate::marshal::take_object::<FunctionBlockType>(__type_ as *mut _) })
3530    }
3531
3532    /// Gets a list of sub-function blocks.
3533    ///
3534    /// # Parameters
3535    /// - `search_filter`: Provides optional parameters such as "recursive" and "visibleOnly" to modify the search pattern.
3536    ///
3537    /// # Returns
3538    /// - `function_blocks`: The list of sub-function blocks. If searchFilter is not provided, the returned list contains only visible function blocks and does not include those of child function blocks.
3539    ///
3540    /// Calls the openDAQ C function `daqFunctionBlock_getFunctionBlocks()`.
3541    pub fn function_blocks(&self) -> Result<Vec<FunctionBlock>> {
3542        let mut __function_blocks: *mut sys::daqList = std::ptr::null_mut();
3543        let __code = unsafe { (crate::sys::api().daqFunctionBlock_getFunctionBlocks)(self.as_raw() as *mut _, &mut __function_blocks, std::ptr::null_mut()) };
3544        check(__code, "daqFunctionBlock_getFunctionBlocks")?;
3545        Ok(unsafe { crate::marshal::take_list::<FunctionBlock>(__function_blocks as *mut _, "daqFunctionBlock_getFunctionBlocks") }?)
3546    }
3547
3548    /// Gets a list of sub-function blocks.
3549    ///
3550    /// # Parameters
3551    /// - `search_filter`: Provides optional parameters such as "recursive" and "visibleOnly" to modify the search pattern.
3552    ///
3553    /// # Returns
3554    /// - `function_blocks`: The list of sub-function blocks. If searchFilter is not provided, the returned list contains only visible function blocks and does not include those of child function blocks.
3555    ///
3556    /// Calls the openDAQ C function `daqFunctionBlock_getFunctionBlocks()`.
3557    pub fn function_blocks_with(&self, search_filter: Option<&SearchFilter>) -> Result<Vec<FunctionBlock>> {
3558        let mut __function_blocks: *mut sys::daqList = std::ptr::null_mut();
3559        let __code = unsafe { (crate::sys::api().daqFunctionBlock_getFunctionBlocks)(self.as_raw() as *mut _, &mut __function_blocks, search_filter.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
3560        check(__code, "daqFunctionBlock_getFunctionBlocks")?;
3561        Ok(unsafe { crate::marshal::take_list::<FunctionBlock>(__function_blocks as *mut _, "daqFunctionBlock_getFunctionBlocks") }?)
3562    }
3563
3564    /// Gets a list of the function block's input ports.
3565    ///
3566    /// # Parameters
3567    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3568    ///
3569    /// # Returns
3570    /// - `ports`: The list of input ports. If searchFilter is not provided, the returned list contains only visible input ports and does not include those of child function blocks.
3571    ///
3572    /// Calls the openDAQ C function `daqFunctionBlock_getInputPorts()`.
3573    pub fn input_ports(&self) -> Result<Vec<InputPort>> {
3574        let mut __ports: *mut sys::daqList = std::ptr::null_mut();
3575        let __code = unsafe { (crate::sys::api().daqFunctionBlock_getInputPorts)(self.as_raw() as *mut _, &mut __ports, std::ptr::null_mut()) };
3576        check(__code, "daqFunctionBlock_getInputPorts")?;
3577        Ok(unsafe { crate::marshal::take_list::<InputPort>(__ports as *mut _, "daqFunctionBlock_getInputPorts") }?)
3578    }
3579
3580    /// Gets a list of the function block's input ports.
3581    ///
3582    /// # Parameters
3583    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3584    ///
3585    /// # Returns
3586    /// - `ports`: The list of input ports. If searchFilter is not provided, the returned list contains only visible input ports and does not include those of child function blocks.
3587    ///
3588    /// Calls the openDAQ C function `daqFunctionBlock_getInputPorts()`.
3589    pub fn input_ports_with(&self, search_filter: Option<&SearchFilter>) -> Result<Vec<InputPort>> {
3590        let mut __ports: *mut sys::daqList = std::ptr::null_mut();
3591        let __code = unsafe { (crate::sys::api().daqFunctionBlock_getInputPorts)(self.as_raw() as *mut _, &mut __ports, search_filter.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
3592        check(__code, "daqFunctionBlock_getInputPorts")?;
3593        Ok(unsafe { crate::marshal::take_list::<InputPort>(__ports as *mut _, "daqFunctionBlock_getInputPorts") }?)
3594    }
3595
3596    /// Gets the list of the function block's output signals.
3597    ///
3598    /// # Parameters
3599    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3600    ///
3601    /// # Returns
3602    /// - `signals`: The list of output signals. If searchFilter is not provided, the returned list contains only visible signals and does not include those of child function blocks.
3603    ///
3604    /// Calls the openDAQ C function `daqFunctionBlock_getSignals()`.
3605    pub fn signals(&self) -> Result<Vec<Signal>> {
3606        let mut __signals: *mut sys::daqList = std::ptr::null_mut();
3607        let __code = unsafe { (crate::sys::api().daqFunctionBlock_getSignals)(self.as_raw() as *mut _, &mut __signals, std::ptr::null_mut()) };
3608        check(__code, "daqFunctionBlock_getSignals")?;
3609        Ok(unsafe { crate::marshal::take_list::<Signal>(__signals as *mut _, "daqFunctionBlock_getSignals") }?)
3610    }
3611
3612    /// Gets the list of the function block's output signals.
3613    ///
3614    /// # Parameters
3615    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3616    ///
3617    /// # Returns
3618    /// - `signals`: The list of output signals. If searchFilter is not provided, the returned list contains only visible signals and does not include those of child function blocks.
3619    ///
3620    /// Calls the openDAQ C function `daqFunctionBlock_getSignals()`.
3621    pub fn signals_with(&self, search_filter: Option<&SearchFilter>) -> Result<Vec<Signal>> {
3622        let mut __signals: *mut sys::daqList = std::ptr::null_mut();
3623        let __code = unsafe { (crate::sys::api().daqFunctionBlock_getSignals)(self.as_raw() as *mut _, &mut __signals, search_filter.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
3624        check(__code, "daqFunctionBlock_getSignals")?;
3625        Ok(unsafe { crate::marshal::take_list::<Signal>(__signals as *mut _, "daqFunctionBlock_getSignals") }?)
3626    }
3627
3628    /// Gets the list of the function block's visible output signals including signals from visible child function blocks.
3629    ///
3630    /// # Parameters
3631    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3632    ///
3633    /// # Returns
3634    /// - `signals`: The list of output signals.
3635    ///
3636    /// Calls the openDAQ C function `daqFunctionBlock_getSignalsRecursive()`.
3637    pub fn signals_recursive(&self) -> Result<Vec<Signal>> {
3638        let mut __signals: *mut sys::daqList = std::ptr::null_mut();
3639        let __code = unsafe { (crate::sys::api().daqFunctionBlock_getSignalsRecursive)(self.as_raw() as *mut _, &mut __signals, std::ptr::null_mut()) };
3640        check(__code, "daqFunctionBlock_getSignalsRecursive")?;
3641        Ok(unsafe { crate::marshal::take_list::<Signal>(__signals as *mut _, "daqFunctionBlock_getSignalsRecursive") }?)
3642    }
3643
3644    /// Gets the list of the function block's visible output signals including signals from visible child function blocks.
3645    ///
3646    /// # Parameters
3647    /// - `search_filter`: Provides an optional filter that filters out unwanted components and allows for recursion.
3648    ///
3649    /// # Returns
3650    /// - `signals`: The list of output signals.
3651    ///
3652    /// Calls the openDAQ C function `daqFunctionBlock_getSignalsRecursive()`.
3653    pub fn signals_recursive_with(&self, search_filter: Option<&SearchFilter>) -> Result<Vec<Signal>> {
3654        let mut __signals: *mut sys::daqList = std::ptr::null_mut();
3655        let __code = unsafe { (crate::sys::api().daqFunctionBlock_getSignalsRecursive)(self.as_raw() as *mut _, &mut __signals, search_filter.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
3656        check(__code, "daqFunctionBlock_getSignalsRecursive")?;
3657        Ok(unsafe { crate::marshal::take_list::<Signal>(__signals as *mut _, "daqFunctionBlock_getSignalsRecursive") }?)
3658    }
3659
3660    /// Gets the function block's status signal.
3661    ///
3662    /// # Returns
3663    /// - `status_signal`: The status signal. The status signal sends out a status event packet every time it is connected to an input port. Additionally, a status event packet is sent whenever the status of the function block changes.
3664    ///
3665    /// Calls the openDAQ C function `daqFunctionBlock_getStatusSignal()`.
3666    pub fn status_signal(&self) -> Result<Option<Signal>> {
3667        let mut __status_signal: *mut sys::daqSignal = std::ptr::null_mut();
3668        let __code = unsafe { (crate::sys::api().daqFunctionBlock_getStatusSignal)(self.as_raw() as *mut _, &mut __status_signal) };
3669        check(__code, "daqFunctionBlock_getStatusSignal")?;
3670        Ok(unsafe { crate::marshal::take_object::<Signal>(__status_signal as *mut _) })
3671    }
3672
3673    /// Removes the function block provided as argument, disconnecting its signals and input ports.
3674    ///
3675    /// # Parameters
3676    /// - `function_block`: The function block to be removed.
3677    ///
3678    /// Calls the openDAQ C function `daqFunctionBlock_removeFunctionBlock()`.
3679    pub fn remove_function_block(&self, function_block: &FunctionBlock) -> Result<()> {
3680        let __code = unsafe { (crate::sys::api().daqFunctionBlock_removeFunctionBlock)(self.as_raw() as *mut _, function_block.as_raw() as *mut _) };
3681        check(__code, "daqFunctionBlock_removeFunctionBlock")?;
3682        Ok(())
3683    }
3684
3685}
3686
3687impl LogFileInfoBuilder {
3688    /// Builds the log file info.
3689    ///
3690    /// # Returns
3691    /// - `log_file_info`: The log file info.
3692    ///
3693    /// Calls the openDAQ C function `daqLogFileInfoBuilder_build()`.
3694    pub fn build(&self) -> Result<Option<LogFileInfo>> {
3695        let mut __log_file_info: *mut sys::daqLogFileInfo = std::ptr::null_mut();
3696        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_build)(self.as_raw() as *mut _, &mut __log_file_info) };
3697        check(__code, "daqLogFileInfoBuilder_build")?;
3698        Ok(unsafe { crate::marshal::take_object::<LogFileInfo>(__log_file_info as *mut _) })
3699    }
3700
3701    /// Creates an LogFileInfo Builder with no parameters configured.
3702    ///
3703    /// Calls the openDAQ C function `daqLogFileInfoBuilder_createLogFileInfoBuilder()`.
3704    pub fn new() -> Result<LogFileInfoBuilder> {
3705        let mut __obj: *mut sys::daqLogFileInfoBuilder = std::ptr::null_mut();
3706        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_createLogFileInfoBuilder)(&mut __obj) };
3707        check(__code, "daqLogFileInfoBuilder_createLogFileInfoBuilder")?;
3708        Ok(unsafe { crate::marshal::require_object::<LogFileInfoBuilder>(__obj as *mut _, "daqLogFileInfoBuilder_createLogFileInfoBuilder") }?)
3709    }
3710
3711    /// Gets the description of the log file.
3712    ///
3713    /// # Returns
3714    /// - `description`: The description of the log file.
3715    ///
3716    /// Calls the openDAQ C function `daqLogFileInfoBuilder_getDescription()`.
3717    pub fn description(&self) -> Result<String> {
3718        let mut __description: *mut sys::daqString = std::ptr::null_mut();
3719        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_getDescription)(self.as_raw() as *mut _, &mut __description) };
3720        check(__code, "daqLogFileInfoBuilder_getDescription")?;
3721        Ok(unsafe { crate::marshal::take_string(__description) })
3722    }
3723
3724    /// Gets the encoding of the log file.
3725    ///
3726    /// # Returns
3727    /// - `encoding`: The encoding of the log file.
3728    ///
3729    /// Calls the openDAQ C function `daqLogFileInfoBuilder_getEncoding()`.
3730    pub fn encoding(&self) -> Result<String> {
3731        let mut __encoding: *mut sys::daqString = std::ptr::null_mut();
3732        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_getEncoding)(self.as_raw() as *mut _, &mut __encoding) };
3733        check(__code, "daqLogFileInfoBuilder_getEncoding")?;
3734        Ok(unsafe { crate::marshal::take_string(__encoding) })
3735    }
3736
3737    /// Gets the id of the log file. If the local path is not assigned, the id is equal to the `localPath + "/" + name`.
3738    ///
3739    /// # Parameters
3740    /// - `id`: The id of the log file.
3741    ///
3742    /// Calls the openDAQ C function `daqLogFileInfoBuilder_getId()`.
3743    pub fn id(&self) -> Result<String> {
3744        let mut __id: *mut sys::daqString = std::ptr::null_mut();
3745        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_getId)(self.as_raw() as *mut _, &mut __id) };
3746        check(__code, "daqLogFileInfoBuilder_getId")?;
3747        Ok(unsafe { crate::marshal::take_string(__id) })
3748    }
3749
3750    /// Gets the date of the last modification of the log file in ISO 8601 format.
3751    ///
3752    /// # Returns
3753    /// - `last_modified`: The date of the last modification of the log file.
3754    ///
3755    /// Calls the openDAQ C function `daqLogFileInfoBuilder_getLastModified()`.
3756    pub fn last_modified(&self) -> Result<String> {
3757        let mut __last_modified: *mut sys::daqString = std::ptr::null_mut();
3758        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_getLastModified)(self.as_raw() as *mut _, &mut __last_modified) };
3759        check(__code, "daqLogFileInfoBuilder_getLastModified")?;
3760        Ok(unsafe { crate::marshal::take_string(__last_modified) })
3761    }
3762
3763    /// Gets the local path of the log file. The local path can be not assigned as it is optional.
3764    ///
3765    /// # Returns
3766    /// - `local_path`: The local path of the log file.
3767    ///
3768    /// Calls the openDAQ C function `daqLogFileInfoBuilder_getLocalPath()`.
3769    pub fn local_path(&self) -> Result<String> {
3770        let mut __local_path: *mut sys::daqString = std::ptr::null_mut();
3771        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_getLocalPath)(self.as_raw() as *mut _, &mut __local_path) };
3772        check(__code, "daqLogFileInfoBuilder_getLocalPath")?;
3773        Ok(unsafe { crate::marshal::take_string(__local_path) })
3774    }
3775
3776    /// Gets the name of the log file.
3777    ///
3778    /// # Returns
3779    /// - `name`: The name of the log file.
3780    ///
3781    /// Calls the openDAQ C function `daqLogFileInfoBuilder_getName()`.
3782    pub fn name(&self) -> Result<String> {
3783        let mut __name: *mut sys::daqString = std::ptr::null_mut();
3784        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_getName)(self.as_raw() as *mut _, &mut __name) };
3785        check(__code, "daqLogFileInfoBuilder_getName")?;
3786        Ok(unsafe { crate::marshal::take_string(__name) })
3787    }
3788
3789    /// Gets the size of the log file in bytes.
3790    ///
3791    /// # Returns
3792    /// - `size`: The size of the log file.
3793    ///
3794    /// Calls the openDAQ C function `daqLogFileInfoBuilder_getSize()`.
3795    pub fn size(&self) -> Result<usize> {
3796        let mut __size: usize = Default::default();
3797        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_getSize)(self.as_raw() as *mut _, &mut __size) };
3798        check(__code, "daqLogFileInfoBuilder_getSize")?;
3799        Ok(__size)
3800    }
3801
3802    /// Sets the description of the log file.
3803    ///
3804    /// # Parameters
3805    /// - `description`: The description of the log file.
3806    ///
3807    /// Calls the openDAQ C function `daqLogFileInfoBuilder_setDescription()`.
3808    pub fn set_description(&self, description: &str) -> Result<()> {
3809        let __description = crate::marshal::make_string(description)?;
3810        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_setDescription)(self.as_raw() as *mut _, __description.as_ptr() as *mut _) };
3811        check(__code, "daqLogFileInfoBuilder_setDescription")?;
3812        Ok(())
3813    }
3814
3815    /// Sets the encoding of the log file.
3816    ///
3817    /// # Parameters
3818    /// - `encoding`: The encoding of the log file.
3819    ///
3820    /// Calls the openDAQ C function `daqLogFileInfoBuilder_setEncoding()`.
3821    pub fn set_encoding(&self, encoding: &str) -> Result<()> {
3822        let __encoding = crate::marshal::make_string(encoding)?;
3823        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_setEncoding)(self.as_raw() as *mut _, __encoding.as_ptr() as *mut _) };
3824        check(__code, "daqLogFileInfoBuilder_setEncoding")?;
3825        Ok(())
3826    }
3827
3828    /// Sets the id of the log file. Oth
3829    ///
3830    /// # Parameters
3831    /// - `id`: The id of the log file.
3832    ///
3833    /// Calls the openDAQ C function `daqLogFileInfoBuilder_setId()`.
3834    pub fn set_id(&self, id: &str) -> Result<()> {
3835        let __id = crate::marshal::make_string(id)?;
3836        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_setId)(self.as_raw() as *mut _, __id.as_ptr() as *mut _) };
3837        check(__code, "daqLogFileInfoBuilder_setId")?;
3838        Ok(())
3839    }
3840
3841    /// Sets the date of the last modification of the log file in ISO 8601 format.
3842    ///
3843    /// # Parameters
3844    /// - `last_modified`: The date of the last modification of the log file.
3845    ///
3846    /// Calls the openDAQ C function `daqLogFileInfoBuilder_setLastModified()`.
3847    pub fn set_last_modified(&self, last_modified: &str) -> Result<()> {
3848        let __last_modified = crate::marshal::make_string(last_modified)?;
3849        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_setLastModified)(self.as_raw() as *mut _, __last_modified.as_ptr() as *mut _) };
3850        check(__code, "daqLogFileInfoBuilder_setLastModified")?;
3851        Ok(())
3852    }
3853
3854    /// Sets the local path of the log file. The local path can be not assigned as it is optional.
3855    ///
3856    /// # Parameters
3857    /// - `local_path`: The local path of the log file.
3858    ///
3859    /// Calls the openDAQ C function `daqLogFileInfoBuilder_setLocalPath()`.
3860    pub fn set_local_path(&self, local_path: &str) -> Result<()> {
3861        let __local_path = crate::marshal::make_string(local_path)?;
3862        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_setLocalPath)(self.as_raw() as *mut _, __local_path.as_ptr() as *mut _) };
3863        check(__code, "daqLogFileInfoBuilder_setLocalPath")?;
3864        Ok(())
3865    }
3866
3867    /// Sets the name of the log file.
3868    ///
3869    /// # Parameters
3870    /// - `name`: The name of the log file.
3871    ///
3872    /// Calls the openDAQ C function `daqLogFileInfoBuilder_setName()`.
3873    pub fn set_name(&self, name: &str) -> Result<()> {
3874        let __name = crate::marshal::make_string(name)?;
3875        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_setName)(self.as_raw() as *mut _, __name.as_ptr() as *mut _) };
3876        check(__code, "daqLogFileInfoBuilder_setName")?;
3877        Ok(())
3878    }
3879
3880    /// Sets the size of the log file in bytes.
3881    ///
3882    /// # Parameters
3883    /// - `size`: The size of the log file.
3884    ///
3885    /// Calls the openDAQ C function `daqLogFileInfoBuilder_setSize()`.
3886    pub fn set_size(&self, size: usize) -> Result<()> {
3887        let __code = unsafe { (crate::sys::api().daqLogFileInfoBuilder_setSize)(self.as_raw() as *mut _, size) };
3888        check(__code, "daqLogFileInfoBuilder_setSize")?;
3889        Ok(())
3890    }
3891
3892}
3893
3894impl LogFileInfo {
3895    /// Creates an log file info from the builder.
3896    ///
3897    /// # Parameters
3898    /// - `builder`: The log file info builder.
3899    ///
3900    /// Calls the openDAQ C function `daqLogFileInfo_createLogFileInfoFromBuilder()`.
3901    pub fn from_builder(builder: &LogFileInfoBuilder) -> Result<LogFileInfo> {
3902        let mut __obj: *mut sys::daqLogFileInfo = std::ptr::null_mut();
3903        let __code = unsafe { (crate::sys::api().daqLogFileInfo_createLogFileInfoFromBuilder)(&mut __obj, builder.as_raw() as *mut _) };
3904        check(__code, "daqLogFileInfo_createLogFileInfoFromBuilder")?;
3905        Ok(unsafe { crate::marshal::require_object::<LogFileInfo>(__obj as *mut _, "daqLogFileInfo_createLogFileInfoFromBuilder") }?)
3906    }
3907
3908    /// Gets the description of the log file.
3909    ///
3910    /// # Returns
3911    /// - `description`: The description of the log file.
3912    ///
3913    /// Calls the openDAQ C function `daqLogFileInfo_getDescription()`.
3914    pub fn description(&self) -> Result<String> {
3915        let mut __description: *mut sys::daqString = std::ptr::null_mut();
3916        let __code = unsafe { (crate::sys::api().daqLogFileInfo_getDescription)(self.as_raw() as *mut _, &mut __description) };
3917        check(__code, "daqLogFileInfo_getDescription")?;
3918        Ok(unsafe { crate::marshal::take_string(__description) })
3919    }
3920
3921    /// Gets the encoding of the log file.
3922    ///
3923    /// # Returns
3924    /// - `encoding`: The encoding of the log file.
3925    ///
3926    /// Calls the openDAQ C function `daqLogFileInfo_getEncoding()`.
3927    pub fn encoding(&self) -> Result<String> {
3928        let mut __encoding: *mut sys::daqString = std::ptr::null_mut();
3929        let __code = unsafe { (crate::sys::api().daqLogFileInfo_getEncoding)(self.as_raw() as *mut _, &mut __encoding) };
3930        check(__code, "daqLogFileInfo_getEncoding")?;
3931        Ok(unsafe { crate::marshal::take_string(__encoding) })
3932    }
3933
3934    /// Gets the id of the log file in format `getLocalPath() + "/" + getName()`.
3935    ///
3936    /// # Returns
3937    /// - `id`: The id of the log file.
3938    ///
3939    /// Calls the openDAQ C function `daqLogFileInfo_getId()`.
3940    pub fn id(&self) -> Result<String> {
3941        let mut __id: *mut sys::daqString = std::ptr::null_mut();
3942        let __code = unsafe { (crate::sys::api().daqLogFileInfo_getId)(self.as_raw() as *mut _, &mut __id) };
3943        check(__code, "daqLogFileInfo_getId")?;
3944        Ok(unsafe { crate::marshal::take_string(__id) })
3945    }
3946
3947    /// Gets the date of the last modification of the log file in ISO 8601 format.
3948    ///
3949    /// # Returns
3950    /// - `last_modified`: The date of the last modification of the log file.
3951    ///
3952    /// Calls the openDAQ C function `daqLogFileInfo_getLastModified()`.
3953    pub fn last_modified(&self) -> Result<String> {
3954        let mut __last_modified: *mut sys::daqString = std::ptr::null_mut();
3955        let __code = unsafe { (crate::sys::api().daqLogFileInfo_getLastModified)(self.as_raw() as *mut _, &mut __last_modified) };
3956        check(__code, "daqLogFileInfo_getLastModified")?;
3957        Ok(unsafe { crate::marshal::take_string(__last_modified) })
3958    }
3959
3960    /// Gets the local path of the log file. The local path can be not assigned as it is optional.
3961    ///
3962    /// # Returns
3963    /// - `local_path`: The local path of the log file.
3964    ///
3965    /// Calls the openDAQ C function `daqLogFileInfo_getLocalPath()`.
3966    pub fn local_path(&self) -> Result<String> {
3967        let mut __local_path: *mut sys::daqString = std::ptr::null_mut();
3968        let __code = unsafe { (crate::sys::api().daqLogFileInfo_getLocalPath)(self.as_raw() as *mut _, &mut __local_path) };
3969        check(__code, "daqLogFileInfo_getLocalPath")?;
3970        Ok(unsafe { crate::marshal::take_string(__local_path) })
3971    }
3972
3973    /// Gets the name of the log file.
3974    ///
3975    /// # Returns
3976    /// - `name`: The name of the log file.
3977    ///
3978    /// Calls the openDAQ C function `daqLogFileInfo_getName()`.
3979    pub fn name(&self) -> Result<String> {
3980        let mut __name: *mut sys::daqString = std::ptr::null_mut();
3981        let __code = unsafe { (crate::sys::api().daqLogFileInfo_getName)(self.as_raw() as *mut _, &mut __name) };
3982        check(__code, "daqLogFileInfo_getName")?;
3983        Ok(unsafe { crate::marshal::take_string(__name) })
3984    }
3985
3986    /// Gets the size of the log file in bytes.
3987    ///
3988    /// # Returns
3989    /// - `size`: The size of the log file.
3990    ///
3991    /// Calls the openDAQ C function `daqLogFileInfo_getSize()`.
3992    pub fn size(&self) -> Result<usize> {
3993        let mut __size: usize = Default::default();
3994        let __code = unsafe { (crate::sys::api().daqLogFileInfo_getSize)(self.as_raw() as *mut _, &mut __size) };
3995        check(__code, "daqLogFileInfo_getSize")?;
3996        Ok(__size)
3997    }
3998
3999}
4000
4001impl NetworkInterface {
4002    /// Creates a property object containing default configuration values for a network interface.
4003    ///
4004    /// # Returns
4005    /// - `default_config`: The configuration object containing default settings for configuring device's network interface. The created object can be modified or directly submitted using the `submitConfiguration` method.
4006    ///
4007    /// Calls the openDAQ C function `daqNetworkInterface_createDefaultConfiguration()`.
4008    pub fn create_default_configuration(&self) -> Result<Option<PropertyObject>> {
4009        let mut __default_config: *mut sys::daqPropertyObject = std::ptr::null_mut();
4010        let __code = unsafe { (crate::sys::api().daqNetworkInterface_createDefaultConfiguration)(self.as_raw() as *mut _, &mut __default_config) };
4011        check(__code, "daqNetworkInterface_createDefaultConfiguration")?;
4012        Ok(unsafe { crate::marshal::take_object::<PropertyObject>(__default_config as *mut _) })
4013    }
4014
4015    /// Calls the openDAQ C function `daqNetworkInterface_createNetworkInterface()`.
4016    pub fn new(name: &str, owner_device_manufacturer_name: &str, owner_device_serial_number: &str, module_manager: impl Into<Value>) -> Result<NetworkInterface> {
4017        let __name = crate::marshal::make_string(name)?;
4018        let __owner_device_manufacturer_name = crate::marshal::make_string(owner_device_manufacturer_name)?;
4019        let __owner_device_serial_number = crate::marshal::make_string(owner_device_serial_number)?;
4020        let __module_manager = crate::value::to_daq(&module_manager.into())?;
4021        let mut __obj: *mut sys::daqNetworkInterface = std::ptr::null_mut();
4022        let __code = unsafe { (crate::sys::api().daqNetworkInterface_createNetworkInterface)(&mut __obj, __name.as_ptr() as *mut _, __owner_device_manufacturer_name.as_ptr() as *mut _, __owner_device_serial_number.as_ptr() as *mut _, crate::value::opt_ref_ptr(&__module_manager) as *mut _) };
4023        check(__code, "daqNetworkInterface_createNetworkInterface")?;
4024        Ok(unsafe { crate::marshal::require_object::<NetworkInterface>(__obj as *mut _, "daqNetworkInterface_createNetworkInterface") }?)
4025    }
4026
4027    /// Requests the currently active configuration for the network interface.
4028    ///
4029    /// # Returns
4030    /// - `config`: The property object containing the currently active configuration.
4031    ///
4032    /// # Errors
4033    /// - `OPENDAQ_ERR_NOTIMPLEMENTED`: if the device doesn't support retrieving the active configuration.
4034    ///
4035    /// Calls the openDAQ C function `daqNetworkInterface_requestCurrentConfiguration()`.
4036    pub fn request_current_configuration(&self) -> Result<Option<PropertyObject>> {
4037        let mut __config: *mut sys::daqPropertyObject = std::ptr::null_mut();
4038        let __code = unsafe { (crate::sys::api().daqNetworkInterface_requestCurrentConfiguration)(self.as_raw() as *mut _, &mut __config) };
4039        check(__code, "daqNetworkInterface_requestCurrentConfiguration")?;
4040        Ok(unsafe { crate::marshal::take_object::<PropertyObject>(__config as *mut _) })
4041    }
4042
4043    /// Submits a new configuration for the network interface.
4044    ///
4045    /// # Parameters
4046    /// - `config`: The new configuration to apply.
4047    ///
4048    /// # Errors
4049    /// - `OPENDAQ_SUCCESS`: if the new configuration is applied successfully; otherwise, returns an informative error code. The provided configuration must adhere to the required properties, including "dhcp4", "address4", "gateway4", and their IPv6 equivalents, as described in the class-level documentation.
4050    ///
4051    /// Calls the openDAQ C function `daqNetworkInterface_submitConfiguration()`.
4052    pub fn submit_configuration(&self, config: &PropertyObject) -> Result<()> {
4053        let __code = unsafe { (crate::sys::api().daqNetworkInterface_submitConfiguration)(self.as_raw() as *mut _, config.as_raw() as *mut _) };
4054        check(__code, "daqNetworkInterface_submitConfiguration")?;
4055        Ok(())
4056    }
4057
4058}
4059
4060impl ReferenceDomainInfo {
4061    /// Creates a Reference Domain Info using Builder
4062    ///
4063    /// # Parameters
4064    /// - `builder`: Reference Domain Info Builder
4065    ///
4066    /// Calls the openDAQ C function `daqReferenceDomainInfo_createReferenceDomainInfoFromBuilder()`.
4067    pub fn from_builder(builder: &ReferenceDomainInfoBuilder) -> Result<ReferenceDomainInfo> {
4068        let mut __obj: *mut sys::daqReferenceDomainInfo = std::ptr::null_mut();
4069        let __code = unsafe { (crate::sys::api().daqReferenceDomainInfo_createReferenceDomainInfoFromBuilder)(&mut __obj, builder.as_raw() as *mut _) };
4070        check(__code, "daqReferenceDomainInfo_createReferenceDomainInfoFromBuilder")?;
4071        Ok(unsafe { crate::marshal::require_object::<ReferenceDomainInfo>(__obj as *mut _, "daqReferenceDomainInfo_createReferenceDomainInfoFromBuilder") }?)
4072    }
4073
4074    /// Gets the Reference Domain ID.
4075    ///
4076    /// # Returns
4077    /// - `reference_domain_id`: The Reference Domain ID. If set, gives the common identifier of one domain group. Signals with the same Reference Domain ID share a common synchronization source (all the signals in a group either come from the same device or are synchronized using a protocol, such as PTP, NTP, IRIG, etc.). Those signals can always be read together, implying that a Multi Reader can be used to read the signals if their sampling rates are compatible.
4078    ///
4079    /// Calls the openDAQ C function `daqReferenceDomainInfo_getReferenceDomainId()`.
4080    pub fn reference_domain_id(&self) -> Result<String> {
4081        let mut __reference_domain_id: *mut sys::daqString = std::ptr::null_mut();
4082        let __code = unsafe { (crate::sys::api().daqReferenceDomainInfo_getReferenceDomainId)(self.as_raw() as *mut _, &mut __reference_domain_id) };
4083        check(__code, "daqReferenceDomainInfo_getReferenceDomainId")?;
4084        Ok(unsafe { crate::marshal::take_string(__reference_domain_id) })
4085    }
4086
4087    /// Gets the Reference Domain Offset.
4088    ///
4089    /// # Returns
4090    /// - `reference_domain_offset`: The Reference Domain Offset. If set, denotes the offset in ticks that must be added to the domain values of the signal for them to be equal to that of the sync source. The sync source will always have an offset of 0. This offset is changed only if the sync source changes and should be kept at 0 otherwise, allowing clients to differentiate between data loss and resync events. Any device can choose to always keep the offset at 0, representing changes in the offset in the domain packet values instead. This implementation prevents clients from differentiating between errors (data loss) and resync events. Additionally, if the offset is not configured, clients have no way of detecting a resync event in the case of asynchronous signals.
4091    ///
4092    /// Calls the openDAQ C function `daqReferenceDomainInfo_getReferenceDomainOffset()`.
4093    pub fn reference_domain_offset(&self) -> Result<Option<i64>> {
4094        let mut __reference_domain_offset: *mut sys::daqInteger = std::ptr::null_mut();
4095        let __code = unsafe { (crate::sys::api().daqReferenceDomainInfo_getReferenceDomainOffset)(self.as_raw() as *mut _, &mut __reference_domain_offset) };
4096        check(__code, "daqReferenceDomainInfo_getReferenceDomainOffset")?;
4097        Ok(unsafe { crate::value::take_boxed_int(__reference_domain_offset, "daqReferenceDomainInfo_getReferenceDomainOffset") }?)
4098    }
4099
4100    /// Gets the value that indicates the Reference Time Source.
4101    ///
4102    /// # Returns
4103    /// - `reference_time_protocol`: The value that indicates the Reference Time Source. If not set to Unknown, the domain quantity is “time”, and the timestamps are absolute according to the chosen time standard. The possible values are Gps, Tai, and Utc. This field is used to determine if two signals with different Domain IDs can be read together. Signals that have configured a Reference Time Source are trusted to have absolute time stamps that correlate to the chosen time standard (eg. two separate PTP networks, both driven through GPS can be read together, as their absolute time is the same).
4104    ///
4105    /// Calls the openDAQ C function `daqReferenceDomainInfo_getReferenceTimeProtocol()`.
4106    pub fn reference_time_protocol(&self) -> Result<TimeProtocol> {
4107        let mut __reference_time_protocol: u32 = 0;
4108        let __code = unsafe { (crate::sys::api().daqReferenceDomainInfo_getReferenceTimeProtocol)(self.as_raw() as *mut _, &mut __reference_time_protocol) };
4109        check(__code, "daqReferenceDomainInfo_getReferenceTimeProtocol")?;
4110        Ok(crate::marshal::enum_out(TimeProtocol::from_raw(__reference_time_protocol), "daqReferenceDomainInfo_getReferenceTimeProtocol")?)
4111    }
4112
4113    /// Gets the value that indicates if offset is used.
4114    ///
4115    /// # Returns
4116    /// - `uses_offset`: The value that indicates if offset is used. If False, a device will contain time jumps due to resync in the domain signal data.
4117    ///
4118    /// Calls the openDAQ C function `daqReferenceDomainInfo_getUsesOffset()`.
4119    pub fn uses_offset(&self) -> Result<UsesOffset> {
4120        let mut __uses_offset: u32 = 0;
4121        let __code = unsafe { (crate::sys::api().daqReferenceDomainInfo_getUsesOffset)(self.as_raw() as *mut _, &mut __uses_offset) };
4122        check(__code, "daqReferenceDomainInfo_getUsesOffset")?;
4123        Ok(crate::marshal::enum_out(UsesOffset::from_raw(__uses_offset), "daqReferenceDomainInfo_getUsesOffset")?)
4124    }
4125
4126}
4127
4128impl ServerCapabilityConfig {
4129    /// Sets the device's address
4130    ///
4131    /// # Returns
4132    /// - `address`: The device's address
4133    ///
4134    /// Calls the openDAQ C function `daqServerCapabilityConfig_addAddress()`.
4135    pub fn add_address(&self, address: &str) -> Result<()> {
4136        let __address = crate::marshal::make_string(address)?;
4137        let __code = unsafe { (crate::sys::api().daqServerCapabilityConfig_addAddress)(self.as_raw() as *mut _, __address.as_ptr() as *mut _) };
4138        check(__code, "daqServerCapabilityConfig_addAddress")?;
4139        Ok(())
4140    }
4141
4142    /// Calls the openDAQ C function `daqServerCapabilityConfig_addAddressInfo()`.
4143    pub fn add_address_info(&self, address_info: &AddressInfo) -> Result<()> {
4144        let __code = unsafe { (crate::sys::api().daqServerCapabilityConfig_addAddressInfo)(self.as_raw() as *mut _, address_info.as_raw() as *mut _) };
4145        check(__code, "daqServerCapabilityConfig_addAddressInfo")?;
4146        Ok(())
4147    }
4148
4149    /// Sets the connection string of device with current protocol
4150    ///
4151    /// # Parameters
4152    /// - `connection_string`: The connection string of device
4153    ///
4154    /// Calls the openDAQ C function `daqServerCapabilityConfig_addConnectionString()`.
4155    pub fn add_connection_string(&self, connection_string: &str) -> Result<()> {
4156        let __connection_string = crate::marshal::make_string(connection_string)?;
4157        let __code = unsafe { (crate::sys::api().daqServerCapabilityConfig_addConnectionString)(self.as_raw() as *mut _, __connection_string.as_ptr() as *mut _) };
4158        check(__code, "daqServerCapabilityConfig_addConnectionString")?;
4159        Ok(())
4160    }
4161
4162    /// Calls the openDAQ C function `daqServerCapabilityConfig_createServerCapability()`.
4163    pub fn server_capability(protocol_id: &str, protocol_name: &str, protocol_type: ProtocolType) -> Result<ServerCapabilityConfig> {
4164        let __protocol_id = crate::marshal::make_string(protocol_id)?;
4165        let __protocol_name = crate::marshal::make_string(protocol_name)?;
4166        let mut __obj: *mut sys::daqServerCapabilityConfig = std::ptr::null_mut();
4167        let __code = unsafe { (crate::sys::api().daqServerCapabilityConfig_createServerCapability)(&mut __obj, __protocol_id.as_ptr() as *mut _, __protocol_name.as_ptr() as *mut _, protocol_type as u32) };
4168        check(__code, "daqServerCapabilityConfig_createServerCapability")?;
4169        Ok(unsafe { crate::marshal::require_object::<ServerCapabilityConfig>(__obj as *mut _, "daqServerCapabilityConfig_createServerCapability") }?)
4170    }
4171
4172    /// Sets the connection string of device with current protocol
4173    ///
4174    /// # Parameters
4175    /// - `connection_string`: The connection string of device
4176    ///
4177    /// Calls the openDAQ C function `daqServerCapabilityConfig_setConnectionString()`.
4178    pub fn set_connection_string(&self, connection_string: &str) -> Result<()> {
4179        let __connection_string = crate::marshal::make_string(connection_string)?;
4180        let __code = unsafe { (crate::sys::api().daqServerCapabilityConfig_setConnectionString)(self.as_raw() as *mut _, __connection_string.as_ptr() as *mut _) };
4181        check(__code, "daqServerCapabilityConfig_setConnectionString")?;
4182        Ok(())
4183    }
4184
4185    /// Sets the type of connection
4186    ///
4187    /// # Parameters
4188    /// - `type`: The type of connection
4189    ///
4190    /// Calls the openDAQ C function `daqServerCapabilityConfig_setConnectionType()`.
4191    pub fn set_connection_type(&self, type_: &str) -> Result<()> {
4192        let __type_ = crate::marshal::make_string(type_)?;
4193        let __code = unsafe { (crate::sys::api().daqServerCapabilityConfig_setConnectionType)(self.as_raw() as *mut _, __type_.as_ptr() as *mut _) };
4194        check(__code, "daqServerCapabilityConfig_setConnectionType")?;
4195        Ok(())
4196    }
4197
4198    /// Sets the boolean flag indicating whether the server capability supports core event propagation to clients
4199    ///
4200    /// # Parameters
4201    /// - `enabled`: True if core events are enabled; false otherwise
4202    ///
4203    /// Calls the openDAQ C function `daqServerCapabilityConfig_setCoreEventsEnabled()`.
4204    pub fn set_core_events_enabled(&self, enabled: bool) -> Result<()> {
4205        let __code = unsafe { (crate::sys::api().daqServerCapabilityConfig_setCoreEventsEnabled)(self.as_raw() as *mut _, u8::from(enabled)) };
4206        check(__code, "daqServerCapabilityConfig_setCoreEventsEnabled")?;
4207        Ok(())
4208    }
4209
4210    /// Sets the port of the device
4211    ///
4212    /// # Parameters
4213    /// - `port`: The port of the device
4214    ///
4215    /// Calls the openDAQ C function `daqServerCapabilityConfig_setPort()`.
4216    pub fn set_port(&self, port: i64) -> Result<()> {
4217        let __port = crate::value::int_to_ref(port)?;
4218        let __code = unsafe { (crate::sys::api().daqServerCapabilityConfig_setPort)(self.as_raw() as *mut _, __port.as_ptr() as *mut _) };
4219        check(__code, "daqServerCapabilityConfig_setPort")?;
4220        Ok(())
4221    }
4222
4223    /// Sets the prefix of the connection string (eg. "daq.nd" or "daq.opcua")
4224    ///
4225    /// # Parameters
4226    /// - `prefix`: The connection string prefix
4227    ///
4228    /// Calls the openDAQ C function `daqServerCapabilityConfig_setPrefix()`.
4229    pub fn set_prefix(&self, prefix: &str) -> Result<()> {
4230        let __prefix = crate::marshal::make_string(prefix)?;
4231        let __code = unsafe { (crate::sys::api().daqServerCapabilityConfig_setPrefix)(self.as_raw() as *mut _, __prefix.as_ptr() as *mut _) };
4232        check(__code, "daqServerCapabilityConfig_setPrefix")?;
4233        Ok(())
4234    }
4235
4236    /// Sets the ID of protocol
4237    ///
4238    /// # Parameters
4239    /// - `protocol_id`: The ID of protocol
4240    ///
4241    /// Calls the openDAQ C function `daqServerCapabilityConfig_setProtocolId()`.
4242    pub fn set_protocol_id(&self, protocol_id: &str) -> Result<()> {
4243        let __protocol_id = crate::marshal::make_string(protocol_id)?;
4244        let __code = unsafe { (crate::sys::api().daqServerCapabilityConfig_setProtocolId)(self.as_raw() as *mut _, __protocol_id.as_ptr() as *mut _) };
4245        check(__code, "daqServerCapabilityConfig_setProtocolId")?;
4246        Ok(())
4247    }
4248
4249    /// Sets the name of protocol
4250    ///
4251    /// # Parameters
4252    /// - `protocol_name`: The name of protocol
4253    ///
4254    /// Calls the openDAQ C function `daqServerCapabilityConfig_setProtocolName()`.
4255    pub fn set_protocol_name(&self, protocol_name: &str) -> Result<()> {
4256        let __protocol_name = crate::marshal::make_string(protocol_name)?;
4257        let __code = unsafe { (crate::sys::api().daqServerCapabilityConfig_setProtocolName)(self.as_raw() as *mut _, __protocol_name.as_ptr() as *mut _) };
4258        check(__code, "daqServerCapabilityConfig_setProtocolName")?;
4259        Ok(())
4260    }
4261
4262    /// Sets the type of protocol
4263    ///
4264    /// # Parameters
4265    /// - `type`: The type of protocol
4266    ///
4267    /// Calls the openDAQ C function `daqServerCapabilityConfig_setProtocolType()`.
4268    pub fn set_protocol_type(&self, type_: ProtocolType) -> Result<()> {
4269        let __code = unsafe { (crate::sys::api().daqServerCapabilityConfig_setProtocolType)(self.as_raw() as *mut _, type_ as u32) };
4270        check(__code, "daqServerCapabilityConfig_setProtocolType")?;
4271        Ok(())
4272    }
4273
4274    /// Sets the protocol version
4275    ///
4276    /// # Parameters
4277    /// - `version`: The protocol version
4278    ///
4279    /// Calls the openDAQ C function `daqServerCapabilityConfig_setProtocolVersion()`.
4280    pub fn set_protocol_version(&self, version: &str) -> Result<()> {
4281        let __version = crate::marshal::make_string(version)?;
4282        let __code = unsafe { (crate::sys::api().daqServerCapabilityConfig_setProtocolVersion)(self.as_raw() as *mut _, __version.as_ptr() as *mut _) };
4283        check(__code, "daqServerCapabilityConfig_setProtocolVersion")?;
4284        Ok(())
4285    }
4286
4287}
4288
4289impl ServerCapability {
4290    /// Gets the list of address information objects.
4291    ///
4292    /// # Returns
4293    /// - `address_info`: The list of address information objects. Address information duplicates the connection string and address as available on the Server Capability object. Additionally, it provides information on what type of address it is (e.g., IPv4, IPv6), as well as whether the address is reachable.
4294    ///
4295    /// Calls the openDAQ C function `daqServerCapability_getAddressInfo()`.
4296    pub fn address_info(&self) -> Result<Vec<AddressInfo>> {
4297        let mut __address_info: *mut sys::daqList = std::ptr::null_mut();
4298        let __code = unsafe { (crate::sys::api().daqServerCapability_getAddressInfo)(self.as_raw() as *mut _, &mut __address_info) };
4299        check(__code, "daqServerCapability_getAddressInfo")?;
4300        Ok(unsafe { crate::marshal::take_list::<AddressInfo>(__address_info as *mut _, "daqServerCapability_getAddressInfo") }?)
4301    }
4302
4303    /// Gets the device's list of addresses with the current protocol.
4304    ///
4305    /// # Returns
4306    /// - `addresses`: The device's list of addresses (hosts)
4307    ///
4308    /// Calls the openDAQ C function `daqServerCapability_getAddresses()`.
4309    pub fn addresses(&self) -> Result<Vec<String>> {
4310        let mut __addresses: *mut sys::daqList = std::ptr::null_mut();
4311        let __code = unsafe { (crate::sys::api().daqServerCapability_getAddresses)(self.as_raw() as *mut _, &mut __addresses) };
4312        check(__code, "daqServerCapability_getAddresses")?;
4313        Ok(unsafe { crate::marshal::take_list::<String>(__addresses as *mut _, "daqServerCapability_getAddresses") }?)
4314    }
4315
4316    /// Gets the connection string of the device with the current protocol.
4317    ///
4318    /// # Returns
4319    /// - `connection_string`: The connection string of the device (URL to connect).
4320    ///
4321    /// Calls the openDAQ C function `daqServerCapability_getConnectionString()`.
4322    pub fn connection_string(&self) -> Result<String> {
4323        let mut __connection_string: *mut sys::daqString = std::ptr::null_mut();
4324        let __code = unsafe { (crate::sys::api().daqServerCapability_getConnectionString)(self.as_raw() as *mut _, &mut __connection_string) };
4325        check(__code, "daqServerCapability_getConnectionString")?;
4326        Ok(unsafe { crate::marshal::take_string(__connection_string) })
4327    }
4328
4329    /// Gets the connection string of the device with the current protocol.
4330    ///
4331    /// # Returns
4332    /// - `connection_strings`: The connection string of the device (URL to connect).
4333    ///
4334    /// Calls the openDAQ C function `daqServerCapability_getConnectionStrings()`.
4335    pub fn connection_strings(&self) -> Result<Vec<String>> {
4336        let mut __connection_strings: *mut sys::daqList = std::ptr::null_mut();
4337        let __code = unsafe { (crate::sys::api().daqServerCapability_getConnectionStrings)(self.as_raw() as *mut _, &mut __connection_strings) };
4338        check(__code, "daqServerCapability_getConnectionStrings")?;
4339        Ok(unsafe { crate::marshal::take_list::<String>(__connection_strings as *mut _, "daqServerCapability_getConnectionStrings") }?)
4340    }
4341
4342    /// Gets the type of connection supported by the device.
4343    ///
4344    /// # Returns
4345    /// - `type`: The type of connection (e.g., "TCP/IP").
4346    ///
4347    /// Calls the openDAQ C function `daqServerCapability_getConnectionType()`.
4348    pub fn connection_type(&self) -> Result<String> {
4349        let mut __type_: *mut sys::daqString = std::ptr::null_mut();
4350        let __code = unsafe { (crate::sys::api().daqServerCapability_getConnectionType)(self.as_raw() as *mut _, &mut __type_) };
4351        check(__code, "daqServerCapability_getConnectionType")?;
4352        Ok(unsafe { crate::marshal::take_string(__type_) })
4353    }
4354
4355    /// Gets the client update method supported by the device.
4356    ///
4357    /// # Returns
4358    /// - `enabled`: The client update method (Boolean value indicating if core events are enabled for communication between server and client device).
4359    ///
4360    /// Calls the openDAQ C function `daqServerCapability_getCoreEventsEnabled()`.
4361    pub fn core_events_enabled(&self) -> Result<bool> {
4362        let mut __enabled: u8 = 0;
4363        let __code = unsafe { (crate::sys::api().daqServerCapability_getCoreEventsEnabled)(self.as_raw() as *mut _, &mut __enabled) };
4364        check(__code, "daqServerCapability_getCoreEventsEnabled")?;
4365        Ok(__enabled != 0)
4366    }
4367
4368    /// Gets the port of the device with the current protocol.
4369    ///
4370    /// # Returns
4371    /// - `port`: The port of the device.
4372    ///
4373    /// Calls the openDAQ C function `daqServerCapability_getPort()`.
4374    pub fn port(&self) -> Result<Option<i64>> {
4375        let mut __port: *mut sys::daqInteger = std::ptr::null_mut();
4376        let __code = unsafe { (crate::sys::api().daqServerCapability_getPort)(self.as_raw() as *mut _, &mut __port) };
4377        check(__code, "daqServerCapability_getPort")?;
4378        Ok(unsafe { crate::value::take_boxed_int(__port, "daqServerCapability_getPort") }?)
4379    }
4380
4381    /// Gets the prefix of the connection string (eg. "daq.nd" or "daq.opcua")
4382    ///
4383    /// # Parameters
4384    /// - `prefix`: The connection string prefix
4385    ///
4386    /// Calls the openDAQ C function `daqServerCapability_getPrefix()`.
4387    pub fn prefix(&self) -> Result<String> {
4388        let mut __prefix: *mut sys::daqString = std::ptr::null_mut();
4389        let __code = unsafe { (crate::sys::api().daqServerCapability_getPrefix)(self.as_raw() as *mut _, &mut __prefix) };
4390        check(__code, "daqServerCapability_getPrefix")?;
4391        Ok(unsafe { crate::marshal::take_string(__prefix) })
4392    }
4393
4394    /// Gets the id of the protocol supported by the device. Should not contain spaces or special characters except for '_' and '-'.
4395    ///
4396    /// # Returns
4397    /// - `protocol_id`: The id of the protocol.
4398    ///
4399    /// Calls the openDAQ C function `daqServerCapability_getProtocolId()`.
4400    pub fn protocol_id(&self) -> Result<String> {
4401        let mut __protocol_id: *mut sys::daqString = std::ptr::null_mut();
4402        let __code = unsafe { (crate::sys::api().daqServerCapability_getProtocolId)(self.as_raw() as *mut _, &mut __protocol_id) };
4403        check(__code, "daqServerCapability_getProtocolId")?;
4404        Ok(unsafe { crate::marshal::take_string(__protocol_id) })
4405    }
4406
4407    /// Gets the name of the protocol supported by the device.
4408    ///
4409    /// # Returns
4410    /// - `protocol_name`: The name of the protocol (e.g., "OpenDAQNativeStreaming", "OpenDAQOPCUA", "OpenDAQLTStreaming").
4411    ///
4412    /// Calls the openDAQ C function `daqServerCapability_getProtocolName()`.
4413    pub fn protocol_name(&self) -> Result<String> {
4414        let mut __protocol_name: *mut sys::daqString = std::ptr::null_mut();
4415        let __code = unsafe { (crate::sys::api().daqServerCapability_getProtocolName)(self.as_raw() as *mut _, &mut __protocol_name) };
4416        check(__code, "daqServerCapability_getProtocolName")?;
4417        Ok(unsafe { crate::marshal::take_string(__protocol_name) })
4418    }
4419
4420    /// Gets the type of protocol supported by the device.
4421    ///
4422    /// # Returns
4423    /// - `type`: The type of protocol (Enumeration value reflecting protocol type: "ConfigurationAndStreaming", "Configuration", "Streaming", "Unknown").
4424    ///
4425    /// Calls the openDAQ C function `daqServerCapability_getProtocolType()`.
4426    pub fn protocol_type(&self) -> Result<ProtocolType> {
4427        let mut __type_: u32 = 0;
4428        let __code = unsafe { (crate::sys::api().daqServerCapability_getProtocolType)(self.as_raw() as *mut _, &mut __type_) };
4429        check(__code, "daqServerCapability_getProtocolType")?;
4430        Ok(crate::marshal::enum_out(ProtocolType::from_raw(__type_), "daqServerCapability_getProtocolType")?)
4431    }
4432
4433    /// Gets the protocol version supported by the device's protocol.
4434    ///
4435    /// # Returns
4436    /// - `version`: The protocol version.
4437    ///
4438    /// Calls the openDAQ C function `daqServerCapability_getProtocolVersion()`.
4439    pub fn protocol_version(&self) -> Result<String> {
4440        let mut __version: *mut sys::daqString = std::ptr::null_mut();
4441        let __code = unsafe { (crate::sys::api().daqServerCapability_getProtocolVersion)(self.as_raw() as *mut _, &mut __version) };
4442        check(__code, "daqServerCapability_getProtocolVersion")?;
4443        Ok(unsafe { crate::marshal::take_string(__version) })
4444    }
4445
4446}
4447
4448impl Server {
4449    /// Disables the server to be discovered by the clients.
4450    ///
4451    /// Calls the openDAQ C function `daqServer_disableDiscovery()`.
4452    pub fn disable_discovery(&self) -> Result<()> {
4453        let __code = unsafe { (crate::sys::api().daqServer_disableDiscovery)(self.as_raw() as *mut _) };
4454        check(__code, "daqServer_disableDiscovery")?;
4455        Ok(())
4456    }
4457
4458    /// Enables the server to be discovered by the clients.
4459    ///
4460    /// Calls the openDAQ C function `daqServer_enableDiscovery()`.
4461    pub fn enable_discovery(&self) -> Result<()> {
4462        let __code = unsafe { (crate::sys::api().daqServer_enableDiscovery)(self.as_raw() as *mut _) };
4463        check(__code, "daqServer_enableDiscovery")?;
4464        Ok(())
4465    }
4466
4467    /// Gets the server id.
4468    ///
4469    /// # Returns
4470    /// - `server_id`: The server id.
4471    ///
4472    /// Calls the openDAQ C function `daqServer_getId()`.
4473    pub fn id(&self) -> Result<String> {
4474        let mut __server_id: *mut sys::daqString = std::ptr::null_mut();
4475        let __code = unsafe { (crate::sys::api().daqServer_getId)(self.as_raw() as *mut _, &mut __server_id) };
4476        check(__code, "daqServer_getId")?;
4477        Ok(unsafe { crate::marshal::take_string(__server_id) })
4478    }
4479
4480    /// Gets a list of the server's signals.
4481    ///
4482    /// # Returns
4483    /// - `signals`: The flat list of signals. Server signals are most often the mirrored representations of signals that belong to the client connected to the instance via this server.
4484    ///
4485    /// Calls the openDAQ C function `daqServer_getSignals()`.
4486    pub fn signals(&self) -> Result<Vec<Signal>> {
4487        let mut __signals: *mut sys::daqList = std::ptr::null_mut();
4488        let __code = unsafe { (crate::sys::api().daqServer_getSignals)(self.as_raw() as *mut _, &mut __signals, std::ptr::null_mut()) };
4489        check(__code, "daqServer_getSignals")?;
4490        Ok(unsafe { crate::marshal::take_list::<Signal>(__signals as *mut _, "daqServer_getSignals") }?)
4491    }
4492
4493    /// Gets a list of the server's signals.
4494    ///
4495    /// # Returns
4496    /// - `signals`: The flat list of signals. Server signals are most often the mirrored representations of signals that belong to the client connected to the instance via this server.
4497    ///
4498    /// Calls the openDAQ C function `daqServer_getSignals()`.
4499    pub fn signals_with(&self, search_filter: Option<&SearchFilter>) -> Result<Vec<Signal>> {
4500        let mut __signals: *mut sys::daqList = std::ptr::null_mut();
4501        let __code = unsafe { (crate::sys::api().daqServer_getSignals)(self.as_raw() as *mut _, &mut __signals, search_filter.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
4502        check(__code, "daqServer_getSignals")?;
4503        Ok(unsafe { crate::marshal::take_list::<Signal>(__signals as *mut _, "daqServer_getSignals") }?)
4504    }
4505
4506    /// Gets a streaming source associated with server.
4507    ///
4508    /// # Returns
4509    /// - `streaming`: The streaming object that represents the server’s client-to-device streaming source. The streaming object is assigned on servers that support the generalized client-to-device streaming mechanism. The object is expected to be associated with mirrored server-side copies of client signals and is responsible for receiving their data sent from the client to the device.
4510    ///
4511    /// Calls the openDAQ C function `daqServer_getStreaming()`.
4512    pub fn streaming(&self) -> Result<Option<Streaming>> {
4513        let mut __streaming: *mut sys::daqStreaming = std::ptr::null_mut();
4514        let __code = unsafe { (crate::sys::api().daqServer_getStreaming)(self.as_raw() as *mut _, &mut __streaming) };
4515        check(__code, "daqServer_getStreaming")?;
4516        Ok(unsafe { crate::marshal::take_object::<Streaming>(__streaming as *mut _) })
4517    }
4518
4519    /// Stops the server. This is called when we remove the server from the Instance or Instance is closing.
4520    ///
4521    /// Calls the openDAQ C function `daqServer_stop()`.
4522    pub fn stop(&self) -> Result<()> {
4523        let __code = unsafe { (crate::sys::api().daqServer_stop)(self.as_raw() as *mut _) };
4524        check(__code, "daqServer_stop")?;
4525        Ok(())
4526    }
4527
4528}
4529
4530impl Streaming {
4531    /// Adds input ports to the Streaming.
4532    ///
4533    /// # Parameters
4534    /// - `input_ports`: The list of input ports to be added.
4535    ///
4536    /// # Errors
4537    /// - `OPENDAQ_ERR_DUPLICATEITEM`: if an input port on the list is already added to the Streaming.
4538    /// - `OPENDAQ_ERR_NOINTERFACE`: if an input port on the list is not a mirrored signal. After an input port is added to the Streaming, the Streaming automatically appears in the list of available streaming sources of an input port.
4539    ///
4540    /// Calls the openDAQ C function `daqStreaming_addInputPorts()`.
4541    pub fn add_input_ports(&self, input_ports: &[MirroredInputPortConfig]) -> Result<()> {
4542        let __input_ports = crate::marshal::list_from_interfaces(input_ports)?;
4543        let __code = unsafe { (crate::sys::api().daqStreaming_addInputPorts)(self.as_raw() as *mut _, __input_ports.as_ptr() as *mut _) };
4544        check(__code, "daqStreaming_addInputPorts")?;
4545        Ok(())
4546    }
4547
4548    /// Adds signals to the Streaming.
4549    ///
4550    /// # Parameters
4551    /// - `signals`: The list of signals to be added.
4552    ///
4553    /// # Errors
4554    /// - `OPENDAQ_ERR_DUPLICATEITEM`: if a signal on the list is already added to the Streaming.
4555    /// - `OPENDAQ_ERR_NOINTERFACE`: if a signal on the list is not a mirrored signal. After a signal is added to the Streaming, the Streaming automatically appears in the list of available streaming sources of a signal. Some signals, however, may be silently ignored without triggering an error - for example, private signals are excluded by default.
4556    ///
4557    /// Calls the openDAQ C function `daqStreaming_addSignals()`.
4558    pub fn add_signals(&self, signals: &[Signal]) -> Result<()> {
4559        let __signals = crate::marshal::list_from_interfaces(signals)?;
4560        let __code = unsafe { (crate::sys::api().daqStreaming_addSignals)(self.as_raw() as *mut _, __signals.as_ptr() as *mut _) };
4561        check(__code, "daqStreaming_addSignals")?;
4562        Ok(())
4563    }
4564
4565    /// Gets the active state of the Streaming.
4566    ///
4567    /// # Returns
4568    /// - `active`: True if the Streaming is active; false otherwise.
4569    ///
4570    /// Calls the openDAQ C function `daqStreaming_getActive()`.
4571    pub fn active(&self) -> Result<bool> {
4572        let mut __active: u8 = 0;
4573        let __code = unsafe { (crate::sys::api().daqStreaming_getActive)(self.as_raw() as *mut _, &mut __active) };
4574        check(__code, "daqStreaming_getActive")?;
4575        Ok(__active != 0)
4576    }
4577
4578    /// Checks whether client-to-device streaming is enabled for this streaming object.
4579    ///
4580    /// # Returns
4581    /// - `enabled`: The flag indicating if client-to-device streaming is enabled.
4582    ///
4583    /// Calls the openDAQ C function `daqStreaming_getClientToDeviceStreamingEnabled()`.
4584    pub fn client_to_device_streaming_enabled(&self) -> Result<bool> {
4585        let mut __enabled: u8 = 0;
4586        let __code = unsafe { (crate::sys::api().daqStreaming_getClientToDeviceStreamingEnabled)(self.as_raw() as *mut _, &mut __enabled) };
4587        check(__code, "daqStreaming_getClientToDeviceStreamingEnabled")?;
4588        Ok(__enabled != 0)
4589    }
4590
4591    /// Retrieves the current status of the streaming connection.
4592    ///
4593    /// # Returns
4594    /// - `connection_status`: The connection status, represented as an enumeration of type "ConnectionStatusType" with possible values: "Connected", "Reconnecting", or "Unrecoverable".
4595    ///
4596    /// Calls the openDAQ C function `daqStreaming_getConnectionStatus()`.
4597    pub fn connection_status(&self) -> Result<Option<Enumeration>> {
4598        let mut __connection_status: *mut sys::daqEnumeration = std::ptr::null_mut();
4599        let __code = unsafe { (crate::sys::api().daqStreaming_getConnectionStatus)(self.as_raw() as *mut _, &mut __connection_status) };
4600        check(__code, "daqStreaming_getConnectionStatus")?;
4601        Ok(unsafe { crate::marshal::take_object::<Enumeration>(__connection_status as *mut _) })
4602    }
4603
4604    /// Gets the string representation of a connection address used to connect to the streaming service of the device.
4605    ///
4606    /// # Returns
4607    /// - `connection_string`: The string used to connect to the streaming service.
4608    ///
4609    /// Calls the openDAQ C function `daqStreaming_getConnectionString()`.
4610    pub fn connection_string(&self) -> Result<String> {
4611        let mut __connection_string: *mut sys::daqString = std::ptr::null_mut();
4612        let __code = unsafe { (crate::sys::api().daqStreaming_getConnectionString)(self.as_raw() as *mut _, &mut __connection_string) };
4613        check(__code, "daqStreaming_getConnectionString")?;
4614        Ok(unsafe { crate::marshal::take_string(__connection_string) })
4615    }
4616
4617    /// Gets the global ID of the device (as it appears on the remote instance) to which this streaming object establishes a connection.
4618    ///
4619    /// # Returns
4620    /// - `device_remote_id`: The string representing the device's remote ID.
4621    ///
4622    /// Calls the openDAQ C function `daqStreaming_getOwnerDeviceRemoteId()`.
4623    pub fn owner_device_remote_id(&self) -> Result<String> {
4624        let mut __device_remote_id: *mut sys::daqString = std::ptr::null_mut();
4625        let __code = unsafe { (crate::sys::api().daqStreaming_getOwnerDeviceRemoteId)(self.as_raw() as *mut _, &mut __device_remote_id) };
4626        check(__code, "daqStreaming_getOwnerDeviceRemoteId")?;
4627        Ok(unsafe { crate::marshal::take_string(__device_remote_id) })
4628    }
4629
4630    /// Gets the identifier of the data transfer protocol (e.g., "OpenDAQNativeStreaming", "OpenDAQLTStreaming") used by this streaming object.
4631    ///
4632    /// # Returns
4633    /// - `protocol_id`: The string representing the protocol ID.
4634    ///
4635    /// Calls the openDAQ C function `daqStreaming_getProtocolId()`.
4636    pub fn protocol_id(&self) -> Result<String> {
4637        let mut __protocol_id: *mut sys::daqString = std::ptr::null_mut();
4638        let __code = unsafe { (crate::sys::api().daqStreaming_getProtocolId)(self.as_raw() as *mut _, &mut __protocol_id) };
4639        check(__code, "daqStreaming_getProtocolId")?;
4640        Ok(unsafe { crate::marshal::take_string(__protocol_id) })
4641    }
4642
4643    /// Removes all added input ports from the Streaming.
4644    ///
4645    /// Calls the openDAQ C function `daqStreaming_removeAllInputPorts()`.
4646    pub fn remove_all_input_ports(&self) -> Result<()> {
4647        let __code = unsafe { (crate::sys::api().daqStreaming_removeAllInputPorts)(self.as_raw() as *mut _) };
4648        check(__code, "daqStreaming_removeAllInputPorts")?;
4649        Ok(())
4650    }
4651
4652    /// Removes all added signals from the Streaming.
4653    ///
4654    /// Calls the openDAQ C function `daqStreaming_removeAllSignals()`.
4655    pub fn remove_all_signals(&self) -> Result<()> {
4656        let __code = unsafe { (crate::sys::api().daqStreaming_removeAllSignals)(self.as_raw() as *mut _) };
4657        check(__code, "daqStreaming_removeAllSignals")?;
4658        Ok(())
4659    }
4660
4661    /// Removes input ports from the Streaming.
4662    ///
4663    /// # Parameters
4664    /// - `input_ports`: The list of input ports to be removed.
4665    ///
4666    /// # Errors
4667    /// - `OPENDAQ_ERR_NOTFOUND`: if an input port on the list was not added to the Streaming. After an input port is removed from the Streaming, the Streaming is automatically excluded in the list of available streaming sources of an input port.
4668    ///
4669    /// Calls the openDAQ C function `daqStreaming_removeInputPorts()`.
4670    pub fn remove_input_ports(&self, input_ports: &[MirroredInputPortConfig]) -> Result<()> {
4671        let __input_ports = crate::marshal::list_from_interfaces(input_ports)?;
4672        let __code = unsafe { (crate::sys::api().daqStreaming_removeInputPorts)(self.as_raw() as *mut _, __input_ports.as_ptr() as *mut _) };
4673        check(__code, "daqStreaming_removeInputPorts")?;
4674        Ok(())
4675    }
4676
4677    /// Removes signals from the Streaming.
4678    ///
4679    /// # Parameters
4680    /// - `signals`: The list of signals to be removed.
4681    ///
4682    /// # Errors
4683    /// - `OPENDAQ_ERR_NOTFOUND`: if a signal on the list was not added to the Streaming. After a signal is removed from the Streaming, the Streaming is automatically excluded in the list of available streaming sources of a signal.
4684    ///
4685    /// Calls the openDAQ C function `daqStreaming_removeSignals()`.
4686    pub fn remove_signals(&self, signals: &[Signal]) -> Result<()> {
4687        let __signals = crate::marshal::list_from_interfaces(signals)?;
4688        let __code = unsafe { (crate::sys::api().daqStreaming_removeSignals)(self.as_raw() as *mut _, __signals.as_ptr() as *mut _) };
4689        check(__code, "daqStreaming_removeSignals")?;
4690        Ok(())
4691    }
4692
4693    /// Sets the Streaming to be either active or inactive.
4694    ///
4695    /// # Parameters
4696    /// - `active`: The new active state of the Streaming.
4697    ///
4698    /// Calls the openDAQ C function `daqStreaming_setActive()`.
4699    pub fn set_active(&self, active: bool) -> Result<()> {
4700        let __code = unsafe { (crate::sys::api().daqStreaming_setActive)(self.as_raw() as *mut _, u8::from(active)) };
4701        check(__code, "daqStreaming_setActive")?;
4702        Ok(())
4703    }
4704
4705}
4706
4707impl SyncComponent {
4708    /// Calls the openDAQ C function `daqSyncComponent_createSyncComponent()`.
4709    pub fn new(context: &Context, parse_failed_exception: &Component, local_id: &str) -> Result<SyncComponent> {
4710        let __local_id = crate::marshal::make_string(local_id)?;
4711        let mut __obj: *mut sys::daqSyncComponent = std::ptr::null_mut();
4712        let __code = unsafe { (crate::sys::api().daqSyncComponent_createSyncComponent)(&mut __obj, context.as_raw() as *mut _, parse_failed_exception.as_raw() as *mut _, __local_id.as_ptr() as *mut _) };
4713        check(__code, "daqSyncComponent_createSyncComponent")?;
4714        Ok(unsafe { crate::marshal::require_object::<SyncComponent>(__obj as *mut _, "daqSyncComponent_createSyncComponent") }?)
4715    }
4716
4717    /// Retrieves the list of interfaces associated with this synchronization component.
4718    ///
4719    /// # Returns
4720    /// - `interfaces`: List of interfaces associated with this component.
4721    ///
4722    /// Calls the openDAQ C function `daqSyncComponent_getInterfaces()`.
4723    pub fn interfaces(&self) -> Result<std::collections::HashMap<String, PropertyObject>> {
4724        let mut __interfaces: *mut sys::daqDict = std::ptr::null_mut();
4725        let __code = unsafe { (crate::sys::api().daqSyncComponent_getInterfaces)(self.as_raw() as *mut _, &mut __interfaces) };
4726        check(__code, "daqSyncComponent_getInterfaces")?;
4727        Ok(unsafe { crate::marshal::take_dict::<String, PropertyObject>(__interfaces as *mut _, "daqSyncComponent_getInterfaces") }?)
4728    }
4729
4730    /// Retrieves the selected sync source interface.
4731    ///
4732    /// # Returns
4733    /// - `selected_source`: The selected sync source interface.
4734    ///
4735    /// Calls the openDAQ C function `daqSyncComponent_getSelectedSource()`.
4736    pub fn selected_source(&self) -> Result<i64> {
4737        let mut __selected_source: i64 = Default::default();
4738        let __code = unsafe { (crate::sys::api().daqSyncComponent_getSelectedSource)(self.as_raw() as *mut _, &mut __selected_source) };
4739        check(__code, "daqSyncComponent_getSelectedSource")?;
4740        Ok(__selected_source)
4741    }
4742
4743    /// Retrieves the synchronization lock status.
4744    ///
4745    /// # Returns
4746    /// - `synchronization_locked`: True if synchronization is locked; false otherwise.
4747    ///
4748    /// Calls the openDAQ C function `daqSyncComponent_getSyncLocked()`.
4749    pub fn sync_locked(&self) -> Result<bool> {
4750        let mut __synchronization_locked: u8 = 0;
4751        let __code = unsafe { (crate::sys::api().daqSyncComponent_getSyncLocked)(self.as_raw() as *mut _, &mut __synchronization_locked) };
4752        check(__code, "daqSyncComponent_getSyncLocked")?;
4753        Ok(__synchronization_locked != 0)
4754    }
4755
4756    /// Sets the selected sync source interface.
4757    ///
4758    /// # Parameters
4759    /// - `selected_source`: The selected sync source interface.
4760    ///
4761    /// Calls the openDAQ C function `daqSyncComponent_setSelectedSource()`.
4762    pub fn set_selected_source(&self, selected_source: i64) -> Result<()> {
4763        let __code = unsafe { (crate::sys::api().daqSyncComponent_setSelectedSource)(self.as_raw() as *mut _, selected_source) };
4764        check(__code, "daqSyncComponent_setSelectedSource")?;
4765        Ok(())
4766    }
4767
4768}
4769
4770impl UserLock {
4771    /// Creates an unlocked UserLock object.
4772    ///
4773    /// Calls the openDAQ C function `daqUserLock_createUserLock()`.
4774    pub fn new() -> Result<UserLock> {
4775        let mut __obj: *mut sys::daqUserLock = std::ptr::null_mut();
4776        let __code = unsafe { (crate::sys::api().daqUserLock_createUserLock)(&mut __obj) };
4777        check(__code, "daqUserLock_createUserLock")?;
4778        Ok(unsafe { crate::marshal::require_object::<UserLock>(__obj as *mut _, "daqUserLock_createUserLock") }?)
4779    }
4780
4781    /// Forcefully unlock the object. A force unlock will always succeed, regardless of which user initially locked the object.
4782    ///
4783    /// Calls the openDAQ C function `daqUserLock_forceUnlock()`.
4784    pub fn force_unlock(&self) -> Result<()> {
4785        let __code = unsafe { (crate::sys::api().daqUserLock_forceUnlock)(self.as_raw() as *mut _) };
4786        check(__code, "daqUserLock_forceUnlock")?;
4787        Ok(())
4788    }
4789
4790    /// Returns true if the object is locked.
4791    ///
4792    /// # Parameters
4793    /// - `is_locked_out`: \[out\] True if the object is locked.
4794    ///
4795    /// Calls the openDAQ C function `daqUserLock_isLocked()`.
4796    pub fn is_locked(&self) -> Result<bool> {
4797        let mut __is_locked_out: u8 = 0;
4798        let __code = unsafe { (crate::sys::api().daqUserLock_isLocked)(self.as_raw() as *mut _, &mut __is_locked_out) };
4799        check(__code, "daqUserLock_isLocked")?;
4800        Ok(__is_locked_out != 0)
4801    }
4802
4803    /// Lock the object. Only the user who locked the object can unlock it. If the object was locked without a specific user, or with an anonymous user, any user can unlock it.
4804    ///
4805    /// # Parameters
4806    /// - `user`: User performing the lock action.
4807    ///
4808    /// Calls the openDAQ C function `daqUserLock_lock()`.
4809    pub fn lock(&self) -> Result<()> {
4810        let __code = unsafe { (crate::sys::api().daqUserLock_lock)(self.as_raw() as *mut _, std::ptr::null_mut()) };
4811        check(__code, "daqUserLock_lock")?;
4812        Ok(())
4813    }
4814
4815    /// Lock the object. Only the user who locked the object can unlock it. If the object was locked without a specific user, or with an anonymous user, any user can unlock it.
4816    ///
4817    /// # Parameters
4818    /// - `user`: User performing the lock action.
4819    ///
4820    /// Calls the openDAQ C function `daqUserLock_lock()`.
4821    pub fn lock_with(&self, user: Option<&User>) -> Result<()> {
4822        let __code = unsafe { (crate::sys::api().daqUserLock_lock)(self.as_raw() as *mut _, user.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
4823        check(__code, "daqUserLock_lock")?;
4824        Ok(())
4825    }
4826
4827    /// Unlock the object. Only the user who locked the object can unlock it. If the object was locked without a specific user, or with an anonymous user, any user can unlock it.
4828    ///
4829    /// # Parameters
4830    /// - `user`: User performing the unlock action.
4831    ///
4832    /// Calls the openDAQ C function `daqUserLock_unlock()`.
4833    pub fn unlock(&self) -> Result<()> {
4834        let __code = unsafe { (crate::sys::api().daqUserLock_unlock)(self.as_raw() as *mut _, std::ptr::null_mut()) };
4835        check(__code, "daqUserLock_unlock")?;
4836        Ok(())
4837    }
4838
4839    /// Unlock the object. Only the user who locked the object can unlock it. If the object was locked without a specific user, or with an anonymous user, any user can unlock it.
4840    ///
4841    /// # Parameters
4842    /// - `user`: User performing the unlock action.
4843    ///
4844    /// Calls the openDAQ C function `daqUserLock_unlock()`.
4845    pub fn unlock_with(&self, user: Option<&User>) -> Result<()> {
4846        let __code = unsafe { (crate::sys::api().daqUserLock_unlock)(self.as_raw() as *mut _, user.map_or(std::ptr::null_mut(), |o| o.as_raw() as *mut _)) };
4847        check(__code, "daqUserLock_unlock")?;
4848        Ok(())
4849    }
4850
4851}
4852