 
 
 
+// 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
-//extern String brokers[MAX_BROKERS][4];  // Array containing information about brokers received over mDNS.
 Brokers brokers(QUESTION_SERVICE);
 
-void answerCallback(const mdns::Answer* answer){ brokers.ParseMDnsAnswer(answer); }
+void answerCallback(const mdns::Answer* answer) {
+  brokers.ParseMDnsAnswer(answer);
+}
 mdns::MDns my_mdns(NULL, NULL, answerCallback);
 
 

}

void handleConfig() {
  String message = "";
  if (http_server.hasArg("test_arg")) {
    message += "test_arg: " + http_server.arg("test_arg") + "\n";
  }

  http_server.send(200, "text/plain", message);

// 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,
