コード例 #1
0
ファイル: actions.py プロジェクト: philostert/mqtt-extended
    def get_data(self):

        print("PUBLISH TO {} {} {} ".format(self._client.uid, self.msg.topic, self.msg.payload))
        if self.qos > MQTTConstants.AT_MOST_ONCE:
            self.msg.dup = self._client.outgoing_queue.is_sent(self.msg.id)
            #print("PUBLISH TO {} {} {} DUPLICATE: {}".format(self._client.uid, self.msg.topic, self.msg.payload,
            #                                              self.msg.dup))

        if self.qos == MQTTConstants.EXACTLY_ONCE:
            if self._client.outgoing_queue.is_pubconf(self.msg.id):
                return Pubrel.from_pub(self.msg)  # potentially misleading
            else:
                return self.msg
        else:
            return self.msg
コード例 #2
0
    def get_data(self):

        print("PUBLISH TO {} {} {} ".format(self._client.uid, self.msg.topic,
                                            self.msg.payload))
        if self.qos > MQTTConstants.AT_MOST_ONCE:
            self.msg.dup = self._client.outgoing_queue.is_sent(self.msg.id)
            #print("PUBLISH TO {} {} {} DUPLICATE: {}".format(self._client.uid, self.msg.topic, self.msg.payload,
            #                                              self.msg.dup))

        if self.qos == MQTTConstants.EXACTLY_ONCE:
            if self._client.outgoing_queue.is_pubconf(self.msg.id):
                return Pubrel.from_pub(self.msg)  # potentially misleading
            else:
                return self.msg
        else:
            return self.msg
コード例 #3
0
ファイル: actions.py プロジェクト: philostert/mqtt-extended
 def run(self):
     self._client.outgoing_queue.set_pubconf(self.msg.id)
     self.write_to_client(Pubrel.from_pub(self.msg))
コード例 #4
0
 def run(self):
     self._client.outgoing_queue.set_pubconf(self.msg.id)
     self.write_to_client(Pubrel.from_pub(self.msg))