@@ -14,6 +14,7 @@ mod checksum;
14
14
mod cmds;
15
15
mod prelude;
16
16
mod protocol;
17
+ pub mod utils;
17
18
18
19
pub use self :: prelude:: * ;
19
20
@@ -25,7 +26,7 @@ use self::capsuled_parser::parse_capsuled;
25
26
use self :: ultra_capsuled_parser:: parse_ultra_capsuled;
26
27
use self :: checksum:: Checksum ;
27
28
use self :: cmds:: * ;
28
- pub use self :: protocol:: RplidarProtocol ;
29
+ pub use self :: protocol:: RplidarHostProtocol ;
29
30
use byteorder:: { ByteOrder , LittleEndian } ;
30
31
use rpos_drv:: { Channel , Error , ErrorKind , Message , Result } ;
31
32
use std:: collections:: VecDeque ;
@@ -39,7 +40,7 @@ const RPLIDAR_GET_LIDAR_CONF_START_VERSION:u16 = ((1 << 8) | (24)) as u16;
39
40
/// Rplidar device driver
40
41
#[ derive( Debug ) ]
41
42
pub struct RplidarDevice < T : ?Sized > {
42
- channel : Channel < RplidarProtocol , T > ,
43
+ channel : Channel < RplidarHostProtocol , T > ,
43
44
cached_measurement_nodes : VecDeque < ScanPoint > ,
44
45
cached_prev_capsule : CachedPrevCapsule ,
45
46
}
@@ -93,10 +94,10 @@ where
93
94
/// # Example
94
95
/// ```compile_fail
95
96
/// let mut serial_port = serialport::open(serial_port_name)?;
96
- /// let channel = Channel::new(RplidarProtocol ::new(), serial_port);
97
+ /// let channel = Channel::new(RplidarHostProtocol ::new(), serial_port);
97
98
/// let rplidar_device = RplidarDevice::new(channel);
98
99
/// ```
99
- pub fn new ( channel : Channel < RplidarProtocol , T > ) -> RplidarDevice < T > {
100
+ pub fn new ( channel : Channel < RplidarHostProtocol , T > ) -> RplidarDevice < T > {
100
101
RplidarDevice {
101
102
channel : channel,
102
103
cached_measurement_nodes : VecDeque :: with_capacity ( RPLIDAR_DEFAULT_CACHE_DEPTH ) ,
@@ -112,7 +113,7 @@ where
112
113
/// let rplidar_device = RplidarDevice::with_stream(serial_port);
113
114
/// ```
114
115
pub fn with_stream ( stream : Box < T > ) -> RplidarDevice < T > {
115
- RplidarDevice :: < T > :: new ( rpos_drv:: Channel :: new ( RplidarProtocol :: new ( ) , stream) )
116
+ RplidarDevice :: < T > :: new ( rpos_drv:: Channel :: new ( RplidarHostProtocol :: new ( ) , stream) )
116
117
}
117
118
118
119
/// get device info of the RPLIDAR
@@ -708,8 +709,3 @@ fn check_sync_and_checksum_hq(msg: &Message) -> Result<()> {
708
709
return Ok ( ( ) ) ;
709
710
}
710
711
}
711
-
712
- #[ cfg( test) ]
713
- mod tests {
714
-
715
- }
0 commit comments