def query(self, cmd, binPayload=None, doLog=True): if doLog: self.gui.logSend("query: ", CommandNames[cmd]) cobsBlock = binPayload and cobs.encodeCobsString(binPayload) binary = self.buildBinaryCommand(cmd, cobsBlock) reply = self.send2(cmd, binary) if reply == ResendWasOK: # Command was ok, but no response due to reconnect, restart query: return self.query(cmd, binPayload) return reply
def query(self, cmd, binPayload=None, doLog=True): if doLog: self.gui.logSend("query: ", CommandNames[cmd]) cobsBlock = binPayload and cobs.encodeCobsString(binPayload) binary = self.buildBinaryCommand(cmd, cobsBlock) reply = self.send2(cmd, binary) if reply == ResendWasOK: # Command was ok, but no response due to reconnect, restart query: return self.query(cmd, binPayload) return reply
def sendCommand(self, cmd, binPayload=None): cobsBlock = binPayload and cobs.encodeCobsString(binPayload) self.sendCommandC(cmd, cobsBlock)
def sendCommand(self, cmd, binPayload=None): cobsBlock = binPayload and cobs.encodeCobsString(binPayload) self.sendCommandC(cmd, cobsBlock)