def __read(self): result = [] for _ in range(1): message = Message([Frame("1" * 256)]) message.ecu = ECU.ALL message.data = bytearray([randint(0, 255) for _ in range(6)]) result.append(message) return result
def send(self, cmd): # stow this, so we can check that the API made the right request print(cmd) self._last_command = cmd # all commands succeed message = Message([]) message.data = bytearray(b'response data') message.ecu = ECU.ENGINE # picked engine so that simple commands like RPM will work return [message]
def send_and_parse(self, cmd): # stow this, so we can check that the API made the right request print(cmd) self._last_command = cmd # all commands succeed message = Message([]) message.data = bytearray(b'response data') message.ecu = ECU.ENGINE # picked engine so that simple commands like RPM will work return [ message ]