tinkerforge/bindings/
analog_in_v2_bricklet.rs

1/* ***********************************************************
2 * This file was automatically generated on 2024-02-27.      *
3 *                                                           *
4 * Rust Bindings Version 2.0.21                              *
5 *                                                           *
6 * If you have a bugfix for this file and want to commit it, *
7 * please fix the bug in the generator. You can find a link  *
8 * to the generators git repository on tinkerforge.com       *
9 *************************************************************/
10
11//! Measures DC voltage between 0V and 42V.
12//!
13//! See also the documentation [here](https://www.tinkerforge.com/en/doc/Software/Bricklets/AnalogInV2_Bricklet_Rust.html).
14use crate::{
15    byte_converter::*, converting_callback_receiver::ConvertingCallbackReceiver, converting_receiver::ConvertingReceiver, device::*,
16    ip_connection::GetRequestSender,
17};
18pub enum AnalogInV2BrickletFunction {
19    GetVoltage,
20    GetAnalogValue,
21    SetVoltageCallbackPeriod,
22    GetVoltageCallbackPeriod,
23    SetAnalogValueCallbackPeriod,
24    GetAnalogValueCallbackPeriod,
25    SetVoltageCallbackThreshold,
26    GetVoltageCallbackThreshold,
27    SetAnalogValueCallbackThreshold,
28    GetAnalogValueCallbackThreshold,
29    SetDebouncePeriod,
30    GetDebouncePeriod,
31    SetMovingAverage,
32    GetMovingAverage,
33    GetIdentity,
34    CallbackVoltage,
35    CallbackAnalogValue,
36    CallbackVoltageReached,
37    CallbackAnalogValueReached,
38}
39impl From<AnalogInV2BrickletFunction> for u8 {
40    fn from(fun: AnalogInV2BrickletFunction) -> Self {
41        match fun {
42            AnalogInV2BrickletFunction::GetVoltage => 1,
43            AnalogInV2BrickletFunction::GetAnalogValue => 2,
44            AnalogInV2BrickletFunction::SetVoltageCallbackPeriod => 3,
45            AnalogInV2BrickletFunction::GetVoltageCallbackPeriod => 4,
46            AnalogInV2BrickletFunction::SetAnalogValueCallbackPeriod => 5,
47            AnalogInV2BrickletFunction::GetAnalogValueCallbackPeriod => 6,
48            AnalogInV2BrickletFunction::SetVoltageCallbackThreshold => 7,
49            AnalogInV2BrickletFunction::GetVoltageCallbackThreshold => 8,
50            AnalogInV2BrickletFunction::SetAnalogValueCallbackThreshold => 9,
51            AnalogInV2BrickletFunction::GetAnalogValueCallbackThreshold => 10,
52            AnalogInV2BrickletFunction::SetDebouncePeriod => 11,
53            AnalogInV2BrickletFunction::GetDebouncePeriod => 12,
54            AnalogInV2BrickletFunction::SetMovingAverage => 13,
55            AnalogInV2BrickletFunction::GetMovingAverage => 14,
56            AnalogInV2BrickletFunction::GetIdentity => 255,
57            AnalogInV2BrickletFunction::CallbackVoltage => 15,
58            AnalogInV2BrickletFunction::CallbackAnalogValue => 16,
59            AnalogInV2BrickletFunction::CallbackVoltageReached => 17,
60            AnalogInV2BrickletFunction::CallbackAnalogValueReached => 18,
61        }
62    }
63}
64pub const ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_OFF: char = 'x';
65pub const ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_OUTSIDE: char = 'o';
66pub const ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_INSIDE: char = 'i';
67pub const ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_SMALLER: char = '<';
68pub const ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_GREATER: char = '>';
69
70#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
71pub struct VoltageCallbackThreshold {
72    pub option: char,
73    pub min: u16,
74    pub max: u16,
75}
76impl FromByteSlice for VoltageCallbackThreshold {
77    fn bytes_expected() -> usize { 5 }
78    fn from_le_byte_slice(bytes: &[u8]) -> VoltageCallbackThreshold {
79        VoltageCallbackThreshold {
80            option: <char>::from_le_byte_slice(&bytes[0..1]),
81            min: <u16>::from_le_byte_slice(&bytes[1..3]),
82            max: <u16>::from_le_byte_slice(&bytes[3..5]),
83        }
84    }
85}
86
87#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
88pub struct AnalogValueCallbackThreshold {
89    pub option: char,
90    pub min: u16,
91    pub max: u16,
92}
93impl FromByteSlice for AnalogValueCallbackThreshold {
94    fn bytes_expected() -> usize { 5 }
95    fn from_le_byte_slice(bytes: &[u8]) -> AnalogValueCallbackThreshold {
96        AnalogValueCallbackThreshold {
97            option: <char>::from_le_byte_slice(&bytes[0..1]),
98            min: <u16>::from_le_byte_slice(&bytes[1..3]),
99            max: <u16>::from_le_byte_slice(&bytes[3..5]),
100        }
101    }
102}
103
104#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
105pub struct Identity {
106    pub uid: String,
107    pub connected_uid: String,
108    pub position: char,
109    pub hardware_version: [u8; 3],
110    pub firmware_version: [u8; 3],
111    pub device_identifier: u16,
112}
113impl FromByteSlice for Identity {
114    fn bytes_expected() -> usize { 25 }
115    fn from_le_byte_slice(bytes: &[u8]) -> Identity {
116        Identity {
117            uid: <String>::from_le_byte_slice(&bytes[0..8]),
118            connected_uid: <String>::from_le_byte_slice(&bytes[8..16]),
119            position: <char>::from_le_byte_slice(&bytes[16..17]),
120            hardware_version: <[u8; 3]>::from_le_byte_slice(&bytes[17..20]),
121            firmware_version: <[u8; 3]>::from_le_byte_slice(&bytes[20..23]),
122            device_identifier: <u16>::from_le_byte_slice(&bytes[23..25]),
123        }
124    }
125}
126
127/// Measures DC voltage between 0V and 42V
128#[derive(Clone)]
129pub struct AnalogInV2Bricklet {
130    device: Device,
131}
132impl AnalogInV2Bricklet {
133    pub const DEVICE_IDENTIFIER: u16 = 251;
134    pub const DEVICE_DISPLAY_NAME: &'static str = "Analog In Bricklet 2.0";
135    /// Creates an object with the unique device ID `uid`. This object can then be used after the IP Connection `ip_connection` is connected.
136    pub fn new<T: GetRequestSender>(uid: &str, req_sender: T) -> AnalogInV2Bricklet {
137        let mut result = AnalogInV2Bricklet { device: Device::new([2, 0, 1], uid, req_sender, 0) };
138        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::GetVoltage) as usize] = ResponseExpectedFlag::AlwaysTrue;
139        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::GetAnalogValue) as usize] = ResponseExpectedFlag::AlwaysTrue;
140        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::SetVoltageCallbackPeriod) as usize] =
141            ResponseExpectedFlag::True;
142        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::GetVoltageCallbackPeriod) as usize] =
143            ResponseExpectedFlag::AlwaysTrue;
144        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::SetAnalogValueCallbackPeriod) as usize] =
145            ResponseExpectedFlag::True;
146        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::GetAnalogValueCallbackPeriod) as usize] =
147            ResponseExpectedFlag::AlwaysTrue;
148        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::SetVoltageCallbackThreshold) as usize] =
149            ResponseExpectedFlag::True;
150        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::GetVoltageCallbackThreshold) as usize] =
151            ResponseExpectedFlag::AlwaysTrue;
152        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::SetAnalogValueCallbackThreshold) as usize] =
153            ResponseExpectedFlag::True;
154        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::GetAnalogValueCallbackThreshold) as usize] =
155            ResponseExpectedFlag::AlwaysTrue;
156        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::SetDebouncePeriod) as usize] = ResponseExpectedFlag::True;
157        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::GetDebouncePeriod) as usize] =
158            ResponseExpectedFlag::AlwaysTrue;
159        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::SetMovingAverage) as usize] = ResponseExpectedFlag::False;
160        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::GetMovingAverage) as usize] = ResponseExpectedFlag::AlwaysTrue;
161        result.device.response_expected[u8::from(AnalogInV2BrickletFunction::GetIdentity) as usize] = ResponseExpectedFlag::AlwaysTrue;
162        result
163    }
164
165    /// Returns the response expected flag for the function specified by the function ID parameter.
166    /// It is true if the function is expected to send a response, false otherwise.
167    ///
168    /// For getter functions this is enabled by default and cannot be disabled, because those
169    /// functions will always send a response. For callback configuration functions it is enabled
170    /// by default too, but can be disabled by [`set_response_expected`](crate::analog_in_v2_bricklet::AnalogInV2Bricklet::set_response_expected).
171    /// For setter functions it is disabled by default and can be enabled.
172    ///
173    /// Enabling the response expected flag for a setter function allows to detect timeouts
174    /// and other error conditions calls of this setter as well. The device will then send a response
175    /// for this purpose. If this flag is disabled for a setter function then no response is sent
176    /// and errors are silently ignored, because they cannot be detected.
177    ///
178    /// See [`set_response_expected`](crate::analog_in_v2_bricklet::AnalogInV2Bricklet::set_response_expected) for the list of function ID constants available for this function.
179    pub fn get_response_expected(&mut self, fun: AnalogInV2BrickletFunction) -> Result<bool, GetResponseExpectedError> {
180        self.device.get_response_expected(u8::from(fun))
181    }
182
183    /// Changes the response expected flag of the function specified by the function ID parameter.
184    /// This flag can only be changed for setter (default value: false) and callback configuration
185    /// functions (default value: true). For getter functions it is always enabled.
186    ///
187    /// Enabling the response expected flag for a setter function allows to detect timeouts and
188    /// other error conditions calls of this setter as well. The device will then send a response
189    /// for this purpose. If this flag is disabled for a setter function then no response is sent
190    /// and errors are silently ignored, because they cannot be detected.
191    pub fn set_response_expected(
192        &mut self,
193        fun: AnalogInV2BrickletFunction,
194        response_expected: bool,
195    ) -> Result<(), SetResponseExpectedError> {
196        self.device.set_response_expected(u8::from(fun), response_expected)
197    }
198
199    /// Changes the response expected flag for all setter and callback configuration functions of this device at once.
200    pub fn set_response_expected_all(&mut self, response_expected: bool) { self.device.set_response_expected_all(response_expected) }
201
202    /// Returns the version of the API definition (major, minor, revision) implemented by this API bindings.
203    /// This is neither the release version of this API bindings nor does it tell you anything about the represented Brick or Bricklet.
204    pub fn get_api_version(&self) -> [u8; 3] { self.device.api_version }
205
206    /// This receiver is triggered periodically with the period that is set by
207    /// [`set_voltage_callback_period`]. The parameter is the voltage of the
208    /// sensor.
209    ///
210    /// Der [`get_voltage_callback_receiver`] receiver is only triggered if the voltage has changed since
211    /// the last triggering.
212    ///
213    /// [`set_voltage_callback_period`]: #method.set_voltage_callback_period
214    /// [`get_voltage_callback_receiver`]: #method.get_voltage_callback_receiver
215    pub fn get_voltage_callback_receiver(&self) -> ConvertingCallbackReceiver<u16> {
216        self.device.get_callback_receiver(u8::from(AnalogInV2BrickletFunction::CallbackVoltage))
217    }
218
219    /// This receiver is triggered periodically with the period that is set by
220    /// [`set_analog_value_callback_period`]. The parameter is the analog
221    /// value of the sensor.
222    ///
223    /// The [`get_analog_value_callback_receiver`] receiver is only triggered if the voltage has changed
224    /// since the last triggering.
225    pub fn get_analog_value_callback_receiver(&self) -> ConvertingCallbackReceiver<u16> {
226        self.device.get_callback_receiver(u8::from(AnalogInV2BrickletFunction::CallbackAnalogValue))
227    }
228
229    /// This receiver is triggered when the threshold as set by
230    /// [`set_voltage_callback_threshold`] is reached.
231    /// The parameter is the voltage of the sensor.
232    ///
233    /// If the threshold keeps being reached, the receiver is triggered periodically
234    /// with the period as set by [`set_debounce_period`].
235    pub fn get_voltage_reached_callback_receiver(&self) -> ConvertingCallbackReceiver<u16> {
236        self.device.get_callback_receiver(u8::from(AnalogInV2BrickletFunction::CallbackVoltageReached))
237    }
238
239    /// This receiver is triggered when the threshold as set by
240    /// [`set_analog_value_callback_threshold`] is reached.
241    /// The parameter is the analog value of the sensor.
242    ///
243    /// If the threshold keeps being reached, the receiver is triggered periodically
244    /// with the period as set by [`set_debounce_period`].
245    pub fn get_analog_value_reached_callback_receiver(&self) -> ConvertingCallbackReceiver<u16> {
246        self.device.get_callback_receiver(u8::from(AnalogInV2BrickletFunction::CallbackAnalogValueReached))
247    }
248
249    /// Returns the measured voltage. The resolution is approximately 10mV.
250    ///
251    /// If you want to get the voltage periodically, it is recommended to use the
252    /// [`get_voltage_callback_receiver`] receiver and set the period with
253    /// [`set_voltage_callback_period`].
254    pub fn get_voltage(&self) -> ConvertingReceiver<u16> {
255        let payload = vec![0; 0];
256
257        self.device.get(u8::from(AnalogInV2BrickletFunction::GetVoltage), payload)
258    }
259
260    /// Returns the value as read by a 12-bit analog-to-digital converter.
261    ///
262    /// If you want the analog value periodically, it is recommended to use the
263    /// [`get_analog_value_callback_receiver`] receiver and set the period with
264    /// [`set_analog_value_callback_period`].
265    pub fn get_analog_value(&self) -> ConvertingReceiver<u16> {
266        let payload = vec![0; 0];
267
268        self.device.get(u8::from(AnalogInV2BrickletFunction::GetAnalogValue), payload)
269    }
270
271    /// Sets the period with which the [`get_voltage_callback_receiver`] receiver is triggered
272    /// periodically. A value of 0 turns the receiver off.
273    ///
274    /// The [`get_voltage_callback_receiver`] receiver is only triggered if the voltage has changed since
275    /// the last triggering.
276    pub fn set_voltage_callback_period(&self, period: u32) -> ConvertingReceiver<()> {
277        let mut payload = vec![0; 4];
278        payload[0..4].copy_from_slice(&<u32>::to_le_byte_vec(period));
279
280        self.device.set(u8::from(AnalogInV2BrickletFunction::SetVoltageCallbackPeriod), payload)
281    }
282
283    /// Returns the period as set by [`set_voltage_callback_period`].
284    pub fn get_voltage_callback_period(&self) -> ConvertingReceiver<u32> {
285        let payload = vec![0; 0];
286
287        self.device.get(u8::from(AnalogInV2BrickletFunction::GetVoltageCallbackPeriod), payload)
288    }
289
290    /// Sets the period with which the [`get_analog_value_callback_receiver`] receiver is triggered
291    /// periodically. A value of 0 turns the receiver off.
292    ///
293    /// The [`get_analog_value_callback_receiver`] receiver is only triggered if the analog value has
294    /// changed since the last triggering.
295    pub fn set_analog_value_callback_period(&self, period: u32) -> ConvertingReceiver<()> {
296        let mut payload = vec![0; 4];
297        payload[0..4].copy_from_slice(&<u32>::to_le_byte_vec(period));
298
299        self.device.set(u8::from(AnalogInV2BrickletFunction::SetAnalogValueCallbackPeriod), payload)
300    }
301
302    /// Returns the period as set by [`set_analog_value_callback_period`].
303    pub fn get_analog_value_callback_period(&self) -> ConvertingReceiver<u32> {
304        let payload = vec![0; 0];
305
306        self.device.get(u8::from(AnalogInV2BrickletFunction::GetAnalogValueCallbackPeriod), payload)
307    }
308
309    /// Sets the thresholds for the [`get_voltage_reached_callback_receiver`] receiver.
310    ///
311    /// The following options are possible:
312    ///
313    ///  Option| Description
314    ///  --- | ---
315    ///  'x'|    Receiver is turned off
316    ///  'o'|    Receiver is triggered when the voltage is *outside* the min and max values
317    ///  'i'|    Receiver is triggered when the voltage is *inside* the min and max values
318    ///  '<'|    Receiver is triggered when the voltage is smaller than the min value (max is ignored)
319    ///  '>'|    Receiver is triggered when the voltage is greater than the min value (max is ignored)
320    ///
321    /// Associated constants:
322    /// * ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_OFF
323    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_OUTSIDE
324    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_INSIDE
325    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_SMALLER
326    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_GREATER
327    pub fn set_voltage_callback_threshold(&self, option: char, min: u16, max: u16) -> ConvertingReceiver<()> {
328        let mut payload = vec![0; 5];
329        payload[0..1].copy_from_slice(&<char>::to_le_byte_vec(option));
330        payload[1..3].copy_from_slice(&<u16>::to_le_byte_vec(min));
331        payload[3..5].copy_from_slice(&<u16>::to_le_byte_vec(max));
332
333        self.device.set(u8::from(AnalogInV2BrickletFunction::SetVoltageCallbackThreshold), payload)
334    }
335
336    /// Returns the threshold as set by [`set_voltage_callback_threshold`].
337    ///
338    /// Associated constants:
339    /// * ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_OFF
340    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_OUTSIDE
341    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_INSIDE
342    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_SMALLER
343    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_GREATER
344    pub fn get_voltage_callback_threshold(&self) -> ConvertingReceiver<VoltageCallbackThreshold> {
345        let payload = vec![0; 0];
346
347        self.device.get(u8::from(AnalogInV2BrickletFunction::GetVoltageCallbackThreshold), payload)
348    }
349
350    /// Sets the thresholds for the [`get_analog_value_reached_callback_receiver`] receiver.
351    ///
352    /// The following options are possible:
353    ///
354    ///  Option| Description
355    ///  --- | ---
356    ///  'x'|    Receiver is turned off
357    ///  'o'|    Receiver is triggered when the analog value is *outside* the min and max values
358    ///  'i'|    Receiver is triggered when the analog value is *inside* the min and max values
359    ///  '<'|    Receiver is triggered when the analog value is smaller than the min value (max is ignored)
360    ///  '>'|    Receiver is triggered when the analog value is greater than the min value (max is ignored)
361    ///
362    /// Associated constants:
363    /// * ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_OFF
364    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_OUTSIDE
365    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_INSIDE
366    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_SMALLER
367    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_GREATER
368    pub fn set_analog_value_callback_threshold(&self, option: char, min: u16, max: u16) -> ConvertingReceiver<()> {
369        let mut payload = vec![0; 5];
370        payload[0..1].copy_from_slice(&<char>::to_le_byte_vec(option));
371        payload[1..3].copy_from_slice(&<u16>::to_le_byte_vec(min));
372        payload[3..5].copy_from_slice(&<u16>::to_le_byte_vec(max));
373
374        self.device.set(u8::from(AnalogInV2BrickletFunction::SetAnalogValueCallbackThreshold), payload)
375    }
376
377    /// Returns the threshold as set by [`set_analog_value_callback_threshold`].
378    ///
379    /// Associated constants:
380    /// * ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_OFF
381    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_OUTSIDE
382    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_INSIDE
383    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_SMALLER
384    ///	* ANALOG_IN_V2_BRICKLET_THRESHOLD_OPTION_GREATER
385    pub fn get_analog_value_callback_threshold(&self) -> ConvertingReceiver<AnalogValueCallbackThreshold> {
386        let payload = vec![0; 0];
387
388        self.device.get(u8::from(AnalogInV2BrickletFunction::GetAnalogValueCallbackThreshold), payload)
389    }
390
391    /// Sets the period with which the threshold receivers
392    ///
393    /// * [`get_voltage_reached_callback_receiver`],
394    /// * [`get_analog_value_reached_callback_receiver`]
395    ///
396    /// are triggered, if the thresholds
397    ///
398    /// * [`set_voltage_callback_threshold`],
399    /// * [`set_analog_value_callback_threshold`]
400    ///
401    /// keep being reached.
402    pub fn set_debounce_period(&self, debounce: u32) -> ConvertingReceiver<()> {
403        let mut payload = vec![0; 4];
404        payload[0..4].copy_from_slice(&<u32>::to_le_byte_vec(debounce));
405
406        self.device.set(u8::from(AnalogInV2BrickletFunction::SetDebouncePeriod), payload)
407    }
408
409    /// Returns the debounce period as set by [`set_debounce_period`].
410    pub fn get_debounce_period(&self) -> ConvertingReceiver<u32> {
411        let payload = vec![0; 0];
412
413        self.device.get(u8::from(AnalogInV2BrickletFunction::GetDebouncePeriod), payload)
414    }
415
416    /// Sets the length of a [moving averaging](https://en.wikipedia.org/wiki/Moving_average)__
417    /// for the voltage.
418    ///
419    /// Setting the length to 1 will turn the averaging off. With less
420    /// averaging, there is more noise on the data.
421    pub fn set_moving_average(&self, average: u8) -> ConvertingReceiver<()> {
422        let mut payload = vec![0; 1];
423        payload[0..1].copy_from_slice(&<u8>::to_le_byte_vec(average));
424
425        self.device.set(u8::from(AnalogInV2BrickletFunction::SetMovingAverage), payload)
426    }
427
428    /// Returns the length of the moving average as set by [`set_moving_average`].
429    pub fn get_moving_average(&self) -> ConvertingReceiver<u8> {
430        let payload = vec![0; 0];
431
432        self.device.get(u8::from(AnalogInV2BrickletFunction::GetMovingAverage), payload)
433    }
434
435    /// Returns the UID, the UID where the Bricklet is connected to,
436    /// the position, the hardware and firmware version as well as the
437    /// device identifier.
438    ///
439    /// The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
440    /// A Bricklet connected to an [Isolator Bricklet](isolator_bricklet) is always at
441    /// position 'z'.
442    ///
443    /// The device identifier numbers can be found [here](device_identifier).
444    /// |device_identifier_constant|
445    pub fn get_identity(&self) -> ConvertingReceiver<Identity> {
446        let payload = vec![0; 0];
447
448        self.device.get(u8::from(AnalogInV2BrickletFunction::GetIdentity), payload)
449    }
450}