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_message

      self.__mqtt__.connect(self.config["mqtt"]["wss_addr"], \
              self.config["mqtt"]["wss_port"], keepalive=10)
    

    ‘’’

  • 它主要是使用回调函数的方法,让我很好奇,所有有这篇记录


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM