 // Maximum number of devices connected to IO pins.
 #define MAX_DEVICES 8
 
+// Length of name strings. (hostname, room names, lamp names, etc.)
+#define NAME_LEN 32
+
 
 enum Io_Type {
   test,

  if (!mqtt_client.connected()) {
    Serial.println("MQTT disconnected.");
    mqtt_connect();
  }  
}




// Configuration
void SetHostname(const char* new_hostname) {
  strncpy(config.hostname, new_hostname, NAME_LEN);
}

void SetDevice(const unsigned int index, struct Connected_device device) {
  if (index < MAX_DEVICES) {
    memcpy(&(config.devices[index]), &device, sizeof(device));
  }
}


// mDNS
Brokers brokers(QUESTION_SERVICE);

void answerCallback(const mdns::Answer* answer) {
  brokers.ParseMDnsAnswer(answer);
}
mdns::MDns my_mdns(NULL, NULL, answerCallback);


