bmsd/mqtt.c

changeset 572
7a03181d29a3
parent 567
6bf0afc33e70
child 578
e75ce5bbda73
equal deleted inserted replaced
571:468377312726 572:7a03181d29a3
101 mosquitto_subscribe(mosq, NULL, topic, 0); 101 mosquitto_subscribe(mosq, NULL, topic, 0);
102 free(topic); 102 free(topic);
103 topic = xstrcpy((char *)"mbv1.0/co2meters/#"); // Subscribe to co2meter messages. 103 topic = xstrcpy((char *)"mbv1.0/co2meters/#"); // Subscribe to co2meter messages.
104 mosquitto_subscribe(mosq, NULL, topic, 0); 104 mosquitto_subscribe(mosq, NULL, topic, 0);
105 free(topic); 105 free(topic);
106 topic = xstrcpy((char *)"ispindel/#"); // Subscribe to ispindel messages.
107 mosquitto_subscribe(mosq, NULL, topic, 0);
108 free(topic);
106 topic = NULL; 109 topic = NULL;
107 mqtt_status = STATUS_CONNACK_RECVD; 110 mqtt_status = STATUS_CONNACK_RECVD;
108 } else { 111 } else {
109 syslog(LOG_NOTICE, "MQTT: my_connect_callback: %s\n", mosquitto_connack_string(result)); 112 syslog(LOG_NOTICE, "MQTT: my_connect_callback: %s\n", mosquitto_connack_string(result));
110 } 113 }

mercurial