introduce dns

This commit is contained in:
2020-11-27 12:28:56 +01:00
parent 3e1a7946c2
commit 8894036679
6 changed files with 32 additions and 1 deletions

View File

@ -92,6 +92,11 @@ void mqttCommHandler(void *handle) {
break;
case 1:
coloredMsg(LOG_GREEN, false, "mqch, resolving broker name");
if (! wizDnsQuery("mqttbroker", brokerAddress)) {
coloredMsg(LOG_GREEN, false, "mqch, query for broker address failed, going to error state");
state = 255;
}
coloredMsg(LOG_GREEN, false, "mqch, connecting to broker ");
bool res = mqttConnect(&mqttClient, brokerAddress, 1883, "mbv3gw-client", NULL, NULL, NULL, 0, false, NULL, false);
coloredMsg(LOG_GREEN, false, "mqch, mqttConnect returns %d", res);