relax identification check

accept *,SECoP,*

Change-Id: Ieb56e9c57fc5eb18e025fbc2f1d17a9d6e3f0a97
This commit is contained in:
zolliker 2023-01-23 17:43:27 +01:00
parent 589b857039
commit c70b61e4e5

View File

@ -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 == '.':