1#[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 LaserRangeFinderBrickletFunction {
24 GetDistance,
25 GetVelocity,
26 SetDistanceCallbackPeriod,
27 GetDistanceCallbackPeriod,
28 SetVelocityCallbackPeriod,
29 GetVelocityCallbackPeriod,
30 SetDistanceCallbackThreshold,
31 GetDistanceCallbackThreshold,
32 SetVelocityCallbackThreshold,
33 GetVelocityCallbackThreshold,
34 SetDebouncePeriod,
35 GetDebouncePeriod,
36 SetMovingAverage,
37 GetMovingAverage,
38 SetMode,
39 GetMode,
40 EnableLaser,
41 DisableLaser,
42 IsLaserEnabled,
43 GetSensorHardwareVersion,
44 SetConfiguration,
45 GetConfiguration,
46 GetIdentity,
47 CallbackDistance,
48 CallbackVelocity,
49 CallbackDistanceReached,
50 CallbackVelocityReached,
51}
52impl From<LaserRangeFinderBrickletFunction> for u8 {
53 fn from(fun: LaserRangeFinderBrickletFunction) -> Self {
54 match fun {
55 LaserRangeFinderBrickletFunction::GetDistance => 1,
56 LaserRangeFinderBrickletFunction::GetVelocity => 2,
57 LaserRangeFinderBrickletFunction::SetDistanceCallbackPeriod => 3,
58 LaserRangeFinderBrickletFunction::GetDistanceCallbackPeriod => 4,
59 LaserRangeFinderBrickletFunction::SetVelocityCallbackPeriod => 5,
60 LaserRangeFinderBrickletFunction::GetVelocityCallbackPeriod => 6,
61 LaserRangeFinderBrickletFunction::SetDistanceCallbackThreshold => 7,
62 LaserRangeFinderBrickletFunction::GetDistanceCallbackThreshold => 8,
63 LaserRangeFinderBrickletFunction::SetVelocityCallbackThreshold => 9,
64 LaserRangeFinderBrickletFunction::GetVelocityCallbackThreshold => 10,
65 LaserRangeFinderBrickletFunction::SetDebouncePeriod => 11,
66 LaserRangeFinderBrickletFunction::GetDebouncePeriod => 12,
67 LaserRangeFinderBrickletFunction::SetMovingAverage => 13,
68 LaserRangeFinderBrickletFunction::GetMovingAverage => 14,
69 LaserRangeFinderBrickletFunction::SetMode => 15,
70 LaserRangeFinderBrickletFunction::GetMode => 16,
71 LaserRangeFinderBrickletFunction::EnableLaser => 17,
72 LaserRangeFinderBrickletFunction::DisableLaser => 18,
73 LaserRangeFinderBrickletFunction::IsLaserEnabled => 19,
74 LaserRangeFinderBrickletFunction::GetSensorHardwareVersion => 24,
75 LaserRangeFinderBrickletFunction::SetConfiguration => 25,
76 LaserRangeFinderBrickletFunction::GetConfiguration => 26,
77 LaserRangeFinderBrickletFunction::GetIdentity => 255,
78 LaserRangeFinderBrickletFunction::CallbackDistance => 20,
79 LaserRangeFinderBrickletFunction::CallbackVelocity => 21,
80 LaserRangeFinderBrickletFunction::CallbackDistanceReached => 22,
81 LaserRangeFinderBrickletFunction::CallbackVelocityReached => 23,
82 }
83 }
84}
85pub const LASER_RANGE_FINDER_BRICKLET_THRESHOLD_OPTION_OFF: char = 'x';
86pub const LASER_RANGE_FINDER_BRICKLET_THRESHOLD_OPTION_OUTSIDE: char = 'o';
87pub const LASER_RANGE_FINDER_BRICKLET_THRESHOLD_OPTION_INSIDE: char = 'i';
88pub const LASER_RANGE_FINDER_BRICKLET_THRESHOLD_OPTION_SMALLER: char = '<';
89pub const LASER_RANGE_FINDER_BRICKLET_THRESHOLD_OPTION_GREATER: char = '>';
90pub const LASER_RANGE_FINDER_BRICKLET_MODE_DISTANCE: u8 = 0;
91pub const LASER_RANGE_FINDER_BRICKLET_MODE_VELOCITY_MAX_13MS: u8 = 1;
92pub const LASER_RANGE_FINDER_BRICKLET_MODE_VELOCITY_MAX_32MS: u8 = 2;
93pub const LASER_RANGE_FINDER_BRICKLET_MODE_VELOCITY_MAX_64MS: u8 = 3;
94pub const LASER_RANGE_FINDER_BRICKLET_MODE_VELOCITY_MAX_127MS: u8 = 4;
95pub const LASER_RANGE_FINDER_BRICKLET_VERSION_1: u8 = 1;
96pub const LASER_RANGE_FINDER_BRICKLET_VERSION_3: u8 = 3;
97
98#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
99pub struct DistanceCallbackThreshold {
100 pub option: char,
101 pub min: u16,
102 pub max: u16,
103}
104impl FromByteSlice for DistanceCallbackThreshold {
105 fn bytes_expected() -> usize {
106 5
107 }
108 fn from_le_byte_slice(bytes: &[u8]) -> DistanceCallbackThreshold {
109 DistanceCallbackThreshold {
110 option: <char>::from_le_byte_slice(&bytes[0..1]),
111 min: <u16>::from_le_byte_slice(&bytes[1..3]),
112 max: <u16>::from_le_byte_slice(&bytes[3..5]),
113 }
114 }
115}
116
117#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
118pub struct VelocityCallbackThreshold {
119 pub option: char,
120 pub min: i16,
121 pub max: i16,
122}
123impl FromByteSlice for VelocityCallbackThreshold {
124 fn bytes_expected() -> usize {
125 5
126 }
127 fn from_le_byte_slice(bytes: &[u8]) -> VelocityCallbackThreshold {
128 VelocityCallbackThreshold {
129 option: <char>::from_le_byte_slice(&bytes[0..1]),
130 min: <i16>::from_le_byte_slice(&bytes[1..3]),
131 max: <i16>::from_le_byte_slice(&bytes[3..5]),
132 }
133 }
134}
135
136#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
137pub struct MovingAverage {
138 pub distance_average_length: u8,
139 pub velocity_average_length: u8,
140}
141impl FromByteSlice for MovingAverage {
142 fn bytes_expected() -> usize {
143 2
144 }
145 fn from_le_byte_slice(bytes: &[u8]) -> MovingAverage {
146 MovingAverage {
147 distance_average_length: <u8>::from_le_byte_slice(&bytes[0..1]),
148 velocity_average_length: <u8>::from_le_byte_slice(&bytes[1..2]),
149 }
150 }
151}
152
153#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
154pub struct Configuration {
155 pub acquisition_count: u8,
156 pub enable_quick_termination: bool,
157 pub threshold_value: u8,
158 pub measurement_frequency: u16,
159}
160impl FromByteSlice for Configuration {
161 fn bytes_expected() -> usize {
162 5
163 }
164 fn from_le_byte_slice(bytes: &[u8]) -> Configuration {
165 Configuration {
166 acquisition_count: <u8>::from_le_byte_slice(&bytes[0..1]),
167 enable_quick_termination: <bool>::from_le_byte_slice(&bytes[1..2]),
168 threshold_value: <u8>::from_le_byte_slice(&bytes[2..3]),
169 measurement_frequency: <u16>::from_le_byte_slice(&bytes[3..5]),
170 }
171 }
172}
173
174#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
175pub struct Identity {
176 pub uid: String,
177 pub connected_uid: String,
178 pub position: char,
179 pub hardware_version: [u8; 3],
180 pub firmware_version: [u8; 3],
181 pub device_identifier: u16,
182}
183impl FromByteSlice for Identity {
184 fn bytes_expected() -> usize {
185 25
186 }
187 fn from_le_byte_slice(bytes: &[u8]) -> Identity {
188 Identity {
189 uid: <String>::from_le_byte_slice(&bytes[0..8]),
190 connected_uid: <String>::from_le_byte_slice(&bytes[8..16]),
191 position: <char>::from_le_byte_slice(&bytes[16..17]),
192 hardware_version: <[u8; 3]>::from_le_byte_slice(&bytes[17..20]),
193 firmware_version: <[u8; 3]>::from_le_byte_slice(&bytes[20..23]),
194 device_identifier: <u16>::from_le_byte_slice(&bytes[23..25]),
195 }
196 }
197}
198
199#[derive(Clone)]
201pub struct LaserRangeFinderBricklet {
202 device: Device,
203}
204impl LaserRangeFinderBricklet {
205 pub const DEVICE_IDENTIFIER: u16 = 255;
206 pub const DEVICE_DISPLAY_NAME: &'static str = "Laser Range Finder Bricklet";
207 pub fn new(uid: Uid, connection: AsyncIpConnection) -> LaserRangeFinderBricklet {
209 let mut result = LaserRangeFinderBricklet { device: Device::new([2, 0, 10], uid, connection, Self::DEVICE_DISPLAY_NAME) };
210 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::GetDistance) as usize] =
211 ResponseExpectedFlag::AlwaysTrue;
212 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::GetVelocity) as usize] =
213 ResponseExpectedFlag::AlwaysTrue;
214 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::SetDistanceCallbackPeriod) as usize] =
215 ResponseExpectedFlag::True;
216 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::GetDistanceCallbackPeriod) as usize] =
217 ResponseExpectedFlag::AlwaysTrue;
218 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::SetVelocityCallbackPeriod) as usize] =
219 ResponseExpectedFlag::True;
220 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::GetVelocityCallbackPeriod) as usize] =
221 ResponseExpectedFlag::AlwaysTrue;
222 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::SetDistanceCallbackThreshold) as usize] =
223 ResponseExpectedFlag::True;
224 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::GetDistanceCallbackThreshold) as usize] =
225 ResponseExpectedFlag::AlwaysTrue;
226 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::SetVelocityCallbackThreshold) as usize] =
227 ResponseExpectedFlag::True;
228 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::GetVelocityCallbackThreshold) as usize] =
229 ResponseExpectedFlag::AlwaysTrue;
230 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::SetDebouncePeriod) as usize] =
231 ResponseExpectedFlag::True;
232 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::GetDebouncePeriod) as usize] =
233 ResponseExpectedFlag::AlwaysTrue;
234 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::SetMovingAverage) as usize] =
235 ResponseExpectedFlag::False;
236 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::GetMovingAverage) as usize] =
237 ResponseExpectedFlag::AlwaysTrue;
238 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::SetMode) as usize] = ResponseExpectedFlag::False;
239 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::GetMode) as usize] = ResponseExpectedFlag::AlwaysTrue;
240 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::EnableLaser) as usize] = ResponseExpectedFlag::False;
241 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::DisableLaser) as usize] = ResponseExpectedFlag::False;
242 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::IsLaserEnabled) as usize] =
243 ResponseExpectedFlag::AlwaysTrue;
244 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::GetSensorHardwareVersion) as usize] =
245 ResponseExpectedFlag::AlwaysTrue;
246 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::SetConfiguration) as usize] =
247 ResponseExpectedFlag::False;
248 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::GetConfiguration) as usize] =
249 ResponseExpectedFlag::AlwaysTrue;
250 result.device.response_expected[u8::from(LaserRangeFinderBrickletFunction::GetIdentity) as usize] =
251 ResponseExpectedFlag::AlwaysTrue;
252 result
253 }
254
255 pub fn get_response_expected(&mut self, fun: LaserRangeFinderBrickletFunction) -> Result<bool, GetResponseExpectedError> {
270 self.device.get_response_expected(u8::from(fun))
271 }
272
273 pub fn set_response_expected(
282 &mut self,
283 fun: LaserRangeFinderBrickletFunction,
284 response_expected: bool,
285 ) -> Result<(), SetResponseExpectedError> {
286 self.device.set_response_expected(u8::from(fun), response_expected)
287 }
288
289 pub fn set_response_expected_all(&mut self, response_expected: bool) {
291 self.device.set_response_expected_all(response_expected)
292 }
293
294 pub fn get_api_version(&self) -> [u8; 3] {
297 self.device.api_version
298 }
299
300 pub async fn get_distance_callback_receiver(&mut self) -> impl Stream<Item = u16> {
310 self.device
311 .get_callback_receiver(u8::from(LaserRangeFinderBrickletFunction::CallbackDistance))
312 .await
313 .map(|p| u16::from_le_byte_slice(p.body()))
314 }
315
316 pub async fn get_velocity_callback_receiver(&mut self) -> impl Stream<Item = i16> {
323 self.device
324 .get_callback_receiver(u8::from(LaserRangeFinderBrickletFunction::CallbackVelocity))
325 .await
326 .map(|p| i16::from_le_byte_slice(p.body()))
327 }
328
329 pub async fn get_distance_reached_callback_receiver(&mut self) -> impl Stream<Item = u16> {
336 self.device
337 .get_callback_receiver(u8::from(LaserRangeFinderBrickletFunction::CallbackDistanceReached))
338 .await
339 .map(|p| u16::from_le_byte_slice(p.body()))
340 }
341
342 pub async fn get_velocity_reached_callback_receiver(&mut self) -> impl Stream<Item = i16> {
349 self.device
350 .get_callback_receiver(u8::from(LaserRangeFinderBrickletFunction::CallbackVelocityReached))
351 .await
352 .map(|p| i16::from_le_byte_slice(p.body()))
353 }
354
355 pub async fn get_distance(&mut self) -> Result<u16, TinkerforgeError> {
367 let payload = [0; 0];
368
369 #[allow(unused_variables)]
370 let result = self.device.get(u8::from(LaserRangeFinderBrickletFunction::GetDistance), &payload).await?;
371 Ok(u16::from_le_byte_slice(result.body()))
372 }
373
374 pub async fn get_velocity(&mut self) -> Result<i16, TinkerforgeError> {
388 let payload = [0; 0];
389
390 #[allow(unused_variables)]
391 let result = self.device.get(u8::from(LaserRangeFinderBrickletFunction::GetVelocity), &payload).await?;
392 Ok(i16::from_le_byte_slice(result.body()))
393 }
394
395 pub async fn set_distance_callback_period(&mut self, period: u32) -> Result<(), TinkerforgeError> {
401 let mut payload = [0; 4];
402 period.write_to_slice(&mut payload[0..4]);
403
404 #[allow(unused_variables)]
405 let result = self.device.set(u8::from(LaserRangeFinderBrickletFunction::SetDistanceCallbackPeriod), &payload).await?;
406 Ok(())
407 }
408
409 pub async fn get_distance_callback_period(&mut self) -> Result<u32, TinkerforgeError> {
411 let payload = [0; 0];
412
413 #[allow(unused_variables)]
414 let result = self.device.get(u8::from(LaserRangeFinderBrickletFunction::GetDistanceCallbackPeriod), &payload).await?;
415 Ok(u32::from_le_byte_slice(result.body()))
416 }
417
418 pub async fn set_velocity_callback_period(&mut self, period: u32) -> Result<(), TinkerforgeError> {
424 let mut payload = [0; 4];
425 period.write_to_slice(&mut payload[0..4]);
426
427 #[allow(unused_variables)]
428 let result = self.device.set(u8::from(LaserRangeFinderBrickletFunction::SetVelocityCallbackPeriod), &payload).await?;
429 Ok(())
430 }
431
432 pub async fn get_velocity_callback_period(&mut self) -> Result<u32, TinkerforgeError> {
434 let payload = [0; 0];
435
436 #[allow(unused_variables)]
437 let result = self.device.get(u8::from(LaserRangeFinderBrickletFunction::GetVelocityCallbackPeriod), &payload).await?;
438 Ok(u32::from_le_byte_slice(result.body()))
439 }
440
441 pub async fn set_distance_callback_threshold(&mut self, option: char, min: u16, max: u16) -> Result<(), TinkerforgeError> {
460 let mut payload = [0; 5];
461 option.write_to_slice(&mut payload[0..1]);
462 min.write_to_slice(&mut payload[1..3]);
463 max.write_to_slice(&mut payload[3..5]);
464
465 #[allow(unused_variables)]
466 let result = self.device.set(u8::from(LaserRangeFinderBrickletFunction::SetDistanceCallbackThreshold), &payload).await?;
467 Ok(())
468 }
469
470 pub async fn get_distance_callback_threshold(&mut self) -> Result<DistanceCallbackThreshold, TinkerforgeError> {
479 let payload = [0; 0];
480
481 #[allow(unused_variables)]
482 let result = self.device.get(u8::from(LaserRangeFinderBrickletFunction::GetDistanceCallbackThreshold), &payload).await?;
483 Ok(DistanceCallbackThreshold::from_le_byte_slice(result.body()))
484 }
485
486 pub async fn set_velocity_callback_threshold(&mut self, option: char, min: i16, max: i16) -> Result<(), TinkerforgeError> {
505 let mut payload = [0; 5];
506 option.write_to_slice(&mut payload[0..1]);
507 min.write_to_slice(&mut payload[1..3]);
508 max.write_to_slice(&mut payload[3..5]);
509
510 #[allow(unused_variables)]
511 let result = self.device.set(u8::from(LaserRangeFinderBrickletFunction::SetVelocityCallbackThreshold), &payload).await?;
512 Ok(())
513 }
514
515 pub async fn get_velocity_callback_threshold(&mut self) -> Result<VelocityCallbackThreshold, TinkerforgeError> {
524 let payload = [0; 0];
525
526 #[allow(unused_variables)]
527 let result = self.device.get(u8::from(LaserRangeFinderBrickletFunction::GetVelocityCallbackThreshold), &payload).await?;
528 Ok(VelocityCallbackThreshold::from_le_byte_slice(result.body()))
529 }
530
531 pub async fn set_debounce_period(&mut self, debounce: u32) -> Result<(), TinkerforgeError> {
543 let mut payload = [0; 4];
544 debounce.write_to_slice(&mut payload[0..4]);
545
546 #[allow(unused_variables)]
547 let result = self.device.set(u8::from(LaserRangeFinderBrickletFunction::SetDebouncePeriod), &payload).await?;
548 Ok(())
549 }
550
551 pub async fn get_debounce_period(&mut self) -> Result<u32, TinkerforgeError> {
553 let payload = [0; 0];
554
555 #[allow(unused_variables)]
556 let result = self.device.get(u8::from(LaserRangeFinderBrickletFunction::GetDebouncePeriod), &payload).await?;
557 Ok(u32::from_le_byte_slice(result.body()))
558 }
559
560 pub async fn set_moving_average(&mut self, distance_average_length: u8, velocity_average_length: u8) -> Result<(), TinkerforgeError> {
566 let mut payload = [0; 2];
567 distance_average_length.write_to_slice(&mut payload[0..1]);
568 velocity_average_length.write_to_slice(&mut payload[1..2]);
569
570 #[allow(unused_variables)]
571 let result = self.device.set(u8::from(LaserRangeFinderBrickletFunction::SetMovingAverage), &payload).await?;
572 Ok(())
573 }
574
575 pub async fn get_moving_average(&mut self) -> Result<MovingAverage, TinkerforgeError> {
577 let payload = [0; 0];
578
579 #[allow(unused_variables)]
580 let result = self.device.get(u8::from(LaserRangeFinderBrickletFunction::GetMovingAverage), &payload).await?;
581 Ok(MovingAverage::from_le_byte_slice(result.body()))
582 }
583
584 pub async fn set_mode(&mut self, mode: u8) -> Result<(), TinkerforgeError> {
608 let mut payload = [0; 1];
609 mode.write_to_slice(&mut payload[0..1]);
610
611 #[allow(unused_variables)]
612 let result = self.device.set(u8::from(LaserRangeFinderBrickletFunction::SetMode), &payload).await?;
613 Ok(())
614 }
615
616 pub async fn get_mode(&mut self) -> Result<u8, TinkerforgeError> {
625 let payload = [0; 0];
626
627 #[allow(unused_variables)]
628 let result = self.device.get(u8::from(LaserRangeFinderBrickletFunction::GetMode), &payload).await?;
629 Ok(u8::from_le_byte_slice(result.body()))
630 }
631
632 pub async fn enable_laser(&mut self) -> Result<(), TinkerforgeError> {
637 let payload = [0; 0];
638
639 #[allow(unused_variables)]
640 let result = self.device.set(u8::from(LaserRangeFinderBrickletFunction::EnableLaser), &payload).await?;
641 Ok(())
642 }
643
644 pub async fn disable_laser(&mut self) -> Result<(), TinkerforgeError> {
646 let payload = [0; 0];
647
648 #[allow(unused_variables)]
649 let result = self.device.set(u8::from(LaserRangeFinderBrickletFunction::DisableLaser), &payload).await?;
650 Ok(())
651 }
652
653 pub async fn is_laser_enabled(&mut self) -> Result<bool, TinkerforgeError> {
655 let payload = [0; 0];
656
657 #[allow(unused_variables)]
658 let result = self.device.get(u8::from(LaserRangeFinderBrickletFunction::IsLaserEnabled), &payload).await?;
659 Ok(bool::from_le_byte_slice(result.body()))
660 }
661
662 pub async fn get_sensor_hardware_version(&mut self) -> Result<u8, TinkerforgeError> {
671 let payload = [0; 0];
672
673 #[allow(unused_variables)]
674 let result = self.device.get(u8::from(LaserRangeFinderBrickletFunction::GetSensorHardwareVersion), &payload).await?;
675 Ok(u8::from_le_byte_slice(result.body()))
676 }
677
678 pub async fn set_configuration(
711 &mut self,
712 acquisition_count: u8,
713 enable_quick_termination: bool,
714 threshold_value: u8,
715 measurement_frequency: u16,
716 ) -> Result<(), TinkerforgeError> {
717 let mut payload = [0; 5];
718 acquisition_count.write_to_slice(&mut payload[0..1]);
719 enable_quick_termination.write_to_slice(&mut payload[1..2]);
720 threshold_value.write_to_slice(&mut payload[2..3]);
721 measurement_frequency.write_to_slice(&mut payload[3..5]);
722
723 #[allow(unused_variables)]
724 let result = self.device.set(u8::from(LaserRangeFinderBrickletFunction::SetConfiguration), &payload).await?;
725 Ok(())
726 }
727
728 pub async fn get_configuration(&mut self) -> Result<Configuration, TinkerforgeError> {
733 let payload = [0; 0];
734
735 #[allow(unused_variables)]
736 let result = self.device.get(u8::from(LaserRangeFinderBrickletFunction::GetConfiguration), &payload).await?;
737 Ok(Configuration::from_le_byte_slice(result.body()))
738 }
739
740 pub async fn get_identity(&mut self) -> Result<Identity, TinkerforgeError> {
751 let payload = [0; 0];
752
753 #[allow(unused_variables)]
754 let result = self.device.get(u8::from(LaserRangeFinderBrickletFunction::GetIdentity), &payload).await?;
755 Ok(Identity::from_le_byte_slice(result.body()))
756 }
757}