From c70b61e4e5ae966b12b7441a5c6e91a878d7870f Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Mon, 23 Jan 2023 17:43:27 +0100 Subject: [PATCH] relax identification check accept *,SECoP,* Change-Id: Ieb56e9c57fc5eb18e025fbc2f1d17a9d6e3f0a97 --- secop/client/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/secop/client/__init__.py b/secop/client/__init__.py index e01522a..1cd7b0d 100644 --- a/secop/client/__init__.py +++ b/secop/client/__init__.py @@ -243,7 +243,7 @@ class SecopClient(ProxyClient): self.secop_version = reply.decode('utf-8') else: raise self.error_map('HardwareError')('no answer to %s' % IDENTREQUEST) - if not self.secop_version.startswith(IDENTPREFIX): + if self.secop_version.split(',')[1] != 'SECoP': raise self.error_map('HardwareError')('bad answer to %s: %r' % (IDENTREQUEST, self.secop_version)) # now its safe to do secop stuff @@ -285,7 +285,7 @@ class SecopClient(ProxyClient): else: self.active_requests[key] = entry line = encode_msg_frame(*request) - self.log.debug('TX: %r', line) + self.log.debug('> %s', line.decode('utf-8')) self.io.send(line) self._txthread = None self.disconnect(False) @@ -302,6 +302,7 @@ class SecopClient(ProxyClient): # send ping to check if the connection is still alive self.queue_request(HEARTBEATREQUEST, str(noactivity)) continue + self.log.debug('< %s', reply.decode('utf-8')) noactivity = 0 action, ident, data = decode_msg(reply) if ident == '.':