logo
首页技术栈工具库讨论
MQTT Client

MQTT Client

MQTT Client lets you connect to a MQTT broker and publish strings to a topic. First create a MQTTClient. You have to pass a task list from Cooperative Multitasking, a client (e.g. WiFiClient from WiFi101), host, port and credentials of the MQTT broker. Then create a MQTTTopic. Use the MQTTClient and the topic name as arguments when doing that. To connect to the broker call MQTTClient::connect(). After that you can call MQTTTopic:publish("...") to publish a string. Requires Cooperative Multitasking for processing the acknowledgement packets of the broker. So you have call CooperativeMultitasking::run() in your loop() function. See the examples for details.
由 
bruceshi2021-01-15 收录
--
推荐
不推荐
更多信息
PLATFORMIO
MQTT Client
标签
根据用户添加的标签生成
暂无标签