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. |
106 topic = xstrcpy((char *)"mbv1.0/ispindels/#"); // Subscribe to ispindel messages. |
107 mosquitto_subscribe(mosq, NULL, topic, 0); |
107 mosquitto_subscribe(mosq, NULL, topic, 0); |
108 free(topic); |
108 free(topic); |
109 topic = NULL; |
109 topic = NULL; |
110 mqtt_status = STATUS_CONNACK_RECVD; |
110 mqtt_status = STATUS_CONNACK_RECVD; |
111 } else { |
111 } else { |
181 } |
181 } |
182 if (strstr(message->topic, (char *)"co2meters") && strstr(message->topic, (char *)"DLOG")) { |
182 if (strstr(message->topic, (char *)"co2meters") && strstr(message->topic, (char *)"DLOG")) { |
183 co2meter_log(message->topic, (char *)message->payload); |
183 co2meter_log(message->topic, (char *)message->payload); |
184 return; |
184 return; |
185 } |
185 } |
186 if (strstr(message->topic, (char *)"ispindel")) { |
186 if (strstr(message->topic, (char *)"ispindels") && strstr(message->topic, (char *)"DBIRTH")) { |
187 ispindel_mqtt(message->topic, (char *)message->payload); |
187 ispindel_birth_data(message->topic, (char *)message->payload); |
|
188 return; |
188 } |
189 } |
189 syslog(LOG_NOTICE, "MQTT: message callback %s :: %d", message->topic, message->payloadlen); |
190 syslog(LOG_NOTICE, "MQTT: message callback %s :: %d", message->topic, message->payloadlen); |
190 } else { |
191 } else { |
191 if (strstr(message->topic, (char *)"NBIRTH")) { |
192 if (strstr(message->topic, (char *)"NBIRTH")) { |
192 // Ignore ?? |
193 // Ignore ?? |