tinkerforge_async/bindings/
load_cell_bricklet.rs

1/* ***********************************************************
2 * This file was automatically generated on 2024-02-16.      *
3 *                                                           *
4 * Rust Bindings Version 2.0.20                              *
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 weight with a load cell.
12//!
13//! See also the documentation [here](https://www.tinkerforge.com/en/doc/Software/Bricklets/LoadCell_Bricklet_Rust.html).
14#[allow(unused_imports)]
15use crate::{
16    base58::Uid, byte_converter::*, device::*, error::TinkerforgeError, ip_connection::async_io::AsyncIpConnection,
17    low_level_traits::LowLevelRead,
18};
19#[allow(unused_imports)]
20use futures_core::Stream;
21#[allow(unused_imports)]
22use tokio_stream::StreamExt;
23pub enum LoadCellBrickletFunction {
24    GetWeight,
25    SetWeightCallbackPeriod,
26    GetWeightCallbackPeriod,
27    SetWeightCallbackThreshold,
28    GetWeightCallbackThreshold,
29    SetDebouncePeriod,
30    GetDebouncePeriod,
31    SetMovingAverage,
32    GetMovingAverage,
33    LedOn,
34    LedOff,
35    IsLedOn,
36    Calibrate,
37    Tare,
38    SetConfiguration,
39    GetConfiguration,
40    GetIdentity,
41    CallbackWeight,
42    CallbackWeightReached,
43}
44impl From<LoadCellBrickletFunction> for u8 {
45    fn from(fun: LoadCellBrickletFunction) -> Self {
46        match fun {
47            LoadCellBrickletFunction::GetWeight => 1,
48            LoadCellBrickletFunction::SetWeightCallbackPeriod => 2,
49            LoadCellBrickletFunction::GetWeightCallbackPeriod => 3,
50            LoadCellBrickletFunction::SetWeightCallbackThreshold => 4,
51            LoadCellBrickletFunction::GetWeightCallbackThreshold => 5,
52            LoadCellBrickletFunction::SetDebouncePeriod => 6,
53            LoadCellBrickletFunction::GetDebouncePeriod => 7,
54            LoadCellBrickletFunction::SetMovingAverage => 8,
55            LoadCellBrickletFunction::GetMovingAverage => 9,
56            LoadCellBrickletFunction::LedOn => 10,
57            LoadCellBrickletFunction::LedOff => 11,
58            LoadCellBrickletFunction::IsLedOn => 12,
59            LoadCellBrickletFunction::Calibrate => 13,
60            LoadCellBrickletFunction::Tare => 14,
61            LoadCellBrickletFunction::SetConfiguration => 15,
62            LoadCellBrickletFunction::GetConfiguration => 16,
63            LoadCellBrickletFunction::GetIdentity => 255,
64            LoadCellBrickletFunction::CallbackWeight => 17,
65            LoadCellBrickletFunction::CallbackWeightReached => 18,
66        }
67    }
68}
69pub const LOAD_CELL_BRICKLET_THRESHOLD_OPTION_OFF: char = 'x';
70pub const LOAD_CELL_BRICKLET_THRESHOLD_OPTION_OUTSIDE: char = 'o';
71pub const LOAD_CELL_BRICKLET_THRESHOLD_OPTION_INSIDE: char = 'i';
72pub const LOAD_CELL_BRICKLET_THRESHOLD_OPTION_SMALLER: char = '<';
73pub const LOAD_CELL_BRICKLET_THRESHOLD_OPTION_GREATER: char = '>';
74pub const LOAD_CELL_BRICKLET_RATE_10HZ: u8 = 0;
75pub const LOAD_CELL_BRICKLET_RATE_80HZ: u8 = 1;
76pub const LOAD_CELL_BRICKLET_GAIN_128X: u8 = 0;
77pub const LOAD_CELL_BRICKLET_GAIN_64X: u8 = 1;
78pub const LOAD_CELL_BRICKLET_GAIN_32X: u8 = 2;
79
80#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
81pub struct WeightCallbackThreshold {
82    pub option: char,
83    pub min: i32,
84    pub max: i32,
85}
86impl FromByteSlice for WeightCallbackThreshold {
87    fn bytes_expected() -> usize {
88        9
89    }
90    fn from_le_byte_slice(bytes: &[u8]) -> WeightCallbackThreshold {
91        WeightCallbackThreshold {
92            option: <char>::from_le_byte_slice(&bytes[0..1]),
93            min: <i32>::from_le_byte_slice(&bytes[1..5]),
94            max: <i32>::from_le_byte_slice(&bytes[5..9]),
95        }
96    }
97}
98
99#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
100pub struct Configuration {
101    pub rate: u8,
102    pub gain: u8,
103}
104impl FromByteSlice for Configuration {
105    fn bytes_expected() -> usize {
106        2
107    }
108    fn from_le_byte_slice(bytes: &[u8]) -> Configuration {
109        Configuration { rate: <u8>::from_le_byte_slice(&bytes[0..1]), gain: <u8>::from_le_byte_slice(&bytes[1..2]) }
110    }
111}
112
113#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
114pub struct Identity {
115    pub uid: String,
116    pub connected_uid: String,
117    pub position: char,
118    pub hardware_version: [u8; 3],
119    pub firmware_version: [u8; 3],
120    pub device_identifier: u16,
121}
122impl FromByteSlice for Identity {
123    fn bytes_expected() -> usize {
124        25
125    }
126    fn from_le_byte_slice(bytes: &[u8]) -> Identity {
127        Identity {
128            uid: <String>::from_le_byte_slice(&bytes[0..8]),
129            connected_uid: <String>::from_le_byte_slice(&bytes[8..16]),
130            position: <char>::from_le_byte_slice(&bytes[16..17]),
131            hardware_version: <[u8; 3]>::from_le_byte_slice(&bytes[17..20]),
132            firmware_version: <[u8; 3]>::from_le_byte_slice(&bytes[20..23]),
133            device_identifier: <u16>::from_le_byte_slice(&bytes[23..25]),
134        }
135    }
136}
137
138/// Measures weight with a load cell
139#[derive(Clone)]
140pub struct LoadCellBricklet {
141    device: Device,
142}
143impl LoadCellBricklet {
144    pub const DEVICE_IDENTIFIER: u16 = 253;
145    pub const DEVICE_DISPLAY_NAME: &'static str = "Load Cell Bricklet";
146    /// Creates an object with the unique device ID `uid`. This object can then be used after the IP Connection `ip_connection` is connected.
147    pub fn new(uid: Uid, connection: AsyncIpConnection) -> LoadCellBricklet {
148        let mut result = LoadCellBricklet { device: Device::new([2, 0, 10], uid, connection, Self::DEVICE_DISPLAY_NAME) };
149        result.device.response_expected[u8::from(LoadCellBrickletFunction::GetWeight) as usize] = ResponseExpectedFlag::AlwaysTrue;
150        result.device.response_expected[u8::from(LoadCellBrickletFunction::SetWeightCallbackPeriod) as usize] = ResponseExpectedFlag::True;
151        result.device.response_expected[u8::from(LoadCellBrickletFunction::GetWeightCallbackPeriod) as usize] =
152            ResponseExpectedFlag::AlwaysTrue;
153        result.device.response_expected[u8::from(LoadCellBrickletFunction::SetWeightCallbackThreshold) as usize] =
154            ResponseExpectedFlag::True;
155        result.device.response_expected[u8::from(LoadCellBrickletFunction::GetWeightCallbackThreshold) as usize] =
156            ResponseExpectedFlag::AlwaysTrue;
157        result.device.response_expected[u8::from(LoadCellBrickletFunction::SetDebouncePeriod) as usize] = ResponseExpectedFlag::True;
158        result.device.response_expected[u8::from(LoadCellBrickletFunction::GetDebouncePeriod) as usize] = ResponseExpectedFlag::AlwaysTrue;
159        result.device.response_expected[u8::from(LoadCellBrickletFunction::SetMovingAverage) as usize] = ResponseExpectedFlag::False;
160        result.device.response_expected[u8::from(LoadCellBrickletFunction::GetMovingAverage) as usize] = ResponseExpectedFlag::AlwaysTrue;
161        result.device.response_expected[u8::from(LoadCellBrickletFunction::LedOn) as usize] = ResponseExpectedFlag::False;
162        result.device.response_expected[u8::from(LoadCellBrickletFunction::LedOff) as usize] = ResponseExpectedFlag::False;
163        result.device.response_expected[u8::from(LoadCellBrickletFunction::IsLedOn) as usize] = ResponseExpectedFlag::AlwaysTrue;
164        result.device.response_expected[u8::from(LoadCellBrickletFunction::Calibrate) as usize] = ResponseExpectedFlag::False;
165        result.device.response_expected[u8::from(LoadCellBrickletFunction::Tare) as usize] = ResponseExpectedFlag::False;
166        result.device.response_expected[u8::from(LoadCellBrickletFunction::SetConfiguration) as usize] = ResponseExpectedFlag::False;
167        result.device.response_expected[u8::from(LoadCellBrickletFunction::GetConfiguration) as usize] = ResponseExpectedFlag::AlwaysTrue;
168        result.device.response_expected[u8::from(LoadCellBrickletFunction::GetIdentity) as usize] = ResponseExpectedFlag::AlwaysTrue;
169        result
170    }
171
172    /// Returns the response expected flag for the function specified by the function ID parameter.
173    /// It is true if the function is expected to send a response, false otherwise.
174    ///
175    /// For getter functions this is enabled by default and cannot be disabled, because those
176    /// functions will always send a response. For callback configuration functions it is enabled
177    /// by default too, but can be disabled by [`set_response_expected`](crate::load_cell_bricklet::LoadCellBricklet::set_response_expected).
178    /// For setter functions it is disabled by default and can be enabled.
179    ///
180    /// Enabling the response expected flag for a setter function allows to detect timeouts
181    /// and other error conditions calls of this setter as well. The device will then send a response
182    /// for this purpose. If this flag is disabled for a setter function then no response is sent
183    /// and errors are silently ignored, because they cannot be detected.
184    ///
185    /// See [`set_response_expected`](crate::load_cell_bricklet::LoadCellBricklet::set_response_expected) for the list of function ID constants available for this function.
186    pub fn get_response_expected(&mut self, fun: LoadCellBrickletFunction) -> Result<bool, GetResponseExpectedError> {
187        self.device.get_response_expected(u8::from(fun))
188    }
189
190    /// Changes the response expected flag of the function specified by the function ID parameter.
191    /// This flag can only be changed for setter (default value: false) and callback configuration
192    /// functions (default value: true). For getter functions it is always enabled.
193    ///
194    /// Enabling the response expected flag for a setter function allows to detect timeouts and
195    /// other error conditions calls of this setter as well. The device will then send a response
196    /// for this purpose. If this flag is disabled for a setter function then no response is sent
197    /// and errors are silently ignored, because they cannot be detected.
198    pub fn set_response_expected(
199        &mut self,
200        fun: LoadCellBrickletFunction,
201        response_expected: bool,
202    ) -> Result<(), SetResponseExpectedError> {
203        self.device.set_response_expected(u8::from(fun), response_expected)
204    }
205
206    /// Changes the response expected flag for all setter and callback configuration functions of this device at once.
207    pub fn set_response_expected_all(&mut self, response_expected: bool) {
208        self.device.set_response_expected_all(response_expected)
209    }
210
211    /// Returns the version of the API definition (major, minor, revision) implemented by this API bindings.
212    /// This is neither the release version of this API bindings nor does it tell you anything about the represented Brick or Bricklet.
213    pub fn get_api_version(&self) -> [u8; 3] {
214        self.device.api_version
215    }
216
217    /// This receiver is triggered periodically with the period that is set by
218    /// [`set_weight_callback_period`]. The parameter is the weight
219    /// as measured by the load cell.
220    ///
221    /// The [`get_weight_callback_receiver`] receiver is only triggered if the weight has changed since the
222    /// last triggering.
223    ///
224    /// [`set_weight_callback_period`]: #method.set_weight_callback_period
225    /// [`get_weight_callback_receiver`]: #method.get_weight_callback_receiver
226    pub async fn get_weight_callback_receiver(&mut self) -> impl Stream<Item = i32> {
227        self.device
228            .get_callback_receiver(u8::from(LoadCellBrickletFunction::CallbackWeight))
229            .await
230            .map(|p| i32::from_le_byte_slice(p.body()))
231    }
232
233    /// This receiver is triggered when the threshold as set by
234    /// [`set_weight_callback_threshold`] is reached.
235    /// The parameter is the weight as measured by the load cell.
236    ///
237    /// If the threshold keeps being reached, the receiver is triggered periodically
238    /// with the period as set by [`set_debounce_period`].
239    pub async fn get_weight_reached_callback_receiver(&mut self) -> impl Stream<Item = i32> {
240        self.device
241            .get_callback_receiver(u8::from(LoadCellBrickletFunction::CallbackWeightReached))
242            .await
243            .map(|p| i32::from_le_byte_slice(p.body()))
244    }
245
246    /// Returns the currently measured weight.
247    ///
248    /// If you want to get the weight periodically, it is recommended
249    /// to use the [`get_weight_callback_receiver`] receiver and set the period with
250    /// [`set_weight_callback_period`].
251    pub async fn get_weight(&mut self) -> Result<i32, TinkerforgeError> {
252        let payload = [0; 0];
253
254        #[allow(unused_variables)]
255        let result = self.device.get(u8::from(LoadCellBrickletFunction::GetWeight), &payload).await?;
256        Ok(i32::from_le_byte_slice(result.body()))
257    }
258
259    /// Sets the period with which the [`get_weight_callback_receiver`] receiver is triggered
260    /// periodically. A value of 0 turns the receiver off.
261    ///
262    /// The [`get_weight_callback_receiver`] receiver is only triggered if the weight has changed since the
263    /// last triggering.
264    pub async fn set_weight_callback_period(&mut self, period: u32) -> Result<(), TinkerforgeError> {
265        let mut payload = [0; 4];
266        period.write_to_slice(&mut payload[0..4]);
267
268        #[allow(unused_variables)]
269        let result = self.device.set(u8::from(LoadCellBrickletFunction::SetWeightCallbackPeriod), &payload).await?;
270        Ok(())
271    }
272
273    /// Returns the period as set by [`set_weight_callback_period`].
274    pub async fn get_weight_callback_period(&mut self) -> Result<u32, TinkerforgeError> {
275        let payload = [0; 0];
276
277        #[allow(unused_variables)]
278        let result = self.device.get(u8::from(LoadCellBrickletFunction::GetWeightCallbackPeriod), &payload).await?;
279        Ok(u32::from_le_byte_slice(result.body()))
280    }
281
282    /// Sets the thresholds for the [`get_weight_reached_callback_receiver`] receiver.
283    ///
284    /// The following options are possible:
285    ///
286    ///  Option| Description
287    ///  --- | ---
288    ///  'x'|    Receiver is turned off
289    ///  'o'|    Receiver is triggered when the weight is *outside* the min and max values
290    ///  'i'|    Receiver is triggered when the weight is *inside* the min and max values
291    ///  '<'|    Receiver is triggered when the weight is smaller than the min value (max is ignored)
292    ///  '>'|    Receiver is triggered when the weight is greater than the min value (max is ignored)
293    ///
294    /// Associated constants:
295    /// * LOAD_CELL_BRICKLET_THRESHOLD_OPTION_OFF
296    ///	* LOAD_CELL_BRICKLET_THRESHOLD_OPTION_OUTSIDE
297    ///	* LOAD_CELL_BRICKLET_THRESHOLD_OPTION_INSIDE
298    ///	* LOAD_CELL_BRICKLET_THRESHOLD_OPTION_SMALLER
299    ///	* LOAD_CELL_BRICKLET_THRESHOLD_OPTION_GREATER
300    pub async fn set_weight_callback_threshold(&mut self, option: char, min: i32, max: i32) -> Result<(), TinkerforgeError> {
301        let mut payload = [0; 9];
302        option.write_to_slice(&mut payload[0..1]);
303        min.write_to_slice(&mut payload[1..5]);
304        max.write_to_slice(&mut payload[5..9]);
305
306        #[allow(unused_variables)]
307        let result = self.device.set(u8::from(LoadCellBrickletFunction::SetWeightCallbackThreshold), &payload).await?;
308        Ok(())
309    }
310
311    /// Returns the threshold as set by [`set_weight_callback_threshold`].
312    ///
313    /// Associated constants:
314    /// * LOAD_CELL_BRICKLET_THRESHOLD_OPTION_OFF
315    ///	* LOAD_CELL_BRICKLET_THRESHOLD_OPTION_OUTSIDE
316    ///	* LOAD_CELL_BRICKLET_THRESHOLD_OPTION_INSIDE
317    ///	* LOAD_CELL_BRICKLET_THRESHOLD_OPTION_SMALLER
318    ///	* LOAD_CELL_BRICKLET_THRESHOLD_OPTION_GREATER
319    pub async fn get_weight_callback_threshold(&mut self) -> Result<WeightCallbackThreshold, TinkerforgeError> {
320        let payload = [0; 0];
321
322        #[allow(unused_variables)]
323        let result = self.device.get(u8::from(LoadCellBrickletFunction::GetWeightCallbackThreshold), &payload).await?;
324        Ok(WeightCallbackThreshold::from_le_byte_slice(result.body()))
325    }
326
327    /// Sets the period with which the threshold receiver
328    ///
329    /// * [`get_weight_reached_callback_receiver`]
330    ///
331    /// is triggered, if the threshold
332    ///
333    /// * [`set_weight_callback_threshold`]
334    ///
335    /// keeps being reached.
336    pub async fn set_debounce_period(&mut self, debounce: u32) -> Result<(), TinkerforgeError> {
337        let mut payload = [0; 4];
338        debounce.write_to_slice(&mut payload[0..4]);
339
340        #[allow(unused_variables)]
341        let result = self.device.set(u8::from(LoadCellBrickletFunction::SetDebouncePeriod), &payload).await?;
342        Ok(())
343    }
344
345    /// Returns the debounce period as set by [`set_debounce_period`].
346    pub async fn get_debounce_period(&mut self) -> Result<u32, TinkerforgeError> {
347        let payload = [0; 0];
348
349        #[allow(unused_variables)]
350        let result = self.device.get(u8::from(LoadCellBrickletFunction::GetDebouncePeriod), &payload).await?;
351        Ok(u32::from_le_byte_slice(result.body()))
352    }
353
354    /// Sets the length of a [moving averaging](https://en.wikipedia.org/wiki/Moving_average)__
355    /// for the weight value.
356    ///
357    /// Setting the length to 1 will turn the averaging off. With less
358    /// averaging, there is more noise on the data.
359    pub async fn set_moving_average(&mut self, average: u8) -> Result<(), TinkerforgeError> {
360        let mut payload = [0; 1];
361        average.write_to_slice(&mut payload[0..1]);
362
363        #[allow(unused_variables)]
364        let result = self.device.set(u8::from(LoadCellBrickletFunction::SetMovingAverage), &payload).await?;
365        Ok(())
366    }
367
368    /// Returns the length moving average as set by [`set_moving_average`].
369    pub async fn get_moving_average(&mut self) -> Result<u8, TinkerforgeError> {
370        let payload = [0; 0];
371
372        #[allow(unused_variables)]
373        let result = self.device.get(u8::from(LoadCellBrickletFunction::GetMovingAverage), &payload).await?;
374        Ok(u8::from_le_byte_slice(result.body()))
375    }
376
377    /// Turns the LED on.
378    pub async fn led_on(&mut self) -> Result<(), TinkerforgeError> {
379        let payload = [0; 0];
380
381        #[allow(unused_variables)]
382        let result = self.device.set(u8::from(LoadCellBrickletFunction::LedOn), &payload).await?;
383        Ok(())
384    }
385
386    /// Turns the LED off.
387    pub async fn led_off(&mut self) -> Result<(), TinkerforgeError> {
388        let payload = [0; 0];
389
390        #[allow(unused_variables)]
391        let result = self.device.set(u8::from(LoadCellBrickletFunction::LedOff), &payload).await?;
392        Ok(())
393    }
394
395    /// Returns *true* if the led is on, *false* otherwise.
396    pub async fn is_led_on(&mut self) -> Result<bool, TinkerforgeError> {
397        let payload = [0; 0];
398
399        #[allow(unused_variables)]
400        let result = self.device.get(u8::from(LoadCellBrickletFunction::IsLedOn), &payload).await?;
401        Ok(bool::from_le_byte_slice(result.body()))
402    }
403
404    /// To calibrate your Load Cell Bricklet you have to
405    ///
406    /// * empty the scale and call this function with 0 and
407    /// * add a known weight to the scale and call this function with the weight.
408    ///
409    /// The calibration is saved in the EEPROM of the Bricklet and only
410    /// needs to be done once.
411    ///
412    /// We recommend to use the Brick Viewer for calibration, you don't need
413    /// to call this function in your source code.
414    pub async fn calibrate(&mut self, weight: u32) -> Result<(), TinkerforgeError> {
415        let mut payload = [0; 4];
416        weight.write_to_slice(&mut payload[0..4]);
417
418        #[allow(unused_variables)]
419        let result = self.device.set(u8::from(LoadCellBrickletFunction::Calibrate), &payload).await?;
420        Ok(())
421    }
422
423    /// Sets the currently measured weight as tare weight.
424    pub async fn tare(&mut self) -> Result<(), TinkerforgeError> {
425        let payload = [0; 0];
426
427        #[allow(unused_variables)]
428        let result = self.device.set(u8::from(LoadCellBrickletFunction::Tare), &payload).await?;
429        Ok(())
430    }
431
432    /// The measurement rate and gain are configurable.
433    ///
434    /// The rate can be either 10Hz or 80Hz. A faster rate will produce more noise.
435    /// It is additionally possible to add a moving average
436    /// (see [`set_moving_average`]) to the measurements.
437    ///
438    /// The gain can be 128x, 64x or 32x. It represents a measurement range of
439    /// ±20mV, ±40mV and ±80mV respectively. The Load Cell Bricklet uses an
440    /// excitation voltage of 5V and most load cells use an output of 2mV/V. That
441    /// means the voltage range is ±15mV for most load cells (i.e. gain of 128x
442    /// is best). If you don't know what all of this means you should keep it at
443    /// 128x, it will most likely be correct.
444    ///
445    /// The configuration is saved in the EEPROM of the Bricklet and only
446    /// needs to be done once.
447    ///
448    /// We recommend to use the Brick Viewer for configuration, you don't need
449    /// to call this function in your source code.
450    ///
451    /// Associated constants:
452    /// * LOAD_CELL_BRICKLET_RATE_10HZ
453    ///	* LOAD_CELL_BRICKLET_RATE_80HZ
454    ///	* LOAD_CELL_BRICKLET_GAIN_128X
455    ///	* LOAD_CELL_BRICKLET_GAIN_64X
456    ///	* LOAD_CELL_BRICKLET_GAIN_32X
457    pub async fn set_configuration(&mut self, rate: u8, gain: u8) -> Result<(), TinkerforgeError> {
458        let mut payload = [0; 2];
459        rate.write_to_slice(&mut payload[0..1]);
460        gain.write_to_slice(&mut payload[1..2]);
461
462        #[allow(unused_variables)]
463        let result = self.device.set(u8::from(LoadCellBrickletFunction::SetConfiguration), &payload).await?;
464        Ok(())
465    }
466
467    /// Returns the configuration as set by [`set_configuration`].
468    ///
469    /// Associated constants:
470    /// * LOAD_CELL_BRICKLET_RATE_10HZ
471    ///	* LOAD_CELL_BRICKLET_RATE_80HZ
472    ///	* LOAD_CELL_BRICKLET_GAIN_128X
473    ///	* LOAD_CELL_BRICKLET_GAIN_64X
474    ///	* LOAD_CELL_BRICKLET_GAIN_32X
475    pub async fn get_configuration(&mut self) -> Result<Configuration, TinkerforgeError> {
476        let payload = [0; 0];
477
478        #[allow(unused_variables)]
479        let result = self.device.get(u8::from(LoadCellBrickletFunction::GetConfiguration), &payload).await?;
480        Ok(Configuration::from_le_byte_slice(result.body()))
481    }
482
483    /// Returns the UID, the UID where the Bricklet is connected to,
484    /// the position, the hardware and firmware version as well as the
485    /// device identifier.
486    ///
487    /// The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
488    /// A Bricklet connected to an [Isolator Bricklet](isolator_bricklet) is always at
489    /// position 'z'.
490    ///
491    /// The device identifier numbers can be found [here](device_identifier).
492    /// |device_identifier_constant|
493    pub async fn get_identity(&mut self) -> Result<Identity, TinkerforgeError> {
494        let payload = [0; 0];
495
496        #[allow(unused_variables)]
497        let result = self.device.get(u8::from(LoadCellBrickletFunction::GetIdentity), &payload).await?;
498        Ok(Identity::from_le_byte_slice(result.body()))
499    }
500}