93 if (!result) { |
93 if (!result) { |
94 topic = topic_base((char *)"NCMD"); // TODO: do we need this?? |
94 topic = topic_base((char *)"NCMD"); // TODO: do we need this?? |
95 topic = xstrcat(topic, (char *)"/#"); |
95 topic = xstrcat(topic, (char *)"/#"); |
96 mosquitto_subscribe(mosq, NULL, topic, 0); |
96 mosquitto_subscribe(mosq, NULL, topic, 0); |
97 free(topic); |
97 free(topic); |
98 topic = xstrcpy((char *)"mbv1.0/fermenters/#"); // Subscribe to fermenter messages. |
98 topic = xstrcpy((char *)"mbv1.0/fermenters/#"); // Subscribe to fermenter messages. |
99 mosquitto_subscribe(mosq, NULL, topic, 0); |
99 mosquitto_subscribe(mosq, NULL, topic, 0); |
100 free(topic); |
100 free(topic); |
101 topic = xstrcpy((char *)"mbv1.0/brewcontrol/#"); // Subscribe to brewcontrol messages. |
101 topic = xstrcpy((char *)"mbv1.0/co2meter/#"); // Subscribe to co2meter messages. |
102 mosquitto_subscribe(mosq, NULL, topic, 0); |
102 mosquitto_subscribe(mosq, NULL, topic, 0); |
103 free(topic); |
103 free(topic); |
104 topic = NULL; |
104 topic = NULL; |
105 mqtt_status = STATUS_CONNACK_RECVD; |
105 mqtt_status = STATUS_CONNACK_RECVD; |
106 } else { |
106 } else { |