Exemplo n.º 1
0
 def check_tx(self, txBytes):
     if self.serial:
         txByteArray = bytearray(txBytes)
         if len(txBytes) >= 2 and txBytes[:2] == "0x":
             txByteArray = hex2bytes(txBytes[2:])
         txValue = decode_big_endian(BytesBuffer(txByteArray), len(txBytes))
         if txValue < self.txCount:
             return 6
     return 0
Exemplo n.º 2
0
 def append_tx(self, txBytes):
     if self.serial:
         txByteArray = bytearray(txBytes)
         if len(txBytes) >= 2 and txBytes[:2] == "0x":
             txByteArray = hex2bytes(txBytes[2:])
         txValue = decode_big_endian(BytesBuffer(txByteArray), len(txBytes))
         if txValue != self.txCount:
             return None, 6
     self.txCount += 1
     return None, 0
Exemplo n.º 3
0
Arquivo: app.py Projeto: charwliu/tmsp
 def check_tx(self, txBytes):
     if self.serial:
         txByteArray = bytearray(txBytes)
         if len(txBytes) >= 2 and txBytes[:2] == "0x":
             txByteArray = hex2bytes(txBytes[2:])
         txValue = decode_big_endian(
             BytesBuffer(txByteArray), len(txBytes))
         if txValue < self.txCount:
             return 6
     return 0
Exemplo n.º 4
0
 def append_tx(self, txBytes):
     if self.serial:
         txByteArray = bytearray(txBytes)
         if len(txBytes) >= 2 and txBytes[:2] == "0x":
             txByteArray = hex2bytes(txBytes[2:])
         txValue = decode_big_endian(
             BytesBuffer(txByteArray), len(txBytes))
         if txValue != self.txCount:
             return None, 1
     self.txCount += 1
     return None, 0