Mqtt paho 回调函数触发机制跟踪
作者:互联网
Python Mqtt paho 回调函数触发机制跟踪,我使用的是 buildroot 里面的 mqtt paho , 代码在
‘’‘
buildroot-2017.02.8/output/build/python-paho-mqtt-1.2/src/paho/mqtt
‘’‘python mqtt 的使用方法如下:
‘’‘
self.__mqtt_id = str(math.floor(time.time()))
self.mqtt = mqtt.Client(self.__mqtt_id)
self.__mqtt__.username_pw_set(self.config["mqtt"]["username"])
self.__mqtt__.on_connect = self.on_connect
self.__mqtt__.on_disconnect = self.on_disconnect
self.__mqtt__.on_message = self.on_messageself.__mqtt__.connect(self.config["mqtt"]["wss_addr"], \ self.config["mqtt"]["wss_port"], keepalive=10)
‘’’
它主要是使用回调函数的方法,让我很好奇,所有有这篇记录
标签:触发,.__,self,__.,mqtt,Mqtt,connect,paho 来源: https://www.cnblogs.com/chenfulin5/p/10823959.html