Ejemplo n.º 1
0
 def splitMessage(self, boundary, message, maxRange):
     hexData = Converter.byteListToHex(message)
     splitMsg = ''
     los = 0
     startLo = 0
     hexDatas = hexData.split(' ')
     if boundary[los] == 0:
         los = los + 1
     for i in range(min(len(hexDatas), maxRange)):
         if los >= len(boundary):
             splitMsg = splitMsg + hexDatas[i] + ' '
             continue
         splitMsg = splitMsg + hexDatas[i] + ' '
         if i + 1 == boundary[los]:
             splitMsg = splitMsg + '|'
             los = los + 1
     return splitMsg
Ejemplo n.º 2
0
 def splitMessageByType(self, boundary, message):
     hexData = Converter.byteListToHex(message)
     splitMsg = ''
     los = 0
     spltMsgs = []
     hexDatas = hexData.split(' ')
     if boundary[los] == 0:
         los = los + 1
     for i in range((len(hexDatas))):
         if los >= len(boundary):
             splitMsg = splitMsg + hexDatas[i] + ' '
             continue
         splitMsg = splitMsg + hexDatas[i] + ' '
         if i + 1 == boundary[los]:
             spltMsgs.append(splitMsg)
             splitMsg = ''
             los = los + 1
     return spltMsgs