Commit f4c5ba37 authored by Georg Brandl's avatar Georg Brandl Committed by Georg Brandl
Browse files

tc/ag1017: bytes/string fixup

Fixes: #4339
Change-Id: I5ae01b466c6a59a5dbc705d6d47c67c69fe5c9bd
Reviewed-on: https://forge.frm2.tum.de/review/c/frm2/tango/entangle/+/25268


Tested-by: default avatarJenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: default avatarJens Krueger <jens.krueger@frm2.tum.de>
Reviewed-by: default avatarGeorg Brandl <g.brandl@fz-juelich.de>
parent 70affe0f
......@@ -31,7 +31,7 @@ from struct import calcsize, pack, unpack
from entangle import base
from entangle.core import ALARM, FAULT, OFF, ON, Prop, intrange, oneof, subdev
from entangle.core.errors import CommunicationFailure
from entangle.lib.pycompat import bytes2list, list2bytes
from entangle.lib.pycompat import bytes2list, list2bytes, bytes2str
from entangle.lib.util import format_statusbits
ACK = 0x2A
......@@ -195,7 +195,7 @@ class TCBase(object):
# raise CommunicationFailure('illegal address in %r' % reply)
if datalen + MIN_REPLY_LEN != recv:
raise CommunicationFailure(
'illegal datalen or reply fram too short in %r' % reply)
'illegal datalen or reply frame too short in %r' % reply)
# check sum
chk = unpack('>H', list2bytes(reply[-2:]))
if chk != sum(reply[:-2]):
......@@ -417,14 +417,14 @@ class TCBase(object):
p, s = self._communicate(GET_ID_STRINGS, 1)
if p != 1:
raise CommunicationFailure('Bad answer to GET_ID_STRINGS')
return s.strip()
return bytes2str(s.strip())
def _get_unit_serial(self):
# replies a (N)ACK, 1*int16,14 chars:1, unit serial as ASCIIZ
p, s = self._communicate(GET_ID_STRINGS, 2)
if p != 2:
raise CommunicationFailure('Bad answer to GET_ID_STRINGS')
return s.strip()
return bytes2str(s.strip())
def _get_power_profile(self):
# replies a (N)ACK, 10*int16: fmin,p1,f2,p2,f3,p3,f4,p4,fmax,rplim
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment