Last active
May 21, 2024 15:56
-
-
Save jacksonkeating/41f55496aa715eabd70d179cb669294d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//prototypes | |
//functions without a host argument use unauthenticated mqtt://test.mosquitto.org:1883 by default | |
async function expect(topic); | |
async function publish(topic, publishValue); | |
async function expectCustom(host, username, password, topic, publishValue); | |
async function publishCustom(host, username, password, topic, publishValue); | |
//examples | |
var result: {status: string, data: Uint8Array } = {} | |
await wavecake.mqtt.expect('wavecake'); | |
await wavecake.mqtt.publish('wavecake', 'String'); | |
await wavecake.mqtt.expectCustom('mqtts://test.mosquitto.org:8883','wavecake_dev','password','wavecake'); | |
await wavecake.mqtt.publishCustom('mqtts://test.mosquitto.org:8883','wavecake_dev','password','wavecake','String'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment