@@ -316,7 +316,7 @@ def _process_data_command(self, genre, _class, args):
316316 processed_args = []
317317 for index in range (len (args )):
318318 if isinstance (args [index ], list ):
319- if genre == ProtocolCode .SET_ENCODERS_DRAG and index == 0 and _class == "Mercury" :
319+ if genre == ProtocolCode .SET_ENCODERS_DRAG and index == 0 and _class in [ "Mercury" , "MercurySocket" ] :
320320 for data in args [index ]:
321321 byte_value = data .to_bytes (4 , byteorder = 'big' , signed = True )
322322 res = []
@@ -329,7 +329,7 @@ def _process_data_command(self, genre, _class, args):
329329 if isinstance (args [index ], str ):
330330 processed_args .append (args [index ])
331331 else :
332- if genre == ProtocolCode .SET_SERVO_DATA and _class == "Mercury" and index == 2 :
332+ if genre == ProtocolCode .SET_SERVO_DATA and _class in [ "Mercury" , "MercurySocket" ] and index == 2 :
333333 byte_value = args [index ].to_bytes (2 , byteorder = 'big' , signed = True )
334334 res = []
335335 for i in range (len (byte_value )):
@@ -540,7 +540,7 @@ def read(self, genre, method=None, command=None, _class=None):
540540 while True and time .time () - t < wait_time :
541541 data = self ._serial_port .read ()
542542 k += 1
543- if _class == "Mercury" :
543+ if _class in [ "Mercury" , "MercurySocket" ] :
544544 if data_len == 3 :
545545 datas += data
546546 crc = self ._serial_port .read (2 )
0 commit comments