bmsd/mqtt.c

changeset 679
48f8f3fce7c0
parent 590
a43b8b85d8b3
child 747
b6fbe6821468
equal deleted inserted replaced
678:14322825cb3d 679:48f8f3fce7c0
220 mosquitto_publish(my_mosq, &mqtt_mid_sent, topic, 0, NULL, mqtt_qos, retain); 220 mosquitto_publish(my_mosq, &mqtt_mid_sent, topic, 0, NULL, mqtt_qos, retain);
221 } 221 }
222 222
223 223
224 224
225 void mqtt_publish(char *topic, char *payload)
226 {
227 mosquitto_publish(mosq, &mqtt_mid_sent, topic, strlen(payload), payload, mqtt_qos, false);
228 }
229
230
231
225 void publishNData(bool birth, int flag) 232 void publishNData(bool birth, int flag)
226 { 233 {
227 char *topic = NULL, *payload = NULL; 234 char *topic = NULL, *payload = NULL;
228 struct utsname ubuf; 235 struct utsname ubuf;
229 bool comma = false; 236 bool comma = false;

mercurial