Beispiel #1
0
    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
Beispiel #2
0
    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
Beispiel #3
0
    def sendCommand(self, cmd, binPayload=None):

        cobsBlock = binPayload and cobs.encodeCobsString(binPayload)
        self.sendCommandC(cmd, cobsBlock)
Beispiel #4
0
    def sendCommand(self, cmd, binPayload=None):

        cobsBlock = binPayload and cobs.encodeCobsString(binPayload)
        self.sendCommandC(cmd, cobsBlock)