diff --git a/dynamixel/channel/channel.py b/dynamixel/channel/channel.py index f5e082fa5aac84ec2e0795ff064824543da2dff0..5ecf5de36a13a6a9bcc2ccb40de8cf60edca6899 100644 --- a/dynamixel/channel/channel.py +++ b/dynamixel/channel/channel.py @@ -58,15 +58,12 @@ class Channel: pass -class Protocol1: - pass - -class Protocol2: +class Protocol: - def __init__(self, port_handler): + def __init__(self, port_handler, packet_handler): self.port_handler = port_handler - self.packet_handler = sdk.PacketHandler(2.0) + self.packet_handler = packet_handler pass def read(self, servo, row): @@ -113,3 +110,19 @@ class Protocol2: pass + +class Protocol1(Protocol): + + def __init__(self, port_handler): + super(Protocol1, self).__init__(port_handler, sdk.PacketHandler(1.0)) + pass + + pass + +class Protocol2(Protocol): + + def __init__(self, port_handler): + super(Protocol2, self).__init__(port_handler, sdk.PacketHandler(2.0)) + pass + + pass