 
 // Radio pipe addresses for the 2 nodes to communicate.
 const uint64_t pipes[2] = {
-  0xF2F0F0F0D3LL, 0xF1F0F0F0C3LL
-};
-
-//Door Status
-typedef enum {
-  NOMEETING = 0, MIC = 1, CAMERA = 2, MICANDCAMERA = 3
-}
-SwitchStats;
+    0xF2F0F0F0D3LL, 0xF1F0F0F0C3LL};
+
+// Door Status
+typedef enum
+{
+  NOMEETING = 0,
+  MIC = 1,
+  CAMERA = 2,
+  MICANDCAMERA = 3
+} SwitchStats;
 
 // FriendlyName of the door state
-const char* switchStatsFriendlyName[] = {
-  "No meeting\n", "Mic on\n", "Video on\n", "Video and mic on\n"
-};
-
-//Status of the door currently
+const char *switchStatsFriendlyName[] = {
+    "No meeting\n", "Mic on\n", "Video on\n", "Video and mic on\n"};
+
+// Status of the door currently
 SwitchStats switchStats;
-
 
 const int maxPayloadSize = 255;
 const int minPayloadSize = 4;
 const int packageSize = 32;
 const int payloadIncrementBy = 2;
-const char* packetSizeCode = "packet-size";
+const char *packetSizeCode = "packet-size";
 int nextPayloadSize = minPayloadSize;
 
 void setup(void)

  while (radio.available() || radioIterator < packetCount)
  {
    char receive_payload[50];
    if(radio.available()) {
      // Fetch the payload, and see if this was the last one.
      len = radio.getDynamicPayloadSize();
      radio.read(receive_payload, len);
       // Spew it
      printf("Got payload size=%i value=%s\n\r", len, receive_payload);
    }

    if (millis() - started_waiting_at > 2500) {
      radioIterator = packetCount;
      printf("timeout; payload is now: %s\n\r", receive_payload);
    }

    // sender is sending packet size information
    if(radioIterator == 0 && 
      strncmp(receive_payload, packetSizeCode, sizeof(packetSizeCode)) == 0) {
        strtok(receive_payload, ":");
        packetCount = atoi(strtok(NULL, ":"));
        printf("number of packets changed to: %i\n\r", packetCount);

        radioIterator++;
    }

    // only concatenate string when packet count is still as the sender says
    if(strncmp(receive_payload, packetSizeCode, sizeof(packetSizeCode)) != 0) {
      finalMessage.concat(receive_payload);

      radioIterator++;
    }
  }
  printf("no more data\n\r");

  return finalMessage;
}

void decideSwitchMode(String jsonString) {
  DynamicJsonDocument doc(350);
  char* jsonChar = const_cast<char*>(jsonString.c_str());
  
  printf("JSON covert: %s", jsonString.c_str());
  auto error = deserializeJson(doc, jsonChar);
  if (error) {
      Serial.print(F("deserializeJson() failed with code "));
      Serial.println(error.c_str());
      return;
  }

  const int noMeetRed = doc["noMeeting"]["red"];
  const int micRed = doc["mic"]["red"];
  
  printf("nomeet: %i, mic: %i; camera: %s\n\r", noMeetRed, micRed, doc["camera"]);

  // if (jsonString == "green")

  // We will be using the Ack Payload feature, so please enable it
  radio.enableAckPayload();

  // All other setup
  radio.setDataRate(RF24_250KBPS);
  radio.setPALevel(RF24_PA_MAX);
  radio.setChannel(90);
