mqtt.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:thingflow-python 作者: mpi-sws-rse 项目源码 文件源码
def __init__(self, host, port=1883, client_id="", client_username="", client_password=None, server_tls=False, server_cert=None, topics=[], mock_class=None):
        self.host = host
        self.port = port
        self.client_id = client_id
        self.client_username = client_id
        self.client_password = client_password
        self.topics = topics

        self.server_tls =  server_tls
        self.server_cert = server_cert

        if mock_class:
            self.client = MockMQTTClient(self.client_id)
        else:
            self.client = paho.Client(self.client_id)

        if self.client_username:
            self.client.username_pw_set(self.client_username, password=self.client_password)

        self._connect()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号