File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -38,11 +38,13 @@ pub mod device;
3838
3939type Result < T > = std:: result:: Result < T , Box < dyn std:: error:: Error > > ;
4040
41+ #[ derive( Debug ) ]
4142enum Protocols {
4243 V1 ( V1 ) ,
4344 V2 ( V2 ) ,
4445}
4546
47+ #[ derive( Debug ) ]
4648/// Raw dynamixel communication messages controller (protocol v1 or v2)
4749pub struct DynamixelSerialIO {
4850 protocol : Protocols ,
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ use super::{CommunicationErrorKind, Packet};
88const BROADCAST_ID : u8 = 254 ;
99const BROADCAST_RESPONSE_ID : u8 = 253 ;
1010
11+ #[ derive( Debug ) ]
1112pub struct PacketV1 ;
1213impl Packet for PacketV1 {
1314 const HEADER_SIZE : usize = 4 ;
@@ -94,6 +95,7 @@ impl Packet for PacketV1 {
9495 }
9596}
9697
98+ #[ derive( Debug ) ]
9799struct InstructionPacketV1 {
98100 id : u8 ,
99101 instruction : InstructionKindV1 ,
@@ -126,6 +128,7 @@ impl InstructionPacket<PacketV1> for InstructionPacketV1 {
126128 }
127129}
128130
131+ #[ derive( Debug ) ]
129132struct StatusPacketV1 {
130133 id : u8 ,
131134 #[ allow( dead_code) ]
@@ -234,6 +237,7 @@ impl InstructionKindV1 {
234237 }
235238}
236239
240+ #[ derive( Debug ) ]
237241pub struct V1 ;
238242impl Protocol < PacketV1 > for V1 {
239243 fn new ( ) -> Self {
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ use crate::{
55
66use super :: { CommunicationErrorKind , Protocol } ;
77
8+ #[ derive( Debug ) ]
89pub struct V2 ;
910impl Protocol < PacketV2 > for V2 {
1011 fn new ( ) -> Self
@@ -35,6 +36,7 @@ impl Protocol<PacketV2> for V2 {
3536 }
3637}
3738
39+ #[ derive( Debug ) ]
3840pub struct PacketV2 ;
3941impl Packet for PacketV2 {
4042 const HEADER_SIZE : usize = 7 ;
@@ -132,6 +134,7 @@ impl Packet for PacketV2 {
132134 }
133135}
134136
137+ #[ derive( Debug ) ]
135138struct InstructionPacketV2 {
136139 id : u8 ,
137140 instruction : InstructionKindV2 ,
@@ -169,6 +172,7 @@ impl InstructionPacket<PacketV2> for InstructionPacketV2 {
169172 }
170173}
171174
175+ #[ derive( Debug ) ]
172176struct StatusPacketV2 {
173177 id : u8 ,
174178 errors : Vec < DynamixelErrorV2 > ,
You can’t perform that action at this time.
0 commit comments