public publish method
This commit is contained in:
parent
e79cc5f54d
commit
79d9d2fd7c
@ -118,3 +118,12 @@ void mqttCommHandler(void *handle) {
|
||||
void mqttCommInit() {
|
||||
schAdd(mqttCommHandler, NULL, 0, 100);
|
||||
}
|
||||
|
||||
void mqttPublish(char *topic, char *message) {
|
||||
bool res = publish(&mqttClient, topic, message, strlen(message), false);
|
||||
if (res) {
|
||||
coloredMsg(LOG_YELLOW, "mqp: %s -> %s successfully published", message, topic);
|
||||
} else {
|
||||
coloredMsg(LOG_RED, "mqp: %s -> %s failed to publish", message, topic);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user