Skip to content

Commit

Permalink
Python 2.x fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Feb 22, 2017
1 parent b0394e9 commit 8c01791
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions genibus/apdu.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""

from array import array
import logging

from genibus.devices.db import DeviceDB
import genibus.gbdefs as defs
from genibus.utils.crc import calcuteCrc
Expand Down Expand Up @@ -152,7 +154,7 @@ def createGetValuesPDU(klass, header, protocolData = [], measurements = [], para
crc = toBytes(calcuteCrc(pdu))
pdu.extend(crc)

return bytes(pdu)
return array('B', pdu)


def createSetValuesPDU(header, parameter = [], references = []):
Expand Down Expand Up @@ -183,7 +185,7 @@ def createSetValuesPDU(header, parameter = [], references = []):

#arr = array.array('B', pdu)
# TODO: arr.tostring() for I/O!
return bytes(pdu)
return array('B', pdu)


def createGetInfoPDU(klass, header, measurements = [], parameter = [], references = []):
Expand Down Expand Up @@ -222,7 +224,7 @@ def createGetInfoPDU(klass, header, measurements = [], parameter = [], reference
crc = toBytes(calcuteCrc(pdu))
pdu.extend(crc)

return bytes(pdu)
return array('B', pdu)


def createSetCommandsPDU(header, commands):
Expand All @@ -242,7 +244,7 @@ def createSetCommandsPDU(header, commands):
crc = toBytes(calcuteCrc(pdu))
pdu.extend(crc)

return bytes(pdu)
return array('B', pdu)



Expand Down

0 comments on commit 8c01791

Please sign in to comment.