From a4c3f26899322a93a38a2c33294e0b1cb1ac5602 Mon Sep 17 00:00:00 2001
From: Anders Blomdell <anders.blomdell@control.lth.se>
Date: Thu, 10 Dec 2020 16:29:25 +0100
Subject: [PATCH] Add Protocol-1 implementation

---
 dynamixel/channel/channel.py | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/dynamixel/channel/channel.py b/dynamixel/channel/channel.py
index f5e082f..5ecf5de 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
-- 
GitLab