tinkerforge_async/bindings/
analog_out_v3_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//! Generates configurable DC voltage between 0V and 12V.
12//!
13//! See also the documentation [here](https://www.tinkerforge.com/en/doc/Software/Bricklets/AnalogOutV3_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 AnalogOutV3BrickletFunction {
24    SetOutputVoltage,
25    GetOutputVoltage,
26    GetInputVoltage,
27    GetSpitfpErrorCount,
28    SetBootloaderMode,
29    GetBootloaderMode,
30    SetWriteFirmwarePointer,
31    WriteFirmware,
32    SetStatusLedConfig,
33    GetStatusLedConfig,
34    GetChipTemperature,
35    Reset,
36    WriteUid,
37    ReadUid,
38    GetIdentity,
39}
40impl From<AnalogOutV3BrickletFunction> for u8 {
41    fn from(fun: AnalogOutV3BrickletFunction) -> Self {
42        match fun {
43            AnalogOutV3BrickletFunction::SetOutputVoltage => 1,
44            AnalogOutV3BrickletFunction::GetOutputVoltage => 2,
45            AnalogOutV3BrickletFunction::GetInputVoltage => 3,
46            AnalogOutV3BrickletFunction::GetSpitfpErrorCount => 234,
47            AnalogOutV3BrickletFunction::SetBootloaderMode => 235,
48            AnalogOutV3BrickletFunction::GetBootloaderMode => 236,
49            AnalogOutV3BrickletFunction::SetWriteFirmwarePointer => 237,
50            AnalogOutV3BrickletFunction::WriteFirmware => 238,
51            AnalogOutV3BrickletFunction::SetStatusLedConfig => 239,
52            AnalogOutV3BrickletFunction::GetStatusLedConfig => 240,
53            AnalogOutV3BrickletFunction::GetChipTemperature => 242,
54            AnalogOutV3BrickletFunction::Reset => 243,
55            AnalogOutV3BrickletFunction::WriteUid => 248,
56            AnalogOutV3BrickletFunction::ReadUid => 249,
57            AnalogOutV3BrickletFunction::GetIdentity => 255,
58        }
59    }
60}
61pub const ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_BOOTLOADER: u8 = 0;
62pub const ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_FIRMWARE: u8 = 1;
63pub const ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT: u8 = 2;
64pub const ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT: u8 = 3;
65pub const ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT: u8 = 4;
66pub const ANALOG_OUT_V3_BRICKLET_BOOTLOADER_STATUS_OK: u8 = 0;
67pub const ANALOG_OUT_V3_BRICKLET_BOOTLOADER_STATUS_INVALID_MODE: u8 = 1;
68pub const ANALOG_OUT_V3_BRICKLET_BOOTLOADER_STATUS_NO_CHANGE: u8 = 2;
69pub const ANALOG_OUT_V3_BRICKLET_BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT: u8 = 3;
70pub const ANALOG_OUT_V3_BRICKLET_BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT: u8 = 4;
71pub const ANALOG_OUT_V3_BRICKLET_BOOTLOADER_STATUS_CRC_MISMATCH: u8 = 5;
72pub const ANALOG_OUT_V3_BRICKLET_STATUS_LED_CONFIG_OFF: u8 = 0;
73pub const ANALOG_OUT_V3_BRICKLET_STATUS_LED_CONFIG_ON: u8 = 1;
74pub const ANALOG_OUT_V3_BRICKLET_STATUS_LED_CONFIG_SHOW_HEARTBEAT: u8 = 2;
75pub const ANALOG_OUT_V3_BRICKLET_STATUS_LED_CONFIG_SHOW_STATUS: u8 = 3;
76
77#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
78pub struct SpitfpErrorCount {
79    pub error_count_ack_checksum: u32,
80    pub error_count_message_checksum: u32,
81    pub error_count_frame: u32,
82    pub error_count_overflow: u32,
83}
84impl FromByteSlice for SpitfpErrorCount {
85    fn bytes_expected() -> usize {
86        16
87    }
88    fn from_le_byte_slice(bytes: &[u8]) -> SpitfpErrorCount {
89        SpitfpErrorCount {
90            error_count_ack_checksum: <u32>::from_le_byte_slice(&bytes[0..4]),
91            error_count_message_checksum: <u32>::from_le_byte_slice(&bytes[4..8]),
92            error_count_frame: <u32>::from_le_byte_slice(&bytes[8..12]),
93            error_count_overflow: <u32>::from_le_byte_slice(&bytes[12..16]),
94        }
95    }
96}
97
98#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
99pub struct Identity {
100    pub uid: String,
101    pub connected_uid: String,
102    pub position: char,
103    pub hardware_version: [u8; 3],
104    pub firmware_version: [u8; 3],
105    pub device_identifier: u16,
106}
107impl FromByteSlice for Identity {
108    fn bytes_expected() -> usize {
109        25
110    }
111    fn from_le_byte_slice(bytes: &[u8]) -> Identity {
112        Identity {
113            uid: <String>::from_le_byte_slice(&bytes[0..8]),
114            connected_uid: <String>::from_le_byte_slice(&bytes[8..16]),
115            position: <char>::from_le_byte_slice(&bytes[16..17]),
116            hardware_version: <[u8; 3]>::from_le_byte_slice(&bytes[17..20]),
117            firmware_version: <[u8; 3]>::from_le_byte_slice(&bytes[20..23]),
118            device_identifier: <u16>::from_le_byte_slice(&bytes[23..25]),
119        }
120    }
121}
122
123/// Generates configurable DC voltage between 0V and 12V
124#[derive(Clone)]
125pub struct AnalogOutV3Bricklet {
126    device: Device,
127}
128impl AnalogOutV3Bricklet {
129    pub const DEVICE_IDENTIFIER: u16 = 2115;
130    pub const DEVICE_DISPLAY_NAME: &'static str = "Analog Out Bricklet 3.0";
131    /// Creates an object with the unique device ID `uid`. This object can then be used after the IP Connection `ip_connection` is connected.
132    pub fn new(uid: Uid, connection: AsyncIpConnection) -> AnalogOutV3Bricklet {
133        let mut result = AnalogOutV3Bricklet { device: Device::new([2, 0, 10], uid, connection, Self::DEVICE_DISPLAY_NAME) };
134        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::SetOutputVoltage) as usize] = ResponseExpectedFlag::False;
135        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::GetOutputVoltage) as usize] =
136            ResponseExpectedFlag::AlwaysTrue;
137        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::GetInputVoltage) as usize] = ResponseExpectedFlag::AlwaysTrue;
138        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::GetSpitfpErrorCount) as usize] =
139            ResponseExpectedFlag::AlwaysTrue;
140        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::SetBootloaderMode) as usize] =
141            ResponseExpectedFlag::AlwaysTrue;
142        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::GetBootloaderMode) as usize] =
143            ResponseExpectedFlag::AlwaysTrue;
144        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::SetWriteFirmwarePointer) as usize] =
145            ResponseExpectedFlag::False;
146        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::WriteFirmware) as usize] = ResponseExpectedFlag::AlwaysTrue;
147        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::SetStatusLedConfig) as usize] = ResponseExpectedFlag::False;
148        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::GetStatusLedConfig) as usize] =
149            ResponseExpectedFlag::AlwaysTrue;
150        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::GetChipTemperature) as usize] =
151            ResponseExpectedFlag::AlwaysTrue;
152        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::Reset) as usize] = ResponseExpectedFlag::False;
153        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::WriteUid) as usize] = ResponseExpectedFlag::False;
154        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::ReadUid) as usize] = ResponseExpectedFlag::AlwaysTrue;
155        result.device.response_expected[u8::from(AnalogOutV3BrickletFunction::GetIdentity) as usize] = ResponseExpectedFlag::AlwaysTrue;
156        result
157    }
158
159    /// Returns the response expected flag for the function specified by the function ID parameter.
160    /// It is true if the function is expected to send a response, false otherwise.
161    ///
162    /// For getter functions this is enabled by default and cannot be disabled, because those
163    /// functions will always send a response. For callback configuration functions it is enabled
164    /// by default too, but can be disabled by [`set_response_expected`](crate::analog_out_v3_bricklet::AnalogOutV3Bricklet::set_response_expected).
165    /// For setter functions it is disabled by default and can be enabled.
166    ///
167    /// Enabling the response expected flag for a setter function allows to detect timeouts
168    /// and other error conditions calls of this setter as well. The device will then send a response
169    /// for this purpose. If this flag is disabled for a setter function then no response is sent
170    /// and errors are silently ignored, because they cannot be detected.
171    ///
172    /// See [`set_response_expected`](crate::analog_out_v3_bricklet::AnalogOutV3Bricklet::set_response_expected) for the list of function ID constants available for this function.
173    pub fn get_response_expected(&mut self, fun: AnalogOutV3BrickletFunction) -> Result<bool, GetResponseExpectedError> {
174        self.device.get_response_expected(u8::from(fun))
175    }
176
177    /// Changes the response expected flag of the function specified by the function ID parameter.
178    /// This flag can only be changed for setter (default value: false) and callback configuration
179    /// functions (default value: true). For getter functions it is always enabled.
180    ///
181    /// Enabling the response expected flag for a setter function allows to detect timeouts and
182    /// other error conditions calls of this setter as well. The device will then send a response
183    /// for this purpose. If this flag is disabled for a setter function then no response is sent
184    /// and errors are silently ignored, because they cannot be detected.
185    pub fn set_response_expected(
186        &mut self,
187        fun: AnalogOutV3BrickletFunction,
188        response_expected: bool,
189    ) -> Result<(), SetResponseExpectedError> {
190        self.device.set_response_expected(u8::from(fun), response_expected)
191    }
192
193    /// Changes the response expected flag for all setter and callback configuration functions of this device at once.
194    pub fn set_response_expected_all(&mut self, response_expected: bool) {
195        self.device.set_response_expected_all(response_expected)
196    }
197
198    /// Returns the version of the API definition (major, minor, revision) implemented by this API bindings.
199    /// This is neither the release version of this API bindings nor does it tell you anything about the represented Brick or Bricklet.
200    pub fn get_api_version(&self) -> [u8; 3] {
201        self.device.api_version
202    }
203
204    /// Sets the voltage.
205    pub async fn set_output_voltage(&mut self, voltage: u16) -> Result<(), TinkerforgeError> {
206        let mut payload = [0; 2];
207        voltage.write_to_slice(&mut payload[0..2]);
208
209        #[allow(unused_variables)]
210        let result = self.device.set(u8::from(AnalogOutV3BrickletFunction::SetOutputVoltage), &payload).await?;
211        Ok(())
212    }
213
214    /// Returns the voltage as set by [`set_output_voltage`].
215    pub async fn get_output_voltage(&mut self) -> Result<u16, TinkerforgeError> {
216        let payload = [0; 0];
217
218        #[allow(unused_variables)]
219        let result = self.device.get(u8::from(AnalogOutV3BrickletFunction::GetOutputVoltage), &payload).await?;
220        Ok(u16::from_le_byte_slice(result.body()))
221    }
222
223    /// Returns the input voltage.
224    pub async fn get_input_voltage(&mut self) -> Result<u16, TinkerforgeError> {
225        let payload = [0; 0];
226
227        #[allow(unused_variables)]
228        let result = self.device.get(u8::from(AnalogOutV3BrickletFunction::GetInputVoltage), &payload).await?;
229        Ok(u16::from_le_byte_slice(result.body()))
230    }
231
232    /// Returns the error count for the communication between Brick and Bricklet.
233    ///
234    /// The errors are divided into
235    ///
236    /// * ACK checksum errors,
237    /// * message checksum errors,
238    /// * framing errors and
239    /// * overflow errors.
240    ///
241    /// The errors counts are for errors that occur on the Bricklet side. All
242    /// Bricks have a similar function that returns the errors on the Brick side.
243    pub async fn get_spitfp_error_count(&mut self) -> Result<SpitfpErrorCount, TinkerforgeError> {
244        let payload = [0; 0];
245
246        #[allow(unused_variables)]
247        let result = self.device.get(u8::from(AnalogOutV3BrickletFunction::GetSpitfpErrorCount), &payload).await?;
248        Ok(SpitfpErrorCount::from_le_byte_slice(result.body()))
249    }
250
251    /// Sets the bootloader mode and returns the status after the requested
252    /// mode change was instigated.
253    ///
254    /// You can change from bootloader mode to firmware mode and vice versa. A change
255    /// from bootloader mode to firmware mode will only take place if the entry function,
256    /// device identifier and CRC are present and correct.
257    ///
258    /// This function is used by Brick Viewer during flashing. It should not be
259    /// necessary to call it in a normal user program.
260    ///
261    /// Associated constants:
262    /// * ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_BOOTLOADER
263    ///	* ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_FIRMWARE
264    ///	* ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT
265    ///	* ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT
266    ///	* ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT
267    ///	* ANALOG_OUT_V3_BRICKLET_BOOTLOADER_STATUS_OK
268    ///	* ANALOG_OUT_V3_BRICKLET_BOOTLOADER_STATUS_INVALID_MODE
269    ///	* ANALOG_OUT_V3_BRICKLET_BOOTLOADER_STATUS_NO_CHANGE
270    ///	* ANALOG_OUT_V3_BRICKLET_BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT
271    ///	* ANALOG_OUT_V3_BRICKLET_BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT
272    ///	* ANALOG_OUT_V3_BRICKLET_BOOTLOADER_STATUS_CRC_MISMATCH
273    pub async fn set_bootloader_mode(&mut self, mode: u8) -> Result<u8, TinkerforgeError> {
274        let mut payload = [0; 1];
275        mode.write_to_slice(&mut payload[0..1]);
276
277        #[allow(unused_variables)]
278        let result = self.device.get(u8::from(AnalogOutV3BrickletFunction::SetBootloaderMode), &payload).await?;
279        Ok(u8::from_le_byte_slice(result.body()))
280    }
281
282    /// Returns the current bootloader mode, see [`set_bootloader_mode`].
283    ///
284    /// Associated constants:
285    /// * ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_BOOTLOADER
286    ///	* ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_FIRMWARE
287    ///	* ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT
288    ///	* ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT
289    ///	* ANALOG_OUT_V3_BRICKLET_BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT
290    pub async fn get_bootloader_mode(&mut self) -> Result<u8, TinkerforgeError> {
291        let payload = [0; 0];
292
293        #[allow(unused_variables)]
294        let result = self.device.get(u8::from(AnalogOutV3BrickletFunction::GetBootloaderMode), &payload).await?;
295        Ok(u8::from_le_byte_slice(result.body()))
296    }
297
298    /// Sets the firmware pointer for [`write_firmware`]. The pointer has
299    /// to be increased by chunks of size 64. The data is written to flash
300    /// every 4 chunks (which equals to one page of size 256).
301    ///
302    /// This function is used by Brick Viewer during flashing. It should not be
303    /// necessary to call it in a normal user program.
304    pub async fn set_write_firmware_pointer(&mut self, pointer: u32) -> Result<(), TinkerforgeError> {
305        let mut payload = [0; 4];
306        pointer.write_to_slice(&mut payload[0..4]);
307
308        #[allow(unused_variables)]
309        let result = self.device.set(u8::from(AnalogOutV3BrickletFunction::SetWriteFirmwarePointer), &payload).await?;
310        Ok(())
311    }
312
313    /// Writes 64 Bytes of firmware at the position as written by
314    /// [`set_write_firmware_pointer`] before. The firmware is written
315    /// to flash every 4 chunks.
316    ///
317    /// You can only write firmware in bootloader mode.
318    ///
319    /// This function is used by Brick Viewer during flashing. It should not be
320    /// necessary to call it in a normal user program.
321    pub async fn write_firmware(&mut self, data: &[u8; 64]) -> Result<u8, TinkerforgeError> {
322        let mut payload = [0; 64];
323        data.write_to_slice(&mut payload[0..64]);
324
325        #[allow(unused_variables)]
326        let result = self.device.get(u8::from(AnalogOutV3BrickletFunction::WriteFirmware), &payload).await?;
327        Ok(u8::from_le_byte_slice(result.body()))
328    }
329
330    /// Sets the status LED configuration. By default the LED shows
331    /// communication traffic between Brick and Bricklet, it flickers once
332    /// for every 10 received data packets.
333    ///
334    /// You can also turn the LED permanently on/off or show a heartbeat.
335    ///
336    /// If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
337    ///
338    /// Associated constants:
339    /// * ANALOG_OUT_V3_BRICKLET_STATUS_LED_CONFIG_OFF
340    ///	* ANALOG_OUT_V3_BRICKLET_STATUS_LED_CONFIG_ON
341    ///	* ANALOG_OUT_V3_BRICKLET_STATUS_LED_CONFIG_SHOW_HEARTBEAT
342    ///	* ANALOG_OUT_V3_BRICKLET_STATUS_LED_CONFIG_SHOW_STATUS
343    pub async fn set_status_led_config(&mut self, config: u8) -> Result<(), TinkerforgeError> {
344        let mut payload = [0; 1];
345        config.write_to_slice(&mut payload[0..1]);
346
347        #[allow(unused_variables)]
348        let result = self.device.set(u8::from(AnalogOutV3BrickletFunction::SetStatusLedConfig), &payload).await?;
349        Ok(())
350    }
351
352    /// Returns the configuration as set by [`set_status_led_config`]
353    ///
354    /// Associated constants:
355    /// * ANALOG_OUT_V3_BRICKLET_STATUS_LED_CONFIG_OFF
356    ///	* ANALOG_OUT_V3_BRICKLET_STATUS_LED_CONFIG_ON
357    ///	* ANALOG_OUT_V3_BRICKLET_STATUS_LED_CONFIG_SHOW_HEARTBEAT
358    ///	* ANALOG_OUT_V3_BRICKLET_STATUS_LED_CONFIG_SHOW_STATUS
359    pub async fn get_status_led_config(&mut self) -> Result<u8, TinkerforgeError> {
360        let payload = [0; 0];
361
362        #[allow(unused_variables)]
363        let result = self.device.get(u8::from(AnalogOutV3BrickletFunction::GetStatusLedConfig), &payload).await?;
364        Ok(u8::from_le_byte_slice(result.body()))
365    }
366
367    /// Returns the temperature as measured inside the microcontroller. The
368    /// value returned is not the ambient temperature!
369    ///
370    /// The temperature is only proportional to the real temperature and it has bad
371    /// accuracy. Practically it is only useful as an indicator for
372    /// temperature changes.
373    pub async fn get_chip_temperature(&mut self) -> Result<i16, TinkerforgeError> {
374        let payload = [0; 0];
375
376        #[allow(unused_variables)]
377        let result = self.device.get(u8::from(AnalogOutV3BrickletFunction::GetChipTemperature), &payload).await?;
378        Ok(i16::from_le_byte_slice(result.body()))
379    }
380
381    /// Calling this function will reset the Bricklet. All configurations
382    /// will be lost.
383    ///
384    /// After a reset you have to create new device objects,
385    /// calling functions on the existing ones will result in
386    /// undefined behavior!
387    pub async fn reset(&mut self) -> Result<(), TinkerforgeError> {
388        let payload = [0; 0];
389
390        #[allow(unused_variables)]
391        let result = self.device.set(u8::from(AnalogOutV3BrickletFunction::Reset), &payload).await?;
392        Ok(())
393    }
394
395    /// Writes a new UID into flash. If you want to set a new UID
396    /// you have to decode the Base58 encoded UID string into an
397    /// integer first.
398    ///
399    /// We recommend that you use Brick Viewer to change the UID.
400    pub async fn write_uid(&mut self, uid: u32) -> Result<(), TinkerforgeError> {
401        let mut payload = [0; 4];
402        uid.write_to_slice(&mut payload[0..4]);
403
404        #[allow(unused_variables)]
405        let result = self.device.set(u8::from(AnalogOutV3BrickletFunction::WriteUid), &payload).await?;
406        Ok(())
407    }
408
409    /// Returns the current UID as an integer. Encode as
410    /// Base58 to get the usual string version.
411    pub async fn read_uid(&mut self) -> Result<u32, TinkerforgeError> {
412        let payload = [0; 0];
413
414        #[allow(unused_variables)]
415        let result = self.device.get(u8::from(AnalogOutV3BrickletFunction::ReadUid), &payload).await?;
416        Ok(u32::from_le_byte_slice(result.body()))
417    }
418
419    /// Returns the UID, the UID where the Bricklet is connected to,
420    /// the position, the hardware and firmware version as well as the
421    /// device identifier.
422    ///
423    /// The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port).
424    /// A Bricklet connected to an [Isolator Bricklet](isolator_bricklet) is always at
425    /// position 'z'.
426    ///
427    /// The device identifier numbers can be found [here](device_identifier).
428    /// |device_identifier_constant|
429    pub async fn get_identity(&mut self) -> Result<Identity, TinkerforgeError> {
430        let payload = [0; 0];
431
432        #[allow(unused_variables)]
433        let result = self.device.get(u8::from(AnalogOutV3BrickletFunction::GetIdentity), &payload).await?;
434        Ok(Identity::from_le_byte_slice(result.body()))
435    }
436}