From e1c538753667913799c3a4201d9055711a3dfd5b Mon Sep 17 00:00:00 2001
From: David Gauchard <gauchard@laas.fr>
Date: Wed, 19 Jan 2022 15:52:09 +0100
Subject: [PATCH 01/15] apply Allman to tests/

---
 tests/device/libraries/BSTest/src/BSArduino.h |   24 +-
 tests/device/libraries/BSTest/src/BSArgs.h    |  122 +-
 .../device/libraries/BSTest/src/BSProtocol.h  |   33 +-
 tests/device/libraries/BSTest/src/BSStdio.h   |    9 +-
 tests/device/libraries/BSTest/src/BSTest.h    |   48 +-
 tests/device/libraries/BSTest/test/test.cpp   |   10 +-
 tests/device/test_libc/libm_string.c          | 1031 +++++++++--------
 tests/device/test_libc/memcpy-1.c             |  230 ++--
 tests/device/test_libc/memmove1.c             |  256 ++--
 tests/device/test_libc/strcmp-1.c             |  388 ++++---
 tests/device/test_libc/tstring.c              |  542 ++++-----
 tests/host/common/Arduino.cpp                 |   41 +-
 tests/host/common/ArduinoCatch.cpp            |   24 +-
 tests/host/common/ArduinoMain.cpp             |  532 +++++----
 tests/host/common/ArduinoMainLittlefs.cpp     |   14 +-
 tests/host/common/ArduinoMainSpiffs.cpp       |   14 +-
 tests/host/common/ArduinoMainUdp.cpp          |   98 +-
 tests/host/common/ClientContextSocket.cpp     |  314 ++---
 tests/host/common/ClientContextTools.cpp      |   80 +-
 tests/host/common/EEPROM.h                    |  125 +-
 tests/host/common/HostWiring.cpp              |   92 +-
 tests/host/common/MockDigital.cpp             |   80 +-
 tests/host/common/MockEEPROM.cpp              |  114 +-
 tests/host/common/MockEsp.cpp                 |  227 ++--
 tests/host/common/MockSPI.cpp                 |   64 +-
 tests/host/common/MockTools.cpp               |  158 ++-
 tests/host/common/MockUART.cpp                |  896 +++++++-------
 tests/host/common/MockWiFiServer.cpp          |   82 +-
 tests/host/common/MockWiFiServerSocket.cpp    |  202 ++--
 tests/host/common/MocklwIP.cpp                |  102 +-
 tests/host/common/MocklwIP.h                  |    2 +-
 tests/host/common/UdpContextSocket.cpp        |  376 +++---
 tests/host/common/WMath.cpp                   |   69 +-
 tests/host/common/c_types.h                   |   47 +-
 tests/host/common/flash_hal_mock.cpp          |   15 +-
 tests/host/common/include/ClientContext.h     |  101 +-
 tests/host/common/include/UdpContext.h        |   13 +-
 tests/host/common/littlefs_mock.cpp           |   48 +-
 tests/host/common/littlefs_mock.h             |   39 +-
 tests/host/common/md5.c                       |  272 ++---
 tests/host/common/mock.h                      |  109 +-
 tests/host/common/noniso.c                    |   72 +-
 tests/host/common/pins_arduino.h              |   26 +-
 tests/host/common/queue.h                     |  261 ++---
 tests/host/common/sdfs_mock.cpp               |   20 +-
 tests/host/common/sdfs_mock.h                 |   35 +-
 tests/host/common/spiffs_mock.cpp             |   48 +-
 tests/host/common/spiffs_mock.h               |   33 +-
 tests/host/common/user_interface.cpp          |   20 +-
 tests/host/core/test_PolledTimeout.cpp        |  312 ++---
 tests/host/core/test_Print.cpp                |   22 +-
 tests/host/core/test_Updater.cpp              |   22 +-
 tests/host/core/test_md5builder.cpp           |   53 +-
 tests/host/core/test_pgmspace.cpp             |   27 +-
 tests/host/core/test_string.cpp               |  554 ++++-----
 tests/host/fs/test_fs.cpp                     |   35 +-
 tests/host/sys/pgmspace.h                     |   40 +-
 tests/restyle.sh                              |    1 +
 58 files changed, 4555 insertions(+), 4069 deletions(-)

diff --git a/tests/device/libraries/BSTest/src/BSArduino.h b/tests/device/libraries/BSTest/src/BSArduino.h
index 2fd4dc66e0..b9483244a0 100644
--- a/tests/device/libraries/BSTest/src/BSArduino.h
+++ b/tests/device/libraries/BSTest/src/BSArduino.h
@@ -19,9 +19,11 @@ class ArduinoIOHelper
         char* buffer = temp;
         size_t len = vsnprintf(temp, sizeof(temp), format, arg);
         va_end(arg);
-        if (len > sizeof(temp) - 1) {
+        if (len > sizeof(temp) - 1)
+        {
             buffer = new char[len + 1];
-            if (!buffer) {
+            if (!buffer)
+            {
                 return 0;
             }
             va_start(arg, format);
@@ -29,7 +31,8 @@ class ArduinoIOHelper
             va_end(arg);
         }
         len = m_stream.write((const uint8_t*) buffer, len);
-        if (buffer != temp) {
+        if (buffer != temp)
+        {
             delete[] buffer;
         }
         return len;
@@ -40,16 +43,20 @@ class ArduinoIOHelper
         size_t len = 0;
         // Can't use Stream::readBytesUntil here because it can't tell the
         // difference between timing out and receiving the terminator.
-        while (len < dest_size - 1) {
+        while (len < dest_size - 1)
+        {
             int c = m_stream.read();
-            if (c < 0) {
+            if (c < 0)
+            {
                 delay(1);
                 continue;
             }
-            if (c == '\r') {
+            if (c == '\r')
+            {
                 continue;
             }
-            if (c == '\n') {
+            if (c == '\n')
+            {
                 dest[len] = 0;
                 break;
             }
@@ -64,7 +71,8 @@ class ArduinoIOHelper
 
 typedef ArduinoIOHelper IOHelper;
 
-inline void fatal() {
+inline void fatal()
+{
     ESP.restart();
 }
 
diff --git a/tests/device/libraries/BSTest/src/BSArgs.h b/tests/device/libraries/BSTest/src/BSArgs.h
index 060bcdf18c..ba970f60bc 100644
--- a/tests/device/libraries/BSTest/src/BSArgs.h
+++ b/tests/device/libraries/BSTest/src/BSArgs.h
@@ -1,8 +1,8 @@
-/* Splitting string into tokens, taking quotes and escape sequences into account.
- * From https://github.com/espressif/esp-idf/blob/master/components/console/split_argv.c
- * Copyright 2016-2017 Espressif Systems (Shanghai) PTE LTD
- * Licensed under the Apache License 2.0.
- */
+/*  Splitting string into tokens, taking quotes and escape sequences into account.
+    From https://github.com/espressif/esp-idf/blob/master/components/console/split_argv.c
+    Copyright 2016-2017 Espressif Systems (Shanghai) PTE LTD
+    Licensed under the Apache License 2.0.
+*/
 
 #ifndef BS_ARGS_H
 #define BS_ARGS_H
@@ -18,7 +18,8 @@ namespace protocol
 
 #define SS_FLAG_ESCAPE 0x8
 
-typedef enum {
+typedef enum
+{
     /* parsing the space between arguments */
     SS_SPACE = 0x0,
     /* parsing an argument which isn't quoted */
@@ -40,29 +41,29 @@ typedef enum {
 
 
 /**
- * @brief Split command line into arguments in place
- *
- * - This function finds whitespace-separated arguments in the given input line.
- *
- *     'abc def 1 20 .3' -> [ 'abc', 'def', '1', '20', '.3' ]
- *
- * - Argument which include spaces may be surrounded with quotes. In this case
- *   spaces are preserved and quotes are stripped.
- *
- *     'abc "123 456" def' -> [ 'abc', '123 456', 'def' ]
- *
- * - Escape sequences may be used to produce backslash, double quote, and space:
- *
- *     'a\ b\\c\"' -> [ 'a b\c"' ]
- *
- * Pointers to at most argv_size - 1 arguments are returned in argv array.
- * The pointer after the last one (i.e. argv[argc]) is set to NULL.
- *
- * @param line pointer to buffer to parse; it is modified in place
- * @param argv array where the pointers to arguments are written
- * @param argv_size number of elements in argv_array (max. number of arguments will be argv_size - 1)
- * @return number of arguments found (argc)
- */
+    @brief Split command line into arguments in place
+
+    - This function finds whitespace-separated arguments in the given input line.
+
+       'abc def 1 20 .3' -> [ 'abc', 'def', '1', '20', '.3' ]
+
+    - Argument which include spaces may be surrounded with quotes. In this case
+     spaces are preserved and quotes are stripped.
+
+       'abc "123 456" def' -> [ 'abc', '123 456', 'def' ]
+
+    - Escape sequences may be used to produce backslash, double quote, and space:
+
+       'a\ b\\c\"' -> [ 'a b\c"' ]
+
+    Pointers to at most argv_size - 1 arguments are returned in argv array.
+    The pointer after the last one (i.e. argv[argc]) is set to NULL.
+
+    @param line pointer to buffer to parse; it is modified in place
+    @param argv array where the pointers to arguments are written
+    @param argv_size number of elements in argv_array (max. number of arguments will be argv_size - 1)
+    @return number of arguments found (argc)
+*/
 inline size_t split_args(char *line, char **argv, size_t argv_size)
 {
     const int QUOTE = '"';
@@ -72,24 +73,34 @@ inline size_t split_args(char *line, char **argv, size_t argv_size)
     size_t argc = 0;
     char *next_arg_start = line;
     char *out_ptr = line;
-    for (char *in_ptr = line; argc < argv_size - 1; ++in_ptr) {
-        int char_in = (unsigned char) *in_ptr;
-        if (char_in == 0) {
+    for (char *in_ptr = line; argc < argv_size - 1; ++in_ptr)
+    {
+        int char_in = (unsigned char) * in_ptr;
+        if (char_in == 0)
+        {
             break;
         }
         int char_out = -1;
 
-        switch (state) {
+        switch (state)
+        {
         case SS_SPACE:
-            if (char_in == SPACE) {
+            if (char_in == SPACE)
+            {
                 /* skip space */
-            } else if (char_in == QUOTE) {
+            }
+            else if (char_in == QUOTE)
+            {
                 next_arg_start = out_ptr;
                 state = SS_QUOTED_ARG;
-            } else if (char_in == ESCAPE) {
+            }
+            else if (char_in == ESCAPE)
+            {
                 next_arg_start = out_ptr;
                 state = SS_ARG_ESCAPED;
-            } else {
+            }
+            else
+            {
                 next_arg_start = out_ptr;
                 state = SS_ARG;
                 char_out = char_in;
@@ -97,37 +108,51 @@ inline size_t split_args(char *line, char **argv, size_t argv_size)
             break;
 
         case SS_QUOTED_ARG:
-            if (char_in == QUOTE) {
+            if (char_in == QUOTE)
+            {
                 END_ARG();
-            } else if (char_in == ESCAPE) {
+            }
+            else if (char_in == ESCAPE)
+            {
                 state = SS_QUOTED_ARG_ESCAPED;
-            } else {
+            }
+            else
+            {
                 char_out = char_in;
             }
             break;
 
         case SS_ARG_ESCAPED:
         case SS_QUOTED_ARG_ESCAPED:
-            if (char_in == ESCAPE || char_in == QUOTE || char_in == SPACE) {
+            if (char_in == ESCAPE || char_in == QUOTE || char_in == SPACE)
+            {
                 char_out = char_in;
-            } else {
+            }
+            else
+            {
                 /* unrecognized escape character, skip */
             }
-            state = (split_state_t) (state & (~SS_FLAG_ESCAPE));
+            state = (split_state_t)(state & (~SS_FLAG_ESCAPE));
             break;
 
         case SS_ARG:
-            if (char_in == SPACE) {
+            if (char_in == SPACE)
+            {
                 END_ARG();
-            } else if (char_in == ESCAPE) {
+            }
+            else if (char_in == ESCAPE)
+            {
                 state = SS_ARG_ESCAPED;
-            } else {
+            }
+            else
+            {
                 char_out = char_in;
             }
             break;
         }
         /* need to output anything? */
-        if (char_out >= 0) {
+        if (char_out >= 0)
+        {
             *out_ptr = char_out;
             ++out_ptr;
         }
@@ -135,7 +160,8 @@ inline size_t split_args(char *line, char **argv, size_t argv_size)
     /* make sure the final argument is terminated */
     *out_ptr = 0;
     /* finalize the last argument */
-    if (state != SS_SPACE && argc < argv_size - 1) {
+    if (state != SS_SPACE && argc < argv_size - 1)
+    {
         argv[argc++] = next_arg_start;
     }
     /* add a NULL at the end of argv */
diff --git a/tests/device/libraries/BSTest/src/BSProtocol.h b/tests/device/libraries/BSTest/src/BSProtocol.h
index 05a874f956..afb8bfb023 100644
--- a/tests/device/libraries/BSTest/src/BSProtocol.h
+++ b/tests/device/libraries/BSTest/src/BSProtocol.h
@@ -24,7 +24,7 @@ void output_check_failure(IO& io, size_t line)
 }
 
 template<typename IO>
-void output_test_end(IO& io, bool success, size_t checks, size_t failed_checks, size_t line=0)
+void output_test_end(IO& io, bool success, size_t checks, size_t failed_checks, size_t line = 0)
 {
     io.printf(BS_LINE_PREFIX "end line=%d result=%d checks=%d failed_checks=%d\n", line, success, checks, failed_checks);
 }
@@ -63,23 +63,27 @@ void output_getenv_result(IO& io, const char* key, const char* value)
 template<typename IO>
 void output_pretest_result(IO& io, bool res)
 {
-    io.printf(BS_LINE_PREFIX "pretest result=%d\n", res?1:0);
+    io.printf(BS_LINE_PREFIX "pretest result=%d\n", res ? 1 : 0);
 }
 
 template<typename IO>
 bool input_handle(IO& io, char* line_buf, size_t line_buf_size, int& test_num)
 {
     int cb_read = io.read_line(line_buf, line_buf_size);
-    if (cb_read == 0 || line_buf[0] == '\n') {
+    if (cb_read == 0 || line_buf[0] == '\n')
+    {
         return false;
     }
     char* argv[4];
-    size_t argc = split_args(line_buf, argv, sizeof(argv)/sizeof(argv[0]));
-    if (argc == 0) {
+    size_t argc = split_args(line_buf, argv, sizeof(argv) / sizeof(argv[0]));
+    if (argc == 0)
+    {
         return false;
     }
-    if (strcmp(argv[0], "setenv") == 0) {
-        if (argc != 3) {
+    if (strcmp(argv[0], "setenv") == 0)
+    {
+        if (argc != 3)
+        {
             return false;
         }
         setenv(argv[1], argv[2], 1);
@@ -87,16 +91,20 @@ bool input_handle(IO& io, char* line_buf, size_t line_buf_size, int& test_num)
         test_num = -1;
         return false;   /* we didn't get the test number yet, so return false */
     }
-    if (strcmp(argv[0], "getenv") == 0) {
-        if (argc != 2) {
+    if (strcmp(argv[0], "getenv") == 0)
+    {
+        if (argc != 2)
+        {
             return false;
         }
         const char* value = getenv(argv[1]);
         output_getenv_result(io, argv[1], (value != NULL) ? value : "");
         return false;
     }
-    if (strcmp(argv[0], "pretest") == 0) {
-        if (argc != 1) {
+    if (strcmp(argv[0], "pretest") == 0)
+    {
+        if (argc != 1)
+        {
             return false;
         }
         bool res = ::pretest();
@@ -106,7 +114,8 @@ bool input_handle(IO& io, char* line_buf, size_t line_buf_size, int& test_num)
     /* not one of the commands, try to parse as test number */
     char* endptr;
     test_num = (int) strtol(argv[0], &endptr, 10);
-    if (endptr != argv[0] + strlen(argv[0])) {
+    if (endptr != argv[0] + strlen(argv[0]))
+    {
         return false;
     }
     return true;
diff --git a/tests/device/libraries/BSTest/src/BSStdio.h b/tests/device/libraries/BSTest/src/BSStdio.h
index 4d1bfb56f0..f804f9750b 100644
--- a/tests/device/libraries/BSTest/src/BSStdio.h
+++ b/tests/device/libraries/BSTest/src/BSStdio.h
@@ -25,11 +25,13 @@ class StdIOHelper
     size_t read_line(char* dest, size_t dest_size)
     {
         char* res = fgets(dest, dest_size, stdin);
-        if (res == NULL) {
+        if (res == NULL)
+        {
             return 0;
         }
         size_t len = strlen(dest);
-        if (dest[len - 1] == '\n') {
+        if (dest[len - 1] == '\n')
+        {
             dest[len - 1] = 0;
             len--;
         }
@@ -39,7 +41,8 @@ class StdIOHelper
 
 typedef StdIOHelper IOHelper;
 
-inline void fatal() {
+inline void fatal()
+{
     throw std::runtime_error("fatal error");
 }
 
diff --git a/tests/device/libraries/BSTest/src/BSTest.h b/tests/device/libraries/BSTest/src/BSTest.h
index 11b4ee9f6e..6de198cb0c 100644
--- a/tests/device/libraries/BSTest/src/BSTest.h
+++ b/tests/device/libraries/BSTest/src/BSTest.h
@@ -28,7 +28,8 @@ class TestCase
     TestCase(TestCase* prev, test_case_func_t func, const char* file, size_t line, const char* name, const char* desc)
         : m_func(func), m_file(file), m_line(line), m_name(name), m_desc(desc)
     {
-        if (prev) {
+        if (prev)
+        {
             prev->m_next = this;
         }
     }
@@ -60,7 +61,7 @@ class TestCase
 
     const char* desc() const
     {
-        return (m_desc)?m_desc:"";
+        return (m_desc) ? m_desc : "";
     }
 
 protected:
@@ -72,11 +73,13 @@ class TestCase
     const char* m_desc;
 };
 
-struct Registry {
+struct Registry
+{
     void add(test_case_func_t func, const char* file, size_t line, const char* name, const char* desc)
     {
         TestCase* tc = new TestCase(m_last, func, file, line, name, desc);
-        if (!m_first) {
+        if (!m_first)
+        {
             m_first = tc;
         }
         m_last = tc;
@@ -85,7 +88,8 @@ struct Registry {
     TestCase* m_last = nullptr;
 };
 
-struct Env {
+struct Env
+{
     std::function<void(void)> m_check_pass;
     std::function<void(size_t)> m_check_fail;
     std::function<void(size_t)> m_fail;
@@ -115,8 +119,9 @@ class Runner
 
     void run()
     {
-        do {
-        } while(do_menu());
+        do
+        {
+        } while (do_menu());
     }
 
     void check_pass()
@@ -141,22 +146,27 @@ class Runner
     {
         protocol::output_menu_begin(m_io);
         int id = 1;
-        for (TestCase* tc = g_env.m_registry.m_first; tc; tc = tc->next(), ++id) {
+        for (TestCase* tc = g_env.m_registry.m_first; tc; tc = tc->next(), ++id)
+        {
             protocol::output_menu_item(m_io, id, tc->name(), tc->desc());
         }
         protocol::output_menu_end(m_io);
-        while(true) {
+        while (true)
+        {
             int id;
             char line_buf[BS_LINE_BUF_SIZE];
-            if (!protocol::input_handle(m_io, line_buf, sizeof(line_buf), id)) {
+            if (!protocol::input_handle(m_io, line_buf, sizeof(line_buf), id))
+            {
                 continue;
             }
-            if (id < 0) {
+            if (id < 0)
+            {
                 return true;
             }
             TestCase* tc = g_env.m_registry.m_first;
             for (int i = 0; i != id - 1 && tc; ++i, tc = tc->next());
-            if (!tc) {
+            if (!tc)
+            {
                 bs::fatal();
             }
             m_check_pass_count = 0;
@@ -185,19 +195,25 @@ class AutoReg
 
 inline void check(bool condition, size_t line)
 {
-    if (!condition) {
+    if (!condition)
+    {
         g_env.m_check_fail(line);
-    } else {
+    }
+    else
+    {
         g_env.m_check_pass();
     }
 }
 
 inline void require(bool condition, size_t line)
 {
-    if (!condition) {
+    if (!condition)
+    {
         g_env.m_check_fail(line);
         g_env.m_fail(line);
-    } else {
+    }
+    else
+    {
         g_env.m_check_pass();
     }
 }
diff --git a/tests/device/libraries/BSTest/test/test.cpp b/tests/device/libraries/BSTest/test/test.cpp
index 863373e0de..25145344fb 100644
--- a/tests/device/libraries/BSTest/test/test.cpp
+++ b/tests/device/libraries/BSTest/test/test.cpp
@@ -6,11 +6,15 @@ BS_ENV_DECLARE();
 
 int main()
 {
-    while(true) {
-        try{
+    while (true)
+    {
+        try
+        {
             BS_RUN();
             return 0;
-        }catch(...) {
+        }
+        catch (...)
+        {
             printf("Exception\n\n");
         }
     }
diff --git a/tests/device/test_libc/libm_string.c b/tests/device/test_libc/libm_string.c
index 17f29098cd..715f7973b2 100644
--- a/tests/device/test_libc/libm_string.c
+++ b/tests/device/test_libc/libm_string.c
@@ -26,19 +26,19 @@ static int  errors = 0;
 #define check(thing) checkit(thing, __LINE__)
 
 static void
-_DEFUN(checkit,(ok,l),
+_DEFUN(checkit, (ok, l),
        int ok _AND
-       int l )
+       int l)
 
 {
-//  newfunc(it);
-//  line(l);
-  
-  if (!ok)
-  {
-    printf("string.c:%d %s\n", l, it);
-    ++errors;
-  }
+    //  newfunc(it);
+    //  line(l);
+
+    if (!ok)
+    {
+        printf("string.c:%d %s\n", l, it);
+        ++errors;
+    }
 }
 
 
@@ -47,17 +47,21 @@ _DEFUN(checkit,(ok,l),
 #define equal(a, b)  funcqual(a,b,__LINE__);
 
 static void
-_DEFUN(funcqual,(a,b,l),
+_DEFUN(funcqual, (a, b, l),
        char *a _AND
        char *b _AND
        int l)
 {
-//  newfunc(it);
-  
-//  line(l);
-  if (a == NULL && b == NULL) return;
-  if (strcmp(a,b)) {
-      printf("string.c:%d (%s)\n", l, it);  
+    //  newfunc(it);
+
+    //  line(l);
+    if (a == NULL && b == NULL)
+    {
+        return;
+    }
+    if (strcmp(a, b))
+    {
+        printf("string.c:%d (%s)\n", l, it);
     }
 }
 
@@ -69,507 +73,510 @@ static char two[50];
 
 void libm_test_string()
 {
-  /* Test strcmp first because we use it to test other things.  */
-  it = "strcmp";
-  check(strcmp("", "") == 0); /* Trivial case. */
-  check(strcmp("a", "a") == 0); /* Identity. */
-  check(strcmp("abc", "abc") == 0); /* Multicharacter. */
-  check(strcmp("abc", "abcd") < 0); /* Length mismatches. */
-  check(strcmp("abcd", "abc") > 0);
-  check(strcmp("abcd", "abce") < 0);	/* Honest miscompares. */
-  check(strcmp("abce", "abcd") > 0);
-  check(strcmp("a\103", "a") > 0); /* Tricky if char signed. */
-  check(strcmp("a\103", "a\003") > 0);
-
-  /* Test strcpy next because we need it to set up other tests.  */
-  it = "strcpy";
-  check(strcpy(one, "abcd") == one);	/* Returned value. */
-  equal(one, "abcd");	/* Basic test. */
-
-  (void) strcpy(one, "x");
-  equal(one, "x");		/* Writeover. */
-  equal(one+2, "cd");	/* Wrote too much? */
-
-  (void) strcpy(two, "hi there");
-  (void) strcpy(one, two);
-  equal(one, "hi there");	/* Basic test encore. */
-  equal(two, "hi there");	/* Stomped on source? */
-
-  (void) strcpy(one, "");
-  equal(one, "");		/* Boundary condition. */
-
-  /* strcat.  */
-  it = "strcat";
-  (void) strcpy(one, "ijk");
-  check(strcat(one, "lmn") == one); /* Returned value. */
-  equal(one, "ijklmn");	/* Basic test. */
-
-  (void) strcpy(one, "x");
-  (void) strcat(one, "yz");
-  equal(one, "xyz");		/* Writeover. */
-  equal(one+4, "mn");	/* Wrote too much? */
-
-  (void) strcpy(one, "gh");
-  (void) strcpy(two, "ef");
-  (void) strcat(one, two);
-  equal(one, "ghef");	/* Basic test encore. */
-  equal(two, "ef");		/* Stomped on source? */
-
-  (void) strcpy(one, "");
-  (void) strcat(one, "");
-  equal(one, "");		/* Boundary conditions. */
-  (void) strcpy(one, "ab");
-  (void) strcat(one, "");
-  equal(one, "ab");
-  (void) strcpy(one, "");
-  (void) strcat(one, "cd");
-  equal(one, "cd");
-
-  /* strncat - first test it as strcat, with big counts,
-     then test the count mechanism.  */
-  it = "strncat";
-  (void) strcpy(one, "ijk");
-  check(strncat(one, "lmn", 99) == one); /* Returned value. */
-  equal(one, "ijklmn");	/* Basic test. */
-
-  (void) strcpy(one, "x");
-  (void) strncat(one, "yz", 99);
-  equal(one, "xyz");		/* Writeover. */
-  equal(one+4, "mn");	/* Wrote too much? */
-
-  (void) strcpy(one, "gh");
-  (void) strcpy(two, "ef");
-  (void) strncat(one, two, 99);
-  equal(one, "ghef");	/* Basic test encore. */
-  equal(two, "ef");		/* Stomped on source? */
-
-  (void) strcpy(one, "");
-  (void) strncat(one, "", 99);
-  equal(one, "");		/* Boundary conditions. */
-  (void) strcpy(one, "ab");
-  (void) strncat(one, "", 99);
-  equal(one, "ab");
-  (void) strcpy(one, "");
-  (void) strncat(one, "cd", 99);
-  equal(one, "cd");
-
-  (void) strcpy(one, "ab");
-  (void) strncat(one, "cdef", 2);
-  equal(one, "abcd");	/* Count-limited. */
-
-  (void) strncat(one, "gh", 0);
-  equal(one, "abcd");	/* Zero count. */
-
-  (void) strncat(one, "gh", 2);
-  equal(one, "abcdgh");	/* Count _AND length equal. */
-  it = "strncmp";
-  /* strncmp - first test as strcmp with big counts";*/
-  check(strncmp("", "", 99) == 0); /* Trivial case. */
-  check(strncmp("a", "a", 99) == 0);	/* Identity. */
-  check(strncmp("abc", "abc", 99) == 0); /* Multicharacter. */
-  check(strncmp("abc", "abcd", 99) < 0); /* Length unequal. */
-  check(strncmp("abcd", "abc",99) > 0);
-  check(strncmp("abcd", "abce", 99) < 0); /* Honestly unequal. */
-  check(strncmp("abce", "abcd",99)>0);
-  check(strncmp("abce", "abcd", 3) == 0); /* Count limited. */
-  check(strncmp("abce", "abc", 3) == 0); /* Count == length. */
-  check(strncmp("abcd", "abce", 4) < 0); /* Nudging limit. */
-  check(strncmp("abc", "def", 0) == 0); /* Zero count. */
-
-  /* strncpy - testing is a bit different because of odd semantics.  */
-  it = "strncpy";
-  check(strncpy(one, "abc", 4) == one); /* Returned value. */
-  equal(one, "abc");		/* Did the copy go right? */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) strncpy(one, "xyz", 2);
-  equal(one, "xycdefgh");	/* Copy cut by count. */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) strncpy(one, "xyz", 3); /* Copy cut just before NUL. */
-  equal(one, "xyzdefgh");
-
-  (void) strcpy(one, "abcdefgh");
-  (void) strncpy(one, "xyz", 4); /* Copy just includes NUL. */
-  equal(one, "xyz");
-  equal(one+4, "efgh");	/* Wrote too much? */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) strncpy(one, "xyz", 5); /* Copy includes padding. */
-  equal(one, "xyz");
-  equal(one+4, "");
-  equal(one+5, "fgh");
-
-  (void) strcpy(one, "abc");
-  (void) strncpy(one, "xyz", 0); /* Zero-length copy. */
-  equal(one, "abc");	
-
-  (void) strncpy(one, "", 2);	/* Zero-length source. */
-  equal(one, "");
-  equal(one+1, "");	
-  equal(one+2, "c");
-
-  (void) strcpy(one, "hi there");
-  (void) strncpy(two, one, 9);
-  equal(two, "hi there");	/* Just paranoia. */
-  equal(one, "hi there");	/* Stomped on source? */
-
-  /* strlen.  */
-  it = "strlen";
-  check(strlen("") == 0);	/* Empty. */
-  check(strlen("a") == 1);	/* Single char. */
-  check(strlen("abcd") == 4); /* Multiple chars. */
-
-  /* strchr.  */
-  it = "strchr";
-  check(strchr("abcd", 'z') == NULL); /* Not found. */
-  (void) strcpy(one, "abcd");
-  check(strchr(one, 'c') == one+2); /* Basic test. */
-  check(strchr(one, 'd') == one+3); /* End of string. */
-  check(strchr(one, 'a') == one); /* Beginning. */
-  check(strchr(one, '\0') == one+4);	/* Finding NUL. */
-  (void) strcpy(one, "ababa");
-  check(strchr(one, 'b') == one+1); /* Finding first. */
-  (void) strcpy(one, "");
-  check(strchr(one, 'b') == NULL); /* Empty string. */
-  check(strchr(one, '\0') == one); /* NUL in empty string. */
-
-  /* index - just like strchr.  */
-  it = "index";
-  check(index("abcd", 'z') == NULL);	/* Not found. */
-  (void) strcpy(one, "abcd");
-  check(index(one, 'c') == one+2); /* Basic test. */
-  check(index(one, 'd') == one+3); /* End of string. */
-  check(index(one, 'a') == one); /* Beginning. */
-  check(index(one, '\0') == one+4); /* Finding NUL. */
-  (void) strcpy(one, "ababa");
-  check(index(one, 'b') == one+1); /* Finding first. */
-  (void) strcpy(one, "");
-  check(index(one, 'b') == NULL); /* Empty string. */
-  check(index(one, '\0') == one); /* NUL in empty string. */
-
-  /* strrchr.  */
-  it = "strrchr";
-  check(strrchr("abcd", 'z') == NULL); /* Not found. */
-  (void) strcpy(one, "abcd");
-  check(strrchr(one, 'c') == one+2);	/* Basic test. */
-  check(strrchr(one, 'd') == one+3);	/* End of string. */
-  check(strrchr(one, 'a') == one); /* Beginning. */
-  check(strrchr(one, '\0') == one+4); /* Finding NUL. */
-  (void) strcpy(one, "ababa");
-  check(strrchr(one, 'b') == one+3);	/* Finding last. */
-  (void) strcpy(one, "");
-  check(strrchr(one, 'b') == NULL); /* Empty string. */
-  check(strrchr(one, '\0') == one); /* NUL in empty string. */
-
-  /* rindex - just like strrchr.  */
-  it = "rindex";
-  check(rindex("abcd", 'z') == NULL); /* Not found. */
-  (void) strcpy(one, "abcd");
-  check(rindex(one, 'c') == one+2); /* Basic test. */
-  check(rindex(one, 'd') == one+3); /* End of string. */
-  check(rindex(one, 'a') == one); /* Beginning. */
-  check(rindex(one, '\0') == one+4);	/* Finding NUL. */
-  (void) strcpy(one, "ababa");
-  check(rindex(one, 'b') == one+3); /* Finding last. */
-  (void) strcpy(one, "");
-  check(rindex(one, 'b') == NULL); /* Empty string. */
-  check(rindex(one, '\0') == one); /* NUL in empty string. */
-
-  /* strpbrk - somewhat like strchr.  */
-  it = "strpbrk";
-  check(strpbrk("abcd", "z") == NULL); /* Not found. */
-  (void) strcpy(one, "abcd");
-  check(strpbrk(one, "c") == one+2);	/* Basic test. */
-  check(strpbrk(one, "d") == one+3);	/* End of string. */
-  check(strpbrk(one, "a") == one); /* Beginning. */
-  check(strpbrk(one, "") == NULL); /* Empty search list. */
-  check(strpbrk(one, "cb") == one+1); /* Multiple search. */
-  (void) strcpy(one, "abcabdea");
-  check(strpbrk(one, "b") == one+1);	/* Finding first. */
-  check(strpbrk(one, "cb") == one+1); /* With multiple search. */
-  check(strpbrk(one, "db") == one+1); /* Another variant. */
-  (void) strcpy(one, "");
-  check(strpbrk(one, "bc") == NULL); /* Empty string. */
-  check(strpbrk(one, "") == NULL); /* Both strings empty. */
-
-  /* strstr - somewhat like strchr.  */
-  it = "strstr";
-  check(strstr("z", "abcd") == NULL); /* Not found. */
-  check(strstr("abx", "abcd") == NULL); /* Dead end. */
-  (void) strcpy(one, "abcd");
-  check(strstr(one,"c") == one+2); /* Basic test. */
-  check(strstr(one, "bc") == one+1);	/* Multichar. */
-  check(strstr(one,"d") == one+3); /* End of string. */
-  check(strstr(one,"cd") == one+2);	/* Tail of string. */
-  check(strstr(one,"abc") == one); /* Beginning. */
-  check(strstr(one,"abcd") == one);	/* Exact match. */
-  check(strstr(one,"de") == NULL);	/* Past end. */
-  check(strstr(one,"") == one); /* Finding empty. */
-  (void) strcpy(one, "ababa");
-  check(strstr(one,"ba") == one+1); /* Finding first. */
-  (void) strcpy(one, "");
-  check(strstr(one, "b") == NULL); /* Empty string. */
-  check(strstr(one,"") == one); /* Empty in empty string. */
-  (void) strcpy(one, "bcbca");
-  check(strstr(one,"bca") == one+2); /* False start. */
-  (void) strcpy(one, "bbbcabbca");
-  check(strstr(one,"bbca") == one+1); /* With overlap. */
-
-  /* strspn.  */
-  it = "strspn";
-  check(strspn("abcba", "abc") == 5); /* Whole string. */
-  check(strspn("abcba", "ab") == 2);	/* Partial. */
-  check(strspn("abc", "qx") == 0); /* None. */
-  check(strspn("", "ab") == 0); /* Null string. */
-  check(strspn("abc", "") == 0); /* Null search list. */
-
-  /* strcspn.  */
-  it = "strcspn";
-  check(strcspn("abcba", "qx") == 5); /* Whole string. */
-  check(strcspn("abcba", "cx") == 2); /* Partial. */
-  check(strcspn("abc", "abc") == 0);	/* None. */
-  check(strcspn("", "ab") == 0); /* Null string. */
-  check(strcspn("abc", "") == 3); /* Null search list. */
-
-  /* strtok - the hard one.  */
-  it = "strtok";
-  (void) strcpy(one, "first, second, third");
-  equal(strtok(one, ", "), "first");	/* Basic test. */
-  equal(one, "first");
-  equal(strtok((char *)NULL, ", "), "second");
-  equal(strtok((char *)NULL, ", "), "third");
-  check(strtok((char *)NULL, ", ") == NULL);
-  (void) strcpy(one, ", first, ");
-  equal(strtok(one, ", "), "first");	/* Extra delims, 1 tok. */
-  check(strtok((char *)NULL, ", ") == NULL);
-  (void) strcpy(one, "1a, 1b; 2a, 2b");
-  equal(strtok(one, ", "), "1a"); /* Changing delim lists. */
-  equal(strtok((char *)NULL, "; "), "1b");
-  equal(strtok((char *)NULL, ", "), "2a");
-  (void) strcpy(two, "x-y");
-  equal(strtok(two, "-"), "x"); /* New string before done. */
-  equal(strtok((char *)NULL, "-"), "y");
-  check(strtok((char *)NULL, "-") == NULL);
-  (void) strcpy(one, "a,b, c,, ,d");
-  equal(strtok(one, ", "), "a"); /* Different separators. */
-  equal(strtok((char *)NULL, ", "), "b");
-  equal(strtok((char *)NULL, " ,"), "c"); /* Permute list too. */
-  equal(strtok((char *)NULL, " ,"), "d");
-  check(strtok((char *)NULL, ", ") == NULL);
-  check(strtok((char *)NULL, ", ") == NULL); /* Persistence. */
-  (void) strcpy(one, ", ");
-  check(strtok(one, ", ") == NULL);	/* No tokens. */
-  (void) strcpy(one, "");
-  check(strtok(one, ", ") == NULL);	/* Empty string. */
-  (void) strcpy(one, "abc");
-  equal(strtok(one, ", "), "abc"); /* No delimiters. */
-  check(strtok((char *)NULL, ", ") == NULL);
-  (void) strcpy(one, "abc");
-  equal(strtok(one, ""), "abc"); /* Empty delimiter list. */
-  check(strtok((char *)NULL, "") == NULL);
-  (void) strcpy(one, "abcdefgh");
-  (void) strcpy(one, "a,b,c");
-  equal(strtok(one, ","), "a"); /* Basics again... */
-  equal(strtok((char *)NULL, ","), "b");
-  equal(strtok((char *)NULL, ","), "c");
-  check(strtok((char *)NULL, ",") == NULL);
-  equal(one+6, "gh");	/* Stomped past end? */
-  equal(one, "a");		/* Stomped old tokens? */
-  equal(one+2, "b");
-  equal(one+4, "c");
-
-  /* memcmp.  */
-  it = "memcmp";
-  check(memcmp("a", "a", 1) == 0); /* Identity. */
-  check(memcmp("abc", "abc", 3) == 0); /* Multicharacter. */
-  check(memcmp("abcd", "abce", 4) < 0); /* Honestly unequal. */
-  check(memcmp("abce", "abcd",4));
-  check(memcmp("alph", "beta", 4) < 0);
-  check(memcmp("abce", "abcd", 3) == 0); /* Count limited. */
-  check(memcmp("abc", "def", 0) == 0); /* Zero count. */
-
-  /* memcmp should test strings as unsigned */
-  one[0] = 0xfe;
-  two[0] = 0x03;
-  check(memcmp(one, two,1) > 0);
-  
-  
-  /* memchr.  */
-  it = "memchr";
-  check(memchr("abcd", 'z', 4) == NULL); /* Not found. */
-  (void) strcpy(one, "abcd");
-  check(memchr(one, 'c', 4) == one+2); /* Basic test. */
-  check(memchr(one, 'd', 4) == one+3); /* End of string. */
-  check(memchr(one, 'a', 4) == one);	/* Beginning. */
-  check(memchr(one, '\0', 5) == one+4); /* Finding NUL. */
-  (void) strcpy(one, "ababa");
-  check(memchr(one, 'b', 5) == one+1); /* Finding first. */
-  check(memchr(one, 'b', 0) == NULL); /* Zero count. */
-  check(memchr(one, 'a', 1) == one);	/* Singleton case. */
-  (void) strcpy(one, "a\203b");
-  check(memchr(one, 0203, 3) == one+1); /* Unsignedness. */
-
-  /* memcpy - need not work for overlap.  */
-  it = "memcpy";
-  check(memcpy(one, "abc", 4) == one); /* Returned value. */
-  equal(one, "abc");		/* Did the copy go right? */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) memcpy(one+1, "xyz", 2);
-  equal(one, "axydefgh");	/* Basic test. */
-
-  (void) strcpy(one, "abc");
-  (void) memcpy(one, "xyz", 0);
-  equal(one, "abc");		/* Zero-length copy. */
-
-  (void) strcpy(one, "hi there");
-  (void) strcpy(two, "foo");
-  (void) memcpy(two, one, 9);
-  equal(two, "hi there");	/* Just paranoia. */
-  equal(one, "hi there");	/* Stomped on source? */
+    /* Test strcmp first because we use it to test other things.  */
+    it = "strcmp";
+    check(strcmp("", "") == 0); /* Trivial case. */
+    check(strcmp("a", "a") == 0); /* Identity. */
+    check(strcmp("abc", "abc") == 0); /* Multicharacter. */
+    check(strcmp("abc", "abcd") < 0); /* Length mismatches. */
+    check(strcmp("abcd", "abc") > 0);
+    check(strcmp("abcd", "abce") < 0);	/* Honest miscompares. */
+    check(strcmp("abce", "abcd") > 0);
+    check(strcmp("a\103", "a") > 0); /* Tricky if char signed. */
+    check(strcmp("a\103", "a\003") > 0);
+
+    /* Test strcpy next because we need it to set up other tests.  */
+    it = "strcpy";
+    check(strcpy(one, "abcd") == one);	/* Returned value. */
+    equal(one, "abcd");	/* Basic test. */
+
+    (void) strcpy(one, "x");
+    equal(one, "x");		/* Writeover. */
+    equal(one + 2, "cd");	/* Wrote too much? */
+
+    (void) strcpy(two, "hi there");
+    (void) strcpy(one, two);
+    equal(one, "hi there");	/* Basic test encore. */
+    equal(two, "hi there");	/* Stomped on source? */
+
+    (void) strcpy(one, "");
+    equal(one, "");		/* Boundary condition. */
+
+    /* strcat.  */
+    it = "strcat";
+    (void) strcpy(one, "ijk");
+    check(strcat(one, "lmn") == one); /* Returned value. */
+    equal(one, "ijklmn");	/* Basic test. */
+
+    (void) strcpy(one, "x");
+    (void) strcat(one, "yz");
+    equal(one, "xyz");		/* Writeover. */
+    equal(one + 4, "mn");	/* Wrote too much? */
+
+    (void) strcpy(one, "gh");
+    (void) strcpy(two, "ef");
+    (void) strcat(one, two);
+    equal(one, "ghef");	/* Basic test encore. */
+    equal(two, "ef");		/* Stomped on source? */
+
+    (void) strcpy(one, "");
+    (void) strcat(one, "");
+    equal(one, "");		/* Boundary conditions. */
+    (void) strcpy(one, "ab");
+    (void) strcat(one, "");
+    equal(one, "ab");
+    (void) strcpy(one, "");
+    (void) strcat(one, "cd");
+    equal(one, "cd");
+
+    /*  strncat - first test it as strcat, with big counts,
+        then test the count mechanism.  */
+    it = "strncat";
+    (void) strcpy(one, "ijk");
+    check(strncat(one, "lmn", 99) == one); /* Returned value. */
+    equal(one, "ijklmn");	/* Basic test. */
+
+    (void) strcpy(one, "x");
+    (void) strncat(one, "yz", 99);
+    equal(one, "xyz");		/* Writeover. */
+    equal(one + 4, "mn");	/* Wrote too much? */
+
+    (void) strcpy(one, "gh");
+    (void) strcpy(two, "ef");
+    (void) strncat(one, two, 99);
+    equal(one, "ghef");	/* Basic test encore. */
+    equal(two, "ef");		/* Stomped on source? */
+
+    (void) strcpy(one, "");
+    (void) strncat(one, "", 99);
+    equal(one, "");		/* Boundary conditions. */
+    (void) strcpy(one, "ab");
+    (void) strncat(one, "", 99);
+    equal(one, "ab");
+    (void) strcpy(one, "");
+    (void) strncat(one, "cd", 99);
+    equal(one, "cd");
+
+    (void) strcpy(one, "ab");
+    (void) strncat(one, "cdef", 2);
+    equal(one, "abcd");	/* Count-limited. */
+
+    (void) strncat(one, "gh", 0);
+    equal(one, "abcd");	/* Zero count. */
+
+    (void) strncat(one, "gh", 2);
+    equal(one, "abcdgh");	/* Count _AND length equal. */
+    it = "strncmp";
+    /* strncmp - first test as strcmp with big counts";*/
+    check(strncmp("", "", 99) == 0); /* Trivial case. */
+    check(strncmp("a", "a", 99) == 0);	/* Identity. */
+    check(strncmp("abc", "abc", 99) == 0); /* Multicharacter. */
+    check(strncmp("abc", "abcd", 99) < 0); /* Length unequal. */
+    check(strncmp("abcd", "abc", 99) > 0);
+    check(strncmp("abcd", "abce", 99) < 0); /* Honestly unequal. */
+    check(strncmp("abce", "abcd", 99) > 0);
+    check(strncmp("abce", "abcd", 3) == 0); /* Count limited. */
+    check(strncmp("abce", "abc", 3) == 0); /* Count == length. */
+    check(strncmp("abcd", "abce", 4) < 0); /* Nudging limit. */
+    check(strncmp("abc", "def", 0) == 0); /* Zero count. */
+
+    /* strncpy - testing is a bit different because of odd semantics.  */
+    it = "strncpy";
+    check(strncpy(one, "abc", 4) == one); /* Returned value. */
+    equal(one, "abc");		/* Did the copy go right? */
+
+    (void) strcpy(one, "abcdefgh");
+    (void) strncpy(one, "xyz", 2);
+    equal(one, "xycdefgh");	/* Copy cut by count. */
+
+    (void) strcpy(one, "abcdefgh");
+    (void) strncpy(one, "xyz", 3); /* Copy cut just before NUL. */
+    equal(one, "xyzdefgh");
+
+    (void) strcpy(one, "abcdefgh");
+    (void) strncpy(one, "xyz", 4); /* Copy just includes NUL. */
+    equal(one, "xyz");
+    equal(one + 4, "efgh");	/* Wrote too much? */
+
+    (void) strcpy(one, "abcdefgh");
+    (void) strncpy(one, "xyz", 5); /* Copy includes padding. */
+    equal(one, "xyz");
+    equal(one + 4, "");
+    equal(one + 5, "fgh");
+
+    (void) strcpy(one, "abc");
+    (void) strncpy(one, "xyz", 0); /* Zero-length copy. */
+    equal(one, "abc");
+
+    (void) strncpy(one, "", 2);	/* Zero-length source. */
+    equal(one, "");
+    equal(one + 1, "");
+    equal(one + 2, "c");
+
+    (void) strcpy(one, "hi there");
+    (void) strncpy(two, one, 9);
+    equal(two, "hi there");	/* Just paranoia. */
+    equal(one, "hi there");	/* Stomped on source? */
+
+    /* strlen.  */
+    it = "strlen";
+    check(strlen("") == 0);	/* Empty. */
+    check(strlen("a") == 1);	/* Single char. */
+    check(strlen("abcd") == 4); /* Multiple chars. */
+
+    /* strchr.  */
+    it = "strchr";
+    check(strchr("abcd", 'z') == NULL); /* Not found. */
+    (void) strcpy(one, "abcd");
+    check(strchr(one, 'c') == one + 2); /* Basic test. */
+    check(strchr(one, 'd') == one + 3); /* End of string. */
+    check(strchr(one, 'a') == one); /* Beginning. */
+    check(strchr(one, '\0') == one + 4);	/* Finding NUL. */
+    (void) strcpy(one, "ababa");
+    check(strchr(one, 'b') == one + 1); /* Finding first. */
+    (void) strcpy(one, "");
+    check(strchr(one, 'b') == NULL); /* Empty string. */
+    check(strchr(one, '\0') == one); /* NUL in empty string. */
+
+    /* index - just like strchr.  */
+    it = "index";
+    check(index("abcd", 'z') == NULL);	/* Not found. */
+    (void) strcpy(one, "abcd");
+    check(index(one, 'c') == one + 2); /* Basic test. */
+    check(index(one, 'd') == one + 3); /* End of string. */
+    check(index(one, 'a') == one); /* Beginning. */
+    check(index(one, '\0') == one + 4); /* Finding NUL. */
+    (void) strcpy(one, "ababa");
+    check(index(one, 'b') == one + 1); /* Finding first. */
+    (void) strcpy(one, "");
+    check(index(one, 'b') == NULL); /* Empty string. */
+    check(index(one, '\0') == one); /* NUL in empty string. */
+
+    /* strrchr.  */
+    it = "strrchr";
+    check(strrchr("abcd", 'z') == NULL); /* Not found. */
+    (void) strcpy(one, "abcd");
+    check(strrchr(one, 'c') == one + 2);	/* Basic test. */
+    check(strrchr(one, 'd') == one + 3);	/* End of string. */
+    check(strrchr(one, 'a') == one); /* Beginning. */
+    check(strrchr(one, '\0') == one + 4); /* Finding NUL. */
+    (void) strcpy(one, "ababa");
+    check(strrchr(one, 'b') == one + 3);	/* Finding last. */
+    (void) strcpy(one, "");
+    check(strrchr(one, 'b') == NULL); /* Empty string. */
+    check(strrchr(one, '\0') == one); /* NUL in empty string. */
+
+    /* rindex - just like strrchr.  */
+    it = "rindex";
+    check(rindex("abcd", 'z') == NULL); /* Not found. */
+    (void) strcpy(one, "abcd");
+    check(rindex(one, 'c') == one + 2); /* Basic test. */
+    check(rindex(one, 'd') == one + 3); /* End of string. */
+    check(rindex(one, 'a') == one); /* Beginning. */
+    check(rindex(one, '\0') == one + 4);	/* Finding NUL. */
+    (void) strcpy(one, "ababa");
+    check(rindex(one, 'b') == one + 3); /* Finding last. */
+    (void) strcpy(one, "");
+    check(rindex(one, 'b') == NULL); /* Empty string. */
+    check(rindex(one, '\0') == one); /* NUL in empty string. */
+
+    /* strpbrk - somewhat like strchr.  */
+    it = "strpbrk";
+    check(strpbrk("abcd", "z") == NULL); /* Not found. */
+    (void) strcpy(one, "abcd");
+    check(strpbrk(one, "c") == one + 2);	/* Basic test. */
+    check(strpbrk(one, "d") == one + 3);	/* End of string. */
+    check(strpbrk(one, "a") == one); /* Beginning. */
+    check(strpbrk(one, "") == NULL); /* Empty search list. */
+    check(strpbrk(one, "cb") == one + 1); /* Multiple search. */
+    (void) strcpy(one, "abcabdea");
+    check(strpbrk(one, "b") == one + 1);	/* Finding first. */
+    check(strpbrk(one, "cb") == one + 1); /* With multiple search. */
+    check(strpbrk(one, "db") == one + 1); /* Another variant. */
+    (void) strcpy(one, "");
+    check(strpbrk(one, "bc") == NULL); /* Empty string. */
+    check(strpbrk(one, "") == NULL); /* Both strings empty. */
+
+    /* strstr - somewhat like strchr.  */
+    it = "strstr";
+    check(strstr("z", "abcd") == NULL); /* Not found. */
+    check(strstr("abx", "abcd") == NULL); /* Dead end. */
+    (void) strcpy(one, "abcd");
+    check(strstr(one, "c") == one + 2); /* Basic test. */
+    check(strstr(one, "bc") == one + 1);	/* Multichar. */
+    check(strstr(one, "d") == one + 3); /* End of string. */
+    check(strstr(one, "cd") == one + 2);	/* Tail of string. */
+    check(strstr(one, "abc") == one); /* Beginning. */
+    check(strstr(one, "abcd") == one);	/* Exact match. */
+    check(strstr(one, "de") == NULL);	/* Past end. */
+    check(strstr(one, "") == one); /* Finding empty. */
+    (void) strcpy(one, "ababa");
+    check(strstr(one, "ba") == one + 1); /* Finding first. */
+    (void) strcpy(one, "");
+    check(strstr(one, "b") == NULL); /* Empty string. */
+    check(strstr(one, "") == one); /* Empty in empty string. */
+    (void) strcpy(one, "bcbca");
+    check(strstr(one, "bca") == one + 2); /* False start. */
+    (void) strcpy(one, "bbbcabbca");
+    check(strstr(one, "bbca") == one + 1); /* With overlap. */
+
+    /* strspn.  */
+    it = "strspn";
+    check(strspn("abcba", "abc") == 5); /* Whole string. */
+    check(strspn("abcba", "ab") == 2);	/* Partial. */
+    check(strspn("abc", "qx") == 0); /* None. */
+    check(strspn("", "ab") == 0); /* Null string. */
+    check(strspn("abc", "") == 0); /* Null search list. */
+
+    /* strcspn.  */
+    it = "strcspn";
+    check(strcspn("abcba", "qx") == 5); /* Whole string. */
+    check(strcspn("abcba", "cx") == 2); /* Partial. */
+    check(strcspn("abc", "abc") == 0);	/* None. */
+    check(strcspn("", "ab") == 0); /* Null string. */
+    check(strcspn("abc", "") == 3); /* Null search list. */
+
+    /* strtok - the hard one.  */
+    it = "strtok";
+    (void) strcpy(one, "first, second, third");
+    equal(strtok(one, ", "), "first");	/* Basic test. */
+    equal(one, "first");
+    equal(strtok((char *)NULL, ", "), "second");
+    equal(strtok((char *)NULL, ", "), "third");
+    check(strtok((char *)NULL, ", ") == NULL);
+    (void) strcpy(one, ", first, ");
+    equal(strtok(one, ", "), "first");	/* Extra delims, 1 tok. */
+    check(strtok((char *)NULL, ", ") == NULL);
+    (void) strcpy(one, "1a, 1b; 2a, 2b");
+    equal(strtok(one, ", "), "1a"); /* Changing delim lists. */
+    equal(strtok((char *)NULL, "; "), "1b");
+    equal(strtok((char *)NULL, ", "), "2a");
+    (void) strcpy(two, "x-y");
+    equal(strtok(two, "-"), "x"); /* New string before done. */
+    equal(strtok((char *)NULL, "-"), "y");
+    check(strtok((char *)NULL, "-") == NULL);
+    (void) strcpy(one, "a,b, c,, ,d");
+    equal(strtok(one, ", "), "a"); /* Different separators. */
+    equal(strtok((char *)NULL, ", "), "b");
+    equal(strtok((char *)NULL, " ,"), "c"); /* Permute list too. */
+    equal(strtok((char *)NULL, " ,"), "d");
+    check(strtok((char *)NULL, ", ") == NULL);
+    check(strtok((char *)NULL, ", ") == NULL); /* Persistence. */
+    (void) strcpy(one, ", ");
+    check(strtok(one, ", ") == NULL);	/* No tokens. */
+    (void) strcpy(one, "");
+    check(strtok(one, ", ") == NULL);	/* Empty string. */
+    (void) strcpy(one, "abc");
+    equal(strtok(one, ", "), "abc"); /* No delimiters. */
+    check(strtok((char *)NULL, ", ") == NULL);
+    (void) strcpy(one, "abc");
+    equal(strtok(one, ""), "abc"); /* Empty delimiter list. */
+    check(strtok((char *)NULL, "") == NULL);
+    (void) strcpy(one, "abcdefgh");
+    (void) strcpy(one, "a,b,c");
+    equal(strtok(one, ","), "a"); /* Basics again... */
+    equal(strtok((char *)NULL, ","), "b");
+    equal(strtok((char *)NULL, ","), "c");
+    check(strtok((char *)NULL, ",") == NULL);
+    equal(one + 6, "gh");	/* Stomped past end? */
+    equal(one, "a");		/* Stomped old tokens? */
+    equal(one + 2, "b");
+    equal(one + 4, "c");
+
+    /* memcmp.  */
+    it = "memcmp";
+    check(memcmp("a", "a", 1) == 0); /* Identity. */
+    check(memcmp("abc", "abc", 3) == 0); /* Multicharacter. */
+    check(memcmp("abcd", "abce", 4) < 0); /* Honestly unequal. */
+    check(memcmp("abce", "abcd", 4));
+    check(memcmp("alph", "beta", 4) < 0);
+    check(memcmp("abce", "abcd", 3) == 0); /* Count limited. */
+    check(memcmp("abc", "def", 0) == 0); /* Zero count. */
+
+    /* memcmp should test strings as unsigned */
+    one[0] = 0xfe;
+    two[0] = 0x03;
+    check(memcmp(one, two, 1) > 0);
+
+
+    /* memchr.  */
+    it = "memchr";
+    check(memchr("abcd", 'z', 4) == NULL); /* Not found. */
+    (void) strcpy(one, "abcd");
+    check(memchr(one, 'c', 4) == one + 2); /* Basic test. */
+    check(memchr(one, 'd', 4) == one + 3); /* End of string. */
+    check(memchr(one, 'a', 4) == one);	/* Beginning. */
+    check(memchr(one, '\0', 5) == one + 4); /* Finding NUL. */
+    (void) strcpy(one, "ababa");
+    check(memchr(one, 'b', 5) == one + 1); /* Finding first. */
+    check(memchr(one, 'b', 0) == NULL); /* Zero count. */
+    check(memchr(one, 'a', 1) == one);	/* Singleton case. */
+    (void) strcpy(one, "a\203b");
+    check(memchr(one, 0203, 3) == one + 1); /* Unsignedness. */
+
+    /* memcpy - need not work for overlap.  */
+    it = "memcpy";
+    check(memcpy(one, "abc", 4) == one); /* Returned value. */
+    equal(one, "abc");		/* Did the copy go right? */
+
+    (void) strcpy(one, "abcdefgh");
+    (void) memcpy(one + 1, "xyz", 2);
+    equal(one, "axydefgh");	/* Basic test. */
+
+    (void) strcpy(one, "abc");
+    (void) memcpy(one, "xyz", 0);
+    equal(one, "abc");		/* Zero-length copy. */
+
+    (void) strcpy(one, "hi there");
+    (void) strcpy(two, "foo");
+    (void) memcpy(two, one, 9);
+    equal(two, "hi there");	/* Just paranoia. */
+    equal(one, "hi there");	/* Stomped on source? */
 #if 0
-  /* memmove - must work on overlap.  */
-  it = "memmove";
-  check(memmove(one, "abc", 4) == one); /* Returned value. */
-  equal(one, "abc");		/* Did the copy go right? */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) memmove(one+1, "xyz", 2);
-  equal(one, "axydefgh");	/* Basic test. */
-
-  (void) strcpy(one, "abc");
-  (void) memmove(one, "xyz", 0);
-  equal(one, "abc");		/* Zero-length copy. */
-
-  (void) strcpy(one, "hi there");
-  (void) strcpy(two, "foo");
-  (void) memmove(two, one, 9);
-  equal(two, "hi there");	/* Just paranoia. */
-  equal(one, "hi there");	/* Stomped on source? */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) memmove(one+1, one, 9);
-  equal(one, "aabcdefgh");	/* Overlap, right-to-left. */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) memmove(one+1, one+2, 7);
-  equal(one, "acdefgh");	/* Overlap, left-to-right. */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) memmove(one, one, 9);
-  equal(one, "abcdefgh");	/* 100% overlap. */
+    /* memmove - must work on overlap.  */
+    it = "memmove";
+    check(memmove(one, "abc", 4) == one); /* Returned value. */
+    equal(one, "abc");		/* Did the copy go right? */
+
+    (void) strcpy(one, "abcdefgh");
+    (void) memmove(one + 1, "xyz", 2);
+    equal(one, "axydefgh");	/* Basic test. */
+
+    (void) strcpy(one, "abc");
+    (void) memmove(one, "xyz", 0);
+    equal(one, "abc");		/* Zero-length copy. */
+
+    (void) strcpy(one, "hi there");
+    (void) strcpy(two, "foo");
+    (void) memmove(two, one, 9);
+    equal(two, "hi there");	/* Just paranoia. */
+    equal(one, "hi there");	/* Stomped on source? */
+
+    (void) strcpy(one, "abcdefgh");
+    (void) memmove(one + 1, one, 9);
+    equal(one, "aabcdefgh");	/* Overlap, right-to-left. */
+
+    (void) strcpy(one, "abcdefgh");
+    (void) memmove(one + 1, one + 2, 7);
+    equal(one, "acdefgh");	/* Overlap, left-to-right. */
+
+    (void) strcpy(one, "abcdefgh");
+    (void) memmove(one, one, 9);
+    equal(one, "abcdefgh");	/* 100% overlap. */
 #endif
 #if 0
-  /* memccpy - first test like memcpy, then the search part
-     The SVID, the only place where memccpy is mentioned, says
-     overlap might fail, so we don't try it.  Besides, it's hard
-     to see the rationale for a non-left-to-right memccpy.  */
-  it = "memccpy";
-  check(memccpy(one, "abc", 'q', 4) == NULL); /* Returned value. */
-  equal(one, "abc");		/* Did the copy go right? */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) memccpy(one+1, "xyz", 'q', 2);
-  equal(one, "axydefgh");	/* Basic test. */
-
-  (void) strcpy(one, "abc");
-  (void) memccpy(one, "xyz", 'q', 0);
-  equal(one, "abc");		/* Zero-length copy. */
-
-  (void) strcpy(one, "hi there");
-  (void) strcpy(two, "foo");
-  (void) memccpy(two, one, 'q', 9);
-  equal(two, "hi there");	/* Just paranoia. */
-  equal(one, "hi there");	/* Stomped on source? */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) strcpy(two, "horsefeathers");
-  check(memccpy(two, one, 'f', 9) == two+6);	/* Returned value. */
-  equal(one, "abcdefgh");	/* Source intact? */
-  equal(two, "abcdefeathers"); /* Copy correct? */
-
-  (void) strcpy(one, "abcd");
-  (void) strcpy(two, "bumblebee");
-  check(memccpy(two, one, 'a', 4) == two+1); /* First char. */
-  equal(two, "aumblebee");
-  check(memccpy(two, one, 'd', 4) == two+4); /* Last char. */
-  equal(two, "abcdlebee");
-  (void) strcpy(one, "xyz");
-  check(memccpy(two, one, 'x', 1) == two+1); /* Singleton. */
-  equal(two, "xbcdlebee");
+    /*  memccpy - first test like memcpy, then the search part
+        The SVID, the only place where memccpy is mentioned, says
+        overlap might fail, so we don't try it.  Besides, it's hard
+        to see the rationale for a non-left-to-right memccpy.  */
+    it = "memccpy";
+    check(memccpy(one, "abc", 'q', 4) == NULL); /* Returned value. */
+    equal(one, "abc");		/* Did the copy go right? */
+
+    (void) strcpy(one, "abcdefgh");
+    (void) memccpy(one + 1, "xyz", 'q', 2);
+    equal(one, "axydefgh");	/* Basic test. */
+
+    (void) strcpy(one, "abc");
+    (void) memccpy(one, "xyz", 'q', 0);
+    equal(one, "abc");		/* Zero-length copy. */
+
+    (void) strcpy(one, "hi there");
+    (void) strcpy(two, "foo");
+    (void) memccpy(two, one, 'q', 9);
+    equal(two, "hi there");	/* Just paranoia. */
+    equal(one, "hi there");	/* Stomped on source? */
+
+    (void) strcpy(one, "abcdefgh");
+    (void) strcpy(two, "horsefeathers");
+    check(memccpy(two, one, 'f', 9) == two + 6);	/* Returned value. */
+    equal(one, "abcdefgh");	/* Source intact? */
+    equal(two, "abcdefeathers"); /* Copy correct? */
+
+    (void) strcpy(one, "abcd");
+    (void) strcpy(two, "bumblebee");
+    check(memccpy(two, one, 'a', 4) == two + 1); /* First char. */
+    equal(two, "aumblebee");
+    check(memccpy(two, one, 'd', 4) == two + 4); /* Last char. */
+    equal(two, "abcdlebee");
+    (void) strcpy(one, "xyz");
+    check(memccpy(two, one, 'x', 1) == two + 1); /* Singleton. */
+    equal(two, "xbcdlebee");
 #endif
-  /* memset.  */
-  it = "memset";
-  (void) strcpy(one, "abcdefgh");
-  check(memset(one+1, 'x', 3) == one+1); /* Return value. */
-  equal(one, "axxxefgh");	/* Basic test. */
-
-  (void) memset(one+2, 'y', 0);
-  equal(one, "axxxefgh");	/* Zero-length set. */
-
-  (void) memset(one+5, 0, 1);
-  equal(one, "axxxe");	/* Zero fill. */
-  equal(one+6, "gh");	/* _AND the leftover. */
-
-  (void) memset(one+2, 010045, 1);
-  equal(one, "ax\045xe");	/* Unsigned char convert. */
-
-  /* bcopy - much like memcpy.
-     Berklix manual is silent about overlap, so don't test it.  */
-  it = "bcopy";
-  (void) bcopy("abc", one, 4);
-  equal(one, "abc");		/* Simple copy. */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) bcopy("xyz", one+1, 2);
-  equal(one, "axydefgh");	/* Basic test. */
-
-  (void) strcpy(one, "abc");
-  (void) bcopy("xyz", one, 0);
-  equal(one, "abc");		/* Zero-length copy. */
-
-  (void) strcpy(one, "hi there");
-  (void) strcpy(two, "foo");
-  (void) bcopy(one, two, 9);
-  equal(two, "hi there");	/* Just paranoia. */
-  equal(one, "hi there");	/* Stomped on source? */
-
-  /* bzero.  */
-  it = "bzero";
-  (void) strcpy(one, "abcdef");
-  bzero(one+2, 2);
-  equal(one, "ab");		/* Basic test. */
-  equal(one+3, "");
-  equal(one+4, "ef");
-
-  (void) strcpy(one, "abcdef");
-  bzero(one+2, 0);
-  equal(one, "abcdef");	/* Zero-length copy. */
-
-  /* bcmp - somewhat like memcmp.  */
-  it = "bcmp";
-  check(bcmp("a", "a", 1) == 0); /* Identity. */
-  check(bcmp("abc", "abc", 3) == 0);	/* Multicharacter. */
-  check(bcmp("abcd", "abce", 4) != 0); /* Honestly unequal. */
-  check(bcmp("abce", "abcd",4));
-  check(bcmp("alph", "beta", 4) != 0);
-  check(bcmp("abce", "abcd", 3) == 0); /* Count limited. */
-  check(bcmp("abc", "def", 0) == 0);	/* Zero count. */
-
-  if (errors) abort();
-  printf("ok\n");
+    /* memset.  */
+    it = "memset";
+    (void) strcpy(one, "abcdefgh");
+    check(memset(one + 1, 'x', 3) == one + 1); /* Return value. */
+    equal(one, "axxxefgh");	/* Basic test. */
+
+    (void) memset(one + 2, 'y', 0);
+    equal(one, "axxxefgh");	/* Zero-length set. */
+
+    (void) memset(one + 5, 0, 1);
+    equal(one, "axxxe");	/* Zero fill. */
+    equal(one + 6, "gh");	/* _AND the leftover. */
+
+    (void) memset(one + 2, 010045, 1);
+    equal(one, "ax\045xe");	/* Unsigned char convert. */
+
+    /*  bcopy - much like memcpy.
+        Berklix manual is silent about overlap, so don't test it.  */
+    it = "bcopy";
+    (void) bcopy("abc", one, 4);
+    equal(one, "abc");		/* Simple copy. */
+
+    (void) strcpy(one, "abcdefgh");
+    (void) bcopy("xyz", one + 1, 2);
+    equal(one, "axydefgh");	/* Basic test. */
+
+    (void) strcpy(one, "abc");
+    (void) bcopy("xyz", one, 0);
+    equal(one, "abc");		/* Zero-length copy. */
+
+    (void) strcpy(one, "hi there");
+    (void) strcpy(two, "foo");
+    (void) bcopy(one, two, 9);
+    equal(two, "hi there");	/* Just paranoia. */
+    equal(one, "hi there");	/* Stomped on source? */
+
+    /* bzero.  */
+    it = "bzero";
+    (void) strcpy(one, "abcdef");
+    bzero(one + 2, 2);
+    equal(one, "ab");		/* Basic test. */
+    equal(one + 3, "");
+    equal(one + 4, "ef");
+
+    (void) strcpy(one, "abcdef");
+    bzero(one + 2, 0);
+    equal(one, "abcdef");	/* Zero-length copy. */
+
+    /* bcmp - somewhat like memcmp.  */
+    it = "bcmp";
+    check(bcmp("a", "a", 1) == 0); /* Identity. */
+    check(bcmp("abc", "abc", 3) == 0);	/* Multicharacter. */
+    check(bcmp("abcd", "abce", 4) != 0); /* Honestly unequal. */
+    check(bcmp("abce", "abcd", 4));
+    check(bcmp("alph", "beta", 4) != 0);
+    check(bcmp("abce", "abcd", 3) == 0); /* Count limited. */
+    check(bcmp("abc", "def", 0) == 0);	/* Zero count. */
+
+    if (errors)
+    {
+        abort();
+    }
+    printf("ok\n");
 
 #if 0  /* strerror - VERY system-dependent.  */
-{
-  extern CONST unsigned int _sys_nerr;
-  extern CONST char *CONST _sys_errlist[];
-  int f;
-  it = "strerror";
-  f = open("/", O_WRONLY);	/* Should always fail. */
-  check(f < 0 && errno > 0 && errno < _sys_nerr);
-  equal(strerror(errno), _sys_errlist[errno]);
-}
+    {
+        extern CONST unsigned int _sys_nerr;
+        extern CONST char *CONST _sys_errlist[];
+        int f;
+        it = "strerror";
+        f = open("/", O_WRONLY);	/* Should always fail. */
+        check(f < 0 && errno > 0 && errno < _sys_nerr);
+        equal(strerror(errno), _sys_errlist[errno]);
+    }
 #endif
 }
 
diff --git a/tests/device/test_libc/memcpy-1.c b/tests/device/test_libc/memcpy-1.c
index 2485af0923..4e14bb5810 100644
--- a/tests/device/test_libc/memcpy-1.c
+++ b/tests/device/test_libc/memcpy-1.c
@@ -1,30 +1,30 @@
 /*
- * Copyright (c) 2011 ARM Ltd
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the company may not be used to endorse or promote
- *    products derived from this software without specific prior written
- *    permission.
- *
- * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+    Copyright (c) 2011 ARM Ltd
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
+    1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    3. The name of the company may not be used to endorse or promote
+      products derived from this software without specific prior written
+      permission.
+
+    THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
+    WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+    IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+    TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
 
 #include <string.h>
 #include <stdlib.h>
@@ -70,105 +70,109 @@
 static int errors = 0;
 
 static void
-print_error (char const* msg, ...)
-{   
-  errors++;
-  if (errors == TOO_MANY_ERRORS)
+print_error(char const* msg, ...)
+{
+    errors++;
+    if (errors == TOO_MANY_ERRORS)
     {
-      fprintf (stderr, "Too many errors.\n");
+        fprintf(stderr, "Too many errors.\n");
     }
-  else if (errors < TOO_MANY_ERRORS)
+    else if (errors < TOO_MANY_ERRORS)
     {
-      va_list ap;
-      va_start (ap, msg);
-      vfprintf (stderr, msg, ap);
-      va_end (ap);
+        va_list ap;
+        va_start(ap, msg);
+        vfprintf(stderr, msg, ap);
+        va_end(ap);
     }
-  else
+    else
     {
-      /* Further errors omitted.  */
+        /* Further errors omitted.  */
     }
 }
 
 extern int rand_seed;
 void memcpy_main(void)
 {
-  /* Allocate buffers to read and write from.  */
-  char src[BUFF_SIZE], dest[BUFF_SIZE], backup_src[BUFF_SIZE];
-
-  /* Fill the source buffer with non-null values, reproducible random data. */
-  srand (rand_seed);
-  int i, j;
-  unsigned sa;
-  unsigned da;
-  unsigned n;
-  for (i = 0; i < BUFF_SIZE; i++)
+    /* Allocate buffers to read and write from.  */
+    char src[BUFF_SIZE], dest[BUFF_SIZE], backup_src[BUFF_SIZE];
+
+    /* Fill the source buffer with non-null values, reproducible random data. */
+    srand(rand_seed);
+    int i, j;
+    unsigned sa;
+    unsigned da;
+    unsigned n;
+    for (i = 0; i < BUFF_SIZE; i++)
+    {
+        src[i] = (char)rand() | 1;
+        backup_src[i] = src[i];
+    }
+
+    /*  Make calls to memcpy with block sizes ranging between 1 and
+        MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
+    for (sa = 0; sa <= MAX_OFFSET; sa++)
+        for (da = 0; da <= MAX_OFFSET; da++)
+            for (n = 1; n <= MAX_BLOCK_SIZE; n++)
+            {
+                //printf (".");
+                /* Zero dest so we can check it properly after the copying.  */
+                for (j = 0; j < BUFF_SIZE; j++)
+                {
+                    dest[j] = 0;
+                }
+
+                void *ret = memcpy(dest + START_COPY + da, src + sa, n);
+
+                /* Check return value.  */
+                if (ret != (dest + START_COPY + da))
+                    print_error("\nFailed: wrong return value in memcpy of %u bytes "
+                                "with src_align %u and dst_align %u. "
+                                "Return value and dest should be the same"
+                                "(ret is %p, dest is %p)\n",
+                                n, sa, da, ret, dest + START_COPY + da);
+
+                /*  Check that content of the destination buffer
+                    is the same as the source buffer, and
+                    memory outside destination buffer is not modified.  */
+                for (j = 0; j < BUFF_SIZE; j++)
+                    if ((unsigned)j < START_COPY + da)
+                    {
+                        if (dest[j] != 0)
+                            print_error("\nFailed: after memcpy of %u bytes "
+                                        "with src_align %u and dst_align %u, "
+                                        "byte %u before the start of dest is not 0.\n",
+                                        n, sa, da, START_COPY - j);
+                    }
+                    else if ((unsigned)j < START_COPY + da + n)
+                    {
+                        i = j - START_COPY - da;
+                        if (dest[j] != (src + sa)[i])
+                            print_error("\nFailed: after memcpy of %u bytes "
+                                        "with src_align %u and dst_align %u, "
+                                        "byte %u in dest and src are not the same.\n",
+                                        n, sa, da, i);
+                    }
+                    else if (dest[j] != 0)
+                    {
+                        print_error("\nFailed: after memcpy of %u bytes "
+                                    "with src_align %u and dst_align %u, "
+                                    "byte %u after the end of dest is not 0.\n",
+                                    n, sa, da, j - START_COPY - da - n);
+                    }
+
+                /* Check src is not modified.  */
+                for (j = 0; j < BUFF_SIZE; j++)
+                    if (src[i] != backup_src[i])
+                        print_error("\nFailed: after memcpy of %u bytes "
+                                    "with src_align %u and dst_align %u, "
+                                    "byte %u of src is modified.\n",
+                                    n, sa, da, j);
+            }
+
+    if (errors != 0)
     {
-      src[i] = (char)rand () | 1;
-      backup_src[i] = src[i];
+        abort();
     }
 
-  /* Make calls to memcpy with block sizes ranging between 1 and
-     MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
-  for (sa = 0; sa <= MAX_OFFSET; sa++)
-    for (da = 0; da <= MAX_OFFSET; da++)
-      for (n = 1; n <= MAX_BLOCK_SIZE; n++)
-        {
-          //printf (".");
-          /* Zero dest so we can check it properly after the copying.  */
-          for (j = 0; j < BUFF_SIZE; j++)
-            dest[j] = 0;
-          
-          void *ret = memcpy (dest + START_COPY + da, src + sa, n);
-          
-          /* Check return value.  */
-          if (ret != (dest + START_COPY + da))
-            print_error ("\nFailed: wrong return value in memcpy of %u bytes "
-                         "with src_align %u and dst_align %u. "
-                         "Return value and dest should be the same"
-                         "(ret is %p, dest is %p)\n",
-                         n, sa, da, ret, dest + START_COPY + da);
-          
-          /* Check that content of the destination buffer
-             is the same as the source buffer, and
-             memory outside destination buffer is not modified.  */
-          for (j = 0; j < BUFF_SIZE; j++)
-            if ((unsigned)j < START_COPY + da)
-              {
-                if (dest[j] != 0)
-                  print_error ("\nFailed: after memcpy of %u bytes "
-                               "with src_align %u and dst_align %u, "
-                               "byte %u before the start of dest is not 0.\n",
-                               n, sa, da, START_COPY - j);
-              }
-            else if ((unsigned)j < START_COPY + da + n)
-              {
-                i = j - START_COPY - da;
-                if (dest[j] != (src + sa)[i])
-                  print_error ("\nFailed: after memcpy of %u bytes "
-                               "with src_align %u and dst_align %u, "
-                               "byte %u in dest and src are not the same.\n",
-                               n, sa, da, i);
-              }
-            else if (dest[j] != 0)
-              {
-                print_error ("\nFailed: after memcpy of %u bytes "
-                             "with src_align %u and dst_align %u, "
-                             "byte %u after the end of dest is not 0.\n",
-                             n, sa, da, j - START_COPY - da - n);
-              }
-
-          /* Check src is not modified.  */
-          for (j = 0; j < BUFF_SIZE; j++)
-            if (src[i] != backup_src[i])
-              print_error ("\nFailed: after memcpy of %u bytes "
-                           "with src_align %u and dst_align %u, "
-                           "byte %u of src is modified.\n",
-                           n, sa, da, j);
-        }
-
-  if (errors != 0)
-    abort ();
-
-  printf("ok\n");
+    printf("ok\n");
 }
diff --git a/tests/device/test_libc/memmove1.c b/tests/device/test_libc/memmove1.c
index f64feae759..573b476765 100644
--- a/tests/device/test_libc/memmove1.c
+++ b/tests/device/test_libc/memmove1.c
@@ -1,38 +1,38 @@
-/* A minor test-program for memmove.
-   Copyright (C) 2005 Axis Communications.
-   All rights reserved.
+/*  A minor test-program for memmove.
+    Copyright (C) 2005 Axis Communications.
+    All rights reserved.
 
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions
-   are met:
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
 
-   1. Redistributions of source code must retain the above copyright
+    1. Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.
 
-   2. Neither the name of Axis Communications nor the names of its
+    2. Neither the name of Axis Communications nor the names of its
       contributors may be used to endorse or promote products derived
       from this software without specific prior written permission.
 
-   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
-   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
-   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-   POSSIBILITY OF SUCH DAMAGE.  */
-
-/* Test moves of 0..MAX bytes; overlapping-src-higher,
-   overlapping-src-lower and non-overlapping.  The overlap varies with
-   1..N where N is the size moved.  This means an order of MAX**2
-   iterations.  The size of an octet may seem appropriate for MAX and
-   makes an upper limit for simple testing.  For the CRIS simulator,
-   making this 256 added 90s to the test-run (2GHz P4) while 64 (4s) was
-   enough to spot the bugs that had crept in, hence the number chosen.  */
+    THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+    COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+    POSSIBILITY OF SUCH DAMAGE.  */
+
+/*  Test moves of 0..MAX bytes; overlapping-src-higher,
+    overlapping-src-lower and non-overlapping.  The overlap varies with
+    1..N where N is the size moved.  This means an order of MAX**2
+    iterations.  The size of an octet may seem appropriate for MAX and
+    makes an upper limit for simple testing.  For the CRIS simulator,
+    making this 256 added 90s to the test-run (2GHz P4) while 64 (4s) was
+    enough to spot the bugs that had crept in, hence the number chosen.  */
 #define MAX 64
 
 #include <stdio.h>
@@ -64,131 +64,139 @@ int errors = 0;
 /* A safe target-independent memmove.  */
 
 void
-mymemmove (unsigned char *dest, unsigned char *src, size_t n)
+mymemmove(unsigned char *dest, unsigned char *src, size_t n)
 {
-  if ((src <= dest && src + n <= dest)
-      || src >= dest)
-    while (n-- > 0)
-      *dest++ = *src++;
-  else
+    if ((src <= dest && src + n <= dest)
+            || src >= dest)
+        while (n-- > 0)
+        {
+            *dest++ = *src++;
+        }
+    else
     {
-      dest += n;
-      src += n;
-      while (n-- > 0)
-	*--dest = *--src;
+        dest += n;
+        src += n;
+        while (n-- > 0)
+        {
+            *--dest = *--src;
+        }
     }
 }
 
-/* It's either the noinline attribute or forcing the test framework to
-   pass -fno-builtin-memmove.  */
+/*  It's either the noinline attribute or forcing the test framework to
+    pass -fno-builtin-memmove.  */
 void
-xmemmove (unsigned char *dest, unsigned char *src, size_t n)
-     __attribute__ ((__noinline__));
+xmemmove(unsigned char *dest, unsigned char *src, size_t n)
+__attribute__((__noinline__));
 
 void
-xmemmove (unsigned char *dest, unsigned char *src, size_t n)
+xmemmove(unsigned char *dest, unsigned char *src, size_t n)
 {
-  void *retp;
-  retp = memmove (dest, src, n);
+    void *retp;
+    retp = memmove(dest, src, n);
 
-  if (retp != dest)
+    if (retp != dest)
     {
-      errors++;
-      DEBUGP ("memmove of n bytes returned %p instead of dest=%p\n",
-	      retp, dest);
+        errors++;
+        DEBUGP("memmove of n bytes returned %p instead of dest=%p\n",
+               retp, dest);
     }
 }
 
 
-/* Fill the array with something we can associate with a position, but
-   not exactly the same as the position index.  */
+/*  Fill the array with something we can associate with a position, but
+    not exactly the same as the position index.  */
 
 void
-fill (unsigned char dest[MAX*3])
+fill(unsigned char dest[MAX * 3])
 {
-  size_t i;
-  for (i = 0; i < MAX*3; i++)
-    dest[i] = (10 + i) % MAX;
+    size_t i;
+    for (i = 0; i < MAX * 3; i++)
+    {
+        dest[i] = (10 + i) % MAX;
+    }
 }
 
 void memmove_main(void)
 {
-  size_t i;
-  int errors = 0;
-
-  /* Leave some room before and after the area tested, so we can detect
-     overwrites of up to N bytes, N being the amount tested.  If you
-     want to test using valgrind, make these malloced instead.  */
-  unsigned char from_test[MAX*3];
-  unsigned char to_test[MAX*3];
-  unsigned char from_known[MAX*3];
-  unsigned char to_known[MAX*3];
-
-  /* Non-overlap.  */
-  for (i = 0; i < MAX; i++)
+    size_t i;
+    int errors = 0;
+
+    /*  Leave some room before and after the area tested, so we can detect
+        overwrites of up to N bytes, N being the amount tested.  If you
+        want to test using valgrind, make these malloced instead.  */
+    unsigned char from_test[MAX * 3];
+    unsigned char to_test[MAX * 3];
+    unsigned char from_known[MAX * 3];
+    unsigned char to_known[MAX * 3];
+
+    /* Non-overlap.  */
+    for (i = 0; i < MAX; i++)
     {
-      /* Do the memmove first before setting the known array, so we know
-         it didn't change any of the known array.  */
-      fill (from_test);
-      fill (to_test);
-      xmemmove (to_test + MAX, 1 + from_test + MAX, i);
-
-      fill (from_known);
-      fill (to_known);
-      mymemmove (to_known + MAX, 1 + from_known + MAX, i);
-
-      if (memcmp (to_known, to_test, sizeof (to_known)) != 0)
-	{
-	  errors++;
-	  DEBUGP ("memmove failed non-overlap test for %d bytes\n", i);
-	}
+        /*  Do the memmove first before setting the known array, so we know
+            it didn't change any of the known array.  */
+        fill(from_test);
+        fill(to_test);
+        xmemmove(to_test + MAX, 1 + from_test + MAX, i);
+
+        fill(from_known);
+        fill(to_known);
+        mymemmove(to_known + MAX, 1 + from_known + MAX, i);
+
+        if (memcmp(to_known, to_test, sizeof(to_known)) != 0)
+        {
+            errors++;
+            DEBUGP("memmove failed non-overlap test for %d bytes\n", i);
+        }
     }
 
-  /* Overlap-from-before.  */
-  for (i = 0; i < MAX; i++)
+    /* Overlap-from-before.  */
+    for (i = 0; i < MAX; i++)
     {
-      size_t j;
-      for (j = 0; j < i; j++)
-	{
-	  fill (to_test);
-	  xmemmove (to_test + MAX * 2 - i, to_test + MAX * 2 - i - j, i);
-
-	  fill (to_known);
-	  mymemmove (to_known + MAX * 2 - i, to_known + MAX * 2 - i - j, i);
-
-	  if (memcmp (to_known, to_test, sizeof (to_known)) != 0)
-	    {
-	      errors++;
-	      DEBUGP ("memmove failed for %d bytes,"
-		      " with src %d bytes before dest\n",
-		      i, j);
-	    }
-	}
+        size_t j;
+        for (j = 0; j < i; j++)
+        {
+            fill(to_test);
+            xmemmove(to_test + MAX * 2 - i, to_test + MAX * 2 - i - j, i);
+
+            fill(to_known);
+            mymemmove(to_known + MAX * 2 - i, to_known + MAX * 2 - i - j, i);
+
+            if (memcmp(to_known, to_test, sizeof(to_known)) != 0)
+            {
+                errors++;
+                DEBUGP("memmove failed for %d bytes,"
+                       " with src %d bytes before dest\n",
+                       i, j);
+            }
+        }
     }
 
-  /* Overlap-from-after.  */
-  for (i = 0; i < MAX; i++)
+    /* Overlap-from-after.  */
+    for (i = 0; i < MAX; i++)
     {
-      size_t j;
-      for (j = 0; j < i; j++)
-	{
-	  fill (to_test);
-	  xmemmove (to_test + MAX, to_test + MAX + j, i);
-
-	  fill (to_known);
-	  mymemmove (to_known + MAX, to_known + MAX + j, i);
-
-	  if (memcmp (to_known, to_test, sizeof (to_known)) != 0)
-	    {
-	      errors++;
-	      DEBUGP ("memmove failed when moving %d bytes,"
-		      " with src %d bytes after dest\n",
-		      i, j);
-	    }
-	}
+        size_t j;
+        for (j = 0; j < i; j++)
+        {
+            fill(to_test);
+            xmemmove(to_test + MAX, to_test + MAX + j, i);
+
+            fill(to_known);
+            mymemmove(to_known + MAX, to_known + MAX + j, i);
+
+            if (memcmp(to_known, to_test, sizeof(to_known)) != 0)
+            {
+                errors++;
+                DEBUGP("memmove failed when moving %d bytes,"
+                       " with src %d bytes after dest\n",
+                       i, j);
+            }
+        }
     }
 
-  if (errors != 0)
-    abort ();
-  printf("ok\n");
+    if (errors != 0)
+    {
+        abort();
+    }
+    printf("ok\n");
 }
diff --git a/tests/device/test_libc/strcmp-1.c b/tests/device/test_libc/strcmp-1.c
index 7c1883a085..b2b3649762 100644
--- a/tests/device/test_libc/strcmp-1.c
+++ b/tests/device/test_libc/strcmp-1.c
@@ -1,30 +1,30 @@
 /*
- * Copyright (c) 2011 ARM Ltd
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the company may not be used to endorse or promote
- *    products derived from this software without specific prior written
- *    permission.
- *
- * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+    Copyright (c) 2011 ARM Ltd
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
+    1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    3. The name of the company may not be used to endorse or promote
+      products derived from this software without specific prior written
+      permission.
+
+    THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
+    WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+    IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+    TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
 
 #include <string.h>
 #include <stdlib.h>
@@ -47,8 +47,8 @@
 #define BUFF_SIZE 256
 
 
-/* The macro LONG_TEST controls whether a short or a more comprehensive test
-   of strcmp should be performed.  */
+/*  The macro LONG_TEST controls whether a short or a more comprehensive test
+    of strcmp should be performed.  */
 #ifdef LONG_TEST
 #ifndef BUFF_SIZE
 #define BUFF_SIZE 1024
@@ -113,23 +113,23 @@ static int errors = 0;
 const char *testname = "strcmp";
 
 static void
-print_error (char const* msg, ...)
+print_error(char const* msg, ...)
 {
-  errors++;
-  if (errors == TOO_MANY_ERRORS)
+    errors++;
+    if (errors == TOO_MANY_ERRORS)
     {
-      fprintf (stderr, "Too many errors.\n");
+        fprintf(stderr, "Too many errors.\n");
     }
-  else if (errors < TOO_MANY_ERRORS)
+    else if (errors < TOO_MANY_ERRORS)
     {
-      va_list ap;
-      va_start (ap, msg);
-      vfprintf (stderr, msg, ap);
-      va_end (ap);
+        va_list ap;
+        va_start(ap, msg);
+        vfprintf(stderr, msg, ap);
+        va_end(ap);
     }
-  else
+    else
     {
-      /* Further errors omitted.  */
+        /* Further errors omitted.  */
     }
 }
 
@@ -137,155 +137,167 @@ print_error (char const* msg, ...)
 extern int rand_seed;
 void strcmp_main(void)
 {
-  /* Allocate buffers to read and write from.  */
-  char src[BUFF_SIZE], dest[BUFF_SIZE];
-
-  /* Fill the source buffer with non-null values, reproducible random data. */
-  srand (rand_seed);
-  int i, j, zeros;
-  unsigned sa;
-  unsigned da;
-  unsigned n, m, len;
-  char *p;
-  int ret;
-
-  /* Make calls to strcmp with block sizes ranging between 1 and
-     MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
-  for (sa = 0; sa <= MAX_OFFSET; sa++)
-    for (da = 0; da <= MAX_OFFSET; da++)
-      for (n = 1; n <= MAX_BLOCK_SIZE; n++)
-	{
-	for (m = 1;  m < n + MAX_DIFF; m++)
-	  for (len = 0; len < MAX_LEN; len++)
-	    for  (zeros = 1; zeros < MAX_ZEROS; zeros++)
-	    {
-	      if (n - m > MAX_DIFF)
-		continue;
-	      /* Make a copy of the source.  */
-	      for (i = 0; i < BUFF_SIZE; i++)
-		{
-		  src[i] = 'A' + (i % 26);
-		  dest[i] = src[i];
-		}
-   delay(0);
-	      memcpy (dest + da, src + sa, n);
-
-	      /* Make src 0-terminated.  */
-	      p = src + sa + n - 1;
-	      for (i = 0; i < zeros; i++)
-		{
-		  *p++ = '\0';
-		}
-
-	      /* Modify dest.  */
-	      p = dest + da + m - 1;
-	      for (j = 0; j < (int)len; j++)
-		*p++ = 'x';
-	      /* Make dest 0-terminated.  */
-	      *p = '\0';
-
-	      ret = strcmp (src + sa, dest + da);
-
-	      /* Check return value.  */
-	      if (n == m)
-		{
-		  if (len == 0)
-		    {
-		      if (ret != 0)
-			{
-			print_error ("\nFailed: after %s of %u bytes "
-				     "with src_align %u and dst_align %u, "
-				     "dest after %d bytes is modified for %d bytes, "
-				     "return value is %d, expected 0.\n",
-				     testname, n, sa, da, m, len, ret);
-			}
-		    }
-		  else
-		    {
-		      if (ret >= 0)
-			print_error ("\nFailed: after %s of %u bytes "
-				     "with src_align %u and dst_align %u, "
-				     "dest after %d bytes is modified for %d bytes, "
-				     "return value is %d, expected negative.\n",
-				     testname, n, sa, da, m, len, ret);
-		    }
-		}
-	      else if (m > n)
-		{
-		  if (ret >= 0)
-		    {
-		      print_error ("\nFailed: after %s of %u bytes "
-				   "with src_align %u and dst_align %u, "
-				   "dest after %d bytes is modified for %d bytes, "
-				   "return value is %d, expected negative.\n",
-				   testname, n, sa, da, m, len, ret);
-		    }
-		}
-	      else  /* m < n */
-		{
-		  if (len == 0)
-		    {
-		      if (ret <= 0)
-			print_error ("\nFailed: after %s of %u bytes "
-				     "with src_align %u and dst_align %u, "
-				     "dest after %d bytes is modified for %d bytes, "
-				     "return value is %d, expected positive.\n",
-				     testname, n, sa, da, m, len, ret);
-		    }
-		  else
-		    {
-		      if (ret >= 0)
-			print_error ("\nFailed: after %s of %u bytes "
-				     "with src_align %u and dst_align %u, "
-				     "dest after %d bytes is modified for %d bytes, "
-				     "return value is %d, expected negative.\n",
-				     testname, n, sa, da, m, len, ret);
-		    }
-		}
-	    }
-	}
-
-  /* Check some corner cases.  */
-  src[1] = 'A';
-  dest[1] = 'A';
-  src[2] = 'B';
-  dest[2] = 'B';
-  src[3] = 'C';
-  dest[3] = 'C';
-  src[4] = '\0';
-  dest[4] = '\0';
-
-  src[0] = 0xc1;
-  dest[0] = 0x41;
-  ret = strcmp (src, dest);
-  if (ret <= 0)
-    print_error ("\nFailed: expected positive, return %d\n", ret);
-
-  src[0] = 0x01;
-  dest[0] = 0x82;
-  ret = strcmp (src, dest);
-  if (ret >= 0)
-    print_error ("\nFailed: expected negative, return %d\n", ret);
-
-  dest[0] = src[0] = 'D';
-  src[3] = 0xc1;
-  dest[3] = 0x41;
-  ret = strcmp (src, dest);
-  if (ret <= 0)
-    print_error ("\nFailed: expected positive, return %d\n", ret);
-
-  src[3] = 0x01;
-  dest[3] = 0x82;
-  ret = strcmp (src, dest);
-  if (ret >= 0)
-    print_error ("\nFailed: expected negative, return %d\n", ret);
-
-  //printf ("\n");
-  if (errors != 0)
+    /* Allocate buffers to read and write from.  */
+    char src[BUFF_SIZE], dest[BUFF_SIZE];
+
+    /* Fill the source buffer with non-null values, reproducible random data. */
+    srand(rand_seed);
+    int i, j, zeros;
+    unsigned sa;
+    unsigned da;
+    unsigned n, m, len;
+    char *p;
+    int ret;
+
+    /*  Make calls to strcmp with block sizes ranging between 1 and
+        MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
+    for (sa = 0; sa <= MAX_OFFSET; sa++)
+        for (da = 0; da <= MAX_OFFSET; da++)
+            for (n = 1; n <= MAX_BLOCK_SIZE; n++)
+            {
+                for (m = 1;  m < n + MAX_DIFF; m++)
+                    for (len = 0; len < MAX_LEN; len++)
+                        for (zeros = 1; zeros < MAX_ZEROS; zeros++)
+                        {
+                            if (n - m > MAX_DIFF)
+                            {
+                                continue;
+                            }
+                            /* Make a copy of the source.  */
+                            for (i = 0; i < BUFF_SIZE; i++)
+                            {
+                                src[i] = 'A' + (i % 26);
+                                dest[i] = src[i];
+                            }
+                            delay(0);
+                            memcpy(dest + da, src + sa, n);
+
+                            /* Make src 0-terminated.  */
+                            p = src + sa + n - 1;
+                            for (i = 0; i < zeros; i++)
+                            {
+                                *p++ = '\0';
+                            }
+
+                            /* Modify dest.  */
+                            p = dest + da + m - 1;
+                            for (j = 0; j < (int)len; j++)
+                            {
+                                *p++ = 'x';
+                            }
+                            /* Make dest 0-terminated.  */
+                            *p = '\0';
+
+                            ret = strcmp(src + sa, dest + da);
+
+                            /* Check return value.  */
+                            if (n == m)
+                            {
+                                if (len == 0)
+                                {
+                                    if (ret != 0)
+                                    {
+                                        print_error("\nFailed: after %s of %u bytes "
+                                                    "with src_align %u and dst_align %u, "
+                                                    "dest after %d bytes is modified for %d bytes, "
+                                                    "return value is %d, expected 0.\n",
+                                                    testname, n, sa, da, m, len, ret);
+                                    }
+                                }
+                                else
+                                {
+                                    if (ret >= 0)
+                                        print_error("\nFailed: after %s of %u bytes "
+                                                    "with src_align %u and dst_align %u, "
+                                                    "dest after %d bytes is modified for %d bytes, "
+                                                    "return value is %d, expected negative.\n",
+                                                    testname, n, sa, da, m, len, ret);
+                                }
+                            }
+                            else if (m > n)
+                            {
+                                if (ret >= 0)
+                                {
+                                    print_error("\nFailed: after %s of %u bytes "
+                                                "with src_align %u and dst_align %u, "
+                                                "dest after %d bytes is modified for %d bytes, "
+                                                "return value is %d, expected negative.\n",
+                                                testname, n, sa, da, m, len, ret);
+                                }
+                            }
+                            else  /* m < n */
+                            {
+                                if (len == 0)
+                                {
+                                    if (ret <= 0)
+                                        print_error("\nFailed: after %s of %u bytes "
+                                                    "with src_align %u and dst_align %u, "
+                                                    "dest after %d bytes is modified for %d bytes, "
+                                                    "return value is %d, expected positive.\n",
+                                                    testname, n, sa, da, m, len, ret);
+                                }
+                                else
+                                {
+                                    if (ret >= 0)
+                                        print_error("\nFailed: after %s of %u bytes "
+                                                    "with src_align %u and dst_align %u, "
+                                                    "dest after %d bytes is modified for %d bytes, "
+                                                    "return value is %d, expected negative.\n",
+                                                    testname, n, sa, da, m, len, ret);
+                                }
+                            }
+                        }
+            }
+
+    /* Check some corner cases.  */
+    src[1] = 'A';
+    dest[1] = 'A';
+    src[2] = 'B';
+    dest[2] = 'B';
+    src[3] = 'C';
+    dest[3] = 'C';
+    src[4] = '\0';
+    dest[4] = '\0';
+
+    src[0] = 0xc1;
+    dest[0] = 0x41;
+    ret = strcmp(src, dest);
+    if (ret <= 0)
     {
-      printf ("ERROR. FAILED.\n");
-      abort ();
+        print_error("\nFailed: expected positive, return %d\n", ret);
     }
-  //exit (0);
-  printf("ok\n");
+
+    src[0] = 0x01;
+    dest[0] = 0x82;
+    ret = strcmp(src, dest);
+    if (ret >= 0)
+    {
+        print_error("\nFailed: expected negative, return %d\n", ret);
+    }
+
+    dest[0] = src[0] = 'D';
+    src[3] = 0xc1;
+    dest[3] = 0x41;
+    ret = strcmp(src, dest);
+    if (ret <= 0)
+    {
+        print_error("\nFailed: expected positive, return %d\n", ret);
+    }
+
+    src[3] = 0x01;
+    dest[3] = 0x82;
+    ret = strcmp(src, dest);
+    if (ret >= 0)
+    {
+        print_error("\nFailed: expected negative, return %d\n", ret);
+    }
+
+    //printf ("\n");
+    if (errors != 0)
+    {
+        printf("ERROR. FAILED.\n");
+        abort();
+    }
+    //exit (0);
+    printf("ok\n");
 }
diff --git a/tests/device/test_libc/tstring.c b/tests/device/test_libc/tstring.c
index 7e806b1027..c2f2f4075a 100644
--- a/tests/device/test_libc/tstring.c
+++ b/tests/device/test_libc/tstring.c
@@ -1,9 +1,9 @@
 /*
- * Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
- *
- * Permission to use, copy, modify, and distribute this software
- * is freely granted, provided that this notice is preserved.
- */
+    Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
+
+    Permission to use, copy, modify, and distribute this software
+    is freely granted, provided that this notice is preserved.
+*/
 
 #include <string.h>
 #include <stdio.h>
@@ -26,336 +26,342 @@
 
 #define MAX_2 (2 * MAX_1 + MAX_1 / 10)
 
-void eprintf (int line, char *result, char *expected, int size)
+void eprintf(int line, char *result, char *expected, int size)
 {
-  if (size != 0)
-    printf ("Failure at line %d, result is <%.*s>, should be <%s> of size %d\n",
-             line, size, result, expected, size);
-  else
-    printf ("Failure at line %d, result is <%s>, should be <%s>\n",
-             line, result, expected);
+    if (size != 0)
+        printf("Failure at line %d, result is <%.*s>, should be <%s> of size %d\n",
+               line, size, result, expected, size);
+    else
+        printf("Failure at line %d, result is <%s>, should be <%s>\n",
+               line, result, expected);
 }
 
-void mycopy (char *target, char *source, int size)
+void mycopy(char *target, char *source, int size)
 {
-  int i;
+    int i;
 
-  for (i = 0; i < size; ++i)
+    for (i = 0; i < size; ++i)
     {
-      target[i] = source[i];
+        target[i] = source[i];
     }
 }
 
-void myset (char *target, char ch, int size)
+void myset(char *target, char ch, int size)
 {
-  int i;
-  
-  for (i = 0; i < size; ++i)
+    int i;
+
+    for (i = 0; i < size; ++i)
     {
-      target[i] = ch;
+        target[i] = ch;
     }
 }
 
 void tstring_main(void)
 {
-  char target[MAX_1] = "A";
-  char first_char;
-  char second_char;
-  char array[] = "abcdefghijklmnopqrstuvwxz";
-  char array2[] = "0123456789!@#$%^&*(";
-  char buffer2[MAX_1];
-  char buffer3[MAX_1];
-  char buffer4[MAX_1];
-  char buffer5[MAX_2];
-  char buffer6[MAX_2];
-  char buffer7[MAX_2];
-  char expected[MAX_1];
-  char *tmp1, *tmp2, *tmp3, *tmp4, *tmp5, *tmp6, *tmp7;
-  int i, j, k, x, z, align_test_iterations;
-  z = 0;
-  
-  int test_failed = 0;
-
-  tmp1 = target;
-  tmp2 = buffer2;
-  tmp3 = buffer3;
-  tmp4 = buffer4;
-  tmp5 = buffer5;
-  tmp6 = buffer6;
-  tmp7 = buffer7;
-
-  tmp2[0] = 'Z';
-  tmp2[1] = '\0';
-
-  if (memset (target, 'X', 0) != target ||
-      memcpy (target, "Y", 0) != target ||
-      memmove (target, "K", 0) != target ||
-      strncpy (tmp2, "4", 0) != tmp2 ||
-      strncat (tmp2, "123", 0) != tmp2 ||
-      strcat (target, "") != target)
+    char target[MAX_1] = "A";
+    char first_char;
+    char second_char;
+    char array[] = "abcdefghijklmnopqrstuvwxz";
+    char array2[] = "0123456789!@#$%^&*(";
+    char buffer2[MAX_1];
+    char buffer3[MAX_1];
+    char buffer4[MAX_1];
+    char buffer5[MAX_2];
+    char buffer6[MAX_2];
+    char buffer7[MAX_2];
+    char expected[MAX_1];
+    char *tmp1, *tmp2, *tmp3, *tmp4, *tmp5, *tmp6, *tmp7;
+    int i, j, k, x, z, align_test_iterations;
+    z = 0;
+
+    int test_failed = 0;
+
+    tmp1 = target;
+    tmp2 = buffer2;
+    tmp3 = buffer3;
+    tmp4 = buffer4;
+    tmp5 = buffer5;
+    tmp6 = buffer6;
+    tmp7 = buffer7;
+
+    tmp2[0] = 'Z';
+    tmp2[1] = '\0';
+
+    if (memset(target, 'X', 0) != target ||
+            memcpy(target, "Y", 0) != target ||
+            memmove(target, "K", 0) != target ||
+            strncpy(tmp2, "4", 0) != tmp2 ||
+            strncat(tmp2, "123", 0) != tmp2 ||
+            strcat(target, "") != target)
     {
-      eprintf (__LINE__, target, "A", 0);
-      test_failed = 1;
+        eprintf(__LINE__, target, "A", 0);
+        test_failed = 1;
     }
 
-  if (strcmp (target, "A") || strlen(target) != 1 || memchr (target, 'A', 0) != NULL
-      || memcmp (target, "J", 0) || strncmp (target, "A", 1) || strncmp (target, "J", 0) ||
-      tmp2[0] != 'Z' || tmp2[1] != '\0')
+    if (strcmp(target, "A") || strlen(target) != 1 || memchr(target, 'A', 0) != NULL
+            || memcmp(target, "J", 0) || strncmp(target, "A", 1) || strncmp(target, "J", 0) ||
+            tmp2[0] != 'Z' || tmp2[1] != '\0')
     {
-      eprintf (__LINE__, target, "A", 0);
-      test_failed = 1;
+        eprintf(__LINE__, target, "A", 0);
+        test_failed = 1;
     }
 
-  tmp2[2] = 'A';
-  if (strcpy (target, "") != target ||
-      strncpy (tmp2, "", 4) != tmp2 ||
-      strcat (target, "") != target)
+    tmp2[2] = 'A';
+    if (strcpy(target, "") != target ||
+            strncpy(tmp2, "", 4) != tmp2 ||
+            strcat(target, "") != target)
     {
-      eprintf (__LINE__, target, "", 0);
-      test_failed = 1;
+        eprintf(__LINE__, target, "", 0);
+        test_failed = 1;
     }
 
-  if (target[0] != '\0' || strncmp (target, "", 1) ||
-      memcmp (tmp2, "\0\0\0\0", 4))
+    if (target[0] != '\0' || strncmp(target, "", 1) ||
+            memcmp(tmp2, "\0\0\0\0", 4))
     {
-      eprintf (__LINE__, target, "", 0);
-      test_failed = 1;
+        eprintf(__LINE__, target, "", 0);
+        test_failed = 1;
     }
 
-  tmp2[2] = 'A';
-  if (strncat (tmp2, "1", 3) != tmp2 ||
-      memcmp (tmp2, "1\0A", 3))
+    tmp2[2] = 'A';
+    if (strncat(tmp2, "1", 3) != tmp2 ||
+            memcmp(tmp2, "1\0A", 3))
     {
-      eprintf (__LINE__, tmp2, "1\0A", 3);
-      test_failed = 1;
+        eprintf(__LINE__, tmp2, "1\0A", 3);
+        test_failed = 1;
     }
 
-  if (strcpy (tmp3, target) != tmp3 ||
-      strcat (tmp3, "X") != tmp3 ||
-      strncpy (tmp2, "X", 2) != tmp2 ||
-      memset (target, tmp2[0], 1) != target)
+    if (strcpy(tmp3, target) != tmp3 ||
+            strcat(tmp3, "X") != tmp3 ||
+            strncpy(tmp2, "X", 2) != tmp2 ||
+            memset(target, tmp2[0], 1) != target)
     {
-      eprintf (__LINE__, target, "X", 0);
-      test_failed = 1;
+        eprintf(__LINE__, target, "X", 0);
+        test_failed = 1;
     }
 
-  if (strcmp (target, "X") || strlen (target) != 1 ||
-      memchr (target, 'X', 2) != target ||
-      strchr (target, 'X') != target ||
-      memchr (target, 'Y', 2) != NULL ||
-      strchr (target, 'Y') != NULL ||
-      strcmp (tmp3, target) ||
-      strncmp (tmp3, target, 2) ||
-      memcmp (target, "K", 0) ||
-      strncmp (target, tmp3, 3))
+    if (strcmp(target, "X") || strlen(target) != 1 ||
+            memchr(target, 'X', 2) != target ||
+            strchr(target, 'X') != target ||
+            memchr(target, 'Y', 2) != NULL ||
+            strchr(target, 'Y') != NULL ||
+            strcmp(tmp3, target) ||
+            strncmp(tmp3, target, 2) ||
+            memcmp(target, "K", 0) ||
+            strncmp(target, tmp3, 3))
     {
-      eprintf (__LINE__, target, "X", 0);
-      test_failed = 1;
+        eprintf(__LINE__, target, "X", 0);
+        test_failed = 1;
     }
 
-  if (strcpy (tmp3, "Y") != tmp3 ||
-      strcat (tmp3, "Y") != tmp3 ||
-      memset (target, 'Y', 2) != target)
+    if (strcpy(tmp3, "Y") != tmp3 ||
+            strcat(tmp3, "Y") != tmp3 ||
+            memset(target, 'Y', 2) != target)
     {
-      eprintf (__LINE__, target, "Y", 0);
-      test_failed = 1;
+        eprintf(__LINE__, target, "Y", 0);
+        test_failed = 1;
     }
 
-  target[2] = '\0';
-  if (memcmp (target, "YY", 2) || strcmp (target, "YY") ||
-      strlen (target) != 2 || memchr (target, 'Y', 2) != target ||
-      strcmp (tmp3, target) ||
-      strncmp (target, tmp3, 3) ||
-      strncmp (target, tmp3, 4) ||
-      strncmp (target, tmp3, 2) ||
-      strchr (target, 'Y') != target)
+    target[2] = '\0';
+    if (memcmp(target, "YY", 2) || strcmp(target, "YY") ||
+            strlen(target) != 2 || memchr(target, 'Y', 2) != target ||
+            strcmp(tmp3, target) ||
+            strncmp(target, tmp3, 3) ||
+            strncmp(target, tmp3, 4) ||
+            strncmp(target, tmp3, 2) ||
+            strchr(target, 'Y') != target)
     {
-      eprintf (__LINE__, target, "YY", 2);
-      test_failed = 1;
+        eprintf(__LINE__, target, "YY", 2);
+        test_failed = 1;
     }
 
-  strcpy (target, "WW");
-  if (memcmp (target, "WW", 2) || strcmp (target, "WW") ||
-      strlen (target) != 2 || memchr (target, 'W', 2) != target ||
-      strchr (target, 'W') != target)
+    strcpy(target, "WW");
+    if (memcmp(target, "WW", 2) || strcmp(target, "WW") ||
+            strlen(target) != 2 || memchr(target, 'W', 2) != target ||
+            strchr(target, 'W') != target)
     {
-      eprintf (__LINE__, target, "WW", 2);
-      test_failed = 1;
+        eprintf(__LINE__, target, "WW", 2);
+        test_failed = 1;
     }
 
-  if (strncpy (target, "XX", 16) != target ||
-      memcmp (target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16))
+    if (strncpy(target, "XX", 16) != target ||
+            memcmp(target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16))
     {
-      eprintf (__LINE__, target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16);
-      test_failed = 1;
+        eprintf(__LINE__, target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16);
+        test_failed = 1;
     }
 
-  if (strcpy (tmp3, "ZZ") != tmp3 ||
-      strcat (tmp3, "Z") != tmp3 ||
-      memcpy (tmp4, "Z", 2) != tmp4 ||
-      strcat (tmp4, "ZZ") != tmp4 ||
-      memset (target, 'Z', 3) != target)
+    if (strcpy(tmp3, "ZZ") != tmp3 ||
+            strcat(tmp3, "Z") != tmp3 ||
+            memcpy(tmp4, "Z", 2) != tmp4 ||
+            strcat(tmp4, "ZZ") != tmp4 ||
+            memset(target, 'Z', 3) != target)
     {
-      eprintf (__LINE__, target, "ZZZ", 3);
-      test_failed = 1;
+        eprintf(__LINE__, target, "ZZZ", 3);
+        test_failed = 1;
     }
 
-  target[3] = '\0';
-  tmp5[0] = '\0';
-  strncat (tmp5, "123", 2);
-  if (memcmp (target, "ZZZ", 3) || strcmp (target, "ZZZ") ||
-      strcmp (tmp3, target) || strcmp (tmp4, target) ||
-      strncmp (target, "ZZZ", 4) || strncmp (target, "ZZY", 3) <= 0 ||
-      strncmp ("ZZY", target, 4) >= 0 ||
-      memcmp (tmp5, "12", 3) ||
-      strlen (target) != 3)
+    target[3] = '\0';
+    tmp5[0] = '\0';
+    strncat(tmp5, "123", 2);
+    if (memcmp(target, "ZZZ", 3) || strcmp(target, "ZZZ") ||
+            strcmp(tmp3, target) || strcmp(tmp4, target) ||
+            strncmp(target, "ZZZ", 4) || strncmp(target, "ZZY", 3) <= 0 ||
+            strncmp("ZZY", target, 4) >= 0 ||
+            memcmp(tmp5, "12", 3) ||
+            strlen(target) != 3)
     {
-      eprintf (__LINE__, target, "ZZZ", 3);
-      test_failed = 1;
+        eprintf(__LINE__, target, "ZZZ", 3);
+        test_failed = 1;
     }
 
-  target[2] = 'K';
-  if (memcmp (target, "ZZZ", 2) || strcmp (target, "ZZZ") >= 0 ||
-      memcmp (target, "ZZZ", 3) >= 0 || strlen (target) != 3 ||
-      memchr (target, 'K', 3) != target + 2 ||
-      strncmp (target, "ZZZ", 2) || strncmp (target, "ZZZ", 4) >= 0 ||
-      strchr (target, 'K') != target + 2)
+    target[2] = 'K';
+    if (memcmp(target, "ZZZ", 2) || strcmp(target, "ZZZ") >= 0 ||
+            memcmp(target, "ZZZ", 3) >= 0 || strlen(target) != 3 ||
+            memchr(target, 'K', 3) != target + 2 ||
+            strncmp(target, "ZZZ", 2) || strncmp(target, "ZZZ", 4) >= 0 ||
+            strchr(target, 'K') != target + 2)
     {
-      eprintf (__LINE__, target, "ZZK", 3);
-      test_failed = 1;
+        eprintf(__LINE__, target, "ZZK", 3);
+        test_failed = 1;
     }
-  
-  strcpy (target, "AAA");
-  if (memcmp (target, "AAA", 3) || strcmp (target, "AAA") ||
-      strncmp (target, "AAA", 3) ||
-      strlen (target) != 3)
+
+    strcpy(target, "AAA");
+    if (memcmp(target, "AAA", 3) || strcmp(target, "AAA") ||
+            strncmp(target, "AAA", 3) ||
+            strlen(target) != 3)
     {
-      eprintf (__LINE__, target, "AAA", 3);
-      test_failed = 1;
+        eprintf(__LINE__, target, "AAA", 3);
+        test_failed = 1;
     }
-  
-  j = 5;
-  while (j < MAX_1)
+
+    j = 5;
+    while (j < MAX_1)
     {
-      for (i = j-1; i <= j+1; ++i)
+        for (i = j - 1; i <= j + 1; ++i)
         {
-	  /* don't bother checking unaligned data in the larger
-	     sizes since it will waste time without performing additional testing */
-	  if ((size_t)i <= 16 * sizeof(long))
-	    {
-	      align_test_iterations = 2*sizeof(long);
-              if ((size_t)i <= 2 * sizeof(long) + 1)
-                z = 2;
-	      else
-	        z = 2 * sizeof(long);
+            /*  don't bother checking unaligned data in the larger
+                sizes since it will waste time without performing additional testing */
+            if ((size_t)i <= 16 * sizeof(long))
+            {
+                align_test_iterations = 2 * sizeof(long);
+                if ((size_t)i <= 2 * sizeof(long) + 1)
+                {
+                    z = 2;
+                }
+                else
+                {
+                    z = 2 * sizeof(long);
+                }
             }
-	  else
+            else
             {
-	      align_test_iterations = 1;
+                align_test_iterations = 1;
             }
 
-	  for (x = 0; x < align_test_iterations; ++x)
-	    {
-	      tmp1 = target + x;
-	      tmp2 = buffer2 + x;
-	      tmp3 = buffer3 + x;
-	      tmp4 = buffer4 + x;
-	      tmp5 = buffer5 + x;
-	      tmp6 = buffer6 + x;
-
-	      first_char = array[i % (sizeof(array) - 1)];
-	      second_char = array2[i % (sizeof(array2) - 1)];
-	      memset (tmp1, first_char, i);
-	      mycopy (tmp2, tmp1, i);
-	      myset (tmp2 + z, second_char, i - z - 1);
-	      if (memcpy (tmp1 + z, tmp2 + z, i - z - 1) != tmp1 + z)
-		{
-		  printf ("error at line %d\n", __LINE__);
-		  test_failed = 1;
-		}
-
-	      tmp1[i] = '\0';
-	      tmp2[i] = '\0';
-	      if (strcpy (expected, tmp2) != expected)
-		{
-		  printf ("error at line %d\n", __LINE__);
-		  test_failed = 1;
-		}
-	      tmp2[i-z] = first_char + 1;
-	      if (memmove (tmp2 + z + 1, tmp2 + z, i - z - 1) != tmp2 + z + 1 ||
-		  memset (tmp3, first_char, i) != tmp3)
-		{
-		  printf ("error at line %d\n", __LINE__);
-		  test_failed = 1;
-		}
-
-	      myset (tmp4, first_char, i);
-	      tmp5[0] = '\0';
-	      if (strncpy (tmp5, tmp1, i+1) != tmp5 ||
-		  strcat (tmp5, tmp1) != tmp5)
-		{
-		  printf ("error at line %d\n", __LINE__);
-		  test_failed = 1;
-		}
-	      mycopy (tmp6, tmp1, i);
-	      mycopy (tmp6 + i, tmp1, i + 1);
-
-	      tmp7[2*i+z] = second_char;
-              strcpy (tmp7, tmp1);
-         
-	      (void)strchr (tmp1, second_char);
- 
-	      if (memcmp (tmp1, expected, i) || strcmp (tmp1, expected) ||
-		  strncmp (tmp1, expected, i) ||
-                  strncmp (tmp1, expected, i+1) ||
-		  strcmp (tmp1, tmp2) >= 0 || memcmp (tmp1, tmp2, i) >= 0 ||
-		  strncmp (tmp1, tmp2, i+1) >= 0 ||
-		  (int)strlen (tmp1) != i || memchr (tmp1, first_char, i) != tmp1 ||
-		  strchr (tmp1, first_char) != tmp1 ||
-		  memchr (tmp1, second_char, i) != tmp1 + z ||
-		  strchr (tmp1, second_char) != tmp1 + z ||
-		  strcmp (tmp5, tmp6) ||
-		  strncat (tmp7, tmp1, i+2) != tmp7 ||
-		  strcmp (tmp7, tmp6) ||
-		  tmp7[2*i+z] != second_char)
-		{
-		  eprintf (__LINE__, tmp1, expected, 0);
-		  printf ("x is %d\n",x);
-		  printf ("i is %d\n", i);
-		  printf ("tmp1 is <%p>\n", tmp1);
-		  printf ("tmp5 is <%p> <%s>\n", tmp5, tmp5);
-		  printf ("tmp6 is <%p> <%s>\n", tmp6, tmp6);
-		  test_failed = 1;
-		}
-
-	      for (k = 1; k <= align_test_iterations && k <= i; ++k)
-		{
-		  if (memcmp (tmp3, tmp4, i - k + 1) != 0 ||
-		      strncmp (tmp3, tmp4, i - k + 1) != 0)
-		    {
-		      printf ("Failure at line %d, comparing %.*s with %.*s\n",
-			      __LINE__, i, tmp3, i, tmp4);
-		      test_failed = 1;
-		    }
-		  tmp4[i-k] = first_char + 1;
-		  if (memcmp (tmp3, tmp4, i) >= 0 ||
-		      strncmp (tmp3, tmp4, i) >= 0 ||
-		      memcmp (tmp4, tmp3, i) <= 0 ||
-		      strncmp (tmp4, tmp3, i) <= 0)
-		    {
-		      printf ("Failure at line %d, comparing %.*s with %.*s\n",
-			      __LINE__, i, tmp3, i, tmp4);
-		      test_failed = 1;
-		    }
-		  tmp4[i-k] = first_char;
-		}
-	    }              
+            for (x = 0; x < align_test_iterations; ++x)
+            {
+                tmp1 = target + x;
+                tmp2 = buffer2 + x;
+                tmp3 = buffer3 + x;
+                tmp4 = buffer4 + x;
+                tmp5 = buffer5 + x;
+                tmp6 = buffer6 + x;
+
+                first_char = array[i % (sizeof(array) - 1)];
+                second_char = array2[i % (sizeof(array2) - 1)];
+                memset(tmp1, first_char, i);
+                mycopy(tmp2, tmp1, i);
+                myset(tmp2 + z, second_char, i - z - 1);
+                if (memcpy(tmp1 + z, tmp2 + z, i - z - 1) != tmp1 + z)
+                {
+                    printf("error at line %d\n", __LINE__);
+                    test_failed = 1;
+                }
+
+                tmp1[i] = '\0';
+                tmp2[i] = '\0';
+                if (strcpy(expected, tmp2) != expected)
+                {
+                    printf("error at line %d\n", __LINE__);
+                    test_failed = 1;
+                }
+                tmp2[i - z] = first_char + 1;
+                if (memmove(tmp2 + z + 1, tmp2 + z, i - z - 1) != tmp2 + z + 1 ||
+                        memset(tmp3, first_char, i) != tmp3)
+                {
+                    printf("error at line %d\n", __LINE__);
+                    test_failed = 1;
+                }
+
+                myset(tmp4, first_char, i);
+                tmp5[0] = '\0';
+                if (strncpy(tmp5, tmp1, i + 1) != tmp5 ||
+                        strcat(tmp5, tmp1) != tmp5)
+                {
+                    printf("error at line %d\n", __LINE__);
+                    test_failed = 1;
+                }
+                mycopy(tmp6, tmp1, i);
+                mycopy(tmp6 + i, tmp1, i + 1);
+
+                tmp7[2 * i + z] = second_char;
+                strcpy(tmp7, tmp1);
+
+                (void)strchr(tmp1, second_char);
+
+                if (memcmp(tmp1, expected, i) || strcmp(tmp1, expected) ||
+                        strncmp(tmp1, expected, i) ||
+                        strncmp(tmp1, expected, i + 1) ||
+                        strcmp(tmp1, tmp2) >= 0 || memcmp(tmp1, tmp2, i) >= 0 ||
+                        strncmp(tmp1, tmp2, i + 1) >= 0 ||
+                        (int)strlen(tmp1) != i || memchr(tmp1, first_char, i) != tmp1 ||
+                        strchr(tmp1, first_char) != tmp1 ||
+                        memchr(tmp1, second_char, i) != tmp1 + z ||
+                        strchr(tmp1, second_char) != tmp1 + z ||
+                        strcmp(tmp5, tmp6) ||
+                        strncat(tmp7, tmp1, i + 2) != tmp7 ||
+                        strcmp(tmp7, tmp6) ||
+                        tmp7[2 * i + z] != second_char)
+                {
+                    eprintf(__LINE__, tmp1, expected, 0);
+                    printf("x is %d\n", x);
+                    printf("i is %d\n", i);
+                    printf("tmp1 is <%p>\n", tmp1);
+                    printf("tmp5 is <%p> <%s>\n", tmp5, tmp5);
+                    printf("tmp6 is <%p> <%s>\n", tmp6, tmp6);
+                    test_failed = 1;
+                }
+
+                for (k = 1; k <= align_test_iterations && k <= i; ++k)
+                {
+                    if (memcmp(tmp3, tmp4, i - k + 1) != 0 ||
+                            strncmp(tmp3, tmp4, i - k + 1) != 0)
+                    {
+                        printf("Failure at line %d, comparing %.*s with %.*s\n",
+                               __LINE__, i, tmp3, i, tmp4);
+                        test_failed = 1;
+                    }
+                    tmp4[i - k] = first_char + 1;
+                    if (memcmp(tmp3, tmp4, i) >= 0 ||
+                            strncmp(tmp3, tmp4, i) >= 0 ||
+                            memcmp(tmp4, tmp3, i) <= 0 ||
+                            strncmp(tmp4, tmp3, i) <= 0)
+                    {
+                        printf("Failure at line %d, comparing %.*s with %.*s\n",
+                               __LINE__, i, tmp3, i, tmp4);
+                        test_failed = 1;
+                    }
+                    tmp4[i - k] = first_char;
+                }
+            }
         }
-      j = ((2 * j) >> 2) << 2;
+        j = ((2 * j) >> 2) << 2;
     }
 
-  if (test_failed)
-    abort();
+    if (test_failed)
+    {
+        abort();
+    }
 
-  printf("ok\n"); 
+    printf("ok\n");
 }
diff --git a/tests/host/common/Arduino.cpp b/tests/host/common/Arduino.cpp
index 1c651e7e1f..3ca0670ae1 100644
--- a/tests/host/common/Arduino.cpp
+++ b/tests/host/common/Arduino.cpp
@@ -1,16 +1,16 @@
 /*
- Arduino.cpp - Mocks for common Arduino APIs
- Copyright © 2016 Ivan Grokhotkov
- 
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- 
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
+    Arduino.cpp - Mocks for common Arduino APIs
+    Copyright © 2016 Ivan Grokhotkov
+
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
 */
 
 #include <sys/time.h>
@@ -28,7 +28,9 @@ extern "C" unsigned long millis()
     timeval time;
     gettimeofday(&time, NULL);
     if (gtod0.tv_sec == 0)
+    {
         memcpy(&gtod0, &time, sizeof gtod0);
+    }
     return ((time.tv_sec - gtod0.tv_sec) * 1000) + ((time.tv_usec - gtod0.tv_usec) / 1000);
 }
 
@@ -37,7 +39,9 @@ extern "C" unsigned long micros()
     timeval time;
     gettimeofday(&time, NULL);
     if (gtod0.tv_sec == 0)
+    {
         memcpy(&gtod0, &time, sizeof gtod0);
+    }
     return ((time.tv_sec - gtod0.tv_sec) * 1000000) + time.tv_usec - gtod0.tv_usec;
 }
 
@@ -58,7 +62,7 @@ extern "C" bool can_yield()
     return true;
 }
 
-extern "C" void optimistic_yield (uint32_t interval_us)
+extern "C" void optimistic_yield(uint32_t interval_us)
 {
     (void)interval_us;
 }
@@ -75,21 +79,24 @@ extern "C" void esp_yield()
 {
 }
 
-extern "C" void esp_delay (unsigned long ms)
+extern "C" void esp_delay(unsigned long ms)
 {
     usleep(ms * 1000);
 }
 
-bool esp_try_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms) {
+bool esp_try_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms)
+{
     uint32_t expired = millis() - start_ms;
-    if (expired >= timeout_ms) {
+    if (expired >= timeout_ms)
+    {
         return true;
     }
     esp_delay(std::min((timeout_ms - expired), intvl_ms));
     return false;
 }
 
-extern "C" void __panic_func(const char* file, int line, const char* func) {
+extern "C" void __panic_func(const char* file, int line, const char* func)
+{
     (void)file;
     (void)line;
     (void)func;
diff --git a/tests/host/common/ArduinoCatch.cpp b/tests/host/common/ArduinoCatch.cpp
index 6a1e3cca23..1f09607f7b 100644
--- a/tests/host/common/ArduinoCatch.cpp
+++ b/tests/host/common/ArduinoCatch.cpp
@@ -1,16 +1,16 @@
 /*
- Arduino.cpp - Mocks for common Arduino APIs
- Copyright © 2016 Ivan Grokhotkov
- 
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- 
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
+    Arduino.cpp - Mocks for common Arduino APIs
+    Copyright © 2016 Ivan Grokhotkov
+
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
 */
 
 #define CATCH_CONFIG_MAIN
diff --git a/tests/host/common/ArduinoMain.cpp b/tests/host/common/ArduinoMain.cpp
index ddda929d46..e4c966e29b 100644
--- a/tests/host/common/ArduinoMain.cpp
+++ b/tests/host/common/ArduinoMain.cpp
@@ -1,32 +1,32 @@
 /*
- Arduino emulator main loop
- Copyright (c) 2018 david gauchard. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal with the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- - Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimers.
-
- - Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimers in the
-   documentation and/or other materials provided with the distribution.
-
- - The names of its contributors may not be used to endorse or promote
-   products derived from this Software without specific prior written
-   permission.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS WITH THE SOFTWARE.
+    Arduino emulator main loop
+    Copyright (c) 2018 david gauchard. All rights reserved.
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal with the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+
+    - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimers.
+
+    - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimers in the
+    documentation and/or other materials provided with the distribution.
+
+    - The names of its contributors may not be used to endorse or promote
+    products derived from this Software without specific prior written
+    permission.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS WITH THE SOFTWARE.
 */
 
 #include <Arduino.h>
@@ -56,265 +56,287 @@ const char* fspath = nullptr;
 
 static struct termios initial_settings;
 
-int mockverbose (const char* fmt, ...)
+int mockverbose(const char* fmt, ...)
 {
-	va_list ap;
-	va_start(ap, fmt);
-	if (mockdebug)
-		return fprintf(stderr, MOCK) + vfprintf(stderr, fmt, ap);
-	return 0;
+    va_list ap;
+    va_start(ap, fmt);
+    if (mockdebug)
+    {
+        return fprintf(stderr, MOCK) + vfprintf(stderr, fmt, ap);
+    }
+    return 0;
 }
 
 static int mock_start_uart(void)
 {
-	struct termios settings;
-
-	if (!isatty(STDIN))
-	{
-		perror("setting tty in raw mode: isatty(STDIN)");
-		return -1;
-	}
-	if (tcgetattr(STDIN, &initial_settings) < 0)
-	{
-		perror("setting tty in raw mode: tcgetattr(STDIN)");
-		return -1;
-	}
-	settings = initial_settings;
-	settings.c_lflag &= ~(ignore_sigint ? ISIG : 0);
-	settings.c_lflag &= ~(ECHO	| ICANON);
-	settings.c_iflag &= ~(ICRNL | INLCR | ISTRIP | IXON);
-	settings.c_oflag |=	(ONLCR);
-	settings.c_cc[VMIN]	= 0;
-	settings.c_cc[VTIME] = 0;
-	if (tcsetattr(STDIN, TCSANOW, &settings) < 0)
-	{
-		perror("setting tty in raw mode: tcsetattr(STDIN)");
-		return -1;
-	}
-	restore_tty = true;
-	return 0;
+    struct termios settings;
+
+    if (!isatty(STDIN))
+    {
+        perror("setting tty in raw mode: isatty(STDIN)");
+        return -1;
+    }
+    if (tcgetattr(STDIN, &initial_settings) < 0)
+    {
+        perror("setting tty in raw mode: tcgetattr(STDIN)");
+        return -1;
+    }
+    settings = initial_settings;
+    settings.c_lflag &= ~(ignore_sigint ? ISIG : 0);
+    settings.c_lflag &= ~(ECHO	| ICANON);
+    settings.c_iflag &= ~(ICRNL | INLCR | ISTRIP | IXON);
+    settings.c_oflag |=	(ONLCR);
+    settings.c_cc[VMIN]	= 0;
+    settings.c_cc[VTIME] = 0;
+    if (tcsetattr(STDIN, TCSANOW, &settings) < 0)
+    {
+        perror("setting tty in raw mode: tcsetattr(STDIN)");
+        return -1;
+    }
+    restore_tty = true;
+    return 0;
 }
 
 static int mock_stop_uart(void)
 {
-	if (!restore_tty) return 0;
-	if (!isatty(STDIN)) {
-		perror("restoring tty: isatty(STDIN)");
-		return -1;
-	}
-	if (tcsetattr(STDIN, TCSANOW, &initial_settings) < 0)
-	{
-		perror("restoring tty: tcsetattr(STDIN)");
-		return -1;
-	}
-	printf("\e[?25h"); // show cursor
-	return (0);
+    if (!restore_tty)
+    {
+        return 0;
+    }
+    if (!isatty(STDIN))
+    {
+        perror("restoring tty: isatty(STDIN)");
+        return -1;
+    }
+    if (tcsetattr(STDIN, TCSANOW, &initial_settings) < 0)
+    {
+        perror("restoring tty: tcsetattr(STDIN)");
+        return -1;
+    }
+    printf("\e[?25h"); // show cursor
+    return (0);
 }
 
 static uint8_t mock_read_uart(void)
 {
-	uint8_t ch = 0;
-	return (read(STDIN, &ch, 1) == 1) ? ch : 0;
+    uint8_t ch = 0;
+    return (read(STDIN, &ch, 1) == 1) ? ch : 0;
 }
 
-void help (const char* argv0, int exitcode)
+void help(const char* argv0, int exitcode)
 {
-	printf(
-		"%s - compiled with esp8266/arduino emulator\n"
-		"options:\n"
-		"\t-h\n"
-		"\tnetwork:\n"
-		"\t-i <interface> - use this interface for IP address\n"
-		"\t-l             - bind tcp/udp servers to interface only (not 0.0.0.0)\n"
-		"\t-s             - port shifter (default: %d, when root: 0)\n"
+    printf(
+        "%s - compiled with esp8266/arduino emulator\n"
+        "options:\n"
+        "\t-h\n"
+        "\tnetwork:\n"
+        "\t-i <interface> - use this interface for IP address\n"
+        "\t-l             - bind tcp/udp servers to interface only (not 0.0.0.0)\n"
+        "\t-s             - port shifter (default: %d, when root: 0)\n"
         "\tterminal:\n"
-		"\t-b             - blocking tty/mocked-uart (default: not blocking tty)\n"
-		"\t-T             - show timestamp on output\n"
-		"\tFS:\n"
-		"\t-P             - path for fs-persistent files (default: %s-)\n"
-		"\t-S             - spiffs size in KBytes (default: %zd)\n"
-		"\t-L             - littlefs size in KBytes (default: %zd)\n"
-		"\t                 (spiffs, littlefs: negative value will force mismatched size)\n"
+        "\t-b             - blocking tty/mocked-uart (default: not blocking tty)\n"
+        "\t-T             - show timestamp on output\n"
+        "\tFS:\n"
+        "\t-P             - path for fs-persistent files (default: %s-)\n"
+        "\t-S             - spiffs size in KBytes (default: %zd)\n"
+        "\t-L             - littlefs size in KBytes (default: %zd)\n"
+        "\t                 (spiffs, littlefs: negative value will force mismatched size)\n"
         "\tgeneral:\n"
-		"\t-c             - ignore CTRL-C (send it via Serial)\n"
-		"\t-f             - no throttle (possibly 100%%CPU)\n"
-		"\t-1             - run loop once then exit (for host testing)\n"
-		"\t-v             - verbose\n"
-		, argv0, MOCK_PORT_SHIFTER, argv0, spiffs_kb, littlefs_kb);
-	exit(exitcode);
+        "\t-c             - ignore CTRL-C (send it via Serial)\n"
+        "\t-f             - no throttle (possibly 100%%CPU)\n"
+        "\t-1             - run loop once then exit (for host testing)\n"
+        "\t-v             - verbose\n"
+        , argv0, MOCK_PORT_SHIFTER, argv0, spiffs_kb, littlefs_kb);
+    exit(exitcode);
 }
 
 static struct option options[] =
 {
-	{ "help",           no_argument,        NULL, 'h' },
-	{ "fast",           no_argument,        NULL, 'f' },
-	{ "local",          no_argument,        NULL, 'l' },
-	{ "sigint",         no_argument,        NULL, 'c' },
-	{ "blockinguart",   no_argument,        NULL, 'b' },
-	{ "verbose",        no_argument,        NULL, 'v' },
-	{ "timestamp",      no_argument,        NULL, 'T' },
-	{ "interface",      required_argument,  NULL, 'i' },
-	{ "fspath",         required_argument,  NULL, 'P' },
-	{ "spiffskb",       required_argument,  NULL, 'S' },
-	{ "littlefskb",     required_argument,  NULL, 'L' },
-	{ "portshifter",    required_argument,  NULL, 's' },
-	{ "once",           no_argument,        NULL, '1' },
+    { "help",           no_argument,        NULL, 'h' },
+    { "fast",           no_argument,        NULL, 'f' },
+    { "local",          no_argument,        NULL, 'l' },
+    { "sigint",         no_argument,        NULL, 'c' },
+    { "blockinguart",   no_argument,        NULL, 'b' },
+    { "verbose",        no_argument,        NULL, 'v' },
+    { "timestamp",      no_argument,        NULL, 'T' },
+    { "interface",      required_argument,  NULL, 'i' },
+    { "fspath",         required_argument,  NULL, 'P' },
+    { "spiffskb",       required_argument,  NULL, 'S' },
+    { "littlefskb",     required_argument,  NULL, 'L' },
+    { "portshifter",    required_argument,  NULL, 's' },
+    { "once",           no_argument,        NULL, '1' },
 };
 
-void cleanup ()
+void cleanup()
 {
-	mock_stop_spiffs();
-	mock_stop_littlefs();
-	mock_stop_uart();
+    mock_stop_spiffs();
+    mock_stop_littlefs();
+    mock_stop_uart();
 }
 
-void make_fs_filename (String& name, const char* fspath, const char* argv0)
+void make_fs_filename(String& name, const char* fspath, const char* argv0)
 {
-	name.clear();
-	if (fspath)
-	{
-		int lastSlash = -1;
-		for (int i = 0; argv0[i]; i++)
-			if (argv0[i] == '/')
-				lastSlash = i;
-		name = fspath;
-		name += '/';
-		name += &argv0[lastSlash + 1];
-	}
-	else
-		name = argv0;
+    name.clear();
+    if (fspath)
+    {
+        int lastSlash = -1;
+        for (int i = 0; argv0[i]; i++)
+            if (argv0[i] == '/')
+            {
+                lastSlash = i;
+            }
+        name = fspath;
+        name += '/';
+        name += &argv0[lastSlash + 1];
+    }
+    else
+    {
+        name = argv0;
+    }
 }
 
-void control_c (int sig)
+void control_c(int sig)
 {
-	(void)sig;
-
-	if (user_exit)
-	{
-		fprintf(stderr, MOCK "stuck, killing\n");
-		cleanup();
-		exit(1);
-	}
-	user_exit = true;
+    (void)sig;
+
+    if (user_exit)
+    {
+        fprintf(stderr, MOCK "stuck, killing\n");
+        cleanup();
+        exit(1);
+    }
+    user_exit = true;
 }
 
-int main (int argc, char* const argv [])
+int main(int argc, char* const argv [])
 {
-	bool fast = false;
-	blocking_uart = false; // global
-
-	signal(SIGINT, control_c);
-	signal(SIGTERM, control_c);
-	if (geteuid() == 0)
-		mock_port_shifter = 0;
-	else
-		mock_port_shifter = MOCK_PORT_SHIFTER;
-
-	for (;;)
-	{
-		int n = getopt_long(argc, argv, "hlcfbvTi:S:s:L:P:1", options, NULL);
-		if (n < 0)
-			break;
-		switch (n)
-		{
-		case 'h':
-			help(argv[0], EXIT_SUCCESS);
-			break;
-		case 'i':
-			host_interface = optarg;
-			break;
-		case 'l':
-			global_ipv4_netfmt = NO_GLOBAL_BINDING;
-			break;
-		case 's':
-			mock_port_shifter = atoi(optarg);
-			break;
-		case 'c':
-			ignore_sigint = true;
-			break;
-		case 'f':
-			fast = true;
-			break;
-		case 'S':
-			spiffs_kb = atoi(optarg);
-			break;
-		case 'L':
-			littlefs_kb = atoi(optarg);
-			break;
-		case 'P':
-			fspath = optarg;
-			break;
-		case 'b':
-			blocking_uart = true;
-			break;
-		case 'v':
-			mockdebug = true;
-			break;
-		case 'T':
-			serial_timestamp = true;
-			break;
-		case '1':
-			run_once = true;
-			break;
-		default:
-			help(argv[0], EXIT_FAILURE);
-		}
-	}
-
-	mockverbose("server port shifter: %d\n", mock_port_shifter);
-
-	if (spiffs_kb)
-	{
-		String name;
-		make_fs_filename(name, fspath, argv[0]);
-		name += "-spiffs";
-		name += String(spiffs_kb > 0? spiffs_kb: -spiffs_kb, DEC);
-		name += "KB";
-		mock_start_spiffs(name, spiffs_kb);
-	}
-
-	if (littlefs_kb)
-	{
-		String name;
-		make_fs_filename(name, fspath, argv[0]);
-		name += "-littlefs";
-		name += String(littlefs_kb > 0? littlefs_kb: -littlefs_kb, DEC);
-		name += "KB";
-		mock_start_littlefs(name, littlefs_kb);
-	}
-
-	// setup global global_ipv4_netfmt
-	wifi_get_ip_info(0, nullptr);
-
-	if (!blocking_uart)
-	{
-		// set stdin to non blocking mode
-		mock_start_uart();
-	}
-
-	// install exit handler in case Esp.restart() is called
-	atexit(cleanup);
-
-	// first call to millis(): now is millis() and micros() beginning
-	millis();
-
-	setup();
-	while (!user_exit)
-	{
-		uint8_t data = mock_read_uart();
-
-		if (data)
-			uart_new_data(UART0, data);
-		if (!fast)
-			usleep(1000); // not 100% cpu, ~1000 loops per second
-		loop();
-		loop_end();
-		check_incoming_udp();
-
-		if (run_once)
-			user_exit = true;
-	}
-	cleanup();
-
-	return 0;
+    bool fast = false;
+    blocking_uart = false; // global
+
+    signal(SIGINT, control_c);
+    signal(SIGTERM, control_c);
+    if (geteuid() == 0)
+    {
+        mock_port_shifter = 0;
+    }
+    else
+    {
+        mock_port_shifter = MOCK_PORT_SHIFTER;
+    }
+
+    for (;;)
+    {
+        int n = getopt_long(argc, argv, "hlcfbvTi:S:s:L:P:1", options, NULL);
+        if (n < 0)
+        {
+            break;
+        }
+        switch (n)
+        {
+        case 'h':
+            help(argv[0], EXIT_SUCCESS);
+            break;
+        case 'i':
+            host_interface = optarg;
+            break;
+        case 'l':
+            global_ipv4_netfmt = NO_GLOBAL_BINDING;
+            break;
+        case 's':
+            mock_port_shifter = atoi(optarg);
+            break;
+        case 'c':
+            ignore_sigint = true;
+            break;
+        case 'f':
+            fast = true;
+            break;
+        case 'S':
+            spiffs_kb = atoi(optarg);
+            break;
+        case 'L':
+            littlefs_kb = atoi(optarg);
+            break;
+        case 'P':
+            fspath = optarg;
+            break;
+        case 'b':
+            blocking_uart = true;
+            break;
+        case 'v':
+            mockdebug = true;
+            break;
+        case 'T':
+            serial_timestamp = true;
+            break;
+        case '1':
+            run_once = true;
+            break;
+        default:
+            help(argv[0], EXIT_FAILURE);
+        }
+    }
+
+    mockverbose("server port shifter: %d\n", mock_port_shifter);
+
+    if (spiffs_kb)
+    {
+        String name;
+        make_fs_filename(name, fspath, argv[0]);
+        name += "-spiffs";
+        name += String(spiffs_kb > 0 ? spiffs_kb : -spiffs_kb, DEC);
+        name += "KB";
+        mock_start_spiffs(name, spiffs_kb);
+    }
+
+    if (littlefs_kb)
+    {
+        String name;
+        make_fs_filename(name, fspath, argv[0]);
+        name += "-littlefs";
+        name += String(littlefs_kb > 0 ? littlefs_kb : -littlefs_kb, DEC);
+        name += "KB";
+        mock_start_littlefs(name, littlefs_kb);
+    }
+
+    // setup global global_ipv4_netfmt
+    wifi_get_ip_info(0, nullptr);
+
+    if (!blocking_uart)
+    {
+        // set stdin to non blocking mode
+        mock_start_uart();
+    }
+
+    // install exit handler in case Esp.restart() is called
+    atexit(cleanup);
+
+    // first call to millis(): now is millis() and micros() beginning
+    millis();
+
+    setup();
+    while (!user_exit)
+    {
+        uint8_t data = mock_read_uart();
+
+        if (data)
+        {
+            uart_new_data(UART0, data);
+        }
+        if (!fast)
+        {
+            usleep(1000);    // not 100% cpu, ~1000 loops per second
+        }
+        loop();
+        loop_end();
+        check_incoming_udp();
+
+        if (run_once)
+        {
+            user_exit = true;
+        }
+    }
+    cleanup();
+
+    return 0;
 }
diff --git a/tests/host/common/ArduinoMainLittlefs.cpp b/tests/host/common/ArduinoMainLittlefs.cpp
index bf040a2fc5..36a685e50e 100644
--- a/tests/host/common/ArduinoMainLittlefs.cpp
+++ b/tests/host/common/ArduinoMainLittlefs.cpp
@@ -3,15 +3,17 @@
 
 LittleFSMock* littlefs_mock = nullptr;
 
-void mock_start_littlefs (const String& fname, size_t size_kb, size_t block_kb, size_t page_b)
+void mock_start_littlefs(const String& fname, size_t size_kb, size_t block_kb, size_t page_b)
 {
-	littlefs_mock = new LittleFSMock(size_kb * 1024, block_kb * 1024, page_b, fname);
+    littlefs_mock = new LittleFSMock(size_kb * 1024, block_kb * 1024, page_b, fname);
 }
 
-void mock_stop_littlefs ()
+void mock_stop_littlefs()
 {
-	if (littlefs_mock)
-		delete littlefs_mock;
-	littlefs_mock = nullptr;
+    if (littlefs_mock)
+    {
+        delete littlefs_mock;
+    }
+    littlefs_mock = nullptr;
 }
 
diff --git a/tests/host/common/ArduinoMainSpiffs.cpp b/tests/host/common/ArduinoMainSpiffs.cpp
index 1e5099d0ff..27e34baee7 100644
--- a/tests/host/common/ArduinoMainSpiffs.cpp
+++ b/tests/host/common/ArduinoMainSpiffs.cpp
@@ -3,15 +3,17 @@
 
 SpiffsMock* spiffs_mock = nullptr;
 
-void mock_start_spiffs (const String& fname, size_t size_kb, size_t block_kb, size_t page_b)
+void mock_start_spiffs(const String& fname, size_t size_kb, size_t block_kb, size_t page_b)
 {
-	spiffs_mock = new SpiffsMock(size_kb * 1024, block_kb * 1024, page_b, fname);
+    spiffs_mock = new SpiffsMock(size_kb * 1024, block_kb * 1024, page_b, fname);
 }
 
-void mock_stop_spiffs ()
+void mock_stop_spiffs()
 {
-	if (spiffs_mock)
-		delete spiffs_mock;
-	spiffs_mock = nullptr;
+    if (spiffs_mock)
+    {
+        delete spiffs_mock;
+    }
+    spiffs_mock = nullptr;
 }
 
diff --git a/tests/host/common/ArduinoMainUdp.cpp b/tests/host/common/ArduinoMainUdp.cpp
index 6c4a034d2a..2c0bb90841 100644
--- a/tests/host/common/ArduinoMainUdp.cpp
+++ b/tests/host/common/ArduinoMainUdp.cpp
@@ -1,60 +1,64 @@
 /*
- Arduino emulator main loop
- Copyright (c) 2018 david gauchard. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal with the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- - Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimers.
-
- - Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimers in the
-   documentation and/or other materials provided with the distribution.
-
- - The names of its contributors may not be used to endorse or promote
-   products derived from this Software without specific prior written
-   permission.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS WITH THE SOFTWARE.
+    Arduino emulator main loop
+    Copyright (c) 2018 david gauchard. All rights reserved.
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal with the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+
+    - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimers.
+
+    - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimers in the
+    documentation and/or other materials provided with the distribution.
+
+    - The names of its contributors may not be used to endorse or promote
+    products derived from this Software without specific prior written
+    permission.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS WITH THE SOFTWARE.
 */
 
 #include <include/UdpContext.h>
 #include <poll.h>
 #include <map>
 
-std::map<int,UdpContext*> udps;
+std::map<int, UdpContext*> udps;
 
-void register_udp (int sock, UdpContext* udp)
+void register_udp(int sock, UdpContext* udp)
 {
-	if (udp)
-		udps[sock] = udp;
-	else
-		udps.erase(sock);
+    if (udp)
+    {
+        udps[sock] = udp;
+    }
+    else
+    {
+        udps.erase(sock);
+    }
 }
 
-void check_incoming_udp ()
+void check_incoming_udp()
 {
-	// check incoming udp
-	for (auto& udp: udps)
-	{
-		pollfd p;
-		p.fd = udp.first;
-		p.events = POLLIN;
-		if (poll(&p, 1, 0) && p.revents == POLLIN)
-		{
-			mockverbose("UDP poll(%d) -> cb\r", p.fd);
-			udp.second->mock_cb();
-		}
-	}
+    // check incoming udp
+    for (auto& udp : udps)
+    {
+        pollfd p;
+        p.fd = udp.first;
+        p.events = POLLIN;
+        if (poll(&p, 1, 0) && p.revents == POLLIN)
+        {
+            mockverbose("UDP poll(%d) -> cb\r", p.fd);
+            udp.second->mock_cb();
+        }
+    }
 }
diff --git a/tests/host/common/ClientContextSocket.cpp b/tests/host/common/ClientContextSocket.cpp
index 2d1d7c6e83..063952ce24 100644
--- a/tests/host/common/ClientContextSocket.cpp
+++ b/tests/host/common/ClientContextSocket.cpp
@@ -1,33 +1,33 @@
 
 /*
- Arduino emulation - socket part of ClientContext
- Copyright (c) 2018 david gauchard. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal with the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- - Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimers.
-
- - Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimers in the
-   documentation and/or other materials provided with the distribution.
-
- - The names of its contributors may not be used to endorse or promote
-   products derived from this Software without specific prior written
-   permission.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS WITH THE SOFTWARE.
+    Arduino emulation - socket part of ClientContext
+    Copyright (c) 2018 david gauchard. All rights reserved.
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal with the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+
+    - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimers.
+
+    - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimers in the
+    documentation and/or other materials provided with the distribution.
+
+    - The names of its contributors may not be used to endorse or promote
+    products derived from this Software without specific prior written
+    permission.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS WITH THE SOFTWARE.
 */
 // separated from lwIP to avoid type conflicts
 
@@ -39,168 +39,176 @@
 #include <fcntl.h>
 #include <errno.h>
 
-int mockSockSetup (int sock)
+int mockSockSetup(int sock)
 {
-	if (fcntl(sock, F_SETFL, O_NONBLOCK) == -1)
-	{
-		perror("socket fcntl(O_NONBLOCK)");
-		close(sock);
-		return -1;
-	}
+    if (fcntl(sock, F_SETFL, O_NONBLOCK) == -1)
+    {
+        perror("socket fcntl(O_NONBLOCK)");
+        close(sock);
+        return -1;
+    }
 
 #ifndef MSG_NOSIGNAL
-	int i = 1;
-	if (setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof i) == -1)
-	{
-		perror("sockopt(SO_NOSIGPIPE)(macOS)");
-		close(sock);
-		return -1;
-	}
+    int i = 1;
+    if (setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof i) == -1)
+    {
+        perror("sockopt(SO_NOSIGPIPE)(macOS)");
+        close(sock);
+        return -1;
+    }
 #endif
 
-	return sock;
+    return sock;
 }
 
-int mockConnect (uint32_t ipv4, int& sock, int port)
+int mockConnect(uint32_t ipv4, int& sock, int port)
 {
-	struct sockaddr_in server;
-	if ((sock = ::socket(AF_INET, SOCK_STREAM, 0)) == -1)
-	{
-		perror(MOCK "ClientContext:connect: ::socket()");
-		return 0;
-	}
-	server.sin_family = AF_INET;
-	server.sin_port = htons(port);
-	memcpy(&server.sin_addr, &ipv4, 4);
-	if (::connect(sock, (struct sockaddr*)&server, sizeof(server)) == -1)
-	{
-		perror(MOCK "ClientContext::connect: ::connect()");
-		return 0;
-	}
-
-	return mockSockSetup(sock) == -1? 0: 1;
+    struct sockaddr_in server;
+    if ((sock = ::socket(AF_INET, SOCK_STREAM, 0)) == -1)
+    {
+        perror(MOCK "ClientContext:connect: ::socket()");
+        return 0;
+    }
+    server.sin_family = AF_INET;
+    server.sin_port = htons(port);
+    memcpy(&server.sin_addr, &ipv4, 4);
+    if (::connect(sock, (struct sockaddr*)&server, sizeof(server)) == -1)
+    {
+        perror(MOCK "ClientContext::connect: ::connect()");
+        return 0;
+    }
+
+    return mockSockSetup(sock) == -1 ? 0 : 1;
 }
 
-ssize_t mockFillInBuf (int sock, char* ccinbuf, size_t& ccinbufsize)
+ssize_t mockFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize)
 {
-	size_t maxread = CCBUFSIZE - ccinbufsize;
-	ssize_t ret = ::read(sock, ccinbuf + ccinbufsize, maxread);
-
-	if (ret == 0)
-	{
-		// connection closed
-		// nothing is read
-		return 0;
-	}
-
-	if (ret == -1)
-	{
-		if (errno != EAGAIN)
-		{
-			fprintf(stderr, MOCK "ClientContext::(read/peek fd=%i): filling buffer for %zd bytes: %s\n", sock, maxread, strerror(errno));
+    size_t maxread = CCBUFSIZE - ccinbufsize;
+    ssize_t ret = ::read(sock, ccinbuf + ccinbufsize, maxread);
+
+    if (ret == 0)
+    {
+        // connection closed
+        // nothing is read
+        return 0;
+    }
+
+    if (ret == -1)
+    {
+        if (errno != EAGAIN)
+        {
+            fprintf(stderr, MOCK "ClientContext::(read/peek fd=%i): filling buffer for %zd bytes: %s\n", sock, maxread, strerror(errno));
             // error
-			return -1;
-		}
-		ret = 0;
-	}
+            return -1;
+        }
+        ret = 0;
+    }
 
-	ccinbufsize += ret;
-	return ret;
+    ccinbufsize += ret;
+    return ret;
 }
 
-ssize_t mockPeekBytes (int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+ssize_t mockPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
 {
     // usersize==0: peekAvailable()
 
-	if (usersize > CCBUFSIZE)
-		mockverbose("CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
-
-	struct pollfd p;
-	size_t retsize = 0;
-	do
-	{
-		if (usersize && usersize <= ccinbufsize)
-		{
-			// data already buffered
-			retsize = usersize;
-			break;
-		}
-		
-		// check incoming data data
-		if (mockFillInBuf(sock, ccinbuf, ccinbufsize) < 0)
-		{
-			return -1;
-	    }
+    if (usersize > CCBUFSIZE)
+    {
+        mockverbose("CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
+    }
+
+    struct pollfd p;
+    size_t retsize = 0;
+    do
+    {
+        if (usersize && usersize <= ccinbufsize)
+        {
+            // data already buffered
+            retsize = usersize;
+            break;
+        }
+
+        // check incoming data data
+        if (mockFillInBuf(sock, ccinbuf, ccinbufsize) < 0)
+        {
+            return -1;
+        }
 
         if (usersize == 0 && ccinbufsize)
             // peekAvailable
+        {
             return ccinbufsize;
+        }
+
+        if (usersize <= ccinbufsize)
+        {
+            // data just received
+            retsize = usersize;
+            break;
+        }
+
+        // wait for more data until timeout
+        p.fd = sock;
+        p.events = POLLIN;
+    } while (poll(&p, 1, timeout_ms) == 1);
 
-		if (usersize <= ccinbufsize)
-		{
-			// data just received
-			retsize = usersize;
-			break;
-		}
-		
-		// wait for more data until timeout
-		p.fd = sock;
-		p.events = POLLIN;
-	} while (poll(&p, 1, timeout_ms) == 1);
-	
     if (dst)
     {
         memcpy(dst, ccinbuf, retsize);
     }
 
-	return retsize;
+    return retsize;
 }
 
-ssize_t mockRead (int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+ssize_t mockRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
 {
-	ssize_t copied = mockPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
-	if (copied < 0)
-		return -1;
-	// swallow (XXX use a circular buffer)
-	memmove(ccinbuf, ccinbuf + copied, ccinbufsize - copied);
-	ccinbufsize -= copied;
-	return copied;
+    ssize_t copied = mockPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
+    if (copied < 0)
+    {
+        return -1;
+    }
+    // swallow (XXX use a circular buffer)
+    memmove(ccinbuf, ccinbuf + copied, ccinbufsize - copied);
+    ccinbufsize -= copied;
+    return copied;
 }
-	
-ssize_t mockWrite (int sock, const uint8_t* data, size_t size, int timeout_ms)
+
+ssize_t mockWrite(int sock, const uint8_t* data, size_t size, int timeout_ms)
 {
-	size_t sent = 0;
-	while (sent < size)
-	{
-
-		struct pollfd p;
-		p.fd = sock;
-		p.events = POLLOUT;
-		int ret = poll(&p, 1, timeout_ms);
-		if (ret == -1)
-		{
-			fprintf(stderr, MOCK "ClientContext::write(%d): %s\n", sock, strerror(errno));
-			return -1;
-		}
-		if (ret)
-		{
+    size_t sent = 0;
+    while (sent < size)
+    {
+
+        struct pollfd p;
+        p.fd = sock;
+        p.events = POLLOUT;
+        int ret = poll(&p, 1, timeout_ms);
+        if (ret == -1)
+        {
+            fprintf(stderr, MOCK "ClientContext::write(%d): %s\n", sock, strerror(errno));
+            return -1;
+        }
+        if (ret)
+        {
 #ifndef MSG_NOSIGNAL
-			ret = ::write(sock, data + sent, size - sent);
+            ret = ::write(sock, data + sent, size - sent);
 #else
-			ret = ::send(sock, data + sent, size - sent, MSG_NOSIGNAL);
+            ret = ::send(sock, data + sent, size - sent, MSG_NOSIGNAL);
 #endif
-			if (ret == -1)
-			{
-				fprintf(stderr, MOCK "ClientContext::write/send(%d): %s\n", sock, strerror(errno));
-				return -1;
-			}
-			sent += ret;
-			if (sent < size)
-				fprintf(stderr, MOCK "ClientContext::write: sent %d bytes (%zd / %zd)\n", ret, sent, size);
-		}
-	}
+            if (ret == -1)
+            {
+                fprintf(stderr, MOCK "ClientContext::write/send(%d): %s\n", sock, strerror(errno));
+                return -1;
+            }
+            sent += ret;
+            if (sent < size)
+            {
+                fprintf(stderr, MOCK "ClientContext::write: sent %d bytes (%zd / %zd)\n", ret, sent, size);
+            }
+        }
+    }
 #ifdef DEBUG_ESP_WIFI
     mockverbose(MOCK "ClientContext::write: total sent %zd bytes\n", sent);
 #endif
-	return sent;
+    return sent;
 }
diff --git a/tests/host/common/ClientContextTools.cpp b/tests/host/common/ClientContextTools.cpp
index ccc06b56d9..bf4bc348c0 100644
--- a/tests/host/common/ClientContextTools.cpp
+++ b/tests/host/common/ClientContextTools.cpp
@@ -1,32 +1,32 @@
 /*
- Arduino emulation - part of ClientContext
- Copyright (c) 2018 david gauchard. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal with the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- - Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimers.
-
- - Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimers in the
-   documentation and/or other materials provided with the distribution.
-
- - The names of its contributors may not be used to endorse or promote
-   products derived from this Software without specific prior written
-   permission.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS WITH THE SOFTWARE.
+    Arduino emulation - part of ClientContext
+    Copyright (c) 2018 david gauchard. All rights reserved.
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal with the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+
+    - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimers.
+
+    - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimers in the
+    documentation and/or other materials provided with the distribution.
+
+    - The names of its contributors may not be used to endorse or promote
+    products derived from this Software without specific prior written
+    permission.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS WITH THE SOFTWARE.
 */
 
 #include <lwip/def.h>
@@ -39,19 +39,21 @@
 
 err_t dns_gethostbyname(const char *hostname, ip_addr_t *addr, dns_found_callback found, void *callback_arg)
 {
-	(void)callback_arg;
-	(void)found;
-	struct hostent* hbn = gethostbyname(hostname);
-	if (!hbn)
-		return ERR_TIMEOUT;
-	addr->addr = *(uint32_t*)hbn->h_addr_list[0];
-	return ERR_OK;
+    (void)callback_arg;
+    (void)found;
+    struct hostent* hbn = gethostbyname(hostname);
+    if (!hbn)
+    {
+        return ERR_TIMEOUT;
+    }
+    addr->addr = *(uint32_t*)hbn->h_addr_list[0];
+    return ERR_OK;
 }
 
 static struct tcp_pcb mock_tcp_pcb;
-tcp_pcb* tcp_new (void)
+tcp_pcb* tcp_new(void)
 {
-	// this is useless
-	// ClientContext is setting the source port and we don't care here
-	return &mock_tcp_pcb;
+    // this is useless
+    // ClientContext is setting the source port and we don't care here
+    return &mock_tcp_pcb;
 }
diff --git a/tests/host/common/EEPROM.h b/tests/host/common/EEPROM.h
index a1e47546de..2e91bc10c1 100644
--- a/tests/host/common/EEPROM.h
+++ b/tests/host/common/EEPROM.h
@@ -1,77 +1,92 @@
 /*
- Arduino EEPROM emulation
- Copyright (c) 2018 david gauchard. All rights reserved.
+    Arduino EEPROM emulation
+    Copyright (c) 2018 david gauchard. All rights reserved.
 
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal with the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal with the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
 
- - Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimers.
+    - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimers.
 
- - Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimers in the
-   documentation and/or other materials provided with the distribution.
+    - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimers in the
+    documentation and/or other materials provided with the distribution.
 
- - The names of its contributors may not be used to endorse or promote
-   products derived from this Software without specific prior written
-   permission.
+    - The names of its contributors may not be used to endorse or promote
+    products derived from this Software without specific prior written
+    permission.
 
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS WITH THE SOFTWARE.
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS WITH THE SOFTWARE.
 */
 
 #ifndef EEPROM_MOCK
 #define EEPROM_MOCK
 
-class EEPROMClass {
+class EEPROMClass
+{
 public:
-  EEPROMClass(uint32_t sector);
-  EEPROMClass(void);
-  ~EEPROMClass();
+    EEPROMClass(uint32_t sector);
+    EEPROMClass(void);
+    ~EEPROMClass();
 
-  void begin(size_t size);
-  uint8_t read(int address);
-  void write(int address, uint8_t val);
-  bool commit();
-  void end();
+    void begin(size_t size);
+    uint8_t read(int address);
+    void write(int address, uint8_t val);
+    bool commit();
+    void end();
 
-  template<typename T> 
-  T& get(int const address, T& t)
-  {
-    if (address < 0 || address + sizeof(T) > _size)
-      return t;
-    for (size_t i = 0; i < sizeof(T); i++)
-        ((uint8_t*)&t)[i] = read(i);
-    return t;
-  }
+    template<typename T>
+    T& get(int const address, T& t)
+    {
+        if (address < 0 || address + sizeof(T) > _size)
+        {
+            return t;
+        }
+        for (size_t i = 0; i < sizeof(T); i++)
+        {
+            ((uint8_t*)&t)[i] = read(i);
+        }
+        return t;
+    }
 
-  template<typename T> 
-  const T& put(int const address, const T& t)
-  {
-    if (address < 0 || address + sizeof(T) > _size)
-      return t;
-    for (size_t i = 0; i < sizeof(T); i++)
-        write(i, ((uint8_t*)&t)[i]);
-    return t;
-  }
+    template<typename T>
+    const T& put(int const address, const T& t)
+    {
+        if (address < 0 || address + sizeof(T) > _size)
+        {
+            return t;
+        }
+        for (size_t i = 0; i < sizeof(T); i++)
+        {
+            write(i, ((uint8_t*)&t)[i]);
+        }
+        return t;
+    }
 
-  size_t length() { return _size; }
+    size_t length()
+    {
+        return _size;
+    }
 
-  //uint8_t& operator[](int const address) { return read(address); }
-  uint8_t operator[] (int address) { return read(address); }
+    //uint8_t& operator[](int const address) { return read(address); }
+    uint8_t operator[](int address)
+    {
+        return read(address);
+    }
 
 protected:
-  size_t _size = 0;
-  int _fd = -1;
+    size_t _size = 0;
+    int _fd = -1;
 };
 
 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_EEPROM)
diff --git a/tests/host/common/HostWiring.cpp b/tests/host/common/HostWiring.cpp
index 765d4297b6..e5c84a40a6 100644
--- a/tests/host/common/HostWiring.cpp
+++ b/tests/host/common/HostWiring.cpp
@@ -1,32 +1,32 @@
 /*
- Arduino: wire emulation
- Copyright (c) 2018 david gauchard. All rights reserved.
+    Arduino: wire emulation
+    Copyright (c) 2018 david gauchard. All rights reserved.
 
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal with the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal with the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
 
- - Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimers.
+    - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimers.
 
- - Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimers in the
-   documentation and/or other materials provided with the distribution.
+    - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimers in the
+    documentation and/or other materials provided with the distribution.
 
- - The names of its contributors may not be used to endorse or promote
-   products derived from this Software without specific prior written
-   permission.
+    - The names of its contributors may not be used to endorse or promote
+    products derived from this Software without specific prior written
+    permission.
 
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS WITH THE SOFTWARE.
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS WITH THE SOFTWARE.
 */
 
 #include <Arduino.h>
@@ -37,49 +37,49 @@
 #define VERBOSE(x...) mockverbose(x)
 #endif
 
-void pinMode (uint8_t pin, uint8_t mode)
+void pinMode(uint8_t pin, uint8_t mode)
 {
-	#define xxx(mode) case mode: m=STRHELPER(mode); break
-	const char* m;
-	switch (mode)
-	{
-	case INPUT: m="INPUT"; break;
-	case OUTPUT: m="OUTPUT"; break;
-	case INPUT_PULLUP: m="INPUT_PULLUP"; break;
-	case OUTPUT_OPEN_DRAIN: m="OUTPUT_OPEN_DRAIN"; break;
-	case INPUT_PULLDOWN_16: m="INPUT_PULLDOWN_16"; break;
-	case WAKEUP_PULLUP: m="WAKEUP_PULLUP"; break;
-	case WAKEUP_PULLDOWN: m="WAKEUP_PULLDOWN"; break;
-	default: m="(special)";
-	}
-	VERBOSE("gpio%d: mode='%s'\n", pin, m);
+#define xxx(mode) case mode: m=STRHELPER(mode); break
+    const char* m;
+    switch (mode)
+    {
+    case INPUT: m = "INPUT"; break;
+    case OUTPUT: m = "OUTPUT"; break;
+    case INPUT_PULLUP: m = "INPUT_PULLUP"; break;
+    case OUTPUT_OPEN_DRAIN: m = "OUTPUT_OPEN_DRAIN"; break;
+    case INPUT_PULLDOWN_16: m = "INPUT_PULLDOWN_16"; break;
+    case WAKEUP_PULLUP: m = "WAKEUP_PULLUP"; break;
+    case WAKEUP_PULLDOWN: m = "WAKEUP_PULLDOWN"; break;
+    default: m = "(special)";
+    }
+    VERBOSE("gpio%d: mode='%s'\n", pin, m);
 }
 
 void digitalWrite(uint8_t pin, uint8_t val)
 {
-	VERBOSE("digitalWrite(pin=%d val=%d)\n", pin, val);
+    VERBOSE("digitalWrite(pin=%d val=%d)\n", pin, val);
 }
 
 void analogWrite(uint8_t pin, int val)
 {
-	VERBOSE("analogWrite(pin=%d, val=%d\n", pin, val);
+    VERBOSE("analogWrite(pin=%d, val=%d\n", pin, val);
 }
 
 int analogRead(uint8_t pin)
 {
-	(void)pin;
-	return 512;
+    (void)pin;
+    return 512;
 }
 
 void analogWriteRange(uint32_t range)
 {
-	VERBOSE("analogWriteRange(range=%d)\n", range);
+    VERBOSE("analogWriteRange(range=%d)\n", range);
 }
 
 int digitalRead(uint8_t pin)
 {
-	VERBOSE("digitalRead(%d)\n", pin);
+    VERBOSE("digitalRead(%d)\n", pin);
 
-	// pin 0 is most likely a low active input
-	return pin ? 0 : 1;
+    // pin 0 is most likely a low active input
+    return pin ? 0 : 1;
 }
diff --git a/tests/host/common/MockDigital.cpp b/tests/host/common/MockDigital.cpp
index aa04527ab5..a94e6f2f20 100644
--- a/tests/host/common/MockDigital.cpp
+++ b/tests/host/common/MockDigital.cpp
@@ -1,22 +1,22 @@
 /*
-  digital.c - wiring digital implementation for esp8266
+    digital.c - wiring digital implementation for esp8266
 
-  Copyright (c) 2015 Hristo Gochkov. All rights reserved.
-  This file is part of the esp8266 core for Arduino environment.
+    Copyright (c) 2015 Hristo Gochkov. All rights reserved.
+    This file is part of the esp8266 core for Arduino environment.
 
-  This library is free software; you can redistribute it and/or
-  modify it under the terms of the GNU Lesser General Public
-  License as published by the Free Software Foundation; either
-  version 2.1 of the License, or (at your option) any later version.
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
 
-  This library is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-  Lesser General Public License for more details.
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
 
-  You should have received a copy of the GNU Lesser General Public
-  License along with this library; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 #define ARDUINO_MAIN
 #include "wiring_private.h"
@@ -30,27 +30,35 @@
 
 extern "C" {
 
-static uint8_t _mode[17];
-static uint8_t _gpio[17];
-
-extern void pinMode(uint8_t pin, uint8_t mode) {
-  if (pin < 17) {
-    _mode[pin] = mode;
-  }
-}
-
-extern void digitalWrite(uint8_t pin, uint8_t val) {
-  if (pin < 17) {
-    _gpio[pin] = val;
-  }
-}
-
-extern int digitalRead(uint8_t pin) {
-  if (pin < 17) {
-    return _gpio[pin] != 0;
-  } else {
-    return 0;
-  }
-}
+    static uint8_t _mode[17];
+    static uint8_t _gpio[17];
+
+    extern void pinMode(uint8_t pin, uint8_t mode)
+    {
+        if (pin < 17)
+        {
+            _mode[pin] = mode;
+        }
+    }
+
+    extern void digitalWrite(uint8_t pin, uint8_t val)
+    {
+        if (pin < 17)
+        {
+            _gpio[pin] = val;
+        }
+    }
+
+    extern int digitalRead(uint8_t pin)
+    {
+        if (pin < 17)
+        {
+            return _gpio[pin] != 0;
+        }
+        else
+        {
+            return 0;
+        }
+    }
 
 };
diff --git a/tests/host/common/MockEEPROM.cpp b/tests/host/common/MockEEPROM.cpp
index 6357c73dd2..a4d7e4ac43 100644
--- a/tests/host/common/MockEEPROM.cpp
+++ b/tests/host/common/MockEEPROM.cpp
@@ -1,32 +1,32 @@
 /*
- Arduino emulation - EEPROM
- Copyright (c) 2018 david gauchard. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal with the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- - Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimers.
-
- - Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimers in the
-   documentation and/or other materials provided with the distribution.
-
- - The names of its contributors may not be used to endorse or promote
-   products derived from this Software without specific prior written
-   permission.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS WITH THE SOFTWARE.
+    Arduino emulation - EEPROM
+    Copyright (c) 2018 david gauchard. All rights reserved.
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal with the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+
+    - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimers.
+
+    - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimers in the
+    documentation and/or other materials provided with the distribution.
+
+    - The names of its contributors may not be used to endorse or promote
+    products derived from this Software without specific prior written
+    permission.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS WITH THE SOFTWARE.
 */
 
 #ifndef __EEPROM_H
@@ -42,52 +42,62 @@
 
 #define EEPROM_FILE_NAME "eeprom"
 
-EEPROMClass::EEPROMClass ()
+EEPROMClass::EEPROMClass()
 {
 }
 
-EEPROMClass::~EEPROMClass ()
+EEPROMClass::~EEPROMClass()
 {
-	if (_fd >= 0)
-		close(_fd);
+    if (_fd >= 0)
+    {
+        close(_fd);
+    }
 }
 
 void EEPROMClass::begin(size_t size)
 {
-	_size = size;
-	if (   (_fd = open(EEPROM_FILE_NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1
-	    || ftruncate(_fd, size) == -1)
-	{
-		fprintf(stderr, MOCK "EEPROM: cannot open/create '%s' for r/w: %s\n\r", EEPROM_FILE_NAME, strerror(errno));
-		_fd = -1;
-	}
+    _size = size;
+    if ((_fd = open(EEPROM_FILE_NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1
+            || ftruncate(_fd, size) == -1)
+    {
+        fprintf(stderr, MOCK "EEPROM: cannot open/create '%s' for r/w: %s\n\r", EEPROM_FILE_NAME, strerror(errno));
+        _fd = -1;
+    }
 }
 
 void EEPROMClass::end()
 {
-	if (_fd != -1)
-		close(_fd);
+    if (_fd != -1)
+    {
+        close(_fd);
+    }
 }
 
 bool EEPROMClass::commit()
 {
-	return true;
+    return true;
 }
 
-uint8_t EEPROMClass::read (int x)
+uint8_t EEPROMClass::read(int x)
 {
-	char c = 0;
-	if (pread(_fd, &c, 1, x) != 1)
-		fprintf(stderr, MOCK "eeprom: %s\n\r", strerror(errno));
-	return c;
+    char c = 0;
+    if (pread(_fd, &c, 1, x) != 1)
+    {
+        fprintf(stderr, MOCK "eeprom: %s\n\r", strerror(errno));
+    }
+    return c;
 }
 
-void EEPROMClass::write (int x, uint8_t c)
+void EEPROMClass::write(int x, uint8_t c)
 {
-	if (x > (int)_size)
-		fprintf(stderr, MOCK "### eeprom beyond\r\n");
-	else if (pwrite(_fd, &c, 1, x) != 1)
-		fprintf(stderr, MOCK "eeprom: %s\n\r", strerror(errno));
+    if (x > (int)_size)
+    {
+        fprintf(stderr, MOCK "### eeprom beyond\r\n");
+    }
+    else if (pwrite(_fd, &c, 1, x) != 1)
+    {
+        fprintf(stderr, MOCK "eeprom: %s\n\r", strerror(errno));
+    }
 }
 
 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_EEPROM)
diff --git a/tests/host/common/MockEsp.cpp b/tests/host/common/MockEsp.cpp
index d11a39e940..09e6c9d000 100644
--- a/tests/host/common/MockEsp.cpp
+++ b/tests/host/common/MockEsp.cpp
@@ -1,32 +1,32 @@
 /*
- Arduino emulation - esp8266's core
- Copyright (c) 2018 david gauchard. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal with the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- - Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimers.
-
- - Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimers in the
-   documentation and/or other materials provided with the distribution.
-
- - The names of its contributors may not be used to endorse or promote
-   products derived from this Software without specific prior written
-   permission.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS WITH THE SOFTWARE.
+    Arduino emulation - esp8266's core
+    Copyright (c) 2018 david gauchard. All rights reserved.
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal with the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+
+    - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimers.
+
+    - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimers in the
+    documentation and/or other materials provided with the distribution.
+
+    - The names of its contributors may not be used to endorse or promote
+    products derived from this Software without specific prior written
+    permission.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS WITH THE SOFTWARE.
 */
 
 #include <Esp.h>
@@ -36,195 +36,216 @@
 
 #include <stdlib.h>
 
-unsigned long long operator"" _kHz(unsigned long long x) {
+unsigned long long operator"" _kHz(unsigned long long x)
+{
     return x * 1000;
 }
 
-unsigned long long operator"" _MHz(unsigned long long x) {
+unsigned long long operator"" _MHz(unsigned long long x)
+{
     return x * 1000 * 1000;
 }
 
-unsigned long long operator"" _GHz(unsigned long long x) {
+unsigned long long operator"" _GHz(unsigned long long x)
+{
     return x * 1000 * 1000 * 1000;
 }
 
-unsigned long long operator"" _kBit(unsigned long long x) {
+unsigned long long operator"" _kBit(unsigned long long x)
+{
     return x * 1024;
 }
 
-unsigned long long operator"" _MBit(unsigned long long x) {
+unsigned long long operator"" _MBit(unsigned long long x)
+{
     return x * 1024 * 1024;
 }
 
-unsigned long long operator"" _GBit(unsigned long long x) {
+unsigned long long operator"" _GBit(unsigned long long x)
+{
     return x * 1024 * 1024 * 1024;
 }
 
-unsigned long long operator"" _kB(unsigned long long x) {
+unsigned long long operator"" _kB(unsigned long long x)
+{
     return x * 1024;
 }
 
-unsigned long long operator"" _MB(unsigned long long x) {
+unsigned long long operator"" _MB(unsigned long long x)
+{
     return x * 1024 * 1024;
 }
 
-unsigned long long operator"" _GB(unsigned long long x) {
+unsigned long long operator"" _GB(unsigned long long x)
+{
     return x * 1024 * 1024 * 1024;
 }
 
 uint32_t _SPIFFS_start;
 
-void eboot_command_write (struct eboot_command* cmd)
+void eboot_command_write(struct eboot_command* cmd)
 {
-	(void)cmd;
+    (void)cmd;
 }
 
 EspClass ESP;
 
-void EspClass::restart ()
+void EspClass::restart()
 {
-	mockverbose("Esp.restart(): exiting\n");
-	exit(EXIT_SUCCESS);
+    mockverbose("Esp.restart(): exiting\n");
+    exit(EXIT_SUCCESS);
 }
 
 uint32_t EspClass::getChipId()
 {
-	return 0xee1337;
+    return 0xee1337;
 }
 
 bool EspClass::checkFlashConfig(bool needsEquals)
 {
-	(void) needsEquals;
-	return true;
+    (void) needsEquals;
+    return true;
 }
 
 uint32_t EspClass::getSketchSize()
 {
-	return 400000;
+    return 400000;
 }
 
 uint32_t EspClass::getFreeHeap()
 {
-	return 30000;
+    return 30000;
 }
 
 uint32_t EspClass::getMaxFreeBlockSize()
 {
-	return 20000;
+    return 20000;
 }
 
 String EspClass::getResetReason()
 {
-  return "Power on";
+    return "Power on";
 }
 
 uint32_t EspClass::getFreeSketchSpace()
 {
-  return 4 * 1024 * 1024;
+    return 4 * 1024 * 1024;
 }
 
 const char *EspClass::getSdkVersion()
 {
-  return "2.5.0";
+    return "2.5.0";
 }
 
 uint32_t EspClass::getFlashChipSpeed()
 {
-  return 40;
+    return 40;
 }
 
-void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag) {
-  uint32_t hf = 10 * 1024;
-  float hm = 1 * 1024;
+void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag)
+{
+    uint32_t hf = 10 * 1024;
+    float hm = 1 * 1024;
 
-  if (hfree) *hfree = hf;
-  if (hmax) *hmax = hm;
-  if (hfrag) *hfrag = 100 - (sqrt(hm) * 100) / hf;
+    if (hfree)
+    {
+        *hfree = hf;
+    }
+    if (hmax)
+    {
+        *hmax = hm;
+    }
+    if (hfrag)
+    {
+        *hfrag = 100 - (sqrt(hm) * 100) / hf;
+    }
 }
 
 bool EspClass::flashEraseSector(uint32_t sector)
 {
-	(void) sector;
-	return true;
+    (void) sector;
+    return true;
 }
 
 FlashMode_t EspClass::getFlashChipMode()
 {
-	return FM_DOUT;
+    return FM_DOUT;
 }
 
 FlashMode_t EspClass::magicFlashChipMode(uint8_t byte)
 {
-	(void) byte;
-	return FM_DOUT;
+    (void) byte;
+    return FM_DOUT;
 }
 
 bool EspClass::flashWrite(uint32_t offset, const uint32_t *data, size_t size)
 {
-	(void)offset;
-	(void)data;
-	(void)size;
-	return true;
+    (void)offset;
+    (void)data;
+    (void)size;
+    return true;
 }
 
 bool EspClass::flashWrite(uint32_t offset, const uint8_t *data, size_t size)
 {
-	(void)offset;
-	(void)data;
-	(void)size;
-	return true;
+    (void)offset;
+    (void)data;
+    (void)size;
+    return true;
 }
 
 bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size)
 {
-	(void)offset;
-	(void)data;
-	(void)size;
-	return true;
+    (void)offset;
+    (void)data;
+    (void)size;
+    return true;
 }
 
 bool EspClass::flashRead(uint32_t offset, uint8_t *data, size_t size)
 {
-	(void)offset;
-	(void)data;
-	(void)size;
-	return true;
-}
-
-uint32_t EspClass::magicFlashChipSize(uint8_t byte) {
-    switch(byte & 0x0F) {
-        case 0x0: // 4 Mbit (512KB)
-            return (512_kB);
-        case 0x1: // 2 MBit (256KB)
-            return (256_kB);
-        case 0x2: // 8 MBit (1MB)
-            return (1_MB);
-        case 0x3: // 16 MBit (2MB)
-            return (2_MB);
-        case 0x4: // 32 MBit (4MB)
-            return (4_MB);
-        case 0x8: // 64 MBit (8MB)
-            return (8_MB);
-        case 0x9: // 128 MBit (16MB)
-            return (16_MB);
-        default: // fail?
-            return 0;
+    (void)offset;
+    (void)data;
+    (void)size;
+    return true;
+}
+
+uint32_t EspClass::magicFlashChipSize(uint8_t byte)
+{
+    switch (byte & 0x0F)
+    {
+    case 0x0: // 4 Mbit (512KB)
+        return (512_kB);
+    case 0x1: // 2 MBit (256KB)
+        return (256_kB);
+    case 0x2: // 8 MBit (1MB)
+        return (1_MB);
+    case 0x3: // 16 MBit (2MB)
+        return (2_MB);
+    case 0x4: // 32 MBit (4MB)
+        return (4_MB);
+    case 0x8: // 64 MBit (8MB)
+        return (8_MB);
+    case 0x9: // 128 MBit (16MB)
+        return (16_MB);
+    default: // fail?
+        return 0;
     }
 }
 
 uint32_t EspClass::getFlashChipRealSize(void)
 {
-	return magicFlashChipSize(4);
+    return magicFlashChipSize(4);
 }
 
 uint32_t EspClass::getFlashChipSize(void)
 {
-	return magicFlashChipSize(4);
+    return magicFlashChipSize(4);
 }
 
-String EspClass::getFullVersion ()
+String EspClass::getFullVersion()
 {
-	return "emulation-on-host";
+    return "emulation-on-host";
 }
 
 uint32_t EspClass::getFreeContStack()
diff --git a/tests/host/common/MockSPI.cpp b/tests/host/common/MockSPI.cpp
index 251cad914a..3efef67ac9 100644
--- a/tests/host/common/MockSPI.cpp
+++ b/tests/host/common/MockSPI.cpp
@@ -1,32 +1,32 @@
 /*
- Arduino emulation - spi
- Copyright (c) 2018 david gauchard. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal with the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- - Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimers.
-
- - Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimers in the
-   documentation and/or other materials provided with the distribution.
-
- - The names of its contributors may not be used to endorse or promote
-   products derived from this Software without specific prior written
-   permission.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS WITH THE SOFTWARE.
+    Arduino emulation - spi
+    Copyright (c) 2018 david gauchard. All rights reserved.
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal with the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+
+    - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimers.
+
+    - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimers in the
+    documentation and/or other materials provided with the distribution.
+
+    - The names of its contributors may not be used to endorse or promote
+    products derived from this Software without specific prior written
+    permission.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS WITH THE SOFTWARE.
 */
 
 #include <SPI.h>
@@ -35,13 +35,13 @@
 SPIClass SPI;
 #endif
 
-SPIClass::SPIClass ()
+SPIClass::SPIClass()
 {
 }
 
 uint8_t SPIClass::transfer(uint8_t data)
 {
-	return data;
+    return data;
 }
 
 void SPIClass::begin()
@@ -54,10 +54,10 @@ void SPIClass::end()
 
 void SPIClass::setFrequency(uint32_t freq)
 {
-	(void)freq;
+    (void)freq;
 }
 
 void SPIClass::setHwCs(bool use)
 {
-	(void)use;
+    (void)use;
 }
diff --git a/tests/host/common/MockTools.cpp b/tests/host/common/MockTools.cpp
index 5eb7969de7..a41b7521bc 100644
--- a/tests/host/common/MockTools.cpp
+++ b/tests/host/common/MockTools.cpp
@@ -1,32 +1,32 @@
 /*
- Arduino emulation - tools
- Copyright (c) 2018 david gauchard. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal with the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- - Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimers.
-
- - Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimers in the
-   documentation and/or other materials provided with the distribution.
-
- - The names of its contributors may not be used to endorse or promote
-   products derived from this Software without specific prior written
-   permission.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS WITH THE SOFTWARE.
+    Arduino emulation - tools
+    Copyright (c) 2018 david gauchard. All rights reserved.
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal with the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+
+    - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimers.
+
+    - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimers in the
+    documentation and/or other materials provided with the distribution.
+
+    - The names of its contributors may not be used to endorse or promote
+    products derived from this Software without specific prior written
+    permission.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS WITH THE SOFTWARE.
 */
 
 #include <arpa/inet.h>
@@ -35,46 +35,82 @@
 extern "C"
 {
 
-uint32_t lwip_htonl (uint32_t hostlong)  { return htonl(hostlong);  }
-uint16_t lwip_htons (uint16_t hostshort) { return htons(hostshort); }
-uint32_t lwip_ntohl (uint32_t netlong)   { return ntohl(netlong);   }
-uint16_t lwip_ntohs (uint16_t netshort)  { return ntohs(netshort);  }
-
-char* ets_strcpy (char* d, const char* s) { return strcpy(d, s); }
-char* ets_strncpy (char* d, const char* s, size_t n) { return strncpy(d, s, n); }
-size_t ets_strlen (const char* s) { return strlen(s); }
-
-int ets_printf (const char* fmt, ...)
-{
+    uint32_t lwip_htonl(uint32_t hostlong)
+    {
+        return htonl(hostlong);
+    }
+    uint16_t lwip_htons(uint16_t hostshort)
+    {
+        return htons(hostshort);
+    }
+    uint32_t lwip_ntohl(uint32_t netlong)
+    {
+        return ntohl(netlong);
+    }
+    uint16_t lwip_ntohs(uint16_t netshort)
+    {
+        return ntohs(netshort);
+    }
+
+    char* ets_strcpy(char* d, const char* s)
+    {
+        return strcpy(d, s);
+    }
+    char* ets_strncpy(char* d, const char* s, size_t n)
+    {
+        return strncpy(d, s, n);
+    }
+    size_t ets_strlen(const char* s)
+    {
+        return strlen(s);
+    }
+
+    int ets_printf(const char* fmt, ...)
+    {
         va_list ap;
         va_start(ap, fmt);
-	int len = vprintf(fmt, ap);
-	va_end(ap);
-	return len;
-}
-
-void stack_thunk_add_ref() { }
-void stack_thunk_del_ref() { }
-void stack_thunk_repaint() { }
-
-uint32_t stack_thunk_get_refcnt() { return 0; }
-uint32_t stack_thunk_get_stack_top() { return 0; }
-uint32_t stack_thunk_get_stack_bot() { return 0; }
-uint32_t stack_thunk_get_cont_sp() { return 0; }
-uint32_t stack_thunk_get_max_usage() { return 0; }
-void stack_thunk_dump_stack() { }
-
-// Thunking macro
+        int len = vprintf(fmt, ap);
+        va_end(ap);
+        return len;
+    }
+
+    void stack_thunk_add_ref() { }
+    void stack_thunk_del_ref() { }
+    void stack_thunk_repaint() { }
+
+    uint32_t stack_thunk_get_refcnt()
+    {
+        return 0;
+    }
+    uint32_t stack_thunk_get_stack_top()
+    {
+        return 0;
+    }
+    uint32_t stack_thunk_get_stack_bot()
+    {
+        return 0;
+    }
+    uint32_t stack_thunk_get_cont_sp()
+    {
+        return 0;
+    }
+    uint32_t stack_thunk_get_max_usage()
+    {
+        return 0;
+    }
+    void stack_thunk_dump_stack() { }
+
+    // Thunking macro
 #define make_stack_thunk(fcnToThunk)
 
 };
 
 void configTime(int timezone, int daylightOffset_sec,
-                           const char* server1, const char* server2, const char* server3)
+                const char* server1, const char* server2, const char* server3)
 {
-	(void)server1;
-	(void)server2;
-	(void)server3;
+    (void)server1;
+    (void)server2;
+    (void)server3;
 
-	mockverbose("configTime: TODO (tz=%dH offset=%dS) (time will be host's)\n", timezone, daylightOffset_sec);
+    mockverbose("configTime: TODO (tz=%dH offset=%dS) (time will be host's)\n", timezone, daylightOffset_sec);
 }
diff --git a/tests/host/common/MockUART.cpp b/tests/host/common/MockUART.cpp
index dc6514ae40..19d234cbb9 100644
--- a/tests/host/common/MockUART.cpp
+++ b/tests/host/common/MockUART.cpp
@@ -1,32 +1,32 @@
 /*
- MockUART.cpp - esp8266 UART HAL EMULATION
+    MockUART.cpp - esp8266 UART HAL EMULATION
 
- Copyright (c) 2019 Clemens Kirchgatterer. All rights reserved.
- This file is part of the esp8266 core for Arduino environment.
+    Copyright (c) 2019 Clemens Kirchgatterer. All rights reserved.
+    This file is part of the esp8266 core for Arduino environment.
 
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
 
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- Lesser General Public License for more details.
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
 
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
 
 /*
- This UART driver is directly derived from the ESP8266 UART HAL driver
- Copyright (c) 2014 Ivan Grokhotkov. It provides the same API as the
- original driver and was striped from all HW dependent interfaces.
+    This UART driver is directly derived from the ESP8266 UART HAL driver
+    Copyright (c) 2014 Ivan Grokhotkov. It provides the same API as the
+    original driver and was striped from all HW dependent interfaces.
 
- UART0 writes got to stdout, while UART1 writes got to stderr. The user
- is responsible for feeding the RX FIFO new data by calling uart_new_data().
- */
+    UART0 writes got to stdout, while UART1 writes got to stderr. The user
+    is responsible for feeding the RX FIFO new data by calling uart_new_data().
+*/
 
 #include <unistd.h> // write
 #include <sys/time.h> // gettimeofday
@@ -39,464 +39,526 @@
 
 extern "C" {
 
-bool blocking_uart = true; // system default
+    bool blocking_uart = true; // system default
 
-static int s_uart_debug_nr = UART1;
+    static int s_uart_debug_nr = UART1;
 
-static uart_t *UART[2] = { NULL, NULL };
+    static uart_t *UART[2] = { NULL, NULL };
 
-struct uart_rx_buffer_
-{
-	size_t size;
-	size_t rpos;
-	size_t wpos;
-	uint8_t * buffer;
-};
-
-struct uart_
-{
-	int uart_nr;
-	int baud_rate;
-	bool rx_enabled;
-	bool tx_enabled;
-	bool rx_overrun;
-	struct uart_rx_buffer_ * rx_buffer;
-};
-
-bool serial_timestamp = false;
+    struct uart_rx_buffer_
+    {
+        size_t size;
+        size_t rpos;
+        size_t wpos;
+        uint8_t * buffer;
+    };
 
-// write one byte to the emulated UART
-static void
-uart_do_write_char(const int uart_nr, char c)
-{
-	static bool w = false;
-
-	if (uart_nr >= UART0 && uart_nr <= UART1)
-	{
-		if (serial_timestamp && (c == '\n' || c == '\r'))
-		{
-			if (w)
-			{
-				FILE* out = uart_nr == UART0? stdout: stderr;
-				timeval tv;
-				gettimeofday(&tv, nullptr);
-				const tm* tm = localtime(&tv.tv_sec);
-				fprintf(out, "\r\n%d:%02d:%02d.%06d: ", tm->tm_hour, tm->tm_min, tm->tm_sec, (int)tv.tv_usec);
-				fflush(out);
-				w = false;
-			}
-		}
-		else
-		{
+    struct uart_
+    {
+        int uart_nr;
+        int baud_rate;
+        bool rx_enabled;
+        bool tx_enabled;
+        bool rx_overrun;
+        struct uart_rx_buffer_ * rx_buffer;
+    };
+
+    bool serial_timestamp = false;
+
+    // write one byte to the emulated UART
+    static void
+    uart_do_write_char(const int uart_nr, char c)
+    {
+        static bool w = false;
+
+        if (uart_nr >= UART0 && uart_nr <= UART1)
+        {
+            if (serial_timestamp && (c == '\n' || c == '\r'))
+            {
+                if (w)
+                {
+                    FILE* out = uart_nr == UART0 ? stdout : stderr;
+                    timeval tv;
+                    gettimeofday(&tv, nullptr);
+                    const tm* tm = localtime(&tv.tv_sec);
+                    fprintf(out, "\r\n%d:%02d:%02d.%06d: ", tm->tm_hour, tm->tm_min, tm->tm_sec, (int)tv.tv_usec);
+                    fflush(out);
+                    w = false;
+                }
+            }
+            else
+            {
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunused-result"
-			write(uart_nr + 1, &c, 1);
+                write(uart_nr + 1, &c, 1);
 #pragma GCC diagnostic pop
-			w = true;
-		}
-	}
-}
+                w = true;
+            }
+        }
+    }
 
-// write a new byte into the RX FIFO buffer
-static void
-uart_handle_data(uart_t* uart, uint8_t data)
-{
-	struct uart_rx_buffer_ *rx_buffer = uart->rx_buffer;
+    // write a new byte into the RX FIFO buffer
+    static void
+    uart_handle_data(uart_t* uart, uint8_t data)
+    {
+        struct uart_rx_buffer_ *rx_buffer = uart->rx_buffer;
 
-	size_t nextPos = (rx_buffer->wpos + 1) % rx_buffer->size;
-	if(nextPos == rx_buffer->rpos)
-	{
-		uart->rx_overrun = true;
+        size_t nextPos = (rx_buffer->wpos + 1) % rx_buffer->size;
+        if (nextPos == rx_buffer->rpos)
+        {
+            uart->rx_overrun = true;
 #ifdef UART_DISCARD_NEWEST
-		return;
+            return;
 #else
-		if (++rx_buffer->rpos == rx_buffer->size)
-			rx_buffer->rpos = 0;
+            if (++rx_buffer->rpos == rx_buffer->size)
+            {
+                rx_buffer->rpos = 0;
+            }
 #endif
-	}
-	rx_buffer->buffer[rx_buffer->wpos] = data;
-	rx_buffer->wpos = nextPos;
-}
+        }
+        rx_buffer->buffer[rx_buffer->wpos] = data;
+        rx_buffer->wpos = nextPos;
+    }
 
-// insert a new byte into the RX FIFO nuffer
-void
-uart_new_data(const int uart_nr, uint8_t data)
-{
-	uart_t* uart = UART[uart_nr];
+    // insert a new byte into the RX FIFO nuffer
+    void
+    uart_new_data(const int uart_nr, uint8_t data)
+    {
+        uart_t* uart = UART[uart_nr];
 
-	if(uart == NULL || !uart->rx_enabled) {
-		return;
-	}
+        if (uart == NULL || !uart->rx_enabled)
+        {
+            return;
+        }
 
-	uart_handle_data(uart, data);
-}
+        uart_handle_data(uart, data);
+    }
 
-static size_t
-uart_rx_available_unsafe(const struct uart_rx_buffer_ * rx_buffer)
-{
-	size_t ret = rx_buffer->wpos - rx_buffer->rpos;
+    static size_t
+    uart_rx_available_unsafe(const struct uart_rx_buffer_ * rx_buffer)
+    {
+        size_t ret = rx_buffer->wpos - rx_buffer->rpos;
 
-	if(rx_buffer->wpos < rx_buffer->rpos)
-		ret = (rx_buffer->wpos + rx_buffer->size) - rx_buffer->rpos;
+        if (rx_buffer->wpos < rx_buffer->rpos)
+        {
+            ret = (rx_buffer->wpos + rx_buffer->size) - rx_buffer->rpos;
+        }
 
-	return ret;
-}
+        return ret;
+    }
 
-// taking data straight from fifo, only needed in uart_resize_rx_buffer()
-static int
-uart_read_char_unsafe(uart_t* uart)
-{
-	if (uart_rx_available_unsafe(uart->rx_buffer))
-	{
-		// take oldest sw data
-		int ret = uart->rx_buffer->buffer[uart->rx_buffer->rpos];
-		uart->rx_buffer->rpos = (uart->rx_buffer->rpos + 1) % uart->rx_buffer->size;
-		return ret;
-	}
-	// unavailable
-	return -1;
-}
+    // taking data straight from fifo, only needed in uart_resize_rx_buffer()
+    static int
+    uart_read_char_unsafe(uart_t* uart)
+    {
+        if (uart_rx_available_unsafe(uart->rx_buffer))
+        {
+            // take oldest sw data
+            int ret = uart->rx_buffer->buffer[uart->rx_buffer->rpos];
+            uart->rx_buffer->rpos = (uart->rx_buffer->rpos + 1) % uart->rx_buffer->size;
+            return ret;
+        }
+        // unavailable
+        return -1;
+    }
 
-/**********************************************************/
-/************ UART API FUNCTIONS **************************/
-/**********************************************************/
+    /**********************************************************/
+    /************ UART API FUNCTIONS **************************/
+    /**********************************************************/
 
-size_t
-uart_rx_available(uart_t* uart)
-{
-	if(uart == NULL || !uart->rx_enabled)
-		return 0;
+    size_t
+    uart_rx_available(uart_t* uart)
+    {
+        if (uart == NULL || !uart->rx_enabled)
+        {
+            return 0;
+        }
 
-	return uart_rx_available_unsafe(uart->rx_buffer);
-}
+        return uart_rx_available_unsafe(uart->rx_buffer);
+    }
 
-int
-uart_peek_char(uart_t* uart)
-{
-	if(uart == NULL || !uart->rx_enabled)
-		return -1;
+    int
+    uart_peek_char(uart_t* uart)
+    {
+        if (uart == NULL || !uart->rx_enabled)
+        {
+            return -1;
+        }
 
-	if (!uart_rx_available_unsafe(uart->rx_buffer))
-		return -1;
+        if (!uart_rx_available_unsafe(uart->rx_buffer))
+        {
+            return -1;
+        }
 
-	return uart->rx_buffer->buffer[uart->rx_buffer->rpos];
-}
+        return uart->rx_buffer->buffer[uart->rx_buffer->rpos];
+    }
 
-int
-uart_read_char(uart_t* uart)
-{
-	uint8_t ret;
-	return uart_read(uart, (char*)&ret, 1) ? ret : -1;
-}
+    int
+    uart_read_char(uart_t* uart)
+    {
+        uint8_t ret;
+        return uart_read(uart, (char*)&ret, 1) ? ret : -1;
+    }
 
-size_t
-uart_read(uart_t* uart, char* userbuffer, size_t usersize)
-{
-	if(uart == NULL || !uart->rx_enabled)
-		return 0;
-
-    if (!blocking_uart)
-    {
-        char c;
-        if (read(0, &c, 1) == 1)
-            uart_new_data(0, c);
-    }
-
-	size_t ret = 0;
-	while (ret < usersize && uart_rx_available_unsafe(uart->rx_buffer))
-	{
-		// pour sw buffer to user's buffer
-		// get largest linear length from sw buffer
-		size_t chunk = uart->rx_buffer->rpos < uart->rx_buffer->wpos ?
-		               uart->rx_buffer->wpos - uart->rx_buffer->rpos :
-		               uart->rx_buffer->size - uart->rx_buffer->rpos;
-		if (ret + chunk > usersize)
-			chunk = usersize - ret;
-		memcpy(userbuffer + ret, uart->rx_buffer->buffer + uart->rx_buffer->rpos, chunk);
-		uart->rx_buffer->rpos = (uart->rx_buffer->rpos + chunk) % uart->rx_buffer->size;
-		ret += chunk;
-	}
-	return ret;
-}
+    size_t
+    uart_read(uart_t* uart, char* userbuffer, size_t usersize)
+    {
+        if (uart == NULL || !uart->rx_enabled)
+        {
+            return 0;
+        }
+
+        if (!blocking_uart)
+        {
+            char c;
+            if (read(0, &c, 1) == 1)
+            {
+                uart_new_data(0, c);
+            }
+        }
+
+        size_t ret = 0;
+        while (ret < usersize && uart_rx_available_unsafe(uart->rx_buffer))
+        {
+            // pour sw buffer to user's buffer
+            // get largest linear length from sw buffer
+            size_t chunk = uart->rx_buffer->rpos < uart->rx_buffer->wpos ?
+                           uart->rx_buffer->wpos - uart->rx_buffer->rpos :
+                           uart->rx_buffer->size - uart->rx_buffer->rpos;
+            if (ret + chunk > usersize)
+            {
+                chunk = usersize - ret;
+            }
+            memcpy(userbuffer + ret, uart->rx_buffer->buffer + uart->rx_buffer->rpos, chunk);
+            uart->rx_buffer->rpos = (uart->rx_buffer->rpos + chunk) % uart->rx_buffer->size;
+            ret += chunk;
+        }
+        return ret;
+    }
 
-size_t
-uart_resize_rx_buffer(uart_t* uart, size_t new_size)
-{
-	if(uart == NULL || !uart->rx_enabled)
-		return 0;
-
-	if(uart->rx_buffer->size == new_size)
-		return uart->rx_buffer->size;
-
-	uint8_t * new_buf = (uint8_t*)malloc(new_size);
-	if(!new_buf)
-		return uart->rx_buffer->size;
-
-	size_t new_wpos = 0;
-	// if uart_rx_available_unsafe() returns non-0, uart_read_char_unsafe() can't return -1
-	while(uart_rx_available_unsafe(uart->rx_buffer) && new_wpos < new_size)
-		new_buf[new_wpos++] = uart_read_char_unsafe(uart);
-	if (new_wpos == new_size)
-		new_wpos = 0;
-
-	uint8_t * old_buf = uart->rx_buffer->buffer;
-	uart->rx_buffer->rpos = 0;
-	uart->rx_buffer->wpos = new_wpos;
-	uart->rx_buffer->size = new_size;
-	uart->rx_buffer->buffer = new_buf;
-	free(old_buf);
-	return uart->rx_buffer->size;
-}
+    size_t
+    uart_resize_rx_buffer(uart_t* uart, size_t new_size)
+    {
+        if (uart == NULL || !uart->rx_enabled)
+        {
+            return 0;
+        }
+
+        if (uart->rx_buffer->size == new_size)
+        {
+            return uart->rx_buffer->size;
+        }
+
+        uint8_t * new_buf = (uint8_t*)malloc(new_size);
+        if (!new_buf)
+        {
+            return uart->rx_buffer->size;
+        }
+
+        size_t new_wpos = 0;
+        // if uart_rx_available_unsafe() returns non-0, uart_read_char_unsafe() can't return -1
+        while (uart_rx_available_unsafe(uart->rx_buffer) && new_wpos < new_size)
+        {
+            new_buf[new_wpos++] = uart_read_char_unsafe(uart);
+        }
+        if (new_wpos == new_size)
+        {
+            new_wpos = 0;
+        }
+
+        uint8_t * old_buf = uart->rx_buffer->buffer;
+        uart->rx_buffer->rpos = 0;
+        uart->rx_buffer->wpos = new_wpos;
+        uart->rx_buffer->size = new_size;
+        uart->rx_buffer->buffer = new_buf;
+        free(old_buf);
+        return uart->rx_buffer->size;
+    }
 
-size_t
-uart_get_rx_buffer_size(uart_t* uart)
-{
-	return uart && uart->rx_enabled ? uart->rx_buffer->size : 0;
-}
+    size_t
+    uart_get_rx_buffer_size(uart_t* uart)
+    {
+        return uart && uart->rx_enabled ? uart->rx_buffer->size : 0;
+    }
 
-size_t
-uart_write_char(uart_t* uart, char c)
-{
-	if(uart == NULL || !uart->tx_enabled)
-		return 0;
+    size_t
+    uart_write_char(uart_t* uart, char c)
+    {
+        if (uart == NULL || !uart->tx_enabled)
+        {
+            return 0;
+        }
 
-	uart_do_write_char(uart->uart_nr, c);
+        uart_do_write_char(uart->uart_nr, c);
 
-	return 1;
-}
+        return 1;
+    }
 
-size_t
-uart_write(uart_t* uart, const char* buf, size_t size)
-{
-	if(uart == NULL || !uart->tx_enabled)
-		return 0;
+    size_t
+    uart_write(uart_t* uart, const char* buf, size_t size)
+    {
+        if (uart == NULL || !uart->tx_enabled)
+        {
+            return 0;
+        }
+
+        size_t ret = size;
+        const int uart_nr = uart->uart_nr;
+        while (size--)
+        {
+            uart_do_write_char(uart_nr, *buf++);
+        }
+
+        return ret;
+    }
 
-	size_t ret = size;
-	const int uart_nr = uart->uart_nr;
-	while (size--)
-		uart_do_write_char(uart_nr, *buf++);
+    size_t
+    uart_tx_free(uart_t* uart)
+    {
+        if (uart == NULL || !uart->tx_enabled)
+        {
+            return 0;
+        }
 
-	return ret;
-}
+        return UART_TX_FIFO_SIZE;
+    }
 
-size_t
-uart_tx_free(uart_t* uart)
-{
-	if(uart == NULL || !uart->tx_enabled)
-		return 0;
+    void
+    uart_wait_tx_empty(uart_t* uart)
+    {
+        (void) uart;
+    }
 
-	return UART_TX_FIFO_SIZE;
-}
+    void
+    uart_flush(uart_t* uart)
+    {
+        if (uart == NULL)
+        {
+            return;
+        }
+
+        if (uart->rx_enabled)
+        {
+            uart->rx_buffer->rpos = 0;
+            uart->rx_buffer->wpos = 0;
+        }
+    }
 
-void
-uart_wait_tx_empty(uart_t* uart)
-{
-	(void) uart;
-}
+    void
+    uart_set_baudrate(uart_t* uart, int baud_rate)
+    {
+        if (uart == NULL)
+        {
+            return;
+        }
 
-void
-uart_flush(uart_t* uart)
-{
-	if(uart == NULL)
-		return;
-
-	if(uart->rx_enabled)
-	{
-		uart->rx_buffer->rpos = 0;
-		uart->rx_buffer->wpos = 0;
-	}
-}
+        uart->baud_rate = baud_rate;
+    }
 
-void
-uart_set_baudrate(uart_t* uart, int baud_rate)
-{
-	if(uart == NULL)
-		return;
+    int
+    uart_get_baudrate(uart_t* uart)
+    {
+        if (uart == NULL)
+        {
+            return 0;
+        }
 
-	uart->baud_rate = baud_rate;
-}
+        return uart->baud_rate;
+    }
 
-int
-uart_get_baudrate(uart_t* uart)
-{
-	if(uart == NULL)
-		return 0;
+    uint8_t
+    uart_get_bit_length(const int uart_nr)
+    {
+        uint8_t width = ((uart_nr % 16) >> 2) + 5;
+        uint8_t parity = (uart_nr >> 5) + 1;
+        uint8_t stop = uart_nr % 4;
+        return (width + parity + stop + 1);
+    }
 
-	return uart->baud_rate;
-}
+    uart_t*
+    uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, size_t rx_size, bool invert)
+    {
+        (void) config;
+        (void) tx_pin;
+        (void) invert;
+        uart_t* uart = (uart_t*) malloc(sizeof(uart_t));
+        if (uart == NULL)
+        {
+            return NULL;
+        }
+
+        uart->uart_nr = uart_nr;
+        uart->rx_overrun = false;
+
+        switch (uart->uart_nr)
+        {
+        case UART0:
+            uart->rx_enabled = (mode != UART_TX_ONLY);
+            uart->tx_enabled = (mode != UART_RX_ONLY);
+            if (uart->rx_enabled)
+            {
+                struct uart_rx_buffer_ * rx_buffer = (struct uart_rx_buffer_ *)malloc(sizeof(struct uart_rx_buffer_));
+                if (rx_buffer == NULL)
+                {
+                    free(uart);
+                    return NULL;
+                }
+                rx_buffer->size = rx_size;//var this
+                rx_buffer->rpos = 0;
+                rx_buffer->wpos = 0;
+                rx_buffer->buffer = (uint8_t *)malloc(rx_buffer->size);
+                if (rx_buffer->buffer == NULL)
+                {
+                    free(rx_buffer);
+                    free(uart);
+                    return NULL;
+                }
+                uart->rx_buffer = rx_buffer;
+            }
+            break;
+
+        case UART1:
+            // Note: uart_interrupt_handler does not support RX on UART 1.
+            uart->rx_enabled = false;
+            uart->tx_enabled = (mode != UART_RX_ONLY);
+            break;
+
+        case UART_NO:
+        default:
+            // big fail!
+            free(uart);
+            return NULL;
+        }
+
+        uart_set_baudrate(uart, baudrate);
+
+        UART[uart_nr] = uart;
+
+        return uart;
+    }
 
-uint8_t
-uart_get_bit_length(const int uart_nr)
-{
-	uint8_t width = ((uart_nr % 16) >> 2) + 5;
-	uint8_t parity = (uart_nr >> 5) + 1;
-	uint8_t stop = uart_nr % 4;
-	return (width + parity + stop + 1);
-}
+    void
+    uart_uninit(uart_t* uart)
+    {
+        if (uart == NULL)
+        {
+            return;
+        }
+
+        if (uart->rx_enabled)
+        {
+            free(uart->rx_buffer->buffer);
+            free(uart->rx_buffer);
+        }
+        free(uart);
+    }
 
-uart_t*
-uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, size_t rx_size, bool invert)
-{
-	(void) config;
-	(void) tx_pin;
-	(void) invert;
-	uart_t* uart = (uart_t*) malloc(sizeof(uart_t));
-	if(uart == NULL)
-		return NULL;
-
-	uart->uart_nr = uart_nr;
-	uart->rx_overrun = false;
-
-	switch(uart->uart_nr)
-	{
-	case UART0:
-		uart->rx_enabled = (mode != UART_TX_ONLY);
-		uart->tx_enabled = (mode != UART_RX_ONLY);
-		if(uart->rx_enabled)
-		{
-			struct uart_rx_buffer_ * rx_buffer = (struct uart_rx_buffer_ *)malloc(sizeof(struct uart_rx_buffer_));
-			if(rx_buffer == NULL)
-			{
-				free(uart);
-				return NULL;
-			}
-			rx_buffer->size = rx_size;//var this
-			rx_buffer->rpos = 0;
-			rx_buffer->wpos = 0;
-			rx_buffer->buffer = (uint8_t *)malloc(rx_buffer->size);
-			if(rx_buffer->buffer == NULL)
-			{
-				free(rx_buffer);
-				free(uart);
-				return NULL;
-			}
-			uart->rx_buffer = rx_buffer;
-		}
-		break;
-
-	case UART1:
-		// Note: uart_interrupt_handler does not support RX on UART 1.
-		uart->rx_enabled = false;
-		uart->tx_enabled = (mode != UART_RX_ONLY);
-		break;
-
-	case UART_NO:
-	default:
-		// big fail!
-		free(uart);
-		return NULL;
-	}
-
-	uart_set_baudrate(uart, baudrate);
-
-	UART[uart_nr] = uart;
-
-	return uart;
-}
+    bool
+    uart_swap(uart_t* uart, int tx_pin)
+    {
+        (void) uart;
+        (void) tx_pin;
+        return true;
+    }
 
-void
-uart_uninit(uart_t* uart)
-{
-	if(uart == NULL)
-		return;
-
-	if(uart->rx_enabled) {
-		free(uart->rx_buffer->buffer);
-		free(uart->rx_buffer);
-	}
-	free(uart);
-}
+    bool
+    uart_set_tx(uart_t* uart, int tx_pin)
+    {
+        (void) uart;
+        (void) tx_pin;
+        return true;
+    }
 
-bool
-uart_swap(uart_t* uart, int tx_pin)
-{
-	(void) uart;
-	(void) tx_pin;
-	return true;
-}
+    bool
+    uart_set_pins(uart_t* uart, int tx, int rx)
+    {
+        (void) uart;
+        (void) tx;
+        (void) rx;
+        return true;
+    }
 
-bool
-uart_set_tx(uart_t* uart, int tx_pin)
-{
-	(void) uart;
-	(void) tx_pin;
-	return true;
-}
+    bool
+    uart_tx_enabled(uart_t* uart)
+    {
+        if (uart == NULL)
+        {
+            return false;
+        }
 
-bool
-uart_set_pins(uart_t* uart, int tx, int rx)
-{
-	(void) uart;
-	(void) tx;
-	(void) rx;
-	return true;
-}
+        return uart->tx_enabled;
+    }
 
-bool
-uart_tx_enabled(uart_t* uart)
-{
-	if(uart == NULL)
-		return false;
+    bool
+    uart_rx_enabled(uart_t* uart)
+    {
+        if (uart == NULL)
+        {
+            return false;
+        }
 
-	return uart->tx_enabled;
-}
+        return uart->rx_enabled;
+    }
 
-bool
-uart_rx_enabled(uart_t* uart)
-{
-	if(uart == NULL)
-		return false;
+    bool
+    uart_has_overrun(uart_t* uart)
+    {
+        if (uart == NULL || !uart->rx_overrun)
+        {
+            return false;
+        }
+
+        // clear flag
+        uart->rx_overrun = false;
+        return true;
+    }
 
-	return uart->rx_enabled;
-}
+    bool
+    uart_has_rx_error(uart_t* uart)
+    {
+        (void) uart;
+        return false;
+    }
 
-bool
-uart_has_overrun(uart_t* uart)
-{
-	if(uart == NULL || !uart->rx_overrun)
-		return false;
+    void
+    uart_set_debug(int uart_nr)
+    {
+        (void)uart_nr;
+    }
 
-	// clear flag
-	uart->rx_overrun = false;
-	return true;
-}
+    int
+    uart_get_debug()
+    {
+        return s_uart_debug_nr;
+    }
 
-bool
-uart_has_rx_error(uart_t* uart)
-{
-	(void) uart;
-	return false;
-}
+    void
+    uart_start_detect_baudrate(int uart_nr)
+    {
+        (void) uart_nr;
+    }
 
-void
-uart_set_debug(int uart_nr)
-{
-	(void)uart_nr;
-}
+    int
+    uart_detect_baudrate(int uart_nr)
+    {
+        (void) uart_nr;
+        return 115200;
+    }
 
-int
-uart_get_debug()
+};
+
+
+size_t uart_peek_available(uart_t* uart)
 {
-	return s_uart_debug_nr;
+    return 0;
 }
-
-void
-uart_start_detect_baudrate(int uart_nr)
+const char* uart_peek_buffer(uart_t* uart)
 {
-	(void) uart_nr;
+    return nullptr;
 }
-
-int
-uart_detect_baudrate(int uart_nr)
+void uart_peek_consume(uart_t* uart, size_t consume)
 {
-	(void) uart_nr;
-	return 115200;
+    (void)uart;
+    (void)consume;
 }
 
-};
-
-
-size_t uart_peek_available (uart_t* uart) { return 0; }
-const char* uart_peek_buffer (uart_t* uart) { return nullptr; }
-void uart_peek_consume (uart_t* uart, size_t consume) { (void)uart; (void)consume; }
-
diff --git a/tests/host/common/MockWiFiServer.cpp b/tests/host/common/MockWiFiServer.cpp
index dba66362d3..3c74927af0 100644
--- a/tests/host/common/MockWiFiServer.cpp
+++ b/tests/host/common/MockWiFiServer.cpp
@@ -1,32 +1,32 @@
 /*
- Arduino emulation - WiFiServer
- Copyright (c) 2018 david gauchard. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal with the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- - Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimers.
-
- - Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimers in the
-   documentation and/or other materials provided with the distribution.
-
- - The names of its contributors may not be used to endorse or promote
-   products derived from this Software without specific prior written
-   permission.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS WITH THE SOFTWARE.
+    Arduino emulation - WiFiServer
+    Copyright (c) 2018 david gauchard. All rights reserved.
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal with the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+
+    - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimers.
+
+    - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimers in the
+    documentation and/or other materials provided with the distribution.
+
+    - The names of its contributors may not be used to endorse or promote
+    products derived from this Software without specific prior written
+    permission.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS WITH THE SOFTWARE.
 */
 
 #include <WiFiClient.h>
@@ -44,28 +44,30 @@ extern "C" const ip_addr_t ip_addr_any = IPADDR4_INIT(IPADDR_ANY);
 
 // lwIP API side of WiFiServer
 
-WiFiServer::WiFiServer (const IPAddress& addr, uint16_t port)
+WiFiServer::WiFiServer(const IPAddress& addr, uint16_t port)
 {
-	(void)addr;
-	_port = port;
+    (void)addr;
+    _port = port;
 }
 
-WiFiServer::WiFiServer (uint16_t port)
+WiFiServer::WiFiServer(uint16_t port)
 {
-	_port = port;
+    _port = port;
 }
 
-WiFiClient WiFiServer::available (uint8_t* status)
+WiFiClient WiFiServer::available(uint8_t* status)
 {
-	(void)status;
-	return accept();
+    (void)status;
+    return accept();
 }
 
-WiFiClient WiFiServer::accept ()
+WiFiClient WiFiServer::accept()
 {
-	if (hasClient())
-		return WiFiClient(new ClientContext(serverAccept(pcb2int(_listen_pcb))));
-	return WiFiClient();
+    if (hasClient())
+    {
+        return WiFiClient(new ClientContext(serverAccept(pcb2int(_listen_pcb))));
+    }
+    return WiFiClient();
 }
 
 // static declaration
diff --git a/tests/host/common/MockWiFiServerSocket.cpp b/tests/host/common/MockWiFiServerSocket.cpp
index 9ab344bf50..3eff34bfff 100644
--- a/tests/host/common/MockWiFiServerSocket.cpp
+++ b/tests/host/common/MockWiFiServerSocket.cpp
@@ -1,32 +1,32 @@
 /*
- Arduino emulation - WiFiServer socket side
- Copyright (c) 2018 david gauchard. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal with the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- - Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimers.
-
- - Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimers in the
-   documentation and/or other materials provided with the distribution.
-
- - The names of its contributors may not be used to endorse or promote
-   products derived from this Software without specific prior written
-   permission.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS WITH THE SOFTWARE.
+    Arduino emulation - WiFiServer socket side
+    Copyright (c) 2018 david gauchard. All rights reserved.
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal with the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+
+    - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimers.
+
+    - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimers in the
+    documentation and/or other materials provided with the distribution.
+
+    - The names of its contributors may not be used to endorse or promote
+    products derived from this Software without specific prior written
+    permission.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS WITH THE SOFTWARE.
 */
 
 #include <WiFiServer.h>
@@ -44,102 +44,108 @@
 
 // host socket internal side of WiFiServer
 
-int serverAccept (int srvsock)
+int serverAccept(int srvsock)
 {
-	int clisock;
-	socklen_t n;
-	struct sockaddr_in client;
-	n = sizeof(client);
-	if ((clisock = accept(srvsock, (struct sockaddr*)&client, &n)) == -1)
-	{
-		perror(MOCK "accept()");
-		exit(EXIT_FAILURE);
-	}
-	return mockSockSetup(clisock);
+    int clisock;
+    socklen_t n;
+    struct sockaddr_in client;
+    n = sizeof(client);
+    if ((clisock = accept(srvsock, (struct sockaddr*)&client, &n)) == -1)
+    {
+        perror(MOCK "accept()");
+        exit(EXIT_FAILURE);
+    }
+    return mockSockSetup(clisock);
 }
 
-void WiFiServer::begin (uint16_t port)
+void WiFiServer::begin(uint16_t port)
 {
     return begin(port, !0);
 }
 
-void WiFiServer::begin (uint16_t port, uint8_t backlog)
+void WiFiServer::begin(uint16_t port, uint8_t backlog)
 {
     if (!backlog)
+    {
         return;
+    }
     _port = port;
     return begin();
 }
 
-void WiFiServer::begin ()
+void WiFiServer::begin()
 {
-	int sock;
-	int mockport;
-	struct sockaddr_in server;
-
-	mockport = _port;
-	if (mockport < 1024 && mock_port_shifter)
-	{
-		mockport += mock_port_shifter;
-		fprintf(stderr, MOCK "=====> WiFiServer port: %d shifted to %d (use option -s) <=====\n", _port, mockport);
-	}
-	else
-		fprintf(stderr, MOCK "=====> WiFiServer port: %d <=====\n", mockport);
-
-	if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1)
-	{
-		perror(MOCK "socket()");
-		exit(EXIT_FAILURE);
-	}
-
-	int optval = 1;
-	if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)) == -1)
-	{
-		perror(MOCK "reuseport");
-		exit(EXIT_FAILURE);
-	}
-
-	server.sin_family = AF_INET;
-	server.sin_port = htons(mockport);
-	server.sin_addr.s_addr = htonl(global_source_address);
-	if (bind(sock, (struct sockaddr*)&server, sizeof(server)) == -1)
-	{
-		perror(MOCK "bind()");
-		exit(EXIT_FAILURE);
-	}
-
-	if (listen(sock, 1) == -1)
-	{
-		perror(MOCK "listen()");
-		exit(EXIT_FAILURE);
-	}
-
-
-	// store int into pointer
-	_listen_pcb = int2pcb(sock);
+    int sock;
+    int mockport;
+    struct sockaddr_in server;
+
+    mockport = _port;
+    if (mockport < 1024 && mock_port_shifter)
+    {
+        mockport += mock_port_shifter;
+        fprintf(stderr, MOCK "=====> WiFiServer port: %d shifted to %d (use option -s) <=====\n", _port, mockport);
+    }
+    else
+    {
+        fprintf(stderr, MOCK "=====> WiFiServer port: %d <=====\n", mockport);
+    }
+
+    if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1)
+    {
+        perror(MOCK "socket()");
+        exit(EXIT_FAILURE);
+    }
+
+    int optval = 1;
+    if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)) == -1)
+    {
+        perror(MOCK "reuseport");
+        exit(EXIT_FAILURE);
+    }
+
+    server.sin_family = AF_INET;
+    server.sin_port = htons(mockport);
+    server.sin_addr.s_addr = htonl(global_source_address);
+    if (bind(sock, (struct sockaddr*)&server, sizeof(server)) == -1)
+    {
+        perror(MOCK "bind()");
+        exit(EXIT_FAILURE);
+    }
+
+    if (listen(sock, 1) == -1)
+    {
+        perror(MOCK "listen()");
+        exit(EXIT_FAILURE);
+    }
+
+
+    // store int into pointer
+    _listen_pcb = int2pcb(sock);
 }
 
-bool WiFiServer::hasClient ()
+bool WiFiServer::hasClient()
 {
-	struct pollfd p;
-	p.fd = pcb2int(_listen_pcb);
-	p.events = POLLIN;
-	return poll(&p, 1, 0) && p.revents == POLLIN;
+    struct pollfd p;
+    p.fd = pcb2int(_listen_pcb);
+    p.events = POLLIN;
+    return poll(&p, 1, 0) && p.revents == POLLIN;
 }
 
-void WiFiServer::close ()
+void WiFiServer::close()
 {
-	if (pcb2int(_listen_pcb) >= 0)
-		::close(pcb2int(_listen_pcb));
-	_listen_pcb = int2pcb(-1);
+    if (pcb2int(_listen_pcb) >= 0)
+    {
+        ::close(pcb2int(_listen_pcb));
+    }
+    _listen_pcb = int2pcb(-1);
 }
 
-void WiFiServer::stop ()
+void WiFiServer::stop()
 {
     close();
 }
 
-size_t WiFiServer::hasClientData ()
+size_t WiFiServer::hasClientData()
 {
     // Trivial Mocking:
     // There is no waiting list of clients in this trivial mocking code,
@@ -149,7 +155,7 @@ size_t WiFiServer::hasClientData ()
     return 0;
 }
 
-bool WiFiServer::hasMaxPendingClients ()
+bool WiFiServer::hasMaxPendingClients()
 {
     // Mocking code does not consider the waiting client list,
     // so it will return ::hasClient() here meaning:
diff --git a/tests/host/common/MocklwIP.cpp b/tests/host/common/MocklwIP.cpp
index 1e19f20fc7..0b98243217 100644
--- a/tests/host/common/MocklwIP.cpp
+++ b/tests/host/common/MocklwIP.cpp
@@ -8,57 +8,57 @@ esp8266::AddressListImplementation::AddressList addrList;
 extern "C"
 {
 
-extern netif netif0;
-
-netif* netif_list = &netif0;
-
-err_t dhcp_renew(struct netif *netif)
-{
-	(void)netif;
-	return ERR_OK;
-}
-
-void sntp_setserver(u8_t, const ip_addr_t)
-{
-}
-
-const ip_addr_t* sntp_getserver(u8_t)
-{
-    return IP_ADDR_ANY;
-}
-
-err_t etharp_request(struct netif *netif, const ip4_addr_t *ipaddr)
-{
-    (void)netif;
-    (void)ipaddr;
-    return ERR_OK;
-}
-
-err_t igmp_start(struct netif* netif)
-{
-    (void)netif;
-    return ERR_OK;
-}
-
-err_t igmp_joingroup_netif(struct netif *netif, const ip4_addr_t *groupaddr)
-{
-    (void)netif;
-    (void)groupaddr;
-    return ERR_OK;
-}
-
-err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr)
-{
-    (void)netif;
-    (void)groupaddr;
-    return ERR_OK;
-}
-
-struct netif* netif_get_by_index(u8_t idx)
-{
-    (void)idx;
-    return &netif0;
-}
+    extern netif netif0;
+
+    netif* netif_list = &netif0;
+
+    err_t dhcp_renew(struct netif *netif)
+    {
+        (void)netif;
+        return ERR_OK;
+    }
+
+    void sntp_setserver(u8_t, const ip_addr_t)
+    {
+    }
+
+    const ip_addr_t* sntp_getserver(u8_t)
+    {
+        return IP_ADDR_ANY;
+    }
+
+    err_t etharp_request(struct netif *netif, const ip4_addr_t *ipaddr)
+    {
+        (void)netif;
+        (void)ipaddr;
+        return ERR_OK;
+    }
+
+    err_t igmp_start(struct netif* netif)
+    {
+        (void)netif;
+        return ERR_OK;
+    }
+
+    err_t igmp_joingroup_netif(struct netif *netif, const ip4_addr_t *groupaddr)
+    {
+        (void)netif;
+        (void)groupaddr;
+        return ERR_OK;
+    }
+
+    err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr)
+    {
+        (void)netif;
+        (void)groupaddr;
+        return ERR_OK;
+    }
+
+    struct netif* netif_get_by_index(u8_t idx)
+    {
+        (void)idx;
+        return &netif0;
+    }
 
 
 } // extern "C"
diff --git a/tests/host/common/MocklwIP.h b/tests/host/common/MocklwIP.h
index e7fead4cb7..47c3d06c6e 100644
--- a/tests/host/common/MocklwIP.h
+++ b/tests/host/common/MocklwIP.h
@@ -8,7 +8,7 @@ extern "C"
 #include <user_interface.h>
 #include <lwip/netif.h>
 
-extern netif netif0;
+    extern netif netif0;
 
 } // extern "C"
 
diff --git a/tests/host/common/UdpContextSocket.cpp b/tests/host/common/UdpContextSocket.cpp
index 4212bb0ee4..23f2883c11 100644
--- a/tests/host/common/UdpContextSocket.cpp
+++ b/tests/host/common/UdpContextSocket.cpp
@@ -1,32 +1,32 @@
 /*
- Arduino emulation - UdpContext emulation - socket part
- Copyright (c) 2018 david gauchard. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal with the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- - Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimers.
-
- - Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimers in the
-   documentation and/or other materials provided with the distribution.
-
- - The names of its contributors may not be used to endorse or promote
-   products derived from this Software without specific prior written
-   permission.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS WITH THE SOFTWARE.
+    Arduino emulation - UdpContext emulation - socket part
+    Copyright (c) 2018 david gauchard. All rights reserved.
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal with the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+
+    - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimers.
+
+    - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimers in the
+    documentation and/or other materials provided with the distribution.
+
+    - The names of its contributors may not be used to endorse or promote
+    products derived from this Software without specific prior written
+    permission.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS WITH THE SOFTWARE.
 */
 
 #include <unistd.h>
@@ -39,176 +39,198 @@
 #include <assert.h>
 #include <net/if.h>
 
-int mockUDPSocket ()
+int mockUDPSocket()
 {
-	int s;
-	if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1 || fcntl(s, F_SETFL, O_NONBLOCK) == -1)
-	{
-		fprintf(stderr, MOCK "UDP socket: %s", strerror(errno));
-		exit(EXIT_FAILURE);
-	}
-	return s;
+    int s;
+    if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1 || fcntl(s, F_SETFL, O_NONBLOCK) == -1)
+    {
+        fprintf(stderr, MOCK "UDP socket: %s", strerror(errno));
+        exit(EXIT_FAILURE);
+    }
+    return s;
 }
 
-bool mockUDPListen (int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
+bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
 {
-	int optval;
-	int mockport;
-
-	mockport = port;
-	if (mockport < 1024 && mock_port_shifter)
-	{
-		mockport += mock_port_shifter;
-		fprintf(stderr, MOCK "=====> UdpServer port: %d shifted to %d (use option -s) <=====\n", port, mockport);
-	}
-	else
-		fprintf(stderr, MOCK "=====> UdpServer port: %d <=====\n", mockport);
-
-	optval = 1;
-	if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)) == -1)
-		fprintf(stderr, MOCK "SO_REUSEPORT failed\n");
-	optval = 1;
-	if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) == -1)
-		fprintf(stderr, MOCK "SO_REUSEADDR failed\n");
-
-	struct sockaddr_in servaddr;
-	memset(&servaddr, 0, sizeof(servaddr));
-
-	// Filling server information
-	servaddr.sin_family = AF_INET;
-	(void) dstaddr;
-	//servaddr.sin_addr.s_addr = htonl(global_source_address);
-	servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
-	servaddr.sin_port = htons(mockport);
-
-	// Bind the socket with the server address
-	if (bind(sock, (const struct sockaddr *)&servaddr, sizeof(servaddr)) < 0)
-	{
-		fprintf(stderr, MOCK "UDP bind on port %d failed: %s\n", mockport, strerror(errno));
-		return false;
-	}
-	else
-		mockverbose("UDP server on port %d (sock=%d)\n", mockport, sock);
-
-	if (!mcast)
-		mcast = inet_addr("224.0.0.1"); // all hosts group
-	if (mcast)
-	{
-		// https://web.cs.wpi.edu/~claypool/courses/4514-B99/samples/multicast.c
-		// https://stackoverflow.com/questions/12681097/c-choose-interface-for-udp-multicast-socket
-
-		struct ip_mreq mreq;
-		mreq.imr_multiaddr.s_addr = mcast;
-		//mreq.imr_interface.s_addr = htonl(global_source_address);
-		mreq.imr_interface.s_addr = htonl(INADDR_ANY);
-
-		if (host_interface)
-		{
+    int optval;
+    int mockport;
+
+    mockport = port;
+    if (mockport < 1024 && mock_port_shifter)
+    {
+        mockport += mock_port_shifter;
+        fprintf(stderr, MOCK "=====> UdpServer port: %d shifted to %d (use option -s) <=====\n", port, mockport);
+    }
+    else
+    {
+        fprintf(stderr, MOCK "=====> UdpServer port: %d <=====\n", mockport);
+    }
+
+    optval = 1;
+    if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)) == -1)
+    {
+        fprintf(stderr, MOCK "SO_REUSEPORT failed\n");
+    }
+    optval = 1;
+    if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) == -1)
+    {
+        fprintf(stderr, MOCK "SO_REUSEADDR failed\n");
+    }
+
+    struct sockaddr_in servaddr;
+    memset(&servaddr, 0, sizeof(servaddr));
+
+    // Filling server information
+    servaddr.sin_family = AF_INET;
+    (void) dstaddr;
+    //servaddr.sin_addr.s_addr = htonl(global_source_address);
+    servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
+    servaddr.sin_port = htons(mockport);
+
+    // Bind the socket with the server address
+    if (bind(sock, (const struct sockaddr *)&servaddr, sizeof(servaddr)) < 0)
+    {
+        fprintf(stderr, MOCK "UDP bind on port %d failed: %s\n", mockport, strerror(errno));
+        return false;
+    }
+    else
+    {
+        mockverbose("UDP server on port %d (sock=%d)\n", mockport, sock);
+    }
+
+    if (!mcast)
+    {
+        mcast = inet_addr("224.0.0.1");    // all hosts group
+    }
+    if (mcast)
+    {
+        // https://web.cs.wpi.edu/~claypool/courses/4514-B99/samples/multicast.c
+        // https://stackoverflow.com/questions/12681097/c-choose-interface-for-udp-multicast-socket
+
+        struct ip_mreq mreq;
+        mreq.imr_multiaddr.s_addr = mcast;
+        //mreq.imr_interface.s_addr = htonl(global_source_address);
+        mreq.imr_interface.s_addr = htonl(INADDR_ANY);
+
+        if (host_interface)
+        {
 #if __APPLE__
-			int idx = if_nametoindex(host_interface);
-			if (setsockopt(sock, IPPROTO_TCP, IP_BOUND_IF, &idx, sizeof(idx)) == -1)
+            int idx = if_nametoindex(host_interface);
+            if (setsockopt(sock, IPPROTO_TCP, IP_BOUND_IF, &idx, sizeof(idx)) == -1)
 #else
-			if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, host_interface, strlen(host_interface)) == -1)
+            if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, host_interface, strlen(host_interface)) == -1)
 #endif
-				fprintf(stderr, MOCK "UDP multicast: can't setup bind/output on interface %s: %s\n", host_interface, strerror(errno));
-			if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, &mreq.imr_interface, sizeof(struct in_addr)) == -1)
-				fprintf(stderr, MOCK "UDP multicast: can't setup bind/input on interface %s: %s\n", host_interface, strerror(errno));
-		}
-
-		if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0)
-		{
-			fprintf(stderr, MOCK "can't join multicast group addr %08x\n", (int)mcast);
-			return false;
-		}
-		else
-			mockverbose("joined multicast group addr %08lx\n", (long)ntohl(mcast));
-	}
-
-	return true;
+                fprintf(stderr, MOCK "UDP multicast: can't setup bind/output on interface %s: %s\n", host_interface, strerror(errno));
+            if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, &mreq.imr_interface, sizeof(struct in_addr)) == -1)
+            {
+                fprintf(stderr, MOCK "UDP multicast: can't setup bind/input on interface %s: %s\n", host_interface, strerror(errno));
+            }
+        }
+
+        if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0)
+        {
+            fprintf(stderr, MOCK "can't join multicast group addr %08x\n", (int)mcast);
+            return false;
+        }
+        else
+        {
+            mockverbose("joined multicast group addr %08lx\n", (long)ntohl(mcast));
+        }
+    }
+
+    return true;
 }
 
 
-size_t mockUDPFillInBuf (int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port)
+size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port)
 {
-	struct sockaddr_storage addrbuf;
-	socklen_t addrbufsize = std::min((socklen_t)sizeof(addrbuf), (socklen_t)16);
-
-	size_t maxread = CCBUFSIZE - ccinbufsize;
-	ssize_t ret = ::recvfrom(sock, ccinbuf + ccinbufsize, maxread, 0/*flags*/, (sockaddr*)&addrbuf, &addrbufsize);
-	if (ret == -1)
-	{
-		if (errno != EAGAIN)
-			fprintf(stderr, MOCK "UDPContext::(read/peek): filling buffer for %zd bytes: %s\n", maxread, strerror(errno));
-		ret = 0;
-	}
-
-	if (ret > 0)
-	{
-		port = ntohs(((sockaddr_in*)&addrbuf)->sin_port);
-		if (addrbuf.ss_family == AF_INET)
-			memcpy(&addr[0], &(((sockaddr_in*)&addrbuf)->sin_addr.s_addr), addrsize = 4);
-		else
-		{
-			fprintf(stderr, MOCK "TODO UDP+IPv6\n");
-			exit(EXIT_FAILURE);
-		}
-	}
-
-	return ccinbufsize += ret;
+    struct sockaddr_storage addrbuf;
+    socklen_t addrbufsize = std::min((socklen_t)sizeof(addrbuf), (socklen_t)16);
+
+    size_t maxread = CCBUFSIZE - ccinbufsize;
+    ssize_t ret = ::recvfrom(sock, ccinbuf + ccinbufsize, maxread, 0/*flags*/, (sockaddr*)&addrbuf, &addrbufsize);
+    if (ret == -1)
+    {
+        if (errno != EAGAIN)
+        {
+            fprintf(stderr, MOCK "UDPContext::(read/peek): filling buffer for %zd bytes: %s\n", maxread, strerror(errno));
+        }
+        ret = 0;
+    }
+
+    if (ret > 0)
+    {
+        port = ntohs(((sockaddr_in*)&addrbuf)->sin_port);
+        if (addrbuf.ss_family == AF_INET)
+        {
+            memcpy(&addr[0], &(((sockaddr_in*)&addrbuf)->sin_addr.s_addr), addrsize = 4);
+        }
+        else
+        {
+            fprintf(stderr, MOCK "TODO UDP+IPv6\n");
+            exit(EXIT_FAILURE);
+        }
+    }
+
+    return ccinbufsize += ret;
 }
 
-size_t mockUDPPeekBytes (int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
 {
-	(void) sock;
-	(void) timeout_ms;  
-	if (usersize > CCBUFSIZE)
-		fprintf(stderr, MOCK "CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
-
-	size_t retsize = 0;
-	if (ccinbufsize)
-	{
-		// data already buffered
-		retsize = usersize;
-		if (retsize > ccinbufsize)
-			retsize = ccinbufsize;
-	}
-	memcpy(dst, ccinbuf, retsize);
-	return retsize;
+    (void) sock;
+    (void) timeout_ms;
+    if (usersize > CCBUFSIZE)
+    {
+        fprintf(stderr, MOCK "CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
+    }
+
+    size_t retsize = 0;
+    if (ccinbufsize)
+    {
+        // data already buffered
+        retsize = usersize;
+        if (retsize > ccinbufsize)
+        {
+            retsize = ccinbufsize;
+        }
+    }
+    memcpy(dst, ccinbuf, retsize);
+    return retsize;
 }
 
-void mockUDPSwallow (size_t copied, char* ccinbuf, size_t& ccinbufsize)
+void mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize)
 {
-	// poor man buffer
-	memmove(ccinbuf, ccinbuf + copied, ccinbufsize - copied);
-	ccinbufsize -= copied;
+    // poor man buffer
+    memmove(ccinbuf, ccinbuf + copied, ccinbufsize - copied);
+    ccinbufsize -= copied;
 }
 
-size_t mockUDPRead (int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
 {
-	size_t copied = mockUDPPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
-	mockUDPSwallow(copied, ccinbuf, ccinbufsize);
-	return copied;
+    size_t copied = mockUDPPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
+    mockUDPSwallow(copied, ccinbuf, ccinbufsize);
+    return copied;
 }
 
-size_t mockUDPWrite (int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port)
+size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port)
 {
-	(void) timeout_ms;
-	// Filling server information
-	struct sockaddr_in peer;
-	peer.sin_family = AF_INET;
-	peer.sin_addr.s_addr = ipv4; //XXFIXME should use lwip_htonl?
-	peer.sin_port = htons(port);
-	int ret = ::sendto(sock, data, size, 0/*flags*/, (const sockaddr*)&peer, sizeof(peer));
-	if (ret == -1)
-	{
-		fprintf(stderr, MOCK "UDPContext::write: write(%d): %s\n", sock, strerror(errno));
-		return 0;
-	}
-	if (ret != (int)size)
-	{
-		fprintf(stderr, MOCK "UDPContext::write: short write (%d < %zd) (TODO)\n", ret, size);
-		exit(EXIT_FAILURE);
-	}
-
-	return ret;
+    (void) timeout_ms;
+    // Filling server information
+    struct sockaddr_in peer;
+    peer.sin_family = AF_INET;
+    peer.sin_addr.s_addr = ipv4; //XXFIXME should use lwip_htonl?
+    peer.sin_port = htons(port);
+    int ret = ::sendto(sock, data, size, 0/*flags*/, (const sockaddr*)&peer, sizeof(peer));
+    if (ret == -1)
+    {
+        fprintf(stderr, MOCK "UDPContext::write: write(%d): %s\n", sock, strerror(errno));
+        return 0;
+    }
+    if (ret != (int)size)
+    {
+        fprintf(stderr, MOCK "UDPContext::write: short write (%d < %zd) (TODO)\n", ret, size);
+        exit(EXIT_FAILURE);
+    }
+
+    return ret;
 }
diff --git a/tests/host/common/WMath.cpp b/tests/host/common/WMath.cpp
index 4fdf07fa2e..8409941db4 100644
--- a/tests/host/common/WMath.cpp
+++ b/tests/host/common/WMath.cpp
@@ -1,62 +1,71 @@
 /* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
 
 /*
- Part of the Wiring project - http://wiring.org.co
- Copyright (c) 2004-06 Hernando Barragan
- Modified 13 August 2006, David A. Mellis for Arduino - http://www.arduino.cc/
- 
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- 
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- Lesser General Public License for more details.
- 
- You should have received a copy of the GNU Lesser General
- Public License along with this library; if not, write to the
- Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- Boston, MA  02111-1307  USA
- 
- $Id$
- */
+    Part of the Wiring project - http://wiring.org.co
+    Copyright (c) 2004-06 Hernando Barragan
+    Modified 13 August 2006, David A. Mellis for Arduino - http://www.arduino.cc/
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General
+    Public License along with this library; if not, write to the
+    Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+    Boston, MA  02111-1307  USA
+
+    $Id$
+*/
 
 extern "C" {
 #include <stdlib.h>
 #include <stdint.h>
 }
 
-void randomSeed(unsigned long seed) {
-    if(seed != 0) {
+void randomSeed(unsigned long seed)
+{
+    if (seed != 0)
+    {
         srand(seed);
     }
 }
 
-long random(long howbig) {
-    if(howbig == 0) {
+long random(long howbig)
+{
+    if (howbig == 0)
+    {
         return 0;
     }
     return (rand()) % howbig;
 }
 
-long random(long howsmall, long howbig) {
-    if(howsmall >= howbig) {
+long random(long howsmall, long howbig)
+{
+    if (howsmall >= howbig)
+    {
         return howsmall;
     }
     long diff = howbig - howsmall;
     return random(diff) + howsmall;
 }
 
-long map(long x, long in_min, long in_max, long out_min, long out_max) {
+long map(long x, long in_min, long in_max, long out_min, long out_max)
+{
     return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
 }
 
-uint16_t makeWord(unsigned int w) {
+uint16_t makeWord(unsigned int w)
+{
     return w;
 }
 
-uint16_t makeWord(unsigned char h, unsigned char l) {
+uint16_t makeWord(unsigned char h, unsigned char l)
+{
     return (h << 8) | l;
 }
diff --git a/tests/host/common/c_types.h b/tests/host/common/c_types.h
index a4c784c7fb..c57b64dd91 100644
--- a/tests/host/common/c_types.h
+++ b/tests/host/common/c_types.h
@@ -6,28 +6,28 @@
 // diff -u common/c_types.h ../../tools/sdk/include/c_types.h
 
 /*
- * ESPRESSIF MIT License
- *
- * Copyright (c) 2016 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
- *
- * Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
- * it is free of charge, to any person obtaining a copy of this software and associated
- * documentation files (the "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the Software is furnished
- * to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all copies or
- * substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
+    ESPRESSIF MIT License
+
+    Copyright (c) 2016 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
+
+    Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
+    it is free of charge, to any person obtaining a copy of this software and associated
+    documentation files (the "Software"), to deal in the Software without restriction, including
+    without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the Software is furnished
+    to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in all copies or
+    substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+    FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+    COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+    IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+*/
 
 #ifndef _C_TYPES_H_
 #define _C_TYPES_H_
@@ -74,7 +74,8 @@ typedef double              real64;
 #endif /* NULL */
 
 /* probably should not put STATUS here */
-typedef enum {
+typedef enum
+{
     OK = 0,
     FAIL,
     PENDING,
diff --git a/tests/host/common/flash_hal_mock.cpp b/tests/host/common/flash_hal_mock.cpp
index 5304d7553a..10b9dba023 100644
--- a/tests/host/common/flash_hal_mock.cpp
+++ b/tests/host/common/flash_hal_mock.cpp
@@ -12,24 +12,29 @@ extern "C"
     uint8_t* s_phys_data = nullptr;
 }
 
-int32_t flash_hal_read(uint32_t addr, uint32_t size, uint8_t *dst) {
+int32_t flash_hal_read(uint32_t addr, uint32_t size, uint8_t *dst)
+{
     memcpy(dst, s_phys_data + addr, size);
     return 0;
 }
 
-int32_t flash_hal_write(uint32_t addr, uint32_t size, const uint8_t *src) {
+int32_t flash_hal_write(uint32_t addr, uint32_t size, const uint8_t *src)
+{
     memcpy(s_phys_data + addr, src, size);
     return 0;
 }
 
-int32_t flash_hal_erase(uint32_t addr, uint32_t size) {
+int32_t flash_hal_erase(uint32_t addr, uint32_t size)
+{
     if ((size & (FLASH_SECTOR_SIZE - 1)) != 0 ||
-        (addr & (FLASH_SECTOR_SIZE - 1)) != 0) {
+            (addr & (FLASH_SECTOR_SIZE - 1)) != 0)
+    {
         abort();
     }
     const uint32_t sector = addr / FLASH_SECTOR_SIZE;
     const uint32_t sectorCount = size / FLASH_SECTOR_SIZE;
-    for (uint32_t i = 0; i < sectorCount; ++i) {
+    for (uint32_t i = 0; i < sectorCount; ++i)
+    {
         memset(s_phys_data + (sector + i) * FLASH_SECTOR_SIZE, 0xff, FLASH_SECTOR_SIZE);
     }
     return 0;
diff --git a/tests/host/common/include/ClientContext.h b/tests/host/common/include/ClientContext.h
index bd9c9b80a5..0c06c889ff 100644
--- a/tests/host/common/include/ClientContext.h
+++ b/tests/host/common/include/ClientContext.h
@@ -1,23 +1,23 @@
 /*
- ClientContext.h - emulation of TCP connection handling on top of lwIP
+    ClientContext.h - emulation of TCP connection handling on top of lwIP
 
- Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
- This file is part of the esp8266 core for Arduino environment.
+    Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
+    This file is part of the esp8266 core for Arduino environment.
 
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
 
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- Lesser General Public License for more details.
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
 
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- */
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
 #ifndef CLIENTCONTEXT_H
 #define CLIENTCONTEXT_H
 
@@ -26,7 +26,7 @@ class WiFiClient;
 
 #include <assert.h>
 
-bool getDefaultPrivateGlobalSyncValue ();
+bool getDefaultPrivateGlobalSyncValue();
 
 typedef void (*discard_cb_t)(void*, ClientContext*);
 
@@ -39,19 +39,19 @@ class ClientContext
     {
         (void)pcb;
     }
-    
-    ClientContext (int sock) :
+
+    ClientContext(int sock) :
         _discard_cb(nullptr), _discard_cb_arg(nullptr), _refcnt(0), _next(nullptr),
         _sync(::getDefaultPrivateGlobalSyncValue()), _sock(sock)
     {
     }
-    
+
     err_t abort()
     {
         if (_sock >= 0)
         {
             ::close(_sock);
-	    mockverbose("socket %d closed\n", _sock);
+            mockverbose("socket %d closed\n", _sock);
         }
         _sock = -1;
         return ERR_ABRT;
@@ -88,11 +88,14 @@ class ClientContext
     void unref()
     {
         DEBUGV(":ur %d\r\n", _refcnt);
-        if(--_refcnt == 0) {
+        if (--_refcnt == 0)
+        {
             discard_received();
             close();
             if (_discard_cb)
-                 _discard_cb(_discard_cb_arg, this);
+            {
+                _discard_cb(_discard_cb_arg, this);
+            }
             DEBUGV(":del\r\n");
             delete this;
         }
@@ -157,9 +160,13 @@ class ClientContext
     size_t getSize()
     {
         if (_sock < 0)
+        {
             return 0;
+        }
         if (_inbufsize)
+        {
             return _inbufsize;
+        }
         ssize_t ret = mockFillInBuf(_sock, _inbuf, _inbufsize);
         if (ret < 0)
         {
@@ -172,10 +179,10 @@ class ClientContext
     int read()
     {
         char c;
-        return read(&c, 1)? (unsigned char)c: -1;
+        return read(&c, 1) ? (unsigned char)c : -1;
     }
 
-    size_t read (char* dst, size_t size)
+    size_t read(char* dst, size_t size)
     {
         ssize_t ret = mockRead(_sock, dst, size, 0, _inbuf, _inbufsize);
         if (ret < 0)
@@ -189,7 +196,7 @@ class ClientContext
     int peek()
     {
         char c;
-        return peekBytes(&c, 1)? c: -1;
+        return peekBytes(&c, 1) ? c : -1;
     }
 
     size_t peekBytes(char *dst, size_t size)
@@ -216,22 +223,22 @@ class ClientContext
 
     uint8_t state()
     {
-	(void)getSize(); // read on socket to force detect closed peer
-        return _sock >= 0? ESTABLISHED: CLOSED;
+        (void)getSize(); // read on socket to force detect closed peer
+        return _sock >= 0 ? ESTABLISHED : CLOSED;
     }
 
     size_t write(const char* data, size_t size)
     {
-	ssize_t ret = mockWrite(_sock, (const uint8_t*)data, size, _timeout_ms);
-	if (ret < 0)
-	{
-	    abort();
-	    return 0;
-	}
-	return ret;
+        ssize_t ret = mockWrite(_sock, (const uint8_t*)data, size, _timeout_ms);
+        if (ret < 0)
+        {
+            abort();
+            return 0;
+        }
+        return ret;
     }
 
-    void keepAlive (uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC, uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC, uint8_t count = TCP_DEFAULT_KEEPALIVE_COUNT)
+    void keepAlive(uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC, uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC, uint8_t count = TCP_DEFAULT_KEEPALIVE_COUNT)
     {
         (void) idle_sec;
         (void) intv_sec;
@@ -239,37 +246,37 @@ class ClientContext
         mockverbose("TODO ClientContext::keepAlive()\n");
     }
 
-    bool isKeepAliveEnabled () const
+    bool isKeepAliveEnabled() const
     {
         mockverbose("TODO ClientContext::isKeepAliveEnabled()\n");
         return false;
     }
 
-    uint16_t getKeepAliveIdle () const
+    uint16_t getKeepAliveIdle() const
     {
         mockverbose("TODO ClientContext::getKeepAliveIdle()\n");
         return 0;
     }
 
-    uint16_t getKeepAliveInterval () const
+    uint16_t getKeepAliveInterval() const
     {
         mockverbose("TODO ClientContext::getKeepAliveInternal()\n");
         return 0;
     }
 
-    uint8_t getKeepAliveCount () const
+    uint8_t getKeepAliveCount() const
     {
         mockverbose("TODO ClientContext::getKeepAliveCount()\n");
         return 0;
     }
 
-    bool getSync () const
+    bool getSync() const
     {
         mockverbose("TODO ClientContext::getSync()\n");
         return _sync;
     }
 
-    void setSync (bool sync)
+    void setSync(bool sync)
     {
         mockverbose("TODO ClientContext::setSync()\n");
         _sync = sync;
@@ -277,13 +284,13 @@ class ClientContext
 
     // return a pointer to available data buffer (size = peekAvailable())
     // semantic forbids any kind of read() before calling peekConsume()
-    const char* peekBuffer ()
+    const char* peekBuffer()
     {
         return _inbuf;
     }
 
     // return number of byte accessible by peekBuffer()
-    size_t peekAvailable ()
+    size_t peekAvailable()
     {
         ssize_t ret = mockPeekBytes(_sock, nullptr, 0, 0, _inbuf, _inbufsize);
         if (ret < 0)
@@ -295,7 +302,7 @@ class ClientContext
     }
 
     // consume bytes after use (see peekBuffer)
-    void peekConsume (size_t consume)
+    void peekConsume(size_t consume)
     {
         assert(consume <= _inbufsize);
         memmove(_inbuf, _inbuf + consume, _inbufsize - consume);
@@ -309,11 +316,11 @@ class ClientContext
 
     int8_t _refcnt;
     ClientContext* _next;
-    
+
     bool _sync;
-    
+
     // MOCK
-    
+
     int _sock = -1;
     int _timeout_ms = 5000;
 
diff --git a/tests/host/common/include/UdpContext.h b/tests/host/common/include/UdpContext.h
index bf104bc40f..725ce89ca1 100644
--- a/tests/host/common/include/UdpContext.h
+++ b/tests/host/common/include/UdpContext.h
@@ -222,7 +222,9 @@ class UdpContext
         size_t wrt = mockUDPWrite(_sock, (const uint8_t*)_outbuf, _outbufsize, _timeout_ms, dst, dstport);
         err_t ret = _outbufsize ? ERR_OK : ERR_ABRT;
         if (!keepBuffer || wrt == _outbufsize)
+        {
             cancelBuffer();
+        }
         return ret;
     }
 
@@ -242,15 +244,22 @@ class UdpContext
         err_t err;
         esp8266::polledTimeout::oneShotFastMs timeout(timeoutMs);
         while (((err = trySend(addr, port)) != ERR_OK) && !timeout)
+        {
             delay(0);
+        }
         if (err != ERR_OK)
+        {
             cancelBuffer();
+        }
         return err == ERR_OK;
     }
 
     void mock_cb(void)
     {
-        if (_on_rx) _on_rx();
+        if (_on_rx)
+        {
+            _on_rx();
+        }
     }
 
 public:
@@ -270,7 +279,9 @@ class UdpContext
             //ip4_addr_set_u32(&ip_2_ip4(_dst), *(uint32_t*)addr);
         }
         else
+        {
             mockverbose("TODO unhandled udp address of size %d\n", (int)addrsize);
+        }
     }
 
     int _sock = -1;
diff --git a/tests/host/common/littlefs_mock.cpp b/tests/host/common/littlefs_mock.cpp
index 0d99e82b1e..8377eb3b80 100644
--- a/tests/host/common/littlefs_mock.cpp
+++ b/tests/host/common/littlefs_mock.cpp
@@ -1,19 +1,19 @@
 /*
- littlefs_mock.cpp - LittleFS mock for host side testing
- Copyright © 2019 Earle F. Philhower, III
+    littlefs_mock.cpp - LittleFS mock for host side testing
+    Copyright © 2019 Earle F. Philhower, III
 
- Based off spiffs_mock.cpp:
- Copyright © 2016 Ivan Grokhotkov
+    Based off spiffs_mock.cpp:
+    Copyright © 2016 Ivan Grokhotkov
 
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
 
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
 */
 
 
@@ -42,7 +42,9 @@ LittleFSMock::LittleFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, con
 {
     m_storage = storage;
     if ((m_overwrite = (fs_size < 0)))
+    {
         fs_size = -fs_size;
+    }
 
     fprintf(stderr, "LittleFS: %zd bytes\n", fs_size);
 
@@ -73,26 +75,28 @@ LittleFSMock::~LittleFSMock()
     LittleFS = FS(FSImplPtr(nullptr));
 }
 
-void LittleFSMock::load ()
+void LittleFSMock::load()
 {
     if (!m_fs.size() || !m_storage.length())
+    {
         return;
-    
+    }
+
     int fs = ::open(m_storage.c_str(), O_RDONLY);
     if (fs == -1)
     {
         fprintf(stderr, "LittleFS: loading '%s': %s\n", m_storage.c_str(), strerror(errno));
         return;
     }
-    
+
     off_t flen = lseek(fs, 0, SEEK_END);
-    if (flen == (off_t)-1)
+    if (flen == (off_t) -1)
     {
         fprintf(stderr, "LittleFS: checking size of '%s': %s\n", m_storage.c_str(), strerror(errno));
         return;
     }
     lseek(fs, 0, SEEK_SET);
-    
+
     if (flen != (off_t)m_fs.size())
     {
         fprintf(stderr, "LittleFS: size of '%s': %d does not match requested size %zd\n", m_storage.c_str(), (int)flen, m_fs.size());
@@ -108,15 +112,19 @@ void LittleFSMock::load ()
         fprintf(stderr, "LittleFS: loading %zi bytes from '%s'\n", m_fs.size(), m_storage.c_str());
         ssize_t r = ::read(fs, m_fs.data(), m_fs.size());
         if (r != (ssize_t)m_fs.size())
+        {
             fprintf(stderr, "LittleFS: reading %zi bytes: returned %zd: %s\n", m_fs.size(), r, strerror(errno));
+        }
     }
     ::close(fs);
 }
 
-void LittleFSMock::save ()
+void LittleFSMock::save()
 {
     if (!m_fs.size() || !m_storage.length())
+    {
         return;
+    }
 
     int fs = ::open(m_storage.c_str(), O_CREAT | O_TRUNC | O_WRONLY, 0644);
     if (fs == -1)
@@ -127,7 +135,11 @@ void LittleFSMock::save ()
     fprintf(stderr, "LittleFS: saving %zi bytes to '%s'\n", m_fs.size(), m_storage.c_str());
 
     if (::write(fs, m_fs.data(), m_fs.size()) != (ssize_t)m_fs.size())
+    {
         fprintf(stderr, "LittleFS: writing %zi bytes: %s\n", m_fs.size(), strerror(errno));
+    }
     if (::close(fs) == -1)
+    {
         fprintf(stderr, "LittleFS: closing %s: %s\n", m_storage.c_str(), strerror(errno));
+    }
 }
diff --git a/tests/host/common/littlefs_mock.h b/tests/host/common/littlefs_mock.h
index 0905fa9322..283a61f1b5 100644
--- a/tests/host/common/littlefs_mock.h
+++ b/tests/host/common/littlefs_mock.h
@@ -1,19 +1,19 @@
 /*
- littlefs_mock.h - LittleFS HAL mock for host side testing
- Copyright © 2019 Earle F. Philhower, III
-
- Based on spiffs_mock:
- Copyright © 2016 Ivan Grokhotkov
- 
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- 
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
+    littlefs_mock.h - LittleFS HAL mock for host side testing
+    Copyright © 2019 Earle F. Philhower, III
+
+    Based on spiffs_mock:
+    Copyright © 2016 Ivan Grokhotkov
+
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
 */
 
 #ifndef littlefs_mock_hpp
@@ -27,15 +27,16 @@
 
 #define DEFAULT_LITTLEFS_FILE_NAME "littlefs.bin"
 
-class LittleFSMock {
+class LittleFSMock
+{
 public:
     LittleFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString);
     void reset();
     ~LittleFSMock();
-    
+
 protected:
-    void load ();
-    void save ();
+    void load();
+    void save();
 
     std::vector<uint8_t> m_fs;
     String m_storage;
diff --git a/tests/host/common/md5.c b/tests/host/common/md5.c
index 4b58f261f3..195ffa0785 100644
--- a/tests/host/common/md5.c
+++ b/tests/host/common/md5.c
@@ -1,36 +1,36 @@
 /*
- * Copyright (c) 2007, Cameron Rich
- * 
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, 
- *   this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice, 
- *   this list of conditions and the following disclaimer in the documentation 
- *   and/or other materials provided with the distribution.
- * * Neither the name of the axTLS project nor the names of its contributors 
- *   may be used to endorse or promote products derived from this software 
- *   without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+    Copyright (c) 2007, Cameron Rich
+
+    All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions are met:
+
+ * * Redistributions of source code must retain the above copyright notice,
+     this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+     this list of conditions and the following disclaimer in the documentation
+     and/or other materials provided with the distribution.
+ * * Neither the name of the axTLS project nor the names of its contributors
+     may be used to endorse or promote products derived from this software
+     without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
 
 /**
- * This file implements the MD5 algorithm as defined in RFC1321
- */
+    This file implements the MD5 algorithm as defined in RFC1321
+*/
 
 #include <string.h>
 #include <stdint.h>
@@ -39,18 +39,18 @@
 #define EXP_FUNC extern
 #define STDCALL
 
-#define MD5_SIZE    16 
+#define MD5_SIZE    16
 
-typedef struct 
+typedef struct
 {
-  uint32_t state[4];        /* state (ABCD) */
-  uint32_t count[2];        /* number of bits, modulo 2^64 (lsb first) */
-  uint8_t buffer[64];       /* input buffer */
+    uint32_t state[4];        /* state (ABCD) */
+    uint32_t count[2];        /* number of bits, modulo 2^64 (lsb first) */
+    uint8_t buffer[64];       /* input buffer */
 } MD5_CTX;
 
 
-/* Constants for MD5Transform routine.
- */
+/*  Constants for MD5Transform routine.
+*/
 #define S11 7
 #define S12 12
 #define S13 17
@@ -73,15 +73,15 @@ static void MD5Transform(uint32_t state[4], const uint8_t block[64]);
 static void Encode(uint8_t *output, uint32_t *input, uint32_t len);
 static void Decode(uint32_t *output, const uint8_t *input, uint32_t len);
 
-static const uint8_t PADDING[64] = 
+static const uint8_t PADDING[64] =
 {
     0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
-/* F, G, H and I are basic MD5 functions.
- */
+/*  F, G, H and I are basic MD5 functions.
+*/
 #define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
 #define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
 #define H(x, y, z) ((x) ^ (y) ^ (z))
@@ -90,8 +90,8 @@ static const uint8_t PADDING[64] =
 /* ROTATE_LEFT rotates x left n bits.  */
 #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
 
-/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
-   Rotation is separate from addition to prevent recomputation.  */
+/*  FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
+    Rotation is separate from addition to prevent recomputation.  */
 #define FF(a, b, c, d, x, s, ac) { \
     (a) += F ((b), (c), (d)) + (x) + (uint32_t)(ac); \
     (a) = ROTATE_LEFT ((a), (s)); \
@@ -114,14 +114,14 @@ static const uint8_t PADDING[64] =
   }
 
 /**
- * MD5 initialization - begins an MD5 operation, writing a new ctx.
- */
+    MD5 initialization - begins an MD5 operation, writing a new ctx.
+*/
 EXP_FUNC void STDCALL MD5Init(MD5_CTX *ctx)
 {
     ctx->count[0] = ctx->count[1] = 0;
 
-    /* Load magic initialization constants.
-     */
+    /*  Load magic initialization constants.
+    */
     ctx->state[0] = 0x67452301;
     ctx->state[1] = 0xefcdab89;
     ctx->state[2] = 0x98badcfe;
@@ -129,8 +129,8 @@ EXP_FUNC void STDCALL MD5Init(MD5_CTX *ctx)
 }
 
 /**
- * Accepts an array of octets as the next portion of the message.
- */
+    Accepts an array of octets as the next portion of the message.
+*/
 EXP_FUNC void STDCALL MD5Update(MD5_CTX *ctx, const uint8_t * msg, int len)
 {
     uint32_t x;
@@ -141,32 +141,38 @@ EXP_FUNC void STDCALL MD5Update(MD5_CTX *ctx, const uint8_t * msg, int len)
 
     /* Update number of bits */
     if ((ctx->count[0] += ((uint32_t)len << 3)) < ((uint32_t)len << 3))
+    {
         ctx->count[1]++;
+    }
     ctx->count[1] += ((uint32_t)len >> 29);
 
     partLen = 64 - x;
 
     /* Transform as many times as possible.  */
-    if (len >= partLen) 
+    if (len >= partLen)
     {
         memcpy(&ctx->buffer[x], msg, partLen);
         MD5Transform(ctx->state, ctx->buffer);
 
         for (i = partLen; i + 63 < len; i += 64)
+        {
             MD5Transform(ctx->state, &msg[i]);
+        }
 
         x = 0;
     }
     else
+    {
         i = 0;
+    }
 
     /* Buffer remaining input */
-    memcpy(&ctx->buffer[x], &msg[i], len-i);
+    memcpy(&ctx->buffer[x], &msg[i], len - i);
 }
 
 /**
- * Return the 128-bit message digest into the user's array
- */
+    Return the 128-bit message digest into the user's array
+*/
 EXP_FUNC void STDCALL MD5Final(uint8_t *digest, MD5_CTX *ctx)
 {
     uint8_t bits[8];
@@ -175,8 +181,8 @@ EXP_FUNC void STDCALL MD5Final(uint8_t *digest, MD5_CTX *ctx)
     /* Save number of bits */
     Encode(bits, ctx->count, 8);
 
-    /* Pad out to 56 mod 64.
-     */
+    /*  Pad out to 56 mod 64.
+    */
     x = (uint32_t)((ctx->count[0] >> 3) & 0x3f);
     padLen = (x < 56) ? (56 - x) : (120 - x);
     MD5Update(ctx, PADDING, padLen);
@@ -189,86 +195,86 @@ EXP_FUNC void STDCALL MD5Final(uint8_t *digest, MD5_CTX *ctx)
 }
 
 /**
- * MD5 basic transformation. Transforms state based on block.
- */
+    MD5 basic transformation. Transforms state based on block.
+*/
 static void MD5Transform(uint32_t state[4], const uint8_t block[64])
 {
-    uint32_t a = state[0], b = state[1], c = state[2], 
+    uint32_t a = state[0], b = state[1], c = state[2],
              d = state[3], x[MD5_SIZE];
 
     Decode(x, block, 64);
 
     /* Round 1 */
-    FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
-    FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
-    FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
-    FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
-    FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
-    FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
-    FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
-    FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
-    FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
-    FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
-    FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
-    FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
-    FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
-    FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
-    FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
-    FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
+    FF(a, b, c, d, x[ 0], S11, 0xd76aa478);  /* 1 */
+    FF(d, a, b, c, x[ 1], S12, 0xe8c7b756);  /* 2 */
+    FF(c, d, a, b, x[ 2], S13, 0x242070db);  /* 3 */
+    FF(b, c, d, a, x[ 3], S14, 0xc1bdceee);  /* 4 */
+    FF(a, b, c, d, x[ 4], S11, 0xf57c0faf);  /* 5 */
+    FF(d, a, b, c, x[ 5], S12, 0x4787c62a);  /* 6 */
+    FF(c, d, a, b, x[ 6], S13, 0xa8304613);  /* 7 */
+    FF(b, c, d, a, x[ 7], S14, 0xfd469501);  /* 8 */
+    FF(a, b, c, d, x[ 8], S11, 0x698098d8);  /* 9 */
+    FF(d, a, b, c, x[ 9], S12, 0x8b44f7af);  /* 10 */
+    FF(c, d, a, b, x[10], S13, 0xffff5bb1);  /* 11 */
+    FF(b, c, d, a, x[11], S14, 0x895cd7be);  /* 12 */
+    FF(a, b, c, d, x[12], S11, 0x6b901122);  /* 13 */
+    FF(d, a, b, c, x[13], S12, 0xfd987193);  /* 14 */
+    FF(c, d, a, b, x[14], S13, 0xa679438e);  /* 15 */
+    FF(b, c, d, a, x[15], S14, 0x49b40821);  /* 16 */
 
     /* Round 2 */
-    GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
-    GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
-    GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
-    GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
-    GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
-    GG (d, a, b, c, x[10], S22,  0x2441453); /* 22 */
-    GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
-    GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
-    GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
-    GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
-    GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
-    GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
-    GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
-    GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
-    GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
-    GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
+    GG(a, b, c, d, x[ 1], S21, 0xf61e2562);  /* 17 */
+    GG(d, a, b, c, x[ 6], S22, 0xc040b340);  /* 18 */
+    GG(c, d, a, b, x[11], S23, 0x265e5a51);  /* 19 */
+    GG(b, c, d, a, x[ 0], S24, 0xe9b6c7aa);  /* 20 */
+    GG(a, b, c, d, x[ 5], S21, 0xd62f105d);  /* 21 */
+    GG(d, a, b, c, x[10], S22,  0x2441453);  /* 22 */
+    GG(c, d, a, b, x[15], S23, 0xd8a1e681);  /* 23 */
+    GG(b, c, d, a, x[ 4], S24, 0xe7d3fbc8);  /* 24 */
+    GG(a, b, c, d, x[ 9], S21, 0x21e1cde6);  /* 25 */
+    GG(d, a, b, c, x[14], S22, 0xc33707d6);  /* 26 */
+    GG(c, d, a, b, x[ 3], S23, 0xf4d50d87);  /* 27 */
+    GG(b, c, d, a, x[ 8], S24, 0x455a14ed);  /* 28 */
+    GG(a, b, c, d, x[13], S21, 0xa9e3e905);  /* 29 */
+    GG(d, a, b, c, x[ 2], S22, 0xfcefa3f8);  /* 30 */
+    GG(c, d, a, b, x[ 7], S23, 0x676f02d9);  /* 31 */
+    GG(b, c, d, a, x[12], S24, 0x8d2a4c8a);  /* 32 */
 
     /* Round 3 */
-    HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
-    HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
-    HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
-    HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
-    HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
-    HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
-    HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
-    HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
-    HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
-    HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
-    HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
-    HH (b, c, d, a, x[ 6], S34,  0x4881d05); /* 44 */
-    HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
-    HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
-    HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
-    HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
+    HH(a, b, c, d, x[ 5], S31, 0xfffa3942);  /* 33 */
+    HH(d, a, b, c, x[ 8], S32, 0x8771f681);  /* 34 */
+    HH(c, d, a, b, x[11], S33, 0x6d9d6122);  /* 35 */
+    HH(b, c, d, a, x[14], S34, 0xfde5380c);  /* 36 */
+    HH(a, b, c, d, x[ 1], S31, 0xa4beea44);  /* 37 */
+    HH(d, a, b, c, x[ 4], S32, 0x4bdecfa9);  /* 38 */
+    HH(c, d, a, b, x[ 7], S33, 0xf6bb4b60);  /* 39 */
+    HH(b, c, d, a, x[10], S34, 0xbebfbc70);  /* 40 */
+    HH(a, b, c, d, x[13], S31, 0x289b7ec6);  /* 41 */
+    HH(d, a, b, c, x[ 0], S32, 0xeaa127fa);  /* 42 */
+    HH(c, d, a, b, x[ 3], S33, 0xd4ef3085);  /* 43 */
+    HH(b, c, d, a, x[ 6], S34,  0x4881d05);  /* 44 */
+    HH(a, b, c, d, x[ 9], S31, 0xd9d4d039);  /* 45 */
+    HH(d, a, b, c, x[12], S32, 0xe6db99e5);  /* 46 */
+    HH(c, d, a, b, x[15], S33, 0x1fa27cf8);  /* 47 */
+    HH(b, c, d, a, x[ 2], S34, 0xc4ac5665);  /* 48 */
 
     /* Round 4 */
-    II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
-    II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
-    II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
-    II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
-    II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
-    II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
-    II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
-    II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
-    II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
-    II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
-    II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
-    II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
-    II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
-    II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
-    II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
-    II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
+    II(a, b, c, d, x[ 0], S41, 0xf4292244);  /* 49 */
+    II(d, a, b, c, x[ 7], S42, 0x432aff97);  /* 50 */
+    II(c, d, a, b, x[14], S43, 0xab9423a7);  /* 51 */
+    II(b, c, d, a, x[ 5], S44, 0xfc93a039);  /* 52 */
+    II(a, b, c, d, x[12], S41, 0x655b59c3);  /* 53 */
+    II(d, a, b, c, x[ 3], S42, 0x8f0ccc92);  /* 54 */
+    II(c, d, a, b, x[10], S43, 0xffeff47d);  /* 55 */
+    II(b, c, d, a, x[ 1], S44, 0x85845dd1);  /* 56 */
+    II(a, b, c, d, x[ 8], S41, 0x6fa87e4f);  /* 57 */
+    II(d, a, b, c, x[15], S42, 0xfe2ce6e0);  /* 58 */
+    II(c, d, a, b, x[ 6], S43, 0xa3014314);  /* 59 */
+    II(b, c, d, a, x[13], S44, 0x4e0811a1);  /* 60 */
+    II(a, b, c, d, x[ 4], S41, 0xf7537e82);  /* 61 */
+    II(d, a, b, c, x[11], S42, 0xbd3af235);  /* 62 */
+    II(c, d, a, b, x[ 2], S43, 0x2ad7d2bb);  /* 63 */
+    II(b, c, d, a, x[ 9], S44, 0xeb86d391);  /* 64 */
 
     state[0] += a;
     state[1] += b;
@@ -277,31 +283,31 @@ static void MD5Transform(uint32_t state[4], const uint8_t block[64])
 }
 
 /**
- * Encodes input (uint32_t) into output (uint8_t). Assumes len is
- *   a multiple of 4.
- */
+    Encodes input (uint32_t) into output (uint8_t). Assumes len is
+     a multiple of 4.
+*/
 static void Encode(uint8_t *output, uint32_t *input, uint32_t len)
 {
     uint32_t i, j;
 
-    for (i = 0, j = 0; j < len; i++, j += 4) 
+    for (i = 0, j = 0; j < len; i++, j += 4)
     {
         output[j] = (uint8_t)(input[i] & 0xff);
-        output[j+1] = (uint8_t)((input[i] >> 8) & 0xff);
-        output[j+2] = (uint8_t)((input[i] >> 16) & 0xff);
-        output[j+3] = (uint8_t)((input[i] >> 24) & 0xff);
+        output[j + 1] = (uint8_t)((input[i] >> 8) & 0xff);
+        output[j + 2] = (uint8_t)((input[i] >> 16) & 0xff);
+        output[j + 3] = (uint8_t)((input[i] >> 24) & 0xff);
     }
 }
 
 /**
- *  Decodes input (uint8_t) into output (uint32_t). Assumes len is
- *   a multiple of 4.
- */
+    Decodes input (uint8_t) into output (uint32_t). Assumes len is
+     a multiple of 4.
+*/
 static void Decode(uint32_t *output, const uint8_t *input, uint32_t len)
 {
     uint32_t i, j;
 
     for (i = 0, j = 0; j < len; i++, j += 4)
-        output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j+1]) << 8) |
-            (((uint32_t)input[j+2]) << 16) | (((uint32_t)input[j+3]) << 24);
+        output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j + 1]) << 8) |
+                    (((uint32_t)input[j + 2]) << 16) | (((uint32_t)input[j + 3]) << 24);
 }
diff --git a/tests/host/common/mock.h b/tests/host/common/mock.h
index 56919ee60a..a0af18f5b7 100644
--- a/tests/host/common/mock.h
+++ b/tests/host/common/mock.h
@@ -1,32 +1,32 @@
 /*
- Arduino emulation - common to all emulated code
- Copyright (c) 2018 david gauchard. All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal with the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- - Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimers.
-
- - Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimers in the
-   documentation and/or other materials provided with the distribution.
-
- - The names of its contributors may not be used to endorse or promote
-   products derived from this Software without specific prior written
-   permission.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS WITH THE SOFTWARE.
+    Arduino emulation - common to all emulated code
+    Copyright (c) 2018 david gauchard. All rights reserved.
+
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the "Software"),
+    to deal with the Software without restriction, including without limitation
+    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+    and/or sell copies of the Software, and to permit persons to whom the
+    Software is furnished to do so, subject to the following conditions:
+
+    - Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimers.
+
+    - Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimers in the
+    documentation and/or other materials provided with the distribution.
+
+    - The names of its contributors may not be used to endorse or promote
+    products derived from this Software without specific prior written
+    permission.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+    DEALINGS WITH THE SOFTWARE.
 */
 
 #define CORE_MOCK 1
@@ -60,8 +60,8 @@
 extern "C" {
 #endif
 // TODO: #include <stdlib_noniso.h> ?
-char* itoa (int val, char *s, int radix);
-char* ltoa (long val, char *s, int radix);
+char* itoa(int val, char *s, int radix);
+char* ltoa(long val, char *s, int radix);
 
 
 size_t strlcat(char *dst, const char *src, size_t size);
@@ -100,12 +100,15 @@ uint32_t esp_get_cycle_count();
 extern "C" {
 #endif
 #include <osapi.h>
-int ets_printf (const char* fmt, ...) __attribute__ ((format (printf, 1, 2)));
+int ets_printf(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
 #define os_printf_plus printf
 #define ets_vsnprintf vsnprintf
-inline void ets_putc (char c) { putchar(c); }
+inline void ets_putc(char c)
+{
+    putchar(c);
+}
 
-int mockverbose (const char* fmt, ...) __attribute__ ((format (printf, 1, 2)));
+int mockverbose(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
 
 extern const char* host_interface; // cmdline parameter
 extern bool serial_timestamp;
@@ -140,33 +143,33 @@ void uart_new_data(const int uart_nr, uint8_t data);
 #endif
 
 // tcp
-int    mockSockSetup  (int sock);
-int    mockConnect    (uint32_t addr, int& sock, int port);
-ssize_t mockFillInBuf (int sock, char* ccinbuf, size_t& ccinbufsize);
-ssize_t mockPeekBytes (int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
-ssize_t mockRead      (int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
-ssize_t mockWrite     (int sock, const uint8_t* data, size_t size, int timeout_ms);
-int serverAccept (int sock);
+int    mockSockSetup(int sock);
+int    mockConnect(uint32_t addr, int& sock, int port);
+ssize_t mockFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize);
+ssize_t mockPeekBytes(int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
+ssize_t mockRead(int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
+ssize_t mockWrite(int sock, const uint8_t* data, size_t size, int timeout_ms);
+int serverAccept(int sock);
 
 // udp
-void check_incoming_udp ();
-int mockUDPSocket ();
-bool mockUDPListen (int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast = 0);
-size_t mockUDPFillInBuf (int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port);
-size_t mockUDPPeekBytes (int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
-size_t mockUDPRead (int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
-size_t mockUDPWrite (int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port);
-void mockUDPSwallow (size_t copied, char* ccinbuf, size_t& ccinbufsize);
+void check_incoming_udp();
+int mockUDPSocket();
+bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast = 0);
+size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port);
+size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
+size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
+size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port);
+void mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize);
 
 class UdpContext;
-void register_udp (int sock, UdpContext* udp = nullptr);
+void register_udp(int sock, UdpContext* udp = nullptr);
 
 //
 
-void mock_start_spiffs (const String& fname, size_t size_kb, size_t block_kb = 8, size_t page_b = 512);
-void mock_stop_spiffs ();
-void mock_start_littlefs (const String& fname, size_t size_kb, size_t block_kb = 8, size_t page_b = 512);
-void mock_stop_littlefs ();
+void mock_start_spiffs(const String& fname, size_t size_kb, size_t block_kb = 8, size_t page_b = 512);
+void mock_stop_spiffs();
+void mock_start_littlefs(const String& fname, size_t size_kb, size_t block_kb = 8, size_t page_b = 512);
+void mock_stop_littlefs();
 
 //
 
diff --git a/tests/host/common/noniso.c b/tests/host/common/noniso.c
index 869a4b7f8e..5ef9c85774 100644
--- a/tests/host/common/noniso.c
+++ b/tests/host/common/noniso.c
@@ -1,16 +1,16 @@
 /*
- noniso.cpp - replacements for non-ISO functions used by Arduino core
- Copyright © 2016 Ivan Grokhotkov
- 
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- 
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
+    noniso.cpp - replacements for non-ISO functions used by Arduino core
+    Copyright © 2016 Ivan Grokhotkov
+
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
 */
 
 
@@ -22,10 +22,12 @@
 #include "stdlib_noniso.h"
 
 
-void reverse(char* begin, char* end) {
+void reverse(char* begin, char* end)
+{
     char *is = begin;
     char *ie = end - 1;
-    while(is < ie) {
+    while (is < ie)
+    {
         char tmp = *ie;
         *ie = *is;
         *is = tmp;
@@ -34,8 +36,10 @@ void reverse(char* begin, char* end) {
     }
 }
 
-char* utoa(unsigned value, char* result, int base) {
-    if(base < 2 || base > 16) {
+char* utoa(unsigned value, char* result, int base)
+{
+    if (base < 2 || base > 16)
+    {
         *result = 0;
         return result;
     }
@@ -43,56 +47,66 @@ char* utoa(unsigned value, char* result, int base) {
     char* out = result;
     unsigned quotient = value;
 
-    do {
+    do
+    {
         const unsigned tmp = quotient / base;
         *out = "0123456789abcdef"[quotient - (tmp * base)];
         ++out;
         quotient = tmp;
-    } while(quotient);
+    } while (quotient);
 
     reverse(result, out);
     *out = 0;
     return result;
 }
 
-char* itoa(int value, char* result, int base) {
-    if(base < 2 || base > 16) {
+char* itoa(int value, char* result, int base)
+{
+    if (base < 2 || base > 16)
+    {
         *result = 0;
         return result;
     }
-    if (base != 10) {
-	return utoa((unsigned)value, result, base);
-   }
+    if (base != 10)
+    {
+        return utoa((unsigned)value, result, base);
+    }
 
     char* out = result;
     int quotient = abs(value);
 
-    do {
+    do
+    {
         const int tmp = quotient / base;
         *out = "0123456789abcdef"[quotient - (tmp * base)];
         ++out;
         quotient = tmp;
-    } while(quotient);
+    } while (quotient);
 
     // Apply negative sign
-    if(value < 0)
+    if (value < 0)
+    {
         *out++ = '-';
+    }
 
     reverse(result, out);
     *out = 0;
     return result;
 }
 
-int atoi(const char* s) {
+int atoi(const char* s)
+{
     return (int) atol(s);
 }
 
-long atol(const char* s) {
+long atol(const char* s)
+{
     char * tmp;
     return strtol(s, &tmp, 10);
 }
 
-double atof(const char* s) {
+double atof(const char* s)
+{
     char * tmp;
     return strtod(s, &tmp);
 }
diff --git a/tests/host/common/pins_arduino.h b/tests/host/common/pins_arduino.h
index ad051ed24a..5c33e0f119 100644
--- a/tests/host/common/pins_arduino.h
+++ b/tests/host/common/pins_arduino.h
@@ -1,17 +1,17 @@
 /*
- pins_arduino.h
- Copyright © 2016 Ivan Grokhotkov
- 
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- 
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- */
+    pins_arduino.h
+    Copyright © 2016 Ivan Grokhotkov
+
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
+*/
 #ifndef pins_arduino_h
 #define pins_arduino_h
 
diff --git a/tests/host/common/queue.h b/tests/host/common/queue.h
index af637ca030..778241d2a5 100644
--- a/tests/host/common/queue.h
+++ b/tests/host/common/queue.h
@@ -1,38 +1,38 @@
 /*
- * Copyright (c) 1991, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *	@(#)queue.h	8.5 (Berkeley) 8/20/94
- * $FreeBSD: src/sys/sys/queue.h,v 1.48 2002/04/17 14:00:37 tmm Exp $
- */
+    Copyright (c) 1991, 1993
+ 	The Regents of the University of California.  All rights reserved.
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met:
+    1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    3. All advertising materials mentioning features or use of this software
+      must display the following acknowledgement:
+ 	This product includes software developed by the University of
+ 	California, Berkeley and its contributors.
+    4. Neither the name of the University nor the names of its contributors
+      may be used to endorse or promote products derived from this software
+      without specific prior written permission.
+
+    THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+    ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+    SUCH DAMAGE.
+
+ 	@(#)queue.h	8.5 (Berkeley) 8/20/94
+    $FreeBSD: src/sys/sys/queue.h,v 1.48 2002/04/17 14:00:37 tmm Exp $
+*/
 
 #ifndef _SYS_QUEUE_H_
 #define	_SYS_QUEUE_H_
@@ -40,72 +40,72 @@
 #include <machine/ansi.h>	/* for __offsetof */
 
 /*
- * This file defines four types of data structures: singly-linked lists,
- * singly-linked tail queues, lists and tail queues.
- *
- * A singly-linked list is headed by a single forward pointer. The elements
- * are singly linked for minimum space and pointer manipulation overhead at
- * the expense of O(n) removal for arbitrary elements. New elements can be
- * added to the list after an existing element or at the head of the list.
- * Elements being removed from the head of the list should use the explicit
- * macro for this purpose for optimum efficiency. A singly-linked list may
- * only be traversed in the forward direction.  Singly-linked lists are ideal
- * for applications with large datasets and few or no removals or for
- * implementing a LIFO queue.
- *
- * A singly-linked tail queue is headed by a pair of pointers, one to the
- * head of the list and the other to the tail of the list. The elements are
- * singly linked for minimum space and pointer manipulation overhead at the
- * expense of O(n) removal for arbitrary elements. New elements can be added
- * to the list after an existing element, at the head of the list, or at the
- * end of the list. Elements being removed from the head of the tail queue
- * should use the explicit macro for this purpose for optimum efficiency.
- * A singly-linked tail queue may only be traversed in the forward direction.
- * Singly-linked tail queues are ideal for applications with large datasets
- * and few or no removals or for implementing a FIFO queue.
- *
- * A list is headed by a single forward pointer (or an array of forward
- * pointers for a hash table header). The elements are doubly linked
- * so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before
- * or after an existing element or at the head of the list. A list
- * may only be traversed in the forward direction.
- *
- * A tail queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or
- * after an existing element, at the head of the list, or at the end of
- * the list. A tail queue may be traversed in either direction.
- *
- * For details on the use of these macros, see the queue(3) manual page.
- *
- *
- *			SLIST	LIST	STAILQ	TAILQ
- * _HEAD		+	+	+	+
- * _HEAD_INITIALIZER	+	+	+	+
- * _ENTRY		+	+	+	+
- * _INIT		+	+	+	+
- * _EMPTY		+	+	+	+
- * _FIRST		+	+	+	+
- * _NEXT		+	+	+	+
- * _PREV		-	-	-	+
- * _LAST		-	-	+	+
- * _FOREACH		+	+	+	+
- * _FOREACH_REVERSE	-	-	-	+
- * _INSERT_HEAD		+	+	+	+
- * _INSERT_BEFORE	-	+	-	+
- * _INSERT_AFTER	+	+	+	+
- * _INSERT_TAIL		-	-	+	+
- * _CONCAT		-	-	+	+
- * _REMOVE_HEAD		+	-	+	-
- * _REMOVE		+	+	+	+
- *
- */
+    This file defines four types of data structures: singly-linked lists,
+    singly-linked tail queues, lists and tail queues.
+
+    A singly-linked list is headed by a single forward pointer. The elements
+    are singly linked for minimum space and pointer manipulation overhead at
+    the expense of O(n) removal for arbitrary elements. New elements can be
+    added to the list after an existing element or at the head of the list.
+    Elements being removed from the head of the list should use the explicit
+    macro for this purpose for optimum efficiency. A singly-linked list may
+    only be traversed in the forward direction.  Singly-linked lists are ideal
+    for applications with large datasets and few or no removals or for
+    implementing a LIFO queue.
+
+    A singly-linked tail queue is headed by a pair of pointers, one to the
+    head of the list and the other to the tail of the list. The elements are
+    singly linked for minimum space and pointer manipulation overhead at the
+    expense of O(n) removal for arbitrary elements. New elements can be added
+    to the list after an existing element, at the head of the list, or at the
+    end of the list. Elements being removed from the head of the tail queue
+    should use the explicit macro for this purpose for optimum efficiency.
+    A singly-linked tail queue may only be traversed in the forward direction.
+    Singly-linked tail queues are ideal for applications with large datasets
+    and few or no removals or for implementing a FIFO queue.
+
+    A list is headed by a single forward pointer (or an array of forward
+    pointers for a hash table header). The elements are doubly linked
+    so that an arbitrary element can be removed without a need to
+    traverse the list. New elements can be added to the list before
+    or after an existing element or at the head of the list. A list
+    may only be traversed in the forward direction.
+
+    A tail queue is headed by a pair of pointers, one to the head of the
+    list and the other to the tail of the list. The elements are doubly
+    linked so that an arbitrary element can be removed without a need to
+    traverse the list. New elements can be added to the list before or
+    after an existing element, at the head of the list, or at the end of
+    the list. A tail queue may be traversed in either direction.
+
+    For details on the use of these macros, see the queue(3) manual page.
+
+
+ 			SLIST	LIST	STAILQ	TAILQ
+    _HEAD		+	+	+	+
+    _HEAD_INITIALIZER	+	+	+	+
+    _ENTRY		+	+	+	+
+    _INIT		+	+	+	+
+    _EMPTY		+	+	+	+
+    _FIRST		+	+	+	+
+    _NEXT		+	+	+	+
+    _PREV		-	-	-	+
+    _LAST		-	-	+	+
+    _FOREACH		+	+	+	+
+    _FOREACH_REVERSE	-	-	-	+
+    _INSERT_HEAD		+	+	+	+
+    _INSERT_BEFORE	-	+	-	+
+    _INSERT_AFTER	+	+	+	+
+    _INSERT_TAIL		-	-	+	+
+    _CONCAT		-	-	+	+
+    _REMOVE_HEAD		+	-	+	-
+    _REMOVE		+	+	+	+
+
+*/
 
 /*
- * Singly-linked List declarations.
- */
+    Singly-linked List declarations.
+*/
 #define	SLIST_HEAD(name, type)						\
 struct name {								\
 	struct type *slh_first;	/* first element */			\
@@ -113,15 +113,15 @@ struct name {								\
 
 #define	SLIST_HEAD_INITIALIZER(head)					\
 	{ NULL }
- 
+
 #define	SLIST_ENTRY(type)						\
 struct {								\
 	struct type *sle_next;	/* next element */			\
 }
- 
+
 /*
- * Singly-linked List functions.
- */
+    Singly-linked List functions.
+*/
 #define	SLIST_EMPTY(head)	((head)->slh_first == NULL)
 
 #define	SLIST_FIRST(head)	((head)->slh_first)
@@ -165,8 +165,8 @@ struct {								\
 } while (0)
 
 /*
- * Singly-linked Tail queue declarations.
- */
+    Singly-linked Tail queue declarations.
+*/
 #define	STAILQ_HEAD(name, type)						\
 struct name {								\
 	struct type *stqh_first;/* first element */			\
@@ -182,8 +182,8 @@ struct {								\
 }
 
 /*
- * Singly-linked Tail queue functions.
- */
+    Singly-linked Tail queue functions.
+*/
 #define	STAILQ_CONCAT(head1, head2) do {				\
 	if (!STAILQ_EMPTY((head2))) {					\
 		*(head1)->stqh_last = (head2)->stqh_first;		\
@@ -258,8 +258,8 @@ struct {								\
 } while (0)
 
 /*
- * List declarations.
- */
+    List declarations.
+*/
 #define	LIST_HEAD(name, type)						\
 struct name {								\
 	struct type *lh_first;	/* first element */			\
@@ -275,8 +275,8 @@ struct {								\
 }
 
 /*
- * List functions.
- */
+    List functions.
+*/
 
 #define	LIST_EMPTY(head)	((head)->lh_first == NULL)
 
@@ -323,8 +323,8 @@ struct {								\
 } while (0)
 
 /*
- * Tail queue declarations.
- */
+    Tail queue declarations.
+*/
 #define	TAILQ_HEAD(name, type)						\
 struct name {								\
 	struct type *tqh_first;	/* first element */			\
@@ -341,8 +341,8 @@ struct {								\
 }
 
 /*
- * Tail queue functions.
- */
+    Tail queue functions.
+*/
 #define	TAILQ_CONCAT(head1, head2, field) do {				\
 	if (!TAILQ_EMPTY(head2)) {					\
 		*(head1)->tqh_last = (head2)->tqh_first;		\
@@ -426,13 +426,14 @@ struct {								\
 #ifdef _KERNEL
 
 /*
- * XXX insque() and remque() are an old way of handling certain queues.
- * They bogusly assumes that all queue heads look alike.
- */
+    XXX insque() and remque() are an old way of handling certain queues.
+    They bogusly assumes that all queue heads look alike.
+*/
 
-struct quehead {
-	struct quehead *qh_link;
-	struct quehead *qh_rlink;
+struct quehead
+{
+    struct quehead *qh_link;
+    struct quehead *qh_rlink;
 };
 
 #ifdef	__GNUC__
@@ -440,23 +441,23 @@ struct quehead {
 static __inline void
 insque(void *a, void *b)
 {
-	struct quehead *element = (struct quehead *)a,
-		 *head = (struct quehead *)b;
+    struct quehead *element = (struct quehead *)a,
+                    *head = (struct quehead *)b;
 
-	element->qh_link = head->qh_link;
-	element->qh_rlink = head;
-	head->qh_link = element;
-	element->qh_link->qh_rlink = element;
+    element->qh_link = head->qh_link;
+    element->qh_rlink = head;
+    head->qh_link = element;
+    element->qh_link->qh_rlink = element;
 }
 
 static __inline void
 remque(void *a)
 {
-	struct quehead *element = (struct quehead *)a;
+    struct quehead *element = (struct quehead *)a;
 
-	element->qh_link->qh_rlink = element->qh_rlink;
-	element->qh_rlink->qh_link = element->qh_link;
-	element->qh_rlink = 0;
+    element->qh_link->qh_rlink = element->qh_rlink;
+    element->qh_rlink->qh_link = element->qh_link;
+    element->qh_rlink = 0;
 }
 
 #else /* !__GNUC__ */
diff --git a/tests/host/common/sdfs_mock.cpp b/tests/host/common/sdfs_mock.cpp
index ef2ae44152..2673ab318f 100644
--- a/tests/host/common/sdfs_mock.cpp
+++ b/tests/host/common/sdfs_mock.cpp
@@ -1,16 +1,16 @@
 /*
- sdfs_mock.cpp - SDFS HAL mock for host side testing
- Copyright (c) 2019 Earle F. Philhower, III
+    sdfs_mock.cpp - SDFS HAL mock for host side testing
+    Copyright (c) 2019 Earle F. Philhower, III
 
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
 
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
 */
 
 #include "sdfs_mock.h"
diff --git a/tests/host/common/sdfs_mock.h b/tests/host/common/sdfs_mock.h
index 611474701a..08a196a846 100644
--- a/tests/host/common/sdfs_mock.h
+++ b/tests/host/common/sdfs_mock.h
@@ -1,16 +1,16 @@
 /*
- sdfs.h - SDFS mock for host side testing
- Copyright (c) 2019 Earle F. Philhower, III
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
+    sdfs.h - SDFS mock for host side testing
+    Copyright (c) 2019 Earle F. Philhower, III
+
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
 */
 
 #ifndef sdfs_mock_hpp
@@ -21,9 +21,16 @@
 #include <vector>
 #include <FS.h>
 
-class SDFSMock {
+class SDFSMock
+{
 public:
-    SDFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString) { (void)fs_size; (void)fs_block; (void)fs_page; (void)storage; }
+    SDFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString)
+    {
+        (void)fs_size;
+        (void)fs_block;
+        (void)fs_page;
+        (void)storage;
+    }
     void reset() { }
     ~SDFSMock() { }
 };
diff --git a/tests/host/common/spiffs_mock.cpp b/tests/host/common/spiffs_mock.cpp
index c7f9f53aba..716b84b60f 100644
--- a/tests/host/common/spiffs_mock.cpp
+++ b/tests/host/common/spiffs_mock.cpp
@@ -1,16 +1,16 @@
 /*
- spiffs_mock.cpp - SPIFFS HAL mock for host side testing
- Copyright © 2016 Ivan Grokhotkov
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
+    spiffs_mock.cpp - SPIFFS HAL mock for host side testing
+    Copyright © 2016 Ivan Grokhotkov
+
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
 */
 
 
@@ -41,7 +41,9 @@ SpiffsMock::SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const S
 {
     m_storage = storage;
     if ((m_overwrite = (fs_size < 0)))
+    {
         fs_size = -fs_size;
+    }
 
     fprintf(stderr, "SPIFFS: %zd bytes\n", fs_size);
 
@@ -72,26 +74,28 @@ SpiffsMock::~SpiffsMock()
     SPIFFS = FS(FSImplPtr(nullptr));
 }
 
-void SpiffsMock::load ()
+void SpiffsMock::load()
 {
     if (!m_fs.size() || !m_storage.length())
+    {
         return;
-    
+    }
+
     int fs = ::open(m_storage.c_str(), O_RDONLY);
     if (fs == -1)
     {
         fprintf(stderr, "SPIFFS: loading '%s': %s\n", m_storage.c_str(), strerror(errno));
         return;
     }
-    
+
     off_t flen = lseek(fs, 0, SEEK_END);
-    if (flen == (off_t)-1)
+    if (flen == (off_t) -1)
     {
         fprintf(stderr, "SPIFFS: checking size of '%s': %s\n", m_storage.c_str(), strerror(errno));
         return;
     }
     lseek(fs, 0, SEEK_SET);
-    
+
     if (flen != (off_t)m_fs.size())
     {
         fprintf(stderr, "SPIFFS: size of '%s': %d does not match requested size %zd\n", m_storage.c_str(), (int)flen, m_fs.size());
@@ -107,15 +111,19 @@ void SpiffsMock::load ()
         fprintf(stderr, "SPIFFS: loading %zi bytes from '%s'\n", m_fs.size(), m_storage.c_str());
         ssize_t r = ::read(fs, m_fs.data(), m_fs.size());
         if (r != (ssize_t)m_fs.size())
+        {
             fprintf(stderr, "SPIFFS: reading %zi bytes: returned %zd: %s\n", m_fs.size(), r, strerror(errno));
+        }
     }
     ::close(fs);
 }
 
-void SpiffsMock::save ()
+void SpiffsMock::save()
 {
     if (!m_fs.size() || !m_storage.length())
+    {
         return;
+    }
 
     int fs = ::open(m_storage.c_str(), O_CREAT | O_TRUNC | O_WRONLY, 0644);
     if (fs == -1)
@@ -126,9 +134,13 @@ void SpiffsMock::save ()
     fprintf(stderr, "SPIFFS: saving %zi bytes to '%s'\n", m_fs.size(), m_storage.c_str());
 
     if (::write(fs, m_fs.data(), m_fs.size()) != (ssize_t)m_fs.size())
+    {
         fprintf(stderr, "SPIFFS: writing %zi bytes: %s\n", m_fs.size(), strerror(errno));
+    }
     if (::close(fs) == -1)
+    {
         fprintf(stderr, "SPIFFS: closing %s: %s\n", m_storage.c_str(), strerror(errno));
+    }
 }
 
 #pragma GCC diagnostic pop
diff --git a/tests/host/common/spiffs_mock.h b/tests/host/common/spiffs_mock.h
index 4c265964f5..12a97f2851 100644
--- a/tests/host/common/spiffs_mock.h
+++ b/tests/host/common/spiffs_mock.h
@@ -1,16 +1,16 @@
 /*
- spiffs_mock.h - SPIFFS HAL mock for host side testing
- Copyright © 2016 Ivan Grokhotkov
- 
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- 
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
+    spiffs_mock.h - SPIFFS HAL mock for host side testing
+    Copyright © 2016 Ivan Grokhotkov
+
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
 */
 
 #ifndef spiffs_mock_hpp
@@ -24,15 +24,16 @@
 
 #define DEFAULT_SPIFFS_FILE_NAME "spiffs.bin"
 
-class SpiffsMock {
+class SpiffsMock
+{
 public:
     SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString);
     void reset();
     ~SpiffsMock();
-    
+
 protected:
-    void load ();
-    void save ();
+    void load();
+    void save();
 
     std::vector<uint8_t> m_fs;
     String m_storage;
diff --git a/tests/host/common/user_interface.cpp b/tests/host/common/user_interface.cpp
index 4e03d77786..2c9bde2453 100644
--- a/tests/host/common/user_interface.cpp
+++ b/tests/host/common/user_interface.cpp
@@ -62,22 +62,22 @@ bool DhcpServer::set_dhcps_offer_option(uint8 level, void* optarg)
     return false;
 }
 
-void DhcpServer::end ()
+void DhcpServer::end()
 {
 }
 
-bool DhcpServer::begin (struct ip_info *info)
+bool DhcpServer::begin(struct ip_info *info)
 {
     (void)info;
     return false;
 }
 
-DhcpServer::DhcpServer (netif* netif)
+DhcpServer::DhcpServer(netif* netif)
 {
     (void)netif;
 }
 
-DhcpServer::~DhcpServer ()
+DhcpServer::~DhcpServer()
 {
     end();
 }
@@ -126,7 +126,9 @@ extern "C"
         strcpy((char*)config->password, "emulated-ssid-password");
         config->bssid_set = 0;
         for (int i = 0; i < 6; i++)
+        {
             config->bssid[i] = i;
+        }
         config->threshold.rssi = 1;
         config->threshold.authmode = AUTH_WPA_PSK;
 #ifdef NONOSDK3V0
@@ -181,7 +183,9 @@ extern "C"
         }
 
         if (host_interface)
+        {
             mockverbose("host: looking for interface '%s':\n", host_interface);
+        }
 
         for (ifa = ifAddrStruct; ifa != NULL; ifa = ifa->ifa_next)
         {
@@ -194,7 +198,9 @@ extern "C"
                 mockverbose(" IPV4 (0x%08lx)", test_ipv4);
                 if ((test_ipv4 & 0xff000000) == 0x7f000000)
                     // 127./8
+                {
                     mockverbose(" (local, ignored)");
+                }
                 else
                 {
                     if (!host_interface || (host_interface && strcmp(ifa->ifa_name, host_interface) == 0))
@@ -204,7 +210,9 @@ extern "C"
                         mask = *(uint32_t*) & ((struct sockaddr_in*)ifa->ifa_netmask)->sin_addr;
                         mockverbose(" (selected)\n");
                         if (host_interface)
+                        {
                             global_source_address = ntohl(ipv4);
+                        }
                         break;
                     }
                 }
@@ -213,14 +221,18 @@ extern "C"
         }
 
         if (ifAddrStruct != NULL)
+        {
             freeifaddrs(ifAddrStruct);
+        }
 
         (void)if_index;
         //if (if_index != STATION_IF)
         //	fprintf(stderr, "we are not AP");
 
         if (global_ipv4_netfmt == NO_GLOBAL_BINDING)
+        {
             global_ipv4_netfmt = ipv4;
+        }
 
         if (info)
         {
diff --git a/tests/host/core/test_PolledTimeout.cpp b/tests/host/core/test_PolledTimeout.cpp
index 37b31d8544..3645123827 100644
--- a/tests/host/core/test_PolledTimeout.cpp
+++ b/tests/host/core/test_PolledTimeout.cpp
@@ -9,238 +9,260 @@ template<typename argT>
 inline bool
 fuzzycomp(argT a, argT b)
 {
-  const argT epsilon = 10;
-  return (std::max(a,b) - std::min(a,b) <= epsilon);
+    const argT epsilon = 10;
+    return (std::max(a, b) - std::min(a, b) <= epsilon);
 }
 
 TEST_CASE("OneShot Timeout 500000000ns (0.5s)", "[polledTimeout]")
 {
-  using esp8266::polledTimeout::oneShotFastNs;
-  using timeType = oneShotFastNs::timeType;
-  timeType before, after, delta;
+    using esp8266::polledTimeout::oneShotFastNs;
+    using timeType = oneShotFastNs::timeType;
+    timeType before, after, delta;
 
-  Serial.println("OneShot Timeout 500000000ns (0.5s)");
+    Serial.println("OneShot Timeout 500000000ns (0.5s)");
 
-  oneShotFastNs timeout(500000000);
-  before = micros();
-  while(!timeout.expired())
-    yield();
-  after = micros();
+    oneShotFastNs timeout(500000000);
+    before = micros();
+    while (!timeout.expired())
+    {
+        yield();
+    }
+    after = micros();
 
-  delta = after - before;
-  Serial.printf("delta = %u\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %u\n", delta);
 
-  REQUIRE(fuzzycomp(delta/1000, (timeType)500));
+    REQUIRE(fuzzycomp(delta / 1000, (timeType)500));
 
 
-  Serial.print("reset\n");
+    Serial.print("reset\n");
 
-  timeout.reset();
-  before = micros();
-  while(!timeout)
-    yield();
-  after = micros();
+    timeout.reset();
+    before = micros();
+    while (!timeout)
+    {
+        yield();
+    }
+    after = micros();
 
-  delta = after - before;
-  Serial.printf("delta = %u\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %u\n", delta);
 
-  REQUIRE(fuzzycomp(delta/1000, (timeType)500));
+    REQUIRE(fuzzycomp(delta / 1000, (timeType)500));
 }
 
 TEST_CASE("OneShot Timeout 3000000us", "[polledTimeout]")
 {
-  using esp8266::polledTimeout::oneShotFastUs;
-  using timeType = oneShotFastUs::timeType;
-  timeType before, after, delta;
+    using esp8266::polledTimeout::oneShotFastUs;
+    using timeType = oneShotFastUs::timeType;
+    timeType before, after, delta;
 
-  Serial.println("OneShot Timeout 3000000us");
+    Serial.println("OneShot Timeout 3000000us");
 
-  oneShotFastUs timeout(3000000);
-  before = micros();
-  while(!timeout.expired())
-    yield();
-  after = micros();
+    oneShotFastUs timeout(3000000);
+    before = micros();
+    while (!timeout.expired())
+    {
+        yield();
+    }
+    after = micros();
 
-  delta = after - before;
-  Serial.printf("delta = %u\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %u\n", delta);
 
-  REQUIRE(fuzzycomp(delta/1000, (timeType)3000));
+    REQUIRE(fuzzycomp(delta / 1000, (timeType)3000));
 
 
-  Serial.print("reset\n");
+    Serial.print("reset\n");
 
-  timeout.reset();
-  before = micros();
-  while(!timeout)
-    yield();
-  after = micros();
+    timeout.reset();
+    before = micros();
+    while (!timeout)
+    {
+        yield();
+    }
+    after = micros();
 
-  delta = after - before;
-  Serial.printf("delta = %u\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %u\n", delta);
 
-  REQUIRE(fuzzycomp(delta/1000, (timeType)3000));
+    REQUIRE(fuzzycomp(delta / 1000, (timeType)3000));
 }
 
 TEST_CASE("OneShot Timeout 3000ms", "[polledTimeout]")
 {
-  using esp8266::polledTimeout::oneShotMs;
-  using timeType = oneShotMs::timeType;
-  timeType before, after, delta;
+    using esp8266::polledTimeout::oneShotMs;
+    using timeType = oneShotMs::timeType;
+    timeType before, after, delta;
 
-  Serial.println("OneShot Timeout 3000ms");
+    Serial.println("OneShot Timeout 3000ms");
 
-  oneShotMs timeout(3000);
-  before = millis();
-  while(!timeout.expired())
-    yield();
-  after = millis();
+    oneShotMs timeout(3000);
+    before = millis();
+    while (!timeout.expired())
+    {
+        yield();
+    }
+    after = millis();
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  REQUIRE(fuzzycomp(delta, (timeType)3000));
+    REQUIRE(fuzzycomp(delta, (timeType)3000));
 
 
-  Serial.print("reset\n");
+    Serial.print("reset\n");
 
-  timeout.reset();
-  before = millis();
-  while(!timeout)
-    yield();
-  after = millis();
+    timeout.reset();
+    before = millis();
+    while (!timeout)
+    {
+        yield();
+    }
+    after = millis();
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  REQUIRE(fuzzycomp(delta, (timeType)3000));
+    REQUIRE(fuzzycomp(delta, (timeType)3000));
 }
 
 TEST_CASE("OneShot Timeout 3000ms reset to 1000ms", "[polledTimeout]")
 {
-  using esp8266::polledTimeout::oneShotMs;
-  using timeType = oneShotMs::timeType;
-  timeType before, after, delta;
+    using esp8266::polledTimeout::oneShotMs;
+    using timeType = oneShotMs::timeType;
+    timeType before, after, delta;
 
-  Serial.println("OneShot Timeout 3000ms");
+    Serial.println("OneShot Timeout 3000ms");
 
-  oneShotMs timeout(3000);
-  before = millis();
-  while(!timeout.expired())
-    yield();
-  after = millis();
+    oneShotMs timeout(3000);
+    before = millis();
+    while (!timeout.expired())
+    {
+        yield();
+    }
+    after = millis();
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  REQUIRE(fuzzycomp(delta, (timeType)3000));
+    REQUIRE(fuzzycomp(delta, (timeType)3000));
 
 
-  Serial.print("reset\n");
+    Serial.print("reset\n");
 
-  timeout.reset(1000);
-  before = millis();
-  while(!timeout)
-    yield();
-  after = millis();
+    timeout.reset(1000);
+    before = millis();
+    while (!timeout)
+    {
+        yield();
+    }
+    after = millis();
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  REQUIRE(fuzzycomp(delta, (timeType)1000));
+    REQUIRE(fuzzycomp(delta, (timeType)1000));
 }
 
 TEST_CASE("Periodic Timeout 1T 3000ms", "[polledTimeout]")
 {
-  using esp8266::polledTimeout::periodicMs;
-  using timeType = periodicMs::timeType;
-  timeType before, after, delta;
+    using esp8266::polledTimeout::periodicMs;
+    using timeType = periodicMs::timeType;
+    timeType before, after, delta;
 
-  Serial.println("Periodic Timeout 1T 3000ms");
+    Serial.println("Periodic Timeout 1T 3000ms");
 
-  periodicMs timeout(3000);
-  before = millis();
-  while(!timeout)
-    yield();
-  after = millis();
+    periodicMs timeout(3000);
+    before = millis();
+    while (!timeout)
+    {
+        yield();
+    }
+    after = millis();
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  REQUIRE(fuzzycomp(delta, (timeType)3000));
+    REQUIRE(fuzzycomp(delta, (timeType)3000));
 
-  Serial.print("no reset needed\n");
+    Serial.print("no reset needed\n");
 
-  before = millis();
-  while(!timeout)
-    yield();
-  after = millis();
+    before = millis();
+    while (!timeout)
+    {
+        yield();
+    }
+    after = millis();
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  REQUIRE(fuzzycomp(delta, (timeType)3000));
+    REQUIRE(fuzzycomp(delta, (timeType)3000));
 }
 
 TEST_CASE("Periodic Timeout 10T 1000ms", "[polledTimeout]")
 {
-  using esp8266::polledTimeout::periodicMs;
-  using timeType = periodicMs::timeType;
-  timeType before, after, delta;
+    using esp8266::polledTimeout::periodicMs;
+    using timeType = periodicMs::timeType;
+    timeType before, after, delta;
 
-  Serial.println("Periodic 10T Timeout 1000ms");
+    Serial.println("Periodic 10T Timeout 1000ms");
 
-  int counter = 10;
+    int counter = 10;
 
-  periodicMs timeout(1000);
-  before = millis();
-  while(1)
-  {
-    if(timeout)
+    periodicMs timeout(1000);
+    before = millis();
+    while (1)
     {
-      Serial.print("*");
-      if(!--counter)
-        break;
-      yield();
+        if (timeout)
+        {
+            Serial.print("*");
+            if (!--counter)
+            {
+                break;
+            }
+            yield();
+        }
     }
-  }
-  after = millis();
+    after = millis();
 
-  delta = after - before;
-  Serial.printf("\ndelta = %lu\n", delta);
-  REQUIRE(fuzzycomp(delta, (timeType)10000));
+    delta = after - before;
+    Serial.printf("\ndelta = %lu\n", delta);
+    REQUIRE(fuzzycomp(delta, (timeType)10000));
 }
 
 TEST_CASE("OneShot Timeout 3000ms reset to 1000ms custom yield", "[polledTimeout]")
 {
-  using YieldOrSkipPolicy = esp8266::polledTimeout::YieldPolicy::YieldOrSkip;
-  using oneShotMsYield = esp8266::polledTimeout::timeoutTemplate<false, YieldOrSkipPolicy>;
-  using timeType = oneShotMsYield::timeType;
-  timeType before, after, delta;
+    using YieldOrSkipPolicy = esp8266::polledTimeout::YieldPolicy::YieldOrSkip;
+    using oneShotMsYield = esp8266::polledTimeout::timeoutTemplate<false, YieldOrSkipPolicy>;
+    using timeType = oneShotMsYield::timeType;
+    timeType before, after, delta;
 
-  Serial.println("OneShot Timeout 3000ms");
+    Serial.println("OneShot Timeout 3000ms");
 
 
-  oneShotMsYield timeout(3000);
-  before = millis();
-  while(!timeout.expired());
-  after = millis();
+    oneShotMsYield timeout(3000);
+    before = millis();
+    while (!timeout.expired());
+    after = millis();
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  REQUIRE(fuzzycomp(delta, (timeType)3000));
+    REQUIRE(fuzzycomp(delta, (timeType)3000));
 
 
-  Serial.print("reset\n");
+    Serial.print("reset\n");
 
-  timeout.reset(1000);
-  before = millis();
-  while(!timeout);
-  after = millis();
+    timeout.reset(1000);
+    before = millis();
+    while (!timeout);
+    after = millis();
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  REQUIRE(fuzzycomp(delta, (timeType)1000));
+    REQUIRE(fuzzycomp(delta, (timeType)1000));
 }
 
diff --git a/tests/host/core/test_Print.cpp b/tests/host/core/test_Print.cpp
index e58539c59e..33baead1b0 100644
--- a/tests/host/core/test_Print.cpp
+++ b/tests/host/core/test_Print.cpp
@@ -1,17 +1,17 @@
 /*
- test_pgmspace.cpp - pgmspace tests
- Copyright © 2016 Ivan Grokhotkov
+    test_pgmspace.cpp - pgmspace tests
+    Copyright © 2016 Ivan Grokhotkov
 
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
 
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- */
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
+*/
 
 #include <catch.hpp>
 #include <string.h>
diff --git a/tests/host/core/test_Updater.cpp b/tests/host/core/test_Updater.cpp
index f3b850e130..ab8941694b 100644
--- a/tests/host/core/test_Updater.cpp
+++ b/tests/host/core/test_Updater.cpp
@@ -1,17 +1,17 @@
 /*
- test_Updater.cpp - Updater tests
- Copyright © 2019 Earle F. Philhower, III
+    test_Updater.cpp - Updater tests
+    Copyright © 2019 Earle F. Philhower, III
 
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
 
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- */
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
+*/
 
 #include <catch.hpp>
 #include <Updater.h>
diff --git a/tests/host/core/test_md5builder.cpp b/tests/host/core/test_md5builder.cpp
index 0041c2eb72..6f8075fe93 100644
--- a/tests/host/core/test_md5builder.cpp
+++ b/tests/host/core/test_md5builder.cpp
@@ -1,17 +1,17 @@
 /*
- test_md5builder.cpp - MD5Builder tests
- Copyright © 2016 Ivan Grokhotkov
+    test_md5builder.cpp - MD5Builder tests
+    Copyright © 2016 Ivan Grokhotkov
 
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
 
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- */
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
+*/
 
 #include <catch.hpp>
 #include <string.h>
@@ -35,25 +35,28 @@ TEST_CASE("MD5Builder::add works as expected", "[core][MD5Builder]")
 
 TEST_CASE("MD5Builder::addHexString works as expected", "[core][MD5Builder]")
 {
-    WHEN("A char array is parsed"){
-      MD5Builder builder;
-      builder.begin();
-      const char * myPayload = "1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696F6e73";
-      builder.addHexString(myPayload);
-      builder.calculate();
-      REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
+    WHEN("A char array is parsed")
+    {
+        MD5Builder builder;
+        builder.begin();
+        const char * myPayload = "1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696F6e73";
+        builder.addHexString(myPayload);
+        builder.calculate();
+        REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
     }
 
-    WHEN("A Arduino String is parsed"){
-      MD5Builder builder;
-      builder.begin();
-      builder.addHexString(String("1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696f6e73"));
-      builder.calculate();
-      REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
+    WHEN("A Arduino String is parsed")
+    {
+        MD5Builder builder;
+        builder.begin();
+        builder.addHexString(String("1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696f6e73"));
+        builder.calculate();
+        REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
     }
 }
 
-TEST_CASE("MD5Builder::addStream works", "[core][MD5Builder]"){
+TEST_CASE("MD5Builder::addStream works", "[core][MD5Builder]")
+{
     MD5Builder builder;
     const char* str = "MD5Builder::addStream_works_longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong";
     {
diff --git a/tests/host/core/test_pgmspace.cpp b/tests/host/core/test_pgmspace.cpp
index f44221c2b4..28fa6ca0f1 100644
--- a/tests/host/core/test_pgmspace.cpp
+++ b/tests/host/core/test_pgmspace.cpp
@@ -1,17 +1,17 @@
 /*
- test_pgmspace.cpp - pgmspace tests
- Copyright © 2016 Ivan Grokhotkov
+    test_pgmspace.cpp - pgmspace tests
+    Copyright © 2016 Ivan Grokhotkov
 
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
 
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- */
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
+*/
 
 #include <catch.hpp>
 #include <string.h>
@@ -19,7 +19,8 @@
 
 TEST_CASE("strstr_P works as strstr", "[core][pgmspace]")
 {
-    auto t = [](const char* h, const char* n) {
+    auto t = [](const char* h, const char* n)
+    {
         const char* strstr_P_result = strstr_P(h, n);
         const char* strstr_result = strstr(h, n);
         REQUIRE(strstr_P_result == strstr_result);
@@ -27,7 +28,7 @@ TEST_CASE("strstr_P works as strstr", "[core][pgmspace]")
 
     // Test case data is from avr-libc, original copyright (c) 2007  Dmitry Xmelkov
     // See avr-libc/tests/simulate/pmstring/strstr_P.c
-    t ("", "");
+    t("", "");
     t("12345", "");
     t("ababac", "abac");
     t("", "a");
diff --git a/tests/host/core/test_string.cpp b/tests/host/core/test_string.cpp
index cd844545d0..e2eaba3a99 100644
--- a/tests/host/core/test_string.cpp
+++ b/tests/host/core/test_string.cpp
@@ -1,17 +1,17 @@
 /*
- test_string.cpp - String tests
- Copyright © 2018 Earle F. Philhower, III
+    test_string.cpp - String tests
+    Copyright © 2018 Earle F. Philhower, III
 
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
 
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- */
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
+*/
 
 #include <catch.hpp>
 #include <string.h>
@@ -52,10 +52,10 @@ TEST_CASE("String::replace", "[core][String]")
 
 TEST_CASE("String(value, base)", "[core][String]")
 {
-    String strbase2(9999,2);
-    String strbase8(9999,8);
-    String strbase10(9999,10);
-    String strbase16(9999,16);
+    String strbase2(9999, 2);
+    String strbase8(9999, 8);
+    String strbase10(9999, 10);
+    String strbase16(9999, 16);
     REQUIRE(strbase2 == "10011100001111");
     REQUIRE(strbase8 == "23417");
     REQUIRE(strbase10 == "9999");
@@ -64,7 +64,7 @@ TEST_CASE("String(value, base)", "[core][String]")
     String strnegf(-2.123, 3);
     REQUIRE(strnegi == "-9999");
     REQUIRE(strnegf == "-2.123");
-    String strbase16l((long)999999,16);
+    String strbase16l((long)999999, 16);
     REQUIRE(strbase16l == "f423f");
 }
 
@@ -78,7 +78,7 @@ TEST_CASE("String constructors", "[core][String]")
     REQUIRE(ib == "3e7");
     String lb((unsigned long)3000000000, 8);
     REQUIRE(lb == "26264057000");
-    String sl1((long)-2000000000, 10);
+    String sl1((long) -2000000000, 10);
     REQUIRE(sl1 == "-2000000000");
     String s1("abcd");
     String s2(s1);
@@ -124,11 +124,11 @@ TEST_CASE("String concantenation", "[core][String]")
     REQUIRE(str == "abcdeabcde9872147483647-214748364869");
     str += (unsigned int)1969;
     REQUIRE(str == "abcdeabcde9872147483647-2147483648691969");
-    str += (long)-123;
+    str += (long) -123;
     REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123");
     str += (unsigned long)321;
     REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321");
-    str += (float)-1.01;
+    str += (float) -1.01;
     REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.01");
     str += (double)1.01;
     REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01");
@@ -146,13 +146,13 @@ TEST_CASE("String concantenation", "[core][String]")
     REQUIRE(str.concat(str) == true);
     REQUIRE(str == "cleanclean");
     // non-decimal negative #s should be as if they were unsigned
-    str = String((int)-100, 16);
+    str = String((int) -100, 16);
     REQUIRE(str == "ffffff9c");
-    str = String((long)-101, 16);
+    str = String((long) -101, 16);
     REQUIRE(str == "ffffff9b");
-    str = String((int)-100, 10);
+    str = String((int) -100, 10);
     REQUIRE(str == "-100");
-    str = String((long)-100, 10);
+    str = String((long) -100, 10);
     REQUIRE(str == "-100");
     // Non-zero-terminated array concatenation
     const char buff[] = "abcdefg";
@@ -161,12 +161,16 @@ TEST_CASE("String concantenation", "[core][String]")
     n = "1"; // Overwrite [1] with 0, but leave old junk in SSO space still
     n.concat(buff, 3);
     REQUIRE(n == "1abc"); // Ensure the trailing 0 is always present even w/this funky concat
-    for (int i=0; i<20; i++)
-        n.concat(buff, 1); // Add 20 'a's to go from SSO to normal string
+    for (int i = 0; i < 20; i++)
+    {
+        n.concat(buff, 1);    // Add 20 'a's to go from SSO to normal string
+    }
     REQUIRE(n == "1abcaaaaaaaaaaaaaaaaaaaa");
     n = "";
-    for (int i=0; i<=5; i++)
+    for (int i = 0; i <= 5; i++)
+    {
         n.concat(buff, i);
+    }
     REQUIRE(n == "aababcabcdabcde");
     n.concat(buff, 0); // And check no add'n
     REQUIRE(n == "aababcabcdabcde");
@@ -224,7 +228,7 @@ TEST_CASE("String conversion", "[core][String]")
     REQUIRE(l == INT_MIN);
     s = "3.14159";
     float f = s.toFloat();
-    REQUIRE( fabs(f - 3.14159) < 0.0001 );
+    REQUIRE(fabs(f - 3.14159) < 0.0001);
 }
 
 TEST_CASE("String case", "[core][String]")
@@ -246,7 +250,7 @@ TEST_CASE("String nulls", "[core][String]")
     s.trim();
     s.toUpperCase();
     s.toLowerCase();
-    s.remove(1,1);
+    s.remove(1, 1);
     s.remove(10);
     s.replace("taco", "burrito");
     s.replace('a', 'b');
@@ -268,7 +272,7 @@ TEST_CASE("String nulls", "[core][String]")
     REQUIRE(s == "");
     REQUIRE(s.length() == 0);
     s.setCharAt(1, 't');
-    REQUIRE(s.startsWith("abc",0) == false);
+    REQUIRE(s.startsWith("abc", 0) == false);
     REQUIRE(s.startsWith("def") == false);
     REQUIRE(s.equalsConstantTime("def") == false);
     REQUIRE(s.equalsConstantTime("") == true);
@@ -299,125 +303,128 @@ TEST_CASE("String sizes near 8b", "[core][String]")
     String s15("12345678901234");
     String s16("123456789012345");
     String s17("1234567890123456");
-    REQUIRE(!strcmp(s7.c_str(),"123456"));
-    REQUIRE(!strcmp(s8.c_str(),"1234567"));
-    REQUIRE(!strcmp(s9.c_str(),"12345678"));
-    REQUIRE(!strcmp(s15.c_str(),"12345678901234"));
-    REQUIRE(!strcmp(s16.c_str(),"123456789012345"));
-    REQUIRE(!strcmp(s17.c_str(),"1234567890123456"));
+    REQUIRE(!strcmp(s7.c_str(), "123456"));
+    REQUIRE(!strcmp(s8.c_str(), "1234567"));
+    REQUIRE(!strcmp(s9.c_str(), "12345678"));
+    REQUIRE(!strcmp(s15.c_str(), "12345678901234"));
+    REQUIRE(!strcmp(s16.c_str(), "123456789012345"));
+    REQUIRE(!strcmp(s17.c_str(), "1234567890123456"));
     s7 += '_';
     s8 += '_';
     s9 += '_';
     s15 += '_';
     s16 += '_';
     s17 += '_';
-    REQUIRE(!strcmp(s7.c_str(),"123456_"));
-    REQUIRE(!strcmp(s8.c_str(),"1234567_"));
-    REQUIRE(!strcmp(s9.c_str(),"12345678_"));
-    REQUIRE(!strcmp(s15.c_str(),"12345678901234_"));
-    REQUIRE(!strcmp(s16.c_str(),"123456789012345_"));
-    REQUIRE(!strcmp(s17.c_str(),"1234567890123456_"));
+    REQUIRE(!strcmp(s7.c_str(), "123456_"));
+    REQUIRE(!strcmp(s8.c_str(), "1234567_"));
+    REQUIRE(!strcmp(s9.c_str(), "12345678_"));
+    REQUIRE(!strcmp(s15.c_str(), "12345678901234_"));
+    REQUIRE(!strcmp(s16.c_str(), "123456789012345_"));
+    REQUIRE(!strcmp(s17.c_str(), "1234567890123456_"));
 }
 
 TEST_CASE("String SSO works", "[core][String]")
 {
-  // This test assumes that SSO_SIZE==8, if that changes the test must as well
-  String s;
-  s += "0";
-  REQUIRE(s == "0");
-  REQUIRE(s.length() == 1);
-  const char *savesso = s.c_str();
-  s += 1;
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "01");
-  REQUIRE(s.length() == 2);
-  s += "2";
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "012");
-  REQUIRE(s.length() == 3);
-  s += 3;
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "0123");
-  REQUIRE(s.length() == 4);
-  s += "4";
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "01234");
-  REQUIRE(s.length() == 5);
-  s += "5";
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "012345");
-  REQUIRE(s.length() == 6);
-  s += "6";
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "0123456");
-  REQUIRE(s.length() == 7);
-  s += "7";
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "01234567");
-  REQUIRE(s.length() == 8);
-  s += "8";
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "012345678");
-  REQUIRE(s.length() == 9);
-  s += "9";
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "0123456789");
-  REQUIRE(s.length() == 10);
-  if (sizeof(savesso) == 4) {
-    s += "a";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789a");
-    REQUIRE(s.length() == 11);
-    s += "b";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789ab");
-    REQUIRE(s.length() == 12);
-    s += "c";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abc");
-    REQUIRE(s.length() == 13);
-  } else {
-  s += "a";
+    // This test assumes that SSO_SIZE==8, if that changes the test must as well
+    String s;
+    s += "0";
+    REQUIRE(s == "0");
+    REQUIRE(s.length() == 1);
+    const char *savesso = s.c_str();
+    s += 1;
+    REQUIRE(s.c_str() == savesso);
+    REQUIRE(s == "01");
+    REQUIRE(s.length() == 2);
+    s += "2";
+    REQUIRE(s.c_str() == savesso);
+    REQUIRE(s == "012");
+    REQUIRE(s.length() == 3);
+    s += 3;
+    REQUIRE(s.c_str() == savesso);
+    REQUIRE(s == "0123");
+    REQUIRE(s.length() == 4);
+    s += "4";
+    REQUIRE(s.c_str() == savesso);
+    REQUIRE(s == "01234");
+    REQUIRE(s.length() == 5);
+    s += "5";
+    REQUIRE(s.c_str() == savesso);
+    REQUIRE(s == "012345");
+    REQUIRE(s.length() == 6);
+    s += "6";
+    REQUIRE(s.c_str() == savesso);
+    REQUIRE(s == "0123456");
+    REQUIRE(s.length() == 7);
+    s += "7";
+    REQUIRE(s.c_str() == savesso);
+    REQUIRE(s == "01234567");
+    REQUIRE(s.length() == 8);
+    s += "8";
     REQUIRE(s.c_str() == savesso);
-    REQUIRE(s == "0123456789a");
-    REQUIRE(s.length() == 11);
-    s += "bcde";
+    REQUIRE(s == "012345678");
+    REQUIRE(s.length() == 9);
+    s += "9";
     REQUIRE(s.c_str() == savesso);
-    REQUIRE(s == "0123456789abcde");
-    REQUIRE(s.length() == 15);
-    s += "fghi";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abcdefghi");
-    REQUIRE(s.length() == 19);
-    s += "j";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abcdefghij");
-    REQUIRE(s.length() == 20);
-    s += "k";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abcdefghijk");
-    REQUIRE(s.length() == 21);
-    s += "l";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abcdefghijkl");
-    REQUIRE(s.length() == 22);
-    s += "m";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abcdefghijklm");
-    REQUIRE(s.length() == 23);
-    s += "nopq";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abcdefghijklmnopq");
-    REQUIRE(s.length() == 27);
-    s += "rstu";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abcdefghijklmnopqrstu");
-    REQUIRE(s.length() == 31);
-  }
-  s = "0123456789abcde";
-  s = s.substring(s.indexOf('a'));
-  REQUIRE(s == "abcde");
-  REQUIRE(s.length() == 5);
+    REQUIRE(s == "0123456789");
+    REQUIRE(s.length() == 10);
+    if (sizeof(savesso) == 4)
+    {
+        s += "a";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789a");
+        REQUIRE(s.length() == 11);
+        s += "b";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789ab");
+        REQUIRE(s.length() == 12);
+        s += "c";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abc");
+        REQUIRE(s.length() == 13);
+    }
+    else
+    {
+        s += "a";
+        REQUIRE(s.c_str() == savesso);
+        REQUIRE(s == "0123456789a");
+        REQUIRE(s.length() == 11);
+        s += "bcde";
+        REQUIRE(s.c_str() == savesso);
+        REQUIRE(s == "0123456789abcde");
+        REQUIRE(s.length() == 15);
+        s += "fghi";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abcdefghi");
+        REQUIRE(s.length() == 19);
+        s += "j";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abcdefghij");
+        REQUIRE(s.length() == 20);
+        s += "k";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abcdefghijk");
+        REQUIRE(s.length() == 21);
+        s += "l";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abcdefghijkl");
+        REQUIRE(s.length() == 22);
+        s += "m";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abcdefghijklm");
+        REQUIRE(s.length() == 23);
+        s += "nopq";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abcdefghijklmnopq");
+        REQUIRE(s.length() == 27);
+        s += "rstu";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abcdefghijklmnopqrstu");
+        REQUIRE(s.length() == 31);
+    }
+    s = "0123456789abcde";
+    s = s.substring(s.indexOf('a'));
+    REQUIRE(s == "abcde");
+    REQUIRE(s.length() == 5);
 }
 
 #include <new>
@@ -429,64 +436,64 @@ void repl(const String& key, const String& val, String& s, boolean useURLencode)
 
 TEST_CASE("String SSO handles junk in memory", "[core][String]")
 {
-  // We fill the SSO space with garbage then construct an object in it and check consistency
-  // This is NOT how you want to use Strings outside of this testing!
-  unsigned char space[64];
-  String *s = (String*)space;
-  memset(space, 0xff, 64);
-  new(s) String;
-  REQUIRE(*s == "");
-  s->~String();
-
-  // Tests from #5883
-  bool useURLencode = false;
-  const char euro[4] = {(char)0xe2, (char)0x82, (char)0xac, 0}; // Unicode euro symbol
-  const char yen[3]   = {(char)0xc2, (char)0xa5, 0}; // Unicode yen symbol
-
-  memset(space, 0xff, 64);
-  new(s) String("%ssid%");
-  repl(("%ssid%"), "MikroTik", *s, useURLencode);
-  REQUIRE(*s == "MikroTik");
-  s->~String();
-
-  memset(space, 0xff, 64);
-  new(s) String("{E}");
-  repl(("{E}"), euro, *s, useURLencode);
-  REQUIRE(*s == "€");
-  s->~String();
-  memset(space, 0xff, 64);
-  new(s) String("&euro;");
-  repl(("&euro;"), euro, *s, useURLencode);
-  REQUIRE(*s == "€");
-  s->~String();
-  memset(space, 0xff, 64);
-  new(s) String("{Y}");
-  repl(("{Y}"), yen, *s, useURLencode);
-  REQUIRE(*s == "¥");
-  s->~String();
-  memset(space, 0xff, 64);
-  new(s) String("&yen;");
-  repl(("&yen;"), yen, *s, useURLencode);
-  REQUIRE(*s == "¥");
-  s->~String();
-
-  memset(space, 0xff, 64);
-  new(s) String("%sysname%");
-  repl(("%sysname%"), "CO2_defect", *s, useURLencode);
-  REQUIRE(*s == "CO2_defect");
-  s->~String();
+    // We fill the SSO space with garbage then construct an object in it and check consistency
+    // This is NOT how you want to use Strings outside of this testing!
+    unsigned char space[64];
+    String *s = (String*)space;
+    memset(space, 0xff, 64);
+    new (s) String;
+    REQUIRE(*s == "");
+    s->~String();
+
+    // Tests from #5883
+    bool useURLencode = false;
+    const char euro[4] = {(char)0xe2, (char)0x82, (char)0xac, 0}; // Unicode euro symbol
+    const char yen[3]   = {(char)0xc2, (char)0xa5, 0}; // Unicode yen symbol
+
+    memset(space, 0xff, 64);
+    new (s) String("%ssid%");
+    repl(("%ssid%"), "MikroTik", *s, useURLencode);
+    REQUIRE(*s == "MikroTik");
+    s->~String();
+
+    memset(space, 0xff, 64);
+    new (s) String("{E}");
+    repl(("{E}"), euro, *s, useURLencode);
+    REQUIRE(*s == "€");
+    s->~String();
+    memset(space, 0xff, 64);
+    new (s) String("&euro;");
+    repl(("&euro;"), euro, *s, useURLencode);
+    REQUIRE(*s == "€");
+    s->~String();
+    memset(space, 0xff, 64);
+    new (s) String("{Y}");
+    repl(("{Y}"), yen, *s, useURLencode);
+    REQUIRE(*s == "¥");
+    s->~String();
+    memset(space, 0xff, 64);
+    new (s) String("&yen;");
+    repl(("&yen;"), yen, *s, useURLencode);
+    REQUIRE(*s == "¥");
+    s->~String();
+
+    memset(space, 0xff, 64);
+    new (s) String("%sysname%");
+    repl(("%sysname%"), "CO2_defect", *s, useURLencode);
+    REQUIRE(*s == "CO2_defect");
+    s->~String();
 }
 
 
 TEST_CASE("Issue #5949 - Overlapping src/dest in replace", "[core][String]")
 {
-  String blah = "blah";
-  blah.replace("xx", "y");
-  REQUIRE(blah == "blah");
-  blah.replace("x", "yy");
-  REQUIRE(blah == "blah");
-  blah.replace(blah, blah);
-  REQUIRE(blah == "blah");
+    String blah = "blah";
+    blah.replace("xx", "y");
+    REQUIRE(blah == "blah");
+    blah.replace("x", "yy");
+    REQUIRE(blah == "blah");
+    blah.replace(blah, blah);
+    REQUIRE(blah == "blah");
 }
 
 
@@ -502,97 +509,100 @@ TEST_CASE("Issue #2736 - StreamString SSO fix", "[core][StreamString]")
 
 TEST_CASE("Strings with NULs", "[core][String]")
 {
-  // The following should never be done in a real app! This is only to inject 0s in the middle of a string.
-  // Fits in SSO...
-  String str("01234567");
-  REQUIRE(str.length() == 8);
-  char *ptr = (char *)str.c_str();
-  ptr[3] = 0;
-  String str2;
-  str2 = str;
-  REQUIRE(str2.length() == 8);
-  // Needs a buffer pointer
-  str = "0123456789012345678901234567890123456789";
-  ptr = (char *)str.c_str();
-  ptr[3] = 0;
-  str2 = str;
-  REQUIRE(str2.length() == 40);
-  String str3("a");
-  ptr = (char *)str3.c_str();
-  *ptr = 0;
-  REQUIRE(str3.length() == 1);
-  str3 += str3;
-  REQUIRE(str3.length() == 2);
-  str3 += str3;
-  REQUIRE(str3.length() == 4);
-  str3 += str3;
-  REQUIRE(str3.length() == 8);
-  str3 += str3;
-  REQUIRE(str3.length() == 16);
-  str3 += str3;
-  REQUIRE(str3.length() == 32);
-  str3 += str3;
-  REQUIRE(str3.length() == 64);
-  static char zeros[64] = {0};
-  const char *p = str3.c_str();
-  REQUIRE(!memcmp(p, zeros, 64));
+    // The following should never be done in a real app! This is only to inject 0s in the middle of a string.
+    // Fits in SSO...
+    String str("01234567");
+    REQUIRE(str.length() == 8);
+    char *ptr = (char *)str.c_str();
+    ptr[3] = 0;
+    String str2;
+    str2 = str;
+    REQUIRE(str2.length() == 8);
+    // Needs a buffer pointer
+    str = "0123456789012345678901234567890123456789";
+    ptr = (char *)str.c_str();
+    ptr[3] = 0;
+    str2 = str;
+    REQUIRE(str2.length() == 40);
+    String str3("a");
+    ptr = (char *)str3.c_str();
+    *ptr = 0;
+    REQUIRE(str3.length() == 1);
+    str3 += str3;
+    REQUIRE(str3.length() == 2);
+    str3 += str3;
+    REQUIRE(str3.length() == 4);
+    str3 += str3;
+    REQUIRE(str3.length() == 8);
+    str3 += str3;
+    REQUIRE(str3.length() == 16);
+    str3 += str3;
+    REQUIRE(str3.length() == 32);
+    str3 += str3;
+    REQUIRE(str3.length() == 64);
+    static char zeros[64] = {0};
+    const char *p = str3.c_str();
+    REQUIRE(!memcmp(p, zeros, 64));
 }
 
 TEST_CASE("Replace and string expansion", "[core][String]")
 {
-  String s, l;
-  // Make these large enough to span SSO and non SSO
-  String whole = "#123456789012345678901234567890";
-  const char *res = "abcde123456789012345678901234567890";
-  for (size_t i=1; i < whole.length(); i++) {
-    s = whole.substring(0, i);
-    l = s;
-    l.replace("#", "abcde");
-    char buff[64];
-    strcpy(buff, res);
-    buff[5 + i-1] = 0;
-    REQUIRE(!strcmp(l.c_str(), buff));
-    REQUIRE(l.length() == strlen(buff));
-  }
+    String s, l;
+    // Make these large enough to span SSO and non SSO
+    String whole = "#123456789012345678901234567890";
+    const char *res = "abcde123456789012345678901234567890";
+    for (size_t i = 1; i < whole.length(); i++)
+    {
+        s = whole.substring(0, i);
+        l = s;
+        l.replace("#", "abcde");
+        char buff[64];
+        strcpy(buff, res);
+        buff[5 + i - 1] = 0;
+        REQUIRE(!strcmp(l.c_str(), buff));
+        REQUIRE(l.length() == strlen(buff));
+    }
 }
 
 TEST_CASE("String chaining", "[core][String]")
 {
-  const char* chunks[] {
-    "~12345",
-    "67890",
-    "qwertyuiopasdfghjkl",
-    "zxcvbnm"
-  };
-
-  String all;
-  for (auto* chunk : chunks) {
-      all += chunk;
-  }
-
-  // make sure we can chain a combination of things to form a String
-  REQUIRE((String(chunks[0]) + String(chunks[1]) + String(chunks[2]) + String(chunks[3])) == all);
-  REQUIRE((chunks[0] + String(chunks[1]) + F(chunks[2]) + chunks[3]) == all);
-  REQUIRE((String(chunks[0]) + F(chunks[1]) + F(chunks[2]) + String(chunks[3])) == all);
-  REQUIRE(('~' + String(&chunks[0][0] + 1) + chunks[1] + String(chunks[2]) + F(chunks[3])) == all);
-  REQUIRE((String(chunks[0]) + '6' + (&chunks[1][0] + 1) + String(chunks[2]) + F(chunks[3])) == all);
-
-  // these are still invalid (and also cannot compile at all):
-  // - `F(...)` + `F(...)`
-  // - `F(...)` + `const char*`
-  // - `const char*` + `F(...)`
-  // we need `String()` as either rhs or lhs
-
-  // ensure chaining reuses the buffer
-  // (internal details...)
-  {
-    String tmp(chunks[3]);
-    tmp.reserve(2 * all.length());
-    auto* ptr = tmp.c_str();
-    String result("~1" + String(&chunks[0][0] + 2) + F(chunks[1]) + chunks[2] + std::move(tmp));
-    REQUIRE(result == all);
-    REQUIRE(static_cast<const void*>(result.c_str()) == static_cast<const void*>(ptr));
-  }
+    const char* chunks[]
+    {
+        "~12345",
+        "67890",
+        "qwertyuiopasdfghjkl",
+        "zxcvbnm"
+    };
+
+    String all;
+    for (auto* chunk : chunks)
+    {
+        all += chunk;
+    }
+
+    // make sure we can chain a combination of things to form a String
+    REQUIRE((String(chunks[0]) + String(chunks[1]) + String(chunks[2]) + String(chunks[3])) == all);
+    REQUIRE((chunks[0] + String(chunks[1]) + F(chunks[2]) + chunks[3]) == all);
+    REQUIRE((String(chunks[0]) + F(chunks[1]) + F(chunks[2]) + String(chunks[3])) == all);
+    REQUIRE(('~' + String(&chunks[0][0] + 1) + chunks[1] + String(chunks[2]) + F(chunks[3])) == all);
+    REQUIRE((String(chunks[0]) + '6' + (&chunks[1][0] + 1) + String(chunks[2]) + F(chunks[3])) == all);
+
+    // these are still invalid (and also cannot compile at all):
+    // - `F(...)` + `F(...)`
+    // - `F(...)` + `const char*`
+    // - `const char*` + `F(...)`
+    // we need `String()` as either rhs or lhs
+
+    // ensure chaining reuses the buffer
+    // (internal details...)
+    {
+        String tmp(chunks[3]);
+        tmp.reserve(2 * all.length());
+        auto* ptr = tmp.c_str();
+        String result("~1" + String(&chunks[0][0] + 2) + F(chunks[1]) + chunks[2] + std::move(tmp));
+        REQUIRE(result == all);
+        REQUIRE(static_cast<const void*>(result.c_str()) == static_cast<const void*>(ptr));
+    }
 }
 
 TEST_CASE("String concat OOB #8198", "[core][String]")
diff --git a/tests/host/fs/test_fs.cpp b/tests/host/fs/test_fs.cpp
index fb73a6a271..dad26483a6 100644
--- a/tests/host/fs/test_fs.cpp
+++ b/tests/host/fs/test_fs.cpp
@@ -1,16 +1,16 @@
 /*
- test_fs.cpp - host side file system tests
- Copyright © 2016 Ivan Grokhotkov
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
+    test_fs.cpp - host side file system tests
+    Copyright © 2016 Ivan Grokhotkov
+
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
 */
 
 #include <catch.hpp>
@@ -25,7 +25,8 @@
 #include "../../../libraries/SD/src/SD.h"
 
 
-namespace spiffs_test {
+namespace spiffs_test
+{
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
@@ -62,7 +63,8 @@ TEST_CASE("SPIFFS checks the config object passed in", "[fs]")
 };
 
 
-namespace littlefs_test {
+namespace littlefs_test
+{
 #define FSTYPE LittleFS
 #define TESTPRE "LittleFS - "
 #define TESTPAT "[lfs]"
@@ -95,7 +97,8 @@ TEST_CASE("LittleFS checks the config object passed in", "[fs]")
 
 };
 
-namespace sdfs_test {
+namespace sdfs_test
+{
 #define FSTYPE SDFS
 #define TESTPRE "SDFS - "
 #define TESTPAT "[sdfs]"
@@ -142,7 +145,7 @@ TEST_CASE("SD.h FILE_WRITE macro is append", "[fs]")
     f.write(65);
     f.write("bbcc");
     f.write("theend", 6);
-    char block[3]={'x','y','z'};
+    char block[3] = {'x', 'y', 'z'};
     f.write(block, 3);
     uint32_t bigone = 0x40404040;
     f.write((const uint8_t*)&bigone, 4);
diff --git a/tests/host/sys/pgmspace.h b/tests/host/sys/pgmspace.h
index ecc4558351..5426685bf8 100644
--- a/tests/host/sys/pgmspace.h
+++ b/tests/host/sys/pgmspace.h
@@ -27,17 +27,17 @@
 #endif
 
 #ifdef __cplusplus
-    #define pgm_read_byte(addr)             (*reinterpret_cast<const uint8_t*>(addr))
-    #define pgm_read_word(addr)             (*reinterpret_cast<const uint16_t*>(addr))
-    #define pgm_read_dword(addr)            (*reinterpret_cast<const uint32_t*>(addr))
-    #define pgm_read_float(addr)            (*reinterpret_cast<const float*>(addr))
-    #define pgm_read_ptr(addr)              (*reinterpret_cast<const void* const *>(addr))
+#define pgm_read_byte(addr)             (*reinterpret_cast<const uint8_t*>(addr))
+#define pgm_read_word(addr)             (*reinterpret_cast<const uint16_t*>(addr))
+#define pgm_read_dword(addr)            (*reinterpret_cast<const uint32_t*>(addr))
+#define pgm_read_float(addr)            (*reinterpret_cast<const float*>(addr))
+#define pgm_read_ptr(addr)              (*reinterpret_cast<const void* const *>(addr))
 #else
-    #define pgm_read_byte(addr)             (*(const uint8_t*)(addr))
-    #define pgm_read_word(addr)             (*(const uint16_t*)(addr))
-    #define pgm_read_dword(addr)            (*(const uint32_t*)(addr))
-    #define pgm_read_float(addr)            (*(const float)(addr))
-    #define pgm_read_ptr(addr)              (*(const void* const *)(addr))
+#define pgm_read_byte(addr)             (*(const uint8_t*)(addr))
+#define pgm_read_word(addr)             (*(const uint16_t*)(addr))
+#define pgm_read_dword(addr)            (*(const uint32_t*)(addr))
+#define pgm_read_float(addr)            (*(const float)(addr))
+#define pgm_read_ptr(addr)              (*(const void* const *)(addr))
 #endif
 
 #define pgm_read_byte_near(addr)        pgm_read_byte(addr)
@@ -54,10 +54,22 @@
 // Wrapper inlines for _P functions
 #include <stdio.h>
 #include <string.h>
-inline const char *strstr_P(const char *haystack, const char *needle) { return strstr(haystack, needle); }
-inline char *strcpy_P(char *dest, const char *src) { return strcpy(dest, src); }
-inline size_t strlen_P(const char *s) { return strlen(s); }
-inline int vsnprintf_P(char *str, size_t size, const char *format, va_list ap) { return vsnprintf(str, size, format, ap); }
+inline const char *strstr_P(const char *haystack, const char *needle)
+{
+    return strstr(haystack, needle);
+}
+inline char *strcpy_P(char *dest, const char *src)
+{
+    return strcpy(dest, src);
+}
+inline size_t strlen_P(const char *s)
+{
+    return strlen(s);
+}
+inline int vsnprintf_P(char *str, size_t size, const char *format, va_list ap)
+{
+    return vsnprintf(str, size, format, ap);
+}
 
 #define memcpy_P memcpy
 #define memmove_P memmove
diff --git a/tests/restyle.sh b/tests/restyle.sh
index ea454069c5..e7fdbc6c28 100755
--- a/tests/restyle.sh
+++ b/tests/restyle.sh
@@ -20,6 +20,7 @@ cores/esp8266/core_esp8266_si2c.cpp
 cores/esp8266/StreamString.*
 cores/esp8266/StreamSend.*
 libraries/Netdump
+tests
 "
 
 # core

From b130c8b556b9bf3e2589807de207cfaae056c070 Mon Sep 17 00:00:00 2001
From: David Gauchard <gauchard@laas.fr>
Date: Wed, 19 Jan 2022 17:55:24 +0100
Subject: [PATCH 02/15] wip: use clang-format

---
 .clang-format                                 |    7 +
 .github/workflows/pull-request.yml            |    2 +-
 cores/esp8266/LwipDhcpServer-NonOS.cpp        |    7 +-
 cores/esp8266/LwipDhcpServer.cpp              |  438 ++++---
 cores/esp8266/LwipDhcpServer.h                |   66 +-
 cores/esp8266/LwipIntf.cpp                    |   20 +-
 cores/esp8266/LwipIntf.h                      |   16 +-
 cores/esp8266/LwipIntfCB.cpp                  |   16 +-
 cores/esp8266/LwipIntfDev.h                   |  107 +-
 cores/esp8266/StreamSend.cpp                  |   22 +-
 cores/esp8266/StreamString.h                  |   87 +-
 cores/esp8266/core_esp8266_si2c.cpp           |  373 +++---
 cores/esp8266/debug.cpp                       |    4 +-
 cores/esp8266/debug.h                         |   44 +-
 libraries/ESP8266mDNS/src/ESP8266mDNS.cpp     |    1 -
 libraries/ESP8266mDNS/src/ESP8266mDNS.h       |    6 +-
 libraries/ESP8266mDNS/src/LEAmDNS.cpp         |  531 ++++-----
 libraries/ESP8266mDNS/src/LEAmDNS.h           |  358 +++---
 libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp |  839 ++++++-------
 libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp |  275 ++---
 libraries/ESP8266mDNS/src/LEAmDNS_Priv.h      |   62 +-
 libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp |  619 ++++------
 .../ESP8266mDNS/src/LEAmDNS_Transfer.cpp      | 1033 ++++++++---------
 libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h  |    2 +-
 .../Netdump/examples/Netdump/Netdump.ino      |   66 +-
 libraries/Netdump/src/Netdump.cpp             |   57 +-
 libraries/Netdump/src/Netdump.h               |   23 +-
 libraries/Netdump/src/NetdumpIP.cpp           |  162 ++-
 libraries/Netdump/src/NetdumpIP.h             |   34 +-
 libraries/Netdump/src/NetdumpPacket.cpp       |  209 ++--
 libraries/Netdump/src/NetdumpPacket.h         |   40 +-
 libraries/Netdump/src/PacketType.cpp          |   58 +-
 libraries/Netdump/src/PacketType.h            |    9 +-
 libraries/SoftwareSerial                      |    2 +-
 libraries/Wire/Wire.cpp                       |   12 +-
 libraries/Wire/Wire.h                         |   15 +-
 libraries/lwIP_PPP/src/PPPServer.cpp          |  120 +-
 libraries/lwIP_PPP/src/PPPServer.h            |   10 +-
 libraries/lwIP_enc28j60/src/ENC28J60lwIP.h    |    2 +-
 .../lwIP_enc28j60/src/utility/enc28j60.cpp    |  146 ++-
 .../lwIP_enc28j60/src/utility/enc28j60.h      |   23 +-
 libraries/lwIP_w5100/src/W5100lwIP.h          |    2 +-
 libraries/lwIP_w5100/src/utility/w5100.cpp    |   43 +-
 libraries/lwIP_w5100/src/utility/w5100.h      |  163 ++-
 libraries/lwIP_w5500/src/W5500lwIP.h          |    2 +-
 libraries/lwIP_w5500/src/utility/w5500.cpp    |   31 +-
 libraries/lwIP_w5500/src/utility/w5500.h      |  115 +-
 tests/device/libraries/BSTest/src/BSArduino.h |   15 +-
 tests/device/libraries/BSTest/src/BSArgs.h    |  162 +--
 .../device/libraries/BSTest/src/BSProtocol.h  |   32 +-
 tests/device/libraries/BSTest/src/BSStdio.h   |    8 +-
 tests/device/libraries/BSTest/src/BSTest.h    |   58 +-
 tests/device/libraries/BSTest/test/test.cpp   |    8 +-
 tests/device/test_libc/libm_string.c          |  499 ++++----
 tests/device/test_libc/memcpy-1.c             |   56 +-
 tests/device/test_libc/memmove1.c             |   44 +-
 tests/device/test_libc/strcmp-1.c             |   72 +-
 tests/device/test_libc/tstring.c              |  143 ++-
 tests/host/common/Arduino.cpp                 |    3 +-
 tests/host/common/ArduinoCatch.cpp            |    3 +-
 tests/host/common/ArduinoMain.cpp             |  136 +--
 tests/host/common/ArduinoMainLittlefs.cpp     |    1 -
 tests/host/common/ArduinoMainSpiffs.cpp       |    1 -
 tests/host/common/ClientContextSocket.cpp     |   13 +-
 tests/host/common/ClientContextTools.cpp      |   10 +-
 tests/host/common/EEPROM.h                    |    8 +-
 tests/host/common/HostWiring.cpp              |   36 +-
 tests/host/common/MockDigital.cpp             |   13 +-
 tests/host/common/MockEEPROM.cpp              |    9 +-
 tests/host/common/MockEsp.cpp                 |   48 +-
 tests/host/common/MockTools.cpp               |   13 +-
 tests/host/common/MockUART.cpp                |  131 +--
 tests/host/common/MockWiFiServer.cpp          |    1 -
 tests/host/common/MockWiFiServerSocket.cpp    |    9 +-
 tests/host/common/MocklwIP.cpp                |   12 +-
 tests/host/common/MocklwIP.h                  |    7 +-
 tests/host/common/UdpContextSocket.cpp        |   31 +-
 tests/host/common/WMath.cpp                   |    5 +-
 tests/host/common/c_types.h                   |   77 +-
 tests/host/common/flash_hal_mock.cpp          |    6 +-
 tests/host/common/flash_hal_mock.h            |    4 +-
 tests/host/common/include/ClientContext.h     |   29 +-
 tests/host/common/include/UdpContext.h        |   33 +-
 tests/host/common/littlefs_mock.cpp           |   31 +-
 tests/host/common/littlefs_mock.h             |    8 +-
 tests/host/common/md5.c                       |  210 ++--
 tests/host/common/mock.h                      |   56 +-
 tests/host/common/noniso.c                    |   19 +-
 tests/host/common/pins_arduino.h              |    1 -
 tests/host/common/queue.h                     |  666 ++++++-----
 tests/host/common/sdfs_mock.cpp               |    2 +-
 tests/host/common/sdfs_mock.h                 |   29 +-
 tests/host/common/spiffs_mock.cpp             |   28 +-
 tests/host/common/spiffs_mock.h               |    8 +-
 tests/host/common/strl.cpp                    |   30 +-
 tests/host/common/user_interface.cpp          |   73 +-
 tests/host/core/test_PolledTimeout.cpp        |   17 +-
 tests/host/core/test_Print.cpp                |   28 +-
 tests/host/core/test_Updater.cpp              |    5 +-
 tests/host/core/test_md5builder.cpp           |    7 +-
 tests/host/core/test_pgmspace.cpp             |    4 +-
 tests/host/core/test_string.cpp               |   61 +-
 tests/host/fs/test_fs.cpp                     |   29 +-
 tests/host/sys/pgmspace.h                     |   52 +-
 tests/restyle.sh                              |    7 +-
 tools/sdk/lwip2/builder                       |    2 +-
 106 files changed, 4515 insertions(+), 4873 deletions(-)
 create mode 100644 .clang-format

diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000000..a54f0962b7
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,7 @@
+BasedOnStyle: Chromium
+AlignTrailingComments: true
+BreakBeforeBraces: Allman
+ColumnLimit: 0
+IndentWidth: 4
+KeepEmptyLinesAtTheStartOfBlocks: false
+SpacesBeforeTrailingComments: 2
diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml
index 74f1b43063..2606963a83 100644
--- a/.github/workflows/pull-request.yml
+++ b/.github/workflows/pull-request.yml
@@ -242,7 +242,7 @@ jobs:
         TRAVIS_TAG: ${{ github.ref }}
       run: |
           sudo apt update
-          sudo apt install astyle
+          sudo apt install astyle clang-format
           bash ./tests/ci/style_check.sh
 
 
diff --git a/cores/esp8266/LwipDhcpServer-NonOS.cpp b/cores/esp8266/LwipDhcpServer-NonOS.cpp
index 0bd04ebcfe..aee22b6d5c 100644
--- a/cores/esp8266/LwipDhcpServer-NonOS.cpp
+++ b/cores/esp8266/LwipDhcpServer-NonOS.cpp
@@ -23,7 +23,7 @@
 // these functions must exists as-is with "C" interface,
 // nonos-sdk calls them at boot time and later
 
-#include <lwip/init.h> // LWIP_VERSION
+#include <lwip/init.h>  // LWIP_VERSION
 
 #include <lwip/netif.h>
 #include "LwipDhcpServer.h"
@@ -35,8 +35,7 @@ DhcpServer dhcpSoftAP(&netif_git[SOFTAP_IF]);
 
 extern "C"
 {
-
-    void dhcps_start(struct ip_info *info, netif* apnetif)
+    void dhcps_start(struct ip_info* info, netif* apnetif)
     {
         // apnetif is esp interface, replaced by lwip2's
         // netif_git[SOFTAP_IF] interface in constructor
@@ -61,4 +60,4 @@ extern "C"
         dhcpSoftAP.end();
     }
 
-} // extern "C"
+}  // extern "C"
diff --git a/cores/esp8266/LwipDhcpServer.cpp b/cores/esp8266/LwipDhcpServer.cpp
index 86f8849a91..869c9350a9 100644
--- a/cores/esp8266/LwipDhcpServer.cpp
+++ b/cores/esp8266/LwipDhcpServer.cpp
@@ -34,23 +34,23 @@
 // (better is enemy of [good = already working])
 // ^^ this comment is supposed to be removed after the first commit
 
-#include <lwip/init.h> // LWIP_VERSION
+#include <lwip/init.h>  // LWIP_VERSION
 
-#define DHCPS_LEASE_TIME_DEF    (120)
+#define DHCPS_LEASE_TIME_DEF (120)
 
 #define USE_DNS
 
-#include "lwip/inet.h"
 #include "lwip/err.h"
+#include "lwip/inet.h"
+#include "lwip/mem.h"
 #include "lwip/pbuf.h"
 #include "lwip/udp.h"
-#include "lwip/mem.h"
 #include "osapi.h"
 
 #include "LwipDhcpServer.h"
 
-#include "user_interface.h"
 #include "mem.h"
+#include "user_interface.h"
 
 typedef struct dhcps_state
 {
@@ -107,46 +107,45 @@ struct dhcps_pool
     uint32 lease_timer;
     dhcps_type_t type;
     dhcps_state_t state;
-
 };
 
-#define DHCPS_LEASE_TIMER  dhcps_lease_time  //0x05A0
+#define DHCPS_LEASE_TIMER dhcps_lease_time  //0x05A0
 #define DHCPS_MAX_LEASE 0x64
 #define BOOTP_BROADCAST 0x8000
 
-#define DHCP_REQUEST        1
-#define DHCP_REPLY          2
+#define DHCP_REQUEST 1
+#define DHCP_REPLY 2
 #define DHCP_HTYPE_ETHERNET 1
-#define DHCP_HLEN_ETHERNET  6
-#define DHCP_MSG_LEN      236
-
-#define DHCPS_SERVER_PORT  67
-#define DHCPS_CLIENT_PORT  68
-
-#define DHCPDISCOVER  1
-#define DHCPOFFER     2
-#define DHCPREQUEST   3
-#define DHCPDECLINE   4
-#define DHCPACK       5
-#define DHCPNAK       6
-#define DHCPRELEASE   7
-
-#define DHCP_OPTION_SUBNET_MASK   1
-#define DHCP_OPTION_ROUTER        3
-#define DHCP_OPTION_DNS_SERVER    6
-#define DHCP_OPTION_REQ_IPADDR   50
-#define DHCP_OPTION_LEASE_TIME   51
-#define DHCP_OPTION_MSG_TYPE     53
-#define DHCP_OPTION_SERVER_ID    54
+#define DHCP_HLEN_ETHERNET 6
+#define DHCP_MSG_LEN 236
+
+#define DHCPS_SERVER_PORT 67
+#define DHCPS_CLIENT_PORT 68
+
+#define DHCPDISCOVER 1
+#define DHCPOFFER 2
+#define DHCPREQUEST 3
+#define DHCPDECLINE 4
+#define DHCPACK 5
+#define DHCPNAK 6
+#define DHCPRELEASE 7
+
+#define DHCP_OPTION_SUBNET_MASK 1
+#define DHCP_OPTION_ROUTER 3
+#define DHCP_OPTION_DNS_SERVER 6
+#define DHCP_OPTION_REQ_IPADDR 50
+#define DHCP_OPTION_LEASE_TIME 51
+#define DHCP_OPTION_MSG_TYPE 53
+#define DHCP_OPTION_SERVER_ID 54
 #define DHCP_OPTION_INTERFACE_MTU 26
 #define DHCP_OPTION_PERFORM_ROUTER_DISCOVERY 31
 #define DHCP_OPTION_BROADCAST_ADDRESS 28
-#define DHCP_OPTION_REQ_LIST     55
-#define DHCP_OPTION_END         255
+#define DHCP_OPTION_REQ_LIST 55
+#define DHCP_OPTION_END 255
 
 //#define USE_CLASS_B_NET 1
-#define DHCPS_DEBUG          0
-#define MAX_STATION_NUM      8
+#define DHCPS_DEBUG 0
+#define MAX_STATION_NUM 8
 
 #define DHCPS_STATE_OFFER 1
 #define DHCPS_STATE_DECLINE 2
@@ -155,25 +154,35 @@ struct dhcps_pool
 #define DHCPS_STATE_IDLE 5
 #define DHCPS_STATE_RELEASE 6
 
-#define   dhcps_router_enabled(offer)	((offer & OFFER_ROUTER) != 0)
+#define dhcps_router_enabled(offer) ((offer & OFFER_ROUTER) != 0)
 
 #ifdef MEMLEAK_DEBUG
 const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__;
 #endif
 
 #if DHCPS_DEBUG
-#define LWIP_IS_OK(what,err) ({ int ret = 1, errval = (err); if (errval != ERR_OK) { os_printf("DHCPS ERROR: %s (lwip:%d)\n", what, errval); ret = 0; } ret; })
+#define LWIP_IS_OK(what, err) (                                     \
+    {                                                               \
+        int ret = 1, errval = (err);                                \
+        if (errval != ERR_OK)                                       \
+        {                                                           \
+            os_printf("DHCPS ERROR: %s (lwip:%d)\n", what, errval); \
+            ret = 0;                                                \
+        }                                                           \
+        ret;                                                        \
+    })
 #else
-#define LWIP_IS_OK(what,err) ((err) == ERR_OK)
+#define LWIP_IS_OK(what, err) ((err) == ERR_OK)
 #endif
 
-const uint32 DhcpServer::magic_cookie = 0x63538263; // https://tools.ietf.org/html/rfc1497
+const uint32 DhcpServer::magic_cookie = 0x63538263;  // https://tools.ietf.org/html/rfc1497
 
 int fw_has_started_softap_dhcps = 0;
 
 ////////////////////////////////////////////////////////////////////////////////////
 
-DhcpServer::DhcpServer(netif* netif): _netif(netif)
+DhcpServer::DhcpServer(netif* netif)
+    : _netif(netif)
 {
     pcb_dhcps = nullptr;
     dns_address.addr = 0;
@@ -189,13 +198,13 @@ DhcpServer::DhcpServer(netif* netif): _netif(netif)
         // 2. global ctor DhcpServer's `dhcpSoftAP(&netif_git[SOFTAP_IF])` is called
         // 3. (that's here) => begin(legacy-values) is called
         ip_info ip =
-        {
-            { 0x0104a8c0 }, // IP 192.168.4.1
-            { 0x00ffffff }, // netmask 255.255.255.0
-            { 0 }           // gateway 0.0.0.0
-        };
+            {
+                {0x0104a8c0},  // IP 192.168.4.1
+                {0x00ffffff},  // netmask 255.255.255.0
+                {0}            // gateway 0.0.0.0
+            };
         begin(&ip);
-        fw_has_started_softap_dhcps = 2; // not 1, ending initial boot sequence
+        fw_has_started_softap_dhcps = 2;  // not 1, ending initial boot sequence
     }
 };
 
@@ -217,11 +226,11 @@ void DhcpServer::dhcps_set_dns(int num, const ipv4_addr_t* dns)
     Parameters   : arg -- Additional argument to pass to the callback function
     Returns      : none
 *******************************************************************************/
-void DhcpServer::node_insert_to_list(list_node **phead, list_node* pinsert)
+void DhcpServer::node_insert_to_list(list_node** phead, list_node* pinsert)
 {
-    list_node *plist = nullptr;
-    struct dhcps_pool *pdhcps_pool = nullptr;
-    struct dhcps_pool *pdhcps_node = nullptr;
+    list_node* plist = nullptr;
+    struct dhcps_pool* pdhcps_pool = nullptr;
+    struct dhcps_pool* pdhcps_node = nullptr;
     if (*phead == nullptr)
     {
         *phead = pinsert;
@@ -266,9 +275,9 @@ void DhcpServer::node_insert_to_list(list_node **phead, list_node* pinsert)
     Parameters   : arg -- Additional argument to pass to the callback function
     Returns      : none
 *******************************************************************************/
-void DhcpServer::node_remove_from_list(list_node **phead, list_node* pdelete)
+void DhcpServer::node_remove_from_list(list_node** phead, list_node* pdelete)
 {
-    list_node *plist = nullptr;
+    list_node* plist = nullptr;
 
     plist = *phead;
     if (plist == nullptr)
@@ -303,10 +312,10 @@ void DhcpServer::node_remove_from_list(list_node **phead, list_node* pdelete)
     Parameters   : mac address
     Returns      : true if ok and false if this mac already exist or if all ip are already reserved
 *******************************************************************************/
-bool DhcpServer::add_dhcps_lease(uint8 *macaddr)
+bool DhcpServer::add_dhcps_lease(uint8* macaddr)
 {
-    struct dhcps_pool *pdhcps_pool = nullptr;
-    list_node *pback_node = nullptr;
+    struct dhcps_pool* pdhcps_pool = nullptr;
+    list_node* pback_node = nullptr;
 
     uint32 start_ip = dhcps_lease.start_ip.addr;
     uint32 end_ip = dhcps_lease.end_ip.addr;
@@ -335,13 +344,13 @@ bool DhcpServer::add_dhcps_lease(uint8 *macaddr)
         return false;
     }
 
-    pdhcps_pool = (struct dhcps_pool *)zalloc(sizeof(struct dhcps_pool));
+    pdhcps_pool = (struct dhcps_pool*)zalloc(sizeof(struct dhcps_pool));
     pdhcps_pool->ip.addr = start_ip;
     memcpy(pdhcps_pool->mac, macaddr, sizeof(pdhcps_pool->mac));
     pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
     pdhcps_pool->type = DHCPS_TYPE_STATIC;
     pdhcps_pool->state = DHCPS_STATE_ONLINE;
-    pback_node = (list_node *)zalloc(sizeof(list_node));
+    pback_node = (list_node*)zalloc(sizeof(list_node));
     pback_node->pnode = pdhcps_pool;
     pback_node->pnext = nullptr;
     node_insert_to_list(&plist, pback_node);
@@ -359,9 +368,8 @@ bool DhcpServer::add_dhcps_lease(uint8 *macaddr)
     @return uint8_t* DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-uint8_t* DhcpServer::add_msg_type(uint8_t *optptr, uint8_t type)
+uint8_t* DhcpServer::add_msg_type(uint8_t* optptr, uint8_t type)
 {
-
     *optptr++ = DHCP_OPTION_MSG_TYPE;
     *optptr++ = 1;
     *optptr++ = type;
@@ -376,7 +384,7 @@ uint8_t* DhcpServer::add_msg_type(uint8_t *optptr, uint8_t type)
     @return uint8_t* DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-uint8_t* DhcpServer::add_offer_options(uint8_t *optptr)
+uint8_t* DhcpServer::add_offer_options(uint8_t* optptr)
 {
     //struct ipv4_addr ipadd;
     //ipadd.addr = server_address.addr;
@@ -448,19 +456,19 @@ uint8_t* DhcpServer::add_offer_options(uint8_t *optptr)
     *optptr++ = DHCP_OPTION_INTERFACE_MTU;
     *optptr++ = 2;
     *optptr++ = 0x05;
-    *optptr++ = 0xdc; // 1500
+    *optptr++ = 0xdc;  // 1500
 
     *optptr++ = DHCP_OPTION_PERFORM_ROUTER_DISCOVERY;
     *optptr++ = 1;
     *optptr++ = 0x00;
 
-#if 0 // vendor specific uninitialized (??)
+#if 0  // vendor specific uninitialized (??)
     *optptr++ = 43; // vendor specific
     *optptr++ = 6;
     // uninitialized ?
 #endif
 
-#if 0 // already set (DHCP_OPTION_SUBNET_MASK==1) (??)
+#if 0  // already set (DHCP_OPTION_SUBNET_MASK==1) (??)
     *optptr++ = 0x01;
     *optptr++ = 4;
     *optptr++ = 0;
@@ -483,15 +491,14 @@ uint8_t* DhcpServer::add_offer_options(uint8_t *optptr)
     @return uint8_t* DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-uint8_t* DhcpServer::add_end(uint8_t *optptr)
+uint8_t* DhcpServer::add_end(uint8_t* optptr)
 {
-
     *optptr++ = DHCP_OPTION_END;
     return optptr;
 }
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
-void DhcpServer::create_msg(struct dhcps_msg *m)
+void DhcpServer::create_msg(struct dhcps_msg* m)
 {
     struct ipv4_addr client;
 
@@ -504,14 +511,14 @@ void DhcpServer::create_msg(struct dhcps_msg *m)
     m->secs = 0;
     m->flags = htons(BOOTP_BROADCAST);
 
-    memcpy((char *) m->yiaddr, (char *) &client.addr, sizeof(m->yiaddr));
-    memset((char *) m->ciaddr, 0, sizeof(m->ciaddr));
-    memset((char *) m->siaddr, 0, sizeof(m->siaddr));
-    memset((char *) m->giaddr, 0, sizeof(m->giaddr));
-    memset((char *) m->sname, 0, sizeof(m->sname));
-    memset((char *) m->file, 0, sizeof(m->file));
-    memset((char *) m->options, 0, sizeof(m->options));
-    memcpy((char *) m->options, &magic_cookie, sizeof(magic_cookie));
+    memcpy((char*)m->yiaddr, (char*)&client.addr, sizeof(m->yiaddr));
+    memset((char*)m->ciaddr, 0, sizeof(m->ciaddr));
+    memset((char*)m->siaddr, 0, sizeof(m->siaddr));
+    memset((char*)m->giaddr, 0, sizeof(m->giaddr));
+    memset((char*)m->sname, 0, sizeof(m->sname));
+    memset((char*)m->file, 0, sizeof(m->file));
+    memset((char*)m->options, 0, sizeof(m->options));
+    memcpy((char*)m->options, &magic_cookie, sizeof(magic_cookie));
 }
 ///////////////////////////////////////////////////////////////////////////////////
 /*
@@ -520,11 +527,11 @@ void DhcpServer::create_msg(struct dhcps_msg *m)
     @param -- m DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-void DhcpServer::send_offer(struct dhcps_msg *m)
+void DhcpServer::send_offer(struct dhcps_msg* m)
 {
-    uint8_t *end;
+    uint8_t* end;
     struct pbuf *p, *q;
-    u8_t *data;
+    u8_t* data;
     u16_t cnt = 0;
     u16_t i;
     create_msg(m);
@@ -539,7 +546,6 @@ void DhcpServer::send_offer(struct dhcps_msg *m)
 #endif
     if (p != nullptr)
     {
-
 #if DHCPS_DEBUG
         os_printf("dhcps: send_offer>>pbuf_alloc succeed\n");
         os_printf("dhcps: send_offer>>p->tot_len = %d\n", p->tot_len);
@@ -548,10 +554,10 @@ void DhcpServer::send_offer(struct dhcps_msg *m)
         q = p;
         while (q != nullptr)
         {
-            data = (u8_t *)q->payload;
+            data = (u8_t*)q->payload;
             for (i = 0; i < q->len; i++)
             {
-                data[i] = ((u8_t *) m)[cnt++];
+                data[i] = ((u8_t*)m)[cnt++];
             }
 
             q = q->next;
@@ -559,7 +565,6 @@ void DhcpServer::send_offer(struct dhcps_msg *m)
     }
     else
     {
-
 #if DHCPS_DEBUG
         os_printf("dhcps: send_offer>>pbuf_alloc failed\n");
 #endif
@@ -586,12 +591,11 @@ void DhcpServer::send_offer(struct dhcps_msg *m)
     @param m DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-void DhcpServer::send_nak(struct dhcps_msg *m)
+void DhcpServer::send_nak(struct dhcps_msg* m)
 {
-
-    u8_t *end;
+    u8_t* end;
     struct pbuf *p, *q;
-    u8_t *data;
+    u8_t* data;
     u16_t cnt = 0;
     u16_t i;
     create_msg(m);
@@ -605,7 +609,6 @@ void DhcpServer::send_nak(struct dhcps_msg *m)
 #endif
     if (p != nullptr)
     {
-
 #if DHCPS_DEBUG
         os_printf("dhcps: send_nak>>pbuf_alloc succeed\n");
         os_printf("dhcps: send_nak>>p->tot_len = %d\n", p->tot_len);
@@ -614,10 +617,10 @@ void DhcpServer::send_nak(struct dhcps_msg *m)
         q = p;
         while (q != nullptr)
         {
-            data = (u8_t *)q->payload;
+            data = (u8_t*)q->payload;
             for (i = 0; i < q->len; i++)
             {
-                data[i] = ((u8_t *) m)[cnt++];
+                data[i] = ((u8_t*)m)[cnt++];
             }
 
             q = q->next;
@@ -625,7 +628,6 @@ void DhcpServer::send_nak(struct dhcps_msg *m)
     }
     else
     {
-
 #if DHCPS_DEBUG
         os_printf("dhcps: send_nak>>pbuf_alloc failed\n");
 #endif
@@ -647,12 +649,11 @@ void DhcpServer::send_nak(struct dhcps_msg *m)
     @param m DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-void DhcpServer::send_ack(struct dhcps_msg *m)
+void DhcpServer::send_ack(struct dhcps_msg* m)
 {
-
-    u8_t *end;
+    u8_t* end;
     struct pbuf *p, *q;
-    u8_t *data;
+    u8_t* data;
     u16_t cnt = 0;
     u16_t i;
     create_msg(m);
@@ -667,7 +668,6 @@ void DhcpServer::send_ack(struct dhcps_msg *m)
 #endif
     if (p != nullptr)
     {
-
 #if DHCPS_DEBUG
         os_printf("dhcps: send_ack>>pbuf_alloc succeed\n");
         os_printf("dhcps: send_ack>>p->tot_len = %d\n", p->tot_len);
@@ -676,10 +676,10 @@ void DhcpServer::send_ack(struct dhcps_msg *m)
         q = p;
         while (q != nullptr)
         {
-            data = (u8_t *)q->payload;
+            data = (u8_t*)q->payload;
             for (i = 0; i < q->len; i++)
             {
-                data[i] = ((u8_t *) m)[cnt++];
+                data[i] = ((u8_t*)m)[cnt++];
             }
 
             q = q->next;
@@ -687,7 +687,6 @@ void DhcpServer::send_ack(struct dhcps_msg *m)
     }
     else
     {
-
 #if DHCPS_DEBUG
         os_printf("dhcps: send_ack>>pbuf_alloc failed\n");
 #endif
@@ -718,7 +717,7 @@ void DhcpServer::send_ack(struct dhcps_msg *m)
     @return uint8_t* DHCP Server
 */
 ///////////////////////////////////////////////////////////////////////////////////
-uint8_t DhcpServer::parse_options(uint8_t *optptr, sint16_t len)
+uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
 {
     struct ipv4_addr client;
     bool is_dhcp_parse_end = false;
@@ -726,7 +725,7 @@ uint8_t DhcpServer::parse_options(uint8_t *optptr, sint16_t len)
 
     client.addr = client_address.addr;
 
-    u8_t *end = optptr + len;
+    u8_t* end = optptr + len;
     u16_t type = 0;
 
     s.state = DHCPS_STATE_IDLE;
@@ -736,35 +735,34 @@ uint8_t DhcpServer::parse_options(uint8_t *optptr, sint16_t len)
 #if DHCPS_DEBUG
         os_printf("dhcps: (sint16_t)*optptr = %d\n", (sint16_t)*optptr);
 #endif
-        switch ((sint16_t) *optptr)
+        switch ((sint16_t)*optptr)
         {
+            case DHCP_OPTION_MSG_TYPE:  //53
+                type = *(optptr + 2);
+                break;
 
-        case DHCP_OPTION_MSG_TYPE:  //53
-            type = *(optptr + 2);
-            break;
-
-        case DHCP_OPTION_REQ_IPADDR://50
-            //os_printf("dhcps:0x%08x,0x%08x\n",client.addr,*(uint32*)(optptr+2));
-            if (memcmp((char *) &client.addr, (char *) optptr + 2, 4) == 0)
-            {
+            case DHCP_OPTION_REQ_IPADDR:  //50
+                //os_printf("dhcps:0x%08x,0x%08x\n",client.addr,*(uint32*)(optptr+2));
+                if (memcmp((char*)&client.addr, (char*)optptr + 2, 4) == 0)
+                {
 #if DHCPS_DEBUG
-                os_printf("dhcps: DHCP_OPTION_REQ_IPADDR = 0 ok\n");
+                    os_printf("dhcps: DHCP_OPTION_REQ_IPADDR = 0 ok\n");
 #endif
-                s.state = DHCPS_STATE_ACK;
-            }
-            else
-            {
+                    s.state = DHCPS_STATE_ACK;
+                }
+                else
+                {
 #if DHCPS_DEBUG
-                os_printf("dhcps: DHCP_OPTION_REQ_IPADDR != 0 err\n");
+                    os_printf("dhcps: DHCP_OPTION_REQ_IPADDR != 0 err\n");
 #endif
-                s.state = DHCPS_STATE_NAK;
+                    s.state = DHCPS_STATE_NAK;
+                }
+                break;
+            case DHCP_OPTION_END:
+            {
+                is_dhcp_parse_end = true;
             }
             break;
-        case DHCP_OPTION_END:
-        {
-            is_dhcp_parse_end = true;
-        }
-        break;
         }
 
         if (is_dhcp_parse_end)
@@ -777,43 +775,43 @@ uint8_t DhcpServer::parse_options(uint8_t *optptr, sint16_t len)
 
     switch (type)
     {
-    case DHCPDISCOVER://1
-        s.state = DHCPS_STATE_OFFER;
+        case DHCPDISCOVER:  //1
+            s.state = DHCPS_STATE_OFFER;
 #if DHCPS_DEBUG
-        os_printf("dhcps: DHCPD_STATE_OFFER\n");
+            os_printf("dhcps: DHCPD_STATE_OFFER\n");
 #endif
-        break;
+            break;
 
-    case DHCPREQUEST://3
-        if (!(s.state == DHCPS_STATE_ACK || s.state == DHCPS_STATE_NAK))
-        {
-            if (renew == true)
+        case DHCPREQUEST:  //3
+            if (!(s.state == DHCPS_STATE_ACK || s.state == DHCPS_STATE_NAK))
             {
-                s.state = DHCPS_STATE_ACK;
-            }
-            else
-            {
-                s.state = DHCPS_STATE_NAK;
-            }
+                if (renew == true)
+                {
+                    s.state = DHCPS_STATE_ACK;
+                }
+                else
+                {
+                    s.state = DHCPS_STATE_NAK;
+                }
 #if DHCPS_DEBUG
-            os_printf("dhcps: DHCPD_STATE_NAK\n");
+                os_printf("dhcps: DHCPD_STATE_NAK\n");
 #endif
-        }
-        break;
+            }
+            break;
 
-    case DHCPDECLINE://4
-        s.state = DHCPS_STATE_IDLE;
+        case DHCPDECLINE:  //4
+            s.state = DHCPS_STATE_IDLE;
 #if DHCPS_DEBUG
-        os_printf("dhcps: DHCPD_STATE_IDLE\n");
+            os_printf("dhcps: DHCPD_STATE_IDLE\n");
 #endif
-        break;
+            break;
 
-    case DHCPRELEASE://7
-        s.state = DHCPS_STATE_RELEASE;
+        case DHCPRELEASE:  //7
+            s.state = DHCPS_STATE_RELEASE;
 #if DHCPS_DEBUG
-        os_printf("dhcps: DHCPD_STATE_IDLE\n");
+            os_printf("dhcps: DHCPD_STATE_IDLE\n");
 #endif
-        break;
+            break;
     }
 #if DHCPS_DEBUG
     os_printf("dhcps: return s.state = %d\n", s.state);
@@ -822,9 +820,9 @@ uint8_t DhcpServer::parse_options(uint8_t *optptr, sint16_t len)
 }
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
-sint16_t DhcpServer::parse_msg(struct dhcps_msg *m, u16_t len)
+sint16_t DhcpServer::parse_msg(struct dhcps_msg* m, u16_t len)
 {
-    if (memcmp((char *)m->options,
+    if (memcmp((char*)m->options,
                &magic_cookie,
                sizeof(magic_cookie)) == 0)
     {
@@ -836,7 +834,7 @@ sint16_t DhcpServer::parse_msg(struct dhcps_msg *m, u16_t len)
 
         if (ret == DHCPS_STATE_RELEASE)
         {
-            dhcps_client_leave(m->chaddr, &ip, true); // force to delete
+            dhcps_client_leave(m->chaddr, &ip, true);  // force to delete
             client_address.addr = ip.addr;
         }
 
@@ -857,10 +855,10 @@ sint16_t DhcpServer::parse_msg(struct dhcps_msg *m, u16_t len)
 */
 ///////////////////////////////////////////////////////////////////////////////////
 
-void DhcpServer::S_handle_dhcp(void *arg,
-                               struct udp_pcb *pcb,
-                               struct pbuf *p,
-                               const ip_addr_t *addr,
+void DhcpServer::S_handle_dhcp(void* arg,
+                               struct udp_pcb* pcb,
+                               struct pbuf* p,
+                               const ip_addr_t* addr,
                                uint16_t port)
 {
     DhcpServer* instance = reinterpret_cast<DhcpServer*>(arg);
@@ -868,21 +866,21 @@ void DhcpServer::S_handle_dhcp(void *arg,
 }
 
 void DhcpServer::handle_dhcp(
-    struct udp_pcb *pcb,
-    struct pbuf *p,
-    const ip_addr_t *addr,
+    struct udp_pcb* pcb,
+    struct pbuf* p,
+    const ip_addr_t* addr,
     uint16_t port)
 {
     (void)pcb;
     (void)addr;
     (void)port;
 
-    struct dhcps_msg *pmsg_dhcps = nullptr;
+    struct dhcps_msg* pmsg_dhcps = nullptr;
     sint16_t tlen = 0;
     u16_t i = 0;
     u16_t dhcps_msg_cnt = 0;
-    u8_t *p_dhcps_msg = nullptr;
-    u8_t *data = nullptr;
+    u8_t* p_dhcps_msg = nullptr;
+    u8_t* data = nullptr;
 
 #if DHCPS_DEBUG
     os_printf("dhcps: handle_dhcp-> receive a packet\n");
@@ -892,13 +890,13 @@ void DhcpServer::handle_dhcp(
         return;
     }
 
-    pmsg_dhcps = (struct dhcps_msg *)zalloc(sizeof(struct dhcps_msg));
+    pmsg_dhcps = (struct dhcps_msg*)zalloc(sizeof(struct dhcps_msg));
     if (nullptr == pmsg_dhcps)
     {
         pbuf_free(p);
         return;
     }
-    p_dhcps_msg = (u8_t *)pmsg_dhcps;
+    p_dhcps_msg = (u8_t*)pmsg_dhcps;
     tlen = p->tot_len;
     data = (u8_t*)p->payload;
 
@@ -933,31 +931,30 @@ void DhcpServer::handle_dhcp(
 
     switch (parse_msg(pmsg_dhcps, tlen - 240))
     {
-
-    case DHCPS_STATE_OFFER://1
+        case DHCPS_STATE_OFFER:  //1
 #if DHCPS_DEBUG
-        os_printf("dhcps: handle_dhcp-> DHCPD_STATE_OFFER\n");
+            os_printf("dhcps: handle_dhcp-> DHCPD_STATE_OFFER\n");
 #endif
-        send_offer(pmsg_dhcps);
-        break;
-    case DHCPS_STATE_ACK://3
+            send_offer(pmsg_dhcps);
+            break;
+        case DHCPS_STATE_ACK:  //3
 #if DHCPS_DEBUG
-        os_printf("dhcps: handle_dhcp-> DHCPD_STATE_ACK\n");
+            os_printf("dhcps: handle_dhcp-> DHCPD_STATE_ACK\n");
 #endif
-        send_ack(pmsg_dhcps);
-        if (_netif->num == SOFTAP_IF)
-        {
-            wifi_softap_set_station_info(pmsg_dhcps->chaddr, &client_address);
-        }
-        break;
-    case DHCPS_STATE_NAK://4
+            send_ack(pmsg_dhcps);
+            if (_netif->num == SOFTAP_IF)
+            {
+                wifi_softap_set_station_info(pmsg_dhcps->chaddr, &client_address);
+            }
+            break;
+        case DHCPS_STATE_NAK:  //4
 #if DHCPS_DEBUG
-        os_printf("dhcps: handle_dhcp-> DHCPD_STATE_NAK\n");
+            os_printf("dhcps: handle_dhcp-> DHCPD_STATE_NAK\n");
 #endif
-        send_nak(pmsg_dhcps);
-        break;
-    default :
-        break;
+            send_nak(pmsg_dhcps);
+            break;
+        default:
+            break;
     }
 #if DHCPS_DEBUG
     os_printf("dhcps: handle_dhcp-> pbuf_free(p)\n");
@@ -986,8 +983,7 @@ void DhcpServer::init_dhcps_lease(uint32 ip)
         {
             /*config ip information must be in the same segment as the local ip*/
             softap_ip >>= 8;
-            if (((start_ip >> 8 != softap_ip) || (end_ip >> 8 != softap_ip))
-                    || (end_ip - start_ip > DHCPS_MAX_LEASE))
+            if (((start_ip >> 8 != softap_ip) || (end_ip >> 8 != softap_ip)) || (end_ip - start_ip > DHCPS_MAX_LEASE))
             {
                 dhcps_lease.enable = false;
             }
@@ -1005,7 +1001,7 @@ void DhcpServer::init_dhcps_lease(uint32 ip)
         }
         else
         {
-            local_ip ++;
+            local_ip++;
         }
 
         bzero(&dhcps_lease, sizeof(dhcps_lease));
@@ -1020,7 +1016,7 @@ void DhcpServer::init_dhcps_lease(uint32 ip)
 }
 ///////////////////////////////////////////////////////////////////////////////////
 
-bool DhcpServer::begin(struct ip_info *info)
+bool DhcpServer::begin(struct ip_info* info)
 {
     if (pcb_dhcps != nullptr)
     {
@@ -1053,9 +1049,9 @@ bool DhcpServer::begin(struct ip_info *info)
 
     if (_netif->num == SOFTAP_IF)
     {
-        wifi_set_ip_info(SOFTAP_IF, info);    // added for lwip-git, not sure whether useful
+        wifi_set_ip_info(SOFTAP_IF, info);  // added for lwip-git, not sure whether useful
     }
-    _netif->flags |= NETIF_FLAG_UP | NETIF_FLAG_LINK_UP; // added for lwip-git
+    _netif->flags |= NETIF_FLAG_UP | NETIF_FLAG_LINK_UP;  // added for lwip-git
 
     return true;
 }
@@ -1077,8 +1073,8 @@ void DhcpServer::end()
     pcb_dhcps = nullptr;
 
     //udp_remove(pcb_dhcps);
-    list_node *pnode = nullptr;
-    list_node *pback_node = nullptr;
+    list_node* pnode = nullptr;
+    list_node* pback_node = nullptr;
     struct dhcps_pool* dhcp_node = nullptr;
     struct ipv4_addr ip_zero;
 
@@ -1107,7 +1103,6 @@ bool DhcpServer::isRunning()
     return !!_netif->state;
 }
 
-
 /******************************************************************************
     FunctionName : set_dhcps_lease
     Description  : set the lease information of DHCP server
@@ -1115,7 +1110,7 @@ bool DhcpServer::isRunning()
                             Little-Endian.
     Returns      : true or false
 *******************************************************************************/
-bool DhcpServer::set_dhcps_lease(struct dhcps_lease *please)
+bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
 {
     uint32 softap_ip = 0;
     uint32 start_ip = 0;
@@ -1151,8 +1146,7 @@ bool DhcpServer::set_dhcps_lease(struct dhcps_lease *please)
 
         /*config ip information must be in the same segment as the local ip*/
         softap_ip >>= 8;
-        if ((start_ip >> 8 != softap_ip)
-                || (end_ip >> 8 != softap_ip))
+        if ((start_ip >> 8 != softap_ip) || (end_ip >> 8 != softap_ip))
         {
             return false;
         }
@@ -1180,7 +1174,7 @@ bool DhcpServer::set_dhcps_lease(struct dhcps_lease *please)
                             Little-Endian.
     Returns      : true or false
 *******************************************************************************/
-bool DhcpServer::get_dhcps_lease(struct dhcps_lease *please)
+bool DhcpServer::get_dhcps_lease(struct dhcps_lease* please)
 {
     if (_netif->num == SOFTAP_IF)
     {
@@ -1244,7 +1238,8 @@ void DhcpServer::kill_oldest_dhcps_pool(void)
         pre = p;
         p = p->pnext;
     }
-    minpre->pnext = minp->pnext; pdhcps_pool->state = DHCPS_STATE_OFFLINE;
+    minpre->pnext = minp->pnext;
+    pdhcps_pool->state = DHCPS_STATE_OFFLINE;
     free(minp->pnode);
     minp->pnode = nullptr;
     free(minp);
@@ -1254,16 +1249,16 @@ void DhcpServer::kill_oldest_dhcps_pool(void)
 void DhcpServer::dhcps_coarse_tmr(void)
 {
     uint8 num_dhcps_pool = 0;
-    list_node *pback_node = nullptr;
-    list_node *pnode = nullptr;
-    struct dhcps_pool *pdhcps_pool = nullptr;
+    list_node* pback_node = nullptr;
+    list_node* pnode = nullptr;
+    struct dhcps_pool* pdhcps_pool = nullptr;
     pnode = plist;
     while (pnode != nullptr)
     {
         pdhcps_pool = (struct dhcps_pool*)pnode->pnode;
         if (pdhcps_pool->type == DHCPS_TYPE_DYNAMIC)
         {
-            pdhcps_pool->lease_timer --;
+            pdhcps_pool->lease_timer--;
         }
         if (pdhcps_pool->lease_timer == 0)
         {
@@ -1277,8 +1272,8 @@ void DhcpServer::dhcps_coarse_tmr(void)
         }
         else
         {
-            pnode = pnode ->pnext;
-            num_dhcps_pool ++;
+            pnode = pnode->pnext;
+            num_dhcps_pool++;
         }
     }
 
@@ -1304,13 +1299,13 @@ bool DhcpServer::set_dhcps_offer_option(uint8 level, void* optarg)
 
     switch (level)
     {
-    case OFFER_ROUTER:
-        offer = (*(uint8 *)optarg) & 0x01;
-        offer_flag = true;
-        break;
-    default :
-        offer_flag = false;
-        break;
+        case OFFER_ROUTER:
+            offer = (*(uint8*)optarg) & 0x01;
+            offer_flag = true;
+            break;
+        default:
+            offer_flag = false;
+            break;
     }
     return offer_flag;
 }
@@ -1358,15 +1353,15 @@ bool DhcpServer::reset_dhcps_lease_time(void)
     return true;
 }
 
-uint32 DhcpServer::get_dhcps_lease_time(void) // minute
+uint32 DhcpServer::get_dhcps_lease_time(void)  // minute
 {
     return dhcps_lease_time;
 }
 
-void DhcpServer::dhcps_client_leave(u8 *bssid, struct ipv4_addr *ip, bool force)
+void DhcpServer::dhcps_client_leave(u8* bssid, struct ipv4_addr* ip, bool force)
 {
-    struct dhcps_pool *pdhcps_pool = nullptr;
-    list_node *pback_node = nullptr;
+    struct dhcps_pool* pdhcps_pool = nullptr;
+    list_node* pback_node = nullptr;
 
     if ((bssid == nullptr) || (ip == nullptr))
     {
@@ -1412,12 +1407,12 @@ void DhcpServer::dhcps_client_leave(u8 *bssid, struct ipv4_addr *ip, bool force)
     }
 }
 
-uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
+uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
 {
-    struct dhcps_pool *pdhcps_pool = nullptr;
-    list_node *pback_node = nullptr;
-    list_node *pmac_node = nullptr;
-    list_node *pip_node = nullptr;
+    struct dhcps_pool* pdhcps_pool = nullptr;
+    list_node* pback_node = nullptr;
+    list_node* pmac_node = nullptr;
+    list_node* pip_node = nullptr;
     bool flag = false;
     uint32 start_ip = dhcps_lease.start_ip.addr;
     uint32 end_ip = dhcps_lease.end_ip.addr;
@@ -1501,7 +1496,7 @@ uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
         }
     }
 
-    if (pmac_node != nullptr)   // update new ip
+    if (pmac_node != nullptr)  // update new ip
     {
         if (pip_node != nullptr)
         {
@@ -1531,7 +1526,6 @@ uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
             pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
             pdhcps_pool->type = type;
             pdhcps_pool->state = DHCPS_STATE_ONLINE;
-
         }
         else
         {
@@ -1544,7 +1538,7 @@ uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
             {
                 pdhcps_pool->ip.addr = start_ip;
             }
-            else        // no ip to distribute
+            else  // no ip to distribute
             {
                 return IPADDR_ANY;
             }
@@ -1556,9 +1550,9 @@ uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
             node_insert_to_list(&plist, pmac_node);
         }
     }
-    else     // new station
+    else  // new station
     {
-        if (pip_node != nullptr)   // maybe ip has used
+        if (pip_node != nullptr)  // maybe ip has used
         {
             pdhcps_pool = (struct dhcps_pool*)pip_node->pnode;
             if (pdhcps_pool->state != DHCPS_STATE_OFFLINE)
@@ -1572,7 +1566,7 @@ uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
         }
         else
         {
-            pdhcps_pool = (struct dhcps_pool *)zalloc(sizeof(struct dhcps_pool));
+            pdhcps_pool = (struct dhcps_pool*)zalloc(sizeof(struct dhcps_pool));
             if (ip != nullptr)
             {
                 pdhcps_pool->ip.addr = ip->addr;
@@ -1581,7 +1575,7 @@ uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
             {
                 pdhcps_pool->ip.addr = start_ip;
             }
-            else        // no ip to distribute
+            else  // no ip to distribute
             {
                 free(pdhcps_pool);
                 return IPADDR_ANY;
@@ -1595,7 +1589,7 @@ uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
             pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
             pdhcps_pool->type = type;
             pdhcps_pool->state = DHCPS_STATE_ONLINE;
-            pback_node = (list_node *)zalloc(sizeof(list_node));
+            pback_node = (list_node*)zalloc(sizeof(list_node));
             pback_node->pnode = pdhcps_pool;
             pback_node->pnext = nullptr;
             node_insert_to_list(&plist, pback_node);
diff --git a/cores/esp8266/LwipDhcpServer.h b/cores/esp8266/LwipDhcpServer.h
index e93166981d..51c4bf86f9 100644
--- a/cores/esp8266/LwipDhcpServer.h
+++ b/cores/esp8266/LwipDhcpServer.h
@@ -31,12 +31,11 @@
 #ifndef __DHCPS_H__
 #define __DHCPS_H__
 
-#include <lwip/init.h> // LWIP_VERSION
+#include <lwip/init.h>  // LWIP_VERSION
 
 class DhcpServer
 {
-public:
-
+   public:
     DhcpServer(netif* netif);
     ~DhcpServer();
 
@@ -54,55 +53,54 @@ class DhcpServer
     // legacy public C structure and API to eventually turn into C++
 
     void init_dhcps_lease(uint32 ip);
-    bool set_dhcps_lease(struct dhcps_lease *please);
-    bool get_dhcps_lease(struct dhcps_lease *please);
+    bool set_dhcps_lease(struct dhcps_lease* please);
+    bool get_dhcps_lease(struct dhcps_lease* please);
     bool set_dhcps_offer_option(uint8 level, void* optarg);
     bool set_dhcps_lease_time(uint32 minute);
     bool reset_dhcps_lease_time(void);
     uint32 get_dhcps_lease_time(void);
-    bool add_dhcps_lease(uint8 *macaddr);
+    bool add_dhcps_lease(uint8* macaddr);
 
     void dhcps_set_dns(int num, const ipv4_addr_t* dns);
 
-protected:
-
+   protected:
     // legacy C structure and API to eventually turn into C++
 
     typedef struct _list_node
     {
-        void *pnode;
-        struct _list_node *pnext;
+        void* pnode;
+        struct _list_node* pnext;
     } list_node;
 
-    void node_insert_to_list(list_node **phead, list_node* pinsert);
-    void node_remove_from_list(list_node **phead, list_node* pdelete);
-    uint8_t* add_msg_type(uint8_t *optptr, uint8_t type);
-    uint8_t* add_offer_options(uint8_t *optptr);
-    uint8_t* add_end(uint8_t *optptr);
-    void create_msg(struct dhcps_msg *m);
-    void send_offer(struct dhcps_msg *m);
-    void send_nak(struct dhcps_msg *m);
-    void send_ack(struct dhcps_msg *m);
-    uint8_t parse_options(uint8_t *optptr, sint16_t len);
-    sint16_t parse_msg(struct dhcps_msg *m, u16_t len);
-    static void S_handle_dhcp(void *arg,
-                              struct udp_pcb *pcb,
-                              struct pbuf *p,
-                              const ip_addr_t *addr,
+    void node_insert_to_list(list_node** phead, list_node* pinsert);
+    void node_remove_from_list(list_node** phead, list_node* pdelete);
+    uint8_t* add_msg_type(uint8_t* optptr, uint8_t type);
+    uint8_t* add_offer_options(uint8_t* optptr);
+    uint8_t* add_end(uint8_t* optptr);
+    void create_msg(struct dhcps_msg* m);
+    void send_offer(struct dhcps_msg* m);
+    void send_nak(struct dhcps_msg* m);
+    void send_ack(struct dhcps_msg* m);
+    uint8_t parse_options(uint8_t* optptr, sint16_t len);
+    sint16_t parse_msg(struct dhcps_msg* m, u16_t len);
+    static void S_handle_dhcp(void* arg,
+                              struct udp_pcb* pcb,
+                              struct pbuf* p,
+                              const ip_addr_t* addr,
                               uint16_t port);
     void handle_dhcp(
-        struct udp_pcb *pcb,
-        struct pbuf *p,
-        const ip_addr_t *addr,
+        struct udp_pcb* pcb,
+        struct pbuf* p,
+        const ip_addr_t* addr,
         uint16_t port);
     void kill_oldest_dhcps_pool(void);
-    void dhcps_coarse_tmr(void); // CURRENTLY NOT CALLED
-    void dhcps_client_leave(u8 *bssid, struct ipv4_addr *ip, bool force);
-    uint32 dhcps_client_update(u8 *bssid, struct ipv4_addr *ip);
+    void dhcps_coarse_tmr(void);  // CURRENTLY NOT CALLED
+    void dhcps_client_leave(u8* bssid, struct ipv4_addr* ip, bool force);
+    uint32 dhcps_client_update(u8* bssid, struct ipv4_addr* ip);
 
     netif* _netif;
 
-    struct udp_pcb *pcb_dhcps;
+    struct udp_pcb* pcb_dhcps;
     ip_addr_t broadcast_dhcps;
     struct ipv4_addr server_address;
     struct ipv4_addr client_address;
@@ -110,7 +108,7 @@ class DhcpServer
     uint32 dhcps_lease_time;
 
     struct dhcps_lease dhcps_lease;
-    list_node *plist;
+    list_node* plist;
     uint8 offer;
     bool renew;
 
@@ -121,4 +119,4 @@ class DhcpServer
 extern DhcpServer dhcpSoftAP;
 extern "C" int fw_has_started_softap_dhcps;
 
-#endif // __DHCPS_H__
+#endif  // __DHCPS_H__
diff --git a/cores/esp8266/LwipIntf.cpp b/cores/esp8266/LwipIntf.cpp
index b4a4807b9a..e549270623 100644
--- a/cores/esp8266/LwipIntf.cpp
+++ b/cores/esp8266/LwipIntf.cpp
@@ -1,19 +1,20 @@
 
-extern "C" {
+extern "C"
+{
+#include "lwip/dhcp.h"
+#include "lwip/dns.h"
 #include "lwip/err.h"
+#include "lwip/init.h"  // LWIP_VERSION_
 #include "lwip/ip_addr.h"
-#include "lwip/dns.h"
-#include "lwip/dhcp.h"
-#include "lwip/init.h" // LWIP_VERSION_
 #if LWIP_IPV6
-#include "lwip/netif.h" // struct netif
+#include "lwip/netif.h"  // struct netif
 #endif
 
 #include <user_interface.h>
 }
 
-#include "debug.h"
 #include "LwipIntf.h"
+#include "debug.h"
 
 // args      | esp order    arduino order
 // ----      + ---------    -------------
@@ -24,8 +25,7 @@ extern "C" {
 //
 // result stored into gateway/netmask/dns1
 
-bool LwipIntf::ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3,
-                                IPAddress& gateway, IPAddress& netmask, IPAddress& dns1)
+bool LwipIntf::ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3, IPAddress& gateway, IPAddress& netmask, IPAddress& dns1)
 {
     //To allow compatibility, check first octet of 3rd arg. If 255, interpret as ESP order, otherwise Arduino order.
     gateway = arg1;
@@ -36,7 +36,7 @@ bool LwipIntf::ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1
     {
         //octet is not 255 => interpret as Arduino order
         gateway = arg2;
-        netmask = arg3[0] == 0 ? IPAddress(255, 255, 255, 0) : arg3; //arg order is arduino and 4th arg not given => assign it arduino default
+        netmask = arg3[0] == 0 ? IPAddress(255, 255, 255, 0) : arg3;  //arg order is arduino and 4th arg not given => assign it arduino default
         dns1 = arg1;
     }
 
@@ -143,7 +143,6 @@ bool LwipIntf::hostname(const char* aHostname)
     // harmless for AP, also compatible with ethernet adapters (to come)
     for (netif* intf = netif_list; intf; intf = intf->next)
     {
-
         // unconditionally update all known interfaces
         intf->hostname = wifi_station_get_hostname();
 
@@ -162,4 +161,3 @@ bool LwipIntf::hostname(const char* aHostname)
 
     return ret && compliant;
 }
-
diff --git a/cores/esp8266/LwipIntf.h b/cores/esp8266/LwipIntf.h
index d73c2d825a..5eef15305a 100644
--- a/cores/esp8266/LwipIntf.h
+++ b/cores/esp8266/LwipIntf.h
@@ -2,16 +2,15 @@
 #ifndef _LWIPINTF_H
 #define _LWIPINTF_H
 
-#include <lwip/netif.h>
 #include <IPAddress.h>
+#include <lwip/netif.h>
 
 #include <functional>
 
 class LwipIntf
 {
-public:
-
-    using CBType = std::function <void(netif*)>;
+   public:
+    using CBType = std::function<void(netif*)>;
 
     static bool stateUpCB(LwipIntf::CBType&& cb);
 
@@ -24,9 +23,7 @@ class LwipIntf
     // arg3     | dns1       netmask
     //
     // result stored into gateway/netmask/dns1
-    static
-    bool ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3,
-                          IPAddress& gateway, IPAddress& netmask, IPAddress& dns1);
+    static bool ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3, IPAddress& gateway, IPAddress& netmask, IPAddress& dns1);
 
     String hostname();
     bool hostname(const String& aHostname)
@@ -41,9 +38,8 @@ class LwipIntf
     }
     const char* getHostname();
 
-protected:
-
+   protected:
     static bool stateChangeSysCB(LwipIntf::CBType&& cb);
 };
 
-#endif // _LWIPINTF_H
+#endif  // _LWIPINTF_H
diff --git a/cores/esp8266/LwipIntfCB.cpp b/cores/esp8266/LwipIntfCB.cpp
index 1e495c5fd3..7271416300 100644
--- a/cores/esp8266/LwipIntfCB.cpp
+++ b/cores/esp8266/LwipIntfCB.cpp
@@ -6,7 +6,7 @@
 #define NETIF_STATUS_CB_SIZE 3
 
 static int netifStatusChangeListLength = 0;
-LwipIntf::CBType netifStatusChangeList [NETIF_STATUS_CB_SIZE];
+LwipIntf::CBType netifStatusChangeList[NETIF_STATUS_CB_SIZE];
 
 extern "C" void netif_status_changed(struct netif* netif)
 {
@@ -33,12 +33,10 @@ bool LwipIntf::stateChangeSysCB(LwipIntf::CBType&& cb)
 
 bool LwipIntf::stateUpCB(LwipIntf::CBType&& cb)
 {
-    return stateChangeSysCB([cb](netif * nif)
-    {
-        if (netif_is_up(nif))
-            schedule_function([cb, nif]()
-        {
-            cb(nif);
-        });
-    });
+    return stateChangeSysCB([cb](netif* nif)
+                            {
+                                if (netif_is_up(nif))
+                                    schedule_function([cb, nif]()
+                                                      { cb(nif); });
+                            });
 }
diff --git a/cores/esp8266/LwipIntfDev.h b/cores/esp8266/LwipIntfDev.h
index f8290d7cd6..82dd4e653f 100644
--- a/cores/esp8266/LwipIntfDev.h
+++ b/cores/esp8266/LwipIntfDev.h
@@ -6,19 +6,19 @@
 // remove all Serial.print
 // unchain pbufs
 
-#include <netif/ethernet.h>
-#include <lwip/init.h>
-#include <lwip/netif.h>
-#include <lwip/etharp.h>
+#include <lwip/apps/sntp.h>
 #include <lwip/dhcp.h>
 #include <lwip/dns.h>
-#include <lwip/apps/sntp.h>
+#include <lwip/etharp.h>
+#include <lwip/init.h>
+#include <lwip/netif.h>
+#include <netif/ethernet.h>
 
-#include <user_interface.h>	// wifi_get_macaddr()
+#include <user_interface.h>  // wifi_get_macaddr()
 
+#include "LwipIntf.h"
 #include "SPI.h"
 #include "Schedule.h"
-#include "LwipIntf.h"
 #include "wl_definitions.h"
 
 #ifndef DEFAULT_MTU
@@ -26,17 +26,15 @@
 #endif
 
 template <class RawDev>
-class LwipIntfDev: public LwipIntf, public RawDev
+class LwipIntfDev : public LwipIntf, public RawDev
 {
-
-public:
-
-    LwipIntfDev(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1):
-        RawDev(cs, spi, intr),
-        _mtu(DEFAULT_MTU),
-        _intrPin(intr),
-        _started(false),
-        _default(false)
+   public:
+    LwipIntfDev(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1)
+        : RawDev(cs, spi, intr),
+          _mtu(DEFAULT_MTU),
+          _intrPin(intr),
+          _started(false),
+          _default(false)
     {
         memset(&_netif, 0, sizeof(_netif));
     }
@@ -44,22 +42,22 @@ class LwipIntfDev: public LwipIntf, public RawDev
     boolean config(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3 = IPADDR_NONE, const IPAddress& dns2 = IPADDR_NONE);
 
     // default mac-address is inferred from esp8266's STA interface
-    boolean begin(const uint8_t *macAddress = nullptr, const uint16_t mtu = DEFAULT_MTU);
+    boolean begin(const uint8_t* macAddress = nullptr, const uint16_t mtu = DEFAULT_MTU);
 
     const netif* getNetIf() const
     {
         return &_netif;
     }
 
-    IPAddress    localIP() const
+    IPAddress localIP() const
     {
         return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.ip_addr)));
     }
-    IPAddress    subnetMask() const
+    IPAddress subnetMask() const
     {
         return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.netmask)));
     }
-    IPAddress    gatewayIP() const
+    IPAddress gatewayIP() const
     {
         return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.gw)));
     }
@@ -76,28 +74,26 @@ class LwipIntfDev: public LwipIntf, public RawDev
 
     wl_status_t status();
 
-protected:
-
+   protected:
     err_t netif_init();
-    void  netif_status_callback();
+    void netif_status_callback();
 
     static err_t netif_init_s(netif* netif);
-    static err_t linkoutput_s(netif *netif, struct pbuf *p);
-    static void  netif_status_callback_s(netif* netif);
+    static err_t linkoutput_s(netif* netif, struct pbuf* p);
+    static void netif_status_callback_s(netif* netif);
 
     // called on a regular basis or on interrupt
     err_t handlePackets();
 
     // members
 
-    netif       _netif;
-
-    uint16_t    _mtu;
-    int8_t      _intrPin;
-    uint8_t     _macAddress[6];
-    bool        _started;
-    bool        _default;
+    netif _netif;
 
+    uint16_t _mtu;
+    int8_t _intrPin;
+    uint8_t _macAddress[6];
+    bool _started;
+    bool _default;
 };
 
 template <class RawDev>
@@ -162,9 +158,9 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
         memset(_macAddress, 0, 6);
         _macAddress[0] = 0xEE;
 #endif
-        _macAddress[3] += _netif.num;   // alter base mac address
-        _macAddress[0] &= 0xfe;         // set as locally administered, unicast, per
-        _macAddress[0] |= 0x02;         // https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local
+        _macAddress[3] += _netif.num;  // alter base mac address
+        _macAddress[0] &= 0xfe;        // set as locally administered, unicast, per
+        _macAddress[0] |= 0x02;        // https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local
     }
 
     if (!RawDev::begin(_macAddress))
@@ -194,15 +190,15 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
     {
         switch (dhcp_start(&_netif))
         {
-        case ERR_OK:
-            break;
+            case ERR_OK:
+                break;
 
-        case ERR_IF:
-            return false;
+            case ERR_IF:
+                return false;
 
-        default:
-            netif_remove(&_netif);
-            return false;
+            default:
+                netif_remove(&_netif);
+                return false;
         }
     }
 
@@ -222,10 +218,11 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
     }
 
     if (_intrPin < 0 && !schedule_recurrent_function_us([&]()
-{
-    this->handlePackets();
-        return true;
-    }, 100))
+                                                        {
+                                                            this->handlePackets();
+                                                            return true;
+                                                        },
+                                                        100))
     {
         netif_remove(&_netif);
         return false;
@@ -241,7 +238,7 @@ wl_status_t LwipIntfDev<RawDev>::status()
 }
 
 template <class RawDev>
-err_t LwipIntfDev<RawDev>::linkoutput_s(netif *netif, struct pbuf *pbuf)
+err_t LwipIntfDev<RawDev>::linkoutput_s(netif* netif, struct pbuf* pbuf)
 {
     LwipIntfDev* ths = (LwipIntfDev*)netif->state;
 
@@ -255,7 +252,7 @@ err_t LwipIntfDev<RawDev>::linkoutput_s(netif *netif, struct pbuf *pbuf)
 #if PHY_HAS_CAPTURE
     if (phy_capture)
     {
-        phy_capture(ths->_netif.num, (const char*)pbuf->payload, pbuf->len, /*out*/1, /*success*/len == pbuf->len);
+        phy_capture(ths->_netif.num, (const char*)pbuf->payload, pbuf->len, /*out*/ 1, /*success*/ len == pbuf->len);
     }
 #endif
 
@@ -282,10 +279,7 @@ err_t LwipIntfDev<RawDev>::netif_init()
     _netif.mtu = _mtu;
     _netif.chksum_flags = NETIF_CHECKSUM_ENABLE_ALL;
     _netif.flags =
-        NETIF_FLAG_ETHARP
-        | NETIF_FLAG_IGMP
-        | NETIF_FLAG_BROADCAST
-        | NETIF_FLAG_LINK_UP;
+        NETIF_FLAG_ETHARP | NETIF_FLAG_IGMP | NETIF_FLAG_BROADCAST | NETIF_FLAG_LINK_UP;
 
     // lwIP's doc: This function typically first resolves the hardware
     // address, then sends the packet.  For ethernet physical layer, this is
@@ -328,7 +322,7 @@ err_t LwipIntfDev<RawDev>::handlePackets()
     while (1)
     {
         if (++pkt == 10)
-            // prevent starvation
+        // prevent starvation
         {
             return ERR_OK;
         }
@@ -374,7 +368,7 @@ err_t LwipIntfDev<RawDev>::handlePackets()
 #if PHY_HAS_CAPTURE
         if (phy_capture)
         {
-            phy_capture(_netif.num, (const char*)pbuf->payload, tot_len, /*out*/0, /*success*/err == ERR_OK);
+            phy_capture(_netif.num, (const char*)pbuf->payload, tot_len, /*out*/ 0, /*success*/ err == ERR_OK);
         }
 #endif
 
@@ -384,7 +378,6 @@ err_t LwipIntfDev<RawDev>::handlePackets()
             return err;
         }
         // (else) allocated pbuf is now lwIP's responsibility
-
     }
 }
 
@@ -398,4 +391,4 @@ void LwipIntfDev<RawDev>::setDefault()
     }
 }
 
-#endif // _LWIPINTFDEV_H
+#endif  // _LWIPINTFDEV_H
diff --git a/cores/esp8266/StreamSend.cpp b/cores/esp8266/StreamSend.cpp
index 693e340cff..d84a4bf961 100644
--- a/cores/esp8266/StreamSend.cpp
+++ b/cores/esp8266/StreamSend.cpp
@@ -19,7 +19,6 @@
     parsing functions based on TextFinder library by Michael Margolis
 */
 
-
 #include <Arduino.h>
 #include <StreamDev.h>
 
@@ -32,7 +31,7 @@ size_t Stream::sendGeneric(Print* to,
 
     if (len == 0)
     {
-        return 0;    // conveniently avoids timeout for no requested data
+        return 0;  // conveniently avoids timeout for no requested data
     }
 
     // There are two timeouts:
@@ -57,7 +56,6 @@ size_t Stream::sendGeneric(Print* to,
     return SendGenericRegular(to, len, timeoutMs);
 }
 
-
 size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int readUntilChar, const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
 {
     // "neverExpires (default, impossible)" is translated to default timeout
@@ -104,7 +102,7 @@ size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int rea
             {
                 peekConsume(w);
                 written += w;
-                timedOut.reset(); // something has been written
+                timedOut.reset();  // something has been written
             }
             if (foundChar)
             {
@@ -186,7 +184,7 @@ size_t Stream::SendGenericRegularUntil(Print* to, const ssize_t len, const int r
                 break;
             }
             written += 1;
-            timedOut.reset(); // something has been written
+            timedOut.reset();  // something has been written
         }
 
         if (timedOut)
@@ -243,7 +241,7 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
 
         size_t w = to->availableForWrite();
         if (w == 0 && !to->outputCanTimeout())
-            // no more data can be written, ever
+        // no more data can be written, ever
         {
             break;
         }
@@ -270,7 +268,7 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
                 setReport(Report::WriteError);
                 break;
             }
-            timedOut.reset(); // something has been written
+            timedOut.reset();  // something has been written
         }
 
         if (timedOut)
@@ -305,19 +303,19 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
     return written;
 }
 
-Stream& operator << (Stream& out, String& string)
+Stream& operator<<(Stream& out, String& string)
 {
     StreamConstPtr(string).sendAll(out);
     return out;
 }
 
-Stream& operator << (Stream& out, StreamString& stream)
+Stream& operator<<(Stream& out, StreamString& stream)
 {
     stream.sendAll(out);
     return out;
 }
 
-Stream& operator << (Stream& out, Stream& stream)
+Stream& operator<<(Stream& out, Stream& stream)
 {
     if (stream.streamRemaining() < 0)
     {
@@ -339,13 +337,13 @@ Stream& operator << (Stream& out, Stream& stream)
     return out;
 }
 
-Stream& operator << (Stream& out, const char* text)
+Stream& operator<<(Stream& out, const char* text)
 {
     StreamConstPtr(text, strlen_P(text)).sendAll(out);
     return out;
 }
 
-Stream& operator << (Stream& out, const __FlashStringHelper* text)
+Stream& operator<<(Stream& out, const __FlashStringHelper* text)
 {
     StreamConstPtr(text).sendAll(out);
     return out;
diff --git a/cores/esp8266/StreamString.h b/cores/esp8266/StreamString.h
index be11669a79..3f7f5dc89c 100644
--- a/cores/esp8266/StreamString.h
+++ b/cores/esp8266/StreamString.h
@@ -23,8 +23,8 @@
 #ifndef __STREAMSTRING_H
 #define __STREAMSTRING_H
 
-#include <limits>
 #include <algorithm>
+#include <limits>
 #include "Stream.h"
 #include "WString.h"
 
@@ -32,17 +32,16 @@
 // S2Stream points to a String and makes it a Stream
 // (it is also the helper for StreamString)
 
-class S2Stream: public Stream
+class S2Stream : public Stream
 {
-public:
-
-    S2Stream(String& string, int peekPointer = -1):
-        string(&string), peekPointer(peekPointer)
+   public:
+    S2Stream(String& string, int peekPointer = -1)
+        : string(&string), peekPointer(peekPointer)
     {
     }
 
-    S2Stream(String* string, int peekPointer = -1):
-        string(string), peekPointer(peekPointer)
+    S2Stream(String* string, int peekPointer = -1)
+        : string(string), peekPointer(peekPointer)
     {
     }
 
@@ -206,19 +205,16 @@ class S2Stream: public Stream
         peekPointer = pointer;
     }
 
-protected:
-
+   protected:
     String* string;
-    int peekPointer; // -1:String is consumed / >=0:resettable pointer
+    int peekPointer;  // -1:String is consumed / >=0:resettable pointer
 };
 
-
 // StreamString is a S2Stream holding the String
 
-class StreamString: public String, public S2Stream
+class StreamString : public String, public S2Stream
 {
-protected:
-
+   protected:
     void resetpp()
     {
         if (peekPointer > 0)
@@ -227,56 +223,69 @@ class StreamString: public String, public S2Stream
         }
     }
 
-public:
-
-    StreamString(StreamString&& bro): String(bro), S2Stream(this) { }
-    StreamString(const StreamString& bro): String(bro), S2Stream(this) { }
+   public:
+    StreamString(StreamString&& bro)
+        : String(bro), S2Stream(this) {}
+    StreamString(const StreamString& bro)
+        : String(bro), S2Stream(this) {}
 
     // duplicate String constructors and operator=:
 
-    StreamString(const char* text = nullptr): String(text), S2Stream(this) { }
-    StreamString(const String& string): String(string), S2Stream(this) { }
-    StreamString(const __FlashStringHelper *str): String(str), S2Stream(this) { }
-    StreamString(String&& string): String(string), S2Stream(this) { }
-
-    explicit StreamString(char c): String(c), S2Stream(this) { }
-    explicit StreamString(unsigned char c, unsigned char base = 10): String(c, base), S2Stream(this) { }
-    explicit StreamString(int i, unsigned char base = 10): String(i, base), S2Stream(this) { }
-    explicit StreamString(unsigned int i, unsigned char base = 10): String(i, base), S2Stream(this) { }
-    explicit StreamString(long l, unsigned char base = 10): String(l, base), S2Stream(this) { }
-    explicit StreamString(unsigned long l, unsigned char base = 10): String(l, base), S2Stream(this) { }
-    explicit StreamString(float f, unsigned char decimalPlaces = 2): String(f, decimalPlaces), S2Stream(this) { }
-    explicit StreamString(double d, unsigned char decimalPlaces = 2): String(d, decimalPlaces), S2Stream(this) { }
-
-    StreamString& operator= (const StreamString& rhs)
+    StreamString(const char* text = nullptr)
+        : String(text), S2Stream(this) {}
+    StreamString(const String& string)
+        : String(string), S2Stream(this) {}
+    StreamString(const __FlashStringHelper* str)
+        : String(str), S2Stream(this) {}
+    StreamString(String&& string)
+        : String(string), S2Stream(this) {}
+
+    explicit StreamString(char c)
+        : String(c), S2Stream(this) {}
+    explicit StreamString(unsigned char c, unsigned char base = 10)
+        : String(c, base), S2Stream(this) {}
+    explicit StreamString(int i, unsigned char base = 10)
+        : String(i, base), S2Stream(this) {}
+    explicit StreamString(unsigned int i, unsigned char base = 10)
+        : String(i, base), S2Stream(this) {}
+    explicit StreamString(long l, unsigned char base = 10)
+        : String(l, base), S2Stream(this) {}
+    explicit StreamString(unsigned long l, unsigned char base = 10)
+        : String(l, base), S2Stream(this) {}
+    explicit StreamString(float f, unsigned char decimalPlaces = 2)
+        : String(f, decimalPlaces), S2Stream(this) {}
+    explicit StreamString(double d, unsigned char decimalPlaces = 2)
+        : String(d, decimalPlaces), S2Stream(this) {}
+
+    StreamString& operator=(const StreamString& rhs)
     {
         String::operator=(rhs);
         resetpp();
         return *this;
     }
 
-    StreamString& operator= (const String& rhs)
+    StreamString& operator=(const String& rhs)
     {
         String::operator=(rhs);
         resetpp();
         return *this;
     }
 
-    StreamString& operator= (const char* cstr)
+    StreamString& operator=(const char* cstr)
     {
         String::operator=(cstr);
         resetpp();
         return *this;
     }
 
-    StreamString& operator= (const __FlashStringHelper* str)
+    StreamString& operator=(const __FlashStringHelper* str)
     {
         String::operator=(str);
         resetpp();
         return *this;
     }
 
-    StreamString& operator= (String&& rval)
+    StreamString& operator=(String&& rval)
     {
         String::operator=(rval);
         resetpp();
@@ -284,4 +293,4 @@ class StreamString: public String, public S2Stream
     }
 };
 
-#endif // __STREAMSTRING_H
+#endif  // __STREAMSTRING_H
diff --git a/cores/esp8266/core_esp8266_si2c.cpp b/cores/esp8266/core_esp8266_si2c.cpp
index e01dffe080..28b6f99f40 100644
--- a/cores/esp8266/core_esp8266_si2c.cpp
+++ b/cores/esp8266/core_esp8266_si2c.cpp
@@ -19,16 +19,15 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     Modified January 2017 by Bjorn Hammarberg (bjoham@esp8266.com) - i2c slave support
 */
-#include "twi.h"
+#include "PolledTimeout.h"
 #include "pins_arduino.h"
+#include "twi.h"
 #include "wiring_private.h"
-#include "PolledTimeout.h"
-
 
-
-extern "C" {
-#include "twi_util.h"
+extern "C"
+{
 #include "ets_sys.h"
+#include "twi_util.h"
 };
 
 // Inline helpers
@@ -57,11 +56,10 @@ static inline __attribute__((always_inline)) bool SCL_READ(const int twi_scl)
     return (GPI & (1 << twi_scl)) != 0;
 }
 
-
 // Implement as a class to reduce code size by allowing access to many global variables with a single base pointer
 class Twi
 {
-private:
+   private:
     unsigned int preferred_si2c_clock = 100000;
     uint32_t twi_dcount = 18;
     unsigned char twi_sda = 0;
@@ -73,8 +71,26 @@ class Twi
     // issues about RmW on packed bytes.  The int-wide variations of asm instructions are smaller than the equivalent
     // byte-wide ones, and since these emums are used everywhere, the difference adds up fast.  There is only a single
     // instance of the class, though, so the extra 12 bytes of RAM used here saves a lot more IRAM.
-    volatile enum { TWIPM_UNKNOWN = 0, TWIPM_IDLE, TWIPM_ADDRESSED, TWIPM_WAIT} twip_mode = TWIPM_IDLE;
-    volatile enum { TWIP_UNKNOWN = 0, TWIP_IDLE, TWIP_START, TWIP_SEND_ACK, TWIP_WAIT_ACK, TWIP_WAIT_STOP, TWIP_SLA_W, TWIP_SLA_R, TWIP_REP_START, TWIP_READ, TWIP_STOP, TWIP_REC_ACK, TWIP_READ_ACK, TWIP_RWAIT_ACK, TWIP_WRITE, TWIP_BUS_ERR } twip_state = TWIP_IDLE;
+    volatile enum { TWIPM_UNKNOWN = 0,
+                    TWIPM_IDLE,
+                    TWIPM_ADDRESSED,
+                    TWIPM_WAIT } twip_mode = TWIPM_IDLE;
+    volatile enum { TWIP_UNKNOWN = 0,
+                    TWIP_IDLE,
+                    TWIP_START,
+                    TWIP_SEND_ACK,
+                    TWIP_WAIT_ACK,
+                    TWIP_WAIT_STOP,
+                    TWIP_SLA_W,
+                    TWIP_SLA_R,
+                    TWIP_REP_START,
+                    TWIP_READ,
+                    TWIP_STOP,
+                    TWIP_REC_ACK,
+                    TWIP_READ_ACK,
+                    TWIP_RWAIT_ACK,
+                    TWIP_WRITE,
+                    TWIP_BUS_ERR } twip_state = TWIP_IDLE;
     volatile int twip_status = TW_NO_INFO;
     volatile int bitCount = 0;
 
@@ -83,7 +99,11 @@ class Twi
     volatile int twi_ack_rec = 0;
     volatile int twi_timeout_ms = 10;
 
-    volatile enum { TWI_READY = 0, TWI_MRX, TWI_MTX, TWI_SRX, TWI_STX } twi_state = TWI_READY;
+    volatile enum { TWI_READY = 0,
+                    TWI_MRX,
+                    TWI_MTX,
+                    TWI_SRX,
+                    TWI_STX } twi_state = TWI_READY;
     volatile uint8_t twi_error = 0xFF;
 
     uint8_t twi_txBuffer[TWI_BUFFER_LENGTH];
@@ -97,16 +117,25 @@ class Twi
     void (*twi_onSlaveReceive)(uint8_t*, size_t);
 
     // ETS queue/timer interfaces
-    enum { EVENTTASK_QUEUE_SIZE = 1, EVENTTASK_QUEUE_PRIO = 2 };
-    enum { TWI_SIG_RANGE = 0x00000100, TWI_SIG_RX = 0x00000101, TWI_SIG_TX = 0x00000102 };
+    enum
+    {
+        EVENTTASK_QUEUE_SIZE = 1,
+        EVENTTASK_QUEUE_PRIO = 2
+    };
+    enum
+    {
+        TWI_SIG_RANGE = 0x00000100,
+        TWI_SIG_RX = 0x00000101,
+        TWI_SIG_TX = 0x00000102
+    };
     ETSEvent eventTaskQueue[EVENTTASK_QUEUE_SIZE];
     ETSTimer timer;
 
     // Event/IRQ callbacks, so they can't use "this" and need to be static
     static void IRAM_ATTR onSclChange(void);
     static void IRAM_ATTR onSdaChange(void);
-    static void eventTask(ETSEvent *e);
-    static void IRAM_ATTR onTimer(void *unused);
+    static void eventTask(ETSEvent* e);
+    static void IRAM_ATTR onTimer(void* unused);
 
     // Allow not linking in the slave code if there is no call to setAddress
     bool _slaveEnabled = false;
@@ -126,9 +155,9 @@ class Twi
     {
         esp8266::polledTimeout::oneShotFastUs timeout(twi_clockStretchLimit);
         esp8266::polledTimeout::periodicFastUs yieldTimeout(5000);
-        while (!timeout && !SCL_READ(twi_scl)) // outer loop is stretch duration up to stretch limit
+        while (!timeout && !SCL_READ(twi_scl))  // outer loop is stretch duration up to stretch limit
         {
-            if (yieldTimeout)   // inner loop yields every 5ms
+            if (yieldTimeout)  // inner loop yields every 5ms
             {
                 yield();
             }
@@ -138,12 +167,12 @@ class Twi
     // Generate a clock "valley" (at the end of a segment, just before a repeated start)
     void twi_scl_valley(void);
 
-public:
+   public:
     void setClock(unsigned int freq);
     void setClockStretchLimit(uint32_t limit);
     void init(unsigned char sda, unsigned char scl);
     void setAddress(uint8_t address);
-    unsigned char writeTo(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop);
+    unsigned char writeTo(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop);
     unsigned char readFrom(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop);
     uint8_t status();
     uint8_t transmit(const uint8_t* data, uint8_t length);
@@ -175,8 +204,8 @@ void Twi::setClock(unsigned int freq)
     {
         freq = 400000;
     }
-    twi_dcount = (500000000 / freq);  // half-cycle period in ns
-    twi_dcount = (1000 * (twi_dcount - 1120)) / 62500; // (half cycle - overhead) / busywait loop time
+    twi_dcount = (500000000 / freq);                    // half-cycle period in ns
+    twi_dcount = (1000 * (twi_dcount - 1120)) / 62500;  // (half cycle - overhead) / busywait loop time
 
 #else
 
@@ -184,8 +213,8 @@ void Twi::setClock(unsigned int freq)
     {
         freq = 800000;
     }
-    twi_dcount = (500000000 / freq);  // half-cycle period in ns
-    twi_dcount = (1000 * (twi_dcount - 560)) / 31250; // (half cycle - overhead) / busywait loop time
+    twi_dcount = (500000000 / freq);                   // half-cycle period in ns
+    twi_dcount = (1000 * (twi_dcount - 560)) / 31250;  // (half cycle - overhead) / busywait loop time
 
 #endif
 }
@@ -195,8 +224,6 @@ void Twi::setClockStretchLimit(uint32_t limit)
     twi_clockStretchLimit = limit;
 }
 
-
-
 void Twi::init(unsigned char sda, unsigned char scl)
 {
     // set timer function
@@ -210,7 +237,7 @@ void Twi::init(unsigned char sda, unsigned char scl)
     pinMode(twi_sda, INPUT_PULLUP);
     pinMode(twi_scl, INPUT_PULLUP);
     twi_setClock(preferred_si2c_clock);
-    twi_setClockStretchLimit(150000L); // default value is 150 mS
+    twi_setClockStretchLimit(150000L);  // default value is 150 mS
 }
 
 void Twi::setAddress(uint8_t address)
@@ -234,7 +261,7 @@ void IRAM_ATTR Twi::busywait(unsigned int v)
     unsigned int i;
     for (i = 0; i < v; i++)  // loop time is 5 machine cycles: 31.25ns @ 160MHz, 62.5ns @ 80MHz
     {
-        __asm__ __volatile__("nop"); // minimum element to keep GCC from optimizing this function out.
+        __asm__ __volatile__("nop");  // minimum element to keep GCC from optimizing this function out.
     }
 }
 
@@ -308,7 +335,7 @@ bool Twi::write_byte(unsigned char byte)
         write_bit(byte & 0x80);
         byte <<= 1;
     }
-    return !read_bit();//NACK/ACK
+    return !read_bit();  //NACK/ACK
 }
 
 unsigned char Twi::read_byte(bool nack)
@@ -323,7 +350,7 @@ unsigned char Twi::read_byte(bool nack)
     return byte;
 }
 
-unsigned char Twi::writeTo(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop)
+unsigned char Twi::writeTo(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop)
 {
     unsigned int i;
     if (!write_start())
@@ -336,7 +363,7 @@ unsigned char Twi::writeTo(unsigned char address, unsigned char * buf, unsigned
         {
             write_stop();
         }
-        return 2; //received NACK on transmit of address
+        return 2;  //received NACK on transmit of address
     }
     for (i = 0; i < len; i++)
     {
@@ -346,7 +373,7 @@ unsigned char Twi::writeTo(unsigned char address, unsigned char * buf, unsigned
             {
                 write_stop();
             }
-            return 3;//received NACK on transmit of data
+            return 3;  //received NACK on transmit of data
         }
     }
     if (sendStop)
@@ -381,7 +408,7 @@ unsigned char Twi::readFrom(unsigned char address, unsigned char* buf, unsigned
         {
             write_stop();
         }
-        return 2;//received NACK on transmit of address
+        return 2;  //received NACK on transmit of address
     }
     for (i = 0; i < (len - 1); i++)
     {
@@ -424,12 +451,12 @@ uint8_t Twi::status()
     }
 
     int clockCount = 20;
-    while (!SDA_READ(twi_sda) && clockCount-- > 0)   // if SDA low, read the bits slaves have to sent to a max
+    while (!SDA_READ(twi_sda) && clockCount-- > 0)  // if SDA low, read the bits slaves have to sent to a max
     {
         read_bit();
         if (!SCL_READ(twi_scl))
         {
-            return I2C_SCL_HELD_LOW_AFTER_READ; // I2C bus error. SCL held low beyond slave clock stretch time
+            return I2C_SCL_HELD_LOW_AFTER_READ;  // I2C bus error. SCL held low beyond slave clock stretch time
         }
     }
     if (!SDA_READ(twi_sda))
@@ -485,139 +512,137 @@ void IRAM_ATTR Twi::reply(uint8_t ack)
     if (ack)
     {
         //TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT) | _BV(TWEA);
-        SCL_HIGH(twi.twi_scl);      // _BV(TWINT)
-        twi_ack = 1;    // _BV(TWEA)
+        SCL_HIGH(twi.twi_scl);  // _BV(TWINT)
+        twi_ack = 1;            // _BV(TWEA)
     }
     else
     {
         //TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT);
-        SCL_HIGH(twi.twi_scl);      // _BV(TWINT)
-        twi_ack = 0;    // ~_BV(TWEA)
+        SCL_HIGH(twi.twi_scl);  // _BV(TWINT)
+        twi_ack = 0;            // ~_BV(TWEA)
     }
 }
 
-
 void IRAM_ATTR Twi::releaseBus(void)
 {
     // release bus
     //TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT);
-    SCL_HIGH(twi.twi_scl);      // _BV(TWINT)
-    twi_ack = 1;    // _BV(TWEA)
+    SCL_HIGH(twi.twi_scl);  // _BV(TWINT)
+    twi_ack = 1;            // _BV(TWEA)
     SDA_HIGH(twi.twi_sda);
 
     // update twi state
     twi_state = TWI_READY;
 }
 
-
 void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
 {
     twip_status = status;
     switch (status)
     {
-    // Slave Receiver
-    case TW_SR_SLA_ACK:   // addressed, returned ack
-    case TW_SR_GCALL_ACK: // addressed generally, returned ack
-    case TW_SR_ARB_LOST_SLA_ACK:   // lost arbitration, returned ack
-    case TW_SR_ARB_LOST_GCALL_ACK: // lost arbitration, returned ack
-        // enter slave receiver mode
-        twi_state = TWI_SRX;
-        // indicate that rx buffer can be overwritten and ack
-        twi_rxBufferIndex = 0;
-        reply(1);
-        break;
-    case TW_SR_DATA_ACK:       // data received, returned ack
-    case TW_SR_GCALL_DATA_ACK: // data received generally, returned ack
-        // if there is still room in the rx buffer
-        if (twi_rxBufferIndex < TWI_BUFFER_LENGTH)
-        {
-            // put byte in buffer and ack
-            twi_rxBuffer[twi_rxBufferIndex++] = twi_data;
+        // Slave Receiver
+        case TW_SR_SLA_ACK:             // addressed, returned ack
+        case TW_SR_GCALL_ACK:           // addressed generally, returned ack
+        case TW_SR_ARB_LOST_SLA_ACK:    // lost arbitration, returned ack
+        case TW_SR_ARB_LOST_GCALL_ACK:  // lost arbitration, returned ack
+            // enter slave receiver mode
+            twi_state = TWI_SRX;
+            // indicate that rx buffer can be overwritten and ack
+            twi_rxBufferIndex = 0;
             reply(1);
-        }
-        else
-        {
-            // otherwise nack
-            reply(0);
-        }
-        break;
-    case TW_SR_STOP: // stop or repeated start condition received
-        // put a null char after data if there's room
-        if (twi_rxBufferIndex < TWI_BUFFER_LENGTH)
-        {
-            twi_rxBuffer[twi_rxBufferIndex] = '\0';
-        }
-        // callback to user-defined callback over event task to allow for non-RAM-residing code
-        //twi_rxBufferLock = true; // This may be necessary
-        ets_post(EVENTTASK_QUEUE_PRIO, TWI_SIG_RX, twi_rxBufferIndex);
-
-        // since we submit rx buffer to "wire" library, we can reset it
-        twi_rxBufferIndex = 0;
-        break;
-
-    case TW_SR_DATA_NACK:       // data received, returned nack
-    case TW_SR_GCALL_DATA_NACK: // data received generally, returned nack
-        // nack back at master
-        reply(0);
-        break;
-
-    // Slave Transmitter
-    case TW_ST_SLA_ACK:          // addressed, returned ack
-    case TW_ST_ARB_LOST_SLA_ACK: // arbitration lost, returned ack
-        // enter slave transmitter mode
-        twi_state = TWI_STX;
-        // ready the tx buffer index for iteration
-        twi_txBufferIndex = 0;
-        // set tx buffer length to be zero, to verify if user changes it
-        twi_txBufferLength = 0;
-        // callback to user-defined callback over event task to allow for non-RAM-residing code
-        // request for txBuffer to be filled and length to be set
-        // note: user must call twi_transmit(bytes, length) to do this
-        ets_post(EVENTTASK_QUEUE_PRIO, TWI_SIG_TX, 0);
-        break;
-
-    case TW_ST_DATA_ACK: // byte sent, ack returned
-        // copy data to output register
-        twi_data = twi_txBuffer[twi_txBufferIndex++];
-
-        bitCount = 8;
-        bitCount--;
-        if (twi_data & 0x80)
-        {
-            SDA_HIGH(twi.twi_sda);
-        }
-        else
-        {
-            SDA_LOW(twi.twi_sda);
-        }
-        twi_data <<= 1;
+            break;
+        case TW_SR_DATA_ACK:        // data received, returned ack
+        case TW_SR_GCALL_DATA_ACK:  // data received generally, returned ack
+            // if there is still room in the rx buffer
+            if (twi_rxBufferIndex < TWI_BUFFER_LENGTH)
+            {
+                // put byte in buffer and ack
+                twi_rxBuffer[twi_rxBufferIndex++] = twi_data;
+                reply(1);
+            }
+            else
+            {
+                // otherwise nack
+                reply(0);
+            }
+            break;
+        case TW_SR_STOP:  // stop or repeated start condition received
+            // put a null char after data if there's room
+            if (twi_rxBufferIndex < TWI_BUFFER_LENGTH)
+            {
+                twi_rxBuffer[twi_rxBufferIndex] = '\0';
+            }
+            // callback to user-defined callback over event task to allow for non-RAM-residing code
+            //twi_rxBufferLock = true; // This may be necessary
+            ets_post(EVENTTASK_QUEUE_PRIO, TWI_SIG_RX, twi_rxBufferIndex);
 
-        // if there is more to send, ack, otherwise nack
-        if (twi_txBufferIndex < twi_txBufferLength)
-        {
-            reply(1);
-        }
-        else
-        {
+            // since we submit rx buffer to "wire" library, we can reset it
+            twi_rxBufferIndex = 0;
+            break;
+
+        case TW_SR_DATA_NACK:        // data received, returned nack
+        case TW_SR_GCALL_DATA_NACK:  // data received generally, returned nack
+            // nack back at master
             reply(0);
-        }
-        break;
-    case TW_ST_DATA_NACK: // received nack, we are done
-    case TW_ST_LAST_DATA: // received ack, but we are done already!
-        // leave slave receiver state
-        releaseBus();
-        break;
-
-    // All
-    case TW_NO_INFO:   // no state information
-        break;
-    case TW_BUS_ERROR: // bus error, illegal stop/start
-        twi_error = TW_BUS_ERROR;
-        break;
+            break;
+
+        // Slave Transmitter
+        case TW_ST_SLA_ACK:           // addressed, returned ack
+        case TW_ST_ARB_LOST_SLA_ACK:  // arbitration lost, returned ack
+            // enter slave transmitter mode
+            twi_state = TWI_STX;
+            // ready the tx buffer index for iteration
+            twi_txBufferIndex = 0;
+            // set tx buffer length to be zero, to verify if user changes it
+            twi_txBufferLength = 0;
+            // callback to user-defined callback over event task to allow for non-RAM-residing code
+            // request for txBuffer to be filled and length to be set
+            // note: user must call twi_transmit(bytes, length) to do this
+            ets_post(EVENTTASK_QUEUE_PRIO, TWI_SIG_TX, 0);
+            break;
+
+        case TW_ST_DATA_ACK:  // byte sent, ack returned
+            // copy data to output register
+            twi_data = twi_txBuffer[twi_txBufferIndex++];
+
+            bitCount = 8;
+            bitCount--;
+            if (twi_data & 0x80)
+            {
+                SDA_HIGH(twi.twi_sda);
+            }
+            else
+            {
+                SDA_LOW(twi.twi_sda);
+            }
+            twi_data <<= 1;
+
+            // if there is more to send, ack, otherwise nack
+            if (twi_txBufferIndex < twi_txBufferLength)
+            {
+                reply(1);
+            }
+            else
+            {
+                reply(0);
+            }
+            break;
+        case TW_ST_DATA_NACK:  // received nack, we are done
+        case TW_ST_LAST_DATA:  // received ack, but we are done already!
+            // leave slave receiver state
+            releaseBus();
+            break;
+
+        // All
+        case TW_NO_INFO:  // no state information
+            break;
+        case TW_BUS_ERROR:  // bus error, illegal stop/start
+            twi_error = TW_BUS_ERROR;
+            break;
     }
 }
 
-void IRAM_ATTR Twi::onTimer(void *unused)
+void IRAM_ATTR Twi::onTimer(void* unused)
 {
     (void)unused;
     twi.releaseBus();
@@ -626,9 +651,8 @@ void IRAM_ATTR Twi::onTimer(void *unused)
     twi.twip_state = TWIP_BUS_ERR;
 }
 
-void Twi::eventTask(ETSEvent *e)
+void Twi::eventTask(ETSEvent* e)
 {
-
     if (e == NULL)
     {
         return;
@@ -636,26 +660,26 @@ void Twi::eventTask(ETSEvent *e)
 
     switch (e->sig)
     {
-    case TWI_SIG_TX:
-        twi.twi_onSlaveTransmit();
+        case TWI_SIG_TX:
+            twi.twi_onSlaveTransmit();
 
-        // if they didn't change buffer & length, initialize it
-        if (twi.twi_txBufferLength == 0)
-        {
-            twi.twi_txBufferLength = 1;
-            twi.twi_txBuffer[0] = 0x00;
-        }
+            // if they didn't change buffer & length, initialize it
+            if (twi.twi_txBufferLength == 0)
+            {
+                twi.twi_txBufferLength = 1;
+                twi.twi_txBuffer[0] = 0x00;
+            }
 
-        // Initiate transmission
-        twi.onTwipEvent(TW_ST_DATA_ACK);
+            // Initiate transmission
+            twi.onTwipEvent(TW_ST_DATA_ACK);
 
-        break;
+            break;
 
-    case TWI_SIG_RX:
-        // ack future responses and leave slave receiver state
-        twi.releaseBus();
-        twi.twi_onSlaveReceive(twi.twi_rxBuffer, e->par);
-        break;
+        case TWI_SIG_RX:
+            // ack future responses and leave slave receiver state
+            twi.releaseBus();
+            twi.twi_onSlaveReceive(twi.twi_rxBuffer, e->par);
+            break;
     }
 }
 
@@ -663,7 +687,7 @@ void Twi::eventTask(ETSEvent *e)
 // compared to the logical-or of all states with the same branch.  This removes the need
 // for a large series of straight-line compares.  The biggest win is when multiple states
 // all have the same branch (onSdaChange), but for others there is some benefit, still.
-#define S2M(x) (1<<(x))
+#define S2M(x) (1 << (x))
 // Shorthand for if the state is any of the or'd bitmask x
 #define IFSTATE(x) if (twip_state_mask & (x))
 
@@ -677,7 +701,7 @@ void IRAM_ATTR Twi::onSclChange(void)
     sda = SDA_READ(twi.twi_sda);
     scl = SCL_READ(twi.twi_scl);
 
-    twi.twip_status = 0xF8;     // reset TWI status
+    twi.twip_status = 0xF8;  // reset TWI status
 
     int twip_state_mask = S2M(twi.twip_state);
     IFSTATE(S2M(TWIP_START) | S2M(TWIP_REP_START) | S2M(TWIP_SLA_W) | S2M(TWIP_READ))
@@ -752,7 +776,7 @@ void IRAM_ATTR Twi::onSclChange(void)
                 }
                 else
                 {
-                    SCL_LOW(twi.twi_scl);   // clock stretching
+                    SCL_LOW(twi.twi_scl);  // clock stretching
                     SDA_HIGH(twi.twi_sda);
                     twi.twip_mode = TWIPM_ADDRESSED;
                     if (!(twi.twi_data & 0x01))
@@ -770,7 +794,7 @@ void IRAM_ATTR Twi::onSclChange(void)
             }
             else
             {
-                SCL_LOW(twi.twi_scl);   // clock stretching
+                SCL_LOW(twi.twi_scl);  // clock stretching
                 SDA_HIGH(twi.twi_sda);
                 if (!twi.twi_ack)
                 {
@@ -848,7 +872,7 @@ void IRAM_ATTR Twi::onSclChange(void)
         }
         else
         {
-            SCL_LOW(twi.twi_scl);   // clock stretching
+            SCL_LOW(twi.twi_scl);  // clock stretching
             if (twi.twi_ack && twi.twi_ack_rec)
             {
                 twi.onTwipEvent(TW_ST_DATA_ACK);
@@ -875,7 +899,7 @@ void IRAM_ATTR Twi::onSdaChange(void)
     scl = SCL_READ(twi.twi_scl);
 
     int twip_state_mask = S2M(twi.twip_state);
-    if (scl)   /* !DATA */
+    if (scl) /* !DATA */
     {
         IFSTATE(S2M(TWIP_IDLE))
         {
@@ -888,13 +912,13 @@ void IRAM_ATTR Twi::onSdaChange(void)
                 // START
                 twi.bitCount = 8;
                 twi.twip_state = TWIP_START;
-                ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true); // Once, ms
+                ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true);  // Once, ms
             }
         }
         else IFSTATE(S2M(TWIP_START) | S2M(TWIP_REP_START) | S2M(TWIP_SEND_ACK) | S2M(TWIP_WAIT_ACK) | S2M(TWIP_SLA_R) | S2M(TWIP_REC_ACK) | S2M(TWIP_READ_ACK) | S2M(TWIP_RWAIT_ACK) | S2M(TWIP_WRITE))
         {
             // START or STOP
-            SDA_HIGH(twi.twi_sda);   // Should not be necessary
+            SDA_HIGH(twi.twi_sda);  // Should not be necessary
             twi.onTwipEvent(TW_BUS_ERROR);
             twi.twip_mode = TWIPM_WAIT;
             twi.twip_state = TWIP_BUS_ERR;
@@ -904,7 +928,7 @@ void IRAM_ATTR Twi::onSdaChange(void)
             if (sda)
             {
                 // STOP
-                SCL_LOW(twi.twi_scl);   // generates a low SCL pulse after STOP
+                SCL_LOW(twi.twi_scl);  // generates a low SCL pulse after STOP
                 ets_timer_disarm(&twi.timer);
                 twi.twip_state = TWIP_IDLE;
                 twi.twip_mode = TWIPM_IDLE;
@@ -921,7 +945,7 @@ void IRAM_ATTR Twi::onSdaChange(void)
                 {
                     twi.bitCount = 8;
                     twi.twip_state = TWIP_REP_START;
-                    ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true); // Once, ms
+                    ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true);  // Once, ms
                 }
             }
         }
@@ -938,7 +962,7 @@ void IRAM_ATTR Twi::onSdaChange(void)
             else
             {
                 // during first bit in byte transfer - ok
-                SCL_LOW(twi.twi_scl);   // clock stretching
+                SCL_LOW(twi.twi_scl);  // clock stretching
                 twi.onTwipEvent(TW_SR_STOP);
                 if (sda)
                 {
@@ -951,7 +975,7 @@ void IRAM_ATTR Twi::onSdaChange(void)
                 {
                     // START
                     twi.bitCount = 8;
-                    ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true); // Once, ms
+                    ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true);  // Once, ms
                     twi.twip_state = TWIP_REP_START;
                     twi.twip_mode = TWIPM_IDLE;
                 }
@@ -961,8 +985,8 @@ void IRAM_ATTR Twi::onSdaChange(void)
 }
 
 // C wrappers for the object, since API is exposed only as C
-extern "C" {
-
+extern "C"
+{
     void twi_init(unsigned char sda, unsigned char scl)
     {
         return twi.init(sda, scl);
@@ -983,12 +1007,12 @@ extern "C" {
         twi.setClockStretchLimit(limit);
     }
 
-    uint8_t twi_writeTo(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop)
+    uint8_t twi_writeTo(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop)
     {
         return twi.writeTo(address, buf, len, sendStop);
     }
 
-    uint8_t twi_readFrom(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop)
+    uint8_t twi_readFrom(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop)
     {
         return twi.readFrom(address, buf, len, sendStop);
     }
@@ -998,7 +1022,7 @@ extern "C" {
         return twi.status();
     }
 
-    uint8_t twi_transmit(const uint8_t * buf, uint8_t len)
+    uint8_t twi_transmit(const uint8_t* buf, uint8_t len)
     {
         return twi.transmit(buf, len);
     }
@@ -1027,5 +1051,4 @@ extern "C" {
     {
         twi.enableSlave();
     }
-
 };
diff --git a/cores/esp8266/debug.cpp b/cores/esp8266/debug.cpp
index 06af1e424b..7173c29ab7 100644
--- a/cores/esp8266/debug.cpp
+++ b/cores/esp8266/debug.cpp
@@ -18,8 +18,8 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#include "Arduino.h"
 #include "debug.h"
+#include "Arduino.h"
 #include "osapi.h"
 
 #ifdef DEBUG_ESP_CORE
@@ -30,7 +30,7 @@ void __iamslow(const char* what)
 #endif
 
 IRAM_ATTR
-void hexdump(const void *mem, uint32_t len, uint8_t cols)
+void hexdump(const void* mem, uint32_t len, uint8_t cols)
 {
     const char* src = (const char*)mem;
     os_printf("\n[HEXDUMP] Address: %p len: 0x%X (%d)", src, len, len);
diff --git a/cores/esp8266/debug.h b/cores/esp8266/debug.h
index 263d3e9149..025687a5af 100644
--- a/cores/esp8266/debug.h
+++ b/cores/esp8266/debug.h
@@ -5,44 +5,54 @@
 #include <stdint.h>
 
 #ifdef DEBUG_ESP_CORE
-#define DEBUGV(fmt, ...) ::printf((PGM_P)PSTR(fmt), ## __VA_ARGS__)
+#define DEBUGV(fmt, ...) ::printf((PGM_P)PSTR(fmt), ##__VA_ARGS__)
 #endif
 
 #ifndef DEBUGV
-#define DEBUGV(...) do { (void)0; } while (0)
+#define DEBUGV(...) \
+    do              \
+    {               \
+        (void)0;    \
+    } while (0)
 #endif
 
 #ifdef __cplusplus
-extern "C" void hexdump(const void *mem, uint32_t len, uint8_t cols = 16);
+extern "C" void hexdump(const void* mem, uint32_t len, uint8_t cols = 16);
 #else
-void hexdump(const void *mem, uint32_t len, uint8_t cols);
+void hexdump(const void* mem, uint32_t len, uint8_t cols);
 #endif
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
-void __unhandled_exception(const char *str) __attribute__((noreturn));
-void __panic_func(const char* file, int line, const char* func) __attribute__((noreturn));
+    void __unhandled_exception(const char* str) __attribute__((noreturn));
+    void __panic_func(const char* file, int line, const char* func) __attribute__((noreturn));
 #define panic() __panic_func(PSTR(__FILE__), __LINE__, __func__)
 
 #ifdef DEBUG_ESP_CORE
-extern void __iamslow(const char* what);
-#define IAMSLOW() \
-    do { \
-        static bool once = false; \
-        if (!once) { \
-            once = true; \
+    extern void __iamslow(const char* what);
+#define IAMSLOW()                                  \
+    do                                             \
+    {                                              \
+        static bool once = false;                  \
+        if (!once)                                 \
+        {                                          \
+            once = true;                           \
             __iamslow((PGM_P)FPSTR(__FUNCTION__)); \
-        } \
+        }                                          \
     } while (0)
 #else
-#define IAMSLOW() do { (void)0; } while (0)
+#define IAMSLOW() \
+    do            \
+    {             \
+        (void)0;  \
+    } while (0)
 #endif
 
 #ifdef __cplusplus
 }
 #endif
 
-
-#endif//ARD_DEBUG_H
+#endif  //ARD_DEBUG_H
diff --git a/libraries/ESP8266mDNS/src/ESP8266mDNS.cpp b/libraries/ESP8266mDNS/src/ESP8266mDNS.cpp
index b5d7aac277..821b7010af 100644
--- a/libraries/ESP8266mDNS/src/ESP8266mDNS.cpp
+++ b/libraries/ESP8266mDNS/src/ESP8266mDNS.cpp
@@ -30,4 +30,3 @@
 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_MDNS)
 MDNSResponder MDNS;
 #endif
-
diff --git a/libraries/ESP8266mDNS/src/ESP8266mDNS.h b/libraries/ESP8266mDNS/src/ESP8266mDNS.h
index 8b035a7986..3b6ccc6449 100644
--- a/libraries/ESP8266mDNS/src/ESP8266mDNS.h
+++ b/libraries/ESP8266mDNS/src/ESP8266mDNS.h
@@ -41,13 +41,13 @@
 #ifndef __ESP8266MDNS_H
 #define __ESP8266MDNS_H
 
-#include "LEAmDNS.h"            // LEA
+#include "LEAmDNS.h"  // LEA
 
 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_MDNS)
 // Maps the implementation to use to the global namespace type
-using MDNSResponder = esp8266::MDNSImplementation::MDNSResponder;                // LEA
+using MDNSResponder = esp8266::MDNSImplementation::MDNSResponder;  // LEA
 
 extern MDNSResponder MDNS;
 #endif
 
-#endif // __ESP8266MDNS_H
+#endif  // __ESP8266MDNS_H
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.cpp b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
index 4908a67e06..c6ed0fe997 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
@@ -22,24 +22,22 @@
 
 */
 
-#include <Schedule.h>
 #include <AddrList.h>
+#include <Schedule.h>
 
-#include "ESP8266mDNS.h"
-#include "LEAmDNS_Priv.h"
-#include <LwipIntf.h> // LwipIntf::stateUpCB()
+#include <LwipIntf.h>  // LwipIntf::stateUpCB()
 #include <lwip/igmp.h>
 #include <lwip/prot/dns.h>
+#include "ESP8266mDNS.h"
+#include "LEAmDNS_Priv.h"
 
 namespace esp8266
 {
-
 /*
     LEAmDNS
 */
 namespace MDNSImplementation
 {
-
 /**
     STRINGIZE
 */
@@ -50,7 +48,6 @@ namespace MDNSImplementation
 #define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
 #endif
 
-
 /**
     INTERFACE
 */
@@ -59,11 +56,11 @@ namespace MDNSImplementation
     MDNSResponder::MDNSResponder
 */
 MDNSResponder::MDNSResponder(void)
-    :   m_pServices(0),
-        m_pUDPContext(0),
-        m_pcHostname(0),
-        m_pServiceQueries(0),
-        m_fnServiceTxtCallback(0)
+    : m_pServices(0),
+      m_pUDPContext(0),
+      m_pcHostname(0),
+      m_pServiceQueries(0),
+      m_fnServiceTxtCallback(0)
 {
 }
 
@@ -72,7 +69,6 @@ MDNSResponder::MDNSResponder(void)
 */
 MDNSResponder::~MDNSResponder(void)
 {
-
     _resetProbeStatus(false);
     _releaseServiceQueries();
     _releaseHostname();
@@ -91,26 +87,24 @@ MDNSResponder::~MDNSResponder(void)
 */
 bool MDNSResponder::begin(const char* p_pcHostname, const IPAddress& /*p_IPAddress*/, uint32_t /*p_u32TTL*/)
 {
-    bool    bResult = false;
+    bool bResult = false;
 
     if (_setHostname(p_pcHostname))
     {
         bResult = _restart();
     }
 
-    LwipIntf::stateUpCB
-    (
-        [this](netif * intf)
-    {
-        (void)intf;
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] new Interface '%c%c' is UP! restarting\n"), intf->name[0], intf->name[1]));
-        _restart();
-    }
-    );
+    LwipIntf::stateUpCB(
+        [this](netif* intf)
+        {
+            (void)intf;
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] new Interface '%c%c' is UP! restarting\n"), intf->name[0], intf->name[1]));
+            _restart();
+        });
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] begin: FAILED for '%s'!\n"), (p_pcHostname ? : "-"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] begin: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
+                 });
 
     return bResult;
 }
@@ -124,12 +118,12 @@ bool MDNSResponder::begin(const char* p_pcHostname, const IPAddress& /*p_IPAddre
 */
 bool MDNSResponder::close(void)
 {
-    bool    bResult = false;
+    bool bResult = false;
 
     if (0 != m_pUDPContext)
     {
         _announce(false, true);
-        _resetProbeStatus(false);   // Stop probing
+        _resetProbeStatus(false);  // Stop probing
         _releaseServiceQueries();
         _releaseServices();
         _releaseUDPContext();
@@ -167,8 +161,7 @@ bool MDNSResponder::end(void)
 */
 bool MDNSResponder::setHostname(const char* p_pcHostname)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if (_setHostname(p_pcHostname))
     {
@@ -186,9 +179,9 @@ bool MDNSResponder::setHostname(const char* p_pcHostname)
         }
     }
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setHostname: FAILED for '%s'!\n"), (p_pcHostname ? : "-"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setHostname: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
+                 });
     return bResult;
 }
 
@@ -197,11 +190,9 @@ bool MDNSResponder::setHostname(const char* p_pcHostname)
 */
 bool MDNSResponder::setHostname(const String& p_strHostname)
 {
-
     return setHostname(p_strHostname.c_str());
 }
 
-
 /*
     SERVICES
 */
@@ -215,37 +206,34 @@ bool MDNSResponder::setHostname(const String& p_strHostname)
 
 */
 MDNSResponder::hMDNSService MDNSResponder::addService(const char* p_pcName,
-        const char* p_pcService,
-        const char* p_pcProtocol,
-        uint16_t p_u16Port)
-{
-
-    hMDNSService    hResult = 0;
-
-    if (((!p_pcName) ||                                                     // NO name OR
-            (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcName))) &&           // Fitting name
-            (p_pcService) &&
-            (MDNS_SERVICE_NAME_LENGTH >= os_strlen(p_pcService)) &&
-            (p_pcProtocol) &&
-            ((MDNS_SERVICE_PROTOCOL_LENGTH - 1) != os_strlen(p_pcProtocol)) &&
-            (p_u16Port))
+                                                      const char* p_pcService,
+                                                      const char* p_pcProtocol,
+                                                      uint16_t p_u16Port)
+{
+    hMDNSService hResult = 0;
+
+    if (((!p_pcName) ||                                            // NO name OR
+         (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcName))) &&  // Fitting name
+        (p_pcService) &&
+        (MDNS_SERVICE_NAME_LENGTH >= os_strlen(p_pcService)) &&
+        (p_pcProtocol) &&
+        ((MDNS_SERVICE_PROTOCOL_LENGTH - 1) != os_strlen(p_pcProtocol)) &&
+        (p_u16Port))
     {
-
-        if (!_findService((p_pcName ? : m_pcHostname), p_pcService, p_pcProtocol))  // Not already used
+        if (!_findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol))  // Not already used
         {
             if (0 != (hResult = (hMDNSService)_allocService(p_pcName, p_pcService, p_pcProtocol, p_u16Port)))
             {
-
                 // Start probing
                 ((stcMDNSService*)hResult)->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
             }
         }
-    }   // else: bad arguments
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: %s to add '%s.%s.%s'!\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcName ? : "-"), p_pcService, p_pcProtocol););
+    }  // else: bad arguments
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: %s to add '%s.%s.%s'!\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcName ?: "-"), p_pcService, p_pcProtocol););
     DEBUG_EX_ERR(if (!hResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: FAILED to add '%s.%s.%s'!\n"), (p_pcName ? : "-"), p_pcService, p_pcProtocol);
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: FAILED to add '%s.%s.%s'!\n"), (p_pcName ?: "-"), p_pcService, p_pcProtocol);
+                 });
     return hResult;
 }
 
@@ -258,15 +246,14 @@ MDNSResponder::hMDNSService MDNSResponder::addService(const char* p_pcName,
 */
 bool MDNSResponder::removeService(const MDNSResponder::hMDNSService p_hService)
 {
-
     stcMDNSService* pService = 0;
-    bool    bResult = (((pService = _findService(p_hService))) &&
-                       (_announceService(*pService, false)) &&
-                       (_releaseService(pService)));
+    bool bResult = (((pService = _findService(p_hService))) &&
+                    (_announceService(*pService, false)) &&
+                    (_releaseService(pService)));
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeService: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeService: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -277,8 +264,7 @@ bool MDNSResponder::removeService(const char* p_pcName,
                                   const char* p_pcService,
                                   const char* p_pcProtocol)
 {
-
-    return removeService((hMDNSService)_findService((p_pcName ? : m_pcHostname), p_pcService, p_pcProtocol));
+    return removeService((hMDNSService)_findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol));
 }
 
 /*
@@ -288,7 +274,6 @@ bool MDNSResponder::addService(const String& p_strService,
                                const String& p_strProtocol,
                                uint16_t p_u16Port)
 {
-
     return (0 != addService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str(), p_u16Port));
 }
 
@@ -298,17 +283,16 @@ bool MDNSResponder::addService(const String& p_strService,
 bool MDNSResponder::setServiceName(const MDNSResponder::hMDNSService p_hService,
                                    const char* p_pcInstanceName)
 {
-
     stcMDNSService* pService = 0;
-    bool    bResult = (((!p_pcInstanceName) ||
-                        (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcInstanceName))) &&
-                       ((pService = _findService(p_hService))) &&
-                       (pService->setName(p_pcInstanceName)) &&
-                       ((pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart)));
+    bool bResult = (((!p_pcInstanceName) ||
+                     (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcInstanceName))) &&
+                    ((pService = _findService(p_hService))) &&
+                    (pService->setName(p_pcInstanceName)) &&
+                    ((pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart)));
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setServiceName: FAILED for '%s'!\n"), (p_pcInstanceName ? : "-"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setServiceName: FAILED for '%s'!\n"), (p_pcInstanceName ?: "-"));
+                 });
     return bResult;
 }
 
@@ -323,20 +307,19 @@ bool MDNSResponder::setServiceName(const MDNSResponder::hMDNSService p_hService,
 
 */
 MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        const char* p_pcValue)
+                                                     const char* p_pcKey,
+                                                     const char* p_pcValue)
 {
-
-    hMDNSTxt    hTxt = 0;
+    hMDNSTxt hTxt = 0;
     stcMDNSService* pService = _findService(p_hService);
     if (pService)
     {
         hTxt = (hMDNSTxt)_addServiceTxt(pService, p_pcKey, p_pcValue, false);
     }
     DEBUG_EX_ERR(if (!hTxt)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ? : "-"), (p_pcValue ? : "-"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
+                 });
     return hTxt;
 }
 
@@ -346,10 +329,11 @@ MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSS
     Formats: http://www.cplusplus.com/reference/cstdio/printf/
 */
 MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint32_t p_u32Value)
+                                                     const char* p_pcKey,
+                                                     uint32_t p_u32Value)
 {
-    char    acBuffer[32];   *acBuffer = 0;
+    char acBuffer[32];
+    *acBuffer = 0;
     sprintf(acBuffer, "%u", p_u32Value);
 
     return addServiceTxt(p_hService, p_pcKey, acBuffer);
@@ -359,10 +343,11 @@ MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSS
     MDNSResponder::addServiceTxt (uint16_t)
 */
 MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint16_t p_u16Value)
+                                                     const char* p_pcKey,
+                                                     uint16_t p_u16Value)
 {
-    char    acBuffer[16];   *acBuffer = 0;
+    char acBuffer[16];
+    *acBuffer = 0;
     sprintf(acBuffer, "%hu", p_u16Value);
 
     return addServiceTxt(p_hService, p_pcKey, acBuffer);
@@ -372,10 +357,11 @@ MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSS
     MDNSResponder::addServiceTxt (uint8_t)
 */
 MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint8_t p_u8Value)
+                                                     const char* p_pcKey,
+                                                     uint8_t p_u8Value)
 {
-    char    acBuffer[8];    *acBuffer = 0;
+    char acBuffer[8];
+    *acBuffer = 0;
     sprintf(acBuffer, "%hhu", p_u8Value);
 
     return addServiceTxt(p_hService, p_pcKey, acBuffer);
@@ -385,10 +371,11 @@ MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSS
     MDNSResponder::addServiceTxt (int32_t)
 */
 MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int32_t p_i32Value)
+                                                     const char* p_pcKey,
+                                                     int32_t p_i32Value)
 {
-    char    acBuffer[32];   *acBuffer = 0;
+    char acBuffer[32];
+    *acBuffer = 0;
     sprintf(acBuffer, "%i", p_i32Value);
 
     return addServiceTxt(p_hService, p_pcKey, acBuffer);
@@ -398,10 +385,11 @@ MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSS
     MDNSResponder::addServiceTxt (int16_t)
 */
 MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int16_t p_i16Value)
+                                                     const char* p_pcKey,
+                                                     int16_t p_i16Value)
 {
-    char    acBuffer[16];   *acBuffer = 0;
+    char acBuffer[16];
+    *acBuffer = 0;
     sprintf(acBuffer, "%hi", p_i16Value);
 
     return addServiceTxt(p_hService, p_pcKey, acBuffer);
@@ -411,10 +399,11 @@ MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSS
     MDNSResponder::addServiceTxt (int8_t)
 */
 MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int8_t p_i8Value)
+                                                     const char* p_pcKey,
+                                                     int8_t p_i8Value)
 {
-    char    acBuffer[8];    *acBuffer = 0;
+    char acBuffer[8];
+    *acBuffer = 0;
     sprintf(acBuffer, "%hhi", p_i8Value);
 
     return addServiceTxt(p_hService, p_pcKey, acBuffer);
@@ -428,22 +417,21 @@ MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSS
 bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
                                      const MDNSResponder::hMDNSTxt p_hTxt)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     stcMDNSService* pService = _findService(p_hService);
     if (pService)
     {
-        stcMDNSServiceTxt*  pTxt = _findServiceTxt(pService, p_hTxt);
+        stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_hTxt);
         if (pTxt)
         {
             bResult = _releaseServiceTxt(pService, pTxt);
         }
     }
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -453,22 +441,21 @@ bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hServic
 bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
                                      const char* p_pcKey)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     stcMDNSService* pService = _findService(p_hService);
     if (pService)
     {
-        stcMDNSServiceTxt*  pTxt = _findServiceTxt(pService, p_pcKey);
+        stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_pcKey);
         if (pTxt)
         {
             bResult = _releaseServiceTxt(pService, pTxt);
         }
     }
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED for '%s'!\n"), (p_pcKey ? : "-"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED for '%s'!\n"), (p_pcKey ?: "-"));
+                 });
     return bResult;
 }
 
@@ -480,13 +467,12 @@ bool MDNSResponder::removeServiceTxt(const char* p_pcName,
                                      const char* p_pcProtocol,
                                      const char* p_pcKey)
 {
+    bool bResult = false;
 
-    bool    bResult = false;
-
-    stcMDNSService* pService = _findService((p_pcName ? : m_pcHostname), p_pcService, p_pcProtocol);
+    stcMDNSService* pService = _findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol);
     if (pService)
     {
-        stcMDNSServiceTxt*  pTxt = _findServiceTxt(pService, p_pcKey);
+        stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_pcKey);
         if (pTxt)
         {
             bResult = _releaseServiceTxt(pService, pTxt);
@@ -503,7 +489,6 @@ bool MDNSResponder::addServiceTxt(const char* p_pcService,
                                   const char* p_pcKey,
                                   const char* p_pcValue)
 {
-
     return (0 != _addServiceTxt(_findService(m_pcHostname, p_pcService, p_pcProtocol), p_pcKey, p_pcValue, false));
 }
 
@@ -515,7 +500,6 @@ bool MDNSResponder::addServiceTxt(const String& p_strService,
                                   const String& p_strKey,
                                   const String& p_strValue)
 {
-
     return (0 != _addServiceTxt(_findService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str()), p_strKey.c_str(), p_strValue.c_str(), false));
 }
 
@@ -528,7 +512,6 @@ bool MDNSResponder::addServiceTxt(const String& p_strService,
 */
 bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
 {
-
     m_fnServiceTxtCallback = p_fnCallback;
 
     return true;
@@ -542,10 +525,9 @@ bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::MDNSDynamicServi
 
 */
 bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::hMDNSService p_hService,
-        MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
+                                                 MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     stcMDNSService* pService = _findService(p_hService);
     if (pService)
@@ -555,9 +537,9 @@ bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::hMDNSService p_h
         bResult = true;
     }
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setDynamicServiceTxtCallback: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setDynamicServiceTxtCallback: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -565,12 +547,12 @@ bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::hMDNSService p_h
     MDNSResponder::addDynamicServiceTxt
 */
 MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        const char* p_pcValue)
+                                                            const char* p_pcKey,
+                                                            const char* p_pcValue)
 {
     //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt (%s=%s)\n"), p_pcKey, p_pcValue););
 
-    hMDNSTxt        hTxt = 0;
+    hMDNSTxt hTxt = 0;
 
     stcMDNSService* pService = _findService(p_hService);
     if (pService)
@@ -578,9 +560,9 @@ MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNS
         hTxt = _addServiceTxt(pService, p_pcKey, p_pcValue, true);
     }
     DEBUG_EX_ERR(if (!hTxt)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ? : "-"), (p_pcValue ? : "-"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
+                 });
     return hTxt;
 }
 
@@ -588,11 +570,11 @@ MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNS
     MDNSResponder::addDynamicServiceTxt (uint32_t)
 */
 MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint32_t p_u32Value)
+                                                            const char* p_pcKey,
+                                                            uint32_t p_u32Value)
 {
-
-    char    acBuffer[32];   *acBuffer = 0;
+    char acBuffer[32];
+    *acBuffer = 0;
     sprintf(acBuffer, "%u", p_u32Value);
 
     return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
@@ -602,11 +584,11 @@ MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNS
     MDNSResponder::addDynamicServiceTxt (uint16_t)
 */
 MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint16_t p_u16Value)
+                                                            const char* p_pcKey,
+                                                            uint16_t p_u16Value)
 {
-
-    char    acBuffer[16];   *acBuffer = 0;
+    char acBuffer[16];
+    *acBuffer = 0;
     sprintf(acBuffer, "%hu", p_u16Value);
 
     return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
@@ -616,11 +598,11 @@ MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNS
     MDNSResponder::addDynamicServiceTxt (uint8_t)
 */
 MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint8_t p_u8Value)
+                                                            const char* p_pcKey,
+                                                            uint8_t p_u8Value)
 {
-
-    char    acBuffer[8];    *acBuffer = 0;
+    char acBuffer[8];
+    *acBuffer = 0;
     sprintf(acBuffer, "%hhu", p_u8Value);
 
     return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
@@ -630,11 +612,11 @@ MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNS
     MDNSResponder::addDynamicServiceTxt (int32_t)
 */
 MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int32_t p_i32Value)
+                                                            const char* p_pcKey,
+                                                            int32_t p_i32Value)
 {
-
-    char    acBuffer[32];   *acBuffer = 0;
+    char acBuffer[32];
+    *acBuffer = 0;
     sprintf(acBuffer, "%i", p_i32Value);
 
     return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
@@ -644,11 +626,11 @@ MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNS
     MDNSResponder::addDynamicServiceTxt (int16_t)
 */
 MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int16_t p_i16Value)
+                                                            const char* p_pcKey,
+                                                            int16_t p_i16Value)
 {
-
-    char    acBuffer[16];   *acBuffer = 0;
+    char acBuffer[16];
+    *acBuffer = 0;
     sprintf(acBuffer, "%hi", p_i16Value);
 
     return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
@@ -658,17 +640,16 @@ MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNS
     MDNSResponder::addDynamicServiceTxt (int8_t)
 */
 MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int8_t p_i8Value)
+                                                            const char* p_pcKey,
+                                                            int8_t p_i8Value)
 {
-
-    char    acBuffer[8];    *acBuffer = 0;
+    char acBuffer[8];
+    *acBuffer = 0;
     sprintf(acBuffer, "%hhi", p_i8Value);
 
     return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
 }
 
-
 /**
     STATIC SERVICE QUERY (LEGACY)
 */
@@ -695,19 +676,18 @@ uint32_t MDNSResponder::queryService(const char* p_pcService,
 
     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService '%s.%s'\n"), p_pcService, p_pcProtocol););
 
-    uint32_t    u32Result = 0;
+    uint32_t u32Result = 0;
 
-    stcMDNSServiceQuery*    pServiceQuery = 0;
+    stcMDNSServiceQuery* pServiceQuery = 0;
     if ((p_pcService) &&
-            (os_strlen(p_pcService)) &&
-            (p_pcProtocol) &&
-            (os_strlen(p_pcProtocol)) &&
-            (p_u16Timeout) &&
-            (_removeLegacyServiceQuery()) &&
-            ((pServiceQuery = _allocServiceQuery())) &&
-            (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
+        (os_strlen(p_pcService)) &&
+        (p_pcProtocol) &&
+        (os_strlen(p_pcProtocol)) &&
+        (p_u16Timeout) &&
+        (_removeLegacyServiceQuery()) &&
+        ((pServiceQuery = _allocServiceQuery())) &&
+        (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
     {
-
         pServiceQuery->m_bLegacyQuery = true;
 
         if (_sendMDNSServiceQuery(*pServiceQuery))
@@ -720,7 +700,7 @@ uint32_t MDNSResponder::queryService(const char* p_pcService,
             pServiceQuery->m_bAwaitingAnswers = false;
             u32Result = pServiceQuery->answerCount();
         }
-        else    // FAILED to send query
+        else  // FAILED to send query
         {
             _removeServiceQuery(pServiceQuery);
         }
@@ -740,7 +720,6 @@ uint32_t MDNSResponder::queryService(const char* p_pcService,
 */
 bool MDNSResponder::removeQuery(void)
 {
-
     return _removeLegacyServiceQuery();
 }
 
@@ -750,7 +729,6 @@ bool MDNSResponder::removeQuery(void)
 uint32_t MDNSResponder::queryService(const String& p_strService,
                                      const String& p_strProtocol)
 {
-
     return queryService(p_strService.c_str(), p_strProtocol.c_str());
 }
 
@@ -759,16 +737,14 @@ uint32_t MDNSResponder::queryService(const String& p_strService,
 */
 const char* MDNSResponder::answerHostname(const uint32_t p_u32AnswerIndex)
 {
-
-    stcMDNSServiceQuery*            pServiceQuery = _findLegacyServiceQuery();
+    stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
     stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
 
     if ((pSQAnswer) &&
-            (pSQAnswer->m_HostDomain.m_u16NameLength) &&
-            (!pSQAnswer->m_pcHostDomain))
+        (pSQAnswer->m_HostDomain.m_u16NameLength) &&
+        (!pSQAnswer->m_pcHostDomain))
     {
-
-        char*   pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
+        char* pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
         if (pcHostDomain)
         {
             pSQAnswer->m_HostDomain.c_str(pcHostDomain);
@@ -783,10 +759,9 @@ const char* MDNSResponder::answerHostname(const uint32_t p_u32AnswerIndex)
 */
 IPAddress MDNSResponder::answerIP(const uint32_t p_u32AnswerIndex)
 {
-
-    const stcMDNSServiceQuery*                              pServiceQuery = _findLegacyServiceQuery();
-    const stcMDNSServiceQuery::stcAnswer*                   pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    const stcMDNSServiceQuery::stcAnswer::stcIP4Address*    pIP4Address = (((pSQAnswer) && (pSQAnswer->m_pIP4Addresses)) ? pSQAnswer->IP4AddressAtIndex(0) : 0);
+    const stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
+    const stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    const stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = (((pSQAnswer) && (pSQAnswer->m_pIP4Addresses)) ? pSQAnswer->IP4AddressAtIndex(0) : 0);
     return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
 }
 #endif
@@ -797,10 +772,9 @@ IPAddress MDNSResponder::answerIP(const uint32_t p_u32AnswerIndex)
 */
 IPAddress MDNSResponder::answerIP6(const uint32_t p_u32AnswerIndex)
 {
-
-    const stcMDNSServiceQuery*                              pServiceQuery = _findLegacyServiceQuery();
-    const stcMDNSServiceQuery::stcAnswer*                   pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    const stcMDNSServiceQuery::stcAnswer::stcIP6Address*    pIP6Address = (((pSQAnswer) && (pSQAnswer->m_pIP6Addresses)) ? pSQAnswer->IP6AddressAtIndex(0) : 0);
+    const stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
+    const stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    const stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address = (((pSQAnswer) && (pSQAnswer->m_pIP6Addresses)) ? pSQAnswer->IP6AddressAtIndex(0) : 0);
     return (pIP6Address ? pIP6Address->m_IPAddress : IP6Address());
 }
 #endif
@@ -810,9 +784,8 @@ IPAddress MDNSResponder::answerIP6(const uint32_t p_u32AnswerIndex)
 */
 uint16_t MDNSResponder::answerPort(const uint32_t p_u32AnswerIndex)
 {
-
-    const stcMDNSServiceQuery*              pServiceQuery = _findLegacyServiceQuery();
-    const stcMDNSServiceQuery::stcAnswer*   pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    const stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
+    const stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
     return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
 }
 
@@ -821,7 +794,6 @@ uint16_t MDNSResponder::answerPort(const uint32_t p_u32AnswerIndex)
 */
 String MDNSResponder::hostname(const uint32_t p_u32AnswerIndex)
 {
-
     return String(answerHostname(p_u32AnswerIndex));
 }
 
@@ -830,7 +802,6 @@ String MDNSResponder::hostname(const uint32_t p_u32AnswerIndex)
 */
 IPAddress MDNSResponder::IP(const uint32_t p_u32AnswerIndex)
 {
-
     return answerIP(p_u32AnswerIndex);
 }
 
@@ -839,11 +810,9 @@ IPAddress MDNSResponder::IP(const uint32_t p_u32AnswerIndex)
 */
 uint16_t MDNSResponder::port(const uint32_t p_u32AnswerIndex)
 {
-
     return answerPort(p_u32AnswerIndex);
 }
 
-
 /**
     DYNAMIC SERVICE QUERY
 */
@@ -862,21 +831,20 @@ uint16_t MDNSResponder::port(const uint32_t p_u32AnswerIndex)
 
 */
 MDNSResponder::hMDNSServiceQuery MDNSResponder::installServiceQuery(const char* p_pcService,
-        const char* p_pcProtocol,
-        MDNSResponder::MDNSServiceQueryCallbackFunc p_fnCallback)
+                                                                    const char* p_pcProtocol,
+                                                                    MDNSResponder::MDNSServiceQueryCallbackFunc p_fnCallback)
 {
-    hMDNSServiceQuery       hResult = 0;
+    hMDNSServiceQuery hResult = 0;
 
-    stcMDNSServiceQuery*    pServiceQuery = 0;
+    stcMDNSServiceQuery* pServiceQuery = 0;
     if ((p_pcService) &&
-            (os_strlen(p_pcService)) &&
-            (p_pcProtocol) &&
-            (os_strlen(p_pcProtocol)) &&
-            (p_fnCallback) &&
-            ((pServiceQuery = _allocServiceQuery())) &&
-            (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
+        (os_strlen(p_pcService)) &&
+        (p_pcProtocol) &&
+        (os_strlen(p_pcProtocol)) &&
+        (p_fnCallback) &&
+        ((pServiceQuery = _allocServiceQuery())) &&
+        (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
     {
-
         pServiceQuery->m_fnCallback = p_fnCallback;
         pServiceQuery->m_bLegacyQuery = false;
 
@@ -892,11 +860,11 @@ MDNSResponder::hMDNSServiceQuery MDNSResponder::installServiceQuery(const char*
             _removeServiceQuery(pServiceQuery);
         }
     }
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: %s for '%s.%s'!\n\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcService ? : "-"), (p_pcProtocol ? : "-")););
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: %s for '%s.%s'!\n\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
     DEBUG_EX_ERR(if (!hResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: FAILED for '%s.%s'!\n\n"), (p_pcService ? : "-"), (p_pcProtocol ? : "-"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: FAILED for '%s.%s'!\n\n"), (p_pcService ?: "-"), (p_pcProtocol ?: "-"));
+                 });
     return hResult;
 }
 
@@ -908,14 +876,13 @@ MDNSResponder::hMDNSServiceQuery MDNSResponder::installServiceQuery(const char*
 */
 bool MDNSResponder::removeServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
 {
-
-    stcMDNSServiceQuery*    pServiceQuery = 0;
-    bool    bResult = (((pServiceQuery = _findServiceQuery(p_hServiceQuery))) &&
-                       (_removeServiceQuery(pServiceQuery)));
+    stcMDNSServiceQuery* pServiceQuery = 0;
+    bool bResult = (((pServiceQuery = _findServiceQuery(p_hServiceQuery))) &&
+                    (_removeServiceQuery(pServiceQuery)));
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceQuery: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceQuery: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -924,12 +891,11 @@ bool MDNSResponder::removeServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServi
 */
 uint32_t MDNSResponder::answerCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
 {
-
-    stcMDNSServiceQuery*    pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
     return (pServiceQuery ? pServiceQuery->answerCount() : 0);
 }
 
-std::vector<MDNSResponder::MDNSServiceInfo>  MDNSResponder::answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
+std::vector<MDNSResponder::MDNSServiceInfo> MDNSResponder::answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
 {
     std::vector<MDNSResponder::MDNSServiceInfo> tempVector;
     for (uint32_t i = 0; i < answerCount(p_hServiceQuery); i++)
@@ -947,17 +913,15 @@ std::vector<MDNSResponder::MDNSServiceInfo>  MDNSResponder::answerInfo(const MDN
 
 */
 const char* MDNSResponder::answerServiceDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                               const uint32_t p_u32AnswerIndex)
 {
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
     stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
     // Fill m_pcServiceDomain (if not already done)
     if ((pSQAnswer) &&
-            (pSQAnswer->m_ServiceDomain.m_u16NameLength) &&
-            (!pSQAnswer->m_pcServiceDomain))
+        (pSQAnswer->m_ServiceDomain.m_u16NameLength) &&
+        (!pSQAnswer->m_pcServiceDomain))
     {
-
         pSQAnswer->m_pcServiceDomain = pSQAnswer->allocServiceDomain(pSQAnswer->m_ServiceDomain.c_strLength());
         if (pSQAnswer->m_pcServiceDomain)
         {
@@ -973,8 +937,7 @@ const char* MDNSResponder::answerServiceDomain(const MDNSResponder::hMDNSService
 bool MDNSResponder::hasAnswerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
                                         const uint32_t p_u32AnswerIndex)
 {
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
     stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
     return ((pSQAnswer) &&
             (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
@@ -988,17 +951,15 @@ bool MDNSResponder::hasAnswerHostDomain(const MDNSResponder::hMDNSServiceQuery p
 
 */
 const char* MDNSResponder::answerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                            const uint32_t p_u32AnswerIndex)
 {
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
     stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
     // Fill m_pcHostDomain (if not already done)
     if ((pSQAnswer) &&
-            (pSQAnswer->m_HostDomain.m_u16NameLength) &&
-            (!pSQAnswer->m_pcHostDomain))
+        (pSQAnswer->m_HostDomain.m_u16NameLength) &&
+        (!pSQAnswer->m_pcHostDomain))
     {
-
         pSQAnswer->m_pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
         if (pSQAnswer->m_pcHostDomain)
         {
@@ -1015,8 +976,7 @@ const char* MDNSResponder::answerHostDomain(const MDNSResponder::hMDNSServiceQue
 bool MDNSResponder::hasAnswerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
                                         const uint32_t p_u32AnswerIndex)
 {
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
     stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
     return ((pSQAnswer) &&
             (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_IP4Address));
@@ -1026,10 +986,9 @@ bool MDNSResponder::hasAnswerIP4Address(const MDNSResponder::hMDNSServiceQuery p
     MDNSResponder::answerIP4AddressCount
 */
 uint32_t MDNSResponder::answerIP4AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                              const uint32_t p_u32AnswerIndex)
 {
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
     stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
     return (pSQAnswer ? pSQAnswer->IP4AddressCount() : 0);
 }
@@ -1038,13 +997,12 @@ uint32_t MDNSResponder::answerIP4AddressCount(const MDNSResponder::hMDNSServiceQ
     MDNSResponder::answerIP4Address
 */
 IPAddress MDNSResponder::answerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex,
-        const uint32_t p_u32AddressIndex)
+                                          const uint32_t p_u32AnswerIndex,
+                                          const uint32_t p_u32AddressIndex)
 {
-
-    stcMDNSServiceQuery*                            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer*                 pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    stcMDNSServiceQuery::stcAnswer::stcIP4Address*  pIP4Address = (pSQAnswer ? pSQAnswer->IP4AddressAtIndex(p_u32AddressIndex) : 0);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = (pSQAnswer ? pSQAnswer->IP4AddressAtIndex(p_u32AddressIndex) : 0);
     return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
 }
 #endif
@@ -1056,8 +1014,7 @@ IPAddress MDNSResponder::answerIP4Address(const MDNSResponder::hMDNSServiceQuery
 bool MDNSResponder::hasAnswerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
                                         const uint32_t p_u32AnswerIndex)
 {
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
     stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
     return ((pSQAnswer) &&
             (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostIP6Address));
@@ -1067,10 +1024,9 @@ bool MDNSResponder::hasAnswerIP6Address(const MDNSResponder::hMDNSServiceQuery p
     MDNSResponder::answerIP6AddressCount
 */
 uint32_t MDNSResponder::answerIP6AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                              const uint32_t p_u32AnswerIndex)
 {
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
     stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
     return (pSQAnswer ? pSQAnswer->IP6AddressCount() : 0);
 }
@@ -1079,13 +1035,12 @@ uint32_t MDNSResponder::answerIP6AddressCount(const MDNSResponder::hMDNSServiceQ
     MDNSResponder::answerIP6Address
 */
 IPAddress MDNSResponder::answerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex,
-        const uint32_t p_u32AddressIndex)
+                                          const uint32_t p_u32AnswerIndex,
+                                          const uint32_t p_u32AddressIndex)
 {
-
-    stcMDNSServiceQuery*                            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer*                 pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    stcMDNSServiceQuery::stcAnswer::stcIP6Address*  pIP6Address = (pSQAnswer ? pSQAnswer->IP6AddressAtIndex(p_u32AddressIndex) : 0);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address = (pSQAnswer ? pSQAnswer->IP6AddressAtIndex(p_u32AddressIndex) : 0);
     return (pIP6Address ? pIP6Address->m_IPAddress : IPAddress());
 }
 #endif
@@ -1096,8 +1051,7 @@ IPAddress MDNSResponder::answerIP6Address(const MDNSResponder::hMDNSServiceQuery
 bool MDNSResponder::hasAnswerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
                                   const uint32_t p_u32AnswerIndex)
 {
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
     stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
     return ((pSQAnswer) &&
             (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
@@ -1109,8 +1063,7 @@ bool MDNSResponder::hasAnswerPort(const MDNSResponder::hMDNSServiceQuery p_hServ
 uint16_t MDNSResponder::answerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
                                    const uint32_t p_u32AnswerIndex)
 {
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
     stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
     return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
 }
@@ -1121,8 +1074,7 @@ uint16_t MDNSResponder::answerPort(const MDNSResponder::hMDNSServiceQuery p_hSer
 bool MDNSResponder::hasAnswerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
                                   const uint32_t p_u32AnswerIndex)
 {
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
     stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
     return ((pSQAnswer) &&
             (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_Txts));
@@ -1138,15 +1090,13 @@ bool MDNSResponder::hasAnswerTxts(const MDNSResponder::hMDNSServiceQuery p_hServ
 const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
                                       const uint32_t p_u32AnswerIndex)
 {
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
     stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
     // Fill m_pcTxts (if not already done)
     if ((pSQAnswer) &&
-            (pSQAnswer->m_Txts.m_pTxts) &&
-            (!pSQAnswer->m_pcTxts))
+        (pSQAnswer->m_Txts.m_pTxts) &&
+        (!pSQAnswer->m_pcTxts))
     {
-
         pSQAnswer->m_pcTxts = pSQAnswer->allocTxts(pSQAnswer->m_Txts.c_strLength());
         if (pSQAnswer->m_pcTxts)
         {
@@ -1172,7 +1122,6 @@ const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_h
 */
 bool MDNSResponder::setHostProbeResultCallback(MDNSResponder::MDNSHostProbeFn p_fnCallback)
 {
-
     m_HostProbeInformation.m_fnHostProbeResultCallback = p_fnCallback;
 
     return true;
@@ -1182,9 +1131,7 @@ bool MDNSResponder::setHostProbeResultCallback(MDNSHostProbeFn1 pfn)
 {
     using namespace std::placeholders;
     return setHostProbeResultCallback([this, pfn](const char* p_pcDomainName, bool p_bProbeResult)
-    {
-        pfn(*this, p_pcDomainName, p_bProbeResult);
-    });
+                                      { pfn(*this, p_pcDomainName, p_bProbeResult); });
 }
 
 /*
@@ -1197,10 +1144,9 @@ bool MDNSResponder::setHostProbeResultCallback(MDNSHostProbeFn1 pfn)
 
 */
 bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-        MDNSResponder::MDNSServiceProbeFn p_fnCallback)
+                                                  MDNSResponder::MDNSServiceProbeFn p_fnCallback)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     stcMDNSService* pService = _findService(p_hService);
     if (pService)
@@ -1213,16 +1159,13 @@ bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSServ
 }
 
 bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-        MDNSResponder::MDNSServiceProbeFn1 p_fnCallback)
+                                                  MDNSResponder::MDNSServiceProbeFn1 p_fnCallback)
 {
     using namespace std::placeholders;
     return setServiceProbeResultCallback(p_hService, [this, p_fnCallback](const char* p_pcServiceName, const hMDNSService p_hMDNSService, bool p_bProbeResult)
-    {
-        p_fnCallback(*this, p_pcServiceName, p_hMDNSService, p_bProbeResult);
-    });
+                                         { p_fnCallback(*this, p_pcServiceName, p_hMDNSService, p_bProbeResult); });
 }
 
-
 /*
     MISC
 */
@@ -1236,7 +1179,6 @@ bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSServ
 */
 bool MDNSResponder::notifyAPChange(void)
 {
-
     return _restart();
 }
 
@@ -1258,7 +1200,6 @@ bool MDNSResponder::update(void)
 */
 bool MDNSResponder::announce(void)
 {
-
     return (_announce(true, true));
 }
 
@@ -1269,18 +1210,16 @@ bool MDNSResponder::announce(void)
 
 */
 MDNSResponder::hMDNSService MDNSResponder::enableArduino(uint16_t p_u16Port,
-        bool p_bAuthUpload /*= false*/)
+                                                         bool p_bAuthUpload /*= false*/)
 {
-
-    hMDNSService    hService = addService(0, "arduino", "tcp", p_u16Port);
+    hMDNSService hService = addService(0, "arduino", "tcp", p_u16Port);
     if (hService)
     {
         if ((!addServiceTxt(hService, "tcp_check", "no")) ||
-                (!addServiceTxt(hService, "ssh_upload", "no")) ||
-                (!addServiceTxt(hService, "board", STRINGIZE_VALUE_OF(ARDUINO_BOARD))) ||
-                (!addServiceTxt(hService, "auth_upload", (p_bAuthUpload) ? "yes" : "no")))
+            (!addServiceTxt(hService, "ssh_upload", "no")) ||
+            (!addServiceTxt(hService, "board", STRINGIZE_VALUE_OF(ARDUINO_BOARD))) ||
+            (!addServiceTxt(hService, "auth_upload", (p_bAuthUpload) ? "yes" : "no")))
         {
-
             removeService(hService);
             hService = 0;
         }
@@ -1299,7 +1238,7 @@ MDNSResponder::hMDNSService MDNSResponder::enableArduino(uint16_t p_u16Port,
 */
 bool MDNSResponder::_joinMulticastGroups(void)
 {
-    bool    bResult = false;
+    bool bResult = false;
 
     // Join multicast group(s)
     for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
@@ -1307,7 +1246,7 @@ bool MDNSResponder::_joinMulticastGroups(void)
         if (netif_is_up(pNetIf))
         {
 #ifdef MDNS_IP4_SUPPORT
-            ip_addr_t   multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
+            ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
             if (!(pNetIf->flags & NETIF_FLAG_IGMP))
             {
                 DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: Setting flag: flags & NETIF_FLAG_IGMP\n")););
@@ -1331,11 +1270,11 @@ bool MDNSResponder::_joinMulticastGroups(void)
 #endif
 
 #ifdef MDNS_IPV6_SUPPORT
-            ip_addr_t   multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
+            ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
             bResult = ((bResult) &&
                        (ERR_OK == mld6_joingroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6))));
             DEBUG_EX_ERR_IF(!bResult, DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: mld6_joingroup_netif (" NETIFID_STR ") FAILED!\n"),
-                            NETIFID_VAL(pNetIf)));
+                                                            NETIFID_VAL(pNetIf)));
 #endif
         }
     }
@@ -1347,7 +1286,7 @@ bool MDNSResponder::_joinMulticastGroups(void)
 */
 bool MDNSResponder::_leaveMulticastGroups()
 {
-    bool    bResult = false;
+    bool bResult = false;
 
     for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
     {
@@ -1357,15 +1296,15 @@ bool MDNSResponder::_leaveMulticastGroups()
 
             // Leave multicast group(s)
 #ifdef MDNS_IP4_SUPPORT
-            ip_addr_t   multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
+            ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
             if (ERR_OK != igmp_leavegroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4)))
             {
                 DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
             }
 #endif
 #ifdef MDNS_IPV6_SUPPORT
-            ip_addr_t   multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
-            if (ERR_OK != mld6_leavegroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6)/*&(multicast_addr_V6.u_addr.ip6)*/))
+            ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
+            if (ERR_OK != mld6_leavegroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6) /*&(multicast_addr_V6.u_addr.ip6)*/))
             {
                 DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
             }
@@ -1375,10 +1314,6 @@ bool MDNSResponder::_leaveMulticastGroups()
     return bResult;
 }
 
+}  //namespace MDNSImplementation
 
-
-} //namespace MDNSImplementation
-
-} //namespace esp8266
-
-
+}  //namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.h b/libraries/ESP8266mDNS/src/LEAmDNS.h
index 670de02ed0..7d7b8b7287 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.h
@@ -102,28 +102,24 @@
 #ifndef MDNS_H
 #define MDNS_H
 
-#include <functional>   // for UdpContext.h
+#include <PolledTimeout.h>
+#include <functional>  // for UdpContext.h
+#include <limits>
+#include <map>
 #include "WiFiUdp.h"
-#include "lwip/udp.h"
 #include "debug.h"
 #include "include/UdpContext.h"
-#include <limits>
-#include <PolledTimeout.h>
-#include <map>
-
+#include "lwip/udp.h"
 
 #include "ESP8266WiFi.h"
 
-
 namespace esp8266
 {
-
 /**
     LEAmDNS
 */
 namespace MDNSImplementation
 {
-
 //this should be defined at build time
 #ifndef ARDUINO_BOARD
 #define ARDUINO_BOARD "generic"
@@ -135,47 +131,47 @@ namespace MDNSImplementation
 #endif
 
 #ifdef MDNS_IP4_SUPPORT
-#define MDNS_IP4_SIZE               4
+#define MDNS_IP4_SIZE 4
 #endif
 #ifdef MDNS_IP6_SUPPORT
-#define MDNS_IP6_SIZE               16
+#define MDNS_IP6_SIZE 16
 #endif
 /*
     Maximum length for all service txts for one service
 */
-#define MDNS_SERVICE_TXT_MAXLENGTH      1300
+#define MDNS_SERVICE_TXT_MAXLENGTH 1300
 /*
     Maximum length for a full domain name eg. MyESP._http._tcp.local
 */
-#define MDNS_DOMAIN_MAXLENGTH           256
+#define MDNS_DOMAIN_MAXLENGTH 256
 /*
     Maximum length of on label in a domain name (length info fits into 6 bits)
 */
-#define MDNS_DOMAIN_LABEL_MAXLENGTH     63
+#define MDNS_DOMAIN_LABEL_MAXLENGTH 63
 /*
     Maximum length of a service name eg. http
 */
-#define MDNS_SERVICE_NAME_LENGTH        15
+#define MDNS_SERVICE_NAME_LENGTH 15
 /*
     Maximum length of a service protocol name eg. tcp
 */
-#define MDNS_SERVICE_PROTOCOL_LENGTH    3
+#define MDNS_SERVICE_PROTOCOL_LENGTH 3
 /*
     Default timeout for static service queries
 */
-#define MDNS_QUERYSERVICES_WAIT_TIME    1000
+#define MDNS_QUERYSERVICES_WAIT_TIME 1000
 
 /*
     Timeout for udpContext->sendtimeout()
 */
-#define MDNS_UDPCONTEXT_TIMEOUT  50
+#define MDNS_UDPCONTEXT_TIMEOUT 50
 
 /**
     MDNSResponder
 */
 class MDNSResponder
 {
-public:
+   public:
     /* INTERFACE */
 
     MDNSResponder(void);
@@ -210,7 +206,7 @@ class MDNSResponder
     /**
         hMDNSService (opaque handle to access the service)
     */
-    typedef const void*     hMDNSService;
+    typedef const void* hMDNSService;
 
     // Add a new service to the MDNS responder. If no name (instance name) is given (p_pcName = 0)
     // the current hostname is used. If the hostname is changed later, the instance names for
@@ -230,7 +226,6 @@ class MDNSResponder
                     const String& p_strProtocol,
                     uint16_t p_u16Port);
 
-
     // Change the services instance name (and restart probing).
     bool setServiceName(const hMDNSService p_hService,
                         const char* p_pcInstanceName);
@@ -250,7 +245,7 @@ class MDNSResponder
     /**
         hMDNSTxt (opaque handle to access the TXT items)
     */
-    typedef void*   hMDNSTxt;
+    typedef void* hMDNSTxt;
 
     // Add a (static) MDNS TXT item ('key' = 'value') to the service
     hMDNSTxt addServiceTxt(const hMDNSService p_hService,
@@ -358,35 +353,35 @@ class MDNSResponder
     /**
         hMDNSServiceQuery (opaque handle to access dynamic service queries)
     */
-    typedef const void*     hMDNSServiceQuery;
+    typedef const void* hMDNSServiceQuery;
 
     /**
         enuServiceQueryAnswerType
     */
     typedef enum _enuServiceQueryAnswerType
     {
-        ServiceQueryAnswerType_ServiceDomain        = (1 << 0), // Service instance name
-        ServiceQueryAnswerType_HostDomainAndPort    = (1 << 1), // Host domain and service port
-        ServiceQueryAnswerType_Txts                 = (1 << 2), // TXT items
+        ServiceQueryAnswerType_ServiceDomain = (1 << 0),      // Service instance name
+        ServiceQueryAnswerType_HostDomainAndPort = (1 << 1),  // Host domain and service port
+        ServiceQueryAnswerType_Txts = (1 << 2),               // TXT items
 #ifdef MDNS_IP4_SUPPORT
-        ServiceQueryAnswerType_IP4Address           = (1 << 3), // IP4 address
+        ServiceQueryAnswerType_IP4Address = (1 << 3),  // IP4 address
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        ServiceQueryAnswerType_IP6Address           = (1 << 4), // IP6 address
+        ServiceQueryAnswerType_IP6Address = (1 << 4),  // IP6 address
 #endif
     } enuServiceQueryAnswerType;
 
     enum class AnswerType : uint32_t
     {
-        Unknown                             = 0,
-        ServiceDomain                       = ServiceQueryAnswerType_ServiceDomain,
-        HostDomainAndPort                   = ServiceQueryAnswerType_HostDomainAndPort,
-        Txt                                 = ServiceQueryAnswerType_Txts,
+        Unknown = 0,
+        ServiceDomain = ServiceQueryAnswerType_ServiceDomain,
+        HostDomainAndPort = ServiceQueryAnswerType_HostDomainAndPort,
+        Txt = ServiceQueryAnswerType_Txts,
 #ifdef MDNS_IP4_SUPPORT
-        IP4Address                          = ServiceQueryAnswerType_IP4Address,
+        IP4Address = ServiceQueryAnswerType_IP4Address,
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        IP6Address                          = ServiceQueryAnswerType_IP6Address,
+        IP6Address = ServiceQueryAnswerType_IP6Address,
 #endif
     };
 
@@ -394,11 +389,12 @@ class MDNSResponder
         MDNSServiceQueryCallbackFn
         Callback function for received answers for dynamic service queries
     */
-    struct MDNSServiceInfo; // forward declaration
+    struct MDNSServiceInfo;  // forward declaration
     typedef std::function<void(const MDNSServiceInfo& mdnsServiceInfo,
-                               AnswerType answerType,     // flag for the updated answer item
-                               bool p_bSetContent                      // true: Answer component set, false: component deleted
-                              )> MDNSServiceQueryCallbackFunc;
+                               AnswerType answerType,  // flag for the updated answer item
+                               bool p_bSetContent      // true: Answer component set, false: component deleted
+                               )>
+        MDNSServiceQueryCallbackFunc;
 
     // Install a dynamic service query. For every received answer (part) the given callback
     // function is called. The query will be updated every time, the TTL for an answer
@@ -459,20 +455,24 @@ class MDNSResponder
         Callback function for (host and service domain) probe results
     */
     typedef std::function<void(const char* p_pcDomainName,
-                               bool p_bProbeResult)> MDNSHostProbeFn;
+                               bool p_bProbeResult)>
+        MDNSHostProbeFn;
 
     typedef std::function<void(MDNSResponder& resp,
                                const char* p_pcDomainName,
-                               bool p_bProbeResult)> MDNSHostProbeFn1;
+                               bool p_bProbeResult)>
+        MDNSHostProbeFn1;
 
     typedef std::function<void(const char* p_pcServiceName,
                                const hMDNSService p_hMDNSService,
-                               bool p_bProbeResult)> MDNSServiceProbeFn;
+                               bool p_bProbeResult)>
+        MDNSServiceProbeFn;
 
     typedef std::function<void(MDNSResponder& resp,
                                const char* p_pcServiceName,
                                const hMDNSService p_hMDNSService,
-                               bool p_bProbeResult)> MDNSServiceProbeFn1;
+                               bool p_bProbeResult)>
+        MDNSServiceProbeFn1;
 
     // Set a global callback function for host and service probe results
     // The callback function is called, when the probing for the host domain
@@ -509,7 +509,7 @@ class MDNSResponder
 
     /** STRUCTS **/
 
-public:
+   public:
     /**
         MDNSServiceInfo, used in application callbacks
     */
@@ -518,22 +518,23 @@ class MDNSResponder
         MDNSServiceInfo(MDNSResponder& p_pM, MDNSResponder::hMDNSServiceQuery p_hS, uint32_t p_u32A)
             : p_pMDNSResponder(p_pM),
               p_hServiceQuery(p_hS),
-              p_u32AnswerIndex(p_u32A)
-        {};
+              p_u32AnswerIndex(p_u32A){};
         struct CompareKey
         {
-            bool operator()(char const *a, char const *b) const
+            bool operator()(char const* a, char const* b) const
             {
                 return strcmp(a, b) < 0;
             }
         };
         using KeyValueMap = std::map<const char*, const char*, CompareKey>;
-    protected:
+
+       protected:
         MDNSResponder& p_pMDNSResponder;
         MDNSResponder::hMDNSServiceQuery p_hServiceQuery;
         uint32_t p_u32AnswerIndex;
         KeyValueMap keyValueMap;
-    public:
+
+       public:
         const char* serviceDomain()
         {
             return p_pMDNSResponder.answerServiceDomain(p_hServiceQuery, p_u32AnswerIndex);
@@ -544,8 +545,7 @@ class MDNSResponder
         }
         const char* hostDomain()
         {
-            return (hostDomainAvailable()) ?
-                   p_pMDNSResponder.answerHostDomain(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
+            return (hostDomainAvailable()) ? p_pMDNSResponder.answerHostDomain(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
         };
         bool hostPortAvailable()
         {
@@ -553,8 +553,7 @@ class MDNSResponder
         }
         uint16_t hostPort()
         {
-            return (hostPortAvailable()) ?
-                   p_pMDNSResponder.answerPort(p_hServiceQuery, p_u32AnswerIndex) : 0;
+            return (hostPortAvailable()) ? p_pMDNSResponder.answerPort(p_hServiceQuery, p_u32AnswerIndex) : 0;
         };
         bool IP4AddressAvailable()
         {
@@ -579,8 +578,7 @@ class MDNSResponder
         }
         const char* strKeyValue()
         {
-            return (txtAvailable()) ?
-                   p_pMDNSResponder.answerTxts(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
+            return (txtAvailable()) ? p_pMDNSResponder.answerTxts(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
         };
         const KeyValueMap& keyValues()
         {
@@ -600,7 +598,7 @@ class MDNSResponder
             for (stcMDNSServiceTxt* pTxt = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); pTxt; pTxt = pTxt->m_pNext)
             {
                 if ((key) &&
-                        (0 == strcmp(pTxt->m_pcKey, key)))
+                    (0 == strcmp(pTxt->m_pcKey, key)))
                 {
                     result = pTxt->m_pcValue;
                     break;
@@ -609,17 +607,17 @@ class MDNSResponder
             return result;
         }
     };
-protected:
 
+   protected:
     /**
         stcMDNSServiceTxt
     */
     struct stcMDNSServiceTxt
     {
         stcMDNSServiceTxt* m_pNext;
-        char*              m_pcKey;
-        char*              m_pcValue;
-        bool               m_bTemp;
+        char* m_pcKey;
+        char* m_pcValue;
+        bool m_bTemp;
 
         stcMDNSServiceTxt(const char* p_pcKey = 0,
                           const char* p_pcValue = 0,
@@ -656,7 +654,7 @@ class MDNSResponder
     */
     struct stcMDNSServiceTxts
     {
-        stcMDNSServiceTxt*  m_pTxts;
+        stcMDNSServiceTxt* m_pTxts;
 
         stcMDNSServiceTxts(void);
         stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other);
@@ -694,15 +692,15 @@ class MDNSResponder
     typedef enum _enuContentFlags
     {
         // Host
-        ContentFlag_A           = 0x01,
-        ContentFlag_PTR_IP4     = 0x02,
-        ContentFlag_PTR_IP6     = 0x04,
-        ContentFlag_AAAA        = 0x08,
+        ContentFlag_A = 0x01,
+        ContentFlag_PTR_IP4 = 0x02,
+        ContentFlag_PTR_IP6 = 0x04,
+        ContentFlag_AAAA = 0x08,
         // Service
-        ContentFlag_PTR_TYPE    = 0x10,
-        ContentFlag_PTR_NAME    = 0x20,
-        ContentFlag_TXT         = 0x40,
-        ContentFlag_SRV         = 0x80,
+        ContentFlag_PTR_TYPE = 0x10,
+        ContentFlag_PTR_NAME = 0x20,
+        ContentFlag_TXT = 0x40,
+        ContentFlag_SRV = 0x80,
     } enuContentFlags;
 
     /**
@@ -710,19 +708,19 @@ class MDNSResponder
     */
     struct stcMDNS_MsgHeader
     {
-        uint16_t        m_u16ID;            // Identifier
-        bool            m_1bQR      : 1;    // Query/Response flag
-        unsigned char   m_4bOpcode  : 4;    // Operation code
-        bool            m_1bAA      : 1;    // Authoritative Answer flag
-        bool            m_1bTC      : 1;    // Truncation flag
-        bool            m_1bRD      : 1;    // Recursion desired
-        bool            m_1bRA      : 1;    // Recursion available
-        unsigned char   m_3bZ       : 3;    // Zero
-        unsigned char   m_4bRCode   : 4;    // Response code
-        uint16_t        m_u16QDCount;       // Question count
-        uint16_t        m_u16ANCount;       // Answer count
-        uint16_t        m_u16NSCount;       // Authority Record count
-        uint16_t        m_u16ARCount;       // Additional Record count
+        uint16_t m_u16ID;              // Identifier
+        bool m_1bQR : 1;               // Query/Response flag
+        unsigned char m_4bOpcode : 4;  // Operation code
+        bool m_1bAA : 1;               // Authoritative Answer flag
+        bool m_1bTC : 1;               // Truncation flag
+        bool m_1bRD : 1;               // Recursion desired
+        bool m_1bRA : 1;               // Recursion available
+        unsigned char m_3bZ : 3;       // Zero
+        unsigned char m_4bRCode : 4;   // Response code
+        uint16_t m_u16QDCount;         // Question count
+        uint16_t m_u16ANCount;         // Answer count
+        uint16_t m_u16NSCount;         // Authority Record count
+        uint16_t m_u16ARCount;         // Additional Record count
 
         stcMDNS_MsgHeader(uint16_t p_u16ID = 0,
                           bool p_bQR = false,
@@ -743,8 +741,8 @@ class MDNSResponder
     */
     struct stcMDNS_RRDomain
     {
-        char            m_acName[MDNS_DOMAIN_MAXLENGTH];    // Encoded domain name
-        uint16_t        m_u16NameLength;                    // Length (incl. '\0')
+        char m_acName[MDNS_DOMAIN_MAXLENGTH];  // Encoded domain name
+        uint16_t m_u16NameLength;              // Length (incl. '\0')
 
         stcMDNS_RRDomain(void);
         stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other);
@@ -770,8 +768,8 @@ class MDNSResponder
     */
     struct stcMDNS_RRAttributes
     {
-        uint16_t            m_u16Type;      // Type
-        uint16_t            m_u16Class;     // Class, nearly always 'IN'
+        uint16_t m_u16Type;   // Type
+        uint16_t m_u16Class;  // Class, nearly always 'IN'
 
         stcMDNS_RRAttributes(uint16_t p_u16Type = 0,
                              uint16_t p_u16Class = 1 /*DNS_RRCLASS_IN Internet*/);
@@ -785,8 +783,8 @@ class MDNSResponder
     */
     struct stcMDNS_RRHeader
     {
-        stcMDNS_RRDomain        m_Domain;
-        stcMDNS_RRAttributes    m_Attributes;
+        stcMDNS_RRDomain m_Domain;
+        stcMDNS_RRAttributes m_Attributes;
 
         stcMDNS_RRHeader(void);
         stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other);
@@ -801,9 +799,9 @@ class MDNSResponder
     */
     struct stcMDNS_RRQuestion
     {
-        stcMDNS_RRQuestion*     m_pNext;
-        stcMDNS_RRHeader        m_Header;
-        bool                    m_bUnicast;     // Unicast reply requested
+        stcMDNS_RRQuestion* m_pNext;
+        stcMDNS_RRHeader m_Header;
+        bool m_bUnicast;  // Unicast reply requested
 
         stcMDNS_RRQuestion(void);
     };
@@ -826,11 +824,11 @@ class MDNSResponder
     */
     struct stcMDNS_RRAnswer
     {
-        stcMDNS_RRAnswer*   m_pNext;
+        stcMDNS_RRAnswer* m_pNext;
         const enuAnswerType m_AnswerType;
-        stcMDNS_RRHeader    m_Header;
-        bool                m_bCacheFlush;  // Cache flush command bit
-        uint32_t            m_u32TTL;       // Validity time in seconds
+        stcMDNS_RRHeader m_Header;
+        bool m_bCacheFlush;  // Cache flush command bit
+        uint32_t m_u32TTL;   // Validity time in seconds
 
         virtual ~stcMDNS_RRAnswer(void);
 
@@ -838,7 +836,7 @@ class MDNSResponder
 
         bool clear(void);
 
-    protected:
+       protected:
         stcMDNS_RRAnswer(enuAnswerType p_AnswerType,
                          const stcMDNS_RRHeader& p_Header,
                          uint32_t p_u32TTL);
@@ -850,7 +848,7 @@ class MDNSResponder
     */
     struct stcMDNS_RRAnswerA : public stcMDNS_RRAnswer
     {
-        IPAddress           m_IPAddress;
+        IPAddress m_IPAddress;
 
         stcMDNS_RRAnswerA(const stcMDNS_RRHeader& p_Header,
                           uint32_t p_u32TTL);
@@ -865,7 +863,7 @@ class MDNSResponder
     */
     struct stcMDNS_RRAnswerPTR : public stcMDNS_RRAnswer
     {
-        stcMDNS_RRDomain    m_PTRDomain;
+        stcMDNS_RRDomain m_PTRDomain;
 
         stcMDNS_RRAnswerPTR(const stcMDNS_RRHeader& p_Header,
                             uint32_t p_u32TTL);
@@ -879,7 +877,7 @@ class MDNSResponder
     */
     struct stcMDNS_RRAnswerTXT : public stcMDNS_RRAnswer
     {
-        stcMDNSServiceTxts  m_Txts;
+        stcMDNSServiceTxts m_Txts;
 
         stcMDNS_RRAnswerTXT(const stcMDNS_RRHeader& p_Header,
                             uint32_t p_u32TTL);
@@ -909,10 +907,10 @@ class MDNSResponder
     */
     struct stcMDNS_RRAnswerSRV : public stcMDNS_RRAnswer
     {
-        uint16_t            m_u16Priority;
-        uint16_t            m_u16Weight;
-        uint16_t            m_u16Port;
-        stcMDNS_RRDomain    m_SRVDomain;
+        uint16_t m_u16Priority;
+        uint16_t m_u16Weight;
+        uint16_t m_u16Port;
+        stcMDNS_RRDomain m_SRVDomain;
 
         stcMDNS_RRAnswerSRV(const stcMDNS_RRHeader& p_Header,
                             uint32_t p_u32TTL);
@@ -926,8 +924,8 @@ class MDNSResponder
     */
     struct stcMDNS_RRAnswerGeneric : public stcMDNS_RRAnswer
     {
-        uint16_t            m_u16RDLength;  // Length of variable answer
-        uint8_t*            m_pu8RDData;    // Offset of start of variable answer in packet
+        uint16_t m_u16RDLength;  // Length of variable answer
+        uint8_t* m_pu8RDData;    // Offset of start of variable answer in packet
 
         stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
                                 uint32_t p_u32TTL);
@@ -936,7 +934,6 @@ class MDNSResponder
         bool clear(void);
     };
 
-
     /**
         enuProbingStatus
     */
@@ -953,36 +950,35 @@ class MDNSResponder
     */
     struct stcProbeInformation
     {
-        enuProbingStatus                  m_ProbingStatus;
-        uint8_t                           m_u8SentCount;  // Used for probes and announcements
-        esp8266::polledTimeout::oneShotMs m_Timeout;      // Used for probes and announcements
+        enuProbingStatus m_ProbingStatus;
+        uint8_t m_u8SentCount;                        // Used for probes and announcements
+        esp8266::polledTimeout::oneShotMs m_Timeout;  // Used for probes and announcements
         //clsMDNSTimeFlag                   m_TimeFlag;     // Used for probes and announcements
-        bool                              m_bConflict;
-        bool                              m_bTiebreakNeeded;
-        MDNSHostProbeFn   				m_fnHostProbeResultCallback;
-        MDNSServiceProbeFn 				m_fnServiceProbeResultCallback;
+        bool m_bConflict;
+        bool m_bTiebreakNeeded;
+        MDNSHostProbeFn m_fnHostProbeResultCallback;
+        MDNSServiceProbeFn m_fnServiceProbeResultCallback;
 
         stcProbeInformation(void);
 
         bool clear(bool p_bClearUserdata = false);
     };
 
-
     /**
         stcMDNSService
     */
     struct stcMDNSService
     {
-        stcMDNSService*                 m_pNext;
-        char*                           m_pcName;
-        bool                            m_bAutoName;    // Name was set automatically to hostname (if no name was supplied)
-        char*                           m_pcService;
-        char*                           m_pcProtocol;
-        uint16_t                        m_u16Port;
-        uint8_t                         m_u8ReplyMask;
-        stcMDNSServiceTxts              m_Txts;
+        stcMDNSService* m_pNext;
+        char* m_pcName;
+        bool m_bAutoName;  // Name was set automatically to hostname (if no name was supplied)
+        char* m_pcService;
+        char* m_pcProtocol;
+        uint16_t m_u16Port;
+        uint8_t m_u8ReplyMask;
+        stcMDNSServiceTxts m_Txts;
         MDNSDynamicServiceTxtCallbackFunc m_fnTxtCallback;
-        stcProbeInformation             m_ProbeInformation;
+        stcProbeInformation m_ProbeInformation;
 
         stcMDNSService(const char* p_pcName = 0,
                        const char* p_pcService = 0,
@@ -1021,14 +1017,14 @@ class MDNSResponder
                 /**
                     TIMEOUTLEVELs
                 */
-                const timeoutLevel_t    TIMEOUTLEVEL_UNSET      = 0;
-                const timeoutLevel_t    TIMEOUTLEVEL_BASE       = 80;
-                const timeoutLevel_t    TIMEOUTLEVEL_INTERVAL   = 5;
-                const timeoutLevel_t    TIMEOUTLEVEL_FINAL      = 100;
+                const timeoutLevel_t TIMEOUTLEVEL_UNSET = 0;
+                const timeoutLevel_t TIMEOUTLEVEL_BASE = 80;
+                const timeoutLevel_t TIMEOUTLEVEL_INTERVAL = 5;
+                const timeoutLevel_t TIMEOUTLEVEL_FINAL = 100;
 
-                uint32_t                          m_u32TTL;
+                uint32_t m_u32TTL;
                 esp8266::polledTimeout::oneShotMs m_TTLTimeout;
-                timeoutLevel_t                    m_timeoutLevel;
+                timeoutLevel_t m_timeoutLevel;
 
                 using timeoutBase = decltype(m_TTLTimeout);
 
@@ -1049,9 +1045,9 @@ class MDNSResponder
             */
             struct stcIP4Address
             {
-                stcIP4Address*  m_pNext;
-                IPAddress       m_IPAddress;
-                stcTTL          m_TTL;
+                stcIP4Address* m_pNext;
+                IPAddress m_IPAddress;
+                stcTTL m_TTL;
 
                 stcIP4Address(IPAddress p_IPAddress,
                               uint32_t p_u32TTL = 0);
@@ -1063,35 +1059,35 @@ class MDNSResponder
             */
             struct stcIP6Address
             {
-                stcIP6Address*  m_pNext;
-                IP6Address      m_IPAddress;
-                stcTTL          m_TTL;
+                stcIP6Address* m_pNext;
+                IP6Address m_IPAddress;
+                stcTTL m_TTL;
 
                 stcIP6Address(IPAddress p_IPAddress,
                               uint32_t p_u32TTL = 0);
             };
 #endif
 
-            stcAnswer*          m_pNext;
+            stcAnswer* m_pNext;
             // The service domain is the first 'answer' (from PTR answer, using service and protocol) to be set
             // Defines the key for additional answer, like host domain, etc.
-            stcMDNS_RRDomain    m_ServiceDomain;    // 1. level answer (PTR), eg. MyESP._http._tcp.local
-            char*               m_pcServiceDomain;
-            stcTTL              m_TTLServiceDomain;
-            stcMDNS_RRDomain    m_HostDomain;       // 2. level answer (SRV, using service domain), eg. esp8266.local
-            char*               m_pcHostDomain;
-            uint16_t            m_u16Port;          // 2. level answer (SRV, using service domain), eg. 5000
-            stcTTL              m_TTLHostDomainAndPort;
-            stcMDNSServiceTxts  m_Txts;             // 2. level answer (TXT, using service domain), eg. c#=1
-            char*               m_pcTxts;
-            stcTTL              m_TTLTxts;
+            stcMDNS_RRDomain m_ServiceDomain;  // 1. level answer (PTR), eg. MyESP._http._tcp.local
+            char* m_pcServiceDomain;
+            stcTTL m_TTLServiceDomain;
+            stcMDNS_RRDomain m_HostDomain;  // 2. level answer (SRV, using service domain), eg. esp8266.local
+            char* m_pcHostDomain;
+            uint16_t m_u16Port;  // 2. level answer (SRV, using service domain), eg. 5000
+            stcTTL m_TTLHostDomainAndPort;
+            stcMDNSServiceTxts m_Txts;  // 2. level answer (TXT, using service domain), eg. c#=1
+            char* m_pcTxts;
+            stcTTL m_TTLTxts;
 #ifdef MDNS_IP4_SUPPORT
-            stcIP4Address*      m_pIP4Addresses;    // 3. level answer (A, using host domain), eg. 123.456.789.012
+            stcIP4Address* m_pIP4Addresses;  // 3. level answer (A, using host domain), eg. 123.456.789.012
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            stcIP6Address*      m_pIP6Addresses;    // 3. level answer (AAAA, using host domain), eg. 1234::09
+            stcIP6Address* m_pIP6Addresses;  // 3. level answer (AAAA, using host domain), eg. 1234::09
 #endif
-            uint32_t            m_u32ContentFlags;
+            uint32_t m_u32ContentFlags;
 
             stcAnswer(void);
             ~stcAnswer(void);
@@ -1129,14 +1125,14 @@ class MDNSResponder
 #endif
         };
 
-        stcMDNSServiceQuery*              m_pNext;
-        stcMDNS_RRDomain                  m_ServiceTypeDomain;    // eg. _http._tcp.local
-        MDNSServiceQueryCallbackFunc      m_fnCallback;
-        bool                              m_bLegacyQuery;
-        uint8_t                           m_u8SentCount;
+        stcMDNSServiceQuery* m_pNext;
+        stcMDNS_RRDomain m_ServiceTypeDomain;  // eg. _http._tcp.local
+        MDNSServiceQueryCallbackFunc m_fnCallback;
+        bool m_bLegacyQuery;
+        uint8_t m_u8SentCount;
         esp8266::polledTimeout::oneShotMs m_ResendTimeout;
-        bool                              m_bAwaitingAnswers;
-        stcAnswer*                        m_pAnswers;
+        bool m_bAwaitingAnswers;
+        stcAnswer* m_pAnswers;
 
         stcMDNSServiceQuery(void);
         ~stcMDNSServiceQuery(void);
@@ -1160,34 +1156,34 @@ class MDNSResponder
     */
     struct stcMDNSSendParameter
     {
-    protected:
+       protected:
         /**
             stcDomainCacheItem
         */
         struct stcDomainCacheItem
         {
-            stcDomainCacheItem*     m_pNext;
-            const void*             m_pHostnameOrService;   // Opaque id for host or service domain (pointer)
-            bool                    m_bAdditionalData;      // Opaque flag for special info (service domain included)
-            uint16_t                m_u16Offset;            // Offset in UDP output buffer
+            stcDomainCacheItem* m_pNext;
+            const void* m_pHostnameOrService;  // Opaque id for host or service domain (pointer)
+            bool m_bAdditionalData;            // Opaque flag for special info (service domain included)
+            uint16_t m_u16Offset;              // Offset in UDP output buffer
 
             stcDomainCacheItem(const void* p_pHostnameOrService,
                                bool p_bAdditionalData,
                                uint32_t p_u16Offset);
         };
 
-    public:
-        uint16_t                m_u16ID;                    // Query ID (used only in lagacy queries)
-        stcMDNS_RRQuestion*     m_pQuestions;               // A list of queries
-        uint8_t                 m_u8HostReplyMask;          // Flags for reply components/answers
-        bool                    m_bLegacyQuery;             // Flag: Legacy query
-        bool                    m_bResponse;                // Flag: Response to a query
-        bool                    m_bAuthorative;             // Flag: Authoritative (owner) response
-        bool                    m_bCacheFlush;              // Flag: Clients should flush their caches
-        bool                    m_bUnicast;                 // Flag: Unicast response
-        bool                    m_bUnannounce;              // Flag: Unannounce service
-        uint16_t                m_u16Offset;                // Current offset in UDP write buffer (mainly for domain cache)
-        stcDomainCacheItem*     m_pDomainCacheItems;        // Cached host and service domains
+       public:
+        uint16_t m_u16ID;                         // Query ID (used only in lagacy queries)
+        stcMDNS_RRQuestion* m_pQuestions;         // A list of queries
+        uint8_t m_u8HostReplyMask;                // Flags for reply components/answers
+        bool m_bLegacyQuery;                      // Flag: Legacy query
+        bool m_bResponse;                         // Flag: Response to a query
+        bool m_bAuthorative;                      // Flag: Authoritative (owner) response
+        bool m_bCacheFlush;                       // Flag: Clients should flush their caches
+        bool m_bUnicast;                          // Flag: Unicast response
+        bool m_bUnannounce;                       // Flag: Unannounce service
+        uint16_t m_u16Offset;                     // Current offset in UDP write buffer (mainly for domain cache)
+        stcDomainCacheItem* m_pDomainCacheItems;  // Cached host and service domains
 
         stcMDNSSendParameter(void);
         ~stcMDNSSendParameter(void);
@@ -1205,12 +1201,12 @@ class MDNSResponder
     };
 
     // Instance variables
-    stcMDNSService*                 m_pServices;
-    UdpContext*                     m_pUDPContext;
-    char*                           m_pcHostname;
-    stcMDNSServiceQuery*            m_pServiceQueries;
+    stcMDNSService* m_pServices;
+    UdpContext* m_pUDPContext;
+    char* m_pcHostname;
+    stcMDNSServiceQuery* m_pServiceQueries;
     MDNSDynamicServiceTxtCallbackFunc m_fnServiceTxtCallback;
-    stcProbeInformation             m_HostProbeInformation;
+    stcProbeInformation m_HostProbeInformation;
 
     /** CONTROL **/
     /* MAINTENANCE */
@@ -1397,7 +1393,7 @@ class MDNSResponder
     stcMDNSServiceQuery* _findLegacyServiceQuery(void);
     bool _releaseServiceQueries(void);
     stcMDNSServiceQuery* _findNextServiceQueryByServiceType(const stcMDNS_RRDomain& p_ServiceDomain,
-            const stcMDNSServiceQuery* p_pPrevServiceQuery);
+                                                            const stcMDNSServiceQuery* p_pPrevServiceQuery);
 
     /* HOSTNAME */
     bool _setHostname(const char* p_pcHostname);
@@ -1456,8 +1452,8 @@ class MDNSResponder
 #endif
 };
 
-}// namespace MDNSImplementation
+}  // namespace MDNSImplementation
 
-}// namespace esp8266
+}  // namespace esp8266
 
-#endif // MDNS_H
+#endif  // MDNS_H
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
index bf1b1cde26..54f31c998b 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
@@ -22,24 +22,25 @@
 
 */
 
-#include <sys/time.h>
-#include <IPAddress.h>
 #include <AddrList.h>
-#include <lwip/ip_addr.h>
+#include <IPAddress.h>
 #include <WString.h>
+#include <lwip/ip_addr.h>
+#include <sys/time.h>
 #include <cstdint>
 
 /*
     ESP8266mDNS Control.cpp
 */
 
-extern "C" {
+extern "C"
+{
 #include "user_interface.h"
 }
 
 #include "ESP8266mDNS.h"
-#include "LEAmDNS_lwIPdefs.h"
 #include "LEAmDNS_Priv.h"
+#include "LEAmDNS_lwIPdefs.h"
 
 namespace esp8266
 {
@@ -48,12 +49,10 @@ namespace esp8266
 */
 namespace MDNSImplementation
 {
-
 /**
     CONTROL
 */
 
-
 /**
     MAINTENANCE
 */
@@ -68,16 +67,13 @@ namespace MDNSImplementation
 */
 bool MDNSResponder::_process(bool p_bUserContext)
 {
-
-    bool    bResult = true;
+    bool bResult = true;
 
     if (!p_bUserContext)
     {
-
-        if ((m_pUDPContext) &&          // UDPContext available AND
-                (m_pUDPContext->next()))    // has content
+        if ((m_pUDPContext) &&        // UDPContext available AND
+            (m_pUDPContext->next()))  // has content
         {
-
             //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _update: Calling _parseMessage\n")););
             bResult = _parseMessage();
             //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parsePacket %s\n"), (bResult ? "succeeded" : "FAILED")););
@@ -85,8 +81,8 @@ bool MDNSResponder::_process(bool p_bUserContext)
     }
     else
     {
-        bResult =  _updateProbeStatus() &&              // Probing
-                   _checkServiceQueryCache();           // Service query cache check
+        bResult = _updateProbeStatus() &&     // Probing
+                  _checkServiceQueryCache();  // Service query cache check
     }
     return bResult;
 }
@@ -96,9 +92,8 @@ bool MDNSResponder::_process(bool p_bUserContext)
 */
 bool MDNSResponder::_restart(void)
 {
-
-    return ((_resetProbeStatus(true/*restart*/)) &&  // Stop and restart probing
-            (_allocUDPContext()));                   // Restart UDP
+    return ((_resetProbeStatus(true /*restart*/)) &&  // Stop and restart probing
+            (_allocUDPContext()));                    // Restart UDP
 }
 
 /**
@@ -111,27 +106,26 @@ bool MDNSResponder::_restart(void)
 bool MDNSResponder::_parseMessage(void)
 {
     DEBUG_EX_INFO(
-        unsigned long   ulStartTime = millis();
-        unsigned        uStartMemory = ESP.getFreeHeap();
+        unsigned long ulStartTime = millis();
+        unsigned uStartMemory = ESP.getFreeHeap();
         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage (Time: %lu ms, heap: %u bytes, from %s(%u), to %s(%u))\n"), ulStartTime, uStartMemory,
                               IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), m_pUDPContext->getRemotePort(),
-                              IPAddress(m_pUDPContext->getDestAddress()).toString().c_str(), m_pUDPContext->getLocalPort());
-    );
+                              IPAddress(m_pUDPContext->getDestAddress()).toString().c_str(), m_pUDPContext->getLocalPort()););
     //DEBUG_EX_INFO(_udpDump(););
 
-    bool    bResult = false;
+    bool bResult = false;
 
-    stcMDNS_MsgHeader   header;
+    stcMDNS_MsgHeader header;
     if (_readMDNSMsgHeader(header))
     {
-        if (0 == header.m_4bOpcode)     // A standard query
+        if (0 == header.m_4bOpcode)  // A standard query
         {
-            if (header.m_1bQR)          // Received a response -> answers to a query
+            if (header.m_1bQR)  // Received a response -> answers to a query
             {
                 //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading answers: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
                 bResult = _parseResponse(header);
             }
-            else                        // Received a query (Questions)
+            else  // Received a query (Questions)
             {
                 //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading query: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
                 bResult = _parseQuery(header);
@@ -149,9 +143,8 @@ bool MDNSResponder::_parseMessage(void)
         m_pUDPContext->flush();
     }
     DEBUG_EX_INFO(
-        unsigned    uFreeHeap = ESP.getFreeHeap();
-        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Done (%s after %lu ms, ate %i bytes, remaining %u)\n\n"), (bResult ? "Succeeded" : "FAILED"), (millis() - ulStartTime), (uStartMemory - uFreeHeap), uFreeHeap);
-    );
+        unsigned uFreeHeap = ESP.getFreeHeap();
+        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Done (%s after %lu ms, ate %i bytes, remaining %u)\n\n"), (bResult ? "Succeeded" : "FAILED"), (millis() - ulStartTime), (uStartMemory - uFreeHeap), uFreeHeap););
     return bResult;
 }
 
@@ -174,33 +167,31 @@ bool MDNSResponder::_parseMessage(void)
 */
 bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
 {
+    bool bResult = true;
 
-    bool    bResult = true;
-
-    stcMDNSSendParameter    sendParameter;
-    uint8_t                 u8HostOrServiceReplies = 0;
+    stcMDNSSendParameter sendParameter;
+    uint8_t u8HostOrServiceReplies = 0;
     for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
     {
-
-        stcMDNS_RRQuestion  questionRR;
+        stcMDNS_RRQuestion questionRR;
         if ((bResult = _readRRQuestion(questionRR)))
         {
             // Define host replies, BUT only answer queries after probing is done
             u8HostOrServiceReplies =
                 sendParameter.m_u8HostReplyMask |= (((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus))
-                                                    ? _replyMaskForHost(questionRR.m_Header, 0)
-                                                    : 0);
+                                                        ? _replyMaskForHost(questionRR.m_Header, 0)
+                                                        : 0);
             DEBUG_EX_INFO(if (u8HostOrServiceReplies)
-        {
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Host reply needed 0x%X\n"), u8HostOrServiceReplies);
-            });
+                          {
+                              DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Host reply needed 0x%X\n"), u8HostOrServiceReplies);
+                          });
 
             // Check tiebreak need for host domain
             if (ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus)
             {
-                bool    bFullNameMatch = false;
+                bool bFullNameMatch = false;
                 if ((_replyMaskForHost(questionRR.m_Header, &bFullNameMatch)) &&
-                        (bFullNameMatch))
+                    (bFullNameMatch))
                 {
                     // We're in 'probing' state and someone is asking for our host domain: this might be
                     // a race-condition: Two host with the same domain names try simutanously to probe their domains
@@ -217,26 +208,26 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
             {
                 // Define service replies, BUT only answer queries after probing is done
                 uint8_t u8ReplyMaskForQuestion = (((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus))
-                                                  ? _replyMaskForService(questionRR.m_Header, *pService, 0)
-                                                  : 0);
+                                                      ? _replyMaskForService(questionRR.m_Header, *pService, 0)
+                                                      : 0);
                 u8HostOrServiceReplies |= (pService->m_u8ReplyMask |= u8ReplyMaskForQuestion);
                 DEBUG_EX_INFO(if (u8ReplyMaskForQuestion)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service reply needed for (%s.%s.%s): 0x%X (%s)\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol, u8ReplyMaskForQuestion, IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str());
-                });
+                              {
+                                  DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service reply needed for (%s.%s.%s): 0x%X (%s)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, u8ReplyMaskForQuestion, IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str());
+                              });
 
                 // Check tiebreak need for service domain
                 if (ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus)
                 {
-                    bool    bFullNameMatch = false;
+                    bool bFullNameMatch = false;
                     if ((_replyMaskForService(questionRR.m_Header, *pService, &bFullNameMatch)) &&
-                            (bFullNameMatch))
+                        (bFullNameMatch))
                     {
                         // We're in 'probing' state and someone is asking for this service domain: this might be
                         // a race-condition: Two services with the same domain names try simutanously to probe their domains
                         // See: RFC 6762, 8.2 (Tiebraking)
                         // However, we're using a max. reduced approach for tiebreaking here: The 'higher' SRV host wins!
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for service domain %s.%s.%s detected while probing.\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for service domain %s.%s.%s detected while probing.\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
 
                         pService->m_ProbeInformation.m_bTiebreakNeeded = true;
                     }
@@ -245,31 +236,29 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
 
             // Handle unicast and legacy specialities
             // If only one question asks for unicast reply, the whole reply packet is send unicast
-            if (((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) ||     // Unicast (maybe legacy) query OR
-                    (questionRR.m_bUnicast)) &&                                // Expressivly unicast query
-                    (!sendParameter.m_bUnicast))
+            if (((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) ||  // Unicast (maybe legacy) query OR
+                 (questionRR.m_bUnicast)) &&                             // Expressivly unicast query
+                (!sendParameter.m_bUnicast))
             {
-
                 sendParameter.m_bUnicast = true;
                 sendParameter.m_bCacheFlush = false;
                 DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Unicast response for %s!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
 
                 if ((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) &&  // Unicast (maybe legacy) query AND
-                        (1 == p_MsgHeader.m_u16QDCount) &&                          // Only one question AND
-                        ((sendParameter.m_u8HostReplyMask) ||                       //  Host replies OR
-                         (u8HostOrServiceReplies)))                                 //  Host or service replies available
+                    (1 == p_MsgHeader.m_u16QDCount) &&                      // Only one question AND
+                    ((sendParameter.m_u8HostReplyMask) ||                   //  Host replies OR
+                     (u8HostOrServiceReplies)))                             //  Host or service replies available
                 {
                     // We're a match for this legacy query, BUT
                     // make sure, that the query comes from a local host
                     ip_info IPInfo_Local;
                     ip_info IPInfo_Remote;
                     if (((IPInfo_Remote.ip.addr = m_pUDPContext->getRemoteAddress())) &&
-                            (((wifi_get_ip_info(SOFTAP_IF, &IPInfo_Local)) &&
-                              (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask))) ||  // Remote IP in SOFTAP's subnet OR
-                             ((wifi_get_ip_info(STATION_IF, &IPInfo_Local)) &&
-                              (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask)))))   // Remote IP in STATION's subnet
+                        (((wifi_get_ip_info(SOFTAP_IF, &IPInfo_Local)) &&
+                          (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask))) ||  // Remote IP in SOFTAP's subnet OR
+                         ((wifi_get_ip_info(STATION_IF, &IPInfo_Local)) &&
+                          (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask)))))  // Remote IP in STATION's subnet
                     {
-
                         DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from local host %s, id %u!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), p_MsgHeader.m_u16ID););
 
                         sendParameter.m_u16ID = p_MsgHeader.m_u16ID;
@@ -298,40 +287,37 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
         {
             DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read question!\n")););
         }
-    }   // for questions
+    }  // for questions
 
     //DEBUG_EX_INFO(if (u8HostOrServiceReplies) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Reply needed: %u (%s: %s->%s)\n"), u8HostOrServiceReplies, clsTimeSyncer::timestr(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), IPAddress(m_pUDPContext->getDestAddress()).toString().c_str()); } );
 
     // Handle known answers
-    uint32_t    u32Answers = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
+    uint32_t u32Answers = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
     DEBUG_EX_INFO(if ((u8HostOrServiceReplies) && (u32Answers))
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Known answers(%u):\n"), u32Answers);
-    });
+                  {
+                      DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Known answers(%u):\n"), u32Answers);
+                  });
 
     for (uint32_t an = 0; ((bResult) && (an < u32Answers)); ++an)
     {
-        stcMDNS_RRAnswer*   pKnownRRAnswer = 0;
+        stcMDNS_RRAnswer* pKnownRRAnswer = 0;
         if (((bResult = _readRRAnswer(pKnownRRAnswer))) &&
-                (pKnownRRAnswer))
+            (pKnownRRAnswer))
         {
-
-            if ((DNS_RRTYPE_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Type) &&      // No ANY type answer
-                    (DNS_RRCLASS_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Class))      // No ANY class answer
+            if ((DNS_RRTYPE_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Type) &&  // No ANY type answer
+                (DNS_RRCLASS_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Class))  // No ANY class answer
             {
-
                 // Find match between planned answer (sendParameter.m_u8HostReplyMask) and this 'known answer'
                 uint8_t u8HostMatchMask = (sendParameter.m_u8HostReplyMask & _replyMaskForHost(pKnownRRAnswer->m_Header));
-                if ((u8HostMatchMask) &&                                            // The RR in the known answer matches an RR we are planning to send, AND
-                        ((MDNS_HOST_TTL / 2) <= pKnownRRAnswer->m_u32TTL))              // The TTL of the known answer is longer than half of the new host TTL (120s)
+                if ((u8HostMatchMask) &&                                // The RR in the known answer matches an RR we are planning to send, AND
+                    ((MDNS_HOST_TTL / 2) <= pKnownRRAnswer->m_u32TTL))  // The TTL of the known answer is longer than half of the new host TTL (120s)
                 {
-
                     // Compare contents
                     if (AnswerType_PTR == pKnownRRAnswer->answerType())
                     {
-                        stcMDNS_RRDomain    hostDomain;
+                        stcMDNS_RRDomain hostDomain;
                         if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                                (((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain == hostDomain))
+                            (((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain == hostDomain))
                         {
                             // Host domain match
 #ifdef MDNS_IP4_SUPPORT
@@ -357,11 +343,11 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
                         // IP4 address was asked for
 #ifdef MDNS_IP4_SUPPORT
                         if ((AnswerType_A == pKnownRRAnswer->answerType()) &&
-                                (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == m_pUDPContext->getInputNetif()->ip_addr))
+                            (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == m_pUDPContext->getInputNetif()->ip_addr))
                         {
                             DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 address already known... skipping!\n")););
                             sendParameter.m_u8HostReplyMask &= ~ContentFlag_A;
-                        }   // else: RData NOT IP4 length !!
+                        }  // else: RData NOT IP4 length !!
 #endif
                     }
                     else if (u8HostMatchMask & ContentFlag_AAAA)
@@ -369,29 +355,27 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
                         // IP6 address was asked for
 #ifdef MDNS_IP6_SUPPORT
                         if ((AnswerType_AAAA == pAnswerRR->answerType()) &&
-                                (((stcMDNS_RRAnswerAAAA*)pAnswerRR)->m_IPAddress == _getResponseMulticastInterface()))
+                            (((stcMDNS_RRAnswerAAAA*)pAnswerRR)->m_IPAddress == _getResponseMulticastInterface()))
                         {
-
                             DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 address already known... skipping!\n")););
                             sendParameter.m_u8HostReplyMask &= ~ContentFlag_AAAA;
-                        }   // else: RData NOT IP6 length !!
+                        }  // else: RData NOT IP6 length !!
 #endif
                     }
-                }   // Host match /*and TTL*/
+                }  // Host match /*and TTL*/
 
                 //
                 // Check host tiebreak possibility
                 if (m_HostProbeInformation.m_bTiebreakNeeded)
                 {
-                    stcMDNS_RRDomain    hostDomain;
+                    stcMDNS_RRDomain hostDomain;
                     if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                            (pKnownRRAnswer->m_Header.m_Domain == hostDomain))
+                        (pKnownRRAnswer->m_Header.m_Domain == hostDomain))
                     {
                         // Host domain match
 #ifdef MDNS_IP4_SUPPORT
                         if (AnswerType_A == pKnownRRAnswer->answerType())
                         {
-
                             IPAddress localIPAddress(m_pUDPContext->getInputNetif()->ip_addr);
                             if (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == localIPAddress)
                             {
@@ -401,14 +385,14 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
                             }
                             else
                             {
-                                if ((uint32_t)(((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress) > (uint32_t)localIPAddress)   // The OTHER IP is 'higher' -> LOST
+                                if ((uint32_t)(((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress) > (uint32_t)localIPAddress)  // The OTHER IP is 'higher' -> LOST
                                 {
                                     // LOST tiebreak
                                     DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) LOST (lower)!\n")););
                                     _cancelProbingForHost();
                                     m_HostProbeInformation.m_bTiebreakNeeded = false;
                                 }
-                                else    // WON tiebreak
+                                else  // WON tiebreak
                                 {
                                     //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
                                     DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (higher IP)!\n")););
@@ -424,31 +408,29 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
                         }
 #endif
                     }
-                }   // Host tiebreak possibility
+                }  // Host tiebreak possibility
 
                 // Check service answers
                 for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
                 {
-
                     uint8_t u8ServiceMatchMask = (pService->m_u8ReplyMask & _replyMaskForService(pKnownRRAnswer->m_Header, *pService));
 
-                    if ((u8ServiceMatchMask) &&                                 // The RR in the known answer matches an RR we are planning to send, AND
-                            ((MDNS_SERVICE_TTL / 2) <= pKnownRRAnswer->m_u32TTL))   // The TTL of the known answer is longer than half of the new service TTL (4500s)
+                    if ((u8ServiceMatchMask) &&                                // The RR in the known answer matches an RR we are planning to send, AND
+                        ((MDNS_SERVICE_TTL / 2) <= pKnownRRAnswer->m_u32TTL))  // The TTL of the known answer is longer than half of the new service TTL (4500s)
                     {
-
                         if (AnswerType_PTR == pKnownRRAnswer->answerType())
                         {
-                            stcMDNS_RRDomain    serviceDomain;
+                            stcMDNS_RRDomain serviceDomain;
                             if ((u8ServiceMatchMask & ContentFlag_PTR_TYPE) &&
-                                    (_buildDomainForService(*pService, false, serviceDomain)) &&
-                                    (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
+                                (_buildDomainForService(*pService, false, serviceDomain)) &&
+                                (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
                             {
                                 DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service type PTR already known... skipping!\n")););
                                 pService->m_u8ReplyMask &= ~ContentFlag_PTR_TYPE;
                             }
                             if ((u8ServiceMatchMask & ContentFlag_PTR_NAME) &&
-                                    (_buildDomainForService(*pService, true, serviceDomain)) &&
-                                    (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
+                                (_buildDomainForService(*pService, true, serviceDomain)) &&
+                                (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
                             {
                                 DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service name PTR already known... skipping!\n")););
                                 pService->m_u8ReplyMask &= ~ContentFlag_PTR_NAME;
@@ -457,19 +439,17 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
                         else if (u8ServiceMatchMask & ContentFlag_SRV)
                         {
                             DEBUG_EX_ERR(if (AnswerType_SRV != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (SRV)!\n")););
-                            stcMDNS_RRDomain    hostDomain;
+                            stcMDNS_RRDomain hostDomain;
                             if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                                    (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))    // Host domain match
+                                (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))  // Host domain match
                             {
-
                                 if ((MDNS_SRV_PRIORITY == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Priority) &&
-                                        (MDNS_SRV_WEIGHT == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Weight) &&
-                                        (pService->m_u16Port == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Port))
+                                    (MDNS_SRV_WEIGHT == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Weight) &&
+                                    (pService->m_u16Port == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Port))
                                 {
-
                                     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service SRV answer already known... skipping!\n")););
                                     pService->m_u8ReplyMask &= ~ContentFlag_SRV;
-                                }   // else: Small differences -> send update message
+                                }  // else: Small differences -> send update message
                             }
                         }
                         else if (u8ServiceMatchMask & ContentFlag_TXT)
@@ -483,38 +463,37 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
                             }
                             _releaseTempServiceTxts(*pService);
                         }
-                    }   // Service match and enough TTL
+                    }  // Service match and enough TTL
 
                     //
                     // Check service tiebreak possibility
                     if (pService->m_ProbeInformation.m_bTiebreakNeeded)
                     {
-                        stcMDNS_RRDomain    serviceDomain;
+                        stcMDNS_RRDomain serviceDomain;
                         if ((_buildDomainForService(*pService, true, serviceDomain)) &&
-                                (pKnownRRAnswer->m_Header.m_Domain == serviceDomain))
+                            (pKnownRRAnswer->m_Header.m_Domain == serviceDomain))
                         {
                             // Service domain match
                             if (AnswerType_SRV == pKnownRRAnswer->answerType())
                             {
-                                stcMDNS_RRDomain    hostDomain;
+                                stcMDNS_RRDomain hostDomain;
                                 if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                                        (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))    // Host domain match
+                                    (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))  // Host domain match
                                 {
-
                                     // We've received an old message from ourselves (same SRV)
                                     DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (was an old message)!\n")););
                                     pService->m_ProbeInformation.m_bTiebreakNeeded = false;
                                 }
                                 else
                                 {
-                                    if (((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain > hostDomain)   // The OTHER domain is 'higher' -> LOST
+                                    if (((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain > hostDomain)  // The OTHER domain is 'higher' -> LOST
                                     {
                                         // LOST tiebreak
                                         DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) LOST (lower)!\n")););
                                         _cancelProbingForService(*pService);
                                         pService->m_ProbeInformation.m_bTiebreakNeeded = false;
                                     }
-                                    else    // WON tiebreak
+                                    else  // WON tiebreak
                                     {
                                         //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
                                         DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (higher)!\n")););
@@ -523,9 +502,9 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
                                 }
                             }
                         }
-                    }   // service tiebreak possibility
-                }   // for services
-            }   // ANY answers
+                    }  // service tiebreak possibility
+                }      // for services
+            }          // ANY answers
         }
         else
         {
@@ -537,7 +516,7 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
             delete pKnownRRAnswer;
             pKnownRRAnswer = 0;
         }
-    }   // for answers
+    }  // for answers
 
     if (bResult)
     {
@@ -559,10 +538,9 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
         }
         DEBUG_EX_INFO(
             else
-        {
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: No reply needed\n"));
-        }
-        );
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: No reply needed\n"));
+            });
     }
     else
     {
@@ -581,14 +559,14 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
     {
         if (pService->m_ProbeInformation.m_bTiebreakNeeded)
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for service domain (%s.%s.%s)\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for service domain (%s.%s.%s)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
             pService->m_ProbeInformation.m_bTiebreakNeeded = false;
         }
     }
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -624,13 +602,12 @@ bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_Msg
     //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse\n")););
     //DEBUG_EX_INFO(_udpDump(););
 
-    bool    bResult = false;
+    bool bResult = false;
 
     // A response should be the result of a query or a probe
-    if ((_hasServiceQueriesWaitingForAnswers()) ||          // Waiting for query answers OR
-            (_hasProbesWaitingForAnswers()))                    // Probe responses
+    if ((_hasServiceQueriesWaitingForAnswers()) ||  // Waiting for query answers OR
+        (_hasProbesWaitingForAnswers()))            // Probe responses
     {
-
         DEBUG_EX_INFO(
             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response\n"));
             //_udpDump();
@@ -639,22 +616,22 @@ bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_Msg
         bResult = true;
         //
         // Ignore questions here
-        stcMDNS_RRQuestion  dummyRRQ;
+        stcMDNS_RRQuestion dummyRRQ;
         for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
         {
             DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response containing a question... ignoring!\n")););
             bResult = _readRRQuestion(dummyRRQ);
-        }   // for queries
+        }  // for queries
 
         //
         // Read and collect answers
-        stcMDNS_RRAnswer*   pCollectedRRAnswers = 0;
-        uint32_t            u32NumberOfAnswerRRs = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
+        stcMDNS_RRAnswer* pCollectedRRAnswers = 0;
+        uint32_t u32NumberOfAnswerRRs = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
         for (uint32_t an = 0; ((bResult) && (an < u32NumberOfAnswerRRs)); ++an)
         {
-            stcMDNS_RRAnswer*   pRRAnswer = 0;
+            stcMDNS_RRAnswer* pRRAnswer = 0;
             if (((bResult = _readRRAnswer(pRRAnswer))) &&
-                    (pRRAnswer))
+                (pRRAnswer))
             {
                 //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: ADDING answer!\n")););
                 pRRAnswer->m_pNext = pCollectedRRAnswers;
@@ -670,7 +647,7 @@ bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_Msg
                 }
                 bResult = false;
             }
-        }   // for answers
+        }  // for answers
 
         //
         // Process answers
@@ -679,7 +656,7 @@ bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_Msg
             bResult = ((!pCollectedRRAnswers) ||
                        (_processAnswers(pCollectedRRAnswers)));
         }
-        else    // Some failure while reading answers
+        else  // Some failure while reading answers
         {
             DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answers!\n")););
             m_pUDPContext->flush();
@@ -689,12 +666,12 @@ bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_Msg
         while (pCollectedRRAnswers)
         {
             //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: DELETING answer!\n")););
-            stcMDNS_RRAnswer*   pNextAnswer = pCollectedRRAnswers->m_pNext;
+            stcMDNS_RRAnswer* pNextAnswer = pCollectedRRAnswers->m_pNext;
             delete pCollectedRRAnswers;
             pCollectedRRAnswers = pNextAnswer;
         }
     }
-    else    // Received an unexpected response -> ignore
+    else  // Received an unexpected response -> ignore
     {
         /*  DEBUG_EX_INFO(
                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received an unexpected response... ignoring!\nDUMP:\n"));
@@ -720,9 +697,9 @@ bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_Msg
         bResult = true;
     }
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -742,8 +719,7 @@ bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_Msg
 */
 bool MDNSResponder::_processAnswers(const MDNSResponder::stcMDNS_RRAnswer* p_pAnswers)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if (p_pAnswers)
     {
@@ -752,27 +728,27 @@ bool MDNSResponder::_processAnswers(const MDNSResponder::stcMDNS_RRAnswer* p_pAn
 
         // Answers may arrive in an unexpected order. So we loop our answers as long, as we
         // can connect new information to service queries
-        bool    bFoundNewKeyAnswer;
+        bool bFoundNewKeyAnswer;
         do
         {
             bFoundNewKeyAnswer = false;
 
             const stcMDNS_RRAnswer* pRRAnswer = p_pAnswers;
             while ((pRRAnswer) &&
-                    (bResult))
+                   (bResult))
             {
                 // 1. level answer (PTR)
                 if (AnswerType_PTR == pRRAnswer->answerType())
                 {
                     // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
-                    bResult = _processPTRAnswer((stcMDNS_RRAnswerPTR*)pRRAnswer, bFoundNewKeyAnswer);   // May 'enable' new SRV or TXT answers to be linked to queries
+                    bResult = _processPTRAnswer((stcMDNS_RRAnswerPTR*)pRRAnswer, bFoundNewKeyAnswer);  // May 'enable' new SRV or TXT answers to be linked to queries
                 }
                 // 2. level answers
                 // SRV -> host domain and port
                 else if (AnswerType_SRV == pRRAnswer->answerType())
                 {
                     // eg. MyESP_http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
-                    bResult = _processSRVAnswer((stcMDNS_RRAnswerSRV*)pRRAnswer, bFoundNewKeyAnswer);   // May 'enable' new A/AAAA answers to be linked to queries
+                    bResult = _processSRVAnswer((stcMDNS_RRAnswerSRV*)pRRAnswer, bFoundNewKeyAnswer);  // May 'enable' new A/AAAA answers to be linked to queries
                 }
                 // TXT -> Txts
                 else if (AnswerType_TXT == pRRAnswer->answerType())
@@ -801,15 +777,13 @@ bool MDNSResponder::_processAnswers(const MDNSResponder::stcMDNS_RRAnswer* p_pAn
                 // Finally check for probing conflicts
                 // Host domain
                 if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&
-                        ((AnswerType_A == pRRAnswer->answerType()) ||
-                         (AnswerType_AAAA == pRRAnswer->answerType())))
+                    ((AnswerType_A == pRRAnswer->answerType()) ||
+                     (AnswerType_AAAA == pRRAnswer->answerType())))
                 {
-
-                    stcMDNS_RRDomain    hostDomain;
+                    stcMDNS_RRDomain hostDomain;
                     if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                            (pRRAnswer->m_Header.m_Domain == hostDomain))
+                        (pRRAnswer->m_Header.m_Domain == hostDomain))
                     {
-
                         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.local\n"), m_pcHostname););
                         _cancelProbingForHost();
                     }
@@ -818,30 +792,28 @@ bool MDNSResponder::_processAnswers(const MDNSResponder::stcMDNS_RRAnswer* p_pAn
                 for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
                 {
                     if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&
-                            ((AnswerType_TXT == pRRAnswer->answerType()) ||
-                             (AnswerType_SRV == pRRAnswer->answerType())))
+                        ((AnswerType_TXT == pRRAnswer->answerType()) ||
+                         (AnswerType_SRV == pRRAnswer->answerType())))
                     {
-
-                        stcMDNS_RRDomain    serviceDomain;
+                        stcMDNS_RRDomain serviceDomain;
                         if ((_buildDomainForService(*pService, true, serviceDomain)) &&
-                                (pRRAnswer->m_Header.m_Domain == serviceDomain))
+                            (pRRAnswer->m_Header.m_Domain == serviceDomain))
                         {
-
-                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.%s.%s\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.%s.%s\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
                             _cancelProbingForService(*pService);
                         }
                     }
                 }
 
-                pRRAnswer = pRRAnswer->m_pNext; // Next collected answer
-            }   // while (answers)
+                pRRAnswer = pRRAnswer->m_pNext;  // Next collected answer
+            }                                    // while (answers)
         } while ((bFoundNewKeyAnswer) &&
                  (bResult));
-    }   // else: No answers provided
+    }  // else: No answers provided
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -851,8 +823,7 @@ bool MDNSResponder::_processAnswers(const MDNSResponder::stcMDNS_RRAnswer* p_pAn
 bool MDNSResponder::_processPTRAnswer(const MDNSResponder::stcMDNS_RRAnswerPTR* p_pPTRAnswer,
                                       bool& p_rbFoundNewKeyAnswer)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if ((bResult = (0 != p_pPTRAnswer)))
     {
@@ -860,36 +831,34 @@ bool MDNSResponder::_processPTRAnswer(const MDNSResponder::stcMDNS_RRAnswerPTR*
         // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
         // Check pending service queries for eg. '_http._tcp'
 
-        stcMDNSServiceQuery*    pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, 0);
+        stcMDNSServiceQuery* pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, 0);
         while (pServiceQuery)
         {
             if (pServiceQuery->m_bAwaitingAnswers)
             {
                 // Find answer for service domain (eg. MyESP._http._tcp.local)
                 stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pPTRAnswer->m_PTRDomain);
-                if (pSQAnswer)      // existing answer
+                if (pSQAnswer)  // existing answer
                 {
-                    if (p_pPTRAnswer->m_u32TTL)     // Received update message
+                    if (p_pPTRAnswer->m_u32TTL)  // Received update message
                     {
-                        pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);    // Update TTL tag
+                        pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);  // Update TTL tag
                         DEBUG_EX_INFO(
                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Updated TTL(%d) for "), (int)p_pPTRAnswer->m_u32TTL);
                             _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                        );
+                            DEBUG_OUTPUT.printf_P(PSTR("\n")););
                     }
-                    else                            // received goodbye-message
+                    else  // received goodbye-message
                     {
-                        pSQAnswer->m_TTLServiceDomain.prepareDeletion();    // Prepare answer deletion according to RFC 6762, 10.1
+                        pSQAnswer->m_TTLServiceDomain.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
                         DEBUG_EX_INFO(
                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: 'Goodbye' received for "));
                             _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                        );
+                            DEBUG_OUTPUT.printf_P(PSTR("\n")););
                     }
                 }
-                else if ((p_pPTRAnswer->m_u32TTL) &&                                // Not just a goodbye-message
-                         ((pSQAnswer = new stcMDNSServiceQuery::stcAnswer)))        // Not yet included -> add answer
+                else if ((p_pPTRAnswer->m_u32TTL) &&                          // Not just a goodbye-message
+                         ((pSQAnswer = new stcMDNSServiceQuery::stcAnswer)))  // Not yet included -> add answer
                 {
                     pSQAnswer->m_ServiceDomain = p_pPTRAnswer->m_PTRDomain;
                     pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_ServiceDomain;
@@ -907,11 +876,11 @@ bool MDNSResponder::_processPTRAnswer(const MDNSResponder::stcMDNS_RRAnswerPTR*
             }
             pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, pServiceQuery);
         }
-    }   // else: No p_pPTRAnswer
+    }  // else: No p_pPTRAnswer
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -921,32 +890,29 @@ bool MDNSResponder::_processPTRAnswer(const MDNSResponder::stcMDNS_RRAnswerPTR*
 bool MDNSResponder::_processSRVAnswer(const MDNSResponder::stcMDNS_RRAnswerSRV* p_pSRVAnswer,
                                       bool& p_rbFoundNewKeyAnswer)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if ((bResult = (0 != p_pSRVAnswer)))
     {
         // eg. MyESP._http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
 
-        stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
+        stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
         while (pServiceQuery)
         {
             stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pSRVAnswer->m_Header.m_Domain);
-            if (pSQAnswer)      // Answer for this service domain (eg. MyESP._http._tcp.local) available
+            if (pSQAnswer)  // Answer for this service domain (eg. MyESP._http._tcp.local) available
             {
-                if (p_pSRVAnswer->m_u32TTL)     // First or update message (TTL != 0)
+                if (p_pSRVAnswer->m_u32TTL)  // First or update message (TTL != 0)
                 {
-                    pSQAnswer->m_TTLHostDomainAndPort.set(p_pSRVAnswer->m_u32TTL);    // Update TTL tag
+                    pSQAnswer->m_TTLHostDomainAndPort.set(p_pSRVAnswer->m_u32TTL);  // Update TTL tag
                     DEBUG_EX_INFO(
                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: Updated TTL(%d) for "), (int)p_pSRVAnswer->m_u32TTL);
                         _printRRDomain(pSQAnswer->m_ServiceDomain);
-                        DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
-                    );
+                        DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")););
                     // Host domain & Port
                     if ((pSQAnswer->m_HostDomain != p_pSRVAnswer->m_SRVDomain) ||
-                            (pSQAnswer->m_u16Port != p_pSRVAnswer->m_u16Port))
+                        (pSQAnswer->m_u16Port != p_pSRVAnswer->m_u16Port))
                     {
-
                         pSQAnswer->m_HostDomain = p_pSRVAnswer->m_SRVDomain;
                         pSQAnswer->releaseHostDomain();
                         pSQAnswer->m_u16Port = p_pSRVAnswer->m_u16Port;
@@ -960,23 +926,22 @@ bool MDNSResponder::_processSRVAnswer(const MDNSResponder::stcMDNS_RRAnswerSRV*
                         }
                     }
                 }
-                else                        // Goodby message
+                else  // Goodby message
                 {
-                    pSQAnswer->m_TTLHostDomainAndPort.prepareDeletion();    // Prepare answer deletion according to RFC 6762, 10.1
+                    pSQAnswer->m_TTLHostDomainAndPort.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
                     DEBUG_EX_INFO(
                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: 'Goodbye' received for "));
                         _printRRDomain(pSQAnswer->m_ServiceDomain);
-                        DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
-                    );
+                        DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")););
                 }
             }
             pServiceQuery = pServiceQuery->m_pNext;
-        }   // while(service query)
-    }   // else: No p_pSRVAnswer
+        }  // while(service query)
+    }      // else: No p_pSRVAnswer
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -985,27 +950,25 @@ bool MDNSResponder::_processSRVAnswer(const MDNSResponder::stcMDNS_RRAnswerSRV*
 */
 bool MDNSResponder::_processTXTAnswer(const MDNSResponder::stcMDNS_RRAnswerTXT* p_pTXTAnswer)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if ((bResult = (0 != p_pTXTAnswer)))
     {
         // eg. MyESP._http._tcp.local TXT xxxx xx c#=1
 
-        stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
+        stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
         while (pServiceQuery)
         {
             stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pTXTAnswer->m_Header.m_Domain);
-            if (pSQAnswer)      // Answer for this service domain (eg. MyESP._http._tcp.local) available
+            if (pSQAnswer)  // Answer for this service domain (eg. MyESP._http._tcp.local) available
             {
-                if (p_pTXTAnswer->m_u32TTL)     // First or update message
+                if (p_pTXTAnswer->m_u32TTL)  // First or update message
                 {
-                    pSQAnswer->m_TTLTxts.set(p_pTXTAnswer->m_u32TTL); // Update TTL tag
+                    pSQAnswer->m_TTLTxts.set(p_pTXTAnswer->m_u32TTL);  // Update TTL tag
                     DEBUG_EX_INFO(
                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: Updated TTL(%d) for "), (int)p_pTXTAnswer->m_u32TTL);
                         _printRRDomain(pSQAnswer->m_ServiceDomain);
-                        DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
-                    );
+                        DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")););
                     if (!pSQAnswer->m_Txts.compare(p_pTXTAnswer->m_Txts))
                     {
                         pSQAnswer->m_Txts = p_pTXTAnswer->m_Txts;
@@ -1019,23 +982,22 @@ bool MDNSResponder::_processTXTAnswer(const MDNSResponder::stcMDNS_RRAnswerTXT*
                         }
                     }
                 }
-                else                        // Goodby message
+                else  // Goodby message
                 {
-                    pSQAnswer->m_TTLTxts.prepareDeletion(); // Prepare answer deletion according to RFC 6762, 10.1
+                    pSQAnswer->m_TTLTxts.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
                     DEBUG_EX_INFO(
                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: 'Goodbye' received for "));
                         _printRRDomain(pSQAnswer->m_ServiceDomain);
-                        DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
-                    );
+                        DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")););
                 }
             }
             pServiceQuery = pServiceQuery->m_pNext;
-        }   // while(service query)
-    }   // else: No p_pTXTAnswer
+        }  // while(service query)
+    }      // else: No p_pTXTAnswer
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -1045,52 +1007,48 @@ bool MDNSResponder::_processTXTAnswer(const MDNSResponder::stcMDNS_RRAnswerTXT*
 */
 bool MDNSResponder::_processAAnswer(const MDNSResponder::stcMDNS_RRAnswerA* p_pAAnswer)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if ((bResult = (0 != p_pAAnswer)))
     {
         // eg. esp8266.local A xxxx xx 192.168.2.120
 
-        stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
+        stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
         while (pServiceQuery)
         {
             stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAnswer->m_Header.m_Domain);
-            if (pSQAnswer)      // Answer for this host domain (eg. esp8266.local) available
+            if (pSQAnswer)  // Answer for this host domain (eg. esp8266.local) available
             {
-                stcMDNSServiceQuery::stcAnswer::stcIP4Address*  pIP4Address = pSQAnswer->findIP4Address(p_pAAnswer->m_IPAddress);
+                stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = pSQAnswer->findIP4Address(p_pAAnswer->m_IPAddress);
                 if (pIP4Address)
                 {
                     // Already known IP4 address
-                    if (p_pAAnswer->m_u32TTL)   // Valid TTL -> Update answers TTL
+                    if (p_pAAnswer->m_u32TTL)  // Valid TTL -> Update answers TTL
                     {
                         pIP4Address->m_TTL.set(p_pAAnswer->m_u32TTL);
                         DEBUG_EX_INFO(
                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%d) for "), (int)p_pAAnswer->m_u32TTL);
                             _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" IP4Address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str());
-                        );
+                            DEBUG_OUTPUT.printf_P(PSTR(" IP4Address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str()););
                     }
-                    else                        // 'Goodbye' message for known IP4 address
+                    else  // 'Goodbye' message for known IP4 address
                     {
-                        pIP4Address->m_TTL.prepareDeletion();   // Prepare answer deletion according to RFC 6762, 10.1
+                        pIP4Address->m_TTL.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
                         DEBUG_EX_INFO(
                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
                             _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str());
-                        );
+                            DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str()););
                     }
                 }
                 else
                 {
                     // Until now unknown IP4 address -> Add (if the message isn't just a 'Goodbye' note)
-                    if (p_pAAnswer->m_u32TTL)   // NOT just a 'Goodbye' message
+                    if (p_pAAnswer->m_u32TTL)  // NOT just a 'Goodbye' message
                     {
                         pIP4Address = new stcMDNSServiceQuery::stcAnswer::stcIP4Address(p_pAAnswer->m_IPAddress, p_pAAnswer->m_u32TTL);
                         if ((pIP4Address) &&
-                                (pSQAnswer->addIP4Address(pIP4Address)))
+                            (pSQAnswer->addIP4Address(pIP4Address)))
                         {
-
                             pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
                             if (pServiceQuery->m_fnCallback)
                             {
@@ -1106,12 +1064,12 @@ bool MDNSResponder::_processAAnswer(const MDNSResponder::stcMDNS_RRAnswerA* p_pA
                 }
             }
             pServiceQuery = pServiceQuery->m_pNext;
-        }   // while(service query)
-    }   // else: No p_pAAnswer
+        }  // while(service query)
+    }      // else: No p_pAAnswer
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED!\n"));
+                 });
     return bResult;
 }
 #endif
@@ -1122,52 +1080,48 @@ bool MDNSResponder::_processAAnswer(const MDNSResponder::stcMDNS_RRAnswerA* p_pA
 */
 bool MDNSResponder::_processAAAAAnswer(const MDNSResponder::stcMDNS_RRAnswerAAAA* p_pAAAAAnswer)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if ((bResult = (0 != p_pAAAAAnswer)))
     {
         // eg. esp8266.local AAAA xxxx xx 0bf3::0c
 
-        stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
+        stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
         while (pServiceQuery)
         {
             stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAAAAnswer->m_Header.m_Domain);
-            if (pSQAnswer)      // Answer for this host domain (eg. esp8266.local) available
+            if (pSQAnswer)  // Answer for this host domain (eg. esp8266.local) available
             {
-                stcIP6Address*  pIP6Address = pSQAnswer->findIP6Address(p_pAAAAAnswer->m_IPAddress);
+                stcIP6Address* pIP6Address = pSQAnswer->findIP6Address(p_pAAAAAnswer->m_IPAddress);
                 if (pIP6Address)
                 {
                     // Already known IP6 address
-                    if (p_pAAAAAnswer->m_u32TTL)   // Valid TTL -> Update answers TTL
+                    if (p_pAAAAAnswer->m_u32TTL)  // Valid TTL -> Update answers TTL
                     {
                         pIP6Address->m_TTL.set(p_pAAAAAnswer->m_u32TTL);
                         DEBUG_EX_INFO(
                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%lu) for "), p_pAAAAAnswer->m_u32TTL);
                             _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str());
-                        );
+                            DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str()););
                     }
-                    else                        // 'Goodbye' message for known IP6 address
+                    else  // 'Goodbye' message for known IP6 address
                     {
-                        pIP6Address->m_TTL.prepareDeletion();   // Prepare answer deletion according to RFC 6762, 10.1
+                        pIP6Address->m_TTL.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
                         DEBUG_EX_INFO(
                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
                             _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str());
-                        );
+                            DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str()););
                     }
                 }
                 else
                 {
                     // Until now unknown IP6 address -> Add (if the message isn't just a 'Goodbye' note)
-                    if (p_pAAAAAnswer->m_u32TTL)   // NOT just a 'Goodbye' message
+                    if (p_pAAAAAnswer->m_u32TTL)  // NOT just a 'Goodbye' message
                     {
                         pIP6Address = new stcIP6Address(p_pAAAAAnswer->m_IPAddress, p_pAAAAAnswer->m_u32TTL);
                         if ((pIP6Address) &&
-                                (pSQAnswer->addIP6Address(pIP6Address)))
+                            (pSQAnswer->addIP6Address(pIP6Address)))
                         {
-
                             pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP6Address;
 
                             if (pServiceQuery->m_fnCallback)
@@ -1183,14 +1137,13 @@ bool MDNSResponder::_processAAAAAnswer(const MDNSResponder::stcMDNS_RRAnswerAAAA
                 }
             }
             pServiceQuery = pServiceQuery->m_pNext;
-        }   // while(service query)
-    }   // else: No p_pAAAAAnswer
+        }  // while(service query)
+    }      // else: No p_pAAAAAnswer
 
     return bResult;
 }
 #endif
 
-
 /*
     PROBING
 */
@@ -1209,8 +1162,7 @@ bool MDNSResponder::_processAAAAAnswer(const MDNSResponder::stcMDNS_RRAnswerAAAA
 */
 bool MDNSResponder::_updateProbeStatus(void)
 {
-
-    bool    bResult = true;
+    bool bResult = true;
 
     //
     // Probe host domain
@@ -1222,11 +1174,10 @@ bool MDNSResponder::_updateProbeStatus(void)
         m_HostProbeInformation.m_Timeout.reset(rand() % MDNS_PROBE_DELAY);
         m_HostProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
     }
-    else if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&                // Probing AND
-             (m_HostProbeInformation.m_Timeout.expired()))                                          // Time for next probe
+    else if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing AND
+             (m_HostProbeInformation.m_Timeout.expired()))                            // Time for next probe
     {
-
-        if (MDNS_PROBE_COUNT > m_HostProbeInformation.m_u8SentCount)                                // Send next probe
+        if (MDNS_PROBE_COUNT > m_HostProbeInformation.m_u8SentCount)  // Send next probe
         {
             if ((bResult = _sendHostProbe()))
             {
@@ -1235,7 +1186,7 @@ bool MDNSResponder::_updateProbeStatus(void)
                 ++m_HostProbeInformation.m_u8SentCount;
             }
         }
-        else                                                                                        // Probing finished
+        else  // Probing finished
         {
             DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host probing.\n")););
             m_HostProbeInformation.m_ProbingStatus = ProbingStatus_Done;
@@ -1250,12 +1201,11 @@ bool MDNSResponder::_updateProbeStatus(void)
             m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
             DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared host announcing.\n\n")););
         }
-    }   // else: Probing already finished OR waiting for next time slot
+    }  // else: Probing already finished OR waiting for next time slot
     else if ((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus) &&
              (m_HostProbeInformation.m_Timeout.expired()))
     {
-
-        if ((bResult = _announce(true, false)))     // Don't announce services here
+        if ((bResult = _announce(true, false)))  // Don't announce services here
         {
             ++m_HostProbeInformation.m_u8SentCount;
 
@@ -1276,17 +1226,15 @@ bool MDNSResponder::_updateProbeStatus(void)
     // Probe services
     for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
     {
-        if (ProbingStatus_ReadyToStart == pService->m_ProbeInformation.m_ProbingStatus)         // Ready to get started
+        if (ProbingStatus_ReadyToStart == pService->m_ProbeInformation.m_ProbingStatus)  // Ready to get started
         {
-
-            pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);                     // More or equal than first probe for host domain
+            pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);  // More or equal than first probe for host domain
             pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
         }
         else if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing AND
-                 (pService->m_ProbeInformation.m_Timeout.expired()))               // Time for next probe
+                 (pService->m_ProbeInformation.m_Timeout.expired()))                            // Time for next probe
         {
-
-            if (MDNS_PROBE_COUNT > pService->m_ProbeInformation.m_u8SentCount)                  // Send next probe
+            if (MDNS_PROBE_COUNT > pService->m_ProbeInformation.m_u8SentCount)  // Send next probe
             {
                 if ((bResult = _sendServiceProbe(*pService)))
                 {
@@ -1295,9 +1243,9 @@ bool MDNSResponder::_updateProbeStatus(void)
                     ++pService->m_ProbeInformation.m_u8SentCount;
                 }
             }
-            else                                                                                        // Probing finished
+            else  // Probing finished
             {
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service probing %s.%s.%s\n\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service probing %s.%s.%s\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
                 pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_Done;
                 pService->m_ProbeInformation.m_Timeout.resetToNeverExpires();
                 if (pService->m_ProbeInformation.m_fnServiceProbeResultCallback)
@@ -1309,32 +1257,31 @@ bool MDNSResponder::_updateProbeStatus(void)
                 pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
                 DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared service announcing.\n\n")););
             }
-        }   // else: Probing already finished OR waiting for next time slot
+        }  // else: Probing already finished OR waiting for next time slot
         else if ((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus) &&
                  (pService->m_ProbeInformation.m_Timeout.expired()))
         {
-
-            if ((bResult = _announceService(*pService)))     // Announce service
+            if ((bResult = _announceService(*pService)))  // Announce service
             {
                 ++pService->m_ProbeInformation.m_u8SentCount;
 
                 if (MDNS_ANNOUNCE_COUNT > pService->m_ProbeInformation.m_u8SentCount)
                 {
                     pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing service %s.%s.%s (%d)\n\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_ProbeInformation.m_u8SentCount););
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing service %s.%s.%s (%d)\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_ProbeInformation.m_u8SentCount););
                 }
                 else
                 {
                     pService->m_ProbeInformation.m_Timeout.resetToNeverExpires();
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service announcing for %s.%s.%s\n\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service announcing for %s.%s.%s\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
                 }
             }
         }
     }
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: FAILED!\n\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: FAILED!\n\n"));
+                 });
     return bResult;
 }
 
@@ -1348,7 +1295,6 @@ bool MDNSResponder::_updateProbeStatus(void)
 */
 bool MDNSResponder::_resetProbeStatus(bool p_bRestart /*= true*/)
 {
-
     m_HostProbeInformation.clear(false);
     m_HostProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
 
@@ -1365,14 +1311,13 @@ bool MDNSResponder::_resetProbeStatus(bool p_bRestart /*= true*/)
 */
 bool MDNSResponder::_hasProbesWaitingForAnswers(void) const
 {
-
-    bool    bResult = ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&      // Probing
-                       (0 < m_HostProbeInformation.m_u8SentCount));                                 // And really probing
+    bool bResult = ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing
+                    (0 < m_HostProbeInformation.m_u8SentCount));                             // And really probing
 
     for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
     {
-        bResult = ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&    // Probing
-                   (0 < pService->m_ProbeInformation.m_u8SentCount));                               // And really probing
+        bResult = ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing
+                   (0 < pService->m_ProbeInformation.m_u8SentCount));                             // And really probing
     }
     return bResult;
 }
@@ -1392,27 +1337,26 @@ bool MDNSResponder::_sendHostProbe(void)
 {
     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe (%s, %lu)\n"), m_pcHostname, millis()););
 
-    bool    bResult = true;
+    bool bResult = true;
 
     // Requests for host domain
-    stcMDNSSendParameter    sendParameter;
-    sendParameter.m_bCacheFlush = false;    // RFC 6762 10.2
+    stcMDNSSendParameter sendParameter;
+    sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
 
     sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
     if (((bResult = (0 != sendParameter.m_pQuestions))) &&
-            ((bResult = _buildDomainForHost(m_pcHostname, sendParameter.m_pQuestions->m_Header.m_Domain))))
+        ((bResult = _buildDomainForHost(m_pcHostname, sendParameter.m_pQuestions->m_Header.m_Domain))))
     {
-
         //sendParameter.m_pQuestions->m_bUnicast = true;
         sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY;
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);   // Unicast & INternet
+        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
 
         // Add known answers
 #ifdef MDNS_IP4_SUPPORT
-        sendParameter.m_u8HostReplyMask |= ContentFlag_A;                                   // Add A answer
+        sendParameter.m_u8HostReplyMask |= ContentFlag_A;  // Add A answer
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;                                // Add AAAA answer
+        sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;  // Add AAAA answer
 #endif
     }
     else
@@ -1425,9 +1369,9 @@ bool MDNSResponder::_sendHostProbe(void)
         }
     }
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED!\n"));
+                 });
     return ((bResult) &&
             (_sendMDNSMessage(sendParameter)));
 }
@@ -1446,25 +1390,24 @@ bool MDNSResponder::_sendHostProbe(void)
 */
 bool MDNSResponder::_sendServiceProbe(stcMDNSService& p_rService)
 {
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe (%s.%s.%s, %lu)\n"), (p_rService.m_pcName ? : m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, millis()););
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe (%s.%s.%s, %lu)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, millis()););
 
-    bool    bResult = true;
+    bool bResult = true;
 
     // Requests for service instance domain
-    stcMDNSSendParameter    sendParameter;
-    sendParameter.m_bCacheFlush = false;    // RFC 6762 10.2
+    stcMDNSSendParameter sendParameter;
+    sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
 
     sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
     if (((bResult = (0 != sendParameter.m_pQuestions))) &&
-            ((bResult = _buildDomainForService(p_rService, true, sendParameter.m_pQuestions->m_Header.m_Domain))))
+        ((bResult = _buildDomainForService(p_rService, true, sendParameter.m_pQuestions->m_Header.m_Domain))))
     {
-
         sendParameter.m_pQuestions->m_bUnicast = true;
         sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY;
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);   // Unicast & INternet
+        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
 
         // Add known answers
-        p_rService.m_u8ReplyMask = (ContentFlag_SRV | ContentFlag_PTR_NAME);                // Add SRV and PTR NAME answers
+        p_rService.m_u8ReplyMask = (ContentFlag_SRV | ContentFlag_PTR_NAME);  // Add SRV and PTR NAME answers
     }
     else
     {
@@ -1476,9 +1419,9 @@ bool MDNSResponder::_sendServiceProbe(stcMDNSService& p_rService)
         }
     }
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED!\n"));
+                 });
     return ((bResult) &&
             (_sendMDNSMessage(sendParameter)));
 }
@@ -1488,8 +1431,7 @@ bool MDNSResponder::_sendServiceProbe(stcMDNSService& p_rService)
 */
 bool MDNSResponder::_cancelProbingForHost(void)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     m_HostProbeInformation.clear(false);
     // Send host notification
@@ -1512,8 +1454,7 @@ bool MDNSResponder::_cancelProbingForHost(void)
 */
 bool MDNSResponder::_cancelProbingForService(stcMDNSService& p_rService)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     p_rService.m_ProbeInformation.clear(false);
     // Send notification
@@ -1525,8 +1466,6 @@ bool MDNSResponder::_cancelProbingForService(stcMDNSService& p_rService)
     return bResult;
 }
 
-
-
 /**
     ANNOUNCING
 */
@@ -1551,28 +1490,26 @@ bool MDNSResponder::_cancelProbingForService(stcMDNSService& p_rService)
 bool MDNSResponder::_announce(bool p_bAnnounce,
                               bool p_bIncludeServices)
 {
+    bool bResult = false;
 
-    bool    bResult = false;
-
-    stcMDNSSendParameter    sendParameter;
+    stcMDNSSendParameter sendParameter;
     if (ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus)
     {
-
         bResult = true;
 
-        sendParameter.m_bResponse = true;           // Announces are 'Unsolicited authoritative responses'
+        sendParameter.m_bResponse = true;  // Announces are 'Unsolicited authoritative responses'
         sendParameter.m_bAuthorative = true;
-        sendParameter.m_bUnannounce = !p_bAnnounce; // When unannouncing, the TTL is set to '0' while creating the answers
+        sendParameter.m_bUnannounce = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
 
         // Announce host
         sendParameter.m_u8HostReplyMask = 0;
 #ifdef MDNS_IP4_SUPPORT
-        sendParameter.m_u8HostReplyMask |= ContentFlag_A;                   // A answer
-        sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP4;             // PTR_IP4 answer
+        sendParameter.m_u8HostReplyMask |= ContentFlag_A;        // A answer
+        sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP4;  // PTR_IP4 answer
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;                // AAAA answer
-        sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP6;             // PTR_IP6 answer
+        sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;     // AAAA answer
+        sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP6;  // PTR_IP6 answer
 #endif
 
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing host %s (content 0x%X)\n"), m_pcHostname, sendParameter.m_u8HostReplyMask););
@@ -1586,15 +1523,15 @@ bool MDNSResponder::_announce(bool p_bAnnounce,
                 {
                     pService->m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
 
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing service %s.%s.%s (content %u)\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_u8ReplyMask););
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing service %s.%s.%s (content %u)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_u8ReplyMask););
                 }
             }
         }
     }
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: FAILED!\n"));
+                 });
     return ((bResult) &&
             (_sendMDNSMessage(sendParameter)));
 }
@@ -1605,35 +1542,32 @@ bool MDNSResponder::_announce(bool p_bAnnounce,
 bool MDNSResponder::_announceService(stcMDNSService& p_rService,
                                      bool p_bAnnounce /*= true*/)
 {
+    bool bResult = false;
 
-    bool    bResult = false;
-
-    stcMDNSSendParameter    sendParameter;
+    stcMDNSSendParameter sendParameter;
     if (ProbingStatus_Done == p_rService.m_ProbeInformation.m_ProbingStatus)
     {
-
-        sendParameter.m_bResponse = true;           // Announces are 'Unsolicited authoritative responses'
+        sendParameter.m_bResponse = true;  // Announces are 'Unsolicited authoritative responses'
         sendParameter.m_bAuthorative = true;
-        sendParameter.m_bUnannounce = !p_bAnnounce; // When unannouncing, the TTL is set to '0' while creating the answers
+        sendParameter.m_bUnannounce = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
 
         // DON'T announce host
         sendParameter.m_u8HostReplyMask = 0;
 
         // Announce services (service type, name, SRV (location) and TXTs)
         p_rService.m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: Announcing service %s.%s.%s (content 0x%X)\n"), (p_rService.m_pcName ? : m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, p_rService.m_u8ReplyMask););
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: Announcing service %s.%s.%s (content 0x%X)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, p_rService.m_u8ReplyMask););
 
         bResult = true;
     }
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: FAILED!\n"));
+                 });
     return ((bResult) &&
             (_sendMDNSMessage(sendParameter)));
 }
 
-
 /**
     SERVICE QUERY CACHE
 */
@@ -1643,8 +1577,7 @@ bool MDNSResponder::_announceService(stcMDNSService& p_rService,
 */
 bool MDNSResponder::_hasServiceQueriesWaitingForAnswers(void) const
 {
-
-    bool    bOpenQueries = false;
+    bool bOpenQueries = false;
 
     for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; pServiceQuery; pServiceQuery = pServiceQuery->m_pNext)
     {
@@ -1668,33 +1601,28 @@ bool MDNSResponder::_hasServiceQueriesWaitingForAnswers(void) const
 */
 bool MDNSResponder::_checkServiceQueryCache(void)
 {
-
-    bool        bResult = true;
+    bool bResult = true;
 
     DEBUG_EX_INFO(
-        bool    printedInfo = false;
-    );
+        bool printedInfo = false;);
     for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; ((bResult) && (pServiceQuery)); pServiceQuery = pServiceQuery->m_pNext)
     {
-
         //
         // Resend dynamic service queries, if not already done often enough
         if ((!pServiceQuery->m_bLegacyQuery) &&
-                (MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount) &&
-                (pServiceQuery->m_ResendTimeout.expired()))
+            (MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount) &&
+            (pServiceQuery->m_ResendTimeout.expired()))
         {
-
             if ((bResult = _sendMDNSServiceQuery(*pServiceQuery)))
             {
                 ++pServiceQuery->m_u8SentCount;
                 pServiceQuery->m_ResendTimeout.reset((MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount)
-                                                     ? (MDNS_DYNAMIC_QUERY_RESEND_DELAY * (pServiceQuery->m_u8SentCount - 1))
-                                                     : esp8266::polledTimeout::oneShotMs::neverExpires);
+                                                         ? (MDNS_DYNAMIC_QUERY_RESEND_DELAY * (pServiceQuery->m_u8SentCount - 1))
+                                                         : esp8266::polledTimeout::oneShotMs::neverExpires);
             }
             DEBUG_EX_INFO(
                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: %s to resend service query!"), (bResult ? "Succeeded" : "FAILED"));
-                printedInfo = true;
-            );
+                printedInfo = true;);
         }
 
         //
@@ -1703,26 +1631,23 @@ bool MDNSResponder::_checkServiceQueryCache(void)
         {
             stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->m_pAnswers;
             while ((bResult) &&
-                    (pSQAnswer))
+                   (pSQAnswer))
             {
                 stcMDNSServiceQuery::stcAnswer* pNextSQAnswer = pSQAnswer->m_pNext;
 
                 // 1. level answer
                 if ((bResult) &&
-                        (pSQAnswer->m_TTLServiceDomain.flagged()))
+                    (pSQAnswer->m_TTLServiceDomain.flagged()))
                 {
-
                     if (!pSQAnswer->m_TTLServiceDomain.finalTimeoutLevel())
                     {
-
                         bResult = ((_sendMDNSServiceQuery(*pServiceQuery)) &&
                                    (pSQAnswer->m_TTLServiceDomain.restart()));
                         DEBUG_EX_INFO(
                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: PTR update scheduled for "));
                             _printRRDomain(pSQAnswer->m_ServiceDomain);
                             DEBUG_OUTPUT.printf_P(PSTR(" %s\n"), (bResult ? "OK" : "FAILURE"));
-                            printedInfo = true;
-                        );
+                            printedInfo = true;);
                     }
                     else
                     {
@@ -1736,32 +1661,28 @@ bool MDNSResponder::_checkServiceQueryCache(void)
                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove PTR answer for "));
                             _printRRDomain(pSQAnswer->m_ServiceDomain);
                             DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                            printedInfo = true;
-                        );
+                            printedInfo = true;);
 
                         bResult = pServiceQuery->removeAnswer(pSQAnswer);
                         pSQAnswer = 0;
-                        continue;   // Don't use this answer anymore
+                        continue;  // Don't use this answer anymore
                     }
-                }   // ServiceDomain flagged
+                }  // ServiceDomain flagged
 
                 // 2. level answers
                 // HostDomain & Port (from SRV)
                 if ((bResult) &&
-                        (pSQAnswer->m_TTLHostDomainAndPort.flagged()))
+                    (pSQAnswer->m_TTLHostDomainAndPort.flagged()))
                 {
-
                     if (!pSQAnswer->m_TTLHostDomainAndPort.finalTimeoutLevel())
                     {
-
                         bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_SRV)) &&
                                    (pSQAnswer->m_TTLHostDomainAndPort.restart()));
                         DEBUG_EX_INFO(
                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: SRV update scheduled for "));
                             _printRRDomain(pSQAnswer->m_ServiceDomain);
                             DEBUG_OUTPUT.printf_P(PSTR(" host domain and port %s\n"), (bResult ? "OK" : "FAILURE"));
-                            printedInfo = true;
-                        );
+                            printedInfo = true;);
                     }
                     else
                     {
@@ -1770,14 +1691,13 @@ bool MDNSResponder::_checkServiceQueryCache(void)
                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove SRV answer for "));
                             _printRRDomain(pSQAnswer->m_ServiceDomain);
                             DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
-                            printedInfo = true;
-                        );
+                            printedInfo = true;);
                         // Delete
                         pSQAnswer->m_HostDomain.clear();
                         pSQAnswer->releaseHostDomain();
                         pSQAnswer->m_u16Port = 0;
                         pSQAnswer->m_TTLHostDomainAndPort.set(0);
-                        uint32_t    u32ContentFlags = ServiceQueryAnswerType_HostDomainAndPort;
+                        uint32_t u32ContentFlags = ServiceQueryAnswerType_HostDomainAndPort;
                         // As the host domain is the base for the IP4- and IP6Address, remove these too
 #ifdef MDNS_IP4_SUPPORT
                         pSQAnswer->releaseIP4Addresses();
@@ -1796,24 +1716,21 @@ bool MDNSResponder::_checkServiceQueryCache(void)
                             pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(u32ContentFlags), false);
                         }
                     }
-                }   // HostDomainAndPort flagged
+                }  // HostDomainAndPort flagged
 
                 // Txts (from TXT)
                 if ((bResult) &&
-                        (pSQAnswer->m_TTLTxts.flagged()))
+                    (pSQAnswer->m_TTLTxts.flagged()))
                 {
-
                     if (!pSQAnswer->m_TTLTxts.finalTimeoutLevel())
                     {
-
                         bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_TXT)) &&
                                    (pSQAnswer->m_TTLTxts.restart()));
                         DEBUG_EX_INFO(
                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: TXT update scheduled for "));
                             _printRRDomain(pSQAnswer->m_ServiceDomain);
                             DEBUG_OUTPUT.printf_P(PSTR(" TXTs %s\n"), (bResult ? "OK" : "FAILURE"));
-                            printedInfo = true;
-                        );
+                            printedInfo = true;);
                     }
                     else
                     {
@@ -1822,8 +1739,7 @@ bool MDNSResponder::_checkServiceQueryCache(void)
                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove TXT answer for "));
                             _printRRDomain(pSQAnswer->m_ServiceDomain);
                             DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
-                            printedInfo = true;
-                        );
+                            printedInfo = true;);
                         // Delete
                         pSQAnswer->m_Txts.clear();
                         pSQAnswer->m_TTLTxts.set(0);
@@ -1837,29 +1753,25 @@ bool MDNSResponder::_checkServiceQueryCache(void)
                             pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), false);
                         }
                     }
-                }   // TXTs flagged
+                }  // TXTs flagged
 
                 // 3. level answers
 #ifdef MDNS_IP4_SUPPORT
                 // IP4Address (from A)
-                stcMDNSServiceQuery::stcAnswer::stcIP4Address*  pIP4Address = pSQAnswer->m_pIP4Addresses;
-                bool                                            bAUpdateQuerySent = false;
+                stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = pSQAnswer->m_pIP4Addresses;
+                bool bAUpdateQuerySent = false;
                 while ((pIP4Address) &&
-                        (bResult))
+                       (bResult))
                 {
-
-                    stcMDNSServiceQuery::stcAnswer::stcIP4Address*  pNextIP4Address = pIP4Address->m_pNext; // Get 'next' early, as 'current' may be deleted at the end...
+                    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pNextIP4Address = pIP4Address->m_pNext;  // Get 'next' early, as 'current' may be deleted at the end...
 
                     if (pIP4Address->m_TTL.flagged())
                     {
-
-                        if (!pIP4Address->m_TTL.finalTimeoutLevel())    // Needs update
+                        if (!pIP4Address->m_TTL.finalTimeoutLevel())  // Needs update
                         {
-
                             if ((bAUpdateQuerySent) ||
-                                    ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_A))))
+                                ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_A))))
                             {
-
                                 pIP4Address->m_TTL.restart();
                                 bAUpdateQuerySent = true;
 
@@ -1867,8 +1779,7 @@ bool MDNSResponder::_checkServiceQueryCache(void)
                                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP4 update scheduled for "));
                                     _printRRDomain(pSQAnswer->m_ServiceDomain);
                                     DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), (pIP4Address->m_IPAddress.toString().c_str()));
-                                    printedInfo = true;
-                                );
+                                    printedInfo = true;);
                             }
                         }
                         else
@@ -1878,10 +1789,9 @@ bool MDNSResponder::_checkServiceQueryCache(void)
                                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove IP4 answer for "));
                                 _printRRDomain(pSQAnswer->m_ServiceDomain);
                                 DEBUG_OUTPUT.printf_P(PSTR(" IP4 address\n"));
-                                printedInfo = true;
-                            );
+                                printedInfo = true;);
                             pSQAnswer->removeIP4Address(pIP4Address);
-                            if (!pSQAnswer->m_pIP4Addresses)    // NO IP4 address left -> remove content flag
+                            if (!pSQAnswer->m_pIP4Addresses)  // NO IP4 address left -> remove content flag
                             {
                                 pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP4Address;
                             }
@@ -1892,31 +1802,27 @@ bool MDNSResponder::_checkServiceQueryCache(void)
                                 pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), false);
                             }
                         }
-                    }   // IP4 flagged
+                    }  // IP4 flagged
 
                     pIP4Address = pNextIP4Address;  // Next
-                }   // while
+                }                                   // while
 #endif
 #ifdef MDNS_IP6_SUPPORT
                 // IP6Address (from AAAA)
-                stcMDNSServiceQuery::stcAnswer::stcIP6Address*  pIP6Address = pSQAnswer->m_pIP6Addresses;
-                bool                                            bAAAAUpdateQuerySent = false;
+                stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address = pSQAnswer->m_pIP6Addresses;
+                bool bAAAAUpdateQuerySent = false;
                 while ((pIP6Address) &&
-                        (bResult))
+                       (bResult))
                 {
-
-                    stcMDNSServiceQuery::stcAnswer::stcIP6Address*  pNextIP6Address = pIP6Address->m_pNext; // Get 'next' early, as 'current' may be deleted at the end...
+                    stcMDNSServiceQuery::stcAnswer::stcIP6Address* pNextIP6Address = pIP6Address->m_pNext;  // Get 'next' early, as 'current' may be deleted at the end...
 
                     if (pIP6Address->m_TTL.flagged())
                     {
-
-                        if (!pIP6Address->m_TTL.finalTimeoutLevel())    // Needs update
+                        if (!pIP6Address->m_TTL.finalTimeoutLevel())  // Needs update
                         {
-
                             if ((bAAAAUpdateQuerySent) ||
-                                    ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_AAAA))))
+                                ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_AAAA))))
                             {
-
                                 pIP6Address->m_TTL.restart();
                                 bAAAAUpdateQuerySent = true;
 
@@ -1924,8 +1830,7 @@ bool MDNSResponder::_checkServiceQueryCache(void)
                                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP6 update scheduled for "));
                                     _printRRDomain(pSQAnswer->m_ServiceDomain);
                                     DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), (pIP6Address->m_IPAddress.toString().c_str()));
-                                    printedInfo = true;
-                                );
+                                    printedInfo = true;);
                             }
                         }
                         else
@@ -1935,10 +1840,9 @@ bool MDNSResponder::_checkServiceQueryCache(void)
                                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove answer for "));
                                 _printRRDomain(pSQAnswer->m_ServiceDomain);
                                 DEBUG_OUTPUT.printf_P(PSTR(" IP6Address\n"));
-                                printedInfo = true;
-                            );
+                                printedInfo = true;);
                             pSQAnswer->removeIP6Address(pIP6Address);
-                            if (!pSQAnswer->m_pIP6Addresses)    // NO IP6 address left -> remove content flag
+                            if (!pSQAnswer->m_pIP6Addresses)  // NO IP6 address left -> remove content flag
                             {
                                 pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP6Address;
                             }
@@ -1948,10 +1852,10 @@ bool MDNSResponder::_checkServiceQueryCache(void)
                                 pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, false, pServiceQuery->m_pUserdata);
                             }
                         }
-                    }   // IP6 flagged
+                    }  // IP6 flagged
 
                     pIP6Address = pNextIP6Address;  // Next
-                }   // while
+                }                                   // while
 #endif
                 pSQAnswer = pNextSQAnswer;
             }
@@ -1959,18 +1863,16 @@ bool MDNSResponder::_checkServiceQueryCache(void)
     }
     DEBUG_EX_INFO(
         if (printedInfo)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("\n"));
-    }
-    );
+        {
+            DEBUG_OUTPUT.printf_P(PSTR("\n"));
+        });
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: FAILED!\n"));
+                 });
     return bResult;
 }
 
-
 /*
     MDNSResponder::_replyMaskForHost
 
@@ -1981,29 +1883,28 @@ bool MDNSResponder::_checkServiceQueryCache(void)
     In addition, a full name match (question domain == host domain) is marked.
 */
 uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
-        bool* p_pbFullNameMatch /*= 0*/) const
+                                         bool* p_pbFullNameMatch /*= 0*/) const
 {
     //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost\n")););
 
     uint8_t u8ReplyMask = 0;
-    (p_pbFullNameMatch ? *p_pbFullNameMatch = false : 0);
+    (p_pbFullNameMatch ? * p_pbFullNameMatch = false : 0);
 
     if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) ||
-            (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
+        (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
     {
-
         if ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) ||
-                (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+            (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
         {
             // PTR request
 #ifdef MDNS_IP4_SUPPORT
-            stcMDNS_RRDomain    reverseIP4Domain;
+            stcMDNS_RRDomain reverseIP4Domain;
             for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
             {
                 if (netif_is_up(pNetIf))
                 {
                     if ((_buildDomainForReverseIP4(pNetIf->ip_addr, reverseIP4Domain)) &&
-                            (p_RRHeader.m_Domain == reverseIP4Domain))
+                        (p_RRHeader.m_Domain == reverseIP4Domain))
                     {
                         // Reverse domain match
                         u8ReplyMask |= ContentFlag_PTR_IP4;
@@ -2014,18 +1915,17 @@ uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader&
 #ifdef MDNS_IP6_SUPPORT
             // TODO
 #endif
-        }   // Address qeuest
+        }  // Address qeuest
 
-        stcMDNS_RRDomain    hostDomain;
+        stcMDNS_RRDomain hostDomain;
         if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                (p_RRHeader.m_Domain == hostDomain))    // Host domain match
+            (p_RRHeader.m_Domain == hostDomain))  // Host domain match
         {
-
             (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
 
 #ifdef MDNS_IP4_SUPPORT
             if ((DNS_RRTYPE_A == p_RRHeader.m_Attributes.m_u16Type) ||
-                    (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
             {
                 // IP4 address request
                 u8ReplyMask |= ContentFlag_A;
@@ -2033,7 +1933,7 @@ uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader&
 #endif
 #ifdef MDNS_IP6_SUPPORT
             if ((DNS_RRTYPE_AAAA == p_RRHeader.m_Attributes.m_u16Type) ||
-                    (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
             {
                 // IP6 address request
                 u8ReplyMask |= ContentFlag_AAAA;
@@ -2046,9 +1946,9 @@ uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader&
         //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
     }
     DEBUG_EX_INFO(if (u8ReplyMask)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: 0x%X\n"), u8ReplyMask);
-    });
+                  {
+                      DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: 0x%X\n"), u8ReplyMask);
+                  });
     return u8ReplyMask;
 }
 
@@ -2065,51 +1965,48 @@ uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader&
     In addition, a full name match (question domain == service instance domain) is marked.
 */
 uint8_t MDNSResponder::_replyMaskForService(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
-        const MDNSResponder::stcMDNSService& p_Service,
-        bool* p_pbFullNameMatch /*= 0*/) const
+                                            const MDNSResponder::stcMDNSService& p_Service,
+                                            bool* p_pbFullNameMatch /*= 0*/) const
 {
-
     uint8_t u8ReplyMask = 0;
-    (p_pbFullNameMatch ? *p_pbFullNameMatch = false : 0);
+    (p_pbFullNameMatch ? * p_pbFullNameMatch = false : 0);
 
     if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) ||
-            (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
+        (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
     {
-
-        stcMDNS_RRDomain    DNSSDDomain;
-        if ((_buildDomainForDNSSD(DNSSDDomain)) &&                          // _services._dns-sd._udp.local
-                (p_RRHeader.m_Domain == DNSSDDomain) &&
-                ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) ||
-                 (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
+        stcMDNS_RRDomain DNSSDDomain;
+        if ((_buildDomainForDNSSD(DNSSDDomain)) &&  // _services._dns-sd._udp.local
+            (p_RRHeader.m_Domain == DNSSDDomain) &&
+            ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) ||
+             (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
         {
             // Common service info requested
             u8ReplyMask |= ContentFlag_PTR_TYPE;
         }
 
-        stcMDNS_RRDomain    serviceDomain;
-        if ((_buildDomainForService(p_Service, false, serviceDomain)) &&    // eg. _http._tcp.local
-                (p_RRHeader.m_Domain == serviceDomain) &&
-                ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) ||
-                 (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
+        stcMDNS_RRDomain serviceDomain;
+        if ((_buildDomainForService(p_Service, false, serviceDomain)) &&  // eg. _http._tcp.local
+            (p_RRHeader.m_Domain == serviceDomain) &&
+            ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) ||
+             (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
         {
             // Special service info requested
             u8ReplyMask |= ContentFlag_PTR_NAME;
         }
 
-        if ((_buildDomainForService(p_Service, true, serviceDomain)) &&     // eg. MyESP._http._tcp.local
-                (p_RRHeader.m_Domain == serviceDomain))
+        if ((_buildDomainForService(p_Service, true, serviceDomain)) &&  // eg. MyESP._http._tcp.local
+            (p_RRHeader.m_Domain == serviceDomain))
         {
-
             (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
 
             if ((DNS_RRTYPE_SRV == p_RRHeader.m_Attributes.m_u16Type) ||
-                    (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
             {
                 // Instance info SRV requested
                 u8ReplyMask |= ContentFlag_SRV;
             }
             if ((DNS_RRTYPE_TXT == p_RRHeader.m_Attributes.m_u16Type) ||
-                    (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
             {
                 // Instance info TXT requested
                 u8ReplyMask |= ContentFlag_TXT;
@@ -2121,12 +2018,12 @@ uint8_t MDNSResponder::_replyMaskForService(const MDNSResponder::stcMDNS_RRHeade
         //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
     }
     DEBUG_EX_INFO(if (u8ReplyMask)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService(%s.%s.%s): 0x%X\n"), p_Service.m_pcName, p_Service.m_pcService, p_Service.m_pcProtocol, u8ReplyMask);
-    });
+                  {
+                      DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService(%s.%s.%s): 0x%X\n"), p_Service.m_pcName, p_Service.m_pcService, p_Service.m_pcProtocol, u8ReplyMask);
+                  });
     return u8ReplyMask;
 }
 
-} // namespace MDNSImplementation
+}  // namespace MDNSImplementation
 
-} // namespace esp8266
+}  // namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
index d4014db993..7a7f3e5104 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
@@ -23,21 +23,19 @@
 */
 
 #include <lwip/igmp.h>
-#include <stdlib_noniso.h> // strrstr()
+#include <stdlib_noniso.h>  // strrstr()
 
 #include "ESP8266mDNS.h"
-#include "LEAmDNS_lwIPdefs.h"
 #include "LEAmDNS_Priv.h"
+#include "LEAmDNS_lwIPdefs.h"
 
 namespace esp8266
 {
-
 /*
     LEAmDNS
 */
 namespace MDNSImplementation
 {
-
 /**
     HELPERS
 */
@@ -55,31 +53,29 @@ namespace MDNSImplementation
 
 */
 /*static*/ bool MDNSResponder::indexDomain(char*& p_rpcDomain,
-        const char* p_pcDivider /*= "-"*/,
-        const char* p_pcDefaultDomain /*= 0*/)
+                                           const char* p_pcDivider /*= "-"*/,
+                                           const char* p_pcDefaultDomain /*= 0*/)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     // Ensure a divider exists; use '-' as default
-    const char*   pcDivider = (p_pcDivider ? : "-");
+    const char* pcDivider = (p_pcDivider ?: "-");
 
     if (p_rpcDomain)
     {
         const char* pFoundDivider = strrstr(p_rpcDomain, pcDivider);
-        if (pFoundDivider)      // maybe already extended
+        if (pFoundDivider)  // maybe already extended
         {
-            char*         pEnd = 0;
+            char* pEnd = 0;
             unsigned long ulIndex = strtoul((pFoundDivider + strlen(pcDivider)), &pEnd, 10);
             if ((ulIndex) &&
-                    ((pEnd - p_rpcDomain) == (ptrdiff_t)strlen(p_rpcDomain)) &&
-                    (!*pEnd))         // Valid (old) index found
+                ((pEnd - p_rpcDomain) == (ptrdiff_t)strlen(p_rpcDomain)) &&
+                (!*pEnd))  // Valid (old) index found
             {
-
-                char    acIndexBuffer[16];
+                char acIndexBuffer[16];
                 sprintf(acIndexBuffer, "%lu", (++ulIndex));
-                size_t  stLength = ((pFoundDivider - p_rpcDomain + strlen(pcDivider)) + strlen(acIndexBuffer) + 1);
-                char*   pNewHostname = new char[stLength];
+                size_t stLength = ((pFoundDivider - p_rpcDomain + strlen(pcDivider)) + strlen(acIndexBuffer) + 1);
+                char* pNewHostname = new char[stLength];
                 if (pNewHostname)
                 {
                     memcpy(pNewHostname, p_rpcDomain, (pFoundDivider - p_rpcDomain + strlen(pcDivider)));
@@ -102,10 +98,10 @@ namespace MDNSImplementation
             }
         }
 
-        if (!pFoundDivider)     // not yet extended (or failed to increment extension) -> start indexing
+        if (!pFoundDivider)  // not yet extended (or failed to increment extension) -> start indexing
         {
-            size_t    stLength = strlen(p_rpcDomain) + (strlen(pcDivider) + 1 + 1);   // Name + Divider + '2' + '\0'
-            char*     pNewHostname = new char[stLength];
+            size_t stLength = strlen(p_rpcDomain) + (strlen(pcDivider) + 1 + 1);  // Name + Divider + '2' + '\0'
+            char* pNewHostname = new char[stLength];
             if (pNewHostname)
             {
                 sprintf(pNewHostname, "%s%s2", p_rpcDomain, pcDivider);
@@ -124,9 +120,9 @@ namespace MDNSImplementation
     else
     {
         // No given host domain, use base or default
-        const char* cpcDefaultName = (p_pcDefaultDomain ? : "esp8266");
+        const char* cpcDefaultName = (p_pcDefaultDomain ?: "esp8266");
 
-        size_t      stLength = strlen(cpcDefaultName) + 1;   // '\0'
+        size_t stLength = strlen(cpcDefaultName) + 1;  // '\0'
         p_rpcDomain = new char[stLength];
         if (p_rpcDomain)
         {
@@ -142,7 +138,6 @@ namespace MDNSImplementation
     return bResult;
 }
 
-
 /*
     UDP CONTEXT
 */
@@ -192,7 +187,6 @@ bool MDNSResponder::_allocUDPContext(void)
 */
 bool MDNSResponder::_releaseUDPContext(void)
 {
-
     if (m_pUDPContext)
     {
         m_pUDPContext->unref();
@@ -202,7 +196,6 @@ bool MDNSResponder::_releaseUDPContext(void)
     return true;
 }
 
-
 /*
     SERVICE QUERY
 */
@@ -212,8 +205,7 @@ bool MDNSResponder::_releaseUDPContext(void)
 */
 MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_allocServiceQuery(void)
 {
-
-    stcMDNSServiceQuery*    pServiceQuery = new stcMDNSServiceQuery;
+    stcMDNSServiceQuery* pServiceQuery = new stcMDNSServiceQuery;
     if (pServiceQuery)
     {
         // Link to query list
@@ -228,14 +220,13 @@ MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_allocServiceQuery(void)
 */
 bool MDNSResponder::_removeServiceQuery(MDNSResponder::stcMDNSServiceQuery* p_pServiceQuery)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if (p_pServiceQuery)
     {
-        stcMDNSServiceQuery*    pPred = m_pServiceQueries;
+        stcMDNSServiceQuery* pPred = m_pServiceQueries;
         while ((pPred) &&
-                (pPred->m_pNext != p_pServiceQuery))
+               (pPred->m_pNext != p_pServiceQuery))
         {
             pPred = pPred->m_pNext;
         }
@@ -245,7 +236,7 @@ bool MDNSResponder::_removeServiceQuery(MDNSResponder::stcMDNSServiceQuery* p_pS
             delete p_pServiceQuery;
             bResult = true;
         }
-        else    // No predecessor
+        else  // No predecessor
         {
             if (m_pServiceQueries == p_pServiceQuery)
             {
@@ -267,8 +258,7 @@ bool MDNSResponder::_removeServiceQuery(MDNSResponder::stcMDNSServiceQuery* p_pS
 */
 bool MDNSResponder::_removeLegacyServiceQuery(void)
 {
-
-    stcMDNSServiceQuery*    pLegacyServiceQuery = _findLegacyServiceQuery();
+    stcMDNSServiceQuery* pLegacyServiceQuery = _findLegacyServiceQuery();
     return (pLegacyServiceQuery ? _removeServiceQuery(pLegacyServiceQuery) : true);
 }
 
@@ -280,8 +270,7 @@ bool MDNSResponder::_removeLegacyServiceQuery(void)
 */
 MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
 {
-
-    stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
+    stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
     while (pServiceQuery)
     {
         if ((hMDNSServiceQuery)pServiceQuery == p_hServiceQuery)
@@ -298,8 +287,7 @@ MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findServiceQuery(MDNSRespond
 */
 MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findLegacyServiceQuery(void)
 {
-
-    stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
+    stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
     while (pServiceQuery)
     {
         if (pServiceQuery->m_bLegacyQuery)
@@ -318,7 +306,7 @@ bool MDNSResponder::_releaseServiceQueries(void)
 {
     while (m_pServiceQueries)
     {
-        stcMDNSServiceQuery*    pNext = m_pServiceQueries->m_pNext;
+        stcMDNSServiceQuery* pNext = m_pServiceQueries->m_pNext;
         delete m_pServiceQueries;
         m_pServiceQueries = pNext;
     }
@@ -329,11 +317,11 @@ bool MDNSResponder::_releaseServiceQueries(void)
     MDNSResponder::_findNextServiceQueryByServiceType
 */
 MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findNextServiceQueryByServiceType(const stcMDNS_RRDomain& p_ServiceTypeDomain,
-        const stcMDNSServiceQuery* p_pPrevServiceQuery)
+                                                                                      const stcMDNSServiceQuery* p_pPrevServiceQuery)
 {
-    stcMDNSServiceQuery*    pMatchingServiceQuery = 0;
+    stcMDNSServiceQuery* pMatchingServiceQuery = 0;
 
-    stcMDNSServiceQuery*    pServiceQuery = (p_pPrevServiceQuery ? p_pPrevServiceQuery->m_pNext : m_pServiceQueries);
+    stcMDNSServiceQuery* pServiceQuery = (p_pPrevServiceQuery ? p_pPrevServiceQuery->m_pNext : m_pServiceQueries);
     while (pServiceQuery)
     {
         if (p_ServiceTypeDomain == pServiceQuery->m_ServiceTypeDomain)
@@ -346,7 +334,6 @@ MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findNextServiceQueryByServic
     return pMatchingServiceQuery;
 }
 
-
 /*
     HOSTNAME
 */
@@ -358,13 +345,13 @@ bool MDNSResponder::_setHostname(const char* p_pcHostname)
 {
     //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _allocHostname (%s)\n"), p_pcHostname););
 
-    bool    bResult = false;
+    bool bResult = false;
 
     _releaseHostname();
 
-    size_t  stLength = 0;
+    size_t stLength = 0;
     if ((p_pcHostname) &&
-            (MDNS_DOMAIN_LABEL_MAXLENGTH >= (stLength = strlen(p_pcHostname))))   // char max size for a single label
+        (MDNS_DOMAIN_LABEL_MAXLENGTH >= (stLength = strlen(p_pcHostname))))  // char max size for a single label
     {
         // Copy in hostname characters as lowercase
         if ((bResult = (0 != (m_pcHostname = new char[stLength + 1]))))
@@ -389,7 +376,6 @@ bool MDNSResponder::_setHostname(const char* p_pcHostname)
 */
 bool MDNSResponder::_releaseHostname(void)
 {
-
     if (m_pcHostname)
     {
         delete[] m_pcHostname;
@@ -398,7 +384,6 @@ bool MDNSResponder::_releaseHostname(void)
     return true;
 }
 
-
 /*
     SERVICE
 */
@@ -407,25 +392,23 @@ bool MDNSResponder::_releaseHostname(void)
     MDNSResponder::_allocService
 */
 MDNSResponder::stcMDNSService* MDNSResponder::_allocService(const char* p_pcName,
-        const char* p_pcService,
-        const char* p_pcProtocol,
-        uint16_t p_u16Port)
+                                                            const char* p_pcService,
+                                                            const char* p_pcProtocol,
+                                                            uint16_t p_u16Port)
 {
-
     stcMDNSService* pService = 0;
     if (((!p_pcName) ||
-            (MDNS_DOMAIN_LABEL_MAXLENGTH >= strlen(p_pcName))) &&
-            (p_pcService) &&
-            (MDNS_SERVICE_NAME_LENGTH >= strlen(p_pcService)) &&
-            (p_pcProtocol) &&
-            (MDNS_SERVICE_PROTOCOL_LENGTH >= strlen(p_pcProtocol)) &&
-            (p_u16Port) &&
-            (0 != (pService = new stcMDNSService)) &&
-            (pService->setName(p_pcName ? : m_pcHostname)) &&
-            (pService->setService(p_pcService)) &&
-            (pService->setProtocol(p_pcProtocol)))
+         (MDNS_DOMAIN_LABEL_MAXLENGTH >= strlen(p_pcName))) &&
+        (p_pcService) &&
+        (MDNS_SERVICE_NAME_LENGTH >= strlen(p_pcService)) &&
+        (p_pcProtocol) &&
+        (MDNS_SERVICE_PROTOCOL_LENGTH >= strlen(p_pcProtocol)) &&
+        (p_u16Port) &&
+        (0 != (pService = new stcMDNSService)) &&
+        (pService->setName(p_pcName ?: m_pcHostname)) &&
+        (pService->setService(p_pcService)) &&
+        (pService->setProtocol(p_pcProtocol)))
     {
-
         pService->m_bAutoName = (0 == p_pcName);
         pService->m_u16Port = p_u16Port;
 
@@ -441,14 +424,13 @@ MDNSResponder::stcMDNSService* MDNSResponder::_allocService(const char* p_pcName
 */
 bool MDNSResponder::_releaseService(MDNSResponder::stcMDNSService* p_pService)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if (p_pService)
     {
         stcMDNSService* pPred = m_pServices;
         while ((pPred) &&
-                (pPred->m_pNext != p_pService))
+               (pPred->m_pNext != p_pService))
         {
             pPred = pPred->m_pNext;
         }
@@ -458,7 +440,7 @@ bool MDNSResponder::_releaseService(MDNSResponder::stcMDNSService* p_pService)
             delete p_pService;
             bResult = true;
         }
-        else    // No predecessor
+        else  // No predecessor
         {
             if (m_pServices == p_pService)
             {
@@ -480,7 +462,6 @@ bool MDNSResponder::_releaseService(MDNSResponder::stcMDNSService* p_pService)
 */
 bool MDNSResponder::_releaseServices(void)
 {
-
     stcMDNSService* pService = m_pServices;
     while (pService)
     {
@@ -494,18 +475,16 @@ bool MDNSResponder::_releaseServices(void)
     MDNSResponder::_findService
 */
 MDNSResponder::stcMDNSService* MDNSResponder::_findService(const char* p_pcName,
-        const char* p_pcService,
-        const char* p_pcProtocol)
+                                                           const char* p_pcService,
+                                                           const char* p_pcProtocol)
 {
-
     stcMDNSService* pService = m_pServices;
     while (pService)
     {
         if ((0 == strcmp(pService->m_pcName, p_pcName)) &&
-                (0 == strcmp(pService->m_pcService, p_pcService)) &&
-                (0 == strcmp(pService->m_pcProtocol, p_pcProtocol)))
+            (0 == strcmp(pService->m_pcService, p_pcService)) &&
+            (0 == strcmp(pService->m_pcProtocol, p_pcProtocol)))
         {
-
             break;
         }
         pService = pService->m_pNext;
@@ -518,7 +497,6 @@ MDNSResponder::stcMDNSService* MDNSResponder::_findService(const char* p_pcName,
 */
 MDNSResponder::stcMDNSService* MDNSResponder::_findService(const MDNSResponder::hMDNSService p_hService)
 {
-
     stcMDNSService* pService = m_pServices;
     while (pService)
     {
@@ -531,7 +509,6 @@ MDNSResponder::stcMDNSService* MDNSResponder::_findService(const MDNSResponder::
     return pService;
 }
 
-
 /*
     SERVICE TXT
 */
@@ -540,30 +517,29 @@ MDNSResponder::stcMDNSService* MDNSResponder::_findService(const MDNSResponder::
     MDNSResponder::_allocServiceTxt
 */
 MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_allocServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        const char* p_pcKey,
-        const char* p_pcValue,
-        bool p_bTemp)
+                                                                  const char* p_pcKey,
+                                                                  const char* p_pcValue,
+                                                                  bool p_bTemp)
 {
-
-    stcMDNSServiceTxt*  pTxt = 0;
+    stcMDNSServiceTxt* pTxt = 0;
 
     if ((p_pService) &&
-            (p_pcKey) &&
-            (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() +
-                                           1 +                                 // Length byte
-                                           (p_pcKey ? strlen(p_pcKey) : 0) +
-                                           1 +                                 // '='
-                                           (p_pcValue ? strlen(p_pcValue) : 0))))
+        (p_pcKey) &&
+        (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() +
+                                       1 +  // Length byte
+                                       (p_pcKey ? strlen(p_pcKey) : 0) +
+                                       1 +  // '='
+                                       (p_pcValue ? strlen(p_pcValue) : 0))))
     {
-
         pTxt = new stcMDNSServiceTxt;
         if (pTxt)
         {
-            size_t  stLength = (p_pcKey ? strlen(p_pcKey) : 0);
+            size_t stLength = (p_pcKey ? strlen(p_pcKey) : 0);
             pTxt->m_pcKey = new char[stLength + 1];
             if (pTxt->m_pcKey)
             {
-                strncpy(pTxt->m_pcKey, p_pcKey, stLength); pTxt->m_pcKey[stLength] = 0;
+                strncpy(pTxt->m_pcKey, p_pcKey, stLength);
+                pTxt->m_pcKey[stLength] = 0;
             }
 
             if (p_pcValue)
@@ -572,7 +548,8 @@ MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_allocServiceTxt(MDNSResponder:
                 pTxt->m_pcValue = new char[stLength + 1];
                 if (pTxt->m_pcValue)
                 {
-                    strncpy(pTxt->m_pcValue, p_pcValue, stLength); pTxt->m_pcValue[stLength] = 0;
+                    strncpy(pTxt->m_pcValue, p_pcValue, stLength);
+                    pTxt->m_pcValue[stLength] = 0;
                 }
             }
             pTxt->m_bTemp = p_bTemp;
@@ -590,7 +567,6 @@ MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_allocServiceTxt(MDNSResponder:
 bool MDNSResponder::_releaseServiceTxt(MDNSResponder::stcMDNSService* p_pService,
                                        MDNSResponder::stcMDNSServiceTxt* p_pTxt)
 {
-
     return ((p_pService) &&
             (p_pTxt) &&
             (p_pService->m_Txts.remove(p_pTxt)));
@@ -600,16 +576,15 @@ bool MDNSResponder::_releaseServiceTxt(MDNSResponder::stcMDNSService* p_pService
     MDNSResponder::_updateServiceTxt
 */
 MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_updateServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        MDNSResponder::stcMDNSServiceTxt* p_pTxt,
-        const char* p_pcValue,
-        bool p_bTemp)
+                                                                   MDNSResponder::stcMDNSServiceTxt* p_pTxt,
+                                                                   const char* p_pcValue,
+                                                                   bool p_bTemp)
 {
-
     if ((p_pService) &&
-            (p_pTxt) &&
-            (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() -
-                                           (p_pTxt->m_pcValue ? strlen(p_pTxt->m_pcValue) : 0) +
-                                           (p_pcValue ? strlen(p_pcValue) : 0))))
+        (p_pTxt) &&
+        (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() -
+                                       (p_pTxt->m_pcValue ? strlen(p_pTxt->m_pcValue) : 0) +
+                                       (p_pcValue ? strlen(p_pcValue) : 0))))
     {
         p_pTxt->update(p_pcValue);
         p_pTxt->m_bTemp = p_bTemp;
@@ -621,9 +596,8 @@ MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_updateServiceTxt(MDNSResponder
     MDNSResponder::_findServiceTxt
 */
 MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        const char* p_pcKey)
+                                                                 const char* p_pcKey)
 {
-
     return (p_pService ? p_pService->m_Txts.find(p_pcKey) : 0);
 }
 
@@ -631,9 +605,8 @@ MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::
     MDNSResponder::_findServiceTxt
 */
 MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        const hMDNSTxt p_hTxt)
+                                                                 const hMDNSTxt p_hTxt)
 {
-
     return (((p_pService) && (p_hTxt)) ? p_pService->m_Txts.find((stcMDNSServiceTxt*)p_hTxt) : 0);
 }
 
@@ -641,18 +614,17 @@ MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::
     MDNSResponder::_addServiceTxt
 */
 MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_addServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        const char* p_pcKey,
-        const char* p_pcValue,
-        bool p_bTemp)
+                                                                const char* p_pcKey,
+                                                                const char* p_pcValue,
+                                                                bool p_bTemp)
 {
-    stcMDNSServiceTxt*  pResult = 0;
+    stcMDNSServiceTxt* pResult = 0;
 
     if ((p_pService) &&
-            (p_pcKey) &&
-            (strlen(p_pcKey)))
+        (p_pcKey) &&
+        (strlen(p_pcKey)))
     {
-
-        stcMDNSServiceTxt*  pTxt = p_pService->m_Txts.find(p_pcKey);
+        stcMDNSServiceTxt* pTxt = p_pService->m_Txts.find(p_pcKey);
         if (pTxt)
         {
             pResult = _updateServiceTxt(p_pService, pTxt, p_pcValue, p_bTemp);
@@ -666,12 +638,12 @@ MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_addServiceTxt(MDNSResponder::s
 }
 
 MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                                                 const uint32_t p_u32AnswerIndex)
 {
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
     stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
     // Fill m_pcTxts (if not already done)
-    return (pSQAnswer) ?  pSQAnswer->m_Txts.m_pTxts : 0;
+    return (pSQAnswer) ? pSQAnswer->m_Txts.m_pTxts : 0;
 }
 
 /*
@@ -679,7 +651,6 @@ MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_answerKeyValue(const hMDNSServ
 */
 bool MDNSResponder::_collectServiceTxts(MDNSResponder::stcMDNSService& p_rService)
 {
-
     // Call Dynamic service callbacks
     if (m_fnServiceTxtCallback)
     {
@@ -697,11 +668,9 @@ bool MDNSResponder::_collectServiceTxts(MDNSResponder::stcMDNSService& p_rServic
 */
 bool MDNSResponder::_releaseTempServiceTxts(MDNSResponder::stcMDNSService& p_rService)
 {
-
     return (p_rService.m_Txts.removeTempTxts());
 }
 
-
 /*
     MISC
 */
@@ -712,11 +681,10 @@ bool MDNSResponder::_releaseTempServiceTxts(MDNSResponder::stcMDNSService& p_rSe
 */
 bool MDNSResponder::_printRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_RRDomain) const
 {
-
     //DEBUG_OUTPUT.printf_P(PSTR("Domain: "));
 
     const char* pCursor = p_RRDomain.m_acName;
-    uint8_t     u8Length = *pCursor++;
+    uint8_t u8Length = *pCursor++;
     if (u8Length)
     {
         while (u8Length)
@@ -732,7 +700,7 @@ bool MDNSResponder::_printRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_RRDo
             }
         }
     }
-    else    // empty domain
+    else  // empty domain
     {
         DEBUG_OUTPUT.printf_P(PSTR("-empty-"));
     }
@@ -746,45 +714,44 @@ bool MDNSResponder::_printRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_RRDo
 */
 bool MDNSResponder::_printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAnswer) const
 {
-
     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] RRAnswer: "));
     _printRRDomain(p_RRAnswer.m_Header.m_Domain);
     DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, "), p_RRAnswer.m_Header.m_Attributes.m_u16Type, p_RRAnswer.m_Header.m_Attributes.m_u16Class, p_RRAnswer.m_u32TTL);
-    switch (p_RRAnswer.m_Header.m_Attributes.m_u16Type & (~0x8000))     // Topmost bit might carry 'cache flush' flag
+    switch (p_RRAnswer.m_Header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
     {
 #ifdef MDNS_IP4_SUPPORT
-    case DNS_RRTYPE_A:
-        DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((const stcMDNS_RRAnswerA*)&p_RRAnswer)->m_IPAddress.toString().c_str());
-        break;
+        case DNS_RRTYPE_A:
+            DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((const stcMDNS_RRAnswerA*)&p_RRAnswer)->m_IPAddress.toString().c_str());
+            break;
 #endif
-    case DNS_RRTYPE_PTR:
-        DEBUG_OUTPUT.printf_P(PSTR("PTR "));
-        _printRRDomain(((const stcMDNS_RRAnswerPTR*)&p_RRAnswer)->m_PTRDomain);
-        break;
-    case DNS_RRTYPE_TXT:
-    {
-        size_t  stTxtLength = ((const stcMDNS_RRAnswerTXT*)&p_RRAnswer)->m_Txts.c_strLength();
-        char*   pTxts = new char[stTxtLength];
-        if (pTxts)
+        case DNS_RRTYPE_PTR:
+            DEBUG_OUTPUT.printf_P(PSTR("PTR "));
+            _printRRDomain(((const stcMDNS_RRAnswerPTR*)&p_RRAnswer)->m_PTRDomain);
+            break;
+        case DNS_RRTYPE_TXT:
         {
-            ((/*const c_str()!!*/stcMDNS_RRAnswerTXT*)&p_RRAnswer)->m_Txts.c_str(pTxts);
-            DEBUG_OUTPUT.printf_P(PSTR("TXT(%zu) %s"), stTxtLength, pTxts);
-            delete[] pTxts;
+            size_t stTxtLength = ((const stcMDNS_RRAnswerTXT*)&p_RRAnswer)->m_Txts.c_strLength();
+            char* pTxts = new char[stTxtLength];
+            if (pTxts)
+            {
+                ((/*const c_str()!!*/ stcMDNS_RRAnswerTXT*)&p_RRAnswer)->m_Txts.c_str(pTxts);
+                DEBUG_OUTPUT.printf_P(PSTR("TXT(%zu) %s"), stTxtLength, pTxts);
+                delete[] pTxts;
+            }
+            break;
         }
-        break;
-    }
 #ifdef MDNS_IP6_SUPPORT
-    case DNS_RRTYPE_AAAA:
-        DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
-        break;
+        case DNS_RRTYPE_AAAA:
+            DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
+            break;
 #endif
-    case DNS_RRTYPE_SRV:
-        DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_u16Port);
-        _printRRDomain(((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_SRVDomain);
-        break;
-    default:
-        DEBUG_OUTPUT.printf_P(PSTR("generic "));
-        break;
+        case DNS_RRTYPE_SRV:
+            DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_u16Port);
+            _printRRDomain(((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_SRVDomain);
+            break;
+        default:
+            DEBUG_OUTPUT.printf_P(PSTR("generic "));
+            break;
     }
     DEBUG_OUTPUT.printf_P(PSTR("\n"));
 
@@ -792,10 +759,6 @@ bool MDNSResponder::_printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAn
 }
 #endif
 
-}   // namespace MDNSImplementation
-
-} // namespace esp8266
-
-
-
+}  // namespace MDNSImplementation
 
+}  // namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h b/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
index 49fc5bb608..70e81de5e6 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
@@ -27,14 +27,12 @@
 
 namespace esp8266
 {
-
 /*
     LEAmDNS
 */
 
 namespace MDNSImplementation
 {
-
 // Enable class debug functions
 #define ESP_8266_MDNS_INCLUDE
 //#define DEBUG_ESP_MDNS_RESPONDER
@@ -62,7 +60,7 @@ namespace MDNSImplementation
 
 #ifdef DEBUG_ESP_MDNS_RESPONDER
 #ifdef DEBUG_ESP_MDNS_INFO
-#define DEBUG_EX_INFO(A)    A
+#define DEBUG_EX_INFO(A) A
 #else
 #define DEBUG_EX_INFO(A)
 #endif
@@ -72,12 +70,12 @@ namespace MDNSImplementation
 #define DEBUG_EX_ERR(A)
 #endif
 #ifdef DEBUG_ESP_MDNS_TX
-#define DEBUG_EX_TX(A)  A
+#define DEBUG_EX_TX(A) A
 #else
 #define DEBUG_EX_TX(A)
 #endif
 #ifdef DEBUG_ESP_MDNS_RX
-#define DEBUG_EX_RX(A)  A
+#define DEBUG_EX_RX(A) A
 #else
 #define DEBUG_EX_RX(A)
 #endif
@@ -88,10 +86,26 @@ namespace MDNSImplementation
 #define DEBUG_OUTPUT Serial
 #endif
 #else
-#define DEBUG_EX_INFO(A)    do { (void)0; } while (0)
-#define DEBUG_EX_ERR(A)     do { (void)0; } while (0)
-#define DEBUG_EX_TX(A)      do { (void)0; } while (0)
-#define DEBUG_EX_RX(A)      do { (void)0; } while (0)
+#define DEBUG_EX_INFO(A) \
+    do                   \
+    {                    \
+        (void)0;         \
+    } while (0)
+#define DEBUG_EX_ERR(A) \
+    do                  \
+    {                   \
+        (void)0;        \
+    } while (0)
+#define DEBUG_EX_TX(A) \
+    do                 \
+    {                  \
+        (void)0;       \
+    } while (0)
+#define DEBUG_EX_RX(A) \
+    do                 \
+    {                  \
+        (void)0;       \
+    } while (0)
 #endif
 
 /*  already defined in lwIP ('lwip/prot/dns.h')
@@ -111,44 +125,43 @@ namespace MDNSImplementation
 
     However, RFC 3171 seems to force 255 instead
 */
-#define MDNS_MULTICAST_TTL              255/*1*/
+#define MDNS_MULTICAST_TTL 255 /*1*/
 
 /*
     This is the MDNS record TTL
     Host level records are set to 2min (120s)
     service level records are set to 75min (4500s)
 */
-#define MDNS_HOST_TTL                   120
-#define MDNS_SERVICE_TTL                4500
+#define MDNS_HOST_TTL 120
+#define MDNS_SERVICE_TTL 4500
 
 /*
     Compressed labels are flagged by the two topmost bits of the length byte being set
 */
-#define MDNS_DOMAIN_COMPRESS_MARK       0xC0
+#define MDNS_DOMAIN_COMPRESS_MARK 0xC0
 /*
     Avoid endless recursion because of malformed compressed labels
 */
-#define MDNS_DOMAIN_MAX_REDIRCTION      6
+#define MDNS_DOMAIN_MAX_REDIRCTION 6
 
 /*
     Default service priority and weight in SRV answers
 */
-#define MDNS_SRV_PRIORITY               0
-#define MDNS_SRV_WEIGHT                 0
+#define MDNS_SRV_PRIORITY 0
+#define MDNS_SRV_WEIGHT 0
 
 /*
     Delay between and number of probes for host and service domains
     Delay between and number of announces for host and service domains
     Delay between and number of service queries; the delay is multiplied by the resent number in '_checkServiceQueryCache'
 */
-#define MDNS_PROBE_DELAY                250
-#define MDNS_PROBE_COUNT                3
-#define MDNS_ANNOUNCE_DELAY             1000
-#define MDNS_ANNOUNCE_COUNT             8
+#define MDNS_PROBE_DELAY 250
+#define MDNS_PROBE_COUNT 3
+#define MDNS_ANNOUNCE_DELAY 1000
+#define MDNS_ANNOUNCE_COUNT 8
 #define MDNS_DYNAMIC_QUERY_RESEND_COUNT 5
 #define MDNS_DYNAMIC_QUERY_RESEND_DELAY 5000
 
-
 /*
     Force host domain to use only lowercase letters
 */
@@ -167,15 +180,14 @@ namespace MDNSImplementation
 #ifdef F
 #undef F
 #endif
-#define F(A)    A
+#define F(A) A
 #endif
 
-}   // namespace MDNSImplementation
+}  // namespace MDNSImplementation
 
-} // namespace esp8266
+}  // namespace esp8266
 
 // Include the main header, so the submodlues only need to include this header
 #include "LEAmDNS.h"
 
-
 #endif  // MDNS_PRIV_H
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
index 786287457d..f6bf0bf543 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
@@ -28,13 +28,11 @@
 
 namespace esp8266
 {
-
 /*
     LEAmDNS
 */
 namespace MDNSImplementation
 {
-
 /**
     STRUCTS
 */
@@ -53,14 +51,13 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt constructor
 */
 MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const char* p_pcKey /*= 0*/,
-        const char* p_pcValue /*= 0*/,
-        bool p_bTemp /*= false*/)
-    :   m_pNext(0),
-        m_pcKey(0),
-        m_pcValue(0),
-        m_bTemp(p_bTemp)
+                                                    const char* p_pcValue /*= 0*/,
+                                                    bool p_bTemp /*= false*/)
+    : m_pNext(0),
+      m_pcKey(0),
+      m_pcValue(0),
+      m_bTemp(p_bTemp)
 {
-
     setKey(p_pcKey);
     setValue(p_pcValue);
 }
@@ -69,12 +66,11 @@ MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const char* p_pcKey /*= 0*/,
     MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt copy-constructor
 */
 MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const MDNSResponder::stcMDNSServiceTxt& p_Other)
-    :   m_pNext(0),
-        m_pcKey(0),
-        m_pcValue(0),
-        m_bTemp(false)
+    : m_pNext(0),
+      m_pcKey(0),
+      m_pcValue(0),
+      m_bTemp(false)
 {
-
     operator=(p_Other);
 }
 
@@ -83,7 +79,6 @@ MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const MDNSResponder::stcMDNS
 */
 MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt(void)
 {
-
     clear();
 }
 
@@ -92,7 +87,6 @@ MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt(void)
 */
 MDNSResponder::stcMDNSServiceTxt& MDNSResponder::stcMDNSServiceTxt::operator=(const MDNSResponder::stcMDNSServiceTxt& p_Other)
 {
-
     if (&p_Other != this)
     {
         clear();
@@ -106,7 +100,6 @@ MDNSResponder::stcMDNSServiceTxt& MDNSResponder::stcMDNSServiceTxt::operator=(co
 */
 bool MDNSResponder::stcMDNSServiceTxt::clear(void)
 {
-
     releaseKey();
     releaseValue();
     return true;
@@ -117,7 +110,6 @@ bool MDNSResponder::stcMDNSServiceTxt::clear(void)
 */
 char* MDNSResponder::stcMDNSServiceTxt::allocKey(size_t p_stLength)
 {
-
     releaseKey();
     if (p_stLength)
     {
@@ -130,9 +122,8 @@ char* MDNSResponder::stcMDNSServiceTxt::allocKey(size_t p_stLength)
     MDNSResponder::stcMDNSServiceTxt::setKey
 */
 bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey,
-        size_t p_stLength)
+                                              size_t p_stLength)
 {
-
     bool bResult = false;
 
     releaseKey();
@@ -153,7 +144,6 @@ bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey,
 */
 bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey)
 {
-
     return setKey(p_pcKey, (p_pcKey ? strlen(p_pcKey) : 0));
 }
 
@@ -162,7 +152,6 @@ bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey)
 */
 bool MDNSResponder::stcMDNSServiceTxt::releaseKey(void)
 {
-
     if (m_pcKey)
     {
         delete[] m_pcKey;
@@ -176,7 +165,6 @@ bool MDNSResponder::stcMDNSServiceTxt::releaseKey(void)
 */
 char* MDNSResponder::stcMDNSServiceTxt::allocValue(size_t p_stLength)
 {
-
     releaseValue();
     if (p_stLength)
     {
@@ -189,9 +177,8 @@ char* MDNSResponder::stcMDNSServiceTxt::allocValue(size_t p_stLength)
     MDNSResponder::stcMDNSServiceTxt::setValue
 */
 bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue,
-        size_t p_stLength)
+                                                size_t p_stLength)
 {
-
     bool bResult = false;
 
     releaseValue();
@@ -204,7 +191,7 @@ bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue,
             bResult = true;
         }
     }
-    else    // No value -> also OK
+    else  // No value -> also OK
     {
         bResult = true;
     }
@@ -216,7 +203,6 @@ bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue,
 */
 bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue)
 {
-
     return setValue(p_pcValue, (p_pcValue ? strlen(p_pcValue) : 0));
 }
 
@@ -225,7 +211,6 @@ bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue)
 */
 bool MDNSResponder::stcMDNSServiceTxt::releaseValue(void)
 {
-
     if (m_pcValue)
     {
         delete[] m_pcValue;
@@ -238,10 +223,9 @@ bool MDNSResponder::stcMDNSServiceTxt::releaseValue(void)
     MDNSResponder::stcMDNSServiceTxt::set
 */
 bool MDNSResponder::stcMDNSServiceTxt::set(const char* p_pcKey,
-        const char* p_pcValue,
-        bool p_bTemp /*= false*/)
+                                           const char* p_pcValue,
+                                           bool p_bTemp /*= false*/)
 {
-
     m_bTemp = p_bTemp;
     return ((setKey(p_pcKey)) &&
             (setValue(p_pcValue)));
@@ -252,7 +236,6 @@ bool MDNSResponder::stcMDNSServiceTxt::set(const char* p_pcKey,
 */
 bool MDNSResponder::stcMDNSServiceTxt::update(const char* p_pcValue)
 {
-
     return setValue(p_pcValue);
 }
 
@@ -263,18 +246,16 @@ bool MDNSResponder::stcMDNSServiceTxt::update(const char* p_pcValue)
 */
 size_t MDNSResponder::stcMDNSServiceTxt::length(void) const
 {
-
-    size_t  stLength = 0;
+    size_t stLength = 0;
     if (m_pcKey)
     {
-        stLength += strlen(m_pcKey);                     // Key
-        stLength += 1;                                      // '='
-        stLength += (m_pcValue ? strlen(m_pcValue) : 0); // Value
+        stLength += strlen(m_pcKey);                      // Key
+        stLength += 1;                                    // '='
+        stLength += (m_pcValue ? strlen(m_pcValue) : 0);  // Value
     }
     return stLength;
 }
 
-
 /**
     MDNSResponder::stcMDNSServiceTxts
 
@@ -291,18 +272,16 @@ size_t MDNSResponder::stcMDNSServiceTxt::length(void) const
     MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts constructor
 */
 MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(void)
-    :   m_pTxts(0)
+    : m_pTxts(0)
 {
-
 }
 
 /*
     MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts copy-constructor
 */
 MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other)
-    :   m_pTxts(0)
+    : m_pTxts(0)
 {
-
     operator=(p_Other);
 }
 
@@ -311,7 +290,6 @@ MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(const stcMDNSServiceTxts&
 */
 MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts(void)
 {
-
     clear();
 }
 
@@ -320,7 +298,6 @@ MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts(void)
 */
 MDNSResponder::stcMDNSServiceTxts& MDNSResponder::stcMDNSServiceTxts::operator=(const stcMDNSServiceTxts& p_Other)
 {
-
     if (this != &p_Other)
     {
         clear();
@@ -338,7 +315,6 @@ MDNSResponder::stcMDNSServiceTxts& MDNSResponder::stcMDNSServiceTxts::operator=(
 */
 bool MDNSResponder::stcMDNSServiceTxts::clear(void)
 {
-
     while (m_pTxts)
     {
         stcMDNSServiceTxt* pNext = m_pTxts->m_pNext;
@@ -353,7 +329,6 @@ bool MDNSResponder::stcMDNSServiceTxts::clear(void)
 */
 bool MDNSResponder::stcMDNSServiceTxts::add(MDNSResponder::stcMDNSServiceTxt* p_pTxt)
 {
-
     bool bResult = false;
 
     if (p_pTxt)
@@ -370,14 +345,13 @@ bool MDNSResponder::stcMDNSServiceTxts::add(MDNSResponder::stcMDNSServiceTxt* p_
 */
 bool MDNSResponder::stcMDNSServiceTxts::remove(stcMDNSServiceTxt* p_pTxt)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if (p_pTxt)
     {
-        stcMDNSServiceTxt*  pPred = m_pTxts;
+        stcMDNSServiceTxt* pPred = m_pTxts;
         while ((pPred) &&
-                (pPred->m_pNext != p_pTxt))
+               (pPred->m_pNext != p_pTxt))
         {
             pPred = pPred->m_pNext;
         }
@@ -387,7 +361,7 @@ bool MDNSResponder::stcMDNSServiceTxts::remove(stcMDNSServiceTxt* p_pTxt)
             delete p_pTxt;
             bResult = true;
         }
-        else if (m_pTxts == p_pTxt)     // No predecessor, but first item
+        else if (m_pTxts == p_pTxt)  // No predecessor, but first item
         {
             m_pTxts = p_pTxt->m_pNext;
             delete p_pTxt;
@@ -402,14 +376,13 @@ bool MDNSResponder::stcMDNSServiceTxts::remove(stcMDNSServiceTxt* p_pTxt)
 */
 bool MDNSResponder::stcMDNSServiceTxts::removeTempTxts(void)
 {
+    bool bResult = true;
 
-    bool    bResult = true;
-
-    stcMDNSServiceTxt*  pTxt = m_pTxts;
+    stcMDNSServiceTxt* pTxt = m_pTxts;
     while ((bResult) &&
-            (pTxt))
+           (pTxt))
     {
-        stcMDNSServiceTxt*  pNext = pTxt->m_pNext;
+        stcMDNSServiceTxt* pNext = pTxt->m_pNext;
         if (pTxt->m_bTemp)
         {
             bResult = remove(pTxt);
@@ -424,13 +397,12 @@ bool MDNSResponder::stcMDNSServiceTxts::removeTempTxts(void)
 */
 MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey)
 {
-
     stcMDNSServiceTxt* pResult = 0;
 
     for (stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
     {
         if ((p_pcKey) &&
-                (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
+            (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
         {
             pResult = pTxt;
             break;
@@ -444,15 +416,13 @@ MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const
 */
 const MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey) const
 {
-
-    const stcMDNSServiceTxt*   pResult = 0;
+    const stcMDNSServiceTxt* pResult = 0;
 
     for (const stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
     {
         if ((p_pcKey) &&
-                (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
+            (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
         {
-
             pResult = pTxt;
             break;
         }
@@ -465,7 +435,6 @@ const MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(
 */
 MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const stcMDNSServiceTxt* p_pTxt)
 {
-
     stcMDNSServiceTxt* pResult = 0;
 
     for (stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
@@ -484,14 +453,13 @@ MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const
 */
 uint16_t MDNSResponder::stcMDNSServiceTxts::length(void) const
 {
+    uint16_t u16Length = 0;
 
-    uint16_t    u16Length = 0;
-
-    stcMDNSServiceTxt*  pTxt = m_pTxts;
+    stcMDNSServiceTxt* pTxt = m_pTxts;
     while (pTxt)
     {
-        u16Length += 1;                 // Length byte
-        u16Length += pTxt->length();    // Text
+        u16Length += 1;               // Length byte
+        u16Length += pTxt->length();  // Text
         pTxt = pTxt->m_pNext;
     }
     return u16Length;
@@ -504,7 +472,6 @@ uint16_t MDNSResponder::stcMDNSServiceTxts::length(void) const
 */
 size_t MDNSResponder::stcMDNSServiceTxts::c_strLength(void) const
 {
-
     return length();
 }
 
@@ -513,7 +480,6 @@ size_t MDNSResponder::stcMDNSServiceTxts::c_strLength(void) const
 */
 bool MDNSResponder::stcMDNSServiceTxts::c_str(char* p_pcBuffer)
 {
-
     bool bResult = false;
 
     if (p_pcBuffer)
@@ -523,19 +489,21 @@ bool MDNSResponder::stcMDNSServiceTxts::c_str(char* p_pcBuffer)
         *p_pcBuffer = 0;
         for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
         {
-            size_t  stLength;
+            size_t stLength;
             if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0)))))
             {
                 if (pTxt != m_pTxts)
                 {
                     *p_pcBuffer++ = ';';
                 }
-                strncpy(p_pcBuffer, pTxt->m_pcKey, stLength); p_pcBuffer[stLength] = 0;
+                strncpy(p_pcBuffer, pTxt->m_pcKey, stLength);
+                p_pcBuffer[stLength] = 0;
                 p_pcBuffer += stLength;
                 *p_pcBuffer++ = '=';
                 if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0)))
                 {
-                    strncpy(p_pcBuffer, pTxt->m_pcValue, stLength); p_pcBuffer[stLength] = 0;
+                    strncpy(p_pcBuffer, pTxt->m_pcValue, stLength);
+                    p_pcBuffer[stLength] = 0;
                     p_pcBuffer += stLength;
                 }
             }
@@ -552,7 +520,6 @@ bool MDNSResponder::stcMDNSServiceTxts::c_str(char* p_pcBuffer)
 */
 size_t MDNSResponder::stcMDNSServiceTxts::bufferLength(void) const
 {
-
     return (length() + 1);
 }
 
@@ -561,7 +528,6 @@ size_t MDNSResponder::stcMDNSServiceTxts::bufferLength(void) const
 */
 bool MDNSResponder::stcMDNSServiceTxts::buffer(char* p_pcBuffer)
 {
-
     bool bResult = false;
 
     if (p_pcBuffer)
@@ -572,7 +538,7 @@ bool MDNSResponder::stcMDNSServiceTxts::buffer(char* p_pcBuffer)
         for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
         {
             *(unsigned char*)p_pcBuffer++ = pTxt->length();
-            size_t  stLength;
+            size_t stLength;
             if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0)))))
             {
                 memcpy(p_pcBuffer, pTxt->m_pcKey, stLength);
@@ -595,15 +561,14 @@ bool MDNSResponder::stcMDNSServiceTxts::buffer(char* p_pcBuffer)
 */
 bool MDNSResponder::stcMDNSServiceTxts::compare(const MDNSResponder::stcMDNSServiceTxts& p_Other) const
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if ((bResult = (length() == p_Other.length())))
     {
         // Compare A->B
         for (const stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
         {
-            const stcMDNSServiceTxt*    pOtherTxt = p_Other.find(pTxt->m_pcKey);
+            const stcMDNSServiceTxt* pOtherTxt = p_Other.find(pTxt->m_pcKey);
             bResult = ((pOtherTxt) &&
                        (pTxt->m_pcValue) &&
                        (pOtherTxt->m_pcValue) &&
@@ -613,7 +578,7 @@ bool MDNSResponder::stcMDNSServiceTxts::compare(const MDNSResponder::stcMDNSServ
         // Compare B->A
         for (const stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; ((bResult) && (pOtherTxt)); pOtherTxt = pOtherTxt->m_pNext)
         {
-            const stcMDNSServiceTxt*    pTxt = find(pOtherTxt->m_pcKey);
+            const stcMDNSServiceTxt* pTxt = find(pOtherTxt->m_pcKey);
             bResult = ((pTxt) &&
                        (pOtherTxt->m_pcValue) &&
                        (pTxt->m_pcValue) &&
@@ -629,7 +594,6 @@ bool MDNSResponder::stcMDNSServiceTxts::compare(const MDNSResponder::stcMDNSServ
 */
 bool MDNSResponder::stcMDNSServiceTxts::operator==(const stcMDNSServiceTxts& p_Other) const
 {
-
     return compare(p_Other);
 }
 
@@ -638,11 +602,9 @@ bool MDNSResponder::stcMDNSServiceTxts::operator==(const stcMDNSServiceTxts& p_O
 */
 bool MDNSResponder::stcMDNSServiceTxts::operator!=(const stcMDNSServiceTxts& p_Other) const
 {
-
     return !compare(p_Other);
 }
 
-
 /**
     MDNSResponder::stcMDNS_MsgHeader
 
@@ -654,29 +616,33 @@ bool MDNSResponder::stcMDNSServiceTxts::operator!=(const stcMDNSServiceTxts& p_O
     MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader
 */
 MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader(uint16_t p_u16ID /*= 0*/,
-        bool p_bQR /*= false*/,
-        unsigned char p_ucOpcode /*= 0*/,
-        bool p_bAA /*= false*/,
-        bool p_bTC /*= false*/,
-        bool p_bRD /*= false*/,
-        bool p_bRA /*= false*/,
-        unsigned char p_ucRCode /*= 0*/,
-        uint16_t p_u16QDCount /*= 0*/,
-        uint16_t p_u16ANCount /*= 0*/,
-        uint16_t p_u16NSCount /*= 0*/,
-        uint16_t p_u16ARCount /*= 0*/)
-    :   m_u16ID(p_u16ID),
-        m_1bQR(p_bQR), m_4bOpcode(p_ucOpcode), m_1bAA(p_bAA), m_1bTC(p_bTC), m_1bRD(p_bRD),
-        m_1bRA(p_bRA), m_3bZ(0), m_4bRCode(p_ucRCode),
-        m_u16QDCount(p_u16QDCount),
-        m_u16ANCount(p_u16ANCount),
-        m_u16NSCount(p_u16NSCount),
-        m_u16ARCount(p_u16ARCount)
+                                                    bool p_bQR /*= false*/,
+                                                    unsigned char p_ucOpcode /*= 0*/,
+                                                    bool p_bAA /*= false*/,
+                                                    bool p_bTC /*= false*/,
+                                                    bool p_bRD /*= false*/,
+                                                    bool p_bRA /*= false*/,
+                                                    unsigned char p_ucRCode /*= 0*/,
+                                                    uint16_t p_u16QDCount /*= 0*/,
+                                                    uint16_t p_u16ANCount /*= 0*/,
+                                                    uint16_t p_u16NSCount /*= 0*/,
+                                                    uint16_t p_u16ARCount /*= 0*/)
+    : m_u16ID(p_u16ID),
+      m_1bQR(p_bQR),
+      m_4bOpcode(p_ucOpcode),
+      m_1bAA(p_bAA),
+      m_1bTC(p_bTC),
+      m_1bRD(p_bRD),
+      m_1bRA(p_bRA),
+      m_3bZ(0),
+      m_4bRCode(p_ucRCode),
+      m_u16QDCount(p_u16QDCount),
+      m_u16ANCount(p_u16ANCount),
+      m_u16NSCount(p_u16NSCount),
+      m_u16ARCount(p_u16ARCount)
 {
-
 }
 
-
 /**
     MDNSResponder::stcMDNS_RRDomain
 
@@ -694,9 +660,8 @@ MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader(uint16_t p_u16ID /*= 0*/,
     MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain constructor
 */
 MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(void)
-    :   m_u16NameLength(0)
+    : m_u16NameLength(0)
 {
-
     clear();
 }
 
@@ -704,9 +669,8 @@ MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(void)
     MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain copy-constructor
 */
 MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other)
-    :   m_u16NameLength(0)
+    : m_u16NameLength(0)
 {
-
     operator=(p_Other);
 }
 
@@ -715,7 +679,6 @@ MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Othe
 */
 MDNSResponder::stcMDNS_RRDomain& MDNSResponder::stcMDNS_RRDomain::operator=(const stcMDNS_RRDomain& p_Other)
 {
-
     if (&p_Other != this)
     {
         memcpy(m_acName, p_Other.m_acName, sizeof(m_acName));
@@ -729,7 +692,6 @@ MDNSResponder::stcMDNS_RRDomain& MDNSResponder::stcMDNS_RRDomain::operator=(cons
 */
 bool MDNSResponder::stcMDNS_RRDomain::clear(void)
 {
-
     memset(m_acName, 0, sizeof(m_acName));
     m_u16NameLength = 0;
     return true;
@@ -739,19 +701,18 @@ bool MDNSResponder::stcMDNS_RRDomain::clear(void)
     MDNSResponder::stcMDNS_RRDomain::addLabel
 */
 bool MDNSResponder::stcMDNS_RRDomain::addLabel(const char* p_pcLabel,
-        bool p_bPrependUnderline /*= false*/)
+                                               bool p_bPrependUnderline /*= false*/)
 {
+    bool bResult = false;
 
-    bool    bResult = false;
-
-    size_t  stLength = (p_pcLabel
-                        ? (strlen(p_pcLabel) + (p_bPrependUnderline ? 1 : 0))
-                        : 0);
+    size_t stLength = (p_pcLabel
+                           ? (strlen(p_pcLabel) + (p_bPrependUnderline ? 1 : 0))
+                           : 0);
     if ((MDNS_DOMAIN_LABEL_MAXLENGTH >= stLength) &&
-            (MDNS_DOMAIN_MAXLENGTH >= (m_u16NameLength + (1 + stLength))))
+        (MDNS_DOMAIN_MAXLENGTH >= (m_u16NameLength + (1 + stLength))))
     {
         // Length byte
-        m_acName[m_u16NameLength] = (unsigned char)stLength;    // Might be 0!
+        m_acName[m_u16NameLength] = (unsigned char)stLength;  // Might be 0!
         ++m_u16NameLength;
         // Label
         if (stLength)
@@ -761,7 +722,8 @@ bool MDNSResponder::stcMDNS_RRDomain::addLabel(const char* p_pcLabel,
                 m_acName[m_u16NameLength++] = '_';
                 --stLength;
             }
-            strncpy(&(m_acName[m_u16NameLength]), p_pcLabel, stLength); m_acName[m_u16NameLength + stLength] = 0;
+            strncpy(&(m_acName[m_u16NameLength]), p_pcLabel, stLength);
+            m_acName[m_u16NameLength + stLength] = 0;
             m_u16NameLength += stLength;
         }
         bResult = true;
@@ -774,24 +736,23 @@ bool MDNSResponder::stcMDNS_RRDomain::addLabel(const char* p_pcLabel,
 */
 bool MDNSResponder::stcMDNS_RRDomain::compare(const stcMDNS_RRDomain& p_Other) const
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if (m_u16NameLength == p_Other.m_u16NameLength)
     {
         const char* pT = m_acName;
         const char* pO = p_Other.m_acName;
         while ((pT) &&
-                (pO) &&
-                (*((unsigned char*)pT) == *((unsigned char*)pO)) &&                  // Same length AND
-                (0 == strncasecmp((pT + 1), (pO + 1), *((unsigned char*)pT))))     // Same content
+               (pO) &&
+               (*((unsigned char*)pT) == *((unsigned char*)pO)) &&             // Same length AND
+               (0 == strncasecmp((pT + 1), (pO + 1), *((unsigned char*)pT))))  // Same content
         {
-            if (*((unsigned char*)pT))              // Not 0
+            if (*((unsigned char*)pT))  // Not 0
             {
-                pT += (1 + * ((unsigned char*)pT)); // Shift by length byte and length
-                pO += (1 + * ((unsigned char*)pO));
+                pT += (1 + *((unsigned char*)pT));  // Shift by length byte and length
+                pO += (1 + *((unsigned char*)pO));
             }
-            else                                    // Is 0 -> Successfully reached the end
+            else  // Is 0 -> Successfully reached the end
             {
                 bResult = true;
                 break;
@@ -806,7 +767,6 @@ bool MDNSResponder::stcMDNS_RRDomain::compare(const stcMDNS_RRDomain& p_Other) c
 */
 bool MDNSResponder::stcMDNS_RRDomain::operator==(const stcMDNS_RRDomain& p_Other) const
 {
-
     return compare(p_Other);
 }
 
@@ -815,7 +775,6 @@ bool MDNSResponder::stcMDNS_RRDomain::operator==(const stcMDNS_RRDomain& p_Other
 */
 bool MDNSResponder::stcMDNS_RRDomain::operator!=(const stcMDNS_RRDomain& p_Other) const
 {
-
     return !compare(p_Other);
 }
 
@@ -824,7 +783,6 @@ bool MDNSResponder::stcMDNS_RRDomain::operator!=(const stcMDNS_RRDomain& p_Other
 */
 bool MDNSResponder::stcMDNS_RRDomain::operator>(const stcMDNS_RRDomain& p_Other) const
 {
-
     // TODO: Check, if this is a good idea...
     return !compare(p_Other);
 }
@@ -834,10 +792,9 @@ bool MDNSResponder::stcMDNS_RRDomain::operator>(const stcMDNS_RRDomain& p_Other)
 */
 size_t MDNSResponder::stcMDNS_RRDomain::c_strLength(void) const
 {
+    size_t stLength = 0;
 
-    size_t          stLength = 0;
-
-    unsigned char*  pucLabelLength = (unsigned char*)m_acName;
+    unsigned char* pucLabelLength = (unsigned char*)m_acName;
     while (*pucLabelLength)
     {
         stLength += (*pucLabelLength + 1 /* +1 for '.' or '\0'*/);
@@ -851,7 +808,6 @@ size_t MDNSResponder::stcMDNS_RRDomain::c_strLength(void) const
 */
 bool MDNSResponder::stcMDNS_RRDomain::c_str(char* p_pcBuffer)
 {
-
     bool bResult = false;
 
     if (p_pcBuffer)
@@ -870,7 +826,6 @@ bool MDNSResponder::stcMDNS_RRDomain::c_str(char* p_pcBuffer)
     return bResult;
 }
 
-
 /**
     MDNSResponder::stcMDNS_RRAttributes
 
@@ -882,11 +837,10 @@ bool MDNSResponder::stcMDNS_RRDomain::c_str(char* p_pcBuffer)
     MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes constructor
 */
 MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(uint16_t p_u16Type /*= 0*/,
-        uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/)
-    :   m_u16Type(p_u16Type),
-        m_u16Class(p_u16Class)
+                                                          uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/)
+    : m_u16Type(p_u16Type),
+      m_u16Class(p_u16Class)
 {
-
 }
 
 /*
@@ -894,7 +848,6 @@ MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(uint16_t p_u16Type /*=
 */
 MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
 {
-
     operator=(p_Other);
 }
 
@@ -903,7 +856,6 @@ MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(const MDNSResponder::s
 */
 MDNSResponder::stcMDNS_RRAttributes& MDNSResponder::stcMDNS_RRAttributes::operator=(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
 {
-
     if (&p_Other != this)
     {
         m_u16Type = p_Other.m_u16Type;
@@ -912,7 +864,6 @@ MDNSResponder::stcMDNS_RRAttributes& MDNSResponder::stcMDNS_RRAttributes::operat
     return *this;
 }
 
-
 /**
     MDNSResponder::stcMDNS_RRHeader
 
@@ -925,7 +876,6 @@ MDNSResponder::stcMDNS_RRAttributes& MDNSResponder::stcMDNS_RRAttributes::operat
 */
 MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(void)
 {
-
 }
 
 /*
@@ -933,7 +883,6 @@ MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(void)
 */
 MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other)
 {
-
     operator=(p_Other);
 }
 
@@ -942,7 +891,6 @@ MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Othe
 */
 MDNSResponder::stcMDNS_RRHeader& MDNSResponder::stcMDNS_RRHeader::operator=(const MDNSResponder::stcMDNS_RRHeader& p_Other)
 {
-
     if (&p_Other != this)
     {
         m_Domain = p_Other.m_Domain;
@@ -956,12 +904,10 @@ MDNSResponder::stcMDNS_RRHeader& MDNSResponder::stcMDNS_RRHeader::operator=(cons
 */
 bool MDNSResponder::stcMDNS_RRHeader::clear(void)
 {
-
     m_Domain.clear();
     return true;
 }
 
-
 /**
     MDNSResponder::stcMDNS_RRQuestion
 
@@ -973,13 +919,11 @@ bool MDNSResponder::stcMDNS_RRHeader::clear(void)
     MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion constructor
 */
 MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion(void)
-    :   m_pNext(0),
-        m_bUnicast(false)
+    : m_pNext(0),
+      m_bUnicast(false)
 {
-
 }
 
-
 /**
     MDNSResponder::stcMDNS_RRAnswer
 
@@ -992,14 +936,13 @@ MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion(void)
     MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer constructor
 */
 MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer(enuAnswerType p_AnswerType,
-        const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-    :   m_pNext(0),
-        m_AnswerType(p_AnswerType),
-        m_Header(p_Header),
-        m_u32TTL(p_u32TTL)
+                                                  const MDNSResponder::stcMDNS_RRHeader& p_Header,
+                                                  uint32_t p_u32TTL)
+    : m_pNext(0),
+      m_AnswerType(p_AnswerType),
+      m_Header(p_Header),
+      m_u32TTL(p_u32TTL)
 {
-
     // Extract 'cache flush'-bit
     m_bCacheFlush = (m_Header.m_Attributes.m_u16Class & 0x8000);
     m_Header.m_Attributes.m_u16Class &= (~0x8000);
@@ -1010,7 +953,6 @@ MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer(enuAnswerType p_AnswerType,
 */
 MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer(void)
 {
-
 }
 
 /*
@@ -1018,7 +960,6 @@ MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer(void)
 */
 MDNSResponder::enuAnswerType MDNSResponder::stcMDNS_RRAnswer::answerType(void) const
 {
-
     return m_AnswerType;
 }
 
@@ -1027,13 +968,11 @@ MDNSResponder::enuAnswerType MDNSResponder::stcMDNS_RRAnswer::answerType(void) c
 */
 bool MDNSResponder::stcMDNS_RRAnswer::clear(void)
 {
-
     m_pNext = 0;
     m_Header.clear();
     return true;
 }
 
-
 /**
     MDNSResponder::stcMDNS_RRAnswerA
 
@@ -1047,11 +986,10 @@ bool MDNSResponder::stcMDNS_RRAnswer::clear(void)
     MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA constructor
 */
 MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-    :   stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL),
-        m_IPAddress(0, 0, 0, 0)
+                                                    uint32_t p_u32TTL)
+    : stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL),
+      m_IPAddress(0, 0, 0, 0)
 {
-
 }
 
 /*
@@ -1059,7 +997,6 @@ MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA(const MDNSResponder::stcMDNS
 */
 MDNSResponder::stcMDNS_RRAnswerA::~stcMDNS_RRAnswerA(void)
 {
-
     clear();
 }
 
@@ -1068,13 +1005,11 @@ MDNSResponder::stcMDNS_RRAnswerA::~stcMDNS_RRAnswerA(void)
 */
 bool MDNSResponder::stcMDNS_RRAnswerA::clear(void)
 {
-
     m_IPAddress = IPAddress(0, 0, 0, 0);
     return true;
 }
 #endif
 
-
 /**
     MDNSResponder::stcMDNS_RRAnswerPTR
 
@@ -1087,10 +1022,9 @@ bool MDNSResponder::stcMDNS_RRAnswerA::clear(void)
     MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR constructor
 */
 MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-    :   stcMDNS_RRAnswer(AnswerType_PTR, p_Header, p_u32TTL)
+                                                        uint32_t p_u32TTL)
+    : stcMDNS_RRAnswer(AnswerType_PTR, p_Header, p_u32TTL)
 {
-
 }
 
 /*
@@ -1098,7 +1032,6 @@ MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR(const MDNSResponder::stc
 */
 MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR(void)
 {
-
     clear();
 }
 
@@ -1107,12 +1040,10 @@ MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR(void)
 */
 bool MDNSResponder::stcMDNS_RRAnswerPTR::clear(void)
 {
-
     m_PTRDomain.clear();
     return true;
 }
 
-
 /**
     MDNSResponder::stcMDNS_RRAnswerTXT
 
@@ -1125,10 +1056,9 @@ bool MDNSResponder::stcMDNS_RRAnswerPTR::clear(void)
     MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT constructor
 */
 MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-    :   stcMDNS_RRAnswer(AnswerType_TXT, p_Header, p_u32TTL)
+                                                        uint32_t p_u32TTL)
+    : stcMDNS_RRAnswer(AnswerType_TXT, p_Header, p_u32TTL)
 {
-
 }
 
 /*
@@ -1136,7 +1066,6 @@ MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT(const MDNSResponder::stc
 */
 MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT(void)
 {
-
     clear();
 }
 
@@ -1145,12 +1074,10 @@ MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT(void)
 */
 bool MDNSResponder::stcMDNS_RRAnswerTXT::clear(void)
 {
-
     m_Txts.clear();
     return true;
 }
 
-
 /**
     MDNSResponder::stcMDNS_RRAnswerAAAA
 
@@ -1164,10 +1091,9 @@ bool MDNSResponder::stcMDNS_RRAnswerTXT::clear(void)
     MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA constructor
 */
 MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-    :   stcMDNS_RRAnswer(AnswerType_AAAA, p_Header, p_u32TTL)
+                                                          uint32_t p_u32TTL)
+    : stcMDNS_RRAnswer(AnswerType_AAAA, p_Header, p_u32TTL)
 {
-
 }
 
 /*
@@ -1175,7 +1101,6 @@ MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA(const MDNSResponder::s
 */
 MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA(void)
 {
-
     clear();
 }
 
@@ -1184,12 +1109,10 @@ MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA(void)
 */
 bool MDNSResponder::stcMDNS_RRAnswerAAAA::clear(void)
 {
-
     return true;
 }
 #endif
 
-
 /**
     MDNSResponder::stcMDNS_RRAnswerSRV
 
@@ -1202,13 +1125,12 @@ bool MDNSResponder::stcMDNS_RRAnswerAAAA::clear(void)
     MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV constructor
 */
 MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-    :   stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL),
-        m_u16Priority(0),
-        m_u16Weight(0),
-        m_u16Port(0)
+                                                        uint32_t p_u32TTL)
+    : stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL),
+      m_u16Priority(0),
+      m_u16Weight(0),
+      m_u16Port(0)
 {
-
 }
 
 /*
@@ -1216,7 +1138,6 @@ MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV(const MDNSResponder::stc
 */
 MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV(void)
 {
-
     clear();
 }
 
@@ -1225,7 +1146,6 @@ MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV(void)
 */
 bool MDNSResponder::stcMDNS_RRAnswerSRV::clear(void)
 {
-
     m_u16Priority = 0;
     m_u16Weight = 0;
     m_u16Port = 0;
@@ -1233,7 +1153,6 @@ bool MDNSResponder::stcMDNS_RRAnswerSRV::clear(void)
     return true;
 }
 
-
 /**
     MDNSResponder::stcMDNS_RRAnswerGeneric
 
@@ -1246,12 +1165,11 @@ bool MDNSResponder::stcMDNS_RRAnswerSRV::clear(void)
     MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric constructor
 */
 MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-    :   stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL),
-        m_u16RDLength(0),
-        m_pu8RDData(0)
+                                                                uint32_t p_u32TTL)
+    : stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL),
+      m_u16RDLength(0),
+      m_pu8RDData(0)
 {
-
 }
 
 /*
@@ -1259,7 +1177,6 @@ MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric(const stcMDNS_RR
 */
 MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric(void)
 {
-
     clear();
 }
 
@@ -1268,7 +1185,6 @@ MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric(void)
 */
 bool MDNSResponder::stcMDNS_RRAnswerGeneric::clear(void)
 {
-
     if (m_pu8RDData)
     {
         delete[] m_pu8RDData;
@@ -1279,7 +1195,6 @@ bool MDNSResponder::stcMDNS_RRAnswerGeneric::clear(void)
     return true;
 }
 
-
 /**
     MDNSResponder::stcProbeInformation
 
@@ -1291,13 +1206,13 @@ bool MDNSResponder::stcMDNS_RRAnswerGeneric::clear(void)
     MDNSResponder::stcProbeInformation::stcProbeInformation constructor
 */
 MDNSResponder::stcProbeInformation::stcProbeInformation(void)
-    :   m_ProbingStatus(ProbingStatus_WaitingForData),
-        m_u8SentCount(0),
-        m_Timeout(esp8266::polledTimeout::oneShotMs::neverExpires),
-        m_bConflict(false),
-        m_bTiebreakNeeded(false),
-        m_fnHostProbeResultCallback(0),
-        m_fnServiceProbeResultCallback(0)
+    : m_ProbingStatus(ProbingStatus_WaitingForData),
+      m_u8SentCount(0),
+      m_Timeout(esp8266::polledTimeout::oneShotMs::neverExpires),
+      m_bConflict(false),
+      m_bTiebreakNeeded(false),
+      m_fnHostProbeResultCallback(0),
+      m_fnServiceProbeResultCallback(0)
 {
 }
 
@@ -1306,7 +1221,6 @@ MDNSResponder::stcProbeInformation::stcProbeInformation(void)
 */
 bool MDNSResponder::stcProbeInformation::clear(bool p_bClearUserdata /*= false*/)
 {
-
     m_ProbingStatus = ProbingStatus_WaitingForData;
     m_u8SentCount = 0;
     m_Timeout.resetToNeverExpires();
@@ -1335,18 +1249,17 @@ bool MDNSResponder::stcProbeInformation::clear(bool p_bClearUserdata /*= false*/
     MDNSResponder::stcMDNSService::stcMDNSService constructor
 */
 MDNSResponder::stcMDNSService::stcMDNSService(const char* p_pcName /*= 0*/,
-        const char* p_pcService /*= 0*/,
-        const char* p_pcProtocol /*= 0*/)
-    :   m_pNext(0),
-        m_pcName(0),
-        m_bAutoName(false),
-        m_pcService(0),
-        m_pcProtocol(0),
-        m_u16Port(0),
-        m_u8ReplyMask(0),
-        m_fnTxtCallback(0)
+                                              const char* p_pcService /*= 0*/,
+                                              const char* p_pcProtocol /*= 0*/)
+    : m_pNext(0),
+      m_pcName(0),
+      m_bAutoName(false),
+      m_pcService(0),
+      m_pcProtocol(0),
+      m_u16Port(0),
+      m_u8ReplyMask(0),
+      m_fnTxtCallback(0)
 {
-
     setName(p_pcName);
     setService(p_pcService);
     setProtocol(p_pcProtocol);
@@ -1357,7 +1270,6 @@ MDNSResponder::stcMDNSService::stcMDNSService(const char* p_pcName /*= 0*/,
 */
 MDNSResponder::stcMDNSService::~stcMDNSService(void)
 {
-
     releaseName();
     releaseService();
     releaseProtocol();
@@ -1368,7 +1280,6 @@ MDNSResponder::stcMDNSService::~stcMDNSService(void)
 */
 bool MDNSResponder::stcMDNSService::setName(const char* p_pcName)
 {
-
     bool bResult = false;
 
     releaseName();
@@ -1393,7 +1304,6 @@ bool MDNSResponder::stcMDNSService::setName(const char* p_pcName)
 */
 bool MDNSResponder::stcMDNSService::releaseName(void)
 {
-
     if (m_pcName)
     {
         delete[] m_pcName;
@@ -1407,7 +1317,6 @@ bool MDNSResponder::stcMDNSService::releaseName(void)
 */
 bool MDNSResponder::stcMDNSService::setService(const char* p_pcService)
 {
-
     bool bResult = false;
 
     releaseService();
@@ -1432,7 +1341,6 @@ bool MDNSResponder::stcMDNSService::setService(const char* p_pcService)
 */
 bool MDNSResponder::stcMDNSService::releaseService(void)
 {
-
     if (m_pcService)
     {
         delete[] m_pcService;
@@ -1446,7 +1354,6 @@ bool MDNSResponder::stcMDNSService::releaseService(void)
 */
 bool MDNSResponder::stcMDNSService::setProtocol(const char* p_pcProtocol)
 {
-
     bool bResult = false;
 
     releaseProtocol();
@@ -1471,7 +1378,6 @@ bool MDNSResponder::stcMDNSService::setProtocol(const char* p_pcProtocol)
 */
 bool MDNSResponder::stcMDNSService::releaseProtocol(void)
 {
-
     if (m_pcProtocol)
     {
         delete[] m_pcProtocol;
@@ -1480,7 +1386,6 @@ bool MDNSResponder::stcMDNSService::releaseProtocol(void)
     return true;
 }
 
-
 /**
     MDNSResponder::stcMDNSServiceQuery
 
@@ -1562,7 +1467,6 @@ bool MDNSResponder::stcMDNSService::releaseProtocol(void)
             (m_TTLTimeFlag.flagged()));
     }*/
 
-
 /**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL
 
@@ -1577,11 +1481,10 @@ bool MDNSResponder::stcMDNSService::releaseProtocol(void)
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL constructor
 */
 MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL(void)
-    :   m_u32TTL(0),
-        m_TTLTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
-        m_timeoutLevel(TIMEOUTLEVEL_UNSET)
+    : m_u32TTL(0),
+      m_TTLTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
+      m_timeoutLevel(TIMEOUTLEVEL_UNSET)
 {
-
 }
 
 /*
@@ -1589,16 +1492,15 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL(void)
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set(uint32_t p_u32TTL)
 {
-
     m_u32TTL = p_u32TTL;
     if (m_u32TTL)
     {
-        m_timeoutLevel = TIMEOUTLEVEL_BASE;             // Set to 80%
+        m_timeoutLevel = TIMEOUTLEVEL_BASE;  // Set to 80%
         m_TTLTimeout.reset(timeout());
     }
     else
     {
-        m_timeoutLevel = TIMEOUTLEVEL_UNSET;            // undef
+        m_timeoutLevel = TIMEOUTLEVEL_UNSET;  // undef
         m_TTLTimeout.resetToNeverExpires();
     }
     return true;
@@ -1609,7 +1511,6 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set(uint32_t p_u32TT
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::flagged(void)
 {
-
     return ((m_u32TTL) &&
             (TIMEOUTLEVEL_UNSET != m_timeoutLevel) &&
             (m_TTLTimeout.expired()));
@@ -1620,14 +1521,12 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::flagged(void)
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::restart(void)
 {
+    bool bResult = true;
 
-    bool    bResult = true;
-
-    if ((TIMEOUTLEVEL_BASE <= m_timeoutLevel) &&    // >= 80% AND
-            (TIMEOUTLEVEL_FINAL > m_timeoutLevel))      // < 100%
+    if ((TIMEOUTLEVEL_BASE <= m_timeoutLevel) &&  // >= 80% AND
+        (TIMEOUTLEVEL_FINAL > m_timeoutLevel))    // < 100%
     {
-
-        m_timeoutLevel += TIMEOUTLEVEL_INTERVAL;    // increment by 5%
+        m_timeoutLevel += TIMEOUTLEVEL_INTERVAL;  // increment by 5%
         m_TTLTimeout.reset(timeout());
     }
     else
@@ -1644,9 +1543,8 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::restart(void)
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::prepareDeletion(void)
 {
-
     m_timeoutLevel = TIMEOUTLEVEL_FINAL;
-    m_TTLTimeout.reset(1 * 1000);   // See RFC 6762, 10.1
+    m_TTLTimeout.reset(1 * 1000);  // See RFC 6762, 10.1
 
     return true;
 }
@@ -1656,7 +1554,6 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::prepareDeletion(void
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel(void) const
 {
-
     return (TIMEOUTLEVEL_FINAL == m_timeoutLevel);
 }
 
@@ -1665,20 +1562,18 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel(vo
 */
 MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::timeType MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout(void) const
 {
-    if (TIMEOUTLEVEL_BASE == m_timeoutLevel)            // 80%
+    if (TIMEOUTLEVEL_BASE == m_timeoutLevel)  // 80%
     {
-        return (m_u32TTL * 800L);                  // to milliseconds
+        return (m_u32TTL * 800L);  // to milliseconds
     }
-    else if ((TIMEOUTLEVEL_BASE < m_timeoutLevel) &&    // >80% AND
-             (TIMEOUTLEVEL_FINAL >= m_timeoutLevel))    // <= 100%
+    else if ((TIMEOUTLEVEL_BASE < m_timeoutLevel) &&  // >80% AND
+             (TIMEOUTLEVEL_FINAL >= m_timeoutLevel))  // <= 100%
     {
-
         return (m_u32TTL * 50L);
-    }   // else: invalid
+    }  // else: invalid
     return MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::neverExpires;
 }
 
-
 #ifdef MDNS_IP4_SUPPORT
 /**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address
@@ -1689,16 +1584,14 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::timeType MDN
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address constructor
 */
 MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address(IPAddress p_IPAddress,
-        uint32_t p_u32TTL /*= 0*/)
-    :   m_pNext(0),
-        m_IPAddress(p_IPAddress)
+                                                                            uint32_t p_u32TTL /*= 0*/)
+    : m_pNext(0),
+      m_IPAddress(p_IPAddress)
 {
-
     m_TTL.set(p_u32TTL);
 }
 #endif
 
-
 /**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer
 */
@@ -1707,18 +1600,18 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address(IPAd
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer constructor
 */
 MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer(void)
-    :   m_pNext(0),
-        m_pcServiceDomain(0),
-        m_pcHostDomain(0),
-        m_u16Port(0),
-        m_pcTxts(0),
+    : m_pNext(0),
+      m_pcServiceDomain(0),
+      m_pcHostDomain(0),
+      m_u16Port(0),
+      m_pcTxts(0),
 #ifdef MDNS_IP4_SUPPORT
-        m_pIP4Addresses(0),
+      m_pIP4Addresses(0),
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        m_pIP6Addresses(0),
+      m_pIP6Addresses(0),
 #endif
-        m_u32ContentFlags(0)
+      m_u32ContentFlags(0)
 {
 }
 
@@ -1727,7 +1620,6 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer(void)
 */
 MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer(void)
 {
-
     clear();
 }
 
@@ -1736,7 +1628,6 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer(void)
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear(void)
 {
-
     return ((releaseTxts()) &&
 #ifdef MDNS_IP4_SUPPORT
             (releaseIP4Addresses()) &&
@@ -1744,7 +1635,7 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear(void)
 #ifdef MDNS_IP6_SUPPORT
             (releaseIP6Addresses())
 #endif
-            (releaseHostDomain()) &&
+                (releaseHostDomain()) &&
             (releaseServiceDomain()));
 }
 
@@ -1756,7 +1647,6 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear(void)
 */
 char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocServiceDomain(size_t p_stLength)
 {
-
     releaseServiceDomain();
     if (p_stLength)
     {
@@ -1770,7 +1660,6 @@ char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocServiceDomain(size_t p
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseServiceDomain(void)
 {
-
     if (m_pcServiceDomain)
     {
         delete[] m_pcServiceDomain;
@@ -1787,7 +1676,6 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseServiceDomain(void)
 */
 char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocHostDomain(size_t p_stLength)
 {
-
     releaseHostDomain();
     if (p_stLength)
     {
@@ -1801,7 +1689,6 @@ char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocHostDomain(size_t p_st
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseHostDomain(void)
 {
-
     if (m_pcHostDomain)
     {
         delete[] m_pcHostDomain;
@@ -1818,7 +1705,6 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseHostDomain(void)
 */
 char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocTxts(size_t p_stLength)
 {
-
     releaseTxts();
     if (p_stLength)
     {
@@ -1832,7 +1718,6 @@ char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocTxts(size_t p_stLength
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseTxts(void)
 {
-
     if (m_pcTxts)
     {
         delete[] m_pcTxts;
@@ -1847,10 +1732,9 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseTxts(void)
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP4Addresses(void)
 {
-
     while (m_pIP4Addresses)
     {
-        stcIP4Address*  pNext = m_pIP4Addresses->m_pNext;
+        stcIP4Address* pNext = m_pIP4Addresses->m_pNext;
         delete m_pIP4Addresses;
         m_pIP4Addresses = pNext;
     }
@@ -1862,7 +1746,6 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP4Addresses(void)
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
 {
-
     bool bResult = false;
 
     if (p_pIP4Address)
@@ -1879,14 +1762,13 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address(MDNSResponder:
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if (p_pIP4Address)
     {
-        stcIP4Address*  pPred = m_pIP4Addresses;
+        stcIP4Address* pPred = m_pIP4Addresses;
         while ((pPred) &&
-                (pPred->m_pNext != p_pIP4Address))
+               (pPred->m_pNext != p_pIP4Address))
         {
             pPred = pPred->m_pNext;
         }
@@ -1896,7 +1778,7 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address(MDNSRespond
             delete p_pIP4Address;
             bResult = true;
         }
-        else if (m_pIP4Addresses == p_pIP4Address)     // No predecessor, but first item
+        else if (m_pIP4Addresses == p_pIP4Address)  // No predecessor, but first item
         {
             m_pIP4Addresses = p_pIP4Address->m_pNext;
             delete p_pIP4Address;
@@ -1911,7 +1793,6 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address(MDNSRespond
 */
 const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress) const
 {
-
     return (stcIP4Address*)(((const stcAnswer*)this)->findIP4Address(p_IPAddress));
 }
 
@@ -1920,8 +1801,7 @@ const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponde
 */
 MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress)
 {
-
-    stcIP4Address*  pIP4Address = m_pIP4Addresses;
+    stcIP4Address* pIP4Address = m_pIP4Addresses;
     while (pIP4Address)
     {
         if (pIP4Address->m_IPAddress == p_IPAddress)
@@ -1938,10 +1818,9 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stc
 */
 uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount(void) const
 {
+    uint32_t u32Count = 0;
 
-    uint32_t    u32Count = 0;
-
-    stcIP4Address*  pIP4Address = m_pIP4Addresses;
+    stcIP4Address* pIP4Address = m_pIP4Addresses;
     while (pIP4Address)
     {
         ++u32Count;
@@ -1955,7 +1834,6 @@ uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount(void) co
 */
 MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index)
 {
-
     return (stcIP4Address*)(((const stcAnswer*)this)->IP4AddressAtIndex(p_u32Index));
 }
 
@@ -1964,15 +1842,14 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stc
 */
 const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index) const
 {
-
-    const stcIP4Address*    pIP4Address = 0;
+    const stcIP4Address* pIP4Address = 0;
 
     if (((uint32_t)(-1) != p_u32Index) &&
-            (m_pIP4Addresses))
+        (m_pIP4Addresses))
     {
-
-        uint32_t    u32Index;
-        for (pIP4Address = m_pIP4Addresses, u32Index = 0; ((pIP4Address) && (u32Index < p_u32Index)); pIP4Address = pIP4Address->m_pNext, ++u32Index);
+        uint32_t u32Index;
+        for (pIP4Address = m_pIP4Addresses, u32Index = 0; ((pIP4Address) && (u32Index < p_u32Index)); pIP4Address = pIP4Address->m_pNext, ++u32Index)
+            ;
     }
     return pIP4Address;
 }
@@ -1984,10 +1861,9 @@ const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponde
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP6Addresses(void)
 {
-
     while (m_pIP6Addresses)
     {
-        stcIP6Address*  pNext = m_pIP6Addresses->m_pNext;
+        stcIP6Address* pNext = m_pIP6Addresses->m_pNext;
         delete m_pIP6Addresses;
         m_pIP6Addresses = pNext;
     }
@@ -1999,7 +1875,6 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP6Addresses(void)
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
 {
-
     bool bResult = false;
 
     if (p_pIP6Address)
@@ -2016,14 +1891,13 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address(MDNSResponder:
 */
 bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if (p_pIP6Address)
     {
-        stcIP6Address*  pPred = m_pIP6Addresses;
+        stcIP6Address* pPred = m_pIP6Addresses;
         while ((pPred) &&
-                (pPred->m_pNext != p_pIP6Address))
+               (pPred->m_pNext != p_pIP6Address))
         {
             pPred = pPred->m_pNext;
         }
@@ -2033,7 +1907,7 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address(MDNSRespond
             delete p_pIP6Address;
             bResult = true;
         }
-        else if (m_pIP6Addresses == p_pIP6Address)     // No predecessor, but first item
+        else if (m_pIP6Addresses == p_pIP6Address)  // No predecessor, but first item
         {
             m_pIP6Addresses = p_pIP6Address->m_pNext;
             delete p_pIP6Address;
@@ -2048,7 +1922,6 @@ bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address(MDNSRespond
 */
 MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IP6Address& p_IPAddress)
 {
-
     return (stcIP6Address*)(((const stcAnswer*)this)->findIP6Address(p_IPAddress));
 }
 
@@ -2057,8 +1930,7 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stc
 */
 const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IPAddress& p_IPAddress) const
 {
-
-    const stcIP6Address*    pIP6Address = m_pIP6Addresses;
+    const stcIP6Address* pIP6Address = m_pIP6Addresses;
     while (pIP6Address)
     {
         if (p_IP6Address->m_IPAddress == p_IPAddress)
@@ -2075,10 +1947,9 @@ const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponde
 */
 uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount(void) const
 {
+    uint32_t u32Count = 0;
 
-    uint32_t    u32Count = 0;
-
-    stcIP6Address*  pIP6Address = m_pIP6Addresses;
+    stcIP6Address* pIP6Address = m_pIP6Addresses;
     while (pIP6Address)
     {
         ++u32Count;
@@ -2092,7 +1963,6 @@ uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount(void) co
 */
 const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index) const
 {
-
     return (stcIP6Address*)(((const stcAnswer*)this)->IP6AddressAtIndex(p_u32Index));
 }
 
@@ -2101,21 +1971,19 @@ const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponde
 */
 MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index)
 {
-
-    stcIP6Address*    pIP6Address = 0;
+    stcIP6Address* pIP6Address = 0;
 
     if (((uint32_t)(-1) != p_u32Index) &&
-            (m_pIP6Addresses))
+        (m_pIP6Addresses))
     {
-
-        uint32_t    u32Index;
-        for (pIP6Address = m_pIP6Addresses, u32Index = 0; ((pIP6Address) && (u32Index < p_u32Index)); pIP6Address = pIP6Address->m_pNext, ++u32Index);
+        uint32_t u32Index;
+        for (pIP6Address = m_pIP6Addresses, u32Index = 0; ((pIP6Address) && (u32Index < p_u32Index)); pIP6Address = pIP6Address->m_pNext, ++u32Index)
+            ;
     }
     return pIP6Address;
 }
 #endif
 
-
 /**
     MDNSResponder::stcMDNSServiceQuery
 
@@ -2137,15 +2005,14 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stc
     MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery constructor
 */
 MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery(void)
-    :   m_pNext(0),
-        m_fnCallback(0),
-        m_bLegacyQuery(false),
-        m_u8SentCount(0),
-        m_ResendTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
-        m_bAwaitingAnswers(true),
-        m_pAnswers(0)
+    : m_pNext(0),
+      m_fnCallback(0),
+      m_bLegacyQuery(false),
+      m_u8SentCount(0),
+      m_ResendTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
+      m_bAwaitingAnswers(true),
+      m_pAnswers(0)
 {
-
     clear();
 }
 
@@ -2154,7 +2021,6 @@ MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery(void)
 */
 MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery(void)
 {
-
     clear();
 }
 
@@ -2163,7 +2029,6 @@ MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery(void)
 */
 bool MDNSResponder::stcMDNSServiceQuery::clear(void)
 {
-
     m_fnCallback = 0;
     m_bLegacyQuery = false;
     m_u8SentCount = 0;
@@ -2171,7 +2036,7 @@ bool MDNSResponder::stcMDNSServiceQuery::clear(void)
     m_bAwaitingAnswers = true;
     while (m_pAnswers)
     {
-        stcAnswer*  pNext = m_pAnswers->m_pNext;
+        stcAnswer* pNext = m_pAnswers->m_pNext;
         delete m_pAnswers;
         m_pAnswers = pNext;
     }
@@ -2183,10 +2048,9 @@ bool MDNSResponder::stcMDNSServiceQuery::clear(void)
 */
 uint32_t MDNSResponder::stcMDNSServiceQuery::answerCount(void) const
 {
+    uint32_t u32Count = 0;
 
-    uint32_t    u32Count = 0;
-
-    stcAnswer*  pAnswer = m_pAnswers;
+    stcAnswer* pAnswer = m_pAnswers;
     while (pAnswer)
     {
         ++u32Count;
@@ -2200,15 +2064,14 @@ uint32_t MDNSResponder::stcMDNSServiceQuery::answerCount(void) const
 */
 const MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index) const
 {
-
-    const stcAnswer*    pAnswer = 0;
+    const stcAnswer* pAnswer = 0;
 
     if (((uint32_t)(-1) != p_u32Index) &&
-            (m_pAnswers))
+        (m_pAnswers))
     {
-
-        uint32_t    u32Index;
-        for (pAnswer = m_pAnswers, u32Index = 0; ((pAnswer) && (u32Index < p_u32Index)); pAnswer = pAnswer->m_pNext, ++u32Index);
+        uint32_t u32Index;
+        for (pAnswer = m_pAnswers, u32Index = 0; ((pAnswer) && (u32Index < p_u32Index)); pAnswer = pAnswer->m_pNext, ++u32Index)
+            ;
     }
     return pAnswer;
 }
@@ -2218,7 +2081,6 @@ const MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServi
 */
 MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index)
 {
-
     return (stcAnswer*)(((const stcMDNSServiceQuery*)this)->answerAtIndex(p_u32Index));
 }
 
@@ -2227,8 +2089,7 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuer
 */
 uint32_t MDNSResponder::stcMDNSServiceQuery::indexOfAnswer(const MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer) const
 {
-
-    uint32_t    u32Index = 0;
+    uint32_t u32Index = 0;
 
     for (const stcAnswer* pAnswer = m_pAnswers; pAnswer; pAnswer = pAnswer->m_pNext, ++u32Index)
     {
@@ -2245,8 +2106,7 @@ uint32_t MDNSResponder::stcMDNSServiceQuery::indexOfAnswer(const MDNSResponder::
 */
 bool MDNSResponder::stcMDNSServiceQuery::addAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if (p_pAnswer)
     {
@@ -2262,14 +2122,13 @@ bool MDNSResponder::stcMDNSServiceQuery::addAnswer(MDNSResponder::stcMDNSService
 */
 bool MDNSResponder::stcMDNSServiceQuery::removeAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if (p_pAnswer)
     {
-        stcAnswer*  pPred = m_pAnswers;
+        stcAnswer* pPred = m_pAnswers;
         while ((pPred) &&
-                (pPred->m_pNext != p_pAnswer))
+               (pPred->m_pNext != p_pAnswer))
         {
             pPred = pPred->m_pNext;
         }
@@ -2279,7 +2138,7 @@ bool MDNSResponder::stcMDNSServiceQuery::removeAnswer(MDNSResponder::stcMDNSServ
             delete p_pAnswer;
             bResult = true;
         }
-        else if (m_pAnswers == p_pAnswer)   // No predecessor, but first item
+        else if (m_pAnswers == p_pAnswer)  // No predecessor, but first item
         {
             m_pAnswers = p_pAnswer->m_pNext;
             delete p_pAnswer;
@@ -2294,8 +2153,7 @@ bool MDNSResponder::stcMDNSServiceQuery::removeAnswer(MDNSResponder::stcMDNSServ
 */
 MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForServiceDomain(const MDNSResponder::stcMDNS_RRDomain& p_ServiceDomain)
 {
-
-    stcAnswer*  pAnswer = m_pAnswers;
+    stcAnswer* pAnswer = m_pAnswers;
     while (pAnswer)
     {
         if (pAnswer->m_ServiceDomain == p_ServiceDomain)
@@ -2312,8 +2170,7 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuer
 */
 MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForHostDomain(const MDNSResponder::stcMDNS_RRDomain& p_HostDomain)
 {
-
-    stcAnswer*  pAnswer = m_pAnswers;
+    stcAnswer* pAnswer = m_pAnswers;
     while (pAnswer)
     {
         if (pAnswer->m_HostDomain == p_HostDomain)
@@ -2325,7 +2182,6 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuer
     return pAnswer;
 }
 
-
 /**
     MDNSResponder::stcMDNSSendParameter
 
@@ -2347,14 +2203,13 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuer
     MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem constructor
 */
 MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem(const void* p_pHostnameOrService,
-        bool p_bAdditionalData,
-        uint32_t p_u16Offset)
-    :   m_pNext(0),
-        m_pHostnameOrService(p_pHostnameOrService),
-        m_bAdditionalData(p_bAdditionalData),
-        m_u16Offset(p_u16Offset)
+                                                                            bool p_bAdditionalData,
+                                                                            uint32_t p_u16Offset)
+    : m_pNext(0),
+      m_pHostnameOrService(p_pHostnameOrService),
+      m_bAdditionalData(p_bAdditionalData),
+      m_u16Offset(p_u16Offset)
 {
-
 }
 
 /**
@@ -2365,10 +2220,9 @@ MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem(cons
     MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter constructor
 */
 MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter(void)
-    :   m_pQuestions(0),
-        m_pDomainCacheItems(0)
+    : m_pQuestions(0),
+      m_pDomainCacheItems(0)
 {
-
     clear();
 }
 
@@ -2377,7 +2231,6 @@ MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter(void)
 */
 MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter(void)
 {
-
     clear();
 }
 
@@ -2386,7 +2239,6 @@ MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter(void)
 */
 bool MDNSResponder::stcMDNSSendParameter::clear(void)
 {
-
     m_u16ID = 0;
     m_u8HostReplyMask = 0;
     m_u16Offset = 0;
@@ -2406,14 +2258,14 @@ bool MDNSResponder::stcMDNSSendParameter::clear(void)
         m_pQuestions = pNext;
     }
 
-    return clearCachedNames();;
+    return clearCachedNames();
+    ;
 }
 /*
     MDNSResponder::stcMDNSSendParameter::clear cached names
 */
 bool MDNSResponder::stcMDNSSendParameter::clearCachedNames(void)
 {
-
     m_u16Offset = 0;
 
     while (m_pDomainCacheItems)
@@ -2432,7 +2284,6 @@ bool MDNSResponder::stcMDNSSendParameter::clearCachedNames(void)
 */
 bool MDNSResponder::stcMDNSSendParameter::shiftOffset(uint16_t p_u16Shift)
 {
-
     m_u16Offset += p_u16Shift;
     return true;
 }
@@ -2441,18 +2292,16 @@ bool MDNSResponder::stcMDNSSendParameter::shiftOffset(uint16_t p_u16Shift)
     MDNSResponder::stcMDNSSendParameter::addDomainCacheItem
 */
 bool MDNSResponder::stcMDNSSendParameter::addDomainCacheItem(const void* p_pHostnameOrService,
-        bool p_bAdditionalData,
-        uint16_t p_u16Offset)
+                                                             bool p_bAdditionalData,
+                                                             uint16_t p_u16Offset)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     stcDomainCacheItem* pNewItem = 0;
     if ((p_pHostnameOrService) &&
-            (p_u16Offset) &&
-            ((pNewItem = new stcDomainCacheItem(p_pHostnameOrService, p_bAdditionalData, p_u16Offset))))
+        (p_u16Offset) &&
+        ((pNewItem = new stcDomainCacheItem(p_pHostnameOrService, p_bAdditionalData, p_u16Offset))))
     {
-
         pNewItem->m_pNext = m_pDomainCacheItems;
         bResult = ((m_pDomainCacheItems = pNewItem));
     }
@@ -2463,15 +2312,14 @@ bool MDNSResponder::stcMDNSSendParameter::addDomainCacheItem(const void* p_pHost
     MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset
 */
 uint16_t MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset(const void* p_pHostnameOrService,
-        bool p_bAdditionalData) const
+                                                                     bool p_bAdditionalData) const
 {
-
-    const stcDomainCacheItem*   pCacheItem = m_pDomainCacheItems;
+    const stcDomainCacheItem* pCacheItem = m_pDomainCacheItems;
 
     for (; pCacheItem; pCacheItem = pCacheItem->m_pNext)
     {
         if ((pCacheItem->m_pHostnameOrService == p_pHostnameOrService) &&
-                (pCacheItem->m_bAdditionalData == p_bAdditionalData))   // Found cache item
+            (pCacheItem->m_bAdditionalData == p_bAdditionalData))  // Found cache item
         {
             break;
         }
@@ -2479,9 +2327,6 @@ uint16_t MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset(const void*
     return (pCacheItem ? pCacheItem->m_u16Offset : 0);
 }
 
-}   // namespace MDNSImplementation
-
-} // namespace esp8266
-
-
+}  // namespace MDNSImplementation
 
+}  // namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
index ebe66dff1c..4248b582a8 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
@@ -22,46 +22,43 @@
 
 */
 
-extern "C" {
+extern "C"
+{
 #include "user_interface.h"
 }
 
 #include "ESP8266mDNS.h"
-#include "LEAmDNS_lwIPdefs.h"
 #include "LEAmDNS_Priv.h"
-
+#include "LEAmDNS_lwIPdefs.h"
 
 namespace esp8266
 {
-
 /*
     LEAmDNS
 */
 namespace MDNSImplementation
 {
-
 /**
     CONST STRINGS
 */
-static const char*                      scpcLocal               = "local";
-static const char*                      scpcServices            = "services";
-static const char*                      scpcDNSSD               = "dns-sd";
-static const char*                      scpcUDP                 = "udp";
+static const char* scpcLocal = "local";
+static const char* scpcServices = "services";
+static const char* scpcDNSSD = "dns-sd";
+static const char* scpcUDP = "udp";
 //static const char*                    scpcTCP                 = "tcp";
 
 #ifdef MDNS_IP4_SUPPORT
-static const char*                  scpcReverseIP4Domain    = "in-addr";
+static const char* scpcReverseIP4Domain = "in-addr";
 #endif
 #ifdef MDNS_IP6_SUPPORT
-static const char*                  scpcReverseIP6Domain    = "ip6";
+static const char* scpcReverseIP6Domain = "ip6";
 #endif
-static const char*                      scpcReverseTopDomain    = "arpa";
+static const char* scpcReverseTopDomain = "arpa";
 
 /**
     TRANSFER
 */
 
-
 /**
     SENDING
 */
@@ -77,22 +74,21 @@ static const char*                      scpcReverseTopDomain    = "arpa";
 */
 bool MDNSResponder::_sendMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
-
-    bool    bResult = true;
+    bool bResult = true;
 
     if (p_rSendParameter.m_bResponse &&
-            p_rSendParameter.m_bUnicast)    // Unicast response  -> Send to querier
+        p_rSendParameter.m_bUnicast)  // Unicast response  -> Send to querier
     {
         DEBUG_EX_ERR(if (!m_pUDPContext->getRemoteAddress())
-    {
-        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: MISSING remote address for response!\n"));
-        });
-        IPAddress   ipRemote;
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: MISSING remote address for response!\n"));
+                     });
+        IPAddress ipRemote;
         ipRemote = m_pUDPContext->getRemoteAddress();
         bResult = ((_prepareMDNSMessage(p_rSendParameter, m_pUDPContext->getInputNetif()->ip_addr)) &&
                    (m_pUDPContext->sendTimeout(ipRemote, m_pUDPContext->getRemotePort(), MDNS_UDPCONTEXT_TIMEOUT)));
     }
-    else                                // Multicast response
+    else  // Multicast response
     {
         bResult = _sendMDNSMessage_Multicast(p_rSendParameter);
     }
@@ -104,9 +100,9 @@ bool MDNSResponder::_sendMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSen
     }
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -118,33 +114,32 @@ bool MDNSResponder::_sendMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSen
 */
 bool MDNSResponder::_sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
     {
         if (netif_is_up(pNetIf))
         {
-            IPAddress   fromIPAddress;
+            IPAddress fromIPAddress;
             //fromIPAddress = _getResponseMulticastInterface();
             fromIPAddress = pNetIf->ip_addr;
             m_pUDPContext->setMulticastInterface(fromIPAddress);
 
 #ifdef MDNS_IP4_SUPPORT
-            IPAddress   toMulticastAddress(DNS_MQUERY_IPV4_GROUP_INIT);
+            IPAddress toMulticastAddress(DNS_MQUERY_IPV4_GROUP_INIT);
 #endif
 #ifdef MDNS_IP6_SUPPORT
             //TODO: set multicast address
-            IPAddress   toMulticastAddress(DNS_MQUERY_IPV6_GROUP_INIT);
+            IPAddress toMulticastAddress(DNS_MQUERY_IPV6_GROUP_INIT);
 #endif
             DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: Will send to '%s'.\n"), toMulticastAddress.toString().c_str()););
             bResult = ((_prepareMDNSMessage(p_rSendParameter, fromIPAddress)) &&
                        (m_pUDPContext->sendTimeout(toMulticastAddress, DNS_MQUERY_PORT, MDNS_UDPCONTEXT_TIMEOUT)));
 
             DEBUG_EX_ERR(if (!bResult)
-        {
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: FAILED!\n"));
-            });
+                         {
+                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: FAILED!\n"));
+                         });
         }
     }
     return bResult;
@@ -163,24 +158,24 @@ bool MDNSResponder::_prepareMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_r
                                         IPAddress p_IPAddress)
 {
     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage\n")););
-    bool    bResult = true;
-    p_rSendParameter.clearCachedNames(); // Need to remove cached names, p_SendParameter might have been used before on other interface
+    bool bResult = true;
+    p_rSendParameter.clearCachedNames();  // Need to remove cached names, p_SendParameter might have been used before on other interface
 
     // Prepare header; count answers
-    stcMDNS_MsgHeader  msgHeader(p_rSendParameter.m_u16ID, p_rSendParameter.m_bResponse, 0, p_rSendParameter.m_bAuthorative);
+    stcMDNS_MsgHeader msgHeader(p_rSendParameter.m_u16ID, p_rSendParameter.m_bResponse, 0, p_rSendParameter.m_bAuthorative);
     // If this is a response, the answers are anwers,
     // else this is a query or probe and the answers go into auth section
-    uint16_t&           ru16Answers = (p_rSendParameter.m_bResponse
-                                       ? msgHeader.m_u16ANCount
-                                       : msgHeader.m_u16NSCount);
+    uint16_t& ru16Answers = (p_rSendParameter.m_bResponse
+                                 ? msgHeader.m_u16ANCount
+                                 : msgHeader.m_u16NSCount);
 
     /**
         enuSequence
     */
     enum enuSequence
     {
-        Sequence_Count  = 0,
-        Sequence_Send   = 1
+        Sequence_Count = 0,
+        Sequence_Send = 1
     };
 
     // Two step sequence: 'Count' and 'Send'
@@ -188,66 +183,65 @@ bool MDNSResponder::_prepareMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_r
     {
         DEBUG_EX_INFO(
             if (Sequence_Send == sequence)
-    {
-        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
-                              (unsigned)msgHeader.m_u16ID,
-                              (unsigned)msgHeader.m_1bQR, (unsigned)msgHeader.m_4bOpcode, (unsigned)msgHeader.m_1bAA, (unsigned)msgHeader.m_1bTC, (unsigned)msgHeader.m_1bRD,
-                              (unsigned)msgHeader.m_1bRA, (unsigned)msgHeader.m_4bRCode,
-                              (unsigned)msgHeader.m_u16QDCount,
-                              (unsigned)msgHeader.m_u16ANCount,
-                              (unsigned)msgHeader.m_u16NSCount,
-                              (unsigned)msgHeader.m_u16ARCount);
-        }
-        );
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
+                                      (unsigned)msgHeader.m_u16ID,
+                                      (unsigned)msgHeader.m_1bQR, (unsigned)msgHeader.m_4bOpcode, (unsigned)msgHeader.m_1bAA, (unsigned)msgHeader.m_1bTC, (unsigned)msgHeader.m_1bRD,
+                                      (unsigned)msgHeader.m_1bRA, (unsigned)msgHeader.m_4bRCode,
+                                      (unsigned)msgHeader.m_u16QDCount,
+                                      (unsigned)msgHeader.m_u16ANCount,
+                                      (unsigned)msgHeader.m_u16NSCount,
+                                      (unsigned)msgHeader.m_u16ARCount);
+            });
         // Count/send
         // Header
         bResult = ((Sequence_Count == sequence)
-                   ? true
-                   : _writeMDNSMsgHeader(msgHeader, p_rSendParameter));
+                       ? true
+                       : _writeMDNSMsgHeader(msgHeader, p_rSendParameter));
         DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSMsgHeader FAILED!\n")););
         // Questions
         for (stcMDNS_RRQuestion* pQuestion = p_rSendParameter.m_pQuestions; ((bResult) && (pQuestion)); pQuestion = pQuestion->m_pNext)
         {
             ((Sequence_Count == sequence)
-             ? ++msgHeader.m_u16QDCount
-             : (bResult = _writeMDNSQuestion(*pQuestion, p_rSendParameter)));
+                 ? ++msgHeader.m_u16QDCount
+                 : (bResult = _writeMDNSQuestion(*pQuestion, p_rSendParameter)));
             DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSQuestion FAILED!\n")););
         }
 
         // Answers and authoritative answers
 #ifdef MDNS_IP4_SUPPORT
         if ((bResult) &&
-                (p_rSendParameter.m_u8HostReplyMask & ContentFlag_A))
+            (p_rSendParameter.m_u8HostReplyMask & ContentFlag_A))
         {
             ((Sequence_Count == sequence)
-             ? ++ru16Answers
-             : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
+                 ? ++ru16Answers
+                 : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
             DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(A) FAILED!\n")););
         }
         if ((bResult) &&
-                (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP4))
+            (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP4))
         {
             ((Sequence_Count == sequence)
-             ? ++ru16Answers
-             : (bResult = _writeMDNSAnswer_PTR_IP4(p_IPAddress, p_rSendParameter)));
+                 ? ++ru16Answers
+                 : (bResult = _writeMDNSAnswer_PTR_IP4(p_IPAddress, p_rSendParameter)));
             DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP4 FAILED!\n")););
         }
 #endif
 #ifdef MDNS_IP6_SUPPORT
         if ((bResult) &&
-                (p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA))
+            (p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA))
         {
             ((Sequence_Count == sequence)
-             ? ++ru16Answers
-             : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
+                 ? ++ru16Answers
+                 : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
             DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(A) FAILED!\n")););
         }
         if ((bResult) &&
-                (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP6))
+            (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP6))
         {
             ((Sequence_Count == sequence)
-             ? ++ru16Answers
-             : (bResult = _writeMDNSAnswer_PTR_IP6(p_IPAddress, p_rSendParameter)));
+                 ? ++ru16Answers
+                 : (bResult = _writeMDNSAnswer_PTR_IP6(p_IPAddress, p_rSendParameter)));
             DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP6 FAILED!\n")););
         }
 #endif
@@ -255,110 +249,110 @@ bool MDNSResponder::_prepareMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_r
         for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
         {
             if ((bResult) &&
-                    (pService->m_u8ReplyMask & ContentFlag_PTR_TYPE))
+                (pService->m_u8ReplyMask & ContentFlag_PTR_TYPE))
             {
                 ((Sequence_Count == sequence)
-                 ? ++ru16Answers
-                 : (bResult = _writeMDNSAnswer_PTR_TYPE(*pService, p_rSendParameter)));
+                     ? ++ru16Answers
+                     : (bResult = _writeMDNSAnswer_PTR_TYPE(*pService, p_rSendParameter)));
                 DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_TYPE FAILED!\n")););
             }
             if ((bResult) &&
-                    (pService->m_u8ReplyMask & ContentFlag_PTR_NAME))
+                (pService->m_u8ReplyMask & ContentFlag_PTR_NAME))
             {
                 ((Sequence_Count == sequence)
-                 ? ++ru16Answers
-                 : (bResult = _writeMDNSAnswer_PTR_NAME(*pService, p_rSendParameter)));
+                     ? ++ru16Answers
+                     : (bResult = _writeMDNSAnswer_PTR_NAME(*pService, p_rSendParameter)));
                 DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_NAME FAILED!\n")););
             }
             if ((bResult) &&
-                    (pService->m_u8ReplyMask & ContentFlag_SRV))
+                (pService->m_u8ReplyMask & ContentFlag_SRV))
             {
                 ((Sequence_Count == sequence)
-                 ? ++ru16Answers
-                 : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
+                     ? ++ru16Answers
+                     : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
                 DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(A) FAILED!\n")););
             }
             if ((bResult) &&
-                    (pService->m_u8ReplyMask & ContentFlag_TXT))
+                (pService->m_u8ReplyMask & ContentFlag_TXT))
             {
                 ((Sequence_Count == sequence)
-                 ? ++ru16Answers
-                 : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
+                     ? ++ru16Answers
+                     : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
                 DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(A) FAILED!\n")););
             }
-        }   // for services
+        }  // for services
 
         // Additional answers
 #ifdef MDNS_IP4_SUPPORT
-        bool    bNeedsAdditionalAnswerA = false;
+        bool bNeedsAdditionalAnswerA = false;
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        bool    bNeedsAdditionalAnswerAAAA = false;
+        bool bNeedsAdditionalAnswerAAAA = false;
 #endif
         for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
         {
             if ((bResult) &&
-                    (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) && // If PTR_NAME is requested, AND
-                    (!(pService->m_u8ReplyMask & ContentFlag_SRV)))     // NOT SRV -> add SRV as additional answer
+                (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) &&  // If PTR_NAME is requested, AND
+                (!(pService->m_u8ReplyMask & ContentFlag_SRV)))      // NOT SRV -> add SRV as additional answer
             {
                 ((Sequence_Count == sequence)
-                 ? ++msgHeader.m_u16ARCount
-                 : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
+                     ? ++msgHeader.m_u16ARCount
+                     : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
                 DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(B) FAILED!\n")););
             }
             if ((bResult) &&
-                    (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) && // If PTR_NAME is requested, AND
-                    (!(pService->m_u8ReplyMask & ContentFlag_TXT)))     // NOT TXT -> add TXT as additional answer
+                (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) &&  // If PTR_NAME is requested, AND
+                (!(pService->m_u8ReplyMask & ContentFlag_TXT)))      // NOT TXT -> add TXT as additional answer
             {
                 ((Sequence_Count == sequence)
-                 ? ++msgHeader.m_u16ARCount
-                 : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
+                     ? ++msgHeader.m_u16ARCount
+                     : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
                 DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(B) FAILED!\n")););
             }
-            if ((pService->m_u8ReplyMask & (ContentFlag_PTR_NAME | ContentFlag_SRV)) ||         // If service instance name or SRV OR
-                    (p_rSendParameter.m_u8HostReplyMask & (ContentFlag_A | ContentFlag_AAAA)))      // any host IP address is requested
+            if ((pService->m_u8ReplyMask & (ContentFlag_PTR_NAME | ContentFlag_SRV)) ||     // If service instance name or SRV OR
+                (p_rSendParameter.m_u8HostReplyMask & (ContentFlag_A | ContentFlag_AAAA)))  // any host IP address is requested
             {
 #ifdef MDNS_IP4_SUPPORT
                 if ((bResult) &&
-                        (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_A)))            // Add IP4 address
+                    (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_A)))  // Add IP4 address
                 {
                     bNeedsAdditionalAnswerA = true;
                 }
 #endif
 #ifdef MDNS_IP6_SUPPORT
                 if ((bResult) &&
-                        (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA)))         // Add IP6 address
+                    (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA)))  // Add IP6 address
                 {
                     bNeedsAdditionalAnswerAAAA = true;
                 }
 #endif
             }
-        }   // for services
+        }  // for services
 
         // Answer A needed?
 #ifdef MDNS_IP4_SUPPORT
         if ((bResult) &&
-                (bNeedsAdditionalAnswerA))
+            (bNeedsAdditionalAnswerA))
         {
             ((Sequence_Count == sequence)
-             ? ++msgHeader.m_u16ARCount
-             : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
+                 ? ++msgHeader.m_u16ARCount
+                 : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
             DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(B) FAILED!\n")););
         }
 #endif
 #ifdef MDNS_IP6_SUPPORT
         // Answer AAAA needed?
         if ((bResult) &&
-                (bNeedsAdditionalAnswerAAAA))
+            (bNeedsAdditionalAnswerAAAA))
         {
             ((Sequence_Count == sequence)
-             ? ++msgHeader.m_u16ARCount
-             : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
+                 ? ++msgHeader.m_u16ARCount
+                 : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
             DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(B) FAILED!\n")););
         }
 #endif
         DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: Loop %i FAILED!\n"), sequence););
-    }   // for sequence
+    }  // for sequence
     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: FAILED!\n")););
     return bResult;
 }
@@ -371,7 +365,6 @@ bool MDNSResponder::_prepareMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_r
 */
 bool MDNSResponder::_sendMDNSServiceQuery(const MDNSResponder::stcMDNSServiceQuery& p_ServiceQuery)
 {
-
     return _sendMDNSQuery(p_ServiceQuery.m_ServiceTypeDomain, DNS_RRTYPE_PTR);
 }
 
@@ -385,23 +378,22 @@ bool MDNSResponder::_sendMDNSQuery(const MDNSResponder::stcMDNS_RRDomain& p_Quer
                                    uint16_t p_u16QueryType,
                                    stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers /*= 0*/)
 {
+    bool bResult = false;
 
-    bool                    bResult = false;
-
-    stcMDNSSendParameter    sendParameter;
+    stcMDNSSendParameter sendParameter;
     if (0 != ((sendParameter.m_pQuestions = new stcMDNS_RRQuestion)))
     {
         sendParameter.m_pQuestions->m_Header.m_Domain = p_QueryDomain;
 
         sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = p_u16QueryType;
         // It seems, that some mDNS implementations don't support 'unicast response' questions...
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (/*0x8000 |*/ DNS_RRCLASS_IN);   // /*Unicast &*/ INternet
+        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (/*0x8000 |*/ DNS_RRCLASS_IN);  // /*Unicast &*/ INternet
 
         // TODO: Add known answer to the query
         (void)p_pKnownAnswers;
 
         bResult = _sendMDNSMessage(sendParameter);
-    }   // else: FAILED to alloc question
+    }  // else: FAILED to alloc question
     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSQuery: FAILED to alloc question!\n")););
     return bResult;
 }
@@ -424,7 +416,7 @@ bool MDNSResponder::_readRRQuestion(MDNSResponder::stcMDNS_RRQuestion& p_rRRQues
 {
     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion\n")););
 
-    bool    bResult = false;
+    bool bResult = false;
 
     if ((bResult = _readRRHeader(p_rRRQuestion.m_Header)))
     {
@@ -435,13 +427,12 @@ bool MDNSResponder::_readRRQuestion(MDNSResponder::stcMDNS_RRQuestion& p_rRRQues
         DEBUG_EX_INFO(
             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion "));
             _printRRDomain(p_rRRQuestion.m_Header.m_Domain);
-            DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X %s\n"), (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Type, (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Class, (p_rRRQuestion.m_bUnicast ? "Unicast" : "Multicast"));
-        );
+            DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X %s\n"), (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Type, (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Class, (p_rRRQuestion.m_bUnicast ? "Unicast" : "Multicast")););
     }
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -460,103 +451,100 @@ bool MDNSResponder::_readRRAnswer(MDNSResponder::stcMDNS_RRAnswer*& p_rpRRAnswer
 {
     //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer\n")););
 
-    bool    bResult = false;
+    bool bResult = false;
 
-    stcMDNS_RRHeader    header;
-    uint32_t            u32TTL;
-    uint16_t            u16RDLength;
+    stcMDNS_RRHeader header;
+    uint32_t u32TTL;
+    uint16_t u16RDLength;
     if ((_readRRHeader(header)) &&
-            (_udpRead32(u32TTL)) &&
-            (_udpRead16(u16RDLength)))
+        (_udpRead32(u32TTL)) &&
+        (_udpRead16(u16RDLength)))
     {
-
         /*  DEBUG_EX_INFO(
                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: Reading 0x%04X answer (class:0x%04X, TTL:%u, RDLength:%u) for "), header.m_Attributes.m_u16Type, header.m_Attributes.m_u16Class, u32TTL, u16RDLength);
                 _printRRDomain(header.m_Domain);
                 DEBUG_OUTPUT.printf_P(PSTR("\n"));
                 );*/
 
-        switch (header.m_Attributes.m_u16Type & (~0x8000))      // Topmost bit might carry 'cache flush' flag
+        switch (header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
         {
-#ifdef MDNS_IP4_SUPPORT
-        case DNS_RRTYPE_A:
-            p_rpRRAnswer = new stcMDNS_RRAnswerA(header, u32TTL);
-            bResult = _readRRAnswerA(*(stcMDNS_RRAnswerA*&)p_rpRRAnswer, u16RDLength);
-            break;
-#endif
-        case DNS_RRTYPE_PTR:
-            p_rpRRAnswer = new stcMDNS_RRAnswerPTR(header, u32TTL);
-            bResult = _readRRAnswerPTR(*(stcMDNS_RRAnswerPTR*&)p_rpRRAnswer, u16RDLength);
-            break;
-        case DNS_RRTYPE_TXT:
-            p_rpRRAnswer = new stcMDNS_RRAnswerTXT(header, u32TTL);
-            bResult = _readRRAnswerTXT(*(stcMDNS_RRAnswerTXT*&)p_rpRRAnswer, u16RDLength);
-            break;
-#ifdef MDNS_IP6_SUPPORT
-        case DNS_RRTYPE_AAAA:
-            p_rpRRAnswer = new stcMDNS_RRAnswerAAAA(header, u32TTL);
-            bResult = _readRRAnswerAAAA(*(stcMDNS_RRAnswerAAAA*&)p_rpRRAnswer, u16RDLength);
-            break;
-#endif
-        case DNS_RRTYPE_SRV:
-            p_rpRRAnswer = new stcMDNS_RRAnswerSRV(header, u32TTL);
-            bResult = _readRRAnswerSRV(*(stcMDNS_RRAnswerSRV*&)p_rpRRAnswer, u16RDLength);
-            break;
-        default:
-            p_rpRRAnswer = new stcMDNS_RRAnswerGeneric(header, u32TTL);
-            bResult = _readRRAnswerGeneric(*(stcMDNS_RRAnswerGeneric*&)p_rpRRAnswer, u16RDLength);
-            break;
-        }
-        DEBUG_EX_INFO(
-            if ((bResult) &&
-                (p_rpRRAnswer))
-    {
-        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: "));
-            _printRRDomain(p_rpRRAnswer->m_Header.m_Domain);
-            DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, RDLength:%u "), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type, p_rpRRAnswer->m_Header.m_Attributes.m_u16Class, p_rpRRAnswer->m_u32TTL, u16RDLength);
-            switch (header.m_Attributes.m_u16Type & (~0x8000))      // Topmost bit might carry 'cache flush' flag
-            {
 #ifdef MDNS_IP4_SUPPORT
             case DNS_RRTYPE_A:
-                DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
+                p_rpRRAnswer = new stcMDNS_RRAnswerA(header, u32TTL);
+                bResult = _readRRAnswerA(*(stcMDNS_RRAnswerA*&)p_rpRRAnswer, u16RDLength);
                 break;
 #endif
             case DNS_RRTYPE_PTR:
-                DEBUG_OUTPUT.printf_P(PSTR("PTR "));
-                _printRRDomain(((stcMDNS_RRAnswerPTR*&)p_rpRRAnswer)->m_PTRDomain);
+                p_rpRRAnswer = new stcMDNS_RRAnswerPTR(header, u32TTL);
+                bResult = _readRRAnswerPTR(*(stcMDNS_RRAnswerPTR*&)p_rpRRAnswer, u16RDLength);
                 break;
             case DNS_RRTYPE_TXT:
-            {
-                size_t  stTxtLength = ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_strLength();
-                char*   pTxts = new char[stTxtLength];
-                if (pTxts)
-                {
-                    ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_str(pTxts);
-                    DEBUG_OUTPUT.printf_P(PSTR("TXT(%zu) %s"), stTxtLength, pTxts);
-                    delete[] pTxts;
-                }
+                p_rpRRAnswer = new stcMDNS_RRAnswerTXT(header, u32TTL);
+                bResult = _readRRAnswerTXT(*(stcMDNS_RRAnswerTXT*&)p_rpRRAnswer, u16RDLength);
                 break;
-            }
 #ifdef MDNS_IP6_SUPPORT
             case DNS_RRTYPE_AAAA:
-                DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
+                p_rpRRAnswer = new stcMDNS_RRAnswerAAAA(header, u32TTL);
+                bResult = _readRRAnswerAAAA(*(stcMDNS_RRAnswerAAAA*&)p_rpRRAnswer, u16RDLength);
                 break;
 #endif
             case DNS_RRTYPE_SRV:
-                DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_u16Port);
-                _printRRDomain(((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_SRVDomain);
+                p_rpRRAnswer = new stcMDNS_RRAnswerSRV(header, u32TTL);
+                bResult = _readRRAnswerSRV(*(stcMDNS_RRAnswerSRV*&)p_rpRRAnswer, u16RDLength);
                 break;
             default:
-                DEBUG_OUTPUT.printf_P(PSTR("generic "));
+                p_rpRRAnswer = new stcMDNS_RRAnswerGeneric(header, u32TTL);
+                bResult = _readRRAnswerGeneric(*(stcMDNS_RRAnswerGeneric*&)p_rpRRAnswer, u16RDLength);
                 break;
-            }
-            DEBUG_OUTPUT.printf_P(PSTR("\n"));
-        }
-        else
-        {
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED to read specific answer of type 0x%04X!\n"), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type);
         }
-        );  // DEBUG_EX_INFO
+        DEBUG_EX_INFO(
+            if ((bResult) &&
+                (p_rpRRAnswer))
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: "));
+                _printRRDomain(p_rpRRAnswer->m_Header.m_Domain);
+                DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, RDLength:%u "), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type, p_rpRRAnswer->m_Header.m_Attributes.m_u16Class, p_rpRRAnswer->m_u32TTL, u16RDLength);
+                switch (header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
+                {
+#ifdef MDNS_IP4_SUPPORT
+                    case DNS_RRTYPE_A:
+                        DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
+                        break;
+#endif
+                    case DNS_RRTYPE_PTR:
+                        DEBUG_OUTPUT.printf_P(PSTR("PTR "));
+                        _printRRDomain(((stcMDNS_RRAnswerPTR*&)p_rpRRAnswer)->m_PTRDomain);
+                        break;
+                    case DNS_RRTYPE_TXT:
+                    {
+                        size_t stTxtLength = ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_strLength();
+                        char* pTxts = new char[stTxtLength];
+                        if (pTxts)
+                        {
+                            ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_str(pTxts);
+                            DEBUG_OUTPUT.printf_P(PSTR("TXT(%zu) %s"), stTxtLength, pTxts);
+                            delete[] pTxts;
+                        }
+                        break;
+                    }
+#ifdef MDNS_IP6_SUPPORT
+                    case DNS_RRTYPE_AAAA:
+                        DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
+                        break;
+#endif
+                    case DNS_RRTYPE_SRV:
+                        DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_u16Port);
+                        _printRRDomain(((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_SRVDomain);
+                        break;
+                    default:
+                        DEBUG_OUTPUT.printf_P(PSTR("generic "));
+                        break;
+                }
+                DEBUG_OUTPUT.printf_P(PSTR("\n"));
+            } else
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED to read specific answer of type 0x%04X!\n"), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type);
+            });  // DEBUG_EX_INFO
     }
     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED!\n")););
     return bResult;
@@ -569,11 +557,10 @@ bool MDNSResponder::_readRRAnswer(MDNSResponder::stcMDNS_RRAnswer*& p_rpRRAnswer
 bool MDNSResponder::_readRRAnswerA(MDNSResponder::stcMDNS_RRAnswerA& p_rRRAnswerA,
                                    uint16_t p_u16RDLength)
 {
-
-    uint32_t    u32IP4Address;
-    bool        bResult = ((MDNS_IP4_SIZE == p_u16RDLength) &&
-                           (_udpReadBuffer((unsigned char*)&u32IP4Address, MDNS_IP4_SIZE)) &&
-                           ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IP4Address))));
+    uint32_t u32IP4Address;
+    bool bResult = ((MDNS_IP4_SIZE == p_u16RDLength) &&
+                    (_udpReadBuffer((unsigned char*)&u32IP4Address, MDNS_IP4_SIZE)) &&
+                    ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IP4Address))));
     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerA: FAILED!\n")););
     return bResult;
 }
@@ -585,9 +572,8 @@ bool MDNSResponder::_readRRAnswerA(MDNSResponder::stcMDNS_RRAnswerA& p_rRRAnswer
 bool MDNSResponder::_readRRAnswerPTR(MDNSResponder::stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
                                      uint16_t p_u16RDLength)
 {
-
-    bool    bResult = ((p_u16RDLength) &&
-                       (_readRRDomain(p_rRRAnswerPTR.m_PTRDomain)));
+    bool bResult = ((p_u16RDLength) &&
+                    (_readRRDomain(p_rRRAnswerPTR.m_PTRDomain)));
     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerPTR: FAILED!\n")););
     return bResult;
 }
@@ -601,43 +587,42 @@ bool MDNSResponder::_readRRAnswerTXT(MDNSResponder::stcMDNS_RRAnswerTXT& p_rRRAn
                                      uint16_t p_u16RDLength)
 {
     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: RDLength:%u\n"), p_u16RDLength););
-    bool    bResult = true;
+    bool bResult = true;
 
     p_rRRAnswerTXT.clear();
     if (p_u16RDLength)
     {
         bResult = false;
 
-        unsigned char*  pucBuffer = new unsigned char[p_u16RDLength];
+        unsigned char* pucBuffer = new unsigned char[p_u16RDLength];
         if (pucBuffer)
         {
             if (_udpReadBuffer(pucBuffer, p_u16RDLength))
             {
                 bResult = true;
 
-                const unsigned char*    pucCursor = pucBuffer;
+                const unsigned char* pucCursor = pucBuffer;
                 while ((pucCursor < (pucBuffer + p_u16RDLength)) &&
-                        (bResult))
+                       (bResult))
                 {
                     bResult = false;
 
-                    stcMDNSServiceTxt*      pTxt = 0;
-                    unsigned char   ucLength = *pucCursor++;    // Length of the next txt item
+                    stcMDNSServiceTxt* pTxt = 0;
+                    unsigned char ucLength = *pucCursor++;  // Length of the next txt item
                     if (ucLength)
                     {
                         DEBUG_EX_INFO(
                             static char sacBuffer[64]; *sacBuffer = 0;
                             uint8_t u8MaxLength = ((ucLength > (sizeof(sacBuffer) - 1)) ? (sizeof(sacBuffer) - 1) : ucLength);
                             os_strncpy(sacBuffer, (const char*)pucCursor, u8MaxLength); sacBuffer[u8MaxLength] = 0;
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: Item(%u): %s\n"), ucLength, sacBuffer);
-                        );
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: Item(%u): %s\n"), ucLength, sacBuffer););
 
-                        unsigned char*  pucEqualSign = (unsigned char*)os_strchr((const char*)pucCursor, '=');  // Position of the '=' sign
-                        unsigned char   ucKeyLength;
+                        unsigned char* pucEqualSign = (unsigned char*)os_strchr((const char*)pucCursor, '=');  // Position of the '=' sign
+                        unsigned char ucKeyLength;
                         if ((pucEqualSign) &&
-                                ((ucKeyLength = (pucEqualSign - pucCursor))))
+                            ((ucKeyLength = (pucEqualSign - pucCursor))))
                         {
-                            unsigned char   ucValueLength = (ucLength - (pucEqualSign - pucCursor + 1));
+                            unsigned char ucValueLength = (ucLength - (pucEqualSign - pucCursor + 1));
                             bResult = (((pTxt = new stcMDNSServiceTxt)) &&
                                        (pTxt->setKey((const char*)pucCursor, ucKeyLength)) &&
                                        (pTxt->setValue((const char*)(pucEqualSign + 1), ucValueLength)));
@@ -648,20 +633,20 @@ bool MDNSResponder::_readRRAnswerTXT(MDNSResponder::stcMDNS_RRAnswerTXT& p_rRRAn
                         }
                         pucCursor += ucLength;
                     }
-                    else    // no/zero length TXT
+                    else  // no/zero length TXT
                     {
                         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: TXT answer contains no items.\n")););
                         bResult = true;
                     }
 
                     if ((bResult) &&
-                            (pTxt))     // Everything is fine so far
+                        (pTxt))  // Everything is fine so far
                     {
                         // Link TXT item to answer TXTs
                         pTxt->m_pNext = p_rRRAnswerTXT.m_Txts.m_pTxts;
                         p_rRRAnswerTXT.m_Txts.m_pTxts = pTxt;
                     }
-                    else            // At least no TXT (might be OK, if length was 0) OR an error
+                    else  // At least no TXT (might be OK, if length was 0) OR an error
                     {
                         if (!bResult)
                         {
@@ -669,8 +654,7 @@ bool MDNSResponder::_readRRAnswerTXT(MDNSResponder::stcMDNS_RRAnswerTXT& p_rRRAn
                                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT item!\n"));
                                 DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
                                 _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
-                                DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                            );
+                                DEBUG_OUTPUT.printf_P(PSTR("\n")););
                         }
                         if (pTxt)
                         {
@@ -679,16 +663,15 @@ bool MDNSResponder::_readRRAnswerTXT(MDNSResponder::stcMDNS_RRAnswerTXT& p_rRRAn
                         }
                         p_rRRAnswerTXT.clear();
                     }
-                }   // while
+                }  // while
 
                 DEBUG_EX_ERR(
-                    if (!bResult)   // Some failure
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
-                    _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
-                    DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                }
-                );
+                    if (!bResult)  // Some failure
+                    {
+                        DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
+                        _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
+                        DEBUG_OUTPUT.printf_P(PSTR("\n"));
+                    });
             }
             else
             {
@@ -714,7 +697,7 @@ bool MDNSResponder::_readRRAnswerTXT(MDNSResponder::stcMDNS_RRAnswerTXT& p_rRRAn
 bool MDNSResponder::_readRRAnswerAAAA(MDNSResponder::stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
                                       uint16_t p_u16RDLength)
 {
-    bool    bResult = false;
+    bool bResult = false;
     // TODO: Implement
     return bResult;
 }
@@ -726,12 +709,11 @@ bool MDNSResponder::_readRRAnswerAAAA(MDNSResponder::stcMDNS_RRAnswerAAAA& p_rRR
 bool MDNSResponder::_readRRAnswerSRV(MDNSResponder::stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
                                      uint16_t p_u16RDLength)
 {
-
-    bool    bResult = (((3 * sizeof(uint16_t)) < p_u16RDLength) &&
-                       (_udpRead16(p_rRRAnswerSRV.m_u16Priority)) &&
-                       (_udpRead16(p_rRRAnswerSRV.m_u16Weight)) &&
-                       (_udpRead16(p_rRRAnswerSRV.m_u16Port)) &&
-                       (_readRRDomain(p_rRRAnswerSRV.m_SRVDomain)));
+    bool bResult = (((3 * sizeof(uint16_t)) < p_u16RDLength) &&
+                    (_udpRead16(p_rRRAnswerSRV.m_u16Priority)) &&
+                    (_udpRead16(p_rRRAnswerSRV.m_u16Weight)) &&
+                    (_udpRead16(p_rRRAnswerSRV.m_u16Port)) &&
+                    (_readRRDomain(p_rRRAnswerSRV.m_SRVDomain)));
     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerSRV: FAILED!\n")););
     return bResult;
 }
@@ -740,15 +722,14 @@ bool MDNSResponder::_readRRAnswerSRV(MDNSResponder::stcMDNS_RRAnswerSRV& p_rRRAn
     MDNSResponder::_readRRAnswerGeneric
 */
 bool MDNSResponder::_readRRAnswerGeneric(MDNSResponder::stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
-        uint16_t p_u16RDLength)
+                                         uint16_t p_u16RDLength)
 {
-    bool    bResult = (0 == p_u16RDLength);
+    bool bResult = (0 == p_u16RDLength);
 
     p_rRRAnswerGeneric.clear();
     if (((p_rRRAnswerGeneric.m_u16RDLength = p_u16RDLength)) &&
-            ((p_rRRAnswerGeneric.m_pu8RDData = new unsigned char[p_rRRAnswerGeneric.m_u16RDLength])))
+        ((p_rRRAnswerGeneric.m_pu8RDData = new unsigned char[p_rRRAnswerGeneric.m_u16RDLength])))
     {
-
         bResult = _udpReadBuffer(p_rRRAnswerGeneric.m_pu8RDData, p_rRRAnswerGeneric.m_u16RDLength);
     }
     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerGeneric: FAILED!\n")););
@@ -762,8 +743,8 @@ bool MDNSResponder::_readRRHeader(MDNSResponder::stcMDNS_RRHeader& p_rRRHeader)
 {
     //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader\n")););
 
-    bool    bResult = ((_readRRDomain(p_rRRHeader.m_Domain)) &&
-                       (_readRRAttributes(p_rRRHeader.m_Attributes)));
+    bool bResult = ((_readRRDomain(p_rRRHeader.m_Domain)) &&
+                    (_readRRAttributes(p_rRRHeader.m_Attributes)));
     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader: FAILED!\n")););
     return bResult;
 }
@@ -778,8 +759,8 @@ bool MDNSResponder::_readRRDomain(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain)
 {
     //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain\n")););
 
-    bool    bResult = ((p_rRRDomain.clear()) &&
-                       (_readRRDomain_Loop(p_rRRDomain, 0)));
+    bool bResult = ((p_rRRDomain.clear()) &&
+                    (_readRRDomain_Loop(p_rRRDomain, 0)));
     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain: FAILED!\n")););
     return bResult;
 }
@@ -797,7 +778,7 @@ bool MDNSResponder::_readRRDomain_Loop(MDNSResponder::stcMDNS_RRDomain& p_rRRDom
 {
     //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u)\n"), p_u8Depth););
 
-    bool    bResult = false;
+    bool bResult = false;
 
     if (MDNS_DOMAIN_MAX_REDIRCTION >= p_u8Depth)
     {
@@ -812,20 +793,20 @@ bool MDNSResponder::_readRRDomain_Loop(MDNSResponder::stcMDNS_RRDomain& p_rRRDom
             if (u8Len & MDNS_DOMAIN_COMPRESS_MARK)
             {
                 // Compressed label(s)
-                uint16_t    u16Offset = ((u8Len & ~MDNS_DOMAIN_COMPRESS_MARK) << 8);    // Implicit BE to LE conversion!
+                uint16_t u16Offset = ((u8Len & ~MDNS_DOMAIN_COMPRESS_MARK) << 8);  // Implicit BE to LE conversion!
                 _udpRead8(u8Len);
                 u16Offset |= u8Len;
 
                 if (m_pUDPContext->isValidOffset(u16Offset))
                 {
-                    size_t  stCurrentPosition = m_pUDPContext->tell();      // Prepare return from recursion
+                    size_t stCurrentPosition = m_pUDPContext->tell();  // Prepare return from recursion
 
                     //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Redirecting from %u to %u!\n"), p_u8Depth, stCurrentPosition, u16Offset););
                     m_pUDPContext->seek(u16Offset);
-                    if (_readRRDomain_Loop(p_rRRDomain, p_u8Depth + 1))     // Do recursion
+                    if (_readRRDomain_Loop(p_rRRDomain, p_u8Depth + 1))  // Do recursion
                     {
                         //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Succeeded to read redirected label! Returning to %u\n"), p_u8Depth, stCurrentPosition););
-                        m_pUDPContext->seek(stCurrentPosition);             // Restore after recursion
+                        m_pUDPContext->seek(stCurrentPosition);  // Restore after recursion
                     }
                     else
                     {
@@ -848,9 +829,9 @@ bool MDNSResponder::_readRRDomain_Loop(MDNSResponder::stcMDNS_RRDomain& p_rRRDom
                     // Add length byte
                     p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength] = u8Len;
                     ++(p_rRRDomain.m_u16NameLength);
-                    if (u8Len)      // Add name
+                    if (u8Len)  // Add name
                     {
-                        if ((bResult = _udpReadBuffer((unsigned char*) & (p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]), u8Len)))
+                        if ((bResult = _udpReadBuffer((unsigned char*)&(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]), u8Len)))
                         {
                             /*  DEBUG_EX_INFO(
                                     p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength + u8Len] = 0;  // Closing '\0' for printing
@@ -886,13 +867,12 @@ bool MDNSResponder::_readRRAttributes(MDNSResponder::stcMDNS_RRAttributes& p_rRR
 {
     //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes\n")););
 
-    bool    bResult = ((_udpRead16(p_rRRAttributes.m_u16Type)) &&
-                       (_udpRead16(p_rRRAttributes.m_u16Class)));
+    bool bResult = ((_udpRead16(p_rRRAttributes.m_u16Type)) &&
+                    (_udpRead16(p_rRRAttributes.m_u16Class)));
     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes: FAILED!\n")););
     return bResult;
 }
 
-
 /*
     DOMAIN NAMES
 */
@@ -906,13 +886,12 @@ bool MDNSResponder::_readRRAttributes(MDNSResponder::stcMDNS_RRAttributes& p_rRR
 bool MDNSResponder::_buildDomainForHost(const char* p_pcHostname,
                                         MDNSResponder::stcMDNS_RRDomain& p_rHostDomain) const
 {
-
     p_rHostDomain.clear();
-    bool    bResult = ((p_pcHostname) &&
-                       (*p_pcHostname) &&
-                       (p_rHostDomain.addLabel(p_pcHostname)) &&
-                       (p_rHostDomain.addLabel(scpcLocal)) &&
-                       (p_rHostDomain.addLabel(0)));
+    bool bResult = ((p_pcHostname) &&
+                    (*p_pcHostname) &&
+                    (p_rHostDomain.addLabel(p_pcHostname)) &&
+                    (p_rHostDomain.addLabel(scpcLocal)) &&
+                    (p_rHostDomain.addLabel(0)));
     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForHost: FAILED!\n")););
     return bResult;
 }
@@ -926,13 +905,12 @@ bool MDNSResponder::_buildDomainForHost(const char* p_pcHostname,
 */
 bool MDNSResponder::_buildDomainForDNSSD(MDNSResponder::stcMDNS_RRDomain& p_rDNSSDDomain) const
 {
-
     p_rDNSSDDomain.clear();
-    bool    bResult = ((p_rDNSSDDomain.addLabel(scpcServices, true)) &&
-                       (p_rDNSSDDomain.addLabel(scpcDNSSD, true)) &&
-                       (p_rDNSSDDomain.addLabel(scpcUDP, true)) &&
-                       (p_rDNSSDDomain.addLabel(scpcLocal)) &&
-                       (p_rDNSSDDomain.addLabel(0)));
+    bool bResult = ((p_rDNSSDDomain.addLabel(scpcServices, true)) &&
+                    (p_rDNSSDDomain.addLabel(scpcDNSSD, true)) &&
+                    (p_rDNSSDDomain.addLabel(scpcUDP, true)) &&
+                    (p_rDNSSDDomain.addLabel(scpcLocal)) &&
+                    (p_rDNSSDDomain.addLabel(0)));
     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForDNSSD: FAILED!\n")););
     return bResult;
 }
@@ -945,17 +923,16 @@ bool MDNSResponder::_buildDomainForDNSSD(MDNSResponder::stcMDNS_RRDomain& p_rDNS
 
 */
 bool MDNSResponder::_buildDomainForService(const MDNSResponder::stcMDNSService& p_Service,
-        bool p_bIncludeName,
-        MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
+                                           bool p_bIncludeName,
+                                           MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
 {
-
     p_rServiceDomain.clear();
-    bool    bResult = (((!p_bIncludeName) ||
-                        (p_rServiceDomain.addLabel(p_Service.m_pcName))) &&
-                       (p_rServiceDomain.addLabel(p_Service.m_pcService, true)) &&
-                       (p_rServiceDomain.addLabel(p_Service.m_pcProtocol, true)) &&
-                       (p_rServiceDomain.addLabel(scpcLocal)) &&
-                       (p_rServiceDomain.addLabel(0)));
+    bool bResult = (((!p_bIncludeName) ||
+                     (p_rServiceDomain.addLabel(p_Service.m_pcName))) &&
+                    (p_rServiceDomain.addLabel(p_Service.m_pcService, true)) &&
+                    (p_rServiceDomain.addLabel(p_Service.m_pcProtocol, true)) &&
+                    (p_rServiceDomain.addLabel(scpcLocal)) &&
+                    (p_rServiceDomain.addLabel(0)));
     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED!\n")););
     return bResult;
 }
@@ -968,18 +945,17 @@ bool MDNSResponder::_buildDomainForService(const MDNSResponder::stcMDNSService&
 
 */
 bool MDNSResponder::_buildDomainForService(const char* p_pcService,
-        const char* p_pcProtocol,
-        MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
+                                           const char* p_pcProtocol,
+                                           MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
 {
-
     p_rServiceDomain.clear();
-    bool    bResult = ((p_pcService) &&
-                       (p_pcProtocol) &&
-                       (p_rServiceDomain.addLabel(p_pcService, ('_' != *p_pcService))) &&
-                       (p_rServiceDomain.addLabel(p_pcProtocol, ('_' != *p_pcProtocol))) &&
-                       (p_rServiceDomain.addLabel(scpcLocal)) &&
-                       (p_rServiceDomain.addLabel(0)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED for (%s.%s)!\n"), (p_pcService ? : "-"), (p_pcProtocol ? : "-")););
+    bool bResult = ((p_pcService) &&
+                    (p_pcProtocol) &&
+                    (p_rServiceDomain.addLabel(p_pcService, ('_' != *p_pcService))) &&
+                    (p_rServiceDomain.addLabel(p_pcProtocol, ('_' != *p_pcProtocol))) &&
+                    (p_rServiceDomain.addLabel(scpcLocal)) &&
+                    (p_rServiceDomain.addLabel(0)));
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED for (%s.%s)!\n"), (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
     return bResult;
 }
 
@@ -992,14 +968,13 @@ bool MDNSResponder::_buildDomainForService(const char* p_pcService,
     Used while detecting reverse IP4 questions and answering these
 */
 bool MDNSResponder::_buildDomainForReverseIP4(IPAddress p_IP4Address,
-        MDNSResponder::stcMDNS_RRDomain& p_rReverseIP4Domain) const
+                                              MDNSResponder::stcMDNS_RRDomain& p_rReverseIP4Domain) const
 {
-
-    bool    bResult = true;
+    bool bResult = true;
 
     p_rReverseIP4Domain.clear();
 
-    char    acBuffer[32];
+    char acBuffer[32];
     for (int i = MDNS_IP4_SIZE; ((bResult) && (i >= 1)); --i)
     {
         itoa(p_IP4Address[i - 1], acBuffer, 10);
@@ -1021,14 +996,13 @@ bool MDNSResponder::_buildDomainForReverseIP4(IPAddress p_IP4Address,
     Used while detecting reverse IP6 questions and answering these
 */
 bool MDNSResponder::_buildDomainForReverseIP6(IPAddress p_IP4Address,
-        MDNSResponder::stcMDNS_RRDomain& p_rReverseIP6Domain) const
+                                              MDNSResponder::stcMDNS_RRDomain& p_rReverseIP6Domain) const
 {
     // TODO: Implement
     return false;
 }
 #endif
 
-
 /*
     UDP
 */
@@ -1039,16 +1013,15 @@ bool MDNSResponder::_buildDomainForReverseIP6(IPAddress p_IP4Address,
 bool MDNSResponder::_udpReadBuffer(unsigned char* p_pBuffer,
                                    size_t p_stLength)
 {
-
-    bool    bResult = ((m_pUDPContext) &&
-                       (true/*m_pUDPContext->getSize() > p_stLength*/) &&
-                       (p_pBuffer) &&
-                       (p_stLength) &&
-                       ((p_stLength == m_pUDPContext->read((char*)p_pBuffer, p_stLength))));
+    bool bResult = ((m_pUDPContext) &&
+                    (true /*m_pUDPContext->getSize() > p_stLength*/) &&
+                    (p_pBuffer) &&
+                    (p_stLength) &&
+                    ((p_stLength == m_pUDPContext->read((char*)p_pBuffer, p_stLength))));
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpReadBuffer: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpReadBuffer: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -1057,7 +1030,6 @@ bool MDNSResponder::_udpReadBuffer(unsigned char* p_pBuffer,
 */
 bool MDNSResponder::_udpRead8(uint8_t& p_ru8Value)
 {
-
     return _udpReadBuffer((unsigned char*)&p_ru8Value, sizeof(p_ru8Value));
 }
 
@@ -1066,8 +1038,7 @@ bool MDNSResponder::_udpRead8(uint8_t& p_ru8Value)
 */
 bool MDNSResponder::_udpRead16(uint16_t& p_ru16Value)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if (_udpReadBuffer((unsigned char*)&p_ru16Value, sizeof(p_ru16Value)))
     {
@@ -1082,8 +1053,7 @@ bool MDNSResponder::_udpRead16(uint16_t& p_ru16Value)
 */
 bool MDNSResponder::_udpRead32(uint32_t& p_ru32Value)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     if (_udpReadBuffer((unsigned char*)&p_ru32Value, sizeof(p_ru32Value)))
     {
@@ -1099,15 +1069,14 @@ bool MDNSResponder::_udpRead32(uint32_t& p_ru32Value)
 bool MDNSResponder::_udpAppendBuffer(const unsigned char* p_pcBuffer,
                                      size_t p_stLength)
 {
-
     bool bResult = ((m_pUDPContext) &&
                     (p_pcBuffer) &&
                     (p_stLength) &&
                     (p_stLength == m_pUDPContext->append((const char*)p_pcBuffer, p_stLength)));
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpAppendBuffer: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpAppendBuffer: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -1116,7 +1085,6 @@ bool MDNSResponder::_udpAppendBuffer(const unsigned char* p_pcBuffer,
 */
 bool MDNSResponder::_udpAppend8(uint8_t p_u8Value)
 {
-
     return (_udpAppendBuffer((unsigned char*)&p_u8Value, sizeof(p_u8Value)));
 }
 
@@ -1125,7 +1093,6 @@ bool MDNSResponder::_udpAppend8(uint8_t p_u8Value)
 */
 bool MDNSResponder::_udpAppend16(uint16_t p_u16Value)
 {
-
     p_u16Value = lwip_htons(p_u16Value);
     return (_udpAppendBuffer((unsigned char*)&p_u16Value, sizeof(p_u16Value)));
 }
@@ -1135,7 +1102,6 @@ bool MDNSResponder::_udpAppend16(uint16_t p_u16Value)
 */
 bool MDNSResponder::_udpAppend32(uint32_t p_u32Value)
 {
-
     p_u32Value = lwip_htonl(p_u32Value);
     return (_udpAppendBuffer((unsigned char*)&p_u32Value, sizeof(p_u32Value)));
 }
@@ -1146,13 +1112,12 @@ bool MDNSResponder::_udpAppend32(uint32_t p_u32Value)
 */
 bool MDNSResponder::_udpDump(bool p_bMovePointer /*= false*/)
 {
+    const uint8_t cu8BytesPerLine = 16;
 
-    const uint8_t   cu8BytesPerLine = 16;
-
-    uint32_t        u32StartPosition = m_pUDPContext->tell();
+    uint32_t u32StartPosition = m_pUDPContext->tell();
     DEBUG_OUTPUT.println("UDP Context Dump:");
-    uint32_t    u32Counter = 0;
-    uint8_t     u8Byte = 0;
+    uint32_t u32Counter = 0;
+    uint8_t u8Byte = 0;
 
     while (_udpRead8(u8Byte))
     {
@@ -1160,7 +1125,7 @@ bool MDNSResponder::_udpDump(bool p_bMovePointer /*= false*/)
     }
     DEBUG_OUTPUT.printf_P(PSTR("%sDone: %u bytes\n"), (((u32Counter) && (u32Counter % cu8BytesPerLine)) ? "\n" : ""), u32Counter);
 
-    if (!p_bMovePointer)    // Restore
+    if (!p_bMovePointer)  // Restore
     {
         m_pUDPContext->seek(u32StartPosition);
     }
@@ -1173,11 +1138,10 @@ bool MDNSResponder::_udpDump(bool p_bMovePointer /*= false*/)
 bool MDNSResponder::_udpDump(unsigned p_uOffset,
                              unsigned p_uLength)
 {
-
     if ((m_pUDPContext) &&
-            (m_pUDPContext->isValidOffset(p_uOffset)))
+        (m_pUDPContext->isValidOffset(p_uOffset)))
     {
-        unsigned    uCurrentPosition = m_pUDPContext->tell();   // Remember start position
+        unsigned uCurrentPosition = m_pUDPContext->tell();  // Remember start position
 
         m_pUDPContext->seek(p_uOffset);
         uint8_t u8Byte;
@@ -1192,7 +1156,6 @@ bool MDNSResponder::_udpDump(unsigned p_uOffset,
 }
 #endif
 
-
 /**
     READ/WRITE MDNS STRUCTS
 */
@@ -1212,29 +1175,27 @@ bool MDNSResponder::_udpDump(unsigned p_uOffset,
 */
 bool MDNSResponder::_readMDNSMsgHeader(MDNSResponder::stcMDNS_MsgHeader& p_rMsgHeader)
 {
-
-    bool    bResult = false;
+    bool bResult = false;
 
     uint8_t u8B1;
     uint8_t u8B2;
     if ((_udpRead16(p_rMsgHeader.m_u16ID)) &&
-            (_udpRead8(u8B1)) &&
-            (_udpRead8(u8B2)) &&
-            (_udpRead16(p_rMsgHeader.m_u16QDCount)) &&
-            (_udpRead16(p_rMsgHeader.m_u16ANCount)) &&
-            (_udpRead16(p_rMsgHeader.m_u16NSCount)) &&
-            (_udpRead16(p_rMsgHeader.m_u16ARCount)))
+        (_udpRead8(u8B1)) &&
+        (_udpRead8(u8B2)) &&
+        (_udpRead16(p_rMsgHeader.m_u16QDCount)) &&
+        (_udpRead16(p_rMsgHeader.m_u16ANCount)) &&
+        (_udpRead16(p_rMsgHeader.m_u16NSCount)) &&
+        (_udpRead16(p_rMsgHeader.m_u16ARCount)))
     {
+        p_rMsgHeader.m_1bQR = (u8B1 & 0x80);      // Query/Respond flag
+        p_rMsgHeader.m_4bOpcode = (u8B1 & 0x78);  // Operation code (0: Standard query, others ignored)
+        p_rMsgHeader.m_1bAA = (u8B1 & 0x04);      // Authoritative answer
+        p_rMsgHeader.m_1bTC = (u8B1 & 0x02);      // Truncation flag
+        p_rMsgHeader.m_1bRD = (u8B1 & 0x01);      // Recursion desired
 
-        p_rMsgHeader.m_1bQR     = (u8B1 & 0x80);    // Query/Respond flag
-        p_rMsgHeader.m_4bOpcode = (u8B1 & 0x78);    // Operation code (0: Standard query, others ignored)
-        p_rMsgHeader.m_1bAA     = (u8B1 & 0x04);    // Authoritative answer
-        p_rMsgHeader.m_1bTC     = (u8B1 & 0x02);    // Truncation flag
-        p_rMsgHeader.m_1bRD     = (u8B1 & 0x01);    // Recursion desired
-
-        p_rMsgHeader.m_1bRA     = (u8B2 & 0x80);    // Recursion available
-        p_rMsgHeader.m_3bZ      = (u8B2 & 0x70);    // Zero
-        p_rMsgHeader.m_4bRCode  = (u8B2 & 0x0F);    // Response code
+        p_rMsgHeader.m_1bRA = (u8B2 & 0x80);     // Recursion available
+        p_rMsgHeader.m_3bZ = (u8B2 & 0x70);      // Zero
+        p_rMsgHeader.m_4bRCode = (u8B2 & 0x0F);  // Response code
 
         /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
                 (unsigned)p_rMsgHeader.m_u16ID,
@@ -1247,9 +1208,9 @@ bool MDNSResponder::_readMDNSMsgHeader(MDNSResponder::stcMDNS_MsgHeader& p_rMsgH
         bResult = true;
     }
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -1259,7 +1220,6 @@ bool MDNSResponder::_readMDNSMsgHeader(MDNSResponder::stcMDNS_MsgHeader& p_rMsgH
 bool MDNSResponder::_write8(uint8_t p_u8Value,
                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
-
     return ((_udpAppend8(p_u8Value)) &&
             (p_rSendParameter.shiftOffset(sizeof(p_u8Value))));
 }
@@ -1270,7 +1230,6 @@ bool MDNSResponder::_write8(uint8_t p_u8Value,
 bool MDNSResponder::_write16(uint16_t p_u16Value,
                              MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
-
     return ((_udpAppend16(p_u16Value)) &&
             (p_rSendParameter.shiftOffset(sizeof(p_u16Value))));
 }
@@ -1281,7 +1240,6 @@ bool MDNSResponder::_write16(uint16_t p_u16Value,
 bool MDNSResponder::_write32(uint32_t p_u32Value,
                              MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
-
     return ((_udpAppend32(p_u32Value)) &&
             (p_rSendParameter.shiftOffset(sizeof(p_u32Value))));
 }
@@ -1309,18 +1267,18 @@ bool MDNSResponder::_writeMDNSMsgHeader(const MDNSResponder::stcMDNS_MsgHeader&
 
     uint8_t u8B1((p_MsgHeader.m_1bQR << 7) | (p_MsgHeader.m_4bOpcode << 3) | (p_MsgHeader.m_1bAA << 2) | (p_MsgHeader.m_1bTC << 1) | (p_MsgHeader.m_1bRD));
     uint8_t u8B2((p_MsgHeader.m_1bRA << 7) | (p_MsgHeader.m_3bZ << 4) | (p_MsgHeader.m_4bRCode));
-    bool    bResult = ((_write16(p_MsgHeader.m_u16ID, p_rSendParameter)) &&
-                       (_write8(u8B1, p_rSendParameter)) &&
-                       (_write8(u8B2, p_rSendParameter)) &&
-                       (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter)) &&
-                       (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter)) &&
-                       (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter)) &&
-                       (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter)));
+    bool bResult = ((_write16(p_MsgHeader.m_u16ID, p_rSendParameter)) &&
+                    (_write8(u8B1, p_rSendParameter)) &&
+                    (_write8(u8B2, p_rSendParameter)) &&
+                    (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter)) &&
+                    (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter)) &&
+                    (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter)) &&
+                    (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter)));
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -1328,16 +1286,15 @@ bool MDNSResponder::_writeMDNSMsgHeader(const MDNSResponder::stcMDNS_MsgHeader&
     MDNSResponder::_writeRRAttributes
 */
 bool MDNSResponder::_writeMDNSRRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Attributes,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+                                           MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
-
-    bool    bResult = ((_write16(p_Attributes.m_u16Type, p_rSendParameter)) &&
-                       (_write16(p_Attributes.m_u16Class, p_rSendParameter)));
+    bool bResult = ((_write16(p_Attributes.m_u16Type, p_rSendParameter)) &&
+                    (_write16(p_Attributes.m_u16Class, p_rSendParameter)));
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRAttributes: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRAttributes: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -1347,14 +1304,13 @@ bool MDNSResponder::_writeMDNSRRAttributes(const MDNSResponder::stcMDNS_RRAttrib
 bool MDNSResponder::_writeMDNSRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_Domain,
                                        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
-
-    bool    bResult = ((_udpAppendBuffer((const unsigned char*)p_Domain.m_acName, p_Domain.m_u16NameLength)) &&
-                       (p_rSendParameter.shiftOffset(p_Domain.m_u16NameLength)));
+    bool bResult = ((_udpAppendBuffer((const unsigned char*)p_Domain.m_acName, p_Domain.m_u16NameLength)) &&
+                    (p_rSendParameter.shiftOffset(p_Domain.m_u16NameLength)));
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRDomain: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRDomain: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -1374,34 +1330,32 @@ bool MDNSResponder::_writeMDNSRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_
 
 */
 bool MDNSResponder::_writeMDNSHostDomain(const char* p_pcHostname,
-        bool p_bPrependRDLength,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+                                         bool p_bPrependRDLength,
+                                         MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
-
     // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
-    uint16_t            u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostname, false);
-
-    stcMDNS_RRDomain    hostDomain;
-    bool    bResult = (u16CachedDomainOffset
-                       // Found cached domain -> mark as compressed domain
-                       ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) && // Valid offset
-                          ((!p_bPrependRDLength) ||
-                           (_write16(2, p_rSendParameter))) &&                                     // Length of 'Cxxx'
-                          (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&   // Compression mark (and offset)
-                          (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
-                       // No cached domain -> add this domain to cache and write full domain name
-                       : ((_buildDomainForHost(p_pcHostname, hostDomain)) &&                       // eg. esp8266.local
-                          ((!p_bPrependRDLength) ||
-                           (_write16(hostDomain.m_u16NameLength, p_rSendParameter))) &&            // RDLength (if needed)
-                          (p_rSendParameter.addDomainCacheItem((const void*)p_pcHostname, false, p_rSendParameter.m_u16Offset)) &&
-                          (_writeMDNSRRDomain(hostDomain, p_rSendParameter))));
+    uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostname, false);
+
+    stcMDNS_RRDomain hostDomain;
+    bool bResult = (u16CachedDomainOffset
+                        // Found cached domain -> mark as compressed domain
+                        ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
+                           ((!p_bPrependRDLength) ||
+                            (_write16(2, p_rSendParameter))) &&                                                        // Length of 'Cxxx'
+                           (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&  // Compression mark (and offset)
+                           (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
+                        // No cached domain -> add this domain to cache and write full domain name
+                        : ((_buildDomainForHost(p_pcHostname, hostDomain)) &&  // eg. esp8266.local
+                           ((!p_bPrependRDLength) ||
+                            (_write16(hostDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
+                           (p_rSendParameter.addDomainCacheItem((const void*)p_pcHostname, false, p_rSendParameter.m_u16Offset)) &&
+                           (_writeMDNSRRDomain(hostDomain, p_rSendParameter))));
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSHostDomain: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSHostDomain: FAILED!\n"));
+                 });
     return bResult;
-
 }
 
 /*
@@ -1417,35 +1371,33 @@ bool MDNSResponder::_writeMDNSHostDomain(const char* p_pcHostname,
 
 */
 bool MDNSResponder::_writeMDNSServiceDomain(const MDNSResponder::stcMDNSService& p_Service,
-        bool p_bIncludeName,
-        bool p_bPrependRDLength,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+                                            bool p_bIncludeName,
+                                            bool p_bPrependRDLength,
+                                            MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
-
     // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
-    uint16_t            u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName);
-
-    stcMDNS_RRDomain    serviceDomain;
-    bool    bResult = (u16CachedDomainOffset
-                       // Found cached domain -> mark as compressed domain
-                       ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) && // Valid offset
-                          ((!p_bPrependRDLength) ||
-                           (_write16(2, p_rSendParameter))) &&                                     // Length of 'Cxxx'
-                          (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&   // Compression mark (and offset)
-                          (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
-                       // No cached domain -> add this domain to cache and write full domain name
-                       : ((_buildDomainForService(p_Service, p_bIncludeName, serviceDomain)) &&    // eg. MyESP._http._tcp.local
-                          ((!p_bPrependRDLength) ||
-                           (_write16(serviceDomain.m_u16NameLength, p_rSendParameter))) &&         // RDLength (if needed)
-                          (p_rSendParameter.addDomainCacheItem((const void*)&p_Service, p_bIncludeName, p_rSendParameter.m_u16Offset)) &&
-                          (_writeMDNSRRDomain(serviceDomain, p_rSendParameter))));
+    uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName);
+
+    stcMDNS_RRDomain serviceDomain;
+    bool bResult = (u16CachedDomainOffset
+                        // Found cached domain -> mark as compressed domain
+                        ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
+                           ((!p_bPrependRDLength) ||
+                            (_write16(2, p_rSendParameter))) &&                                                        // Length of 'Cxxx'
+                           (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&  // Compression mark (and offset)
+                           (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
+                        // No cached domain -> add this domain to cache and write full domain name
+                        : ((_buildDomainForService(p_Service, p_bIncludeName, serviceDomain)) &&  // eg. MyESP._http._tcp.local
+                           ((!p_bPrependRDLength) ||
+                            (_write16(serviceDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
+                           (p_rSendParameter.addDomainCacheItem((const void*)&p_Service, p_bIncludeName, p_rSendParameter.m_u16Offset)) &&
+                           (_writeMDNSRRDomain(serviceDomain, p_rSendParameter))));
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSServiceDomain: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSServiceDomain: FAILED!\n"));
+                 });
     return bResult;
-
 }
 
 /*
@@ -1463,18 +1415,16 @@ bool MDNSResponder::_writeMDNSQuestion(MDNSResponder::stcMDNS_RRQuestion& p_Ques
 {
     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion\n")););
 
-    bool    bResult = ((_writeMDNSRRDomain(p_Question.m_Header.m_Domain, p_rSendParameter)) &&
-                       (_writeMDNSRRAttributes(p_Question.m_Header.m_Attributes, p_rSendParameter)));
+    bool bResult = ((_writeMDNSRRDomain(p_Question.m_Header.m_Domain, p_rSendParameter)) &&
+                    (_writeMDNSRRAttributes(p_Question.m_Header.m_Attributes, p_rSendParameter)));
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion: FAILED!\n"));
+                 });
     return bResult;
-
 }
 
-
 #ifdef MDNS_IP4_SUPPORT
 /*
     MDNSResponder::_writeMDNSAnswer_A
@@ -1496,22 +1446,21 @@ bool MDNSResponder::_writeMDNSAnswer_A(IPAddress p_IPAddress,
 {
     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A (%s)\n"), p_IPAddress.toString().c_str()););
 
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_A,
-                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
-    const unsigned char     aucIPAddress[MDNS_IP4_SIZE] = { p_IPAddress[0], p_IPAddress[1], p_IPAddress[2], p_IPAddress[3] };
-    bool    bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) &&
-                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&        // TYPE & CLASS
-                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&    // TTL
-                       (_write16(MDNS_IP4_SIZE, p_rSendParameter)) &&                   // RDLength
-                       (_udpAppendBuffer(aucIPAddress, MDNS_IP4_SIZE)) &&               // RData
-                       (p_rSendParameter.shiftOffset(MDNS_IP4_SIZE)));
+    stcMDNS_RRAttributes attributes(DNS_RRTYPE_A,
+                                    ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+    const unsigned char aucIPAddress[MDNS_IP4_SIZE] = {p_IPAddress[0], p_IPAddress[1], p_IPAddress[2], p_IPAddress[3]};
+    bool bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) &&
+                    (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                              // TYPE & CLASS
+                    (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&  // TTL
+                    (_write16(MDNS_IP4_SIZE, p_rSendParameter)) &&                                         // RDLength
+                    (_udpAppendBuffer(aucIPAddress, MDNS_IP4_SIZE)) &&                                     // RData
+                    (p_rSendParameter.shiftOffset(MDNS_IP4_SIZE)));
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A: FAILED!\n"));
+                 });
     return bResult;
-
 }
 
 /*
@@ -1524,24 +1473,24 @@ bool MDNSResponder::_writeMDNSAnswer_A(IPAddress p_IPAddress,
     Used while answering reverse IP4 questions
 */
 bool MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress p_IPAddress,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4 (%s)\n"), p_IPAddress.toString().c_str()););
 
-    stcMDNS_RRDomain        reverseIP4Domain;
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_PTR,
-                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
-    stcMDNS_RRDomain        hostDomain;
-    bool    bResult = ((_buildDomainForReverseIP4(p_IPAddress, reverseIP4Domain)) &&    // 012.789.456.123.in-addr.arpa
-                       (_writeMDNSRRDomain(reverseIP4Domain, p_rSendParameter)) &&
-                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&        // TYPE & CLASS
-                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&    // TTL
-                       (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));   // RDLength & RData (host domain, eg. esp8266.local)
+    stcMDNS_RRDomain reverseIP4Domain;
+    stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
+                                    ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+    stcMDNS_RRDomain hostDomain;
+    bool bResult = ((_buildDomainForReverseIP4(p_IPAddress, reverseIP4Domain)) &&  // 012.789.456.123.in-addr.arpa
+                    (_writeMDNSRRDomain(reverseIP4Domain, p_rSendParameter)) &&
+                    (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                              // TYPE & CLASS
+                    (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&  // TTL
+                    (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                         // RDLength & RData (host domain, eg. esp8266.local)
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4: FAILED!\n"));
+                 });
     return bResult;
 }
 #endif
@@ -1557,23 +1506,23 @@ bool MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress p_IPAddress,
     http://www.zytrax.com/books/dns/ch8/ptr.html
 */
 bool MDNSResponder::_writeMDNSAnswer_PTR_TYPE(MDNSResponder::stcMDNSService& p_rService,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+                                              MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE\n")););
 
-    stcMDNS_RRDomain        dnssdDomain;
-    stcMDNS_RRDomain        serviceDomain;
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);	// No cache flush! only INternet
-    bool    bResult = ((_buildDomainForDNSSD(dnssdDomain)) &&                                   // _services._dns-sd._udp.local
-                       (_writeMDNSRRDomain(dnssdDomain, p_rSendParameter)) &&
-                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                // TYPE & CLASS
-                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) && // TTL
-                       (_writeMDNSServiceDomain(p_rService, false, true, p_rSendParameter)));   // RDLength & RData (service domain, eg. _http._tcp.local)
+    stcMDNS_RRDomain dnssdDomain;
+    stcMDNS_RRDomain serviceDomain;
+    stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);  // No cache flush! only INternet
+    bool bResult = ((_buildDomainForDNSSD(dnssdDomain)) &&            // _services._dns-sd._udp.local
+                    (_writeMDNSRRDomain(dnssdDomain, p_rSendParameter)) &&
+                    (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
+                    (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
+                    (_writeMDNSServiceDomain(p_rService, false, true, p_rSendParameter)));                    // RDLength & RData (service domain, eg. _http._tcp.local)
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -1588,24 +1537,23 @@ bool MDNSResponder::_writeMDNSAnswer_PTR_TYPE(MDNSResponder::stcMDNSService& p_r
     http://www.zytrax.com/books/dns/ch8/ptr.html
 */
 bool MDNSResponder::_writeMDNSAnswer_PTR_NAME(MDNSResponder::stcMDNSService& p_rService,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+                                              MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME\n")););
 
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);	// No cache flush! only INternet
-    bool    bResult = ((_writeMDNSServiceDomain(p_rService, false, false, p_rSendParameter)) && // _http._tcp.local
-                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                    // TYPE & CLASS
-                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) && // TTL
-                       (_writeMDNSServiceDomain(p_rService, true, true, p_rSendParameter)));        // RDLength & RData (service domain, eg. MyESP._http._tcp.local)
+    stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);                                          // No cache flush! only INternet
+    bool bResult = ((_writeMDNSServiceDomain(p_rService, false, false, p_rSendParameter)) &&                  // _http._tcp.local
+                    (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
+                    (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
+                    (_writeMDNSServiceDomain(p_rService, true, true, p_rSendParameter)));                     // RDLength & RData (service domain, eg. MyESP._http._tcp.local)
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME: FAILED!\n"));
+                 });
     return bResult;
 }
 
-
 /*
     MDNSResponder::_writeMDNSAnswer_TXT
 
@@ -1618,49 +1566,48 @@ bool MDNSResponder::_writeMDNSAnswer_PTR_NAME(MDNSResponder::stcMDNSService& p_r
     http://www.zytrax.com/books/dns/ch8/txt.html
 */
 bool MDNSResponder::_writeMDNSAnswer_TXT(MDNSResponder::stcMDNSService& p_rService,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+                                         MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT\n")););
 
-    bool                    bResult = false;
+    bool bResult = false;
 
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_TXT,
-                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
+    stcMDNS_RRAttributes attributes(DNS_RRTYPE_TXT,
+                                    ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
 
     if ((_collectServiceTxts(p_rService)) &&
-            (_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&     // MyESP._http._tcp.local
-            (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                   // TYPE & CLASS
-            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&    // TTL
-            (_write16(p_rService.m_Txts.length(), p_rSendParameter)))                   // RDLength
+        (_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&                   // MyESP._http._tcp.local
+        (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
+        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
+        (_write16(p_rService.m_Txts.length(), p_rSendParameter)))                                 // RDLength
     {
-
         bResult = true;
         // RData    Txts
         for (stcMDNSServiceTxt* pTxt = p_rService.m_Txts.m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
         {
-            unsigned char       ucLengthByte = pTxt->length();
-            bResult = ((_udpAppendBuffer((unsigned char*)&ucLengthByte, sizeof(ucLengthByte))) &&   // Length
+            unsigned char ucLengthByte = pTxt->length();
+            bResult = ((_udpAppendBuffer((unsigned char*)&ucLengthByte, sizeof(ucLengthByte))) &&  // Length
                        (p_rSendParameter.shiftOffset(sizeof(ucLengthByte))) &&
-                       ((size_t)os_strlen(pTxt->m_pcKey) == m_pUDPContext->append(pTxt->m_pcKey, os_strlen(pTxt->m_pcKey))) &&          // Key
+                       ((size_t)os_strlen(pTxt->m_pcKey) == m_pUDPContext->append(pTxt->m_pcKey, os_strlen(pTxt->m_pcKey))) &&  // Key
                        (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcKey))) &&
-                       (1 == m_pUDPContext->append("=", 1)) &&                                                                          // =
+                       (1 == m_pUDPContext->append("=", 1)) &&  // =
                        (p_rSendParameter.shiftOffset(1)) &&
                        ((!pTxt->m_pcValue) ||
                         (((size_t)os_strlen(pTxt->m_pcValue) == m_pUDPContext->append(pTxt->m_pcValue, os_strlen(pTxt->m_pcValue))) &&  // Value
                          (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcValue))))));
 
             DEBUG_EX_ERR(if (!bResult)
-        {
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED to write %sTxt %s=%s!\n"), (pTxt->m_bTemp ? "temp. " : ""), (pTxt->m_pcKey ? : "?"), (pTxt->m_pcValue ? : "?"));
-            });
+                         {
+                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED to write %sTxt %s=%s!\n"), (pTxt->m_bTemp ? "temp. " : ""), (pTxt->m_pcKey ?: "?"), (pTxt->m_pcValue ?: "?"));
+                         });
         }
     }
     _releaseTempServiceTxts(p_rService);
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -1675,22 +1622,22 @@ bool MDNSResponder::_writeMDNSAnswer_TXT(MDNSResponder::stcMDNSService& p_rServi
     http://www.zytrax.com/books/dns/ch8/aaaa.html
 */
 bool MDNSResponder::_writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+                                          MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA\n")););
 
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_AAAA,
-                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
-    bool    bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) && // esp8266.local
-                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&            // TYPE & CLASS
-                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&    // TTL
-                       (_write16(MDNS_IP6_SIZE, p_rSendParameter)) &&                       // RDLength
-                       (false /*TODO: IP6 version of: _udpAppendBuffer((uint32_t)p_IPAddress, MDNS_IP4_SIZE)*/));   // RData
+    stcMDNS_RRAttributes attributes(DNS_RRTYPE_AAAA,
+                                    ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));          // Cache flush? & INternet
+    bool bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) &&                            // esp8266.local
+                    (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                   // TYPE & CLASS
+                    (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&       // TTL
+                    (_write16(MDNS_IP6_SIZE, p_rSendParameter)) &&                                              // RDLength
+                    (false /*TODO: IP6 version of: _udpAppendBuffer((uint32_t)p_IPAddress, MDNS_IP4_SIZE)*/));  // RData
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA: FAILED!\n"));
+                 });
     return bResult;
 }
 
@@ -1704,23 +1651,23 @@ bool MDNSResponder::_writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
     Used while answering reverse IP6 questions
 */
 bool MDNSResponder::_writeMDNSAnswer_PTR_IP6(IPAddress p_IPAddress,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6\n")););
 
-    stcMDNS_RRDomain        reverseIP6Domain;
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_PTR,
-                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
-    bool    bResult = ((_buildDomainForReverseIP6(p_IPAddress, reverseIP6Domain)) &&        // xxxx::xx.ip6.arpa
-                       (_writeMDNSRRDomain(reverseIP6Domain, p_rSendParameter)) &&
-                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&            // TYPE & CLASS
-                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&    // TTL
-                       (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));       // RDLength & RData (host domain, eg. esp8266.local)
+    stcMDNS_RRDomain reverseIP6Domain;
+    stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
+                                    ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+    bool bResult = ((_buildDomainForReverseIP6(p_IPAddress, reverseIP6Domain)) &&                       // xxxx::xx.ip6.arpa
+                    (_writeMDNSRRDomain(reverseIP6Domain, p_rSendParameter)) &&
+                    (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                              // TYPE & CLASS
+                    (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&  // TTL
+                    (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                         // RDLength & RData (host domain, eg. esp8266.local)
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6: FAILED!\n"));
+                 });
     return bResult;
 }
 #endif
@@ -1732,57 +1679,53 @@ bool MDNSResponder::_writeMDNSAnswer_PTR_IP6(IPAddress p_IPAddress,
     http://www.zytrax.com/books/dns/ch8/srv.html ???? Include instance name ????
 */
 bool MDNSResponder::_writeMDNSAnswer_SRV(MDNSResponder::stcMDNSService& p_rService,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+                                         MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
 {
     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV\n")););
 
-    uint16_t                u16CachedDomainOffset = (p_rSendParameter.m_bLegacyQuery
-            ? 0
-            : p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostname, false));
-
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_SRV,
-                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
-    stcMDNS_RRDomain        hostDomain;
-    bool    bResult = ((_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&  // MyESP._http._tcp.local
-                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                // TYPE & CLASS
-                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) && // TTL
-                       (!u16CachedDomainOffset
-                        // No cache for domain name (or no compression allowed)
-                        ? ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                           (_write16((sizeof(uint16_t /*Prio*/) +                           // RDLength
-                                      sizeof(uint16_t /*Weight*/) +
-                                      sizeof(uint16_t /*Port*/) +
-                                      hostDomain.m_u16NameLength), p_rSendParameter)) &&    // Domain length
-                           (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&               // Priority
-                           (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                 // Weight
-                           (_write16(p_rService.m_u16Port, p_rSendParameter)) &&            // Port
-                           (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostname, false, p_rSendParameter.m_u16Offset)) &&
-                           (_writeMDNSRRDomain(hostDomain, p_rSendParameter)))              // Host, eg. esp8266.local
-                        // Cache available for domain
-                        : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) && // Valid offset
-                           (_write16((sizeof(uint16_t /*Prio*/) +                           // RDLength
-                                      sizeof(uint16_t /*Weight*/) +
-                                      sizeof(uint16_t /*Port*/) +
-                                      2), p_rSendParameter)) &&                             // Length of 'C0xx'
-                           (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&               // Priority
-                           (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                 // Weight
-                           (_write16(p_rService.m_u16Port, p_rSendParameter)) &&            // Port
-                           (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&   // Compression mark (and offset)
-                           (_write8((uint8_t)u16CachedDomainOffset, p_rSendParameter)))));  // Offset
+    uint16_t u16CachedDomainOffset = (p_rSendParameter.m_bLegacyQuery
+                                          ? 0
+                                          : p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostname, false));
+
+    stcMDNS_RRAttributes attributes(DNS_RRTYPE_SRV,
+                                    ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+    stcMDNS_RRDomain hostDomain;
+    bool bResult = ((_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&                   // MyESP._http._tcp.local
+                    (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
+                    (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
+                    (!u16CachedDomainOffset
+                         // No cache for domain name (or no compression allowed)
+                         ? ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
+                            (_write16((sizeof(uint16_t /*Prio*/) +  // RDLength
+                                       sizeof(uint16_t /*Weight*/) +
+                                       sizeof(uint16_t /*Port*/) +
+                                       hostDomain.m_u16NameLength),
+                                      p_rSendParameter)) &&                        // Domain length
+                            (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&     // Priority
+                            (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&       // Weight
+                            (_write16(p_rService.m_u16Port, p_rSendParameter)) &&  // Port
+                            (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostname, false, p_rSendParameter.m_u16Offset)) &&
+                            (_writeMDNSRRDomain(hostDomain, p_rSendParameter)))  // Host, eg. esp8266.local
+                         // Cache available for domain
+                         : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
+                            (_write16((sizeof(uint16_t /*Prio*/) +                                                        // RDLength
+                                       sizeof(uint16_t /*Weight*/) +
+                                       sizeof(uint16_t /*Port*/) +
+                                       2),
+                                      p_rSendParameter)) &&                                                             // Length of 'C0xx'
+                            (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&                                          // Priority
+                            (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                            // Weight
+                            (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                       // Port
+                            (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&  // Compression mark (and offset)
+                            (_write8((uint8_t)u16CachedDomainOffset, p_rSendParameter)))));                             // Offset
 
     DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV: FAILED!\n"));
-    });
+                 {
+                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV: FAILED!\n"));
+                 });
     return bResult;
 }
 
-}   // namespace MDNSImplementation
-
-} // namespace esp8266
-
-
-
-
-
+}  // namespace MDNSImplementation
 
+}  // namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h b/libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h
index 3686440f10..ea2128a9ed 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h
@@ -27,4 +27,4 @@
 
 #include <lwip/prot/dns.h>  // DNS_RRTYPE_xxx, DNS_MQUERY_PORT
 
-#endif // MDNS_LWIPDEFS_H
+#endif  // MDNS_LWIPDEFS_H
diff --git a/libraries/Netdump/examples/Netdump/Netdump.ino b/libraries/Netdump/examples/Netdump/Netdump.ino
index dbba63869b..86523705b1 100644
--- a/libraries/Netdump/examples/Netdump/Netdump.ino
+++ b/libraries/Netdump/examples/Netdump/Netdump.ino
@@ -1,9 +1,9 @@
 #include "Arduino.h"
 
-#include "Netdump.h"
-#include <ESP8266WiFi.h>
 #include <ESP8266WebServer.h>
+#include <ESP8266WiFi.h>
 #include <ESP8266mDNS.h>
+#include "Netdump.h"
 //#include <FS.h>
 #include <LittleFS.h>
 #include <map>
@@ -12,7 +12,7 @@ using namespace NetCapture;
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
@@ -24,8 +24,8 @@ Netdump nd;
 FS* filesystem = &LittleFS;
 
 ESP8266WebServer webServer(80);    // Used for sending commands
-WiFiServer       tcpServer(8000);  // Used to show netcat option.
-File             tracefile;
+WiFiServer tcpServer(8000);        // Used to show netcat option.
+File tracefile;
 
 std::map<PacketType, int> packetCount;
 
@@ -37,25 +37,23 @@ enum class SerialOption : uint8_t {
 
 void startSerial(SerialOption option) {
   switch (option) {
-    case SerialOption::AllFull : //All Packets, show packet summary.
+    case SerialOption::AllFull:    //All Packets, show packet summary.
       nd.printDump(Serial, Packet::PacketDetail::FULL);
       break;
 
-    case SerialOption::LocalNone : // Only local IP traffic, full details
+    case SerialOption::LocalNone:    // Only local IP traffic, full details
       nd.printDump(Serial, Packet::PacketDetail::NONE,
       [](Packet n) {
         return (n.hasIP(WiFi.localIP()));
-      }
-                  );
+      });
       break;
-    case SerialOption::HTTPChar : // Only HTTP traffic, show packet content as chars
+    case SerialOption::HTTPChar:    // Only HTTP traffic, show packet content as chars
       nd.printDump(Serial, Packet::PacketDetail::CHAR,
       [](Packet n) {
         return (n.isHTTP());
-      }
-                  );
+      });
       break;
-    default :
+    default:
       Serial.printf("No valid SerialOption provided\r\n");
   };
 }
@@ -99,16 +97,14 @@ void setup(void) {
       d.concat("<li>" + dir.fileName() + "</li>");
     }
     webServer.send(200, "text.html", d);
-  }
-              );
+  });
 
   webServer.on("/req",
   []() {
     static int rq = 0;
     String a = "<h1>You are connected, Number of requests = " + String(rq++) + "</h1>";
     webServer.send(200, "text/html", a);
-  }
-              );
+  });
 
   webServer.on("/reset",
   []() {
@@ -116,13 +112,12 @@ void setup(void) {
     tracefile.close();
     tcpServer.close();
     webServer.send(200, "text.html", "<h1>Netdump session reset</h1>");
-  }
-              );
+  });
 
   webServer.serveStatic("/", *filesystem, "/");
   webServer.begin();
 
-  startSerial(SerialOption::AllFull); // Serial output examples, use enum SerialOption for selection
+  startSerial(SerialOption::AllFull);    // Serial output examples, use enum SerialOption for selection
 
   //  startTcpDump();     // tcpdump option
   //  startTracefile();  // output to SPIFFS or LittleFS
@@ -130,21 +125,21 @@ void setup(void) {
   // use a self provide callback, this count network packets
   /*
     nd.setCallback(
-     [](Packet p)
-     {
-  	  Serial.printf("PKT : %s : ",p.sourceIP().toString().c_str());
-  	  for ( auto pp : p.allPacketTypes())
-  		  {
-  		     Serial.printf("%s ",pp.toString().c_str());
-  			 packetCount[pp]++;
-  		  }
-  	  Serial.printf("\r\n CNT ");
-  	  for (auto pc : packetCount)
-  		  {
-  		  	  Serial.printf("%s %d ", pc.first.toString().c_str(),pc.second);
-  		  }
-  	  Serial.printf("\r\n");
-     }
+    [](Packet p)
+    {
+    Serial.printf("PKT : %s : ",p.sourceIP().toString().c_str());
+    for ( auto pp : p.allPacketTypes())
+  	  {
+  	     Serial.printf("%s ",pp.toString().c_str());
+  		 packetCount[pp]++;
+  	  }
+    Serial.printf("\r\n CNT ");
+    for (auto pc : packetCount)
+  	  {
+  	  	  Serial.printf("%s %d ", pc.first.toString().c_str(),pc.second);
+  	  }
+    Serial.printf("\r\n");
+    }
     );
   */
 }
@@ -153,4 +148,3 @@ void loop(void) {
   webServer.handleClient();
   MDNS.update();
 }
-
diff --git a/libraries/Netdump/src/Netdump.cpp b/libraries/Netdump/src/Netdump.cpp
index 4d4deb05b2..9e688f3ca7 100644
--- a/libraries/Netdump/src/Netdump.cpp
+++ b/libraries/Netdump/src/Netdump.cpp
@@ -23,10 +23,8 @@
 #include <lwip/init.h>
 #include "Schedule.h"
 
-
 namespace NetCapture
 {
-
 CallBackList<Netdump::LwipCallback> Netdump::lwipCallback;
 
 Netdump::Netdump()
@@ -52,7 +50,7 @@ void Netdump::setCallback(const Callback nc)
 
 void Netdump::setCallback(const Callback nc, const Filter nf)
 {
-    netDumpFilter   = nf;
+    netDumpFilter = nf;
     netDumpCallback = nc;
 }
 
@@ -69,24 +67,20 @@ void Netdump::reset()
 void Netdump::printDump(Print& out, Packet::PacketDetail ndd, const Filter nf)
 {
     out.printf_P(PSTR("netDump starting\r\n"));
-    setCallback([&out, ndd, this](const Packet & ndp)
-    {
-        printDumpProcess(out, ndd, ndp);
-    }, nf);
+    setCallback([&out, ndd, this](const Packet& ndp)
+                { printDumpProcess(out, ndd, ndp); },
+                nf);
 }
 
 void Netdump::fileDump(File& outfile, const Filter nf)
 {
-
     writePcapHeader(outfile);
-    setCallback([&outfile, this](const Packet & ndp)
-    {
-        fileDumpProcess(outfile, ndp);
-    }, nf);
+    setCallback([&outfile, this](const Packet& ndp)
+                { fileDumpProcess(outfile, ndp); },
+                nf);
 }
-bool Netdump::tcpDump(WiFiServer &tcpDumpServer, const Filter nf)
+bool Netdump::tcpDump(WiFiServer& tcpDumpServer, const Filter nf)
 {
-
     if (!packetBuffer)
     {
         packetBuffer = new (std::nothrow) char[tcpBufferSize];
@@ -99,9 +93,7 @@ bool Netdump::tcpDump(WiFiServer &tcpDumpServer, const Filter nf)
     bufferIndex = 0;
 
     schedule_function([&tcpDumpServer, this, nf]()
-    {
-        tcpDumpLoop(tcpDumpServer, nf);
-    });
+                      { tcpDumpLoop(tcpDumpServer, nf); });
     return true;
 }
 
@@ -109,7 +101,7 @@ void Netdump::capture(int netif_idx, const char* data, size_t len, int out, int
 {
     if (lwipCallback.execute(netif_idx, data, len, out, success) == 0)
     {
-        phy_capture = nullptr; // No active callback/netdump instances, will be set again by new object.
+        phy_capture = nullptr;  // No active callback/netdump instances, will be set again by new object.
     }
 }
 
@@ -118,7 +110,7 @@ void Netdump::netdumpCapture(int netif_idx, const char* data, size_t len, int ou
     if (netDumpCallback)
     {
         Packet np(millis(), netif_idx, data, len, out, success);
-        if (netDumpFilter  && !netDumpFilter(np))
+        if (netDumpFilter && !netDumpFilter(np))
         {
             return;
         }
@@ -131,8 +123,8 @@ void Netdump::writePcapHeader(Stream& s) const
     uint32_t pcapHeader[6];
     pcapHeader[0] = 0xa1b2c3d4;     // pcap magic number
     pcapHeader[1] = 0x00040002;     // pcap major/minor version
-    pcapHeader[2] = 0;			     // pcap UTC correction in seconds
-    pcapHeader[3] = 0;			     // pcap time stamp accuracy
+    pcapHeader[2] = 0;              // pcap UTC correction in seconds
+    pcapHeader[3] = 0;              // pcap time stamp accuracy
     pcapHeader[4] = maxPcapLength;  // pcap max packet length per record
     pcapHeader[5] = 1;              // pacp data linkt type = ethernet
     s.write(reinterpret_cast<char*>(pcapHeader), 24);
@@ -154,7 +146,7 @@ void Netdump::fileDumpProcess(File& outfile, const Packet& np) const
     pcapHeader[1] = tv.tv_usec;
     pcapHeader[2] = incl_len;
     pcapHeader[3] = np.getPacketSize();
-    outfile.write(reinterpret_cast<char*>(pcapHeader), 16); // pcap record header
+    outfile.write(reinterpret_cast<char*>(pcapHeader), 16);  // pcap record header
 
     outfile.write(np.rawData(), incl_len);
 }
@@ -168,16 +160,16 @@ void Netdump::tcpDumpProcess(const Packet& np)
     }
     size_t incl_len = np.getPacketSize() > maxPcapLength ? maxPcapLength : np.getPacketSize();
 
-    if (bufferIndex + 16 + incl_len < tcpBufferSize) // only add if enough space available
+    if (bufferIndex + 16 + incl_len < tcpBufferSize)  // only add if enough space available
     {
         struct timeval tv;
         gettimeofday(&tv, nullptr);
         uint32_t* pcapHeader = reinterpret_cast<uint32_t*>(&packetBuffer[bufferIndex]);
-        pcapHeader[0] = tv.tv_sec;      // add pcap record header
+        pcapHeader[0] = tv.tv_sec;  // add pcap record header
         pcapHeader[1] = tv.tv_usec;
         pcapHeader[2] = incl_len;
         pcapHeader[3] = np.getPacketSize();
-        bufferIndex += 16; // pcap header size
+        bufferIndex += 16;  // pcap header size
         memcpy(&packetBuffer[bufferIndex], np.rawData(), incl_len);
         bufferIndex += incl_len;
     }
@@ -189,7 +181,7 @@ void Netdump::tcpDumpProcess(const Packet& np)
     }
 }
 
-void Netdump::tcpDumpLoop(WiFiServer &tcpDumpServer, const Filter nf)
+void Netdump::tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf)
 {
     if (tcpDumpServer.hasClient())
     {
@@ -199,10 +191,9 @@ void Netdump::tcpDumpLoop(WiFiServer &tcpDumpServer, const Filter nf)
         bufferIndex = 0;
         writePcapHeader(tcpDumpClient);
 
-        setCallback([this](const Packet & ndp)
-        {
-            tcpDumpProcess(ndp);
-        }, nf);
+        setCallback([this](const Packet& ndp)
+                    { tcpDumpProcess(ndp); },
+                    nf);
     }
     if (!tcpDumpClient || !tcpDumpClient.connected())
     {
@@ -217,10 +208,8 @@ void Netdump::tcpDumpLoop(WiFiServer &tcpDumpServer, const Filter nf)
     if (tcpDumpServer.status() != CLOSED)
     {
         schedule_function([&tcpDumpServer, this, nf]()
-        {
-            tcpDumpLoop(tcpDumpServer, nf);
-        });
+                          { tcpDumpLoop(tcpDumpServer, nf); });
     }
 }
 
-} // namespace NetCapture
+}  // namespace NetCapture
diff --git a/libraries/Netdump/src/Netdump.h b/libraries/Netdump/src/Netdump.h
index 0e8b6cbb00..dd5a3d124c 100644
--- a/libraries/Netdump/src/Netdump.h
+++ b/libraries/Netdump/src/Netdump.h
@@ -22,23 +22,21 @@
 #ifndef __NETDUMP_H
 #define __NETDUMP_H
 
+#include <ESP8266WiFi.h>
+#include <FS.h>
 #include <Print.h>
-#include <functional>
 #include <lwipopts.h>
-#include <FS.h>
-#include "NetdumpPacket.h"
-#include <ESP8266WiFi.h>
+#include <functional>
 #include "CallBackList.h"
+#include "NetdumpPacket.h"
 
 namespace NetCapture
 {
-
 using namespace experimental::CBListImplentation;
 
 class Netdump
 {
-public:
-
+   public:
     using Filter = std::function<bool(const Packet&)>;
     using Callback = std::function<void(const Packet&)>;
     using LwipCallback = std::function<void(int, const char*, int, int, int)>;
@@ -53,12 +51,11 @@ class Netdump
 
     void printDump(Print& out, Packet::PacketDetail ndd, const Filter nf = nullptr);
     void fileDump(File& outfile, const Filter nf = nullptr);
-    bool tcpDump(WiFiServer &tcpDumpServer, const Filter nf = nullptr);
-
+    bool tcpDump(WiFiServer& tcpDumpServer, const Filter nf = nullptr);
 
-private:
+   private:
     Callback netDumpCallback = nullptr;
-    Filter   netDumpFilter   = nullptr;
+    Filter netDumpFilter = nullptr;
 
     static void capture(int netif_idx, const char* data, size_t len, int out, int success);
     static CallBackList<LwipCallback> lwipCallback;
@@ -69,7 +66,7 @@ class Netdump
     void printDumpProcess(Print& out, Packet::PacketDetail ndd, const Packet& np) const;
     void fileDumpProcess(File& outfile, const Packet& np) const;
     void tcpDumpProcess(const Packet& np);
-    void tcpDumpLoop(WiFiServer &tcpDumpServer, const Filter nf);
+    void tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf);
 
     void writePcapHeader(Stream& s) const;
 
@@ -82,6 +79,6 @@ class Netdump
     static constexpr uint32_t pcapMagic = 0xa1b2c3d4;
 };
 
-} // namespace NetCapture
+}  // namespace NetCapture
 
 #endif /* __NETDUMP_H */
diff --git a/libraries/Netdump/src/NetdumpIP.cpp b/libraries/Netdump/src/NetdumpIP.cpp
index 56936c744a..f90113f47b 100644
--- a/libraries/Netdump/src/NetdumpIP.cpp
+++ b/libraries/Netdump/src/NetdumpIP.cpp
@@ -23,7 +23,6 @@
 
 namespace NetCapture
 {
-
 NetdumpIP::NetdumpIP()
 {
 }
@@ -37,7 +36,7 @@ NetdumpIP::NetdumpIP(uint8_t first_octet, uint8_t second_octet, uint8_t third_oc
     (*this)[3] = fourth_octet;
 }
 
-NetdumpIP::NetdumpIP(const uint8_t *address, bool v4)
+NetdumpIP::NetdumpIP(const uint8_t* address, bool v4)
 {
     uint8_t cnt;
     if (v4)
@@ -88,7 +87,7 @@ NetdumpIP::NetdumpIP(const String& ip)
     }
 }
 
-bool NetdumpIP::fromString(const char *address)
+bool NetdumpIP::fromString(const char* address)
 {
     if (!fromString4(address))
     {
@@ -97,11 +96,11 @@ bool NetdumpIP::fromString(const char *address)
     return true;
 }
 
-bool NetdumpIP::fromString4(const char *address)
+bool NetdumpIP::fromString4(const char* address)
 {
     // TODO: (IPv4) add support for "a", "a.b", "a.b.c" formats
 
-    uint16_t acc = 0; // Accumulator
+    uint16_t acc = 0;  // Accumulator
     uint8_t dots = 0;
 
     while (*address)
@@ -144,11 +143,11 @@ bool NetdumpIP::fromString4(const char *address)
     return true;
 }
 
-bool NetdumpIP::fromString6(const char *address)
+bool NetdumpIP::fromString6(const char* address)
 {
     // TODO: test test test
 
-    uint32_t acc = 0; // Accumulator
+    uint32_t acc = 0;  // Accumulator
     int dots = 0, doubledots = -1;
 
     while (*address)
@@ -162,7 +161,7 @@ bool NetdumpIP::fromString6(const char *address)
             }
             acc = acc * 16 + (c - '0');
             if (acc > 0xffff)
-                // Value out of range
+            // Value out of range
             {
                 return false;
             }
@@ -172,7 +171,7 @@ bool NetdumpIP::fromString6(const char *address)
             if (*address == ':')
             {
                 if (doubledots >= 0)
-                    // :: allowed once
+                // :: allowed once
                 {
                     return false;
                 }
@@ -181,7 +180,7 @@ bool NetdumpIP::fromString6(const char *address)
                 address++;
             }
             if (dots == 7)
-                // too many separators
+            // too many separators
             {
                 return false;
             }
@@ -189,14 +188,14 @@ bool NetdumpIP::fromString6(const char *address)
             acc = 0;
         }
         else
-            // Invalid char
+        // Invalid char
         {
             return false;
         }
     }
 
     if (doubledots == -1 && dots != 7)
-        // Too few separators
+    // Too few separators
     {
         return false;
     }
@@ -223,12 +222,11 @@ String NetdumpIP::toString()
     StreamString sstr;
     if (isV6())
     {
-        sstr.reserve(40); // 8 shorts x 4 chars each + 7 colons + nullterm
-
+        sstr.reserve(40);  // 8 shorts x 4 chars each + 7 colons + nullterm
     }
     else
     {
-        sstr.reserve(16); // 4 bytes with 3 chars max + 3 dots + nullterm, or '(IP unset)'
+        sstr.reserve(16);  // 4 bytes with 3 chars max + 3 dots + nullterm, or '(IP unset)'
     }
     printTo(sstr);
     return sstr;
@@ -253,7 +251,7 @@ size_t NetdumpIP::printTo(Print& p)
             {
                 n += p.printf_P(PSTR("%x"), bit);
                 if (count0 > 0)
-                    // no more hiding 0
+                // no more hiding 0
                 {
                     count0 = -8;
                 }
@@ -280,7 +278,7 @@ size_t NetdumpIP::printTo(Print& p)
     return n;
 }
 
-bool NetdumpIP::compareRaw(IPversion v, const uint8_t* a,  const uint8_t* b) const
+bool NetdumpIP::compareRaw(IPversion v, const uint8_t* a, const uint8_t* b) const
 {
     for (int i = 0; i < (v == IPversion::IPV4 ? 4 : 16); i++)
     {
@@ -296,39 +294,39 @@ bool NetdumpIP::compareIP(const IPAddress& ip) const
 {
     switch (ipv)
     {
-    case IPversion::UNSET :
-        if (ip.isSet())
-        {
-            return false;
-        }
-        else
-        {
-            return true;
-        }
-        break;
-    case IPversion::IPV4 :
-        if (ip.isV6() || !ip.isSet())
-        {
-            return false;
-        }
-        else
-        {
-            return compareRaw(IPversion::IPV4, rawip, reinterpret_cast<const uint8_t*>(&ip.v4()));
-        }
-        break;
-    case IPversion::IPV6 :
-        if (ip.isV4() || !ip.isSet())
-        {
+        case IPversion::UNSET:
+            if (ip.isSet())
+            {
+                return false;
+            }
+            else
+            {
+                return true;
+            }
+            break;
+        case IPversion::IPV4:
+            if (ip.isV6() || !ip.isSet())
+            {
+                return false;
+            }
+            else
+            {
+                return compareRaw(IPversion::IPV4, rawip, reinterpret_cast<const uint8_t*>(&ip.v4()));
+            }
+            break;
+        case IPversion::IPV6:
+            if (ip.isV4() || !ip.isSet())
+            {
+                return false;
+            }
+            else
+            {
+                return compareRaw(IPversion::IPV6, rawip, reinterpret_cast<const uint8_t*>(ip.raw6()));
+            }
+            break;
+        default:
             return false;
-        }
-        else
-        {
-            return compareRaw(IPversion::IPV6, rawip, reinterpret_cast<const uint8_t*>(ip.raw6()));
-        }
-        break;
-    default :
-        return false;
-        break;
+            break;
     }
 }
 
@@ -336,40 +334,40 @@ bool NetdumpIP::compareIP(const NetdumpIP& nip) const
 {
     switch (ipv)
     {
-    case IPversion::UNSET :
-        if (nip.isSet())
-        {
-            return false;
-        }
-        else
-        {
-            return true;
-        }
-        break;
-    case IPversion::IPV4 :
-        if (nip.isV6() || !nip.isSet())
-        {
-            return false;
-        }
-        else
-        {
-            return compareRaw(IPversion::IPV4, rawip, nip.rawip);
-        }
-        break;
-    case IPversion::IPV6 :
-        if (nip.isV4() || !nip.isSet())
-        {
+        case IPversion::UNSET:
+            if (nip.isSet())
+            {
+                return false;
+            }
+            else
+            {
+                return true;
+            }
+            break;
+        case IPversion::IPV4:
+            if (nip.isV6() || !nip.isSet())
+            {
+                return false;
+            }
+            else
+            {
+                return compareRaw(IPversion::IPV4, rawip, nip.rawip);
+            }
+            break;
+        case IPversion::IPV6:
+            if (nip.isV4() || !nip.isSet())
+            {
+                return false;
+            }
+            else
+            {
+                return compareRaw(IPversion::IPV6, rawip, nip.rawip);
+            }
+            break;
+        default:
             return false;
-        }
-        else
-        {
-            return compareRaw(IPversion::IPV6, rawip, nip.rawip);
-        }
-        break;
-    default :
-        return false;
-        break;
+            break;
     }
 }
 
-} // namespace NetCapture
+}  // namespace NetCapture
diff --git a/libraries/Netdump/src/NetdumpIP.h b/libraries/Netdump/src/NetdumpIP.h
index 8a450c374a..ae8efc7e94 100644
--- a/libraries/Netdump/src/NetdumpIP.h
+++ b/libraries/Netdump/src/NetdumpIP.h
@@ -8,21 +8,20 @@
 #ifndef LIBRARIES_ESPGOODIES_HR_SRC_NETDUMP_NETDUMPIP_H_
 #define LIBRARIES_ESPGOODIES_HR_SRC_NETDUMP_NETDUMPIP_H_
 
-#include <stdint.h>
-#include <lwip/init.h>
-#include <StreamString.h>
 #include <IPAddress.h>
+#include <StreamString.h>
+#include <lwip/init.h>
+#include <stdint.h>
 
 namespace NetCapture
 {
-
 class NetdumpIP
 {
-public:
+   public:
     NetdumpIP();
 
     NetdumpIP(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet);
-    NetdumpIP(const uint8_t *address, bool V4 = true);
+    NetdumpIP(const uint8_t* address, bool V4 = true);
     NetdumpIP(const IPAddress& ip);
     NetdumpIP(const String& ip);
 
@@ -31,12 +30,17 @@ class NetdumpIP
         return rawip[index];
     }
 
-    bool fromString(const char *address);
+    bool fromString(const char* address);
 
     String toString();
 
-private:
-    enum class IPversion {UNSET, IPV4, IPV6};
+   private:
+    enum class IPversion
+    {
+        UNSET,
+        IPV4,
+        IPV6
+    };
     IPversion ipv = IPversion::UNSET;
 
     uint8_t rawip[16] = {0};
@@ -70,15 +74,16 @@ class NetdumpIP
         return (ipv != IPversion::UNSET);
     };
 
-    bool compareRaw(IPversion v, const uint8_t* a,  const uint8_t* b) const;
+    bool compareRaw(IPversion v, const uint8_t* a, const uint8_t* b) const;
     bool compareIP(const IPAddress& ip) const;
     bool compareIP(const NetdumpIP& nip) const;
 
-    bool fromString4(const char *address);
-    bool fromString6(const char *address);
+    bool fromString4(const char* address);
+    bool fromString6(const char* address);
 
     size_t printTo(Print& p);
-public:
+
+   public:
     bool operator==(const IPAddress& addr) const
     {
         return compareIP(addr);
@@ -95,9 +100,8 @@ class NetdumpIP
     {
         return !compareIP(addr);
     };
-
 };
 
-} // namespace NetCapture
+}  // namespace NetCapture
 
 #endif /* LIBRARIES_ESPGOODIES_HR_SRC_NETDUMP_NETDUMPIP_H_ */
diff --git a/libraries/Netdump/src/NetdumpPacket.cpp b/libraries/Netdump/src/NetdumpPacket.cpp
index bb4e09920c..9efad50490 100644
--- a/libraries/Netdump/src/NetdumpPacket.cpp
+++ b/libraries/Netdump/src/NetdumpPacket.cpp
@@ -19,12 +19,11 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#include "Netdump.h"
 #include <lwip/init.h>
+#include "Netdump.h"
 
 namespace NetCapture
 {
-
 void Packet::printDetail(Print& out, const String& indent, const char* data, size_t size, PacketDetail pd) const
 {
     if (pd == PacketDetail::NONE)
@@ -159,18 +158,19 @@ void Packet::MACtoString(int dataIdx, StreamString& sstr) const
             sstr.print(':');
         }
     }
-
 }
 
 void Packet::ARPtoString(PacketDetail netdumpDetail, StreamString& sstr) const
 {
     switch (getARPType())
     {
-    case 1 : sstr.printf_P(PSTR("who has %s tell %s"), getIP(ETH_HDR_LEN + 24).toString().c_str(), getIP(ETH_HDR_LEN + 14).toString().c_str());
-        break;
-    case 2 : sstr.printf_P(PSTR("%s is at "), getIP(ETH_HDR_LEN + 14).toString().c_str());
-        MACtoString(ETH_HDR_LEN + 8, sstr);
-        break;
+        case 1:
+            sstr.printf_P(PSTR("who has %s tell %s"), getIP(ETH_HDR_LEN + 24).toString().c_str(), getIP(ETH_HDR_LEN + 14).toString().c_str());
+            break;
+        case 2:
+            sstr.printf_P(PSTR("%s is at "), getIP(ETH_HDR_LEN + 14).toString().c_str());
+            MACtoString(ETH_HDR_LEN + 8, sstr);
+            break;
     }
     sstr.printf("\r\n");
     printDetail(sstr, PSTR("           D "), &data[ETH_HDR_LEN], packetLength - ETH_HDR_LEN, netdumpDetail);
@@ -217,7 +217,7 @@ void Packet::TCPtoString(PacketDetail netdumpDetail, StreamString& sstr) const
     sstr.printf_P(PSTR("%d:%d "), getSrcPort(), getDstPort());
     uint16_t flags = getTcpFlags();
     sstr.print('[');
-    const char chars [] = "FSRPAUECN";
+    const char chars[] = "FSRPAUECN";
     for (uint8_t i = 0; i < sizeof chars; i++)
         if (flags & (1 << i))
         {
@@ -237,20 +237,36 @@ void Packet::ICMPtoString(PacketDetail, StreamString& sstr) const
     {
         switch (getIcmpType())
         {
-        case 0 : sstr.printf_P(PSTR("ping reply")); break;
-        case 8 : sstr.printf_P(PSTR("ping request")); break;
-        default: sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType()); break;
+            case 0:
+                sstr.printf_P(PSTR("ping reply"));
+                break;
+            case 8:
+                sstr.printf_P(PSTR("ping request"));
+                break;
+            default:
+                sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType());
+                break;
         }
     }
     if (isIPv6())
     {
         switch (getIcmpType())
         {
-        case 129 : sstr.printf_P(PSTR("ping reply")); break;
-        case 128 : sstr.printf_P(PSTR("ping request")); break;
-        case 135 : sstr.printf_P(PSTR("Neighbour solicitation")); break;
-        case 136 : sstr.printf_P(PSTR("Neighbour advertisement")); break;
-        default: sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType()); break;
+            case 129:
+                sstr.printf_P(PSTR("ping reply"));
+                break;
+            case 128:
+                sstr.printf_P(PSTR("ping request"));
+                break;
+            case 135:
+                sstr.printf_P(PSTR("Neighbour solicitation"));
+                break;
+            case 136:
+                sstr.printf_P(PSTR("Neighbour advertisement"));
+                break;
+            default:
+                sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType());
+                break;
         }
     }
     sstr.printf_P(PSTR("\r\n"));
@@ -260,18 +276,42 @@ void Packet::IGMPtoString(PacketDetail, StreamString& sstr) const
 {
     switch (getIgmpType())
     {
-    case 1 : sstr.printf_P(PSTR("Create Group Request")); break;
-    case 2 : sstr.printf_P(PSTR("Create Group Reply")); break;
-    case 3 : sstr.printf_P(PSTR("Join Group Request")); break;
-    case 4 : sstr.printf_P(PSTR("Join Group Reply")); break;
-    case 5 : sstr.printf_P(PSTR("Leave Group Request")); break;
-    case 6 : sstr.printf_P(PSTR("Leave Group Reply")); break;
-    case 7 : sstr.printf_P(PSTR("Confirm Group Request")); break;
-    case 8 : sstr.printf_P(PSTR("Confirm Group Reply")); break;
-    case 0x11 : sstr.printf_P(PSTR("Group Membership Query")); break;
-    case 0x12 : sstr.printf_P(PSTR("IGMPv1 Membership Report")); break;
-    case 0x22 : sstr.printf_P(PSTR("IGMPv3 Membership Report")); break;
-    default: sstr.printf_P(PSTR("type(0x%02x)"), getIgmpType()); break;
+        case 1:
+            sstr.printf_P(PSTR("Create Group Request"));
+            break;
+        case 2:
+            sstr.printf_P(PSTR("Create Group Reply"));
+            break;
+        case 3:
+            sstr.printf_P(PSTR("Join Group Request"));
+            break;
+        case 4:
+            sstr.printf_P(PSTR("Join Group Reply"));
+            break;
+        case 5:
+            sstr.printf_P(PSTR("Leave Group Request"));
+            break;
+        case 6:
+            sstr.printf_P(PSTR("Leave Group Reply"));
+            break;
+        case 7:
+            sstr.printf_P(PSTR("Confirm Group Request"));
+            break;
+        case 8:
+            sstr.printf_P(PSTR("Confirm Group Reply"));
+            break;
+        case 0x11:
+            sstr.printf_P(PSTR("Group Membership Query"));
+            break;
+        case 0x12:
+            sstr.printf_P(PSTR("IGMPv1 Membership Report"));
+            break;
+        case 0x22:
+            sstr.printf_P(PSTR("IGMPv3 Membership Report"));
+            break;
+        default:
+            sstr.printf_P(PSTR("type(0x%02x)"), getIgmpType());
+            break;
     }
     sstr.printf_P(PSTR("\r\n"));
 }
@@ -298,7 +338,6 @@ const String Packet::toString() const
     return toString(PacketDetail::NONE);
 }
 
-
 const String Packet::toString(PacketDetail netdumpDetail) const
 {
     StreamString sstr;
@@ -320,62 +359,62 @@ const String Packet::toString(PacketDetail netdumpDetail) const
 
     switch (thisPacketType)
     {
-    case PacketType::ARP :
-    {
-        ARPtoString(netdumpDetail, sstr);
-        break;
-    }
-    case PacketType::MDNS :
-    case PacketType::DNS :
-    {
-        DNStoString(netdumpDetail, sstr);
-        break;
-    }
-    case PacketType::SSDP :
-    case PacketType::DHCP :
-    case PacketType::WSDD :
-    case PacketType::NETBIOS :
-    case PacketType::SMB :
-    case PacketType::OTA :
-    case PacketType::UDP :
-    {
-        UDPtoString(netdumpDetail, sstr);
-        break;
-    }
-    case PacketType::TCP :
-    case PacketType::HTTP :
-    {
-        TCPtoString(netdumpDetail, sstr);
-        break;
-    }
-    case PacketType::ICMP :
-    {
-        ICMPtoString(netdumpDetail, sstr);
-        break;
-    }
-    case PacketType::IGMP :
-    {
-        IGMPtoString(netdumpDetail, sstr);
-        break;
-    }
-    case PacketType::IPv4 :
-    case PacketType::IPv6 :
-    {
-        IPtoString(netdumpDetail, sstr);
-        break;
-    }
-    case PacketType::UKNW :
-    {
-        UKNWtoString(netdumpDetail, sstr);
-        break;
-    }
-    default :
-    {
-        sstr.printf_P(PSTR("Non identified packet\r\n"));
-        break;
-    }
+        case PacketType::ARP:
+        {
+            ARPtoString(netdumpDetail, sstr);
+            break;
+        }
+        case PacketType::MDNS:
+        case PacketType::DNS:
+        {
+            DNStoString(netdumpDetail, sstr);
+            break;
+        }
+        case PacketType::SSDP:
+        case PacketType::DHCP:
+        case PacketType::WSDD:
+        case PacketType::NETBIOS:
+        case PacketType::SMB:
+        case PacketType::OTA:
+        case PacketType::UDP:
+        {
+            UDPtoString(netdumpDetail, sstr);
+            break;
+        }
+        case PacketType::TCP:
+        case PacketType::HTTP:
+        {
+            TCPtoString(netdumpDetail, sstr);
+            break;
+        }
+        case PacketType::ICMP:
+        {
+            ICMPtoString(netdumpDetail, sstr);
+            break;
+        }
+        case PacketType::IGMP:
+        {
+            IGMPtoString(netdumpDetail, sstr);
+            break;
+        }
+        case PacketType::IPv4:
+        case PacketType::IPv6:
+        {
+            IPtoString(netdumpDetail, sstr);
+            break;
+        }
+        case PacketType::UKNW:
+        {
+            UKNWtoString(netdumpDetail, sstr);
+            break;
+        }
+        default:
+        {
+            sstr.printf_P(PSTR("Non identified packet\r\n"));
+            break;
+        }
     }
     return sstr;
 }
 
-} // namespace NetCapture
+}  // namespace NetCapture
diff --git a/libraries/Netdump/src/NetdumpPacket.h b/libraries/Netdump/src/NetdumpPacket.h
index a898ef230f..8cf13169e0 100644
--- a/libraries/Netdump/src/NetdumpPacket.h
+++ b/libraries/Netdump/src/NetdumpPacket.h
@@ -22,21 +22,20 @@
 #ifndef __NETDUMP_PACKET_H
 #define __NETDUMP_PACKET_H
 
-#include <lwipopts.h>
 #include <IPAddress.h>
 #include <StreamString.h>
+#include <lwipopts.h>
+#include <vector>
 #include "NetdumpIP.h"
 #include "PacketType.h"
-#include <vector>
 
 namespace NetCapture
 {
-
 int constexpr ETH_HDR_LEN = 14;
 
 class Packet
 {
-public:
+   public:
     Packet(unsigned long msec, int n, const char* d, size_t l, int o, int s)
         : packetTime(msec), netif_idx(n), data(d), packetLength(l), out(o), success(s)
     {
@@ -75,7 +74,7 @@ class Packet
     {
         return ntoh16(idx + 2) | (((uint32_t)ntoh16(idx)) << 16);
     };
-    uint8_t  byteData(uint16_t idx) const
+    uint8_t byteData(uint16_t idx) const
     {
         return data[idx];
     }
@@ -87,17 +86,17 @@ class Packet
     {
         return ntoh16(12);
     };
-    uint8_t  ipType() const
+    uint8_t ipType() const
     {
         return isIP() ? isIPv4() ? data[ETH_HDR_LEN + 9] : data[ETH_HDR_LEN + 6] : 0;
     };
     uint16_t getIpHdrLen() const
     {
-        return isIPv4() ? (((unsigned char)data[ETH_HDR_LEN]) & 0x0f) << 2 : 40 ;   // IPv6 is fixed length
+        return isIPv4() ? (((unsigned char)data[ETH_HDR_LEN]) & 0x0f) << 2 : 40;  // IPv6 is fixed length
     }
     uint16_t getIpTotalLen() const
     {
-        return isIP() ? isIPv4() ? ntoh16(ETH_HDR_LEN + 2) : (packetLength - ETH_HDR_LEN)   :  0;
+        return isIP() ? isIPv4() ? ntoh16(ETH_HDR_LEN + 2) : (packetLength - ETH_HDR_LEN) : 0;
     }
     uint32_t getTcpSeq() const
     {
@@ -115,20 +114,20 @@ class Packet
     {
         return isTCP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 14) : 0;
     }
-    uint8_t  getTcpHdrLen() const
+    uint8_t getTcpHdrLen() const
     {
         return isTCP() ? (data[ETH_HDR_LEN + getIpHdrLen() + 12] >> 4) * 4 : 0;
-    };//Header len is in multiple of 4 bytes
+    };  //Header len is in multiple of 4 bytes
     uint16_t getTcpLen() const
     {
-        return isTCP() ? getIpTotalLen() - getIpHdrLen() - getTcpHdrLen() : 0 ;
+        return isTCP() ? getIpTotalLen() - getIpHdrLen() - getTcpHdrLen() : 0;
     };
 
-    uint8_t  getIcmpType() const
+    uint8_t getIcmpType() const
     {
         return isICMP() ? data[ETH_HDR_LEN + getIpHdrLen() + 0] : 0;
     }
-    uint8_t  getIgmpType() const
+    uint8_t getIgmpType() const
     {
         return isIGMP() ? data[ETH_HDR_LEN + getIpHdrLen() + 0] : 0;
     }
@@ -136,11 +135,11 @@ class Packet
     {
         return isARP() ? data[ETH_HDR_LEN + 7] : 0;
     }
-    bool    is_ARP_who() const
+    bool is_ARP_who() const
     {
         return (getARPType() == 1);
     }
-    bool    is_ARP_is() const
+    bool is_ARP_is() const
     {
         return (getARPType() == 2);
     }
@@ -244,7 +243,7 @@ class Packet
         return ip;
     };
 
-    bool      hasIP(NetdumpIP ip) const
+    bool hasIP(NetdumpIP ip) const
     {
         return (isIP() && ((ip == sourceIP()) || (ip == destIP())));
     }
@@ -270,7 +269,7 @@ class Packet
     {
         return isIP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 2) : 0;
     }
-    bool     hasPort(uint16_t p) const
+    bool hasPort(uint16_t p) const
     {
         return (isIP() && ((getSrcPort() == p) || (getDstPort() == p)));
     }
@@ -282,9 +281,7 @@ class Packet
     const PacketType packetType() const;
     const std::vector<PacketType>& allPacketTypes() const;
 
-
-private:
-
+   private:
     void setPacketType(PacketType);
     void setPacketTypes();
 
@@ -298,7 +295,6 @@ class Packet
     void IPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
     void UKNWtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
 
-
     time_t packetTime;
     int netif_idx;
     const char* data;
@@ -309,6 +305,6 @@ class Packet
     std::vector<PacketType> thisAllPacketTypes;
 };
 
-} // namespace NetCapture
+}  // namespace NetCapture
 
 #endif /* __NETDUMP_PACKET_H */
diff --git a/libraries/Netdump/src/PacketType.cpp b/libraries/Netdump/src/PacketType.cpp
index 565aa55f0a..05bf35a9f6 100644
--- a/libraries/Netdump/src/PacketType.cpp
+++ b/libraries/Netdump/src/PacketType.cpp
@@ -9,7 +9,6 @@
 
 namespace NetCapture
 {
-
 PacketType::PacketType()
 {
 }
@@ -18,25 +17,44 @@ String PacketType::toString() const
 {
     switch (ptype)
     {
-    case PType::ARP :    return PSTR("ARP");
-    case PType::IP :     return PSTR("IP");
-    case PType::UDP :    return PSTR("UDP");
-    case PType::MDNS :   return PSTR("MDNS");
-    case PType::DNS :    return PSTR("DNS");
-    case PType::SSDP :   return PSTR("SSDP");
-    case PType::DHCP :   return PSTR("DHCP");
-    case PType::WSDD :   return PSTR("WSDD");
-    case PType::NETBIOS: return PSTR("NBIO");
-    case PType::SMB :    return PSTR("SMB");
-    case PType::OTA :    return PSTR("OTA");
-    case PType::TCP :    return PSTR("TCP");
-    case PType::HTTP :   return PSTR("HTTP");
-    case PType::ICMP :   return PSTR("ICMP");
-    case PType::IGMP :   return PSTR("IGMP");
-    case PType::IPv4:    return PSTR("IPv4");
-    case PType::IPv6:    return PSTR("IPv6");
-    case PType::UKNW :   return PSTR("UKNW");
-    default :            return PSTR("ERR");
+        case PType::ARP:
+            return PSTR("ARP");
+        case PType::IP:
+            return PSTR("IP");
+        case PType::UDP:
+            return PSTR("UDP");
+        case PType::MDNS:
+            return PSTR("MDNS");
+        case PType::DNS:
+            return PSTR("DNS");
+        case PType::SSDP:
+            return PSTR("SSDP");
+        case PType::DHCP:
+            return PSTR("DHCP");
+        case PType::WSDD:
+            return PSTR("WSDD");
+        case PType::NETBIOS:
+            return PSTR("NBIO");
+        case PType::SMB:
+            return PSTR("SMB");
+        case PType::OTA:
+            return PSTR("OTA");
+        case PType::TCP:
+            return PSTR("TCP");
+        case PType::HTTP:
+            return PSTR("HTTP");
+        case PType::ICMP:
+            return PSTR("ICMP");
+        case PType::IGMP:
+            return PSTR("IGMP");
+        case PType::IPv4:
+            return PSTR("IPv4");
+        case PType::IPv6:
+            return PSTR("IPv6");
+        case PType::UKNW:
+            return PSTR("UKNW");
+        default:
+            return PSTR("ERR");
     };
 }
 
diff --git a/libraries/Netdump/src/PacketType.h b/libraries/Netdump/src/PacketType.h
index 8f4aa5ce79..c819f15511 100644
--- a/libraries/Netdump/src/PacketType.h
+++ b/libraries/Netdump/src/PacketType.h
@@ -11,11 +11,9 @@
 
 namespace NetCapture
 {
-
 class PacketType
 {
-public:
-
+   public:
     enum PType : int
     {
         ARP,
@@ -39,7 +37,8 @@ class PacketType
     };
 
     PacketType();
-    PacketType(PType pt) : ptype(pt) {};
+    PacketType(PType pt)
+        : ptype(pt){};
 
     operator PType() const
     {
@@ -52,7 +51,7 @@ class PacketType
 
     String toString() const;
 
-private:
+   private:
     PType ptype;
 };
 
diff --git a/libraries/SoftwareSerial b/libraries/SoftwareSerial
index eb4b29074b..bd2f6ce6a7 160000
--- a/libraries/SoftwareSerial
+++ b/libraries/SoftwareSerial
@@ -1 +1 @@
-Subproject commit eb4b29074b75eacac3585bf84b5495b8f80a92cf
+Subproject commit bd2f6ce6a78d0c31b6978bcffb3c8379a5e4e2e4
diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp
index e9fc796bbf..f389a7b24e 100644
--- a/libraries/Wire/Wire.cpp
+++ b/libraries/Wire/Wire.cpp
@@ -22,15 +22,15 @@
     Modified January 2017 by Bjorn Hammarberg (bjoham@esp8266.com) - i2c slave support
 */
 
-extern "C" {
+extern "C"
+{
+#include <inttypes.h>
 #include <stdlib.h>
 #include <string.h>
-#include <inttypes.h>
 }
 
-#include "twi.h"
 #include "Wire.h"
-
+#include "twi.h"
 
 //Some boards don't have these pins available, and hence don't support Wire.
 //Check here for compile-time error.
@@ -199,7 +199,7 @@ size_t TwoWire::write(uint8_t data)
     return 1;
 }
 
-size_t TwoWire::write(const uint8_t *data, size_t quantity)
+size_t TwoWire::write(const uint8_t* data, size_t quantity)
 {
     if (transmitting)
     {
@@ -312,7 +312,7 @@ void TwoWire::onReceive(void (*function)(int))
     // arduino api compatibility fixer:
     // really hope size parameter will not exceed 2^31 :)
     static_assert(sizeof(int) == sizeof(size_t), "something is wrong in Arduino kingdom");
-    user_onReceive = reinterpret_cast<void(*)(size_t)>(function);
+    user_onReceive = reinterpret_cast<void (*)(size_t)>(function);
 }
 
 void TwoWire::onReceive(void (*function)(size_t))
diff --git a/libraries/Wire/Wire.h b/libraries/Wire/Wire.h
index be73f10fe6..626087a4b2 100644
--- a/libraries/Wire/Wire.h
+++ b/libraries/Wire/Wire.h
@@ -27,7 +27,6 @@
 #include <inttypes.h>
 #include "Stream.h"
 
-
 #ifndef I2C_BUFFER_LENGTH
 // DEPRECATED: Do not use BUFFER_LENGTH, prefer I2C_BUFFER_LENGTH
 #define BUFFER_LENGTH 128
@@ -36,7 +35,7 @@
 
 class TwoWire : public Stream
 {
-private:
+   private:
     static uint8_t rxBuffer[];
     static size_t rxBufferIndex;
     static size_t rxBufferLength;
@@ -51,11 +50,12 @@ class TwoWire : public Stream
     static void (*user_onReceive)(size_t);
     static void onRequestService(void);
     static void onReceiveService(uint8_t*, size_t);
-public:
+
+   public:
     TwoWire();
     void begin(int sda, int scl);
     void begin(int sda, int scl, uint8_t address);
-    void pins(int sda, int scl) __attribute__((deprecated)); // use begin(sda, scl) in new code
+    void pins(int sda, int scl) __attribute__((deprecated));  // use begin(sda, scl) in new code
     void begin();
     void begin(uint8_t);
     void begin(int);
@@ -74,13 +74,13 @@ class TwoWire : public Stream
     uint8_t requestFrom(int, int, int);
 
     virtual size_t write(uint8_t);
-    virtual size_t write(const uint8_t *, size_t);
+    virtual size_t write(const uint8_t*, size_t);
     virtual int available(void);
     virtual int read(void);
     virtual int peek(void);
     virtual void flush(void);
-    void onReceive(void (*)(int));      // arduino api
-    void onReceive(void (*)(size_t));   // legacy esp8266 backward compatibility
+    void onReceive(void (*)(int));     // arduino api
+    void onReceive(void (*)(size_t));  // legacy esp8266 backward compatibility
     void onRequest(void (*)(void));
 
     using Print::write;
@@ -91,4 +91,3 @@ extern TwoWire Wire;
 #endif
 
 #endif
-
diff --git a/libraries/lwIP_PPP/src/PPPServer.cpp b/libraries/lwIP_PPP/src/PPPServer.cpp
index 98fddd7777..ef0e571ec5 100644
--- a/libraries/lwIP_PPP/src/PPPServer.cpp
+++ b/libraries/lwIP_PPP/src/PPPServer.cpp
@@ -10,13 +10,14 @@
 // using NAT instead (see in example)
 
 #include <Arduino.h>
-#include <Schedule.h>
 #include <IPAddress.h>
+#include <Schedule.h>
 #include <lwip/dns.h>
 
 #include "PPPServer.h"
 
-PPPServer::PPPServer(Stream* sio): _sio(sio), _cb(netif_status_cb_s), _enabled(false)
+PPPServer::PPPServer(Stream* sio)
+    : _sio(sio), _cb(netif_status_cb_s), _enabled(false)
 {
 }
 
@@ -43,85 +44,85 @@ void PPPServer::link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx)
 
     switch (err_code)
     {
-    case PPPERR_NONE:               /* No error. */
-    {
+        case PPPERR_NONE: /* No error. */
+        {
 #if LWIP_DNS
-        const ip_addr_t *ns;
+            const ip_addr_t* ns;
 #endif /* LWIP_DNS */
-        ets_printf("ppp_link_status_cb: PPPERR_NONE\n\r");
+            ets_printf("ppp_link_status_cb: PPPERR_NONE\n\r");
 #if LWIP_IPV4
-        ets_printf("   our_ip4addr = %s\n\r", ip4addr_ntoa(netif_ip4_addr(nif)));
-        ets_printf("   his_ipaddr  = %s\n\r", ip4addr_ntoa(netif_ip4_gw(nif)));
-        ets_printf("   netmask     = %s\n\r", ip4addr_ntoa(netif_ip4_netmask(nif)));
+            ets_printf("   our_ip4addr = %s\n\r", ip4addr_ntoa(netif_ip4_addr(nif)));
+            ets_printf("   his_ipaddr  = %s\n\r", ip4addr_ntoa(netif_ip4_gw(nif)));
+            ets_printf("   netmask     = %s\n\r", ip4addr_ntoa(netif_ip4_netmask(nif)));
 #endif /* LWIP_IPV4 */
 #if LWIP_IPV6
-        ets_printf("   our_ip6addr = %s\n\r", ip6addr_ntoa(netif_ip6_addr(nif, 0)));
+            ets_printf("   our_ip6addr = %s\n\r", ip6addr_ntoa(netif_ip6_addr(nif, 0)));
 #endif /* LWIP_IPV6 */
 
 #if LWIP_DNS
-        ns = dns_getserver(0);
-        ets_printf("   dns1        = %s\n\r", ipaddr_ntoa(ns));
-        ns = dns_getserver(1);
-        ets_printf("   dns2        = %s\n\r", ipaddr_ntoa(ns));
+            ns = dns_getserver(0);
+            ets_printf("   dns1        = %s\n\r", ipaddr_ntoa(ns));
+            ns = dns_getserver(1);
+            ets_printf("   dns2        = %s\n\r", ipaddr_ntoa(ns));
 #endif /* LWIP_DNS */
 #if PPP_IPV6_SUPPORT
-        ets_printf("   our6_ipaddr = %s\n\r", ip6addr_ntoa(netif_ip6_addr(nif, 0)));
+            ets_printf("   our6_ipaddr = %s\n\r", ip6addr_ntoa(netif_ip6_addr(nif, 0)));
 #endif /* PPP_IPV6_SUPPORT */
-    }
-    stop = false;
-    break;
+        }
+            stop = false;
+            break;
 
-    case PPPERR_PARAM:             /* Invalid parameter. */
-        ets_printf("ppp_link_status_cb: PPPERR_PARAM\n");
-        break;
+        case PPPERR_PARAM: /* Invalid parameter. */
+            ets_printf("ppp_link_status_cb: PPPERR_PARAM\n");
+            break;
 
-    case PPPERR_OPEN:              /* Unable to open PPP session. */
-        ets_printf("ppp_link_status_cb: PPPERR_OPEN\n");
-        break;
+        case PPPERR_OPEN: /* Unable to open PPP session. */
+            ets_printf("ppp_link_status_cb: PPPERR_OPEN\n");
+            break;
 
-    case PPPERR_DEVICE:            /* Invalid I/O device for PPP. */
-        ets_printf("ppp_link_status_cb: PPPERR_DEVICE\n");
-        break;
+        case PPPERR_DEVICE: /* Invalid I/O device for PPP. */
+            ets_printf("ppp_link_status_cb: PPPERR_DEVICE\n");
+            break;
 
-    case PPPERR_ALLOC:             /* Unable to allocate resources. */
-        ets_printf("ppp_link_status_cb: PPPERR_ALLOC\n");
-        break;
+        case PPPERR_ALLOC: /* Unable to allocate resources. */
+            ets_printf("ppp_link_status_cb: PPPERR_ALLOC\n");
+            break;
 
-    case PPPERR_USER:              /* User interrupt. */
-        ets_printf("ppp_link_status_cb: PPPERR_USER\n");
-        break;
+        case PPPERR_USER: /* User interrupt. */
+            ets_printf("ppp_link_status_cb: PPPERR_USER\n");
+            break;
 
-    case PPPERR_CONNECT:           /* Connection lost. */
-        ets_printf("ppp_link_status_cb: PPPERR_CONNECT\n");
-        break;
+        case PPPERR_CONNECT: /* Connection lost. */
+            ets_printf("ppp_link_status_cb: PPPERR_CONNECT\n");
+            break;
 
-    case PPPERR_AUTHFAIL:          /* Failed authentication challenge. */
-        ets_printf("ppp_link_status_cb: PPPERR_AUTHFAIL\n");
-        break;
+        case PPPERR_AUTHFAIL: /* Failed authentication challenge. */
+            ets_printf("ppp_link_status_cb: PPPERR_AUTHFAIL\n");
+            break;
 
-    case PPPERR_PROTOCOL:          /* Failed to meet protocol. */
-        ets_printf("ppp_link_status_cb: PPPERR_PROTOCOL\n");
-        break;
+        case PPPERR_PROTOCOL: /* Failed to meet protocol. */
+            ets_printf("ppp_link_status_cb: PPPERR_PROTOCOL\n");
+            break;
 
-    case PPPERR_PEERDEAD:          /* Connection timeout. */
-        ets_printf("ppp_link_status_cb: PPPERR_PEERDEAD\n");
-        break;
+        case PPPERR_PEERDEAD: /* Connection timeout. */
+            ets_printf("ppp_link_status_cb: PPPERR_PEERDEAD\n");
+            break;
 
-    case PPPERR_IDLETIMEOUT:       /* Idle Timeout. */
-        ets_printf("ppp_link_status_cb: PPPERR_IDLETIMEOUT\n");
-        break;
+        case PPPERR_IDLETIMEOUT: /* Idle Timeout. */
+            ets_printf("ppp_link_status_cb: PPPERR_IDLETIMEOUT\n");
+            break;
 
-    case PPPERR_CONNECTTIME:       /* PPPERR_CONNECTTIME. */
-        ets_printf("ppp_link_status_cb: PPPERR_CONNECTTIME\n");
-        break;
+        case PPPERR_CONNECTTIME: /* PPPERR_CONNECTTIME. */
+            ets_printf("ppp_link_status_cb: PPPERR_CONNECTTIME\n");
+            break;
 
-    case PPPERR_LOOPBACK:          /* Connection timeout. */
-        ets_printf("ppp_link_status_cb: PPPERR_LOOPBACK\n");
-        break;
+        case PPPERR_LOOPBACK: /* Connection timeout. */
+            ets_printf("ppp_link_status_cb: PPPERR_LOOPBACK\n");
+            break;
 
-    default:
-        ets_printf("ppp_link_status_cb: unknown errCode %d\n", err_code);
-        break;
+        default:
+            ets_printf("ppp_link_status_cb: unknown errCode %d\n", err_code);
+            break;
     }
 
     if (stop)
@@ -178,9 +179,8 @@ bool PPPServer::begin(const IPAddress& ourAddress, const IPAddress& peer)
 
     _enabled = true;
     if (!schedule_recurrent_function_us([&]()
-{
-    return this->handlePackets();
-    }, 1000))
+                                        { return this->handlePackets(); },
+                                        1000))
     {
         netif_remove(&_netif);
         return false;
diff --git a/libraries/lwIP_PPP/src/PPPServer.h b/libraries/lwIP_PPP/src/PPPServer.h
index e2c95658a6..5bae0ebe6b 100644
--- a/libraries/lwIP_PPP/src/PPPServer.h
+++ b/libraries/lwIP_PPP/src/PPPServer.h
@@ -27,7 +27,6 @@
 
 */
 
-
 #ifndef __PPPSERVER_H
 #define __PPPSERVER_H
 
@@ -39,8 +38,7 @@
 
 class PPPServer
 {
-public:
-
+   public:
     PPPServer(Stream* sio);
 
     bool begin(const IPAddress& ourAddress, const IPAddress& peer = IPAddress(172, 31, 255, 254));
@@ -55,8 +53,7 @@ class PPPServer
         return &_netif.gw;
     }
 
-protected:
-
+   protected:
     static constexpr size_t _bufsize = 128;
     Stream* _sio;
     ppp_pcb* _ppp;
@@ -71,7 +68,6 @@ class PPPServer
     static u32_t output_cb_s(ppp_pcb* pcb, u8_t* data, u32_t len, void* ctx);
     static void link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx);
     static void netif_status_cb_s(netif* nif);
-
 };
 
-#endif // __PPPSERVER_H
+#endif  // __PPPSERVER_H
diff --git a/libraries/lwIP_enc28j60/src/ENC28J60lwIP.h b/libraries/lwIP_enc28j60/src/ENC28J60lwIP.h
index e525e94069..cef7d61f8e 100644
--- a/libraries/lwIP_enc28j60/src/ENC28J60lwIP.h
+++ b/libraries/lwIP_enc28j60/src/ENC28J60lwIP.h
@@ -7,4 +7,4 @@
 
 using ENC28J60lwIP = LwipIntfDev<ENC28J60>;
 
-#endif // _ENC28J60LWIP_H
+#endif  // _ENC28J60LWIP_H
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
index 42d1af7fc2..a1ac345a3c 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
@@ -35,15 +35,14 @@
 #include <Arduino.h>
 #include <SPI.h>
 
+#include <stdarg.h>
 #include <stdint.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <string.h>
 
 #include "enc28j60.h"
 
-
-void serial_printf(const char *fmt, ...)
+void serial_printf(const char* fmt, ...)
 {
     char buf[128];
     va_list args;
@@ -57,11 +56,15 @@ void serial_printf(const char *fmt, ...)
 #if DEBUG
 #define PRINTF(...) printf(__VA_ARGS__)
 #else
-#define PRINTF(...) do { (void)0; } while (0)
+#define PRINTF(...) \
+    do              \
+    {               \
+        (void)0;    \
+    } while (0)
 #endif
 
-#define EIE   0x1b
-#define EIR   0x1c
+#define EIE 0x1b
+#define EIR 0x1c
 #define ESTAT 0x1d
 #define ECON2 0x1e
 #define ECON1 0x1f
@@ -69,13 +72,13 @@ void serial_printf(const char *fmt, ...)
 #define ESTAT_CLKRDY 0x01
 #define ESTAT_TXABRT 0x02
 
-#define ECON1_RXEN   0x04
-#define ECON1_TXRTS  0x08
+#define ECON1_RXEN 0x04
+#define ECON1_TXRTS 0x08
 
 #define ECON2_AUTOINC 0x80
-#define ECON2_PKTDEC  0x40
+#define ECON2_PKTDEC 0x40
 
-#define EIR_TXIF      0x08
+#define EIR_TXIF 0x08
 
 #define ERXTX_BANK 0x00
 
@@ -95,19 +98,19 @@ void serial_printf(const char *fmt, ...)
 #define ERXRDPTH 0x0d
 
 #define RX_BUF_START 0x0000
-#define RX_BUF_END   0x0fff
+#define RX_BUF_END 0x0fff
 
 #define TX_BUF_START 0x1200
 
 /* MACONx registers are in bank 2 */
 #define MACONX_BANK 0x02
 
-#define MACON1  0x00
-#define MACON3  0x02
-#define MACON4  0x03
+#define MACON1 0x00
+#define MACON3 0x02
+#define MACON4 0x03
 #define MABBIPG 0x04
-#define MAIPGL  0x06
-#define MAIPGH  0x07
+#define MAIPGL 0x06
+#define MAIPGH 0x07
 #define MAMXFLL 0x0a
 #define MAMXFLH 0x0b
 
@@ -116,9 +119,9 @@ void serial_printf(const char *fmt, ...)
 #define MACON1_MARXEN 0x01
 
 #define MACON3_PADCFG_FULL 0xe0
-#define MACON3_TXCRCEN     0x10
-#define MACON3_FRMLNEN     0x02
-#define MACON3_FULDPX      0x01
+#define MACON3_TXCRCEN 0x10
+#define MACON3_FRMLNEN 0x02
+#define MACON3_FULDPX 0x01
 
 #define MAX_MAC_LENGTH 1518
 
@@ -136,36 +139,33 @@ void serial_printf(const char *fmt, ...)
 #define ERXFCON 0x18
 #define EPKTCNT 0x19
 
-#define ERXFCON_UCEN  0x80
+#define ERXFCON_UCEN 0x80
 #define ERXFCON_ANDOR 0x40
 #define ERXFCON_CRCEN 0x20
-#define ERXFCON_MCEN  0x02
-#define ERXFCON_BCEN  0x01
+#define ERXFCON_MCEN 0x02
+#define ERXFCON_BCEN 0x01
 
 // The ENC28J60 SPI Interface supports clock speeds up to 20 MHz
 static const SPISettings spiSettings(20000000, MSBFIRST, SPI_MODE0);
 
-ENC28J60::ENC28J60(int8_t cs, SPIClass& spi, int8_t intr):
-    _bank(ERXTX_BANK), _cs(cs), _spi(spi)
+ENC28J60::ENC28J60(int8_t cs, SPIClass& spi, int8_t intr)
+    : _bank(ERXTX_BANK), _cs(cs), _spi(spi)
 {
     (void)intr;
 }
 
-void
-ENC28J60::enc28j60_arch_spi_select(void)
+void ENC28J60::enc28j60_arch_spi_select(void)
 {
     SPI.beginTransaction(spiSettings);
     digitalWrite(_cs, LOW);
 }
 
-void
-ENC28J60::enc28j60_arch_spi_deselect(void)
+void ENC28J60::enc28j60_arch_spi_deselect(void)
 {
     digitalWrite(_cs, HIGH);
     SPI.endTransaction();
 }
 
-
 /*---------------------------------------------------------------------------*/
 uint8_t
 ENC28J60::is_mac_mii_reg(uint8_t reg)
@@ -173,14 +173,14 @@ ENC28J60::is_mac_mii_reg(uint8_t reg)
     /* MAC or MII register (otherwise, ETH register)? */
     switch (_bank)
     {
-    case MACONX_BANK:
-        return reg < EIE;
-    case MAADRX_BANK:
-        return reg <= MAADR2 || reg == MISTAT;
-    case ERXTX_BANK:
-    case EPKTCNT_BANK:
-    default:
-        return 0;
+        case MACONX_BANK:
+            return reg < EIE;
+        case MAADRX_BANK:
+            return reg <= MAADR2 || reg == MISTAT;
+        case ERXTX_BANK:
+        case EPKTCNT_BANK:
+        default:
+            return 0;
     }
 }
 /*---------------------------------------------------------------------------*/
@@ -200,8 +200,7 @@ ENC28J60::readreg(uint8_t reg)
     return r;
 }
 /*---------------------------------------------------------------------------*/
-void
-ENC28J60::writereg(uint8_t reg, uint8_t data)
+void ENC28J60::writereg(uint8_t reg, uint8_t data)
 {
     enc28j60_arch_spi_select();
     SPI.transfer(0x40 | (reg & 0x1f));
@@ -209,8 +208,7 @@ ENC28J60::writereg(uint8_t reg, uint8_t data)
     enc28j60_arch_spi_deselect();
 }
 /*---------------------------------------------------------------------------*/
-void
-ENC28J60::setregbitfield(uint8_t reg, uint8_t mask)
+void ENC28J60::setregbitfield(uint8_t reg, uint8_t mask)
 {
     if (is_mac_mii_reg(reg))
     {
@@ -225,8 +223,7 @@ ENC28J60::setregbitfield(uint8_t reg, uint8_t mask)
     }
 }
 /*---------------------------------------------------------------------------*/
-void
-ENC28J60::clearregbitfield(uint8_t reg, uint8_t mask)
+void ENC28J60::clearregbitfield(uint8_t reg, uint8_t mask)
 {
     if (is_mac_mii_reg(reg))
     {
@@ -241,15 +238,13 @@ ENC28J60::clearregbitfield(uint8_t reg, uint8_t mask)
     }
 }
 /*---------------------------------------------------------------------------*/
-void
-ENC28J60::setregbank(uint8_t new_bank)
+void ENC28J60::setregbank(uint8_t new_bank)
 {
     writereg(ECON1, (readreg(ECON1) & 0xfc) | (new_bank & 0x03));
     _bank = new_bank;
 }
 /*---------------------------------------------------------------------------*/
-void
-ENC28J60::writedata(const uint8_t *data, int datalen)
+void ENC28J60::writedata(const uint8_t* data, int datalen)
 {
     int i;
     enc28j60_arch_spi_select();
@@ -262,14 +257,12 @@ ENC28J60::writedata(const uint8_t *data, int datalen)
     enc28j60_arch_spi_deselect();
 }
 /*---------------------------------------------------------------------------*/
-void
-ENC28J60::writedatabyte(uint8_t byte)
+void ENC28J60::writedatabyte(uint8_t byte)
 {
     writedata(&byte, 1);
 }
 /*---------------------------------------------------------------------------*/
-int
-ENC28J60::readdata(uint8_t *buf, int len)
+int ENC28J60::readdata(uint8_t* buf, int len)
 {
     int i;
     enc28j60_arch_spi_select();
@@ -292,8 +285,7 @@ ENC28J60::readdatabyte(void)
 }
 
 /*---------------------------------------------------------------------------*/
-void
-ENC28J60::softreset(void)
+void ENC28J60::softreset(void)
 {
     enc28j60_arch_spi_select();
     /* The System Command (soft reset) is 1 1 1 1 1 1 1 1 */
@@ -312,20 +304,19 @@ ENC28J60::readrev(void)
     rev = readreg(EREVID);
     switch (rev)
     {
-    case 2:
-        return 1;
-    case 6:
-        return 7;
-    default:
-        return rev;
+        case 2:
+            return 1;
+        case 6:
+            return 7;
+        default:
+            return rev;
     }
 }
 //#endif
 
 /*---------------------------------------------------------------------------*/
 
-bool
-ENC28J60::reset(void)
+bool ENC28J60::reset(void)
 {
     PRINTF("enc28j60: resetting chip\n");
 
@@ -398,7 +389,9 @@ ENC28J60::reset(void)
 
     /* Wait for OST */
     PRINTF("waiting for ESTAT_CLKRDY\n");
-    while ((readreg(ESTAT) & ESTAT_CLKRDY) == 0) {};
+    while ((readreg(ESTAT) & ESTAT_CLKRDY) == 0)
+    {
+    };
     PRINTF("ESTAT_CLKRDY\n");
 
     setregbank(ERXTX_BANK);
@@ -471,7 +464,7 @@ ENC28J60::reset(void)
 
     /* Set padding, crc, full duplex */
     setregbitfield(MACON3, MACON3_PADCFG_FULL | MACON3_TXCRCEN | MACON3_FULDPX |
-                   MACON3_FRMLNEN);
+                               MACON3_FRMLNEN);
 
     /* Don't modify MACON4 */
 
@@ -532,7 +525,7 @@ ENC28J60::reset(void)
 }
 /*---------------------------------------------------------------------------*/
 boolean
-ENC28J60::begin(const uint8_t *address)
+ENC28J60::begin(const uint8_t* address)
 {
     _localMac = address;
 
@@ -547,7 +540,7 @@ ENC28J60::begin(const uint8_t *address)
 /*---------------------------------------------------------------------------*/
 
 uint16_t
-ENC28J60::sendFrame(const uint8_t *data, uint16_t datalen)
+ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen)
 {
     uint16_t dataend;
 
@@ -598,7 +591,8 @@ ENC28J60::sendFrame(const uint8_t *data, uint16_t datalen)
 
     /* Send the packet */
     setregbitfield(ECON1, ECON1_TXRTS);
-    while ((readreg(ECON1) & ECON1_TXRTS) > 0);
+    while ((readreg(ECON1) & ECON1_TXRTS) > 0)
+        ;
 
 #if DEBUG
     if ((readreg(ESTAT) & ESTAT_TXABRT) != 0)
@@ -611,11 +605,13 @@ ENC28J60::sendFrame(const uint8_t *data, uint16_t datalen)
         readdata(tsv, sizeof(tsv));
         writereg(ERDPTL, erdpt & 0xff);
         writereg(ERDPTH, erdpt >> 8);
-        PRINTF("enc28j60: tx err: %d: %02x:%02x:%02x:%02x:%02x:%02x\n"
-               "                  tsv: %02x%02x%02x%02x%02x%02x%02x\n", datalen,
-               0xff & data[0], 0xff & data[1], 0xff & data[2],
-               0xff & data[3], 0xff & data[4], 0xff & data[5],
-               tsv[6], tsv[5], tsv[4], tsv[3], tsv[2], tsv[1], tsv[0]);
+        PRINTF(
+            "enc28j60: tx err: %d: %02x:%02x:%02x:%02x:%02x:%02x\n"
+            "                  tsv: %02x%02x%02x%02x%02x%02x%02x\n",
+            datalen,
+            0xff & data[0], 0xff & data[1], 0xff & data[2],
+            0xff & data[3], 0xff & data[4], 0xff & data[5],
+            tsv[6], tsv[5], tsv[4], tsv[3], tsv[2], tsv[1], tsv[0]);
     }
     else
     {
@@ -633,7 +629,7 @@ ENC28J60::sendFrame(const uint8_t *data, uint16_t datalen)
 /*---------------------------------------------------------------------------*/
 
 uint16_t
-ENC28J60::readFrame(uint8_t *buffer, uint16_t bufsize)
+ENC28J60::readFrame(uint8_t* buffer, uint16_t bufsize)
 {
     readFrameSize();
     return readFrameData(buffer, bufsize);
@@ -682,19 +678,17 @@ ENC28J60::readFrameSize()
     return _len;
 }
 
-void
-ENC28J60::discardFrame(uint16_t framesize)
+void ENC28J60::discardFrame(uint16_t framesize)
 {
     (void)framesize;
     (void)readFrameData(nullptr, 0);
 }
 
 uint16_t
-ENC28J60::readFrameData(uint8_t *buffer, uint16_t framesize)
+ENC28J60::readFrameData(uint8_t* buffer, uint16_t framesize)
 {
     if (framesize < _len)
     {
-
         buffer = nullptr;
 
         /* flush rx fifo */
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.h b/libraries/lwIP_enc28j60/src/utility/enc28j60.h
index 07ec39e929..fb544e1bfc 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.h
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.h
@@ -46,8 +46,7 @@
 */
 class ENC28J60
 {
-
-public:
+   public:
     /**
         Constructor that uses the default hardware SPI pins
         @param cs the Arduino Chip Select / Slave Select pin (default 10 on Uno)
@@ -61,7 +60,7 @@ class ENC28J60
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean begin(const uint8_t *address);
+    boolean begin(const uint8_t* address);
 
     /**
         Send an Ethernet frame
@@ -69,7 +68,7 @@ class ENC28J60
         @param datalen the length of the data in the packet
         @return the number of bytes transmitted
     */
-    virtual uint16_t sendFrame(const uint8_t *data, uint16_t datalen);
+    virtual uint16_t sendFrame(const uint8_t* data, uint16_t datalen);
 
     /**
         Read an Ethernet frame
@@ -78,10 +77,9 @@ class ENC28J60
         @return the length of the received packet
                or 0 if no packet was received
     */
-    virtual uint16_t readFrame(uint8_t *buffer, uint16_t bufsize);
-
-protected:
+    virtual uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
 
+   protected:
     static constexpr bool interruptIsPossible()
     {
         return false;
@@ -109,19 +107,18 @@ class ENC28J60
         @return the length of the received frame
                or 0 if a problem occurred
     */
-    uint16_t readFrameData(uint8_t *frame, uint16_t framesize);
-
-private:
+    uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
 
+   private:
     uint8_t is_mac_mii_reg(uint8_t reg);
     uint8_t readreg(uint8_t reg);
     void writereg(uint8_t reg, uint8_t data);
     void setregbitfield(uint8_t reg, uint8_t mask);
     void clearregbitfield(uint8_t reg, uint8_t mask);
     void setregbank(uint8_t new_bank);
-    void writedata(const uint8_t *data, int datalen);
+    void writedata(const uint8_t* data, int datalen);
     void writedatabyte(uint8_t byte);
-    int readdata(uint8_t *buf, int len);
+    int readdata(uint8_t* buf, int len);
     uint8_t readdatabyte(void);
     void softreset(void);
     uint8_t readrev(void);
@@ -140,7 +137,7 @@ class ENC28J60
     int8_t _cs;
     SPIClass& _spi;
 
-    const uint8_t *_localMac;
+    const uint8_t* _localMac;
 
     /* readFrame*() state */
     uint16_t _next, _len;
diff --git a/libraries/lwIP_w5100/src/W5100lwIP.h b/libraries/lwIP_w5100/src/W5100lwIP.h
index c8f549529d..593625a8d5 100644
--- a/libraries/lwIP_w5100/src/W5100lwIP.h
+++ b/libraries/lwIP_w5100/src/W5100lwIP.h
@@ -7,4 +7,4 @@
 
 using Wiznet5100lwIP = LwipIntfDev<Wiznet5100>;
 
-#endif // _W5500LWIP_H
+#endif  // _W5500LWIP_H
diff --git a/libraries/lwIP_w5100/src/utility/w5100.cpp b/libraries/lwIP_w5100/src/utility/w5100.cpp
index 6377aa5b63..661f2550c3 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.cpp
+++ b/libraries/lwIP_w5100/src/utility/w5100.cpp
@@ -32,9 +32,8 @@
 
 // original sources: https://github.com/njh/W5100MacRaw
 
-#include <SPI.h>
 #include "w5100.h"
-
+#include <SPI.h>
 
 uint8_t Wiznet5100::wizchip_read(uint16_t address)
 {
@@ -42,8 +41,8 @@ uint8_t Wiznet5100::wizchip_read(uint16_t address)
 
     wizchip_cs_select();
     _spi.transfer(0x0F);
-    _spi.transfer((address & 0xFF00) >>  8);
-    _spi.transfer((address & 0x00FF) >>  0);
+    _spi.transfer((address & 0xFF00) >> 8);
+    _spi.transfer((address & 0x00FF) >> 0);
     ret = _spi.transfer(0);
     wizchip_cs_deselect();
 
@@ -55,7 +54,6 @@ uint16_t Wiznet5100::wizchip_read_word(uint16_t address)
     return ((uint16_t)wizchip_read(address) << 8) + wizchip_read(address + 1);
 }
 
-
 void Wiznet5100::wizchip_read_buf(uint16_t address, uint8_t* pBuf, uint16_t len)
 {
     for (uint16_t i = 0; i < len; i++)
@@ -68,16 +66,16 @@ void Wiznet5100::wizchip_write(uint16_t address, uint8_t wb)
 {
     wizchip_cs_select();
     _spi.transfer(0xF0);
-    _spi.transfer((address & 0xFF00) >>  8);
-    _spi.transfer((address & 0x00FF) >>  0);
-    _spi.transfer(wb);    // Data write (write 1byte data)
+    _spi.transfer((address & 0xFF00) >> 8);
+    _spi.transfer((address & 0x00FF) >> 0);
+    _spi.transfer(wb);  // Data write (write 1byte data)
     wizchip_cs_deselect();
 }
 
 void Wiznet5100::wizchip_write_word(uint16_t address, uint16_t word)
 {
     wizchip_write(address, (uint8_t)(word >> 8));
-    wizchip_write(address + 1, (uint8_t) word);
+    wizchip_write(address + 1, (uint8_t)word);
 }
 
 void Wiznet5100::wizchip_write_buf(uint16_t address, const uint8_t* pBuf, uint16_t len)
@@ -94,7 +92,8 @@ void Wiznet5100::setSn_CR(uint8_t cr)
     wizchip_write(Sn_CR, cr);
 
     // Now wait for the command to complete
-    while (wizchip_read(Sn_CR));
+    while (wizchip_read(Sn_CR))
+        ;
 }
 
 uint16_t Wiznet5100::getSn_TX_FSR()
@@ -111,7 +110,6 @@ uint16_t Wiznet5100::getSn_TX_FSR()
     return val;
 }
 
-
 uint16_t Wiznet5100::getSn_RX_RSR()
 {
     uint16_t val = 0, val1 = 0;
@@ -126,7 +124,7 @@ uint16_t Wiznet5100::getSn_RX_RSR()
     return val;
 }
 
-void Wiznet5100::wizchip_send_data(const uint8_t *wizdata, uint16_t len)
+void Wiznet5100::wizchip_send_data(const uint8_t* wizdata, uint16_t len)
 {
     uint16_t ptr;
     uint16_t size;
@@ -157,7 +155,7 @@ void Wiznet5100::wizchip_send_data(const uint8_t *wizdata, uint16_t len)
     setSn_TX_WR(ptr);
 }
 
-void Wiznet5100::wizchip_recv_data(uint8_t *wizdata, uint16_t len)
+void Wiznet5100::wizchip_recv_data(uint8_t* wizdata, uint16_t len)
 {
     uint16_t ptr;
     uint16_t size;
@@ -169,7 +167,6 @@ void Wiznet5100::wizchip_recv_data(uint8_t *wizdata, uint16_t len)
     src_mask = ptr & RxBufferMask;
     src_ptr = RxBufferAddress + src_mask;
 
-
     if ((src_mask + len) > RxBufferLength)
     {
         size = RxBufferLength - src_mask;
@@ -201,19 +198,18 @@ void Wiznet5100::wizchip_recv_ignore(uint16_t len)
 void Wiznet5100::wizchip_sw_reset()
 {
     setMR(MR_RST);
-    getMR(); // for delay
+    getMR();  // for delay
 
     setSHAR(_mac_address);
 }
 
-
-Wiznet5100::Wiznet5100(int8_t cs, SPIClass& spi, int8_t intr):
-    _spi(spi), _cs(cs)
+Wiznet5100::Wiznet5100(int8_t cs, SPIClass& spi, int8_t intr)
+    : _spi(spi), _cs(cs)
 {
     (void)intr;
 }
 
-boolean Wiznet5100::begin(const uint8_t *mac_address)
+boolean Wiznet5100::begin(const uint8_t* mac_address)
 {
     memcpy(_mac_address, mac_address, 6);
 
@@ -257,10 +253,11 @@ void Wiznet5100::end()
     setSn_IR(0xFF);
 
     // Wait for socket to change to closed
-    while (getSn_SR() != SOCK_CLOSED);
+    while (getSn_SR() != SOCK_CLOSED)
+        ;
 }
 
-uint16_t Wiznet5100::readFrame(uint8_t *buffer, uint16_t bufsize)
+uint16_t Wiznet5100::readFrame(uint8_t* buffer, uint16_t bufsize)
 {
     uint16_t data_len = readFrameSize();
 
@@ -307,7 +304,7 @@ void Wiznet5100::discardFrame(uint16_t framesize)
     setSn_CR(Sn_CR_RECV);
 }
 
-uint16_t Wiznet5100::readFrameData(uint8_t *buffer, uint16_t framesize)
+uint16_t Wiznet5100::readFrameData(uint8_t* buffer, uint16_t framesize)
 {
     wizchip_recv_data(buffer, framesize);
     setSn_CR(Sn_CR_RECV);
@@ -329,7 +326,7 @@ uint16_t Wiznet5100::readFrameData(uint8_t *buffer, uint16_t framesize)
 #endif
 }
 
-uint16_t Wiznet5100::sendFrame(const uint8_t *buf, uint16_t len)
+uint16_t Wiznet5100::sendFrame(const uint8_t* buf, uint16_t len)
 {
     // Wait for space in the transmit buffer
     while (1)
diff --git a/libraries/lwIP_w5100/src/utility/w5100.h b/libraries/lwIP_w5100/src/utility/w5100.h
index 43b9f0b9f3..291d57362a 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.h
+++ b/libraries/lwIP_w5100/src/utility/w5100.h
@@ -32,18 +32,16 @@
 
 // original sources: https://github.com/njh/W5100MacRaw
 
-#ifndef	W5100_H
-#define	W5100_H
+#ifndef W5100_H
+#define W5100_H
 
-#include <stdint.h>
 #include <Arduino.h>
 #include <SPI.h>
-
+#include <stdint.h>
 
 class Wiznet5100
 {
-
-public:
+   public:
     /**
         Constructor that uses the default hardware SPI pins
         @param cs the Arduino Chip Select / Slave Select pin (default 10)
@@ -57,7 +55,7 @@ class Wiznet5100
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean begin(const uint8_t *address);
+    boolean begin(const uint8_t* address);
 
     /**
         Shut down the Ethernet controlled
@@ -70,7 +68,7 @@ class Wiznet5100
         @param datalen the length of the data in the packet
         @return the number of bytes transmitted
     */
-    uint16_t sendFrame(const uint8_t *data, uint16_t datalen);
+    uint16_t sendFrame(const uint8_t* data, uint16_t datalen);
 
     /**
         Read an Ethernet frame
@@ -79,10 +77,9 @@ class Wiznet5100
         @return the length of the received packet
                or 0 if no packet was received
     */
-    uint16_t readFrame(uint8_t *buffer, uint16_t bufsize);
-
-protected:
+    uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
 
+   protected:
     static constexpr bool interruptIsPossible()
     {
         return false;
@@ -110,20 +107,18 @@ class Wiznet5100
         @return the length of the received frame
                or 0 if a problem occurred
     */
-    uint16_t readFrameData(uint8_t *frame, uint16_t framesize);
+    uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
 
-
-private:
-    static const uint16_t TxBufferAddress = 0x4000;  /* Internal Tx buffer address of the iinchip */
-    static const uint16_t RxBufferAddress = 0x6000;  /* Internal Rx buffer address of the iinchip */
-    static const uint8_t TxBufferSize = 0x3; /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
-    static const uint8_t RxBufferSize = 0x3; /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
+   private:
+    static const uint16_t TxBufferAddress = 0x4000;                   /* Internal Tx buffer address of the iinchip */
+    static const uint16_t RxBufferAddress = 0x6000;                   /* Internal Rx buffer address of the iinchip */
+    static const uint8_t TxBufferSize = 0x3;                          /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
+    static const uint8_t RxBufferSize = 0x3;                          /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
     static const uint16_t TxBufferLength = (1 << TxBufferSize) << 10; /* Length of Tx buffer in bytes */
     static const uint16_t RxBufferLength = (1 << RxBufferSize) << 10; /* Length of Rx buffer in bytes */
     static const uint16_t TxBufferMask = TxBufferLength - 1;
     static const uint16_t RxBufferMask = RxBufferLength - 1;
 
-
     SPIClass& _spi;
     int8_t _cs;
     uint8_t _mac_address[6];
@@ -194,7 +189,6 @@ class Wiznet5100
     */
     void wizchip_write_buf(uint16_t address, const uint8_t* pBuf, uint16_t len);
 
-
     /**
         Reset WIZCHIP by softly.
     */
@@ -212,7 +206,7 @@ class Wiznet5100
         @param len Data length
         @sa wizchip_recv_data()
     */
-    void wizchip_send_data(const uint8_t *wizdata, uint16_t len);
+    void wizchip_send_data(const uint8_t* wizdata, uint16_t len);
 
     /**
         It copies data to your buffer from internal RX memory
@@ -226,7 +220,7 @@ class Wiznet5100
         @param len Data length
         @sa wizchip_send_data()
     */
-    void wizchip_recv_data(uint8_t *wizdata, uint16_t len);
+    void wizchip_recv_data(uint8_t* wizdata, uint16_t len);
 
     /**
         It discard the received data in RX memory.
@@ -247,77 +241,76 @@ class Wiznet5100
     */
     uint16_t getSn_RX_RSR();
 
-
     /** Common registers */
     enum
     {
-        MR = 0x0000,        ///< Mode Register address (R/W)
-        GAR = 0x0001,       ///< Gateway IP Register address (R/W)
-        SUBR = 0x0005,      ///< Subnet mask Register address (R/W)
-        SHAR = 0x0009,      ///< Source MAC Register address (R/W)
-        SIPR = 0x000F,      ///< Source IP Register address (R/W)
-        IR = 0x0015,        ///< Interrupt Register (R/W)
-        IMR = 0x0016,       ///< Socket Interrupt Mask Register (R/W)
-        RTR = 0x0017,       ///< Timeout register address (1 is 100us) (R/W)
-        RCR = 0x0019,       ///< Retry count register (R/W)
-        RMSR = 0x001A,      ///< Receive Memory Size
-        TMSR = 0x001B,      ///< Transmit Memory Size
+        MR = 0x0000,    ///< Mode Register address (R/W)
+        GAR = 0x0001,   ///< Gateway IP Register address (R/W)
+        SUBR = 0x0005,  ///< Subnet mask Register address (R/W)
+        SHAR = 0x0009,  ///< Source MAC Register address (R/W)
+        SIPR = 0x000F,  ///< Source IP Register address (R/W)
+        IR = 0x0015,    ///< Interrupt Register (R/W)
+        IMR = 0x0016,   ///< Socket Interrupt Mask Register (R/W)
+        RTR = 0x0017,   ///< Timeout register address (1 is 100us) (R/W)
+        RCR = 0x0019,   ///< Retry count register (R/W)
+        RMSR = 0x001A,  ///< Receive Memory Size
+        TMSR = 0x001B,  ///< Transmit Memory Size
     };
 
     /** Socket registers */
     enum
     {
-        Sn_MR = 0x0400,     ///< Socket Mode register(R/W)
-        Sn_CR = 0x0401,     ///< Socket command register (R/W)
-        Sn_IR = 0x0402,     ///< Socket interrupt register (R)
-        Sn_SR = 0x0403,     ///< Socket status register (R)
-        Sn_PORT = 0x0404,   ///< Source port register (R/W)
-        Sn_DHAR = 0x0406,   ///< Peer MAC register address (R/W)
-        Sn_DIPR = 0x040C,   ///< Peer IP register address (R/W)
-        Sn_DPORT = 0x0410,  ///< Peer port register address (R/W)
-        Sn_MSSR = 0x0412,   ///< Maximum Segment Size(Sn_MSSR0) register address (R/W)
-        Sn_PROTO = 0x0414,  ///< IP Protocol(PROTO) Register (R/W)
-        Sn_TOS = 0x0415,    ///< IP Type of Service(TOS) Register (R/W)
-        Sn_TTL = 0x0416,    ///< IP Time to live(TTL) Register (R/W)
-        Sn_TX_FSR = 0x0420, ///< Transmit free memory size register (R)
-        Sn_TX_RD = 0x0422,  ///< Transmit memory read pointer register address (R)
-        Sn_TX_WR = 0x0424,  ///< Transmit memory write pointer register address (R/W)
-        Sn_RX_RSR = 0x0426, ///< Received data size register (R)
-        Sn_RX_RD = 0x0428,  ///< Read point of Receive memory (R/W)
-        Sn_RX_WR = 0x042A,  ///< Write point of Receive memory (R)
+        Sn_MR = 0x0400,      ///< Socket Mode register(R/W)
+        Sn_CR = 0x0401,      ///< Socket command register (R/W)
+        Sn_IR = 0x0402,      ///< Socket interrupt register (R)
+        Sn_SR = 0x0403,      ///< Socket status register (R)
+        Sn_PORT = 0x0404,    ///< Source port register (R/W)
+        Sn_DHAR = 0x0406,    ///< Peer MAC register address (R/W)
+        Sn_DIPR = 0x040C,    ///< Peer IP register address (R/W)
+        Sn_DPORT = 0x0410,   ///< Peer port register address (R/W)
+        Sn_MSSR = 0x0412,    ///< Maximum Segment Size(Sn_MSSR0) register address (R/W)
+        Sn_PROTO = 0x0414,   ///< IP Protocol(PROTO) Register (R/W)
+        Sn_TOS = 0x0415,     ///< IP Type of Service(TOS) Register (R/W)
+        Sn_TTL = 0x0416,     ///< IP Time to live(TTL) Register (R/W)
+        Sn_TX_FSR = 0x0420,  ///< Transmit free memory size register (R)
+        Sn_TX_RD = 0x0422,   ///< Transmit memory read pointer register address (R)
+        Sn_TX_WR = 0x0424,   ///< Transmit memory write pointer register address (R/W)
+        Sn_RX_RSR = 0x0426,  ///< Received data size register (R)
+        Sn_RX_RD = 0x0428,   ///< Read point of Receive memory (R/W)
+        Sn_RX_WR = 0x042A,   ///< Write point of Receive memory (R)
     };
 
     /** Mode register values */
     enum
     {
-        MR_RST = 0x80,    ///< Reset
-        MR_PB = 0x10,     ///< Ping block
-        MR_AI = 0x02,     ///< Address Auto-Increment in Indirect Bus Interface
-        MR_IND = 0x01,    ///< Indirect Bus Interface mode
+        MR_RST = 0x80,  ///< Reset
+        MR_PB = 0x10,   ///< Ping block
+        MR_AI = 0x02,   ///< Address Auto-Increment in Indirect Bus Interface
+        MR_IND = 0x01,  ///< Indirect Bus Interface mode
     };
 
     /** Socket Mode Register values @ref Sn_MR */
     enum
     {
-        Sn_MR_CLOSE = 0x00,  ///< Unused socket
-        Sn_MR_TCP = 0x01,    ///< TCP
-        Sn_MR_UDP = 0x02,    ///< UDP
-        Sn_MR_IPRAW = 0x03,  ///< IP LAYER RAW SOCK
-        Sn_MR_MACRAW = 0x04, ///< MAC LAYER RAW SOCK
-        Sn_MR_ND = 0x20,     ///< No Delayed Ack(TCP) flag
-        Sn_MR_MF = 0x40,     ///< Use MAC filter
-        Sn_MR_MULTI = 0x80,  ///< support multicating
+        Sn_MR_CLOSE = 0x00,   ///< Unused socket
+        Sn_MR_TCP = 0x01,     ///< TCP
+        Sn_MR_UDP = 0x02,     ///< UDP
+        Sn_MR_IPRAW = 0x03,   ///< IP LAYER RAW SOCK
+        Sn_MR_MACRAW = 0x04,  ///< MAC LAYER RAW SOCK
+        Sn_MR_ND = 0x20,      ///< No Delayed Ack(TCP) flag
+        Sn_MR_MF = 0x40,      ///< Use MAC filter
+        Sn_MR_MULTI = 0x80,   ///< support multicating
     };
 
     /** Socket Command Register values */
     enum
     {
-        Sn_CR_OPEN = 0x01,      ///< Initialise or open socket
-        Sn_CR_CLOSE = 0x10,     ///< Close socket
-        Sn_CR_SEND = 0x20,      ///< Update TX buffer pointer and send data
-        Sn_CR_SEND_MAC = 0x21,  ///< Send data with MAC address, so without ARP process
-        Sn_CR_SEND_KEEP = 0x22, ///< Send keep alive message
-        Sn_CR_RECV = 0x40,      ///< Update RX buffer pointer and receive data
+        Sn_CR_OPEN = 0x01,       ///< Initialise or open socket
+        Sn_CR_CLOSE = 0x10,      ///< Close socket
+        Sn_CR_SEND = 0x20,       ///< Update TX buffer pointer and send data
+        Sn_CR_SEND_MAC = 0x21,   ///< Send data with MAC address, so without ARP process
+        Sn_CR_SEND_KEEP = 0x22,  ///< Send keep alive message
+        Sn_CR_RECV = 0x40,       ///< Update RX buffer pointer and receive data
     };
 
     /** Socket Interrupt register values */
@@ -333,20 +326,20 @@ class Wiznet5100
     /** Socket Status Register values */
     enum
     {
-        SOCK_CLOSED = 0x00,      ///< Closed
-        SOCK_INIT = 0x13,        ///< Initiate state
-        SOCK_LISTEN = 0x14,      ///< Listen state
-        SOCK_SYNSENT = 0x15,     ///< Connection state
-        SOCK_SYNRECV = 0x16,     ///< Connection state
-        SOCK_ESTABLISHED = 0x17, ///< Success to connect
-        SOCK_FIN_WAIT = 0x18,    ///< Closing state
-        SOCK_CLOSING = 0x1A,     ///< Closing state
-        SOCK_TIME_WAIT = 0x1B,   ///< Closing state
-        SOCK_CLOSE_WAIT = 0x1C,  ///< Closing state
-        SOCK_LAST_ACK = 0x1D,    ///< Closing state
-        SOCK_UDP = 0x22,         ///< UDP socket
-        SOCK_IPRAW = 0x32,       ///< IP raw mode socket
-        SOCK_MACRAW = 0x42,      ///< MAC raw mode socket
+        SOCK_CLOSED = 0x00,       ///< Closed
+        SOCK_INIT = 0x13,         ///< Initiate state
+        SOCK_LISTEN = 0x14,       ///< Listen state
+        SOCK_SYNSENT = 0x15,      ///< Connection state
+        SOCK_SYNRECV = 0x16,      ///< Connection state
+        SOCK_ESTABLISHED = 0x17,  ///< Success to connect
+        SOCK_FIN_WAIT = 0x18,     ///< Closing state
+        SOCK_CLOSING = 0x1A,      ///< Closing state
+        SOCK_TIME_WAIT = 0x1B,    ///< Closing state
+        SOCK_CLOSE_WAIT = 0x1C,   ///< Closing state
+        SOCK_LAST_ACK = 0x1D,     ///< Closing state
+        SOCK_UDP = 0x22,          ///< UDP socket
+        SOCK_IPRAW = 0x32,        ///< IP raw mode socket
+        SOCK_MACRAW = 0x42,       ///< MAC raw mode socket
     };
 
     /**
@@ -496,4 +489,4 @@ class Wiznet5100
     }
 };
 
-#endif // W5100_H
+#endif  // W5100_H
diff --git a/libraries/lwIP_w5500/src/W5500lwIP.h b/libraries/lwIP_w5500/src/W5500lwIP.h
index 1e8f201331..8b708cbf90 100644
--- a/libraries/lwIP_w5500/src/W5500lwIP.h
+++ b/libraries/lwIP_w5500/src/W5500lwIP.h
@@ -7,4 +7,4 @@
 
 using Wiznet5500lwIP = LwipIntfDev<Wiznet5500>;
 
-#endif // _W5500LWIP_H
+#endif  // _W5500LWIP_H
diff --git a/libraries/lwIP_w5500/src/utility/w5500.cpp b/libraries/lwIP_w5500/src/utility/w5500.cpp
index b3c3ce0162..89bc6a9be0 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.cpp
+++ b/libraries/lwIP_w5500/src/utility/w5500.cpp
@@ -32,9 +32,8 @@
 
 // original sources: https://github.com/njh/W5500MacRaw
 
-#include <SPI.h>
 #include "w5500.h"
-
+#include <SPI.h>
 
 uint8_t Wiznet5500::wizchip_read(uint8_t block, uint16_t address)
 {
@@ -95,7 +94,7 @@ void Wiznet5500::wizchip_write(uint8_t block, uint16_t address, uint8_t wb)
 void Wiznet5500::wizchip_write_word(uint8_t block, uint16_t address, uint16_t word)
 {
     wizchip_write(block, address, (uint8_t)(word >> 8));
-    wizchip_write(block, address + 1, (uint8_t) word);
+    wizchip_write(block, address + 1, (uint8_t)word);
 }
 
 void Wiznet5500::wizchip_write_buf(uint8_t block, uint16_t address, const uint8_t* pBuf, uint16_t len)
@@ -123,7 +122,8 @@ void Wiznet5500::setSn_CR(uint8_t cr)
     wizchip_write(BlockSelectSReg, Sn_CR, cr);
 
     // Now wait for the command to complete
-    while (wizchip_read(BlockSelectSReg, Sn_CR));
+    while (wizchip_read(BlockSelectSReg, Sn_CR))
+        ;
 }
 
 uint16_t Wiznet5500::getSn_TX_FSR()
@@ -140,7 +140,6 @@ uint16_t Wiznet5500::getSn_TX_FSR()
     return val;
 }
 
-
 uint16_t Wiznet5500::getSn_RX_RSR()
 {
     uint16_t val = 0, val1 = 0;
@@ -155,7 +154,7 @@ uint16_t Wiznet5500::getSn_RX_RSR()
     return val;
 }
 
-void Wiznet5500::wizchip_send_data(const uint8_t *wizdata, uint16_t len)
+void Wiznet5500::wizchip_send_data(const uint8_t* wizdata, uint16_t len)
 {
     uint16_t ptr = 0;
 
@@ -171,7 +170,7 @@ void Wiznet5500::wizchip_send_data(const uint8_t *wizdata, uint16_t len)
     setSn_TX_WR(ptr);
 }
 
-void Wiznet5500::wizchip_recv_data(uint8_t *wizdata, uint16_t len)
+void Wiznet5500::wizchip_recv_data(uint8_t* wizdata, uint16_t len)
 {
     uint16_t ptr;
 
@@ -198,7 +197,7 @@ void Wiznet5500::wizchip_recv_ignore(uint16_t len)
 void Wiznet5500::wizchip_sw_reset()
 {
     setMR(MR_RST);
-    getMR(); // for delay
+    getMR();  // for delay
 
     setSHAR(_mac_address);
 }
@@ -278,14 +277,13 @@ int8_t Wiznet5500::wizphy_setphypmode(uint8_t pmode)
     return -1;
 }
 
-
-Wiznet5500::Wiznet5500(int8_t cs, SPIClass& spi, int8_t intr):
-    _spi(spi), _cs(cs)
+Wiznet5500::Wiznet5500(int8_t cs, SPIClass& spi, int8_t intr)
+    : _spi(spi), _cs(cs)
 {
     (void)intr;
 }
 
-boolean Wiznet5500::begin(const uint8_t *mac_address)
+boolean Wiznet5500::begin(const uint8_t* mac_address)
 {
     memcpy(_mac_address, mac_address, 6);
 
@@ -329,10 +327,11 @@ void Wiznet5500::end()
     setSn_IR(0xFF);
 
     // Wait for socket to change to closed
-    while (getSn_SR() != SOCK_CLOSED);
+    while (getSn_SR() != SOCK_CLOSED)
+        ;
 }
 
-uint16_t Wiznet5500::readFrame(uint8_t *buffer, uint16_t bufsize)
+uint16_t Wiznet5500::readFrame(uint8_t* buffer, uint16_t bufsize)
 {
     uint16_t data_len = readFrameSize();
 
@@ -379,7 +378,7 @@ void Wiznet5500::discardFrame(uint16_t framesize)
     setSn_CR(Sn_CR_RECV);
 }
 
-uint16_t Wiznet5500::readFrameData(uint8_t *buffer, uint16_t framesize)
+uint16_t Wiznet5500::readFrameData(uint8_t* buffer, uint16_t framesize)
 {
     wizchip_recv_data(buffer, framesize);
     setSn_CR(Sn_CR_RECV);
@@ -402,7 +401,7 @@ uint16_t Wiznet5500::readFrameData(uint8_t *buffer, uint16_t framesize)
 #endif
 }
 
-uint16_t Wiznet5500::sendFrame(const uint8_t *buf, uint16_t len)
+uint16_t Wiznet5500::sendFrame(const uint8_t* buf, uint16_t len)
 {
     // Wait for space in the transmit buffer
     while (1)
diff --git a/libraries/lwIP_w5500/src/utility/w5500.h b/libraries/lwIP_w5500/src/utility/w5500.h
index 85b253a4bf..23d3159395 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.h
+++ b/libraries/lwIP_w5500/src/utility/w5500.h
@@ -35,23 +35,19 @@
 #ifndef W5500_H
 #define W5500_H
 
-#include <stdint.h>
 #include <Arduino.h>
 #include <SPI.h>
-
-
+#include <stdint.h>
 
 class Wiznet5500
 {
-
-public:
+   public:
     /**
         Constructor that uses the default hardware SPI pins
         @param cs the Arduino Chip Select / Slave Select pin (default 10)
     */
     Wiznet5500(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1);
 
-
     /**
         Initialise the Ethernet controller
         Must be called before sending or receiving Ethernet frames
@@ -59,7 +55,7 @@ class Wiznet5500
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean begin(const uint8_t *address);
+    boolean begin(const uint8_t* address);
 
     /**
         Shut down the Ethernet controlled
@@ -72,7 +68,7 @@ class Wiznet5500
         @param datalen the length of the data in the packet
         @return the number of bytes transmitted
     */
-    uint16_t sendFrame(const uint8_t *data, uint16_t datalen);
+    uint16_t sendFrame(const uint8_t* data, uint16_t datalen);
 
     /**
         Read an Ethernet frame
@@ -81,10 +77,9 @@ class Wiznet5500
         @return the length of the received packet
                or 0 if no packet was received
     */
-    uint16_t readFrame(uint8_t *buffer, uint16_t bufsize);
-
-protected:
+    uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
 
+   protected:
     static constexpr bool interruptIsPossible()
     {
         return false;
@@ -112,11 +107,9 @@ class Wiznet5500
         @return the length of the received frame
                or 0 if a problem occurred
     */
-    uint16_t readFrameData(uint8_t *frame, uint16_t framesize);
-
-
-private:
+    uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
 
+   private:
     //< SPI interface Read operation in Control Phase
     static const uint8_t AccessModeRead = (0x00 << 2);
 
@@ -135,8 +128,6 @@ class Wiznet5500
     //< Socket 0 Rx buffer address block
     static const uint8_t BlockSelectRxBuf = (0x03 << 3);
 
-
-
     SPIClass& _spi;
     int8_t _cs;
     uint8_t _mac_address[6];
@@ -181,7 +172,6 @@ class Wiznet5500
         _spi.transfer(wb);
     }
 
-
     /**
         Read a 1 byte value from a register.
         @param address Register address
@@ -240,7 +230,6 @@ class Wiznet5500
     */
     uint16_t getSn_RX_RSR();
 
-
     /**
         Reset WIZCHIP by softly.
     */
@@ -279,7 +268,7 @@ class Wiznet5500
         @param len Data length
         @sa wizchip_recv_data()
     */
-    void wizchip_send_data(const uint8_t *wizdata, uint16_t len);
+    void wizchip_send_data(const uint8_t* wizdata, uint16_t len);
 
     /**
         It copies data to your buffer from internal RX memory
@@ -293,7 +282,7 @@ class Wiznet5500
         @param len Data length
         @sa wizchip_send_data()
     */
-    void wizchip_recv_data(uint8_t *wizdata, uint16_t len);
+    void wizchip_recv_data(uint8_t* wizdata, uint16_t len);
 
     /**
         It discard the received data in RX memory.
@@ -302,8 +291,6 @@ class Wiznet5500
     */
     void wizchip_recv_ignore(uint16_t len);
 
-
-
     /** Common registers */
     enum
     {
@@ -371,40 +358,40 @@ class Wiznet5500
     /* Interrupt Mask Register values */
     enum
     {
-        IM_IR7 = 0x80,   ///< IP Conflict Interrupt Mask
-        IM_IR6 = 0x40,   ///< Destination unreachable Interrupt Mask
-        IM_IR5 = 0x20,   ///< PPPoE Close Interrupt Mask
-        IM_IR4 = 0x10,   ///< Magic Packet Interrupt Mask
+        IM_IR7 = 0x80,  ///< IP Conflict Interrupt Mask
+        IM_IR6 = 0x40,  ///< Destination unreachable Interrupt Mask
+        IM_IR5 = 0x20,  ///< PPPoE Close Interrupt Mask
+        IM_IR4 = 0x10,  ///< Magic Packet Interrupt Mask
     };
 
     /** Socket Mode Register values @ref Sn_MR */
     enum
     {
-        Sn_MR_CLOSE = 0x00,  ///< Unused socket
-        Sn_MR_TCP = 0x01,    ///< TCP
-        Sn_MR_UDP = 0x02,    ///< UDP
-        Sn_MR_MACRAW = 0x04, ///< MAC LAYER RAW SOCK
-        Sn_MR_UCASTB = 0x10, ///< Unicast Block in UDP Multicasting
-        Sn_MR_ND = 0x20,     ///< No Delayed Ack(TCP), Multicast flag
-        Sn_MR_BCASTB = 0x40, ///< Broadcast block in UDP Multicasting
-        Sn_MR_MULTI = 0x80,  ///< Support UDP Multicasting
-        Sn_MR_MIP6B = 0x10,  ///< IPv6 packet Blocking in @ref Sn_MR_MACRAW mode
-        Sn_MR_MMB = 0x20,    ///< Multicast Blocking in @ref Sn_MR_MACRAW mode
-        Sn_MR_MFEN = 0x80,   ///< MAC filter enable in @ref Sn_MR_MACRAW mode
+        Sn_MR_CLOSE = 0x00,   ///< Unused socket
+        Sn_MR_TCP = 0x01,     ///< TCP
+        Sn_MR_UDP = 0x02,     ///< UDP
+        Sn_MR_MACRAW = 0x04,  ///< MAC LAYER RAW SOCK
+        Sn_MR_UCASTB = 0x10,  ///< Unicast Block in UDP Multicasting
+        Sn_MR_ND = 0x20,      ///< No Delayed Ack(TCP), Multicast flag
+        Sn_MR_BCASTB = 0x40,  ///< Broadcast block in UDP Multicasting
+        Sn_MR_MULTI = 0x80,   ///< Support UDP Multicasting
+        Sn_MR_MIP6B = 0x10,   ///< IPv6 packet Blocking in @ref Sn_MR_MACRAW mode
+        Sn_MR_MMB = 0x20,     ///< Multicast Blocking in @ref Sn_MR_MACRAW mode
+        Sn_MR_MFEN = 0x80,    ///< MAC filter enable in @ref Sn_MR_MACRAW mode
     };
 
     /** Socket Command Register values */
     enum
     {
-        Sn_CR_OPEN = 0x01,      ///< Initialise or open socket
-        Sn_CR_LISTEN = 0x02,    ///< Wait connection request in TCP mode (Server mode)
-        Sn_CR_CONNECT = 0x04,   ///< Send connection request in TCP mode (Client mode)
-        Sn_CR_DISCON = 0x08,    ///< Send closing request in TCP mode
-        Sn_CR_CLOSE = 0x10,     ///< Close socket
-        Sn_CR_SEND = 0x20,      ///< Update TX buffer pointer and send data
-        Sn_CR_SEND_MAC = 0x21,  ///< Send data with MAC address, so without ARP process
-        Sn_CR_SEND_KEEP = 0x22, ///< Send keep alive message
-        Sn_CR_RECV = 0x40,      ///< Update RX buffer pointer and receive data
+        Sn_CR_OPEN = 0x01,       ///< Initialise or open socket
+        Sn_CR_LISTEN = 0x02,     ///< Wait connection request in TCP mode (Server mode)
+        Sn_CR_CONNECT = 0x04,    ///< Send connection request in TCP mode (Client mode)
+        Sn_CR_DISCON = 0x08,     ///< Send closing request in TCP mode
+        Sn_CR_CLOSE = 0x10,      ///< Close socket
+        Sn_CR_SEND = 0x20,       ///< Update TX buffer pointer and send data
+        Sn_CR_SEND_MAC = 0x21,   ///< Send data with MAC address, so without ARP process
+        Sn_CR_SEND_KEEP = 0x22,  ///< Send keep alive message
+        Sn_CR_RECV = 0x40,       ///< Update RX buffer pointer and receive data
     };
 
     /** Socket Interrupt register values */
@@ -420,27 +407,26 @@ class Wiznet5500
     /** Socket Status Register values */
     enum
     {
-        SOCK_CLOSED = 0x00,      ///< Closed
-        SOCK_INIT = 0x13,        ///< Initiate state
-        SOCK_LISTEN = 0x14,      ///< Listen state
-        SOCK_SYNSENT = 0x15,     ///< Connection state
-        SOCK_SYNRECV = 0x16,     ///< Connection state
-        SOCK_ESTABLISHED = 0x17, ///< Success to connect
-        SOCK_FIN_WAIT = 0x18,    ///< Closing state
-        SOCK_CLOSING = 0x1A,     ///< Closing state
-        SOCK_TIME_WAIT = 0x1B,   ///< Closing state
-        SOCK_CLOSE_WAIT = 0x1C,  ///< Closing state
-        SOCK_LAST_ACK = 0x1D,    ///< Closing state
-        SOCK_UDP = 0x22,         ///< UDP socket
-        SOCK_MACRAW = 0x42,      ///< MAC raw mode socket
+        SOCK_CLOSED = 0x00,       ///< Closed
+        SOCK_INIT = 0x13,         ///< Initiate state
+        SOCK_LISTEN = 0x14,       ///< Listen state
+        SOCK_SYNSENT = 0x15,      ///< Connection state
+        SOCK_SYNRECV = 0x16,      ///< Connection state
+        SOCK_ESTABLISHED = 0x17,  ///< Success to connect
+        SOCK_FIN_WAIT = 0x18,     ///< Closing state
+        SOCK_CLOSING = 0x1A,      ///< Closing state
+        SOCK_TIME_WAIT = 0x1B,    ///< Closing state
+        SOCK_CLOSE_WAIT = 0x1C,   ///< Closing state
+        SOCK_LAST_ACK = 0x1D,     ///< Closing state
+        SOCK_UDP = 0x22,          ///< UDP socket
+        SOCK_MACRAW = 0x42,       ///< MAC raw mode socket
     };
 
-
     /* PHYCFGR register value */
     enum
     {
-        PHYCFGR_RST = ~(1 << 7), //< For PHY reset, must operate AND mask.
-        PHYCFGR_OPMD = (1 << 6), // Configre PHY with OPMDC value
+        PHYCFGR_RST = ~(1 << 7),  //< For PHY reset, must operate AND mask.
+        PHYCFGR_OPMD = (1 << 6),  // Configre PHY with OPMDC value
         PHYCFGR_OPMDC_ALLA = (7 << 3),
         PHYCFGR_OPMDC_PDOWN = (6 << 3),
         PHYCFGR_OPMDC_NA = (5 << 3),
@@ -469,7 +455,6 @@ class Wiznet5500
         PHY_POWER_DOWN = 1,   ///< PHY power down mode
     };
 
-
     /**
         Set Mode Register
         @param (uint8_t)mr The value to be set.
@@ -764,4 +749,4 @@ class Wiznet5500
     }
 };
 
-#endif // W5500_H
+#endif  // W5500_H
diff --git a/tests/device/libraries/BSTest/src/BSArduino.h b/tests/device/libraries/BSTest/src/BSArduino.h
index b9483244a0..f77e6d0f86 100644
--- a/tests/device/libraries/BSTest/src/BSArduino.h
+++ b/tests/device/libraries/BSTest/src/BSArduino.h
@@ -6,12 +6,13 @@ namespace bs
 {
 class ArduinoIOHelper
 {
-public:
-    ArduinoIOHelper(Stream& stream) : m_stream(stream)
+   public:
+    ArduinoIOHelper(Stream& stream)
+        : m_stream(stream)
     {
     }
 
-    size_t printf(const char *format, ...)
+    size_t printf(const char* format, ...)
     {
         va_list arg;
         va_start(arg, format);
@@ -30,7 +31,7 @@ class ArduinoIOHelper
             ets_vsnprintf(buffer, len + 1, format, arg);
             va_end(arg);
         }
-        len = m_stream.write((const uint8_t*) buffer, len);
+        len = m_stream.write((const uint8_t*)buffer, len);
         if (buffer != temp)
         {
             delete[] buffer;
@@ -65,7 +66,7 @@ class ArduinoIOHelper
         return len;
     }
 
-protected:
+   protected:
     Stream& m_stream;
 };
 
@@ -76,6 +77,6 @@ inline void fatal()
     ESP.restart();
 }
 
-} // namespace bs
+}  // namespace bs
 
-#endif //BS_ARDUINO_H
+#endif  //BS_ARDUINO_H
diff --git a/tests/device/libraries/BSTest/src/BSArgs.h b/tests/device/libraries/BSTest/src/BSArgs.h
index ba970f60bc..879085b321 100644
--- a/tests/device/libraries/BSTest/src/BSArgs.h
+++ b/tests/device/libraries/BSTest/src/BSArgs.h
@@ -7,15 +7,14 @@
 #ifndef BS_ARGS_H
 #define BS_ARGS_H
 
-#include <stdio.h>
 #include <ctype.h>
+#include <stdio.h>
 #include <string.h>
 
 namespace bs
 {
 namespace protocol
 {
-
 #define SS_FLAG_ESCAPE 0x8
 
 typedef enum
@@ -33,12 +32,13 @@ typedef enum
 } split_state_t;
 
 /* helper macro, called when done with an argument */
-#define END_ARG() do { \
-        char_out = 0;   \
-        argv[argc++] = next_arg_start;  \
-        state = SS_SPACE;   \
-    } while(0);
-
+#define END_ARG()                      \
+    do                                 \
+    {                                  \
+        char_out = 0;                  \
+        argv[argc++] = next_arg_start; \
+        state = SS_SPACE;              \
+    } while (0);
 
 /**
     @brief Split command line into arguments in place
@@ -64,18 +64,18 @@ typedef enum
     @param argv_size number of elements in argv_array (max. number of arguments will be argv_size - 1)
     @return number of arguments found (argc)
 */
-inline size_t split_args(char *line, char **argv, size_t argv_size)
+inline size_t split_args(char* line, char** argv, size_t argv_size)
 {
     const int QUOTE = '"';
     const int ESCAPE = '\\';
     const int SPACE = ' ';
     split_state_t state = SS_SPACE;
     size_t argc = 0;
-    char *next_arg_start = line;
-    char *out_ptr = line;
-    for (char *in_ptr = line; argc < argv_size - 1; ++in_ptr)
+    char* next_arg_start = line;
+    char* out_ptr = line;
+    for (char* in_ptr = line; argc < argv_size - 1; ++in_ptr)
     {
-        int char_in = (unsigned char) * in_ptr;
+        int char_in = (unsigned char)*in_ptr;
         if (char_in == 0)
         {
             break;
@@ -84,71 +84,71 @@ inline size_t split_args(char *line, char **argv, size_t argv_size)
 
         switch (state)
         {
-        case SS_SPACE:
-            if (char_in == SPACE)
-            {
-                /* skip space */
-            }
-            else if (char_in == QUOTE)
-            {
-                next_arg_start = out_ptr;
-                state = SS_QUOTED_ARG;
-            }
-            else if (char_in == ESCAPE)
-            {
-                next_arg_start = out_ptr;
-                state = SS_ARG_ESCAPED;
-            }
-            else
-            {
-                next_arg_start = out_ptr;
-                state = SS_ARG;
-                char_out = char_in;
-            }
-            break;
-
-        case SS_QUOTED_ARG:
-            if (char_in == QUOTE)
-            {
-                END_ARG();
-            }
-            else if (char_in == ESCAPE)
-            {
-                state = SS_QUOTED_ARG_ESCAPED;
-            }
-            else
-            {
-                char_out = char_in;
-            }
-            break;
-
-        case SS_ARG_ESCAPED:
-        case SS_QUOTED_ARG_ESCAPED:
-            if (char_in == ESCAPE || char_in == QUOTE || char_in == SPACE)
-            {
-                char_out = char_in;
-            }
-            else
-            {
-                /* unrecognized escape character, skip */
-            }
-            state = (split_state_t)(state & (~SS_FLAG_ESCAPE));
-            break;
-
-        case SS_ARG:
-            if (char_in == SPACE)
-            {
-                END_ARG();
-            }
-            else if (char_in == ESCAPE)
-            {
-                state = SS_ARG_ESCAPED;
-            }
-            else
-            {
-                char_out = char_in;
-            }
-            break;
+            case SS_SPACE:
+                if (char_in == SPACE)
+                {
+                    /* skip space */
+                }
+                else if (char_in == QUOTE)
+                {
+                    next_arg_start = out_ptr;
+                    state = SS_QUOTED_ARG;
+                }
+                else if (char_in == ESCAPE)
+                {
+                    next_arg_start = out_ptr;
+                    state = SS_ARG_ESCAPED;
+                }
+                else
+                {
+                    next_arg_start = out_ptr;
+                    state = SS_ARG;
+                    char_out = char_in;
+                }
+                break;
+
+            case SS_QUOTED_ARG:
+                if (char_in == QUOTE)
+                {
+                    END_ARG();
+                }
+                else if (char_in == ESCAPE)
+                {
+                    state = SS_QUOTED_ARG_ESCAPED;
+                }
+                else
+                {
+                    char_out = char_in;
+                }
+                break;
+
+            case SS_ARG_ESCAPED:
+            case SS_QUOTED_ARG_ESCAPED:
+                if (char_in == ESCAPE || char_in == QUOTE || char_in == SPACE)
+                {
+                    char_out = char_in;
+                }
+                else
+                {
+                    /* unrecognized escape character, skip */
+                }
+                state = (split_state_t)(state & (~SS_FLAG_ESCAPE));
+                break;
+
+            case SS_ARG:
+                if (char_in == SPACE)
+                {
+                    END_ARG();
+                }
+                else if (char_in == ESCAPE)
+                {
+                    state = SS_ARG_ESCAPED;
+                }
+                else
+                {
+                    char_out = char_in;
+                }
+                break;
         }
         /* need to output anything? */
         if (char_out >= 0)
@@ -170,8 +170,8 @@ inline size_t split_args(char *line, char **argv, size_t argv_size)
     return argc;
 }
 
-} // namespace bs
+}  // namespace protocol
 
-} // namespace protocol
+}  // namespace bs
 
-#endif //BS_ARGS_H
+#endif  //BS_ARGS_H
diff --git a/tests/device/libraries/BSTest/src/BSProtocol.h b/tests/device/libraries/BSTest/src/BSProtocol.h
index afb8bfb023..08400e02ce 100644
--- a/tests/device/libraries/BSTest/src/BSProtocol.h
+++ b/tests/device/libraries/BSTest/src/BSProtocol.h
@@ -11,62 +11,62 @@ namespace bs
 {
 namespace protocol
 {
-template<typename IO>
+template <typename IO>
 void output_test_start(IO& io, const char* file, size_t line, const char* name, const char* desc)
 {
     io.printf(BS_LINE_PREFIX "start file=\"%s\" line=%d name=\"%s\" desc=\"%s\"\n", file, line, name, desc);
 }
 
-template<typename IO>
+template <typename IO>
 void output_check_failure(IO& io, size_t line)
 {
     io.printf(BS_LINE_PREFIX "check_failure line=%d\n", line);
 }
 
-template<typename IO>
+template <typename IO>
 void output_test_end(IO& io, bool success, size_t checks, size_t failed_checks, size_t line = 0)
 {
     io.printf(BS_LINE_PREFIX "end line=%d result=%d checks=%d failed_checks=%d\n", line, success, checks, failed_checks);
 }
 
-template<typename IO>
+template <typename IO>
 void output_menu_begin(IO& io)
 {
     io.printf(BS_LINE_PREFIX "menu_begin\n");
 }
 
-template<typename IO>
+template <typename IO>
 void output_menu_item(IO& io, int index, const char* name, const char* desc)
 {
     io.printf(BS_LINE_PREFIX "item id=%d name=\"%s\" desc=\"%s\"\n", index, name, desc);
 }
 
-template<typename IO>
+template <typename IO>
 void output_menu_end(IO& io)
 {
     io.printf(BS_LINE_PREFIX "menu_end\n");
 }
 
-template<typename IO>
+template <typename IO>
 void output_setenv_result(IO& io, const char* key, const char* value)
 {
     io.printf(BS_LINE_PREFIX "setenv key=\"%s\" value=\"%s\"\n", key, value);
 }
 
-template<typename IO>
+template <typename IO>
 void output_getenv_result(IO& io, const char* key, const char* value)
 {
-    (void) key;
+    (void)key;
     io.printf(BS_LINE_PREFIX "getenv value=\"%s\"\n", value);
 }
 
-template<typename IO>
+template <typename IO>
 void output_pretest_result(IO& io, bool res)
 {
     io.printf(BS_LINE_PREFIX "pretest result=%d\n", res ? 1 : 0);
 }
 
-template<typename IO>
+template <typename IO>
 bool input_handle(IO& io, char* line_buf, size_t line_buf_size, int& test_num)
 {
     int cb_read = io.read_line(line_buf, line_buf_size);
@@ -89,7 +89,7 @@ bool input_handle(IO& io, char* line_buf, size_t line_buf_size, int& test_num)
         setenv(argv[1], argv[2], 1);
         output_setenv_result(io, argv[1], argv[2]);
         test_num = -1;
-        return false;   /* we didn't get the test number yet, so return false */
+        return false; /* we didn't get the test number yet, so return false */
     }
     if (strcmp(argv[0], "getenv") == 0)
     {
@@ -113,7 +113,7 @@ bool input_handle(IO& io, char* line_buf, size_t line_buf_size, int& test_num)
     }
     /* not one of the commands, try to parse as test number */
     char* endptr;
-    test_num = (int) strtol(argv[0], &endptr, 10);
+    test_num = (int)strtol(argv[0], &endptr, 10);
     if (endptr != argv[0] + strlen(argv[0]))
     {
         return false;
@@ -121,7 +121,7 @@ bool input_handle(IO& io, char* line_buf, size_t line_buf_size, int& test_num)
     return true;
 }
 
-} // ::protocol
-} // ::bs
+}  // namespace protocol
+}  // namespace bs
 
-#endif //BS_PROTOCOL_H
+#endif  //BS_PROTOCOL_H
diff --git a/tests/device/libraries/BSTest/src/BSStdio.h b/tests/device/libraries/BSTest/src/BSStdio.h
index f804f9750b..97a2c1230c 100644
--- a/tests/device/libraries/BSTest/src/BSStdio.h
+++ b/tests/device/libraries/BSTest/src/BSStdio.h
@@ -8,12 +8,12 @@ namespace bs
 {
 class StdIOHelper
 {
-public:
+   public:
     StdIOHelper()
     {
     }
 
-    size_t printf(const char *format, ...)
+    size_t printf(const char* format, ...)
     {
         va_list arg;
         va_start(arg, format);
@@ -46,6 +46,6 @@ inline void fatal()
     throw std::runtime_error("fatal error");
 }
 
-} // namespace bs
+}  // namespace bs
 
-#endif //BS_STDIO_H
+#endif  //BS_STDIO_H
diff --git a/tests/device/libraries/BSTest/src/BSTest.h b/tests/device/libraries/BSTest/src/BSTest.h
index 6de198cb0c..bc9154a5ae 100644
--- a/tests/device/libraries/BSTest/src/BSTest.h
+++ b/tests/device/libraries/BSTest/src/BSTest.h
@@ -20,11 +20,11 @@
 
 namespace bs
 {
-typedef void(*test_case_func_t)();
+typedef void (*test_case_func_t)();
 
 class TestCase
 {
-public:
+   public:
     TestCase(TestCase* prev, test_case_func_t func, const char* file, size_t line, const char* name, const char* desc)
         : m_func(func), m_file(file), m_line(line), m_name(name), m_desc(desc)
     {
@@ -64,7 +64,7 @@ class TestCase
         return (m_desc) ? m_desc : "";
     }
 
-protected:
+   protected:
     TestCase* m_next = nullptr;
     test_case_func_t m_func;
     const char* m_file;
@@ -98,12 +98,14 @@ struct Env
 
 extern Env g_env;
 
-template<typename IO>
+template <typename IO>
 class Runner
 {
     typedef Runner<IO> Tself;
-public:
-    Runner(IO& io) : m_io(io)
+
+   public:
+    Runner(IO& io)
+        : m_io(io)
     {
         g_env.m_check_pass = std::bind(&Tself::check_pass, this);
         g_env.m_check_fail = std::bind(&Tself::check_fail, this, std::placeholders::_1);
@@ -141,7 +143,7 @@ class Runner
         bs::fatal();
     }
 
-protected:
+   protected:
     bool do_menu()
     {
         protocol::output_menu_begin(m_io);
@@ -164,7 +166,8 @@ class Runner
                 return true;
             }
             TestCase* tc = g_env.m_registry.m_first;
-            for (int i = 0; i != id - 1 && tc; ++i, tc = tc->next());
+            for (int i = 0; i != id - 1 && tc; ++i, tc = tc->next())
+                ;
             if (!tc)
             {
                 bs::fatal();
@@ -178,7 +181,7 @@ class Runner
         }
     }
 
-protected:
+   protected:
     IO& m_io;
     size_t m_check_pass_count;
     size_t m_check_fail_count;
@@ -186,7 +189,7 @@ class Runner
 
 class AutoReg
 {
-public:
+   public:
     AutoReg(test_case_func_t func, const char* file, size_t line, const char* name, const char* desc = nullptr)
     {
         g_env.m_registry.add(func, file, line, name, desc);
@@ -218,22 +221,35 @@ inline void require(bool condition, size_t line)
     }
 }
 
-} // ::bs
+}  // namespace bs
 
-#define BS_NAME_LINE2( name, line ) name##line
-#define BS_NAME_LINE( name, line ) BS_NAME_LINE2( name, line )
-#define BS_UNIQUE_NAME( name ) BS_NAME_LINE( name, __LINE__ )
+#define BS_NAME_LINE2(name, line) name##line
+#define BS_NAME_LINE(name, line) BS_NAME_LINE2(name, line)
+#define BS_UNIQUE_NAME(name) BS_NAME_LINE(name, __LINE__)
 
-#define TEST_CASE( ... ) \
-    static void BS_UNIQUE_NAME( TEST_FUNC__ )(); \
-    namespace{ bs::AutoReg BS_UNIQUE_NAME( test_autoreg__ )( &BS_UNIQUE_NAME( TEST_FUNC__ ), __FILE__, __LINE__, __VA_ARGS__ ); }\
-    static void BS_UNIQUE_NAME(  TEST_FUNC__ )()
+#define TEST_CASE(...)                                                                                         \
+    static void BS_UNIQUE_NAME(TEST_FUNC__)();                                                                 \
+    namespace                                                                                                  \
+    {                                                                                                          \
+    bs::AutoReg BS_UNIQUE_NAME(test_autoreg__)(&BS_UNIQUE_NAME(TEST_FUNC__), __FILE__, __LINE__, __VA_ARGS__); \
+    }                                                                                                          \
+    static void BS_UNIQUE_NAME(TEST_FUNC__)()
 
 #define CHECK(condition) bs::check((condition), __LINE__)
 #define REQUIRE(condition) bs::require((condition), __LINE__)
 #define FAIL() bs::g_env.m_fail(__LINE__)
 
-#define BS_ENV_DECLARE() namespace bs { Env g_env; }
-#define BS_RUN(...) do { bs::IOHelper helper = bs::IOHelper(__VA_ARGS__); bs::Runner<bs::IOHelper> runner(helper); runner.run(); } while(0);
+#define BS_ENV_DECLARE() \
+    namespace bs         \
+    {                    \
+    Env g_env;           \
+    }
+#define BS_RUN(...)                                      \
+    do                                                   \
+    {                                                    \
+        bs::IOHelper helper = bs::IOHelper(__VA_ARGS__); \
+        bs::Runner<bs::IOHelper> runner(helper);         \
+        runner.run();                                    \
+    } while (0);
 
-#endif //BSTEST_H
+#endif  //BSTEST_H
diff --git a/tests/device/libraries/BSTest/test/test.cpp b/tests/device/libraries/BSTest/test/test.cpp
index 25145344fb..48da79d3bd 100644
--- a/tests/device/libraries/BSTest/test/test.cpp
+++ b/tests/device/libraries/BSTest/test/test.cpp
@@ -1,9 +1,8 @@
-#include "BSTest.h"
 #include <stdio.h>
+#include "BSTest.h"
 
 BS_ENV_DECLARE();
 
-
 int main()
 {
     while (true)
@@ -21,7 +20,6 @@ int main()
     return 1;
 }
 
-
 TEST_CASE("this test runs successfully", "[bluesmoke]")
 {
     CHECK(1 + 1 == 2);
@@ -42,16 +40,13 @@ TEST_CASE("another test which fails and crashes", "[bluesmoke][fail]")
     REQUIRE(false);
 }
 
-
 TEST_CASE("third test which should be skipped", "[.]")
 {
     FAIL();
 }
 
-
 TEST_CASE("this test also runs successfully", "[bluesmoke]")
 {
-
 }
 
 TEST_CASE("environment variables can be set and read from python", "[bluesmoke]")
@@ -61,4 +56,3 @@ TEST_CASE("environment variables can be set and read from python", "[bluesmoke]"
     CHECK(strcmp(res, "42") == 0);
     setenv("VAR_FROM_TEST", "24", 1);
 }
-
diff --git a/tests/device/test_libc/libm_string.c b/tests/device/test_libc/libm_string.c
index 715f7973b2..7b479a7d08 100644
--- a/tests/device/test_libc/libm_string.c
+++ b/tests/device/test_libc/libm_string.c
@@ -1,9 +1,7 @@
+#include <errno.h>
 #include <stdio.h>
-#include <string.h>
 #include <stdlib.h>
-#include <errno.h>
-
-
+#include <string.h>
 
 #define memcmp memcmp_P
 #define memcpy memcpy_P
@@ -18,17 +16,14 @@
 #define strcmp strcmp_P
 #define strncmp strncmp_P
 
-
-_CONST char *it = "<UNSET>";	/* Routine name for message routines. */
-static int  errors = 0;
+_CONST char* it = "<UNSET>"; /* Routine name for message routines. */
+static int errors = 0;
 
 /* Complain if condition is not true.  */
 #define check(thing) checkit(thing, __LINE__)
 
 static void
-_DEFUN(checkit, (ok, l),
-       int ok _AND
-       int l)
+_DEFUN(checkit, (ok, l), int ok _AND int l)
 
 {
     //  newfunc(it);
@@ -41,16 +36,11 @@ _DEFUN(checkit, (ok, l),
     }
 }
 
-
-
 /* Complain if first two args don't strcmp as equal.  */
-#define equal(a, b)  funcqual(a,b,__LINE__);
+#define equal(a, b) funcqual(a, b, __LINE__);
 
 static void
-_DEFUN(funcqual, (a, b, l),
-       char *a _AND
-       char *b _AND
-       int l)
+_DEFUN(funcqual, (a, b, l), char* a _AND char* b _AND int l)
 {
     //  newfunc(it);
 
@@ -65,373 +55,369 @@ _DEFUN(funcqual, (a, b, l),
     }
 }
 
-
-
 static char one[50];
 static char two[50];
 
-
 void libm_test_string()
 {
     /* Test strcmp first because we use it to test other things.  */
     it = "strcmp";
-    check(strcmp("", "") == 0); /* Trivial case. */
-    check(strcmp("a", "a") == 0); /* Identity. */
+    check(strcmp("", "") == 0);       /* Trivial case. */
+    check(strcmp("a", "a") == 0);     /* Identity. */
     check(strcmp("abc", "abc") == 0); /* Multicharacter. */
     check(strcmp("abc", "abcd") < 0); /* Length mismatches. */
     check(strcmp("abcd", "abc") > 0);
-    check(strcmp("abcd", "abce") < 0);	/* Honest miscompares. */
+    check(strcmp("abcd", "abce") < 0); /* Honest miscompares. */
     check(strcmp("abce", "abcd") > 0);
     check(strcmp("a\103", "a") > 0); /* Tricky if char signed. */
     check(strcmp("a\103", "a\003") > 0);
 
     /* Test strcpy next because we need it to set up other tests.  */
     it = "strcpy";
-    check(strcpy(one, "abcd") == one);	/* Returned value. */
-    equal(one, "abcd");	/* Basic test. */
+    check(strcpy(one, "abcd") == one); /* Returned value. */
+    equal(one, "abcd");                /* Basic test. */
 
-    (void) strcpy(one, "x");
-    equal(one, "x");		/* Writeover. */
-    equal(one + 2, "cd");	/* Wrote too much? */
+    (void)strcpy(one, "x");
+    equal(one, "x");      /* Writeover. */
+    equal(one + 2, "cd"); /* Wrote too much? */
 
-    (void) strcpy(two, "hi there");
-    (void) strcpy(one, two);
-    equal(one, "hi there");	/* Basic test encore. */
-    equal(two, "hi there");	/* Stomped on source? */
+    (void)strcpy(two, "hi there");
+    (void)strcpy(one, two);
+    equal(one, "hi there"); /* Basic test encore. */
+    equal(two, "hi there"); /* Stomped on source? */
 
-    (void) strcpy(one, "");
-    equal(one, "");		/* Boundary condition. */
+    (void)strcpy(one, "");
+    equal(one, ""); /* Boundary condition. */
 
     /* strcat.  */
     it = "strcat";
-    (void) strcpy(one, "ijk");
+    (void)strcpy(one, "ijk");
     check(strcat(one, "lmn") == one); /* Returned value. */
-    equal(one, "ijklmn");	/* Basic test. */
-
-    (void) strcpy(one, "x");
-    (void) strcat(one, "yz");
-    equal(one, "xyz");		/* Writeover. */
-    equal(one + 4, "mn");	/* Wrote too much? */
-
-    (void) strcpy(one, "gh");
-    (void) strcpy(two, "ef");
-    (void) strcat(one, two);
-    equal(one, "ghef");	/* Basic test encore. */
-    equal(two, "ef");		/* Stomped on source? */
-
-    (void) strcpy(one, "");
-    (void) strcat(one, "");
-    equal(one, "");		/* Boundary conditions. */
-    (void) strcpy(one, "ab");
-    (void) strcat(one, "");
+    equal(one, "ijklmn");             /* Basic test. */
+
+    (void)strcpy(one, "x");
+    (void)strcat(one, "yz");
+    equal(one, "xyz");    /* Writeover. */
+    equal(one + 4, "mn"); /* Wrote too much? */
+
+    (void)strcpy(one, "gh");
+    (void)strcpy(two, "ef");
+    (void)strcat(one, two);
+    equal(one, "ghef"); /* Basic test encore. */
+    equal(two, "ef");   /* Stomped on source? */
+
+    (void)strcpy(one, "");
+    (void)strcat(one, "");
+    equal(one, ""); /* Boundary conditions. */
+    (void)strcpy(one, "ab");
+    (void)strcat(one, "");
     equal(one, "ab");
-    (void) strcpy(one, "");
-    (void) strcat(one, "cd");
+    (void)strcpy(one, "");
+    (void)strcat(one, "cd");
     equal(one, "cd");
 
     /*  strncat - first test it as strcat, with big counts,
         then test the count mechanism.  */
     it = "strncat";
-    (void) strcpy(one, "ijk");
+    (void)strcpy(one, "ijk");
     check(strncat(one, "lmn", 99) == one); /* Returned value. */
-    equal(one, "ijklmn");	/* Basic test. */
-
-    (void) strcpy(one, "x");
-    (void) strncat(one, "yz", 99);
-    equal(one, "xyz");		/* Writeover. */
-    equal(one + 4, "mn");	/* Wrote too much? */
-
-    (void) strcpy(one, "gh");
-    (void) strcpy(two, "ef");
-    (void) strncat(one, two, 99);
-    equal(one, "ghef");	/* Basic test encore. */
-    equal(two, "ef");		/* Stomped on source? */
-
-    (void) strcpy(one, "");
-    (void) strncat(one, "", 99);
-    equal(one, "");		/* Boundary conditions. */
-    (void) strcpy(one, "ab");
-    (void) strncat(one, "", 99);
+    equal(one, "ijklmn");                  /* Basic test. */
+
+    (void)strcpy(one, "x");
+    (void)strncat(one, "yz", 99);
+    equal(one, "xyz");    /* Writeover. */
+    equal(one + 4, "mn"); /* Wrote too much? */
+
+    (void)strcpy(one, "gh");
+    (void)strcpy(two, "ef");
+    (void)strncat(one, two, 99);
+    equal(one, "ghef"); /* Basic test encore. */
+    equal(two, "ef");   /* Stomped on source? */
+
+    (void)strcpy(one, "");
+    (void)strncat(one, "", 99);
+    equal(one, ""); /* Boundary conditions. */
+    (void)strcpy(one, "ab");
+    (void)strncat(one, "", 99);
     equal(one, "ab");
-    (void) strcpy(one, "");
-    (void) strncat(one, "cd", 99);
+    (void)strcpy(one, "");
+    (void)strncat(one, "cd", 99);
     equal(one, "cd");
 
-    (void) strcpy(one, "ab");
-    (void) strncat(one, "cdef", 2);
-    equal(one, "abcd");	/* Count-limited. */
+    (void)strcpy(one, "ab");
+    (void)strncat(one, "cdef", 2);
+    equal(one, "abcd"); /* Count-limited. */
 
-    (void) strncat(one, "gh", 0);
-    equal(one, "abcd");	/* Zero count. */
+    (void)strncat(one, "gh", 0);
+    equal(one, "abcd"); /* Zero count. */
 
-    (void) strncat(one, "gh", 2);
-    equal(one, "abcdgh");	/* Count _AND length equal. */
+    (void)strncat(one, "gh", 2);
+    equal(one, "abcdgh"); /* Count _AND length equal. */
     it = "strncmp";
     /* strncmp - first test as strcmp with big counts";*/
-    check(strncmp("", "", 99) == 0); /* Trivial case. */
-    check(strncmp("a", "a", 99) == 0);	/* Identity. */
+    check(strncmp("", "", 99) == 0);       /* Trivial case. */
+    check(strncmp("a", "a", 99) == 0);     /* Identity. */
     check(strncmp("abc", "abc", 99) == 0); /* Multicharacter. */
     check(strncmp("abc", "abcd", 99) < 0); /* Length unequal. */
     check(strncmp("abcd", "abc", 99) > 0);
     check(strncmp("abcd", "abce", 99) < 0); /* Honestly unequal. */
     check(strncmp("abce", "abcd", 99) > 0);
     check(strncmp("abce", "abcd", 3) == 0); /* Count limited. */
-    check(strncmp("abce", "abc", 3) == 0); /* Count == length. */
-    check(strncmp("abcd", "abce", 4) < 0); /* Nudging limit. */
-    check(strncmp("abc", "def", 0) == 0); /* Zero count. */
+    check(strncmp("abce", "abc", 3) == 0);  /* Count == length. */
+    check(strncmp("abcd", "abce", 4) < 0);  /* Nudging limit. */
+    check(strncmp("abc", "def", 0) == 0);   /* Zero count. */
 
     /* strncpy - testing is a bit different because of odd semantics.  */
     it = "strncpy";
     check(strncpy(one, "abc", 4) == one); /* Returned value. */
-    equal(one, "abc");		/* Did the copy go right? */
+    equal(one, "abc");                    /* Did the copy go right? */
 
-    (void) strcpy(one, "abcdefgh");
-    (void) strncpy(one, "xyz", 2);
-    equal(one, "xycdefgh");	/* Copy cut by count. */
+    (void)strcpy(one, "abcdefgh");
+    (void)strncpy(one, "xyz", 2);
+    equal(one, "xycdefgh"); /* Copy cut by count. */
 
-    (void) strcpy(one, "abcdefgh");
-    (void) strncpy(one, "xyz", 3); /* Copy cut just before NUL. */
+    (void)strcpy(one, "abcdefgh");
+    (void)strncpy(one, "xyz", 3); /* Copy cut just before NUL. */
     equal(one, "xyzdefgh");
 
-    (void) strcpy(one, "abcdefgh");
-    (void) strncpy(one, "xyz", 4); /* Copy just includes NUL. */
+    (void)strcpy(one, "abcdefgh");
+    (void)strncpy(one, "xyz", 4); /* Copy just includes NUL. */
     equal(one, "xyz");
-    equal(one + 4, "efgh");	/* Wrote too much? */
+    equal(one + 4, "efgh"); /* Wrote too much? */
 
-    (void) strcpy(one, "abcdefgh");
-    (void) strncpy(one, "xyz", 5); /* Copy includes padding. */
+    (void)strcpy(one, "abcdefgh");
+    (void)strncpy(one, "xyz", 5); /* Copy includes padding. */
     equal(one, "xyz");
     equal(one + 4, "");
     equal(one + 5, "fgh");
 
-    (void) strcpy(one, "abc");
-    (void) strncpy(one, "xyz", 0); /* Zero-length copy. */
+    (void)strcpy(one, "abc");
+    (void)strncpy(one, "xyz", 0); /* Zero-length copy. */
     equal(one, "abc");
 
-    (void) strncpy(one, "", 2);	/* Zero-length source. */
+    (void)strncpy(one, "", 2); /* Zero-length source. */
     equal(one, "");
     equal(one + 1, "");
     equal(one + 2, "c");
 
-    (void) strcpy(one, "hi there");
-    (void) strncpy(two, one, 9);
-    equal(two, "hi there");	/* Just paranoia. */
-    equal(one, "hi there");	/* Stomped on source? */
+    (void)strcpy(one, "hi there");
+    (void)strncpy(two, one, 9);
+    equal(two, "hi there"); /* Just paranoia. */
+    equal(one, "hi there"); /* Stomped on source? */
 
     /* strlen.  */
     it = "strlen";
-    check(strlen("") == 0);	/* Empty. */
-    check(strlen("a") == 1);	/* Single char. */
+    check(strlen("") == 0);     /* Empty. */
+    check(strlen("a") == 1);    /* Single char. */
     check(strlen("abcd") == 4); /* Multiple chars. */
 
     /* strchr.  */
     it = "strchr";
     check(strchr("abcd", 'z') == NULL); /* Not found. */
-    (void) strcpy(one, "abcd");
-    check(strchr(one, 'c') == one + 2); /* Basic test. */
-    check(strchr(one, 'd') == one + 3); /* End of string. */
-    check(strchr(one, 'a') == one); /* Beginning. */
-    check(strchr(one, '\0') == one + 4);	/* Finding NUL. */
-    (void) strcpy(one, "ababa");
+    (void)strcpy(one, "abcd");
+    check(strchr(one, 'c') == one + 2);  /* Basic test. */
+    check(strchr(one, 'd') == one + 3);  /* End of string. */
+    check(strchr(one, 'a') == one);      /* Beginning. */
+    check(strchr(one, '\0') == one + 4); /* Finding NUL. */
+    (void)strcpy(one, "ababa");
     check(strchr(one, 'b') == one + 1); /* Finding first. */
-    (void) strcpy(one, "");
+    (void)strcpy(one, "");
     check(strchr(one, 'b') == NULL); /* Empty string. */
     check(strchr(one, '\0') == one); /* NUL in empty string. */
 
     /* index - just like strchr.  */
     it = "index";
-    check(index("abcd", 'z') == NULL);	/* Not found. */
-    (void) strcpy(one, "abcd");
-    check(index(one, 'c') == one + 2); /* Basic test. */
-    check(index(one, 'd') == one + 3); /* End of string. */
-    check(index(one, 'a') == one); /* Beginning. */
+    check(index("abcd", 'z') == NULL); /* Not found. */
+    (void)strcpy(one, "abcd");
+    check(index(one, 'c') == one + 2);  /* Basic test. */
+    check(index(one, 'd') == one + 3);  /* End of string. */
+    check(index(one, 'a') == one);      /* Beginning. */
     check(index(one, '\0') == one + 4); /* Finding NUL. */
-    (void) strcpy(one, "ababa");
+    (void)strcpy(one, "ababa");
     check(index(one, 'b') == one + 1); /* Finding first. */
-    (void) strcpy(one, "");
+    (void)strcpy(one, "");
     check(index(one, 'b') == NULL); /* Empty string. */
     check(index(one, '\0') == one); /* NUL in empty string. */
 
     /* strrchr.  */
     it = "strrchr";
     check(strrchr("abcd", 'z') == NULL); /* Not found. */
-    (void) strcpy(one, "abcd");
-    check(strrchr(one, 'c') == one + 2);	/* Basic test. */
-    check(strrchr(one, 'd') == one + 3);	/* End of string. */
-    check(strrchr(one, 'a') == one); /* Beginning. */
+    (void)strcpy(one, "abcd");
+    check(strrchr(one, 'c') == one + 2);  /* Basic test. */
+    check(strrchr(one, 'd') == one + 3);  /* End of string. */
+    check(strrchr(one, 'a') == one);      /* Beginning. */
     check(strrchr(one, '\0') == one + 4); /* Finding NUL. */
-    (void) strcpy(one, "ababa");
-    check(strrchr(one, 'b') == one + 3);	/* Finding last. */
-    (void) strcpy(one, "");
+    (void)strcpy(one, "ababa");
+    check(strrchr(one, 'b') == one + 3); /* Finding last. */
+    (void)strcpy(one, "");
     check(strrchr(one, 'b') == NULL); /* Empty string. */
     check(strrchr(one, '\0') == one); /* NUL in empty string. */
 
     /* rindex - just like strrchr.  */
     it = "rindex";
     check(rindex("abcd", 'z') == NULL); /* Not found. */
-    (void) strcpy(one, "abcd");
-    check(rindex(one, 'c') == one + 2); /* Basic test. */
-    check(rindex(one, 'd') == one + 3); /* End of string. */
-    check(rindex(one, 'a') == one); /* Beginning. */
-    check(rindex(one, '\0') == one + 4);	/* Finding NUL. */
-    (void) strcpy(one, "ababa");
+    (void)strcpy(one, "abcd");
+    check(rindex(one, 'c') == one + 2);  /* Basic test. */
+    check(rindex(one, 'd') == one + 3);  /* End of string. */
+    check(rindex(one, 'a') == one);      /* Beginning. */
+    check(rindex(one, '\0') == one + 4); /* Finding NUL. */
+    (void)strcpy(one, "ababa");
     check(rindex(one, 'b') == one + 3); /* Finding last. */
-    (void) strcpy(one, "");
+    (void)strcpy(one, "");
     check(rindex(one, 'b') == NULL); /* Empty string. */
     check(rindex(one, '\0') == one); /* NUL in empty string. */
 
     /* strpbrk - somewhat like strchr.  */
     it = "strpbrk";
     check(strpbrk("abcd", "z") == NULL); /* Not found. */
-    (void) strcpy(one, "abcd");
-    check(strpbrk(one, "c") == one + 2);	/* Basic test. */
-    check(strpbrk(one, "d") == one + 3);	/* End of string. */
-    check(strpbrk(one, "a") == one); /* Beginning. */
-    check(strpbrk(one, "") == NULL); /* Empty search list. */
+    (void)strcpy(one, "abcd");
+    check(strpbrk(one, "c") == one + 2);  /* Basic test. */
+    check(strpbrk(one, "d") == one + 3);  /* End of string. */
+    check(strpbrk(one, "a") == one);      /* Beginning. */
+    check(strpbrk(one, "") == NULL);      /* Empty search list. */
     check(strpbrk(one, "cb") == one + 1); /* Multiple search. */
-    (void) strcpy(one, "abcabdea");
-    check(strpbrk(one, "b") == one + 1);	/* Finding first. */
+    (void)strcpy(one, "abcabdea");
+    check(strpbrk(one, "b") == one + 1);  /* Finding first. */
     check(strpbrk(one, "cb") == one + 1); /* With multiple search. */
     check(strpbrk(one, "db") == one + 1); /* Another variant. */
-    (void) strcpy(one, "");
+    (void)strcpy(one, "");
     check(strpbrk(one, "bc") == NULL); /* Empty string. */
-    check(strpbrk(one, "") == NULL); /* Both strings empty. */
+    check(strpbrk(one, "") == NULL);   /* Both strings empty. */
 
     /* strstr - somewhat like strchr.  */
     it = "strstr";
-    check(strstr("z", "abcd") == NULL); /* Not found. */
+    check(strstr("z", "abcd") == NULL);   /* Not found. */
     check(strstr("abx", "abcd") == NULL); /* Dead end. */
-    (void) strcpy(one, "abcd");
-    check(strstr(one, "c") == one + 2); /* Basic test. */
-    check(strstr(one, "bc") == one + 1);	/* Multichar. */
-    check(strstr(one, "d") == one + 3); /* End of string. */
-    check(strstr(one, "cd") == one + 2);	/* Tail of string. */
-    check(strstr(one, "abc") == one); /* Beginning. */
-    check(strstr(one, "abcd") == one);	/* Exact match. */
-    check(strstr(one, "de") == NULL);	/* Past end. */
-    check(strstr(one, "") == one); /* Finding empty. */
-    (void) strcpy(one, "ababa");
+    (void)strcpy(one, "abcd");
+    check(strstr(one, "c") == one + 2);  /* Basic test. */
+    check(strstr(one, "bc") == one + 1); /* Multichar. */
+    check(strstr(one, "d") == one + 3);  /* End of string. */
+    check(strstr(one, "cd") == one + 2); /* Tail of string. */
+    check(strstr(one, "abc") == one);    /* Beginning. */
+    check(strstr(one, "abcd") == one);   /* Exact match. */
+    check(strstr(one, "de") == NULL);    /* Past end. */
+    check(strstr(one, "") == one);       /* Finding empty. */
+    (void)strcpy(one, "ababa");
     check(strstr(one, "ba") == one + 1); /* Finding first. */
-    (void) strcpy(one, "");
+    (void)strcpy(one, "");
     check(strstr(one, "b") == NULL); /* Empty string. */
-    check(strstr(one, "") == one); /* Empty in empty string. */
-    (void) strcpy(one, "bcbca");
+    check(strstr(one, "") == one);   /* Empty in empty string. */
+    (void)strcpy(one, "bcbca");
     check(strstr(one, "bca") == one + 2); /* False start. */
-    (void) strcpy(one, "bbbcabbca");
+    (void)strcpy(one, "bbbcabbca");
     check(strstr(one, "bbca") == one + 1); /* With overlap. */
 
     /* strspn.  */
     it = "strspn";
     check(strspn("abcba", "abc") == 5); /* Whole string. */
-    check(strspn("abcba", "ab") == 2);	/* Partial. */
-    check(strspn("abc", "qx") == 0); /* None. */
-    check(strspn("", "ab") == 0); /* Null string. */
-    check(strspn("abc", "") == 0); /* Null search list. */
+    check(strspn("abcba", "ab") == 2);  /* Partial. */
+    check(strspn("abc", "qx") == 0);    /* None. */
+    check(strspn("", "ab") == 0);       /* Null string. */
+    check(strspn("abc", "") == 0);      /* Null search list. */
 
     /* strcspn.  */
     it = "strcspn";
     check(strcspn("abcba", "qx") == 5); /* Whole string. */
     check(strcspn("abcba", "cx") == 2); /* Partial. */
-    check(strcspn("abc", "abc") == 0);	/* None. */
-    check(strcspn("", "ab") == 0); /* Null string. */
-    check(strcspn("abc", "") == 3); /* Null search list. */
+    check(strcspn("abc", "abc") == 0);  /* None. */
+    check(strcspn("", "ab") == 0);      /* Null string. */
+    check(strcspn("abc", "") == 3);     /* Null search list. */
 
     /* strtok - the hard one.  */
     it = "strtok";
-    (void) strcpy(one, "first, second, third");
-    equal(strtok(one, ", "), "first");	/* Basic test. */
+    (void)strcpy(one, "first, second, third");
+    equal(strtok(one, ", "), "first"); /* Basic test. */
     equal(one, "first");
-    equal(strtok((char *)NULL, ", "), "second");
-    equal(strtok((char *)NULL, ", "), "third");
-    check(strtok((char *)NULL, ", ") == NULL);
-    (void) strcpy(one, ", first, ");
-    equal(strtok(one, ", "), "first");	/* Extra delims, 1 tok. */
-    check(strtok((char *)NULL, ", ") == NULL);
-    (void) strcpy(one, "1a, 1b; 2a, 2b");
+    equal(strtok((char*)NULL, ", "), "second");
+    equal(strtok((char*)NULL, ", "), "third");
+    check(strtok((char*)NULL, ", ") == NULL);
+    (void)strcpy(one, ", first, ");
+    equal(strtok(one, ", "), "first"); /* Extra delims, 1 tok. */
+    check(strtok((char*)NULL, ", ") == NULL);
+    (void)strcpy(one, "1a, 1b; 2a, 2b");
     equal(strtok(one, ", "), "1a"); /* Changing delim lists. */
-    equal(strtok((char *)NULL, "; "), "1b");
-    equal(strtok((char *)NULL, ", "), "2a");
-    (void) strcpy(two, "x-y");
+    equal(strtok((char*)NULL, "; "), "1b");
+    equal(strtok((char*)NULL, ", "), "2a");
+    (void)strcpy(two, "x-y");
     equal(strtok(two, "-"), "x"); /* New string before done. */
-    equal(strtok((char *)NULL, "-"), "y");
-    check(strtok((char *)NULL, "-") == NULL);
-    (void) strcpy(one, "a,b, c,, ,d");
+    equal(strtok((char*)NULL, "-"), "y");
+    check(strtok((char*)NULL, "-") == NULL);
+    (void)strcpy(one, "a,b, c,, ,d");
     equal(strtok(one, ", "), "a"); /* Different separators. */
-    equal(strtok((char *)NULL, ", "), "b");
-    equal(strtok((char *)NULL, " ,"), "c"); /* Permute list too. */
-    equal(strtok((char *)NULL, " ,"), "d");
-    check(strtok((char *)NULL, ", ") == NULL);
-    check(strtok((char *)NULL, ", ") == NULL); /* Persistence. */
-    (void) strcpy(one, ", ");
-    check(strtok(one, ", ") == NULL);	/* No tokens. */
-    (void) strcpy(one, "");
-    check(strtok(one, ", ") == NULL);	/* Empty string. */
-    (void) strcpy(one, "abc");
+    equal(strtok((char*)NULL, ", "), "b");
+    equal(strtok((char*)NULL, " ,"), "c"); /* Permute list too. */
+    equal(strtok((char*)NULL, " ,"), "d");
+    check(strtok((char*)NULL, ", ") == NULL);
+    check(strtok((char*)NULL, ", ") == NULL); /* Persistence. */
+    (void)strcpy(one, ", ");
+    check(strtok(one, ", ") == NULL); /* No tokens. */
+    (void)strcpy(one, "");
+    check(strtok(one, ", ") == NULL); /* Empty string. */
+    (void)strcpy(one, "abc");
     equal(strtok(one, ", "), "abc"); /* No delimiters. */
-    check(strtok((char *)NULL, ", ") == NULL);
-    (void) strcpy(one, "abc");
+    check(strtok((char*)NULL, ", ") == NULL);
+    (void)strcpy(one, "abc");
     equal(strtok(one, ""), "abc"); /* Empty delimiter list. */
-    check(strtok((char *)NULL, "") == NULL);
-    (void) strcpy(one, "abcdefgh");
-    (void) strcpy(one, "a,b,c");
+    check(strtok((char*)NULL, "") == NULL);
+    (void)strcpy(one, "abcdefgh");
+    (void)strcpy(one, "a,b,c");
     equal(strtok(one, ","), "a"); /* Basics again... */
-    equal(strtok((char *)NULL, ","), "b");
-    equal(strtok((char *)NULL, ","), "c");
-    check(strtok((char *)NULL, ",") == NULL);
-    equal(one + 6, "gh");	/* Stomped past end? */
-    equal(one, "a");		/* Stomped old tokens? */
+    equal(strtok((char*)NULL, ","), "b");
+    equal(strtok((char*)NULL, ","), "c");
+    check(strtok((char*)NULL, ",") == NULL);
+    equal(one + 6, "gh"); /* Stomped past end? */
+    equal(one, "a");      /* Stomped old tokens? */
     equal(one + 2, "b");
     equal(one + 4, "c");
 
     /* memcmp.  */
     it = "memcmp";
-    check(memcmp("a", "a", 1) == 0); /* Identity. */
-    check(memcmp("abc", "abc", 3) == 0); /* Multicharacter. */
+    check(memcmp("a", "a", 1) == 0);      /* Identity. */
+    check(memcmp("abc", "abc", 3) == 0);  /* Multicharacter. */
     check(memcmp("abcd", "abce", 4) < 0); /* Honestly unequal. */
     check(memcmp("abce", "abcd", 4));
     check(memcmp("alph", "beta", 4) < 0);
     check(memcmp("abce", "abcd", 3) == 0); /* Count limited. */
-    check(memcmp("abc", "def", 0) == 0); /* Zero count. */
+    check(memcmp("abc", "def", 0) == 0);   /* Zero count. */
 
     /* memcmp should test strings as unsigned */
     one[0] = 0xfe;
     two[0] = 0x03;
     check(memcmp(one, two, 1) > 0);
 
-
     /* memchr.  */
     it = "memchr";
     check(memchr("abcd", 'z', 4) == NULL); /* Not found. */
-    (void) strcpy(one, "abcd");
-    check(memchr(one, 'c', 4) == one + 2); /* Basic test. */
-    check(memchr(one, 'd', 4) == one + 3); /* End of string. */
-    check(memchr(one, 'a', 4) == one);	/* Beginning. */
+    (void)strcpy(one, "abcd");
+    check(memchr(one, 'c', 4) == one + 2);  /* Basic test. */
+    check(memchr(one, 'd', 4) == one + 3);  /* End of string. */
+    check(memchr(one, 'a', 4) == one);      /* Beginning. */
     check(memchr(one, '\0', 5) == one + 4); /* Finding NUL. */
-    (void) strcpy(one, "ababa");
+    (void)strcpy(one, "ababa");
     check(memchr(one, 'b', 5) == one + 1); /* Finding first. */
-    check(memchr(one, 'b', 0) == NULL); /* Zero count. */
-    check(memchr(one, 'a', 1) == one);	/* Singleton case. */
-    (void) strcpy(one, "a\203b");
+    check(memchr(one, 'b', 0) == NULL);    /* Zero count. */
+    check(memchr(one, 'a', 1) == one);     /* Singleton case. */
+    (void)strcpy(one, "a\203b");
     check(memchr(one, 0203, 3) == one + 1); /* Unsignedness. */
 
     /* memcpy - need not work for overlap.  */
     it = "memcpy";
     check(memcpy(one, "abc", 4) == one); /* Returned value. */
-    equal(one, "abc");		/* Did the copy go right? */
+    equal(one, "abc");                   /* Did the copy go right? */
 
-    (void) strcpy(one, "abcdefgh");
-    (void) memcpy(one + 1, "xyz", 2);
-    equal(one, "axydefgh");	/* Basic test. */
+    (void)strcpy(one, "abcdefgh");
+    (void)memcpy(one + 1, "xyz", 2);
+    equal(one, "axydefgh"); /* Basic test. */
 
-    (void) strcpy(one, "abc");
-    (void) memcpy(one, "xyz", 0);
-    equal(one, "abc");		/* Zero-length copy. */
+    (void)strcpy(one, "abc");
+    (void)memcpy(one, "xyz", 0);
+    equal(one, "abc"); /* Zero-length copy. */
 
-    (void) strcpy(one, "hi there");
-    (void) strcpy(two, "foo");
-    (void) memcpy(two, one, 9);
-    equal(two, "hi there");	/* Just paranoia. */
-    equal(one, "hi there");	/* Stomped on source? */
+    (void)strcpy(one, "hi there");
+    (void)strcpy(two, "foo");
+    (void)memcpy(two, one, 9);
+    equal(two, "hi there"); /* Just paranoia. */
+    equal(one, "hi there"); /* Stomped on source? */
 #if 0
     /* memmove - must work on overlap.  */
     it = "memmove";
@@ -505,61 +491,61 @@ void libm_test_string()
 #endif
     /* memset.  */
     it = "memset";
-    (void) strcpy(one, "abcdefgh");
+    (void)strcpy(one, "abcdefgh");
     check(memset(one + 1, 'x', 3) == one + 1); /* Return value. */
-    equal(one, "axxxefgh");	/* Basic test. */
+    equal(one, "axxxefgh");                    /* Basic test. */
 
-    (void) memset(one + 2, 'y', 0);
-    equal(one, "axxxefgh");	/* Zero-length set. */
+    (void)memset(one + 2, 'y', 0);
+    equal(one, "axxxefgh"); /* Zero-length set. */
 
-    (void) memset(one + 5, 0, 1);
-    equal(one, "axxxe");	/* Zero fill. */
-    equal(one + 6, "gh");	/* _AND the leftover. */
+    (void)memset(one + 5, 0, 1);
+    equal(one, "axxxe");  /* Zero fill. */
+    equal(one + 6, "gh"); /* _AND the leftover. */
 
-    (void) memset(one + 2, 010045, 1);
-    equal(one, "ax\045xe");	/* Unsigned char convert. */
+    (void)memset(one + 2, 010045, 1);
+    equal(one, "ax\045xe"); /* Unsigned char convert. */
 
     /*  bcopy - much like memcpy.
         Berklix manual is silent about overlap, so don't test it.  */
     it = "bcopy";
-    (void) bcopy("abc", one, 4);
-    equal(one, "abc");		/* Simple copy. */
+    (void)bcopy("abc", one, 4);
+    equal(one, "abc"); /* Simple copy. */
 
-    (void) strcpy(one, "abcdefgh");
-    (void) bcopy("xyz", one + 1, 2);
-    equal(one, "axydefgh");	/* Basic test. */
+    (void)strcpy(one, "abcdefgh");
+    (void)bcopy("xyz", one + 1, 2);
+    equal(one, "axydefgh"); /* Basic test. */
 
-    (void) strcpy(one, "abc");
-    (void) bcopy("xyz", one, 0);
-    equal(one, "abc");		/* Zero-length copy. */
+    (void)strcpy(one, "abc");
+    (void)bcopy("xyz", one, 0);
+    equal(one, "abc"); /* Zero-length copy. */
 
-    (void) strcpy(one, "hi there");
-    (void) strcpy(two, "foo");
-    (void) bcopy(one, two, 9);
-    equal(two, "hi there");	/* Just paranoia. */
-    equal(one, "hi there");	/* Stomped on source? */
+    (void)strcpy(one, "hi there");
+    (void)strcpy(two, "foo");
+    (void)bcopy(one, two, 9);
+    equal(two, "hi there"); /* Just paranoia. */
+    equal(one, "hi there"); /* Stomped on source? */
 
     /* bzero.  */
     it = "bzero";
-    (void) strcpy(one, "abcdef");
+    (void)strcpy(one, "abcdef");
     bzero(one + 2, 2);
-    equal(one, "ab");		/* Basic test. */
+    equal(one, "ab"); /* Basic test. */
     equal(one + 3, "");
     equal(one + 4, "ef");
 
-    (void) strcpy(one, "abcdef");
+    (void)strcpy(one, "abcdef");
     bzero(one + 2, 0);
-    equal(one, "abcdef");	/* Zero-length copy. */
+    equal(one, "abcdef"); /* Zero-length copy. */
 
     /* bcmp - somewhat like memcmp.  */
     it = "bcmp";
-    check(bcmp("a", "a", 1) == 0); /* Identity. */
-    check(bcmp("abc", "abc", 3) == 0);	/* Multicharacter. */
+    check(bcmp("a", "a", 1) == 0);       /* Identity. */
+    check(bcmp("abc", "abc", 3) == 0);   /* Multicharacter. */
     check(bcmp("abcd", "abce", 4) != 0); /* Honestly unequal. */
     check(bcmp("abce", "abcd", 4));
     check(bcmp("alph", "beta", 4) != 0);
     check(bcmp("abce", "abcd", 3) == 0); /* Count limited. */
-    check(bcmp("abc", "def", 0) == 0);	/* Zero count. */
+    check(bcmp("abc", "def", 0) == 0);   /* Zero count. */
 
     if (errors)
     {
@@ -567,7 +553,7 @@ void libm_test_string()
     }
     printf("ok\n");
 
-#if 0  /* strerror - VERY system-dependent.  */
+#if 0 /* strerror - VERY system-dependent.  */
     {
         extern CONST unsigned int _sys_nerr;
         extern CONST char *CONST _sys_errlist[];
@@ -579,4 +565,3 @@ void libm_test_string()
     }
 #endif
 }
-
diff --git a/tests/device/test_libc/memcpy-1.c b/tests/device/test_libc/memcpy-1.c
index 4e14bb5810..7ba022115c 100644
--- a/tests/device/test_libc/memcpy-1.c
+++ b/tests/device/test_libc/memcpy-1.c
@@ -26,11 +26,10 @@
     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
 #include <stdarg.h>
-
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #define memcmp memcmp_P
 #define memcpy memcpy_P
@@ -121,15 +120,16 @@ void memcpy_main(void)
                     dest[j] = 0;
                 }
 
-                void *ret = memcpy(dest + START_COPY + da, src + sa, n);
+                void* ret = memcpy(dest + START_COPY + da, src + sa, n);
 
                 /* Check return value.  */
                 if (ret != (dest + START_COPY + da))
-                    print_error("\nFailed: wrong return value in memcpy of %u bytes "
-                                "with src_align %u and dst_align %u. "
-                                "Return value and dest should be the same"
-                                "(ret is %p, dest is %p)\n",
-                                n, sa, da, ret, dest + START_COPY + da);
+                    print_error(
+                        "\nFailed: wrong return value in memcpy of %u bytes "
+                        "with src_align %u and dst_align %u. "
+                        "Return value and dest should be the same"
+                        "(ret is %p, dest is %p)\n",
+                        n, sa, da, ret, dest + START_COPY + da);
 
                 /*  Check that content of the destination buffer
                     is the same as the source buffer, and
@@ -138,35 +138,39 @@ void memcpy_main(void)
                     if ((unsigned)j < START_COPY + da)
                     {
                         if (dest[j] != 0)
-                            print_error("\nFailed: after memcpy of %u bytes "
-                                        "with src_align %u and dst_align %u, "
-                                        "byte %u before the start of dest is not 0.\n",
-                                        n, sa, da, START_COPY - j);
+                            print_error(
+                                "\nFailed: after memcpy of %u bytes "
+                                "with src_align %u and dst_align %u, "
+                                "byte %u before the start of dest is not 0.\n",
+                                n, sa, da, START_COPY - j);
                     }
                     else if ((unsigned)j < START_COPY + da + n)
                     {
                         i = j - START_COPY - da;
                         if (dest[j] != (src + sa)[i])
-                            print_error("\nFailed: after memcpy of %u bytes "
-                                        "with src_align %u and dst_align %u, "
-                                        "byte %u in dest and src are not the same.\n",
-                                        n, sa, da, i);
+                            print_error(
+                                "\nFailed: after memcpy of %u bytes "
+                                "with src_align %u and dst_align %u, "
+                                "byte %u in dest and src are not the same.\n",
+                                n, sa, da, i);
                     }
                     else if (dest[j] != 0)
                     {
-                        print_error("\nFailed: after memcpy of %u bytes "
-                                    "with src_align %u and dst_align %u, "
-                                    "byte %u after the end of dest is not 0.\n",
-                                    n, sa, da, j - START_COPY - da - n);
+                        print_error(
+                            "\nFailed: after memcpy of %u bytes "
+                            "with src_align %u and dst_align %u, "
+                            "byte %u after the end of dest is not 0.\n",
+                            n, sa, da, j - START_COPY - da - n);
                     }
 
                 /* Check src is not modified.  */
                 for (j = 0; j < BUFF_SIZE; j++)
                     if (src[i] != backup_src[i])
-                        print_error("\nFailed: after memcpy of %u bytes "
-                                    "with src_align %u and dst_align %u, "
-                                    "byte %u of src is modified.\n",
-                                    n, sa, da, j);
+                        print_error(
+                            "\nFailed: after memcpy of %u bytes "
+                            "with src_align %u and dst_align %u, "
+                            "byte %u of src is modified.\n",
+                            n, sa, da, j);
             }
 
     if (errors != 0)
diff --git a/tests/device/test_libc/memmove1.c b/tests/device/test_libc/memmove1.c
index 573b476765..96b46d2887 100644
--- a/tests/device/test_libc/memmove1.c
+++ b/tests/device/test_libc/memmove1.c
@@ -55,19 +55,17 @@
 #define TOO_MANY_ERRORS 11
 int errors = 0;
 
-#define DEBUGP					\
- if (errors == TOO_MANY_ERRORS)			\
-   printf ("Further errors omitted\n");		\
- else if (errors < TOO_MANY_ERRORS)		\
-   printf
+#define DEBUGP                              \
+    if (errors == TOO_MANY_ERRORS)          \
+        printf("Further errors omitted\n"); \
+    else if (errors < TOO_MANY_ERRORS)      \
+    printf
 
 /* A safe target-independent memmove.  */
 
-void
-mymemmove(unsigned char *dest, unsigned char *src, size_t n)
+void mymemmove(unsigned char* dest, unsigned char* src, size_t n)
 {
-    if ((src <= dest && src + n <= dest)
-            || src >= dest)
+    if ((src <= dest && src + n <= dest) || src >= dest)
         while (n-- > 0)
         {
             *dest++ = *src++;
@@ -85,14 +83,12 @@ mymemmove(unsigned char *dest, unsigned char *src, size_t n)
 
 /*  It's either the noinline attribute or forcing the test framework to
     pass -fno-builtin-memmove.  */
-void
-xmemmove(unsigned char *dest, unsigned char *src, size_t n)
-__attribute__((__noinline__));
+void xmemmove(unsigned char* dest, unsigned char* src, size_t n)
+    __attribute__((__noinline__));
 
-void
-xmemmove(unsigned char *dest, unsigned char *src, size_t n)
+void xmemmove(unsigned char* dest, unsigned char* src, size_t n)
 {
-    void *retp;
+    void* retp;
     retp = memmove(dest, src, n);
 
     if (retp != dest)
@@ -103,12 +99,10 @@ xmemmove(unsigned char *dest, unsigned char *src, size_t n)
     }
 }
 
-
 /*  Fill the array with something we can associate with a position, but
     not exactly the same as the position index.  */
 
-void
-fill(unsigned char dest[MAX * 3])
+void fill(unsigned char dest[MAX * 3])
 {
     size_t i;
     for (i = 0; i < MAX * 3; i++)
@@ -165,9 +159,10 @@ void memmove_main(void)
             if (memcmp(to_known, to_test, sizeof(to_known)) != 0)
             {
                 errors++;
-                DEBUGP("memmove failed for %d bytes,"
-                       " with src %d bytes before dest\n",
-                       i, j);
+                DEBUGP(
+                    "memmove failed for %d bytes,"
+                    " with src %d bytes before dest\n",
+                    i, j);
             }
         }
     }
@@ -187,9 +182,10 @@ void memmove_main(void)
             if (memcmp(to_known, to_test, sizeof(to_known)) != 0)
             {
                 errors++;
-                DEBUGP("memmove failed when moving %d bytes,"
-                       " with src %d bytes after dest\n",
-                       i, j);
+                DEBUGP(
+                    "memmove failed when moving %d bytes,"
+                    " with src %d bytes after dest\n",
+                    i, j);
             }
         }
     }
diff --git a/tests/device/test_libc/strcmp-1.c b/tests/device/test_libc/strcmp-1.c
index b2b3649762..b996dc01ce 100644
--- a/tests/device/test_libc/strcmp-1.c
+++ b/tests/device/test_libc/strcmp-1.c
@@ -26,10 +26,10 @@
     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
 #include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #define memcmp memcmp_P
 #define memcpy memcpy_P
@@ -46,7 +46,6 @@
 
 #define BUFF_SIZE 256
 
-
 /*  The macro LONG_TEST controls whether a short or a more comprehensive test
     of strcmp should be performed.  */
 #ifdef LONG_TEST
@@ -106,11 +105,10 @@
 #error "Buffer overrun: MAX_OFFSET + MAX_BLOCK_SIZE + MAX_DIFF + MAX_LEN + MAX_ZEROS >= BUFF_SIZE."
 #endif
 
-
 #define TOO_MANY_ERRORS 11
 static int errors = 0;
 
-const char *testname = "strcmp";
+const char* testname = "strcmp";
 
 static void
 print_error(char const* msg, ...)
@@ -133,7 +131,6 @@ print_error(char const* msg, ...)
     }
 }
 
-
 extern int rand_seed;
 void strcmp_main(void)
 {
@@ -146,7 +143,7 @@ void strcmp_main(void)
     unsigned sa;
     unsigned da;
     unsigned n, m, len;
-    char *p;
+    char* p;
     int ret;
 
     /*  Make calls to strcmp with block sizes ranging between 1 and
@@ -155,7 +152,7 @@ void strcmp_main(void)
         for (da = 0; da <= MAX_OFFSET; da++)
             for (n = 1; n <= MAX_BLOCK_SIZE; n++)
             {
-                for (m = 1;  m < n + MAX_DIFF; m++)
+                for (m = 1; m < n + MAX_DIFF; m++)
                     for (len = 0; len < MAX_LEN; len++)
                         for (zeros = 1; zeros < MAX_ZEROS; zeros++)
                         {
@@ -197,53 +194,58 @@ void strcmp_main(void)
                                 {
                                     if (ret != 0)
                                     {
-                                        print_error("\nFailed: after %s of %u bytes "
-                                                    "with src_align %u and dst_align %u, "
-                                                    "dest after %d bytes is modified for %d bytes, "
-                                                    "return value is %d, expected 0.\n",
-                                                    testname, n, sa, da, m, len, ret);
+                                        print_error(
+                                            "\nFailed: after %s of %u bytes "
+                                            "with src_align %u and dst_align %u, "
+                                            "dest after %d bytes is modified for %d bytes, "
+                                            "return value is %d, expected 0.\n",
+                                            testname, n, sa, da, m, len, ret);
                                     }
                                 }
                                 else
                                 {
                                     if (ret >= 0)
-                                        print_error("\nFailed: after %s of %u bytes "
-                                                    "with src_align %u and dst_align %u, "
-                                                    "dest after %d bytes is modified for %d bytes, "
-                                                    "return value is %d, expected negative.\n",
-                                                    testname, n, sa, da, m, len, ret);
+                                        print_error(
+                                            "\nFailed: after %s of %u bytes "
+                                            "with src_align %u and dst_align %u, "
+                                            "dest after %d bytes is modified for %d bytes, "
+                                            "return value is %d, expected negative.\n",
+                                            testname, n, sa, da, m, len, ret);
                                 }
                             }
                             else if (m > n)
                             {
                                 if (ret >= 0)
                                 {
-                                    print_error("\nFailed: after %s of %u bytes "
-                                                "with src_align %u and dst_align %u, "
-                                                "dest after %d bytes is modified for %d bytes, "
-                                                "return value is %d, expected negative.\n",
-                                                testname, n, sa, da, m, len, ret);
+                                    print_error(
+                                        "\nFailed: after %s of %u bytes "
+                                        "with src_align %u and dst_align %u, "
+                                        "dest after %d bytes is modified for %d bytes, "
+                                        "return value is %d, expected negative.\n",
+                                        testname, n, sa, da, m, len, ret);
                                 }
                             }
-                            else  /* m < n */
+                            else /* m < n */
                             {
                                 if (len == 0)
                                 {
                                     if (ret <= 0)
-                                        print_error("\nFailed: after %s of %u bytes "
-                                                    "with src_align %u and dst_align %u, "
-                                                    "dest after %d bytes is modified for %d bytes, "
-                                                    "return value is %d, expected positive.\n",
-                                                    testname, n, sa, da, m, len, ret);
+                                        print_error(
+                                            "\nFailed: after %s of %u bytes "
+                                            "with src_align %u and dst_align %u, "
+                                            "dest after %d bytes is modified for %d bytes, "
+                                            "return value is %d, expected positive.\n",
+                                            testname, n, sa, da, m, len, ret);
                                 }
                                 else
                                 {
                                     if (ret >= 0)
-                                        print_error("\nFailed: after %s of %u bytes "
-                                                    "with src_align %u and dst_align %u, "
-                                                    "dest after %d bytes is modified for %d bytes, "
-                                                    "return value is %d, expected negative.\n",
-                                                    testname, n, sa, da, m, len, ret);
+                                        print_error(
+                                            "\nFailed: after %s of %u bytes "
+                                            "with src_align %u and dst_align %u, "
+                                            "dest after %d bytes is modified for %d bytes, "
+                                            "return value is %d, expected negative.\n",
+                                            testname, n, sa, da, m, len, ret);
                                 }
                             }
                         }
diff --git a/tests/device/test_libc/tstring.c b/tests/device/test_libc/tstring.c
index c2f2f4075a..451dc4cf6e 100644
--- a/tests/device/test_libc/tstring.c
+++ b/tests/device/test_libc/tstring.c
@@ -5,10 +5,10 @@
     is freely granted, provided that this notice is preserved.
 */
 
-#include <string.h>
+#include <pgmspace.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <pgmspace.h>
+#include <string.h>
 
 #define MAX_1 50
 #define memcmp memcmp_P
@@ -26,7 +26,7 @@
 
 #define MAX_2 (2 * MAX_1 + MAX_1 / 10)
 
-void eprintf(int line, char *result, char *expected, int size)
+void eprintf(int line, char* result, char* expected, int size)
 {
     if (size != 0)
         printf("Failure at line %d, result is <%.*s>, should be <%s> of size %d\n",
@@ -36,7 +36,7 @@ void eprintf(int line, char *result, char *expected, int size)
                line, result, expected);
 }
 
-void mycopy(char *target, char *source, int size)
+void mycopy(char* target, char* source, int size)
 {
     int i;
 
@@ -46,7 +46,7 @@ void mycopy(char *target, char *source, int size)
     }
 }
 
-void myset(char *target, char ch, int size)
+void myset(char* target, char ch, int size)
 {
     int i;
 
@@ -88,19 +88,18 @@ void tstring_main(void)
     tmp2[1] = '\0';
 
     if (memset(target, 'X', 0) != target ||
-            memcpy(target, "Y", 0) != target ||
-            memmove(target, "K", 0) != target ||
-            strncpy(tmp2, "4", 0) != tmp2 ||
-            strncat(tmp2, "123", 0) != tmp2 ||
-            strcat(target, "") != target)
+        memcpy(target, "Y", 0) != target ||
+        memmove(target, "K", 0) != target ||
+        strncpy(tmp2, "4", 0) != tmp2 ||
+        strncat(tmp2, "123", 0) != tmp2 ||
+        strcat(target, "") != target)
     {
         eprintf(__LINE__, target, "A", 0);
         test_failed = 1;
     }
 
-    if (strcmp(target, "A") || strlen(target) != 1 || memchr(target, 'A', 0) != NULL
-            || memcmp(target, "J", 0) || strncmp(target, "A", 1) || strncmp(target, "J", 0) ||
-            tmp2[0] != 'Z' || tmp2[1] != '\0')
+    if (strcmp(target, "A") || strlen(target) != 1 || memchr(target, 'A', 0) != NULL || memcmp(target, "J", 0) || strncmp(target, "A", 1) || strncmp(target, "J", 0) ||
+        tmp2[0] != 'Z' || tmp2[1] != '\0')
     {
         eprintf(__LINE__, target, "A", 0);
         test_failed = 1;
@@ -108,15 +107,15 @@ void tstring_main(void)
 
     tmp2[2] = 'A';
     if (strcpy(target, "") != target ||
-            strncpy(tmp2, "", 4) != tmp2 ||
-            strcat(target, "") != target)
+        strncpy(tmp2, "", 4) != tmp2 ||
+        strcat(target, "") != target)
     {
         eprintf(__LINE__, target, "", 0);
         test_failed = 1;
     }
 
     if (target[0] != '\0' || strncmp(target, "", 1) ||
-            memcmp(tmp2, "\0\0\0\0", 4))
+        memcmp(tmp2, "\0\0\0\0", 4))
     {
         eprintf(__LINE__, target, "", 0);
         test_failed = 1;
@@ -124,38 +123,38 @@ void tstring_main(void)
 
     tmp2[2] = 'A';
     if (strncat(tmp2, "1", 3) != tmp2 ||
-            memcmp(tmp2, "1\0A", 3))
+        memcmp(tmp2, "1\0A", 3))
     {
         eprintf(__LINE__, tmp2, "1\0A", 3);
         test_failed = 1;
     }
 
     if (strcpy(tmp3, target) != tmp3 ||
-            strcat(tmp3, "X") != tmp3 ||
-            strncpy(tmp2, "X", 2) != tmp2 ||
-            memset(target, tmp2[0], 1) != target)
+        strcat(tmp3, "X") != tmp3 ||
+        strncpy(tmp2, "X", 2) != tmp2 ||
+        memset(target, tmp2[0], 1) != target)
     {
         eprintf(__LINE__, target, "X", 0);
         test_failed = 1;
     }
 
     if (strcmp(target, "X") || strlen(target) != 1 ||
-            memchr(target, 'X', 2) != target ||
-            strchr(target, 'X') != target ||
-            memchr(target, 'Y', 2) != NULL ||
-            strchr(target, 'Y') != NULL ||
-            strcmp(tmp3, target) ||
-            strncmp(tmp3, target, 2) ||
-            memcmp(target, "K", 0) ||
-            strncmp(target, tmp3, 3))
+        memchr(target, 'X', 2) != target ||
+        strchr(target, 'X') != target ||
+        memchr(target, 'Y', 2) != NULL ||
+        strchr(target, 'Y') != NULL ||
+        strcmp(tmp3, target) ||
+        strncmp(tmp3, target, 2) ||
+        memcmp(target, "K", 0) ||
+        strncmp(target, tmp3, 3))
     {
         eprintf(__LINE__, target, "X", 0);
         test_failed = 1;
     }
 
     if (strcpy(tmp3, "Y") != tmp3 ||
-            strcat(tmp3, "Y") != tmp3 ||
-            memset(target, 'Y', 2) != target)
+        strcat(tmp3, "Y") != tmp3 ||
+        memset(target, 'Y', 2) != target)
     {
         eprintf(__LINE__, target, "Y", 0);
         test_failed = 1;
@@ -163,12 +162,12 @@ void tstring_main(void)
 
     target[2] = '\0';
     if (memcmp(target, "YY", 2) || strcmp(target, "YY") ||
-            strlen(target) != 2 || memchr(target, 'Y', 2) != target ||
-            strcmp(tmp3, target) ||
-            strncmp(target, tmp3, 3) ||
-            strncmp(target, tmp3, 4) ||
-            strncmp(target, tmp3, 2) ||
-            strchr(target, 'Y') != target)
+        strlen(target) != 2 || memchr(target, 'Y', 2) != target ||
+        strcmp(tmp3, target) ||
+        strncmp(target, tmp3, 3) ||
+        strncmp(target, tmp3, 4) ||
+        strncmp(target, tmp3, 2) ||
+        strchr(target, 'Y') != target)
     {
         eprintf(__LINE__, target, "YY", 2);
         test_failed = 1;
@@ -176,25 +175,25 @@ void tstring_main(void)
 
     strcpy(target, "WW");
     if (memcmp(target, "WW", 2) || strcmp(target, "WW") ||
-            strlen(target) != 2 || memchr(target, 'W', 2) != target ||
-            strchr(target, 'W') != target)
+        strlen(target) != 2 || memchr(target, 'W', 2) != target ||
+        strchr(target, 'W') != target)
     {
         eprintf(__LINE__, target, "WW", 2);
         test_failed = 1;
     }
 
     if (strncpy(target, "XX", 16) != target ||
-            memcmp(target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16))
+        memcmp(target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16))
     {
         eprintf(__LINE__, target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16);
         test_failed = 1;
     }
 
     if (strcpy(tmp3, "ZZ") != tmp3 ||
-            strcat(tmp3, "Z") != tmp3 ||
-            memcpy(tmp4, "Z", 2) != tmp4 ||
-            strcat(tmp4, "ZZ") != tmp4 ||
-            memset(target, 'Z', 3) != target)
+        strcat(tmp3, "Z") != tmp3 ||
+        memcpy(tmp4, "Z", 2) != tmp4 ||
+        strcat(tmp4, "ZZ") != tmp4 ||
+        memset(target, 'Z', 3) != target)
     {
         eprintf(__LINE__, target, "ZZZ", 3);
         test_failed = 1;
@@ -204,11 +203,11 @@ void tstring_main(void)
     tmp5[0] = '\0';
     strncat(tmp5, "123", 2);
     if (memcmp(target, "ZZZ", 3) || strcmp(target, "ZZZ") ||
-            strcmp(tmp3, target) || strcmp(tmp4, target) ||
-            strncmp(target, "ZZZ", 4) || strncmp(target, "ZZY", 3) <= 0 ||
-            strncmp("ZZY", target, 4) >= 0 ||
-            memcmp(tmp5, "12", 3) ||
-            strlen(target) != 3)
+        strcmp(tmp3, target) || strcmp(tmp4, target) ||
+        strncmp(target, "ZZZ", 4) || strncmp(target, "ZZY", 3) <= 0 ||
+        strncmp("ZZY", target, 4) >= 0 ||
+        memcmp(tmp5, "12", 3) ||
+        strlen(target) != 3)
     {
         eprintf(__LINE__, target, "ZZZ", 3);
         test_failed = 1;
@@ -216,10 +215,10 @@ void tstring_main(void)
 
     target[2] = 'K';
     if (memcmp(target, "ZZZ", 2) || strcmp(target, "ZZZ") >= 0 ||
-            memcmp(target, "ZZZ", 3) >= 0 || strlen(target) != 3 ||
-            memchr(target, 'K', 3) != target + 2 ||
-            strncmp(target, "ZZZ", 2) || strncmp(target, "ZZZ", 4) >= 0 ||
-            strchr(target, 'K') != target + 2)
+        memcmp(target, "ZZZ", 3) >= 0 || strlen(target) != 3 ||
+        memchr(target, 'K', 3) != target + 2 ||
+        strncmp(target, "ZZZ", 2) || strncmp(target, "ZZZ", 4) >= 0 ||
+        strchr(target, 'K') != target + 2)
     {
         eprintf(__LINE__, target, "ZZK", 3);
         test_failed = 1;
@@ -227,8 +226,8 @@ void tstring_main(void)
 
     strcpy(target, "AAA");
     if (memcmp(target, "AAA", 3) || strcmp(target, "AAA") ||
-            strncmp(target, "AAA", 3) ||
-            strlen(target) != 3)
+        strncmp(target, "AAA", 3) ||
+        strlen(target) != 3)
     {
         eprintf(__LINE__, target, "AAA", 3);
         test_failed = 1;
@@ -287,7 +286,7 @@ void tstring_main(void)
                 }
                 tmp2[i - z] = first_char + 1;
                 if (memmove(tmp2 + z + 1, tmp2 + z, i - z - 1) != tmp2 + z + 1 ||
-                        memset(tmp3, first_char, i) != tmp3)
+                    memset(tmp3, first_char, i) != tmp3)
                 {
                     printf("error at line %d\n", __LINE__);
                     test_failed = 1;
@@ -296,7 +295,7 @@ void tstring_main(void)
                 myset(tmp4, first_char, i);
                 tmp5[0] = '\0';
                 if (strncpy(tmp5, tmp1, i + 1) != tmp5 ||
-                        strcat(tmp5, tmp1) != tmp5)
+                    strcat(tmp5, tmp1) != tmp5)
                 {
                     printf("error at line %d\n", __LINE__);
                     test_failed = 1;
@@ -310,18 +309,18 @@ void tstring_main(void)
                 (void)strchr(tmp1, second_char);
 
                 if (memcmp(tmp1, expected, i) || strcmp(tmp1, expected) ||
-                        strncmp(tmp1, expected, i) ||
-                        strncmp(tmp1, expected, i + 1) ||
-                        strcmp(tmp1, tmp2) >= 0 || memcmp(tmp1, tmp2, i) >= 0 ||
-                        strncmp(tmp1, tmp2, i + 1) >= 0 ||
-                        (int)strlen(tmp1) != i || memchr(tmp1, first_char, i) != tmp1 ||
-                        strchr(tmp1, first_char) != tmp1 ||
-                        memchr(tmp1, second_char, i) != tmp1 + z ||
-                        strchr(tmp1, second_char) != tmp1 + z ||
-                        strcmp(tmp5, tmp6) ||
-                        strncat(tmp7, tmp1, i + 2) != tmp7 ||
-                        strcmp(tmp7, tmp6) ||
-                        tmp7[2 * i + z] != second_char)
+                    strncmp(tmp1, expected, i) ||
+                    strncmp(tmp1, expected, i + 1) ||
+                    strcmp(tmp1, tmp2) >= 0 || memcmp(tmp1, tmp2, i) >= 0 ||
+                    strncmp(tmp1, tmp2, i + 1) >= 0 ||
+                    (int)strlen(tmp1) != i || memchr(tmp1, first_char, i) != tmp1 ||
+                    strchr(tmp1, first_char) != tmp1 ||
+                    memchr(tmp1, second_char, i) != tmp1 + z ||
+                    strchr(tmp1, second_char) != tmp1 + z ||
+                    strcmp(tmp5, tmp6) ||
+                    strncat(tmp7, tmp1, i + 2) != tmp7 ||
+                    strcmp(tmp7, tmp6) ||
+                    tmp7[2 * i + z] != second_char)
                 {
                     eprintf(__LINE__, tmp1, expected, 0);
                     printf("x is %d\n", x);
@@ -335,7 +334,7 @@ void tstring_main(void)
                 for (k = 1; k <= align_test_iterations && k <= i; ++k)
                 {
                     if (memcmp(tmp3, tmp4, i - k + 1) != 0 ||
-                            strncmp(tmp3, tmp4, i - k + 1) != 0)
+                        strncmp(tmp3, tmp4, i - k + 1) != 0)
                     {
                         printf("Failure at line %d, comparing %.*s with %.*s\n",
                                __LINE__, i, tmp3, i, tmp4);
@@ -343,9 +342,9 @@ void tstring_main(void)
                     }
                     tmp4[i - k] = first_char + 1;
                     if (memcmp(tmp3, tmp4, i) >= 0 ||
-                            strncmp(tmp3, tmp4, i) >= 0 ||
-                            memcmp(tmp4, tmp3, i) <= 0 ||
-                            strncmp(tmp4, tmp3, i) <= 0)
+                        strncmp(tmp3, tmp4, i) >= 0 ||
+                        memcmp(tmp4, tmp3, i) <= 0 ||
+                        strncmp(tmp4, tmp3, i) <= 0)
                     {
                         printf("Failure at line %d, comparing %.*s with %.*s\n",
                                __LINE__, i, tmp3, i, tmp4);
diff --git a/tests/host/common/Arduino.cpp b/tests/host/common/Arduino.cpp
index 3ca0670ae1..eca6b82d32 100644
--- a/tests/host/common/Arduino.cpp
+++ b/tests/host/common/Arduino.cpp
@@ -21,7 +21,7 @@
 #include <Arduino.h>
 #include <Schedule.h>
 
-static struct timeval gtod0 = { 0, 0 };
+static struct timeval gtod0 = {0, 0};
 
 extern "C" unsigned long millis()
 {
@@ -45,7 +45,6 @@ extern "C" unsigned long micros()
     return ((time.tv_sec - gtod0.tv_sec) * 1000000) + time.tv_usec - gtod0.tv_usec;
 }
 
-
 extern "C" void yield()
 {
     run_scheduled_recurrent_functions();
diff --git a/tests/host/common/ArduinoCatch.cpp b/tests/host/common/ArduinoCatch.cpp
index 1f09607f7b..e15ef335e4 100644
--- a/tests/host/common/ArduinoCatch.cpp
+++ b/tests/host/common/ArduinoCatch.cpp
@@ -14,7 +14,6 @@
 */
 
 #define CATCH_CONFIG_MAIN
-#include <catch.hpp>
 #include <sys/time.h>
+#include <catch.hpp>
 #include "Arduino.h"
-
diff --git a/tests/host/common/ArduinoMain.cpp b/tests/host/common/ArduinoMain.cpp
index e4c966e29b..73ebbcf7e3 100644
--- a/tests/host/common/ArduinoMain.cpp
+++ b/tests/host/common/ArduinoMain.cpp
@@ -30,14 +30,14 @@
 */
 
 #include <Arduino.h>
-#include <user_interface.h> // wifi_get_ip_info()
+#include <user_interface.h>  // wifi_get_ip_info()
 
-#include <signal.h>
-#include <unistd.h>
 #include <getopt.h>
-#include <termios.h>
+#include <signal.h>
 #include <stdarg.h>
 #include <stdio.h>
+#include <termios.h>
+#include <unistd.h>
 
 #define MOCK_PORT_SHIFTER 9000
 
@@ -83,10 +83,10 @@ static int mock_start_uart(void)
     }
     settings = initial_settings;
     settings.c_lflag &= ~(ignore_sigint ? ISIG : 0);
-    settings.c_lflag &= ~(ECHO	| ICANON);
+    settings.c_lflag &= ~(ECHO | ICANON);
     settings.c_iflag &= ~(ICRNL | INLCR | ISTRIP | IXON);
-    settings.c_oflag |=	(ONLCR);
-    settings.c_cc[VMIN]	= 0;
+    settings.c_oflag |= (ONLCR);
+    settings.c_cc[VMIN] = 0;
     settings.c_cc[VTIME] = 0;
     if (tcsetattr(STDIN, TCSANOW, &settings) < 0)
     {
@@ -113,7 +113,7 @@ static int mock_stop_uart(void)
         perror("restoring tty: tcsetattr(STDIN)");
         return -1;
     }
-    printf("\e[?25h"); // show cursor
+    printf("\e[?25h");  // show cursor
     return (0);
 }
 
@@ -145,26 +145,26 @@ void help(const char* argv0, int exitcode)
         "\t-c             - ignore CTRL-C (send it via Serial)\n"
         "\t-f             - no throttle (possibly 100%%CPU)\n"
         "\t-1             - run loop once then exit (for host testing)\n"
-        "\t-v             - verbose\n"
-        , argv0, MOCK_PORT_SHIFTER, argv0, spiffs_kb, littlefs_kb);
+        "\t-v             - verbose\n",
+        argv0, MOCK_PORT_SHIFTER, argv0, spiffs_kb, littlefs_kb);
     exit(exitcode);
 }
 
 static struct option options[] =
-{
-    { "help",           no_argument,        NULL, 'h' },
-    { "fast",           no_argument,        NULL, 'f' },
-    { "local",          no_argument,        NULL, 'l' },
-    { "sigint",         no_argument,        NULL, 'c' },
-    { "blockinguart",   no_argument,        NULL, 'b' },
-    { "verbose",        no_argument,        NULL, 'v' },
-    { "timestamp",      no_argument,        NULL, 'T' },
-    { "interface",      required_argument,  NULL, 'i' },
-    { "fspath",         required_argument,  NULL, 'P' },
-    { "spiffskb",       required_argument,  NULL, 'S' },
-    { "littlefskb",     required_argument,  NULL, 'L' },
-    { "portshifter",    required_argument,  NULL, 's' },
-    { "once",           no_argument,        NULL, '1' },
+    {
+        {"help", no_argument, NULL, 'h'},
+        {"fast", no_argument, NULL, 'f'},
+        {"local", no_argument, NULL, 'l'},
+        {"sigint", no_argument, NULL, 'c'},
+        {"blockinguart", no_argument, NULL, 'b'},
+        {"verbose", no_argument, NULL, 'v'},
+        {"timestamp", no_argument, NULL, 'T'},
+        {"interface", required_argument, NULL, 'i'},
+        {"fspath", required_argument, NULL, 'P'},
+        {"spiffskb", required_argument, NULL, 'S'},
+        {"littlefskb", required_argument, NULL, 'L'},
+        {"portshifter", required_argument, NULL, 's'},
+        {"once", no_argument, NULL, '1'},
 };
 
 void cleanup()
@@ -208,10 +208,10 @@ void control_c(int sig)
     user_exit = true;
 }
 
-int main(int argc, char* const argv [])
+int main(int argc, char* const argv[])
 {
     bool fast = false;
-    blocking_uart = false; // global
+    blocking_uart = false;  // global
 
     signal(SIGINT, control_c);
     signal(SIGTERM, control_c);
@@ -233,47 +233,47 @@ int main(int argc, char* const argv [])
         }
         switch (n)
         {
-        case 'h':
-            help(argv[0], EXIT_SUCCESS);
-            break;
-        case 'i':
-            host_interface = optarg;
-            break;
-        case 'l':
-            global_ipv4_netfmt = NO_GLOBAL_BINDING;
-            break;
-        case 's':
-            mock_port_shifter = atoi(optarg);
-            break;
-        case 'c':
-            ignore_sigint = true;
-            break;
-        case 'f':
-            fast = true;
-            break;
-        case 'S':
-            spiffs_kb = atoi(optarg);
-            break;
-        case 'L':
-            littlefs_kb = atoi(optarg);
-            break;
-        case 'P':
-            fspath = optarg;
-            break;
-        case 'b':
-            blocking_uart = true;
-            break;
-        case 'v':
-            mockdebug = true;
-            break;
-        case 'T':
-            serial_timestamp = true;
-            break;
-        case '1':
-            run_once = true;
-            break;
-        default:
-            help(argv[0], EXIT_FAILURE);
+            case 'h':
+                help(argv[0], EXIT_SUCCESS);
+                break;
+            case 'i':
+                host_interface = optarg;
+                break;
+            case 'l':
+                global_ipv4_netfmt = NO_GLOBAL_BINDING;
+                break;
+            case 's':
+                mock_port_shifter = atoi(optarg);
+                break;
+            case 'c':
+                ignore_sigint = true;
+                break;
+            case 'f':
+                fast = true;
+                break;
+            case 'S':
+                spiffs_kb = atoi(optarg);
+                break;
+            case 'L':
+                littlefs_kb = atoi(optarg);
+                break;
+            case 'P':
+                fspath = optarg;
+                break;
+            case 'b':
+                blocking_uart = true;
+                break;
+            case 'v':
+                mockdebug = true;
+                break;
+            case 'T':
+                serial_timestamp = true;
+                break;
+            case '1':
+                run_once = true;
+                break;
+            default:
+                help(argv[0], EXIT_FAILURE);
         }
     }
 
@@ -325,7 +325,7 @@ int main(int argc, char* const argv [])
         }
         if (!fast)
         {
-            usleep(1000);    // not 100% cpu, ~1000 loops per second
+            usleep(1000);  // not 100% cpu, ~1000 loops per second
         }
         loop();
         loop_end();
diff --git a/tests/host/common/ArduinoMainLittlefs.cpp b/tests/host/common/ArduinoMainLittlefs.cpp
index 36a685e50e..a9b7974cf5 100644
--- a/tests/host/common/ArduinoMainLittlefs.cpp
+++ b/tests/host/common/ArduinoMainLittlefs.cpp
@@ -16,4 +16,3 @@ void mock_stop_littlefs()
     }
     littlefs_mock = nullptr;
 }
-
diff --git a/tests/host/common/ArduinoMainSpiffs.cpp b/tests/host/common/ArduinoMainSpiffs.cpp
index 27e34baee7..8530a316f0 100644
--- a/tests/host/common/ArduinoMainSpiffs.cpp
+++ b/tests/host/common/ArduinoMainSpiffs.cpp
@@ -16,4 +16,3 @@ void mock_stop_spiffs()
     }
     spiffs_mock = nullptr;
 }
-
diff --git a/tests/host/common/ClientContextSocket.cpp b/tests/host/common/ClientContextSocket.cpp
index 063952ce24..70ec1d5216 100644
--- a/tests/host/common/ClientContextSocket.cpp
+++ b/tests/host/common/ClientContextSocket.cpp
@@ -31,13 +31,13 @@
 */
 // separated from lwIP to avoid type conflicts
 
-#include <unistd.h>
-#include <sys/socket.h>
-#include <netinet/tcp.h>
 #include <arpa/inet.h>
-#include <poll.h>
-#include <fcntl.h>
 #include <errno.h>
+#include <fcntl.h>
+#include <netinet/tcp.h>
+#include <poll.h>
+#include <sys/socket.h>
+#include <unistd.h>
 
 int mockSockSetup(int sock)
 {
@@ -135,7 +135,7 @@ ssize_t mockPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char
         }
 
         if (usersize == 0 && ccinbufsize)
-            // peekAvailable
+        // peekAvailable
         {
             return ccinbufsize;
         }
@@ -178,7 +178,6 @@ ssize_t mockWrite(int sock, const uint8_t* data, size_t size, int timeout_ms)
     size_t sent = 0;
     while (sent < size)
     {
-
         struct pollfd p;
         p.fd = sock;
         p.events = POLLOUT;
diff --git a/tests/host/common/ClientContextTools.cpp b/tests/host/common/ClientContextTools.cpp
index bf4bc348c0..2574c152d1 100644
--- a/tests/host/common/ClientContextTools.cpp
+++ b/tests/host/common/ClientContextTools.cpp
@@ -29,15 +29,15 @@
     DEALINGS WITH THE SOFTWARE.
 */
 
-#include <lwip/def.h>
-#include <lwip/tcp.h>
-#include <lwip/dns.h>
 #include <WiFiClient.h>
 #include <include/ClientContext.h>
+#include <lwip/def.h>
+#include <lwip/dns.h>
+#include <lwip/tcp.h>
 
-#include <netdb.h> // gethostbyname
+#include <netdb.h>  // gethostbyname
 
-err_t dns_gethostbyname(const char *hostname, ip_addr_t *addr, dns_found_callback found, void *callback_arg)
+err_t dns_gethostbyname(const char* hostname, ip_addr_t* addr, dns_found_callback found, void* callback_arg)
 {
     (void)callback_arg;
     (void)found;
diff --git a/tests/host/common/EEPROM.h b/tests/host/common/EEPROM.h
index 2e91bc10c1..faeafa590d 100644
--- a/tests/host/common/EEPROM.h
+++ b/tests/host/common/EEPROM.h
@@ -34,7 +34,7 @@
 
 class EEPROMClass
 {
-public:
+   public:
     EEPROMClass(uint32_t sector);
     EEPROMClass(void);
     ~EEPROMClass();
@@ -45,7 +45,7 @@ class EEPROMClass
     bool commit();
     void end();
 
-    template<typename T>
+    template <typename T>
     T& get(int const address, T& t)
     {
         if (address < 0 || address + sizeof(T) > _size)
@@ -59,7 +59,7 @@ class EEPROMClass
         return t;
     }
 
-    template<typename T>
+    template <typename T>
     const T& put(int const address, const T& t)
     {
         if (address < 0 || address + sizeof(T) > _size)
@@ -84,7 +84,7 @@ class EEPROMClass
         return read(address);
     }
 
-protected:
+   protected:
     size_t _size = 0;
     int _fd = -1;
 };
diff --git a/tests/host/common/HostWiring.cpp b/tests/host/common/HostWiring.cpp
index e5c84a40a6..b3c6b6eb9c 100644
--- a/tests/host/common/HostWiring.cpp
+++ b/tests/host/common/HostWiring.cpp
@@ -39,18 +39,36 @@
 
 void pinMode(uint8_t pin, uint8_t mode)
 {
-#define xxx(mode) case mode: m=STRHELPER(mode); break
+#define xxx(mode)            \
+    case mode:               \
+        m = STRHELPER(mode); \
+        break
     const char* m;
     switch (mode)
     {
-    case INPUT: m = "INPUT"; break;
-    case OUTPUT: m = "OUTPUT"; break;
-    case INPUT_PULLUP: m = "INPUT_PULLUP"; break;
-    case OUTPUT_OPEN_DRAIN: m = "OUTPUT_OPEN_DRAIN"; break;
-    case INPUT_PULLDOWN_16: m = "INPUT_PULLDOWN_16"; break;
-    case WAKEUP_PULLUP: m = "WAKEUP_PULLUP"; break;
-    case WAKEUP_PULLDOWN: m = "WAKEUP_PULLDOWN"; break;
-    default: m = "(special)";
+        case INPUT:
+            m = "INPUT";
+            break;
+        case OUTPUT:
+            m = "OUTPUT";
+            break;
+        case INPUT_PULLUP:
+            m = "INPUT_PULLUP";
+            break;
+        case OUTPUT_OPEN_DRAIN:
+            m = "OUTPUT_OPEN_DRAIN";
+            break;
+        case INPUT_PULLDOWN_16:
+            m = "INPUT_PULLDOWN_16";
+            break;
+        case WAKEUP_PULLUP:
+            m = "WAKEUP_PULLUP";
+            break;
+        case WAKEUP_PULLDOWN:
+            m = "WAKEUP_PULLDOWN";
+            break;
+        default:
+            m = "(special)";
     }
     VERBOSE("gpio%d: mode='%s'\n", pin, m);
 }
diff --git a/tests/host/common/MockDigital.cpp b/tests/host/common/MockDigital.cpp
index a94e6f2f20..1c63a3b8df 100644
--- a/tests/host/common/MockDigital.cpp
+++ b/tests/host/common/MockDigital.cpp
@@ -19,17 +19,17 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 #define ARDUINO_MAIN
-#include "wiring_private.h"
-#include "pins_arduino.h"
 #include "c_types.h"
+#include "core_esp8266_waveform.h"
 #include "eagle_soc.h"
 #include "ets_sys.h"
-#include "user_interface.h"
-#include "core_esp8266_waveform.h"
 #include "interrupts.h"
+#include "pins_arduino.h"
+#include "user_interface.h"
+#include "wiring_private.h"
 
-extern "C" {
-
+extern "C"
+{
     static uint8_t _mode[17];
     static uint8_t _gpio[17];
 
@@ -60,5 +60,4 @@ extern "C" {
             return 0;
         }
     }
-
 };
diff --git a/tests/host/common/MockEEPROM.cpp b/tests/host/common/MockEEPROM.cpp
index a4d7e4ac43..e28114a714 100644
--- a/tests/host/common/MockEEPROM.cpp
+++ b/tests/host/common/MockEEPROM.cpp
@@ -34,11 +34,11 @@
 
 #include <EEPROM.h>
 
-#include <sys/stat.h>
+#include <errno.h>
 #include <fcntl.h>
-#include <unistd.h>
+#include <sys/stat.h>
 #include <sys/types.h>
-#include <errno.h>
+#include <unistd.h>
 
 #define EEPROM_FILE_NAME "eeprom"
 
@@ -57,8 +57,7 @@ EEPROMClass::~EEPROMClass()
 void EEPROMClass::begin(size_t size)
 {
     _size = size;
-    if ((_fd = open(EEPROM_FILE_NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1
-            || ftruncate(_fd, size) == -1)
+    if ((_fd = open(EEPROM_FILE_NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1 || ftruncate(_fd, size) == -1)
     {
         fprintf(stderr, MOCK "EEPROM: cannot open/create '%s' for r/w: %s\n\r", EEPROM_FILE_NAME, strerror(errno));
         _fd = -1;
diff --git a/tests/host/common/MockEsp.cpp b/tests/host/common/MockEsp.cpp
index 09e6c9d000..f61333273f 100644
--- a/tests/host/common/MockEsp.cpp
+++ b/tests/host/common/MockEsp.cpp
@@ -103,7 +103,7 @@ uint32_t EspClass::getChipId()
 
 bool EspClass::checkFlashConfig(bool needsEquals)
 {
-    (void) needsEquals;
+    (void)needsEquals;
     return true;
 }
 
@@ -132,7 +132,7 @@ uint32_t EspClass::getFreeSketchSpace()
     return 4 * 1024 * 1024;
 }
 
-const char *EspClass::getSdkVersion()
+const char* EspClass::getSdkVersion()
 {
     return "2.5.0";
 }
@@ -163,7 +163,7 @@ void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag)
 
 bool EspClass::flashEraseSector(uint32_t sector)
 {
-    (void) sector;
+    (void)sector;
     return true;
 }
 
@@ -174,11 +174,11 @@ FlashMode_t EspClass::getFlashChipMode()
 
 FlashMode_t EspClass::magicFlashChipMode(uint8_t byte)
 {
-    (void) byte;
+    (void)byte;
     return FM_DOUT;
 }
 
-bool EspClass::flashWrite(uint32_t offset, const uint32_t *data, size_t size)
+bool EspClass::flashWrite(uint32_t offset, const uint32_t* data, size_t size)
 {
     (void)offset;
     (void)data;
@@ -186,7 +186,7 @@ bool EspClass::flashWrite(uint32_t offset, const uint32_t *data, size_t size)
     return true;
 }
 
-bool EspClass::flashWrite(uint32_t offset, const uint8_t *data, size_t size)
+bool EspClass::flashWrite(uint32_t offset, const uint8_t* data, size_t size)
 {
     (void)offset;
     (void)data;
@@ -194,7 +194,7 @@ bool EspClass::flashWrite(uint32_t offset, const uint8_t *data, size_t size)
     return true;
 }
 
-bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size)
+bool EspClass::flashRead(uint32_t offset, uint32_t* data, size_t size)
 {
     (void)offset;
     (void)data;
@@ -202,7 +202,7 @@ bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size)
     return true;
 }
 
-bool EspClass::flashRead(uint32_t offset, uint8_t *data, size_t size)
+bool EspClass::flashRead(uint32_t offset, uint8_t* data, size_t size)
 {
     (void)offset;
     (void)data;
@@ -214,22 +214,22 @@ uint32_t EspClass::magicFlashChipSize(uint8_t byte)
 {
     switch (byte & 0x0F)
     {
-    case 0x0: // 4 Mbit (512KB)
-        return (512_kB);
-    case 0x1: // 2 MBit (256KB)
-        return (256_kB);
-    case 0x2: // 8 MBit (1MB)
-        return (1_MB);
-    case 0x3: // 16 MBit (2MB)
-        return (2_MB);
-    case 0x4: // 32 MBit (4MB)
-        return (4_MB);
-    case 0x8: // 64 MBit (8MB)
-        return (8_MB);
-    case 0x9: // 128 MBit (16MB)
-        return (16_MB);
-    default: // fail?
-        return 0;
+        case 0x0:  // 4 Mbit (512KB)
+            return (512_kB);
+        case 0x1:  // 2 MBit (256KB)
+            return (256_kB);
+        case 0x2:  // 8 MBit (1MB)
+            return (1_MB);
+        case 0x3:  // 16 MBit (2MB)
+            return (2_MB);
+        case 0x4:  // 32 MBit (4MB)
+            return (4_MB);
+        case 0x8:  // 64 MBit (8MB)
+            return (8_MB);
+        case 0x9:  // 128 MBit (16MB)
+            return (16_MB);
+        default:  // fail?
+            return 0;
     }
 }
 
diff --git a/tests/host/common/MockTools.cpp b/tests/host/common/MockTools.cpp
index a41b7521bc..4a469053f6 100644
--- a/tests/host/common/MockTools.cpp
+++ b/tests/host/common/MockTools.cpp
@@ -34,7 +34,6 @@
 
 extern "C"
 {
-
     uint32_t lwip_htonl(uint32_t hostlong)
     {
         return htonl(hostlong);
@@ -74,9 +73,9 @@ extern "C"
         return len;
     }
 
-    void stack_thunk_add_ref() { }
-    void stack_thunk_del_ref() { }
-    void stack_thunk_repaint() { }
+    void stack_thunk_add_ref() {}
+    void stack_thunk_del_ref() {}
+    void stack_thunk_repaint() {}
 
     uint32_t stack_thunk_get_refcnt()
     {
@@ -98,15 +97,13 @@ extern "C"
     {
         return 0;
     }
-    void stack_thunk_dump_stack() { }
+    void stack_thunk_dump_stack() {}
 
     // Thunking macro
 #define make_stack_thunk(fcnToThunk)
-
 };
 
-void configTime(int timezone, int daylightOffset_sec,
-                const char* server1, const char* server2, const char* server3)
+void configTime(int timezone, int daylightOffset_sec, const char* server1, const char* server2, const char* server3)
 {
     (void)server1;
     (void)server2;
diff --git a/tests/host/common/MockUART.cpp b/tests/host/common/MockUART.cpp
index 19d234cbb9..eec93ca590 100644
--- a/tests/host/common/MockUART.cpp
+++ b/tests/host/common/MockUART.cpp
@@ -28,29 +28,29 @@
     is responsible for feeding the RX FIFO new data by calling uart_new_data().
 */
 
-#include <unistd.h> // write
-#include <sys/time.h> // gettimeofday
-#include <time.h> // localtime
+#include <sys/time.h>  // gettimeofday
+#include <time.h>      // localtime
+#include <unistd.h>    // write
 
 #include "Arduino.h"
 #include "uart.h"
 
 //#define UART_DISCARD_NEWEST
 
-extern "C" {
-
-    bool blocking_uart = true; // system default
+extern "C"
+{
+    bool blocking_uart = true;  // system default
 
     static int s_uart_debug_nr = UART1;
 
-    static uart_t *UART[2] = { NULL, NULL };
+    static uart_t* UART[2] = {NULL, NULL};
 
     struct uart_rx_buffer_
     {
         size_t size;
         size_t rpos;
         size_t wpos;
-        uint8_t * buffer;
+        uint8_t* buffer;
     };
 
     struct uart_
@@ -60,7 +60,7 @@ extern "C" {
         bool rx_enabled;
         bool tx_enabled;
         bool rx_overrun;
-        struct uart_rx_buffer_ * rx_buffer;
+        struct uart_rx_buffer_* rx_buffer;
     };
 
     bool serial_timestamp = false;
@@ -101,7 +101,7 @@ extern "C" {
     static void
     uart_handle_data(uart_t* uart, uint8_t data)
     {
-        struct uart_rx_buffer_ *rx_buffer = uart->rx_buffer;
+        struct uart_rx_buffer_* rx_buffer = uart->rx_buffer;
 
         size_t nextPos = (rx_buffer->wpos + 1) % rx_buffer->size;
         if (nextPos == rx_buffer->rpos)
@@ -135,7 +135,7 @@ extern "C" {
     }
 
     static size_t
-    uart_rx_available_unsafe(const struct uart_rx_buffer_ * rx_buffer)
+    uart_rx_available_unsafe(const struct uart_rx_buffer_* rx_buffer)
     {
         size_t ret = rx_buffer->wpos - rx_buffer->rpos;
 
@@ -222,9 +222,7 @@ extern "C" {
         {
             // pour sw buffer to user's buffer
             // get largest linear length from sw buffer
-            size_t chunk = uart->rx_buffer->rpos < uart->rx_buffer->wpos ?
-                           uart->rx_buffer->wpos - uart->rx_buffer->rpos :
-                           uart->rx_buffer->size - uart->rx_buffer->rpos;
+            size_t chunk = uart->rx_buffer->rpos < uart->rx_buffer->wpos ? uart->rx_buffer->wpos - uart->rx_buffer->rpos : uart->rx_buffer->size - uart->rx_buffer->rpos;
             if (ret + chunk > usersize)
             {
                 chunk = usersize - ret;
@@ -249,7 +247,7 @@ extern "C" {
             return uart->rx_buffer->size;
         }
 
-        uint8_t * new_buf = (uint8_t*)malloc(new_size);
+        uint8_t* new_buf = (uint8_t*)malloc(new_size);
         if (!new_buf)
         {
             return uart->rx_buffer->size;
@@ -266,7 +264,7 @@ extern "C" {
             new_wpos = 0;
         }
 
-        uint8_t * old_buf = uart->rx_buffer->buffer;
+        uint8_t* old_buf = uart->rx_buffer->buffer;
         uart->rx_buffer->rpos = 0;
         uart->rx_buffer->wpos = new_wpos;
         uart->rx_buffer->size = new_size;
@@ -326,7 +324,7 @@ extern "C" {
     void
     uart_wait_tx_empty(uart_t* uart)
     {
-        (void) uart;
+        (void)uart;
     }
 
     void
@@ -378,10 +376,10 @@ extern "C" {
     uart_t*
     uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, size_t rx_size, bool invert)
     {
-        (void) config;
-        (void) tx_pin;
-        (void) invert;
-        uart_t* uart = (uart_t*) malloc(sizeof(uart_t));
+        (void)config;
+        (void)tx_pin;
+        (void)invert;
+        uart_t* uart = (uart_t*)malloc(sizeof(uart_t));
         if (uart == NULL)
         {
             return NULL;
@@ -392,42 +390,42 @@ extern "C" {
 
         switch (uart->uart_nr)
         {
-        case UART0:
-            uart->rx_enabled = (mode != UART_TX_ONLY);
-            uart->tx_enabled = (mode != UART_RX_ONLY);
-            if (uart->rx_enabled)
-            {
-                struct uart_rx_buffer_ * rx_buffer = (struct uart_rx_buffer_ *)malloc(sizeof(struct uart_rx_buffer_));
-                if (rx_buffer == NULL)
+            case UART0:
+                uart->rx_enabled = (mode != UART_TX_ONLY);
+                uart->tx_enabled = (mode != UART_RX_ONLY);
+                if (uart->rx_enabled)
                 {
-                    free(uart);
-                    return NULL;
+                    struct uart_rx_buffer_* rx_buffer = (struct uart_rx_buffer_*)malloc(sizeof(struct uart_rx_buffer_));
+                    if (rx_buffer == NULL)
+                    {
+                        free(uart);
+                        return NULL;
+                    }
+                    rx_buffer->size = rx_size;  //var this
+                    rx_buffer->rpos = 0;
+                    rx_buffer->wpos = 0;
+                    rx_buffer->buffer = (uint8_t*)malloc(rx_buffer->size);
+                    if (rx_buffer->buffer == NULL)
+                    {
+                        free(rx_buffer);
+                        free(uart);
+                        return NULL;
+                    }
+                    uart->rx_buffer = rx_buffer;
                 }
-                rx_buffer->size = rx_size;//var this
-                rx_buffer->rpos = 0;
-                rx_buffer->wpos = 0;
-                rx_buffer->buffer = (uint8_t *)malloc(rx_buffer->size);
-                if (rx_buffer->buffer == NULL)
-                {
-                    free(rx_buffer);
-                    free(uart);
-                    return NULL;
-                }
-                uart->rx_buffer = rx_buffer;
-            }
-            break;
-
-        case UART1:
-            // Note: uart_interrupt_handler does not support RX on UART 1.
-            uart->rx_enabled = false;
-            uart->tx_enabled = (mode != UART_RX_ONLY);
-            break;
-
-        case UART_NO:
-        default:
-            // big fail!
-            free(uart);
-            return NULL;
+                break;
+
+            case UART1:
+                // Note: uart_interrupt_handler does not support RX on UART 1.
+                uart->rx_enabled = false;
+                uart->tx_enabled = (mode != UART_RX_ONLY);
+                break;
+
+            case UART_NO:
+            default:
+                // big fail!
+                free(uart);
+                return NULL;
         }
 
         uart_set_baudrate(uart, baudrate);
@@ -456,25 +454,25 @@ extern "C" {
     bool
     uart_swap(uart_t* uart, int tx_pin)
     {
-        (void) uart;
-        (void) tx_pin;
+        (void)uart;
+        (void)tx_pin;
         return true;
     }
 
     bool
     uart_set_tx(uart_t* uart, int tx_pin)
     {
-        (void) uart;
-        (void) tx_pin;
+        (void)uart;
+        (void)tx_pin;
         return true;
     }
 
     bool
     uart_set_pins(uart_t* uart, int tx, int rx)
     {
-        (void) uart;
-        (void) tx;
-        (void) rx;
+        (void)uart;
+        (void)tx;
+        (void)rx;
         return true;
     }
 
@@ -516,7 +514,7 @@ extern "C" {
     bool
     uart_has_rx_error(uart_t* uart)
     {
-        (void) uart;
+        (void)uart;
         return false;
     }
 
@@ -535,19 +533,17 @@ extern "C" {
     void
     uart_start_detect_baudrate(int uart_nr)
     {
-        (void) uart_nr;
+        (void)uart_nr;
     }
 
     int
     uart_detect_baudrate(int uart_nr)
     {
-        (void) uart_nr;
+        (void)uart_nr;
         return 115200;
     }
-
 };
 
-
 size_t uart_peek_available(uart_t* uart)
 {
     return 0;
@@ -561,4 +557,3 @@ void uart_peek_consume(uart_t* uart, size_t consume)
     (void)uart;
     (void)consume;
 }
-
diff --git a/tests/host/common/MockWiFiServer.cpp b/tests/host/common/MockWiFiServer.cpp
index 3c74927af0..791952fe06 100644
--- a/tests/host/common/MockWiFiServer.cpp
+++ b/tests/host/common/MockWiFiServer.cpp
@@ -74,4 +74,3 @@ WiFiClient WiFiServer::accept()
 
 #include <include/UdpContext.h>
 uint32_t UdpContext::staticMCastAddr = 0;
-
diff --git a/tests/host/common/MockWiFiServerSocket.cpp b/tests/host/common/MockWiFiServerSocket.cpp
index 3eff34bfff..4d1254fc73 100644
--- a/tests/host/common/MockWiFiServerSocket.cpp
+++ b/tests/host/common/MockWiFiServerSocket.cpp
@@ -32,12 +32,12 @@
 #include <WiFiServer.h>
 
 #include <arpa/inet.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+#include <errno.h>
+#include <fcntl.h>
 #include <poll.h>
+#include <sys/socket.h>
+#include <sys/types.h>
 #include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
 
 #define int2pcb(x) ((tcp_pcb*)(intptr_t)(x))
 #define pcb2int(x) ((int)(intptr_t)(x))
@@ -118,7 +118,6 @@ void WiFiServer::begin()
         exit(EXIT_FAILURE);
     }
 
-
     // store int into pointer
     _listen_pcb = int2pcb(sock);
 }
diff --git a/tests/host/common/MocklwIP.cpp b/tests/host/common/MocklwIP.cpp
index 0b98243217..0b5dfa502b 100644
--- a/tests/host/common/MocklwIP.cpp
+++ b/tests/host/common/MocklwIP.cpp
@@ -7,12 +7,11 @@ esp8266::AddressListImplementation::AddressList addrList;
 
 extern "C"
 {
-
     extern netif netif0;
 
     netif* netif_list = &netif0;
 
-    err_t dhcp_renew(struct netif *netif)
+    err_t dhcp_renew(struct netif* netif)
     {
         (void)netif;
         return ERR_OK;
@@ -27,7 +26,7 @@ extern "C"
         return IP_ADDR_ANY;
     }
 
-    err_t etharp_request(struct netif *netif, const ip4_addr_t *ipaddr)
+    err_t etharp_request(struct netif* netif, const ip4_addr_t* ipaddr)
     {
         (void)netif;
         (void)ipaddr;
@@ -40,14 +39,14 @@ extern "C"
         return ERR_OK;
     }
 
-    err_t igmp_joingroup_netif(struct netif *netif, const ip4_addr_t *groupaddr)
+    err_t igmp_joingroup_netif(struct netif* netif, const ip4_addr_t* groupaddr)
     {
         (void)netif;
         (void)groupaddr;
         return ERR_OK;
     }
 
-    err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr)
+    err_t igmp_leavegroup_netif(struct netif* netif, const ip4_addr_t* groupaddr)
     {
         (void)netif;
         (void)groupaddr;
@@ -60,5 +59,4 @@ extern "C"
         return &netif0;
     }
 
-
-} // extern "C"
+}  // extern "C"
diff --git a/tests/host/common/MocklwIP.h b/tests/host/common/MocklwIP.h
index 47c3d06c6e..19ded4b26a 100644
--- a/tests/host/common/MocklwIP.h
+++ b/tests/host/common/MocklwIP.h
@@ -4,12 +4,11 @@
 
 extern "C"
 {
-
-#include <user_interface.h>
 #include <lwip/netif.h>
+#include <user_interface.h>
 
     extern netif netif0;
 
-} // extern "C"
+}  // extern "C"
 
-#endif // __MOCKLWIP_H
+#endif  // __MOCKLWIP_H
diff --git a/tests/host/common/UdpContextSocket.cpp b/tests/host/common/UdpContextSocket.cpp
index 23f2883c11..ef2294d6b8 100644
--- a/tests/host/common/UdpContextSocket.cpp
+++ b/tests/host/common/UdpContextSocket.cpp
@@ -29,15 +29,15 @@
     DEALINGS WITH THE SOFTWARE.
 */
 
-#include <unistd.h>
-#include <sys/socket.h>
-#include <netinet/tcp.h>
 #include <arpa/inet.h>
-#include <poll.h>
-#include <fcntl.h>
-#include <errno.h>
 #include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
 #include <net/if.h>
+#include <netinet/tcp.h>
+#include <poll.h>
+#include <sys/socket.h>
+#include <unistd.h>
 
 int mockUDPSocket()
 {
@@ -82,13 +82,13 @@ bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
 
     // Filling server information
     servaddr.sin_family = AF_INET;
-    (void) dstaddr;
+    (void)dstaddr;
     //servaddr.sin_addr.s_addr = htonl(global_source_address);
     servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
     servaddr.sin_port = htons(mockport);
 
     // Bind the socket with the server address
-    if (bind(sock, (const struct sockaddr *)&servaddr, sizeof(servaddr)) < 0)
+    if (bind(sock, (const struct sockaddr*)&servaddr, sizeof(servaddr)) < 0)
     {
         fprintf(stderr, MOCK "UDP bind on port %d failed: %s\n", mockport, strerror(errno));
         return false;
@@ -100,7 +100,7 @@ bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
 
     if (!mcast)
     {
-        mcast = inet_addr("224.0.0.1");    // all hosts group
+        mcast = inet_addr("224.0.0.1");  // all hosts group
     }
     if (mcast)
     {
@@ -141,14 +141,13 @@ bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
     return true;
 }
 
-
 size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port)
 {
     struct sockaddr_storage addrbuf;
     socklen_t addrbufsize = std::min((socklen_t)sizeof(addrbuf), (socklen_t)16);
 
     size_t maxread = CCBUFSIZE - ccinbufsize;
-    ssize_t ret = ::recvfrom(sock, ccinbuf + ccinbufsize, maxread, 0/*flags*/, (sockaddr*)&addrbuf, &addrbufsize);
+    ssize_t ret = ::recvfrom(sock, ccinbuf + ccinbufsize, maxread, 0 /*flags*/, (sockaddr*)&addrbuf, &addrbufsize);
     if (ret == -1)
     {
         if (errno != EAGAIN)
@@ -177,8 +176,8 @@ size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& a
 
 size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
 {
-    (void) sock;
-    (void) timeout_ms;
+    (void)sock;
+    (void)timeout_ms;
     if (usersize > CCBUFSIZE)
     {
         fprintf(stderr, MOCK "CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
@@ -214,13 +213,13 @@ size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinb
 
 size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port)
 {
-    (void) timeout_ms;
+    (void)timeout_ms;
     // Filling server information
     struct sockaddr_in peer;
     peer.sin_family = AF_INET;
-    peer.sin_addr.s_addr = ipv4; //XXFIXME should use lwip_htonl?
+    peer.sin_addr.s_addr = ipv4;  //XXFIXME should use lwip_htonl?
     peer.sin_port = htons(port);
-    int ret = ::sendto(sock, data, size, 0/*flags*/, (const sockaddr*)&peer, sizeof(peer));
+    int ret = ::sendto(sock, data, size, 0 /*flags*/, (const sockaddr*)&peer, sizeof(peer));
     if (ret == -1)
     {
         fprintf(stderr, MOCK "UDPContext::write: write(%d): %s\n", sock, strerror(errno));
diff --git a/tests/host/common/WMath.cpp b/tests/host/common/WMath.cpp
index 8409941db4..dbfce37eb9 100644
--- a/tests/host/common/WMath.cpp
+++ b/tests/host/common/WMath.cpp
@@ -23,9 +23,10 @@
     $Id$
 */
 
-extern "C" {
-#include <stdlib.h>
+extern "C"
+{
 #include <stdint.h>
+#include <stdlib.h>
 }
 
 void randomSeed(unsigned long seed)
diff --git a/tests/host/common/c_types.h b/tests/host/common/c_types.h
index c57b64dd91..fcf7a889a1 100644
--- a/tests/host/common/c_types.h
+++ b/tests/host/common/c_types.h
@@ -31,46 +31,46 @@
 
 #ifndef _C_TYPES_H_
 #define _C_TYPES_H_
-#include <stdint.h>
-#include <stdbool.h>
 #include <stdarg.h>
+#include <stdbool.h>
+#include <stdint.h>
 #include <sys/cdefs.h>
 
-typedef signed char         sint8_t;
-typedef signed short        sint16_t;
-typedef signed long         sint32_t;
-typedef signed long long    sint64_t;
+typedef signed char sint8_t;
+typedef signed short sint16_t;
+typedef signed long sint32_t;
+typedef signed long long sint64_t;
 // CONFLICT typedef unsigned long long  u_int64_t;
-typedef float               real32_t;
-typedef double              real64_t;
+typedef float real32_t;
+typedef double real64_t;
 
 // CONFLICT typedef unsigned char       uint8;
-typedef unsigned char       u8;
-typedef signed char         sint8;
-typedef signed char         int8;
-typedef signed char         s8;
-typedef unsigned short      uint16;
-typedef unsigned short      u16;
-typedef signed short        sint16;
-typedef signed short        s16;
+typedef unsigned char u8;
+typedef signed char sint8;
+typedef signed char int8;
+typedef signed char s8;
+typedef unsigned short uint16;
+typedef unsigned short u16;
+typedef signed short sint16;
+typedef signed short s16;
 // CONFLICT typedef unsigned int        uint32;
-typedef unsigned int        u_int;
-typedef unsigned int        u32;
-typedef signed int          sint32;
-typedef signed int          s32;
-typedef int                 int32;
-typedef signed long long    sint64;
-typedef unsigned long long  uint64;
-typedef unsigned long long  u64;
-typedef float               real32;
-typedef double              real64;
+typedef unsigned int u_int;
+typedef unsigned int u32;
+typedef signed int sint32;
+typedef signed int s32;
+typedef int int32;
+typedef signed long long sint64;
+typedef unsigned long long uint64;
+typedef unsigned long long u64;
+typedef float real32;
+typedef double real64;
 
-#define __le16      u16
+#define __le16 u16
 
-#define LOCAL       static
+#define LOCAL static
 
 #ifndef NULL
-#define NULL (void *)0
+#define NULL (void*)0
 #endif /* NULL */
 
 /* probably should not put STATUS here */
@@ -83,10 +83,10 @@ typedef enum
     CANCEL,
 } STATUS;
 
-#define BIT(nr)                 (1UL << (nr))
+#define BIT(nr) (1UL << (nr))
 
-#define REG_SET_BIT(_r, _b)  (*(volatile uint32_t*)(_r) |= (_b))
-#define REG_CLR_BIT(_r, _b)  (*(volatile uint32_t*)(_r) &= ~(_b))
+#define REG_SET_BIT(_r, _b) (*(volatile uint32_t*)(_r) |= (_b))
+#define REG_CLR_BIT(_r, _b) (*(volatile uint32_t*)(_r) &= ~(_b))
 
 #define DMEM_ATTR __attribute__((section(".bss")))
 #define SHMEM_ATTR
@@ -94,9 +94,9 @@ typedef enum
 #ifdef ICACHE_FLASH
 #define __ICACHE_STRINGIZE_NX(A) #A
 #define __ICACHE_STRINGIZE(A) __ICACHE_STRINGIZE_NX(A)
-#define ICACHE_FLASH_ATTR   __attribute__((section("\".irom0.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
-#define IRAM_ATTR     __attribute__((section("\".iram.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
-#define ICACHE_RODATA_ATTR  __attribute__((section("\".irom.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
+#define ICACHE_FLASH_ATTR __attribute__((section("\".irom0.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
+#define IRAM_ATTR __attribute__((section("\".iram.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
+#define ICACHE_RODATA_ATTR __attribute__((section("\".irom.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
 #else
 #define ICACHE_FLASH_ATTR
 #define IRAM_ATTR
@@ -109,10 +109,9 @@ typedef enum
 #define STORE_ATTR __attribute__((aligned(4)))
 
 #ifndef __cplusplus
-#define BOOL            bool
-#define TRUE            true
-#define FALSE           false
-
+#define BOOL bool
+#define TRUE true
+#define FALSE false
 
 #endif /* !__cplusplus */
 
diff --git a/tests/host/common/flash_hal_mock.cpp b/tests/host/common/flash_hal_mock.cpp
index 10b9dba023..396d2c6362 100644
--- a/tests/host/common/flash_hal_mock.cpp
+++ b/tests/host/common/flash_hal_mock.cpp
@@ -12,13 +12,13 @@ extern "C"
     uint8_t* s_phys_data = nullptr;
 }
 
-int32_t flash_hal_read(uint32_t addr, uint32_t size, uint8_t *dst)
+int32_t flash_hal_read(uint32_t addr, uint32_t size, uint8_t* dst)
 {
     memcpy(dst, s_phys_data + addr, size);
     return 0;
 }
 
-int32_t flash_hal_write(uint32_t addr, uint32_t size, const uint8_t *src)
+int32_t flash_hal_write(uint32_t addr, uint32_t size, const uint8_t* src)
 {
     memcpy(s_phys_data + addr, src, size);
     return 0;
@@ -27,7 +27,7 @@ int32_t flash_hal_write(uint32_t addr, uint32_t size, const uint8_t *src)
 int32_t flash_hal_erase(uint32_t addr, uint32_t size)
 {
     if ((size & (FLASH_SECTOR_SIZE - 1)) != 0 ||
-            (addr & (FLASH_SECTOR_SIZE - 1)) != 0)
+        (addr & (FLASH_SECTOR_SIZE - 1)) != 0)
     {
         abort();
     }
diff --git a/tests/host/common/flash_hal_mock.h b/tests/host/common/flash_hal_mock.h
index af5035eaa5..bacd375e2e 100644
--- a/tests/host/common/flash_hal_mock.h
+++ b/tests/host/common/flash_hal_mock.h
@@ -12,8 +12,8 @@ extern "C"
     extern uint8_t* s_phys_data;
 }
 
-extern int32_t flash_hal_read(uint32_t addr, uint32_t size, uint8_t *dst);
-extern int32_t flash_hal_write(uint32_t addr, uint32_t size, const uint8_t *src);
+extern int32_t flash_hal_read(uint32_t addr, uint32_t size, uint8_t* dst);
+extern int32_t flash_hal_write(uint32_t addr, uint32_t size, const uint8_t* src);
 extern int32_t flash_hal_erase(uint32_t addr, uint32_t size);
 
 #endif
diff --git a/tests/host/common/include/ClientContext.h b/tests/host/common/include/ClientContext.h
index 0c06c889ff..357c0b5b8c 100644
--- a/tests/host/common/include/ClientContext.h
+++ b/tests/host/common/include/ClientContext.h
@@ -32,17 +32,15 @@ typedef void (*discard_cb_t)(void*, ClientContext*);
 
 class ClientContext
 {
-public:
-    ClientContext(tcp_pcb* pcb, discard_cb_t discard_cb, void* discard_cb_arg) :
-        _discard_cb(discard_cb), _discard_cb_arg(discard_cb_arg), _refcnt(0), _next(0),
-        _sync(::getDefaultPrivateGlobalSyncValue()), _sock(-1)
+   public:
+    ClientContext(tcp_pcb* pcb, discard_cb_t discard_cb, void* discard_cb_arg)
+        : _discard_cb(discard_cb), _discard_cb_arg(discard_cb_arg), _refcnt(0), _next(0), _sync(::getDefaultPrivateGlobalSyncValue()), _sock(-1)
     {
         (void)pcb;
     }
 
-    ClientContext(int sock) :
-        _discard_cb(nullptr), _discard_cb_arg(nullptr), _refcnt(0), _next(nullptr),
-        _sync(::getDefaultPrivateGlobalSyncValue()), _sock(sock)
+    ClientContext(int sock)
+        : _discard_cb(nullptr), _discard_cb_arg(nullptr), _refcnt(0), _next(nullptr), _sync(::getDefaultPrivateGlobalSyncValue()), _sock(sock)
     {
     }
 
@@ -199,7 +197,7 @@ class ClientContext
         return peekBytes(&c, 1) ? c : -1;
     }
 
-    size_t peekBytes(char *dst, size_t size)
+    size_t peekBytes(char* dst, size_t size)
     {
         ssize_t ret = mockPeekBytes(_sock, dst, size, _timeout_ms, _inbuf, _inbufsize);
         if (ret < 0)
@@ -223,7 +221,7 @@ class ClientContext
 
     uint8_t state()
     {
-        (void)getSize(); // read on socket to force detect closed peer
+        (void)getSize();  // read on socket to force detect closed peer
         return _sock >= 0 ? ESTABLISHED : CLOSED;
     }
 
@@ -240,9 +238,9 @@ class ClientContext
 
     void keepAlive(uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC, uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC, uint8_t count = TCP_DEFAULT_KEEPALIVE_COUNT)
     {
-        (void) idle_sec;
-        (void) intv_sec;
-        (void) count;
+        (void)idle_sec;
+        (void)intv_sec;
+        (void)count;
         mockverbose("TODO ClientContext::keepAlive()\n");
     }
 
@@ -309,8 +307,7 @@ class ClientContext
         _inbufsize -= consume;
     }
 
-private:
-
+   private:
     discard_cb_t _discard_cb = nullptr;
     void* _discard_cb_arg = nullptr;
 
@@ -324,8 +321,8 @@ class ClientContext
     int _sock = -1;
     int _timeout_ms = 5000;
 
-    char _inbuf [CCBUFSIZE];
+    char _inbuf[CCBUFSIZE];
     size_t _inbufsize = 0;
 };
 
-#endif //CLIENTCONTEXT_H
+#endif  //CLIENTCONTEXT_H
diff --git a/tests/host/common/include/UdpContext.h b/tests/host/common/include/UdpContext.h
index 725ce89ca1..238d068cfc 100644
--- a/tests/host/common/include/UdpContext.h
+++ b/tests/host/common/include/UdpContext.h
@@ -23,8 +23,8 @@
 
 #include <functional>
 
-#include <MocklwIP.h>
 #include <IPAddress.h>
+#include <MocklwIP.h>
 #include <PolledTimeout.h>
 
 class UdpContext;
@@ -36,11 +36,11 @@ extern netif netif0;
 
 class UdpContext
 {
-public:
-
+   public:
     typedef std::function<void(void)> rxhandler_t;
 
-    UdpContext(): _on_rx(nullptr), _refcnt(0)
+    UdpContext()
+        : _on_rx(nullptr), _refcnt(0)
     {
         _sock = mockUDPSocket();
     }
@@ -156,13 +156,13 @@ class UdpContext
     IPAddress getDestAddress()
     {
         mockverbose("TODO: implement UDP getDestAddress\n");
-        return 0; //ip_hdr* iphdr = GET_IP_HDR(_rx_buf);
+        return 0;  //ip_hdr* iphdr = GET_IP_HDR(_rx_buf);
     }
 
     uint16_t getLocalPort()
     {
         mockverbose("TODO: implement UDP getLocalPort\n");
-        return 0; //
+        return 0;  //
     }
 
     bool next()
@@ -191,7 +191,7 @@ class UdpContext
     int peek()
     {
         char c;
-        return mockUDPPeekBytes(_sock, &c, 1, _timeout_ms, _inbuf, _inbufsize) ? : -1;
+        return mockUDPPeekBytes(_sock, &c, 1, _timeout_ms, _inbuf, _inbufsize) ?: -1;
     }
 
     void flush()
@@ -218,7 +218,7 @@ class UdpContext
     err_t trySend(ip_addr_t* addr = 0, uint16_t port = 0, bool keepBuffer = true)
     {
         uint32_t dst = addr ? addr->addr : _dst.addr;
-        uint16_t dstport = port ? : _dstport;
+        uint16_t dstport = port ?: _dstport;
         size_t wrt = mockUDPWrite(_sock, (const uint8_t*)_outbuf, _outbufsize, _timeout_ms, dst, dstport);
         err_t ret = _outbufsize ? ERR_OK : ERR_ABRT;
         if (!keepBuffer || wrt == _outbufsize)
@@ -238,8 +238,7 @@ class UdpContext
         return trySend(addr, port, false) == ERR_OK;
     }
 
-    bool sendTimeout(ip_addr_t* addr, uint16_t port,
-                     esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
+    bool sendTimeout(ip_addr_t* addr, uint16_t port, esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
     {
         err_t err;
         esp8266::polledTimeout::oneShotFastMs timeout(timeoutMs);
@@ -262,12 +261,10 @@ class UdpContext
         }
     }
 
-public:
-
+   public:
     static uint32_t staticMCastAddr;
 
-private:
-
+   private:
     void translate_addr()
     {
         if (addrsize == 4)
@@ -291,9 +288,9 @@ class UdpContext
     ip_addr_t _dst;
     uint16_t _dstport;
 
-    char _inbuf [CCBUFSIZE];
+    char _inbuf[CCBUFSIZE];
     size_t _inbufsize = 0;
-    char _outbuf [CCBUFSIZE];
+    char _outbuf[CCBUFSIZE];
     size_t _outbufsize = 0;
 
     int _timeout_ms = 0;
@@ -302,11 +299,11 @@ class UdpContext
     uint8_t addr[16];
 };
 
-extern "C" inline err_t igmp_joingroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr)
+extern "C" inline err_t igmp_joingroup(const ip4_addr_t* ifaddr, const ip4_addr_t* groupaddr)
 {
     (void)ifaddr;
     UdpContext::staticMCastAddr = groupaddr->addr;
     return ERR_OK;
 }
 
-#endif//UDPCONTEXT_H
+#endif  //UDPCONTEXT_H
diff --git a/tests/host/common/littlefs_mock.cpp b/tests/host/common/littlefs_mock.cpp
index 8377eb3b80..a32b12cd79 100644
--- a/tests/host/common/littlefs_mock.cpp
+++ b/tests/host/common/littlefs_mock.cpp
@@ -16,20 +16,19 @@
     all copies or substantial portions of the Software.
 */
 
-
 #include "littlefs_mock.h"
-#include "spiffs_mock.h"
-#include "spiffs/spiffs.h"
-#include "debug.h"
+#include <LittleFS.h>
 #include <flash_utils.h>
 #include <stdlib.h>
-#include <LittleFS.h>
+#include "debug.h"
+#include "spiffs/spiffs.h"
+#include "spiffs_mock.h"
 
 #include <spiffs_api.h>
 
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 #include <unistd.h>
 #include <cerrno>
 #include "flash_hal_mock.h"
@@ -49,11 +48,11 @@ LittleFSMock::LittleFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, con
     fprintf(stderr, "LittleFS: %zd bytes\n", fs_size);
 
     m_fs.resize(fs_size, 0xff);
-    s_phys_addr  = 0;
-    s_phys_size  = static_cast<uint32_t>(fs_size);
-    s_phys_page  = static_cast<uint32_t>(fs_page);
+    s_phys_addr = 0;
+    s_phys_size = static_cast<uint32_t>(fs_size);
+    s_phys_page = static_cast<uint32_t>(fs_page);
     s_phys_block = static_cast<uint32_t>(fs_block);
-    s_phys_data  = m_fs.data();
+    s_phys_data = m_fs.data();
     reset();
 }
 
@@ -66,11 +65,11 @@ void LittleFSMock::reset()
 LittleFSMock::~LittleFSMock()
 {
     save();
-    s_phys_addr  = 0;
-    s_phys_size  = 0;
-    s_phys_page  = 0;
+    s_phys_addr = 0;
+    s_phys_size = 0;
+    s_phys_page = 0;
     s_phys_block = 0;
-    s_phys_data  = nullptr;
+    s_phys_data = nullptr;
     m_fs.resize(0);
     LittleFS = FS(FSImplPtr(nullptr));
 }
@@ -90,7 +89,7 @@ void LittleFSMock::load()
     }
 
     off_t flen = lseek(fs, 0, SEEK_END);
-    if (flen == (off_t) -1)
+    if (flen == (off_t)-1)
     {
         fprintf(stderr, "LittleFS: checking size of '%s': %s\n", m_storage.c_str(), strerror(errno));
         return;
diff --git a/tests/host/common/littlefs_mock.h b/tests/host/common/littlefs_mock.h
index 283a61f1b5..df6f47f785 100644
--- a/tests/host/common/littlefs_mock.h
+++ b/tests/host/common/littlefs_mock.h
@@ -19,22 +19,22 @@
 #ifndef littlefs_mock_hpp
 #define littlefs_mock_hpp
 
-#include <stdint.h>
+#include <FS.h>
 #include <stddef.h>
+#include <stdint.h>
 #include <vector>
-#include <FS.h>
 #include "flash_hal_mock.h"
 
 #define DEFAULT_LITTLEFS_FILE_NAME "littlefs.bin"
 
 class LittleFSMock
 {
-public:
+   public:
     LittleFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString);
     void reset();
     ~LittleFSMock();
 
-protected:
+   protected:
     void load();
     void save();
 
diff --git a/tests/host/common/md5.c b/tests/host/common/md5.c
index 195ffa0785..ea2c76c98e 100644
--- a/tests/host/common/md5.c
+++ b/tests/host/common/md5.c
@@ -32,23 +32,22 @@
     This file implements the MD5 algorithm as defined in RFC1321
 */
 
-#include <string.h>
-#include <stdint.h>
 #include <stddef.h>
+#include <stdint.h>
+#include <string.h>
 
 #define EXP_FUNC extern
 #define STDCALL
 
-#define MD5_SIZE    16
+#define MD5_SIZE 16
 
 typedef struct
 {
-    uint32_t state[4];        /* state (ABCD) */
-    uint32_t count[2];        /* number of bits, modulo 2^64 (lsb first) */
-    uint8_t buffer[64];       /* input buffer */
+    uint32_t state[4];  /* state (ABCD) */
+    uint32_t count[2];  /* number of bits, modulo 2^64 (lsb first) */
+    uint8_t buffer[64]; /* input buffer */
 } MD5_CTX;
 
-
 /*  Constants for MD5Transform routine.
 */
 #define S11 7
@@ -70,15 +69,14 @@ typedef struct
 
 /* ----- static functions ----- */
 static void MD5Transform(uint32_t state[4], const uint8_t block[64]);
-static void Encode(uint8_t *output, uint32_t *input, uint32_t len);
-static void Decode(uint32_t *output, const uint8_t *input, uint32_t len);
+static void Encode(uint8_t* output, uint32_t* input, uint32_t len);
+static void Decode(uint32_t* output, const uint8_t* input, uint32_t len);
 
 static const uint8_t PADDING[64] =
-{
-    0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
+    {
+        0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 
 /*  F, G, H and I are basic MD5 functions.
 */
@@ -88,35 +86,39 @@ static const uint8_t PADDING[64] =
 #define I(x, y, z) ((y) ^ ((x) | (~z)))
 
 /* ROTATE_LEFT rotates x left n bits.  */
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
+#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
 
 /*  FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
     Rotation is separate from addition to prevent recomputation.  */
-#define FF(a, b, c, d, x, s, ac) { \
-    (a) += F ((b), (c), (d)) + (x) + (uint32_t)(ac); \
-    (a) = ROTATE_LEFT ((a), (s)); \
-    (a) += (b); \
-  }
-#define GG(a, b, c, d, x, s, ac) { \
-    (a) += G ((b), (c), (d)) + (x) + (uint32_t)(ac); \
-    (a) = ROTATE_LEFT ((a), (s)); \
-    (a) += (b); \
-  }
-#define HH(a, b, c, d, x, s, ac) { \
-    (a) += H ((b), (c), (d)) + (x) + (uint32_t)(ac); \
-    (a) = ROTATE_LEFT ((a), (s)); \
-    (a) += (b); \
-  }
-#define II(a, b, c, d, x, s, ac) { \
-    (a) += I ((b), (c), (d)) + (x) + (uint32_t)(ac); \
-    (a) = ROTATE_LEFT ((a), (s)); \
-    (a) += (b); \
-  }
+#define FF(a, b, c, d, x, s, ac)                        \
+    {                                                   \
+        (a) += F((b), (c), (d)) + (x) + (uint32_t)(ac); \
+        (a) = ROTATE_LEFT((a), (s));                    \
+        (a) += (b);                                     \
+    }
+#define GG(a, b, c, d, x, s, ac)                        \
+    {                                                   \
+        (a) += G((b), (c), (d)) + (x) + (uint32_t)(ac); \
+        (a) = ROTATE_LEFT((a), (s));                    \
+        (a) += (b);                                     \
+    }
+#define HH(a, b, c, d, x, s, ac)                        \
+    {                                                   \
+        (a) += H((b), (c), (d)) + (x) + (uint32_t)(ac); \
+        (a) = ROTATE_LEFT((a), (s));                    \
+        (a) += (b);                                     \
+    }
+#define II(a, b, c, d, x, s, ac)                        \
+    {                                                   \
+        (a) += I((b), (c), (d)) + (x) + (uint32_t)(ac); \
+        (a) = ROTATE_LEFT((a), (s));                    \
+        (a) += (b);                                     \
+    }
 
 /**
     MD5 initialization - begins an MD5 operation, writing a new ctx.
 */
-EXP_FUNC void STDCALL MD5Init(MD5_CTX *ctx)
+EXP_FUNC void STDCALL MD5Init(MD5_CTX* ctx)
 {
     ctx->count[0] = ctx->count[1] = 0;
 
@@ -131,7 +133,7 @@ EXP_FUNC void STDCALL MD5Init(MD5_CTX *ctx)
 /**
     Accepts an array of octets as the next portion of the message.
 */
-EXP_FUNC void STDCALL MD5Update(MD5_CTX *ctx, const uint8_t * msg, int len)
+EXP_FUNC void STDCALL MD5Update(MD5_CTX* ctx, const uint8_t* msg, int len)
 {
     uint32_t x;
     int i, partLen;
@@ -173,7 +175,7 @@ EXP_FUNC void STDCALL MD5Update(MD5_CTX *ctx, const uint8_t * msg, int len)
 /**
     Return the 128-bit message digest into the user's array
 */
-EXP_FUNC void STDCALL MD5Final(uint8_t *digest, MD5_CTX *ctx)
+EXP_FUNC void STDCALL MD5Final(uint8_t* digest, MD5_CTX* ctx)
 {
     uint8_t bits[8];
     uint32_t x, padLen;
@@ -205,76 +207,76 @@ static void MD5Transform(uint32_t state[4], const uint8_t block[64])
     Decode(x, block, 64);
 
     /* Round 1 */
-    FF(a, b, c, d, x[ 0], S11, 0xd76aa478);  /* 1 */
-    FF(d, a, b, c, x[ 1], S12, 0xe8c7b756);  /* 2 */
-    FF(c, d, a, b, x[ 2], S13, 0x242070db);  /* 3 */
-    FF(b, c, d, a, x[ 3], S14, 0xc1bdceee);  /* 4 */
-    FF(a, b, c, d, x[ 4], S11, 0xf57c0faf);  /* 5 */
-    FF(d, a, b, c, x[ 5], S12, 0x4787c62a);  /* 6 */
-    FF(c, d, a, b, x[ 6], S13, 0xa8304613);  /* 7 */
-    FF(b, c, d, a, x[ 7], S14, 0xfd469501);  /* 8 */
-    FF(a, b, c, d, x[ 8], S11, 0x698098d8);  /* 9 */
-    FF(d, a, b, c, x[ 9], S12, 0x8b44f7af);  /* 10 */
-    FF(c, d, a, b, x[10], S13, 0xffff5bb1);  /* 11 */
-    FF(b, c, d, a, x[11], S14, 0x895cd7be);  /* 12 */
-    FF(a, b, c, d, x[12], S11, 0x6b901122);  /* 13 */
-    FF(d, a, b, c, x[13], S12, 0xfd987193);  /* 14 */
-    FF(c, d, a, b, x[14], S13, 0xa679438e);  /* 15 */
-    FF(b, c, d, a, x[15], S14, 0x49b40821);  /* 16 */
+    FF(a, b, c, d, x[0], S11, 0xd76aa478);  /* 1 */
+    FF(d, a, b, c, x[1], S12, 0xe8c7b756);  /* 2 */
+    FF(c, d, a, b, x[2], S13, 0x242070db);  /* 3 */
+    FF(b, c, d, a, x[3], S14, 0xc1bdceee);  /* 4 */
+    FF(a, b, c, d, x[4], S11, 0xf57c0faf);  /* 5 */
+    FF(d, a, b, c, x[5], S12, 0x4787c62a);  /* 6 */
+    FF(c, d, a, b, x[6], S13, 0xa8304613);  /* 7 */
+    FF(b, c, d, a, x[7], S14, 0xfd469501);  /* 8 */
+    FF(a, b, c, d, x[8], S11, 0x698098d8);  /* 9 */
+    FF(d, a, b, c, x[9], S12, 0x8b44f7af);  /* 10 */
+    FF(c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
+    FF(b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
+    FF(a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
+    FF(d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
+    FF(c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
+    FF(b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
 
     /* Round 2 */
-    GG(a, b, c, d, x[ 1], S21, 0xf61e2562);  /* 17 */
-    GG(d, a, b, c, x[ 6], S22, 0xc040b340);  /* 18 */
-    GG(c, d, a, b, x[11], S23, 0x265e5a51);  /* 19 */
-    GG(b, c, d, a, x[ 0], S24, 0xe9b6c7aa);  /* 20 */
-    GG(a, b, c, d, x[ 5], S21, 0xd62f105d);  /* 21 */
-    GG(d, a, b, c, x[10], S22,  0x2441453);  /* 22 */
-    GG(c, d, a, b, x[15], S23, 0xd8a1e681);  /* 23 */
-    GG(b, c, d, a, x[ 4], S24, 0xe7d3fbc8);  /* 24 */
-    GG(a, b, c, d, x[ 9], S21, 0x21e1cde6);  /* 25 */
-    GG(d, a, b, c, x[14], S22, 0xc33707d6);  /* 26 */
-    GG(c, d, a, b, x[ 3], S23, 0xf4d50d87);  /* 27 */
-    GG(b, c, d, a, x[ 8], S24, 0x455a14ed);  /* 28 */
-    GG(a, b, c, d, x[13], S21, 0xa9e3e905);  /* 29 */
-    GG(d, a, b, c, x[ 2], S22, 0xfcefa3f8);  /* 30 */
-    GG(c, d, a, b, x[ 7], S23, 0x676f02d9);  /* 31 */
-    GG(b, c, d, a, x[12], S24, 0x8d2a4c8a);  /* 32 */
+    GG(a, b, c, d, x[1], S21, 0xf61e2562);  /* 17 */
+    GG(d, a, b, c, x[6], S22, 0xc040b340);  /* 18 */
+    GG(c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
+    GG(b, c, d, a, x[0], S24, 0xe9b6c7aa);  /* 20 */
+    GG(a, b, c, d, x[5], S21, 0xd62f105d);  /* 21 */
+    GG(d, a, b, c, x[10], S22, 0x2441453);  /* 22 */
+    GG(c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
+    GG(b, c, d, a, x[4], S24, 0xe7d3fbc8);  /* 24 */
+    GG(a, b, c, d, x[9], S21, 0x21e1cde6);  /* 25 */
+    GG(d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
+    GG(c, d, a, b, x[3], S23, 0xf4d50d87);  /* 27 */
+    GG(b, c, d, a, x[8], S24, 0x455a14ed);  /* 28 */
+    GG(a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
+    GG(d, a, b, c, x[2], S22, 0xfcefa3f8);  /* 30 */
+    GG(c, d, a, b, x[7], S23, 0x676f02d9);  /* 31 */
+    GG(b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
 
     /* Round 3 */
-    HH(a, b, c, d, x[ 5], S31, 0xfffa3942);  /* 33 */
-    HH(d, a, b, c, x[ 8], S32, 0x8771f681);  /* 34 */
-    HH(c, d, a, b, x[11], S33, 0x6d9d6122);  /* 35 */
-    HH(b, c, d, a, x[14], S34, 0xfde5380c);  /* 36 */
-    HH(a, b, c, d, x[ 1], S31, 0xa4beea44);  /* 37 */
-    HH(d, a, b, c, x[ 4], S32, 0x4bdecfa9);  /* 38 */
-    HH(c, d, a, b, x[ 7], S33, 0xf6bb4b60);  /* 39 */
-    HH(b, c, d, a, x[10], S34, 0xbebfbc70);  /* 40 */
-    HH(a, b, c, d, x[13], S31, 0x289b7ec6);  /* 41 */
-    HH(d, a, b, c, x[ 0], S32, 0xeaa127fa);  /* 42 */
-    HH(c, d, a, b, x[ 3], S33, 0xd4ef3085);  /* 43 */
-    HH(b, c, d, a, x[ 6], S34,  0x4881d05);  /* 44 */
-    HH(a, b, c, d, x[ 9], S31, 0xd9d4d039);  /* 45 */
-    HH(d, a, b, c, x[12], S32, 0xe6db99e5);  /* 46 */
-    HH(c, d, a, b, x[15], S33, 0x1fa27cf8);  /* 47 */
-    HH(b, c, d, a, x[ 2], S34, 0xc4ac5665);  /* 48 */
+    HH(a, b, c, d, x[5], S31, 0xfffa3942);  /* 33 */
+    HH(d, a, b, c, x[8], S32, 0x8771f681);  /* 34 */
+    HH(c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
+    HH(b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
+    HH(a, b, c, d, x[1], S31, 0xa4beea44);  /* 37 */
+    HH(d, a, b, c, x[4], S32, 0x4bdecfa9);  /* 38 */
+    HH(c, d, a, b, x[7], S33, 0xf6bb4b60);  /* 39 */
+    HH(b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
+    HH(a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
+    HH(d, a, b, c, x[0], S32, 0xeaa127fa);  /* 42 */
+    HH(c, d, a, b, x[3], S33, 0xd4ef3085);  /* 43 */
+    HH(b, c, d, a, x[6], S34, 0x4881d05);   /* 44 */
+    HH(a, b, c, d, x[9], S31, 0xd9d4d039);  /* 45 */
+    HH(d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
+    HH(c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
+    HH(b, c, d, a, x[2], S34, 0xc4ac5665);  /* 48 */
 
     /* Round 4 */
-    II(a, b, c, d, x[ 0], S41, 0xf4292244);  /* 49 */
-    II(d, a, b, c, x[ 7], S42, 0x432aff97);  /* 50 */
-    II(c, d, a, b, x[14], S43, 0xab9423a7);  /* 51 */
-    II(b, c, d, a, x[ 5], S44, 0xfc93a039);  /* 52 */
-    II(a, b, c, d, x[12], S41, 0x655b59c3);  /* 53 */
-    II(d, a, b, c, x[ 3], S42, 0x8f0ccc92);  /* 54 */
-    II(c, d, a, b, x[10], S43, 0xffeff47d);  /* 55 */
-    II(b, c, d, a, x[ 1], S44, 0x85845dd1);  /* 56 */
-    II(a, b, c, d, x[ 8], S41, 0x6fa87e4f);  /* 57 */
-    II(d, a, b, c, x[15], S42, 0xfe2ce6e0);  /* 58 */
-    II(c, d, a, b, x[ 6], S43, 0xa3014314);  /* 59 */
-    II(b, c, d, a, x[13], S44, 0x4e0811a1);  /* 60 */
-    II(a, b, c, d, x[ 4], S41, 0xf7537e82);  /* 61 */
-    II(d, a, b, c, x[11], S42, 0xbd3af235);  /* 62 */
-    II(c, d, a, b, x[ 2], S43, 0x2ad7d2bb);  /* 63 */
-    II(b, c, d, a, x[ 9], S44, 0xeb86d391);  /* 64 */
+    II(a, b, c, d, x[0], S41, 0xf4292244);  /* 49 */
+    II(d, a, b, c, x[7], S42, 0x432aff97);  /* 50 */
+    II(c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
+    II(b, c, d, a, x[5], S44, 0xfc93a039);  /* 52 */
+    II(a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
+    II(d, a, b, c, x[3], S42, 0x8f0ccc92);  /* 54 */
+    II(c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
+    II(b, c, d, a, x[1], S44, 0x85845dd1);  /* 56 */
+    II(a, b, c, d, x[8], S41, 0x6fa87e4f);  /* 57 */
+    II(d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
+    II(c, d, a, b, x[6], S43, 0xa3014314);  /* 59 */
+    II(b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
+    II(a, b, c, d, x[4], S41, 0xf7537e82);  /* 61 */
+    II(d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
+    II(c, d, a, b, x[2], S43, 0x2ad7d2bb);  /* 63 */
+    II(b, c, d, a, x[9], S44, 0xeb86d391);  /* 64 */
 
     state[0] += a;
     state[1] += b;
@@ -286,7 +288,7 @@ static void MD5Transform(uint32_t state[4], const uint8_t block[64])
     Encodes input (uint32_t) into output (uint8_t). Assumes len is
      a multiple of 4.
 */
-static void Encode(uint8_t *output, uint32_t *input, uint32_t len)
+static void Encode(uint8_t* output, uint32_t* input, uint32_t len)
 {
     uint32_t i, j;
 
@@ -303,7 +305,7 @@ static void Encode(uint8_t *output, uint32_t *input, uint32_t len)
     Decodes input (uint8_t) into output (uint32_t). Assumes len is
      a multiple of 4.
 */
-static void Decode(uint32_t *output, const uint8_t *input, uint32_t len)
+static void Decode(uint32_t* output, const uint8_t* input, uint32_t len)
 {
     uint32_t i, j;
 
diff --git a/tests/host/common/mock.h b/tests/host/common/mock.h
index a0af18f5b7..e30a607cb7 100644
--- a/tests/host/common/mock.h
+++ b/tests/host/common/mock.h
@@ -30,7 +30,7 @@
 */
 
 #define CORE_MOCK 1
-#define MOCK "(mock) " // TODO: provide common logging API instead of adding this string everywhere?
+#define MOCK "(mock) "  // TODO: provide common logging API instead of adding this string everywhere?
 
 //
 
@@ -57,15 +57,15 @@
 #include <stddef.h>
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
-// TODO: #include <stdlib_noniso.h> ?
-char* itoa(int val, char *s, int radix);
-char* ltoa(long val, char *s, int radix);
-
+    // TODO: #include <stdlib_noniso.h> ?
+    char* itoa(int val, char* s, int radix);
+    char* ltoa(long val, char* s, int radix);
 
-size_t strlcat(char *dst, const char *src, size_t size);
-size_t strlcpy(char *dst, const char *src, size_t size);
+    size_t strlcat(char* dst, const char* src, size_t size);
+    size_t strlcpy(char* dst, const char* src, size_t size);
 
 #ifdef __cplusplus
 }
@@ -97,29 +97,30 @@ uint32_t esp_get_cycle_count();
 //
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 #include <osapi.h>
-int ets_printf(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
+    int ets_printf(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
 #define os_printf_plus printf
 #define ets_vsnprintf vsnprintf
-inline void ets_putc(char c)
-{
-    putchar(c);
-}
+    inline void ets_putc(char c)
+    {
+        putchar(c);
+    }
 
-int mockverbose(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
+    int mockverbose(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
 
-extern const char* host_interface; // cmdline parameter
-extern bool serial_timestamp;
-extern int mock_port_shifter;
-extern bool blocking_uart;
-extern uint32_t global_source_address; // 0 = INADDR_ANY by default
+    extern const char* host_interface;  // cmdline parameter
+    extern bool serial_timestamp;
+    extern int mock_port_shifter;
+    extern bool blocking_uart;
+    extern uint32_t global_source_address;  // 0 = INADDR_ANY by default
 
 #define NO_GLOBAL_BINDING 0xffffffff
-extern uint32_t global_ipv4_netfmt; // selected interface addresse to bind to
+    extern uint32_t global_ipv4_netfmt;  // selected interface addresse to bind to
 
-void loop_end();
+    void loop_end();
 
 #ifdef __cplusplus
 }
@@ -135,16 +136,17 @@ void loop_end();
 
 // uart
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
-void uart_new_data(const int uart_nr, uint8_t data);
+    void uart_new_data(const int uart_nr, uint8_t data);
 #ifdef __cplusplus
 }
 #endif
 
 // tcp
-int    mockSockSetup(int sock);
-int    mockConnect(uint32_t addr, int& sock, int port);
+int mockSockSetup(int sock);
+int mockConnect(uint32_t addr, int& sock, int port);
 ssize_t mockFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize);
 ssize_t mockPeekBytes(int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
 ssize_t mockRead(int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
@@ -177,4 +179,4 @@ void mock_stop_littlefs();
 
 //
 
-#endif // __cplusplus
+#endif  // __cplusplus
diff --git a/tests/host/common/noniso.c b/tests/host/common/noniso.c
index 5ef9c85774..718aadb5d4 100644
--- a/tests/host/common/noniso.c
+++ b/tests/host/common/noniso.c
@@ -13,19 +13,17 @@
     all copies or substantial portions of the Software.
 */
 
-
-#include <stdlib.h>
-#include <string.h>
+#include <math.h>
 #include <stdbool.h>
 #include <stdint.h>
-#include <math.h>
+#include <stdlib.h>
+#include <string.h>
 #include "stdlib_noniso.h"
 
-
 void reverse(char* begin, char* end)
 {
-    char *is = begin;
-    char *ie = end - 1;
+    char* is = begin;
+    char* ie = end - 1;
     while (is < ie)
     {
         char tmp = *ie;
@@ -96,18 +94,17 @@ char* itoa(int value, char* result, int base)
 
 int atoi(const char* s)
 {
-    return (int) atol(s);
+    return (int)atol(s);
 }
 
 long atol(const char* s)
 {
-    char * tmp;
+    char* tmp;
     return strtol(s, &tmp, 10);
 }
 
 double atof(const char* s)
 {
-    char * tmp;
+    char* tmp;
     return strtod(s, &tmp);
 }
-
diff --git a/tests/host/common/pins_arduino.h b/tests/host/common/pins_arduino.h
index 5c33e0f119..cba546a2bc 100644
--- a/tests/host/common/pins_arduino.h
+++ b/tests/host/common/pins_arduino.h
@@ -15,5 +15,4 @@
 #ifndef pins_arduino_h
 #define pins_arduino_h
 
-
 #endif /* pins_arduino_h */
diff --git a/tests/host/common/queue.h b/tests/host/common/queue.h
index 778241d2a5..1a96ce16b1 100644
--- a/tests/host/common/queue.h
+++ b/tests/host/common/queue.h
@@ -35,9 +35,9 @@
 */
 
 #ifndef _SYS_QUEUE_H_
-#define	_SYS_QUEUE_H_
+#define _SYS_QUEUE_H_
 
-#include <machine/ansi.h>	/* for __offsetof */
+#include <machine/ansi.h> /* for __offsetof */
 
 /*
     This file defines four types of data structures: singly-linked lists,
@@ -106,322 +106,390 @@
 /*
     Singly-linked List declarations.
 */
-#define	SLIST_HEAD(name, type)						\
-struct name {								\
-	struct type *slh_first;	/* first element */			\
-}
-
-#define	SLIST_HEAD_INITIALIZER(head)					\
-	{ NULL }
-
-#define	SLIST_ENTRY(type)						\
-struct {								\
-	struct type *sle_next;	/* next element */			\
-}
+#define SLIST_HEAD(name, type)                      \
+    struct name                                     \
+    {                                               \
+        struct type* slh_first; /* first element */ \
+    }
+
+#define SLIST_HEAD_INITIALIZER(head) \
+    {                                \
+        NULL                         \
+    }
+
+#define SLIST_ENTRY(type)                         \
+    struct                                        \
+    {                                             \
+        struct type* sle_next; /* next element */ \
+    }
 
 /*
     Singly-linked List functions.
 */
-#define	SLIST_EMPTY(head)	((head)->slh_first == NULL)
-
-#define	SLIST_FIRST(head)	((head)->slh_first)
-
-#define	SLIST_FOREACH(var, head, field)					\
-	for ((var) = SLIST_FIRST((head));				\
-	    (var);							\
-	    (var) = SLIST_NEXT((var), field))
-
-#define	SLIST_INIT(head) do {						\
-	SLIST_FIRST((head)) = NULL;					\
-} while (0)
-
-#define	SLIST_INSERT_AFTER(slistelm, elm, field) do {			\
-	SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field);	\
-	SLIST_NEXT((slistelm), field) = (elm);				\
-} while (0)
-
-#define	SLIST_INSERT_HEAD(head, elm, field) do {			\
-	SLIST_NEXT((elm), field) = SLIST_FIRST((head));			\
-	SLIST_FIRST((head)) = (elm);					\
-} while (0)
-
-#define	SLIST_NEXT(elm, field)	((elm)->field.sle_next)
-
-#define	SLIST_REMOVE(head, elm, type, field) do {			\
-	if (SLIST_FIRST((head)) == (elm)) {				\
-		SLIST_REMOVE_HEAD((head), field);			\
-	}								\
-	else {								\
-		struct type *curelm = SLIST_FIRST((head));		\
-		while (SLIST_NEXT(curelm, field) != (elm))		\
-			curelm = SLIST_NEXT(curelm, field);		\
-		SLIST_NEXT(curelm, field) =				\
-		    SLIST_NEXT(SLIST_NEXT(curelm, field), field);	\
-	}								\
-} while (0)
-
-#define	SLIST_REMOVE_HEAD(head, field) do {				\
-	SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field);	\
-} while (0)
+#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
+
+#define SLIST_FIRST(head) ((head)->slh_first)
+
+#define SLIST_FOREACH(var, head, field) \
+    for ((var) = SLIST_FIRST((head));   \
+         (var);                         \
+         (var) = SLIST_NEXT((var), field))
+
+#define SLIST_INIT(head)            \
+    do                              \
+    {                               \
+        SLIST_FIRST((head)) = NULL; \
+    } while (0)
+
+#define SLIST_INSERT_AFTER(slistelm, elm, field)                  \
+    do                                                            \
+    {                                                             \
+        SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \
+        SLIST_NEXT((slistelm), field) = (elm);                    \
+    } while (0)
+
+#define SLIST_INSERT_HEAD(head, elm, field)             \
+    do                                                  \
+    {                                                   \
+        SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
+        SLIST_FIRST((head)) = (elm);                    \
+    } while (0)
+
+#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
+
+#define SLIST_REMOVE(head, elm, type, field)                  \
+    do                                                        \
+    {                                                         \
+        if (SLIST_FIRST((head)) == (elm))                     \
+        {                                                     \
+            SLIST_REMOVE_HEAD((head), field);                 \
+        }                                                     \
+        else                                                  \
+        {                                                     \
+            struct type* curelm = SLIST_FIRST((head));        \
+            while (SLIST_NEXT(curelm, field) != (elm))        \
+                curelm = SLIST_NEXT(curelm, field);           \
+            SLIST_NEXT(curelm, field) =                       \
+                SLIST_NEXT(SLIST_NEXT(curelm, field), field); \
+        }                                                     \
+    } while (0)
+
+#define SLIST_REMOVE_HEAD(head, field)                                \
+    do                                                                \
+    {                                                                 \
+        SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
+    } while (0)
 
 /*
     Singly-linked Tail queue declarations.
 */
-#define	STAILQ_HEAD(name, type)						\
-struct name {								\
-	struct type *stqh_first;/* first element */			\
-	struct type **stqh_last;/* addr of last next element */		\
-}
-
-#define	STAILQ_HEAD_INITIALIZER(head)					\
-	{ NULL, &(head).stqh_first }
-
-#define	STAILQ_ENTRY(type)						\
-struct {								\
-	struct type *stqe_next;	/* next element */			\
-}
+#define STAILQ_HEAD(name, type)                                  \
+    struct name                                                  \
+    {                                                            \
+        struct type* stqh_first; /* first element */             \
+        struct type** stqh_last; /* addr of last next element */ \
+    }
+
+#define STAILQ_HEAD_INITIALIZER(head) \
+    {                                 \
+        NULL, &(head).stqh_first      \
+    }
+
+#define STAILQ_ENTRY(type)                         \
+    struct                                         \
+    {                                              \
+        struct type* stqe_next; /* next element */ \
+    }
 
 /*
     Singly-linked Tail queue functions.
 */
-#define	STAILQ_CONCAT(head1, head2) do {				\
-	if (!STAILQ_EMPTY((head2))) {					\
-		*(head1)->stqh_last = (head2)->stqh_first;		\
-		(head1)->stqh_last = (head2)->stqh_last;		\
-		STAILQ_INIT((head2));					\
-	}								\
-} while (0)
-
-#define	STAILQ_EMPTY(head)	((head)->stqh_first == NULL)
-
-#define	STAILQ_FIRST(head)	((head)->stqh_first)
-
-#define	STAILQ_FOREACH(var, head, field)				\
-	for((var) = STAILQ_FIRST((head));				\
-	   (var);							\
-	   (var) = STAILQ_NEXT((var), field))
-
-#define	STAILQ_INIT(head) do {						\
-	STAILQ_FIRST((head)) = NULL;					\
-	(head)->stqh_last = &STAILQ_FIRST((head));			\
-} while (0)
-
-#define	STAILQ_INSERT_AFTER(head, tqelm, elm, field) do {		\
-	if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
-		(head)->stqh_last = &STAILQ_NEXT((elm), field);		\
-	STAILQ_NEXT((tqelm), field) = (elm);				\
-} while (0)
-
-#define	STAILQ_INSERT_HEAD(head, elm, field) do {			\
-	if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL)	\
-		(head)->stqh_last = &STAILQ_NEXT((elm), field);		\
-	STAILQ_FIRST((head)) = (elm);					\
-} while (0)
-
-#define	STAILQ_INSERT_TAIL(head, elm, field) do {			\
-	STAILQ_NEXT((elm), field) = NULL;				\
-	*(head)->stqh_last = (elm);					\
-	(head)->stqh_last = &STAILQ_NEXT((elm), field);			\
-} while (0)
-
-#define	STAILQ_LAST(head, type, field)					\
-	(STAILQ_EMPTY((head)) ?						\
-		NULL :							\
-	        ((struct type *)					\
-		((char *)((head)->stqh_last) - __offsetof(struct type, field))))
-
-#define	STAILQ_NEXT(elm, field)	((elm)->field.stqe_next)
-
-#define	STAILQ_REMOVE(head, elm, type, field) do {			\
-	if (STAILQ_FIRST((head)) == (elm)) {				\
-		STAILQ_REMOVE_HEAD((head), field);			\
-	}								\
-	else {								\
-		struct type *curelm = STAILQ_FIRST((head));		\
-		while (STAILQ_NEXT(curelm, field) != (elm))		\
-			curelm = STAILQ_NEXT(curelm, field);		\
-		if ((STAILQ_NEXT(curelm, field) =			\
-		     STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL)\
-			(head)->stqh_last = &STAILQ_NEXT((curelm), field);\
-	}								\
-} while (0)
-
-#define	STAILQ_REMOVE_HEAD(head, field) do {				\
-	if ((STAILQ_FIRST((head)) =					\
-	     STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL)		\
-		(head)->stqh_last = &STAILQ_FIRST((head));		\
-} while (0)
-
-#define	STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do {			\
-	if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL)	\
-		(head)->stqh_last = &STAILQ_FIRST((head));		\
-} while (0)
+#define STAILQ_CONCAT(head1, head2)                    \
+    do                                                 \
+    {                                                  \
+        if (!STAILQ_EMPTY((head2)))                    \
+        {                                              \
+            *(head1)->stqh_last = (head2)->stqh_first; \
+            (head1)->stqh_last = (head2)->stqh_last;   \
+            STAILQ_INIT((head2));                      \
+        }                                              \
+    } while (0)
+
+#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
+
+#define STAILQ_FIRST(head) ((head)->stqh_first)
+
+#define STAILQ_FOREACH(var, head, field) \
+    for ((var) = STAILQ_FIRST((head));   \
+         (var);                          \
+         (var) = STAILQ_NEXT((var), field))
+
+#define STAILQ_INIT(head)                          \
+    do                                             \
+    {                                              \
+        STAILQ_FIRST((head)) = NULL;               \
+        (head)->stqh_last = &STAILQ_FIRST((head)); \
+    } while (0)
+
+#define STAILQ_INSERT_AFTER(head, tqelm, elm, field)                           \
+    do                                                                         \
+    {                                                                          \
+        if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL) \
+            (head)->stqh_last = &STAILQ_NEXT((elm), field);                    \
+        STAILQ_NEXT((tqelm), field) = (elm);                                   \
+    } while (0)
+
+#define STAILQ_INSERT_HEAD(head, elm, field)                            \
+    do                                                                  \
+    {                                                                   \
+        if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
+            (head)->stqh_last = &STAILQ_NEXT((elm), field);             \
+        STAILQ_FIRST((head)) = (elm);                                   \
+    } while (0)
+
+#define STAILQ_INSERT_TAIL(head, elm, field)            \
+    do                                                  \
+    {                                                   \
+        STAILQ_NEXT((elm), field) = NULL;               \
+        *(head)->stqh_last = (elm);                     \
+        (head)->stqh_last = &STAILQ_NEXT((elm), field); \
+    } while (0)
+
+#define STAILQ_LAST(head, type, field) \
+    (STAILQ_EMPTY((head)) ? NULL : ((struct type*)((char*)((head)->stqh_last) - __offsetof(struct type, field))))
+
+#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
+
+#define STAILQ_REMOVE(head, elm, type, field)                                 \
+    do                                                                        \
+    {                                                                         \
+        if (STAILQ_FIRST((head)) == (elm))                                    \
+        {                                                                     \
+            STAILQ_REMOVE_HEAD((head), field);                                \
+        }                                                                     \
+        else                                                                  \
+        {                                                                     \
+            struct type* curelm = STAILQ_FIRST((head));                       \
+            while (STAILQ_NEXT(curelm, field) != (elm))                       \
+                curelm = STAILQ_NEXT(curelm, field);                          \
+            if ((STAILQ_NEXT(curelm, field) =                                 \
+                     STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL) \
+                (head)->stqh_last = &STAILQ_NEXT((curelm), field);            \
+        }                                                                     \
+    } while (0)
+
+#define STAILQ_REMOVE_HEAD(head, field)                             \
+    do                                                              \
+    {                                                               \
+        if ((STAILQ_FIRST((head)) =                                 \
+                 STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
+            (head)->stqh_last = &STAILQ_FIRST((head));              \
+    } while (0)
+
+#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field)                      \
+    do                                                                  \
+    {                                                                   \
+        if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \
+            (head)->stqh_last = &STAILQ_FIRST((head));                  \
+    } while (0)
 
 /*
     List declarations.
 */
-#define	LIST_HEAD(name, type)						\
-struct name {								\
-	struct type *lh_first;	/* first element */			\
-}
-
-#define	LIST_HEAD_INITIALIZER(head)					\
-	{ NULL }
-
-#define	LIST_ENTRY(type)						\
-struct {								\
-	struct type *le_next;	/* next element */			\
-	struct type **le_prev;	/* address of previous next element */	\
-}
+#define LIST_HEAD(name, type)                      \
+    struct name                                    \
+    {                                              \
+        struct type* lh_first; /* first element */ \
+    }
+
+#define LIST_HEAD_INITIALIZER(head) \
+    {                               \
+        NULL                        \
+    }
+
+#define LIST_ENTRY(type)                                              \
+    struct                                                            \
+    {                                                                 \
+        struct type* le_next;  /* next element */                     \
+        struct type** le_prev; /* address of previous next element */ \
+    }
 
 /*
     List functions.
 */
 
-#define	LIST_EMPTY(head)	((head)->lh_first == NULL)
-
-#define	LIST_FIRST(head)	((head)->lh_first)
-
-#define	LIST_FOREACH(var, head, field)					\
-	for ((var) = LIST_FIRST((head));				\
-	    (var);							\
-	    (var) = LIST_NEXT((var), field))
-
-#define	LIST_INIT(head) do {						\
-	LIST_FIRST((head)) = NULL;					\
-} while (0)
-
-#define	LIST_INSERT_AFTER(listelm, elm, field) do {			\
-	if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
-		LIST_NEXT((listelm), field)->field.le_prev =		\
-		    &LIST_NEXT((elm), field);				\
-	LIST_NEXT((listelm), field) = (elm);				\
-	(elm)->field.le_prev = &LIST_NEXT((listelm), field);		\
-} while (0)
-
-#define	LIST_INSERT_BEFORE(listelm, elm, field) do {			\
-	(elm)->field.le_prev = (listelm)->field.le_prev;		\
-	LIST_NEXT((elm), field) = (listelm);				\
-	*(listelm)->field.le_prev = (elm);				\
-	(listelm)->field.le_prev = &LIST_NEXT((elm), field);		\
-} while (0)
-
-#define	LIST_INSERT_HEAD(head, elm, field) do {				\
-	if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL)	\
-		LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
-	LIST_FIRST((head)) = (elm);					\
-	(elm)->field.le_prev = &LIST_FIRST((head));			\
-} while (0)
-
-#define	LIST_NEXT(elm, field)	((elm)->field.le_next)
-
-#define	LIST_REMOVE(elm, field) do {					\
-	if (LIST_NEXT((elm), field) != NULL)				\
-		LIST_NEXT((elm), field)->field.le_prev = 		\
-		    (elm)->field.le_prev;				\
-	*(elm)->field.le_prev = LIST_NEXT((elm), field);		\
-} while (0)
+#define LIST_EMPTY(head) ((head)->lh_first == NULL)
+
+#define LIST_FIRST(head) ((head)->lh_first)
+
+#define LIST_FOREACH(var, head, field) \
+    for ((var) = LIST_FIRST((head));   \
+         (var);                        \
+         (var) = LIST_NEXT((var), field))
+
+#define LIST_INIT(head)            \
+    do                             \
+    {                              \
+        LIST_FIRST((head)) = NULL; \
+    } while (0)
+
+#define LIST_INSERT_AFTER(listelm, elm, field)                               \
+    do                                                                       \
+    {                                                                        \
+        if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL) \
+            LIST_NEXT((listelm), field)->field.le_prev =                     \
+                &LIST_NEXT((elm), field);                                    \
+        LIST_NEXT((listelm), field) = (elm);                                 \
+        (elm)->field.le_prev = &LIST_NEXT((listelm), field);                 \
+    } while (0)
+
+#define LIST_INSERT_BEFORE(listelm, elm, field)              \
+    do                                                       \
+    {                                                        \
+        (elm)->field.le_prev = (listelm)->field.le_prev;     \
+        LIST_NEXT((elm), field) = (listelm);                 \
+        *(listelm)->field.le_prev = (elm);                   \
+        (listelm)->field.le_prev = &LIST_NEXT((elm), field); \
+    } while (0)
+
+#define LIST_INSERT_HEAD(head, elm, field)                                \
+    do                                                                    \
+    {                                                                     \
+        if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL)       \
+            LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field); \
+        LIST_FIRST((head)) = (elm);                                       \
+        (elm)->field.le_prev = &LIST_FIRST((head));                       \
+    } while (0)
+
+#define LIST_NEXT(elm, field) ((elm)->field.le_next)
+
+#define LIST_REMOVE(elm, field)                          \
+    do                                                   \
+    {                                                    \
+        if (LIST_NEXT((elm), field) != NULL)             \
+            LIST_NEXT((elm), field)->field.le_prev =     \
+                (elm)->field.le_prev;                    \
+        *(elm)->field.le_prev = LIST_NEXT((elm), field); \
+    } while (0)
 
 /*
     Tail queue declarations.
 */
-#define	TAILQ_HEAD(name, type)						\
-struct name {								\
-	struct type *tqh_first;	/* first element */			\
-	struct type **tqh_last;	/* addr of last next element */		\
-}
-
-#define	TAILQ_HEAD_INITIALIZER(head)					\
-	{ NULL, &(head).tqh_first }
-
-#define	TAILQ_ENTRY(type)						\
-struct {								\
-	struct type *tqe_next;	/* next element */			\
-	struct type **tqe_prev;	/* address of previous next element */	\
-}
+#define TAILQ_HEAD(name, type)                                  \
+    struct name                                                 \
+    {                                                           \
+        struct type* tqh_first; /* first element */             \
+        struct type** tqh_last; /* addr of last next element */ \
+    }
+
+#define TAILQ_HEAD_INITIALIZER(head) \
+    {                                \
+        NULL, &(head).tqh_first      \
+    }
+
+#define TAILQ_ENTRY(type)                                              \
+    struct                                                             \
+    {                                                                  \
+        struct type* tqe_next;  /* next element */                     \
+        struct type** tqe_prev; /* address of previous next element */ \
+    }
 
 /*
     Tail queue functions.
 */
-#define	TAILQ_CONCAT(head1, head2, field) do {				\
-	if (!TAILQ_EMPTY(head2)) {					\
-		*(head1)->tqh_last = (head2)->tqh_first;		\
-		(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last;	\
-		(head1)->tqh_last = (head2)->tqh_last;			\
-		TAILQ_INIT((head2));					\
-	}								\
-} while (0)
-
-#define	TAILQ_EMPTY(head)	((head)->tqh_first == NULL)
-
-#define	TAILQ_FIRST(head)	((head)->tqh_first)
-
-#define	TAILQ_FOREACH(var, head, field)					\
-	for ((var) = TAILQ_FIRST((head));				\
-	    (var);							\
-	    (var) = TAILQ_NEXT((var), field))
-
-#define	TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
-	for ((var) = TAILQ_LAST((head), headname);			\
-	    (var);							\
-	    (var) = TAILQ_PREV((var), headname, field))
-
-#define	TAILQ_INIT(head) do {						\
-	TAILQ_FIRST((head)) = NULL;					\
-	(head)->tqh_last = &TAILQ_FIRST((head));			\
-} while (0)
-
-#define	TAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
-	if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
-		TAILQ_NEXT((elm), field)->field.tqe_prev = 		\
-		    &TAILQ_NEXT((elm), field);				\
-	else								\
-		(head)->tqh_last = &TAILQ_NEXT((elm), field);		\
-	TAILQ_NEXT((listelm), field) = (elm);				\
-	(elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field);		\
-} while (0)
-
-#define	TAILQ_INSERT_BEFORE(listelm, elm, field) do {			\
-	(elm)->field.tqe_prev = (listelm)->field.tqe_prev;		\
-	TAILQ_NEXT((elm), field) = (listelm);				\
-	*(listelm)->field.tqe_prev = (elm);				\
-	(listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field);		\
-} while (0)
-
-#define	TAILQ_INSERT_HEAD(head, elm, field) do {			\
-	if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL)	\
-		TAILQ_FIRST((head))->field.tqe_prev =			\
-		    &TAILQ_NEXT((elm), field);				\
-	else								\
-		(head)->tqh_last = &TAILQ_NEXT((elm), field);		\
-	TAILQ_FIRST((head)) = (elm);					\
-	(elm)->field.tqe_prev = &TAILQ_FIRST((head));			\
-} while (0)
-
-#define	TAILQ_INSERT_TAIL(head, elm, field) do {			\
-	TAILQ_NEXT((elm), field) = NULL;				\
-	(elm)->field.tqe_prev = (head)->tqh_last;			\
-	*(head)->tqh_last = (elm);					\
-	(head)->tqh_last = &TAILQ_NEXT((elm), field);			\
-} while (0)
-
-#define	TAILQ_LAST(head, headname)					\
-	(*(((struct headname *)((head)->tqh_last))->tqh_last))
-
-#define	TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
-
-#define	TAILQ_PREV(elm, headname, field)				\
-	(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
-
-#define	TAILQ_REMOVE(head, elm, field) do {				\
-	if ((TAILQ_NEXT((elm), field)) != NULL)				\
-		TAILQ_NEXT((elm), field)->field.tqe_prev = 		\
-		    (elm)->field.tqe_prev;				\
-	else								\
-		(head)->tqh_last = (elm)->field.tqe_prev;		\
-	*(elm)->field.tqe_prev = TAILQ_NEXT((elm), field);		\
-} while (0)
-
+#define TAILQ_CONCAT(head1, head2, field)                           \
+    do                                                              \
+    {                                                               \
+        if (!TAILQ_EMPTY(head2))                                    \
+        {                                                           \
+            *(head1)->tqh_last = (head2)->tqh_first;                \
+            (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
+            (head1)->tqh_last = (head2)->tqh_last;                  \
+            TAILQ_INIT((head2));                                    \
+        }                                                           \
+    } while (0)
+
+#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
+
+#define TAILQ_FIRST(head) ((head)->tqh_first)
+
+#define TAILQ_FOREACH(var, head, field) \
+    for ((var) = TAILQ_FIRST((head));   \
+         (var);                         \
+         (var) = TAILQ_NEXT((var), field))
+
+#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
+    for ((var) = TAILQ_LAST((head), headname);            \
+         (var);                                           \
+         (var) = TAILQ_PREV((var), headname, field))
+
+#define TAILQ_INIT(head)                         \
+    do                                           \
+    {                                            \
+        TAILQ_FIRST((head)) = NULL;              \
+        (head)->tqh_last = &TAILQ_FIRST((head)); \
+    } while (0)
+
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field)                          \
+    do                                                                         \
+    {                                                                          \
+        if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL) \
+            TAILQ_NEXT((elm), field)->field.tqe_prev =                         \
+                &TAILQ_NEXT((elm), field);                                     \
+        else                                                                   \
+            (head)->tqh_last = &TAILQ_NEXT((elm), field);                      \
+        TAILQ_NEXT((listelm), field) = (elm);                                  \
+        (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field);                 \
+    } while (0)
+
+#define TAILQ_INSERT_BEFORE(listelm, elm, field)               \
+    do                                                         \
+    {                                                          \
+        (elm)->field.tqe_prev = (listelm)->field.tqe_prev;     \
+        TAILQ_NEXT((elm), field) = (listelm);                  \
+        *(listelm)->field.tqe_prev = (elm);                    \
+        (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
+    } while (0)
+
+#define TAILQ_INSERT_HEAD(head, elm, field)                           \
+    do                                                                \
+    {                                                                 \
+        if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
+            TAILQ_FIRST((head))->field.tqe_prev =                     \
+                &TAILQ_NEXT((elm), field);                            \
+        else                                                          \
+            (head)->tqh_last = &TAILQ_NEXT((elm), field);             \
+        TAILQ_FIRST((head)) = (elm);                                  \
+        (elm)->field.tqe_prev = &TAILQ_FIRST((head));                 \
+    } while (0)
+
+#define TAILQ_INSERT_TAIL(head, elm, field)           \
+    do                                                \
+    {                                                 \
+        TAILQ_NEXT((elm), field) = NULL;              \
+        (elm)->field.tqe_prev = (head)->tqh_last;     \
+        *(head)->tqh_last = (elm);                    \
+        (head)->tqh_last = &TAILQ_NEXT((elm), field); \
+    } while (0)
+
+#define TAILQ_LAST(head, headname) \
+    (*(((struct headname*)((head)->tqh_last))->tqh_last))
+
+#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+
+#define TAILQ_PREV(elm, headname, field) \
+    (*(((struct headname*)((elm)->field.tqe_prev))->tqh_last))
+
+#define TAILQ_REMOVE(head, elm, field)                     \
+    do                                                     \
+    {                                                      \
+        if ((TAILQ_NEXT((elm), field)) != NULL)            \
+            TAILQ_NEXT((elm), field)->field.tqe_prev =     \
+                (elm)->field.tqe_prev;                     \
+        else                                               \
+            (head)->tqh_last = (elm)->field.tqe_prev;      \
+        *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \
+    } while (0)
 
 #ifdef _KERNEL
 
@@ -432,17 +500,17 @@ struct {								\
 
 struct quehead
 {
-    struct quehead *qh_link;
-    struct quehead *qh_rlink;
+    struct quehead* qh_link;
+    struct quehead* qh_rlink;
 };
 
-#ifdef	__GNUC__
+#ifdef __GNUC__
 
 static __inline void
-insque(void *a, void *b)
+insque(void* a, void* b)
 {
-    struct quehead *element = (struct quehead *)a,
-                    *head = (struct quehead *)b;
+    struct quehead *element = (struct quehead*)a,
+                   *head = (struct quehead*)b;
 
     element->qh_link = head->qh_link;
     element->qh_rlink = head;
@@ -451,9 +519,9 @@ insque(void *a, void *b)
 }
 
 static __inline void
-remque(void *a)
+remque(void* a)
 {
-    struct quehead *element = (struct quehead *)a;
+    struct quehead* element = (struct quehead*)a;
 
     element->qh_link->qh_rlink = element->qh_rlink;
     element->qh_rlink->qh_link = element->qh_link;
@@ -462,8 +530,8 @@ remque(void *a)
 
 #else /* !__GNUC__ */
 
-void	insque(void *a, void *b);
-void	remque(void *a);
+void insque(void* a, void* b);
+void remque(void* a);
 
 #endif /* __GNUC__ */
 
diff --git a/tests/host/common/sdfs_mock.cpp b/tests/host/common/sdfs_mock.cpp
index 2673ab318f..26143ea4d7 100644
--- a/tests/host/common/sdfs_mock.cpp
+++ b/tests/host/common/sdfs_mock.cpp
@@ -18,4 +18,4 @@
 
 #define SDSIZE 16LL
 uint64_t _sdCardSizeB = 0;
-uint8_t *_sdCard = nullptr;
+uint8_t* _sdCard = nullptr;
diff --git a/tests/host/common/sdfs_mock.h b/tests/host/common/sdfs_mock.h
index 08a196a846..0b357fa30e 100644
--- a/tests/host/common/sdfs_mock.h
+++ b/tests/host/common/sdfs_mock.h
@@ -16,14 +16,14 @@
 #ifndef sdfs_mock_hpp
 #define sdfs_mock_hpp
 
-#include <stdint.h>
+#include <FS.h>
 #include <stddef.h>
+#include <stdint.h>
 #include <vector>
-#include <FS.h>
 
 class SDFSMock
 {
-public:
+   public:
     SDFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString)
     {
         (void)fs_size;
@@ -31,19 +31,22 @@ class SDFSMock
         (void)fs_page;
         (void)storage;
     }
-    void reset() { }
-    ~SDFSMock() { }
+    void reset() {}
+    ~SDFSMock() {}
 };
 
 extern uint64_t _sdCardSizeB;
-extern uint8_t *_sdCard;
-
-#define SDFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage) \
-    SDFS.end(); \
-    SDFSMock sdfs_mock(size_kb * 1024, block_kb * 1024, page_b, storage); free(_sdCard); \
-    _sdCardSizeB = size_kb ? 16 * 1024 * 1024 : 0; \
-    if (_sdCardSizeB) _sdCard = (uint8_t*)calloc(_sdCardSizeB, 1); \
-    else _sdCard = nullptr; \
+extern uint8_t* _sdCard;
+
+#define SDFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage)             \
+    SDFS.end();                                                           \
+    SDFSMock sdfs_mock(size_kb * 1024, block_kb * 1024, page_b, storage); \
+    free(_sdCard);                                                        \
+    _sdCardSizeB = size_kb ? 16 * 1024 * 1024 : 0;                        \
+    if (_sdCardSizeB)                                                     \
+        _sdCard = (uint8_t*)calloc(_sdCardSizeB, 1);                      \
+    else                                                                  \
+        _sdCard = nullptr;                                                \
     SDFS.setConfig(SDFSConfig().setAutoFormat(true));
 #define SDFS_MOCK_RESET() sdfs_mock.reset()
 
diff --git a/tests/host/common/spiffs_mock.cpp b/tests/host/common/spiffs_mock.cpp
index 716b84b60f..eaccb41898 100644
--- a/tests/host/common/spiffs_mock.cpp
+++ b/tests/host/common/spiffs_mock.cpp
@@ -13,18 +13,17 @@
     all copies or substantial portions of the Software.
 */
 
-
 #include "spiffs_mock.h"
-#include "spiffs/spiffs.h"
-#include "debug.h"
 #include <flash_utils.h>
 #include <stdlib.h>
+#include "debug.h"
+#include "spiffs/spiffs.h"
 
 #include <spiffs_api.h>
 
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 #include <unistd.h>
 #include <cerrno>
 
@@ -48,11 +47,11 @@ SpiffsMock::SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const S
     fprintf(stderr, "SPIFFS: %zd bytes\n", fs_size);
 
     m_fs.resize(fs_size, 0xff);
-    s_phys_addr  = 0;
-    s_phys_size  = static_cast<uint32_t>(fs_size);
-    s_phys_page  = static_cast<uint32_t>(fs_page);
+    s_phys_addr = 0;
+    s_phys_size = static_cast<uint32_t>(fs_size);
+    s_phys_page = static_cast<uint32_t>(fs_page);
     s_phys_block = static_cast<uint32_t>(fs_block);
-    s_phys_data  = m_fs.data();
+    s_phys_data = m_fs.data();
     reset();
 }
 
@@ -65,11 +64,11 @@ void SpiffsMock::reset()
 SpiffsMock::~SpiffsMock()
 {
     save();
-    s_phys_addr  = 0;
-    s_phys_size  = 0;
-    s_phys_page  = 0;
+    s_phys_addr = 0;
+    s_phys_size = 0;
+    s_phys_page = 0;
     s_phys_block = 0;
-    s_phys_data  = nullptr;
+    s_phys_data = nullptr;
     m_fs.resize(0);
     SPIFFS = FS(FSImplPtr(nullptr));
 }
@@ -89,7 +88,7 @@ void SpiffsMock::load()
     }
 
     off_t flen = lseek(fs, 0, SEEK_END);
-    if (flen == (off_t) -1)
+    if (flen == (off_t)-1)
     {
         fprintf(stderr, "SPIFFS: checking size of '%s': %s\n", m_storage.c_str(), strerror(errno));
         return;
@@ -144,4 +143,3 @@ void SpiffsMock::save()
 }
 
 #pragma GCC diagnostic pop
-
diff --git a/tests/host/common/spiffs_mock.h b/tests/host/common/spiffs_mock.h
index 12a97f2851..2cf16c7d47 100644
--- a/tests/host/common/spiffs_mock.h
+++ b/tests/host/common/spiffs_mock.h
@@ -16,22 +16,22 @@
 #ifndef spiffs_mock_hpp
 #define spiffs_mock_hpp
 
-#include <stdint.h>
+#include <FS.h>
 #include <stddef.h>
+#include <stdint.h>
 #include <vector>
-#include <FS.h>
 #include "flash_hal_mock.h"
 
 #define DEFAULT_SPIFFS_FILE_NAME "spiffs.bin"
 
 class SpiffsMock
 {
-public:
+   public:
     SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString);
     void reset();
     ~SpiffsMock();
 
-protected:
+   protected:
     void load();
     void save();
 
diff --git a/tests/host/common/strl.cpp b/tests/host/common/strl.cpp
index 529b9a1edb..95c98913d6 100644
--- a/tests/host/common/strl.cpp
+++ b/tests/host/common/strl.cpp
@@ -5,25 +5,24 @@
     '_cups_strlcat()' - Safely concatenate two strings.
 */
 
-size_t                  /* O - Length of string */
-strlcat(char       *dst,        /* O - Destination string */
-        const char *src,      /* I - Source string */
-        size_t     size)      /* I - Size of destination string buffer */
+size_t                   /* O - Length of string */
+strlcat(char* dst,       /* O - Destination string */
+        const char* src, /* I - Source string */
+        size_t size)     /* I - Size of destination string buffer */
 {
-    size_t    srclen;         /* Length of source string */
-    size_t    dstlen;         /* Length of destination string */
-
+    size_t srclen; /* Length of source string */
+    size_t dstlen; /* Length of destination string */
 
     /*
         Figure out how much room is left...
     */
 
     dstlen = strlen(dst);
-    size   -= dstlen + 1;
+    size -= dstlen + 1;
 
     if (!size)
     {
-        return (dstlen);    /* No room, return immediately... */
+        return (dstlen); /* No room, return immediately... */
     }
 
     /*
@@ -53,19 +52,18 @@ strlcat(char       *dst,        /* O - Destination string */
     '_cups_strlcpy()' - Safely copy two strings.
 */
 
-size_t                  /* O - Length of string */
-strlcpy(char       *dst,        /* O - Destination string */
-        const char *src,      /* I - Source string */
-        size_t      size)     /* I - Size of destination string buffer */
+size_t                   /* O - Length of string */
+strlcpy(char* dst,       /* O - Destination string */
+        const char* src, /* I - Source string */
+        size_t size)     /* I - Size of destination string buffer */
 {
-    size_t    srclen;         /* Length of source string */
-
+    size_t srclen; /* Length of source string */
 
     /*
         Figure out how much room is needed...
     */
 
-    size --;
+    size--;
 
     srclen = strlen(src);
 
diff --git a/tests/host/common/user_interface.cpp b/tests/host/common/user_interface.cpp
index 2c9bde2453..92313e7f49 100644
--- a/tests/host/common/user_interface.cpp
+++ b/tests/host/common/user_interface.cpp
@@ -31,19 +31,19 @@
 
 #include <lwip/def.h>
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/types.h>
+#include <arpa/inet.h>
 #include <ifaddrs.h>
 #include <netinet/in.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <arpa/inet.h>
+#include <sys/types.h>
 
 #include "MocklwIP.h"
 
 #include <LwipDhcpServer.h>
 
-bool DhcpServer::set_dhcps_lease(struct dhcps_lease *please)
+bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
 {
     (void)please;
     return false;
@@ -66,7 +66,7 @@ void DhcpServer::end()
 {
 }
 
-bool DhcpServer::begin(struct ip_info *info)
+bool DhcpServer::begin(struct ip_info* info)
 {
     (void)info;
     return false;
@@ -86,9 +86,8 @@ DhcpServer dhcpSoftAP(nullptr);
 
 extern "C"
 {
-
-#include <user_interface.h>
 #include <lwip/netif.h>
+#include <user_interface.h>
 
     uint8 wifi_get_opmode(void)
     {
@@ -120,7 +119,7 @@ extern "C"
         return 1;
     }
 
-    bool wifi_station_get_config(struct station_config *config)
+    bool wifi_station_get_config(struct station_config* config)
     {
         strcpy((char*)config->ssid, "emulated-ssid");
         strcpy((char*)config->password, "emulated-ssid-password");
@@ -160,21 +159,21 @@ extern "C"
         (void)type;
     }
 
-    uint32_t global_ipv4_netfmt = 0; // global binding
+    uint32_t global_ipv4_netfmt = 0;  // global binding
 
     netif netif0;
     uint32_t global_source_address = INADDR_ANY;
 
-    bool wifi_get_ip_info(uint8 if_index, struct ip_info *info)
+    bool wifi_get_ip_info(uint8 if_index, struct ip_info* info)
     {
         // emulate wifi_get_ip_info()
         // ignore if_index
         // use global option -i (host_interface) to select bound interface/address
 
-        struct ifaddrs * ifAddrStruct = NULL, * ifa = NULL;
+        struct ifaddrs *ifAddrStruct = NULL, *ifa = NULL;
         uint32_t ipv4 = lwip_htonl(0x7f000001);
         uint32_t mask = lwip_htonl(0xff000000);
-        global_source_address = INADDR_ANY; // =0
+        global_source_address = INADDR_ANY;  // =0
 
         if (getifaddrs(&ifAddrStruct) != 0)
         {
@@ -190,14 +189,13 @@ extern "C"
         for (ifa = ifAddrStruct; ifa != NULL; ifa = ifa->ifa_next)
         {
             mockverbose("host: interface: %s", ifa->ifa_name);
-            if (ifa->ifa_addr
-                    && ifa->ifa_addr->sa_family == AF_INET // ip_info is IPv4 only
-               )
+            if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET  // ip_info is IPv4 only
+            )
             {
-                auto test_ipv4 = lwip_ntohl(*(uint32_t*) & ((struct sockaddr_in*)ifa->ifa_addr)->sin_addr);
+                auto test_ipv4 = lwip_ntohl(*(uint32_t*)&((struct sockaddr_in*)ifa->ifa_addr)->sin_addr);
                 mockverbose(" IPV4 (0x%08lx)", test_ipv4);
                 if ((test_ipv4 & 0xff000000) == 0x7f000000)
-                    // 127./8
+                // 127./8
                 {
                     mockverbose(" (local, ignored)");
                 }
@@ -206,8 +204,8 @@ extern "C"
                     if (!host_interface || (host_interface && strcmp(ifa->ifa_name, host_interface) == 0))
                     {
                         // use the first non-local interface, or, if specified, the one selected by user on cmdline
-                        ipv4 = *(uint32_t*) & ((struct sockaddr_in*)ifa->ifa_addr)->sin_addr;
-                        mask = *(uint32_t*) & ((struct sockaddr_in*)ifa->ifa_netmask)->sin_addr;
+                        ipv4 = *(uint32_t*)&((struct sockaddr_in*)ifa->ifa_addr)->sin_addr;
+                        mask = *(uint32_t*)&((struct sockaddr_in*)ifa->ifa_netmask)->sin_addr;
                         mockverbose(" (selected)\n");
                         if (host_interface)
                         {
@@ -255,7 +253,7 @@ extern "C"
         return 1;
     }
 
-    bool wifi_get_macaddr(uint8 if_index, uint8 *macaddr)
+    bool wifi_get_macaddr(uint8 if_index, uint8* macaddr)
     {
         (void)if_index;
         macaddr[0] = 0xde;
@@ -279,7 +277,7 @@ extern "C"
         return MIN_SLEEP_T;
     }
 
-#endif // nonos-sdk-pre-3
+#endif  // nonos-sdk-pre-3
 
     sleep_type_t wifi_get_sleep_type(void)
     {
@@ -299,7 +297,7 @@ extern "C"
         mockverbose("TODO: wifi_set_event_handler_cb set\n");
     }
 
-    bool wifi_set_ip_info(uint8 if_index, struct ip_info *info)
+    bool wifi_set_ip_info(uint8 if_index, struct ip_info* info)
     {
         (void)if_index;
         (void)info;
@@ -364,12 +362,12 @@ extern "C"
         return true;
     }
 
-    bool wifi_station_get_config_default(struct station_config *config)
+    bool wifi_station_get_config_default(struct station_config* config)
     {
         return wifi_station_get_config(config);
     }
 
-    char wifi_station_get_hostname_str [128];
+    char wifi_station_get_hostname_str[128];
     const char* wifi_station_get_hostname(void)
     {
         return strcpy(wifi_station_get_hostname_str, "esposix");
@@ -390,19 +388,19 @@ extern "C"
         return set != 0;
     }
 
-    bool wifi_station_set_config(struct station_config *config)
+    bool wifi_station_set_config(struct station_config* config)
     {
         (void)config;
         return true;
     }
 
-    bool wifi_station_set_config_current(struct station_config *config)
+    bool wifi_station_set_config_current(struct station_config* config)
     {
         (void)config;
         return true;
     }
 
-    bool wifi_station_set_hostname(const char *name)
+    bool wifi_station_set_hostname(const char* name)
     {
         (void)name;
         return true;
@@ -434,7 +432,7 @@ extern "C"
         return true;
     }
 
-    bool wifi_softap_get_config(struct softap_config *config)
+    bool wifi_softap_get_config(struct softap_config* config)
     {
         strcpy((char*)config->ssid, "apssid");
         strcpy((char*)config->password, "appasswd");
@@ -447,7 +445,7 @@ extern "C"
         return true;
     }
 
-    bool wifi_softap_get_config_default(struct softap_config *config)
+    bool wifi_softap_get_config_default(struct softap_config* config)
     {
         return wifi_softap_get_config(config);
     }
@@ -457,19 +455,19 @@ extern "C"
         return 2;
     }
 
-    bool wifi_softap_set_config(struct softap_config *config)
+    bool wifi_softap_set_config(struct softap_config* config)
     {
         (void)config;
         return true;
     }
 
-    bool wifi_softap_set_config_current(struct softap_config *config)
+    bool wifi_softap_set_config_current(struct softap_config* config)
     {
         (void)config;
         return true;
     }
 
-    bool wifi_softap_set_dhcps_lease(struct dhcps_lease *please)
+    bool wifi_softap_set_dhcps_lease(struct dhcps_lease* please)
     {
         (void)please;
         return true;
@@ -488,7 +486,7 @@ extern "C"
         return true;
     }
 
-    bool wifi_station_scan(struct scan_config *config, scan_done_cb_t cb)
+    bool wifi_station_scan(struct scan_config* config, scan_done_cb_t cb)
     {
         (void)config;
         cb(nullptr, FAIL);
@@ -510,7 +508,7 @@ extern "C"
         (void)intr;
     }
 
-    void dns_setserver(u8_t numdns, ip_addr_t *dnsserver)
+    void dns_setserver(u8_t numdns, ip_addr_t* dnsserver)
     {
         (void)numdns;
         (void)dnsserver;
@@ -519,11 +517,10 @@ extern "C"
     ip_addr_t dns_getserver(u8_t numdns)
     {
         (void)numdns;
-        ip_addr_t addr = { 0x7f000001 };
+        ip_addr_t addr = {0x7f000001};
         return addr;
     }
 
-
 #include <smartconfig.h>
     bool smartconfig_start(sc_callback_t cb, ...)
     {
@@ -542,4 +539,4 @@ extern "C"
         return NONE_SLEEP_T;
     }
 
-} // extern "C"
+}  // extern "C"
diff --git a/tests/host/core/test_PolledTimeout.cpp b/tests/host/core/test_PolledTimeout.cpp
index 3645123827..ac39477feb 100644
--- a/tests/host/core/test_PolledTimeout.cpp
+++ b/tests/host/core/test_PolledTimeout.cpp
@@ -2,10 +2,10 @@
 #include "PolledTimeout.h"
 
 #define mockverbose printf
-#include "common/MockEsp.cpp" // getCycleCount
+#include "common/MockEsp.cpp"  // getCycleCount
 
 //This won't work for
-template<typename argT>
+template <typename argT>
 inline bool
 fuzzycomp(argT a, argT b)
 {
@@ -34,7 +34,6 @@ TEST_CASE("OneShot Timeout 500000000ns (0.5s)", "[polledTimeout]")
 
     REQUIRE(fuzzycomp(delta / 1000, (timeType)500));
 
-
     Serial.print("reset\n");
 
     timeout.reset();
@@ -72,7 +71,6 @@ TEST_CASE("OneShot Timeout 3000000us", "[polledTimeout]")
 
     REQUIRE(fuzzycomp(delta / 1000, (timeType)3000));
 
-
     Serial.print("reset\n");
 
     timeout.reset();
@@ -110,7 +108,6 @@ TEST_CASE("OneShot Timeout 3000ms", "[polledTimeout]")
 
     REQUIRE(fuzzycomp(delta, (timeType)3000));
 
-
     Serial.print("reset\n");
 
     timeout.reset();
@@ -148,7 +145,6 @@ TEST_CASE("OneShot Timeout 3000ms reset to 1000ms", "[polledTimeout]")
 
     REQUIRE(fuzzycomp(delta, (timeType)3000));
 
-
     Serial.print("reset\n");
 
     timeout.reset(1000);
@@ -241,10 +237,10 @@ TEST_CASE("OneShot Timeout 3000ms reset to 1000ms custom yield", "[polledTimeout
 
     Serial.println("OneShot Timeout 3000ms");
 
-
     oneShotMsYield timeout(3000);
     before = millis();
-    while (!timeout.expired());
+    while (!timeout.expired())
+        ;
     after = millis();
 
     delta = after - before;
@@ -252,12 +248,12 @@ TEST_CASE("OneShot Timeout 3000ms reset to 1000ms custom yield", "[polledTimeout
 
     REQUIRE(fuzzycomp(delta, (timeType)3000));
 
-
     Serial.print("reset\n");
 
     timeout.reset(1000);
     before = millis();
-    while (!timeout);
+    while (!timeout)
+        ;
     after = millis();
 
     delta = after - before;
@@ -265,4 +261,3 @@ TEST_CASE("OneShot Timeout 3000ms reset to 1000ms custom yield", "[polledTimeout
 
     REQUIRE(fuzzycomp(delta, (timeType)1000));
 }
-
diff --git a/tests/host/core/test_Print.cpp b/tests/host/core/test_Print.cpp
index 33baead1b0..86197afcf6 100644
--- a/tests/host/core/test_Print.cpp
+++ b/tests/host/core/test_Print.cpp
@@ -13,12 +13,12 @@
     all copies or substantial portions of the Software.
 */
 
-#include <catch.hpp>
-#include <string.h>
 #include <FS.h>
 #include <LittleFS.h>
-#include "../common/littlefs_mock.h"
 #include <spiffs/spiffs.h>
+#include <string.h>
+#include <catch.hpp>
+#include "../common/littlefs_mock.h"
 
 // Use a LittleFS file because we can't instantiate a virtual class like Print
 TEST_CASE("Print::write overrides all compile properly", "[core][Print]")
@@ -27,18 +27,18 @@ TEST_CASE("Print::write overrides all compile properly", "[core][Print]")
     REQUIRE(LittleFS.begin());
     auto p = LittleFS.open("test.bin", "w");
     REQUIRE(p);
-    uint8_t    uint8 = 1;
-    uint16_t  uint16 = 2;
-    uint32_t  uint32 = 3;
-    size_t      size = 4;
-    int8_t      int8 = 1;
-    int16_t    int16 = 2;
-    int32_t    int32 = 3;
-    char           c = 'h';
-    int            i = 10;
-    long           l = 11;
+    uint8_t uint8 = 1;
+    uint16_t uint16 = 2;
+    uint32_t uint32 = 3;
+    size_t size = 4;
+    int8_t int8 = 1;
+    int16_t int16 = 2;
+    int32_t int32 = 3;
+    char c = 'h';
+    int i = 10;
+    long l = 11;
     unsigned char uc = 20;
-    unsigned int  ui = 21;
+    unsigned int ui = 21;
     unsigned long ul = 22;
     p.write(uint8);
     p.write(uint16);
diff --git a/tests/host/core/test_Updater.cpp b/tests/host/core/test_Updater.cpp
index ab8941694b..edd84741f5 100644
--- a/tests/host/core/test_Updater.cpp
+++ b/tests/host/core/test_Updater.cpp
@@ -13,14 +13,13 @@
     all copies or substantial portions of the Software.
 */
 
-#include <catch.hpp>
 #include <Updater.h>
-
+#include <catch.hpp>
 
 // Use a SPIFFS file because we can't instantiate a virtual class like Print
 TEST_CASE("Updater fails when writes overflow requested size", "[core][Updater]")
 {
-    UpdaterClass *u;
+    UpdaterClass* u;
     uint8_t buff[6000];
     memset(buff, 0, sizeof(buff));
     u = new UpdaterClass();
diff --git a/tests/host/core/test_md5builder.cpp b/tests/host/core/test_md5builder.cpp
index 6f8075fe93..bb788c3d35 100644
--- a/tests/host/core/test_md5builder.cpp
+++ b/tests/host/core/test_md5builder.cpp
@@ -13,10 +13,10 @@
     all copies or substantial portions of the Software.
 */
 
-#include <catch.hpp>
-#include <string.h>
 #include <MD5Builder.h>
 #include <StreamString.h>
+#include <string.h>
+#include <catch.hpp>
 
 TEST_CASE("MD5Builder::add works as expected", "[core][MD5Builder]")
 {
@@ -32,14 +32,13 @@ TEST_CASE("MD5Builder::add works as expected", "[core][MD5Builder]")
     REQUIRE(builder.toString() == "9edb67f2b22c604fab13e2fd1d6056d7");
 }
 
-
 TEST_CASE("MD5Builder::addHexString works as expected", "[core][MD5Builder]")
 {
     WHEN("A char array is parsed")
     {
         MD5Builder builder;
         builder.begin();
-        const char * myPayload = "1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696F6e73";
+        const char* myPayload = "1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696F6e73";
         builder.addHexString(myPayload);
         builder.calculate();
         REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
diff --git a/tests/host/core/test_pgmspace.cpp b/tests/host/core/test_pgmspace.cpp
index 28fa6ca0f1..dc44b55374 100644
--- a/tests/host/core/test_pgmspace.cpp
+++ b/tests/host/core/test_pgmspace.cpp
@@ -13,9 +13,9 @@
     all copies or substantial portions of the Software.
 */
 
-#include <catch.hpp>
-#include <string.h>
 #include <pgmspace.h>
+#include <string.h>
+#include <catch.hpp>
 
 TEST_CASE("strstr_P works as strstr", "[core][pgmspace]")
 {
diff --git a/tests/host/core/test_string.cpp b/tests/host/core/test_string.cpp
index e2eaba3a99..9aa770a8a9 100644
--- a/tests/host/core/test_string.cpp
+++ b/tests/host/core/test_string.cpp
@@ -13,11 +13,11 @@
     all copies or substantial portions of the Software.
 */
 
-#include <catch.hpp>
-#include <string.h>
+#include <StreamString.h>
 #include <WString.h>
 #include <limits.h>
-#include <StreamString.h>
+#include <string.h>
+#include <catch.hpp>
 
 TEST_CASE("String::move", "[core][String]")
 {
@@ -78,12 +78,12 @@ TEST_CASE("String constructors", "[core][String]")
     REQUIRE(ib == "3e7");
     String lb((unsigned long)3000000000, 8);
     REQUIRE(lb == "26264057000");
-    String sl1((long) -2000000000, 10);
+    String sl1((long)-2000000000, 10);
     REQUIRE(sl1 == "-2000000000");
     String s1("abcd");
     String s2(s1);
     REQUIRE(s1 == s2);
-    String *s3 = new String("manos");
+    String* s3 = new String("manos");
     s2 = *s3;
     delete s3;
     REQUIRE(s2 == "manos");
@@ -124,11 +124,11 @@ TEST_CASE("String concantenation", "[core][String]")
     REQUIRE(str == "abcdeabcde9872147483647-214748364869");
     str += (unsigned int)1969;
     REQUIRE(str == "abcdeabcde9872147483647-2147483648691969");
-    str += (long) -123;
+    str += (long)-123;
     REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123");
     str += (unsigned long)321;
     REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321");
-    str += (float) -1.01;
+    str += (float)-1.01;
     REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.01");
     str += (double)1.01;
     REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01");
@@ -146,24 +146,24 @@ TEST_CASE("String concantenation", "[core][String]")
     REQUIRE(str.concat(str) == true);
     REQUIRE(str == "cleanclean");
     // non-decimal negative #s should be as if they were unsigned
-    str = String((int) -100, 16);
+    str = String((int)-100, 16);
     REQUIRE(str == "ffffff9c");
-    str = String((long) -101, 16);
+    str = String((long)-101, 16);
     REQUIRE(str == "ffffff9b");
-    str = String((int) -100, 10);
+    str = String((int)-100, 10);
     REQUIRE(str == "-100");
-    str = String((long) -100, 10);
+    str = String((long)-100, 10);
     REQUIRE(str == "-100");
     // Non-zero-terminated array concatenation
     const char buff[] = "abcdefg";
     String n;
-    n = "1234567890"; // Make it a SSO string, fill with non-0 data
-    n = "1"; // Overwrite [1] with 0, but leave old junk in SSO space still
+    n = "1234567890";  // Make it a SSO string, fill with non-0 data
+    n = "1";           // Overwrite [1] with 0, but leave old junk in SSO space still
     n.concat(buff, 3);
-    REQUIRE(n == "1abc"); // Ensure the trailing 0 is always present even w/this funky concat
+    REQUIRE(n == "1abc");  // Ensure the trailing 0 is always present even w/this funky concat
     for (int i = 0; i < 20; i++)
     {
-        n.concat(buff, 1);    // Add 20 'a's to go from SSO to normal string
+        n.concat(buff, 1);  // Add 20 'a's to go from SSO to normal string
     }
     REQUIRE(n == "1abcaaaaaaaaaaaaaaaaaaaa");
     n = "";
@@ -172,7 +172,7 @@ TEST_CASE("String concantenation", "[core][String]")
         n.concat(buff, i);
     }
     REQUIRE(n == "aababcabcdabcde");
-    n.concat(buff, 0); // And check no add'n
+    n.concat(buff, 0);  // And check no add'n
     REQUIRE(n == "aababcabcdabcde");
 }
 
@@ -330,7 +330,7 @@ TEST_CASE("String SSO works", "[core][String]")
     s += "0";
     REQUIRE(s == "0");
     REQUIRE(s.length() == 1);
-    const char *savesso = s.c_str();
+    const char* savesso = s.c_str();
     s += 1;
     REQUIRE(s.c_str() == savesso);
     REQUIRE(s == "01");
@@ -433,13 +433,12 @@ void repl(const String& key, const String& val, String& s, boolean useURLencode)
     s.replace(key, val);
 }
 
-
 TEST_CASE("String SSO handles junk in memory", "[core][String]")
 {
     // We fill the SSO space with garbage then construct an object in it and check consistency
     // This is NOT how you want to use Strings outside of this testing!
     unsigned char space[64];
-    String *s = (String*)space;
+    String* s = (String*)space;
     memset(space, 0xff, 64);
     new (s) String;
     REQUIRE(*s == "");
@@ -447,8 +446,8 @@ TEST_CASE("String SSO handles junk in memory", "[core][String]")
 
     // Tests from #5883
     bool useURLencode = false;
-    const char euro[4] = {(char)0xe2, (char)0x82, (char)0xac, 0}; // Unicode euro symbol
-    const char yen[3]   = {(char)0xc2, (char)0xa5, 0}; // Unicode yen symbol
+    const char euro[4] = {(char)0xe2, (char)0x82, (char)0xac, 0};  // Unicode euro symbol
+    const char yen[3] = {(char)0xc2, (char)0xa5, 0};               // Unicode yen symbol
 
     memset(space, 0xff, 64);
     new (s) String("%ssid%");
@@ -484,7 +483,6 @@ TEST_CASE("String SSO handles junk in memory", "[core][String]")
     s->~String();
 }
 
-
 TEST_CASE("Issue #5949 - Overlapping src/dest in replace", "[core][String]")
 {
     String blah = "blah";
@@ -496,7 +494,6 @@ TEST_CASE("Issue #5949 - Overlapping src/dest in replace", "[core][String]")
     REQUIRE(blah == "blah");
 }
 
-
 TEST_CASE("Issue #2736 - StreamString SSO fix", "[core][StreamString]")
 {
     StreamString s;
@@ -513,19 +510,19 @@ TEST_CASE("Strings with NULs", "[core][String]")
     // Fits in SSO...
     String str("01234567");
     REQUIRE(str.length() == 8);
-    char *ptr = (char *)str.c_str();
+    char* ptr = (char*)str.c_str();
     ptr[3] = 0;
     String str2;
     str2 = str;
     REQUIRE(str2.length() == 8);
     // Needs a buffer pointer
     str = "0123456789012345678901234567890123456789";
-    ptr = (char *)str.c_str();
+    ptr = (char*)str.c_str();
     ptr[3] = 0;
     str2 = str;
     REQUIRE(str2.length() == 40);
     String str3("a");
-    ptr = (char *)str3.c_str();
+    ptr = (char*)str3.c_str();
     *ptr = 0;
     REQUIRE(str3.length() == 1);
     str3 += str3;
@@ -541,7 +538,7 @@ TEST_CASE("Strings with NULs", "[core][String]")
     str3 += str3;
     REQUIRE(str3.length() == 64);
     static char zeros[64] = {0};
-    const char *p = str3.c_str();
+    const char* p = str3.c_str();
     REQUIRE(!memcmp(p, zeros, 64));
 }
 
@@ -550,7 +547,7 @@ TEST_CASE("Replace and string expansion", "[core][String]")
     String s, l;
     // Make these large enough to span SSO and non SSO
     String whole = "#123456789012345678901234567890";
-    const char *res = "abcde123456789012345678901234567890";
+    const char* res = "abcde123456789012345678901234567890";
     for (size_t i = 1; i < whole.length(); i++)
     {
         s = whole.substring(0, i);
@@ -566,13 +563,11 @@ TEST_CASE("Replace and string expansion", "[core][String]")
 
 TEST_CASE("String chaining", "[core][String]")
 {
-    const char* chunks[]
-    {
+    const char* chunks[]{
         "~12345",
         "67890",
         "qwertyuiopasdfghjkl",
-        "zxcvbnm"
-    };
+        "zxcvbnm"};
 
     String all;
     for (auto* chunk : chunks)
@@ -607,7 +602,7 @@ TEST_CASE("String chaining", "[core][String]")
 
 TEST_CASE("String concat OOB #8198", "[core][String]")
 {
-    char *p = (char*)malloc(16);
+    char* p = (char*)malloc(16);
     memset(p, 'x', 16);
     String s = "abcd";
     s.concat(p, 16);
diff --git a/tests/host/fs/test_fs.cpp b/tests/host/fs/test_fs.cpp
index dad26483a6..5ea8e94a67 100644
--- a/tests/host/fs/test_fs.cpp
+++ b/tests/host/fs/test_fs.cpp
@@ -13,17 +13,16 @@
     all copies or substantial portions of the Software.
 */
 
+#include <FS.h>
+#include <LittleFS.h>
+#include <spiffs/spiffs.h>
 #include <catch.hpp>
 #include <map>
-#include <FS.h>
-#include "../common/spiffs_mock.h"
+#include "../../../libraries/SD/src/SD.h"
+#include "../../../libraries/SDFS/src/SDFS.h"
 #include "../common/littlefs_mock.h"
 #include "../common/sdfs_mock.h"
-#include <spiffs/spiffs.h>
-#include <LittleFS.h>
-#include "../../../libraries/SDFS/src/SDFS.h"
-#include "../../../libraries/SD/src/SD.h"
-
+#include "../common/spiffs_mock.h"
 
 namespace spiffs_test
 {
@@ -60,8 +59,7 @@ TEST_CASE("SPIFFS checks the config object passed in", "[fs]")
 }
 #pragma GCC diagnostic pop
 
-};
-
+};  // namespace spiffs_test
 
 namespace littlefs_test
 {
@@ -95,7 +93,7 @@ TEST_CASE("LittleFS checks the config object passed in", "[fs]")
     REQUIRE(LittleFS.setConfig(l));
 }
 
-};
+};  // namespace littlefs_test
 
 namespace sdfs_test
 {
@@ -103,10 +101,11 @@ namespace sdfs_test
 #define TESTPRE "SDFS - "
 #define TESTPAT "[sdfs]"
 // SDFS supports long paths (MAXPATH)
-#define TOOLONGFILENAME "/" \
-	"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
-	"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
-	"12345678901234567890123456789012345678901234567890123456"
+#define TOOLONGFILENAME                                                                                    \
+    "/"                                                                                                    \
+    "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
+    "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
+    "12345678901234567890123456789012345678901234567890123456"
 #define FS_MOCK_DECLARE SDFS_MOCK_DECLARE
 #define FS_MOCK_RESET SDFS_MOCK_RESET
 #define FS_HAS_DIRS
@@ -165,4 +164,4 @@ TEST_CASE("SD.h FILE_WRITE macro is append", "[fs]")
     REQUIRE(u == 0);
 }
 
-};
+};  // namespace sdfs_test
diff --git a/tests/host/sys/pgmspace.h b/tests/host/sys/pgmspace.h
index 5426685bf8..6ccd881a8c 100644
--- a/tests/host/sys/pgmspace.h
+++ b/tests/host/sys/pgmspace.h
@@ -15,11 +15,11 @@
 #endif
 
 #ifndef PGM_P
-#define PGM_P const char *
+#define PGM_P const char*
 #endif
 
 #ifndef PGM_VOID_P
-#define PGM_VOID_P const void *
+#define PGM_VOID_P const void*
 #endif
 
 #ifndef PSTR
@@ -27,46 +27,46 @@
 #endif
 
 #ifdef __cplusplus
-#define pgm_read_byte(addr)             (*reinterpret_cast<const uint8_t*>(addr))
-#define pgm_read_word(addr)             (*reinterpret_cast<const uint16_t*>(addr))
-#define pgm_read_dword(addr)            (*reinterpret_cast<const uint32_t*>(addr))
-#define pgm_read_float(addr)            (*reinterpret_cast<const float*>(addr))
-#define pgm_read_ptr(addr)              (*reinterpret_cast<const void* const *>(addr))
+#define pgm_read_byte(addr) (*reinterpret_cast<const uint8_t*>(addr))
+#define pgm_read_word(addr) (*reinterpret_cast<const uint16_t*>(addr))
+#define pgm_read_dword(addr) (*reinterpret_cast<const uint32_t*>(addr))
+#define pgm_read_float(addr) (*reinterpret_cast<const float*>(addr))
+#define pgm_read_ptr(addr) (*reinterpret_cast<const void* const*>(addr))
 #else
-#define pgm_read_byte(addr)             (*(const uint8_t*)(addr))
-#define pgm_read_word(addr)             (*(const uint16_t*)(addr))
-#define pgm_read_dword(addr)            (*(const uint32_t*)(addr))
-#define pgm_read_float(addr)            (*(const float)(addr))
-#define pgm_read_ptr(addr)              (*(const void* const *)(addr))
+#define pgm_read_byte(addr) (*(const uint8_t*)(addr))
+#define pgm_read_word(addr) (*(const uint16_t*)(addr))
+#define pgm_read_dword(addr) (*(const uint32_t*)(addr))
+#define pgm_read_float(addr) (*(const float)(addr))
+#define pgm_read_ptr(addr) (*(const void* const*)(addr))
 #endif
 
-#define pgm_read_byte_near(addr)        pgm_read_byte(addr)
-#define pgm_read_word_near(addr)        pgm_read_word(addr)
-#define pgm_read_dword_near(addr)       pgm_read_dword(addr)
-#define pgm_read_float_near(addr)       pgm_read_float(addr)
-#define pgm_read_ptr_near(addr)         pgm_read_ptr(addr)
-#define pgm_read_byte_far(addr)         pgm_read_byte(addr)
-#define pgm_read_word_far(addr)         pgm_read_word(addr)
-#define pgm_read_dword_far(addr)        pgm_read_dword(addr)
-#define pgm_read_float_far(addr)        pgm_read_float(addr)
-#define pgm_read_ptr_far(addr)          pgm_read_ptr(addr)
+#define pgm_read_byte_near(addr) pgm_read_byte(addr)
+#define pgm_read_word_near(addr) pgm_read_word(addr)
+#define pgm_read_dword_near(addr) pgm_read_dword(addr)
+#define pgm_read_float_near(addr) pgm_read_float(addr)
+#define pgm_read_ptr_near(addr) pgm_read_ptr(addr)
+#define pgm_read_byte_far(addr) pgm_read_byte(addr)
+#define pgm_read_word_far(addr) pgm_read_word(addr)
+#define pgm_read_dword_far(addr) pgm_read_dword(addr)
+#define pgm_read_float_far(addr) pgm_read_float(addr)
+#define pgm_read_ptr_far(addr) pgm_read_ptr(addr)
 
 // Wrapper inlines for _P functions
 #include <stdio.h>
 #include <string.h>
-inline const char *strstr_P(const char *haystack, const char *needle)
+inline const char* strstr_P(const char* haystack, const char* needle)
 {
     return strstr(haystack, needle);
 }
-inline char *strcpy_P(char *dest, const char *src)
+inline char* strcpy_P(char* dest, const char* src)
 {
     return strcpy(dest, src);
 }
-inline size_t strlen_P(const char *s)
+inline size_t strlen_P(const char* s)
 {
     return strlen(s);
 }
-inline int vsnprintf_P(char *str, size_t size, const char *format, va_list ap)
+inline int vsnprintf_P(char* str, size_t size, const char* format, va_list ap)
 {
     return vsnprintf(str, size, format, ap);
 }
diff --git a/tests/restyle.sh b/tests/restyle.sh
index e7fdbc6c28..12d031d21e 100755
--- a/tests/restyle.sh
+++ b/tests/restyle.sh
@@ -29,14 +29,11 @@ for d in $all; do
     if [ -d "$d" ]; then
         echo "-------- directory $d:"
         for e in c cpp h; do
-            find $d -name "*.$e" -exec \
-                astyle \
-                    --suffix=none \
-                    --options=${org}/astyle_core.conf {} \;
+            find $d -name "*.$e" -exec clang-format -i {} \;
         done
     else
         echo "-------- file $d:"
-        astyle --suffix=none --options=${org}/astyle_core.conf "$d"
+        clang-format -i ${d}
     fi
 done
 
diff --git a/tools/sdk/lwip2/builder b/tools/sdk/lwip2/builder
index 450bb63c1b..7421258237 160000
--- a/tools/sdk/lwip2/builder
+++ b/tools/sdk/lwip2/builder
@@ -1 +1 @@
-Subproject commit 450bb63c1bc8b35770ca7f246945cf383569f52f
+Subproject commit 7421258237b7c8f61629226961af498a0a6e0096

From 01e6b9645eac241e3350995e4a593bbd2f407036 Mon Sep 17 00:00:00 2001
From: David Gauchard <gauchard@laas.fr>
Date: Wed, 19 Jan 2022 18:03:55 +0100
Subject: [PATCH 03/15] revert submodule update

---
 tools/sdk/lwip2/builder | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/sdk/lwip2/builder b/tools/sdk/lwip2/builder
index 7421258237..450bb63c1b 160000
--- a/tools/sdk/lwip2/builder
+++ b/tools/sdk/lwip2/builder
@@ -1 +1 @@
-Subproject commit 7421258237b7c8f61629226961af498a0a6e0096
+Subproject commit 450bb63c1bc8b35770ca7f246945cf383569f52f

From c5ecc72544deb37bc230fc323383a527a26e8c25 Mon Sep 17 00:00:00 2001
From: David Gauchard <gauchard@laas.fr>
Date: Wed, 19 Jan 2022 18:22:56 +0100
Subject: [PATCH 04/15] use clang-format-12 instead of 10

---
 .github/workflows/pull-request.yml | 2 +-
 tests/restyle.sh                   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml
index 2606963a83..5cf15ddcf3 100644
--- a/.github/workflows/pull-request.yml
+++ b/.github/workflows/pull-request.yml
@@ -242,7 +242,7 @@ jobs:
         TRAVIS_TAG: ${{ github.ref }}
       run: |
           sudo apt update
-          sudo apt install astyle clang-format
+          sudo apt install astyle clang-format-12
           bash ./tests/ci/style_check.sh
 
 
diff --git a/tests/restyle.sh b/tests/restyle.sh
index 12d031d21e..b8438e089b 100755
--- a/tests/restyle.sh
+++ b/tests/restyle.sh
@@ -29,11 +29,11 @@ for d in $all; do
     if [ -d "$d" ]; then
         echo "-------- directory $d:"
         for e in c cpp h; do
-            find $d -name "*.$e" -exec clang-format -i {} \;
+            find $d -name "*.$e" -exec clang-format-12 -i {} \;
         done
     else
         echo "-------- file $d:"
-        clang-format -i ${d}
+        clang-format-12 -i ${d}
     fi
 done
 

From 9a353ccd22dfcfe7cd2a2080a3553c27577aa4a5 Mon Sep 17 00:00:00 2001
From: David Gauchard <gauchard@laas.fr>
Date: Wed, 19 Jan 2022 18:30:44 +0100
Subject: [PATCH 05/15] unsort #include order

---
 .clang-format | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.clang-format b/.clang-format
index a54f0962b7..0bde5080d7 100644
--- a/.clang-format
+++ b/.clang-format
@@ -5,3 +5,4 @@ ColumnLimit: 0
 IndentWidth: 4
 KeepEmptyLinesAtTheStartOfBlocks: false
 SpacesBeforeTrailingComments: 2
+SortIncludes: false

From f2dae5f1232128528e0a2ef7400640df4712a7d3 Mon Sep 17 00:00:00 2001
From: David Gauchard <gauchard@laas.fr>
Date: Wed, 19 Jan 2022 18:35:09 +0100
Subject: [PATCH 06/15] apply new clang-format configuration

---
 cores/esp8266/LwipDhcpServer.cpp              |   6 +-
 cores/esp8266/LwipIntf.cpp                    |   8 +-
 cores/esp8266/LwipIntf.h                      |   2 +-
 cores/esp8266/LwipIntfDev.h                   |  12 +-
 cores/esp8266/StreamString.h                  |   2 +-
 cores/esp8266/core_esp8266_si2c.cpp           |   6 +-
 cores/esp8266/debug.cpp                       |   2 +-
 libraries/ESP8266mDNS/src/LEAmDNS.cpp         |   6 +-
 libraries/ESP8266mDNS/src/LEAmDNS.h           |   8 +-
 libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp |   8 +-
 libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp |   2 +-
 .../ESP8266mDNS/src/LEAmDNS_Transfer.cpp      |   2 +-
 .../Netdump/examples/Netdump/Netdump.ino      |  66 ++---
 libraries/Netdump/src/Netdump.h               |   8 +-
 libraries/Netdump/src/NetdumpIP.h             |   6 +-
 libraries/Netdump/src/NetdumpPacket.cpp       |   2 +-
 libraries/Netdump/src/NetdumpPacket.h         |   4 +-
 libraries/Wire/Wire.cpp                       |   4 +-
 libraries/lwIP_PPP/src/PPPServer.cpp          |   2 +-
 .../lwIP_enc28j60/src/utility/enc28j60.cpp    |   2 +-
 libraries/lwIP_w5100/src/utility/w5100.cpp    |   2 +-
 libraries/lwIP_w5100/src/utility/w5100.h      |   2 +-
 libraries/lwIP_w5500/src/utility/w5500.cpp    |   2 +-
 libraries/lwIP_w5500/src/utility/w5500.h      |   2 +-
 tests/device/libraries/BSTest/src/BSArgs.h    |  58 ++---
 tests/device/libraries/BSTest/test/test.cpp   |   2 +-
 tests/device/test_libc/libm_string.c          | 168 +++++++------
 tests/device/test_libc/memcpy-1.c             |  72 +++---
 tests/device/test_libc/memmove1.c             |  82 +++----
 tests/device/test_libc/strcmp-1.c             |  78 +++---
 tests/device/test_libc/tstring.c              |  24 +-
 tests/host/common/Arduino.cpp                 |  28 +--
 tests/host/common/ArduinoCatch.cpp            |  26 +-
 tests/host/common/ArduinoMain.cpp             |  82 +++----
 tests/host/common/ArduinoMainLittlefs.cpp     |   2 -
 tests/host/common/ArduinoMainSpiffs.cpp       |   2 -
 tests/host/common/ArduinoMainUdp.cpp          |  60 +++--
 tests/host/common/ClientContextSocket.cpp     |  76 +++---
 tests/host/common/ClientContextTools.cpp      |  64 +++--
 tests/host/common/EEPROM.h                    |  64 ++---
 tests/host/common/HostWiring.cpp              |  46 ++--
 tests/host/common/MockDigital.cpp             |  36 +--
 tests/host/common/MockEEPROM.cpp              |  72 +++---
 tests/host/common/MockEsp.cpp                 |  62 +++--
 tests/host/common/MockSPI.cpp                 |  56 ++---
 tests/host/common/MockTools.cpp               | 108 +++-----
 tests/host/common/MockUART.cpp                |  94 ++-----
 tests/host/common/MockWiFiServer.cpp          |  58 +++--
 tests/host/common/MockWiFiServerSocket.cpp    |  70 +++---
 tests/host/common/MocklwIP.h                  |   2 +-
 tests/host/common/UdpContextSocket.cpp        |  90 +++----
 tests/host/common/WMath.cpp                   |  44 ++--
 tests/host/common/c_types.h                   |  48 ++--
 tests/host/common/include/ClientContext.h     |  36 ++-
 tests/host/common/include/UdpContext.h        |  12 +-
 tests/host/common/littlefs_mock.cpp           |  48 ++--
 tests/host/common/littlefs_mock.h             |  34 +--
 tests/host/common/md5.c                       | 118 +++++----
 tests/host/common/mock.h                      |  56 ++---
 tests/host/common/noniso.c                    |  32 ++-
 tests/host/common/pins_arduino.h              |  26 +-
 tests/host/common/queue.h                     | 230 +++++++++---------
 tests/host/common/sdfs_mock.cpp               |  20 +-
 tests/host/common/sdfs_mock.h                 |  28 +--
 tests/host/common/spiffs_mock.cpp             |  44 ++--
 tests/host/common/spiffs_mock.h               |  28 +--
 tests/host/common/user_interface.cpp          |  24 +-
 tests/host/core/test_PolledTimeout.cpp        |  22 --
 tests/host/core/test_Print.cpp                |  28 +--
 tests/host/core/test_Updater.cpp              |  24 +-
 tests/host/core/test_md5builder.cpp           |  26 +-
 tests/host/core/test_pgmspace.cpp             |  26 +-
 tests/host/core/test_string.cpp               |  32 ++-
 tests/host/fs/test_fs.cpp                     |  36 +--
 74 files changed, 1234 insertions(+), 1536 deletions(-)

diff --git a/cores/esp8266/LwipDhcpServer.cpp b/cores/esp8266/LwipDhcpServer.cpp
index 869c9350a9..cbf151f767 100644
--- a/cores/esp8266/LwipDhcpServer.cpp
+++ b/cores/esp8266/LwipDhcpServer.cpp
@@ -40,17 +40,17 @@
 
 #define USE_DNS
 
-#include "lwip/err.h"
 #include "lwip/inet.h"
-#include "lwip/mem.h"
+#include "lwip/err.h"
 #include "lwip/pbuf.h"
 #include "lwip/udp.h"
+#include "lwip/mem.h"
 #include "osapi.h"
 
 #include "LwipDhcpServer.h"
 
-#include "mem.h"
 #include "user_interface.h"
+#include "mem.h"
 
 typedef struct dhcps_state
 {
diff --git a/cores/esp8266/LwipIntf.cpp b/cores/esp8266/LwipIntf.cpp
index e549270623..71dec259a4 100644
--- a/cores/esp8266/LwipIntf.cpp
+++ b/cores/esp8266/LwipIntf.cpp
@@ -1,11 +1,11 @@
 
 extern "C"
 {
-#include "lwip/dhcp.h"
-#include "lwip/dns.h"
 #include "lwip/err.h"
-#include "lwip/init.h"  // LWIP_VERSION_
 #include "lwip/ip_addr.h"
+#include "lwip/dns.h"
+#include "lwip/dhcp.h"
+#include "lwip/init.h"  // LWIP_VERSION_
 #if LWIP_IPV6
 #include "lwip/netif.h"  // struct netif
 #endif
@@ -13,8 +13,8 @@ extern "C"
 #include <user_interface.h>
 }
 
-#include "LwipIntf.h"
 #include "debug.h"
+#include "LwipIntf.h"
 
 // args      | esp order    arduino order
 // ----      + ---------    -------------
diff --git a/cores/esp8266/LwipIntf.h b/cores/esp8266/LwipIntf.h
index 5eef15305a..778785b7fd 100644
--- a/cores/esp8266/LwipIntf.h
+++ b/cores/esp8266/LwipIntf.h
@@ -2,8 +2,8 @@
 #ifndef _LWIPINTF_H
 #define _LWIPINTF_H
 
-#include <IPAddress.h>
 #include <lwip/netif.h>
+#include <IPAddress.h>
 
 #include <functional>
 
diff --git a/cores/esp8266/LwipIntfDev.h b/cores/esp8266/LwipIntfDev.h
index 82dd4e653f..3ec06c55f6 100644
--- a/cores/esp8266/LwipIntfDev.h
+++ b/cores/esp8266/LwipIntfDev.h
@@ -6,19 +6,19 @@
 // remove all Serial.print
 // unchain pbufs
 
-#include <lwip/apps/sntp.h>
-#include <lwip/dhcp.h>
-#include <lwip/dns.h>
-#include <lwip/etharp.h>
+#include <netif/ethernet.h>
 #include <lwip/init.h>
 #include <lwip/netif.h>
-#include <netif/ethernet.h>
+#include <lwip/etharp.h>
+#include <lwip/dhcp.h>
+#include <lwip/dns.h>
+#include <lwip/apps/sntp.h>
 
 #include <user_interface.h>  // wifi_get_macaddr()
 
-#include "LwipIntf.h"
 #include "SPI.h"
 #include "Schedule.h"
+#include "LwipIntf.h"
 #include "wl_definitions.h"
 
 #ifndef DEFAULT_MTU
diff --git a/cores/esp8266/StreamString.h b/cores/esp8266/StreamString.h
index 3f7f5dc89c..4af6f5653c 100644
--- a/cores/esp8266/StreamString.h
+++ b/cores/esp8266/StreamString.h
@@ -23,8 +23,8 @@
 #ifndef __STREAMSTRING_H
 #define __STREAMSTRING_H
 
-#include <algorithm>
 #include <limits>
+#include <algorithm>
 #include "Stream.h"
 #include "WString.h"
 
diff --git a/cores/esp8266/core_esp8266_si2c.cpp b/cores/esp8266/core_esp8266_si2c.cpp
index 28b6f99f40..e8f0ddb9c1 100644
--- a/cores/esp8266/core_esp8266_si2c.cpp
+++ b/cores/esp8266/core_esp8266_si2c.cpp
@@ -19,15 +19,15 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     Modified January 2017 by Bjorn Hammarberg (bjoham@esp8266.com) - i2c slave support
 */
-#include "PolledTimeout.h"
-#include "pins_arduino.h"
 #include "twi.h"
+#include "pins_arduino.h"
 #include "wiring_private.h"
+#include "PolledTimeout.h"
 
 extern "C"
 {
-#include "ets_sys.h"
 #include "twi_util.h"
+#include "ets_sys.h"
 };
 
 // Inline helpers
diff --git a/cores/esp8266/debug.cpp b/cores/esp8266/debug.cpp
index 7173c29ab7..327aace64e 100644
--- a/cores/esp8266/debug.cpp
+++ b/cores/esp8266/debug.cpp
@@ -18,8 +18,8 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#include "debug.h"
 #include "Arduino.h"
+#include "debug.h"
 #include "osapi.h"
 
 #ifdef DEBUG_ESP_CORE
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.cpp b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
index c6ed0fe997..611c3dfc38 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
@@ -22,14 +22,14 @@
 
 */
 
-#include <AddrList.h>
 #include <Schedule.h>
+#include <AddrList.h>
 
+#include "ESP8266mDNS.h"
+#include "LEAmDNS_Priv.h"
 #include <LwipIntf.h>  // LwipIntf::stateUpCB()
 #include <lwip/igmp.h>
 #include <lwip/prot/dns.h>
-#include "ESP8266mDNS.h"
-#include "LEAmDNS_Priv.h"
 
 namespace esp8266
 {
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.h b/libraries/ESP8266mDNS/src/LEAmDNS.h
index 7d7b8b7287..48ceab3b09 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.h
@@ -102,14 +102,14 @@
 #ifndef MDNS_H
 #define MDNS_H
 
-#include <PolledTimeout.h>
 #include <functional>  // for UdpContext.h
-#include <limits>
-#include <map>
 #include "WiFiUdp.h"
+#include "lwip/udp.h"
 #include "debug.h"
 #include "include/UdpContext.h"
-#include "lwip/udp.h"
+#include <limits>
+#include <PolledTimeout.h>
+#include <map>
 
 #include "ESP8266WiFi.h"
 
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
index 54f31c998b..7b66d086af 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
@@ -22,11 +22,11 @@
 
 */
 
-#include <AddrList.h>
+#include <sys/time.h>
 #include <IPAddress.h>
-#include <WString.h>
+#include <AddrList.h>
 #include <lwip/ip_addr.h>
-#include <sys/time.h>
+#include <WString.h>
 #include <cstdint>
 
 /*
@@ -39,8 +39,8 @@ extern "C"
 }
 
 #include "ESP8266mDNS.h"
-#include "LEAmDNS_Priv.h"
 #include "LEAmDNS_lwIPdefs.h"
+#include "LEAmDNS_Priv.h"
 
 namespace esp8266
 {
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
index 7a7f3e5104..74255552e6 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
@@ -26,8 +26,8 @@
 #include <stdlib_noniso.h>  // strrstr()
 
 #include "ESP8266mDNS.h"
-#include "LEAmDNS_Priv.h"
 #include "LEAmDNS_lwIPdefs.h"
+#include "LEAmDNS_Priv.h"
 
 namespace esp8266
 {
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
index 4248b582a8..6509e42b05 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
@@ -28,8 +28,8 @@ extern "C"
 }
 
 #include "ESP8266mDNS.h"
-#include "LEAmDNS_Priv.h"
 #include "LEAmDNS_lwIPdefs.h"
+#include "LEAmDNS_Priv.h"
 
 namespace esp8266
 {
diff --git a/libraries/Netdump/examples/Netdump/Netdump.ino b/libraries/Netdump/examples/Netdump/Netdump.ino
index 86523705b1..dbba63869b 100644
--- a/libraries/Netdump/examples/Netdump/Netdump.ino
+++ b/libraries/Netdump/examples/Netdump/Netdump.ino
@@ -1,9 +1,9 @@
 #include "Arduino.h"
 
-#include <ESP8266WebServer.h>
+#include "Netdump.h"
 #include <ESP8266WiFi.h>
+#include <ESP8266WebServer.h>
 #include <ESP8266mDNS.h>
-#include "Netdump.h"
 //#include <FS.h>
 #include <LittleFS.h>
 #include <map>
@@ -12,7 +12,7 @@ using namespace NetCapture;
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
 const char* ssid = STASSID;
@@ -24,8 +24,8 @@ Netdump nd;
 FS* filesystem = &LittleFS;
 
 ESP8266WebServer webServer(80);    // Used for sending commands
-WiFiServer tcpServer(8000);        // Used to show netcat option.
-File tracefile;
+WiFiServer       tcpServer(8000);  // Used to show netcat option.
+File             tracefile;
 
 std::map<PacketType, int> packetCount;
 
@@ -37,23 +37,25 @@ enum class SerialOption : uint8_t {
 
 void startSerial(SerialOption option) {
   switch (option) {
-    case SerialOption::AllFull:    //All Packets, show packet summary.
+    case SerialOption::AllFull : //All Packets, show packet summary.
       nd.printDump(Serial, Packet::PacketDetail::FULL);
       break;
 
-    case SerialOption::LocalNone:    // Only local IP traffic, full details
+    case SerialOption::LocalNone : // Only local IP traffic, full details
       nd.printDump(Serial, Packet::PacketDetail::NONE,
       [](Packet n) {
         return (n.hasIP(WiFi.localIP()));
-      });
+      }
+                  );
       break;
-    case SerialOption::HTTPChar:    // Only HTTP traffic, show packet content as chars
+    case SerialOption::HTTPChar : // Only HTTP traffic, show packet content as chars
       nd.printDump(Serial, Packet::PacketDetail::CHAR,
       [](Packet n) {
         return (n.isHTTP());
-      });
+      }
+                  );
       break;
-    default:
+    default :
       Serial.printf("No valid SerialOption provided\r\n");
   };
 }
@@ -97,14 +99,16 @@ void setup(void) {
       d.concat("<li>" + dir.fileName() + "</li>");
     }
     webServer.send(200, "text.html", d);
-  });
+  }
+              );
 
   webServer.on("/req",
   []() {
     static int rq = 0;
     String a = "<h1>You are connected, Number of requests = " + String(rq++) + "</h1>";
     webServer.send(200, "text/html", a);
-  });
+  }
+              );
 
   webServer.on("/reset",
   []() {
@@ -112,12 +116,13 @@ void setup(void) {
     tracefile.close();
     tcpServer.close();
     webServer.send(200, "text.html", "<h1>Netdump session reset</h1>");
-  });
+  }
+              );
 
   webServer.serveStatic("/", *filesystem, "/");
   webServer.begin();
 
-  startSerial(SerialOption::AllFull);    // Serial output examples, use enum SerialOption for selection
+  startSerial(SerialOption::AllFull); // Serial output examples, use enum SerialOption for selection
 
   //  startTcpDump();     // tcpdump option
   //  startTracefile();  // output to SPIFFS or LittleFS
@@ -125,21 +130,21 @@ void setup(void) {
   // use a self provide callback, this count network packets
   /*
     nd.setCallback(
-    [](Packet p)
-    {
-    Serial.printf("PKT : %s : ",p.sourceIP().toString().c_str());
-    for ( auto pp : p.allPacketTypes())
-  	  {
-  	     Serial.printf("%s ",pp.toString().c_str());
-  		 packetCount[pp]++;
-  	  }
-    Serial.printf("\r\n CNT ");
-    for (auto pc : packetCount)
-  	  {
-  	  	  Serial.printf("%s %d ", pc.first.toString().c_str(),pc.second);
-  	  }
-    Serial.printf("\r\n");
-    }
+     [](Packet p)
+     {
+  	  Serial.printf("PKT : %s : ",p.sourceIP().toString().c_str());
+  	  for ( auto pp : p.allPacketTypes())
+  		  {
+  		     Serial.printf("%s ",pp.toString().c_str());
+  			 packetCount[pp]++;
+  		  }
+  	  Serial.printf("\r\n CNT ");
+  	  for (auto pc : packetCount)
+  		  {
+  		  	  Serial.printf("%s %d ", pc.first.toString().c_str(),pc.second);
+  		  }
+  	  Serial.printf("\r\n");
+     }
     );
   */
 }
@@ -148,3 +153,4 @@ void loop(void) {
   webServer.handleClient();
   MDNS.update();
 }
+
diff --git a/libraries/Netdump/src/Netdump.h b/libraries/Netdump/src/Netdump.h
index dd5a3d124c..2dead84551 100644
--- a/libraries/Netdump/src/Netdump.h
+++ b/libraries/Netdump/src/Netdump.h
@@ -22,13 +22,13 @@
 #ifndef __NETDUMP_H
 #define __NETDUMP_H
 
-#include <ESP8266WiFi.h>
-#include <FS.h>
 #include <Print.h>
-#include <lwipopts.h>
 #include <functional>
-#include "CallBackList.h"
+#include <lwipopts.h>
+#include <FS.h>
 #include "NetdumpPacket.h"
+#include <ESP8266WiFi.h>
+#include "CallBackList.h"
 
 namespace NetCapture
 {
diff --git a/libraries/Netdump/src/NetdumpIP.h b/libraries/Netdump/src/NetdumpIP.h
index ae8efc7e94..bf93c7c940 100644
--- a/libraries/Netdump/src/NetdumpIP.h
+++ b/libraries/Netdump/src/NetdumpIP.h
@@ -8,10 +8,10 @@
 #ifndef LIBRARIES_ESPGOODIES_HR_SRC_NETDUMP_NETDUMPIP_H_
 #define LIBRARIES_ESPGOODIES_HR_SRC_NETDUMP_NETDUMPIP_H_
 
-#include <IPAddress.h>
-#include <StreamString.h>
-#include <lwip/init.h>
 #include <stdint.h>
+#include <lwip/init.h>
+#include <StreamString.h>
+#include <IPAddress.h>
 
 namespace NetCapture
 {
diff --git a/libraries/Netdump/src/NetdumpPacket.cpp b/libraries/Netdump/src/NetdumpPacket.cpp
index 9efad50490..0af8292bb2 100644
--- a/libraries/Netdump/src/NetdumpPacket.cpp
+++ b/libraries/Netdump/src/NetdumpPacket.cpp
@@ -19,8 +19,8 @@
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
-#include <lwip/init.h>
 #include "Netdump.h"
+#include <lwip/init.h>
 
 namespace NetCapture
 {
diff --git a/libraries/Netdump/src/NetdumpPacket.h b/libraries/Netdump/src/NetdumpPacket.h
index 8cf13169e0..f143ea832e 100644
--- a/libraries/Netdump/src/NetdumpPacket.h
+++ b/libraries/Netdump/src/NetdumpPacket.h
@@ -22,12 +22,12 @@
 #ifndef __NETDUMP_PACKET_H
 #define __NETDUMP_PACKET_H
 
+#include <lwipopts.h>
 #include <IPAddress.h>
 #include <StreamString.h>
-#include <lwipopts.h>
-#include <vector>
 #include "NetdumpIP.h"
 #include "PacketType.h"
+#include <vector>
 
 namespace NetCapture
 {
diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp
index f389a7b24e..495978b421 100644
--- a/libraries/Wire/Wire.cpp
+++ b/libraries/Wire/Wire.cpp
@@ -24,13 +24,13 @@
 
 extern "C"
 {
-#include <inttypes.h>
 #include <stdlib.h>
 #include <string.h>
+#include <inttypes.h>
 }
 
-#include "Wire.h"
 #include "twi.h"
+#include "Wire.h"
 
 //Some boards don't have these pins available, and hence don't support Wire.
 //Check here for compile-time error.
diff --git a/libraries/lwIP_PPP/src/PPPServer.cpp b/libraries/lwIP_PPP/src/PPPServer.cpp
index ef0e571ec5..04512102fd 100644
--- a/libraries/lwIP_PPP/src/PPPServer.cpp
+++ b/libraries/lwIP_PPP/src/PPPServer.cpp
@@ -10,8 +10,8 @@
 // using NAT instead (see in example)
 
 #include <Arduino.h>
-#include <IPAddress.h>
 #include <Schedule.h>
+#include <IPAddress.h>
 #include <lwip/dns.h>
 
 #include "PPPServer.h"
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
index a1ac345a3c..0fa4ca0989 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
@@ -35,9 +35,9 @@
 #include <Arduino.h>
 #include <SPI.h>
 
-#include <stdarg.h>
 #include <stdint.h>
 #include <stdio.h>
+#include <stdarg.h>
 #include <string.h>
 
 #include "enc28j60.h"
diff --git a/libraries/lwIP_w5100/src/utility/w5100.cpp b/libraries/lwIP_w5100/src/utility/w5100.cpp
index 661f2550c3..1251579744 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.cpp
+++ b/libraries/lwIP_w5100/src/utility/w5100.cpp
@@ -32,8 +32,8 @@
 
 // original sources: https://github.com/njh/W5100MacRaw
 
-#include "w5100.h"
 #include <SPI.h>
+#include "w5100.h"
 
 uint8_t Wiznet5100::wizchip_read(uint16_t address)
 {
diff --git a/libraries/lwIP_w5100/src/utility/w5100.h b/libraries/lwIP_w5100/src/utility/w5100.h
index 291d57362a..f099b22ea1 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.h
+++ b/libraries/lwIP_w5100/src/utility/w5100.h
@@ -35,9 +35,9 @@
 #ifndef W5100_H
 #define W5100_H
 
+#include <stdint.h>
 #include <Arduino.h>
 #include <SPI.h>
-#include <stdint.h>
 
 class Wiznet5100
 {
diff --git a/libraries/lwIP_w5500/src/utility/w5500.cpp b/libraries/lwIP_w5500/src/utility/w5500.cpp
index 89bc6a9be0..90f607f0cf 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.cpp
+++ b/libraries/lwIP_w5500/src/utility/w5500.cpp
@@ -32,8 +32,8 @@
 
 // original sources: https://github.com/njh/W5500MacRaw
 
-#include "w5500.h"
 #include <SPI.h>
+#include "w5500.h"
 
 uint8_t Wiznet5500::wizchip_read(uint8_t block, uint16_t address)
 {
diff --git a/libraries/lwIP_w5500/src/utility/w5500.h b/libraries/lwIP_w5500/src/utility/w5500.h
index 23d3159395..8b41529610 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.h
+++ b/libraries/lwIP_w5500/src/utility/w5500.h
@@ -35,9 +35,9 @@
 #ifndef W5500_H
 #define W5500_H
 
+#include <stdint.h>
 #include <Arduino.h>
 #include <SPI.h>
-#include <stdint.h>
 
 class Wiznet5500
 {
diff --git a/tests/device/libraries/BSTest/src/BSArgs.h b/tests/device/libraries/BSTest/src/BSArgs.h
index 879085b321..e939f55534 100644
--- a/tests/device/libraries/BSTest/src/BSArgs.h
+++ b/tests/device/libraries/BSTest/src/BSArgs.h
@@ -1,14 +1,14 @@
-/*  Splitting string into tokens, taking quotes and escape sequences into account.
-    From https://github.com/espressif/esp-idf/blob/master/components/console/split_argv.c
-    Copyright 2016-2017 Espressif Systems (Shanghai) PTE LTD
-    Licensed under the Apache License 2.0.
-*/
+/* Splitting string into tokens, taking quotes and escape sequences into account.
+ * From https://github.com/espressif/esp-idf/blob/master/components/console/split_argv.c
+ * Copyright 2016-2017 Espressif Systems (Shanghai) PTE LTD
+ * Licensed under the Apache License 2.0.
+ */
 
 #ifndef BS_ARGS_H
 #define BS_ARGS_H
 
-#include <ctype.h>
 #include <stdio.h>
+#include <ctype.h>
 #include <string.h>
 
 namespace bs
@@ -41,29 +41,29 @@ typedef enum
     } while (0);
 
 /**
-    @brief Split command line into arguments in place
-
-    - This function finds whitespace-separated arguments in the given input line.
-
-       'abc def 1 20 .3' -> [ 'abc', 'def', '1', '20', '.3' ]
-
-    - Argument which include spaces may be surrounded with quotes. In this case
-     spaces are preserved and quotes are stripped.
-
-       'abc "123 456" def' -> [ 'abc', '123 456', 'def' ]
-
-    - Escape sequences may be used to produce backslash, double quote, and space:
-
-       'a\ b\\c\"' -> [ 'a b\c"' ]
-
-    Pointers to at most argv_size - 1 arguments are returned in argv array.
-    The pointer after the last one (i.e. argv[argc]) is set to NULL.
-
-    @param line pointer to buffer to parse; it is modified in place
-    @param argv array where the pointers to arguments are written
-    @param argv_size number of elements in argv_array (max. number of arguments will be argv_size - 1)
-    @return number of arguments found (argc)
-*/
+ * @brief Split command line into arguments in place
+ *
+ * - This function finds whitespace-separated arguments in the given input line.
+ *
+ *     'abc def 1 20 .3' -> [ 'abc', 'def', '1', '20', '.3' ]
+ *
+ * - Argument which include spaces may be surrounded with quotes. In this case
+ *   spaces are preserved and quotes are stripped.
+ *
+ *     'abc "123 456" def' -> [ 'abc', '123 456', 'def' ]
+ *
+ * - Escape sequences may be used to produce backslash, double quote, and space:
+ *
+ *     'a\ b\\c\"' -> [ 'a b\c"' ]
+ *
+ * Pointers to at most argv_size - 1 arguments are returned in argv array.
+ * The pointer after the last one (i.e. argv[argc]) is set to NULL.
+ *
+ * @param line pointer to buffer to parse; it is modified in place
+ * @param argv array where the pointers to arguments are written
+ * @param argv_size number of elements in argv_array (max. number of arguments will be argv_size - 1)
+ * @return number of arguments found (argc)
+ */
 inline size_t split_args(char* line, char** argv, size_t argv_size)
 {
     const int QUOTE = '"';
diff --git a/tests/device/libraries/BSTest/test/test.cpp b/tests/device/libraries/BSTest/test/test.cpp
index 48da79d3bd..553f8013be 100644
--- a/tests/device/libraries/BSTest/test/test.cpp
+++ b/tests/device/libraries/BSTest/test/test.cpp
@@ -1,5 +1,5 @@
-#include <stdio.h>
 #include "BSTest.h"
+#include <stdio.h>
 
 BS_ENV_DECLARE();
 
diff --git a/tests/device/test_libc/libm_string.c b/tests/device/test_libc/libm_string.c
index 7b479a7d08..68b9c5e139 100644
--- a/tests/device/test_libc/libm_string.c
+++ b/tests/device/test_libc/libm_string.c
@@ -1,7 +1,7 @@
-#include <errno.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
+#include <stdlib.h>
+#include <errno.h>
 
 #define memcmp memcmp_P
 #define memcpy memcpy_P
@@ -46,9 +46,7 @@ _DEFUN(funcqual, (a, b, l), char* a _AND char* b _AND int l)
 
     //  line(l);
     if (a == NULL && b == NULL)
-    {
         return;
-    }
     if (strcmp(a, b))
     {
         printf("string.c:%d (%s)\n", l, it);
@@ -116,8 +114,8 @@ void libm_test_string()
     (void)strcat(one, "cd");
     equal(one, "cd");
 
-    /*  strncat - first test it as strcat, with big counts,
-        then test the count mechanism.  */
+    /* strncat - first test it as strcat, with big counts,
+     then test the count mechanism.  */
     it = "strncat";
     (void)strcpy(one, "ijk");
     check(strncat(one, "lmn", 99) == one); /* Returned value. */
@@ -419,75 +417,75 @@ void libm_test_string()
     equal(two, "hi there"); /* Just paranoia. */
     equal(one, "hi there"); /* Stomped on source? */
 #if 0
-    /* memmove - must work on overlap.  */
-    it = "memmove";
-    check(memmove(one, "abc", 4) == one); /* Returned value. */
-    equal(one, "abc");		/* Did the copy go right? */
-
-    (void) strcpy(one, "abcdefgh");
-    (void) memmove(one + 1, "xyz", 2);
-    equal(one, "axydefgh");	/* Basic test. */
-
-    (void) strcpy(one, "abc");
-    (void) memmove(one, "xyz", 0);
-    equal(one, "abc");		/* Zero-length copy. */
-
-    (void) strcpy(one, "hi there");
-    (void) strcpy(two, "foo");
-    (void) memmove(two, one, 9);
-    equal(two, "hi there");	/* Just paranoia. */
-    equal(one, "hi there");	/* Stomped on source? */
-
-    (void) strcpy(one, "abcdefgh");
-    (void) memmove(one + 1, one, 9);
-    equal(one, "aabcdefgh");	/* Overlap, right-to-left. */
-
-    (void) strcpy(one, "abcdefgh");
-    (void) memmove(one + 1, one + 2, 7);
-    equal(one, "acdefgh");	/* Overlap, left-to-right. */
-
-    (void) strcpy(one, "abcdefgh");
-    (void) memmove(one, one, 9);
-    equal(one, "abcdefgh");	/* 100% overlap. */
+  /* memmove - must work on overlap.  */
+  it = "memmove";
+  check(memmove(one, "abc", 4) == one); /* Returned value. */
+  equal(one, "abc");		/* Did the copy go right? */
+
+  (void) strcpy(one, "abcdefgh");
+  (void) memmove(one+1, "xyz", 2);
+  equal(one, "axydefgh");	/* Basic test. */
+
+  (void) strcpy(one, "abc");
+  (void) memmove(one, "xyz", 0);
+  equal(one, "abc");		/* Zero-length copy. */
+
+  (void) strcpy(one, "hi there");
+  (void) strcpy(two, "foo");
+  (void) memmove(two, one, 9);
+  equal(two, "hi there");	/* Just paranoia. */
+  equal(one, "hi there");	/* Stomped on source? */
+
+  (void) strcpy(one, "abcdefgh");
+  (void) memmove(one+1, one, 9);
+  equal(one, "aabcdefgh");	/* Overlap, right-to-left. */
+
+  (void) strcpy(one, "abcdefgh");
+  (void) memmove(one+1, one+2, 7);
+  equal(one, "acdefgh");	/* Overlap, left-to-right. */
+
+  (void) strcpy(one, "abcdefgh");
+  (void) memmove(one, one, 9);
+  equal(one, "abcdefgh");	/* 100% overlap. */
 #endif
 #if 0
-    /*  memccpy - first test like memcpy, then the search part
-        The SVID, the only place where memccpy is mentioned, says
-        overlap might fail, so we don't try it.  Besides, it's hard
-        to see the rationale for a non-left-to-right memccpy.  */
-    it = "memccpy";
-    check(memccpy(one, "abc", 'q', 4) == NULL); /* Returned value. */
-    equal(one, "abc");		/* Did the copy go right? */
-
-    (void) strcpy(one, "abcdefgh");
-    (void) memccpy(one + 1, "xyz", 'q', 2);
-    equal(one, "axydefgh");	/* Basic test. */
-
-    (void) strcpy(one, "abc");
-    (void) memccpy(one, "xyz", 'q', 0);
-    equal(one, "abc");		/* Zero-length copy. */
-
-    (void) strcpy(one, "hi there");
-    (void) strcpy(two, "foo");
-    (void) memccpy(two, one, 'q', 9);
-    equal(two, "hi there");	/* Just paranoia. */
-    equal(one, "hi there");	/* Stomped on source? */
-
-    (void) strcpy(one, "abcdefgh");
-    (void) strcpy(two, "horsefeathers");
-    check(memccpy(two, one, 'f', 9) == two + 6);	/* Returned value. */
-    equal(one, "abcdefgh");	/* Source intact? */
-    equal(two, "abcdefeathers"); /* Copy correct? */
-
-    (void) strcpy(one, "abcd");
-    (void) strcpy(two, "bumblebee");
-    check(memccpy(two, one, 'a', 4) == two + 1); /* First char. */
-    equal(two, "aumblebee");
-    check(memccpy(two, one, 'd', 4) == two + 4); /* Last char. */
-    equal(two, "abcdlebee");
-    (void) strcpy(one, "xyz");
-    check(memccpy(two, one, 'x', 1) == two + 1); /* Singleton. */
-    equal(two, "xbcdlebee");
+  /* memccpy - first test like memcpy, then the search part
+     The SVID, the only place where memccpy is mentioned, says
+     overlap might fail, so we don't try it.  Besides, it's hard
+     to see the rationale for a non-left-to-right memccpy.  */
+  it = "memccpy";
+  check(memccpy(one, "abc", 'q', 4) == NULL); /* Returned value. */
+  equal(one, "abc");		/* Did the copy go right? */
+
+  (void) strcpy(one, "abcdefgh");
+  (void) memccpy(one+1, "xyz", 'q', 2);
+  equal(one, "axydefgh");	/* Basic test. */
+
+  (void) strcpy(one, "abc");
+  (void) memccpy(one, "xyz", 'q', 0);
+  equal(one, "abc");		/* Zero-length copy. */
+
+  (void) strcpy(one, "hi there");
+  (void) strcpy(two, "foo");
+  (void) memccpy(two, one, 'q', 9);
+  equal(two, "hi there");	/* Just paranoia. */
+  equal(one, "hi there");	/* Stomped on source? */
+
+  (void) strcpy(one, "abcdefgh");
+  (void) strcpy(two, "horsefeathers");
+  check(memccpy(two, one, 'f', 9) == two+6);	/* Returned value. */
+  equal(one, "abcdefgh");	/* Source intact? */
+  equal(two, "abcdefeathers"); /* Copy correct? */
+
+  (void) strcpy(one, "abcd");
+  (void) strcpy(two, "bumblebee");
+  check(memccpy(two, one, 'a', 4) == two+1); /* First char. */
+  equal(two, "aumblebee");
+  check(memccpy(two, one, 'd', 4) == two+4); /* Last char. */
+  equal(two, "abcdlebee");
+  (void) strcpy(one, "xyz");
+  check(memccpy(two, one, 'x', 1) == two+1); /* Singleton. */
+  equal(two, "xbcdlebee");
 #endif
     /* memset.  */
     it = "memset";
@@ -505,8 +503,8 @@ void libm_test_string()
     (void)memset(one + 2, 010045, 1);
     equal(one, "ax\045xe"); /* Unsigned char convert. */
 
-    /*  bcopy - much like memcpy.
-        Berklix manual is silent about overlap, so don't test it.  */
+    /* bcopy - much like memcpy.
+     Berklix manual is silent about overlap, so don't test it.  */
     it = "bcopy";
     (void)bcopy("abc", one, 4);
     equal(one, "abc"); /* Simple copy. */
@@ -548,20 +546,18 @@ void libm_test_string()
     check(bcmp("abc", "def", 0) == 0);   /* Zero count. */
 
     if (errors)
-    {
         abort();
-    }
     printf("ok\n");
 
 #if 0 /* strerror - VERY system-dependent.  */
-    {
-        extern CONST unsigned int _sys_nerr;
-        extern CONST char *CONST _sys_errlist[];
-        int f;
-        it = "strerror";
-        f = open("/", O_WRONLY);	/* Should always fail. */
-        check(f < 0 && errno > 0 && errno < _sys_nerr);
-        equal(strerror(errno), _sys_errlist[errno]);
-    }
+{
+  extern CONST unsigned int _sys_nerr;
+  extern CONST char *CONST _sys_errlist[];
+  int f;
+  it = "strerror";
+  f = open("/", O_WRONLY);	/* Should always fail. */
+  check(f < 0 && errno > 0 && errno < _sys_nerr);
+  equal(strerror(errno), _sys_errlist[errno]);
+}
 #endif
 }
diff --git a/tests/device/test_libc/memcpy-1.c b/tests/device/test_libc/memcpy-1.c
index 7ba022115c..b16d1bd4ed 100644
--- a/tests/device/test_libc/memcpy-1.c
+++ b/tests/device/test_libc/memcpy-1.c
@@ -1,35 +1,35 @@
 /*
-    Copyright (c) 2011 ARM Ltd
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions
-    are met:
-    1. Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-    3. The name of the company may not be used to endorse or promote
-      products derived from this software without specific prior written
-      permission.
-
-    THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
-    WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-    IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-    TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2011 ARM Ltd
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ *    products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
 
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
 
 #define memcmp memcmp_P
 #define memcpy memcpy_P
@@ -107,8 +107,8 @@ void memcpy_main(void)
         backup_src[i] = src[i];
     }
 
-    /*  Make calls to memcpy with block sizes ranging between 1 and
-        MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
+    /* Make calls to memcpy with block sizes ranging between 1 and
+     MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
     for (sa = 0; sa <= MAX_OFFSET; sa++)
         for (da = 0; da <= MAX_OFFSET; da++)
             for (n = 1; n <= MAX_BLOCK_SIZE; n++)
@@ -116,9 +116,7 @@ void memcpy_main(void)
                 //printf (".");
                 /* Zero dest so we can check it properly after the copying.  */
                 for (j = 0; j < BUFF_SIZE; j++)
-                {
                     dest[j] = 0;
-                }
 
                 void* ret = memcpy(dest + START_COPY + da, src + sa, n);
 
@@ -131,9 +129,9 @@ void memcpy_main(void)
                         "(ret is %p, dest is %p)\n",
                         n, sa, da, ret, dest + START_COPY + da);
 
-                /*  Check that content of the destination buffer
-                    is the same as the source buffer, and
-                    memory outside destination buffer is not modified.  */
+                /* Check that content of the destination buffer
+             is the same as the source buffer, and
+             memory outside destination buffer is not modified.  */
                 for (j = 0; j < BUFF_SIZE; j++)
                     if ((unsigned)j < START_COPY + da)
                     {
@@ -174,9 +172,7 @@ void memcpy_main(void)
             }
 
     if (errors != 0)
-    {
         abort();
-    }
 
     printf("ok\n");
 }
diff --git a/tests/device/test_libc/memmove1.c b/tests/device/test_libc/memmove1.c
index 96b46d2887..8aadfb7753 100644
--- a/tests/device/test_libc/memmove1.c
+++ b/tests/device/test_libc/memmove1.c
@@ -1,38 +1,38 @@
-/*  A minor test-program for memmove.
-    Copyright (C) 2005 Axis Communications.
-    All rights reserved.
+/* A minor test-program for memmove.
+   Copyright (C) 2005 Axis Communications.
+   All rights reserved.
 
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions
-    are met:
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
 
-    1. Redistributions of source code must retain the above copyright
+   1. Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.
 
-    2. Neither the name of Axis Communications nor the names of its
+   2. Neither the name of Axis Communications nor the names of its
       contributors may be used to endorse or promote products derived
       from this software without specific prior written permission.
 
-    THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
-    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
-    COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-    IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-    POSSIBILITY OF SUCH DAMAGE.  */
-
-/*  Test moves of 0..MAX bytes; overlapping-src-higher,
-    overlapping-src-lower and non-overlapping.  The overlap varies with
-    1..N where N is the size moved.  This means an order of MAX**2
-    iterations.  The size of an octet may seem appropriate for MAX and
-    makes an upper limit for simple testing.  For the CRIS simulator,
-    making this 256 added 90s to the test-run (2GHz P4) while 64 (4s) was
-    enough to spot the bugs that had crept in, hence the number chosen.  */
+   THIS SOFTWARE IS PROVIDED BY AXIS COMMUNICATIONS AND ITS CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AXIS
+   COMMUNICATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+   POSSIBILITY OF SUCH DAMAGE.  */
+
+/* Test moves of 0..MAX bytes; overlapping-src-higher,
+   overlapping-src-lower and non-overlapping.  The overlap varies with
+   1..N where N is the size moved.  This means an order of MAX**2
+   iterations.  The size of an octet may seem appropriate for MAX and
+   makes an upper limit for simple testing.  For the CRIS simulator,
+   making this 256 added 90s to the test-run (2GHz P4) while 64 (4s) was
+   enough to spot the bugs that had crept in, hence the number chosen.  */
 #define MAX 64
 
 #include <stdio.h>
@@ -67,22 +67,18 @@ void mymemmove(unsigned char* dest, unsigned char* src, size_t n)
 {
     if ((src <= dest && src + n <= dest) || src >= dest)
         while (n-- > 0)
-        {
             *dest++ = *src++;
-        }
     else
     {
         dest += n;
         src += n;
         while (n-- > 0)
-        {
             *--dest = *--src;
-        }
     }
 }
 
-/*  It's either the noinline attribute or forcing the test framework to
-    pass -fno-builtin-memmove.  */
+/* It's either the noinline attribute or forcing the test framework to
+   pass -fno-builtin-memmove.  */
 void xmemmove(unsigned char* dest, unsigned char* src, size_t n)
     __attribute__((__noinline__));
 
@@ -99,16 +95,14 @@ void xmemmove(unsigned char* dest, unsigned char* src, size_t n)
     }
 }
 
-/*  Fill the array with something we can associate with a position, but
-    not exactly the same as the position index.  */
+/* Fill the array with something we can associate with a position, but
+   not exactly the same as the position index.  */
 
 void fill(unsigned char dest[MAX * 3])
 {
     size_t i;
     for (i = 0; i < MAX * 3; i++)
-    {
         dest[i] = (10 + i) % MAX;
-    }
 }
 
 void memmove_main(void)
@@ -116,9 +110,9 @@ void memmove_main(void)
     size_t i;
     int errors = 0;
 
-    /*  Leave some room before and after the area tested, so we can detect
-        overwrites of up to N bytes, N being the amount tested.  If you
-        want to test using valgrind, make these malloced instead.  */
+    /* Leave some room before and after the area tested, so we can detect
+     overwrites of up to N bytes, N being the amount tested.  If you
+     want to test using valgrind, make these malloced instead.  */
     unsigned char from_test[MAX * 3];
     unsigned char to_test[MAX * 3];
     unsigned char from_known[MAX * 3];
@@ -127,8 +121,8 @@ void memmove_main(void)
     /* Non-overlap.  */
     for (i = 0; i < MAX; i++)
     {
-        /*  Do the memmove first before setting the known array, so we know
-            it didn't change any of the known array.  */
+        /* Do the memmove first before setting the known array, so we know
+         it didn't change any of the known array.  */
         fill(from_test);
         fill(to_test);
         xmemmove(to_test + MAX, 1 + from_test + MAX, i);
@@ -191,8 +185,6 @@ void memmove_main(void)
     }
 
     if (errors != 0)
-    {
         abort();
-    }
     printf("ok\n");
 }
diff --git a/tests/device/test_libc/strcmp-1.c b/tests/device/test_libc/strcmp-1.c
index b996dc01ce..bfabf8e967 100644
--- a/tests/device/test_libc/strcmp-1.c
+++ b/tests/device/test_libc/strcmp-1.c
@@ -1,35 +1,35 @@
 /*
-    Copyright (c) 2011 ARM Ltd
-    All rights reserved.
+ * Copyright (c) 2011 ARM Ltd
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the company may not be used to endorse or promote
+ *    products derived from this software without specific prior written
+ *    permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
 
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions
-    are met:
-    1. Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-    3. The name of the company may not be used to endorse or promote
-      products derived from this software without specific prior written
-      permission.
-
-    THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
-    WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-    IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-    TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
 
 #define memcmp memcmp_P
 #define memcpy memcpy_P
@@ -46,8 +46,8 @@
 
 #define BUFF_SIZE 256
 
-/*  The macro LONG_TEST controls whether a short or a more comprehensive test
-    of strcmp should be performed.  */
+/* The macro LONG_TEST controls whether a short or a more comprehensive test
+   of strcmp should be performed.  */
 #ifdef LONG_TEST
 #ifndef BUFF_SIZE
 #define BUFF_SIZE 1024
@@ -146,8 +146,8 @@ void strcmp_main(void)
     char* p;
     int ret;
 
-    /*  Make calls to strcmp with block sizes ranging between 1 and
-        MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
+    /* Make calls to strcmp with block sizes ranging between 1 and
+     MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
     for (sa = 0; sa <= MAX_OFFSET; sa++)
         for (da = 0; da <= MAX_OFFSET; da++)
             for (n = 1; n <= MAX_BLOCK_SIZE; n++)
@@ -157,9 +157,7 @@ void strcmp_main(void)
                         for (zeros = 1; zeros < MAX_ZEROS; zeros++)
                         {
                             if (n - m > MAX_DIFF)
-                            {
                                 continue;
-                            }
                             /* Make a copy of the source.  */
                             for (i = 0; i < BUFF_SIZE; i++)
                             {
@@ -179,9 +177,7 @@ void strcmp_main(void)
                             /* Modify dest.  */
                             p = dest + da + m - 1;
                             for (j = 0; j < (int)len; j++)
-                            {
                                 *p++ = 'x';
-                            }
                             /* Make dest 0-terminated.  */
                             *p = '\0';
 
@@ -265,34 +261,26 @@ void strcmp_main(void)
     dest[0] = 0x41;
     ret = strcmp(src, dest);
     if (ret <= 0)
-    {
         print_error("\nFailed: expected positive, return %d\n", ret);
-    }
 
     src[0] = 0x01;
     dest[0] = 0x82;
     ret = strcmp(src, dest);
     if (ret >= 0)
-    {
         print_error("\nFailed: expected negative, return %d\n", ret);
-    }
 
     dest[0] = src[0] = 'D';
     src[3] = 0xc1;
     dest[3] = 0x41;
     ret = strcmp(src, dest);
     if (ret <= 0)
-    {
         print_error("\nFailed: expected positive, return %d\n", ret);
-    }
 
     src[3] = 0x01;
     dest[3] = 0x82;
     ret = strcmp(src, dest);
     if (ret >= 0)
-    {
         print_error("\nFailed: expected negative, return %d\n", ret);
-    }
 
     //printf ("\n");
     if (errors != 0)
diff --git a/tests/device/test_libc/tstring.c b/tests/device/test_libc/tstring.c
index 451dc4cf6e..fd6e16842e 100644
--- a/tests/device/test_libc/tstring.c
+++ b/tests/device/test_libc/tstring.c
@@ -1,14 +1,14 @@
 /*
-    Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
+ * Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
 
-    Permission to use, copy, modify, and distribute this software
-    is freely granted, provided that this notice is preserved.
-*/
-
-#include <pgmspace.h>
+#include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
+#include <pgmspace.h>
 
 #define MAX_1 50
 #define memcmp memcmp_P
@@ -238,19 +238,15 @@ void tstring_main(void)
     {
         for (i = j - 1; i <= j + 1; ++i)
         {
-            /*  don't bother checking unaligned data in the larger
-                sizes since it will waste time without performing additional testing */
+            /* don't bother checking unaligned data in the larger
+	     sizes since it will waste time without performing additional testing */
             if ((size_t)i <= 16 * sizeof(long))
             {
                 align_test_iterations = 2 * sizeof(long);
                 if ((size_t)i <= 2 * sizeof(long) + 1)
-                {
                     z = 2;
-                }
                 else
-                {
                     z = 2 * sizeof(long);
-                }
             }
             else
             {
@@ -358,9 +354,7 @@ void tstring_main(void)
     }
 
     if (test_failed)
-    {
         abort();
-    }
 
     printf("ok\n");
 }
diff --git a/tests/host/common/Arduino.cpp b/tests/host/common/Arduino.cpp
index eca6b82d32..2662fc3b5c 100644
--- a/tests/host/common/Arduino.cpp
+++ b/tests/host/common/Arduino.cpp
@@ -1,16 +1,16 @@
 /*
-    Arduino.cpp - Mocks for common Arduino APIs
-    Copyright © 2016 Ivan Grokhotkov
-
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
-
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
+ Arduino.cpp - Mocks for common Arduino APIs
+ Copyright © 2016 Ivan Grokhotkov
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
 */
 
 #include <sys/time.h>
@@ -28,9 +28,7 @@ extern "C" unsigned long millis()
     timeval time;
     gettimeofday(&time, NULL);
     if (gtod0.tv_sec == 0)
-    {
         memcpy(&gtod0, &time, sizeof gtod0);
-    }
     return ((time.tv_sec - gtod0.tv_sec) * 1000) + ((time.tv_usec - gtod0.tv_usec) / 1000);
 }
 
@@ -39,9 +37,7 @@ extern "C" unsigned long micros()
     timeval time;
     gettimeofday(&time, NULL);
     if (gtod0.tv_sec == 0)
-    {
         memcpy(&gtod0, &time, sizeof gtod0);
-    }
     return ((time.tv_sec - gtod0.tv_sec) * 1000000) + time.tv_usec - gtod0.tv_usec;
 }
 
diff --git a/tests/host/common/ArduinoCatch.cpp b/tests/host/common/ArduinoCatch.cpp
index e15ef335e4..c0e835495d 100644
--- a/tests/host/common/ArduinoCatch.cpp
+++ b/tests/host/common/ArduinoCatch.cpp
@@ -1,19 +1,19 @@
 /*
-    Arduino.cpp - Mocks for common Arduino APIs
-    Copyright © 2016 Ivan Grokhotkov
-
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
-
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
+ Arduino.cpp - Mocks for common Arduino APIs
+ Copyright © 2016 Ivan Grokhotkov
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
 */
 
 #define CATCH_CONFIG_MAIN
-#include <sys/time.h>
 #include <catch.hpp>
+#include <sys/time.h>
 #include "Arduino.h"
diff --git a/tests/host/common/ArduinoMain.cpp b/tests/host/common/ArduinoMain.cpp
index 73ebbcf7e3..f8f0e9d13e 100644
--- a/tests/host/common/ArduinoMain.cpp
+++ b/tests/host/common/ArduinoMain.cpp
@@ -1,43 +1,43 @@
 /*
-    Arduino emulator main loop
-    Copyright (c) 2018 david gauchard. All rights reserved.
-
-    Permission is hereby granted, free of charge, to any person obtaining a
-    copy of this software and associated documentation files (the "Software"),
-    to deal with the Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the
-    Software is furnished to do so, subject to the following conditions:
-
-    - Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimers.
-
-    - Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimers in the
-    documentation and/or other materials provided with the distribution.
-
-    - The names of its contributors may not be used to endorse or promote
-    products derived from this Software without specific prior written
-    permission.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS WITH THE SOFTWARE.
+ Arduino emulator main loop
+ Copyright (c) 2018 david gauchard. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal with the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ - Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimers.
+
+ - Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimers in the
+   documentation and/or other materials provided with the distribution.
+
+ - The names of its contributors may not be used to endorse or promote
+   products derived from this Software without specific prior written
+   permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
 */
 
 #include <Arduino.h>
 #include <user_interface.h>  // wifi_get_ip_info()
 
-#include <getopt.h>
 #include <signal.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <termios.h>
 #include <stdarg.h>
 #include <stdio.h>
-#include <termios.h>
-#include <unistd.h>
 
 #define MOCK_PORT_SHIFTER 9000
 
@@ -61,9 +61,7 @@ int mockverbose(const char* fmt, ...)
     va_list ap;
     va_start(ap, fmt);
     if (mockdebug)
-    {
         return fprintf(stderr, MOCK) + vfprintf(stderr, fmt, ap);
-    }
     return 0;
 }
 
@@ -100,9 +98,7 @@ static int mock_start_uart(void)
 static int mock_stop_uart(void)
 {
     if (!restore_tty)
-    {
         return 0;
-    }
     if (!isatty(STDIN))
     {
         perror("restoring tty: isatty(STDIN)");
@@ -182,17 +178,13 @@ void make_fs_filename(String& name, const char* fspath, const char* argv0)
         int lastSlash = -1;
         for (int i = 0; argv0[i]; i++)
             if (argv0[i] == '/')
-            {
                 lastSlash = i;
-            }
         name = fspath;
         name += '/';
         name += &argv0[lastSlash + 1];
     }
     else
-    {
         name = argv0;
-    }
 }
 
 void control_c(int sig)
@@ -216,21 +208,15 @@ int main(int argc, char* const argv[])
     signal(SIGINT, control_c);
     signal(SIGTERM, control_c);
     if (geteuid() == 0)
-    {
         mock_port_shifter = 0;
-    }
     else
-    {
         mock_port_shifter = MOCK_PORT_SHIFTER;
-    }
 
     for (;;)
     {
         int n = getopt_long(argc, argv, "hlcfbvTi:S:s:L:P:1", options, NULL);
         if (n < 0)
-        {
             break;
-        }
         switch (n)
         {
             case 'h':
@@ -320,21 +306,15 @@ int main(int argc, char* const argv[])
         uint8_t data = mock_read_uart();
 
         if (data)
-        {
             uart_new_data(UART0, data);
-        }
         if (!fast)
-        {
             usleep(1000);  // not 100% cpu, ~1000 loops per second
-        }
         loop();
         loop_end();
         check_incoming_udp();
 
         if (run_once)
-        {
             user_exit = true;
-        }
     }
     cleanup();
 
diff --git a/tests/host/common/ArduinoMainLittlefs.cpp b/tests/host/common/ArduinoMainLittlefs.cpp
index a9b7974cf5..c85e0b9dbc 100644
--- a/tests/host/common/ArduinoMainLittlefs.cpp
+++ b/tests/host/common/ArduinoMainLittlefs.cpp
@@ -11,8 +11,6 @@ void mock_start_littlefs(const String& fname, size_t size_kb, size_t block_kb, s
 void mock_stop_littlefs()
 {
     if (littlefs_mock)
-    {
         delete littlefs_mock;
-    }
     littlefs_mock = nullptr;
 }
diff --git a/tests/host/common/ArduinoMainSpiffs.cpp b/tests/host/common/ArduinoMainSpiffs.cpp
index 8530a316f0..035cc9e752 100644
--- a/tests/host/common/ArduinoMainSpiffs.cpp
+++ b/tests/host/common/ArduinoMainSpiffs.cpp
@@ -11,8 +11,6 @@ void mock_start_spiffs(const String& fname, size_t size_kb, size_t block_kb, siz
 void mock_stop_spiffs()
 {
     if (spiffs_mock)
-    {
         delete spiffs_mock;
-    }
     spiffs_mock = nullptr;
 }
diff --git a/tests/host/common/ArduinoMainUdp.cpp b/tests/host/common/ArduinoMainUdp.cpp
index 2c0bb90841..18d3c591fe 100644
--- a/tests/host/common/ArduinoMainUdp.cpp
+++ b/tests/host/common/ArduinoMainUdp.cpp
@@ -1,32 +1,32 @@
 /*
-    Arduino emulator main loop
-    Copyright (c) 2018 david gauchard. All rights reserved.
-
-    Permission is hereby granted, free of charge, to any person obtaining a
-    copy of this software and associated documentation files (the "Software"),
-    to deal with the Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the
-    Software is furnished to do so, subject to the following conditions:
-
-    - Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimers.
-
-    - Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimers in the
-    documentation and/or other materials provided with the distribution.
-
-    - The names of its contributors may not be used to endorse or promote
-    products derived from this Software without specific prior written
-    permission.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS WITH THE SOFTWARE.
+ Arduino emulator main loop
+ Copyright (c) 2018 david gauchard. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal with the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ - Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimers.
+
+ - Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimers in the
+   documentation and/or other materials provided with the distribution.
+
+ - The names of its contributors may not be used to endorse or promote
+   products derived from this Software without specific prior written
+   permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
 */
 
 #include <include/UdpContext.h>
@@ -38,13 +38,9 @@ std::map<int, UdpContext*> udps;
 void register_udp(int sock, UdpContext* udp)
 {
     if (udp)
-    {
         udps[sock] = udp;
-    }
     else
-    {
         udps.erase(sock);
-    }
 }
 
 void check_incoming_udp()
diff --git a/tests/host/common/ClientContextSocket.cpp b/tests/host/common/ClientContextSocket.cpp
index 70ec1d5216..34dcde16d8 100644
--- a/tests/host/common/ClientContextSocket.cpp
+++ b/tests/host/common/ClientContextSocket.cpp
@@ -1,43 +1,43 @@
 
 /*
-    Arduino emulation - socket part of ClientContext
-    Copyright (c) 2018 david gauchard. All rights reserved.
-
-    Permission is hereby granted, free of charge, to any person obtaining a
-    copy of this software and associated documentation files (the "Software"),
-    to deal with the Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the
-    Software is furnished to do so, subject to the following conditions:
-
-    - Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimers.
-
-    - Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimers in the
-    documentation and/or other materials provided with the distribution.
-
-    - The names of its contributors may not be used to endorse or promote
-    products derived from this Software without specific prior written
-    permission.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS WITH THE SOFTWARE.
+ Arduino emulation - socket part of ClientContext
+ Copyright (c) 2018 david gauchard. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal with the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ - Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimers.
+
+ - Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimers in the
+   documentation and/or other materials provided with the distribution.
+
+ - The names of its contributors may not be used to endorse or promote
+   products derived from this Software without specific prior written
+   permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
 */
 // separated from lwIP to avoid type conflicts
 
-#include <arpa/inet.h>
-#include <errno.h>
-#include <fcntl.h>
+#include <unistd.h>
+#include <sys/socket.h>
 #include <netinet/tcp.h>
+#include <arpa/inet.h>
 #include <poll.h>
-#include <sys/socket.h>
-#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
 
 int mockSockSetup(int sock)
 {
@@ -113,9 +113,7 @@ ssize_t mockPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char
     // usersize==0: peekAvailable()
 
     if (usersize > CCBUFSIZE)
-    {
         mockverbose("CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
-    }
 
     struct pollfd p;
     size_t retsize = 0;
@@ -135,10 +133,8 @@ ssize_t mockPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char
         }
 
         if (usersize == 0 && ccinbufsize)
-        // peekAvailable
-        {
+            // peekAvailable
             return ccinbufsize;
-        }
 
         if (usersize <= ccinbufsize)
         {
@@ -164,9 +160,7 @@ ssize_t mockRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf
 {
     ssize_t copied = mockPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
     if (copied < 0)
-    {
         return -1;
-    }
     // swallow (XXX use a circular buffer)
     memmove(ccinbuf, ccinbuf + copied, ccinbufsize - copied);
     ccinbufsize -= copied;
@@ -201,9 +195,7 @@ ssize_t mockWrite(int sock, const uint8_t* data, size_t size, int timeout_ms)
             }
             sent += ret;
             if (sent < size)
-            {
                 fprintf(stderr, MOCK "ClientContext::write: sent %d bytes (%zd / %zd)\n", ret, sent, size);
-            }
         }
     }
 #ifdef DEBUG_ESP_WIFI
diff --git a/tests/host/common/ClientContextTools.cpp b/tests/host/common/ClientContextTools.cpp
index 2574c152d1..b3236d9f41 100644
--- a/tests/host/common/ClientContextTools.cpp
+++ b/tests/host/common/ClientContextTools.cpp
@@ -1,39 +1,39 @@
 /*
-    Arduino emulation - part of ClientContext
-    Copyright (c) 2018 david gauchard. All rights reserved.
-
-    Permission is hereby granted, free of charge, to any person obtaining a
-    copy of this software and associated documentation files (the "Software"),
-    to deal with the Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the
-    Software is furnished to do so, subject to the following conditions:
-
-    - Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimers.
-
-    - Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimers in the
-    documentation and/or other materials provided with the distribution.
-
-    - The names of its contributors may not be used to endorse or promote
-    products derived from this Software without specific prior written
-    permission.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS WITH THE SOFTWARE.
+ Arduino emulation - part of ClientContext
+ Copyright (c) 2018 david gauchard. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal with the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ - Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimers.
+
+ - Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimers in the
+   documentation and/or other materials provided with the distribution.
+
+ - The names of its contributors may not be used to endorse or promote
+   products derived from this Software without specific prior written
+   permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
 */
 
-#include <WiFiClient.h>
-#include <include/ClientContext.h>
 #include <lwip/def.h>
-#include <lwip/dns.h>
 #include <lwip/tcp.h>
+#include <lwip/dns.h>
+#include <WiFiClient.h>
+#include <include/ClientContext.h>
 
 #include <netdb.h>  // gethostbyname
 
@@ -43,9 +43,7 @@ err_t dns_gethostbyname(const char* hostname, ip_addr_t* addr, dns_found_callbac
     (void)found;
     struct hostent* hbn = gethostbyname(hostname);
     if (!hbn)
-    {
         return ERR_TIMEOUT;
-    }
     addr->addr = *(uint32_t*)hbn->h_addr_list[0];
     return ERR_OK;
 }
diff --git a/tests/host/common/EEPROM.h b/tests/host/common/EEPROM.h
index faeafa590d..669d60bfaf 100644
--- a/tests/host/common/EEPROM.h
+++ b/tests/host/common/EEPROM.h
@@ -1,32 +1,32 @@
 /*
-    Arduino EEPROM emulation
-    Copyright (c) 2018 david gauchard. All rights reserved.
+ Arduino EEPROM emulation
+ Copyright (c) 2018 david gauchard. All rights reserved.
 
-    Permission is hereby granted, free of charge, to any person obtaining a
-    copy of this software and associated documentation files (the "Software"),
-    to deal with the Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the
-    Software is furnished to do so, subject to the following conditions:
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal with the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
 
-    - Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimers.
+ - Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimers.
 
-    - Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimers in the
-    documentation and/or other materials provided with the distribution.
+ - Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimers in the
+   documentation and/or other materials provided with the distribution.
 
-    - The names of its contributors may not be used to endorse or promote
-    products derived from this Software without specific prior written
-    permission.
+ - The names of its contributors may not be used to endorse or promote
+   products derived from this Software without specific prior written
+   permission.
 
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS WITH THE SOFTWARE.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
 */
 
 #ifndef EEPROM_MOCK
@@ -49,13 +49,9 @@ class EEPROMClass
     T& get(int const address, T& t)
     {
         if (address < 0 || address + sizeof(T) > _size)
-        {
             return t;
-        }
         for (size_t i = 0; i < sizeof(T); i++)
-        {
             ((uint8_t*)&t)[i] = read(i);
-        }
         return t;
     }
 
@@ -63,26 +59,16 @@ class EEPROMClass
     const T& put(int const address, const T& t)
     {
         if (address < 0 || address + sizeof(T) > _size)
-        {
             return t;
-        }
         for (size_t i = 0; i < sizeof(T); i++)
-        {
             write(i, ((uint8_t*)&t)[i]);
-        }
         return t;
     }
 
-    size_t length()
-    {
-        return _size;
-    }
+    size_t length() { return _size; }
 
     //uint8_t& operator[](int const address) { return read(address); }
-    uint8_t operator[](int address)
-    {
-        return read(address);
-    }
+    uint8_t operator[](int address) { return read(address); }
 
    protected:
     size_t _size = 0;
diff --git a/tests/host/common/HostWiring.cpp b/tests/host/common/HostWiring.cpp
index b3c6b6eb9c..892b336b2c 100644
--- a/tests/host/common/HostWiring.cpp
+++ b/tests/host/common/HostWiring.cpp
@@ -1,32 +1,32 @@
 /*
-    Arduino: wire emulation
-    Copyright (c) 2018 david gauchard. All rights reserved.
+ Arduino: wire emulation
+ Copyright (c) 2018 david gauchard. All rights reserved.
 
-    Permission is hereby granted, free of charge, to any person obtaining a
-    copy of this software and associated documentation files (the "Software"),
-    to deal with the Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the
-    Software is furnished to do so, subject to the following conditions:
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal with the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
 
-    - Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimers.
+ - Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimers.
 
-    - Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimers in the
-    documentation and/or other materials provided with the distribution.
+ - Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimers in the
+   documentation and/or other materials provided with the distribution.
 
-    - The names of its contributors may not be used to endorse or promote
-    products derived from this Software without specific prior written
-    permission.
+ - The names of its contributors may not be used to endorse or promote
+   products derived from this Software without specific prior written
+   permission.
 
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS WITH THE SOFTWARE.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
 */
 
 #include <Arduino.h>
diff --git a/tests/host/common/MockDigital.cpp b/tests/host/common/MockDigital.cpp
index 1c63a3b8df..0820ea63f1 100644
--- a/tests/host/common/MockDigital.cpp
+++ b/tests/host/common/MockDigital.cpp
@@ -1,32 +1,32 @@
 /*
-    digital.c - wiring digital implementation for esp8266
+  digital.c - wiring digital implementation for esp8266
 
-    Copyright (c) 2015 Hristo Gochkov. All rights reserved.
-    This file is part of the esp8266 core for Arduino environment.
+  Copyright (c) 2015 Hristo Gochkov. All rights reserved.
+  This file is part of the esp8266 core for Arduino environment.
 
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
 
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
 
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 #define ARDUINO_MAIN
+#include "wiring_private.h"
+#include "pins_arduino.h"
 #include "c_types.h"
-#include "core_esp8266_waveform.h"
 #include "eagle_soc.h"
 #include "ets_sys.h"
-#include "interrupts.h"
-#include "pins_arduino.h"
 #include "user_interface.h"
-#include "wiring_private.h"
+#include "core_esp8266_waveform.h"
+#include "interrupts.h"
 
 extern "C"
 {
diff --git a/tests/host/common/MockEEPROM.cpp b/tests/host/common/MockEEPROM.cpp
index e28114a714..5dcb0ac18a 100644
--- a/tests/host/common/MockEEPROM.cpp
+++ b/tests/host/common/MockEEPROM.cpp
@@ -1,32 +1,32 @@
 /*
-    Arduino emulation - EEPROM
-    Copyright (c) 2018 david gauchard. All rights reserved.
-
-    Permission is hereby granted, free of charge, to any person obtaining a
-    copy of this software and associated documentation files (the "Software"),
-    to deal with the Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the
-    Software is furnished to do so, subject to the following conditions:
-
-    - Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimers.
-
-    - Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimers in the
-    documentation and/or other materials provided with the distribution.
-
-    - The names of its contributors may not be used to endorse or promote
-    products derived from this Software without specific prior written
-    permission.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS WITH THE SOFTWARE.
+ Arduino emulation - EEPROM
+ Copyright (c) 2018 david gauchard. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal with the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ - Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimers.
+
+ - Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimers in the
+   documentation and/or other materials provided with the distribution.
+
+ - The names of its contributors may not be used to endorse or promote
+   products derived from this Software without specific prior written
+   permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
 */
 
 #ifndef __EEPROM_H
@@ -34,11 +34,11 @@
 
 #include <EEPROM.h>
 
-#include <errno.h>
-#include <fcntl.h>
 #include <sys/stat.h>
-#include <sys/types.h>
+#include <fcntl.h>
 #include <unistd.h>
+#include <sys/types.h>
+#include <errno.h>
 
 #define EEPROM_FILE_NAME "eeprom"
 
@@ -49,9 +49,7 @@ EEPROMClass::EEPROMClass()
 EEPROMClass::~EEPROMClass()
 {
     if (_fd >= 0)
-    {
         close(_fd);
-    }
 }
 
 void EEPROMClass::begin(size_t size)
@@ -67,9 +65,7 @@ void EEPROMClass::begin(size_t size)
 void EEPROMClass::end()
 {
     if (_fd != -1)
-    {
         close(_fd);
-    }
 }
 
 bool EEPROMClass::commit()
@@ -81,22 +77,16 @@ uint8_t EEPROMClass::read(int x)
 {
     char c = 0;
     if (pread(_fd, &c, 1, x) != 1)
-    {
         fprintf(stderr, MOCK "eeprom: %s\n\r", strerror(errno));
-    }
     return c;
 }
 
 void EEPROMClass::write(int x, uint8_t c)
 {
     if (x > (int)_size)
-    {
         fprintf(stderr, MOCK "### eeprom beyond\r\n");
-    }
     else if (pwrite(_fd, &c, 1, x) != 1)
-    {
         fprintf(stderr, MOCK "eeprom: %s\n\r", strerror(errno));
-    }
 }
 
 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_EEPROM)
diff --git a/tests/host/common/MockEsp.cpp b/tests/host/common/MockEsp.cpp
index f61333273f..21908ba447 100644
--- a/tests/host/common/MockEsp.cpp
+++ b/tests/host/common/MockEsp.cpp
@@ -1,32 +1,32 @@
 /*
-    Arduino emulation - esp8266's core
-    Copyright (c) 2018 david gauchard. All rights reserved.
-
-    Permission is hereby granted, free of charge, to any person obtaining a
-    copy of this software and associated documentation files (the "Software"),
-    to deal with the Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the
-    Software is furnished to do so, subject to the following conditions:
-
-    - Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimers.
-
-    - Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimers in the
-    documentation and/or other materials provided with the distribution.
-
-    - The names of its contributors may not be used to endorse or promote
-    products derived from this Software without specific prior written
-    permission.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS WITH THE SOFTWARE.
+ Arduino emulation - esp8266's core
+ Copyright (c) 2018 david gauchard. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal with the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ - Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimers.
+
+ - Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimers in the
+   documentation and/or other materials provided with the distribution.
+
+ - The names of its contributors may not be used to endorse or promote
+   products derived from this Software without specific prior written
+   permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
 */
 
 #include <Esp.h>
@@ -148,17 +148,11 @@ void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag)
     float hm = 1 * 1024;
 
     if (hfree)
-    {
         *hfree = hf;
-    }
     if (hmax)
-    {
         *hmax = hm;
-    }
     if (hfrag)
-    {
         *hfrag = 100 - (sqrt(hm) * 100) / hf;
-    }
 }
 
 bool EspClass::flashEraseSector(uint32_t sector)
diff --git a/tests/host/common/MockSPI.cpp b/tests/host/common/MockSPI.cpp
index 3efef67ac9..629970f436 100644
--- a/tests/host/common/MockSPI.cpp
+++ b/tests/host/common/MockSPI.cpp
@@ -1,32 +1,32 @@
 /*
-    Arduino emulation - spi
-    Copyright (c) 2018 david gauchard. All rights reserved.
-
-    Permission is hereby granted, free of charge, to any person obtaining a
-    copy of this software and associated documentation files (the "Software"),
-    to deal with the Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the
-    Software is furnished to do so, subject to the following conditions:
-
-    - Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimers.
-
-    - Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimers in the
-    documentation and/or other materials provided with the distribution.
-
-    - The names of its contributors may not be used to endorse or promote
-    products derived from this Software without specific prior written
-    permission.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS WITH THE SOFTWARE.
+ Arduino emulation - spi
+ Copyright (c) 2018 david gauchard. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal with the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ - Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimers.
+
+ - Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimers in the
+   documentation and/or other materials provided with the distribution.
+
+ - The names of its contributors may not be used to endorse or promote
+   products derived from this Software without specific prior written
+   permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
 */
 
 #include <SPI.h>
diff --git a/tests/host/common/MockTools.cpp b/tests/host/common/MockTools.cpp
index 4a469053f6..fda6895949 100644
--- a/tests/host/common/MockTools.cpp
+++ b/tests/host/common/MockTools.cpp
@@ -1,32 +1,32 @@
 /*
-    Arduino emulation - tools
-    Copyright (c) 2018 david gauchard. All rights reserved.
+ Arduino emulation - tools
+ Copyright (c) 2018 david gauchard. All rights reserved.
 
-    Permission is hereby granted, free of charge, to any person obtaining a
-    copy of this software and associated documentation files (the "Software"),
-    to deal with the Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the
-    Software is furnished to do so, subject to the following conditions:
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal with the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
 
-    - Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimers.
+ - Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimers.
 
-    - Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimers in the
-    documentation and/or other materials provided with the distribution.
+ - Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimers in the
+   documentation and/or other materials provided with the distribution.
 
-    - The names of its contributors may not be used to endorse or promote
-    products derived from this Software without specific prior written
-    permission.
+ - The names of its contributors may not be used to endorse or promote
+   products derived from this Software without specific prior written
+   permission.
 
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS WITH THE SOFTWARE.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
 */
 
 #include <arpa/inet.h>
@@ -34,35 +34,14 @@
 
 extern "C"
 {
-    uint32_t lwip_htonl(uint32_t hostlong)
-    {
-        return htonl(hostlong);
-    }
-    uint16_t lwip_htons(uint16_t hostshort)
-    {
-        return htons(hostshort);
-    }
-    uint32_t lwip_ntohl(uint32_t netlong)
-    {
-        return ntohl(netlong);
-    }
-    uint16_t lwip_ntohs(uint16_t netshort)
-    {
-        return ntohs(netshort);
-    }
+    uint32_t lwip_htonl(uint32_t hostlong) { return htonl(hostlong); }
+    uint16_t lwip_htons(uint16_t hostshort) { return htons(hostshort); }
+    uint32_t lwip_ntohl(uint32_t netlong) { return ntohl(netlong); }
+    uint16_t lwip_ntohs(uint16_t netshort) { return ntohs(netshort); }
 
-    char* ets_strcpy(char* d, const char* s)
-    {
-        return strcpy(d, s);
-    }
-    char* ets_strncpy(char* d, const char* s, size_t n)
-    {
-        return strncpy(d, s, n);
-    }
-    size_t ets_strlen(const char* s)
-    {
-        return strlen(s);
-    }
+    char* ets_strcpy(char* d, const char* s) { return strcpy(d, s); }
+    char* ets_strncpy(char* d, const char* s, size_t n) { return strncpy(d, s, n); }
+    size_t ets_strlen(const char* s) { return strlen(s); }
 
     int ets_printf(const char* fmt, ...)
     {
@@ -77,29 +56,14 @@ extern "C"
     void stack_thunk_del_ref() {}
     void stack_thunk_repaint() {}
 
-    uint32_t stack_thunk_get_refcnt()
-    {
-        return 0;
-    }
-    uint32_t stack_thunk_get_stack_top()
-    {
-        return 0;
-    }
-    uint32_t stack_thunk_get_stack_bot()
-    {
-        return 0;
-    }
-    uint32_t stack_thunk_get_cont_sp()
-    {
-        return 0;
-    }
-    uint32_t stack_thunk_get_max_usage()
-    {
-        return 0;
-    }
+    uint32_t stack_thunk_get_refcnt() { return 0; }
+    uint32_t stack_thunk_get_stack_top() { return 0; }
+    uint32_t stack_thunk_get_stack_bot() { return 0; }
+    uint32_t stack_thunk_get_cont_sp() { return 0; }
+    uint32_t stack_thunk_get_max_usage() { return 0; }
     void stack_thunk_dump_stack() {}
 
-    // Thunking macro
+// Thunking macro
 #define make_stack_thunk(fcnToThunk)
 };
 
diff --git a/tests/host/common/MockUART.cpp b/tests/host/common/MockUART.cpp
index eec93ca590..4ea89cddc1 100644
--- a/tests/host/common/MockUART.cpp
+++ b/tests/host/common/MockUART.cpp
@@ -1,36 +1,36 @@
 /*
-    MockUART.cpp - esp8266 UART HAL EMULATION
+ MockUART.cpp - esp8266 UART HAL EMULATION
 
-    Copyright (c) 2019 Clemens Kirchgatterer. All rights reserved.
-    This file is part of the esp8266 core for Arduino environment.
+ Copyright (c) 2019 Clemens Kirchgatterer. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
 
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
 
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
 
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
 
 /*
-    This UART driver is directly derived from the ESP8266 UART HAL driver
-    Copyright (c) 2014 Ivan Grokhotkov. It provides the same API as the
-    original driver and was striped from all HW dependent interfaces.
+ This UART driver is directly derived from the ESP8266 UART HAL driver
+ Copyright (c) 2014 Ivan Grokhotkov. It provides the same API as the
+ original driver and was striped from all HW dependent interfaces.
 
-    UART0 writes got to stdout, while UART1 writes got to stderr. The user
-    is responsible for feeding the RX FIFO new data by calling uart_new_data().
-*/
+ UART0 writes got to stdout, while UART1 writes got to stderr. The user
+ is responsible for feeding the RX FIFO new data by calling uart_new_data().
+ */
 
+#include <unistd.h>    // write
 #include <sys/time.h>  // gettimeofday
 #include <time.h>      // localtime
-#include <unistd.h>    // write
 
 #include "Arduino.h"
 #include "uart.h"
@@ -111,9 +111,7 @@ extern "C"
             return;
 #else
             if (++rx_buffer->rpos == rx_buffer->size)
-            {
                 rx_buffer->rpos = 0;
-            }
 #endif
         }
         rx_buffer->buffer[rx_buffer->wpos] = data;
@@ -140,9 +138,7 @@ extern "C"
         size_t ret = rx_buffer->wpos - rx_buffer->rpos;
 
         if (rx_buffer->wpos < rx_buffer->rpos)
-        {
             ret = (rx_buffer->wpos + rx_buffer->size) - rx_buffer->rpos;
-        }
 
         return ret;
     }
@@ -170,9 +166,7 @@ extern "C"
     uart_rx_available(uart_t* uart)
     {
         if (uart == NULL || !uart->rx_enabled)
-        {
             return 0;
-        }
 
         return uart_rx_available_unsafe(uart->rx_buffer);
     }
@@ -181,14 +175,10 @@ extern "C"
     uart_peek_char(uart_t* uart)
     {
         if (uart == NULL || !uart->rx_enabled)
-        {
             return -1;
-        }
 
         if (!uart_rx_available_unsafe(uart->rx_buffer))
-        {
             return -1;
-        }
 
         return uart->rx_buffer->buffer[uart->rx_buffer->rpos];
     }
@@ -204,17 +194,13 @@ extern "C"
     uart_read(uart_t* uart, char* userbuffer, size_t usersize)
     {
         if (uart == NULL || !uart->rx_enabled)
-        {
             return 0;
-        }
 
         if (!blocking_uart)
         {
             char c;
             if (read(0, &c, 1) == 1)
-            {
                 uart_new_data(0, c);
-            }
         }
 
         size_t ret = 0;
@@ -224,9 +210,7 @@ extern "C"
             // get largest linear length from sw buffer
             size_t chunk = uart->rx_buffer->rpos < uart->rx_buffer->wpos ? uart->rx_buffer->wpos - uart->rx_buffer->rpos : uart->rx_buffer->size - uart->rx_buffer->rpos;
             if (ret + chunk > usersize)
-            {
                 chunk = usersize - ret;
-            }
             memcpy(userbuffer + ret, uart->rx_buffer->buffer + uart->rx_buffer->rpos, chunk);
             uart->rx_buffer->rpos = (uart->rx_buffer->rpos + chunk) % uart->rx_buffer->size;
             ret += chunk;
@@ -238,31 +222,21 @@ extern "C"
     uart_resize_rx_buffer(uart_t* uart, size_t new_size)
     {
         if (uart == NULL || !uart->rx_enabled)
-        {
             return 0;
-        }
 
         if (uart->rx_buffer->size == new_size)
-        {
             return uart->rx_buffer->size;
-        }
 
         uint8_t* new_buf = (uint8_t*)malloc(new_size);
         if (!new_buf)
-        {
             return uart->rx_buffer->size;
-        }
 
         size_t new_wpos = 0;
         // if uart_rx_available_unsafe() returns non-0, uart_read_char_unsafe() can't return -1
         while (uart_rx_available_unsafe(uart->rx_buffer) && new_wpos < new_size)
-        {
             new_buf[new_wpos++] = uart_read_char_unsafe(uart);
-        }
         if (new_wpos == new_size)
-        {
             new_wpos = 0;
-        }
 
         uint8_t* old_buf = uart->rx_buffer->buffer;
         uart->rx_buffer->rpos = 0;
@@ -283,9 +257,7 @@ extern "C"
     uart_write_char(uart_t* uart, char c)
     {
         if (uart == NULL || !uart->tx_enabled)
-        {
             return 0;
-        }
 
         uart_do_write_char(uart->uart_nr, c);
 
@@ -296,16 +268,12 @@ extern "C"
     uart_write(uart_t* uart, const char* buf, size_t size)
     {
         if (uart == NULL || !uart->tx_enabled)
-        {
             return 0;
-        }
 
         size_t ret = size;
         const int uart_nr = uart->uart_nr;
         while (size--)
-        {
             uart_do_write_char(uart_nr, *buf++);
-        }
 
         return ret;
     }
@@ -314,9 +282,7 @@ extern "C"
     uart_tx_free(uart_t* uart)
     {
         if (uart == NULL || !uart->tx_enabled)
-        {
             return 0;
-        }
 
         return UART_TX_FIFO_SIZE;
     }
@@ -331,9 +297,7 @@ extern "C"
     uart_flush(uart_t* uart)
     {
         if (uart == NULL)
-        {
             return;
-        }
 
         if (uart->rx_enabled)
         {
@@ -346,9 +310,7 @@ extern "C"
     uart_set_baudrate(uart_t* uart, int baud_rate)
     {
         if (uart == NULL)
-        {
             return;
-        }
 
         uart->baud_rate = baud_rate;
     }
@@ -357,9 +319,7 @@ extern "C"
     uart_get_baudrate(uart_t* uart)
     {
         if (uart == NULL)
-        {
             return 0;
-        }
 
         return uart->baud_rate;
     }
@@ -381,9 +341,7 @@ extern "C"
         (void)invert;
         uart_t* uart = (uart_t*)malloc(sizeof(uart_t));
         if (uart == NULL)
-        {
             return NULL;
-        }
 
         uart->uart_nr = uart_nr;
         uart->rx_overrun = false;
@@ -439,9 +397,7 @@ extern "C"
     uart_uninit(uart_t* uart)
     {
         if (uart == NULL)
-        {
             return;
-        }
 
         if (uart->rx_enabled)
         {
@@ -480,9 +436,7 @@ extern "C"
     uart_tx_enabled(uart_t* uart)
     {
         if (uart == NULL)
-        {
             return false;
-        }
 
         return uart->tx_enabled;
     }
@@ -491,9 +445,7 @@ extern "C"
     uart_rx_enabled(uart_t* uart)
     {
         if (uart == NULL)
-        {
             return false;
-        }
 
         return uart->rx_enabled;
     }
@@ -502,9 +454,7 @@ extern "C"
     uart_has_overrun(uart_t* uart)
     {
         if (uart == NULL || !uart->rx_overrun)
-        {
             return false;
-        }
 
         // clear flag
         uart->rx_overrun = false;
diff --git a/tests/host/common/MockWiFiServer.cpp b/tests/host/common/MockWiFiServer.cpp
index 791952fe06..f199a2b588 100644
--- a/tests/host/common/MockWiFiServer.cpp
+++ b/tests/host/common/MockWiFiServer.cpp
@@ -1,32 +1,32 @@
 /*
-    Arduino emulation - WiFiServer
-    Copyright (c) 2018 david gauchard. All rights reserved.
-
-    Permission is hereby granted, free of charge, to any person obtaining a
-    copy of this software and associated documentation files (the "Software"),
-    to deal with the Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the
-    Software is furnished to do so, subject to the following conditions:
-
-    - Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimers.
-
-    - Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimers in the
-    documentation and/or other materials provided with the distribution.
-
-    - The names of its contributors may not be used to endorse or promote
-    products derived from this Software without specific prior written
-    permission.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS WITH THE SOFTWARE.
+ Arduino emulation - WiFiServer
+ Copyright (c) 2018 david gauchard. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal with the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ - Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimers.
+
+ - Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimers in the
+   documentation and/or other materials provided with the distribution.
+
+ - The names of its contributors may not be used to endorse or promote
+   products derived from this Software without specific prior written
+   permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
 */
 
 #include <WiFiClient.h>
@@ -64,9 +64,7 @@ WiFiClient WiFiServer::available(uint8_t* status)
 WiFiClient WiFiServer::accept()
 {
     if (hasClient())
-    {
         return WiFiClient(new ClientContext(serverAccept(pcb2int(_listen_pcb))));
-    }
     return WiFiClient();
 }
 
diff --git a/tests/host/common/MockWiFiServerSocket.cpp b/tests/host/common/MockWiFiServerSocket.cpp
index 4d1254fc73..aee0ad817e 100644
--- a/tests/host/common/MockWiFiServerSocket.cpp
+++ b/tests/host/common/MockWiFiServerSocket.cpp
@@ -1,43 +1,43 @@
 /*
-    Arduino emulation - WiFiServer socket side
-    Copyright (c) 2018 david gauchard. All rights reserved.
-
-    Permission is hereby granted, free of charge, to any person obtaining a
-    copy of this software and associated documentation files (the "Software"),
-    to deal with the Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the
-    Software is furnished to do so, subject to the following conditions:
-
-    - Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimers.
-
-    - Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimers in the
-    documentation and/or other materials provided with the distribution.
-
-    - The names of its contributors may not be used to endorse or promote
-    products derived from this Software without specific prior written
-    permission.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS WITH THE SOFTWARE.
+ Arduino emulation - WiFiServer socket side
+ Copyright (c) 2018 david gauchard. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal with the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ - Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimers.
+
+ - Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimers in the
+   documentation and/or other materials provided with the distribution.
+
+ - The names of its contributors may not be used to endorse or promote
+   products derived from this Software without specific prior written
+   permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
 */
 
 #include <WiFiServer.h>
 
 #include <arpa/inet.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <poll.h>
-#include <sys/socket.h>
 #include <sys/types.h>
+#include <sys/socket.h>
+#include <poll.h>
 #include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
 
 #define int2pcb(x) ((tcp_pcb*)(intptr_t)(x))
 #define pcb2int(x) ((int)(intptr_t)(x))
@@ -66,9 +66,7 @@ void WiFiServer::begin(uint16_t port)
 void WiFiServer::begin(uint16_t port, uint8_t backlog)
 {
     if (!backlog)
-    {
         return;
-    }
     _port = port;
     return begin();
 }
@@ -86,9 +84,7 @@ void WiFiServer::begin()
         fprintf(stderr, MOCK "=====> WiFiServer port: %d shifted to %d (use option -s) <=====\n", _port, mockport);
     }
     else
-    {
         fprintf(stderr, MOCK "=====> WiFiServer port: %d <=====\n", mockport);
-    }
 
     if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1)
     {
@@ -133,9 +129,7 @@ bool WiFiServer::hasClient()
 void WiFiServer::close()
 {
     if (pcb2int(_listen_pcb) >= 0)
-    {
         ::close(pcb2int(_listen_pcb));
-    }
     _listen_pcb = int2pcb(-1);
 }
 
diff --git a/tests/host/common/MocklwIP.h b/tests/host/common/MocklwIP.h
index 19ded4b26a..9f0b4718f5 100644
--- a/tests/host/common/MocklwIP.h
+++ b/tests/host/common/MocklwIP.h
@@ -4,8 +4,8 @@
 
 extern "C"
 {
-#include <lwip/netif.h>
 #include <user_interface.h>
+#include <lwip/netif.h>
 
     extern netif netif0;
 
diff --git a/tests/host/common/UdpContextSocket.cpp b/tests/host/common/UdpContextSocket.cpp
index ef2294d6b8..0b8a17a706 100644
--- a/tests/host/common/UdpContextSocket.cpp
+++ b/tests/host/common/UdpContextSocket.cpp
@@ -1,43 +1,43 @@
 /*
-    Arduino emulation - UdpContext emulation - socket part
-    Copyright (c) 2018 david gauchard. All rights reserved.
-
-    Permission is hereby granted, free of charge, to any person obtaining a
-    copy of this software and associated documentation files (the "Software"),
-    to deal with the Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the
-    Software is furnished to do so, subject to the following conditions:
-
-    - Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimers.
-
-    - Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimers in the
-    documentation and/or other materials provided with the distribution.
-
-    - The names of its contributors may not be used to endorse or promote
-    products derived from this Software without specific prior written
-    permission.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS WITH THE SOFTWARE.
+ Arduino emulation - UdpContext emulation - socket part
+ Copyright (c) 2018 david gauchard. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal with the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ - Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimers.
+
+ - Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimers in the
+   documentation and/or other materials provided with the distribution.
+
+ - The names of its contributors may not be used to endorse or promote
+   products derived from this Software without specific prior written
+   permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
 */
 
+#include <unistd.h>
+#include <sys/socket.h>
+#include <netinet/tcp.h>
 #include <arpa/inet.h>
-#include <assert.h>
-#include <errno.h>
+#include <poll.h>
 #include <fcntl.h>
+#include <errno.h>
+#include <assert.h>
 #include <net/if.h>
-#include <netinet/tcp.h>
-#include <poll.h>
-#include <sys/socket.h>
-#include <unistd.h>
 
 int mockUDPSocket()
 {
@@ -62,20 +62,14 @@ bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
         fprintf(stderr, MOCK "=====> UdpServer port: %d shifted to %d (use option -s) <=====\n", port, mockport);
     }
     else
-    {
         fprintf(stderr, MOCK "=====> UdpServer port: %d <=====\n", mockport);
-    }
 
     optval = 1;
     if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)) == -1)
-    {
         fprintf(stderr, MOCK "SO_REUSEPORT failed\n");
-    }
     optval = 1;
     if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) == -1)
-    {
         fprintf(stderr, MOCK "SO_REUSEADDR failed\n");
-    }
 
     struct sockaddr_in servaddr;
     memset(&servaddr, 0, sizeof(servaddr));
@@ -94,14 +88,10 @@ bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
         return false;
     }
     else
-    {
         mockverbose("UDP server on port %d (sock=%d)\n", mockport, sock);
-    }
 
     if (!mcast)
-    {
         mcast = inet_addr("224.0.0.1");  // all hosts group
-    }
     if (mcast)
     {
         // https://web.cs.wpi.edu/~claypool/courses/4514-B99/samples/multicast.c
@@ -122,9 +112,7 @@ bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
 #endif
                 fprintf(stderr, MOCK "UDP multicast: can't setup bind/output on interface %s: %s\n", host_interface, strerror(errno));
             if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, &mreq.imr_interface, sizeof(struct in_addr)) == -1)
-            {
                 fprintf(stderr, MOCK "UDP multicast: can't setup bind/input on interface %s: %s\n", host_interface, strerror(errno));
-            }
         }
 
         if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0)
@@ -133,9 +121,7 @@ bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
             return false;
         }
         else
-        {
             mockverbose("joined multicast group addr %08lx\n", (long)ntohl(mcast));
-        }
     }
 
     return true;
@@ -151,9 +137,7 @@ size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& a
     if (ret == -1)
     {
         if (errno != EAGAIN)
-        {
             fprintf(stderr, MOCK "UDPContext::(read/peek): filling buffer for %zd bytes: %s\n", maxread, strerror(errno));
-        }
         ret = 0;
     }
 
@@ -161,9 +145,7 @@ size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& a
     {
         port = ntohs(((sockaddr_in*)&addrbuf)->sin_port);
         if (addrbuf.ss_family == AF_INET)
-        {
             memcpy(&addr[0], &(((sockaddr_in*)&addrbuf)->sin_addr.s_addr), addrsize = 4);
-        }
         else
         {
             fprintf(stderr, MOCK "TODO UDP+IPv6\n");
@@ -179,9 +161,7 @@ size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, ch
     (void)sock;
     (void)timeout_ms;
     if (usersize > CCBUFSIZE)
-    {
         fprintf(stderr, MOCK "CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
-    }
 
     size_t retsize = 0;
     if (ccinbufsize)
@@ -189,9 +169,7 @@ size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, ch
         // data already buffered
         retsize = usersize;
         if (retsize > ccinbufsize)
-        {
             retsize = ccinbufsize;
-        }
     }
     memcpy(dst, ccinbuf, retsize);
     return retsize;
diff --git a/tests/host/common/WMath.cpp b/tests/host/common/WMath.cpp
index dbfce37eb9..99b83a31f0 100644
--- a/tests/host/common/WMath.cpp
+++ b/tests/host/common/WMath.cpp
@@ -1,32 +1,32 @@
 /* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */
 
 /*
-    Part of the Wiring project - http://wiring.org.co
-    Copyright (c) 2004-06 Hernando Barragan
-    Modified 13 August 2006, David A. Mellis for Arduino - http://www.arduino.cc/
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General
-    Public License along with this library; if not, write to the
-    Free Software Foundation, Inc., 59 Temple Place, Suite 330,
-    Boston, MA  02111-1307  USA
-
-    $Id$
-*/
+ Part of the Wiring project - http://wiring.org.co
+ Copyright (c) 2004-06 Hernando Barragan
+ Modified 13 August 2006, David A. Mellis for Arduino - http://www.arduino.cc/
+ 
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+ 
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+ 
+ You should have received a copy of the GNU Lesser General
+ Public License along with this library; if not, write to the
+ Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ Boston, MA  02111-1307  USA
+ 
+ $Id$
+ */
 
 extern "C"
 {
-#include <stdint.h>
 #include <stdlib.h>
+#include <stdint.h>
 }
 
 void randomSeed(unsigned long seed)
diff --git a/tests/host/common/c_types.h b/tests/host/common/c_types.h
index fcf7a889a1..f8a665ee91 100644
--- a/tests/host/common/c_types.h
+++ b/tests/host/common/c_types.h
@@ -6,34 +6,34 @@
 // diff -u common/c_types.h ../../tools/sdk/include/c_types.h
 
 /*
-    ESPRESSIF MIT License
-
-    Copyright (c) 2016 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
-
-    Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
-    it is free of charge, to any person obtaining a copy of this software and associated
-    documentation files (the "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the Software is furnished
-    to do so, subject to the following conditions:
-
-    The above copyright notice and this permission notice shall be included in all copies or
-    substantial portions of the Software.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-    FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-    COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-    IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-*/
+ * ESPRESSIF MIT License
+ *
+ * Copyright (c) 2016 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
+ *
+ * Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
+ * it is free of charge, to any person obtaining a copy of this software and associated
+ * documentation files (the "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished
+ * to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
 
 #ifndef _C_TYPES_H_
 #define _C_TYPES_H_
-#include <stdarg.h>
-#include <stdbool.h>
 #include <stdint.h>
+#include <stdbool.h>
+#include <stdarg.h>
 #include <sys/cdefs.h>
 
 typedef signed char sint8_t;
diff --git a/tests/host/common/include/ClientContext.h b/tests/host/common/include/ClientContext.h
index 357c0b5b8c..cec57b3030 100644
--- a/tests/host/common/include/ClientContext.h
+++ b/tests/host/common/include/ClientContext.h
@@ -1,23 +1,23 @@
 /*
-    ClientContext.h - emulation of TCP connection handling on top of lwIP
+ ClientContext.h - emulation of TCP connection handling on top of lwIP
 
-    Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
-    This file is part of the esp8266 core for Arduino environment.
+ Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
 
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
 
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
 
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
 #ifndef CLIENTCONTEXT_H
 #define CLIENTCONTEXT_H
 
@@ -91,9 +91,7 @@ class ClientContext
             discard_received();
             close();
             if (_discard_cb)
-            {
                 _discard_cb(_discard_cb_arg, this);
-            }
             DEBUGV(":del\r\n");
             delete this;
         }
@@ -158,13 +156,9 @@ class ClientContext
     size_t getSize()
     {
         if (_sock < 0)
-        {
             return 0;
-        }
         if (_inbufsize)
-        {
             return _inbufsize;
-        }
         ssize_t ret = mockFillInBuf(_sock, _inbuf, _inbufsize);
         if (ret < 0)
         {
diff --git a/tests/host/common/include/UdpContext.h b/tests/host/common/include/UdpContext.h
index 238d068cfc..bbb079739a 100644
--- a/tests/host/common/include/UdpContext.h
+++ b/tests/host/common/include/UdpContext.h
@@ -23,8 +23,8 @@
 
 #include <functional>
 
-#include <IPAddress.h>
 #include <MocklwIP.h>
+#include <IPAddress.h>
 #include <PolledTimeout.h>
 
 class UdpContext;
@@ -222,9 +222,7 @@ class UdpContext
         size_t wrt = mockUDPWrite(_sock, (const uint8_t*)_outbuf, _outbufsize, _timeout_ms, dst, dstport);
         err_t ret = _outbufsize ? ERR_OK : ERR_ABRT;
         if (!keepBuffer || wrt == _outbufsize)
-        {
             cancelBuffer();
-        }
         return ret;
     }
 
@@ -243,22 +241,16 @@ class UdpContext
         err_t err;
         esp8266::polledTimeout::oneShotFastMs timeout(timeoutMs);
         while (((err = trySend(addr, port)) != ERR_OK) && !timeout)
-        {
             delay(0);
-        }
         if (err != ERR_OK)
-        {
             cancelBuffer();
-        }
         return err == ERR_OK;
     }
 
     void mock_cb(void)
     {
         if (_on_rx)
-        {
             _on_rx();
-        }
     }
 
    public:
@@ -276,9 +268,7 @@ class UdpContext
             //ip4_addr_set_u32(&ip_2_ip4(_dst), *(uint32_t*)addr);
         }
         else
-        {
             mockverbose("TODO unhandled udp address of size %d\n", (int)addrsize);
-        }
     }
 
     int _sock = -1;
diff --git a/tests/host/common/littlefs_mock.cpp b/tests/host/common/littlefs_mock.cpp
index a32b12cd79..ae5aa03be0 100644
--- a/tests/host/common/littlefs_mock.cpp
+++ b/tests/host/common/littlefs_mock.cpp
@@ -1,34 +1,34 @@
 /*
-    littlefs_mock.cpp - LittleFS mock for host side testing
-    Copyright © 2019 Earle F. Philhower, III
+ littlefs_mock.cpp - LittleFS mock for host side testing
+ Copyright © 2019 Earle F. Philhower, III
 
-    Based off spiffs_mock.cpp:
-    Copyright © 2016 Ivan Grokhotkov
+ Based off spiffs_mock.cpp:
+ Copyright © 2016 Ivan Grokhotkov
 
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
 
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
 */
 
 #include "littlefs_mock.h"
-#include <LittleFS.h>
+#include "spiffs_mock.h"
+#include "spiffs/spiffs.h"
+#include "debug.h"
 #include <flash_utils.h>
 #include <stdlib.h>
-#include "debug.h"
-#include "spiffs/spiffs.h"
-#include "spiffs_mock.h"
+#include <LittleFS.h>
 
 #include <spiffs_api.h>
 
-#include <fcntl.h>
-#include <sys/stat.h>
 #include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include <unistd.h>
 #include <cerrno>
 #include "flash_hal_mock.h"
@@ -41,9 +41,7 @@ LittleFSMock::LittleFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, con
 {
     m_storage = storage;
     if ((m_overwrite = (fs_size < 0)))
-    {
         fs_size = -fs_size;
-    }
 
     fprintf(stderr, "LittleFS: %zd bytes\n", fs_size);
 
@@ -77,9 +75,7 @@ LittleFSMock::~LittleFSMock()
 void LittleFSMock::load()
 {
     if (!m_fs.size() || !m_storage.length())
-    {
         return;
-    }
 
     int fs = ::open(m_storage.c_str(), O_RDONLY);
     if (fs == -1)
@@ -111,9 +107,7 @@ void LittleFSMock::load()
         fprintf(stderr, "LittleFS: loading %zi bytes from '%s'\n", m_fs.size(), m_storage.c_str());
         ssize_t r = ::read(fs, m_fs.data(), m_fs.size());
         if (r != (ssize_t)m_fs.size())
-        {
             fprintf(stderr, "LittleFS: reading %zi bytes: returned %zd: %s\n", m_fs.size(), r, strerror(errno));
-        }
     }
     ::close(fs);
 }
@@ -121,9 +115,7 @@ void LittleFSMock::load()
 void LittleFSMock::save()
 {
     if (!m_fs.size() || !m_storage.length())
-    {
         return;
-    }
 
     int fs = ::open(m_storage.c_str(), O_CREAT | O_TRUNC | O_WRONLY, 0644);
     if (fs == -1)
@@ -134,11 +126,7 @@ void LittleFSMock::save()
     fprintf(stderr, "LittleFS: saving %zi bytes to '%s'\n", m_fs.size(), m_storage.c_str());
 
     if (::write(fs, m_fs.data(), m_fs.size()) != (ssize_t)m_fs.size())
-    {
         fprintf(stderr, "LittleFS: writing %zi bytes: %s\n", m_fs.size(), strerror(errno));
-    }
     if (::close(fs) == -1)
-    {
         fprintf(stderr, "LittleFS: closing %s: %s\n", m_storage.c_str(), strerror(errno));
-    }
 }
diff --git a/tests/host/common/littlefs_mock.h b/tests/host/common/littlefs_mock.h
index df6f47f785..bbbbe7c0cb 100644
--- a/tests/host/common/littlefs_mock.h
+++ b/tests/host/common/littlefs_mock.h
@@ -1,28 +1,28 @@
 /*
-    littlefs_mock.h - LittleFS HAL mock for host side testing
-    Copyright © 2019 Earle F. Philhower, III
-
-    Based on spiffs_mock:
-    Copyright © 2016 Ivan Grokhotkov
-
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
-
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
+ littlefs_mock.h - LittleFS HAL mock for host side testing
+ Copyright © 2019 Earle F. Philhower, III
+
+ Based on spiffs_mock:
+ Copyright © 2016 Ivan Grokhotkov
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
 */
 
 #ifndef littlefs_mock_hpp
 #define littlefs_mock_hpp
 
-#include <FS.h>
-#include <stddef.h>
 #include <stdint.h>
+#include <stddef.h>
 #include <vector>
+#include <FS.h>
 #include "flash_hal_mock.h"
 
 #define DEFAULT_LITTLEFS_FILE_NAME "littlefs.bin"
diff --git a/tests/host/common/md5.c b/tests/host/common/md5.c
index ea2c76c98e..8b84713aa4 100644
--- a/tests/host/common/md5.c
+++ b/tests/host/common/md5.c
@@ -1,40 +1,40 @@
 /*
-    Copyright (c) 2007, Cameron Rich
-
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions are met:
-
- * * Redistributions of source code must retain the above copyright notice,
-     this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
-     this list of conditions and the following disclaimer in the documentation
-     and/or other materials provided with the distribution.
- * * Neither the name of the axTLS project nor the names of its contributors
-     may be used to endorse or promote products derived from this software
-     without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
+ * Copyright (c) 2007, Cameron Rich
+ * 
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without 
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright notice, 
+ *   this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice, 
+ *   this list of conditions and the following disclaimer in the documentation 
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the axTLS project nor the names of its contributors 
+ *   may be used to endorse or promote products derived from this software 
+ *   without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
 
 /**
-    This file implements the MD5 algorithm as defined in RFC1321
-*/
+ * This file implements the MD5 algorithm as defined in RFC1321
+ */
 
-#include <stddef.h>
-#include <stdint.h>
 #include <string.h>
+#include <stdint.h>
+#include <stddef.h>
 
 #define EXP_FUNC extern
 #define STDCALL
@@ -48,8 +48,8 @@ typedef struct
     uint8_t buffer[64]; /* input buffer */
 } MD5_CTX;
 
-/*  Constants for MD5Transform routine.
-*/
+/* Constants for MD5Transform routine.
+ */
 #define S11 7
 #define S12 12
 #define S13 17
@@ -78,8 +78,8 @@ static const uint8_t PADDING[64] =
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 
-/*  F, G, H and I are basic MD5 functions.
-*/
+/* F, G, H and I are basic MD5 functions.
+ */
 #define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
 #define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
 #define H(x, y, z) ((x) ^ (y) ^ (z))
@@ -88,8 +88,8 @@ static const uint8_t PADDING[64] =
 /* ROTATE_LEFT rotates x left n bits.  */
 #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
 
-/*  FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
-    Rotation is separate from addition to prevent recomputation.  */
+/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
+   Rotation is separate from addition to prevent recomputation.  */
 #define FF(a, b, c, d, x, s, ac)                        \
     {                                                   \
         (a) += F((b), (c), (d)) + (x) + (uint32_t)(ac); \
@@ -116,14 +116,14 @@ static const uint8_t PADDING[64] =
     }
 
 /**
-    MD5 initialization - begins an MD5 operation, writing a new ctx.
-*/
+ * MD5 initialization - begins an MD5 operation, writing a new ctx.
+ */
 EXP_FUNC void STDCALL MD5Init(MD5_CTX* ctx)
 {
     ctx->count[0] = ctx->count[1] = 0;
 
-    /*  Load magic initialization constants.
-    */
+    /* Load magic initialization constants.
+     */
     ctx->state[0] = 0x67452301;
     ctx->state[1] = 0xefcdab89;
     ctx->state[2] = 0x98badcfe;
@@ -131,8 +131,8 @@ EXP_FUNC void STDCALL MD5Init(MD5_CTX* ctx)
 }
 
 /**
-    Accepts an array of octets as the next portion of the message.
-*/
+ * Accepts an array of octets as the next portion of the message.
+ */
 EXP_FUNC void STDCALL MD5Update(MD5_CTX* ctx, const uint8_t* msg, int len)
 {
     uint32_t x;
@@ -143,9 +143,7 @@ EXP_FUNC void STDCALL MD5Update(MD5_CTX* ctx, const uint8_t* msg, int len)
 
     /* Update number of bits */
     if ((ctx->count[0] += ((uint32_t)len << 3)) < ((uint32_t)len << 3))
-    {
         ctx->count[1]++;
-    }
     ctx->count[1] += ((uint32_t)len >> 29);
 
     partLen = 64 - x;
@@ -157,24 +155,20 @@ EXP_FUNC void STDCALL MD5Update(MD5_CTX* ctx, const uint8_t* msg, int len)
         MD5Transform(ctx->state, ctx->buffer);
 
         for (i = partLen; i + 63 < len; i += 64)
-        {
             MD5Transform(ctx->state, &msg[i]);
-        }
 
         x = 0;
     }
     else
-    {
         i = 0;
-    }
 
     /* Buffer remaining input */
     memcpy(&ctx->buffer[x], &msg[i], len - i);
 }
 
 /**
-    Return the 128-bit message digest into the user's array
-*/
+ * Return the 128-bit message digest into the user's array
+ */
 EXP_FUNC void STDCALL MD5Final(uint8_t* digest, MD5_CTX* ctx)
 {
     uint8_t bits[8];
@@ -183,8 +177,8 @@ EXP_FUNC void STDCALL MD5Final(uint8_t* digest, MD5_CTX* ctx)
     /* Save number of bits */
     Encode(bits, ctx->count, 8);
 
-    /*  Pad out to 56 mod 64.
-    */
+    /* Pad out to 56 mod 64.
+     */
     x = (uint32_t)((ctx->count[0] >> 3) & 0x3f);
     padLen = (x < 56) ? (56 - x) : (120 - x);
     MD5Update(ctx, PADDING, padLen);
@@ -197,8 +191,8 @@ EXP_FUNC void STDCALL MD5Final(uint8_t* digest, MD5_CTX* ctx)
 }
 
 /**
-    MD5 basic transformation. Transforms state based on block.
-*/
+ * MD5 basic transformation. Transforms state based on block.
+ */
 static void MD5Transform(uint32_t state[4], const uint8_t block[64])
 {
     uint32_t a = state[0], b = state[1], c = state[2],
@@ -285,9 +279,9 @@ static void MD5Transform(uint32_t state[4], const uint8_t block[64])
 }
 
 /**
-    Encodes input (uint32_t) into output (uint8_t). Assumes len is
-     a multiple of 4.
-*/
+ * Encodes input (uint32_t) into output (uint8_t). Assumes len is
+ *   a multiple of 4.
+ */
 static void Encode(uint8_t* output, uint32_t* input, uint32_t len)
 {
     uint32_t i, j;
@@ -302,9 +296,9 @@ static void Encode(uint8_t* output, uint32_t* input, uint32_t len)
 }
 
 /**
-    Decodes input (uint8_t) into output (uint32_t). Assumes len is
-     a multiple of 4.
-*/
+ *  Decodes input (uint8_t) into output (uint32_t). Assumes len is
+ *   a multiple of 4.
+ */
 static void Decode(uint32_t* output, const uint8_t* input, uint32_t len)
 {
     uint32_t i, j;
diff --git a/tests/host/common/mock.h b/tests/host/common/mock.h
index e30a607cb7..c9a6493468 100644
--- a/tests/host/common/mock.h
+++ b/tests/host/common/mock.h
@@ -1,32 +1,32 @@
 /*
-    Arduino emulation - common to all emulated code
-    Copyright (c) 2018 david gauchard. All rights reserved.
-
-    Permission is hereby granted, free of charge, to any person obtaining a
-    copy of this software and associated documentation files (the "Software"),
-    to deal with the Software without restriction, including without limitation
-    the rights to use, copy, modify, merge, publish, distribute, sublicense,
-    and/or sell copies of the Software, and to permit persons to whom the
-    Software is furnished to do so, subject to the following conditions:
-
-    - Redistributions of source code must retain the above copyright notice,
-    this list of conditions and the following disclaimers.
-
-    - Redistributions in binary form must reproduce the above copyright notice,
-    this list of conditions and the following disclaimers in the
-    documentation and/or other materials provided with the distribution.
-
-    - The names of its contributors may not be used to endorse or promote
-    products derived from this Software without specific prior written
-    permission.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-    THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-    OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-    ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-    DEALINGS WITH THE SOFTWARE.
+ Arduino emulation - common to all emulated code
+ Copyright (c) 2018 david gauchard. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal with the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ - Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimers.
+
+ - Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimers in the
+   documentation and/or other materials provided with the distribution.
+
+ - The names of its contributors may not be used to endorse or promote
+   products derived from this Software without specific prior written
+   permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
 */
 
 #define CORE_MOCK 1
diff --git a/tests/host/common/noniso.c b/tests/host/common/noniso.c
index 718aadb5d4..19343a5728 100644
--- a/tests/host/common/noniso.c
+++ b/tests/host/common/noniso.c
@@ -1,23 +1,23 @@
 /*
-    noniso.cpp - replacements for non-ISO functions used by Arduino core
-    Copyright © 2016 Ivan Grokhotkov
-
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
-
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
+ noniso.cpp - replacements for non-ISO functions used by Arduino core
+ Copyright © 2016 Ivan Grokhotkov
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
 */
 
-#include <math.h>
-#include <stdbool.h>
-#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <math.h>
 #include "stdlib_noniso.h"
 
 void reverse(char* begin, char* end)
@@ -83,9 +83,7 @@ char* itoa(int value, char* result, int base)
 
     // Apply negative sign
     if (value < 0)
-    {
         *out++ = '-';
-    }
 
     reverse(result, out);
     *out = 0;
diff --git a/tests/host/common/pins_arduino.h b/tests/host/common/pins_arduino.h
index cba546a2bc..c3a66453b7 100644
--- a/tests/host/common/pins_arduino.h
+++ b/tests/host/common/pins_arduino.h
@@ -1,17 +1,17 @@
 /*
-    pins_arduino.h
-    Copyright © 2016 Ivan Grokhotkov
-
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
-
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
-*/
+ pins_arduino.h
+ Copyright © 2016 Ivan Grokhotkov
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ */
 #ifndef pins_arduino_h
 #define pins_arduino_h
 
diff --git a/tests/host/common/queue.h b/tests/host/common/queue.h
index 1a96ce16b1..2c2d89ba34 100644
--- a/tests/host/common/queue.h
+++ b/tests/host/common/queue.h
@@ -1,38 +1,38 @@
 /*
-    Copyright (c) 1991, 1993
- 	The Regents of the University of California.  All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions
-    are met:
-    1. Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    2. Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-    3. All advertising materials mentioning features or use of this software
-      must display the following acknowledgement:
- 	This product includes software developed by the University of
- 	California, Berkeley and its contributors.
-    4. Neither the name of the University nor the names of its contributors
-      may be used to endorse or promote products derived from this software
-      without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-    ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-    SUCH DAMAGE.
-
- 	@(#)queue.h	8.5 (Berkeley) 8/20/94
-    $FreeBSD: src/sys/sys/queue.h,v 1.48 2002/04/17 14:00:37 tmm Exp $
-*/
+ * Copyright (c) 1991, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)queue.h	8.5 (Berkeley) 8/20/94
+ * $FreeBSD: src/sys/sys/queue.h,v 1.48 2002/04/17 14:00:37 tmm Exp $
+ */
 
 #ifndef _SYS_QUEUE_H_
 #define _SYS_QUEUE_H_
@@ -40,72 +40,72 @@
 #include <machine/ansi.h> /* for __offsetof */
 
 /*
-    This file defines four types of data structures: singly-linked lists,
-    singly-linked tail queues, lists and tail queues.
-
-    A singly-linked list is headed by a single forward pointer. The elements
-    are singly linked for minimum space and pointer manipulation overhead at
-    the expense of O(n) removal for arbitrary elements. New elements can be
-    added to the list after an existing element or at the head of the list.
-    Elements being removed from the head of the list should use the explicit
-    macro for this purpose for optimum efficiency. A singly-linked list may
-    only be traversed in the forward direction.  Singly-linked lists are ideal
-    for applications with large datasets and few or no removals or for
-    implementing a LIFO queue.
-
-    A singly-linked tail queue is headed by a pair of pointers, one to the
-    head of the list and the other to the tail of the list. The elements are
-    singly linked for minimum space and pointer manipulation overhead at the
-    expense of O(n) removal for arbitrary elements. New elements can be added
-    to the list after an existing element, at the head of the list, or at the
-    end of the list. Elements being removed from the head of the tail queue
-    should use the explicit macro for this purpose for optimum efficiency.
-    A singly-linked tail queue may only be traversed in the forward direction.
-    Singly-linked tail queues are ideal for applications with large datasets
-    and few or no removals or for implementing a FIFO queue.
-
-    A list is headed by a single forward pointer (or an array of forward
-    pointers for a hash table header). The elements are doubly linked
-    so that an arbitrary element can be removed without a need to
-    traverse the list. New elements can be added to the list before
-    or after an existing element or at the head of the list. A list
-    may only be traversed in the forward direction.
-
-    A tail queue is headed by a pair of pointers, one to the head of the
-    list and the other to the tail of the list. The elements are doubly
-    linked so that an arbitrary element can be removed without a need to
-    traverse the list. New elements can be added to the list before or
-    after an existing element, at the head of the list, or at the end of
-    the list. A tail queue may be traversed in either direction.
-
-    For details on the use of these macros, see the queue(3) manual page.
-
-
- 			SLIST	LIST	STAILQ	TAILQ
-    _HEAD		+	+	+	+
-    _HEAD_INITIALIZER	+	+	+	+
-    _ENTRY		+	+	+	+
-    _INIT		+	+	+	+
-    _EMPTY		+	+	+	+
-    _FIRST		+	+	+	+
-    _NEXT		+	+	+	+
-    _PREV		-	-	-	+
-    _LAST		-	-	+	+
-    _FOREACH		+	+	+	+
-    _FOREACH_REVERSE	-	-	-	+
-    _INSERT_HEAD		+	+	+	+
-    _INSERT_BEFORE	-	+	-	+
-    _INSERT_AFTER	+	+	+	+
-    _INSERT_TAIL		-	-	+	+
-    _CONCAT		-	-	+	+
-    _REMOVE_HEAD		+	-	+	-
-    _REMOVE		+	+	+	+
-
-*/
+ * This file defines four types of data structures: singly-linked lists,
+ * singly-linked tail queues, lists and tail queues.
+ *
+ * A singly-linked list is headed by a single forward pointer. The elements
+ * are singly linked for minimum space and pointer manipulation overhead at
+ * the expense of O(n) removal for arbitrary elements. New elements can be
+ * added to the list after an existing element or at the head of the list.
+ * Elements being removed from the head of the list should use the explicit
+ * macro for this purpose for optimum efficiency. A singly-linked list may
+ * only be traversed in the forward direction.  Singly-linked lists are ideal
+ * for applications with large datasets and few or no removals or for
+ * implementing a LIFO queue.
+ *
+ * A singly-linked tail queue is headed by a pair of pointers, one to the
+ * head of the list and the other to the tail of the list. The elements are
+ * singly linked for minimum space and pointer manipulation overhead at the
+ * expense of O(n) removal for arbitrary elements. New elements can be added
+ * to the list after an existing element, at the head of the list, or at the
+ * end of the list. Elements being removed from the head of the tail queue
+ * should use the explicit macro for this purpose for optimum efficiency.
+ * A singly-linked tail queue may only be traversed in the forward direction.
+ * Singly-linked tail queues are ideal for applications with large datasets
+ * and few or no removals or for implementing a FIFO queue.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may only be traversed in the forward direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ *
+ *
+ *			SLIST	LIST	STAILQ	TAILQ
+ * _HEAD		+	+	+	+
+ * _HEAD_INITIALIZER	+	+	+	+
+ * _ENTRY		+	+	+	+
+ * _INIT		+	+	+	+
+ * _EMPTY		+	+	+	+
+ * _FIRST		+	+	+	+
+ * _NEXT		+	+	+	+
+ * _PREV		-	-	-	+
+ * _LAST		-	-	+	+
+ * _FOREACH		+	+	+	+
+ * _FOREACH_REVERSE	-	-	-	+
+ * _INSERT_HEAD		+	+	+	+
+ * _INSERT_BEFORE	-	+	-	+
+ * _INSERT_AFTER	+	+	+	+
+ * _INSERT_TAIL		-	-	+	+
+ * _CONCAT		-	-	+	+
+ * _REMOVE_HEAD		+	-	+	-
+ * _REMOVE		+	+	+	+
+ *
+ */
 
 /*
-    Singly-linked List declarations.
-*/
+ * Singly-linked List declarations.
+ */
 #define SLIST_HEAD(name, type)                      \
     struct name                                     \
     {                                               \
@@ -124,8 +124,8 @@
     }
 
 /*
-    Singly-linked List functions.
-*/
+ * Singly-linked List functions.
+ */
 #define SLIST_EMPTY(head) ((head)->slh_first == NULL)
 
 #define SLIST_FIRST(head) ((head)->slh_first)
@@ -181,8 +181,8 @@
     } while (0)
 
 /*
-    Singly-linked Tail queue declarations.
-*/
+ * Singly-linked Tail queue declarations.
+ */
 #define STAILQ_HEAD(name, type)                                  \
     struct name                                                  \
     {                                                            \
@@ -202,8 +202,8 @@
     }
 
 /*
-    Singly-linked Tail queue functions.
-*/
+ * Singly-linked Tail queue functions.
+ */
 #define STAILQ_CONCAT(head1, head2)                    \
     do                                                 \
     {                                                  \
@@ -294,8 +294,8 @@
     } while (0)
 
 /*
-    List declarations.
-*/
+ * List declarations.
+ */
 #define LIST_HEAD(name, type)                      \
     struct name                                    \
     {                                              \
@@ -315,8 +315,8 @@
     }
 
 /*
-    List functions.
-*/
+ * List functions.
+ */
 
 #define LIST_EMPTY(head) ((head)->lh_first == NULL)
 
@@ -373,8 +373,8 @@
     } while (0)
 
 /*
-    Tail queue declarations.
-*/
+ * Tail queue declarations.
+ */
 #define TAILQ_HEAD(name, type)                                  \
     struct name                                                 \
     {                                                           \
@@ -395,8 +395,8 @@
     }
 
 /*
-    Tail queue functions.
-*/
+ * Tail queue functions.
+ */
 #define TAILQ_CONCAT(head1, head2, field)                           \
     do                                                              \
     {                                                               \
@@ -494,9 +494,9 @@
 #ifdef _KERNEL
 
 /*
-    XXX insque() and remque() are an old way of handling certain queues.
-    They bogusly assumes that all queue heads look alike.
-*/
+ * XXX insque() and remque() are an old way of handling certain queues.
+ * They bogusly assumes that all queue heads look alike.
+ */
 
 struct quehead
 {
diff --git a/tests/host/common/sdfs_mock.cpp b/tests/host/common/sdfs_mock.cpp
index 26143ea4d7..8410fa7f8a 100644
--- a/tests/host/common/sdfs_mock.cpp
+++ b/tests/host/common/sdfs_mock.cpp
@@ -1,16 +1,16 @@
 /*
-    sdfs_mock.cpp - SDFS HAL mock for host side testing
-    Copyright (c) 2019 Earle F. Philhower, III
+ sdfs_mock.cpp - SDFS HAL mock for host side testing
+ Copyright (c) 2019 Earle F. Philhower, III
 
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
 
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
 */
 
 #include "sdfs_mock.h"
diff --git a/tests/host/common/sdfs_mock.h b/tests/host/common/sdfs_mock.h
index 0b357fa30e..462d8fffe1 100644
--- a/tests/host/common/sdfs_mock.h
+++ b/tests/host/common/sdfs_mock.h
@@ -1,25 +1,25 @@
 /*
-    sdfs.h - SDFS mock for host side testing
-    Copyright (c) 2019 Earle F. Philhower, III
-
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
-
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
+ sdfs.h - SDFS mock for host side testing
+ Copyright (c) 2019 Earle F. Philhower, III
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
 */
 
 #ifndef sdfs_mock_hpp
 #define sdfs_mock_hpp
 
-#include <FS.h>
-#include <stddef.h>
 #include <stdint.h>
+#include <stddef.h>
 #include <vector>
+#include <FS.h>
 
 class SDFSMock
 {
diff --git a/tests/host/common/spiffs_mock.cpp b/tests/host/common/spiffs_mock.cpp
index eaccb41898..c6452a98f6 100644
--- a/tests/host/common/spiffs_mock.cpp
+++ b/tests/host/common/spiffs_mock.cpp
@@ -1,29 +1,29 @@
 /*
-    spiffs_mock.cpp - SPIFFS HAL mock for host side testing
-    Copyright © 2016 Ivan Grokhotkov
-
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
-
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
+ spiffs_mock.cpp - SPIFFS HAL mock for host side testing
+ Copyright © 2016 Ivan Grokhotkov
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
 */
 
 #include "spiffs_mock.h"
+#include "spiffs/spiffs.h"
+#include "debug.h"
 #include <flash_utils.h>
 #include <stdlib.h>
-#include "debug.h"
-#include "spiffs/spiffs.h"
 
 #include <spiffs_api.h>
 
-#include <fcntl.h>
-#include <sys/stat.h>
 #include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include <unistd.h>
 #include <cerrno>
 
@@ -40,9 +40,7 @@ SpiffsMock::SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const S
 {
     m_storage = storage;
     if ((m_overwrite = (fs_size < 0)))
-    {
         fs_size = -fs_size;
-    }
 
     fprintf(stderr, "SPIFFS: %zd bytes\n", fs_size);
 
@@ -76,9 +74,7 @@ SpiffsMock::~SpiffsMock()
 void SpiffsMock::load()
 {
     if (!m_fs.size() || !m_storage.length())
-    {
         return;
-    }
 
     int fs = ::open(m_storage.c_str(), O_RDONLY);
     if (fs == -1)
@@ -110,9 +106,7 @@ void SpiffsMock::load()
         fprintf(stderr, "SPIFFS: loading %zi bytes from '%s'\n", m_fs.size(), m_storage.c_str());
         ssize_t r = ::read(fs, m_fs.data(), m_fs.size());
         if (r != (ssize_t)m_fs.size())
-        {
             fprintf(stderr, "SPIFFS: reading %zi bytes: returned %zd: %s\n", m_fs.size(), r, strerror(errno));
-        }
     }
     ::close(fs);
 }
@@ -120,9 +114,7 @@ void SpiffsMock::load()
 void SpiffsMock::save()
 {
     if (!m_fs.size() || !m_storage.length())
-    {
         return;
-    }
 
     int fs = ::open(m_storage.c_str(), O_CREAT | O_TRUNC | O_WRONLY, 0644);
     if (fs == -1)
@@ -133,13 +125,9 @@ void SpiffsMock::save()
     fprintf(stderr, "SPIFFS: saving %zi bytes to '%s'\n", m_fs.size(), m_storage.c_str());
 
     if (::write(fs, m_fs.data(), m_fs.size()) != (ssize_t)m_fs.size())
-    {
         fprintf(stderr, "SPIFFS: writing %zi bytes: %s\n", m_fs.size(), strerror(errno));
-    }
     if (::close(fs) == -1)
-    {
         fprintf(stderr, "SPIFFS: closing %s: %s\n", m_storage.c_str(), strerror(errno));
-    }
 }
 
 #pragma GCC diagnostic pop
diff --git a/tests/host/common/spiffs_mock.h b/tests/host/common/spiffs_mock.h
index 2cf16c7d47..098f73c3f4 100644
--- a/tests/host/common/spiffs_mock.h
+++ b/tests/host/common/spiffs_mock.h
@@ -1,25 +1,25 @@
 /*
-    spiffs_mock.h - SPIFFS HAL mock for host side testing
-    Copyright © 2016 Ivan Grokhotkov
-
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
-
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
+ spiffs_mock.h - SPIFFS HAL mock for host side testing
+ Copyright © 2016 Ivan Grokhotkov
+ 
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ 
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
 */
 
 #ifndef spiffs_mock_hpp
 #define spiffs_mock_hpp
 
-#include <FS.h>
-#include <stddef.h>
 #include <stdint.h>
+#include <stddef.h>
 #include <vector>
+#include <FS.h>
 #include "flash_hal_mock.h"
 
 #define DEFAULT_SPIFFS_FILE_NAME "spiffs.bin"
diff --git a/tests/host/common/user_interface.cpp b/tests/host/common/user_interface.cpp
index 92313e7f49..0091d77ba6 100644
--- a/tests/host/common/user_interface.cpp
+++ b/tests/host/common/user_interface.cpp
@@ -31,13 +31,13 @@
 
 #include <lwip/def.h>
 
-#include <arpa/inet.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
 #include <ifaddrs.h>
 #include <netinet/in.h>
-#include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
-#include <sys/types.h>
+#include <arpa/inet.h>
 
 #include "MocklwIP.h"
 
@@ -86,8 +86,8 @@ DhcpServer dhcpSoftAP(nullptr);
 
 extern "C"
 {
-#include <lwip/netif.h>
 #include <user_interface.h>
+#include <lwip/netif.h>
 
     uint8 wifi_get_opmode(void)
     {
@@ -125,9 +125,7 @@ extern "C"
         strcpy((char*)config->password, "emulated-ssid-password");
         config->bssid_set = 0;
         for (int i = 0; i < 6; i++)
-        {
             config->bssid[i] = i;
-        }
         config->threshold.rssi = 1;
         config->threshold.authmode = AUTH_WPA_PSK;
 #ifdef NONOSDK3V0
@@ -182,9 +180,7 @@ extern "C"
         }
 
         if (host_interface)
-        {
             mockverbose("host: looking for interface '%s':\n", host_interface);
-        }
 
         for (ifa = ifAddrStruct; ifa != NULL; ifa = ifa->ifa_next)
         {
@@ -195,10 +191,8 @@ extern "C"
                 auto test_ipv4 = lwip_ntohl(*(uint32_t*)&((struct sockaddr_in*)ifa->ifa_addr)->sin_addr);
                 mockverbose(" IPV4 (0x%08lx)", test_ipv4);
                 if ((test_ipv4 & 0xff000000) == 0x7f000000)
-                // 127./8
-                {
+                    // 127./8
                     mockverbose(" (local, ignored)");
-                }
                 else
                 {
                     if (!host_interface || (host_interface && strcmp(ifa->ifa_name, host_interface) == 0))
@@ -208,9 +202,7 @@ extern "C"
                         mask = *(uint32_t*)&((struct sockaddr_in*)ifa->ifa_netmask)->sin_addr;
                         mockverbose(" (selected)\n");
                         if (host_interface)
-                        {
                             global_source_address = ntohl(ipv4);
-                        }
                         break;
                     }
                 }
@@ -219,18 +211,14 @@ extern "C"
         }
 
         if (ifAddrStruct != NULL)
-        {
             freeifaddrs(ifAddrStruct);
-        }
 
         (void)if_index;
         //if (if_index != STATION_IF)
         //	fprintf(stderr, "we are not AP");
 
         if (global_ipv4_netfmt == NO_GLOBAL_BINDING)
-        {
             global_ipv4_netfmt = ipv4;
-        }
 
         if (info)
         {
diff --git a/tests/host/core/test_PolledTimeout.cpp b/tests/host/core/test_PolledTimeout.cpp
index ac39477feb..b2c7a212b0 100644
--- a/tests/host/core/test_PolledTimeout.cpp
+++ b/tests/host/core/test_PolledTimeout.cpp
@@ -24,9 +24,7 @@ TEST_CASE("OneShot Timeout 500000000ns (0.5s)", "[polledTimeout]")
     oneShotFastNs timeout(500000000);
     before = micros();
     while (!timeout.expired())
-    {
         yield();
-    }
     after = micros();
 
     delta = after - before;
@@ -39,9 +37,7 @@ TEST_CASE("OneShot Timeout 500000000ns (0.5s)", "[polledTimeout]")
     timeout.reset();
     before = micros();
     while (!timeout)
-    {
         yield();
-    }
     after = micros();
 
     delta = after - before;
@@ -61,9 +57,7 @@ TEST_CASE("OneShot Timeout 3000000us", "[polledTimeout]")
     oneShotFastUs timeout(3000000);
     before = micros();
     while (!timeout.expired())
-    {
         yield();
-    }
     after = micros();
 
     delta = after - before;
@@ -76,9 +70,7 @@ TEST_CASE("OneShot Timeout 3000000us", "[polledTimeout]")
     timeout.reset();
     before = micros();
     while (!timeout)
-    {
         yield();
-    }
     after = micros();
 
     delta = after - before;
@@ -98,9 +90,7 @@ TEST_CASE("OneShot Timeout 3000ms", "[polledTimeout]")
     oneShotMs timeout(3000);
     before = millis();
     while (!timeout.expired())
-    {
         yield();
-    }
     after = millis();
 
     delta = after - before;
@@ -113,9 +103,7 @@ TEST_CASE("OneShot Timeout 3000ms", "[polledTimeout]")
     timeout.reset();
     before = millis();
     while (!timeout)
-    {
         yield();
-    }
     after = millis();
 
     delta = after - before;
@@ -135,9 +123,7 @@ TEST_CASE("OneShot Timeout 3000ms reset to 1000ms", "[polledTimeout]")
     oneShotMs timeout(3000);
     before = millis();
     while (!timeout.expired())
-    {
         yield();
-    }
     after = millis();
 
     delta = after - before;
@@ -150,9 +136,7 @@ TEST_CASE("OneShot Timeout 3000ms reset to 1000ms", "[polledTimeout]")
     timeout.reset(1000);
     before = millis();
     while (!timeout)
-    {
         yield();
-    }
     after = millis();
 
     delta = after - before;
@@ -172,9 +156,7 @@ TEST_CASE("Periodic Timeout 1T 3000ms", "[polledTimeout]")
     periodicMs timeout(3000);
     before = millis();
     while (!timeout)
-    {
         yield();
-    }
     after = millis();
 
     delta = after - before;
@@ -186,9 +168,7 @@ TEST_CASE("Periodic Timeout 1T 3000ms", "[polledTimeout]")
 
     before = millis();
     while (!timeout)
-    {
         yield();
-    }
     after = millis();
 
     delta = after - before;
@@ -215,9 +195,7 @@ TEST_CASE("Periodic Timeout 10T 1000ms", "[polledTimeout]")
         {
             Serial.print("*");
             if (!--counter)
-            {
                 break;
-            }
             yield();
         }
     }
diff --git a/tests/host/core/test_Print.cpp b/tests/host/core/test_Print.cpp
index 86197afcf6..8e7f34729e 100644
--- a/tests/host/core/test_Print.cpp
+++ b/tests/host/core/test_Print.cpp
@@ -1,24 +1,24 @@
 /*
-    test_pgmspace.cpp - pgmspace tests
-    Copyright © 2016 Ivan Grokhotkov
+ test_pgmspace.cpp - pgmspace tests
+ Copyright © 2016 Ivan Grokhotkov
 
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
 
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
-*/
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ */
 
+#include <catch.hpp>
+#include <string.h>
 #include <FS.h>
 #include <LittleFS.h>
-#include <spiffs/spiffs.h>
-#include <string.h>
-#include <catch.hpp>
 #include "../common/littlefs_mock.h"
+#include <spiffs/spiffs.h>
 
 // Use a LittleFS file because we can't instantiate a virtual class like Print
 TEST_CASE("Print::write overrides all compile properly", "[core][Print]")
diff --git a/tests/host/core/test_Updater.cpp b/tests/host/core/test_Updater.cpp
index edd84741f5..29447e2b21 100644
--- a/tests/host/core/test_Updater.cpp
+++ b/tests/host/core/test_Updater.cpp
@@ -1,20 +1,20 @@
 /*
-    test_Updater.cpp - Updater tests
-    Copyright © 2019 Earle F. Philhower, III
+ test_Updater.cpp - Updater tests
+ Copyright © 2019 Earle F. Philhower, III
 
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
 
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
-*/
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ */
 
-#include <Updater.h>
 #include <catch.hpp>
+#include <Updater.h>
 
 // Use a SPIFFS file because we can't instantiate a virtual class like Print
 TEST_CASE("Updater fails when writes overflow requested size", "[core][Updater]")
diff --git a/tests/host/core/test_md5builder.cpp b/tests/host/core/test_md5builder.cpp
index bb788c3d35..53e76790e7 100644
--- a/tests/host/core/test_md5builder.cpp
+++ b/tests/host/core/test_md5builder.cpp
@@ -1,22 +1,22 @@
 /*
-    test_md5builder.cpp - MD5Builder tests
-    Copyright © 2016 Ivan Grokhotkov
+ test_md5builder.cpp - MD5Builder tests
+ Copyright © 2016 Ivan Grokhotkov
 
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
 
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
-*/
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ */
 
+#include <catch.hpp>
+#include <string.h>
 #include <MD5Builder.h>
 #include <StreamString.h>
-#include <string.h>
-#include <catch.hpp>
 
 TEST_CASE("MD5Builder::add works as expected", "[core][MD5Builder]")
 {
diff --git a/tests/host/core/test_pgmspace.cpp b/tests/host/core/test_pgmspace.cpp
index dc44b55374..5ebbf4c425 100644
--- a/tests/host/core/test_pgmspace.cpp
+++ b/tests/host/core/test_pgmspace.cpp
@@ -1,21 +1,21 @@
 /*
-    test_pgmspace.cpp - pgmspace tests
-    Copyright © 2016 Ivan Grokhotkov
+ test_pgmspace.cpp - pgmspace tests
+ Copyright © 2016 Ivan Grokhotkov
 
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
 
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
-*/
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ */
 
-#include <pgmspace.h>
-#include <string.h>
 #include <catch.hpp>
+#include <string.h>
+#include <pgmspace.h>
 
 TEST_CASE("strstr_P works as strstr", "[core][pgmspace]")
 {
diff --git a/tests/host/core/test_string.cpp b/tests/host/core/test_string.cpp
index 9aa770a8a9..db6244a059 100644
--- a/tests/host/core/test_string.cpp
+++ b/tests/host/core/test_string.cpp
@@ -1,23 +1,23 @@
 /*
-    test_string.cpp - String tests
-    Copyright © 2018 Earle F. Philhower, III
+ test_string.cpp - String tests
+ Copyright © 2018 Earle F. Philhower, III
 
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
 
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
-*/
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ */
 
-#include <StreamString.h>
+#include <catch.hpp>
+#include <string.h>
 #include <WString.h>
 #include <limits.h>
-#include <string.h>
-#include <catch.hpp>
+#include <StreamString.h>
 
 TEST_CASE("String::move", "[core][String]")
 {
@@ -162,15 +162,11 @@ TEST_CASE("String concantenation", "[core][String]")
     n.concat(buff, 3);
     REQUIRE(n == "1abc");  // Ensure the trailing 0 is always present even w/this funky concat
     for (int i = 0; i < 20; i++)
-    {
         n.concat(buff, 1);  // Add 20 'a's to go from SSO to normal string
-    }
     REQUIRE(n == "1abcaaaaaaaaaaaaaaaaaaaa");
     n = "";
     for (int i = 0; i <= 5; i++)
-    {
         n.concat(buff, i);
-    }
     REQUIRE(n == "aababcabcdabcde");
     n.concat(buff, 0);  // And check no add'n
     REQUIRE(n == "aababcabcdabcde");
diff --git a/tests/host/fs/test_fs.cpp b/tests/host/fs/test_fs.cpp
index 5ea8e94a67..be7b26ad14 100644
--- a/tests/host/fs/test_fs.cpp
+++ b/tests/host/fs/test_fs.cpp
@@ -1,28 +1,28 @@
 /*
-    test_fs.cpp - host side file system tests
-    Copyright © 2016 Ivan Grokhotkov
-
-    Permission is hereby granted, free of charge, to any person obtaining a copy
-    of this software and associated documentation files (the "Software"), to deal
-    in the Software without restriction, including without limitation the rights
-    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-    copies of the Software, and to permit persons to whom the Software is
-    furnished to do so, subject to the following conditions:
-
-    The above copyright notice and this permission notice shall be included in
-    all copies or substantial portions of the Software.
+ test_fs.cpp - host side file system tests
+ Copyright © 2016 Ivan Grokhotkov
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
 */
 
-#include <FS.h>
-#include <LittleFS.h>
-#include <spiffs/spiffs.h>
 #include <catch.hpp>
 #include <map>
-#include "../../../libraries/SD/src/SD.h"
-#include "../../../libraries/SDFS/src/SDFS.h"
+#include <FS.h>
+#include "../common/spiffs_mock.h"
 #include "../common/littlefs_mock.h"
 #include "../common/sdfs_mock.h"
-#include "../common/spiffs_mock.h"
+#include <spiffs/spiffs.h>
+#include <LittleFS.h>
+#include "../../../libraries/SDFS/src/SDFS.h"
+#include "../../../libraries/SD/src/SD.h"
 
 namespace spiffs_test
 {

From 015aacff06f53930ee023846ea27132557c3ae19 Mon Sep 17 00:00:00 2001
From: david gauchard <gauchard@laas.fr>
Date: Thu, 20 Jan 2022 00:13:16 +0100
Subject: [PATCH 07/15] clang-format: based on WebKit style, added Arduino ino
 style

---
 .github/workflows/pull-request.yml            |    2 +-
 cores/esp8266/LwipDhcpServer.cpp              |  162 +-
 cores/esp8266/LwipDhcpServer.h                |   12 +-
 cores/esp8266/LwipIntf.cpp                    |    2 +-
 cores/esp8266/LwipIntf.h                      |    4 +-
 cores/esp8266/LwipIntfCB.cpp                  |   10 +-
 cores/esp8266/LwipIntfDev.h                   |   41 +-
 cores/esp8266/StreamSend.cpp                  |    6 +-
 cores/esp8266/StreamString.h                  |   84 +-
 cores/esp8266/core_esp8266_si2c.cpp           |  275 +-
 .../ArduinoOTA/examples/BasicOTA/BasicOTA.ino |    2 +-
 .../ArduinoOTA/examples/OTALeds/OTALeds.ino   |    5 +-
 .../CaptivePortalAdvanced.ino                 |   13 +-
 .../CaptivePortalAdvanced/handleHttp.ino      |   77 +-
 .../examples/CaptivePortalAdvanced/tools.ino  |    1 -
 .../Arduino_Wifi_AVRISP.ino                   |   26 +-
 .../examples/Authorization/Authorization.ino  |    3 -
 .../BasicHttpClient/BasicHttpClient.ino       |    4 +-
 .../BasicHttpsClient/BasicHttpsClient.ino     |    6 +-
 .../DigestAuthorization.ino                   |   25 +-
 .../PostHttpClient/PostHttpClient.ino         |    3 +-
 .../ReuseConnectionV2/ReuseConnectionV2.ino   |    4 +-
 .../StreamHttpClient/StreamHttpClient.ino     |    3 +-
 .../StreamHttpsClient/StreamHttpsClient.ino   |    4 +-
 .../SecureBearSSLUpdater.ino                  |   20 +-
 .../SecureWebUpdater/SecureWebUpdater.ino     |    2 +-
 .../examples/WebUpdater/WebUpdater.ino        |    2 +-
 .../LLMNR_Web_Server/LLMNR_Web_Server.ino     |    2 +-
 .../examples/ESP_NBNST/ESP_NBNST.ino          |    3 +-
 libraries/ESP8266SSDP/examples/SSDP/SSDP.ino  |    2 +-
 .../AdvancedWebServer/AdvancedWebServer.ino   |   12 +-
 .../examples/FSBrowser/FSBrowser.ino          |   22 +-
 .../ESP8266WebServer/examples/Graph/Graph.ino |    7 +-
 .../examples/HelloServer/HelloServer.ino      |   14 +-
 .../HelloServerBearSSL/HelloServerBearSSL.ino |   50 +-
 .../HttpAdvancedAuth/HttpAdvancedAuth.ino     |   16 +-
 .../examples/HttpBasicAuth/HttpBasicAuth.ino  |    2 +-
 .../HttpHashCredAuth/HttpHashCredAuth.ino     |   78 +-
 .../examples/PathArgServer/PathArgServer.ino  |    6 +-
 .../examples/PostServer/PostServer.ino        |    4 +-
 .../ServerSentEvents/ServerSentEvents.ino     |   38 +-
 .../SimpleAuthentication.ino                  |    5 +-
 .../examples/WebServer/WebServer.ino          |  134 +-
 .../examples/WebUpdate/WebUpdate.ino          |   11 +-
 .../BearSSL_CertStore/BearSSL_CertStore.ino   |   15 +-
 .../BearSSL_MaxFragmentLength.ino             |    8 +-
 .../BearSSL_Server/BearSSL_Server.ino         |   49 +-
 .../BearSSL_ServerClientCert.ino              |   42 +-
 .../BearSSL_Sessions/BearSSL_Sessions.ino     |   14 +-
 .../BearSSL_Validation/BearSSL_Validation.ino |   13 +-
 .../examples/HTTPSRequest/HTTPSRequest.ino    |    7 +-
 libraries/ESP8266WiFi/examples/IPv6/IPv6.ino  |   33 +-
 .../examples/NTPClient/NTPClient.ino          |   34 +-
 .../examples/PagerServer/PagerServer.ino      |    4 +-
 .../RangeExtender-NAPT/RangeExtender-NAPT.ino |   17 +-
 .../examples/StaticLease/StaticLease.ino      |   10 +-
 libraries/ESP8266WiFi/examples/Udp/Udp.ino    |   16 +-
 .../WiFiAccessPoint/WiFiAccessPoint.ino       |    6 +-
 .../examples/WiFiClient/WiFiClient.ino        |    4 +-
 .../WiFiClientBasic/WiFiClientBasic.ino       |    6 +-
 .../examples/WiFiEcho/WiFiEcho.ino            |   72 +-
 .../examples/WiFiEvents/WiFiEvents.ino        |    6 +-
 .../WiFiManualWebServer.ino                   |    2 +-
 .../examples/WiFiScan/WiFiScan.ino            |   16 +-
 .../examples/WiFiShutdown/WiFiShutdown.ino    |    4 +-
 .../WiFiTelnetToSerial/WiFiTelnetToSerial.ino |    4 +-
 .../examples/HelloEspnow/HelloEspnow.ino      |   61 +-
 .../examples/HelloMesh/HelloMesh.ino          |   16 +-
 .../examples/HelloTcpIp/HelloTcpIp.ino        |   32 +-
 .../examples/httpUpdate/httpUpdate.ino        |    6 +-
 .../httpUpdateLittleFS/httpUpdateLittleFS.ino |    4 +-
 .../httpUpdateSecure/httpUpdateSecure.ino     |    7 +-
 .../httpUpdateSigned/httpUpdateSigned.ino     |   18 +-
 .../LEAmDNS/mDNS_Clock/mDNS_Clock.ino         |   45 +-
 .../mDNS_ServiceMonitor.ino                   |   48 +-
 .../OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino   |   18 +-
 .../mDNS-SD_Extended/mDNS-SD_Extended.ino     |    6 +-
 .../mDNS_Web_Server/mDNS_Web_Server.ino       |    4 +-
 libraries/ESP8266mDNS/src/LEAmDNS.cpp         | 1587 +++++-----
 libraries/ESP8266mDNS/src/LEAmDNS.h           | 2091 +++++++------
 libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp | 2706 ++++++++--------
 libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp |  859 +++---
 libraries/ESP8266mDNS/src/LEAmDNS_Priv.h      |    2 +-
 libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp | 2746 ++++++++---------
 .../ESP8266mDNS/src/LEAmDNS_Transfer.cpp      | 2111 ++++++-------
 .../InputSerialPlotter/InputSerialPlotter.ino |    3 +-
 .../I2S/examples/SimpleTone/SimpleTone.ino    |    4 +-
 .../LittleFS_Timestamp/LittleFS_Timestamp.ino |   27 +-
 .../LittleFS/examples/SpeedTest/SpeedTest.ino |    7 +-
 .../Netdump/examples/Netdump/Netdump.ino      |   72 +-
 libraries/Netdump/src/Netdump.cpp             |   16 +-
 libraries/Netdump/src/Netdump.h               |    4 +-
 libraries/Netdump/src/NetdumpIP.cpp           |  128 +-
 libraries/Netdump/src/NetdumpIP.h             |    8 +-
 libraries/Netdump/src/NetdumpPacket.cpp       |  242 +-
 libraries/Netdump/src/NetdumpPacket.h         |   11 +-
 libraries/Netdump/src/PacketType.cpp          |   76 +-
 libraries/Netdump/src/PacketType.h            |    6 +-
 .../SD/examples/Datalogger/Datalogger.ino     |    9 -
 libraries/SD/examples/DumpFile/DumpFile.ino   |    1 -
 libraries/SD/examples/Files/Files.ino         |    3 -
 libraries/SD/examples/ReadWrite/ReadWrite.ino |    2 -
 libraries/SD/examples/listfiles/listfiles.ino |    6 +-
 .../SPISlave_Master/SPISlave_Master.ino       |  106 +-
 .../SPISlave_SafeMaster.ino                   |  117 +-
 .../examples/SPISlave_Test/SPISlave_Test.ino  |   10 +-
 libraries/Servo/examples/Sweep/Sweep.ino      |   14 +-
 .../examples/drawCircle/drawCircle.ino        |   13 +-
 .../examples/drawLines/drawLines.ino          |   11 +-
 .../examples/drawNumber/drawNumber.ino        |   20 +-
 .../examples/drawRectangle/drawRectangle.ino  |    5 +-
 .../examples/paint/paint.ino                  |    6 +-
 .../examples/shapes/shapes.ino                |    8 +-
 .../examples/text/text.ino                    |   19 +-
 .../examples/tftbmp/tftbmp.ino                |   44 +-
 .../examples/tftbmp2/tftbmp2.ino              |   65 +-
 .../examples/TickerBasic/TickerBasic.ino      |    4 +-
 .../TickerFunctional/TickerFunctional.ino     |   38 +-
 libraries/Wire/Wire.cpp                       |    2 +-
 libraries/Wire/Wire.h                         |    4 +-
 .../examples/master_reader/master_reader.ino  |    9 +-
 .../examples/master_writer/master_writer.ino  |    7 +-
 .../slave_receiver/slave_receiver.ino         |   11 +-
 .../examples/slave_sender/slave_sender.ino    |    3 +-
 libraries/esp8266/examples/Blink/Blink.ino    |   10 +-
 .../BlinkPolledTimeout/BlinkPolledTimeout.ino |   11 +-
 .../BlinkWithoutDelay/BlinkWithoutDelay.ino   |    4 +-
 .../examples/CallBackList/CallBackGeneric.ino |   26 +-
 .../examples/CheckFlashCRC/CheckFlashCRC.ino  |    3 +-
 .../CheckFlashConfig/CheckFlashConfig.ino     |    5 +-
 .../examples/ConfigFile/ConfigFile.ino        |    1 -
 .../FadePolledTimeout/FadePolledTimeout.ino   |    5 +-
 .../examples/HeapMetric/HeapMetric.ino        |    9 +-
 .../examples/HelloCrypto/HelloCrypto.ino      |    4 -
 .../examples/HwdtStackDump/HwdtStackDump.ino  |   15 +-
 .../examples/HwdtStackDump/ProcessKey.ino     |   23 +-
 .../examples/I2STransmit/I2STransmit.ino      |    7 +-
 .../examples/IramReserve/IramReserve.ino      |   12 +-
 .../examples/IramReserve/ProcessKey.ino       |   23 +-
 .../examples/LowPowerDemo/LowPowerDemo.ino    |  230 +-
 libraries/esp8266/examples/MMU48K/MMU48K.ino  |  138 +-
 .../examples/NTP-TZ-DST/NTP-TZ-DST.ino        |   46 +-
 .../examples/RTCUserMemory/RTCUserMemory.ino  |   14 +-
 .../SerialDetectBaudrate.ino                  |    4 +-
 .../examples/SerialStress/SerialStress.ino    |   25 +-
 .../SigmaDeltaDemo/SigmaDeltaDemo.ino         |    2 -
 .../examples/StreamString/StreamString.ino    |    5 +-
 .../examples/TestEspApi/TestEspApi.ino        |   46 +-
 .../examples/UartDownload/UartDownload.ino    |   22 +-
 .../examples/interactive/interactive.ino      |   90 +-
 .../esp8266/examples/irammem/irammem.ino      |  134 +-
 .../examples/virtualmem/virtualmem.ino        |   18 +-
 .../lwIP_PPP/examples/PPPServer/PPPServer.ino |   15 +-
 libraries/lwIP_PPP/src/PPPServer.cpp          |  120 +-
 libraries/lwIP_PPP/src/PPPServer.h            |    4 +-
 .../lwIP_enc28j60/src/utility/enc28j60.cpp    |   43 +-
 .../lwIP_enc28j60/src/utility/enc28j60.h      |    6 +-
 libraries/lwIP_w5100/src/utility/w5100.cpp    |    3 +-
 libraries/lwIP_w5100/src/utility/w5100.h      |    6 +-
 libraries/lwIP_w5500/src/utility/w5500.cpp    |    3 +-
 libraries/lwIP_w5500/src/utility/w5500.h      |    6 +-
 tests/astyle_core.conf                        |   32 -
 tests/astyle_examples.conf                    |   44 -
 tests/clang-format-arduino                    |    5 +
 .clang-format => tests/clang-format-core      |    2 +-
 tests/device/libraries/BSTest/src/BSArduino.h |    4 +-
 tests/device/libraries/BSTest/src/BSArgs.h    |   94 +-
 .../device/libraries/BSTest/src/BSProtocol.h  |  174 +-
 tests/device/libraries/BSTest/src/BSStdio.h   |    2 +-
 tests/device/libraries/BSTest/src/BSTest.h    |   32 +-
 tests/device/test_libc/memmove1.c             |    2 +-
 tests/device/test_libc/tstring.c              |  113 +-
 tests/host/common/Arduino.cpp                 |    2 +-
 tests/host/common/ArduinoMain.cpp             |  111 +-
 tests/host/common/EEPROM.h                    |    4 +-
 tests/host/common/HostWiring.cpp              |   46 +-
 tests/host/common/MockEsp.cpp                 |   32 +-
 tests/host/common/MockTools.cpp               |    8 +-
 tests/host/common/MockUART.cpp                |   70 +-
 tests/host/common/flash_hal_mock.cpp          |    3 +-
 tests/host/common/include/ClientContext.h     |   18 +-
 tests/host/common/include/UdpContext.h        |    9 +-
 tests/host/common/littlefs_mock.h             |    4 +-
 tests/host/common/md5.c                       |   13 +-
 tests/host/common/queue.h                     |  154 +-
 tests/host/common/sdfs_mock.h                 |    6 +-
 tests/host/common/spiffs_mock.h               |    4 +-
 tests/host/common/strl.cpp                    |   16 +-
 tests/host/common/user_interface.cpp          |    2 +-
 tests/host/core/test_string.cpp               |   13 +-
 tests/host/fs/test_fs.cpp                     |    2 +-
 tests/restyle.sh                              |    7 +-
 192 files changed, 8398 insertions(+), 8862 deletions(-)
 mode change 100755 => 100644 libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
 delete mode 100644 tests/astyle_core.conf
 delete mode 100644 tests/astyle_examples.conf
 create mode 100644 tests/clang-format-arduino
 rename .clang-format => tests/clang-format-core (88%)

diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml
index 5cf15ddcf3..62e7e0e09f 100644
--- a/.github/workflows/pull-request.yml
+++ b/.github/workflows/pull-request.yml
@@ -242,7 +242,7 @@ jobs:
         TRAVIS_TAG: ${{ github.ref }}
       run: |
           sudo apt update
-          sudo apt install astyle clang-format-12
+          sudo apt install clang-format-12
           bash ./tests/ci/style_check.sh
 
 
diff --git a/cores/esp8266/LwipDhcpServer.cpp b/cores/esp8266/LwipDhcpServer.cpp
index cbf151f767..c5b5342fef 100644
--- a/cores/esp8266/LwipDhcpServer.cpp
+++ b/cores/esp8266/LwipDhcpServer.cpp
@@ -197,12 +197,11 @@ DhcpServer::DhcpServer(netif* netif)
         // 1. `fw_has_started_softap_dhcps` is already initialized to 1
         // 2. global ctor DhcpServer's `dhcpSoftAP(&netif_git[SOFTAP_IF])` is called
         // 3. (that's here) => begin(legacy-values) is called
-        ip_info ip =
-            {
-                {0x0104a8c0},  // IP 192.168.4.1
-                {0x00ffffff},  // netmask 255.255.255.0
-                {0}            // gateway 0.0.0.0
-            };
+        ip_info ip = {
+            { 0x0104a8c0 },  // IP 192.168.4.1
+            { 0x00ffffff },  // netmask 255.255.255.0
+            { 0 }            // gateway 0.0.0.0
+        };
         begin(&ip);
         fw_has_started_softap_dhcps = 2;  // not 1, ending initial boot sequence
     }
@@ -737,32 +736,32 @@ uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
 #endif
         switch ((sint16_t)*optptr)
         {
-            case DHCP_OPTION_MSG_TYPE:  //53
-                type = *(optptr + 2);
-                break;
+        case DHCP_OPTION_MSG_TYPE:  //53
+            type = *(optptr + 2);
+            break;
 
-            case DHCP_OPTION_REQ_IPADDR:  //50
-                //os_printf("dhcps:0x%08x,0x%08x\n",client.addr,*(uint32*)(optptr+2));
-                if (memcmp((char*)&client.addr, (char*)optptr + 2, 4) == 0)
-                {
+        case DHCP_OPTION_REQ_IPADDR:  //50
+            //os_printf("dhcps:0x%08x,0x%08x\n",client.addr,*(uint32*)(optptr+2));
+            if (memcmp((char*)&client.addr, (char*)optptr + 2, 4) == 0)
+            {
 #if DHCPS_DEBUG
-                    os_printf("dhcps: DHCP_OPTION_REQ_IPADDR = 0 ok\n");
+                os_printf("dhcps: DHCP_OPTION_REQ_IPADDR = 0 ok\n");
 #endif
-                    s.state = DHCPS_STATE_ACK;
-                }
-                else
-                {
+                s.state = DHCPS_STATE_ACK;
+            }
+            else
+            {
 #if DHCPS_DEBUG
-                    os_printf("dhcps: DHCP_OPTION_REQ_IPADDR != 0 err\n");
+                os_printf("dhcps: DHCP_OPTION_REQ_IPADDR != 0 err\n");
 #endif
-                    s.state = DHCPS_STATE_NAK;
-                }
-                break;
-            case DHCP_OPTION_END:
-            {
-                is_dhcp_parse_end = true;
+                s.state = DHCPS_STATE_NAK;
             }
             break;
+        case DHCP_OPTION_END:
+        {
+            is_dhcp_parse_end = true;
+        }
+        break;
         }
 
         if (is_dhcp_parse_end)
@@ -775,43 +774,43 @@ uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
 
     switch (type)
     {
-        case DHCPDISCOVER:  //1
-            s.state = DHCPS_STATE_OFFER;
+    case DHCPDISCOVER:  //1
+        s.state = DHCPS_STATE_OFFER;
 #if DHCPS_DEBUG
-            os_printf("dhcps: DHCPD_STATE_OFFER\n");
+        os_printf("dhcps: DHCPD_STATE_OFFER\n");
 #endif
-            break;
+        break;
 
-        case DHCPREQUEST:  //3
-            if (!(s.state == DHCPS_STATE_ACK || s.state == DHCPS_STATE_NAK))
+    case DHCPREQUEST:  //3
+        if (!(s.state == DHCPS_STATE_ACK || s.state == DHCPS_STATE_NAK))
+        {
+            if (renew == true)
             {
-                if (renew == true)
-                {
-                    s.state = DHCPS_STATE_ACK;
-                }
-                else
-                {
-                    s.state = DHCPS_STATE_NAK;
-                }
+                s.state = DHCPS_STATE_ACK;
+            }
+            else
+            {
+                s.state = DHCPS_STATE_NAK;
+            }
 #if DHCPS_DEBUG
-                os_printf("dhcps: DHCPD_STATE_NAK\n");
+            os_printf("dhcps: DHCPD_STATE_NAK\n");
 #endif
-            }
-            break;
+        }
+        break;
 
-        case DHCPDECLINE:  //4
-            s.state = DHCPS_STATE_IDLE;
+    case DHCPDECLINE:  //4
+        s.state = DHCPS_STATE_IDLE;
 #if DHCPS_DEBUG
-            os_printf("dhcps: DHCPD_STATE_IDLE\n");
+        os_printf("dhcps: DHCPD_STATE_IDLE\n");
 #endif
-            break;
+        break;
 
-        case DHCPRELEASE:  //7
-            s.state = DHCPS_STATE_RELEASE;
+    case DHCPRELEASE:  //7
+        s.state = DHCPS_STATE_RELEASE;
 #if DHCPS_DEBUG
-            os_printf("dhcps: DHCPD_STATE_IDLE\n");
+        os_printf("dhcps: DHCPD_STATE_IDLE\n");
 #endif
-            break;
+        break;
     }
 #if DHCPS_DEBUG
     os_printf("dhcps: return s.state = %d\n", s.state);
@@ -823,8 +822,9 @@ uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
 sint16_t DhcpServer::parse_msg(struct dhcps_msg* m, u16_t len)
 {
     if (memcmp((char*)m->options,
-               &magic_cookie,
-               sizeof(magic_cookie)) == 0)
+            &magic_cookie,
+            sizeof(magic_cookie))
+        == 0)
     {
         struct ipv4_addr ip;
         memcpy(&ip.addr, m->ciaddr, sizeof(ip.addr));
@@ -856,10 +856,10 @@ sint16_t DhcpServer::parse_msg(struct dhcps_msg* m, u16_t len)
 ///////////////////////////////////////////////////////////////////////////////////
 
 void DhcpServer::S_handle_dhcp(void* arg,
-                               struct udp_pcb* pcb,
-                               struct pbuf* p,
-                               const ip_addr_t* addr,
-                               uint16_t port)
+    struct udp_pcb* pcb,
+    struct pbuf* p,
+    const ip_addr_t* addr,
+    uint16_t port)
 {
     DhcpServer* instance = reinterpret_cast<DhcpServer*>(arg);
     instance->handle_dhcp(pcb, p, addr, port);
@@ -931,30 +931,30 @@ void DhcpServer::handle_dhcp(
 
     switch (parse_msg(pmsg_dhcps, tlen - 240))
     {
-        case DHCPS_STATE_OFFER:  //1
+    case DHCPS_STATE_OFFER:  //1
 #if DHCPS_DEBUG
-            os_printf("dhcps: handle_dhcp-> DHCPD_STATE_OFFER\n");
+        os_printf("dhcps: handle_dhcp-> DHCPD_STATE_OFFER\n");
 #endif
-            send_offer(pmsg_dhcps);
-            break;
-        case DHCPS_STATE_ACK:  //3
+        send_offer(pmsg_dhcps);
+        break;
+    case DHCPS_STATE_ACK:  //3
 #if DHCPS_DEBUG
-            os_printf("dhcps: handle_dhcp-> DHCPD_STATE_ACK\n");
+        os_printf("dhcps: handle_dhcp-> DHCPD_STATE_ACK\n");
 #endif
-            send_ack(pmsg_dhcps);
-            if (_netif->num == SOFTAP_IF)
-            {
-                wifi_softap_set_station_info(pmsg_dhcps->chaddr, &client_address);
-            }
-            break;
-        case DHCPS_STATE_NAK:  //4
+        send_ack(pmsg_dhcps);
+        if (_netif->num == SOFTAP_IF)
+        {
+            wifi_softap_set_station_info(pmsg_dhcps->chaddr, &client_address);
+        }
+        break;
+    case DHCPS_STATE_NAK:  //4
 #if DHCPS_DEBUG
-            os_printf("dhcps: handle_dhcp-> DHCPD_STATE_NAK\n");
+        os_printf("dhcps: handle_dhcp-> DHCPD_STATE_NAK\n");
 #endif
-            send_nak(pmsg_dhcps);
-            break;
-        default:
-            break;
+        send_nak(pmsg_dhcps);
+        break;
+    default:
+        break;
     }
 #if DHCPS_DEBUG
     os_printf("dhcps: handle_dhcp-> pbuf_free(p)\n");
@@ -1299,13 +1299,13 @@ bool DhcpServer::set_dhcps_offer_option(uint8 level, void* optarg)
 
     switch (level)
     {
-        case OFFER_ROUTER:
-            offer = (*(uint8*)optarg) & 0x01;
-            offer_flag = true;
-            break;
-        default:
-            offer_flag = false;
-            break;
+    case OFFER_ROUTER:
+        offer = (*(uint8*)optarg) & 0x01;
+        offer_flag = true;
+        break;
+    default:
+        offer_flag = false;
+        break;
     }
     return offer_flag;
 }
diff --git a/cores/esp8266/LwipDhcpServer.h b/cores/esp8266/LwipDhcpServer.h
index 51c4bf86f9..74fa3a4018 100644
--- a/cores/esp8266/LwipDhcpServer.h
+++ b/cores/esp8266/LwipDhcpServer.h
@@ -35,7 +35,7 @@
 
 class DhcpServer
 {
-   public:
+public:
     DhcpServer(netif* netif);
     ~DhcpServer();
 
@@ -63,7 +63,7 @@ class DhcpServer
 
     void dhcps_set_dns(int num, const ipv4_addr_t* dns);
 
-   protected:
+protected:
     // legacy C structure and API to eventually turn into C++
 
     typedef struct _list_node
@@ -84,10 +84,10 @@ class DhcpServer
     uint8_t parse_options(uint8_t* optptr, sint16_t len);
     sint16_t parse_msg(struct dhcps_msg* m, u16_t len);
     static void S_handle_dhcp(void* arg,
-                              struct udp_pcb* pcb,
-                              struct pbuf* p,
-                              const ip_addr_t* addr,
-                              uint16_t port);
+        struct udp_pcb* pcb,
+        struct pbuf* p,
+        const ip_addr_t* addr,
+        uint16_t port);
     void handle_dhcp(
         struct udp_pcb* pcb,
         struct pbuf* p,
diff --git a/cores/esp8266/LwipIntf.cpp b/cores/esp8266/LwipIntf.cpp
index 71dec259a4..10d42aaf23 100644
--- a/cores/esp8266/LwipIntf.cpp
+++ b/cores/esp8266/LwipIntf.cpp
@@ -153,7 +153,7 @@ bool LwipIntf::hostname(const char* aHostname)
             if (lwipret != ERR_OK)
             {
                 DEBUGV("WiFi.hostname(%s): lwIP error %d on interface %c%c (index %d)\n",
-                       intf->hostname, (int)lwipret, intf->name[0], intf->name[1], intf->num);
+                    intf->hostname, (int)lwipret, intf->name[0], intf->name[1], intf->num);
                 ret = false;
             }
         }
diff --git a/cores/esp8266/LwipIntf.h b/cores/esp8266/LwipIntf.h
index 778785b7fd..7943c6cb5a 100644
--- a/cores/esp8266/LwipIntf.h
+++ b/cores/esp8266/LwipIntf.h
@@ -9,7 +9,7 @@
 
 class LwipIntf
 {
-   public:
+public:
     using CBType = std::function<void(netif*)>;
 
     static bool stateUpCB(LwipIntf::CBType&& cb);
@@ -38,7 +38,7 @@ class LwipIntf
     }
     const char* getHostname();
 
-   protected:
+protected:
     static bool stateChangeSysCB(LwipIntf::CBType&& cb);
 };
 
diff --git a/cores/esp8266/LwipIntfCB.cpp b/cores/esp8266/LwipIntfCB.cpp
index 7271416300..71047dcdd1 100644
--- a/cores/esp8266/LwipIntfCB.cpp
+++ b/cores/esp8266/LwipIntfCB.cpp
@@ -34,9 +34,9 @@ bool LwipIntf::stateChangeSysCB(LwipIntf::CBType&& cb)
 bool LwipIntf::stateUpCB(LwipIntf::CBType&& cb)
 {
     return stateChangeSysCB([cb](netif* nif)
-                            {
-                                if (netif_is_up(nif))
-                                    schedule_function([cb, nif]()
-                                                      { cb(nif); });
-                            });
+        {
+            if (netif_is_up(nif))
+                schedule_function([cb, nif]()
+                    { cb(nif); });
+        });
 }
diff --git a/cores/esp8266/LwipIntfDev.h b/cores/esp8266/LwipIntfDev.h
index 3ec06c55f6..bebba74266 100644
--- a/cores/esp8266/LwipIntfDev.h
+++ b/cores/esp8266/LwipIntfDev.h
@@ -28,13 +28,13 @@
 template <class RawDev>
 class LwipIntfDev : public LwipIntf, public RawDev
 {
-   public:
+public:
     LwipIntfDev(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1)
-        : RawDev(cs, spi, intr),
-          _mtu(DEFAULT_MTU),
-          _intrPin(intr),
-          _started(false),
-          _default(false)
+        : RawDev(cs, spi, intr)
+        , _mtu(DEFAULT_MTU)
+        , _intrPin(intr)
+        , _started(false)
+        , _default(false)
     {
         memset(&_netif, 0, sizeof(_netif));
     }
@@ -74,7 +74,7 @@ class LwipIntfDev : public LwipIntf, public RawDev
 
     wl_status_t status();
 
-   protected:
+protected:
     err_t netif_init();
     void netif_status_callback();
 
@@ -190,15 +190,15 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
     {
         switch (dhcp_start(&_netif))
         {
-            case ERR_OK:
-                break;
+        case ERR_OK:
+            break;
 
-            case ERR_IF:
-                return false;
+        case ERR_IF:
+            return false;
 
-            default:
-                netif_remove(&_netif);
-                return false;
+        default:
+            netif_remove(&_netif);
+            return false;
         }
     }
 
@@ -218,11 +218,11 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
     }
 
     if (_intrPin < 0 && !schedule_recurrent_function_us([&]()
-                                                        {
-                                                            this->handlePackets();
-                                                            return true;
-                                                        },
-                                                        100))
+            {
+                this->handlePackets();
+                return true;
+            },
+            100))
     {
         netif_remove(&_netif);
         return false;
@@ -278,8 +278,7 @@ err_t LwipIntfDev<RawDev>::netif_init()
     _netif.name[1] = '0' + _netif.num;
     _netif.mtu = _mtu;
     _netif.chksum_flags = NETIF_CHECKSUM_ENABLE_ALL;
-    _netif.flags =
-        NETIF_FLAG_ETHARP | NETIF_FLAG_IGMP | NETIF_FLAG_BROADCAST | NETIF_FLAG_LINK_UP;
+    _netif.flags = NETIF_FLAG_ETHARP | NETIF_FLAG_IGMP | NETIF_FLAG_BROADCAST | NETIF_FLAG_LINK_UP;
 
     // lwIP's doc: This function typically first resolves the hardware
     // address, then sends the packet.  For ethernet physical layer, this is
diff --git a/cores/esp8266/StreamSend.cpp b/cores/esp8266/StreamSend.cpp
index d84a4bf961..948e46e5fb 100644
--- a/cores/esp8266/StreamSend.cpp
+++ b/cores/esp8266/StreamSend.cpp
@@ -23,9 +23,9 @@
 #include <StreamDev.h>
 
 size_t Stream::sendGeneric(Print* to,
-                           const ssize_t len,
-                           const int readUntilChar,
-                           const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
+    const ssize_t len,
+    const int readUntilChar,
+    const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
 {
     setReport(Report::Success);
 
diff --git a/cores/esp8266/StreamString.h b/cores/esp8266/StreamString.h
index 4af6f5653c..7bda5dde68 100644
--- a/cores/esp8266/StreamString.h
+++ b/cores/esp8266/StreamString.h
@@ -34,14 +34,16 @@
 
 class S2Stream : public Stream
 {
-   public:
+public:
     S2Stream(String& string, int peekPointer = -1)
-        : string(&string), peekPointer(peekPointer)
+        : string(&string)
+        , peekPointer(peekPointer)
     {
     }
 
     S2Stream(String* string, int peekPointer = -1)
-        : string(string), peekPointer(peekPointer)
+        : string(string)
+        , peekPointer(peekPointer)
     {
     }
 
@@ -205,7 +207,7 @@ class S2Stream : public Stream
         peekPointer = pointer;
     }
 
-   protected:
+protected:
     String* string;
     int peekPointer;  // -1:String is consumed / >=0:resettable pointer
 };
@@ -214,7 +216,7 @@ class S2Stream : public Stream
 
 class StreamString : public String, public S2Stream
 {
-   protected:
+protected:
     void resetpp()
     {
         if (peekPointer > 0)
@@ -223,39 +225,81 @@ class StreamString : public String, public S2Stream
         }
     }
 
-   public:
+public:
     StreamString(StreamString&& bro)
-        : String(bro), S2Stream(this) {}
+        : String(bro)
+        , S2Stream(this)
+    {
+    }
     StreamString(const StreamString& bro)
-        : String(bro), S2Stream(this) {}
+        : String(bro)
+        , S2Stream(this)
+    {
+    }
 
     // duplicate String constructors and operator=:
 
     StreamString(const char* text = nullptr)
-        : String(text), S2Stream(this) {}
+        : String(text)
+        , S2Stream(this)
+    {
+    }
     StreamString(const String& string)
-        : String(string), S2Stream(this) {}
+        : String(string)
+        , S2Stream(this)
+    {
+    }
     StreamString(const __FlashStringHelper* str)
-        : String(str), S2Stream(this) {}
+        : String(str)
+        , S2Stream(this)
+    {
+    }
     StreamString(String&& string)
-        : String(string), S2Stream(this) {}
+        : String(string)
+        , S2Stream(this)
+    {
+    }
 
     explicit StreamString(char c)
-        : String(c), S2Stream(this) {}
+        : String(c)
+        , S2Stream(this)
+    {
+    }
     explicit StreamString(unsigned char c, unsigned char base = 10)
-        : String(c, base), S2Stream(this) {}
+        : String(c, base)
+        , S2Stream(this)
+    {
+    }
     explicit StreamString(int i, unsigned char base = 10)
-        : String(i, base), S2Stream(this) {}
+        : String(i, base)
+        , S2Stream(this)
+    {
+    }
     explicit StreamString(unsigned int i, unsigned char base = 10)
-        : String(i, base), S2Stream(this) {}
+        : String(i, base)
+        , S2Stream(this)
+    {
+    }
     explicit StreamString(long l, unsigned char base = 10)
-        : String(l, base), S2Stream(this) {}
+        : String(l, base)
+        , S2Stream(this)
+    {
+    }
     explicit StreamString(unsigned long l, unsigned char base = 10)
-        : String(l, base), S2Stream(this) {}
+        : String(l, base)
+        , S2Stream(this)
+    {
+    }
     explicit StreamString(float f, unsigned char decimalPlaces = 2)
-        : String(f, decimalPlaces), S2Stream(this) {}
+        : String(f, decimalPlaces)
+        , S2Stream(this)
+    {
+    }
     explicit StreamString(double d, unsigned char decimalPlaces = 2)
-        : String(d, decimalPlaces), S2Stream(this) {}
+        : String(d, decimalPlaces)
+        , S2Stream(this)
+    {
+    }
 
     StreamString& operator=(const StreamString& rhs)
     {
diff --git a/cores/esp8266/core_esp8266_si2c.cpp b/cores/esp8266/core_esp8266_si2c.cpp
index e8f0ddb9c1..e56b8b5fba 100644
--- a/cores/esp8266/core_esp8266_si2c.cpp
+++ b/cores/esp8266/core_esp8266_si2c.cpp
@@ -59,7 +59,7 @@ static inline __attribute__((always_inline)) bool SCL_READ(const int twi_scl)
 // Implement as a class to reduce code size by allowing access to many global variables with a single base pointer
 class Twi
 {
-   private:
+private:
     unsigned int preferred_si2c_clock = 100000;
     uint32_t twi_dcount = 18;
     unsigned char twi_sda = 0;
@@ -72,25 +72,27 @@ class Twi
     // byte-wide ones, and since these emums are used everywhere, the difference adds up fast.  There is only a single
     // instance of the class, though, so the extra 12 bytes of RAM used here saves a lot more IRAM.
     volatile enum { TWIPM_UNKNOWN = 0,
-                    TWIPM_IDLE,
-                    TWIPM_ADDRESSED,
-                    TWIPM_WAIT } twip_mode = TWIPM_IDLE;
+        TWIPM_IDLE,
+        TWIPM_ADDRESSED,
+        TWIPM_WAIT } twip_mode
+        = TWIPM_IDLE;
     volatile enum { TWIP_UNKNOWN = 0,
-                    TWIP_IDLE,
-                    TWIP_START,
-                    TWIP_SEND_ACK,
-                    TWIP_WAIT_ACK,
-                    TWIP_WAIT_STOP,
-                    TWIP_SLA_W,
-                    TWIP_SLA_R,
-                    TWIP_REP_START,
-                    TWIP_READ,
-                    TWIP_STOP,
-                    TWIP_REC_ACK,
-                    TWIP_READ_ACK,
-                    TWIP_RWAIT_ACK,
-                    TWIP_WRITE,
-                    TWIP_BUS_ERR } twip_state = TWIP_IDLE;
+        TWIP_IDLE,
+        TWIP_START,
+        TWIP_SEND_ACK,
+        TWIP_WAIT_ACK,
+        TWIP_WAIT_STOP,
+        TWIP_SLA_W,
+        TWIP_SLA_R,
+        TWIP_REP_START,
+        TWIP_READ,
+        TWIP_STOP,
+        TWIP_REC_ACK,
+        TWIP_READ_ACK,
+        TWIP_RWAIT_ACK,
+        TWIP_WRITE,
+        TWIP_BUS_ERR } twip_state
+        = TWIP_IDLE;
     volatile int twip_status = TW_NO_INFO;
     volatile int bitCount = 0;
 
@@ -100,10 +102,11 @@ class Twi
     volatile int twi_timeout_ms = 10;
 
     volatile enum { TWI_READY = 0,
-                    TWI_MRX,
-                    TWI_MTX,
-                    TWI_SRX,
-                    TWI_STX } twi_state = TWI_READY;
+        TWI_MRX,
+        TWI_MTX,
+        TWI_SRX,
+        TWI_STX } twi_state
+        = TWI_READY;
     volatile uint8_t twi_error = 0xFF;
 
     uint8_t twi_txBuffer[TWI_BUFFER_LENGTH];
@@ -167,7 +170,7 @@ class Twi
     // Generate a clock "valley" (at the end of a segment, just before a repeated start)
     void twi_scl_valley(void);
 
-   public:
+public:
     void setClock(unsigned int freq);
     void setClockStretchLimit(uint32_t limit);
     void init(unsigned char sda, unsigned char scl);
@@ -540,105 +543,105 @@ void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
     twip_status = status;
     switch (status)
     {
-        // Slave Receiver
-        case TW_SR_SLA_ACK:             // addressed, returned ack
-        case TW_SR_GCALL_ACK:           // addressed generally, returned ack
-        case TW_SR_ARB_LOST_SLA_ACK:    // lost arbitration, returned ack
-        case TW_SR_ARB_LOST_GCALL_ACK:  // lost arbitration, returned ack
-            // enter slave receiver mode
-            twi_state = TWI_SRX;
-            // indicate that rx buffer can be overwritten and ack
-            twi_rxBufferIndex = 0;
+    // Slave Receiver
+    case TW_SR_SLA_ACK:             // addressed, returned ack
+    case TW_SR_GCALL_ACK:           // addressed generally, returned ack
+    case TW_SR_ARB_LOST_SLA_ACK:    // lost arbitration, returned ack
+    case TW_SR_ARB_LOST_GCALL_ACK:  // lost arbitration, returned ack
+        // enter slave receiver mode
+        twi_state = TWI_SRX;
+        // indicate that rx buffer can be overwritten and ack
+        twi_rxBufferIndex = 0;
+        reply(1);
+        break;
+    case TW_SR_DATA_ACK:        // data received, returned ack
+    case TW_SR_GCALL_DATA_ACK:  // data received generally, returned ack
+        // if there is still room in the rx buffer
+        if (twi_rxBufferIndex < TWI_BUFFER_LENGTH)
+        {
+            // put byte in buffer and ack
+            twi_rxBuffer[twi_rxBufferIndex++] = twi_data;
             reply(1);
-            break;
-        case TW_SR_DATA_ACK:        // data received, returned ack
-        case TW_SR_GCALL_DATA_ACK:  // data received generally, returned ack
-            // if there is still room in the rx buffer
-            if (twi_rxBufferIndex < TWI_BUFFER_LENGTH)
-            {
-                // put byte in buffer and ack
-                twi_rxBuffer[twi_rxBufferIndex++] = twi_data;
-                reply(1);
-            }
-            else
-            {
-                // otherwise nack
-                reply(0);
-            }
-            break;
-        case TW_SR_STOP:  // stop or repeated start condition received
-            // put a null char after data if there's room
-            if (twi_rxBufferIndex < TWI_BUFFER_LENGTH)
-            {
-                twi_rxBuffer[twi_rxBufferIndex] = '\0';
-            }
-            // callback to user-defined callback over event task to allow for non-RAM-residing code
-            //twi_rxBufferLock = true; // This may be necessary
-            ets_post(EVENTTASK_QUEUE_PRIO, TWI_SIG_RX, twi_rxBufferIndex);
-
-            // since we submit rx buffer to "wire" library, we can reset it
-            twi_rxBufferIndex = 0;
-            break;
-
-        case TW_SR_DATA_NACK:        // data received, returned nack
-        case TW_SR_GCALL_DATA_NACK:  // data received generally, returned nack
-            // nack back at master
+        }
+        else
+        {
+            // otherwise nack
             reply(0);
-            break;
-
-        // Slave Transmitter
-        case TW_ST_SLA_ACK:           // addressed, returned ack
-        case TW_ST_ARB_LOST_SLA_ACK:  // arbitration lost, returned ack
-            // enter slave transmitter mode
-            twi_state = TWI_STX;
-            // ready the tx buffer index for iteration
-            twi_txBufferIndex = 0;
-            // set tx buffer length to be zero, to verify if user changes it
-            twi_txBufferLength = 0;
-            // callback to user-defined callback over event task to allow for non-RAM-residing code
-            // request for txBuffer to be filled and length to be set
-            // note: user must call twi_transmit(bytes, length) to do this
-            ets_post(EVENTTASK_QUEUE_PRIO, TWI_SIG_TX, 0);
-            break;
-
-        case TW_ST_DATA_ACK:  // byte sent, ack returned
-            // copy data to output register
-            twi_data = twi_txBuffer[twi_txBufferIndex++];
-
-            bitCount = 8;
-            bitCount--;
-            if (twi_data & 0x80)
-            {
-                SDA_HIGH(twi.twi_sda);
-            }
-            else
-            {
-                SDA_LOW(twi.twi_sda);
-            }
-            twi_data <<= 1;
+        }
+        break;
+    case TW_SR_STOP:  // stop or repeated start condition received
+        // put a null char after data if there's room
+        if (twi_rxBufferIndex < TWI_BUFFER_LENGTH)
+        {
+            twi_rxBuffer[twi_rxBufferIndex] = '\0';
+        }
+        // callback to user-defined callback over event task to allow for non-RAM-residing code
+        //twi_rxBufferLock = true; // This may be necessary
+        ets_post(EVENTTASK_QUEUE_PRIO, TWI_SIG_RX, twi_rxBufferIndex);
+
+        // since we submit rx buffer to "wire" library, we can reset it
+        twi_rxBufferIndex = 0;
+        break;
+
+    case TW_SR_DATA_NACK:        // data received, returned nack
+    case TW_SR_GCALL_DATA_NACK:  // data received generally, returned nack
+        // nack back at master
+        reply(0);
+        break;
+
+    // Slave Transmitter
+    case TW_ST_SLA_ACK:           // addressed, returned ack
+    case TW_ST_ARB_LOST_SLA_ACK:  // arbitration lost, returned ack
+        // enter slave transmitter mode
+        twi_state = TWI_STX;
+        // ready the tx buffer index for iteration
+        twi_txBufferIndex = 0;
+        // set tx buffer length to be zero, to verify if user changes it
+        twi_txBufferLength = 0;
+        // callback to user-defined callback over event task to allow for non-RAM-residing code
+        // request for txBuffer to be filled and length to be set
+        // note: user must call twi_transmit(bytes, length) to do this
+        ets_post(EVENTTASK_QUEUE_PRIO, TWI_SIG_TX, 0);
+        break;
+
+    case TW_ST_DATA_ACK:  // byte sent, ack returned
+        // copy data to output register
+        twi_data = twi_txBuffer[twi_txBufferIndex++];
+
+        bitCount = 8;
+        bitCount--;
+        if (twi_data & 0x80)
+        {
+            SDA_HIGH(twi.twi_sda);
+        }
+        else
+        {
+            SDA_LOW(twi.twi_sda);
+        }
+        twi_data <<= 1;
 
-            // if there is more to send, ack, otherwise nack
-            if (twi_txBufferIndex < twi_txBufferLength)
-            {
-                reply(1);
-            }
-            else
-            {
-                reply(0);
-            }
-            break;
-        case TW_ST_DATA_NACK:  // received nack, we are done
-        case TW_ST_LAST_DATA:  // received ack, but we are done already!
-            // leave slave receiver state
-            releaseBus();
-            break;
-
-        // All
-        case TW_NO_INFO:  // no state information
-            break;
-        case TW_BUS_ERROR:  // bus error, illegal stop/start
-            twi_error = TW_BUS_ERROR;
-            break;
+        // if there is more to send, ack, otherwise nack
+        if (twi_txBufferIndex < twi_txBufferLength)
+        {
+            reply(1);
+        }
+        else
+        {
+            reply(0);
+        }
+        break;
+    case TW_ST_DATA_NACK:  // received nack, we are done
+    case TW_ST_LAST_DATA:  // received ack, but we are done already!
+        // leave slave receiver state
+        releaseBus();
+        break;
+
+    // All
+    case TW_NO_INFO:  // no state information
+        break;
+    case TW_BUS_ERROR:  // bus error, illegal stop/start
+        twi_error = TW_BUS_ERROR;
+        break;
     }
 }
 
@@ -660,26 +663,26 @@ void Twi::eventTask(ETSEvent* e)
 
     switch (e->sig)
     {
-        case TWI_SIG_TX:
-            twi.twi_onSlaveTransmit();
+    case TWI_SIG_TX:
+        twi.twi_onSlaveTransmit();
 
-            // if they didn't change buffer & length, initialize it
-            if (twi.twi_txBufferLength == 0)
-            {
-                twi.twi_txBufferLength = 1;
-                twi.twi_txBuffer[0] = 0x00;
-            }
+        // if they didn't change buffer & length, initialize it
+        if (twi.twi_txBufferLength == 0)
+        {
+            twi.twi_txBufferLength = 1;
+            twi.twi_txBuffer[0] = 0x00;
+        }
 
-            // Initiate transmission
-            twi.onTwipEvent(TW_ST_DATA_ACK);
+        // Initiate transmission
+        twi.onTwipEvent(TW_ST_DATA_ACK);
 
-            break;
+        break;
 
-        case TWI_SIG_RX:
-            // ack future responses and leave slave receiver state
-            twi.releaseBus();
-            twi.twi_onSlaveReceive(twi.twi_rxBuffer, e->par);
-            break;
+    case TWI_SIG_RX:
+        // ack future responses and leave slave receiver state
+        twi.releaseBus();
+        twi.twi_onSlaveReceive(twi.twi_rxBuffer, e->par);
+        break;
     }
 }
 
diff --git a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
index ddc5629741..95c1c4efac 100644
--- a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
+++ b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
@@ -5,7 +5,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
diff --git a/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino b/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
index 7d05074e15..7c72b122e4 100644
--- a/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
+++ b/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
@@ -5,7 +5,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
@@ -14,7 +14,7 @@ const char* host = "OTA-LEDS";
 
 int led_pin = 13;
 #define N_DIMMERS 3
-int dimmer_pin[] = {14, 5, 15};
+int dimmer_pin[] = { 14, 5, 15 };
 
 void setup() {
   Serial.begin(115200);
@@ -67,7 +67,6 @@ void setup() {
   /* setup the OTA server */
   ArduinoOTA.begin();
   Serial.println("Ready");
-
 }
 
 void loop() {
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
index 5f1f5020a1..27bfab06ce 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
@@ -20,14 +20,14 @@
 /* Set these to your desired softAP credentials. They are not configurable at runtime */
 #ifndef APSSID
 #define APSSID "ESP_ap"
-#define APPSK  "12345678"
+#define APPSK "12345678"
 #endif
 
-const char *softAP_ssid = APSSID;
-const char *softAP_password = APPSK;
+const char* softAP_ssid = APSSID;
+const char* softAP_password = APPSK;
 
 /* hostname for mDNS. Should work at least on windows. Try http://esp8266.local */
-const char *myHostname = "esp8266";
+const char* myHostname = "esp8266";
 
 /* Don't set this wifi credentials. They are configurated at runtime and stored on EEPROM */
 char ssid[33] = "";
@@ -44,7 +44,6 @@ ESP8266WebServer server(80);
 IPAddress apIP(172, 217, 28, 1);
 IPAddress netMsk(255, 255, 255, 0);
 
-
 /** Should I connect to WLAN asap? */
 boolean connect;
 
@@ -74,8 +73,8 @@ void setup() {
   server.on("/", handleRoot);
   server.on("/wifi", handleWifi);
   server.on("/wifisave", handleWifiSave);
-  server.on("/generate_204", handleRoot);  //Android captive portal. Maybe not needed. Might be handled by notFound handler.
-  server.on("/fwlink", handleRoot);  //Microsoft captive portal. Maybe not needed. Might be handled by notFound handler.
+  server.on("/generate_204", handleRoot); //Android captive portal. Maybe not needed. Might be handled by notFound handler.
+  server.on("/fwlink", handleRoot); //Microsoft captive portal. Maybe not needed. Might be handled by notFound handler.
   server.onNotFound(handleNotFound);
   server.begin(); // Web server start
   Serial.println("HTTP server started");
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
index dc286c1840..276aad2a2d 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
@@ -9,18 +9,18 @@ void handleRoot() {
 
   String Page;
   Page += F(
-            "<!DOCTYPE html><html lang='en'><head>"
-            "<meta name='viewport' content='width=device-width'>"
-            "<title>CaptivePortal</title></head><body>"
-            "<h1>HELLO WORLD!!</h1>");
+      "<!DOCTYPE html><html lang='en'><head>"
+      "<meta name='viewport' content='width=device-width'>"
+      "<title>CaptivePortal</title></head><body>"
+      "<h1>HELLO WORLD!!</h1>");
   if (server.client().localIP() == apIP) {
     Page += String(F("<p>You are connected through the soft AP: ")) + softAP_ssid + F("</p>");
   } else {
     Page += String(F("<p>You are connected through the wifi network: ")) + ssid + F("</p>");
   }
   Page += F(
-            "<p>You may want to <a href='/wifi'>config the wifi connection</a>.</p>"
-            "</body></html>");
+      "<p>You may want to <a href='/wifi'>config the wifi connection</a>.</p>"
+      "</body></html>");
 
   server.send(200, "text/html", Page);
 }
@@ -30,7 +30,7 @@ boolean captivePortal() {
   if (!isIp(server.hostHeader()) && server.hostHeader() != (String(myHostname) + ".local")) {
     Serial.println("Request redirected to captive portal");
     server.sendHeader("Location", String("http://") + toStringIp(server.client().localIP()), true);
-    server.send(302, "text/plain", "");   // Empty content inhibits Content-length header so we have to close the socket ourselves.
+    server.send(302, "text/plain", ""); // Empty content inhibits Content-length header so we have to close the socket ourselves.
     server.client().stop(); // Stop is needed because we sent no content length
     return true;
   }
@@ -45,37 +45,32 @@ void handleWifi() {
 
   String Page;
   Page += F(
-            "<!DOCTYPE html><html lang='en'><head>"
-            "<meta name='viewport' content='width=device-width'>"
-            "<title>CaptivePortal</title></head><body>"
-            "<h1>Wifi config</h1>");
+      "<!DOCTYPE html><html lang='en'><head>"
+      "<meta name='viewport' content='width=device-width'>"
+      "<title>CaptivePortal</title></head><body>"
+      "<h1>Wifi config</h1>");
   if (server.client().localIP() == apIP) {
     Page += String(F("<p>You are connected through the soft AP: ")) + softAP_ssid + F("</p>");
   } else {
     Page += String(F("<p>You are connected through the wifi network: ")) + ssid + F("</p>");
   }
-  Page +=
-    String(F(
-             "\r\n<br />"
-             "<table><tr><th align='left'>SoftAP config</th></tr>"
-             "<tr><td>SSID ")) +
-    String(softAP_ssid) +
-    F("</td></tr>"
-      "<tr><td>IP ") +
-    toStringIp(WiFi.softAPIP()) +
-    F("</td></tr>"
-      "</table>"
-      "\r\n<br />"
-      "<table><tr><th align='left'>WLAN config</th></tr>"
-      "<tr><td>SSID ") +
-    String(ssid) +
-    F("</td></tr>"
-      "<tr><td>IP ") +
-    toStringIp(WiFi.localIP()) +
-    F("</td></tr>"
-      "</table>"
-      "\r\n<br />"
-      "<table><tr><th align='left'>WLAN list (refresh if any missing)</th></tr>");
+  Page += String(F(
+              "\r\n<br />"
+              "<table><tr><th align='left'>SoftAP config</th></tr>"
+              "<tr><td>SSID "))
+      + String(softAP_ssid) + F("</td></tr>"
+                                "<tr><td>IP ")
+      + toStringIp(WiFi.softAPIP()) + F("</td></tr>"
+                                        "</table>"
+                                        "\r\n<br />"
+                                        "<table><tr><th align='left'>WLAN config</th></tr>"
+                                        "<tr><td>SSID ")
+      + String(ssid) + F("</td></tr>"
+                         "<tr><td>IP ")
+      + toStringIp(WiFi.localIP()) + F("</td></tr>"
+                                       "</table>"
+                                       "\r\n<br />"
+                                       "<table><tr><th align='left'>WLAN list (refresh if any missing)</th></tr>");
   Serial.println("scan start");
   int n = WiFi.scanNetworks();
   Serial.println("scan done");
@@ -87,13 +82,13 @@ void handleWifi() {
     Page += F("<tr><td>No WLAN found</td></tr>");
   }
   Page += F(
-            "</table>"
-            "\r\n<br /><form method='POST' action='wifisave'><h4>Connect to network:</h4>"
-            "<input type='text' placeholder='network' name='n'/>"
-            "<br /><input type='password' placeholder='password' name='p'/>"
-            "<br /><input type='submit' value='Connect/Disconnect'/></form>"
-            "<p>You may want to <a href='/'>return to the home page</a>.</p>"
-            "</body></html>");
+      "</table>"
+      "\r\n<br /><form method='POST' action='wifisave'><h4>Connect to network:</h4>"
+      "<input type='text' placeholder='network' name='n'/>"
+      "<br /><input type='password' placeholder='password' name='p'/>"
+      "<br /><input type='submit' value='Connect/Disconnect'/></form>"
+      "<p>You may want to <a href='/'>return to the home page</a>.</p>"
+      "</body></html>");
   server.send(200, "text/html", Page);
   server.client().stop(); // Stop is needed because we sent no content length
 }
@@ -107,7 +102,7 @@ void handleWifiSave() {
   server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
   server.sendHeader("Pragma", "no-cache");
   server.sendHeader("Expires", "-1");
-  server.send(302, "text/plain", "");    // Empty content inhibits Content-length header so we have to close the socket ourselves.
+  server.send(302, "text/plain", ""); // Empty content inhibits Content-length header so we have to close the socket ourselves.
   server.client().stop(); // Stop is needed because we sent no content length
   saveCredentials();
   connect = strlen(ssid) > 0; // Request WLAN connect with new credentials if there is a SSID
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/tools.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/tools.ino
index e4840a1c12..6ed7b05b7d 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/tools.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/tools.ino
@@ -18,4 +18,3 @@ String toStringIp(IPAddress ip) {
   res += String(((ip >> 8 * 3)) & 0xFF);
   return res;
 }
-
diff --git a/libraries/ESP8266AVRISP/examples/Arduino_Wifi_AVRISP/Arduino_Wifi_AVRISP.ino b/libraries/ESP8266AVRISP/examples/Arduino_Wifi_AVRISP/Arduino_Wifi_AVRISP.ino
index fdc34cff2b..01b7388bb2 100644
--- a/libraries/ESP8266AVRISP/examples/Arduino_Wifi_AVRISP/Arduino_Wifi_AVRISP.ino
+++ b/libraries/ESP8266AVRISP/examples/Arduino_Wifi_AVRISP/Arduino_Wifi_AVRISP.ino
@@ -5,7 +5,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* host = "esp8266-avrisp";
@@ -52,20 +52,20 @@ void loop() {
   if (last_state != new_state) {
     switch (new_state) {
       case AVRISP_STATE_IDLE: {
-          Serial.printf("[AVRISP] now idle\r\n");
-          // Use the SPI bus for other purposes
-          break;
-        }
+        Serial.printf("[AVRISP] now idle\r\n");
+        // Use the SPI bus for other purposes
+        break;
+      }
       case AVRISP_STATE_PENDING: {
-          Serial.printf("[AVRISP] connection pending\r\n");
-          // Clean up your other purposes and prepare for programming mode
-          break;
-        }
+        Serial.printf("[AVRISP] connection pending\r\n");
+        // Clean up your other purposes and prepare for programming mode
+        break;
+      }
       case AVRISP_STATE_ACTIVE: {
-          Serial.printf("[AVRISP] programming mode\r\n");
-          // Stand by for completion
-          break;
-        }
+        Serial.printf("[AVRISP] programming mode\r\n");
+        // Stand by for completion
+        break;
+      }
     }
     last_state = new_state;
   }
diff --git a/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino b/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino
index 9de3077ff4..878cab95b5 100644
--- a/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino
+++ b/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino
@@ -33,7 +33,6 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP("SSID", "PASSWORD");
-
 }
 
 void loop() {
@@ -47,7 +46,6 @@ void loop() {
     Serial.print("[HTTP] begin...\n");
     // configure traged server and url
 
-
     http.begin(client, "http://guest:guest@jigsaw.w3.org/HTTP/Basic/");
 
     /*
@@ -60,7 +58,6 @@ void loop() {
       http.setAuthorization("Z3Vlc3Q6Z3Vlc3Q=");
     */
 
-
     Serial.print("[HTTP] GET...\n");
     // start connection and send HTTP header
     int httpCode = http.GET();
diff --git a/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino b/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
index 21a97172ef..18f225b797 100644
--- a/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
@@ -33,7 +33,6 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP("SSID", "PASSWORD");
-
 }
 
 void loop() {
@@ -45,8 +44,7 @@ void loop() {
     HTTPClient http;
 
     Serial.print("[HTTP] begin...\n");
-    if (http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html")) {  // HTTP
-
+    if (http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html")) { // HTTP
 
       Serial.print("[HTTP] GET...\n");
       // start connection and send HTTP header
diff --git a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
index aaa4af2b4d..efb653fc76 100644
--- a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
@@ -14,7 +14,7 @@
 
 #include <WiFiClientSecureBearSSL.h>
 // Fingerprint for demo URL, expires on June 2, 2021, needs to be updated well before this date
-const uint8_t fingerprint[20] = {0x40, 0xaf, 0x00, 0x6b, 0xec, 0x90, 0x22, 0x41, 0x8e, 0xa3, 0xad, 0xfa, 0x1a, 0xe8, 0x25, 0x41, 0x1d, 0x1a, 0x54, 0xb3};
+const uint8_t fingerprint[20] = { 0x40, 0xaf, 0x00, 0x6b, 0xec, 0x90, 0x22, 0x41, 0x8e, 0xa3, 0xad, 0xfa, 0x1a, 0xe8, 0x25, 0x41, 0x1d, 0x1a, 0x54, 0xb3 };
 
 ESP8266WiFiMulti WiFiMulti;
 
@@ -41,7 +41,7 @@ void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
 
-    std::unique_ptr<BearSSL::WiFiClientSecure>client(new BearSSL::WiFiClientSecure);
+    std::unique_ptr<BearSSL::WiFiClientSecure> client(new BearSSL::WiFiClientSecure);
 
     client->setFingerprint(fingerprint);
     // Or, if you happy to ignore the SSL certificate, then use the following line instead:
@@ -50,7 +50,7 @@ void loop() {
     HTTPClient https;
 
     Serial.print("[HTTPS] begin...\n");
-    if (https.begin(*client, "https://jigsaw.w3.org/HTTP/connection.html")) {  // HTTPS
+    if (https.begin(*client, "https://jigsaw.w3.org/HTTP/connection.html")) { // HTTPS
 
       Serial.print("[HTTPS] GET...\n");
       // start connection and send HTTP header
diff --git a/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino b/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
index db8fe8cbd4..a538fd4799 100644
--- a/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
+++ b/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
@@ -13,17 +13,17 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
 const char* ssidPassword = STAPSK;
 
-const char *username = "admin";
-const char *password = "admin";
+const char* username = "admin";
+const char* password = "admin";
 
-const char *server = "http://httpbin.org";
-const char *uri = "/digest-auth/auth/admin/admin/MD5";
+const char* server = "http://httpbin.org";
+const char* uri = "/digest-auth/auth/admin/admin/MD5";
 
 String exractParam(String& authReq, const String& param, const char delimit) {
   int _begin = authReq.indexOf(param);
@@ -34,10 +34,9 @@ String exractParam(String& authReq, const String& param, const char delimit) {
 }
 
 String getCNonce(const int len) {
-  static const char alphanum[] =
-    "0123456789"
-    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-    "abcdefghijklmnopqrstuvwxyz";
+  static const char alphanum[] = "0123456789"
+                                 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                                 "abcdefghijklmnopqrstuvwxyz";
   String s = "";
 
   for (int i = 0; i < len; ++i) {
@@ -59,7 +58,7 @@ String getDigestAuth(String& authReq, const String& username, const String& pass
   // parameters for the RFC 2617 newer Digest
   MD5Builder md5;
   md5.begin();
-  md5.add(username + ":" + realm + ":" + password);  // md5 of the user:realm:user
+  md5.add(username + ":" + realm + ":" + password); // md5 of the user:realm:user
   md5.calculate();
   String h1 = md5.toString();
 
@@ -73,8 +72,7 @@ String getDigestAuth(String& authReq, const String& username, const String& pass
   md5.calculate();
   String response = md5.toString();
 
-  String authorization = "Digest username=\"" + username + "\", realm=\"" + realm + "\", nonce=\"" + nonce +
-                         "\", uri=\"" + uri + "\", algorithm=\"MD5\", qop=auth, nc=" + String(nc) + ", cnonce=\"" + cNonce + "\", response=\"" + response + "\"";
+  String authorization = "Digest username=\"" + username + "\", realm=\"" + realm + "\", nonce=\"" + nonce + "\", uri=\"" + uri + "\", algorithm=\"MD5\", qop=auth, nc=" + String(nc) + ", cnonce=\"" + cNonce + "\", response=\"" + response + "\"";
   Serial.println(authorization);
 
   return authorization;
@@ -107,8 +105,7 @@ void loop() {
   // configure traged server and url
   http.begin(client, String(server) + String(uri));
 
-
-  const char *keys[] = {"WWW-Authenticate"};
+  const char* keys[] = { "WWW-Authenticate" };
   http.collectHeaders(keys, 1);
 
   Serial.print("[HTTP] GET...\n");
diff --git a/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino b/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
index 936e235eeb..01f7c34eff 100644
--- a/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
@@ -20,7 +20,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 void setup() {
@@ -40,7 +40,6 @@ void setup() {
   Serial.println("");
   Serial.print("Connected! IP address: ");
   Serial.println(WiFi.localIP());
-
 }
 
 void loop() {
diff --git a/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino b/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
index 42a89beced..4cfc3911bf 100644
--- a/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
+++ b/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
@@ -6,14 +6,13 @@
    This example reuses the http connection and also restores the connection if the connection is lost
 */
 
-
 #include <ESP8266WiFi.h>
 #include <ESP8266WiFiMulti.h>
 #include <ESP8266HTTPClient.h>
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 ESP8266WiFiMulti WiFiMulti;
@@ -43,7 +42,6 @@ void setup() {
   // allow reuse (if server supports it)
   http.setReuse(true);
 
-
   http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html");
   //http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
 }
diff --git a/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino b/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
index 7e1593f52b..7a813c7e10 100644
--- a/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
@@ -31,7 +31,6 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP("SSID", "PASSWORD");
-
 }
 
 void loop() {
@@ -70,7 +69,7 @@ void loop() {
         // or "by hand"
 
         // get tcp stream
-        WiFiClient * stream = &client;
+        WiFiClient* stream = &client;
 
         // read all data from server
         while (http.connected() && (len > 0 || len == -1)) {
diff --git a/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
index 8098986650..9ba575bd78 100644
--- a/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
@@ -31,7 +31,6 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP("SSID", "PASSWORD");
-
 }
 
 void loop() {
@@ -50,7 +49,7 @@ void loop() {
     Serial.print("[HTTPS] begin...\n");
 
     // configure server and url
-    const uint8_t fingerprint[20] = {0x15, 0x77, 0xdc, 0x04, 0x7c, 0x00, 0xf8, 0x70, 0x09, 0x34, 0x24, 0xf4, 0xd3, 0xa1, 0x7a, 0x6c, 0x1e, 0xa3, 0xe0, 0x2a};
+    const uint8_t fingerprint[20] = { 0x15, 0x77, 0xdc, 0x04, 0x7c, 0x00, 0xf8, 0x70, 0x09, 0x34, 0x24, 0xf4, 0xd3, 0xa1, 0x7a, 0x6c, 0x1e, 0xa3, 0xe0, 0x2a };
 
     client->setFingerprint(fingerprint);
 
@@ -95,7 +94,6 @@ void loop() {
 
           Serial.println();
           Serial.print("[HTTPS] connection closed or file end.\n");
-
         }
       } else {
         Serial.printf("[HTTPS] GET... failed, error: %s\n", https.errorToString(httpCode).c_str());
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino
index a2514e171d..d849181a6c 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino
@@ -21,7 +21,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* host = "esp8266-webupdate";
@@ -57,7 +57,7 @@ JfUvYadSYxh3nblvA4OL+iEZiW8NE3hbW6WPXxvS7Euge0uWMPc4uEcnsE0ZVG3m
 -----END CERTIFICATE-----
 )EOF";
 
-static const char serverKey[] PROGMEM =  R"EOF(
+static const char serverKey[] PROGMEM = R"EOF(
 -----BEGIN RSA PRIVATE KEY-----
 MIIEpQIBAAKCAQEA9UoHBtn4oNKXjRgIOQ/rLxK/iI0a8Q5mDxhfuwa9//FkftSI
 IFY8UhGk2YNJpnfKOyYWqbqwuJhIZJ2sEIWp2301OnavuGBrpKOgBJJljgH2l/4Z
@@ -87,9 +87,7 @@ gz5JWYhbD6c38khSzJb0pNXCo3EuYAVa36kDM96k1BtWuhRS10Q1VXk=
 -----END RSA PRIVATE KEY-----
 )EOF";
 
-
-void setup()
-{
+void setup() {
 
   Serial.begin(115200);
   Serial.println();
@@ -97,7 +95,7 @@ void setup()
   WiFi.mode(WIFI_AP_STA);
   WiFi.begin(ssid, password);
 
-  while(WiFi.waitForConnectResult() != WL_CONNECTED){
+  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
     WiFi.begin(ssid, password);
     Serial.println("WiFi failed, retrying.");
   }
@@ -111,13 +109,13 @@ void setup()
   httpServer.begin();
 
   MDNS.addService("https", "tcp", 443);
-  Serial.printf("BearSSLUpdateServer ready!\nOpen https://%s.local%s in "\
-                "your browser and login with username '%s' and password "\
-                "'%s'\n", host, update_path, update_username, update_password);
+  Serial.printf("BearSSLUpdateServer ready!\nOpen https://%s.local%s in "
+                "your browser and login with username '%s' and password "
+                "'%s'\n",
+      host, update_path, update_username, update_password);
 }
 
-void loop()
-{
+void loop() {
   httpServer.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
index 11e23a929d..d37ef3f1f6 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
@@ -10,7 +10,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* host = "esp8266-webupdate";
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
index fea3c4023a..89b5f62a90 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
@@ -10,7 +10,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* host = "esp8266-webupdate";
diff --git a/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino b/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
index 6b29bb5141..f36da85aeb 100644
--- a/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
+++ b/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
@@ -62,7 +62,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
diff --git a/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino b/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
old mode 100755
new mode 100644
index 57f5529850..4d7998667b
--- a/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
+++ b/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
@@ -4,7 +4,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
@@ -40,7 +40,6 @@ void setup() {
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-
   wwwserver.on("/", handleRoot);
   wwwserver.begin();
 
diff --git a/libraries/ESP8266SSDP/examples/SSDP/SSDP.ino b/libraries/ESP8266SSDP/examples/SSDP/SSDP.ino
index 28b0ca977b..c081869696 100644
--- a/libraries/ESP8266SSDP/examples/SSDP/SSDP.ino
+++ b/libraries/ESP8266SSDP/examples/SSDP/SSDP.ino
@@ -4,7 +4,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
diff --git a/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino b/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
index 2fc8508ca0..c20d1ddb15 100644
--- a/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
+++ b/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
@@ -35,11 +35,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *password = STAPSK;
+const char* ssid = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer server(80);
 
@@ -54,7 +54,7 @@ void handleRoot() {
 
   snprintf(temp, 400,
 
-           "<html>\
+      "<html>\
   <head>\
     <meta http-equiv='refresh' content='5'/>\
     <title>ESP8266 Demo</title>\
@@ -69,8 +69,7 @@ void handleRoot() {
   </body>\
 </html>",
 
-           hr, min % 60, sec % 60
-          );
+      hr, min % 60, sec % 60);
   server.send(200, "text/html", temp);
   digitalWrite(led, 0);
 }
@@ -151,4 +150,3 @@ void loop(void) {
   server.handleClient();
   MDNS.update();
 }
-
diff --git a/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino b/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
index 39f69fe3ff..686f4327ed 100644
--- a/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
+++ b/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
@@ -67,12 +67,11 @@ SDFSConfig fileSystemConfig = SDFSConfig();
 #error Please select a filesystem first by uncommenting one of the "#define USE_xxx" lines at the beginning of the sketch.
 #endif
 
-
 #define DBG_OUTPUT_PORT Serial
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
@@ -135,7 +134,6 @@ String checkForUnsupportedPath(String filename) {
 }
 #endif
 
-
 ////////////////////////////////
 // Request handlers
 
@@ -168,7 +166,6 @@ void handleStatus() {
   server.send(200, "application/json", json);
 }
 
-
 /*
    Return the list of files in the directory specified by the "dir" query string parameter.
    Also demonstrates the use of chunked responses.
@@ -242,7 +239,6 @@ void handleFileList() {
   server.chunkedResponseFinalize();
 }
 
-
 /*
    Read the given file from the filesystem and stream it back to the client
 */
@@ -280,7 +276,6 @@ bool handleFileRead(String path) {
   return false;
 }
 
-
 /*
    As some FS (e.g. LittleFS) delete the parent folder when the last child has been removed,
    return the path of the closest parent still existing
@@ -290,7 +285,7 @@ String lastExistingParent(String path) {
     if (path.lastIndexOf('/') > 0) {
       path = path.substring(0, path.lastIndexOf('/'));
     } else {
-      path = String();  // No slash => the top folder does not exist
+      path = String(); // No slash => the top folder does not exist
     }
   }
   DBG_OUTPUT_PORT.println(String("Last existing parent: ") + path);
@@ -345,7 +340,7 @@ void handleFileCreate() {
       // Create a file
       File file = fileSystem->open(path, "w");
       if (file) {
-        file.write((const char *)0);
+        file.write((const char*)0);
         file.close();
       } else {
         return replyServerError(F("CREATE FAILED"));
@@ -379,7 +374,6 @@ void handleFileCreate() {
   }
 }
 
-
 /*
    Delete the file or folder designed by the given path.
    If it's a file, delete it.
@@ -411,7 +405,6 @@ void deleteRecursive(String path) {
   fileSystem->rmdir(path);
 }
 
-
 /*
    Handle a file deletion request
    Operation      | req.responseText
@@ -477,7 +470,6 @@ void handleFileUpload() {
   }
 }
 
-
 /*
    The "Not Found" handler catches all URI not explicitly declared in code
    First try to find and return the requested file from the filesystem,
@@ -536,7 +528,6 @@ void handleGetEdit() {
 #else
   replyNotFound(FPSTR(FILE_NOT_FOUND));
 #endif
-
 }
 
 void setup(void) {
@@ -609,15 +600,15 @@ void setup(void) {
   server.on("/edit", HTTP_GET, handleGetEdit);
 
   // Create file
-  server.on("/edit",  HTTP_PUT, handleFileCreate);
+  server.on("/edit", HTTP_PUT, handleFileCreate);
 
   // Delete file
-  server.on("/edit",  HTTP_DELETE, handleFileDelete);
+  server.on("/edit", HTTP_DELETE, handleFileDelete);
 
   // Upload file
   // - first callback is called after the request has ended with all parsed arguments
   // - second callback handles file upload at that location
-  server.on("/edit",  HTTP_POST, replyOK, handleFileUpload);
+  server.on("/edit", HTTP_POST, replyOK, handleFileUpload);
 
   // Default handler for all URIs not defined above
   // Use it to read files from filesystem
@@ -628,7 +619,6 @@ void setup(void) {
   DBG_OUTPUT_PORT.println("HTTP server started");
 }
 
-
 void loop(void) {
   server.handleClient();
   MDNS.update();
diff --git a/libraries/ESP8266WebServer/examples/Graph/Graph.ino b/libraries/ESP8266WebServer/examples/Graph/Graph.ino
index b0eb5f847b..d4915f201f 100644
--- a/libraries/ESP8266WebServer/examples/Graph/Graph.ino
+++ b/libraries/ESP8266WebServer/examples/Graph/Graph.ino
@@ -53,12 +53,11 @@ SDFSConfig fileSystemConfig = SDFSConfig();
 #error Please select a filesystem first by uncommenting one of the "#define USE_xxx" lines at the beginning of the sketch.
 #endif
 
-
 #define DBG_OUTPUT_PORT Serial
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 // Indicate which digital I/Os should be displayed on the chart.
@@ -132,7 +131,6 @@ bool handleFileRead(String path) {
   return false;
 }
 
-
 /*
    The "Not Found" handler catches all URI not explicitly declared in code
    First try to find and return the requested file from the filesystem,
@@ -240,7 +238,6 @@ void setup(void) {
   // Use it to read files from filesystem
   server.onNotFound(handleNotFound);
 
-
   // Start server
   server.begin();
   DBG_OUTPUT_PORT.println("HTTP server started");
@@ -249,7 +246,6 @@ void setup(void) {
   DBG_OUTPUT_PORT.println(" 0 (OFF):    outputs are off and hidden from chart");
   DBG_OUTPUT_PORT.println(" 1 (AUTO):   outputs are rotated automatically every second");
   DBG_OUTPUT_PORT.println(" 2 (MANUAL): outputs can be toggled from the web page");
-
 }
 
 // Return default GPIO mask, that is all I/Os except SD card ones
@@ -329,4 +325,3 @@ void loop(void) {
       break;
   }
 }
-
diff --git a/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino b/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
index 7fdee1667a..68096d29ad 100644
--- a/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
+++ b/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
@@ -5,7 +5,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
@@ -89,17 +89,17 @@ void setup(void) {
   /////////////////////////////////////////////////////////
   // Hook examples
 
-  server.addHook([](const String & method, const String & url, WiFiClient * client, ESP8266WebServer::ContentTypeFunction contentType) {
-    (void)method;      // GET, PUT, ...
-    (void)url;         // example: /root/myfile.html
-    (void)client;      // the webserver tcp client connection
+  server.addHook([](const String& method, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction contentType) {
+    (void)method; // GET, PUT, ...
+    (void)url; // example: /root/myfile.html
+    (void)client; // the webserver tcp client connection
     (void)contentType; // contentType(".html") => "text/html"
     Serial.printf("A useless web hook has passed\n");
     Serial.printf("(this hook is in 0x%08x area (401x=IRAM 402x=FLASH))\n", esp_get_program_counter());
     return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
   });
 
-  server.addHook([](const String&, const String & url, WiFiClient*, ESP8266WebServer::ContentTypeFunction) {
+  server.addHook([](const String&, const String& url, WiFiClient*, ESP8266WebServer::ContentTypeFunction) {
     if (url.startsWith("/fail")) {
       Serial.printf("An always failing web hook has been triggered\n");
       return ESP8266WebServer::CLIENT_MUST_STOP;
@@ -107,7 +107,7 @@ void setup(void) {
     return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
   });
 
-  server.addHook([](const String&, const String & url, WiFiClient * client, ESP8266WebServer::ContentTypeFunction) {
+  server.addHook([](const String&, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction) {
     if (url.startsWith("/dump")) {
       Serial.printf("The dumper web hook is on the run\n");
 
diff --git a/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino b/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino
index 185914f305..18d397249b 100644
--- a/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino
+++ b/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino
@@ -18,7 +18,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
@@ -50,7 +50,7 @@ JfUvYadSYxh3nblvA4OL+iEZiW8NE3hbW6WPXxvS7Euge0uWMPc4uEcnsE0ZVG3m
 -----END CERTIFICATE-----
 )EOF";
 
-static const char serverKey[] PROGMEM =  R"EOF(
+static const char serverKey[] PROGMEM = R"EOF(
 -----BEGIN RSA PRIVATE KEY-----
 MIIEpQIBAAKCAQEA9UoHBtn4oNKXjRgIOQ/rLxK/iI0a8Q5mDxhfuwa9//FkftSI
 IFY8UhGk2YNJpnfKOyYWqbqwuJhIZJ2sEIWp2301OnavuGBrpKOgBJJljgH2l/4Z
@@ -80,7 +80,6 @@ gz5JWYhbD6c38khSzJb0pNXCo3EuYAVa36kDM96k1BtWuhRS10Q1VXk=
 -----END RSA PRIVATE KEY-----
 )EOF";
 
-
 const int led = 13;
 
 void handleRoot() {
@@ -89,24 +88,24 @@ void handleRoot() {
   digitalWrite(led, 0);
 }
 
-void handleNotFound(){
+void handleNotFound() {
   digitalWrite(led, 1);
   String message = "File Not Found\n\n";
   message += "URI: ";
   message += server.uri();
   message += "\nMethod: ";
-  message += (server.method() == HTTP_GET)?"GET":"POST";
+  message += (server.method() == HTTP_GET) ? "GET" : "POST";
   message += "\nArguments: ";
   message += server.args();
   message += "\n";
-  for (uint8_t i=0; i<server.args(); i++){
+  for (uint8_t i = 0; i < server.args(); i++) {
     message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
   }
   server.send(404, "text/plain", message);
   digitalWrite(led, 0);
 }
 
-void setup(void){
+void setup(void) {
   pinMode(led, OUTPUT);
   digitalWrite(led, 0);
   Serial.begin(115200);
@@ -138,7 +137,7 @@ void setup(void){
 
   server.on("/", handleRoot);
 
-  server.on("/inline", [](){
+  server.on("/inline", []() {
     server.send(200, "text/plain", "this works as well");
   });
 
@@ -153,26 +152,26 @@ extern "C" void stack_thunk_dump_stack();
 void processKey(Print& out, int hotKey) {
   switch (hotKey) {
     case 'd': {
-        HeapSelectDram ephemeral;
-        umm_info(NULL, true);
-        break;
-      }
+      HeapSelectDram ephemeral;
+      umm_info(NULL, true);
+      break;
+    }
     case 'i': {
+      HeapSelectIram ephemeral;
+      umm_info(NULL, true);
+      break;
+    }
+    case 'h': {
+      {
         HeapSelectIram ephemeral;
-        umm_info(NULL, true);
-        break;
+        Serial.printf(PSTR("IRAM ESP.getFreeHeap:  %u\n"), ESP.getFreeHeap());
       }
-    case 'h': {
-        {
-          HeapSelectIram ephemeral;
-          Serial.printf(PSTR("IRAM ESP.getFreeHeap:  %u\n"), ESP.getFreeHeap());
-        }
-        {
-          HeapSelectDram ephemeral;
-          Serial.printf(PSTR("DRAM ESP.getFreeHeap:  %u\n"), ESP.getFreeHeap());
-        }
-        break;
+      {
+        HeapSelectDram ephemeral;
+        Serial.printf(PSTR("DRAM ESP.getFreeHeap:  %u\n"), ESP.getFreeHeap());
       }
+      break;
+    }
 #ifdef DEBUG_ESP_PORT
     // From this context stack_thunk_dump_stack() will only work when Serial
     // debug is enabled.
@@ -210,8 +209,7 @@ void processKey(Print& out, int hotKey) {
   }
 }
 
-
-void loop(void){
+void loop(void) {
   server.handleClient();
   MDNS.update();
   if (Serial.available() > 0) {
diff --git a/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino b/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
index 857048cf0b..a3a01d4ced 100644
--- a/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
@@ -11,7 +11,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
@@ -39,13 +39,13 @@ void setup() {
 
   server.on("/", []() {
     if (!server.authenticate(www_username, www_password))
-      //Basic Auth Method with Custom realm and Failure Response
-      //return server.requestAuthentication(BASIC_AUTH, www_realm, authFailResponse);
-      //Digest Auth Method with realm="Login Required" and empty Failure Response
-      //return server.requestAuthentication(DIGEST_AUTH);
-      //Digest Auth Method with Custom realm and empty Failure Response
-      //return server.requestAuthentication(DIGEST_AUTH, www_realm);
-      //Digest Auth Method with Custom realm and Failure Response
+    //Basic Auth Method with Custom realm and Failure Response
+    //return server.requestAuthentication(BASIC_AUTH, www_realm, authFailResponse);
+    //Digest Auth Method with realm="Login Required" and empty Failure Response
+    //return server.requestAuthentication(DIGEST_AUTH);
+    //Digest Auth Method with Custom realm and empty Failure Response
+    //return server.requestAuthentication(DIGEST_AUTH, www_realm);
+    //Digest Auth Method with Custom realm and Failure Response
     {
       return server.requestAuthentication(DIGEST_AUTH, www_realm, authFailResponse);
     }
diff --git a/libraries/ESP8266WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino b/libraries/ESP8266WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino
index 7c06637caf..b7d5c16f41 100644
--- a/libraries/ESP8266WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino
@@ -5,7 +5,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
diff --git a/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino b/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
index c2ceaca53d..2a9657e2fc 100644
--- a/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
@@ -18,14 +18,14 @@
 //Unfortunately it is not possible to have persistent WiFi credentials stored as anything but plain text. Obfuscation would be the only feasible barrier.
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
 const char* wifi_pw = STAPSK;
 
 const String file_credentials = R"(/credentials.txt)"; // LittleFS file name for the saved credentials
-const String change_creds =  "changecreds";            // Address for a credential change
+const String change_creds = "changecreds"; // Address for a credential change
 
 //The ESP8266WebServerSecure requires an encryption certificate and matching key.
 //These can generated with the bash script available in the ESP8266 Arduino repository.
@@ -52,7 +52,7 @@ JfUvYadSYxh3nblvA4OL+iEZiW8NE3hbW6WPXxvS7Euge0uWMPc4uEcnsE0ZVG3m
 5tAF1D5vAAwA8nfPysumlLsIjohJZo4lgnhB++AlOg==
 -----END CERTIFICATE-----
 )EOF";
-static const char serverKey[] PROGMEM =  R"EOF(
+static const char serverKey[] PROGMEM = R"EOF(
 -----BEGIN RSA PRIVATE KEY-----
 MIIEpQIBAAKCAQEA9UoHBtn4oNKXjRgIOQ/rLxK/iI0a8Q5mDxhfuwa9//FkftSI
 IFY8UhGk2YNJpnfKOyYWqbqwuJhIZJ2sEIWp2301OnavuGBrpKOgBJJljgH2l/4Z
@@ -94,10 +94,10 @@ void setup() {
   Serial.begin(115200);
 
   //Initialize LittleFS to save credentials
-  if(!LittleFS.begin()){
-		Serial.println("LittleFS initialization error, programmer flash configured?");
+  if (!LittleFS.begin()) {
+    Serial.println("LittleFS initialization error, programmer flash configured?");
     ESP.restart();
-	}
+  }
 
   //Attempt to load credentials. If the file does not yet exist, they will be set to the default values above
   loadcredentials();
@@ -112,8 +112,8 @@ void setup() {
   }
 
   server.getServer().setRSACert(new BearSSL::X509List(serverCert), new BearSSL::PrivateKey(serverKey));
-  server.on("/",showcredentialpage); //for this simple example, just show a simple page for changing credentials at the root
-  server.on("/" + change_creds,handlecredentialchange); //handles submission of credentials from the client
+  server.on("/", showcredentialpage); //for this simple example, just show a simple page for changing credentials at the root
+  server.on("/" + change_creds, handlecredentialchange); //handles submission of credentials from the client
   server.onNotFound(redirect);
   server.begin();
 
@@ -128,12 +128,12 @@ void loop() {
 }
 
 //This function redirects home
-void redirect(){
+void redirect() {
   String url = "https://" + WiFi.localIP().toString();
   Serial.println("Redirect called. Redirecting to " + url);
   server.sendHeader("Location", url, true);
   Serial.println("Header sent.");
-  server.send( 302, "text/plain", ""); // Empty content inhibits Content-length header so we have to close the socket ourselves.
+  server.send(302, "text/plain", ""); // Empty content inhibits Content-length header so we have to close the socket ourselves.
   Serial.println("Empty page sent.");
   server.client().stop(); // Stop is needed because we sent no content length
   Serial.println("Client stopped.");
@@ -142,21 +142,21 @@ void redirect(){
 //This function checks whether the current session has been authenticated. If not, a request for credentials is sent.
 bool session_authenticated() {
   Serial.println("Checking authentication.");
-  if (server.authenticateDigest(login,H1)) {
+  if (server.authenticateDigest(login, H1)) {
     Serial.println("Authentication confirmed.");
     return true;
-  } else  {
+  } else {
     Serial.println("Not authenticated. Requesting credentials.");
-    server.requestAuthentication(DIGEST_AUTH,realm.c_str(),authentication_failed);
+    server.requestAuthentication(DIGEST_AUTH, realm.c_str(), authentication_failed);
     redirect();
     return false;
   }
 }
 
 //This function sends a simple webpage for changing login credentials to the client
-void showcredentialpage(){
+void showcredentialpage() {
   Serial.println("Show credential page called.");
-  if(!session_authenticated()){
+  if (!session_authenticated()) {
     return;
   }
 
@@ -165,11 +165,12 @@ void showcredentialpage(){
   String page;
   page = R"(<html>)";
 
-  page+=
-  R"(
+  page +=
+      R"(
   <h2>Login Credentials</h2><br>
 
-  <form action=")" + change_creds + R"(" method="post">
+  <form action=")"
+      + change_creds + R"(" method="post">
   Login:<br>
   <input type="text" name="login"><br>
   Password:<br>
@@ -178,8 +179,7 @@ void showcredentialpage(){
   <input type="password" name="password_duplicate"><br>
   <p><button type="submit" name="newcredentials">Change Credentials</button></p>
   </form><br>
-  )"
-  ;
+  )";
 
   page += R"(</html>)";
 
@@ -189,16 +189,15 @@ void showcredentialpage(){
 }
 
 //Saves credentials to LittleFS
-void savecredentials(String new_login, String new_password)
-{
+void savecredentials(String new_login, String new_password) {
   //Set global variables to new values
-  login=new_login;
-  H1=ESP8266WebServer::credentialHash(new_login,realm,new_password);
+  login = new_login;
+  H1 = ESP8266WebServer::credentialHash(new_login, realm, new_password);
 
   //Save new values to LittleFS for loading on next reboot
   Serial.println("Saving credentials.");
-  File f=LittleFS.open(file_credentials,"w"); //open as a brand new file, discard old contents
-  if(f){
+  File f = LittleFS.open(file_credentials, "w"); //open as a brand new file, discard old contents
+  if (f) {
     Serial.println("Modifying credentials in file system.");
     f.println(login);
     f.println(H1);
@@ -210,18 +209,17 @@ void savecredentials(String new_login, String new_password)
 }
 
 //loads credentials from LittleFS
-void loadcredentials()
-{
+void loadcredentials() {
   Serial.println("Searching for credentials.");
   File f;
-  f=LittleFS.open(file_credentials,"r");
-  if(f){
+  f = LittleFS.open(file_credentials, "r");
+  if (f) {
     Serial.println("Loading credentials from file system.");
-    String mod=f.readString(); //read the file to a String
-    int index_1=mod.indexOf('\n',0); //locate the first line break
-    int index_2=mod.indexOf('\n',index_1+1); //locate the second line break
-    login=mod.substring(0,index_1-1); //get the first line (excluding the line break)
-    H1=mod.substring(index_1+1,index_2-1); //get the second line (excluding the line break)
+    String mod = f.readString(); //read the file to a String
+    int index_1 = mod.indexOf('\n', 0); //locate the first line break
+    int index_2 = mod.indexOf('\n', index_1 + 1); //locate the second line break
+    login = mod.substring(0, index_1 - 1); //get the first line (excluding the line break)
+    H1 = mod.substring(index_1 + 1, index_2 - 1); //get the second line (excluding the line break)
     f.close();
   } else {
     String default_login = "admin";
@@ -229,15 +227,15 @@ void loadcredentials()
     Serial.println("None found. Setting to default credentials.");
     Serial.println("user:" + default_login);
     Serial.println("password:" + default_password);
-    login=default_login;
-    H1=ESP8266WebServer::credentialHash(default_login,realm,default_password);
+    login = default_login;
+    H1 = ESP8266WebServer::credentialHash(default_login, realm, default_password);
   }
 }
 
 //This function handles a credential change from a client.
 void handlecredentialchange() {
   Serial.println("Handle credential change called.");
-  if(!session_authenticated()){
+  if (!session_authenticated()) {
     return;
   }
 
@@ -247,9 +245,9 @@ void handlecredentialchange() {
   String pw1 = server.arg("password");
   String pw2 = server.arg("password_duplicate");
 
-  if(login != "" && pw1 != "" && pw1 == pw2){
+  if (login != "" && pw1 != "" && pw1 == pw2) {
 
-    savecredentials(login,pw1);
+    savecredentials(login, pw1);
     server.send(200, "text/plain", "Credentials updated");
     redirect();
   } else {
diff --git a/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino b/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
index dc998986e5..e27973cab2 100644
--- a/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
+++ b/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
@@ -8,11 +8,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *password = STAPSK;
+const char* ssid = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer server(80);
 
diff --git a/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino b/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
index da1703807a..6c787794e5 100644
--- a/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
+++ b/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
@@ -5,10 +5,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 ESP8266WebServer server(80);
diff --git a/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino b/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
index 77ae1e958e..c2fe34bb9c 100644
--- a/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
+++ b/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
@@ -42,7 +42,7 @@ extern "C" {
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
@@ -51,7 +51,7 @@ const unsigned int port = 80;
 
 ESP8266WebServer server(port);
 
-#define SSE_MAX_CHANNELS 8  // in this simplified example, only eight SSE clients subscription allowed
+#define SSE_MAX_CHANNELS 8 // in this simplified example, only eight SSE clients subscription allowed
 struct SSESubscription {
   IPAddress clientIP;
   WiFiClient client;
@@ -60,7 +60,7 @@ struct SSESubscription {
 uint8_t subscriptionCount = 0;
 
 typedef struct {
-  const char *name;
+  const char* name;
   unsigned short value;
   Ticker update;
 } sensorType;
@@ -89,7 +89,7 @@ void SSEKeepAlive() {
     }
     if (subscription[i].client.connected()) {
       Serial.printf_P(PSTR("SSEKeepAlive - client is still listening on channel %d\n"), i);
-      subscription[i].client.println(F("event: event\ndata: { \"TYPE\":\"KEEP-ALIVE\" }\n"));   // Extra newline required by SSE standard
+      subscription[i].client.println(F("event: event\ndata: { \"TYPE\":\"KEEP-ALIVE\" }\n")); // Extra newline required by SSE standard
     } else {
       Serial.printf_P(PSTR("SSEKeepAlive - client not listening on channel %d, remove subscription\n"), i);
       subscription[i].keepAliveTimer.detach();
@@ -105,7 +105,7 @@ void SSEKeepAlive() {
 // every 60 seconds it sends a keep alive event via Ticker
 void SSEHandler(uint8_t channel) {
   WiFiClient client = server.client();
-  SSESubscription &s = subscription[channel];
+  SSESubscription& s = subscription[channel];
   if (s.clientIP != client.remoteIP()) { // IP addresses don't match, reject this client
     Serial.printf_P(PSTR("SSEHandler - unregistered client with IP %s tries to listen\n"), server.client().remoteIP().toString().c_str());
     return handleNotFound();
@@ -116,12 +116,12 @@ void SSEHandler(uint8_t channel) {
   s.client = client; // capture SSE server client connection
   server.setContentLength(CONTENT_LENGTH_UNKNOWN); // the payload can go on forever
   server.sendContent_P(PSTR("HTTP/1.1 200 OK\nContent-Type: text/event-stream;\nConnection: keep-alive\nCache-Control: no-cache\nAccess-Control-Allow-Origin: *\n\n"));
-  s.keepAliveTimer.attach_scheduled(30.0, SSEKeepAlive);  // Refresh time every 30s for demo
+  s.keepAliveTimer.attach_scheduled(30.0, SSEKeepAlive); // Refresh time every 30s for demo
 }
 
 void handleAll() {
-  const char *uri = server.uri().c_str();
-  const char *restEvents = PSTR("/rest/events/");
+  const char* uri = server.uri().c_str();
+  const char* restEvents = PSTR("/rest/events/");
   if (strncmp_P(uri, restEvents, strlen_P(restEvents))) {
     return handleNotFound();
   }
@@ -133,7 +133,7 @@ void handleAll() {
   handleNotFound();
 };
 
-void SSEBroadcastState(const char *sensorName, unsigned short prevSensorValue, unsigned short sensorValue) {
+void SSEBroadcastState(const char* sensorName, unsigned short prevSensorValue, unsigned short sensorValue) {
   for (uint8_t i = 0; i < SSE_MAX_CHANNELS; i++) {
     if (!(subscription[i].clientIP)) {
       continue;
@@ -141,9 +141,9 @@ void SSEBroadcastState(const char *sensorName, unsigned short prevSensorValue, u
     String IPaddrstr = IPAddress(subscription[i].clientIP).toString();
     if (subscription[i].client.connected()) {
       Serial.printf_P(PSTR("broadcast status change to client IP %s on channel %d for %s with new state %d\n"),
-                      IPaddrstr.c_str(), i, sensorName, sensorValue);
+          IPaddrstr.c_str(), i, sensorName, sensorValue);
       subscription[i].client.printf_P(PSTR("event: event\ndata: {\"TYPE\":\"STATE\", \"%s\":{\"state\":%d, \"prevState\":%d}}\n\n"),
-                                      sensorName, sensorValue, prevSensorValue);
+          sensorName, sensorValue, prevSensorValue);
     } else {
       Serial.printf_P(PSTR("SSEBroadcastState - client %s registered on channel %d but not listening\n"), IPaddrstr.c_str(), i);
     }
@@ -151,23 +151,23 @@ void SSEBroadcastState(const char *sensorName, unsigned short prevSensorValue, u
 }
 
 // Simulate sensors
-void updateSensor(sensorType &sensor) {
+void updateSensor(sensorType& sensor) {
   unsigned short newVal = (unsigned short)RANDOM_REG32; // (not so good) random value for the sensor
   Serial.printf_P(PSTR("update sensor %s - previous state: %d, new state: %d\n"), sensor.name, sensor.value, newVal);
   if (sensor.value != newVal) {
-    SSEBroadcastState(sensor.name, sensor.value, newVal);  // only broadcast if state is different
+    SSEBroadcastState(sensor.name, sensor.value, newVal); // only broadcast if state is different
   }
   sensor.value = newVal;
-  sensor.update.once(rand() % 20 + 10, std::bind(updateSensor, sensor));  // randomly update sensor
+  sensor.update.once(rand() % 20 + 10, std::bind(updateSensor, sensor)); // randomly update sensor
 }
 
 void handleSubscribe() {
   if (subscriptionCount == SSE_MAX_CHANNELS - 1) {
-    return handleNotFound();  // We ran out of channels
+    return handleNotFound(); // We ran out of channels
   }
 
   uint8_t channel;
-  IPAddress clientIP = server.client().remoteIP();   // get IP address of client
+  IPAddress clientIP = server.client().remoteIP(); // get IP address of client
   String SSEurl = F("http://");
   SSEurl += WiFi.localIP().toString();
   SSEurl += F(":");
@@ -180,7 +180,7 @@ void handleSubscribe() {
     if (!subscription[channel].clientIP) {
       break;
     }
-  subscription[channel] = {clientIP, server.client(), Ticker()};
+  subscription[channel] = { clientIP, server.client(), Ticker() };
   SSEurl += channel;
   Serial.printf_P(PSTR("Allocated channel %d, on uri %s\n"), channel, SSEurl.substring(offset).c_str());
   //server.on(SSEurl.substring(offset), std::bind(SSEHandler, &(subscription[channel])));
@@ -200,7 +200,7 @@ void setup(void) {
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
   Serial.println("");
-  while (WiFi.status() != WL_CONNECTED) {   // Wait for connection
+  while (WiFi.status() != WL_CONNECTED) { // Wait for connection
     delay(500);
     Serial.print(".");
   }
@@ -209,7 +209,7 @@ void setup(void) {
     Serial.println("MDNS responder started");
   }
 
-  startServers();   // start web and SSE servers
+  startServers(); // start web and SSE servers
   sensor[0].name = "sensorA";
   sensor[1].name = "sensorB";
   updateSensor(sensor[0]);
diff --git a/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino b/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
index 2cba08fe9c..a2b7bc9275 100644
--- a/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
+++ b/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
@@ -4,7 +4,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
@@ -45,7 +45,7 @@ void handleLogin() {
     return;
   }
   if (server.hasArg("USERNAME") && server.hasArg("PASSWORD")) {
-    if (server.arg("USERNAME") == "admin" &&  server.arg("PASSWORD") == "admin") {
+    if (server.arg("USERNAME") == "admin" && server.arg("PASSWORD") == "admin") {
       server.sendHeader("Location", "/");
       server.sendHeader("Cache-Control", "no-cache");
       server.sendHeader("Set-Cookie", "ESPSESSIONID=1");
@@ -115,7 +115,6 @@ void setup(void) {
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-
   server.on("/", handleRoot);
   server.on("/login", handleLogin);
   server.on("/inline", []() {
diff --git a/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino b/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
index 08107586fd..be875048ee 100644
--- a/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
+++ b/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
@@ -11,7 +11,7 @@
 
 #include "secrets.h" // add WLAN Credentials in here.
 
-#include <FS.h>       // File System for Web Server Files
+#include <FS.h> // File System for Web Server Files
 #include <LittleFS.h> // This file system is used.
 
 // mark parameters not used in example
@@ -32,7 +32,6 @@ ESP8266WebServer server(80);
 // The text of builtin files are in this header file
 #include "builtinfiles.h"
 
-
 // ===== Simple functions used to answer simple GET requests =====
 
 // This function is called when the WebServer was requested without giving a filename.
@@ -49,7 +48,6 @@ void handleRedirect() {
   server.send(302);
 } // handleRedirect()
 
-
 // This function is called when the WebServer was requested to list all existing files in the filesystem.
 // a JSON array with file information is returned.
 void handleListFiles() {
@@ -73,7 +71,6 @@ void handleListFiles() {
   server.send(200, "text/javascript; charset=utf-8", result);
 } // handleListFiles()
 
-
 // This function is called when the sysInfo service was requested.
 void handleSysInfo() {
   String result;
@@ -92,91 +89,85 @@ void handleSysInfo() {
   server.send(200, "text/javascript; charset=utf-8", result);
 } // handleSysInfo()
 
-
 // ===== Request Handler class used to answer more complex requests =====
 
 // The FileServerHandler is registered to the web server to support DELETE and UPLOAD of files into the filesystem.
 class FileServerHandler : public RequestHandler {
   public:
-    // @brief Construct a new File Server Handler object
-    // @param fs The file system to be used.
-    // @param path Path to the root folder in the file system that is used for serving static data down and upload.
-    // @param cache_header Cache Header to be used in replies.
-    FileServerHandler() {
-      TRACE("FileServerHandler is registered\n");
-    }
-
-
-    // @brief check incoming request. Can handle POST for uploads and DELETE.
-    // @param requestMethod method of the http request line.
-    // @param requestUri request ressource from the http request line.
-    // @return true when method can be handled.
-    bool canHandle(HTTPMethod requestMethod, const String UNUSED &_uri) override {
-      return ((requestMethod == HTTP_POST) || (requestMethod == HTTP_DELETE));
-    } // canHandle()
-
+  // @brief Construct a new File Server Handler object
+  // @param fs The file system to be used.
+  // @param path Path to the root folder in the file system that is used for serving static data down and upload.
+  // @param cache_header Cache Header to be used in replies.
+  FileServerHandler() {
+    TRACE("FileServerHandler is registered\n");
+  }
 
-    bool canUpload(const String &uri) override {
-      // only allow upload on root fs level.
-      return (uri == "/");
-    } // canUpload()
+  // @brief check incoming request. Can handle POST for uploads and DELETE.
+  // @param requestMethod method of the http request line.
+  // @param requestUri request ressource from the http request line.
+  // @return true when method can be handled.
+  bool canHandle(HTTPMethod requestMethod, const String UNUSED& _uri) override {
+    return ((requestMethod == HTTP_POST) || (requestMethod == HTTP_DELETE));
+  } // canHandle()
+
+  bool canUpload(const String& uri) override {
+    // only allow upload on root fs level.
+    return (uri == "/");
+  } // canUpload()
+
+  bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, const String& requestUri) override {
+    // ensure that filename starts with '/'
+    String fName = requestUri;
+    if (!fName.startsWith("/")) {
+      fName = "/" + fName;
+    }
 
+    if (requestMethod == HTTP_POST) {
+      // all done in upload. no other forms.
 
-    bool handle(ESP8266WebServer &server, HTTPMethod requestMethod, const String &requestUri) override {
-      // ensure that filename starts with '/'
-      String fName = requestUri;
-      if (!fName.startsWith("/")) {
-        fName = "/" + fName;
+    } else if (requestMethod == HTTP_DELETE) {
+      if (LittleFS.exists(fName)) {
+        LittleFS.remove(fName);
       }
+    } // if
+
+    server.send(200); // all done.
+    return (true);
+  } // handle()
+
+  // uploading process
+  void upload(ESP8266WebServer UNUSED& server, const String UNUSED& _requestUri, HTTPUpload& upload) override {
+    // ensure that filename starts with '/'
+    String fName = upload.filename;
+    if (!fName.startsWith("/")) {
+      fName = "/" + fName;
+    }
 
-      if (requestMethod == HTTP_POST) {
-        // all done in upload. no other forms.
-
-      } else if (requestMethod == HTTP_DELETE) {
-        if (LittleFS.exists(fName)) {
-          LittleFS.remove(fName);
-        }
+    if (upload.status == UPLOAD_FILE_START) {
+      // Open the file
+      if (LittleFS.exists(fName)) {
+        LittleFS.remove(fName);
       } // if
+      _fsUploadFile = LittleFS.open(fName, "w");
 
-      server.send(200); // all done.
-      return (true);
-    } // handle()
-
-
-    // uploading process
-    void upload(ESP8266WebServer UNUSED &server, const String UNUSED &_requestUri, HTTPUpload &upload) override {
-      // ensure that filename starts with '/'
-      String fName = upload.filename;
-      if (!fName.startsWith("/")) {
-        fName = "/" + fName;
+    } else if (upload.status == UPLOAD_FILE_WRITE) {
+      // Write received bytes
+      if (_fsUploadFile) {
+        _fsUploadFile.write(upload.buf, upload.currentSize);
       }
 
-      if (upload.status == UPLOAD_FILE_START) {
-        // Open the file
-        if (LittleFS.exists(fName)) {
-          LittleFS.remove(fName);
-        } // if
-        _fsUploadFile = LittleFS.open(fName, "w");
-
-      } else if (upload.status == UPLOAD_FILE_WRITE) {
-        // Write received bytes
-        if (_fsUploadFile) {
-          _fsUploadFile.write(upload.buf, upload.currentSize);
-        }
-
-      } else if (upload.status == UPLOAD_FILE_END) {
-        // Close the file
-        if (_fsUploadFile) {
-          _fsUploadFile.close();
-        }
-      } // if
-    }   // upload()
+    } else if (upload.status == UPLOAD_FILE_END) {
+      // Close the file
+      if (_fsUploadFile) {
+        _fsUploadFile.close();
+      }
+    } // if
+  } // upload()
 
   protected:
-    File _fsUploadFile;
+  File _fsUploadFile;
 };
 
-
 // Setup everything to make the webserver work.
 void setup(void) {
   delay(3000); // wait for serial monitor to start completely.
@@ -252,7 +243,6 @@ void setup(void) {
   TRACE("hostname=%s\n", WiFi.getHostname());
 } // setup
 
-
 // run the server...
 void loop(void) {
   server.handleClient();
diff --git a/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino b/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
index 17646fd172..4dff271390 100644
--- a/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
+++ b/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
@@ -9,7 +9,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* host = "esp8266-webupdate";
@@ -31,11 +31,11 @@ void setup(void) {
       server.sendHeader("Connection", "close");
       server.send(200, "text/html", serverIndex);
     });
-    server.on("/update", HTTP_POST, []() {
+    server.on(
+        "/update", HTTP_POST, []() {
       server.sendHeader("Connection", "close");
       server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
-      ESP.restart();
-    }, []() {
+      ESP.restart(); }, []() {
       HTTPUpload& upload = server.upload();
       if (upload.status == UPLOAD_FILE_START) {
         Serial.setDebugOutput(true);
@@ -57,8 +57,7 @@ void setup(void) {
         }
         Serial.setDebugOutput(false);
       }
-      yield();
-    });
+      yield(); });
     server.begin();
     MDNS.addService("http", "tcp", 80);
 
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
index a599a0395a..7b5ccc9ba1 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
@@ -41,11 +41,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
 // A single, global CertStore which can be used by all
 // connections.  Needs to stay live the entire time any of
@@ -71,7 +71,7 @@ void setClock() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump URL
-void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_t port, const char *path) {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
   if (!path) {
     path = "/";
   }
@@ -100,7 +100,7 @@ void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_
         break;
       }
       // Only print out first line up to \r, then abort connection
-      char *nl = strchr(tmp, '\r');
+      char* nl = strchr(tmp, '\r');
       if (nl) {
         *nl = 0;
         Serial.print(tmp);
@@ -145,7 +145,7 @@ void setup() {
     return; // Can't connect to anything w/o certs!
   }
 
-  BearSSL::WiFiClientSecure *bear = new BearSSL::WiFiClientSecure();
+  BearSSL::WiFiClientSecure* bear = new BearSSL::WiFiClientSecure();
   // Integrate the cert store with this connection
   bear->setCertStore(&certStore);
   Serial.printf("Attempting to fetch https://github.com/...\n");
@@ -164,10 +164,9 @@ void loop() {
   site.replace(String("\n"), emptyString);
   Serial.printf("https://%s/\n", site.c_str());
 
-  BearSSL::WiFiClientSecure *bear = new BearSSL::WiFiClientSecure();
+  BearSSL::WiFiClientSecure* bear = new BearSSL::WiFiClientSecure();
   // Integrate the cert store with this connection
   bear->setCertStore(&certStore);
   fetchURL(bear, site.c_str(), 443, "/");
   delete bear;
 }
-
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_MaxFragmentLength/BearSSL_MaxFragmentLength.ino b/libraries/ESP8266WiFi/examples/BearSSL_MaxFragmentLength/BearSSL_MaxFragmentLength.ino
index 708d906eb1..b58177712c 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_MaxFragmentLength/BearSSL_MaxFragmentLength.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_MaxFragmentLength/BearSSL_MaxFragmentLength.ino
@@ -9,13 +9,13 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
-void fetch(BearSSL::WiFiClientSecure *client) {
+void fetch(BearSSL::WiFiClientSecure* client) {
   client->write("GET / HTTP/1.0\r\nHost: tls.mbed.org\r\nUser-Agent: ESP8266\r\n\r\n");
   client->flush();
   using oneShot = esp8266::polledTimeout::oneShot;
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
index 160b6a981e..9677178521 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
@@ -39,11 +39,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
 // The HTTPS server
 BearSSL::WiFiServerSecure server(443);
@@ -139,10 +139,10 @@ GBEnkz4KpKv7TkHoW+j7F5EMcLcSrUIpyw==
 #endif
 
 #define CACHE_SIZE 5 // Number of sessions to cache.
-#define USE_CACHE // Enable SSL session caching.
-                  // Caching SSL sessions shortens the length of the SSL handshake.
-                  // You can see the performance improvement by looking at the
-                  // Network tab of the developer tools of your browser.
+#define USE_CACHE // Enable SSL session caching.                      \
+    // Caching SSL sessions shortens the length of the SSL handshake. \
+    // You can see the performance improvement by looking at the      \
+    // Network tab of the developer tools of your browser.
 //#define DYNAMIC_CACHE // Whether to dynamically allocate the cache.
 
 #if defined(USE_CACHE) && defined(DYNAMIC_CACHE)
@@ -176,12 +176,12 @@ void setup() {
   Serial.println(WiFi.localIP());
 
   // Attach the server private cert/key combo
-  BearSSL::X509List *serverCertList = new BearSSL::X509List(server_cert);
-  BearSSL::PrivateKey *serverPrivKey = new BearSSL::PrivateKey(server_private_key);
+  BearSSL::X509List* serverCertList = new BearSSL::X509List(server_cert);
+  BearSSL::PrivateKey* serverPrivKey = new BearSSL::PrivateKey(server_private_key);
 #ifndef USE_EC
   server.setRSACert(serverCertList, serverPrivKey);
 #else
-  server.setECCert(serverCertList, BR_KEYTYPE_KEYX|BR_KEYTYPE_SIGN, serverPrivKey);
+  server.setECCert(serverCertList, BR_KEYTYPE_KEYX | BR_KEYTYPE_SIGN, serverPrivKey);
 #endif
 
   // Set the server's cache
@@ -193,17 +193,16 @@ void setup() {
   server.begin();
 }
 
-static const char *HTTP_RES =
-        "HTTP/1.0 200 OK\r\n"
-        "Connection: close\r\n"
-        "Content-Length: 62\r\n"
-        "Content-Type: text/html; charset=iso-8859-1\r\n"
-        "\r\n"
-        "<html>\r\n"
-        "<body>\r\n"
-        "<p>Hello from ESP8266!</p>\r\n"
-        "</body>\r\n"
-        "</html>\r\n";
+static const char* HTTP_RES = "HTTP/1.0 200 OK\r\n"
+                              "Connection: close\r\n"
+                              "Content-Length: 62\r\n"
+                              "Content-Type: text/html; charset=iso-8859-1\r\n"
+                              "\r\n"
+                              "<html>\r\n"
+                              "<body>\r\n"
+                              "<p>Hello from ESP8266!</p>\r\n"
+                              "</body>\r\n"
+                              "</html>\r\n";
 
 void loop() {
   static int cnt;
@@ -211,13 +210,13 @@ void loop() {
   if (!incoming) {
     return;
   }
-  Serial.printf("Incoming connection...%d\n",cnt++);
-  
+  Serial.printf("Incoming connection...%d\n", cnt++);
+
   // Ugly way to wait for \r\n (i.e. end of HTTP request which we don't actually parse here)
-  uint32_t timeout=millis() + 1000;
+  uint32_t timeout = millis() + 1000;
   int lcwn = 0;
   for (;;) {
-    unsigned char x=0;
+    unsigned char x = 0;
     if ((millis() > timeout) || (incoming.available() && incoming.read(&x, 1) < 0)) {
       incoming.stop();
       Serial.printf("Connection error, closed\n");
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino b/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
index 3e88019cf4..58687f9041 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
@@ -67,11 +67,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
 // The server which will require a client cert signed by the trusted CA
 BearSSL::WiFiServerSecure server(443);
@@ -160,8 +160,7 @@ seoK24dHmt6tWmn/sbxX7Aa6TL/4mVlFoOgcaTJyVaY/BrY=
 // head of the app.
 
 // Set time via NTP, as required for x.509 validation
-void setClock()
-{
+void setClock() {
   configTime(3 * 3600, 0, "pool.ntp.org", "time.nist.gov");
 
   Serial.print("Waiting for NTP time sync: ");
@@ -202,29 +201,28 @@ void setup() {
   setClock(); // Required for X.509 validation
 
   // Attach the server private cert/key combo
-  BearSSL::X509List *serverCertList = new BearSSL::X509List(server_cert);
-  BearSSL::PrivateKey *serverPrivKey = new BearSSL::PrivateKey(server_private_key);
+  BearSSL::X509List* serverCertList = new BearSSL::X509List(server_cert);
+  BearSSL::PrivateKey* serverPrivKey = new BearSSL::PrivateKey(server_private_key);
   server.setRSACert(serverCertList, serverPrivKey);
 
   // Require a certificate validated by the trusted CA
-  BearSSL::X509List *serverTrustedCA = new BearSSL::X509List(ca_cert);
+  BearSSL::X509List* serverTrustedCA = new BearSSL::X509List(ca_cert);
   server.setClientTrustAnchor(serverTrustedCA);
 
   // Actually start accepting connections
   server.begin();
 }
 
-static const char *HTTP_RES =
-        "HTTP/1.0 200 OK\r\n"
-        "Connection: close\r\n"
-        "Content-Length: 59\r\n"
-        "Content-Type: text/html; charset=iso-8859-1\r\n"
-        "\r\n"
-        "<html>\r\n"
-        "<body>\r\n"
-        "<p>Hello my friend!</p>\r\n"
-        "</body>\r\n"
-        "</html>\r\n";
+static const char* HTTP_RES = "HTTP/1.0 200 OK\r\n"
+                              "Connection: close\r\n"
+                              "Content-Length: 59\r\n"
+                              "Content-Type: text/html; charset=iso-8859-1\r\n"
+                              "\r\n"
+                              "<html>\r\n"
+                              "<body>\r\n"
+                              "<p>Hello my friend!</p>\r\n"
+                              "</body>\r\n"
+                              "</html>\r\n";
 
 void loop() {
   BearSSL::WiFiClientSecure incoming = server.accept();
@@ -232,12 +230,12 @@ void loop() {
     return;
   }
   Serial.println("Incoming connection...\n");
-  
+
   // Ugly way to wait for \r\n (i.e. end of HTTP request which we don't actually parse here)
-  uint32_t timeout=millis() + 1000;
+  uint32_t timeout = millis() + 1000;
   int lcwn = 0;
   for (;;) {
-    unsigned char x=0;
+    unsigned char x = 0;
     if ((millis() > timeout) || (incoming.available() && incoming.read(&x, 1) < 0)) {
       incoming.stop();
       Serial.printf("Connection error, closed\n");
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino b/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
index fa03c7fa38..5229f1c095 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
@@ -9,13 +9,13 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
-const char *   path = "/";
+const char* path = "/";
 
 void setup() {
   Serial.begin(115200);
@@ -52,7 +52,7 @@ void setup() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump HTTP response
-void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_t port, const char *path) {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
   if (!path) {
     path = "/";
   }
@@ -81,7 +81,7 @@ void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_
         break;
       }
       // Only print out first line up to \r, then abort connection
-      char *nl = strchr(tmp, '\r');
+      char* nl = strchr(tmp, '\r');
       if (nl) {
         *nl = 0;
         Serial.print(tmp);
@@ -94,7 +94,6 @@ void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_
   Serial.printf("\n-------\n\n");
 }
 
-
 void loop() {
   uint32_t start, finish;
   BearSSL::WiFiClientSecure client;
@@ -132,4 +131,3 @@ void loop() {
 
   delay(10000); // Avoid DDOSing github
 }
-
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino b/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
index b91570da11..5968283bd6 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
@@ -12,13 +12,13 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
-const char *   path = "/";
+const char* path = "/";
 
 // Set time via NTP, as required for x.509 validation
 void setClock() {
@@ -39,7 +39,7 @@ void setClock() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump HTTP response
-void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_t port, const char *path) {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
   if (!path) {
     path = "/";
   }
@@ -70,7 +70,7 @@ void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_
         break;
       }
       // Only print out first line up to \r, then abort connection
-      char *nl = strchr(tmp, '\r');
+      char* nl = strchr(tmp, '\r');
       if (nl) {
         *nl = 0;
         Serial.print(tmp);
@@ -223,7 +223,6 @@ void setup() {
   fetchFaster();
 }
 
-
 void loop() {
   // Nothing to do here
 }
diff --git a/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino b/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
index 9ccf3b6b37..0493192afb 100644
--- a/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
+++ b/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
@@ -17,7 +17,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
@@ -74,10 +74,7 @@ void setup() {
   Serial.print("Requesting URL: ");
   Serial.println(url);
 
-  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
-               "Host: " + github_host + "\r\n" +
-               "User-Agent: BuildFailureDetectorESP8266\r\n" +
-               "Connection: close\r\n\r\n");
+  client.print(String("GET ") + url + " HTTP/1.1\r\n" + "Host: " + github_host + "\r\n" + "User-Agent: BuildFailureDetectorESP8266\r\n" + "Connection: close\r\n\r\n");
 
   Serial.println("Request sent");
   while (client.connected()) {
diff --git a/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino b/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
index 560d9bfe46..6087b688b1 100644
--- a/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
+++ b/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
@@ -23,11 +23,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-#define FQDN  F("www.google.com")  // with both IPv4 & IPv6 addresses
-#define FQDN2 F("www.yahoo.com")   // with both IPv4 & IPv6 addresses
+#define FQDN F("www.google.com") // with both IPv4 & IPv6 addresses
+#define FQDN2 F("www.yahoo.com") // with both IPv4 & IPv6 addresses
 #define FQDN6 F("ipv6.google.com") // does not resolve in IPv4
 #define STATUSDELAY_MS 10000
 #define TCP_PORT 23
@@ -80,20 +80,19 @@ void status(Print& out) {
   out.println(F("(with 'telnet <addr> or 'nc -u <addr> 23')"));
   for (auto a : addrList) {
     out.printf("IF='%s' IPv6=%d local=%d hostname='%s' addr= %s",
-               a.ifname().c_str(),
-               a.isV6(),
-               a.isLocal(),
-               a.ifhostname(),
-               a.toString().c_str());
+        a.ifname().c_str(),
+        a.isV6(),
+        a.isLocal(),
+        a.ifhostname(),
+        a.toString().c_str());
 
     if (a.isLegacy()) {
       out.printf(" / mask:%s / gw:%s",
-                 a.netmask().toString().c_str(),
-                 a.gw().toString().c_str());
+          a.netmask().toString().c_str(),
+          a.gw().toString().c_str());
     }
 
     out.println();
-
   }
 
   // lwIP's dns client will ask for IPv4 first (by default)
@@ -101,7 +100,7 @@ void status(Print& out) {
   fqdn(out, FQDN);
   fqdn(out, FQDN6);
 #if LWIP_IPV4 && LWIP_IPV6
-  fqdn_rt(out, FQDN,  DNSResolveType::DNS_AddrType_IPv4_IPv6); // IPv4 before IPv6
+  fqdn_rt(out, FQDN, DNSResolveType::DNS_AddrType_IPv4_IPv6); // IPv4 before IPv6
   fqdn_rt(out, FQDN2, DNSResolveType::DNS_AddrType_IPv6_IPv4); // IPv6 before IPv4
 #endif
   out.println(F("------------------------------"));
@@ -146,9 +145,9 @@ void setup() {
   for (bool configured = false; !configured;) {
     for (auto addr : addrList)
       if ((configured = !addr.isLocal()
-                        // && addr.isV6() // uncomment when IPv6 is mandatory
-                        // && addr.ifnumber() == STATION_IF
-          )) {
+              // && addr.isV6() // uncomment when IPv6 is mandatory
+              // && addr.ifnumber() == STATION_IF
+              )) {
         break;
       }
     Serial.print('.');
@@ -188,7 +187,7 @@ void loop() {
     udp.remoteIP().printTo(Serial);
     Serial.print(F(" :"));
     Serial.println(udp.remotePort());
-    int  c;
+    int c;
     while ((c = udp.read()) >= 0) {
       Serial.write(c);
     }
@@ -199,9 +198,7 @@ void loop() {
     udp.endPacket();
   }
 
-
   if (showStatusOnSerialNow) {
     status(Serial);
   }
-
 }
diff --git a/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino b/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
index 927e78fee9..780bb71485 100644
--- a/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
+++ b/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
@@ -23,14 +23,13 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char * ssid = STASSID; // your network SSID (name)
-const char * pass = STAPSK;  // your network password
+const char* ssid = STASSID; // your network SSID (name)
+const char* pass = STAPSK; // your network password
 
-
-unsigned int localPort = 2390;      // local port to listen for UDP packets
+unsigned int localPort = 2390; // local port to listen for UDP packets
 
 /* Don't hardwire the IP address or we won't get the benefits of the pool.
     Lookup the IP address for the host name instead */
@@ -40,7 +39,7 @@ const char* ntpServerName = "time.nist.gov";
 
 const int NTP_PACKET_SIZE = 48; // NTP time stamp is in the first 48 bytes of the message
 
-byte packetBuffer[ NTP_PACKET_SIZE]; //buffer to hold incoming and outgoing packets
+byte packetBuffer[NTP_PACKET_SIZE]; //buffer to hold incoming and outgoing packets
 
 // A UDP instance to let us send and receive packets over UDP
 WiFiUDP udp;
@@ -109,16 +108,15 @@ void loop() {
     // print Unix time:
     Serial.println(epoch);
 
-
     // print the hour, minute and second:
-    Serial.print("The UTC time is ");       // UTC is the time at Greenwich Meridian (GMT)
-    Serial.print((epoch  % 86400L) / 3600); // print the hour (86400 equals secs per day)
+    Serial.print("The UTC time is "); // UTC is the time at Greenwich Meridian (GMT)
+    Serial.print((epoch % 86400L) / 3600); // print the hour (86400 equals secs per day)
     Serial.print(':');
     if (((epoch % 3600) / 60) < 10) {
       // In the first 10 minutes of each hour, we'll want a leading '0'
       Serial.print('0');
     }
-    Serial.print((epoch  % 3600) / 60); // print the minute (3600 equals secs per minute)
+    Serial.print((epoch % 3600) / 60); // print the minute (3600 equals secs per minute)
     Serial.print(':');
     if ((epoch % 60) < 10) {
       // In the first 10 seconds of each minute, we'll want a leading '0'
@@ -137,15 +135,15 @@ void sendNTPpacket(IPAddress& address) {
   memset(packetBuffer, 0, NTP_PACKET_SIZE);
   // Initialize values needed to form NTP request
   // (see URL above for details on the packets)
-  packetBuffer[0] = 0b11100011;   // LI, Version, Mode
-  packetBuffer[1] = 0;     // Stratum, or type of clock
-  packetBuffer[2] = 6;     // Polling Interval
-  packetBuffer[3] = 0xEC;  // Peer Clock Precision
+  packetBuffer[0] = 0b11100011; // LI, Version, Mode
+  packetBuffer[1] = 0; // Stratum, or type of clock
+  packetBuffer[2] = 6; // Polling Interval
+  packetBuffer[3] = 0xEC; // Peer Clock Precision
   // 8 bytes of zero for Root Delay & Root Dispersion
-  packetBuffer[12]  = 49;
-  packetBuffer[13]  = 0x4E;
-  packetBuffer[14]  = 49;
-  packetBuffer[15]  = 52;
+  packetBuffer[12] = 49;
+  packetBuffer[13] = 0x4E;
+  packetBuffer[14] = 49;
+  packetBuffer[15] = 52;
 
   // all NTP fields have been given values, now
   // you can send a packet requesting a timestamp:
diff --git a/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino b/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
index 43f8fe981c..198cae34b0 100644
--- a/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
+++ b/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
@@ -25,10 +25,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 ArduinoWiFiServer server(2323);
diff --git a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
index a98e894873..a908495150 100644
--- a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
+++ b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
@@ -7,7 +7,7 @@
 
 #ifndef STASSID
 #define STASSID "mynetwork"
-#define STAPSK  "mynetworkpassword"
+#define STAPSK "mynetworkpassword"
 #endif
 
 #include <ESP8266WiFi.h>
@@ -52,18 +52,18 @@ void setup() {
     delay(500);
   }
   Serial.printf("\nSTA: %s (dns: %s / %s)\n",
-                WiFi.localIP().toString().c_str(),
-                WiFi.dnsIP(0).toString().c_str(),
-                WiFi.dnsIP(1).toString().c_str());
+      WiFi.localIP().toString().c_str(),
+      WiFi.dnsIP(0).toString().c_str(),
+      WiFi.dnsIP(1).toString().c_str());
 
   // give DNS servers to AP side
   dhcpSoftAP.dhcps_set_dns(0, WiFi.dnsIP(0));
   dhcpSoftAP.dhcps_set_dns(1, WiFi.dnsIP(1));
 
-  WiFi.softAPConfig(  // enable AP, with android-compatible google domain
-    IPAddress(172, 217, 28, 254),
-    IPAddress(172, 217, 28, 254),
-    IPAddress(255, 255, 255, 0));
+  WiFi.softAPConfig( // enable AP, with android-compatible google domain
+      IPAddress(172, 217, 28, 254),
+      IPAddress(172, 217, 28, 254),
+      IPAddress(255, 255, 255, 0));
   WiFi.softAP(STASSID "extender", STAPSK);
   Serial.printf("AP: %s\n", WiFi.softAPIP().toString().c_str());
 
@@ -94,4 +94,3 @@ void setup() {
 
 void loop() {
 }
-
diff --git a/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino b/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
index e4520c4720..ada965fc16 100644
--- a/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
+++ b/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
@@ -7,8 +7,8 @@
 #include <LwipDhcpServer.h>
 
 /* Set these to your desired credentials. */
-const char *ssid = "ESPap";
-const char *password = "thereisnospoon";
+const char* ssid = "ESPap";
+const char* password = "thereisnospoon";
 
 ESP8266WebServer server(80);
 
@@ -20,7 +20,7 @@ void handleRoot() {
   String result;
   char wifiClientMac[18];
   unsigned char number_client;
-  struct station_info *stat_info;
+  struct station_info* stat_info;
 
   int i = 1;
 
@@ -76,8 +76,8 @@ void setup() {
      ...
      any client not listed will use next IP address available from the range (here 192.168.0.102 and more)
   */
-  dhcpSoftAP.add_dhcps_lease(mac_CAM);  // always 192.168.0.100
-  dhcpSoftAP.add_dhcps_lease(mac_PC);   // always 192.168.0.101
+  dhcpSoftAP.add_dhcps_lease(mac_CAM); // always 192.168.0.100
+  dhcpSoftAP.add_dhcps_lease(mac_PC); // always 192.168.0.101
   /* Start Access Point. You can remove the password parameter if you want the AP to be open. */
   WiFi.softAP(ssid, password);
   Serial.print("AP IP address: ");
diff --git a/libraries/ESP8266WiFi/examples/Udp/Udp.ino b/libraries/ESP8266WiFi/examples/Udp/Udp.ino
index 7ec287b392..d9ff61bfcf 100644
--- a/libraries/ESP8266WiFi/examples/Udp/Udp.ino
+++ b/libraries/ESP8266WiFi/examples/Udp/Udp.ino
@@ -14,20 +14,19 @@
   adapted from Ethernet library examples
 */
 
-
 #include <ESP8266WiFi.h>
 #include <WiFiUdp.h>
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-unsigned int localPort = 8888;      // local port to listen on
+unsigned int localPort = 8888; // local port to listen on
 
 // buffers for receiving and sending data
 char packetBuffer[UDP_TX_PACKET_MAX_SIZE + 1]; //buffer to hold incoming packet,
-char  ReplyBuffer[] = "acknowledged\r\n";       // a string to send back
+char ReplyBuffer[] = "acknowledged\r\n"; // a string to send back
 
 WiFiUDP Udp;
 
@@ -50,10 +49,10 @@ void loop() {
   int packetSize = Udp.parsePacket();
   if (packetSize) {
     Serial.printf("Received packet of size %d from %s:%d\n    (to %s:%d, free heap = %d B)\n",
-                  packetSize,
-                  Udp.remoteIP().toString().c_str(), Udp.remotePort(),
-                  Udp.destinationIP().toString().c_str(), Udp.localPort(),
-                  ESP.getFreeHeap());
+        packetSize,
+        Udp.remoteIP().toString().c_str(), Udp.remotePort(),
+        Udp.destinationIP().toString().c_str(), Udp.localPort(),
+        ESP.getFreeHeap());
 
     // read the packet into packetBufffer
     int n = Udp.read(packetBuffer, UDP_TX_PACKET_MAX_SIZE);
@@ -66,7 +65,6 @@ void loop() {
     Udp.write(ReplyBuffer);
     Udp.endPacket();
   }
-
 }
 
 /*
diff --git a/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino b/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
index 6fea68f590..e32666a74b 100644
--- a/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
@@ -36,12 +36,12 @@
 
 #ifndef APSSID
 #define APSSID "ESPap"
-#define APPSK  "thereisnospoon"
+#define APPSK "thereisnospoon"
 #endif
 
 /* Set these to your desired credentials. */
-const char *ssid = APSSID;
-const char *password = APPSK;
+const char* ssid = APSSID;
+const char* password = APPSK;
 
 ESP8266WebServer server(80);
 
diff --git a/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino b/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino
index ef9016063b..5299765f62 100644
--- a/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino
@@ -7,10 +7,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 const char* host = "djxmmx.net";
diff --git a/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino b/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
index e442282e37..8723e7e8cd 100644
--- a/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
@@ -9,10 +9,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 const char* host = "192.168.1.1";
@@ -44,7 +44,6 @@ void setup() {
   delay(500);
 }
 
-
 void loop() {
   Serial.print("connecting to ");
   Serial.print(host);
@@ -75,4 +74,3 @@ void loop() {
   Serial.println("wait 5 sec...");
   delay(5000);
 }
-
diff --git a/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino b/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
index f902e019a9..b4761b46d2 100644
--- a/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
@@ -11,7 +11,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 constexpr int port = 23;
@@ -19,7 +19,7 @@ constexpr int port = 23;
 WiFiServer server(port);
 WiFiClient client;
 
-constexpr size_t sizes [] = { 0, 512, 384, 256, 128, 64, 16, 8, 4 };
+constexpr size_t sizes[] = { 0, 512, 384, 256, 128, 64, 16, 8, 4 };
 constexpr uint32_t breathMs = 200;
 esp8266::polledTimeout::oneShotFastMs enoughMs(breathMs);
 esp8266::polledTimeout::periodicFastMs test(2000);
@@ -51,10 +51,9 @@ void setup() {
                 "- Use 'telnet/nc echo23.local %d' to try echo\n\n"
                 "- Use 'python3 echo-client.py' bandwidth meter to compare transfer APIs\n\n"
                 "  and try typing 1, 1, 1, 2, 2, 2, 3, 3, 3 on console during transfers\n\n",
-                port);
+      port);
 }
 
-
 void loop() {
 
   MDNS.update();
@@ -84,10 +83,28 @@ void loop() {
   if (Serial.available()) {
     s = (s + 1) % (sizeof(sizes) / sizeof(sizes[0]));
     switch (Serial.read()) {
-      case '1': if (t != 1) s = 0; t = 1; Serial.println("byte-by-byte (watch then press 2, 3 or 4)"); break;
-      case '2': if (t != 2) s = 1; t = 2; Serial.printf("through buffer (watch then press 2 again, or 1, 3 or 4)\n"); break;
-      case '3': if (t != 3) s = 0; t = 3; Serial.printf("direct access (sendAvailable - watch then press 3 again, or 1, 2 or 4)\n"); break;
-      case '4':                    t = 4; Serial.printf("direct access (sendAll - close peer to stop, then press 1, 2 or 3 before restarting peer)\n"); break;
+      case '1':
+        if (t != 1)
+          s = 0;
+        t = 1;
+        Serial.println("byte-by-byte (watch then press 2, 3 or 4)");
+        break;
+      case '2':
+        if (t != 2)
+          s = 1;
+        t = 2;
+        Serial.printf("through buffer (watch then press 2 again, or 1, 3 or 4)\n");
+        break;
+      case '3':
+        if (t != 3)
+          s = 0;
+        t = 3;
+        Serial.printf("direct access (sendAvailable - watch then press 3 again, or 1, 2 or 4)\n");
+        break;
+      case '4':
+        t = 4;
+        Serial.printf("direct access (sendAll - close peer to stop, then press 1, 2 or 3 before restarting peer)\n");
+        break;
     }
     tot = cnt = 0;
     ESP.resetFreeContStack();
@@ -131,11 +148,20 @@ void loop() {
     cnt++;
 
     switch (client.getLastSendReport()) {
-      case Stream::Report::Success: break;
-      case Stream::Report::TimedOut: Serial.println("Stream::send: timeout"); break;
-      case Stream::Report::ReadError: Serial.println("Stream::send: read error"); break;
-      case Stream::Report::WriteError: Serial.println("Stream::send: write error"); break;
-      case Stream::Report::ShortOperation: Serial.println("Stream::send: short transfer"); break;
+      case Stream::Report::Success:
+        break;
+      case Stream::Report::TimedOut:
+        Serial.println("Stream::send: timeout");
+        break;
+      case Stream::Report::ReadError:
+        Serial.println("Stream::send: read error");
+        break;
+      case Stream::Report::WriteError:
+        Serial.println("Stream::send: write error");
+        break;
+      case Stream::Report::ShortOperation:
+        Serial.println("Stream::send: short transfer");
+        break;
     }
   }
 
@@ -145,12 +171,20 @@ void loop() {
     cnt++;
 
     switch (client.getLastSendReport()) {
-      case Stream::Report::Success: break;
-      case Stream::Report::TimedOut: Serial.println("Stream::send: timeout"); break;
-      case Stream::Report::ReadError: Serial.println("Stream::send: read error"); break;
-      case Stream::Report::WriteError: Serial.println("Stream::send: write error"); break;
-      case Stream::Report::ShortOperation: Serial.println("Stream::send: short transfer"); break;
+      case Stream::Report::Success:
+        break;
+      case Stream::Report::TimedOut:
+        Serial.println("Stream::send: timeout");
+        break;
+      case Stream::Report::ReadError:
+        Serial.println("Stream::send: read error");
+        break;
+      case Stream::Report::WriteError:
+        Serial.println("Stream::send: write error");
+        break;
+      case Stream::Report::ShortOperation:
+        Serial.println("Stream::send: short transfer");
+        break;
     }
   }
-
 }
diff --git a/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino b/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
index d72985a9c1..70f8d06317 100644
--- a/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
@@ -18,10 +18,10 @@
 
 #ifndef APSSID
 #define APSSID "esp8266"
-#define APPSK  "esp8266"
+#define APPSK "esp8266"
 #endif
 
-const char* ssid     = APSSID;
+const char* ssid = APSSID;
 const char* password = APPSK;
 
 WiFiEventHandler stationConnectedHandler;
@@ -99,6 +99,6 @@ void loop() {
 String macToString(const unsigned char* mac) {
   char buf[20];
   snprintf(buf, sizeof(buf), "%02x:%02x:%02x:%02x:%02x:%02x",
-           mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+      mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
   return String(buf);
 }
diff --git a/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino b/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
index 56c04a3a53..e6b3160e18 100644
--- a/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
@@ -11,7 +11,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
diff --git a/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino b/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
index b546df4a7d..d7036e08c5 100644
--- a/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
@@ -41,14 +41,14 @@ void loop() {
       WiFi.getNetworkInfo(i, ssid, encryptionType, rssi, bssid, channel, hidden);
 
       Serial.printf(PSTR("  %02d: [CH %02d] [%02X:%02X:%02X:%02X:%02X:%02X] %ddBm %c %c %s\n"),
-                    i,
-                    channel,
-                    bssid[0], bssid[1], bssid[2],
-                    bssid[3], bssid[4], bssid[5],
-                    rssi,
-                    (encryptionType == ENC_TYPE_NONE) ? ' ' : '*',
-                    hidden ? 'H' : 'V',
-                    ssid.c_str());
+          i,
+          channel,
+          bssid[0], bssid[1], bssid[2],
+          bssid[3], bssid[4], bssid[5],
+          rssi,
+          (encryptionType == ENC_TYPE_NONE) ? ' ' : '*',
+          hidden ? 'H' : 'V',
+          ssid.c_str());
       yield();
     }
   } else {
diff --git a/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino b/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
index b03357c143..31fc10d757 100644
--- a/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
@@ -36,7 +36,7 @@ void setup() {
   // Here you can do whatever you need to do that doesn't need a WiFi connection.
   // ---
 
-  ESP.rtcUserMemoryRead(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t *>(&state), sizeof(state));
+  ESP.rtcUserMemoryRead(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t*>(&state), sizeof(state));
   unsigned long start = millis();
 
   if (!WiFi.resumeFromShutdown(state)
@@ -64,7 +64,7 @@ void setup() {
   // ---
 
   WiFi.shutdown(state);
-  ESP.rtcUserMemoryWrite(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t *>(&state), sizeof(state));
+  ESP.rtcUserMemoryWrite(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t*>(&state), sizeof(state));
 
   // ---
   // Here you can do whatever you need to do that doesn't need a WiFi connection anymore.
diff --git a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
index 7ddcdd6d07..b5ae8b2b10 100644
--- a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
@@ -24,7 +24,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 /*
@@ -64,7 +64,7 @@ SoftwareSerial* logger = nullptr;
 #define logger (&Serial1)
 #endif
 
-#define STACK_PROTECTOR  512 // bytes
+#define STACK_PROTECTOR 512 // bytes
 
 //how many clients should be able to telnet to this ESP8266
 #define MAX_SRV_CLIENTS 2
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino b/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
index 443d52e2bb..d8f1ece88d 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
@@ -25,25 +25,22 @@ constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO"; //
 // A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a default Kok set, but it can be replaced if desired.
 // All ESP-NOW keys below must match in an encrypted connection pair for encrypted communication to be possible.
 // Note that it is also possible to use Strings as key seeds instead of arrays.
-uint8_t espnowEncryptedConnectionKey[16] = {0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting transmissions of encrypted connections.
-                                            0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11
-                                           };
-uint8_t espnowEncryptionKok[16] = {0x22, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting the encrypted connection key.
-                                   0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x33
-                                  };
-uint8_t espnowHashKey[16] = {0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44, // This is the secret key used for HMAC during encrypted connection requests.
-                             0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD
-                            };
+uint8_t espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting transmissions of encrypted connections.
+  0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11 };
+uint8_t espnowEncryptionKok[16] = { 0x22, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting the encrypted connection key.
+  0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x33 };
+uint8_t espnowHashKey[16] = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44, // This is the secret key used for HMAC during encrypted connection requests.
+  0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD };
 
 unsigned int requestNumber = 0;
 unsigned int responseNumber = 0;
 
 const char broadcastMetadataDelimiter = 23; // 23 = End-of-Transmission-Block (ETB) control character in ASCII
 
-String manageRequest(const String &request, MeshBackendBase &meshInstance);
-TransmissionStatusType manageResponse(const String &response, MeshBackendBase &meshInstance);
-void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance);
-bool broadcastFilter(String &firstTransmission, EspnowMeshBackend &meshInstance);
+String manageRequest(const String& request, MeshBackendBase& meshInstance);
+TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance);
+void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance);
+bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance);
 
 /* Create the mesh node object */
 EspnowMeshBackend espnowNode = EspnowMeshBackend(manageRequest, manageResponse, networkFilter, broadcastFilter, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
@@ -55,12 +52,12 @@ EspnowMeshBackend espnowNode = EspnowMeshBackend(manageRequest, manageResponse,
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
 */
-String manageRequest(const String &request, MeshBackendBase &meshInstance) {
+String manageRequest(const String& request, MeshBackendBase& meshInstance) {
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
+  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
     (void)tcpIpInstance; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
     Serial.print(F("TCP/IP: "));
   } else {
@@ -74,7 +71,7 @@ String manageRequest(const String &request, MeshBackendBase &meshInstance) {
   Serial.print(F("Request received: "));
 
   if (request.charAt(0) == 0) {
-    Serial.println(request);  // substring will not work for multiStrings.
+    Serial.println(request); // substring will not work for multiStrings.
   } else {
     Serial.println(request.substring(0, 100));
   }
@@ -90,14 +87,14 @@ String manageRequest(const String &request, MeshBackendBase &meshInstance) {
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The status code resulting from the response, as an int
 */
-TransmissionStatusType manageResponse(const String &response, MeshBackendBase &meshInstance) {
+TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance) {
   TransmissionStatusType statusCode = TransmissionStatusType::TRANSMISSION_COMPLETE;
 
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
+  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
     Serial.print(F("TCP/IP: "));
 
     // Getting the sent message like this will work as long as ONLY(!) TCP/IP is used.
@@ -126,7 +123,7 @@ TransmissionStatusType manageResponse(const String &response, MeshBackendBase &m
    @param numberOfNetworks The number of networks found in the WiFi scan.
    @param meshInstance The MeshBackendBase instance that called the function.
 */
-void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance) {
+void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
   // Note that the network index of a given node may change whenever a new scan is done.
   for (int networkIndex = 0; networkIndex < numberOfNetworks; ++networkIndex) {
     String currentSSID = WiFi.SSID(networkIndex);
@@ -137,9 +134,9 @@ void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance) {
       uint64_t targetNodeID = TypeCast::stringToUint64(currentSSID.substring(meshNameIndex + meshInstance.getMeshName().length()));
 
       if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID())) {
-        if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
+        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
           espnowInstance->connectionQueue().emplace_back(networkIndex);
-        } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
+        } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
           tcpIpInstance->connectionQueue().emplace_back(networkIndex);
         } else {
           Serial.println(F("Invalid mesh backend!"));
@@ -161,14 +158,14 @@ void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance) {
 
    @return True if the broadcast should be accepted. False otherwise.
 */
-bool broadcastFilter(String &firstTransmission, EspnowMeshBackend &meshInstance) {
+bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance) {
   // This example broadcastFilter will accept a transmission if it contains the broadcastMetadataDelimiter
   // and as metaData either no targetMeshName or a targetMeshName that matches the MeshName of meshInstance.
 
   int32_t metadataEndIndex = firstTransmission.indexOf(broadcastMetadataDelimiter);
 
   if (metadataEndIndex == -1) {
-    return false;  // broadcastMetadataDelimiter not found
+    return false; // broadcastMetadataDelimiter not found
   }
 
   String targetMeshName = firstTransmission.substring(0, metadataEndIndex);
@@ -195,7 +192,7 @@ bool broadcastFilter(String &firstTransmission, EspnowMeshBackend &meshInstance)
 
    @return True if attemptTransmission should continue with the next entry in the connectionQueue. False if attemptTransmission should stop.
 */
-bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase &meshInstance) {
+bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
   // Currently this is exactly the same as the default hook, but you can modify it to alter the behaviour of attemptTransmission.
 
   (void)meshInstance; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
@@ -218,7 +215,7 @@ bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase &meshInstance) {
    @return True if the response transmission process should continue with the next response in the waiting list.
            False if the response transmission process should stop once processing of the just sent response is complete.
 */
-bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String &response, const uint8_t *recipientMac, uint32_t responseIndex, EspnowMeshBackend &meshInstance) {
+bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String& response, const uint8_t* recipientMac, uint32_t responseIndex, EspnowMeshBackend& meshInstance) {
   // Currently this is exactly the same as the default hook, but you can modify it to alter the behaviour of sendEspnowResponses.
 
   (void)transmissionSuccessful; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
@@ -318,7 +315,7 @@ void loop() {
     if (espnowNode.latestTransmissionOutcomes().empty()) {
       Serial.println(F("No mesh AP found."));
     } else {
-      for (TransmissionOutcome &transmissionOutcome : espnowNode.latestTransmissionOutcomes()) {
+      for (TransmissionOutcome& transmissionOutcome : espnowNode.latestTransmissionOutcomes()) {
         if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED) {
           Serial.println(String(F("Transmission failed to mesh AP ")) + transmissionOutcome.SSID());
         } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED) {
@@ -348,7 +345,7 @@ void loop() {
       // If you have a data array containing null values it is possible to transmit the raw data by making the array into a multiString as shown below.
       // You can use String::c_str() or String::begin() to retrieve the data array later.
       // Note that certain String methods such as String::substring use null values to determine String length, which means they will not work as normal with multiStrings.
-      uint8_t dataArray[] = {0, '\'', 0, '\'', ' ', '(', 'n', 'u', 'l', 'l', ')', ' ', 'v', 'a', 'l', 'u', 'e'};
+      uint8_t dataArray[] = { 0, '\'', 0, '\'', ' ', '(', 'n', 'u', 'l', 'l', ')', ' ', 'v', 'a', 'l', 'u', 'e' };
       String espnowMessage = TypeCast::uint8ArrayToMultiString(dataArray, sizeof dataArray) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
       Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
       espnowNode.attemptTransmission(espnowMessage, false);
@@ -356,7 +353,7 @@ void loop() {
 
       Serial.println(F("\nPerforming encrypted ESP-NOW transmissions."));
 
-      uint8_t targetBSSID[6] {0};
+      uint8_t targetBSSID[6] { 0 };
 
       // We can create encrypted connections to individual nodes so that all ESP-NOW communication with the node will be encrypted.
       if (espnowNode.constConnectionQueue()[0].getBSSID(targetBSSID) && espnowNode.requestEncryptedConnection(targetBSSID) == EncryptedConnectionStatus::CONNECTION_ESTABLISHED) {
@@ -434,7 +431,7 @@ void loop() {
           espnowNode.attemptAutoEncryptingTransmission(espnowMessage);
           espnowDelay(100); // Wait for response.
         } else {
-          Serial.println(String(F("Ooops! Encrypted connection removal failed. Status: ")) +  String(static_cast<int>(removalOutcome)));
+          Serial.println(String(F("Ooops! Encrypted connection removal failed. Status: ")) + String(static_cast<int>(removalOutcome)));
         }
 
         // Finally, should you ever want to stop other parties from sending unencrypted messages to the node
@@ -446,7 +443,7 @@ void loop() {
 
       // Our last request was sent to all nodes found, so time to create a new request.
       espnowNode.setMessage(String(F("Hello world request #")) + String(++requestNumber) + F(" from ")
-                            + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.'));
+          + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.'));
     }
 
     Serial.println();
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino b/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
index 3ae8567e16..b70b41b8c4 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
@@ -34,14 +34,12 @@ constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO"; //
 // A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a default Kok set, but it can be replaced if desired.
 // All ESP-NOW keys below must match in an encrypted connection pair for encrypted communication to be possible.
 // Note that it is also possible to use Strings as key seeds instead of arrays.
-uint8_t espnowEncryptedConnectionKey[16] = {0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting transmissions of encrypted connections.
-                                            0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11
-                                           };
-uint8_t espnowHashKey[16] = {0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44, // This is the secret key used for HMAC during encrypted connection requests.
-                             0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD
-                            };
+uint8_t espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting transmissions of encrypted connections.
+  0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11 };
+uint8_t espnowHashKey[16] = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44, // This is the secret key used for HMAC during encrypted connection requests.
+  0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD };
 
-bool meshMessageHandler(String &message, FloodingMesh &meshInstance);
+bool meshMessageHandler(String& message, FloodingMesh& meshInstance);
 
 /* Create the mesh node object */
 FloodingMesh floodingMesh = FloodingMesh(meshMessageHandler, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
@@ -62,7 +60,7 @@ bool useLED = false; // Change this to true if you wish the onboard LED to mark
    @param meshInstance The FloodingMesh instance that received the message.
    @return True if this node should forward the received message to other nodes. False otherwise.
 */
-bool meshMessageHandler(String &message, FloodingMesh &meshInstance) {
+bool meshMessageHandler(String& message, FloodingMesh& meshInstance) {
   int32_t delimiterIndex = message.indexOf(meshInstance.metadataDelimiter());
   if (delimiterIndex == 0) {
     Serial.print(String(F("Message received from STA MAC ")) + meshInstance.getEspnowMeshBackend().getSenderMac() + F(": "));
@@ -138,7 +136,7 @@ void setup() {
   floodingMesh.begin();
   floodingMesh.activateAP(); // Required to receive messages
 
-  uint8_t apMacArray[6] {0};
+  uint8_t apMacArray[6] { 0 };
   theOneMac = TypeCast::macToString(WiFi.softAPmacAddress(apMacArray));
 
   if (useLED) {
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino b/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
index f68b81f181..f8c3b6a9f8 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
@@ -25,9 +25,9 @@ constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO"; //
 unsigned int requestNumber = 0;
 unsigned int responseNumber = 0;
 
-String manageRequest(const String &request, MeshBackendBase &meshInstance);
-TransmissionStatusType manageResponse(const String &response, MeshBackendBase &meshInstance);
-void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance);
+String manageRequest(const String& request, MeshBackendBase& meshInstance);
+TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance);
+void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance);
 
 /* Create the mesh node object */
 TcpIpMeshBackend tcpIpNode = TcpIpMeshBackend(manageRequest, manageResponse, networkFilter, FPSTR(exampleWiFiPassword), FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
@@ -39,12 +39,12 @@ TcpIpMeshBackend tcpIpNode = TcpIpMeshBackend(manageRequest, manageResponse, net
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
 */
-String manageRequest(const String &request, MeshBackendBase &meshInstance) {
+String manageRequest(const String& request, MeshBackendBase& meshInstance) {
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
+  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
     (void)tcpIpInstance; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
     Serial.print(F("TCP/IP: "));
   } else {
@@ -69,14 +69,14 @@ String manageRequest(const String &request, MeshBackendBase &meshInstance) {
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The status code resulting from the response, as an int
 */
-TransmissionStatusType manageResponse(const String &response, MeshBackendBase &meshInstance) {
+TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance) {
   TransmissionStatusType statusCode = TransmissionStatusType::TRANSMISSION_COMPLETE;
 
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
+  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
     Serial.print(F("TCP/IP: "));
 
     // Getting the sent message like this will work as long as ONLY(!) TCP/IP is used.
@@ -105,7 +105,7 @@ TransmissionStatusType manageResponse(const String &response, MeshBackendBase &m
    @param numberOfNetworks The number of networks found in the WiFi scan.
    @param meshInstance The MeshBackendBase instance that called the function.
 */
-void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance) {
+void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
   // Note that the network index of a given node may change whenever a new scan is done.
   for (int networkIndex = 0; networkIndex < numberOfNetworks; ++networkIndex) {
     String currentSSID = WiFi.SSID(networkIndex);
@@ -116,9 +116,9 @@ void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance) {
       uint64_t targetNodeID = TypeCast::stringToUint64(currentSSID.substring(meshNameIndex + meshInstance.getMeshName().length()));
 
       if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID())) {
-        if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
+        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
           espnowInstance->connectionQueue().emplace_back(networkIndex);
-        } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
+        } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
           tcpIpInstance->connectionQueue().emplace_back(networkIndex);
         } else {
           Serial.println(F("Invalid mesh backend!"));
@@ -139,14 +139,14 @@ void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance) {
 
    @return True if attemptTransmission should continue with the next entry in the connectionQueue. False if attemptTransmission should stop.
 */
-bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase &meshInstance) {
+bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
   // The default hook only returns true and does nothing else.
 
-  if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
+  if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
     if (tcpIpInstance->latestTransmissionOutcomes().back().transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE) {
       // Our last request got a response, so time to create a new request.
       meshInstance.setMessage(String(F("Hello world request #")) + String(++requestNumber) + F(" from ")
-                              + meshInstance.getMeshName() + meshInstance.getNodeID() + String('.'));
+          + meshInstance.getMeshName() + meshInstance.getNodeID() + String('.'));
     }
   } else {
     Serial.println(F("Invalid mesh backend!"));
@@ -202,7 +202,7 @@ void loop() {
     if (tcpIpNode.latestTransmissionOutcomes().empty()) {
       Serial.println(F("No mesh AP found."));
     } else {
-      for (TransmissionOutcome &transmissionOutcome : tcpIpNode.latestTransmissionOutcomes()) {
+      for (TransmissionOutcome& transmissionOutcome : tcpIpNode.latestTransmissionOutcomes()) {
         if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED) {
           Serial.println(String(F("Transmission failed to mesh AP ")) + transmissionOutcome.SSID());
         } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED) {
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino b/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
index 19c555a235..6f8e93dec4 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
@@ -15,7 +15,7 @@
 
 #ifndef APSSID
 #define APSSID "APSSID"
-#define APPSK  "APPSK"
+#define APPSK "APPSK"
 #endif
 
 ESP8266WiFiMulti WiFiMulti;
@@ -37,8 +37,6 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP(APSSID, APPSK);
-
-
 }
 
 void update_started() {
@@ -57,7 +55,6 @@ void update_error(int err) {
   Serial.printf("CALLBACK:  HTTP update fatal error code %d\n", err);
 }
 
-
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
@@ -97,4 +94,3 @@ void loop() {
     }
   }
 }
-
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
index 6541d047fd..22f6e65260 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
@@ -17,7 +17,7 @@ ESP8266WiFiMulti WiFiMulti;
 
 #ifndef APSSID
 #define APSSID "APSSID"
-#define APPSK  "APPSK"
+#define APPSK "APPSK"
 #endif
 
 void setup() {
@@ -37,7 +37,6 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP(APSSID, APPSK);
-
 }
 
 void loop() {
@@ -77,4 +76,3 @@ void loop() {
     }
   }
 }
-
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
index beb613897c..0353126ef2 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
@@ -18,7 +18,7 @@
 
 #ifndef APSSID
 #define APSSID "APSSID"
-#define APPSK  "APPSK"
+#define APPSK "APPSK"
 #endif
 
 ESP8266WiFiMulti WiFiMulti;
@@ -31,7 +31,7 @@ BearSSL::CertStore certStore;
 
 // Set time via NTP, as required for x.509 validation
 void setClock() {
-  configTime(0, 0, "pool.ntp.org", "time.nist.gov");  // UTC
+  configTime(0, 0, "pool.ntp.org", "time.nist.gov"); // UTC
 
   Serial.print(F("Waiting for NTP time sync: "));
   time_t now = time(nullptr);
@@ -85,7 +85,7 @@ void loop() {
     setClock();
 
     BearSSL::WiFiClientSecure client;
-    bool mfln = client.probeMaxFragmentLength("server", 443, 1024);  // server must be the same as in ESPhttpUpdate.update()
+    bool mfln = client.probeMaxFragmentLength("server", 443, 1024); // server must be the same as in ESPhttpUpdate.update()
     Serial.printf("MFLN supported: %s\n", mfln ? "yes" : "no");
     if (mfln) {
       client.setBufferSizes(1024, 1024);
@@ -104,7 +104,6 @@ void loop() {
     // Or:
     //t_httpUpdate_return ret = ESPhttpUpdate.update(client, "server", 443, "file.bin");
 
-
     switch (ret) {
       case HTTP_UPDATE_FAILED:
         Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s\n", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
index e196ef6419..c7580950a6 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
@@ -23,7 +23,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 ESP8266WiFiMulti WiFiMulti;
@@ -50,9 +50,9 @@ TQIDAQAB
 -----END PUBLIC KEY-----
 )EOF";
 #if MANUAL_SIGNING
-BearSSL::PublicKey *signPubKey = nullptr;
-BearSSL::HashSHA256 *hash;
-BearSSL::SigningVerifier *sign;
+BearSSL::PublicKey* signPubKey = nullptr;
+BearSSL::HashSHA256* hash;
+BearSSL::SigningVerifier* sign;
 #endif
 
 void setup() {
@@ -73,24 +73,23 @@ void setup() {
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP(STASSID, STAPSK);
 
-  #if MANUAL_SIGNING
+#if MANUAL_SIGNING
   signPubKey = new BearSSL::PublicKey(pubkey);
   hash = new BearSSL::HashSHA256();
   sign = new BearSSL::SigningVerifier(signPubKey);
-  #endif
+#endif
 }
 
-
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
 
     WiFiClient client;
 
-    #if MANUAL_SIGNING
+#if MANUAL_SIGNING
     // Ensure all updates are signed appropriately.  W/o this call, all will be accepted.
     Update.installSignature(hash, sign);
-    #endif
+#endif
     // If the key files are present in the build directory, signing will be
     // enabled using them automatically
 
@@ -114,4 +113,3 @@ void loop() {
   }
   delay(10000);
 }
-
diff --git a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
index f0a9de1225..b5748bf331 100644
--- a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
+++ b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
@@ -31,7 +31,6 @@
 
 */
 
-
 #include <ESP8266WiFi.h>
 #include <WiFiClient.h>
 #include <ESP8266WebServer.h>
@@ -43,44 +42,42 @@
    Global defines and vars
 */
 
-#define TIMEZONE_OFFSET     1                                   // CET
-#define DST_OFFSET          1                                   // CEST
-#define UPDATE_CYCLE        (1 * 1000)                          // every second
+#define TIMEZONE_OFFSET 1 // CET
+#define DST_OFFSET 1 // CEST
+#define UPDATE_CYCLE (1 * 1000) // every second
 
-#define SERVICE_PORT        80                                  // HTTP port
+#define SERVICE_PORT 80 // HTTP port
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char*                   ssid                    = STASSID;
-const char*                   password                = STAPSK;
+const char* ssid = STASSID;
+const char* password = STAPSK;
 
-char*                         pcHostDomain            = 0;        // Negotiated host domain
-bool                          bHostDomainConfirmed    = false;    // Flags the confirmation of the host domain
-MDNSResponder::hMDNSService   hMDNSService            = 0;        // The handle of the clock service in the MDNS responder
+char* pcHostDomain = 0; // Negotiated host domain
+bool bHostDomainConfirmed = false; // Flags the confirmation of the host domain
+MDNSResponder::hMDNSService hMDNSService = 0; // The handle of the clock service in the MDNS responder
 
 // HTTP server at port 'SERVICE_PORT' will respond to HTTP requests
-ESP8266WebServer              server(SERVICE_PORT);
+ESP8266WebServer server(SERVICE_PORT);
 
 /*
    getTimeString
 */
 const char* getTimeString(void) {
 
-  static char   acTimeString[32];
+  static char acTimeString[32];
   time_t now = time(nullptr);
   ctime_r(&now, acTimeString);
-  size_t    stLength;
-  while (((stLength = strlen(acTimeString))) &&
-         ('\n' == acTimeString[stLength - 1])) {
+  size_t stLength;
+  while (((stLength = strlen(acTimeString))) && ('\n' == acTimeString[stLength - 1])) {
     acTimeString[stLength - 1] = 0; // Remove trailing line break...
   }
   return acTimeString;
 }
 
-
 /*
    setClock
 
@@ -90,8 +87,8 @@ void setClock(void) {
   configTime((TIMEZONE_OFFSET * 3600), (DST_OFFSET * 3600), "pool.ntp.org", "time.nist.gov", "time.windows.com");
 
   Serial.print("Waiting for NTP time sync: ");
-  time_t now = time(nullptr);   // Secs since 01.01.1970 (when uninitialized starts with (8 * 3600 = 28800)
-  while (now < 8 * 3600 * 2) {  // Wait for realistic value
+  time_t now = time(nullptr); // Secs since 01.01.1970 (when uninitialized starts with (8 * 3600 = 28800)
+  while (now < 8 * 3600 * 2) { // Wait for realistic value
     delay(500);
     Serial.print(".");
     now = time(nullptr);
@@ -100,7 +97,6 @@ void setClock(void) {
   Serial.printf("Current time: %s\n", getTimeString());
 }
 
-
 /*
    setStationHostname
 */
@@ -113,7 +109,6 @@ bool setStationHostname(const char* p_pcHostname) {
   return true;
 }
 
-
 /*
    MDNSDynamicServiceTxtCallback
 
@@ -132,7 +127,6 @@ void MDNSDynamicServiceTxtCallback(const MDNSResponder::hMDNSService p_hService)
   }
 }
 
-
 /*
    MDNSProbeResultCallback
 
@@ -176,7 +170,6 @@ void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
   }
 }
 
-
 /*
    handleHTTPClient
 */
@@ -186,7 +179,8 @@ void handleHTTPRequest() {
   Serial.println("HTTP Request");
 
   // Get current time
-  time_t now = time(nullptr);;
+  time_t now = time(nullptr);
+  ;
   struct tm timeinfo;
   gmtime_r(&now, &timeinfo);
 
@@ -231,8 +225,7 @@ void setup(void) {
   // Setup MDNS responder
   MDNS.setHostProbeResultCallback(hostProbeResult);
   // Init the (currently empty) host domain string with 'esp8266'
-  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) ||
-      (!MDNS.begin(pcHostDomain))) {
+  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) || (!MDNS.begin(pcHostDomain))) {
     Serial.println("Error setting up MDNS responder!");
     while (1) { // STOP
       delay(1000);
diff --git a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
index 17b29ec57c..4724762b4d 100644
--- a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
+++ b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
@@ -29,7 +29,6 @@
 
 */
 
-
 #include <ESP8266WiFi.h>
 #include <WiFiClient.h>
 #include <ESP8266WebServer.h>
@@ -39,27 +38,26 @@
    Global defines and vars
 */
 
-#define SERVICE_PORT                                    80                                  // HTTP port
+#define SERVICE_PORT 80 // HTTP port
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char*                                    ssid                    = STASSID;
-const char*                                    password                = STAPSK;
+const char* ssid = STASSID;
+const char* password = STAPSK;
 
-char*                                          pcHostDomain            = 0;        // Negotiated host domain
-bool                                           bHostDomainConfirmed    = false;    // Flags the confirmation of the host domain
-MDNSResponder::hMDNSService                    hMDNSService            = 0;        // The handle of the http service in the MDNS responder
-MDNSResponder::hMDNSServiceQuery               hMDNSServiceQuery       = 0;        // The handle of the 'http.tcp' service query in the MDNS responder
+char* pcHostDomain = 0; // Negotiated host domain
+bool bHostDomainConfirmed = false; // Flags the confirmation of the host domain
+MDNSResponder::hMDNSService hMDNSService = 0; // The handle of the http service in the MDNS responder
+MDNSResponder::hMDNSServiceQuery hMDNSServiceQuery = 0; // The handle of the 'http.tcp' service query in the MDNS responder
 
-const String                                   cstrNoHTTPServices      = "Currently no 'http.tcp' services in the local network!<br/>";
-String                                         strHTTPServices         = cstrNoHTTPServices;
+const String cstrNoHTTPServices = "Currently no 'http.tcp' services in the local network!<br/>";
+String strHTTPServices = cstrNoHTTPServices;
 
 // HTTP server at port 'SERVICE_PORT' will respond to HTTP requests
-ESP8266WebServer                                     server(SERVICE_PORT);
-
+ESP8266WebServer server(SERVICE_PORT);
 
 /*
    setStationHostname
@@ -80,25 +78,25 @@ bool setStationHostname(const char* p_pcHostname) {
 void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSResponder::AnswerType answerType, bool p_bSetContent) {
   String answerInfo;
   switch (answerType) {
-    case MDNSResponder::AnswerType::ServiceDomain :
+    case MDNSResponder::AnswerType::ServiceDomain:
       answerInfo = "ServiceDomain " + String(serviceInfo.serviceDomain());
       break;
-    case MDNSResponder::AnswerType::HostDomainAndPort :
+    case MDNSResponder::AnswerType::HostDomainAndPort:
       answerInfo = "HostDomainAndPort " + String(serviceInfo.hostDomain()) + ":" + String(serviceInfo.hostPort());
       break;
-    case MDNSResponder::AnswerType::IP4Address :
+    case MDNSResponder::AnswerType::IP4Address:
       answerInfo = "IP4Address ";
       for (IPAddress ip : serviceInfo.IP4Adresses()) {
         answerInfo += "- " + ip.toString();
       };
       break;
-    case MDNSResponder::AnswerType::Txt :
+    case MDNSResponder::AnswerType::Txt:
       answerInfo = "TXT " + String(serviceInfo.strKeyValue());
       for (auto kv : serviceInfo.keyValues()) {
         answerInfo += "\nkv : " + String(kv.first) + " : " + String(kv.second);
       }
       break;
-    default :
+    default:
       answerInfo = "Unknown Answertype";
   }
   Serial.printf("Answer %s %s\n", answerInfo.c_str(), p_bSetContent ? "Modified" : "Deleted");
@@ -110,9 +108,9 @@ void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSRe
 */
 
 void serviceProbeResult(String p_pcServiceName,
-                        const MDNSResponder::hMDNSService p_hMDNSService,
-                        bool p_bProbeResult) {
-  (void) p_hMDNSService;
+    const MDNSResponder::hMDNSService p_hMDNSService,
+    bool p_bProbeResult) {
+  (void)p_hMDNSService;
   Serial.printf("MDNSServiceProbeResultCallback: Service %s probe %s\n", p_pcServiceName.c_str(), (p_bProbeResult ? "succeeded." : "failed!"));
 }
 
@@ -186,7 +184,7 @@ void handleHTTPRequest() {
   s += WiFi.hostname() + ".local at " + WiFi.localIP().toString() + "</h3></head>";
   s += "<br/><h4>Local HTTP services are :</h4>";
   s += "<ol>";
-  for (auto info :  MDNS.answerInfo(hMDNSServiceQuery)) {
+  for (auto info : MDNS.answerInfo(hMDNSServiceQuery)) {
     s += "<li>";
     s += info.serviceDomain();
     if (info.hostDomainAvailable()) {
@@ -245,8 +243,7 @@ void setup(void) {
   MDNS.setHostProbeResultCallback(hostProbeResult);
 
   // Init the (currently empty) host domain string with 'esp8266'
-  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) ||
-      (!MDNS.begin(pcHostDomain))) {
+  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) || (!MDNS.begin(pcHostDomain))) {
     Serial.println(" Error setting up MDNS responder!");
     while (1) { // STOP
       delay(1000);
@@ -265,6 +262,3 @@ void loop(void) {
   // Allow MDNS processing
   MDNS.update();
 }
-
-
-
diff --git a/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino b/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
index 87d03900f3..97364eb729 100644
--- a/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
+++ b/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
@@ -14,12 +14,12 @@
 
 #ifndef APSSID
 #define APSSID "your-apssid"
-#define APPSK  "your-password"
+#define APPSK "your-password"
 #endif
 
 #ifndef STASSID
 #define STASSID "your-sta"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 // includes
@@ -30,7 +30,6 @@
 #include <ArduinoOTA.h>
 #include <ESP8266mDNS.h>
 
-
 /**
    @brief mDNS and OTA Constants
    @{
@@ -59,7 +58,7 @@ const char* ap_default_psk = APPSK; ///< Default PSK.
    and the WiFi PSK in the second line.
    Line separator can be \r\n (CR LF) \r or \n.
 */
-bool loadConfig(String *ssid, String *pass) {
+bool loadConfig(String* ssid, String* pass) {
   // open file for reading.
   File configFile = LittleFS.open("/cl_conf.txt", "r");
   if (!configFile) {
@@ -112,14 +111,13 @@ bool loadConfig(String *ssid, String *pass) {
   return true;
 } // loadConfig
 
-
 /**
    @brief Save WiFi SSID and PSK to configuration file.
    @param ssid SSID as string pointer.
    @param pass PSK as string pointer,
    @return True or False.
 */
-bool saveConfig(String *ssid, String *pass) {
+bool saveConfig(String* ssid, String* pass) {
   // Open config file for writing.
   File configFile = LittleFS.open("/cl_conf.txt", "w");
   if (!configFile) {
@@ -137,7 +135,6 @@ bool saveConfig(String *ssid, String *pass) {
   return true;
 } // saveConfig
 
-
 /**
    @brief Arduino setup function.
 */
@@ -162,7 +159,6 @@ void setup() {
   Serial.println("Hostname: " + hostname);
   //Serial.println(WiFi.hostname());
 
-
   // Initialize file system.
   if (!LittleFS.begin()) {
     Serial.println("Failed to mount file system");
@@ -170,7 +166,7 @@ void setup() {
   }
 
   // Load wifi connection information.
-  if (! loadConfig(&station_ssid, &station_psk)) {
+  if (!loadConfig(&station_ssid, &station_psk)) {
     station_ssid = STASSID;
     station_psk = STAPSK;
 
@@ -233,11 +229,10 @@ void setup() {
   }
 
   // Start OTA server.
-  ArduinoOTA.setHostname((const char *)hostname.c_str());
+  ArduinoOTA.setHostname((const char*)hostname.c_str());
   ArduinoOTA.begin();
 }
 
-
 /**
    @brief Arduino loop function.
 */
@@ -245,4 +240,3 @@ void loop() {
   // Handle OTA server.
   ArduinoOTA.handle();
 }
-
diff --git a/libraries/ESP8266mDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino b/libraries/ESP8266mDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino
index fda2fe6562..0a43ca3e85 100644
--- a/libraries/ESP8266mDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino
+++ b/libraries/ESP8266mDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino
@@ -14,12 +14,12 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
-char hostString[16] = {0};
+char hostString[16] = { 0 };
 
 void setup() {
   Serial.begin(115200);
diff --git a/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino b/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
index e85714d821..3f65e361de 100644
--- a/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
+++ b/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
@@ -15,14 +15,13 @@
 
 */
 
-
 #include <ESP8266WiFi.h>
 #include <ESP8266mDNS.h>
 #include <WiFiClient.h>
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
@@ -121,4 +120,3 @@ void loop(void) {
 
   Serial.println("Done with client");
 }
-
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.cpp b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
index 611c3dfc38..910884ae5d 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
@@ -48,35 +48,35 @@ namespace MDNSImplementation
 #define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
 #endif
 
-/**
+    /**
     INTERFACE
 */
 
-/**
+    /**
     MDNSResponder::MDNSResponder
 */
-MDNSResponder::MDNSResponder(void)
-    : m_pServices(0),
-      m_pUDPContext(0),
-      m_pcHostname(0),
-      m_pServiceQueries(0),
-      m_fnServiceTxtCallback(0)
-{
-}
+    MDNSResponder::MDNSResponder(void)
+        : m_pServices(0)
+        , m_pUDPContext(0)
+        , m_pcHostname(0)
+        , m_pServiceQueries(0)
+        , m_fnServiceTxtCallback(0)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::~MDNSResponder
 */
-MDNSResponder::~MDNSResponder(void)
-{
-    _resetProbeStatus(false);
-    _releaseServiceQueries();
-    _releaseHostname();
-    _releaseUDPContext();
-    _releaseServices();
-}
+    MDNSResponder::~MDNSResponder(void)
+    {
+        _resetProbeStatus(false);
+        _releaseServiceQueries();
+        _releaseHostname();
+        _releaseUDPContext();
+        _releaseServices();
+    }
 
-/*
+    /*
     MDNSResponder::begin
 
     Set the host domain (for probing) and install WiFi event handlers for
@@ -85,60 +85,60 @@ MDNSResponder::~MDNSResponder(void)
     Finally the responder is (re)started
 
 */
-bool MDNSResponder::begin(const char* p_pcHostname, const IPAddress& /*p_IPAddress*/, uint32_t /*p_u32TTL*/)
-{
-    bool bResult = false;
-
-    if (_setHostname(p_pcHostname))
+    bool MDNSResponder::begin(const char* p_pcHostname, const IPAddress& /*p_IPAddress*/, uint32_t /*p_u32TTL*/)
     {
-        bResult = _restart();
-    }
+        bool bResult = false;
 
-    LwipIntf::stateUpCB(
-        [this](netif* intf)
+        if (_setHostname(p_pcHostname))
         {
-            (void)intf;
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] new Interface '%c%c' is UP! restarting\n"), intf->name[0], intf->name[1]));
-            _restart();
-        });
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] begin: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
-                 });
-
-    return bResult;
-}
+            bResult = _restart();
+        }
 
-/*
+        LwipIntf::stateUpCB(
+            [this](netif* intf)
+            {
+                (void)intf;
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] new Interface '%c%c' is UP! restarting\n"), intf->name[0], intf->name[1]));
+                _restart();
+            });
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] begin: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
+            });
+
+        return bResult;
+    }
+
+    /*
     MDNSResponder::close
 
     Ends the MDNS responder.
     Announced services are unannounced (by multicasting a goodbye message)
 
 */
-bool MDNSResponder::close(void)
-{
-    bool bResult = false;
-
-    if (0 != m_pUDPContext)
+    bool MDNSResponder::close(void)
     {
-        _announce(false, true);
-        _resetProbeStatus(false);  // Stop probing
-        _releaseServiceQueries();
-        _releaseServices();
-        _releaseUDPContext();
-        _releaseHostname();
+        bool bResult = false;
 
-        bResult = true;
-    }
-    else
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] close: Ignoring call to close!\n")););
+        if (0 != m_pUDPContext)
+        {
+            _announce(false, true);
+            _resetProbeStatus(false);  // Stop probing
+            _releaseServiceQueries();
+            _releaseServices();
+            _releaseUDPContext();
+            _releaseHostname();
+
+            bResult = true;
+        }
+        else
+        {
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] close: Ignoring call to close!\n")););
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::end
 
     Ends the MDNS responder.
@@ -146,12 +146,12 @@ bool MDNSResponder::close(void)
 
 */
 
-bool MDNSResponder::end(void)
-{
-    return close();
-}
+    bool MDNSResponder::end(void)
+    {
+        return close();
+    }
 
-/*
+    /*
     MDNSResponder::setHostname
 
     Replaces the current hostname and restarts probing.
@@ -159,45 +159,45 @@ bool MDNSResponder::end(void)
     name), the instance names are replaced also (and the probing is restarted).
 
 */
-bool MDNSResponder::setHostname(const char* p_pcHostname)
-{
-    bool bResult = false;
-
-    if (_setHostname(p_pcHostname))
+    bool MDNSResponder::setHostname(const char* p_pcHostname)
     {
-        m_HostProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
+        bool bResult = false;
 
-        // Replace 'auto-set' service names
-        bResult = true;
-        for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+        if (_setHostname(p_pcHostname))
         {
-            if (pService->m_bAutoName)
+            m_HostProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
+
+            // Replace 'auto-set' service names
+            bResult = true;
+            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
             {
-                bResult = pService->setName(p_pcHostname);
-                pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
+                if (pService->m_bAutoName)
+                {
+                    bResult = pService->setName(p_pcHostname);
+                    pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
+                }
             }
         }
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setHostname: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
+            });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setHostname: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
-                 });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::setHostname (LEGACY)
 */
-bool MDNSResponder::setHostname(const String& p_strHostname)
-{
-    return setHostname(p_strHostname.c_str());
-}
+    bool MDNSResponder::setHostname(const String& p_strHostname)
+    {
+        return setHostname(p_strHostname.c_str());
+    }
 
-/*
+    /*
     SERVICES
 */
 
-/*
+    /*
     MDNSResponder::addService
 
     Add service; using hostname if no name is explicitly provided for the service
@@ -205,456 +205,447 @@ bool MDNSResponder::setHostname(const String& p_strHostname)
     may be given. If not, it is added automatically.
 
 */
-MDNSResponder::hMDNSService MDNSResponder::addService(const char* p_pcName,
-                                                      const char* p_pcService,
-                                                      const char* p_pcProtocol,
-                                                      uint16_t p_u16Port)
-{
-    hMDNSService hResult = 0;
-
-    if (((!p_pcName) ||                                            // NO name OR
-         (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcName))) &&  // Fitting name
-        (p_pcService) &&
-        (MDNS_SERVICE_NAME_LENGTH >= os_strlen(p_pcService)) &&
-        (p_pcProtocol) &&
-        ((MDNS_SERVICE_PROTOCOL_LENGTH - 1) != os_strlen(p_pcProtocol)) &&
-        (p_u16Port))
+    MDNSResponder::hMDNSService MDNSResponder::addService(const char* p_pcName,
+        const char* p_pcService,
+        const char* p_pcProtocol,
+        uint16_t p_u16Port)
     {
-        if (!_findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol))  // Not already used
+        hMDNSService hResult = 0;
+
+        if (((!p_pcName) ||  // NO name OR
+                (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcName)))
+            &&  // Fitting name
+            (p_pcService) && (MDNS_SERVICE_NAME_LENGTH >= os_strlen(p_pcService)) && (p_pcProtocol) && ((MDNS_SERVICE_PROTOCOL_LENGTH - 1) != os_strlen(p_pcProtocol)) && (p_u16Port))
         {
-            if (0 != (hResult = (hMDNSService)_allocService(p_pcName, p_pcService, p_pcProtocol, p_u16Port)))
+            if (!_findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol))  // Not already used
             {
-                // Start probing
-                ((stcMDNSService*)hResult)->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
+                if (0 != (hResult = (hMDNSService)_allocService(p_pcName, p_pcService, p_pcProtocol, p_u16Port)))
+                {
+                    // Start probing
+                    ((stcMDNSService*)hResult)->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
+                }
             }
-        }
-    }  // else: bad arguments
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: %s to add '%s.%s.%s'!\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcName ?: "-"), p_pcService, p_pcProtocol););
-    DEBUG_EX_ERR(if (!hResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: FAILED to add '%s.%s.%s'!\n"), (p_pcName ?: "-"), p_pcService, p_pcProtocol);
-                 });
-    return hResult;
-}
+        }  // else: bad arguments
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: %s to add '%s.%s.%s'!\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcName ?: "-"), p_pcService, p_pcProtocol););
+        DEBUG_EX_ERR(if (!hResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: FAILED to add '%s.%s.%s'!\n"), (p_pcName ?: "-"), p_pcService, p_pcProtocol);
+            });
+        return hResult;
+    }
 
-/*
+    /*
     MDNSResponder::removeService
 
     Unanounce a service (by sending a goodbye message) and remove it
     from the MDNS responder
 
 */
-bool MDNSResponder::removeService(const MDNSResponder::hMDNSService p_hService)
-{
-    stcMDNSService* pService = 0;
-    bool bResult = (((pService = _findService(p_hService))) &&
-                    (_announceService(*pService, false)) &&
-                    (_releaseService(pService)));
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeService: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::removeService(const MDNSResponder::hMDNSService p_hService)
+    {
+        stcMDNSService* pService = 0;
+        bool bResult = (((pService = _findService(p_hService))) && (_announceService(*pService, false)) && (_releaseService(pService)));
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeService: FAILED!\n"));
+            });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::removeService
 */
-bool MDNSResponder::removeService(const char* p_pcName,
-                                  const char* p_pcService,
-                                  const char* p_pcProtocol)
-{
-    return removeService((hMDNSService)_findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol));
-}
+    bool MDNSResponder::removeService(const char* p_pcName,
+        const char* p_pcService,
+        const char* p_pcProtocol)
+    {
+        return removeService((hMDNSService)_findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol));
+    }
 
-/*
+    /*
     MDNSResponder::addService (LEGACY)
 */
-bool MDNSResponder::addService(const String& p_strService,
-                               const String& p_strProtocol,
-                               uint16_t p_u16Port)
-{
-    return (0 != addService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str(), p_u16Port));
-}
+    bool MDNSResponder::addService(const String& p_strService,
+        const String& p_strProtocol,
+        uint16_t p_u16Port)
+    {
+        return (0 != addService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str(), p_u16Port));
+    }
 
-/*
+    /*
     MDNSResponder::setServiceName
 */
-bool MDNSResponder::setServiceName(const MDNSResponder::hMDNSService p_hService,
-                                   const char* p_pcInstanceName)
-{
-    stcMDNSService* pService = 0;
-    bool bResult = (((!p_pcInstanceName) ||
-                     (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcInstanceName))) &&
-                    ((pService = _findService(p_hService))) &&
-                    (pService->setName(p_pcInstanceName)) &&
-                    ((pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart)));
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setServiceName: FAILED for '%s'!\n"), (p_pcInstanceName ?: "-"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::setServiceName(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcInstanceName)
+    {
+        stcMDNSService* pService = 0;
+        bool bResult = (((!p_pcInstanceName) || (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcInstanceName))) && ((pService = _findService(p_hService))) && (pService->setName(p_pcInstanceName)) && ((pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart)));
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setServiceName: FAILED for '%s'!\n"), (p_pcInstanceName ?: "-"));
+            });
+        return bResult;
+    }
 
-/*
+    /*
     SERVICE TXT
 */
 
-/*
+    /*
     MDNSResponder::addServiceTxt
 
     Add a static service TXT item ('Key'='Value') to a service.
 
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                     const char* p_pcKey,
-                                                     const char* p_pcValue)
-{
-    hMDNSTxt hTxt = 0;
-    stcMDNSService* pService = _findService(p_hService);
-    if (pService)
+    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        const char* p_pcValue)
     {
-        hTxt = (hMDNSTxt)_addServiceTxt(pService, p_pcKey, p_pcValue, false);
+        hMDNSTxt hTxt = 0;
+        stcMDNSService* pService = _findService(p_hService);
+        if (pService)
+        {
+            hTxt = (hMDNSTxt)_addServiceTxt(pService, p_pcKey, p_pcValue, false);
+        }
+        DEBUG_EX_ERR(if (!hTxt)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
+            });
+        return hTxt;
     }
-    DEBUG_EX_ERR(if (!hTxt)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
-                 });
-    return hTxt;
-}
 
-/*
+    /*
     MDNSResponder::addServiceTxt (uint32_t)
 
     Formats: http://www.cplusplus.com/reference/cstdio/printf/
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                     const char* p_pcKey,
-                                                     uint32_t p_u32Value)
-{
-    char acBuffer[32];
-    *acBuffer = 0;
-    sprintf(acBuffer, "%u", p_u32Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        uint32_t p_u32Value)
+    {
+        char acBuffer[32];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%u", p_u32Value);
 
-    return addServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addServiceTxt (uint16_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                     const char* p_pcKey,
-                                                     uint16_t p_u16Value)
-{
-    char acBuffer[16];
-    *acBuffer = 0;
-    sprintf(acBuffer, "%hu", p_u16Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        uint16_t p_u16Value)
+    {
+        char acBuffer[16];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hu", p_u16Value);
 
-    return addServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addServiceTxt (uint8_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                     const char* p_pcKey,
-                                                     uint8_t p_u8Value)
-{
-    char acBuffer[8];
-    *acBuffer = 0;
-    sprintf(acBuffer, "%hhu", p_u8Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        uint8_t p_u8Value)
+    {
+        char acBuffer[8];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hhu", p_u8Value);
 
-    return addServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addServiceTxt (int32_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                     const char* p_pcKey,
-                                                     int32_t p_i32Value)
-{
-    char acBuffer[32];
-    *acBuffer = 0;
-    sprintf(acBuffer, "%i", p_i32Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        int32_t p_i32Value)
+    {
+        char acBuffer[32];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%i", p_i32Value);
 
-    return addServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addServiceTxt (int16_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                     const char* p_pcKey,
-                                                     int16_t p_i16Value)
-{
-    char acBuffer[16];
-    *acBuffer = 0;
-    sprintf(acBuffer, "%hi", p_i16Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        int16_t p_i16Value)
+    {
+        char acBuffer[16];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hi", p_i16Value);
 
-    return addServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addServiceTxt (int8_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                     const char* p_pcKey,
-                                                     int8_t p_i8Value)
-{
-    char acBuffer[8];
-    *acBuffer = 0;
-    sprintf(acBuffer, "%hhi", p_i8Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        int8_t p_i8Value)
+    {
+        char acBuffer[8];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hhi", p_i8Value);
 
-    return addServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::removeServiceTxt
 
     Remove a static service TXT item from a service.
 */
-bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                     const MDNSResponder::hMDNSTxt p_hTxt)
-{
-    bool bResult = false;
-
-    stcMDNSService* pService = _findService(p_hService);
-    if (pService)
+    bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const MDNSResponder::hMDNSTxt p_hTxt)
     {
-        stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_hTxt);
-        if (pTxt)
+        bool bResult = false;
+
+        stcMDNSService* pService = _findService(p_hService);
+        if (pService)
         {
-            bResult = _releaseServiceTxt(pService, pTxt);
+            stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_hTxt);
+            if (pTxt)
+            {
+                bResult = _releaseServiceTxt(pService, pTxt);
+            }
         }
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED!\n"));
+            });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED!\n"));
-                 });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::removeServiceTxt
 */
-bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                     const char* p_pcKey)
-{
-    bool bResult = false;
-
-    stcMDNSService* pService = _findService(p_hService);
-    if (pService)
+    bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey)
     {
-        stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_pcKey);
-        if (pTxt)
+        bool bResult = false;
+
+        stcMDNSService* pService = _findService(p_hService);
+        if (pService)
         {
-            bResult = _releaseServiceTxt(pService, pTxt);
+            stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_pcKey);
+            if (pTxt)
+            {
+                bResult = _releaseServiceTxt(pService, pTxt);
+            }
         }
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED for '%s'!\n"), (p_pcKey ?: "-"));
+            });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED for '%s'!\n"), (p_pcKey ?: "-"));
-                 });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::removeServiceTxt
 */
-bool MDNSResponder::removeServiceTxt(const char* p_pcName,
-                                     const char* p_pcService,
-                                     const char* p_pcProtocol,
-                                     const char* p_pcKey)
-{
-    bool bResult = false;
-
-    stcMDNSService* pService = _findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol);
-    if (pService)
+    bool MDNSResponder::removeServiceTxt(const char* p_pcName,
+        const char* p_pcService,
+        const char* p_pcProtocol,
+        const char* p_pcKey)
     {
-        stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_pcKey);
-        if (pTxt)
+        bool bResult = false;
+
+        stcMDNSService* pService = _findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol);
+        if (pService)
         {
-            bResult = _releaseServiceTxt(pService, pTxt);
+            stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_pcKey);
+            if (pTxt)
+            {
+                bResult = _releaseServiceTxt(pService, pTxt);
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::addServiceTxt (LEGACY)
 */
-bool MDNSResponder::addServiceTxt(const char* p_pcService,
-                                  const char* p_pcProtocol,
-                                  const char* p_pcKey,
-                                  const char* p_pcValue)
-{
-    return (0 != _addServiceTxt(_findService(m_pcHostname, p_pcService, p_pcProtocol), p_pcKey, p_pcValue, false));
-}
+    bool MDNSResponder::addServiceTxt(const char* p_pcService,
+        const char* p_pcProtocol,
+        const char* p_pcKey,
+        const char* p_pcValue)
+    {
+        return (0 != _addServiceTxt(_findService(m_pcHostname, p_pcService, p_pcProtocol), p_pcKey, p_pcValue, false));
+    }
 
-/*
+    /*
     MDNSResponder::addServiceTxt (LEGACY)
 */
-bool MDNSResponder::addServiceTxt(const String& p_strService,
-                                  const String& p_strProtocol,
-                                  const String& p_strKey,
-                                  const String& p_strValue)
-{
-    return (0 != _addServiceTxt(_findService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str()), p_strKey.c_str(), p_strValue.c_str(), false));
-}
+    bool MDNSResponder::addServiceTxt(const String& p_strService,
+        const String& p_strProtocol,
+        const String& p_strKey,
+        const String& p_strValue)
+    {
+        return (0 != _addServiceTxt(_findService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str()), p_strKey.c_str(), p_strValue.c_str(), false));
+    }
 
-/*
+    /*
     MDNSResponder::setDynamicServiceTxtCallback (global)
 
     Set a global callback for dynamic service TXT items. The callback is called, whenever
     service TXT items are needed.
 
 */
-bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
-{
-    m_fnServiceTxtCallback = p_fnCallback;
+    bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
+    {
+        m_fnServiceTxtCallback = p_fnCallback;
 
-    return true;
-}
+        return true;
+    }
 
-/*
+    /*
     MDNSResponder::setDynamicServiceTxtCallback (service specific)
 
     Set a service specific callback for dynamic service TXT items. The callback is called, whenever
     service TXT items are needed for the given service.
 
 */
-bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::hMDNSService p_hService,
-                                                 MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
-{
-    bool bResult = false;
-
-    stcMDNSService* pService = _findService(p_hService);
-    if (pService)
+    bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::hMDNSService p_hService,
+        MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
     {
-        pService->m_fnTxtCallback = p_fnCallback;
+        bool bResult = false;
+
+        stcMDNSService* pService = _findService(p_hService);
+        if (pService)
+        {
+            pService->m_fnTxtCallback = p_fnCallback;
 
-        bResult = true;
+            bResult = true;
+        }
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setDynamicServiceTxtCallback: FAILED!\n"));
+            });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setDynamicServiceTxtCallback: FAILED!\n"));
-                 });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::addDynamicServiceTxt
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                            const char* p_pcKey,
-                                                            const char* p_pcValue)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt (%s=%s)\n"), p_pcKey, p_pcValue););
+    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        const char* p_pcValue)
+    {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt (%s=%s)\n"), p_pcKey, p_pcValue););
 
-    hMDNSTxt hTxt = 0;
+        hMDNSTxt hTxt = 0;
 
-    stcMDNSService* pService = _findService(p_hService);
-    if (pService)
-    {
-        hTxt = _addServiceTxt(pService, p_pcKey, p_pcValue, true);
+        stcMDNSService* pService = _findService(p_hService);
+        if (pService)
+        {
+            hTxt = _addServiceTxt(pService, p_pcKey, p_pcValue, true);
+        }
+        DEBUG_EX_ERR(if (!hTxt)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
+            });
+        return hTxt;
     }
-    DEBUG_EX_ERR(if (!hTxt)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
-                 });
-    return hTxt;
-}
 
-/*
+    /*
     MDNSResponder::addDynamicServiceTxt (uint32_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                            const char* p_pcKey,
-                                                            uint32_t p_u32Value)
-{
-    char acBuffer[32];
-    *acBuffer = 0;
-    sprintf(acBuffer, "%u", p_u32Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        uint32_t p_u32Value)
+    {
+        char acBuffer[32];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%u", p_u32Value);
 
-    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addDynamicServiceTxt (uint16_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                            const char* p_pcKey,
-                                                            uint16_t p_u16Value)
-{
-    char acBuffer[16];
-    *acBuffer = 0;
-    sprintf(acBuffer, "%hu", p_u16Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        uint16_t p_u16Value)
+    {
+        char acBuffer[16];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hu", p_u16Value);
 
-    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addDynamicServiceTxt (uint8_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                            const char* p_pcKey,
-                                                            uint8_t p_u8Value)
-{
-    char acBuffer[8];
-    *acBuffer = 0;
-    sprintf(acBuffer, "%hhu", p_u8Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        uint8_t p_u8Value)
+    {
+        char acBuffer[8];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hhu", p_u8Value);
 
-    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addDynamicServiceTxt (int32_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                            const char* p_pcKey,
-                                                            int32_t p_i32Value)
-{
-    char acBuffer[32];
-    *acBuffer = 0;
-    sprintf(acBuffer, "%i", p_i32Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        int32_t p_i32Value)
+    {
+        char acBuffer[32];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%i", p_i32Value);
 
-    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addDynamicServiceTxt (int16_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                            const char* p_pcKey,
-                                                            int16_t p_i16Value)
-{
-    char acBuffer[16];
-    *acBuffer = 0;
-    sprintf(acBuffer, "%hi", p_i16Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        int16_t p_i16Value)
+    {
+        char acBuffer[16];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hi", p_i16Value);
 
-    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addDynamicServiceTxt (int8_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                            const char* p_pcKey,
-                                                            int8_t p_i8Value)
-{
-    char acBuffer[8];
-    *acBuffer = 0;
-    sprintf(acBuffer, "%hhi", p_i8Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        int8_t p_i8Value)
+    {
+        char acBuffer[8];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hhi", p_i8Value);
 
-    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/**
+    /**
     STATIC SERVICE QUERY (LEGACY)
 */
 
-/*
+    /*
     MDNSResponder::queryService
 
     Perform a (blocking) static service query.
@@ -664,160 +655,151 @@ MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNS
     - answerPort (or 'port')
 
 */
-uint32_t MDNSResponder::queryService(const char* p_pcService,
-                                     const char* p_pcProtocol,
-                                     const uint16_t p_u16Timeout /*= MDNS_QUERYSERVICES_WAIT_TIME*/)
-{
-    if (0 == m_pUDPContext)
+    uint32_t MDNSResponder::queryService(const char* p_pcService,
+        const char* p_pcProtocol,
+        const uint16_t p_u16Timeout /*= MDNS_QUERYSERVICES_WAIT_TIME*/)
     {
-        // safeguard against misuse
-        return 0;
-    }
-
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService '%s.%s'\n"), p_pcService, p_pcProtocol););
+        if (0 == m_pUDPContext)
+        {
+            // safeguard against misuse
+            return 0;
+        }
 
-    uint32_t u32Result = 0;
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService '%s.%s'\n"), p_pcService, p_pcProtocol););
 
-    stcMDNSServiceQuery* pServiceQuery = 0;
-    if ((p_pcService) &&
-        (os_strlen(p_pcService)) &&
-        (p_pcProtocol) &&
-        (os_strlen(p_pcProtocol)) &&
-        (p_u16Timeout) &&
-        (_removeLegacyServiceQuery()) &&
-        ((pServiceQuery = _allocServiceQuery())) &&
-        (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
-    {
-        pServiceQuery->m_bLegacyQuery = true;
+        uint32_t u32Result = 0;
 
-        if (_sendMDNSServiceQuery(*pServiceQuery))
+        stcMDNSServiceQuery* pServiceQuery = 0;
+        if ((p_pcService) && (os_strlen(p_pcService)) && (p_pcProtocol) && (os_strlen(p_pcProtocol)) && (p_u16Timeout) && (_removeLegacyServiceQuery()) && ((pServiceQuery = _allocServiceQuery())) && (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
         {
-            // Wait for answers to arrive
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: Waiting %u ms for answers...\n"), p_u16Timeout););
-            delay(p_u16Timeout);
+            pServiceQuery->m_bLegacyQuery = true;
+
+            if (_sendMDNSServiceQuery(*pServiceQuery))
+            {
+                // Wait for answers to arrive
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: Waiting %u ms for answers...\n"), p_u16Timeout););
+                delay(p_u16Timeout);
 
-            // All answers should have arrived by now -> stop adding new answers
-            pServiceQuery->m_bAwaitingAnswers = false;
-            u32Result = pServiceQuery->answerCount();
+                // All answers should have arrived by now -> stop adding new answers
+                pServiceQuery->m_bAwaitingAnswers = false;
+                u32Result = pServiceQuery->answerCount();
+            }
+            else  // FAILED to send query
+            {
+                _removeServiceQuery(pServiceQuery);
+            }
         }
-        else  // FAILED to send query
+        else
         {
-            _removeServiceQuery(pServiceQuery);
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: INVALID input data!\n")););
         }
+        return u32Result;
     }
-    else
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: INVALID input data!\n")););
-    }
-    return u32Result;
-}
 
-/*
+    /*
     MDNSResponder::removeQuery
 
     Remove the last static service query (and all answers).
 
 */
-bool MDNSResponder::removeQuery(void)
-{
-    return _removeLegacyServiceQuery();
-}
+    bool MDNSResponder::removeQuery(void)
+    {
+        return _removeLegacyServiceQuery();
+    }
 
-/*
+    /*
     MDNSResponder::queryService (LEGACY)
 */
-uint32_t MDNSResponder::queryService(const String& p_strService,
-                                     const String& p_strProtocol)
-{
-    return queryService(p_strService.c_str(), p_strProtocol.c_str());
-}
+    uint32_t MDNSResponder::queryService(const String& p_strService,
+        const String& p_strProtocol)
+    {
+        return queryService(p_strService.c_str(), p_strProtocol.c_str());
+    }
 
-/*
+    /*
     MDNSResponder::answerHostname
 */
-const char* MDNSResponder::answerHostname(const uint32_t p_u32AnswerIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-
-    if ((pSQAnswer) &&
-        (pSQAnswer->m_HostDomain.m_u16NameLength) &&
-        (!pSQAnswer->m_pcHostDomain))
+    const char* MDNSResponder::answerHostname(const uint32_t p_u32AnswerIndex)
     {
-        char* pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
-        if (pcHostDomain)
+        stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+
+        if ((pSQAnswer) && (pSQAnswer->m_HostDomain.m_u16NameLength) && (!pSQAnswer->m_pcHostDomain))
         {
-            pSQAnswer->m_HostDomain.c_str(pcHostDomain);
+            char* pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
+            if (pcHostDomain)
+            {
+                pSQAnswer->m_HostDomain.c_str(pcHostDomain);
+            }
         }
+        return (pSQAnswer ? pSQAnswer->m_pcHostDomain : 0);
     }
-    return (pSQAnswer ? pSQAnswer->m_pcHostDomain : 0);
-}
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::answerIP
 */
-IPAddress MDNSResponder::answerIP(const uint32_t p_u32AnswerIndex)
-{
-    const stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
-    const stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    const stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = (((pSQAnswer) && (pSQAnswer->m_pIP4Addresses)) ? pSQAnswer->IP4AddressAtIndex(0) : 0);
-    return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
-}
+    IPAddress MDNSResponder::answerIP(const uint32_t p_u32AnswerIndex)
+    {
+        const stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
+        const stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        const stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = (((pSQAnswer) && (pSQAnswer->m_pIP4Addresses)) ? pSQAnswer->IP4AddressAtIndex(0) : 0);
+        return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
+    }
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-/*
+    /*
     MDNSResponder::answerIP6
 */
-IPAddress MDNSResponder::answerIP6(const uint32_t p_u32AnswerIndex)
-{
-    const stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
-    const stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    const stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address = (((pSQAnswer) && (pSQAnswer->m_pIP6Addresses)) ? pSQAnswer->IP6AddressAtIndex(0) : 0);
-    return (pIP6Address ? pIP6Address->m_IPAddress : IP6Address());
-}
+    IPAddress MDNSResponder::answerIP6(const uint32_t p_u32AnswerIndex)
+    {
+        const stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
+        const stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        const stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address = (((pSQAnswer) && (pSQAnswer->m_pIP6Addresses)) ? pSQAnswer->IP6AddressAtIndex(0) : 0);
+        return (pIP6Address ? pIP6Address->m_IPAddress : IP6Address());
+    }
 #endif
 
-/*
+    /*
     MDNSResponder::answerPort
 */
-uint16_t MDNSResponder::answerPort(const uint32_t p_u32AnswerIndex)
-{
-    const stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
-    const stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
-}
+    uint16_t MDNSResponder::answerPort(const uint32_t p_u32AnswerIndex)
+    {
+        const stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
+        const stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
+    }
 
-/*
+    /*
     MDNSResponder::hostname (LEGACY)
 */
-String MDNSResponder::hostname(const uint32_t p_u32AnswerIndex)
-{
-    return String(answerHostname(p_u32AnswerIndex));
-}
+    String MDNSResponder::hostname(const uint32_t p_u32AnswerIndex)
+    {
+        return String(answerHostname(p_u32AnswerIndex));
+    }
 
-/*
+    /*
     MDNSResponder::IP (LEGACY)
 */
-IPAddress MDNSResponder::IP(const uint32_t p_u32AnswerIndex)
-{
-    return answerIP(p_u32AnswerIndex);
-}
+    IPAddress MDNSResponder::IP(const uint32_t p_u32AnswerIndex)
+    {
+        return answerIP(p_u32AnswerIndex);
+    }
 
-/*
+    /*
     MDNSResponder::port (LEGACY)
 */
-uint16_t MDNSResponder::port(const uint32_t p_u32AnswerIndex)
-{
-    return answerPort(p_u32AnswerIndex);
-}
+    uint16_t MDNSResponder::port(const uint32_t p_u32AnswerIndex)
+    {
+        return answerPort(p_u32AnswerIndex);
+    }
 
-/**
+    /**
     DYNAMIC SERVICE QUERY
 */
 
-/*
+    /*
     MDNSResponder::installServiceQuery
 
     Add a dynamic service query and a corresponding callback to the MDNS responder.
@@ -830,287 +812,269 @@ uint16_t MDNSResponder::port(const uint32_t p_u32AnswerIndex)
     - answerTxts
 
 */
-MDNSResponder::hMDNSServiceQuery MDNSResponder::installServiceQuery(const char* p_pcService,
-                                                                    const char* p_pcProtocol,
-                                                                    MDNSResponder::MDNSServiceQueryCallbackFunc p_fnCallback)
-{
-    hMDNSServiceQuery hResult = 0;
-
-    stcMDNSServiceQuery* pServiceQuery = 0;
-    if ((p_pcService) &&
-        (os_strlen(p_pcService)) &&
-        (p_pcProtocol) &&
-        (os_strlen(p_pcProtocol)) &&
-        (p_fnCallback) &&
-        ((pServiceQuery = _allocServiceQuery())) &&
-        (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
+    MDNSResponder::hMDNSServiceQuery MDNSResponder::installServiceQuery(const char* p_pcService,
+        const char* p_pcProtocol,
+        MDNSResponder::MDNSServiceQueryCallbackFunc p_fnCallback)
     {
-        pServiceQuery->m_fnCallback = p_fnCallback;
-        pServiceQuery->m_bLegacyQuery = false;
+        hMDNSServiceQuery hResult = 0;
 
-        if (_sendMDNSServiceQuery(*pServiceQuery))
+        stcMDNSServiceQuery* pServiceQuery = 0;
+        if ((p_pcService) && (os_strlen(p_pcService)) && (p_pcProtocol) && (os_strlen(p_pcProtocol)) && (p_fnCallback) && ((pServiceQuery = _allocServiceQuery())) && (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
         {
-            pServiceQuery->m_u8SentCount = 1;
-            pServiceQuery->m_ResendTimeout.reset(MDNS_DYNAMIC_QUERY_RESEND_DELAY);
+            pServiceQuery->m_fnCallback = p_fnCallback;
+            pServiceQuery->m_bLegacyQuery = false;
 
-            hResult = (hMDNSServiceQuery)pServiceQuery;
-        }
-        else
-        {
-            _removeServiceQuery(pServiceQuery);
+            if (_sendMDNSServiceQuery(*pServiceQuery))
+            {
+                pServiceQuery->m_u8SentCount = 1;
+                pServiceQuery->m_ResendTimeout.reset(MDNS_DYNAMIC_QUERY_RESEND_DELAY);
+
+                hResult = (hMDNSServiceQuery)pServiceQuery;
+            }
+            else
+            {
+                _removeServiceQuery(pServiceQuery);
+            }
         }
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: %s for '%s.%s'!\n\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
+        DEBUG_EX_ERR(if (!hResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: FAILED for '%s.%s'!\n\n"), (p_pcService ?: "-"), (p_pcProtocol ?: "-"));
+            });
+        return hResult;
     }
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: %s for '%s.%s'!\n\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
-    DEBUG_EX_ERR(if (!hResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: FAILED for '%s.%s'!\n\n"), (p_pcService ?: "-"), (p_pcProtocol ?: "-"));
-                 });
-    return hResult;
-}
 
-/*
+    /*
     MDNSResponder::removeServiceQuery
 
     Remove a dynamic service query (and all collected answers) from the MDNS responder
 
 */
-bool MDNSResponder::removeServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
-{
-    stcMDNSServiceQuery* pServiceQuery = 0;
-    bool bResult = (((pServiceQuery = _findServiceQuery(p_hServiceQuery))) &&
-                    (_removeServiceQuery(pServiceQuery)));
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceQuery: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::removeServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
+    {
+        stcMDNSServiceQuery* pServiceQuery = 0;
+        bool bResult = (((pServiceQuery = _findServiceQuery(p_hServiceQuery))) && (_removeServiceQuery(pServiceQuery)));
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceQuery: FAILED!\n"));
+            });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::answerCount
 */
-uint32_t MDNSResponder::answerCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    return (pServiceQuery ? pServiceQuery->answerCount() : 0);
-}
+    uint32_t MDNSResponder::answerCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        return (pServiceQuery ? pServiceQuery->answerCount() : 0);
+    }
 
-std::vector<MDNSResponder::MDNSServiceInfo> MDNSResponder::answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
-{
-    std::vector<MDNSResponder::MDNSServiceInfo> tempVector;
-    for (uint32_t i = 0; i < answerCount(p_hServiceQuery); i++)
+    std::vector<MDNSResponder::MDNSServiceInfo> MDNSResponder::answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
     {
-        tempVector.emplace_back(*this, p_hServiceQuery, i);
+        std::vector<MDNSResponder::MDNSServiceInfo> tempVector;
+        for (uint32_t i = 0; i < answerCount(p_hServiceQuery); i++)
+        {
+            tempVector.emplace_back(*this, p_hServiceQuery, i);
+        }
+        return tempVector;
     }
-    return tempVector;
-}
 
-/*
+    /*
     MDNSResponder::answerServiceDomain
 
     Returns the domain for the given service.
     If not already existing, the string is allocated, filled and attached to the answer.
 
 */
-const char* MDNSResponder::answerServiceDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                               const uint32_t p_u32AnswerIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    // Fill m_pcServiceDomain (if not already done)
-    if ((pSQAnswer) &&
-        (pSQAnswer->m_ServiceDomain.m_u16NameLength) &&
-        (!pSQAnswer->m_pcServiceDomain))
-    {
-        pSQAnswer->m_pcServiceDomain = pSQAnswer->allocServiceDomain(pSQAnswer->m_ServiceDomain.c_strLength());
-        if (pSQAnswer->m_pcServiceDomain)
+    const char* MDNSResponder::answerServiceDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        // Fill m_pcServiceDomain (if not already done)
+        if ((pSQAnswer) && (pSQAnswer->m_ServiceDomain.m_u16NameLength) && (!pSQAnswer->m_pcServiceDomain))
         {
-            pSQAnswer->m_ServiceDomain.c_str(pSQAnswer->m_pcServiceDomain);
+            pSQAnswer->m_pcServiceDomain = pSQAnswer->allocServiceDomain(pSQAnswer->m_ServiceDomain.c_strLength());
+            if (pSQAnswer->m_pcServiceDomain)
+            {
+                pSQAnswer->m_ServiceDomain.c_str(pSQAnswer->m_pcServiceDomain);
+            }
         }
+        return (pSQAnswer ? pSQAnswer->m_pcServiceDomain : 0);
     }
-    return (pSQAnswer ? pSQAnswer->m_pcServiceDomain : 0);
-}
 
-/*
+    /*
     MDNSResponder::hasAnswerHostDomain
 */
-bool MDNSResponder::hasAnswerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                        const uint32_t p_u32AnswerIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return ((pSQAnswer) &&
-            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
-}
+    bool MDNSResponder::hasAnswerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
+    }
 
-/*
+    /*
     MDNSResponder::answerHostDomain
 
     Returns the host domain for the given service.
     If not already existing, the string is allocated, filled and attached to the answer.
 
 */
-const char* MDNSResponder::answerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                            const uint32_t p_u32AnswerIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    // Fill m_pcHostDomain (if not already done)
-    if ((pSQAnswer) &&
-        (pSQAnswer->m_HostDomain.m_u16NameLength) &&
-        (!pSQAnswer->m_pcHostDomain))
-    {
-        pSQAnswer->m_pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
-        if (pSQAnswer->m_pcHostDomain)
+    const char* MDNSResponder::answerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        // Fill m_pcHostDomain (if not already done)
+        if ((pSQAnswer) && (pSQAnswer->m_HostDomain.m_u16NameLength) && (!pSQAnswer->m_pcHostDomain))
         {
-            pSQAnswer->m_HostDomain.c_str(pSQAnswer->m_pcHostDomain);
+            pSQAnswer->m_pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
+            if (pSQAnswer->m_pcHostDomain)
+            {
+                pSQAnswer->m_HostDomain.c_str(pSQAnswer->m_pcHostDomain);
+            }
         }
+        return (pSQAnswer ? pSQAnswer->m_pcHostDomain : 0);
     }
-    return (pSQAnswer ? pSQAnswer->m_pcHostDomain : 0);
-}
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::hasAnswerIP4Address
 */
-bool MDNSResponder::hasAnswerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                        const uint32_t p_u32AnswerIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return ((pSQAnswer) &&
-            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_IP4Address));
-}
+    bool MDNSResponder::hasAnswerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_IP4Address));
+    }
 
-/*
+    /*
     MDNSResponder::answerIP4AddressCount
 */
-uint32_t MDNSResponder::answerIP4AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                              const uint32_t p_u32AnswerIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return (pSQAnswer ? pSQAnswer->IP4AddressCount() : 0);
-}
+    uint32_t MDNSResponder::answerIP4AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return (pSQAnswer ? pSQAnswer->IP4AddressCount() : 0);
+    }
 
-/*
+    /*
     MDNSResponder::answerIP4Address
 */
-IPAddress MDNSResponder::answerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                          const uint32_t p_u32AnswerIndex,
-                                          const uint32_t p_u32AddressIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = (pSQAnswer ? pSQAnswer->IP4AddressAtIndex(p_u32AddressIndex) : 0);
-    return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
-}
+    IPAddress MDNSResponder::answerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex,
+        const uint32_t p_u32AddressIndex)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = (pSQAnswer ? pSQAnswer->IP4AddressAtIndex(p_u32AddressIndex) : 0);
+        return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
+    }
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-/*
+    /*
     MDNSResponder::hasAnswerIP6Address
 */
-bool MDNSResponder::hasAnswerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                        const uint32_t p_u32AnswerIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return ((pSQAnswer) &&
-            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostIP6Address));
-}
+    bool MDNSResponder::hasAnswerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostIP6Address));
+    }
 
-/*
+    /*
     MDNSResponder::answerIP6AddressCount
 */
-uint32_t MDNSResponder::answerIP6AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                              const uint32_t p_u32AnswerIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return (pSQAnswer ? pSQAnswer->IP6AddressCount() : 0);
-}
+    uint32_t MDNSResponder::answerIP6AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return (pSQAnswer ? pSQAnswer->IP6AddressCount() : 0);
+    }
 
-/*
+    /*
     MDNSResponder::answerIP6Address
 */
-IPAddress MDNSResponder::answerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                          const uint32_t p_u32AnswerIndex,
-                                          const uint32_t p_u32AddressIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address = (pSQAnswer ? pSQAnswer->IP6AddressAtIndex(p_u32AddressIndex) : 0);
-    return (pIP6Address ? pIP6Address->m_IPAddress : IPAddress());
-}
+    IPAddress MDNSResponder::answerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex,
+        const uint32_t p_u32AddressIndex)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address = (pSQAnswer ? pSQAnswer->IP6AddressAtIndex(p_u32AddressIndex) : 0);
+        return (pIP6Address ? pIP6Address->m_IPAddress : IPAddress());
+    }
 #endif
 
-/*
+    /*
     MDNSResponder::hasAnswerPort
 */
-bool MDNSResponder::hasAnswerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                  const uint32_t p_u32AnswerIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return ((pSQAnswer) &&
-            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
-}
+    bool MDNSResponder::hasAnswerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
+    }
 
-/*
+    /*
     MDNSResponder::answerPort
 */
-uint16_t MDNSResponder::answerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                   const uint32_t p_u32AnswerIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
-}
+    uint16_t MDNSResponder::answerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
+    }
 
-/*
+    /*
     MDNSResponder::hasAnswerTxts
 */
-bool MDNSResponder::hasAnswerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                  const uint32_t p_u32AnswerIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return ((pSQAnswer) &&
-            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_Txts));
-}
+    bool MDNSResponder::hasAnswerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_Txts));
+    }
 
-/*
+    /*
     MDNSResponder::answerTxts
 
     Returns all TXT items for the given service as a ';'-separated string.
     If not already existing; the string is allocated, filled and attached to the answer.
 
 */
-const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                      const uint32_t p_u32AnswerIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    // Fill m_pcTxts (if not already done)
-    if ((pSQAnswer) &&
-        (pSQAnswer->m_Txts.m_pTxts) &&
-        (!pSQAnswer->m_pcTxts))
-    {
-        pSQAnswer->m_pcTxts = pSQAnswer->allocTxts(pSQAnswer->m_Txts.c_strLength());
-        if (pSQAnswer->m_pcTxts)
+    const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        // Fill m_pcTxts (if not already done)
+        if ((pSQAnswer) && (pSQAnswer->m_Txts.m_pTxts) && (!pSQAnswer->m_pcTxts))
         {
-            pSQAnswer->m_Txts.c_str(pSQAnswer->m_pcTxts);
+            pSQAnswer->m_pcTxts = pSQAnswer->allocTxts(pSQAnswer->m_Txts.c_strLength());
+            if (pSQAnswer->m_pcTxts)
+            {
+                pSQAnswer->m_Txts.c_str(pSQAnswer->m_pcTxts);
+            }
         }
+        return (pSQAnswer ? pSQAnswer->m_pcTxts : 0);
     }
-    return (pSQAnswer ? pSQAnswer->m_pcTxts : 0);
-}
 
-/*
+    /*
     PROBING
 */
 
-/*
+    /*
     MDNSResponder::setProbeResultCallback
 
     Set a global callback for probe results. The callback is called, when probing
@@ -1120,21 +1084,21 @@ const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_h
     When succeeded, the host or service domain will be announced by the MDNS responder.
 
 */
-bool MDNSResponder::setHostProbeResultCallback(MDNSResponder::MDNSHostProbeFn p_fnCallback)
-{
-    m_HostProbeInformation.m_fnHostProbeResultCallback = p_fnCallback;
+    bool MDNSResponder::setHostProbeResultCallback(MDNSResponder::MDNSHostProbeFn p_fnCallback)
+    {
+        m_HostProbeInformation.m_fnHostProbeResultCallback = p_fnCallback;
 
-    return true;
-}
+        return true;
+    }
 
-bool MDNSResponder::setHostProbeResultCallback(MDNSHostProbeFn1 pfn)
-{
-    using namespace std::placeholders;
-    return setHostProbeResultCallback([this, pfn](const char* p_pcDomainName, bool p_bProbeResult)
-                                      { pfn(*this, p_pcDomainName, p_bProbeResult); });
-}
+    bool MDNSResponder::setHostProbeResultCallback(MDNSHostProbeFn1 pfn)
+    {
+        using namespace std::placeholders;
+        return setHostProbeResultCallback([this, pfn](const char* p_pcDomainName, bool p_bProbeResult)
+            { pfn(*this, p_pcDomainName, p_bProbeResult); });
+    }
 
-/*
+    /*
     MDNSResponder::setServiceProbeResultCallback
 
     Set a service specific callback for probe results. The callback is called, when probing
@@ -1143,176 +1107,171 @@ bool MDNSResponder::setHostProbeResultCallback(MDNSHostProbeFn1 pfn)
     When succeeded, the service domain will be announced by the MDNS responder.
 
 */
-bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-                                                  MDNSResponder::MDNSServiceProbeFn p_fnCallback)
-{
-    bool bResult = false;
-
-    stcMDNSService* pService = _findService(p_hService);
-    if (pService)
+    bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+        MDNSResponder::MDNSServiceProbeFn p_fnCallback)
     {
-        pService->m_ProbeInformation.m_fnServiceProbeResultCallback = p_fnCallback;
+        bool bResult = false;
+
+        stcMDNSService* pService = _findService(p_hService);
+        if (pService)
+        {
+            pService->m_ProbeInformation.m_fnServiceProbeResultCallback = p_fnCallback;
 
-        bResult = true;
+            bResult = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-                                                  MDNSResponder::MDNSServiceProbeFn1 p_fnCallback)
-{
-    using namespace std::placeholders;
-    return setServiceProbeResultCallback(p_hService, [this, p_fnCallback](const char* p_pcServiceName, const hMDNSService p_hMDNSService, bool p_bProbeResult)
-                                         { p_fnCallback(*this, p_pcServiceName, p_hMDNSService, p_bProbeResult); });
-}
+    bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+        MDNSResponder::MDNSServiceProbeFn1 p_fnCallback)
+    {
+        using namespace std::placeholders;
+        return setServiceProbeResultCallback(p_hService, [this, p_fnCallback](const char* p_pcServiceName, const hMDNSService p_hMDNSService, bool p_bProbeResult)
+            { p_fnCallback(*this, p_pcServiceName, p_hMDNSService, p_bProbeResult); });
+    }
 
-/*
+    /*
     MISC
 */
 
-/*
+    /*
     MDNSResponder::notifyAPChange
 
     Should be called, whenever the AP for the MDNS responder changes.
     A bit of this is caught by the event callbacks installed in the constructor.
 
 */
-bool MDNSResponder::notifyAPChange(void)
-{
-    return _restart();
-}
+    bool MDNSResponder::notifyAPChange(void)
+    {
+        return _restart();
+    }
 
-/*
+    /*
     MDNSResponder::update
 
     Should be called in every 'loop'.
 
 */
-bool MDNSResponder::update(void)
-{
-    return _process(true);
-}
+    bool MDNSResponder::update(void)
+    {
+        return _process(true);
+    }
 
-/*
+    /*
     MDNSResponder::announce
 
     Should be called, if the 'configuration' changes. Mainly this will be changes in the TXT items...
 */
-bool MDNSResponder::announce(void)
-{
-    return (_announce(true, true));
-}
+    bool MDNSResponder::announce(void)
+    {
+        return (_announce(true, true));
+    }
 
-/*
+    /*
     MDNSResponder::enableArduino
 
     Enable the OTA update service.
 
 */
-MDNSResponder::hMDNSService MDNSResponder::enableArduino(uint16_t p_u16Port,
-                                                         bool p_bAuthUpload /*= false*/)
-{
-    hMDNSService hService = addService(0, "arduino", "tcp", p_u16Port);
-    if (hService)
+    MDNSResponder::hMDNSService MDNSResponder::enableArduino(uint16_t p_u16Port,
+        bool p_bAuthUpload /*= false*/)
     {
-        if ((!addServiceTxt(hService, "tcp_check", "no")) ||
-            (!addServiceTxt(hService, "ssh_upload", "no")) ||
-            (!addServiceTxt(hService, "board", STRINGIZE_VALUE_OF(ARDUINO_BOARD))) ||
-            (!addServiceTxt(hService, "auth_upload", (p_bAuthUpload) ? "yes" : "no")))
+        hMDNSService hService = addService(0, "arduino", "tcp", p_u16Port);
+        if (hService)
         {
-            removeService(hService);
-            hService = 0;
+            if ((!addServiceTxt(hService, "tcp_check", "no")) || (!addServiceTxt(hService, "ssh_upload", "no")) || (!addServiceTxt(hService, "board", STRINGIZE_VALUE_OF(ARDUINO_BOARD))) || (!addServiceTxt(hService, "auth_upload", (p_bAuthUpload) ? "yes" : "no")))
+            {
+                removeService(hService);
+                hService = 0;
+            }
         }
+        return hService;
     }
-    return hService;
-}
 
-/*
+    /*
 
     MULTICAST GROUPS
 
 */
 
-/*
+    /*
     MDNSResponder::_joinMulticastGroups
 */
-bool MDNSResponder::_joinMulticastGroups(void)
-{
-    bool bResult = false;
-
-    // Join multicast group(s)
-    for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+    bool MDNSResponder::_joinMulticastGroups(void)
     {
-        if (netif_is_up(pNetIf))
+        bool bResult = false;
+
+        // Join multicast group(s)
+        for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
         {
-#ifdef MDNS_IP4_SUPPORT
-            ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
-            if (!(pNetIf->flags & NETIF_FLAG_IGMP))
+            if (netif_is_up(pNetIf))
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: Setting flag: flags & NETIF_FLAG_IGMP\n")););
-                pNetIf->flags |= NETIF_FLAG_IGMP;
-
-                if (ERR_OK != igmp_start(pNetIf))
+#ifdef MDNS_IP4_SUPPORT
+                ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
+                if (!(pNetIf->flags & NETIF_FLAG_IGMP))
                 {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_start FAILED!\n")););
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: Setting flag: flags & NETIF_FLAG_IGMP\n")););
+                    pNetIf->flags |= NETIF_FLAG_IGMP;
+
+                    if (ERR_OK != igmp_start(pNetIf))
+                    {
+                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_start FAILED!\n")););
+                    }
                 }
-            }
 
-            if ((ERR_OK == igmp_joingroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4))))
-            {
-                bResult = true;
-            }
-            else
-            {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_joingroup_netif(" NETIFID_STR ": %s) FAILED!\n"),
-                                                   NETIFID_VAL(pNetIf), IPAddress(multicast_addr_V4).toString().c_str()););
-            }
+                if ((ERR_OK == igmp_joingroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4))))
+                {
+                    bResult = true;
+                }
+                else
+                {
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_joingroup_netif(" NETIFID_STR ": %s) FAILED!\n"),
+                        NETIFID_VAL(pNetIf), IPAddress(multicast_addr_V4).toString().c_str()););
+                }
 #endif
 
 #ifdef MDNS_IPV6_SUPPORT
-            ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
-            bResult = ((bResult) &&
-                       (ERR_OK == mld6_joingroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6))));
-            DEBUG_EX_ERR_IF(!bResult, DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: mld6_joingroup_netif (" NETIFID_STR ") FAILED!\n"),
-                                                            NETIFID_VAL(pNetIf)));
+                ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
+                bResult = ((bResult) && (ERR_OK == mld6_joingroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6))));
+                DEBUG_EX_ERR_IF(!bResult, DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: mld6_joingroup_netif (" NETIFID_STR ") FAILED!\n"), NETIFID_VAL(pNetIf)));
 #endif
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     clsLEAmDNS2_Host::_leaveMulticastGroups
 */
-bool MDNSResponder::_leaveMulticastGroups()
-{
-    bool bResult = false;
-
-    for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+    bool MDNSResponder::_leaveMulticastGroups()
     {
-        if (netif_is_up(pNetIf))
+        bool bResult = false;
+
+        for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
         {
-            bResult = true;
+            if (netif_is_up(pNetIf))
+            {
+                bResult = true;
 
-            // Leave multicast group(s)
+                // Leave multicast group(s)
 #ifdef MDNS_IP4_SUPPORT
-            ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
-            if (ERR_OK != igmp_leavegroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4)))
-            {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
-            }
+                ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
+                if (ERR_OK != igmp_leavegroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4)))
+                {
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
+                }
 #endif
 #ifdef MDNS_IPV6_SUPPORT
-            ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
-            if (ERR_OK != mld6_leavegroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6) /*&(multicast_addr_V6.u_addr.ip6)*/))
-            {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
-            }
+                ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
+                if (ERR_OK != mld6_leavegroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6) /*&(multicast_addr_V6.u_addr.ip6)*/))
+                {
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
+                }
 #endif
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
 }  //namespace MDNSImplementation
 
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.h b/libraries/ESP8266mDNS/src/LEAmDNS.h
index 48ceab3b09..24a561080f 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.h
@@ -166,1291 +166,1290 @@ namespace MDNSImplementation
 */
 #define MDNS_UDPCONTEXT_TIMEOUT 50
 
-/**
+    /**
     MDNSResponder
 */
-class MDNSResponder
-{
-   public:
-    /* INTERFACE */
-
-    MDNSResponder(void);
-    virtual ~MDNSResponder(void);
-
-    // Start the MDNS responder by setting the default hostname
-    // Later call MDNS::update() in every 'loop' to run the process loop
-    // (probing, announcing, responding, ...)
-    // if interfaceAddress is not specified, default interface is STA, or AP when STA is not set
-    bool begin(const char* p_pcHostname, const IPAddress& p_IPAddress = INADDR_ANY, uint32_t p_u32TTL = 120 /*ignored*/);
-    bool begin(const String& p_strHostname, const IPAddress& p_IPAddress = INADDR_ANY, uint32_t p_u32TTL = 120 /*ignored*/)
-    {
-        return begin(p_strHostname.c_str(), p_IPAddress, p_u32TTL);
-    }
-    bool _joinMulticastGroups(void);
-    bool _leaveMulticastGroups(void);
-
-    // Finish MDNS processing
-    bool close(void);
-    // for esp32 compatibility
-    bool end(void);
-    // Change hostname (probing is restarted)
-    bool setHostname(const char* p_pcHostname);
-    // for compatibility...
-    bool setHostname(const String& p_strHostname);
-
-    bool isRunning(void)
+    class MDNSResponder
     {
-        return (m_pUDPContext != 0);
-    }
+    public:
+        /* INTERFACE */
+
+        MDNSResponder(void);
+        virtual ~MDNSResponder(void);
+
+        // Start the MDNS responder by setting the default hostname
+        // Later call MDNS::update() in every 'loop' to run the process loop
+        // (probing, announcing, responding, ...)
+        // if interfaceAddress is not specified, default interface is STA, or AP when STA is not set
+        bool begin(const char* p_pcHostname, const IPAddress& p_IPAddress = INADDR_ANY, uint32_t p_u32TTL = 120 /*ignored*/);
+        bool begin(const String& p_strHostname, const IPAddress& p_IPAddress = INADDR_ANY, uint32_t p_u32TTL = 120 /*ignored*/)
+        {
+            return begin(p_strHostname.c_str(), p_IPAddress, p_u32TTL);
+        }
+        bool _joinMulticastGroups(void);
+        bool _leaveMulticastGroups(void);
+
+        // Finish MDNS processing
+        bool close(void);
+        // for esp32 compatibility
+        bool end(void);
+        // Change hostname (probing is restarted)
+        bool setHostname(const char* p_pcHostname);
+        // for compatibility...
+        bool setHostname(const String& p_strHostname);
+
+        bool isRunning(void)
+        {
+            return (m_pUDPContext != 0);
+        }
 
-    /**
+        /**
         hMDNSService (opaque handle to access the service)
     */
-    typedef const void* hMDNSService;
-
-    // Add a new service to the MDNS responder. If no name (instance name) is given (p_pcName = 0)
-    // the current hostname is used. If the hostname is changed later, the instance names for
-    // these 'auto-named' services are changed to the new name also (and probing is restarted).
-    // The usual '_' before p_pcService (eg. http) and protocol (eg. tcp) may be given.
-    hMDNSService addService(const char* p_pcName,
-                            const char* p_pcService,
-                            const char* p_pcProtocol,
-                            uint16_t p_u16Port);
-    // Removes a service from the MDNS responder
-    bool removeService(const hMDNSService p_hService);
-    bool removeService(const char* p_pcInstanceName,
-                       const char* p_pcServiceName,
-                       const char* p_pcProtocol);
-    // for compatibility...
-    bool addService(const String& p_strServiceName,
-                    const String& p_strProtocol,
-                    uint16_t p_u16Port);
-
-    // Change the services instance name (and restart probing).
-    bool setServiceName(const hMDNSService p_hService,
-                        const char* p_pcInstanceName);
-    //for compatibility
-    //Warning: this has the side effect of changing the hostname.
-    //TODO: implement instancename different from hostname
-    void setInstanceName(const char* p_pcHostname)
-    {
-        setHostname(p_pcHostname);
-    }
-    // for esp32 compatibility
-    void setInstanceName(const String& s_pcHostname)
-    {
-        setInstanceName(s_pcHostname.c_str());
-    }
+        typedef const void* hMDNSService;
+
+        // Add a new service to the MDNS responder. If no name (instance name) is given (p_pcName = 0)
+        // the current hostname is used. If the hostname is changed later, the instance names for
+        // these 'auto-named' services are changed to the new name also (and probing is restarted).
+        // The usual '_' before p_pcService (eg. http) and protocol (eg. tcp) may be given.
+        hMDNSService addService(const char* p_pcName,
+            const char* p_pcService,
+            const char* p_pcProtocol,
+            uint16_t p_u16Port);
+        // Removes a service from the MDNS responder
+        bool removeService(const hMDNSService p_hService);
+        bool removeService(const char* p_pcInstanceName,
+            const char* p_pcServiceName,
+            const char* p_pcProtocol);
+        // for compatibility...
+        bool addService(const String& p_strServiceName,
+            const String& p_strProtocol,
+            uint16_t p_u16Port);
+
+        // Change the services instance name (and restart probing).
+        bool setServiceName(const hMDNSService p_hService,
+            const char* p_pcInstanceName);
+        //for compatibility
+        //Warning: this has the side effect of changing the hostname.
+        //TODO: implement instancename different from hostname
+        void setInstanceName(const char* p_pcHostname)
+        {
+            setHostname(p_pcHostname);
+        }
+        // for esp32 compatibility
+        void setInstanceName(const String& s_pcHostname)
+        {
+            setInstanceName(s_pcHostname.c_str());
+        }
 
-    /**
+        /**
         hMDNSTxt (opaque handle to access the TXT items)
     */
-    typedef void* hMDNSTxt;
-
-    // Add a (static) MDNS TXT item ('key' = 'value') to the service
-    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                           const char* p_pcKey,
-                           const char* p_pcValue);
-    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                           const char* p_pcKey,
-                           uint32_t p_u32Value);
-    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                           const char* p_pcKey,
-                           uint16_t p_u16Value);
-    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                           const char* p_pcKey,
-                           uint8_t p_u8Value);
-    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                           const char* p_pcKey,
-                           int32_t p_i32Value);
-    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                           const char* p_pcKey,
-                           int16_t p_i16Value);
-    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                           const char* p_pcKey,
-                           int8_t p_i8Value);
-
-    // Remove an existing (static) MDNS TXT item from the service
-    bool removeServiceTxt(const hMDNSService p_hService,
-                          const hMDNSTxt p_hTxt);
-    bool removeServiceTxt(const hMDNSService p_hService,
-                          const char* p_pcKey);
-    bool removeServiceTxt(const char* p_pcinstanceName,
-                          const char* p_pcServiceName,
-                          const char* p_pcProtocol,
-                          const char* p_pcKey);
-    // for compatibility...
-    bool addServiceTxt(const char* p_pcService,
-                       const char* p_pcProtocol,
-                       const char* p_pcKey,
-                       const char* p_pcValue);
-    bool addServiceTxt(const String& p_strService,
-                       const String& p_strProtocol,
-                       const String& p_strKey,
-                       const String& p_strValue);
+        typedef void* hMDNSTxt;
+
+        // Add a (static) MDNS TXT item ('key' = 'value') to the service
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+            const char* p_pcKey,
+            const char* p_pcValue);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+            const char* p_pcKey,
+            uint32_t p_u32Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+            const char* p_pcKey,
+            uint16_t p_u16Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+            const char* p_pcKey,
+            uint8_t p_u8Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+            const char* p_pcKey,
+            int32_t p_i32Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+            const char* p_pcKey,
+            int16_t p_i16Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+            const char* p_pcKey,
+            int8_t p_i8Value);
+
+        // Remove an existing (static) MDNS TXT item from the service
+        bool removeServiceTxt(const hMDNSService p_hService,
+            const hMDNSTxt p_hTxt);
+        bool removeServiceTxt(const hMDNSService p_hService,
+            const char* p_pcKey);
+        bool removeServiceTxt(const char* p_pcinstanceName,
+            const char* p_pcServiceName,
+            const char* p_pcProtocol,
+            const char* p_pcKey);
+        // for compatibility...
+        bool addServiceTxt(const char* p_pcService,
+            const char* p_pcProtocol,
+            const char* p_pcKey,
+            const char* p_pcValue);
+        bool addServiceTxt(const String& p_strService,
+            const String& p_strProtocol,
+            const String& p_strKey,
+            const String& p_strValue);
 
-    /**
+        /**
         MDNSDynamicServiceTxtCallbackFn
         Callback function for dynamic MDNS TXT items
     */
 
-    typedef std::function<void(const hMDNSService p_hService)> MDNSDynamicServiceTxtCallbackFunc;
-
-    // Set a global callback for dynamic MDNS TXT items. The callback function is called
-    // every time, a TXT item is needed for one of the installed services.
-    bool setDynamicServiceTxtCallback(MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
-    // Set a service specific callback for dynamic MDNS TXT items. The callback function
-    // is called every time, a TXT item is needed for the given service.
-    bool setDynamicServiceTxtCallback(const hMDNSService p_hService,
-                                      MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
-
-    // Add a (dynamic) MDNS TXT item ('key' = 'value') to the service
-    // Dynamic TXT items are removed right after one-time use. So they need to be added
-    // every time the value s needed (via callback).
-    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                  const char* p_pcKey,
-                                  const char* p_pcValue);
-    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                  const char* p_pcKey,
-                                  uint32_t p_u32Value);
-    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                  const char* p_pcKey,
-                                  uint16_t p_u16Value);
-    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                  const char* p_pcKey,
-                                  uint8_t p_u8Value);
-    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                  const char* p_pcKey,
-                                  int32_t p_i32Value);
-    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                  const char* p_pcKey,
-                                  int16_t p_i16Value);
-    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                  const char* p_pcKey,
-                                  int8_t p_i8Value);
-
-    // Perform a (static) service query. The function returns after p_u16Timeout milliseconds
-    // The answers (the number of received answers is returned) can be retrieved by calling
-    // - answerHostname (or hostname)
-    // - answerIP (or IP)
-    // - answerPort (or port)
-    uint32_t queryService(const char* p_pcService,
-                          const char* p_pcProtocol,
-                          const uint16_t p_u16Timeout = MDNS_QUERYSERVICES_WAIT_TIME);
-    bool removeQuery(void);
-    // for compatibility...
-    uint32_t queryService(const String& p_strService,
-                          const String& p_strProtocol);
-
-    const char* answerHostname(const uint32_t p_u32AnswerIndex);
-    IPAddress answerIP(const uint32_t p_u32AnswerIndex);
-    uint16_t answerPort(const uint32_t p_u32AnswerIndex);
-    // for compatibility...
-    String hostname(const uint32_t p_u32AnswerIndex);
-    IPAddress IP(const uint32_t p_u32AnswerIndex);
-    uint16_t port(const uint32_t p_u32AnswerIndex);
+        typedef std::function<void(const hMDNSService p_hService)> MDNSDynamicServiceTxtCallbackFunc;
+
+        // Set a global callback for dynamic MDNS TXT items. The callback function is called
+        // every time, a TXT item is needed for one of the installed services.
+        bool setDynamicServiceTxtCallback(MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
+        // Set a service specific callback for dynamic MDNS TXT items. The callback function
+        // is called every time, a TXT item is needed for the given service.
+        bool setDynamicServiceTxtCallback(const hMDNSService p_hService,
+            MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
+
+        // Add a (dynamic) MDNS TXT item ('key' = 'value') to the service
+        // Dynamic TXT items are removed right after one-time use. So they need to be added
+        // every time the value s needed (via callback).
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+            const char* p_pcKey,
+            const char* p_pcValue);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+            const char* p_pcKey,
+            uint32_t p_u32Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+            const char* p_pcKey,
+            uint16_t p_u16Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+            const char* p_pcKey,
+            uint8_t p_u8Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+            const char* p_pcKey,
+            int32_t p_i32Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+            const char* p_pcKey,
+            int16_t p_i16Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+            const char* p_pcKey,
+            int8_t p_i8Value);
+
+        // Perform a (static) service query. The function returns after p_u16Timeout milliseconds
+        // The answers (the number of received answers is returned) can be retrieved by calling
+        // - answerHostname (or hostname)
+        // - answerIP (or IP)
+        // - answerPort (or port)
+        uint32_t queryService(const char* p_pcService,
+            const char* p_pcProtocol,
+            const uint16_t p_u16Timeout = MDNS_QUERYSERVICES_WAIT_TIME);
+        bool removeQuery(void);
+        // for compatibility...
+        uint32_t queryService(const String& p_strService,
+            const String& p_strProtocol);
+
+        const char* answerHostname(const uint32_t p_u32AnswerIndex);
+        IPAddress answerIP(const uint32_t p_u32AnswerIndex);
+        uint16_t answerPort(const uint32_t p_u32AnswerIndex);
+        // for compatibility...
+        String hostname(const uint32_t p_u32AnswerIndex);
+        IPAddress IP(const uint32_t p_u32AnswerIndex);
+        uint16_t port(const uint32_t p_u32AnswerIndex);
 
-    /**
+        /**
         hMDNSServiceQuery (opaque handle to access dynamic service queries)
     */
-    typedef const void* hMDNSServiceQuery;
+        typedef const void* hMDNSServiceQuery;
 
-    /**
+        /**
         enuServiceQueryAnswerType
     */
-    typedef enum _enuServiceQueryAnswerType
-    {
-        ServiceQueryAnswerType_ServiceDomain = (1 << 0),      // Service instance name
-        ServiceQueryAnswerType_HostDomainAndPort = (1 << 1),  // Host domain and service port
-        ServiceQueryAnswerType_Txts = (1 << 2),               // TXT items
+        typedef enum _enuServiceQueryAnswerType
+        {
+            ServiceQueryAnswerType_ServiceDomain = (1 << 0),      // Service instance name
+            ServiceQueryAnswerType_HostDomainAndPort = (1 << 1),  // Host domain and service port
+            ServiceQueryAnswerType_Txts = (1 << 2),               // TXT items
 #ifdef MDNS_IP4_SUPPORT
-        ServiceQueryAnswerType_IP4Address = (1 << 3),  // IP4 address
+            ServiceQueryAnswerType_IP4Address = (1 << 3),  // IP4 address
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        ServiceQueryAnswerType_IP6Address = (1 << 4),  // IP6 address
+            ServiceQueryAnswerType_IP6Address = (1 << 4),  // IP6 address
 #endif
-    } enuServiceQueryAnswerType;
+        } enuServiceQueryAnswerType;
 
-    enum class AnswerType : uint32_t
-    {
-        Unknown = 0,
-        ServiceDomain = ServiceQueryAnswerType_ServiceDomain,
-        HostDomainAndPort = ServiceQueryAnswerType_HostDomainAndPort,
-        Txt = ServiceQueryAnswerType_Txts,
+        enum class AnswerType : uint32_t
+        {
+            Unknown = 0,
+            ServiceDomain = ServiceQueryAnswerType_ServiceDomain,
+            HostDomainAndPort = ServiceQueryAnswerType_HostDomainAndPort,
+            Txt = ServiceQueryAnswerType_Txts,
 #ifdef MDNS_IP4_SUPPORT
-        IP4Address = ServiceQueryAnswerType_IP4Address,
+            IP4Address = ServiceQueryAnswerType_IP4Address,
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        IP6Address = ServiceQueryAnswerType_IP6Address,
+            IP6Address = ServiceQueryAnswerType_IP6Address,
 #endif
-    };
+        };
 
-    /**
+        /**
         MDNSServiceQueryCallbackFn
         Callback function for received answers for dynamic service queries
     */
-    struct MDNSServiceInfo;  // forward declaration
-    typedef std::function<void(const MDNSServiceInfo& mdnsServiceInfo,
-                               AnswerType answerType,  // flag for the updated answer item
-                               bool p_bSetContent      // true: Answer component set, false: component deleted
-                               )>
-        MDNSServiceQueryCallbackFunc;
-
-    // Install a dynamic service query. For every received answer (part) the given callback
-    // function is called. The query will be updated every time, the TTL for an answer
-    // has timed-out.
-    // The answers can also be retrieved by calling
-    // - answerCount
-    // - answerServiceDomain
-    // - hasAnswerHostDomain/answerHostDomain
-    // - hasAnswerIP4Address/answerIP4Address
-    // - hasAnswerIP6Address/answerIP6Address
-    // - hasAnswerPort/answerPort
-    // - hasAnswerTxts/answerTxts
-    hMDNSServiceQuery installServiceQuery(const char* p_pcService,
-                                          const char* p_pcProtocol,
-                                          MDNSServiceQueryCallbackFunc p_fnCallback);
-    // Remove a dynamic service query
-    bool removeServiceQuery(hMDNSServiceQuery p_hServiceQuery);
-
-    uint32_t answerCount(const hMDNSServiceQuery p_hServiceQuery);
-    std::vector<MDNSResponder::MDNSServiceInfo> answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery);
-
-    const char* answerServiceDomain(const hMDNSServiceQuery p_hServiceQuery,
-                                    const uint32_t p_u32AnswerIndex);
-    bool hasAnswerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
-                             const uint32_t p_u32AnswerIndex);
-    const char* answerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
-                                 const uint32_t p_u32AnswerIndex);
+        struct MDNSServiceInfo;  // forward declaration
+        typedef std::function<void(const MDNSServiceInfo& mdnsServiceInfo,
+            AnswerType answerType,  // flag for the updated answer item
+            bool p_bSetContent      // true: Answer component set, false: component deleted
+            )>
+            MDNSServiceQueryCallbackFunc;
+
+        // Install a dynamic service query. For every received answer (part) the given callback
+        // function is called. The query will be updated every time, the TTL for an answer
+        // has timed-out.
+        // The answers can also be retrieved by calling
+        // - answerCount
+        // - answerServiceDomain
+        // - hasAnswerHostDomain/answerHostDomain
+        // - hasAnswerIP4Address/answerIP4Address
+        // - hasAnswerIP6Address/answerIP6Address
+        // - hasAnswerPort/answerPort
+        // - hasAnswerTxts/answerTxts
+        hMDNSServiceQuery installServiceQuery(const char* p_pcService,
+            const char* p_pcProtocol,
+            MDNSServiceQueryCallbackFunc p_fnCallback);
+        // Remove a dynamic service query
+        bool removeServiceQuery(hMDNSServiceQuery p_hServiceQuery);
+
+        uint32_t answerCount(const hMDNSServiceQuery p_hServiceQuery);
+        std::vector<MDNSResponder::MDNSServiceInfo> answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery);
+
+        const char* answerServiceDomain(const hMDNSServiceQuery p_hServiceQuery,
+            const uint32_t p_u32AnswerIndex);
+        bool hasAnswerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
+            const uint32_t p_u32AnswerIndex);
+        const char* answerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
+            const uint32_t p_u32AnswerIndex);
 #ifdef MDNS_IP4_SUPPORT
-    bool hasAnswerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
-                             const uint32_t p_u32AnswerIndex);
-    uint32_t answerIP4AddressCount(const hMDNSServiceQuery p_hServiceQuery,
-                                   const uint32_t p_u32AnswerIndex);
-    IPAddress answerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
-                               const uint32_t p_u32AnswerIndex,
-                               const uint32_t p_u32AddressIndex);
+        bool hasAnswerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
+            const uint32_t p_u32AnswerIndex);
+        uint32_t answerIP4AddressCount(const hMDNSServiceQuery p_hServiceQuery,
+            const uint32_t p_u32AnswerIndex);
+        IPAddress answerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
+            const uint32_t p_u32AnswerIndex,
+            const uint32_t p_u32AddressIndex);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-    bool hasAnswerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
-                             const uint32_t p_u32AnswerIndex);
-    uint32_t answerIP6AddressCount(const hMDNSServiceQuery p_hServiceQuery,
-                                   const uint32_t p_u32AnswerIndex);
-    IPAddress answerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
-                               const uint32_t p_u32AnswerIndex,
-                               const uint32_t p_u32AddressIndex);
+        bool hasAnswerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
+            const uint32_t p_u32AnswerIndex);
+        uint32_t answerIP6AddressCount(const hMDNSServiceQuery p_hServiceQuery,
+            const uint32_t p_u32AnswerIndex);
+        IPAddress answerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
+            const uint32_t p_u32AnswerIndex,
+            const uint32_t p_u32AddressIndex);
 #endif
-    bool hasAnswerPort(const hMDNSServiceQuery p_hServiceQuery,
-                       const uint32_t p_u32AnswerIndex);
-    uint16_t answerPort(const hMDNSServiceQuery p_hServiceQuery,
-                        const uint32_t p_u32AnswerIndex);
-    bool hasAnswerTxts(const hMDNSServiceQuery p_hServiceQuery,
-                       const uint32_t p_u32AnswerIndex);
-    // Get the TXT items as a ';'-separated string
-    const char* answerTxts(const hMDNSServiceQuery p_hServiceQuery,
-                           const uint32_t p_u32AnswerIndex);
+        bool hasAnswerPort(const hMDNSServiceQuery p_hServiceQuery,
+            const uint32_t p_u32AnswerIndex);
+        uint16_t answerPort(const hMDNSServiceQuery p_hServiceQuery,
+            const uint32_t p_u32AnswerIndex);
+        bool hasAnswerTxts(const hMDNSServiceQuery p_hServiceQuery,
+            const uint32_t p_u32AnswerIndex);
+        // Get the TXT items as a ';'-separated string
+        const char* answerTxts(const hMDNSServiceQuery p_hServiceQuery,
+            const uint32_t p_u32AnswerIndex);
 
-    /**
+        /**
         MDNSProbeResultCallbackFn
         Callback function for (host and service domain) probe results
     */
-    typedef std::function<void(const char* p_pcDomainName,
-                               bool p_bProbeResult)>
-        MDNSHostProbeFn;
-
-    typedef std::function<void(MDNSResponder& resp,
-                               const char* p_pcDomainName,
-                               bool p_bProbeResult)>
-        MDNSHostProbeFn1;
-
-    typedef std::function<void(const char* p_pcServiceName,
-                               const hMDNSService p_hMDNSService,
-                               bool p_bProbeResult)>
-        MDNSServiceProbeFn;
-
-    typedef std::function<void(MDNSResponder& resp,
-                               const char* p_pcServiceName,
-                               const hMDNSService p_hMDNSService,
-                               bool p_bProbeResult)>
-        MDNSServiceProbeFn1;
-
-    // Set a global callback function for host and service probe results
-    // The callback function is called, when the probing for the host domain
-    // (or a service domain, which hasn't got a service specific callback)
-    // Succeeds or fails.
-    // In case of failure, the failed domain name should be changed.
-    bool setHostProbeResultCallback(MDNSHostProbeFn p_fnCallback);
-    bool setHostProbeResultCallback(MDNSHostProbeFn1 p_fnCallback);
-
-    // Set a service specific probe result callback
-    bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-                                       MDNSServiceProbeFn p_fnCallback);
-    bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-                                       MDNSServiceProbeFn1 p_fnCallback);
-
-    // Application should call this whenever AP is configured/disabled
-    bool notifyAPChange(void);
-
-    // 'update' should be called in every 'loop' to run the MDNS processing
-    bool update(void);
-
-    // 'announce' can be called every time, the configuration of some service
-    // changes. Mainly, this would be changed content of TXT items.
-    bool announce(void);
-
-    // Enable OTA update
-    hMDNSService enableArduino(uint16_t p_u16Port,
-                               bool p_bAuthUpload = false);
-
-    // Domain name helper
-    static bool indexDomain(char*& p_rpcDomain,
-                            const char* p_pcDivider = "-",
-                            const char* p_pcDefaultDomain = 0);
-
-    /** STRUCTS **/
-
-   public:
-    /**
+        typedef std::function<void(const char* p_pcDomainName,
+            bool p_bProbeResult)>
+            MDNSHostProbeFn;
+
+        typedef std::function<void(MDNSResponder& resp,
+            const char* p_pcDomainName,
+            bool p_bProbeResult)>
+            MDNSHostProbeFn1;
+
+        typedef std::function<void(const char* p_pcServiceName,
+            const hMDNSService p_hMDNSService,
+            bool p_bProbeResult)>
+            MDNSServiceProbeFn;
+
+        typedef std::function<void(MDNSResponder& resp,
+            const char* p_pcServiceName,
+            const hMDNSService p_hMDNSService,
+            bool p_bProbeResult)>
+            MDNSServiceProbeFn1;
+
+        // Set a global callback function for host and service probe results
+        // The callback function is called, when the probing for the host domain
+        // (or a service domain, which hasn't got a service specific callback)
+        // Succeeds or fails.
+        // In case of failure, the failed domain name should be changed.
+        bool setHostProbeResultCallback(MDNSHostProbeFn p_fnCallback);
+        bool setHostProbeResultCallback(MDNSHostProbeFn1 p_fnCallback);
+
+        // Set a service specific probe result callback
+        bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+            MDNSServiceProbeFn p_fnCallback);
+        bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+            MDNSServiceProbeFn1 p_fnCallback);
+
+        // Application should call this whenever AP is configured/disabled
+        bool notifyAPChange(void);
+
+        // 'update' should be called in every 'loop' to run the MDNS processing
+        bool update(void);
+
+        // 'announce' can be called every time, the configuration of some service
+        // changes. Mainly, this would be changed content of TXT items.
+        bool announce(void);
+
+        // Enable OTA update
+        hMDNSService enableArduino(uint16_t p_u16Port,
+            bool p_bAuthUpload = false);
+
+        // Domain name helper
+        static bool indexDomain(char*& p_rpcDomain,
+            const char* p_pcDivider = "-",
+            const char* p_pcDefaultDomain = 0);
+
+        /** STRUCTS **/
+
+    public:
+        /**
         MDNSServiceInfo, used in application callbacks
     */
-    struct MDNSServiceInfo
-    {
-        MDNSServiceInfo(MDNSResponder& p_pM, MDNSResponder::hMDNSServiceQuery p_hS, uint32_t p_u32A)
-            : p_pMDNSResponder(p_pM),
-              p_hServiceQuery(p_hS),
-              p_u32AnswerIndex(p_u32A){};
-        struct CompareKey
+        struct MDNSServiceInfo
         {
-            bool operator()(char const* a, char const* b) const
+            MDNSServiceInfo(MDNSResponder& p_pM, MDNSResponder::hMDNSServiceQuery p_hS, uint32_t p_u32A)
+                : p_pMDNSResponder(p_pM)
+                , p_hServiceQuery(p_hS)
+                , p_u32AnswerIndex(p_u32A) {};
+            struct CompareKey
             {
-                return strcmp(a, b) < 0;
-            }
-        };
-        using KeyValueMap = std::map<const char*, const char*, CompareKey>;
+                bool operator()(char const* a, char const* b) const
+                {
+                    return strcmp(a, b) < 0;
+                }
+            };
+            using KeyValueMap = std::map<const char*, const char*, CompareKey>;
 
-       protected:
-        MDNSResponder& p_pMDNSResponder;
-        MDNSResponder::hMDNSServiceQuery p_hServiceQuery;
-        uint32_t p_u32AnswerIndex;
-        KeyValueMap keyValueMap;
+        protected:
+            MDNSResponder& p_pMDNSResponder;
+            MDNSResponder::hMDNSServiceQuery p_hServiceQuery;
+            uint32_t p_u32AnswerIndex;
+            KeyValueMap keyValueMap;
 
-       public:
-        const char* serviceDomain()
-        {
-            return p_pMDNSResponder.answerServiceDomain(p_hServiceQuery, p_u32AnswerIndex);
-        };
-        bool hostDomainAvailable()
-        {
-            return (p_pMDNSResponder.hasAnswerHostDomain(p_hServiceQuery, p_u32AnswerIndex));
-        }
-        const char* hostDomain()
-        {
-            return (hostDomainAvailable()) ? p_pMDNSResponder.answerHostDomain(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
-        };
-        bool hostPortAvailable()
-        {
-            return (p_pMDNSResponder.hasAnswerPort(p_hServiceQuery, p_u32AnswerIndex));
-        }
-        uint16_t hostPort()
-        {
-            return (hostPortAvailable()) ? p_pMDNSResponder.answerPort(p_hServiceQuery, p_u32AnswerIndex) : 0;
-        };
-        bool IP4AddressAvailable()
-        {
-            return (p_pMDNSResponder.hasAnswerIP4Address(p_hServiceQuery, p_u32AnswerIndex));
-        }
-        std::vector<IPAddress> IP4Adresses()
-        {
-            std::vector<IPAddress> internalIP;
-            if (IP4AddressAvailable())
+        public:
+            const char* serviceDomain()
+            {
+                return p_pMDNSResponder.answerServiceDomain(p_hServiceQuery, p_u32AnswerIndex);
+            };
+            bool hostDomainAvailable()
+            {
+                return (p_pMDNSResponder.hasAnswerHostDomain(p_hServiceQuery, p_u32AnswerIndex));
+            }
+            const char* hostDomain()
+            {
+                return (hostDomainAvailable()) ? p_pMDNSResponder.answerHostDomain(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
+            };
+            bool hostPortAvailable()
+            {
+                return (p_pMDNSResponder.hasAnswerPort(p_hServiceQuery, p_u32AnswerIndex));
+            }
+            uint16_t hostPort()
+            {
+                return (hostPortAvailable()) ? p_pMDNSResponder.answerPort(p_hServiceQuery, p_u32AnswerIndex) : 0;
+            };
+            bool IP4AddressAvailable()
+            {
+                return (p_pMDNSResponder.hasAnswerIP4Address(p_hServiceQuery, p_u32AnswerIndex));
+            }
+            std::vector<IPAddress> IP4Adresses()
             {
-                uint16_t cntIP4Adress = p_pMDNSResponder.answerIP4AddressCount(p_hServiceQuery, p_u32AnswerIndex);
-                for (uint32_t u2 = 0; u2 < cntIP4Adress; ++u2)
+                std::vector<IPAddress> internalIP;
+                if (IP4AddressAvailable())
                 {
-                    internalIP.emplace_back(p_pMDNSResponder.answerIP4Address(p_hServiceQuery, p_u32AnswerIndex, u2));
+                    uint16_t cntIP4Adress = p_pMDNSResponder.answerIP4AddressCount(p_hServiceQuery, p_u32AnswerIndex);
+                    for (uint32_t u2 = 0; u2 < cntIP4Adress; ++u2)
+                    {
+                        internalIP.emplace_back(p_pMDNSResponder.answerIP4Address(p_hServiceQuery, p_u32AnswerIndex, u2));
+                    }
                 }
+                return internalIP;
+            };
+            bool txtAvailable()
+            {
+                return (p_pMDNSResponder.hasAnswerTxts(p_hServiceQuery, p_u32AnswerIndex));
             }
-            return internalIP;
-        };
-        bool txtAvailable()
-        {
-            return (p_pMDNSResponder.hasAnswerTxts(p_hServiceQuery, p_u32AnswerIndex));
-        }
-        const char* strKeyValue()
-        {
-            return (txtAvailable()) ? p_pMDNSResponder.answerTxts(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
-        };
-        const KeyValueMap& keyValues()
-        {
-            if (txtAvailable() && keyValueMap.size() == 0)
+            const char* strKeyValue()
+            {
+                return (txtAvailable()) ? p_pMDNSResponder.answerTxts(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
+            };
+            const KeyValueMap& keyValues()
             {
-                for (auto kv = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); kv != nullptr; kv = kv->m_pNext)
+                if (txtAvailable() && keyValueMap.size() == 0)
                 {
-                    keyValueMap.emplace(std::pair<const char*, const char*>(kv->m_pcKey, kv->m_pcValue));
+                    for (auto kv = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); kv != nullptr; kv = kv->m_pNext)
+                    {
+                        keyValueMap.emplace(std::pair<const char*, const char*>(kv->m_pcKey, kv->m_pcValue));
+                    }
                 }
+                return keyValueMap;
             }
-            return keyValueMap;
-        }
-        const char* value(const char* key)
-        {
-            char* result = nullptr;
-
-            for (stcMDNSServiceTxt* pTxt = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); pTxt; pTxt = pTxt->m_pNext)
+            const char* value(const char* key)
             {
-                if ((key) &&
-                    (0 == strcmp(pTxt->m_pcKey, key)))
+                char* result = nullptr;
+
+                for (stcMDNSServiceTxt* pTxt = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); pTxt; pTxt = pTxt->m_pNext)
                 {
-                    result = pTxt->m_pcValue;
-                    break;
+                    if ((key) && (0 == strcmp(pTxt->m_pcKey, key)))
+                    {
+                        result = pTxt->m_pcValue;
+                        break;
+                    }
                 }
+                return result;
             }
-            return result;
-        }
-    };
+        };
 
-   protected:
-    /**
+    protected:
+        /**
         stcMDNSServiceTxt
     */
-    struct stcMDNSServiceTxt
-    {
-        stcMDNSServiceTxt* m_pNext;
-        char* m_pcKey;
-        char* m_pcValue;
-        bool m_bTemp;
-
-        stcMDNSServiceTxt(const char* p_pcKey = 0,
-                          const char* p_pcValue = 0,
-                          bool p_bTemp = false);
-        stcMDNSServiceTxt(const stcMDNSServiceTxt& p_Other);
-        ~stcMDNSServiceTxt(void);
-
-        stcMDNSServiceTxt& operator=(const stcMDNSServiceTxt& p_Other);
-        bool clear(void);
-
-        char* allocKey(size_t p_stLength);
-        bool setKey(const char* p_pcKey,
-                    size_t p_stLength);
-        bool setKey(const char* p_pcKey);
-        bool releaseKey(void);
-
-        char* allocValue(size_t p_stLength);
-        bool setValue(const char* p_pcValue,
-                      size_t p_stLength);
-        bool setValue(const char* p_pcValue);
-        bool releaseValue(void);
-
-        bool set(const char* p_pcKey,
-                 const char* p_pcValue,
-                 bool p_bTemp = false);
-
-        bool update(const char* p_pcValue);
-
-        size_t length(void) const;
-    };
+        struct stcMDNSServiceTxt
+        {
+            stcMDNSServiceTxt* m_pNext;
+            char* m_pcKey;
+            char* m_pcValue;
+            bool m_bTemp;
+
+            stcMDNSServiceTxt(const char* p_pcKey = 0,
+                const char* p_pcValue = 0,
+                bool p_bTemp = false);
+            stcMDNSServiceTxt(const stcMDNSServiceTxt& p_Other);
+            ~stcMDNSServiceTxt(void);
+
+            stcMDNSServiceTxt& operator=(const stcMDNSServiceTxt& p_Other);
+            bool clear(void);
 
-    /**
+            char* allocKey(size_t p_stLength);
+            bool setKey(const char* p_pcKey,
+                size_t p_stLength);
+            bool setKey(const char* p_pcKey);
+            bool releaseKey(void);
+
+            char* allocValue(size_t p_stLength);
+            bool setValue(const char* p_pcValue,
+                size_t p_stLength);
+            bool setValue(const char* p_pcValue);
+            bool releaseValue(void);
+
+            bool set(const char* p_pcKey,
+                const char* p_pcValue,
+                bool p_bTemp = false);
+
+            bool update(const char* p_pcValue);
+
+            size_t length(void) const;
+        };
+
+        /**
         stcMDNSTxts
     */
-    struct stcMDNSServiceTxts
-    {
-        stcMDNSServiceTxt* m_pTxts;
+        struct stcMDNSServiceTxts
+        {
+            stcMDNSServiceTxt* m_pTxts;
 
-        stcMDNSServiceTxts(void);
-        stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other);
-        ~stcMDNSServiceTxts(void);
+            stcMDNSServiceTxts(void);
+            stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other);
+            ~stcMDNSServiceTxts(void);
 
-        stcMDNSServiceTxts& operator=(const stcMDNSServiceTxts& p_Other);
+            stcMDNSServiceTxts& operator=(const stcMDNSServiceTxts& p_Other);
 
-        bool clear(void);
+            bool clear(void);
 
-        bool add(stcMDNSServiceTxt* p_pTxt);
-        bool remove(stcMDNSServiceTxt* p_pTxt);
+            bool add(stcMDNSServiceTxt* p_pTxt);
+            bool remove(stcMDNSServiceTxt* p_pTxt);
 
-        bool removeTempTxts(void);
+            bool removeTempTxts(void);
 
-        stcMDNSServiceTxt* find(const char* p_pcKey);
-        const stcMDNSServiceTxt* find(const char* p_pcKey) const;
-        stcMDNSServiceTxt* find(const stcMDNSServiceTxt* p_pTxt);
+            stcMDNSServiceTxt* find(const char* p_pcKey);
+            const stcMDNSServiceTxt* find(const char* p_pcKey) const;
+            stcMDNSServiceTxt* find(const stcMDNSServiceTxt* p_pTxt);
 
-        uint16_t length(void) const;
+            uint16_t length(void) const;
 
-        size_t c_strLength(void) const;
-        bool c_str(char* p_pcBuffer);
+            size_t c_strLength(void) const;
+            bool c_str(char* p_pcBuffer);
 
-        size_t bufferLength(void) const;
-        bool buffer(char* p_pcBuffer);
+            size_t bufferLength(void) const;
+            bool buffer(char* p_pcBuffer);
 
-        bool compare(const stcMDNSServiceTxts& p_Other) const;
-        bool operator==(const stcMDNSServiceTxts& p_Other) const;
-        bool operator!=(const stcMDNSServiceTxts& p_Other) const;
-    };
+            bool compare(const stcMDNSServiceTxts& p_Other) const;
+            bool operator==(const stcMDNSServiceTxts& p_Other) const;
+            bool operator!=(const stcMDNSServiceTxts& p_Other) const;
+        };
 
-    /**
+        /**
         enuContentFlags
     */
-    typedef enum _enuContentFlags
-    {
-        // Host
-        ContentFlag_A = 0x01,
-        ContentFlag_PTR_IP4 = 0x02,
-        ContentFlag_PTR_IP6 = 0x04,
-        ContentFlag_AAAA = 0x08,
-        // Service
-        ContentFlag_PTR_TYPE = 0x10,
-        ContentFlag_PTR_NAME = 0x20,
-        ContentFlag_TXT = 0x40,
-        ContentFlag_SRV = 0x80,
-    } enuContentFlags;
+        typedef enum _enuContentFlags
+        {
+            // Host
+            ContentFlag_A = 0x01,
+            ContentFlag_PTR_IP4 = 0x02,
+            ContentFlag_PTR_IP6 = 0x04,
+            ContentFlag_AAAA = 0x08,
+            // Service
+            ContentFlag_PTR_TYPE = 0x10,
+            ContentFlag_PTR_NAME = 0x20,
+            ContentFlag_TXT = 0x40,
+            ContentFlag_SRV = 0x80,
+        } enuContentFlags;
 
-    /**
+        /**
         stcMDNS_MsgHeader
     */
-    struct stcMDNS_MsgHeader
-    {
-        uint16_t m_u16ID;              // Identifier
-        bool m_1bQR : 1;               // Query/Response flag
-        unsigned char m_4bOpcode : 4;  // Operation code
-        bool m_1bAA : 1;               // Authoritative Answer flag
-        bool m_1bTC : 1;               // Truncation flag
-        bool m_1bRD : 1;               // Recursion desired
-        bool m_1bRA : 1;               // Recursion available
-        unsigned char m_3bZ : 3;       // Zero
-        unsigned char m_4bRCode : 4;   // Response code
-        uint16_t m_u16QDCount;         // Question count
-        uint16_t m_u16ANCount;         // Answer count
-        uint16_t m_u16NSCount;         // Authority Record count
-        uint16_t m_u16ARCount;         // Additional Record count
-
-        stcMDNS_MsgHeader(uint16_t p_u16ID = 0,
-                          bool p_bQR = false,
-                          unsigned char p_ucOpcode = 0,
-                          bool p_bAA = false,
-                          bool p_bTC = false,
-                          bool p_bRD = false,
-                          bool p_bRA = false,
-                          unsigned char p_ucRCode = 0,
-                          uint16_t p_u16QDCount = 0,
-                          uint16_t p_u16ANCount = 0,
-                          uint16_t p_u16NSCount = 0,
-                          uint16_t p_u16ARCount = 0);
-    };
+        struct stcMDNS_MsgHeader
+        {
+            uint16_t m_u16ID;              // Identifier
+            bool m_1bQR : 1;               // Query/Response flag
+            unsigned char m_4bOpcode : 4;  // Operation code
+            bool m_1bAA : 1;               // Authoritative Answer flag
+            bool m_1bTC : 1;               // Truncation flag
+            bool m_1bRD : 1;               // Recursion desired
+            bool m_1bRA : 1;               // Recursion available
+            unsigned char m_3bZ : 3;       // Zero
+            unsigned char m_4bRCode : 4;   // Response code
+            uint16_t m_u16QDCount;         // Question count
+            uint16_t m_u16ANCount;         // Answer count
+            uint16_t m_u16NSCount;         // Authority Record count
+            uint16_t m_u16ARCount;         // Additional Record count
+
+            stcMDNS_MsgHeader(uint16_t p_u16ID = 0,
+                bool p_bQR = false,
+                unsigned char p_ucOpcode = 0,
+                bool p_bAA = false,
+                bool p_bTC = false,
+                bool p_bRD = false,
+                bool p_bRA = false,
+                unsigned char p_ucRCode = 0,
+                uint16_t p_u16QDCount = 0,
+                uint16_t p_u16ANCount = 0,
+                uint16_t p_u16NSCount = 0,
+                uint16_t p_u16ARCount = 0);
+        };
 
-    /**
+        /**
         stcMDNS_RRDomain
     */
-    struct stcMDNS_RRDomain
-    {
-        char m_acName[MDNS_DOMAIN_MAXLENGTH];  // Encoded domain name
-        uint16_t m_u16NameLength;              // Length (incl. '\0')
+        struct stcMDNS_RRDomain
+        {
+            char m_acName[MDNS_DOMAIN_MAXLENGTH];  // Encoded domain name
+            uint16_t m_u16NameLength;              // Length (incl. '\0')
 
-        stcMDNS_RRDomain(void);
-        stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other);
+            stcMDNS_RRDomain(void);
+            stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other);
 
-        stcMDNS_RRDomain& operator=(const stcMDNS_RRDomain& p_Other);
+            stcMDNS_RRDomain& operator=(const stcMDNS_RRDomain& p_Other);
 
-        bool clear(void);
+            bool clear(void);
 
-        bool addLabel(const char* p_pcLabel,
-                      bool p_bPrependUnderline = false);
+            bool addLabel(const char* p_pcLabel,
+                bool p_bPrependUnderline = false);
 
-        bool compare(const stcMDNS_RRDomain& p_Other) const;
-        bool operator==(const stcMDNS_RRDomain& p_Other) const;
-        bool operator!=(const stcMDNS_RRDomain& p_Other) const;
-        bool operator>(const stcMDNS_RRDomain& p_Other) const;
+            bool compare(const stcMDNS_RRDomain& p_Other) const;
+            bool operator==(const stcMDNS_RRDomain& p_Other) const;
+            bool operator!=(const stcMDNS_RRDomain& p_Other) const;
+            bool operator>(const stcMDNS_RRDomain& p_Other) const;
 
-        size_t c_strLength(void) const;
-        bool c_str(char* p_pcBuffer);
-    };
+            size_t c_strLength(void) const;
+            bool c_str(char* p_pcBuffer);
+        };
 
-    /**
+        /**
         stcMDNS_RRAttributes
     */
-    struct stcMDNS_RRAttributes
-    {
-        uint16_t m_u16Type;   // Type
-        uint16_t m_u16Class;  // Class, nearly always 'IN'
+        struct stcMDNS_RRAttributes
+        {
+            uint16_t m_u16Type;   // Type
+            uint16_t m_u16Class;  // Class, nearly always 'IN'
 
-        stcMDNS_RRAttributes(uint16_t p_u16Type = 0,
-                             uint16_t p_u16Class = 1 /*DNS_RRCLASS_IN Internet*/);
-        stcMDNS_RRAttributes(const stcMDNS_RRAttributes& p_Other);
+            stcMDNS_RRAttributes(uint16_t p_u16Type = 0,
+                uint16_t p_u16Class = 1 /*DNS_RRCLASS_IN Internet*/);
+            stcMDNS_RRAttributes(const stcMDNS_RRAttributes& p_Other);
 
-        stcMDNS_RRAttributes& operator=(const stcMDNS_RRAttributes& p_Other);
-    };
+            stcMDNS_RRAttributes& operator=(const stcMDNS_RRAttributes& p_Other);
+        };
 
-    /**
+        /**
         stcMDNS_RRHeader
     */
-    struct stcMDNS_RRHeader
-    {
-        stcMDNS_RRDomain m_Domain;
-        stcMDNS_RRAttributes m_Attributes;
+        struct stcMDNS_RRHeader
+        {
+            stcMDNS_RRDomain m_Domain;
+            stcMDNS_RRAttributes m_Attributes;
 
-        stcMDNS_RRHeader(void);
-        stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other);
+            stcMDNS_RRHeader(void);
+            stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other);
 
-        stcMDNS_RRHeader& operator=(const stcMDNS_RRHeader& p_Other);
+            stcMDNS_RRHeader& operator=(const stcMDNS_RRHeader& p_Other);
 
-        bool clear(void);
-    };
+            bool clear(void);
+        };
 
-    /**
+        /**
         stcMDNS_RRQuestion
     */
-    struct stcMDNS_RRQuestion
-    {
-        stcMDNS_RRQuestion* m_pNext;
-        stcMDNS_RRHeader m_Header;
-        bool m_bUnicast;  // Unicast reply requested
+        struct stcMDNS_RRQuestion
+        {
+            stcMDNS_RRQuestion* m_pNext;
+            stcMDNS_RRHeader m_Header;
+            bool m_bUnicast;  // Unicast reply requested
 
-        stcMDNS_RRQuestion(void);
-    };
+            stcMDNS_RRQuestion(void);
+        };
 
-    /**
+        /**
         enuAnswerType
     */
-    typedef enum _enuAnswerType
-    {
-        AnswerType_A,
-        AnswerType_PTR,
-        AnswerType_TXT,
-        AnswerType_AAAA,
-        AnswerType_SRV,
-        AnswerType_Generic
-    } enuAnswerType;
+        typedef enum _enuAnswerType
+        {
+            AnswerType_A,
+            AnswerType_PTR,
+            AnswerType_TXT,
+            AnswerType_AAAA,
+            AnswerType_SRV,
+            AnswerType_Generic
+        } enuAnswerType;
 
-    /**
+        /**
         stcMDNS_RRAnswer
     */
-    struct stcMDNS_RRAnswer
-    {
-        stcMDNS_RRAnswer* m_pNext;
-        const enuAnswerType m_AnswerType;
-        stcMDNS_RRHeader m_Header;
-        bool m_bCacheFlush;  // Cache flush command bit
-        uint32_t m_u32TTL;   // Validity time in seconds
+        struct stcMDNS_RRAnswer
+        {
+            stcMDNS_RRAnswer* m_pNext;
+            const enuAnswerType m_AnswerType;
+            stcMDNS_RRHeader m_Header;
+            bool m_bCacheFlush;  // Cache flush command bit
+            uint32_t m_u32TTL;   // Validity time in seconds
 
-        virtual ~stcMDNS_RRAnswer(void);
+            virtual ~stcMDNS_RRAnswer(void);
 
-        enuAnswerType answerType(void) const;
+            enuAnswerType answerType(void) const;
 
-        bool clear(void);
+            bool clear(void);
 
-       protected:
-        stcMDNS_RRAnswer(enuAnswerType p_AnswerType,
-                         const stcMDNS_RRHeader& p_Header,
-                         uint32_t p_u32TTL);
-    };
+        protected:
+            stcMDNS_RRAnswer(enuAnswerType p_AnswerType,
+                const stcMDNS_RRHeader& p_Header,
+                uint32_t p_u32TTL);
+        };
 
 #ifdef MDNS_IP4_SUPPORT
-    /**
+        /**
         stcMDNS_RRAnswerA
     */
-    struct stcMDNS_RRAnswerA : public stcMDNS_RRAnswer
-    {
-        IPAddress m_IPAddress;
+        struct stcMDNS_RRAnswerA : public stcMDNS_RRAnswer
+        {
+            IPAddress m_IPAddress;
 
-        stcMDNS_RRAnswerA(const stcMDNS_RRHeader& p_Header,
-                          uint32_t p_u32TTL);
-        ~stcMDNS_RRAnswerA(void);
+            stcMDNS_RRAnswerA(const stcMDNS_RRHeader& p_Header,
+                uint32_t p_u32TTL);
+            ~stcMDNS_RRAnswerA(void);
 
-        bool clear(void);
-    };
+            bool clear(void);
+        };
 #endif
 
-    /**
+        /**
         stcMDNS_RRAnswerPTR
     */
-    struct stcMDNS_RRAnswerPTR : public stcMDNS_RRAnswer
-    {
-        stcMDNS_RRDomain m_PTRDomain;
+        struct stcMDNS_RRAnswerPTR : public stcMDNS_RRAnswer
+        {
+            stcMDNS_RRDomain m_PTRDomain;
 
-        stcMDNS_RRAnswerPTR(const stcMDNS_RRHeader& p_Header,
-                            uint32_t p_u32TTL);
-        ~stcMDNS_RRAnswerPTR(void);
+            stcMDNS_RRAnswerPTR(const stcMDNS_RRHeader& p_Header,
+                uint32_t p_u32TTL);
+            ~stcMDNS_RRAnswerPTR(void);
 
-        bool clear(void);
-    };
+            bool clear(void);
+        };
 
-    /**
+        /**
         stcMDNS_RRAnswerTXT
     */
-    struct stcMDNS_RRAnswerTXT : public stcMDNS_RRAnswer
-    {
-        stcMDNSServiceTxts m_Txts;
+        struct stcMDNS_RRAnswerTXT : public stcMDNS_RRAnswer
+        {
+            stcMDNSServiceTxts m_Txts;
 
-        stcMDNS_RRAnswerTXT(const stcMDNS_RRHeader& p_Header,
-                            uint32_t p_u32TTL);
-        ~stcMDNS_RRAnswerTXT(void);
+            stcMDNS_RRAnswerTXT(const stcMDNS_RRHeader& p_Header,
+                uint32_t p_u32TTL);
+            ~stcMDNS_RRAnswerTXT(void);
 
-        bool clear(void);
-    };
+            bool clear(void);
+        };
 
 #ifdef MDNS_IP6_SUPPORT
-    /**
+        /**
         stcMDNS_RRAnswerAAAA
     */
-    struct stcMDNS_RRAnswerAAAA : public stcMDNS_RRAnswer
-    {
-        //TODO: IP6Address          m_IPAddress;
+        struct stcMDNS_RRAnswerAAAA : public stcMDNS_RRAnswer
+        {
+            //TODO: IP6Address          m_IPAddress;
 
-        stcMDNS_RRAnswerAAAA(const stcMDNS_RRHeader& p_Header,
-                             uint32_t p_u32TTL);
-        ~stcMDNS_RRAnswerAAAA(void);
+            stcMDNS_RRAnswerAAAA(const stcMDNS_RRHeader& p_Header,
+                uint32_t p_u32TTL);
+            ~stcMDNS_RRAnswerAAAA(void);
 
-        bool clear(void);
-    };
+            bool clear(void);
+        };
 #endif
 
-    /**
+        /**
         stcMDNS_RRAnswerSRV
     */
-    struct stcMDNS_RRAnswerSRV : public stcMDNS_RRAnswer
-    {
-        uint16_t m_u16Priority;
-        uint16_t m_u16Weight;
-        uint16_t m_u16Port;
-        stcMDNS_RRDomain m_SRVDomain;
+        struct stcMDNS_RRAnswerSRV : public stcMDNS_RRAnswer
+        {
+            uint16_t m_u16Priority;
+            uint16_t m_u16Weight;
+            uint16_t m_u16Port;
+            stcMDNS_RRDomain m_SRVDomain;
 
-        stcMDNS_RRAnswerSRV(const stcMDNS_RRHeader& p_Header,
-                            uint32_t p_u32TTL);
-        ~stcMDNS_RRAnswerSRV(void);
+            stcMDNS_RRAnswerSRV(const stcMDNS_RRHeader& p_Header,
+                uint32_t p_u32TTL);
+            ~stcMDNS_RRAnswerSRV(void);
 
-        bool clear(void);
-    };
+            bool clear(void);
+        };
 
-    /**
+        /**
         stcMDNS_RRAnswerGeneric
     */
-    struct stcMDNS_RRAnswerGeneric : public stcMDNS_RRAnswer
-    {
-        uint16_t m_u16RDLength;  // Length of variable answer
-        uint8_t* m_pu8RDData;    // Offset of start of variable answer in packet
+        struct stcMDNS_RRAnswerGeneric : public stcMDNS_RRAnswer
+        {
+            uint16_t m_u16RDLength;  // Length of variable answer
+            uint8_t* m_pu8RDData;    // Offset of start of variable answer in packet
 
-        stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
-                                uint32_t p_u32TTL);
-        ~stcMDNS_RRAnswerGeneric(void);
+            stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
+                uint32_t p_u32TTL);
+            ~stcMDNS_RRAnswerGeneric(void);
 
-        bool clear(void);
-    };
+            bool clear(void);
+        };
 
-    /**
+        /**
         enuProbingStatus
     */
-    typedef enum _enuProbingStatus
-    {
-        ProbingStatus_WaitingForData,
-        ProbingStatus_ReadyToStart,
-        ProbingStatus_InProgress,
-        ProbingStatus_Done
-    } enuProbingStatus;
+        typedef enum _enuProbingStatus
+        {
+            ProbingStatus_WaitingForData,
+            ProbingStatus_ReadyToStart,
+            ProbingStatus_InProgress,
+            ProbingStatus_Done
+        } enuProbingStatus;
 
-    /**
+        /**
         stcProbeInformation
     */
-    struct stcProbeInformation
-    {
-        enuProbingStatus m_ProbingStatus;
-        uint8_t m_u8SentCount;                        // Used for probes and announcements
-        esp8266::polledTimeout::oneShotMs m_Timeout;  // Used for probes and announcements
-        //clsMDNSTimeFlag                   m_TimeFlag;     // Used for probes and announcements
-        bool m_bConflict;
-        bool m_bTiebreakNeeded;
-        MDNSHostProbeFn m_fnHostProbeResultCallback;
-        MDNSServiceProbeFn m_fnServiceProbeResultCallback;
-
-        stcProbeInformation(void);
-
-        bool clear(bool p_bClearUserdata = false);
-    };
+        struct stcProbeInformation
+        {
+            enuProbingStatus m_ProbingStatus;
+            uint8_t m_u8SentCount;                        // Used for probes and announcements
+            esp8266::polledTimeout::oneShotMs m_Timeout;  // Used for probes and announcements
+            //clsMDNSTimeFlag                   m_TimeFlag;     // Used for probes and announcements
+            bool m_bConflict;
+            bool m_bTiebreakNeeded;
+            MDNSHostProbeFn m_fnHostProbeResultCallback;
+            MDNSServiceProbeFn m_fnServiceProbeResultCallback;
+
+            stcProbeInformation(void);
+
+            bool clear(bool p_bClearUserdata = false);
+        };
 
-    /**
+        /**
         stcMDNSService
     */
-    struct stcMDNSService
-    {
-        stcMDNSService* m_pNext;
-        char* m_pcName;
-        bool m_bAutoName;  // Name was set automatically to hostname (if no name was supplied)
-        char* m_pcService;
-        char* m_pcProtocol;
-        uint16_t m_u16Port;
-        uint8_t m_u8ReplyMask;
-        stcMDNSServiceTxts m_Txts;
-        MDNSDynamicServiceTxtCallbackFunc m_fnTxtCallback;
-        stcProbeInformation m_ProbeInformation;
-
-        stcMDNSService(const char* p_pcName = 0,
-                       const char* p_pcService = 0,
-                       const char* p_pcProtocol = 0);
-        ~stcMDNSService(void);
-
-        bool setName(const char* p_pcName);
-        bool releaseName(void);
-
-        bool setService(const char* p_pcService);
-        bool releaseService(void);
-
-        bool setProtocol(const char* p_pcProtocol);
-        bool releaseProtocol(void);
-    };
+        struct stcMDNSService
+        {
+            stcMDNSService* m_pNext;
+            char* m_pcName;
+            bool m_bAutoName;  // Name was set automatically to hostname (if no name was supplied)
+            char* m_pcService;
+            char* m_pcProtocol;
+            uint16_t m_u16Port;
+            uint8_t m_u8ReplyMask;
+            stcMDNSServiceTxts m_Txts;
+            MDNSDynamicServiceTxtCallbackFunc m_fnTxtCallback;
+            stcProbeInformation m_ProbeInformation;
+
+            stcMDNSService(const char* p_pcName = 0,
+                const char* p_pcService = 0,
+                const char* p_pcProtocol = 0);
+            ~stcMDNSService(void);
+
+            bool setName(const char* p_pcName);
+            bool releaseName(void);
+
+            bool setService(const char* p_pcService);
+            bool releaseService(void);
+
+            bool setProtocol(const char* p_pcProtocol);
+            bool releaseProtocol(void);
+        };
 
-    /**
+        /**
         stcMDNSServiceQuery
     */
-    struct stcMDNSServiceQuery
-    {
-        /**
-            stcAnswer
-        */
-        struct stcAnswer
+        struct stcMDNSServiceQuery
         {
             /**
-                stcTTL
-            */
-            struct stcTTL
+            stcAnswer
+        */
+            struct stcAnswer
             {
                 /**
+                stcTTL
+            */
+                struct stcTTL
+                {
+                    /**
                     timeoutLevel_t
                 */
-                typedef uint8_t timeoutLevel_t;
-                /**
+                    typedef uint8_t timeoutLevel_t;
+                    /**
                     TIMEOUTLEVELs
                 */
-                const timeoutLevel_t TIMEOUTLEVEL_UNSET = 0;
-                const timeoutLevel_t TIMEOUTLEVEL_BASE = 80;
-                const timeoutLevel_t TIMEOUTLEVEL_INTERVAL = 5;
-                const timeoutLevel_t TIMEOUTLEVEL_FINAL = 100;
+                    const timeoutLevel_t TIMEOUTLEVEL_UNSET = 0;
+                    const timeoutLevel_t TIMEOUTLEVEL_BASE = 80;
+                    const timeoutLevel_t TIMEOUTLEVEL_INTERVAL = 5;
+                    const timeoutLevel_t TIMEOUTLEVEL_FINAL = 100;
 
-                uint32_t m_u32TTL;
-                esp8266::polledTimeout::oneShotMs m_TTLTimeout;
-                timeoutLevel_t m_timeoutLevel;
+                    uint32_t m_u32TTL;
+                    esp8266::polledTimeout::oneShotMs m_TTLTimeout;
+                    timeoutLevel_t m_timeoutLevel;
 
-                using timeoutBase = decltype(m_TTLTimeout);
+                    using timeoutBase = decltype(m_TTLTimeout);
 
-                stcTTL(void);
-                bool set(uint32_t p_u32TTL);
+                    stcTTL(void);
+                    bool set(uint32_t p_u32TTL);
 
-                bool flagged(void);
-                bool restart(void);
+                    bool flagged(void);
+                    bool restart(void);
 
-                bool prepareDeletion(void);
-                bool finalTimeoutLevel(void) const;
+                    bool prepareDeletion(void);
+                    bool finalTimeoutLevel(void) const;
 
-                timeoutBase::timeType timeout(void) const;
-            };
+                    timeoutBase::timeType timeout(void) const;
+                };
 #ifdef MDNS_IP4_SUPPORT
-            /**
+                /**
                 stcIP4Address
             */
-            struct stcIP4Address
-            {
-                stcIP4Address* m_pNext;
-                IPAddress m_IPAddress;
-                stcTTL m_TTL;
+                struct stcIP4Address
+                {
+                    stcIP4Address* m_pNext;
+                    IPAddress m_IPAddress;
+                    stcTTL m_TTL;
 
-                stcIP4Address(IPAddress p_IPAddress,
-                              uint32_t p_u32TTL = 0);
-            };
+                    stcIP4Address(IPAddress p_IPAddress,
+                        uint32_t p_u32TTL = 0);
+                };
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            /**
+                /**
                 stcIP6Address
             */
-            struct stcIP6Address
-            {
-                stcIP6Address* m_pNext;
-                IP6Address m_IPAddress;
-                stcTTL m_TTL;
+                struct stcIP6Address
+                {
+                    stcIP6Address* m_pNext;
+                    IP6Address m_IPAddress;
+                    stcTTL m_TTL;
 
-                stcIP6Address(IPAddress p_IPAddress,
-                              uint32_t p_u32TTL = 0);
-            };
+                    stcIP6Address(IPAddress p_IPAddress,
+                        uint32_t p_u32TTL = 0);
+                };
 #endif
 
-            stcAnswer* m_pNext;
-            // The service domain is the first 'answer' (from PTR answer, using service and protocol) to be set
-            // Defines the key for additional answer, like host domain, etc.
-            stcMDNS_RRDomain m_ServiceDomain;  // 1. level answer (PTR), eg. MyESP._http._tcp.local
-            char* m_pcServiceDomain;
-            stcTTL m_TTLServiceDomain;
-            stcMDNS_RRDomain m_HostDomain;  // 2. level answer (SRV, using service domain), eg. esp8266.local
-            char* m_pcHostDomain;
-            uint16_t m_u16Port;  // 2. level answer (SRV, using service domain), eg. 5000
-            stcTTL m_TTLHostDomainAndPort;
-            stcMDNSServiceTxts m_Txts;  // 2. level answer (TXT, using service domain), eg. c#=1
-            char* m_pcTxts;
-            stcTTL m_TTLTxts;
+                stcAnswer* m_pNext;
+                // The service domain is the first 'answer' (from PTR answer, using service and protocol) to be set
+                // Defines the key for additional answer, like host domain, etc.
+                stcMDNS_RRDomain m_ServiceDomain;  // 1. level answer (PTR), eg. MyESP._http._tcp.local
+                char* m_pcServiceDomain;
+                stcTTL m_TTLServiceDomain;
+                stcMDNS_RRDomain m_HostDomain;  // 2. level answer (SRV, using service domain), eg. esp8266.local
+                char* m_pcHostDomain;
+                uint16_t m_u16Port;  // 2. level answer (SRV, using service domain), eg. 5000
+                stcTTL m_TTLHostDomainAndPort;
+                stcMDNSServiceTxts m_Txts;  // 2. level answer (TXT, using service domain), eg. c#=1
+                char* m_pcTxts;
+                stcTTL m_TTLTxts;
 #ifdef MDNS_IP4_SUPPORT
-            stcIP4Address* m_pIP4Addresses;  // 3. level answer (A, using host domain), eg. 123.456.789.012
+                stcIP4Address* m_pIP4Addresses;  // 3. level answer (A, using host domain), eg. 123.456.789.012
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            stcIP6Address* m_pIP6Addresses;  // 3. level answer (AAAA, using host domain), eg. 1234::09
+                stcIP6Address* m_pIP6Addresses;  // 3. level answer (AAAA, using host domain), eg. 1234::09
 #endif
-            uint32_t m_u32ContentFlags;
+                uint32_t m_u32ContentFlags;
 
-            stcAnswer(void);
-            ~stcAnswer(void);
+                stcAnswer(void);
+                ~stcAnswer(void);
 
-            bool clear(void);
+                bool clear(void);
 
-            char* allocServiceDomain(size_t p_stLength);
-            bool releaseServiceDomain(void);
+                char* allocServiceDomain(size_t p_stLength);
+                bool releaseServiceDomain(void);
 
-            char* allocHostDomain(size_t p_stLength);
-            bool releaseHostDomain(void);
+                char* allocHostDomain(size_t p_stLength);
+                bool releaseHostDomain(void);
 
-            char* allocTxts(size_t p_stLength);
-            bool releaseTxts(void);
+                char* allocTxts(size_t p_stLength);
+                bool releaseTxts(void);
 
 #ifdef MDNS_IP4_SUPPORT
-            bool releaseIP4Addresses(void);
-            bool addIP4Address(stcIP4Address* p_pIP4Address);
-            bool removeIP4Address(stcIP4Address* p_pIP4Address);
-            const stcIP4Address* findIP4Address(const IPAddress& p_IPAddress) const;
-            stcIP4Address* findIP4Address(const IPAddress& p_IPAddress);
-            uint32_t IP4AddressCount(void) const;
-            const stcIP4Address* IP4AddressAtIndex(uint32_t p_u32Index) const;
-            stcIP4Address* IP4AddressAtIndex(uint32_t p_u32Index);
+                bool releaseIP4Addresses(void);
+                bool addIP4Address(stcIP4Address* p_pIP4Address);
+                bool removeIP4Address(stcIP4Address* p_pIP4Address);
+                const stcIP4Address* findIP4Address(const IPAddress& p_IPAddress) const;
+                stcIP4Address* findIP4Address(const IPAddress& p_IPAddress);
+                uint32_t IP4AddressCount(void) const;
+                const stcIP4Address* IP4AddressAtIndex(uint32_t p_u32Index) const;
+                stcIP4Address* IP4AddressAtIndex(uint32_t p_u32Index);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            bool releaseIP6Addresses(void);
-            bool addIP6Address(stcIP6Address* p_pIP6Address);
-            bool removeIP6Address(stcIP6Address* p_pIP6Address);
-            const stcIP6Address* findIP6Address(const IPAddress& p_IPAddress) const;
-            stcIP6Address* findIP6Address(const IPAddress& p_IPAddress);
-            uint32_t IP6AddressCount(void) const;
-            const stcIP6Address* IP6AddressAtIndex(uint32_t p_u32Index) const;
-            stcIP6Address* IP6AddressAtIndex(uint32_t p_u32Index);
+                bool releaseIP6Addresses(void);
+                bool addIP6Address(stcIP6Address* p_pIP6Address);
+                bool removeIP6Address(stcIP6Address* p_pIP6Address);
+                const stcIP6Address* findIP6Address(const IPAddress& p_IPAddress) const;
+                stcIP6Address* findIP6Address(const IPAddress& p_IPAddress);
+                uint32_t IP6AddressCount(void) const;
+                const stcIP6Address* IP6AddressAtIndex(uint32_t p_u32Index) const;
+                stcIP6Address* IP6AddressAtIndex(uint32_t p_u32Index);
 #endif
-        };
+            };
 
-        stcMDNSServiceQuery* m_pNext;
-        stcMDNS_RRDomain m_ServiceTypeDomain;  // eg. _http._tcp.local
-        MDNSServiceQueryCallbackFunc m_fnCallback;
-        bool m_bLegacyQuery;
-        uint8_t m_u8SentCount;
-        esp8266::polledTimeout::oneShotMs m_ResendTimeout;
-        bool m_bAwaitingAnswers;
-        stcAnswer* m_pAnswers;
+            stcMDNSServiceQuery* m_pNext;
+            stcMDNS_RRDomain m_ServiceTypeDomain;  // eg. _http._tcp.local
+            MDNSServiceQueryCallbackFunc m_fnCallback;
+            bool m_bLegacyQuery;
+            uint8_t m_u8SentCount;
+            esp8266::polledTimeout::oneShotMs m_ResendTimeout;
+            bool m_bAwaitingAnswers;
+            stcAnswer* m_pAnswers;
 
-        stcMDNSServiceQuery(void);
-        ~stcMDNSServiceQuery(void);
+            stcMDNSServiceQuery(void);
+            ~stcMDNSServiceQuery(void);
 
-        bool clear(void);
+            bool clear(void);
 
-        uint32_t answerCount(void) const;
-        const stcAnswer* answerAtIndex(uint32_t p_u32Index) const;
-        stcAnswer* answerAtIndex(uint32_t p_u32Index);
-        uint32_t indexOfAnswer(const stcAnswer* p_pAnswer) const;
+            uint32_t answerCount(void) const;
+            const stcAnswer* answerAtIndex(uint32_t p_u32Index) const;
+            stcAnswer* answerAtIndex(uint32_t p_u32Index);
+            uint32_t indexOfAnswer(const stcAnswer* p_pAnswer) const;
 
-        bool addAnswer(stcAnswer* p_pAnswer);
-        bool removeAnswer(stcAnswer* p_pAnswer);
+            bool addAnswer(stcAnswer* p_pAnswer);
+            bool removeAnswer(stcAnswer* p_pAnswer);
 
-        stcAnswer* findAnswerForServiceDomain(const stcMDNS_RRDomain& p_ServiceDomain);
-        stcAnswer* findAnswerForHostDomain(const stcMDNS_RRDomain& p_HostDomain);
-    };
+            stcAnswer* findAnswerForServiceDomain(const stcMDNS_RRDomain& p_ServiceDomain);
+            stcAnswer* findAnswerForHostDomain(const stcMDNS_RRDomain& p_HostDomain);
+        };
 
-    /**
+        /**
         stcMDNSSendParameter
     */
-    struct stcMDNSSendParameter
-    {
-       protected:
-        /**
+        struct stcMDNSSendParameter
+        {
+        protected:
+            /**
             stcDomainCacheItem
         */
-        struct stcDomainCacheItem
-        {
-            stcDomainCacheItem* m_pNext;
-            const void* m_pHostnameOrService;  // Opaque id for host or service domain (pointer)
-            bool m_bAdditionalData;            // Opaque flag for special info (service domain included)
-            uint16_t m_u16Offset;              // Offset in UDP output buffer
-
-            stcDomainCacheItem(const void* p_pHostnameOrService,
-                               bool p_bAdditionalData,
-                               uint32_t p_u16Offset);
-        };
+            struct stcDomainCacheItem
+            {
+                stcDomainCacheItem* m_pNext;
+                const void* m_pHostnameOrService;  // Opaque id for host or service domain (pointer)
+                bool m_bAdditionalData;            // Opaque flag for special info (service domain included)
+                uint16_t m_u16Offset;              // Offset in UDP output buffer
+
+                stcDomainCacheItem(const void* p_pHostnameOrService,
+                    bool p_bAdditionalData,
+                    uint32_t p_u16Offset);
+            };
 
-       public:
-        uint16_t m_u16ID;                         // Query ID (used only in lagacy queries)
-        stcMDNS_RRQuestion* m_pQuestions;         // A list of queries
-        uint8_t m_u8HostReplyMask;                // Flags for reply components/answers
-        bool m_bLegacyQuery;                      // Flag: Legacy query
-        bool m_bResponse;                         // Flag: Response to a query
-        bool m_bAuthorative;                      // Flag: Authoritative (owner) response
-        bool m_bCacheFlush;                       // Flag: Clients should flush their caches
-        bool m_bUnicast;                          // Flag: Unicast response
-        bool m_bUnannounce;                       // Flag: Unannounce service
-        uint16_t m_u16Offset;                     // Current offset in UDP write buffer (mainly for domain cache)
-        stcDomainCacheItem* m_pDomainCacheItems;  // Cached host and service domains
-
-        stcMDNSSendParameter(void);
-        ~stcMDNSSendParameter(void);
-
-        bool clear(void);
-        bool clearCachedNames(void);
-
-        bool shiftOffset(uint16_t p_u16Shift);
-
-        bool addDomainCacheItem(const void* p_pHostnameOrService,
-                                bool p_bAdditionalData,
-                                uint16_t p_u16Offset);
-        uint16_t findCachedDomainOffset(const void* p_pHostnameOrService,
-                                        bool p_bAdditionalData) const;
-    };
+        public:
+            uint16_t m_u16ID;                         // Query ID (used only in lagacy queries)
+            stcMDNS_RRQuestion* m_pQuestions;         // A list of queries
+            uint8_t m_u8HostReplyMask;                // Flags for reply components/answers
+            bool m_bLegacyQuery;                      // Flag: Legacy query
+            bool m_bResponse;                         // Flag: Response to a query
+            bool m_bAuthorative;                      // Flag: Authoritative (owner) response
+            bool m_bCacheFlush;                       // Flag: Clients should flush their caches
+            bool m_bUnicast;                          // Flag: Unicast response
+            bool m_bUnannounce;                       // Flag: Unannounce service
+            uint16_t m_u16Offset;                     // Current offset in UDP write buffer (mainly for domain cache)
+            stcDomainCacheItem* m_pDomainCacheItems;  // Cached host and service domains
+
+            stcMDNSSendParameter(void);
+            ~stcMDNSSendParameter(void);
+
+            bool clear(void);
+            bool clearCachedNames(void);
 
-    // Instance variables
-    stcMDNSService* m_pServices;
-    UdpContext* m_pUDPContext;
-    char* m_pcHostname;
-    stcMDNSServiceQuery* m_pServiceQueries;
-    MDNSDynamicServiceTxtCallbackFunc m_fnServiceTxtCallback;
-    stcProbeInformation m_HostProbeInformation;
-
-    /** CONTROL **/
-    /* MAINTENANCE */
-    bool _process(bool p_bUserContext);
-    bool _restart(void);
-
-    /* RECEIVING */
-    bool _parseMessage(void);
-    bool _parseQuery(const stcMDNS_MsgHeader& p_Header);
-
-    bool _parseResponse(const stcMDNS_MsgHeader& p_Header);
-    bool _processAnswers(const stcMDNS_RRAnswer* p_pPTRAnswers);
-    bool _processPTRAnswer(const stcMDNS_RRAnswerPTR* p_pPTRAnswer,
-                           bool& p_rbFoundNewKeyAnswer);
-    bool _processSRVAnswer(const stcMDNS_RRAnswerSRV* p_pSRVAnswer,
-                           bool& p_rbFoundNewKeyAnswer);
-    bool _processTXTAnswer(const stcMDNS_RRAnswerTXT* p_pTXTAnswer);
+            bool shiftOffset(uint16_t p_u16Shift);
+
+            bool addDomainCacheItem(const void* p_pHostnameOrService,
+                bool p_bAdditionalData,
+                uint16_t p_u16Offset);
+            uint16_t findCachedDomainOffset(const void* p_pHostnameOrService,
+                bool p_bAdditionalData) const;
+        };
+
+        // Instance variables
+        stcMDNSService* m_pServices;
+        UdpContext* m_pUDPContext;
+        char* m_pcHostname;
+        stcMDNSServiceQuery* m_pServiceQueries;
+        MDNSDynamicServiceTxtCallbackFunc m_fnServiceTxtCallback;
+        stcProbeInformation m_HostProbeInformation;
+
+        /** CONTROL **/
+        /* MAINTENANCE */
+        bool _process(bool p_bUserContext);
+        bool _restart(void);
+
+        /* RECEIVING */
+        bool _parseMessage(void);
+        bool _parseQuery(const stcMDNS_MsgHeader& p_Header);
+
+        bool _parseResponse(const stcMDNS_MsgHeader& p_Header);
+        bool _processAnswers(const stcMDNS_RRAnswer* p_pPTRAnswers);
+        bool _processPTRAnswer(const stcMDNS_RRAnswerPTR* p_pPTRAnswer,
+            bool& p_rbFoundNewKeyAnswer);
+        bool _processSRVAnswer(const stcMDNS_RRAnswerSRV* p_pSRVAnswer,
+            bool& p_rbFoundNewKeyAnswer);
+        bool _processTXTAnswer(const stcMDNS_RRAnswerTXT* p_pTXTAnswer);
 #ifdef MDNS_IP4_SUPPORT
-    bool _processAAnswer(const stcMDNS_RRAnswerA* p_pAAnswer);
+        bool _processAAnswer(const stcMDNS_RRAnswerA* p_pAAnswer);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-    bool _processAAAAAnswer(const stcMDNS_RRAnswerAAAA* p_pAAAAAnswer);
+        bool _processAAAAAnswer(const stcMDNS_RRAnswerAAAA* p_pAAAAAnswer);
 #endif
 
-    /* PROBING */
-    bool _updateProbeStatus(void);
-    bool _resetProbeStatus(bool p_bRestart = true);
-    bool _hasProbesWaitingForAnswers(void) const;
-    bool _sendHostProbe(void);
-    bool _sendServiceProbe(stcMDNSService& p_rService);
-    bool _cancelProbingForHost(void);
-    bool _cancelProbingForService(stcMDNSService& p_rService);
-
-    /* ANNOUNCE */
-    bool _announce(bool p_bAnnounce,
-                   bool p_bIncludeServices);
-    bool _announceService(stcMDNSService& p_rService,
-                          bool p_bAnnounce = true);
-
-    /* SERVICE QUERY CACHE */
-    bool _hasServiceQueriesWaitingForAnswers(void) const;
-    bool _checkServiceQueryCache(void);
-
-    /** TRANSFER **/
-    /* SENDING */
-    bool _sendMDNSMessage(stcMDNSSendParameter& p_SendParameter);
-    bool _sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter);
-    bool _prepareMDNSMessage(stcMDNSSendParameter& p_SendParameter,
-                             IPAddress p_IPAddress);
-    bool _sendMDNSServiceQuery(const stcMDNSServiceQuery& p_ServiceQuery);
-    bool _sendMDNSQuery(const stcMDNS_RRDomain& p_QueryDomain,
-                        uint16_t p_u16QueryType,
-                        stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers = 0);
-
-    uint8_t _replyMaskForHost(const stcMDNS_RRHeader& p_RRHeader,
-                              bool* p_pbFullNameMatch = 0) const;
-    uint8_t _replyMaskForService(const stcMDNS_RRHeader& p_RRHeader,
-                                 const stcMDNSService& p_Service,
-                                 bool* p_pbFullNameMatch = 0) const;
-
-    /* RESOURCE RECORD */
-    bool _readRRQuestion(stcMDNS_RRQuestion& p_rQuestion);
-    bool _readRRAnswer(stcMDNS_RRAnswer*& p_rpAnswer);
+        /* PROBING */
+        bool _updateProbeStatus(void);
+        bool _resetProbeStatus(bool p_bRestart = true);
+        bool _hasProbesWaitingForAnswers(void) const;
+        bool _sendHostProbe(void);
+        bool _sendServiceProbe(stcMDNSService& p_rService);
+        bool _cancelProbingForHost(void);
+        bool _cancelProbingForService(stcMDNSService& p_rService);
+
+        /* ANNOUNCE */
+        bool _announce(bool p_bAnnounce,
+            bool p_bIncludeServices);
+        bool _announceService(stcMDNSService& p_rService,
+            bool p_bAnnounce = true);
+
+        /* SERVICE QUERY CACHE */
+        bool _hasServiceQueriesWaitingForAnswers(void) const;
+        bool _checkServiceQueryCache(void);
+
+        /** TRANSFER **/
+        /* SENDING */
+        bool _sendMDNSMessage(stcMDNSSendParameter& p_SendParameter);
+        bool _sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter);
+        bool _prepareMDNSMessage(stcMDNSSendParameter& p_SendParameter,
+            IPAddress p_IPAddress);
+        bool _sendMDNSServiceQuery(const stcMDNSServiceQuery& p_ServiceQuery);
+        bool _sendMDNSQuery(const stcMDNS_RRDomain& p_QueryDomain,
+            uint16_t p_u16QueryType,
+            stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers = 0);
+
+        uint8_t _replyMaskForHost(const stcMDNS_RRHeader& p_RRHeader,
+            bool* p_pbFullNameMatch = 0) const;
+        uint8_t _replyMaskForService(const stcMDNS_RRHeader& p_RRHeader,
+            const stcMDNSService& p_Service,
+            bool* p_pbFullNameMatch = 0) const;
+
+        /* RESOURCE RECORD */
+        bool _readRRQuestion(stcMDNS_RRQuestion& p_rQuestion);
+        bool _readRRAnswer(stcMDNS_RRAnswer*& p_rpAnswer);
 #ifdef MDNS_IP4_SUPPORT
-    bool _readRRAnswerA(stcMDNS_RRAnswerA& p_rRRAnswerA,
-                        uint16_t p_u16RDLength);
+        bool _readRRAnswerA(stcMDNS_RRAnswerA& p_rRRAnswerA,
+            uint16_t p_u16RDLength);
 #endif
-    bool _readRRAnswerPTR(stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
-                          uint16_t p_u16RDLength);
-    bool _readRRAnswerTXT(stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
-                          uint16_t p_u16RDLength);
+        bool _readRRAnswerPTR(stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
+            uint16_t p_u16RDLength);
+        bool _readRRAnswerTXT(stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
+            uint16_t p_u16RDLength);
 #ifdef MDNS_IP6_SUPPORT
-    bool _readRRAnswerAAAA(stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
-                           uint16_t p_u16RDLength);
+        bool _readRRAnswerAAAA(stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
+            uint16_t p_u16RDLength);
 #endif
-    bool _readRRAnswerSRV(stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
-                          uint16_t p_u16RDLength);
-    bool _readRRAnswerGeneric(stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
-                              uint16_t p_u16RDLength);
-
-    bool _readRRHeader(stcMDNS_RRHeader& p_rHeader);
-    bool _readRRDomain(stcMDNS_RRDomain& p_rRRDomain);
-    bool _readRRDomain_Loop(stcMDNS_RRDomain& p_rRRDomain,
-                            uint8_t p_u8Depth);
-    bool _readRRAttributes(stcMDNS_RRAttributes& p_rAttributes);
-
-    /* DOMAIN NAMES */
-    bool _buildDomainForHost(const char* p_pcHostname,
-                             stcMDNS_RRDomain& p_rHostDomain) const;
-    bool _buildDomainForDNSSD(stcMDNS_RRDomain& p_rDNSSDDomain) const;
-    bool _buildDomainForService(const stcMDNSService& p_Service,
-                                bool p_bIncludeName,
-                                stcMDNS_RRDomain& p_rServiceDomain) const;
-    bool _buildDomainForService(const char* p_pcService,
-                                const char* p_pcProtocol,
-                                stcMDNS_RRDomain& p_rServiceDomain) const;
+        bool _readRRAnswerSRV(stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
+            uint16_t p_u16RDLength);
+        bool _readRRAnswerGeneric(stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
+            uint16_t p_u16RDLength);
+
+        bool _readRRHeader(stcMDNS_RRHeader& p_rHeader);
+        bool _readRRDomain(stcMDNS_RRDomain& p_rRRDomain);
+        bool _readRRDomain_Loop(stcMDNS_RRDomain& p_rRRDomain,
+            uint8_t p_u8Depth);
+        bool _readRRAttributes(stcMDNS_RRAttributes& p_rAttributes);
+
+        /* DOMAIN NAMES */
+        bool _buildDomainForHost(const char* p_pcHostname,
+            stcMDNS_RRDomain& p_rHostDomain) const;
+        bool _buildDomainForDNSSD(stcMDNS_RRDomain& p_rDNSSDDomain) const;
+        bool _buildDomainForService(const stcMDNSService& p_Service,
+            bool p_bIncludeName,
+            stcMDNS_RRDomain& p_rServiceDomain) const;
+        bool _buildDomainForService(const char* p_pcService,
+            const char* p_pcProtocol,
+            stcMDNS_RRDomain& p_rServiceDomain) const;
 #ifdef MDNS_IP4_SUPPORT
-    bool _buildDomainForReverseIP4(IPAddress p_IP4Address,
-                                   stcMDNS_RRDomain& p_rReverseIP4Domain) const;
+        bool _buildDomainForReverseIP4(IPAddress p_IP4Address,
+            stcMDNS_RRDomain& p_rReverseIP4Domain) const;
 #endif
 #ifdef MDNS_IP6_SUPPORT
-    bool _buildDomainForReverseIP6(IPAddress p_IP4Address,
-                                   stcMDNS_RRDomain& p_rReverseIP6Domain) const;
+        bool _buildDomainForReverseIP6(IPAddress p_IP4Address,
+            stcMDNS_RRDomain& p_rReverseIP6Domain) const;
 #endif
 
-    /* UDP */
-    bool _udpReadBuffer(unsigned char* p_pBuffer,
-                        size_t p_stLength);
-    bool _udpRead8(uint8_t& p_ru8Value);
-    bool _udpRead16(uint16_t& p_ru16Value);
-    bool _udpRead32(uint32_t& p_ru32Value);
+        /* UDP */
+        bool _udpReadBuffer(unsigned char* p_pBuffer,
+            size_t p_stLength);
+        bool _udpRead8(uint8_t& p_ru8Value);
+        bool _udpRead16(uint16_t& p_ru16Value);
+        bool _udpRead32(uint32_t& p_ru32Value);
 
-    bool _udpAppendBuffer(const unsigned char* p_pcBuffer,
-                          size_t p_stLength);
-    bool _udpAppend8(uint8_t p_u8Value);
-    bool _udpAppend16(uint16_t p_u16Value);
-    bool _udpAppend32(uint32_t p_u32Value);
+        bool _udpAppendBuffer(const unsigned char* p_pcBuffer,
+            size_t p_stLength);
+        bool _udpAppend8(uint8_t p_u8Value);
+        bool _udpAppend16(uint16_t p_u16Value);
+        bool _udpAppend32(uint32_t p_u32Value);
 
 #if not defined ESP_8266_MDNS_INCLUDE || defined DEBUG_ESP_MDNS_RESPONDER
-    bool _udpDump(bool p_bMovePointer = false);
-    bool _udpDump(unsigned p_uOffset,
-                  unsigned p_uLength);
+        bool _udpDump(bool p_bMovePointer = false);
+        bool _udpDump(unsigned p_uOffset,
+            unsigned p_uLength);
 #endif
 
-    /* READ/WRITE MDNS STRUCTS */
-    bool _readMDNSMsgHeader(stcMDNS_MsgHeader& p_rMsgHeader);
-
-    bool _write8(uint8_t p_u8Value,
-                 stcMDNSSendParameter& p_rSendParameter);
-    bool _write16(uint16_t p_u16Value,
-                  stcMDNSSendParameter& p_rSendParameter);
-    bool _write32(uint32_t p_u32Value,
-                  stcMDNSSendParameter& p_rSendParameter);
-
-    bool _writeMDNSMsgHeader(const stcMDNS_MsgHeader& p_MsgHeader,
-                             stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSRRAttributes(const stcMDNS_RRAttributes& p_Attributes,
-                                stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSRRDomain(const stcMDNS_RRDomain& p_Domain,
-                            stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSHostDomain(const char* m_pcHostname,
-                              bool p_bPrependRDLength,
-                              stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSServiceDomain(const stcMDNSService& p_Service,
-                                 bool p_bIncludeName,
-                                 bool p_bPrependRDLength,
-                                 stcMDNSSendParameter& p_rSendParameter);
-
-    bool _writeMDNSQuestion(stcMDNS_RRQuestion& p_Question,
-                            stcMDNSSendParameter& p_rSendParameter);
+        /* READ/WRITE MDNS STRUCTS */
+        bool _readMDNSMsgHeader(stcMDNS_MsgHeader& p_rMsgHeader);
+
+        bool _write8(uint8_t p_u8Value,
+            stcMDNSSendParameter& p_rSendParameter);
+        bool _write16(uint16_t p_u16Value,
+            stcMDNSSendParameter& p_rSendParameter);
+        bool _write32(uint32_t p_u32Value,
+            stcMDNSSendParameter& p_rSendParameter);
+
+        bool _writeMDNSMsgHeader(const stcMDNS_MsgHeader& p_MsgHeader,
+            stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSRRAttributes(const stcMDNS_RRAttributes& p_Attributes,
+            stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSRRDomain(const stcMDNS_RRDomain& p_Domain,
+            stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSHostDomain(const char* m_pcHostname,
+            bool p_bPrependRDLength,
+            stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSServiceDomain(const stcMDNSService& p_Service,
+            bool p_bIncludeName,
+            bool p_bPrependRDLength,
+            stcMDNSSendParameter& p_rSendParameter);
+
+        bool _writeMDNSQuestion(stcMDNS_RRQuestion& p_Question,
+            stcMDNSSendParameter& p_rSendParameter);
 
 #ifdef MDNS_IP4_SUPPORT
-    bool _writeMDNSAnswer_A(IPAddress p_IPAddress,
-                            stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSAnswer_PTR_IP4(IPAddress p_IPAddress,
-                                  stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_A(IPAddress p_IPAddress,
+            stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_PTR_IP4(IPAddress p_IPAddress,
+            stcMDNSSendParameter& p_rSendParameter);
 #endif
-    bool _writeMDNSAnswer_PTR_TYPE(stcMDNSService& p_rService,
-                                   stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSAnswer_PTR_NAME(stcMDNSService& p_rService,
-                                   stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSAnswer_TXT(stcMDNSService& p_rService,
-                              stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_PTR_TYPE(stcMDNSService& p_rService,
+            stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_PTR_NAME(stcMDNSService& p_rService,
+            stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_TXT(stcMDNSService& p_rService,
+            stcMDNSSendParameter& p_rSendParameter);
 #ifdef MDNS_IP6_SUPPORT
-    bool _writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
-                               stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSAnswer_PTR_IP6(IPAddress p_IPAddress,
-                                  stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
+            stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_PTR_IP6(IPAddress p_IPAddress,
+            stcMDNSSendParameter& p_rSendParameter);
 #endif
-    bool _writeMDNSAnswer_SRV(stcMDNSService& p_rService,
-                              stcMDNSSendParameter& p_rSendParameter);
-
-    /** HELPERS **/
-    /* UDP CONTEXT */
-    bool _callProcess(void);
-    bool _allocUDPContext(void);
-    bool _releaseUDPContext(void);
-
-    /* SERVICE QUERY */
-    stcMDNSServiceQuery* _allocServiceQuery(void);
-    bool _removeServiceQuery(stcMDNSServiceQuery* p_pServiceQuery);
-    bool _removeLegacyServiceQuery(void);
-    stcMDNSServiceQuery* _findServiceQuery(hMDNSServiceQuery p_hServiceQuery);
-    stcMDNSServiceQuery* _findLegacyServiceQuery(void);
-    bool _releaseServiceQueries(void);
-    stcMDNSServiceQuery* _findNextServiceQueryByServiceType(const stcMDNS_RRDomain& p_ServiceDomain,
-                                                            const stcMDNSServiceQuery* p_pPrevServiceQuery);
-
-    /* HOSTNAME */
-    bool _setHostname(const char* p_pcHostname);
-    bool _releaseHostname(void);
-
-    /* SERVICE */
-    stcMDNSService* _allocService(const char* p_pcName,
-                                  const char* p_pcService,
-                                  const char* p_pcProtocol,
-                                  uint16_t p_u16Port);
-    bool _releaseService(stcMDNSService* p_pService);
-    bool _releaseServices(void);
-
-    stcMDNSService* _findService(const char* p_pcName,
-                                 const char* p_pcService,
-                                 const char* p_pcProtocol);
-    stcMDNSService* _findService(const hMDNSService p_hService);
-
-    size_t _countServices(void) const;
-
-    /* SERVICE TXT */
-    stcMDNSServiceTxt* _allocServiceTxt(stcMDNSService* p_pService,
-                                        const char* p_pcKey,
-                                        const char* p_pcValue,
-                                        bool p_bTemp);
-    bool _releaseServiceTxt(stcMDNSService* p_pService,
-                            stcMDNSServiceTxt* p_pTxt);
-    stcMDNSServiceTxt* _updateServiceTxt(stcMDNSService* p_pService,
-                                         stcMDNSServiceTxt* p_pTxt,
-                                         const char* p_pcValue,
-                                         bool p_bTemp);
-
-    stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
-                                       const char* p_pcKey);
-    stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
-                                       const hMDNSTxt p_hTxt);
-
-    stcMDNSServiceTxt* _addServiceTxt(stcMDNSService* p_pService,
-                                      const char* p_pcKey,
-                                      const char* p_pcValue,
-                                      bool p_bTemp);
-
-    stcMDNSServiceTxt* _answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
-                                       const uint32_t p_u32AnswerIndex);
-
-    bool _collectServiceTxts(stcMDNSService& p_rService);
-    bool _releaseTempServiceTxts(stcMDNSService& p_rService);
-    const stcMDNSServiceTxt* _serviceTxts(const char* p_pcName,
-                                          const char* p_pcService,
-                                          const char* p_pcProtocol);
-
-    /* MISC */
+        bool _writeMDNSAnswer_SRV(stcMDNSService& p_rService,
+            stcMDNSSendParameter& p_rSendParameter);
+
+        /** HELPERS **/
+        /* UDP CONTEXT */
+        bool _callProcess(void);
+        bool _allocUDPContext(void);
+        bool _releaseUDPContext(void);
+
+        /* SERVICE QUERY */
+        stcMDNSServiceQuery* _allocServiceQuery(void);
+        bool _removeServiceQuery(stcMDNSServiceQuery* p_pServiceQuery);
+        bool _removeLegacyServiceQuery(void);
+        stcMDNSServiceQuery* _findServiceQuery(hMDNSServiceQuery p_hServiceQuery);
+        stcMDNSServiceQuery* _findLegacyServiceQuery(void);
+        bool _releaseServiceQueries(void);
+        stcMDNSServiceQuery* _findNextServiceQueryByServiceType(const stcMDNS_RRDomain& p_ServiceDomain,
+            const stcMDNSServiceQuery* p_pPrevServiceQuery);
+
+        /* HOSTNAME */
+        bool _setHostname(const char* p_pcHostname);
+        bool _releaseHostname(void);
+
+        /* SERVICE */
+        stcMDNSService* _allocService(const char* p_pcName,
+            const char* p_pcService,
+            const char* p_pcProtocol,
+            uint16_t p_u16Port);
+        bool _releaseService(stcMDNSService* p_pService);
+        bool _releaseServices(void);
+
+        stcMDNSService* _findService(const char* p_pcName,
+            const char* p_pcService,
+            const char* p_pcProtocol);
+        stcMDNSService* _findService(const hMDNSService p_hService);
+
+        size_t _countServices(void) const;
+
+        /* SERVICE TXT */
+        stcMDNSServiceTxt* _allocServiceTxt(stcMDNSService* p_pService,
+            const char* p_pcKey,
+            const char* p_pcValue,
+            bool p_bTemp);
+        bool _releaseServiceTxt(stcMDNSService* p_pService,
+            stcMDNSServiceTxt* p_pTxt);
+        stcMDNSServiceTxt* _updateServiceTxt(stcMDNSService* p_pService,
+            stcMDNSServiceTxt* p_pTxt,
+            const char* p_pcValue,
+            bool p_bTemp);
+
+        stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
+            const char* p_pcKey);
+        stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
+            const hMDNSTxt p_hTxt);
+
+        stcMDNSServiceTxt* _addServiceTxt(stcMDNSService* p_pService,
+            const char* p_pcKey,
+            const char* p_pcValue,
+            bool p_bTemp);
+
+        stcMDNSServiceTxt* _answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
+            const uint32_t p_u32AnswerIndex);
+
+        bool _collectServiceTxts(stcMDNSService& p_rService);
+        bool _releaseTempServiceTxts(stcMDNSService& p_rService);
+        const stcMDNSServiceTxt* _serviceTxts(const char* p_pcName,
+            const char* p_pcService,
+            const char* p_pcProtocol);
+
+        /* MISC */
 #if not defined ESP_8266_MDNS_INCLUDE || defined DEBUG_ESP_MDNS_RESPONDER
-    bool _printRRDomain(const stcMDNS_RRDomain& p_rRRDomain) const;
-    bool _printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAnswer) const;
+        bool _printRRDomain(const stcMDNS_RRDomain& p_rRRDomain) const;
+        bool _printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAnswer) const;
 #endif
-};
+    };
 
 }  // namespace MDNSImplementation
 
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
index 7b66d086af..4c3be2b063 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
@@ -49,15 +49,15 @@ namespace esp8266
 */
 namespace MDNSImplementation
 {
-/**
+    /**
     CONTROL
 */
 
-/**
+    /**
     MAINTENANCE
 */
 
-/*
+    /*
     MDNSResponder::_process
 
     Run the MDNS process.
@@ -65,90 +65,90 @@ namespace MDNSImplementation
     should be called in every 'loop' by calling 'MDNS::update()'.
 
 */
-bool MDNSResponder::_process(bool p_bUserContext)
-{
-    bool bResult = true;
-
-    if (!p_bUserContext)
+    bool MDNSResponder::_process(bool p_bUserContext)
     {
-        if ((m_pUDPContext) &&        // UDPContext available AND
-            (m_pUDPContext->next()))  // has content
+        bool bResult = true;
+
+        if (!p_bUserContext)
         {
-            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _update: Calling _parseMessage\n")););
-            bResult = _parseMessage();
-            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parsePacket %s\n"), (bResult ? "succeeded" : "FAILED")););
+            if ((m_pUDPContext) &&        // UDPContext available AND
+                (m_pUDPContext->next()))  // has content
+            {
+                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _update: Calling _parseMessage\n")););
+                bResult = _parseMessage();
+                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parsePacket %s\n"), (bResult ? "succeeded" : "FAILED")););
+            }
         }
+        else
+        {
+            bResult = _updateProbeStatus() &&  // Probing
+                _checkServiceQueryCache();     // Service query cache check
+        }
+        return bResult;
     }
-    else
-    {
-        bResult = _updateProbeStatus() &&     // Probing
-                  _checkServiceQueryCache();  // Service query cache check
-    }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_restart
 */
-bool MDNSResponder::_restart(void)
-{
-    return ((_resetProbeStatus(true /*restart*/)) &&  // Stop and restart probing
-            (_allocUDPContext()));                    // Restart UDP
-}
+    bool MDNSResponder::_restart(void)
+    {
+        return ((_resetProbeStatus(true /*restart*/)) &&  // Stop and restart probing
+            (_allocUDPContext()));                        // Restart UDP
+    }
 
-/**
+    /**
     RECEIVING
 */
 
-/*
+    /*
     MDNSResponder::_parseMessage
 */
-bool MDNSResponder::_parseMessage(void)
-{
-    DEBUG_EX_INFO(
-        unsigned long ulStartTime = millis();
-        unsigned uStartMemory = ESP.getFreeHeap();
-        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage (Time: %lu ms, heap: %u bytes, from %s(%u), to %s(%u))\n"), ulStartTime, uStartMemory,
-                              IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), m_pUDPContext->getRemotePort(),
-                              IPAddress(m_pUDPContext->getDestAddress()).toString().c_str(), m_pUDPContext->getLocalPort()););
-    //DEBUG_EX_INFO(_udpDump(););
-
-    bool bResult = false;
-
-    stcMDNS_MsgHeader header;
-    if (_readMDNSMsgHeader(header))
+    bool MDNSResponder::_parseMessage(void)
     {
-        if (0 == header.m_4bOpcode)  // A standard query
+        DEBUG_EX_INFO(
+            unsigned long ulStartTime = millis();
+            unsigned uStartMemory = ESP.getFreeHeap();
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage (Time: %lu ms, heap: %u bytes, from %s(%u), to %s(%u))\n"), ulStartTime, uStartMemory,
+                IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), m_pUDPContext->getRemotePort(),
+                IPAddress(m_pUDPContext->getDestAddress()).toString().c_str(), m_pUDPContext->getLocalPort()););
+        //DEBUG_EX_INFO(_udpDump(););
+
+        bool bResult = false;
+
+        stcMDNS_MsgHeader header;
+        if (_readMDNSMsgHeader(header))
         {
-            if (header.m_1bQR)  // Received a response -> answers to a query
+            if (0 == header.m_4bOpcode)  // A standard query
             {
-                //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading answers: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
-                bResult = _parseResponse(header);
+                if (header.m_1bQR)  // Received a response -> answers to a query
+                {
+                    //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading answers: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
+                    bResult = _parseResponse(header);
+                }
+                else  // Received a query (Questions)
+                {
+                    //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading query: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
+                    bResult = _parseQuery(header);
+                }
             }
-            else  // Received a query (Questions)
+            else
             {
-                //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading query: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
-                bResult = _parseQuery(header);
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Received UNEXPECTED opcode:%u. Ignoring message!\n"), header.m_4bOpcode););
+                m_pUDPContext->flush();
             }
         }
         else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Received UNEXPECTED opcode:%u. Ignoring message!\n"), header.m_4bOpcode););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: FAILED to read header\n")););
             m_pUDPContext->flush();
         }
+        DEBUG_EX_INFO(
+            unsigned uFreeHeap = ESP.getFreeHeap();
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Done (%s after %lu ms, ate %i bytes, remaining %u)\n\n"), (bResult ? "Succeeded" : "FAILED"), (millis() - ulStartTime), (uStartMemory - uFreeHeap), uFreeHeap););
+        return bResult;
     }
-    else
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: FAILED to read header\n")););
-        m_pUDPContext->flush();
-    }
-    DEBUG_EX_INFO(
-        unsigned uFreeHeap = ESP.getFreeHeap();
-        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Done (%s after %lu ms, ate %i bytes, remaining %u)\n\n"), (bResult ? "Succeeded" : "FAILED"), (millis() - ulStartTime), (uStartMemory - uFreeHeap), uFreeHeap););
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_parseQuery
 
     Queries are of interest in two cases:
@@ -165,412 +165,393 @@ bool MDNSResponder::_parseMessage(void)
 
     1.
 */
-bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
-{
-    bool bResult = true;
-
-    stcMDNSSendParameter sendParameter;
-    uint8_t u8HostOrServiceReplies = 0;
-    for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
+    bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
     {
-        stcMDNS_RRQuestion questionRR;
-        if ((bResult = _readRRQuestion(questionRR)))
+        bool bResult = true;
+
+        stcMDNSSendParameter sendParameter;
+        uint8_t u8HostOrServiceReplies = 0;
+        for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
         {
-            // Define host replies, BUT only answer queries after probing is done
-            u8HostOrServiceReplies =
-                sendParameter.m_u8HostReplyMask |= (((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus))
-                                                        ? _replyMaskForHost(questionRR.m_Header, 0)
-                                                        : 0);
-            DEBUG_EX_INFO(if (u8HostOrServiceReplies)
-                          {
-                              DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Host reply needed 0x%X\n"), u8HostOrServiceReplies);
-                          });
-
-            // Check tiebreak need for host domain
-            if (ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus)
+            stcMDNS_RRQuestion questionRR;
+            if ((bResult = _readRRQuestion(questionRR)))
             {
-                bool bFullNameMatch = false;
-                if ((_replyMaskForHost(questionRR.m_Header, &bFullNameMatch)) &&
-                    (bFullNameMatch))
-                {
-                    // We're in 'probing' state and someone is asking for our host domain: this might be
-                    // a race-condition: Two host with the same domain names try simutanously to probe their domains
-                    // See: RFC 6762, 8.2 (Tiebraking)
-                    // However, we're using a max. reduced approach for tiebreaking here: The higher IP-address wins!
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for host domain detected while probing.\n")););
-
-                    m_HostProbeInformation.m_bTiebreakNeeded = true;
-                }
-            }
+                // Define host replies, BUT only answer queries after probing is done
+                u8HostOrServiceReplies = sendParameter.m_u8HostReplyMask |= (((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus))
+                        ? _replyMaskForHost(questionRR.m_Header, 0)
+                        : 0);
+                DEBUG_EX_INFO(if (u8HostOrServiceReplies)
+                    {
+                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Host reply needed 0x%X\n"), u8HostOrServiceReplies);
+                    });
 
-            // Define service replies
-            for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
-            {
-                // Define service replies, BUT only answer queries after probing is done
-                uint8_t u8ReplyMaskForQuestion = (((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus))
-                                                      ? _replyMaskForService(questionRR.m_Header, *pService, 0)
-                                                      : 0);
-                u8HostOrServiceReplies |= (pService->m_u8ReplyMask |= u8ReplyMaskForQuestion);
-                DEBUG_EX_INFO(if (u8ReplyMaskForQuestion)
-                              {
-                                  DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service reply needed for (%s.%s.%s): 0x%X (%s)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, u8ReplyMaskForQuestion, IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str());
-                              });
-
-                // Check tiebreak need for service domain
-                if (ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus)
+                // Check tiebreak need for host domain
+                if (ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus)
                 {
                     bool bFullNameMatch = false;
-                    if ((_replyMaskForService(questionRR.m_Header, *pService, &bFullNameMatch)) &&
-                        (bFullNameMatch))
+                    if ((_replyMaskForHost(questionRR.m_Header, &bFullNameMatch)) && (bFullNameMatch))
                     {
-                        // We're in 'probing' state and someone is asking for this service domain: this might be
-                        // a race-condition: Two services with the same domain names try simutanously to probe their domains
+                        // We're in 'probing' state and someone is asking for our host domain: this might be
+                        // a race-condition: Two host with the same domain names try simutanously to probe their domains
                         // See: RFC 6762, 8.2 (Tiebraking)
-                        // However, we're using a max. reduced approach for tiebreaking here: The 'higher' SRV host wins!
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for service domain %s.%s.%s detected while probing.\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                        // However, we're using a max. reduced approach for tiebreaking here: The higher IP-address wins!
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for host domain detected while probing.\n")););
 
-                        pService->m_ProbeInformation.m_bTiebreakNeeded = true;
+                        m_HostProbeInformation.m_bTiebreakNeeded = true;
                     }
                 }
-            }
 
-            // Handle unicast and legacy specialities
-            // If only one question asks for unicast reply, the whole reply packet is send unicast
-            if (((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) ||  // Unicast (maybe legacy) query OR
-                 (questionRR.m_bUnicast)) &&                             // Expressivly unicast query
-                (!sendParameter.m_bUnicast))
-            {
-                sendParameter.m_bUnicast = true;
-                sendParameter.m_bCacheFlush = false;
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Unicast response for %s!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
-
-                if ((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) &&  // Unicast (maybe legacy) query AND
-                    (1 == p_MsgHeader.m_u16QDCount) &&                      // Only one question AND
-                    ((sendParameter.m_u8HostReplyMask) ||                   //  Host replies OR
-                     (u8HostOrServiceReplies)))                             //  Host or service replies available
+                // Define service replies
+                for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
                 {
-                    // We're a match for this legacy query, BUT
-                    // make sure, that the query comes from a local host
-                    ip_info IPInfo_Local;
-                    ip_info IPInfo_Remote;
-                    if (((IPInfo_Remote.ip.addr = m_pUDPContext->getRemoteAddress())) &&
-                        (((wifi_get_ip_info(SOFTAP_IF, &IPInfo_Local)) &&
-                          (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask))) ||  // Remote IP in SOFTAP's subnet OR
-                         ((wifi_get_ip_info(STATION_IF, &IPInfo_Local)) &&
-                          (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask)))))  // Remote IP in STATION's subnet
+                    // Define service replies, BUT only answer queries after probing is done
+                    uint8_t u8ReplyMaskForQuestion = (((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus))
+                            ? _replyMaskForService(questionRR.m_Header, *pService, 0)
+                            : 0);
+                    u8HostOrServiceReplies |= (pService->m_u8ReplyMask |= u8ReplyMaskForQuestion);
+                    DEBUG_EX_INFO(if (u8ReplyMaskForQuestion)
+                        {
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service reply needed for (%s.%s.%s): 0x%X (%s)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, u8ReplyMaskForQuestion, IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str());
+                        });
+
+                    // Check tiebreak need for service domain
+                    if (ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus)
                     {
-                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from local host %s, id %u!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), p_MsgHeader.m_u16ID););
+                        bool bFullNameMatch = false;
+                        if ((_replyMaskForService(questionRR.m_Header, *pService, &bFullNameMatch)) && (bFullNameMatch))
+                        {
+                            // We're in 'probing' state and someone is asking for this service domain: this might be
+                            // a race-condition: Two services with the same domain names try simutanously to probe their domains
+                            // See: RFC 6762, 8.2 (Tiebraking)
+                            // However, we're using a max. reduced approach for tiebreaking here: The 'higher' SRV host wins!
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for service domain %s.%s.%s detected while probing.\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+
+                            pService->m_ProbeInformation.m_bTiebreakNeeded = true;
+                        }
+                    }
+                }
 
-                        sendParameter.m_u16ID = p_MsgHeader.m_u16ID;
-                        sendParameter.m_bLegacyQuery = true;
-                        sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
-                        if ((bResult = (0 != sendParameter.m_pQuestions)))
+                // Handle unicast and legacy specialities
+                // If only one question asks for unicast reply, the whole reply packet is send unicast
+                if (((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) ||  // Unicast (maybe legacy) query OR
+                        (questionRR.m_bUnicast))
+                    &&  // Expressivly unicast query
+                    (!sendParameter.m_bUnicast))
+                {
+                    sendParameter.m_bUnicast = true;
+                    sendParameter.m_bCacheFlush = false;
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Unicast response for %s!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
+
+                    if ((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) &&  // Unicast (maybe legacy) query AND
+                        (1 == p_MsgHeader.m_u16QDCount) &&                      // Only one question AND
+                        ((sendParameter.m_u8HostReplyMask) ||                   //  Host replies OR
+                            (u8HostOrServiceReplies)))                          //  Host or service replies available
+                    {
+                        // We're a match for this legacy query, BUT
+                        // make sure, that the query comes from a local host
+                        ip_info IPInfo_Local;
+                        ip_info IPInfo_Remote;
+                        if (((IPInfo_Remote.ip.addr = m_pUDPContext->getRemoteAddress())) && (((wifi_get_ip_info(SOFTAP_IF, &IPInfo_Local)) && (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask))) ||  // Remote IP in SOFTAP's subnet OR
+                                ((wifi_get_ip_info(STATION_IF, &IPInfo_Local)) && (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask)))))                                                                // Remote IP in STATION's subnet
                         {
-                            sendParameter.m_pQuestions->m_Header.m_Domain = questionRR.m_Header.m_Domain;
-                            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = questionRR.m_Header.m_Attributes.m_u16Type;
-                            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = questionRR.m_Header.m_Attributes.m_u16Class;
+                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from local host %s, id %u!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), p_MsgHeader.m_u16ID););
+
+                            sendParameter.m_u16ID = p_MsgHeader.m_u16ID;
+                            sendParameter.m_bLegacyQuery = true;
+                            sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
+                            if ((bResult = (0 != sendParameter.m_pQuestions)))
+                            {
+                                sendParameter.m_pQuestions->m_Header.m_Domain = questionRR.m_Header.m_Domain;
+                                sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = questionRR.m_Header.m_Attributes.m_u16Type;
+                                sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = questionRR.m_Header.m_Attributes.m_u16Class;
+                            }
+                            else
+                            {
+                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to add legacy question!\n")););
+                            }
                         }
                         else
                         {
-                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to add legacy question!\n")););
+                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from NON-LOCAL host!\n")););
+                            bResult = false;
                         }
                     }
-                    else
-                    {
-                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from NON-LOCAL host!\n")););
-                        bResult = false;
-                    }
                 }
             }
-        }
-        else
-        {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read question!\n")););
-        }
-    }  // for questions
+            else
+            {
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read question!\n")););
+            }
+        }  // for questions
 
-    //DEBUG_EX_INFO(if (u8HostOrServiceReplies) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Reply needed: %u (%s: %s->%s)\n"), u8HostOrServiceReplies, clsTimeSyncer::timestr(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), IPAddress(m_pUDPContext->getDestAddress()).toString().c_str()); } );
+        //DEBUG_EX_INFO(if (u8HostOrServiceReplies) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Reply needed: %u (%s: %s->%s)\n"), u8HostOrServiceReplies, clsTimeSyncer::timestr(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), IPAddress(m_pUDPContext->getDestAddress()).toString().c_str()); } );
 
-    // Handle known answers
-    uint32_t u32Answers = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
-    DEBUG_EX_INFO(if ((u8HostOrServiceReplies) && (u32Answers))
-                  {
-                      DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Known answers(%u):\n"), u32Answers);
-                  });
+        // Handle known answers
+        uint32_t u32Answers = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
+        DEBUG_EX_INFO(if ((u8HostOrServiceReplies) && (u32Answers))
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Known answers(%u):\n"), u32Answers);
+            });
 
-    for (uint32_t an = 0; ((bResult) && (an < u32Answers)); ++an)
-    {
-        stcMDNS_RRAnswer* pKnownRRAnswer = 0;
-        if (((bResult = _readRRAnswer(pKnownRRAnswer))) &&
-            (pKnownRRAnswer))
+        for (uint32_t an = 0; ((bResult) && (an < u32Answers)); ++an)
         {
-            if ((DNS_RRTYPE_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Type) &&  // No ANY type answer
-                (DNS_RRCLASS_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Class))  // No ANY class answer
+            stcMDNS_RRAnswer* pKnownRRAnswer = 0;
+            if (((bResult = _readRRAnswer(pKnownRRAnswer))) && (pKnownRRAnswer))
             {
-                // Find match between planned answer (sendParameter.m_u8HostReplyMask) and this 'known answer'
-                uint8_t u8HostMatchMask = (sendParameter.m_u8HostReplyMask & _replyMaskForHost(pKnownRRAnswer->m_Header));
-                if ((u8HostMatchMask) &&                                // The RR in the known answer matches an RR we are planning to send, AND
-                    ((MDNS_HOST_TTL / 2) <= pKnownRRAnswer->m_u32TTL))  // The TTL of the known answer is longer than half of the new host TTL (120s)
+                if ((DNS_RRTYPE_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Type) &&  // No ANY type answer
+                    (DNS_RRCLASS_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Class))  // No ANY class answer
                 {
-                    // Compare contents
-                    if (AnswerType_PTR == pKnownRRAnswer->answerType())
+                    // Find match between planned answer (sendParameter.m_u8HostReplyMask) and this 'known answer'
+                    uint8_t u8HostMatchMask = (sendParameter.m_u8HostReplyMask & _replyMaskForHost(pKnownRRAnswer->m_Header));
+                    if ((u8HostMatchMask) &&                                // The RR in the known answer matches an RR we are planning to send, AND
+                        ((MDNS_HOST_TTL / 2) <= pKnownRRAnswer->m_u32TTL))  // The TTL of the known answer is longer than half of the new host TTL (120s)
                     {
-                        stcMDNS_RRDomain hostDomain;
-                        if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                            (((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain == hostDomain))
+                        // Compare contents
+                        if (AnswerType_PTR == pKnownRRAnswer->answerType())
                         {
-                            // Host domain match
-#ifdef MDNS_IP4_SUPPORT
-                            if (u8HostMatchMask & ContentFlag_PTR_IP4)
+                            stcMDNS_RRDomain hostDomain;
+                            if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain == hostDomain))
                             {
-                                // IP4 PTR was asked for, but is already known -> skipping
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 PTR already known... skipping!\n")););
-                                sendParameter.m_u8HostReplyMask &= ~ContentFlag_PTR_IP4;
-                            }
+                                // Host domain match
+#ifdef MDNS_IP4_SUPPORT
+                                if (u8HostMatchMask & ContentFlag_PTR_IP4)
+                                {
+                                    // IP4 PTR was asked for, but is already known -> skipping
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 PTR already known... skipping!\n")););
+                                    sendParameter.m_u8HostReplyMask &= ~ContentFlag_PTR_IP4;
+                                }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                            if (u8HostMatchMask & ContentFlag_PTR_IP6)
-                            {
-                                // IP6 PTR was asked for, but is already known -> skipping
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 PTR already known... skipping!\n")););
-                                sendParameter.m_u8HostReplyMask &= ~ContentFlag_PTR_IP6;
-                            }
+                                if (u8HostMatchMask & ContentFlag_PTR_IP6)
+                                {
+                                    // IP6 PTR was asked for, but is already known -> skipping
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 PTR already known... skipping!\n")););
+                                    sendParameter.m_u8HostReplyMask &= ~ContentFlag_PTR_IP6;
+                                }
 #endif
+                            }
                         }
-                    }
-                    else if (u8HostMatchMask & ContentFlag_A)
-                    {
-                        // IP4 address was asked for
-#ifdef MDNS_IP4_SUPPORT
-                        if ((AnswerType_A == pKnownRRAnswer->answerType()) &&
-                            (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == m_pUDPContext->getInputNetif()->ip_addr))
+                        else if (u8HostMatchMask & ContentFlag_A)
                         {
-                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 address already known... skipping!\n")););
-                            sendParameter.m_u8HostReplyMask &= ~ContentFlag_A;
-                        }  // else: RData NOT IP4 length !!
+                            // IP4 address was asked for
+#ifdef MDNS_IP4_SUPPORT
+                            if ((AnswerType_A == pKnownRRAnswer->answerType()) && (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == m_pUDPContext->getInputNetif()->ip_addr))
+                            {
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 address already known... skipping!\n")););
+                                sendParameter.m_u8HostReplyMask &= ~ContentFlag_A;
+                            }  // else: RData NOT IP4 length !!
 #endif
-                    }
-                    else if (u8HostMatchMask & ContentFlag_AAAA)
-                    {
-                        // IP6 address was asked for
-#ifdef MDNS_IP6_SUPPORT
-                        if ((AnswerType_AAAA == pAnswerRR->answerType()) &&
-                            (((stcMDNS_RRAnswerAAAA*)pAnswerRR)->m_IPAddress == _getResponseMulticastInterface()))
+                        }
+                        else if (u8HostMatchMask & ContentFlag_AAAA)
                         {
-                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 address already known... skipping!\n")););
-                            sendParameter.m_u8HostReplyMask &= ~ContentFlag_AAAA;
-                        }  // else: RData NOT IP6 length !!
+                            // IP6 address was asked for
+#ifdef MDNS_IP6_SUPPORT
+                            if ((AnswerType_AAAA == pAnswerRR->answerType()) && (((stcMDNS_RRAnswerAAAA*)pAnswerRR)->m_IPAddress == _getResponseMulticastInterface()))
+                            {
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 address already known... skipping!\n")););
+                                sendParameter.m_u8HostReplyMask &= ~ContentFlag_AAAA;
+                            }  // else: RData NOT IP6 length !!
 #endif
-                    }
-                }  // Host match /*and TTL*/
+                        }
+                    }  // Host match /*and TTL*/
 
-                //
-                // Check host tiebreak possibility
-                if (m_HostProbeInformation.m_bTiebreakNeeded)
-                {
-                    stcMDNS_RRDomain hostDomain;
-                    if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                        (pKnownRRAnswer->m_Header.m_Domain == hostDomain))
+                    //
+                    // Check host tiebreak possibility
+                    if (m_HostProbeInformation.m_bTiebreakNeeded)
                     {
-                        // Host domain match
-#ifdef MDNS_IP4_SUPPORT
-                        if (AnswerType_A == pKnownRRAnswer->answerType())
+                        stcMDNS_RRDomain hostDomain;
+                        if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (pKnownRRAnswer->m_Header.m_Domain == hostDomain))
                         {
-                            IPAddress localIPAddress(m_pUDPContext->getInputNetif()->ip_addr);
-                            if (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == localIPAddress)
-                            {
-                                // SAME IP address -> We've received an old message from ourselves (same IP)
-                                DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (was an old message)!\n")););
-                                m_HostProbeInformation.m_bTiebreakNeeded = false;
-                            }
-                            else
+                            // Host domain match
+#ifdef MDNS_IP4_SUPPORT
+                            if (AnswerType_A == pKnownRRAnswer->answerType())
                             {
-                                if ((uint32_t)(((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress) > (uint32_t)localIPAddress)  // The OTHER IP is 'higher' -> LOST
+                                IPAddress localIPAddress(m_pUDPContext->getInputNetif()->ip_addr);
+                                if (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == localIPAddress)
                                 {
-                                    // LOST tiebreak
-                                    DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) LOST (lower)!\n")););
-                                    _cancelProbingForHost();
+                                    // SAME IP address -> We've received an old message from ourselves (same IP)
+                                    DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (was an old message)!\n")););
                                     m_HostProbeInformation.m_bTiebreakNeeded = false;
                                 }
-                                else  // WON tiebreak
+                                else
                                 {
-                                    //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
-                                    DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (higher IP)!\n")););
-                                    m_HostProbeInformation.m_bTiebreakNeeded = false;
+                                    if ((uint32_t)(((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress) > (uint32_t)localIPAddress)  // The OTHER IP is 'higher' -> LOST
+                                    {
+                                        // LOST tiebreak
+                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) LOST (lower)!\n")););
+                                        _cancelProbingForHost();
+                                        m_HostProbeInformation.m_bTiebreakNeeded = false;
+                                    }
+                                    else  // WON tiebreak
+                                    {
+                                        //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
+                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (higher IP)!\n")););
+                                        m_HostProbeInformation.m_bTiebreakNeeded = false;
+                                    }
                                 }
                             }
-                        }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                        if (AnswerType_AAAA == pAnswerRR->answerType())
-                        {
-                            // TODO
-                        }
+                            if (AnswerType_AAAA == pAnswerRR->answerType())
+                            {
+                                // TODO
+                            }
 #endif
-                    }
-                }  // Host tiebreak possibility
-
-                // Check service answers
-                for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
-                {
-                    uint8_t u8ServiceMatchMask = (pService->m_u8ReplyMask & _replyMaskForService(pKnownRRAnswer->m_Header, *pService));
+                        }
+                    }  // Host tiebreak possibility
 
-                    if ((u8ServiceMatchMask) &&                                // The RR in the known answer matches an RR we are planning to send, AND
-                        ((MDNS_SERVICE_TTL / 2) <= pKnownRRAnswer->m_u32TTL))  // The TTL of the known answer is longer than half of the new service TTL (4500s)
+                    // Check service answers
+                    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
                     {
-                        if (AnswerType_PTR == pKnownRRAnswer->answerType())
+                        uint8_t u8ServiceMatchMask = (pService->m_u8ReplyMask & _replyMaskForService(pKnownRRAnswer->m_Header, *pService));
+
+                        if ((u8ServiceMatchMask) &&                                // The RR in the known answer matches an RR we are planning to send, AND
+                            ((MDNS_SERVICE_TTL / 2) <= pKnownRRAnswer->m_u32TTL))  // The TTL of the known answer is longer than half of the new service TTL (4500s)
                         {
-                            stcMDNS_RRDomain serviceDomain;
-                            if ((u8ServiceMatchMask & ContentFlag_PTR_TYPE) &&
-                                (_buildDomainForService(*pService, false, serviceDomain)) &&
-                                (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
+                            if (AnswerType_PTR == pKnownRRAnswer->answerType())
                             {
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service type PTR already known... skipping!\n")););
-                                pService->m_u8ReplyMask &= ~ContentFlag_PTR_TYPE;
-                            }
-                            if ((u8ServiceMatchMask & ContentFlag_PTR_NAME) &&
-                                (_buildDomainForService(*pService, true, serviceDomain)) &&
-                                (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
-                            {
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service name PTR already known... skipping!\n")););
-                                pService->m_u8ReplyMask &= ~ContentFlag_PTR_NAME;
+                                stcMDNS_RRDomain serviceDomain;
+                                if ((u8ServiceMatchMask & ContentFlag_PTR_TYPE) && (_buildDomainForService(*pService, false, serviceDomain)) && (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
+                                {
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service type PTR already known... skipping!\n")););
+                                    pService->m_u8ReplyMask &= ~ContentFlag_PTR_TYPE;
+                                }
+                                if ((u8ServiceMatchMask & ContentFlag_PTR_NAME) && (_buildDomainForService(*pService, true, serviceDomain)) && (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
+                                {
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service name PTR already known... skipping!\n")););
+                                    pService->m_u8ReplyMask &= ~ContentFlag_PTR_NAME;
+                                }
                             }
-                        }
-                        else if (u8ServiceMatchMask & ContentFlag_SRV)
-                        {
-                            DEBUG_EX_ERR(if (AnswerType_SRV != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (SRV)!\n")););
-                            stcMDNS_RRDomain hostDomain;
-                            if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                                (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))  // Host domain match
+                            else if (u8ServiceMatchMask & ContentFlag_SRV)
                             {
-                                if ((MDNS_SRV_PRIORITY == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Priority) &&
-                                    (MDNS_SRV_WEIGHT == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Weight) &&
-                                    (pService->m_u16Port == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Port))
+                                DEBUG_EX_ERR(if (AnswerType_SRV != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (SRV)!\n")););
+                                stcMDNS_RRDomain hostDomain;
+                                if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))  // Host domain match
                                 {
-                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service SRV answer already known... skipping!\n")););
-                                    pService->m_u8ReplyMask &= ~ContentFlag_SRV;
-                                }  // else: Small differences -> send update message
+                                    if ((MDNS_SRV_PRIORITY == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Priority) && (MDNS_SRV_WEIGHT == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Weight) && (pService->m_u16Port == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Port))
+                                    {
+                                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service SRV answer already known... skipping!\n")););
+                                        pService->m_u8ReplyMask &= ~ContentFlag_SRV;
+                                    }  // else: Small differences -> send update message
+                                }
                             }
-                        }
-                        else if (u8ServiceMatchMask & ContentFlag_TXT)
-                        {
-                            DEBUG_EX_ERR(if (AnswerType_TXT != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (TXT)!\n")););
-                            _collectServiceTxts(*pService);
-                            if (pService->m_Txts == ((stcMDNS_RRAnswerTXT*)pKnownRRAnswer)->m_Txts)
+                            else if (u8ServiceMatchMask & ContentFlag_TXT)
                             {
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service TXT answer already known... skipping!\n")););
-                                pService->m_u8ReplyMask &= ~ContentFlag_TXT;
+                                DEBUG_EX_ERR(if (AnswerType_TXT != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (TXT)!\n")););
+                                _collectServiceTxts(*pService);
+                                if (pService->m_Txts == ((stcMDNS_RRAnswerTXT*)pKnownRRAnswer)->m_Txts)
+                                {
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service TXT answer already known... skipping!\n")););
+                                    pService->m_u8ReplyMask &= ~ContentFlag_TXT;
+                                }
+                                _releaseTempServiceTxts(*pService);
                             }
-                            _releaseTempServiceTxts(*pService);
-                        }
-                    }  // Service match and enough TTL
+                        }  // Service match and enough TTL
 
-                    //
-                    // Check service tiebreak possibility
-                    if (pService->m_ProbeInformation.m_bTiebreakNeeded)
-                    {
-                        stcMDNS_RRDomain serviceDomain;
-                        if ((_buildDomainForService(*pService, true, serviceDomain)) &&
-                            (pKnownRRAnswer->m_Header.m_Domain == serviceDomain))
+                        //
+                        // Check service tiebreak possibility
+                        if (pService->m_ProbeInformation.m_bTiebreakNeeded)
                         {
-                            // Service domain match
-                            if (AnswerType_SRV == pKnownRRAnswer->answerType())
+                            stcMDNS_RRDomain serviceDomain;
+                            if ((_buildDomainForService(*pService, true, serviceDomain)) && (pKnownRRAnswer->m_Header.m_Domain == serviceDomain))
                             {
-                                stcMDNS_RRDomain hostDomain;
-                                if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                                    (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))  // Host domain match
-                                {
-                                    // We've received an old message from ourselves (same SRV)
-                                    DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (was an old message)!\n")););
-                                    pService->m_ProbeInformation.m_bTiebreakNeeded = false;
-                                }
-                                else
+                                // Service domain match
+                                if (AnswerType_SRV == pKnownRRAnswer->answerType())
                                 {
-                                    if (((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain > hostDomain)  // The OTHER domain is 'higher' -> LOST
+                                    stcMDNS_RRDomain hostDomain;
+                                    if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))  // Host domain match
                                     {
-                                        // LOST tiebreak
-                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) LOST (lower)!\n")););
-                                        _cancelProbingForService(*pService);
+                                        // We've received an old message from ourselves (same SRV)
+                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (was an old message)!\n")););
                                         pService->m_ProbeInformation.m_bTiebreakNeeded = false;
                                     }
-                                    else  // WON tiebreak
+                                    else
                                     {
-                                        //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
-                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (higher)!\n")););
-                                        pService->m_ProbeInformation.m_bTiebreakNeeded = false;
+                                        if (((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain > hostDomain)  // The OTHER domain is 'higher' -> LOST
+                                        {
+                                            // LOST tiebreak
+                                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) LOST (lower)!\n")););
+                                            _cancelProbingForService(*pService);
+                                            pService->m_ProbeInformation.m_bTiebreakNeeded = false;
+                                        }
+                                        else  // WON tiebreak
+                                        {
+                                            //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
+                                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (higher)!\n")););
+                                            pService->m_ProbeInformation.m_bTiebreakNeeded = false;
+                                        }
                                     }
                                 }
                             }
-                        }
-                    }  // service tiebreak possibility
-                }      // for services
-            }          // ANY answers
+                        }  // service tiebreak possibility
+                    }      // for services
+                }          // ANY answers
+            }
+            else
+            {
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read known answer!\n")););
+            }
+
+            if (pKnownRRAnswer)
+            {
+                delete pKnownRRAnswer;
+                pKnownRRAnswer = 0;
+            }
+        }  // for answers
+
+        if (bResult)
+        {
+            // Check, if a reply is needed
+            uint8_t u8ReplyNeeded = sendParameter.m_u8HostReplyMask;
+            for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+            {
+                u8ReplyNeeded |= pService->m_u8ReplyMask;
+            }
+
+            if (u8ReplyNeeded)
+            {
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Sending answer(0x%X)...\n"), u8ReplyNeeded););
+
+                sendParameter.m_bResponse = true;
+                sendParameter.m_bAuthorative = true;
+
+                bResult = _sendMDNSMessage(sendParameter);
+            }
+            DEBUG_EX_INFO(
+                else
+                {
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: No reply needed\n"));
+                });
         }
         else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read known answer!\n")););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Something FAILED!\n")););
+            m_pUDPContext->flush();
         }
 
-        if (pKnownRRAnswer)
+        //
+        // Check and reset tiebreak-states
+        if (m_HostProbeInformation.m_bTiebreakNeeded)
         {
-            delete pKnownRRAnswer;
-            pKnownRRAnswer = 0;
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for host domain!\n")););
+            m_HostProbeInformation.m_bTiebreakNeeded = false;
         }
-    }  // for answers
-
-    if (bResult)
-    {
-        // Check, if a reply is needed
-        uint8_t u8ReplyNeeded = sendParameter.m_u8HostReplyMask;
         for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
         {
-            u8ReplyNeeded |= pService->m_u8ReplyMask;
-        }
-
-        if (u8ReplyNeeded)
-        {
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Sending answer(0x%X)...\n"), u8ReplyNeeded););
-
-            sendParameter.m_bResponse = true;
-            sendParameter.m_bAuthorative = true;
-
-            bResult = _sendMDNSMessage(sendParameter);
+            if (pService->m_ProbeInformation.m_bTiebreakNeeded)
+            {
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for service domain (%s.%s.%s)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                pService->m_ProbeInformation.m_bTiebreakNeeded = false;
+            }
         }
-        DEBUG_EX_INFO(
-            else
+        DEBUG_EX_ERR(if (!bResult)
             {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: No reply needed\n"));
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED!\n"));
             });
+        return bResult;
     }
-    else
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Something FAILED!\n")););
-        m_pUDPContext->flush();
-    }
-
-    //
-    // Check and reset tiebreak-states
-    if (m_HostProbeInformation.m_bTiebreakNeeded)
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for host domain!\n")););
-        m_HostProbeInformation.m_bTiebreakNeeded = false;
-    }
-    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
-    {
-        if (pService->m_ProbeInformation.m_bTiebreakNeeded)
-        {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for service domain (%s.%s.%s)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
-            pService->m_ProbeInformation.m_bTiebreakNeeded = false;
-        }
-    }
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED!\n"));
-                 });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_parseResponse
 
     Responses are of interest in two cases:
@@ -597,83 +578,81 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
                TXT - links the instance name to services TXTs
       Level 3: A/AAAA - links the host domain to an IP address
 */
-bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse\n")););
-    //DEBUG_EX_INFO(_udpDump(););
-
-    bool bResult = false;
-
-    // A response should be the result of a query or a probe
-    if ((_hasServiceQueriesWaitingForAnswers()) ||  // Waiting for query answers OR
-        (_hasProbesWaitingForAnswers()))            // Probe responses
+    bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
     {
-        DEBUG_EX_INFO(
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response\n"));
-            //_udpDump();
-        );
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse\n")););
+        //DEBUG_EX_INFO(_udpDump(););
 
-        bResult = true;
-        //
-        // Ignore questions here
-        stcMDNS_RRQuestion dummyRRQ;
-        for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
-        {
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response containing a question... ignoring!\n")););
-            bResult = _readRRQuestion(dummyRRQ);
-        }  // for queries
+        bool bResult = false;
 
-        //
-        // Read and collect answers
-        stcMDNS_RRAnswer* pCollectedRRAnswers = 0;
-        uint32_t u32NumberOfAnswerRRs = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
-        for (uint32_t an = 0; ((bResult) && (an < u32NumberOfAnswerRRs)); ++an)
+        // A response should be the result of a query or a probe
+        if ((_hasServiceQueriesWaitingForAnswers()) ||  // Waiting for query answers OR
+            (_hasProbesWaitingForAnswers()))            // Probe responses
         {
-            stcMDNS_RRAnswer* pRRAnswer = 0;
-            if (((bResult = _readRRAnswer(pRRAnswer))) &&
-                (pRRAnswer))
+            DEBUG_EX_INFO(
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response\n"));
+                //_udpDump();
+            );
+
+            bResult = true;
+            //
+            // Ignore questions here
+            stcMDNS_RRQuestion dummyRRQ;
+            for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
             {
-                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: ADDING answer!\n")););
-                pRRAnswer->m_pNext = pCollectedRRAnswers;
-                pCollectedRRAnswers = pRRAnswer;
-            }
-            else
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response containing a question... ignoring!\n")););
+                bResult = _readRRQuestion(dummyRRQ);
+            }  // for queries
+
+            //
+            // Read and collect answers
+            stcMDNS_RRAnswer* pCollectedRRAnswers = 0;
+            uint32_t u32NumberOfAnswerRRs = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
+            for (uint32_t an = 0; ((bResult) && (an < u32NumberOfAnswerRRs)); ++an)
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answer!\n")););
-                if (pRRAnswer)
+                stcMDNS_RRAnswer* pRRAnswer = 0;
+                if (((bResult = _readRRAnswer(pRRAnswer))) && (pRRAnswer))
+                {
+                    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: ADDING answer!\n")););
+                    pRRAnswer->m_pNext = pCollectedRRAnswers;
+                    pCollectedRRAnswers = pRRAnswer;
+                }
+                else
                 {
-                    delete pRRAnswer;
-                    pRRAnswer = 0;
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answer!\n")););
+                    if (pRRAnswer)
+                    {
+                        delete pRRAnswer;
+                        pRRAnswer = 0;
+                    }
+                    bResult = false;
                 }
-                bResult = false;
+            }  // for answers
+
+            //
+            // Process answers
+            if (bResult)
+            {
+                bResult = ((!pCollectedRRAnswers) || (_processAnswers(pCollectedRRAnswers)));
+            }
+            else  // Some failure while reading answers
+            {
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answers!\n")););
+                m_pUDPContext->flush();
             }
-        }  // for answers
 
-        //
-        // Process answers
-        if (bResult)
-        {
-            bResult = ((!pCollectedRRAnswers) ||
-                       (_processAnswers(pCollectedRRAnswers)));
-        }
-        else  // Some failure while reading answers
-        {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answers!\n")););
-            m_pUDPContext->flush();
+            // Delete collected answers
+            while (pCollectedRRAnswers)
+            {
+                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: DELETING answer!\n")););
+                stcMDNS_RRAnswer* pNextAnswer = pCollectedRRAnswers->m_pNext;
+                delete pCollectedRRAnswers;
+                pCollectedRRAnswers = pNextAnswer;
+            }
         }
-
-        // Delete collected answers
-        while (pCollectedRRAnswers)
+        else  // Received an unexpected response -> ignore
         {
-            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: DELETING answer!\n")););
-            stcMDNS_RRAnswer* pNextAnswer = pCollectedRRAnswers->m_pNext;
-            delete pCollectedRRAnswers;
-            pCollectedRRAnswers = pNextAnswer;
-        }
-    }
-    else  // Received an unexpected response -> ignore
-    {
-        /*  DEBUG_EX_INFO(
+            /*  DEBUG_EX_INFO(
                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received an unexpected response... ignoring!\nDUMP:\n"));
                 bool    bDumpResult = true;
                 for (uint16_t qd=0; ((bDumpResult) && (qd<p_MsgHeader.m_u16QDCount)); ++qd) {
@@ -693,17 +672,17 @@ bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_Msg
                     esp_suspend();
                 }
             );*/
-        m_pUDPContext->flush();
-        bResult = true;
+            m_pUDPContext->flush();
+            bResult = true;
+        }
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED!\n"));
+            });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED!\n"));
-                 });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_processAnswers
     Host:
     A (0x01):               eg. esp8266.local A OP TTL 123.456.789.012
@@ -717,438 +696,427 @@ bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_Msg
     TXT (0x10):             eg. MyESP._http._tcp.local TXT OP TTL c#=1
 
 */
-bool MDNSResponder::_processAnswers(const MDNSResponder::stcMDNS_RRAnswer* p_pAnswers)
-{
-    bool bResult = false;
-
-    if (p_pAnswers)
+    bool MDNSResponder::_processAnswers(const MDNSResponder::stcMDNS_RRAnswer* p_pAnswers)
     {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Processing answers...\n")););
-        bResult = true;
+        bool bResult = false;
 
-        // Answers may arrive in an unexpected order. So we loop our answers as long, as we
-        // can connect new information to service queries
-        bool bFoundNewKeyAnswer;
-        do
+        if (p_pAnswers)
         {
-            bFoundNewKeyAnswer = false;
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Processing answers...\n")););
+            bResult = true;
 
-            const stcMDNS_RRAnswer* pRRAnswer = p_pAnswers;
-            while ((pRRAnswer) &&
-                   (bResult))
+            // Answers may arrive in an unexpected order. So we loop our answers as long, as we
+            // can connect new information to service queries
+            bool bFoundNewKeyAnswer;
+            do
             {
-                // 1. level answer (PTR)
-                if (AnswerType_PTR == pRRAnswer->answerType())
-                {
-                    // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
-                    bResult = _processPTRAnswer((stcMDNS_RRAnswerPTR*)pRRAnswer, bFoundNewKeyAnswer);  // May 'enable' new SRV or TXT answers to be linked to queries
-                }
-                // 2. level answers
-                // SRV -> host domain and port
-                else if (AnswerType_SRV == pRRAnswer->answerType())
-                {
-                    // eg. MyESP_http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
-                    bResult = _processSRVAnswer((stcMDNS_RRAnswerSRV*)pRRAnswer, bFoundNewKeyAnswer);  // May 'enable' new A/AAAA answers to be linked to queries
-                }
-                // TXT -> Txts
-                else if (AnswerType_TXT == pRRAnswer->answerType())
+                bFoundNewKeyAnswer = false;
+
+                const stcMDNS_RRAnswer* pRRAnswer = p_pAnswers;
+                while ((pRRAnswer) && (bResult))
                 {
-                    // eg. MyESP_http._tcp.local TXT xxxx xx c#=1
-                    bResult = _processTXTAnswer((stcMDNS_RRAnswerTXT*)pRRAnswer);
-                }
-                // 3. level answers
+                    // 1. level answer (PTR)
+                    if (AnswerType_PTR == pRRAnswer->answerType())
+                    {
+                        // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
+                        bResult = _processPTRAnswer((stcMDNS_RRAnswerPTR*)pRRAnswer, bFoundNewKeyAnswer);  // May 'enable' new SRV or TXT answers to be linked to queries
+                    }
+                    // 2. level answers
+                    // SRV -> host domain and port
+                    else if (AnswerType_SRV == pRRAnswer->answerType())
+                    {
+                        // eg. MyESP_http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
+                        bResult = _processSRVAnswer((stcMDNS_RRAnswerSRV*)pRRAnswer, bFoundNewKeyAnswer);  // May 'enable' new A/AAAA answers to be linked to queries
+                    }
+                    // TXT -> Txts
+                    else if (AnswerType_TXT == pRRAnswer->answerType())
+                    {
+                        // eg. MyESP_http._tcp.local TXT xxxx xx c#=1
+                        bResult = _processTXTAnswer((stcMDNS_RRAnswerTXT*)pRRAnswer);
+                    }
+                    // 3. level answers
 #ifdef MDNS_IP4_SUPPORT
-                // A -> IP4Address
-                else if (AnswerType_A == pRRAnswer->answerType())
-                {
-                    // eg. esp8266.local A xxxx xx 192.168.2.120
-                    bResult = _processAAnswer((stcMDNS_RRAnswerA*)pRRAnswer);
-                }
+                    // A -> IP4Address
+                    else if (AnswerType_A == pRRAnswer->answerType())
+                    {
+                        // eg. esp8266.local A xxxx xx 192.168.2.120
+                        bResult = _processAAnswer((stcMDNS_RRAnswerA*)pRRAnswer);
+                    }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                // AAAA -> IP6Address
-                else if (AnswerType_AAAA == pRRAnswer->answerType())
-                {
-                    // eg. esp8266.local AAAA xxxx xx 09cf::0c
-                    bResult = _processAAAAAnswer((stcMDNS_RRAnswerAAAA*)pRRAnswer);
-                }
+                    // AAAA -> IP6Address
+                    else if (AnswerType_AAAA == pRRAnswer->answerType())
+                    {
+                        // eg. esp8266.local AAAA xxxx xx 09cf::0c
+                        bResult = _processAAAAAnswer((stcMDNS_RRAnswerAAAA*)pRRAnswer);
+                    }
 #endif
 
-                // Finally check for probing conflicts
-                // Host domain
-                if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&
-                    ((AnswerType_A == pRRAnswer->answerType()) ||
-                     (AnswerType_AAAA == pRRAnswer->answerType())))
-                {
-                    stcMDNS_RRDomain hostDomain;
-                    if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                        (pRRAnswer->m_Header.m_Domain == hostDomain))
+                    // Finally check for probing conflicts
+                    // Host domain
+                    if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) && ((AnswerType_A == pRRAnswer->answerType()) || (AnswerType_AAAA == pRRAnswer->answerType())))
                     {
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.local\n"), m_pcHostname););
-                        _cancelProbingForHost();
+                        stcMDNS_RRDomain hostDomain;
+                        if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (pRRAnswer->m_Header.m_Domain == hostDomain))
+                        {
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.local\n"), m_pcHostname););
+                            _cancelProbingForHost();
+                        }
                     }
-                }
-                // Service domains
-                for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
-                {
-                    if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&
-                        ((AnswerType_TXT == pRRAnswer->answerType()) ||
-                         (AnswerType_SRV == pRRAnswer->answerType())))
+                    // Service domains
+                    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
                     {
-                        stcMDNS_RRDomain serviceDomain;
-                        if ((_buildDomainForService(*pService, true, serviceDomain)) &&
-                            (pRRAnswer->m_Header.m_Domain == serviceDomain))
+                        if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) && ((AnswerType_TXT == pRRAnswer->answerType()) || (AnswerType_SRV == pRRAnswer->answerType())))
                         {
-                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.%s.%s\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
-                            _cancelProbingForService(*pService);
+                            stcMDNS_RRDomain serviceDomain;
+                            if ((_buildDomainForService(*pService, true, serviceDomain)) && (pRRAnswer->m_Header.m_Domain == serviceDomain))
+                            {
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.%s.%s\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                                _cancelProbingForService(*pService);
+                            }
                         }
                     }
-                }
 
-                pRRAnswer = pRRAnswer->m_pNext;  // Next collected answer
-            }                                    // while (answers)
-        } while ((bFoundNewKeyAnswer) &&
-                 (bResult));
-    }  // else: No answers provided
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: FAILED!\n"));
-                 });
-    return bResult;
-}
+                    pRRAnswer = pRRAnswer->m_pNext;  // Next collected answer
+                }                                    // while (answers)
+            } while ((bFoundNewKeyAnswer) && (bResult));
+        }  // else: No answers provided
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: FAILED!\n"));
+            });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_processPTRAnswer
 */
-bool MDNSResponder::_processPTRAnswer(const MDNSResponder::stcMDNS_RRAnswerPTR* p_pPTRAnswer,
-                                      bool& p_rbFoundNewKeyAnswer)
-{
-    bool bResult = false;
-
-    if ((bResult = (0 != p_pPTRAnswer)))
+    bool MDNSResponder::_processPTRAnswer(const MDNSResponder::stcMDNS_RRAnswerPTR* p_pPTRAnswer,
+        bool& p_rbFoundNewKeyAnswer)
     {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Processing PTR answers...\n")););
-        // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
-        // Check pending service queries for eg. '_http._tcp'
+        bool bResult = false;
 
-        stcMDNSServiceQuery* pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, 0);
-        while (pServiceQuery)
+        if ((bResult = (0 != p_pPTRAnswer)))
         {
-            if (pServiceQuery->m_bAwaitingAnswers)
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Processing PTR answers...\n")););
+            // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
+            // Check pending service queries for eg. '_http._tcp'
+
+            stcMDNSServiceQuery* pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, 0);
+            while (pServiceQuery)
             {
-                // Find answer for service domain (eg. MyESP._http._tcp.local)
-                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pPTRAnswer->m_PTRDomain);
-                if (pSQAnswer)  // existing answer
+                if (pServiceQuery->m_bAwaitingAnswers)
                 {
-                    if (p_pPTRAnswer->m_u32TTL)  // Received update message
-                    {
-                        pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);  // Update TTL tag
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Updated TTL(%d) for "), (int)p_pPTRAnswer->m_u32TTL);
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR("\n")););
-                    }
-                    else  // received goodbye-message
+                    // Find answer for service domain (eg. MyESP._http._tcp.local)
+                    stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pPTRAnswer->m_PTRDomain);
+                    if (pSQAnswer)  // existing answer
                     {
-                        pSQAnswer->m_TTLServiceDomain.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: 'Goodbye' received for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR("\n")););
+                        if (p_pPTRAnswer->m_u32TTL)  // Received update message
+                        {
+                            pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);  // Update TTL tag
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Updated TTL(%d) for "), (int)p_pPTRAnswer->m_u32TTL);
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR("\n")););
+                        }
+                        else  // received goodbye-message
+                        {
+                            pSQAnswer->m_TTLServiceDomain.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: 'Goodbye' received for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR("\n")););
+                        }
                     }
-                }
-                else if ((p_pPTRAnswer->m_u32TTL) &&                          // Not just a goodbye-message
-                         ((pSQAnswer = new stcMDNSServiceQuery::stcAnswer)))  // Not yet included -> add answer
-                {
-                    pSQAnswer->m_ServiceDomain = p_pPTRAnswer->m_PTRDomain;
-                    pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_ServiceDomain;
-                    pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);
-                    pSQAnswer->releaseServiceDomain();
-
-                    bResult = pServiceQuery->addAnswer(pSQAnswer);
-                    p_rbFoundNewKeyAnswer = true;
-                    if (pServiceQuery->m_fnCallback)
+                    else if ((p_pPTRAnswer->m_u32TTL) &&                     // Not just a goodbye-message
+                        ((pSQAnswer = new stcMDNSServiceQuery::stcAnswer)))  // Not yet included -> add answer
                     {
-                        MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                        pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain), true);
+                        pSQAnswer->m_ServiceDomain = p_pPTRAnswer->m_PTRDomain;
+                        pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_ServiceDomain;
+                        pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);
+                        pSQAnswer->releaseServiceDomain();
+
+                        bResult = pServiceQuery->addAnswer(pSQAnswer);
+                        p_rbFoundNewKeyAnswer = true;
+                        if (pServiceQuery->m_fnCallback)
+                        {
+                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain), true);
+                        }
                     }
                 }
+                pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, pServiceQuery);
             }
-            pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, pServiceQuery);
-        }
-    }  // else: No p_pPTRAnswer
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: FAILED!\n"));
-                 });
-    return bResult;
-}
+        }  // else: No p_pPTRAnswer
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: FAILED!\n"));
+            });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_processSRVAnswer
 */
-bool MDNSResponder::_processSRVAnswer(const MDNSResponder::stcMDNS_RRAnswerSRV* p_pSRVAnswer,
-                                      bool& p_rbFoundNewKeyAnswer)
-{
-    bool bResult = false;
-
-    if ((bResult = (0 != p_pSRVAnswer)))
+    bool MDNSResponder::_processSRVAnswer(const MDNSResponder::stcMDNS_RRAnswerSRV* p_pSRVAnswer,
+        bool& p_rbFoundNewKeyAnswer)
     {
-        // eg. MyESP._http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
+        bool bResult = false;
 
-        stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
-        while (pServiceQuery)
+        if ((bResult = (0 != p_pSRVAnswer)))
         {
-            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pSRVAnswer->m_Header.m_Domain);
-            if (pSQAnswer)  // Answer for this service domain (eg. MyESP._http._tcp.local) available
+            // eg. MyESP._http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
+
+            stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
+            while (pServiceQuery)
             {
-                if (p_pSRVAnswer->m_u32TTL)  // First or update message (TTL != 0)
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pSRVAnswer->m_Header.m_Domain);
+                if (pSQAnswer)  // Answer for this service domain (eg. MyESP._http._tcp.local) available
                 {
-                    pSQAnswer->m_TTLHostDomainAndPort.set(p_pSRVAnswer->m_u32TTL);  // Update TTL tag
-                    DEBUG_EX_INFO(
-                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: Updated TTL(%d) for "), (int)p_pSRVAnswer->m_u32TTL);
-                        _printRRDomain(pSQAnswer->m_ServiceDomain);
-                        DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")););
-                    // Host domain & Port
-                    if ((pSQAnswer->m_HostDomain != p_pSRVAnswer->m_SRVDomain) ||
-                        (pSQAnswer->m_u16Port != p_pSRVAnswer->m_u16Port))
+                    if (p_pSRVAnswer->m_u32TTL)  // First or update message (TTL != 0)
                     {
-                        pSQAnswer->m_HostDomain = p_pSRVAnswer->m_SRVDomain;
-                        pSQAnswer->releaseHostDomain();
-                        pSQAnswer->m_u16Port = p_pSRVAnswer->m_u16Port;
-                        pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_HostDomainAndPort;
-
-                        p_rbFoundNewKeyAnswer = true;
-                        if (pServiceQuery->m_fnCallback)
+                        pSQAnswer->m_TTLHostDomainAndPort.set(p_pSRVAnswer->m_u32TTL);  // Update TTL tag
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: Updated TTL(%d) for "), (int)p_pSRVAnswer->m_u32TTL);
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")););
+                        // Host domain & Port
+                        if ((pSQAnswer->m_HostDomain != p_pSRVAnswer->m_SRVDomain) || (pSQAnswer->m_u16Port != p_pSRVAnswer->m_u16Port))
                         {
-                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_HostDomainAndPort), true);
+                            pSQAnswer->m_HostDomain = p_pSRVAnswer->m_SRVDomain;
+                            pSQAnswer->releaseHostDomain();
+                            pSQAnswer->m_u16Port = p_pSRVAnswer->m_u16Port;
+                            pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_HostDomainAndPort;
+
+                            p_rbFoundNewKeyAnswer = true;
+                            if (pServiceQuery->m_fnCallback)
+                            {
+                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_HostDomainAndPort), true);
+                            }
                         }
                     }
+                    else  // Goodby message
+                    {
+                        pSQAnswer->m_TTLHostDomainAndPort.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: 'Goodbye' received for "));
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")););
+                    }
                 }
-                else  // Goodby message
-                {
-                    pSQAnswer->m_TTLHostDomainAndPort.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                    DEBUG_EX_INFO(
-                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: 'Goodbye' received for "));
-                        _printRRDomain(pSQAnswer->m_ServiceDomain);
-                        DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")););
-                }
-            }
-            pServiceQuery = pServiceQuery->m_pNext;
-        }  // while(service query)
-    }      // else: No p_pSRVAnswer
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: FAILED!\n"));
-                 });
-    return bResult;
-}
+                pServiceQuery = pServiceQuery->m_pNext;
+            }  // while(service query)
+        }      // else: No p_pSRVAnswer
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: FAILED!\n"));
+            });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_processTXTAnswer
 */
-bool MDNSResponder::_processTXTAnswer(const MDNSResponder::stcMDNS_RRAnswerTXT* p_pTXTAnswer)
-{
-    bool bResult = false;
-
-    if ((bResult = (0 != p_pTXTAnswer)))
+    bool MDNSResponder::_processTXTAnswer(const MDNSResponder::stcMDNS_RRAnswerTXT* p_pTXTAnswer)
     {
-        // eg. MyESP._http._tcp.local TXT xxxx xx c#=1
+        bool bResult = false;
 
-        stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
-        while (pServiceQuery)
+        if ((bResult = (0 != p_pTXTAnswer)))
         {
-            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pTXTAnswer->m_Header.m_Domain);
-            if (pSQAnswer)  // Answer for this service domain (eg. MyESP._http._tcp.local) available
+            // eg. MyESP._http._tcp.local TXT xxxx xx c#=1
+
+            stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
+            while (pServiceQuery)
             {
-                if (p_pTXTAnswer->m_u32TTL)  // First or update message
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pTXTAnswer->m_Header.m_Domain);
+                if (pSQAnswer)  // Answer for this service domain (eg. MyESP._http._tcp.local) available
                 {
-                    pSQAnswer->m_TTLTxts.set(p_pTXTAnswer->m_u32TTL);  // Update TTL tag
-                    DEBUG_EX_INFO(
-                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: Updated TTL(%d) for "), (int)p_pTXTAnswer->m_u32TTL);
-                        _printRRDomain(pSQAnswer->m_ServiceDomain);
-                        DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")););
-                    if (!pSQAnswer->m_Txts.compare(p_pTXTAnswer->m_Txts))
+                    if (p_pTXTAnswer->m_u32TTL)  // First or update message
                     {
-                        pSQAnswer->m_Txts = p_pTXTAnswer->m_Txts;
-                        pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_Txts;
-                        pSQAnswer->releaseTxts();
-
-                        if (pServiceQuery->m_fnCallback)
+                        pSQAnswer->m_TTLTxts.set(p_pTXTAnswer->m_u32TTL);  // Update TTL tag
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: Updated TTL(%d) for "), (int)p_pTXTAnswer->m_u32TTL);
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")););
+                        if (!pSQAnswer->m_Txts.compare(p_pTXTAnswer->m_Txts))
                         {
-                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), true);
+                            pSQAnswer->m_Txts = p_pTXTAnswer->m_Txts;
+                            pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_Txts;
+                            pSQAnswer->releaseTxts();
+
+                            if (pServiceQuery->m_fnCallback)
+                            {
+                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), true);
+                            }
                         }
                     }
+                    else  // Goodby message
+                    {
+                        pSQAnswer->m_TTLTxts.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: 'Goodbye' received for "));
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")););
+                    }
                 }
-                else  // Goodby message
-                {
-                    pSQAnswer->m_TTLTxts.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                    DEBUG_EX_INFO(
-                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: 'Goodbye' received for "));
-                        _printRRDomain(pSQAnswer->m_ServiceDomain);
-                        DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")););
-                }
-            }
-            pServiceQuery = pServiceQuery->m_pNext;
-        }  // while(service query)
-    }      // else: No p_pTXTAnswer
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: FAILED!\n"));
-                 });
-    return bResult;
-}
+                pServiceQuery = pServiceQuery->m_pNext;
+            }  // while(service query)
+        }      // else: No p_pTXTAnswer
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: FAILED!\n"));
+            });
+        return bResult;
+    }
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::_processAAnswer
 */
-bool MDNSResponder::_processAAnswer(const MDNSResponder::stcMDNS_RRAnswerA* p_pAAnswer)
-{
-    bool bResult = false;
-
-    if ((bResult = (0 != p_pAAnswer)))
+    bool MDNSResponder::_processAAnswer(const MDNSResponder::stcMDNS_RRAnswerA* p_pAAnswer)
     {
-        // eg. esp8266.local A xxxx xx 192.168.2.120
+        bool bResult = false;
 
-        stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
-        while (pServiceQuery)
+        if ((bResult = (0 != p_pAAnswer)))
         {
-            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAnswer->m_Header.m_Domain);
-            if (pSQAnswer)  // Answer for this host domain (eg. esp8266.local) available
+            // eg. esp8266.local A xxxx xx 192.168.2.120
+
+            stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
+            while (pServiceQuery)
             {
-                stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = pSQAnswer->findIP4Address(p_pAAnswer->m_IPAddress);
-                if (pIP4Address)
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAnswer->m_Header.m_Domain);
+                if (pSQAnswer)  // Answer for this host domain (eg. esp8266.local) available
                 {
-                    // Already known IP4 address
-                    if (p_pAAnswer->m_u32TTL)  // Valid TTL -> Update answers TTL
+                    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = pSQAnswer->findIP4Address(p_pAAnswer->m_IPAddress);
+                    if (pIP4Address)
                     {
-                        pIP4Address->m_TTL.set(p_pAAnswer->m_u32TTL);
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%d) for "), (int)p_pAAnswer->m_u32TTL);
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" IP4Address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str()););
-                    }
-                    else  // 'Goodbye' message for known IP4 address
-                    {
-                        pIP4Address->m_TTL.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str()););
+                        // Already known IP4 address
+                        if (p_pAAnswer->m_u32TTL)  // Valid TTL -> Update answers TTL
+                        {
+                            pIP4Address->m_TTL.set(p_pAAnswer->m_u32TTL);
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%d) for "), (int)p_pAAnswer->m_u32TTL);
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" IP4Address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str()););
+                        }
+                        else  // 'Goodbye' message for known IP4 address
+                        {
+                            pIP4Address->m_TTL.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str()););
+                        }
                     }
-                }
-                else
-                {
-                    // Until now unknown IP4 address -> Add (if the message isn't just a 'Goodbye' note)
-                    if (p_pAAnswer->m_u32TTL)  // NOT just a 'Goodbye' message
+                    else
                     {
-                        pIP4Address = new stcMDNSServiceQuery::stcAnswer::stcIP4Address(p_pAAnswer->m_IPAddress, p_pAAnswer->m_u32TTL);
-                        if ((pIP4Address) &&
-                            (pSQAnswer->addIP4Address(pIP4Address)))
+                        // Until now unknown IP4 address -> Add (if the message isn't just a 'Goodbye' note)
+                        if (p_pAAnswer->m_u32TTL)  // NOT just a 'Goodbye' message
                         {
-                            pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
-                            if (pServiceQuery->m_fnCallback)
+                            pIP4Address = new stcMDNSServiceQuery::stcAnswer::stcIP4Address(p_pAAnswer->m_IPAddress, p_pAAnswer->m_u32TTL);
+                            if ((pIP4Address) && (pSQAnswer->addIP4Address(pIP4Address)))
                             {
-                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), true);
+                                pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
+                                if (pServiceQuery->m_fnCallback)
+                                {
+                                    MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                                    pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), true);
+                                }
+                            }
+                            else
+                            {
+                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP4 address (%s)!\n"), p_pAAnswer->m_IPAddress.toString().c_str()););
                             }
-                        }
-                        else
-                        {
-                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP4 address (%s)!\n"), p_pAAnswer->m_IPAddress.toString().c_str()););
                         }
                     }
                 }
-            }
-            pServiceQuery = pServiceQuery->m_pNext;
-        }  // while(service query)
-    }      // else: No p_pAAnswer
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED!\n"));
-                 });
-    return bResult;
-}
+                pServiceQuery = pServiceQuery->m_pNext;
+            }  // while(service query)
+        }      // else: No p_pAAnswer
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED!\n"));
+            });
+        return bResult;
+    }
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-/*
+    /*
     MDNSResponder::_processAAAAAnswer
 */
-bool MDNSResponder::_processAAAAAnswer(const MDNSResponder::stcMDNS_RRAnswerAAAA* p_pAAAAAnswer)
-{
-    bool bResult = false;
-
-    if ((bResult = (0 != p_pAAAAAnswer)))
+    bool MDNSResponder::_processAAAAAnswer(const MDNSResponder::stcMDNS_RRAnswerAAAA* p_pAAAAAnswer)
     {
-        // eg. esp8266.local AAAA xxxx xx 0bf3::0c
+        bool bResult = false;
 
-        stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
-        while (pServiceQuery)
+        if ((bResult = (0 != p_pAAAAAnswer)))
         {
-            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAAAAnswer->m_Header.m_Domain);
-            if (pSQAnswer)  // Answer for this host domain (eg. esp8266.local) available
+            // eg. esp8266.local AAAA xxxx xx 0bf3::0c
+
+            stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
+            while (pServiceQuery)
             {
-                stcIP6Address* pIP6Address = pSQAnswer->findIP6Address(p_pAAAAAnswer->m_IPAddress);
-                if (pIP6Address)
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAAAAnswer->m_Header.m_Domain);
+                if (pSQAnswer)  // Answer for this host domain (eg. esp8266.local) available
                 {
-                    // Already known IP6 address
-                    if (p_pAAAAAnswer->m_u32TTL)  // Valid TTL -> Update answers TTL
-                    {
-                        pIP6Address->m_TTL.set(p_pAAAAAnswer->m_u32TTL);
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%lu) for "), p_pAAAAAnswer->m_u32TTL);
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str()););
-                    }
-                    else  // 'Goodbye' message for known IP6 address
+                    stcIP6Address* pIP6Address = pSQAnswer->findIP6Address(p_pAAAAAnswer->m_IPAddress);
+                    if (pIP6Address)
                     {
-                        pIP6Address->m_TTL.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str()););
+                        // Already known IP6 address
+                        if (p_pAAAAAnswer->m_u32TTL)  // Valid TTL -> Update answers TTL
+                        {
+                            pIP6Address->m_TTL.set(p_pAAAAAnswer->m_u32TTL);
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%lu) for "), p_pAAAAAnswer->m_u32TTL);
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str()););
+                        }
+                        else  // 'Goodbye' message for known IP6 address
+                        {
+                            pIP6Address->m_TTL.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str()););
+                        }
                     }
-                }
-                else
-                {
-                    // Until now unknown IP6 address -> Add (if the message isn't just a 'Goodbye' note)
-                    if (p_pAAAAAnswer->m_u32TTL)  // NOT just a 'Goodbye' message
+                    else
                     {
-                        pIP6Address = new stcIP6Address(p_pAAAAAnswer->m_IPAddress, p_pAAAAAnswer->m_u32TTL);
-                        if ((pIP6Address) &&
-                            (pSQAnswer->addIP6Address(pIP6Address)))
+                        // Until now unknown IP6 address -> Add (if the message isn't just a 'Goodbye' note)
+                        if (p_pAAAAAnswer->m_u32TTL)  // NOT just a 'Goodbye' message
                         {
-                            pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP6Address;
+                            pIP6Address = new stcIP6Address(p_pAAAAAnswer->m_IPAddress, p_pAAAAAnswer->m_u32TTL);
+                            if ((pIP6Address) && (pSQAnswer->addIP6Address(pIP6Address)))
+                            {
+                                pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP6Address;
 
-                            if (pServiceQuery->m_fnCallback)
+                                if (pServiceQuery->m_fnCallback)
+                                {
+                                    pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, true, pServiceQuery->m_pUserdata);
+                                }
+                            }
+                            else
                             {
-                                pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, true, pServiceQuery->m_pUserdata);
+                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP6 address (%s)!\n"), p_pAAAAAnswer->m_IPAddress.toString().c_str()););
                             }
                         }
-                        else
-                        {
-                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP6 address (%s)!\n"), p_pAAAAAnswer->m_IPAddress.toString().c_str()););
-                        }
                     }
                 }
-            }
-            pServiceQuery = pServiceQuery->m_pNext;
-        }  // while(service query)
-    }      // else: No p_pAAAAAnswer
+                pServiceQuery = pServiceQuery->m_pNext;
+            }  // while(service query)
+        }      // else: No p_pAAAAAnswer
 
-    return bResult;
-}
+        return bResult;
+    }
 #endif
 
-/*
+    /*
     PROBING
 */
 
-/*
+    /*
     MDNSResponder::_updateProbeStatus
 
     Manages the (outgoing) probing process.
@@ -1160,132 +1128,130 @@ bool MDNSResponder::_processAAAAAnswer(const MDNSResponder::stcMDNS_RRAnswerAAAA
     Conflict management is handled in '_parseResponse ff.'
     Tiebraking is handled in 'parseQuery ff.'
 */
-bool MDNSResponder::_updateProbeStatus(void)
-{
-    bool bResult = true;
-
-    //
-    // Probe host domain
-    if (ProbingStatus_ReadyToStart == m_HostProbeInformation.m_ProbingStatus)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Starting host probing...\n")););
-
-        // First probe delay SHOULD be random 0-250 ms
-        m_HostProbeInformation.m_Timeout.reset(rand() % MDNS_PROBE_DELAY);
-        m_HostProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
-    }
-    else if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing AND
-             (m_HostProbeInformation.m_Timeout.expired()))                            // Time for next probe
+    bool MDNSResponder::_updateProbeStatus(void)
     {
-        if (MDNS_PROBE_COUNT > m_HostProbeInformation.m_u8SentCount)  // Send next probe
-        {
-            if ((bResult = _sendHostProbe()))
-            {
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Did sent host probe\n\n")););
-                m_HostProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);
-                ++m_HostProbeInformation.m_u8SentCount;
-            }
-        }
-        else  // Probing finished
-        {
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host probing.\n")););
-            m_HostProbeInformation.m_ProbingStatus = ProbingStatus_Done;
-            m_HostProbeInformation.m_Timeout.resetToNeverExpires();
-            if (m_HostProbeInformation.m_fnHostProbeResultCallback)
-            {
-                m_HostProbeInformation.m_fnHostProbeResultCallback(m_pcHostname, true);
-            }
+        bool bResult = true;
 
-            // Prepare to announce host
-            m_HostProbeInformation.m_u8SentCount = 0;
-            m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared host announcing.\n\n")););
-        }
-    }  // else: Probing already finished OR waiting for next time slot
-    else if ((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus) &&
-             (m_HostProbeInformation.m_Timeout.expired()))
-    {
-        if ((bResult = _announce(true, false)))  // Don't announce services here
+        //
+        // Probe host domain
+        if (ProbingStatus_ReadyToStart == m_HostProbeInformation.m_ProbingStatus)
         {
-            ++m_HostProbeInformation.m_u8SentCount;
-
-            if (MDNS_ANNOUNCE_COUNT > m_HostProbeInformation.m_u8SentCount)
-            {
-                m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing host (%d).\n\n"), m_HostProbeInformation.m_u8SentCount););
-            }
-            else
-            {
-                m_HostProbeInformation.m_Timeout.resetToNeverExpires();
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host announcing.\n\n")););
-            }
-        }
-    }
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Starting host probing...\n")););
 
-    //
-    // Probe services
-    for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
-    {
-        if (ProbingStatus_ReadyToStart == pService->m_ProbeInformation.m_ProbingStatus)  // Ready to get started
-        {
-            pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);  // More or equal than first probe for host domain
-            pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
+            // First probe delay SHOULD be random 0-250 ms
+            m_HostProbeInformation.m_Timeout.reset(rand() % MDNS_PROBE_DELAY);
+            m_HostProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
         }
-        else if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing AND
-                 (pService->m_ProbeInformation.m_Timeout.expired()))                            // Time for next probe
+        else if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing AND
+            (m_HostProbeInformation.m_Timeout.expired()))                                 // Time for next probe
         {
-            if (MDNS_PROBE_COUNT > pService->m_ProbeInformation.m_u8SentCount)  // Send next probe
+            if (MDNS_PROBE_COUNT > m_HostProbeInformation.m_u8SentCount)  // Send next probe
             {
-                if ((bResult = _sendServiceProbe(*pService)))
+                if ((bResult = _sendHostProbe()))
                 {
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Did sent service probe (%u)\n\n"), (pService->m_ProbeInformation.m_u8SentCount + 1)););
-                    pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);
-                    ++pService->m_ProbeInformation.m_u8SentCount;
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Did sent host probe\n\n")););
+                    m_HostProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);
+                    ++m_HostProbeInformation.m_u8SentCount;
                 }
             }
             else  // Probing finished
             {
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service probing %s.%s.%s\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
-                pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_Done;
-                pService->m_ProbeInformation.m_Timeout.resetToNeverExpires();
-                if (pService->m_ProbeInformation.m_fnServiceProbeResultCallback)
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host probing.\n")););
+                m_HostProbeInformation.m_ProbingStatus = ProbingStatus_Done;
+                m_HostProbeInformation.m_Timeout.resetToNeverExpires();
+                if (m_HostProbeInformation.m_fnHostProbeResultCallback)
                 {
-                    pService->m_ProbeInformation.m_fnServiceProbeResultCallback(pService->m_pcName, pService, true);
+                    m_HostProbeInformation.m_fnHostProbeResultCallback(m_pcHostname, true);
                 }
-                // Prepare to announce service
-                pService->m_ProbeInformation.m_u8SentCount = 0;
-                pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared service announcing.\n\n")););
+
+                // Prepare to announce host
+                m_HostProbeInformation.m_u8SentCount = 0;
+                m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared host announcing.\n\n")););
             }
         }  // else: Probing already finished OR waiting for next time slot
-        else if ((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus) &&
-                 (pService->m_ProbeInformation.m_Timeout.expired()))
+        else if ((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus) && (m_HostProbeInformation.m_Timeout.expired()))
         {
-            if ((bResult = _announceService(*pService)))  // Announce service
+            if ((bResult = _announce(true, false)))  // Don't announce services here
             {
-                ++pService->m_ProbeInformation.m_u8SentCount;
+                ++m_HostProbeInformation.m_u8SentCount;
 
-                if (MDNS_ANNOUNCE_COUNT > pService->m_ProbeInformation.m_u8SentCount)
+                if (MDNS_ANNOUNCE_COUNT > m_HostProbeInformation.m_u8SentCount)
                 {
-                    pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing service %s.%s.%s (%d)\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_ProbeInformation.m_u8SentCount););
+                    m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing host (%d).\n\n"), m_HostProbeInformation.m_u8SentCount););
                 }
                 else
                 {
+                    m_HostProbeInformation.m_Timeout.resetToNeverExpires();
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host announcing.\n\n")););
+                }
+            }
+        }
+
+        //
+        // Probe services
+        for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+        {
+            if (ProbingStatus_ReadyToStart == pService->m_ProbeInformation.m_ProbingStatus)  // Ready to get started
+            {
+                pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);  // More or equal than first probe for host domain
+                pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
+            }
+            else if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing AND
+                (pService->m_ProbeInformation.m_Timeout.expired()))                                 // Time for next probe
+            {
+                if (MDNS_PROBE_COUNT > pService->m_ProbeInformation.m_u8SentCount)  // Send next probe
+                {
+                    if ((bResult = _sendServiceProbe(*pService)))
+                    {
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Did sent service probe (%u)\n\n"), (pService->m_ProbeInformation.m_u8SentCount + 1)););
+                        pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);
+                        ++pService->m_ProbeInformation.m_u8SentCount;
+                    }
+                }
+                else  // Probing finished
+                {
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service probing %s.%s.%s\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                    pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_Done;
                     pService->m_ProbeInformation.m_Timeout.resetToNeverExpires();
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service announcing for %s.%s.%s\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                    if (pService->m_ProbeInformation.m_fnServiceProbeResultCallback)
+                    {
+                        pService->m_ProbeInformation.m_fnServiceProbeResultCallback(pService->m_pcName, pService, true);
+                    }
+                    // Prepare to announce service
+                    pService->m_ProbeInformation.m_u8SentCount = 0;
+                    pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared service announcing.\n\n")););
+                }
+            }  // else: Probing already finished OR waiting for next time slot
+            else if ((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus) && (pService->m_ProbeInformation.m_Timeout.expired()))
+            {
+                if ((bResult = _announceService(*pService)))  // Announce service
+                {
+                    ++pService->m_ProbeInformation.m_u8SentCount;
+
+                    if (MDNS_ANNOUNCE_COUNT > pService->m_ProbeInformation.m_u8SentCount)
+                    {
+                        pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing service %s.%s.%s (%d)\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_ProbeInformation.m_u8SentCount););
+                    }
+                    else
+                    {
+                        pService->m_ProbeInformation.m_Timeout.resetToNeverExpires();
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service announcing for %s.%s.%s\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                    }
                 }
             }
         }
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: FAILED!\n\n"));
+            });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: FAILED!\n\n"));
-                 });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_resetProbeStatus
 
     Resets the probe status.
@@ -1293,36 +1259,36 @@ bool MDNSResponder::_updateProbeStatus(void)
     when running 'updateProbeStatus' (which is done in every '_update' loop), the probing
     process is restarted.
 */
-bool MDNSResponder::_resetProbeStatus(bool p_bRestart /*= true*/)
-{
-    m_HostProbeInformation.clear(false);
-    m_HostProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
-
-    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+    bool MDNSResponder::_resetProbeStatus(bool p_bRestart /*= true*/)
     {
-        pService->m_ProbeInformation.clear(false);
-        pService->m_ProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
+        m_HostProbeInformation.clear(false);
+        m_HostProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
+
+        for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+        {
+            pService->m_ProbeInformation.clear(false);
+            pService->m_ProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::_hasProbesWaitingForAnswers
 */
-bool MDNSResponder::_hasProbesWaitingForAnswers(void) const
-{
-    bool bResult = ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing
-                    (0 < m_HostProbeInformation.m_u8SentCount));                             // And really probing
-
-    for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
+    bool MDNSResponder::_hasProbesWaitingForAnswers(void) const
     {
-        bResult = ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing
-                   (0 < pService->m_ProbeInformation.m_u8SentCount));                             // And really probing
+        bool bResult = ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing
+            (0 < m_HostProbeInformation.m_u8SentCount));                                         // And really probing
+
+        for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
+        {
+            bResult = ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing
+                (0 < pService->m_ProbeInformation.m_u8SentCount));                                    // And really probing
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_sendHostProbe
 
     Asks (probes) in the local network for the planned host domain
@@ -1333,50 +1299,48 @@ bool MDNSResponder::_hasProbesWaitingForAnswers(void) const
     Host domain:
     - A/AAAA (eg. esp8266.esp -> 192.168.2.120)
 */
-bool MDNSResponder::_sendHostProbe(void)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe (%s, %lu)\n"), m_pcHostname, millis()););
+    bool MDNSResponder::_sendHostProbe(void)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe (%s, %lu)\n"), m_pcHostname, millis()););
 
-    bool bResult = true;
+        bool bResult = true;
 
-    // Requests for host domain
-    stcMDNSSendParameter sendParameter;
-    sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
+        // Requests for host domain
+        stcMDNSSendParameter sendParameter;
+        sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
 
-    sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
-    if (((bResult = (0 != sendParameter.m_pQuestions))) &&
-        ((bResult = _buildDomainForHost(m_pcHostname, sendParameter.m_pQuestions->m_Header.m_Domain))))
-    {
-        //sendParameter.m_pQuestions->m_bUnicast = true;
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY;
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
+        sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
+        if (((bResult = (0 != sendParameter.m_pQuestions))) && ((bResult = _buildDomainForHost(m_pcHostname, sendParameter.m_pQuestions->m_Header.m_Domain))))
+        {
+            //sendParameter.m_pQuestions->m_bUnicast = true;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
 
-        // Add known answers
+            // Add known answers
 #ifdef MDNS_IP4_SUPPORT
-        sendParameter.m_u8HostReplyMask |= ContentFlag_A;  // Add A answer
+            sendParameter.m_u8HostReplyMask |= ContentFlag_A;  // Add A answer
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;  // Add AAAA answer
+            sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;  // Add AAAA answer
 #endif
-    }
-    else
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED to create host question!\n")););
-        if (sendParameter.m_pQuestions)
+        }
+        else
         {
-            delete sendParameter.m_pQuestions;
-            sendParameter.m_pQuestions = 0;
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED to create host question!\n")););
+            if (sendParameter.m_pQuestions)
+            {
+                delete sendParameter.m_pQuestions;
+                sendParameter.m_pQuestions = 0;
+            }
         }
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED!\n"));
+            });
+        return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED!\n"));
-                 });
-    return ((bResult) &&
-            (_sendMDNSMessage(sendParameter)));
-}
 
-/*
+    /*
     MDNSResponder::_sendServiceProbe
 
     Asks (probes) in the local network for the planned service instance domain
@@ -1388,89 +1352,87 @@ bool MDNSResponder::_sendHostProbe(void)
     - SRV (eg. MyESP._http._tcp.local -> 5000 esp8266.local)
     - PTR NAME (eg. _http._tcp.local -> MyESP._http._tcp.local) (TODO: Check if needed, maybe TXT is better)
 */
-bool MDNSResponder::_sendServiceProbe(stcMDNSService& p_rService)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe (%s.%s.%s, %lu)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, millis()););
-
-    bool bResult = true;
+    bool MDNSResponder::_sendServiceProbe(stcMDNSService& p_rService)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe (%s.%s.%s, %lu)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, millis()););
 
-    // Requests for service instance domain
-    stcMDNSSendParameter sendParameter;
-    sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
+        bool bResult = true;
 
-    sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
-    if (((bResult = (0 != sendParameter.m_pQuestions))) &&
-        ((bResult = _buildDomainForService(p_rService, true, sendParameter.m_pQuestions->m_Header.m_Domain))))
-    {
-        sendParameter.m_pQuestions->m_bUnicast = true;
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY;
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
+        // Requests for service instance domain
+        stcMDNSSendParameter sendParameter;
+        sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
 
-        // Add known answers
-        p_rService.m_u8ReplyMask = (ContentFlag_SRV | ContentFlag_PTR_NAME);  // Add SRV and PTR NAME answers
-    }
-    else
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED to create service question!\n")););
-        if (sendParameter.m_pQuestions)
+        sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
+        if (((bResult = (0 != sendParameter.m_pQuestions))) && ((bResult = _buildDomainForService(p_rService, true, sendParameter.m_pQuestions->m_Header.m_Domain))))
+        {
+            sendParameter.m_pQuestions->m_bUnicast = true;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
+
+            // Add known answers
+            p_rService.m_u8ReplyMask = (ContentFlag_SRV | ContentFlag_PTR_NAME);  // Add SRV and PTR NAME answers
+        }
+        else
         {
-            delete sendParameter.m_pQuestions;
-            sendParameter.m_pQuestions = 0;
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED to create service question!\n")););
+            if (sendParameter.m_pQuestions)
+            {
+                delete sendParameter.m_pQuestions;
+                sendParameter.m_pQuestions = 0;
+            }
         }
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED!\n"));
+            });
+        return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED!\n"));
-                 });
-    return ((bResult) &&
-            (_sendMDNSMessage(sendParameter)));
-}
 
-/*
+    /*
     MDNSResponder::_cancelProbingForHost
 */
-bool MDNSResponder::_cancelProbingForHost(void)
-{
-    bool bResult = false;
-
-    m_HostProbeInformation.clear(false);
-    // Send host notification
-    if (m_HostProbeInformation.m_fnHostProbeResultCallback)
+    bool MDNSResponder::_cancelProbingForHost(void)
     {
-        m_HostProbeInformation.m_fnHostProbeResultCallback(m_pcHostname, false);
+        bool bResult = false;
 
-        bResult = true;
-    }
+        m_HostProbeInformation.clear(false);
+        // Send host notification
+        if (m_HostProbeInformation.m_fnHostProbeResultCallback)
+        {
+            m_HostProbeInformation.m_fnHostProbeResultCallback(m_pcHostname, false);
 
-    for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
-    {
-        bResult = _cancelProbingForService(*pService);
+            bResult = true;
+        }
+
+        for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
+        {
+            bResult = _cancelProbingForService(*pService);
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_cancelProbingForService
 */
-bool MDNSResponder::_cancelProbingForService(stcMDNSService& p_rService)
-{
-    bool bResult = false;
-
-    p_rService.m_ProbeInformation.clear(false);
-    // Send notification
-    if (p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback)
+    bool MDNSResponder::_cancelProbingForService(stcMDNSService& p_rService)
     {
-        p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback(p_rService.m_pcName, &p_rService, false);
-        bResult = true;
+        bool bResult = false;
+
+        p_rService.m_ProbeInformation.clear(false);
+        // Send notification
+        if (p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback)
+        {
+            p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback(p_rService.m_pcName, &p_rService, false);
+            bResult = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/**
+    /**
     ANNOUNCING
 */
 
-/*
+    /*
     MDNSResponder::_announce
 
     Announces the host domain:
@@ -1487,110 +1449,108 @@ bool MDNSResponder::_cancelProbingForService(stcMDNSService& p_rService)
     Goodbye messages are created by setting the TTL for the answer to 0, this happens
     inside the '_writeXXXAnswer' procs via 'sendParameter.m_bUnannounce = true'
 */
-bool MDNSResponder::_announce(bool p_bAnnounce,
-                              bool p_bIncludeServices)
-{
-    bool bResult = false;
-
-    stcMDNSSendParameter sendParameter;
-    if (ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus)
+    bool MDNSResponder::_announce(bool p_bAnnounce,
+        bool p_bIncludeServices)
     {
-        bResult = true;
+        bool bResult = false;
+
+        stcMDNSSendParameter sendParameter;
+        if (ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus)
+        {
+            bResult = true;
 
-        sendParameter.m_bResponse = true;  // Announces are 'Unsolicited authoritative responses'
-        sendParameter.m_bAuthorative = true;
-        sendParameter.m_bUnannounce = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
+            sendParameter.m_bResponse = true;  // Announces are 'Unsolicited authoritative responses'
+            sendParameter.m_bAuthorative = true;
+            sendParameter.m_bUnannounce = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
 
-        // Announce host
-        sendParameter.m_u8HostReplyMask = 0;
+            // Announce host
+            sendParameter.m_u8HostReplyMask = 0;
 #ifdef MDNS_IP4_SUPPORT
-        sendParameter.m_u8HostReplyMask |= ContentFlag_A;        // A answer
-        sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP4;  // PTR_IP4 answer
+            sendParameter.m_u8HostReplyMask |= ContentFlag_A;        // A answer
+            sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP4;  // PTR_IP4 answer
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;     // AAAA answer
-        sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP6;  // PTR_IP6 answer
+            sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;     // AAAA answer
+            sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP6;  // PTR_IP6 answer
 #endif
 
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing host %s (content 0x%X)\n"), m_pcHostname, sendParameter.m_u8HostReplyMask););
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing host %s (content 0x%X)\n"), m_pcHostname, sendParameter.m_u8HostReplyMask););
 
-        if (p_bIncludeServices)
-        {
-            // Announce services (service type, name, SRV (location) and TXTs)
-            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+            if (p_bIncludeServices)
             {
-                if (ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus)
+                // Announce services (service type, name, SRV (location) and TXTs)
+                for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
                 {
-                    pService->m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
+                    if (ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus)
+                    {
+                        pService->m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
 
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing service %s.%s.%s (content %u)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_u8ReplyMask););
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing service %s.%s.%s (content %u)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_u8ReplyMask););
+                    }
                 }
             }
         }
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: FAILED!\n"));
+            });
+        return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: FAILED!\n"));
-                 });
-    return ((bResult) &&
-            (_sendMDNSMessage(sendParameter)));
-}
 
-/*
+    /*
     MDNSResponder::_announceService
 */
-bool MDNSResponder::_announceService(stcMDNSService& p_rService,
-                                     bool p_bAnnounce /*= true*/)
-{
-    bool bResult = false;
-
-    stcMDNSSendParameter sendParameter;
-    if (ProbingStatus_Done == p_rService.m_ProbeInformation.m_ProbingStatus)
+    bool MDNSResponder::_announceService(stcMDNSService& p_rService,
+        bool p_bAnnounce /*= true*/)
     {
-        sendParameter.m_bResponse = true;  // Announces are 'Unsolicited authoritative responses'
-        sendParameter.m_bAuthorative = true;
-        sendParameter.m_bUnannounce = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
+        bool bResult = false;
+
+        stcMDNSSendParameter sendParameter;
+        if (ProbingStatus_Done == p_rService.m_ProbeInformation.m_ProbingStatus)
+        {
+            sendParameter.m_bResponse = true;  // Announces are 'Unsolicited authoritative responses'
+            sendParameter.m_bAuthorative = true;
+            sendParameter.m_bUnannounce = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
 
-        // DON'T announce host
-        sendParameter.m_u8HostReplyMask = 0;
+            // DON'T announce host
+            sendParameter.m_u8HostReplyMask = 0;
 
-        // Announce services (service type, name, SRV (location) and TXTs)
-        p_rService.m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: Announcing service %s.%s.%s (content 0x%X)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, p_rService.m_u8ReplyMask););
+            // Announce services (service type, name, SRV (location) and TXTs)
+            p_rService.m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: Announcing service %s.%s.%s (content 0x%X)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, p_rService.m_u8ReplyMask););
 
-        bResult = true;
+            bResult = true;
+        }
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: FAILED!\n"));
+            });
+        return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: FAILED!\n"));
-                 });
-    return ((bResult) &&
-            (_sendMDNSMessage(sendParameter)));
-}
 
-/**
+    /**
     SERVICE QUERY CACHE
 */
 
-/*
+    /*
     MDNSResponder::_hasServiceQueriesWaitingForAnswers
 */
-bool MDNSResponder::_hasServiceQueriesWaitingForAnswers(void) const
-{
-    bool bOpenQueries = false;
-
-    for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; pServiceQuery; pServiceQuery = pServiceQuery->m_pNext)
+    bool MDNSResponder::_hasServiceQueriesWaitingForAnswers(void) const
     {
-        if (pServiceQuery->m_bAwaitingAnswers)
+        bool bOpenQueries = false;
+
+        for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; pServiceQuery; pServiceQuery = pServiceQuery->m_pNext)
         {
-            bOpenQueries = true;
-            break;
+            if (pServiceQuery->m_bAwaitingAnswers)
+            {
+                bOpenQueries = true;
+                break;
+            }
         }
+        return bOpenQueries;
     }
-    return bOpenQueries;
-}
 
-/*
+    /*
     MDNSResponder::_checkServiceQueryCache
 
     For any 'living' service query (m_bAwaitingAnswers == true) all available answers (their components)
@@ -1599,281 +1559,268 @@ bool MDNSResponder::_hasServiceQueriesWaitingForAnswers(void) const
     When no update arrived (in time), the component is removed from the answer (cache).
 
 */
-bool MDNSResponder::_checkServiceQueryCache(void)
-{
-    bool bResult = true;
-
-    DEBUG_EX_INFO(
-        bool printedInfo = false;);
-    for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; ((bResult) && (pServiceQuery)); pServiceQuery = pServiceQuery->m_pNext)
+    bool MDNSResponder::_checkServiceQueryCache(void)
     {
-        //
-        // Resend dynamic service queries, if not already done often enough
-        if ((!pServiceQuery->m_bLegacyQuery) &&
-            (MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount) &&
-            (pServiceQuery->m_ResendTimeout.expired()))
+        bool bResult = true;
+
+        DEBUG_EX_INFO(
+            bool printedInfo = false;);
+        for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; ((bResult) && (pServiceQuery)); pServiceQuery = pServiceQuery->m_pNext)
         {
-            if ((bResult = _sendMDNSServiceQuery(*pServiceQuery)))
+            //
+            // Resend dynamic service queries, if not already done often enough
+            if ((!pServiceQuery->m_bLegacyQuery) && (MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount) && (pServiceQuery->m_ResendTimeout.expired()))
             {
-                ++pServiceQuery->m_u8SentCount;
-                pServiceQuery->m_ResendTimeout.reset((MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount)
-                                                         ? (MDNS_DYNAMIC_QUERY_RESEND_DELAY * (pServiceQuery->m_u8SentCount - 1))
-                                                         : esp8266::polledTimeout::oneShotMs::neverExpires);
+                if ((bResult = _sendMDNSServiceQuery(*pServiceQuery)))
+                {
+                    ++pServiceQuery->m_u8SentCount;
+                    pServiceQuery->m_ResendTimeout.reset((MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount)
+                            ? (MDNS_DYNAMIC_QUERY_RESEND_DELAY * (pServiceQuery->m_u8SentCount - 1))
+                            : esp8266::polledTimeout::oneShotMs::neverExpires);
+                }
+                DEBUG_EX_INFO(
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: %s to resend service query!"), (bResult ? "Succeeded" : "FAILED"));
+                    printedInfo = true;);
             }
-            DEBUG_EX_INFO(
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: %s to resend service query!"), (bResult ? "Succeeded" : "FAILED"));
-                printedInfo = true;);
-        }
 
-        //
-        // Schedule updates for cached answers
-        if (pServiceQuery->m_bAwaitingAnswers)
-        {
-            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->m_pAnswers;
-            while ((bResult) &&
-                   (pSQAnswer))
+            //
+            // Schedule updates for cached answers
+            if (pServiceQuery->m_bAwaitingAnswers)
             {
-                stcMDNSServiceQuery::stcAnswer* pNextSQAnswer = pSQAnswer->m_pNext;
-
-                // 1. level answer
-                if ((bResult) &&
-                    (pSQAnswer->m_TTLServiceDomain.flagged()))
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->m_pAnswers;
+                while ((bResult) && (pSQAnswer))
                 {
-                    if (!pSQAnswer->m_TTLServiceDomain.finalTimeoutLevel())
-                    {
-                        bResult = ((_sendMDNSServiceQuery(*pServiceQuery)) &&
-                                   (pSQAnswer->m_TTLServiceDomain.restart()));
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: PTR update scheduled for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" %s\n"), (bResult ? "OK" : "FAILURE"));
-                            printedInfo = true;);
-                    }
-                    else
+                    stcMDNSServiceQuery::stcAnswer* pNextSQAnswer = pSQAnswer->m_pNext;
+
+                    // 1. level answer
+                    if ((bResult) && (pSQAnswer->m_TTLServiceDomain.flagged()))
                     {
-                        // Timed out! -> Delete
-                        if (pServiceQuery->m_fnCallback)
+                        if (!pSQAnswer->m_TTLServiceDomain.finalTimeoutLevel())
                         {
-                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain), false);
+                            bResult = ((_sendMDNSServiceQuery(*pServiceQuery)) && (pSQAnswer->m_TTLServiceDomain.restart()));
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: PTR update scheduled for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" %s\n"), (bResult ? "OK" : "FAILURE"));
+                                printedInfo = true;);
                         }
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove PTR answer for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                            printedInfo = true;);
+                        else
+                        {
+                            // Timed out! -> Delete
+                            if (pServiceQuery->m_fnCallback)
+                            {
+                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain), false);
+                            }
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove PTR answer for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR("\n"));
+                                printedInfo = true;);
 
-                        bResult = pServiceQuery->removeAnswer(pSQAnswer);
-                        pSQAnswer = 0;
-                        continue;  // Don't use this answer anymore
-                    }
-                }  // ServiceDomain flagged
+                            bResult = pServiceQuery->removeAnswer(pSQAnswer);
+                            pSQAnswer = 0;
+                            continue;  // Don't use this answer anymore
+                        }
+                    }  // ServiceDomain flagged
 
-                // 2. level answers
-                // HostDomain & Port (from SRV)
-                if ((bResult) &&
-                    (pSQAnswer->m_TTLHostDomainAndPort.flagged()))
-                {
-                    if (!pSQAnswer->m_TTLHostDomainAndPort.finalTimeoutLevel())
-                    {
-                        bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_SRV)) &&
-                                   (pSQAnswer->m_TTLHostDomainAndPort.restart()));
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: SRV update scheduled for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" host domain and port %s\n"), (bResult ? "OK" : "FAILURE"));
-                            printedInfo = true;);
-                    }
-                    else
+                    // 2. level answers
+                    // HostDomain & Port (from SRV)
+                    if ((bResult) && (pSQAnswer->m_TTLHostDomainAndPort.flagged()))
                     {
-                        // Timed out! -> Delete
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove SRV answer for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
-                            printedInfo = true;);
-                        // Delete
-                        pSQAnswer->m_HostDomain.clear();
-                        pSQAnswer->releaseHostDomain();
-                        pSQAnswer->m_u16Port = 0;
-                        pSQAnswer->m_TTLHostDomainAndPort.set(0);
-                        uint32_t u32ContentFlags = ServiceQueryAnswerType_HostDomainAndPort;
-                        // As the host domain is the base for the IP4- and IP6Address, remove these too
+                        if (!pSQAnswer->m_TTLHostDomainAndPort.finalTimeoutLevel())
+                        {
+                            bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_SRV)) && (pSQAnswer->m_TTLHostDomainAndPort.restart()));
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: SRV update scheduled for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" host domain and port %s\n"), (bResult ? "OK" : "FAILURE"));
+                                printedInfo = true;);
+                        }
+                        else
+                        {
+                            // Timed out! -> Delete
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove SRV answer for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
+                                printedInfo = true;);
+                            // Delete
+                            pSQAnswer->m_HostDomain.clear();
+                            pSQAnswer->releaseHostDomain();
+                            pSQAnswer->m_u16Port = 0;
+                            pSQAnswer->m_TTLHostDomainAndPort.set(0);
+                            uint32_t u32ContentFlags = ServiceQueryAnswerType_HostDomainAndPort;
+                            // As the host domain is the base for the IP4- and IP6Address, remove these too
 #ifdef MDNS_IP4_SUPPORT
-                        pSQAnswer->releaseIP4Addresses();
-                        u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
+                            pSQAnswer->releaseIP4Addresses();
+                            u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                        pSQAnswer->releaseIP6Addresses();
-                        u32ContentFlags |= ServiceQueryAnswerType_IP6Address;
+                            pSQAnswer->releaseIP6Addresses();
+                            u32ContentFlags |= ServiceQueryAnswerType_IP6Address;
 #endif
 
-                        // Remove content flags for deleted answer parts
-                        pSQAnswer->m_u32ContentFlags &= ~u32ContentFlags;
-                        if (pServiceQuery->m_fnCallback)
-                        {
-                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(u32ContentFlags), false);
-                        }
-                    }
-                }  // HostDomainAndPort flagged
-
-                // Txts (from TXT)
-                if ((bResult) &&
-                    (pSQAnswer->m_TTLTxts.flagged()))
-                {
-                    if (!pSQAnswer->m_TTLTxts.finalTimeoutLevel())
-                    {
-                        bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_TXT)) &&
-                                   (pSQAnswer->m_TTLTxts.restart()));
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: TXT update scheduled for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" TXTs %s\n"), (bResult ? "OK" : "FAILURE"));
-                            printedInfo = true;);
-                    }
-                    else
-                    {
-                        // Timed out! -> Delete
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove TXT answer for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
-                            printedInfo = true;);
-                        // Delete
-                        pSQAnswer->m_Txts.clear();
-                        pSQAnswer->m_TTLTxts.set(0);
-
-                        // Remove content flags for deleted answer parts
-                        pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_Txts;
-
-                        if (pServiceQuery->m_fnCallback)
-                        {
-                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), false);
+                            // Remove content flags for deleted answer parts
+                            pSQAnswer->m_u32ContentFlags &= ~u32ContentFlags;
+                            if (pServiceQuery->m_fnCallback)
+                            {
+                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(u32ContentFlags), false);
+                            }
                         }
-                    }
-                }  // TXTs flagged
-
-                // 3. level answers
-#ifdef MDNS_IP4_SUPPORT
-                // IP4Address (from A)
-                stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = pSQAnswer->m_pIP4Addresses;
-                bool bAUpdateQuerySent = false;
-                while ((pIP4Address) &&
-                       (bResult))
-                {
-                    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pNextIP4Address = pIP4Address->m_pNext;  // Get 'next' early, as 'current' may be deleted at the end...
+                    }  // HostDomainAndPort flagged
 
-                    if (pIP4Address->m_TTL.flagged())
+                    // Txts (from TXT)
+                    if ((bResult) && (pSQAnswer->m_TTLTxts.flagged()))
                     {
-                        if (!pIP4Address->m_TTL.finalTimeoutLevel())  // Needs update
+                        if (!pSQAnswer->m_TTLTxts.finalTimeoutLevel())
                         {
-                            if ((bAUpdateQuerySent) ||
-                                ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_A))))
-                            {
-                                pIP4Address->m_TTL.restart();
-                                bAUpdateQuerySent = true;
-
-                                DEBUG_EX_INFO(
-                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP4 update scheduled for "));
-                                    _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                    DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), (pIP4Address->m_IPAddress.toString().c_str()));
-                                    printedInfo = true;);
-                            }
+                            bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_TXT)) && (pSQAnswer->m_TTLTxts.restart()));
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: TXT update scheduled for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" TXTs %s\n"), (bResult ? "OK" : "FAILURE"));
+                                printedInfo = true;);
                         }
                         else
                         {
                             // Timed out! -> Delete
                             DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove IP4 answer for "));
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove TXT answer for "));
                                 _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" IP4 address\n"));
+                                DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
                                 printedInfo = true;);
-                            pSQAnswer->removeIP4Address(pIP4Address);
-                            if (!pSQAnswer->m_pIP4Addresses)  // NO IP4 address left -> remove content flag
-                            {
-                                pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP4Address;
-                            }
-                            // Notify client
+                            // Delete
+                            pSQAnswer->m_Txts.clear();
+                            pSQAnswer->m_TTLTxts.set(0);
+
+                            // Remove content flags for deleted answer parts
+                            pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_Txts;
+
                             if (pServiceQuery->m_fnCallback)
                             {
                                 MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), false);
+                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), false);
                             }
                         }
-                    }  // IP4 flagged
-
-                    pIP4Address = pNextIP4Address;  // Next
-                }                                   // while
-#endif
-#ifdef MDNS_IP6_SUPPORT
-                // IP6Address (from AAAA)
-                stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address = pSQAnswer->m_pIP6Addresses;
-                bool bAAAAUpdateQuerySent = false;
-                while ((pIP6Address) &&
-                       (bResult))
-                {
-                    stcMDNSServiceQuery::stcAnswer::stcIP6Address* pNextIP6Address = pIP6Address->m_pNext;  // Get 'next' early, as 'current' may be deleted at the end...
+                    }  // TXTs flagged
 
-                    if (pIP6Address->m_TTL.flagged())
+                    // 3. level answers
+#ifdef MDNS_IP4_SUPPORT
+                    // IP4Address (from A)
+                    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = pSQAnswer->m_pIP4Addresses;
+                    bool bAUpdateQuerySent = false;
+                    while ((pIP4Address) && (bResult))
                     {
-                        if (!pIP6Address->m_TTL.finalTimeoutLevel())  // Needs update
+                        stcMDNSServiceQuery::stcAnswer::stcIP4Address* pNextIP4Address = pIP4Address->m_pNext;  // Get 'next' early, as 'current' may be deleted at the end...
+
+                        if (pIP4Address->m_TTL.flagged())
                         {
-                            if ((bAAAAUpdateQuerySent) ||
-                                ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_AAAA))))
+                            if (!pIP4Address->m_TTL.finalTimeoutLevel())  // Needs update
                             {
-                                pIP6Address->m_TTL.restart();
-                                bAAAAUpdateQuerySent = true;
-
+                                if ((bAUpdateQuerySent) || ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_A))))
+                                {
+                                    pIP4Address->m_TTL.restart();
+                                    bAUpdateQuerySent = true;
+
+                                    DEBUG_EX_INFO(
+                                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP4 update scheduled for "));
+                                        _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                        DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), (pIP4Address->m_IPAddress.toString().c_str()));
+                                        printedInfo = true;);
+                                }
+                            }
+                            else
+                            {
+                                // Timed out! -> Delete
                                 DEBUG_EX_INFO(
-                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP6 update scheduled for "));
+                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove IP4 answer for "));
                                     _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                    DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), (pIP6Address->m_IPAddress.toString().c_str()));
+                                    DEBUG_OUTPUT.printf_P(PSTR(" IP4 address\n"));
                                     printedInfo = true;);
+                                pSQAnswer->removeIP4Address(pIP4Address);
+                                if (!pSQAnswer->m_pIP4Addresses)  // NO IP4 address left -> remove content flag
+                                {
+                                    pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP4Address;
+                                }
+                                // Notify client
+                                if (pServiceQuery->m_fnCallback)
+                                {
+                                    MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                                    pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), false);
+                                }
                             }
-                        }
-                        else
+                        }  // IP4 flagged
+
+                        pIP4Address = pNextIP4Address;  // Next
+                    }                                   // while
+#endif
+#ifdef MDNS_IP6_SUPPORT
+                    // IP6Address (from AAAA)
+                    stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address = pSQAnswer->m_pIP6Addresses;
+                    bool bAAAAUpdateQuerySent = false;
+                    while ((pIP6Address) && (bResult))
+                    {
+                        stcMDNSServiceQuery::stcAnswer::stcIP6Address* pNextIP6Address = pIP6Address->m_pNext;  // Get 'next' early, as 'current' may be deleted at the end...
+
+                        if (pIP6Address->m_TTL.flagged())
                         {
-                            // Timed out! -> Delete
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove answer for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" IP6Address\n"));
-                                printedInfo = true;);
-                            pSQAnswer->removeIP6Address(pIP6Address);
-                            if (!pSQAnswer->m_pIP6Addresses)  // NO IP6 address left -> remove content flag
+                            if (!pIP6Address->m_TTL.finalTimeoutLevel())  // Needs update
                             {
-                                pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP6Address;
+                                if ((bAAAAUpdateQuerySent) || ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_AAAA))))
+                                {
+                                    pIP6Address->m_TTL.restart();
+                                    bAAAAUpdateQuerySent = true;
+
+                                    DEBUG_EX_INFO(
+                                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP6 update scheduled for "));
+                                        _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                        DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), (pIP6Address->m_IPAddress.toString().c_str()));
+                                        printedInfo = true;);
+                                }
                             }
-                            // Notify client
-                            if (pServiceQuery->m_fnCallback)
+                            else
                             {
-                                pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, false, pServiceQuery->m_pUserdata);
+                                // Timed out! -> Delete
+                                DEBUG_EX_INFO(
+                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove answer for "));
+                                    _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                    DEBUG_OUTPUT.printf_P(PSTR(" IP6Address\n"));
+                                    printedInfo = true;);
+                                pSQAnswer->removeIP6Address(pIP6Address);
+                                if (!pSQAnswer->m_pIP6Addresses)  // NO IP6 address left -> remove content flag
+                                {
+                                    pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP6Address;
+                                }
+                                // Notify client
+                                if (pServiceQuery->m_fnCallback)
+                                {
+                                    pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, false, pServiceQuery->m_pUserdata);
+                                }
                             }
-                        }
-                    }  // IP6 flagged
+                        }  // IP6 flagged
 
-                    pIP6Address = pNextIP6Address;  // Next
-                }                                   // while
+                        pIP6Address = pNextIP6Address;  // Next
+                    }                                   // while
 #endif
-                pSQAnswer = pNextSQAnswer;
+                    pSQAnswer = pNextSQAnswer;
+                }
             }
         }
+        DEBUG_EX_INFO(
+            if (printedInfo)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("\n"));
+            });
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: FAILED!\n"));
+            });
+        return bResult;
     }
-    DEBUG_EX_INFO(
-        if (printedInfo)
-        {
-            DEBUG_OUTPUT.printf_P(PSTR("\n"));
-        });
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: FAILED!\n"));
-                 });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_replyMaskForHost
 
     Determines the relevant host answers for the given question.
@@ -1882,77 +1829,71 @@ bool MDNSResponder::_checkServiceQueryCache(void)
 
     In addition, a full name match (question domain == host domain) is marked.
 */
-uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
-                                         bool* p_pbFullNameMatch /*= 0*/) const
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost\n")););
+    uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
+        bool* p_pbFullNameMatch /*= 0*/) const
+    {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost\n")););
 
-    uint8_t u8ReplyMask = 0;
-    (p_pbFullNameMatch ? * p_pbFullNameMatch = false : 0);
+        uint8_t u8ReplyMask = 0;
+        (p_pbFullNameMatch ? * p_pbFullNameMatch = false : 0);
 
-    if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) ||
-        (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
-    {
-        if ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) ||
-            (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+        if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) || (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
         {
-            // PTR request
-#ifdef MDNS_IP4_SUPPORT
-            stcMDNS_RRDomain reverseIP4Domain;
-            for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+            if ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
             {
-                if (netif_is_up(pNetIf))
+                // PTR request
+#ifdef MDNS_IP4_SUPPORT
+                stcMDNS_RRDomain reverseIP4Domain;
+                for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
                 {
-                    if ((_buildDomainForReverseIP4(pNetIf->ip_addr, reverseIP4Domain)) &&
-                        (p_RRHeader.m_Domain == reverseIP4Domain))
+                    if (netif_is_up(pNetIf))
                     {
-                        // Reverse domain match
-                        u8ReplyMask |= ContentFlag_PTR_IP4;
+                        if ((_buildDomainForReverseIP4(pNetIf->ip_addr, reverseIP4Domain)) && (p_RRHeader.m_Domain == reverseIP4Domain))
+                        {
+                            // Reverse domain match
+                            u8ReplyMask |= ContentFlag_PTR_IP4;
+                        }
                     }
                 }
-            }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            // TODO
+                // TODO
 #endif
-        }  // Address qeuest
+            }  // Address qeuest
 
-        stcMDNS_RRDomain hostDomain;
-        if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-            (p_RRHeader.m_Domain == hostDomain))  // Host domain match
-        {
-            (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
+            stcMDNS_RRDomain hostDomain;
+            if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (p_RRHeader.m_Domain == hostDomain))  // Host domain match
+            {
+                (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
 
 #ifdef MDNS_IP4_SUPPORT
-            if ((DNS_RRTYPE_A == p_RRHeader.m_Attributes.m_u16Type) ||
-                (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
-            {
-                // IP4 address request
-                u8ReplyMask |= ContentFlag_A;
-            }
+                if ((DNS_RRTYPE_A == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                {
+                    // IP4 address request
+                    u8ReplyMask |= ContentFlag_A;
+                }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            if ((DNS_RRTYPE_AAAA == p_RRHeader.m_Attributes.m_u16Type) ||
-                (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
-            {
-                // IP6 address request
-                u8ReplyMask |= ContentFlag_AAAA;
-            }
+                if ((DNS_RRTYPE_AAAA == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                {
+                    // IP6 address request
+                    u8ReplyMask |= ContentFlag_AAAA;
+                }
 #endif
+            }
         }
+        else
+        {
+            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
+        }
+        DEBUG_EX_INFO(if (u8ReplyMask)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: 0x%X\n"), u8ReplyMask);
+            });
+        return u8ReplyMask;
     }
-    else
-    {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
-    }
-    DEBUG_EX_INFO(if (u8ReplyMask)
-                  {
-                      DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: 0x%X\n"), u8ReplyMask);
-                  });
-    return u8ReplyMask;
-}
 
-/*
+    /*
     MDNSResponder::_replyMaskForService
 
     Determines the relevant service answers for the given question
@@ -1964,65 +1905,58 @@ uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader&
 
     In addition, a full name match (question domain == service instance domain) is marked.
 */
-uint8_t MDNSResponder::_replyMaskForService(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
-                                            const MDNSResponder::stcMDNSService& p_Service,
-                                            bool* p_pbFullNameMatch /*= 0*/) const
-{
-    uint8_t u8ReplyMask = 0;
-    (p_pbFullNameMatch ? * p_pbFullNameMatch = false : 0);
-
-    if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) ||
-        (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
+    uint8_t MDNSResponder::_replyMaskForService(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
+        const MDNSResponder::stcMDNSService& p_Service,
+        bool* p_pbFullNameMatch /*= 0*/) const
     {
-        stcMDNS_RRDomain DNSSDDomain;
-        if ((_buildDomainForDNSSD(DNSSDDomain)) &&  // _services._dns-sd._udp.local
-            (p_RRHeader.m_Domain == DNSSDDomain) &&
-            ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) ||
-             (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
-        {
-            // Common service info requested
-            u8ReplyMask |= ContentFlag_PTR_TYPE;
-        }
-
-        stcMDNS_RRDomain serviceDomain;
-        if ((_buildDomainForService(p_Service, false, serviceDomain)) &&  // eg. _http._tcp.local
-            (p_RRHeader.m_Domain == serviceDomain) &&
-            ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) ||
-             (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
-        {
-            // Special service info requested
-            u8ReplyMask |= ContentFlag_PTR_NAME;
-        }
+        uint8_t u8ReplyMask = 0;
+        (p_pbFullNameMatch ? * p_pbFullNameMatch = false : 0);
 
-        if ((_buildDomainForService(p_Service, true, serviceDomain)) &&  // eg. MyESP._http._tcp.local
-            (p_RRHeader.m_Domain == serviceDomain))
+        if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) || (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
         {
-            (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
+            stcMDNS_RRDomain DNSSDDomain;
+            if ((_buildDomainForDNSSD(DNSSDDomain)) &&  // _services._dns-sd._udp.local
+                (p_RRHeader.m_Domain == DNSSDDomain) && ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
+            {
+                // Common service info requested
+                u8ReplyMask |= ContentFlag_PTR_TYPE;
+            }
 
-            if ((DNS_RRTYPE_SRV == p_RRHeader.m_Attributes.m_u16Type) ||
-                (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+            stcMDNS_RRDomain serviceDomain;
+            if ((_buildDomainForService(p_Service, false, serviceDomain)) &&  // eg. _http._tcp.local
+                (p_RRHeader.m_Domain == serviceDomain) && ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
             {
-                // Instance info SRV requested
-                u8ReplyMask |= ContentFlag_SRV;
+                // Special service info requested
+                u8ReplyMask |= ContentFlag_PTR_NAME;
             }
-            if ((DNS_RRTYPE_TXT == p_RRHeader.m_Attributes.m_u16Type) ||
-                (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+
+            if ((_buildDomainForService(p_Service, true, serviceDomain)) &&  // eg. MyESP._http._tcp.local
+                (p_RRHeader.m_Domain == serviceDomain))
             {
-                // Instance info TXT requested
-                u8ReplyMask |= ContentFlag_TXT;
+                (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
+
+                if ((DNS_RRTYPE_SRV == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                {
+                    // Instance info SRV requested
+                    u8ReplyMask |= ContentFlag_SRV;
+                }
+                if ((DNS_RRTYPE_TXT == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                {
+                    // Instance info TXT requested
+                    u8ReplyMask |= ContentFlag_TXT;
+                }
             }
         }
+        else
+        {
+            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
+        }
+        DEBUG_EX_INFO(if (u8ReplyMask)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService(%s.%s.%s): 0x%X\n"), p_Service.m_pcName, p_Service.m_pcService, p_Service.m_pcProtocol, u8ReplyMask);
+            });
+        return u8ReplyMask;
     }
-    else
-    {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
-    }
-    DEBUG_EX_INFO(if (u8ReplyMask)
-                  {
-                      DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService(%s.%s.%s): 0x%X\n"), p_Service.m_pcName, p_Service.m_pcService, p_Service.m_pcProtocol, u8ReplyMask);
-                  });
-    return u8ReplyMask;
-}
 
 }  // namespace MDNSImplementation
 
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
index 74255552e6..2803565d02 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
@@ -36,11 +36,11 @@ namespace esp8266
 */
 namespace MDNSImplementation
 {
-/**
+    /**
     HELPERS
 */
 
-/*
+    /*
     MDNSResponder::indexDomain (static)
 
     Updates the given domain 'p_rpcHostname' by appending a delimiter and an index number.
@@ -52,35 +52,57 @@ namespace MDNSImplementation
     if no default is given, 'esp8266' is used.
 
 */
-/*static*/ bool MDNSResponder::indexDomain(char*& p_rpcDomain,
-                                           const char* p_pcDivider /*= "-"*/,
-                                           const char* p_pcDefaultDomain /*= 0*/)
-{
-    bool bResult = false;
+    /*static*/ bool MDNSResponder::indexDomain(char*& p_rpcDomain,
+        const char* p_pcDivider /*= "-"*/,
+        const char* p_pcDefaultDomain /*= 0*/)
+    {
+        bool bResult = false;
 
-    // Ensure a divider exists; use '-' as default
-    const char* pcDivider = (p_pcDivider ?: "-");
+        // Ensure a divider exists; use '-' as default
+        const char* pcDivider = (p_pcDivider ?: "-");
 
-    if (p_rpcDomain)
-    {
-        const char* pFoundDivider = strrstr(p_rpcDomain, pcDivider);
-        if (pFoundDivider)  // maybe already extended
+        if (p_rpcDomain)
         {
-            char* pEnd = 0;
-            unsigned long ulIndex = strtoul((pFoundDivider + strlen(pcDivider)), &pEnd, 10);
-            if ((ulIndex) &&
-                ((pEnd - p_rpcDomain) == (ptrdiff_t)strlen(p_rpcDomain)) &&
-                (!*pEnd))  // Valid (old) index found
+            const char* pFoundDivider = strrstr(p_rpcDomain, pcDivider);
+            if (pFoundDivider)  // maybe already extended
             {
-                char acIndexBuffer[16];
-                sprintf(acIndexBuffer, "%lu", (++ulIndex));
-                size_t stLength = ((pFoundDivider - p_rpcDomain + strlen(pcDivider)) + strlen(acIndexBuffer) + 1);
+                char* pEnd = 0;
+                unsigned long ulIndex = strtoul((pFoundDivider + strlen(pcDivider)), &pEnd, 10);
+                if ((ulIndex) && ((pEnd - p_rpcDomain) == (ptrdiff_t)strlen(p_rpcDomain)) && (!*pEnd))  // Valid (old) index found
+                {
+                    char acIndexBuffer[16];
+                    sprintf(acIndexBuffer, "%lu", (++ulIndex));
+                    size_t stLength = ((pFoundDivider - p_rpcDomain + strlen(pcDivider)) + strlen(acIndexBuffer) + 1);
+                    char* pNewHostname = new char[stLength];
+                    if (pNewHostname)
+                    {
+                        memcpy(pNewHostname, p_rpcDomain, (pFoundDivider - p_rpcDomain + strlen(pcDivider)));
+                        pNewHostname[pFoundDivider - p_rpcDomain + strlen(pcDivider)] = 0;
+                        strcat(pNewHostname, acIndexBuffer);
+
+                        delete[] p_rpcDomain;
+                        p_rpcDomain = pNewHostname;
+
+                        bResult = true;
+                    }
+                    else
+                    {
+                        DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
+                    }
+                }
+                else
+                {
+                    pFoundDivider = 0;  // Flag the need to (base) extend the hostname
+                }
+            }
+
+            if (!pFoundDivider)  // not yet extended (or failed to increment extension) -> start indexing
+            {
+                size_t stLength = strlen(p_rpcDomain) + (strlen(pcDivider) + 1 + 1);  // Name + Divider + '2' + '\0'
                 char* pNewHostname = new char[stLength];
                 if (pNewHostname)
                 {
-                    memcpy(pNewHostname, p_rpcDomain, (pFoundDivider - p_rpcDomain + strlen(pcDivider)));
-                    pNewHostname[pFoundDivider - p_rpcDomain + strlen(pcDivider)] = 0;
-                    strcat(pNewHostname, acIndexBuffer);
+                    sprintf(pNewHostname, "%s%s2", p_rpcDomain, pcDivider);
 
                     delete[] p_rpcDomain;
                     p_rpcDomain = pNewHostname;
@@ -92,23 +114,17 @@ namespace MDNSImplementation
                     DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
                 }
             }
-            else
-            {
-                pFoundDivider = 0;  // Flag the need to (base) extend the hostname
-            }
         }
-
-        if (!pFoundDivider)  // not yet extended (or failed to increment extension) -> start indexing
+        else
         {
-            size_t stLength = strlen(p_rpcDomain) + (strlen(pcDivider) + 1 + 1);  // Name + Divider + '2' + '\0'
-            char* pNewHostname = new char[stLength];
-            if (pNewHostname)
-            {
-                sprintf(pNewHostname, "%s%s2", p_rpcDomain, pcDivider);
-
-                delete[] p_rpcDomain;
-                p_rpcDomain = pNewHostname;
+            // No given host domain, use base or default
+            const char* cpcDefaultName = (p_pcDefaultDomain ?: "esp8266");
 
+            size_t stLength = strlen(cpcDefaultName) + 1;  // '\0'
+            p_rpcDomain = new char[stLength];
+            if (p_rpcDomain)
+            {
+                strncpy(p_rpcDomain, cpcDefaultName, stLength);
                 bResult = true;
             }
             else
@@ -116,40 +132,22 @@ namespace MDNSImplementation
                 DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
             }
         }
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] indexDomain: %s\n"), p_rpcDomain););
+        return bResult;
     }
-    else
-    {
-        // No given host domain, use base or default
-        const char* cpcDefaultName = (p_pcDefaultDomain ?: "esp8266");
 
-        size_t stLength = strlen(cpcDefaultName) + 1;  // '\0'
-        p_rpcDomain = new char[stLength];
-        if (p_rpcDomain)
-        {
-            strncpy(p_rpcDomain, cpcDefaultName, stLength);
-            bResult = true;
-        }
-        else
-        {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
-        }
-    }
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] indexDomain: %s\n"), p_rpcDomain););
-    return bResult;
-}
-
-/*
+    /*
     UDP CONTEXT
 */
 
-bool MDNSResponder::_callProcess(void)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf("[MDNSResponder] _callProcess (%lu, triggered by: %s)\n", millis(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
+    bool MDNSResponder::_callProcess(void)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf("[MDNSResponder] _callProcess (%lu, triggered by: %s)\n", millis(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
 
-    return _process(false);
-}
+        return _process(false);
+    }
 
-/*
+    /*
     MDNSResponder::_allocUDPContext
 
     (Re-)Creates the one-and-only UDP context for the MDNS responder.
@@ -159,566 +157,539 @@ bool MDNSResponder::_callProcess(void)
     is called from the WiFi stack side of the ESP stack system.
 
 */
-bool MDNSResponder::_allocUDPContext(void)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.println("[MDNSResponder] _allocUDPContext"););
+    bool MDNSResponder::_allocUDPContext(void)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.println("[MDNSResponder] _allocUDPContext"););
 
-    _releaseUDPContext();
-    _joinMulticastGroups();
+        _releaseUDPContext();
+        _joinMulticastGroups();
 
-    m_pUDPContext = new UdpContext;
-    m_pUDPContext->ref();
+        m_pUDPContext = new UdpContext;
+        m_pUDPContext->ref();
 
-    if (m_pUDPContext->listen(IP4_ADDR_ANY, DNS_MQUERY_PORT))
-    {
-        m_pUDPContext->setMulticastTTL(MDNS_MULTICAST_TTL);
-        m_pUDPContext->onRx(std::bind(&MDNSResponder::_callProcess, this));
-    }
-    else
-    {
-        return false;
-    }
+        if (m_pUDPContext->listen(IP4_ADDR_ANY, DNS_MQUERY_PORT))
+        {
+            m_pUDPContext->setMulticastTTL(MDNS_MULTICAST_TTL);
+            m_pUDPContext->onRx(std::bind(&MDNSResponder::_callProcess, this));
+        }
+        else
+        {
+            return false;
+        }
 
-    return true;
-}
+        return true;
+    }
 
-/*
+    /*
     MDNSResponder::_releaseUDPContext
 */
-bool MDNSResponder::_releaseUDPContext(void)
-{
-    if (m_pUDPContext)
+    bool MDNSResponder::_releaseUDPContext(void)
     {
-        m_pUDPContext->unref();
-        m_pUDPContext = 0;
-        _leaveMulticastGroups();
+        if (m_pUDPContext)
+        {
+            m_pUDPContext->unref();
+            m_pUDPContext = 0;
+            _leaveMulticastGroups();
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     SERVICE QUERY
 */
 
-/*
+    /*
     MDNSResponder::_allocServiceQuery
 */
-MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_allocServiceQuery(void)
-{
-    stcMDNSServiceQuery* pServiceQuery = new stcMDNSServiceQuery;
-    if (pServiceQuery)
+    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_allocServiceQuery(void)
     {
-        // Link to query list
-        pServiceQuery->m_pNext = m_pServiceQueries;
-        m_pServiceQueries = pServiceQuery;
+        stcMDNSServiceQuery* pServiceQuery = new stcMDNSServiceQuery;
+        if (pServiceQuery)
+        {
+            // Link to query list
+            pServiceQuery->m_pNext = m_pServiceQueries;
+            m_pServiceQueries = pServiceQuery;
+        }
+        return m_pServiceQueries;
     }
-    return m_pServiceQueries;
-}
 
-/*
+    /*
     MDNSResponder::_removeServiceQuery
 */
-bool MDNSResponder::_removeServiceQuery(MDNSResponder::stcMDNSServiceQuery* p_pServiceQuery)
-{
-    bool bResult = false;
-
-    if (p_pServiceQuery)
+    bool MDNSResponder::_removeServiceQuery(MDNSResponder::stcMDNSServiceQuery* p_pServiceQuery)
     {
-        stcMDNSServiceQuery* pPred = m_pServiceQueries;
-        while ((pPred) &&
-               (pPred->m_pNext != p_pServiceQuery))
-        {
-            pPred = pPred->m_pNext;
-        }
-        if (pPred)
-        {
-            pPred->m_pNext = p_pServiceQuery->m_pNext;
-            delete p_pServiceQuery;
-            bResult = true;
-        }
-        else  // No predecessor
+        bool bResult = false;
+
+        if (p_pServiceQuery)
         {
-            if (m_pServiceQueries == p_pServiceQuery)
+            stcMDNSServiceQuery* pPred = m_pServiceQueries;
+            while ((pPred) && (pPred->m_pNext != p_pServiceQuery))
             {
-                m_pServiceQueries = p_pServiceQuery->m_pNext;
+                pPred = pPred->m_pNext;
+            }
+            if (pPred)
+            {
+                pPred->m_pNext = p_pServiceQuery->m_pNext;
                 delete p_pServiceQuery;
                 bResult = true;
             }
-            else
+            else  // No predecessor
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.println("[MDNSResponder] _releaseServiceQuery: INVALID service query!"););
+                if (m_pServiceQueries == p_pServiceQuery)
+                {
+                    m_pServiceQueries = p_pServiceQuery->m_pNext;
+                    delete p_pServiceQuery;
+                    bResult = true;
+                }
+                else
+                {
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.println("[MDNSResponder] _releaseServiceQuery: INVALID service query!"););
+                }
             }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_removeLegacyServiceQuery
 */
-bool MDNSResponder::_removeLegacyServiceQuery(void)
-{
-    stcMDNSServiceQuery* pLegacyServiceQuery = _findLegacyServiceQuery();
-    return (pLegacyServiceQuery ? _removeServiceQuery(pLegacyServiceQuery) : true);
-}
+    bool MDNSResponder::_removeLegacyServiceQuery(void)
+    {
+        stcMDNSServiceQuery* pLegacyServiceQuery = _findLegacyServiceQuery();
+        return (pLegacyServiceQuery ? _removeServiceQuery(pLegacyServiceQuery) : true);
+    }
 
-/*
+    /*
     MDNSResponder::_findServiceQuery
 
     'Convert' hMDNSServiceQuery to stcMDNSServiceQuery* (ensure existence)
 
 */
-MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
-{
-    stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
-    while (pServiceQuery)
+    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
     {
-        if ((hMDNSServiceQuery)pServiceQuery == p_hServiceQuery)
+        stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
+        while (pServiceQuery)
         {
-            break;
+            if ((hMDNSServiceQuery)pServiceQuery == p_hServiceQuery)
+            {
+                break;
+            }
+            pServiceQuery = pServiceQuery->m_pNext;
         }
-        pServiceQuery = pServiceQuery->m_pNext;
+        return pServiceQuery;
     }
-    return pServiceQuery;
-}
 
-/*
+    /*
     MDNSResponder::_findLegacyServiceQuery
 */
-MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findLegacyServiceQuery(void)
-{
-    stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
-    while (pServiceQuery)
+    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findLegacyServiceQuery(void)
     {
-        if (pServiceQuery->m_bLegacyQuery)
+        stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
+        while (pServiceQuery)
         {
-            break;
+            if (pServiceQuery->m_bLegacyQuery)
+            {
+                break;
+            }
+            pServiceQuery = pServiceQuery->m_pNext;
         }
-        pServiceQuery = pServiceQuery->m_pNext;
+        return pServiceQuery;
     }
-    return pServiceQuery;
-}
 
-/*
+    /*
     MDNSResponder::_releaseServiceQueries
 */
-bool MDNSResponder::_releaseServiceQueries(void)
-{
-    while (m_pServiceQueries)
+    bool MDNSResponder::_releaseServiceQueries(void)
     {
-        stcMDNSServiceQuery* pNext = m_pServiceQueries->m_pNext;
-        delete m_pServiceQueries;
-        m_pServiceQueries = pNext;
+        while (m_pServiceQueries)
+        {
+            stcMDNSServiceQuery* pNext = m_pServiceQueries->m_pNext;
+            delete m_pServiceQueries;
+            m_pServiceQueries = pNext;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::_findNextServiceQueryByServiceType
 */
-MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findNextServiceQueryByServiceType(const stcMDNS_RRDomain& p_ServiceTypeDomain,
-                                                                                      const stcMDNSServiceQuery* p_pPrevServiceQuery)
-{
-    stcMDNSServiceQuery* pMatchingServiceQuery = 0;
-
-    stcMDNSServiceQuery* pServiceQuery = (p_pPrevServiceQuery ? p_pPrevServiceQuery->m_pNext : m_pServiceQueries);
-    while (pServiceQuery)
+    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findNextServiceQueryByServiceType(const stcMDNS_RRDomain& p_ServiceTypeDomain,
+        const stcMDNSServiceQuery* p_pPrevServiceQuery)
     {
-        if (p_ServiceTypeDomain == pServiceQuery->m_ServiceTypeDomain)
+        stcMDNSServiceQuery* pMatchingServiceQuery = 0;
+
+        stcMDNSServiceQuery* pServiceQuery = (p_pPrevServiceQuery ? p_pPrevServiceQuery->m_pNext : m_pServiceQueries);
+        while (pServiceQuery)
         {
-            pMatchingServiceQuery = pServiceQuery;
-            break;
+            if (p_ServiceTypeDomain == pServiceQuery->m_ServiceTypeDomain)
+            {
+                pMatchingServiceQuery = pServiceQuery;
+                break;
+            }
+            pServiceQuery = pServiceQuery->m_pNext;
         }
-        pServiceQuery = pServiceQuery->m_pNext;
+        return pMatchingServiceQuery;
     }
-    return pMatchingServiceQuery;
-}
 
-/*
+    /*
     HOSTNAME
 */
 
-/*
+    /*
     MDNSResponder::_setHostname
 */
-bool MDNSResponder::_setHostname(const char* p_pcHostname)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _allocHostname (%s)\n"), p_pcHostname););
+    bool MDNSResponder::_setHostname(const char* p_pcHostname)
+    {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _allocHostname (%s)\n"), p_pcHostname););
 
-    bool bResult = false;
+        bool bResult = false;
 
-    _releaseHostname();
+        _releaseHostname();
 
-    size_t stLength = 0;
-    if ((p_pcHostname) &&
-        (MDNS_DOMAIN_LABEL_MAXLENGTH >= (stLength = strlen(p_pcHostname))))  // char max size for a single label
-    {
-        // Copy in hostname characters as lowercase
-        if ((bResult = (0 != (m_pcHostname = new char[stLength + 1]))))
+        size_t stLength = 0;
+        if ((p_pcHostname) && (MDNS_DOMAIN_LABEL_MAXLENGTH >= (stLength = strlen(p_pcHostname))))  // char max size for a single label
         {
-#ifdef MDNS_FORCE_LOWERCASE_HOSTNAME
-            size_t i = 0;
-            for (; i < stLength; ++i)
+            // Copy in hostname characters as lowercase
+            if ((bResult = (0 != (m_pcHostname = new char[stLength + 1]))))
             {
-                m_pcHostname[i] = (isupper(p_pcHostname[i]) ? tolower(p_pcHostname[i]) : p_pcHostname[i]);
-            }
-            m_pcHostname[i] = 0;
+#ifdef MDNS_FORCE_LOWERCASE_HOSTNAME
+                size_t i = 0;
+                for (; i < stLength; ++i)
+                {
+                    m_pcHostname[i] = (isupper(p_pcHostname[i]) ? tolower(p_pcHostname[i]) : p_pcHostname[i]);
+                }
+                m_pcHostname[i] = 0;
 #else
-            strncpy(m_pcHostname, p_pcHostname, (stLength + 1));
+                strncpy(m_pcHostname, p_pcHostname, (stLength + 1));
 #endif
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_releaseHostname
 */
-bool MDNSResponder::_releaseHostname(void)
-{
-    if (m_pcHostname)
+    bool MDNSResponder::_releaseHostname(void)
     {
-        delete[] m_pcHostname;
-        m_pcHostname = 0;
+        if (m_pcHostname)
+        {
+            delete[] m_pcHostname;
+            m_pcHostname = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     SERVICE
 */
 
-/*
+    /*
     MDNSResponder::_allocService
 */
-MDNSResponder::stcMDNSService* MDNSResponder::_allocService(const char* p_pcName,
-                                                            const char* p_pcService,
-                                                            const char* p_pcProtocol,
-                                                            uint16_t p_u16Port)
-{
-    stcMDNSService* pService = 0;
-    if (((!p_pcName) ||
-         (MDNS_DOMAIN_LABEL_MAXLENGTH >= strlen(p_pcName))) &&
-        (p_pcService) &&
-        (MDNS_SERVICE_NAME_LENGTH >= strlen(p_pcService)) &&
-        (p_pcProtocol) &&
-        (MDNS_SERVICE_PROTOCOL_LENGTH >= strlen(p_pcProtocol)) &&
-        (p_u16Port) &&
-        (0 != (pService = new stcMDNSService)) &&
-        (pService->setName(p_pcName ?: m_pcHostname)) &&
-        (pService->setService(p_pcService)) &&
-        (pService->setProtocol(p_pcProtocol)))
+    MDNSResponder::stcMDNSService* MDNSResponder::_allocService(const char* p_pcName,
+        const char* p_pcService,
+        const char* p_pcProtocol,
+        uint16_t p_u16Port)
     {
-        pService->m_bAutoName = (0 == p_pcName);
-        pService->m_u16Port = p_u16Port;
+        stcMDNSService* pService = 0;
+        if (((!p_pcName) || (MDNS_DOMAIN_LABEL_MAXLENGTH >= strlen(p_pcName))) && (p_pcService) && (MDNS_SERVICE_NAME_LENGTH >= strlen(p_pcService)) && (p_pcProtocol) && (MDNS_SERVICE_PROTOCOL_LENGTH >= strlen(p_pcProtocol)) && (p_u16Port) && (0 != (pService = new stcMDNSService)) && (pService->setName(p_pcName ?: m_pcHostname)) && (pService->setService(p_pcService)) && (pService->setProtocol(p_pcProtocol)))
+        {
+            pService->m_bAutoName = (0 == p_pcName);
+            pService->m_u16Port = p_u16Port;
 
-        // Add to list (or start list)
-        pService->m_pNext = m_pServices;
-        m_pServices = pService;
+            // Add to list (or start list)
+            pService->m_pNext = m_pServices;
+            m_pServices = pService;
+        }
+        return pService;
     }
-    return pService;
-}
 
-/*
+    /*
     MDNSResponder::_releaseService
 */
-bool MDNSResponder::_releaseService(MDNSResponder::stcMDNSService* p_pService)
-{
-    bool bResult = false;
-
-    if (p_pService)
+    bool MDNSResponder::_releaseService(MDNSResponder::stcMDNSService* p_pService)
     {
-        stcMDNSService* pPred = m_pServices;
-        while ((pPred) &&
-               (pPred->m_pNext != p_pService))
-        {
-            pPred = pPred->m_pNext;
-        }
-        if (pPred)
-        {
-            pPred->m_pNext = p_pService->m_pNext;
-            delete p_pService;
-            bResult = true;
-        }
-        else  // No predecessor
+        bool bResult = false;
+
+        if (p_pService)
         {
-            if (m_pServices == p_pService)
+            stcMDNSService* pPred = m_pServices;
+            while ((pPred) && (pPred->m_pNext != p_pService))
+            {
+                pPred = pPred->m_pNext;
+            }
+            if (pPred)
             {
-                m_pServices = p_pService->m_pNext;
+                pPred->m_pNext = p_pService->m_pNext;
                 delete p_pService;
                 bResult = true;
             }
-            else
+            else  // No predecessor
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.println("[MDNSResponder] _releaseService: INVALID service!"););
+                if (m_pServices == p_pService)
+                {
+                    m_pServices = p_pService->m_pNext;
+                    delete p_pService;
+                    bResult = true;
+                }
+                else
+                {
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.println("[MDNSResponder] _releaseService: INVALID service!"););
+                }
             }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_releaseServices
 */
-bool MDNSResponder::_releaseServices(void)
-{
-    stcMDNSService* pService = m_pServices;
-    while (pService)
+    bool MDNSResponder::_releaseServices(void)
     {
-        _releaseService(pService);
-        pService = m_pServices;
+        stcMDNSService* pService = m_pServices;
+        while (pService)
+        {
+            _releaseService(pService);
+            pService = m_pServices;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::_findService
 */
-MDNSResponder::stcMDNSService* MDNSResponder::_findService(const char* p_pcName,
-                                                           const char* p_pcService,
-                                                           const char* p_pcProtocol)
-{
-    stcMDNSService* pService = m_pServices;
-    while (pService)
+    MDNSResponder::stcMDNSService* MDNSResponder::_findService(const char* p_pcName,
+        const char* p_pcService,
+        const char* p_pcProtocol)
     {
-        if ((0 == strcmp(pService->m_pcName, p_pcName)) &&
-            (0 == strcmp(pService->m_pcService, p_pcService)) &&
-            (0 == strcmp(pService->m_pcProtocol, p_pcProtocol)))
+        stcMDNSService* pService = m_pServices;
+        while (pService)
         {
-            break;
+            if ((0 == strcmp(pService->m_pcName, p_pcName)) && (0 == strcmp(pService->m_pcService, p_pcService)) && (0 == strcmp(pService->m_pcProtocol, p_pcProtocol)))
+            {
+                break;
+            }
+            pService = pService->m_pNext;
         }
-        pService = pService->m_pNext;
+        return pService;
     }
-    return pService;
-}
 
-/*
+    /*
     MDNSResponder::_findService
 */
-MDNSResponder::stcMDNSService* MDNSResponder::_findService(const MDNSResponder::hMDNSService p_hService)
-{
-    stcMDNSService* pService = m_pServices;
-    while (pService)
+    MDNSResponder::stcMDNSService* MDNSResponder::_findService(const MDNSResponder::hMDNSService p_hService)
     {
-        if (p_hService == (hMDNSService)pService)
+        stcMDNSService* pService = m_pServices;
+        while (pService)
         {
-            break;
+            if (p_hService == (hMDNSService)pService)
+            {
+                break;
+            }
+            pService = pService->m_pNext;
         }
-        pService = pService->m_pNext;
+        return pService;
     }
-    return pService;
-}
 
-/*
+    /*
     SERVICE TXT
 */
 
-/*
+    /*
     MDNSResponder::_allocServiceTxt
 */
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_allocServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                                                  const char* p_pcKey,
-                                                                  const char* p_pcValue,
-                                                                  bool p_bTemp)
-{
-    stcMDNSServiceTxt* pTxt = 0;
-
-    if ((p_pService) &&
-        (p_pcKey) &&
-        (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() +
-                                       1 +  // Length byte
-                                       (p_pcKey ? strlen(p_pcKey) : 0) +
-                                       1 +  // '='
-                                       (p_pcValue ? strlen(p_pcValue) : 0))))
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_allocServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+        const char* p_pcKey,
+        const char* p_pcValue,
+        bool p_bTemp)
     {
-        pTxt = new stcMDNSServiceTxt;
-        if (pTxt)
+        stcMDNSServiceTxt* pTxt = 0;
+
+        if ((p_pService) && (p_pcKey) && (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() + 1 +  // Length byte
+                                              (p_pcKey ? strlen(p_pcKey) : 0) + 1 +                        // '='
+                                              (p_pcValue ? strlen(p_pcValue) : 0))))
         {
-            size_t stLength = (p_pcKey ? strlen(p_pcKey) : 0);
-            pTxt->m_pcKey = new char[stLength + 1];
-            if (pTxt->m_pcKey)
+            pTxt = new stcMDNSServiceTxt;
+            if (pTxt)
             {
-                strncpy(pTxt->m_pcKey, p_pcKey, stLength);
-                pTxt->m_pcKey[stLength] = 0;
-            }
+                size_t stLength = (p_pcKey ? strlen(p_pcKey) : 0);
+                pTxt->m_pcKey = new char[stLength + 1];
+                if (pTxt->m_pcKey)
+                {
+                    strncpy(pTxt->m_pcKey, p_pcKey, stLength);
+                    pTxt->m_pcKey[stLength] = 0;
+                }
 
-            if (p_pcValue)
-            {
-                stLength = (p_pcValue ? strlen(p_pcValue) : 0);
-                pTxt->m_pcValue = new char[stLength + 1];
-                if (pTxt->m_pcValue)
+                if (p_pcValue)
                 {
-                    strncpy(pTxt->m_pcValue, p_pcValue, stLength);
-                    pTxt->m_pcValue[stLength] = 0;
+                    stLength = (p_pcValue ? strlen(p_pcValue) : 0);
+                    pTxt->m_pcValue = new char[stLength + 1];
+                    if (pTxt->m_pcValue)
+                    {
+                        strncpy(pTxt->m_pcValue, p_pcValue, stLength);
+                        pTxt->m_pcValue[stLength] = 0;
+                    }
                 }
-            }
-            pTxt->m_bTemp = p_bTemp;
+                pTxt->m_bTemp = p_bTemp;
 
-            // Add to list (or start list)
-            p_pService->m_Txts.add(pTxt);
+                // Add to list (or start list)
+                p_pService->m_Txts.add(pTxt);
+            }
         }
+        return pTxt;
     }
-    return pTxt;
-}
 
-/*
+    /*
     MDNSResponder::_releaseServiceTxt
 */
-bool MDNSResponder::_releaseServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                       MDNSResponder::stcMDNSServiceTxt* p_pTxt)
-{
-    return ((p_pService) &&
-            (p_pTxt) &&
-            (p_pService->m_Txts.remove(p_pTxt)));
-}
+    bool MDNSResponder::_releaseServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+        MDNSResponder::stcMDNSServiceTxt* p_pTxt)
+    {
+        return ((p_pService) && (p_pTxt) && (p_pService->m_Txts.remove(p_pTxt)));
+    }
 
-/*
+    /*
     MDNSResponder::_updateServiceTxt
 */
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_updateServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                                                   MDNSResponder::stcMDNSServiceTxt* p_pTxt,
-                                                                   const char* p_pcValue,
-                                                                   bool p_bTemp)
-{
-    if ((p_pService) &&
-        (p_pTxt) &&
-        (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() -
-                                       (p_pTxt->m_pcValue ? strlen(p_pTxt->m_pcValue) : 0) +
-                                       (p_pcValue ? strlen(p_pcValue) : 0))))
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_updateServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+        MDNSResponder::stcMDNSServiceTxt* p_pTxt,
+        const char* p_pcValue,
+        bool p_bTemp)
     {
-        p_pTxt->update(p_pcValue);
-        p_pTxt->m_bTemp = p_bTemp;
+        if ((p_pService) && (p_pTxt) && (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() - (p_pTxt->m_pcValue ? strlen(p_pTxt->m_pcValue) : 0) + (p_pcValue ? strlen(p_pcValue) : 0))))
+        {
+            p_pTxt->update(p_pcValue);
+            p_pTxt->m_bTemp = p_bTemp;
+        }
+        return p_pTxt;
     }
-    return p_pTxt;
-}
 
-/*
+    /*
     MDNSResponder::_findServiceTxt
 */
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                                                 const char* p_pcKey)
-{
-    return (p_pService ? p_pService->m_Txts.find(p_pcKey) : 0);
-}
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+        const char* p_pcKey)
+    {
+        return (p_pService ? p_pService->m_Txts.find(p_pcKey) : 0);
+    }
 
-/*
+    /*
     MDNSResponder::_findServiceTxt
 */
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                                                 const hMDNSTxt p_hTxt)
-{
-    return (((p_pService) && (p_hTxt)) ? p_pService->m_Txts.find((stcMDNSServiceTxt*)p_hTxt) : 0);
-}
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+        const hMDNSTxt p_hTxt)
+    {
+        return (((p_pService) && (p_hTxt)) ? p_pService->m_Txts.find((stcMDNSServiceTxt*)p_hTxt) : 0);
+    }
 
-/*
+    /*
     MDNSResponder::_addServiceTxt
 */
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_addServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                                                const char* p_pcKey,
-                                                                const char* p_pcValue,
-                                                                bool p_bTemp)
-{
-    stcMDNSServiceTxt* pResult = 0;
-
-    if ((p_pService) &&
-        (p_pcKey) &&
-        (strlen(p_pcKey)))
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_addServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+        const char* p_pcKey,
+        const char* p_pcValue,
+        bool p_bTemp)
     {
-        stcMDNSServiceTxt* pTxt = p_pService->m_Txts.find(p_pcKey);
-        if (pTxt)
-        {
-            pResult = _updateServiceTxt(p_pService, pTxt, p_pcValue, p_bTemp);
-        }
-        else
+        stcMDNSServiceTxt* pResult = 0;
+
+        if ((p_pService) && (p_pcKey) && (strlen(p_pcKey)))
         {
-            pResult = _allocServiceTxt(p_pService, p_pcKey, p_pcValue, p_bTemp);
+            stcMDNSServiceTxt* pTxt = p_pService->m_Txts.find(p_pcKey);
+            if (pTxt)
+            {
+                pResult = _updateServiceTxt(p_pService, pTxt, p_pcValue, p_bTemp);
+            }
+            else
+            {
+                pResult = _allocServiceTxt(p_pService, p_pcKey, p_pcValue, p_bTemp);
+            }
         }
+        return pResult;
     }
-    return pResult;
-}
 
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
-                                                                 const uint32_t p_u32AnswerIndex)
-{
-    stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    // Fill m_pcTxts (if not already done)
-    return (pSQAnswer) ? pSQAnswer->m_Txts.m_pTxts : 0;
-}
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        // Fill m_pcTxts (if not already done)
+        return (pSQAnswer) ? pSQAnswer->m_Txts.m_pTxts : 0;
+    }
 
-/*
+    /*
     MDNSResponder::_collectServiceTxts
 */
-bool MDNSResponder::_collectServiceTxts(MDNSResponder::stcMDNSService& p_rService)
-{
-    // Call Dynamic service callbacks
-    if (m_fnServiceTxtCallback)
-    {
-        m_fnServiceTxtCallback((hMDNSService)&p_rService);
-    }
-    if (p_rService.m_fnTxtCallback)
+    bool MDNSResponder::_collectServiceTxts(MDNSResponder::stcMDNSService& p_rService)
     {
-        p_rService.m_fnTxtCallback((hMDNSService)&p_rService);
+        // Call Dynamic service callbacks
+        if (m_fnServiceTxtCallback)
+        {
+            m_fnServiceTxtCallback((hMDNSService)&p_rService);
+        }
+        if (p_rService.m_fnTxtCallback)
+        {
+            p_rService.m_fnTxtCallback((hMDNSService)&p_rService);
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::_releaseTempServiceTxts
 */
-bool MDNSResponder::_releaseTempServiceTxts(MDNSResponder::stcMDNSService& p_rService)
-{
-    return (p_rService.m_Txts.removeTempTxts());
-}
+    bool MDNSResponder::_releaseTempServiceTxts(MDNSResponder::stcMDNSService& p_rService)
+    {
+        return (p_rService.m_Txts.removeTempTxts());
+    }
 
-/*
+    /*
     MISC
 */
 
 #ifdef DEBUG_ESP_MDNS_RESPONDER
-/*
+    /*
     MDNSResponder::_printRRDomain
 */
-bool MDNSResponder::_printRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_RRDomain) const
-{
-    //DEBUG_OUTPUT.printf_P(PSTR("Domain: "));
-
-    const char* pCursor = p_RRDomain.m_acName;
-    uint8_t u8Length = *pCursor++;
-    if (u8Length)
+    bool MDNSResponder::_printRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_RRDomain) const
     {
-        while (u8Length)
+        //DEBUG_OUTPUT.printf_P(PSTR("Domain: "));
+
+        const char* pCursor = p_RRDomain.m_acName;
+        uint8_t u8Length = *pCursor++;
+        if (u8Length)
         {
-            for (uint8_t u = 0; u < u8Length; ++u)
+            while (u8Length)
             {
-                DEBUG_OUTPUT.printf_P(PSTR("%c"), *(pCursor++));
-            }
-            u8Length = *pCursor++;
-            if (u8Length)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("."));
+                for (uint8_t u = 0; u < u8Length; ++u)
+                {
+                    DEBUG_OUTPUT.printf_P(PSTR("%c"), *(pCursor++));
+                }
+                u8Length = *pCursor++;
+                if (u8Length)
+                {
+                    DEBUG_OUTPUT.printf_P(PSTR("."));
+                }
             }
         }
-    }
-    else  // empty domain
-    {
-        DEBUG_OUTPUT.printf_P(PSTR("-empty-"));
-    }
-    //DEBUG_OUTPUT.printf_P(PSTR("\n"));
+        else  // empty domain
+        {
+            DEBUG_OUTPUT.printf_P(PSTR("-empty-"));
+        }
+        //DEBUG_OUTPUT.printf_P(PSTR("\n"));
 
-    return true;
-}
+        return true;
+    }
 
-/*
+    /*
     MDNSResponder::_printRRAnswer
 */
-bool MDNSResponder::_printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAnswer) const
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] RRAnswer: "));
-    _printRRDomain(p_RRAnswer.m_Header.m_Domain);
-    DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, "), p_RRAnswer.m_Header.m_Attributes.m_u16Type, p_RRAnswer.m_Header.m_Attributes.m_u16Class, p_RRAnswer.m_u32TTL);
-    switch (p_RRAnswer.m_Header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
+    bool MDNSResponder::_printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAnswer) const
     {
+        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] RRAnswer: "));
+        _printRRDomain(p_RRAnswer.m_Header.m_Domain);
+        DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, "), p_RRAnswer.m_Header.m_Attributes.m_u16Type, p_RRAnswer.m_Header.m_Attributes.m_u16Class, p_RRAnswer.m_u32TTL);
+        switch (p_RRAnswer.m_Header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
+        {
 #ifdef MDNS_IP4_SUPPORT
         case DNS_RRTYPE_A:
             DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((const stcMDNS_RRAnswerA*)&p_RRAnswer)->m_IPAddress.toString().c_str());
@@ -752,11 +723,11 @@ bool MDNSResponder::_printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAn
         default:
             DEBUG_OUTPUT.printf_P(PSTR("generic "));
             break;
-    }
-    DEBUG_OUTPUT.printf_P(PSTR("\n"));
+        }
+        DEBUG_OUTPUT.printf_P(PSTR("\n"));
 
-    return true;
-}
+        return true;
+    }
 #endif
 
 }  // namespace MDNSImplementation
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h b/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
index 70e81de5e6..f57e48f0c5 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
@@ -35,7 +35,7 @@ namespace MDNSImplementation
 {
 // Enable class debug functions
 #define ESP_8266_MDNS_INCLUDE
-//#define DEBUG_ESP_MDNS_RESPONDER
+    //#define DEBUG_ESP_MDNS_RESPONDER
 
 #if !defined(DEBUG_ESP_MDNS_RESPONDER) && defined(DEBUG_ESP_MDNS)
 #define DEBUG_ESP_MDNS_RESPONDER
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
index f6bf0bf543..b1bfd98ccf 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
@@ -33,11 +33,11 @@ namespace esp8266
 */
 namespace MDNSImplementation
 {
-/**
+    /**
     STRUCTS
 */
 
-/**
+    /**
     MDNSResponder::stcMDNSServiceTxt
 
     One MDNS TXT item.
@@ -47,216 +47,215 @@ namespace MDNSImplementation
     Output as byte array 'c#=1' is supported.
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt constructor
 */
-MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const char* p_pcKey /*= 0*/,
-                                                    const char* p_pcValue /*= 0*/,
-                                                    bool p_bTemp /*= false*/)
-    : m_pNext(0),
-      m_pcKey(0),
-      m_pcValue(0),
-      m_bTemp(p_bTemp)
-{
-    setKey(p_pcKey);
-    setValue(p_pcValue);
-}
+    MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const char* p_pcKey /*= 0*/,
+        const char* p_pcValue /*= 0*/,
+        bool p_bTemp /*= false*/)
+        : m_pNext(0)
+        , m_pcKey(0)
+        , m_pcValue(0)
+        , m_bTemp(p_bTemp)
+    {
+        setKey(p_pcKey);
+        setValue(p_pcValue);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt copy-constructor
 */
-MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const MDNSResponder::stcMDNSServiceTxt& p_Other)
-    : m_pNext(0),
-      m_pcKey(0),
-      m_pcValue(0),
-      m_bTemp(false)
-{
-    operator=(p_Other);
-}
+    MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const MDNSResponder::stcMDNSServiceTxt& p_Other)
+        : m_pNext(0)
+        , m_pcKey(0)
+        , m_pcValue(0)
+        , m_bTemp(false)
+    {
+        operator=(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt destructor
 */
-MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt(void)
-{
-    clear();
-}
+    MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::operator=
 */
-MDNSResponder::stcMDNSServiceTxt& MDNSResponder::stcMDNSServiceTxt::operator=(const MDNSResponder::stcMDNSServiceTxt& p_Other)
-{
-    if (&p_Other != this)
+    MDNSResponder::stcMDNSServiceTxt& MDNSResponder::stcMDNSServiceTxt::operator=(const MDNSResponder::stcMDNSServiceTxt& p_Other)
     {
-        clear();
-        set(p_Other.m_pcKey, p_Other.m_pcValue, p_Other.m_bTemp);
+        if (&p_Other != this)
+        {
+            clear();
+            set(p_Other.m_pcKey, p_Other.m_pcValue, p_Other.m_bTemp);
+        }
+        return *this;
     }
-    return *this;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::clear
 */
-bool MDNSResponder::stcMDNSServiceTxt::clear(void)
-{
-    releaseKey();
-    releaseValue();
-    return true;
-}
+    bool MDNSResponder::stcMDNSServiceTxt::clear(void)
+    {
+        releaseKey();
+        releaseValue();
+        return true;
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::allocKey
 */
-char* MDNSResponder::stcMDNSServiceTxt::allocKey(size_t p_stLength)
-{
-    releaseKey();
-    if (p_stLength)
+    char* MDNSResponder::stcMDNSServiceTxt::allocKey(size_t p_stLength)
     {
-        m_pcKey = new char[p_stLength + 1];
+        releaseKey();
+        if (p_stLength)
+        {
+            m_pcKey = new char[p_stLength + 1];
+        }
+        return m_pcKey;
     }
-    return m_pcKey;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::setKey
 */
-bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey,
-                                              size_t p_stLength)
-{
-    bool bResult = false;
-
-    releaseKey();
-    if (p_stLength)
+    bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey,
+        size_t p_stLength)
     {
-        if (allocKey(p_stLength))
+        bool bResult = false;
+
+        releaseKey();
+        if (p_stLength)
         {
-            strncpy(m_pcKey, p_pcKey, p_stLength);
-            m_pcKey[p_stLength] = 0;
-            bResult = true;
+            if (allocKey(p_stLength))
+            {
+                strncpy(m_pcKey, p_pcKey, p_stLength);
+                m_pcKey[p_stLength] = 0;
+                bResult = true;
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::setKey
 */
-bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey)
-{
-    return setKey(p_pcKey, (p_pcKey ? strlen(p_pcKey) : 0));
-}
+    bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey)
+    {
+        return setKey(p_pcKey, (p_pcKey ? strlen(p_pcKey) : 0));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::releaseKey
 */
-bool MDNSResponder::stcMDNSServiceTxt::releaseKey(void)
-{
-    if (m_pcKey)
+    bool MDNSResponder::stcMDNSServiceTxt::releaseKey(void)
     {
-        delete[] m_pcKey;
-        m_pcKey = 0;
+        if (m_pcKey)
+        {
+            delete[] m_pcKey;
+            m_pcKey = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::allocValue
 */
-char* MDNSResponder::stcMDNSServiceTxt::allocValue(size_t p_stLength)
-{
-    releaseValue();
-    if (p_stLength)
+    char* MDNSResponder::stcMDNSServiceTxt::allocValue(size_t p_stLength)
     {
-        m_pcValue = new char[p_stLength + 1];
+        releaseValue();
+        if (p_stLength)
+        {
+            m_pcValue = new char[p_stLength + 1];
+        }
+        return m_pcValue;
     }
-    return m_pcValue;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::setValue
 */
-bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue,
-                                                size_t p_stLength)
-{
-    bool bResult = false;
-
-    releaseValue();
-    if (p_stLength)
+    bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue,
+        size_t p_stLength)
     {
-        if (allocValue(p_stLength))
+        bool bResult = false;
+
+        releaseValue();
+        if (p_stLength)
+        {
+            if (allocValue(p_stLength))
+            {
+                strncpy(m_pcValue, p_pcValue, p_stLength);
+                m_pcValue[p_stLength] = 0;
+                bResult = true;
+            }
+        }
+        else  // No value -> also OK
         {
-            strncpy(m_pcValue, p_pcValue, p_stLength);
-            m_pcValue[p_stLength] = 0;
             bResult = true;
         }
+        return bResult;
     }
-    else  // No value -> also OK
-    {
-        bResult = true;
-    }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::setValue
 */
-bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue)
-{
-    return setValue(p_pcValue, (p_pcValue ? strlen(p_pcValue) : 0));
-}
+    bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue)
+    {
+        return setValue(p_pcValue, (p_pcValue ? strlen(p_pcValue) : 0));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::releaseValue
 */
-bool MDNSResponder::stcMDNSServiceTxt::releaseValue(void)
-{
-    if (m_pcValue)
+    bool MDNSResponder::stcMDNSServiceTxt::releaseValue(void)
     {
-        delete[] m_pcValue;
-        m_pcValue = 0;
+        if (m_pcValue)
+        {
+            delete[] m_pcValue;
+            m_pcValue = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::set
 */
-bool MDNSResponder::stcMDNSServiceTxt::set(const char* p_pcKey,
-                                           const char* p_pcValue,
-                                           bool p_bTemp /*= false*/)
-{
-    m_bTemp = p_bTemp;
-    return ((setKey(p_pcKey)) &&
-            (setValue(p_pcValue)));
-}
+    bool MDNSResponder::stcMDNSServiceTxt::set(const char* p_pcKey,
+        const char* p_pcValue,
+        bool p_bTemp /*= false*/)
+    {
+        m_bTemp = p_bTemp;
+        return ((setKey(p_pcKey)) && (setValue(p_pcValue)));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::update
 */
-bool MDNSResponder::stcMDNSServiceTxt::update(const char* p_pcValue)
-{
-    return setValue(p_pcValue);
-}
+    bool MDNSResponder::stcMDNSServiceTxt::update(const char* p_pcValue)
+    {
+        return setValue(p_pcValue);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::length
 
     length of eg. 'c#=1' without any closing '\0'
 */
-size_t MDNSResponder::stcMDNSServiceTxt::length(void) const
-{
-    size_t stLength = 0;
-    if (m_pcKey)
+    size_t MDNSResponder::stcMDNSServiceTxt::length(void) const
     {
-        stLength += strlen(m_pcKey);                      // Key
-        stLength += 1;                                    // '='
-        stLength += (m_pcValue ? strlen(m_pcValue) : 0);  // Value
+        size_t stLength = 0;
+        if (m_pcKey)
+        {
+            stLength += strlen(m_pcKey);                      // Key
+            stLength += 1;                                    // '='
+            stLength += (m_pcValue ? strlen(m_pcValue) : 0);  // Value
+        }
+        return stLength;
     }
-    return stLength;
-}
 
-/**
+    /**
     MDNSResponder::stcMDNSServiceTxts
 
     A list of zero or more MDNS TXT items.
@@ -268,382 +267,370 @@ size_t MDNSResponder::stcMDNSServiceTxt::length(void) const
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts constructor
 */
-MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(void)
-    : m_pTxts(0)
-{
-}
+    MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(void)
+        : m_pTxts(0)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts copy-constructor
 */
-MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other)
-    : m_pTxts(0)
-{
-    operator=(p_Other);
-}
+    MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other)
+        : m_pTxts(0)
+    {
+        operator=(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts destructor
 */
-MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts(void)
-{
-    clear();
-}
+    MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::operator=
 */
-MDNSResponder::stcMDNSServiceTxts& MDNSResponder::stcMDNSServiceTxts::operator=(const stcMDNSServiceTxts& p_Other)
-{
-    if (this != &p_Other)
+    MDNSResponder::stcMDNSServiceTxts& MDNSResponder::stcMDNSServiceTxts::operator=(const stcMDNSServiceTxts& p_Other)
     {
-        clear();
-
-        for (stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; pOtherTxt; pOtherTxt = pOtherTxt->m_pNext)
+        if (this != &p_Other)
         {
-            add(new stcMDNSServiceTxt(*pOtherTxt));
+            clear();
+
+            for (stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; pOtherTxt; pOtherTxt = pOtherTxt->m_pNext)
+            {
+                add(new stcMDNSServiceTxt(*pOtherTxt));
+            }
         }
+        return *this;
     }
-    return *this;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::clear
 */
-bool MDNSResponder::stcMDNSServiceTxts::clear(void)
-{
-    while (m_pTxts)
+    bool MDNSResponder::stcMDNSServiceTxts::clear(void)
     {
-        stcMDNSServiceTxt* pNext = m_pTxts->m_pNext;
-        delete m_pTxts;
-        m_pTxts = pNext;
+        while (m_pTxts)
+        {
+            stcMDNSServiceTxt* pNext = m_pTxts->m_pNext;
+            delete m_pTxts;
+            m_pTxts = pNext;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::add
 */
-bool MDNSResponder::stcMDNSServiceTxts::add(MDNSResponder::stcMDNSServiceTxt* p_pTxt)
-{
-    bool bResult = false;
-
-    if (p_pTxt)
+    bool MDNSResponder::stcMDNSServiceTxts::add(MDNSResponder::stcMDNSServiceTxt* p_pTxt)
     {
-        p_pTxt->m_pNext = m_pTxts;
-        m_pTxts = p_pTxt;
-        bResult = true;
+        bool bResult = false;
+
+        if (p_pTxt)
+        {
+            p_pTxt->m_pNext = m_pTxts;
+            m_pTxts = p_pTxt;
+            bResult = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::remove
 */
-bool MDNSResponder::stcMDNSServiceTxts::remove(stcMDNSServiceTxt* p_pTxt)
-{
-    bool bResult = false;
-
-    if (p_pTxt)
+    bool MDNSResponder::stcMDNSServiceTxts::remove(stcMDNSServiceTxt* p_pTxt)
     {
-        stcMDNSServiceTxt* pPred = m_pTxts;
-        while ((pPred) &&
-               (pPred->m_pNext != p_pTxt))
-        {
-            pPred = pPred->m_pNext;
-        }
-        if (pPred)
-        {
-            pPred->m_pNext = p_pTxt->m_pNext;
-            delete p_pTxt;
-            bResult = true;
-        }
-        else if (m_pTxts == p_pTxt)  // No predecessor, but first item
+        bool bResult = false;
+
+        if (p_pTxt)
         {
-            m_pTxts = p_pTxt->m_pNext;
-            delete p_pTxt;
-            bResult = true;
+            stcMDNSServiceTxt* pPred = m_pTxts;
+            while ((pPred) && (pPred->m_pNext != p_pTxt))
+            {
+                pPred = pPred->m_pNext;
+            }
+            if (pPred)
+            {
+                pPred->m_pNext = p_pTxt->m_pNext;
+                delete p_pTxt;
+                bResult = true;
+            }
+            else if (m_pTxts == p_pTxt)  // No predecessor, but first item
+            {
+                m_pTxts = p_pTxt->m_pNext;
+                delete p_pTxt;
+                bResult = true;
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::removeTempTxts
 */
-bool MDNSResponder::stcMDNSServiceTxts::removeTempTxts(void)
-{
-    bool bResult = true;
-
-    stcMDNSServiceTxt* pTxt = m_pTxts;
-    while ((bResult) &&
-           (pTxt))
+    bool MDNSResponder::stcMDNSServiceTxts::removeTempTxts(void)
     {
-        stcMDNSServiceTxt* pNext = pTxt->m_pNext;
-        if (pTxt->m_bTemp)
+        bool bResult = true;
+
+        stcMDNSServiceTxt* pTxt = m_pTxts;
+        while ((bResult) && (pTxt))
         {
-            bResult = remove(pTxt);
+            stcMDNSServiceTxt* pNext = pTxt->m_pNext;
+            if (pTxt->m_bTemp)
+            {
+                bResult = remove(pTxt);
+            }
+            pTxt = pNext;
         }
-        pTxt = pNext;
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::find
 */
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey)
-{
-    stcMDNSServiceTxt* pResult = 0;
-
-    for (stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey)
     {
-        if ((p_pcKey) &&
-            (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
+        stcMDNSServiceTxt* pResult = 0;
+
+        for (stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
         {
-            pResult = pTxt;
-            break;
+            if ((p_pcKey) && (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
+            {
+                pResult = pTxt;
+                break;
+            }
         }
+        return pResult;
     }
-    return pResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::find
 */
-const MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey) const
-{
-    const stcMDNSServiceTxt* pResult = 0;
-
-    for (const stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
+    const MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey) const
     {
-        if ((p_pcKey) &&
-            (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
+        const stcMDNSServiceTxt* pResult = 0;
+
+        for (const stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
         {
-            pResult = pTxt;
-            break;
+            if ((p_pcKey) && (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
+            {
+                pResult = pTxt;
+                break;
+            }
         }
+        return pResult;
     }
-    return pResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::find
 */
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const stcMDNSServiceTxt* p_pTxt)
-{
-    stcMDNSServiceTxt* pResult = 0;
-
-    for (stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const stcMDNSServiceTxt* p_pTxt)
     {
-        if (p_pTxt == pTxt)
+        stcMDNSServiceTxt* pResult = 0;
+
+        for (stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
         {
-            pResult = pTxt;
-            break;
+            if (p_pTxt == pTxt)
+            {
+                pResult = pTxt;
+                break;
+            }
         }
+        return pResult;
     }
-    return pResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::length
 */
-uint16_t MDNSResponder::stcMDNSServiceTxts::length(void) const
-{
-    uint16_t u16Length = 0;
-
-    stcMDNSServiceTxt* pTxt = m_pTxts;
-    while (pTxt)
+    uint16_t MDNSResponder::stcMDNSServiceTxts::length(void) const
     {
-        u16Length += 1;               // Length byte
-        u16Length += pTxt->length();  // Text
-        pTxt = pTxt->m_pNext;
+        uint16_t u16Length = 0;
+
+        stcMDNSServiceTxt* pTxt = m_pTxts;
+        while (pTxt)
+        {
+            u16Length += 1;               // Length byte
+            u16Length += pTxt->length();  // Text
+            pTxt = pTxt->m_pNext;
+        }
+        return u16Length;
     }
-    return u16Length;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::c_strLength
 
     (incl. closing '\0'). Length bytes place is used for delimiting ';' and closing '\0'
 */
-size_t MDNSResponder::stcMDNSServiceTxts::c_strLength(void) const
-{
-    return length();
-}
+    size_t MDNSResponder::stcMDNSServiceTxts::c_strLength(void) const
+    {
+        return length();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::c_str
 */
-bool MDNSResponder::stcMDNSServiceTxts::c_str(char* p_pcBuffer)
-{
-    bool bResult = false;
-
-    if (p_pcBuffer)
+    bool MDNSResponder::stcMDNSServiceTxts::c_str(char* p_pcBuffer)
     {
-        bResult = true;
+        bool bResult = false;
 
-        *p_pcBuffer = 0;
-        for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
+        if (p_pcBuffer)
         {
-            size_t stLength;
-            if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0)))))
+            bResult = true;
+
+            *p_pcBuffer = 0;
+            for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
             {
-                if (pTxt != m_pTxts)
+                size_t stLength;
+                if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0)))))
                 {
-                    *p_pcBuffer++ = ';';
-                }
-                strncpy(p_pcBuffer, pTxt->m_pcKey, stLength);
-                p_pcBuffer[stLength] = 0;
-                p_pcBuffer += stLength;
-                *p_pcBuffer++ = '=';
-                if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0)))
-                {
-                    strncpy(p_pcBuffer, pTxt->m_pcValue, stLength);
+                    if (pTxt != m_pTxts)
+                    {
+                        *p_pcBuffer++ = ';';
+                    }
+                    strncpy(p_pcBuffer, pTxt->m_pcKey, stLength);
                     p_pcBuffer[stLength] = 0;
                     p_pcBuffer += stLength;
+                    *p_pcBuffer++ = '=';
+                    if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0)))
+                    {
+                        strncpy(p_pcBuffer, pTxt->m_pcValue, stLength);
+                        p_pcBuffer[stLength] = 0;
+                        p_pcBuffer += stLength;
+                    }
                 }
             }
+            *p_pcBuffer++ = 0;
         }
-        *p_pcBuffer++ = 0;
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::bufferLength
 
     (incl. closing '\0').
 */
-size_t MDNSResponder::stcMDNSServiceTxts::bufferLength(void) const
-{
-    return (length() + 1);
-}
+    size_t MDNSResponder::stcMDNSServiceTxts::bufferLength(void) const
+    {
+        return (length() + 1);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::toBuffer
 */
-bool MDNSResponder::stcMDNSServiceTxts::buffer(char* p_pcBuffer)
-{
-    bool bResult = false;
-
-    if (p_pcBuffer)
+    bool MDNSResponder::stcMDNSServiceTxts::buffer(char* p_pcBuffer)
     {
-        bResult = true;
+        bool bResult = false;
 
-        *p_pcBuffer = 0;
-        for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
+        if (p_pcBuffer)
         {
-            *(unsigned char*)p_pcBuffer++ = pTxt->length();
-            size_t stLength;
-            if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0)))))
+            bResult = true;
+
+            *p_pcBuffer = 0;
+            for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
             {
-                memcpy(p_pcBuffer, pTxt->m_pcKey, stLength);
-                p_pcBuffer += stLength;
-                *p_pcBuffer++ = '=';
-                if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0)))
+                *(unsigned char*)p_pcBuffer++ = pTxt->length();
+                size_t stLength;
+                if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0)))))
                 {
-                    memcpy(p_pcBuffer, pTxt->m_pcValue, stLength);
+                    memcpy(p_pcBuffer, pTxt->m_pcKey, stLength);
                     p_pcBuffer += stLength;
+                    *p_pcBuffer++ = '=';
+                    if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0)))
+                    {
+                        memcpy(p_pcBuffer, pTxt->m_pcValue, stLength);
+                        p_pcBuffer += stLength;
+                    }
                 }
             }
+            *p_pcBuffer++ = 0;
         }
-        *p_pcBuffer++ = 0;
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::compare
 */
-bool MDNSResponder::stcMDNSServiceTxts::compare(const MDNSResponder::stcMDNSServiceTxts& p_Other) const
-{
-    bool bResult = false;
-
-    if ((bResult = (length() == p_Other.length())))
+    bool MDNSResponder::stcMDNSServiceTxts::compare(const MDNSResponder::stcMDNSServiceTxts& p_Other) const
     {
-        // Compare A->B
-        for (const stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
-        {
-            const stcMDNSServiceTxt* pOtherTxt = p_Other.find(pTxt->m_pcKey);
-            bResult = ((pOtherTxt) &&
-                       (pTxt->m_pcValue) &&
-                       (pOtherTxt->m_pcValue) &&
-                       (strlen(pTxt->m_pcValue) == strlen(pOtherTxt->m_pcValue)) &&
-                       (0 == strcmp(pTxt->m_pcValue, pOtherTxt->m_pcValue)));
-        }
-        // Compare B->A
-        for (const stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; ((bResult) && (pOtherTxt)); pOtherTxt = pOtherTxt->m_pNext)
+        bool bResult = false;
+
+        if ((bResult = (length() == p_Other.length())))
         {
-            const stcMDNSServiceTxt* pTxt = find(pOtherTxt->m_pcKey);
-            bResult = ((pTxt) &&
-                       (pOtherTxt->m_pcValue) &&
-                       (pTxt->m_pcValue) &&
-                       (strlen(pOtherTxt->m_pcValue) == strlen(pTxt->m_pcValue)) &&
-                       (0 == strcmp(pOtherTxt->m_pcValue, pTxt->m_pcValue)));
+            // Compare A->B
+            for (const stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
+            {
+                const stcMDNSServiceTxt* pOtherTxt = p_Other.find(pTxt->m_pcKey);
+                bResult = ((pOtherTxt) && (pTxt->m_pcValue) && (pOtherTxt->m_pcValue) && (strlen(pTxt->m_pcValue) == strlen(pOtherTxt->m_pcValue)) && (0 == strcmp(pTxt->m_pcValue, pOtherTxt->m_pcValue)));
+            }
+            // Compare B->A
+            for (const stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; ((bResult) && (pOtherTxt)); pOtherTxt = pOtherTxt->m_pNext)
+            {
+                const stcMDNSServiceTxt* pTxt = find(pOtherTxt->m_pcKey);
+                bResult = ((pTxt) && (pOtherTxt->m_pcValue) && (pTxt->m_pcValue) && (strlen(pOtherTxt->m_pcValue) == strlen(pTxt->m_pcValue)) && (0 == strcmp(pOtherTxt->m_pcValue, pTxt->m_pcValue)));
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::operator==
 */
-bool MDNSResponder::stcMDNSServiceTxts::operator==(const stcMDNSServiceTxts& p_Other) const
-{
-    return compare(p_Other);
-}
+    bool MDNSResponder::stcMDNSServiceTxts::operator==(const stcMDNSServiceTxts& p_Other) const
+    {
+        return compare(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::operator!=
 */
-bool MDNSResponder::stcMDNSServiceTxts::operator!=(const stcMDNSServiceTxts& p_Other) const
-{
-    return !compare(p_Other);
-}
+    bool MDNSResponder::stcMDNSServiceTxts::operator!=(const stcMDNSServiceTxts& p_Other) const
+    {
+        return !compare(p_Other);
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_MsgHeader
 
     A MDNS message header.
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader
 */
-MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader(uint16_t p_u16ID /*= 0*/,
-                                                    bool p_bQR /*= false*/,
-                                                    unsigned char p_ucOpcode /*= 0*/,
-                                                    bool p_bAA /*= false*/,
-                                                    bool p_bTC /*= false*/,
-                                                    bool p_bRD /*= false*/,
-                                                    bool p_bRA /*= false*/,
-                                                    unsigned char p_ucRCode /*= 0*/,
-                                                    uint16_t p_u16QDCount /*= 0*/,
-                                                    uint16_t p_u16ANCount /*= 0*/,
-                                                    uint16_t p_u16NSCount /*= 0*/,
-                                                    uint16_t p_u16ARCount /*= 0*/)
-    : m_u16ID(p_u16ID),
-      m_1bQR(p_bQR),
-      m_4bOpcode(p_ucOpcode),
-      m_1bAA(p_bAA),
-      m_1bTC(p_bTC),
-      m_1bRD(p_bRD),
-      m_1bRA(p_bRA),
-      m_3bZ(0),
-      m_4bRCode(p_ucRCode),
-      m_u16QDCount(p_u16QDCount),
-      m_u16ANCount(p_u16ANCount),
-      m_u16NSCount(p_u16NSCount),
-      m_u16ARCount(p_u16ARCount)
-{
-}
-
-/**
+    MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader(uint16_t p_u16ID /*= 0*/,
+        bool p_bQR /*= false*/,
+        unsigned char p_ucOpcode /*= 0*/,
+        bool p_bAA /*= false*/,
+        bool p_bTC /*= false*/,
+        bool p_bRD /*= false*/,
+        bool p_bRA /*= false*/,
+        unsigned char p_ucRCode /*= 0*/,
+        uint16_t p_u16QDCount /*= 0*/,
+        uint16_t p_u16ANCount /*= 0*/,
+        uint16_t p_u16NSCount /*= 0*/,
+        uint16_t p_u16ARCount /*= 0*/)
+        : m_u16ID(p_u16ID)
+        , m_1bQR(p_bQR)
+        , m_4bOpcode(p_ucOpcode)
+        , m_1bAA(p_bAA)
+        , m_1bTC(p_bTC)
+        , m_1bRD(p_bRD)
+        , m_1bRA(p_bRA)
+        , m_3bZ(0)
+        , m_4bRCode(p_ucRCode)
+        , m_u16QDCount(p_u16QDCount)
+        , m_u16ANCount(p_u16ANCount)
+        , m_u16NSCount(p_u16NSCount)
+        , m_u16ARCount(p_u16ARCount)
+    {
+    }
+
+    /**
     MDNSResponder::stcMDNS_RRDomain
 
     A MDNS domain object.
@@ -656,275 +643,272 @@ MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader(uint16_t p_u16ID /*= 0*/,
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain constructor
 */
-MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(void)
-    : m_u16NameLength(0)
-{
-    clear();
-}
+    MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(void)
+        : m_u16NameLength(0)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain copy-constructor
 */
-MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other)
-    : m_u16NameLength(0)
-{
-    operator=(p_Other);
-}
+    MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other)
+        : m_u16NameLength(0)
+    {
+        operator=(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::operator =
 */
-MDNSResponder::stcMDNS_RRDomain& MDNSResponder::stcMDNS_RRDomain::operator=(const stcMDNS_RRDomain& p_Other)
-{
-    if (&p_Other != this)
+    MDNSResponder::stcMDNS_RRDomain& MDNSResponder::stcMDNS_RRDomain::operator=(const stcMDNS_RRDomain& p_Other)
     {
-        memcpy(m_acName, p_Other.m_acName, sizeof(m_acName));
-        m_u16NameLength = p_Other.m_u16NameLength;
+        if (&p_Other != this)
+        {
+            memcpy(m_acName, p_Other.m_acName, sizeof(m_acName));
+            m_u16NameLength = p_Other.m_u16NameLength;
+        }
+        return *this;
     }
-    return *this;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::clear
 */
-bool MDNSResponder::stcMDNS_RRDomain::clear(void)
-{
-    memset(m_acName, 0, sizeof(m_acName));
-    m_u16NameLength = 0;
-    return true;
-}
+    bool MDNSResponder::stcMDNS_RRDomain::clear(void)
+    {
+        memset(m_acName, 0, sizeof(m_acName));
+        m_u16NameLength = 0;
+        return true;
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::addLabel
 */
-bool MDNSResponder::stcMDNS_RRDomain::addLabel(const char* p_pcLabel,
-                                               bool p_bPrependUnderline /*= false*/)
-{
-    bool bResult = false;
-
-    size_t stLength = (p_pcLabel
-                           ? (strlen(p_pcLabel) + (p_bPrependUnderline ? 1 : 0))
-                           : 0);
-    if ((MDNS_DOMAIN_LABEL_MAXLENGTH >= stLength) &&
-        (MDNS_DOMAIN_MAXLENGTH >= (m_u16NameLength + (1 + stLength))))
-    {
-        // Length byte
-        m_acName[m_u16NameLength] = (unsigned char)stLength;  // Might be 0!
-        ++m_u16NameLength;
-        // Label
-        if (stLength)
+    bool MDNSResponder::stcMDNS_RRDomain::addLabel(const char* p_pcLabel,
+        bool p_bPrependUnderline /*= false*/)
+    {
+        bool bResult = false;
+
+        size_t stLength = (p_pcLabel
+                ? (strlen(p_pcLabel) + (p_bPrependUnderline ? 1 : 0))
+                : 0);
+        if ((MDNS_DOMAIN_LABEL_MAXLENGTH >= stLength) && (MDNS_DOMAIN_MAXLENGTH >= (m_u16NameLength + (1 + stLength))))
         {
-            if (p_bPrependUnderline)
+            // Length byte
+            m_acName[m_u16NameLength] = (unsigned char)stLength;  // Might be 0!
+            ++m_u16NameLength;
+            // Label
+            if (stLength)
             {
-                m_acName[m_u16NameLength++] = '_';
-                --stLength;
+                if (p_bPrependUnderline)
+                {
+                    m_acName[m_u16NameLength++] = '_';
+                    --stLength;
+                }
+                strncpy(&(m_acName[m_u16NameLength]), p_pcLabel, stLength);
+                m_acName[m_u16NameLength + stLength] = 0;
+                m_u16NameLength += stLength;
             }
-            strncpy(&(m_acName[m_u16NameLength]), p_pcLabel, stLength);
-            m_acName[m_u16NameLength + stLength] = 0;
-            m_u16NameLength += stLength;
+            bResult = true;
         }
-        bResult = true;
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::compare
 */
-bool MDNSResponder::stcMDNS_RRDomain::compare(const stcMDNS_RRDomain& p_Other) const
-{
-    bool bResult = false;
-
-    if (m_u16NameLength == p_Other.m_u16NameLength)
+    bool MDNSResponder::stcMDNS_RRDomain::compare(const stcMDNS_RRDomain& p_Other) const
     {
-        const char* pT = m_acName;
-        const char* pO = p_Other.m_acName;
-        while ((pT) &&
-               (pO) &&
-               (*((unsigned char*)pT) == *((unsigned char*)pO)) &&             // Same length AND
-               (0 == strncasecmp((pT + 1), (pO + 1), *((unsigned char*)pT))))  // Same content
+        bool bResult = false;
+
+        if (m_u16NameLength == p_Other.m_u16NameLength)
         {
-            if (*((unsigned char*)pT))  // Not 0
-            {
-                pT += (1 + *((unsigned char*)pT));  // Shift by length byte and length
-                pO += (1 + *((unsigned char*)pO));
-            }
-            else  // Is 0 -> Successfully reached the end
+            const char* pT = m_acName;
+            const char* pO = p_Other.m_acName;
+            while ((pT) && (pO) && (*((unsigned char*)pT) == *((unsigned char*)pO)) &&  // Same length AND
+                (0 == strncasecmp((pT + 1), (pO + 1), *((unsigned char*)pT))))          // Same content
             {
-                bResult = true;
-                break;
+                if (*((unsigned char*)pT))  // Not 0
+                {
+                    pT += (1 + *((unsigned char*)pT));  // Shift by length byte and length
+                    pO += (1 + *((unsigned char*)pO));
+                }
+                else  // Is 0 -> Successfully reached the end
+                {
+                    bResult = true;
+                    break;
+                }
             }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::operator ==
 */
-bool MDNSResponder::stcMDNS_RRDomain::operator==(const stcMDNS_RRDomain& p_Other) const
-{
-    return compare(p_Other);
-}
+    bool MDNSResponder::stcMDNS_RRDomain::operator==(const stcMDNS_RRDomain& p_Other) const
+    {
+        return compare(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::operator !=
 */
-bool MDNSResponder::stcMDNS_RRDomain::operator!=(const stcMDNS_RRDomain& p_Other) const
-{
-    return !compare(p_Other);
-}
+    bool MDNSResponder::stcMDNS_RRDomain::operator!=(const stcMDNS_RRDomain& p_Other) const
+    {
+        return !compare(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::operator >
 */
-bool MDNSResponder::stcMDNS_RRDomain::operator>(const stcMDNS_RRDomain& p_Other) const
-{
-    // TODO: Check, if this is a good idea...
-    return !compare(p_Other);
-}
+    bool MDNSResponder::stcMDNS_RRDomain::operator>(const stcMDNS_RRDomain& p_Other) const
+    {
+        // TODO: Check, if this is a good idea...
+        return !compare(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::c_strLength
 */
-size_t MDNSResponder::stcMDNS_RRDomain::c_strLength(void) const
-{
-    size_t stLength = 0;
-
-    unsigned char* pucLabelLength = (unsigned char*)m_acName;
-    while (*pucLabelLength)
+    size_t MDNSResponder::stcMDNS_RRDomain::c_strLength(void) const
     {
-        stLength += (*pucLabelLength + 1 /* +1 for '.' or '\0'*/);
-        pucLabelLength += (*pucLabelLength + 1);
+        size_t stLength = 0;
+
+        unsigned char* pucLabelLength = (unsigned char*)m_acName;
+        while (*pucLabelLength)
+        {
+            stLength += (*pucLabelLength + 1 /* +1 for '.' or '\0'*/);
+            pucLabelLength += (*pucLabelLength + 1);
+        }
+        return stLength;
     }
-    return stLength;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::c_str
 */
-bool MDNSResponder::stcMDNS_RRDomain::c_str(char* p_pcBuffer)
-{
-    bool bResult = false;
-
-    if (p_pcBuffer)
+    bool MDNSResponder::stcMDNS_RRDomain::c_str(char* p_pcBuffer)
     {
-        *p_pcBuffer = 0;
-        unsigned char* pucLabelLength = (unsigned char*)m_acName;
-        while (*pucLabelLength)
+        bool bResult = false;
+
+        if (p_pcBuffer)
         {
-            memcpy(p_pcBuffer, (const char*)(pucLabelLength + 1), *pucLabelLength);
-            p_pcBuffer += *pucLabelLength;
-            pucLabelLength += (*pucLabelLength + 1);
-            *p_pcBuffer++ = (*pucLabelLength ? '.' : '\0');
+            *p_pcBuffer = 0;
+            unsigned char* pucLabelLength = (unsigned char*)m_acName;
+            while (*pucLabelLength)
+            {
+                memcpy(p_pcBuffer, (const char*)(pucLabelLength + 1), *pucLabelLength);
+                p_pcBuffer += *pucLabelLength;
+                pucLabelLength += (*pucLabelLength + 1);
+                *p_pcBuffer++ = (*pucLabelLength ? '.' : '\0');
+            }
+            bResult = true;
         }
-        bResult = true;
+        return bResult;
     }
-    return bResult;
-}
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRAttributes
 
     A MDNS attributes object.
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes constructor
 */
-MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(uint16_t p_u16Type /*= 0*/,
-                                                          uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/)
-    : m_u16Type(p_u16Type),
-      m_u16Class(p_u16Class)
-{
-}
+    MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(uint16_t p_u16Type /*= 0*/,
+        uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/)
+        : m_u16Type(p_u16Type)
+        , m_u16Class(p_u16Class)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes copy-constructor
 */
-MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
-{
-    operator=(p_Other);
-}
+    MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
+    {
+        operator=(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAttributes::operator =
 */
-MDNSResponder::stcMDNS_RRAttributes& MDNSResponder::stcMDNS_RRAttributes::operator=(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
-{
-    if (&p_Other != this)
+    MDNSResponder::stcMDNS_RRAttributes& MDNSResponder::stcMDNS_RRAttributes::operator=(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
     {
-        m_u16Type = p_Other.m_u16Type;
-        m_u16Class = p_Other.m_u16Class;
+        if (&p_Other != this)
+        {
+            m_u16Type = p_Other.m_u16Type;
+            m_u16Class = p_Other.m_u16Class;
+        }
+        return *this;
     }
-    return *this;
-}
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRHeader
 
     A MDNS record header (domain and attributes) object.
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader constructor
 */
-MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(void)
-{
-}
+    MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(void)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader copy-constructor
 */
-MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other)
-{
-    operator=(p_Other);
-}
+    MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other)
+    {
+        operator=(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRHeader::operator =
 */
-MDNSResponder::stcMDNS_RRHeader& MDNSResponder::stcMDNS_RRHeader::operator=(const MDNSResponder::stcMDNS_RRHeader& p_Other)
-{
-    if (&p_Other != this)
+    MDNSResponder::stcMDNS_RRHeader& MDNSResponder::stcMDNS_RRHeader::operator=(const MDNSResponder::stcMDNS_RRHeader& p_Other)
     {
-        m_Domain = p_Other.m_Domain;
-        m_Attributes = p_Other.m_Attributes;
+        if (&p_Other != this)
+        {
+            m_Domain = p_Other.m_Domain;
+            m_Attributes = p_Other.m_Attributes;
+        }
+        return *this;
     }
-    return *this;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRHeader::clear
 */
-bool MDNSResponder::stcMDNS_RRHeader::clear(void)
-{
-    m_Domain.clear();
-    return true;
-}
+    bool MDNSResponder::stcMDNS_RRHeader::clear(void)
+    {
+        m_Domain.clear();
+        return true;
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRQuestion
 
     A MDNS question record object (header + question flags)
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion constructor
 */
-MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion(void)
-    : m_pNext(0),
-      m_bUnicast(false)
-{
-}
+    MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion(void)
+        : m_pNext(0)
+        , m_bUnicast(false)
+    {
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRAnswer
 
     A MDNS answer record object (header + answer content).
@@ -932,48 +916,48 @@ MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion(void)
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer constructor
 */
-MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer(enuAnswerType p_AnswerType,
-                                                  const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                  uint32_t p_u32TTL)
-    : m_pNext(0),
-      m_AnswerType(p_AnswerType),
-      m_Header(p_Header),
-      m_u32TTL(p_u32TTL)
-{
-    // Extract 'cache flush'-bit
-    m_bCacheFlush = (m_Header.m_Attributes.m_u16Class & 0x8000);
-    m_Header.m_Attributes.m_u16Class &= (~0x8000);
-}
+    MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer(enuAnswerType p_AnswerType,
+        const MDNSResponder::stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL)
+        : m_pNext(0)
+        , m_AnswerType(p_AnswerType)
+        , m_Header(p_Header)
+        , m_u32TTL(p_u32TTL)
+    {
+        // Extract 'cache flush'-bit
+        m_bCacheFlush = (m_Header.m_Attributes.m_u16Class & 0x8000);
+        m_Header.m_Attributes.m_u16Class &= (~0x8000);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer destructor
 */
-MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer(void)
-{
-}
+    MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer(void)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswer::answerType
 */
-MDNSResponder::enuAnswerType MDNSResponder::stcMDNS_RRAnswer::answerType(void) const
-{
-    return m_AnswerType;
-}
+    MDNSResponder::enuAnswerType MDNSResponder::stcMDNS_RRAnswer::answerType(void) const
+    {
+        return m_AnswerType;
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswer::clear
 */
-bool MDNSResponder::stcMDNS_RRAnswer::clear(void)
-{
-    m_pNext = 0;
-    m_Header.clear();
-    return true;
-}
+    bool MDNSResponder::stcMDNS_RRAnswer::clear(void)
+    {
+        m_pNext = 0;
+        m_Header.clear();
+        return true;
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRAnswerA
 
     A MDNS A answer object.
@@ -982,35 +966,35 @@ bool MDNSResponder::stcMDNS_RRAnswer::clear(void)
 */
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA constructor
 */
-MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                    uint32_t p_u32TTL)
-    : stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL),
-      m_IPAddress(0, 0, 0, 0)
-{
-}
+    MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL)
+        : stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL)
+        , m_IPAddress(0, 0, 0, 0)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA destructor
 */
-MDNSResponder::stcMDNS_RRAnswerA::~stcMDNS_RRAnswerA(void)
-{
-    clear();
-}
+    MDNSResponder::stcMDNS_RRAnswerA::~stcMDNS_RRAnswerA(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerA::clear
 */
-bool MDNSResponder::stcMDNS_RRAnswerA::clear(void)
-{
-    m_IPAddress = IPAddress(0, 0, 0, 0);
-    return true;
-}
+    bool MDNSResponder::stcMDNS_RRAnswerA::clear(void)
+    {
+        m_IPAddress = IPAddress(0, 0, 0, 0);
+        return true;
+    }
 #endif
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRAnswerPTR
 
     A MDNS PTR answer object.
@@ -1018,33 +1002,33 @@ bool MDNSResponder::stcMDNS_RRAnswerA::clear(void)
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR constructor
 */
-MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                        uint32_t p_u32TTL)
-    : stcMDNS_RRAnswer(AnswerType_PTR, p_Header, p_u32TTL)
-{
-}
+    MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL)
+        : stcMDNS_RRAnswer(AnswerType_PTR, p_Header, p_u32TTL)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR destructor
 */
-MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR(void)
-{
-    clear();
-}
+    MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerPTR::clear
 */
-bool MDNSResponder::stcMDNS_RRAnswerPTR::clear(void)
-{
-    m_PTRDomain.clear();
-    return true;
-}
+    bool MDNSResponder::stcMDNS_RRAnswerPTR::clear(void)
+    {
+        m_PTRDomain.clear();
+        return true;
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRAnswerTXT
 
     A MDNS TXT answer object.
@@ -1052,33 +1036,33 @@ bool MDNSResponder::stcMDNS_RRAnswerPTR::clear(void)
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT constructor
 */
-MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                        uint32_t p_u32TTL)
-    : stcMDNS_RRAnswer(AnswerType_TXT, p_Header, p_u32TTL)
-{
-}
+    MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL)
+        : stcMDNS_RRAnswer(AnswerType_TXT, p_Header, p_u32TTL)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT destructor
 */
-MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT(void)
-{
-    clear();
-}
+    MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerTXT::clear
 */
-bool MDNSResponder::stcMDNS_RRAnswerTXT::clear(void)
-{
-    m_Txts.clear();
-    return true;
-}
+    bool MDNSResponder::stcMDNS_RRAnswerTXT::clear(void)
+    {
+        m_Txts.clear();
+        return true;
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRAnswerAAAA
 
     A MDNS AAAA answer object.
@@ -1087,33 +1071,33 @@ bool MDNSResponder::stcMDNS_RRAnswerTXT::clear(void)
 */
 
 #ifdef MDNS_IP6_SUPPORT
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA constructor
 */
-MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                          uint32_t p_u32TTL)
-    : stcMDNS_RRAnswer(AnswerType_AAAA, p_Header, p_u32TTL)
-{
-}
+    MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL)
+        : stcMDNS_RRAnswer(AnswerType_AAAA, p_Header, p_u32TTL)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA destructor
 */
-MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA(void)
-{
-    clear();
-}
+    MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerAAAA::clear
 */
-bool MDNSResponder::stcMDNS_RRAnswerAAAA::clear(void)
-{
-    return true;
-}
+    bool MDNSResponder::stcMDNS_RRAnswerAAAA::clear(void)
+    {
+        return true;
+    }
 #endif
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRAnswerSRV
 
     A MDNS SRV answer object.
@@ -1121,39 +1105,39 @@ bool MDNSResponder::stcMDNS_RRAnswerAAAA::clear(void)
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV constructor
 */
-MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                        uint32_t p_u32TTL)
-    : stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL),
-      m_u16Priority(0),
-      m_u16Weight(0),
-      m_u16Port(0)
-{
-}
+    MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL)
+        : stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL)
+        , m_u16Priority(0)
+        , m_u16Weight(0)
+        , m_u16Port(0)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV destructor
 */
-MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV(void)
-{
-    clear();
-}
+    MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerSRV::clear
 */
-bool MDNSResponder::stcMDNS_RRAnswerSRV::clear(void)
-{
-    m_u16Priority = 0;
-    m_u16Weight = 0;
-    m_u16Port = 0;
-    m_SRVDomain.clear();
-    return true;
-}
+    bool MDNSResponder::stcMDNS_RRAnswerSRV::clear(void)
+    {
+        m_u16Priority = 0;
+        m_u16Weight = 0;
+        m_u16Port = 0;
+        m_SRVDomain.clear();
+        return true;
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRAnswerGeneric
 
     An unknown (generic) MDNS answer object.
@@ -1161,80 +1145,80 @@ bool MDNSResponder::stcMDNS_RRAnswerSRV::clear(void)
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric constructor
 */
-MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
-                                                                uint32_t p_u32TTL)
-    : stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL),
-      m_u16RDLength(0),
-      m_pu8RDData(0)
-{
-}
+    MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL)
+        : stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL)
+        , m_u16RDLength(0)
+        , m_pu8RDData(0)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric destructor
 */
-MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric(void)
-{
-    clear();
-}
+    MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerGeneric::clear
 */
-bool MDNSResponder::stcMDNS_RRAnswerGeneric::clear(void)
-{
-    if (m_pu8RDData)
+    bool MDNSResponder::stcMDNS_RRAnswerGeneric::clear(void)
     {
-        delete[] m_pu8RDData;
-        m_pu8RDData = 0;
-    }
-    m_u16RDLength = 0;
+        if (m_pu8RDData)
+        {
+            delete[] m_pu8RDData;
+            m_pu8RDData = 0;
+        }
+        m_u16RDLength = 0;
 
-    return true;
-}
+        return true;
+    }
 
-/**
+    /**
     MDNSResponder::stcProbeInformation
 
     Probing status information for a host or service domain
 
 */
 
-/*
+    /*
     MDNSResponder::stcProbeInformation::stcProbeInformation constructor
 */
-MDNSResponder::stcProbeInformation::stcProbeInformation(void)
-    : m_ProbingStatus(ProbingStatus_WaitingForData),
-      m_u8SentCount(0),
-      m_Timeout(esp8266::polledTimeout::oneShotMs::neverExpires),
-      m_bConflict(false),
-      m_bTiebreakNeeded(false),
-      m_fnHostProbeResultCallback(0),
-      m_fnServiceProbeResultCallback(0)
-{
-}
+    MDNSResponder::stcProbeInformation::stcProbeInformation(void)
+        : m_ProbingStatus(ProbingStatus_WaitingForData)
+        , m_u8SentCount(0)
+        , m_Timeout(esp8266::polledTimeout::oneShotMs::neverExpires)
+        , m_bConflict(false)
+        , m_bTiebreakNeeded(false)
+        , m_fnHostProbeResultCallback(0)
+        , m_fnServiceProbeResultCallback(0)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcProbeInformation::clear
 */
-bool MDNSResponder::stcProbeInformation::clear(bool p_bClearUserdata /*= false*/)
-{
-    m_ProbingStatus = ProbingStatus_WaitingForData;
-    m_u8SentCount = 0;
-    m_Timeout.resetToNeverExpires();
-    m_bConflict = false;
-    m_bTiebreakNeeded = false;
-    if (p_bClearUserdata)
+    bool MDNSResponder::stcProbeInformation::clear(bool p_bClearUserdata /*= false*/)
     {
-        m_fnHostProbeResultCallback = 0;
-        m_fnServiceProbeResultCallback = 0;
+        m_ProbingStatus = ProbingStatus_WaitingForData;
+        m_u8SentCount = 0;
+        m_Timeout.resetToNeverExpires();
+        m_bConflict = false;
+        m_bTiebreakNeeded = false;
+        if (p_bClearUserdata)
+        {
+            m_fnHostProbeResultCallback = 0;
+            m_fnServiceProbeResultCallback = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/**
+    /**
     MDNSResponder::stcMDNSService
 
     A MDNS service object (to be announced by the MDNS responder)
@@ -1245,148 +1229,148 @@ bool MDNSResponder::stcProbeInformation::clear(bool p_bClearUserdata /*= false*/
     reset in '_sendMDNSMessage' afterwards.
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSService::stcMDNSService constructor
 */
-MDNSResponder::stcMDNSService::stcMDNSService(const char* p_pcName /*= 0*/,
-                                              const char* p_pcService /*= 0*/,
-                                              const char* p_pcProtocol /*= 0*/)
-    : m_pNext(0),
-      m_pcName(0),
-      m_bAutoName(false),
-      m_pcService(0),
-      m_pcProtocol(0),
-      m_u16Port(0),
-      m_u8ReplyMask(0),
-      m_fnTxtCallback(0)
-{
-    setName(p_pcName);
-    setService(p_pcService);
-    setProtocol(p_pcProtocol);
-}
+    MDNSResponder::stcMDNSService::stcMDNSService(const char* p_pcName /*= 0*/,
+        const char* p_pcService /*= 0*/,
+        const char* p_pcProtocol /*= 0*/)
+        : m_pNext(0)
+        , m_pcName(0)
+        , m_bAutoName(false)
+        , m_pcService(0)
+        , m_pcProtocol(0)
+        , m_u16Port(0)
+        , m_u8ReplyMask(0)
+        , m_fnTxtCallback(0)
+    {
+        setName(p_pcName);
+        setService(p_pcService);
+        setProtocol(p_pcProtocol);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSService::~stcMDNSService destructor
 */
-MDNSResponder::stcMDNSService::~stcMDNSService(void)
-{
-    releaseName();
-    releaseService();
-    releaseProtocol();
-}
+    MDNSResponder::stcMDNSService::~stcMDNSService(void)
+    {
+        releaseName();
+        releaseService();
+        releaseProtocol();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSService::setName
 */
-bool MDNSResponder::stcMDNSService::setName(const char* p_pcName)
-{
-    bool bResult = false;
-
-    releaseName();
-    size_t stLength = (p_pcName ? strlen(p_pcName) : 0);
-    if (stLength)
+    bool MDNSResponder::stcMDNSService::setName(const char* p_pcName)
     {
-        if ((bResult = (0 != (m_pcName = new char[stLength + 1]))))
+        bool bResult = false;
+
+        releaseName();
+        size_t stLength = (p_pcName ? strlen(p_pcName) : 0);
+        if (stLength)
+        {
+            if ((bResult = (0 != (m_pcName = new char[stLength + 1]))))
+            {
+                strncpy(m_pcName, p_pcName, stLength);
+                m_pcName[stLength] = 0;
+            }
+        }
+        else
         {
-            strncpy(m_pcName, p_pcName, stLength);
-            m_pcName[stLength] = 0;
+            bResult = true;
         }
+        return bResult;
     }
-    else
-    {
-        bResult = true;
-    }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSService::releaseName
 */
-bool MDNSResponder::stcMDNSService::releaseName(void)
-{
-    if (m_pcName)
+    bool MDNSResponder::stcMDNSService::releaseName(void)
     {
-        delete[] m_pcName;
-        m_pcName = 0;
+        if (m_pcName)
+        {
+            delete[] m_pcName;
+            m_pcName = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSService::setService
 */
-bool MDNSResponder::stcMDNSService::setService(const char* p_pcService)
-{
-    bool bResult = false;
-
-    releaseService();
-    size_t stLength = (p_pcService ? strlen(p_pcService) : 0);
-    if (stLength)
+    bool MDNSResponder::stcMDNSService::setService(const char* p_pcService)
     {
-        if ((bResult = (0 != (m_pcService = new char[stLength + 1]))))
+        bool bResult = false;
+
+        releaseService();
+        size_t stLength = (p_pcService ? strlen(p_pcService) : 0);
+        if (stLength)
         {
-            strncpy(m_pcService, p_pcService, stLength);
-            m_pcService[stLength] = 0;
+            if ((bResult = (0 != (m_pcService = new char[stLength + 1]))))
+            {
+                strncpy(m_pcService, p_pcService, stLength);
+                m_pcService[stLength] = 0;
+            }
         }
+        else
+        {
+            bResult = true;
+        }
+        return bResult;
     }
-    else
-    {
-        bResult = true;
-    }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSService::releaseService
 */
-bool MDNSResponder::stcMDNSService::releaseService(void)
-{
-    if (m_pcService)
+    bool MDNSResponder::stcMDNSService::releaseService(void)
     {
-        delete[] m_pcService;
-        m_pcService = 0;
+        if (m_pcService)
+        {
+            delete[] m_pcService;
+            m_pcService = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSService::setProtocol
 */
-bool MDNSResponder::stcMDNSService::setProtocol(const char* p_pcProtocol)
-{
-    bool bResult = false;
-
-    releaseProtocol();
-    size_t stLength = (p_pcProtocol ? strlen(p_pcProtocol) : 0);
-    if (stLength)
+    bool MDNSResponder::stcMDNSService::setProtocol(const char* p_pcProtocol)
     {
-        if ((bResult = (0 != (m_pcProtocol = new char[stLength + 1]))))
+        bool bResult = false;
+
+        releaseProtocol();
+        size_t stLength = (p_pcProtocol ? strlen(p_pcProtocol) : 0);
+        if (stLength)
         {
-            strncpy(m_pcProtocol, p_pcProtocol, stLength);
-            m_pcProtocol[stLength] = 0;
+            if ((bResult = (0 != (m_pcProtocol = new char[stLength + 1]))))
+            {
+                strncpy(m_pcProtocol, p_pcProtocol, stLength);
+                m_pcProtocol[stLength] = 0;
+            }
         }
+        else
+        {
+            bResult = true;
+        }
+        return bResult;
     }
-    else
-    {
-        bResult = true;
-    }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSService::releaseProtocol
 */
-bool MDNSResponder::stcMDNSService::releaseProtocol(void)
-{
-    if (m_pcProtocol)
+    bool MDNSResponder::stcMDNSService::releaseProtocol(void)
     {
-        delete[] m_pcProtocol;
-        m_pcProtocol = 0;
+        if (m_pcProtocol)
+        {
+            delete[] m_pcProtocol;
+            m_pcProtocol = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/**
+    /**
     MDNSResponder::stcMDNSServiceQuery
 
     A MDNS service query object.
@@ -1397,7 +1381,7 @@ bool MDNSResponder::stcMDNSService::releaseProtocol(void)
 
 */
 
-/**
+    /**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer
 
     One answer for a service query.
@@ -1418,7 +1402,7 @@ bool MDNSResponder::stcMDNSService::releaseProtocol(void)
 
 */
 
-/**
+    /**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL
 
     The TTL (Time-To-Live) for an specific answer content.
@@ -1467,7 +1451,7 @@ bool MDNSResponder::stcMDNSService::releaseProtocol(void)
             (m_TTLTimeFlag.flagged()));
     }*/
 
-/**
+    /**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL
 
     The TTL (Time-To-Live) for an specific answer content.
@@ -1477,514 +1461,511 @@ bool MDNSResponder::stcMDNSService::releaseProtocol(void)
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL constructor
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL(void)
-    : m_u32TTL(0),
-      m_TTLTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
-      m_timeoutLevel(TIMEOUTLEVEL_UNSET)
-{
-}
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL(void)
+        : m_u32TTL(0)
+        , m_TTLTimeout(esp8266::polledTimeout::oneShotMs::neverExpires)
+        , m_timeoutLevel(TIMEOUTLEVEL_UNSET)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set(uint32_t p_u32TTL)
-{
-    m_u32TTL = p_u32TTL;
-    if (m_u32TTL)
-    {
-        m_timeoutLevel = TIMEOUTLEVEL_BASE;  // Set to 80%
-        m_TTLTimeout.reset(timeout());
-    }
-    else
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set(uint32_t p_u32TTL)
     {
-        m_timeoutLevel = TIMEOUTLEVEL_UNSET;  // undef
-        m_TTLTimeout.resetToNeverExpires();
+        m_u32TTL = p_u32TTL;
+        if (m_u32TTL)
+        {
+            m_timeoutLevel = TIMEOUTLEVEL_BASE;  // Set to 80%
+            m_TTLTimeout.reset(timeout());
+        }
+        else
+        {
+            m_timeoutLevel = TIMEOUTLEVEL_UNSET;  // undef
+            m_TTLTimeout.resetToNeverExpires();
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::flagged
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::flagged(void)
-{
-    return ((m_u32TTL) &&
-            (TIMEOUTLEVEL_UNSET != m_timeoutLevel) &&
-            (m_TTLTimeout.expired()));
-}
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::flagged(void)
+    {
+        return ((m_u32TTL) && (TIMEOUTLEVEL_UNSET != m_timeoutLevel) && (m_TTLTimeout.expired()));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::restart
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::restart(void)
-{
-    bool bResult = true;
-
-    if ((TIMEOUTLEVEL_BASE <= m_timeoutLevel) &&  // >= 80% AND
-        (TIMEOUTLEVEL_FINAL > m_timeoutLevel))    // < 100%
-    {
-        m_timeoutLevel += TIMEOUTLEVEL_INTERVAL;  // increment by 5%
-        m_TTLTimeout.reset(timeout());
-    }
-    else
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::restart(void)
     {
-        bResult = false;
-        m_TTLTimeout.resetToNeverExpires();
-        m_timeoutLevel = TIMEOUTLEVEL_UNSET;
+        bool bResult = true;
+
+        if ((TIMEOUTLEVEL_BASE <= m_timeoutLevel) &&  // >= 80% AND
+            (TIMEOUTLEVEL_FINAL > m_timeoutLevel))    // < 100%
+        {
+            m_timeoutLevel += TIMEOUTLEVEL_INTERVAL;  // increment by 5%
+            m_TTLTimeout.reset(timeout());
+        }
+        else
+        {
+            bResult = false;
+            m_TTLTimeout.resetToNeverExpires();
+            m_timeoutLevel = TIMEOUTLEVEL_UNSET;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::prepareDeletion
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::prepareDeletion(void)
-{
-    m_timeoutLevel = TIMEOUTLEVEL_FINAL;
-    m_TTLTimeout.reset(1 * 1000);  // See RFC 6762, 10.1
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::prepareDeletion(void)
+    {
+        m_timeoutLevel = TIMEOUTLEVEL_FINAL;
+        m_TTLTimeout.reset(1 * 1000);  // See RFC 6762, 10.1
 
-    return true;
-}
+        return true;
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel(void) const
-{
-    return (TIMEOUTLEVEL_FINAL == m_timeoutLevel);
-}
-
-/*
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel(void) const
+    {
+        return (TIMEOUTLEVEL_FINAL == m_timeoutLevel);
+    }
+
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::timeType MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout(void) const
-{
-    if (TIMEOUTLEVEL_BASE == m_timeoutLevel)  // 80%
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::timeType MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout(void) const
     {
-        return (m_u32TTL * 800L);  // to milliseconds
+        if (TIMEOUTLEVEL_BASE == m_timeoutLevel)  // 80%
+        {
+            return (m_u32TTL * 800L);  // to milliseconds
+        }
+        else if ((TIMEOUTLEVEL_BASE < m_timeoutLevel) &&  // >80% AND
+            (TIMEOUTLEVEL_FINAL >= m_timeoutLevel))       // <= 100%
+        {
+            return (m_u32TTL * 50L);
+        }  // else: invalid
+        return MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::neverExpires;
     }
-    else if ((TIMEOUTLEVEL_BASE < m_timeoutLevel) &&  // >80% AND
-             (TIMEOUTLEVEL_FINAL >= m_timeoutLevel))  // <= 100%
-    {
-        return (m_u32TTL * 50L);
-    }  // else: invalid
-    return MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::neverExpires;
-}
 
 #ifdef MDNS_IP4_SUPPORT
-/**
+    /**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address constructor
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address(IPAddress p_IPAddress,
-                                                                            uint32_t p_u32TTL /*= 0*/)
-    : m_pNext(0),
-      m_IPAddress(p_IPAddress)
-{
-    m_TTL.set(p_u32TTL);
-}
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address(IPAddress p_IPAddress,
+        uint32_t p_u32TTL /*= 0*/)
+        : m_pNext(0)
+        , m_IPAddress(p_IPAddress)
+    {
+        m_TTL.set(p_u32TTL);
+    }
 #endif
 
-/**
+    /**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer constructor
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer(void)
-    : m_pNext(0),
-      m_pcServiceDomain(0),
-      m_pcHostDomain(0),
-      m_u16Port(0),
-      m_pcTxts(0),
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer(void)
+        : m_pNext(0)
+        , m_pcServiceDomain(0)
+        , m_pcHostDomain(0)
+        , m_u16Port(0)
+        , m_pcTxts(0)
+        ,
 #ifdef MDNS_IP4_SUPPORT
-      m_pIP4Addresses(0),
+        m_pIP4Addresses(0)
+        ,
 #endif
 #ifdef MDNS_IP6_SUPPORT
-      m_pIP6Addresses(0),
+        m_pIP6Addresses(0)
+        ,
 #endif
-      m_u32ContentFlags(0)
-{
-}
+        m_u32ContentFlags(0)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer destructor
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer(void)
-{
-    clear();
-}
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear(void)
-{
-    return ((releaseTxts()) &&
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear(void)
+    {
+        return ((releaseTxts()) &&
 #ifdef MDNS_IP4_SUPPORT
             (releaseIP4Addresses()) &&
 #endif
 #ifdef MDNS_IP6_SUPPORT
             (releaseIP6Addresses())
 #endif
-                (releaseHostDomain()) &&
-            (releaseServiceDomain()));
-}
+                (releaseHostDomain())
+            && (releaseServiceDomain()));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocServiceDomain
 
     Alloc memory for the char array representation of the service domain.
 
 */
-char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocServiceDomain(size_t p_stLength)
-{
-    releaseServiceDomain();
-    if (p_stLength)
+    char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocServiceDomain(size_t p_stLength)
     {
-        m_pcServiceDomain = new char[p_stLength];
+        releaseServiceDomain();
+        if (p_stLength)
+        {
+            m_pcServiceDomain = new char[p_stLength];
+        }
+        return m_pcServiceDomain;
     }
-    return m_pcServiceDomain;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseServiceDomain
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseServiceDomain(void)
-{
-    if (m_pcServiceDomain)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseServiceDomain(void)
     {
-        delete[] m_pcServiceDomain;
-        m_pcServiceDomain = 0;
+        if (m_pcServiceDomain)
+        {
+            delete[] m_pcServiceDomain;
+            m_pcServiceDomain = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocHostDomain
 
     Alloc memory for the char array representation of the host domain.
 
 */
-char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocHostDomain(size_t p_stLength)
-{
-    releaseHostDomain();
-    if (p_stLength)
+    char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocHostDomain(size_t p_stLength)
     {
-        m_pcHostDomain = new char[p_stLength];
+        releaseHostDomain();
+        if (p_stLength)
+        {
+            m_pcHostDomain = new char[p_stLength];
+        }
+        return m_pcHostDomain;
     }
-    return m_pcHostDomain;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseHostDomain
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseHostDomain(void)
-{
-    if (m_pcHostDomain)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseHostDomain(void)
     {
-        delete[] m_pcHostDomain;
-        m_pcHostDomain = 0;
+        if (m_pcHostDomain)
+        {
+            delete[] m_pcHostDomain;
+            m_pcHostDomain = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocTxts
 
     Alloc memory for the char array representation of the TXT items.
 
 */
-char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocTxts(size_t p_stLength)
-{
-    releaseTxts();
-    if (p_stLength)
+    char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocTxts(size_t p_stLength)
     {
-        m_pcTxts = new char[p_stLength];
+        releaseTxts();
+        if (p_stLength)
+        {
+            m_pcTxts = new char[p_stLength];
+        }
+        return m_pcTxts;
     }
-    return m_pcTxts;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseTxts
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseTxts(void)
-{
-    if (m_pcTxts)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseTxts(void)
     {
-        delete[] m_pcTxts;
-        m_pcTxts = 0;
+        if (m_pcTxts)
+        {
+            delete[] m_pcTxts;
+            m_pcTxts = 0;
+        }
+        return true;
     }
-    return true;
-}
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP4Addresses
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP4Addresses(void)
-{
-    while (m_pIP4Addresses)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP4Addresses(void)
     {
-        stcIP4Address* pNext = m_pIP4Addresses->m_pNext;
-        delete m_pIP4Addresses;
-        m_pIP4Addresses = pNext;
+        while (m_pIP4Addresses)
+        {
+            stcIP4Address* pNext = m_pIP4Addresses->m_pNext;
+            delete m_pIP4Addresses;
+            m_pIP4Addresses = pNext;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
-{
-    bool bResult = false;
-
-    if (p_pIP4Address)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
     {
-        p_pIP4Address->m_pNext = m_pIP4Addresses;
-        m_pIP4Addresses = p_pIP4Address;
-        bResult = true;
+        bool bResult = false;
+
+        if (p_pIP4Address)
+        {
+            p_pIP4Address->m_pNext = m_pIP4Addresses;
+            m_pIP4Addresses = p_pIP4Address;
+            bResult = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
-{
-    bool bResult = false;
-
-    if (p_pIP4Address)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
     {
-        stcIP4Address* pPred = m_pIP4Addresses;
-        while ((pPred) &&
-               (pPred->m_pNext != p_pIP4Address))
-        {
-            pPred = pPred->m_pNext;
-        }
-        if (pPred)
-        {
-            pPred->m_pNext = p_pIP4Address->m_pNext;
-            delete p_pIP4Address;
-            bResult = true;
-        }
-        else if (m_pIP4Addresses == p_pIP4Address)  // No predecessor, but first item
+        bool bResult = false;
+
+        if (p_pIP4Address)
         {
-            m_pIP4Addresses = p_pIP4Address->m_pNext;
-            delete p_pIP4Address;
-            bResult = true;
+            stcIP4Address* pPred = m_pIP4Addresses;
+            while ((pPred) && (pPred->m_pNext != p_pIP4Address))
+            {
+                pPred = pPred->m_pNext;
+            }
+            if (pPred)
+            {
+                pPred->m_pNext = p_pIP4Address->m_pNext;
+                delete p_pIP4Address;
+                bResult = true;
+            }
+            else if (m_pIP4Addresses == p_pIP4Address)  // No predecessor, but first item
+            {
+                m_pIP4Addresses = p_pIP4Address->m_pNext;
+                delete p_pIP4Address;
+                bResult = true;
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address (const)
 */
-const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress) const
-{
-    return (stcIP4Address*)(((const stcAnswer*)this)->findIP4Address(p_IPAddress));
-}
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress) const
+    {
+        return (stcIP4Address*)(((const stcAnswer*)this)->findIP4Address(p_IPAddress));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress)
-{
-    stcIP4Address* pIP4Address = m_pIP4Addresses;
-    while (pIP4Address)
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress)
     {
-        if (pIP4Address->m_IPAddress == p_IPAddress)
+        stcIP4Address* pIP4Address = m_pIP4Addresses;
+        while (pIP4Address)
         {
-            break;
+            if (pIP4Address->m_IPAddress == p_IPAddress)
+            {
+                break;
+            }
+            pIP4Address = pIP4Address->m_pNext;
         }
-        pIP4Address = pIP4Address->m_pNext;
+        return pIP4Address;
     }
-    return pIP4Address;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount
 */
-uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount(void) const
-{
-    uint32_t u32Count = 0;
-
-    stcIP4Address* pIP4Address = m_pIP4Addresses;
-    while (pIP4Address)
+    uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount(void) const
     {
-        ++u32Count;
-        pIP4Address = pIP4Address->m_pNext;
+        uint32_t u32Count = 0;
+
+        stcIP4Address* pIP4Address = m_pIP4Addresses;
+        while (pIP4Address)
+        {
+            ++u32Count;
+            pIP4Address = pIP4Address->m_pNext;
+        }
+        return u32Count;
     }
-    return u32Count;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index)
-{
-    return (stcIP4Address*)(((const stcAnswer*)this)->IP4AddressAtIndex(p_u32Index));
-}
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index)
+    {
+        return (stcIP4Address*)(((const stcAnswer*)this)->IP4AddressAtIndex(p_u32Index));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex (const)
 */
-const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index) const
-{
-    const stcIP4Address* pIP4Address = 0;
-
-    if (((uint32_t)(-1) != p_u32Index) &&
-        (m_pIP4Addresses))
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index) const
     {
-        uint32_t u32Index;
-        for (pIP4Address = m_pIP4Addresses, u32Index = 0; ((pIP4Address) && (u32Index < p_u32Index)); pIP4Address = pIP4Address->m_pNext, ++u32Index)
-            ;
+        const stcIP4Address* pIP4Address = 0;
+
+        if (((uint32_t)(-1) != p_u32Index) && (m_pIP4Addresses))
+        {
+            uint32_t u32Index;
+            for (pIP4Address = m_pIP4Addresses, u32Index = 0; ((pIP4Address) && (u32Index < p_u32Index)); pIP4Address = pIP4Address->m_pNext, ++u32Index)
+                ;
+        }
+        return pIP4Address;
     }
-    return pIP4Address;
-}
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP6Addresses
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP6Addresses(void)
-{
-    while (m_pIP6Addresses)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP6Addresses(void)
     {
-        stcIP6Address* pNext = m_pIP6Addresses->m_pNext;
-        delete m_pIP6Addresses;
-        m_pIP6Addresses = pNext;
+        while (m_pIP6Addresses)
+        {
+            stcIP6Address* pNext = m_pIP6Addresses->m_pNext;
+            delete m_pIP6Addresses;
+            m_pIP6Addresses = pNext;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
-{
-    bool bResult = false;
-
-    if (p_pIP6Address)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
     {
-        p_pIP6Address->m_pNext = m_pIP6Addresses;
-        m_pIP6Addresses = p_pIP6Address;
-        bResult = true;
+        bool bResult = false;
+
+        if (p_pIP6Address)
+        {
+            p_pIP6Address->m_pNext = m_pIP6Addresses;
+            m_pIP6Addresses = p_pIP6Address;
+            bResult = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
-{
-    bool bResult = false;
-
-    if (p_pIP6Address)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
     {
-        stcIP6Address* pPred = m_pIP6Addresses;
-        while ((pPred) &&
-               (pPred->m_pNext != p_pIP6Address))
-        {
-            pPred = pPred->m_pNext;
-        }
-        if (pPred)
-        {
-            pPred->m_pNext = p_pIP6Address->m_pNext;
-            delete p_pIP6Address;
-            bResult = true;
-        }
-        else if (m_pIP6Addresses == p_pIP6Address)  // No predecessor, but first item
+        bool bResult = false;
+
+        if (p_pIP6Address)
         {
-            m_pIP6Addresses = p_pIP6Address->m_pNext;
-            delete p_pIP6Address;
-            bResult = true;
+            stcIP6Address* pPred = m_pIP6Addresses;
+            while ((pPred) && (pPred->m_pNext != p_pIP6Address))
+            {
+                pPred = pPred->m_pNext;
+            }
+            if (pPred)
+            {
+                pPred->m_pNext = p_pIP6Address->m_pNext;
+                delete p_pIP6Address;
+                bResult = true;
+            }
+            else if (m_pIP6Addresses == p_pIP6Address)  // No predecessor, but first item
+            {
+                m_pIP6Addresses = p_pIP6Address->m_pNext;
+                delete p_pIP6Address;
+                bResult = true;
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IP6Address& p_IPAddress)
-{
-    return (stcIP6Address*)(((const stcAnswer*)this)->findIP6Address(p_IPAddress));
-}
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IP6Address& p_IPAddress)
+    {
+        return (stcIP6Address*)(((const stcAnswer*)this)->findIP6Address(p_IPAddress));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address (const)
 */
-const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IPAddress& p_IPAddress) const
-{
-    const stcIP6Address* pIP6Address = m_pIP6Addresses;
-    while (pIP6Address)
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IPAddress& p_IPAddress) const
     {
-        if (p_IP6Address->m_IPAddress == p_IPAddress)
+        const stcIP6Address* pIP6Address = m_pIP6Addresses;
+        while (pIP6Address)
         {
-            break;
+            if (p_IP6Address->m_IPAddress == p_IPAddress)
+            {
+                break;
+            }
+            pIP6Address = pIP6Address->m_pNext;
         }
-        pIP6Address = pIP6Address->m_pNext;
+        return pIP6Address;
     }
-    return pIP6Address;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount
 */
-uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount(void) const
-{
-    uint32_t u32Count = 0;
-
-    stcIP6Address* pIP6Address = m_pIP6Addresses;
-    while (pIP6Address)
+    uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount(void) const
     {
-        ++u32Count;
-        pIP6Address = pIP6Address->m_pNext;
+        uint32_t u32Count = 0;
+
+        stcIP6Address* pIP6Address = m_pIP6Addresses;
+        while (pIP6Address)
+        {
+            ++u32Count;
+            pIP6Address = pIP6Address->m_pNext;
+        }
+        return u32Count;
     }
-    return u32Count;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex (const)
 */
-const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index) const
-{
-    return (stcIP6Address*)(((const stcAnswer*)this)->IP6AddressAtIndex(p_u32Index));
-}
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index) const
+    {
+        return (stcIP6Address*)(((const stcAnswer*)this)->IP6AddressAtIndex(p_u32Index));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index)
-{
-    stcIP6Address* pIP6Address = 0;
-
-    if (((uint32_t)(-1) != p_u32Index) &&
-        (m_pIP6Addresses))
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index)
     {
-        uint32_t u32Index;
-        for (pIP6Address = m_pIP6Addresses, u32Index = 0; ((pIP6Address) && (u32Index < p_u32Index)); pIP6Address = pIP6Address->m_pNext, ++u32Index)
-            ;
+        stcIP6Address* pIP6Address = 0;
+
+        if (((uint32_t)(-1) != p_u32Index) && (m_pIP6Addresses))
+        {
+            uint32_t u32Index;
+            for (pIP6Address = m_pIP6Addresses, u32Index = 0; ((pIP6Address) && (u32Index < p_u32Index)); pIP6Address = pIP6Address->m_pNext, ++u32Index)
+                ;
+        }
+        return pIP6Address;
     }
-    return pIP6Address;
-}
 #endif
 
-/**
+    /**
     MDNSResponder::stcMDNSServiceQuery
 
     A service query object.
@@ -2001,188 +1982,186 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stc
     Service query object may be connected to a linked list.
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery constructor
 */
-MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery(void)
-    : m_pNext(0),
-      m_fnCallback(0),
-      m_bLegacyQuery(false),
-      m_u8SentCount(0),
-      m_ResendTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
-      m_bAwaitingAnswers(true),
-      m_pAnswers(0)
-{
-    clear();
-}
+    MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery(void)
+        : m_pNext(0)
+        , m_fnCallback(0)
+        , m_bLegacyQuery(false)
+        , m_u8SentCount(0)
+        , m_ResendTimeout(esp8266::polledTimeout::oneShotMs::neverExpires)
+        , m_bAwaitingAnswers(true)
+        , m_pAnswers(0)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery destructor
 */
-MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery(void)
-{
-    clear();
-}
+    MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::clear
 */
-bool MDNSResponder::stcMDNSServiceQuery::clear(void)
-{
-    m_fnCallback = 0;
-    m_bLegacyQuery = false;
-    m_u8SentCount = 0;
-    m_ResendTimeout.resetToNeverExpires();
-    m_bAwaitingAnswers = true;
-    while (m_pAnswers)
+    bool MDNSResponder::stcMDNSServiceQuery::clear(void)
     {
-        stcAnswer* pNext = m_pAnswers->m_pNext;
-        delete m_pAnswers;
-        m_pAnswers = pNext;
+        m_fnCallback = 0;
+        m_bLegacyQuery = false;
+        m_u8SentCount = 0;
+        m_ResendTimeout.resetToNeverExpires();
+        m_bAwaitingAnswers = true;
+        while (m_pAnswers)
+        {
+            stcAnswer* pNext = m_pAnswers->m_pNext;
+            delete m_pAnswers;
+            m_pAnswers = pNext;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::answerCount
 */
-uint32_t MDNSResponder::stcMDNSServiceQuery::answerCount(void) const
-{
-    uint32_t u32Count = 0;
-
-    stcAnswer* pAnswer = m_pAnswers;
-    while (pAnswer)
+    uint32_t MDNSResponder::stcMDNSServiceQuery::answerCount(void) const
     {
-        ++u32Count;
-        pAnswer = pAnswer->m_pNext;
+        uint32_t u32Count = 0;
+
+        stcAnswer* pAnswer = m_pAnswers;
+        while (pAnswer)
+        {
+            ++u32Count;
+            pAnswer = pAnswer->m_pNext;
+        }
+        return u32Count;
     }
-    return u32Count;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::answerAtIndex
 */
-const MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index) const
-{
-    const stcAnswer* pAnswer = 0;
-
-    if (((uint32_t)(-1) != p_u32Index) &&
-        (m_pAnswers))
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index) const
     {
-        uint32_t u32Index;
-        for (pAnswer = m_pAnswers, u32Index = 0; ((pAnswer) && (u32Index < p_u32Index)); pAnswer = pAnswer->m_pNext, ++u32Index)
-            ;
+        const stcAnswer* pAnswer = 0;
+
+        if (((uint32_t)(-1) != p_u32Index) && (m_pAnswers))
+        {
+            uint32_t u32Index;
+            for (pAnswer = m_pAnswers, u32Index = 0; ((pAnswer) && (u32Index < p_u32Index)); pAnswer = pAnswer->m_pNext, ++u32Index)
+                ;
+        }
+        return pAnswer;
     }
-    return pAnswer;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::answerAtIndex
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index)
-{
-    return (stcAnswer*)(((const stcMDNSServiceQuery*)this)->answerAtIndex(p_u32Index));
-}
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index)
+    {
+        return (stcAnswer*)(((const stcMDNSServiceQuery*)this)->answerAtIndex(p_u32Index));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::indexOfAnswer
 */
-uint32_t MDNSResponder::stcMDNSServiceQuery::indexOfAnswer(const MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer) const
-{
-    uint32_t u32Index = 0;
-
-    for (const stcAnswer* pAnswer = m_pAnswers; pAnswer; pAnswer = pAnswer->m_pNext, ++u32Index)
+    uint32_t MDNSResponder::stcMDNSServiceQuery::indexOfAnswer(const MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer) const
     {
-        if (pAnswer == p_pAnswer)
+        uint32_t u32Index = 0;
+
+        for (const stcAnswer* pAnswer = m_pAnswers; pAnswer; pAnswer = pAnswer->m_pNext, ++u32Index)
         {
-            return u32Index;
+            if (pAnswer == p_pAnswer)
+            {
+                return u32Index;
+            }
         }
+        return ((uint32_t)(-1));
     }
-    return ((uint32_t)(-1));
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::addAnswer
 */
-bool MDNSResponder::stcMDNSServiceQuery::addAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
-{
-    bool bResult = false;
-
-    if (p_pAnswer)
+    bool MDNSResponder::stcMDNSServiceQuery::addAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
     {
-        p_pAnswer->m_pNext = m_pAnswers;
-        m_pAnswers = p_pAnswer;
-        bResult = true;
+        bool bResult = false;
+
+        if (p_pAnswer)
+        {
+            p_pAnswer->m_pNext = m_pAnswers;
+            m_pAnswers = p_pAnswer;
+            bResult = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::removeAnswer
 */
-bool MDNSResponder::stcMDNSServiceQuery::removeAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
-{
-    bool bResult = false;
-
-    if (p_pAnswer)
+    bool MDNSResponder::stcMDNSServiceQuery::removeAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
     {
-        stcAnswer* pPred = m_pAnswers;
-        while ((pPred) &&
-               (pPred->m_pNext != p_pAnswer))
-        {
-            pPred = pPred->m_pNext;
-        }
-        if (pPred)
-        {
-            pPred->m_pNext = p_pAnswer->m_pNext;
-            delete p_pAnswer;
-            bResult = true;
-        }
-        else if (m_pAnswers == p_pAnswer)  // No predecessor, but first item
+        bool bResult = false;
+
+        if (p_pAnswer)
         {
-            m_pAnswers = p_pAnswer->m_pNext;
-            delete p_pAnswer;
-            bResult = true;
+            stcAnswer* pPred = m_pAnswers;
+            while ((pPred) && (pPred->m_pNext != p_pAnswer))
+            {
+                pPred = pPred->m_pNext;
+            }
+            if (pPred)
+            {
+                pPred->m_pNext = p_pAnswer->m_pNext;
+                delete p_pAnswer;
+                bResult = true;
+            }
+            else if (m_pAnswers == p_pAnswer)  // No predecessor, but first item
+            {
+                m_pAnswers = p_pAnswer->m_pNext;
+                delete p_pAnswer;
+                bResult = true;
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::findAnswerForServiceDomain
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForServiceDomain(const MDNSResponder::stcMDNS_RRDomain& p_ServiceDomain)
-{
-    stcAnswer* pAnswer = m_pAnswers;
-    while (pAnswer)
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForServiceDomain(const MDNSResponder::stcMDNS_RRDomain& p_ServiceDomain)
     {
-        if (pAnswer->m_ServiceDomain == p_ServiceDomain)
+        stcAnswer* pAnswer = m_pAnswers;
+        while (pAnswer)
         {
-            break;
+            if (pAnswer->m_ServiceDomain == p_ServiceDomain)
+            {
+                break;
+            }
+            pAnswer = pAnswer->m_pNext;
         }
-        pAnswer = pAnswer->m_pNext;
+        return pAnswer;
     }
-    return pAnswer;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::findAnswerForHostDomain
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForHostDomain(const MDNSResponder::stcMDNS_RRDomain& p_HostDomain)
-{
-    stcAnswer* pAnswer = m_pAnswers;
-    while (pAnswer)
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForHostDomain(const MDNSResponder::stcMDNS_RRDomain& p_HostDomain)
     {
-        if (pAnswer->m_HostDomain == p_HostDomain)
+        stcAnswer* pAnswer = m_pAnswers;
+        while (pAnswer)
         {
-            break;
+            if (pAnswer->m_HostDomain == p_HostDomain)
+            {
+                break;
+            }
+            pAnswer = pAnswer->m_pNext;
         }
-        pAnswer = pAnswer->m_pNext;
+        return pAnswer;
     }
-    return pAnswer;
-}
 
-/**
+    /**
     MDNSResponder::stcMDNSSendParameter
 
     A 'collection' of properties and flags for one MDNS query or response.
@@ -2192,140 +2171,137 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuer
 
 */
 
-/**
+    /**
     MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem
 
     A cached host or service domain, incl. the offset in the UDP output buffer.
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem constructor
 */
-MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem(const void* p_pHostnameOrService,
-                                                                            bool p_bAdditionalData,
-                                                                            uint32_t p_u16Offset)
-    : m_pNext(0),
-      m_pHostnameOrService(p_pHostnameOrService),
-      m_bAdditionalData(p_bAdditionalData),
-      m_u16Offset(p_u16Offset)
-{
-}
+    MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem(const void* p_pHostnameOrService,
+        bool p_bAdditionalData,
+        uint32_t p_u16Offset)
+        : m_pNext(0)
+        , m_pHostnameOrService(p_pHostnameOrService)
+        , m_bAdditionalData(p_bAdditionalData)
+        , m_u16Offset(p_u16Offset)
+    {
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNSSendParameter
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter constructor
 */
-MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter(void)
-    : m_pQuestions(0),
-      m_pDomainCacheItems(0)
-{
-    clear();
-}
+    MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter(void)
+        : m_pQuestions(0)
+        , m_pDomainCacheItems(0)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter destructor
 */
-MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter(void)
-{
-    clear();
-}
+    MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSSendParameter::clear
 */
-bool MDNSResponder::stcMDNSSendParameter::clear(void)
-{
-    m_u16ID = 0;
-    m_u8HostReplyMask = 0;
-    m_u16Offset = 0;
+    bool MDNSResponder::stcMDNSSendParameter::clear(void)
+    {
+        m_u16ID = 0;
+        m_u8HostReplyMask = 0;
+        m_u16Offset = 0;
 
-    m_bLegacyQuery = false;
-    m_bResponse = false;
-    m_bAuthorative = false;
-    m_bUnicast = false;
-    m_bUnannounce = false;
+        m_bLegacyQuery = false;
+        m_bResponse = false;
+        m_bAuthorative = false;
+        m_bUnicast = false;
+        m_bUnannounce = false;
 
-    m_bCacheFlush = true;
+        m_bCacheFlush = true;
 
-    while (m_pQuestions)
-    {
-        stcMDNS_RRQuestion* pNext = m_pQuestions->m_pNext;
-        delete m_pQuestions;
-        m_pQuestions = pNext;
-    }
+        while (m_pQuestions)
+        {
+            stcMDNS_RRQuestion* pNext = m_pQuestions->m_pNext;
+            delete m_pQuestions;
+            m_pQuestions = pNext;
+        }
 
-    return clearCachedNames();
-    ;
-}
-/*
+        return clearCachedNames();
+        ;
+    }
+    /*
     MDNSResponder::stcMDNSSendParameter::clear cached names
 */
-bool MDNSResponder::stcMDNSSendParameter::clearCachedNames(void)
-{
-    m_u16Offset = 0;
-
-    while (m_pDomainCacheItems)
+    bool MDNSResponder::stcMDNSSendParameter::clearCachedNames(void)
     {
-        stcDomainCacheItem* pNext = m_pDomainCacheItems->m_pNext;
-        delete m_pDomainCacheItems;
-        m_pDomainCacheItems = pNext;
-    }
-    m_pDomainCacheItems = nullptr;
+        m_u16Offset = 0;
 
-    return true;
-}
+        while (m_pDomainCacheItems)
+        {
+            stcDomainCacheItem* pNext = m_pDomainCacheItems->m_pNext;
+            delete m_pDomainCacheItems;
+            m_pDomainCacheItems = pNext;
+        }
+        m_pDomainCacheItems = nullptr;
 
-/*
+        return true;
+    }
+
+    /*
     MDNSResponder::stcMDNSSendParameter::shiftOffset
 */
-bool MDNSResponder::stcMDNSSendParameter::shiftOffset(uint16_t p_u16Shift)
-{
-    m_u16Offset += p_u16Shift;
-    return true;
-}
+    bool MDNSResponder::stcMDNSSendParameter::shiftOffset(uint16_t p_u16Shift)
+    {
+        m_u16Offset += p_u16Shift;
+        return true;
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSSendParameter::addDomainCacheItem
 */
-bool MDNSResponder::stcMDNSSendParameter::addDomainCacheItem(const void* p_pHostnameOrService,
-                                                             bool p_bAdditionalData,
-                                                             uint16_t p_u16Offset)
-{
-    bool bResult = false;
-
-    stcDomainCacheItem* pNewItem = 0;
-    if ((p_pHostnameOrService) &&
-        (p_u16Offset) &&
-        ((pNewItem = new stcDomainCacheItem(p_pHostnameOrService, p_bAdditionalData, p_u16Offset))))
+    bool MDNSResponder::stcMDNSSendParameter::addDomainCacheItem(const void* p_pHostnameOrService,
+        bool p_bAdditionalData,
+        uint16_t p_u16Offset)
     {
-        pNewItem->m_pNext = m_pDomainCacheItems;
-        bResult = ((m_pDomainCacheItems = pNewItem));
+        bool bResult = false;
+
+        stcDomainCacheItem* pNewItem = 0;
+        if ((p_pHostnameOrService) && (p_u16Offset) && ((pNewItem = new stcDomainCacheItem(p_pHostnameOrService, p_bAdditionalData, p_u16Offset))))
+        {
+            pNewItem->m_pNext = m_pDomainCacheItems;
+            bResult = ((m_pDomainCacheItems = pNewItem));
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset
 */
-uint16_t MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset(const void* p_pHostnameOrService,
-                                                                     bool p_bAdditionalData) const
-{
-    const stcDomainCacheItem* pCacheItem = m_pDomainCacheItems;
-
-    for (; pCacheItem; pCacheItem = pCacheItem->m_pNext)
+    uint16_t MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset(const void* p_pHostnameOrService,
+        bool p_bAdditionalData) const
     {
-        if ((pCacheItem->m_pHostnameOrService == p_pHostnameOrService) &&
-            (pCacheItem->m_bAdditionalData == p_bAdditionalData))  // Found cache item
+        const stcDomainCacheItem* pCacheItem = m_pDomainCacheItems;
+
+        for (; pCacheItem; pCacheItem = pCacheItem->m_pNext)
         {
-            break;
+            if ((pCacheItem->m_pHostnameOrService == p_pHostnameOrService) && (pCacheItem->m_bAdditionalData == p_bAdditionalData))  // Found cache item
+            {
+                break;
+            }
         }
+        return (pCacheItem ? pCacheItem->m_u16Offset : 0);
     }
-    return (pCacheItem ? pCacheItem->m_u16Offset : 0);
-}
 
 }  // namespace MDNSImplementation
 
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
index 6509e42b05..7be63de401 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
@@ -38,32 +38,32 @@ namespace esp8266
 */
 namespace MDNSImplementation
 {
-/**
+    /**
     CONST STRINGS
 */
-static const char* scpcLocal = "local";
-static const char* scpcServices = "services";
-static const char* scpcDNSSD = "dns-sd";
-static const char* scpcUDP = "udp";
-//static const char*                    scpcTCP                 = "tcp";
+    static const char* scpcLocal = "local";
+    static const char* scpcServices = "services";
+    static const char* scpcDNSSD = "dns-sd";
+    static const char* scpcUDP = "udp";
+    //static const char*                    scpcTCP                 = "tcp";
 
 #ifdef MDNS_IP4_SUPPORT
-static const char* scpcReverseIP4Domain = "in-addr";
+    static const char* scpcReverseIP4Domain = "in-addr";
 #endif
 #ifdef MDNS_IP6_SUPPORT
-static const char* scpcReverseIP6Domain = "ip6";
+    static const char* scpcReverseIP6Domain = "ip6";
 #endif
-static const char* scpcReverseTopDomain = "arpa";
+    static const char* scpcReverseTopDomain = "arpa";
 
-/**
+    /**
     TRANSFER
 */
 
-/**
+    /**
     SENDING
 */
 
-/*
+    /*
     MDNSResponder::_sendMDNSMessage
 
     Unicast responses are prepared and sent directly to the querier.
@@ -72,80 +72,77 @@ static const char* scpcReverseTopDomain = "arpa";
     Any reply flags in installed services are removed at the end!
 
 */
-bool MDNSResponder::_sendMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    bool bResult = true;
-
-    if (p_rSendParameter.m_bResponse &&
-        p_rSendParameter.m_bUnicast)  // Unicast response  -> Send to querier
-    {
-        DEBUG_EX_ERR(if (!m_pUDPContext->getRemoteAddress())
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: MISSING remote address for response!\n"));
-                     });
-        IPAddress ipRemote;
-        ipRemote = m_pUDPContext->getRemoteAddress();
-        bResult = ((_prepareMDNSMessage(p_rSendParameter, m_pUDPContext->getInputNetif()->ip_addr)) &&
-                   (m_pUDPContext->sendTimeout(ipRemote, m_pUDPContext->getRemotePort(), MDNS_UDPCONTEXT_TIMEOUT)));
-    }
-    else  // Multicast response
+    bool MDNSResponder::_sendMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
-        bResult = _sendMDNSMessage_Multicast(p_rSendParameter);
-    }
+        bool bResult = true;
 
-    // Finally clear service reply masks
-    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
-    {
-        pService->m_u8ReplyMask = 0;
-    }
+        if (p_rSendParameter.m_bResponse && p_rSendParameter.m_bUnicast)  // Unicast response  -> Send to querier
+        {
+            DEBUG_EX_ERR(if (!m_pUDPContext->getRemoteAddress())
+                {
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: MISSING remote address for response!\n"));
+                });
+            IPAddress ipRemote;
+            ipRemote = m_pUDPContext->getRemoteAddress();
+            bResult = ((_prepareMDNSMessage(p_rSendParameter, m_pUDPContext->getInputNetif()->ip_addr)) && (m_pUDPContext->sendTimeout(ipRemote, m_pUDPContext->getRemotePort(), MDNS_UDPCONTEXT_TIMEOUT)));
+        }
+        else  // Multicast response
+        {
+            bResult = _sendMDNSMessage_Multicast(p_rSendParameter);
+        }
 
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: FAILED!\n"));
-                 });
-    return bResult;
-}
+        // Finally clear service reply masks
+        for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+        {
+            pService->m_u8ReplyMask = 0;
+        }
 
-/*
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: FAILED!\n"));
+            });
+        return bResult;
+    }
+
+    /*
     MDNSResponder::_sendMDNSMessage_Multicast
 
     Fills the UDP output buffer (via _prepareMDNSMessage) and sends the buffer
     via the selected WiFi interface (Station or AP)
 */
-bool MDNSResponder::_sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    bool bResult = false;
-
-    for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+    bool MDNSResponder::_sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
-        if (netif_is_up(pNetIf))
+        bool bResult = false;
+
+        for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
         {
-            IPAddress fromIPAddress;
-            //fromIPAddress = _getResponseMulticastInterface();
-            fromIPAddress = pNetIf->ip_addr;
-            m_pUDPContext->setMulticastInterface(fromIPAddress);
+            if (netif_is_up(pNetIf))
+            {
+                IPAddress fromIPAddress;
+                //fromIPAddress = _getResponseMulticastInterface();
+                fromIPAddress = pNetIf->ip_addr;
+                m_pUDPContext->setMulticastInterface(fromIPAddress);
 
 #ifdef MDNS_IP4_SUPPORT
-            IPAddress toMulticastAddress(DNS_MQUERY_IPV4_GROUP_INIT);
+                IPAddress toMulticastAddress(DNS_MQUERY_IPV4_GROUP_INIT);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            //TODO: set multicast address
-            IPAddress toMulticastAddress(DNS_MQUERY_IPV6_GROUP_INIT);
+                //TODO: set multicast address
+                IPAddress toMulticastAddress(DNS_MQUERY_IPV6_GROUP_INIT);
 #endif
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: Will send to '%s'.\n"), toMulticastAddress.toString().c_str()););
-            bResult = ((_prepareMDNSMessage(p_rSendParameter, fromIPAddress)) &&
-                       (m_pUDPContext->sendTimeout(toMulticastAddress, DNS_MQUERY_PORT, MDNS_UDPCONTEXT_TIMEOUT)));
-
-            DEBUG_EX_ERR(if (!bResult)
-                         {
-                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: FAILED!\n"));
-                         });
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: Will send to '%s'.\n"), toMulticastAddress.toString().c_str()););
+                bResult = ((_prepareMDNSMessage(p_rSendParameter, fromIPAddress)) && (m_pUDPContext->sendTimeout(toMulticastAddress, DNS_MQUERY_PORT, MDNS_UDPCONTEXT_TIMEOUT)));
+
+                DEBUG_EX_ERR(if (!bResult)
+                    {
+                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: FAILED!\n"));
+                    });
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_prepareMDNSMessage
 
     The MDNS message is composed in a two-step process.
@@ -154,289 +151,275 @@ bool MDNSResponder::_sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParamet
     output buffer.
 
 */
-bool MDNSResponder::_prepareMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter,
-                                        IPAddress p_IPAddress)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage\n")););
-    bool bResult = true;
-    p_rSendParameter.clearCachedNames();  // Need to remove cached names, p_SendParameter might have been used before on other interface
-
-    // Prepare header; count answers
-    stcMDNS_MsgHeader msgHeader(p_rSendParameter.m_u16ID, p_rSendParameter.m_bResponse, 0, p_rSendParameter.m_bAuthorative);
-    // If this is a response, the answers are anwers,
-    // else this is a query or probe and the answers go into auth section
-    uint16_t& ru16Answers = (p_rSendParameter.m_bResponse
-                                 ? msgHeader.m_u16ANCount
-                                 : msgHeader.m_u16NSCount);
-
-    /**
+    bool MDNSResponder::_prepareMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter,
+        IPAddress p_IPAddress)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage\n")););
+        bool bResult = true;
+        p_rSendParameter.clearCachedNames();  // Need to remove cached names, p_SendParameter might have been used before on other interface
+
+        // Prepare header; count answers
+        stcMDNS_MsgHeader msgHeader(p_rSendParameter.m_u16ID, p_rSendParameter.m_bResponse, 0, p_rSendParameter.m_bAuthorative);
+        // If this is a response, the answers are anwers,
+        // else this is a query or probe and the answers go into auth section
+        uint16_t& ru16Answers = (p_rSendParameter.m_bResponse
+                ? msgHeader.m_u16ANCount
+                : msgHeader.m_u16NSCount);
+
+        /**
         enuSequence
     */
-    enum enuSequence
-    {
-        Sequence_Count = 0,
-        Sequence_Send = 1
-    };
-
-    // Two step sequence: 'Count' and 'Send'
-    for (uint32_t sequence = Sequence_Count; ((bResult) && (sequence <= Sequence_Send)); ++sequence)
-    {
-        DEBUG_EX_INFO(
-            if (Sequence_Send == sequence)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
-                                      (unsigned)msgHeader.m_u16ID,
-                                      (unsigned)msgHeader.m_1bQR, (unsigned)msgHeader.m_4bOpcode, (unsigned)msgHeader.m_1bAA, (unsigned)msgHeader.m_1bTC, (unsigned)msgHeader.m_1bRD,
-                                      (unsigned)msgHeader.m_1bRA, (unsigned)msgHeader.m_4bRCode,
-                                      (unsigned)msgHeader.m_u16QDCount,
-                                      (unsigned)msgHeader.m_u16ANCount,
-                                      (unsigned)msgHeader.m_u16NSCount,
-                                      (unsigned)msgHeader.m_u16ARCount);
-            });
-        // Count/send
-        // Header
-        bResult = ((Sequence_Count == sequence)
-                       ? true
-                       : _writeMDNSMsgHeader(msgHeader, p_rSendParameter));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSMsgHeader FAILED!\n")););
-        // Questions
-        for (stcMDNS_RRQuestion* pQuestion = p_rSendParameter.m_pQuestions; ((bResult) && (pQuestion)); pQuestion = pQuestion->m_pNext)
-        {
-            ((Sequence_Count == sequence)
-                 ? ++msgHeader.m_u16QDCount
-                 : (bResult = _writeMDNSQuestion(*pQuestion, p_rSendParameter)));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSQuestion FAILED!\n")););
-        }
-
-        // Answers and authoritative answers
-#ifdef MDNS_IP4_SUPPORT
-        if ((bResult) &&
-            (p_rSendParameter.m_u8HostReplyMask & ContentFlag_A))
-        {
-            ((Sequence_Count == sequence)
-                 ? ++ru16Answers
-                 : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(A) FAILED!\n")););
-        }
-        if ((bResult) &&
-            (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP4))
-        {
-            ((Sequence_Count == sequence)
-                 ? ++ru16Answers
-                 : (bResult = _writeMDNSAnswer_PTR_IP4(p_IPAddress, p_rSendParameter)));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP4 FAILED!\n")););
-        }
-#endif
-#ifdef MDNS_IP6_SUPPORT
-        if ((bResult) &&
-            (p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA))
+        enum enuSequence
         {
-            ((Sequence_Count == sequence)
-                 ? ++ru16Answers
-                 : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(A) FAILED!\n")););
-        }
-        if ((bResult) &&
-            (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP6))
-        {
-            ((Sequence_Count == sequence)
-                 ? ++ru16Answers
-                 : (bResult = _writeMDNSAnswer_PTR_IP6(p_IPAddress, p_rSendParameter)));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP6 FAILED!\n")););
-        }
-#endif
+            Sequence_Count = 0,
+            Sequence_Send = 1
+        };
 
-        for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+        // Two step sequence: 'Count' and 'Send'
+        for (uint32_t sequence = Sequence_Count; ((bResult) && (sequence <= Sequence_Send)); ++sequence)
         {
-            if ((bResult) &&
-                (pService->m_u8ReplyMask & ContentFlag_PTR_TYPE))
-            {
-                ((Sequence_Count == sequence)
-                     ? ++ru16Answers
-                     : (bResult = _writeMDNSAnswer_PTR_TYPE(*pService, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_TYPE FAILED!\n")););
-            }
-            if ((bResult) &&
-                (pService->m_u8ReplyMask & ContentFlag_PTR_NAME))
+            DEBUG_EX_INFO(
+                if (Sequence_Send == sequence)
+                {
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
+                        (unsigned)msgHeader.m_u16ID,
+                        (unsigned)msgHeader.m_1bQR, (unsigned)msgHeader.m_4bOpcode, (unsigned)msgHeader.m_1bAA, (unsigned)msgHeader.m_1bTC, (unsigned)msgHeader.m_1bRD,
+                        (unsigned)msgHeader.m_1bRA, (unsigned)msgHeader.m_4bRCode,
+                        (unsigned)msgHeader.m_u16QDCount,
+                        (unsigned)msgHeader.m_u16ANCount,
+                        (unsigned)msgHeader.m_u16NSCount,
+                        (unsigned)msgHeader.m_u16ARCount);
+                });
+            // Count/send
+            // Header
+            bResult = ((Sequence_Count == sequence)
+                    ? true
+                    : _writeMDNSMsgHeader(msgHeader, p_rSendParameter));
+            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSMsgHeader FAILED!\n")););
+            // Questions
+            for (stcMDNS_RRQuestion* pQuestion = p_rSendParameter.m_pQuestions; ((bResult) && (pQuestion)); pQuestion = pQuestion->m_pNext)
             {
                 ((Sequence_Count == sequence)
-                     ? ++ru16Answers
-                     : (bResult = _writeMDNSAnswer_PTR_NAME(*pService, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_NAME FAILED!\n")););
+                        ? ++msgHeader.m_u16QDCount
+                        : (bResult = _writeMDNSQuestion(*pQuestion, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSQuestion FAILED!\n")););
             }
-            if ((bResult) &&
-                (pService->m_u8ReplyMask & ContentFlag_SRV))
+
+            // Answers and authoritative answers
+#ifdef MDNS_IP4_SUPPORT
+            if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_A))
             {
                 ((Sequence_Count == sequence)
-                     ? ++ru16Answers
-                     : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(A) FAILED!\n")););
+                        ? ++ru16Answers
+                        : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(A) FAILED!\n")););
             }
-            if ((bResult) &&
-                (pService->m_u8ReplyMask & ContentFlag_TXT))
+            if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP4))
             {
                 ((Sequence_Count == sequence)
-                     ? ++ru16Answers
-                     : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(A) FAILED!\n")););
+                        ? ++ru16Answers
+                        : (bResult = _writeMDNSAnswer_PTR_IP4(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP4 FAILED!\n")););
             }
-        }  // for services
-
-        // Additional answers
-#ifdef MDNS_IP4_SUPPORT
-        bool bNeedsAdditionalAnswerA = false;
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        bool bNeedsAdditionalAnswerAAAA = false;
-#endif
-        for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
-        {
-            if ((bResult) &&
-                (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) &&  // If PTR_NAME is requested, AND
-                (!(pService->m_u8ReplyMask & ContentFlag_SRV)))      // NOT SRV -> add SRV as additional answer
+            if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA))
             {
                 ((Sequence_Count == sequence)
-                     ? ++msgHeader.m_u16ARCount
-                     : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(B) FAILED!\n")););
+                        ? ++ru16Answers
+                        : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(A) FAILED!\n")););
             }
-            if ((bResult) &&
-                (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) &&  // If PTR_NAME is requested, AND
-                (!(pService->m_u8ReplyMask & ContentFlag_TXT)))      // NOT TXT -> add TXT as additional answer
+            if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP6))
             {
                 ((Sequence_Count == sequence)
-                     ? ++msgHeader.m_u16ARCount
-                     : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(B) FAILED!\n")););
+                        ? ++ru16Answers
+                        : (bResult = _writeMDNSAnswer_PTR_IP6(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP6 FAILED!\n")););
             }
-            if ((pService->m_u8ReplyMask & (ContentFlag_PTR_NAME | ContentFlag_SRV)) ||     // If service instance name or SRV OR
-                (p_rSendParameter.m_u8HostReplyMask & (ContentFlag_A | ContentFlag_AAAA)))  // any host IP address is requested
+#endif
+
+            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
             {
-#ifdef MDNS_IP4_SUPPORT
-                if ((bResult) &&
-                    (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_A)))  // Add IP4 address
+                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_TYPE))
+                {
+                    ((Sequence_Count == sequence)
+                            ? ++ru16Answers
+                            : (bResult = _writeMDNSAnswer_PTR_TYPE(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_TYPE FAILED!\n")););
+                }
+                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME))
+                {
+                    ((Sequence_Count == sequence)
+                            ? ++ru16Answers
+                            : (bResult = _writeMDNSAnswer_PTR_NAME(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_NAME FAILED!\n")););
+                }
+                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_SRV))
+                {
+                    ((Sequence_Count == sequence)
+                            ? ++ru16Answers
+                            : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(A) FAILED!\n")););
+                }
+                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_TXT))
                 {
-                    bNeedsAdditionalAnswerA = true;
+                    ((Sequence_Count == sequence)
+                            ? ++ru16Answers
+                            : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(A) FAILED!\n")););
                 }
+            }  // for services
+
+            // Additional answers
+#ifdef MDNS_IP4_SUPPORT
+            bool bNeedsAdditionalAnswerA = false;
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                if ((bResult) &&
-                    (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA)))  // Add IP6 address
+            bool bNeedsAdditionalAnswerAAAA = false;
+#endif
+            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+            {
+                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) &&  // If PTR_NAME is requested, AND
+                    (!(pService->m_u8ReplyMask & ContentFlag_SRV)))                   // NOT SRV -> add SRV as additional answer
+                {
+                    ((Sequence_Count == sequence)
+                            ? ++msgHeader.m_u16ARCount
+                            : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(B) FAILED!\n")););
+                }
+                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) &&  // If PTR_NAME is requested, AND
+                    (!(pService->m_u8ReplyMask & ContentFlag_TXT)))                   // NOT TXT -> add TXT as additional answer
                 {
-                    bNeedsAdditionalAnswerAAAA = true;
+                    ((Sequence_Count == sequence)
+                            ? ++msgHeader.m_u16ARCount
+                            : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(B) FAILED!\n")););
                 }
+                if ((pService->m_u8ReplyMask & (ContentFlag_PTR_NAME | ContentFlag_SRV)) ||     // If service instance name or SRV OR
+                    (p_rSendParameter.m_u8HostReplyMask & (ContentFlag_A | ContentFlag_AAAA)))  // any host IP address is requested
+                {
+#ifdef MDNS_IP4_SUPPORT
+                    if ((bResult) && (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_A)))  // Add IP4 address
+                    {
+                        bNeedsAdditionalAnswerA = true;
+                    }
 #endif
-            }
-        }  // for services
+#ifdef MDNS_IP6_SUPPORT
+                    if ((bResult) && (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA)))  // Add IP6 address
+                    {
+                        bNeedsAdditionalAnswerAAAA = true;
+                    }
+#endif
+                }
+            }  // for services
 
-        // Answer A needed?
+            // Answer A needed?
 #ifdef MDNS_IP4_SUPPORT
-        if ((bResult) &&
-            (bNeedsAdditionalAnswerA))
-        {
-            ((Sequence_Count == sequence)
-                 ? ++msgHeader.m_u16ARCount
-                 : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(B) FAILED!\n")););
-        }
+            if ((bResult) && (bNeedsAdditionalAnswerA))
+            {
+                ((Sequence_Count == sequence)
+                        ? ++msgHeader.m_u16ARCount
+                        : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(B) FAILED!\n")););
+            }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        // Answer AAAA needed?
-        if ((bResult) &&
-            (bNeedsAdditionalAnswerAAAA))
-        {
-            ((Sequence_Count == sequence)
-                 ? ++msgHeader.m_u16ARCount
-                 : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(B) FAILED!\n")););
-        }
+            // Answer AAAA needed?
+            if ((bResult) && (bNeedsAdditionalAnswerAAAA))
+            {
+                ((Sequence_Count == sequence)
+                        ? ++msgHeader.m_u16ARCount
+                        : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(B) FAILED!\n")););
+            }
 #endif
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: Loop %i FAILED!\n"), sequence););
-    }  // for sequence
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: FAILED!\n")););
-    return bResult;
-}
+            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: Loop %i FAILED!\n"), sequence););
+        }  // for sequence
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_sendMDNSServiceQuery
 
     Creates and sends a PTR query for the given service domain.
 
 */
-bool MDNSResponder::_sendMDNSServiceQuery(const MDNSResponder::stcMDNSServiceQuery& p_ServiceQuery)
-{
-    return _sendMDNSQuery(p_ServiceQuery.m_ServiceTypeDomain, DNS_RRTYPE_PTR);
-}
+    bool MDNSResponder::_sendMDNSServiceQuery(const MDNSResponder::stcMDNSServiceQuery& p_ServiceQuery)
+    {
+        return _sendMDNSQuery(p_ServiceQuery.m_ServiceTypeDomain, DNS_RRTYPE_PTR);
+    }
 
-/*
+    /*
     MDNSResponder::_sendMDNSQuery
 
     Creates and sends a query for the given domain and query type.
 
 */
-bool MDNSResponder::_sendMDNSQuery(const MDNSResponder::stcMDNS_RRDomain& p_QueryDomain,
-                                   uint16_t p_u16QueryType,
-                                   stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers /*= 0*/)
-{
-    bool bResult = false;
-
-    stcMDNSSendParameter sendParameter;
-    if (0 != ((sendParameter.m_pQuestions = new stcMDNS_RRQuestion)))
+    bool MDNSResponder::_sendMDNSQuery(const MDNSResponder::stcMDNS_RRDomain& p_QueryDomain,
+        uint16_t p_u16QueryType,
+        stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers /*= 0*/)
     {
-        sendParameter.m_pQuestions->m_Header.m_Domain = p_QueryDomain;
+        bool bResult = false;
 
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = p_u16QueryType;
-        // It seems, that some mDNS implementations don't support 'unicast response' questions...
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (/*0x8000 |*/ DNS_RRCLASS_IN);  // /*Unicast &*/ INternet
+        stcMDNSSendParameter sendParameter;
+        if (0 != ((sendParameter.m_pQuestions = new stcMDNS_RRQuestion)))
+        {
+            sendParameter.m_pQuestions->m_Header.m_Domain = p_QueryDomain;
 
-        // TODO: Add known answer to the query
-        (void)p_pKnownAnswers;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = p_u16QueryType;
+            // It seems, that some mDNS implementations don't support 'unicast response' questions...
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (/*0x8000 |*/ DNS_RRCLASS_IN);  // /*Unicast &*/ INternet
 
-        bResult = _sendMDNSMessage(sendParameter);
-    }  // else: FAILED to alloc question
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSQuery: FAILED to alloc question!\n")););
-    return bResult;
-}
+            // TODO: Add known answer to the query
+            (void)p_pKnownAnswers;
 
-/**
+            bResult = _sendMDNSMessage(sendParameter);
+        }  // else: FAILED to alloc question
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSQuery: FAILED to alloc question!\n")););
+        return bResult;
+    }
+
+    /**
     HELPERS
 */
 
-/**
+    /**
     RESOURCE RECORDS
 */
 
-/*
+    /*
     MDNSResponder::_readRRQuestion
 
     Reads a question (eg. MyESP._http._tcp.local ANY IN) from the UPD input buffer.
 
 */
-bool MDNSResponder::_readRRQuestion(MDNSResponder::stcMDNS_RRQuestion& p_rRRQuestion)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion\n")););
+    bool MDNSResponder::_readRRQuestion(MDNSResponder::stcMDNS_RRQuestion& p_rRRQuestion)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion\n")););
 
-    bool bResult = false;
+        bool bResult = false;
 
-    if ((bResult = _readRRHeader(p_rRRQuestion.m_Header)))
-    {
-        // Extract unicast flag from class field
-        p_rRRQuestion.m_bUnicast = (p_rRRQuestion.m_Header.m_Attributes.m_u16Class & 0x8000);
-        p_rRRQuestion.m_Header.m_Attributes.m_u16Class &= (~0x8000);
-
-        DEBUG_EX_INFO(
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion "));
-            _printRRDomain(p_rRRQuestion.m_Header.m_Domain);
-            DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X %s\n"), (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Type, (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Class, (p_rRRQuestion.m_bUnicast ? "Unicast" : "Multicast")););
+        if ((bResult = _readRRHeader(p_rRRQuestion.m_Header)))
+        {
+            // Extract unicast flag from class field
+            p_rRRQuestion.m_bUnicast = (p_rRRQuestion.m_Header.m_Attributes.m_u16Class & 0x8000);
+            p_rRRQuestion.m_Header.m_Attributes.m_u16Class &= (~0x8000);
+
+            DEBUG_EX_INFO(
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion "));
+                _printRRDomain(p_rRRQuestion.m_Header.m_Domain);
+                DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X %s\n"), (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Type, (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Class, (p_rRRQuestion.m_bUnicast ? "Unicast" : "Multicast")););
+        }
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion: FAILED!\n"));
+            });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion: FAILED!\n"));
-                 });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_readRRAnswer
 
     Reads an answer (eg. _http._tcp.local PTR OP TTL MyESP._http._tcp.local)
@@ -447,27 +430,25 @@ bool MDNSResponder::_readRRQuestion(MDNSResponder::stcMDNS_RRQuestion& p_rRRQues
     from the input buffer).
 
 */
-bool MDNSResponder::_readRRAnswer(MDNSResponder::stcMDNS_RRAnswer*& p_rpRRAnswer)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer\n")););
+    bool MDNSResponder::_readRRAnswer(MDNSResponder::stcMDNS_RRAnswer*& p_rpRRAnswer)
+    {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer\n")););
 
-    bool bResult = false;
+        bool bResult = false;
 
-    stcMDNS_RRHeader header;
-    uint32_t u32TTL;
-    uint16_t u16RDLength;
-    if ((_readRRHeader(header)) &&
-        (_udpRead32(u32TTL)) &&
-        (_udpRead16(u16RDLength)))
-    {
-        /*  DEBUG_EX_INFO(
+        stcMDNS_RRHeader header;
+        uint32_t u32TTL;
+        uint16_t u16RDLength;
+        if ((_readRRHeader(header)) && (_udpRead32(u32TTL)) && (_udpRead16(u16RDLength)))
+        {
+            /*  DEBUG_EX_INFO(
                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: Reading 0x%04X answer (class:0x%04X, TTL:%u, RDLength:%u) for "), header.m_Attributes.m_u16Type, header.m_Attributes.m_u16Class, u32TTL, u16RDLength);
                 _printRRDomain(header.m_Domain);
                 DEBUG_OUTPUT.printf_P(PSTR("\n"));
                 );*/
 
-        switch (header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
-        {
+            switch (header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
+            {
 #ifdef MDNS_IP4_SUPPORT
             case DNS_RRTYPE_A:
                 p_rpRRAnswer = new stcMDNS_RRAnswerA(header, u32TTL);
@@ -496,16 +477,15 @@ bool MDNSResponder::_readRRAnswer(MDNSResponder::stcMDNS_RRAnswer*& p_rpRRAnswer
                 p_rpRRAnswer = new stcMDNS_RRAnswerGeneric(header, u32TTL);
                 bResult = _readRRAnswerGeneric(*(stcMDNS_RRAnswerGeneric*&)p_rpRRAnswer, u16RDLength);
                 break;
-        }
-        DEBUG_EX_INFO(
-            if ((bResult) &&
-                (p_rpRRAnswer))
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: "));
-                _printRRDomain(p_rpRRAnswer->m_Header.m_Domain);
-                DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, RDLength:%u "), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type, p_rpRRAnswer->m_Header.m_Attributes.m_u16Class, p_rpRRAnswer->m_u32TTL, u16RDLength);
-                switch (header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
+            }
+            DEBUG_EX_INFO(
+                if ((bResult) && (p_rpRRAnswer))
                 {
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: "));
+                    _printRRDomain(p_rpRRAnswer->m_Header.m_Domain);
+                    DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, RDLength:%u "), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type, p_rpRRAnswer->m_Header.m_Attributes.m_u16Class, p_rpRRAnswer->m_u32TTL, u16RDLength);
+                    switch (header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
+                    {
 #ifdef MDNS_IP4_SUPPORT
                     case DNS_RRTYPE_A:
                         DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
@@ -539,233 +519,218 @@ bool MDNSResponder::_readRRAnswer(MDNSResponder::stcMDNS_RRAnswer*& p_rpRRAnswer
                     default:
                         DEBUG_OUTPUT.printf_P(PSTR("generic "));
                         break;
-                }
-                DEBUG_OUTPUT.printf_P(PSTR("\n"));
-            } else
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED to read specific answer of type 0x%04X!\n"), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type);
-            });  // DEBUG_EX_INFO
+                    }
+                    DEBUG_OUTPUT.printf_P(PSTR("\n"));
+                } else
+                {
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED to read specific answer of type 0x%04X!\n"), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type);
+                });  // DEBUG_EX_INFO
+        }
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED!\n")););
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED!\n")););
-    return bResult;
-}
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::_readRRAnswerA
 */
-bool MDNSResponder::_readRRAnswerA(MDNSResponder::stcMDNS_RRAnswerA& p_rRRAnswerA,
-                                   uint16_t p_u16RDLength)
-{
-    uint32_t u32IP4Address;
-    bool bResult = ((MDNS_IP4_SIZE == p_u16RDLength) &&
-                    (_udpReadBuffer((unsigned char*)&u32IP4Address, MDNS_IP4_SIZE)) &&
-                    ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IP4Address))));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerA: FAILED!\n")););
-    return bResult;
-}
+    bool MDNSResponder::_readRRAnswerA(MDNSResponder::stcMDNS_RRAnswerA& p_rRRAnswerA,
+        uint16_t p_u16RDLength)
+    {
+        uint32_t u32IP4Address;
+        bool bResult = ((MDNS_IP4_SIZE == p_u16RDLength) && (_udpReadBuffer((unsigned char*)&u32IP4Address, MDNS_IP4_SIZE)) && ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IP4Address))));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerA: FAILED!\n")););
+        return bResult;
+    }
 #endif
 
-/*
+    /*
     MDNSResponder::_readRRAnswerPTR
 */
-bool MDNSResponder::_readRRAnswerPTR(MDNSResponder::stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
-                                     uint16_t p_u16RDLength)
-{
-    bool bResult = ((p_u16RDLength) &&
-                    (_readRRDomain(p_rRRAnswerPTR.m_PTRDomain)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerPTR: FAILED!\n")););
-    return bResult;
-}
+    bool MDNSResponder::_readRRAnswerPTR(MDNSResponder::stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
+        uint16_t p_u16RDLength)
+    {
+        bool bResult = ((p_u16RDLength) && (_readRRDomain(p_rRRAnswerPTR.m_PTRDomain)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerPTR: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_readRRAnswerTXT
 
     Read TXT items from a buffer like 4c#=15ff=20
 */
-bool MDNSResponder::_readRRAnswerTXT(MDNSResponder::stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
-                                     uint16_t p_u16RDLength)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: RDLength:%u\n"), p_u16RDLength););
-    bool bResult = true;
-
-    p_rRRAnswerTXT.clear();
-    if (p_u16RDLength)
+    bool MDNSResponder::_readRRAnswerTXT(MDNSResponder::stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
+        uint16_t p_u16RDLength)
     {
-        bResult = false;
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: RDLength:%u\n"), p_u16RDLength););
+        bool bResult = true;
 
-        unsigned char* pucBuffer = new unsigned char[p_u16RDLength];
-        if (pucBuffer)
+        p_rRRAnswerTXT.clear();
+        if (p_u16RDLength)
         {
-            if (_udpReadBuffer(pucBuffer, p_u16RDLength))
-            {
-                bResult = true;
+            bResult = false;
 
-                const unsigned char* pucCursor = pucBuffer;
-                while ((pucCursor < (pucBuffer + p_u16RDLength)) &&
-                       (bResult))
+            unsigned char* pucBuffer = new unsigned char[p_u16RDLength];
+            if (pucBuffer)
+            {
+                if (_udpReadBuffer(pucBuffer, p_u16RDLength))
                 {
-                    bResult = false;
+                    bResult = true;
 
-                    stcMDNSServiceTxt* pTxt = 0;
-                    unsigned char ucLength = *pucCursor++;  // Length of the next txt item
-                    if (ucLength)
+                    const unsigned char* pucCursor = pucBuffer;
+                    while ((pucCursor < (pucBuffer + p_u16RDLength)) && (bResult))
                     {
-                        DEBUG_EX_INFO(
-                            static char sacBuffer[64]; *sacBuffer = 0;
-                            uint8_t u8MaxLength = ((ucLength > (sizeof(sacBuffer) - 1)) ? (sizeof(sacBuffer) - 1) : ucLength);
-                            os_strncpy(sacBuffer, (const char*)pucCursor, u8MaxLength); sacBuffer[u8MaxLength] = 0;
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: Item(%u): %s\n"), ucLength, sacBuffer););
-
-                        unsigned char* pucEqualSign = (unsigned char*)os_strchr((const char*)pucCursor, '=');  // Position of the '=' sign
-                        unsigned char ucKeyLength;
-                        if ((pucEqualSign) &&
-                            ((ucKeyLength = (pucEqualSign - pucCursor))))
+                        bResult = false;
+
+                        stcMDNSServiceTxt* pTxt = 0;
+                        unsigned char ucLength = *pucCursor++;  // Length of the next txt item
+                        if (ucLength)
                         {
-                            unsigned char ucValueLength = (ucLength - (pucEqualSign - pucCursor + 1));
-                            bResult = (((pTxt = new stcMDNSServiceTxt)) &&
-                                       (pTxt->setKey((const char*)pucCursor, ucKeyLength)) &&
-                                       (pTxt->setValue((const char*)(pucEqualSign + 1), ucValueLength)));
+                            DEBUG_EX_INFO(
+                                static char sacBuffer[64]; *sacBuffer = 0;
+                                uint8_t u8MaxLength = ((ucLength > (sizeof(sacBuffer) - 1)) ? (sizeof(sacBuffer) - 1) : ucLength);
+                                os_strncpy(sacBuffer, (const char*)pucCursor, u8MaxLength); sacBuffer[u8MaxLength] = 0;
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: Item(%u): %s\n"), ucLength, sacBuffer););
+
+                            unsigned char* pucEqualSign = (unsigned char*)os_strchr((const char*)pucCursor, '=');  // Position of the '=' sign
+                            unsigned char ucKeyLength;
+                            if ((pucEqualSign) && ((ucKeyLength = (pucEqualSign - pucCursor))))
+                            {
+                                unsigned char ucValueLength = (ucLength - (pucEqualSign - pucCursor + 1));
+                                bResult = (((pTxt = new stcMDNSServiceTxt)) && (pTxt->setKey((const char*)pucCursor, ucKeyLength)) && (pTxt->setValue((const char*)(pucEqualSign + 1), ucValueLength)));
+                            }
+                            else
+                            {
+                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: INVALID TXT format (No '=')!\n")););
+                            }
+                            pucCursor += ucLength;
                         }
-                        else
+                        else  // no/zero length TXT
                         {
-                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: INVALID TXT format (No '=')!\n")););
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: TXT answer contains no items.\n")););
+                            bResult = true;
                         }
-                        pucCursor += ucLength;
-                    }
-                    else  // no/zero length TXT
-                    {
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: TXT answer contains no items.\n")););
-                        bResult = true;
-                    }
 
-                    if ((bResult) &&
-                        (pTxt))  // Everything is fine so far
-                    {
-                        // Link TXT item to answer TXTs
-                        pTxt->m_pNext = p_rRRAnswerTXT.m_Txts.m_pTxts;
-                        p_rRRAnswerTXT.m_Txts.m_pTxts = pTxt;
-                    }
-                    else  // At least no TXT (might be OK, if length was 0) OR an error
-                    {
-                        if (!bResult)
+                        if ((bResult) && (pTxt))  // Everything is fine so far
                         {
-                            DEBUG_EX_ERR(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT item!\n"));
-                                DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
-                                _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
-                                DEBUG_OUTPUT.printf_P(PSTR("\n")););
+                            // Link TXT item to answer TXTs
+                            pTxt->m_pNext = p_rRRAnswerTXT.m_Txts.m_pTxts;
+                            p_rRRAnswerTXT.m_Txts.m_pTxts = pTxt;
                         }
-                        if (pTxt)
+                        else  // At least no TXT (might be OK, if length was 0) OR an error
                         {
-                            delete pTxt;
-                            pTxt = 0;
+                            if (!bResult)
+                            {
+                                DEBUG_EX_ERR(
+                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT item!\n"));
+                                    DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
+                                    _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
+                                    DEBUG_OUTPUT.printf_P(PSTR("\n")););
+                            }
+                            if (pTxt)
+                            {
+                                delete pTxt;
+                                pTxt = 0;
+                            }
+                            p_rRRAnswerTXT.clear();
                         }
-                        p_rRRAnswerTXT.clear();
-                    }
-                }  // while
+                    }  // while
 
-                DEBUG_EX_ERR(
-                    if (!bResult)  // Some failure
-                    {
-                        DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
-                        _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
-                        DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                    });
+                    DEBUG_EX_ERR(
+                        if (!bResult)  // Some failure
+                        {
+                            DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
+                            _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
+                            DEBUG_OUTPUT.printf_P(PSTR("\n"));
+                        });
+                }
+                else
+                {
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT content!\n")););
+                }
+                // Clean up
+                delete[] pucBuffer;
             }
             else
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT content!\n")););
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to alloc buffer for TXT content!\n")););
             }
-            // Clean up
-            delete[] pucBuffer;
         }
         else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to alloc buffer for TXT content!\n")););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: WARNING! No content!\n")););
         }
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED!\n")););
+        return bResult;
     }
-    else
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: WARNING! No content!\n")););
-    }
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED!\n")););
-    return bResult;
-}
 
 #ifdef MDNS_IP6_SUPPORT
-bool MDNSResponder::_readRRAnswerAAAA(MDNSResponder::stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
-                                      uint16_t p_u16RDLength)
-{
-    bool bResult = false;
-    // TODO: Implement
-    return bResult;
-}
+    bool MDNSResponder::_readRRAnswerAAAA(MDNSResponder::stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
+        uint16_t p_u16RDLength)
+    {
+        bool bResult = false;
+        // TODO: Implement
+        return bResult;
+    }
 #endif
 
-/*
+    /*
     MDNSResponder::_readRRAnswerSRV
 */
-bool MDNSResponder::_readRRAnswerSRV(MDNSResponder::stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
-                                     uint16_t p_u16RDLength)
-{
-    bool bResult = (((3 * sizeof(uint16_t)) < p_u16RDLength) &&
-                    (_udpRead16(p_rRRAnswerSRV.m_u16Priority)) &&
-                    (_udpRead16(p_rRRAnswerSRV.m_u16Weight)) &&
-                    (_udpRead16(p_rRRAnswerSRV.m_u16Port)) &&
-                    (_readRRDomain(p_rRRAnswerSRV.m_SRVDomain)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerSRV: FAILED!\n")););
-    return bResult;
-}
+    bool MDNSResponder::_readRRAnswerSRV(MDNSResponder::stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
+        uint16_t p_u16RDLength)
+    {
+        bool bResult = (((3 * sizeof(uint16_t)) < p_u16RDLength) && (_udpRead16(p_rRRAnswerSRV.m_u16Priority)) && (_udpRead16(p_rRRAnswerSRV.m_u16Weight)) && (_udpRead16(p_rRRAnswerSRV.m_u16Port)) && (_readRRDomain(p_rRRAnswerSRV.m_SRVDomain)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerSRV: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_readRRAnswerGeneric
 */
-bool MDNSResponder::_readRRAnswerGeneric(MDNSResponder::stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
-                                         uint16_t p_u16RDLength)
-{
-    bool bResult = (0 == p_u16RDLength);
-
-    p_rRRAnswerGeneric.clear();
-    if (((p_rRRAnswerGeneric.m_u16RDLength = p_u16RDLength)) &&
-        ((p_rRRAnswerGeneric.m_pu8RDData = new unsigned char[p_rRRAnswerGeneric.m_u16RDLength])))
+    bool MDNSResponder::_readRRAnswerGeneric(MDNSResponder::stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
+        uint16_t p_u16RDLength)
     {
-        bResult = _udpReadBuffer(p_rRRAnswerGeneric.m_pu8RDData, p_rRRAnswerGeneric.m_u16RDLength);
+        bool bResult = (0 == p_u16RDLength);
+
+        p_rRRAnswerGeneric.clear();
+        if (((p_rRRAnswerGeneric.m_u16RDLength = p_u16RDLength)) && ((p_rRRAnswerGeneric.m_pu8RDData = new unsigned char[p_rRRAnswerGeneric.m_u16RDLength])))
+        {
+            bResult = _udpReadBuffer(p_rRRAnswerGeneric.m_pu8RDData, p_rRRAnswerGeneric.m_u16RDLength);
+        }
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerGeneric: FAILED!\n")););
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerGeneric: FAILED!\n")););
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_readRRHeader
 */
-bool MDNSResponder::_readRRHeader(MDNSResponder::stcMDNS_RRHeader& p_rRRHeader)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader\n")););
+    bool MDNSResponder::_readRRHeader(MDNSResponder::stcMDNS_RRHeader& p_rRRHeader)
+    {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader\n")););
 
-    bool bResult = ((_readRRDomain(p_rRRHeader.m_Domain)) &&
-                    (_readRRAttributes(p_rRRHeader.m_Attributes)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader: FAILED!\n")););
-    return bResult;
-}
+        bool bResult = ((_readRRDomain(p_rRRHeader.m_Domain)) && (_readRRAttributes(p_rRRHeader.m_Attributes)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_readRRDomain
 
     Reads a (maybe multilevel compressed) domain from the UDP input buffer.
 
 */
-bool MDNSResponder::_readRRDomain(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain\n")););
+    bool MDNSResponder::_readRRDomain(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain)
+    {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain\n")););
 
-    bool bResult = ((p_rRRDomain.clear()) &&
-                    (_readRRDomain_Loop(p_rRRDomain, 0)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain: FAILED!\n")););
-    return bResult;
-}
+        bool bResult = ((p_rRRDomain.clear()) && (_readRRDomain_Loop(p_rRRDomain, 0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_readRRDomain_Loop
 
     Reads a domain from the UDP input buffer. For every compression level, the functions
@@ -773,394 +738,363 @@ bool MDNSResponder::_readRRDomain(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain)
     the maximum recursion depth is set by MDNS_DOMAIN_MAX_REDIRCTION.
 
 */
-bool MDNSResponder::_readRRDomain_Loop(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain,
-                                       uint8_t p_u8Depth)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u)\n"), p_u8Depth););
-
-    bool bResult = false;
-
-    if (MDNS_DOMAIN_MAX_REDIRCTION >= p_u8Depth)
+    bool MDNSResponder::_readRRDomain_Loop(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain,
+        uint8_t p_u8Depth)
     {
-        bResult = true;
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u)\n"), p_u8Depth););
 
-        uint8_t u8Len = 0;
-        do
+        bool bResult = false;
+
+        if (MDNS_DOMAIN_MAX_REDIRCTION >= p_u8Depth)
         {
-            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Offset:%u p0:%02x\n"), p_u8Depth, m_pUDPContext->tell(), m_pUDPContext->peek()););
-            _udpRead8(u8Len);
+            bResult = true;
 
-            if (u8Len & MDNS_DOMAIN_COMPRESS_MARK)
+            uint8_t u8Len = 0;
+            do
             {
-                // Compressed label(s)
-                uint16_t u16Offset = ((u8Len & ~MDNS_DOMAIN_COMPRESS_MARK) << 8);  // Implicit BE to LE conversion!
+                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Offset:%u p0:%02x\n"), p_u8Depth, m_pUDPContext->tell(), m_pUDPContext->peek()););
                 _udpRead8(u8Len);
-                u16Offset |= u8Len;
 
-                if (m_pUDPContext->isValidOffset(u16Offset))
+                if (u8Len & MDNS_DOMAIN_COMPRESS_MARK)
                 {
-                    size_t stCurrentPosition = m_pUDPContext->tell();  // Prepare return from recursion
+                    // Compressed label(s)
+                    uint16_t u16Offset = ((u8Len & ~MDNS_DOMAIN_COMPRESS_MARK) << 8);  // Implicit BE to LE conversion!
+                    _udpRead8(u8Len);
+                    u16Offset |= u8Len;
 
-                    //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Redirecting from %u to %u!\n"), p_u8Depth, stCurrentPosition, u16Offset););
-                    m_pUDPContext->seek(u16Offset);
-                    if (_readRRDomain_Loop(p_rRRDomain, p_u8Depth + 1))  // Do recursion
+                    if (m_pUDPContext->isValidOffset(u16Offset))
                     {
-                        //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Succeeded to read redirected label! Returning to %u\n"), p_u8Depth, stCurrentPosition););
-                        m_pUDPContext->seek(stCurrentPosition);  // Restore after recursion
+                        size_t stCurrentPosition = m_pUDPContext->tell();  // Prepare return from recursion
+
+                        //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Redirecting from %u to %u!\n"), p_u8Depth, stCurrentPosition, u16Offset););
+                        m_pUDPContext->seek(u16Offset);
+                        if (_readRRDomain_Loop(p_rRRDomain, p_u8Depth + 1))  // Do recursion
+                        {
+                            //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Succeeded to read redirected label! Returning to %u\n"), p_u8Depth, stCurrentPosition););
+                            m_pUDPContext->seek(stCurrentPosition);  // Restore after recursion
+                        }
+                        else
+                        {
+                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): FAILED to read redirected label!\n"), p_u8Depth););
+                            bResult = false;
+                        }
                     }
                     else
                     {
-                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): FAILED to read redirected label!\n"), p_u8Depth););
+                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): INVALID offset in redirection!\n"), p_u8Depth););
                         bResult = false;
                     }
+                    break;
                 }
                 else
                 {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): INVALID offset in redirection!\n"), p_u8Depth););
-                    bResult = false;
-                }
-                break;
-            }
-            else
-            {
-                // Normal (uncompressed) label (maybe '\0' only)
-                if (MDNS_DOMAIN_MAXLENGTH > (p_rRRDomain.m_u16NameLength + u8Len))
-                {
-                    // Add length byte
-                    p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength] = u8Len;
-                    ++(p_rRRDomain.m_u16NameLength);
-                    if (u8Len)  // Add name
+                    // Normal (uncompressed) label (maybe '\0' only)
+                    if (MDNS_DOMAIN_MAXLENGTH > (p_rRRDomain.m_u16NameLength + u8Len))
                     {
-                        if ((bResult = _udpReadBuffer((unsigned char*)&(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]), u8Len)))
+                        // Add length byte
+                        p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength] = u8Len;
+                        ++(p_rRRDomain.m_u16NameLength);
+                        if (u8Len)  // Add name
                         {
-                            /*  DEBUG_EX_INFO(
+                            if ((bResult = _udpReadBuffer((unsigned char*)&(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]), u8Len)))
+                            {
+                                /*  DEBUG_EX_INFO(
                                     p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength + u8Len] = 0;  // Closing '\0' for printing
                                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Domain label (%u): %s\n"), p_u8Depth, (unsigned)(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength - 1]), &(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]));
                                     );*/
 
-                            p_rRRDomain.m_u16NameLength += u8Len;
+                                p_rRRDomain.m_u16NameLength += u8Len;
+                            }
                         }
+                        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(2) offset:%u p0:%x\n"), m_pUDPContext->tell(), m_pUDPContext->peek()););
+                    }
+                    else
+                    {
+                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Domain name too long (%u + %u)!\n"), p_u8Depth, p_rRRDomain.m_u16NameLength, u8Len););
+                        bResult = false;
+                        break;
                     }
-                    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(2) offset:%u p0:%x\n"), m_pUDPContext->tell(), m_pUDPContext->peek()););
-                }
-                else
-                {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Domain name too long (%u + %u)!\n"), p_u8Depth, p_rRRDomain.m_u16NameLength, u8Len););
-                    bResult = false;
-                    break;
                 }
-            }
-        } while ((bResult) &&
-                 (0 != u8Len));
-    }
-    else
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Too many redirections!\n"), p_u8Depth););
+            } while ((bResult) && (0 != u8Len));
+        }
+        else
+        {
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Too many redirections!\n"), p_u8Depth););
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_readRRAttributes
 */
-bool MDNSResponder::_readRRAttributes(MDNSResponder::stcMDNS_RRAttributes& p_rRRAttributes)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes\n")););
+    bool MDNSResponder::_readRRAttributes(MDNSResponder::stcMDNS_RRAttributes& p_rRRAttributes)
+    {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes\n")););
 
-    bool bResult = ((_udpRead16(p_rRRAttributes.m_u16Type)) &&
-                    (_udpRead16(p_rRRAttributes.m_u16Class)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes: FAILED!\n")););
-    return bResult;
-}
+        bool bResult = ((_udpRead16(p_rRRAttributes.m_u16Type)) && (_udpRead16(p_rRRAttributes.m_u16Class)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     DOMAIN NAMES
 */
 
-/*
+    /*
     MDNSResponder::_buildDomainForHost
 
     Builds a MDNS host domain (eg. esp8266.local) for the given hostname.
 
 */
-bool MDNSResponder::_buildDomainForHost(const char* p_pcHostname,
-                                        MDNSResponder::stcMDNS_RRDomain& p_rHostDomain) const
-{
-    p_rHostDomain.clear();
-    bool bResult = ((p_pcHostname) &&
-                    (*p_pcHostname) &&
-                    (p_rHostDomain.addLabel(p_pcHostname)) &&
-                    (p_rHostDomain.addLabel(scpcLocal)) &&
-                    (p_rHostDomain.addLabel(0)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForHost: FAILED!\n")););
-    return bResult;
-}
+    bool MDNSResponder::_buildDomainForHost(const char* p_pcHostname,
+        MDNSResponder::stcMDNS_RRDomain& p_rHostDomain) const
+    {
+        p_rHostDomain.clear();
+        bool bResult = ((p_pcHostname) && (*p_pcHostname) && (p_rHostDomain.addLabel(p_pcHostname)) && (p_rHostDomain.addLabel(scpcLocal)) && (p_rHostDomain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForHost: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_buildDomainForDNSSD
 
     Builds the '_services._dns-sd._udp.local' domain.
     Used while detecting generic service enum question (DNS-SD) and answering these questions.
 
 */
-bool MDNSResponder::_buildDomainForDNSSD(MDNSResponder::stcMDNS_RRDomain& p_rDNSSDDomain) const
-{
-    p_rDNSSDDomain.clear();
-    bool bResult = ((p_rDNSSDDomain.addLabel(scpcServices, true)) &&
-                    (p_rDNSSDDomain.addLabel(scpcDNSSD, true)) &&
-                    (p_rDNSSDDomain.addLabel(scpcUDP, true)) &&
-                    (p_rDNSSDDomain.addLabel(scpcLocal)) &&
-                    (p_rDNSSDDomain.addLabel(0)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForDNSSD: FAILED!\n")););
-    return bResult;
-}
+    bool MDNSResponder::_buildDomainForDNSSD(MDNSResponder::stcMDNS_RRDomain& p_rDNSSDDomain) const
+    {
+        p_rDNSSDDomain.clear();
+        bool bResult = ((p_rDNSSDDomain.addLabel(scpcServices, true)) && (p_rDNSSDDomain.addLabel(scpcDNSSD, true)) && (p_rDNSSDDomain.addLabel(scpcUDP, true)) && (p_rDNSSDDomain.addLabel(scpcLocal)) && (p_rDNSSDDomain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForDNSSD: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_buildDomainForService
 
     Builds the domain for the given service (eg. _http._tcp.local or
     MyESP._http._tcp.local (if p_bIncludeName is set)).
 
 */
-bool MDNSResponder::_buildDomainForService(const MDNSResponder::stcMDNSService& p_Service,
-                                           bool p_bIncludeName,
-                                           MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
-{
-    p_rServiceDomain.clear();
-    bool bResult = (((!p_bIncludeName) ||
-                     (p_rServiceDomain.addLabel(p_Service.m_pcName))) &&
-                    (p_rServiceDomain.addLabel(p_Service.m_pcService, true)) &&
-                    (p_rServiceDomain.addLabel(p_Service.m_pcProtocol, true)) &&
-                    (p_rServiceDomain.addLabel(scpcLocal)) &&
-                    (p_rServiceDomain.addLabel(0)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED!\n")););
-    return bResult;
-}
+    bool MDNSResponder::_buildDomainForService(const MDNSResponder::stcMDNSService& p_Service,
+        bool p_bIncludeName,
+        MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
+    {
+        p_rServiceDomain.clear();
+        bool bResult = (((!p_bIncludeName) || (p_rServiceDomain.addLabel(p_Service.m_pcName))) && (p_rServiceDomain.addLabel(p_Service.m_pcService, true)) && (p_rServiceDomain.addLabel(p_Service.m_pcProtocol, true)) && (p_rServiceDomain.addLabel(scpcLocal)) && (p_rServiceDomain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_buildDomainForService
 
     Builds the domain for the given service properties (eg. _http._tcp.local).
     The usual prepended '_' are added, if missing in the input strings.
 
 */
-bool MDNSResponder::_buildDomainForService(const char* p_pcService,
-                                           const char* p_pcProtocol,
-                                           MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
-{
-    p_rServiceDomain.clear();
-    bool bResult = ((p_pcService) &&
-                    (p_pcProtocol) &&
-                    (p_rServiceDomain.addLabel(p_pcService, ('_' != *p_pcService))) &&
-                    (p_rServiceDomain.addLabel(p_pcProtocol, ('_' != *p_pcProtocol))) &&
-                    (p_rServiceDomain.addLabel(scpcLocal)) &&
-                    (p_rServiceDomain.addLabel(0)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED for (%s.%s)!\n"), (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
-    return bResult;
-}
+    bool MDNSResponder::_buildDomainForService(const char* p_pcService,
+        const char* p_pcProtocol,
+        MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
+    {
+        p_rServiceDomain.clear();
+        bool bResult = ((p_pcService) && (p_pcProtocol) && (p_rServiceDomain.addLabel(p_pcService, ('_' != *p_pcService))) && (p_rServiceDomain.addLabel(p_pcProtocol, ('_' != *p_pcProtocol))) && (p_rServiceDomain.addLabel(scpcLocal)) && (p_rServiceDomain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED for (%s.%s)!\n"), (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
+        return bResult;
+    }
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::_buildDomainForReverseIP4
 
     The IP4 address is stringized by printing the four address bytes into a char buffer in reverse order
     and adding 'in-addr.arpa' (eg. 012.789.456.123.in-addr.arpa).
     Used while detecting reverse IP4 questions and answering these
 */
-bool MDNSResponder::_buildDomainForReverseIP4(IPAddress p_IP4Address,
-                                              MDNSResponder::stcMDNS_RRDomain& p_rReverseIP4Domain) const
-{
-    bool bResult = true;
+    bool MDNSResponder::_buildDomainForReverseIP4(IPAddress p_IP4Address,
+        MDNSResponder::stcMDNS_RRDomain& p_rReverseIP4Domain) const
+    {
+        bool bResult = true;
 
-    p_rReverseIP4Domain.clear();
+        p_rReverseIP4Domain.clear();
 
-    char acBuffer[32];
-    for (int i = MDNS_IP4_SIZE; ((bResult) && (i >= 1)); --i)
-    {
-        itoa(p_IP4Address[i - 1], acBuffer, 10);
-        bResult = p_rReverseIP4Domain.addLabel(acBuffer);
+        char acBuffer[32];
+        for (int i = MDNS_IP4_SIZE; ((bResult) && (i >= 1)); --i)
+        {
+            itoa(p_IP4Address[i - 1], acBuffer, 10);
+            bResult = p_rReverseIP4Domain.addLabel(acBuffer);
+        }
+        bResult = ((bResult) && (p_rReverseIP4Domain.addLabel(scpcReverseIP4Domain)) && (p_rReverseIP4Domain.addLabel(scpcReverseTopDomain)) && (p_rReverseIP4Domain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForReverseIP4: FAILED!\n")););
+        return bResult;
     }
-    bResult = ((bResult) &&
-               (p_rReverseIP4Domain.addLabel(scpcReverseIP4Domain)) &&
-               (p_rReverseIP4Domain.addLabel(scpcReverseTopDomain)) &&
-               (p_rReverseIP4Domain.addLabel(0)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForReverseIP4: FAILED!\n")););
-    return bResult;
-}
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-/*
+    /*
     MDNSResponder::_buildDomainForReverseIP6
 
     Used while detecting reverse IP6 questions and answering these
 */
-bool MDNSResponder::_buildDomainForReverseIP6(IPAddress p_IP4Address,
-                                              MDNSResponder::stcMDNS_RRDomain& p_rReverseIP6Domain) const
-{
-    // TODO: Implement
-    return false;
-}
+    bool MDNSResponder::_buildDomainForReverseIP6(IPAddress p_IP4Address,
+        MDNSResponder::stcMDNS_RRDomain& p_rReverseIP6Domain) const
+    {
+        // TODO: Implement
+        return false;
+    }
 #endif
 
-/*
+    /*
     UDP
 */
 
-/*
+    /*
     MDNSResponder::_udpReadBuffer
 */
-bool MDNSResponder::_udpReadBuffer(unsigned char* p_pBuffer,
-                                   size_t p_stLength)
-{
-    bool bResult = ((m_pUDPContext) &&
-                    (true /*m_pUDPContext->getSize() > p_stLength*/) &&
-                    (p_pBuffer) &&
-                    (p_stLength) &&
-                    ((p_stLength == m_pUDPContext->read((char*)p_pBuffer, p_stLength))));
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpReadBuffer: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::_udpReadBuffer(unsigned char* p_pBuffer,
+        size_t p_stLength)
+    {
+        bool bResult = ((m_pUDPContext) && (true /*m_pUDPContext->getSize() > p_stLength*/) && (p_pBuffer) && (p_stLength) && ((p_stLength == m_pUDPContext->read((char*)p_pBuffer, p_stLength))));
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpReadBuffer: FAILED!\n"));
+            });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_udpRead8
 */
-bool MDNSResponder::_udpRead8(uint8_t& p_ru8Value)
-{
-    return _udpReadBuffer((unsigned char*)&p_ru8Value, sizeof(p_ru8Value));
-}
+    bool MDNSResponder::_udpRead8(uint8_t& p_ru8Value)
+    {
+        return _udpReadBuffer((unsigned char*)&p_ru8Value, sizeof(p_ru8Value));
+    }
 
-/*
+    /*
     MDNSResponder::_udpRead16
 */
-bool MDNSResponder::_udpRead16(uint16_t& p_ru16Value)
-{
-    bool bResult = false;
-
-    if (_udpReadBuffer((unsigned char*)&p_ru16Value, sizeof(p_ru16Value)))
+    bool MDNSResponder::_udpRead16(uint16_t& p_ru16Value)
     {
-        p_ru16Value = lwip_ntohs(p_ru16Value);
-        bResult = true;
+        bool bResult = false;
+
+        if (_udpReadBuffer((unsigned char*)&p_ru16Value, sizeof(p_ru16Value)))
+        {
+            p_ru16Value = lwip_ntohs(p_ru16Value);
+            bResult = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_udpRead32
 */
-bool MDNSResponder::_udpRead32(uint32_t& p_ru32Value)
-{
-    bool bResult = false;
-
-    if (_udpReadBuffer((unsigned char*)&p_ru32Value, sizeof(p_ru32Value)))
+    bool MDNSResponder::_udpRead32(uint32_t& p_ru32Value)
     {
-        p_ru32Value = lwip_ntohl(p_ru32Value);
-        bResult = true;
+        bool bResult = false;
+
+        if (_udpReadBuffer((unsigned char*)&p_ru32Value, sizeof(p_ru32Value)))
+        {
+            p_ru32Value = lwip_ntohl(p_ru32Value);
+            bResult = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_udpAppendBuffer
 */
-bool MDNSResponder::_udpAppendBuffer(const unsigned char* p_pcBuffer,
-                                     size_t p_stLength)
-{
-    bool bResult = ((m_pUDPContext) &&
-                    (p_pcBuffer) &&
-                    (p_stLength) &&
-                    (p_stLength == m_pUDPContext->append((const char*)p_pcBuffer, p_stLength)));
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpAppendBuffer: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::_udpAppendBuffer(const unsigned char* p_pcBuffer,
+        size_t p_stLength)
+    {
+        bool bResult = ((m_pUDPContext) && (p_pcBuffer) && (p_stLength) && (p_stLength == m_pUDPContext->append((const char*)p_pcBuffer, p_stLength)));
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpAppendBuffer: FAILED!\n"));
+            });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_udpAppend8
 */
-bool MDNSResponder::_udpAppend8(uint8_t p_u8Value)
-{
-    return (_udpAppendBuffer((unsigned char*)&p_u8Value, sizeof(p_u8Value)));
-}
+    bool MDNSResponder::_udpAppend8(uint8_t p_u8Value)
+    {
+        return (_udpAppendBuffer((unsigned char*)&p_u8Value, sizeof(p_u8Value)));
+    }
 
-/*
+    /*
     MDNSResponder::_udpAppend16
 */
-bool MDNSResponder::_udpAppend16(uint16_t p_u16Value)
-{
-    p_u16Value = lwip_htons(p_u16Value);
-    return (_udpAppendBuffer((unsigned char*)&p_u16Value, sizeof(p_u16Value)));
-}
+    bool MDNSResponder::_udpAppend16(uint16_t p_u16Value)
+    {
+        p_u16Value = lwip_htons(p_u16Value);
+        return (_udpAppendBuffer((unsigned char*)&p_u16Value, sizeof(p_u16Value)));
+    }
 
-/*
+    /*
     MDNSResponder::_udpAppend32
 */
-bool MDNSResponder::_udpAppend32(uint32_t p_u32Value)
-{
-    p_u32Value = lwip_htonl(p_u32Value);
-    return (_udpAppendBuffer((unsigned char*)&p_u32Value, sizeof(p_u32Value)));
-}
+    bool MDNSResponder::_udpAppend32(uint32_t p_u32Value)
+    {
+        p_u32Value = lwip_htonl(p_u32Value);
+        return (_udpAppendBuffer((unsigned char*)&p_u32Value, sizeof(p_u32Value)));
+    }
 
 #ifdef DEBUG_ESP_MDNS_RESPONDER
-/*
+    /*
     MDNSResponder::_udpDump
 */
-bool MDNSResponder::_udpDump(bool p_bMovePointer /*= false*/)
-{
-    const uint8_t cu8BytesPerLine = 16;
+    bool MDNSResponder::_udpDump(bool p_bMovePointer /*= false*/)
+    {
+        const uint8_t cu8BytesPerLine = 16;
 
-    uint32_t u32StartPosition = m_pUDPContext->tell();
-    DEBUG_OUTPUT.println("UDP Context Dump:");
-    uint32_t u32Counter = 0;
-    uint8_t u8Byte = 0;
+        uint32_t u32StartPosition = m_pUDPContext->tell();
+        DEBUG_OUTPUT.println("UDP Context Dump:");
+        uint32_t u32Counter = 0;
+        uint8_t u8Byte = 0;
 
-    while (_udpRead8(u8Byte))
-    {
-        DEBUG_OUTPUT.printf_P(PSTR("%02x %s"), u8Byte, ((++u32Counter % cu8BytesPerLine) ? "" : "\n"));
-    }
-    DEBUG_OUTPUT.printf_P(PSTR("%sDone: %u bytes\n"), (((u32Counter) && (u32Counter % cu8BytesPerLine)) ? "\n" : ""), u32Counter);
+        while (_udpRead8(u8Byte))
+        {
+            DEBUG_OUTPUT.printf_P(PSTR("%02x %s"), u8Byte, ((++u32Counter % cu8BytesPerLine) ? "" : "\n"));
+        }
+        DEBUG_OUTPUT.printf_P(PSTR("%sDone: %u bytes\n"), (((u32Counter) && (u32Counter % cu8BytesPerLine)) ? "\n" : ""), u32Counter);
 
-    if (!p_bMovePointer)  // Restore
-    {
-        m_pUDPContext->seek(u32StartPosition);
+        if (!p_bMovePointer)  // Restore
+        {
+            m_pUDPContext->seek(u32StartPosition);
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::_udpDump
 */
-bool MDNSResponder::_udpDump(unsigned p_uOffset,
-                             unsigned p_uLength)
-{
-    if ((m_pUDPContext) &&
-        (m_pUDPContext->isValidOffset(p_uOffset)))
+    bool MDNSResponder::_udpDump(unsigned p_uOffset,
+        unsigned p_uLength)
     {
-        unsigned uCurrentPosition = m_pUDPContext->tell();  // Remember start position
-
-        m_pUDPContext->seek(p_uOffset);
-        uint8_t u8Byte;
-        for (unsigned u = 0; ((u < p_uLength) && (_udpRead8(u8Byte))); ++u)
+        if ((m_pUDPContext) && (m_pUDPContext->isValidOffset(p_uOffset)))
         {
-            DEBUG_OUTPUT.printf_P(PSTR("%02x "), u8Byte);
+            unsigned uCurrentPosition = m_pUDPContext->tell();  // Remember start position
+
+            m_pUDPContext->seek(p_uOffset);
+            uint8_t u8Byte;
+            for (unsigned u = 0; ((u < p_uLength) && (_udpRead8(u8Byte))); ++u)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("%02x "), u8Byte);
+            }
+            // Return to start position
+            m_pUDPContext->seek(uCurrentPosition);
         }
-        // Return to start position
-        m_pUDPContext->seek(uCurrentPosition);
+        return true;
     }
-    return true;
-}
 #endif
 
-/**
+    /**
     READ/WRITE MDNS STRUCTS
 */
 
-/*
+    /*
     MDNSResponder::_readMDNSMsgHeader
 
     Read a MDNS header from the UDP input buffer.
@@ -1173,31 +1107,25 @@ bool MDNSResponder::_udpDump(unsigned p_uOffset,
     In addition, bitfield memory order is undefined in C standard (GCC doesn't order them in the coded direction...), so they
     need some mapping here
 */
-bool MDNSResponder::_readMDNSMsgHeader(MDNSResponder::stcMDNS_MsgHeader& p_rMsgHeader)
-{
-    bool bResult = false;
-
-    uint8_t u8B1;
-    uint8_t u8B2;
-    if ((_udpRead16(p_rMsgHeader.m_u16ID)) &&
-        (_udpRead8(u8B1)) &&
-        (_udpRead8(u8B2)) &&
-        (_udpRead16(p_rMsgHeader.m_u16QDCount)) &&
-        (_udpRead16(p_rMsgHeader.m_u16ANCount)) &&
-        (_udpRead16(p_rMsgHeader.m_u16NSCount)) &&
-        (_udpRead16(p_rMsgHeader.m_u16ARCount)))
+    bool MDNSResponder::_readMDNSMsgHeader(MDNSResponder::stcMDNS_MsgHeader& p_rMsgHeader)
     {
-        p_rMsgHeader.m_1bQR = (u8B1 & 0x80);      // Query/Respond flag
-        p_rMsgHeader.m_4bOpcode = (u8B1 & 0x78);  // Operation code (0: Standard query, others ignored)
-        p_rMsgHeader.m_1bAA = (u8B1 & 0x04);      // Authoritative answer
-        p_rMsgHeader.m_1bTC = (u8B1 & 0x02);      // Truncation flag
-        p_rMsgHeader.m_1bRD = (u8B1 & 0x01);      // Recursion desired
+        bool bResult = false;
 
-        p_rMsgHeader.m_1bRA = (u8B2 & 0x80);     // Recursion available
-        p_rMsgHeader.m_3bZ = (u8B2 & 0x70);      // Zero
-        p_rMsgHeader.m_4bRCode = (u8B2 & 0x0F);  // Response code
+        uint8_t u8B1;
+        uint8_t u8B2;
+        if ((_udpRead16(p_rMsgHeader.m_u16ID)) && (_udpRead8(u8B1)) && (_udpRead8(u8B2)) && (_udpRead16(p_rMsgHeader.m_u16QDCount)) && (_udpRead16(p_rMsgHeader.m_u16ANCount)) && (_udpRead16(p_rMsgHeader.m_u16NSCount)) && (_udpRead16(p_rMsgHeader.m_u16ARCount)))
+        {
+            p_rMsgHeader.m_1bQR = (u8B1 & 0x80);      // Query/Respond flag
+            p_rMsgHeader.m_4bOpcode = (u8B1 & 0x78);  // Operation code (0: Standard query, others ignored)
+            p_rMsgHeader.m_1bAA = (u8B1 & 0x04);      // Authoritative answer
+            p_rMsgHeader.m_1bTC = (u8B1 & 0x02);      // Truncation flag
+            p_rMsgHeader.m_1bRD = (u8B1 & 0x01);      // Recursion desired
+
+            p_rMsgHeader.m_1bRA = (u8B2 & 0x80);     // Recursion available
+            p_rMsgHeader.m_3bZ = (u8B2 & 0x70);      // Zero
+            p_rMsgHeader.m_4bRCode = (u8B2 & 0x0F);  // Response code
 
-        /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
+            /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
                 (unsigned)p_rMsgHeader.m_u16ID,
                 (unsigned)p_rMsgHeader.m_1bQR, (unsigned)p_rMsgHeader.m_4bOpcode, (unsigned)p_rMsgHeader.m_1bAA, (unsigned)p_rMsgHeader.m_1bTC, (unsigned)p_rMsgHeader.m_1bRD,
                 (unsigned)p_rMsgHeader.m_1bRA, (unsigned)p_rMsgHeader.m_4bRCode,
@@ -1205,46 +1133,43 @@ bool MDNSResponder::_readMDNSMsgHeader(MDNSResponder::stcMDNS_MsgHeader& p_rMsgH
                 (unsigned)p_rMsgHeader.m_u16ANCount,
                 (unsigned)p_rMsgHeader.m_u16NSCount,
                 (unsigned)p_rMsgHeader.m_u16ARCount););*/
-        bResult = true;
+            bResult = true;
+        }
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: FAILED!\n"));
+            });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: FAILED!\n"));
-                 });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_write8
 */
-bool MDNSResponder::_write8(uint8_t p_u8Value,
-                            MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    return ((_udpAppend8(p_u8Value)) &&
-            (p_rSendParameter.shiftOffset(sizeof(p_u8Value))));
-}
+    bool MDNSResponder::_write8(uint8_t p_u8Value,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        return ((_udpAppend8(p_u8Value)) && (p_rSendParameter.shiftOffset(sizeof(p_u8Value))));
+    }
 
-/*
+    /*
     MDNSResponder::_write16
 */
-bool MDNSResponder::_write16(uint16_t p_u16Value,
-                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    return ((_udpAppend16(p_u16Value)) &&
-            (p_rSendParameter.shiftOffset(sizeof(p_u16Value))));
-}
+    bool MDNSResponder::_write16(uint16_t p_u16Value,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        return ((_udpAppend16(p_u16Value)) && (p_rSendParameter.shiftOffset(sizeof(p_u16Value))));
+    }
 
-/*
+    /*
     MDNSResponder::_write32
 */
-bool MDNSResponder::_write32(uint32_t p_u32Value,
-                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    return ((_udpAppend32(p_u32Value)) &&
-            (p_rSendParameter.shiftOffset(sizeof(p_u32Value))));
-}
+    bool MDNSResponder::_write32(uint32_t p_u32Value,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        return ((_udpAppend32(p_u32Value)) && (p_rSendParameter.shiftOffset(sizeof(p_u32Value))));
+    }
 
-/*
+    /*
     MDNSResponder::_writeMDNSMsgHeader
 
     Write MDNS header to the UDP output buffer.
@@ -1253,10 +1178,10 @@ bool MDNSResponder::_write32(uint32_t p_u32Value,
     In addition, bitfield memory order is undefined in C standard (GCC doesn't order them in the coded direction...), so they
     need some mapping here
 */
-bool MDNSResponder::_writeMDNSMsgHeader(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader,
-                                        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
+    bool MDNSResponder::_writeMDNSMsgHeader(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
             (unsigned)p_MsgHeader.m_u16ID,
             (unsigned)p_MsgHeader.m_1bQR, (unsigned)p_MsgHeader.m_4bOpcode, (unsigned)p_MsgHeader.m_1bAA, (unsigned)p_MsgHeader.m_1bTC, (unsigned)p_MsgHeader.m_1bRD,
             (unsigned)p_MsgHeader.m_1bRA, (unsigned)p_MsgHeader.m_4bRCode,
@@ -1265,56 +1190,48 @@ bool MDNSResponder::_writeMDNSMsgHeader(const MDNSResponder::stcMDNS_MsgHeader&
             (unsigned)p_MsgHeader.m_u16NSCount,
             (unsigned)p_MsgHeader.m_u16ARCount););*/
 
-    uint8_t u8B1((p_MsgHeader.m_1bQR << 7) | (p_MsgHeader.m_4bOpcode << 3) | (p_MsgHeader.m_1bAA << 2) | (p_MsgHeader.m_1bTC << 1) | (p_MsgHeader.m_1bRD));
-    uint8_t u8B2((p_MsgHeader.m_1bRA << 7) | (p_MsgHeader.m_3bZ << 4) | (p_MsgHeader.m_4bRCode));
-    bool bResult = ((_write16(p_MsgHeader.m_u16ID, p_rSendParameter)) &&
-                    (_write8(u8B1, p_rSendParameter)) &&
-                    (_write8(u8B2, p_rSendParameter)) &&
-                    (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter)) &&
-                    (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter)) &&
-                    (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter)) &&
-                    (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter)));
-
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: FAILED!\n"));
-                 });
-    return bResult;
-}
+        uint8_t u8B1((p_MsgHeader.m_1bQR << 7) | (p_MsgHeader.m_4bOpcode << 3) | (p_MsgHeader.m_1bAA << 2) | (p_MsgHeader.m_1bTC << 1) | (p_MsgHeader.m_1bRD));
+        uint8_t u8B2((p_MsgHeader.m_1bRA << 7) | (p_MsgHeader.m_3bZ << 4) | (p_MsgHeader.m_4bRCode));
+        bool bResult = ((_write16(p_MsgHeader.m_u16ID, p_rSendParameter)) && (_write8(u8B1, p_rSendParameter)) && (_write8(u8B2, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter)));
 
-/*
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: FAILED!\n"));
+            });
+        return bResult;
+    }
+
+    /*
     MDNSResponder::_writeRRAttributes
 */
-bool MDNSResponder::_writeMDNSRRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Attributes,
-                                           MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    bool bResult = ((_write16(p_Attributes.m_u16Type, p_rSendParameter)) &&
-                    (_write16(p_Attributes.m_u16Class, p_rSendParameter)));
-
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRAttributes: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSRRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Attributes,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        bool bResult = ((_write16(p_Attributes.m_u16Type, p_rSendParameter)) && (_write16(p_Attributes.m_u16Class, p_rSendParameter)));
 
-/*
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRAttributes: FAILED!\n"));
+            });
+        return bResult;
+    }
+
+    /*
     MDNSResponder::_writeMDNSRRDomain
 */
-bool MDNSResponder::_writeMDNSRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_Domain,
-                                       MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    bool bResult = ((_udpAppendBuffer((const unsigned char*)p_Domain.m_acName, p_Domain.m_u16NameLength)) &&
-                    (p_rSendParameter.shiftOffset(p_Domain.m_u16NameLength)));
-
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRDomain: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_Domain,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        bool bResult = ((_udpAppendBuffer((const unsigned char*)p_Domain.m_acName, p_Domain.m_u16NameLength)) && (p_rSendParameter.shiftOffset(p_Domain.m_u16NameLength)));
 
-/*
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRDomain: FAILED!\n"));
+            });
+        return bResult;
+    }
+
+    /*
     MDNSResponder::_writeMDNSHostDomain
 
     Write a host domain to the UDP output buffer.
@@ -1329,36 +1246,33 @@ bool MDNSResponder::_writeMDNSRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_
     and written to the output buffer.
 
 */
-bool MDNSResponder::_writeMDNSHostDomain(const char* p_pcHostname,
-                                         bool p_bPrependRDLength,
-                                         MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
-    uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostname, false);
-
-    stcMDNS_RRDomain hostDomain;
-    bool bResult = (u16CachedDomainOffset
-                        // Found cached domain -> mark as compressed domain
-                        ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
-                           ((!p_bPrependRDLength) ||
-                            (_write16(2, p_rSendParameter))) &&                                                        // Length of 'Cxxx'
-                           (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&  // Compression mark (and offset)
-                           (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
-                        // No cached domain -> add this domain to cache and write full domain name
-                        : ((_buildDomainForHost(p_pcHostname, hostDomain)) &&  // eg. esp8266.local
-                           ((!p_bPrependRDLength) ||
-                            (_write16(hostDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
-                           (p_rSendParameter.addDomainCacheItem((const void*)p_pcHostname, false, p_rSendParameter.m_u16Offset)) &&
-                           (_writeMDNSRRDomain(hostDomain, p_rSendParameter))));
-
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSHostDomain: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSHostDomain(const char* p_pcHostname,
+        bool p_bPrependRDLength,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
+        uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostname, false);
+
+        stcMDNS_RRDomain hostDomain;
+        bool bResult = (u16CachedDomainOffset
+                // Found cached domain -> mark as compressed domain
+                ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
+                    ((!p_bPrependRDLength) || (_write16(2, p_rSendParameter))) &&                                // Length of 'Cxxx'
+                    (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&   // Compression mark (and offset)
+                    (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
+                // No cached domain -> add this domain to cache and write full domain name
+                : ((_buildDomainForHost(p_pcHostname, hostDomain)) &&                                       // eg. esp8266.local
+                    ((!p_bPrependRDLength) || (_write16(hostDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
+                    (p_rSendParameter.addDomainCacheItem((const void*)p_pcHostname, false, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(hostDomain, p_rSendParameter))));
+
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSHostDomain: FAILED!\n"));
+            });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_writeMDNSServiceDomain
 
     Write a service domain to the UDP output buffer.
@@ -1370,37 +1284,34 @@ bool MDNSResponder::_writeMDNSHostDomain(const char* p_pcHostname,
     the instance name (p_bIncludeName is set) and thoose who don't.
 
 */
-bool MDNSResponder::_writeMDNSServiceDomain(const MDNSResponder::stcMDNSService& p_Service,
-                                            bool p_bIncludeName,
-                                            bool p_bPrependRDLength,
-                                            MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
-    uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName);
-
-    stcMDNS_RRDomain serviceDomain;
-    bool bResult = (u16CachedDomainOffset
-                        // Found cached domain -> mark as compressed domain
-                        ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
-                           ((!p_bPrependRDLength) ||
-                            (_write16(2, p_rSendParameter))) &&                                                        // Length of 'Cxxx'
-                           (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&  // Compression mark (and offset)
-                           (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
-                        // No cached domain -> add this domain to cache and write full domain name
-                        : ((_buildDomainForService(p_Service, p_bIncludeName, serviceDomain)) &&  // eg. MyESP._http._tcp.local
-                           ((!p_bPrependRDLength) ||
-                            (_write16(serviceDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
-                           (p_rSendParameter.addDomainCacheItem((const void*)&p_Service, p_bIncludeName, p_rSendParameter.m_u16Offset)) &&
-                           (_writeMDNSRRDomain(serviceDomain, p_rSendParameter))));
-
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSServiceDomain: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSServiceDomain(const MDNSResponder::stcMDNSService& p_Service,
+        bool p_bIncludeName,
+        bool p_bPrependRDLength,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
+        uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName);
+
+        stcMDNS_RRDomain serviceDomain;
+        bool bResult = (u16CachedDomainOffset
+                // Found cached domain -> mark as compressed domain
+                ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
+                    ((!p_bPrependRDLength) || (_write16(2, p_rSendParameter))) &&                                // Length of 'Cxxx'
+                    (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&   // Compression mark (and offset)
+                    (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
+                // No cached domain -> add this domain to cache and write full domain name
+                : ((_buildDomainForService(p_Service, p_bIncludeName, serviceDomain)) &&                       // eg. MyESP._http._tcp.local
+                    ((!p_bPrependRDLength) || (_write16(serviceDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
+                    (p_rSendParameter.addDomainCacheItem((const void*)&p_Service, p_bIncludeName, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(serviceDomain, p_rSendParameter))));
+
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSServiceDomain: FAILED!\n"));
+            });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_writeMDNSQuestion
 
     Write a MDNS question to the UDP output buffer
@@ -1410,23 +1321,22 @@ bool MDNSResponder::_writeMDNSServiceDomain(const MDNSResponder::stcMDNSService&
     QCLASS (16bit, eg. IN)
 
 */
-bool MDNSResponder::_writeMDNSQuestion(MDNSResponder::stcMDNS_RRQuestion& p_Question,
-                                       MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion\n")););
+    bool MDNSResponder::_writeMDNSQuestion(MDNSResponder::stcMDNS_RRQuestion& p_Question,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion\n")););
 
-    bool bResult = ((_writeMDNSRRDomain(p_Question.m_Header.m_Domain, p_rSendParameter)) &&
-                    (_writeMDNSRRAttributes(p_Question.m_Header.m_Attributes, p_rSendParameter)));
+        bool bResult = ((_writeMDNSRRDomain(p_Question.m_Header.m_Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(p_Question.m_Header.m_Attributes, p_rSendParameter)));
 
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion: FAILED!\n"));
-                 });
-    return bResult;
-}
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion: FAILED!\n"));
+            });
+        return bResult;
+    }
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::_writeMDNSAnswer_A
 
     Write a MDNS A answer to the UDP output buffer.
@@ -1441,29 +1351,28 @@ bool MDNSResponder::_writeMDNSQuestion(MDNSResponder::stcMDNS_RRQuestion& p_Ques
     eg. esp8266.local A 0x8001 120 4 123.456.789.012
     Ref: http://www.zytrax.com/books/dns/ch8/a.html
 */
-bool MDNSResponder::_writeMDNSAnswer_A(IPAddress p_IPAddress,
-                                       MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A (%s)\n"), p_IPAddress.toString().c_str()););
-
-    stcMDNS_RRAttributes attributes(DNS_RRTYPE_A,
-                                    ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
-    const unsigned char aucIPAddress[MDNS_IP4_SIZE] = {p_IPAddress[0], p_IPAddress[1], p_IPAddress[2], p_IPAddress[3]};
-    bool bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) &&
-                    (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                              // TYPE & CLASS
-                    (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&  // TTL
-                    (_write16(MDNS_IP4_SIZE, p_rSendParameter)) &&                                         // RDLength
-                    (_udpAppendBuffer(aucIPAddress, MDNS_IP4_SIZE)) &&                                     // RData
-                    (p_rSendParameter.shiftOffset(MDNS_IP4_SIZE)));
-
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSAnswer_A(IPAddress p_IPAddress,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A (%s)\n"), p_IPAddress.toString().c_str()););
+
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_A,
+            ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+        const unsigned char aucIPAddress[MDNS_IP4_SIZE] = { p_IPAddress[0], p_IPAddress[1], p_IPAddress[2], p_IPAddress[3] };
+        bool bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                                   // TTL
+            (_write16(MDNS_IP4_SIZE, p_rSendParameter)) &&                                                                                          // RDLength
+            (_udpAppendBuffer(aucIPAddress, MDNS_IP4_SIZE)) &&                                                                                      // RData
+            (p_rSendParameter.shiftOffset(MDNS_IP4_SIZE)));
+
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A: FAILED!\n"));
+            });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_writeMDNSAnswer_PTR_IP4
 
     Write a MDNS reverse IP4 PTR answer to the UDP output buffer.
@@ -1472,30 +1381,29 @@ bool MDNSResponder::_writeMDNSAnswer_A(IPAddress p_IPAddress,
     eg. 012.789.456.123.in-addr.arpa PTR 0x8001 120 15 esp8266.local
     Used while answering reverse IP4 questions
 */
-bool MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress p_IPAddress,
-                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4 (%s)\n"), p_IPAddress.toString().c_str()););
-
-    stcMDNS_RRDomain reverseIP4Domain;
-    stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
-                                    ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
-    stcMDNS_RRDomain hostDomain;
-    bool bResult = ((_buildDomainForReverseIP4(p_IPAddress, reverseIP4Domain)) &&  // 012.789.456.123.in-addr.arpa
-                    (_writeMDNSRRDomain(reverseIP4Domain, p_rSendParameter)) &&
-                    (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                              // TYPE & CLASS
-                    (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&  // TTL
-                    (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                         // RDLength & RData (host domain, eg. esp8266.local)
-
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress p_IPAddress,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4 (%s)\n"), p_IPAddress.toString().c_str()););
+
+        stcMDNS_RRDomain reverseIP4Domain;
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
+            ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+        stcMDNS_RRDomain hostDomain;
+        bool bResult = ((_buildDomainForReverseIP4(p_IPAddress, reverseIP4Domain)) &&                                              // 012.789.456.123.in-addr.arpa
+            (_writeMDNSRRDomain(reverseIP4Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                  // TTL
+            (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                                                         // RDLength & RData (host domain, eg. esp8266.local)
+
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4: FAILED!\n"));
+            });
+        return bResult;
+    }
 #endif
 
-/*
+    /*
     MDNSResponder::_writeMDNSAnswer_PTR_TYPE
 
     Write a MDNS PTR answer to the UDP output buffer.
@@ -1505,28 +1413,27 @@ bool MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress p_IPAddress,
     eg. _services._dns-sd._udp.local PTR 0x8001 5400 xx _http._tcp.local
     http://www.zytrax.com/books/dns/ch8/ptr.html
 */
-bool MDNSResponder::_writeMDNSAnswer_PTR_TYPE(MDNSResponder::stcMDNSService& p_rService,
-                                              MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE\n")););
-
-    stcMDNS_RRDomain dnssdDomain;
-    stcMDNS_RRDomain serviceDomain;
-    stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);  // No cache flush! only INternet
-    bool bResult = ((_buildDomainForDNSSD(dnssdDomain)) &&            // _services._dns-sd._udp.local
-                    (_writeMDNSRRDomain(dnssdDomain, p_rSendParameter)) &&
-                    (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
-                    (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
-                    (_writeMDNSServiceDomain(p_rService, false, true, p_rSendParameter)));                    // RDLength & RData (service domain, eg. _http._tcp.local)
-
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSAnswer_PTR_TYPE(MDNSResponder::stcMDNSService& p_rService,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE\n")););
 
-/*
+        stcMDNS_RRDomain dnssdDomain;
+        stcMDNS_RRDomain serviceDomain;
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);                                                      // No cache flush! only INternet
+        bool bResult = ((_buildDomainForDNSSD(dnssdDomain)) &&                                                                // _services._dns-sd._udp.local
+            (_writeMDNSRRDomain(dnssdDomain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&                          // TTL
+            (_writeMDNSServiceDomain(p_rService, false, true, p_rSendParameter)));                                            // RDLength & RData (service domain, eg. _http._tcp.local)
+
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE: FAILED!\n"));
+            });
+        return bResult;
+    }
+
+    /*
     MDNSResponder::_writeMDNSAnswer_PTR_NAME
 
     Write a MDNS PTR answer to the UDP output buffer.
@@ -1536,25 +1443,25 @@ bool MDNSResponder::_writeMDNSAnswer_PTR_TYPE(MDNSResponder::stcMDNSService& p_r
     eg. _http.tcp.local PTR 0x8001 120 xx myESP._http._tcp.local
     http://www.zytrax.com/books/dns/ch8/ptr.html
 */
-bool MDNSResponder::_writeMDNSAnswer_PTR_NAME(MDNSResponder::stcMDNSService& p_rService,
-                                              MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME\n")););
-
-    stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);                                          // No cache flush! only INternet
-    bool bResult = ((_writeMDNSServiceDomain(p_rService, false, false, p_rSendParameter)) &&                  // _http._tcp.local
-                    (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
-                    (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
-                    (_writeMDNSServiceDomain(p_rService, true, true, p_rSendParameter)));                     // RDLength & RData (service domain, eg. MyESP._http._tcp.local)
-
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSAnswer_PTR_NAME(MDNSResponder::stcMDNSService& p_rService,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME\n")););
 
-/*
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);                              // No cache flush! only INternet
+        bool bResult = ((_writeMDNSServiceDomain(p_rService, false, false, p_rSendParameter)) &&      // _http._tcp.local
+            (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
+            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
+            (_writeMDNSServiceDomain(p_rService, true, true, p_rSendParameter)));                     // RDLength & RData (service domain, eg. MyESP._http._tcp.local)
+
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME: FAILED!\n"));
+            });
+        return bResult;
+    }
+
+    /*
     MDNSResponder::_writeMDNSAnswer_TXT
 
     Write a MDNS TXT answer to the UDP output buffer.
@@ -1565,54 +1472,49 @@ bool MDNSResponder::_writeMDNSAnswer_PTR_NAME(MDNSResponder::stcMDNSService& p_r
     eg. myESP._http._tcp.local TXT 0x8001 120 4 c#=1
     http://www.zytrax.com/books/dns/ch8/txt.html
 */
-bool MDNSResponder::_writeMDNSAnswer_TXT(MDNSResponder::stcMDNSService& p_rService,
-                                         MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT\n")););
+    bool MDNSResponder::_writeMDNSAnswer_TXT(MDNSResponder::stcMDNSService& p_rService,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT\n")););
 
-    bool bResult = false;
+        bool bResult = false;
 
-    stcMDNS_RRAttributes attributes(DNS_RRTYPE_TXT,
-                                    ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_TXT,
+            ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
 
-    if ((_collectServiceTxts(p_rService)) &&
-        (_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&                   // MyESP._http._tcp.local
-        (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
-        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
-        (_write16(p_rService.m_Txts.length(), p_rSendParameter)))                                 // RDLength
-    {
-        bResult = true;
-        // RData    Txts
-        for (stcMDNSServiceTxt* pTxt = p_rService.m_Txts.m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
+        if ((_collectServiceTxts(p_rService)) && (_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&  // MyESP._http._tcp.local
+            (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                                     // TYPE & CLASS
+            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&                      // TTL
+            (_write16(p_rService.m_Txts.length(), p_rSendParameter)))                                                     // RDLength
         {
-            unsigned char ucLengthByte = pTxt->length();
-            bResult = ((_udpAppendBuffer((unsigned char*)&ucLengthByte, sizeof(ucLengthByte))) &&  // Length
-                       (p_rSendParameter.shiftOffset(sizeof(ucLengthByte))) &&
-                       ((size_t)os_strlen(pTxt->m_pcKey) == m_pUDPContext->append(pTxt->m_pcKey, os_strlen(pTxt->m_pcKey))) &&  // Key
-                       (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcKey))) &&
-                       (1 == m_pUDPContext->append("=", 1)) &&  // =
-                       (p_rSendParameter.shiftOffset(1)) &&
-                       ((!pTxt->m_pcValue) ||
-                        (((size_t)os_strlen(pTxt->m_pcValue) == m_pUDPContext->append(pTxt->m_pcValue, os_strlen(pTxt->m_pcValue))) &&  // Value
-                         (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcValue))))));
-
-            DEBUG_EX_ERR(if (!bResult)
-                         {
-                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED to write %sTxt %s=%s!\n"), (pTxt->m_bTemp ? "temp. " : ""), (pTxt->m_pcKey ?: "?"), (pTxt->m_pcValue ?: "?"));
-                         });
+            bResult = true;
+            // RData    Txts
+            for (stcMDNSServiceTxt* pTxt = p_rService.m_Txts.m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
+            {
+                unsigned char ucLengthByte = pTxt->length();
+                bResult = ((_udpAppendBuffer((unsigned char*)&ucLengthByte, sizeof(ucLengthByte))) &&                                                                                           // Length
+                    (p_rSendParameter.shiftOffset(sizeof(ucLengthByte))) && ((size_t)os_strlen(pTxt->m_pcKey) == m_pUDPContext->append(pTxt->m_pcKey, os_strlen(pTxt->m_pcKey))) &&             // Key
+                    (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcKey))) && (1 == m_pUDPContext->append("=", 1)) &&                                                                 // =
+                    (p_rSendParameter.shiftOffset(1)) && ((!pTxt->m_pcValue) || (((size_t)os_strlen(pTxt->m_pcValue) == m_pUDPContext->append(pTxt->m_pcValue, os_strlen(pTxt->m_pcValue))) &&  // Value
+                                                              (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcValue))))));
+
+                DEBUG_EX_ERR(if (!bResult)
+                    {
+                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED to write %sTxt %s=%s!\n"), (pTxt->m_bTemp ? "temp. " : ""), (pTxt->m_pcKey ?: "?"), (pTxt->m_pcValue ?: "?"));
+                    });
+            }
         }
-    }
-    _releaseTempServiceTxts(p_rService);
+        _releaseTempServiceTxts(p_rService);
 
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED!\n"));
-                 });
-    return bResult;
-}
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED!\n"));
+            });
+        return bResult;
+    }
 
 #ifdef MDNS_IP6_SUPPORT
-/*
+    /*
     MDNSResponder::_writeMDNSAnswer_AAAA
 
     Write a MDNS AAAA answer to the UDP output buffer.
@@ -1621,27 +1523,27 @@ bool MDNSResponder::_writeMDNSAnswer_TXT(MDNSResponder::stcMDNSService& p_rServi
     eg. esp8266.local AAAA 0x8001 120 16 xxxx::xx
     http://www.zytrax.com/books/dns/ch8/aaaa.html
 */
-bool MDNSResponder::_writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
-                                          MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA\n")););
-
-    stcMDNS_RRAttributes attributes(DNS_RRTYPE_AAAA,
-                                    ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));          // Cache flush? & INternet
-    bool bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) &&                            // esp8266.local
-                    (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                   // TYPE & CLASS
-                    (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&       // TTL
-                    (_write16(MDNS_IP6_SIZE, p_rSendParameter)) &&                                              // RDLength
-                    (false /*TODO: IP6 version of: _udpAppendBuffer((uint32_t)p_IPAddress, MDNS_IP4_SIZE)*/));  // RData
-
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA\n")););
 
-/*
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_AAAA,
+            ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));                          // Cache flush? & INternet
+        bool bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) &&                // esp8266.local
+            (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                   // TYPE & CLASS
+            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&       // TTL
+            (_write16(MDNS_IP6_SIZE, p_rSendParameter)) &&                                              // RDLength
+            (false /*TODO: IP6 version of: _udpAppendBuffer((uint32_t)p_IPAddress, MDNS_IP4_SIZE)*/));  // RData
+
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA: FAILED!\n"));
+            });
+        return bResult;
+    }
+
+    /*
     MDNSResponder::_writeMDNSAnswer_PTR_IP6
 
     Write a MDNS reverse IP6 PTR answer to the UDP output buffer.
@@ -1650,81 +1552,76 @@ bool MDNSResponder::_writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
     eg. xxxx::xx.in6.arpa PTR 0x8001 120 15 esp8266.local
     Used while answering reverse IP6 questions
 */
-bool MDNSResponder::_writeMDNSAnswer_PTR_IP6(IPAddress p_IPAddress,
-                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6\n")););
-
-    stcMDNS_RRDomain reverseIP6Domain;
-    stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
-                                    ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
-    bool bResult = ((_buildDomainForReverseIP6(p_IPAddress, reverseIP6Domain)) &&                       // xxxx::xx.ip6.arpa
-                    (_writeMDNSRRDomain(reverseIP6Domain, p_rSendParameter)) &&
-                    (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                              // TYPE & CLASS
-                    (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&  // TTL
-                    (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                         // RDLength & RData (host domain, eg. esp8266.local)
-
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSAnswer_PTR_IP6(IPAddress p_IPAddress,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6\n")););
+
+        stcMDNS_RRDomain reverseIP6Domain;
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
+            ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));                                                     // Cache flush? & INternet
+        bool bResult = ((_buildDomainForReverseIP6(p_IPAddress, reverseIP6Domain)) &&                                              // xxxx::xx.ip6.arpa
+            (_writeMDNSRRDomain(reverseIP6Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                  // TTL
+            (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                                                         // RDLength & RData (host domain, eg. esp8266.local)
+
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6: FAILED!\n"));
+            });
+        return bResult;
+    }
 #endif
 
-/*
+    /*
     MDNSResponder::_writeMDNSAnswer_SRV
 
     eg. MyESP._http.tcp.local SRV 0x8001 120 0 0 60068 esp8266.local
     http://www.zytrax.com/books/dns/ch8/srv.html ???? Include instance name ????
 */
-bool MDNSResponder::_writeMDNSAnswer_SRV(MDNSResponder::stcMDNSService& p_rService,
-                                         MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV\n")););
-
-    uint16_t u16CachedDomainOffset = (p_rSendParameter.m_bLegacyQuery
-                                          ? 0
-                                          : p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostname, false));
-
-    stcMDNS_RRAttributes attributes(DNS_RRTYPE_SRV,
-                                    ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
-    stcMDNS_RRDomain hostDomain;
-    bool bResult = ((_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&                   // MyESP._http._tcp.local
-                    (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
-                    (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
-                    (!u16CachedDomainOffset
-                         // No cache for domain name (or no compression allowed)
-                         ? ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                            (_write16((sizeof(uint16_t /*Prio*/) +  // RDLength
-                                       sizeof(uint16_t /*Weight*/) +
-                                       sizeof(uint16_t /*Port*/) +
-                                       hostDomain.m_u16NameLength),
-                                      p_rSendParameter)) &&                        // Domain length
-                            (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&     // Priority
-                            (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&       // Weight
-                            (_write16(p_rService.m_u16Port, p_rSendParameter)) &&  // Port
-                            (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostname, false, p_rSendParameter.m_u16Offset)) &&
-                            (_writeMDNSRRDomain(hostDomain, p_rSendParameter)))  // Host, eg. esp8266.local
-                         // Cache available for domain
-                         : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
-                            (_write16((sizeof(uint16_t /*Prio*/) +                                                        // RDLength
-                                       sizeof(uint16_t /*Weight*/) +
-                                       sizeof(uint16_t /*Port*/) +
-                                       2),
-                                      p_rSendParameter)) &&                                                             // Length of 'C0xx'
-                            (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&                                          // Priority
-                            (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                            // Weight
-                            (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                       // Port
-                            (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&  // Compression mark (and offset)
-                            (_write8((uint8_t)u16CachedDomainOffset, p_rSendParameter)))));                             // Offset
-
-    DEBUG_EX_ERR(if (!bResult)
-                 {
-                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV: FAILED!\n"));
-                 });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSAnswer_SRV(MDNSResponder::stcMDNSService& p_rService,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV\n")););
+
+        uint16_t u16CachedDomainOffset = (p_rSendParameter.m_bLegacyQuery
+                ? 0
+                : p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostname, false));
+
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_SRV,
+            ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+        stcMDNS_RRDomain hostDomain;
+        bool bResult = ((_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&       // MyESP._http._tcp.local
+            (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
+            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
+            (!u16CachedDomainOffset
+                    // No cache for domain name (or no compression allowed)
+                    ? ((_buildDomainForHost(m_pcHostname, hostDomain)) && (_write16((sizeof(uint16_t /*Prio*/) +  // RDLength
+                                                                                        sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + hostDomain.m_u16NameLength),
+                           p_rSendParameter))
+                        &&                                                                                                                                                            // Domain length
+                        (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&                                                                                                            // Priority
+                        (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                                                                                              // Weight
+                        (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                                                                                         // Port
+                        (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostname, false, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(hostDomain, p_rSendParameter)))  // Host, eg. esp8266.local
+                    // Cache available for domain
+                    : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
+                        (_write16((sizeof(uint16_t /*Prio*/) +                                                       // RDLength
+                                      sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + 2),
+                            p_rSendParameter))
+                        &&                                                                                          // Length of 'C0xx'
+                        (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&                                          // Priority
+                        (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                            // Weight
+                        (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                       // Port
+                        (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&  // Compression mark (and offset)
+                        (_write8((uint8_t)u16CachedDomainOffset, p_rSendParameter)))));                             // Offset
+
+        DEBUG_EX_ERR(if (!bResult)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV: FAILED!\n"));
+            });
+        return bResult;
+    }
 
 }  // namespace MDNSImplementation
 
diff --git a/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino b/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino
index 713440d73f..16139c5d22 100644
--- a/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino
+++ b/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino
@@ -21,7 +21,8 @@ void setup() {
   // start I2S at 8 kHz with 24-bits per sample
   if (!I2S.begin(I2S_PHILIPS_MODE, 8000, 24)) {
     Serial.println("Failed to initialize I2S!");
-    while (1); // do nothing
+    while (1)
+      ; // do nothing
   }
 }
 
diff --git a/libraries/I2S/examples/SimpleTone/SimpleTone.ino b/libraries/I2S/examples/SimpleTone/SimpleTone.ino
index 6959ae74ba..5825ba12ca 100644
--- a/libraries/I2S/examples/SimpleTone/SimpleTone.ino
+++ b/libraries/I2S/examples/SimpleTone/SimpleTone.ino
@@ -26,7 +26,8 @@ void setup() {
   // start I2S at the sample rate with 16-bits per sample
   if (!I2S.begin(I2S_PHILIPS_MODE, sampleRate, 16)) {
     Serial.println("Failed to initialize I2S!");
-    while (1); // do nothing
+    while (1)
+      ; // do nothing
   }
 }
 
@@ -43,4 +44,3 @@ void loop() {
   // increment the counter for the next sample
   count++;
 }
-
diff --git a/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino b/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
index 40e02087dc..b7a2f0c5e4 100644
--- a/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
+++ b/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
@@ -9,17 +9,16 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
 long timezone = 2;
 byte daysavetime = 1;
 
-
-void listDir(const char * dirname) {
+void listDir(const char* dirname) {
   Serial.printf("Listing directory: %s\n", dirname);
 
   Dir root = LittleFS.openDir(dirname);
@@ -33,15 +32,14 @@ void listDir(const char * dirname) {
     time_t cr = file.getCreationTime();
     time_t lw = file.getLastWrite();
     file.close();
-    struct tm * tmstruct = localtime(&cr);
+    struct tm* tmstruct = localtime(&cr);
     Serial.printf("    CREATION: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
     tmstruct = localtime(&lw);
     Serial.printf("  LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
   }
 }
 
-
-void readFile(const char * path) {
+void readFile(const char* path) {
   Serial.printf("Reading file: %s\n", path);
 
   File file = LittleFS.open(path, "r");
@@ -57,7 +55,7 @@ void readFile(const char * path) {
   file.close();
 }
 
-void writeFile(const char * path, const char * message) {
+void writeFile(const char* path, const char* message) {
   Serial.printf("Writing file: %s\n", path);
 
   File file = LittleFS.open(path, "w");
@@ -74,7 +72,7 @@ void writeFile(const char * path, const char * message) {
   file.close();
 }
 
-void appendFile(const char * path, const char * message) {
+void appendFile(const char* path, const char* message) {
   Serial.printf("Appending to file: %s\n", path);
 
   File file = LittleFS.open(path, "a");
@@ -90,7 +88,7 @@ void appendFile(const char * path, const char * message) {
   file.close();
 }
 
-void renameFile(const char * path1, const char * path2) {
+void renameFile(const char* path1, const char* path2) {
   Serial.printf("Renaming file %s to %s\n", path1, path2);
   if (LittleFS.rename(path1, path2)) {
     Serial.println("File renamed");
@@ -99,7 +97,7 @@ void renameFile(const char * path1, const char * path2) {
   }
 }
 
-void deleteFile(const char * path) {
+void deleteFile(const char* path) {
   Serial.printf("Deleting file: %s\n", path);
   if (LittleFS.remove(path)) {
     Serial.println("File deleted");
@@ -127,7 +125,7 @@ void setup() {
   Serial.println(WiFi.localIP());
   Serial.println("Contacting Time Server");
   configTime(3600 * timezone, daysavetime * 3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org");
-  struct tm tmstruct ;
+  struct tm tmstruct;
   delay(2000);
   tmstruct.tm_year = 0;
   getLocalTime(&tmstruct, 5000);
@@ -158,9 +156,6 @@ void setup() {
   }
   readFile("/hello.txt");
   listDir("/");
-
-
 }
 
 void loop() { }
-
diff --git a/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino b/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
index 35e0ac66e6..1c631e309c 100644
--- a/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
+++ b/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
@@ -15,7 +15,7 @@
 #define TESTSIZEKB 512
 
 // Format speed in bytes/second.  Static buffer so not re-entrant safe
-const char *rate(unsigned long start, unsigned long stop, unsigned long bytes) {
+const char* rate(unsigned long start, unsigned long stop, unsigned long bytes) {
   static char buff[64];
   if (stop == start) {
     strcpy_P(buff, PSTR("Inf b/s"));
@@ -33,7 +33,7 @@ const char *rate(unsigned long start, unsigned long stop, unsigned long bytes) {
   return buff;
 }
 
-void DoTest(FS *fs) {
+void DoTest(FS* fs) {
   if (!fs->format()) {
     Serial.printf("Unable to format(), aborting\n");
     return;
@@ -45,7 +45,7 @@ void DoTest(FS *fs) {
 
   uint8_t data[256];
   for (int i = 0; i < 256; i++) {
-    data[i] = (uint8_t) i;
+    data[i] = (uint8_t)i;
   }
 
   Serial.printf("Creating %dKB file, may take a while...\n", TESTSIZEKB);
@@ -133,7 +133,6 @@ void DoTest(FS *fs) {
   stop = millis();
   Serial.printf("==> Time to read 64KB in 1b chunks = %lu milliseconds = %s\n", stop - start, rate(start, stop, 65536));
 
-
   start = millis();
   auto dest = fs->open("/test1bw.bin", "w");
   f = fs->open("/test1b.bin", "r");
diff --git a/libraries/Netdump/examples/Netdump/Netdump.ino b/libraries/Netdump/examples/Netdump/Netdump.ino
index dbba63869b..0251fe2fd1 100644
--- a/libraries/Netdump/examples/Netdump/Netdump.ino
+++ b/libraries/Netdump/examples/Netdump/Netdump.ino
@@ -12,7 +12,7 @@ using namespace NetCapture;
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
@@ -23,9 +23,9 @@ Netdump nd;
 //FS* filesystem = &SPIFFS;
 FS* filesystem = &LittleFS;
 
-ESP8266WebServer webServer(80);    // Used for sending commands
-WiFiServer       tcpServer(8000);  // Used to show netcat option.
-File             tracefile;
+ESP8266WebServer webServer(80); // Used for sending commands
+WiFiServer tcpServer(8000); // Used to show netcat option.
+File tracefile;
 
 std::map<PacketType, int> packetCount;
 
@@ -37,25 +37,23 @@ enum class SerialOption : uint8_t {
 
 void startSerial(SerialOption option) {
   switch (option) {
-    case SerialOption::AllFull : //All Packets, show packet summary.
+    case SerialOption::AllFull: //All Packets, show packet summary.
       nd.printDump(Serial, Packet::PacketDetail::FULL);
       break;
 
-    case SerialOption::LocalNone : // Only local IP traffic, full details
+    case SerialOption::LocalNone: // Only local IP traffic, full details
       nd.printDump(Serial, Packet::PacketDetail::NONE,
-      [](Packet n) {
-        return (n.hasIP(WiFi.localIP()));
-      }
-                  );
+          [](Packet n) {
+            return (n.hasIP(WiFi.localIP()));
+          });
       break;
-    case SerialOption::HTTPChar : // Only HTTP traffic, show packet content as chars
+    case SerialOption::HTTPChar: // Only HTTP traffic, show packet content as chars
       nd.printDump(Serial, Packet::PacketDetail::CHAR,
-      [](Packet n) {
-        return (n.isHTTP());
-      }
-                  );
+          [](Packet n) {
+            return (n.isHTTP());
+          });
       break;
-    default :
+    default:
       Serial.printf("No valid SerialOption provided\r\n");
   };
 }
@@ -92,32 +90,29 @@ void setup(void) {
   filesystem->begin();
 
   webServer.on("/list",
-  []() {
-    Dir dir = filesystem->openDir("/");
-    String d = "<h1>File list</h1>";
-    while (dir.next()) {
-      d.concat("<li>" + dir.fileName() + "</li>");
-    }
-    webServer.send(200, "text.html", d);
-  }
-              );
+      []() {
+        Dir dir = filesystem->openDir("/");
+        String d = "<h1>File list</h1>";
+        while (dir.next()) {
+          d.concat("<li>" + dir.fileName() + "</li>");
+        }
+        webServer.send(200, "text.html", d);
+      });
 
   webServer.on("/req",
-  []() {
-    static int rq = 0;
-    String a = "<h1>You are connected, Number of requests = " + String(rq++) + "</h1>";
-    webServer.send(200, "text/html", a);
-  }
-              );
+      []() {
+        static int rq = 0;
+        String a = "<h1>You are connected, Number of requests = " + String(rq++) + "</h1>";
+        webServer.send(200, "text/html", a);
+      });
 
   webServer.on("/reset",
-  []() {
-    nd.reset();
-    tracefile.close();
-    tcpServer.close();
-    webServer.send(200, "text.html", "<h1>Netdump session reset</h1>");
-  }
-              );
+      []() {
+        nd.reset();
+        tracefile.close();
+        tcpServer.close();
+        webServer.send(200, "text.html", "<h1>Netdump session reset</h1>");
+      });
 
   webServer.serveStatic("/", *filesystem, "/");
   webServer.begin();
@@ -153,4 +148,3 @@ void loop(void) {
   webServer.handleClient();
   MDNS.update();
 }
-
diff --git a/libraries/Netdump/src/Netdump.cpp b/libraries/Netdump/src/Netdump.cpp
index 9e688f3ca7..57898f0ee1 100644
--- a/libraries/Netdump/src/Netdump.cpp
+++ b/libraries/Netdump/src/Netdump.cpp
@@ -68,16 +68,16 @@ void Netdump::printDump(Print& out, Packet::PacketDetail ndd, const Filter nf)
 {
     out.printf_P(PSTR("netDump starting\r\n"));
     setCallback([&out, ndd, this](const Packet& ndp)
-                { printDumpProcess(out, ndd, ndp); },
-                nf);
+        { printDumpProcess(out, ndd, ndp); },
+        nf);
 }
 
 void Netdump::fileDump(File& outfile, const Filter nf)
 {
     writePcapHeader(outfile);
     setCallback([&outfile, this](const Packet& ndp)
-                { fileDumpProcess(outfile, ndp); },
-                nf);
+        { fileDumpProcess(outfile, ndp); },
+        nf);
 }
 bool Netdump::tcpDump(WiFiServer& tcpDumpServer, const Filter nf)
 {
@@ -93,7 +93,7 @@ bool Netdump::tcpDump(WiFiServer& tcpDumpServer, const Filter nf)
     bufferIndex = 0;
 
     schedule_function([&tcpDumpServer, this, nf]()
-                      { tcpDumpLoop(tcpDumpServer, nf); });
+        { tcpDumpLoop(tcpDumpServer, nf); });
     return true;
 }
 
@@ -192,8 +192,8 @@ void Netdump::tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf)
         writePcapHeader(tcpDumpClient);
 
         setCallback([this](const Packet& ndp)
-                    { tcpDumpProcess(ndp); },
-                    nf);
+            { tcpDumpProcess(ndp); },
+            nf);
     }
     if (!tcpDumpClient || !tcpDumpClient.connected())
     {
@@ -208,7 +208,7 @@ void Netdump::tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf)
     if (tcpDumpServer.status() != CLOSED)
     {
         schedule_function([&tcpDumpServer, this, nf]()
-                          { tcpDumpLoop(tcpDumpServer, nf); });
+            { tcpDumpLoop(tcpDumpServer, nf); });
     }
 }
 
diff --git a/libraries/Netdump/src/Netdump.h b/libraries/Netdump/src/Netdump.h
index 2dead84551..34457b6e9b 100644
--- a/libraries/Netdump/src/Netdump.h
+++ b/libraries/Netdump/src/Netdump.h
@@ -36,7 +36,7 @@ using namespace experimental::CBListImplentation;
 
 class Netdump
 {
-   public:
+public:
     using Filter = std::function<bool(const Packet&)>;
     using Callback = std::function<void(const Packet&)>;
     using LwipCallback = std::function<void(int, const char*, int, int, int)>;
@@ -53,7 +53,7 @@ class Netdump
     void fileDump(File& outfile, const Filter nf = nullptr);
     bool tcpDump(WiFiServer& tcpDumpServer, const Filter nf = nullptr);
 
-   private:
+private:
     Callback netDumpCallback = nullptr;
     Filter netDumpFilter = nullptr;
 
diff --git a/libraries/Netdump/src/NetdumpIP.cpp b/libraries/Netdump/src/NetdumpIP.cpp
index f90113f47b..dd8c657111 100644
--- a/libraries/Netdump/src/NetdumpIP.cpp
+++ b/libraries/Netdump/src/NetdumpIP.cpp
@@ -294,39 +294,39 @@ bool NetdumpIP::compareIP(const IPAddress& ip) const
 {
     switch (ipv)
     {
-        case IPversion::UNSET:
-            if (ip.isSet())
-            {
-                return false;
-            }
-            else
-            {
-                return true;
-            }
-            break;
-        case IPversion::IPV4:
-            if (ip.isV6() || !ip.isSet())
-            {
-                return false;
-            }
-            else
-            {
-                return compareRaw(IPversion::IPV4, rawip, reinterpret_cast<const uint8_t*>(&ip.v4()));
-            }
-            break;
-        case IPversion::IPV6:
-            if (ip.isV4() || !ip.isSet())
-            {
-                return false;
-            }
-            else
-            {
-                return compareRaw(IPversion::IPV6, rawip, reinterpret_cast<const uint8_t*>(ip.raw6()));
-            }
-            break;
-        default:
+    case IPversion::UNSET:
+        if (ip.isSet())
+        {
+            return false;
+        }
+        else
+        {
+            return true;
+        }
+        break;
+    case IPversion::IPV4:
+        if (ip.isV6() || !ip.isSet())
+        {
+            return false;
+        }
+        else
+        {
+            return compareRaw(IPversion::IPV4, rawip, reinterpret_cast<const uint8_t*>(&ip.v4()));
+        }
+        break;
+    case IPversion::IPV6:
+        if (ip.isV4() || !ip.isSet())
+        {
             return false;
-            break;
+        }
+        else
+        {
+            return compareRaw(IPversion::IPV6, rawip, reinterpret_cast<const uint8_t*>(ip.raw6()));
+        }
+        break;
+    default:
+        return false;
+        break;
     }
 }
 
@@ -334,39 +334,39 @@ bool NetdumpIP::compareIP(const NetdumpIP& nip) const
 {
     switch (ipv)
     {
-        case IPversion::UNSET:
-            if (nip.isSet())
-            {
-                return false;
-            }
-            else
-            {
-                return true;
-            }
-            break;
-        case IPversion::IPV4:
-            if (nip.isV6() || !nip.isSet())
-            {
-                return false;
-            }
-            else
-            {
-                return compareRaw(IPversion::IPV4, rawip, nip.rawip);
-            }
-            break;
-        case IPversion::IPV6:
-            if (nip.isV4() || !nip.isSet())
-            {
-                return false;
-            }
-            else
-            {
-                return compareRaw(IPversion::IPV6, rawip, nip.rawip);
-            }
-            break;
-        default:
+    case IPversion::UNSET:
+        if (nip.isSet())
+        {
+            return false;
+        }
+        else
+        {
+            return true;
+        }
+        break;
+    case IPversion::IPV4:
+        if (nip.isV6() || !nip.isSet())
+        {
+            return false;
+        }
+        else
+        {
+            return compareRaw(IPversion::IPV4, rawip, nip.rawip);
+        }
+        break;
+    case IPversion::IPV6:
+        if (nip.isV4() || !nip.isSet())
+        {
             return false;
-            break;
+        }
+        else
+        {
+            return compareRaw(IPversion::IPV6, rawip, nip.rawip);
+        }
+        break;
+    default:
+        return false;
+        break;
     }
 }
 
diff --git a/libraries/Netdump/src/NetdumpIP.h b/libraries/Netdump/src/NetdumpIP.h
index bf93c7c940..41b1677869 100644
--- a/libraries/Netdump/src/NetdumpIP.h
+++ b/libraries/Netdump/src/NetdumpIP.h
@@ -17,7 +17,7 @@ namespace NetCapture
 {
 class NetdumpIP
 {
-   public:
+public:
     NetdumpIP();
 
     NetdumpIP(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet);
@@ -34,7 +34,7 @@ class NetdumpIP
 
     String toString();
 
-   private:
+private:
     enum class IPversion
     {
         UNSET,
@@ -43,7 +43,7 @@ class NetdumpIP
     };
     IPversion ipv = IPversion::UNSET;
 
-    uint8_t rawip[16] = {0};
+    uint8_t rawip[16] = { 0 };
 
     void setV4()
     {
@@ -83,7 +83,7 @@ class NetdumpIP
 
     size_t printTo(Print& p);
 
-   public:
+public:
     bool operator==(const IPAddress& addr) const
     {
         return compareIP(addr);
diff --git a/libraries/Netdump/src/NetdumpPacket.cpp b/libraries/Netdump/src/NetdumpPacket.cpp
index 0af8292bb2..e3243cc887 100644
--- a/libraries/Netdump/src/NetdumpPacket.cpp
+++ b/libraries/Netdump/src/NetdumpPacket.cpp
@@ -164,13 +164,13 @@ void Packet::ARPtoString(PacketDetail netdumpDetail, StreamString& sstr) const
 {
     switch (getARPType())
     {
-        case 1:
-            sstr.printf_P(PSTR("who has %s tell %s"), getIP(ETH_HDR_LEN + 24).toString().c_str(), getIP(ETH_HDR_LEN + 14).toString().c_str());
-            break;
-        case 2:
-            sstr.printf_P(PSTR("%s is at "), getIP(ETH_HDR_LEN + 14).toString().c_str());
-            MACtoString(ETH_HDR_LEN + 8, sstr);
-            break;
+    case 1:
+        sstr.printf_P(PSTR("who has %s tell %s"), getIP(ETH_HDR_LEN + 24).toString().c_str(), getIP(ETH_HDR_LEN + 14).toString().c_str());
+        break;
+    case 2:
+        sstr.printf_P(PSTR("%s is at "), getIP(ETH_HDR_LEN + 14).toString().c_str());
+        MACtoString(ETH_HDR_LEN + 8, sstr);
+        break;
     }
     sstr.printf("\r\n");
     printDetail(sstr, PSTR("           D "), &data[ETH_HDR_LEN], packetLength - ETH_HDR_LEN, netdumpDetail);
@@ -237,36 +237,36 @@ void Packet::ICMPtoString(PacketDetail, StreamString& sstr) const
     {
         switch (getIcmpType())
         {
-            case 0:
-                sstr.printf_P(PSTR("ping reply"));
-                break;
-            case 8:
-                sstr.printf_P(PSTR("ping request"));
-                break;
-            default:
-                sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType());
-                break;
+        case 0:
+            sstr.printf_P(PSTR("ping reply"));
+            break;
+        case 8:
+            sstr.printf_P(PSTR("ping request"));
+            break;
+        default:
+            sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType());
+            break;
         }
     }
     if (isIPv6())
     {
         switch (getIcmpType())
         {
-            case 129:
-                sstr.printf_P(PSTR("ping reply"));
-                break;
-            case 128:
-                sstr.printf_P(PSTR("ping request"));
-                break;
-            case 135:
-                sstr.printf_P(PSTR("Neighbour solicitation"));
-                break;
-            case 136:
-                sstr.printf_P(PSTR("Neighbour advertisement"));
-                break;
-            default:
-                sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType());
-                break;
+        case 129:
+            sstr.printf_P(PSTR("ping reply"));
+            break;
+        case 128:
+            sstr.printf_P(PSTR("ping request"));
+            break;
+        case 135:
+            sstr.printf_P(PSTR("Neighbour solicitation"));
+            break;
+        case 136:
+            sstr.printf_P(PSTR("Neighbour advertisement"));
+            break;
+        default:
+            sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType());
+            break;
         }
     }
     sstr.printf_P(PSTR("\r\n"));
@@ -276,42 +276,42 @@ void Packet::IGMPtoString(PacketDetail, StreamString& sstr) const
 {
     switch (getIgmpType())
     {
-        case 1:
-            sstr.printf_P(PSTR("Create Group Request"));
-            break;
-        case 2:
-            sstr.printf_P(PSTR("Create Group Reply"));
-            break;
-        case 3:
-            sstr.printf_P(PSTR("Join Group Request"));
-            break;
-        case 4:
-            sstr.printf_P(PSTR("Join Group Reply"));
-            break;
-        case 5:
-            sstr.printf_P(PSTR("Leave Group Request"));
-            break;
-        case 6:
-            sstr.printf_P(PSTR("Leave Group Reply"));
-            break;
-        case 7:
-            sstr.printf_P(PSTR("Confirm Group Request"));
-            break;
-        case 8:
-            sstr.printf_P(PSTR("Confirm Group Reply"));
-            break;
-        case 0x11:
-            sstr.printf_P(PSTR("Group Membership Query"));
-            break;
-        case 0x12:
-            sstr.printf_P(PSTR("IGMPv1 Membership Report"));
-            break;
-        case 0x22:
-            sstr.printf_P(PSTR("IGMPv3 Membership Report"));
-            break;
-        default:
-            sstr.printf_P(PSTR("type(0x%02x)"), getIgmpType());
-            break;
+    case 1:
+        sstr.printf_P(PSTR("Create Group Request"));
+        break;
+    case 2:
+        sstr.printf_P(PSTR("Create Group Reply"));
+        break;
+    case 3:
+        sstr.printf_P(PSTR("Join Group Request"));
+        break;
+    case 4:
+        sstr.printf_P(PSTR("Join Group Reply"));
+        break;
+    case 5:
+        sstr.printf_P(PSTR("Leave Group Request"));
+        break;
+    case 6:
+        sstr.printf_P(PSTR("Leave Group Reply"));
+        break;
+    case 7:
+        sstr.printf_P(PSTR("Confirm Group Request"));
+        break;
+    case 8:
+        sstr.printf_P(PSTR("Confirm Group Reply"));
+        break;
+    case 0x11:
+        sstr.printf_P(PSTR("Group Membership Query"));
+        break;
+    case 0x12:
+        sstr.printf_P(PSTR("IGMPv1 Membership Report"));
+        break;
+    case 0x22:
+        sstr.printf_P(PSTR("IGMPv3 Membership Report"));
+        break;
+    default:
+        sstr.printf_P(PSTR("type(0x%02x)"), getIgmpType());
+        break;
     }
     sstr.printf_P(PSTR("\r\n"));
 }
@@ -359,60 +359,60 @@ const String Packet::toString(PacketDetail netdumpDetail) const
 
     switch (thisPacketType)
     {
-        case PacketType::ARP:
-        {
-            ARPtoString(netdumpDetail, sstr);
-            break;
-        }
-        case PacketType::MDNS:
-        case PacketType::DNS:
-        {
-            DNStoString(netdumpDetail, sstr);
-            break;
-        }
-        case PacketType::SSDP:
-        case PacketType::DHCP:
-        case PacketType::WSDD:
-        case PacketType::NETBIOS:
-        case PacketType::SMB:
-        case PacketType::OTA:
-        case PacketType::UDP:
-        {
-            UDPtoString(netdumpDetail, sstr);
-            break;
-        }
-        case PacketType::TCP:
-        case PacketType::HTTP:
-        {
-            TCPtoString(netdumpDetail, sstr);
-            break;
-        }
-        case PacketType::ICMP:
-        {
-            ICMPtoString(netdumpDetail, sstr);
-            break;
-        }
-        case PacketType::IGMP:
-        {
-            IGMPtoString(netdumpDetail, sstr);
-            break;
-        }
-        case PacketType::IPv4:
-        case PacketType::IPv6:
-        {
-            IPtoString(netdumpDetail, sstr);
-            break;
-        }
-        case PacketType::UKNW:
-        {
-            UKNWtoString(netdumpDetail, sstr);
-            break;
-        }
-        default:
-        {
-            sstr.printf_P(PSTR("Non identified packet\r\n"));
-            break;
-        }
+    case PacketType::ARP:
+    {
+        ARPtoString(netdumpDetail, sstr);
+        break;
+    }
+    case PacketType::MDNS:
+    case PacketType::DNS:
+    {
+        DNStoString(netdumpDetail, sstr);
+        break;
+    }
+    case PacketType::SSDP:
+    case PacketType::DHCP:
+    case PacketType::WSDD:
+    case PacketType::NETBIOS:
+    case PacketType::SMB:
+    case PacketType::OTA:
+    case PacketType::UDP:
+    {
+        UDPtoString(netdumpDetail, sstr);
+        break;
+    }
+    case PacketType::TCP:
+    case PacketType::HTTP:
+    {
+        TCPtoString(netdumpDetail, sstr);
+        break;
+    }
+    case PacketType::ICMP:
+    {
+        ICMPtoString(netdumpDetail, sstr);
+        break;
+    }
+    case PacketType::IGMP:
+    {
+        IGMPtoString(netdumpDetail, sstr);
+        break;
+    }
+    case PacketType::IPv4:
+    case PacketType::IPv6:
+    {
+        IPtoString(netdumpDetail, sstr);
+        break;
+    }
+    case PacketType::UKNW:
+    {
+        UKNWtoString(netdumpDetail, sstr);
+        break;
+    }
+    default:
+    {
+        sstr.printf_P(PSTR("Non identified packet\r\n"));
+        break;
+    }
     }
     return sstr;
 }
diff --git a/libraries/Netdump/src/NetdumpPacket.h b/libraries/Netdump/src/NetdumpPacket.h
index f143ea832e..7d4aabf4dc 100644
--- a/libraries/Netdump/src/NetdumpPacket.h
+++ b/libraries/Netdump/src/NetdumpPacket.h
@@ -35,9 +35,14 @@ int constexpr ETH_HDR_LEN = 14;
 
 class Packet
 {
-   public:
+public:
     Packet(unsigned long msec, int n, const char* d, size_t l, int o, int s)
-        : packetTime(msec), netif_idx(n), data(d), packetLength(l), out(o), success(s)
+        : packetTime(msec)
+        , netif_idx(n)
+        , data(d)
+        , packetLength(l)
+        , out(o)
+        , success(s)
     {
         setPacketTypes();
     };
@@ -281,7 +286,7 @@ class Packet
     const PacketType packetType() const;
     const std::vector<PacketType>& allPacketTypes() const;
 
-   private:
+private:
     void setPacketType(PacketType);
     void setPacketTypes();
 
diff --git a/libraries/Netdump/src/PacketType.cpp b/libraries/Netdump/src/PacketType.cpp
index 05bf35a9f6..b2d6f84e75 100644
--- a/libraries/Netdump/src/PacketType.cpp
+++ b/libraries/Netdump/src/PacketType.cpp
@@ -17,44 +17,44 @@ String PacketType::toString() const
 {
     switch (ptype)
     {
-        case PType::ARP:
-            return PSTR("ARP");
-        case PType::IP:
-            return PSTR("IP");
-        case PType::UDP:
-            return PSTR("UDP");
-        case PType::MDNS:
-            return PSTR("MDNS");
-        case PType::DNS:
-            return PSTR("DNS");
-        case PType::SSDP:
-            return PSTR("SSDP");
-        case PType::DHCP:
-            return PSTR("DHCP");
-        case PType::WSDD:
-            return PSTR("WSDD");
-        case PType::NETBIOS:
-            return PSTR("NBIO");
-        case PType::SMB:
-            return PSTR("SMB");
-        case PType::OTA:
-            return PSTR("OTA");
-        case PType::TCP:
-            return PSTR("TCP");
-        case PType::HTTP:
-            return PSTR("HTTP");
-        case PType::ICMP:
-            return PSTR("ICMP");
-        case PType::IGMP:
-            return PSTR("IGMP");
-        case PType::IPv4:
-            return PSTR("IPv4");
-        case PType::IPv6:
-            return PSTR("IPv6");
-        case PType::UKNW:
-            return PSTR("UKNW");
-        default:
-            return PSTR("ERR");
+    case PType::ARP:
+        return PSTR("ARP");
+    case PType::IP:
+        return PSTR("IP");
+    case PType::UDP:
+        return PSTR("UDP");
+    case PType::MDNS:
+        return PSTR("MDNS");
+    case PType::DNS:
+        return PSTR("DNS");
+    case PType::SSDP:
+        return PSTR("SSDP");
+    case PType::DHCP:
+        return PSTR("DHCP");
+    case PType::WSDD:
+        return PSTR("WSDD");
+    case PType::NETBIOS:
+        return PSTR("NBIO");
+    case PType::SMB:
+        return PSTR("SMB");
+    case PType::OTA:
+        return PSTR("OTA");
+    case PType::TCP:
+        return PSTR("TCP");
+    case PType::HTTP:
+        return PSTR("HTTP");
+    case PType::ICMP:
+        return PSTR("ICMP");
+    case PType::IGMP:
+        return PSTR("IGMP");
+    case PType::IPv4:
+        return PSTR("IPv4");
+    case PType::IPv6:
+        return PSTR("IPv6");
+    case PType::UKNW:
+        return PSTR("UKNW");
+    default:
+        return PSTR("ERR");
     };
 }
 
diff --git a/libraries/Netdump/src/PacketType.h b/libraries/Netdump/src/PacketType.h
index c819f15511..36a5593ead 100644
--- a/libraries/Netdump/src/PacketType.h
+++ b/libraries/Netdump/src/PacketType.h
@@ -13,7 +13,7 @@ namespace NetCapture
 {
 class PacketType
 {
-   public:
+public:
     enum PType : int
     {
         ARP,
@@ -38,7 +38,7 @@ class PacketType
 
     PacketType();
     PacketType(PType pt)
-        : ptype(pt){};
+        : ptype(pt) {};
 
     operator PType() const
     {
@@ -51,7 +51,7 @@ class PacketType
 
     String toString() const;
 
-   private:
+private:
     PType ptype;
 };
 
diff --git a/libraries/SD/examples/Datalogger/Datalogger.ino b/libraries/SD/examples/Datalogger/Datalogger.ino
index a023b63821..d75a2e1c8e 100644
--- a/libraries/SD/examples/Datalogger/Datalogger.ino
+++ b/libraries/SD/examples/Datalogger/Datalogger.ino
@@ -69,12 +69,3 @@ void loop() {
     Serial.println("error opening datalog.txt");
   }
 }
-
-
-
-
-
-
-
-
-
diff --git a/libraries/SD/examples/DumpFile/DumpFile.ino b/libraries/SD/examples/DumpFile/DumpFile.ino
index 3574652890..038cfc1c01 100644
--- a/libraries/SD/examples/DumpFile/DumpFile.ino
+++ b/libraries/SD/examples/DumpFile/DumpFile.ino
@@ -58,4 +58,3 @@ void setup() {
 
 void loop() {
 }
-
diff --git a/libraries/SD/examples/Files/Files.ino b/libraries/SD/examples/Files/Files.ino
index 1c1b83ec20..f162837dcf 100644
--- a/libraries/SD/examples/Files/Files.ino
+++ b/libraries/SD/examples/Files/Files.ino
@@ -66,6 +66,3 @@ void setup() {
 void loop() {
   // nothing happens after setup finishes.
 }
-
-
-
diff --git a/libraries/SD/examples/ReadWrite/ReadWrite.ino b/libraries/SD/examples/ReadWrite/ReadWrite.ino
index 7aa9a40c4b..680bb33296 100644
--- a/libraries/SD/examples/ReadWrite/ReadWrite.ino
+++ b/libraries/SD/examples/ReadWrite/ReadWrite.ino
@@ -71,5 +71,3 @@ void setup() {
 void loop() {
   // nothing happens after setup
 }
-
-
diff --git a/libraries/SD/examples/listfiles/listfiles.ino b/libraries/SD/examples/listfiles/listfiles.ino
index 55478d7080..a1de460672 100644
--- a/libraries/SD/examples/listfiles/listfiles.ino
+++ b/libraries/SD/examples/listfiles/listfiles.ino
@@ -52,8 +52,8 @@ void loop() {
 void printDirectory(File dir, int numTabs) {
   while (true) {
 
-    File entry =  dir.openNextFile();
-    if (! entry) {
+    File entry = dir.openNextFile();
+    if (!entry) {
       // no more files
       break;
     }
@@ -70,7 +70,7 @@ void printDirectory(File dir, int numTabs) {
       Serial.print(entry.size(), DEC);
       time_t cr = entry.getCreationTime();
       time_t lw = entry.getLastWrite();
-      struct tm * tmstruct = localtime(&cr);
+      struct tm* tmstruct = localtime(&cr);
       Serial.printf("\tCREATION: %d-%02d-%02d %02d:%02d:%02d", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
       tmstruct = localtime(&lw);
       Serial.printf("\tLAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
diff --git a/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino b/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
index 528e52ed81..a564b3c027 100644
--- a/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
+++ b/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
@@ -18,72 +18,74 @@
 
 class ESPMaster {
   private:
-    uint8_t _ss_pin;
+  uint8_t _ss_pin;
 
   public:
-    ESPMaster(uint8_t pin): _ss_pin(pin) {}
-    void begin() {
-      pinMode(_ss_pin, OUTPUT);
-      digitalWrite(_ss_pin, HIGH);
-    }
+  ESPMaster(uint8_t pin)
+      : _ss_pin(pin) {
+  }
+  void begin() {
+    pinMode(_ss_pin, OUTPUT);
+    digitalWrite(_ss_pin, HIGH);
+  }
 
-    uint32_t readStatus() {
-      digitalWrite(_ss_pin, LOW);
-      SPI.transfer(0x04);
-      uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
-      digitalWrite(_ss_pin, HIGH);
-      return status;
-    }
+  uint32_t readStatus() {
+    digitalWrite(_ss_pin, LOW);
+    SPI.transfer(0x04);
+    uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
+    digitalWrite(_ss_pin, HIGH);
+    return status;
+  }
 
-    void writeStatus(uint32_t status) {
-      digitalWrite(_ss_pin, LOW);
-      SPI.transfer(0x01);
-      SPI.transfer(status & 0xFF);
-      SPI.transfer((status >> 8) & 0xFF);
-      SPI.transfer((status >> 16) & 0xFF);
-      SPI.transfer((status >> 24) & 0xFF);
-      digitalWrite(_ss_pin, HIGH);
-    }
+  void writeStatus(uint32_t status) {
+    digitalWrite(_ss_pin, LOW);
+    SPI.transfer(0x01);
+    SPI.transfer(status & 0xFF);
+    SPI.transfer((status >> 8) & 0xFF);
+    SPI.transfer((status >> 16) & 0xFF);
+    SPI.transfer((status >> 24) & 0xFF);
+    digitalWrite(_ss_pin, HIGH);
+  }
 
-    void readData(uint8_t * data) {
-      digitalWrite(_ss_pin, LOW);
-      SPI.transfer(0x03);
-      SPI.transfer(0x00);
-      for (uint8_t i = 0; i < 32; i++) {
-        data[i] = SPI.transfer(0);
-      }
-      digitalWrite(_ss_pin, HIGH);
+  void readData(uint8_t* data) {
+    digitalWrite(_ss_pin, LOW);
+    SPI.transfer(0x03);
+    SPI.transfer(0x00);
+    for (uint8_t i = 0; i < 32; i++) {
+      data[i] = SPI.transfer(0);
     }
+    digitalWrite(_ss_pin, HIGH);
+  }
 
-    void writeData(uint8_t * data, size_t len) {
-      uint8_t i = 0;
-      digitalWrite(_ss_pin, LOW);
-      SPI.transfer(0x02);
-      SPI.transfer(0x00);
-      while (len-- && i < 32) {
-        SPI.transfer(data[i++]);
-      }
-      while (i++ < 32) {
-        SPI.transfer(0);
-      }
-      digitalWrite(_ss_pin, HIGH);
+  void writeData(uint8_t* data, size_t len) {
+    uint8_t i = 0;
+    digitalWrite(_ss_pin, LOW);
+    SPI.transfer(0x02);
+    SPI.transfer(0x00);
+    while (len-- && i < 32) {
+      SPI.transfer(data[i++]);
     }
-
-    String readData() {
-      char data[33];
-      data[32] = 0;
-      readData((uint8_t *)data);
-      return String(data);
+    while (i++ < 32) {
+      SPI.transfer(0);
     }
+    digitalWrite(_ss_pin, HIGH);
+  }
 
-    void writeData(const char * data) {
-      writeData((uint8_t *)data, strlen(data));
-    }
+  String readData() {
+    char data[33];
+    data[32] = 0;
+    readData((uint8_t*)data);
+    return String(data);
+  }
+
+  void writeData(const char* data) {
+    writeData((uint8_t*)data, strlen(data));
+  }
 };
 
 ESPMaster esp(SS);
 
-void send(const char * message) {
+void send(const char* message) {
   Serial.print("Master: ");
   Serial.println(message);
   esp.writeData(message);
diff --git a/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino b/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
index 04c23c4502..6019e5fb54 100644
--- a/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
+++ b/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
@@ -19,76 +19,79 @@
 
 class ESPSafeMaster {
   private:
-    uint8_t _ss_pin;
-    void _pulseSS() {
-      digitalWrite(_ss_pin, HIGH);
-      delayMicroseconds(5);
-      digitalWrite(_ss_pin, LOW);
-    }
+  uint8_t _ss_pin;
+  void _pulseSS() {
+    digitalWrite(_ss_pin, HIGH);
+    delayMicroseconds(5);
+    digitalWrite(_ss_pin, LOW);
+  }
+
   public:
-    ESPSafeMaster(uint8_t pin): _ss_pin(pin) {}
-    void begin() {
-      pinMode(_ss_pin, OUTPUT);
-      _pulseSS();
-    }
+  ESPSafeMaster(uint8_t pin)
+      : _ss_pin(pin) {
+  }
+  void begin() {
+    pinMode(_ss_pin, OUTPUT);
+    _pulseSS();
+  }
 
-    uint32_t readStatus() {
-      _pulseSS();
-      SPI.transfer(0x04);
-      uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
-      _pulseSS();
-      return status;
-    }
+  uint32_t readStatus() {
+    _pulseSS();
+    SPI.transfer(0x04);
+    uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
+    _pulseSS();
+    return status;
+  }
 
-    void writeStatus(uint32_t status) {
-      _pulseSS();
-      SPI.transfer(0x01);
-      SPI.transfer(status & 0xFF);
-      SPI.transfer((status >> 8) & 0xFF);
-      SPI.transfer((status >> 16) & 0xFF);
-      SPI.transfer((status >> 24) & 0xFF);
-      _pulseSS();
-    }
+  void writeStatus(uint32_t status) {
+    _pulseSS();
+    SPI.transfer(0x01);
+    SPI.transfer(status & 0xFF);
+    SPI.transfer((status >> 8) & 0xFF);
+    SPI.transfer((status >> 16) & 0xFF);
+    SPI.transfer((status >> 24) & 0xFF);
+    _pulseSS();
+  }
 
-    void readData(uint8_t * data) {
-      _pulseSS();
-      SPI.transfer(0x03);
-      SPI.transfer(0x00);
-      for (uint8_t i = 0; i < 32; i++) {
-        data[i] = SPI.transfer(0);
-      }
-      _pulseSS();
+  void readData(uint8_t* data) {
+    _pulseSS();
+    SPI.transfer(0x03);
+    SPI.transfer(0x00);
+    for (uint8_t i = 0; i < 32; i++) {
+      data[i] = SPI.transfer(0);
     }
+    _pulseSS();
+  }
 
-    void writeData(uint8_t * data, size_t len) {
-      uint8_t i = 0;
-      _pulseSS();
-      SPI.transfer(0x02);
-      SPI.transfer(0x00);
-      while (len-- && i < 32) {
-        SPI.transfer(data[i++]);
-      }
-      while (i++ < 32) {
-        SPI.transfer(0);
-      }
-      _pulseSS();
+  void writeData(uint8_t* data, size_t len) {
+    uint8_t i = 0;
+    _pulseSS();
+    SPI.transfer(0x02);
+    SPI.transfer(0x00);
+    while (len-- && i < 32) {
+      SPI.transfer(data[i++]);
     }
-
-    String readData() {
-      char data[33];
-      data[32] = 0;
-      readData((uint8_t *)data);
-      return String(data);
+    while (i++ < 32) {
+      SPI.transfer(0);
     }
+    _pulseSS();
+  }
 
-    void writeData(const char * data) {
-      writeData((uint8_t *)data, strlen(data));
-    }
+  String readData() {
+    char data[33];
+    data[32] = 0;
+    readData((uint8_t*)data);
+    return String(data);
+  }
+
+  void writeData(const char* data) {
+    writeData((uint8_t*)data, strlen(data));
+  }
 };
 
 ESPSafeMaster esp(SS);
 
-void send(const char * message) {
+void send(const char* message) {
   Serial.print("Master: ");
   Serial.println(message);
   esp.writeData(message);
diff --git a/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino b/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
index 0be83fd298..f8b29a220d 100644
--- a/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
+++ b/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
@@ -24,9 +24,9 @@ void setup() {
   // data has been received from the master. Beware that len is always 32
   // and the buffer is autofilled with zeroes if data is less than 32 bytes long
   // It's up to the user to implement protocol for handling data length
-  SPISlave.onData([](uint8_t * data, size_t len) {
-    String message = String((char *)data);
-    (void) len;
+  SPISlave.onData([](uint8_t* data, size_t len) {
+    String message = String((char*)data);
+    (void)len;
     if (message.equals("Hello Slave!")) {
       SPISlave.setData("Hello Master!");
     } else if (message.equals("Are you alive?")) {
@@ -36,7 +36,7 @@ void setup() {
     } else {
       SPISlave.setData("Say what?");
     }
-    Serial.printf("Question: %s\n", (char *)data);
+    Serial.printf("Question: %s\n", (char*)data);
   });
 
   // The master has read out outgoing data buffer
@@ -69,4 +69,4 @@ void setup() {
   SPISlave.setData("Ask me a question!");
 }
 
-void loop() {}
+void loop() { }
diff --git a/libraries/Servo/examples/Sweep/Sweep.ino b/libraries/Servo/examples/Sweep/Sweep.ino
index 5a6bd6ef40..dd5453e647 100644
--- a/libraries/Servo/examples/Sweep/Sweep.ino
+++ b/libraries/Servo/examples/Sweep/Sweep.ino
@@ -12,12 +12,11 @@
 
 #include <Servo.h>
 
-Servo myservo;  // create servo object to control a servo
+Servo myservo; // create servo object to control a servo
 // twelve servo objects can be created on most boards
 
-
 void setup() {
-  myservo.attach(2);  // attaches the servo on GIO2 to the servo object
+  myservo.attach(2); // attaches the servo on GIO2 to the servo object
 }
 
 void loop() {
@@ -25,12 +24,11 @@ void loop() {
 
   for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
     // in steps of 1 degree
-    myservo.write(pos);              // tell servo to go to position in variable 'pos'
-    delay(15);                       // waits 15ms for the servo to reach the position
+    myservo.write(pos); // tell servo to go to position in variable 'pos'
+    delay(15); // waits 15ms for the servo to reach the position
   }
   for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
-    myservo.write(pos);              // tell servo to go to position in variable 'pos'
-    delay(15);                       // waits 15ms for the servo to reach the position
+    myservo.write(pos); // tell servo to go to position in variable 'pos'
+    delay(15); // waits 15ms for the servo to reach the position
   }
 }
-
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino b/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
index fbc22a861c..68b44cdd50 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
@@ -8,21 +8,20 @@
 #include <SPI.h>
 
 void setup() {
-  TFT_BL_ON;                                          //turn on the background light
+  TFT_BL_ON; //turn on the background light
 
-  Tft.TFTinit();                                      //init TFT library
+  Tft.TFTinit(); //init TFT library
 
-  Tft.drawCircle(100, 100, 30, YELLOW);               //center: (100, 100), r = 30 ,color : YELLOW
+  Tft.drawCircle(100, 100, 30, YELLOW); //center: (100, 100), r = 30 ,color : YELLOW
 
-  Tft.drawCircle(100, 200, 40, CYAN);                 // center: (100, 200), r = 10 ,color : CYAN
+  Tft.drawCircle(100, 200, 40, CYAN); // center: (100, 200), r = 10 ,color : CYAN
 
-  Tft.fillCircle(200, 100, 30, RED);                  //center: (200, 100), r = 30 ,color : RED
+  Tft.fillCircle(200, 100, 30, RED); //center: (200, 100), r = 30 ,color : RED
 
-  Tft.fillCircle(200, 200, 30, BLUE);                 //center: (200, 200), r = 30 ,color : BLUE
+  Tft.fillCircle(200, 200, 30, BLUE); //center: (200, 200), r = 30 ,color : BLUE
 }
 
 void loop() {
-
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino b/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
index a777044d3e..b89aa5a09a 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
@@ -8,20 +8,19 @@
 #include <TFTv2.h>
 #include <SPI.h>
 void setup() {
-  TFT_BL_ON;                                  // turn on the background light
-  Tft.TFTinit();                              //init TFT library
+  TFT_BL_ON; // turn on the background light
+  Tft.TFTinit(); //init TFT library
 
-  Tft.drawLine(0, 0, 239, 319, RED);          //start: (0, 0) end: (239, 319), color : RED
+  Tft.drawLine(0, 0, 239, 319, RED); //start: (0, 0) end: (239, 319), color : RED
 
-  Tft.drawVerticalLine(60, 100, 100, GREEN);  // Draw a vertical line
+  Tft.drawVerticalLine(60, 100, 100, GREEN); // Draw a vertical line
   // start: (60, 100) length: 100 color: green
 
-  Tft.drawHorizontalLine(30, 60, 150, BLUE);  //Draw a horizontal line
+  Tft.drawHorizontalLine(30, 60, 150, BLUE); //Draw a horizontal line
   //start: (30, 60), high: 150, color: blue
 }
 
 void loop() {
-
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino b/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
index ed62233796..ff94d9c587 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
@@ -9,28 +9,26 @@
 #include <SPI.h>
 
 void setup() {
-  TFT_BL_ON;                                      // turn on the background light
+  TFT_BL_ON; // turn on the background light
 
-  Tft.TFTinit();                                  // init TFT library
+  Tft.TFTinit(); // init TFT library
 
-  Tft.drawNumber(1024, 0, 0, 1, RED);             // draw a integer: 1024, Location: (0, 0),  size: 1, color: RED
+  Tft.drawNumber(1024, 0, 0, 1, RED); // draw a integer: 1024, Location: (0, 0),  size: 1, color: RED
 
-  Tft.drawNumber(1024, 0, 20, 2, BLUE);           // draw a integer: 1024, Location: (0, 20), size: 2, color: BLUE
+  Tft.drawNumber(1024, 0, 20, 2, BLUE); // draw a integer: 1024, Location: (0, 20), size: 2, color: BLUE
 
-  Tft.drawNumber(1024, 0, 50, 3, GREEN);          // draw a integer: 1024, Location: (0, 50), size: 3, color: GREEN
+  Tft.drawNumber(1024, 0, 50, 3, GREEN); // draw a integer: 1024, Location: (0, 50), size: 3, color: GREEN
 
-  Tft.drawNumber(1024, 0, 90, 4, BLUE);           // draw a integer: 1024, Location: (0, 90), size:4, color: BLUE
+  Tft.drawNumber(1024, 0, 90, 4, BLUE); // draw a integer: 1024, Location: (0, 90), size:4, color: BLUE
 
-  Tft.drawFloat(1.2345, 0, 150, 4, YELLOW);       // draw a float number: 1.2345, Location: (0, 150), size: 4, color: YELLOW
+  Tft.drawFloat(1.2345, 0, 150, 4, YELLOW); // draw a float number: 1.2345, Location: (0, 150), size: 4, color: YELLOW
 
-  Tft.drawFloat(1.2345, 2, 0, 200, 4, BLUE);      // draw a float number: 1.2345: Location: (0, 200), size: 4, decimal: 2, color: BLUE
-
-  Tft.drawFloat(1.2345, 4, 0, 250, 4, RED);       // draw a float number: 1.2345 Location: (0, 250), size: 4, decimal: 4, color: RED
+  Tft.drawFloat(1.2345, 2, 0, 200, 4, BLUE); // draw a float number: 1.2345: Location: (0, 200), size: 4, decimal: 2, color: BLUE
 
+  Tft.drawFloat(1.2345, 4, 0, 250, 4, RED); // draw a float number: 1.2345 Location: (0, 250), size: 4, decimal: 4, color: RED
 }
 
 void loop() {
-
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino b/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
index a2d7af8709..f7d7c91b8d 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
@@ -8,8 +8,8 @@
 #include <SPI.h>
 
 void setup() {
-  TFT_BL_ON;      // turn on the background light
-  Tft.TFTinit();  // init TFT library
+  TFT_BL_ON; // turn on the background light
+  Tft.TFTinit(); // init TFT library
 
   Tft.fillScreen(80, 160, 50, 150, RED);
   Tft.fillRectangle(30, 120, 100, 65, YELLOW);
@@ -17,7 +17,6 @@ void setup() {
 }
 
 void loop() {
-
 }
 /*********************************************************************************************************
   END FILE
diff --git a/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino b/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
index dc13088b9f..4774becf60 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
@@ -5,8 +5,8 @@
 #include <SPI.h>
 
 int ColorPaletteHigh = 30;
-int color = WHITE;  //Paint brush color
-unsigned int colors[8] = {BLACK, RED, GREEN, BLUE, CYAN, YELLOW, WHITE, GRAY1};
+int color = WHITE; //Paint brush color
+unsigned int colors[8] = { BLACK, RED, GREEN, BLUE, CYAN, YELLOW, WHITE, GRAY1 };
 
 // For better pressure precision, we need to know the resistance
 // between X+ and X- Use any multimeter to read it
@@ -15,7 +15,7 @@ unsigned int colors[8] = {BLACK, RED, GREEN, BLUE, CYAN, YELLOW, WHITE, GRAY1};
 TouchScreen ts = TouchScreen(XP, YP, XM, YM); //init TouchScreen port pins
 
 void setup() {
-  Tft.TFTinit();  //init TFT library
+  Tft.TFTinit(); //init TFT library
   Serial.begin(115200);
   //Draw the pallet
   for (int i = 0; i < 8; i++) {
diff --git a/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino b/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
index 6607a01cff..f6b2eee5b4 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
@@ -5,13 +5,13 @@
 #include <SPI.h>
 
 void setup() {
-  TFT_BL_ON;                                          // turn on the background light
-  Tft.TFTinit();                                      // init TFT library
+  TFT_BL_ON; // turn on the background light
+  Tft.TFTinit(); // init TFT library
 }
 
 void loop() {
-  for (int r = 0; r < 115; r = r + 2) {               //set r : 0--115
-    Tft.drawCircle(119, 160, r, random(0xFFFF));    //draw circle, center:(119, 160), color: random
+  for (int r = 0; r < 115; r = r + 2) { //set r : 0--115
+    Tft.drawCircle(119, 160, r, random(0xFFFF)); //draw circle, center:(119, 160), color: random
   }
   delay(10);
 }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/text/text.ino b/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
index 03308f6891..d35f100d5c 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
@@ -8,26 +8,23 @@
 #include <SPI.h>
 
 void setup() {
-  TFT_BL_ON;      // turn on the background light
-  Tft.TFTinit();  // init TFT library
+  TFT_BL_ON; // turn on the background light
+  Tft.TFTinit(); // init TFT library
 
-  Tft.drawChar('S', 0, 0, 1, RED);            // draw char: 'S', (0, 0), size: 1, color: RED
+  Tft.drawChar('S', 0, 0, 1, RED); // draw char: 'S', (0, 0), size: 1, color: RED
 
-  Tft.drawChar('E', 10, 10, 2, BLUE);         // draw char: 'E', (10, 10), size: 2, color: BLUE
+  Tft.drawChar('E', 10, 10, 2, BLUE); // draw char: 'E', (10, 10), size: 2, color: BLUE
 
-  Tft.drawChar('E', 20, 40, 3, GREEN);        // draw char: 'E', (20, 40), size: 3, color: GREEN
+  Tft.drawChar('E', 20, 40, 3, GREEN); // draw char: 'E', (20, 40), size: 3, color: GREEN
 
-  Tft.drawChar('E', 30, 80, 4, YELLOW);       // draw char: 'E', (30, 80), size: 4, color: YELLOW
+  Tft.drawChar('E', 30, 80, 4, YELLOW); // draw char: 'E', (30, 80), size: 4, color: YELLOW
 
-  Tft.drawChar('D', 40, 120, 4, YELLOW);      // draw char: 'D', (40, 120), size: 4, color: YELLOW
+  Tft.drawChar('D', 40, 120, 4, YELLOW); // draw char: 'D', (40, 120), size: 4, color: YELLOW
 
-  Tft.drawString("Hello", 0, 180, 3, CYAN);   // draw string: "hello", (0, 180), size: 3, color: CYAN
+  Tft.drawString("Hello", 0, 180, 3, CYAN); // draw string: "hello", (0, 180), size: 3, color: CYAN
 
   Tft.drawString("World!!", 60, 220, 4, WHITE); // draw string: "world!!", (80, 230), size: 4, color: WHITE
-
-
 }
 
 void loop() {
-
 }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino b/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino
index 49d39fee3b..6ee5238abd 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino
@@ -16,30 +16,27 @@
 
 #include "TFTv2.h"
 
-#define MAX_BMP         10                      // bmp file num
-#define FILENAME_LEN    20                      // max file name length
+#define MAX_BMP 10 // bmp file num
+#define FILENAME_LEN 20 // max file name length
 
+const int PIN_SD_CS = 4; // pin of sd card
 
-const int PIN_SD_CS = 4;                        // pin of sd card
+const int __Gnbmp_height = 320; // bmp height
+const int __Gnbmp_width = 240; // bmp width
 
-const int __Gnbmp_height = 320;                 // bmp height
-const int __Gnbmp_width  = 240;                 // bmp width
+unsigned char __Gnbmp_image_offset = 0; // offset
 
-unsigned char __Gnbmp_image_offset  = 0;        // offset
+int __Gnfile_num = 3; // num of file
 
-
-int __Gnfile_num = 3;                           // num of file
-
-char __Gsbmp_files[3][FILENAME_LEN] = {         // add file name here
+char __Gsbmp_files[3][FILENAME_LEN] = {
+  // add file name here
   "flower.BMP",
   "hibiscus.bmp",
   "test.bmp",
 };
 
-
 File bmpFile;
 
-
 void setup() {
 
   Serial.begin(115200);
@@ -54,7 +51,8 @@ void setup() {
 
   if (!SD.begin(PIN_SD_CS)) {
     Serial.println("failed!");
-    while (1);                              // init fail, die here
+    while (1)
+      ; // init fail, die here
   }
 
   Serial.println("SD OK!");
@@ -65,12 +63,13 @@ void setup() {
 void loop() {
   for (unsigned char i = 0; i < __Gnfile_num; i++) {
     bmpFile = SD.open(__Gsbmp_files[i]);
-    if (! bmpFile) {
+    if (!bmpFile) {
       Serial.println("didn't find image");
-      while (1);
+      while (1)
+        ;
     }
 
-    if (! bmpReadHeader(bmpFile)) {
+    if (!bmpReadHeader(bmpFile)) {
       Serial.println("bad bmp");
       return;
     }
@@ -80,7 +79,6 @@ void loop() {
 
     delay(1000);
   }
-
 }
 
 /*********************************************/
@@ -90,15 +88,15 @@ void loop() {
 // more RAM but makes the drawing a little faster. 20 pixels' worth
 // is probably a good place
 
-#define BUFFPIXEL       60                      // must be a divisor of 240 
-#define BUFFPIXEL_X3    180                     // BUFFPIXELx3
+#define BUFFPIXEL 60 // must be a divisor of 240
+#define BUFFPIXEL_X3 180 // BUFFPIXELx3
 
 void bmpdraw(File f, int x, int y) {
   bmpFile.seek(__Gnbmp_image_offset);
 
   uint32_t time = millis();
 
-  uint8_t sdbuffer[BUFFPIXEL_X3];                 // 3 * pixels to buffer
+  uint8_t sdbuffer[BUFFPIXEL_X3]; // 3 * pixels to buffer
 
   for (int i = 0; i < __Gnbmp_height; i++) {
 
@@ -110,7 +108,7 @@ void bmpdraw(File f, int x, int y) {
       unsigned int __color[BUFFPIXEL];
 
       for (int k = 0; k < BUFFPIXEL; k++) {
-        __color[k] = sdbuffer[buffidx + 2] >> 3;                    // read
+        __color[k] = sdbuffer[buffidx + 2] >> 3; // read
         __color[k] = __color[k] << 6 | (sdbuffer[buffidx + 1] >> 2); // green
         __color[k] = __color[k] << 5 | (sdbuffer[buffidx + 0] >> 3); // blue
 
@@ -131,7 +129,6 @@ void bmpdraw(File f, int x, int y) {
 
       TFT_CS_HIGH;
     }
-
   }
 
   Serial.print(millis() - time, DEC);
@@ -165,11 +162,10 @@ boolean bmpReadHeader(File f) {
   Serial.print("header size ");
   Serial.println(tmp, DEC);
 
-
   int bmp_width = read32(f);
   int bmp_height = read32(f);
 
-  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) {   // if image is not 320x240, return false
+  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) { // if image is not 320x240, return false
     return false;
   }
 
diff --git a/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino b/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
index 03423a4ef5..0e91c67ce4 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
@@ -18,23 +18,24 @@
 
 #include "TFTv2.h"
 
-#define MAX_BMP         10                      // bmp file num
-#define FILENAME_LEN    20                      // max file name length
+#define MAX_BMP 10 // bmp file num
+#define FILENAME_LEN 20 // max file name length
 
-const int PIN_SD_CS = 4;                        // pin of sd card
+const int PIN_SD_CS = 4; // pin of sd card
 
-const long __Gnbmp_height = 320;                 // bmp height
-const long __Gnbmp_width  = 240;                 // bmp width
+const long __Gnbmp_height = 320; // bmp height
+const long __Gnbmp_width = 240; // bmp width
 
-long __Gnbmp_image_offset  = 0;;
+long __Gnbmp_image_offset = 0;
+;
 
-int __Gnfile_num = 0;                           // num of file
-char __Gsbmp_files[MAX_BMP][FILENAME_LEN];      // file name
+int __Gnfile_num = 0; // num of file
+char __Gsbmp_files[MAX_BMP][FILENAME_LEN]; // file name
 
 File bmpFile;
 
 // if bmp file return 1, else return 0
-bool checkBMP(char *_name, char r_name[]) {
+bool checkBMP(char* _name, char r_name[]) {
   int len = 0;
 
   if (NULL == _name) {
@@ -55,29 +56,28 @@ bool checkBMP(char *_name, char r_name[]) {
   }
 
   // if xxx.bmp or xxx.BMP
-  if (r_name[len - 4] == '.' \
-      && (r_name[len - 3] == 'b' || (r_name[len - 3] == 'B')) \
-      && (r_name[len - 2] == 'm' || (r_name[len - 2] == 'M')) \
+  if (r_name[len - 4] == '.'
+      && (r_name[len - 3] == 'b' || (r_name[len - 3] == 'B'))
+      && (r_name[len - 2] == 'm' || (r_name[len - 2] == 'M'))
       && (r_name[len - 1] == 'p' || (r_name[len - 1] == 'P'))) {
     return true;
   }
 
   return false;
-
 }
 
 // search root to find bmp file
 void searchDirectory() {
-  File root = SD.open("/");                       // root
+  File root = SD.open("/"); // root
   while (true) {
-    File entry =  root.openNextFile();
+    File entry = root.openNextFile();
 
-    if (! entry) {
+    if (!entry) {
       break;
     }
 
     if (!entry.isDirectory()) {
-      char *ptmp = entry.name();
+      char* ptmp = entry.name();
 
       char __Name[20];
 
@@ -99,7 +99,6 @@ void searchDirectory() {
   }
 }
 
-
 void setup() {
 
   Serial.begin(115200);
@@ -114,7 +113,8 @@ void setup() {
 
   if (!SD.begin(PIN_SD_CS)) {
     Serial.println("failed!");
-    while (1);                              // init fail, die here
+    while (1)
+      ; // init fail, die here
   }
 
   Serial.println("SD OK!");
@@ -150,15 +150,15 @@ void loop() {
       }
   */
 
-
   bmpFile = SD.open("pfvm_1.bmp");
 
-  if (! bmpFile) {
+  if (!bmpFile) {
     Serial.println("didn't find image");
-    while (1);
+    while (1)
+      ;
   }
 
-  if (! bmpReadHeader(bmpFile)) {
+  if (!bmpReadHeader(bmpFile)) {
     Serial.println("bad bmp");
     return;
   }
@@ -166,7 +166,8 @@ void loop() {
   bmpdraw(bmpFile, 0, 0, 1);
   bmpFile.close();
 
-  while (1);
+  while (1)
+    ;
 }
 
 /*********************************************/
@@ -176,12 +177,11 @@ void loop() {
 // more RAM but makes the drawing a little faster. 20 pixels' worth
 // is probably a good place
 
-#define BUFFPIXEL       60                          // must be a divisor of 240 
-#define BUFFPIXEL_X3    180                         // BUFFPIXELx3
+#define BUFFPIXEL 60 // must be a divisor of 240
+#define BUFFPIXEL_X3 180 // BUFFPIXELx3
 
-
-#define UP_DOWN     1
-#define DOWN_UP     0
+#define UP_DOWN 1
+#define DOWN_UP 0
 
 // dir - 1: up to down
 // dir - 2: down to up
@@ -194,7 +194,7 @@ void bmpdraw(File f, int x, int y, int dir) {
 
   uint32_t time = millis();
 
-  uint8_t sdbuffer[BUFFPIXEL_X3];                                         // 3 * pixels to buffer
+  uint8_t sdbuffer[BUFFPIXEL_X3]; // 3 * pixels to buffer
 
   for (int i = 0; i < __Gnbmp_height; i++) {
     if (dir) {
@@ -210,7 +210,7 @@ void bmpdraw(File f, int x, int y, int dir) {
       unsigned int __color[BUFFPIXEL];
 
       for (int k = 0; k < BUFFPIXEL; k++) {
-        __color[k] = sdbuffer[buffidx + 2] >> 3;                    // read
+        __color[k] = sdbuffer[buffidx + 2] >> 3; // read
         __color[k] = __color[k] << 6 | (sdbuffer[buffidx + 1] >> 2); // green
         __color[k] = __color[k] << 5 | (sdbuffer[buffidx + 0] >> 3); // blue
 
@@ -239,7 +239,6 @@ void bmpdraw(File f, int x, int y, int dir) {
 
       TFT_CS_HIGH;
     }
-
   }
 
   Serial.print(millis() - time, DEC);
@@ -276,7 +275,7 @@ boolean bmpReadHeader(File f) {
   int bmp_width = read32(f);
   int bmp_height = read32(f);
 
-  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) {   // if image is not 320x240, return false
+  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) { // if image is not 320x240, return false
     return false;
   }
 
diff --git a/libraries/Ticker/examples/TickerBasic/TickerBasic.ino b/libraries/Ticker/examples/TickerBasic/TickerBasic.ino
index 2fabd98315..0eed169ee2 100644
--- a/libraries/Ticker/examples/TickerBasic/TickerBasic.ino
+++ b/libraries/Ticker/examples/TickerBasic/TickerBasic.ino
@@ -19,8 +19,8 @@ Ticker flipper;
 int count = 0;
 
 void flip() {
-  int state = digitalRead(LED_BUILTIN);  // get the current state of GPIO1 pin
-  digitalWrite(LED_BUILTIN, !state);     // set pin to the opposite state
+  int state = digitalRead(LED_BUILTIN); // get the current state of GPIO1 pin
+  digitalWrite(LED_BUILTIN, !state); // set pin to the opposite state
 
   ++count;
   // when the counter reaches a certain value, start blinking like crazy
diff --git a/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino b/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
index 33c9435982..970bf7235a 100644
--- a/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
+++ b/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
@@ -1,27 +1,28 @@
 #include "Arduino.h"
 #include "Ticker.h"
 
-#define LED1  2
-#define LED2  4
-#define LED3  12
-#define LED4  14
-#define LED5  15
-
+#define LED1 2
+#define LED2 4
+#define LED3 12
+#define LED4 14
+#define LED5 15
 
 class ExampleClass {
   public:
-    ExampleClass(int pin, int duration) : _pin(pin), _duration(duration) {
-      pinMode(_pin, OUTPUT);
-      _myTicker.attach_ms(_duration, std::bind(&ExampleClass::classBlink, this));
-    }
-    ~ExampleClass() {};
-
-    int _pin, _duration;
-    Ticker _myTicker;
-
-    void classBlink() {
-      digitalWrite(_pin, !digitalRead(_pin));
-    }
+  ExampleClass(int pin, int duration)
+      : _pin(pin)
+      , _duration(duration) {
+    pinMode(_pin, OUTPUT);
+    _myTicker.attach_ms(_duration, std::bind(&ExampleClass::classBlink, this));
+  }
+  ~ExampleClass() {};
+
+  int _pin, _duration;
+  Ticker _myTicker;
+
+  void classBlink() {
+    digitalWrite(_pin, !digitalRead(_pin));
+  }
 };
 
 void staticBlink() {
@@ -43,7 +44,6 @@ Ticker lambdaTicker;
 
 ExampleClass example(LED1, 100);
 
-
 void setup() {
   pinMode(LED2, OUTPUT);
   staticTicker.attach_ms(100, staticBlink);
diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp
index 495978b421..592bbb08c4 100644
--- a/libraries/Wire/Wire.cpp
+++ b/libraries/Wire/Wire.cpp
@@ -58,7 +58,7 @@ static int default_scl_pin = SCL;
 
 // Constructors ////////////////////////////////////////////////////////////////
 
-TwoWire::TwoWire() {}
+TwoWire::TwoWire() { }
 
 // Public Methods //////////////////////////////////////////////////////////////
 
diff --git a/libraries/Wire/Wire.h b/libraries/Wire/Wire.h
index 626087a4b2..1b2a00b908 100644
--- a/libraries/Wire/Wire.h
+++ b/libraries/Wire/Wire.h
@@ -35,7 +35,7 @@
 
 class TwoWire : public Stream
 {
-   private:
+private:
     static uint8_t rxBuffer[];
     static size_t rxBufferIndex;
     static size_t rxBufferLength;
@@ -51,7 +51,7 @@ class TwoWire : public Stream
     static void onRequestService(void);
     static void onReceiveService(uint8_t*, size_t);
 
-   public:
+public:
     TwoWire();
     void begin(int sda, int scl);
     void begin(int sda, int scl, uint8_t address);
diff --git a/libraries/Wire/examples/master_reader/master_reader.ino b/libraries/Wire/examples/master_reader/master_reader.ino
index 323830f847..bc464d529a 100644
--- a/libraries/Wire/examples/master_reader/master_reader.ino
+++ b/libraries/Wire/examples/master_reader/master_reader.ino
@@ -8,7 +8,6 @@
 
 // This example code is in the public domain.
 
-
 #include <Wire.h>
 #include <PolledTimeout.h>
 
@@ -18,8 +17,8 @@ const int16_t I2C_MASTER = 0x42;
 const int16_t I2C_SLAVE = 0x08;
 
 void setup() {
-  Serial.begin(115200);  // start serial for output
-  Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER);        // join i2c bus (address optional for master)
+  Serial.begin(115200); // start serial for output
+  Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER); // join i2c bus (address optional for master)
 }
 
 void loop() {
@@ -27,11 +26,11 @@ void loop() {
   static periodic nextPing(1000);
 
   if (nextPing) {
-    Wire.requestFrom(I2C_SLAVE, 6);    // request 6 bytes from slave device #8
+    Wire.requestFrom(I2C_SLAVE, 6); // request 6 bytes from slave device #8
 
     while (Wire.available()) { // slave may send less than requested
       char c = Wire.read(); // receive a byte as character
-      Serial.print(c);         // print the character
+      Serial.print(c); // print the character
     }
   }
 }
diff --git a/libraries/Wire/examples/master_writer/master_writer.ino b/libraries/Wire/examples/master_writer/master_writer.ino
index 1e9719e23c..d19edbd27a 100644
--- a/libraries/Wire/examples/master_writer/master_writer.ino
+++ b/libraries/Wire/examples/master_writer/master_writer.ino
@@ -8,7 +8,6 @@
 
 // This example code is in the public domain.
 
-
 #include <Wire.h>
 #include <PolledTimeout.h>
 
@@ -29,9 +28,9 @@ void loop() {
 
   if (nextPing) {
     Wire.beginTransmission(I2C_SLAVE); // transmit to device #8
-    Wire.write("x is ");        // sends five bytes
-    Wire.write(x);              // sends one byte
-    Wire.endTransmission();    // stop transmitting
+    Wire.write("x is "); // sends five bytes
+    Wire.write(x); // sends one byte
+    Wire.endTransmission(); // stop transmitting
 
     x++;
   }
diff --git a/libraries/Wire/examples/slave_receiver/slave_receiver.ino b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
index 270cc43129..812ed0e385 100644
--- a/libraries/Wire/examples/slave_receiver/slave_receiver.ino
+++ b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
@@ -8,7 +8,6 @@
 
 // This example code is in the public domain.
 
-
 #include <Wire.h>
 
 #define SDA_PIN 4
@@ -18,7 +17,7 @@ const int16_t I2C_MASTER = 0x42;
 const int16_t I2C_SLAVE = 0x08;
 
 void setup() {
-  Serial.begin(115200);           // start serial for output
+  Serial.begin(115200); // start serial for output
 
   Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE); // new syntax: join i2c bus (address required for slave)
   Wire.onReceive(receiveEvent); // register event
@@ -31,11 +30,11 @@ void loop() {
 // this function is registered as an event, see setup()
 void receiveEvent(size_t howMany) {
 
-  (void) howMany;
+  (void)howMany;
   while (1 < Wire.available()) { // loop through all but the last
     char c = Wire.read(); // receive byte as a character
-    Serial.print(c);         // print the character
+    Serial.print(c); // print the character
   }
-  int x = Wire.read();    // receive byte as an integer
-  Serial.println(x);         // print the integer
+  int x = Wire.read(); // receive byte as an integer
+  Serial.println(x); // print the integer
 }
diff --git a/libraries/Wire/examples/slave_sender/slave_sender.ino b/libraries/Wire/examples/slave_sender/slave_sender.ino
index e177be8538..31bfbc40e3 100644
--- a/libraries/Wire/examples/slave_sender/slave_sender.ino
+++ b/libraries/Wire/examples/slave_sender/slave_sender.ino
@@ -8,7 +8,6 @@
 
 // This example code is in the public domain.
 
-
 #include <Wire.h>
 
 #define SDA_PIN 4
@@ -17,7 +16,7 @@ const int16_t I2C_MASTER = 0x42;
 const int16_t I2C_SLAVE = 0x08;
 
 void setup() {
-  Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE);                // join i2c bus with address #8
+  Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE); // join i2c bus with address #8
   Wire.onRequest(requestEvent); // register event
 }
 
diff --git a/libraries/esp8266/examples/Blink/Blink.ino b/libraries/esp8266/examples/Blink/Blink.ino
index de23fb519f..cf7d4c55e4 100644
--- a/libraries/esp8266/examples/Blink/Blink.ino
+++ b/libraries/esp8266/examples/Blink/Blink.ino
@@ -10,15 +10,15 @@
 */
 
 void setup() {
-  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
+  pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
 }
 
 // the loop function runs over and over again forever
 void loop() {
-  digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
+  digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level
   // but actually the LED is on; this is because
   // it is active low on the ESP-01)
-  delay(1000);                      // Wait for a second
-  digitalWrite(LED_BUILTIN, HIGH);  // Turn the LED off by making the voltage HIGH
-  delay(2000);                      // Wait for two seconds (to demonstrate the active low LED)
+  delay(1000); // Wait for a second
+  digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
+  delay(2000); // Wait for two seconds (to demonstrate the active low LED)
 }
diff --git a/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino b/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
index 11e2aff482..304c27d384 100644
--- a/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
+++ b/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
@@ -22,22 +22,20 @@
   Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
 */
 
-
 #include <PolledTimeout.h>
 
 void ledOn() {
-  digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
+  digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level
 }
 
 void ledOff() {
-  digitalWrite(LED_BUILTIN, HIGH);  // Turn the LED off by making the voltage HIGH
+  digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
 }
 
 void ledToggle() {
-  digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));  // Change the state of the LED
+  digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); // Change the state of the LED
 }
 
-
 esp8266::polledTimeout::periodicFastUs halfPeriod(500000); //use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace
 
 // the setup function runs only once at start
@@ -57,7 +55,7 @@ void setup() {
   Serial.printf("periodic/oneShotFastNs::rangeCompensate = %u\n", (uint32_t)esp8266::polledTimeout::periodicFastNs::rangeCompensate);
 #endif
 
-  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
+  pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
 
   using esp8266::polledTimeout::oneShotMs; //import the type to the local namespace
 
@@ -83,7 +81,6 @@ void setup() {
   halfPeriod.reset(); //halfPeriod is global, so it gets inited on sketch start. Clear it here to make it ready for loop, where it's actually used.
 }
 
-
 // the loop function runs over and over again forever
 void loop() {
   if (halfPeriod) {
diff --git a/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino b/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
index 24689f3a44..a1af7aab53 100644
--- a/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
+++ b/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
@@ -24,9 +24,9 @@ void loop() {
   if (currentMillis - previousMillis >= interval) {
     previousMillis = currentMillis;
     if (ledState == LOW) {
-      ledState = HIGH;  // Note that this switches the LED *off*
+      ledState = HIGH; // Note that this switches the LED *off*
     } else {
-      ledState = LOW;  // Note that this switches the LED *on*
+      ledState = LOW; // Note that this switches the LED *on*
     }
     digitalWrite(LED_BUILTIN, ledState);
   }
diff --git a/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino b/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
index ce4dac2470..b4aff127fb 100644
--- a/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
+++ b/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
@@ -6,24 +6,24 @@ using namespace experimental::CBListImplentation;
 
 class exampleClass {
   public:
-    exampleClass() {};
+  exampleClass() {};
 
-    using exCallBack = std::function<void(int)>;
-    using exHandler  = CallBackList<exCallBack>::CallBackHandler;
+  using exCallBack = std::function<void(int)>;
+  using exHandler = CallBackList<exCallBack>::CallBackHandler;
 
-    CallBackList<exCallBack> myHandlers;
+  CallBackList<exCallBack> myHandlers;
 
-    exHandler setHandler(exCallBack cb) {
-      return myHandlers.add(cb);
-    }
+  exHandler setHandler(exCallBack cb) {
+    return myHandlers.add(cb);
+  }
 
-    void removeHandler(exHandler hnd) {
-      myHandlers.remove(hnd);
-    }
+  void removeHandler(exHandler hnd) {
+    myHandlers.remove(hnd);
+  }
 
-    void trigger(int t) {
-      myHandlers.execute(t);
-    }
+  void trigger(int t) {
+    myHandlers.execute(t);
+  }
 };
 
 exampleClass myExample;
diff --git a/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino b/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
index fa520722f6..95a92c9ca2 100644
--- a/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
+++ b/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
@@ -25,7 +25,7 @@ void setup() {
   uint32_t sector = ((((uint32_t)ptr - 0x40200000) / SPI_FLASH_SEC_SIZE));
 
   // Create a sector with 1 bit set (i.e. fake corruption)
-  uint32_t *space = (uint32_t*)calloc(SPI_FLASH_SEC_SIZE, 1);
+  uint32_t* space = (uint32_t*)calloc(SPI_FLASH_SEC_SIZE, 1);
   space[42] = 64;
 
   // Write it into flash at the spot in question
@@ -40,6 +40,5 @@ void setup() {
   Serial.printf("CRC check: %s\n", ESP.checkFlashCRC() ? "OK" : "ERROR");
 }
 
-
 void loop() {
 }
diff --git a/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino b/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
index 9c3a54d7da..f5ac22f10b 100644
--- a/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
+++ b/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
@@ -20,7 +20,10 @@ void loop() {
 
   Serial.printf("Flash ide  size: %u bytes\n", ideSize);
   Serial.printf("Flash ide speed: %u Hz\n", ESP.getFlashChipSpeed());
-  Serial.printf("Flash ide mode:  %s\n", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT" : ideMode == FM_DIO ? "DIO" : ideMode == FM_DOUT ? "DOUT" : "UNKNOWN"));
+  Serial.printf("Flash ide mode:  %s\n", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT"
+                                                 : ideMode == FM_DIO                     ? "DIO"
+                                                 : ideMode == FM_DOUT                    ? "DOUT"
+                                                                                         : "UNKNOWN"));
 
   if (ideSize != realSize) {
     Serial.println("Flash Chip configuration wrong!\n");
diff --git a/libraries/esp8266/examples/ConfigFile/ConfigFile.ino b/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
index 59693edb31..964b2dc7e0 100644
--- a/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
+++ b/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
@@ -67,7 +67,6 @@ void setup() {
     return;
   }
 
-
   if (!saveConfig()) {
     Serial.println("Failed to save config");
   } else {
diff --git a/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino b/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
index 1f192dd01c..e2ecb41bf6 100644
--- a/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
+++ b/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
@@ -39,12 +39,12 @@ void setup() {
   // PWM-Locked generator:   https://github.com/esp8266/Arduino/pull/7231
   enablePhaseLockedWaveform();
 
-  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
+  pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
   analogWriteRange(1000);
 
   using esp8266::polledTimeout::oneShotMs; //import the type to the local namespace
 
-  digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
+  digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level
 
   oneShotMs timeoutOn(2000);
   while (!timeoutOn) {
@@ -54,7 +54,6 @@ void setup() {
   stepPeriod.reset();
 }
 
-
 void loop() {
   static int val = 0;
   static int delta = 100;
diff --git a/libraries/esp8266/examples/HeapMetric/HeapMetric.ino b/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
index 5c7a27dbbe..387ac5624a 100644
--- a/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
+++ b/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
@@ -52,21 +52,18 @@ void tryit(int blocksize) {
     calculation of multiple elements combined with the rounding up for the
     8-byte alignment of each allocation can make for some tricky calculations.
   */
-  int rawMemoryMaxFreeBlockSize =  ESP.getMaxFreeBlockSize();
+  int rawMemoryMaxFreeBlockSize = ESP.getMaxFreeBlockSize();
   // Remove the space for overhead component of the blocks*sizeof(void*) array.
   int maxFreeBlockSize = rawMemoryMaxFreeBlockSize - UMM_OVERHEAD_ADJUST;
   // Initial estimate to use all of the MaxFreeBlock with multiples of 8 rounding up.
-  blocks = maxFreeBlockSize /
-           (((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + sizeof(void*));
+  blocks = maxFreeBlockSize / (((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + sizeof(void*));
   /*
     While we allowed for the 8-byte alignment overhead for blocks*blocksize we
     were unable to compensate in advance for the later 8-byte aligning needed
     for the blocks*sizeof(void*) allocation. Thus blocks may be off by one count.
     We now validate the estimate and adjust as needed.
   */
-  int rawMemoryEstimate =
-    blocks * ((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) +
-    ((blocks * sizeof(void*) + UMM_OVERHEAD_ADJUST + 7) & ~7);
+  int rawMemoryEstimate = blocks * ((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + ((blocks * sizeof(void*) + UMM_OVERHEAD_ADJUST + 7) & ~7);
   if (rawMemoryMaxFreeBlockSize < rawMemoryEstimate) {
     --blocks;
   }
diff --git a/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino b/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
index 1fb90134c2..c7c3249888 100644
--- a/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
+++ b/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
@@ -47,7 +47,6 @@ void loop() {
 
   static uint32_t encryptionCounter = 0;
 
-
   // Generate the salt to use for HKDF
   uint8_t hkdfSalt[16] { 0 };
   getNonceGenerator()(hkdfSalt, sizeof hkdfSalt);
@@ -61,14 +60,12 @@ void loop() {
   Serial.println(String(F("\nThis is the SHA256 hash of our example data, in HEX format:\n")) + TypeCast::uint8ArrayToHexString(resultArray, sizeof resultArray));
   Serial.println(String(F("This is the SHA256 hash of our example data, in HEX format, using String output:\n")) + SHA256::hash(exampleData));
 
-
   // HMAC
   // Note that HMAC output length is limited
   SHA256::hmac(exampleData.c_str(), exampleData.length(), derivedKey, sizeof derivedKey, resultArray, sizeof resultArray);
   Serial.println(String(F("\nThis is the SHA256 HMAC of our example data, in HEX format:\n")) + TypeCast::uint8ArrayToHexString(resultArray, sizeof resultArray));
   Serial.println(String(F("This is the SHA256 HMAC of our example data, in HEX format, using String output:\n")) + SHA256::hmac(exampleData, derivedKey, sizeof derivedKey, SHA256::NATURAL_LENGTH));
 
-
   // Authenticated Encryption with Associated Data (AEAD)
   String dataToEncrypt = F("This data is not encrypted.");
   uint8_t resultingNonce[12] { 0 }; // The nonce is always 12 bytes
@@ -91,7 +88,6 @@ void loop() {
 
   Serial.println(dataToEncrypt);
 
-
   Serial.println(F("\n##########################################################################################################\n"));
 
   delay(10000);
diff --git a/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino b/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
index ff1c41e93b..0d57aa78c8 100644
--- a/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
+++ b/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
@@ -24,7 +24,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid = STASSID;
@@ -39,9 +39,9 @@ extern "C" {
 #define thunk_ets_uart_printf ets_uart_printf
 
 #else
-  int thunk_ets_uart_printf(const char *format, ...) __attribute__((format(printf, 1, 2)));
-  // Second stack thunked helper - this macro creates the global function thunk_ets_uart_printf
-  make_stack_thunk(ets_uart_printf);
+int thunk_ets_uart_printf(const char* format, ...) __attribute__((format(printf, 1, 2)));
+// Second stack thunked helper - this macro creates the global function thunk_ets_uart_printf
+make_stack_thunk(ets_uart_printf);
 #endif
 };
 ////////////////////////////////////////////////////////////////////
@@ -50,7 +50,7 @@ void setup(void) {
   WiFi.persistent(false); // w/o this a flash write occurs at every boot
   WiFi.mode(WIFI_OFF);
   Serial.begin(115200);
-  delay(20);    // This delay helps when using the 'Modified Serial monitor' otherwise it is not needed.
+  delay(20); // This delay helps when using the 'Modified Serial monitor' otherwise it is not needed.
   Serial.println();
   Serial.println();
   Serial.println(F("The Hardware Watchdog Timer Demo is starting ..."));
@@ -78,8 +78,8 @@ void setup(void) {
 #endif
 
   Serial.printf_P(PSTR("This example was built with%s an extra 4K of heap space (g_pcont == 0x%08lX)\r\n"),
-                  ((uintptr_t)0x3FFFC000 < (uintptr_t)g_pcont) ? "" : "out",
-                  (uintptr_t)g_pcont);
+      ((uintptr_t)0x3FFFC000 < (uintptr_t)g_pcont) ? "" : "out",
+      (uintptr_t)g_pcont);
 #if defined(DEBUG_ESP_HWDT) || defined(DEBUG_ESP_HWDT_NOEXTRA4K)
   Serial.print(F("and with the HWDT"));
 #if defined(DEBUG_ESP_HWDT_NOEXTRA4K)
@@ -94,7 +94,6 @@ void setup(void) {
   processKey(Serial, '?');
 }
 
-
 void loop(void) {
   if (Serial.available() > 0) {
     int hotKey = Serial.read();
diff --git a/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino b/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
index 7d182bf377..195d1fa178 100644
--- a/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
+++ b/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
@@ -1,5 +1,5 @@
 #include <esp8266_undocumented.h>
-void crashMeIfYouCan(void)__attribute__((weak));
+void crashMeIfYouCan(void) __attribute__((weak));
 int divideA_B(int a, int b);
 
 int* nullPointer = NULL;
@@ -15,16 +15,15 @@ void processKey(Print& out, int hotKey) {
       ESP.restart();
       break;
     case 's': {
-        uint32_t startTime = millis();
-        out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
-        ets_install_putc1(ets_putc);
-        while (true) {
-          ets_printf("%9lu\r", (millis() - startTime));
-          ets_delay_us(250000);
-          // stay in an loop blocking other system activity.
-        }
+      uint32_t startTime = millis();
+      out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
+      ets_install_putc1(ets_putc);
+      while (true) {
+        ets_printf("%9lu\r", (millis() - startTime));
+        ets_delay_us(250000);
+        // stay in an loop blocking other system activity.
       }
-      break;
+    } break;
     case 'h':
       out.printf_P(PSTR("Now crashing with Hardware WDT. This will take about 6 seconds.\r\n"));
       asm volatile("mov.n a2, %0\n\t"
@@ -32,7 +31,9 @@ void processKey(Print& out, int hotKey) {
                    "mov.n a4, %2\n\t"
                    "mov.n a5, %3\n\t"
                    "mov.n a6, %4\n\t"
-                   : : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa) : "memory");
+                   :
+                   : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa)
+                   : "memory");
       // Could not find these in the stack dump, unless interrupts were enabled.
       {
         uint32_t startTime = millis();
diff --git a/libraries/esp8266/examples/I2STransmit/I2STransmit.ino b/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
index 2eaab265d2..9758455b75 100644
--- a/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
+++ b/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
@@ -14,12 +14,12 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 // Set your network here
-const char *SSID = STASSID;
-const char *PASS = STAPSK;
+const char* SSID = STASSID;
+const char* PASS = STAPSK;
 
 WiFiUDP udp;
 // Set your listener PC's IP here:
@@ -60,7 +60,6 @@ void setup() {
   udp.beginPacket(listener, port);
   udp.write("I2S Receiver\r\n");
   udp.endPacket();
-
 }
 
 void loop() {
diff --git a/libraries/esp8266/examples/IramReserve/IramReserve.ino b/libraries/esp8266/examples/IramReserve/IramReserve.ino
index 96d7479da4..7c354d5a13 100644
--- a/libraries/esp8266/examples/IramReserve/IramReserve.ino
+++ b/libraries/esp8266/examples/IramReserve/IramReserve.ino
@@ -18,7 +18,7 @@
 #if defined(UMM_HEAP_IRAM)
 
 #if defined(CORE_MOCK)
-#define XCHAL_INSTRAM1_VADDR		0x40100000
+#define XCHAL_INSTRAM1_VADDR 0x40100000
 #else
 #include <sys/config.h> // For config/core-isa.h
 #endif
@@ -29,7 +29,6 @@ struct durable {
   uint32_t chksum;
 };
 
-
 // Leave a durable block of IRAM after the 2nd heap.
 
 // The block should be in 8-byte increments and fall on an 8-byte alignment.
@@ -39,7 +38,7 @@ struct durable {
 #define IRAM_RESERVE ((uintptr_t)XCHAL_INSTRAM1_VADDR + 0xC000UL - IRAM_RESERVE_SZ)
 
 // Define a reference with the right properties to make access easier.
-#define DURABLE ((struct durable *)IRAM_RESERVE)
+#define DURABLE ((struct durable*)IRAM_RESERVE)
 #define INCREMENT_BOOTCOUNT() (DURABLE->bootCounter)++
 
 extern struct rst_info resetInfo;
@@ -58,11 +57,9 @@ extern struct rst_info resetInfo;
   XOR sum on the IRAM data (or just a section of the IRAM data).
 */
 inline bool is_iram_valid(void) {
-  return (REASON_WDT_RST      <= resetInfo.reason &&
-          REASON_SOFT_RESTART >= resetInfo.reason);
+  return (REASON_WDT_RST <= resetInfo.reason && REASON_SOFT_RESTART >= resetInfo.reason);
 }
 
-
 void setup() {
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
@@ -79,7 +76,6 @@ void setup() {
   Serial.printf("Number of reboots at %u\r\n", DURABLE->bootCounter);
   Serial.printf("\r\nSome less than direct, ways to restart:\r\n");
   processKey(Serial, '?');
-
 }
 
 void loop(void) {
@@ -112,7 +108,7 @@ extern "C" void umm_init_iram(void) {
   sec_heap_sz -= IRAM_RESERVE_SZ; // Shrink IRAM heap
   if (0xC000UL > sec_heap_sz) {
 
-    umm_init_iram_ex((void *)sec_heap, sec_heap_sz, true);
+    umm_init_iram_ex((void*)sec_heap, sec_heap_sz, true);
   }
 }
 
diff --git a/libraries/esp8266/examples/IramReserve/ProcessKey.ino b/libraries/esp8266/examples/IramReserve/ProcessKey.ino
index 7d182bf377..195d1fa178 100644
--- a/libraries/esp8266/examples/IramReserve/ProcessKey.ino
+++ b/libraries/esp8266/examples/IramReserve/ProcessKey.ino
@@ -1,5 +1,5 @@
 #include <esp8266_undocumented.h>
-void crashMeIfYouCan(void)__attribute__((weak));
+void crashMeIfYouCan(void) __attribute__((weak));
 int divideA_B(int a, int b);
 
 int* nullPointer = NULL;
@@ -15,16 +15,15 @@ void processKey(Print& out, int hotKey) {
       ESP.restart();
       break;
     case 's': {
-        uint32_t startTime = millis();
-        out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
-        ets_install_putc1(ets_putc);
-        while (true) {
-          ets_printf("%9lu\r", (millis() - startTime));
-          ets_delay_us(250000);
-          // stay in an loop blocking other system activity.
-        }
+      uint32_t startTime = millis();
+      out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
+      ets_install_putc1(ets_putc);
+      while (true) {
+        ets_printf("%9lu\r", (millis() - startTime));
+        ets_delay_us(250000);
+        // stay in an loop blocking other system activity.
       }
-      break;
+    } break;
     case 'h':
       out.printf_P(PSTR("Now crashing with Hardware WDT. This will take about 6 seconds.\r\n"));
       asm volatile("mov.n a2, %0\n\t"
@@ -32,7 +31,9 @@ void processKey(Print& out, int hotKey) {
                    "mov.n a4, %2\n\t"
                    "mov.n a5, %3\n\t"
                    "mov.n a6, %4\n\t"
-                   : : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa) : "memory");
+                   :
+                   : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa)
+                   : "memory");
       // Could not find these in the stack dump, unless interrupts were enabled.
       {
         uint32_t startTime = millis();
diff --git a/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino b/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
index 2c22416e0d..2dc8b99404 100644
--- a/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
+++ b/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
@@ -38,43 +38,43 @@
   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA  */
 
 #include <ESP8266WiFi.h>
-#include <coredecls.h>         // crc32()
+#include <coredecls.h> // crc32()
 #include <PolledTimeout.h>
 #include <include/WiFiState.h> // WiFiState structure details
 
 //#define DEBUG  // prints WiFi connection info to serial, uncomment if you want WiFi messages
 #ifdef DEBUG
-#define DEBUG_PRINTLN(x)  Serial.println(x)
-#define DEBUG_PRINT(x)  Serial.print(x)
+#define DEBUG_PRINTLN(x) Serial.println(x)
+#define DEBUG_PRINT(x) Serial.print(x)
 #else
 #define DEBUG_PRINTLN(x)
 #define DEBUG_PRINT(x)
 #endif
 
-#define WAKE_UP_PIN 0  // D3/GPIO0, can also force a serial flash upload with RESET
+#define WAKE_UP_PIN 0 // D3/GPIO0, can also force a serial flash upload with RESET
 // you can use any GPIO for WAKE_UP_PIN except for D0/GPIO16 as it doesn't support interrupts
 
 // uncomment one of the two lines below for your LED connection (optional)
-#define LED 5  // D1/GPIO5 external LED for modules with built-in LEDs so it doesn't add amperage
+#define LED 5 // D1/GPIO5 external LED for modules with built-in LEDs so it doesn't add amperage
 //#define LED 2  // D4/GPIO2 LED for ESP-01,07 modules; D4 is LED_BUILTIN on most other modules
 // you can use LED_BUILTIN, but it adds to the measured amperage by 0.3mA to 6mA.
 
-ADC_MODE(ADC_VCC);  // allows you to monitor the internal VCC level; it varies with WiFi load
+ADC_MODE(ADC_VCC); // allows you to monitor the internal VCC level; it varies with WiFi load
 // don't connect anything to the analog input pin(s)!
 
 // enter your WiFi configuration below
-const char* AP_SSID = "SSID";  // your router's SSID here
-const char* AP_PASS = "password";  // your router's password here
+const char* AP_SSID = "SSID"; // your router's SSID here
+const char* AP_PASS = "password"; // your router's password here
 IPAddress staticIP(0, 0, 0, 0); // parameters below are for your static IP address, if used
 IPAddress gateway(0, 0, 0, 0);
 IPAddress subnet(0, 0, 0, 0);
 IPAddress dns1(0, 0, 0, 0);
 IPAddress dns2(0, 0, 0, 0);
-uint32_t timeout = 30E3;  // 30 second timeout on the WiFi connection
+uint32_t timeout = 30E3; // 30 second timeout on the WiFi connection
 
 //#define TESTPOINT  //  used to track the timing of several test cycles (optional)
 #ifdef TESTPOINT
-#define testPointPin 4  // D2/GPIO4, you can use any pin that supports interrupts
+#define testPointPin 4 // D2/GPIO4, you can use any pin that supports interrupts
 #define testPoint_HIGH digitalWrite(testPointPin, HIGH)
 #define testPoint_LOW digitalWrite(testPointPin, LOW)
 #else
@@ -89,35 +89,35 @@ struct nv_s {
 
   struct {
     uint32_t crc32;
-    uint32_t rstCount;  // stores the Deep Sleep reset count
+    uint32_t rstCount; // stores the Deep Sleep reset count
     // you can add anything else here that you want to save, must be 4-byte aligned
   } rtcData;
 };
 
 static nv_s* nv = (nv_s*)RTC_USER_MEM; // user RTC RAM area
 
-uint32_t resetCount = 0;  // keeps track of the number of Deep Sleep tests / resets
+uint32_t resetCount = 0; // keeps track of the number of Deep Sleep tests / resets
 
 const uint32_t blinkDelay = 100; // fast blink rate for the LED when waiting for the user
-esp8266::polledTimeout::periodicMs blinkLED(blinkDelay);  // LED blink delay without delay()
-esp8266::polledTimeout::oneShotMs altDelay(blinkDelay);  // tight loop to simulate user code
-esp8266::polledTimeout::oneShotMs wifiTimeout(timeout);  // 30 second timeout on WiFi connection
+esp8266::polledTimeout::periodicMs blinkLED(blinkDelay); // LED blink delay without delay()
+esp8266::polledTimeout::oneShotMs altDelay(blinkDelay); // tight loop to simulate user code
+esp8266::polledTimeout::oneShotMs wifiTimeout(timeout); // 30 second timeout on WiFi connection
 // use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace
 
-void wakeupCallback() {  // unlike ISRs, you can do a print() from a callback function
-  testPoint_LOW;  // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW
-  printMillis();  // show time difference across sleep; millis is wrong as the CPU eventually stops
+void wakeupCallback() { // unlike ISRs, you can do a print() from a callback function
+  testPoint_LOW; // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW
+  printMillis(); // show time difference across sleep; millis is wrong as the CPU eventually stops
   Serial.println(F("Woke from Light Sleep - this is the callback"));
 }
 
 void setup() {
 #ifdef TESTPOINT
-  pinMode(testPointPin, OUTPUT);  // test point for Light Sleep and Deep Sleep tests
-  testPoint_LOW;  // Deep Sleep reset doesn't clear GPIOs, testPoint LOW shows boot time
+  pinMode(testPointPin, OUTPUT); // test point for Light Sleep and Deep Sleep tests
+  testPoint_LOW; // Deep Sleep reset doesn't clear GPIOs, testPoint LOW shows boot time
 #endif
-  pinMode(LED, OUTPUT);  // activity and status indicator
-  digitalWrite(LED, LOW);  // turn on the LED
-  pinMode(WAKE_UP_PIN, INPUT_PULLUP);  // polled to advance tests, interrupt for Forced Light Sleep
+  pinMode(LED, OUTPUT); // activity and status indicator
+  digitalWrite(LED, LOW); // turn on the LED
+  pinMode(WAKE_UP_PIN, INPUT_PULLUP); // polled to advance tests, interrupt for Forced Light Sleep
   Serial.begin(115200);
   Serial.println();
   Serial.print(F("\nReset reason = "));
@@ -129,31 +129,31 @@ void setup() {
   }
 
   // Read previous resets (Deep Sleeps) from RTC memory, if any
-  uint32_t crcOfData = crc32((uint8_t*) &nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
+  uint32_t crcOfData = crc32((uint8_t*)&nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
   if ((crcOfData = nv->rtcData.crc32) && (resetCause == "Deep-Sleep Wake")) {
-    resetCount = nv->rtcData.rstCount;  // read the previous reset count
+    resetCount = nv->rtcData.rstCount; // read the previous reset count
     resetCount++;
   }
   nv->rtcData.rstCount = resetCount; // update the reset count & CRC
   updateRTCcrc();
 
-  if (resetCount == 1) {  // show that millis() is cleared across the Deep Sleep reset
+  if (resetCount == 1) { // show that millis() is cleared across the Deep Sleep reset
     printMillis();
   }
-}  // end of setup()
+} // end of setup()
 
 void loop() {
-  if (resetCount == 0) {  // if first loop() since power on or external reset
+  if (resetCount == 0) { // if first loop() since power on or external reset
     runTest1();
     runTest2();
     runTest3();
     runTest4();
     runTest5();
     runTest6();
-    runTest7();  // first Deep Sleep test, all these end with a RESET
+    runTest7(); // first Deep Sleep test, all these end with a RESET
   }
   if (resetCount < 4) {
-    initWiFi();  // optional re-init of WiFi for the Deep Sleep tests
+    initWiFi(); // optional re-init of WiFi for the Deep Sleep tests
   }
   if (resetCount == 1) {
     runTest8();
@@ -168,7 +168,7 @@ void loop() {
 
 void runTest1() {
   Serial.println(F("\n1st test - running with WiFi unconfigured"));
-  readVoltage();  // read internal VCC
+  readVoltage(); // read internal VCC
   Serial.println(F("press the switch to continue"));
   waitPushbutton(false, blinkDelay);
 }
@@ -177,11 +177,11 @@ void runTest2() {
   Serial.println(F("\n2nd test - Automatic Modem Sleep"));
   Serial.println(F("connecting WiFi, please wait until the LED blinks"));
   initWiFi();
-  if (WiFi.localIP()) {  // won't go into Automatic Sleep without an active WiFi connection
+  if (WiFi.localIP()) { // won't go into Automatic Sleep without an active WiFi connection
     Serial.println(F("The amperage will drop in 7 seconds."));
-    readVoltage();  // read internal VCC
+    readVoltage(); // read internal VCC
     Serial.println(F("press the switch to continue"));
-    waitPushbutton(true, 90);  /* This is using a special feature: below 100 mS blink delay,
+    waitPushbutton(true, 90); /* This is using a special feature: below 100 mS blink delay,
          the LED blink delay is padding 100 mS time with 'program cycles' to fill the 100 mS.
          At 90 mS delay, 90% of the blink time is delay(), and 10% is 'your program running'.
          Below 90% you'll see a difference in the average amperage: less delay() = more amperage.
@@ -195,13 +195,13 @@ void runTest2() {
 
 void runTest3() {
   Serial.println(F("\n3rd test - Forced Modem Sleep"));
-  WiFi.shutdown(nv->wss);  // shut the modem down and save the WiFi state for faster reconnection
+  WiFi.shutdown(nv->wss); // shut the modem down and save the WiFi state for faster reconnection
   //  WiFi.forceSleepBegin(delay_in_uS);  // alternate method of Forced Modem Sleep for an optional timed shutdown,
   // with WiFi.forceSleepBegin(0xFFFFFFF); the modem sleeps until you wake it, with values <= 0xFFFFFFE it's timed
   //  delay(10);  // it doesn't always go to sleep unless you delay(10); yield() wasn't reliable
-  readVoltage();  // read internal VCC
+  readVoltage(); // read internal VCC
   Serial.println(F("press the switch to continue"));
-  waitPushbutton(true, 99);  /* Using the same < 100 mS feature. If you drop the delay below 100, you
+  waitPushbutton(true, 99); /* Using the same < 100 mS feature. If you drop the delay below 100, you
       will see the effect of program time vs. delay() time on minimum amperage.  Above ~ 97 (97% of the
       time in delay) there is little change in amperage, so you need to spend maximum time in delay()
       to get minimum amperage.*/
@@ -213,10 +213,10 @@ void runTest4() {
   Serial.println(F("Automatic Light Sleep begins after WiFi connects (LED blinks)"));
   // on successive loops after power-on, WiFi shows 'connected' several seconds before Sleep happens
   // and WiFi reconnects after the forceSleepWake more quickly
-  digitalWrite(LED, LOW);  // visual cue that we're reconnecting WiFi
+  digitalWrite(LED, LOW); // visual cue that we're reconnecting WiFi
   uint32_t wifiBegin = millis();
-  WiFi.forceSleepWake();  // reconnect with previous STA mode and connection settings
-  WiFi.setSleepMode(WIFI_LIGHT_SLEEP, 3);  // Automatic Light Sleep, DTIM listen interval = 3
+  WiFi.forceSleepWake(); // reconnect with previous STA mode and connection settings
+  WiFi.setSleepMode(WIFI_LIGHT_SLEEP, 3); // Automatic Light Sleep, DTIM listen interval = 3
   // at higher DTIM intervals you'll have a hard time establishing and maintaining a connection
   wifiTimeout.reset(timeout);
   while (((!WiFi.localIP()) || (WiFi.status() != WL_CONNECTED)) && (!wifiTimeout)) {
@@ -227,9 +227,9 @@ void runTest4() {
     float reConn = (millis() - wifiBegin);
     Serial.print(F("WiFi connect time = "));
     Serial.printf("%1.2f seconds\n", reConn / 1000);
-    readVoltage();  // read internal VCC
+    readVoltage(); // read internal VCC
     Serial.println(F("long press of the switch to continue"));
-    waitPushbutton(true, 350);  /* Below 100 mS delay it only goes into 'Automatic Modem Sleep',
+    waitPushbutton(true, 350); /* Below 100 mS delay it only goes into 'Automatic Modem Sleep',
         and below ~ 350 mS delay() the 'Automatic Light Sleep' is less frequent.  Above 500 mS
         delay() doesn't make significant improvement in power savings. */
   } else {
@@ -241,142 +241,142 @@ void runTest5() {
   Serial.println(F("\n5th test - Timed Light Sleep, wake in 10 seconds"));
   Serial.println(F("Press the button when you're ready to proceed"));
   waitPushbutton(true, blinkDelay);
-  WiFi.mode(WIFI_OFF);  // you must turn the modem off; using disconnect won't work
-  readVoltage();  // read internal VCC
-  printMillis();  // show millis() across sleep, including Serial.flush()
-  digitalWrite(LED, HIGH);  // turn the LED off so they know the CPU isn't running
-  testPoint_HIGH;  // testPoint LOW in callback tracks delay from testPoint HIGH to LOW
-  extern os_timer_t *timer_list;
-  timer_list = nullptr;  // stop (but don't disable) the 4 OS timers
+  WiFi.mode(WIFI_OFF); // you must turn the modem off; using disconnect won't work
+  readVoltage(); // read internal VCC
+  printMillis(); // show millis() across sleep, including Serial.flush()
+  digitalWrite(LED, HIGH); // turn the LED off so they know the CPU isn't running
+  testPoint_HIGH; // testPoint LOW in callback tracks delay from testPoint HIGH to LOW
+  extern os_timer_t* timer_list;
+  timer_list = nullptr; // stop (but don't disable) the 4 OS timers
   wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
-  gpio_pin_wakeup_enable(GPIO_ID_PIN(WAKE_UP_PIN), GPIO_PIN_INTR_LOLEVEL);  // GPIO wakeup (optional)
+  gpio_pin_wakeup_enable(GPIO_ID_PIN(WAKE_UP_PIN), GPIO_PIN_INTR_LOLEVEL); // GPIO wakeup (optional)
   // only LOLEVEL or HILEVEL interrupts work, no edge, that's an SDK or CPU limitation
   wifi_fpm_set_wakeup_cb(wakeupCallback); // set wakeup callback
   // the callback is optional, but without it the modem will wake in 10 seconds then delay(10 seconds)
   // with the callback the sleep time is only 10 seconds total, no extra delay() afterward
   wifi_fpm_open();
-  wifi_fpm_do_sleep(10E6);  // Sleep range = 10000 ~ 268,435,454 uS (0xFFFFFFE, 2^28-1)
+  wifi_fpm_do_sleep(10E6); // Sleep range = 10000 ~ 268,435,454 uS (0xFFFFFFE, 2^28-1)
   delay(10e3 + 1); // delay needs to be 1 mS longer than sleep or it only goes into Modem Sleep
-  Serial.println(F("Woke up!"));  // the interrupt callback hits before this is executed
+  Serial.println(F("Woke up!")); // the interrupt callback hits before this is executed
 }
 
 void runTest6() {
   Serial.println(F("\n6th test - Forced Light Sleep, wake with GPIO interrupt"));
   Serial.flush();
-  WiFi.mode(WIFI_OFF);  // you must turn the modem off; using disconnect won't work
-  digitalWrite(LED, HIGH);  // turn the LED off so they know the CPU isn't running
-  readVoltage();  // read internal VCC
+  WiFi.mode(WIFI_OFF); // you must turn the modem off; using disconnect won't work
+  digitalWrite(LED, HIGH); // turn the LED off so they know the CPU isn't running
+  readVoltage(); // read internal VCC
   Serial.println(F("CPU going to sleep, pull WAKE_UP_PIN low to wake it (press the switch)"));
-  printMillis();  // show millis() across sleep, including Serial.flush()
-  testPoint_HIGH;  // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW in callback
+  printMillis(); // show millis() across sleep, including Serial.flush()
+  testPoint_HIGH; // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW in callback
   wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
   gpio_pin_wakeup_enable(GPIO_ID_PIN(WAKE_UP_PIN), GPIO_PIN_INTR_LOLEVEL);
   // only LOLEVEL or HILEVEL interrupts work, no edge, that's an SDK or CPU limitation
   wifi_fpm_set_wakeup_cb(wakeupCallback); // Set wakeup callback (optional)
   wifi_fpm_open();
-  wifi_fpm_do_sleep(0xFFFFFFF);  // only 0xFFFFFFF, any other value and it won't disconnect the RTC timer
-  delay(10);  // it goes to sleep during this delay() and waits for an interrupt
-  Serial.println(F("Woke up!"));  // the interrupt callback hits before this is executed*/
+  wifi_fpm_do_sleep(0xFFFFFFF); // only 0xFFFFFFF, any other value and it won't disconnect the RTC timer
+  delay(10); // it goes to sleep during this delay() and waits for an interrupt
+  Serial.println(F("Woke up!")); // the interrupt callback hits before this is executed*/
 }
 
 void runTest7() {
   Serial.println(F("\n7th test - Deep Sleep for 10 seconds, reset and wake with RF_DEFAULT"));
-  initWiFi();  // initialize WiFi since we turned it off in the last test
-  readVoltage();  // read internal VCC
+  initWiFi(); // initialize WiFi since we turned it off in the last test
+  readVoltage(); // read internal VCC
   Serial.println(F("press the switch to continue"));
-  while (!digitalRead(WAKE_UP_PIN)) {  // wait for them to release the switch from the previous test
+  while (!digitalRead(WAKE_UP_PIN)) { // wait for them to release the switch from the previous test
     delay(10);
   }
-  delay(50);  // debounce time for the switch, pushbutton released
-  waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
-  digitalWrite(LED, LOW);  // turn the LED on, at least briefly
+  delay(50); // debounce time for the switch, pushbutton released
+  waitPushbutton(false, blinkDelay); // set true if you want to see Automatic Modem Sleep
+  digitalWrite(LED, LOW); // turn the LED on, at least briefly
   //WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep,
   // and no extended RFCAL as it goes into Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  printMillis();  // show time difference across sleep
-  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  printMillis(); // show time difference across sleep
+  testPoint_HIGH; // testPoint set HIGH to track Deep Sleep period, cleared at startup()
   ESP.deepSleep(10E6, WAKE_RF_DEFAULT); // good night!  D0 fires a reset in 10 seconds...
   // if you do ESP.deepSleep(0, mode); it needs a RESET to come out of sleep (RTC is disconnected)
   // maximum timed Deep Sleep interval ~ 3 to 4 hours depending on the RTC timer, see the README
   // the 2 uA GPIO amperage during Deep Sleep can't drive the LED so it's not lit now, although
   // depending on the LED used, you might see it very dimly lit in a dark room during this test
-  Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
+  Serial.println(F("What... I'm not asleep?!?")); // it will never get here
 }
 
 void runTest8() {
   Serial.println(F("\n8th test - in RF_DEFAULT, Deep Sleep for 10 seconds, reset and wake with RFCAL"));
-  readVoltage();  // read internal VCC
+  readVoltage(); // read internal VCC
   Serial.println(F("press the switch to continue"));
-  waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
+  waitPushbutton(false, blinkDelay); // set true if you want to see Automatic Modem Sleep
   //WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep,
   // and no extended RFCAL as it goes into Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush();  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  Serial.flush(); // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH; // testPoint set HIGH to track Deep Sleep period, cleared at startup()
   ESP.deepSleep(10E6, WAKE_RFCAL); // good night!  D0 fires a reset in 10 seconds...
-  Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
+  Serial.println(F("What... I'm not asleep?!?")); // it will never get here
 }
 
 void runTest9() {
   Serial.println(F("\n9th test - in RFCAL, Deep Sleep Instant for 10 seconds, reset and wake with NO_RFCAL"));
-  readVoltage();  // read internal VCC
+  readVoltage(); // read internal VCC
   Serial.println(F("press the switch to continue"));
-  waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
-  WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep
+  waitPushbutton(false, blinkDelay); // set true if you want to see Automatic Modem Sleep
+  WiFi.shutdown(nv->wss); // Forced Modem Sleep for a more Instant Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush();  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  Serial.flush(); // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH; // testPoint set HIGH to track Deep Sleep period, cleared at startup()
   ESP.deepSleepInstant(10E6, WAKE_NO_RFCAL); // good night!  D0 fires a reset in 10 seconds...
-  Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
+  Serial.println(F("What... I'm not asleep?!?")); // it will never get here
 }
 
 void runTest10() {
   Serial.println(F("\n10th test - in NO_RFCAL, Deep Sleep Instant for 10 seconds, reset and wake with RF_DISABLED"));
-  readVoltage();  // read internal VCC
+  readVoltage(); // read internal VCC
   Serial.println(F("press the switch to continue"));
-  waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
+  waitPushbutton(false, blinkDelay); // set true if you want to see Automatic Modem Sleep
   //WiFi.forceSleepBegin();  // Forced Modem Sleep for a more Instant Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush();  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  Serial.flush(); // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH; // testPoint set HIGH to track Deep Sleep period, cleared at startup()
   ESP.deepSleepInstant(10E6, WAKE_RF_DISABLED); // good night!  D0 fires a reset in 10 seconds...
-  Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
+  Serial.println(F("What... I'm not asleep?!?")); // it will never get here
 }
 
 void resetTests() {
-  readVoltage();  // read internal VCC
+  readVoltage(); // read internal VCC
   Serial.println(F("\nTests completed, in RF_DISABLED, press the switch to do an ESP.restart()"));
-  memset(&nv->wss, 0, sizeof(nv->wss) * 2);  // wipe saved WiFi states, comment this if you want to keep them
+  memset(&nv->wss, 0, sizeof(nv->wss) * 2); // wipe saved WiFi states, comment this if you want to keep them
   waitPushbutton(false, 1000);
   ESP.restart();
 }
 
-void waitPushbutton(bool usesDelay, unsigned int delayTime) {  // loop until they press the switch
+void waitPushbutton(bool usesDelay, unsigned int delayTime) { // loop until they press the switch
   // note: 2 different modes, as 3 of the power saving modes need a delay() to activate fully
-  if (!usesDelay) {  // quick interception of pushbutton press, no delay() used
+  if (!usesDelay) { // quick interception of pushbutton press, no delay() used
     blinkLED.reset(delayTime);
-    while (digitalRead(WAKE_UP_PIN)) {  // wait for a pushbutton press
+    while (digitalRead(WAKE_UP_PIN)) { // wait for a pushbutton press
       if (blinkLED) {
-        digitalWrite(LED, !digitalRead(LED));  // toggle the activity LED
+        digitalWrite(LED, !digitalRead(LED)); // toggle the activity LED
       }
-      yield();  // this would be a good place for ArduinoOTA.handle();
+      yield(); // this would be a good place for ArduinoOTA.handle();
     }
-  } else {  // long delay() for the 3 modes that need it, but it misses quick switch presses
-    while (digitalRead(WAKE_UP_PIN)) {  // wait for a pushbutton press
-      digitalWrite(LED, !digitalRead(LED));  // toggle the activity LED
-      delay(delayTime);  // another good place for ArduinoOTA.handle();
+  } else { // long delay() for the 3 modes that need it, but it misses quick switch presses
+    while (digitalRead(WAKE_UP_PIN)) { // wait for a pushbutton press
+      digitalWrite(LED, !digitalRead(LED)); // toggle the activity LED
+      delay(delayTime); // another good place for ArduinoOTA.handle();
       if (delayTime < 100) {
-        altDelay.reset(100 - delayTime);  // pad the time < 100 mS with some real CPU cycles
-        while (!altDelay) {  // this simulates 'your program running', not delay() time
+        altDelay.reset(100 - delayTime); // pad the time < 100 mS with some real CPU cycles
+        while (!altDelay) { // this simulates 'your program running', not delay() time
         }
       }
     }
   }
-  delay(50);  // debounce time for the switch, pushbutton pressed
-  while (!digitalRead(WAKE_UP_PIN)) {  // now wait for them to release the pushbutton
+  delay(50); // debounce time for the switch, pushbutton pressed
+  while (!digitalRead(WAKE_UP_PIN)) { // now wait for them to release the pushbutton
     delay(10);
   }
-  delay(50);  // debounce time for the switch, pushbutton released
+  delay(50); // debounce time for the switch, pushbutton released
 }
 
 void readVoltage() { // read internal VCC
@@ -385,34 +385,34 @@ void readVoltage() { // read internal VCC
 }
 
 void printMillis() {
-  Serial.print(F("millis() = "));  // show that millis() isn't correct across most Sleep modes
+  Serial.print(F("millis() = ")); // show that millis() isn't correct across most Sleep modes
   Serial.println(millis());
-  Serial.flush();  // needs a Serial.flush() else it may not print the whole message before sleeping
+  Serial.flush(); // needs a Serial.flush() else it may not print the whole message before sleeping
 }
 
-void updateRTCcrc() {  // updates the reset count CRC
-  nv->rtcData.crc32 = crc32((uint8_t*) &nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
+void updateRTCcrc() { // updates the reset count CRC
+  nv->rtcData.crc32 = crc32((uint8_t*)&nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
 }
 
 void initWiFi() {
-  digitalWrite(LED, LOW);  // give a visual indication that we're alive but busy with WiFi
-  uint32_t wifiBegin = millis();  // how long does it take to connect
-  if ((crc32((uint8_t*) &nv->rtcData.rstCount + 1, sizeof(nv->wss)) && !WiFi.shutdownValidCRC(nv->wss))) {
+  digitalWrite(LED, LOW); // give a visual indication that we're alive but busy with WiFi
+  uint32_t wifiBegin = millis(); // how long does it take to connect
+  if ((crc32((uint8_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss)) && !WiFi.shutdownValidCRC(nv->wss))) {
     // if good copy of wss, overwrite invalid (primary) copy
-    memcpy((uint32_t*) &nv->wss, (uint32_t*) &nv->rtcData.rstCount + 1, sizeof(nv->wss));
+    memcpy((uint32_t*)&nv->wss, (uint32_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss));
   }
-  if (WiFi.shutdownValidCRC(nv->wss)) {  // if we have a valid WiFi saved state
-    memcpy((uint32_t*) &nv->rtcData.rstCount + 1, (uint32_t*) &nv->wss, sizeof(nv->wss)); // save a copy of it
+  if (WiFi.shutdownValidCRC(nv->wss)) { // if we have a valid WiFi saved state
+    memcpy((uint32_t*)&nv->rtcData.rstCount + 1, (uint32_t*)&nv->wss, sizeof(nv->wss)); // save a copy of it
     Serial.println(F("resuming WiFi"));
   }
-  if (!(WiFi.resumeFromShutdown(nv->wss))) {  // couldn't resume, or no valid saved WiFi state yet
+  if (!(WiFi.resumeFromShutdown(nv->wss))) { // couldn't resume, or no valid saved WiFi state yet
     /* Explicitly set the ESP8266 as a WiFi-client (STAtion mode), otherwise by default it
       would try to act as both a client and an access-point and could cause network issues
       with other WiFi devices on your network. */
-    WiFi.persistent(false);  // don't store the connection each time to save wear on the flash
+    WiFi.persistent(false); // don't store the connection each time to save wear on the flash
     WiFi.mode(WIFI_STA);
-    WiFi.setOutputPower(10);  // reduce RF output power, increase if it won't connect
-    WiFi.config(staticIP, gateway, subnet);  // if using static IP, enter parameters at the top
+    WiFi.setOutputPower(10); // reduce RF output power, increase if it won't connect
+    WiFi.config(staticIP, gateway, subnet); // if using static IP, enter parameters at the top
     WiFi.begin(AP_SSID, AP_PASS);
     Serial.print(F("connecting to WiFi "));
     Serial.println(AP_SSID);
diff --git a/libraries/esp8266/examples/MMU48K/MMU48K.ino b/libraries/esp8266/examples/MMU48K/MMU48K.ino
index d75d91232b..e33a08ebb0 100644
--- a/libraries/esp8266/examples/MMU48K/MMU48K.ino
+++ b/libraries/esp8266/examples/MMU48K/MMU48K.ino
@@ -4,21 +4,21 @@
 #include <umm_malloc/umm_heap_select.h>
 
 #if defined(CORE_MOCK)
-#define XCHAL_INSTRAM1_VADDR		0x40100000
+#define XCHAL_INSTRAM1_VADDR 0x40100000
 #else
 #include <sys/config.h> // For config/core-isa.h
 #endif
 
-uint32_t timed_byte_read(char *pc, uint32_t * o);
-uint32_t timed_byte_read2(char *pc, uint32_t * o);
+uint32_t timed_byte_read(char* pc, uint32_t* o);
+uint32_t timed_byte_read2(char* pc, uint32_t* o);
 int divideA_B(int a, int b);
 
 int* nullPointer = NULL;
 
-char *probe_b  = NULL;
-short *probe_s = NULL;
-char *probe_c  = (char *)0x40110000;
-short *unaligned_probe_s = NULL;
+char* probe_b = NULL;
+short* probe_s = NULL;
+char* probe_c = (char*)0x40110000;
+short* unaligned_probe_s = NULL;
 
 uint32_t read_var = 0x11223344;
 
@@ -30,10 +30,10 @@ uint32_t read_var = 0x11223344;
 */
 
 #if defined(MMU_IRAM_HEAP) || defined(MMU_SEC_HEAP)
-uint32_t *gobble;
+uint32_t* gobble;
 size_t gobble_sz;
 
-#elif (MMU_IRAM_SIZE > 32*1024)
+#elif (MMU_IRAM_SIZE > 32 * 1024)
 uint32_t gobble[4 * 1024] IRAM_ATTR;
 constexpr size_t gobble_sz = sizeof(gobble);
 
@@ -42,7 +42,7 @@ uint32_t gobble[256] IRAM_ATTR;
 constexpr size_t gobble_sz = sizeof(gobble);
 #endif
 
-bool  isValid(uint32_t *probe) {
+bool isValid(uint32_t* probe) {
   bool rc = true;
   if (NULL == probe) {
     ets_uart_printf("\nNULL memory pointer %p ...\n", probe);
@@ -54,7 +54,8 @@ bool  isValid(uint32_t *probe) {
   uint32_t saveData = *probe;
   for (size_t i = 0; i < 32; i++) {
     *probe = BIT(i);
-    asm volatile("" ::: "memory");
+    asm volatile("" ::
+                     : "memory");
     uint32_t val = *probe;
     if (val != BIT(i)) {
       ets_uart_printf("  Read 0x%08X != Wrote 0x%08X\n", val, (uint32_t)BIT(i));
@@ -67,9 +68,8 @@ bool  isValid(uint32_t *probe) {
   return rc;
 }
 
-
-void dump_mem32(const void * addr, const size_t len) {
-  uint32_t *addr32 = (uint32_t *)addr;
+void dump_mem32(const void* addr, const size_t len) {
+  uint32_t* addr32 = (uint32_t*)addr;
   ets_uart_printf("\n");
   if ((uintptr_t)addr32 & 3) {
     ets_uart_printf("non-32-bit access\n");
@@ -93,7 +93,7 @@ void print_mmu_status(Print& oStream) {
   oStream.println();
   oStream.println();
   uint32_t iram_bank_reg = ESP8266_DREG(0x24);
-  if (0 == (iram_bank_reg & 0x10)) {  // if bit clear, is enabled
+  if (0 == (iram_bank_reg & 0x10)) { // if bit clear, is enabled
     oStream.printf_P(PSTR("  IRAM block mapped to:    0x40108000"));
     oStream.println();
   }
@@ -122,7 +122,6 @@ void print_mmu_status(Print& oStream) {
 #endif
 }
 
-
 void setup() {
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
@@ -138,14 +137,14 @@ void setup() {
     HeapSelectIram ephemeral;
     // Serial.printf_P(PSTR("ESP.getFreeHeap(): %u\n"), ESP.getFreeHeap());
     gobble_sz = ESP.getFreeHeap() - UMM_OVERHEAD_ADJUST; // - 4096;
-    gobble = (uint32_t *)malloc(gobble_sz);
+    gobble = (uint32_t*)malloc(gobble_sz);
   }
   Serial.printf_P(PSTR("\r\nmalloc() from IRAM Heap:\r\n"));
   Serial.printf_P(PSTR("  gobble_sz: %u\r\n"), gobble_sz);
   Serial.printf_P(PSTR("  gobble:    %p\r\n"), gobble);
 
 #elif defined(MMU_SEC_HEAP)
-  gobble = (uint32_t *)MMU_SEC_HEAP;
+  gobble = (uint32_t*)MMU_SEC_HEAP;
   gobble_sz = MMU_SEC_HEAP_SIZE;
 #endif
 
@@ -165,41 +164,40 @@ void setup() {
 
   // Lets peak over the edge
   Serial.printf_P(PSTR("\r\nPeek over the edge of memory at 0x4010C000\r\n"));
-  dump_mem32((void *)(0x4010C000 - 16 * 4), 32);
-
-  probe_b = (char *)gobble;
-  probe_s = (short *)((uintptr_t)gobble);
-  unaligned_probe_s = (short *)((uintptr_t)gobble + 1);
+  dump_mem32((void*)(0x4010C000 - 16 * 4), 32);
 
+  probe_b = (char*)gobble;
+  probe_s = (short*)((uintptr_t)gobble);
+  unaligned_probe_s = (short*)((uintptr_t)gobble + 1);
 }
 
 void processKey(Print& out, int hotKey) {
   switch (hotKey) {
     case 't': {
-        uint32_t tmp;
-        out.printf_P(PSTR("Test how much time is added by exception handling"));
-        out.println();
-        out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char *)0x40200003, &tmp), tmp);
-        out.println();
-        out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char *)0x40200003, &tmp), tmp);
-        out.println();
-        out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char *)0x40108000, &tmp), tmp);
-        out.println();
-        out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char *)((uintptr_t)&read_var + 1), &tmp), tmp);
-        out.println();
-        out.printf_P(PSTR("Test how much time is used by the inline function method"));
-        out.println();
-        out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)0x40200003, &tmp), tmp);
-        out.println();
-        out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)0x40200003, &tmp), tmp);
-        out.println();
-        out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)0x40108000, &tmp), tmp);
-        out.println();
-        out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)((uintptr_t)&read_var + 1), &tmp), tmp);
-        out.println();
-        out.println();
-        break;
-      }
+      uint32_t tmp;
+      out.printf_P(PSTR("Test how much time is added by exception handling"));
+      out.println();
+      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char*)0x40200003, &tmp), tmp);
+      out.println();
+      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char*)0x40200003, &tmp), tmp);
+      out.println();
+      out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char*)0x40108000, &tmp), tmp);
+      out.println();
+      out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char*)((uintptr_t)&read_var + 1), &tmp), tmp);
+      out.println();
+      out.printf_P(PSTR("Test how much time is used by the inline function method"));
+      out.println();
+      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)0x40200003, &tmp), tmp);
+      out.println();
+      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)0x40200003, &tmp), tmp);
+      out.println();
+      out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)0x40108000, &tmp), tmp);
+      out.println();
+      out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)((uintptr_t)&read_var + 1), &tmp), tmp);
+      out.println();
+      out.println();
+      break;
+    }
     case '9':
       out.printf_P(PSTR("Unaligned exception by reading short"));
       out.println();
@@ -228,17 +226,17 @@ void processKey(Print& out, int hotKey) {
       out.println();
       break;
     case 'B': {
-        out.printf_P(PSTR("Load/Store exception by writing byte to iRAM"));
-        out.println();
-        char val = 0x55;
-        out.printf_P(PSTR("Write byte, 0x%02X, to iRAM at %p"), val, probe_b);
-        out.println();
-        out.flush();
-        probe_b[0] = val;
-        out.printf_P(PSTR("Read Byte back from iRAM, 0x%02X at %p"), probe_b[0], probe_b);
-        out.println();
-        break;
-      }
+      out.printf_P(PSTR("Load/Store exception by writing byte to iRAM"));
+      out.println();
+      char val = 0x55;
+      out.printf_P(PSTR("Write byte, 0x%02X, to iRAM at %p"), val, probe_b);
+      out.println();
+      out.flush();
+      probe_b[0] = val;
+      out.printf_P(PSTR("Read Byte back from iRAM, 0x%02X at %p"), probe_b[0], probe_b);
+      out.println();
+      break;
+    }
     case 's':
       out.printf_P(PSTR("Load/Store exception by reading short from iRAM"));
       out.println();
@@ -247,17 +245,17 @@ void processKey(Print& out, int hotKey) {
       out.println();
       break;
     case 'S': {
-        out.printf_P(PSTR("Load/Store exception by writing short to iRAM"));
-        out.println();
-        short int val = 0x0AA0;
-        out.printf_P(PSTR("Write short, 0x%04X, to iRAM at %p"), val, probe_s);
-        out.println();
-        out.flush();
-        probe_s[0] = val;
-        out.printf_P(PSTR("Read short back from iRAM, 0x%04X at %p"), probe_s[0], probe_s);
-        out.println();
-        break;
-      }
+      out.printf_P(PSTR("Load/Store exception by writing short to iRAM"));
+      out.println();
+      short int val = 0x0AA0;
+      out.printf_P(PSTR("Write short, 0x%04X, to iRAM at %p"), val, probe_s);
+      out.println();
+      out.flush();
+      probe_s[0] = val;
+      out.printf_P(PSTR("Read short back from iRAM, 0x%04X at %p"), probe_s[0], probe_s);
+      out.println();
+      break;
+    }
     case 'R':
       out.printf_P(PSTR("Restart, ESP.restart(); ..."));
       out.println();
@@ -310,7 +308,6 @@ void processKey(Print& out, int hotKey) {
   }
 }
 
-
 void serialClientLoop(void) {
   if (Serial.available() > 0) {
     int hotKey = Serial.read();
@@ -322,7 +319,6 @@ void loop() {
   serialClientLoop();
 }
 
-
 int __attribute__((noinline)) divideA_B(int a, int b) {
   return (a / b);
 }
diff --git a/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino b/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
index f6c2df08fc..31a6f26cc6 100644
--- a/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
+++ b/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
@@ -12,16 +12,14 @@
   This example code is in the public domain.
 */
 
-
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 // initial time (possibly given by an external RTC)
 #define RTC_UTC_TEST 1510592825 // 1510592825 = Monday 13 November 2017 17:07:05 UTC
 
-
 // This database is autogenerated from IANA timezone database
 //    https://www.iana.org/time-zones
 // and can be updated on demand in this repository
@@ -44,17 +42,17 @@
 ////////////////////////////////////////////////////////
 
 #include <ESP8266WiFi.h>
-#include <coredecls.h>                  // settimeofday_cb()
+#include <coredecls.h> // settimeofday_cb()
 #include <Schedule.h>
 #include <PolledTimeout.h>
 
-#include <time.h>                       // time() ctime()
-#include <sys/time.h>                   // struct timeval
+#include <time.h> // time() ctime()
+#include <sys/time.h> // struct timeval
 
-#include <sntp.h>                       // sntp_servermode_dhcp()
+#include <sntp.h> // sntp_servermode_dhcp()
 
 // for testing purpose:
-extern "C" int clock_gettime(clockid_t unused, struct timespec *tp);
+extern "C" int clock_gettime(clockid_t unused, struct timespec* tp);
 
 ////////////////////////////////////////////////////////
 
@@ -86,15 +84,21 @@ static bool time_machine_run_once = false;
 //    return 15000; // 15s
 //}
 
-#define PTM(w) \
+#define PTM(w)              \
   Serial.print(" " #w "="); \
   Serial.print(tm->tm_##w);
 
 void printTm(const char* what, const tm* tm) {
   Serial.print(what);
-  PTM(isdst); PTM(yday); PTM(wday);
-  PTM(year);  PTM(mon);  PTM(mday);
-  PTM(hour);  PTM(min);  PTM(sec);
+  PTM(isdst);
+  PTM(yday);
+  PTM(wday);
+  PTM(year);
+  PTM(mon);
+  PTM(mday);
+  PTM(hour);
+  PTM(min);
+  PTM(sec);
 }
 
 void showTime() {
@@ -135,7 +139,7 @@ void showTime() {
   Serial.println((uint32_t)now);
 
   // timezone and demo in the future
-  Serial.printf("timezone:  %s\n", getenv("TZ") ? : "(none)");
+  Serial.printf("timezone:  %s\n", getenv("TZ") ?: "(none)");
 
   // human readable
   Serial.print("ctime:     ");
@@ -153,8 +157,8 @@ void showTime() {
         Serial.printf("%s ", sntp.toString().c_str());
       }
       Serial.printf("- IPv6: %s - Reachability: %o\n",
-                    sntp.isV6() ? "Yes" : "No",
-                    sntp_getreachability(i));
+          sntp.isV6() ? "Yes" : "No",
+          sntp_getreachability(i));
     }
   }
 
@@ -169,11 +173,11 @@ void showTime() {
     gettimeofday(&tv, nullptr);
     if (tv.tv_sec != prevtv.tv_sec) {
       Serial.printf("time(): %u   gettimeofday(): %u.%06u  seconds are unchanged\n",
-                    (uint32_t)prevtime,
-                    (uint32_t)prevtv.tv_sec, (uint32_t)prevtv.tv_usec);
+          (uint32_t)prevtime,
+          (uint32_t)prevtv.tv_sec, (uint32_t)prevtv.tv_usec);
       Serial.printf("time(): %u   gettimeofday(): %u.%06u  <-- seconds have changed\n",
-                    (uint32_t)(prevtime = time(nullptr)),
-                    (uint32_t)tv.tv_sec, (uint32_t)tv.tv_usec);
+          (uint32_t)(prevtime = time(nullptr)),
+          (uint32_t)tv.tv_sec, (uint32_t)tv.tv_usec);
       break;
     }
     prevtv = tv;
@@ -213,8 +217,8 @@ void time_is_set(bool from_sntp /* <= this parameter is optional */) {
     now = time(nullptr);
     const tm* tm = localtime(&now);
     Serial.printf(": future=%3ddays: DST=%s - ",
-                  time_machine_days,
-                  tm->tm_isdst ? "true " : "false");
+        time_machine_days,
+        tm->tm_isdst ? "true " : "false");
     Serial.print(ctime(&now));
     gettimeofday(&tv, nullptr);
     constexpr int days = 30;
diff --git a/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino b/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
index 9736995c74..170eabe38c 100644
--- a/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
+++ b/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
@@ -13,7 +13,7 @@
 // This example code is in the public domain.
 
 // CRC function used to ensure data validity
-uint32_t calculateCRC32(const uint8_t *data, size_t length);
+uint32_t calculateCRC32(const uint8_t* data, size_t length);
 
 // helper function to dump memory contents as hex
 void printMemory();
@@ -34,11 +34,11 @@ void setup() {
   delay(1000);
 
   // Read struct from RTC memory
-  if (ESP.rtcUserMemoryRead(0, (uint32_t*) &rtcData, sizeof(rtcData))) {
+  if (ESP.rtcUserMemoryRead(0, (uint32_t*)&rtcData, sizeof(rtcData))) {
     Serial.println("Read: ");
     printMemory();
     Serial.println();
-    uint32_t crcOfData = calculateCRC32((uint8_t*) &rtcData.data[0], sizeof(rtcData.data));
+    uint32_t crcOfData = calculateCRC32((uint8_t*)&rtcData.data[0], sizeof(rtcData.data));
     Serial.print("CRC32 of data: ");
     Serial.println(crcOfData, HEX);
     Serial.print("CRC32 read from RTC: ");
@@ -55,9 +55,9 @@ void setup() {
     rtcData.data[i] = random(0, 128);
   }
   // Update CRC32 of data
-  rtcData.crc32 = calculateCRC32((uint8_t*) &rtcData.data[0], sizeof(rtcData.data));
+  rtcData.crc32 = calculateCRC32((uint8_t*)&rtcData.data[0], sizeof(rtcData.data));
   // Write struct to RTC memory
-  if (ESP.rtcUserMemoryWrite(0, (uint32_t*) &rtcData, sizeof(rtcData))) {
+  if (ESP.rtcUserMemoryWrite(0, (uint32_t*)&rtcData, sizeof(rtcData))) {
     Serial.println("Write: ");
     printMemory();
     Serial.println();
@@ -70,7 +70,7 @@ void setup() {
 void loop() {
 }
 
-uint32_t calculateCRC32(const uint8_t *data, size_t length) {
+uint32_t calculateCRC32(const uint8_t* data, size_t length) {
   uint32_t crc = 0xffffffff;
   while (length--) {
     uint8_t c = *data++;
@@ -91,7 +91,7 @@ uint32_t calculateCRC32(const uint8_t *data, size_t length) {
 //prints all rtcData, including the leading crc32
 void printMemory() {
   char buf[3];
-  uint8_t *ptr = (uint8_t *)&rtcData;
+  uint8_t* ptr = (uint8_t*)&rtcData;
   for (size_t i = 0; i < sizeof(rtcData); i++) {
     sprintf(buf, "%02X", ptr[i]);
     Serial.print(buf);
diff --git a/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino b/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
index 61967c691f..d2fd2f2e21 100644
--- a/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
+++ b/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
@@ -1,4 +1,4 @@
-#define TIMEOUT (10000UL)     // Maximum time to wait for serial activity to start
+#define TIMEOUT (10000UL) // Maximum time to wait for serial activity to start
 
 void setup() {
   // put your setup code here, to run once:
@@ -29,6 +29,4 @@ void setup() {
 
 void loop() {
   // put your main code here, to run repeatedly:
-
 }
-
diff --git a/libraries/esp8266/examples/SerialStress/SerialStress.ino b/libraries/esp8266/examples/SerialStress/SerialStress.ino
index a19eb9f270..b899c76eac 100644
--- a/libraries/esp8266/examples/SerialStress/SerialStress.ino
+++ b/libraries/esp8266/examples/SerialStress/SerialStress.ino
@@ -11,18 +11,18 @@
 #include <ESP8266WiFi.h>
 #include <SoftwareSerial.h>
 
-#define SSBAUD          115200  // logger on console for humans
-#define BAUD            3000000 // hardware serial stress test
-#define BUFFER_SIZE     4096    // may be useless to use more than 2*SERIAL_SIZE_RX
-#define SERIAL_SIZE_RX  1024    // Serial.setRxBufferSize()
+#define SSBAUD 115200 // logger on console for humans
+#define BAUD 3000000 // hardware serial stress test
+#define BUFFER_SIZE 4096 // may be useless to use more than 2*SERIAL_SIZE_RX
+#define SERIAL_SIZE_RX 1024 // Serial.setRxBufferSize()
 
 #define FAKE_INCREASED_AVAILABLE 100 // test readBytes's timeout
 
 #define TIMEOUT 5000
 #define DEBUG(x...) //x
 
-uint8_t buf [BUFFER_SIZE];
-uint8_t temp [BUFFER_SIZE];
+uint8_t buf[BUFFER_SIZE];
+uint8_t temp[BUFFER_SIZE];
 bool reading = true;
 size_t testReadBytesTimeout = 0;
 
@@ -38,7 +38,7 @@ Stream* logger;
 
 void error(const char* what) {
   logger->printf("\nerror: %s after %ld minutes\nread idx:  %d\nwrite idx: %d\ntotal:     %ld\nlast read: %d\nmaxavail:  %d\n",
-                 what, (long)((millis() - start_ms) / 60000), in_idx, out_idx, (long)in_total, (int)local_receive_size, maxavail);
+      what, (long)((millis() - start_ms) / 60000), in_idx, out_idx, (long)in_total, (int)local_receive_size, maxavail);
   if (Serial.hasOverrun()) {
     logger->printf("overrun!\n");
   }
@@ -76,7 +76,7 @@ void setup() {
   int baud = Serial.baudRate();
   logger->printf(ESP.getFullVersion().c_str());
   logger->printf("\n\nBAUD: %d - CoreRxBuffer: %d bytes - TestBuffer: %d bytes\n",
-                 baud, SERIAL_SIZE_RX, BUFFER_SIZE);
+      baud, SERIAL_SIZE_RX, BUFFER_SIZE);
 
   size_for_1sec = baud / 10; // 8n1=10baudFor8bits
   logger->printf("led changes state every %zd bytes (= 1 second)\n", size_for_1sec);
@@ -91,7 +91,8 @@ void setup() {
   // bind RX and TX
   USC0(0) |= (1 << UCLBE);
 
-  while (Serial.read() == -1);
+  while (Serial.read() == -1)
+    ;
   if (Serial.hasOverrun()) {
     logger->print("overrun?\n");
   }
@@ -107,9 +108,7 @@ void loop() {
     maxlen = BUFFER_SIZE - out_idx;
   }
   // check if not cycling more than buffer size relatively to input
-  size_t in_out = out_idx == in_idx ?
-                  BUFFER_SIZE :
-                  (in_idx + BUFFER_SIZE - out_idx - 1) % BUFFER_SIZE;
+  size_t in_out = out_idx == in_idx ? BUFFER_SIZE : (in_idx + BUFFER_SIZE - out_idx - 1) % BUFFER_SIZE;
   if (maxlen > in_out) {
     maxlen = in_out;
   }
@@ -172,7 +171,7 @@ void loop() {
 
     unsigned long now_ms = millis();
     int bwkbps_avg = ((((uint64_t)in_total) * 8000) / (now_ms - start_ms)) >> 10;
-    int bwkbps_now = (((in_total - in_prev) * 8000) / (now_ms - last_ms)) >> 10 ;
+    int bwkbps_now = (((in_total - in_prev) * 8000) / (now_ms - last_ms)) >> 10;
     logger->printf("bwavg=%d bwnow=%d kbps maxavail=%i\n", bwkbps_avg, bwkbps_now, maxavail);
 
     in_prev = in_total;
diff --git a/libraries/esp8266/examples/SigmaDeltaDemo/SigmaDeltaDemo.ino b/libraries/esp8266/examples/SigmaDeltaDemo/SigmaDeltaDemo.ino
index bdc1799eb7..7b432bf2da 100644
--- a/libraries/esp8266/examples/SigmaDeltaDemo/SigmaDeltaDemo.ino
+++ b/libraries/esp8266/examples/SigmaDeltaDemo/SigmaDeltaDemo.ino
@@ -14,7 +14,6 @@ void setup() {
   Serial.println();
   Serial.println("Start Sigma Delta Example\n");
   Serial.printf("Frequency = %u\n", realFreq);
-
 }
 
 void loop() {
@@ -36,7 +35,6 @@ void loop() {
       sigmaDeltaWrite(0, duty);
       delay(10);
     }
-
   }
 
   Serial.println("Detaching builtin led & playing a blinkie\n");
diff --git a/libraries/esp8266/examples/StreamString/StreamString.ino b/libraries/esp8266/examples/StreamString/StreamString.ino
index c9c6b46025..446f1e0c75 100644
--- a/libraries/esp8266/examples/StreamString/StreamString.ino
+++ b/libraries/esp8266/examples/StreamString/StreamString.ino
@@ -21,7 +21,7 @@ void checksketch(const char* what, const char* res1, const char* res2) {
 #endif
 
 void testStringPtrProgmem() {
-  static const char inProgmem [] PROGMEM = "I am in progmem";
+  static const char inProgmem[] PROGMEM = "I am in progmem";
   auto inProgmem2 = F("I am too in progmem");
 
   int heap = (int)ESP.getFreeHeap();
@@ -46,7 +46,6 @@ void testStreamString() {
   // In non-default non-consume mode, it will just move a pointer.  That one
   // can be ::resetPointer(pos) anytime.  See the example below.
 
-
   // The String included in 'result' will not be modified by read:
   // (this is not the default)
   result.resetPointer();
@@ -182,7 +181,7 @@ void setup() {
   testStreamString();
 
   Serial.printf("sizeof: String:%d Stream:%d StreamString:%d SStream:%d\n",
-                (int)sizeof(String), (int)sizeof(Stream), (int)sizeof(StreamString), (int)sizeof(S2Stream));
+      (int)sizeof(String), (int)sizeof(Stream), (int)sizeof(StreamString), (int)sizeof(S2Stream));
 }
 
 #endif
diff --git a/libraries/esp8266/examples/TestEspApi/TestEspApi.ino b/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
index 49ff525898..0daff924c4 100644
--- a/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
+++ b/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
@@ -28,7 +28,7 @@ Stream& ehConsolePort(Serial);
 // UNLESS: You swap the TX pin using the alternate pinout.
 const uint8_t LED_PIN = 1;
 
-const char * const RST_REASONS[] = {
+const char* const RST_REASONS[] = {
   "REASON_DEFAULT_RST",
   "REASON_WDT_RST",
   "REASON_EXCEPTION_RST",
@@ -38,7 +38,7 @@ const char * const RST_REASONS[] = {
   "REASON_EXT_SYS_RST"
 };
 
-const char * const FLASH_SIZE_MAP_NAMES[] = {
+const char* const FLASH_SIZE_MAP_NAMES[] = {
   "FLASH_SIZE_4M_MAP_256_256",
   "FLASH_SIZE_2M",
   "FLASH_SIZE_8M_MAP_512_512",
@@ -48,14 +48,14 @@ const char * const FLASH_SIZE_MAP_NAMES[] = {
   "FLASH_SIZE_32M_MAP_1024_1024"
 };
 
-const char * const OP_MODE_NAMES[] {
+const char* const OP_MODE_NAMES[] {
   "NULL_MODE",
   "STATION_MODE",
   "SOFTAP_MODE",
   "STATIONAP_MODE"
 };
 
-const char * const AUTH_MODE_NAMES[] {
+const char* const AUTH_MODE_NAMES[] {
   "AUTH_OPEN",
   "AUTH_WEP",
   "AUTH_WPA_PSK",
@@ -64,14 +64,14 @@ const char * const AUTH_MODE_NAMES[] {
   "AUTH_MAX"
 };
 
-const char * const PHY_MODE_NAMES[] {
+const char* const PHY_MODE_NAMES[] {
   "",
   "PHY_MODE_11B",
   "PHY_MODE_11G",
   "PHY_MODE_11N"
 };
 
-const char * const EVENT_NAMES[] {
+const char* const EVENT_NAMES[] {
   "EVENT_STAMODE_CONNECTED",
   "EVENT_STAMODE_DISCONNECTED",
   "EVENT_STAMODE_AUTHMODE_CHANGE",
@@ -81,7 +81,7 @@ const char * const EVENT_NAMES[] {
   "EVENT_MAX"
 };
 
-const char * const EVENT_REASONS[] {
+const char* const EVENT_REASONS[] {
   "",
   "REASON_UNSPECIFIED",
   "REASON_AUTH_EXPIRE",
@@ -108,12 +108,12 @@ const char * const EVENT_REASONS[] {
   "REASON_CIPHER_SUITE_REJECTED",
 };
 
-const char * const EVENT_REASONS_200[] {
+const char* const EVENT_REASONS_200[] {
   "REASON_BEACON_TIMEOUT",
   "REASON_NO_AP_FOUND"
 };
 
-void wifi_event_handler_cb(System_Event_t * event) {
+void wifi_event_handler_cb(System_Event_t* event) {
   ehConsolePort.print(EVENT_NAMES[event->event]);
   ehConsolePort.print(" (");
 
@@ -128,27 +128,26 @@ void wifi_event_handler_cb(System_Event_t * event) {
       break;
     case EVENT_SOFTAPMODE_STACONNECTED:
     case EVENT_SOFTAPMODE_STADISCONNECTED: {
-        char mac[32] = {0};
-        snprintf(mac, 32, MACSTR ", aid: %d", MAC2STR(event->event_info.sta_connected.mac), event->event_info.sta_connected.aid);
+      char mac[32] = { 0 };
+      snprintf(mac, 32, MACSTR ", aid: %d", MAC2STR(event->event_info.sta_connected.mac), event->event_info.sta_connected.aid);
 
-        ehConsolePort.print(mac);
-      }
-      break;
+      ehConsolePort.print(mac);
+    } break;
   }
 
   ehConsolePort.println(")");
 }
 
-void print_softap_config(Stream & consolePort, softap_config const& config) {
+void print_softap_config(Stream& consolePort, softap_config const& config) {
   consolePort.println();
   consolePort.println(F("SoftAP Configuration"));
   consolePort.println(F("--------------------"));
 
   consolePort.print(F("ssid:            "));
-  consolePort.println((char *) config.ssid);
+  consolePort.println((char*)config.ssid);
 
   consolePort.print(F("password:        "));
-  consolePort.println((char *) config.password);
+  consolePort.println((char*)config.password);
 
   consolePort.print(F("ssid_len:        "));
   consolePort.println(config.ssid_len);
@@ -173,8 +172,8 @@ void print_softap_config(Stream & consolePort, softap_config const& config) {
   consolePort.println();
 }
 
-void print_system_info(Stream & consolePort) {
-  const rst_info * resetInfo = system_get_rst_info();
+void print_system_info(Stream& consolePort) {
+  const rst_info* resetInfo = system_get_rst_info();
   consolePort.print(F("system_get_rst_info() reset reason: "));
   consolePort.println(RST_REASONS[resetInfo->reason]);
 
@@ -211,7 +210,7 @@ void print_system_info(Stream & consolePort) {
   consolePort.println(FLASH_SIZE_MAP_NAMES[system_get_flash_size_map()]);
 }
 
-void print_wifi_general(Stream & consolePort) {
+void print_wifi_general(Stream& consolePort) {
   consolePort.print(F("wifi_get_channel(): "));
   consolePort.println(wifi_get_channel());
 
@@ -219,8 +218,8 @@ void print_wifi_general(Stream & consolePort) {
   consolePort.println(PHY_MODE_NAMES[wifi_get_phy_mode()]);
 }
 
-void secure_softap_config(softap_config * config, const char * ssid, const char * password) {
-  size_t ssidLen     = strlen(ssid)     < sizeof(config->ssid)     ? strlen(ssid)     : sizeof(config->ssid);
+void secure_softap_config(softap_config* config, const char* ssid, const char* password) {
+  size_t ssidLen = strlen(ssid) < sizeof(config->ssid) ? strlen(ssid) : sizeof(config->ssid);
   size_t passwordLen = strlen(password) < sizeof(config->password) ? strlen(password) : sizeof(config->password);
 
   memset(config->ssid, 0, sizeof(config->ssid));
@@ -230,7 +229,7 @@ void secure_softap_config(softap_config * config, const char * ssid, const char
   memcpy(config->password, password, passwordLen);
 
   config->ssid_len = ssidLen;
-  config->channel  = 1;
+  config->channel = 1;
   config->authmode = AUTH_WPA2_PSK;
   //    config->ssid_hidden = 1;
   config->max_connection = 4;
@@ -293,4 +292,3 @@ void loop() {
   Serial.println(system_get_time());
   delay(1000);
 }
-
diff --git a/libraries/esp8266/examples/UartDownload/UartDownload.ino b/libraries/esp8266/examples/UartDownload/UartDownload.ino
index cf581c8890..97a28813dc 100644
--- a/libraries/esp8266/examples/UartDownload/UartDownload.ino
+++ b/libraries/esp8266/examples/UartDownload/UartDownload.ino
@@ -59,9 +59,8 @@ constexpr char slipFrameMarker = '\xC0';
 //   <0xC0><cmd><payload length><32 bit cksum><payload data ...><0xC0>
 // Slip packet for ESP_SYNC, minus the frame markers ('\xC0') captured from
 // esptool using the `--trace` option.
-const char syncPkt[] PROGMEM =
-  "\x00\x08\x24\x00\x00\x00\x00\x00\x07\x07\x12\x20"
-  "UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU";
+const char syncPkt[] PROGMEM = "\x00\x08\x24\x00\x00\x00\x00\x00\x07\x07\x12\x20"
+                               "UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU";
 
 constexpr size_t syncPktSz = sizeof(syncPkt) - 1; // Don't compare zero terminator char
 
@@ -90,7 +89,7 @@ void proxyEspSync() {
   }
 
   // Assume RX FIFO data is garbled and flush all RX data.
-  while (0 <= Serial.read()) {} // Clear FIFO
+  while (0 <= Serial.read()) { } // Clear FIFO
 
   // If your Serial requirements need a specific timeout value, you would
   // restore those here.
@@ -112,12 +111,12 @@ void setup() {
   Serial.begin(115200);
 
   Serial.println(F(
-                   "\r\n\r\n"
-                   "Boot UART Download Demo - initialization started.\r\n"
-                   "\r\n"
-                   "For a quick test to see the UART Download work,\r\n"
-                   "stop your serial terminal APP and run:\r\n"
-                   "  esptool.py --chip esp8266 --before no_reset --after soft_reset flash_id\r\n"));
+      "\r\n\r\n"
+      "Boot UART Download Demo - initialization started.\r\n"
+      "\r\n"
+      "For a quick test to see the UART Download work,\r\n"
+      "stop your serial terminal APP and run:\r\n"
+      "  esptool.py --chip esp8266 --before no_reset --after soft_reset flash_id\r\n"));
 
   // ...
 }
@@ -143,7 +142,7 @@ void cmdLoop(Print& oStream, int key) {
       ESP.restart();
       break;
 
-    // ...
+      // ...
 
     case '?':
       oStream.println(F("\r\nHot key help:"));
@@ -162,7 +161,6 @@ void cmdLoop(Print& oStream, int key) {
   oStream.println();
 }
 
-
 void loop() {
 
   // In this example, we can have Serial data from a user keystroke for our
diff --git a/libraries/esp8266/examples/interactive/interactive.ino b/libraries/esp8266/examples/interactive/interactive.ino
index b3bd1ff931..a13b817508 100644
--- a/libraries/esp8266/examples/interactive/interactive.ino
+++ b/libraries/esp8266/examples/interactive/interactive.ino
@@ -12,11 +12,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char * SSID = STASSID;
-const char * PSK = STAPSK;
+const char* SSID = STASSID;
+const char* PSK = STAPSK;
 
 IPAddress staticip(192, 168, 1, 123);
 IPAddress gateway(192, 168, 1, 254);
@@ -36,15 +36,14 @@ void setup() {
   Serial.println();
   Serial.println(WiFi.localIP());
   Serial.print(
-    "WL_IDLE_STATUS      = 0\n"
-    "WL_NO_SSID_AVAIL    = 1\n"
-    "WL_SCAN_COMPLETED   = 2\n"
-    "WL_CONNECTED        = 3\n"
-    "WL_CONNECT_FAILED   = 4\n"
-    "WL_CONNECTION_LOST  = 5\n"
-    "WL_WRONG_PASSWORD   = 6\n"
-    "WL_DISCONNECTED     = 7\n"
-  );
+      "WL_IDLE_STATUS      = 0\n"
+      "WL_NO_SSID_AVAIL    = 1\n"
+      "WL_SCAN_COMPLETED   = 2\n"
+      "WL_CONNECTED        = 3\n"
+      "WL_CONNECT_FAILED   = 4\n"
+      "WL_CONNECTION_LOST  = 5\n"
+      "WL_WRONG_PASSWORD   = 6\n"
+      "WL_DISCONNECTED     = 7\n");
 }
 
 void WiFiOn() {
@@ -63,11 +62,18 @@ void WiFiOff() {
 }
 
 void loop() {
-#define TEST(name, var, varinit, func) \
+#define TEST(name, var, varinit, func)   \
   static decltype(func) var = (varinit); \
-  if ((var) != (func)) { var = (func); Serial.printf("**** %s: ", name); Serial.println(var); }
+  if ((var) != (func)) {                 \
+    var = (func);                        \
+    Serial.printf("**** %s: ", name);    \
+    Serial.println(var);                 \
+  }
 
-#define DO(x...) Serial.println(F( #x )); x; break
+#define DO(x...)         \
+  Serial.println(F(#x)); \
+  x;                     \
+  break
 
   TEST("Free Heap", freeHeap, 0, ESP.getFreeHeap());
   TEST("WiFiStatus", status, WL_IDLE_STATUS, WiFi.status());
@@ -75,23 +81,41 @@ void loop() {
   TEST("AP-IP", apIp, (uint32_t)0, WiFi.softAPIP());
 
   switch (Serial.read()) {
-    case 'F': DO(WiFiOff());
-    case 'N': DO(WiFiOn());
-    case '1': DO(WiFi.mode(WIFI_AP));
-    case '2': DO(WiFi.mode(WIFI_AP_STA));
-    case '3': DO(WiFi.mode(WIFI_STA));
-    case 'R': DO(if (((GPI >> 16) & 0xf) == 1) ESP.reset() /* else must hard reset */);
-    case 'd': DO(WiFi.disconnect());
-    case 'b': DO(WiFi.begin());
-    case 'B': DO(WiFi.begin(SSID, PSK));
-    case 'r': DO(WiFi.reconnect());
-    case 'c': DO(wifi_station_connect());
-    case 'a': DO(WiFi.setAutoReconnect(false));
-    case 'A': DO(WiFi.setAutoReconnect(true));
-    case 'n': DO(WiFi.setSleepMode(WIFI_NONE_SLEEP));
-    case 'l': DO(WiFi.setSleepMode(WIFI_LIGHT_SLEEP));
-    case 'm': DO(WiFi.setSleepMode(WIFI_MODEM_SLEEP));
-    case 'S': DO(WiFi.config(staticip, gateway, subnet)); // use static address
-    case 's': DO(WiFi.config(0u, 0u, 0u));                // back to dhcp client
+    case 'F':
+      DO(WiFiOff());
+    case 'N':
+      DO(WiFiOn());
+    case '1':
+      DO(WiFi.mode(WIFI_AP));
+    case '2':
+      DO(WiFi.mode(WIFI_AP_STA));
+    case '3':
+      DO(WiFi.mode(WIFI_STA));
+    case 'R':
+      DO(if (((GPI >> 16) & 0xf) == 1) ESP.reset() /* else must hard reset */);
+    case 'd':
+      DO(WiFi.disconnect());
+    case 'b':
+      DO(WiFi.begin());
+    case 'B':
+      DO(WiFi.begin(SSID, PSK));
+    case 'r':
+      DO(WiFi.reconnect());
+    case 'c':
+      DO(wifi_station_connect());
+    case 'a':
+      DO(WiFi.setAutoReconnect(false));
+    case 'A':
+      DO(WiFi.setAutoReconnect(true));
+    case 'n':
+      DO(WiFi.setSleepMode(WIFI_NONE_SLEEP));
+    case 'l':
+      DO(WiFi.setSleepMode(WIFI_LIGHT_SLEEP));
+    case 'm':
+      DO(WiFi.setSleepMode(WIFI_MODEM_SLEEP));
+    case 'S':
+      DO(WiFi.config(staticip, gateway, subnet)); // use static address
+    case 's':
+      DO(WiFi.config(0u, 0u, 0u)); // back to dhcp client
   }
 }
diff --git a/libraries/esp8266/examples/irammem/irammem.ino b/libraries/esp8266/examples/irammem/irammem.ino
index 5cd1db7b36..429b9a389c 100644
--- a/libraries/esp8266/examples/irammem/irammem.ino
+++ b/libraries/esp8266/examples/irammem/irammem.ino
@@ -9,7 +9,6 @@
 
 // #define USE_SET_IRAM_HEAP
 
-
 #ifndef ETS_PRINTF
 #define ETS_PRINTF ets_uart_printf
 #endif
@@ -21,9 +20,8 @@
 
 #pragma GCC push_options
 // reference
-#pragma GCC optimize("O0")   // We expect -O0 to generate the correct results
-__attribute__((noinline))
-void aliasTestReference(uint16_t *x) {
+#pragma GCC optimize("O0") // We expect -O0 to generate the correct results
+__attribute__((noinline)) void aliasTestReference(uint16_t* x) {
   // Without adhearance to strict-aliasing, this sequence of code would fail
   // when optimized by GCC Version 10.3
   size_t len = 3;
@@ -36,8 +34,7 @@ void aliasTestReference(uint16_t *x) {
 }
 // Tests
 #pragma GCC optimize("Os")
-__attribute__((noinline))
-void aliasTestOs(uint16_t *x) {
+__attribute__((noinline)) void aliasTestOs(uint16_t* x) {
   size_t len = 3;
   for (size_t u = 0; u < len; u++) {
     uint16_t x1 = mmu_get_uint16(&x[0]);
@@ -47,8 +44,7 @@ void aliasTestOs(uint16_t *x) {
   }
 }
 #pragma GCC optimize("O2")
-__attribute__((noinline))
-void aliasTestO2(uint16_t *x) {
+__attribute__((noinline)) void aliasTestO2(uint16_t* x) {
   size_t len = 3;
   for (size_t u = 0; u < len; u++) {
     uint16_t x1 = mmu_get_uint16(&x[0]);
@@ -58,8 +54,7 @@ void aliasTestO2(uint16_t *x) {
   }
 }
 #pragma GCC optimize("O3")
-__attribute__((noinline))
-void aliasTestO3(uint16_t *x) {
+__attribute__((noinline)) void aliasTestO3(uint16_t* x) {
   size_t len = 3;
   for (size_t u = 0; u < len; u++) {
     uint16_t x1 = mmu_get_uint16(&x[0]);
@@ -74,7 +69,8 @@ void aliasTestO3(uint16_t *x) {
 // the exception handler. For this case the -O0 version will appear faster.
 #pragma GCC optimize("O0")
 __attribute__((noinline)) IRAM_ATTR
-uint32_t timedRead_Reference(uint8_t *res) {
+    uint32_t
+    timedRead_Reference(uint8_t* res) {
   // This test case was verified with GCC 10.3
   // There is a code case that can result in 32-bit wide IRAM load from memory
   // being optimized down to an 8-bit memory access. In this test case we need
@@ -82,31 +78,34 @@ uint32_t timedRead_Reference(uint8_t *res) {
   // This section verifies that the workaround implimented by the inline
   // function mmu_get_uint8() is preventing this. See comments for function
   // mmu_get_uint8(() in mmu_iram.h for more details.
-  const uint8_t *x = (const uint8_t *)0x40100003ul;
+  const uint8_t* x = (const uint8_t*)0x40100003ul;
   uint32_t b = ESP.getCycleCount();
   *res = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC optimize("Os")
 __attribute__((noinline)) IRAM_ATTR
-uint32_t timedRead_Os(uint8_t *res) {
-  const uint8_t *x = (const uint8_t *)0x40100003ul;
+    uint32_t
+    timedRead_Os(uint8_t* res) {
+  const uint8_t* x = (const uint8_t*)0x40100003ul;
   uint32_t b = ESP.getCycleCount();
   *res = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC optimize("O2")
 __attribute__((noinline)) IRAM_ATTR
-uint32_t timedRead_O2(uint8_t *res) {
-  const uint8_t *x = (const uint8_t *)0x40100003ul;
+    uint32_t
+    timedRead_O2(uint8_t* res) {
+  const uint8_t* x = (const uint8_t*)0x40100003ul;
   uint32_t b = ESP.getCycleCount();
   *res = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC optimize("O3")
 __attribute__((noinline)) IRAM_ATTR
-uint32_t timedRead_O3(uint8_t *res) {
-  const uint8_t *x = (const uint8_t *)0x40100003ul;
+    uint32_t
+    timedRead_O3(uint8_t* res) {
+  const uint8_t* x = (const uint8_t*)0x40100003ul;
   uint32_t b = ESP.getCycleCount();
   *res = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
@@ -153,7 +152,7 @@ bool test4_32bit_loads() {
   return result;
 }
 
-void printPunFail(uint16_t *ref, uint16_t *x, size_t sz) {
+void printPunFail(uint16_t* ref, uint16_t* x, size_t sz) {
   Serial.printf("    Expected:");
   for (size_t i = 0; i < sz; i++) {
     Serial.printf(" %3u", ref[i]);
@@ -168,12 +167,12 @@ void printPunFail(uint16_t *ref, uint16_t *x, size_t sz) {
 bool testPunning() {
   bool result = true;
   // Get reference result for verifing test
-  alignas(uint32_t) uint16_t x_ref[] = {1, 2, 3, 0};
-  aliasTestReference(x_ref);  // -O0
+  alignas(uint32_t) uint16_t x_ref[] = { 1, 2, 3, 0 };
+  aliasTestReference(x_ref); // -O0
   Serial.printf("mmu_get_uint16() strict-aliasing tests with different optimizations:\r\n");
 
   {
-    alignas(alignof(uint32_t)) uint16_t x[] = {1, 2, 3, 0};
+    alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
     aliasTestOs(x);
     Serial.printf("  Option -Os ");
     if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
@@ -185,7 +184,7 @@ bool testPunning() {
     }
   }
   {
-    alignas(alignof(uint32_t)) uint16_t x[] = {1, 2, 3, 0};
+    alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
     aliasTestO2(x);
     Serial.printf("  Option -O2 ");
     if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
@@ -197,7 +196,7 @@ bool testPunning() {
     }
   }
   {
-    alignas(alignof(uint32_t)) uint16_t x[] = {1, 2, 3, 0};
+    alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
     aliasTestO3(x);
     Serial.printf("  Option -O3 ");
     if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
@@ -211,8 +210,7 @@ bool testPunning() {
   return result;
 }
 
-
-uint32_t cyclesToRead_nKx32(int n, unsigned int *x, uint32_t *res) {
+uint32_t cyclesToRead_nKx32(int n, unsigned int* x, uint32_t* res) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
@@ -222,7 +220,7 @@ uint32_t cyclesToRead_nKx32(int n, unsigned int *x, uint32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx32(int n, unsigned int *x) {
+uint32_t cyclesToWrite_nKx32(int n, unsigned int* x) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
@@ -232,7 +230,7 @@ uint32_t cyclesToWrite_nKx32(int n, unsigned int *x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx16(int n, unsigned short *x, uint32_t *res) {
+uint32_t cyclesToRead_nKx16(int n, unsigned short* x, uint32_t* res) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
@@ -242,7 +240,7 @@ uint32_t cyclesToRead_nKx16(int n, unsigned short *x, uint32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx16(int n, unsigned short *x) {
+uint32_t cyclesToWrite_nKx16(int n, unsigned short* x) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
@@ -252,7 +250,7 @@ uint32_t cyclesToWrite_nKx16(int n, unsigned short *x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKxs16(int n, short *x, int32_t *res) {
+uint32_t cyclesToRead_nKxs16(int n, short* x, int32_t* res) {
   uint32_t b = ESP.getCycleCount();
   int32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
@@ -262,7 +260,7 @@ uint32_t cyclesToRead_nKxs16(int n, short *x, int32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKxs16(int n, short *x) {
+uint32_t cyclesToWrite_nKxs16(int n, short* x) {
   uint32_t b = ESP.getCycleCount();
   int32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
@@ -272,7 +270,7 @@ uint32_t cyclesToWrite_nKxs16(int n, short *x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx8(int n, unsigned char*x, uint32_t *res) {
+uint32_t cyclesToRead_nKx8(int n, unsigned char* x, uint32_t* res) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
@@ -282,7 +280,7 @@ uint32_t cyclesToRead_nKx8(int n, unsigned char*x, uint32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx8(int n, unsigned char*x) {
+uint32_t cyclesToWrite_nKx8(int n, unsigned char* x) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
@@ -293,7 +291,7 @@ uint32_t cyclesToWrite_nKx8(int n, unsigned char*x) {
 }
 
 // Compare with Inline
-uint32_t cyclesToRead_nKx16_viaInline(int n, unsigned short *x, uint32_t *res) {
+uint32_t cyclesToRead_nKx16_viaInline(int n, unsigned short* x, uint32_t* res) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
@@ -303,7 +301,7 @@ uint32_t cyclesToRead_nKx16_viaInline(int n, unsigned short *x, uint32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short *x) {
+uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short* x) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
@@ -314,7 +312,7 @@ uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short *x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKxs16_viaInline(int n, short *x, int32_t *res) {
+uint32_t cyclesToRead_nKxs16_viaInline(int n, short* x, int32_t* res) {
   uint32_t b = ESP.getCycleCount();
   int32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
@@ -324,7 +322,7 @@ uint32_t cyclesToRead_nKxs16_viaInline(int n, short *x, int32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKxs16_viaInline(int n, short *x) {
+uint32_t cyclesToWrite_nKxs16_viaInline(int n, short* x) {
   uint32_t b = ESP.getCycleCount();
   int32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
@@ -335,7 +333,7 @@ uint32_t cyclesToWrite_nKxs16_viaInline(int n, short *x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx8_viaInline(int n, unsigned char*x, uint32_t *res) {
+uint32_t cyclesToRead_nKx8_viaInline(int n, unsigned char* x, uint32_t* res) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
@@ -345,7 +343,7 @@ uint32_t cyclesToRead_nKx8_viaInline(int n, unsigned char*x, uint32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char*x) {
+uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char* x) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
@@ -356,14 +354,14 @@ uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char*x) {
   return ESP.getCycleCount() - b;
 }
 
-
-bool perfTest_nK(int nK, uint32_t *mem, uint32_t *imem) {
+bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
   uint32_t res, verify_res;
   uint32_t t;
   bool success = true;
   int sres, verify_sres;
 
-  Serial.printf("\r\nPerformance numbers for 16 bit access - using inline macros or exception handling for IRAM.\r\n");;
+  Serial.printf("\r\nPerformance numbers for 16 bit access - using inline macros or exception handling for IRAM.\r\n");
+  ;
   t = cyclesToWrite_nKx16(nK, (uint16_t*)mem);
   Serial.printf("DRAM Memory Write:         %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx16(nK, (uint16_t*)mem, &verify_res);
@@ -416,7 +414,8 @@ bool perfTest_nK(int nK, uint32_t *mem, uint32_t *imem) {
     success = false;
   }
 
-  Serial.printf("\r\nPerformance numbers for 8 bit access - using inline macros or exception handling for IRAM access.\r\n");;
+  Serial.printf("\r\nPerformance numbers for 8 bit access - using inline macros or exception handling for IRAM access.\r\n");
+  ;
   t = cyclesToWrite_nKx8(nK, (uint8_t*)mem);
   Serial.printf("DRAM Memory Write:         %7d cycles for %dK by  uint8, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx8(nK, (uint8_t*)mem, &verify_res);
@@ -467,7 +466,7 @@ void setup() {
   // IRAM region.  It will continue to use the builtin DRAM until we request
   // otherwise.
   Serial.printf("DRAM free: %6d\r\n", ESP.getFreeHeap());
-  uint32_t *mem = (uint32_t *)malloc(2 * 1024 * sizeof(uint32_t));
+  uint32_t* mem = (uint32_t*)malloc(2 * 1024 * sizeof(uint32_t));
   Serial.printf("DRAM buffer: Address %p, free %d\r\n", mem, ESP.getFreeHeap());
   if (!mem) {
     return;
@@ -477,12 +476,12 @@ void setup() {
 #ifdef USE_SET_IRAM_HEAP
   ESP.setIramHeap();
   Serial.printf("IRAM free: %6d\r\n", ESP.getFreeHeap());
-  uint32_t *imem = (uint32_t *)malloc(2 * 1024 * sizeof(uint32_t));
+  uint32_t* imem = (uint32_t*)malloc(2 * 1024 * sizeof(uint32_t));
   Serial.printf("IRAM buffer: Address %p, free %d\r\n", imem, ESP.getFreeHeap());
   // Make sure we go back to the DRAM heap for other allocations.  Don't forget to ESP.resetHeap()!
   ESP.resetHeap();
 #else
-  uint32_t *imem;
+  uint32_t* imem;
   {
     HeapSelectIram ephemeral;
     // This class effectively does this
@@ -491,7 +490,7 @@ void setup() {
     //  ...
     // umm_set_heap_by_id(_heap_id);
     Serial.printf("IRAM free: %6d\r\n", ESP.getFreeHeap());
-    imem = (uint32_t *)malloc(2 * 1024 * sizeof(uint32_t));
+    imem = (uint32_t*)malloc(2 * 1024 * sizeof(uint32_t));
     Serial.printf("IRAM buffer: Address %p, free %d\r\n", imem, ESP.getFreeHeap());
   }
 #endif
@@ -502,7 +501,8 @@ void setup() {
   uint32_t res;
   uint32_t t;
   int nK = 1;
-  Serial.printf("\r\nPerformance numbers for 32 bit access - no exception handler or inline macros needed.\r\n");;
+  Serial.printf("\r\nPerformance numbers for 32 bit access - no exception handler or inline macros needed.\r\n");
+  ;
   t = cyclesToWrite_nKx32(nK, mem);
   Serial.printf("DRAM Memory Write:         %7d cycles for %dK by uint32, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx32(nK, mem, &res);
@@ -514,7 +514,6 @@ void setup() {
   Serial.printf("IRAM Memory Read:          %7d cycles for %dK by uint32, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), res);
   Serial.println();
 
-
   if (perfTest_nK(1, mem, imem) && testPunning() && test4_32bit_loads()) {
     Serial.println();
   } else {
@@ -596,9 +595,9 @@ void setup() {
     uint8_t hfrag;
     ESP.getHeapStats(&hfree, &hmax, &hfrag);
     ETS_PRINTF("ESP.getHeapStats(free: %u, max: %u, frag: %u)\n",
-               hfree, hmax, hfrag);
+        hfree, hmax, hfrag);
     if (free_iram > UMM_OVERHEAD_ADJUST) {
-      void *all = malloc(free_iram - UMM_OVERHEAD_ADJUST);
+      void* all = malloc(free_iram - UMM_OVERHEAD_ADJUST);
       ETS_PRINTF("%p = malloc(%u)\n", all, free_iram);
       umm_info(NULL, true);
 
@@ -614,26 +613,26 @@ void setup() {
 void processKey(Print& out, int hotKey) {
   switch (hotKey) {
     case 'd': {
-        HeapSelectDram ephemeral;
-        umm_info(NULL, true);
-        break;
-      }
+      HeapSelectDram ephemeral;
+      umm_info(NULL, true);
+      break;
+    }
     case 'i': {
+      HeapSelectIram ephemeral;
+      umm_info(NULL, true);
+      break;
+    }
+    case 'h': {
+      {
         HeapSelectIram ephemeral;
-        umm_info(NULL, true);
-        break;
+        Serial.printf(PSTR("IRAM ESP.getFreeHeap:  %u\n"), ESP.getFreeHeap());
       }
-    case 'h': {
-        {
-          HeapSelectIram ephemeral;
-          Serial.printf(PSTR("IRAM ESP.getFreeHeap:  %u\n"), ESP.getFreeHeap());
-        }
-        {
-          HeapSelectDram ephemeral;
-          Serial.printf(PSTR("DRAM ESP.getFreeHeap:  %u\r\n"), ESP.getFreeHeap());
-        }
-        break;
+      {
+        HeapSelectDram ephemeral;
+        Serial.printf(PSTR("DRAM ESP.getFreeHeap:  %u\r\n"), ESP.getFreeHeap());
       }
+      break;
+    }
     case 'R':
       out.printf_P(PSTR("Restart, ESP.restart(); ...\r\n"));
       ESP.restart();
@@ -660,7 +659,6 @@ void processKey(Print& out, int hotKey) {
   }
 }
 
-
 void loop(void) {
   if (Serial.available() > 0) {
     int hotKey = Serial.read();
diff --git a/libraries/esp8266/examples/virtualmem/virtualmem.ino b/libraries/esp8266/examples/virtualmem/virtualmem.ino
index 47b9396cc7..3a2fc65fe1 100644
--- a/libraries/esp8266/examples/virtualmem/virtualmem.ino
+++ b/libraries/esp8266/examples/virtualmem/virtualmem.ino
@@ -1,5 +1,5 @@
 
-uint32_t cyclesToRead1Kx32(unsigned int *x, uint32_t *res) {
+uint32_t cyclesToRead1Kx32(unsigned int* x, uint32_t* res) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
@@ -9,7 +9,7 @@ uint32_t cyclesToRead1Kx32(unsigned int *x, uint32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx32(unsigned int *x) {
+uint32_t cyclesToWrite1Kx32(unsigned int* x) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
@@ -19,8 +19,7 @@ uint32_t cyclesToWrite1Kx32(unsigned int *x) {
   return ESP.getCycleCount() - b;
 }
 
-
-uint32_t cyclesToRead1Kx16(unsigned short *x, uint32_t *res) {
+uint32_t cyclesToRead1Kx16(unsigned short* x, uint32_t* res) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
@@ -30,7 +29,7 @@ uint32_t cyclesToRead1Kx16(unsigned short *x, uint32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx16(unsigned short *x) {
+uint32_t cyclesToWrite1Kx16(unsigned short* x) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
@@ -40,7 +39,7 @@ uint32_t cyclesToWrite1Kx16(unsigned short *x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead1Kx8(unsigned char*x, uint32_t *res) {
+uint32_t cyclesToRead1Kx8(unsigned char* x, uint32_t* res) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
@@ -50,7 +49,7 @@ uint32_t cyclesToRead1Kx8(unsigned char*x, uint32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx8(unsigned char*x) {
+uint32_t cyclesToWrite1Kx8(unsigned char* x) {
   uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
@@ -66,12 +65,12 @@ void setup() {
 
   // Enabling VM does not change malloc to use the external region.  It will continue to
   // use the normal RAM until we request otherwise.
-  uint32_t *mem = (uint32_t *)malloc(1024 * sizeof(uint32_t));
+  uint32_t* mem = (uint32_t*)malloc(1024 * sizeof(uint32_t));
   Serial.printf("Internal buffer: Address %p, free %d\n", mem, ESP.getFreeHeap());
 
   // Now request from the VM heap
   ESP.setExternalHeap();
-  uint32_t *vm = (uint32_t *)malloc(1024 * sizeof(uint32_t));
+  uint32_t* vm = (uint32_t*)malloc(1024 * sizeof(uint32_t));
   Serial.printf("External buffer: Address %p, free %d\n", vm, ESP.getFreeHeap());
   // Make sure we go back to the internal heap for other allocations.  Don't forget to ESP.resetHeap()!
   ESP.resetHeap();
@@ -134,5 +133,4 @@ void setup() {
 }
 
 void loop() {
-
 }
diff --git a/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino b/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
index ed2943c278..c9139e6852 100644
--- a/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
+++ b/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
@@ -25,7 +25,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 #define LOGGERBAUD 115200
@@ -43,9 +43,9 @@ PPPServer ppp(&ppplink);
 
 void PPPConnectedCallback(netif* nif) {
   logger.printf("ppp: ip=%s/mask=%s/gw=%s\n",
-                IPAddress(&nif->ip_addr).toString().c_str(),
-                IPAddress(&nif->netmask).toString().c_str(),
-                IPAddress(&nif->gw).toString().c_str());
+      IPAddress(&nif->ip_addr).toString().c_str(),
+      IPAddress(&nif->netmask).toString().c_str(),
+      IPAddress(&nif->gw).toString().c_str());
 
   logger.printf("Heap before: %d\n", ESP.getFreeHeap());
   err_t ret = ip_napt_init(NAPT, NAPT_PORT);
@@ -80,9 +80,9 @@ void setup() {
     delay(500);
   }
   logger.printf("\nSTA: %s (dns: %s / %s)\n",
-                WiFi.localIP().toString().c_str(),
-                WiFi.dnsIP(0).toString().c_str(),
-                WiFi.dnsIP(1).toString().c_str());
+      WiFi.localIP().toString().c_str(),
+      WiFi.dnsIP(0).toString().c_str(),
+      WiFi.dnsIP(1).toString().c_str());
 
   ppplink.begin(PPPLINKBAUD);
   ppplink.enableIntTx(true);
@@ -97,7 +97,6 @@ void setup() {
   logger.printf("ppp: %d\n", ret);
 }
 
-
 #else
 
 void setup() {
diff --git a/libraries/lwIP_PPP/src/PPPServer.cpp b/libraries/lwIP_PPP/src/PPPServer.cpp
index 04512102fd..1b8279a56b 100644
--- a/libraries/lwIP_PPP/src/PPPServer.cpp
+++ b/libraries/lwIP_PPP/src/PPPServer.cpp
@@ -17,7 +17,9 @@
 #include "PPPServer.h"
 
 PPPServer::PPPServer(Stream* sio)
-    : _sio(sio), _cb(netif_status_cb_s), _enabled(false)
+    : _sio(sio)
+    , _cb(netif_status_cb_s)
+    , _enabled(false)
 {
 }
 
@@ -44,85 +46,85 @@ void PPPServer::link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx)
 
     switch (err_code)
     {
-        case PPPERR_NONE: /* No error. */
-        {
+    case PPPERR_NONE: /* No error. */
+    {
 #if LWIP_DNS
-            const ip_addr_t* ns;
+        const ip_addr_t* ns;
 #endif /* LWIP_DNS */
-            ets_printf("ppp_link_status_cb: PPPERR_NONE\n\r");
+        ets_printf("ppp_link_status_cb: PPPERR_NONE\n\r");
 #if LWIP_IPV4
-            ets_printf("   our_ip4addr = %s\n\r", ip4addr_ntoa(netif_ip4_addr(nif)));
-            ets_printf("   his_ipaddr  = %s\n\r", ip4addr_ntoa(netif_ip4_gw(nif)));
-            ets_printf("   netmask     = %s\n\r", ip4addr_ntoa(netif_ip4_netmask(nif)));
+        ets_printf("   our_ip4addr = %s\n\r", ip4addr_ntoa(netif_ip4_addr(nif)));
+        ets_printf("   his_ipaddr  = %s\n\r", ip4addr_ntoa(netif_ip4_gw(nif)));
+        ets_printf("   netmask     = %s\n\r", ip4addr_ntoa(netif_ip4_netmask(nif)));
 #endif /* LWIP_IPV4 */
 #if LWIP_IPV6
-            ets_printf("   our_ip6addr = %s\n\r", ip6addr_ntoa(netif_ip6_addr(nif, 0)));
+        ets_printf("   our_ip6addr = %s\n\r", ip6addr_ntoa(netif_ip6_addr(nif, 0)));
 #endif /* LWIP_IPV6 */
 
 #if LWIP_DNS
-            ns = dns_getserver(0);
-            ets_printf("   dns1        = %s\n\r", ipaddr_ntoa(ns));
-            ns = dns_getserver(1);
-            ets_printf("   dns2        = %s\n\r", ipaddr_ntoa(ns));
+        ns = dns_getserver(0);
+        ets_printf("   dns1        = %s\n\r", ipaddr_ntoa(ns));
+        ns = dns_getserver(1);
+        ets_printf("   dns2        = %s\n\r", ipaddr_ntoa(ns));
 #endif /* LWIP_DNS */
 #if PPP_IPV6_SUPPORT
-            ets_printf("   our6_ipaddr = %s\n\r", ip6addr_ntoa(netif_ip6_addr(nif, 0)));
+        ets_printf("   our6_ipaddr = %s\n\r", ip6addr_ntoa(netif_ip6_addr(nif, 0)));
 #endif /* PPP_IPV6_SUPPORT */
-        }
-            stop = false;
-            break;
+    }
+        stop = false;
+        break;
 
-        case PPPERR_PARAM: /* Invalid parameter. */
-            ets_printf("ppp_link_status_cb: PPPERR_PARAM\n");
-            break;
+    case PPPERR_PARAM: /* Invalid parameter. */
+        ets_printf("ppp_link_status_cb: PPPERR_PARAM\n");
+        break;
 
-        case PPPERR_OPEN: /* Unable to open PPP session. */
-            ets_printf("ppp_link_status_cb: PPPERR_OPEN\n");
-            break;
+    case PPPERR_OPEN: /* Unable to open PPP session. */
+        ets_printf("ppp_link_status_cb: PPPERR_OPEN\n");
+        break;
 
-        case PPPERR_DEVICE: /* Invalid I/O device for PPP. */
-            ets_printf("ppp_link_status_cb: PPPERR_DEVICE\n");
-            break;
+    case PPPERR_DEVICE: /* Invalid I/O device for PPP. */
+        ets_printf("ppp_link_status_cb: PPPERR_DEVICE\n");
+        break;
 
-        case PPPERR_ALLOC: /* Unable to allocate resources. */
-            ets_printf("ppp_link_status_cb: PPPERR_ALLOC\n");
-            break;
+    case PPPERR_ALLOC: /* Unable to allocate resources. */
+        ets_printf("ppp_link_status_cb: PPPERR_ALLOC\n");
+        break;
 
-        case PPPERR_USER: /* User interrupt. */
-            ets_printf("ppp_link_status_cb: PPPERR_USER\n");
-            break;
+    case PPPERR_USER: /* User interrupt. */
+        ets_printf("ppp_link_status_cb: PPPERR_USER\n");
+        break;
 
-        case PPPERR_CONNECT: /* Connection lost. */
-            ets_printf("ppp_link_status_cb: PPPERR_CONNECT\n");
-            break;
+    case PPPERR_CONNECT: /* Connection lost. */
+        ets_printf("ppp_link_status_cb: PPPERR_CONNECT\n");
+        break;
 
-        case PPPERR_AUTHFAIL: /* Failed authentication challenge. */
-            ets_printf("ppp_link_status_cb: PPPERR_AUTHFAIL\n");
-            break;
+    case PPPERR_AUTHFAIL: /* Failed authentication challenge. */
+        ets_printf("ppp_link_status_cb: PPPERR_AUTHFAIL\n");
+        break;
 
-        case PPPERR_PROTOCOL: /* Failed to meet protocol. */
-            ets_printf("ppp_link_status_cb: PPPERR_PROTOCOL\n");
-            break;
+    case PPPERR_PROTOCOL: /* Failed to meet protocol. */
+        ets_printf("ppp_link_status_cb: PPPERR_PROTOCOL\n");
+        break;
 
-        case PPPERR_PEERDEAD: /* Connection timeout. */
-            ets_printf("ppp_link_status_cb: PPPERR_PEERDEAD\n");
-            break;
+    case PPPERR_PEERDEAD: /* Connection timeout. */
+        ets_printf("ppp_link_status_cb: PPPERR_PEERDEAD\n");
+        break;
 
-        case PPPERR_IDLETIMEOUT: /* Idle Timeout. */
-            ets_printf("ppp_link_status_cb: PPPERR_IDLETIMEOUT\n");
-            break;
+    case PPPERR_IDLETIMEOUT: /* Idle Timeout. */
+        ets_printf("ppp_link_status_cb: PPPERR_IDLETIMEOUT\n");
+        break;
 
-        case PPPERR_CONNECTTIME: /* PPPERR_CONNECTTIME. */
-            ets_printf("ppp_link_status_cb: PPPERR_CONNECTTIME\n");
-            break;
+    case PPPERR_CONNECTTIME: /* PPPERR_CONNECTTIME. */
+        ets_printf("ppp_link_status_cb: PPPERR_CONNECTTIME\n");
+        break;
 
-        case PPPERR_LOOPBACK: /* Connection timeout. */
-            ets_printf("ppp_link_status_cb: PPPERR_LOOPBACK\n");
-            break;
+    case PPPERR_LOOPBACK: /* Connection timeout. */
+        ets_printf("ppp_link_status_cb: PPPERR_LOOPBACK\n");
+        break;
 
-        default:
-            ets_printf("ppp_link_status_cb: unknown errCode %d\n", err_code);
-            break;
+    default:
+        ets_printf("ppp_link_status_cb: unknown errCode %d\n", err_code);
+        break;
     }
 
     if (stop)
@@ -141,7 +143,7 @@ u32_t PPPServer::output_cb_s(ppp_pcb* pcb, u8_t* data, u32_t len, void* ctx)
 void PPPServer::netif_status_cb_s(netif* nif)
 {
     ets_printf("PPPNETIF: %c%c%d is %s\n", nif->name[0], nif->name[1], nif->num,
-               netif_is_up(nif) ? "UP" : "DOWN");
+        netif_is_up(nif) ? "UP" : "DOWN");
 #if LWIP_IPV4
     ets_printf("IPV4: Host at %s ", ip4addr_ntoa(netif_ip4_addr(nif)));
     ets_printf("mask %s ", ip4addr_ntoa(netif_ip4_netmask(nif)));
@@ -179,8 +181,8 @@ bool PPPServer::begin(const IPAddress& ourAddress, const IPAddress& peer)
 
     _enabled = true;
     if (!schedule_recurrent_function_us([&]()
-                                        { return this->handlePackets(); },
-                                        1000))
+            { return this->handlePackets(); },
+            1000))
     {
         netif_remove(&_netif);
         return false;
diff --git a/libraries/lwIP_PPP/src/PPPServer.h b/libraries/lwIP_PPP/src/PPPServer.h
index 5bae0ebe6b..326aa16f69 100644
--- a/libraries/lwIP_PPP/src/PPPServer.h
+++ b/libraries/lwIP_PPP/src/PPPServer.h
@@ -38,7 +38,7 @@
 
 class PPPServer
 {
-   public:
+public:
     PPPServer(Stream* sio);
 
     bool begin(const IPAddress& ourAddress, const IPAddress& peer = IPAddress(172, 31, 255, 254));
@@ -53,7 +53,7 @@ class PPPServer
         return &_netif.gw;
     }
 
-   protected:
+protected:
     static constexpr size_t _bufsize = 128;
     Stream* _sio;
     ppp_pcb* _ppp;
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
index 0fa4ca0989..bbc00041ca 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
@@ -149,7 +149,9 @@ void serial_printf(const char* fmt, ...)
 static const SPISettings spiSettings(20000000, MSBFIRST, SPI_MODE0);
 
 ENC28J60::ENC28J60(int8_t cs, SPIClass& spi, int8_t intr)
-    : _bank(ERXTX_BANK), _cs(cs), _spi(spi)
+    : _bank(ERXTX_BANK)
+    , _cs(cs)
+    , _spi(spi)
 {
     (void)intr;
 }
@@ -173,14 +175,14 @@ ENC28J60::is_mac_mii_reg(uint8_t reg)
     /* MAC or MII register (otherwise, ETH register)? */
     switch (_bank)
     {
-        case MACONX_BANK:
-            return reg < EIE;
-        case MAADRX_BANK:
-            return reg <= MAADR2 || reg == MISTAT;
-        case ERXTX_BANK:
-        case EPKTCNT_BANK:
-        default:
-            return 0;
+    case MACONX_BANK:
+        return reg < EIE;
+    case MAADRX_BANK:
+        return reg <= MAADR2 || reg == MISTAT;
+    case ERXTX_BANK:
+    case EPKTCNT_BANK:
+    default:
+        return 0;
     }
 }
 /*---------------------------------------------------------------------------*/
@@ -304,12 +306,12 @@ ENC28J60::readrev(void)
     rev = readreg(EREVID);
     switch (rev)
     {
-        case 2:
-            return 1;
-        case 6:
-            return 7;
-        default:
-            return rev;
+    case 2:
+        return 1;
+    case 6:
+        return 7;
+    default:
+        return rev;
     }
 }
 //#endif
@@ -463,8 +465,7 @@ bool ENC28J60::reset(void)
     setregbitfield(MACON1, MACON1_MARXEN | MACON1_TXPAUS | MACON1_RXPAUS);
 
     /* Set padding, crc, full duplex */
-    setregbitfield(MACON3, MACON3_PADCFG_FULL | MACON3_TXCRCEN | MACON3_FULDPX |
-                               MACON3_FRMLNEN);
+    setregbitfield(MACON3, MACON3_PADCFG_FULL | MACON3_TXCRCEN | MACON3_FULDPX | MACON3_FRMLNEN);
 
     /* Don't modify MACON4 */
 
@@ -616,8 +617,8 @@ ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen)
     else
     {
         PRINTF("enc28j60: tx: %d: %02x:%02x:%02x:%02x:%02x:%02x\n", datalen,
-               0xff & data[0], 0xff & data[1], 0xff & data[2],
-               0xff & data[3], 0xff & data[4], 0xff & data[5]);
+            0xff & data[0], 0xff & data[1], 0xff & data[2],
+            0xff & data[3], 0xff & data[4], 0xff & data[5]);
     }
 #endif
 
@@ -728,8 +729,8 @@ ENC28J60::readFrameData(uint8_t* buffer, uint16_t framesize)
         return 0;
     }
     PRINTF("enc28j60: rx: %d: %02x:%02x:%02x:%02x:%02x:%02x\n", _len,
-           0xff & buffer[0], 0xff & buffer[1], 0xff & buffer[2],
-           0xff & buffer[3], 0xff & buffer[4], 0xff & buffer[5]);
+        0xff & buffer[0], 0xff & buffer[1], 0xff & buffer[2],
+        0xff & buffer[3], 0xff & buffer[4], 0xff & buffer[5]);
 
     //received_packets++;
     //PRINTF("enc28j60: received_packets %d\n", received_packets);
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.h b/libraries/lwIP_enc28j60/src/utility/enc28j60.h
index fb544e1bfc..fe5ef49576 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.h
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.h
@@ -46,7 +46,7 @@
 */
 class ENC28J60
 {
-   public:
+public:
     /**
         Constructor that uses the default hardware SPI pins
         @param cs the Arduino Chip Select / Slave Select pin (default 10 on Uno)
@@ -79,7 +79,7 @@ class ENC28J60
     */
     virtual uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
 
-   protected:
+protected:
     static constexpr bool interruptIsPossible()
     {
         return false;
@@ -109,7 +109,7 @@ class ENC28J60
     */
     uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
 
-   private:
+private:
     uint8_t is_mac_mii_reg(uint8_t reg);
     uint8_t readreg(uint8_t reg);
     void writereg(uint8_t reg, uint8_t data);
diff --git a/libraries/lwIP_w5100/src/utility/w5100.cpp b/libraries/lwIP_w5100/src/utility/w5100.cpp
index 1251579744..aae85a154b 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.cpp
+++ b/libraries/lwIP_w5100/src/utility/w5100.cpp
@@ -204,7 +204,8 @@ void Wiznet5100::wizchip_sw_reset()
 }
 
 Wiznet5100::Wiznet5100(int8_t cs, SPIClass& spi, int8_t intr)
-    : _spi(spi), _cs(cs)
+    : _spi(spi)
+    , _cs(cs)
 {
     (void)intr;
 }
diff --git a/libraries/lwIP_w5100/src/utility/w5100.h b/libraries/lwIP_w5100/src/utility/w5100.h
index f099b22ea1..12c09085ef 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.h
+++ b/libraries/lwIP_w5100/src/utility/w5100.h
@@ -41,7 +41,7 @@
 
 class Wiznet5100
 {
-   public:
+public:
     /**
         Constructor that uses the default hardware SPI pins
         @param cs the Arduino Chip Select / Slave Select pin (default 10)
@@ -79,7 +79,7 @@ class Wiznet5100
     */
     uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
 
-   protected:
+protected:
     static constexpr bool interruptIsPossible()
     {
         return false;
@@ -109,7 +109,7 @@ class Wiznet5100
     */
     uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
 
-   private:
+private:
     static const uint16_t TxBufferAddress = 0x4000;                   /* Internal Tx buffer address of the iinchip */
     static const uint16_t RxBufferAddress = 0x6000;                   /* Internal Rx buffer address of the iinchip */
     static const uint8_t TxBufferSize = 0x3;                          /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
diff --git a/libraries/lwIP_w5500/src/utility/w5500.cpp b/libraries/lwIP_w5500/src/utility/w5500.cpp
index 90f607f0cf..723e85ac19 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.cpp
+++ b/libraries/lwIP_w5500/src/utility/w5500.cpp
@@ -278,7 +278,8 @@ int8_t Wiznet5500::wizphy_setphypmode(uint8_t pmode)
 }
 
 Wiznet5500::Wiznet5500(int8_t cs, SPIClass& spi, int8_t intr)
-    : _spi(spi), _cs(cs)
+    : _spi(spi)
+    , _cs(cs)
 {
     (void)intr;
 }
diff --git a/libraries/lwIP_w5500/src/utility/w5500.h b/libraries/lwIP_w5500/src/utility/w5500.h
index 8b41529610..232b0e7939 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.h
+++ b/libraries/lwIP_w5500/src/utility/w5500.h
@@ -41,7 +41,7 @@
 
 class Wiznet5500
 {
-   public:
+public:
     /**
         Constructor that uses the default hardware SPI pins
         @param cs the Arduino Chip Select / Slave Select pin (default 10)
@@ -79,7 +79,7 @@ class Wiznet5500
     */
     uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
 
-   protected:
+protected:
     static constexpr bool interruptIsPossible()
     {
         return false;
@@ -109,7 +109,7 @@ class Wiznet5500
     */
     uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
 
-   private:
+private:
     //< SPI interface Read operation in Control Phase
     static const uint8_t AccessModeRead = (0x00 << 2);
 
diff --git a/tests/astyle_core.conf b/tests/astyle_core.conf
deleted file mode 100644
index f9ee90adb6..0000000000
--- a/tests/astyle_core.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-# Code formatting rules for Arduino examples, taken from:
-#
-#   https://github.com/arduino/Arduino/blob/master/build/shared/examples_formatter.conf
-#
-
-mode=c
-lineend=linux
-style=allman
-
-# 4 spaces indentation
-indent=spaces=4
-
-# also indent macros
-#indent-preprocessor
-
-# indent classes, switches (and cases), comments starting at column 1
-indent-col1-comments
-
-# put a space around operators
-pad-oper
-
-# put a space after if/for/while
-pad-header
-
-# if you like one-liners, keep them
-keep-one-line-statements
-
-attach-closing-while
-unpad-paren
-pad-oper
-remove-comment-prefix
-add-braces
diff --git a/tests/astyle_examples.conf b/tests/astyle_examples.conf
deleted file mode 100644
index f3b77f2cb4..0000000000
--- a/tests/astyle_examples.conf
+++ /dev/null
@@ -1,44 +0,0 @@
-# Code formatting rules for Arduino examples, taken from:
-#
-#   https://github.com/arduino/Arduino/blob/master/build/shared/examples_formatter.conf
-#
-
-mode=c
-lineend=linux
-
-# 2 spaces indentation
-indent=spaces=2
-
-# also indent macros
-#indent-preprocessor
-
-# indent classes, switches (and cases), comments starting at column 1
-indent-classes
-indent-switches
-indent-cases
-indent-col1-comments
-
-# put a space around operators
-pad-oper
-
-# put a space after if/for/while
-pad-header
-
-# if you like one-liners, keep them
-keep-one-line-statements
-add-braces
-
-style=java
-attach-namespaces
-attach-classes
-attach-inlines
-attach-extern-c
-indent-modifiers
-indent-namespaces
-indent-labels
-#indent-preproc-block
-#indent-preproc-define
-#indent-preproc-cond
-unpad-paren
-add-braces
-remove-comment-prefix
\ No newline at end of file
diff --git a/tests/clang-format-arduino b/tests/clang-format-arduino
new file mode 100644
index 0000000000..69b5a295f8
--- /dev/null
+++ b/tests/clang-format-arduino
@@ -0,0 +1,5 @@
+BasedOnStyle: WebKit
+IndentWidth: 2
+SortIncludes: false
+BreakBeforeBraces: Attach
+IndentCaseLabels: true
diff --git a/.clang-format b/tests/clang-format-core
similarity index 88%
rename from .clang-format
rename to tests/clang-format-core
index 0bde5080d7..7d0d1d9c90 100644
--- a/.clang-format
+++ b/tests/clang-format-core
@@ -1,4 +1,4 @@
-BasedOnStyle: Chromium
+BasedOnStyle: WebKit
 AlignTrailingComments: true
 BreakBeforeBraces: Allman
 ColumnLimit: 0
diff --git a/tests/device/libraries/BSTest/src/BSArduino.h b/tests/device/libraries/BSTest/src/BSArduino.h
index f77e6d0f86..b70a265ea0 100644
--- a/tests/device/libraries/BSTest/src/BSArduino.h
+++ b/tests/device/libraries/BSTest/src/BSArduino.h
@@ -6,7 +6,7 @@ namespace bs
 {
 class ArduinoIOHelper
 {
-   public:
+public:
     ArduinoIOHelper(Stream& stream)
         : m_stream(stream)
     {
@@ -66,7 +66,7 @@ class ArduinoIOHelper
         return len;
     }
 
-   protected:
+protected:
     Stream& m_stream;
 };
 
diff --git a/tests/device/libraries/BSTest/src/BSArgs.h b/tests/device/libraries/BSTest/src/BSArgs.h
index e939f55534..d7ce60500f 100644
--- a/tests/device/libraries/BSTest/src/BSArgs.h
+++ b/tests/device/libraries/BSTest/src/BSArgs.h
@@ -17,19 +17,19 @@ namespace protocol
 {
 #define SS_FLAG_ESCAPE 0x8
 
-typedef enum
-{
-    /* parsing the space between arguments */
-    SS_SPACE = 0x0,
-    /* parsing an argument which isn't quoted */
-    SS_ARG = 0x1,
-    /* parsing a quoted argument */
-    SS_QUOTED_ARG = 0x2,
-    /* parsing an escape sequence within unquoted argument */
-    SS_ARG_ESCAPED = SS_ARG | SS_FLAG_ESCAPE,
-    /* parsing an escape sequence within a quoted argument */
-    SS_QUOTED_ARG_ESCAPED = SS_QUOTED_ARG | SS_FLAG_ESCAPE,
-} split_state_t;
+    typedef enum
+    {
+        /* parsing the space between arguments */
+        SS_SPACE = 0x0,
+        /* parsing an argument which isn't quoted */
+        SS_ARG = 0x1,
+        /* parsing a quoted argument */
+        SS_QUOTED_ARG = 0x2,
+        /* parsing an escape sequence within unquoted argument */
+        SS_ARG_ESCAPED = SS_ARG | SS_FLAG_ESCAPE,
+        /* parsing an escape sequence within a quoted argument */
+        SS_QUOTED_ARG_ESCAPED = SS_QUOTED_ARG | SS_FLAG_ESCAPE,
+    } split_state_t;
 
 /* helper macro, called when done with an argument */
 #define END_ARG()                      \
@@ -40,7 +40,7 @@ typedef enum
         state = SS_SPACE;              \
     } while (0);
 
-/**
+    /**
  * @brief Split command line into arguments in place
  *
  * - This function finds whitespace-separated arguments in the given input line.
@@ -64,26 +64,26 @@ typedef enum
  * @param argv_size number of elements in argv_array (max. number of arguments will be argv_size - 1)
  * @return number of arguments found (argc)
  */
-inline size_t split_args(char* line, char** argv, size_t argv_size)
-{
-    const int QUOTE = '"';
-    const int ESCAPE = '\\';
-    const int SPACE = ' ';
-    split_state_t state = SS_SPACE;
-    size_t argc = 0;
-    char* next_arg_start = line;
-    char* out_ptr = line;
-    for (char* in_ptr = line; argc < argv_size - 1; ++in_ptr)
+    inline size_t split_args(char* line, char** argv, size_t argv_size)
     {
-        int char_in = (unsigned char)*in_ptr;
-        if (char_in == 0)
+        const int QUOTE = '"';
+        const int ESCAPE = '\\';
+        const int SPACE = ' ';
+        split_state_t state = SS_SPACE;
+        size_t argc = 0;
+        char* next_arg_start = line;
+        char* out_ptr = line;
+        for (char* in_ptr = line; argc < argv_size - 1; ++in_ptr)
         {
-            break;
-        }
-        int char_out = -1;
+            int char_in = (unsigned char)*in_ptr;
+            if (char_in == 0)
+            {
+                break;
+            }
+            int char_out = -1;
 
-        switch (state)
-        {
+            switch (state)
+            {
             case SS_SPACE:
                 if (char_in == SPACE)
                 {
@@ -149,26 +149,26 @@ inline size_t split_args(char* line, char** argv, size_t argv_size)
                     char_out = char_in;
                 }
                 break;
+            }
+            /* need to output anything? */
+            if (char_out >= 0)
+            {
+                *out_ptr = char_out;
+                ++out_ptr;
+            }
         }
-        /* need to output anything? */
-        if (char_out >= 0)
+        /* make sure the final argument is terminated */
+        *out_ptr = 0;
+        /* finalize the last argument */
+        if (state != SS_SPACE && argc < argv_size - 1)
         {
-            *out_ptr = char_out;
-            ++out_ptr;
+            argv[argc++] = next_arg_start;
         }
-    }
-    /* make sure the final argument is terminated */
-    *out_ptr = 0;
-    /* finalize the last argument */
-    if (state != SS_SPACE && argc < argv_size - 1)
-    {
-        argv[argc++] = next_arg_start;
-    }
-    /* add a NULL at the end of argv */
-    argv[argc] = NULL;
+        /* add a NULL at the end of argv */
+        argv[argc] = NULL;
 
-    return argc;
-}
+        return argc;
+    }
 
 }  // namespace protocol
 
diff --git a/tests/device/libraries/BSTest/src/BSProtocol.h b/tests/device/libraries/BSTest/src/BSProtocol.h
index 08400e02ce..9b1d128ae1 100644
--- a/tests/device/libraries/BSTest/src/BSProtocol.h
+++ b/tests/device/libraries/BSTest/src/BSProtocol.h
@@ -11,115 +11,115 @@ namespace bs
 {
 namespace protocol
 {
-template <typename IO>
-void output_test_start(IO& io, const char* file, size_t line, const char* name, const char* desc)
-{
-    io.printf(BS_LINE_PREFIX "start file=\"%s\" line=%d name=\"%s\" desc=\"%s\"\n", file, line, name, desc);
-}
-
-template <typename IO>
-void output_check_failure(IO& io, size_t line)
-{
-    io.printf(BS_LINE_PREFIX "check_failure line=%d\n", line);
-}
-
-template <typename IO>
-void output_test_end(IO& io, bool success, size_t checks, size_t failed_checks, size_t line = 0)
-{
-    io.printf(BS_LINE_PREFIX "end line=%d result=%d checks=%d failed_checks=%d\n", line, success, checks, failed_checks);
-}
+    template <typename IO>
+    void output_test_start(IO& io, const char* file, size_t line, const char* name, const char* desc)
+    {
+        io.printf(BS_LINE_PREFIX "start file=\"%s\" line=%d name=\"%s\" desc=\"%s\"\n", file, line, name, desc);
+    }
 
-template <typename IO>
-void output_menu_begin(IO& io)
-{
-    io.printf(BS_LINE_PREFIX "menu_begin\n");
-}
+    template <typename IO>
+    void output_check_failure(IO& io, size_t line)
+    {
+        io.printf(BS_LINE_PREFIX "check_failure line=%d\n", line);
+    }
 
-template <typename IO>
-void output_menu_item(IO& io, int index, const char* name, const char* desc)
-{
-    io.printf(BS_LINE_PREFIX "item id=%d name=\"%s\" desc=\"%s\"\n", index, name, desc);
-}
+    template <typename IO>
+    void output_test_end(IO& io, bool success, size_t checks, size_t failed_checks, size_t line = 0)
+    {
+        io.printf(BS_LINE_PREFIX "end line=%d result=%d checks=%d failed_checks=%d\n", line, success, checks, failed_checks);
+    }
 
-template <typename IO>
-void output_menu_end(IO& io)
-{
-    io.printf(BS_LINE_PREFIX "menu_end\n");
-}
+    template <typename IO>
+    void output_menu_begin(IO& io)
+    {
+        io.printf(BS_LINE_PREFIX "menu_begin\n");
+    }
 
-template <typename IO>
-void output_setenv_result(IO& io, const char* key, const char* value)
-{
-    io.printf(BS_LINE_PREFIX "setenv key=\"%s\" value=\"%s\"\n", key, value);
-}
+    template <typename IO>
+    void output_menu_item(IO& io, int index, const char* name, const char* desc)
+    {
+        io.printf(BS_LINE_PREFIX "item id=%d name=\"%s\" desc=\"%s\"\n", index, name, desc);
+    }
 
-template <typename IO>
-void output_getenv_result(IO& io, const char* key, const char* value)
-{
-    (void)key;
-    io.printf(BS_LINE_PREFIX "getenv value=\"%s\"\n", value);
-}
+    template <typename IO>
+    void output_menu_end(IO& io)
+    {
+        io.printf(BS_LINE_PREFIX "menu_end\n");
+    }
 
-template <typename IO>
-void output_pretest_result(IO& io, bool res)
-{
-    io.printf(BS_LINE_PREFIX "pretest result=%d\n", res ? 1 : 0);
-}
+    template <typename IO>
+    void output_setenv_result(IO& io, const char* key, const char* value)
+    {
+        io.printf(BS_LINE_PREFIX "setenv key=\"%s\" value=\"%s\"\n", key, value);
+    }
 
-template <typename IO>
-bool input_handle(IO& io, char* line_buf, size_t line_buf_size, int& test_num)
-{
-    int cb_read = io.read_line(line_buf, line_buf_size);
-    if (cb_read == 0 || line_buf[0] == '\n')
+    template <typename IO>
+    void output_getenv_result(IO& io, const char* key, const char* value)
     {
-        return false;
+        (void)key;
+        io.printf(BS_LINE_PREFIX "getenv value=\"%s\"\n", value);
     }
-    char* argv[4];
-    size_t argc = split_args(line_buf, argv, sizeof(argv) / sizeof(argv[0]));
-    if (argc == 0)
+
+    template <typename IO>
+    void output_pretest_result(IO& io, bool res)
     {
-        return false;
+        io.printf(BS_LINE_PREFIX "pretest result=%d\n", res ? 1 : 0);
     }
-    if (strcmp(argv[0], "setenv") == 0)
+
+    template <typename IO>
+    bool input_handle(IO& io, char* line_buf, size_t line_buf_size, int& test_num)
     {
-        if (argc != 3)
+        int cb_read = io.read_line(line_buf, line_buf_size);
+        if (cb_read == 0 || line_buf[0] == '\n')
         {
             return false;
         }
-        setenv(argv[1], argv[2], 1);
-        output_setenv_result(io, argv[1], argv[2]);
-        test_num = -1;
-        return false; /* we didn't get the test number yet, so return false */
-    }
-    if (strcmp(argv[0], "getenv") == 0)
-    {
-        if (argc != 2)
+        char* argv[4];
+        size_t argc = split_args(line_buf, argv, sizeof(argv) / sizeof(argv[0]));
+        if (argc == 0)
         {
             return false;
         }
-        const char* value = getenv(argv[1]);
-        output_getenv_result(io, argv[1], (value != NULL) ? value : "");
-        return false;
-    }
-    if (strcmp(argv[0], "pretest") == 0)
-    {
-        if (argc != 1)
+        if (strcmp(argv[0], "setenv") == 0)
         {
+            if (argc != 3)
+            {
+                return false;
+            }
+            setenv(argv[1], argv[2], 1);
+            output_setenv_result(io, argv[1], argv[2]);
+            test_num = -1;
+            return false; /* we didn't get the test number yet, so return false */
+        }
+        if (strcmp(argv[0], "getenv") == 0)
+        {
+            if (argc != 2)
+            {
+                return false;
+            }
+            const char* value = getenv(argv[1]);
+            output_getenv_result(io, argv[1], (value != NULL) ? value : "");
             return false;
         }
-        bool res = ::pretest();
-        output_pretest_result(io, res);
-        return false;
-    }
-    /* not one of the commands, try to parse as test number */
-    char* endptr;
-    test_num = (int)strtol(argv[0], &endptr, 10);
-    if (endptr != argv[0] + strlen(argv[0]))
-    {
-        return false;
+        if (strcmp(argv[0], "pretest") == 0)
+        {
+            if (argc != 1)
+            {
+                return false;
+            }
+            bool res = ::pretest();
+            output_pretest_result(io, res);
+            return false;
+        }
+        /* not one of the commands, try to parse as test number */
+        char* endptr;
+        test_num = (int)strtol(argv[0], &endptr, 10);
+        if (endptr != argv[0] + strlen(argv[0]))
+        {
+            return false;
+        }
+        return true;
     }
-    return true;
-}
 
 }  // namespace protocol
 }  // namespace bs
diff --git a/tests/device/libraries/BSTest/src/BSStdio.h b/tests/device/libraries/BSTest/src/BSStdio.h
index 97a2c1230c..892ecaa9d4 100644
--- a/tests/device/libraries/BSTest/src/BSStdio.h
+++ b/tests/device/libraries/BSTest/src/BSStdio.h
@@ -8,7 +8,7 @@ namespace bs
 {
 class StdIOHelper
 {
-   public:
+public:
     StdIOHelper()
     {
     }
diff --git a/tests/device/libraries/BSTest/src/BSTest.h b/tests/device/libraries/BSTest/src/BSTest.h
index bc9154a5ae..d4e9126265 100644
--- a/tests/device/libraries/BSTest/src/BSTest.h
+++ b/tests/device/libraries/BSTest/src/BSTest.h
@@ -24,9 +24,13 @@ typedef void (*test_case_func_t)();
 
 class TestCase
 {
-   public:
+public:
     TestCase(TestCase* prev, test_case_func_t func, const char* file, size_t line, const char* name, const char* desc)
-        : m_func(func), m_file(file), m_line(line), m_name(name), m_desc(desc)
+        : m_func(func)
+        , m_file(file)
+        , m_line(line)
+        , m_name(name)
+        , m_desc(desc)
     {
         if (prev)
         {
@@ -64,7 +68,7 @@ class TestCase
         return (m_desc) ? m_desc : "";
     }
 
-   protected:
+protected:
     TestCase* m_next = nullptr;
     test_case_func_t m_func;
     const char* m_file;
@@ -103,7 +107,7 @@ class Runner
 {
     typedef Runner<IO> Tself;
 
-   public:
+public:
     Runner(IO& io)
         : m_io(io)
     {
@@ -143,7 +147,7 @@ class Runner
         bs::fatal();
     }
 
-   protected:
+protected:
     bool do_menu()
     {
         protocol::output_menu_begin(m_io);
@@ -181,7 +185,7 @@ class Runner
         }
     }
 
-   protected:
+protected:
     IO& m_io;
     size_t m_check_pass_count;
     size_t m_check_fail_count;
@@ -189,7 +193,7 @@ class Runner
 
 class AutoReg
 {
-   public:
+public:
     AutoReg(test_case_func_t func, const char* file, size_t line, const char* name, const char* desc = nullptr)
     {
         g_env.m_registry.add(func, file, line, name, desc);
@@ -227,12 +231,12 @@ inline void require(bool condition, size_t line)
 #define BS_NAME_LINE(name, line) BS_NAME_LINE2(name, line)
 #define BS_UNIQUE_NAME(name) BS_NAME_LINE(name, __LINE__)
 
-#define TEST_CASE(...)                                                                                         \
-    static void BS_UNIQUE_NAME(TEST_FUNC__)();                                                                 \
-    namespace                                                                                                  \
-    {                                                                                                          \
-    bs::AutoReg BS_UNIQUE_NAME(test_autoreg__)(&BS_UNIQUE_NAME(TEST_FUNC__), __FILE__, __LINE__, __VA_ARGS__); \
-    }                                                                                                          \
+#define TEST_CASE(...)                                                                                             \
+    static void BS_UNIQUE_NAME(TEST_FUNC__)();                                                                     \
+    namespace                                                                                                      \
+    {                                                                                                              \
+        bs::AutoReg BS_UNIQUE_NAME(test_autoreg__)(&BS_UNIQUE_NAME(TEST_FUNC__), __FILE__, __LINE__, __VA_ARGS__); \
+    }                                                                                                              \
     static void BS_UNIQUE_NAME(TEST_FUNC__)()
 
 #define CHECK(condition) bs::check((condition), __LINE__)
@@ -242,7 +246,7 @@ inline void require(bool condition, size_t line)
 #define BS_ENV_DECLARE() \
     namespace bs         \
     {                    \
-    Env g_env;           \
+        Env g_env;       \
     }
 #define BS_RUN(...)                                      \
     do                                                   \
diff --git a/tests/device/test_libc/memmove1.c b/tests/device/test_libc/memmove1.c
index 8aadfb7753..7a4c915b4b 100644
--- a/tests/device/test_libc/memmove1.c
+++ b/tests/device/test_libc/memmove1.c
@@ -91,7 +91,7 @@ void xmemmove(unsigned char* dest, unsigned char* src, size_t n)
     {
         errors++;
         DEBUGP("memmove of n bytes returned %p instead of dest=%p\n",
-               retp, dest);
+            retp, dest);
     }
 }
 
diff --git a/tests/device/test_libc/tstring.c b/tests/device/test_libc/tstring.c
index fd6e16842e..ddf326934f 100644
--- a/tests/device/test_libc/tstring.c
+++ b/tests/device/test_libc/tstring.c
@@ -30,10 +30,10 @@ void eprintf(int line, char* result, char* expected, int size)
 {
     if (size != 0)
         printf("Failure at line %d, result is <%.*s>, should be <%s> of size %d\n",
-               line, size, result, expected, size);
+            line, size, result, expected, size);
     else
         printf("Failure at line %d, result is <%s>, should be <%s>\n",
-               line, result, expected);
+            line, result, expected);
 }
 
 void mycopy(char* target, char* source, int size)
@@ -87,113 +87,77 @@ void tstring_main(void)
     tmp2[0] = 'Z';
     tmp2[1] = '\0';
 
-    if (memset(target, 'X', 0) != target ||
-        memcpy(target, "Y", 0) != target ||
-        memmove(target, "K", 0) != target ||
-        strncpy(tmp2, "4", 0) != tmp2 ||
-        strncat(tmp2, "123", 0) != tmp2 ||
-        strcat(target, "") != target)
+    if (memset(target, 'X', 0) != target || memcpy(target, "Y", 0) != target || memmove(target, "K", 0) != target || strncpy(tmp2, "4", 0) != tmp2 || strncat(tmp2, "123", 0) != tmp2 || strcat(target, "") != target)
     {
         eprintf(__LINE__, target, "A", 0);
         test_failed = 1;
     }
 
-    if (strcmp(target, "A") || strlen(target) != 1 || memchr(target, 'A', 0) != NULL || memcmp(target, "J", 0) || strncmp(target, "A", 1) || strncmp(target, "J", 0) ||
-        tmp2[0] != 'Z' || tmp2[1] != '\0')
+    if (strcmp(target, "A") || strlen(target) != 1 || memchr(target, 'A', 0) != NULL || memcmp(target, "J", 0) || strncmp(target, "A", 1) || strncmp(target, "J", 0) || tmp2[0] != 'Z' || tmp2[1] != '\0')
     {
         eprintf(__LINE__, target, "A", 0);
         test_failed = 1;
     }
 
     tmp2[2] = 'A';
-    if (strcpy(target, "") != target ||
-        strncpy(tmp2, "", 4) != tmp2 ||
-        strcat(target, "") != target)
+    if (strcpy(target, "") != target || strncpy(tmp2, "", 4) != tmp2 || strcat(target, "") != target)
     {
         eprintf(__LINE__, target, "", 0);
         test_failed = 1;
     }
 
-    if (target[0] != '\0' || strncmp(target, "", 1) ||
-        memcmp(tmp2, "\0\0\0\0", 4))
+    if (target[0] != '\0' || strncmp(target, "", 1) || memcmp(tmp2, "\0\0\0\0", 4))
     {
         eprintf(__LINE__, target, "", 0);
         test_failed = 1;
     }
 
     tmp2[2] = 'A';
-    if (strncat(tmp2, "1", 3) != tmp2 ||
-        memcmp(tmp2, "1\0A", 3))
+    if (strncat(tmp2, "1", 3) != tmp2 || memcmp(tmp2, "1\0A", 3))
     {
         eprintf(__LINE__, tmp2, "1\0A", 3);
         test_failed = 1;
     }
 
-    if (strcpy(tmp3, target) != tmp3 ||
-        strcat(tmp3, "X") != tmp3 ||
-        strncpy(tmp2, "X", 2) != tmp2 ||
-        memset(target, tmp2[0], 1) != target)
+    if (strcpy(tmp3, target) != tmp3 || strcat(tmp3, "X") != tmp3 || strncpy(tmp2, "X", 2) != tmp2 || memset(target, tmp2[0], 1) != target)
     {
         eprintf(__LINE__, target, "X", 0);
         test_failed = 1;
     }
 
-    if (strcmp(target, "X") || strlen(target) != 1 ||
-        memchr(target, 'X', 2) != target ||
-        strchr(target, 'X') != target ||
-        memchr(target, 'Y', 2) != NULL ||
-        strchr(target, 'Y') != NULL ||
-        strcmp(tmp3, target) ||
-        strncmp(tmp3, target, 2) ||
-        memcmp(target, "K", 0) ||
-        strncmp(target, tmp3, 3))
+    if (strcmp(target, "X") || strlen(target) != 1 || memchr(target, 'X', 2) != target || strchr(target, 'X') != target || memchr(target, 'Y', 2) != NULL || strchr(target, 'Y') != NULL || strcmp(tmp3, target) || strncmp(tmp3, target, 2) || memcmp(target, "K", 0) || strncmp(target, tmp3, 3))
     {
         eprintf(__LINE__, target, "X", 0);
         test_failed = 1;
     }
 
-    if (strcpy(tmp3, "Y") != tmp3 ||
-        strcat(tmp3, "Y") != tmp3 ||
-        memset(target, 'Y', 2) != target)
+    if (strcpy(tmp3, "Y") != tmp3 || strcat(tmp3, "Y") != tmp3 || memset(target, 'Y', 2) != target)
     {
         eprintf(__LINE__, target, "Y", 0);
         test_failed = 1;
     }
 
     target[2] = '\0';
-    if (memcmp(target, "YY", 2) || strcmp(target, "YY") ||
-        strlen(target) != 2 || memchr(target, 'Y', 2) != target ||
-        strcmp(tmp3, target) ||
-        strncmp(target, tmp3, 3) ||
-        strncmp(target, tmp3, 4) ||
-        strncmp(target, tmp3, 2) ||
-        strchr(target, 'Y') != target)
+    if (memcmp(target, "YY", 2) || strcmp(target, "YY") || strlen(target) != 2 || memchr(target, 'Y', 2) != target || strcmp(tmp3, target) || strncmp(target, tmp3, 3) || strncmp(target, tmp3, 4) || strncmp(target, tmp3, 2) || strchr(target, 'Y') != target)
     {
         eprintf(__LINE__, target, "YY", 2);
         test_failed = 1;
     }
 
     strcpy(target, "WW");
-    if (memcmp(target, "WW", 2) || strcmp(target, "WW") ||
-        strlen(target) != 2 || memchr(target, 'W', 2) != target ||
-        strchr(target, 'W') != target)
+    if (memcmp(target, "WW", 2) || strcmp(target, "WW") || strlen(target) != 2 || memchr(target, 'W', 2) != target || strchr(target, 'W') != target)
     {
         eprintf(__LINE__, target, "WW", 2);
         test_failed = 1;
     }
 
-    if (strncpy(target, "XX", 16) != target ||
-        memcmp(target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16))
+    if (strncpy(target, "XX", 16) != target || memcmp(target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16))
     {
         eprintf(__LINE__, target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16);
         test_failed = 1;
     }
 
-    if (strcpy(tmp3, "ZZ") != tmp3 ||
-        strcat(tmp3, "Z") != tmp3 ||
-        memcpy(tmp4, "Z", 2) != tmp4 ||
-        strcat(tmp4, "ZZ") != tmp4 ||
-        memset(target, 'Z', 3) != target)
+    if (strcpy(tmp3, "ZZ") != tmp3 || strcat(tmp3, "Z") != tmp3 || memcpy(tmp4, "Z", 2) != tmp4 || strcat(tmp4, "ZZ") != tmp4 || memset(target, 'Z', 3) != target)
     {
         eprintf(__LINE__, target, "ZZZ", 3);
         test_failed = 1;
@@ -202,32 +166,21 @@ void tstring_main(void)
     target[3] = '\0';
     tmp5[0] = '\0';
     strncat(tmp5, "123", 2);
-    if (memcmp(target, "ZZZ", 3) || strcmp(target, "ZZZ") ||
-        strcmp(tmp3, target) || strcmp(tmp4, target) ||
-        strncmp(target, "ZZZ", 4) || strncmp(target, "ZZY", 3) <= 0 ||
-        strncmp("ZZY", target, 4) >= 0 ||
-        memcmp(tmp5, "12", 3) ||
-        strlen(target) != 3)
+    if (memcmp(target, "ZZZ", 3) || strcmp(target, "ZZZ") || strcmp(tmp3, target) || strcmp(tmp4, target) || strncmp(target, "ZZZ", 4) || strncmp(target, "ZZY", 3) <= 0 || strncmp("ZZY", target, 4) >= 0 || memcmp(tmp5, "12", 3) || strlen(target) != 3)
     {
         eprintf(__LINE__, target, "ZZZ", 3);
         test_failed = 1;
     }
 
     target[2] = 'K';
-    if (memcmp(target, "ZZZ", 2) || strcmp(target, "ZZZ") >= 0 ||
-        memcmp(target, "ZZZ", 3) >= 0 || strlen(target) != 3 ||
-        memchr(target, 'K', 3) != target + 2 ||
-        strncmp(target, "ZZZ", 2) || strncmp(target, "ZZZ", 4) >= 0 ||
-        strchr(target, 'K') != target + 2)
+    if (memcmp(target, "ZZZ", 2) || strcmp(target, "ZZZ") >= 0 || memcmp(target, "ZZZ", 3) >= 0 || strlen(target) != 3 || memchr(target, 'K', 3) != target + 2 || strncmp(target, "ZZZ", 2) || strncmp(target, "ZZZ", 4) >= 0 || strchr(target, 'K') != target + 2)
     {
         eprintf(__LINE__, target, "ZZK", 3);
         test_failed = 1;
     }
 
     strcpy(target, "AAA");
-    if (memcmp(target, "AAA", 3) || strcmp(target, "AAA") ||
-        strncmp(target, "AAA", 3) ||
-        strlen(target) != 3)
+    if (memcmp(target, "AAA", 3) || strcmp(target, "AAA") || strncmp(target, "AAA", 3) || strlen(target) != 3)
     {
         eprintf(__LINE__, target, "AAA", 3);
         test_failed = 1;
@@ -281,8 +234,7 @@ void tstring_main(void)
                     test_failed = 1;
                 }
                 tmp2[i - z] = first_char + 1;
-                if (memmove(tmp2 + z + 1, tmp2 + z, i - z - 1) != tmp2 + z + 1 ||
-                    memset(tmp3, first_char, i) != tmp3)
+                if (memmove(tmp2 + z + 1, tmp2 + z, i - z - 1) != tmp2 + z + 1 || memset(tmp3, first_char, i) != tmp3)
                 {
                     printf("error at line %d\n", __LINE__);
                     test_failed = 1;
@@ -290,8 +242,7 @@ void tstring_main(void)
 
                 myset(tmp4, first_char, i);
                 tmp5[0] = '\0';
-                if (strncpy(tmp5, tmp1, i + 1) != tmp5 ||
-                    strcat(tmp5, tmp1) != tmp5)
+                if (strncpy(tmp5, tmp1, i + 1) != tmp5 || strcat(tmp5, tmp1) != tmp5)
                 {
                     printf("error at line %d\n", __LINE__);
                     test_failed = 1;
@@ -304,19 +255,7 @@ void tstring_main(void)
 
                 (void)strchr(tmp1, second_char);
 
-                if (memcmp(tmp1, expected, i) || strcmp(tmp1, expected) ||
-                    strncmp(tmp1, expected, i) ||
-                    strncmp(tmp1, expected, i + 1) ||
-                    strcmp(tmp1, tmp2) >= 0 || memcmp(tmp1, tmp2, i) >= 0 ||
-                    strncmp(tmp1, tmp2, i + 1) >= 0 ||
-                    (int)strlen(tmp1) != i || memchr(tmp1, first_char, i) != tmp1 ||
-                    strchr(tmp1, first_char) != tmp1 ||
-                    memchr(tmp1, second_char, i) != tmp1 + z ||
-                    strchr(tmp1, second_char) != tmp1 + z ||
-                    strcmp(tmp5, tmp6) ||
-                    strncat(tmp7, tmp1, i + 2) != tmp7 ||
-                    strcmp(tmp7, tmp6) ||
-                    tmp7[2 * i + z] != second_char)
+                if (memcmp(tmp1, expected, i) || strcmp(tmp1, expected) || strncmp(tmp1, expected, i) || strncmp(tmp1, expected, i + 1) || strcmp(tmp1, tmp2) >= 0 || memcmp(tmp1, tmp2, i) >= 0 || strncmp(tmp1, tmp2, i + 1) >= 0 || (int)strlen(tmp1) != i || memchr(tmp1, first_char, i) != tmp1 || strchr(tmp1, first_char) != tmp1 || memchr(tmp1, second_char, i) != tmp1 + z || strchr(tmp1, second_char) != tmp1 + z || strcmp(tmp5, tmp6) || strncat(tmp7, tmp1, i + 2) != tmp7 || strcmp(tmp7, tmp6) || tmp7[2 * i + z] != second_char)
                 {
                     eprintf(__LINE__, tmp1, expected, 0);
                     printf("x is %d\n", x);
@@ -329,21 +268,17 @@ void tstring_main(void)
 
                 for (k = 1; k <= align_test_iterations && k <= i; ++k)
                 {
-                    if (memcmp(tmp3, tmp4, i - k + 1) != 0 ||
-                        strncmp(tmp3, tmp4, i - k + 1) != 0)
+                    if (memcmp(tmp3, tmp4, i - k + 1) != 0 || strncmp(tmp3, tmp4, i - k + 1) != 0)
                     {
                         printf("Failure at line %d, comparing %.*s with %.*s\n",
-                               __LINE__, i, tmp3, i, tmp4);
+                            __LINE__, i, tmp3, i, tmp4);
                         test_failed = 1;
                     }
                     tmp4[i - k] = first_char + 1;
-                    if (memcmp(tmp3, tmp4, i) >= 0 ||
-                        strncmp(tmp3, tmp4, i) >= 0 ||
-                        memcmp(tmp4, tmp3, i) <= 0 ||
-                        strncmp(tmp4, tmp3, i) <= 0)
+                    if (memcmp(tmp3, tmp4, i) >= 0 || strncmp(tmp3, tmp4, i) >= 0 || memcmp(tmp4, tmp3, i) <= 0 || strncmp(tmp4, tmp3, i) <= 0)
                     {
                         printf("Failure at line %d, comparing %.*s with %.*s\n",
-                               __LINE__, i, tmp3, i, tmp4);
+                            __LINE__, i, tmp3, i, tmp4);
                         test_failed = 1;
                     }
                     tmp4[i - k] = first_char;
diff --git a/tests/host/common/Arduino.cpp b/tests/host/common/Arduino.cpp
index 2662fc3b5c..67bcc8ca34 100644
--- a/tests/host/common/Arduino.cpp
+++ b/tests/host/common/Arduino.cpp
@@ -21,7 +21,7 @@
 #include <Arduino.h>
 #include <Schedule.h>
 
-static struct timeval gtod0 = {0, 0};
+static struct timeval gtod0 = { 0, 0 };
 
 extern "C" unsigned long millis()
 {
diff --git a/tests/host/common/ArduinoMain.cpp b/tests/host/common/ArduinoMain.cpp
index f8f0e9d13e..13e570281d 100644
--- a/tests/host/common/ArduinoMain.cpp
+++ b/tests/host/common/ArduinoMain.cpp
@@ -146,21 +146,20 @@ void help(const char* argv0, int exitcode)
     exit(exitcode);
 }
 
-static struct option options[] =
-    {
-        {"help", no_argument, NULL, 'h'},
-        {"fast", no_argument, NULL, 'f'},
-        {"local", no_argument, NULL, 'l'},
-        {"sigint", no_argument, NULL, 'c'},
-        {"blockinguart", no_argument, NULL, 'b'},
-        {"verbose", no_argument, NULL, 'v'},
-        {"timestamp", no_argument, NULL, 'T'},
-        {"interface", required_argument, NULL, 'i'},
-        {"fspath", required_argument, NULL, 'P'},
-        {"spiffskb", required_argument, NULL, 'S'},
-        {"littlefskb", required_argument, NULL, 'L'},
-        {"portshifter", required_argument, NULL, 's'},
-        {"once", no_argument, NULL, '1'},
+static struct option options[] = {
+    { "help", no_argument, NULL, 'h' },
+    { "fast", no_argument, NULL, 'f' },
+    { "local", no_argument, NULL, 'l' },
+    { "sigint", no_argument, NULL, 'c' },
+    { "blockinguart", no_argument, NULL, 'b' },
+    { "verbose", no_argument, NULL, 'v' },
+    { "timestamp", no_argument, NULL, 'T' },
+    { "interface", required_argument, NULL, 'i' },
+    { "fspath", required_argument, NULL, 'P' },
+    { "spiffskb", required_argument, NULL, 'S' },
+    { "littlefskb", required_argument, NULL, 'L' },
+    { "portshifter", required_argument, NULL, 's' },
+    { "once", no_argument, NULL, '1' },
 };
 
 void cleanup()
@@ -219,47 +218,47 @@ int main(int argc, char* const argv[])
             break;
         switch (n)
         {
-            case 'h':
-                help(argv[0], EXIT_SUCCESS);
-                break;
-            case 'i':
-                host_interface = optarg;
-                break;
-            case 'l':
-                global_ipv4_netfmt = NO_GLOBAL_BINDING;
-                break;
-            case 's':
-                mock_port_shifter = atoi(optarg);
-                break;
-            case 'c':
-                ignore_sigint = true;
-                break;
-            case 'f':
-                fast = true;
-                break;
-            case 'S':
-                spiffs_kb = atoi(optarg);
-                break;
-            case 'L':
-                littlefs_kb = atoi(optarg);
-                break;
-            case 'P':
-                fspath = optarg;
-                break;
-            case 'b':
-                blocking_uart = true;
-                break;
-            case 'v':
-                mockdebug = true;
-                break;
-            case 'T':
-                serial_timestamp = true;
-                break;
-            case '1':
-                run_once = true;
-                break;
-            default:
-                help(argv[0], EXIT_FAILURE);
+        case 'h':
+            help(argv[0], EXIT_SUCCESS);
+            break;
+        case 'i':
+            host_interface = optarg;
+            break;
+        case 'l':
+            global_ipv4_netfmt = NO_GLOBAL_BINDING;
+            break;
+        case 's':
+            mock_port_shifter = atoi(optarg);
+            break;
+        case 'c':
+            ignore_sigint = true;
+            break;
+        case 'f':
+            fast = true;
+            break;
+        case 'S':
+            spiffs_kb = atoi(optarg);
+            break;
+        case 'L':
+            littlefs_kb = atoi(optarg);
+            break;
+        case 'P':
+            fspath = optarg;
+            break;
+        case 'b':
+            blocking_uart = true;
+            break;
+        case 'v':
+            mockdebug = true;
+            break;
+        case 'T':
+            serial_timestamp = true;
+            break;
+        case '1':
+            run_once = true;
+            break;
+        default:
+            help(argv[0], EXIT_FAILURE);
         }
     }
 
diff --git a/tests/host/common/EEPROM.h b/tests/host/common/EEPROM.h
index 669d60bfaf..3a30906ec4 100644
--- a/tests/host/common/EEPROM.h
+++ b/tests/host/common/EEPROM.h
@@ -34,7 +34,7 @@
 
 class EEPROMClass
 {
-   public:
+public:
     EEPROMClass(uint32_t sector);
     EEPROMClass(void);
     ~EEPROMClass();
@@ -70,7 +70,7 @@ class EEPROMClass
     //uint8_t& operator[](int const address) { return read(address); }
     uint8_t operator[](int address) { return read(address); }
 
-   protected:
+protected:
     size_t _size = 0;
     int _fd = -1;
 };
diff --git a/tests/host/common/HostWiring.cpp b/tests/host/common/HostWiring.cpp
index 892b336b2c..638457762e 100644
--- a/tests/host/common/HostWiring.cpp
+++ b/tests/host/common/HostWiring.cpp
@@ -46,29 +46,29 @@ void pinMode(uint8_t pin, uint8_t mode)
     const char* m;
     switch (mode)
     {
-        case INPUT:
-            m = "INPUT";
-            break;
-        case OUTPUT:
-            m = "OUTPUT";
-            break;
-        case INPUT_PULLUP:
-            m = "INPUT_PULLUP";
-            break;
-        case OUTPUT_OPEN_DRAIN:
-            m = "OUTPUT_OPEN_DRAIN";
-            break;
-        case INPUT_PULLDOWN_16:
-            m = "INPUT_PULLDOWN_16";
-            break;
-        case WAKEUP_PULLUP:
-            m = "WAKEUP_PULLUP";
-            break;
-        case WAKEUP_PULLDOWN:
-            m = "WAKEUP_PULLDOWN";
-            break;
-        default:
-            m = "(special)";
+    case INPUT:
+        m = "INPUT";
+        break;
+    case OUTPUT:
+        m = "OUTPUT";
+        break;
+    case INPUT_PULLUP:
+        m = "INPUT_PULLUP";
+        break;
+    case OUTPUT_OPEN_DRAIN:
+        m = "OUTPUT_OPEN_DRAIN";
+        break;
+    case INPUT_PULLDOWN_16:
+        m = "INPUT_PULLDOWN_16";
+        break;
+    case WAKEUP_PULLUP:
+        m = "WAKEUP_PULLUP";
+        break;
+    case WAKEUP_PULLDOWN:
+        m = "WAKEUP_PULLDOWN";
+        break;
+    default:
+        m = "(special)";
     }
     VERBOSE("gpio%d: mode='%s'\n", pin, m);
 }
diff --git a/tests/host/common/MockEsp.cpp b/tests/host/common/MockEsp.cpp
index 21908ba447..29e2653965 100644
--- a/tests/host/common/MockEsp.cpp
+++ b/tests/host/common/MockEsp.cpp
@@ -208,22 +208,22 @@ uint32_t EspClass::magicFlashChipSize(uint8_t byte)
 {
     switch (byte & 0x0F)
     {
-        case 0x0:  // 4 Mbit (512KB)
-            return (512_kB);
-        case 0x1:  // 2 MBit (256KB)
-            return (256_kB);
-        case 0x2:  // 8 MBit (1MB)
-            return (1_MB);
-        case 0x3:  // 16 MBit (2MB)
-            return (2_MB);
-        case 0x4:  // 32 MBit (4MB)
-            return (4_MB);
-        case 0x8:  // 64 MBit (8MB)
-            return (8_MB);
-        case 0x9:  // 128 MBit (16MB)
-            return (16_MB);
-        default:  // fail?
-            return 0;
+    case 0x0:  // 4 Mbit (512KB)
+        return (512_kB);
+    case 0x1:  // 2 MBit (256KB)
+        return (256_kB);
+    case 0x2:  // 8 MBit (1MB)
+        return (1_MB);
+    case 0x3:  // 16 MBit (2MB)
+        return (2_MB);
+    case 0x4:  // 32 MBit (4MB)
+        return (4_MB);
+    case 0x8:  // 64 MBit (8MB)
+        return (8_MB);
+    case 0x9:  // 128 MBit (16MB)
+        return (16_MB);
+    default:  // fail?
+        return 0;
     }
 }
 
diff --git a/tests/host/common/MockTools.cpp b/tests/host/common/MockTools.cpp
index fda6895949..43254efb7b 100644
--- a/tests/host/common/MockTools.cpp
+++ b/tests/host/common/MockTools.cpp
@@ -52,16 +52,16 @@ extern "C"
         return len;
     }
 
-    void stack_thunk_add_ref() {}
-    void stack_thunk_del_ref() {}
-    void stack_thunk_repaint() {}
+    void stack_thunk_add_ref() { }
+    void stack_thunk_del_ref() { }
+    void stack_thunk_repaint() { }
 
     uint32_t stack_thunk_get_refcnt() { return 0; }
     uint32_t stack_thunk_get_stack_top() { return 0; }
     uint32_t stack_thunk_get_stack_bot() { return 0; }
     uint32_t stack_thunk_get_cont_sp() { return 0; }
     uint32_t stack_thunk_get_max_usage() { return 0; }
-    void stack_thunk_dump_stack() {}
+    void stack_thunk_dump_stack() { }
 
 // Thunking macro
 #define make_stack_thunk(fcnToThunk)
diff --git a/tests/host/common/MockUART.cpp b/tests/host/common/MockUART.cpp
index 4ea89cddc1..0eafde29e0 100644
--- a/tests/host/common/MockUART.cpp
+++ b/tests/host/common/MockUART.cpp
@@ -43,7 +43,7 @@ extern "C"
 
     static int s_uart_debug_nr = UART1;
 
-    static uart_t* UART[2] = {NULL, NULL};
+    static uart_t* UART[2] = { NULL, NULL };
 
     struct uart_rx_buffer_
     {
@@ -348,42 +348,42 @@ extern "C"
 
         switch (uart->uart_nr)
         {
-            case UART0:
-                uart->rx_enabled = (mode != UART_TX_ONLY);
-                uart->tx_enabled = (mode != UART_RX_ONLY);
-                if (uart->rx_enabled)
+        case UART0:
+            uart->rx_enabled = (mode != UART_TX_ONLY);
+            uart->tx_enabled = (mode != UART_RX_ONLY);
+            if (uart->rx_enabled)
+            {
+                struct uart_rx_buffer_* rx_buffer = (struct uart_rx_buffer_*)malloc(sizeof(struct uart_rx_buffer_));
+                if (rx_buffer == NULL)
+                {
+                    free(uart);
+                    return NULL;
+                }
+                rx_buffer->size = rx_size;  //var this
+                rx_buffer->rpos = 0;
+                rx_buffer->wpos = 0;
+                rx_buffer->buffer = (uint8_t*)malloc(rx_buffer->size);
+                if (rx_buffer->buffer == NULL)
                 {
-                    struct uart_rx_buffer_* rx_buffer = (struct uart_rx_buffer_*)malloc(sizeof(struct uart_rx_buffer_));
-                    if (rx_buffer == NULL)
-                    {
-                        free(uart);
-                        return NULL;
-                    }
-                    rx_buffer->size = rx_size;  //var this
-                    rx_buffer->rpos = 0;
-                    rx_buffer->wpos = 0;
-                    rx_buffer->buffer = (uint8_t*)malloc(rx_buffer->size);
-                    if (rx_buffer->buffer == NULL)
-                    {
-                        free(rx_buffer);
-                        free(uart);
-                        return NULL;
-                    }
-                    uart->rx_buffer = rx_buffer;
+                    free(rx_buffer);
+                    free(uart);
+                    return NULL;
                 }
-                break;
-
-            case UART1:
-                // Note: uart_interrupt_handler does not support RX on UART 1.
-                uart->rx_enabled = false;
-                uart->tx_enabled = (mode != UART_RX_ONLY);
-                break;
-
-            case UART_NO:
-            default:
-                // big fail!
-                free(uart);
-                return NULL;
+                uart->rx_buffer = rx_buffer;
+            }
+            break;
+
+        case UART1:
+            // Note: uart_interrupt_handler does not support RX on UART 1.
+            uart->rx_enabled = false;
+            uart->tx_enabled = (mode != UART_RX_ONLY);
+            break;
+
+        case UART_NO:
+        default:
+            // big fail!
+            free(uart);
+            return NULL;
         }
 
         uart_set_baudrate(uart, baudrate);
diff --git a/tests/host/common/flash_hal_mock.cpp b/tests/host/common/flash_hal_mock.cpp
index 396d2c6362..e4d912bd77 100644
--- a/tests/host/common/flash_hal_mock.cpp
+++ b/tests/host/common/flash_hal_mock.cpp
@@ -26,8 +26,7 @@ int32_t flash_hal_write(uint32_t addr, uint32_t size, const uint8_t* src)
 
 int32_t flash_hal_erase(uint32_t addr, uint32_t size)
 {
-    if ((size & (FLASH_SECTOR_SIZE - 1)) != 0 ||
-        (addr & (FLASH_SECTOR_SIZE - 1)) != 0)
+    if ((size & (FLASH_SECTOR_SIZE - 1)) != 0 || (addr & (FLASH_SECTOR_SIZE - 1)) != 0)
     {
         abort();
     }
diff --git a/tests/host/common/include/ClientContext.h b/tests/host/common/include/ClientContext.h
index cec57b3030..f10760aae4 100644
--- a/tests/host/common/include/ClientContext.h
+++ b/tests/host/common/include/ClientContext.h
@@ -32,15 +32,25 @@ typedef void (*discard_cb_t)(void*, ClientContext*);
 
 class ClientContext
 {
-   public:
+public:
     ClientContext(tcp_pcb* pcb, discard_cb_t discard_cb, void* discard_cb_arg)
-        : _discard_cb(discard_cb), _discard_cb_arg(discard_cb_arg), _refcnt(0), _next(0), _sync(::getDefaultPrivateGlobalSyncValue()), _sock(-1)
+        : _discard_cb(discard_cb)
+        , _discard_cb_arg(discard_cb_arg)
+        , _refcnt(0)
+        , _next(0)
+        , _sync(::getDefaultPrivateGlobalSyncValue())
+        , _sock(-1)
     {
         (void)pcb;
     }
 
     ClientContext(int sock)
-        : _discard_cb(nullptr), _discard_cb_arg(nullptr), _refcnt(0), _next(nullptr), _sync(::getDefaultPrivateGlobalSyncValue()), _sock(sock)
+        : _discard_cb(nullptr)
+        , _discard_cb_arg(nullptr)
+        , _refcnt(0)
+        , _next(nullptr)
+        , _sync(::getDefaultPrivateGlobalSyncValue())
+        , _sock(sock)
     {
     }
 
@@ -301,7 +311,7 @@ class ClientContext
         _inbufsize -= consume;
     }
 
-   private:
+private:
     discard_cb_t _discard_cb = nullptr;
     void* _discard_cb_arg = nullptr;
 
diff --git a/tests/host/common/include/UdpContext.h b/tests/host/common/include/UdpContext.h
index bbb079739a..eb8a071703 100644
--- a/tests/host/common/include/UdpContext.h
+++ b/tests/host/common/include/UdpContext.h
@@ -36,11 +36,12 @@ extern netif netif0;
 
 class UdpContext
 {
-   public:
+public:
     typedef std::function<void(void)> rxhandler_t;
 
     UdpContext()
-        : _on_rx(nullptr), _refcnt(0)
+        : _on_rx(nullptr)
+        , _refcnt(0)
     {
         _sock = mockUDPSocket();
     }
@@ -253,10 +254,10 @@ class UdpContext
             _on_rx();
     }
 
-   public:
+public:
     static uint32_t staticMCastAddr;
 
-   private:
+private:
     void translate_addr()
     {
         if (addrsize == 4)
diff --git a/tests/host/common/littlefs_mock.h b/tests/host/common/littlefs_mock.h
index bbbbe7c0cb..3d411c7027 100644
--- a/tests/host/common/littlefs_mock.h
+++ b/tests/host/common/littlefs_mock.h
@@ -29,12 +29,12 @@
 
 class LittleFSMock
 {
-   public:
+public:
     LittleFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString);
     void reset();
     ~LittleFSMock();
 
-   protected:
+protected:
     void load();
     void save();
 
diff --git a/tests/host/common/md5.c b/tests/host/common/md5.c
index 8b84713aa4..dfdb80fc80 100644
--- a/tests/host/common/md5.c
+++ b/tests/host/common/md5.c
@@ -72,11 +72,11 @@ static void MD5Transform(uint32_t state[4], const uint8_t block[64]);
 static void Encode(uint8_t* output, uint32_t* input, uint32_t len);
 static void Decode(uint32_t* output, const uint8_t* input, uint32_t len);
 
-static const uint8_t PADDING[64] =
-    {
-        0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+static const uint8_t PADDING[64] = {
+    0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
 
 /* F, G, H and I are basic MD5 functions.
  */
@@ -304,6 +304,5 @@ static void Decode(uint32_t* output, const uint8_t* input, uint32_t len)
     uint32_t i, j;
 
     for (i = 0, j = 0; j < len; i++, j += 4)
-        output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j + 1]) << 8) |
-                    (((uint32_t)input[j + 2]) << 16) | (((uint32_t)input[j + 3]) << 24);
+        output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j + 1]) << 8) | (((uint32_t)input[j + 2]) << 16) | (((uint32_t)input[j + 3]) << 24);
 }
diff --git a/tests/host/common/queue.h b/tests/host/common/queue.h
index 2c2d89ba34..c1d8f7151a 100644
--- a/tests/host/common/queue.h
+++ b/tests/host/common/queue.h
@@ -157,21 +157,20 @@
 
 #define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
 
-#define SLIST_REMOVE(head, elm, type, field)                  \
-    do                                                        \
-    {                                                         \
-        if (SLIST_FIRST((head)) == (elm))                     \
-        {                                                     \
-            SLIST_REMOVE_HEAD((head), field);                 \
-        }                                                     \
-        else                                                  \
-        {                                                     \
-            struct type* curelm = SLIST_FIRST((head));        \
-            while (SLIST_NEXT(curelm, field) != (elm))        \
-                curelm = SLIST_NEXT(curelm, field);           \
-            SLIST_NEXT(curelm, field) =                       \
-                SLIST_NEXT(SLIST_NEXT(curelm, field), field); \
-        }                                                     \
+#define SLIST_REMOVE(head, elm, type, field)                                          \
+    do                                                                                \
+    {                                                                                 \
+        if (SLIST_FIRST((head)) == (elm))                                             \
+        {                                                                             \
+            SLIST_REMOVE_HEAD((head), field);                                         \
+        }                                                                             \
+        else                                                                          \
+        {                                                                             \
+            struct type* curelm = SLIST_FIRST((head));                                \
+            while (SLIST_NEXT(curelm, field) != (elm))                                \
+                curelm = SLIST_NEXT(curelm, field);                                   \
+            SLIST_NEXT(curelm, field) = SLIST_NEXT(SLIST_NEXT(curelm, field), field); \
+        }                                                                             \
     } while (0)
 
 #define SLIST_REMOVE_HEAD(head, field)                                \
@@ -260,30 +259,28 @@
 
 #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
 
-#define STAILQ_REMOVE(head, elm, type, field)                                 \
-    do                                                                        \
-    {                                                                         \
-        if (STAILQ_FIRST((head)) == (elm))                                    \
-        {                                                                     \
-            STAILQ_REMOVE_HEAD((head), field);                                \
-        }                                                                     \
-        else                                                                  \
-        {                                                                     \
-            struct type* curelm = STAILQ_FIRST((head));                       \
-            while (STAILQ_NEXT(curelm, field) != (elm))                       \
-                curelm = STAILQ_NEXT(curelm, field);                          \
-            if ((STAILQ_NEXT(curelm, field) =                                 \
-                     STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL) \
-                (head)->stqh_last = &STAILQ_NEXT((curelm), field);            \
-        }                                                                     \
+#define STAILQ_REMOVE(head, elm, type, field)                                                          \
+    do                                                                                                 \
+    {                                                                                                  \
+        if (STAILQ_FIRST((head)) == (elm))                                                             \
+        {                                                                                              \
+            STAILQ_REMOVE_HEAD((head), field);                                                         \
+        }                                                                                              \
+        else                                                                                           \
+        {                                                                                              \
+            struct type* curelm = STAILQ_FIRST((head));                                                \
+            while (STAILQ_NEXT(curelm, field) != (elm))                                                \
+                curelm = STAILQ_NEXT(curelm, field);                                                   \
+            if ((STAILQ_NEXT(curelm, field) = STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL) \
+                (head)->stqh_last = &STAILQ_NEXT((curelm), field);                                     \
+        }                                                                                              \
     } while (0)
 
-#define STAILQ_REMOVE_HEAD(head, field)                             \
-    do                                                              \
-    {                                                               \
-        if ((STAILQ_FIRST((head)) =                                 \
-                 STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
-            (head)->stqh_last = &STAILQ_FIRST((head));              \
+#define STAILQ_REMOVE_HEAD(head, field)                                                \
+    do                                                                                 \
+    {                                                                                  \
+        if ((STAILQ_FIRST((head)) = STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
+            (head)->stqh_last = &STAILQ_FIRST((head));                                 \
     } while (0)
 
 #define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field)                      \
@@ -333,14 +330,13 @@
         LIST_FIRST((head)) = NULL; \
     } while (0)
 
-#define LIST_INSERT_AFTER(listelm, elm, field)                               \
-    do                                                                       \
-    {                                                                        \
-        if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL) \
-            LIST_NEXT((listelm), field)->field.le_prev =                     \
-                &LIST_NEXT((elm), field);                                    \
-        LIST_NEXT((listelm), field) = (elm);                                 \
-        (elm)->field.le_prev = &LIST_NEXT((listelm), field);                 \
+#define LIST_INSERT_AFTER(listelm, elm, field)                                     \
+    do                                                                             \
+    {                                                                              \
+        if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)       \
+            LIST_NEXT((listelm), field)->field.le_prev = &LIST_NEXT((elm), field); \
+        LIST_NEXT((listelm), field) = (elm);                                       \
+        (elm)->field.le_prev = &LIST_NEXT((listelm), field);                       \
     } while (0)
 
 #define LIST_INSERT_BEFORE(listelm, elm, field)              \
@@ -363,13 +359,12 @@
 
 #define LIST_NEXT(elm, field) ((elm)->field.le_next)
 
-#define LIST_REMOVE(elm, field)                          \
-    do                                                   \
-    {                                                    \
-        if (LIST_NEXT((elm), field) != NULL)             \
-            LIST_NEXT((elm), field)->field.le_prev =     \
-                (elm)->field.le_prev;                    \
-        *(elm)->field.le_prev = LIST_NEXT((elm), field); \
+#define LIST_REMOVE(elm, field)                                            \
+    do                                                                     \
+    {                                                                      \
+        if (LIST_NEXT((elm), field) != NULL)                               \
+            LIST_NEXT((elm), field)->field.le_prev = (elm)->field.le_prev; \
+        *(elm)->field.le_prev = LIST_NEXT((elm), field);                   \
     } while (0)
 
 /*
@@ -430,16 +425,15 @@
         (head)->tqh_last = &TAILQ_FIRST((head)); \
     } while (0)
 
-#define TAILQ_INSERT_AFTER(head, listelm, elm, field)                          \
-    do                                                                         \
-    {                                                                          \
-        if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL) \
-            TAILQ_NEXT((elm), field)->field.tqe_prev =                         \
-                &TAILQ_NEXT((elm), field);                                     \
-        else                                                                   \
-            (head)->tqh_last = &TAILQ_NEXT((elm), field);                      \
-        TAILQ_NEXT((listelm), field) = (elm);                                  \
-        (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field);                 \
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field)                             \
+    do                                                                            \
+    {                                                                             \
+        if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)    \
+            TAILQ_NEXT((elm), field)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
+        else                                                                      \
+            (head)->tqh_last = &TAILQ_NEXT((elm), field);                         \
+        TAILQ_NEXT((listelm), field) = (elm);                                     \
+        (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field);                    \
     } while (0)
 
 #define TAILQ_INSERT_BEFORE(listelm, elm, field)               \
@@ -451,16 +445,15 @@
         (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
     } while (0)
 
-#define TAILQ_INSERT_HEAD(head, elm, field)                           \
-    do                                                                \
-    {                                                                 \
-        if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
-            TAILQ_FIRST((head))->field.tqe_prev =                     \
-                &TAILQ_NEXT((elm), field);                            \
-        else                                                          \
-            (head)->tqh_last = &TAILQ_NEXT((elm), field);             \
-        TAILQ_FIRST((head)) = (elm);                                  \
-        (elm)->field.tqe_prev = &TAILQ_FIRST((head));                 \
+#define TAILQ_INSERT_HEAD(head, elm, field)                                  \
+    do                                                                       \
+    {                                                                        \
+        if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL)        \
+            TAILQ_FIRST((head))->field.tqe_prev = &TAILQ_NEXT((elm), field); \
+        else                                                                 \
+            (head)->tqh_last = &TAILQ_NEXT((elm), field);                    \
+        TAILQ_FIRST((head)) = (elm);                                         \
+        (elm)->field.tqe_prev = &TAILQ_FIRST((head));                        \
     } while (0)
 
 #define TAILQ_INSERT_TAIL(head, elm, field)           \
@@ -480,15 +473,14 @@
 #define TAILQ_PREV(elm, headname, field) \
     (*(((struct headname*)((elm)->field.tqe_prev))->tqh_last))
 
-#define TAILQ_REMOVE(head, elm, field)                     \
-    do                                                     \
-    {                                                      \
-        if ((TAILQ_NEXT((elm), field)) != NULL)            \
-            TAILQ_NEXT((elm), field)->field.tqe_prev =     \
-                (elm)->field.tqe_prev;                     \
-        else                                               \
-            (head)->tqh_last = (elm)->field.tqe_prev;      \
-        *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \
+#define TAILQ_REMOVE(head, elm, field)                                        \
+    do                                                                        \
+    {                                                                         \
+        if ((TAILQ_NEXT((elm), field)) != NULL)                               \
+            TAILQ_NEXT((elm), field)->field.tqe_prev = (elm)->field.tqe_prev; \
+        else                                                                  \
+            (head)->tqh_last = (elm)->field.tqe_prev;                         \
+        *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field);                    \
     } while (0)
 
 #ifdef _KERNEL
diff --git a/tests/host/common/sdfs_mock.h b/tests/host/common/sdfs_mock.h
index 462d8fffe1..d628c953f2 100644
--- a/tests/host/common/sdfs_mock.h
+++ b/tests/host/common/sdfs_mock.h
@@ -23,7 +23,7 @@
 
 class SDFSMock
 {
-   public:
+public:
     SDFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString)
     {
         (void)fs_size;
@@ -31,8 +31,8 @@ class SDFSMock
         (void)fs_page;
         (void)storage;
     }
-    void reset() {}
-    ~SDFSMock() {}
+    void reset() { }
+    ~SDFSMock() { }
 };
 
 extern uint64_t _sdCardSizeB;
diff --git a/tests/host/common/spiffs_mock.h b/tests/host/common/spiffs_mock.h
index 098f73c3f4..76c4b4165f 100644
--- a/tests/host/common/spiffs_mock.h
+++ b/tests/host/common/spiffs_mock.h
@@ -26,12 +26,12 @@
 
 class SpiffsMock
 {
-   public:
+public:
     SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString);
     void reset();
     ~SpiffsMock();
 
-   protected:
+protected:
     void load();
     void save();
 
diff --git a/tests/host/common/strl.cpp b/tests/host/common/strl.cpp
index 95c98913d6..ce26d5b60e 100644
--- a/tests/host/common/strl.cpp
+++ b/tests/host/common/strl.cpp
@@ -5,10 +5,10 @@
     '_cups_strlcat()' - Safely concatenate two strings.
 */
 
-size_t                   /* O - Length of string */
-strlcat(char* dst,       /* O - Destination string */
-        const char* src, /* I - Source string */
-        size_t size)     /* I - Size of destination string buffer */
+size_t               /* O - Length of string */
+strlcat(char* dst,   /* O - Destination string */
+    const char* src, /* I - Source string */
+    size_t size)     /* I - Size of destination string buffer */
 {
     size_t srclen; /* Length of source string */
     size_t dstlen; /* Length of destination string */
@@ -52,10 +52,10 @@ strlcat(char* dst,       /* O - Destination string */
     '_cups_strlcpy()' - Safely copy two strings.
 */
 
-size_t                   /* O - Length of string */
-strlcpy(char* dst,       /* O - Destination string */
-        const char* src, /* I - Source string */
-        size_t size)     /* I - Size of destination string buffer */
+size_t               /* O - Length of string */
+strlcpy(char* dst,   /* O - Destination string */
+    const char* src, /* I - Source string */
+    size_t size)     /* I - Size of destination string buffer */
 {
     size_t srclen; /* Length of source string */
 
diff --git a/tests/host/common/user_interface.cpp b/tests/host/common/user_interface.cpp
index 0091d77ba6..9103e40648 100644
--- a/tests/host/common/user_interface.cpp
+++ b/tests/host/common/user_interface.cpp
@@ -505,7 +505,7 @@ extern "C"
     ip_addr_t dns_getserver(u8_t numdns)
     {
         (void)numdns;
-        ip_addr_t addr = {0x7f000001};
+        ip_addr_t addr = { 0x7f000001 };
         return addr;
     }
 
diff --git a/tests/host/core/test_string.cpp b/tests/host/core/test_string.cpp
index db6244a059..8f6b00eb4a 100644
--- a/tests/host/core/test_string.cpp
+++ b/tests/host/core/test_string.cpp
@@ -97,7 +97,7 @@ TEST_CASE("String constructors", "[core][String]")
     REQUIRE(ssh == "3.14159_abcd");
     String flash = (F("hello from flash"));
     REQUIRE(flash == "hello from flash");
-    const char textarray[6] = {'h', 'e', 'l', 'l', 'o', 0};
+    const char textarray[6] = { 'h', 'e', 'l', 'l', 'o', 0 };
     String hello(textarray);
     REQUIRE(hello == "hello");
     String hello2;
@@ -442,8 +442,8 @@ TEST_CASE("String SSO handles junk in memory", "[core][String]")
 
     // Tests from #5883
     bool useURLencode = false;
-    const char euro[4] = {(char)0xe2, (char)0x82, (char)0xac, 0};  // Unicode euro symbol
-    const char yen[3] = {(char)0xc2, (char)0xa5, 0};               // Unicode yen symbol
+    const char euro[4] = { (char)0xe2, (char)0x82, (char)0xac, 0 };  // Unicode euro symbol
+    const char yen[3] = { (char)0xc2, (char)0xa5, 0 };               // Unicode yen symbol
 
     memset(space, 0xff, 64);
     new (s) String("%ssid%");
@@ -533,7 +533,7 @@ TEST_CASE("Strings with NULs", "[core][String]")
     REQUIRE(str3.length() == 32);
     str3 += str3;
     REQUIRE(str3.length() == 64);
-    static char zeros[64] = {0};
+    static char zeros[64] = { 0 };
     const char* p = str3.c_str();
     REQUIRE(!memcmp(p, zeros, 64));
 }
@@ -559,11 +559,12 @@ TEST_CASE("Replace and string expansion", "[core][String]")
 
 TEST_CASE("String chaining", "[core][String]")
 {
-    const char* chunks[]{
+    const char* chunks[] {
         "~12345",
         "67890",
         "qwertyuiopasdfghjkl",
-        "zxcvbnm"};
+        "zxcvbnm"
+    };
 
     String all;
     for (auto* chunk : chunks)
diff --git a/tests/host/fs/test_fs.cpp b/tests/host/fs/test_fs.cpp
index be7b26ad14..73fc1b2cc6 100644
--- a/tests/host/fs/test_fs.cpp
+++ b/tests/host/fs/test_fs.cpp
@@ -144,7 +144,7 @@ TEST_CASE("SD.h FILE_WRITE macro is append", "[fs]")
     f.write(65);
     f.write("bbcc");
     f.write("theend", 6);
-    char block[3] = {'x', 'y', 'z'};
+    char block[3] = { 'x', 'y', 'z' };
     f.write(block, 3);
     uint32_t bigone = 0x40404040;
     f.write((const uint8_t*)&bigone, 4);
diff --git a/tests/restyle.sh b/tests/restyle.sh
index b8438e089b..c038133941 100755
--- a/tests/restyle.sh
+++ b/tests/restyle.sh
@@ -25,6 +25,7 @@ tests
 
 # core
 
+cp tests/clang-format-core .clang-format
 for d in $all; do
     if [ -d "$d" ]; then
         echo "-------- directory $d:"
@@ -39,10 +40,8 @@ done
 
 # examples
 
+cp tests/clang-format-arduino .clang-format
 for d in libraries; do
     echo "-------- examples in $d:"
-    find $d -name "*.ino" -exec \
-        astyle \
-            --suffix=none \
-            --options=${org}/astyle_examples.conf {} \;
+    find $d -name "*.ino" -exec clang-format-12 -i {} \;
 done

From 3a40b86d7715aa61e092f30ad7f066c264095bea Mon Sep 17 00:00:00 2001
From: david gauchard <gauchard@laas.fr>
Date: Thu, 20 Jan 2022 02:05:22 +0100
Subject: [PATCH 08/15] one more pass

---
 cores/esp8266/LwipDhcpServer.cpp                  |  6 ++++--
 cores/esp8266/LwipIntf.cpp                        |  3 ++-
 cores/esp8266/LwipIntf.h                          |  3 ++-
 cores/esp8266/LwipIntfDev.h                       |  5 ++++-
 .../examples/BearSSL_Server/BearSSL_Server.ino    |  8 ++++----
 .../examples/SPISlave_Master/SPISlave_Master.ino  |  3 +--
 .../SPISlave_SafeMaster/SPISlave_SafeMaster.ino   |  3 +--
 libraries/lwIP_enc28j60/src/utility/enc28j60.cpp  |  9 +++------
 tests/device/libraries/BSTest/src/BSArgs.h        |  4 ++--
 tests/device/libraries/BSTest/src/BSProtocol.h    |  4 ++--
 tests/device/libraries/BSTest/src/BSTest.h        |  2 +-
 tests/device/test_libc/memmove1.c                 | 13 ++++++-------
 tests/device/test_libc/tstring.c                  |  3 ++-
 tests/host/common/MockTools.cpp                   |  3 ++-
 tests/host/common/MockUART.cpp                    | 10 ++--------
 tests/host/common/include/UdpContext.h            |  3 ++-
 tests/host/common/user_interface.cpp              |  3 ++-
 tests/host/fs/test_fs.cpp                         | 15 +++++++--------
 18 files changed, 49 insertions(+), 51 deletions(-)

diff --git a/cores/esp8266/LwipDhcpServer.cpp b/cores/esp8266/LwipDhcpServer.cpp
index c5b5342fef..d7eddd02d9 100644
--- a/cores/esp8266/LwipDhcpServer.cpp
+++ b/cores/esp8266/LwipDhcpServer.cpp
@@ -983,7 +983,8 @@ void DhcpServer::init_dhcps_lease(uint32 ip)
         {
             /*config ip information must be in the same segment as the local ip*/
             softap_ip >>= 8;
-            if (((start_ip >> 8 != softap_ip) || (end_ip >> 8 != softap_ip)) || (end_ip - start_ip > DHCPS_MAX_LEASE))
+            if (((start_ip >> 8 != softap_ip) || (end_ip >> 8 != softap_ip))
+                || (end_ip - start_ip > DHCPS_MAX_LEASE))
             {
                 dhcps_lease.enable = false;
             }
@@ -1146,7 +1147,8 @@ bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
 
         /*config ip information must be in the same segment as the local ip*/
         softap_ip >>= 8;
-        if ((start_ip >> 8 != softap_ip) || (end_ip >> 8 != softap_ip))
+        if ((start_ip >> 8 != softap_ip)
+            || (end_ip >> 8 != softap_ip))
         {
             return false;
         }
diff --git a/cores/esp8266/LwipIntf.cpp b/cores/esp8266/LwipIntf.cpp
index 10d42aaf23..44359e6fc1 100644
--- a/cores/esp8266/LwipIntf.cpp
+++ b/cores/esp8266/LwipIntf.cpp
@@ -25,7 +25,8 @@ extern "C"
 //
 // result stored into gateway/netmask/dns1
 
-bool LwipIntf::ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3, IPAddress& gateway, IPAddress& netmask, IPAddress& dns1)
+bool LwipIntf::ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3,
+    IPAddress& gateway, IPAddress& netmask, IPAddress& dns1)
 {
     //To allow compatibility, check first octet of 3rd arg. If 255, interpret as ESP order, otherwise Arduino order.
     gateway = arg1;
diff --git a/cores/esp8266/LwipIntf.h b/cores/esp8266/LwipIntf.h
index 7943c6cb5a..10acf716c7 100644
--- a/cores/esp8266/LwipIntf.h
+++ b/cores/esp8266/LwipIntf.h
@@ -23,7 +23,8 @@ class LwipIntf
     // arg3     | dns1       netmask
     //
     // result stored into gateway/netmask/dns1
-    static bool ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3, IPAddress& gateway, IPAddress& netmask, IPAddress& dns1);
+    static bool ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3,
+        IPAddress& gateway, IPAddress& netmask, IPAddress& dns1);
 
     String hostname();
     bool hostname(const String& aHostname)
diff --git a/cores/esp8266/LwipIntfDev.h b/cores/esp8266/LwipIntfDev.h
index bebba74266..4dccfa0cba 100644
--- a/cores/esp8266/LwipIntfDev.h
+++ b/cores/esp8266/LwipIntfDev.h
@@ -278,7 +278,10 @@ err_t LwipIntfDev<RawDev>::netif_init()
     _netif.name[1] = '0' + _netif.num;
     _netif.mtu = _mtu;
     _netif.chksum_flags = NETIF_CHECKSUM_ENABLE_ALL;
-    _netif.flags = NETIF_FLAG_ETHARP | NETIF_FLAG_IGMP | NETIF_FLAG_BROADCAST | NETIF_FLAG_LINK_UP;
+    _netif.flags = NETIF_FLAG_ETHARP
+        | NETIF_FLAG_IGMP
+        | NETIF_FLAG_BROADCAST
+        | NETIF_FLAG_LINK_UP;
 
     // lwIP's doc: This function typically first resolves the hardware
     // address, then sends the packet.  For ethernet physical layer, this is
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
index 9677178521..08d81c697b 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
@@ -139,10 +139,10 @@ GBEnkz4KpKv7TkHoW+j7F5EMcLcSrUIpyw==
 #endif
 
 #define CACHE_SIZE 5 // Number of sessions to cache.
-#define USE_CACHE // Enable SSL session caching.                      \
-    // Caching SSL sessions shortens the length of the SSL handshake. \
-    // You can see the performance improvement by looking at the      \
-    // Network tab of the developer tools of your browser.
+// Caching SSL sessions shortens the length of the SSL handshake.
+// You can see the performance improvement by looking at the
+// Network tab of the developer tools of your browser.
+#define USE_CACHE // Enable SSL session caching.
 //#define DYNAMIC_CACHE // Whether to dynamically allocate the cache.
 
 #if defined(USE_CACHE) && defined(DYNAMIC_CACHE)
diff --git a/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino b/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
index a564b3c027..f6f38d95fa 100644
--- a/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
+++ b/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
@@ -22,8 +22,7 @@ class ESPMaster {
 
   public:
   ESPMaster(uint8_t pin)
-      : _ss_pin(pin) {
-  }
+      : _ss_pin(pin) { }
   void begin() {
     pinMode(_ss_pin, OUTPUT);
     digitalWrite(_ss_pin, HIGH);
diff --git a/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino b/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
index 6019e5fb54..2b1d3bbbbc 100644
--- a/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
+++ b/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
@@ -28,8 +28,7 @@ class ESPSafeMaster {
 
   public:
   ESPSafeMaster(uint8_t pin)
-      : _ss_pin(pin) {
-  }
+      : _ss_pin(pin) { }
   void begin() {
     pinMode(_ss_pin, OUTPUT);
     _pulseSS();
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
index bbc00041ca..8ba961b969 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
@@ -391,9 +391,7 @@ bool ENC28J60::reset(void)
 
     /* Wait for OST */
     PRINTF("waiting for ESTAT_CLKRDY\n");
-    while ((readreg(ESTAT) & ESTAT_CLKRDY) == 0)
-    {
-    };
+    while ((readreg(ESTAT) & ESTAT_CLKRDY) == 0) { };
     PRINTF("ESTAT_CLKRDY\n");
 
     setregbank(ERXTX_BANK);
@@ -606,9 +604,8 @@ ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen)
         readdata(tsv, sizeof(tsv));
         writereg(ERDPTL, erdpt & 0xff);
         writereg(ERDPTH, erdpt >> 8);
-        PRINTF(
-            "enc28j60: tx err: %d: %02x:%02x:%02x:%02x:%02x:%02x\n"
-            "                  tsv: %02x%02x%02x%02x%02x%02x%02x\n",
+        PRINTF("enc28j60: tx err: %d: %02x:%02x:%02x:%02x:%02x:%02x\n"
+               "                  tsv: %02x%02x%02x%02x%02x%02x%02x\n",
             datalen,
             0xff & data[0], 0xff & data[1], 0xff & data[2],
             0xff & data[3], 0xff & data[4], 0xff & data[5],
diff --git a/tests/device/libraries/BSTest/src/BSArgs.h b/tests/device/libraries/BSTest/src/BSArgs.h
index d7ce60500f..b989802c2d 100644
--- a/tests/device/libraries/BSTest/src/BSArgs.h
+++ b/tests/device/libraries/BSTest/src/BSArgs.h
@@ -170,8 +170,8 @@ namespace protocol
         return argc;
     }
 
-}  // namespace protocol
-
 }  // namespace bs
 
+}  // namespace protocol
+
 #endif  //BS_ARGS_H
diff --git a/tests/device/libraries/BSTest/src/BSProtocol.h b/tests/device/libraries/BSTest/src/BSProtocol.h
index 9b1d128ae1..868e5cceba 100644
--- a/tests/device/libraries/BSTest/src/BSProtocol.h
+++ b/tests/device/libraries/BSTest/src/BSProtocol.h
@@ -121,7 +121,7 @@ namespace protocol
         return true;
     }
 
-}  // namespace protocol
-}  // namespace bs
+}  // ::protocol
+}  // ::bs
 
 #endif  //BS_PROTOCOL_H
diff --git a/tests/device/libraries/BSTest/src/BSTest.h b/tests/device/libraries/BSTest/src/BSTest.h
index d4e9126265..f792637e7e 100644
--- a/tests/device/libraries/BSTest/src/BSTest.h
+++ b/tests/device/libraries/BSTest/src/BSTest.h
@@ -225,7 +225,7 @@ inline void require(bool condition, size_t line)
     }
 }
 
-}  // namespace bs
+}  // ::bs
 
 #define BS_NAME_LINE2(name, line) name##line
 #define BS_NAME_LINE(name, line) BS_NAME_LINE2(name, line)
diff --git a/tests/device/test_libc/memmove1.c b/tests/device/test_libc/memmove1.c
index 7a4c915b4b..0d76f7cda7 100644
--- a/tests/device/test_libc/memmove1.c
+++ b/tests/device/test_libc/memmove1.c
@@ -65,7 +65,8 @@ int errors = 0;
 
 void mymemmove(unsigned char* dest, unsigned char* src, size_t n)
 {
-    if ((src <= dest && src + n <= dest) || src >= dest)
+    if ((src <= dest && src + n <= dest)
+        || src >= dest)
         while (n-- > 0)
             *dest++ = *src++;
     else
@@ -153,9 +154,8 @@ void memmove_main(void)
             if (memcmp(to_known, to_test, sizeof(to_known)) != 0)
             {
                 errors++;
-                DEBUGP(
-                    "memmove failed for %d bytes,"
-                    " with src %d bytes before dest\n",
+                DEBUGP("memmove failed for %d bytes,"
+                       " with src %d bytes before dest\n",
                     i, j);
             }
         }
@@ -176,9 +176,8 @@ void memmove_main(void)
             if (memcmp(to_known, to_test, sizeof(to_known)) != 0)
             {
                 errors++;
-                DEBUGP(
-                    "memmove failed when moving %d bytes,"
-                    " with src %d bytes after dest\n",
+                DEBUGP("memmove failed when moving %d bytes,"
+                       " with src %d bytes after dest\n",
                     i, j);
             }
         }
diff --git a/tests/device/test_libc/tstring.c b/tests/device/test_libc/tstring.c
index ddf326934f..9434523f85 100644
--- a/tests/device/test_libc/tstring.c
+++ b/tests/device/test_libc/tstring.c
@@ -93,7 +93,8 @@ void tstring_main(void)
         test_failed = 1;
     }
 
-    if (strcmp(target, "A") || strlen(target) != 1 || memchr(target, 'A', 0) != NULL || memcmp(target, "J", 0) || strncmp(target, "A", 1) || strncmp(target, "J", 0) || tmp2[0] != 'Z' || tmp2[1] != '\0')
+    if (strcmp(target, "A") || strlen(target) != 1 || memchr(target, 'A', 0) != NULL
+        || memcmp(target, "J", 0) || strncmp(target, "A", 1) || strncmp(target, "J", 0) || tmp2[0] != 'Z' || tmp2[1] != '\0')
     {
         eprintf(__LINE__, target, "A", 0);
         test_failed = 1;
diff --git a/tests/host/common/MockTools.cpp b/tests/host/common/MockTools.cpp
index 43254efb7b..e291486c5f 100644
--- a/tests/host/common/MockTools.cpp
+++ b/tests/host/common/MockTools.cpp
@@ -67,7 +67,8 @@ extern "C"
 #define make_stack_thunk(fcnToThunk)
 };
 
-void configTime(int timezone, int daylightOffset_sec, const char* server1, const char* server2, const char* server3)
+void configTime(int timezone, int daylightOffset_sec,
+    const char* server1, const char* server2, const char* server3)
 {
     (void)server1;
     (void)server2;
diff --git a/tests/host/common/MockUART.cpp b/tests/host/common/MockUART.cpp
index 0eafde29e0..b87ea3b0f9 100644
--- a/tests/host/common/MockUART.cpp
+++ b/tests/host/common/MockUART.cpp
@@ -494,14 +494,8 @@ extern "C"
     }
 };
 
-size_t uart_peek_available(uart_t* uart)
-{
-    return 0;
-}
-const char* uart_peek_buffer(uart_t* uart)
-{
-    return nullptr;
-}
+size_t uart_peek_available(uart_t* uart) { return 0; }
+const char* uart_peek_buffer(uart_t* uart) { return nullptr; }
 void uart_peek_consume(uart_t* uart, size_t consume)
 {
     (void)uart;
diff --git a/tests/host/common/include/UdpContext.h b/tests/host/common/include/UdpContext.h
index eb8a071703..a070108459 100644
--- a/tests/host/common/include/UdpContext.h
+++ b/tests/host/common/include/UdpContext.h
@@ -237,7 +237,8 @@ class UdpContext
         return trySend(addr, port, false) == ERR_OK;
     }
 
-    bool sendTimeout(ip_addr_t* addr, uint16_t port, esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
+    bool sendTimeout(ip_addr_t* addr, uint16_t port,
+        esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
     {
         err_t err;
         esp8266::polledTimeout::oneShotFastMs timeout(timeoutMs);
diff --git a/tests/host/common/user_interface.cpp b/tests/host/common/user_interface.cpp
index 9103e40648..aede8d2d39 100644
--- a/tests/host/common/user_interface.cpp
+++ b/tests/host/common/user_interface.cpp
@@ -185,7 +185,8 @@ extern "C"
         for (ifa = ifAddrStruct; ifa != NULL; ifa = ifa->ifa_next)
         {
             mockverbose("host: interface: %s", ifa->ifa_name);
-            if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET  // ip_info is IPv4 only
+            if (ifa->ifa_addr
+                && ifa->ifa_addr->sa_family == AF_INET  // ip_info is IPv4 only
             )
             {
                 auto test_ipv4 = lwip_ntohl(*(uint32_t*)&((struct sockaddr_in*)ifa->ifa_addr)->sin_addr);
diff --git a/tests/host/fs/test_fs.cpp b/tests/host/fs/test_fs.cpp
index 73fc1b2cc6..ae88591388 100644
--- a/tests/host/fs/test_fs.cpp
+++ b/tests/host/fs/test_fs.cpp
@@ -59,7 +59,7 @@ TEST_CASE("SPIFFS checks the config object passed in", "[fs]")
 }
 #pragma GCC diagnostic pop
 
-};  // namespace spiffs_test
+};
 
 namespace littlefs_test
 {
@@ -93,7 +93,7 @@ TEST_CASE("LittleFS checks the config object passed in", "[fs]")
     REQUIRE(LittleFS.setConfig(l));
 }
 
-};  // namespace littlefs_test
+};
 
 namespace sdfs_test
 {
@@ -101,11 +101,10 @@ namespace sdfs_test
 #define TESTPRE "SDFS - "
 #define TESTPAT "[sdfs]"
 // SDFS supports long paths (MAXPATH)
-#define TOOLONGFILENAME                                                                                    \
-    "/"                                                                                                    \
-    "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
-    "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
-    "12345678901234567890123456789012345678901234567890123456"
+#define TOOLONGFILENAME "/"                                                                                                    \
+                        "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
+                        "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
+                        "12345678901234567890123456789012345678901234567890123456"
 #define FS_MOCK_DECLARE SDFS_MOCK_DECLARE
 #define FS_MOCK_RESET SDFS_MOCK_RESET
 #define FS_HAS_DIRS
@@ -164,4 +163,4 @@ TEST_CASE("SD.h FILE_WRITE macro is append", "[fs]")
     REQUIRE(u == 0);
 }
 
-};  // namespace sdfs_test
+};

From 591336c10e0f366a13ca6b1a25a7089c2ad81671 Mon Sep 17 00:00:00 2001
From: David Gauchard <gauchard@laas.fr>
Date: Thu, 20 Jan 2022 11:04:35 +0100
Subject: [PATCH 09/15] update and embed clang-format configuration into
 tests/restyle.sh

---
 cores/esp8266/LwipDhcpServer-NonOS.cpp        |    2 +-
 cores/esp8266/LwipDhcpServer.cpp              |  278 ++---
 cores/esp8266/LwipDhcpServer.h                |  106 +-
 cores/esp8266/LwipIntf.cpp                    |    8 +-
 cores/esp8266/LwipIntf.h                      |    6 +-
 cores/esp8266/LwipIntfCB.cpp                  |   14 +-
 cores/esp8266/LwipIntfDev.h                   |   58 +-
 cores/esp8266/StreamSend.cpp                  |   26 +-
 cores/esp8266/StreamString.h                  |  112 +-
 cores/esp8266/core_esp8266_si2c.cpp           |  176 +--
 .../ArduinoOTA/examples/BasicOTA/BasicOTA.ino |   83 +-
 .../ArduinoOTA/examples/OTALeds/OTALeds.ino   |   39 +-
 .../CaptivePortalAdvanced.ino                 |   71 +-
 .../CaptivePortalAdvanced/handleHttp.ino      |   63 +-
 .../examples/CaptivePortalAdvanced/tools.ino  |   15 +-
 .../Arduino_Wifi_AVRISP.ino                   |   46 +-
 .../examples/Authorization/Authorization.ino  |   24 +-
 .../BasicHttpClient/BasicHttpClient.ino       |   31 +-
 .../BasicHttpsClient/BasicHttpsClient.ino     |   33 +-
 .../DigestAuthorization.ino                   |   60 +-
 .../PostHttpClient/PostHttpClient.ino         |   26 +-
 .../ReuseConnectionV2/ReuseConnectionV2.ino   |   36 +-
 .../StreamHttpClient/StreamHttpClient.ino     |   38 +-
 .../StreamHttpsClient/StreamHttpsClient.ino   |   49 +-
 .../SecureBearSSLUpdater.ino                  |   32 +-
 .../SecureWebUpdater/SecureWebUpdater.ino     |   26 +-
 .../examples/WebUpdater/WebUpdater.ino        |   18 +-
 .../LLMNR_Web_Server/LLMNR_Web_Server.ino     |   19 +-
 .../examples/ESP_NBNST/ESP_NBNST.ino          |   18 +-
 libraries/ESP8266SSDP/examples/SSDP/SSDP.ino  |   31 +-
 .../AdvancedWebServer/AdvancedWebServer.ino   |   48 +-
 .../examples/FSBrowser/FSBrowser.ino          |  311 +++--
 .../ESP8266WebServer/examples/Graph/Graph.ino |  153 ++-
 .../examples/HelloServer/HelloServer.ino      |  164 +--
 .../HelloServerBearSSL/HelloServerBearSSL.ino |   56 +-
 .../HttpAdvancedAuth/HttpAdvancedAuth.ino     |   50 +-
 .../examples/HttpBasicAuth/HttpBasicAuth.ino  |   31 +-
 .../HttpHashCredAuth/HttpHashCredAuth.ino     |  111 +-
 .../examples/PathArgServer/PathArgServer.ino  |   41 +-
 .../examples/PostServer/PostServer.ino        |   52 +-
 .../ServerSentEvents/ServerSentEvents.ino     |  148 ++-
 .../SimpleAuthentication.ino                  |   57 +-
 .../examples/WebServer/WebServer.ino          |  146 ++-
 .../examples/WebUpdate/WebUpdate.ino          |   97 +-
 .../BearSSL_CertStore/BearSSL_CertStore.ino   |   50 +-
 .../BearSSL_MaxFragmentLength.ino             |   50 +-
 .../BearSSL_Server/BearSSL_Server.ino         |   66 +-
 .../BearSSL_ServerClientCert.ino              |   60 +-
 .../BearSSL_Sessions/BearSSL_Sessions.ino     |   39 +-
 .../BearSSL_Validation/BearSSL_Validation.ino |   63 +-
 .../examples/HTTPSRequest/HTTPSRequest.ino    |   32 +-
 libraries/ESP8266WiFi/examples/IPv6/IPv6.ino  |   96 +-
 .../examples/NTPClient/NTPClient.ino          |   69 +-
 .../examples/PagerServer/PagerServer.ino      |   32 +-
 .../RangeExtender-NAPT/RangeExtender-NAPT.ino |   32 +-
 .../examples/StaticLease/StaticLease.ino      |   39 +-
 libraries/ESP8266WiFi/examples/Udp/Udp.ino    |   30 +-
 .../WiFiAccessPoint/WiFiAccessPoint.ino       |   13 +-
 .../examples/WiFiClient/WiFiClient.ino        |   37 +-
 .../WiFiClientBasic/WiFiClientBasic.ino       |   20 +-
 .../examples/WiFiEcho/WiFiEcho.ino            |   94 +-
 .../examples/WiFiEvents/WiFiEvents.ino        |   41 +-
 .../WiFiManualWebServer.ino                   |   32 +-
 .../examples/WiFiScan/WiFiScan.ino            |   48 +-
 .../examples/WiFiShutdown/WiFiShutdown.ino    |   18 +-
 .../WiFiTelnetToSerial/WiFiTelnetToSerial.ino |   78 +-
 .../examples/HelloEspnow/HelloEspnow.ino      |  203 ++--
 .../examples/HelloMesh/HelloMesh.ino          |  109 +-
 .../examples/HelloTcpIp/HelloTcpIp.ino        |  137 ++-
 .../examples/httpUpdate/httpUpdate.ino        |   29 +-
 .../httpUpdateLittleFS/httpUpdateLittleFS.ino |   20 +-
 .../httpUpdateSecure/httpUpdateSecure.ino     |   35 +-
 .../httpUpdateSigned/httpUpdateSigned.ino     |   25 +-
 .../LEAmDNS/mDNS_Clock/mDNS_Clock.ino         |  105 +-
 .../mDNS_ServiceMonitor.ino                   |  125 +-
 .../OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino   |   73 +-
 .../mDNS-SD_Extended/mDNS-SD_Extended.ino     |   32 +-
 .../mDNS_Web_Server/mDNS_Web_Server.ino       |   48 +-
 libraries/ESP8266mDNS/src/LEAmDNS.cpp         |  356 +++---
 libraries/ESP8266mDNS/src/LEAmDNS.h           | 1018 ++++++++---------
 libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp |  238 ++--
 libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp |  100 +-
 libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp |  367 +++---
 .../ESP8266mDNS/src/LEAmDNS_Transfer.cpp      |  606 +++++-----
 .../InputSerialPlotter/InputSerialPlotter.ino |   19 +-
 .../I2S/examples/SimpleTone/SimpleTone.ino    |   26 +-
 .../LittleFS_Timestamp/LittleFS_Timestamp.ino |   83 +-
 .../LittleFS/examples/SpeedTest/SpeedTest.ino |   98 +-
 .../Netdump/examples/Netdump/Netdump.ino      |  108 +-
 libraries/Netdump/src/Netdump.cpp             |   30 +-
 libraries/Netdump/src/Netdump.h               |   36 +-
 libraries/Netdump/src/NetdumpIP.cpp           |   12 +-
 libraries/Netdump/src/NetdumpIP.h             |   18 +-
 libraries/Netdump/src/NetdumpPacket.cpp       |    2 +-
 libraries/Netdump/src/NetdumpPacket.h         |   53 +-
 libraries/Netdump/src/PacketType.h            |    4 +-
 .../SD/examples/Datalogger/Datalogger.ino     |   21 +-
 libraries/SD/examples/DumpFile/DumpFile.ino   |   18 +-
 libraries/SD/examples/Files/Files.ino         |   30 +-
 libraries/SD/examples/ReadWrite/ReadWrite.ino |   26 +-
 libraries/SD/examples/listfiles/listfiles.ino |   33 +-
 .../SPISlave_Master/SPISlave_Master.ino       |   46 +-
 .../SPISlave_SafeMaster.ino                   |   49 +-
 .../examples/SPISlave_Test/SPISlave_Test.ino  |   56 +-
 libraries/Servo/examples/Sweep/Sweep.ino      |   24 +-
 .../examples/drawCircle/drawCircle.ino        |   18 +-
 .../examples/drawLines/drawLines.ino          |   16 +-
 .../examples/drawNumber/drawNumber.ino        |   24 +-
 .../examples/drawRectangle/drawRectangle.ino  |   10 +-
 .../examples/paint/paint.ino                  |   33 +-
 .../examples/shapes/shapes.ino                |   15 +-
 .../examples/text/text.ino                    |   24 +-
 .../examples/tftbmp/tftbmp.ino                |   96 +-
 .../examples/tftbmp2/tftbmp2.ino              |  147 ++-
 .../examples/TickerBasic/TickerBasic.ino      |   21 +-
 .../TickerFunctional/TickerFunctional.ino     |   42 +-
 libraries/Wire/Wire.cpp                       |   36 +-
 libraries/Wire/Wire.h                         |   60 +-
 .../examples/master_reader/master_reader.ino  |   24 +-
 .../examples/master_writer/master_writer.ino  |   21 +-
 .../slave_receiver/slave_receiver.ino         |   29 +-
 .../examples/slave_sender/slave_sender.ino    |   17 +-
 libraries/esp8266/examples/Blink/Blink.ino    |   16 +-
 .../BlinkPolledTimeout/BlinkPolledTimeout.ino |   40 +-
 .../BlinkWithoutDelay/BlinkWithoutDelay.ino   |   24 +-
 .../examples/CallBackList/CallBackGeneric.ino |   50 +-
 .../examples/CheckFlashCRC/CheckFlashCRC.ino  |   17 +-
 .../CheckFlashConfig/CheckFlashConfig.ino     |   24 +-
 .../examples/ConfigFile/ConfigFile.ino        |   46 +-
 .../FadePolledTimeout/FadePolledTimeout.ino   |   31 +-
 .../examples/HeapMetric/HeapMetric.ino        |   48 +-
 .../examples/HelloCrypto/HelloCrypto.ino      |   31 +-
 .../examples/HwdtStackDump/HwdtStackDump.ino  |   30 +-
 .../examples/HwdtStackDump/ProcessKey.ino     |   26 +-
 .../examples/I2STransmit/I2STransmit.ino      |   27 +-
 .../examples/IramReserve/IramReserve.ino      |   35 +-
 .../examples/IramReserve/ProcessKey.ino       |   26 +-
 .../examples/LowPowerDemo/LowPowerDemo.ino    |  373 +++---
 libraries/esp8266/examples/MMU48K/MMU48K.ino  |  103 +-
 .../examples/NTP-TZ-DST/NTP-TZ-DST.ino        |  127 +-
 .../examples/RTCUserMemory/RTCUserMemory.ino  |   59 +-
 .../SerialDetectBaudrate.ino                  |   18 +-
 .../examples/SerialStress/SerialStress.ino    |  119 +-
 .../SigmaDeltaDemo/SigmaDeltaDemo.ino         |   24 +-
 .../examples/StreamString/StreamString.ino    |   45 +-
 .../examples/TestEspApi/TestEspApi.ino        |   45 +-
 .../examples/UartDownload/UartDownload.ino    |   49 +-
 .../examples/interactive/interactive.ino      |   33 +-
 .../esp8266/examples/irammem/irammem.ino      |  372 +++---
 .../examples/virtualmem/virtualmem.ino        |   57 +-
 .../lwIP_PPP/examples/PPPServer/PPPServer.ino |   44 +-
 libraries/lwIP_PPP/src/PPPServer.cpp          |   16 +-
 libraries/lwIP_PPP/src/PPPServer.h            |   16 +-
 .../lwIP_enc28j60/src/utility/enc28j60.cpp    |   34 +-
 .../lwIP_enc28j60/src/utility/enc28j60.h      |   52 +-
 libraries/lwIP_w5100/src/utility/w5100.cpp    |   19 +-
 libraries/lwIP_w5100/src/utility/w5100.h      |  156 +--
 libraries/lwIP_w5500/src/utility/w5500.cpp    |    9 +-
 libraries/lwIP_w5500/src/utility/w5500.h      |  230 ++--
 tests/clang-format-arduino                    |    5 -
 tests/clang-format-core                       |    8 -
 tests/device/libraries/BSTest/src/BSArduino.h |   12 +-
 tests/device/libraries/BSTest/src/BSArgs.h    |   34 +-
 .../device/libraries/BSTest/src/BSProtocol.h  |    2 +-
 tests/device/libraries/BSTest/src/BSStdio.h   |    2 +-
 tests/device/libraries/BSTest/src/BSTest.h    |   48 +-
 tests/device/test_libc/libm_string.c          |   12 +-
 tests/device/test_libc/memcpy-1.c             |   53 +-
 tests/device/test_libc/memmove1.c             |   10 +-
 tests/device/test_libc/strcmp-1.c             |   95 +-
 tests/device/test_libc/tstring.c              |   72 +-
 tests/host/common/Arduino.cpp                 |    4 +-
 tests/host/common/ArduinoMain.cpp             |   26 +-
 tests/host/common/ArduinoMainLittlefs.cpp     |    2 +-
 tests/host/common/ArduinoMainSpiffs.cpp       |    2 +-
 tests/host/common/ArduinoMainUdp.cpp          |    4 +-
 tests/host/common/ClientContextSocket.cpp     |   14 +-
 tests/host/common/ClientContextTools.cpp      |    2 +-
 tests/host/common/EEPROM.h                    |   12 +-
 tests/host/common/MockDigital.cpp             |    2 +-
 tests/host/common/MockEEPROM.cpp              |    3 +-
 tests/host/common/MockEsp.cpp                 |    6 +-
 tests/host/common/MockTools.cpp               |   18 +-
 tests/host/common/MockUART.cpp                |   56 +-
 tests/host/common/MockWiFiServerSocket.cpp    |   14 +-
 tests/host/common/MocklwIP.cpp                |    4 +-
 tests/host/common/UdpContextSocket.cpp        |   14 +-
 tests/host/common/c_types.h                   |   44 +-
 tests/host/common/flash_hal_mock.cpp          |   10 +-
 tests/host/common/include/ClientContext.h     |   36 +-
 tests/host/common/include/UdpContext.h        |   39 +-
 tests/host/common/littlefs_mock.cpp           |   16 +-
 tests/host/common/littlefs_mock.h             |    8 +-
 tests/host/common/md5.c                       |   28 +-
 tests/host/common/mock.h                      |   40 +-
 tests/host/common/noniso.c                    |   14 +-
 tests/host/common/queue.h                     |  154 +--
 tests/host/common/sdfs_mock.cpp               |    2 +-
 tests/host/common/spiffs_mock.cpp             |   18 +-
 tests/host/common/spiffs_mock.h               |    8 +-
 tests/host/common/strl.cpp                    |   16 +-
 tests/host/common/user_interface.cpp          |   38 +-
 tests/host/core/test_PolledTimeout.cpp        |    6 +-
 tests/host/core/test_Print.cpp                |   28 +-
 tests/host/core/test_Updater.cpp              |    2 +-
 tests/host/core/test_md5builder.cpp           |    2 +-
 tests/host/core/test_pgmspace.cpp             |    2 +-
 tests/host/core/test_string.cpp               |   46 +-
 tests/host/fs/test_fs.cpp                     |   20 +-
 tests/host/sys/pgmspace.h                     |   20 +-
 tests/restyle.sh                              |   43 +-
 211 files changed, 7138 insertions(+), 5608 deletions(-)
 delete mode 100644 tests/clang-format-arduino
 delete mode 100644 tests/clang-format-core

diff --git a/cores/esp8266/LwipDhcpServer-NonOS.cpp b/cores/esp8266/LwipDhcpServer-NonOS.cpp
index aee22b6d5c..56122c6074 100644
--- a/cores/esp8266/LwipDhcpServer-NonOS.cpp
+++ b/cores/esp8266/LwipDhcpServer-NonOS.cpp
@@ -31,7 +31,7 @@
 extern netif netif_git[2];
 
 // global DHCP instance for softAP interface
-DhcpServer dhcpSoftAP(&netif_git[SOFTAP_IF]);
+DhcpServer   dhcpSoftAP(&netif_git[SOFTAP_IF]);
 
 extern "C"
 {
diff --git a/cores/esp8266/LwipDhcpServer.cpp b/cores/esp8266/LwipDhcpServer.cpp
index d7eddd02d9..8cc189a83a 100644
--- a/cores/esp8266/LwipDhcpServer.cpp
+++ b/cores/esp8266/LwipDhcpServer.cpp
@@ -59,30 +59,30 @@ typedef struct dhcps_state
 
 typedef struct dhcps_msg
 {
-    uint8_t op, htype, hlen, hops;
-    uint8_t xid[4];
+    uint8_t  op, htype, hlen, hops;
+    uint8_t  xid[4];
     uint16_t secs, flags;
-    uint8_t ciaddr[4];
-    uint8_t yiaddr[4];
-    uint8_t siaddr[4];
-    uint8_t giaddr[4];
-    uint8_t chaddr[16];
-    uint8_t sname[64];
-    uint8_t file[128];
-    uint8_t options[312];
+    uint8_t  ciaddr[4];
+    uint8_t  yiaddr[4];
+    uint8_t  siaddr[4];
+    uint8_t  giaddr[4];
+    uint8_t  chaddr[16];
+    uint8_t  sname[64];
+    uint8_t  file[128];
+    uint8_t  options[312];
 } dhcps_msg;
 
 #ifndef LWIP_OPEN_SRC
 struct dhcps_lease
 {
-    bool enable;
+    bool             enable;
     struct ipv4_addr start_ip;
     struct ipv4_addr end_ip;
 };
 
 enum dhcps_offer_option
 {
-    OFFER_START = 0x00,
+    OFFER_START  = 0x00,
     OFFER_ROUTER = 0x01,
     OFFER_END
 };
@@ -103,10 +103,10 @@ typedef enum
 struct dhcps_pool
 {
     struct ipv4_addr ip;
-    uint8 mac[6];
-    uint32 lease_timer;
-    dhcps_type_t type;
-    dhcps_state_t state;
+    uint8            mac[6];
+    uint32           lease_timer;
+    dhcps_type_t     type;
+    dhcps_state_t    state;
 };
 
 #define DHCPS_LEASE_TIMER dhcps_lease_time  //0x05A0
@@ -175,20 +175,20 @@ const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__;
 #define LWIP_IS_OK(what, err) ((err) == ERR_OK)
 #endif
 
-const uint32 DhcpServer::magic_cookie = 0x63538263;  // https://tools.ietf.org/html/rfc1497
+const uint32 DhcpServer::magic_cookie    = 0x63538263;  // https://tools.ietf.org/html/rfc1497
 
-int fw_has_started_softap_dhcps = 0;
+int          fw_has_started_softap_dhcps = 0;
 
 ////////////////////////////////////////////////////////////////////////////////////
 
-DhcpServer::DhcpServer(netif* netif)
-    : _netif(netif)
+DhcpServer::DhcpServer(netif* netif) :
+    _netif(netif)
 {
-    pcb_dhcps = nullptr;
+    pcb_dhcps        = nullptr;
     dns_address.addr = 0;
-    plist = nullptr;
-    offer = 0xFF;
-    renew = false;
+    plist            = nullptr;
+    offer            = 0xFF;
+    renew            = false;
     dhcps_lease_time = DHCPS_LEASE_TIME_DEF;  //minute
 
     if (netif->num == SOFTAP_IF && fw_has_started_softap_dhcps == 1)
@@ -210,7 +210,7 @@ DhcpServer::DhcpServer(netif* netif)
 // wifi_softap_set_station_info is missing in user_interface.h:
 extern "C" void wifi_softap_set_station_info(uint8_t* mac, struct ipv4_addr*);
 
-void DhcpServer::dhcps_set_dns(int num, const ipv4_addr_t* dns)
+void            DhcpServer::dhcps_set_dns(int num, const ipv4_addr_t* dns)
 {
     (void)num;
     if (!ip4_addr_isany(dns))
@@ -227,7 +227,7 @@ void DhcpServer::dhcps_set_dns(int num, const ipv4_addr_t* dns)
 *******************************************************************************/
 void DhcpServer::node_insert_to_list(list_node** phead, list_node* pinsert)
 {
-    list_node* plist = nullptr;
+    list_node*         plist       = nullptr;
     struct dhcps_pool* pdhcps_pool = nullptr;
     struct dhcps_pool* pdhcps_node = nullptr;
     if (*phead == nullptr)
@@ -236,14 +236,14 @@ void DhcpServer::node_insert_to_list(list_node** phead, list_node* pinsert)
     }
     else
     {
-        plist = *phead;
+        plist       = *phead;
         pdhcps_node = (struct dhcps_pool*)pinsert->pnode;
         pdhcps_pool = (struct dhcps_pool*)plist->pnode;
 
         if (pdhcps_node->ip.addr < pdhcps_pool->ip.addr)
         {
             pinsert->pnext = plist;
-            *phead = pinsert;
+            *phead         = pinsert;
         }
         else
         {
@@ -253,7 +253,7 @@ void DhcpServer::node_insert_to_list(list_node** phead, list_node* pinsert)
                 if (pdhcps_node->ip.addr < pdhcps_pool->ip.addr)
                 {
                     pinsert->pnext = plist->pnext;
-                    plist->pnext = pinsert;
+                    plist->pnext   = pinsert;
                     break;
                 }
                 plist = plist->pnext;
@@ -278,7 +278,7 @@ void DhcpServer::node_remove_from_list(list_node** phead, list_node* pdelete)
 {
     list_node* plist = nullptr;
 
-    plist = *phead;
+    plist            = *phead;
     if (plist == nullptr)
     {
         *phead = nullptr;
@@ -287,7 +287,7 @@ void DhcpServer::node_remove_from_list(list_node** phead, list_node* pdelete)
     {
         if (plist == pdelete)
         {
-            *phead = plist->pnext;
+            *phead         = plist->pnext;
             pdelete->pnext = nullptr;
         }
         else
@@ -296,7 +296,7 @@ void DhcpServer::node_remove_from_list(list_node** phead, list_node* pdelete)
             {
                 if (plist->pnext == pdelete)
                 {
-                    plist->pnext = pdelete->pnext;
+                    plist->pnext   = pdelete->pnext;
                     pdelete->pnext = nullptr;
                 }
                 plist = plist->pnext;
@@ -314,10 +314,10 @@ void DhcpServer::node_remove_from_list(list_node** phead, list_node* pdelete)
 bool DhcpServer::add_dhcps_lease(uint8* macaddr)
 {
     struct dhcps_pool* pdhcps_pool = nullptr;
-    list_node* pback_node = nullptr;
+    list_node*         pback_node  = nullptr;
 
-    uint32 start_ip = dhcps_lease.start_ip.addr;
-    uint32 end_ip = dhcps_lease.end_ip.addr;
+    uint32             start_ip    = dhcps_lease.start_ip.addr;
+    uint32             end_ip      = dhcps_lease.end_ip.addr;
 
     for (pback_node = plist; pback_node != nullptr; pback_node = pback_node->pnext)
     {
@@ -343,15 +343,15 @@ bool DhcpServer::add_dhcps_lease(uint8* macaddr)
         return false;
     }
 
-    pdhcps_pool = (struct dhcps_pool*)zalloc(sizeof(struct dhcps_pool));
+    pdhcps_pool          = (struct dhcps_pool*)zalloc(sizeof(struct dhcps_pool));
     pdhcps_pool->ip.addr = start_ip;
     memcpy(pdhcps_pool->mac, macaddr, sizeof(pdhcps_pool->mac));
     pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-    pdhcps_pool->type = DHCPS_TYPE_STATIC;
-    pdhcps_pool->state = DHCPS_STATE_ONLINE;
-    pback_node = (list_node*)zalloc(sizeof(list_node));
-    pback_node->pnode = pdhcps_pool;
-    pback_node->pnext = nullptr;
+    pdhcps_pool->type        = DHCPS_TYPE_STATIC;
+    pdhcps_pool->state       = DHCPS_STATE_ONLINE;
+    pback_node               = (list_node*)zalloc(sizeof(list_node));
+    pback_node->pnode        = pdhcps_pool;
+    pback_node->pnext        = nullptr;
     node_insert_to_list(&plist, pback_node);
 
     return true;
@@ -503,12 +503,12 @@ void DhcpServer::create_msg(struct dhcps_msg* m)
 
     client.addr = client_address.addr;
 
-    m->op = DHCP_REPLY;
-    m->htype = DHCP_HTYPE_ETHERNET;
-    m->hlen = 6;
-    m->hops = 0;
-    m->secs = 0;
-    m->flags = htons(BOOTP_BROADCAST);
+    m->op       = DHCP_REPLY;
+    m->htype    = DHCP_HTYPE_ETHERNET;
+    m->hlen     = 6;
+    m->hops     = 0;
+    m->secs     = 0;
+    m->flags    = htons(BOOTP_BROADCAST);
 
     memcpy((char*)m->yiaddr, (char*)&client.addr, sizeof(m->yiaddr));
     memset((char*)m->ciaddr, 0, sizeof(m->ciaddr));
@@ -528,18 +528,18 @@ void DhcpServer::create_msg(struct dhcps_msg* m)
 ///////////////////////////////////////////////////////////////////////////////////
 void DhcpServer::send_offer(struct dhcps_msg* m)
 {
-    uint8_t* end;
+    uint8_t*     end;
     struct pbuf *p, *q;
-    u8_t* data;
-    u16_t cnt = 0;
-    u16_t i;
+    u8_t*        data;
+    u16_t        cnt = 0;
+    u16_t        i;
     create_msg(m);
 
     end = add_msg_type(&m->options[4], DHCPOFFER);
     end = add_offer_options(end);
     end = add_end(end);
 
-    p = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM);
+    p   = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM);
 #if DHCPS_DEBUG
     os_printf("udhcp: send_offer>>p->ref = %d\n", p->ref);
 #endif
@@ -592,17 +592,17 @@ void DhcpServer::send_offer(struct dhcps_msg* m)
 ///////////////////////////////////////////////////////////////////////////////////
 void DhcpServer::send_nak(struct dhcps_msg* m)
 {
-    u8_t* end;
+    u8_t*        end;
     struct pbuf *p, *q;
-    u8_t* data;
-    u16_t cnt = 0;
-    u16_t i;
+    u8_t*        data;
+    u16_t        cnt = 0;
+    u16_t        i;
     create_msg(m);
 
     end = add_msg_type(&m->options[4], DHCPNAK);
     end = add_end(end);
 
-    p = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM);
+    p   = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM);
 #if DHCPS_DEBUG
     os_printf("udhcp: send_nak>>p->ref = %d\n", p->ref);
 #endif
@@ -650,18 +650,18 @@ void DhcpServer::send_nak(struct dhcps_msg* m)
 ///////////////////////////////////////////////////////////////////////////////////
 void DhcpServer::send_ack(struct dhcps_msg* m)
 {
-    u8_t* end;
+    u8_t*        end;
     struct pbuf *p, *q;
-    u8_t* data;
-    u16_t cnt = 0;
-    u16_t i;
+    u8_t*        data;
+    u16_t        cnt = 0;
+    u16_t        i;
     create_msg(m);
 
     end = add_msg_type(&m->options[4], DHCPACK);
     end = add_offer_options(end);
     end = add_end(end);
 
-    p = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM);
+    p   = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM);
 #if DHCPS_DEBUG
     os_printf("udhcp: send_ack>>p->ref = %d\n", p->ref);
 #endif
@@ -718,16 +718,16 @@ void DhcpServer::send_ack(struct dhcps_msg* m)
 ///////////////////////////////////////////////////////////////////////////////////
 uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
 {
-    struct ipv4_addr client;
-    bool is_dhcp_parse_end = false;
+    struct ipv4_addr   client;
+    bool               is_dhcp_parse_end = false;
     struct dhcps_state s;
 
     client.addr = client_address.addr;
 
-    u8_t* end = optptr + len;
-    u16_t type = 0;
+    u8_t* end   = optptr + len;
+    u16_t type  = 0;
 
-    s.state = DHCPS_STATE_IDLE;
+    s.state     = DHCPS_STATE_IDLE;
 
     while (optptr < end)
     {
@@ -822,15 +822,15 @@ uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
 sint16_t DhcpServer::parse_msg(struct dhcps_msg* m, u16_t len)
 {
     if (memcmp((char*)m->options,
-            &magic_cookie,
-            sizeof(magic_cookie))
+               &magic_cookie,
+               sizeof(magic_cookie))
         == 0)
     {
         struct ipv4_addr ip;
         memcpy(&ip.addr, m->ciaddr, sizeof(ip.addr));
         client_address.addr = dhcps_client_update(m->chaddr, &ip);
 
-        sint16_t ret = parse_options(&m->options[4], len);
+        sint16_t ret        = parse_options(&m->options[4], len);
 
         if (ret == DHCPS_STATE_RELEASE)
         {
@@ -855,32 +855,32 @@ sint16_t DhcpServer::parse_msg(struct dhcps_msg* m, u16_t len)
 */
 ///////////////////////////////////////////////////////////////////////////////////
 
-void DhcpServer::S_handle_dhcp(void* arg,
-    struct udp_pcb* pcb,
-    struct pbuf* p,
-    const ip_addr_t* addr,
-    uint16_t port)
+void DhcpServer::S_handle_dhcp(void*            arg,
+                               struct udp_pcb*  pcb,
+                               struct pbuf*     p,
+                               const ip_addr_t* addr,
+                               uint16_t         port)
 {
     DhcpServer* instance = reinterpret_cast<DhcpServer*>(arg);
     instance->handle_dhcp(pcb, p, addr, port);
 }
 
 void DhcpServer::handle_dhcp(
-    struct udp_pcb* pcb,
-    struct pbuf* p,
+    struct udp_pcb*  pcb,
+    struct pbuf*     p,
     const ip_addr_t* addr,
-    uint16_t port)
+    uint16_t         port)
 {
     (void)pcb;
     (void)addr;
     (void)port;
 
-    struct dhcps_msg* pmsg_dhcps = nullptr;
-    sint16_t tlen = 0;
-    u16_t i = 0;
-    u16_t dhcps_msg_cnt = 0;
-    u8_t* p_dhcps_msg = nullptr;
-    u8_t* data = nullptr;
+    struct dhcps_msg* pmsg_dhcps    = nullptr;
+    sint16_t          tlen          = 0;
+    u16_t             i             = 0;
+    u16_t             dhcps_msg_cnt = 0;
+    u8_t*             p_dhcps_msg   = nullptr;
+    u8_t*             data          = nullptr;
 
 #if DHCPS_DEBUG
     os_printf("dhcps: handle_dhcp-> receive a packet\n");
@@ -897,8 +897,8 @@ void DhcpServer::handle_dhcp(
         return;
     }
     p_dhcps_msg = (u8_t*)pmsg_dhcps;
-    tlen = p->tot_len;
-    data = (u8_t*)p->payload;
+    tlen        = p->tot_len;
+    data        = (u8_t*)p->payload;
 
 #if DHCPS_DEBUG
     os_printf("dhcps: handle_dhcp-> p->tot_len = %d\n", tlen);
@@ -968,12 +968,12 @@ void DhcpServer::init_dhcps_lease(uint32 ip)
 {
     uint32 softap_ip = 0, local_ip = 0;
     uint32 start_ip = 0;
-    uint32 end_ip = 0;
+    uint32 end_ip   = 0;
     if (dhcps_lease.enable == true)
     {
         softap_ip = htonl(ip);
-        start_ip = htonl(dhcps_lease.start_ip.addr);
-        end_ip = htonl(dhcps_lease.end_ip.addr);
+        start_ip  = htonl(dhcps_lease.start_ip.addr);
+        end_ip    = htonl(dhcps_lease.end_ip.addr);
         /*config ip information can't contain local ip*/
         if ((start_ip <= softap_ip) && (softap_ip <= end_ip))
         {
@@ -1007,9 +1007,9 @@ void DhcpServer::init_dhcps_lease(uint32 ip)
 
         bzero(&dhcps_lease, sizeof(dhcps_lease));
         dhcps_lease.start_ip.addr = softap_ip | local_ip;
-        dhcps_lease.end_ip.addr = softap_ip | (local_ip + DHCPS_MAX_LEASE - 1);
+        dhcps_lease.end_ip.addr   = softap_ip | (local_ip + DHCPS_MAX_LEASE - 1);
         dhcps_lease.start_ip.addr = htonl(dhcps_lease.start_ip.addr);
-        dhcps_lease.end_ip.addr = htonl(dhcps_lease.end_ip.addr);
+        dhcps_lease.end_ip.addr   = htonl(dhcps_lease.end_ip.addr);
     }
     //  dhcps_lease.start_ip.addr = htonl(dhcps_lease.start_ip.addr);
     //  dhcps_lease.end_ip.addr= htonl(dhcps_lease.end_ip.addr);
@@ -1071,20 +1071,20 @@ void DhcpServer::end()
 
     udp_disconnect(pcb_dhcps);
     udp_remove(pcb_dhcps);
-    pcb_dhcps = nullptr;
+    pcb_dhcps                     = nullptr;
 
     //udp_remove(pcb_dhcps);
-    list_node* pnode = nullptr;
-    list_node* pback_node = nullptr;
-    struct dhcps_pool* dhcp_node = nullptr;
-    struct ipv4_addr ip_zero;
+    list_node*         pnode      = nullptr;
+    list_node*         pback_node = nullptr;
+    struct dhcps_pool* dhcp_node  = nullptr;
+    struct ipv4_addr   ip_zero;
 
     memset(&ip_zero, 0x0, sizeof(ip_zero));
     pnode = plist;
     while (pnode != nullptr)
     {
         pback_node = pnode;
-        pnode = pback_node->pnext;
+        pnode      = pback_node->pnext;
         node_remove_from_list(&plist, pback_node);
         dhcp_node = (struct dhcps_pool*)pback_node->pnode;
         //dhcps_client_leave(dhcp_node->mac,&dhcp_node->ip,true); // force to delete
@@ -1114,8 +1114,8 @@ bool DhcpServer::isRunning()
 bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
 {
     uint32 softap_ip = 0;
-    uint32 start_ip = 0;
-    uint32 end_ip = 0;
+    uint32 start_ip  = 0;
+    uint32 end_ip    = 0;
 
     if (_netif->num == SOFTAP_IF || _netif->num == STATION_IF)
     {
@@ -1137,8 +1137,8 @@ bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
         // - is wrong
         // - limited to /24 address plans
         softap_ip = htonl(ip_2_ip4(&_netif->ip_addr)->addr);
-        start_ip = htonl(please->start_ip.addr);
-        end_ip = htonl(please->end_ip.addr);
+        start_ip  = htonl(please->start_ip.addr);
+        end_ip    = htonl(please->end_ip.addr);
         /*config ip information can't contain local ip*/
         if ((start_ip <= softap_ip) && (softap_ip <= end_ip))
         {
@@ -1162,7 +1162,7 @@ bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
         //      dhcps_lease.start_ip.addr = start_ip;
         //      dhcps_lease.end_ip.addr = end_ip;
         dhcps_lease.start_ip.addr = please->start_ip.addr;
-        dhcps_lease.end_ip.addr = please->end_ip.addr;
+        dhcps_lease.end_ip.addr   = please->end_ip.addr;
     }
     dhcps_lease.enable = please->enable;
     //  dhcps_lease_flag = false;
@@ -1215,32 +1215,32 @@ bool DhcpServer::get_dhcps_lease(struct dhcps_lease* please)
     //      please->end_ip.addr = dhcps_lease.end_ip.addr;
     //  }
     please->start_ip.addr = dhcps_lease.start_ip.addr;
-    please->end_ip.addr = dhcps_lease.end_ip.addr;
+    please->end_ip.addr   = dhcps_lease.end_ip.addr;
     return true;
 }
 
 void DhcpServer::kill_oldest_dhcps_pool(void)
 {
-    list_node *pre = nullptr, *p = nullptr;
-    list_node *minpre = nullptr, *minp = nullptr;
+    list_node *        pre = nullptr, *p = nullptr;
+    list_node *        minpre = nullptr, *minp = nullptr;
     struct dhcps_pool *pdhcps_pool = nullptr, *pmin_pool = nullptr;
-    pre = plist;
-    p = pre->pnext;
+    pre    = plist;
+    p      = pre->pnext;
     minpre = pre;
-    minp = p;
+    minp   = p;
     while (p != nullptr)
     {
         pdhcps_pool = (struct dhcps_pool*)p->pnode;
-        pmin_pool = (struct dhcps_pool*)minp->pnode;
+        pmin_pool   = (struct dhcps_pool*)minp->pnode;
         if (pdhcps_pool->lease_timer < pmin_pool->lease_timer)
         {
-            minp = p;
+            minp   = p;
             minpre = pre;
         }
         pre = p;
-        p = p->pnext;
+        p   = p->pnext;
     }
-    minpre->pnext = minp->pnext;
+    minpre->pnext      = minp->pnext;
     pdhcps_pool->state = DHCPS_STATE_OFFLINE;
     free(minp->pnode);
     minp->pnode = nullptr;
@@ -1250,11 +1250,11 @@ void DhcpServer::kill_oldest_dhcps_pool(void)
 
 void DhcpServer::dhcps_coarse_tmr(void)
 {
-    uint8 num_dhcps_pool = 0;
-    list_node* pback_node = nullptr;
-    list_node* pnode = nullptr;
-    struct dhcps_pool* pdhcps_pool = nullptr;
-    pnode = plist;
+    uint8              num_dhcps_pool = 0;
+    list_node*         pback_node     = nullptr;
+    list_node*         pnode          = nullptr;
+    struct dhcps_pool* pdhcps_pool    = nullptr;
+    pnode                             = plist;
     while (pnode != nullptr)
     {
         pdhcps_pool = (struct dhcps_pool*)pnode->pnode;
@@ -1265,7 +1265,7 @@ void DhcpServer::dhcps_coarse_tmr(void)
         if (pdhcps_pool->lease_timer == 0)
         {
             pback_node = pnode;
-            pnode = pback_node->pnext;
+            pnode      = pback_node->pnext;
             node_remove_from_list(&plist, pback_node);
             free(pback_node->pnode);
             pback_node->pnode = nullptr;
@@ -1302,7 +1302,7 @@ bool DhcpServer::set_dhcps_offer_option(uint8 level, void* optarg)
     switch (level)
     {
     case OFFER_ROUTER:
-        offer = (*(uint8*)optarg) & 0x01;
+        offer      = (*(uint8*)optarg) & 0x01;
         offer_flag = true;
         break;
     default:
@@ -1363,7 +1363,7 @@ uint32 DhcpServer::get_dhcps_lease_time(void)  // minute
 void DhcpServer::dhcps_client_leave(u8* bssid, struct ipv4_addr* ip, bool force)
 {
     struct dhcps_pool* pdhcps_pool = nullptr;
-    list_node* pback_node = nullptr;
+    list_node*         pback_node  = nullptr;
 
     if ((bssid == nullptr) || (ip == nullptr))
     {
@@ -1412,13 +1412,13 @@ void DhcpServer::dhcps_client_leave(u8* bssid, struct ipv4_addr* ip, bool force)
 uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
 {
     struct dhcps_pool* pdhcps_pool = nullptr;
-    list_node* pback_node = nullptr;
-    list_node* pmac_node = nullptr;
-    list_node* pip_node = nullptr;
-    bool flag = false;
-    uint32 start_ip = dhcps_lease.start_ip.addr;
-    uint32 end_ip = dhcps_lease.end_ip.addr;
-    dhcps_type_t type = DHCPS_TYPE_DYNAMIC;
+    list_node*         pback_node  = nullptr;
+    list_node*         pmac_node   = nullptr;
+    list_node*         pip_node    = nullptr;
+    bool               flag        = false;
+    uint32             start_ip    = dhcps_lease.start_ip.addr;
+    uint32             end_ip      = dhcps_lease.end_ip.addr;
+    dhcps_type_t       type        = DHCPS_TYPE_DYNAMIC;
     if (bssid == nullptr)
     {
         return IPADDR_ANY;
@@ -1522,12 +1522,12 @@ uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
             else
             {
                 renew = true;
-                type = DHCPS_TYPE_DYNAMIC;
+                type  = DHCPS_TYPE_DYNAMIC;
             }
 
             pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-            pdhcps_pool->type = type;
-            pdhcps_pool->state = DHCPS_STATE_ONLINE;
+            pdhcps_pool->type        = type;
+            pdhcps_pool->state       = DHCPS_STATE_ONLINE;
         }
         else
         {
@@ -1547,8 +1547,8 @@ uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
 
             node_remove_from_list(&plist, pmac_node);
             pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-            pdhcps_pool->type = type;
-            pdhcps_pool->state = DHCPS_STATE_ONLINE;
+            pdhcps_pool->type        = type;
+            pdhcps_pool->state       = DHCPS_STATE_ONLINE;
             node_insert_to_list(&plist, pmac_node);
         }
     }
@@ -1563,8 +1563,8 @@ uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
             }
             memcpy(pdhcps_pool->mac, bssid, sizeof(pdhcps_pool->mac));
             pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-            pdhcps_pool->type = type;
-            pdhcps_pool->state = DHCPS_STATE_ONLINE;
+            pdhcps_pool->type        = type;
+            pdhcps_pool->state       = DHCPS_STATE_ONLINE;
         }
         else
         {
@@ -1589,11 +1589,11 @@ uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
             }
             memcpy(pdhcps_pool->mac, bssid, sizeof(pdhcps_pool->mac));
             pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-            pdhcps_pool->type = type;
-            pdhcps_pool->state = DHCPS_STATE_ONLINE;
-            pback_node = (list_node*)zalloc(sizeof(list_node));
-            pback_node->pnode = pdhcps_pool;
-            pback_node->pnext = nullptr;
+            pdhcps_pool->type        = type;
+            pdhcps_pool->state       = DHCPS_STATE_ONLINE;
+            pback_node               = (list_node*)zalloc(sizeof(list_node));
+            pback_node->pnode        = pdhcps_pool;
+            pback_node->pnext        = nullptr;
             node_insert_to_list(&plist, pback_node);
         }
     }
diff --git a/cores/esp8266/LwipDhcpServer.h b/cores/esp8266/LwipDhcpServer.h
index 74fa3a4018..73004cd075 100644
--- a/cores/esp8266/LwipDhcpServer.h
+++ b/cores/esp8266/LwipDhcpServer.h
@@ -39,11 +39,11 @@ class DhcpServer
     DhcpServer(netif* netif);
     ~DhcpServer();
 
-    void setDns(int num, const ipv4_addr_t* dns);
+    void   setDns(int num, const ipv4_addr_t* dns);
 
-    bool begin(ip_info* info);
-    void end();
-    bool isRunning();
+    bool   begin(ip_info* info);
+    void   end();
+    bool   isRunning();
 
     // this is the C interface encapsulated in a class
     // (originally dhcpserver.c in lwIP-v1.4 in NonOS-SDK)
@@ -52,71 +52,71 @@ class DhcpServer
 
     // legacy public C structure and API to eventually turn into C++
 
-    void init_dhcps_lease(uint32 ip);
-    bool set_dhcps_lease(struct dhcps_lease* please);
-    bool get_dhcps_lease(struct dhcps_lease* please);
-    bool set_dhcps_offer_option(uint8 level, void* optarg);
-    bool set_dhcps_lease_time(uint32 minute);
-    bool reset_dhcps_lease_time(void);
+    void   init_dhcps_lease(uint32 ip);
+    bool   set_dhcps_lease(struct dhcps_lease* please);
+    bool   get_dhcps_lease(struct dhcps_lease* please);
+    bool   set_dhcps_offer_option(uint8 level, void* optarg);
+    bool   set_dhcps_lease_time(uint32 minute);
+    bool   reset_dhcps_lease_time(void);
     uint32 get_dhcps_lease_time(void);
-    bool add_dhcps_lease(uint8* macaddr);
+    bool   add_dhcps_lease(uint8* macaddr);
 
-    void dhcps_set_dns(int num, const ipv4_addr_t* dns);
+    void   dhcps_set_dns(int num, const ipv4_addr_t* dns);
 
 protected:
     // legacy C structure and API to eventually turn into C++
 
     typedef struct _list_node
     {
-        void* pnode;
+        void*              pnode;
         struct _list_node* pnext;
     } list_node;
 
-    void node_insert_to_list(list_node** phead, list_node* pinsert);
-    void node_remove_from_list(list_node** phead, list_node* pdelete);
-    uint8_t* add_msg_type(uint8_t* optptr, uint8_t type);
-    uint8_t* add_offer_options(uint8_t* optptr);
-    uint8_t* add_end(uint8_t* optptr);
-    void create_msg(struct dhcps_msg* m);
-    void send_offer(struct dhcps_msg* m);
-    void send_nak(struct dhcps_msg* m);
-    void send_ack(struct dhcps_msg* m);
-    uint8_t parse_options(uint8_t* optptr, sint16_t len);
-    sint16_t parse_msg(struct dhcps_msg* m, u16_t len);
-    static void S_handle_dhcp(void* arg,
-        struct udp_pcb* pcb,
-        struct pbuf* p,
-        const ip_addr_t* addr,
-        uint16_t port);
-    void handle_dhcp(
-        struct udp_pcb* pcb,
-        struct pbuf* p,
-        const ip_addr_t* addr,
-        uint16_t port);
-    void kill_oldest_dhcps_pool(void);
-    void dhcps_coarse_tmr(void);  // CURRENTLY NOT CALLED
-    void dhcps_client_leave(u8* bssid, struct ipv4_addr* ip, bool force);
-    uint32 dhcps_client_update(u8* bssid, struct ipv4_addr* ip);
-
-    netif* _netif;
-
-    struct udp_pcb* pcb_dhcps;
-    ip_addr_t broadcast_dhcps;
-    struct ipv4_addr server_address;
-    struct ipv4_addr client_address;
-    struct ipv4_addr dns_address;
-    uint32 dhcps_lease_time;
-
-    struct dhcps_lease dhcps_lease;
-    list_node* plist;
-    uint8 offer;
-    bool renew;
+    void        node_insert_to_list(list_node** phead, list_node* pinsert);
+    void        node_remove_from_list(list_node** phead, list_node* pdelete);
+    uint8_t*    add_msg_type(uint8_t* optptr, uint8_t type);
+    uint8_t*    add_offer_options(uint8_t* optptr);
+    uint8_t*    add_end(uint8_t* optptr);
+    void        create_msg(struct dhcps_msg* m);
+    void        send_offer(struct dhcps_msg* m);
+    void        send_nak(struct dhcps_msg* m);
+    void        send_ack(struct dhcps_msg* m);
+    uint8_t     parse_options(uint8_t* optptr, sint16_t len);
+    sint16_t    parse_msg(struct dhcps_msg* m, u16_t len);
+    static void S_handle_dhcp(void*            arg,
+                              struct udp_pcb*  pcb,
+                              struct pbuf*     p,
+                              const ip_addr_t* addr,
+                              uint16_t         port);
+    void        handle_dhcp(
+               struct udp_pcb*  pcb,
+               struct pbuf*     p,
+               const ip_addr_t* addr,
+               uint16_t         port);
+    void                kill_oldest_dhcps_pool(void);
+    void                dhcps_coarse_tmr(void);  // CURRENTLY NOT CALLED
+    void                dhcps_client_leave(u8* bssid, struct ipv4_addr* ip, bool force);
+    uint32              dhcps_client_update(u8* bssid, struct ipv4_addr* ip);
+
+    netif*              _netif;
+
+    struct udp_pcb*     pcb_dhcps;
+    ip_addr_t           broadcast_dhcps;
+    struct ipv4_addr    server_address;
+    struct ipv4_addr    client_address;
+    struct ipv4_addr    dns_address;
+    uint32              dhcps_lease_time;
+
+    struct dhcps_lease  dhcps_lease;
+    list_node*          plist;
+    uint8               offer;
+    bool                renew;
 
     static const uint32 magic_cookie;
 };
 
 // SoftAP DHCP server always exists and is started on boot
 extern DhcpServer dhcpSoftAP;
-extern "C" int fw_has_started_softap_dhcps;
+extern "C" int    fw_has_started_softap_dhcps;
 
 #endif  // __DHCPS_H__
diff --git a/cores/esp8266/LwipIntf.cpp b/cores/esp8266/LwipIntf.cpp
index 44359e6fc1..b4ae7e06e9 100644
--- a/cores/esp8266/LwipIntf.cpp
+++ b/cores/esp8266/LwipIntf.cpp
@@ -26,19 +26,19 @@ extern "C"
 // result stored into gateway/netmask/dns1
 
 bool LwipIntf::ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3,
-    IPAddress& gateway, IPAddress& netmask, IPAddress& dns1)
+                                IPAddress& gateway, IPAddress& netmask, IPAddress& dns1)
 {
     //To allow compatibility, check first octet of 3rd arg. If 255, interpret as ESP order, otherwise Arduino order.
     gateway = arg1;
     netmask = arg2;
-    dns1 = arg3;
+    dns1    = arg3;
 
     if (netmask[0] != 255)
     {
         //octet is not 255 => interpret as Arduino order
         gateway = arg2;
         netmask = arg3[0] == 0 ? IPAddress(255, 255, 255, 0) : arg3;  //arg order is arduino and 4th arg not given => assign it arduino default
-        dns1 = arg1;
+        dns1    = arg1;
     }
 
     // check whether all is IPv4 (or gateway not set)
@@ -154,7 +154,7 @@ bool LwipIntf::hostname(const char* aHostname)
             if (lwipret != ERR_OK)
             {
                 DEBUGV("WiFi.hostname(%s): lwIP error %d on interface %c%c (index %d)\n",
-                    intf->hostname, (int)lwipret, intf->name[0], intf->name[1], intf->num);
+                       intf->hostname, (int)lwipret, intf->name[0], intf->name[1], intf->num);
                 ret = false;
             }
         }
diff --git a/cores/esp8266/LwipIntf.h b/cores/esp8266/LwipIntf.h
index 10acf716c7..13a8e56d3b 100644
--- a/cores/esp8266/LwipIntf.h
+++ b/cores/esp8266/LwipIntf.h
@@ -24,10 +24,10 @@ class LwipIntf
     //
     // result stored into gateway/netmask/dns1
     static bool ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3,
-        IPAddress& gateway, IPAddress& netmask, IPAddress& dns1);
+                                 IPAddress& gateway, IPAddress& netmask, IPAddress& dns1);
 
-    String hostname();
-    bool hostname(const String& aHostname)
+    String      hostname();
+    bool        hostname(const String& aHostname)
     {
         return hostname(aHostname.c_str());
     }
diff --git a/cores/esp8266/LwipIntfCB.cpp b/cores/esp8266/LwipIntfCB.cpp
index 71047dcdd1..a5e9b445ca 100644
--- a/cores/esp8266/LwipIntfCB.cpp
+++ b/cores/esp8266/LwipIntfCB.cpp
@@ -5,10 +5,10 @@
 
 #define NETIF_STATUS_CB_SIZE 3
 
-static int netifStatusChangeListLength = 0;
+static int       netifStatusChangeListLength = 0;
 LwipIntf::CBType netifStatusChangeList[NETIF_STATUS_CB_SIZE];
 
-extern "C" void netif_status_changed(struct netif* netif)
+extern "C" void  netif_status_changed(struct netif* netif)
 {
     // override the default empty weak function
     for (int i = 0; i < netifStatusChangeListLength; i++)
@@ -34,9 +34,9 @@ bool LwipIntf::stateChangeSysCB(LwipIntf::CBType&& cb)
 bool LwipIntf::stateUpCB(LwipIntf::CBType&& cb)
 {
     return stateChangeSysCB([cb](netif* nif)
-        {
-            if (netif_is_up(nif))
-                schedule_function([cb, nif]()
-                    { cb(nif); });
-        });
+                            {
+                                if (netif_is_up(nif))
+                                    schedule_function([cb, nif]()
+                                                      { cb(nif); });
+                            });
 }
diff --git a/cores/esp8266/LwipIntfDev.h b/cores/esp8266/LwipIntfDev.h
index 4dccfa0cba..9931daa3c5 100644
--- a/cores/esp8266/LwipIntfDev.h
+++ b/cores/esp8266/LwipIntfDev.h
@@ -29,20 +29,20 @@ template <class RawDev>
 class LwipIntfDev : public LwipIntf, public RawDev
 {
 public:
-    LwipIntfDev(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1)
-        : RawDev(cs, spi, intr)
-        , _mtu(DEFAULT_MTU)
-        , _intrPin(intr)
-        , _started(false)
-        , _default(false)
+    LwipIntfDev(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1) :
+        RawDev(cs, spi, intr),
+        _mtu(DEFAULT_MTU),
+        _intrPin(intr),
+        _started(false),
+        _default(false)
     {
         memset(&_netif, 0, sizeof(_netif));
     }
 
-    boolean config(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3 = IPADDR_NONE, const IPAddress& dns2 = IPADDR_NONE);
+    boolean      config(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3 = IPADDR_NONE, const IPAddress& dns2 = IPADDR_NONE);
 
     // default mac-address is inferred from esp8266's STA interface
-    boolean begin(const uint8_t* macAddress = nullptr, const uint16_t mtu = DEFAULT_MTU);
+    boolean      begin(const uint8_t* macAddress = nullptr, const uint16_t mtu = DEFAULT_MTU);
 
     const netif* getNetIf() const
     {
@@ -75,25 +75,25 @@ class LwipIntfDev : public LwipIntf, public RawDev
     wl_status_t status();
 
 protected:
-    err_t netif_init();
-    void netif_status_callback();
+    err_t        netif_init();
+    void         netif_status_callback();
 
     static err_t netif_init_s(netif* netif);
     static err_t linkoutput_s(netif* netif, struct pbuf* p);
-    static void netif_status_callback_s(netif* netif);
+    static void  netif_status_callback_s(netif* netif);
 
     // called on a regular basis or on interrupt
-    err_t handlePackets();
+    err_t        handlePackets();
 
     // members
 
-    netif _netif;
+    netif        _netif;
 
-    uint16_t _mtu;
-    int8_t _intrPin;
-    uint8_t _macAddress[6];
-    bool _started;
-    bool _default;
+    uint16_t     _mtu;
+    int8_t       _intrPin;
+    uint8_t      _macAddress[6];
+    bool         _started;
+    bool         _default;
 };
 
 template <class RawDev>
@@ -218,11 +218,11 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
     }
 
     if (_intrPin < 0 && !schedule_recurrent_function_us([&]()
-            {
-                this->handlePackets();
-                return true;
-            },
-            100))
+                                                        {
+                                                            this->handlePackets();
+                                                            return true;
+                                                        },
+                                                        100))
     {
         netif_remove(&_netif);
         return false;
@@ -274,11 +274,11 @@ void LwipIntfDev<RawDev>::netif_status_callback_s(struct netif* netif)
 template <class RawDev>
 err_t LwipIntfDev<RawDev>::netif_init()
 {
-    _netif.name[0] = 'e';
-    _netif.name[1] = '0' + _netif.num;
-    _netif.mtu = _mtu;
+    _netif.name[0]      = 'e';
+    _netif.name[1]      = '0' + _netif.num;
+    _netif.mtu          = _mtu;
     _netif.chksum_flags = NETIF_CHECKSUM_ENABLE_ALL;
-    _netif.flags = NETIF_FLAG_ETHARP
+    _netif.flags        = NETIF_FLAG_ETHARP
         | NETIF_FLAG_IGMP
         | NETIF_FLAG_BROADCAST
         | NETIF_FLAG_LINK_UP;
@@ -286,11 +286,11 @@ err_t LwipIntfDev<RawDev>::netif_init()
     // lwIP's doc: This function typically first resolves the hardware
     // address, then sends the packet.  For ethernet physical layer, this is
     // usually lwIP's etharp_output()
-    _netif.output = etharp_output;
+    _netif.output          = etharp_output;
 
     // lwIP's doc: This function outputs the pbuf as-is on the link medium
     // (this must points to the raw ethernet driver, meaning: us)
-    _netif.linkoutput = linkoutput_s;
+    _netif.linkoutput      = linkoutput_s;
 
     _netif.status_callback = netif_status_callback_s;
 
diff --git a/cores/esp8266/StreamSend.cpp b/cores/esp8266/StreamSend.cpp
index 948e46e5fb..13f4e47cda 100644
--- a/cores/esp8266/StreamSend.cpp
+++ b/cores/esp8266/StreamSend.cpp
@@ -22,10 +22,10 @@
 #include <Arduino.h>
 #include <StreamDev.h>
 
-size_t Stream::sendGeneric(Print* to,
-    const ssize_t len,
-    const int readUntilChar,
-    const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
+size_t Stream::sendGeneric(Print*                                                to,
+                           const ssize_t                                         len,
+                           const int                                             readUntilChar,
+                           const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
 {
     setReport(Report::Success);
 
@@ -61,8 +61,8 @@ size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int rea
     // "neverExpires (default, impossible)" is translated to default timeout
     esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
-    const size_t maxLen = std::max((ssize_t)0, len);
-    size_t written = 0;
+    const size_t                          maxLen  = std::max((ssize_t)0, len);
+    size_t                                written = 0;
 
     while (!maxLen || written < maxLen)
     {
@@ -88,13 +88,13 @@ size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int rea
         if (w)
         {
             const char* directbuf = peekBuffer();
-            bool foundChar = false;
+            bool        foundChar = false;
             if (readUntilChar >= 0)
             {
                 const char* last = (const char*)memchr(directbuf, readUntilChar, w);
                 if (last)
                 {
-                    w = std::min((size_t)(last - directbuf), w);
+                    w         = std::min((size_t)(last - directbuf), w);
                     foundChar = true;
                 }
             }
@@ -151,8 +151,8 @@ size_t Stream::SendGenericRegularUntil(Print* to, const ssize_t len, const int r
     // "neverExpires (default, impossible)" is translated to default timeout
     esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
-    const size_t maxLen = std::max((ssize_t)0, len);
-    size_t written = 0;
+    const size_t                          maxLen  = std::max((ssize_t)0, len);
+    size_t                                written = 0;
 
     while (!maxLen || written < maxLen)
     {
@@ -227,8 +227,8 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
     // "neverExpires (default, impossible)" is translated to default timeout
     esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
-    const size_t maxLen = std::max((ssize_t)0, len);
-    size_t written = 0;
+    const size_t                          maxLen  = std::max((ssize_t)0, len);
+    size_t                                written = 0;
 
     while (!maxLen || written < maxLen)
     {
@@ -254,7 +254,7 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
         w = std::min(w, (decltype(w))temporaryStackBufferSize);
         if (w)
         {
-            char temp[w];
+            char    temp[w];
             ssize_t r = read(temp, w);
             if (r < 0)
             {
diff --git a/cores/esp8266/StreamString.h b/cores/esp8266/StreamString.h
index 7bda5dde68..a16f8ce6a4 100644
--- a/cores/esp8266/StreamString.h
+++ b/cores/esp8266/StreamString.h
@@ -35,15 +35,13 @@
 class S2Stream : public Stream
 {
 public:
-    S2Stream(String& string, int peekPointer = -1)
-        : string(&string)
-        , peekPointer(peekPointer)
+    S2Stream(String& string, int peekPointer = -1) :
+        string(&string), peekPointer(peekPointer)
     {
     }
 
-    S2Stream(String* string, int peekPointer = -1)
-        : string(string)
-        , peekPointer(peekPointer)
+    S2Stream(String* string, int peekPointer = -1) :
+        string(string), peekPointer(peekPointer)
     {
     }
 
@@ -209,7 +207,7 @@ class S2Stream : public Stream
 
 protected:
     String* string;
-    int peekPointer;  // -1:String is consumed / >=0:resettable pointer
+    int     peekPointer;  // -1:String is consumed / >=0:resettable pointer
 };
 
 // StreamString is a S2Stream holding the String
@@ -226,80 +224,38 @@ class StreamString : public String, public S2Stream
     }
 
 public:
-    StreamString(StreamString&& bro)
-        : String(bro)
-        , S2Stream(this)
-    {
-    }
-    StreamString(const StreamString& bro)
-        : String(bro)
-        , S2Stream(this)
-    {
-    }
+    StreamString(StreamString&& bro) :
+        String(bro), S2Stream(this) { }
+    StreamString(const StreamString& bro) :
+        String(bro), S2Stream(this) { }
 
     // duplicate String constructors and operator=:
 
-    StreamString(const char* text = nullptr)
-        : String(text)
-        , S2Stream(this)
-    {
-    }
-    StreamString(const String& string)
-        : String(string)
-        , S2Stream(this)
-    {
-    }
-    StreamString(const __FlashStringHelper* str)
-        : String(str)
-        , S2Stream(this)
-    {
-    }
-    StreamString(String&& string)
-        : String(string)
-        , S2Stream(this)
-    {
-    }
-
-    explicit StreamString(char c)
-        : String(c)
-        , S2Stream(this)
-    {
-    }
-    explicit StreamString(unsigned char c, unsigned char base = 10)
-        : String(c, base)
-        , S2Stream(this)
-    {
-    }
-    explicit StreamString(int i, unsigned char base = 10)
-        : String(i, base)
-        , S2Stream(this)
-    {
-    }
-    explicit StreamString(unsigned int i, unsigned char base = 10)
-        : String(i, base)
-        , S2Stream(this)
-    {
-    }
-    explicit StreamString(long l, unsigned char base = 10)
-        : String(l, base)
-        , S2Stream(this)
-    {
-    }
-    explicit StreamString(unsigned long l, unsigned char base = 10)
-        : String(l, base)
-        , S2Stream(this)
-    {
-    }
-    explicit StreamString(float f, unsigned char decimalPlaces = 2)
-        : String(f, decimalPlaces)
-        , S2Stream(this)
-    {
-    }
-    explicit StreamString(double d, unsigned char decimalPlaces = 2)
-        : String(d, decimalPlaces)
-        , S2Stream(this)
-    {
-    }
+    StreamString(const char* text = nullptr) :
+        String(text), S2Stream(this) { }
+    StreamString(const String& string) :
+        String(string), S2Stream(this) { }
+    StreamString(const __FlashStringHelper* str) :
+        String(str), S2Stream(this) { }
+    StreamString(String&& string) :
+        String(string), S2Stream(this) { }
+
+    explicit StreamString(char c) :
+        String(c), S2Stream(this) { }
+    explicit StreamString(unsigned char c, unsigned char base = 10) :
+        String(c, base), S2Stream(this) { }
+    explicit StreamString(int i, unsigned char base = 10) :
+        String(i, base), S2Stream(this) { }
+    explicit StreamString(unsigned int i, unsigned char base = 10) :
+        String(i, base), S2Stream(this) { }
+    explicit StreamString(long l, unsigned char base = 10) :
+        String(l, base), S2Stream(this) { }
+    explicit StreamString(unsigned long l, unsigned char base = 10) :
+        String(l, base), S2Stream(this) { }
+    explicit StreamString(float f, unsigned char decimalPlaces = 2) :
+        String(f, decimalPlaces), S2Stream(this) { }
+    explicit StreamString(double d, unsigned char decimalPlaces = 2) :
+        String(d, decimalPlaces), S2Stream(this) { }
 
     StreamString& operator=(const StreamString& rhs)
     {
diff --git a/cores/esp8266/core_esp8266_si2c.cpp b/cores/esp8266/core_esp8266_si2c.cpp
index e56b8b5fba..7f26656564 100644
--- a/cores/esp8266/core_esp8266_si2c.cpp
+++ b/cores/esp8266/core_esp8266_si2c.cpp
@@ -60,61 +60,61 @@ static inline __attribute__((always_inline)) bool SCL_READ(const int twi_scl)
 class Twi
 {
 private:
-    unsigned int preferred_si2c_clock = 100000;
-    uint32_t twi_dcount = 18;
-    unsigned char twi_sda = 0;
-    unsigned char twi_scl = 0;
-    unsigned char twi_addr = 0;
-    uint32_t twi_clockStretchLimit = 0;
+    unsigned int  preferred_si2c_clock  = 100000;
+    uint32_t      twi_dcount            = 18;
+    unsigned char twi_sda               = 0;
+    unsigned char twi_scl               = 0;
+    unsigned char twi_addr              = 0;
+    uint32_t      twi_clockStretchLimit = 0;
 
     // These are int-wide, even though they could all fit in a byte, to reduce code size and avoid any potential
     // issues about RmW on packed bytes.  The int-wide variations of asm instructions are smaller than the equivalent
     // byte-wide ones, and since these emums are used everywhere, the difference adds up fast.  There is only a single
     // instance of the class, though, so the extra 12 bytes of RAM used here saves a lot more IRAM.
     volatile enum { TWIPM_UNKNOWN = 0,
-        TWIPM_IDLE,
-        TWIPM_ADDRESSED,
-        TWIPM_WAIT } twip_mode
+                    TWIPM_IDLE,
+                    TWIPM_ADDRESSED,
+                    TWIPM_WAIT } twip_mode
         = TWIPM_IDLE;
     volatile enum { TWIP_UNKNOWN = 0,
-        TWIP_IDLE,
-        TWIP_START,
-        TWIP_SEND_ACK,
-        TWIP_WAIT_ACK,
-        TWIP_WAIT_STOP,
-        TWIP_SLA_W,
-        TWIP_SLA_R,
-        TWIP_REP_START,
-        TWIP_READ,
-        TWIP_STOP,
-        TWIP_REC_ACK,
-        TWIP_READ_ACK,
-        TWIP_RWAIT_ACK,
-        TWIP_WRITE,
-        TWIP_BUS_ERR } twip_state
+                    TWIP_IDLE,
+                    TWIP_START,
+                    TWIP_SEND_ACK,
+                    TWIP_WAIT_ACK,
+                    TWIP_WAIT_STOP,
+                    TWIP_SLA_W,
+                    TWIP_SLA_R,
+                    TWIP_REP_START,
+                    TWIP_READ,
+                    TWIP_STOP,
+                    TWIP_REC_ACK,
+                    TWIP_READ_ACK,
+                    TWIP_RWAIT_ACK,
+                    TWIP_WRITE,
+                    TWIP_BUS_ERR } twip_state
         = TWIP_IDLE;
-    volatile int twip_status = TW_NO_INFO;
-    volatile int bitCount = 0;
+    volatile int     twip_status    = TW_NO_INFO;
+    volatile int     bitCount       = 0;
 
-    volatile uint8_t twi_data = 0x00;
-    volatile int twi_ack = 0;
-    volatile int twi_ack_rec = 0;
-    volatile int twi_timeout_ms = 10;
+    volatile uint8_t twi_data       = 0x00;
+    volatile int     twi_ack        = 0;
+    volatile int     twi_ack_rec    = 0;
+    volatile int     twi_timeout_ms = 10;
 
     volatile enum { TWI_READY = 0,
-        TWI_MRX,
-        TWI_MTX,
-        TWI_SRX,
-        TWI_STX } twi_state
+                    TWI_MRX,
+                    TWI_MTX,
+                    TWI_SRX,
+                    TWI_STX } twi_state
         = TWI_READY;
     volatile uint8_t twi_error = 0xFF;
 
-    uint8_t twi_txBuffer[TWI_BUFFER_LENGTH];
-    volatile int twi_txBufferIndex = 0;
-    volatile int twi_txBufferLength = 0;
+    uint8_t          twi_txBuffer[TWI_BUFFER_LENGTH];
+    volatile int     twi_txBufferIndex  = 0;
+    volatile int     twi_txBufferLength = 0;
 
-    uint8_t twi_rxBuffer[TWI_BUFFER_LENGTH];
-    volatile int twi_rxBufferIndex = 0;
+    uint8_t          twi_rxBuffer[TWI_BUFFER_LENGTH];
+    volatile int     twi_rxBufferIndex = 0;
 
     void (*twi_onSlaveTransmit)(void);
     void (*twi_onSlaveReceive)(uint8_t*, size_t);
@@ -128,35 +128,35 @@ class Twi
     enum
     {
         TWI_SIG_RANGE = 0x00000100,
-        TWI_SIG_RX = 0x00000101,
-        TWI_SIG_TX = 0x00000102
+        TWI_SIG_RX    = 0x00000101,
+        TWI_SIG_TX    = 0x00000102
     };
-    ETSEvent eventTaskQueue[EVENTTASK_QUEUE_SIZE];
-    ETSTimer timer;
+    ETSEvent              eventTaskQueue[EVENTTASK_QUEUE_SIZE];
+    ETSTimer              timer;
 
     // Event/IRQ callbacks, so they can't use "this" and need to be static
     static void IRAM_ATTR onSclChange(void);
     static void IRAM_ATTR onSdaChange(void);
-    static void eventTask(ETSEvent* e);
+    static void           eventTask(ETSEvent* e);
     static void IRAM_ATTR onTimer(void* unused);
 
     // Allow not linking in the slave code if there is no call to setAddress
-    bool _slaveEnabled = false;
+    bool                  _slaveEnabled = false;
 
     // Internal use functions
-    void IRAM_ATTR busywait(unsigned int v);
-    bool write_start(void);
-    bool write_stop(void);
-    bool write_bit(bool bit);
-    bool read_bit(void);
-    bool write_byte(unsigned char byte);
-    unsigned char read_byte(bool nack);
-    void IRAM_ATTR onTwipEvent(uint8_t status);
+    void IRAM_ATTR        busywait(unsigned int v);
+    bool                  write_start(void);
+    bool                  write_stop(void);
+    bool                  write_bit(bool bit);
+    bool                  read_bit(void);
+    bool                  write_byte(unsigned char byte);
+    unsigned char         read_byte(bool nack);
+    void IRAM_ATTR        onTwipEvent(uint8_t status);
 
     // Handle the case where a slave needs to stretch the clock with a time-limited busy wait
-    inline void WAIT_CLOCK_STRETCH()
+    inline void           WAIT_CLOCK_STRETCH()
     {
-        esp8266::polledTimeout::oneShotFastUs timeout(twi_clockStretchLimit);
+        esp8266::polledTimeout::oneShotFastUs  timeout(twi_clockStretchLimit);
         esp8266::polledTimeout::periodicFastUs yieldTimeout(5000);
         while (!timeout && !SCL_READ(twi_scl))  // outer loop is stretch duration up to stretch limit
         {
@@ -171,19 +171,19 @@ class Twi
     void twi_scl_valley(void);
 
 public:
-    void setClock(unsigned int freq);
-    void setClockStretchLimit(uint32_t limit);
-    void init(unsigned char sda, unsigned char scl);
-    void setAddress(uint8_t address);
-    unsigned char writeTo(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop);
-    unsigned char readFrom(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop);
-    uint8_t status();
-    uint8_t transmit(const uint8_t* data, uint8_t length);
-    void attachSlaveRxEvent(void (*function)(uint8_t*, size_t));
-    void attachSlaveTxEvent(void (*function)(void));
+    void           setClock(unsigned int freq);
+    void           setClockStretchLimit(uint32_t limit);
+    void           init(unsigned char sda, unsigned char scl);
+    void           setAddress(uint8_t address);
+    unsigned char  writeTo(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop);
+    unsigned char  readFrom(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop);
+    uint8_t        status();
+    uint8_t        transmit(const uint8_t* data, uint8_t length);
+    void           attachSlaveRxEvent(void (*function)(uint8_t*, size_t));
+    void           attachSlaveTxEvent(void (*function)(void));
     void IRAM_ATTR reply(uint8_t ack);
     void IRAM_ATTR releaseBus(void);
-    void enableSlave();
+    void           enableSlave();
 };
 
 static Twi twi;
@@ -549,7 +549,7 @@ void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
     case TW_SR_ARB_LOST_SLA_ACK:    // lost arbitration, returned ack
     case TW_SR_ARB_LOST_GCALL_ACK:  // lost arbitration, returned ack
         // enter slave receiver mode
-        twi_state = TWI_SRX;
+        twi_state         = TWI_SRX;
         // indicate that rx buffer can be overwritten and ack
         twi_rxBufferIndex = 0;
         reply(1);
@@ -593,9 +593,9 @@ void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
     case TW_ST_SLA_ACK:           // addressed, returned ack
     case TW_ST_ARB_LOST_SLA_ACK:  // arbitration lost, returned ack
         // enter slave transmitter mode
-        twi_state = TWI_STX;
+        twi_state          = TWI_STX;
         // ready the tx buffer index for iteration
-        twi_txBufferIndex = 0;
+        twi_txBufferIndex  = 0;
         // set tx buffer length to be zero, to verify if user changes it
         twi_txBufferLength = 0;
         // callback to user-defined callback over event task to allow for non-RAM-residing code
@@ -650,7 +650,7 @@ void IRAM_ATTR Twi::onTimer(void* unused)
     (void)unused;
     twi.releaseBus();
     twi.onTwipEvent(TW_BUS_ERROR);
-    twi.twip_mode = TWIPM_WAIT;
+    twi.twip_mode  = TWIPM_WAIT;
     twi.twip_state = TWIP_BUS_ERR;
 }
 
@@ -670,7 +670,7 @@ void Twi::eventTask(ETSEvent* e)
         if (twi.twi_txBufferLength == 0)
         {
             twi.twi_txBufferLength = 1;
-            twi.twi_txBuffer[0] = 0x00;
+            twi.twi_txBuffer[0]    = 0x00;
         }
 
         // Initiate transmission
@@ -701,10 +701,10 @@ void IRAM_ATTR Twi::onSclChange(void)
 
     // Store bool return in int to reduce final code size.
 
-    sda = SDA_READ(twi.twi_sda);
-    scl = SCL_READ(twi.twi_scl);
+    sda                 = SDA_READ(twi.twi_sda);
+    scl                 = SCL_READ(twi.twi_scl);
 
-    twi.twip_status = 0xF8;  // reset TWI status
+    twi.twip_status     = 0xF8;  // reset TWI status
 
     int twip_state_mask = S2M(twi.twip_state);
     IFSTATE(S2M(TWIP_START) | S2M(TWIP_REP_START) | S2M(TWIP_SLA_W) | S2M(TWIP_READ))
@@ -785,7 +785,7 @@ void IRAM_ATTR Twi::onSclChange(void)
                     if (!(twi.twi_data & 0x01))
                     {
                         twi.onTwipEvent(TW_SR_SLA_ACK);
-                        twi.bitCount = 8;
+                        twi.bitCount   = 8;
                         twi.twip_state = TWIP_SLA_W;
                     }
                     else
@@ -802,13 +802,13 @@ void IRAM_ATTR Twi::onSclChange(void)
                 if (!twi.twi_ack)
                 {
                     twi.onTwipEvent(TW_SR_DATA_NACK);
-                    twi.twip_mode = TWIPM_WAIT;
+                    twi.twip_mode  = TWIPM_WAIT;
                     twi.twip_state = TWIP_WAIT_STOP;
                 }
                 else
                 {
                     twi.onTwipEvent(TW_SR_DATA_ACK);
-                    twi.bitCount = 8;
+                    twi.bitCount   = 8;
                     twi.twip_state = TWIP_READ;
                 }
             }
@@ -864,7 +864,7 @@ void IRAM_ATTR Twi::onSclChange(void)
         else
         {
             twi.twi_ack_rec = !sda;
-            twi.twip_state = TWIP_RWAIT_ACK;
+            twi.twip_state  = TWIP_RWAIT_ACK;
         }
     }
     else IFSTATE(S2M(TWIP_RWAIT_ACK))
@@ -885,7 +885,7 @@ void IRAM_ATTR Twi::onSclChange(void)
             {
                 // we have no more data to send and/or the master doesn't want anymore
                 twi.onTwipEvent(twi.twi_ack_rec ? TW_ST_LAST_DATA : TW_ST_DATA_NACK);
-                twi.twip_mode = TWIPM_WAIT;
+                twi.twip_mode  = TWIPM_WAIT;
                 twi.twip_state = TWIP_WAIT_STOP;
             }
         }
@@ -898,8 +898,8 @@ void IRAM_ATTR Twi::onSdaChange(void)
     unsigned int scl;
 
     // Store bool return in int to reduce final code size.
-    sda = SDA_READ(twi.twi_sda);
-    scl = SCL_READ(twi.twi_scl);
+    sda                 = SDA_READ(twi.twi_sda);
+    scl                 = SCL_READ(twi.twi_scl);
 
     int twip_state_mask = S2M(twi.twip_state);
     if (scl) /* !DATA */
@@ -913,7 +913,7 @@ void IRAM_ATTR Twi::onSdaChange(void)
             else
             {
                 // START
-                twi.bitCount = 8;
+                twi.bitCount   = 8;
                 twi.twip_state = TWIP_START;
                 ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true);  // Once, ms
             }
@@ -923,7 +923,7 @@ void IRAM_ATTR Twi::onSdaChange(void)
             // START or STOP
             SDA_HIGH(twi.twi_sda);  // Should not be necessary
             twi.onTwipEvent(TW_BUS_ERROR);
-            twi.twip_mode = TWIPM_WAIT;
+            twi.twip_mode  = TWIPM_WAIT;
             twi.twip_state = TWIP_BUS_ERR;
         }
         else IFSTATE(S2M(TWIP_WAIT_STOP) | S2M(TWIP_BUS_ERR))
@@ -934,7 +934,7 @@ void IRAM_ATTR Twi::onSdaChange(void)
                 SCL_LOW(twi.twi_scl);  // generates a low SCL pulse after STOP
                 ets_timer_disarm(&twi.timer);
                 twi.twip_state = TWIP_IDLE;
-                twi.twip_mode = TWIPM_IDLE;
+                twi.twip_mode  = TWIPM_IDLE;
                 SCL_HIGH(twi.twi_scl);
             }
             else
@@ -946,7 +946,7 @@ void IRAM_ATTR Twi::onSdaChange(void)
                 }
                 else
                 {
-                    twi.bitCount = 8;
+                    twi.bitCount   = 8;
                     twi.twip_state = TWIP_REP_START;
                     ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true);  // Once, ms
                 }
@@ -959,7 +959,7 @@ void IRAM_ATTR Twi::onSdaChange(void)
             {
                 // inside byte transfer - error
                 twi.onTwipEvent(TW_BUS_ERROR);
-                twi.twip_mode = TWIPM_WAIT;
+                twi.twip_mode  = TWIPM_WAIT;
                 twi.twip_state = TWIP_BUS_ERR;
             }
             else
@@ -972,7 +972,7 @@ void IRAM_ATTR Twi::onSdaChange(void)
                     // STOP
                     ets_timer_disarm(&twi.timer);
                     twi.twip_state = TWIP_IDLE;
-                    twi.twip_mode = TWIPM_IDLE;
+                    twi.twip_mode  = TWIPM_IDLE;
                 }
                 else
                 {
@@ -980,7 +980,7 @@ void IRAM_ATTR Twi::onSdaChange(void)
                     twi.bitCount = 8;
                     ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true);  // Once, ms
                     twi.twip_state = TWIP_REP_START;
-                    twi.twip_mode = TWIPM_IDLE;
+                    twi.twip_mode  = TWIPM_IDLE;
                 }
             }
         }
diff --git a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
index 95c1c4efac..1c7effc626 100644
--- a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
+++ b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
@@ -8,15 +8,17 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
-void setup() {
+void        setup()
+{
   Serial.begin(115200);
   Serial.println("Booting");
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
-  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
+  while (WiFi.waitForConnectResult() != WL_CONNECTED)
+  {
     Serial.println("Connection Failed! Rebooting...");
     delay(5000);
     ESP.restart();
@@ -35,43 +37,56 @@ void setup() {
   // MD5(admin) = 21232f297a57a5a743894a0e4a801fc3
   // ArduinoOTA.setPasswordHash("21232f297a57a5a743894a0e4a801fc3");
 
-  ArduinoOTA.onStart([]() {
-    String type;
-    if (ArduinoOTA.getCommand() == U_FLASH) {
-      type = "sketch";
-    } else { // U_FS
-      type = "filesystem";
-    }
+  ArduinoOTA.onStart([]()
+                     {
+                       String type;
+                       if (ArduinoOTA.getCommand() == U_FLASH)
+                       {
+                         type = "sketch";
+                       }
+                       else
+                       {  // U_FS
+                         type = "filesystem";
+                       }
 
-    // NOTE: if updating FS this would be the place to unmount FS using FS.end()
-    Serial.println("Start updating " + type);
-  });
-  ArduinoOTA.onEnd([]() {
-    Serial.println("\nEnd");
-  });
-  ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
-    Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
-  });
-  ArduinoOTA.onError([](ota_error_t error) {
-    Serial.printf("Error[%u]: ", error);
-    if (error == OTA_AUTH_ERROR) {
-      Serial.println("Auth Failed");
-    } else if (error == OTA_BEGIN_ERROR) {
-      Serial.println("Begin Failed");
-    } else if (error == OTA_CONNECT_ERROR) {
-      Serial.println("Connect Failed");
-    } else if (error == OTA_RECEIVE_ERROR) {
-      Serial.println("Receive Failed");
-    } else if (error == OTA_END_ERROR) {
-      Serial.println("End Failed");
-    }
-  });
+                       // NOTE: if updating FS this would be the place to unmount FS using FS.end()
+                       Serial.println("Start updating " + type);
+                     });
+  ArduinoOTA.onEnd([]()
+                   { Serial.println("\nEnd"); });
+  ArduinoOTA.onProgress([](unsigned int progress, unsigned int total)
+                        { Serial.printf("Progress: %u%%\r", (progress / (total / 100))); });
+  ArduinoOTA.onError([](ota_error_t error)
+                     {
+                       Serial.printf("Error[%u]: ", error);
+                       if (error == OTA_AUTH_ERROR)
+                       {
+                         Serial.println("Auth Failed");
+                       }
+                       else if (error == OTA_BEGIN_ERROR)
+                       {
+                         Serial.println("Begin Failed");
+                       }
+                       else if (error == OTA_CONNECT_ERROR)
+                       {
+                         Serial.println("Connect Failed");
+                       }
+                       else if (error == OTA_RECEIVE_ERROR)
+                       {
+                         Serial.println("Receive Failed");
+                       }
+                       else if (error == OTA_END_ERROR)
+                       {
+                         Serial.println("End Failed");
+                       }
+                     });
   ArduinoOTA.begin();
   Serial.println("Ready");
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 }
 
-void loop() {
+void loop()
+{
   ArduinoOTA.handle();
 }
diff --git a/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino b/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
index 7c72b122e4..347a7a8925 100644
--- a/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
+++ b/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
@@ -8,15 +8,16 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
-const char* host = "OTA-LEDS";
+const char* host     = "OTA-LEDS";
 
-int led_pin = 13;
+int         led_pin  = 13;
 #define N_DIMMERS 3
-int dimmer_pin[] = { 14, 5, 15 };
+int  dimmer_pin[] = { 14, 5, 15 };
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
 
   /* switch on led */
@@ -28,7 +29,8 @@ void setup() {
 
   WiFi.begin(ssid, password);
 
-  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
+  while (WiFi.waitForConnectResult() != WL_CONNECTED)
+  {
     WiFi.begin(ssid, password);
     Serial.println("Retrying connection...");
   }
@@ -39,36 +41,41 @@ void setup() {
   analogWriteRange(1000);
   analogWrite(led_pin, 990);
 
-  for (int i = 0; i < N_DIMMERS; i++) {
+  for (int i = 0; i < N_DIMMERS; i++)
+  {
     pinMode(dimmer_pin[i], OUTPUT);
     analogWrite(dimmer_pin[i], 50);
   }
 
   ArduinoOTA.setHostname(host);
-  ArduinoOTA.onStart([]() { // switch off all the PWMs during upgrade
-    for (int i = 0; i < N_DIMMERS; i++) {
+  ArduinoOTA.onStart([]() {  // switch off all the PWMs during upgrade
+    for (int i = 0; i < N_DIMMERS; i++)
+    {
       analogWrite(dimmer_pin[i], 0);
     }
     analogWrite(led_pin, 0);
   });
 
-  ArduinoOTA.onEnd([]() { // do a fancy thing with our board led at end
-    for (int i = 0; i < 30; i++) {
+  ArduinoOTA.onEnd([]() {  // do a fancy thing with our board led at end
+    for (int i = 0; i < 30; i++)
+    {
       analogWrite(led_pin, (i * 100) % 1001);
       delay(50);
     }
   });
 
-  ArduinoOTA.onError([](ota_error_t error) {
-    (void)error;
-    ESP.restart();
-  });
+  ArduinoOTA.onError([](ota_error_t error)
+                     {
+                       (void)error;
+                       ESP.restart();
+                     });
 
   /* setup the OTA server */
   ArduinoOTA.begin();
   Serial.println("Ready");
 }
 
-void loop() {
+void loop()
+{
   ArduinoOTA.handle();
 }
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
index 27bfab06ce..44328a8fb1 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
@@ -23,37 +23,38 @@
 #define APPSK "12345678"
 #endif
 
-const char* softAP_ssid = APSSID;
-const char* softAP_password = APPSK;
+const char*      softAP_ssid     = APSSID;
+const char*      softAP_password = APPSK;
 
 /* hostname for mDNS. Should work at least on windows. Try http://esp8266.local */
-const char* myHostname = "esp8266";
+const char*      myHostname      = "esp8266";
 
 /* Don't set this wifi credentials. They are configurated at runtime and stored on EEPROM */
-char ssid[33] = "";
-char password[65] = "";
+char             ssid[33]        = "";
+char             password[65]    = "";
 
 // DNS server
-const byte DNS_PORT = 53;
-DNSServer dnsServer;
+const byte       DNS_PORT        = 53;
+DNSServer        dnsServer;
 
 // Web server
 ESP8266WebServer server(80);
 
 /* Soft AP network parameters */
-IPAddress apIP(172, 217, 28, 1);
-IPAddress netMsk(255, 255, 255, 0);
+IPAddress        apIP(172, 217, 28, 1);
+IPAddress        netMsk(255, 255, 255, 0);
 
 /** Should I connect to WLAN asap? */
-boolean connect;
+boolean          connect;
 
 /** Last time I tried to connect to WLAN */
-unsigned long lastConnectTry = 0;
+unsigned long    lastConnectTry = 0;
 
 /** Current WLAN status */
-unsigned int status = WL_IDLE_STATUS;
+unsigned int     status         = WL_IDLE_STATUS;
 
-void setup() {
+void             setup()
+{
   delay(1000);
   Serial.begin(115200);
   Serial.println();
@@ -61,7 +62,7 @@ void setup() {
   /* You can remove the password parameter if you want the AP to be open. */
   WiFi.softAPConfig(apIP, apIP, netMsk);
   WiFi.softAP(softAP_ssid, softAP_password);
-  delay(500); // Without delay I've seen the IP address blank
+  delay(500);  // Without delay I've seen the IP address blank
   Serial.print("AP IP address: ");
   Serial.println(WiFi.softAPIP());
 
@@ -73,16 +74,17 @@ void setup() {
   server.on("/", handleRoot);
   server.on("/wifi", handleWifi);
   server.on("/wifisave", handleWifiSave);
-  server.on("/generate_204", handleRoot); //Android captive portal. Maybe not needed. Might be handled by notFound handler.
-  server.on("/fwlink", handleRoot); //Microsoft captive portal. Maybe not needed. Might be handled by notFound handler.
+  server.on("/generate_204", handleRoot);  //Android captive portal. Maybe not needed. Might be handled by notFound handler.
+  server.on("/fwlink", handleRoot);        //Microsoft captive portal. Maybe not needed. Might be handled by notFound handler.
   server.onNotFound(handleNotFound);
-  server.begin(); // Web server start
+  server.begin();  // Web server start
   Serial.println("HTTP server started");
-  loadCredentials(); // Load WLAN credentials from network
-  connect = strlen(ssid) > 0; // Request WLAN connect if there is a SSID
+  loadCredentials();           // Load WLAN credentials from network
+  connect = strlen(ssid) > 0;  // Request WLAN connect if there is a SSID
 }
 
-void connectWifi() {
+void connectWifi()
+{
   Serial.println("Connecting as wifi client...");
   WiFi.disconnect();
   WiFi.begin(ssid, password);
@@ -91,8 +93,10 @@ void connectWifi() {
   Serial.println(connRes);
 }
 
-void loop() {
-  if (connect) {
+void loop()
+{
+  if (connect)
+  {
     Serial.println("Connect requested");
     connect = false;
     connectWifi();
@@ -100,16 +104,19 @@ void loop() {
   }
   {
     unsigned int s = WiFi.status();
-    if (s == 0 && millis() > (lastConnectTry + 60000)) {
+    if (s == 0 && millis() > (lastConnectTry + 60000))
+    {
       /* If WLAN disconnected and idle try to connect */
       /* Don't set retry time too low as retry interfere the softAP operation */
       connect = true;
     }
-    if (status != s) { // WLAN status change
+    if (status != s)
+    {  // WLAN status change
       Serial.print("Status: ");
       Serial.println(s);
       status = s;
-      if (s == WL_CONNECTED) {
+      if (s == WL_CONNECTED)
+      {
         /* Just connected to WLAN */
         Serial.println("");
         Serial.print("Connected to ");
@@ -118,18 +125,24 @@ void loop() {
         Serial.println(WiFi.localIP());
 
         // Setup MDNS responder
-        if (!MDNS.begin(myHostname)) {
+        if (!MDNS.begin(myHostname))
+        {
           Serial.println("Error setting up MDNS responder!");
-        } else {
+        }
+        else
+        {
           Serial.println("mDNS responder started");
           // Add service to MDNS-SD
           MDNS.addService("http", "tcp", 80);
         }
-      } else if (s == WL_NO_SSID_AVAIL) {
+      }
+      else if (s == WL_NO_SSID_AVAIL)
+      {
         WiFi.disconnect();
       }
     }
-    if (s == WL_CONNECTED) {
+    if (s == WL_CONNECTED)
+    {
       MDNS.update();
     }
   }
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
index 276aad2a2d..a333748e60 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
@@ -1,6 +1,8 @@
 /** Handle root or redirect to captive portal */
-void handleRoot() {
-  if (captivePortal()) { // If caprive portal redirect instead of displaying the page.
+void handleRoot()
+{
+  if (captivePortal())
+  {  // If caprive portal redirect instead of displaying the page.
     return;
   }
   server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
@@ -13,9 +15,12 @@ void handleRoot() {
       "<meta name='viewport' content='width=device-width'>"
       "<title>CaptivePortal</title></head><body>"
       "<h1>HELLO WORLD!!</h1>");
-  if (server.client().localIP() == apIP) {
+  if (server.client().localIP() == apIP)
+  {
     Page += String(F("<p>You are connected through the soft AP: ")) + softAP_ssid + F("</p>");
-  } else {
+  }
+  else
+  {
     Page += String(F("<p>You are connected through the wifi network: ")) + ssid + F("</p>");
   }
   Page += F(
@@ -26,19 +31,22 @@ void handleRoot() {
 }
 
 /** Redirect to captive portal if we got a request for another domain. Return true in that case so the page handler do not try to handle the request again. */
-boolean captivePortal() {
-  if (!isIp(server.hostHeader()) && server.hostHeader() != (String(myHostname) + ".local")) {
+boolean captivePortal()
+{
+  if (!isIp(server.hostHeader()) && server.hostHeader() != (String(myHostname) + ".local"))
+  {
     Serial.println("Request redirected to captive portal");
     server.sendHeader("Location", String("http://") + toStringIp(server.client().localIP()), true);
-    server.send(302, "text/plain", ""); // Empty content inhibits Content-length header so we have to close the socket ourselves.
-    server.client().stop(); // Stop is needed because we sent no content length
+    server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to close the socket ourselves.
+    server.client().stop();              // Stop is needed because we sent no content length
     return true;
   }
   return false;
 }
 
 /** Wifi config page handler */
-void handleWifi() {
+void handleWifi()
+{
   server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
   server.sendHeader("Pragma", "no-cache");
   server.sendHeader("Expires", "-1");
@@ -49,9 +57,12 @@ void handleWifi() {
       "<meta name='viewport' content='width=device-width'>"
       "<title>CaptivePortal</title></head><body>"
       "<h1>Wifi config</h1>");
-  if (server.client().localIP() == apIP) {
+  if (server.client().localIP() == apIP)
+  {
     Page += String(F("<p>You are connected through the soft AP: ")) + softAP_ssid + F("</p>");
-  } else {
+  }
+  else
+  {
     Page += String(F("<p>You are connected through the wifi network: ")) + ssid + F("</p>");
   }
   Page += String(F(
@@ -74,11 +85,15 @@ void handleWifi() {
   Serial.println("scan start");
   int n = WiFi.scanNetworks();
   Serial.println("scan done");
-  if (n > 0) {
-    for (int i = 0; i < n; i++) {
+  if (n > 0)
+  {
+    for (int i = 0; i < n; i++)
+    {
       Page += String(F("\r\n<tr><td>SSID ")) + WiFi.SSID(i) + ((WiFi.encryptionType(i) == ENC_TYPE_NONE) ? F(" ") : F(" *")) + F(" (") + WiFi.RSSI(i) + F(")</td></tr>");
     }
-  } else {
+  }
+  else
+  {
     Page += F("<tr><td>No WLAN found</td></tr>");
   }
   Page += F(
@@ -90,11 +105,12 @@ void handleWifi() {
       "<p>You may want to <a href='/'>return to the home page</a>.</p>"
       "</body></html>");
   server.send(200, "text/html", Page);
-  server.client().stop(); // Stop is needed because we sent no content length
+  server.client().stop();  // Stop is needed because we sent no content length
 }
 
 /** Handle the WLAN save form and redirect to WLAN config page again */
-void handleWifiSave() {
+void handleWifiSave()
+{
   Serial.println("wifi save");
   server.arg("n").toCharArray(ssid, sizeof(ssid) - 1);
   server.arg("p").toCharArray(password, sizeof(password) - 1);
@@ -102,14 +118,16 @@ void handleWifiSave() {
   server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
   server.sendHeader("Pragma", "no-cache");
   server.sendHeader("Expires", "-1");
-  server.send(302, "text/plain", ""); // Empty content inhibits Content-length header so we have to close the socket ourselves.
-  server.client().stop(); // Stop is needed because we sent no content length
+  server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to close the socket ourselves.
+  server.client().stop();              // Stop is needed because we sent no content length
   saveCredentials();
-  connect = strlen(ssid) > 0; // Request WLAN connect with new credentials if there is a SSID
+  connect = strlen(ssid) > 0;  // Request WLAN connect with new credentials if there is a SSID
 }
 
-void handleNotFound() {
-  if (captivePortal()) { // If caprive portal redirect instead of displaying the error page.
+void handleNotFound()
+{
+  if (captivePortal())
+  {  // If caprive portal redirect instead of displaying the error page.
     return;
   }
   String message = F("File Not Found\n\n");
@@ -121,7 +139,8 @@ void handleNotFound() {
   message += server.args();
   message += F("\n");
 
-  for (uint8_t i = 0; i < server.args(); i++) {
+  for (uint8_t i = 0; i < server.args(); i++)
+  {
     message += String(F(" ")) + server.argName(i) + F(": ") + server.arg(i) + F("\n");
   }
   server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/tools.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/tools.ino
index 6ed7b05b7d..e8fb014d35 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/tools.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/tools.ino
@@ -1,8 +1,11 @@
 /** Is this an IP? */
-boolean isIp(String str) {
-  for (size_t i = 0; i < str.length(); i++) {
+boolean isIp(String str)
+{
+  for (size_t i = 0; i < str.length(); i++)
+  {
     int c = str.charAt(i);
-    if (c != '.' && (c < '0' || c > '9')) {
+    if (c != '.' && (c < '0' || c > '9'))
+    {
       return false;
     }
   }
@@ -10,9 +13,11 @@ boolean isIp(String str) {
 }
 
 /** IP to String? */
-String toStringIp(IPAddress ip) {
+String toStringIp(IPAddress ip)
+{
   String res = "";
-  for (int i = 0; i < 3; i++) {
+  for (int i = 0; i < 3; i++)
+  {
     res += String((ip >> (8 * i)) & 0xFF) + ".";
   }
   res += String(((ip >> 8 * 3)) & 0xFF);
diff --git a/libraries/ESP8266AVRISP/examples/Arduino_Wifi_AVRISP/Arduino_Wifi_AVRISP.ino b/libraries/ESP8266AVRISP/examples/Arduino_Wifi_AVRISP/Arduino_Wifi_AVRISP.ino
index 01b7388bb2..b3db7894c6 100644
--- a/libraries/ESP8266AVRISP/examples/Arduino_Wifi_AVRISP/Arduino_Wifi_AVRISP.ino
+++ b/libraries/ESP8266AVRISP/examples/Arduino_Wifi_AVRISP/Arduino_Wifi_AVRISP.ino
@@ -8,23 +8,25 @@
 #define STAPSK "your-password"
 #endif
 
-const char* host = "esp8266-avrisp";
-const char* ssid = STASSID;
-const char* pass = STAPSK;
-const uint16_t port = 328;
-const uint8_t reset_pin = 5;
+const char*    host      = "esp8266-avrisp";
+const char*    ssid      = STASSID;
+const char*    pass      = STAPSK;
+const uint16_t port      = 328;
+const uint8_t  reset_pin = 5;
 
-ESP8266AVRISP avrprog(port, reset_pin);
+ESP8266AVRISP  avrprog(port, reset_pin);
 
-void setup() {
+void           setup()
+{
   Serial.begin(115200);
   Serial.println("");
   Serial.println("Arduino AVR-ISP over TCP");
-  avrprog.setReset(false); // let the AVR run
+  avrprog.setReset(false);  // let the AVR run
 
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
-  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
+  while (WiFi.waitForConnectResult() != WL_CONNECTED)
+  {
     WiFi.begin(ssid, pass);
     Serial.println("WiFi failed, retrying.");
   }
@@ -46,22 +48,28 @@ void setup() {
   avrprog.begin();
 }
 
-void loop() {
+void loop()
+{
   static AVRISPState_t last_state = AVRISP_STATE_IDLE;
-  AVRISPState_t new_state = avrprog.update();
-  if (last_state != new_state) {
-    switch (new_state) {
-      case AVRISP_STATE_IDLE: {
+  AVRISPState_t        new_state  = avrprog.update();
+  if (last_state != new_state)
+  {
+    switch (new_state)
+    {
+      case AVRISP_STATE_IDLE:
+      {
         Serial.printf("[AVRISP] now idle\r\n");
         // Use the SPI bus for other purposes
         break;
       }
-      case AVRISP_STATE_PENDING: {
+      case AVRISP_STATE_PENDING:
+      {
         Serial.printf("[AVRISP] connection pending\r\n");
         // Clean up your other purposes and prepare for programming mode
         break;
       }
-      case AVRISP_STATE_ACTIVE: {
+      case AVRISP_STATE_ACTIVE:
+      {
         Serial.printf("[AVRISP] programming mode\r\n");
         // Stand by for completion
         break;
@@ -70,11 +78,13 @@ void loop() {
     last_state = new_state;
   }
   // Serve the client
-  if (last_state != AVRISP_STATE_IDLE) {
+  if (last_state != AVRISP_STATE_IDLE)
+  {
     avrprog.serve();
   }
 
-  if (WiFi.status() == WL_CONNECTED) {
+  if (WiFi.status() == WL_CONNECTED)
+  {
     MDNS.update();
   }
 }
diff --git a/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino b/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino
index 878cab95b5..add86f1f10 100644
--- a/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino
+++ b/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino
@@ -16,8 +16,8 @@
 
 ESP8266WiFiMulti WiFiMulti;
 
-void setup() {
-
+void             setup()
+{
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -25,7 +25,8 @@ void setup() {
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--) {
+  for (uint8_t t = 4; t > 0; t--)
+  {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -35,10 +36,11 @@ void setup() {
   WiFiMulti.addAP("SSID", "PASSWORD");
 }
 
-void loop() {
+void loop()
+{
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED)) {
-
+  if ((WiFiMulti.run() == WL_CONNECTED))
+  {
     WiFiClient client;
 
     HTTPClient http;
@@ -63,16 +65,20 @@ void loop() {
     int httpCode = http.GET();
 
     // httpCode will be negative on error
-    if (httpCode > 0) {
+    if (httpCode > 0)
+    {
       // HTTP header has been send and Server response header has been handled
       Serial.printf("[HTTP] GET... code: %d\n", httpCode);
 
       // file found at server
-      if (httpCode == HTTP_CODE_OK) {
+      if (httpCode == HTTP_CODE_OK)
+      {
         String payload = http.getString();
         Serial.println(payload);
       }
-    } else {
+    }
+    else
+    {
       Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
     }
 
diff --git a/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino b/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
index 18f225b797..0ae48db06c 100644
--- a/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
@@ -16,8 +16,8 @@
 
 ESP8266WiFiMulti WiFiMulti;
 
-void setup() {
-
+void             setup()
+{
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -25,7 +25,8 @@ void setup() {
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--) {
+  for (uint8_t t = 4; t > 0; t--)
+  {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -35,37 +36,45 @@ void setup() {
   WiFiMulti.addAP("SSID", "PASSWORD");
 }
 
-void loop() {
+void loop()
+{
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED)) {
-
+  if ((WiFiMulti.run() == WL_CONNECTED))
+  {
     WiFiClient client;
 
     HTTPClient http;
 
     Serial.print("[HTTP] begin...\n");
-    if (http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html")) { // HTTP
+    if (http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html"))
+    {  // HTTP
 
       Serial.print("[HTTP] GET...\n");
       // start connection and send HTTP header
       int httpCode = http.GET();
 
       // httpCode will be negative on error
-      if (httpCode > 0) {
+      if (httpCode > 0)
+      {
         // HTTP header has been send and Server response header has been handled
         Serial.printf("[HTTP] GET... code: %d\n", httpCode);
 
         // file found at server
-        if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {
+        if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY)
+        {
           String payload = http.getString();
           Serial.println(payload);
         }
-      } else {
+      }
+      else
+      {
         Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
       }
 
       http.end();
-    } else {
+    }
+    else
+    {
       Serial.printf("[HTTP} Unable to connect\n");
     }
   }
diff --git a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
index efb653fc76..b91f8f116f 100644
--- a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
@@ -14,12 +14,12 @@
 
 #include <WiFiClientSecureBearSSL.h>
 // Fingerprint for demo URL, expires on June 2, 2021, needs to be updated well before this date
-const uint8_t fingerprint[20] = { 0x40, 0xaf, 0x00, 0x6b, 0xec, 0x90, 0x22, 0x41, 0x8e, 0xa3, 0xad, 0xfa, 0x1a, 0xe8, 0x25, 0x41, 0x1d, 0x1a, 0x54, 0xb3 };
+const uint8_t    fingerprint[20] = { 0x40, 0xaf, 0x00, 0x6b, 0xec, 0x90, 0x22, 0x41, 0x8e, 0xa3, 0xad, 0xfa, 0x1a, 0xe8, 0x25, 0x41, 0x1d, 0x1a, 0x54, 0xb3 };
 
 ESP8266WiFiMulti WiFiMulti;
 
-void setup() {
-
+void             setup()
+{
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -27,7 +27,8 @@ void setup() {
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--) {
+  for (uint8_t t = 4; t > 0; t--)
+  {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -37,10 +38,11 @@ void setup() {
   WiFiMulti.addAP("SSID", "PASSWORD");
 }
 
-void loop() {
+void loop()
+{
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED)) {
-
+  if ((WiFiMulti.run() == WL_CONNECTED))
+  {
     std::unique_ptr<BearSSL::WiFiClientSecure> client(new BearSSL::WiFiClientSecure);
 
     client->setFingerprint(fingerprint);
@@ -50,28 +52,35 @@ void loop() {
     HTTPClient https;
 
     Serial.print("[HTTPS] begin...\n");
-    if (https.begin(*client, "https://jigsaw.w3.org/HTTP/connection.html")) { // HTTPS
+    if (https.begin(*client, "https://jigsaw.w3.org/HTTP/connection.html"))
+    {  // HTTPS
 
       Serial.print("[HTTPS] GET...\n");
       // start connection and send HTTP header
       int httpCode = https.GET();
 
       // httpCode will be negative on error
-      if (httpCode > 0) {
+      if (httpCode > 0)
+      {
         // HTTP header has been send and Server response header has been handled
         Serial.printf("[HTTPS] GET... code: %d\n", httpCode);
 
         // file found at server
-        if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {
+        if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY)
+        {
           String payload = https.getString();
           Serial.println(payload);
         }
-      } else {
+      }
+      else
+      {
         Serial.printf("[HTTPS] GET... failed, error: %s\n", https.errorToString(httpCode).c_str());
       }
 
       https.end();
-    } else {
+    }
+    else
+    {
       Serial.printf("[HTTPS] Unable to connect\n");
     }
   }
diff --git a/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino b/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
index a538fd4799..e7b838f01f 100644
--- a/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
+++ b/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
@@ -16,49 +16,54 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid         = STASSID;
 const char* ssidPassword = STAPSK;
 
-const char* username = "admin";
-const char* password = "admin";
+const char* username     = "admin";
+const char* password     = "admin";
 
-const char* server = "http://httpbin.org";
-const char* uri = "/digest-auth/auth/admin/admin/MD5";
+const char* server       = "http://httpbin.org";
+const char* uri          = "/digest-auth/auth/admin/admin/MD5";
 
-String exractParam(String& authReq, const String& param, const char delimit) {
+String      exractParam(String& authReq, const String& param, const char delimit)
+{
   int _begin = authReq.indexOf(param);
-  if (_begin == -1) {
+  if (_begin == -1)
+  {
     return "";
   }
   return authReq.substring(_begin + param.length(), authReq.indexOf(delimit, _begin + param.length()));
 }
 
-String getCNonce(const int len) {
+String getCNonce(const int len)
+{
   static const char alphanum[] = "0123456789"
                                  "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                                  "abcdefghijklmnopqrstuvwxyz";
   String s = "";
 
-  for (int i = 0; i < len; ++i) {
+  for (int i = 0; i < len; ++i)
+  {
     s += alphanum[rand() % (sizeof(alphanum) - 1)];
   }
 
   return s;
 }
 
-String getDigestAuth(String& authReq, const String& username, const String& password, const String& method, const String& uri, unsigned int counter) {
+String getDigestAuth(String& authReq, const String& username, const String& password, const String& method, const String& uri, unsigned int counter)
+{
   // extracting required parameters for RFC 2069 simpler Digest
-  String realm = exractParam(authReq, "realm=\"", '"');
-  String nonce = exractParam(authReq, "nonce=\"", '"');
+  String realm  = exractParam(authReq, "realm=\"", '"');
+  String nonce  = exractParam(authReq, "nonce=\"", '"');
   String cNonce = getCNonce(8);
 
-  char nc[9];
+  char   nc[9];
   snprintf(nc, sizeof(nc), "%08x", counter);
 
   // parameters for the RFC 2617 newer Digest
   MD5Builder md5;
   md5.begin();
-  md5.add(username + ":" + realm + ":" + password); // md5 of the user:realm:user
+  md5.add(username + ":" + realm + ":" + password);  // md5 of the user:realm:user
   md5.calculate();
   String h1 = md5.toString();
 
@@ -70,7 +75,7 @@ String getDigestAuth(String& authReq, const String& username, const String& pass
   md5.begin();
   md5.add(h1 + ":" + nonce + ":" + String(nc) + ":" + cNonce + ":" + "auth" + ":" + h2);
   md5.calculate();
-  String response = md5.toString();
+  String response      = md5.toString();
 
   String authorization = "Digest username=\"" + username + "\", realm=\"" + realm + "\", nonce=\"" + nonce + "\", uri=\"" + uri + "\", algorithm=\"MD5\", qop=auth, nc=" + String(nc) + ", cnonce=\"" + cNonce + "\", response=\"" + response + "\"";
   Serial.println(authorization);
@@ -78,14 +83,16 @@ String getDigestAuth(String& authReq, const String& username, const String& pass
   return authorization;
 }
 
-void setup() {
+void setup()
+{
   randomSeed(RANDOM_REG32);
   Serial.begin(115200);
 
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, ssidPassword);
 
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -96,9 +103,10 @@ void setup() {
   Serial.println(WiFi.localIP());
 }
 
-void loop() {
+void loop()
+{
   WiFiClient client;
-  HTTPClient http; //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
+  HTTPClient http;  //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
 
   Serial.print("[HTTP] begin...\n");
 
@@ -112,7 +120,8 @@ void loop() {
   // start connection and send HTTP header
   int httpCode = http.GET();
 
-  if (httpCode > 0) {
+  if (httpCode > 0)
+  {
     String authReq = http.header("WWW-Authenticate");
     Serial.println(authReq);
 
@@ -124,13 +133,18 @@ void loop() {
     http.addHeader("Authorization", authorization);
 
     int httpCode = http.GET();
-    if (httpCode > 0) {
+    if (httpCode > 0)
+    {
       String payload = http.getString();
       Serial.println(payload);
-    } else {
+    }
+    else
+    {
       Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
     }
-  } else {
+  }
+  else
+  {
     Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
   }
 
diff --git a/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino b/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
index 01f7c34eff..5ac3868708 100644
--- a/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
@@ -23,8 +23,8 @@
 #define STAPSK "your-password"
 #endif
 
-void setup() {
-
+void setup()
+{
   Serial.begin(115200);
 
   Serial.println();
@@ -33,7 +33,8 @@ void setup() {
 
   WiFi.begin(STASSID, STAPSK);
 
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -42,16 +43,17 @@ void setup() {
   Serial.println(WiFi.localIP());
 }
 
-void loop() {
+void loop()
+{
   // wait for WiFi connection
-  if ((WiFi.status() == WL_CONNECTED)) {
-
+  if ((WiFi.status() == WL_CONNECTED))
+  {
     WiFiClient client;
     HTTPClient http;
 
     Serial.print("[HTTP] begin...\n");
     // configure traged server and url
-    http.begin(client, "http://" SERVER_IP "/postplain/"); //HTTP
+    http.begin(client, "http://" SERVER_IP "/postplain/");  //HTTP
     http.addHeader("Content-Type", "application/json");
 
     Serial.print("[HTTP] POST...\n");
@@ -59,18 +61,22 @@ void loop() {
     int httpCode = http.POST("{\"hello\":\"world\"}");
 
     // httpCode will be negative on error
-    if (httpCode > 0) {
+    if (httpCode > 0)
+    {
       // HTTP header has been send and Server response header has been handled
       Serial.printf("[HTTP] POST... code: %d\n", httpCode);
 
       // file found at server
-      if (httpCode == HTTP_CODE_OK) {
+      if (httpCode == HTTP_CODE_OK)
+      {
         const String& payload = http.getString();
         Serial.println("received payload:\n<<");
         Serial.println(payload);
         Serial.println(">>");
       }
-    } else {
+    }
+    else
+    {
       Serial.printf("[HTTP] POST... failed, error: %s\n", http.errorToString(httpCode).c_str());
     }
 
diff --git a/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino b/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
index 4cfc3911bf..9f5c29db5b 100644
--- a/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
+++ b/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
@@ -17,11 +17,11 @@
 
 ESP8266WiFiMulti WiFiMulti;
 
-HTTPClient http;
-WiFiClient client;
-
-void setup() {
+HTTPClient       http;
+WiFiClient       client;
 
+void             setup()
+{
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -33,7 +33,8 @@ void setup() {
   WiFiMulti.addAP(STASSID, STAPSK);
 
   // wait for WiFi connection
-  while ((WiFiMulti.run() != WL_CONNECTED)) {
+  while ((WiFiMulti.run() != WL_CONNECTED))
+  {
     Serial.write('.');
     delay(500);
   }
@@ -46,22 +47,28 @@ void setup() {
   //http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
 }
 
-int pass = 0;
+int  pass = 0;
 
-void loop() {
+void loop()
+{
   // First 10 loop()s, retrieve the URL
-  if (pass < 10) {
+  if (pass < 10)
+  {
     pass++;
     Serial.printf("Reuse connection example, GET url for the %d time\n", pass);
     int httpCode = http.GET();
-    if (httpCode > 0) {
+    if (httpCode > 0)
+    {
       Serial.printf("[HTTP] GET... code: %d\n", httpCode);
 
       // file found at server
-      if (httpCode == HTTP_CODE_OK) {
+      if (httpCode == HTTP_CODE_OK)
+      {
         http.writeToStream(&Serial);
       }
-    } else {
+    }
+    else
+    {
       Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
       // Something went wrong with the connection, try to reconnect
       http.end();
@@ -69,10 +76,13 @@ void loop() {
       //http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
     }
 
-    if (pass == 10) {
+    if (pass == 10)
+    {
       http.end();
       Serial.println("Done testing");
-    } else {
+    }
+    else
+    {
       Serial.println("\n\n\nWait 5 second...\n");
       delay(5000);
     }
diff --git a/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino b/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
index 7a813c7e10..a165646677 100644
--- a/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
@@ -14,8 +14,8 @@
 
 ESP8266WiFiMulti WiFiMulti;
 
-void setup() {
-
+void             setup()
+{
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -23,7 +23,8 @@ void setup() {
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--) {
+  for (uint8_t t = 4; t > 0; t--)
+  {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -33,12 +34,13 @@ void setup() {
   WiFiMulti.addAP("SSID", "PASSWORD");
 }
 
-void loop() {
+void loop()
+{
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED)) {
-
+  if ((WiFiMulti.run() == WL_CONNECTED))
+  {
     WiFiClient client;
-    HTTPClient http; //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
+    HTTPClient http;  //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
 
     Serial.print("[HTTP] begin...\n");
 
@@ -49,15 +51,16 @@ void loop() {
     Serial.print("[HTTP] GET...\n");
     // start connection and send HTTP header
     int httpCode = http.GET();
-    if (httpCode > 0) {
+    if (httpCode > 0)
+    {
       // HTTP header has been send and Server response header has been handled
       Serial.printf("[HTTP] GET... code: %d\n", httpCode);
 
       // file found at server
-      if (httpCode == HTTP_CODE_OK) {
-
+      if (httpCode == HTTP_CODE_OK)
+      {
         // get length of document (is -1 when Server sends no Content-Length header)
-        int len = http.getSize();
+        int     len       = http.getSize();
 
         // create buffer for read
         uint8_t buff[128] = { 0 };
@@ -72,18 +75,21 @@ void loop() {
         WiFiClient* stream = &client;
 
         // read all data from server
-        while (http.connected() && (len > 0 || len == -1)) {
+        while (http.connected() && (len > 0 || len == -1))
+        {
           // read up to 128 byte
           int c = stream->readBytes(buff, std::min((size_t)len, sizeof(buff)));
           Serial.printf("readBytes: %d\n", c);
-          if (!c) {
+          if (!c)
+          {
             Serial.println("read timeout");
           }
 
           // write it to Serial
           Serial.write(buff, c);
 
-          if (len > 0) {
+          if (len > 0)
+          {
             len -= c;
           }
         }
@@ -92,7 +98,9 @@ void loop() {
         Serial.println();
         Serial.print("[HTTP] connection closed or file end.\n");
       }
-    } else {
+    }
+    else
+    {
       Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
     }
 
diff --git a/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
index 9ba575bd78..011ef3a569 100644
--- a/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
@@ -14,8 +14,8 @@
 
 ESP8266WiFiMulti WiFiMulti;
 
-void setup() {
-
+void             setup()
+{
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -23,7 +23,8 @@ void setup() {
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--) {
+  for (uint8_t t = 4; t > 0; t--)
+  {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -33,16 +34,18 @@ void setup() {
   WiFiMulti.addAP("SSID", "PASSWORD");
 }
 
-void loop() {
+void loop()
+{
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED)) {
-
+  if ((WiFiMulti.run() == WL_CONNECTED))
+  {
     std::unique_ptr<BearSSL::WiFiClientSecure> client(new BearSSL::WiFiClientSecure);
 
-    bool mfln = client->probeMaxFragmentLength("tls.mbed.org", 443, 1024);
+    bool                                       mfln = client->probeMaxFragmentLength("tls.mbed.org", 443, 1024);
     Serial.printf("\nConnecting to https://tls.mbed.org\n");
     Serial.printf("Maximum fragment Length negotiation supported: %s\n", mfln ? "yes" : "no");
-    if (mfln) {
+    if (mfln)
+    {
       client->setBufferSizes(1024, 1024);
     }
 
@@ -55,37 +58,41 @@ void loop() {
 
     HTTPClient https;
 
-    if (https.begin(*client, "https://tls.mbed.org/")) {
-
+    if (https.begin(*client, "https://tls.mbed.org/"))
+    {
       Serial.print("[HTTPS] GET...\n");
       // start connection and send HTTP header
       int httpCode = https.GET();
-      if (httpCode > 0) {
+      if (httpCode > 0)
+      {
         // HTTP header has been send and Server response header has been handled
         Serial.printf("[HTTPS] GET... code: %d\n", httpCode);
 
         // file found at server
-        if (httpCode == HTTP_CODE_OK) {
-
+        if (httpCode == HTTP_CODE_OK)
+        {
           // get length of document (is -1 when Server sends no Content-Length header)
-          int len = https.getSize();
+          int            len       = https.getSize();
 
           // create buffer for read
           static uint8_t buff[128] = { 0 };
 
           // read all data from server
-          while (https.connected() && (len > 0 || len == -1)) {
+          while (https.connected() && (len > 0 || len == -1))
+          {
             // get available data size
             size_t size = client->available();
 
-            if (size) {
+            if (size)
+            {
               // read up to 128 byte
               int c = client->readBytes(buff, ((size > sizeof(buff)) ? sizeof(buff) : size));
 
               // write it to Serial
               Serial.write(buff, c);
 
-              if (len > 0) {
+              if (len > 0)
+              {
                 len -= c;
               }
             }
@@ -95,12 +102,16 @@ void loop() {
           Serial.println();
           Serial.print("[HTTPS] connection closed or file end.\n");
         }
-      } else {
+      }
+      else
+      {
         Serial.printf("[HTTPS] GET... failed, error: %s\n", https.errorToString(httpCode).c_str());
       }
 
       https.end();
-    } else {
+    }
+    else
+    {
       Serial.printf("Unable to connect\n");
     }
   }
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino
index d849181a6c..0feea5c4f4 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino
@@ -24,17 +24,17 @@
 #define STAPSK "your-password"
 #endif
 
-const char* host = "esp8266-webupdate";
-const char* update_path = "/firmware";
-const char* update_username = "admin";
-const char* update_password = "admin";
-const char* ssid = STASSID;
-const char* password = STAPSK;
-
-ESP8266WebServerSecure httpServer(443);
+const char*                   host            = "esp8266-webupdate";
+const char*                   update_path     = "/firmware";
+const char*                   update_username = "admin";
+const char*                   update_password = "admin";
+const char*                   ssid            = STASSID;
+const char*                   password        = STAPSK;
+
+ESP8266WebServerSecure        httpServer(443);
 ESP8266HTTPUpdateServerSecure httpUpdater;
 
-static const char serverCert[] PROGMEM = R"EOF(
+static const char             serverCert[] PROGMEM = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIDSzCCAjMCCQD2ahcfZAwXxDANBgkqhkiG9w0BAQsFADCBiTELMAkGA1UEBhMC
 VVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU9yYW5nZSBDb3VudHkx
@@ -57,7 +57,7 @@ JfUvYadSYxh3nblvA4OL+iEZiW8NE3hbW6WPXxvS7Euge0uWMPc4uEcnsE0ZVG3m
 -----END CERTIFICATE-----
 )EOF";
 
-static const char serverKey[] PROGMEM = R"EOF(
+static const char             serverKey[] PROGMEM  = R"EOF(
 -----BEGIN RSA PRIVATE KEY-----
 MIIEpQIBAAKCAQEA9UoHBtn4oNKXjRgIOQ/rLxK/iI0a8Q5mDxhfuwa9//FkftSI
 IFY8UhGk2YNJpnfKOyYWqbqwuJhIZJ2sEIWp2301OnavuGBrpKOgBJJljgH2l/4Z
@@ -87,15 +87,16 @@ gz5JWYhbD6c38khSzJb0pNXCo3EuYAVa36kDM96k1BtWuhRS10Q1VXk=
 -----END RSA PRIVATE KEY-----
 )EOF";
 
-void setup() {
-
+void                          setup()
+{
   Serial.begin(115200);
   Serial.println();
   Serial.println("Booting Sketch...");
   WiFi.mode(WIFI_AP_STA);
   WiFi.begin(ssid, password);
 
-  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
+  while (WiFi.waitForConnectResult() != WL_CONNECTED)
+  {
     WiFi.begin(ssid, password);
     Serial.println("WiFi failed, retrying.");
   }
@@ -112,10 +113,11 @@ void setup() {
   Serial.printf("BearSSLUpdateServer ready!\nOpen https://%s.local%s in "
                 "your browser and login with username '%s' and password "
                 "'%s'\n",
-      host, update_path, update_username, update_password);
+                host, update_path, update_username, update_password);
 }
 
-void loop() {
+void loop()
+{
   httpServer.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
index d37ef3f1f6..ace93bdf93 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
@@ -13,25 +13,26 @@
 #define STAPSK "your-password"
 #endif
 
-const char* host = "esp8266-webupdate";
-const char* update_path = "/firmware";
-const char* update_username = "admin";
-const char* update_password = "admin";
-const char* ssid = STASSID;
-const char* password = STAPSK;
-
-ESP8266WebServer httpServer(80);
+const char*             host            = "esp8266-webupdate";
+const char*             update_path     = "/firmware";
+const char*             update_username = "admin";
+const char*             update_password = "admin";
+const char*             ssid            = STASSID;
+const char*             password        = STAPSK;
+
+ESP8266WebServer        httpServer(80);
 ESP8266HTTPUpdateServer httpUpdater;
 
-void setup(void) {
-
+void                    setup(void)
+{
   Serial.begin(115200);
   Serial.println();
   Serial.println("Booting Sketch...");
   WiFi.mode(WIFI_AP_STA);
   WiFi.begin(ssid, password);
 
-  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
+  while (WiFi.waitForConnectResult() != WL_CONNECTED)
+  {
     WiFi.begin(ssid, password);
     Serial.println("WiFi failed, retrying.");
   }
@@ -45,7 +46,8 @@ void setup(void) {
   Serial.printf("HTTPUpdateServer ready! Open http://%s.local%s in your browser and login with username '%s' and password '%s'\n", host, update_path, update_username, update_password);
 }
 
-void loop(void) {
+void loop(void)
+{
   httpServer.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
index 89b5f62a90..411998b1dd 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
@@ -13,22 +13,23 @@
 #define STAPSK "your-password"
 #endif
 
-const char* host = "esp8266-webupdate";
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*             host     = "esp8266-webupdate";
+const char*             ssid     = STASSID;
+const char*             password = STAPSK;
 
-ESP8266WebServer httpServer(80);
+ESP8266WebServer        httpServer(80);
 ESP8266HTTPUpdateServer httpUpdater;
 
-void setup(void) {
-
+void                    setup(void)
+{
   Serial.begin(115200);
   Serial.println();
   Serial.println("Booting Sketch...");
   WiFi.mode(WIFI_AP_STA);
   WiFi.begin(ssid, password);
 
-  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
+  while (WiFi.waitForConnectResult() != WL_CONNECTED)
+  {
     WiFi.begin(ssid, password);
     Serial.println("WiFi failed, retrying.");
   }
@@ -42,7 +43,8 @@ void setup(void) {
   Serial.printf("HTTPUpdateServer ready! Open http://%s.local/update in your browser\n", host);
 }
 
-void loop(void) {
+void loop(void)
+{
   httpServer.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino b/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
index f36da85aeb..ddc8f44432 100644
--- a/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
+++ b/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
@@ -65,20 +65,23 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*      ssid     = STASSID;
+const char*      password = STAPSK;
 
 ESP8266WebServer web_server(80);
 
-void handle_http_not_found() {
+void             handle_http_not_found()
+{
   web_server.send(404, "text/plain", "Not Found");
 }
 
-void handle_http_root() {
+void handle_http_root()
+{
   web_server.send(200, "text/plain", "It works!");
 }
 
-void setup(void) {
+void setup(void)
+{
   Serial.begin(115200);
 
   // Connect to WiFi network
@@ -87,7 +90,8 @@ void setup(void) {
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -107,6 +111,7 @@ void setup(void) {
   Serial.println("HTTP server started");
 }
 
-void loop(void) {
+void loop(void)
+{
   web_server.handleClient();
 }
diff --git a/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino b/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
index 4d7998667b..3ecf5ea95e 100644
--- a/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
+++ b/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
@@ -7,13 +7,14 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*      ssid     = STASSID;
+const char*      password = STAPSK;
 
 ESP8266WebServer wwwserver(80);
-String content;
+String           content;
 
-static void handleRoot(void) {
+static void      handleRoot(void)
+{
   content = F("<!DOCTYPE HTML>\n<html>Hello world from ESP8266");
   content += F("<p>");
   content += F("</html>");
@@ -21,7 +22,8 @@ static void handleRoot(void) {
   wwwserver.send(200, F("text/html"), content);
 }
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
 
   // Connect to WiFi network
@@ -30,7 +32,8 @@ void setup() {
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -46,6 +49,7 @@ void setup() {
   NBNS.begin("ESP");
 }
 
-void loop() {
+void loop()
+{
   wwwserver.handleClient();
 }
diff --git a/libraries/ESP8266SSDP/examples/SSDP/SSDP.ino b/libraries/ESP8266SSDP/examples/SSDP/SSDP.ino
index c081869696..7fff5454f5 100644
--- a/libraries/ESP8266SSDP/examples/SSDP/SSDP.ino
+++ b/libraries/ESP8266SSDP/examples/SSDP/SSDP.ino
@@ -7,27 +7,26 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*      ssid     = STASSID;
+const char*      password = STAPSK;
 
 ESP8266WebServer HTTP(80);
 
-void setup() {
+void             setup()
+{
   Serial.begin(115200);
   Serial.println();
   Serial.println("Starting WiFi...");
 
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
-  if (WiFi.waitForConnectResult() == WL_CONNECTED) {
-
+  if (WiFi.waitForConnectResult() == WL_CONNECTED)
+  {
     Serial.printf("Starting HTTP...\n");
-    HTTP.on("/index.html", HTTP_GET, []() {
-      HTTP.send(200, "text/plain", "Hello World!");
-    });
-    HTTP.on("/description.xml", HTTP_GET, []() {
-      SSDP.schema(HTTP.client());
-    });
+    HTTP.on("/index.html", HTTP_GET, []()
+            { HTTP.send(200, "text/plain", "Hello World!"); });
+    HTTP.on("/description.xml", HTTP_GET, []()
+            { SSDP.schema(HTTP.client()); });
     HTTP.begin();
 
     Serial.printf("Starting SSDP...\n");
@@ -44,15 +43,19 @@ void setup() {
     SSDP.begin();
 
     Serial.printf("Ready!\n");
-  } else {
+  }
+  else
+  {
     Serial.printf("WiFi Failed\n");
-    while (1) {
+    while (1)
+    {
       delay(100);
     }
   }
 }
 
-void loop() {
+void loop()
+{
   HTTP.handleClient();
   delay(1);
 }
diff --git a/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino b/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
index c20d1ddb15..c91e8779d8 100644
--- a/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
+++ b/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
@@ -38,23 +38,24 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*      ssid     = STASSID;
+const char*      password = STAPSK;
 
 ESP8266WebServer server(80);
 
-const int led = 13;
+const int        led = 13;
 
-void handleRoot() {
+void             handleRoot()
+{
   digitalWrite(led, 1);
   char temp[400];
-  int sec = millis() / 1000;
-  int min = sec / 60;
-  int hr = min / 60;
+  int  sec = millis() / 1000;
+  int  min = sec / 60;
+  int  hr  = min / 60;
 
   snprintf(temp, 400,
 
-      "<html>\
+           "<html>\
   <head>\
     <meta http-equiv='refresh' content='5'/>\
     <title>ESP8266 Demo</title>\
@@ -69,12 +70,13 @@ void handleRoot() {
   </body>\
 </html>",
 
-      hr, min % 60, sec % 60);
+           hr, min % 60, sec % 60);
   server.send(200, "text/html", temp);
   digitalWrite(led, 0);
 }
 
-void handleNotFound() {
+void handleNotFound()
+{
   digitalWrite(led, 1);
   String message = "File Not Found\n\n";
   message += "URI: ";
@@ -85,7 +87,8 @@ void handleNotFound() {
   message += server.args();
   message += "\n";
 
-  for (uint8_t i = 0; i < server.args(); i++) {
+  for (uint8_t i = 0; i < server.args(); i++)
+  {
     message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
   }
 
@@ -93,7 +96,8 @@ void handleNotFound() {
   digitalWrite(led, 0);
 }
 
-void drawGraph() {
+void drawGraph()
+{
   String out;
   out.reserve(2600);
   char temp[70];
@@ -101,7 +105,8 @@ void drawGraph() {
   out += "<rect width=\"400\" height=\"150\" fill=\"rgb(250, 230, 210)\" stroke-width=\"1\" stroke=\"rgb(0, 0, 0)\" />\n";
   out += "<g stroke=\"black\">\n";
   int y = rand() % 130;
-  for (int x = 10; x < 390; x += 10) {
+  for (int x = 10; x < 390; x += 10)
+  {
     int y2 = rand() % 130;
     sprintf(temp, "<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" stroke-width=\"1\" />\n", x, 140 - y, x + 10, 140 - y2);
     out += temp;
@@ -112,7 +117,8 @@ void drawGraph() {
   server.send(200, "image/svg+xml", out);
 }
 
-void setup(void) {
+void setup(void)
+{
   pinMode(led, OUTPUT);
   digitalWrite(led, 0);
   Serial.begin(115200);
@@ -121,7 +127,8 @@ void setup(void) {
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -132,21 +139,22 @@ void setup(void) {
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-  if (MDNS.begin("esp8266")) {
+  if (MDNS.begin("esp8266"))
+  {
     Serial.println("MDNS responder started");
   }
 
   server.on("/", handleRoot);
   server.on("/test.svg", drawGraph);
-  server.on("/inline", []() {
-    server.send(200, "text/plain", "this works as well");
-  });
+  server.on("/inline", []()
+            { server.send(200, "text/plain", "this works as well"); });
   server.onNotFound(handleNotFound);
   server.begin();
   Serial.println("HTTP server started");
 }
 
-void loop(void) {
+void loop(void)
+{
   server.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino b/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
index 686f4327ed..e816a49354 100644
--- a/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
+++ b/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
@@ -49,19 +49,19 @@
 
 #if defined USE_SPIFFS
 #include <FS.h>
-const char* fsName = "SPIFFS";
-FS* fileSystem = &SPIFFS;
-SPIFFSConfig fileSystemConfig = SPIFFSConfig();
+const char*   fsName           = "SPIFFS";
+FS*           fileSystem       = &SPIFFS;
+SPIFFSConfig  fileSystemConfig = SPIFFSConfig();
 #elif defined USE_LITTLEFS
 #include <LittleFS.h>
-const char* fsName = "LittleFS";
-FS* fileSystem = &LittleFS;
+const char*    fsName           = "LittleFS";
+FS*            fileSystem       = &LittleFS;
 LittleFSConfig fileSystemConfig = LittleFSConfig();
 #elif defined USE_SDFS
 #include <SDFS.h>
-const char* fsName = "SDFS";
-FS* fileSystem = &SDFS;
-SDFSConfig fileSystemConfig = SDFSConfig();
+const char* fsName           = "SDFS";
+FS*         fileSystem       = &SDFS;
+SDFSConfig  fileSystemConfig = SDFSConfig();
 // fileSystemConfig.setCSPin(chipSelectPin);
 #else
 #error Please select a filesystem first by uncommenting one of the "#define USE_xxx" lines at the beginning of the sketch.
@@ -74,42 +74,47 @@ SDFSConfig fileSystemConfig = SDFSConfig();
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
-const char* host = "fsbrowser";
+const char*       ssid     = STASSID;
+const char*       password = STAPSK;
+const char*       host     = "fsbrowser";
 
-ESP8266WebServer server(80);
+ESP8266WebServer  server(80);
 
-static bool fsOK;
-String unsupportedFiles = String();
+static bool       fsOK;
+String            unsupportedFiles = String();
 
-File uploadFile;
+File              uploadFile;
 
-static const char TEXT_PLAIN[] PROGMEM = "text/plain";
-static const char FS_INIT_ERROR[] PROGMEM = "FS INIT ERROR";
+static const char TEXT_PLAIN[] PROGMEM     = "text/plain";
+static const char FS_INIT_ERROR[] PROGMEM  = "FS INIT ERROR";
 static const char FILE_NOT_FOUND[] PROGMEM = "FileNotFound";
 
 ////////////////////////////////
 // Utils to return HTTP codes, and determine content-type
 
-void replyOK() {
+void              replyOK()
+{
   server.send(200, FPSTR(TEXT_PLAIN), "");
 }
 
-void replyOKWithMsg(String msg) {
+void replyOKWithMsg(String msg)
+{
   server.send(200, FPSTR(TEXT_PLAIN), msg);
 }
 
-void replyNotFound(String msg) {
+void replyNotFound(String msg)
+{
   server.send(404, FPSTR(TEXT_PLAIN), msg);
 }
 
-void replyBadRequest(String msg) {
+void replyBadRequest(String msg)
+{
   DBG_OUTPUT_PORT.println(msg);
   server.send(400, FPSTR(TEXT_PLAIN), msg + "\r\n");
 }
 
-void replyServerError(String msg) {
+void replyServerError(String msg)
+{
   DBG_OUTPUT_PORT.println(msg);
   server.send(500, FPSTR(TEXT_PLAIN), msg + "\r\n");
 }
@@ -119,15 +124,19 @@ void replyServerError(String msg) {
    Checks filename for character combinations that are not supported by FSBrowser (alhtough valid on SPIFFS).
    Returns an empty String if supported, or detail of error(s) if unsupported
 */
-String checkForUnsupportedPath(String filename) {
+String checkForUnsupportedPath(String filename)
+{
   String error = String();
-  if (!filename.startsWith("/")) {
+  if (!filename.startsWith("/"))
+  {
     error += F("!NO_LEADING_SLASH! ");
   }
-  if (filename.indexOf("//") != -1) {
+  if (filename.indexOf("//") != -1)
+  {
     error += F("!DOUBLE_SLASH! ");
   }
-  if (filename.endsWith("/")) {
+  if (filename.endsWith("/"))
+  {
     error += F("!TRAILING_SLASH! ");
   }
   return error;
@@ -140,7 +149,8 @@ String checkForUnsupportedPath(String filename) {
 /*
    Return the FS type, status and size info
 */
-void handleStatus() {
+void handleStatus()
+{
   DBG_OUTPUT_PORT.println("handleStatus");
   FSInfo fs_info;
   String json;
@@ -149,14 +159,17 @@ void handleStatus() {
   json = "{\"type\":\"";
   json += fsName;
   json += "\", \"isOk\":";
-  if (fsOK) {
+  if (fsOK)
+  {
     fileSystem->info(fs_info);
     json += F("\"true\", \"totalBytes\":\"");
     json += fs_info.totalBytes;
     json += F("\", \"usedBytes\":\"");
     json += fs_info.usedBytes;
     json += "\"";
-  } else {
+  }
+  else
+  {
     json += "\"false\"";
   }
   json += F(",\"unsupportedFiles\":\"");
@@ -170,17 +183,21 @@ void handleStatus() {
    Return the list of files in the directory specified by the "dir" query string parameter.
    Also demonstrates the use of chunked responses.
 */
-void handleFileList() {
-  if (!fsOK) {
+void handleFileList()
+{
+  if (!fsOK)
+  {
     return replyServerError(FPSTR(FS_INIT_ERROR));
   }
 
-  if (!server.hasArg("dir")) {
+  if (!server.hasArg("dir"))
+  {
     return replyBadRequest(F("DIR ARG MISSING"));
   }
 
   String path = server.arg("dir");
-  if (path != "/" && !fileSystem->exists(path)) {
+  if (path != "/" && !fileSystem->exists(path))
+  {
     return replyBadRequest("BAD PATH");
   }
 
@@ -189,7 +206,8 @@ void handleFileList() {
   path.clear();
 
   // use HTTP/1.1 Chunked response to avoid building a huge temporary string
-  if (!server.chunkedResponseModeStart(200, "text/json")) {
+  if (!server.chunkedResponseModeStart(200, "text/json"))
+  {
     server.send(505, F("text/html"), F("HTTP1.1 required"));
     return;
   }
@@ -197,36 +215,47 @@ void handleFileList() {
   // use the same string for every line
   String output;
   output.reserve(64);
-  while (dir.next()) {
+  while (dir.next())
+  {
 #ifdef USE_SPIFFS
     String error = checkForUnsupportedPath(dir.fileName());
-    if (error.length() > 0) {
+    if (error.length() > 0)
+    {
       DBG_OUTPUT_PORT.println(String("Ignoring ") + error + dir.fileName());
       continue;
     }
 #endif
-    if (output.length()) {
+    if (output.length())
+    {
       // send string from previous iteration
       // as an HTTP chunk
       server.sendContent(output);
       output = ',';
-    } else {
+    }
+    else
+    {
       output = '[';
     }
 
     output += "{\"type\":\"";
-    if (dir.isDirectory()) {
+    if (dir.isDirectory())
+    {
       output += "dir";
-    } else {
+    }
+    else
+    {
       output += F("file\",\"size\":\"");
       output += dir.fileSize();
     }
 
     output += F("\",\"name\":\"");
     // Always return names without leading "/"
-    if (dir.fileName()[0] == '/') {
+    if (dir.fileName()[0] == '/')
+    {
       output += &(dir.fileName()[1]);
-    } else {
+    }
+    else
+    {
       output += dir.fileName();
     }
 
@@ -242,31 +271,40 @@ void handleFileList() {
 /*
    Read the given file from the filesystem and stream it back to the client
 */
-bool handleFileRead(String path) {
+bool handleFileRead(String path)
+{
   DBG_OUTPUT_PORT.println(String("handleFileRead: ") + path);
-  if (!fsOK) {
+  if (!fsOK)
+  {
     replyServerError(FPSTR(FS_INIT_ERROR));
     return true;
   }
 
-  if (path.endsWith("/")) {
+  if (path.endsWith("/"))
+  {
     path += "index.htm";
   }
 
   String contentType;
-  if (server.hasArg("download")) {
+  if (server.hasArg("download"))
+  {
     contentType = F("application/octet-stream");
-  } else {
+  }
+  else
+  {
     contentType = mime::getContentType(path);
   }
 
-  if (!fileSystem->exists(path)) {
+  if (!fileSystem->exists(path))
+  {
     // File not found, try gzip version
     path = path + ".gz";
   }
-  if (fileSystem->exists(path)) {
+  if (fileSystem->exists(path))
+  {
     File file = fileSystem->open(path, "r");
-    if (server.streamFile(file, contentType) != file.size()) {
+    if (server.streamFile(file, contentType) != file.size())
+    {
       DBG_OUTPUT_PORT.println("Sent less data than expected!");
     }
     file.close();
@@ -280,12 +318,17 @@ bool handleFileRead(String path) {
    As some FS (e.g. LittleFS) delete the parent folder when the last child has been removed,
    return the path of the closest parent still existing
 */
-String lastExistingParent(String path) {
-  while (!path.isEmpty() && !fileSystem->exists(path)) {
-    if (path.lastIndexOf('/') > 0) {
+String lastExistingParent(String path)
+{
+  while (!path.isEmpty() && !fileSystem->exists(path))
+  {
+    if (path.lastIndexOf('/') > 0)
+    {
       path = path.substring(0, path.lastIndexOf('/'));
-    } else {
-      path = String(); // No slash => the top folder does not exist
+    }
+    else
+    {
+      path = String();  // No slash => the top folder does not exist
     }
   }
   DBG_OUTPUT_PORT.println(String("Last existing parent: ") + path);
@@ -303,71 +346,93 @@ String lastExistingParent(String path) {
    Rename folder  | parent of source folder
    Move folder    | parent of source folder, or remaining ancestor
 */
-void handleFileCreate() {
-  if (!fsOK) {
+void handleFileCreate()
+{
+  if (!fsOK)
+  {
     return replyServerError(FPSTR(FS_INIT_ERROR));
   }
 
   String path = server.arg("path");
-  if (path.isEmpty()) {
+  if (path.isEmpty())
+  {
     return replyBadRequest(F("PATH ARG MISSING"));
   }
 
 #ifdef USE_SPIFFS
-  if (checkForUnsupportedPath(path).length() > 0) {
+  if (checkForUnsupportedPath(path).length() > 0)
+  {
     return replyServerError(F("INVALID FILENAME"));
   }
 #endif
 
-  if (path == "/") {
+  if (path == "/")
+  {
     return replyBadRequest("BAD PATH");
   }
-  if (fileSystem->exists(path)) {
+  if (fileSystem->exists(path))
+  {
     return replyBadRequest(F("PATH FILE EXISTS"));
   }
 
   String src = server.arg("src");
-  if (src.isEmpty()) {
+  if (src.isEmpty())
+  {
     // No source specified: creation
     DBG_OUTPUT_PORT.println(String("handleFileCreate: ") + path);
-    if (path.endsWith("/")) {
+    if (path.endsWith("/"))
+    {
       // Create a folder
       path.remove(path.length() - 1);
-      if (!fileSystem->mkdir(path)) {
+      if (!fileSystem->mkdir(path))
+      {
         return replyServerError(F("MKDIR FAILED"));
       }
-    } else {
+    }
+    else
+    {
       // Create a file
       File file = fileSystem->open(path, "w");
-      if (file) {
+      if (file)
+      {
         file.write((const char*)0);
         file.close();
-      } else {
+      }
+      else
+      {
         return replyServerError(F("CREATE FAILED"));
       }
     }
-    if (path.lastIndexOf('/') > -1) {
+    if (path.lastIndexOf('/') > -1)
+    {
       path = path.substring(0, path.lastIndexOf('/'));
     }
     replyOKWithMsg(path);
-  } else {
+  }
+  else
+  {
     // Source specified: rename
-    if (src == "/") {
+    if (src == "/")
+    {
       return replyBadRequest("BAD SRC");
     }
-    if (!fileSystem->exists(src)) {
+    if (!fileSystem->exists(src))
+    {
       return replyBadRequest(F("SRC FILE NOT FOUND"));
     }
 
     DBG_OUTPUT_PORT.println(String("handleFileCreate: ") + path + " from " + src);
 
-    if (path.endsWith("/")) {
+    if (path.endsWith("/"))
+    {
       path.remove(path.length() - 1);
     }
-    if (src.endsWith("/")) {
+    if (src.endsWith("/"))
+    {
       src.remove(src.length() - 1);
     }
-    if (!fileSystem->rename(src, path)) {
+    if (!fileSystem->rename(src, path))
+    {
       return replyServerError(F("RENAME FAILED"));
     }
     replyOKWithMsg(lastExistingParent(src));
@@ -383,13 +448,15 @@ void handleFileCreate() {
    This use is just for demonstration purpose, and FSBrowser might crash in case of deeply nested filesystems.
    Please don't do this on a production system.
 */
-void deleteRecursive(String path) {
-  File file = fileSystem->open(path, "r");
+void deleteRecursive(String path)
+{
+  File file  = fileSystem->open(path, "r");
   bool isDir = file.isDirectory();
   file.close();
 
   // If it's a plain file, delete it
-  if (!isDir) {
+  if (!isDir)
+  {
     fileSystem->remove(path);
     return;
   }
@@ -397,7 +464,8 @@ void deleteRecursive(String path) {
   // Otherwise delete its contents first
   Dir dir = fileSystem->openDir(path);
 
-  while (dir.next()) {
+  while (dir.next())
+  {
     deleteRecursive(path + '/' + dir.fileName());
   }
 
@@ -412,18 +480,22 @@ void deleteRecursive(String path) {
    Delete file    | parent of deleted file, or remaining ancestor
    Delete folder  | parent of deleted folder, or remaining ancestor
 */
-void handleFileDelete() {
-  if (!fsOK) {
+void handleFileDelete()
+{
+  if (!fsOK)
+  {
     return replyServerError(FPSTR(FS_INIT_ERROR));
   }
 
   String path = server.arg(0);
-  if (path.isEmpty() || path == "/") {
+  if (path.isEmpty() || path == "/")
+  {
     return replyBadRequest("BAD PATH");
   }
 
   DBG_OUTPUT_PORT.println(String("handleFileDelete: ") + path);
-  if (!fileSystem->exists(path)) {
+  if (!fileSystem->exists(path))
+  {
     return replyNotFound(FPSTR(FILE_NOT_FOUND));
   }
   deleteRecursive(path);
@@ -434,36 +506,49 @@ void handleFileDelete() {
 /*
    Handle a file upload request
 */
-void handleFileUpload() {
-  if (!fsOK) {
+void handleFileUpload()
+{
+  if (!fsOK)
+  {
     return replyServerError(FPSTR(FS_INIT_ERROR));
   }
-  if (server.uri() != "/edit") {
+  if (server.uri() != "/edit")
+  {
     return;
   }
   HTTPUpload& upload = server.upload();
-  if (upload.status == UPLOAD_FILE_START) {
+  if (upload.status == UPLOAD_FILE_START)
+  {
     String filename = upload.filename;
     // Make sure paths always start with "/"
-    if (!filename.startsWith("/")) {
+    if (!filename.startsWith("/"))
+    {
       filename = "/" + filename;
     }
     DBG_OUTPUT_PORT.println(String("handleFileUpload Name: ") + filename);
     uploadFile = fileSystem->open(filename, "w");
-    if (!uploadFile) {
+    if (!uploadFile)
+    {
       return replyServerError(F("CREATE FAILED"));
     }
     DBG_OUTPUT_PORT.println(String("Upload: START, filename: ") + filename);
-  } else if (upload.status == UPLOAD_FILE_WRITE) {
-    if (uploadFile) {
+  }
+  else if (upload.status == UPLOAD_FILE_WRITE)
+  {
+    if (uploadFile)
+    {
       size_t bytesWritten = uploadFile.write(upload.buf, upload.currentSize);
-      if (bytesWritten != upload.currentSize) {
+      if (bytesWritten != upload.currentSize)
+      {
         return replyServerError(F("WRITE FAILED"));
       }
     }
     DBG_OUTPUT_PORT.println(String("Upload: WRITE, Bytes: ") + upload.currentSize);
-  } else if (upload.status == UPLOAD_FILE_END) {
-    if (uploadFile) {
+  }
+  else if (upload.status == UPLOAD_FILE_END)
+  {
+    if (uploadFile)
+    {
       uploadFile.close();
     }
     DBG_OUTPUT_PORT.println(String("Upload: END, Size: ") + upload.totalSize);
@@ -475,14 +560,17 @@ void handleFileUpload() {
    First try to find and return the requested file from the filesystem,
    and if it fails, return a 404 page with debug information
 */
-void handleNotFound() {
-  if (!fsOK) {
+void handleNotFound()
+{
+  if (!fsOK)
+  {
     return replyServerError(FPSTR(FS_INIT_ERROR));
   }
 
-  String uri = ESP8266WebServer::urlDecode(server.uri()); // required to read paths with blanks
+  String uri = ESP8266WebServer::urlDecode(server.uri());  // required to read paths with blanks
 
-  if (handleFileRead(uri)) {
+  if (handleFileRead(uri))
+  {
     return;
   }
 
@@ -496,7 +584,8 @@ void handleNotFound() {
   message += F("\nArguments: ");
   message += server.args();
   message += '\n';
-  for (uint8_t i = 0; i < server.args(); i++) {
+  for (uint8_t i = 0; i < server.args(); i++)
+  {
     message += F(" NAME:");
     message += server.argName(i);
     message += F("\n VALUE:");
@@ -517,8 +606,10 @@ void handleNotFound() {
    embedded in the program code.
    Otherwise, fails with a 404 page with debug information
 */
-void handleGetEdit() {
-  if (handleFileRead(F("/edit/index.htm"))) {
+void handleGetEdit()
+{
+  if (handleFileRead(F("/edit/index.htm")))
+  {
     return;
   }
 
@@ -530,7 +621,8 @@ void handleGetEdit() {
 #endif
 }
 
-void setup(void) {
+void setup(void)
+{
   ////////////////////////////////
   // SERIAL INIT
   DBG_OUTPUT_PORT.begin(115200);
@@ -549,11 +641,13 @@ void setup(void) {
   // Debug: dump on console contents of filesystem with no filter and check filenames validity
   Dir dir = fileSystem->openDir("");
   DBG_OUTPUT_PORT.println(F("List of files at root of filesystem:"));
-  while (dir.next()) {
-    String error = checkForUnsupportedPath(dir.fileName());
+  while (dir.next())
+  {
+    String error    = checkForUnsupportedPath(dir.fileName());
     String fileInfo = dir.fileName() + (dir.isDirectory() ? " [DIR]" : String(" (") + dir.fileSize() + "b)");
     DBG_OUTPUT_PORT.println(error + fileInfo);
-    if (error.length() > 0) {
+    if (error.length() > 0)
+    {
       unsupportedFiles += error + fileInfo + '\n';
     }
   }
@@ -570,7 +664,8 @@ void setup(void) {
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     DBG_OUTPUT_PORT.print(".");
   }
@@ -580,7 +675,8 @@ void setup(void) {
 
   ////////////////////////////////
   // MDNS INIT
-  if (MDNS.begin(host)) {
+  if (MDNS.begin(host))
+  {
     MDNS.addService("http", "tcp", 80);
     DBG_OUTPUT_PORT.print(F("Open http://"));
     DBG_OUTPUT_PORT.print(host);
@@ -619,7 +715,8 @@ void setup(void) {
   DBG_OUTPUT_PORT.println("HTTP server started");
 }
 
-void loop(void) {
+void loop(void)
+{
   server.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266WebServer/examples/Graph/Graph.ino b/libraries/ESP8266WebServer/examples/Graph/Graph.ino
index d4915f201f..5ce29247ed 100644
--- a/libraries/ESP8266WebServer/examples/Graph/Graph.ino
+++ b/libraries/ESP8266WebServer/examples/Graph/Graph.ino
@@ -38,15 +38,15 @@
 
 #if defined USE_SPIFFS
 #include <FS.h>
-FS* fileSystem = &SPIFFS;
-SPIFFSConfig fileSystemConfig = SPIFFSConfig();
+FS*           fileSystem       = &SPIFFS;
+SPIFFSConfig  fileSystemConfig = SPIFFSConfig();
 #elif defined USE_LITTLEFS
 #include <LittleFS.h>
-FS* fileSystem = &LittleFS;
+FS*            fileSystem       = &LittleFS;
 LittleFSConfig fileSystemConfig = LittleFSConfig();
 #elif defined USE_SDFS
 #include <SDFS.h>
-FS* fileSystem = &SDFS;
+FS*        fileSystem       = &SDFS;
 SDFSConfig fileSystemConfig = SDFSConfig();
 // fileSystemConfig.setCSPin(chipSelectPin);
 #else
@@ -63,39 +63,44 @@ SDFSConfig fileSystemConfig = SDFSConfig();
 // Indicate which digital I/Os should be displayed on the chart.
 // From GPIO16 to GPIO0, a '1' means the corresponding GPIO will be shown
 // e.g. 0b11111000000111111
-unsigned int gpioMask;
+unsigned int      gpioMask;
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
-const char* host = "graph";
+const char*       ssid     = STASSID;
+const char*       password = STAPSK;
+const char*       host     = "graph";
 
-ESP8266WebServer server(80);
+ESP8266WebServer  server(80);
 
-static const char TEXT_PLAIN[] PROGMEM = "text/plain";
-static const char FS_INIT_ERROR[] PROGMEM = "FS INIT ERROR";
+static const char TEXT_PLAIN[] PROGMEM     = "text/plain";
+static const char FS_INIT_ERROR[] PROGMEM  = "FS INIT ERROR";
 static const char FILE_NOT_FOUND[] PROGMEM = "FileNotFound";
 
 ////////////////////////////////
 // Utils to return HTTP codes
 
-void replyOK() {
+void              replyOK()
+{
   server.send(200, FPSTR(TEXT_PLAIN), "");
 }
 
-void replyOKWithMsg(String msg) {
+void replyOKWithMsg(String msg)
+{
   server.send(200, FPSTR(TEXT_PLAIN), msg);
 }
 
-void replyNotFound(String msg) {
+void replyNotFound(String msg)
+{
   server.send(404, FPSTR(TEXT_PLAIN), msg);
 }
 
-void replyBadRequest(String msg) {
+void replyBadRequest(String msg)
+{
   DBG_OUTPUT_PORT.println(msg);
   server.send(400, FPSTR(TEXT_PLAIN), msg + "\r\n");
 }
 
-void replyServerError(String msg) {
+void replyServerError(String msg)
+{
   DBG_OUTPUT_PORT.println(msg);
   server.send(500, FPSTR(TEXT_PLAIN), msg + "\r\n");
 }
@@ -106,22 +111,27 @@ void replyServerError(String msg) {
 /*
    Read the given file from the filesystem and stream it back to the client
 */
-bool handleFileRead(String path) {
+bool handleFileRead(String path)
+{
   DBG_OUTPUT_PORT.println(String("handleFileRead: ") + path);
 
-  if (path.endsWith("/")) {
+  if (path.endsWith("/"))
+  {
     path += "index.htm";
   }
 
   String contentType = mime::getContentType(path);
 
-  if (!fileSystem->exists(path)) {
+  if (!fileSystem->exists(path))
+  {
     // File not found, try gzip version
     path = path + ".gz";
   }
-  if (fileSystem->exists(path)) {
+  if (fileSystem->exists(path))
+  {
     File file = fileSystem->open(path, "r");
-    if (server.streamFile(file, contentType) != file.size()) {
+    if (server.streamFile(file, contentType) != file.size())
+    {
       DBG_OUTPUT_PORT.println("Sent less data than expected!");
     }
     file.close();
@@ -136,10 +146,12 @@ bool handleFileRead(String path) {
    First try to find and return the requested file from the filesystem,
    and if it fails, return a 404 page with debug information
 */
-void handleNotFound() {
-  String uri = ESP8266WebServer::urlDecode(server.uri()); // required to read paths with blanks
+void handleNotFound()
+{
+  String uri = ESP8266WebServer::urlDecode(server.uri());  // required to read paths with blanks
 
-  if (handleFileRead(uri)) {
+  if (handleFileRead(uri))
+  {
     return;
   }
 
@@ -153,7 +165,8 @@ void handleNotFound() {
   message += F("\nArguments: ");
   message += server.args();
   message += '\n';
-  for (uint8_t i = 0; i < server.args(); i++) {
+  for (uint8_t i = 0; i < server.args(); i++)
+  {
     message += F(" NAME:");
     message += server.argName(i);
     message += F("\n VALUE:");
@@ -168,7 +181,8 @@ void handleNotFound() {
   return replyNotFound(message);
 }
 
-void setup(void) {
+void setup(void)
+{
   ////////////////////////////////
   // SERIAL INIT
   DBG_OUTPUT_PORT.begin(115200);
@@ -196,7 +210,8 @@ void setup(void) {
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     DBG_OUTPUT_PORT.print(".");
   }
@@ -206,7 +221,8 @@ void setup(void) {
 
   ////////////////////////////////
   // MDNS INIT
-  if (MDNS.begin(host)) {
+  if (MDNS.begin(host))
+  {
     MDNS.addService("http", "tcp", 80);
     DBG_OUTPUT_PORT.print(F("Open http://"));
     DBG_OUTPUT_PORT.print(host);
@@ -217,22 +233,23 @@ void setup(void) {
   // WEB SERVER INIT
 
   //get heap status, analog input value and all GPIO statuses in one json call
-  server.on("/espData", HTTP_GET, []() {
-    String json;
-    json.reserve(88);
-    json = "{\"time\":";
-    json += millis();
-    json += ", \"heap\":";
-    json += ESP.getFreeHeap();
-    json += ", \"analog\":";
-    json += analogRead(A0);
-    json += ", \"gpioMask\":";
-    json += gpioMask;
-    json += ", \"gpioData\":";
-    json += (uint32_t)(((GPI | GPO) & 0xFFFF) | ((GP16I & 0x01) << 16));
-    json += "}";
-    server.send(200, "text/json", json);
-  });
+  server.on("/espData", HTTP_GET, []()
+            {
+              String json;
+              json.reserve(88);
+              json = "{\"time\":";
+              json += millis();
+              json += ", \"heap\":";
+              json += ESP.getFreeHeap();
+              json += ", \"analog\":";
+              json += analogRead(A0);
+              json += ", \"gpioMask\":";
+              json += gpioMask;
+              json += ", \"gpioData\":";
+              json += (uint32_t)(((GPI | GPO) & 0xFFFF) | ((GP16I & 0x01) << 16));
+              json += "}";
+              server.send(200, "text/json", json);
+            });
 
   // Default handler for all URIs not defined above
   // Use it to read files from filesystem
@@ -249,40 +266,48 @@ void setup(void) {
 }
 
 // Return default GPIO mask, that is all I/Os except SD card ones
-unsigned int defaultMask() {
+unsigned int defaultMask()
+{
   unsigned int mask = 0b11111111111111111;
-  for (auto pin = 0; pin <= 16; pin++) {
-    if (isFlashInterfacePin(pin)) {
+  for (auto pin = 0; pin <= 16; pin++)
+  {
+    if (isFlashInterfacePin(pin))
+    {
       mask &= ~(1 << pin);
     }
   }
   return mask;
 }
 
-int rgbMode = 1; // 0=off - 1=auto - 2=manual
-int rgbValue = 0;
+int                                rgbMode  = 1;  // 0=off - 1=auto - 2=manual
+int                                rgbValue = 0;
 esp8266::polledTimeout::periodicMs timeToChange(1000);
-bool modeChangeRequested = false;
+bool                               modeChangeRequested = false;
 
-void loop(void) {
+void                               loop(void)
+{
   server.handleClient();
   MDNS.update();
 
-  if (digitalRead(4) == 0) {
+  if (digitalRead(4) == 0)
+  {
     // button pressed
     modeChangeRequested = true;
   }
 
   // see if one second has passed since last change, otherwise stop here
-  if (!timeToChange) {
+  if (!timeToChange)
+  {
     return;
   }
 
   // see if a mode change was requested
-  if (modeChangeRequested) {
+  if (modeChangeRequested)
+  {
     // increment mode (reset after 2)
     rgbMode++;
-    if (rgbMode > 2) {
+    if (rgbMode > 2)
+    {
       rgbMode = 0;
     }
 
@@ -290,12 +315,13 @@ void loop(void) {
   }
 
   // act according to mode
-  switch (rgbMode) {
-    case 0: // off
+  switch (rgbMode)
+  {
+    case 0:  // off
       gpioMask = defaultMask();
-      gpioMask &= ~(1 << 12); // Hide GPIO 12
-      gpioMask &= ~(1 << 13); // Hide GPIO 13
-      gpioMask &= ~(1 << 15); // Hide GPIO 15
+      gpioMask &= ~(1 << 12);  // Hide GPIO 12
+      gpioMask &= ~(1 << 13);  // Hide GPIO 13
+      gpioMask &= ~(1 << 15);  // Hide GPIO 15
 
       // reset outputs
       digitalWrite(12, 0);
@@ -303,12 +329,13 @@ void loop(void) {
       digitalWrite(15, 0);
       break;
 
-    case 1: // auto
+    case 1:  // auto
       gpioMask = defaultMask();
 
       // increment value (reset after 7)
       rgbValue++;
-      if (rgbValue > 7) {
+      if (rgbValue > 7)
+      {
         rgbValue = 0;
       }
 
@@ -318,7 +345,7 @@ void loop(void) {
       digitalWrite(15, rgbValue & 0b100);
       break;
 
-    case 2: // manual
+    case 2:  // manual
       gpioMask = defaultMask();
 
       // keep outputs unchanged
diff --git a/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino b/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
index 68096d29ad..b8fcaef016 100644
--- a/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
+++ b/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
@@ -8,20 +8,22 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*      ssid     = STASSID;
+const char*      password = STAPSK;
 
 ESP8266WebServer server(80);
 
-const int led = 13;
+const int        led = 13;
 
-void handleRoot() {
+void             handleRoot()
+{
   digitalWrite(led, 1);
   server.send(200, "text/plain", "hello from esp8266!\r\n");
   digitalWrite(led, 0);
 }
 
-void handleNotFound() {
+void handleNotFound()
+{
   digitalWrite(led, 1);
   String message = "File Not Found\n\n";
   message += "URI: ";
@@ -31,14 +33,16 @@ void handleNotFound() {
   message += "\nArguments: ";
   message += server.args();
   message += "\n";
-  for (uint8_t i = 0; i < server.args(); i++) {
+  for (uint8_t i = 0; i < server.args(); i++)
+  {
     message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
   }
   server.send(404, "text/plain", message);
   digitalWrite(led, 0);
 }
 
-void setup(void) {
+void setup(void)
+{
   pinMode(led, OUTPUT);
   digitalWrite(led, 0);
   Serial.begin(115200);
@@ -47,7 +51,8 @@ void setup(void) {
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -57,91 +62,99 @@ void setup(void) {
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-  if (MDNS.begin("esp8266")) {
+  if (MDNS.begin("esp8266"))
+  {
     Serial.println("MDNS responder started");
   }
 
   server.on("/", handleRoot);
 
-  server.on("/inline", []() {
-    server.send(200, "text/plain", "this works as well");
-  });
-
-  server.on("/gif", []() {
-    static const uint8_t gif[] PROGMEM = {
-      0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x10, 0x00, 0x10, 0x00, 0x80, 0x01,
-      0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00,
-      0x10, 0x00, 0x10, 0x00, 0x00, 0x02, 0x19, 0x8c, 0x8f, 0xa9, 0xcb, 0x9d,
-      0x00, 0x5f, 0x74, 0xb4, 0x56, 0xb0, 0xb0, 0xd2, 0xf2, 0x35, 0x1e, 0x4c,
-      0x0c, 0x24, 0x5a, 0xe6, 0x89, 0xa6, 0x4d, 0x01, 0x00, 0x3b
-    };
-    char gif_colored[sizeof(gif)];
-    memcpy_P(gif_colored, gif, sizeof(gif));
-    // Set the background to a random set of colors
-    gif_colored[16] = millis() % 256;
-    gif_colored[17] = millis() % 256;
-    gif_colored[18] = millis() % 256;
-    server.send(200, "image/gif", gif_colored, sizeof(gif_colored));
-  });
+  server.on("/inline", []()
+            { server.send(200, "text/plain", "this works as well"); });
+
+  server.on("/gif", []()
+            {
+              static const uint8_t gif[] PROGMEM = {
+                0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x10, 0x00, 0x10, 0x00, 0x80, 0x01,
+                0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00,
+                0x10, 0x00, 0x10, 0x00, 0x00, 0x02, 0x19, 0x8c, 0x8f, 0xa9, 0xcb, 0x9d,
+                0x00, 0x5f, 0x74, 0xb4, 0x56, 0xb0, 0xb0, 0xd2, 0xf2, 0x35, 0x1e, 0x4c,
+                0x0c, 0x24, 0x5a, 0xe6, 0x89, 0xa6, 0x4d, 0x01, 0x00, 0x3b
+              };
+              char gif_colored[sizeof(gif)];
+              memcpy_P(gif_colored, gif, sizeof(gif));
+              // Set the background to a random set of colors
+              gif_colored[16] = millis() % 256;
+              gif_colored[17] = millis() % 256;
+              gif_colored[18] = millis() % 256;
+              server.send(200, "image/gif", gif_colored, sizeof(gif_colored));
+            });
 
   server.onNotFound(handleNotFound);
 
   /////////////////////////////////////////////////////////
   // Hook examples
 
-  server.addHook([](const String& method, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction contentType) {
-    (void)method; // GET, PUT, ...
-    (void)url; // example: /root/myfile.html
-    (void)client; // the webserver tcp client connection
-    (void)contentType; // contentType(".html") => "text/html"
-    Serial.printf("A useless web hook has passed\n");
-    Serial.printf("(this hook is in 0x%08x area (401x=IRAM 402x=FLASH))\n", esp_get_program_counter());
-    return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
-  });
-
-  server.addHook([](const String&, const String& url, WiFiClient*, ESP8266WebServer::ContentTypeFunction) {
-    if (url.startsWith("/fail")) {
-      Serial.printf("An always failing web hook has been triggered\n");
-      return ESP8266WebServer::CLIENT_MUST_STOP;
-    }
-    return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
-  });
-
-  server.addHook([](const String&, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction) {
-    if (url.startsWith("/dump")) {
-      Serial.printf("The dumper web hook is on the run\n");
+  server.addHook([](const String& method, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction contentType)
+                 {
+                   (void)method;       // GET, PUT, ...
+                   (void)url;          // example: /root/myfile.html
+                   (void)client;       // the webserver tcp client connection
+                   (void)contentType;  // contentType(".html") => "text/html"
+                   Serial.printf("A useless web hook has passed\n");
+                   Serial.printf("(this hook is in 0x%08x area (401x=IRAM 402x=FLASH))\n", esp_get_program_counter());
+                   return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
+                 });
+
+  server.addHook([](const String&, const String& url, WiFiClient*, ESP8266WebServer::ContentTypeFunction)
+                 {
+                   if (url.startsWith("/fail"))
+                   {
+                     Serial.printf("An always failing web hook has been triggered\n");
+                     return ESP8266WebServer::CLIENT_MUST_STOP;
+                   }
+                   return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
+                 });
+
+  server.addHook([](const String&, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction)
+                 {
+                   if (url.startsWith("/dump"))
+                   {
+                     Serial.printf("The dumper web hook is on the run\n");
 
       // Here the request is not interpreted, so we cannot for sure
       // swallow the exact amount matching the full request+content,
       // hence the tcp connection cannot be handled anymore by the
       // webserver.
 #ifdef STREAMSEND_API
-      // we are lucky
-      client->sendAll(Serial, 500);
+                     // we are lucky
+                     client->sendAll(Serial, 500);
 #else
-      auto last = millis();
-      while ((millis() - last) < 500) {
-        char buf[32];
-        size_t len = client->read((uint8_t*)buf, sizeof(buf));
-        if (len > 0) {
-          Serial.printf("(<%d> chars)", (int)len);
-          Serial.write(buf, len);
-          last = millis();
-        }
-      }
+                     auto last = millis();
+                     while ((millis() - last) < 500)
+                     {
+                       char   buf[32];
+                       size_t len = client->read((uint8_t*)buf, sizeof(buf));
+                       if (len > 0)
+                       {
+                         Serial.printf("(<%d> chars)", (int)len);
+                         Serial.write(buf, len);
+                         last = millis();
+                       }
+                     }
 #endif
-      // Two choices: return MUST STOP and webserver will close it
-      //                       (we already have the example with '/fail' hook)
-      // or                  IS GIVEN and webserver will forget it
-      // trying with IS GIVEN and storing it on a dumb WiFiClient.
-      // check the client connection: it should not immediately be closed
-      // (make another '/dump' one to close the first)
-      Serial.printf("\nTelling server to forget this connection\n");
-      static WiFiClient forgetme = *client; // stop previous one if present and transfer client refcounter
-      return ESP8266WebServer::CLIENT_IS_GIVEN;
-    }
-    return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
-  });
+                     // Two choices: return MUST STOP and webserver will close it
+                     //                       (we already have the example with '/fail' hook)
+                     // or                  IS GIVEN and webserver will forget it
+                     // trying with IS GIVEN and storing it on a dumb WiFiClient.
+                     // check the client connection: it should not immediately be closed
+                     // (make another '/dump' one to close the first)
+                     Serial.printf("\nTelling server to forget this connection\n");
+                     static WiFiClient forgetme = *client;  // stop previous one if present and transfer client refcounter
+                     return ESP8266WebServer::CLIENT_IS_GIVEN;
+                   }
+                   return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
+                 });
 
   // Hook examples
   /////////////////////////////////////////////////////////
@@ -150,7 +163,8 @@ void setup(void) {
   Serial.println("HTTP server started");
 }
 
-void loop(void) {
+void loop(void)
+{
   server.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino b/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino
index 18d397249b..fb531a4d6f 100644
--- a/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino
+++ b/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino
@@ -21,13 +21,13 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*                     ssid     = STASSID;
+const char*                     password = STAPSK;
 
 BearSSL::ESP8266WebServerSecure server(443);
-BearSSL::ServerSessions serverCache(5);
+BearSSL::ServerSessions         serverCache(5);
 
-static const char serverCert[] PROGMEM = R"EOF(
+static const char               serverCert[] PROGMEM = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIDSzCCAjMCCQD2ahcfZAwXxDANBgkqhkiG9w0BAQsFADCBiTELMAkGA1UEBhMC
 VVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU9yYW5nZSBDb3VudHkx
@@ -50,7 +50,7 @@ JfUvYadSYxh3nblvA4OL+iEZiW8NE3hbW6WPXxvS7Euge0uWMPc4uEcnsE0ZVG3m
 -----END CERTIFICATE-----
 )EOF";
 
-static const char serverKey[] PROGMEM = R"EOF(
+static const char               serverKey[] PROGMEM  = R"EOF(
 -----BEGIN RSA PRIVATE KEY-----
 MIIEpQIBAAKCAQEA9UoHBtn4oNKXjRgIOQ/rLxK/iI0a8Q5mDxhfuwa9//FkftSI
 IFY8UhGk2YNJpnfKOyYWqbqwuJhIZJ2sEIWp2301OnavuGBrpKOgBJJljgH2l/4Z
@@ -80,15 +80,17 @@ gz5JWYhbD6c38khSzJb0pNXCo3EuYAVa36kDM96k1BtWuhRS10Q1VXk=
 -----END RSA PRIVATE KEY-----
 )EOF";
 
-const int led = 13;
+const int                       led                  = 13;
 
-void handleRoot() {
+void                            handleRoot()
+{
   digitalWrite(led, 1);
   server.send(200, "text/plain", "Hello from esp8266 over HTTPS!");
   digitalWrite(led, 0);
 }
 
-void handleNotFound() {
+void handleNotFound()
+{
   digitalWrite(led, 1);
   String message = "File Not Found\n\n";
   message += "URI: ";
@@ -98,14 +100,16 @@ void handleNotFound() {
   message += "\nArguments: ";
   message += server.args();
   message += "\n";
-  for (uint8_t i = 0; i < server.args(); i++) {
+  for (uint8_t i = 0; i < server.args(); i++)
+  {
     message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
   }
   server.send(404, "text/plain", message);
   digitalWrite(led, 0);
 }
 
-void setup(void) {
+void setup(void)
+{
   pinMode(led, OUTPUT);
   digitalWrite(led, 0);
   Serial.begin(115200);
@@ -113,7 +117,8 @@ void setup(void) {
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -126,7 +131,8 @@ void setup(void) {
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-  if (MDNS.begin("esp8266")) {
+  if (MDNS.begin("esp8266"))
+  {
     Serial.println("MDNS responder started");
   }
 
@@ -137,9 +143,8 @@ void setup(void) {
 
   server.on("/", handleRoot);
 
-  server.on("/inline", []() {
-    server.send(200, "text/plain", "this works as well");
-  });
+  server.on("/inline", []()
+            { server.send(200, "text/plain", "this works as well"); });
 
   server.onNotFound(handleNotFound);
 
@@ -149,19 +154,24 @@ void setup(void) {
 
 extern "C" void stack_thunk_dump_stack();
 
-void processKey(Print& out, int hotKey) {
-  switch (hotKey) {
-    case 'd': {
+void            processKey(Print& out, int hotKey)
+{
+  switch (hotKey)
+  {
+    case 'd':
+    {
       HeapSelectDram ephemeral;
       umm_info(NULL, true);
       break;
     }
-    case 'i': {
+    case 'i':
+    {
       HeapSelectIram ephemeral;
       umm_info(NULL, true);
       break;
     }
-    case 'h': {
+    case 'h':
+    {
       {
         HeapSelectIram ephemeral;
         Serial.printf(PSTR("IRAM ESP.getFreeHeap:  %u\n"), ESP.getFreeHeap());
@@ -209,10 +219,12 @@ void processKey(Print& out, int hotKey) {
   }
 }
 
-void loop(void) {
+void loop(void)
+{
   server.handleClient();
   MDNS.update();
-  if (Serial.available() > 0) {
+  if (Serial.available() > 0)
+  {
     int hotKey = Serial.read();
     processKey(Serial, hotKey);
   }
diff --git a/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino b/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
index a3a01d4ced..23813a4159 100644
--- a/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
@@ -14,43 +14,46 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*      ssid     = STASSID;
+const char*      password = STAPSK;
 
 ESP8266WebServer server(80);
 
-const char* www_username = "admin";
-const char* www_password = "esp8266";
+const char*      www_username     = "admin";
+const char*      www_password     = "esp8266";
 // allows you to set the realm of authentication Default:"Login Required"
-const char* www_realm = "Custom Auth Realm";
+const char*      www_realm        = "Custom Auth Realm";
 // the Content of the HTML response in case of Unautherized Access Default:empty
-String authFailResponse = "Authentication Failed";
+String           authFailResponse = "Authentication Failed";
 
-void setup() {
+void             setup()
+{
   Serial.begin(115200);
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
-  if (WiFi.waitForConnectResult() != WL_CONNECTED) {
+  if (WiFi.waitForConnectResult() != WL_CONNECTED)
+  {
     Serial.println("WiFi Connect Failed! Rebooting...");
     delay(1000);
     ESP.restart();
   }
   ArduinoOTA.begin();
 
-  server.on("/", []() {
-    if (!server.authenticate(www_username, www_password))
-    //Basic Auth Method with Custom realm and Failure Response
-    //return server.requestAuthentication(BASIC_AUTH, www_realm, authFailResponse);
-    //Digest Auth Method with realm="Login Required" and empty Failure Response
-    //return server.requestAuthentication(DIGEST_AUTH);
-    //Digest Auth Method with Custom realm and empty Failure Response
-    //return server.requestAuthentication(DIGEST_AUTH, www_realm);
-    //Digest Auth Method with Custom realm and Failure Response
-    {
-      return server.requestAuthentication(DIGEST_AUTH, www_realm, authFailResponse);
-    }
-    server.send(200, "text/plain", "Login OK");
-  });
+  server.on("/", []()
+            {
+              if (!server.authenticate(www_username, www_password))
+              //Basic Auth Method with Custom realm and Failure Response
+              //return server.requestAuthentication(BASIC_AUTH, www_realm, authFailResponse);
+              //Digest Auth Method with realm="Login Required" and empty Failure Response
+              //return server.requestAuthentication(DIGEST_AUTH);
+              //Digest Auth Method with Custom realm and empty Failure Response
+              //return server.requestAuthentication(DIGEST_AUTH, www_realm);
+              //Digest Auth Method with Custom realm and Failure Response
+              {
+                return server.requestAuthentication(DIGEST_AUTH, www_realm, authFailResponse);
+              }
+              server.send(200, "text/plain", "Login OK");
+            });
   server.begin();
 
   Serial.print("Open http://");
@@ -58,7 +61,8 @@ void setup() {
   Serial.println("/ in your browser to see it working");
 }
 
-void loop() {
+void loop()
+{
   ArduinoOTA.handle();
   server.handleClient();
 }
diff --git a/libraries/ESP8266WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino b/libraries/ESP8266WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino
index b7d5c16f41..7716fa4dca 100644
--- a/libraries/ESP8266WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino
@@ -8,31 +8,35 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*      ssid     = STASSID;
+const char*      password = STAPSK;
 
 ESP8266WebServer server(80);
 
-const char* www_username = "admin";
-const char* www_password = "esp8266";
+const char*      www_username = "admin";
+const char*      www_password = "esp8266";
 
-void setup() {
+void             setup()
+{
   Serial.begin(115200);
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
-  if (WiFi.waitForConnectResult() != WL_CONNECTED) {
+  if (WiFi.waitForConnectResult() != WL_CONNECTED)
+  {
     Serial.println("WiFi Connect Failed! Rebooting...");
     delay(1000);
     ESP.restart();
   }
   ArduinoOTA.begin();
 
-  server.on("/", []() {
-    if (!server.authenticate(www_username, www_password)) {
-      return server.requestAuthentication();
-    }
-    server.send(200, "text/plain", "Login OK");
-  });
+  server.on("/", []()
+            {
+              if (!server.authenticate(www_username, www_password))
+              {
+                return server.requestAuthentication();
+              }
+              server.send(200, "text/plain", "Login OK");
+            });
   server.begin();
 
   Serial.print("Open http://");
@@ -40,7 +44,8 @@ void setup() {
   Serial.println("/ in your browser to see it working");
 }
 
-void loop() {
+void loop()
+{
   ArduinoOTA.handle();
   server.handleClient();
 }
diff --git a/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino b/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
index 2a9657e2fc..6bdb235db1 100644
--- a/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
@@ -21,16 +21,16 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* wifi_pw = STAPSK;
+const char*            ssid                 = STASSID;
+const char*            wifi_pw              = STAPSK;
 
-const String file_credentials = R"(/credentials.txt)"; // LittleFS file name for the saved credentials
-const String change_creds = "changecreds"; // Address for a credential change
+const String           file_credentials     = R"(/credentials.txt)";  // LittleFS file name for the saved credentials
+const String           change_creds         = "changecreds";          // Address for a credential change
 
 //The ESP8266WebServerSecure requires an encryption certificate and matching key.
 //These can generated with the bash script available in the ESP8266 Arduino repository.
 //These values can be used for testing but are available publicly so should not be used in production.
-static const char serverCert[] PROGMEM = R"EOF(
+static const char      serverCert[] PROGMEM = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIDSzCCAjMCCQD2ahcfZAwXxDANBgkqhkiG9w0BAQsFADCBiTELMAkGA1UEBhMC
 VVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU9yYW5nZSBDb3VudHkx
@@ -52,7 +52,7 @@ JfUvYadSYxh3nblvA4OL+iEZiW8NE3hbW6WPXxvS7Euge0uWMPc4uEcnsE0ZVG3m
 5tAF1D5vAAwA8nfPysumlLsIjohJZo4lgnhB++AlOg==
 -----END CERTIFICATE-----
 )EOF";
-static const char serverKey[] PROGMEM = R"EOF(
+static const char      serverKey[] PROGMEM  = R"EOF(
 -----BEGIN RSA PRIVATE KEY-----
 MIIEpQIBAAKCAQEA9UoHBtn4oNKXjRgIOQ/rLxK/iI0a8Q5mDxhfuwa9//FkftSI
 IFY8UhGk2YNJpnfKOyYWqbqwuJhIZJ2sEIWp2301OnavuGBrpKOgBJJljgH2l/4Z
@@ -85,16 +85,18 @@ gz5JWYhbD6c38khSzJb0pNXCo3EuYAVa36kDM96k1BtWuhRS10Q1VXk=
 ESP8266WebServerSecure server(443);
 
 //These are temporary credentials that will only be used if none are found saved in LittleFS.
-String login = "admin";
-const String realm = "global";
-String H1 = "";
-String authentication_failed = "User authentication has failed.";
+String                 login                 = "admin";
+const String           realm                 = "global";
+String                 H1                    = "";
+String                 authentication_failed = "User authentication has failed.";
 
-void setup() {
+void                   setup()
+{
   Serial.begin(115200);
 
   //Initialize LittleFS to save credentials
-  if (!LittleFS.begin()) {
+  if (!LittleFS.begin())
+  {
     Serial.println("LittleFS initialization error, programmer flash configured?");
     ESP.restart();
   }
@@ -105,15 +107,16 @@ void setup() {
   //Initialize wifi
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, wifi_pw);
-  if (WiFi.waitForConnectResult() != WL_CONNECTED) {
+  if (WiFi.waitForConnectResult() != WL_CONNECTED)
+  {
     Serial.println("WiFi Connect Failed! Rebooting...");
     delay(1000);
     ESP.restart();
   }
 
   server.getServer().setRSACert(new BearSSL::X509List(serverCert), new BearSSL::PrivateKey(serverKey));
-  server.on("/", showcredentialpage); //for this simple example, just show a simple page for changing credentials at the root
-  server.on("/" + change_creds, handlecredentialchange); //handles submission of credentials from the client
+  server.on("/", showcredentialpage);                     //for this simple example, just show a simple page for changing credentials at the root
+  server.on("/" + change_creds, handlecredentialchange);  //handles submission of credentials from the client
   server.onNotFound(redirect);
   server.begin();
 
@@ -122,30 +125,36 @@ void setup() {
   Serial.println("/ in your browser to see it working");
 }
 
-void loop() {
+void loop()
+{
   yield();
   server.handleClient();
 }
 
 //This function redirects home
-void redirect() {
+void redirect()
+{
   String url = "https://" + WiFi.localIP().toString();
   Serial.println("Redirect called. Redirecting to " + url);
   server.sendHeader("Location", url, true);
   Serial.println("Header sent.");
-  server.send(302, "text/plain", ""); // Empty content inhibits Content-length header so we have to close the socket ourselves.
+  server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to close the socket ourselves.
   Serial.println("Empty page sent.");
-  server.client().stop(); // Stop is needed because we sent no content length
+  server.client().stop();  // Stop is needed because we sent no content length
   Serial.println("Client stopped.");
 }
 
 //This function checks whether the current session has been authenticated. If not, a request for credentials is sent.
-bool session_authenticated() {
+bool session_authenticated()
+{
   Serial.println("Checking authentication.");
-  if (server.authenticateDigest(login, H1)) {
+  if (server.authenticateDigest(login, H1))
+  {
     Serial.println("Authentication confirmed.");
     return true;
-  } else {
+  }
+  else
+  {
     Serial.println("Not authenticated. Requesting credentials.");
     server.requestAuthentication(DIGEST_AUTH, realm.c_str(), authentication_failed);
     redirect();
@@ -154,9 +163,11 @@ bool session_authenticated() {
 }
 
 //This function sends a simple webpage for changing login credentials to the client
-void showcredentialpage() {
+void showcredentialpage()
+{
   Serial.println("Show credential page called.");
-  if (!session_authenticated()) {
+  if (!session_authenticated())
+  {
     return;
   }
 
@@ -189,15 +200,17 @@ void showcredentialpage() {
 }
 
 //Saves credentials to LittleFS
-void savecredentials(String new_login, String new_password) {
+void savecredentials(String new_login, String new_password)
+{
   //Set global variables to new values
   login = new_login;
-  H1 = ESP8266WebServer::credentialHash(new_login, realm, new_password);
+  H1    = ESP8266WebServer::credentialHash(new_login, realm, new_password);
 
   //Save new values to LittleFS for loading on next reboot
   Serial.println("Saving credentials.");
-  File f = LittleFS.open(file_credentials, "w"); //open as a brand new file, discard old contents
-  if (f) {
+  File f = LittleFS.open(file_credentials, "w");  //open as a brand new file, discard old contents
+  if (f)
+  {
     Serial.println("Modifying credentials in file system.");
     f.println(login);
     f.println(H1);
@@ -209,48 +222,56 @@ void savecredentials(String new_login, String new_password) {
 }
 
 //loads credentials from LittleFS
-void loadcredentials() {
+void loadcredentials()
+{
   Serial.println("Searching for credentials.");
   File f;
   f = LittleFS.open(file_credentials, "r");
-  if (f) {
+  if (f)
+  {
     Serial.println("Loading credentials from file system.");
-    String mod = f.readString(); //read the file to a String
-    int index_1 = mod.indexOf('\n', 0); //locate the first line break
-    int index_2 = mod.indexOf('\n', index_1 + 1); //locate the second line break
-    login = mod.substring(0, index_1 - 1); //get the first line (excluding the line break)
-    H1 = mod.substring(index_1 + 1, index_2 - 1); //get the second line (excluding the line break)
+    String mod     = f.readString();                           //read the file to a String
+    int    index_1 = mod.indexOf('\n', 0);                     //locate the first line break
+    int    index_2 = mod.indexOf('\n', index_1 + 1);           //locate the second line break
+    login          = mod.substring(0, index_1 - 1);            //get the first line (excluding the line break)
+    H1             = mod.substring(index_1 + 1, index_2 - 1);  //get the second line (excluding the line break)
     f.close();
-  } else {
-    String default_login = "admin";
+  }
+  else
+  {
+    String default_login    = "admin";
     String default_password = "changeme";
     Serial.println("None found. Setting to default credentials.");
     Serial.println("user:" + default_login);
     Serial.println("password:" + default_password);
     login = default_login;
-    H1 = ESP8266WebServer::credentialHash(default_login, realm, default_password);
+    H1    = ESP8266WebServer::credentialHash(default_login, realm, default_password);
   }
 }
 
 //This function handles a credential change from a client.
-void handlecredentialchange() {
+void handlecredentialchange()
+{
   Serial.println("Handle credential change called.");
-  if (!session_authenticated()) {
+  if (!session_authenticated())
+  {
     return;
   }
 
   Serial.println("Handling credential change request from client.");
 
   String login = server.arg("login");
-  String pw1 = server.arg("password");
-  String pw2 = server.arg("password_duplicate");
-
-  if (login != "" && pw1 != "" && pw1 == pw2) {
+  String pw1   = server.arg("password");
+  String pw2   = server.arg("password_duplicate");
 
+  if (login != "" && pw1 != "" && pw1 == pw2)
+  {
     savecredentials(login, pw1);
     server.send(200, "text/plain", "Credentials updated");
     redirect();
-  } else {
+  }
+  else
+  {
     server.send(200, "text/plain", "Malformed credentials");
     redirect();
   }
diff --git a/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino b/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
index e27973cab2..7866659234 100644
--- a/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
+++ b/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
@@ -11,19 +11,21 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*      ssid     = STASSID;
+const char*      password = STAPSK;
 
 ESP8266WebServer server(80);
 
-void setup(void) {
+void             setup(void)
+{
   Serial.begin(115200);
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -33,29 +35,32 @@ void setup(void) {
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-  if (MDNS.begin("esp8266")) {
+  if (MDNS.begin("esp8266"))
+  {
     Serial.println("MDNS responder started");
   }
 
-  server.on(F("/"), []() {
-    server.send(200, "text/plain", "hello from esp8266!");
-  });
+  server.on(F("/"), []()
+            { server.send(200, "text/plain", "hello from esp8266!"); });
 
-  server.on(UriBraces("/users/{}"), []() {
-    String user = server.pathArg(0);
-    server.send(200, "text/plain", "User: '" + user + "'");
-  });
+  server.on(UriBraces("/users/{}"), []()
+            {
+              String user = server.pathArg(0);
+              server.send(200, "text/plain", "User: '" + user + "'");
+            });
 
-  server.on(UriRegex("^\\/users\\/([0-9]+)\\/devices\\/([0-9]+)$"), []() {
-    String user = server.pathArg(0);
-    String device = server.pathArg(1);
-    server.send(200, "text/plain", "User: '" + user + "' and Device: '" + device + "'");
-  });
+  server.on(UriRegex("^\\/users\\/([0-9]+)\\/devices\\/([0-9]+)$"), []()
+            {
+              String user   = server.pathArg(0);
+              String device = server.pathArg(1);
+              server.send(200, "text/plain", "User: '" + user + "' and Device: '" + device + "'");
+            });
 
   server.begin();
   Serial.println("HTTP server started");
 }
 
-void loop(void) {
+void loop(void)
+{
   server.handleClient();
 }
diff --git a/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino b/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
index 6c787794e5..e25ce3fb72 100644
--- a/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
+++ b/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
@@ -8,14 +8,14 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*      ssid     = STASSID;
+const char*      password = STAPSK;
 
 ESP8266WebServer server(80);
 
-const int led = LED_BUILTIN;
+const int        led       = LED_BUILTIN;
 
-const String postForms = "<html>\
+const String     postForms = "<html>\
   <head>\
     <title>ESP8266 Web Server POST handling</title>\
     <style>\
@@ -36,33 +36,43 @@ const String postForms = "<html>\
   </body>\
 </html>";
 
-void handleRoot() {
+void             handleRoot()
+{
   digitalWrite(led, 1);
   server.send(200, "text/html", postForms);
   digitalWrite(led, 0);
 }
 
-void handlePlain() {
-  if (server.method() != HTTP_POST) {
+void handlePlain()
+{
+  if (server.method() != HTTP_POST)
+  {
     digitalWrite(led, 1);
     server.send(405, "text/plain", "Method Not Allowed");
     digitalWrite(led, 0);
-  } else {
+  }
+  else
+  {
     digitalWrite(led, 1);
     server.send(200, "text/plain", "POST body was:\n" + server.arg("plain"));
     digitalWrite(led, 0);
   }
 }
 
-void handleForm() {
-  if (server.method() != HTTP_POST) {
+void handleForm()
+{
+  if (server.method() != HTTP_POST)
+  {
     digitalWrite(led, 1);
     server.send(405, "text/plain", "Method Not Allowed");
     digitalWrite(led, 0);
-  } else {
+  }
+  else
+  {
     digitalWrite(led, 1);
     String message = "POST form was:\n";
-    for (uint8_t i = 0; i < server.args(); i++) {
+    for (uint8_t i = 0; i < server.args(); i++)
+    {
       message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
     }
     server.send(200, "text/plain", message);
@@ -70,7 +80,8 @@ void handleForm() {
   }
 }
 
-void handleNotFound() {
+void handleNotFound()
+{
   digitalWrite(led, 1);
   String message = "File Not Found\n\n";
   message += "URI: ";
@@ -80,14 +91,16 @@ void handleNotFound() {
   message += "\nArguments: ";
   message += server.args();
   message += "\n";
-  for (uint8_t i = 0; i < server.args(); i++) {
+  for (uint8_t i = 0; i < server.args(); i++)
+  {
     message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
   }
   server.send(404, "text/plain", message);
   digitalWrite(led, 0);
 }
 
-void setup(void) {
+void setup(void)
+{
   pinMode(led, OUTPUT);
   digitalWrite(led, 0);
   Serial.begin(115200);
@@ -95,7 +108,8 @@ void setup(void) {
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -105,7 +119,8 @@ void setup(void) {
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-  if (MDNS.begin("esp8266")) {
+  if (MDNS.begin("esp8266"))
+  {
     Serial.println("MDNS responder started");
   }
 
@@ -121,6 +136,7 @@ void setup(void) {
   Serial.println("HTTP server started");
 }
 
-void loop(void) {
+void loop(void)
+{
   server.handleClient();
 }
diff --git a/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino b/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
index c2fe34bb9c..73127f2941 100644
--- a/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
+++ b/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
@@ -31,7 +31,8 @@
     you can also try to start listening again before the KeepAliver timer expires or simply register your client again
 */
 
-extern "C" {
+extern "C"
+{
 #include "c_types.h"
 }
 #include <ESP8266WiFi.h>
@@ -45,28 +46,31 @@ extern "C" {
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
-const unsigned int port = 80;
+const char*        ssid     = STASSID;
+const char*        password = STAPSK;
+const unsigned int port     = 80;
 
-ESP8266WebServer server(port);
+ESP8266WebServer   server(port);
 
-#define SSE_MAX_CHANNELS 8 // in this simplified example, only eight SSE clients subscription allowed
-struct SSESubscription {
-  IPAddress clientIP;
+#define SSE_MAX_CHANNELS 8  // in this simplified example, only eight SSE clients subscription allowed
+struct SSESubscription
+{
+  IPAddress  clientIP;
   WiFiClient client;
-  Ticker keepAliveTimer;
+  Ticker     keepAliveTimer;
 } subscription[SSE_MAX_CHANNELS];
 uint8_t subscriptionCount = 0;
 
-typedef struct {
-  const char* name;
+typedef struct
+{
+  const char*    name;
   unsigned short value;
-  Ticker update;
+  Ticker         update;
 } sensorType;
 sensorType sensor[2];
 
-void handleNotFound() {
+void       handleNotFound()
+{
   Serial.println(F("Handle not found"));
   String message = "Handle Not Found\n\n";
   message += "URI: ";
@@ -76,21 +80,28 @@ void handleNotFound() {
   message += "\nArguments: ";
   message += server.args();
   message += "\n";
-  for (uint8_t i = 0; i < server.args(); i++) {
+  for (uint8_t i = 0; i < server.args(); i++)
+  {
     message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
   }
   server.send(404, "text/plain", message);
 }
 
-void SSEKeepAlive() {
-  for (uint8_t i = 0; i < SSE_MAX_CHANNELS; i++) {
-    if (!(subscription[i].clientIP)) {
+void SSEKeepAlive()
+{
+  for (uint8_t i = 0; i < SSE_MAX_CHANNELS; i++)
+  {
+    if (!(subscription[i].clientIP))
+    {
       continue;
     }
-    if (subscription[i].client.connected()) {
+    if (subscription[i].client.connected())
+    {
       Serial.printf_P(PSTR("SSEKeepAlive - client is still listening on channel %d\n"), i);
-      subscription[i].client.println(F("event: event\ndata: { \"TYPE\":\"KEEP-ALIVE\" }\n")); // Extra newline required by SSE standard
-    } else {
+      subscription[i].client.println(F("event: event\ndata: { \"TYPE\":\"KEEP-ALIVE\" }\n"));  // Extra newline required by SSE standard
+    }
+    else
+    {
       Serial.printf_P(PSTR("SSEKeepAlive - client not listening on channel %d, remove subscription\n"), i);
       subscription[i].keepAliveTimer.detach();
       subscription[i].client.flush();
@@ -103,72 +114,87 @@ void SSEKeepAlive() {
 
 // SSEHandler handles the client connection to the event bus (client event listener)
 // every 60 seconds it sends a keep alive event via Ticker
-void SSEHandler(uint8_t channel) {
-  WiFiClient client = server.client();
-  SSESubscription& s = subscription[channel];
-  if (s.clientIP != client.remoteIP()) { // IP addresses don't match, reject this client
+void SSEHandler(uint8_t channel)
+{
+  WiFiClient       client = server.client();
+  SSESubscription& s      = subscription[channel];
+  if (s.clientIP != client.remoteIP())
+  {  // IP addresses don't match, reject this client
     Serial.printf_P(PSTR("SSEHandler - unregistered client with IP %s tries to listen\n"), server.client().remoteIP().toString().c_str());
     return handleNotFound();
   }
   client.setNoDelay(true);
   client.setSync(true);
   Serial.printf_P(PSTR("SSEHandler - registered client with IP %s is listening\n"), IPAddress(s.clientIP).toString().c_str());
-  s.client = client; // capture SSE server client connection
-  server.setContentLength(CONTENT_LENGTH_UNKNOWN); // the payload can go on forever
+  s.client = client;                                // capture SSE server client connection
+  server.setContentLength(CONTENT_LENGTH_UNKNOWN);  // the payload can go on forever
   server.sendContent_P(PSTR("HTTP/1.1 200 OK\nContent-Type: text/event-stream;\nConnection: keep-alive\nCache-Control: no-cache\nAccess-Control-Allow-Origin: *\n\n"));
-  s.keepAliveTimer.attach_scheduled(30.0, SSEKeepAlive); // Refresh time every 30s for demo
+  s.keepAliveTimer.attach_scheduled(30.0, SSEKeepAlive);  // Refresh time every 30s for demo
 }
 
-void handleAll() {
-  const char* uri = server.uri().c_str();
+void handleAll()
+{
+  const char* uri        = server.uri().c_str();
   const char* restEvents = PSTR("/rest/events/");
-  if (strncmp_P(uri, restEvents, strlen_P(restEvents))) {
+  if (strncmp_P(uri, restEvents, strlen_P(restEvents)))
+  {
     return handleNotFound();
   }
-  uri += strlen_P(restEvents); // Skip the "/rest/events/" and get to the channel number
+  uri += strlen_P(restEvents);  // Skip the "/rest/events/" and get to the channel number
   unsigned int channel = atoi(uri);
-  if (channel < SSE_MAX_CHANNELS) {
+  if (channel < SSE_MAX_CHANNELS)
+  {
     return SSEHandler(channel);
   }
   handleNotFound();
 };
 
-void SSEBroadcastState(const char* sensorName, unsigned short prevSensorValue, unsigned short sensorValue) {
-  for (uint8_t i = 0; i < SSE_MAX_CHANNELS; i++) {
-    if (!(subscription[i].clientIP)) {
+void SSEBroadcastState(const char* sensorName, unsigned short prevSensorValue, unsigned short sensorValue)
+{
+  for (uint8_t i = 0; i < SSE_MAX_CHANNELS; i++)
+  {
+    if (!(subscription[i].clientIP))
+    {
       continue;
     }
     String IPaddrstr = IPAddress(subscription[i].clientIP).toString();
-    if (subscription[i].client.connected()) {
+    if (subscription[i].client.connected())
+    {
       Serial.printf_P(PSTR("broadcast status change to client IP %s on channel %d for %s with new state %d\n"),
-          IPaddrstr.c_str(), i, sensorName, sensorValue);
+                      IPaddrstr.c_str(), i, sensorName, sensorValue);
       subscription[i].client.printf_P(PSTR("event: event\ndata: {\"TYPE\":\"STATE\", \"%s\":{\"state\":%d, \"prevState\":%d}}\n\n"),
-          sensorName, sensorValue, prevSensorValue);
-    } else {
+                                      sensorName, sensorValue, prevSensorValue);
+    }
+    else
+    {
       Serial.printf_P(PSTR("SSEBroadcastState - client %s registered on channel %d but not listening\n"), IPaddrstr.c_str(), i);
     }
   }
 }
 
 // Simulate sensors
-void updateSensor(sensorType& sensor) {
-  unsigned short newVal = (unsigned short)RANDOM_REG32; // (not so good) random value for the sensor
+void updateSensor(sensorType& sensor)
+{
+  unsigned short newVal = (unsigned short)RANDOM_REG32;  // (not so good) random value for the sensor
   Serial.printf_P(PSTR("update sensor %s - previous state: %d, new state: %d\n"), sensor.name, sensor.value, newVal);
-  if (sensor.value != newVal) {
-    SSEBroadcastState(sensor.name, sensor.value, newVal); // only broadcast if state is different
+  if (sensor.value != newVal)
+  {
+    SSEBroadcastState(sensor.name, sensor.value, newVal);  // only broadcast if state is different
   }
   sensor.value = newVal;
-  sensor.update.once(rand() % 20 + 10, std::bind(updateSensor, sensor)); // randomly update sensor
+  sensor.update.once(rand() % 20 + 10, std::bind(updateSensor, sensor));  // randomly update sensor
 }
 
-void handleSubscribe() {
-  if (subscriptionCount == SSE_MAX_CHANNELS - 1) {
-    return handleNotFound(); // We ran out of channels
+void handleSubscribe()
+{
+  if (subscriptionCount == SSE_MAX_CHANNELS - 1)
+  {
+    return handleNotFound();  // We ran out of channels
   }
 
-  uint8_t channel;
-  IPAddress clientIP = server.client().remoteIP(); // get IP address of client
-  String SSEurl = F("http://");
+  uint8_t   channel;
+  IPAddress clientIP = server.client().remoteIP();  // get IP address of client
+  String    SSEurl   = F("http://");
   SSEurl += WiFi.localIP().toString();
   SSEurl += F(":");
   SSEurl += port;
@@ -176,8 +202,9 @@ void handleSubscribe() {
   SSEurl += F("/rest/events/");
 
   ++subscriptionCount;
-  for (channel = 0; channel < SSE_MAX_CHANNELS; channel++) // Find first free slot
-    if (!subscription[channel].clientIP) {
+  for (channel = 0; channel < SSE_MAX_CHANNELS; channel++)  // Find first free slot
+    if (!subscription[channel].clientIP)
+    {
       break;
     }
   subscription[channel] = { clientIP, server.client(), Ticker() };
@@ -188,35 +215,40 @@ void handleSubscribe() {
   server.send_P(200, "text/plain", SSEurl.c_str());
 }
 
-void startServers() {
+void startServers()
+{
   server.on(F("/rest/events/subscribe"), handleSubscribe);
   server.onNotFound(handleAll);
   server.begin();
   Serial.println("HTTP server and  SSE EventSource started");
 }
 
-void setup(void) {
+void setup(void)
+{
   Serial.begin(115200);
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
   Serial.println("");
-  while (WiFi.status() != WL_CONNECTED) { // Wait for connection
+  while (WiFi.status() != WL_CONNECTED)
+  {  // Wait for connection
     delay(500);
     Serial.print(".");
   }
   Serial.printf_P(PSTR("\nConnected to %s with IP address: %s\n"), ssid, WiFi.localIP().toString().c_str());
-  if (MDNS.begin("esp8266")) {
+  if (MDNS.begin("esp8266"))
+  {
     Serial.println("MDNS responder started");
   }
 
-  startServers(); // start web and SSE servers
+  startServers();  // start web and SSE servers
   sensor[0].name = "sensorA";
   sensor[1].name = "sensorB";
   updateSensor(sensor[0]);
   updateSensor(sensor[1]);
 }
 
-void loop(void) {
+void loop(void)
+{
   server.handleClient();
   MDNS.update();
   yield();
diff --git a/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino b/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
index a2b7bc9275..0f11a120ca 100644
--- a/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
+++ b/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
@@ -7,19 +7,22 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*      ssid     = STASSID;
+const char*      password = STAPSK;
 
 ESP8266WebServer server(80);
 
 //Check if header is present and correct
-bool is_authenticated() {
+bool             is_authenticated()
+{
   Serial.println("Enter is_authenticated");
-  if (server.hasHeader("Cookie")) {
+  if (server.hasHeader("Cookie"))
+  {
     Serial.print("Found cookie: ");
     String cookie = server.header("Cookie");
     Serial.println(cookie);
-    if (cookie.indexOf("ESPSESSIONID=1") != -1) {
+    if (cookie.indexOf("ESPSESSIONID=1") != -1)
+    {
       Serial.println("Authentication Successful");
       return true;
     }
@@ -29,14 +32,17 @@ bool is_authenticated() {
 }
 
 //login page, also called for disconnect
-void handleLogin() {
+void handleLogin()
+{
   String msg;
-  if (server.hasHeader("Cookie")) {
+  if (server.hasHeader("Cookie"))
+  {
     Serial.print("Found cookie: ");
     String cookie = server.header("Cookie");
     Serial.println(cookie);
   }
-  if (server.hasArg("DISCONNECT")) {
+  if (server.hasArg("DISCONNECT"))
+  {
     Serial.println("Disconnection");
     server.sendHeader("Location", "/login");
     server.sendHeader("Cache-Control", "no-cache");
@@ -44,8 +50,10 @@ void handleLogin() {
     server.send(301);
     return;
   }
-  if (server.hasArg("USERNAME") && server.hasArg("PASSWORD")) {
-    if (server.arg("USERNAME") == "admin" && server.arg("PASSWORD") == "admin") {
+  if (server.hasArg("USERNAME") && server.hasArg("PASSWORD"))
+  {
+    if (server.arg("USERNAME") == "admin" && server.arg("PASSWORD") == "admin")
+    {
       server.sendHeader("Location", "/");
       server.sendHeader("Cache-Control", "no-cache");
       server.sendHeader("Set-Cookie", "ESPSESSIONID=1");
@@ -65,17 +73,20 @@ void handleLogin() {
 }
 
 //root page can be accessed only if authentication is ok
-void handleRoot() {
+void handleRoot()
+{
   Serial.println("Enter handleRoot");
   String header;
-  if (!is_authenticated()) {
+  if (!is_authenticated())
+  {
     server.sendHeader("Location", "/login");
     server.sendHeader("Cache-Control", "no-cache");
     server.send(301);
     return;
   }
   String content = "<html><body><H2>hello, you successfully connected to esp8266!</H2><br>";
-  if (server.hasHeader("User-Agent")) {
+  if (server.hasHeader("User-Agent"))
+  {
     content += "the user agent used is : " + server.header("User-Agent") + "<br><br>";
   }
   content += "You can access this page until you <a href=\"/login?DISCONNECT=YES\">disconnect</a></body></html>";
@@ -83,7 +94,8 @@ void handleRoot() {
 }
 
 //no need authentication
-void handleNotFound() {
+void handleNotFound()
+{
   String message = "File Not Found\n\n";
   message += "URI: ";
   message += server.uri();
@@ -92,20 +104,23 @@ void handleNotFound() {
   message += "\nArguments: ";
   message += server.args();
   message += "\n";
-  for (uint8_t i = 0; i < server.args(); i++) {
+  for (uint8_t i = 0; i < server.args(); i++)
+  {
     message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
   }
   server.send(404, "text/plain", message);
 }
 
-void setup(void) {
+void setup(void)
+{
   Serial.begin(115200);
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -117,9 +132,8 @@ void setup(void) {
 
   server.on("/", handleRoot);
   server.on("/login", handleLogin);
-  server.on("/inline", []() {
-    server.send(200, "text/plain", "this works without need of authentication");
-  });
+  server.on("/inline", []()
+            { server.send(200, "text/plain", "this works without need of authentication"); });
 
   server.onNotFound(handleNotFound);
   //ask server to track these headers
@@ -128,6 +142,7 @@ void setup(void) {
   Serial.println("HTTP server started");
 }
 
-void loop(void) {
+void loop(void)
+{
   server.handleClient();
 }
diff --git a/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino b/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
index be875048ee..2f663ee57e 100644
--- a/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
+++ b/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
@@ -9,10 +9,10 @@
 #include <Arduino.h>
 #include <ESP8266WebServer.h>
 
-#include "secrets.h" // add WLAN Credentials in here.
+#include "secrets.h"  // add WLAN Credentials in here.
 
-#include <FS.h> // File System for Web Server Files
-#include <LittleFS.h> // This file system is used.
+#include <FS.h>        // File System for Web Server Files
+#include <LittleFS.h>  // This file system is used.
 
 // mark parameters not used in example
 #define UNUSED __attribute__((unused))
@@ -36,27 +36,32 @@ ESP8266WebServer server(80);
 
 // This function is called when the WebServer was requested without giving a filename.
 // This will redirect to the file index.htm when it is existing otherwise to the built-in $upload.htm page
-void handleRedirect() {
+void handleRedirect()
+{
   TRACE("Redirect...");
   String url = "/index.htm";
 
-  if (!LittleFS.exists(url)) {
+  if (!LittleFS.exists(url))
+  {
     url = "/$update.htm";
   }
 
   server.sendHeader("Location", url, true);
   server.send(302);
-} // handleRedirect()
+}  // handleRedirect()
 
 // This function is called when the WebServer was requested to list all existing files in the filesystem.
 // a JSON array with file information is returned.
-void handleListFiles() {
-  Dir dir = LittleFS.openDir("/");
+void handleListFiles()
+{
+  Dir    dir = LittleFS.openDir("/");
   String result;
 
   result += "[\n";
-  while (dir.next()) {
-    if (result.length() > 4) {
+  while (dir.next())
+  {
+    if (result.length() > 4)
+    {
       result += ",";
     }
     result += "  {";
@@ -65,14 +70,15 @@ void handleListFiles() {
     result += " \"time\": " + String(dir.fileTime());
     result += " }\n";
     // jc.addProperty("size", dir.fileSize());
-  } // while
+  }  // while
   result += "]";
   server.sendHeader("Cache-Control", "no-cache");
   server.send(200, "text/javascript; charset=utf-8", result);
-} // handleListFiles()
+}  // handleListFiles()
 
 // This function is called when the sysInfo service was requested.
-void handleSysInfo() {
+void handleSysInfo()
+{
   String result;
 
   FSInfo fs_info;
@@ -87,18 +93,20 @@ void handleSysInfo() {
 
   server.sendHeader("Cache-Control", "no-cache");
   server.send(200, "text/javascript; charset=utf-8", result);
-} // handleSysInfo()
+}  // handleSysInfo()
 
 // ===== Request Handler class used to answer more complex requests =====
 
 // The FileServerHandler is registered to the web server to support DELETE and UPLOAD of files into the filesystem.
-class FileServerHandler : public RequestHandler {
+class FileServerHandler : public RequestHandler
+{
   public:
   // @brief Construct a new File Server Handler object
   // @param fs The file system to be used.
   // @param path Path to the root folder in the file system that is used for serving static data down and upload.
   // @param cache_header Cache Header to be used in replies.
-  FileServerHandler() {
+  FileServerHandler()
+  {
     TRACE("FileServerHandler is registered\n");
   }
 
@@ -106,71 +114,87 @@ class FileServerHandler : public RequestHandler {
   // @param requestMethod method of the http request line.
   // @param requestUri request ressource from the http request line.
   // @return true when method can be handled.
-  bool canHandle(HTTPMethod requestMethod, const String UNUSED& _uri) override {
+  bool canHandle(HTTPMethod requestMethod, const String UNUSED& _uri) override
+  {
     return ((requestMethod == HTTP_POST) || (requestMethod == HTTP_DELETE));
-  } // canHandle()
+  }  // canHandle()
 
-  bool canUpload(const String& uri) override {
+  bool canUpload(const String& uri) override
+  {
     // only allow upload on root fs level.
     return (uri == "/");
-  } // canUpload()
+  }  // canUpload()
 
-  bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, const String& requestUri) override {
+  bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, const String& requestUri) override
+  {
     // ensure that filename starts with '/'
     String fName = requestUri;
-    if (!fName.startsWith("/")) {
+    if (!fName.startsWith("/"))
+    {
       fName = "/" + fName;
     }
 
-    if (requestMethod == HTTP_POST) {
+    if (requestMethod == HTTP_POST)
+    {
       // all done in upload. no other forms.
-
-    } else if (requestMethod == HTTP_DELETE) {
-      if (LittleFS.exists(fName)) {
+    }
+    else if (requestMethod == HTTP_DELETE)
+    {
+      if (LittleFS.exists(fName))
+      {
         LittleFS.remove(fName);
       }
-    } // if
+    }  // if
 
-    server.send(200); // all done.
+    server.send(200);  // all done.
     return (true);
-  } // handle()
+  }  // handle()
 
   // uploading process
-  void upload(ESP8266WebServer UNUSED& server, const String UNUSED& _requestUri, HTTPUpload& upload) override {
+  void upload(ESP8266WebServer UNUSED& server, const String UNUSED& _requestUri, HTTPUpload& upload) override
+  {
     // ensure that filename starts with '/'
     String fName = upload.filename;
-    if (!fName.startsWith("/")) {
+    if (!fName.startsWith("/"))
+    {
       fName = "/" + fName;
     }
 
-    if (upload.status == UPLOAD_FILE_START) {
+    if (upload.status == UPLOAD_FILE_START)
+    {
       // Open the file
-      if (LittleFS.exists(fName)) {
+      if (LittleFS.exists(fName))
+      {
         LittleFS.remove(fName);
-      } // if
+      }  // if
       _fsUploadFile = LittleFS.open(fName, "w");
-
-    } else if (upload.status == UPLOAD_FILE_WRITE) {
+    }
+    else if (upload.status == UPLOAD_FILE_WRITE)
+    {
       // Write received bytes
-      if (_fsUploadFile) {
+      if (_fsUploadFile)
+      {
         _fsUploadFile.write(upload.buf, upload.currentSize);
       }
-
-    } else if (upload.status == UPLOAD_FILE_END) {
+    }
+    else if (upload.status == UPLOAD_FILE_END)
+    {
       // Close the file
-      if (_fsUploadFile) {
+      if (_fsUploadFile)
+      {
         _fsUploadFile.close();
       }
-    } // if
-  } // upload()
+    }  // if
+  }    // upload()
 
   protected:
   File _fsUploadFile;
 };
 
 // Setup everything to make the webserver work.
-void setup(void) {
-  delay(3000); // wait for serial monitor to start completely.
+void setup(void)
+{
+  delay(3000);  // wait for serial monitor to start completely.
 
   // Use Serial port for some trace information from the example
   Serial.begin(115200);
@@ -179,7 +203,8 @@ void setup(void) {
   TRACE("Starting WebServer example...\n");
 
   TRACE("Mounting the filesystem...\n");
-  if (!LittleFS.begin()) {
+  if (!LittleFS.begin())
+  {
     TRACE("could not mount the filesystem...\n");
     delay(2000);
     ESP.restart();
@@ -187,9 +212,12 @@ void setup(void) {
 
   // start WiFI
   WiFi.mode(WIFI_STA);
-  if (strlen(ssid) == 0) {
+  if (strlen(ssid) == 0)
+  {
     WiFi.begin();
-  } else {
+  }
+  else
+  {
     WiFi.begin(ssid, passPhrase);
   }
 
@@ -197,7 +225,8 @@ void setup(void) {
   WiFi.setHostname(HOSTNAME);
 
   TRACE("Connect to WiFi...\n");
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     TRACE(".");
   }
@@ -210,9 +239,8 @@ void setup(void) {
   TRACE("Register service handlers...\n");
 
   // serve a built-in htm page
-  server.on("/$upload.htm", []() {
-    server.send(200, "text/html", FPSTR(uploadContent));
-  });
+  server.on("/$upload.htm", []()
+            { server.send(200, "text/html", FPSTR(uploadContent)); });
 
   // register a redirect handler when only domain name is given.
   server.on("/", HTTP_GET, handleRedirect);
@@ -234,18 +262,20 @@ void setup(void) {
   server.serveStatic("/", LittleFS, "/");
 
   // handle cases when file is not found
-  server.onNotFound([]() {
-    // standard not found in browser.
-    server.send(404, "text/html", FPSTR(notFoundContent));
-  });
+  server.onNotFound([]()
+                    {
+                      // standard not found in browser.
+                      server.send(404, "text/html", FPSTR(notFoundContent));
+                    });
 
   server.begin();
   TRACE("hostname=%s\n", WiFi.getHostname());
-} // setup
+}  // setup
 
 // run the server...
-void loop(void) {
+void loop(void)
+{
   server.handleClient();
-} // loop()
+}  // loop()
 
 // end.
diff --git a/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino b/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
index 4dff271390..895c5079c4 100644
--- a/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
+++ b/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
@@ -12,62 +12,83 @@
 #define STAPSK "your-password"
 #endif
 
-const char* host = "esp8266-webupdate";
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*      host     = "esp8266-webupdate";
+const char*      ssid     = STASSID;
+const char*      password = STAPSK;
 
 ESP8266WebServer server(80);
-const char* serverIndex = "<form method='POST' action='/update' enctype='multipart/form-data'><input type='file' name='update'><input type='submit' value='Update'></form>";
+const char*      serverIndex = "<form method='POST' action='/update' enctype='multipart/form-data'><input type='file' name='update'><input type='submit' value='Update'></form>";
 
-void setup(void) {
+void             setup(void)
+{
   Serial.begin(115200);
   Serial.println();
   Serial.println("Booting Sketch...");
   WiFi.mode(WIFI_AP_STA);
   WiFi.begin(ssid, password);
-  if (WiFi.waitForConnectResult() == WL_CONNECTED) {
+  if (WiFi.waitForConnectResult() == WL_CONNECTED)
+  {
     MDNS.begin(host);
-    server.on("/", HTTP_GET, []() {
-      server.sendHeader("Connection", "close");
-      server.send(200, "text/html", serverIndex);
-    });
+    server.on("/", HTTP_GET, []()
+              {
+                server.sendHeader("Connection", "close");
+                server.send(200, "text/html", serverIndex);
+              });
     server.on(
-        "/update", HTTP_POST, []() {
-      server.sendHeader("Connection", "close");
-      server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
-      ESP.restart(); }, []() {
-      HTTPUpload& upload = server.upload();
-      if (upload.status == UPLOAD_FILE_START) {
-        Serial.setDebugOutput(true);
-        WiFiUDP::stopAll();
-        Serial.printf("Update: %s\n", upload.filename.c_str());
-        uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
-        if (!Update.begin(maxSketchSpace)) { //start with max available size
-          Update.printError(Serial);
-        }
-      } else if (upload.status == UPLOAD_FILE_WRITE) {
-        if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
-          Update.printError(Serial);
-        }
-      } else if (upload.status == UPLOAD_FILE_END) {
-        if (Update.end(true)) { //true to set the size to the current progress
-          Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
-        } else {
-          Update.printError(Serial);
-        }
-        Serial.setDebugOutput(false);
-      }
-      yield(); });
+        "/update", HTTP_POST, []()
+        {
+          server.sendHeader("Connection", "close");
+          server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
+          ESP.restart();
+        },
+        []()
+        {
+          HTTPUpload& upload = server.upload();
+          if (upload.status == UPLOAD_FILE_START)
+          {
+            Serial.setDebugOutput(true);
+            WiFiUDP::stopAll();
+            Serial.printf("Update: %s\n", upload.filename.c_str());
+            uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
+            if (!Update.begin(maxSketchSpace))
+            {  //start with max available size
+              Update.printError(Serial);
+            }
+          }
+          else if (upload.status == UPLOAD_FILE_WRITE)
+          {
+            if (Update.write(upload.buf, upload.currentSize) != upload.currentSize)
+            {
+              Update.printError(Serial);
+            }
+          }
+          else if (upload.status == UPLOAD_FILE_END)
+          {
+            if (Update.end(true))
+            {  //true to set the size to the current progress
+              Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
+            }
+            else
+            {
+              Update.printError(Serial);
+            }
+            Serial.setDebugOutput(false);
+          }
+          yield();
+        });
     server.begin();
     MDNS.addService("http", "tcp", 80);
 
     Serial.printf("Ready! Open http://%s.local in your browser\n", host);
-  } else {
+  }
+  else
+  {
     Serial.println("WiFi Failed");
   }
 }
 
-void loop(void) {
+void loop(void)
+{
   server.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
index 7b5ccc9ba1..02bec78a42 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
@@ -44,8 +44,8 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* pass = STAPSK;
+const char*        ssid = STASSID;
+const char*        pass = STAPSK;
 
 // A single, global CertStore which can be used by all
 // connections.  Needs to stay live the entire time any of
@@ -53,12 +53,14 @@ const char* pass = STAPSK;
 BearSSL::CertStore certStore;
 
 // Set time via NTP, as required for x.509 validation
-void setClock() {
+void               setClock()
+{
   configTime(3 * 3600, 0, "pool.ntp.org", "time.nist.gov");
 
   Serial.print("Waiting for NTP time sync: ");
   time_t now = time(nullptr);
-  while (now < 8 * 3600 * 2) {
+  while (now < 8 * 3600 * 2)
+  {
     delay(500);
     Serial.print(".");
     now = time(nullptr);
@@ -71,14 +73,17 @@ void setClock() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump URL
-void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
-  if (!path) {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path)
+{
+  if (!path)
+  {
     path = "/";
   }
 
   Serial.printf("Trying: %s:443...", host);
   client->connect(host, port);
-  if (!client->connected()) {
+  if (!client->connected())
+  {
     Serial.printf("*** Can't connect. ***\n-------\n");
     return;
   }
@@ -90,18 +95,22 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   client->write("\r\nUser-Agent: ESP8266\r\n");
   client->write("\r\n");
   uint32_t to = millis() + 5000;
-  if (client->connected()) {
-    do {
+  if (client->connected())
+  {
+    do
+    {
       char tmp[32];
       memset(tmp, 0, 32);
       int rlen = client->read((uint8_t*)tmp, sizeof(tmp) - 1);
       yield();
-      if (rlen < 0) {
+      if (rlen < 0)
+      {
         break;
       }
       // Only print out first line up to \r, then abort connection
       char* nl = strchr(tmp, '\r');
-      if (nl) {
+      if (nl)
+      {
         *nl = 0;
         Serial.print(tmp);
         break;
@@ -113,7 +122,8 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   Serial.printf("\n-------\n");
 }
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   Serial.println();
   Serial.println();
@@ -126,7 +136,8 @@ void setup() {
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -136,13 +147,14 @@ void setup() {
   Serial.println("IP address: ");
   Serial.println(WiFi.localIP());
 
-  setClock(); // Required for X.509 validation
+  setClock();  // Required for X.509 validation
 
   int numCerts = certStore.initCertStore(LittleFS, PSTR("/certs.idx"), PSTR("/certs.ar"));
   Serial.printf("Number of CA certs read: %d\n", numCerts);
-  if (numCerts == 0) {
+  if (numCerts == 0)
+  {
     Serial.printf("No certs found. Did you run certs-from-mozilla.py and upload the LittleFS directory before running?\n");
-    return; // Can't connect to anything w/o certs!
+    return;  // Can't connect to anything w/o certs!
   }
 
   BearSSL::WiFiClientSecure* bear = new BearSSL::WiFiClientSecure();
@@ -153,10 +165,12 @@ void setup() {
   delete bear;
 }
 
-void loop() {
+void loop()
+{
   Serial.printf("\nPlease enter a website address (www.blah.com) to connect to: ");
   String site;
-  do {
+  do
+  {
     site = Serial.readString();
   } while (site == "");
   // Strip newline if present
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_MaxFragmentLength/BearSSL_MaxFragmentLength.ino b/libraries/ESP8266WiFi/examples/BearSSL_MaxFragmentLength/BearSSL_MaxFragmentLength.ino
index b58177712c..dea9f92649 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_MaxFragmentLength/BearSSL_MaxFragmentLength.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_MaxFragmentLength/BearSSL_MaxFragmentLength.ino
@@ -15,20 +15,24 @@
 const char* ssid = STASSID;
 const char* pass = STAPSK;
 
-void fetch(BearSSL::WiFiClientSecure* client) {
+void        fetch(BearSSL::WiFiClientSecure* client)
+{
   client->write("GET / HTTP/1.0\r\nHost: tls.mbed.org\r\nUser-Agent: ESP8266\r\n\r\n");
   client->flush();
   using oneShot = esp8266::polledTimeout::oneShot;
   oneShot timeout(5000);
-  do {
+  do
+  {
     char tmp[32];
-    int rlen = client->read((uint8_t*)tmp, sizeof(tmp) - 1);
+    int  rlen = client->read((uint8_t*)tmp, sizeof(tmp) - 1);
     yield();
-    if (rlen < 0) {
+    if (rlen < 0)
+    {
       break;
     }
-    if (rlen == 0) {
-      delay(10); // Give background processes some time
+    if (rlen == 0)
+    {
+      delay(10);  // Give background processes some time
       continue;
     }
     tmp[rlen] = '\0';
@@ -38,7 +42,8 @@ void fetch(BearSSL::WiFiClientSecure* client) {
   Serial.printf("\n-------\n");
 }
 
-int fetchNoMaxFragmentLength() {
+int fetchNoMaxFragmentLength()
+{
   int ret = ESP.getFreeHeap();
 
   Serial.printf("\nConnecting to https://tls.mbed.org\n");
@@ -47,18 +52,22 @@ int fetchNoMaxFragmentLength() {
   BearSSL::WiFiClientSecure client;
   client.setInsecure();
   client.connect("tls.mbed.org", 443);
-  if (client.connected()) {
+  if (client.connected())
+  {
     Serial.printf("Memory used: %d\n", ret - ESP.getFreeHeap());
     ret -= ESP.getFreeHeap();
     fetch(&client);
-  } else {
+  }
+  else
+  {
     Serial.printf("Unable to connect\n");
   }
   return ret;
 }
 
-int fetchMaxFragmentLength() {
-  int ret = ESP.getFreeHeap();
+int fetchMaxFragmentLength()
+{
+  int                       ret = ESP.getFreeHeap();
 
   // Servers which implement RFC6066's Maximum Fragment Length Negotiation
   // can be configured to limit the size of TLS fragments they transmit.
@@ -82,22 +91,27 @@ int fetchMaxFragmentLength() {
   bool mfln = client.probeMaxFragmentLength("tls.mbed.org", 443, 512);
   Serial.printf("\nConnecting to https://tls.mbed.org\n");
   Serial.printf("MFLN supported: %s\n", mfln ? "yes" : "no");
-  if (mfln) {
+  if (mfln)
+  {
     client.setBufferSizes(512, 512);
   }
   client.connect("tls.mbed.org", 443);
-  if (client.connected()) {
+  if (client.connected())
+  {
     Serial.printf("MFLN status: %s\n", client.getMFLNStatus() ? "true" : "false");
     Serial.printf("Memory used: %d\n", ret - ESP.getFreeHeap());
     ret -= ESP.getFreeHeap();
     fetch(&client);
-  } else {
+  }
+  else
+  {
     Serial.printf("Unable to connect\n");
   }
   return ret;
 }
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
 
   delay(1000);
@@ -111,7 +125,8 @@ void setup() {
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -122,7 +137,8 @@ void setup() {
   Serial.println(WiFi.localIP());
 }
 
-void loop() {
+void loop()
+{
   Serial.printf("\n\n\n\n\n");
 
   yield();
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
index 08d81c697b..bcb08789b0 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
@@ -42,8 +42,8 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* pass = STAPSK;
+const char*               ssid = STASSID;
+const char*               pass = STAPSK;
 
 // The HTTPS server
 BearSSL::WiFiServerSecure server(443);
@@ -85,7 +85,7 @@ Zs0aiirNGTEymRX4rw26Qg==
 )EOF";
 
 // The server's public certificate which must be shared
-const char server_cert[] PROGMEM = R"EOF(
+const char server_cert[] PROGMEM        = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIDUTCCAjmgAwIBAgIJAOcfK7c3JQtnMA0GCSqGSIb3DQEBCwUAMD8xCzAJBgNV
 BAYTAkFVMQ0wCwYDVQQIDAROb25lMQ0wCwYDVQQKDAROb25lMRIwEAYDVQQDDAlF
@@ -109,7 +109,7 @@ UsQIIGpPVh1plR1vYNndDeBpRJSFkoJTkgAIrlFzSMwNebU0pg==
 )EOF";
 
 #else
-const char server_cert[] PROGMEM = R"EOF(
+const char              server_cert[] PROGMEM        = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIB0zCCAXqgAwIBAgIJALANi2eTiGD/MAoGCCqGSM49BAMCMEUxCzAJBgNVBAYT
 AkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRn
@@ -125,7 +125,7 @@ Af8wCgYIKoZIzj0EAwIDRwAwRAIgWvy7ofQTGZMNqxUfe4gjtkU+C9AkQtaOMW2U
 )EOF";
 
 // The server's private key which must be kept secret
-const char server_private_key[] PROGMEM = R"EOF(
+const char              server_private_key[] PROGMEM = R"EOF(
 -----BEGIN EC PARAMETERS-----
 BggqhkjOPQMBBw==
 -----END EC PARAMETERS-----
@@ -138,11 +138,11 @@ GBEnkz4KpKv7TkHoW+j7F5EMcLcSrUIpyw==
 
 #endif
 
-#define CACHE_SIZE 5 // Number of sessions to cache.
-// Caching SSL sessions shortens the length of the SSL handshake.
-// You can see the performance improvement by looking at the
-// Network tab of the developer tools of your browser.
-#define USE_CACHE // Enable SSL session caching.
+#define CACHE_SIZE 5  // Number of sessions to cache.
+#define USE_CACHE     // Enable SSL session caching.                                    \
+                      // Caching SSL sessions shortens the length of the SSL handshake. \
+                      // You can see the performance improvement by looking at the      \
+                      // Network tab of the developer tools of your browser.
 //#define DYNAMIC_CACHE // Whether to dynamically allocate the cache.
 
 #if defined(USE_CACHE) && defined(DYNAMIC_CACHE)
@@ -150,11 +150,12 @@ GBEnkz4KpKv7TkHoW+j7F5EMcLcSrUIpyw==
 BearSSL::ServerSessions serverCache(CACHE_SIZE);
 #elif defined(USE_CACHE)
 // Statically allocated cache.
-ServerSession store[CACHE_SIZE];
+ServerSession           store[CACHE_SIZE];
 BearSSL::ServerSessions serverCache(store, CACHE_SIZE);
 #endif
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   Serial.println();
   Serial.println();
@@ -165,7 +166,8 @@ void setup() {
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -176,8 +178,8 @@ void setup() {
   Serial.println(WiFi.localIP());
 
   // Attach the server private cert/key combo
-  BearSSL::X509List* serverCertList = new BearSSL::X509List(server_cert);
-  BearSSL::PrivateKey* serverPrivKey = new BearSSL::PrivateKey(server_private_key);
+  BearSSL::X509List*   serverCertList = new BearSSL::X509List(server_cert);
+  BearSSL::PrivateKey* serverPrivKey  = new BearSSL::PrivateKey(server_private_key);
 #ifndef USE_EC
   server.setRSACert(serverCertList, serverPrivKey);
 #else
@@ -204,34 +206,46 @@ static const char* HTTP_RES = "HTTP/1.0 200 OK\r\n"
                               "</body>\r\n"
                               "</html>\r\n";
 
-void loop() {
-  static int cnt;
+void loop()
+{
+  static int                cnt;
   BearSSL::WiFiClientSecure incoming = server.accept();
-  if (!incoming) {
+  if (!incoming)
+  {
     return;
   }
   Serial.printf("Incoming connection...%d\n", cnt++);
 
   // Ugly way to wait for \r\n (i.e. end of HTTP request which we don't actually parse here)
   uint32_t timeout = millis() + 1000;
-  int lcwn = 0;
-  for (;;) {
+  int      lcwn    = 0;
+  for (;;)
+  {
     unsigned char x = 0;
-    if ((millis() > timeout) || (incoming.available() && incoming.read(&x, 1) < 0)) {
+    if ((millis() > timeout) || (incoming.available() && incoming.read(&x, 1) < 0))
+    {
       incoming.stop();
       Serial.printf("Connection error, closed\n");
       return;
-    } else if (!x) {
+    }
+    else if (!x)
+    {
       yield();
       continue;
-    } else if (x == 0x0D) {
+    }
+    else if (x == 0x0D)
+    {
       continue;
-    } else if (x == 0x0A) {
-      if (lcwn) {
+    }
+    else if (x == 0x0A)
+    {
+      if (lcwn)
+      {
         break;
       }
       lcwn = 1;
-    } else
+    }
+    else
       lcwn = 0;
   }
   incoming.write((uint8_t*)HTTP_RES, strlen(HTTP_RES));
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino b/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
index 58687f9041..e10a443199 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
@@ -70,15 +70,15 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* pass = STAPSK;
+const char*               ssid = STASSID;
+const char*               pass = STAPSK;
 
 // The server which will require a client cert signed by the trusted CA
 BearSSL::WiFiServerSecure server(443);
 
 // The hardcoded certificate authority for this example.
 // Don't use it on your own apps!!!!!
-const char ca_cert[] PROGMEM = R"EOF(
+const char                ca_cert[] PROGMEM            = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIC1TCCAb2gAwIBAgIJAMPt1Ms37+hLMA0GCSqGSIb3DQEBCwUAMCExCzAJBgNV
 BAYTAlVTMRIwEAYDVQQDDAkxMjcuMC4wLjMwHhcNMTgwMzE0MDQyMTU0WhcNMjkw
@@ -100,7 +100,7 @@ X8yKI14mFOGxuvcygG8L2xxysW7Zq+9g+O7gW0Pm6RDYnUQmIwY83h1KFCtYCJdS
 )EOF";
 
 // The server's private key which must be kept secret
-const char server_private_key[] PROGMEM = R"EOF(
+const char                server_private_key[] PROGMEM = R"EOF(
 -----BEGIN RSA PRIVATE KEY-----
 MIIEowIBAAKCAQEAsRNVTvqP++YUh8NrbXwE83xVsDqcB3F76xcXNKFDERfVd2P/
 LvyDovCcoQtT0UCRgPcxRp894EuPH/Ru6Z2Lu85sV//i7ce27tc2WRFSfuhlRxHP
@@ -131,7 +131,7 @@ tPYglR5fjuRF/wnt3oX9JlQ2RtSbs+3naXH8JoherHaqNn8UpH0t
 )EOF";
 
 // The server's public certificate which must be shared
-const char server_cert[] PROGMEM = R"EOF(
+const char                server_cert[] PROGMEM        = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIDTzCCAjcCCQDPXvMRYOpeuDANBgkqhkiG9w0BAQsFADCBpjESMBAGA1UEAwwJ
 MTI3LjAuMC4xMQswCQYDVQQGEwJVUzElMCMGA1UECgwcTXkgT3duIENlcnRpZmlj
@@ -160,12 +160,14 @@ seoK24dHmt6tWmn/sbxX7Aa6TL/4mVlFoOgcaTJyVaY/BrY=
 // head of the app.
 
 // Set time via NTP, as required for x.509 validation
-void setClock() {
+void                      setClock()
+{
   configTime(3 * 3600, 0, "pool.ntp.org", "time.nist.gov");
 
   Serial.print("Waiting for NTP time sync: ");
   time_t now = time(nullptr);
-  while (now < 8 * 3600 * 2) {
+  while (now < 8 * 3600 * 2)
+  {
     delay(500);
     Serial.print(".");
     now = time(nullptr);
@@ -177,7 +179,8 @@ void setClock() {
   Serial.print(asctime(&timeinfo));
 }
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   Serial.println();
   Serial.println();
@@ -188,7 +191,8 @@ void setup() {
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -198,11 +202,11 @@ void setup() {
   Serial.println("IP address: ");
   Serial.println(WiFi.localIP());
 
-  setClock(); // Required for X.509 validation
+  setClock();  // Required for X.509 validation
 
   // Attach the server private cert/key combo
-  BearSSL::X509List* serverCertList = new BearSSL::X509List(server_cert);
-  BearSSL::PrivateKey* serverPrivKey = new BearSSL::PrivateKey(server_private_key);
+  BearSSL::X509List*   serverCertList = new BearSSL::X509List(server_cert);
+  BearSSL::PrivateKey* serverPrivKey  = new BearSSL::PrivateKey(server_private_key);
   server.setRSACert(serverCertList, serverPrivKey);
 
   // Require a certificate validated by the trusted CA
@@ -224,33 +228,45 @@ static const char* HTTP_RES = "HTTP/1.0 200 OK\r\n"
                               "</body>\r\n"
                               "</html>\r\n";
 
-void loop() {
+void loop()
+{
   BearSSL::WiFiClientSecure incoming = server.accept();
-  if (!incoming) {
+  if (!incoming)
+  {
     return;
   }
   Serial.println("Incoming connection...\n");
 
   // Ugly way to wait for \r\n (i.e. end of HTTP request which we don't actually parse here)
   uint32_t timeout = millis() + 1000;
-  int lcwn = 0;
-  for (;;) {
+  int      lcwn    = 0;
+  for (;;)
+  {
     unsigned char x = 0;
-    if ((millis() > timeout) || (incoming.available() && incoming.read(&x, 1) < 0)) {
+    if ((millis() > timeout) || (incoming.available() && incoming.read(&x, 1) < 0))
+    {
       incoming.stop();
       Serial.printf("Connection error, closed\n");
       return;
-    } else if (!x) {
+    }
+    else if (!x)
+    {
       yield();
       continue;
-    } else if (x == 0x0D) {
+    }
+    else if (x == 0x0D)
+    {
       continue;
-    } else if (x == 0x0A) {
-      if (lcwn) {
+    }
+    else if (x == 0x0A)
+    {
+      if (lcwn)
+      {
         break;
       }
       lcwn = 1;
-    } else
+    }
+    else
       lcwn = 0;
   }
   incoming.write((uint8_t*)HTTP_RES, strlen(HTTP_RES));
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino b/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
index 5229f1c095..d6b74a6628 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
@@ -17,7 +17,8 @@ const char* pass = STAPSK;
 
 const char* path = "/";
 
-void setup() {
+void        setup()
+{
   Serial.begin(115200);
   Serial.println();
   Serial.println();
@@ -26,7 +27,8 @@ void setup() {
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -39,7 +41,8 @@ void setup() {
 
   Serial.print("Waiting for NTP time sync: ");
   time_t now = time(nullptr);
-  while (now < 8 * 3600 * 2) {
+  while (now < 8 * 3600 * 2)
+  {
     delay(500);
     Serial.print(".");
     now = time(nullptr);
@@ -52,14 +55,17 @@ void setup() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump HTTP response
-void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
-  if (!path) {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path)
+{
+  if (!path)
+  {
     path = "/";
   }
 
   Serial.printf("Trying: %s:443...", host);
   client->connect(host, port);
-  if (!client->connected()) {
+  if (!client->connected())
+  {
     Serial.printf("*** Can't connect. ***\n-------\n");
     return;
   }
@@ -71,18 +77,22 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   client->write("\r\nUser-Agent: ESP8266\r\n");
   client->write("\r\n");
   uint32_t to = millis() + 5000;
-  if (client->connected()) {
-    do {
+  if (client->connected())
+  {
+    do
+    {
       char tmp[32];
       memset(tmp, 0, 32);
       int rlen = client->read((uint8_t*)tmp, sizeof(tmp) - 1);
       yield();
-      if (rlen < 0) {
+      if (rlen < 0)
+      {
         break;
       }
       // Only print out first line up to \r, then abort connection
       char* nl = strchr(tmp, '\r');
-      if (nl) {
+      if (nl)
+      {
         *nl = 0;
         Serial.print(tmp);
         break;
@@ -94,10 +104,11 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   Serial.printf("\n-------\n\n");
 }
 
-void loop() {
-  uint32_t start, finish;
+void loop()
+{
+  uint32_t                  start, finish;
   BearSSL::WiFiClientSecure client;
-  BearSSL::X509List cert(cert_DigiCert_High_Assurance_EV_Root_CA);
+  BearSSL::X509List         cert(cert_DigiCert_High_Assurance_EV_Root_CA);
 
   Serial.printf("Connecting without sessions...");
   start = millis();
@@ -129,5 +140,5 @@ void loop() {
   finish = millis();
   Serial.printf("Total time: %dms\n", finish - start);
 
-  delay(10000); // Avoid DDOSing github
+  delay(10000);  // Avoid DDOSing github
 }
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino b/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
index 5968283bd6..6341d09429 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
@@ -21,12 +21,14 @@ const char* pass = STAPSK;
 const char* path = "/";
 
 // Set time via NTP, as required for x.509 validation
-void setClock() {
+void        setClock()
+{
   configTime(3 * 3600, 0, "pool.ntp.org", "time.nist.gov");
 
   Serial.print("Waiting for NTP time sync: ");
   time_t now = time(nullptr);
-  while (now < 8 * 3600 * 2) {
+  while (now < 8 * 3600 * 2)
+  {
     delay(500);
     Serial.print(".");
     now = time(nullptr);
@@ -39,8 +41,10 @@ void setClock() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump HTTP response
-void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
-  if (!path) {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path)
+{
+  if (!path)
+  {
     path = "/";
   }
 
@@ -48,7 +52,8 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   uint32_t freeStackStart = ESP.getFreeContStack();
   Serial.printf("Trying: %s:443...", host);
   client->connect(host, port);
-  if (!client->connected()) {
+  if (!client->connected())
+  {
     Serial.printf("*** Can't connect. ***\n-------\n");
     return;
   }
@@ -60,18 +65,22 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   client->write("\r\nUser-Agent: ESP8266\r\n");
   client->write("\r\n");
   uint32_t to = millis() + 5000;
-  if (client->connected()) {
-    do {
+  if (client->connected())
+  {
+    do
+    {
       char tmp[32];
       memset(tmp, 0, 32);
       int rlen = client->read((uint8_t*)tmp, sizeof(tmp) - 1);
       yield();
-      if (rlen < 0) {
+      if (rlen < 0)
+      {
         break;
       }
       // Only print out first line up to \r, then abort connection
       char* nl = strchr(tmp, '\r');
-      if (nl) {
+      if (nl)
+      {
         *nl = 0;
         Serial.print(tmp);
         break;
@@ -85,7 +94,8 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   Serial.printf("BSSL stack used: %d\n-------\n\n", stack_thunk_get_max_usage());
 }
 
-void fetchNoConfig() {
+void fetchNoConfig()
+{
   Serial.printf(R"EOF(
 If there are no CAs or insecure options specified, BearSSL will not connect.
 Expect the following call to fail as none have been configured.
@@ -94,7 +104,8 @@ Expect the following call to fail as none have been configured.
   fetchURL(&client, gitlab_host, gitlab_port, path);
 }
 
-void fetchInsecure() {
+void fetchInsecure()
+{
   Serial.printf(R"EOF(
 This is absolutely *insecure*, but you can tell BearSSL not to check the
 certificate of the server.  In this mode it will accept ANY certificate,
@@ -105,7 +116,8 @@ which is subject to man-in-the-middle (MITM) attacks.
   fetchURL(&client, gitlab_host, gitlab_port, path);
 }
 
-void fetchFingerprint() {
+void fetchFingerprint()
+{
   Serial.printf(R"EOF(
 The SHA-1 fingerprint of an X.509 certificate can be used to validate it
 instead of the while certificate.  This is not nearly as secure as real
@@ -119,7 +131,8 @@ the root authorities, etc.).
   fetchURL(&client, gitlab_host, gitlab_port, path);
 }
 
-void fetchSelfSigned() {
+void fetchSelfSigned()
+{
   Serial.printf(R"EOF(
 It is also possible to accept *any* self-signed certificate.  This is
 absolutely insecure as anyone can make a self-signed certificate.
@@ -132,7 +145,8 @@ absolutely insecure as anyone can make a self-signed certificate.
   fetchURL(&client, "self-signed.badssl.com", 443, "/");
 }
 
-void fetchKnownKey() {
+void fetchKnownKey()
+{
   Serial.printf(R"EOF(
 The server certificate can be completely ignored and its public key
 hardcoded in your application. This should be secure as the public key
@@ -141,12 +155,13 @@ private and not shared.  A MITM without the private key would not be
 able to establish communications.
 )EOF");
   BearSSL::WiFiClientSecure client;
-  BearSSL::PublicKey key(pubkey_gitlab_com);
+  BearSSL::PublicKey        key(pubkey_gitlab_com);
   client.setKnownKey(&key);
   fetchURL(&client, gitlab_host, gitlab_port, path);
 }
 
-void fetchCertAuthority() {
+void fetchCertAuthority()
+{
   Serial.printf(R"EOF(
 A specific certification authority can be passed in and used to validate
 a chain of certificates from a given server.  These will be validated
@@ -157,7 +172,7 @@ BearSSL does verify the notValidBefore/After fields.
 )EOF");
 
   BearSSL::WiFiClientSecure client;
-  BearSSL::X509List cert(cert_USERTrust_RSA_Certification_Authority);
+  BearSSL::X509List         cert(cert_USERTrust_RSA_Certification_Authority);
   client.setTrustAnchors(&cert);
   Serial.printf("Try validating without setting the time (should fail)\n");
   fetchURL(&client, gitlab_host, gitlab_port, path);
@@ -167,7 +182,8 @@ BearSSL does verify the notValidBefore/After fields.
   fetchURL(&client, gitlab_host, gitlab_port, path);
 }
 
-void fetchFaster() {
+void fetchFaster()
+{
   Serial.printf(R"EOF(
 The ciphers used to set up the SSL connection can be configured to
 only support faster but less secure ciphers.  If you care about security
@@ -183,7 +199,7 @@ may make sense
   client.setCiphersLessSecure();
   now = millis();
   fetchURL(&client, gitlab_host, gitlab_port, path);
-  uint32_t delta2 = millis() - now;
+  uint32_t              delta2       = millis() - now;
   std::vector<uint16_t> myCustomList = { BR_TLS_RSA_WITH_AES_256_CBC_SHA256, BR_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, BR_TLS_RSA_WITH_3DES_EDE_CBC_SHA };
   client.setInsecure();
   client.setCiphers(myCustomList);
@@ -193,7 +209,8 @@ may make sense
   Serial.printf("Using more secure: %dms\nUsing less secure ciphers: %dms\nUsing custom cipher list: %dms\n", delta, delta2, delta3);
 }
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   Serial.println();
   Serial.println();
@@ -204,7 +221,8 @@ void setup() {
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -223,6 +241,7 @@ void setup() {
   fetchFaster();
 }
 
-void loop() {
+void loop()
+{
   // Nothing to do here
 }
diff --git a/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino b/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
index 0493192afb..0fe6258c40 100644
--- a/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
+++ b/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
@@ -20,19 +20,21 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
-X509List cert(cert_DigiCert_High_Assurance_EV_Root_CA);
+X509List    cert(cert_DigiCert_High_Assurance_EV_Root_CA);
 
-void setup() {
+void        setup()
+{
   Serial.begin(115200);
   Serial.println();
   Serial.print("Connecting to ");
   Serial.println(ssid);
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -46,7 +48,8 @@ void setup() {
 
   Serial.print("Waiting for NTP time sync: ");
   time_t now = time(nullptr);
-  while (now < 8 * 3600 * 2) {
+  while (now < 8 * 3600 * 2)
+  {
     delay(500);
     Serial.print(".");
     now = time(nullptr);
@@ -65,7 +68,8 @@ void setup() {
   Serial.printf("Using certificate: %s\n", cert_DigiCert_High_Assurance_EV_Root_CA);
   client.setTrustAnchors(&cert);
 
-  if (!client.connect(github_host, github_port)) {
+  if (!client.connect(github_host, github_port))
+  {
     Serial.println("Connection failed");
     return;
   }
@@ -77,17 +81,22 @@ void setup() {
   client.print(String("GET ") + url + " HTTP/1.1\r\n" + "Host: " + github_host + "\r\n" + "User-Agent: BuildFailureDetectorESP8266\r\n" + "Connection: close\r\n\r\n");
 
   Serial.println("Request sent");
-  while (client.connected()) {
+  while (client.connected())
+  {
     String line = client.readStringUntil('\n');
-    if (line == "\r") {
+    if (line == "\r")
+    {
       Serial.println("Headers received");
       break;
     }
   }
   String line = client.readStringUntil('\n');
-  if (line.startsWith("{\"state\":\"success\"")) {
+  if (line.startsWith("{\"state\":\"success\""))
+  {
     Serial.println("esp8266/Arduino CI successful!");
-  } else {
+  }
+  else
+  {
     Serial.println("esp8266/Arduino CI has failed");
   }
   Serial.println("Reply was:");
@@ -97,5 +106,6 @@ void setup() {
   Serial.println("Closing connection");
 }
 
-void loop() {
+void loop()
+{
 }
diff --git a/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino b/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
index 6087b688b1..56b767869c 100644
--- a/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
+++ b/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
@@ -26,70 +26,83 @@
 #define STAPSK "your-password"
 #endif
 
-#define FQDN F("www.google.com") // with both IPv4 & IPv6 addresses
-#define FQDN2 F("www.yahoo.com") // with both IPv4 & IPv6 addresses
-#define FQDN6 F("ipv6.google.com") // does not resolve in IPv4
+#define FQDN F("www.google.com")    // with both IPv4 & IPv6 addresses
+#define FQDN2 F("www.yahoo.com")    // with both IPv4 & IPv6 addresses
+#define FQDN6 F("ipv6.google.com")  // does not resolve in IPv4
 #define STATUSDELAY_MS 10000
 #define TCP_PORT 23
 #define UDP_PORT 23
 
-WiFiServer statusServer(TCP_PORT);
-WiFiUDP udp;
+WiFiServer                         statusServer(TCP_PORT);
+WiFiUDP                            udp;
 esp8266::polledTimeout::periodicMs showStatusOnSerialNow(STATUSDELAY_MS);
 
-void fqdn(Print& out, const String& fqdn) {
+void                               fqdn(Print& out, const String& fqdn)
+{
   out.print(F("resolving "));
   out.print(fqdn);
   out.print(F(": "));
   IPAddress result;
-  if (WiFi.hostByName(fqdn.c_str(), result)) {
+  if (WiFi.hostByName(fqdn.c_str(), result))
+  {
     result.printTo(out);
     out.println();
-  } else {
+  }
+  else
+  {
     out.println(F("timeout or not found"));
   }
 }
 
 #if LWIP_IPV4 && LWIP_IPV6
-void fqdn_rt(Print& out, const String& fqdn, DNSResolveType resolveType) {
+void fqdn_rt(Print& out, const String& fqdn, DNSResolveType resolveType)
+{
   out.print(F("resolving "));
   out.print(fqdn);
   out.print(F(": "));
   IPAddress result;
-  if (WiFi.hostByName(fqdn.c_str(), result, 10000, resolveType)) {
+  if (WiFi.hostByName(fqdn.c_str(), result, 10000, resolveType))
+  {
     result.printTo(out);
     out.println();
-  } else {
+  }
+  else
+  {
     out.println(F("timeout or not found"));
   }
 }
 #endif
 
-void status(Print& out) {
+void status(Print& out)
+{
   out.println(F("------------------------------"));
   out.println(ESP.getFullVersion());
 
-  for (int i = 0; i < DNS_MAX_SERVERS; i++) {
+  for (int i = 0; i < DNS_MAX_SERVERS; i++)
+  {
     IPAddress dns = WiFi.dnsIP(i);
-    if (dns.isSet()) {
+    if (dns.isSet())
+    {
       out.printf("dns%d: %s\n", i, dns.toString().c_str());
     }
   }
 
   out.println(F("Try me at these addresses:"));
   out.println(F("(with 'telnet <addr> or 'nc -u <addr> 23')"));
-  for (auto a : addrList) {
+  for (auto a : addrList)
+  {
     out.printf("IF='%s' IPv6=%d local=%d hostname='%s' addr= %s",
-        a.ifname().c_str(),
-        a.isV6(),
-        a.isLocal(),
-        a.ifhostname(),
-        a.toString().c_str());
-
-    if (a.isLegacy()) {
+               a.ifname().c_str(),
+               a.isV6(),
+               a.isLocal(),
+               a.ifhostname(),
+               a.toString().c_str());
+
+    if (a.isLegacy())
+    {
       out.printf(" / mask:%s / gw:%s",
-          a.netmask().toString().c_str(),
-          a.gw().toString().c_str());
+                 a.netmask().toString().c_str(),
+                 a.gw().toString().c_str());
     }
 
     out.println();
@@ -100,13 +113,14 @@ void status(Print& out) {
   fqdn(out, FQDN);
   fqdn(out, FQDN6);
 #if LWIP_IPV4 && LWIP_IPV6
-  fqdn_rt(out, FQDN, DNSResolveType::DNS_AddrType_IPv4_IPv6); // IPv4 before IPv6
-  fqdn_rt(out, FQDN2, DNSResolveType::DNS_AddrType_IPv6_IPv4); // IPv6 before IPv4
+  fqdn_rt(out, FQDN, DNSResolveType::DNS_AddrType_IPv4_IPv6);   // IPv4 before IPv6
+  fqdn_rt(out, FQDN2, DNSResolveType::DNS_AddrType_IPv6_IPv4);  // IPv6 before IPv4
 #endif
   out.println(F("------------------------------"));
 }
 
-void setup() {
+void setup()
+{
   WiFi.hostname("ipv6test");
 
   Serial.begin(115200);
@@ -124,7 +138,7 @@ void setup() {
 
   status(Serial);
 
-#if 0 // 0: legacy connecting loop - 1: wait for IPv6
+#if 0  // 0: legacy connecting loop - 1: wait for IPv6
 
   // legacy loop (still valid with IPv4 only)
 
@@ -142,12 +156,14 @@ void setup() {
   //   (false for any other including 192.168./16 and 10./24 since NAT may be in the equation)
   // - IPV6 link-local addresses (fe80::/64)
 
-  for (bool configured = false; !configured;) {
+  for (bool configured = false; !configured;)
+  {
     for (auto addr : addrList)
       if ((configured = !addr.isLocal()
-              // && addr.isV6() // uncomment when IPv6 is mandatory
-              // && addr.ifnumber() == STATION_IF
-              )) {
+           // && addr.isV6() // uncomment when IPv6 is mandatory
+           // && addr.ifnumber() == STATION_IF
+           ))
+      {
         break;
       }
     Serial.print('.');
@@ -171,16 +187,18 @@ void setup() {
 
 unsigned long statusTimeMs = 0;
 
-void loop() {
-
-  if (statusServer.hasClient()) {
+void          loop()
+{
+  if (statusServer.hasClient())
+  {
     WiFiClient cli = statusServer.accept();
     status(cli);
   }
 
   // if there's data available, read a packet
   int packetSize = udp.parsePacket();
-  if (packetSize) {
+  if (packetSize)
+  {
     Serial.print(F("udp received "));
     Serial.print(packetSize);
     Serial.print(F(" bytes from "));
@@ -188,7 +206,8 @@ void loop() {
     Serial.print(F(" :"));
     Serial.println(udp.remotePort());
     int c;
-    while ((c = udp.read()) >= 0) {
+    while ((c = udp.read()) >= 0)
+    {
       Serial.write(c);
     }
 
@@ -198,7 +217,8 @@ void loop() {
     udp.endPacket();
   }
 
-  if (showStatusOnSerialNow) {
+  if (showStatusOnSerialNow)
+  {
     status(Serial);
   }
 }
diff --git a/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino b/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
index 780bb71485..5a24e2cf50 100644
--- a/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
+++ b/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
@@ -26,25 +26,26 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID; // your network SSID (name)
-const char* pass = STAPSK; // your network password
+const char*  ssid      = STASSID;  // your network SSID (name)
+const char*  pass      = STAPSK;   // your network password
 
-unsigned int localPort = 2390; // local port to listen for UDP packets
+unsigned int localPort = 2390;  // local port to listen for UDP packets
 
 /* Don't hardwire the IP address or we won't get the benefits of the pool.
     Lookup the IP address for the host name instead */
 //IPAddress timeServer(129, 6, 15, 28); // time.nist.gov NTP server
-IPAddress timeServerIP; // time.nist.gov NTP server address
-const char* ntpServerName = "time.nist.gov";
+IPAddress    timeServerIP;  // time.nist.gov NTP server address
+const char*  ntpServerName   = "time.nist.gov";
 
-const int NTP_PACKET_SIZE = 48; // NTP time stamp is in the first 48 bytes of the message
+const int    NTP_PACKET_SIZE = 48;  // NTP time stamp is in the first 48 bytes of the message
 
-byte packetBuffer[NTP_PACKET_SIZE]; //buffer to hold incoming and outgoing packets
+byte         packetBuffer[NTP_PACKET_SIZE];  //buffer to hold incoming and outgoing packets
 
 // A UDP instance to let us send and receive packets over UDP
-WiFiUDP udp;
+WiFiUDP      udp;
 
-void setup() {
+void         setup()
+{
   Serial.begin(115200);
   Serial.println();
   Serial.println();
@@ -55,7 +56,8 @@ void setup() {
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -71,28 +73,32 @@ void setup() {
   Serial.println(udp.localPort());
 }
 
-void loop() {
+void loop()
+{
   //get a random server from the pool
   WiFi.hostByName(ntpServerName, timeServerIP);
 
-  sendNTPpacket(timeServerIP); // send an NTP packet to a time server
+  sendNTPpacket(timeServerIP);  // send an NTP packet to a time server
   // wait to see if a reply is available
   delay(1000);
 
   int cb = udp.parsePacket();
-  if (!cb) {
+  if (!cb)
+  {
     Serial.println("no packet yet");
-  } else {
+  }
+  else
+  {
     Serial.print("packet received, length=");
     Serial.println(cb);
     // We've received a packet, read the data from it
-    udp.read(packetBuffer, NTP_PACKET_SIZE); // read the packet into the buffer
+    udp.read(packetBuffer, NTP_PACKET_SIZE);  // read the packet into the buffer
 
     //the timestamp starts at byte 40 of the received packet and is four bytes,
     // or two words, long. First, esxtract the two words:
 
-    unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);
-    unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]);
+    unsigned long highWord      = word(packetBuffer[40], packetBuffer[41]);
+    unsigned long lowWord       = word(packetBuffer[42], packetBuffer[43]);
     // combine the four bytes (two words) into a long integer
     // this is NTP time (seconds since Jan 1 1900):
     unsigned long secsSince1900 = highWord << 16 | lowWord;
@@ -104,41 +110,44 @@ void loop() {
     // Unix time starts on Jan 1 1970. In seconds, that's 2208988800:
     const unsigned long seventyYears = 2208988800UL;
     // subtract seventy years:
-    unsigned long epoch = secsSince1900 - seventyYears;
+    unsigned long       epoch        = secsSince1900 - seventyYears;
     // print Unix time:
     Serial.println(epoch);
 
     // print the hour, minute and second:
-    Serial.print("The UTC time is "); // UTC is the time at Greenwich Meridian (GMT)
-    Serial.print((epoch % 86400L) / 3600); // print the hour (86400 equals secs per day)
+    Serial.print("The UTC time is ");       // UTC is the time at Greenwich Meridian (GMT)
+    Serial.print((epoch % 86400L) / 3600);  // print the hour (86400 equals secs per day)
     Serial.print(':');
-    if (((epoch % 3600) / 60) < 10) {
+    if (((epoch % 3600) / 60) < 10)
+    {
       // In the first 10 minutes of each hour, we'll want a leading '0'
       Serial.print('0');
     }
-    Serial.print((epoch % 3600) / 60); // print the minute (3600 equals secs per minute)
+    Serial.print((epoch % 3600) / 60);  // print the minute (3600 equals secs per minute)
     Serial.print(':');
-    if ((epoch % 60) < 10) {
+    if ((epoch % 60) < 10)
+    {
       // In the first 10 seconds of each minute, we'll want a leading '0'
       Serial.print('0');
     }
-    Serial.println(epoch % 60); // print the second
+    Serial.println(epoch % 60);  // print the second
   }
   // wait ten seconds before asking for the time again
   delay(10000);
 }
 
 // send an NTP request to the time server at the given address
-void sendNTPpacket(IPAddress& address) {
+void sendNTPpacket(IPAddress& address)
+{
   Serial.println("sending NTP packet...");
   // set all bytes in the buffer to 0
   memset(packetBuffer, 0, NTP_PACKET_SIZE);
   // Initialize values needed to form NTP request
   // (see URL above for details on the packets)
-  packetBuffer[0] = 0b11100011; // LI, Version, Mode
-  packetBuffer[1] = 0; // Stratum, or type of clock
-  packetBuffer[2] = 6; // Polling Interval
-  packetBuffer[3] = 0xEC; // Peer Clock Precision
+  packetBuffer[0]  = 0b11100011;  // LI, Version, Mode
+  packetBuffer[1]  = 0;           // Stratum, or type of clock
+  packetBuffer[2]  = 6;           // Polling Interval
+  packetBuffer[3]  = 0xEC;        // Peer Clock Precision
   // 8 bytes of zero for Root Delay & Root Dispersion
   packetBuffer[12] = 49;
   packetBuffer[13] = 0x4E;
@@ -147,7 +156,7 @@ void sendNTPpacket(IPAddress& address) {
 
   // all NTP fields have been given values, now
   // you can send a packet requesting a timestamp:
-  udp.beginPacket(address, 123); //NTP requests are to port 123
+  udp.beginPacket(address, 123);  //NTP requests are to port 123
   udp.write(packetBuffer, NTP_PACKET_SIZE);
   udp.endPacket();
 }
diff --git a/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino b/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
index 198cae34b0..65754b12f4 100644
--- a/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
+++ b/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
@@ -28,13 +28,13 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*       ssid     = STASSID;
+const char*       password = STAPSK;
 
 ArduinoWiFiServer server(2323);
 
-void setup() {
-
+void              setup()
+{
   Serial.begin(115200);
 
   Serial.println();
@@ -43,7 +43,8 @@ void setup() {
 
   WiFi.begin(ssid, password);
 
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -58,15 +59,16 @@ void setup() {
   Serial.println(" 2323");
 }
 
-void loop() {
-
-  WiFiClient client = server.available(); // returns first client which has data to read or a 'false' client
-  if (client) { // client is true only if it is connected and has data to read
-    String s = client.readStringUntil('\n'); // read the message incoming from one of the clients
-    s.trim(); // trim eventual \r
-    Serial.println(s); // print the message to Serial Monitor
-    client.print("echo: "); // this is only for the sending client
-    server.println(s); // send the message to all connected clients
-    server.flush(); // flush the buffers
+void loop()
+{
+  WiFiClient client = server.available();  // returns first client which has data to read or a 'false' client
+  if (client)
+  {                                           // client is true only if it is connected and has data to read
+    String s = client.readStringUntil('\n');  // read the message incoming from one of the clients
+    s.trim();                                 // trim eventual \r
+    Serial.println(s);                        // print the message to Serial Monitor
+    client.print("echo: ");                   // this is only for the sending client
+    server.println(s);                        // send the message to all connected clients
+    server.flush();                           // flush the buffers
   }
 }
diff --git a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
index a908495150..1dccfab67d 100644
--- a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
+++ b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
@@ -22,7 +22,8 @@
 
 #include <NetDump.h>
 
-void dump(int netif_idx, const char* data, size_t len, int out, int success) {
+void dump(int netif_idx, const char* data, size_t len, int out, int success)
+{
   (void)success;
   Serial.print(out ? F("out ") : F(" in "));
   Serial.printf("%d ", netif_idx);
@@ -35,7 +36,8 @@ void dump(int netif_idx, const char* data, size_t len, int out, int success) {
 }
 #endif
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   Serial.printf("\n\nNAPT Range extender\n");
   Serial.printf("Heap on start: %d\n", ESP.getFreeHeap());
@@ -47,20 +49,21 @@ void setup() {
   // first, connect to STA so we can get a proper local DNS server
   WiFi.mode(WIFI_STA);
   WiFi.begin(STASSID, STAPSK);
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     Serial.print('.');
     delay(500);
   }
   Serial.printf("\nSTA: %s (dns: %s / %s)\n",
-      WiFi.localIP().toString().c_str(),
-      WiFi.dnsIP(0).toString().c_str(),
-      WiFi.dnsIP(1).toString().c_str());
+                WiFi.localIP().toString().c_str(),
+                WiFi.dnsIP(0).toString().c_str(),
+                WiFi.dnsIP(1).toString().c_str());
 
   // give DNS servers to AP side
   dhcpSoftAP.dhcps_set_dns(0, WiFi.dnsIP(0));
   dhcpSoftAP.dhcps_set_dns(1, WiFi.dnsIP(1));
 
-  WiFi.softAPConfig( // enable AP, with android-compatible google domain
+  WiFi.softAPConfig(  // enable AP, with android-compatible google domain
       IPAddress(172, 217, 28, 254),
       IPAddress(172, 217, 28, 254),
       IPAddress(255, 255, 255, 0));
@@ -70,27 +73,32 @@ void setup() {
   Serial.printf("Heap before: %d\n", ESP.getFreeHeap());
   err_t ret = ip_napt_init(NAPT, NAPT_PORT);
   Serial.printf("ip_napt_init(%d,%d): ret=%d (OK=%d)\n", NAPT, NAPT_PORT, (int)ret, (int)ERR_OK);
-  if (ret == ERR_OK) {
+  if (ret == ERR_OK)
+  {
     ret = ip_napt_enable_no(SOFTAP_IF, 1);
     Serial.printf("ip_napt_enable_no(SOFTAP_IF): ret=%d (OK=%d)\n", (int)ret, (int)ERR_OK);
-    if (ret == ERR_OK) {
+    if (ret == ERR_OK)
+    {
       Serial.printf("WiFi Network '%s' with same password is now NATed behind '%s'\n", STASSID "extender", STASSID);
     }
   }
   Serial.printf("Heap after napt init: %d\n", ESP.getFreeHeap());
-  if (ret != ERR_OK) {
+  if (ret != ERR_OK)
+  {
     Serial.printf("NAPT initialization failed\n");
   }
 }
 
 #else
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   Serial.printf("\n\nNAPT not supported in this configuration\n");
 }
 
 #endif
 
-void loop() {
+void loop()
+{
 }
diff --git a/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino b/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
index ada965fc16..e057fc3ada 100644
--- a/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
+++ b/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
@@ -7,31 +7,32 @@
 #include <LwipDhcpServer.h>
 
 /* Set these to your desired credentials. */
-const char* ssid = "ESPap";
-const char* password = "thereisnospoon";
+const char*      ssid     = "ESPap";
+const char*      password = "thereisnospoon";
 
 ESP8266WebServer server(80);
 
 /* Set the IP Address you want for your AP */
-IPAddress apIP(192, 168, 0, 1);
+IPAddress        apIP(192, 168, 0, 1);
 
 /* Go to http://192.168.0.1 in a web browser to see current lease */
-void handleRoot() {
-  String result;
-  char wifiClientMac[18];
-  unsigned char number_client;
+void             handleRoot()
+{
+  String               result;
+  char                 wifiClientMac[18];
+  unsigned char        number_client;
   struct station_info* stat_info;
 
-  int i = 1;
+  int                  i = 1;
 
-  number_client = wifi_softap_get_station_num();
-  stat_info = wifi_softap_get_station_info();
+  number_client          = wifi_softap_get_station_num();
+  stat_info              = wifi_softap_get_station_info();
 
-  result = "<html><body><h1>Total Connected Clients : ";
+  result                 = "<html><body><h1>Total Connected Clients : ";
   result += String(number_client);
   result += "</h1></br>";
-  while (stat_info != NULL) {
-
+  while (stat_info != NULL)
+  {
     result += "Client ";
     result += String(i);
     result += " = ";
@@ -49,10 +50,11 @@ void handleRoot() {
   server.send(200, "text/html", result);
 }
 
-void setup() {
+void setup()
+{
   /* List of mac address for static lease */
   uint8 mac_CAM[6] = { 0x00, 0x0C, 0x43, 0x01, 0x60, 0x15 };
-  uint8 mac_PC[6] = { 0xb4, 0x52, 0x7e, 0x9a, 0x19, 0xa5 };
+  uint8 mac_PC[6]  = { 0xb4, 0x52, 0x7e, 0x9a, 0x19, 0xa5 };
 
   Serial.begin(115200);
   Serial.println();
@@ -76,8 +78,8 @@ void setup() {
      ...
      any client not listed will use next IP address available from the range (here 192.168.0.102 and more)
   */
-  dhcpSoftAP.add_dhcps_lease(mac_CAM); // always 192.168.0.100
-  dhcpSoftAP.add_dhcps_lease(mac_PC); // always 192.168.0.101
+  dhcpSoftAP.add_dhcps_lease(mac_CAM);  // always 192.168.0.100
+  dhcpSoftAP.add_dhcps_lease(mac_PC);   // always 192.168.0.101
   /* Start Access Point. You can remove the password parameter if you want the AP to be open. */
   WiFi.softAP(ssid, password);
   Serial.print("AP IP address: ");
@@ -88,6 +90,7 @@ void setup() {
   Serial.println("HTTP server started");
 }
 
-void loop() {
+void loop()
+{
   server.handleClient();
 }
diff --git a/libraries/ESP8266WiFi/examples/Udp/Udp.ino b/libraries/ESP8266WiFi/examples/Udp/Udp.ino
index d9ff61bfcf..10c4905e63 100644
--- a/libraries/ESP8266WiFi/examples/Udp/Udp.ino
+++ b/libraries/ESP8266WiFi/examples/Udp/Udp.ino
@@ -22,19 +22,21 @@
 #define STAPSK "your-password"
 #endif
 
-unsigned int localPort = 8888; // local port to listen on
+unsigned int localPort = 8888;  // local port to listen on
 
 // buffers for receiving and sending data
-char packetBuffer[UDP_TX_PACKET_MAX_SIZE + 1]; //buffer to hold incoming packet,
-char ReplyBuffer[] = "acknowledged\r\n"; // a string to send back
+char         packetBuffer[UDP_TX_PACKET_MAX_SIZE + 1];  //buffer to hold incoming packet,
+char         ReplyBuffer[] = "acknowledged\r\n";        // a string to send back
 
-WiFiUDP Udp;
+WiFiUDP      Udp;
 
-void setup() {
+void         setup()
+{
   Serial.begin(115200);
   WiFi.mode(WIFI_STA);
   WiFi.begin(STASSID, STAPSK);
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     Serial.print('.');
     delay(500);
   }
@@ -44,18 +46,20 @@ void setup() {
   Udp.begin(localPort);
 }
 
-void loop() {
+void loop()
+{
   // if there's data available, read a packet
   int packetSize = Udp.parsePacket();
-  if (packetSize) {
+  if (packetSize)
+  {
     Serial.printf("Received packet of size %d from %s:%d\n    (to %s:%d, free heap = %d B)\n",
-        packetSize,
-        Udp.remoteIP().toString().c_str(), Udp.remotePort(),
-        Udp.destinationIP().toString().c_str(), Udp.localPort(),
-        ESP.getFreeHeap());
+                  packetSize,
+                  Udp.remoteIP().toString().c_str(), Udp.remotePort(),
+                  Udp.destinationIP().toString().c_str(), Udp.localPort(),
+                  ESP.getFreeHeap());
 
     // read the packet into packetBufffer
-    int n = Udp.read(packetBuffer, UDP_TX_PACKET_MAX_SIZE);
+    int n           = Udp.read(packetBuffer, UDP_TX_PACKET_MAX_SIZE);
     packetBuffer[n] = 0;
     Serial.println("Contents:");
     Serial.println(packetBuffer);
diff --git a/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino b/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
index e32666a74b..e807d9e45f 100644
--- a/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
@@ -40,19 +40,21 @@
 #endif
 
 /* Set these to your desired credentials. */
-const char* ssid = APSSID;
-const char* password = APPSK;
+const char*      ssid     = APSSID;
+const char*      password = APPSK;
 
 ESP8266WebServer server(80);
 
 /* Just a little test message.  Go to http://192.168.4.1 in a web browser
    connected to this access point to see it.
 */
-void handleRoot() {
+void             handleRoot()
+{
   server.send(200, "text/html", "<h1>You are connected</h1>");
 }
 
-void setup() {
+void setup()
+{
   delay(1000);
   Serial.begin(115200);
   Serial.println();
@@ -68,6 +70,7 @@ void setup() {
   Serial.println("HTTP server started");
 }
 
-void loop() {
+void loop()
+{
   server.handleClient();
 }
diff --git a/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino b/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino
index 5299765f62..2083f8cf2e 100644
--- a/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino
@@ -10,13 +10,14 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*    ssid     = STASSID;
+const char*    password = STAPSK;
 
-const char* host = "djxmmx.net";
-const uint16_t port = 17;
+const char*    host     = "djxmmx.net";
+const uint16_t port     = 17;
 
-void setup() {
+void           setup()
+{
   Serial.begin(115200);
 
   // We start by connecting to a WiFi network
@@ -32,7 +33,8 @@ void setup() {
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
 
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -43,7 +45,8 @@ void setup() {
   Serial.println(WiFi.localIP());
 }
 
-void loop() {
+void loop()
+{
   static bool wait = false;
 
   Serial.print("connecting to ");
@@ -53,7 +56,8 @@ void loop() {
 
   // Use WiFiClient class to create TCP connections
   WiFiClient client;
-  if (!client.connect(host, port)) {
+  if (!client.connect(host, port))
+  {
     Serial.println("connection failed");
     delay(5000);
     return;
@@ -61,14 +65,17 @@ void loop() {
 
   // This will send a string to the server
   Serial.println("sending data to server");
-  if (client.connected()) {
+  if (client.connected())
+  {
     client.println("hello from ESP8266");
   }
 
   // wait for data to be available
   unsigned long timeout = millis();
-  while (client.available() == 0) {
-    if (millis() - timeout > 5000) {
+  while (client.available() == 0)
+  {
+    if (millis() - timeout > 5000)
+    {
       Serial.println(">>> Client Timeout !");
       client.stop();
       delay(60000);
@@ -79,7 +86,8 @@ void loop() {
   // Read all the lines of the reply from server and print them to Serial
   Serial.println("receiving from remote server");
   // not testing 'client.connected()' since we do not need to send data here
-  while (client.available()) {
+  while (client.available())
+  {
     char ch = static_cast<char>(client.read());
     Serial.print(ch);
   }
@@ -89,8 +97,9 @@ void loop() {
   Serial.println("closing connection");
   client.stop();
 
-  if (wait) {
-    delay(300000); // execute once every 5 minutes, don't flood remote service
+  if (wait)
+  {
+    delay(300000);  // execute once every 5 minutes, don't flood remote service
   }
   wait = true;
 }
diff --git a/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino b/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
index 8723e7e8cd..7aa4b0baef 100644
--- a/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
@@ -12,15 +12,16 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*      ssid     = STASSID;
+const char*      password = STAPSK;
 
-const char* host = "192.168.1.1";
-const uint16_t port = 3000;
+const char*      host     = "192.168.1.1";
+const uint16_t   port     = 3000;
 
 ESP8266WiFiMulti WiFiMulti;
 
-void setup() {
+void             setup()
+{
   Serial.begin(115200);
 
   // We start by connecting to a WiFi network
@@ -31,7 +32,8 @@ void setup() {
   Serial.println();
   Serial.print("Wait for WiFi... ");
 
-  while (WiFiMulti.run() != WL_CONNECTED) {
+  while (WiFiMulti.run() != WL_CONNECTED)
+  {
     Serial.print(".");
     delay(500);
   }
@@ -44,7 +46,8 @@ void setup() {
   delay(500);
 }
 
-void loop() {
+void loop()
+{
   Serial.print("connecting to ");
   Serial.print(host);
   Serial.print(':');
@@ -53,7 +56,8 @@ void loop() {
   // Use WiFiClient class to create TCP connections
   WiFiClient client;
 
-  if (!client.connect(host, port)) {
+  if (!client.connect(host, port))
+  {
     Serial.println("connection failed");
     Serial.println("wait 5 sec...");
     delay(5000);
diff --git a/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino b/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
index b4761b46d2..6488c2266a 100644
--- a/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
@@ -7,27 +7,27 @@
 #include <ESP8266WiFi.h>
 #include <ESP8266mDNS.h>
 #include <PolledTimeout.h>
-#include <algorithm> // std::min
+#include <algorithm>  // std::min
 
 #ifndef STASSID
 #define STASSID "your-ssid"
 #define STAPSK "your-password"
 #endif
 
-constexpr int port = 23;
+constexpr int                          port = 23;
 
-WiFiServer server(port);
-WiFiClient client;
+WiFiServer                             server(port);
+WiFiClient                             client;
 
-constexpr size_t sizes[] = { 0, 512, 384, 256, 128, 64, 16, 8, 4 };
-constexpr uint32_t breathMs = 200;
-esp8266::polledTimeout::oneShotFastMs enoughMs(breathMs);
+constexpr size_t                       sizes[]  = { 0, 512, 384, 256, 128, 64, 16, 8, 4 };
+constexpr uint32_t                     breathMs = 200;
+esp8266::polledTimeout::oneShotFastMs  enoughMs(breathMs);
 esp8266::polledTimeout::periodicFastMs test(2000);
-int t = 1; // test (1, 2 or 3, see below)
-int s = 0; // sizes[] index
-
-void setup() {
+int                                    t = 1;  // test (1, 2 or 3, see below)
+int                                    s = 0;  // sizes[] index
 
+void                                   setup()
+{
   Serial.begin(115200);
   Serial.println(ESP.getFullVersion());
 
@@ -35,7 +35,8 @@ void setup() {
   WiFi.begin(STASSID, STAPSK);
   Serial.print("\nConnecting to ");
   Serial.println(STASSID);
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     Serial.print('.');
     delay(500);
   }
@@ -51,38 +52,45 @@ void setup() {
                 "- Use 'telnet/nc echo23.local %d' to try echo\n\n"
                 "- Use 'python3 echo-client.py' bandwidth meter to compare transfer APIs\n\n"
                 "  and try typing 1, 1, 1, 2, 2, 2, 3, 3, 3 on console during transfers\n\n",
-      port);
+                port);
 }
 
-void loop() {
-
+void loop()
+{
   MDNS.update();
 
   static uint32_t tot = 0;
   static uint32_t cnt = 0;
-  if (test && cnt) {
+  if (test && cnt)
+  {
     Serial.printf("measured-block-size=%u min-free-stack=%u", tot / cnt, ESP.getFreeContStack());
-    if (t == 2 && sizes[s]) {
+    if (t == 2 && sizes[s])
+    {
       Serial.printf(" (blocks: at most %d bytes)", sizes[s]);
     }
-    if (t == 3 && sizes[s]) {
+    if (t == 3 && sizes[s])
+    {
       Serial.printf(" (blocks: exactly %d bytes)", sizes[s]);
     }
-    if (t == 3 && !sizes[s]) {
+    if (t == 3 && !sizes[s])
+    {
       Serial.printf(" (blocks: any size)");
     }
     Serial.printf("\n");
   }
 
   //check if there are any new clients
-  if (server.hasClient()) {
+  if (server.hasClient())
+  {
     client = server.accept();
     Serial.println("New client");
   }
 
-  if (Serial.available()) {
+  if (Serial.available())
+  {
     s = (s + 1) % (sizeof(sizes) / sizeof(sizes[0]));
-    switch (Serial.read()) {
+    switch (Serial.read())
+    {
       case '1':
         if (t != 1)
           s = 0;
@@ -112,9 +120,11 @@ void loop() {
 
   enoughMs.reset(breathMs);
 
-  if (t == 1) {
+  if (t == 1)
+  {
     // byte by byte
-    while (client.available() && client.availableForWrite() && !enoughMs) {
+    while (client.available() && client.availableForWrite() && !enoughMs)
+    {
       // working char by char is not efficient
       client.write(client.read());
       cnt++;
@@ -122,15 +132,18 @@ void loop() {
     }
   }
 
-  else if (t == 2) {
+  else if (t == 2)
+  {
     // block by block through a local buffer (2 copies)
-    while (client.available() && client.availableForWrite() && !enoughMs) {
+    while (client.available() && client.availableForWrite() && !enoughMs)
+    {
       size_t maxTo = std::min(client.available(), client.availableForWrite());
-      maxTo = std::min(maxTo, sizes[s]);
+      maxTo        = std::min(maxTo, sizes[s]);
       uint8_t buf[maxTo];
-      size_t tcp_got = client.read(buf, maxTo);
-      size_t tcp_sent = client.write(buf, tcp_got);
-      if (tcp_sent != maxTo) {
+      size_t  tcp_got  = client.read(buf, maxTo);
+      size_t  tcp_sent = client.write(buf, tcp_got);
+      if (tcp_sent != maxTo)
+      {
         Serial.printf("len mismatch: available:%zd tcp-read:%zd serial-write:%zd\n", maxTo, tcp_got, tcp_sent);
       }
       tot += tcp_sent;
@@ -138,16 +151,21 @@ void loop() {
     }
   }
 
-  else if (t == 3) {
+  else if (t == 3)
+  {
     // stream to print, possibly with only one copy
-    if (sizes[s]) {
+    if (sizes[s])
+    {
       tot += client.sendSize(&client, sizes[s]);
-    } else {
+    }
+    else
+    {
       tot += client.sendAvailable(&client);
     }
     cnt++;
 
-    switch (client.getLastSendReport()) {
+    switch (client.getLastSendReport())
+    {
       case Stream::Report::Success:
         break;
       case Stream::Report::TimedOut:
@@ -165,12 +183,14 @@ void loop() {
     }
   }
 
-  else if (t == 4) {
+  else if (t == 4)
+  {
     // stream to print, possibly with only one copy
-    tot += client.sendAll(&client); // this one might not exit until peer close
+    tot += client.sendAll(&client);  // this one might not exit until peer close
     cnt++;
 
-    switch (client.getLastSendReport()) {
+    switch (client.getLastSendReport())
+    {
       case Stream::Report::Success:
         break;
       case Stream::Report::TimedOut:
diff --git a/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino b/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
index 70f8d06317..1595abb544 100644
--- a/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
@@ -21,17 +21,18 @@
 #define APPSK "esp8266"
 #endif
 
-const char* ssid = APSSID;
-const char* password = APPSK;
+const char*      ssid     = APSSID;
+const char*      password = APPSK;
 
 WiFiEventHandler stationConnectedHandler;
 WiFiEventHandler stationDisconnectedHandler;
 WiFiEventHandler probeRequestPrintHandler;
 WiFiEventHandler probeRequestBlinkHandler;
 
-bool blinkFlag;
+bool             blinkFlag;
 
-void setup() {
+void             setup()
+{
   Serial.begin(115200);
   pinMode(LED_BUILTIN, OUTPUT);
   digitalWrite(LED_BUILTIN, HIGH);
@@ -46,48 +47,55 @@ void setup() {
   // Register event handlers.
   // Callback functions will be called as long as these handler objects exist.
   // Call "onStationConnected" each time a station connects
-  stationConnectedHandler = WiFi.onSoftAPModeStationConnected(&onStationConnected);
+  stationConnectedHandler    = WiFi.onSoftAPModeStationConnected(&onStationConnected);
   // Call "onStationDisconnected" each time a station disconnects
   stationDisconnectedHandler = WiFi.onSoftAPModeStationDisconnected(&onStationDisconnected);
   // Call "onProbeRequestPrint" and "onProbeRequestBlink" each time
   // a probe request is received.
   // Former will print MAC address of the station and RSSI to Serial,
   // latter will blink an LED.
-  probeRequestPrintHandler = WiFi.onSoftAPModeProbeRequestReceived(&onProbeRequestPrint);
-  probeRequestBlinkHandler = WiFi.onSoftAPModeProbeRequestReceived(&onProbeRequestBlink);
+  probeRequestPrintHandler   = WiFi.onSoftAPModeProbeRequestReceived(&onProbeRequestPrint);
+  probeRequestBlinkHandler   = WiFi.onSoftAPModeProbeRequestReceived(&onProbeRequestBlink);
 }
 
-void onStationConnected(const WiFiEventSoftAPModeStationConnected& evt) {
+void onStationConnected(const WiFiEventSoftAPModeStationConnected& evt)
+{
   Serial.print("Station connected: ");
   Serial.println(macToString(evt.mac));
 }
 
-void onStationDisconnected(const WiFiEventSoftAPModeStationDisconnected& evt) {
+void onStationDisconnected(const WiFiEventSoftAPModeStationDisconnected& evt)
+{
   Serial.print("Station disconnected: ");
   Serial.println(macToString(evt.mac));
 }
 
-void onProbeRequestPrint(const WiFiEventSoftAPModeProbeRequestReceived& evt) {
+void onProbeRequestPrint(const WiFiEventSoftAPModeProbeRequestReceived& evt)
+{
   Serial.print("Probe request from: ");
   Serial.print(macToString(evt.mac));
   Serial.print(" RSSI: ");
   Serial.println(evt.rssi);
 }
 
-void onProbeRequestBlink(const WiFiEventSoftAPModeProbeRequestReceived&) {
+void onProbeRequestBlink(const WiFiEventSoftAPModeProbeRequestReceived&)
+{
   // We can't use "delay" or other blocking functions in the event handler.
   // Therefore we set a flag here and then check it inside "loop" function.
   blinkFlag = true;
 }
 
-void loop() {
-  if (millis() > 10000 && probeRequestPrintHandler) {
+void loop()
+{
+  if (millis() > 10000 && probeRequestPrintHandler)
+  {
     // After 10 seconds, disable the probe request event handler which prints.
     // Other three event handlers remain active.
     Serial.println("Not printing probe requests any more (LED should still blink)");
     probeRequestPrintHandler = WiFiEventHandler();
   }
-  if (blinkFlag) {
+  if (blinkFlag)
+  {
     blinkFlag = false;
     digitalWrite(LED_BUILTIN, LOW);
     delay(100);
@@ -96,9 +104,10 @@ void loop() {
   delay(10);
 }
 
-String macToString(const unsigned char* mac) {
+String macToString(const unsigned char* mac)
+{
   char buf[20];
   snprintf(buf, sizeof(buf), "%02x:%02x:%02x:%02x:%02x:%02x",
-      mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+           mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
   return String(buf);
 }
diff --git a/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino b/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
index e6b3160e18..1aff11f4d6 100644
--- a/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
@@ -14,14 +14,15 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 // Create an instance of the server
 // specify the port to listen on as an argument
-WiFiServer server(80);
+WiFiServer  server(80);
 
-void setup() {
+void        setup()
+{
   Serial.begin(115200);
 
   // prepare LED
@@ -37,7 +38,8 @@ void setup() {
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
 
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(F("."));
   }
@@ -52,15 +54,17 @@ void setup() {
   Serial.println(WiFi.localIP());
 }
 
-void loop() {
+void loop()
+{
   // Check if a client has connected
   WiFiClient client = server.accept();
-  if (!client) {
+  if (!client)
+  {
     return;
   }
   Serial.println(F("new client"));
 
-  client.setTimeout(5000); // default is 1000
+  client.setTimeout(5000);  // default is 1000
 
   // Read the first line of the request
   String req = client.readStringUntil('\r');
@@ -69,11 +73,16 @@ void loop() {
 
   // Match the request
   int val;
-  if (req.indexOf(F("/gpio/0")) != -1) {
+  if (req.indexOf(F("/gpio/0")) != -1)
+  {
     val = 0;
-  } else if (req.indexOf(F("/gpio/1")) != -1) {
+  }
+  else if (req.indexOf(F("/gpio/1")) != -1)
+  {
     val = 1;
-  } else {
+  }
+  else
+  {
     Serial.println(F("invalid request"));
     val = digitalRead(LED_BUILTIN);
   }
@@ -83,7 +92,8 @@ void loop() {
 
   // read/ignore the rest of the request
   // do not client.flush(): it is for output only, see below
-  while (client.available()) {
+  while (client.available())
+  {
     // byte by byte is not very efficient
     client.read();
   }
diff --git a/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino b/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
index d7036e08c5..f5356d4f2d 100644
--- a/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
@@ -6,7 +6,8 @@
 
 #include <ESP8266WiFi.h>
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   Serial.println(F("\nESP8266 WiFi scan example"));
 
@@ -18,40 +19,47 @@ void setup() {
   delay(100);
 }
 
-void loop() {
-  String ssid;
-  int32_t rssi;
-  uint8_t encryptionType;
+void loop()
+{
+  String   ssid;
+  int32_t  rssi;
+  uint8_t  encryptionType;
   uint8_t* bssid;
-  int32_t channel;
-  bool hidden;
-  int scanResult;
+  int32_t  channel;
+  bool     hidden;
+  int      scanResult;
 
   Serial.println(F("Starting WiFi scan..."));
 
   scanResult = WiFi.scanNetworks(/*async=*/false, /*hidden=*/true);
 
-  if (scanResult == 0) {
+  if (scanResult == 0)
+  {
     Serial.println(F("No networks found"));
-  } else if (scanResult > 0) {
+  }
+  else if (scanResult > 0)
+  {
     Serial.printf(PSTR("%d networks found:\n"), scanResult);
 
     // Print unsorted scan results
-    for (int8_t i = 0; i < scanResult; i++) {
+    for (int8_t i = 0; i < scanResult; i++)
+    {
       WiFi.getNetworkInfo(i, ssid, encryptionType, rssi, bssid, channel, hidden);
 
       Serial.printf(PSTR("  %02d: [CH %02d] [%02X:%02X:%02X:%02X:%02X:%02X] %ddBm %c %c %s\n"),
-          i,
-          channel,
-          bssid[0], bssid[1], bssid[2],
-          bssid[3], bssid[4], bssid[5],
-          rssi,
-          (encryptionType == ENC_TYPE_NONE) ? ' ' : '*',
-          hidden ? 'H' : 'V',
-          ssid.c_str());
+                    i,
+                    channel,
+                    bssid[0], bssid[1], bssid[2],
+                    bssid[3], bssid[4], bssid[5],
+                    rssi,
+                    (encryptionType == ENC_TYPE_NONE) ? ' ' : '*',
+                    hidden ? 'H' : 'V',
+                    ssid.c_str());
       yield();
     }
-  } else {
+  }
+  else
+  {
     Serial.printf(PSTR("WiFi scan error %d"), scanResult);
   }
 
diff --git a/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino b/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
index 31fc10d757..3ab8d6584c 100644
--- a/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
@@ -17,14 +17,15 @@
 #endif
 
 #include <ESP8266WiFi.h>
-#include <include/WiFiState.h> // WiFiState structure details
+#include <include/WiFiState.h>  // WiFiState structure details
 
-WiFiState state;
+WiFiState   state;
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
-void setup() {
+void        setup()
+{
   Serial.begin(74880);
   //Serial.setDebugOutput(true);  // If you need debug output
   Serial.println("Trying to resume WiFi connection...");
@@ -40,13 +41,15 @@ void setup() {
   unsigned long start = millis();
 
   if (!WiFi.resumeFromShutdown(state)
-      || (WiFi.waitForConnectResult(10000) != WL_CONNECTED)) {
+      || (WiFi.waitForConnectResult(10000) != WL_CONNECTED))
+  {
     Serial.println("Cannot resume WiFi connection, connecting via begin...");
     WiFi.persistent(false);
 
     if (!WiFi.mode(WIFI_STA)
         || !WiFi.begin(ssid, password)
-        || (WiFi.waitForConnectResult(10000) != WL_CONNECTED)) {
+        || (WiFi.waitForConnectResult(10000) != WL_CONNECTED))
+    {
       WiFi.mode(WIFI_OFF);
       Serial.println("Cannot connect!");
       Serial.flush();
@@ -75,6 +78,7 @@ void setup() {
   ESP.deepSleep(10e6, RF_DISABLED);
 }
 
-void loop() {
+void loop()
+{
   // Nothing to do here.
 }
diff --git a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
index b5ae8b2b10..8bd69fb751 100644
--- a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
@@ -20,7 +20,7 @@
 */
 #include <ESP8266WiFi.h>
 
-#include <algorithm> // std::min
+#include <algorithm>  // std::min
 
 #ifndef STASSID
 #define STASSID "your-ssid"
@@ -64,20 +64,20 @@ SoftwareSerial* logger = nullptr;
 #define logger (&Serial1)
 #endif
 
-#define STACK_PROTECTOR 512 // bytes
+#define STACK_PROTECTOR 512  // bytes
 
 //how many clients should be able to telnet to this ESP8266
 #define MAX_SRV_CLIENTS 2
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
-const int port = 23;
+const int   port     = 23;
 
-WiFiServer server(port);
-WiFiClient serverClients[MAX_SRV_CLIENTS];
-
-void setup() {
+WiFiServer  server(port);
+WiFiClient  serverClients[MAX_SRV_CLIENTS];
 
+void        setup()
+{
   Serial.begin(BAUD_SERIAL);
   Serial.setRxBufferSize(RXBUFFERSIZE);
 
@@ -98,7 +98,7 @@ void setup() {
   logger->printf("Serial receive buffer size: %d bytes\n", RXBUFFERSIZE);
 
 #if SERIAL_LOOPBACK
-  USC0(0) |= (1 << UCLBE); // incomplete HardwareSerial API
+  USC0(0) |= (1 << UCLBE);  // incomplete HardwareSerial API
   logger->println("Serial Internal Loopback enabled");
 #endif
 
@@ -106,7 +106,8 @@ void setup() {
   WiFi.begin(ssid, password);
   logger->print("\nConnecting to ");
   logger->println(ssid);
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     logger->print('.');
     delay(500);
   }
@@ -123,13 +124,16 @@ void setup() {
   logger->printf(" %d' to connect\n", port);
 }
 
-void loop() {
+void loop()
+{
   //check if there are any new clients
-  if (server.hasClient()) {
+  if (server.hasClient())
+  {
     //find free/disconnected spot
     int i;
     for (i = 0; i < MAX_SRV_CLIENTS; i++)
-      if (!serverClients[i]) { // equivalent to !serverClients[i].connected()
+      if (!serverClients[i])
+      {  // equivalent to !serverClients[i].connected()
         serverClients[i] = server.accept();
         logger->print("New client: index ");
         logger->print(i);
@@ -137,7 +141,8 @@ void loop() {
       }
 
     //no free/disconnected spot so reject
-    if (i == MAX_SRV_CLIENTS) {
+    if (i == MAX_SRV_CLIENTS)
+    {
       server.accept().println("busy");
       // hints: server.accept() is a WiFiClient with short-term scope
       // when out of scope, a WiFiClient will
@@ -152,20 +157,23 @@ void loop() {
   // Incredibly, this code is faster than the buffered one below - #4620 is needed
   // loopback/3000000baud average 348KB/s
   for (int i = 0; i < MAX_SRV_CLIENTS; i++)
-    while (serverClients[i].available() && Serial.availableForWrite() > 0) {
+    while (serverClients[i].available() && Serial.availableForWrite() > 0)
+    {
       // working char by char is not very efficient
       Serial.write(serverClients[i].read());
     }
 #else
   // loopback/3000000baud average: 312KB/s
   for (int i = 0; i < MAX_SRV_CLIENTS; i++)
-    while (serverClients[i].available() && Serial.availableForWrite() > 0) {
+    while (serverClients[i].available() && Serial.availableForWrite() > 0)
+    {
       size_t maxToSerial = std::min(serverClients[i].available(), Serial.availableForWrite());
-      maxToSerial = std::min(maxToSerial, (size_t)STACK_PROTECTOR);
+      maxToSerial        = std::min(maxToSerial, (size_t)STACK_PROTECTOR);
       uint8_t buf[maxToSerial];
-      size_t tcp_got = serverClients[i].read(buf, maxToSerial);
-      size_t serial_sent = Serial.write(buf, tcp_got);
-      if (serial_sent != maxToSerial) {
+      size_t  tcp_got     = serverClients[i].read(buf, maxToSerial);
+      size_t  serial_sent = Serial.write(buf, tcp_got);
+      if (serial_sent != maxToSerial)
+      {
         logger->printf("len mismatch: available:%zd tcp-read:%zd serial-write:%zd\n", maxToSerial, tcp_got, serial_sent);
       }
     }
@@ -175,15 +183,22 @@ void loop() {
   // client.availableForWrite() returns 0 when !client.connected()
   int maxToTcp = 0;
   for (int i = 0; i < MAX_SRV_CLIENTS; i++)
-    if (serverClients[i]) {
+    if (serverClients[i])
+    {
       int afw = serverClients[i].availableForWrite();
-      if (afw) {
-        if (!maxToTcp) {
+      if (afw)
+      {
+        if (!maxToTcp)
+        {
           maxToTcp = afw;
-        } else {
+        }
+        else
+        {
           maxToTcp = std::min(maxToTcp, afw);
         }
-      } else {
+      }
+      else
+      {
         // warn but ignore congested clients
         logger->println("one client is congested");
       }
@@ -191,18 +206,21 @@ void loop() {
 
   //check UART for data
   size_t len = std::min(Serial.available(), maxToTcp);
-  len = std::min(len, (size_t)STACK_PROTECTOR);
-  if (len) {
+  len        = std::min(len, (size_t)STACK_PROTECTOR);
+  if (len)
+  {
     uint8_t sbuf[len];
-    int serial_got = Serial.readBytes(sbuf, len);
+    int     serial_got = Serial.readBytes(sbuf, len);
     // push UART data to all connected telnet clients
     for (int i = 0; i < MAX_SRV_CLIENTS; i++)
       // if client.availableForWrite() was 0 (congested)
       // and increased since then,
       // ensure write space is sufficient:
-      if (serverClients[i].availableForWrite() >= serial_got) {
+      if (serverClients[i].availableForWrite() >= serial_got)
+      {
         size_t tcp_sent = serverClients[i].write(sbuf, serial_got);
-        if (tcp_sent != len) {
+        if (tcp_sent != len)
+        {
           logger->printf("len mismatch: available:%zd serial-read:%zd tcp-write:%zd\n", len, serial_got, tcp_sent);
         }
       }
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino b/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
index d8f1ece88d..8e296e0324 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
@@ -1,4 +1,4 @@
-#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
+#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
 
 #include <ESP8266WiFi.h>
 #include <EspnowMeshBackend.h>
@@ -6,7 +6,7 @@
 #include <TypeConversionFunctions.h>
 #include <assert.h>
 
-namespace TypeCast = MeshTypeConversionFunctions;
+namespace TypeCast                                      = MeshTypeConversionFunctions;
 
 /**
    NOTE: Although we could define the strings below as normal String variables,
@@ -19,31 +19,31 @@ namespace TypeCast = MeshTypeConversionFunctions;
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char exampleMeshName[] PROGMEM = "MeshNode_"; // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
-constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO"; // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
+constexpr char         exampleMeshName[] PROGMEM        = "MeshNode_";                    // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
+constexpr char         exampleWiFiPassword[] PROGMEM    = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
 
 // A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a default Kok set, but it can be replaced if desired.
 // All ESP-NOW keys below must match in an encrypted connection pair for encrypted communication to be possible.
 // Note that it is also possible to use Strings as key seeds instead of arrays.
-uint8_t espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting transmissions of encrypted connections.
-  0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11 };
-uint8_t espnowEncryptionKok[16] = { 0x22, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting the encrypted connection key.
-  0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x33 };
-uint8_t espnowHashKey[16] = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44, // This is the secret key used for HMAC during encrypted connection requests.
-  0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD };
+uint8_t                espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting transmissions of encrypted connections.
+                                             0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11 };
+uint8_t                espnowEncryptionKok[16]          = { 0x22, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting the encrypted connection key.
+                                    0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x33 };
+uint8_t                espnowHashKey[16]                = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44,  // This is the secret key used for HMAC during encrypted connection requests.
+                              0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD };
 
-unsigned int requestNumber = 0;
-unsigned int responseNumber = 0;
+unsigned int           requestNumber                    = 0;
+unsigned int           responseNumber                   = 0;
 
-const char broadcastMetadataDelimiter = 23; // 23 = End-of-Transmission-Block (ETB) control character in ASCII
+const char             broadcastMetadataDelimiter       = 23;  // 23 = End-of-Transmission-Block (ETB) control character in ASCII
 
-String manageRequest(const String& request, MeshBackendBase& meshInstance);
+String                 manageRequest(const String& request, MeshBackendBase& meshInstance);
 TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance);
-void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance);
-bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance);
+void                   networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance);
+bool                   broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance);
 
 /* Create the mesh node object */
-EspnowMeshBackend espnowNode = EspnowMeshBackend(manageRequest, manageResponse, networkFilter, broadcastFilter, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
+EspnowMeshBackend      espnowNode = EspnowMeshBackend(manageRequest, manageResponse, networkFilter, broadcastFilter, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
 
 /**
    Callback for when other nodes send you a request
@@ -52,15 +52,21 @@ EspnowMeshBackend espnowNode = EspnowMeshBackend(manageRequest, manageResponse,
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
 */
-String manageRequest(const String& request, MeshBackendBase& meshInstance) {
+String                 manageRequest(const String& request, MeshBackendBase& meshInstance)
+{
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance))
+  {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
-    (void)tcpIpInstance; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  }
+  else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance))
+  {
+    (void)tcpIpInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
     Serial.print(F("TCP/IP: "));
-  } else {
+  }
+  else
+  {
     Serial.print(F("UNKNOWN!: "));
   }
 
@@ -70,9 +76,12 @@ String manageRequest(const String& request, MeshBackendBase& meshInstance) {
   // Note that request.substring will not work as expected if the String contains null values as data.
   Serial.print(F("Request received: "));
 
-  if (request.charAt(0) == 0) {
-    Serial.println(request); // substring will not work for multiStrings.
-  } else {
+  if (request.charAt(0) == 0)
+  {
+    Serial.println(request);  // substring will not work for multiStrings.
+  }
+  else
+  {
     Serial.println(request.substring(0, 100));
   }
 
@@ -87,14 +96,18 @@ String manageRequest(const String& request, MeshBackendBase& meshInstance) {
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The status code resulting from the response, as an int
 */
-TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance) {
+TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance)
+{
   TransmissionStatusType statusCode = TransmissionStatusType::TRANSMISSION_COMPLETE;
 
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance))
+  {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+  }
+  else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance))
+  {
     Serial.print(F("TCP/IP: "));
 
     // Getting the sent message like this will work as long as ONLY(!) TCP/IP is used.
@@ -103,7 +116,9 @@ TransmissionStatusType manageResponse(const String& response, MeshBackendBase& m
     // So for ESP-NOW, adding unique identifiers in the response and request is required to associate a response with a request.
     Serial.print(F("Request sent: "));
     Serial.println(tcpIpInstance->getCurrentMessage().substring(0, 100));
-  } else {
+  }
+  else
+  {
     Serial.print(F("UNKNOWN!: "));
   }
 
@@ -123,22 +138,31 @@ TransmissionStatusType manageResponse(const String& response, MeshBackendBase& m
    @param numberOfNetworks The number of networks found in the WiFi scan.
    @param meshInstance The MeshBackendBase instance that called the function.
 */
-void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
+void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance)
+{
   // Note that the network index of a given node may change whenever a new scan is done.
-  for (int networkIndex = 0; networkIndex < numberOfNetworks; ++networkIndex) {
-    String currentSSID = WiFi.SSID(networkIndex);
-    int meshNameIndex = currentSSID.indexOf(meshInstance.getMeshName());
+  for (int networkIndex = 0; networkIndex < numberOfNetworks; ++networkIndex)
+  {
+    String currentSSID   = WiFi.SSID(networkIndex);
+    int    meshNameIndex = currentSSID.indexOf(meshInstance.getMeshName());
 
     /* Connect to any _suitable_ APs which contain meshInstance.getMeshName() */
-    if (meshNameIndex >= 0) {
+    if (meshNameIndex >= 0)
+    {
       uint64_t targetNodeID = TypeCast::stringToUint64(currentSSID.substring(meshNameIndex + meshInstance.getMeshName().length()));
 
-      if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID())) {
-        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+      if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID()))
+      {
+        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance))
+        {
           espnowInstance->connectionQueue().emplace_back(networkIndex);
-        } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+        }
+        else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance))
+        {
           tcpIpInstance->connectionQueue().emplace_back(networkIndex);
-        } else {
+        }
+        else
+        {
           Serial.println(F("Invalid mesh backend!"));
         }
       }
@@ -158,21 +182,26 @@ void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
 
    @return True if the broadcast should be accepted. False otherwise.
 */
-bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance) {
+bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance)
+{
   // This example broadcastFilter will accept a transmission if it contains the broadcastMetadataDelimiter
   // and as metaData either no targetMeshName or a targetMeshName that matches the MeshName of meshInstance.
 
   int32_t metadataEndIndex = firstTransmission.indexOf(broadcastMetadataDelimiter);
 
-  if (metadataEndIndex == -1) {
-    return false; // broadcastMetadataDelimiter not found
+  if (metadataEndIndex == -1)
+  {
+    return false;  // broadcastMetadataDelimiter not found
   }
 
   String targetMeshName = firstTransmission.substring(0, metadataEndIndex);
 
-  if (!targetMeshName.isEmpty() && meshInstance.getMeshName() != targetMeshName) {
-    return false; // Broadcast is for another mesh network
-  } else {
+  if (!targetMeshName.isEmpty() && meshInstance.getMeshName() != targetMeshName)
+  {
+    return false;  // Broadcast is for another mesh network
+  }
+  else
+  {
     // Remove metadata from message and mark as accepted broadcast.
     // Note that when you modify firstTransmission it is best to avoid using substring or other String methods that rely on null values for String length determination.
     // Otherwise your broadcasts cannot include null values in the message bytes.
@@ -192,10 +221,11 @@ bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance)
 
    @return True if attemptTransmission should continue with the next entry in the connectionQueue. False if attemptTransmission should stop.
 */
-bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
+bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance)
+{
   // Currently this is exactly the same as the default hook, but you can modify it to alter the behaviour of attemptTransmission.
 
-  (void)meshInstance; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  (void)meshInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
 
   return true;
 }
@@ -215,10 +245,11 @@ bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
    @return True if the response transmission process should continue with the next response in the waiting list.
            False if the response transmission process should stop once processing of the just sent response is complete.
 */
-bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String& response, const uint8_t* recipientMac, uint32_t responseIndex, EspnowMeshBackend& meshInstance) {
+bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String& response, const uint8_t* recipientMac, uint32_t responseIndex, EspnowMeshBackend& meshInstance)
+{
   // Currently this is exactly the same as the default hook, but you can modify it to alter the behaviour of sendEspnowResponses.
 
-  (void)transmissionSuccessful; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  (void)transmissionSuccessful;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
   (void)response;
   (void)recipientMac;
   (void)responseIndex;
@@ -227,7 +258,8 @@ bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String& r
   return true;
 }
 
-void setup() {
+void setup()
+{
   // Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
   // This will however delay node WiFi start-up by about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to connect to.
   WiFi.persistent(false);
@@ -283,7 +315,8 @@ void setup() {
 }
 
 int32_t timeOfLastScan = -10000;
-void loop() {
+void    loop()
+{
   // The performEspnowMaintenance() method performs all the background operations for the EspnowMeshBackend.
   // It is recommended to place it in the beginning of the loop(), unless there is a need to put it elsewhere.
   // Among other things, the method cleans up old Espnow log entries (freeing up RAM) and sends the responses you provide to Espnow requests.
@@ -293,7 +326,8 @@ void loop() {
   //Should not be used inside responseHandler, requestHandler, networkFilter or broadcastFilter callbacks since performEspnowMaintenance() can alter the ESP-NOW state.
   EspnowMeshBackend::performEspnowMaintenance();
 
-  if (millis() - timeOfLastScan > 10000) { // Give other nodes some time to connect between data transfers.
+  if (millis() - timeOfLastScan > 10000)
+  {  // Give other nodes some time to connect between data transfers.
     Serial.println(F("\nPerforming unencrypted ESP-NOW transmissions."));
 
     uint32_t startTime = millis();
@@ -307,22 +341,34 @@ void loop() {
     espnowDelay(100);
 
     // One way to check how attemptTransmission worked out
-    if (espnowNode.latestTransmissionSuccessful()) {
+    if (espnowNode.latestTransmissionSuccessful())
+    {
       Serial.println(F("Transmission successful."));
     }
 
     // Another way to check how attemptTransmission worked out
-    if (espnowNode.latestTransmissionOutcomes().empty()) {
+    if (espnowNode.latestTransmissionOutcomes().empty())
+    {
       Serial.println(F("No mesh AP found."));
-    } else {
-      for (TransmissionOutcome& transmissionOutcome : espnowNode.latestTransmissionOutcomes()) {
-        if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED) {
+    }
+    else
+    {
+      for (TransmissionOutcome& transmissionOutcome : espnowNode.latestTransmissionOutcomes())
+      {
+        if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED)
+        {
           Serial.println(String(F("Transmission failed to mesh AP ")) + transmissionOutcome.SSID());
-        } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED) {
+        }
+        else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED)
+        {
           Serial.println(String(F("Connection failed to mesh AP ")) + transmissionOutcome.SSID());
-        } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE) {
+        }
+        else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE)
+        {
           // No need to do anything, transmission was successful.
-        } else {
+        }
+        else
+        {
           Serial.println(String(F("Invalid transmission status for ")) + transmissionOutcome.SSID() + String('!'));
           assert(F("Invalid transmission status returned from responseHandler!") && false);
         }
@@ -330,33 +376,34 @@ void loop() {
 
       Serial.println(F("\nPerforming ESP-NOW broadcast."));
 
-      startTime = millis();
+      startTime                = millis();
 
       // Remove espnowNode.getMeshName() from the broadcastMetadata below to broadcast to all ESP-NOW nodes regardless of MeshName.
       // Note that data that comes before broadcastMetadataDelimiter should not contain any broadcastMetadataDelimiter characters,
       // otherwise the broadcastFilter function used in this example file will not work.
       String broadcastMetadata = espnowNode.getMeshName() + String(broadcastMetadataDelimiter);
-      String broadcastMessage = String(F("Broadcast #")) + String(requestNumber) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
+      String broadcastMessage  = String(F("Broadcast #")) + String(requestNumber) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
       espnowNode.broadcast(broadcastMetadata + broadcastMessage);
       Serial.println(String(F("Broadcast to all mesh nodes done in ")) + String(millis() - startTime) + F(" ms."));
 
-      espnowDelay(100); // Wait for responses (broadcasts can receive an unlimited number of responses, other transmissions can only receive one response).
+      espnowDelay(100);  // Wait for responses (broadcasts can receive an unlimited number of responses, other transmissions can only receive one response).
 
       // If you have a data array containing null values it is possible to transmit the raw data by making the array into a multiString as shown below.
       // You can use String::c_str() or String::begin() to retrieve the data array later.
       // Note that certain String methods such as String::substring use null values to determine String length, which means they will not work as normal with multiStrings.
-      uint8_t dataArray[] = { 0, '\'', 0, '\'', ' ', '(', 'n', 'u', 'l', 'l', ')', ' ', 'v', 'a', 'l', 'u', 'e' };
-      String espnowMessage = TypeCast::uint8ArrayToMultiString(dataArray, sizeof dataArray) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
+      uint8_t dataArray[]   = { 0, '\'', 0, '\'', ' ', '(', 'n', 'u', 'l', 'l', ')', ' ', 'v', 'a', 'l', 'u', 'e' };
+      String  espnowMessage = TypeCast::uint8ArrayToMultiString(dataArray, sizeof dataArray) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
       Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
       espnowNode.attemptTransmission(espnowMessage, false);
-      espnowDelay(100); // Wait for response.
+      espnowDelay(100);  // Wait for response.
 
       Serial.println(F("\nPerforming encrypted ESP-NOW transmissions."));
 
       uint8_t targetBSSID[6] { 0 };
 
       // We can create encrypted connections to individual nodes so that all ESP-NOW communication with the node will be encrypted.
-      if (espnowNode.constConnectionQueue()[0].getBSSID(targetBSSID) && espnowNode.requestEncryptedConnection(targetBSSID) == EncryptedConnectionStatus::CONNECTION_ESTABLISHED) {
+      if (espnowNode.constConnectionQueue()[0].getBSSID(targetBSSID) && espnowNode.requestEncryptedConnection(targetBSSID) == EncryptedConnectionStatus::CONNECTION_ESTABLISHED)
+      {
         // The WiFi scan will detect the AP MAC, but this will automatically be converted to the encrypted STA MAC by the framework.
         String peerMac = TypeCast::macToString(targetBSSID);
 
@@ -366,7 +413,7 @@ void loop() {
         String espnowMessage = String(F("This message is encrypted only when received by node ")) + peerMac;
         Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
         espnowNode.attemptTransmission(espnowMessage, false);
-        espnowDelay(100); // Wait for response.
+        espnowDelay(100);  // Wait for response.
 
         // A connection can be serialized and stored for later use.
         // Note that this saves the current state only, so if encrypted communication between the nodes happen after this, the stored state is invalid.
@@ -380,7 +427,7 @@ void loop() {
         espnowMessage = String(F("This message is no longer encrypted when received by node ")) + peerMac;
         Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
         espnowNode.attemptTransmission(espnowMessage, false);
-        espnowDelay(100); // Wait for response.
+        espnowDelay(100);  // Wait for response.
         Serial.println(F("Cannot read the encrypted response..."));
 
         // Let's re-add our stored connection so we can communicate properly with targetBSSID again!
@@ -389,23 +436,25 @@ void loop() {
         espnowMessage = String(F("This message is once again encrypted when received by node ")) + peerMac;
         Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
         espnowNode.attemptTransmission(espnowMessage, false);
-        espnowDelay(100); // Wait for response.
+        espnowDelay(100);  // Wait for response.
 
         Serial.println();
         // If we want to remove the encrypted connection on both nodes, we can do it like this.
         EncryptedConnectionRemovalOutcome removalOutcome = espnowNode.requestEncryptedConnectionRemoval(targetBSSID);
-        if (removalOutcome == EncryptedConnectionRemovalOutcome::REMOVAL_SUCCEEDED) {
+        if (removalOutcome == EncryptedConnectionRemovalOutcome::REMOVAL_SUCCEEDED)
+        {
           Serial.println(peerMac + F(" is no longer encrypted!"));
 
           espnowMessage = String(F("This message is only received by node ")) + peerMac + F(". Transmitting in this way will not change the transmission state of the sender.");
           Serial.println(String(F("Transmitting: ")) + espnowMessage);
           espnowNode.attemptTransmission(espnowMessage, EspnowNetworkInfo(targetBSSID));
-          espnowDelay(100); // Wait for response.
+          espnowDelay(100);  // Wait for response.
 
           Serial.println();
 
           // Of course, we can also just create a temporary encrypted connection that will remove itself once its duration has passed.
-          if (espnowNode.requestTemporaryEncryptedConnection(targetBSSID, 1000) == EncryptedConnectionStatus::CONNECTION_ESTABLISHED) {
+          if (espnowNode.requestTemporaryEncryptedConnection(targetBSSID, 1000) == EncryptedConnectionStatus::CONNECTION_ESTABLISHED)
+          {
             espnowDelay(42);
             uint32_t remainingDuration = 0;
             EspnowMeshBackend::getConnectionInfo(targetBSSID, &remainingDuration);
@@ -420,7 +469,7 @@ void loop() {
             espnowMessage = String(F("Due to encrypted connection expiration, this message is no longer encrypted when received by node ")) + peerMac;
             Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
             espnowNode.attemptTransmission(espnowMessage, false);
-            espnowDelay(100); // Wait for response.
+            espnowDelay(100);  // Wait for response.
           }
 
           // Or if we prefer we can just let the library automatically create brief encrypted connections which are long enough to transmit an encrypted message.
@@ -429,8 +478,10 @@ void loop() {
           espnowMessage = F("This message is always encrypted, regardless of receiver.");
           Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
           espnowNode.attemptAutoEncryptingTransmission(espnowMessage);
-          espnowDelay(100); // Wait for response.
-        } else {
+          espnowDelay(100);  // Wait for response.
+        }
+        else
+        {
           Serial.println(String(F("Ooops! Encrypted connection removal failed. Status: ")) + String(static_cast<int>(removalOutcome)));
         }
 
@@ -443,7 +494,7 @@ void loop() {
 
       // Our last request was sent to all nodes found, so time to create a new request.
       espnowNode.setMessage(String(F("Hello world request #")) + String(++requestNumber) + F(" from ")
-          + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.'));
+                            + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.'));
     }
 
     Serial.println();
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino b/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
index b70b41b8c4..f6be58d9e8 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
@@ -8,14 +8,14 @@
    Or "floodingMesh.getEspnowMeshBackend().setBroadcastTransmissionRedundancy(uint8_t redundancy)" (default 1) at the cost of longer transmission times.
 */
 
-#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
+#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
 
 #include <ESP8266WiFi.h>
 #include <TypeConversionFunctions.h>
 #include <assert.h>
 #include <FloodingMesh.h>
 
-namespace TypeCast = MeshTypeConversionFunctions;
+namespace TypeCast                              = MeshTypeConversionFunctions;
 
 /**
    NOTE: Although we could define the strings below as normal String variables,
@@ -28,26 +28,26 @@ namespace TypeCast = MeshTypeConversionFunctions;
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char exampleMeshName[] PROGMEM = "MeshNode_"; // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
-constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO"; // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
+constexpr char exampleMeshName[] PROGMEM        = "MeshNode_";                    // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
+constexpr char exampleWiFiPassword[] PROGMEM    = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
 
 // A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a default Kok set, but it can be replaced if desired.
 // All ESP-NOW keys below must match in an encrypted connection pair for encrypted communication to be possible.
 // Note that it is also possible to use Strings as key seeds instead of arrays.
-uint8_t espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting transmissions of encrypted connections.
-  0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11 };
-uint8_t espnowHashKey[16] = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44, // This is the secret key used for HMAC during encrypted connection requests.
-  0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD };
+uint8_t        espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting transmissions of encrypted connections.
+                                             0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11 };
+uint8_t        espnowHashKey[16]                = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44,  // This is the secret key used for HMAC during encrypted connection requests.
+                              0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD };
 
-bool meshMessageHandler(String& message, FloodingMesh& meshInstance);
+bool           meshMessageHandler(String& message, FloodingMesh& meshInstance);
 
 /* Create the mesh node object */
-FloodingMesh floodingMesh = FloodingMesh(meshMessageHandler, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
+FloodingMesh   floodingMesh = FloodingMesh(meshMessageHandler, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
 
-bool theOne = true;
-String theOneMac;
+bool           theOne       = true;
+String         theOneMac;
 
-bool useLED = false; // Change this to true if you wish the onboard LED to mark The One.
+bool           useLED = false;  // Change this to true if you wish the onboard LED to mark The One.
 
 /**
    Callback for when a message is received from the mesh network.
@@ -60,54 +60,69 @@ bool useLED = false; // Change this to true if you wish the onboard LED to mark
    @param meshInstance The FloodingMesh instance that received the message.
    @return True if this node should forward the received message to other nodes. False otherwise.
 */
-bool meshMessageHandler(String& message, FloodingMesh& meshInstance) {
+bool           meshMessageHandler(String& message, FloodingMesh& meshInstance)
+{
   int32_t delimiterIndex = message.indexOf(meshInstance.metadataDelimiter());
-  if (delimiterIndex == 0) {
+  if (delimiterIndex == 0)
+  {
     Serial.print(String(F("Message received from STA MAC ")) + meshInstance.getEspnowMeshBackend().getSenderMac() + F(": "));
     Serial.println(message.substring(2, 102));
 
     String potentialMac = message.substring(2, 14);
 
-    if (potentialMac >= theOneMac) {
-      if (potentialMac > theOneMac) {
-        theOne = false;
+    if (potentialMac >= theOneMac)
+    {
+      if (potentialMac > theOneMac)
+      {
+        theOne    = false;
         theOneMac = potentialMac;
       }
 
-      if (useLED && !theOne) {
+      if (useLED && !theOne)
+      {
         bool ledState = message.charAt(1) == '1';
-        digitalWrite(LED_BUILTIN, ledState); // Turn LED on/off (LED_BUILTIN is active low)
+        digitalWrite(LED_BUILTIN, ledState);  // Turn LED on/off (LED_BUILTIN is active low)
       }
 
       return true;
-    } else {
+    }
+    else
+    {
       return false;
     }
-  } else if (delimiterIndex > 0) {
-    if (meshInstance.getOriginMac() == theOneMac) {
-      uint32_t totalBroadcasts = strtoul(message.c_str(), nullptr, 0); // strtoul stops reading input when an invalid character is discovered.
+  }
+  else if (delimiterIndex > 0)
+  {
+    if (meshInstance.getOriginMac() == theOneMac)
+    {
+      uint32_t        totalBroadcasts = strtoul(message.c_str(), nullptr, 0);  // strtoul stops reading input when an invalid character is discovered.
 
       // Static variables are only initialized once.
-      static uint32_t firstBroadcast = totalBroadcasts;
+      static uint32_t firstBroadcast  = totalBroadcasts;
 
-      if (totalBroadcasts - firstBroadcast >= 100) { // Wait a little to avoid start-up glitches
-        static uint32_t missedBroadcasts = 1; // Starting at one to compensate for initial -1 below.
+      if (totalBroadcasts - firstBroadcast >= 100)
+      {                                               // Wait a little to avoid start-up glitches
+        static uint32_t missedBroadcasts        = 1;  // Starting at one to compensate for initial -1 below.
         static uint32_t previousTotalBroadcasts = totalBroadcasts;
         static uint32_t totalReceivedBroadcasts = 0;
         totalReceivedBroadcasts++;
 
-        missedBroadcasts += totalBroadcasts - previousTotalBroadcasts - 1; // We expect an increment by 1.
+        missedBroadcasts += totalBroadcasts - previousTotalBroadcasts - 1;  // We expect an increment by 1.
         previousTotalBroadcasts = totalBroadcasts;
 
-        if (totalReceivedBroadcasts % 50 == 0) {
+        if (totalReceivedBroadcasts % 50 == 0)
+        {
           Serial.println(String(F("missed/total: ")) + String(missedBroadcasts) + '/' + String(totalReceivedBroadcasts));
         }
-        if (totalReceivedBroadcasts % 500 == 0) {
+        if (totalReceivedBroadcasts % 500 == 0)
+        {
           Serial.println(String(F("Benchmark message: ")) + message.substring(0, 100));
         }
       }
     }
-  } else {
+  }
+  else
+  {
     // Only show first 100 characters because printing a large String takes a lot of time, which is a bad thing for a callback function.
     // If you need to print the whole String it is better to store it and print it in the loop() later.
     Serial.print(String(F("Message with origin ")) + meshInstance.getOriginMac() + F(" received: "));
@@ -117,7 +132,8 @@ bool meshMessageHandler(String& message, FloodingMesh& meshInstance) {
   return true;
 }
 
-void setup() {
+void setup()
+{
   // Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
   // This will however delay node WiFi start-up by about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to connect to.
   WiFi.persistent(false);
@@ -134,14 +150,15 @@ void setup() {
   Serial.println(F("Setting up mesh node..."));
 
   floodingMesh.begin();
-  floodingMesh.activateAP(); // Required to receive messages
+  floodingMesh.activateAP();  // Required to receive messages
 
   uint8_t apMacArray[6] { 0 };
   theOneMac = TypeCast::macToString(WiFi.softAPmacAddress(apMacArray));
 
-  if (useLED) {
-    pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
-    digitalWrite(LED_BUILTIN, LOW); // Turn LED on (LED_BUILTIN is active low)
+  if (useLED)
+  {
+    pinMode(LED_BUILTIN, OUTPUT);    // Initialize the LED_BUILTIN pin as an output
+    digitalWrite(LED_BUILTIN, LOW);  // Turn LED on (LED_BUILTIN is active low)
   }
 
   // Uncomment the lines below to use automatic AEAD encryption/decryption of messages sent/received via broadcast() and encryptedBroadcast().
@@ -151,14 +168,15 @@ void setup() {
   //floodingMesh.getEspnowMeshBackend().setEspnowMessageEncryptionKey(F("ChangeThisKeySeed_TODO")); // The message encryption key should always be set manually. Otherwise a default key (all zeroes) is used.
   //floodingMesh.getEspnowMeshBackend().setUseEncryptedMessages(true);
 
-  floodingMeshDelay(5000); // Give some time for user to start the nodes
+  floodingMeshDelay(5000);  // Give some time for user to start the nodes
 }
 
 int32_t timeOfLastProclamation = -10000;
-void loop() {
-  static bool ledState = 1;
+void    loop()
+{
+  static bool     ledState       = 1;
   static uint32_t benchmarkCount = 0;
-  static uint32_t loopStart = millis();
+  static uint32_t loopStart      = millis();
 
   // The floodingMeshDelay() method performs all the background operations for the FloodingMesh (via FloodingMesh::performMeshMaintenance()).
   // It is recommended to place one of these methods in the beginning of the loop(), unless there is a need to put them elsewhere.
@@ -172,10 +190,12 @@ void loop() {
   // Unencrypted: TransmissionStatusType floodingMesh.getEspnowMeshBackend().attemptTransmission(message, EspnowNetworkInfo(recipientMac));
   // Encrypted (slow): floodingMesh.getEspnowMeshBackend().attemptAutoEncryptingTransmission(message, EspnowNetworkInfo(recipientMac));
 
-  if (theOne) {
-    if (millis() - timeOfLastProclamation > 10000) {
+  if (theOne)
+  {
+    if (millis() - timeOfLastProclamation > 10000)
+    {
       uint32_t startTime = millis();
-      ledState = ledState ^ bool(benchmarkCount); // Make other nodes' LEDs alternate between on and off once benchmarking begins.
+      ledState           = ledState ^ bool(benchmarkCount);  // Make other nodes' LEDs alternate between on and off once benchmarking begins.
 
       // Note: The maximum length of an unencrypted broadcast message is given by floodingMesh.maxUnencryptedMessageLength(). It is around 670 bytes by default.
       floodingMesh.broadcast(String(floodingMesh.metadataDelimiter()) + String(ledState) + theOneMac + F(" is The One."));
@@ -185,7 +205,8 @@ void loop() {
       floodingMeshDelay(20);
     }
 
-    if (millis() - loopStart > 23000) { // Start benchmarking the mesh once three proclamations have been made
+    if (millis() - loopStart > 23000)
+    {  // Start benchmarking the mesh once three proclamations have been made
       uint32_t startTime = millis();
       floodingMesh.broadcast(String(benchmarkCount++) + String(floodingMesh.metadataDelimiter()) + F(": Not a spoon in sight."));
       Serial.println(String(F("Benchmark broadcast done in ")) + String(millis() - startTime) + F(" ms."));
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino b/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
index f8c3b6a9f8..bbfb7b74f0 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
@@ -1,4 +1,4 @@
-#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
+#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
 
 #include <ESP8266WiFi.h>
 #include <TcpIpMeshBackend.h>
@@ -6,7 +6,7 @@
 #include <TypeConversionFunctions.h>
 #include <assert.h>
 
-namespace TypeCast = MeshTypeConversionFunctions;
+namespace TypeCast                                   = MeshTypeConversionFunctions;
 
 /**
    NOTE: Although we could define the strings below as normal String variables,
@@ -19,18 +19,18 @@ namespace TypeCast = MeshTypeConversionFunctions;
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char exampleMeshName[] PROGMEM = "MeshNode_";
-constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO"; // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
+constexpr char         exampleMeshName[] PROGMEM     = "MeshNode_";
+constexpr char         exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
 
-unsigned int requestNumber = 0;
-unsigned int responseNumber = 0;
+unsigned int           requestNumber                 = 0;
+unsigned int           responseNumber                = 0;
 
-String manageRequest(const String& request, MeshBackendBase& meshInstance);
+String                 manageRequest(const String& request, MeshBackendBase& meshInstance);
 TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance);
-void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance);
+void                   networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance);
 
 /* Create the mesh node object */
-TcpIpMeshBackend tcpIpNode = TcpIpMeshBackend(manageRequest, manageResponse, networkFilter, FPSTR(exampleWiFiPassword), FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
+TcpIpMeshBackend       tcpIpNode = TcpIpMeshBackend(manageRequest, manageResponse, networkFilter, FPSTR(exampleWiFiPassword), FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
 
 /**
    Callback for when other nodes send you a request
@@ -39,15 +39,21 @@ TcpIpMeshBackend tcpIpNode = TcpIpMeshBackend(manageRequest, manageResponse, net
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
 */
-String manageRequest(const String& request, MeshBackendBase& meshInstance) {
+String                 manageRequest(const String& request, MeshBackendBase& meshInstance)
+{
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance))
+  {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
-    (void)tcpIpInstance; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  }
+  else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance))
+  {
+    (void)tcpIpInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
     Serial.print(F("TCP/IP: "));
-  } else {
+  }
+  else
+  {
     Serial.print(F("UNKNOWN!: "));
   }
 
@@ -69,14 +75,18 @@ String manageRequest(const String& request, MeshBackendBase& meshInstance) {
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The status code resulting from the response, as an int
 */
-TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance) {
+TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance)
+{
   TransmissionStatusType statusCode = TransmissionStatusType::TRANSMISSION_COMPLETE;
 
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance))
+  {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+  }
+  else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance))
+  {
     Serial.print(F("TCP/IP: "));
 
     // Getting the sent message like this will work as long as ONLY(!) TCP/IP is used.
@@ -85,7 +95,9 @@ TransmissionStatusType manageResponse(const String& response, MeshBackendBase& m
     // So for ESP-NOW, adding unique identifiers in the response and request is required to associate a response with a request.
     Serial.print(F("Request sent: "));
     Serial.println(tcpIpInstance->getCurrentMessage().substring(0, 100));
-  } else {
+  }
+  else
+  {
     Serial.print(F("UNKNOWN!: "));
   }
 
@@ -105,22 +117,31 @@ TransmissionStatusType manageResponse(const String& response, MeshBackendBase& m
    @param numberOfNetworks The number of networks found in the WiFi scan.
    @param meshInstance The MeshBackendBase instance that called the function.
 */
-void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
+void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance)
+{
   // Note that the network index of a given node may change whenever a new scan is done.
-  for (int networkIndex = 0; networkIndex < numberOfNetworks; ++networkIndex) {
-    String currentSSID = WiFi.SSID(networkIndex);
-    int meshNameIndex = currentSSID.indexOf(meshInstance.getMeshName());
+  for (int networkIndex = 0; networkIndex < numberOfNetworks; ++networkIndex)
+  {
+    String currentSSID   = WiFi.SSID(networkIndex);
+    int    meshNameIndex = currentSSID.indexOf(meshInstance.getMeshName());
 
     /* Connect to any _suitable_ APs which contain meshInstance.getMeshName() */
-    if (meshNameIndex >= 0) {
+    if (meshNameIndex >= 0)
+    {
       uint64_t targetNodeID = TypeCast::stringToUint64(currentSSID.substring(meshNameIndex + meshInstance.getMeshName().length()));
 
-      if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID())) {
-        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+      if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID()))
+      {
+        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance))
+        {
           espnowInstance->connectionQueue().emplace_back(networkIndex);
-        } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+        }
+        else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance))
+        {
           tcpIpInstance->connectionQueue().emplace_back(networkIndex);
-        } else {
+        }
+        else
+        {
           Serial.println(F("Invalid mesh backend!"));
         }
       }
@@ -139,23 +160,29 @@ void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
 
    @return True if attemptTransmission should continue with the next entry in the connectionQueue. False if attemptTransmission should stop.
 */
-bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
+bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance)
+{
   // The default hook only returns true and does nothing else.
 
-  if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
-    if (tcpIpInstance->latestTransmissionOutcomes().back().transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE) {
+  if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance))
+  {
+    if (tcpIpInstance->latestTransmissionOutcomes().back().transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE)
+    {
       // Our last request got a response, so time to create a new request.
       meshInstance.setMessage(String(F("Hello world request #")) + String(++requestNumber) + F(" from ")
-          + meshInstance.getMeshName() + meshInstance.getNodeID() + String('.'));
+                              + meshInstance.getMeshName() + meshInstance.getNodeID() + String('.'));
     }
-  } else {
+  }
+  else
+  {
     Serial.println(F("Invalid mesh backend!"));
   }
 
   return true;
 }
 
-void setup() {
+void setup()
+{
   // Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
   // This will however delay node WiFi start-up by about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to connect to.
   WiFi.persistent(false);
@@ -174,8 +201,8 @@ void setup() {
 
   /* Initialise the mesh node */
   tcpIpNode.begin();
-  tcpIpNode.activateAP(); // Each AP requires a separate server port.
-  tcpIpNode.setStaticIP(IPAddress(192, 168, 4, 22)); // Activate static IP mode to speed up connection times.
+  tcpIpNode.activateAP();                             // Each AP requires a separate server port.
+  tcpIpNode.setStaticIP(IPAddress(192, 168, 4, 22));  // Activate static IP mode to speed up connection times.
 
   // Storing our message in the TcpIpMeshBackend instance is not required, but can be useful for organizing code, especially when using many TcpIpMeshBackend instances.
   // Note that calling the multi-recipient tcpIpNode.attemptTransmission will replace the stored message with whatever message is transmitted.
@@ -185,38 +212,54 @@ void setup() {
 }
 
 int32_t timeOfLastScan = -10000;
-void loop() {
-  if (millis() - timeOfLastScan > 3000 // Give other nodes some time to connect between data transfers.
-      || (WiFi.status() != WL_CONNECTED && millis() - timeOfLastScan > 2000)) { // Scan for networks with two second intervals when not already connected.
+void    loop()
+{
+  if (millis() - timeOfLastScan > 3000  // Give other nodes some time to connect between data transfers.
+      || (WiFi.status() != WL_CONNECTED && millis() - timeOfLastScan > 2000))
+  {  // Scan for networks with two second intervals when not already connected.
 
     // attemptTransmission(message, scan, scanAllWiFiChannels, concludingDisconnect, initialDisconnect = false)
     tcpIpNode.attemptTransmission(tcpIpNode.getMessage(), true, false, false);
     timeOfLastScan = millis();
 
     // One way to check how attemptTransmission worked out
-    if (tcpIpNode.latestTransmissionSuccessful()) {
+    if (tcpIpNode.latestTransmissionSuccessful())
+    {
       Serial.println(F("Transmission successful."));
     }
 
     // Another way to check how attemptTransmission worked out
-    if (tcpIpNode.latestTransmissionOutcomes().empty()) {
+    if (tcpIpNode.latestTransmissionOutcomes().empty())
+    {
       Serial.println(F("No mesh AP found."));
-    } else {
-      for (TransmissionOutcome& transmissionOutcome : tcpIpNode.latestTransmissionOutcomes()) {
-        if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED) {
+    }
+    else
+    {
+      for (TransmissionOutcome& transmissionOutcome : tcpIpNode.latestTransmissionOutcomes())
+      {
+        if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED)
+        {
           Serial.println(String(F("Transmission failed to mesh AP ")) + transmissionOutcome.SSID());
-        } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED) {
+        }
+        else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED)
+        {
           Serial.println(String(F("Connection failed to mesh AP ")) + transmissionOutcome.SSID());
-        } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE) {
+        }
+        else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE)
+        {
           // No need to do anything, transmission was successful.
-        } else {
+        }
+        else
+        {
           Serial.println(String(F("Invalid transmission status for ")) + transmissionOutcome.SSID() + String('!'));
           assert(F("Invalid transmission status returned from responseHandler!") && false);
         }
       }
     }
     Serial.println();
-  } else {
+  }
+  else
+  {
     /* Accept any incoming connections */
     tcpIpNode.acceptRequests();
   }
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino b/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
index 6f8e93dec4..0ca32a1e79 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
@@ -20,8 +20,8 @@
 
 ESP8266WiFiMulti WiFiMulti;
 
-void setup() {
-
+void             setup()
+{
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -29,7 +29,8 @@ void setup() {
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--) {
+  for (uint8_t t = 4; t > 0; t--)
+  {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -39,26 +40,31 @@ void setup() {
   WiFiMulti.addAP(APSSID, APPSK);
 }
 
-void update_started() {
+void update_started()
+{
   Serial.println("CALLBACK:  HTTP update process started");
 }
 
-void update_finished() {
+void update_finished()
+{
   Serial.println("CALLBACK:  HTTP update process finished");
 }
 
-void update_progress(int cur, int total) {
+void update_progress(int cur, int total)
+{
   Serial.printf("CALLBACK:  HTTP update process at %d of %d bytes...\n", cur, total);
 }
 
-void update_error(int err) {
+void update_error(int err)
+{
   Serial.printf("CALLBACK:  HTTP update fatal error code %d\n", err);
 }
 
-void loop() {
+void loop()
+{
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED)) {
-
+  if ((WiFiMulti.run() == WL_CONNECTED))
+  {
     WiFiClient client;
 
     // The line below is optional. It can be used to blink the LED on the board during flashing
@@ -79,7 +85,8 @@ void loop() {
     // Or:
     //t_httpUpdate_return ret = ESPhttpUpdate.update(client, "server", 80, "file.bin");
 
-    switch (ret) {
+    switch (ret)
+    {
       case HTTP_UPDATE_FAILED:
         Serial.printf("HTTP_UPDATE_FAILD Error (%d): %s\n", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
         break;
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
index 22f6e65260..99ee75d5fc 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
@@ -20,8 +20,8 @@ ESP8266WiFiMulti WiFiMulti;
 #define APPSK "APPSK"
 #endif
 
-void setup() {
-
+void setup()
+{
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -29,7 +29,8 @@ void setup() {
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--) {
+  for (uint8_t t = 4; t > 0; t--)
+  {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -39,10 +40,11 @@ void setup() {
   WiFiMulti.addAP(APSSID, APPSK);
 }
 
-void loop() {
+void loop()
+{
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED)) {
-
+  if ((WiFiMulti.run() == WL_CONNECTED))
+  {
     Serial.println("Update LittleFS...");
 
     WiFiClient client;
@@ -56,11 +58,13 @@ void loop() {
     ESPhttpUpdate.setLedPin(LED_BUILTIN, LOW);
 
     t_httpUpdate_return ret = ESPhttpUpdate.updateFS(client, "http://server/spiffs.bin");
-    if (ret == HTTP_UPDATE_OK) {
+    if (ret == HTTP_UPDATE_OK)
+    {
       Serial.println("Update sketch...");
       ret = ESPhttpUpdate.update(client, "http://server/file.bin");
 
-      switch (ret) {
+      switch (ret)
+      {
         case HTTP_UPDATE_FAILED:
           Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
           break;
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
index 0353126ef2..696fd9de2b 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
@@ -30,12 +30,14 @@ ESP8266WiFiMulti WiFiMulti;
 BearSSL::CertStore certStore;
 
 // Set time via NTP, as required for x.509 validation
-void setClock() {
-  configTime(0, 0, "pool.ntp.org", "time.nist.gov"); // UTC
+void               setClock()
+{
+  configTime(0, 0, "pool.ntp.org", "time.nist.gov");  // UTC
 
   Serial.print(F("Waiting for NTP time sync: "));
   time_t now = time(nullptr);
-  while (now < 8 * 3600 * 2) {
+  while (now < 8 * 3600 * 2)
+  {
     yield();
     delay(500);
     Serial.print(F("."));
@@ -49,8 +51,8 @@ void setClock() {
   Serial.print(asctime(&timeinfo));
 }
 
-void setup() {
-
+void setup()
+{
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -58,7 +60,8 @@ void setup() {
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--) {
+  for (uint8_t t = 4; t > 0; t--)
+  {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -72,22 +75,25 @@ void setup() {
   int numCerts = certStore.initCertStore(LittleFS, PSTR("/certs.idx"), PSTR("/certs.ar"));
   Serial.print(F("Number of CA certs read: "));
   Serial.println(numCerts);
-  if (numCerts == 0) {
+  if (numCerts == 0)
+  {
     Serial.println(F("No certs found. Did you run certs-from-mozill.py and upload the LittleFS directory before running?"));
-    return; // Can't connect to anything w/o certs!
+    return;  // Can't connect to anything w/o certs!
   }
 }
 
-void loop() {
+void loop()
+{
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED)) {
-
+  if ((WiFiMulti.run() == WL_CONNECTED))
+  {
     setClock();
 
     BearSSL::WiFiClientSecure client;
-    bool mfln = client.probeMaxFragmentLength("server", 443, 1024); // server must be the same as in ESPhttpUpdate.update()
+    bool                      mfln = client.probeMaxFragmentLength("server", 443, 1024);  // server must be the same as in ESPhttpUpdate.update()
     Serial.printf("MFLN supported: %s\n", mfln ? "yes" : "no");
-    if (mfln) {
+    if (mfln)
+    {
       client.setBufferSizes(1024, 1024);
     }
     client.setCertStore(&certStore);
@@ -104,7 +110,8 @@ void loop() {
     // Or:
     //t_httpUpdate_return ret = ESPhttpUpdate.update(client, "server", 443, "file.bin");
 
-    switch (ret) {
+    switch (ret)
+    {
       case HTTP_UPDATE_FAILED:
         Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s\n", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
         break;
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
index c7580950a6..e0e999ef58 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
@@ -50,13 +50,13 @@ TQIDAQAB
 -----END PUBLIC KEY-----
 )EOF";
 #if MANUAL_SIGNING
-BearSSL::PublicKey* signPubKey = nullptr;
-BearSSL::HashSHA256* hash;
+BearSSL::PublicKey*       signPubKey = nullptr;
+BearSSL::HashSHA256*      hash;
 BearSSL::SigningVerifier* sign;
 #endif
 
-void setup() {
-
+void setup()
+{
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -64,7 +64,8 @@ void setup() {
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--) {
+  for (uint8_t t = 4; t > 0; t--)
+  {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -75,15 +76,16 @@ void setup() {
 
 #if MANUAL_SIGNING
   signPubKey = new BearSSL::PublicKey(pubkey);
-  hash = new BearSSL::HashSHA256();
-  sign = new BearSSL::SigningVerifier(signPubKey);
+  hash       = new BearSSL::HashSHA256();
+  sign       = new BearSSL::SigningVerifier(signPubKey);
 #endif
 }
 
-void loop() {
+void loop()
+{
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED)) {
-
+  if ((WiFiMulti.run() == WL_CONNECTED))
+  {
     WiFiClient client;
 
 #if MANUAL_SIGNING
@@ -97,7 +99,8 @@ void loop() {
 
     t_httpUpdate_return ret = ESPhttpUpdate.update(client, "http://192.168.1.8/esp8266.bin");
 
-    switch (ret) {
+    switch (ret)
+    {
       case HTTP_UPDATE_FAILED:
         Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s\n", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
         break;
diff --git a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
index b5748bf331..6473cb69d3 100644
--- a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
+++ b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
@@ -42,38 +42,39 @@
    Global defines and vars
 */
 
-#define TIMEZONE_OFFSET 1 // CET
-#define DST_OFFSET 1 // CEST
-#define UPDATE_CYCLE (1 * 1000) // every second
+#define TIMEZONE_OFFSET 1        // CET
+#define DST_OFFSET 1             // CEST
+#define UPDATE_CYCLE (1 * 1000)  // every second
 
-#define SERVICE_PORT 80 // HTTP port
+#define SERVICE_PORT 80  // HTTP port
 
 #ifndef STASSID
 #define STASSID "your-ssid"
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*                 ssid                 = STASSID;
+const char*                 password             = STAPSK;
 
-char* pcHostDomain = 0; // Negotiated host domain
-bool bHostDomainConfirmed = false; // Flags the confirmation of the host domain
-MDNSResponder::hMDNSService hMDNSService = 0; // The handle of the clock service in the MDNS responder
+char*                       pcHostDomain         = 0;      // Negotiated host domain
+bool                        bHostDomainConfirmed = false;  // Flags the confirmation of the host domain
+MDNSResponder::hMDNSService hMDNSService         = 0;      // The handle of the clock service in the MDNS responder
 
 // HTTP server at port 'SERVICE_PORT' will respond to HTTP requests
-ESP8266WebServer server(SERVICE_PORT);
+ESP8266WebServer            server(SERVICE_PORT);
 
 /*
    getTimeString
 */
-const char* getTimeString(void) {
-
+const char*                 getTimeString(void)
+{
   static char acTimeString[32];
-  time_t now = time(nullptr);
+  time_t      now = time(nullptr);
   ctime_r(&now, acTimeString);
   size_t stLength;
-  while (((stLength = strlen(acTimeString))) && ('\n' == acTimeString[stLength - 1])) {
-    acTimeString[stLength - 1] = 0; // Remove trailing line break...
+  while (((stLength = strlen(acTimeString))) && ('\n' == acTimeString[stLength - 1]))
+  {
+    acTimeString[stLength - 1] = 0;  // Remove trailing line break...
   }
   return acTimeString;
 }
@@ -83,12 +84,14 @@ const char* getTimeString(void) {
 
    Set time via NTP
 */
-void setClock(void) {
+void setClock(void)
+{
   configTime((TIMEZONE_OFFSET * 3600), (DST_OFFSET * 3600), "pool.ntp.org", "time.nist.gov", "time.windows.com");
 
   Serial.print("Waiting for NTP time sync: ");
-  time_t now = time(nullptr); // Secs since 01.01.1970 (when uninitialized starts with (8 * 3600 = 28800)
-  while (now < 8 * 3600 * 2) { // Wait for realistic value
+  time_t now = time(nullptr);  // Secs since 01.01.1970 (when uninitialized starts with (8 * 3600 = 28800)
+  while (now < 8 * 3600 * 2)
+  {  // Wait for realistic value
     delay(500);
     Serial.print(".");
     now = time(nullptr);
@@ -100,9 +103,10 @@ void setClock(void) {
 /*
    setStationHostname
 */
-bool setStationHostname(const char* p_pcHostname) {
-
-  if (p_pcHostname) {
+bool setStationHostname(const char* p_pcHostname)
+{
+  if (p_pcHostname)
+  {
     WiFi.hostname(p_pcHostname);
     Serial.printf("setDeviceHostname: Station hostname is set to '%s'\n", p_pcHostname);
   }
@@ -118,10 +122,12 @@ bool setStationHostname(const char* p_pcHostname) {
    This can be triggered by calling MDNS.announce().
 
 */
-void MDNSDynamicServiceTxtCallback(const MDNSResponder::hMDNSService p_hService) {
+void MDNSDynamicServiceTxtCallback(const MDNSResponder::hMDNSService p_hService)
+{
   Serial.println("MDNSDynamicServiceTxtCallback");
 
-  if (hMDNSService == p_hService) {
+  if (hMDNSService == p_hService)
+  {
     Serial.printf("Updating curtime TXT item to: %s\n", getTimeString());
     MDNS.addDynamicServiceTxt(p_hService, "curtime", getTimeString());
   }
@@ -137,22 +143,26 @@ void MDNSDynamicServiceTxtCallback(const MDNSResponder::hMDNSService p_hService)
    restarted via p_pMDNSResponder->setHostname().
 
 */
-void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
-
+void hostProbeResult(String p_pcDomainName, bool p_bProbeResult)
+{
   Serial.println("MDNSProbeResultCallback");
   Serial.printf("MDNSProbeResultCallback: Host domain '%s.local' is %s\n", p_pcDomainName.c_str(), (p_bProbeResult ? "free" : "already USED!"));
-  if (true == p_bProbeResult) {
+  if (true == p_bProbeResult)
+  {
     // Set station hostname
     setStationHostname(pcHostDomain);
 
-    if (!bHostDomainConfirmed) {
+    if (!bHostDomainConfirmed)
+    {
       // Hostname free -> setup clock service
       bHostDomainConfirmed = true;
 
-      if (!hMDNSService) {
+      if (!hMDNSService)
+      {
         // Add a 'clock.tcp' service to port 'SERVICE_PORT', using the host domain as instance domain
         hMDNSService = MDNS.addService(0, "espclk", "tcp", SERVICE_PORT);
-        if (hMDNSService) {
+        if (hMDNSService)
+        {
           // Add a simple static MDNS service TXT item
           MDNS.addServiceTxt(hMDNSService, "port#", SERVICE_PORT);
           // Set the callback function for dynamic service TXTs
@@ -160,11 +170,16 @@ void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
         }
       }
     }
-  } else {
+  }
+  else
+  {
     // Change hostname, use '-' as divider between base name and index
-    if (MDNSResponder::indexDomain(pcHostDomain, "-", 0)) {
+    if (MDNSResponder::indexDomain(pcHostDomain, "-", 0))
+    {
       MDNS.setHostname(pcHostDomain);
-    } else {
+    }
+    else
+    {
       Serial.println("MDNSProbeResultCallback: FAILED to update hostname!");
     }
   }
@@ -174,7 +189,8 @@ void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
    handleHTTPClient
 */
 
-void handleHTTPRequest() {
+void handleHTTPRequest()
+{
   Serial.println("");
   Serial.println("HTTP Request");
 
@@ -200,7 +216,8 @@ void handleHTTPRequest() {
 /*
    setup
 */
-void setup(void) {
+void setup(void)
+{
   Serial.begin(115200);
 
   // Connect to WiFi network
@@ -209,7 +226,8 @@ void setup(void) {
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -225,9 +243,11 @@ void setup(void) {
   // Setup MDNS responder
   MDNS.setHostProbeResultCallback(hostProbeResult);
   // Init the (currently empty) host domain string with 'esp8266'
-  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) || (!MDNS.begin(pcHostDomain))) {
+  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) || (!MDNS.begin(pcHostDomain)))
+  {
     Serial.println("Error setting up MDNS responder!");
-    while (1) { // STOP
+    while (1)
+    {  // STOP
       delay(1000);
     }
   }
@@ -242,17 +262,18 @@ void setup(void) {
 /*
    loop
 */
-void loop(void) {
-
+void loop(void)
+{
   // Check if a request has come in
   server.handleClient();
   // Allow MDNS processing
   MDNS.update();
 
   static esp8266::polledTimeout::periodicMs timeout(UPDATE_CYCLE);
-  if (timeout.expired()) {
-
-    if (hMDNSService) {
+  if (timeout.expired())
+  {
+    if (hMDNSService)
+    {
       // Just trigger a new MDNS announcement, this will lead to a call to
       // 'MDNSDynamicServiceTxtCallback', which will update the time TXT item
       MDNS.announce();
diff --git a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
index 4724762b4d..1eb8ddbf6a 100644
--- a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
+++ b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
@@ -38,33 +38,34 @@
    Global defines and vars
 */
 
-#define SERVICE_PORT 80 // HTTP port
+#define SERVICE_PORT 80  // HTTP port
 
 #ifndef STASSID
 #define STASSID "your-ssid"
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*                      ssid                 = STASSID;
+const char*                      password             = STAPSK;
 
-char* pcHostDomain = 0; // Negotiated host domain
-bool bHostDomainConfirmed = false; // Flags the confirmation of the host domain
-MDNSResponder::hMDNSService hMDNSService = 0; // The handle of the http service in the MDNS responder
-MDNSResponder::hMDNSServiceQuery hMDNSServiceQuery = 0; // The handle of the 'http.tcp' service query in the MDNS responder
+char*                            pcHostDomain         = 0;      // Negotiated host domain
+bool                             bHostDomainConfirmed = false;  // Flags the confirmation of the host domain
+MDNSResponder::hMDNSService      hMDNSService         = 0;      // The handle of the http service in the MDNS responder
+MDNSResponder::hMDNSServiceQuery hMDNSServiceQuery    = 0;      // The handle of the 'http.tcp' service query in the MDNS responder
 
-const String cstrNoHTTPServices = "Currently no 'http.tcp' services in the local network!<br/>";
-String strHTTPServices = cstrNoHTTPServices;
+const String                     cstrNoHTTPServices   = "Currently no 'http.tcp' services in the local network!<br/>";
+String                           strHTTPServices      = cstrNoHTTPServices;
 
 // HTTP server at port 'SERVICE_PORT' will respond to HTTP requests
-ESP8266WebServer server(SERVICE_PORT);
+ESP8266WebServer                 server(SERVICE_PORT);
 
 /*
    setStationHostname
 */
-bool setStationHostname(const char* p_pcHostname) {
-
-  if (p_pcHostname) {
+bool                             setStationHostname(const char* p_pcHostname)
+{
+  if (p_pcHostname)
+  {
     WiFi.hostname(p_pcHostname);
     Serial.printf("setStationHostname: Station hostname is set to '%s'\n", p_pcHostname);
     return true;
@@ -75,9 +76,11 @@ bool setStationHostname(const char* p_pcHostname) {
    MDNSServiceQueryCallback
 */
 
-void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSResponder::AnswerType answerType, bool p_bSetContent) {
+void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSResponder::AnswerType answerType, bool p_bSetContent)
+{
   String answerInfo;
-  switch (answerType) {
+  switch (answerType)
+  {
     case MDNSResponder::AnswerType::ServiceDomain:
       answerInfo = "ServiceDomain " + String(serviceInfo.serviceDomain());
       break;
@@ -86,13 +89,15 @@ void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSRe
       break;
     case MDNSResponder::AnswerType::IP4Address:
       answerInfo = "IP4Address ";
-      for (IPAddress ip : serviceInfo.IP4Adresses()) {
+      for (IPAddress ip : serviceInfo.IP4Adresses())
+      {
         answerInfo += "- " + ip.toString();
       };
       break;
     case MDNSResponder::AnswerType::Txt:
       answerInfo = "TXT " + String(serviceInfo.strKeyValue());
-      for (auto kv : serviceInfo.keyValues()) {
+      for (auto kv : serviceInfo.keyValues())
+      {
         answerInfo += "\nkv : " + String(kv.first) + " : " + String(kv.second);
       }
       break;
@@ -107,9 +112,10 @@ void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSRe
    Probe result callback for Services
 */
 
-void serviceProbeResult(String p_pcServiceName,
-    const MDNSResponder::hMDNSService p_hMDNSService,
-    bool p_bProbeResult) {
+void serviceProbeResult(String                            p_pcServiceName,
+                        const MDNSResponder::hMDNSService p_hMDNSService,
+                        bool                              p_bProbeResult)
+{
   (void)p_hMDNSService;
   Serial.printf("MDNSServiceProbeResultCallback: Service %s probe %s\n", p_pcServiceName.c_str(), (p_bProbeResult ? "succeeded." : "failed!"));
 }
@@ -125,22 +131,26 @@ void serviceProbeResult(String p_pcServiceName,
 
 */
 
-void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
-
+void hostProbeResult(String p_pcDomainName, bool p_bProbeResult)
+{
   Serial.printf("MDNSHostProbeResultCallback: Host domain '%s.local' is %s\n", p_pcDomainName.c_str(), (p_bProbeResult ? "free" : "already USED!"));
 
-  if (true == p_bProbeResult) {
+  if (true == p_bProbeResult)
+  {
     // Set station hostname
     setStationHostname(pcHostDomain);
 
-    if (!bHostDomainConfirmed) {
+    if (!bHostDomainConfirmed)
+    {
       // Hostname free -> setup clock service
       bHostDomainConfirmed = true;
 
-      if (!hMDNSService) {
+      if (!hMDNSService)
+      {
         // Add a 'http.tcp' service to port 'SERVICE_PORT', using the host domain as instance domain
         hMDNSService = MDNS.addService(0, "http", "tcp", SERVICE_PORT);
-        if (hMDNSService) {
+        if (hMDNSService)
+        {
           MDNS.setServiceProbeResultCallback(hMDNSService, serviceProbeResult);
 
           // Add some '_http._tcp' protocol specific MDNS service TXT items
@@ -151,21 +161,30 @@ void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
         }
 
         // Install dynamic 'http.tcp' service query
-        if (!hMDNSServiceQuery) {
+        if (!hMDNSServiceQuery)
+        {
           hMDNSServiceQuery = MDNS.installServiceQuery("http", "tcp", MDNSServiceQueryCallback);
-          if (hMDNSServiceQuery) {
+          if (hMDNSServiceQuery)
+          {
             Serial.printf("MDNSProbeResultCallback: Service query for 'http.tcp' services installed.\n");
-          } else {
+          }
+          else
+          {
             Serial.printf("MDNSProbeResultCallback: FAILED to install service query for 'http.tcp' services!\n");
           }
         }
       }
     }
-  } else {
+  }
+  else
+  {
     // Change hostname, use '-' as divider between base name and index
-    if (MDNSResponder::indexDomain(pcHostDomain, "-", 0)) {
+    if (MDNSResponder::indexDomain(pcHostDomain, "-", 0))
+    {
       MDNS.setHostname(pcHostDomain);
-    } else {
+    }
+    else
+    {
       Serial.println("MDNSProbeResultCallback: FAILED to update hostname!");
     }
   }
@@ -174,33 +193,40 @@ void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
 /*
    HTTP request function (not found is handled by server)
 */
-void handleHTTPRequest() {
+void handleHTTPRequest()
+{
   Serial.println("");
   Serial.println("HTTP Request");
 
-  IPAddress ip = WiFi.localIP();
-  String ipStr = ip.toString();
-  String s = "<!DOCTYPE HTML>\r\n<html><h3><head>Hello from ";
+  IPAddress ip    = WiFi.localIP();
+  String    ipStr = ip.toString();
+  String    s     = "<!DOCTYPE HTML>\r\n<html><h3><head>Hello from ";
   s += WiFi.hostname() + ".local at " + WiFi.localIP().toString() + "</h3></head>";
   s += "<br/><h4>Local HTTP services are :</h4>";
   s += "<ol>";
-  for (auto info : MDNS.answerInfo(hMDNSServiceQuery)) {
+  for (auto info : MDNS.answerInfo(hMDNSServiceQuery))
+  {
     s += "<li>";
     s += info.serviceDomain();
-    if (info.hostDomainAvailable()) {
+    if (info.hostDomainAvailable())
+    {
       s += "<br/>Hostname: ";
       s += String(info.hostDomain());
       s += (info.hostPortAvailable()) ? (":" + String(info.hostPort())) : "";
     }
-    if (info.IP4AddressAvailable()) {
+    if (info.IP4AddressAvailable())
+    {
       s += "<br/>IP4:";
-      for (auto ip : info.IP4Adresses()) {
+      for (auto ip : info.IP4Adresses())
+      {
         s += " " + ip.toString();
       }
     }
-    if (info.txtAvailable()) {
+    if (info.txtAvailable())
+    {
       s += "<br/>TXT:<br/>";
-      for (auto kv : info.keyValues()) {
+      for (auto kv : info.keyValues())
+      {
         s += "\t" + String(kv.first) + " : " + String(kv.second) + "<br/>";
       }
     }
@@ -216,7 +242,8 @@ void handleHTTPRequest() {
 /*
    setup
 */
-void setup(void) {
+void setup(void)
+{
   Serial.begin(115200);
   Serial.setDebugOutput(false);
 
@@ -226,7 +253,8 @@ void setup(void) {
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -243,9 +271,11 @@ void setup(void) {
   MDNS.setHostProbeResultCallback(hostProbeResult);
 
   // Init the (currently empty) host domain string with 'esp8266'
-  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) || (!MDNS.begin(pcHostDomain))) {
+  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) || (!MDNS.begin(pcHostDomain)))
+  {
     Serial.println(" Error setting up MDNS responder!");
-    while (1) { // STOP
+    while (1)
+    {  // STOP
       delay(1000);
     }
   }
@@ -256,7 +286,8 @@ void setup(void) {
   Serial.println("HTTP server started");
 }
 
-void loop(void) {
+void loop(void)
+{
   // Check if a request has come in
   server.handleClient();
   // Allow MDNS processing
diff --git a/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino b/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
index 97364eb729..67de198769 100644
--- a/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
+++ b/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
@@ -34,15 +34,15 @@
    @brief mDNS and OTA Constants
    @{
 */
-#define HOSTNAME "ESP8266-OTA-" ///< Hostname. The setup function adds the Chip ID at the end.
+#define HOSTNAME "ESP8266-OTA-"  ///< Hostname. The setup function adds the Chip ID at the end.
 /// @}
 
 /**
    @brief Default WiFi connection information.
    @{
 */
-const char* ap_default_ssid = APSSID; ///< Default SSID.
-const char* ap_default_psk = APPSK; ///< Default PSK.
+const char* ap_default_ssid = APSSID;  ///< Default SSID.
+const char* ap_default_psk  = APPSK;   ///< Default PSK.
 /// @}
 
 /// Uncomment the next line for verbose output over UART.
@@ -58,10 +58,12 @@ const char* ap_default_psk = APPSK; ///< Default PSK.
    and the WiFi PSK in the second line.
    Line separator can be \r\n (CR LF) \r or \n.
 */
-bool loadConfig(String* ssid, String* pass) {
+bool        loadConfig(String* ssid, String* pass)
+{
   // open file for reading.
   File configFile = LittleFS.open("/cl_conf.txt", "r");
-  if (!configFile) {
+  if (!configFile)
+  {
     Serial.println("Failed to open cl_conf.txt.");
 
     return false;
@@ -74,19 +76,22 @@ bool loadConfig(String* ssid, String* pass) {
   content.trim();
 
   // Check if there is a second line available.
-  int8_t pos = content.indexOf("\r\n");
-  uint8_t le = 2;
+  int8_t  pos = content.indexOf("\r\n");
+  uint8_t le  = 2;
   // check for linux and mac line ending.
-  if (pos == -1) {
-    le = 1;
+  if (pos == -1)
+  {
+    le  = 1;
     pos = content.indexOf("\n");
-    if (pos == -1) {
+    if (pos == -1)
+    {
       pos = content.indexOf("\r");
     }
   }
 
   // If there is no second line: Some information is missing.
-  if (pos == -1) {
+  if (pos == -1)
+  {
     Serial.println("Infvalid content.");
     Serial.println(content);
 
@@ -109,7 +114,7 @@ bool loadConfig(String* ssid, String* pass) {
 #endif
 
   return true;
-} // loadConfig
+}  // loadConfig
 
 /**
    @brief Save WiFi SSID and PSK to configuration file.
@@ -117,10 +122,12 @@ bool loadConfig(String* ssid, String* pass) {
    @param pass PSK as string pointer,
    @return True or False.
 */
-bool saveConfig(String* ssid, String* pass) {
+bool saveConfig(String* ssid, String* pass)
+{
   // Open config file for writing.
   File configFile = LittleFS.open("/cl_conf.txt", "w");
-  if (!configFile) {
+  if (!configFile)
+  {
     Serial.println("Failed to open cl_conf.txt for writing");
 
     return false;
@@ -133,14 +140,15 @@ bool saveConfig(String* ssid, String* pass) {
   configFile.close();
 
   return true;
-} // saveConfig
+}  // saveConfig
 
 /**
    @brief Arduino setup function.
 */
-void setup() {
+void setup()
+{
   String station_ssid = "";
-  String station_psk = "";
+  String station_psk  = "";
 
   Serial.begin(115200);
 
@@ -160,28 +168,32 @@ void setup() {
   //Serial.println(WiFi.hostname());
 
   // Initialize file system.
-  if (!LittleFS.begin()) {
+  if (!LittleFS.begin())
+  {
     Serial.println("Failed to mount file system");
     return;
   }
 
   // Load wifi connection information.
-  if (!loadConfig(&station_ssid, &station_psk)) {
+  if (!loadConfig(&station_ssid, &station_psk))
+  {
     station_ssid = STASSID;
-    station_psk = STAPSK;
+    station_psk  = STAPSK;
 
     Serial.println("No WiFi connection information available.");
   }
 
   // Check WiFi connection
   // ... check mode
-  if (WiFi.getMode() != WIFI_STA) {
+  if (WiFi.getMode() != WIFI_STA)
+  {
     WiFi.mode(WIFI_STA);
     delay(10);
   }
 
   // ... Compare file config with sdk config.
-  if (WiFi.SSID() != station_ssid || WiFi.psk() != station_psk) {
+  if (WiFi.SSID() != station_ssid || WiFi.psk() != station_psk)
+  {
     Serial.println("WiFi config changed.");
 
     // ... Try to connect to WiFi station.
@@ -193,7 +205,9 @@ void setup() {
 
     // ... Uncomment this for debugging output.
     //WiFi.printDiag(Serial);
-  } else {
+  }
+  else
+  {
     // ... Begin with sdk config.
     WiFi.begin();
   }
@@ -202,7 +216,8 @@ void setup() {
 
   // ... Give ESP 10 seconds to connect to station.
   unsigned long startTime = millis();
-  while (WiFi.status() != WL_CONNECTED && millis() - startTime < 10000) {
+  while (WiFi.status() != WL_CONNECTED && millis() - startTime < 10000)
+  {
     Serial.write('.');
     //Serial.print(WiFi.status());
     delay(500);
@@ -210,11 +225,14 @@ void setup() {
   Serial.println();
 
   // Check connection
-  if (WiFi.status() == WL_CONNECTED) {
+  if (WiFi.status() == WL_CONNECTED)
+  {
     // ... print IP Address
     Serial.print("IP address: ");
     Serial.println(WiFi.localIP());
-  } else {
+  }
+  else
+  {
     Serial.println("Can not connect to WiFi station. Go into AP mode.");
 
     // Go into software AP mode.
@@ -236,7 +254,8 @@ void setup() {
 /**
    @brief Arduino loop function.
 */
-void loop() {
+void loop()
+{
   // Handle OTA server.
   ArduinoOTA.handle();
 }
diff --git a/libraries/ESP8266mDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino b/libraries/ESP8266mDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino
index 0a43ca3e85..4ba4a713e6 100644
--- a/libraries/ESP8266mDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino
+++ b/libraries/ESP8266mDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino
@@ -17,11 +17,12 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
-char hostString[16] = { 0 };
+const char* ssid           = STASSID;
+const char* password       = STAPSK;
+char        hostString[16] = { 0 };
 
-void setup() {
+void        setup()
+{
   Serial.begin(115200);
   delay(100);
   Serial.println("\r\nsetup()");
@@ -33,7 +34,8 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(250);
     Serial.print(".");
   }
@@ -43,21 +45,26 @@ void setup() {
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-  if (!MDNS.begin(hostString)) {
+  if (!MDNS.begin(hostString))
+  {
     Serial.println("Error setting up MDNS responder!");
   }
   Serial.println("mDNS responder started");
-  MDNS.addService("esp", "tcp", 8080); // Announce esp tcp service on port 8080
+  MDNS.addService("esp", "tcp", 8080);  // Announce esp tcp service on port 8080
 
   Serial.println("Sending mDNS query");
-  int n = MDNS.queryService("esp", "tcp"); // Send out query for esp tcp services
+  int n = MDNS.queryService("esp", "tcp");  // Send out query for esp tcp services
   Serial.println("mDNS query done");
-  if (n == 0) {
+  if (n == 0)
+  {
     Serial.println("no services found");
-  } else {
+  }
+  else
+  {
     Serial.print(n);
     Serial.println(" service(s) found");
-    for (int i = 0; i < n; ++i) {
+    for (int i = 0; i < n; ++i)
+    {
       // Print details for each service found
       Serial.print(i + 1);
       Serial.print(": ");
@@ -74,7 +81,8 @@ void setup() {
   Serial.println("loop() next");
 }
 
-void loop() {
+void loop()
+{
   // put your main code here, to run repeatedly:
   MDNS.update();
 }
diff --git a/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino b/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
index 3f65e361de..0fa0e52327 100644
--- a/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
+++ b/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
@@ -24,13 +24,14 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 // TCP server at port 80 will respond to HTTP requests
-WiFiServer server(80);
+WiFiServer  server(80);
 
-void setup(void) {
+void        setup(void)
+{
   Serial.begin(115200);
 
   // Connect to WiFi network
@@ -39,7 +40,8 @@ void setup(void) {
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -54,9 +56,11 @@ void setup(void) {
   //   the fully-qualified domain name is "esp8266.local"
   // - second argument is the IP address to advertise
   //   we send our IP address on the WiFi network
-  if (!MDNS.begin("esp8266")) {
+  if (!MDNS.begin("esp8266"))
+  {
     Serial.println("Error setting up MDNS responder!");
-    while (1) {
+    while (1)
+    {
       delay(1000);
     }
   }
@@ -70,31 +74,34 @@ void setup(void) {
   MDNS.addService("http", "tcp", 80);
 }
 
-void loop(void) {
-
+void loop(void)
+{
   MDNS.update();
 
   // Check if a client has connected
   WiFiClient client = server.accept();
-  if (!client) {
+  if (!client)
+  {
     return;
   }
   Serial.println("");
   Serial.println("New client");
 
   // Wait for data from client to become available
-  while (client.connected() && !client.available()) {
+  while (client.connected() && !client.available())
+  {
     delay(1);
   }
 
   // Read the first line of HTTP request
-  String req = client.readStringUntil('\r');
+  String req        = client.readStringUntil('\r');
 
   // First line of HTTP request looks like "GET /path HTTP/1.1"
   // Retrieve the "/path" part by finding the spaces
-  int addr_start = req.indexOf(' ');
-  int addr_end = req.indexOf(' ', addr_start + 1);
-  if (addr_start == -1 || addr_end == -1) {
+  int    addr_start = req.indexOf(' ');
+  int    addr_end   = req.indexOf(' ', addr_start + 1);
+  if (addr_start == -1 || addr_end == -1)
+  {
     Serial.print("Invalid request: ");
     Serial.println(req);
     return;
@@ -105,14 +112,17 @@ void loop(void) {
   client.flush();
 
   String s;
-  if (req == "/") {
-    IPAddress ip = WiFi.localIP();
-    String ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);
-    s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>Hello from ESP8266 at ";
+  if (req == "/")
+  {
+    IPAddress ip    = WiFi.localIP();
+    String    ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);
+    s               = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>Hello from ESP8266 at ";
     s += ipStr;
     s += "</html>\r\n\r\n";
     Serial.println("Sending 200");
-  } else {
+  }
+  else
+  {
     s = "HTTP/1.1 404 Not Found\r\n\r\n";
     Serial.println("Sending 404");
   }
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.cpp b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
index 910884ae5d..b2d7d25e5a 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
@@ -55,12 +55,12 @@ namespace MDNSImplementation
     /**
     MDNSResponder::MDNSResponder
 */
-    MDNSResponder::MDNSResponder(void)
-        : m_pServices(0)
-        , m_pUDPContext(0)
-        , m_pcHostname(0)
-        , m_pServiceQueries(0)
-        , m_fnServiceTxtCallback(0)
+    MDNSResponder::MDNSResponder(void) :
+        m_pServices(0),
+        m_pUDPContext(0),
+        m_pcHostname(0),
+        m_pServiceQueries(0),
+        m_fnServiceTxtCallback(0)
     {
     }
 
@@ -102,9 +102,9 @@ namespace MDNSImplementation
                 _restart();
             });
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] begin: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] begin: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
+                     });
 
         return bResult;
     }
@@ -168,20 +168,20 @@ namespace MDNSImplementation
             m_HostProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
 
             // Replace 'auto-set' service names
-            bResult = true;
+            bResult                                = true;
             for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
             {
                 if (pService->m_bAutoName)
                 {
-                    bResult = pService->setName(p_pcHostname);
+                    bResult                                      = pService->setName(p_pcHostname);
                     pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
                 }
             }
         }
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setHostname: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setHostname: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
+                     });
         return bResult;
     }
 
@@ -206,14 +206,14 @@ namespace MDNSImplementation
 
 */
     MDNSResponder::hMDNSService MDNSResponder::addService(const char* p_pcName,
-        const char* p_pcService,
-        const char* p_pcProtocol,
-        uint16_t p_u16Port)
+                                                          const char* p_pcService,
+                                                          const char* p_pcProtocol,
+                                                          uint16_t    p_u16Port)
     {
         hMDNSService hResult = 0;
 
         if (((!p_pcName) ||  // NO name OR
-                (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcName)))
+             (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcName)))
             &&  // Fitting name
             (p_pcService) && (MDNS_SERVICE_NAME_LENGTH >= os_strlen(p_pcService)) && (p_pcProtocol) && ((MDNS_SERVICE_PROTOCOL_LENGTH - 1) != os_strlen(p_pcProtocol)) && (p_u16Port))
         {
@@ -228,9 +228,9 @@ namespace MDNSImplementation
         }  // else: bad arguments
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: %s to add '%s.%s.%s'!\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcName ?: "-"), p_pcService, p_pcProtocol););
         DEBUG_EX_ERR(if (!hResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: FAILED to add '%s.%s.%s'!\n"), (p_pcName ?: "-"), p_pcService, p_pcProtocol);
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: FAILED to add '%s.%s.%s'!\n"), (p_pcName ?: "-"), p_pcService, p_pcProtocol);
+                     });
         return hResult;
     }
 
@@ -244,11 +244,11 @@ namespace MDNSImplementation
     bool MDNSResponder::removeService(const MDNSResponder::hMDNSService p_hService)
     {
         stcMDNSService* pService = 0;
-        bool bResult = (((pService = _findService(p_hService))) && (_announceService(*pService, false)) && (_releaseService(pService)));
+        bool            bResult  = (((pService = _findService(p_hService))) && (_announceService(*pService, false)) && (_releaseService(pService)));
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeService: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeService: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -256,8 +256,8 @@ namespace MDNSImplementation
     MDNSResponder::removeService
 */
     bool MDNSResponder::removeService(const char* p_pcName,
-        const char* p_pcService,
-        const char* p_pcProtocol)
+                                      const char* p_pcService,
+                                      const char* p_pcProtocol)
     {
         return removeService((hMDNSService)_findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol));
     }
@@ -266,8 +266,8 @@ namespace MDNSImplementation
     MDNSResponder::addService (LEGACY)
 */
     bool MDNSResponder::addService(const String& p_strService,
-        const String& p_strProtocol,
-        uint16_t p_u16Port)
+                                   const String& p_strProtocol,
+                                   uint16_t      p_u16Port)
     {
         return (0 != addService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str(), p_u16Port));
     }
@@ -276,14 +276,14 @@ namespace MDNSImplementation
     MDNSResponder::setServiceName
 */
     bool MDNSResponder::setServiceName(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcInstanceName)
+                                       const char*                       p_pcInstanceName)
     {
         stcMDNSService* pService = 0;
-        bool bResult = (((!p_pcInstanceName) || (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcInstanceName))) && ((pService = _findService(p_hService))) && (pService->setName(p_pcInstanceName)) && ((pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart)));
+        bool            bResult  = (((!p_pcInstanceName) || (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcInstanceName))) && ((pService = _findService(p_hService))) && (pService->setName(p_pcInstanceName)) && ((pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart)));
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setServiceName: FAILED for '%s'!\n"), (p_pcInstanceName ?: "-"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setServiceName: FAILED for '%s'!\n"), (p_pcInstanceName ?: "-"));
+                     });
         return bResult;
     }
 
@@ -298,19 +298,19 @@ namespace MDNSImplementation
 
 */
     MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        const char* p_pcValue)
+                                                         const char*                       p_pcKey,
+                                                         const char*                       p_pcValue)
     {
-        hMDNSTxt hTxt = 0;
+        hMDNSTxt        hTxt     = 0;
         stcMDNSService* pService = _findService(p_hService);
         if (pService)
         {
             hTxt = (hMDNSTxt)_addServiceTxt(pService, p_pcKey, p_pcValue, false);
         }
         DEBUG_EX_ERR(if (!hTxt)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
+                     });
         return hTxt;
     }
 
@@ -320,8 +320,8 @@ namespace MDNSImplementation
     Formats: http://www.cplusplus.com/reference/cstdio/printf/
 */
     MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint32_t p_u32Value)
+                                                         const char*                       p_pcKey,
+                                                         uint32_t                          p_u32Value)
     {
         char acBuffer[32];
         *acBuffer = 0;
@@ -334,8 +334,8 @@ namespace MDNSImplementation
     MDNSResponder::addServiceTxt (uint16_t)
 */
     MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint16_t p_u16Value)
+                                                         const char*                       p_pcKey,
+                                                         uint16_t                          p_u16Value)
     {
         char acBuffer[16];
         *acBuffer = 0;
@@ -348,8 +348,8 @@ namespace MDNSImplementation
     MDNSResponder::addServiceTxt (uint8_t)
 */
     MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint8_t p_u8Value)
+                                                         const char*                       p_pcKey,
+                                                         uint8_t                           p_u8Value)
     {
         char acBuffer[8];
         *acBuffer = 0;
@@ -362,8 +362,8 @@ namespace MDNSImplementation
     MDNSResponder::addServiceTxt (int32_t)
 */
     MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int32_t p_i32Value)
+                                                         const char*                       p_pcKey,
+                                                         int32_t                           p_i32Value)
     {
         char acBuffer[32];
         *acBuffer = 0;
@@ -376,8 +376,8 @@ namespace MDNSImplementation
     MDNSResponder::addServiceTxt (int16_t)
 */
     MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int16_t p_i16Value)
+                                                         const char*                       p_pcKey,
+                                                         int16_t                           p_i16Value)
     {
         char acBuffer[16];
         *acBuffer = 0;
@@ -390,8 +390,8 @@ namespace MDNSImplementation
     MDNSResponder::addServiceTxt (int8_t)
 */
     MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int8_t p_i8Value)
+                                                         const char*                       p_pcKey,
+                                                         int8_t                            p_i8Value)
     {
         char acBuffer[8];
         *acBuffer = 0;
@@ -406,9 +406,9 @@ namespace MDNSImplementation
     Remove a static service TXT item from a service.
 */
     bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const MDNSResponder::hMDNSTxt p_hTxt)
+                                         const MDNSResponder::hMDNSTxt     p_hTxt)
     {
-        bool bResult = false;
+        bool            bResult  = false;
 
         stcMDNSService* pService = _findService(p_hService);
         if (pService)
@@ -420,9 +420,9 @@ namespace MDNSImplementation
             }
         }
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -430,9 +430,9 @@ namespace MDNSImplementation
     MDNSResponder::removeServiceTxt
 */
     bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey)
+                                         const char*                       p_pcKey)
     {
-        bool bResult = false;
+        bool            bResult  = false;
 
         stcMDNSService* pService = _findService(p_hService);
         if (pService)
@@ -444,9 +444,9 @@ namespace MDNSImplementation
             }
         }
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED for '%s'!\n"), (p_pcKey ?: "-"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED for '%s'!\n"), (p_pcKey ?: "-"));
+                     });
         return bResult;
     }
 
@@ -454,11 +454,11 @@ namespace MDNSImplementation
     MDNSResponder::removeServiceTxt
 */
     bool MDNSResponder::removeServiceTxt(const char* p_pcName,
-        const char* p_pcService,
-        const char* p_pcProtocol,
-        const char* p_pcKey)
+                                         const char* p_pcService,
+                                         const char* p_pcProtocol,
+                                         const char* p_pcKey)
     {
-        bool bResult = false;
+        bool            bResult  = false;
 
         stcMDNSService* pService = _findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol);
         if (pService)
@@ -476,9 +476,9 @@ namespace MDNSImplementation
     MDNSResponder::addServiceTxt (LEGACY)
 */
     bool MDNSResponder::addServiceTxt(const char* p_pcService,
-        const char* p_pcProtocol,
-        const char* p_pcKey,
-        const char* p_pcValue)
+                                      const char* p_pcProtocol,
+                                      const char* p_pcKey,
+                                      const char* p_pcValue)
     {
         return (0 != _addServiceTxt(_findService(m_pcHostname, p_pcService, p_pcProtocol), p_pcKey, p_pcValue, false));
     }
@@ -487,9 +487,9 @@ namespace MDNSImplementation
     MDNSResponder::addServiceTxt (LEGACY)
 */
     bool MDNSResponder::addServiceTxt(const String& p_strService,
-        const String& p_strProtocol,
-        const String& p_strKey,
-        const String& p_strValue)
+                                      const String& p_strProtocol,
+                                      const String& p_strKey,
+                                      const String& p_strValue)
     {
         return (0 != _addServiceTxt(_findService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str()), p_strKey.c_str(), p_strValue.c_str(), false));
     }
@@ -515,22 +515,22 @@ namespace MDNSImplementation
     service TXT items are needed for the given service.
 
 */
-    bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::hMDNSService p_hService,
-        MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
+    bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::hMDNSService                      p_hService,
+                                                     MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
     {
-        bool bResult = false;
+        bool            bResult  = false;
 
         stcMDNSService* pService = _findService(p_hService);
         if (pService)
         {
             pService->m_fnTxtCallback = p_fnCallback;
 
-            bResult = true;
+            bResult                   = true;
         }
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setDynamicServiceTxtCallback: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setDynamicServiceTxtCallback: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -538,12 +538,12 @@ namespace MDNSImplementation
     MDNSResponder::addDynamicServiceTxt
 */
     MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        const char* p_pcValue)
+                                                                const char*                 p_pcKey,
+                                                                const char*                 p_pcValue)
     {
         //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt (%s=%s)\n"), p_pcKey, p_pcValue););
 
-        hMDNSTxt hTxt = 0;
+        hMDNSTxt        hTxt     = 0;
 
         stcMDNSService* pService = _findService(p_hService);
         if (pService)
@@ -551,9 +551,9 @@ namespace MDNSImplementation
             hTxt = _addServiceTxt(pService, p_pcKey, p_pcValue, true);
         }
         DEBUG_EX_ERR(if (!hTxt)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
+                     });
         return hTxt;
     }
 
@@ -561,8 +561,8 @@ namespace MDNSImplementation
     MDNSResponder::addDynamicServiceTxt (uint32_t)
 */
     MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint32_t p_u32Value)
+                                                                const char*                 p_pcKey,
+                                                                uint32_t                    p_u32Value)
     {
         char acBuffer[32];
         *acBuffer = 0;
@@ -575,8 +575,8 @@ namespace MDNSImplementation
     MDNSResponder::addDynamicServiceTxt (uint16_t)
 */
     MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint16_t p_u16Value)
+                                                                const char*                 p_pcKey,
+                                                                uint16_t                    p_u16Value)
     {
         char acBuffer[16];
         *acBuffer = 0;
@@ -589,8 +589,8 @@ namespace MDNSImplementation
     MDNSResponder::addDynamicServiceTxt (uint8_t)
 */
     MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint8_t p_u8Value)
+                                                                const char*                 p_pcKey,
+                                                                uint8_t                     p_u8Value)
     {
         char acBuffer[8];
         *acBuffer = 0;
@@ -603,8 +603,8 @@ namespace MDNSImplementation
     MDNSResponder::addDynamicServiceTxt (int32_t)
 */
     MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int32_t p_i32Value)
+                                                                const char*                 p_pcKey,
+                                                                int32_t                     p_i32Value)
     {
         char acBuffer[32];
         *acBuffer = 0;
@@ -617,8 +617,8 @@ namespace MDNSImplementation
     MDNSResponder::addDynamicServiceTxt (int16_t)
 */
     MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int16_t p_i16Value)
+                                                                const char*                 p_pcKey,
+                                                                int16_t                     p_i16Value)
     {
         char acBuffer[16];
         *acBuffer = 0;
@@ -631,8 +631,8 @@ namespace MDNSImplementation
     MDNSResponder::addDynamicServiceTxt (int8_t)
 */
     MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int8_t p_i8Value)
+                                                                const char*                 p_pcKey,
+                                                                int8_t                      p_i8Value)
     {
         char acBuffer[8];
         *acBuffer = 0;
@@ -655,9 +655,9 @@ namespace MDNSImplementation
     - answerPort (or 'port')
 
 */
-    uint32_t MDNSResponder::queryService(const char* p_pcService,
-        const char* p_pcProtocol,
-        const uint16_t p_u16Timeout /*= MDNS_QUERYSERVICES_WAIT_TIME*/)
+    uint32_t MDNSResponder::queryService(const char*    p_pcService,
+                                         const char*    p_pcProtocol,
+                                         const uint16_t p_u16Timeout /*= MDNS_QUERYSERVICES_WAIT_TIME*/)
     {
         if (0 == m_pUDPContext)
         {
@@ -667,7 +667,7 @@ namespace MDNSImplementation
 
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService '%s.%s'\n"), p_pcService, p_pcProtocol););
 
-        uint32_t u32Result = 0;
+        uint32_t             u32Result     = 0;
 
         stcMDNSServiceQuery* pServiceQuery = 0;
         if ((p_pcService) && (os_strlen(p_pcService)) && (p_pcProtocol) && (os_strlen(p_pcProtocol)) && (p_u16Timeout) && (_removeLegacyServiceQuery()) && ((pServiceQuery = _allocServiceQuery())) && (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
@@ -682,7 +682,7 @@ namespace MDNSImplementation
 
                 // All answers should have arrived by now -> stop adding new answers
                 pServiceQuery->m_bAwaitingAnswers = false;
-                u32Result = pServiceQuery->answerCount();
+                u32Result                         = pServiceQuery->answerCount();
             }
             else  // FAILED to send query
             {
@@ -711,7 +711,7 @@ namespace MDNSImplementation
     MDNSResponder::queryService (LEGACY)
 */
     uint32_t MDNSResponder::queryService(const String& p_strService,
-        const String& p_strProtocol)
+                                         const String& p_strProtocol)
     {
         return queryService(p_strService.c_str(), p_strProtocol.c_str());
     }
@@ -721,8 +721,8 @@ namespace MDNSImplementation
 */
     const char* MDNSResponder::answerHostname(const uint32_t p_u32AnswerIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findLegacyServiceQuery();
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
 
         if ((pSQAnswer) && (pSQAnswer->m_HostDomain.m_u16NameLength) && (!pSQAnswer->m_pcHostDomain))
         {
@@ -741,9 +741,9 @@ namespace MDNSImplementation
 */
     IPAddress MDNSResponder::answerIP(const uint32_t p_u32AnswerIndex)
     {
-        const stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
-        const stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        const stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = (((pSQAnswer) && (pSQAnswer->m_pIP4Addresses)) ? pSQAnswer->IP4AddressAtIndex(0) : 0);
+        const stcMDNSServiceQuery*                           pServiceQuery = _findLegacyServiceQuery();
+        const stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        const stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address   = (((pSQAnswer) && (pSQAnswer->m_pIP4Addresses)) ? pSQAnswer->IP4AddressAtIndex(0) : 0);
         return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
     }
 #endif
@@ -754,9 +754,9 @@ namespace MDNSImplementation
 */
     IPAddress MDNSResponder::answerIP6(const uint32_t p_u32AnswerIndex)
     {
-        const stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
-        const stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        const stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address = (((pSQAnswer) && (pSQAnswer->m_pIP6Addresses)) ? pSQAnswer->IP6AddressAtIndex(0) : 0);
+        const stcMDNSServiceQuery*                           pServiceQuery = _findLegacyServiceQuery();
+        const stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        const stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address   = (((pSQAnswer) && (pSQAnswer->m_pIP6Addresses)) ? pSQAnswer->IP6AddressAtIndex(0) : 0);
         return (pIP6Address ? pIP6Address->m_IPAddress : IP6Address());
     }
 #endif
@@ -766,8 +766,8 @@ namespace MDNSImplementation
 */
     uint16_t MDNSResponder::answerPort(const uint32_t p_u32AnswerIndex)
     {
-        const stcMDNSServiceQuery* pServiceQuery = _findLegacyServiceQuery();
-        const stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        const stcMDNSServiceQuery*            pServiceQuery = _findLegacyServiceQuery();
+        const stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
     }
 
@@ -812,16 +812,16 @@ namespace MDNSImplementation
     - answerTxts
 
 */
-    MDNSResponder::hMDNSServiceQuery MDNSResponder::installServiceQuery(const char* p_pcService,
-        const char* p_pcProtocol,
-        MDNSResponder::MDNSServiceQueryCallbackFunc p_fnCallback)
+    MDNSResponder::hMDNSServiceQuery MDNSResponder::installServiceQuery(const char*                                 p_pcService,
+                                                                        const char*                                 p_pcProtocol,
+                                                                        MDNSResponder::MDNSServiceQueryCallbackFunc p_fnCallback)
     {
-        hMDNSServiceQuery hResult = 0;
+        hMDNSServiceQuery    hResult       = 0;
 
         stcMDNSServiceQuery* pServiceQuery = 0;
         if ((p_pcService) && (os_strlen(p_pcService)) && (p_pcProtocol) && (os_strlen(p_pcProtocol)) && (p_fnCallback) && ((pServiceQuery = _allocServiceQuery())) && (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
         {
-            pServiceQuery->m_fnCallback = p_fnCallback;
+            pServiceQuery->m_fnCallback   = p_fnCallback;
             pServiceQuery->m_bLegacyQuery = false;
 
             if (_sendMDNSServiceQuery(*pServiceQuery))
@@ -838,9 +838,9 @@ namespace MDNSImplementation
         }
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: %s for '%s.%s'!\n\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
         DEBUG_EX_ERR(if (!hResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: FAILED for '%s.%s'!\n\n"), (p_pcService ?: "-"), (p_pcProtocol ?: "-"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: FAILED for '%s.%s'!\n\n"), (p_pcService ?: "-"), (p_pcProtocol ?: "-"));
+                     });
         return hResult;
     }
 
@@ -853,11 +853,11 @@ namespace MDNSImplementation
     bool MDNSResponder::removeServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
     {
         stcMDNSServiceQuery* pServiceQuery = 0;
-        bool bResult = (((pServiceQuery = _findServiceQuery(p_hServiceQuery))) && (_removeServiceQuery(pServiceQuery)));
+        bool                 bResult       = (((pServiceQuery = _findServiceQuery(p_hServiceQuery))) && (_removeServiceQuery(pServiceQuery)));
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceQuery: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceQuery: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -888,10 +888,10 @@ namespace MDNSImplementation
 
 */
     const char* MDNSResponder::answerServiceDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                                   const uint32_t                         p_u32AnswerIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         // Fill m_pcServiceDomain (if not already done)
         if ((pSQAnswer) && (pSQAnswer->m_ServiceDomain.m_u16NameLength) && (!pSQAnswer->m_pcServiceDomain))
         {
@@ -908,10 +908,10 @@ namespace MDNSImplementation
     MDNSResponder::hasAnswerHostDomain
 */
     bool MDNSResponder::hasAnswerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                            const uint32_t                         p_u32AnswerIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
     }
 
@@ -923,10 +923,10 @@ namespace MDNSImplementation
 
 */
     const char* MDNSResponder::answerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                                const uint32_t                         p_u32AnswerIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         // Fill m_pcHostDomain (if not already done)
         if ((pSQAnswer) && (pSQAnswer->m_HostDomain.m_u16NameLength) && (!pSQAnswer->m_pcHostDomain))
         {
@@ -944,10 +944,10 @@ namespace MDNSImplementation
     MDNSResponder::hasAnswerIP4Address
 */
     bool MDNSResponder::hasAnswerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                            const uint32_t                         p_u32AnswerIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_IP4Address));
     }
 
@@ -955,10 +955,10 @@ namespace MDNSImplementation
     MDNSResponder::answerIP4AddressCount
 */
     uint32_t MDNSResponder::answerIP4AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                                  const uint32_t                         p_u32AnswerIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return (pSQAnswer ? pSQAnswer->IP4AddressCount() : 0);
     }
 
@@ -966,12 +966,12 @@ namespace MDNSImplementation
     MDNSResponder::answerIP4Address
 */
     IPAddress MDNSResponder::answerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex,
-        const uint32_t p_u32AddressIndex)
+                                              const uint32_t                         p_u32AnswerIndex,
+                                              const uint32_t                         p_u32AddressIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = (pSQAnswer ? pSQAnswer->IP4AddressAtIndex(p_u32AddressIndex) : 0);
+        stcMDNSServiceQuery*                           pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address   = (pSQAnswer ? pSQAnswer->IP4AddressAtIndex(p_u32AddressIndex) : 0);
         return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
     }
 #endif
@@ -981,10 +981,10 @@ namespace MDNSImplementation
     MDNSResponder::hasAnswerIP6Address
 */
     bool MDNSResponder::hasAnswerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                            const uint32_t                         p_u32AnswerIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostIP6Address));
     }
 
@@ -992,10 +992,10 @@ namespace MDNSImplementation
     MDNSResponder::answerIP6AddressCount
 */
     uint32_t MDNSResponder::answerIP6AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                                  const uint32_t                         p_u32AnswerIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return (pSQAnswer ? pSQAnswer->IP6AddressCount() : 0);
     }
 
@@ -1003,12 +1003,12 @@ namespace MDNSImplementation
     MDNSResponder::answerIP6Address
 */
     IPAddress MDNSResponder::answerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex,
-        const uint32_t p_u32AddressIndex)
+                                              const uint32_t                         p_u32AnswerIndex,
+                                              const uint32_t                         p_u32AddressIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address = (pSQAnswer ? pSQAnswer->IP6AddressAtIndex(p_u32AddressIndex) : 0);
+        stcMDNSServiceQuery*                           pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address   = (pSQAnswer ? pSQAnswer->IP6AddressAtIndex(p_u32AddressIndex) : 0);
         return (pIP6Address ? pIP6Address->m_IPAddress : IPAddress());
     }
 #endif
@@ -1017,10 +1017,10 @@ namespace MDNSImplementation
     MDNSResponder::hasAnswerPort
 */
     bool MDNSResponder::hasAnswerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                      const uint32_t                         p_u32AnswerIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
     }
 
@@ -1028,10 +1028,10 @@ namespace MDNSImplementation
     MDNSResponder::answerPort
 */
     uint16_t MDNSResponder::answerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                       const uint32_t                         p_u32AnswerIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
     }
 
@@ -1039,10 +1039,10 @@ namespace MDNSImplementation
     MDNSResponder::hasAnswerTxts
 */
     bool MDNSResponder::hasAnswerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                      const uint32_t                         p_u32AnswerIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_Txts));
     }
 
@@ -1054,10 +1054,10 @@ namespace MDNSImplementation
 
 */
     const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                          const uint32_t                         p_u32AnswerIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         // Fill m_pcTxts (if not already done)
         if ((pSQAnswer) && (pSQAnswer->m_Txts.m_pTxts) && (!pSQAnswer->m_pcTxts))
         {
@@ -1095,7 +1095,7 @@ namespace MDNSImplementation
     {
         using namespace std::placeholders;
         return setHostProbeResultCallback([this, pfn](const char* p_pcDomainName, bool p_bProbeResult)
-            { pfn(*this, p_pcDomainName, p_bProbeResult); });
+                                          { pfn(*this, p_pcDomainName, p_bProbeResult); });
     }
 
     /*
@@ -1108,26 +1108,26 @@ namespace MDNSImplementation
 
 */
     bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-        MDNSResponder::MDNSServiceProbeFn p_fnCallback)
+                                                      MDNSResponder::MDNSServiceProbeFn p_fnCallback)
     {
-        bool bResult = false;
+        bool            bResult  = false;
 
         stcMDNSService* pService = _findService(p_hService);
         if (pService)
         {
             pService->m_ProbeInformation.m_fnServiceProbeResultCallback = p_fnCallback;
 
-            bResult = true;
+            bResult                                                     = true;
         }
         return bResult;
     }
 
-    bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-        MDNSResponder::MDNSServiceProbeFn1 p_fnCallback)
+    bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService  p_hService,
+                                                      MDNSResponder::MDNSServiceProbeFn1 p_fnCallback)
     {
         using namespace std::placeholders;
         return setServiceProbeResultCallback(p_hService, [this, p_fnCallback](const char* p_pcServiceName, const hMDNSService p_hMDNSService, bool p_bProbeResult)
-            { p_fnCallback(*this, p_pcServiceName, p_hMDNSService, p_bProbeResult); });
+                                             { p_fnCallback(*this, p_pcServiceName, p_hMDNSService, p_bProbeResult); });
     }
 
     /*
@@ -1174,7 +1174,7 @@ namespace MDNSImplementation
 
 */
     MDNSResponder::hMDNSService MDNSResponder::enableArduino(uint16_t p_u16Port,
-        bool p_bAuthUpload /*= false*/)
+                                                             bool     p_bAuthUpload /*= false*/)
     {
         hMDNSService hService = addService(0, "arduino", "tcp", p_u16Port);
         if (hService)
@@ -1226,13 +1226,13 @@ namespace MDNSImplementation
                 else
                 {
                     DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_joingroup_netif(" NETIFID_STR ": %s) FAILED!\n"),
-                        NETIFID_VAL(pNetIf), IPAddress(multicast_addr_V4).toString().c_str()););
+                                                       NETIFID_VAL(pNetIf), IPAddress(multicast_addr_V4).toString().c_str()););
                 }
 #endif
 
 #ifdef MDNS_IPV6_SUPPORT
                 ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
-                bResult = ((bResult) && (ERR_OK == mld6_joingroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6))));
+                bResult                     = ((bResult) && (ERR_OK == mld6_joingroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6))));
                 DEBUG_EX_ERR_IF(!bResult, DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: mld6_joingroup_netif (" NETIFID_STR ") FAILED!\n"), NETIFID_VAL(pNetIf)));
 #endif
             }
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.h b/libraries/ESP8266mDNS/src/LEAmDNS.h
index 24a561080f..b27c1302d0 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.h
@@ -212,27 +212,27 @@ namespace MDNSImplementation
         // the current hostname is used. If the hostname is changed later, the instance names for
         // these 'auto-named' services are changed to the new name also (and probing is restarted).
         // The usual '_' before p_pcService (eg. http) and protocol (eg. tcp) may be given.
-        hMDNSService addService(const char* p_pcName,
-            const char* p_pcService,
-            const char* p_pcProtocol,
-            uint16_t p_u16Port);
+        hMDNSService        addService(const char* p_pcName,
+                                       const char* p_pcService,
+                                       const char* p_pcProtocol,
+                                       uint16_t    p_u16Port);
         // Removes a service from the MDNS responder
-        bool removeService(const hMDNSService p_hService);
-        bool removeService(const char* p_pcInstanceName,
-            const char* p_pcServiceName,
-            const char* p_pcProtocol);
+        bool                removeService(const hMDNSService p_hService);
+        bool                removeService(const char* p_pcInstanceName,
+                                          const char* p_pcServiceName,
+                                          const char* p_pcProtocol);
         // for compatibility...
-        bool addService(const String& p_strServiceName,
-            const String& p_strProtocol,
-            uint16_t p_u16Port);
+        bool                addService(const String& p_strServiceName,
+                                       const String& p_strProtocol,
+                                       uint16_t      p_u16Port);
 
         // Change the services instance name (and restart probing).
-        bool setServiceName(const hMDNSService p_hService,
-            const char* p_pcInstanceName);
+        bool                setServiceName(const hMDNSService p_hService,
+                                           const char*        p_pcInstanceName);
         //for compatibility
         //Warning: this has the side effect of changing the hostname.
         //TODO: implement instancename different from hostname
-        void setInstanceName(const char* p_pcHostname)
+        void                setInstanceName(const char* p_pcHostname)
         {
             setHostname(p_pcHostname);
         }
@@ -245,49 +245,49 @@ namespace MDNSImplementation
         /**
         hMDNSTxt (opaque handle to access the TXT items)
     */
-        typedef void* hMDNSTxt;
+        typedef void*                                              hMDNSTxt;
 
         // Add a (static) MDNS TXT item ('key' = 'value') to the service
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-            const char* p_pcKey,
-            const char* p_pcValue);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-            const char* p_pcKey,
-            uint32_t p_u32Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-            const char* p_pcKey,
-            uint16_t p_u16Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-            const char* p_pcKey,
-            uint8_t p_u8Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-            const char* p_pcKey,
-            int32_t p_i32Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-            const char* p_pcKey,
-            int16_t p_i16Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-            const char* p_pcKey,
-            int8_t p_i8Value);
+        hMDNSTxt                                                   addServiceTxt(const hMDNSService p_hService,
+                                                                                 const char*        p_pcKey,
+                                                                                 const char*        p_pcValue);
+        hMDNSTxt                                                   addServiceTxt(const hMDNSService p_hService,
+                                                                                 const char*        p_pcKey,
+                                                                                 uint32_t           p_u32Value);
+        hMDNSTxt                                                   addServiceTxt(const hMDNSService p_hService,
+                                                                                 const char*        p_pcKey,
+                                                                                 uint16_t           p_u16Value);
+        hMDNSTxt                                                   addServiceTxt(const hMDNSService p_hService,
+                                                                                 const char*        p_pcKey,
+                                                                                 uint8_t            p_u8Value);
+        hMDNSTxt                                                   addServiceTxt(const hMDNSService p_hService,
+                                                                                 const char*        p_pcKey,
+                                                                                 int32_t            p_i32Value);
+        hMDNSTxt                                                   addServiceTxt(const hMDNSService p_hService,
+                                                                                 const char*        p_pcKey,
+                                                                                 int16_t            p_i16Value);
+        hMDNSTxt                                                   addServiceTxt(const hMDNSService p_hService,
+                                                                                 const char*        p_pcKey,
+                                                                                 int8_t             p_i8Value);
 
         // Remove an existing (static) MDNS TXT item from the service
-        bool removeServiceTxt(const hMDNSService p_hService,
-            const hMDNSTxt p_hTxt);
-        bool removeServiceTxt(const hMDNSService p_hService,
-            const char* p_pcKey);
-        bool removeServiceTxt(const char* p_pcinstanceName,
-            const char* p_pcServiceName,
-            const char* p_pcProtocol,
-            const char* p_pcKey);
+        bool                                                       removeServiceTxt(const hMDNSService p_hService,
+                                                                                    const hMDNSTxt     p_hTxt);
+        bool                                                       removeServiceTxt(const hMDNSService p_hService,
+                                                                                    const char*        p_pcKey);
+        bool                                                       removeServiceTxt(const char* p_pcinstanceName,
+                                                                                    const char* p_pcServiceName,
+                                                                                    const char* p_pcProtocol,
+                                                                                    const char* p_pcKey);
         // for compatibility...
-        bool addServiceTxt(const char* p_pcService,
-            const char* p_pcProtocol,
-            const char* p_pcKey,
-            const char* p_pcValue);
-        bool addServiceTxt(const String& p_strService,
-            const String& p_strProtocol,
-            const String& p_strKey,
-            const String& p_strValue);
+        bool                                                       addServiceTxt(const char* p_pcService,
+                                                                                 const char* p_pcProtocol,
+                                                                                 const char* p_pcKey,
+                                                                                 const char* p_pcValue);
+        bool                                                       addServiceTxt(const String& p_strService,
+                                                                                 const String& p_strProtocol,
+                                                                                 const String& p_strKey,
+                                                                                 const String& p_strValue);
 
         /**
         MDNSDynamicServiceTxtCallbackFn
@@ -298,71 +298,71 @@ namespace MDNSImplementation
 
         // Set a global callback for dynamic MDNS TXT items. The callback function is called
         // every time, a TXT item is needed for one of the installed services.
-        bool setDynamicServiceTxtCallback(MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
+        bool                                                       setDynamicServiceTxtCallback(MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
         // Set a service specific callback for dynamic MDNS TXT items. The callback function
         // is called every time, a TXT item is needed for the given service.
-        bool setDynamicServiceTxtCallback(const hMDNSService p_hService,
-            MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
+        bool                                                       setDynamicServiceTxtCallback(const hMDNSService                p_hService,
+                                                                                                MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
 
         // Add a (dynamic) MDNS TXT item ('key' = 'value') to the service
         // Dynamic TXT items are removed right after one-time use. So they need to be added
         // every time the value s needed (via callback).
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-            const char* p_pcKey,
-            const char* p_pcValue);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-            const char* p_pcKey,
-            uint32_t p_u32Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-            const char* p_pcKey,
-            uint16_t p_u16Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-            const char* p_pcKey,
-            uint8_t p_u8Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-            const char* p_pcKey,
-            int32_t p_i32Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-            const char* p_pcKey,
-            int16_t p_i16Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-            const char* p_pcKey,
-            int8_t p_i8Value);
+        hMDNSTxt                                                   addDynamicServiceTxt(hMDNSService p_hService,
+                                                                                        const char*  p_pcKey,
+                                                                                        const char*  p_pcValue);
+        hMDNSTxt                                                   addDynamicServiceTxt(hMDNSService p_hService,
+                                                                                        const char*  p_pcKey,
+                                                                                        uint32_t     p_u32Value);
+        hMDNSTxt                                                   addDynamicServiceTxt(hMDNSService p_hService,
+                                                                                        const char*  p_pcKey,
+                                                                                        uint16_t     p_u16Value);
+        hMDNSTxt                                                   addDynamicServiceTxt(hMDNSService p_hService,
+                                                                                        const char*  p_pcKey,
+                                                                                        uint8_t      p_u8Value);
+        hMDNSTxt                                                   addDynamicServiceTxt(hMDNSService p_hService,
+                                                                                        const char*  p_pcKey,
+                                                                                        int32_t      p_i32Value);
+        hMDNSTxt                                                   addDynamicServiceTxt(hMDNSService p_hService,
+                                                                                        const char*  p_pcKey,
+                                                                                        int16_t      p_i16Value);
+        hMDNSTxt                                                   addDynamicServiceTxt(hMDNSService p_hService,
+                                                                                        const char*  p_pcKey,
+                                                                                        int8_t       p_i8Value);
 
         // Perform a (static) service query. The function returns after p_u16Timeout milliseconds
         // The answers (the number of received answers is returned) can be retrieved by calling
         // - answerHostname (or hostname)
         // - answerIP (or IP)
         // - answerPort (or port)
-        uint32_t queryService(const char* p_pcService,
-            const char* p_pcProtocol,
-            const uint16_t p_u16Timeout = MDNS_QUERYSERVICES_WAIT_TIME);
-        bool removeQuery(void);
+        uint32_t                                                   queryService(const char*    p_pcService,
+                                                                                const char*    p_pcProtocol,
+                                                                                const uint16_t p_u16Timeout = MDNS_QUERYSERVICES_WAIT_TIME);
+        bool                                                       removeQuery(void);
         // for compatibility...
-        uint32_t queryService(const String& p_strService,
-            const String& p_strProtocol);
+        uint32_t                                                   queryService(const String& p_strService,
+                                                                                const String& p_strProtocol);
 
-        const char* answerHostname(const uint32_t p_u32AnswerIndex);
-        IPAddress answerIP(const uint32_t p_u32AnswerIndex);
-        uint16_t answerPort(const uint32_t p_u32AnswerIndex);
+        const char*                                                answerHostname(const uint32_t p_u32AnswerIndex);
+        IPAddress                                                  answerIP(const uint32_t p_u32AnswerIndex);
+        uint16_t                                                   answerPort(const uint32_t p_u32AnswerIndex);
         // for compatibility...
-        String hostname(const uint32_t p_u32AnswerIndex);
-        IPAddress IP(const uint32_t p_u32AnswerIndex);
-        uint16_t port(const uint32_t p_u32AnswerIndex);
+        String                                                     hostname(const uint32_t p_u32AnswerIndex);
+        IPAddress                                                  IP(const uint32_t p_u32AnswerIndex);
+        uint16_t                                                   port(const uint32_t p_u32AnswerIndex);
 
         /**
         hMDNSServiceQuery (opaque handle to access dynamic service queries)
     */
-        typedef const void* hMDNSServiceQuery;
+        typedef const void*                                        hMDNSServiceQuery;
 
         /**
         enuServiceQueryAnswerType
     */
         typedef enum _enuServiceQueryAnswerType
         {
-            ServiceQueryAnswerType_ServiceDomain = (1 << 0),      // Service instance name
+            ServiceQueryAnswerType_ServiceDomain     = (1 << 0),  // Service instance name
             ServiceQueryAnswerType_HostDomainAndPort = (1 << 1),  // Host domain and service port
-            ServiceQueryAnswerType_Txts = (1 << 2),               // TXT items
+            ServiceQueryAnswerType_Txts              = (1 << 2),  // TXT items
 #ifdef MDNS_IP4_SUPPORT
             ServiceQueryAnswerType_IP4Address = (1 << 3),  // IP4 address
 #endif
@@ -373,10 +373,10 @@ namespace MDNSImplementation
 
         enum class AnswerType : uint32_t
         {
-            Unknown = 0,
-            ServiceDomain = ServiceQueryAnswerType_ServiceDomain,
+            Unknown           = 0,
+            ServiceDomain     = ServiceQueryAnswerType_ServiceDomain,
             HostDomainAndPort = ServiceQueryAnswerType_HostDomainAndPort,
-            Txt = ServiceQueryAnswerType_Txts,
+            Txt               = ServiceQueryAnswerType_Txts,
 #ifdef MDNS_IP4_SUPPORT
             IP4Address = ServiceQueryAnswerType_IP4Address,
 #endif
@@ -391,10 +391,10 @@ namespace MDNSImplementation
     */
         struct MDNSServiceInfo;  // forward declaration
         typedef std::function<void(const MDNSServiceInfo& mdnsServiceInfo,
-            AnswerType answerType,  // flag for the updated answer item
-            bool p_bSetContent      // true: Answer component set, false: component deleted
-            )>
-            MDNSServiceQueryCallbackFunc;
+                                   AnswerType             answerType,    // flag for the updated answer item
+                                   bool                   p_bSetContent  // true: Answer component set, false: component deleted
+                                   )>
+                                                    MDNSServiceQueryCallbackFunc;
 
         // Install a dynamic service query. For every received answer (part) the given callback
         // function is called. The query will be updated every time, the TTL for an answer
@@ -407,105 +407,105 @@ namespace MDNSImplementation
         // - hasAnswerIP6Address/answerIP6Address
         // - hasAnswerPort/answerPort
         // - hasAnswerTxts/answerTxts
-        hMDNSServiceQuery installServiceQuery(const char* p_pcService,
-            const char* p_pcProtocol,
-            MDNSServiceQueryCallbackFunc p_fnCallback);
+        hMDNSServiceQuery                           installServiceQuery(const char*                  p_pcService,
+                                                                        const char*                  p_pcProtocol,
+                                                                        MDNSServiceQueryCallbackFunc p_fnCallback);
         // Remove a dynamic service query
-        bool removeServiceQuery(hMDNSServiceQuery p_hServiceQuery);
+        bool                                        removeServiceQuery(hMDNSServiceQuery p_hServiceQuery);
 
-        uint32_t answerCount(const hMDNSServiceQuery p_hServiceQuery);
+        uint32_t                                    answerCount(const hMDNSServiceQuery p_hServiceQuery);
         std::vector<MDNSResponder::MDNSServiceInfo> answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery);
 
-        const char* answerServiceDomain(const hMDNSServiceQuery p_hServiceQuery,
-            const uint32_t p_u32AnswerIndex);
-        bool hasAnswerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
-            const uint32_t p_u32AnswerIndex);
-        const char* answerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
-            const uint32_t p_u32AnswerIndex);
+        const char*                                 answerServiceDomain(const hMDNSServiceQuery p_hServiceQuery,
+                                                                        const uint32_t          p_u32AnswerIndex);
+        bool                                        hasAnswerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
+                                                                        const uint32_t          p_u32AnswerIndex);
+        const char*                                 answerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
+                                                                     const uint32_t          p_u32AnswerIndex);
 #ifdef MDNS_IP4_SUPPORT
-        bool hasAnswerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
-            const uint32_t p_u32AnswerIndex);
-        uint32_t answerIP4AddressCount(const hMDNSServiceQuery p_hServiceQuery,
-            const uint32_t p_u32AnswerIndex);
+        bool      hasAnswerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
+                                      const uint32_t          p_u32AnswerIndex);
+        uint32_t  answerIP4AddressCount(const hMDNSServiceQuery p_hServiceQuery,
+                                        const uint32_t          p_u32AnswerIndex);
         IPAddress answerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
-            const uint32_t p_u32AnswerIndex,
-            const uint32_t p_u32AddressIndex);
+                                   const uint32_t          p_u32AnswerIndex,
+                                   const uint32_t          p_u32AddressIndex);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        bool hasAnswerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
-            const uint32_t p_u32AnswerIndex);
-        uint32_t answerIP6AddressCount(const hMDNSServiceQuery p_hServiceQuery,
-            const uint32_t p_u32AnswerIndex);
+        bool      hasAnswerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
+                                      const uint32_t          p_u32AnswerIndex);
+        uint32_t  answerIP6AddressCount(const hMDNSServiceQuery p_hServiceQuery,
+                                        const uint32_t          p_u32AnswerIndex);
         IPAddress answerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
-            const uint32_t p_u32AnswerIndex,
-            const uint32_t p_u32AddressIndex);
+                                   const uint32_t          p_u32AnswerIndex,
+                                   const uint32_t          p_u32AddressIndex);
 #endif
-        bool hasAnswerPort(const hMDNSServiceQuery p_hServiceQuery,
-            const uint32_t p_u32AnswerIndex);
-        uint16_t answerPort(const hMDNSServiceQuery p_hServiceQuery,
-            const uint32_t p_u32AnswerIndex);
-        bool hasAnswerTxts(const hMDNSServiceQuery p_hServiceQuery,
-            const uint32_t p_u32AnswerIndex);
+        bool        hasAnswerPort(const hMDNSServiceQuery p_hServiceQuery,
+                                  const uint32_t          p_u32AnswerIndex);
+        uint16_t    answerPort(const hMDNSServiceQuery p_hServiceQuery,
+                               const uint32_t          p_u32AnswerIndex);
+        bool        hasAnswerTxts(const hMDNSServiceQuery p_hServiceQuery,
+                                  const uint32_t          p_u32AnswerIndex);
         // Get the TXT items as a ';'-separated string
         const char* answerTxts(const hMDNSServiceQuery p_hServiceQuery,
-            const uint32_t p_u32AnswerIndex);
+                               const uint32_t          p_u32AnswerIndex);
 
         /**
         MDNSProbeResultCallbackFn
         Callback function for (host and service domain) probe results
     */
         typedef std::function<void(const char* p_pcDomainName,
-            bool p_bProbeResult)>
+                                   bool        p_bProbeResult)>
             MDNSHostProbeFn;
 
         typedef std::function<void(MDNSResponder& resp,
-            const char* p_pcDomainName,
-            bool p_bProbeResult)>
+                                   const char*    p_pcDomainName,
+                                   bool           p_bProbeResult)>
             MDNSHostProbeFn1;
 
-        typedef std::function<void(const char* p_pcServiceName,
-            const hMDNSService p_hMDNSService,
-            bool p_bProbeResult)>
+        typedef std::function<void(const char*        p_pcServiceName,
+                                   const hMDNSService p_hMDNSService,
+                                   bool               p_bProbeResult)>
             MDNSServiceProbeFn;
 
-        typedef std::function<void(MDNSResponder& resp,
-            const char* p_pcServiceName,
-            const hMDNSService p_hMDNSService,
-            bool p_bProbeResult)>
-            MDNSServiceProbeFn1;
+        typedef std::function<void(MDNSResponder&     resp,
+                                   const char*        p_pcServiceName,
+                                   const hMDNSService p_hMDNSService,
+                                   bool               p_bProbeResult)>
+                     MDNSServiceProbeFn1;
 
         // Set a global callback function for host and service probe results
         // The callback function is called, when the probing for the host domain
         // (or a service domain, which hasn't got a service specific callback)
         // Succeeds or fails.
         // In case of failure, the failed domain name should be changed.
-        bool setHostProbeResultCallback(MDNSHostProbeFn p_fnCallback);
-        bool setHostProbeResultCallback(MDNSHostProbeFn1 p_fnCallback);
+        bool         setHostProbeResultCallback(MDNSHostProbeFn p_fnCallback);
+        bool         setHostProbeResultCallback(MDNSHostProbeFn1 p_fnCallback);
 
         // Set a service specific probe result callback
-        bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-            MDNSServiceProbeFn p_fnCallback);
-        bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-            MDNSServiceProbeFn1 p_fnCallback);
+        bool         setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+                                                   MDNSServiceProbeFn                p_fnCallback);
+        bool         setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+                                                   MDNSServiceProbeFn1               p_fnCallback);
 
         // Application should call this whenever AP is configured/disabled
-        bool notifyAPChange(void);
+        bool         notifyAPChange(void);
 
         // 'update' should be called in every 'loop' to run the MDNS processing
-        bool update(void);
+        bool         update(void);
 
         // 'announce' can be called every time, the configuration of some service
         // changes. Mainly, this would be changed content of TXT items.
-        bool announce(void);
+        bool         announce(void);
 
         // Enable OTA update
         hMDNSService enableArduino(uint16_t p_u16Port,
-            bool p_bAuthUpload = false);
+                                   bool     p_bAuthUpload = false);
 
         // Domain name helper
-        static bool indexDomain(char*& p_rpcDomain,
-            const char* p_pcDivider = "-",
-            const char* p_pcDefaultDomain = 0);
+        static bool  indexDomain(char*&      p_rpcDomain,
+                                 const char* p_pcDivider       = "-",
+                                 const char* p_pcDefaultDomain = 0);
 
         /** STRUCTS **/
 
@@ -515,10 +515,10 @@ namespace MDNSImplementation
     */
         struct MDNSServiceInfo
         {
-            MDNSServiceInfo(MDNSResponder& p_pM, MDNSResponder::hMDNSServiceQuery p_hS, uint32_t p_u32A)
-                : p_pMDNSResponder(p_pM)
-                , p_hServiceQuery(p_hS)
-                , p_u32AnswerIndex(p_u32A) {};
+            MDNSServiceInfo(MDNSResponder& p_pM, MDNSResponder::hMDNSServiceQuery p_hS, uint32_t p_u32A) :
+                p_pMDNSResponder(p_pM),
+                p_hServiceQuery(p_hS),
+                p_u32AnswerIndex(p_u32A) {};
             struct CompareKey
             {
                 bool operator()(char const* a, char const* b) const
@@ -529,10 +529,10 @@ namespace MDNSImplementation
             using KeyValueMap = std::map<const char*, const char*, CompareKey>;
 
         protected:
-            MDNSResponder& p_pMDNSResponder;
+            MDNSResponder&                   p_pMDNSResponder;
             MDNSResponder::hMDNSServiceQuery p_hServiceQuery;
-            uint32_t p_u32AnswerIndex;
-            KeyValueMap keyValueMap;
+            uint32_t                         p_u32AnswerIndex;
+            KeyValueMap                      keyValueMap;
 
         public:
             const char* serviceDomain()
@@ -614,38 +614,38 @@ namespace MDNSImplementation
         struct stcMDNSServiceTxt
         {
             stcMDNSServiceTxt* m_pNext;
-            char* m_pcKey;
-            char* m_pcValue;
-            bool m_bTemp;
+            char*              m_pcKey;
+            char*              m_pcValue;
+            bool               m_bTemp;
 
-            stcMDNSServiceTxt(const char* p_pcKey = 0,
-                const char* p_pcValue = 0,
-                bool p_bTemp = false);
+            stcMDNSServiceTxt(const char* p_pcKey   = 0,
+                              const char* p_pcValue = 0,
+                              bool        p_bTemp   = false);
             stcMDNSServiceTxt(const stcMDNSServiceTxt& p_Other);
             ~stcMDNSServiceTxt(void);
 
             stcMDNSServiceTxt& operator=(const stcMDNSServiceTxt& p_Other);
-            bool clear(void);
+            bool               clear(void);
 
-            char* allocKey(size_t p_stLength);
-            bool setKey(const char* p_pcKey,
-                size_t p_stLength);
-            bool setKey(const char* p_pcKey);
-            bool releaseKey(void);
+            char*              allocKey(size_t p_stLength);
+            bool               setKey(const char* p_pcKey,
+                                      size_t      p_stLength);
+            bool               setKey(const char* p_pcKey);
+            bool               releaseKey(void);
 
-            char* allocValue(size_t p_stLength);
-            bool setValue(const char* p_pcValue,
-                size_t p_stLength);
-            bool setValue(const char* p_pcValue);
-            bool releaseValue(void);
+            char*              allocValue(size_t p_stLength);
+            bool               setValue(const char* p_pcValue,
+                                        size_t      p_stLength);
+            bool               setValue(const char* p_pcValue);
+            bool               releaseValue(void);
 
-            bool set(const char* p_pcKey,
-                const char* p_pcValue,
-                bool p_bTemp = false);
+            bool               set(const char* p_pcKey,
+                                   const char* p_pcValue,
+                                   bool        p_bTemp = false);
 
-            bool update(const char* p_pcValue);
+            bool               update(const char* p_pcValue);
 
-            size_t length(void) const;
+            size_t             length(void) const;
         };
 
         /**
@@ -659,30 +659,30 @@ namespace MDNSImplementation
             stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other);
             ~stcMDNSServiceTxts(void);
 
-            stcMDNSServiceTxts& operator=(const stcMDNSServiceTxts& p_Other);
+            stcMDNSServiceTxts&      operator=(const stcMDNSServiceTxts& p_Other);
 
-            bool clear(void);
+            bool                     clear(void);
 
-            bool add(stcMDNSServiceTxt* p_pTxt);
-            bool remove(stcMDNSServiceTxt* p_pTxt);
+            bool                     add(stcMDNSServiceTxt* p_pTxt);
+            bool                     remove(stcMDNSServiceTxt* p_pTxt);
 
-            bool removeTempTxts(void);
+            bool                     removeTempTxts(void);
 
-            stcMDNSServiceTxt* find(const char* p_pcKey);
+            stcMDNSServiceTxt*       find(const char* p_pcKey);
             const stcMDNSServiceTxt* find(const char* p_pcKey) const;
-            stcMDNSServiceTxt* find(const stcMDNSServiceTxt* p_pTxt);
+            stcMDNSServiceTxt*       find(const stcMDNSServiceTxt* p_pTxt);
 
-            uint16_t length(void) const;
+            uint16_t                 length(void) const;
 
-            size_t c_strLength(void) const;
-            bool c_str(char* p_pcBuffer);
+            size_t                   c_strLength(void) const;
+            bool                     c_str(char* p_pcBuffer);
 
-            size_t bufferLength(void) const;
-            bool buffer(char* p_pcBuffer);
+            size_t                   bufferLength(void) const;
+            bool                     buffer(char* p_pcBuffer);
 
-            bool compare(const stcMDNSServiceTxts& p_Other) const;
-            bool operator==(const stcMDNSServiceTxts& p_Other) const;
-            bool operator!=(const stcMDNSServiceTxts& p_Other) const;
+            bool                     compare(const stcMDNSServiceTxts& p_Other) const;
+            bool                     operator==(const stcMDNSServiceTxts& p_Other) const;
+            bool                     operator!=(const stcMDNSServiceTxts& p_Other) const;
         };
 
         /**
@@ -691,15 +691,15 @@ namespace MDNSImplementation
         typedef enum _enuContentFlags
         {
             // Host
-            ContentFlag_A = 0x01,
-            ContentFlag_PTR_IP4 = 0x02,
-            ContentFlag_PTR_IP6 = 0x04,
-            ContentFlag_AAAA = 0x08,
+            ContentFlag_A        = 0x01,
+            ContentFlag_PTR_IP4  = 0x02,
+            ContentFlag_PTR_IP6  = 0x04,
+            ContentFlag_AAAA     = 0x08,
             // Service
             ContentFlag_PTR_TYPE = 0x10,
             ContentFlag_PTR_NAME = 0x20,
-            ContentFlag_TXT = 0x40,
-            ContentFlag_SRV = 0x80,
+            ContentFlag_TXT      = 0x40,
+            ContentFlag_SRV      = 0x80,
         } enuContentFlags;
 
         /**
@@ -707,32 +707,32 @@ namespace MDNSImplementation
     */
         struct stcMDNS_MsgHeader
         {
-            uint16_t m_u16ID;              // Identifier
-            bool m_1bQR : 1;               // Query/Response flag
+            uint16_t      m_u16ID;         // Identifier
+            bool          m_1bQR     : 1;  // Query/Response flag
             unsigned char m_4bOpcode : 4;  // Operation code
-            bool m_1bAA : 1;               // Authoritative Answer flag
-            bool m_1bTC : 1;               // Truncation flag
-            bool m_1bRD : 1;               // Recursion desired
-            bool m_1bRA : 1;               // Recursion available
-            unsigned char m_3bZ : 3;       // Zero
-            unsigned char m_4bRCode : 4;   // Response code
-            uint16_t m_u16QDCount;         // Question count
-            uint16_t m_u16ANCount;         // Answer count
-            uint16_t m_u16NSCount;         // Authority Record count
-            uint16_t m_u16ARCount;         // Additional Record count
-
-            stcMDNS_MsgHeader(uint16_t p_u16ID = 0,
-                bool p_bQR = false,
-                unsigned char p_ucOpcode = 0,
-                bool p_bAA = false,
-                bool p_bTC = false,
-                bool p_bRD = false,
-                bool p_bRA = false,
-                unsigned char p_ucRCode = 0,
-                uint16_t p_u16QDCount = 0,
-                uint16_t p_u16ANCount = 0,
-                uint16_t p_u16NSCount = 0,
-                uint16_t p_u16ARCount = 0);
+            bool          m_1bAA     : 1;  // Authoritative Answer flag
+            bool          m_1bTC     : 1;  // Truncation flag
+            bool          m_1bRD     : 1;  // Recursion desired
+            bool          m_1bRA     : 1;  // Recursion available
+            unsigned char m_3bZ      : 3;  // Zero
+            unsigned char m_4bRCode  : 4;  // Response code
+            uint16_t      m_u16QDCount;    // Question count
+            uint16_t      m_u16ANCount;    // Answer count
+            uint16_t      m_u16NSCount;    // Authority Record count
+            uint16_t      m_u16ARCount;    // Additional Record count
+
+            stcMDNS_MsgHeader(uint16_t      p_u16ID      = 0,
+                              bool          p_bQR        = false,
+                              unsigned char p_ucOpcode   = 0,
+                              bool          p_bAA        = false,
+                              bool          p_bTC        = false,
+                              bool          p_bRD        = false,
+                              bool          p_bRA        = false,
+                              unsigned char p_ucRCode    = 0,
+                              uint16_t      p_u16QDCount = 0,
+                              uint16_t      p_u16ANCount = 0,
+                              uint16_t      p_u16NSCount = 0,
+                              uint16_t      p_u16ARCount = 0);
         };
 
         /**
@@ -740,26 +740,26 @@ namespace MDNSImplementation
     */
         struct stcMDNS_RRDomain
         {
-            char m_acName[MDNS_DOMAIN_MAXLENGTH];  // Encoded domain name
-            uint16_t m_u16NameLength;              // Length (incl. '\0')
+            char     m_acName[MDNS_DOMAIN_MAXLENGTH];  // Encoded domain name
+            uint16_t m_u16NameLength;                  // Length (incl. '\0')
 
             stcMDNS_RRDomain(void);
             stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other);
 
             stcMDNS_RRDomain& operator=(const stcMDNS_RRDomain& p_Other);
 
-            bool clear(void);
+            bool              clear(void);
 
-            bool addLabel(const char* p_pcLabel,
-                bool p_bPrependUnderline = false);
+            bool              addLabel(const char* p_pcLabel,
+                                       bool        p_bPrependUnderline = false);
 
-            bool compare(const stcMDNS_RRDomain& p_Other) const;
-            bool operator==(const stcMDNS_RRDomain& p_Other) const;
-            bool operator!=(const stcMDNS_RRDomain& p_Other) const;
-            bool operator>(const stcMDNS_RRDomain& p_Other) const;
+            bool              compare(const stcMDNS_RRDomain& p_Other) const;
+            bool              operator==(const stcMDNS_RRDomain& p_Other) const;
+            bool              operator!=(const stcMDNS_RRDomain& p_Other) const;
+            bool              operator>(const stcMDNS_RRDomain& p_Other) const;
 
-            size_t c_strLength(void) const;
-            bool c_str(char* p_pcBuffer);
+            size_t            c_strLength(void) const;
+            bool              c_str(char* p_pcBuffer);
         };
 
         /**
@@ -770,8 +770,8 @@ namespace MDNSImplementation
             uint16_t m_u16Type;   // Type
             uint16_t m_u16Class;  // Class, nearly always 'IN'
 
-            stcMDNS_RRAttributes(uint16_t p_u16Type = 0,
-                uint16_t p_u16Class = 1 /*DNS_RRCLASS_IN Internet*/);
+            stcMDNS_RRAttributes(uint16_t p_u16Type  = 0,
+                                 uint16_t p_u16Class = 1 /*DNS_RRCLASS_IN Internet*/);
             stcMDNS_RRAttributes(const stcMDNS_RRAttributes& p_Other);
 
             stcMDNS_RRAttributes& operator=(const stcMDNS_RRAttributes& p_Other);
@@ -782,7 +782,7 @@ namespace MDNSImplementation
     */
         struct stcMDNS_RRHeader
         {
-            stcMDNS_RRDomain m_Domain;
+            stcMDNS_RRDomain     m_Domain;
             stcMDNS_RRAttributes m_Attributes;
 
             stcMDNS_RRHeader(void);
@@ -790,7 +790,7 @@ namespace MDNSImplementation
 
             stcMDNS_RRHeader& operator=(const stcMDNS_RRHeader& p_Other);
 
-            bool clear(void);
+            bool              clear(void);
         };
 
         /**
@@ -799,8 +799,8 @@ namespace MDNSImplementation
         struct stcMDNS_RRQuestion
         {
             stcMDNS_RRQuestion* m_pNext;
-            stcMDNS_RRHeader m_Header;
-            bool m_bUnicast;  // Unicast reply requested
+            stcMDNS_RRHeader    m_Header;
+            bool                m_bUnicast;  // Unicast reply requested
 
             stcMDNS_RRQuestion(void);
         };
@@ -823,22 +823,22 @@ namespace MDNSImplementation
     */
         struct stcMDNS_RRAnswer
         {
-            stcMDNS_RRAnswer* m_pNext;
+            stcMDNS_RRAnswer*   m_pNext;
             const enuAnswerType m_AnswerType;
-            stcMDNS_RRHeader m_Header;
-            bool m_bCacheFlush;  // Cache flush command bit
-            uint32_t m_u32TTL;   // Validity time in seconds
+            stcMDNS_RRHeader    m_Header;
+            bool                m_bCacheFlush;  // Cache flush command bit
+            uint32_t            m_u32TTL;       // Validity time in seconds
 
             virtual ~stcMDNS_RRAnswer(void);
 
             enuAnswerType answerType(void) const;
 
-            bool clear(void);
+            bool          clear(void);
 
         protected:
-            stcMDNS_RRAnswer(enuAnswerType p_AnswerType,
-                const stcMDNS_RRHeader& p_Header,
-                uint32_t p_u32TTL);
+            stcMDNS_RRAnswer(enuAnswerType           p_AnswerType,
+                             const stcMDNS_RRHeader& p_Header,
+                             uint32_t                p_u32TTL);
         };
 
 #ifdef MDNS_IP4_SUPPORT
@@ -850,7 +850,7 @@ namespace MDNSImplementation
             IPAddress m_IPAddress;
 
             stcMDNS_RRAnswerA(const stcMDNS_RRHeader& p_Header,
-                uint32_t p_u32TTL);
+                              uint32_t                p_u32TTL);
             ~stcMDNS_RRAnswerA(void);
 
             bool clear(void);
@@ -865,7 +865,7 @@ namespace MDNSImplementation
             stcMDNS_RRDomain m_PTRDomain;
 
             stcMDNS_RRAnswerPTR(const stcMDNS_RRHeader& p_Header,
-                uint32_t p_u32TTL);
+                                uint32_t                p_u32TTL);
             ~stcMDNS_RRAnswerPTR(void);
 
             bool clear(void);
@@ -879,7 +879,7 @@ namespace MDNSImplementation
             stcMDNSServiceTxts m_Txts;
 
             stcMDNS_RRAnswerTXT(const stcMDNS_RRHeader& p_Header,
-                uint32_t p_u32TTL);
+                                uint32_t                p_u32TTL);
             ~stcMDNS_RRAnswerTXT(void);
 
             bool clear(void);
@@ -894,7 +894,7 @@ namespace MDNSImplementation
             //TODO: IP6Address          m_IPAddress;
 
             stcMDNS_RRAnswerAAAA(const stcMDNS_RRHeader& p_Header,
-                uint32_t p_u32TTL);
+                                 uint32_t                p_u32TTL);
             ~stcMDNS_RRAnswerAAAA(void);
 
             bool clear(void);
@@ -906,13 +906,13 @@ namespace MDNSImplementation
     */
         struct stcMDNS_RRAnswerSRV : public stcMDNS_RRAnswer
         {
-            uint16_t m_u16Priority;
-            uint16_t m_u16Weight;
-            uint16_t m_u16Port;
+            uint16_t         m_u16Priority;
+            uint16_t         m_u16Weight;
+            uint16_t         m_u16Port;
             stcMDNS_RRDomain m_SRVDomain;
 
             stcMDNS_RRAnswerSRV(const stcMDNS_RRHeader& p_Header,
-                uint32_t p_u32TTL);
+                                uint32_t                p_u32TTL);
             ~stcMDNS_RRAnswerSRV(void);
 
             bool clear(void);
@@ -927,7 +927,7 @@ namespace MDNSImplementation
             uint8_t* m_pu8RDData;    // Offset of start of variable answer in packet
 
             stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
-                uint32_t p_u32TTL);
+                                    uint32_t                p_u32TTL);
             ~stcMDNS_RRAnswerGeneric(void);
 
             bool clear(void);
@@ -949,14 +949,14 @@ namespace MDNSImplementation
     */
         struct stcProbeInformation
         {
-            enuProbingStatus m_ProbingStatus;
-            uint8_t m_u8SentCount;                        // Used for probes and announcements
-            esp8266::polledTimeout::oneShotMs m_Timeout;  // Used for probes and announcements
+            enuProbingStatus                  m_ProbingStatus;
+            uint8_t                           m_u8SentCount;  // Used for probes and announcements
+            esp8266::polledTimeout::oneShotMs m_Timeout;      // Used for probes and announcements
             //clsMDNSTimeFlag                   m_TimeFlag;     // Used for probes and announcements
-            bool m_bConflict;
-            bool m_bTiebreakNeeded;
-            MDNSHostProbeFn m_fnHostProbeResultCallback;
-            MDNSServiceProbeFn m_fnServiceProbeResultCallback;
+            bool                              m_bConflict;
+            bool                              m_bTiebreakNeeded;
+            MDNSHostProbeFn                   m_fnHostProbeResultCallback;
+            MDNSServiceProbeFn                m_fnServiceProbeResultCallback;
 
             stcProbeInformation(void);
 
@@ -968,20 +968,20 @@ namespace MDNSImplementation
     */
         struct stcMDNSService
         {
-            stcMDNSService* m_pNext;
-            char* m_pcName;
-            bool m_bAutoName;  // Name was set automatically to hostname (if no name was supplied)
-            char* m_pcService;
-            char* m_pcProtocol;
-            uint16_t m_u16Port;
-            uint8_t m_u8ReplyMask;
-            stcMDNSServiceTxts m_Txts;
+            stcMDNSService*                   m_pNext;
+            char*                             m_pcName;
+            bool                              m_bAutoName;  // Name was set automatically to hostname (if no name was supplied)
+            char*                             m_pcService;
+            char*                             m_pcProtocol;
+            uint16_t                          m_u16Port;
+            uint8_t                           m_u8ReplyMask;
+            stcMDNSServiceTxts                m_Txts;
             MDNSDynamicServiceTxtCallbackFunc m_fnTxtCallback;
-            stcProbeInformation m_ProbeInformation;
+            stcProbeInformation               m_ProbeInformation;
 
-            stcMDNSService(const char* p_pcName = 0,
-                const char* p_pcService = 0,
-                const char* p_pcProtocol = 0);
+            stcMDNSService(const char* p_pcName     = 0,
+                           const char* p_pcService  = 0,
+                           const char* p_pcProtocol = 0);
             ~stcMDNSService(void);
 
             bool setName(const char* p_pcName);
@@ -1012,29 +1012,29 @@ namespace MDNSImplementation
                     /**
                     timeoutLevel_t
                 */
-                    typedef uint8_t timeoutLevel_t;
+                    typedef uint8_t                   timeoutLevel_t;
                     /**
                     TIMEOUTLEVELs
                 */
-                    const timeoutLevel_t TIMEOUTLEVEL_UNSET = 0;
-                    const timeoutLevel_t TIMEOUTLEVEL_BASE = 80;
-                    const timeoutLevel_t TIMEOUTLEVEL_INTERVAL = 5;
-                    const timeoutLevel_t TIMEOUTLEVEL_FINAL = 100;
+                    const timeoutLevel_t              TIMEOUTLEVEL_UNSET    = 0;
+                    const timeoutLevel_t              TIMEOUTLEVEL_BASE     = 80;
+                    const timeoutLevel_t              TIMEOUTLEVEL_INTERVAL = 5;
+                    const timeoutLevel_t              TIMEOUTLEVEL_FINAL    = 100;
 
-                    uint32_t m_u32TTL;
+                    uint32_t                          m_u32TTL;
                     esp8266::polledTimeout::oneShotMs m_TTLTimeout;
-                    timeoutLevel_t m_timeoutLevel;
+                    timeoutLevel_t                    m_timeoutLevel;
 
                     using timeoutBase = decltype(m_TTLTimeout);
 
                     stcTTL(void);
-                    bool set(uint32_t p_u32TTL);
+                    bool                  set(uint32_t p_u32TTL);
 
-                    bool flagged(void);
-                    bool restart(void);
+                    bool                  flagged(void);
+                    bool                  restart(void);
 
-                    bool prepareDeletion(void);
-                    bool finalTimeoutLevel(void) const;
+                    bool                  prepareDeletion(void);
+                    bool                  finalTimeoutLevel(void) const;
 
                     timeoutBase::timeType timeout(void) const;
                 };
@@ -1045,11 +1045,11 @@ namespace MDNSImplementation
                 struct stcIP4Address
                 {
                     stcIP4Address* m_pNext;
-                    IPAddress m_IPAddress;
-                    stcTTL m_TTL;
+                    IPAddress      m_IPAddress;
+                    stcTTL         m_TTL;
 
                     stcIP4Address(IPAddress p_IPAddress,
-                        uint32_t p_u32TTL = 0);
+                                  uint32_t  p_u32TTL = 0);
                 };
 #endif
 #ifdef MDNS_IP6_SUPPORT
@@ -1059,27 +1059,27 @@ namespace MDNSImplementation
                 struct stcIP6Address
                 {
                     stcIP6Address* m_pNext;
-                    IP6Address m_IPAddress;
-                    stcTTL m_TTL;
+                    IP6Address     m_IPAddress;
+                    stcTTL         m_TTL;
 
                     stcIP6Address(IPAddress p_IPAddress,
-                        uint32_t p_u32TTL = 0);
+                                  uint32_t  p_u32TTL = 0);
                 };
 #endif
 
-                stcAnswer* m_pNext;
+                stcAnswer*         m_pNext;
                 // The service domain is the first 'answer' (from PTR answer, using service and protocol) to be set
                 // Defines the key for additional answer, like host domain, etc.
-                stcMDNS_RRDomain m_ServiceDomain;  // 1. level answer (PTR), eg. MyESP._http._tcp.local
-                char* m_pcServiceDomain;
-                stcTTL m_TTLServiceDomain;
-                stcMDNS_RRDomain m_HostDomain;  // 2. level answer (SRV, using service domain), eg. esp8266.local
-                char* m_pcHostDomain;
-                uint16_t m_u16Port;  // 2. level answer (SRV, using service domain), eg. 5000
-                stcTTL m_TTLHostDomainAndPort;
+                stcMDNS_RRDomain   m_ServiceDomain;  // 1. level answer (PTR), eg. MyESP._http._tcp.local
+                char*              m_pcServiceDomain;
+                stcTTL             m_TTLServiceDomain;
+                stcMDNS_RRDomain   m_HostDomain;  // 2. level answer (SRV, using service domain), eg. esp8266.local
+                char*              m_pcHostDomain;
+                uint16_t           m_u16Port;  // 2. level answer (SRV, using service domain), eg. 5000
+                stcTTL             m_TTLHostDomainAndPort;
                 stcMDNSServiceTxts m_Txts;  // 2. level answer (TXT, using service domain), eg. c#=1
-                char* m_pcTxts;
-                stcTTL m_TTLTxts;
+                char*              m_pcTxts;
+                stcTTL             m_TTLTxts;
 #ifdef MDNS_IP4_SUPPORT
                 stcIP4Address* m_pIP4Addresses;  // 3. level answer (A, using host domain), eg. 123.456.789.012
 #endif
@@ -1091,63 +1091,63 @@ namespace MDNSImplementation
                 stcAnswer(void);
                 ~stcAnswer(void);
 
-                bool clear(void);
+                bool  clear(void);
 
                 char* allocServiceDomain(size_t p_stLength);
-                bool releaseServiceDomain(void);
+                bool  releaseServiceDomain(void);
 
                 char* allocHostDomain(size_t p_stLength);
-                bool releaseHostDomain(void);
+                bool  releaseHostDomain(void);
 
                 char* allocTxts(size_t p_stLength);
-                bool releaseTxts(void);
+                bool  releaseTxts(void);
 
 #ifdef MDNS_IP4_SUPPORT
-                bool releaseIP4Addresses(void);
-                bool addIP4Address(stcIP4Address* p_pIP4Address);
-                bool removeIP4Address(stcIP4Address* p_pIP4Address);
+                bool                 releaseIP4Addresses(void);
+                bool                 addIP4Address(stcIP4Address* p_pIP4Address);
+                bool                 removeIP4Address(stcIP4Address* p_pIP4Address);
                 const stcIP4Address* findIP4Address(const IPAddress& p_IPAddress) const;
-                stcIP4Address* findIP4Address(const IPAddress& p_IPAddress);
-                uint32_t IP4AddressCount(void) const;
+                stcIP4Address*       findIP4Address(const IPAddress& p_IPAddress);
+                uint32_t             IP4AddressCount(void) const;
                 const stcIP4Address* IP4AddressAtIndex(uint32_t p_u32Index) const;
-                stcIP4Address* IP4AddressAtIndex(uint32_t p_u32Index);
+                stcIP4Address*       IP4AddressAtIndex(uint32_t p_u32Index);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                bool releaseIP6Addresses(void);
-                bool addIP6Address(stcIP6Address* p_pIP6Address);
-                bool removeIP6Address(stcIP6Address* p_pIP6Address);
+                bool                 releaseIP6Addresses(void);
+                bool                 addIP6Address(stcIP6Address* p_pIP6Address);
+                bool                 removeIP6Address(stcIP6Address* p_pIP6Address);
                 const stcIP6Address* findIP6Address(const IPAddress& p_IPAddress) const;
-                stcIP6Address* findIP6Address(const IPAddress& p_IPAddress);
-                uint32_t IP6AddressCount(void) const;
+                stcIP6Address*       findIP6Address(const IPAddress& p_IPAddress);
+                uint32_t             IP6AddressCount(void) const;
                 const stcIP6Address* IP6AddressAtIndex(uint32_t p_u32Index) const;
-                stcIP6Address* IP6AddressAtIndex(uint32_t p_u32Index);
+                stcIP6Address*       IP6AddressAtIndex(uint32_t p_u32Index);
 #endif
             };
 
-            stcMDNSServiceQuery* m_pNext;
-            stcMDNS_RRDomain m_ServiceTypeDomain;  // eg. _http._tcp.local
-            MDNSServiceQueryCallbackFunc m_fnCallback;
-            bool m_bLegacyQuery;
-            uint8_t m_u8SentCount;
+            stcMDNSServiceQuery*              m_pNext;
+            stcMDNS_RRDomain                  m_ServiceTypeDomain;  // eg. _http._tcp.local
+            MDNSServiceQueryCallbackFunc      m_fnCallback;
+            bool                              m_bLegacyQuery;
+            uint8_t                           m_u8SentCount;
             esp8266::polledTimeout::oneShotMs m_ResendTimeout;
-            bool m_bAwaitingAnswers;
-            stcAnswer* m_pAnswers;
+            bool                              m_bAwaitingAnswers;
+            stcAnswer*                        m_pAnswers;
 
             stcMDNSServiceQuery(void);
             ~stcMDNSServiceQuery(void);
 
-            bool clear(void);
+            bool             clear(void);
 
-            uint32_t answerCount(void) const;
+            uint32_t         answerCount(void) const;
             const stcAnswer* answerAtIndex(uint32_t p_u32Index) const;
-            stcAnswer* answerAtIndex(uint32_t p_u32Index);
-            uint32_t indexOfAnswer(const stcAnswer* p_pAnswer) const;
+            stcAnswer*       answerAtIndex(uint32_t p_u32Index);
+            uint32_t         indexOfAnswer(const stcAnswer* p_pAnswer) const;
 
-            bool addAnswer(stcAnswer* p_pAnswer);
-            bool removeAnswer(stcAnswer* p_pAnswer);
+            bool             addAnswer(stcAnswer* p_pAnswer);
+            bool             removeAnswer(stcAnswer* p_pAnswer);
 
-            stcAnswer* findAnswerForServiceDomain(const stcMDNS_RRDomain& p_ServiceDomain);
-            stcAnswer* findAnswerForHostDomain(const stcMDNS_RRDomain& p_HostDomain);
+            stcAnswer*       findAnswerForServiceDomain(const stcMDNS_RRDomain& p_ServiceDomain);
+            stcAnswer*       findAnswerForHostDomain(const stcMDNS_RRDomain& p_HostDomain);
         };
 
         /**
@@ -1162,67 +1162,67 @@ namespace MDNSImplementation
             struct stcDomainCacheItem
             {
                 stcDomainCacheItem* m_pNext;
-                const void* m_pHostnameOrService;  // Opaque id for host or service domain (pointer)
-                bool m_bAdditionalData;            // Opaque flag for special info (service domain included)
-                uint16_t m_u16Offset;              // Offset in UDP output buffer
+                const void*         m_pHostnameOrService;  // Opaque id for host or service domain (pointer)
+                bool                m_bAdditionalData;     // Opaque flag for special info (service domain included)
+                uint16_t            m_u16Offset;           // Offset in UDP output buffer
 
                 stcDomainCacheItem(const void* p_pHostnameOrService,
-                    bool p_bAdditionalData,
-                    uint32_t p_u16Offset);
+                                   bool        p_bAdditionalData,
+                                   uint32_t    p_u16Offset);
             };
 
         public:
-            uint16_t m_u16ID;                         // Query ID (used only in lagacy queries)
+            uint16_t            m_u16ID;              // Query ID (used only in lagacy queries)
             stcMDNS_RRQuestion* m_pQuestions;         // A list of queries
-            uint8_t m_u8HostReplyMask;                // Flags for reply components/answers
-            bool m_bLegacyQuery;                      // Flag: Legacy query
-            bool m_bResponse;                         // Flag: Response to a query
-            bool m_bAuthorative;                      // Flag: Authoritative (owner) response
-            bool m_bCacheFlush;                       // Flag: Clients should flush their caches
-            bool m_bUnicast;                          // Flag: Unicast response
-            bool m_bUnannounce;                       // Flag: Unannounce service
-            uint16_t m_u16Offset;                     // Current offset in UDP write buffer (mainly for domain cache)
+            uint8_t             m_u8HostReplyMask;    // Flags for reply components/answers
+            bool                m_bLegacyQuery;       // Flag: Legacy query
+            bool                m_bResponse;          // Flag: Response to a query
+            bool                m_bAuthorative;       // Flag: Authoritative (owner) response
+            bool                m_bCacheFlush;        // Flag: Clients should flush their caches
+            bool                m_bUnicast;           // Flag: Unicast response
+            bool                m_bUnannounce;        // Flag: Unannounce service
+            uint16_t            m_u16Offset;          // Current offset in UDP write buffer (mainly for domain cache)
             stcDomainCacheItem* m_pDomainCacheItems;  // Cached host and service domains
 
             stcMDNSSendParameter(void);
             ~stcMDNSSendParameter(void);
 
-            bool clear(void);
-            bool clearCachedNames(void);
+            bool     clear(void);
+            bool     clearCachedNames(void);
 
-            bool shiftOffset(uint16_t p_u16Shift);
+            bool     shiftOffset(uint16_t p_u16Shift);
 
-            bool addDomainCacheItem(const void* p_pHostnameOrService,
-                bool p_bAdditionalData,
-                uint16_t p_u16Offset);
+            bool     addDomainCacheItem(const void* p_pHostnameOrService,
+                                        bool        p_bAdditionalData,
+                                        uint16_t    p_u16Offset);
             uint16_t findCachedDomainOffset(const void* p_pHostnameOrService,
-                bool p_bAdditionalData) const;
+                                            bool        p_bAdditionalData) const;
         };
 
         // Instance variables
-        stcMDNSService* m_pServices;
-        UdpContext* m_pUDPContext;
-        char* m_pcHostname;
-        stcMDNSServiceQuery* m_pServiceQueries;
+        stcMDNSService*                   m_pServices;
+        UdpContext*                       m_pUDPContext;
+        char*                             m_pcHostname;
+        stcMDNSServiceQuery*              m_pServiceQueries;
         MDNSDynamicServiceTxtCallbackFunc m_fnServiceTxtCallback;
-        stcProbeInformation m_HostProbeInformation;
+        stcProbeInformation               m_HostProbeInformation;
 
         /** CONTROL **/
         /* MAINTENANCE */
-        bool _process(bool p_bUserContext);
-        bool _restart(void);
+        bool                              _process(bool p_bUserContext);
+        bool                              _restart(void);
 
         /* RECEIVING */
-        bool _parseMessage(void);
-        bool _parseQuery(const stcMDNS_MsgHeader& p_Header);
-
-        bool _parseResponse(const stcMDNS_MsgHeader& p_Header);
-        bool _processAnswers(const stcMDNS_RRAnswer* p_pPTRAnswers);
-        bool _processPTRAnswer(const stcMDNS_RRAnswerPTR* p_pPTRAnswer,
-            bool& p_rbFoundNewKeyAnswer);
-        bool _processSRVAnswer(const stcMDNS_RRAnswerSRV* p_pSRVAnswer,
-            bool& p_rbFoundNewKeyAnswer);
-        bool _processTXTAnswer(const stcMDNS_RRAnswerTXT* p_pTXTAnswer);
+        bool                              _parseMessage(void);
+        bool                              _parseQuery(const stcMDNS_MsgHeader& p_Header);
+
+        bool                              _parseResponse(const stcMDNS_MsgHeader& p_Header);
+        bool                              _processAnswers(const stcMDNS_RRAnswer* p_pPTRAnswers);
+        bool                              _processPTRAnswer(const stcMDNS_RRAnswerPTR* p_pPTRAnswer,
+                                                            bool&                      p_rbFoundNewKeyAnswer);
+        bool                              _processSRVAnswer(const stcMDNS_RRAnswerSRV* p_pSRVAnswer,
+                                                            bool&                      p_rbFoundNewKeyAnswer);
+        bool                              _processTXTAnswer(const stcMDNS_RRAnswerTXT* p_pTXTAnswer);
 #ifdef MDNS_IP4_SUPPORT
         bool _processAAnswer(const stcMDNS_RRAnswerA* p_pAAnswer);
 #endif
@@ -1231,95 +1231,95 @@ namespace MDNSImplementation
 #endif
 
         /* PROBING */
-        bool _updateProbeStatus(void);
-        bool _resetProbeStatus(bool p_bRestart = true);
-        bool _hasProbesWaitingForAnswers(void) const;
-        bool _sendHostProbe(void);
-        bool _sendServiceProbe(stcMDNSService& p_rService);
-        bool _cancelProbingForHost(void);
-        bool _cancelProbingForService(stcMDNSService& p_rService);
+        bool    _updateProbeStatus(void);
+        bool    _resetProbeStatus(bool p_bRestart = true);
+        bool    _hasProbesWaitingForAnswers(void) const;
+        bool    _sendHostProbe(void);
+        bool    _sendServiceProbe(stcMDNSService& p_rService);
+        bool    _cancelProbingForHost(void);
+        bool    _cancelProbingForService(stcMDNSService& p_rService);
 
         /* ANNOUNCE */
-        bool _announce(bool p_bAnnounce,
-            bool p_bIncludeServices);
-        bool _announceService(stcMDNSService& p_rService,
-            bool p_bAnnounce = true);
+        bool    _announce(bool p_bAnnounce,
+                          bool p_bIncludeServices);
+        bool    _announceService(stcMDNSService& p_rService,
+                                 bool            p_bAnnounce = true);
 
         /* SERVICE QUERY CACHE */
-        bool _hasServiceQueriesWaitingForAnswers(void) const;
-        bool _checkServiceQueryCache(void);
+        bool    _hasServiceQueriesWaitingForAnswers(void) const;
+        bool    _checkServiceQueryCache(void);
 
         /** TRANSFER **/
         /* SENDING */
-        bool _sendMDNSMessage(stcMDNSSendParameter& p_SendParameter);
-        bool _sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter);
-        bool _prepareMDNSMessage(stcMDNSSendParameter& p_SendParameter,
-            IPAddress p_IPAddress);
-        bool _sendMDNSServiceQuery(const stcMDNSServiceQuery& p_ServiceQuery);
-        bool _sendMDNSQuery(const stcMDNS_RRDomain& p_QueryDomain,
-            uint16_t p_u16QueryType,
-            stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers = 0);
+        bool    _sendMDNSMessage(stcMDNSSendParameter& p_SendParameter);
+        bool    _sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter);
+        bool    _prepareMDNSMessage(stcMDNSSendParameter& p_SendParameter,
+                                    IPAddress             p_IPAddress);
+        bool    _sendMDNSServiceQuery(const stcMDNSServiceQuery& p_ServiceQuery);
+        bool    _sendMDNSQuery(const stcMDNS_RRDomain&         p_QueryDomain,
+                               uint16_t                        p_u16QueryType,
+                               stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers = 0);
 
         uint8_t _replyMaskForHost(const stcMDNS_RRHeader& p_RRHeader,
-            bool* p_pbFullNameMatch = 0) const;
+                                  bool*                   p_pbFullNameMatch = 0) const;
         uint8_t _replyMaskForService(const stcMDNS_RRHeader& p_RRHeader,
-            const stcMDNSService& p_Service,
-            bool* p_pbFullNameMatch = 0) const;
+                                     const stcMDNSService&   p_Service,
+                                     bool*                   p_pbFullNameMatch = 0) const;
 
         /* RESOURCE RECORD */
-        bool _readRRQuestion(stcMDNS_RRQuestion& p_rQuestion);
-        bool _readRRAnswer(stcMDNS_RRAnswer*& p_rpAnswer);
+        bool    _readRRQuestion(stcMDNS_RRQuestion& p_rQuestion);
+        bool    _readRRAnswer(stcMDNS_RRAnswer*& p_rpAnswer);
 #ifdef MDNS_IP4_SUPPORT
         bool _readRRAnswerA(stcMDNS_RRAnswerA& p_rRRAnswerA,
-            uint16_t p_u16RDLength);
+                            uint16_t           p_u16RDLength);
 #endif
         bool _readRRAnswerPTR(stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
-            uint16_t p_u16RDLength);
+                              uint16_t             p_u16RDLength);
         bool _readRRAnswerTXT(stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
-            uint16_t p_u16RDLength);
+                              uint16_t             p_u16RDLength);
 #ifdef MDNS_IP6_SUPPORT
         bool _readRRAnswerAAAA(stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
-            uint16_t p_u16RDLength);
+                               uint16_t              p_u16RDLength);
 #endif
         bool _readRRAnswerSRV(stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
-            uint16_t p_u16RDLength);
+                              uint16_t             p_u16RDLength);
         bool _readRRAnswerGeneric(stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
-            uint16_t p_u16RDLength);
+                                  uint16_t                 p_u16RDLength);
 
         bool _readRRHeader(stcMDNS_RRHeader& p_rHeader);
         bool _readRRDomain(stcMDNS_RRDomain& p_rRRDomain);
         bool _readRRDomain_Loop(stcMDNS_RRDomain& p_rRRDomain,
-            uint8_t p_u8Depth);
+                                uint8_t           p_u8Depth);
         bool _readRRAttributes(stcMDNS_RRAttributes& p_rAttributes);
 
         /* DOMAIN NAMES */
-        bool _buildDomainForHost(const char* p_pcHostname,
-            stcMDNS_RRDomain& p_rHostDomain) const;
+        bool _buildDomainForHost(const char*       p_pcHostname,
+                                 stcMDNS_RRDomain& p_rHostDomain) const;
         bool _buildDomainForDNSSD(stcMDNS_RRDomain& p_rDNSSDDomain) const;
         bool _buildDomainForService(const stcMDNSService& p_Service,
-            bool p_bIncludeName,
-            stcMDNS_RRDomain& p_rServiceDomain) const;
-        bool _buildDomainForService(const char* p_pcService,
-            const char* p_pcProtocol,
-            stcMDNS_RRDomain& p_rServiceDomain) const;
+                                    bool                  p_bIncludeName,
+                                    stcMDNS_RRDomain&     p_rServiceDomain) const;
+        bool _buildDomainForService(const char*       p_pcService,
+                                    const char*       p_pcProtocol,
+                                    stcMDNS_RRDomain& p_rServiceDomain) const;
 #ifdef MDNS_IP4_SUPPORT
-        bool _buildDomainForReverseIP4(IPAddress p_IP4Address,
-            stcMDNS_RRDomain& p_rReverseIP4Domain) const;
+        bool _buildDomainForReverseIP4(IPAddress         p_IP4Address,
+                                       stcMDNS_RRDomain& p_rReverseIP4Domain) const;
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        bool _buildDomainForReverseIP6(IPAddress p_IP4Address,
-            stcMDNS_RRDomain& p_rReverseIP6Domain) const;
+        bool _buildDomainForReverseIP6(IPAddress         p_IP4Address,
+                                       stcMDNS_RRDomain& p_rReverseIP6Domain) const;
 #endif
 
         /* UDP */
         bool _udpReadBuffer(unsigned char* p_pBuffer,
-            size_t p_stLength);
+                            size_t         p_stLength);
         bool _udpRead8(uint8_t& p_ru8Value);
         bool _udpRead16(uint16_t& p_ru16Value);
         bool _udpRead32(uint32_t& p_ru32Value);
 
         bool _udpAppendBuffer(const unsigned char* p_pcBuffer,
-            size_t p_stLength);
+                              size_t               p_stLength);
         bool _udpAppend8(uint8_t p_u8Value);
         bool _udpAppend16(uint16_t p_u16Value);
         bool _udpAppend32(uint32_t p_u32Value);
@@ -1327,122 +1327,122 @@ namespace MDNSImplementation
 #if not defined ESP_8266_MDNS_INCLUDE || defined DEBUG_ESP_MDNS_RESPONDER
         bool _udpDump(bool p_bMovePointer = false);
         bool _udpDump(unsigned p_uOffset,
-            unsigned p_uLength);
+                      unsigned p_uLength);
 #endif
 
         /* READ/WRITE MDNS STRUCTS */
         bool _readMDNSMsgHeader(stcMDNS_MsgHeader& p_rMsgHeader);
 
-        bool _write8(uint8_t p_u8Value,
-            stcMDNSSendParameter& p_rSendParameter);
-        bool _write16(uint16_t p_u16Value,
-            stcMDNSSendParameter& p_rSendParameter);
-        bool _write32(uint32_t p_u32Value,
-            stcMDNSSendParameter& p_rSendParameter);
+        bool _write8(uint8_t               p_u8Value,
+                     stcMDNSSendParameter& p_rSendParameter);
+        bool _write16(uint16_t              p_u16Value,
+                      stcMDNSSendParameter& p_rSendParameter);
+        bool _write32(uint32_t              p_u32Value,
+                      stcMDNSSendParameter& p_rSendParameter);
 
         bool _writeMDNSMsgHeader(const stcMDNS_MsgHeader& p_MsgHeader,
-            stcMDNSSendParameter& p_rSendParameter);
+                                 stcMDNSSendParameter&    p_rSendParameter);
         bool _writeMDNSRRAttributes(const stcMDNS_RRAttributes& p_Attributes,
-            stcMDNSSendParameter& p_rSendParameter);
+                                    stcMDNSSendParameter&       p_rSendParameter);
         bool _writeMDNSRRDomain(const stcMDNS_RRDomain& p_Domain,
-            stcMDNSSendParameter& p_rSendParameter);
-        bool _writeMDNSHostDomain(const char* m_pcHostname,
-            bool p_bPrependRDLength,
-            stcMDNSSendParameter& p_rSendParameter);
+                                stcMDNSSendParameter&   p_rSendParameter);
+        bool _writeMDNSHostDomain(const char*           m_pcHostname,
+                                  bool                  p_bPrependRDLength,
+                                  stcMDNSSendParameter& p_rSendParameter);
         bool _writeMDNSServiceDomain(const stcMDNSService& p_Service,
-            bool p_bIncludeName,
-            bool p_bPrependRDLength,
-            stcMDNSSendParameter& p_rSendParameter);
+                                     bool                  p_bIncludeName,
+                                     bool                  p_bPrependRDLength,
+                                     stcMDNSSendParameter& p_rSendParameter);
 
-        bool _writeMDNSQuestion(stcMDNS_RRQuestion& p_Question,
-            stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSQuestion(stcMDNS_RRQuestion&   p_Question,
+                                stcMDNSSendParameter& p_rSendParameter);
 
 #ifdef MDNS_IP4_SUPPORT
-        bool _writeMDNSAnswer_A(IPAddress p_IPAddress,
-            stcMDNSSendParameter& p_rSendParameter);
-        bool _writeMDNSAnswer_PTR_IP4(IPAddress p_IPAddress,
-            stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_A(IPAddress             p_IPAddress,
+                                stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_PTR_IP4(IPAddress             p_IPAddress,
+                                      stcMDNSSendParameter& p_rSendParameter);
 #endif
-        bool _writeMDNSAnswer_PTR_TYPE(stcMDNSService& p_rService,
-            stcMDNSSendParameter& p_rSendParameter);
-        bool _writeMDNSAnswer_PTR_NAME(stcMDNSService& p_rService,
-            stcMDNSSendParameter& p_rSendParameter);
-        bool _writeMDNSAnswer_TXT(stcMDNSService& p_rService,
-            stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_PTR_TYPE(stcMDNSService&       p_rService,
+                                       stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_PTR_NAME(stcMDNSService&       p_rService,
+                                       stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_TXT(stcMDNSService&       p_rService,
+                                  stcMDNSSendParameter& p_rSendParameter);
 #ifdef MDNS_IP6_SUPPORT
-        bool _writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
-            stcMDNSSendParameter& p_rSendParameter);
-        bool _writeMDNSAnswer_PTR_IP6(IPAddress p_IPAddress,
-            stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_AAAA(IPAddress             p_IPAddress,
+                                   stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_PTR_IP6(IPAddress             p_IPAddress,
+                                      stcMDNSSendParameter& p_rSendParameter);
 #endif
-        bool _writeMDNSAnswer_SRV(stcMDNSService& p_rService,
-            stcMDNSSendParameter& p_rSendParameter);
+        bool                     _writeMDNSAnswer_SRV(stcMDNSService&       p_rService,
+                                                      stcMDNSSendParameter& p_rSendParameter);
 
         /** HELPERS **/
         /* UDP CONTEXT */
-        bool _callProcess(void);
-        bool _allocUDPContext(void);
-        bool _releaseUDPContext(void);
+        bool                     _callProcess(void);
+        bool                     _allocUDPContext(void);
+        bool                     _releaseUDPContext(void);
 
         /* SERVICE QUERY */
-        stcMDNSServiceQuery* _allocServiceQuery(void);
-        bool _removeServiceQuery(stcMDNSServiceQuery* p_pServiceQuery);
-        bool _removeLegacyServiceQuery(void);
-        stcMDNSServiceQuery* _findServiceQuery(hMDNSServiceQuery p_hServiceQuery);
-        stcMDNSServiceQuery* _findLegacyServiceQuery(void);
-        bool _releaseServiceQueries(void);
-        stcMDNSServiceQuery* _findNextServiceQueryByServiceType(const stcMDNS_RRDomain& p_ServiceDomain,
-            const stcMDNSServiceQuery* p_pPrevServiceQuery);
+        stcMDNSServiceQuery*     _allocServiceQuery(void);
+        bool                     _removeServiceQuery(stcMDNSServiceQuery* p_pServiceQuery);
+        bool                     _removeLegacyServiceQuery(void);
+        stcMDNSServiceQuery*     _findServiceQuery(hMDNSServiceQuery p_hServiceQuery);
+        stcMDNSServiceQuery*     _findLegacyServiceQuery(void);
+        bool                     _releaseServiceQueries(void);
+        stcMDNSServiceQuery*     _findNextServiceQueryByServiceType(const stcMDNS_RRDomain&    p_ServiceDomain,
+                                                                    const stcMDNSServiceQuery* p_pPrevServiceQuery);
 
         /* HOSTNAME */
-        bool _setHostname(const char* p_pcHostname);
-        bool _releaseHostname(void);
+        bool                     _setHostname(const char* p_pcHostname);
+        bool                     _releaseHostname(void);
 
         /* SERVICE */
-        stcMDNSService* _allocService(const char* p_pcName,
-            const char* p_pcService,
-            const char* p_pcProtocol,
-            uint16_t p_u16Port);
-        bool _releaseService(stcMDNSService* p_pService);
-        bool _releaseServices(void);
+        stcMDNSService*          _allocService(const char* p_pcName,
+                                               const char* p_pcService,
+                                               const char* p_pcProtocol,
+                                               uint16_t    p_u16Port);
+        bool                     _releaseService(stcMDNSService* p_pService);
+        bool                     _releaseServices(void);
 
-        stcMDNSService* _findService(const char* p_pcName,
-            const char* p_pcService,
-            const char* p_pcProtocol);
-        stcMDNSService* _findService(const hMDNSService p_hService);
+        stcMDNSService*          _findService(const char* p_pcName,
+                                              const char* p_pcService,
+                                              const char* p_pcProtocol);
+        stcMDNSService*          _findService(const hMDNSService p_hService);
 
-        size_t _countServices(void) const;
+        size_t                   _countServices(void) const;
 
         /* SERVICE TXT */
-        stcMDNSServiceTxt* _allocServiceTxt(stcMDNSService* p_pService,
-            const char* p_pcKey,
-            const char* p_pcValue,
-            bool p_bTemp);
-        bool _releaseServiceTxt(stcMDNSService* p_pService,
-            stcMDNSServiceTxt* p_pTxt);
-        stcMDNSServiceTxt* _updateServiceTxt(stcMDNSService* p_pService,
-            stcMDNSServiceTxt* p_pTxt,
-            const char* p_pcValue,
-            bool p_bTemp);
-
-        stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
-            const char* p_pcKey);
-        stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
-            const hMDNSTxt p_hTxt);
-
-        stcMDNSServiceTxt* _addServiceTxt(stcMDNSService* p_pService,
-            const char* p_pcKey,
-            const char* p_pcValue,
-            bool p_bTemp);
-
-        stcMDNSServiceTxt* _answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
-            const uint32_t p_u32AnswerIndex);
-
-        bool _collectServiceTxts(stcMDNSService& p_rService);
-        bool _releaseTempServiceTxts(stcMDNSService& p_rService);
+        stcMDNSServiceTxt*       _allocServiceTxt(stcMDNSService* p_pService,
+                                                  const char*     p_pcKey,
+                                                  const char*     p_pcValue,
+                                                  bool            p_bTemp);
+        bool                     _releaseServiceTxt(stcMDNSService*    p_pService,
+                                                    stcMDNSServiceTxt* p_pTxt);
+        stcMDNSServiceTxt*       _updateServiceTxt(stcMDNSService*    p_pService,
+                                                   stcMDNSServiceTxt* p_pTxt,
+                                                   const char*        p_pcValue,
+                                                   bool               p_bTemp);
+
+        stcMDNSServiceTxt*       _findServiceTxt(stcMDNSService* p_pService,
+                                                 const char*     p_pcKey);
+        stcMDNSServiceTxt*       _findServiceTxt(stcMDNSService* p_pService,
+                                                 const hMDNSTxt  p_hTxt);
+
+        stcMDNSServiceTxt*       _addServiceTxt(stcMDNSService* p_pService,
+                                                const char*     p_pcKey,
+                                                const char*     p_pcValue,
+                                                bool            p_bTemp);
+
+        stcMDNSServiceTxt*       _answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
+                                                 const uint32_t          p_u32AnswerIndex);
+
+        bool                     _collectServiceTxts(stcMDNSService& p_rService);
+        bool                     _releaseTempServiceTxts(stcMDNSService& p_rService);
         const stcMDNSServiceTxt* _serviceTxts(const char* p_pcName,
-            const char* p_pcService,
-            const char* p_pcProtocol);
+                                              const char* p_pcService,
+                                              const char* p_pcProtocol);
 
         /* MISC */
 #if not defined ESP_8266_MDNS_INCLUDE || defined DEBUG_ESP_MDNS_RESPONDER
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
index 4c3be2b063..27b24fae3d 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
@@ -93,7 +93,7 @@ namespace MDNSImplementation
     bool MDNSResponder::_restart(void)
     {
         return ((_resetProbeStatus(true /*restart*/)) &&  // Stop and restart probing
-            (_allocUDPContext()));                        // Restart UDP
+                (_allocUDPContext()));                    // Restart UDP
     }
 
     /**
@@ -106,14 +106,14 @@ namespace MDNSImplementation
     bool MDNSResponder::_parseMessage(void)
     {
         DEBUG_EX_INFO(
-            unsigned long ulStartTime = millis();
-            unsigned uStartMemory = ESP.getFreeHeap();
+            unsigned long ulStartTime  = millis();
+            unsigned      uStartMemory = ESP.getFreeHeap();
             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage (Time: %lu ms, heap: %u bytes, from %s(%u), to %s(%u))\n"), ulStartTime, uStartMemory,
-                IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), m_pUDPContext->getRemotePort(),
-                IPAddress(m_pUDPContext->getDestAddress()).toString().c_str(), m_pUDPContext->getLocalPort()););
+                                  IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), m_pUDPContext->getRemotePort(),
+                                  IPAddress(m_pUDPContext->getDestAddress()).toString().c_str(), m_pUDPContext->getLocalPort()););
         //DEBUG_EX_INFO(_udpDump(););
 
-        bool bResult = false;
+        bool              bResult = false;
 
         stcMDNS_MsgHeader header;
         if (_readMDNSMsgHeader(header))
@@ -167,10 +167,10 @@ namespace MDNSImplementation
 */
     bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
     {
-        bool bResult = true;
+        bool                 bResult = true;
 
         stcMDNSSendParameter sendParameter;
-        uint8_t u8HostOrServiceReplies = 0;
+        uint8_t              u8HostOrServiceReplies = 0;
         for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
         {
             stcMDNS_RRQuestion questionRR;
@@ -178,12 +178,12 @@ namespace MDNSImplementation
             {
                 // Define host replies, BUT only answer queries after probing is done
                 u8HostOrServiceReplies = sendParameter.m_u8HostReplyMask |= (((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus))
-                        ? _replyMaskForHost(questionRR.m_Header, 0)
-                        : 0);
+                                                                                 ? _replyMaskForHost(questionRR.m_Header, 0)
+                                                                                 : 0);
                 DEBUG_EX_INFO(if (u8HostOrServiceReplies)
-                    {
-                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Host reply needed 0x%X\n"), u8HostOrServiceReplies);
-                    });
+                              {
+                                  DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Host reply needed 0x%X\n"), u8HostOrServiceReplies);
+                              });
 
                 // Check tiebreak need for host domain
                 if (ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus)
@@ -206,13 +206,13 @@ namespace MDNSImplementation
                 {
                     // Define service replies, BUT only answer queries after probing is done
                     uint8_t u8ReplyMaskForQuestion = (((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus))
-                            ? _replyMaskForService(questionRR.m_Header, *pService, 0)
-                            : 0);
+                                                          ? _replyMaskForService(questionRR.m_Header, *pService, 0)
+                                                          : 0);
                     u8HostOrServiceReplies |= (pService->m_u8ReplyMask |= u8ReplyMaskForQuestion);
                     DEBUG_EX_INFO(if (u8ReplyMaskForQuestion)
-                        {
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service reply needed for (%s.%s.%s): 0x%X (%s)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, u8ReplyMaskForQuestion, IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str());
-                        });
+                                  {
+                                      DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service reply needed for (%s.%s.%s): 0x%X (%s)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, u8ReplyMaskForQuestion, IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str());
+                                  });
 
                     // Check tiebreak need for service domain
                     if (ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus)
@@ -234,35 +234,35 @@ namespace MDNSImplementation
                 // Handle unicast and legacy specialities
                 // If only one question asks for unicast reply, the whole reply packet is send unicast
                 if (((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) ||  // Unicast (maybe legacy) query OR
-                        (questionRR.m_bUnicast))
+                     (questionRR.m_bUnicast))
                     &&  // Expressivly unicast query
                     (!sendParameter.m_bUnicast))
                 {
-                    sendParameter.m_bUnicast = true;
+                    sendParameter.m_bUnicast    = true;
                     sendParameter.m_bCacheFlush = false;
                     DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Unicast response for %s!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
 
                     if ((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) &&  // Unicast (maybe legacy) query AND
                         (1 == p_MsgHeader.m_u16QDCount) &&                      // Only one question AND
                         ((sendParameter.m_u8HostReplyMask) ||                   //  Host replies OR
-                            (u8HostOrServiceReplies)))                          //  Host or service replies available
+                         (u8HostOrServiceReplies)))                             //  Host or service replies available
                     {
                         // We're a match for this legacy query, BUT
                         // make sure, that the query comes from a local host
                         ip_info IPInfo_Local;
                         ip_info IPInfo_Remote;
                         if (((IPInfo_Remote.ip.addr = m_pUDPContext->getRemoteAddress())) && (((wifi_get_ip_info(SOFTAP_IF, &IPInfo_Local)) && (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask))) ||  // Remote IP in SOFTAP's subnet OR
-                                ((wifi_get_ip_info(STATION_IF, &IPInfo_Local)) && (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask)))))                                                                // Remote IP in STATION's subnet
+                                                                                              ((wifi_get_ip_info(STATION_IF, &IPInfo_Local)) && (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask)))))  // Remote IP in STATION's subnet
                         {
                             DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from local host %s, id %u!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), p_MsgHeader.m_u16ID););
 
-                            sendParameter.m_u16ID = p_MsgHeader.m_u16ID;
+                            sendParameter.m_u16ID        = p_MsgHeader.m_u16ID;
                             sendParameter.m_bLegacyQuery = true;
-                            sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
+                            sendParameter.m_pQuestions   = new stcMDNS_RRQuestion;
                             if ((bResult = (0 != sendParameter.m_pQuestions)))
                             {
-                                sendParameter.m_pQuestions->m_Header.m_Domain = questionRR.m_Header.m_Domain;
-                                sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = questionRR.m_Header.m_Attributes.m_u16Type;
+                                sendParameter.m_pQuestions->m_Header.m_Domain                = questionRR.m_Header.m_Domain;
+                                sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type  = questionRR.m_Header.m_Attributes.m_u16Type;
                                 sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = questionRR.m_Header.m_Attributes.m_u16Class;
                             }
                             else
@@ -289,9 +289,9 @@ namespace MDNSImplementation
         // Handle known answers
         uint32_t u32Answers = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
         DEBUG_EX_INFO(if ((u8HostOrServiceReplies) && (u32Answers))
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Known answers(%u):\n"), u32Answers);
-            });
+                      {
+                          DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Known answers(%u):\n"), u32Answers);
+                      });
 
         for (uint32_t an = 0; ((bResult) && (an < u32Answers)); ++an)
         {
@@ -512,10 +512,10 @@ namespace MDNSImplementation
             {
                 DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Sending answer(0x%X)...\n"), u8ReplyNeeded););
 
-                sendParameter.m_bResponse = true;
+                sendParameter.m_bResponse    = true;
                 sendParameter.m_bAuthorative = true;
 
-                bResult = _sendMDNSMessage(sendParameter);
+                bResult                      = _sendMDNSMessage(sendParameter);
             }
             DEBUG_EX_INFO(
                 else
@@ -545,9 +545,9 @@ namespace MDNSImplementation
             }
         }
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -606,15 +606,15 @@ namespace MDNSImplementation
 
             //
             // Read and collect answers
-            stcMDNS_RRAnswer* pCollectedRRAnswers = 0;
-            uint32_t u32NumberOfAnswerRRs = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
+            stcMDNS_RRAnswer* pCollectedRRAnswers  = 0;
+            uint32_t          u32NumberOfAnswerRRs = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
             for (uint32_t an = 0; ((bResult) && (an < u32NumberOfAnswerRRs)); ++an)
             {
                 stcMDNS_RRAnswer* pRRAnswer = 0;
                 if (((bResult = _readRRAnswer(pRRAnswer))) && (pRRAnswer))
                 {
                     //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: ADDING answer!\n")););
-                    pRRAnswer->m_pNext = pCollectedRRAnswers;
+                    pRRAnswer->m_pNext  = pCollectedRRAnswers;
                     pCollectedRRAnswers = pRRAnswer;
                 }
                 else
@@ -676,9 +676,9 @@ namespace MDNSImplementation
             bResult = true;
         }
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -710,7 +710,7 @@ namespace MDNSImplementation
             bool bFoundNewKeyAnswer;
             do
             {
-                bFoundNewKeyAnswer = false;
+                bFoundNewKeyAnswer                = false;
 
                 const stcMDNS_RRAnswer* pRRAnswer = p_pAnswers;
                 while ((pRRAnswer) && (bResult))
@@ -782,9 +782,9 @@ namespace MDNSImplementation
             } while ((bFoundNewKeyAnswer) && (bResult));
         }  // else: No answers provided
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -792,7 +792,7 @@ namespace MDNSImplementation
     MDNSResponder::_processPTRAnswer
 */
     bool MDNSResponder::_processPTRAnswer(const MDNSResponder::stcMDNS_RRAnswerPTR* p_pPTRAnswer,
-        bool& p_rbFoundNewKeyAnswer)
+                                          bool&                                     p_rbFoundNewKeyAnswer)
     {
         bool bResult = false;
 
@@ -828,15 +828,15 @@ namespace MDNSImplementation
                                 DEBUG_OUTPUT.printf_P(PSTR("\n")););
                         }
                     }
-                    else if ((p_pPTRAnswer->m_u32TTL) &&                     // Not just a goodbye-message
-                        ((pSQAnswer = new stcMDNSServiceQuery::stcAnswer)))  // Not yet included -> add answer
+                    else if ((p_pPTRAnswer->m_u32TTL) &&                          // Not just a goodbye-message
+                             ((pSQAnswer = new stcMDNSServiceQuery::stcAnswer)))  // Not yet included -> add answer
                     {
                         pSQAnswer->m_ServiceDomain = p_pPTRAnswer->m_PTRDomain;
                         pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_ServiceDomain;
                         pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);
                         pSQAnswer->releaseServiceDomain();
 
-                        bResult = pServiceQuery->addAnswer(pSQAnswer);
+                        bResult               = pServiceQuery->addAnswer(pSQAnswer);
                         p_rbFoundNewKeyAnswer = true;
                         if (pServiceQuery->m_fnCallback)
                         {
@@ -849,9 +849,9 @@ namespace MDNSImplementation
             }
         }  // else: No p_pPTRAnswer
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -859,7 +859,7 @@ namespace MDNSImplementation
     MDNSResponder::_processSRVAnswer
 */
     bool MDNSResponder::_processSRVAnswer(const MDNSResponder::stcMDNS_RRAnswerSRV* p_pSRVAnswer,
-        bool& p_rbFoundNewKeyAnswer)
+                                          bool&                                     p_rbFoundNewKeyAnswer)
     {
         bool bResult = false;
 
@@ -909,9 +909,9 @@ namespace MDNSImplementation
             }  // while(service query)
         }      // else: No p_pSRVAnswer
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -965,9 +965,9 @@ namespace MDNSImplementation
             }  // while(service query)
         }      // else: No p_pTXTAnswer
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -1036,9 +1036,9 @@ namespace MDNSImplementation
             }  // while(service query)
         }      // else: No p_pAAnswer
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED!\n"));
+                     });
         return bResult;
     }
 #endif
@@ -1143,7 +1143,7 @@ namespace MDNSImplementation
             m_HostProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
         }
         else if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing AND
-            (m_HostProbeInformation.m_Timeout.expired()))                                 // Time for next probe
+                 (m_HostProbeInformation.m_Timeout.expired()))                            // Time for next probe
         {
             if (MDNS_PROBE_COUNT > m_HostProbeInformation.m_u8SentCount)  // Send next probe
             {
@@ -1199,7 +1199,7 @@ namespace MDNSImplementation
                 pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
             }
             else if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing AND
-                (pService->m_ProbeInformation.m_Timeout.expired()))                                 // Time for next probe
+                     (pService->m_ProbeInformation.m_Timeout.expired()))                            // Time for next probe
             {
                 if (MDNS_PROBE_COUNT > pService->m_ProbeInformation.m_u8SentCount)  // Send next probe
                 {
@@ -1245,9 +1245,9 @@ namespace MDNSImplementation
             }
         }
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: FAILED!\n\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: FAILED!\n\n"));
+                     });
         return bResult;
     }
 
@@ -1278,12 +1278,12 @@ namespace MDNSImplementation
     bool MDNSResponder::_hasProbesWaitingForAnswers(void) const
     {
         bool bResult = ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing
-            (0 < m_HostProbeInformation.m_u8SentCount));                                         // And really probing
+                        (0 < m_HostProbeInformation.m_u8SentCount));                             // And really probing
 
         for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
         {
             bResult = ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing
-                (0 < pService->m_ProbeInformation.m_u8SentCount));                                    // And really probing
+                       (0 < pService->m_ProbeInformation.m_u8SentCount));                             // And really probing
         }
         return bResult;
     }
@@ -1303,17 +1303,17 @@ namespace MDNSImplementation
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe (%s, %lu)\n"), m_pcHostname, millis()););
 
-        bool bResult = true;
+        bool                 bResult = true;
 
         // Requests for host domain
         stcMDNSSendParameter sendParameter;
         sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
 
-        sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
+        sendParameter.m_pQuestions  = new stcMDNS_RRQuestion;
         if (((bResult = (0 != sendParameter.m_pQuestions))) && ((bResult = _buildDomainForHost(m_pcHostname, sendParameter.m_pQuestions->m_Header.m_Domain))))
         {
             //sendParameter.m_pQuestions->m_bUnicast = true;
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type  = DNS_RRTYPE_ANY;
             sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
 
             // Add known answers
@@ -1334,9 +1334,9 @@ namespace MDNSImplementation
             }
         }
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED!\n"));
+                     });
         return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
 
@@ -1356,21 +1356,21 @@ namespace MDNSImplementation
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe (%s.%s.%s, %lu)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, millis()););
 
-        bool bResult = true;
+        bool                 bResult = true;
 
         // Requests for service instance domain
         stcMDNSSendParameter sendParameter;
         sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
 
-        sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
+        sendParameter.m_pQuestions  = new stcMDNS_RRQuestion;
         if (((bResult = (0 != sendParameter.m_pQuestions))) && ((bResult = _buildDomainForService(p_rService, true, sendParameter.m_pQuestions->m_Header.m_Domain))))
         {
-            sendParameter.m_pQuestions->m_bUnicast = true;
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY;
+            sendParameter.m_pQuestions->m_bUnicast                       = true;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type  = DNS_RRTYPE_ANY;
             sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
 
             // Add known answers
-            p_rService.m_u8ReplyMask = (ContentFlag_SRV | ContentFlag_PTR_NAME);  // Add SRV and PTR NAME answers
+            p_rService.m_u8ReplyMask                                     = (ContentFlag_SRV | ContentFlag_PTR_NAME);  // Add SRV and PTR NAME answers
         }
         else
         {
@@ -1382,9 +1382,9 @@ namespace MDNSImplementation
             }
         }
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED!\n"));
+                     });
         return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
 
@@ -1450,18 +1450,18 @@ namespace MDNSImplementation
     inside the '_writeXXXAnswer' procs via 'sendParameter.m_bUnannounce = true'
 */
     bool MDNSResponder::_announce(bool p_bAnnounce,
-        bool p_bIncludeServices)
+                                  bool p_bIncludeServices)
     {
-        bool bResult = false;
+        bool                 bResult = false;
 
         stcMDNSSendParameter sendParameter;
         if (ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus)
         {
-            bResult = true;
+            bResult                         = true;
 
-            sendParameter.m_bResponse = true;  // Announces are 'Unsolicited authoritative responses'
-            sendParameter.m_bAuthorative = true;
-            sendParameter.m_bUnannounce = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
+            sendParameter.m_bResponse       = true;  // Announces are 'Unsolicited authoritative responses'
+            sendParameter.m_bAuthorative    = true;
+            sendParameter.m_bUnannounce     = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
 
             // Announce host
             sendParameter.m_u8HostReplyMask = 0;
@@ -1491,9 +1491,9 @@ namespace MDNSImplementation
             }
         }
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: FAILED!\n"));
+                     });
         return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
 
@@ -1501,30 +1501,30 @@ namespace MDNSImplementation
     MDNSResponder::_announceService
 */
     bool MDNSResponder::_announceService(stcMDNSService& p_rService,
-        bool p_bAnnounce /*= true*/)
+                                         bool            p_bAnnounce /*= true*/)
     {
-        bool bResult = false;
+        bool                 bResult = false;
 
         stcMDNSSendParameter sendParameter;
         if (ProbingStatus_Done == p_rService.m_ProbeInformation.m_ProbingStatus)
         {
-            sendParameter.m_bResponse = true;  // Announces are 'Unsolicited authoritative responses'
-            sendParameter.m_bAuthorative = true;
-            sendParameter.m_bUnannounce = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
+            sendParameter.m_bResponse       = true;  // Announces are 'Unsolicited authoritative responses'
+            sendParameter.m_bAuthorative    = true;
+            sendParameter.m_bUnannounce     = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
 
             // DON'T announce host
             sendParameter.m_u8HostReplyMask = 0;
 
             // Announce services (service type, name, SRV (location) and TXTs)
-            p_rService.m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
+            p_rService.m_u8ReplyMask        = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
             DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: Announcing service %s.%s.%s (content 0x%X)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, p_rService.m_u8ReplyMask););
 
             bResult = true;
         }
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: FAILED!\n"));
+                     });
         return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
 
@@ -1575,8 +1575,8 @@ namespace MDNSImplementation
                 {
                     ++pServiceQuery->m_u8SentCount;
                     pServiceQuery->m_ResendTimeout.reset((MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount)
-                            ? (MDNS_DYNAMIC_QUERY_RESEND_DELAY * (pServiceQuery->m_u8SentCount - 1))
-                            : esp8266::polledTimeout::oneShotMs::neverExpires);
+                                                             ? (MDNS_DYNAMIC_QUERY_RESEND_DELAY * (pServiceQuery->m_u8SentCount - 1))
+                                                             : esp8266::polledTimeout::oneShotMs::neverExpires);
                 }
                 DEBUG_EX_INFO(
                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: %s to resend service query!"), (bResult ? "Succeeded" : "FAILED"));
@@ -1618,7 +1618,7 @@ namespace MDNSImplementation
                                 DEBUG_OUTPUT.printf_P(PSTR("\n"));
                                 printedInfo = true;);
 
-                            bResult = pServiceQuery->removeAnswer(pSQAnswer);
+                            bResult   = pServiceQuery->removeAnswer(pSQAnswer);
                             pSQAnswer = 0;
                             continue;  // Don't use this answer anymore
                         }
@@ -1709,8 +1709,8 @@ namespace MDNSImplementation
                     // 3. level answers
 #ifdef MDNS_IP4_SUPPORT
                     // IP4Address (from A)
-                    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = pSQAnswer->m_pIP4Addresses;
-                    bool bAUpdateQuerySent = false;
+                    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address       = pSQAnswer->m_pIP4Addresses;
+                    bool                                           bAUpdateQuerySent = false;
                     while ((pIP4Address) && (bResult))
                     {
                         stcMDNSServiceQuery::stcAnswer::stcIP4Address* pNextIP4Address = pIP4Address->m_pNext;  // Get 'next' early, as 'current' may be deleted at the end...
@@ -1758,8 +1758,8 @@ namespace MDNSImplementation
 #endif
 #ifdef MDNS_IP6_SUPPORT
                     // IP6Address (from AAAA)
-                    stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address = pSQAnswer->m_pIP6Addresses;
-                    bool bAAAAUpdateQuerySent = false;
+                    stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address          = pSQAnswer->m_pIP6Addresses;
+                    bool                                           bAAAAUpdateQuerySent = false;
                     while ((pIP6Address) && (bResult))
                     {
                         stcMDNSServiceQuery::stcAnswer::stcIP6Address* pNextIP6Address = pIP6Address->m_pNext;  // Get 'next' early, as 'current' may be deleted at the end...
@@ -1814,9 +1814,9 @@ namespace MDNSImplementation
                 DEBUG_OUTPUT.printf_P(PSTR("\n"));
             });
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -1830,7 +1830,7 @@ namespace MDNSImplementation
     In addition, a full name match (question domain == host domain) is marked.
 */
     uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
-        bool* p_pbFullNameMatch /*= 0*/) const
+                                             bool*                                  p_pbFullNameMatch /*= 0*/) const
     {
         //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost\n")););
 
@@ -1887,9 +1887,9 @@ namespace MDNSImplementation
             //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
         }
         DEBUG_EX_INFO(if (u8ReplyMask)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: 0x%X\n"), u8ReplyMask);
-            });
+                      {
+                          DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: 0x%X\n"), u8ReplyMask);
+                      });
         return u8ReplyMask;
     }
 
@@ -1906,8 +1906,8 @@ namespace MDNSImplementation
     In addition, a full name match (question domain == service instance domain) is marked.
 */
     uint8_t MDNSResponder::_replyMaskForService(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
-        const MDNSResponder::stcMDNSService& p_Service,
-        bool* p_pbFullNameMatch /*= 0*/) const
+                                                const MDNSResponder::stcMDNSService&   p_Service,
+                                                bool*                                  p_pbFullNameMatch /*= 0*/) const
     {
         uint8_t u8ReplyMask = 0;
         (p_pbFullNameMatch ? * p_pbFullNameMatch = false : 0);
@@ -1952,9 +1952,9 @@ namespace MDNSImplementation
             //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
         }
         DEBUG_EX_INFO(if (u8ReplyMask)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService(%s.%s.%s): 0x%X\n"), p_Service.m_pcName, p_Service.m_pcService, p_Service.m_pcProtocol, u8ReplyMask);
-            });
+                      {
+                          DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService(%s.%s.%s): 0x%X\n"), p_Service.m_pcName, p_Service.m_pcService, p_Service.m_pcProtocol, u8ReplyMask);
+                      });
         return u8ReplyMask;
     }
 
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
index 2803565d02..be553ea96f 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
@@ -52,11 +52,11 @@ namespace MDNSImplementation
     if no default is given, 'esp8266' is used.
 
 */
-    /*static*/ bool MDNSResponder::indexDomain(char*& p_rpcDomain,
-        const char* p_pcDivider /*= "-"*/,
-        const char* p_pcDefaultDomain /*= 0*/)
+    /*static*/ bool MDNSResponder::indexDomain(char*&      p_rpcDomain,
+                                               const char* p_pcDivider /*= "-"*/,
+                                               const char* p_pcDefaultDomain /*= 0*/)
     {
-        bool bResult = false;
+        bool        bResult   = false;
 
         // Ensure a divider exists; use '-' as default
         const char* pcDivider = (p_pcDivider ?: "-");
@@ -66,14 +66,14 @@ namespace MDNSImplementation
             const char* pFoundDivider = strrstr(p_rpcDomain, pcDivider);
             if (pFoundDivider)  // maybe already extended
             {
-                char* pEnd = 0;
+                char*         pEnd    = 0;
                 unsigned long ulIndex = strtoul((pFoundDivider + strlen(pcDivider)), &pEnd, 10);
                 if ((ulIndex) && ((pEnd - p_rpcDomain) == (ptrdiff_t)strlen(p_rpcDomain)) && (!*pEnd))  // Valid (old) index found
                 {
                     char acIndexBuffer[16];
                     sprintf(acIndexBuffer, "%lu", (++ulIndex));
-                    size_t stLength = ((pFoundDivider - p_rpcDomain + strlen(pcDivider)) + strlen(acIndexBuffer) + 1);
-                    char* pNewHostname = new char[stLength];
+                    size_t stLength     = ((pFoundDivider - p_rpcDomain + strlen(pcDivider)) + strlen(acIndexBuffer) + 1);
+                    char*  pNewHostname = new char[stLength];
                     if (pNewHostname)
                     {
                         memcpy(pNewHostname, p_rpcDomain, (pFoundDivider - p_rpcDomain + strlen(pcDivider)));
@@ -83,7 +83,7 @@ namespace MDNSImplementation
                         delete[] p_rpcDomain;
                         p_rpcDomain = pNewHostname;
 
-                        bResult = true;
+                        bResult     = true;
                     }
                     else
                     {
@@ -98,8 +98,8 @@ namespace MDNSImplementation
 
             if (!pFoundDivider)  // not yet extended (or failed to increment extension) -> start indexing
             {
-                size_t stLength = strlen(p_rpcDomain) + (strlen(pcDivider) + 1 + 1);  // Name + Divider + '2' + '\0'
-                char* pNewHostname = new char[stLength];
+                size_t stLength     = strlen(p_rpcDomain) + (strlen(pcDivider) + 1 + 1);  // Name + Divider + '2' + '\0'
+                char*  pNewHostname = new char[stLength];
                 if (pNewHostname)
                 {
                     sprintf(pNewHostname, "%s%s2", p_rpcDomain, pcDivider);
@@ -107,7 +107,7 @@ namespace MDNSImplementation
                     delete[] p_rpcDomain;
                     p_rpcDomain = pNewHostname;
 
-                    bResult = true;
+                    bResult     = true;
                 }
                 else
                 {
@@ -120,8 +120,8 @@ namespace MDNSImplementation
             // No given host domain, use base or default
             const char* cpcDefaultName = (p_pcDefaultDomain ?: "esp8266");
 
-            size_t stLength = strlen(cpcDefaultName) + 1;  // '\0'
-            p_rpcDomain = new char[stLength];
+            size_t      stLength       = strlen(cpcDefaultName) + 1;  // '\0'
+            p_rpcDomain                = new char[stLength];
             if (p_rpcDomain)
             {
                 strncpy(p_rpcDomain, cpcDefaultName, stLength);
@@ -208,7 +208,7 @@ namespace MDNSImplementation
         {
             // Link to query list
             pServiceQuery->m_pNext = m_pServiceQueries;
-            m_pServiceQueries = pServiceQuery;
+            m_pServiceQueries      = pServiceQuery;
         }
         return m_pServiceQueries;
     }
@@ -313,12 +313,12 @@ namespace MDNSImplementation
     /*
     MDNSResponder::_findNextServiceQueryByServiceType
 */
-    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findNextServiceQueryByServiceType(const stcMDNS_RRDomain& p_ServiceTypeDomain,
-        const stcMDNSServiceQuery* p_pPrevServiceQuery)
+    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findNextServiceQueryByServiceType(const stcMDNS_RRDomain&    p_ServiceTypeDomain,
+                                                                                          const stcMDNSServiceQuery* p_pPrevServiceQuery)
     {
         stcMDNSServiceQuery* pMatchingServiceQuery = 0;
 
-        stcMDNSServiceQuery* pServiceQuery = (p_pPrevServiceQuery ? p_pPrevServiceQuery->m_pNext : m_pServiceQueries);
+        stcMDNSServiceQuery* pServiceQuery         = (p_pPrevServiceQuery ? p_pPrevServiceQuery->m_pNext : m_pServiceQueries);
         while (pServiceQuery)
         {
             if (p_ServiceTypeDomain == pServiceQuery->m_ServiceTypeDomain)
@@ -388,19 +388,19 @@ namespace MDNSImplementation
     MDNSResponder::_allocService
 */
     MDNSResponder::stcMDNSService* MDNSResponder::_allocService(const char* p_pcName,
-        const char* p_pcService,
-        const char* p_pcProtocol,
-        uint16_t p_u16Port)
+                                                                const char* p_pcService,
+                                                                const char* p_pcProtocol,
+                                                                uint16_t    p_u16Port)
     {
         stcMDNSService* pService = 0;
         if (((!p_pcName) || (MDNS_DOMAIN_LABEL_MAXLENGTH >= strlen(p_pcName))) && (p_pcService) && (MDNS_SERVICE_NAME_LENGTH >= strlen(p_pcService)) && (p_pcProtocol) && (MDNS_SERVICE_PROTOCOL_LENGTH >= strlen(p_pcProtocol)) && (p_u16Port) && (0 != (pService = new stcMDNSService)) && (pService->setName(p_pcName ?: m_pcHostname)) && (pService->setService(p_pcService)) && (pService->setProtocol(p_pcProtocol)))
         {
             pService->m_bAutoName = (0 == p_pcName);
-            pService->m_u16Port = p_u16Port;
+            pService->m_u16Port   = p_u16Port;
 
             // Add to list (or start list)
-            pService->m_pNext = m_pServices;
-            m_pServices = pService;
+            pService->m_pNext     = m_pServices;
+            m_pServices           = pService;
         }
         return pService;
     }
@@ -460,8 +460,8 @@ namespace MDNSImplementation
     MDNSResponder::_findService
 */
     MDNSResponder::stcMDNSService* MDNSResponder::_findService(const char* p_pcName,
-        const char* p_pcService,
-        const char* p_pcProtocol)
+                                                               const char* p_pcService,
+                                                               const char* p_pcProtocol)
     {
         stcMDNSService* pService = m_pServices;
         while (pService)
@@ -500,21 +500,21 @@ namespace MDNSImplementation
     MDNSResponder::_allocServiceTxt
 */
     MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_allocServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        const char* p_pcKey,
-        const char* p_pcValue,
-        bool p_bTemp)
+                                                                      const char*                    p_pcKey,
+                                                                      const char*                    p_pcValue,
+                                                                      bool                           p_bTemp)
     {
         stcMDNSServiceTxt* pTxt = 0;
 
-        if ((p_pService) && (p_pcKey) && (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() + 1 +  // Length byte
-                                              (p_pcKey ? strlen(p_pcKey) : 0) + 1 +                        // '='
-                                              (p_pcValue ? strlen(p_pcValue) : 0))))
+        if ((p_pService) && (p_pcKey) && (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() + 1 +      // Length byte
+                                                                        (p_pcKey ? strlen(p_pcKey) : 0) + 1 +  // '='
+                                                                        (p_pcValue ? strlen(p_pcValue) : 0))))
         {
             pTxt = new stcMDNSServiceTxt;
             if (pTxt)
             {
                 size_t stLength = (p_pcKey ? strlen(p_pcKey) : 0);
-                pTxt->m_pcKey = new char[stLength + 1];
+                pTxt->m_pcKey   = new char[stLength + 1];
                 if (pTxt->m_pcKey)
                 {
                     strncpy(pTxt->m_pcKey, p_pcKey, stLength);
@@ -523,7 +523,7 @@ namespace MDNSImplementation
 
                 if (p_pcValue)
                 {
-                    stLength = (p_pcValue ? strlen(p_pcValue) : 0);
+                    stLength        = (p_pcValue ? strlen(p_pcValue) : 0);
                     pTxt->m_pcValue = new char[stLength + 1];
                     if (pTxt->m_pcValue)
                     {
@@ -543,8 +543,8 @@ namespace MDNSImplementation
     /*
     MDNSResponder::_releaseServiceTxt
 */
-    bool MDNSResponder::_releaseServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        MDNSResponder::stcMDNSServiceTxt* p_pTxt)
+    bool MDNSResponder::_releaseServiceTxt(MDNSResponder::stcMDNSService*    p_pService,
+                                           MDNSResponder::stcMDNSServiceTxt* p_pTxt)
     {
         return ((p_pService) && (p_pTxt) && (p_pService->m_Txts.remove(p_pTxt)));
     }
@@ -552,10 +552,10 @@ namespace MDNSImplementation
     /*
     MDNSResponder::_updateServiceTxt
 */
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_updateServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        MDNSResponder::stcMDNSServiceTxt* p_pTxt,
-        const char* p_pcValue,
-        bool p_bTemp)
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_updateServiceTxt(MDNSResponder::stcMDNSService*    p_pService,
+                                                                       MDNSResponder::stcMDNSServiceTxt* p_pTxt,
+                                                                       const char*                       p_pcValue,
+                                                                       bool                              p_bTemp)
     {
         if ((p_pService) && (p_pTxt) && (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() - (p_pTxt->m_pcValue ? strlen(p_pTxt->m_pcValue) : 0) + (p_pcValue ? strlen(p_pcValue) : 0))))
         {
@@ -569,7 +569,7 @@ namespace MDNSImplementation
     MDNSResponder::_findServiceTxt
 */
     MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        const char* p_pcKey)
+                                                                     const char*                    p_pcKey)
     {
         return (p_pService ? p_pService->m_Txts.find(p_pcKey) : 0);
     }
@@ -578,7 +578,7 @@ namespace MDNSImplementation
     MDNSResponder::_findServiceTxt
 */
     MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        const hMDNSTxt p_hTxt)
+                                                                     const hMDNSTxt                 p_hTxt)
     {
         return (((p_pService) && (p_hTxt)) ? p_pService->m_Txts.find((stcMDNSServiceTxt*)p_hTxt) : 0);
     }
@@ -587,9 +587,9 @@ namespace MDNSImplementation
     MDNSResponder::_addServiceTxt
 */
     MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_addServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        const char* p_pcKey,
-        const char* p_pcValue,
-        bool p_bTemp)
+                                                                    const char*                    p_pcKey,
+                                                                    const char*                    p_pcValue,
+                                                                    bool                           p_bTemp)
     {
         stcMDNSServiceTxt* pResult = 0;
 
@@ -609,10 +609,10 @@ namespace MDNSImplementation
     }
 
     MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
+                                                                     const uint32_t          p_u32AnswerIndex)
     {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         // Fill m_pcTxts (if not already done)
         return (pSQAnswer) ? pSQAnswer->m_Txts.m_pTxts : 0;
     }
@@ -654,8 +654,8 @@ namespace MDNSImplementation
     {
         //DEBUG_OUTPUT.printf_P(PSTR("Domain: "));
 
-        const char* pCursor = p_RRDomain.m_acName;
-        uint8_t u8Length = *pCursor++;
+        const char* pCursor  = p_RRDomain.m_acName;
+        uint8_t     u8Length = *pCursor++;
         if (u8Length)
         {
             while (u8Length)
@@ -702,7 +702,7 @@ namespace MDNSImplementation
         case DNS_RRTYPE_TXT:
         {
             size_t stTxtLength = ((const stcMDNS_RRAnswerTXT*)&p_RRAnswer)->m_Txts.c_strLength();
-            char* pTxts = new char[stTxtLength];
+            char*  pTxts       = new char[stTxtLength];
             if (pTxts)
             {
                 ((/*const c_str()!!*/ stcMDNS_RRAnswerTXT*)&p_RRAnswer)->m_Txts.c_str(pTxts);
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
index b1bfd98ccf..325df90cc3 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
@@ -51,12 +51,12 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt constructor
 */
     MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const char* p_pcKey /*= 0*/,
-        const char* p_pcValue /*= 0*/,
-        bool p_bTemp /*= false*/)
-        : m_pNext(0)
-        , m_pcKey(0)
-        , m_pcValue(0)
-        , m_bTemp(p_bTemp)
+                                                        const char* p_pcValue /*= 0*/,
+                                                        bool        p_bTemp /*= false*/) :
+        m_pNext(0),
+        m_pcKey(0),
+        m_pcValue(0),
+        m_bTemp(p_bTemp)
     {
         setKey(p_pcKey);
         setValue(p_pcValue);
@@ -65,11 +65,11 @@ namespace MDNSImplementation
     /*
     MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt copy-constructor
 */
-    MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const MDNSResponder::stcMDNSServiceTxt& p_Other)
-        : m_pNext(0)
-        , m_pcKey(0)
-        , m_pcValue(0)
-        , m_bTemp(false)
+    MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const MDNSResponder::stcMDNSServiceTxt& p_Other) :
+        m_pNext(0),
+        m_pcKey(0),
+        m_pcValue(0),
+        m_bTemp(false)
     {
         operator=(p_Other);
     }
@@ -122,7 +122,7 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNSServiceTxt::setKey
 */
     bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey,
-        size_t p_stLength)
+                                                  size_t      p_stLength)
     {
         bool bResult = false;
 
@@ -133,7 +133,7 @@ namespace MDNSImplementation
             {
                 strncpy(m_pcKey, p_pcKey, p_stLength);
                 m_pcKey[p_stLength] = 0;
-                bResult = true;
+                bResult             = true;
             }
         }
         return bResult;
@@ -177,7 +177,7 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNSServiceTxt::setValue
 */
     bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue,
-        size_t p_stLength)
+                                                    size_t      p_stLength)
     {
         bool bResult = false;
 
@@ -188,7 +188,7 @@ namespace MDNSImplementation
             {
                 strncpy(m_pcValue, p_pcValue, p_stLength);
                 m_pcValue[p_stLength] = 0;
-                bResult = true;
+                bResult               = true;
             }
         }
         else  // No value -> also OK
@@ -223,8 +223,8 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNSServiceTxt::set
 */
     bool MDNSResponder::stcMDNSServiceTxt::set(const char* p_pcKey,
-        const char* p_pcValue,
-        bool p_bTemp /*= false*/)
+                                               const char* p_pcValue,
+                                               bool        p_bTemp /*= false*/)
     {
         m_bTemp = p_bTemp;
         return ((setKey(p_pcKey)) && (setValue(p_pcValue)));
@@ -270,16 +270,16 @@ namespace MDNSImplementation
     /*
     MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts constructor
 */
-    MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(void)
-        : m_pTxts(0)
+    MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(void) :
+        m_pTxts(0)
     {
     }
 
     /*
     MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts copy-constructor
 */
-    MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other)
-        : m_pTxts(0)
+    MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other) :
+        m_pTxts(0)
     {
         operator=(p_Other);
     }
@@ -333,8 +333,8 @@ namespace MDNSImplementation
         if (p_pTxt)
         {
             p_pTxt->m_pNext = m_pTxts;
-            m_pTxts = p_pTxt;
-            bResult = true;
+            m_pTxts         = p_pTxt;
+            bResult         = true;
         }
         return bResult;
     }
@@ -374,9 +374,9 @@ namespace MDNSImplementation
 */
     bool MDNSResponder::stcMDNSServiceTxts::removeTempTxts(void)
     {
-        bool bResult = true;
+        bool               bResult = true;
 
-        stcMDNSServiceTxt* pTxt = m_pTxts;
+        stcMDNSServiceTxt* pTxt    = m_pTxts;
         while ((bResult) && (pTxt))
         {
             stcMDNSServiceTxt* pNext = pTxt->m_pNext;
@@ -448,9 +448,9 @@ namespace MDNSImplementation
 */
     uint16_t MDNSResponder::stcMDNSServiceTxts::length(void) const
     {
-        uint16_t u16Length = 0;
+        uint16_t           u16Length = 0;
 
-        stcMDNSServiceTxt* pTxt = m_pTxts;
+        stcMDNSServiceTxt* pTxt      = m_pTxts;
         while (pTxt)
         {
             u16Length += 1;               // Length byte
@@ -479,7 +479,7 @@ namespace MDNSImplementation
 
         if (p_pcBuffer)
         {
-            bResult = true;
+            bResult     = true;
 
             *p_pcBuffer = 0;
             for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
@@ -527,7 +527,7 @@ namespace MDNSImplementation
 
         if (p_pcBuffer)
         {
-            bResult = true;
+            bResult     = true;
 
             *p_pcBuffer = 0;
             for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
@@ -564,13 +564,13 @@ namespace MDNSImplementation
             for (const stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
             {
                 const stcMDNSServiceTxt* pOtherTxt = p_Other.find(pTxt->m_pcKey);
-                bResult = ((pOtherTxt) && (pTxt->m_pcValue) && (pOtherTxt->m_pcValue) && (strlen(pTxt->m_pcValue) == strlen(pOtherTxt->m_pcValue)) && (0 == strcmp(pTxt->m_pcValue, pOtherTxt->m_pcValue)));
+                bResult                            = ((pOtherTxt) && (pTxt->m_pcValue) && (pOtherTxt->m_pcValue) && (strlen(pTxt->m_pcValue) == strlen(pOtherTxt->m_pcValue)) && (0 == strcmp(pTxt->m_pcValue, pOtherTxt->m_pcValue)));
             }
             // Compare B->A
             for (const stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; ((bResult) && (pOtherTxt)); pOtherTxt = pOtherTxt->m_pNext)
             {
                 const stcMDNSServiceTxt* pTxt = find(pOtherTxt->m_pcKey);
-                bResult = ((pTxt) && (pOtherTxt->m_pcValue) && (pTxt->m_pcValue) && (strlen(pOtherTxt->m_pcValue) == strlen(pTxt->m_pcValue)) && (0 == strcmp(pOtherTxt->m_pcValue, pTxt->m_pcValue)));
+                bResult                       = ((pTxt) && (pOtherTxt->m_pcValue) && (pTxt->m_pcValue) && (strlen(pOtherTxt->m_pcValue) == strlen(pTxt->m_pcValue)) && (0 == strcmp(pOtherTxt->m_pcValue, pTxt->m_pcValue)));
             }
         }
         return bResult;
@@ -602,31 +602,25 @@ namespace MDNSImplementation
     /*
     MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader
 */
-    MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader(uint16_t p_u16ID /*= 0*/,
-        bool p_bQR /*= false*/,
-        unsigned char p_ucOpcode /*= 0*/,
-        bool p_bAA /*= false*/,
-        bool p_bTC /*= false*/,
-        bool p_bRD /*= false*/,
-        bool p_bRA /*= false*/,
-        unsigned char p_ucRCode /*= 0*/,
-        uint16_t p_u16QDCount /*= 0*/,
-        uint16_t p_u16ANCount /*= 0*/,
-        uint16_t p_u16NSCount /*= 0*/,
-        uint16_t p_u16ARCount /*= 0*/)
-        : m_u16ID(p_u16ID)
-        , m_1bQR(p_bQR)
-        , m_4bOpcode(p_ucOpcode)
-        , m_1bAA(p_bAA)
-        , m_1bTC(p_bTC)
-        , m_1bRD(p_bRD)
-        , m_1bRA(p_bRA)
-        , m_3bZ(0)
-        , m_4bRCode(p_ucRCode)
-        , m_u16QDCount(p_u16QDCount)
-        , m_u16ANCount(p_u16ANCount)
-        , m_u16NSCount(p_u16NSCount)
-        , m_u16ARCount(p_u16ARCount)
+    MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader(uint16_t      p_u16ID /*= 0*/,
+                                                        bool          p_bQR /*= false*/,
+                                                        unsigned char p_ucOpcode /*= 0*/,
+                                                        bool          p_bAA /*= false*/,
+                                                        bool          p_bTC /*= false*/,
+                                                        bool          p_bRD /*= false*/,
+                                                        bool          p_bRA /*= false*/,
+                                                        unsigned char p_ucRCode /*= 0*/,
+                                                        uint16_t      p_u16QDCount /*= 0*/,
+                                                        uint16_t      p_u16ANCount /*= 0*/,
+                                                        uint16_t      p_u16NSCount /*= 0*/,
+                                                        uint16_t      p_u16ARCount /*= 0*/) :
+        m_u16ID(p_u16ID),
+        m_1bQR(p_bQR), m_4bOpcode(p_ucOpcode), m_1bAA(p_bAA), m_1bTC(p_bTC), m_1bRD(p_bRD),
+        m_1bRA(p_bRA), m_3bZ(0), m_4bRCode(p_ucRCode),
+        m_u16QDCount(p_u16QDCount),
+        m_u16ANCount(p_u16ANCount),
+        m_u16NSCount(p_u16NSCount),
+        m_u16ARCount(p_u16ARCount)
     {
     }
 
@@ -646,8 +640,8 @@ namespace MDNSImplementation
     /*
     MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain constructor
 */
-    MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(void)
-        : m_u16NameLength(0)
+    MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(void) :
+        m_u16NameLength(0)
     {
         clear();
     }
@@ -655,8 +649,8 @@ namespace MDNSImplementation
     /*
     MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain copy-constructor
 */
-    MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other)
-        : m_u16NameLength(0)
+    MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other) :
+        m_u16NameLength(0)
     {
         operator=(p_Other);
     }
@@ -688,13 +682,13 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNS_RRDomain::addLabel
 */
     bool MDNSResponder::stcMDNS_RRDomain::addLabel(const char* p_pcLabel,
-        bool p_bPrependUnderline /*= false*/)
+                                                   bool        p_bPrependUnderline /*= false*/)
     {
-        bool bResult = false;
+        bool   bResult  = false;
 
         size_t stLength = (p_pcLabel
-                ? (strlen(p_pcLabel) + (p_bPrependUnderline ? 1 : 0))
-                : 0);
+                               ? (strlen(p_pcLabel) + (p_bPrependUnderline ? 1 : 0))
+                               : 0);
         if ((MDNS_DOMAIN_LABEL_MAXLENGTH >= stLength) && (MDNS_DOMAIN_MAXLENGTH >= (m_u16NameLength + (1 + stLength))))
         {
             // Length byte
@@ -729,7 +723,7 @@ namespace MDNSImplementation
             const char* pT = m_acName;
             const char* pO = p_Other.m_acName;
             while ((pT) && (pO) && (*((unsigned char*)pT) == *((unsigned char*)pO)) &&  // Same length AND
-                (0 == strncasecmp((pT + 1), (pO + 1), *((unsigned char*)pT))))          // Same content
+                   (0 == strncasecmp((pT + 1), (pO + 1), *((unsigned char*)pT))))       // Same content
             {
                 if (*((unsigned char*)pT))  // Not 0
                 {
@@ -776,7 +770,7 @@ namespace MDNSImplementation
 */
     size_t MDNSResponder::stcMDNS_RRDomain::c_strLength(void) const
     {
-        size_t stLength = 0;
+        size_t         stLength       = 0;
 
         unsigned char* pucLabelLength = (unsigned char*)m_acName;
         while (*pucLabelLength)
@@ -796,7 +790,7 @@ namespace MDNSImplementation
 
         if (p_pcBuffer)
         {
-            *p_pcBuffer = 0;
+            *p_pcBuffer                   = 0;
             unsigned char* pucLabelLength = (unsigned char*)m_acName;
             while (*pucLabelLength)
             {
@@ -821,9 +815,9 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes constructor
 */
     MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(uint16_t p_u16Type /*= 0*/,
-        uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/)
-        : m_u16Type(p_u16Type)
-        , m_u16Class(p_u16Class)
+                                                              uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/) :
+        m_u16Type(p_u16Type),
+        m_u16Class(p_u16Class)
     {
     }
 
@@ -842,7 +836,7 @@ namespace MDNSImplementation
     {
         if (&p_Other != this)
         {
-            m_u16Type = p_Other.m_u16Type;
+            m_u16Type  = p_Other.m_u16Type;
             m_u16Class = p_Other.m_u16Class;
         }
         return *this;
@@ -877,7 +871,7 @@ namespace MDNSImplementation
     {
         if (&p_Other != this)
         {
-            m_Domain = p_Other.m_Domain;
+            m_Domain     = p_Other.m_Domain;
             m_Attributes = p_Other.m_Attributes;
         }
         return *this;
@@ -902,9 +896,9 @@ namespace MDNSImplementation
     /*
     MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion constructor
 */
-    MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion(void)
-        : m_pNext(0)
-        , m_bUnicast(false)
+    MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion(void) :
+        m_pNext(0),
+        m_bUnicast(false)
     {
     }
 
@@ -919,13 +913,13 @@ namespace MDNSImplementation
     /*
     MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer constructor
 */
-    MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer(enuAnswerType p_AnswerType,
-        const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-        : m_pNext(0)
-        , m_AnswerType(p_AnswerType)
-        , m_Header(p_Header)
-        , m_u32TTL(p_u32TTL)
+    MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer(enuAnswerType                          p_AnswerType,
+                                                      const MDNSResponder::stcMDNS_RRHeader& p_Header,
+                                                      uint32_t                               p_u32TTL) :
+        m_pNext(0),
+        m_AnswerType(p_AnswerType),
+        m_Header(p_Header),
+        m_u32TTL(p_u32TTL)
     {
         // Extract 'cache flush'-bit
         m_bCacheFlush = (m_Header.m_Attributes.m_u16Class & 0x8000);
@@ -970,9 +964,9 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA constructor
 */
     MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-        : stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL)
-        , m_IPAddress(0, 0, 0, 0)
+                                                        uint32_t                               p_u32TTL) :
+        stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL),
+        m_IPAddress(0, 0, 0, 0)
     {
     }
 
@@ -1006,8 +1000,8 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR constructor
 */
     MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-        : stcMDNS_RRAnswer(AnswerType_PTR, p_Header, p_u32TTL)
+                                                            uint32_t                               p_u32TTL) :
+        stcMDNS_RRAnswer(AnswerType_PTR, p_Header, p_u32TTL)
     {
     }
 
@@ -1040,8 +1034,8 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT constructor
 */
     MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-        : stcMDNS_RRAnswer(AnswerType_TXT, p_Header, p_u32TTL)
+                                                            uint32_t                               p_u32TTL) :
+        stcMDNS_RRAnswer(AnswerType_TXT, p_Header, p_u32TTL)
     {
     }
 
@@ -1075,8 +1069,8 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA constructor
 */
     MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-        : stcMDNS_RRAnswer(AnswerType_AAAA, p_Header, p_u32TTL)
+                                                              uint32_t                               p_u32TTL) :
+        stcMDNS_RRAnswer(AnswerType_AAAA, p_Header, p_u32TTL)
     {
     }
 
@@ -1109,11 +1103,11 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV constructor
 */
     MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-        : stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL)
-        , m_u16Priority(0)
-        , m_u16Weight(0)
-        , m_u16Port(0)
+                                                            uint32_t                               p_u32TTL) :
+        stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL),
+        m_u16Priority(0),
+        m_u16Weight(0),
+        m_u16Port(0)
     {
     }
 
@@ -1131,8 +1125,8 @@ namespace MDNSImplementation
     bool MDNSResponder::stcMDNS_RRAnswerSRV::clear(void)
     {
         m_u16Priority = 0;
-        m_u16Weight = 0;
-        m_u16Port = 0;
+        m_u16Weight   = 0;
+        m_u16Port     = 0;
         m_SRVDomain.clear();
         return true;
     }
@@ -1149,10 +1143,10 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric constructor
 */
     MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-        : stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL)
-        , m_u16RDLength(0)
-        , m_pu8RDData(0)
+                                                                    uint32_t                p_u32TTL) :
+        stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL),
+        m_u16RDLength(0),
+        m_pu8RDData(0)
     {
     }
 
@@ -1189,14 +1183,14 @@ namespace MDNSImplementation
     /*
     MDNSResponder::stcProbeInformation::stcProbeInformation constructor
 */
-    MDNSResponder::stcProbeInformation::stcProbeInformation(void)
-        : m_ProbingStatus(ProbingStatus_WaitingForData)
-        , m_u8SentCount(0)
-        , m_Timeout(esp8266::polledTimeout::oneShotMs::neverExpires)
-        , m_bConflict(false)
-        , m_bTiebreakNeeded(false)
-        , m_fnHostProbeResultCallback(0)
-        , m_fnServiceProbeResultCallback(0)
+    MDNSResponder::stcProbeInformation::stcProbeInformation(void) :
+        m_ProbingStatus(ProbingStatus_WaitingForData),
+        m_u8SentCount(0),
+        m_Timeout(esp8266::polledTimeout::oneShotMs::neverExpires),
+        m_bConflict(false),
+        m_bTiebreakNeeded(false),
+        m_fnHostProbeResultCallback(0),
+        m_fnServiceProbeResultCallback(0)
     {
     }
 
@@ -1206,13 +1200,13 @@ namespace MDNSImplementation
     bool MDNSResponder::stcProbeInformation::clear(bool p_bClearUserdata /*= false*/)
     {
         m_ProbingStatus = ProbingStatus_WaitingForData;
-        m_u8SentCount = 0;
+        m_u8SentCount   = 0;
         m_Timeout.resetToNeverExpires();
-        m_bConflict = false;
+        m_bConflict       = false;
         m_bTiebreakNeeded = false;
         if (p_bClearUserdata)
         {
-            m_fnHostProbeResultCallback = 0;
+            m_fnHostProbeResultCallback    = 0;
             m_fnServiceProbeResultCallback = 0;
         }
         return true;
@@ -1233,16 +1227,16 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNSService::stcMDNSService constructor
 */
     MDNSResponder::stcMDNSService::stcMDNSService(const char* p_pcName /*= 0*/,
-        const char* p_pcService /*= 0*/,
-        const char* p_pcProtocol /*= 0*/)
-        : m_pNext(0)
-        , m_pcName(0)
-        , m_bAutoName(false)
-        , m_pcService(0)
-        , m_pcProtocol(0)
-        , m_u16Port(0)
-        , m_u8ReplyMask(0)
-        , m_fnTxtCallback(0)
+                                                  const char* p_pcService /*= 0*/,
+                                                  const char* p_pcProtocol /*= 0*/) :
+        m_pNext(0),
+        m_pcName(0),
+        m_bAutoName(false),
+        m_pcService(0),
+        m_pcProtocol(0),
+        m_u16Port(0),
+        m_u8ReplyMask(0),
+        m_fnTxtCallback(0)
     {
         setName(p_pcName);
         setService(p_pcService);
@@ -1464,10 +1458,10 @@ namespace MDNSImplementation
     /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL constructor
 */
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL(void)
-        : m_u32TTL(0)
-        , m_TTLTimeout(esp8266::polledTimeout::oneShotMs::neverExpires)
-        , m_timeoutLevel(TIMEOUTLEVEL_UNSET)
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL(void) :
+        m_u32TTL(0),
+        m_TTLTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
+        m_timeoutLevel(TIMEOUTLEVEL_UNSET)
     {
     }
 
@@ -1549,7 +1543,7 @@ namespace MDNSImplementation
             return (m_u32TTL * 800L);  // to milliseconds
         }
         else if ((TIMEOUTLEVEL_BASE < m_timeoutLevel) &&  // >80% AND
-            (TIMEOUTLEVEL_FINAL >= m_timeoutLevel))       // <= 100%
+                 (TIMEOUTLEVEL_FINAL >= m_timeoutLevel))  // <= 100%
         {
             return (m_u32TTL * 50L);
         }  // else: invalid
@@ -1566,9 +1560,9 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address constructor
 */
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address(IPAddress p_IPAddress,
-        uint32_t p_u32TTL /*= 0*/)
-        : m_pNext(0)
-        , m_IPAddress(p_IPAddress)
+                                                                                uint32_t  p_u32TTL /*= 0*/) :
+        m_pNext(0),
+        m_IPAddress(p_IPAddress)
     {
         m_TTL.set(p_u32TTL);
     }
@@ -1581,20 +1575,17 @@ namespace MDNSImplementation
     /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer constructor
 */
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer(void)
-        : m_pNext(0)
-        , m_pcServiceDomain(0)
-        , m_pcHostDomain(0)
-        , m_u16Port(0)
-        , m_pcTxts(0)
-        ,
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer(void) :
+        m_pNext(0),
+        m_pcServiceDomain(0),
+        m_pcHostDomain(0),
+        m_u16Port(0),
+        m_pcTxts(0),
 #ifdef MDNS_IP4_SUPPORT
-        m_pIP4Addresses(0)
-        ,
+        m_pIP4Addresses(0),
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        m_pIP6Addresses(0)
-        ,
+        m_pIP6Addresses(0),
 #endif
         m_u32ContentFlags(0)
     {
@@ -1615,13 +1606,13 @@ namespace MDNSImplementation
     {
         return ((releaseTxts()) &&
 #ifdef MDNS_IP4_SUPPORT
-            (releaseIP4Addresses()) &&
+                (releaseIP4Addresses()) &&
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            (releaseIP6Addresses())
+                (releaseIP6Addresses())
 #endif
-                (releaseHostDomain())
-            && (releaseServiceDomain()));
+                    (releaseHostDomain())
+                && (releaseServiceDomain()));
     }
 
     /*
@@ -1736,8 +1727,8 @@ namespace MDNSImplementation
         if (p_pIP4Address)
         {
             p_pIP4Address->m_pNext = m_pIP4Addresses;
-            m_pIP4Addresses = p_pIP4Address;
-            bResult = true;
+            m_pIP4Addresses        = p_pIP4Address;
+            bResult                = true;
         }
         return bResult;
     }
@@ -1802,7 +1793,7 @@ namespace MDNSImplementation
 */
     uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount(void) const
     {
-        uint32_t u32Count = 0;
+        uint32_t       u32Count    = 0;
 
         stcIP4Address* pIP4Address = m_pIP4Addresses;
         while (pIP4Address)
@@ -1863,8 +1854,8 @@ namespace MDNSImplementation
         if (p_pIP6Address)
         {
             p_pIP6Address->m_pNext = m_pIP6Addresses;
-            m_pIP6Addresses = p_pIP6Address;
-            bResult = true;
+            m_pIP6Addresses        = p_pIP6Address;
+            bResult                = true;
         }
         return bResult;
     }
@@ -1929,7 +1920,7 @@ namespace MDNSImplementation
 */
     uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount(void) const
     {
-        uint32_t u32Count = 0;
+        uint32_t       u32Count    = 0;
 
         stcIP6Address* pIP6Address = m_pIP6Addresses;
         while (pIP6Address)
@@ -1985,14 +1976,14 @@ namespace MDNSImplementation
     /*
     MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery constructor
 */
-    MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery(void)
-        : m_pNext(0)
-        , m_fnCallback(0)
-        , m_bLegacyQuery(false)
-        , m_u8SentCount(0)
-        , m_ResendTimeout(esp8266::polledTimeout::oneShotMs::neverExpires)
-        , m_bAwaitingAnswers(true)
-        , m_pAnswers(0)
+    MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery(void) :
+        m_pNext(0),
+        m_fnCallback(0),
+        m_bLegacyQuery(false),
+        m_u8SentCount(0),
+        m_ResendTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
+        m_bAwaitingAnswers(true),
+        m_pAnswers(0)
     {
         clear();
     }
@@ -2010,9 +2001,9 @@ namespace MDNSImplementation
 */
     bool MDNSResponder::stcMDNSServiceQuery::clear(void)
     {
-        m_fnCallback = 0;
+        m_fnCallback   = 0;
         m_bLegacyQuery = false;
-        m_u8SentCount = 0;
+        m_u8SentCount  = 0;
         m_ResendTimeout.resetToNeverExpires();
         m_bAwaitingAnswers = true;
         while (m_pAnswers)
@@ -2029,9 +2020,9 @@ namespace MDNSImplementation
 */
     uint32_t MDNSResponder::stcMDNSServiceQuery::answerCount(void) const
     {
-        uint32_t u32Count = 0;
+        uint32_t   u32Count = 0;
 
-        stcAnswer* pAnswer = m_pAnswers;
+        stcAnswer* pAnswer  = m_pAnswers;
         while (pAnswer)
         {
             ++u32Count;
@@ -2091,8 +2082,8 @@ namespace MDNSImplementation
         if (p_pAnswer)
         {
             p_pAnswer->m_pNext = m_pAnswers;
-            m_pAnswers = p_pAnswer;
-            bResult = true;
+            m_pAnswers         = p_pAnswer;
+            bResult            = true;
         }
         return bResult;
     }
@@ -2182,12 +2173,12 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem constructor
 */
     MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem(const void* p_pHostnameOrService,
-        bool p_bAdditionalData,
-        uint32_t p_u16Offset)
-        : m_pNext(0)
-        , m_pHostnameOrService(p_pHostnameOrService)
-        , m_bAdditionalData(p_bAdditionalData)
-        , m_u16Offset(p_u16Offset)
+                                                                                bool        p_bAdditionalData,
+                                                                                uint32_t    p_u16Offset) :
+        m_pNext(0),
+        m_pHostnameOrService(p_pHostnameOrService),
+        m_bAdditionalData(p_bAdditionalData),
+        m_u16Offset(p_u16Offset)
     {
     }
 
@@ -2198,9 +2189,9 @@ namespace MDNSImplementation
     /*
     MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter constructor
 */
-    MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter(void)
-        : m_pQuestions(0)
-        , m_pDomainCacheItems(0)
+    MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter(void) :
+        m_pQuestions(0),
+        m_pDomainCacheItems(0)
     {
         clear();
     }
@@ -2218,17 +2209,17 @@ namespace MDNSImplementation
 */
     bool MDNSResponder::stcMDNSSendParameter::clear(void)
     {
-        m_u16ID = 0;
+        m_u16ID           = 0;
         m_u8HostReplyMask = 0;
-        m_u16Offset = 0;
+        m_u16Offset       = 0;
 
-        m_bLegacyQuery = false;
-        m_bResponse = false;
-        m_bAuthorative = false;
-        m_bUnicast = false;
-        m_bUnannounce = false;
+        m_bLegacyQuery    = false;
+        m_bResponse       = false;
+        m_bAuthorative    = false;
+        m_bUnicast        = false;
+        m_bUnannounce     = false;
 
-        m_bCacheFlush = true;
+        m_bCacheFlush     = true;
 
         while (m_pQuestions)
         {
@@ -2271,16 +2262,16 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNSSendParameter::addDomainCacheItem
 */
     bool MDNSResponder::stcMDNSSendParameter::addDomainCacheItem(const void* p_pHostnameOrService,
-        bool p_bAdditionalData,
-        uint16_t p_u16Offset)
+                                                                 bool        p_bAdditionalData,
+                                                                 uint16_t    p_u16Offset)
     {
-        bool bResult = false;
+        bool                bResult  = false;
 
         stcDomainCacheItem* pNewItem = 0;
         if ((p_pHostnameOrService) && (p_u16Offset) && ((pNewItem = new stcDomainCacheItem(p_pHostnameOrService, p_bAdditionalData, p_u16Offset))))
         {
             pNewItem->m_pNext = m_pDomainCacheItems;
-            bResult = ((m_pDomainCacheItems = pNewItem));
+            bResult           = ((m_pDomainCacheItems = pNewItem));
         }
         return bResult;
     }
@@ -2289,7 +2280,7 @@ namespace MDNSImplementation
     MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset
 */
     uint16_t MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset(const void* p_pHostnameOrService,
-        bool p_bAdditionalData) const
+                                                                         bool        p_bAdditionalData) const
     {
         const stcDomainCacheItem* pCacheItem = m_pDomainCacheItems;
 
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
index 7be63de401..c1eac04946 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
@@ -41,10 +41,10 @@ namespace MDNSImplementation
     /**
     CONST STRINGS
 */
-    static const char* scpcLocal = "local";
+    static const char* scpcLocal    = "local";
     static const char* scpcServices = "services";
-    static const char* scpcDNSSD = "dns-sd";
-    static const char* scpcUDP = "udp";
+    static const char* scpcDNSSD    = "dns-sd";
+    static const char* scpcUDP      = "udp";
     //static const char*                    scpcTCP                 = "tcp";
 
 #ifdef MDNS_IP4_SUPPORT
@@ -72,19 +72,19 @@ namespace MDNSImplementation
     Any reply flags in installed services are removed at the end!
 
 */
-    bool MDNSResponder::_sendMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool               MDNSResponder::_sendMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         bool bResult = true;
 
         if (p_rSendParameter.m_bResponse && p_rSendParameter.m_bUnicast)  // Unicast response  -> Send to querier
         {
             DEBUG_EX_ERR(if (!m_pUDPContext->getRemoteAddress())
-                {
-                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: MISSING remote address for response!\n"));
-                });
+                         {
+                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: MISSING remote address for response!\n"));
+                         });
             IPAddress ipRemote;
             ipRemote = m_pUDPContext->getRemoteAddress();
-            bResult = ((_prepareMDNSMessage(p_rSendParameter, m_pUDPContext->getInputNetif()->ip_addr)) && (m_pUDPContext->sendTimeout(ipRemote, m_pUDPContext->getRemotePort(), MDNS_UDPCONTEXT_TIMEOUT)));
+            bResult  = ((_prepareMDNSMessage(p_rSendParameter, m_pUDPContext->getInputNetif()->ip_addr)) && (m_pUDPContext->sendTimeout(ipRemote, m_pUDPContext->getRemotePort(), MDNS_UDPCONTEXT_TIMEOUT)));
         }
         else  // Multicast response
         {
@@ -98,9 +98,9 @@ namespace MDNSImplementation
         }
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -134,9 +134,9 @@ namespace MDNSImplementation
                 bResult = ((_prepareMDNSMessage(p_rSendParameter, fromIPAddress)) && (m_pUDPContext->sendTimeout(toMulticastAddress, DNS_MQUERY_PORT, MDNS_UDPCONTEXT_TIMEOUT)));
 
                 DEBUG_EX_ERR(if (!bResult)
-                    {
-                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: FAILED!\n"));
-                    });
+                             {
+                                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: FAILED!\n"));
+                             });
             }
         }
         return bResult;
@@ -152,7 +152,7 @@ namespace MDNSImplementation
 
 */
     bool MDNSResponder::_prepareMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter,
-        IPAddress p_IPAddress)
+                                            IPAddress                            p_IPAddress)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage\n")););
         bool bResult = true;
@@ -162,9 +162,9 @@ namespace MDNSImplementation
         stcMDNS_MsgHeader msgHeader(p_rSendParameter.m_u16ID, p_rSendParameter.m_bResponse, 0, p_rSendParameter.m_bAuthorative);
         // If this is a response, the answers are anwers,
         // else this is a query or probe and the answers go into auth section
-        uint16_t& ru16Answers = (p_rSendParameter.m_bResponse
-                ? msgHeader.m_u16ANCount
-                : msgHeader.m_u16NSCount);
+        uint16_t&         ru16Answers = (p_rSendParameter.m_bResponse
+                                             ? msgHeader.m_u16ANCount
+                                             : msgHeader.m_u16NSCount);
 
         /**
         enuSequence
@@ -172,7 +172,7 @@ namespace MDNSImplementation
         enum enuSequence
         {
             Sequence_Count = 0,
-            Sequence_Send = 1
+            Sequence_Send  = 1
         };
 
         // Two step sequence: 'Count' and 'Send'
@@ -182,26 +182,26 @@ namespace MDNSImplementation
                 if (Sequence_Send == sequence)
                 {
                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
-                        (unsigned)msgHeader.m_u16ID,
-                        (unsigned)msgHeader.m_1bQR, (unsigned)msgHeader.m_4bOpcode, (unsigned)msgHeader.m_1bAA, (unsigned)msgHeader.m_1bTC, (unsigned)msgHeader.m_1bRD,
-                        (unsigned)msgHeader.m_1bRA, (unsigned)msgHeader.m_4bRCode,
-                        (unsigned)msgHeader.m_u16QDCount,
-                        (unsigned)msgHeader.m_u16ANCount,
-                        (unsigned)msgHeader.m_u16NSCount,
-                        (unsigned)msgHeader.m_u16ARCount);
+                                          (unsigned)msgHeader.m_u16ID,
+                                          (unsigned)msgHeader.m_1bQR, (unsigned)msgHeader.m_4bOpcode, (unsigned)msgHeader.m_1bAA, (unsigned)msgHeader.m_1bTC, (unsigned)msgHeader.m_1bRD,
+                                          (unsigned)msgHeader.m_1bRA, (unsigned)msgHeader.m_4bRCode,
+                                          (unsigned)msgHeader.m_u16QDCount,
+                                          (unsigned)msgHeader.m_u16ANCount,
+                                          (unsigned)msgHeader.m_u16NSCount,
+                                          (unsigned)msgHeader.m_u16ARCount);
                 });
             // Count/send
             // Header
             bResult = ((Sequence_Count == sequence)
-                    ? true
-                    : _writeMDNSMsgHeader(msgHeader, p_rSendParameter));
+                           ? true
+                           : _writeMDNSMsgHeader(msgHeader, p_rSendParameter));
             DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSMsgHeader FAILED!\n")););
             // Questions
             for (stcMDNS_RRQuestion* pQuestion = p_rSendParameter.m_pQuestions; ((bResult) && (pQuestion)); pQuestion = pQuestion->m_pNext)
             {
                 ((Sequence_Count == sequence)
-                        ? ++msgHeader.m_u16QDCount
-                        : (bResult = _writeMDNSQuestion(*pQuestion, p_rSendParameter)));
+                     ? ++msgHeader.m_u16QDCount
+                     : (bResult = _writeMDNSQuestion(*pQuestion, p_rSendParameter)));
                 DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSQuestion FAILED!\n")););
             }
 
@@ -210,15 +210,15 @@ namespace MDNSImplementation
             if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_A))
             {
                 ((Sequence_Count == sequence)
-                        ? ++ru16Answers
-                        : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
+                     ? ++ru16Answers
+                     : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
                 DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(A) FAILED!\n")););
             }
             if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP4))
             {
                 ((Sequence_Count == sequence)
-                        ? ++ru16Answers
-                        : (bResult = _writeMDNSAnswer_PTR_IP4(p_IPAddress, p_rSendParameter)));
+                     ? ++ru16Answers
+                     : (bResult = _writeMDNSAnswer_PTR_IP4(p_IPAddress, p_rSendParameter)));
                 DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP4 FAILED!\n")););
             }
 #endif
@@ -226,15 +226,15 @@ namespace MDNSImplementation
             if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA))
             {
                 ((Sequence_Count == sequence)
-                        ? ++ru16Answers
-                        : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
+                     ? ++ru16Answers
+                     : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
                 DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(A) FAILED!\n")););
             }
             if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP6))
             {
                 ((Sequence_Count == sequence)
-                        ? ++ru16Answers
-                        : (bResult = _writeMDNSAnswer_PTR_IP6(p_IPAddress, p_rSendParameter)));
+                     ? ++ru16Answers
+                     : (bResult = _writeMDNSAnswer_PTR_IP6(p_IPAddress, p_rSendParameter)));
                 DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP6 FAILED!\n")););
             }
 #endif
@@ -244,29 +244,29 @@ namespace MDNSImplementation
                 if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_TYPE))
                 {
                     ((Sequence_Count == sequence)
-                            ? ++ru16Answers
-                            : (bResult = _writeMDNSAnswer_PTR_TYPE(*pService, p_rSendParameter)));
+                         ? ++ru16Answers
+                         : (bResult = _writeMDNSAnswer_PTR_TYPE(*pService, p_rSendParameter)));
                     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_TYPE FAILED!\n")););
                 }
                 if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME))
                 {
                     ((Sequence_Count == sequence)
-                            ? ++ru16Answers
-                            : (bResult = _writeMDNSAnswer_PTR_NAME(*pService, p_rSendParameter)));
+                         ? ++ru16Answers
+                         : (bResult = _writeMDNSAnswer_PTR_NAME(*pService, p_rSendParameter)));
                     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_NAME FAILED!\n")););
                 }
                 if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_SRV))
                 {
                     ((Sequence_Count == sequence)
-                            ? ++ru16Answers
-                            : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
+                         ? ++ru16Answers
+                         : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
                     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(A) FAILED!\n")););
                 }
                 if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_TXT))
                 {
                     ((Sequence_Count == sequence)
-                            ? ++ru16Answers
-                            : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
+                         ? ++ru16Answers
+                         : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
                     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(A) FAILED!\n")););
                 }
             }  // for services
@@ -284,16 +284,16 @@ namespace MDNSImplementation
                     (!(pService->m_u8ReplyMask & ContentFlag_SRV)))                   // NOT SRV -> add SRV as additional answer
                 {
                     ((Sequence_Count == sequence)
-                            ? ++msgHeader.m_u16ARCount
-                            : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
+                         ? ++msgHeader.m_u16ARCount
+                         : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
                     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(B) FAILED!\n")););
                 }
                 if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) &&  // If PTR_NAME is requested, AND
                     (!(pService->m_u8ReplyMask & ContentFlag_TXT)))                   // NOT TXT -> add TXT as additional answer
                 {
                     ((Sequence_Count == sequence)
-                            ? ++msgHeader.m_u16ARCount
-                            : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
+                         ? ++msgHeader.m_u16ARCount
+                         : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
                     DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(B) FAILED!\n")););
                 }
                 if ((pService->m_u8ReplyMask & (ContentFlag_PTR_NAME | ContentFlag_SRV)) ||     // If service instance name or SRV OR
@@ -319,8 +319,8 @@ namespace MDNSImplementation
             if ((bResult) && (bNeedsAdditionalAnswerA))
             {
                 ((Sequence_Count == sequence)
-                        ? ++msgHeader.m_u16ARCount
-                        : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
+                     ? ++msgHeader.m_u16ARCount
+                     : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
                 DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(B) FAILED!\n")););
             }
 #endif
@@ -329,8 +329,8 @@ namespace MDNSImplementation
             if ((bResult) && (bNeedsAdditionalAnswerAAAA))
             {
                 ((Sequence_Count == sequence)
-                        ? ++msgHeader.m_u16ARCount
-                        : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
+                     ? ++msgHeader.m_u16ARCount
+                     : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
                 DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(B) FAILED!\n")););
             }
 #endif
@@ -358,17 +358,17 @@ namespace MDNSImplementation
 
 */
     bool MDNSResponder::_sendMDNSQuery(const MDNSResponder::stcMDNS_RRDomain& p_QueryDomain,
-        uint16_t p_u16QueryType,
-        stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers /*= 0*/)
+                                       uint16_t                               p_u16QueryType,
+                                       stcMDNSServiceQuery::stcAnswer*        p_pKnownAnswers /*= 0*/)
     {
-        bool bResult = false;
+        bool                 bResult = false;
 
         stcMDNSSendParameter sendParameter;
         if (0 != ((sendParameter.m_pQuestions = new stcMDNS_RRQuestion)))
         {
-            sendParameter.m_pQuestions->m_Header.m_Domain = p_QueryDomain;
+            sendParameter.m_pQuestions->m_Header.m_Domain                = p_QueryDomain;
 
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = p_u16QueryType;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type  = p_u16QueryType;
             // It seems, that some mDNS implementations don't support 'unicast response' questions...
             sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (/*0x8000 |*/ DNS_RRCLASS_IN);  // /*Unicast &*/ INternet
 
@@ -413,9 +413,9 @@ namespace MDNSImplementation
                 DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X %s\n"), (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Type, (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Class, (p_rRRQuestion.m_bUnicast ? "Unicast" : "Multicast")););
         }
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -434,11 +434,11 @@ namespace MDNSImplementation
     {
         //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer\n")););
 
-        bool bResult = false;
+        bool             bResult = false;
 
         stcMDNS_RRHeader header;
-        uint32_t u32TTL;
-        uint16_t u16RDLength;
+        uint32_t         u32TTL;
+        uint16_t         u16RDLength;
         if ((_readRRHeader(header)) && (_udpRead32(u32TTL)) && (_udpRead16(u16RDLength)))
         {
             /*  DEBUG_EX_INFO(
@@ -452,30 +452,30 @@ namespace MDNSImplementation
 #ifdef MDNS_IP4_SUPPORT
             case DNS_RRTYPE_A:
                 p_rpRRAnswer = new stcMDNS_RRAnswerA(header, u32TTL);
-                bResult = _readRRAnswerA(*(stcMDNS_RRAnswerA*&)p_rpRRAnswer, u16RDLength);
+                bResult      = _readRRAnswerA(*(stcMDNS_RRAnswerA*&)p_rpRRAnswer, u16RDLength);
                 break;
 #endif
             case DNS_RRTYPE_PTR:
                 p_rpRRAnswer = new stcMDNS_RRAnswerPTR(header, u32TTL);
-                bResult = _readRRAnswerPTR(*(stcMDNS_RRAnswerPTR*&)p_rpRRAnswer, u16RDLength);
+                bResult      = _readRRAnswerPTR(*(stcMDNS_RRAnswerPTR*&)p_rpRRAnswer, u16RDLength);
                 break;
             case DNS_RRTYPE_TXT:
                 p_rpRRAnswer = new stcMDNS_RRAnswerTXT(header, u32TTL);
-                bResult = _readRRAnswerTXT(*(stcMDNS_RRAnswerTXT*&)p_rpRRAnswer, u16RDLength);
+                bResult      = _readRRAnswerTXT(*(stcMDNS_RRAnswerTXT*&)p_rpRRAnswer, u16RDLength);
                 break;
 #ifdef MDNS_IP6_SUPPORT
             case DNS_RRTYPE_AAAA:
                 p_rpRRAnswer = new stcMDNS_RRAnswerAAAA(header, u32TTL);
-                bResult = _readRRAnswerAAAA(*(stcMDNS_RRAnswerAAAA*&)p_rpRRAnswer, u16RDLength);
+                bResult      = _readRRAnswerAAAA(*(stcMDNS_RRAnswerAAAA*&)p_rpRRAnswer, u16RDLength);
                 break;
 #endif
             case DNS_RRTYPE_SRV:
                 p_rpRRAnswer = new stcMDNS_RRAnswerSRV(header, u32TTL);
-                bResult = _readRRAnswerSRV(*(stcMDNS_RRAnswerSRV*&)p_rpRRAnswer, u16RDLength);
+                bResult      = _readRRAnswerSRV(*(stcMDNS_RRAnswerSRV*&)p_rpRRAnswer, u16RDLength);
                 break;
             default:
                 p_rpRRAnswer = new stcMDNS_RRAnswerGeneric(header, u32TTL);
-                bResult = _readRRAnswerGeneric(*(stcMDNS_RRAnswerGeneric*&)p_rpRRAnswer, u16RDLength);
+                bResult      = _readRRAnswerGeneric(*(stcMDNS_RRAnswerGeneric*&)p_rpRRAnswer, u16RDLength);
                 break;
             }
             DEBUG_EX_INFO(
@@ -498,7 +498,7 @@ namespace MDNSImplementation
                     case DNS_RRTYPE_TXT:
                     {
                         size_t stTxtLength = ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_strLength();
-                        char* pTxts = new char[stTxtLength];
+                        char*  pTxts       = new char[stTxtLength];
                         if (pTxts)
                         {
                             ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_str(pTxts);
@@ -535,10 +535,10 @@ namespace MDNSImplementation
     MDNSResponder::_readRRAnswerA
 */
     bool MDNSResponder::_readRRAnswerA(MDNSResponder::stcMDNS_RRAnswerA& p_rRRAnswerA,
-        uint16_t p_u16RDLength)
+                                       uint16_t                          p_u16RDLength)
     {
         uint32_t u32IP4Address;
-        bool bResult = ((MDNS_IP4_SIZE == p_u16RDLength) && (_udpReadBuffer((unsigned char*)&u32IP4Address, MDNS_IP4_SIZE)) && ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IP4Address))));
+        bool     bResult = ((MDNS_IP4_SIZE == p_u16RDLength) && (_udpReadBuffer((unsigned char*)&u32IP4Address, MDNS_IP4_SIZE)) && ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IP4Address))));
         DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerA: FAILED!\n")););
         return bResult;
     }
@@ -548,7 +548,7 @@ namespace MDNSImplementation
     MDNSResponder::_readRRAnswerPTR
 */
     bool MDNSResponder::_readRRAnswerPTR(MDNSResponder::stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
-        uint16_t p_u16RDLength)
+                                         uint16_t                            p_u16RDLength)
     {
         bool bResult = ((p_u16RDLength) && (_readRRDomain(p_rRRAnswerPTR.m_PTRDomain)));
         DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerPTR: FAILED!\n")););
@@ -561,7 +561,7 @@ namespace MDNSImplementation
     Read TXT items from a buffer like 4c#=15ff=20
 */
     bool MDNSResponder::_readRRAnswerTXT(MDNSResponder::stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
-        uint16_t p_u16RDLength)
+                                         uint16_t                            p_u16RDLength)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: RDLength:%u\n"), p_u16RDLength););
         bool bResult = true;
@@ -569,36 +569,36 @@ namespace MDNSImplementation
         p_rRRAnswerTXT.clear();
         if (p_u16RDLength)
         {
-            bResult = false;
+            bResult                  = false;
 
             unsigned char* pucBuffer = new unsigned char[p_u16RDLength];
             if (pucBuffer)
             {
                 if (_udpReadBuffer(pucBuffer, p_u16RDLength))
                 {
-                    bResult = true;
+                    bResult                        = true;
 
                     const unsigned char* pucCursor = pucBuffer;
                     while ((pucCursor < (pucBuffer + p_u16RDLength)) && (bResult))
                     {
-                        bResult = false;
+                        bResult                     = false;
 
-                        stcMDNSServiceTxt* pTxt = 0;
-                        unsigned char ucLength = *pucCursor++;  // Length of the next txt item
+                        stcMDNSServiceTxt* pTxt     = 0;
+                        unsigned char      ucLength = *pucCursor++;  // Length of the next txt item
                         if (ucLength)
                         {
                             DEBUG_EX_INFO(
-                                static char sacBuffer[64]; *sacBuffer = 0;
-                                uint8_t u8MaxLength = ((ucLength > (sizeof(sacBuffer) - 1)) ? (sizeof(sacBuffer) - 1) : ucLength);
+                                static char sacBuffer[64]; *sacBuffer                                              = 0;
+                                uint8_t     u8MaxLength                                                            = ((ucLength > (sizeof(sacBuffer) - 1)) ? (sizeof(sacBuffer) - 1) : ucLength);
                                 os_strncpy(sacBuffer, (const char*)pucCursor, u8MaxLength); sacBuffer[u8MaxLength] = 0;
                                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: Item(%u): %s\n"), ucLength, sacBuffer););
 
                             unsigned char* pucEqualSign = (unsigned char*)os_strchr((const char*)pucCursor, '=');  // Position of the '=' sign
-                            unsigned char ucKeyLength;
+                            unsigned char  ucKeyLength;
                             if ((pucEqualSign) && ((ucKeyLength = (pucEqualSign - pucCursor))))
                             {
                                 unsigned char ucValueLength = (ucLength - (pucEqualSign - pucCursor + 1));
-                                bResult = (((pTxt = new stcMDNSServiceTxt)) && (pTxt->setKey((const char*)pucCursor, ucKeyLength)) && (pTxt->setValue((const char*)(pucEqualSign + 1), ucValueLength)));
+                                bResult                     = (((pTxt = new stcMDNSServiceTxt)) && (pTxt->setKey((const char*)pucCursor, ucKeyLength)) && (pTxt->setValue((const char*)(pucEqualSign + 1), ucValueLength)));
                             }
                             else
                             {
@@ -615,7 +615,7 @@ namespace MDNSImplementation
                         if ((bResult) && (pTxt))  // Everything is fine so far
                         {
                             // Link TXT item to answer TXTs
-                            pTxt->m_pNext = p_rRRAnswerTXT.m_Txts.m_pTxts;
+                            pTxt->m_pNext                 = p_rRRAnswerTXT.m_Txts.m_pTxts;
                             p_rRRAnswerTXT.m_Txts.m_pTxts = pTxt;
                         }
                         else  // At least no TXT (might be OK, if length was 0) OR an error
@@ -667,7 +667,7 @@ namespace MDNSImplementation
 
 #ifdef MDNS_IP6_SUPPORT
     bool MDNSResponder::_readRRAnswerAAAA(MDNSResponder::stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
-        uint16_t p_u16RDLength)
+                                          uint16_t                             p_u16RDLength)
     {
         bool bResult = false;
         // TODO: Implement
@@ -679,7 +679,7 @@ namespace MDNSImplementation
     MDNSResponder::_readRRAnswerSRV
 */
     bool MDNSResponder::_readRRAnswerSRV(MDNSResponder::stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
-        uint16_t p_u16RDLength)
+                                         uint16_t                            p_u16RDLength)
     {
         bool bResult = (((3 * sizeof(uint16_t)) < p_u16RDLength) && (_udpRead16(p_rRRAnswerSRV.m_u16Priority)) && (_udpRead16(p_rRRAnswerSRV.m_u16Weight)) && (_udpRead16(p_rRRAnswerSRV.m_u16Port)) && (_readRRDomain(p_rRRAnswerSRV.m_SRVDomain)));
         DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerSRV: FAILED!\n")););
@@ -690,7 +690,7 @@ namespace MDNSImplementation
     MDNSResponder::_readRRAnswerGeneric
 */
     bool MDNSResponder::_readRRAnswerGeneric(MDNSResponder::stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
-        uint16_t p_u16RDLength)
+                                             uint16_t                                p_u16RDLength)
     {
         bool bResult = (0 == p_u16RDLength);
 
@@ -739,7 +739,7 @@ namespace MDNSImplementation
 
 */
     bool MDNSResponder::_readRRDomain_Loop(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain,
-        uint8_t p_u8Depth)
+                                           uint8_t                          p_u8Depth)
     {
         //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u)\n"), p_u8Depth););
 
@@ -747,7 +747,7 @@ namespace MDNSImplementation
 
         if (MDNS_DOMAIN_MAX_REDIRCTION >= p_u8Depth)
         {
-            bResult = true;
+            bResult       = true;
 
             uint8_t u8Len = 0;
             do
@@ -846,8 +846,8 @@ namespace MDNSImplementation
     Builds a MDNS host domain (eg. esp8266.local) for the given hostname.
 
 */
-    bool MDNSResponder::_buildDomainForHost(const char* p_pcHostname,
-        MDNSResponder::stcMDNS_RRDomain& p_rHostDomain) const
+    bool MDNSResponder::_buildDomainForHost(const char*                      p_pcHostname,
+                                            MDNSResponder::stcMDNS_RRDomain& p_rHostDomain) const
     {
         p_rHostDomain.clear();
         bool bResult = ((p_pcHostname) && (*p_pcHostname) && (p_rHostDomain.addLabel(p_pcHostname)) && (p_rHostDomain.addLabel(scpcLocal)) && (p_rHostDomain.addLabel(0)));
@@ -878,8 +878,8 @@ namespace MDNSImplementation
 
 */
     bool MDNSResponder::_buildDomainForService(const MDNSResponder::stcMDNSService& p_Service,
-        bool p_bIncludeName,
-        MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
+                                               bool                                 p_bIncludeName,
+                                               MDNSResponder::stcMDNS_RRDomain&     p_rServiceDomain) const
     {
         p_rServiceDomain.clear();
         bool bResult = (((!p_bIncludeName) || (p_rServiceDomain.addLabel(p_Service.m_pcName))) && (p_rServiceDomain.addLabel(p_Service.m_pcService, true)) && (p_rServiceDomain.addLabel(p_Service.m_pcProtocol, true)) && (p_rServiceDomain.addLabel(scpcLocal)) && (p_rServiceDomain.addLabel(0)));
@@ -894,9 +894,9 @@ namespace MDNSImplementation
     The usual prepended '_' are added, if missing in the input strings.
 
 */
-    bool MDNSResponder::_buildDomainForService(const char* p_pcService,
-        const char* p_pcProtocol,
-        MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
+    bool MDNSResponder::_buildDomainForService(const char*                      p_pcService,
+                                               const char*                      p_pcProtocol,
+                                               MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
     {
         p_rServiceDomain.clear();
         bool bResult = ((p_pcService) && (p_pcProtocol) && (p_rServiceDomain.addLabel(p_pcService, ('_' != *p_pcService))) && (p_rServiceDomain.addLabel(p_pcProtocol, ('_' != *p_pcProtocol))) && (p_rServiceDomain.addLabel(scpcLocal)) && (p_rServiceDomain.addLabel(0)));
@@ -912,8 +912,8 @@ namespace MDNSImplementation
     and adding 'in-addr.arpa' (eg. 012.789.456.123.in-addr.arpa).
     Used while detecting reverse IP4 questions and answering these
 */
-    bool MDNSResponder::_buildDomainForReverseIP4(IPAddress p_IP4Address,
-        MDNSResponder::stcMDNS_RRDomain& p_rReverseIP4Domain) const
+    bool MDNSResponder::_buildDomainForReverseIP4(IPAddress                        p_IP4Address,
+                                                  MDNSResponder::stcMDNS_RRDomain& p_rReverseIP4Domain) const
     {
         bool bResult = true;
 
@@ -937,8 +937,8 @@ namespace MDNSImplementation
 
     Used while detecting reverse IP6 questions and answering these
 */
-    bool MDNSResponder::_buildDomainForReverseIP6(IPAddress p_IP4Address,
-        MDNSResponder::stcMDNS_RRDomain& p_rReverseIP6Domain) const
+    bool MDNSResponder::_buildDomainForReverseIP6(IPAddress                        p_IP4Address,
+                                                  MDNSResponder::stcMDNS_RRDomain& p_rReverseIP6Domain) const
     {
         // TODO: Implement
         return false;
@@ -953,13 +953,13 @@ namespace MDNSImplementation
     MDNSResponder::_udpReadBuffer
 */
     bool MDNSResponder::_udpReadBuffer(unsigned char* p_pBuffer,
-        size_t p_stLength)
+                                       size_t         p_stLength)
     {
         bool bResult = ((m_pUDPContext) && (true /*m_pUDPContext->getSize() > p_stLength*/) && (p_pBuffer) && (p_stLength) && ((p_stLength == m_pUDPContext->read((char*)p_pBuffer, p_stLength))));
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpReadBuffer: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpReadBuffer: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -981,7 +981,7 @@ namespace MDNSImplementation
         if (_udpReadBuffer((unsigned char*)&p_ru16Value, sizeof(p_ru16Value)))
         {
             p_ru16Value = lwip_ntohs(p_ru16Value);
-            bResult = true;
+            bResult     = true;
         }
         return bResult;
     }
@@ -996,7 +996,7 @@ namespace MDNSImplementation
         if (_udpReadBuffer((unsigned char*)&p_ru32Value, sizeof(p_ru32Value)))
         {
             p_ru32Value = lwip_ntohl(p_ru32Value);
-            bResult = true;
+            bResult     = true;
         }
         return bResult;
     }
@@ -1005,13 +1005,13 @@ namespace MDNSImplementation
     MDNSResponder::_udpAppendBuffer
 */
     bool MDNSResponder::_udpAppendBuffer(const unsigned char* p_pcBuffer,
-        size_t p_stLength)
+                                         size_t               p_stLength)
     {
         bool bResult = ((m_pUDPContext) && (p_pcBuffer) && (p_stLength) && (p_stLength == m_pUDPContext->append((const char*)p_pcBuffer, p_stLength)));
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpAppendBuffer: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpAppendBuffer: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -1047,12 +1047,12 @@ namespace MDNSImplementation
 */
     bool MDNSResponder::_udpDump(bool p_bMovePointer /*= false*/)
     {
-        const uint8_t cu8BytesPerLine = 16;
+        const uint8_t cu8BytesPerLine  = 16;
 
-        uint32_t u32StartPosition = m_pUDPContext->tell();
+        uint32_t      u32StartPosition = m_pUDPContext->tell();
         DEBUG_OUTPUT.println("UDP Context Dump:");
         uint32_t u32Counter = 0;
-        uint8_t u8Byte = 0;
+        uint8_t  u8Byte     = 0;
 
         while (_udpRead8(u8Byte))
         {
@@ -1071,7 +1071,7 @@ namespace MDNSImplementation
     MDNSResponder::_udpDump
 */
     bool MDNSResponder::_udpDump(unsigned p_uOffset,
-        unsigned p_uLength)
+                                 unsigned p_uLength)
     {
         if ((m_pUDPContext) && (m_pUDPContext->isValidOffset(p_uOffset)))
         {
@@ -1109,21 +1109,21 @@ namespace MDNSImplementation
 */
     bool MDNSResponder::_readMDNSMsgHeader(MDNSResponder::stcMDNS_MsgHeader& p_rMsgHeader)
     {
-        bool bResult = false;
+        bool    bResult = false;
 
         uint8_t u8B1;
         uint8_t u8B2;
         if ((_udpRead16(p_rMsgHeader.m_u16ID)) && (_udpRead8(u8B1)) && (_udpRead8(u8B2)) && (_udpRead16(p_rMsgHeader.m_u16QDCount)) && (_udpRead16(p_rMsgHeader.m_u16ANCount)) && (_udpRead16(p_rMsgHeader.m_u16NSCount)) && (_udpRead16(p_rMsgHeader.m_u16ARCount)))
         {
-            p_rMsgHeader.m_1bQR = (u8B1 & 0x80);      // Query/Respond flag
+            p_rMsgHeader.m_1bQR     = (u8B1 & 0x80);  // Query/Respond flag
             p_rMsgHeader.m_4bOpcode = (u8B1 & 0x78);  // Operation code (0: Standard query, others ignored)
-            p_rMsgHeader.m_1bAA = (u8B1 & 0x04);      // Authoritative answer
-            p_rMsgHeader.m_1bTC = (u8B1 & 0x02);      // Truncation flag
-            p_rMsgHeader.m_1bRD = (u8B1 & 0x01);      // Recursion desired
+            p_rMsgHeader.m_1bAA     = (u8B1 & 0x04);  // Authoritative answer
+            p_rMsgHeader.m_1bTC     = (u8B1 & 0x02);  // Truncation flag
+            p_rMsgHeader.m_1bRD     = (u8B1 & 0x01);  // Recursion desired
 
-            p_rMsgHeader.m_1bRA = (u8B2 & 0x80);     // Recursion available
-            p_rMsgHeader.m_3bZ = (u8B2 & 0x70);      // Zero
-            p_rMsgHeader.m_4bRCode = (u8B2 & 0x0F);  // Response code
+            p_rMsgHeader.m_1bRA     = (u8B2 & 0x80);  // Recursion available
+            p_rMsgHeader.m_3bZ      = (u8B2 & 0x70);  // Zero
+            p_rMsgHeader.m_4bRCode  = (u8B2 & 0x0F);  // Response code
 
             /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
                 (unsigned)p_rMsgHeader.m_u16ID,
@@ -1133,20 +1133,20 @@ namespace MDNSImplementation
                 (unsigned)p_rMsgHeader.m_u16ANCount,
                 (unsigned)p_rMsgHeader.m_u16NSCount,
                 (unsigned)p_rMsgHeader.m_u16ARCount););*/
-            bResult = true;
+            bResult                 = true;
         }
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: FAILED!\n"));
+                     });
         return bResult;
     }
 
     /*
     MDNSResponder::_write8
 */
-    bool MDNSResponder::_write8(uint8_t p_u8Value,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool MDNSResponder::_write8(uint8_t                              p_u8Value,
+                                MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         return ((_udpAppend8(p_u8Value)) && (p_rSendParameter.shiftOffset(sizeof(p_u8Value))));
     }
@@ -1154,8 +1154,8 @@ namespace MDNSImplementation
     /*
     MDNSResponder::_write16
 */
-    bool MDNSResponder::_write16(uint16_t p_u16Value,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool MDNSResponder::_write16(uint16_t                             p_u16Value,
+                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         return ((_udpAppend16(p_u16Value)) && (p_rSendParameter.shiftOffset(sizeof(p_u16Value))));
     }
@@ -1163,8 +1163,8 @@ namespace MDNSImplementation
     /*
     MDNSResponder::_write32
 */
-    bool MDNSResponder::_write32(uint32_t p_u32Value,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool MDNSResponder::_write32(uint32_t                             p_u32Value,
+                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         return ((_udpAppend32(p_u32Value)) && (p_rSendParameter.shiftOffset(sizeof(p_u32Value))));
     }
@@ -1179,7 +1179,7 @@ namespace MDNSImplementation
     need some mapping here
 */
     bool MDNSResponder::_writeMDNSMsgHeader(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+                                            MDNSResponder::stcMDNSSendParameter&    p_rSendParameter)
     {
         /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
             (unsigned)p_MsgHeader.m_u16ID,
@@ -1192,12 +1192,12 @@ namespace MDNSImplementation
 
         uint8_t u8B1((p_MsgHeader.m_1bQR << 7) | (p_MsgHeader.m_4bOpcode << 3) | (p_MsgHeader.m_1bAA << 2) | (p_MsgHeader.m_1bTC << 1) | (p_MsgHeader.m_1bRD));
         uint8_t u8B2((p_MsgHeader.m_1bRA << 7) | (p_MsgHeader.m_3bZ << 4) | (p_MsgHeader.m_4bRCode));
-        bool bResult = ((_write16(p_MsgHeader.m_u16ID, p_rSendParameter)) && (_write8(u8B1, p_rSendParameter)) && (_write8(u8B2, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter)));
+        bool    bResult = ((_write16(p_MsgHeader.m_u16ID, p_rSendParameter)) && (_write8(u8B1, p_rSendParameter)) && (_write8(u8B2, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter)));
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -1205,14 +1205,14 @@ namespace MDNSImplementation
     MDNSResponder::_writeRRAttributes
 */
     bool MDNSResponder::_writeMDNSRRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Attributes,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+                                               MDNSResponder::stcMDNSSendParameter&       p_rSendParameter)
     {
         bool bResult = ((_write16(p_Attributes.m_u16Type, p_rSendParameter)) && (_write16(p_Attributes.m_u16Class, p_rSendParameter)));
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRAttributes: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRAttributes: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -1220,14 +1220,14 @@ namespace MDNSImplementation
     MDNSResponder::_writeMDNSRRDomain
 */
     bool MDNSResponder::_writeMDNSRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_Domain,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+                                           MDNSResponder::stcMDNSSendParameter&   p_rSendParameter)
     {
         bool bResult = ((_udpAppendBuffer((const unsigned char*)p_Domain.m_acName, p_Domain.m_u16NameLength)) && (p_rSendParameter.shiftOffset(p_Domain.m_u16NameLength)));
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRDomain: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRDomain: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -1246,29 +1246,29 @@ namespace MDNSImplementation
     and written to the output buffer.
 
 */
-    bool MDNSResponder::_writeMDNSHostDomain(const char* p_pcHostname,
-        bool p_bPrependRDLength,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool MDNSResponder::_writeMDNSHostDomain(const char*                          p_pcHostname,
+                                             bool                                 p_bPrependRDLength,
+                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
-        uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostname, false);
+        uint16_t         u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostname, false);
 
         stcMDNS_RRDomain hostDomain;
-        bool bResult = (u16CachedDomainOffset
-                // Found cached domain -> mark as compressed domain
-                ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
-                    ((!p_bPrependRDLength) || (_write16(2, p_rSendParameter))) &&                                // Length of 'Cxxx'
-                    (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&   // Compression mark (and offset)
-                    (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
-                // No cached domain -> add this domain to cache and write full domain name
-                : ((_buildDomainForHost(p_pcHostname, hostDomain)) &&                                       // eg. esp8266.local
-                    ((!p_bPrependRDLength) || (_write16(hostDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
-                    (p_rSendParameter.addDomainCacheItem((const void*)p_pcHostname, false, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(hostDomain, p_rSendParameter))));
+        bool             bResult = (u16CachedDomainOffset
+                            // Found cached domain -> mark as compressed domain
+                                        ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
+                               ((!p_bPrependRDLength) || (_write16(2, p_rSendParameter))) &&                                 // Length of 'Cxxx'
+                               (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&    // Compression mark (and offset)
+                               (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
+                            // No cached domain -> add this domain to cache and write full domain name
+                                        : ((_buildDomainForHost(p_pcHostname, hostDomain)) &&                                      // eg. esp8266.local
+                               ((!p_bPrependRDLength) || (_write16(hostDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
+                               (p_rSendParameter.addDomainCacheItem((const void*)p_pcHostname, false, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(hostDomain, p_rSendParameter))));
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSHostDomain: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSHostDomain: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -1285,29 +1285,29 @@ namespace MDNSImplementation
 
 */
     bool MDNSResponder::_writeMDNSServiceDomain(const MDNSResponder::stcMDNSService& p_Service,
-        bool p_bIncludeName,
-        bool p_bPrependRDLength,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+                                                bool                                 p_bIncludeName,
+                                                bool                                 p_bPrependRDLength,
+                                                MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
-        uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName);
+        uint16_t         u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName);
 
         stcMDNS_RRDomain serviceDomain;
-        bool bResult = (u16CachedDomainOffset
-                // Found cached domain -> mark as compressed domain
-                ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
-                    ((!p_bPrependRDLength) || (_write16(2, p_rSendParameter))) &&                                // Length of 'Cxxx'
-                    (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&   // Compression mark (and offset)
-                    (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
-                // No cached domain -> add this domain to cache and write full domain name
-                : ((_buildDomainForService(p_Service, p_bIncludeName, serviceDomain)) &&                       // eg. MyESP._http._tcp.local
-                    ((!p_bPrependRDLength) || (_write16(serviceDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
-                    (p_rSendParameter.addDomainCacheItem((const void*)&p_Service, p_bIncludeName, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(serviceDomain, p_rSendParameter))));
+        bool             bResult = (u16CachedDomainOffset
+                            // Found cached domain -> mark as compressed domain
+                                        ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
+                               ((!p_bPrependRDLength) || (_write16(2, p_rSendParameter))) &&                                 // Length of 'Cxxx'
+                               (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&    // Compression mark (and offset)
+                               (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
+                            // No cached domain -> add this domain to cache and write full domain name
+                                        : ((_buildDomainForService(p_Service, p_bIncludeName, serviceDomain)) &&                      // eg. MyESP._http._tcp.local
+                               ((!p_bPrependRDLength) || (_write16(serviceDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
+                               (p_rSendParameter.addDomainCacheItem((const void*)&p_Service, p_bIncludeName, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(serviceDomain, p_rSendParameter))));
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSServiceDomain: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSServiceDomain: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -1321,17 +1321,17 @@ namespace MDNSImplementation
     QCLASS (16bit, eg. IN)
 
 */
-    bool MDNSResponder::_writeMDNSQuestion(MDNSResponder::stcMDNS_RRQuestion& p_Question,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool MDNSResponder::_writeMDNSQuestion(MDNSResponder::stcMDNS_RRQuestion&   p_Question,
+                                           MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion\n")););
 
         bool bResult = ((_writeMDNSRRDomain(p_Question.m_Header.m_Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(p_Question.m_Header.m_Attributes, p_rSendParameter)));
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -1351,24 +1351,24 @@ namespace MDNSImplementation
     eg. esp8266.local A 0x8001 120 4 123.456.789.012
     Ref: http://www.zytrax.com/books/dns/ch8/a.html
 */
-    bool MDNSResponder::_writeMDNSAnswer_A(IPAddress p_IPAddress,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool MDNSResponder::_writeMDNSAnswer_A(IPAddress                            p_IPAddress,
+                                           MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A (%s)\n"), p_IPAddress.toString().c_str()););
 
         stcMDNS_RRAttributes attributes(DNS_RRTYPE_A,
-            ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
-        const unsigned char aucIPAddress[MDNS_IP4_SIZE] = { p_IPAddress[0], p_IPAddress[1], p_IPAddress[2], p_IPAddress[3] };
-        bool bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
-            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                                   // TTL
-            (_write16(MDNS_IP4_SIZE, p_rSendParameter)) &&                                                                                          // RDLength
-            (_udpAppendBuffer(aucIPAddress, MDNS_IP4_SIZE)) &&                                                                                      // RData
-            (p_rSendParameter.shiftOffset(MDNS_IP4_SIZE)));
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+        const unsigned char  aucIPAddress[MDNS_IP4_SIZE] = { p_IPAddress[0], p_IPAddress[1], p_IPAddress[2], p_IPAddress[3] };
+        bool                 bResult                     = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                       // TTL
+                        (_write16(MDNS_IP4_SIZE, p_rSendParameter)) &&                                                                              // RDLength
+                        (_udpAppendBuffer(aucIPAddress, MDNS_IP4_SIZE)) &&                                                                          // RData
+                        (p_rSendParameter.shiftOffset(MDNS_IP4_SIZE)));
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -1381,24 +1381,24 @@ namespace MDNSImplementation
     eg. 012.789.456.123.in-addr.arpa PTR 0x8001 120 15 esp8266.local
     Used while answering reverse IP4 questions
 */
-    bool MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress p_IPAddress,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress                            p_IPAddress,
+                                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4 (%s)\n"), p_IPAddress.toString().c_str()););
 
-        stcMDNS_RRDomain reverseIP4Domain;
+        stcMDNS_RRDomain     reverseIP4Domain;
         stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
-            ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
-        stcMDNS_RRDomain hostDomain;
-        bool bResult = ((_buildDomainForReverseIP4(p_IPAddress, reverseIP4Domain)) &&                                              // 012.789.456.123.in-addr.arpa
-            (_writeMDNSRRDomain(reverseIP4Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
-            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                  // TTL
-            (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                                                         // RDLength & RData (host domain, eg. esp8266.local)
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+        stcMDNS_RRDomain     hostDomain;
+        bool                 bResult = ((_buildDomainForReverseIP4(p_IPAddress, reverseIP4Domain)) &&                                                          // 012.789.456.123.in-addr.arpa
+                        (_writeMDNSRRDomain(reverseIP4Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                  // TTL
+                        (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                                                         // RDLength & RData (host domain, eg. esp8266.local)
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4: FAILED!\n"));
+                     });
         return bResult;
     }
 #endif
@@ -1413,23 +1413,23 @@ namespace MDNSImplementation
     eg. _services._dns-sd._udp.local PTR 0x8001 5400 xx _http._tcp.local
     http://www.zytrax.com/books/dns/ch8/ptr.html
 */
-    bool MDNSResponder::_writeMDNSAnswer_PTR_TYPE(MDNSResponder::stcMDNSService& p_rService,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool MDNSResponder::_writeMDNSAnswer_PTR_TYPE(MDNSResponder::stcMDNSService&       p_rService,
+                                                  MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE\n")););
 
-        stcMDNS_RRDomain dnssdDomain;
-        stcMDNS_RRDomain serviceDomain;
-        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);                                                      // No cache flush! only INternet
-        bool bResult = ((_buildDomainForDNSSD(dnssdDomain)) &&                                                                // _services._dns-sd._udp.local
-            (_writeMDNSRRDomain(dnssdDomain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
-            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&                          // TTL
-            (_writeMDNSServiceDomain(p_rService, false, true, p_rSendParameter)));                                            // RDLength & RData (service domain, eg. _http._tcp.local)
+        stcMDNS_RRDomain     dnssdDomain;
+        stcMDNS_RRDomain     serviceDomain;
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);                                                                                  // No cache flush! only INternet
+        bool                 bResult = ((_buildDomainForDNSSD(dnssdDomain)) &&                                                                            // _services._dns-sd._udp.local
+                        (_writeMDNSRRDomain(dnssdDomain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&                          // TTL
+                        (_writeMDNSServiceDomain(p_rService, false, true, p_rSendParameter)));                                            // RDLength & RData (service domain, eg. _http._tcp.local)
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -1443,21 +1443,21 @@ namespace MDNSImplementation
     eg. _http.tcp.local PTR 0x8001 120 xx myESP._http._tcp.local
     http://www.zytrax.com/books/dns/ch8/ptr.html
 */
-    bool MDNSResponder::_writeMDNSAnswer_PTR_NAME(MDNSResponder::stcMDNSService& p_rService,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool MDNSResponder::_writeMDNSAnswer_PTR_NAME(MDNSResponder::stcMDNSService&       p_rService,
+                                                  MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME\n")););
 
-        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);                              // No cache flush! only INternet
-        bool bResult = ((_writeMDNSServiceDomain(p_rService, false, false, p_rSendParameter)) &&      // _http._tcp.local
-            (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
-            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
-            (_writeMDNSServiceDomain(p_rService, true, true, p_rSendParameter)));                     // RDLength & RData (service domain, eg. MyESP._http._tcp.local)
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);                                                          // No cache flush! only INternet
+        bool                 bResult = ((_writeMDNSServiceDomain(p_rService, false, false, p_rSendParameter)) &&                  // _http._tcp.local
+                        (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
+                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
+                        (_writeMDNSServiceDomain(p_rService, true, true, p_rSendParameter)));                     // RDLength & RData (service domain, eg. MyESP._http._tcp.local)
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -1472,15 +1472,15 @@ namespace MDNSImplementation
     eg. myESP._http._tcp.local TXT 0x8001 120 4 c#=1
     http://www.zytrax.com/books/dns/ch8/txt.html
 */
-    bool MDNSResponder::_writeMDNSAnswer_TXT(MDNSResponder::stcMDNSService& p_rService,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool MDNSResponder::_writeMDNSAnswer_TXT(MDNSResponder::stcMDNSService&       p_rService,
+                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT\n")););
 
-        bool bResult = false;
+        bool                 bResult = false;
 
         stcMDNS_RRAttributes attributes(DNS_RRTYPE_TXT,
-            ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
 
         if ((_collectServiceTxts(p_rService)) && (_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&  // MyESP._http._tcp.local
             (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                                     // TYPE & CLASS
@@ -1492,24 +1492,24 @@ namespace MDNSImplementation
             for (stcMDNSServiceTxt* pTxt = p_rService.m_Txts.m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
             {
                 unsigned char ucLengthByte = pTxt->length();
-                bResult = ((_udpAppendBuffer((unsigned char*)&ucLengthByte, sizeof(ucLengthByte))) &&                                                                                           // Length
-                    (p_rSendParameter.shiftOffset(sizeof(ucLengthByte))) && ((size_t)os_strlen(pTxt->m_pcKey) == m_pUDPContext->append(pTxt->m_pcKey, os_strlen(pTxt->m_pcKey))) &&             // Key
-                    (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcKey))) && (1 == m_pUDPContext->append("=", 1)) &&                                                                 // =
-                    (p_rSendParameter.shiftOffset(1)) && ((!pTxt->m_pcValue) || (((size_t)os_strlen(pTxt->m_pcValue) == m_pUDPContext->append(pTxt->m_pcValue, os_strlen(pTxt->m_pcValue))) &&  // Value
-                                                              (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcValue))))));
+                bResult                    = ((_udpAppendBuffer((unsigned char*)&ucLengthByte, sizeof(ucLengthByte))) &&                                                                                                  // Length
+                           (p_rSendParameter.shiftOffset(sizeof(ucLengthByte))) && ((size_t)os_strlen(pTxt->m_pcKey) == m_pUDPContext->append(pTxt->m_pcKey, os_strlen(pTxt->m_pcKey))) &&             // Key
+                           (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcKey))) && (1 == m_pUDPContext->append("=", 1)) &&                                                                 // =
+                           (p_rSendParameter.shiftOffset(1)) && ((!pTxt->m_pcValue) || (((size_t)os_strlen(pTxt->m_pcValue) == m_pUDPContext->append(pTxt->m_pcValue, os_strlen(pTxt->m_pcValue))) &&  // Value
+                                                                                        (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcValue))))));
 
                 DEBUG_EX_ERR(if (!bResult)
-                    {
-                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED to write %sTxt %s=%s!\n"), (pTxt->m_bTemp ? "temp. " : ""), (pTxt->m_pcKey ?: "?"), (pTxt->m_pcValue ?: "?"));
-                    });
+                             {
+                                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED to write %sTxt %s=%s!\n"), (pTxt->m_bTemp ? "temp. " : ""), (pTxt->m_pcKey ?: "?"), (pTxt->m_pcValue ?: "?"));
+                             });
             }
         }
         _releaseTempServiceTxts(p_rService);
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -1523,23 +1523,23 @@ namespace MDNSImplementation
     eg. esp8266.local AAAA 0x8001 120 16 xxxx::xx
     http://www.zytrax.com/books/dns/ch8/aaaa.html
 */
-    bool MDNSResponder::_writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool MDNSResponder::_writeMDNSAnswer_AAAA(IPAddress                            p_IPAddress,
+                                              MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA\n")););
 
         stcMDNS_RRAttributes attributes(DNS_RRTYPE_AAAA,
-            ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));                          // Cache flush? & INternet
-        bool bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) &&                // esp8266.local
-            (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                   // TYPE & CLASS
-            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&       // TTL
-            (_write16(MDNS_IP6_SIZE, p_rSendParameter)) &&                                              // RDLength
-            (false /*TODO: IP6 version of: _udpAppendBuffer((uint32_t)p_IPAddress, MDNS_IP4_SIZE)*/));  // RData
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));                          // Cache flush? & INternet
+        bool                 bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) &&                            // esp8266.local
+                        (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                   // TYPE & CLASS
+                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&       // TTL
+                        (_write16(MDNS_IP6_SIZE, p_rSendParameter)) &&                                              // RDLength
+                        (false /*TODO: IP6 version of: _udpAppendBuffer((uint32_t)p_IPAddress, MDNS_IP4_SIZE)*/));  // RData
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA: FAILED!\n"));
+                     });
         return bResult;
     }
 
@@ -1552,23 +1552,23 @@ namespace MDNSImplementation
     eg. xxxx::xx.in6.arpa PTR 0x8001 120 15 esp8266.local
     Used while answering reverse IP6 questions
 */
-    bool MDNSResponder::_writeMDNSAnswer_PTR_IP6(IPAddress p_IPAddress,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool MDNSResponder::_writeMDNSAnswer_PTR_IP6(IPAddress                            p_IPAddress,
+                                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6\n")););
 
-        stcMDNS_RRDomain reverseIP6Domain;
+        stcMDNS_RRDomain     reverseIP6Domain;
         stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
-            ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));                                                     // Cache flush? & INternet
-        bool bResult = ((_buildDomainForReverseIP6(p_IPAddress, reverseIP6Domain)) &&                                              // xxxx::xx.ip6.arpa
-            (_writeMDNSRRDomain(reverseIP6Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
-            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                  // TTL
-            (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                                                         // RDLength & RData (host domain, eg. esp8266.local)
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));                                                     // Cache flush? & INternet
+        bool                 bResult = ((_buildDomainForReverseIP6(p_IPAddress, reverseIP6Domain)) &&                                                          // xxxx::xx.ip6.arpa
+                        (_writeMDNSRRDomain(reverseIP6Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                  // TTL
+                        (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                                                         // RDLength & RData (host domain, eg. esp8266.local)
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6: FAILED!\n"));
+                     });
         return bResult;
     }
 #endif
@@ -1579,47 +1579,47 @@ namespace MDNSImplementation
     eg. MyESP._http.tcp.local SRV 0x8001 120 0 0 60068 esp8266.local
     http://www.zytrax.com/books/dns/ch8/srv.html ???? Include instance name ????
 */
-    bool MDNSResponder::_writeMDNSAnswer_SRV(MDNSResponder::stcMDNSService& p_rService,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool MDNSResponder::_writeMDNSAnswer_SRV(MDNSResponder::stcMDNSService&       p_rService,
+                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV\n")););
 
-        uint16_t u16CachedDomainOffset = (p_rSendParameter.m_bLegacyQuery
-                ? 0
-                : p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostname, false));
+        uint16_t             u16CachedDomainOffset = (p_rSendParameter.m_bLegacyQuery
+                                                          ? 0
+                                                          : p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostname, false));
 
         stcMDNS_RRAttributes attributes(DNS_RRTYPE_SRV,
-            ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
-        stcMDNS_RRDomain hostDomain;
-        bool bResult = ((_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&       // MyESP._http._tcp.local
-            (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
-            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
-            (!u16CachedDomainOffset
-                    // No cache for domain name (or no compression allowed)
-                    ? ((_buildDomainForHost(m_pcHostname, hostDomain)) && (_write16((sizeof(uint16_t /*Prio*/) +  // RDLength
-                                                                                        sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + hostDomain.m_u16NameLength),
-                           p_rSendParameter))
-                        &&                                                                                                                                                            // Domain length
-                        (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&                                                                                                            // Priority
-                        (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                                                                                              // Weight
-                        (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                                                                                         // Port
-                        (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostname, false, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(hostDomain, p_rSendParameter)))  // Host, eg. esp8266.local
-                    // Cache available for domain
-                    : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
-                        (_write16((sizeof(uint16_t /*Prio*/) +                                                       // RDLength
-                                      sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + 2),
-                            p_rSendParameter))
-                        &&                                                                                          // Length of 'C0xx'
-                        (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&                                          // Priority
-                        (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                            // Weight
-                        (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                       // Port
-                        (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&  // Compression mark (and offset)
-                        (_write8((uint8_t)u16CachedDomainOffset, p_rSendParameter)))));                             // Offset
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+        stcMDNS_RRDomain     hostDomain;
+        bool                 bResult = ((_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&                   // MyESP._http._tcp.local
+                        (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
+                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
+                        (!u16CachedDomainOffset
+                             // No cache for domain name (or no compression allowed)
+                                             ? ((_buildDomainForHost(m_pcHostname, hostDomain)) && (_write16((sizeof(uint16_t /*Prio*/) +  // RDLength
+                                                                                              sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + hostDomain.m_u16NameLength),
+                                                                                             p_rSendParameter))
+                                &&                                                                                                                                                            // Domain length
+                                (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&                                                                                                            // Priority
+                                (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                                                                                              // Weight
+                                (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                                                                                         // Port
+                                (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostname, false, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(hostDomain, p_rSendParameter)))  // Host, eg. esp8266.local
+                             // Cache available for domain
+                                             : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
+                                (_write16((sizeof(uint16_t /*Prio*/) +                                                        // RDLength
+                                           sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + 2),
+                                          p_rSendParameter))
+                                &&                                                                                          // Length of 'C0xx'
+                                (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&                                          // Priority
+                                (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                            // Weight
+                                (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                       // Port
+                                (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&  // Compression mark (and offset)
+                                (_write8((uint8_t)u16CachedDomainOffset, p_rSendParameter)))));                             // Offset
 
         DEBUG_EX_ERR(if (!bResult)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV: FAILED!\n"));
-            });
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV: FAILED!\n"));
+                     });
         return bResult;
     }
 
diff --git a/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino b/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino
index 16139c5d22..1c7c7dca22 100644
--- a/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino
+++ b/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino
@@ -9,28 +9,33 @@
 
 #include <I2S.h>
 
-void setup() {
+void setup()
+{
   // Open serial communications and wait for port to open:
   // A baud rate of 115200 is used instead of 9600 for a faster data rate
   // on non-native USB ports
   Serial.begin(115200);
-  while (!Serial) {
-    ; // wait for serial port to connect. Needed for native USB port only
+  while (!Serial)
+  {
+    ;  // wait for serial port to connect. Needed for native USB port only
   }
 
   // start I2S at 8 kHz with 24-bits per sample
-  if (!I2S.begin(I2S_PHILIPS_MODE, 8000, 24)) {
+  if (!I2S.begin(I2S_PHILIPS_MODE, 8000, 24))
+  {
     Serial.println("Failed to initialize I2S!");
     while (1)
-      ; // do nothing
+      ;  // do nothing
   }
 }
 
-void loop() {
+void loop()
+{
   // read a sample
   int sample = I2S.read();
 
-  if (sample) {
+  if (sample)
+  {
     // if it's non-zero print value to serial
     Serial.println(sample);
   }
diff --git a/libraries/I2S/examples/SimpleTone/SimpleTone.ino b/libraries/I2S/examples/SimpleTone/SimpleTone.ino
index 5825ba12ca..a7ad2b5195 100644
--- a/libraries/I2S/examples/SimpleTone/SimpleTone.ino
+++ b/libraries/I2S/examples/SimpleTone/SimpleTone.ino
@@ -10,29 +10,33 @@
 
 #include <I2S.h>
 
-const int frequency = 440; // frequency of square wave in Hz
-const int amplitude = 500; // amplitude of square wave
-const int sampleRate = 8000; // sample rate in Hz
+const int frequency      = 440;   // frequency of square wave in Hz
+const int amplitude      = 500;   // amplitude of square wave
+const int sampleRate     = 8000;  // sample rate in Hz
 
-const int halfWavelength = (sampleRate / frequency); // half wavelength of square wave
+const int halfWavelength = (sampleRate / frequency);  // half wavelength of square wave
 
-short sample = amplitude; // current sample value
-int count = 0;
+short     sample         = amplitude;  // current sample value
+int       count          = 0;
 
-void setup() {
+void      setup()
+{
   Serial.begin(115200);
   Serial.println("I2S simple tone");
 
   // start I2S at the sample rate with 16-bits per sample
-  if (!I2S.begin(I2S_PHILIPS_MODE, sampleRate, 16)) {
+  if (!I2S.begin(I2S_PHILIPS_MODE, sampleRate, 16))
+  {
     Serial.println("Failed to initialize I2S!");
     while (1)
-      ; // do nothing
+      ;  // do nothing
   }
 }
 
-void loop() {
-  if (count % halfWavelength == 0) {
+void loop()
+{
+  if (count % halfWavelength == 0)
+  {
     // invert the sample every half wavelength count multiple to generate square wave
     sample = -1 * sample;
   }
diff --git a/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino b/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
index b7a2f0c5e4..4ee3f3b424 100644
--- a/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
+++ b/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
@@ -12,18 +12,20 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* pass = STAPSK;
+const char* ssid        = STASSID;
+const char* pass        = STAPSK;
 
-long timezone = 2;
-byte daysavetime = 1;
+long        timezone    = 2;
+byte        daysavetime = 1;
 
-void listDir(const char* dirname) {
+void        listDir(const char* dirname)
+{
   Serial.printf("Listing directory: %s\n", dirname);
 
   Dir root = LittleFS.openDir(dirname);
 
-  while (root.next()) {
+  while (root.next())
+  {
     File file = root.openFile("r");
     Serial.print("  FILE: ");
     Serial.print(root.fileName());
@@ -39,74 +41,96 @@ void listDir(const char* dirname) {
   }
 }
 
-void readFile(const char* path) {
+void readFile(const char* path)
+{
   Serial.printf("Reading file: %s\n", path);
 
   File file = LittleFS.open(path, "r");
-  if (!file) {
+  if (!file)
+  {
     Serial.println("Failed to open file for reading");
     return;
   }
 
   Serial.print("Read from file: ");
-  while (file.available()) {
+  while (file.available())
+  {
     Serial.write(file.read());
   }
   file.close();
 }
 
-void writeFile(const char* path, const char* message) {
+void writeFile(const char* path, const char* message)
+{
   Serial.printf("Writing file: %s\n", path);
 
   File file = LittleFS.open(path, "w");
-  if (!file) {
+  if (!file)
+  {
     Serial.println("Failed to open file for writing");
     return;
   }
-  if (file.print(message)) {
+  if (file.print(message))
+  {
     Serial.println("File written");
-  } else {
+  }
+  else
+  {
     Serial.println("Write failed");
   }
-  delay(2000); // Make sure the CREATE and LASTWRITE times are different
+  delay(2000);  // Make sure the CREATE and LASTWRITE times are different
   file.close();
 }
 
-void appendFile(const char* path, const char* message) {
+void appendFile(const char* path, const char* message)
+{
   Serial.printf("Appending to file: %s\n", path);
 
   File file = LittleFS.open(path, "a");
-  if (!file) {
+  if (!file)
+  {
     Serial.println("Failed to open file for appending");
     return;
   }
-  if (file.print(message)) {
+  if (file.print(message))
+  {
     Serial.println("Message appended");
-  } else {
+  }
+  else
+  {
     Serial.println("Append failed");
   }
   file.close();
 }
 
-void renameFile(const char* path1, const char* path2) {
+void renameFile(const char* path1, const char* path2)
+{
   Serial.printf("Renaming file %s to %s\n", path1, path2);
-  if (LittleFS.rename(path1, path2)) {
+  if (LittleFS.rename(path1, path2))
+  {
     Serial.println("File renamed");
-  } else {
+  }
+  else
+  {
     Serial.println("Rename failed");
   }
 }
 
-void deleteFile(const char* path) {
+void deleteFile(const char* path)
+{
   Serial.printf("Deleting file: %s\n", path);
-  if (LittleFS.remove(path)) {
+  if (LittleFS.remove(path))
+  {
     Serial.println("File deleted");
-  } else {
+  }
+  else
+  {
     Serial.println("Delete failed");
   }
 }
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   // We start by connecting to a WiFi network
   Serial.println();
@@ -116,7 +140,8 @@ void setup() {
 
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -134,7 +159,8 @@ void setup() {
   Serial.println("Formatting LittleFS filesystem");
   LittleFS.format();
   Serial.println("Mount LittleFS");
-  if (!LittleFS.begin()) {
+  if (!LittleFS.begin())
+  {
     Serial.println("LittleFS mount failed");
     return;
   }
@@ -150,7 +176,8 @@ void setup() {
   Serial.println("Timestamp should be valid, data should be good.");
   LittleFS.end();
   Serial.println("Now mount it");
-  if (!LittleFS.begin()) {
+  if (!LittleFS.begin())
+  {
     Serial.println("LittleFS mount failed");
     return;
   }
diff --git a/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino b/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
index 1c631e309c..43b648a0fb 100644
--- a/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
+++ b/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
@@ -15,48 +15,64 @@
 #define TESTSIZEKB 512
 
 // Format speed in bytes/second.  Static buffer so not re-entrant safe
-const char* rate(unsigned long start, unsigned long stop, unsigned long bytes) {
+const char* rate(unsigned long start, unsigned long stop, unsigned long bytes)
+{
   static char buff[64];
-  if (stop == start) {
+  if (stop == start)
+  {
     strcpy_P(buff, PSTR("Inf b/s"));
-  } else {
+  }
+  else
+  {
     unsigned long delta = stop - start;
-    float r = 1000.0 * (float)bytes / (float)delta;
-    if (r >= 1000000.0) {
+    float         r     = 1000.0 * (float)bytes / (float)delta;
+    if (r >= 1000000.0)
+    {
       sprintf_P(buff, PSTR("%0.2f MB/s"), r / 1000000.0);
-    } else if (r >= 1000.0) {
+    }
+    else if (r >= 1000.0)
+    {
       sprintf_P(buff, PSTR("%0.2f KB/s"), r / 1000.0);
-    } else {
+    }
+    else
+    {
       sprintf_P(buff, PSTR("%d bytes/s"), (int)r);
     }
   }
   return buff;
 }
 
-void DoTest(FS* fs) {
-  if (!fs->format()) {
+void DoTest(FS* fs)
+{
+  if (!fs->format())
+  {
     Serial.printf("Unable to format(), aborting\n");
     return;
   }
-  if (!fs->begin()) {
+  if (!fs->begin())
+  {
     Serial.printf("Unable to begin(), aborting\n");
     return;
   }
 
   uint8_t data[256];
-  for (int i = 0; i < 256; i++) {
+  for (int i = 0; i < 256; i++)
+  {
     data[i] = (uint8_t)i;
   }
 
   Serial.printf("Creating %dKB file, may take a while...\n", TESTSIZEKB);
   unsigned long start = millis();
-  File f = fs->open("/testwrite.bin", "w");
-  if (!f) {
+  File          f     = fs->open("/testwrite.bin", "w");
+  if (!f)
+  {
     Serial.printf("Unable to open file for writing, aborting\n");
     return;
   }
-  for (int i = 0; i < TESTSIZEKB; i++) {
-    for (int j = 0; j < 4; j++) {
+  for (int i = 0; i < TESTSIZEKB; i++)
+  {
+    for (int j = 0; j < 4; j++)
+    {
       f.write(data, 256);
     }
   }
@@ -70,9 +86,11 @@ void DoTest(FS* fs) {
 
   Serial.printf("Reading %dKB file sequentially in 256b chunks\n", TESTSIZEKB);
   start = millis();
-  f = fs->open("/testwrite.bin", "r");
-  for (int i = 0; i < TESTSIZEKB; i++) {
-    for (int j = 0; j < 4; j++) {
+  f     = fs->open("/testwrite.bin", "r");
+  for (int i = 0; i < TESTSIZEKB; i++)
+  {
+    for (int j = 0; j < 4; j++)
+    {
       f.read(data, 256);
     }
   }
@@ -82,10 +100,12 @@ void DoTest(FS* fs) {
 
   Serial.printf("Reading %dKB file MISALIGNED in flash and RAM sequentially in 256b chunks\n", TESTSIZEKB);
   start = millis();
-  f = fs->open("/testwrite.bin", "r");
+  f     = fs->open("/testwrite.bin", "r");
   f.read();
-  for (int i = 0; i < TESTSIZEKB; i++) {
-    for (int j = 0; j < 4; j++) {
+  for (int i = 0; i < TESTSIZEKB; i++)
+  {
+    for (int j = 0; j < 4; j++)
+    {
       f.read(data + 1, 256);
     }
   }
@@ -95,14 +115,18 @@ void DoTest(FS* fs) {
 
   Serial.printf("Reading %dKB file in reverse by 256b chunks\n", TESTSIZEKB);
   start = millis();
-  f = fs->open("/testwrite.bin", "r");
-  for (int i = 0; i < TESTSIZEKB; i++) {
-    for (int j = 0; j < 4; j++) {
-      if (!f.seek(256 + 256 * j * i, SeekEnd)) {
+  f     = fs->open("/testwrite.bin", "r");
+  for (int i = 0; i < TESTSIZEKB; i++)
+  {
+    for (int j = 0; j < 4; j++)
+    {
+      if (!f.seek(256 + 256 * j * i, SeekEnd))
+      {
         Serial.printf("Unable to seek to %d, aborting\n", -256 - 256 * j * i);
         return;
       }
-      if (256 != f.read(data, 256)) {
+      if (256 != f.read(data, 256))
+      {
         Serial.printf("Unable to read 256 bytes, aborting\n");
         return;
       }
@@ -114,8 +138,9 @@ void DoTest(FS* fs) {
 
   Serial.printf("Writing 64K file in 1-byte chunks\n");
   start = millis();
-  f = fs->open("/test1b.bin", "w");
-  for (int i = 0; i < 65536; i++) {
+  f     = fs->open("/test1b.bin", "w");
+  for (int i = 0; i < 65536; i++)
+  {
     f.write((uint8_t*)&i, 1);
   }
   f.close();
@@ -124,8 +149,9 @@ void DoTest(FS* fs) {
 
   Serial.printf("Reading 64K file in 1-byte chunks\n");
   start = millis();
-  f = fs->open("/test1b.bin", "r");
-  for (int i = 0; i < 65536; i++) {
+  f     = fs->open("/test1b.bin", "r");
+  for (int i = 0; i < 65536; i++)
+  {
     char c;
     f.read((uint8_t*)&c, 1);
   }
@@ -133,9 +159,9 @@ void DoTest(FS* fs) {
   stop = millis();
   Serial.printf("==> Time to read 64KB in 1b chunks = %lu milliseconds = %s\n", stop - start, rate(start, stop, 65536));
 
-  start = millis();
-  auto dest = fs->open("/test1bw.bin", "w");
-  f = fs->open("/test1b.bin", "r");
+  start         = millis();
+  auto dest     = fs->open("/test1bw.bin", "w");
+  f             = fs->open("/test1b.bin", "r");
   auto copysize = f.sendAll(dest);
   dest.close();
   stop = millis();
@@ -143,7 +169,8 @@ void DoTest(FS* fs) {
   f.close();
 }
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   Serial.printf("Beginning test\n");
   Serial.flush();
@@ -151,6 +178,7 @@ void setup() {
   Serial.println("done");
 }
 
-void loop() {
+void loop()
+{
   delay(10000);
 }
diff --git a/libraries/Netdump/examples/Netdump/Netdump.ino b/libraries/Netdump/examples/Netdump/Netdump.ino
index 0251fe2fd1..931fa14f17 100644
--- a/libraries/Netdump/examples/Netdump/Netdump.ino
+++ b/libraries/Netdump/examples/Netdump/Netdump.ino
@@ -15,109 +15,124 @@ using namespace NetCapture;
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char*               ssid     = STASSID;
+const char*               password = STAPSK;
 
-Netdump nd;
+Netdump                   nd;
 
 //FS* filesystem = &SPIFFS;
-FS* filesystem = &LittleFS;
+FS*                       filesystem = &LittleFS;
 
-ESP8266WebServer webServer(80); // Used for sending commands
-WiFiServer tcpServer(8000); // Used to show netcat option.
-File tracefile;
+ESP8266WebServer          webServer(80);    // Used for sending commands
+WiFiServer                tcpServer(8000);  // Used to show netcat option.
+File                      tracefile;
 
 std::map<PacketType, int> packetCount;
 
-enum class SerialOption : uint8_t {
+enum class SerialOption : uint8_t
+{
   AllFull,
   LocalNone,
   HTTPChar
 };
 
-void startSerial(SerialOption option) {
-  switch (option) {
-    case SerialOption::AllFull: //All Packets, show packet summary.
+void startSerial(SerialOption option)
+{
+  switch (option)
+  {
+    case SerialOption::AllFull:  //All Packets, show packet summary.
       nd.printDump(Serial, Packet::PacketDetail::FULL);
       break;
 
-    case SerialOption::LocalNone: // Only local IP traffic, full details
+    case SerialOption::LocalNone:  // Only local IP traffic, full details
       nd.printDump(Serial, Packet::PacketDetail::NONE,
-          [](Packet n) {
-            return (n.hasIP(WiFi.localIP()));
-          });
+                   [](Packet n)
+                   {
+                     return (n.hasIP(WiFi.localIP()));
+                   });
       break;
-    case SerialOption::HTTPChar: // Only HTTP traffic, show packet content as chars
+    case SerialOption::HTTPChar:  // Only HTTP traffic, show packet content as chars
       nd.printDump(Serial, Packet::PacketDetail::CHAR,
-          [](Packet n) {
-            return (n.isHTTP());
-          });
+                   [](Packet n)
+                   {
+                     return (n.isHTTP());
+                   });
       break;
     default:
       Serial.printf("No valid SerialOption provided\r\n");
   };
 }
 
-void startTracefile() {
+void startTracefile()
+{
   // To file all traffic, format pcap file
   tracefile = filesystem->open("/tr.pcap", "w");
   nd.fileDump(tracefile);
 }
 
-void startTcpDump() {
+void startTcpDump()
+{
   // To tcpserver, all traffic.
   tcpServer.begin();
   nd.tcpDump(tcpServer);
 }
 
-void setup(void) {
+void setup(void)
+{
   Serial.begin(115200);
 
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
 
-  if (WiFi.waitForConnectResult() != WL_CONNECTED) {
+  if (WiFi.waitForConnectResult() != WL_CONNECTED)
+  {
     Serial.println("WiFi Failed, stopping sketch");
-    while (1) {
+    while (1)
+    {
       delay(1000);
     }
   }
 
-  if (!MDNS.begin("netdumphost")) {
+  if (!MDNS.begin("netdumphost"))
+  {
     Serial.println("Error setting up MDNS responder!");
   }
 
   filesystem->begin();
 
   webServer.on("/list",
-      []() {
-        Dir dir = filesystem->openDir("/");
-        String d = "<h1>File list</h1>";
-        while (dir.next()) {
-          d.concat("<li>" + dir.fileName() + "</li>");
-        }
-        webServer.send(200, "text.html", d);
-      });
+               []()
+               {
+                 Dir    dir = filesystem->openDir("/");
+                 String d   = "<h1>File list</h1>";
+                 while (dir.next())
+                 {
+                   d.concat("<li>" + dir.fileName() + "</li>");
+                 }
+                 webServer.send(200, "text.html", d);
+               });
 
   webServer.on("/req",
-      []() {
-        static int rq = 0;
-        String a = "<h1>You are connected, Number of requests = " + String(rq++) + "</h1>";
-        webServer.send(200, "text/html", a);
-      });
+               []()
+               {
+                 static int rq = 0;
+                 String     a  = "<h1>You are connected, Number of requests = " + String(rq++) + "</h1>";
+                 webServer.send(200, "text/html", a);
+               });
 
   webServer.on("/reset",
-      []() {
-        nd.reset();
-        tracefile.close();
-        tcpServer.close();
-        webServer.send(200, "text.html", "<h1>Netdump session reset</h1>");
-      });
+               []()
+               {
+                 nd.reset();
+                 tracefile.close();
+                 tcpServer.close();
+                 webServer.send(200, "text.html", "<h1>Netdump session reset</h1>");
+               });
 
   webServer.serveStatic("/", *filesystem, "/");
   webServer.begin();
 
-  startSerial(SerialOption::AllFull); // Serial output examples, use enum SerialOption for selection
+  startSerial(SerialOption::AllFull);  // Serial output examples, use enum SerialOption for selection
 
   //  startTcpDump();     // tcpdump option
   //  startTracefile();  // output to SPIFFS or LittleFS
@@ -144,7 +159,8 @@ void setup(void) {
   */
 }
 
-void loop(void) {
+void loop(void)
+{
   webServer.handleClient();
   MDNS.update();
 }
diff --git a/libraries/Netdump/src/Netdump.cpp b/libraries/Netdump/src/Netdump.cpp
index 57898f0ee1..f14b4bb9a0 100644
--- a/libraries/Netdump/src/Netdump.cpp
+++ b/libraries/Netdump/src/Netdump.cpp
@@ -50,7 +50,7 @@ void Netdump::setCallback(const Callback nc)
 
 void Netdump::setCallback(const Callback nc, const Filter nf)
 {
-    netDumpFilter = nf;
+    netDumpFilter   = nf;
     netDumpCallback = nc;
 }
 
@@ -68,16 +68,16 @@ void Netdump::printDump(Print& out, Packet::PacketDetail ndd, const Filter nf)
 {
     out.printf_P(PSTR("netDump starting\r\n"));
     setCallback([&out, ndd, this](const Packet& ndp)
-        { printDumpProcess(out, ndd, ndp); },
-        nf);
+                { printDumpProcess(out, ndd, ndp); },
+                nf);
 }
 
 void Netdump::fileDump(File& outfile, const Filter nf)
 {
     writePcapHeader(outfile);
     setCallback([&outfile, this](const Packet& ndp)
-        { fileDumpProcess(outfile, ndp); },
-        nf);
+                { fileDumpProcess(outfile, ndp); },
+                nf);
 }
 bool Netdump::tcpDump(WiFiServer& tcpDumpServer, const Filter nf)
 {
@@ -93,7 +93,7 @@ bool Netdump::tcpDump(WiFiServer& tcpDumpServer, const Filter nf)
     bufferIndex = 0;
 
     schedule_function([&tcpDumpServer, this, nf]()
-        { tcpDumpLoop(tcpDumpServer, nf); });
+                      { tcpDumpLoop(tcpDumpServer, nf); });
     return true;
 }
 
@@ -137,8 +137,8 @@ void Netdump::printDumpProcess(Print& out, Packet::PacketDetail ndd, const Packe
 
 void Netdump::fileDumpProcess(File& outfile, const Packet& np) const
 {
-    size_t incl_len = np.getPacketSize() > maxPcapLength ? maxPcapLength : np.getPacketSize();
-    uint32_t pcapHeader[4];
+    size_t         incl_len = np.getPacketSize() > maxPcapLength ? maxPcapLength : np.getPacketSize();
+    uint32_t       pcapHeader[4];
 
     struct timeval tv;
     gettimeofday(&tv, nullptr);
@@ -165,10 +165,10 @@ void Netdump::tcpDumpProcess(const Packet& np)
         struct timeval tv;
         gettimeofday(&tv, nullptr);
         uint32_t* pcapHeader = reinterpret_cast<uint32_t*>(&packetBuffer[bufferIndex]);
-        pcapHeader[0] = tv.tv_sec;  // add pcap record header
-        pcapHeader[1] = tv.tv_usec;
-        pcapHeader[2] = incl_len;
-        pcapHeader[3] = np.getPacketSize();
+        pcapHeader[0]        = tv.tv_sec;  // add pcap record header
+        pcapHeader[1]        = tv.tv_usec;
+        pcapHeader[2]        = incl_len;
+        pcapHeader[3]        = np.getPacketSize();
         bufferIndex += 16;  // pcap header size
         memcpy(&packetBuffer[bufferIndex], np.rawData(), incl_len);
         bufferIndex += incl_len;
@@ -192,8 +192,8 @@ void Netdump::tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf)
         writePcapHeader(tcpDumpClient);
 
         setCallback([this](const Packet& ndp)
-            { tcpDumpProcess(ndp); },
-            nf);
+                    { tcpDumpProcess(ndp); },
+                    nf);
     }
     if (!tcpDumpClient || !tcpDumpClient.connected())
     {
@@ -208,7 +208,7 @@ void Netdump::tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf)
     if (tcpDumpServer.status() != CLOSED)
     {
         schedule_function([&tcpDumpServer, this, nf]()
-            { tcpDumpLoop(tcpDumpServer, nf); });
+                          { tcpDumpLoop(tcpDumpServer, nf); });
     }
 }
 
diff --git a/libraries/Netdump/src/Netdump.h b/libraries/Netdump/src/Netdump.h
index 34457b6e9b..36bfda434f 100644
--- a/libraries/Netdump/src/Netdump.h
+++ b/libraries/Netdump/src/Netdump.h
@@ -37,8 +37,8 @@ using namespace experimental::CBListImplentation;
 class Netdump
 {
 public:
-    using Filter = std::function<bool(const Packet&)>;
-    using Callback = std::function<void(const Packet&)>;
+    using Filter       = std::function<bool(const Packet&)>;
+    using Callback     = std::function<void(const Packet&)>;
     using LwipCallback = std::function<void(int, const char*, int, int, int)>;
 
     Netdump();
@@ -54,29 +54,29 @@ class Netdump
     bool tcpDump(WiFiServer& tcpDumpServer, const Filter nf = nullptr);
 
 private:
-    Callback netDumpCallback = nullptr;
-    Filter netDumpFilter = nullptr;
+    Callback                                    netDumpCallback = nullptr;
+    Filter                                      netDumpFilter   = nullptr;
 
-    static void capture(int netif_idx, const char* data, size_t len, int out, int success);
-    static CallBackList<LwipCallback> lwipCallback;
+    static void                                 capture(int netif_idx, const char* data, size_t len, int out, int success);
+    static CallBackList<LwipCallback>           lwipCallback;
     CallBackList<LwipCallback>::CallBackHandler lwipHandler;
 
-    void netdumpCapture(int netif_idx, const char* data, size_t len, int out, int success);
+    void                                        netdumpCapture(int netif_idx, const char* data, size_t len, int out, int success);
 
-    void printDumpProcess(Print& out, Packet::PacketDetail ndd, const Packet& np) const;
-    void fileDumpProcess(File& outfile, const Packet& np) const;
-    void tcpDumpProcess(const Packet& np);
-    void tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf);
+    void                                        printDumpProcess(Print& out, Packet::PacketDetail ndd, const Packet& np) const;
+    void                                        fileDumpProcess(File& outfile, const Packet& np) const;
+    void                                        tcpDumpProcess(const Packet& np);
+    void                                        tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf);
 
-    void writePcapHeader(Stream& s) const;
+    void                                        writePcapHeader(Stream& s) const;
 
-    WiFiClient tcpDumpClient;
-    char* packetBuffer = nullptr;
-    int bufferIndex = 0;
+    WiFiClient                                  tcpDumpClient;
+    char*                                       packetBuffer  = nullptr;
+    int                                         bufferIndex   = 0;
 
-    static constexpr int tcpBufferSize = 2048;
-    static constexpr int maxPcapLength = 1024;
-    static constexpr uint32_t pcapMagic = 0xa1b2c3d4;
+    static constexpr int                        tcpBufferSize = 2048;
+    static constexpr int                        maxPcapLength = 1024;
+    static constexpr uint32_t                   pcapMagic     = 0xa1b2c3d4;
 };
 
 }  // namespace NetCapture
diff --git a/libraries/Netdump/src/NetdumpIP.cpp b/libraries/Netdump/src/NetdumpIP.cpp
index dd8c657111..2f2676cbba 100644
--- a/libraries/Netdump/src/NetdumpIP.cpp
+++ b/libraries/Netdump/src/NetdumpIP.cpp
@@ -100,8 +100,8 @@ bool NetdumpIP::fromString4(const char* address)
 {
     // TODO: (IPv4) add support for "a", "a.b", "a.b.c" formats
 
-    uint16_t acc = 0;  // Accumulator
-    uint8_t dots = 0;
+    uint16_t acc  = 0;  // Accumulator
+    uint8_t  dots = 0;
 
     while (*address)
     {
@@ -123,7 +123,7 @@ bool NetdumpIP::fromString4(const char* address)
                 return false;
             }
             (*this)[dots++] = acc;
-            acc = 0;
+            acc             = 0;
         }
         else
         {
@@ -147,8 +147,8 @@ bool NetdumpIP::fromString6(const char* address)
 {
     // TODO: test test test
 
-    uint32_t acc = 0;  // Accumulator
-    int dots = 0, doubledots = -1;
+    uint32_t acc  = 0;  // Accumulator
+    int      dots = 0, doubledots = -1;
 
     while (*address)
     {
@@ -185,7 +185,7 @@ bool NetdumpIP::fromString6(const char* address)
                 return false;
             }
             reinterpret_cast<uint16_t*>(rawip)[dots++] = PP_HTONS(acc);
-            acc = 0;
+            acc                                        = 0;
         }
         else
         // Invalid char
diff --git a/libraries/Netdump/src/NetdumpIP.h b/libraries/Netdump/src/NetdumpIP.h
index 41b1677869..e23963f347 100644
--- a/libraries/Netdump/src/NetdumpIP.h
+++ b/libraries/Netdump/src/NetdumpIP.h
@@ -30,7 +30,7 @@ class NetdumpIP
         return rawip[index];
     }
 
-    bool fromString(const char* address);
+    bool   fromString(const char* address);
 
     String toString();
 
@@ -41,11 +41,11 @@ class NetdumpIP
         IPV4,
         IPV6
     };
-    IPversion ipv = IPversion::UNSET;
+    IPversion ipv       = IPversion::UNSET;
 
-    uint8_t rawip[16] = { 0 };
+    uint8_t   rawip[16] = { 0 };
 
-    void setV4()
+    void      setV4()
     {
         ipv = IPversion::IPV4;
     };
@@ -74,12 +74,12 @@ class NetdumpIP
         return (ipv != IPversion::UNSET);
     };
 
-    bool compareRaw(IPversion v, const uint8_t* a, const uint8_t* b) const;
-    bool compareIP(const IPAddress& ip) const;
-    bool compareIP(const NetdumpIP& nip) const;
+    bool   compareRaw(IPversion v, const uint8_t* a, const uint8_t* b) const;
+    bool   compareIP(const IPAddress& ip) const;
+    bool   compareIP(const NetdumpIP& nip) const;
 
-    bool fromString4(const char* address);
-    bool fromString6(const char* address);
+    bool   fromString4(const char* address);
+    bool   fromString6(const char* address);
 
     size_t printTo(Print& p);
 
diff --git a/libraries/Netdump/src/NetdumpPacket.cpp b/libraries/Netdump/src/NetdumpPacket.cpp
index e3243cc887..44a2e614be 100644
--- a/libraries/Netdump/src/NetdumpPacket.cpp
+++ b/libraries/Netdump/src/NetdumpPacket.cpp
@@ -33,7 +33,7 @@ void Packet::printDetail(Print& out, const String& indent, const char* data, siz
 
     uint16_t charCount = (pd == PacketDetail::CHAR) ? 80 : 24;
 
-    size_t start = 0;
+    size_t   start     = 0;
     while (start < size)
     {
         size_t end = start + charCount;
diff --git a/libraries/Netdump/src/NetdumpPacket.h b/libraries/Netdump/src/NetdumpPacket.h
index 7d4aabf4dc..d1a6e59ab1 100644
--- a/libraries/Netdump/src/NetdumpPacket.h
+++ b/libraries/Netdump/src/NetdumpPacket.h
@@ -36,13 +36,8 @@ int constexpr ETH_HDR_LEN = 14;
 class Packet
 {
 public:
-    Packet(unsigned long msec, int n, const char* d, size_t l, int o, int s)
-        : packetTime(msec)
-        , netif_idx(n)
-        , data(d)
-        , packetLength(l)
-        , out(o)
-        , success(s)
+    Packet(unsigned long msec, int n, const char* d, size_t l, int o, int s) :
+        packetTime(msec), netif_idx(n), data(d), packetLength(l), out(o), success(s)
     {
         setPacketTypes();
     };
@@ -279,34 +274,34 @@ class Packet
         return (isIP() && ((getSrcPort() == p) || (getDstPort() == p)));
     }
 
-    const String toString() const;
-    const String toString(PacketDetail netdumpDetail) const;
-    void printDetail(Print& out, const String& indent, const char* data, size_t size, PacketDetail pd) const;
+    const String                   toString() const;
+    const String                   toString(PacketDetail netdumpDetail) const;
+    void                           printDetail(Print& out, const String& indent, const char* data, size_t size, PacketDetail pd) const;
 
-    const PacketType packetType() const;
+    const PacketType               packetType() const;
     const std::vector<PacketType>& allPacketTypes() const;
 
 private:
-    void setPacketType(PacketType);
-    void setPacketTypes();
+    void                    setPacketType(PacketType);
+    void                    setPacketTypes();
 
-    void MACtoString(int dataIdx, StreamString& sstr) const;
-    void ARPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
-    void DNStoString(PacketDetail netdumpDetail, StreamString& sstr) const;
-    void UDPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
-    void TCPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
-    void ICMPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
-    void IGMPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
-    void IPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
-    void UKNWtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void                    MACtoString(int dataIdx, StreamString& sstr) const;
+    void                    ARPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void                    DNStoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void                    UDPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void                    TCPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void                    ICMPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void                    IGMPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void                    IPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void                    UKNWtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
 
-    time_t packetTime;
-    int netif_idx;
-    const char* data;
-    size_t packetLength;
-    int out;
-    int success;
-    PacketType thisPacketType;
+    time_t                  packetTime;
+    int                     netif_idx;
+    const char*             data;
+    size_t                  packetLength;
+    int                     out;
+    int                     success;
+    PacketType              thisPacketType;
     std::vector<PacketType> thisAllPacketTypes;
 };
 
diff --git a/libraries/Netdump/src/PacketType.h b/libraries/Netdump/src/PacketType.h
index 36a5593ead..28d96ae7bc 100644
--- a/libraries/Netdump/src/PacketType.h
+++ b/libraries/Netdump/src/PacketType.h
@@ -37,8 +37,8 @@ class PacketType
     };
 
     PacketType();
-    PacketType(PType pt)
-        : ptype(pt) {};
+    PacketType(PType pt) :
+        ptype(pt) {};
 
     operator PType() const
     {
diff --git a/libraries/SD/examples/Datalogger/Datalogger.ino b/libraries/SD/examples/Datalogger/Datalogger.ino
index d75a2e1c8e..4a6147aee2 100644
--- a/libraries/SD/examples/Datalogger/Datalogger.ino
+++ b/libraries/SD/examples/Datalogger/Datalogger.ino
@@ -25,14 +25,16 @@
 
 const int chipSelect = 4;
 
-void setup() {
+void      setup()
+{
   // Open serial communications and wait for port to open:
   Serial.begin(115200);
 
   Serial.print("Initializing SD card...");
 
   // see if the card is present and can be initialized:
-  if (!SD.begin(chipSelect)) {
+  if (!SD.begin(chipSelect))
+  {
     Serial.println("Card failed, or not present");
     // don't do anything more:
     return;
@@ -40,15 +42,18 @@ void setup() {
   Serial.println("card initialized.");
 }
 
-void loop() {
+void loop()
+{
   // make a string for assembling the data to log:
   String dataString = "";
 
   // read three sensors and append to the string:
-  for (int analogPin = 0; analogPin < 3; analogPin++) {
+  for (int analogPin = 0; analogPin < 3; analogPin++)
+  {
     int sensor = analogRead(analogPin);
     dataString += String(sensor);
-    if (analogPin < 2) {
+    if (analogPin < 2)
+    {
       dataString += ",";
     }
   }
@@ -58,14 +63,16 @@ void loop() {
   File dataFile = SD.open("datalog.txt", FILE_WRITE);
 
   // if the file is available, write to it:
-  if (dataFile) {
+  if (dataFile)
+  {
     dataFile.println(dataString);
     dataFile.close();
     // print to the serial port too:
     Serial.println(dataString);
   }
   // if the file isn't open, pop up an error:
-  else {
+  else
+  {
     Serial.println("error opening datalog.txt");
   }
 }
diff --git a/libraries/SD/examples/DumpFile/DumpFile.ino b/libraries/SD/examples/DumpFile/DumpFile.ino
index 038cfc1c01..be5a026394 100644
--- a/libraries/SD/examples/DumpFile/DumpFile.ino
+++ b/libraries/SD/examples/DumpFile/DumpFile.ino
@@ -25,14 +25,16 @@
 
 const int chipSelect = 4;
 
-void setup() {
+void      setup()
+{
   // Open serial communications and wait for port to open:
   Serial.begin(115200);
 
   Serial.print("Initializing SD card...");
 
   // see if the card is present and can be initialized:
-  if (!SD.begin(chipSelect)) {
+  if (!SD.begin(chipSelect))
+  {
     Serial.println("Card failed, or not present");
     // don't do anything more:
     return;
@@ -44,17 +46,21 @@ void setup() {
   File dataFile = SD.open("datalog.txt");
 
   // if the file is available, write to it:
-  if (dataFile) {
-    while (dataFile.available()) {
+  if (dataFile)
+  {
+    while (dataFile.available())
+    {
       Serial.write(dataFile.read());
     }
     dataFile.close();
   }
   // if the file isn't open, pop up an error:
-  else {
+  else
+  {
     Serial.println("error opening datalog.txt");
   }
 }
 
-void loop() {
+void loop()
+{
 }
diff --git a/libraries/SD/examples/Files/Files.ino b/libraries/SD/examples/Files/Files.ino
index f162837dcf..bb4bbd7abe 100644
--- a/libraries/SD/examples/Files/Files.ino
+++ b/libraries/SD/examples/Files/Files.ino
@@ -22,21 +22,26 @@
 
 File myFile;
 
-void setup() {
+void setup()
+{
   // Open serial communications and wait for port to open:
   Serial.begin(115200);
 
   Serial.print("Initializing SD card...");
 
-  if (!SD.begin(4)) {
+  if (!SD.begin(4))
+  {
     Serial.println("initialization failed!");
     return;
   }
   Serial.println("initialization done.");
 
-  if (SD.exists("example.txt")) {
+  if (SD.exists("example.txt"))
+  {
     Serial.println("example.txt exists.");
-  } else {
+  }
+  else
+  {
     Serial.println("example.txt doesn't exist.");
   }
 
@@ -46,9 +51,12 @@ void setup() {
   myFile.close();
 
   // Check to see if the file exists:
-  if (SD.exists("example.txt")) {
+  if (SD.exists("example.txt"))
+  {
     Serial.println("example.txt exists.");
-  } else {
+  }
+  else
+  {
     Serial.println("example.txt doesn't exist.");
   }
 
@@ -56,13 +64,17 @@ void setup() {
   Serial.println("Removing example.txt...");
   SD.remove("example.txt");
 
-  if (SD.exists("example.txt")) {
+  if (SD.exists("example.txt"))
+  {
     Serial.println("example.txt exists.");
-  } else {
+  }
+  else
+  {
     Serial.println("example.txt doesn't exist.");
   }
 }
 
-void loop() {
+void loop()
+{
   // nothing happens after setup finishes.
 }
diff --git a/libraries/SD/examples/ReadWrite/ReadWrite.ino b/libraries/SD/examples/ReadWrite/ReadWrite.ino
index 680bb33296..e738fbb4b0 100644
--- a/libraries/SD/examples/ReadWrite/ReadWrite.ino
+++ b/libraries/SD/examples/ReadWrite/ReadWrite.ino
@@ -23,13 +23,15 @@
 
 File myFile;
 
-void setup() {
+void setup()
+{
   // Open serial communications and wait for port to open:
   Serial.begin(115200);
 
   Serial.print("Initializing SD card...");
 
-  if (!SD.begin(4)) {
+  if (!SD.begin(4))
+  {
     Serial.println("initialization failed!");
     return;
   }
@@ -40,34 +42,42 @@ void setup() {
   myFile = SD.open("test.txt", FILE_WRITE);
 
   // if the file opened okay, write to it:
-  if (myFile) {
+  if (myFile)
+  {
     Serial.print("Writing to test.txt...");
     myFile.println("testing 1, 2, 3.");
     // close the file:
     myFile.close();
     Serial.println("done.");
-  } else {
+  }
+  else
+  {
     // if the file didn't open, print an error:
     Serial.println("error opening test.txt");
   }
 
   // re-open the file for reading:
   myFile = SD.open("test.txt");
-  if (myFile) {
+  if (myFile)
+  {
     Serial.println("test.txt:");
 
     // read from the file until there's nothing else in it:
-    while (myFile.available()) {
+    while (myFile.available())
+    {
       Serial.write(myFile.read());
     }
     // close the file:
     myFile.close();
-  } else {
+  }
+  else
+  {
     // if the file didn't open, print an error:
     Serial.println("error opening test.txt");
   }
 }
 
-void loop() {
+void loop()
+{
   // nothing happens after setup
 }
diff --git a/libraries/SD/examples/listfiles/listfiles.ino b/libraries/SD/examples/listfiles/listfiles.ino
index a1de460672..56403560fa 100644
--- a/libraries/SD/examples/listfiles/listfiles.ino
+++ b/libraries/SD/examples/listfiles/listfiles.ino
@@ -26,13 +26,15 @@
 
 File root;
 
-void setup() {
+void setup()
+{
   // Open serial communications and wait for port to open:
   Serial.begin(115200);
 
   Serial.print("Initializing SD card...");
 
-  if (!SD.begin(SS)) {
+  if (!SD.begin(SS))
+  {
     Serial.println("initialization failed!");
     return;
   }
@@ -45,31 +47,38 @@ void setup() {
   Serial.println("done!");
 }
 
-void loop() {
+void loop()
+{
   // nothing happens after setup finishes.
 }
 
-void printDirectory(File dir, int numTabs) {
-  while (true) {
-
+void printDirectory(File dir, int numTabs)
+{
+  while (true)
+  {
     File entry = dir.openNextFile();
-    if (!entry) {
+    if (!entry)
+    {
       // no more files
       break;
     }
-    for (uint8_t i = 0; i < numTabs; i++) {
+    for (uint8_t i = 0; i < numTabs; i++)
+    {
       Serial.print('\t');
     }
     Serial.print(entry.name());
-    if (entry.isDirectory()) {
+    if (entry.isDirectory())
+    {
       Serial.println("/");
       printDirectory(entry, numTabs + 1);
-    } else {
+    }
+    else
+    {
       // files have sizes, directories do not
       Serial.print("\t\t");
       Serial.print(entry.size(), DEC);
-      time_t cr = entry.getCreationTime();
-      time_t lw = entry.getLastWrite();
+      time_t     cr       = entry.getCreationTime();
+      time_t     lw       = entry.getLastWrite();
       struct tm* tmstruct = localtime(&cr);
       Serial.printf("\tCREATION: %d-%02d-%02d %02d:%02d:%02d", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
       tmstruct = localtime(&lw);
diff --git a/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino b/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
index f6f38d95fa..9fb1c274d6 100644
--- a/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
+++ b/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
@@ -16,19 +16,22 @@
 */
 #include <SPI.h>
 
-class ESPMaster {
+class ESPMaster
+{
   private:
   uint8_t _ss_pin;
 
   public:
-  ESPMaster(uint8_t pin)
-      : _ss_pin(pin) { }
-  void begin() {
+  ESPMaster(uint8_t pin) :
+      _ss_pin(pin) { }
+  void begin()
+  {
     pinMode(_ss_pin, OUTPUT);
     digitalWrite(_ss_pin, HIGH);
   }
 
-  uint32_t readStatus() {
+  uint32_t readStatus()
+  {
     digitalWrite(_ss_pin, LOW);
     SPI.transfer(0x04);
     uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
@@ -36,7 +39,8 @@ class ESPMaster {
     return status;
   }
 
-  void writeStatus(uint32_t status) {
+  void writeStatus(uint32_t status)
+  {
     digitalWrite(_ss_pin, LOW);
     SPI.transfer(0x01);
     SPI.transfer(status & 0xFF);
@@ -46,45 +50,53 @@ class ESPMaster {
     digitalWrite(_ss_pin, HIGH);
   }
 
-  void readData(uint8_t* data) {
+  void readData(uint8_t* data)
+  {
     digitalWrite(_ss_pin, LOW);
     SPI.transfer(0x03);
     SPI.transfer(0x00);
-    for (uint8_t i = 0; i < 32; i++) {
+    for (uint8_t i = 0; i < 32; i++)
+    {
       data[i] = SPI.transfer(0);
     }
     digitalWrite(_ss_pin, HIGH);
   }
 
-  void writeData(uint8_t* data, size_t len) {
+  void writeData(uint8_t* data, size_t len)
+  {
     uint8_t i = 0;
     digitalWrite(_ss_pin, LOW);
     SPI.transfer(0x02);
     SPI.transfer(0x00);
-    while (len-- && i < 32) {
+    while (len-- && i < 32)
+    {
       SPI.transfer(data[i++]);
     }
-    while (i++ < 32) {
+    while (i++ < 32)
+    {
       SPI.transfer(0);
     }
     digitalWrite(_ss_pin, HIGH);
   }
 
-  String readData() {
+  String readData()
+  {
     char data[33];
     data[32] = 0;
     readData((uint8_t*)data);
     return String(data);
   }
 
-  void writeData(const char* data) {
+  void writeData(const char* data)
+  {
     writeData((uint8_t*)data, strlen(data));
   }
 };
 
 ESPMaster esp(SS);
 
-void send(const char* message) {
+void      send(const char* message)
+{
   Serial.print("Master: ");
   Serial.println(message);
   esp.writeData(message);
@@ -94,7 +106,8 @@ void send(const char* message) {
   Serial.println();
 }
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   SPI.begin();
   esp.begin();
@@ -102,7 +115,8 @@ void setup() {
   send("Hello Slave!");
 }
 
-void loop() {
+void loop()
+{
   delay(1000);
   send("Are you alive?");
 }
diff --git a/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino b/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
index 2b1d3bbbbc..778d1aa0ea 100644
--- a/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
+++ b/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
@@ -17,24 +17,28 @@
 */
 #include <SPI.h>
 
-class ESPSafeMaster {
+class ESPSafeMaster
+{
   private:
   uint8_t _ss_pin;
-  void _pulseSS() {
+  void    _pulseSS()
+  {
     digitalWrite(_ss_pin, HIGH);
     delayMicroseconds(5);
     digitalWrite(_ss_pin, LOW);
   }
 
   public:
-  ESPSafeMaster(uint8_t pin)
-      : _ss_pin(pin) { }
-  void begin() {
+  ESPSafeMaster(uint8_t pin) :
+      _ss_pin(pin) { }
+  void begin()
+  {
     pinMode(_ss_pin, OUTPUT);
     _pulseSS();
   }
 
-  uint32_t readStatus() {
+  uint32_t readStatus()
+  {
     _pulseSS();
     SPI.transfer(0x04);
     uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
@@ -42,7 +46,8 @@ class ESPSafeMaster {
     return status;
   }
 
-  void writeStatus(uint32_t status) {
+  void writeStatus(uint32_t status)
+  {
     _pulseSS();
     SPI.transfer(0x01);
     SPI.transfer(status & 0xFF);
@@ -52,45 +57,53 @@ class ESPSafeMaster {
     _pulseSS();
   }
 
-  void readData(uint8_t* data) {
+  void readData(uint8_t* data)
+  {
     _pulseSS();
     SPI.transfer(0x03);
     SPI.transfer(0x00);
-    for (uint8_t i = 0; i < 32; i++) {
+    for (uint8_t i = 0; i < 32; i++)
+    {
       data[i] = SPI.transfer(0);
     }
     _pulseSS();
   }
 
-  void writeData(uint8_t* data, size_t len) {
+  void writeData(uint8_t* data, size_t len)
+  {
     uint8_t i = 0;
     _pulseSS();
     SPI.transfer(0x02);
     SPI.transfer(0x00);
-    while (len-- && i < 32) {
+    while (len-- && i < 32)
+    {
       SPI.transfer(data[i++]);
     }
-    while (i++ < 32) {
+    while (i++ < 32)
+    {
       SPI.transfer(0);
     }
     _pulseSS();
   }
 
-  String readData() {
+  String readData()
+  {
     char data[33];
     data[32] = 0;
     readData((uint8_t*)data);
     return String(data);
   }
 
-  void writeData(const char* data) {
+  void writeData(const char* data)
+  {
     writeData((uint8_t*)data, strlen(data));
   }
 };
 
 ESPSafeMaster esp(SS);
 
-void send(const char* message) {
+void          send(const char* message)
+{
   Serial.print("Master: ");
   Serial.println(message);
   esp.writeData(message);
@@ -100,7 +113,8 @@ void send(const char* message) {
   Serial.println();
 }
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   SPI.begin();
   esp.begin();
@@ -108,7 +122,8 @@ void setup() {
   send("Hello Slave!");
 }
 
-void loop() {
+void loop()
+{
   delay(1000);
   send("Are you alive?");
 }
diff --git a/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino b/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
index f8b29a220d..f84f883353 100644
--- a/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
+++ b/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
@@ -17,46 +17,52 @@
 
 #include "SPISlave.h"
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   Serial.setDebugOutput(true);
 
   // data has been received from the master. Beware that len is always 32
   // and the buffer is autofilled with zeroes if data is less than 32 bytes long
   // It's up to the user to implement protocol for handling data length
-  SPISlave.onData([](uint8_t* data, size_t len) {
-    String message = String((char*)data);
-    (void)len;
-    if (message.equals("Hello Slave!")) {
-      SPISlave.setData("Hello Master!");
-    } else if (message.equals("Are you alive?")) {
-      char answer[33];
-      sprintf(answer, "Alive for %lu seconds!", millis() / 1000);
-      SPISlave.setData(answer);
-    } else {
-      SPISlave.setData("Say what?");
-    }
-    Serial.printf("Question: %s\n", (char*)data);
-  });
+  SPISlave.onData([](uint8_t* data, size_t len)
+                  {
+                    String message = String((char*)data);
+                    (void)len;
+                    if (message.equals("Hello Slave!"))
+                    {
+                      SPISlave.setData("Hello Master!");
+                    }
+                    else if (message.equals("Are you alive?"))
+                    {
+                      char answer[33];
+                      sprintf(answer, "Alive for %lu seconds!", millis() / 1000);
+                      SPISlave.setData(answer);
+                    }
+                    else
+                    {
+                      SPISlave.setData("Say what?");
+                    }
+                    Serial.printf("Question: %s\n", (char*)data);
+                  });
 
   // The master has read out outgoing data buffer
   // that buffer can be set with SPISlave.setData
-  SPISlave.onDataSent([]() {
-    Serial.println("Answer Sent");
-  });
+  SPISlave.onDataSent([]()
+                      { Serial.println("Answer Sent"); });
 
   // status has been received from the master.
   // The status register is a special register that bot the slave and the master can write to and read from.
   // Can be used to exchange small data or status information
-  SPISlave.onStatus([](uint32_t data) {
-    Serial.printf("Status: %u\n", data);
-    SPISlave.setStatus(millis()); //set next status
-  });
+  SPISlave.onStatus([](uint32_t data)
+                    {
+                      Serial.printf("Status: %u\n", data);
+                      SPISlave.setStatus(millis());  //set next status
+                    });
 
   // The master has read the status register
-  SPISlave.onStatusSent([]() {
-    Serial.println("Status Sent");
-  });
+  SPISlave.onStatusSent([]()
+                        { Serial.println("Status Sent"); });
 
   // Setup SPI Slave registers and pins
   SPISlave.begin();
diff --git a/libraries/Servo/examples/Sweep/Sweep.ino b/libraries/Servo/examples/Sweep/Sweep.ino
index dd5453e647..bc9fbcf57d 100644
--- a/libraries/Servo/examples/Sweep/Sweep.ino
+++ b/libraries/Servo/examples/Sweep/Sweep.ino
@@ -12,23 +12,27 @@
 
 #include <Servo.h>
 
-Servo myservo; // create servo object to control a servo
+Servo myservo;  // create servo object to control a servo
 // twelve servo objects can be created on most boards
 
-void setup() {
-  myservo.attach(2); // attaches the servo on GIO2 to the servo object
+void  setup()
+{
+  myservo.attach(2);  // attaches the servo on GIO2 to the servo object
 }
 
-void loop() {
+void loop()
+{
   int pos;
 
-  for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
+  for (pos = 0; pos <= 180; pos += 1)
+  {  // goes from 0 degrees to 180 degrees
     // in steps of 1 degree
-    myservo.write(pos); // tell servo to go to position in variable 'pos'
-    delay(15); // waits 15ms for the servo to reach the position
+    myservo.write(pos);  // tell servo to go to position in variable 'pos'
+    delay(15);           // waits 15ms for the servo to reach the position
   }
-  for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
-    myservo.write(pos); // tell servo to go to position in variable 'pos'
-    delay(15); // waits 15ms for the servo to reach the position
+  for (pos = 180; pos >= 0; pos -= 1)
+  {                      // goes from 180 degrees to 0 degrees
+    myservo.write(pos);  // tell servo to go to position in variable 'pos'
+    delay(15);           // waits 15ms for the servo to reach the position
   }
 }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino b/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
index 68b44cdd50..175f231179 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
@@ -7,21 +7,23 @@
 #include <TFTv2.h>
 #include <SPI.h>
 
-void setup() {
-  TFT_BL_ON; //turn on the background light
+void setup()
+{
+  TFT_BL_ON;  //turn on the background light
 
-  Tft.TFTinit(); //init TFT library
+  Tft.TFTinit();  //init TFT library
 
-  Tft.drawCircle(100, 100, 30, YELLOW); //center: (100, 100), r = 30 ,color : YELLOW
+  Tft.drawCircle(100, 100, 30, YELLOW);  //center: (100, 100), r = 30 ,color : YELLOW
 
-  Tft.drawCircle(100, 200, 40, CYAN); // center: (100, 200), r = 10 ,color : CYAN
+  Tft.drawCircle(100, 200, 40, CYAN);  // center: (100, 200), r = 10 ,color : CYAN
 
-  Tft.fillCircle(200, 100, 30, RED); //center: (200, 100), r = 30 ,color : RED
+  Tft.fillCircle(200, 100, 30, RED);  //center: (200, 100), r = 30 ,color : RED
 
-  Tft.fillCircle(200, 200, 30, BLUE); //center: (200, 200), r = 30 ,color : BLUE
+  Tft.fillCircle(200, 200, 30, BLUE);  //center: (200, 200), r = 30 ,color : BLUE
 }
 
-void loop() {
+void loop()
+{
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino b/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
index b89aa5a09a..b958b581ae 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
@@ -7,20 +7,22 @@
 #include <stdint.h>
 #include <TFTv2.h>
 #include <SPI.h>
-void setup() {
-  TFT_BL_ON; // turn on the background light
-  Tft.TFTinit(); //init TFT library
+void setup()
+{
+  TFT_BL_ON;      // turn on the background light
+  Tft.TFTinit();  //init TFT library
 
-  Tft.drawLine(0, 0, 239, 319, RED); //start: (0, 0) end: (239, 319), color : RED
+  Tft.drawLine(0, 0, 239, 319, RED);  //start: (0, 0) end: (239, 319), color : RED
 
-  Tft.drawVerticalLine(60, 100, 100, GREEN); // Draw a vertical line
+  Tft.drawVerticalLine(60, 100, 100, GREEN);  // Draw a vertical line
   // start: (60, 100) length: 100 color: green
 
-  Tft.drawHorizontalLine(30, 60, 150, BLUE); //Draw a horizontal line
+  Tft.drawHorizontalLine(30, 60, 150, BLUE);  //Draw a horizontal line
   //start: (30, 60), high: 150, color: blue
 }
 
-void loop() {
+void loop()
+{
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino b/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
index ff94d9c587..5ff2e50bab 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
@@ -8,27 +8,29 @@
 #include <TFTv2.h>
 #include <SPI.h>
 
-void setup() {
-  TFT_BL_ON; // turn on the background light
+void setup()
+{
+  TFT_BL_ON;  // turn on the background light
 
-  Tft.TFTinit(); // init TFT library
+  Tft.TFTinit();  // init TFT library
 
-  Tft.drawNumber(1024, 0, 0, 1, RED); // draw a integer: 1024, Location: (0, 0),  size: 1, color: RED
+  Tft.drawNumber(1024, 0, 0, 1, RED);  // draw a integer: 1024, Location: (0, 0),  size: 1, color: RED
 
-  Tft.drawNumber(1024, 0, 20, 2, BLUE); // draw a integer: 1024, Location: (0, 20), size: 2, color: BLUE
+  Tft.drawNumber(1024, 0, 20, 2, BLUE);  // draw a integer: 1024, Location: (0, 20), size: 2, color: BLUE
 
-  Tft.drawNumber(1024, 0, 50, 3, GREEN); // draw a integer: 1024, Location: (0, 50), size: 3, color: GREEN
+  Tft.drawNumber(1024, 0, 50, 3, GREEN);  // draw a integer: 1024, Location: (0, 50), size: 3, color: GREEN
 
-  Tft.drawNumber(1024, 0, 90, 4, BLUE); // draw a integer: 1024, Location: (0, 90), size:4, color: BLUE
+  Tft.drawNumber(1024, 0, 90, 4, BLUE);  // draw a integer: 1024, Location: (0, 90), size:4, color: BLUE
 
-  Tft.drawFloat(1.2345, 0, 150, 4, YELLOW); // draw a float number: 1.2345, Location: (0, 150), size: 4, color: YELLOW
+  Tft.drawFloat(1.2345, 0, 150, 4, YELLOW);  // draw a float number: 1.2345, Location: (0, 150), size: 4, color: YELLOW
 
-  Tft.drawFloat(1.2345, 2, 0, 200, 4, BLUE); // draw a float number: 1.2345: Location: (0, 200), size: 4, decimal: 2, color: BLUE
+  Tft.drawFloat(1.2345, 2, 0, 200, 4, BLUE);  // draw a float number: 1.2345: Location: (0, 200), size: 4, decimal: 2, color: BLUE
 
-  Tft.drawFloat(1.2345, 4, 0, 250, 4, RED); // draw a float number: 1.2345 Location: (0, 250), size: 4, decimal: 4, color: RED
+  Tft.drawFloat(1.2345, 4, 0, 250, 4, RED);  // draw a float number: 1.2345 Location: (0, 250), size: 4, decimal: 4, color: RED
 }
 
-void loop() {
+void loop()
+{
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino b/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
index f7d7c91b8d..6837de553e 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
@@ -7,16 +7,18 @@
 #include <TFTv2.h>
 #include <SPI.h>
 
-void setup() {
-  TFT_BL_ON; // turn on the background light
-  Tft.TFTinit(); // init TFT library
+void setup()
+{
+  TFT_BL_ON;      // turn on the background light
+  Tft.TFTinit();  // init TFT library
 
   Tft.fillScreen(80, 160, 50, 150, RED);
   Tft.fillRectangle(30, 120, 100, 65, YELLOW);
   Tft.drawRectangle(100, 170, 120, 60, BLUE);
 }
 
-void loop() {
+void loop()
+{
 }
 /*********************************************************************************************************
   END FILE
diff --git a/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino b/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
index 4774becf60..ec62914fa1 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
@@ -4,42 +4,49 @@
 #include <TFTv2.h>
 #include <SPI.h>
 
-int ColorPaletteHigh = 30;
-int color = WHITE; //Paint brush color
-unsigned int colors[8] = { BLACK, RED, GREEN, BLUE, CYAN, YELLOW, WHITE, GRAY1 };
+int          ColorPaletteHigh = 30;
+int          color            = WHITE;  //Paint brush color
+unsigned int colors[8]        = { BLACK, RED, GREEN, BLUE, CYAN, YELLOW, WHITE, GRAY1 };
 
 // For better pressure precision, we need to know the resistance
 // between X+ and X- Use any multimeter to read it
 // The 2.8" TFT Touch shield has 300 ohms across the X plate
 
-TouchScreen ts = TouchScreen(XP, YP, XM, YM); //init TouchScreen port pins
+TouchScreen  ts               = TouchScreen(XP, YP, XM, YM);  //init TouchScreen port pins
 
-void setup() {
-  Tft.TFTinit(); //init TFT library
+void         setup()
+{
+  Tft.TFTinit();  //init TFT library
   Serial.begin(115200);
   //Draw the pallet
-  for (int i = 0; i < 8; i++) {
+  for (int i = 0; i < 8; i++)
+  {
     Tft.fillRectangle(i * 30, 0, 30, ColorPaletteHigh, colors[i]);
   }
 }
 
-void loop() {
+void loop()
+{
   // a point object holds x y and z coordinates.
   Point p = ts.getPoint();
 
   //map the ADC value read to into pixel coordinates
 
-  p.x = map(p.x, TS_MINX, TS_MAXX, 0, 240);
-  p.y = map(p.y, TS_MINY, TS_MAXY, 0, 320);
+  p.x     = map(p.x, TS_MINX, TS_MAXX, 0, 240);
+  p.y     = map(p.y, TS_MINY, TS_MAXY, 0, 320);
 
   // we have some minimum pressure we consider 'valid'
   // pressure of 0 means no pressing!
 
-  if (p.z > __PRESURE) {
+  if (p.z > __PRESURE)
+  {
     // Detect  paint brush color change
-    if (p.y < ColorPaletteHigh + 2) {
+    if (p.y < ColorPaletteHigh + 2)
+    {
       color = colors[p.x / 30];
-    } else {
+    }
+    else
+    {
       Tft.fillCircle(p.x, p.y, 2, color);
     }
   }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino b/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
index f6b2eee5b4..62591d49e3 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
@@ -4,14 +4,17 @@
 #include <TFTv2.h>
 #include <SPI.h>
 
-void setup() {
-  TFT_BL_ON; // turn on the background light
-  Tft.TFTinit(); // init TFT library
+void setup()
+{
+  TFT_BL_ON;      // turn on the background light
+  Tft.TFTinit();  // init TFT library
 }
 
-void loop() {
-  for (int r = 0; r < 115; r = r + 2) { //set r : 0--115
-    Tft.drawCircle(119, 160, r, random(0xFFFF)); //draw circle, center:(119, 160), color: random
+void loop()
+{
+  for (int r = 0; r < 115; r = r + 2)
+  {                                               //set r : 0--115
+    Tft.drawCircle(119, 160, r, random(0xFFFF));  //draw circle, center:(119, 160), color: random
   }
   delay(10);
 }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/text/text.ino b/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
index d35f100d5c..87ff67865b 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
@@ -7,24 +7,26 @@
 #include <TFTv2.h>
 #include <SPI.h>
 
-void setup() {
-  TFT_BL_ON; // turn on the background light
-  Tft.TFTinit(); // init TFT library
+void setup()
+{
+  TFT_BL_ON;      // turn on the background light
+  Tft.TFTinit();  // init TFT library
 
-  Tft.drawChar('S', 0, 0, 1, RED); // draw char: 'S', (0, 0), size: 1, color: RED
+  Tft.drawChar('S', 0, 0, 1, RED);  // draw char: 'S', (0, 0), size: 1, color: RED
 
-  Tft.drawChar('E', 10, 10, 2, BLUE); // draw char: 'E', (10, 10), size: 2, color: BLUE
+  Tft.drawChar('E', 10, 10, 2, BLUE);  // draw char: 'E', (10, 10), size: 2, color: BLUE
 
-  Tft.drawChar('E', 20, 40, 3, GREEN); // draw char: 'E', (20, 40), size: 3, color: GREEN
+  Tft.drawChar('E', 20, 40, 3, GREEN);  // draw char: 'E', (20, 40), size: 3, color: GREEN
 
-  Tft.drawChar('E', 30, 80, 4, YELLOW); // draw char: 'E', (30, 80), size: 4, color: YELLOW
+  Tft.drawChar('E', 30, 80, 4, YELLOW);  // draw char: 'E', (30, 80), size: 4, color: YELLOW
 
-  Tft.drawChar('D', 40, 120, 4, YELLOW); // draw char: 'D', (40, 120), size: 4, color: YELLOW
+  Tft.drawChar('D', 40, 120, 4, YELLOW);  // draw char: 'D', (40, 120), size: 4, color: YELLOW
 
-  Tft.drawString("Hello", 0, 180, 3, CYAN); // draw string: "hello", (0, 180), size: 3, color: CYAN
+  Tft.drawString("Hello", 0, 180, 3, CYAN);  // draw string: "hello", (0, 180), size: 3, color: CYAN
 
-  Tft.drawString("World!!", 60, 220, 4, WHITE); // draw string: "world!!", (80, 230), size: 4, color: WHITE
+  Tft.drawString("World!!", 60, 220, 4, WHITE);  // draw string: "world!!", (80, 230), size: 4, color: WHITE
 }
 
-void loop() {
+void loop()
+{
 }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino b/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino
index 6ee5238abd..c7b45f30e6 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino
@@ -16,19 +16,19 @@
 
 #include "TFTv2.h"
 
-#define MAX_BMP 10 // bmp file num
-#define FILENAME_LEN 20 // max file name length
+#define MAX_BMP 10       // bmp file num
+#define FILENAME_LEN 20  // max file name length
 
-const int PIN_SD_CS = 4; // pin of sd card
+const int     PIN_SD_CS                      = 4;  // pin of sd card
 
-const int __Gnbmp_height = 320; // bmp height
-const int __Gnbmp_width = 240; // bmp width
+const int     __Gnbmp_height                 = 320;  // bmp height
+const int     __Gnbmp_width                  = 240;  // bmp width
 
-unsigned char __Gnbmp_image_offset = 0; // offset
+unsigned char __Gnbmp_image_offset           = 0;  // offset
 
-int __Gnfile_num = 3; // num of file
+int           __Gnfile_num                   = 3;  // num of file
 
-char __Gsbmp_files[3][FILENAME_LEN] = {
+char          __Gsbmp_files[3][FILENAME_LEN] = {
   // add file name here
   "flower.BMP",
   "hibiscus.bmp",
@@ -37,8 +37,8 @@ char __Gsbmp_files[3][FILENAME_LEN] = {
 
 File bmpFile;
 
-void setup() {
-
+void setup()
+{
   Serial.begin(115200);
 
   pinMode(PIN_SD_CS, OUTPUT);
@@ -49,10 +49,11 @@ void setup() {
   Sd2Card card;
   card.init(SPI_FULL_SPEED, PIN_SD_CS);
 
-  if (!SD.begin(PIN_SD_CS)) {
+  if (!SD.begin(PIN_SD_CS))
+  {
     Serial.println("failed!");
     while (1)
-      ; // init fail, die here
+      ;  // init fail, die here
   }
 
   Serial.println("SD OK!");
@@ -60,16 +61,20 @@ void setup() {
   TFT_BL_ON;
 }
 
-void loop() {
-  for (unsigned char i = 0; i < __Gnfile_num; i++) {
+void loop()
+{
+  for (unsigned char i = 0; i < __Gnfile_num; i++)
+  {
     bmpFile = SD.open(__Gsbmp_files[i]);
-    if (!bmpFile) {
+    if (!bmpFile)
+    {
       Serial.println("didn't find image");
       while (1)
         ;
     }
 
-    if (!bmpReadHeader(bmpFile)) {
+    if (!bmpReadHeader(bmpFile))
+    {
       Serial.println("bad bmp");
       return;
     }
@@ -88,29 +93,32 @@ void loop() {
 // more RAM but makes the drawing a little faster. 20 pixels' worth
 // is probably a good place
 
-#define BUFFPIXEL 60 // must be a divisor of 240
-#define BUFFPIXEL_X3 180 // BUFFPIXELx3
+#define BUFFPIXEL 60      // must be a divisor of 240
+#define BUFFPIXEL_X3 180  // BUFFPIXELx3
 
-void bmpdraw(File f, int x, int y) {
+void bmpdraw(File f, int x, int y)
+{
   bmpFile.seek(__Gnbmp_image_offset);
 
   uint32_t time = millis();
 
-  uint8_t sdbuffer[BUFFPIXEL_X3]; // 3 * pixels to buffer
-
-  for (int i = 0; i < __Gnbmp_height; i++) {
+  uint8_t  sdbuffer[BUFFPIXEL_X3];  // 3 * pixels to buffer
 
-    for (int j = 0; j < (240 / BUFFPIXEL); j++) {
+  for (int i = 0; i < __Gnbmp_height; i++)
+  {
+    for (int j = 0; j < (240 / BUFFPIXEL); j++)
+    {
       bmpFile.read(sdbuffer, BUFFPIXEL_X3);
-      uint8_t buffidx = 0;
-      int offset_x = j * BUFFPIXEL;
+      uint8_t      buffidx  = 0;
+      int          offset_x = j * BUFFPIXEL;
 
       unsigned int __color[BUFFPIXEL];
 
-      for (int k = 0; k < BUFFPIXEL; k++) {
-        __color[k] = sdbuffer[buffidx + 2] >> 3; // read
-        __color[k] = __color[k] << 6 | (sdbuffer[buffidx + 1] >> 2); // green
-        __color[k] = __color[k] << 5 | (sdbuffer[buffidx + 0] >> 3); // blue
+      for (int k = 0; k < BUFFPIXEL; k++)
+      {
+        __color[k] = sdbuffer[buffidx + 2] >> 3;                      // read
+        __color[k] = __color[k] << 6 | (sdbuffer[buffidx + 1] >> 2);  // green
+        __color[k] = __color[k] << 5 | (sdbuffer[buffidx + 0] >> 3);  // blue
 
         buffidx += 3;
       }
@@ -122,7 +130,8 @@ void bmpdraw(File f, int x, int y) {
       TFT_DC_HIGH;
       TFT_CS_LOW;
 
-      for (int m = 0; m < BUFFPIXEL; m++) {
+      for (int m = 0; m < BUFFPIXEL; m++)
+      {
         SPI.transfer(__color[m] >> 8);
         SPI.transfer(__color[m]);
       }
@@ -135,12 +144,14 @@ void bmpdraw(File f, int x, int y) {
   Serial.println(" ms");
 }
 
-boolean bmpReadHeader(File f) {
+boolean bmpReadHeader(File f)
+{
   // read header
   uint32_t tmp;
-  uint8_t bmpDepth;
+  uint8_t  bmpDepth;
 
-  if (read16(f) != 0x4D42) {
+  if (read16(f) != 0x4D42)
+  {
     // magic bytes missing
     return false;
   }
@@ -162,14 +173,16 @@ boolean bmpReadHeader(File f) {
   Serial.print("header size ");
   Serial.println(tmp, DEC);
 
-  int bmp_width = read32(f);
+  int bmp_width  = read32(f);
   int bmp_height = read32(f);
 
-  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) { // if image is not 320x240, return false
+  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height)
+  {  // if image is not 320x240, return false
     return false;
   }
 
-  if (read16(f) != 1) {
+  if (read16(f) != 1)
+  {
     return false;
   }
 
@@ -177,7 +190,8 @@ boolean bmpReadHeader(File f) {
   Serial.print("bitdepth ");
   Serial.println(bmpDepth, DEC);
 
-  if (read32(f) != 0) {
+  if (read32(f) != 0)
+  {
     // compression not supported!
     return false;
   }
@@ -193,9 +207,10 @@ boolean bmpReadHeader(File f) {
 // (the data is stored in little endian format!)
 
 // LITTLE ENDIAN!
-uint16_t read16(File f) {
+uint16_t read16(File f)
+{
   uint16_t d;
-  uint8_t b;
+  uint8_t  b;
   b = f.read();
   d = f.read();
   d <<= 8;
@@ -204,7 +219,8 @@ uint16_t read16(File f) {
 }
 
 // LITTLE ENDIAN!
-uint32_t read32(File f) {
+uint32_t read32(File f)
+{
   uint32_t d;
   uint16_t b;
 
diff --git a/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino b/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
index 0e91c67ce4..0f3a9caa24 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
@@ -18,40 +18,45 @@
 
 #include "TFTv2.h"
 
-#define MAX_BMP 10 // bmp file num
-#define FILENAME_LEN 20 // max file name length
+#define MAX_BMP 10       // bmp file num
+#define FILENAME_LEN 20  // max file name length
 
-const int PIN_SD_CS = 4; // pin of sd card
+const int  PIN_SD_CS            = 4;  // pin of sd card
 
-const long __Gnbmp_height = 320; // bmp height
-const long __Gnbmp_width = 240; // bmp width
+const long __Gnbmp_height       = 320;  // bmp height
+const long __Gnbmp_width        = 240;  // bmp width
 
-long __Gnbmp_image_offset = 0;
+long       __Gnbmp_image_offset = 0;
 ;
 
-int __Gnfile_num = 0; // num of file
-char __Gsbmp_files[MAX_BMP][FILENAME_LEN]; // file name
+int  __Gnfile_num = 0;                      // num of file
+char __Gsbmp_files[MAX_BMP][FILENAME_LEN];  // file name
 
 File bmpFile;
 
 // if bmp file return 1, else return 0
-bool checkBMP(char* _name, char r_name[]) {
+bool checkBMP(char* _name, char r_name[])
+{
   int len = 0;
 
-  if (NULL == _name) {
+  if (NULL == _name)
+  {
     return false;
   }
 
-  while (*_name) {
+  while (*_name)
+  {
     r_name[len++] = *(_name++);
-    if (len > FILENAME_LEN) {
+    if (len > FILENAME_LEN)
+    {
       return false;
     }
   }
 
   r_name[len] = '\0';
 
-  if (len < 5) {
+  if (len < 5)
+  {
     return false;
   }
 
@@ -59,7 +64,8 @@ bool checkBMP(char* _name, char r_name[]) {
   if (r_name[len - 4] == '.'
       && (r_name[len - 3] == 'b' || (r_name[len - 3] == 'B'))
       && (r_name[len - 2] == 'm' || (r_name[len - 2] == 'M'))
-      && (r_name[len - 1] == 'p' || (r_name[len - 1] == 'P'))) {
+      && (r_name[len - 1] == 'p' || (r_name[len - 1] == 'P')))
+  {
     return true;
   }
 
@@ -67,21 +73,26 @@ bool checkBMP(char* _name, char r_name[]) {
 }
 
 // search root to find bmp file
-void searchDirectory() {
-  File root = SD.open("/"); // root
-  while (true) {
+void searchDirectory()
+{
+  File root = SD.open("/");  // root
+  while (true)
+  {
     File entry = root.openNextFile();
 
-    if (!entry) {
+    if (!entry)
+    {
       break;
     }
 
-    if (!entry.isDirectory()) {
+    if (!entry.isDirectory())
+    {
       char* ptmp = entry.name();
 
-      char __Name[20];
+      char  __Name[20];
 
-      if (checkBMP(ptmp, __Name)) {
+      if (checkBMP(ptmp, __Name))
+      {
         Serial.println(__Name);
 
         strcpy(__Gsbmp_files[__Gnfile_num++], __Name);
@@ -94,13 +105,14 @@ void searchDirectory() {
   Serial.print(__Gnfile_num);
   Serial.println(" file: ");
 
-  for (int i = 0; i < __Gnfile_num; i++) {
+  for (int i = 0; i < __Gnfile_num; i++)
+  {
     Serial.println(__Gsbmp_files[i]);
   }
 }
 
-void setup() {
-
+void setup()
+{
   Serial.begin(115200);
 
   pinMode(PIN_SD_CS, OUTPUT);
@@ -111,10 +123,11 @@ void setup() {
   Sd2Card card;
   card.init(SPI_FULL_SPEED, PIN_SD_CS);
 
-  if (!SD.begin(PIN_SD_CS)) {
+  if (!SD.begin(PIN_SD_CS))
+  {
     Serial.println("failed!");
     while (1)
-      ; // init fail, die here
+      ;  // init fail, die here
   }
 
   Serial.println("SD OK!");
@@ -124,7 +137,8 @@ void setup() {
   TFT_BL_ON;
 }
 
-void loop() {
+void loop()
+{
   /*
       static int dirCtrl = 0;
       for(unsigned char i=0; i<__Gnfile_num; i++)
@@ -152,13 +166,15 @@ void loop() {
 
   bmpFile = SD.open("pfvm_1.bmp");
 
-  if (!bmpFile) {
+  if (!bmpFile)
+  {
     Serial.println("didn't find image");
     while (1)
       ;
   }
 
-  if (!bmpReadHeader(bmpFile)) {
+  if (!bmpReadHeader(bmpFile))
+  {
     Serial.println("bad bmp");
     return;
   }
@@ -177,51 +193,58 @@ void loop() {
 // more RAM but makes the drawing a little faster. 20 pixels' worth
 // is probably a good place
 
-#define BUFFPIXEL 60 // must be a divisor of 240
-#define BUFFPIXEL_X3 180 // BUFFPIXELx3
+#define BUFFPIXEL 60      // must be a divisor of 240
+#define BUFFPIXEL_X3 180  // BUFFPIXELx3
 
 #define UP_DOWN 1
 #define DOWN_UP 0
 
 // dir - 1: up to down
 // dir - 2: down to up
-void bmpdraw(File f, int x, int y, int dir) {
-
-  if (bmpFile.seek(__Gnbmp_image_offset)) {
+void bmpdraw(File f, int x, int y, int dir)
+{
+  if (bmpFile.seek(__Gnbmp_image_offset))
+  {
     Serial.print("pos = ");
     Serial.println(bmpFile.position());
   }
 
   uint32_t time = millis();
 
-  uint8_t sdbuffer[BUFFPIXEL_X3]; // 3 * pixels to buffer
+  uint8_t  sdbuffer[BUFFPIXEL_X3];  // 3 * pixels to buffer
 
-  for (int i = 0; i < __Gnbmp_height; i++) {
-    if (dir) {
+  for (int i = 0; i < __Gnbmp_height; i++)
+  {
+    if (dir)
+    {
       bmpFile.seek(__Gnbmp_image_offset + (__Gnbmp_height - 1 - i) * 240 * 3);
     }
 
-    for (int j = 0; j < (240 / BUFFPIXEL); j++) {
-
+    for (int j = 0; j < (240 / BUFFPIXEL); j++)
+    {
       bmpFile.read(sdbuffer, BUFFPIXEL_X3);
-      uint8_t buffidx = 0;
-      int offset_x = j * BUFFPIXEL;
+      uint8_t      buffidx  = 0;
+      int          offset_x = j * BUFFPIXEL;
 
       unsigned int __color[BUFFPIXEL];
 
-      for (int k = 0; k < BUFFPIXEL; k++) {
-        __color[k] = sdbuffer[buffidx + 2] >> 3; // read
-        __color[k] = __color[k] << 6 | (sdbuffer[buffidx + 1] >> 2); // green
-        __color[k] = __color[k] << 5 | (sdbuffer[buffidx + 0] >> 3); // blue
+      for (int k = 0; k < BUFFPIXEL; k++)
+      {
+        __color[k] = sdbuffer[buffidx + 2] >> 3;                      // read
+        __color[k] = __color[k] << 6 | (sdbuffer[buffidx + 1] >> 2);  // green
+        __color[k] = __color[k] << 5 | (sdbuffer[buffidx + 0] >> 3);  // blue
 
         buffidx += 3;
       }
 
       Tft.setCol(offset_x, offset_x + BUFFPIXEL);
 
-      if (dir) {
+      if (dir)
+      {
         Tft.setPage(i, i);
-      } else {
+      }
+      else
+      {
         Tft.setPage(__Gnbmp_height - i - 1, __Gnbmp_height - i - 1);
       }
 
@@ -230,7 +253,8 @@ void bmpdraw(File f, int x, int y, int dir) {
       TFT_DC_HIGH;
       TFT_CS_LOW;
 
-      for (int m = 0; m < BUFFPIXEL; m++) {
+      for (int m = 0; m < BUFFPIXEL; m++)
+      {
         SPI.transfer(__color[m] >> 8);
         SPI.transfer(__color[m]);
 
@@ -245,12 +269,14 @@ void bmpdraw(File f, int x, int y, int dir) {
   Serial.println(" ms");
 }
 
-boolean bmpReadHeader(File f) {
+boolean bmpReadHeader(File f)
+{
   // read header
   uint32_t tmp;
-  uint8_t bmpDepth;
+  uint8_t  bmpDepth;
 
-  if (read16(f) != 0x4D42) {
+  if (read16(f) != 0x4D42)
+  {
     // magic bytes missing
     return false;
   }
@@ -272,14 +298,16 @@ boolean bmpReadHeader(File f) {
   Serial.print("header size ");
   Serial.println(tmp, DEC);
 
-  int bmp_width = read32(f);
+  int bmp_width  = read32(f);
   int bmp_height = read32(f);
 
-  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) { // if image is not 320x240, return false
+  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height)
+  {  // if image is not 320x240, return false
     return false;
   }
 
-  if (read16(f) != 1) {
+  if (read16(f) != 1)
+  {
     return false;
   }
 
@@ -287,7 +315,8 @@ boolean bmpReadHeader(File f) {
   Serial.print("bitdepth ");
   Serial.println(bmpDepth, DEC);
 
-  if (read32(f) != 0) {
+  if (read32(f) != 0)
+  {
     // compression not supported!
     return false;
   }
@@ -303,9 +332,10 @@ boolean bmpReadHeader(File f) {
 // (the data is stored in little endian format!)
 
 // LITTLE ENDIAN!
-uint16_t read16(File f) {
+uint16_t read16(File f)
+{
   uint16_t d;
-  uint8_t b;
+  uint8_t  b;
   b = f.read();
   d = f.read();
   d <<= 8;
@@ -314,7 +344,8 @@ uint16_t read16(File f) {
 }
 
 // LITTLE ENDIAN!
-uint32_t read32(File f) {
+uint32_t read32(File f)
+{
   uint32_t d;
   uint16_t b;
 
diff --git a/libraries/Ticker/examples/TickerBasic/TickerBasic.ino b/libraries/Ticker/examples/TickerBasic/TickerBasic.ino
index 0eed169ee2..70d8d32d7f 100644
--- a/libraries/Ticker/examples/TickerBasic/TickerBasic.ino
+++ b/libraries/Ticker/examples/TickerBasic/TickerBasic.ino
@@ -16,24 +16,28 @@
 
 Ticker flipper;
 
-int count = 0;
+int    count = 0;
 
-void flip() {
-  int state = digitalRead(LED_BUILTIN); // get the current state of GPIO1 pin
-  digitalWrite(LED_BUILTIN, !state); // set pin to the opposite state
+void   flip()
+{
+  int state = digitalRead(LED_BUILTIN);  // get the current state of GPIO1 pin
+  digitalWrite(LED_BUILTIN, !state);     // set pin to the opposite state
 
   ++count;
   // when the counter reaches a certain value, start blinking like crazy
-  if (count == 20) {
+  if (count == 20)
+  {
     flipper.attach(0.1, flip);
   }
   // when the counter reaches yet another value, stop blinking
-  else if (count == 120) {
+  else if (count == 120)
+  {
     flipper.detach();
   }
 }
 
-void setup() {
+void setup()
+{
   pinMode(LED_BUILTIN, OUTPUT);
   digitalWrite(LED_BUILTIN, LOW);
 
@@ -41,5 +45,6 @@ void setup() {
   flipper.attach(0.3, flip);
 }
 
-void loop() {
+void loop()
+{
 }
diff --git a/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino b/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
index 970bf7235a..0226049611 100644
--- a/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
+++ b/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
@@ -7,44 +7,50 @@
 #define LED4 14
 #define LED5 15
 
-class ExampleClass {
+class ExampleClass
+{
   public:
-  ExampleClass(int pin, int duration)
-      : _pin(pin)
-      , _duration(duration) {
+  ExampleClass(int pin, int duration) :
+      _pin(pin), _duration(duration)
+  {
     pinMode(_pin, OUTPUT);
     _myTicker.attach_ms(_duration, std::bind(&ExampleClass::classBlink, this));
   }
   ~ExampleClass() {};
 
-  int _pin, _duration;
+  int    _pin, _duration;
   Ticker _myTicker;
 
-  void classBlink() {
+  void   classBlink()
+  {
     digitalWrite(_pin, !digitalRead(_pin));
   }
 };
 
-void staticBlink() {
+void staticBlink()
+{
   digitalWrite(LED2, !digitalRead(LED2));
 }
 
-void scheduledBlink() {
+void scheduledBlink()
+{
   digitalWrite(LED3, !digitalRead(LED2));
 }
 
-void parameterBlink(int p) {
+void parameterBlink(int p)
+{
   digitalWrite(p, !digitalRead(p));
 }
 
-Ticker staticTicker;
-Ticker scheduledTicker;
-Ticker parameterTicker;
-Ticker lambdaTicker;
+Ticker       staticTicker;
+Ticker       scheduledTicker;
+Ticker       parameterTicker;
+Ticker       lambdaTicker;
 
 ExampleClass example(LED1, 100);
 
-void setup() {
+void         setup()
+{
   pinMode(LED2, OUTPUT);
   staticTicker.attach_ms(100, staticBlink);
 
@@ -55,10 +61,10 @@ void setup() {
   parameterTicker.attach_ms(100, std::bind(parameterBlink, LED4));
 
   pinMode(LED5, OUTPUT);
-  lambdaTicker.attach_ms(100, []() {
-    digitalWrite(LED5, !digitalRead(LED5));
-  });
+  lambdaTicker.attach_ms(100, []()
+                         { digitalWrite(LED5, !digitalRead(LED5)); });
 }
 
-void loop() {
+void loop()
+{
 }
diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp
index 592bbb08c4..a5606bddc3 100644
--- a/libraries/Wire/Wire.cpp
+++ b/libraries/Wire/Wire.cpp
@@ -41,15 +41,15 @@ extern "C"
 // Initialize Class Variables //////////////////////////////////////////////////
 
 uint8_t TwoWire::rxBuffer[I2C_BUFFER_LENGTH];
-size_t TwoWire::rxBufferIndex = 0;
-size_t TwoWire::rxBufferLength = 0;
+size_t  TwoWire::rxBufferIndex  = 0;
+size_t  TwoWire::rxBufferLength = 0;
 
-uint8_t TwoWire::txAddress = 0;
+uint8_t TwoWire::txAddress      = 0;
 uint8_t TwoWire::txBuffer[I2C_BUFFER_LENGTH];
-size_t TwoWire::txBufferIndex = 0;
-size_t TwoWire::txBufferLength = 0;
+size_t  TwoWire::txBufferIndex  = 0;
+size_t  TwoWire::txBufferLength = 0;
 
-uint8_t TwoWire::transmitting = 0;
+uint8_t TwoWire::transmitting   = 0;
 void (*TwoWire::user_onRequest)(void);
 void (*TwoWire::user_onReceive)(size_t);
 
@@ -126,8 +126,8 @@ size_t TwoWire::requestFrom(uint8_t address, size_t size, bool sendStop)
     {
         size = I2C_BUFFER_LENGTH;
     }
-    size_t read = (twi_readFrom(address, rxBuffer, size, sendStop) == 0) ? size : 0;
-    rxBufferIndex = 0;
+    size_t read    = (twi_readFrom(address, rxBuffer, size, sendStop) == 0) ? size : 0;
+    rxBufferIndex  = 0;
     rxBufferLength = read;
     return read;
 }
@@ -154,9 +154,9 @@ uint8_t TwoWire::requestFrom(int address, int quantity, int sendStop)
 
 void TwoWire::beginTransmission(uint8_t address)
 {
-    transmitting = 1;
-    txAddress = address;
-    txBufferIndex = 0;
+    transmitting   = 1;
+    txAddress      = address;
+    txBufferIndex  = 0;
     txBufferLength = 0;
 }
 
@@ -167,10 +167,10 @@ void TwoWire::beginTransmission(int address)
 
 uint8_t TwoWire::endTransmission(uint8_t sendStop)
 {
-    int8_t ret = twi_writeTo(txAddress, txBuffer, txBufferLength, sendStop);
-    txBufferIndex = 0;
+    int8_t ret     = twi_writeTo(txAddress, txBuffer, txBufferLength, sendStop);
+    txBufferIndex  = 0;
     txBufferLength = 0;
-    transmitting = 0;
+    transmitting   = 0;
     return ret;
 }
 
@@ -255,9 +255,9 @@ int TwoWire::peek(void)
 
 void TwoWire::flush(void)
 {
-    rxBufferIndex = 0;
+    rxBufferIndex  = 0;
     rxBufferLength = 0;
-    txBufferIndex = 0;
+    txBufferIndex  = 0;
     txBufferLength = 0;
 }
 
@@ -283,7 +283,7 @@ void TwoWire::onReceiveService(uint8_t* inBytes, size_t numBytes)
     }
 
     // set rx iterator vars
-    rxBufferIndex = 0;
+    rxBufferIndex  = 0;
     rxBufferLength = numBytes;
 
     // alert user program
@@ -300,7 +300,7 @@ void TwoWire::onRequestService(void)
 
     // reset tx buffer iterator vars
     // !!! this will kill any pending pre-master sendTo() activity
-    txBufferIndex = 0;
+    txBufferIndex  = 0;
     txBufferLength = 0;
 
     // alert user program
diff --git a/libraries/Wire/Wire.h b/libraries/Wire/Wire.h
index 1b2a00b908..bba50fa3f6 100644
--- a/libraries/Wire/Wire.h
+++ b/libraries/Wire/Wire.h
@@ -37,13 +37,13 @@ class TwoWire : public Stream
 {
 private:
     static uint8_t rxBuffer[];
-    static size_t rxBufferIndex;
-    static size_t rxBufferLength;
+    static size_t  rxBufferIndex;
+    static size_t  rxBufferLength;
 
     static uint8_t txAddress;
     static uint8_t txBuffer[];
-    static size_t txBufferIndex;
-    static size_t txBufferLength;
+    static size_t  txBufferIndex;
+    static size_t  txBufferLength;
 
     static uint8_t transmitting;
     static void (*user_onRequest)(void);
@@ -53,35 +53,35 @@ class TwoWire : public Stream
 
 public:
     TwoWire();
-    void begin(int sda, int scl);
-    void begin(int sda, int scl, uint8_t address);
-    void pins(int sda, int scl) __attribute__((deprecated));  // use begin(sda, scl) in new code
-    void begin();
-    void begin(uint8_t);
-    void begin(int);
-    void setClock(uint32_t);
-    void setClockStretchLimit(uint32_t);
-    void beginTransmission(uint8_t);
-    void beginTransmission(int);
-    uint8_t endTransmission(void);
-    uint8_t endTransmission(uint8_t);
-    size_t requestFrom(uint8_t address, size_t size, bool sendStop);
-    uint8_t status();
-
-    uint8_t requestFrom(uint8_t, uint8_t);
-    uint8_t requestFrom(uint8_t, uint8_t, uint8_t);
-    uint8_t requestFrom(int, int);
-    uint8_t requestFrom(int, int, int);
+    void           begin(int sda, int scl);
+    void           begin(int sda, int scl, uint8_t address);
+    void           pins(int sda, int scl) __attribute__((deprecated));  // use begin(sda, scl) in new code
+    void           begin();
+    void           begin(uint8_t);
+    void           begin(int);
+    void           setClock(uint32_t);
+    void           setClockStretchLimit(uint32_t);
+    void           beginTransmission(uint8_t);
+    void           beginTransmission(int);
+    uint8_t        endTransmission(void);
+    uint8_t        endTransmission(uint8_t);
+    size_t         requestFrom(uint8_t address, size_t size, bool sendStop);
+    uint8_t        status();
+
+    uint8_t        requestFrom(uint8_t, uint8_t);
+    uint8_t        requestFrom(uint8_t, uint8_t, uint8_t);
+    uint8_t        requestFrom(int, int);
+    uint8_t        requestFrom(int, int, int);
 
     virtual size_t write(uint8_t);
     virtual size_t write(const uint8_t*, size_t);
-    virtual int available(void);
-    virtual int read(void);
-    virtual int peek(void);
-    virtual void flush(void);
-    void onReceive(void (*)(int));     // arduino api
-    void onReceive(void (*)(size_t));  // legacy esp8266 backward compatibility
-    void onRequest(void (*)(void));
+    virtual int    available(void);
+    virtual int    read(void);
+    virtual int    peek(void);
+    virtual void   flush(void);
+    void           onReceive(void (*)(int));     // arduino api
+    void           onReceive(void (*)(size_t));  // legacy esp8266 backward compatibility
+    void           onRequest(void (*)(void));
 
     using Print::write;
 };
diff --git a/libraries/Wire/examples/master_reader/master_reader.ino b/libraries/Wire/examples/master_reader/master_reader.ino
index bc464d529a..478ce34309 100644
--- a/libraries/Wire/examples/master_reader/master_reader.ino
+++ b/libraries/Wire/examples/master_reader/master_reader.ino
@@ -14,23 +14,27 @@
 #define SDA_PIN 4
 #define SCL_PIN 5
 const int16_t I2C_MASTER = 0x42;
-const int16_t I2C_SLAVE = 0x08;
+const int16_t I2C_SLAVE  = 0x08;
 
-void setup() {
-  Serial.begin(115200); // start serial for output
-  Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER); // join i2c bus (address optional for master)
+void          setup()
+{
+  Serial.begin(115200);                      // start serial for output
+  Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER);  // join i2c bus (address optional for master)
 }
 
-void loop() {
+void loop()
+{
   using periodic = esp8266::polledTimeout::periodicMs;
   static periodic nextPing(1000);
 
-  if (nextPing) {
-    Wire.requestFrom(I2C_SLAVE, 6); // request 6 bytes from slave device #8
+  if (nextPing)
+  {
+    Wire.requestFrom(I2C_SLAVE, 6);  // request 6 bytes from slave device #8
 
-    while (Wire.available()) { // slave may send less than requested
-      char c = Wire.read(); // receive a byte as character
-      Serial.print(c); // print the character
+    while (Wire.available())
+    {                        // slave may send less than requested
+      char c = Wire.read();  // receive a byte as character
+      Serial.print(c);       // print the character
     }
   }
 }
diff --git a/libraries/Wire/examples/master_writer/master_writer.ino b/libraries/Wire/examples/master_writer/master_writer.ino
index d19edbd27a..d1d8887cee 100644
--- a/libraries/Wire/examples/master_writer/master_writer.ino
+++ b/libraries/Wire/examples/master_writer/master_writer.ino
@@ -14,23 +14,26 @@
 #define SDA_PIN 4
 #define SCL_PIN 5
 const int16_t I2C_MASTER = 0x42;
-const int16_t I2C_SLAVE = 0x08;
+const int16_t I2C_SLAVE  = 0x08;
 
-void setup() {
-  Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER); // join i2c bus (address optional for master)
+void          setup()
+{
+  Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER);  // join i2c bus (address optional for master)
 }
 
 byte x = 0;
 
-void loop() {
+void loop()
+{
   using periodic = esp8266::polledTimeout::periodicMs;
   static periodic nextPing(1000);
 
-  if (nextPing) {
-    Wire.beginTransmission(I2C_SLAVE); // transmit to device #8
-    Wire.write("x is "); // sends five bytes
-    Wire.write(x); // sends one byte
-    Wire.endTransmission(); // stop transmitting
+  if (nextPing)
+  {
+    Wire.beginTransmission(I2C_SLAVE);  // transmit to device #8
+    Wire.write("x is ");                // sends five bytes
+    Wire.write(x);                      // sends one byte
+    Wire.endTransmission();             // stop transmitting
 
     x++;
   }
diff --git a/libraries/Wire/examples/slave_receiver/slave_receiver.ino b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
index 812ed0e385..1bad5d1adb 100644
--- a/libraries/Wire/examples/slave_receiver/slave_receiver.ino
+++ b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
@@ -14,27 +14,30 @@
 #define SCL_PIN 5
 
 const int16_t I2C_MASTER = 0x42;
-const int16_t I2C_SLAVE = 0x08;
+const int16_t I2C_SLAVE  = 0x08;
 
-void setup() {
-  Serial.begin(115200); // start serial for output
+void          setup()
+{
+  Serial.begin(115200);  // start serial for output
 
-  Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE); // new syntax: join i2c bus (address required for slave)
-  Wire.onReceive(receiveEvent); // register event
+  Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE);  // new syntax: join i2c bus (address required for slave)
+  Wire.onReceive(receiveEvent);             // register event
 }
 
-void loop() {
+void loop()
+{
 }
 
 // function that executes whenever data is received from master
 // this function is registered as an event, see setup()
-void receiveEvent(size_t howMany) {
-
+void receiveEvent(size_t howMany)
+{
   (void)howMany;
-  while (1 < Wire.available()) { // loop through all but the last
-    char c = Wire.read(); // receive byte as a character
-    Serial.print(c); // print the character
+  while (1 < Wire.available())
+  {                        // loop through all but the last
+    char c = Wire.read();  // receive byte as a character
+    Serial.print(c);       // print the character
   }
-  int x = Wire.read(); // receive byte as an integer
-  Serial.println(x); // print the integer
+  int x = Wire.read();  // receive byte as an integer
+  Serial.println(x);    // print the integer
 }
diff --git a/libraries/Wire/examples/slave_sender/slave_sender.ino b/libraries/Wire/examples/slave_sender/slave_sender.ino
index 31bfbc40e3..eeadfe1c3f 100644
--- a/libraries/Wire/examples/slave_sender/slave_sender.ino
+++ b/libraries/Wire/examples/slave_sender/slave_sender.ino
@@ -13,19 +13,22 @@
 #define SDA_PIN 4
 #define SCL_PIN 5
 const int16_t I2C_MASTER = 0x42;
-const int16_t I2C_SLAVE = 0x08;
+const int16_t I2C_SLAVE  = 0x08;
 
-void setup() {
-  Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE); // join i2c bus with address #8
-  Wire.onRequest(requestEvent); // register event
+void          setup()
+{
+  Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE);  // join i2c bus with address #8
+  Wire.onRequest(requestEvent);             // register event
 }
 
-void loop() {
+void loop()
+{
 }
 
 // function that executes whenever data is requested by master
 // this function is registered as an event, see setup()
-void requestEvent() {
-  Wire.write("hello\n"); // respond with message of 6 bytes
+void requestEvent()
+{
+  Wire.write("hello\n");  // respond with message of 6 bytes
   // as expected by master
 }
diff --git a/libraries/esp8266/examples/Blink/Blink.ino b/libraries/esp8266/examples/Blink/Blink.ino
index cf7d4c55e4..eddbbdb1a5 100644
--- a/libraries/esp8266/examples/Blink/Blink.ino
+++ b/libraries/esp8266/examples/Blink/Blink.ino
@@ -9,16 +9,18 @@
   Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
 */
 
-void setup() {
-  pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
+void setup()
+{
+  pinMode(LED_BUILTIN, OUTPUT);  // Initialize the LED_BUILTIN pin as an output
 }
 
 // the loop function runs over and over again forever
-void loop() {
-  digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level
+void loop()
+{
+  digitalWrite(LED_BUILTIN, LOW);  // Turn the LED on (Note that LOW is the voltage level
   // but actually the LED is on; this is because
   // it is active low on the ESP-01)
-  delay(1000); // Wait for a second
-  digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
-  delay(2000); // Wait for two seconds (to demonstrate the active low LED)
+  delay(1000);                      // Wait for a second
+  digitalWrite(LED_BUILTIN, HIGH);  // Turn the LED off by making the voltage HIGH
+  delay(2000);                      // Wait for two seconds (to demonstrate the active low LED)
 }
diff --git a/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino b/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
index 304c27d384..58b6387e81 100644
--- a/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
+++ b/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
@@ -24,22 +24,26 @@
 
 #include <PolledTimeout.h>
 
-void ledOn() {
-  digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level
+void ledOn()
+{
+  digitalWrite(LED_BUILTIN, LOW);  // Turn the LED on (Note that LOW is the voltage level
 }
 
-void ledOff() {
-  digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
+void ledOff()
+{
+  digitalWrite(LED_BUILTIN, HIGH);  // Turn the LED off by making the voltage HIGH
 }
 
-void ledToggle() {
-  digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); // Change the state of the LED
+void ledToggle()
+{
+  digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));  // Change the state of the LED
 }
 
-esp8266::polledTimeout::periodicFastUs halfPeriod(500000); //use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace
+esp8266::polledTimeout::periodicFastUs halfPeriod(500000);  //use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace
 
 // the setup function runs only once at start
-void setup() {
+void                                   setup()
+{
   Serial.begin(115200);
 
   Serial.println();
@@ -48,23 +52,24 @@ void setup() {
   Serial.printf("periodic/oneShotFastUs::timeMax() = %u us\n", (uint32_t)esp8266::polledTimeout::periodicFastUs::timeMax());
   Serial.printf("periodic/oneShotFastNs::timeMax() = %u ns\n", (uint32_t)esp8266::polledTimeout::periodicFastNs::timeMax());
 
-#if 0 // 1 for debugging polledTimeout
+#if 0  // 1 for debugging polledTimeout
   Serial.printf("periodic/oneShotMs::rangeCompensate     = %u\n", (uint32_t)esp8266::polledTimeout::periodicMs::rangeCompensate);
   Serial.printf("periodic/oneShotFastMs::rangeCompensate = %u\n", (uint32_t)esp8266::polledTimeout::periodicFastMs::rangeCompensate);
   Serial.printf("periodic/oneShotFastUs::rangeCompensate = %u\n", (uint32_t)esp8266::polledTimeout::periodicFastUs::rangeCompensate);
   Serial.printf("periodic/oneShotFastNs::rangeCompensate = %u\n", (uint32_t)esp8266::polledTimeout::periodicFastNs::rangeCompensate);
 #endif
 
-  pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
+  pinMode(LED_BUILTIN, OUTPUT);  // Initialize the LED_BUILTIN pin as an output
 
-  using esp8266::polledTimeout::oneShotMs; //import the type to the local namespace
+  using esp8266::polledTimeout::oneShotMs;  //import the type to the local namespace
 
   //STEP1; turn the led ON
   ledOn();
 
   //STEP2: wait for ON timeout
   oneShotMs timeoutOn(2000);
-  while (!timeoutOn) {
+  while (!timeoutOn)
+  {
     yield();
   }
 
@@ -73,17 +78,20 @@ void setup() {
 
   //STEP4: wait for OFF timeout to assure the led is kept off for this time before exiting setup
   oneShotMs timeoutOff(2000);
-  while (!timeoutOff) {
+  while (!timeoutOff)
+  {
     yield();
   }
 
   //Done with STEPs, do other stuff
-  halfPeriod.reset(); //halfPeriod is global, so it gets inited on sketch start. Clear it here to make it ready for loop, where it's actually used.
+  halfPeriod.reset();  //halfPeriod is global, so it gets inited on sketch start. Clear it here to make it ready for loop, where it's actually used.
 }
 
 // the loop function runs over and over again forever
-void loop() {
-  if (halfPeriod) {
+void loop()
+{
+  if (halfPeriod)
+  {
     ledToggle();
   }
 }
diff --git a/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino b/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
index a1af7aab53..3c63eec3cc 100644
--- a/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
+++ b/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
@@ -10,23 +10,29 @@
   Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
 */
 
-int ledState = LOW;
+int           ledState       = LOW;
 
 unsigned long previousMillis = 0;
-const long interval = 1000;
+const long    interval       = 1000;
 
-void setup() {
+void          setup()
+{
   pinMode(LED_BUILTIN, OUTPUT);
 }
 
-void loop() {
+void loop()
+{
   unsigned long currentMillis = millis();
-  if (currentMillis - previousMillis >= interval) {
+  if (currentMillis - previousMillis >= interval)
+  {
     previousMillis = currentMillis;
-    if (ledState == LOW) {
-      ledState = HIGH; // Note that this switches the LED *off*
-    } else {
-      ledState = LOW; // Note that this switches the LED *on*
+    if (ledState == LOW)
+    {
+      ledState = HIGH;  // Note that this switches the LED *off*
+    }
+    else
+    {
+      ledState = LOW;  // Note that this switches the LED *on*
     }
     digitalWrite(LED_BUILTIN, ledState);
   }
diff --git a/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino b/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
index b4aff127fb..257e94c125 100644
--- a/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
+++ b/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
@@ -4,61 +4,69 @@
 
 using namespace experimental::CBListImplentation;
 
-class exampleClass {
+class exampleClass
+{
   public:
   exampleClass() {};
 
   using exCallBack = std::function<void(int)>;
-  using exHandler = CallBackList<exCallBack>::CallBackHandler;
+  using exHandler  = CallBackList<exCallBack>::CallBackHandler;
 
   CallBackList<exCallBack> myHandlers;
 
-  exHandler setHandler(exCallBack cb) {
+  exHandler                setHandler(exCallBack cb)
+  {
     return myHandlers.add(cb);
   }
 
-  void removeHandler(exHandler hnd) {
+  void removeHandler(exHandler hnd)
+  {
     myHandlers.remove(hnd);
   }
 
-  void trigger(int t) {
+  void trigger(int t)
+  {
     myHandlers.execute(t);
   }
 };
 
 exampleClass myExample;
 
-void cb1(int in) {
+void         cb1(int in)
+{
   Serial.printf("Callback 1, in = %d\n", in);
 }
 
-void cb2(int in) {
+void cb2(int in)
+{
   Serial.printf("Callback 2, in = %d\n", in);
 }
 
-void cb3(int in, int s) {
+void cb3(int in, int s)
+{
   Serial.printf("Callback 3, in = %d, s = %d\n", in, s);
 }
 
-Ticker tk, tk2, tk3;
+Ticker                  tk, tk2, tk3;
 exampleClass::exHandler e1 = myExample.setHandler(cb1);
 exampleClass::exHandler e2 = myExample.setHandler(cb2);
 exampleClass::exHandler e3 = myExample.setHandler(std::bind(cb3, std::placeholders::_1, 10));
 
-void setup() {
+void                    setup()
+{
   Serial.begin(115200);
 
-  tk.attach_ms(2000, []() {
-    Serial.printf("trigger %d\n", (uint32_t)millis());
-    myExample.trigger(millis());
-  });
-  tk2.once_ms(10000, []() {
-    myExample.removeHandler(e2);
-  });
-  tk3.once_ms(20000, []() {
-    e3.reset();
-  });
+  tk.attach_ms(2000, []()
+               {
+                 Serial.printf("trigger %d\n", (uint32_t)millis());
+                 myExample.trigger(millis());
+               });
+  tk2.once_ms(10000, []()
+              { myExample.removeHandler(e2); });
+  tk3.once_ms(20000, []()
+              { e3.reset(); });
 }
 
-void loop() {
+void loop()
+{
 }
diff --git a/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino b/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
index 95a92c9ca2..787f2c742f 100644
--- a/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
+++ b/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
@@ -5,14 +5,16 @@
    Released to the Public Domain by Earle F. Philhower, III <earlephilhower@yahoo.com>
 */
 
-extern "C" {
+extern "C"
+{
 #include "spi_flash.h"
 }
 // Artificially create a space in PROGMEM that fills multiple sectors so
 // we can corrupt one without crashing the system
 const int corruptme[SPI_FLASH_SEC_SIZE * 4] PROGMEM = { 0 };
 
-void setup() {
+void      setup()
+{
   Serial.begin(115200);
   Serial.printf("Starting\n");
   Serial.printf("CRC check: %s\n", ESP.checkFlashCRC() ? "OK" : "ERROR");
@@ -21,12 +23,12 @@ void setup() {
   uint32_t ptr = (uint32_t)corruptme;
   // Find a page aligned spot inside the array
   ptr += 2 * SPI_FLASH_SEC_SIZE;
-  ptr &= ~(SPI_FLASH_SEC_SIZE - 1); // Sectoralign
-  uint32_t sector = ((((uint32_t)ptr - 0x40200000) / SPI_FLASH_SEC_SIZE));
+  ptr &= ~(SPI_FLASH_SEC_SIZE - 1);  // Sectoralign
+  uint32_t  sector = ((((uint32_t)ptr - 0x40200000) / SPI_FLASH_SEC_SIZE));
 
   // Create a sector with 1 bit set (i.e. fake corruption)
-  uint32_t* space = (uint32_t*)calloc(SPI_FLASH_SEC_SIZE, 1);
-  space[42] = 64;
+  uint32_t* space  = (uint32_t*)calloc(SPI_FLASH_SEC_SIZE, 1);
+  space[42]        = 64;
 
   // Write it into flash at the spot in question
   spi_flash_erase_sector(sector);
@@ -40,5 +42,6 @@ void setup() {
   Serial.printf("CRC check: %s\n", ESP.checkFlashCRC() ? "OK" : "ERROR");
 }
 
-void loop() {
+void loop()
+{
 }
diff --git a/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino b/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
index f5ac22f10b..7150e8c833 100644
--- a/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
+++ b/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
@@ -5,15 +5,16 @@
 
 */
 
-void setup(void) {
+void setup(void)
+{
   Serial.begin(115200);
 }
 
-void loop() {
-
-  uint32_t realSize = ESP.getFlashChipRealSize();
-  uint32_t ideSize = ESP.getFlashChipSize();
-  FlashMode_t ideMode = ESP.getFlashChipMode();
+void loop()
+{
+  uint32_t    realSize = ESP.getFlashChipRealSize();
+  uint32_t    ideSize  = ESP.getFlashChipSize();
+  FlashMode_t ideMode  = ESP.getFlashChipMode();
 
   Serial.printf("Flash real id:   %08X\n", ESP.getFlashChipId());
   Serial.printf("Flash real size: %u bytes\n\n", realSize);
@@ -21,13 +22,16 @@ void loop() {
   Serial.printf("Flash ide  size: %u bytes\n", ideSize);
   Serial.printf("Flash ide speed: %u Hz\n", ESP.getFlashChipSpeed());
   Serial.printf("Flash ide mode:  %s\n", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT"
-                                                 : ideMode == FM_DIO                     ? "DIO"
-                                                 : ideMode == FM_DOUT                    ? "DOUT"
+                                              : ideMode == FM_DIO                        ? "DIO"
+                                              : ideMode == FM_DOUT                       ? "DOUT"
                                                                                          : "UNKNOWN"));
 
-  if (ideSize != realSize) {
+  if (ideSize != realSize)
+  {
     Serial.println("Flash Chip configuration wrong!\n");
-  } else {
+  }
+  else
+  {
     Serial.println("Flash Chip configuration ok.\n");
   }
 
diff --git a/libraries/esp8266/examples/ConfigFile/ConfigFile.ino b/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
index 964b2dc7e0..879e994d59 100644
--- a/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
+++ b/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
@@ -14,21 +14,24 @@
 // more and possibly updated information can be found at:
 // https://arduinojson.org/v6/example/config/
 
-bool loadConfig() {
+bool loadConfig()
+{
   File configFile = LittleFS.open("/config.json", "r");
-  if (!configFile) {
+  if (!configFile)
+  {
     Serial.println("Failed to open config file");
     return false;
   }
 
   StaticJsonDocument<200> doc;
-  auto error = deserializeJson(doc, configFile);
-  if (error) {
+  auto                    error = deserializeJson(doc, configFile);
+  if (error)
+  {
     Serial.println("Failed to parse config file");
     return false;
   }
 
-  const char* serverName = doc["serverName"];
+  const char* serverName  = doc["serverName"];
   const char* accessToken = doc["accessToken"];
 
   // Real world application would store these values in some variables for
@@ -41,13 +44,15 @@ bool loadConfig() {
   return true;
 }
 
-bool saveConfig() {
+bool saveConfig()
+{
   StaticJsonDocument<200> doc;
-  doc["serverName"] = "api.example.com";
+  doc["serverName"]  = "api.example.com";
   doc["accessToken"] = "128du9as8du12eoue8da98h123ueh9h98";
 
-  File configFile = LittleFS.open("/config.json", "w");
-  if (!configFile) {
+  File configFile    = LittleFS.open("/config.json", "w");
+  if (!configFile)
+  {
     Serial.println("Failed to open config file for writing");
     return false;
   }
@@ -56,29 +61,38 @@ bool saveConfig() {
   return true;
 }
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   Serial.println("");
   delay(1000);
   Serial.println("Mounting FS...");
 
-  if (!LittleFS.begin()) {
+  if (!LittleFS.begin())
+  {
     Serial.println("Failed to mount file system");
     return;
   }
 
-  if (!saveConfig()) {
+  if (!saveConfig())
+  {
     Serial.println("Failed to save config");
-  } else {
+  }
+  else
+  {
     Serial.println("Config saved");
   }
 
-  if (!loadConfig()) {
+  if (!loadConfig())
+  {
     Serial.println("Failed to load config");
-  } else {
+  }
+  else
+  {
     Serial.println("Config loaded");
   }
 }
 
-void loop() {
+void loop()
+{
 }
diff --git a/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino b/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
index e2ecb41bf6..d5c01b31c7 100644
--- a/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
+++ b/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
@@ -28,7 +28,8 @@
 esp8266::polledTimeout::periodicFastUs stepPeriod(50000);
 
 // the setup function runs only once at start
-void setup() {
+void                                   setup()
+{
   Serial.begin(115200);
   Serial.println();
 
@@ -39,31 +40,37 @@ void setup() {
   // PWM-Locked generator:   https://github.com/esp8266/Arduino/pull/7231
   enablePhaseLockedWaveform();
 
-  pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
+  pinMode(LED_BUILTIN, OUTPUT);  // Initialize the LED_BUILTIN pin as an output
   analogWriteRange(1000);
 
-  using esp8266::polledTimeout::oneShotMs; //import the type to the local namespace
+  using esp8266::polledTimeout::oneShotMs;  //import the type to the local namespace
 
-  digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level
+  digitalWrite(LED_BUILTIN, LOW);  // Turn the LED on (Note that LOW is the voltage level
 
   oneShotMs timeoutOn(2000);
-  while (!timeoutOn) {
+  while (!timeoutOn)
+  {
     yield();
   }
 
   stepPeriod.reset();
 }
 
-void loop() {
-  static int val = 0;
+void loop()
+{
+  static int val   = 0;
   static int delta = 100;
-  if (stepPeriod) {
+  if (stepPeriod)
+  {
     val += delta;
-    if (val < 0) {
-      val = 100;
+    if (val < 0)
+    {
+      val   = 100;
       delta = 100;
-    } else if (val > 1000) {
-      val = 900;
+    }
+    else if (val > 1000)
+    {
+      val   = 900;
       delta = -100;
     }
     analogWrite(LED_BUILTIN, val);
diff --git a/libraries/esp8266/examples/HeapMetric/HeapMetric.ino b/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
index 387ac5624a..47a20b21e3 100644
--- a/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
+++ b/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
@@ -6,12 +6,13 @@
 #include <umm_malloc/umm_malloc.h>
 #include <umm_malloc/umm_heap_select.h>
 
-void stats(const char* what) {
+void stats(const char* what)
+{
   // we could use getFreeHeap() getMaxFreeBlockSize() and getHeapFragmentation()
   // or all at once:
   uint32_t free;
   uint32_t max;
-  uint8_t frag;
+  uint8_t  frag;
   ESP.getHeapStats(&free, &max, &frag);
 
   Serial.printf("free: %7u - max: %7u - frag: %3d%% <- ", free, max, frag);
@@ -19,9 +20,10 @@ void stats(const char* what) {
   Serial.println(what);
 }
 
-void tryit(int blocksize) {
+void tryit(int blocksize)
+{
   void** p;
-  int blocks;
+  int    blocks;
 
   /*
     heap-used ~= blocks*sizeof(void*) + blocks*blocksize
@@ -52,48 +54,56 @@ void tryit(int blocksize) {
     calculation of multiple elements combined with the rounding up for the
     8-byte alignment of each allocation can make for some tricky calculations.
   */
-  int rawMemoryMaxFreeBlockSize = ESP.getMaxFreeBlockSize();
+  int    rawMemoryMaxFreeBlockSize = ESP.getMaxFreeBlockSize();
   // Remove the space for overhead component of the blocks*sizeof(void*) array.
-  int maxFreeBlockSize = rawMemoryMaxFreeBlockSize - UMM_OVERHEAD_ADJUST;
+  int    maxFreeBlockSize          = rawMemoryMaxFreeBlockSize - UMM_OVERHEAD_ADJUST;
   // Initial estimate to use all of the MaxFreeBlock with multiples of 8 rounding up.
-  blocks = maxFreeBlockSize / (((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + sizeof(void*));
+  blocks                           = maxFreeBlockSize / (((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + sizeof(void*));
   /*
     While we allowed for the 8-byte alignment overhead for blocks*blocksize we
     were unable to compensate in advance for the later 8-byte aligning needed
     for the blocks*sizeof(void*) allocation. Thus blocks may be off by one count.
     We now validate the estimate and adjust as needed.
   */
-  int rawMemoryEstimate = blocks * ((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + ((blocks * sizeof(void*) + UMM_OVERHEAD_ADJUST + 7) & ~7);
-  if (rawMemoryMaxFreeBlockSize < rawMemoryEstimate) {
+  int rawMemoryEstimate            = blocks * ((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + ((blocks * sizeof(void*) + UMM_OVERHEAD_ADJUST + 7) & ~7);
+  if (rawMemoryMaxFreeBlockSize < rawMemoryEstimate)
+  {
     --blocks;
   }
   Serial.printf("\nFilling memory with blocks of %d bytes each\n", blocksize);
   stats("before");
 
   p = (void**)malloc(sizeof(void*) * blocks);
-  for (int i = 0; i < blocks; i++) {
+  for (int i = 0; i < blocks; i++)
+  {
     p[i] = malloc(blocksize);
   }
   stats("array and blocks allocation");
 
-  for (int i = 0; i < blocks; i += 2) {
-    if (p[i]) {
+  for (int i = 0; i < blocks; i += 2)
+  {
+    if (p[i])
+    {
       free(p[i]);
     }
     p[i] = nullptr;
   }
   stats("freeing every other blocks");
 
-  for (int i = 0; i < (blocks - 1); i += 4) {
-    if (p[i + 1]) {
+  for (int i = 0; i < (blocks - 1); i += 4)
+  {
+    if (p[i + 1])
+    {
       free(p[i + 1]);
     }
     p[i + 1] = nullptr;
   }
   stats("freeing every other remaining blocks");
 
-  for (int i = 0; i < blocks; i++) {
-    if (p[i]) {
+  for (int i = 0; i < blocks; i++)
+  {
+    if (p[i])
+    {
       free(p[i]);
     }
   }
@@ -103,7 +113,8 @@ void tryit(int blocksize) {
   stats("after");
 }
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   WiFi.mode(WIFI_OFF);
   delay(50);
@@ -155,5 +166,6 @@ void setup() {
 #endif
 }
 
-void loop() {
+void loop()
+{
 }
diff --git a/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino b/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
index c7c3249888..c49a7a4867 100644
--- a/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
+++ b/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
@@ -8,7 +8,7 @@
 #include <TypeConversion.h>
 #include <Crypto.h>
 
-namespace TypeCast = experimental::TypeConversion;
+namespace TypeCast                 = experimental::TypeConversion;
 
 /**
    NOTE: Although we could define the strings below as normal String variables,
@@ -21,9 +21,10 @@ namespace TypeCast = experimental::TypeConversion;
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char masterKey[] PROGMEM = "w86vn@rpfA O+S"; // Use 8 random characters or more
+constexpr char masterKey[] PROGMEM = "w86vn@rpfA O+S";  // Use 8 random characters or more
 
-void setup() {
+void           setup()
+{
   // Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
   // This will however delay node WiFi start-up by about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to connect to.
   WiFi.persistent(false);
@@ -34,7 +35,8 @@ void setup() {
   Serial.println();
 }
 
-void loop() {
+void loop()
+{
   // This serves only to demonstrate the library use. See the header file for a full list of functions.
 
   using namespace experimental::crypto;
@@ -42,17 +44,17 @@ void loop() {
   String exampleData = F("Hello Crypto World!");
   Serial.println(String(F("This is our example data: ")) + exampleData);
 
-  uint8_t resultArray[SHA256::NATURAL_LENGTH] { 0 };
-  uint8_t derivedKey[ENCRYPTION_KEY_LENGTH] { 0 };
+  uint8_t         resultArray[SHA256::NATURAL_LENGTH] { 0 };
+  uint8_t         derivedKey[ENCRYPTION_KEY_LENGTH] { 0 };
 
   static uint32_t encryptionCounter = 0;
 
   // Generate the salt to use for HKDF
-  uint8_t hkdfSalt[16] { 0 };
+  uint8_t         hkdfSalt[16] { 0 };
   getNonceGenerator()(hkdfSalt, sizeof hkdfSalt);
 
   // Generate the key to use for HMAC and encryption
-  HKDF hkdfInstance(FPSTR(masterKey), (sizeof masterKey) - 1, hkdfSalt, sizeof hkdfSalt); // (sizeof masterKey) - 1 removes the terminating null value of the c-string
+  HKDF hkdfInstance(FPSTR(masterKey), (sizeof masterKey) - 1, hkdfSalt, sizeof hkdfSalt);  // (sizeof masterKey) - 1 removes the terminating null value of the c-string
   hkdfInstance.produce(derivedKey, sizeof derivedKey);
 
   // Hash
@@ -67,9 +69,9 @@ void loop() {
   Serial.println(String(F("This is the SHA256 HMAC of our example data, in HEX format, using String output:\n")) + SHA256::hmac(exampleData, derivedKey, sizeof derivedKey, SHA256::NATURAL_LENGTH));
 
   // Authenticated Encryption with Associated Data (AEAD)
-  String dataToEncrypt = F("This data is not encrypted.");
-  uint8_t resultingNonce[12] { 0 }; // The nonce is always 12 bytes
-  uint8_t resultingTag[16] { 0 }; // The tag is always 16 bytes
+  String  dataToEncrypt = F("This data is not encrypted.");
+  uint8_t resultingNonce[12] { 0 };  // The nonce is always 12 bytes
+  uint8_t resultingTag[16] { 0 };    // The tag is always 16 bytes
 
   Serial.println(String(F("\nThis is the data to encrypt: ")) + dataToEncrypt);
 
@@ -80,9 +82,12 @@ void loop() {
   bool decryptionSucceeded = ChaCha20Poly1305::decrypt(dataToEncrypt.begin(), dataToEncrypt.length(), derivedKey, &encryptionCounter, sizeof encryptionCounter, resultingNonce, resultingTag);
   encryptionCounter++;
 
-  if (decryptionSucceeded) {
+  if (decryptionSucceeded)
+  {
     Serial.print(F("Decryption succeeded. Result: "));
-  } else {
+  }
+  else
+  {
     Serial.print(F("Decryption failed. Result: "));
   }
 
diff --git a/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino b/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
index 0d57aa78c8..1c5733ea6d 100644
--- a/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
+++ b/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
@@ -19,7 +19,7 @@
 #include <ESP8266WiFi.h>
 #include <Esp.h>
 #include <user_interface.h>
-#include <coredecls.h> // g_pcont - only needed for this debug demo
+#include <coredecls.h>  // g_pcont - only needed for this debug demo
 #include <StackThunk.h>
 
 #ifndef STASSID
@@ -27,30 +27,32 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 ////////////////////////////////////////////////////////////////////
 // This block is just for putting something on the BearSSL stack
 // to show that it has not been zeroed out before HWDT stack dump
 // gets to runs.
-extern "C" {
+extern "C"
+{
 #if CORE_MOCK
 #define thunk_ets_uart_printf ets_uart_printf
 
 #else
-int thunk_ets_uart_printf(const char* format, ...) __attribute__((format(printf, 1, 2)));
-// Second stack thunked helper - this macro creates the global function thunk_ets_uart_printf
-make_stack_thunk(ets_uart_printf);
+  int thunk_ets_uart_printf(const char* format, ...) __attribute__((format(printf, 1, 2)));
+  // Second stack thunked helper - this macro creates the global function thunk_ets_uart_printf
+  make_stack_thunk(ets_uart_printf);
 #endif
 };
 ////////////////////////////////////////////////////////////////////
 
-void setup(void) {
-  WiFi.persistent(false); // w/o this a flash write occurs at every boot
+void setup(void)
+{
+  WiFi.persistent(false);  // w/o this a flash write occurs at every boot
   WiFi.mode(WIFI_OFF);
   Serial.begin(115200);
-  delay(20); // This delay helps when using the 'Modified Serial monitor' otherwise it is not needed.
+  delay(20);  // This delay helps when using the 'Modified Serial monitor' otherwise it is not needed.
   Serial.println();
   Serial.println();
   Serial.println(F("The Hardware Watchdog Timer Demo is starting ..."));
@@ -78,8 +80,8 @@ void setup(void) {
 #endif
 
   Serial.printf_P(PSTR("This example was built with%s an extra 4K of heap space (g_pcont == 0x%08lX)\r\n"),
-      ((uintptr_t)0x3FFFC000 < (uintptr_t)g_pcont) ? "" : "out",
-      (uintptr_t)g_pcont);
+                  ((uintptr_t)0x3FFFC000 < (uintptr_t)g_pcont) ? "" : "out",
+                  (uintptr_t)g_pcont);
 #if defined(DEBUG_ESP_HWDT) || defined(DEBUG_ESP_HWDT_NOEXTRA4K)
   Serial.print(F("and with the HWDT"));
 #if defined(DEBUG_ESP_HWDT_NOEXTRA4K)
@@ -94,8 +96,10 @@ void setup(void) {
   processKey(Serial, '?');
 }
 
-void loop(void) {
-  if (Serial.available() > 0) {
+void loop(void)
+{
+  if (Serial.available() > 0)
+  {
     int hotKey = Serial.read();
     processKey(Serial, hotKey);
   }
diff --git a/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino b/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
index 195d1fa178..fd21931219 100644
--- a/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
+++ b/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
@@ -1,11 +1,13 @@
 #include <esp8266_undocumented.h>
 void crashMeIfYouCan(void) __attribute__((weak));
-int divideA_B(int a, int b);
+int  divideA_B(int a, int b);
 
 int* nullPointer = NULL;
 
-void processKey(Print& out, int hotKey) {
-  switch (hotKey) {
+void processKey(Print& out, int hotKey)
+{
+  switch (hotKey)
+  {
     case 'r':
       out.printf_P(PSTR("Reset, ESP.reset(); ...\r\n"));
       ESP.reset();
@@ -14,16 +16,19 @@ void processKey(Print& out, int hotKey) {
       out.printf_P(PSTR("Restart, ESP.restart(); ...\r\n"));
       ESP.restart();
       break;
-    case 's': {
+    case 's':
+    {
       uint32_t startTime = millis();
       out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
       ets_install_putc1(ets_putc);
-      while (true) {
+      while (true)
+      {
         ets_printf("%9lu\r", (millis() - startTime));
         ets_delay_us(250000);
         // stay in an loop blocking other system activity.
       }
-    } break;
+    }
+    break;
     case 'h':
       out.printf_P(PSTR("Now crashing with Hardware WDT. This will take about 6 seconds.\r\n"));
       asm volatile("mov.n a2, %0\n\t"
@@ -41,7 +46,8 @@ void processKey(Print& out, int hotKey) {
         // the system and crash.
         ets_install_putc1(ets_putc);
         xt_rsil(15);
-        while (true) {
+        while (true)
+        {
           ets_printf("%9lu\r", (millis() - startTime));
           ets_delay_us(250000);
           // stay in an loop blocking other system activity.
@@ -106,12 +112,14 @@ void processKey(Print& out, int hotKey) {
 
 // With the current toolchain 10.1, using this to divide by zero will *not* be
 // caught at compile time.
-int __attribute__((noinline)) divideA_B(int a, int b) {
+int __attribute__((noinline)) divideA_B(int a, int b)
+{
   return (a / b);
 }
 
 // With the current toolchain 10.1, using this to divide by zero *will* be
 // caught at compile time. And a hard coded breakpoint will be inserted.
-int divideA_B_bp(int a, int b) {
+int divideA_B_bp(int a, int b)
+{
   return (a / b);
 }
diff --git a/libraries/esp8266/examples/I2STransmit/I2STransmit.ino b/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
index 9758455b75..67b0658fd3 100644
--- a/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
+++ b/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
@@ -18,17 +18,18 @@
 #endif
 
 // Set your network here
-const char* SSID = STASSID;
-const char* PASS = STAPSK;
+const char*     SSID = STASSID;
+const char*     PASS = STAPSK;
 
-WiFiUDP udp;
+WiFiUDP         udp;
 // Set your listener PC's IP here:
 const IPAddress listener = { 192, 168, 1, 2 };
-const int port = 8266;
+const int       port     = 8266;
 
-int16_t buffer[100][2]; // Temp staging for samples
+int16_t         buffer[100][2];  // Temp staging for samples
 
-void setup() {
+void            setup()
+{
   Serial.begin(115200);
 
   // Connect to WiFi network
@@ -39,7 +40,8 @@ void setup() {
 
   WiFi.begin(SSID, PASS);
 
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -48,7 +50,7 @@ void setup() {
   Serial.print("My IP: ");
   Serial.println(WiFi.localIP());
 
-  i2s_rxtx_begin(true, false); // Enable I2S RX
+  i2s_rxtx_begin(true, false);  // Enable I2S RX
   i2s_set_rate(11025);
 
   Serial.print("\nStart the listener on ");
@@ -62,18 +64,21 @@ void setup() {
   udp.endPacket();
 }
 
-void loop() {
+void loop()
+{
   static uint32_t cnt = 0;
   // Each loop will send 100 raw samples (400 bytes)
   // UDP needs to be < TCP_MSS which can be 500 bytes in LWIP2
-  for (int i = 0; i < 100; i++) {
+  for (int i = 0; i < 100; i++)
+  {
     i2s_read_sample(&buffer[i][0], &buffer[i][1], true);
   }
   udp.beginPacket(listener, port);
   udp.write((uint8_t*)buffer, sizeof(buffer));
   udp.endPacket();
   cnt++;
-  if ((cnt % 100) == 0) {
+  if ((cnt % 100) == 0)
+  {
     Serial.printf("%" PRIu32 "\n", cnt);
   }
 }
diff --git a/libraries/esp8266/examples/IramReserve/IramReserve.ino b/libraries/esp8266/examples/IramReserve/IramReserve.ino
index 7c354d5a13..8e51d3a117 100644
--- a/libraries/esp8266/examples/IramReserve/IramReserve.ino
+++ b/libraries/esp8266/examples/IramReserve/IramReserve.ino
@@ -20,11 +20,12 @@
 #if defined(CORE_MOCK)
 #define XCHAL_INSTRAM1_VADDR 0x40100000
 #else
-#include <sys/config.h> // For config/core-isa.h
+#include <sys/config.h>  // For config/core-isa.h
 #endif
 
 // durable - as in long life, persisting across reboots.
-struct durable {
+struct durable
+{
   uint32_t bootCounter;
   uint32_t chksum;
 };
@@ -56,18 +57,21 @@ extern struct rst_info resetInfo;
   REASON_EXT_SYS_RST, you could add additional logic to set and verify a CRC or
   XOR sum on the IRAM data (or just a section of the IRAM data).
 */
-inline bool is_iram_valid(void) {
+inline bool            is_iram_valid(void)
+{
   return (REASON_WDT_RST <= resetInfo.reason && REASON_SOFT_RESTART >= resetInfo.reason);
 }
 
-void setup() {
+void setup()
+{
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
   Serial.begin(115200);
   delay(10);
   Serial.printf_P(PSTR("\r\nSetup ...\r\n"));
 
-  if (!is_iram_valid()) {
+  if (!is_iram_valid())
+  {
     DURABLE->bootCounter = 0;
   }
 
@@ -78,8 +82,10 @@ void setup() {
   processKey(Serial, '?');
 }
 
-void loop(void) {
-  if (Serial.available() > 0) {
+void loop(void)
+{
+  if (Serial.available() > 0)
+  {
     int hotKey = Serial.read();
     processKey(Serial, hotKey);
   }
@@ -96,7 +102,8 @@ void loop(void) {
 
 extern "C" void _text_end(void);
 
-extern "C" void umm_init_iram(void) {
+extern "C" void umm_init_iram(void)
+{
   /*
     Calculate the start of 2nd heap, staying clear of possible segment alignment
     adjustments and checksums. These can affect the persistence of data across
@@ -105,15 +112,16 @@ extern "C" void umm_init_iram(void) {
   uintptr_t sec_heap = (uintptr_t)_text_end + 32;
   sec_heap &= ~7;
   size_t sec_heap_sz = 0xC000UL - (sec_heap - (uintptr_t)XCHAL_INSTRAM1_VADDR);
-  sec_heap_sz -= IRAM_RESERVE_SZ; // Shrink IRAM heap
-  if (0xC000UL > sec_heap_sz) {
-
+  sec_heap_sz -= IRAM_RESERVE_SZ;  // Shrink IRAM heap
+  if (0xC000UL > sec_heap_sz)
+  {
     umm_init_iram_ex((void*)sec_heap, sec_heap_sz, true);
   }
 }
 
 #else
-void setup() {
+void setup()
+{
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
   Serial.begin(115200);
@@ -121,6 +129,7 @@ void setup() {
   Serial.println("\r\n\r\nThis sketch requires Tools Option: 'MMU: 16KB cache + 48KB IRAM and 2nd Heap (shared)'");
 }
 
-void loop(void) {
+void loop(void)
+{
 }
 #endif
diff --git a/libraries/esp8266/examples/IramReserve/ProcessKey.ino b/libraries/esp8266/examples/IramReserve/ProcessKey.ino
index 195d1fa178..fd21931219 100644
--- a/libraries/esp8266/examples/IramReserve/ProcessKey.ino
+++ b/libraries/esp8266/examples/IramReserve/ProcessKey.ino
@@ -1,11 +1,13 @@
 #include <esp8266_undocumented.h>
 void crashMeIfYouCan(void) __attribute__((weak));
-int divideA_B(int a, int b);
+int  divideA_B(int a, int b);
 
 int* nullPointer = NULL;
 
-void processKey(Print& out, int hotKey) {
-  switch (hotKey) {
+void processKey(Print& out, int hotKey)
+{
+  switch (hotKey)
+  {
     case 'r':
       out.printf_P(PSTR("Reset, ESP.reset(); ...\r\n"));
       ESP.reset();
@@ -14,16 +16,19 @@ void processKey(Print& out, int hotKey) {
       out.printf_P(PSTR("Restart, ESP.restart(); ...\r\n"));
       ESP.restart();
       break;
-    case 's': {
+    case 's':
+    {
       uint32_t startTime = millis();
       out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
       ets_install_putc1(ets_putc);
-      while (true) {
+      while (true)
+      {
         ets_printf("%9lu\r", (millis() - startTime));
         ets_delay_us(250000);
         // stay in an loop blocking other system activity.
       }
-    } break;
+    }
+    break;
     case 'h':
       out.printf_P(PSTR("Now crashing with Hardware WDT. This will take about 6 seconds.\r\n"));
       asm volatile("mov.n a2, %0\n\t"
@@ -41,7 +46,8 @@ void processKey(Print& out, int hotKey) {
         // the system and crash.
         ets_install_putc1(ets_putc);
         xt_rsil(15);
-        while (true) {
+        while (true)
+        {
           ets_printf("%9lu\r", (millis() - startTime));
           ets_delay_us(250000);
           // stay in an loop blocking other system activity.
@@ -106,12 +112,14 @@ void processKey(Print& out, int hotKey) {
 
 // With the current toolchain 10.1, using this to divide by zero will *not* be
 // caught at compile time.
-int __attribute__((noinline)) divideA_B(int a, int b) {
+int __attribute__((noinline)) divideA_B(int a, int b)
+{
   return (a / b);
 }
 
 // With the current toolchain 10.1, using this to divide by zero *will* be
 // caught at compile time. And a hard coded breakpoint will be inserted.
-int divideA_B_bp(int a, int b) {
+int divideA_B_bp(int a, int b)
+{
   return (a / b);
 }
diff --git a/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino b/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
index 2dc8b99404..e1efcbc2a5 100644
--- a/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
+++ b/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
@@ -38,9 +38,9 @@
   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA  */
 
 #include <ESP8266WiFi.h>
-#include <coredecls.h> // crc32()
+#include <coredecls.h>  // crc32()
 #include <PolledTimeout.h>
-#include <include/WiFiState.h> // WiFiState structure details
+#include <include/WiFiState.h>  // WiFiState structure details
 
 //#define DEBUG  // prints WiFi connection info to serial, uncomment if you want WiFi messages
 #ifdef DEBUG
@@ -51,30 +51,30 @@
 #define DEBUG_PRINT(x)
 #endif
 
-#define WAKE_UP_PIN 0 // D3/GPIO0, can also force a serial flash upload with RESET
+#define WAKE_UP_PIN 0  // D3/GPIO0, can also force a serial flash upload with RESET
 // you can use any GPIO for WAKE_UP_PIN except for D0/GPIO16 as it doesn't support interrupts
 
 // uncomment one of the two lines below for your LED connection (optional)
-#define LED 5 // D1/GPIO5 external LED for modules with built-in LEDs so it doesn't add amperage
+#define LED 5  // D1/GPIO5 external LED for modules with built-in LEDs so it doesn't add amperage
 //#define LED 2  // D4/GPIO2 LED for ESP-01,07 modules; D4 is LED_BUILTIN on most other modules
 // you can use LED_BUILTIN, but it adds to the measured amperage by 0.3mA to 6mA.
 
-ADC_MODE(ADC_VCC); // allows you to monitor the internal VCC level; it varies with WiFi load
+ADC_MODE(ADC_VCC);  // allows you to monitor the internal VCC level; it varies with WiFi load
 // don't connect anything to the analog input pin(s)!
 
 // enter your WiFi configuration below
-const char* AP_SSID = "SSID"; // your router's SSID here
-const char* AP_PASS = "password"; // your router's password here
-IPAddress staticIP(0, 0, 0, 0); // parameters below are for your static IP address, if used
-IPAddress gateway(0, 0, 0, 0);
-IPAddress subnet(0, 0, 0, 0);
-IPAddress dns1(0, 0, 0, 0);
-IPAddress dns2(0, 0, 0, 0);
-uint32_t timeout = 30E3; // 30 second timeout on the WiFi connection
+const char* AP_SSID = "SSID";      // your router's SSID here
+const char* AP_PASS = "password";  // your router's password here
+IPAddress   staticIP(0, 0, 0, 0);  // parameters below are for your static IP address, if used
+IPAddress   gateway(0, 0, 0, 0);
+IPAddress   subnet(0, 0, 0, 0);
+IPAddress   dns1(0, 0, 0, 0);
+IPAddress   dns2(0, 0, 0, 0);
+uint32_t    timeout = 30E3;  // 30 second timeout on the WiFi connection
 
 //#define TESTPOINT  //  used to track the timing of several test cycles (optional)
 #ifdef TESTPOINT
-#define testPointPin 4 // D2/GPIO4, you can use any pin that supports interrupts
+#define testPointPin 4  // D2/GPIO4, you can use any pin that supports interrupts
 #define testPoint_HIGH digitalWrite(testPointPin, HIGH)
 #define testPoint_LOW digitalWrite(testPointPin, LOW)
 #else
@@ -84,102 +84,122 @@ uint32_t timeout = 30E3; // 30 second timeout on the WiFi connection
 
 // This structure is stored in RTC memory to save the WiFi state and reset count (number of Deep Sleeps),
 // and it reconnects twice as fast as the first connection; it's used several places in this demo
-struct nv_s {
-  WiFiState wss; // core's WiFi save state
+struct nv_s
+{
+  WiFiState wss;  // core's WiFi save state
 
-  struct {
+  struct
+  {
     uint32_t crc32;
-    uint32_t rstCount; // stores the Deep Sleep reset count
+    uint32_t rstCount;  // stores the Deep Sleep reset count
     // you can add anything else here that you want to save, must be 4-byte aligned
   } rtcData;
 };
 
-static nv_s* nv = (nv_s*)RTC_USER_MEM; // user RTC RAM area
+static nv_s*                       nv         = (nv_s*)RTC_USER_MEM;  // user RTC RAM area
 
-uint32_t resetCount = 0; // keeps track of the number of Deep Sleep tests / resets
+uint32_t                           resetCount = 0;  // keeps track of the number of Deep Sleep tests / resets
 
-const uint32_t blinkDelay = 100; // fast blink rate for the LED when waiting for the user
-esp8266::polledTimeout::periodicMs blinkLED(blinkDelay); // LED blink delay without delay()
-esp8266::polledTimeout::oneShotMs altDelay(blinkDelay); // tight loop to simulate user code
-esp8266::polledTimeout::oneShotMs wifiTimeout(timeout); // 30 second timeout on WiFi connection
+const uint32_t                     blinkDelay = 100;      // fast blink rate for the LED when waiting for the user
+esp8266::polledTimeout::periodicMs blinkLED(blinkDelay);  // LED blink delay without delay()
+esp8266::polledTimeout::oneShotMs  altDelay(blinkDelay);  // tight loop to simulate user code
+esp8266::polledTimeout::oneShotMs  wifiTimeout(timeout);  // 30 second timeout on WiFi connection
 // use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace
 
-void wakeupCallback() { // unlike ISRs, you can do a print() from a callback function
-  testPoint_LOW; // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW
-  printMillis(); // show time difference across sleep; millis is wrong as the CPU eventually stops
+void                               wakeupCallback()
+{                 // unlike ISRs, you can do a print() from a callback function
+  testPoint_LOW;  // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW
+  printMillis();  // show time difference across sleep; millis is wrong as the CPU eventually stops
   Serial.println(F("Woke from Light Sleep - this is the callback"));
 }
 
-void setup() {
+void setup()
+{
 #ifdef TESTPOINT
-  pinMode(testPointPin, OUTPUT); // test point for Light Sleep and Deep Sleep tests
-  testPoint_LOW; // Deep Sleep reset doesn't clear GPIOs, testPoint LOW shows boot time
+  pinMode(testPointPin, OUTPUT);  // test point for Light Sleep and Deep Sleep tests
+  testPoint_LOW;                  // Deep Sleep reset doesn't clear GPIOs, testPoint LOW shows boot time
 #endif
-  pinMode(LED, OUTPUT); // activity and status indicator
-  digitalWrite(LED, LOW); // turn on the LED
-  pinMode(WAKE_UP_PIN, INPUT_PULLUP); // polled to advance tests, interrupt for Forced Light Sleep
+  pinMode(LED, OUTPUT);                // activity and status indicator
+  digitalWrite(LED, LOW);              // turn on the LED
+  pinMode(WAKE_UP_PIN, INPUT_PULLUP);  // polled to advance tests, interrupt for Forced Light Sleep
   Serial.begin(115200);
   Serial.println();
   Serial.print(F("\nReset reason = "));
   String resetCause = ESP.getResetReason();
   Serial.println(resetCause);
   resetCount = 0;
-  if ((resetCause == "External System") || (resetCause == "Power on")) {
+  if ((resetCause == "External System") || (resetCause == "Power on"))
+  {
     Serial.println(F("I'm awake and starting the Low Power tests"));
   }
 
   // Read previous resets (Deep Sleeps) from RTC memory, if any
   uint32_t crcOfData = crc32((uint8_t*)&nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
-  if ((crcOfData = nv->rtcData.crc32) && (resetCause == "Deep-Sleep Wake")) {
-    resetCount = nv->rtcData.rstCount; // read the previous reset count
+  if ((crcOfData = nv->rtcData.crc32) && (resetCause == "Deep-Sleep Wake"))
+  {
+    resetCount = nv->rtcData.rstCount;  // read the previous reset count
     resetCount++;
   }
-  nv->rtcData.rstCount = resetCount; // update the reset count & CRC
+  nv->rtcData.rstCount = resetCount;  // update the reset count & CRC
   updateRTCcrc();
 
-  if (resetCount == 1) { // show that millis() is cleared across the Deep Sleep reset
+  if (resetCount == 1)
+  {  // show that millis() is cleared across the Deep Sleep reset
     printMillis();
   }
-} // end of setup()
+}  // end of setup()
 
-void loop() {
-  if (resetCount == 0) { // if first loop() since power on or external reset
+void loop()
+{
+  if (resetCount == 0)
+  {  // if first loop() since power on or external reset
     runTest1();
     runTest2();
     runTest3();
     runTest4();
     runTest5();
     runTest6();
-    runTest7(); // first Deep Sleep test, all these end with a RESET
+    runTest7();  // first Deep Sleep test, all these end with a RESET
   }
-  if (resetCount < 4) {
-    initWiFi(); // optional re-init of WiFi for the Deep Sleep tests
+  if (resetCount < 4)
+  {
+    initWiFi();  // optional re-init of WiFi for the Deep Sleep tests
   }
-  if (resetCount == 1) {
+  if (resetCount == 1)
+  {
     runTest8();
-  } else if (resetCount == 2) {
+  }
+  else if (resetCount == 2)
+  {
     runTest9();
-  } else if (resetCount == 3) {
+  }
+  else if (resetCount == 3)
+  {
     runTest10();
-  } else if (resetCount == 4) {
+  }
+  else if (resetCount == 4)
+  {
     resetTests();
   }
-} //end of loop()
+}  //end of loop()
 
-void runTest1() {
+void runTest1()
+{
   Serial.println(F("\n1st test - running with WiFi unconfigured"));
-  readVoltage(); // read internal VCC
+  readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
   waitPushbutton(false, blinkDelay);
 }
 
-void runTest2() {
+void runTest2()
+{
   Serial.println(F("\n2nd test - Automatic Modem Sleep"));
   Serial.println(F("connecting WiFi, please wait until the LED blinks"));
   initWiFi();
-  if (WiFi.localIP()) { // won't go into Automatic Sleep without an active WiFi connection
+  if (WiFi.localIP())
+  {  // won't go into Automatic Sleep without an active WiFi connection
     Serial.println(F("The amperage will drop in 7 seconds."));
-    readVoltage(); // read internal VCC
+    readVoltage();  // read internal VCC
     Serial.println(F("press the switch to continue"));
     waitPushbutton(true, 90); /* This is using a special feature: below 100 mS blink delay,
          the LED blink delay is padding 100 mS time with 'program cycles' to fill the 100 mS.
@@ -188,18 +208,21 @@ void runTest2() {
          At 100 mS and above it's essentially all delay() time.  On an oscilloscope you'll see the
          time between beacons at > 67 mA more often with less delay() percentage. You can change
          the '90' mS to other values to see the effect it has on Automatic Modem Sleep. */
-  } else {
+  }
+  else
+  {
     Serial.println(F("no WiFi connection, test skipped"));
   }
 }
 
-void runTest3() {
+void runTest3()
+{
   Serial.println(F("\n3rd test - Forced Modem Sleep"));
-  WiFi.shutdown(nv->wss); // shut the modem down and save the WiFi state for faster reconnection
+  WiFi.shutdown(nv->wss);  // shut the modem down and save the WiFi state for faster reconnection
   //  WiFi.forceSleepBegin(delay_in_uS);  // alternate method of Forced Modem Sleep for an optional timed shutdown,
   // with WiFi.forceSleepBegin(0xFFFFFFF); the modem sleeps until you wake it, with values <= 0xFFFFFFE it's timed
   //  delay(10);  // it doesn't always go to sleep unless you delay(10); yield() wasn't reliable
-  readVoltage(); // read internal VCC
+  readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
   waitPushbutton(true, 99); /* Using the same < 100 mS feature. If you drop the delay below 100, you
       will see the effect of program time vs. delay() time on minimum amperage.  Above ~ 97 (97% of the
@@ -207,212 +230,242 @@ void runTest3() {
       to get minimum amperage.*/
 }
 
-void runTest4() {
+void runTest4()
+{
   Serial.println(F("\n4th test - Automatic Light Sleep"));
   Serial.println(F("reconnecting WiFi with forceSleepWake"));
   Serial.println(F("Automatic Light Sleep begins after WiFi connects (LED blinks)"));
   // on successive loops after power-on, WiFi shows 'connected' several seconds before Sleep happens
   // and WiFi reconnects after the forceSleepWake more quickly
-  digitalWrite(LED, LOW); // visual cue that we're reconnecting WiFi
+  digitalWrite(LED, LOW);  // visual cue that we're reconnecting WiFi
   uint32_t wifiBegin = millis();
-  WiFi.forceSleepWake(); // reconnect with previous STA mode and connection settings
-  WiFi.setSleepMode(WIFI_LIGHT_SLEEP, 3); // Automatic Light Sleep, DTIM listen interval = 3
+  WiFi.forceSleepWake();                   // reconnect with previous STA mode and connection settings
+  WiFi.setSleepMode(WIFI_LIGHT_SLEEP, 3);  // Automatic Light Sleep, DTIM listen interval = 3
   // at higher DTIM intervals you'll have a hard time establishing and maintaining a connection
   wifiTimeout.reset(timeout);
-  while (((!WiFi.localIP()) || (WiFi.status() != WL_CONNECTED)) && (!wifiTimeout)) {
+  while (((!WiFi.localIP()) || (WiFi.status() != WL_CONNECTED)) && (!wifiTimeout))
+  {
     yield();
   }
-  if ((WiFi.status() == WL_CONNECTED) && WiFi.localIP()) {
+  if ((WiFi.status() == WL_CONNECTED) && WiFi.localIP())
+  {
     // won't go into Automatic Sleep without an active WiFi connection
     float reConn = (millis() - wifiBegin);
     Serial.print(F("WiFi connect time = "));
     Serial.printf("%1.2f seconds\n", reConn / 1000);
-    readVoltage(); // read internal VCC
+    readVoltage();  // read internal VCC
     Serial.println(F("long press of the switch to continue"));
     waitPushbutton(true, 350); /* Below 100 mS delay it only goes into 'Automatic Modem Sleep',
         and below ~ 350 mS delay() the 'Automatic Light Sleep' is less frequent.  Above 500 mS
         delay() doesn't make significant improvement in power savings. */
-  } else {
+  }
+  else
+  {
     Serial.println(F("no WiFi connection, test skipped"));
   }
 }
 
-void runTest5() {
+void runTest5()
+{
   Serial.println(F("\n5th test - Timed Light Sleep, wake in 10 seconds"));
   Serial.println(F("Press the button when you're ready to proceed"));
   waitPushbutton(true, blinkDelay);
-  WiFi.mode(WIFI_OFF); // you must turn the modem off; using disconnect won't work
-  readVoltage(); // read internal VCC
-  printMillis(); // show millis() across sleep, including Serial.flush()
-  digitalWrite(LED, HIGH); // turn the LED off so they know the CPU isn't running
-  testPoint_HIGH; // testPoint LOW in callback tracks delay from testPoint HIGH to LOW
+  WiFi.mode(WIFI_OFF);      // you must turn the modem off; using disconnect won't work
+  readVoltage();            // read internal VCC
+  printMillis();            // show millis() across sleep, including Serial.flush()
+  digitalWrite(LED, HIGH);  // turn the LED off so they know the CPU isn't running
+  testPoint_HIGH;           // testPoint LOW in callback tracks delay from testPoint HIGH to LOW
   extern os_timer_t* timer_list;
-  timer_list = nullptr; // stop (but don't disable) the 4 OS timers
+  timer_list = nullptr;  // stop (but don't disable) the 4 OS timers
   wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
-  gpio_pin_wakeup_enable(GPIO_ID_PIN(WAKE_UP_PIN), GPIO_PIN_INTR_LOLEVEL); // GPIO wakeup (optional)
+  gpio_pin_wakeup_enable(GPIO_ID_PIN(WAKE_UP_PIN), GPIO_PIN_INTR_LOLEVEL);  // GPIO wakeup (optional)
   // only LOLEVEL or HILEVEL interrupts work, no edge, that's an SDK or CPU limitation
-  wifi_fpm_set_wakeup_cb(wakeupCallback); // set wakeup callback
+  wifi_fpm_set_wakeup_cb(wakeupCallback);  // set wakeup callback
   // the callback is optional, but without it the modem will wake in 10 seconds then delay(10 seconds)
   // with the callback the sleep time is only 10 seconds total, no extra delay() afterward
   wifi_fpm_open();
-  wifi_fpm_do_sleep(10E6); // Sleep range = 10000 ~ 268,435,454 uS (0xFFFFFFE, 2^28-1)
-  delay(10e3 + 1); // delay needs to be 1 mS longer than sleep or it only goes into Modem Sleep
-  Serial.println(F("Woke up!")); // the interrupt callback hits before this is executed
+  wifi_fpm_do_sleep(10E6);        // Sleep range = 10000 ~ 268,435,454 uS (0xFFFFFFE, 2^28-1)
+  delay(10e3 + 1);                // delay needs to be 1 mS longer than sleep or it only goes into Modem Sleep
+  Serial.println(F("Woke up!"));  // the interrupt callback hits before this is executed
 }
 
-void runTest6() {
+void runTest6()
+{
   Serial.println(F("\n6th test - Forced Light Sleep, wake with GPIO interrupt"));
   Serial.flush();
-  WiFi.mode(WIFI_OFF); // you must turn the modem off; using disconnect won't work
-  digitalWrite(LED, HIGH); // turn the LED off so they know the CPU isn't running
-  readVoltage(); // read internal VCC
+  WiFi.mode(WIFI_OFF);      // you must turn the modem off; using disconnect won't work
+  digitalWrite(LED, HIGH);  // turn the LED off so they know the CPU isn't running
+  readVoltage();            // read internal VCC
   Serial.println(F("CPU going to sleep, pull WAKE_UP_PIN low to wake it (press the switch)"));
-  printMillis(); // show millis() across sleep, including Serial.flush()
-  testPoint_HIGH; // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW in callback
+  printMillis();   // show millis() across sleep, including Serial.flush()
+  testPoint_HIGH;  // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW in callback
   wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
   gpio_pin_wakeup_enable(GPIO_ID_PIN(WAKE_UP_PIN), GPIO_PIN_INTR_LOLEVEL);
   // only LOLEVEL or HILEVEL interrupts work, no edge, that's an SDK or CPU limitation
-  wifi_fpm_set_wakeup_cb(wakeupCallback); // Set wakeup callback (optional)
+  wifi_fpm_set_wakeup_cb(wakeupCallback);  // Set wakeup callback (optional)
   wifi_fpm_open();
-  wifi_fpm_do_sleep(0xFFFFFFF); // only 0xFFFFFFF, any other value and it won't disconnect the RTC timer
-  delay(10); // it goes to sleep during this delay() and waits for an interrupt
-  Serial.println(F("Woke up!")); // the interrupt callback hits before this is executed*/
+  wifi_fpm_do_sleep(0xFFFFFFF);   // only 0xFFFFFFF, any other value and it won't disconnect the RTC timer
+  delay(10);                      // it goes to sleep during this delay() and waits for an interrupt
+  Serial.println(F("Woke up!"));  // the interrupt callback hits before this is executed*/
 }
 
-void runTest7() {
+void runTest7()
+{
   Serial.println(F("\n7th test - Deep Sleep for 10 seconds, reset and wake with RF_DEFAULT"));
-  initWiFi(); // initialize WiFi since we turned it off in the last test
-  readVoltage(); // read internal VCC
+  initWiFi();     // initialize WiFi since we turned it off in the last test
+  readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
-  while (!digitalRead(WAKE_UP_PIN)) { // wait for them to release the switch from the previous test
+  while (!digitalRead(WAKE_UP_PIN))
+  {  // wait for them to release the switch from the previous test
     delay(10);
   }
-  delay(50); // debounce time for the switch, pushbutton released
-  waitPushbutton(false, blinkDelay); // set true if you want to see Automatic Modem Sleep
-  digitalWrite(LED, LOW); // turn the LED on, at least briefly
+  delay(50);                          // debounce time for the switch, pushbutton released
+  waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
+  digitalWrite(LED, LOW);             // turn the LED on, at least briefly
   //WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep,
   // and no extended RFCAL as it goes into Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  printMillis(); // show time difference across sleep
-  testPoint_HIGH; // testPoint set HIGH to track Deep Sleep period, cleared at startup()
-  ESP.deepSleep(10E6, WAKE_RF_DEFAULT); // good night!  D0 fires a reset in 10 seconds...
+  printMillis();                         // show time difference across sleep
+  testPoint_HIGH;                        // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  ESP.deepSleep(10E6, WAKE_RF_DEFAULT);  // good night!  D0 fires a reset in 10 seconds...
   // if you do ESP.deepSleep(0, mode); it needs a RESET to come out of sleep (RTC is disconnected)
   // maximum timed Deep Sleep interval ~ 3 to 4 hours depending on the RTC timer, see the README
   // the 2 uA GPIO amperage during Deep Sleep can't drive the LED so it's not lit now, although
   // depending on the LED used, you might see it very dimly lit in a dark room during this test
-  Serial.println(F("What... I'm not asleep?!?")); // it will never get here
+  Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
-void runTest8() {
+void runTest8()
+{
   Serial.println(F("\n8th test - in RF_DEFAULT, Deep Sleep for 10 seconds, reset and wake with RFCAL"));
-  readVoltage(); // read internal VCC
+  readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
-  waitPushbutton(false, blinkDelay); // set true if you want to see Automatic Modem Sleep
+  waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
   //WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep,
   // and no extended RFCAL as it goes into Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush(); // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH; // testPoint set HIGH to track Deep Sleep period, cleared at startup()
-  ESP.deepSleep(10E6, WAKE_RFCAL); // good night!  D0 fires a reset in 10 seconds...
-  Serial.println(F("What... I'm not asleep?!?")); // it will never get here
+  Serial.flush();                                  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH;                                  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  ESP.deepSleep(10E6, WAKE_RFCAL);                 // good night!  D0 fires a reset in 10 seconds...
+  Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
-void runTest9() {
+void runTest9()
+{
   Serial.println(F("\n9th test - in RFCAL, Deep Sleep Instant for 10 seconds, reset and wake with NO_RFCAL"));
-  readVoltage(); // read internal VCC
+  readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
-  waitPushbutton(false, blinkDelay); // set true if you want to see Automatic Modem Sleep
-  WiFi.shutdown(nv->wss); // Forced Modem Sleep for a more Instant Deep Sleep
+  waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
+  WiFi.shutdown(nv->wss);             // Forced Modem Sleep for a more Instant Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush(); // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH; // testPoint set HIGH to track Deep Sleep period, cleared at startup()
-  ESP.deepSleepInstant(10E6, WAKE_NO_RFCAL); // good night!  D0 fires a reset in 10 seconds...
-  Serial.println(F("What... I'm not asleep?!?")); // it will never get here
+  Serial.flush();                                  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH;                                  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  ESP.deepSleepInstant(10E6, WAKE_NO_RFCAL);       // good night!  D0 fires a reset in 10 seconds...
+  Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
-void runTest10() {
+void runTest10()
+{
   Serial.println(F("\n10th test - in NO_RFCAL, Deep Sleep Instant for 10 seconds, reset and wake with RF_DISABLED"));
-  readVoltage(); // read internal VCC
+  readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
-  waitPushbutton(false, blinkDelay); // set true if you want to see Automatic Modem Sleep
+  waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
   //WiFi.forceSleepBegin();  // Forced Modem Sleep for a more Instant Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush(); // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH; // testPoint set HIGH to track Deep Sleep period, cleared at startup()
-  ESP.deepSleepInstant(10E6, WAKE_RF_DISABLED); // good night!  D0 fires a reset in 10 seconds...
-  Serial.println(F("What... I'm not asleep?!?")); // it will never get here
+  Serial.flush();                                  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH;                                  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  ESP.deepSleepInstant(10E6, WAKE_RF_DISABLED);    // good night!  D0 fires a reset in 10 seconds...
+  Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
-void resetTests() {
-  readVoltage(); // read internal VCC
+void resetTests()
+{
+  readVoltage();  // read internal VCC
   Serial.println(F("\nTests completed, in RF_DISABLED, press the switch to do an ESP.restart()"));
-  memset(&nv->wss, 0, sizeof(nv->wss) * 2); // wipe saved WiFi states, comment this if you want to keep them
+  memset(&nv->wss, 0, sizeof(nv->wss) * 2);  // wipe saved WiFi states, comment this if you want to keep them
   waitPushbutton(false, 1000);
   ESP.restart();
 }
 
-void waitPushbutton(bool usesDelay, unsigned int delayTime) { // loop until they press the switch
+void waitPushbutton(bool usesDelay, unsigned int delayTime)
+{  // loop until they press the switch
   // note: 2 different modes, as 3 of the power saving modes need a delay() to activate fully
-  if (!usesDelay) { // quick interception of pushbutton press, no delay() used
+  if (!usesDelay)
+  {  // quick interception of pushbutton press, no delay() used
     blinkLED.reset(delayTime);
-    while (digitalRead(WAKE_UP_PIN)) { // wait for a pushbutton press
-      if (blinkLED) {
-        digitalWrite(LED, !digitalRead(LED)); // toggle the activity LED
+    while (digitalRead(WAKE_UP_PIN))
+    {  // wait for a pushbutton press
+      if (blinkLED)
+      {
+        digitalWrite(LED, !digitalRead(LED));  // toggle the activity LED
       }
-      yield(); // this would be a good place for ArduinoOTA.handle();
+      yield();  // this would be a good place for ArduinoOTA.handle();
     }
-  } else { // long delay() for the 3 modes that need it, but it misses quick switch presses
-    while (digitalRead(WAKE_UP_PIN)) { // wait for a pushbutton press
-      digitalWrite(LED, !digitalRead(LED)); // toggle the activity LED
-      delay(delayTime); // another good place for ArduinoOTA.handle();
-      if (delayTime < 100) {
-        altDelay.reset(100 - delayTime); // pad the time < 100 mS with some real CPU cycles
-        while (!altDelay) { // this simulates 'your program running', not delay() time
+  }
+  else
+  {  // long delay() for the 3 modes that need it, but it misses quick switch presses
+    while (digitalRead(WAKE_UP_PIN))
+    {                                        // wait for a pushbutton press
+      digitalWrite(LED, !digitalRead(LED));  // toggle the activity LED
+      delay(delayTime);                      // another good place for ArduinoOTA.handle();
+      if (delayTime < 100)
+      {
+        altDelay.reset(100 - delayTime);  // pad the time < 100 mS with some real CPU cycles
+        while (!altDelay)
+        {  // this simulates 'your program running', not delay() time
         }
       }
     }
   }
-  delay(50); // debounce time for the switch, pushbutton pressed
-  while (!digitalRead(WAKE_UP_PIN)) { // now wait for them to release the pushbutton
+  delay(50);  // debounce time for the switch, pushbutton pressed
+  while (!digitalRead(WAKE_UP_PIN))
+  {  // now wait for them to release the pushbutton
     delay(10);
   }
-  delay(50); // debounce time for the switch, pushbutton released
+  delay(50);  // debounce time for the switch, pushbutton released
 }
 
-void readVoltage() { // read internal VCC
+void readVoltage()
+{  // read internal VCC
   float volts = ESP.getVcc();
   Serial.printf("The internal VCC reads %1.2f volts\n", volts / 1000);
 }
 
-void printMillis() {
-  Serial.print(F("millis() = ")); // show that millis() isn't correct across most Sleep modes
+void printMillis()
+{
+  Serial.print(F("millis() = "));  // show that millis() isn't correct across most Sleep modes
   Serial.println(millis());
-  Serial.flush(); // needs a Serial.flush() else it may not print the whole message before sleeping
+  Serial.flush();  // needs a Serial.flush() else it may not print the whole message before sleeping
 }
 
-void updateRTCcrc() { // updates the reset count CRC
+void updateRTCcrc()
+{  // updates the reset count CRC
   nv->rtcData.crc32 = crc32((uint8_t*)&nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
 }
 
-void initWiFi() {
-  digitalWrite(LED, LOW); // give a visual indication that we're alive but busy with WiFi
-  uint32_t wifiBegin = millis(); // how long does it take to connect
-  if ((crc32((uint8_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss)) && !WiFi.shutdownValidCRC(nv->wss))) {
+void initWiFi()
+{
+  digitalWrite(LED, LOW);         // give a visual indication that we're alive but busy with WiFi
+  uint32_t wifiBegin = millis();  // how long does it take to connect
+  if ((crc32((uint8_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss)) && !WiFi.shutdownValidCRC(nv->wss)))
+  {
     // if good copy of wss, overwrite invalid (primary) copy
     memcpy((uint32_t*)&nv->wss, (uint32_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss));
   }
-  if (WiFi.shutdownValidCRC(nv->wss)) { // if we have a valid WiFi saved state
-    memcpy((uint32_t*)&nv->rtcData.rstCount + 1, (uint32_t*)&nv->wss, sizeof(nv->wss)); // save a copy of it
+  if (WiFi.shutdownValidCRC(nv->wss))
+  {                                                                                      // if we have a valid WiFi saved state
+    memcpy((uint32_t*)&nv->rtcData.rstCount + 1, (uint32_t*)&nv->wss, sizeof(nv->wss));  // save a copy of it
     Serial.println(F("resuming WiFi"));
   }
-  if (!(WiFi.resumeFromShutdown(nv->wss))) { // couldn't resume, or no valid saved WiFi state yet
+  if (!(WiFi.resumeFromShutdown(nv->wss)))
+  {  // couldn't resume, or no valid saved WiFi state yet
     /* Explicitly set the ESP8266 as a WiFi-client (STAtion mode), otherwise by default it
       would try to act as both a client and an access-point and could cause network issues
       with other WiFi devices on your network. */
-    WiFi.persistent(false); // don't store the connection each time to save wear on the flash
+    WiFi.persistent(false);  // don't store the connection each time to save wear on the flash
     WiFi.mode(WIFI_STA);
-    WiFi.setOutputPower(10); // reduce RF output power, increase if it won't connect
-    WiFi.config(staticIP, gateway, subnet); // if using static IP, enter parameters at the top
+    WiFi.setOutputPower(10);                 // reduce RF output power, increase if it won't connect
+    WiFi.config(staticIP, gateway, subnet);  // if using static IP, enter parameters at the top
     WiFi.begin(AP_SSID, AP_PASS);
     Serial.print(F("connecting to WiFi "));
     Serial.println(AP_SSID);
@@ -420,10 +473,12 @@ void initWiFi() {
     DEBUG_PRINTLN(WiFi.macAddress());
   }
   wifiTimeout.reset(timeout);
-  while (((!WiFi.localIP()) || (WiFi.status() != WL_CONNECTED)) && (!wifiTimeout)) {
+  while (((!WiFi.localIP()) || (WiFi.status() != WL_CONNECTED)) && (!wifiTimeout))
+  {
     yield();
   }
-  if ((WiFi.status() == WL_CONNECTED) && WiFi.localIP()) {
+  if ((WiFi.status() == WL_CONNECTED) && WiFi.localIP())
+  {
     DEBUG_PRINTLN(F("WiFi connected"));
     Serial.print(F("WiFi connect time = "));
     float reConn = (millis() - wifiBegin);
@@ -432,7 +487,9 @@ void initWiFi() {
     DEBUG_PRINTLN(WiFi.gatewayIP());
     DEBUG_PRINT(F("my IP address: "));
     DEBUG_PRINTLN(WiFi.localIP());
-  } else {
+  }
+  else
+  {
     Serial.println(F("WiFi timed out and didn't connect"));
   }
   WiFi.setAutoReconnect(true);
diff --git a/libraries/esp8266/examples/MMU48K/MMU48K.ino b/libraries/esp8266/examples/MMU48K/MMU48K.ino
index e33a08ebb0..a0fad297d5 100644
--- a/libraries/esp8266/examples/MMU48K/MMU48K.ino
+++ b/libraries/esp8266/examples/MMU48K/MMU48K.ino
@@ -6,21 +6,21 @@
 #if defined(CORE_MOCK)
 #define XCHAL_INSTRAM1_VADDR 0x40100000
 #else
-#include <sys/config.h> // For config/core-isa.h
+#include <sys/config.h>  // For config/core-isa.h
 #endif
 
 uint32_t timed_byte_read(char* pc, uint32_t* o);
 uint32_t timed_byte_read2(char* pc, uint32_t* o);
-int divideA_B(int a, int b);
+int      divideA_B(int a, int b);
 
-int* nullPointer = NULL;
+int*     nullPointer       = NULL;
 
-char* probe_b = NULL;
-short* probe_s = NULL;
-char* probe_c = (char*)0x40110000;
-short* unaligned_probe_s = NULL;
+char*    probe_b           = NULL;
+short*   probe_s           = NULL;
+char*    probe_c           = (char*)0x40110000;
+short*   unaligned_probe_s = NULL;
 
-uint32_t read_var = 0x11223344;
+uint32_t read_var          = 0x11223344;
 
 /*
   Notes,
@@ -31,33 +31,37 @@ uint32_t read_var = 0x11223344;
 
 #if defined(MMU_IRAM_HEAP) || defined(MMU_SEC_HEAP)
 uint32_t* gobble;
-size_t gobble_sz;
+size_t    gobble_sz;
 
 #elif (MMU_IRAM_SIZE > 32 * 1024)
-uint32_t gobble[4 * 1024] IRAM_ATTR;
+uint32_t         gobble[4 * 1024] IRAM_ATTR;
 constexpr size_t gobble_sz = sizeof(gobble);
 
 #else
-uint32_t gobble[256] IRAM_ATTR;
+uint32_t         gobble[256] IRAM_ATTR;
 constexpr size_t gobble_sz = sizeof(gobble);
 #endif
 
-bool isValid(uint32_t* probe) {
+bool isValid(uint32_t* probe)
+{
   bool rc = true;
-  if (NULL == probe) {
+  if (NULL == probe)
+  {
     ets_uart_printf("\nNULL memory pointer %p ...\n", probe);
     return false;
   }
 
   ets_uart_printf("\nTesting for valid memory at %p ...\n", probe);
-  uint32_t savePS = xt_rsil(15);
+  uint32_t savePS   = xt_rsil(15);
   uint32_t saveData = *probe;
-  for (size_t i = 0; i < 32; i++) {
+  for (size_t i = 0; i < 32; i++)
+  {
     *probe = BIT(i);
     asm volatile("" ::
                      : "memory");
     uint32_t val = *probe;
-    if (val != BIT(i)) {
+    if (val != BIT(i))
+    {
       ets_uart_printf("  Read 0x%08X != Wrote 0x%08X\n", val, (uint32_t)BIT(i));
       rc = false;
     }
@@ -68,16 +72,20 @@ bool isValid(uint32_t* probe) {
   return rc;
 }
 
-void dump_mem32(const void* addr, const size_t len) {
+void dump_mem32(const void* addr, const size_t len)
+{
   uint32_t* addr32 = (uint32_t*)addr;
   ets_uart_printf("\n");
-  if ((uintptr_t)addr32 & 3) {
+  if ((uintptr_t)addr32 & 3)
+  {
     ets_uart_printf("non-32-bit access\n");
     ets_delay_us(12000);
   }
-  for (size_t i = 0; i < len;) {
+  for (size_t i = 0; i < len;)
+  {
     ets_uart_printf("%p: ", &addr32[i]);
-    do {
+    do
+    {
       ets_uart_printf(" 0x%08x", addr32[i]);
     } while (i++, (i & 3) && (i < len));
     ets_uart_printf("\n");
@@ -87,17 +95,20 @@ void dump_mem32(const void* addr, const size_t len) {
 
 extern "C" void _text_end(void);
 // extern void *_text_end;
-void print_mmu_status(Print& oStream) {
+void            print_mmu_status(Print& oStream)
+{
   oStream.println();
   oStream.printf_P(PSTR("MMU Configuration"));
   oStream.println();
   oStream.println();
   uint32_t iram_bank_reg = ESP8266_DREG(0x24);
-  if (0 == (iram_bank_reg & 0x10)) { // if bit clear, is enabled
+  if (0 == (iram_bank_reg & 0x10))
+  {  // if bit clear, is enabled
     oStream.printf_P(PSTR("  IRAM block mapped to:    0x40108000"));
     oStream.println();
   }
-  if (0 == (iram_bank_reg & 0x08)) {
+  if (0 == (iram_bank_reg & 0x08))
+  {
     oStream.printf_P(PSTR("  IRAM block mapped to:    0x4010C000"));
     oStream.println();
   }
@@ -122,7 +133,8 @@ void print_mmu_status(Print& oStream) {
 #endif
 }
 
-void setup() {
+void setup()
+{
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
   // Serial.begin(74880);
@@ -136,22 +148,24 @@ void setup() {
   {
     HeapSelectIram ephemeral;
     // Serial.printf_P(PSTR("ESP.getFreeHeap(): %u\n"), ESP.getFreeHeap());
-    gobble_sz = ESP.getFreeHeap() - UMM_OVERHEAD_ADJUST; // - 4096;
-    gobble = (uint32_t*)malloc(gobble_sz);
+    gobble_sz = ESP.getFreeHeap() - UMM_OVERHEAD_ADJUST;  // - 4096;
+    gobble    = (uint32_t*)malloc(gobble_sz);
   }
   Serial.printf_P(PSTR("\r\nmalloc() from IRAM Heap:\r\n"));
   Serial.printf_P(PSTR("  gobble_sz: %u\r\n"), gobble_sz);
   Serial.printf_P(PSTR("  gobble:    %p\r\n"), gobble);
 
 #elif defined(MMU_SEC_HEAP)
-  gobble = (uint32_t*)MMU_SEC_HEAP;
+  gobble    = (uint32_t*)MMU_SEC_HEAP;
   gobble_sz = MMU_SEC_HEAP_SIZE;
 #endif
 
 #if (MMU_IRAM_SIZE > 0x8000) || defined(MMU_IRAM_HEAP) || defined(MMU_SEC_HEAP)
-  if (isValid(gobble)) {
+  if (isValid(gobble))
+  {
     // Put something in our new memory
-    for (size_t i = 0; i < (gobble_sz / 4); i++) {
+    for (size_t i = 0; i < (gobble_sz / 4); i++)
+    {
       gobble[i] = (uint32_t)&gobble[i];
     }
 
@@ -166,14 +180,17 @@ void setup() {
   Serial.printf_P(PSTR("\r\nPeek over the edge of memory at 0x4010C000\r\n"));
   dump_mem32((void*)(0x4010C000 - 16 * 4), 32);
 
-  probe_b = (char*)gobble;
-  probe_s = (short*)((uintptr_t)gobble);
+  probe_b           = (char*)gobble;
+  probe_s           = (short*)((uintptr_t)gobble);
   unaligned_probe_s = (short*)((uintptr_t)gobble + 1);
 }
 
-void processKey(Print& out, int hotKey) {
-  switch (hotKey) {
-    case 't': {
+void processKey(Print& out, int hotKey)
+{
+  switch (hotKey)
+  {
+    case 't':
+    {
       uint32_t tmp;
       out.printf_P(PSTR("Test how much time is added by exception handling"));
       out.println();
@@ -225,7 +242,8 @@ void processKey(Print& out, int hotKey) {
       out.printf_P(PSTR("Read Byte from iRAM, 0x%02X at %p"), probe_b[0], probe_b);
       out.println();
       break;
-    case 'B': {
+    case 'B':
+    {
       out.printf_P(PSTR("Load/Store exception by writing byte to iRAM"));
       out.println();
       char val = 0x55;
@@ -244,7 +262,8 @@ void processKey(Print& out, int hotKey) {
       out.printf_P(PSTR("Read short from iRAM, 0x%04X at %p"), probe_s[0], probe_s);
       out.println();
       break;
-    case 'S': {
+    case 'S':
+    {
       out.printf_P(PSTR("Load/Store exception by writing short to iRAM"));
       out.println();
       short int val = 0x0AA0;
@@ -308,17 +327,21 @@ void processKey(Print& out, int hotKey) {
   }
 }
 
-void serialClientLoop(void) {
-  if (Serial.available() > 0) {
+void serialClientLoop(void)
+{
+  if (Serial.available() > 0)
+  {
     int hotKey = Serial.read();
     processKey(Serial, hotKey);
   }
 }
 
-void loop() {
+void loop()
+{
   serialClientLoop();
 }
 
-int __attribute__((noinline)) divideA_B(int a, int b) {
+int __attribute__((noinline)) divideA_B(int a, int b)
+{
   return (a / b);
 }
diff --git a/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino b/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
index 31a6f26cc6..1039347bda 100644
--- a/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
+++ b/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
@@ -18,7 +18,7 @@
 #endif
 
 // initial time (possibly given by an external RTC)
-#define RTC_UTC_TEST 1510592825 // 1510592825 = Monday 13 November 2017 17:07:05 UTC
+#define RTC_UTC_TEST 1510592825  // 1510592825 = Monday 13 November 2017 17:07:05 UTC
 
 // This database is autogenerated from IANA timezone database
 //    https://www.iana.org/time-zones
@@ -42,29 +42,29 @@
 ////////////////////////////////////////////////////////
 
 #include <ESP8266WiFi.h>
-#include <coredecls.h> // settimeofday_cb()
+#include <coredecls.h>  // settimeofday_cb()
 #include <Schedule.h>
 #include <PolledTimeout.h>
 
-#include <time.h> // time() ctime()
-#include <sys/time.h> // struct timeval
+#include <time.h>      // time() ctime()
+#include <sys/time.h>  // struct timeval
 
-#include <sntp.h> // sntp_servermode_dhcp()
+#include <sntp.h>  // sntp_servermode_dhcp()
 
 // for testing purpose:
-extern "C" int clock_gettime(clockid_t unused, struct timespec* tp);
+extern "C" int                            clock_gettime(clockid_t unused, struct timespec* tp);
 
 ////////////////////////////////////////////////////////
 
-static timeval tv;
-static timespec tp;
-static time_t now;
-static uint32_t now_ms, now_us;
+static timeval                            tv;
+static timespec                           tp;
+static time_t                             now;
+static uint32_t                           now_ms, now_us;
 
 static esp8266::polledTimeout::periodicMs showTimeNow(60000);
-static int time_machine_days = 0; // 0 = present
-static bool time_machine_running = false;
-static bool time_machine_run_once = false;
+static int                                time_machine_days     = 0;  // 0 = present
+static bool                               time_machine_running  = false;
+static bool                               time_machine_run_once = false;
 
 // OPTIONAL: change SNTP startup delay
 // a weak function is already defined and returns 0 (RFC violation)
@@ -88,7 +88,8 @@ static bool time_machine_run_once = false;
   Serial.print(" " #w "="); \
   Serial.print(tm->tm_##w);
 
-void printTm(const char* what, const tm* tm) {
+void printTm(const char* what, const tm* tm)
+{
   Serial.print(what);
   PTM(isdst);
   PTM(yday);
@@ -101,10 +102,11 @@ void printTm(const char* what, const tm* tm) {
   PTM(sec);
 }
 
-void showTime() {
+void showTime()
+{
   gettimeofday(&tv, nullptr);
   clock_gettime(0, &tp);
-  now = time(nullptr);
+  now    = time(nullptr);
   now_ms = millis();
   now_us = micros();
 
@@ -146,19 +148,24 @@ void showTime() {
   Serial.print(ctime(&now));
 
   // lwIP v2 is able to list more details about the currently configured SNTP servers
-  for (int i = 0; i < SNTP_MAX_SERVERS; i++) {
-    IPAddress sntp = *sntp_getserver(i);
+  for (int i = 0; i < SNTP_MAX_SERVERS; i++)
+  {
+    IPAddress   sntp = *sntp_getserver(i);
     const char* name = sntp_getservername(i);
-    if (sntp.isSet()) {
+    if (sntp.isSet())
+    {
       Serial.printf("sntp%d:     ", i);
-      if (name) {
+      if (name)
+      {
         Serial.printf("%s (%s) ", name, sntp.toString().c_str());
-      } else {
+      }
+      else
+      {
         Serial.printf("%s ", sntp.toString().c_str());
       }
       Serial.printf("- IPv6: %s - Reachability: %o\n",
-          sntp.isV6() ? "Yes" : "No",
-          sntp_getreachability(i));
+                    sntp.isV6() ? "Yes" : "No",
+                    sntp_getreachability(i));
     }
   }
 
@@ -166,18 +173,20 @@ void showTime() {
 
   // show subsecond synchronisation
   timeval prevtv;
-  time_t prevtime = time(nullptr);
+  time_t  prevtime = time(nullptr);
   gettimeofday(&prevtv, nullptr);
 
-  while (true) {
+  while (true)
+  {
     gettimeofday(&tv, nullptr);
-    if (tv.tv_sec != prevtv.tv_sec) {
+    if (tv.tv_sec != prevtv.tv_sec)
+    {
       Serial.printf("time(): %u   gettimeofday(): %u.%06u  seconds are unchanged\n",
-          (uint32_t)prevtime,
-          (uint32_t)prevtv.tv_sec, (uint32_t)prevtv.tv_usec);
+                    (uint32_t)prevtime,
+                    (uint32_t)prevtv.tv_sec, (uint32_t)prevtv.tv_usec);
       Serial.printf("time(): %u   gettimeofday(): %u.%06u  <-- seconds have changed\n",
-          (uint32_t)(prevtime = time(nullptr)),
-          (uint32_t)tv.tv_sec, (uint32_t)tv.tv_usec);
+                    (uint32_t)(prevtime = time(nullptr)),
+                    (uint32_t)tv.tv_sec, (uint32_t)tv.tv_usec);
       break;
     }
     prevtv = tv;
@@ -187,55 +196,71 @@ void showTime() {
   Serial.println();
 }
 
-void time_is_set(bool from_sntp /* <= this parameter is optional */) {
+void time_is_set(bool from_sntp /* <= this parameter is optional */)
+{
   // in CONT stack, unlike ISRs,
   // any function is allowed in this callback
 
-  if (time_machine_days == 0) {
-    if (time_machine_running) {
+  if (time_machine_days == 0)
+  {
+    if (time_machine_running)
+    {
       time_machine_run_once = true;
-      time_machine_running = false;
-    } else {
+      time_machine_running  = false;
+    }
+    else
+    {
       time_machine_running = from_sntp && !time_machine_run_once;
     }
-    if (time_machine_running) {
+    if (time_machine_running)
+    {
       Serial.printf("\n-- \n-- Starting time machine demo to show libc's "
                     "automatic DST handling\n-- \n");
     }
   }
 
   Serial.print("settimeofday(");
-  if (from_sntp) {
+  if (from_sntp)
+  {
     Serial.print("SNTP");
-  } else {
+  }
+  else
+  {
     Serial.print("USER");
   }
   Serial.print(")");
 
   // time machine demo
-  if (time_machine_running) {
-    now = time(nullptr);
+  if (time_machine_running)
+  {
+    now          = time(nullptr);
     const tm* tm = localtime(&now);
     Serial.printf(": future=%3ddays: DST=%s - ",
-        time_machine_days,
-        tm->tm_isdst ? "true " : "false");
+                  time_machine_days,
+                  tm->tm_isdst ? "true " : "false");
     Serial.print(ctime(&now));
     gettimeofday(&tv, nullptr);
     constexpr int days = 30;
     time_machine_days += days;
-    if (time_machine_days > 360) {
+    if (time_machine_days > 360)
+    {
       tv.tv_sec -= (time_machine_days - days) * 60 * 60 * 24;
       time_machine_days = 0;
-    } else {
+    }
+    else
+    {
       tv.tv_sec += days * 60 * 60 * 24;
     }
     settimeofday(&tv, nullptr);
-  } else {
+  }
+  else
+  {
     Serial.println();
   }
 }
 
-void setup() {
+void setup()
+{
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
 
@@ -251,8 +276,8 @@ void setup() {
   // setup RTC time
   // it will be used until NTP server will send us real current time
   Serial.println("Manually setting some time from some RTC:");
-  time_t rtc = RTC_UTC_TEST;
-  timeval tv = { rtc, 0 };
+  time_t  rtc = RTC_UTC_TEST;
+  timeval tv  = { rtc, 0 };
   settimeofday(&tv, nullptr);
 
   // NTP servers may be overridden by your DHCP server for a more local one
@@ -283,8 +308,10 @@ void setup() {
   showTime();
 }
 
-void loop() {
-  if (showTimeNow) {
+void loop()
+{
+  if (showTimeNow)
+  {
     showTime();
   }
 }
diff --git a/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino b/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
index 170eabe38c..89e4145c72 100644
--- a/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
+++ b/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
@@ -16,25 +16,28 @@
 uint32_t calculateCRC32(const uint8_t* data, size_t length);
 
 // helper function to dump memory contents as hex
-void printMemory();
+void     printMemory();
 
 // Structure which will be stored in RTC memory.
 // First field is CRC32, which is calculated based on the
 // rest of structure contents.
 // Any fields can go after CRC32.
 // We use byte array as an example.
-struct {
+struct
+{
   uint32_t crc32;
-  byte data[508];
+  byte     data[508];
 } rtcData;
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   Serial.println();
   delay(1000);
 
   // Read struct from RTC memory
-  if (ESP.rtcUserMemoryRead(0, (uint32_t*)&rtcData, sizeof(rtcData))) {
+  if (ESP.rtcUserMemoryRead(0, (uint32_t*)&rtcData, sizeof(rtcData)))
+  {
     Serial.println("Read: ");
     printMemory();
     Serial.println();
@@ -43,21 +46,26 @@ void setup() {
     Serial.println(crcOfData, HEX);
     Serial.print("CRC32 read from RTC: ");
     Serial.println(rtcData.crc32, HEX);
-    if (crcOfData != rtcData.crc32) {
+    if (crcOfData != rtcData.crc32)
+    {
       Serial.println("CRC32 in RTC memory doesn't match CRC32 of data. Data is probably invalid!");
-    } else {
+    }
+    else
+    {
       Serial.println("CRC32 check ok, data is probably valid.");
     }
   }
 
   // Generate new data set for the struct
-  for (size_t i = 0; i < sizeof(rtcData.data); i++) {
+  for (size_t i = 0; i < sizeof(rtcData.data); i++)
+  {
     rtcData.data[i] = random(0, 128);
   }
   // Update CRC32 of data
   rtcData.crc32 = calculateCRC32((uint8_t*)&rtcData.data[0], sizeof(rtcData.data));
   // Write struct to RTC memory
-  if (ESP.rtcUserMemoryWrite(0, (uint32_t*)&rtcData, sizeof(rtcData))) {
+  if (ESP.rtcUserMemoryWrite(0, (uint32_t*)&rtcData, sizeof(rtcData)))
+  {
     Serial.println("Write: ");
     printMemory();
     Serial.println();
@@ -67,20 +75,26 @@ void setup() {
   ESP.deepSleep(5e6);
 }
 
-void loop() {
+void loop()
+{
 }
 
-uint32_t calculateCRC32(const uint8_t* data, size_t length) {
+uint32_t calculateCRC32(const uint8_t* data, size_t length)
+{
   uint32_t crc = 0xffffffff;
-  while (length--) {
+  while (length--)
+  {
     uint8_t c = *data++;
-    for (uint32_t i = 0x80; i > 0; i >>= 1) {
+    for (uint32_t i = 0x80; i > 0; i >>= 1)
+    {
       bool bit = crc & 0x80000000;
-      if (c & i) {
+      if (c & i)
+      {
         bit = !bit;
       }
       crc <<= 1;
-      if (bit) {
+      if (bit)
+      {
         crc ^= 0x04c11db7;
       }
     }
@@ -89,15 +103,20 @@ uint32_t calculateCRC32(const uint8_t* data, size_t length) {
 }
 
 //prints all rtcData, including the leading crc32
-void printMemory() {
-  char buf[3];
+void printMemory()
+{
+  char     buf[3];
   uint8_t* ptr = (uint8_t*)&rtcData;
-  for (size_t i = 0; i < sizeof(rtcData); i++) {
+  for (size_t i = 0; i < sizeof(rtcData); i++)
+  {
     sprintf(buf, "%02X", ptr[i]);
     Serial.print(buf);
-    if ((i + 1) % 32 == 0) {
+    if ((i + 1) % 32 == 0)
+    {
       Serial.println();
-    } else {
+    }
+    else
+    {
       Serial.print(" ");
     }
   }
diff --git a/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino b/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
index d2fd2f2e21..bdf660244f 100644
--- a/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
+++ b/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
@@ -1,6 +1,7 @@
-#define TIMEOUT (10000UL) // Maximum time to wait for serial activity to start
+#define TIMEOUT (10000UL)  // Maximum time to wait for serial activity to start
 
-void setup() {
+void setup()
+{
   // put your setup code here, to run once:
 
   Serial.begin(115200);
@@ -9,11 +10,13 @@ void setup() {
   // There must be activity on the serial port for the baudrate to be detected
   unsigned long detectedBaudrate = Serial.detectBaudrate(TIMEOUT);
 
-  if (detectedBaudrate) {
+  if (detectedBaudrate)
+  {
     Serial.printf("\nDetected baudrate is %lu, switching to that baudrate now...\n", detectedBaudrate);
 
     // Wait for printf to finish
-    while (Serial.availableForWrite() != UART_TX_FIFO_SIZE) {
+    while (Serial.availableForWrite() != UART_TX_FIFO_SIZE)
+    {
       yield();
     }
 
@@ -22,11 +25,14 @@ void setup() {
 
     // After this, any writing to Serial will print gibberish on the serial monitor if the baudrate doesn't match
     Serial.begin(detectedBaudrate);
-  } else {
+  }
+  else
+  {
     Serial.println("\nNothing detected");
   }
 }
 
-void loop() {
+void loop()
+{
   // put your main code here, to run repeatedly:
 }
diff --git a/libraries/esp8266/examples/SerialStress/SerialStress.ino b/libraries/esp8266/examples/SerialStress/SerialStress.ino
index b899c76eac..6c22ce8c7b 100644
--- a/libraries/esp8266/examples/SerialStress/SerialStress.ino
+++ b/libraries/esp8266/examples/SerialStress/SerialStress.ino
@@ -11,57 +11,63 @@
 #include <ESP8266WiFi.h>
 #include <SoftwareSerial.h>
 
-#define SSBAUD 115200 // logger on console for humans
-#define BAUD 3000000 // hardware serial stress test
-#define BUFFER_SIZE 4096 // may be useless to use more than 2*SERIAL_SIZE_RX
-#define SERIAL_SIZE_RX 1024 // Serial.setRxBufferSize()
+#define SSBAUD 115200        // logger on console for humans
+#define BAUD 3000000         // hardware serial stress test
+#define BUFFER_SIZE 4096     // may be useless to use more than 2*SERIAL_SIZE_RX
+#define SERIAL_SIZE_RX 1024  // Serial.setRxBufferSize()
 
-#define FAKE_INCREASED_AVAILABLE 100 // test readBytes's timeout
+#define FAKE_INCREASED_AVAILABLE 100  // test readBytes's timeout
 
 #define TIMEOUT 5000
-#define DEBUG(x...) //x
+#define DEBUG(x...)  //x
 
-uint8_t buf[BUFFER_SIZE];
-uint8_t temp[BUFFER_SIZE];
-bool reading = true;
-size_t testReadBytesTimeout = 0;
+uint8_t         buf[BUFFER_SIZE];
+uint8_t         temp[BUFFER_SIZE];
+bool            reading              = true;
+size_t          testReadBytesTimeout = 0;
 
-static size_t out_idx = 0, in_idx = 0;
-static size_t local_receive_size = 0;
-static size_t size_for_1sec, size_for_led = 0;
-static size_t maxavail = 0;
+static size_t   out_idx = 0, in_idx = 0;
+static size_t   local_receive_size = 0;
+static size_t   size_for_1sec, size_for_led = 0;
+static size_t   maxavail = 0;
 static uint64_t in_total = 0, in_prev = 0;
 static uint64_t start_ms, last_ms;
 static uint64_t timeout;
 
-Stream* logger;
+Stream*         logger;
 
-void error(const char* what) {
+void            error(const char* what)
+{
   logger->printf("\nerror: %s after %ld minutes\nread idx:  %d\nwrite idx: %d\ntotal:     %ld\nlast read: %d\nmaxavail:  %d\n",
-      what, (long)((millis() - start_ms) / 60000), in_idx, out_idx, (long)in_total, (int)local_receive_size, maxavail);
-  if (Serial.hasOverrun()) {
+                 what, (long)((millis() - start_ms) / 60000), in_idx, out_idx, (long)in_total, (int)local_receive_size, maxavail);
+  if (Serial.hasOverrun())
+  {
     logger->printf("overrun!\n");
   }
   logger->printf("should be (size=%d idx=%d..%d):\n    ", BUFFER_SIZE, in_idx, in_idx + local_receive_size - 1);
-  for (size_t i = in_idx; i < in_idx + local_receive_size; i++) {
+  for (size_t i = in_idx; i < in_idx + local_receive_size; i++)
+  {
     logger->printf("%02x(%c) ", buf[i], (unsigned char)((buf[i] > 31 && buf[i] < 128) ? buf[i] : '.'));
   }
   logger->print("\n\nis: ");
-  for (size_t i = 0; i < local_receive_size; i++) {
+  for (size_t i = 0; i < local_receive_size; i++)
+  {
     logger->printf("%02x(%c) ", temp[i], (unsigned char)((temp[i] > 31 && temp[i] < 128) ? temp[i] : '.'));
   }
   logger->println("\n\n");
 
-  while (true) {
+  while (true)
+  {
     delay(1000);
   }
 }
 
-void setup() {
+void setup()
+{
   pinMode(LED_BUILTIN, OUTPUT);
 
   Serial.begin(BAUD);
-  Serial.swap(); // RX=GPIO13 TX=GPIO15
+  Serial.swap();  // RX=GPIO13 TX=GPIO15
   Serial.setRxBufferSize(SERIAL_SIZE_RX);
 
   // using HardwareSerial0 pins,
@@ -76,15 +82,16 @@ void setup() {
   int baud = Serial.baudRate();
   logger->printf(ESP.getFullVersion().c_str());
   logger->printf("\n\nBAUD: %d - CoreRxBuffer: %d bytes - TestBuffer: %d bytes\n",
-      baud, SERIAL_SIZE_RX, BUFFER_SIZE);
+                 baud, SERIAL_SIZE_RX, BUFFER_SIZE);
 
-  size_for_1sec = baud / 10; // 8n1=10baudFor8bits
+  size_for_1sec = baud / 10;  // 8n1=10baudFor8bits
   logger->printf("led changes state every %zd bytes (= 1 second)\n", size_for_1sec);
   logger->printf("press 's' to stop reading, not writing (induces overrun)\n");
   logger->printf("press 't' to toggle timeout testing on readBytes\n");
 
   // prepare send/compare buffer
-  for (size_t i = 0; i < sizeof buf; i++) {
+  for (size_t i = 0; i < sizeof buf; i++)
+  {
     buf[i] = (uint8_t)i;
   }
 
@@ -93,7 +100,8 @@ void setup() {
 
   while (Serial.read() == -1)
     ;
-  if (Serial.hasOverrun()) {
+  if (Serial.hasOverrun())
+  {
     logger->print("overrun?\n");
   }
 
@@ -101,58 +109,72 @@ void setup() {
   logger->println("setup done");
 }
 
-void loop() {
+void loop()
+{
   size_t maxlen = Serial.availableForWrite();
   // check remaining space in buffer
-  if (maxlen > BUFFER_SIZE - out_idx) {
+  if (maxlen > BUFFER_SIZE - out_idx)
+  {
     maxlen = BUFFER_SIZE - out_idx;
   }
   // check if not cycling more than buffer size relatively to input
   size_t in_out = out_idx == in_idx ? BUFFER_SIZE : (in_idx + BUFFER_SIZE - out_idx - 1) % BUFFER_SIZE;
-  if (maxlen > in_out) {
+  if (maxlen > in_out)
+  {
     maxlen = in_out;
   }
   DEBUG(logger->printf("(aw%i/w%i", Serial.availableForWrite(), maxlen));
   size_t local_written_size = Serial.write(buf + out_idx, maxlen);
   DEBUG(logger->printf(":w%i/aw%i/ar%i)\n", local_written_size, Serial.availableForWrite(), Serial.available()));
-  if (local_written_size > maxlen) {
+  if (local_written_size > maxlen)
+  {
     error("bad write");
   }
-  if ((out_idx += local_written_size) == BUFFER_SIZE) {
+  if ((out_idx += local_written_size) == BUFFER_SIZE)
+  {
     out_idx = 0;
   }
   yield();
 
   DEBUG(logger->printf("----------\n"));
 
-  if (Serial.hasOverrun()) {
+  if (Serial.hasOverrun())
+  {
     logger->printf("rx overrun!\n");
   }
-  if (Serial.hasRxError()) {
+  if (Serial.hasRxError())
+  {
     logger->printf("rx error!\n");
   }
 
-  if (reading) {
+  if (reading)
+  {
     // receive data
     maxlen = Serial.available() + testReadBytesTimeout;
-    if (maxlen > maxavail) {
+    if (maxlen > maxavail)
+    {
       maxavail = maxlen;
     }
     // check space in temp receive buffer
-    if (maxlen > BUFFER_SIZE - in_idx) {
+    if (maxlen > BUFFER_SIZE - in_idx)
+    {
       maxlen = BUFFER_SIZE - in_idx;
     }
     DEBUG(logger->printf("(ar%i/r%i", Serial.available(), maxlen));
     local_receive_size = Serial.readBytes(temp, maxlen);
     DEBUG(logger->printf(":r%i/ar%i)\n", local_receive_size, Serial.available()));
-    if (local_receive_size > maxlen) {
+    if (local_receive_size > maxlen)
+    {
       error("bad read");
     }
-    if (local_receive_size) {
-      if (memcmp(buf + in_idx, temp, local_receive_size) != 0) {
+    if (local_receive_size)
+    {
+      if (memcmp(buf + in_idx, temp, local_receive_size) != 0)
+      {
         error("fail");
       }
-      if ((in_idx += local_receive_size) == BUFFER_SIZE) {
+      if ((in_idx += local_receive_size) == BUFFER_SIZE)
+      {
         in_idx = 0;
       }
       in_total += local_receive_size;
@@ -161,17 +183,19 @@ void loop() {
   }
 
   // say something on data every second
-  if ((size_for_led += local_written_size) >= size_for_1sec || millis() > timeout) {
+  if ((size_for_led += local_written_size) >= size_for_1sec || millis() > timeout)
+  {
     digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
     size_for_led = 0;
 
-    if (in_prev == in_total) {
+    if (in_prev == in_total)
+    {
       error("receiving nothing?\n");
     }
 
-    unsigned long now_ms = millis();
-    int bwkbps_avg = ((((uint64_t)in_total) * 8000) / (now_ms - start_ms)) >> 10;
-    int bwkbps_now = (((in_total - in_prev) * 8000) / (now_ms - last_ms)) >> 10;
+    unsigned long now_ms     = millis();
+    int           bwkbps_avg = ((((uint64_t)in_total) * 8000) / (now_ms - start_ms)) >> 10;
+    int           bwkbps_now = (((in_total - in_prev) * 8000) / (now_ms - last_ms)) >> 10;
     logger->printf("bwavg=%d bwnow=%d kbps maxavail=%i\n", bwkbps_avg, bwkbps_now, maxavail);
 
     in_prev = in_total;
@@ -179,7 +203,8 @@ void loop() {
   }
 
   if (logger->available())
-    switch (logger->read()) {
+    switch (logger->read())
+    {
       case 's':
         logger->println("now stopping reading, keeping writing");
         reading = false;
diff --git a/libraries/esp8266/examples/SigmaDeltaDemo/SigmaDeltaDemo.ino b/libraries/esp8266/examples/SigmaDeltaDemo/SigmaDeltaDemo.ino
index 7b432bf2da..83b919387e 100644
--- a/libraries/esp8266/examples/SigmaDeltaDemo/SigmaDeltaDemo.ino
+++ b/libraries/esp8266/examples/SigmaDeltaDemo/SigmaDeltaDemo.ino
@@ -2,22 +2,22 @@
 
 #include "sigma_delta.h"
 
-void setup() {
-
+void setup()
+{
   Serial.begin(115200);
-  pinMode(LED_BUILTIN, OUTPUT); // blinkie & sigma-delta mix
+  pinMode(LED_BUILTIN, OUTPUT);  // blinkie & sigma-delta mix
   uint32_t reqFreq = 1000;
   uint32_t realFreq;
 
-  realFreq = sigmaDeltaSetup(0, reqFreq); // chose a low frequency
+  realFreq = sigmaDeltaSetup(0, reqFreq);  // chose a low frequency
 
   Serial.println();
   Serial.println("Start Sigma Delta Example\n");
   Serial.printf("Frequency = %u\n", realFreq);
 }
 
-void loop() {
-
+void loop()
+{
   uint8_t duty, iRepeat;
 
   Serial.println("Attaching the built in led to the sigma delta source now\n");
@@ -25,13 +25,16 @@ void loop() {
   sigmaDeltaAttachPin(LED_BUILTIN);
 
   Serial.println("Dimming builtin led...\n");
-  for (iRepeat = 0; iRepeat < 10; iRepeat++) {
-    for (duty = 0; duty < 255; duty = duty + 5) {
+  for (iRepeat = 0; iRepeat < 10; iRepeat++)
+  {
+    for (duty = 0; duty < 255; duty = duty + 5)
+    {
       sigmaDeltaWrite(0, duty);
       delay(10);
     }
 
-    for (duty = 255; duty > 0; duty = duty - 5) {
+    for (duty = 255; duty > 0; duty = duty - 5)
+    {
       sigmaDeltaWrite(0, duty);
       delay(10);
     }
@@ -39,7 +42,8 @@ void loop() {
 
   Serial.println("Detaching builtin led & playing a blinkie\n");
   sigmaDeltaDetachPin(LED_BUILTIN);
-  for (iRepeat = 0; iRepeat < 20; iRepeat++) {
+  for (iRepeat = 0; iRepeat < 20; iRepeat++)
+  {
     digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
     delay(500);
   }
diff --git a/libraries/esp8266/examples/StreamString/StreamString.ino b/libraries/esp8266/examples/StreamString/StreamString.ino
index 446f1e0c75..66de2494dc 100644
--- a/libraries/esp8266/examples/StreamString/StreamString.ino
+++ b/libraries/esp8266/examples/StreamString/StreamString.ino
@@ -4,14 +4,19 @@
 #include <StreamDev.h>
 #include <StreamString.h>
 
-void loop() {
+void loop()
+{
   delay(1000);
 }
 
-void checksketch(const char* what, const char* res1, const char* res2) {
-  if (strcmp(res1, res2) == 0) {
+void checksketch(const char* what, const char* res1, const char* res2)
+{
+  if (strcmp(res1, res2) == 0)
+  {
     Serial << "PASSED: Test " << what << " (result: '" << res1 << "')\n";
-  } else {
+  }
+  else
+  {
     Serial << "FAILED: Test " << what << ": '" << res1 << "' <> '" << res2 << "' !\n";
   }
 }
@@ -20,20 +25,22 @@ void checksketch(const char* what, const char* res1, const char* res2) {
 #define check(what, res1, res2) checksketch(what, res1, res2)
 #endif
 
-void testStringPtrProgmem() {
+void testStringPtrProgmem()
+{
   static const char inProgmem[] PROGMEM = "I am in progmem";
-  auto inProgmem2 = F("I am too in progmem");
+  auto              inProgmem2          = F("I am too in progmem");
 
-  int heap = (int)ESP.getFreeHeap();
-  auto stream1 = StreamConstPtr(inProgmem, sizeof(inProgmem) - 1);
-  auto stream2 = StreamConstPtr(inProgmem2);
+  int               heap                = (int)ESP.getFreeHeap();
+  auto              stream1             = StreamConstPtr(inProgmem, sizeof(inProgmem) - 1);
+  auto              stream2             = StreamConstPtr(inProgmem2);
   Serial << stream1 << " - " << stream2 << "\n";
   heap -= (int)ESP.getFreeHeap();
   check("NO heap occupation while streaming progmem strings", String(heap).c_str(), "0");
 }
 
-void testStreamString() {
-  String inputString = "hello";
+void testStreamString()
+{
+  String       inputString = "hello";
   StreamString result;
 
   // By default, reading a S2Stream(String) or a StreamString will consume the String.
@@ -109,7 +116,7 @@ void testStreamString() {
     result.clear();
     S2Stream input(inputString);
     // reading stream will consume the string
-    input.setConsume(); // can be omitted, this is the default
+    input.setConsume();  // can be omitted, this is the default
 
     input.sendSize(result, 1);
     input.sendSize(result, 2);
@@ -154,14 +161,17 @@ void testStreamString() {
 
   // .. but it does when S2Stream or StreamString is used
   {
-    int heap = (int)ESP.getFreeHeap();
+    int  heap   = (int)ESP.getFreeHeap();
     auto stream = StreamString(F("I am in progmem"));
     Serial << stream << "\n";
     heap -= (int)ESP.getFreeHeap();
     String heapStr(heap);
-    if (heap != 0) {
+    if (heap != 0)
+    {
       check("heap is occupied by String/StreamString(progmem)", heapStr.c_str(), heapStr.c_str());
-    } else {
+    }
+    else
+    {
       check("ERROR: heap should be occupied by String/StreamString(progmem)", heapStr.c_str(), "-1");
     }
   }
@@ -174,14 +184,15 @@ void testStreamString() {
 
 #ifndef TEST_CASE
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   delay(1000);
 
   testStreamString();
 
   Serial.printf("sizeof: String:%d Stream:%d StreamString:%d SStream:%d\n",
-      (int)sizeof(String), (int)sizeof(Stream), (int)sizeof(StreamString), (int)sizeof(S2Stream));
+                (int)sizeof(String), (int)sizeof(Stream), (int)sizeof(StreamString), (int)sizeof(S2Stream));
 }
 
 #endif
diff --git a/libraries/esp8266/examples/TestEspApi/TestEspApi.ino b/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
index 0daff924c4..4ad5faf876 100644
--- a/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
+++ b/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
@@ -10,7 +10,8 @@
 */
 
 #ifdef ESP8266
-extern "C" {
+extern "C"
+{
 #include "user_interface.h"
 }
 #endif
@@ -18,7 +19,7 @@ extern "C" {
 // Set up output serial port (could be a SoftwareSerial
 // if really wanted).
 
-Stream& ehConsolePort(Serial);
+Stream&           ehConsolePort(Serial);
 
 // Wired to the blue LED on an ESP-01 board, active LOW.
 //
@@ -26,7 +27,7 @@ Stream& ehConsolePort(Serial);
 // calls, as TX is wired to the same pin.
 //
 // UNLESS: You swap the TX pin using the alternate pinout.
-const uint8_t LED_PIN = 1;
+const uint8_t     LED_PIN       = 1;
 
 const char* const RST_REASONS[] = {
   "REASON_DEFAULT_RST",
@@ -113,11 +114,13 @@ const char* const EVENT_REASONS_200[] {
   "REASON_NO_AP_FOUND"
 };
 
-void wifi_event_handler_cb(System_Event_t* event) {
+void wifi_event_handler_cb(System_Event_t* event)
+{
   ehConsolePort.print(EVENT_NAMES[event->event]);
   ehConsolePort.print(" (");
 
-  switch (event->event) {
+  switch (event->event)
+  {
     case EVENT_STAMODE_CONNECTED:
       break;
     case EVENT_STAMODE_DISCONNECTED:
@@ -127,18 +130,21 @@ void wifi_event_handler_cb(System_Event_t* event) {
     case EVENT_STAMODE_GOT_IP:
       break;
     case EVENT_SOFTAPMODE_STACONNECTED:
-    case EVENT_SOFTAPMODE_STADISCONNECTED: {
+    case EVENT_SOFTAPMODE_STADISCONNECTED:
+    {
       char mac[32] = { 0 };
       snprintf(mac, 32, MACSTR ", aid: %d", MAC2STR(event->event_info.sta_connected.mac), event->event_info.sta_connected.aid);
 
       ehConsolePort.print(mac);
-    } break;
+    }
+    break;
   }
 
   ehConsolePort.println(")");
 }
 
-void print_softap_config(Stream& consolePort, softap_config const& config) {
+void print_softap_config(Stream& consolePort, softap_config const& config)
+{
   consolePort.println();
   consolePort.println(F("SoftAP Configuration"));
   consolePort.println(F("--------------------"));
@@ -172,7 +178,8 @@ void print_softap_config(Stream& consolePort, softap_config const& config) {
   consolePort.println();
 }
 
-void print_system_info(Stream& consolePort) {
+void print_system_info(Stream& consolePort)
+{
   const rst_info* resetInfo = system_get_rst_info();
   consolePort.print(F("system_get_rst_info() reset reason: "));
   consolePort.println(RST_REASONS[resetInfo->reason]);
@@ -210,7 +217,8 @@ void print_system_info(Stream& consolePort) {
   consolePort.println(FLASH_SIZE_MAP_NAMES[system_get_flash_size_map()]);
 }
 
-void print_wifi_general(Stream& consolePort) {
+void print_wifi_general(Stream& consolePort)
+{
   consolePort.print(F("wifi_get_channel(): "));
   consolePort.println(wifi_get_channel());
 
@@ -218,8 +226,9 @@ void print_wifi_general(Stream& consolePort) {
   consolePort.println(PHY_MODE_NAMES[wifi_get_phy_mode()]);
 }
 
-void secure_softap_config(softap_config* config, const char* ssid, const char* password) {
-  size_t ssidLen = strlen(ssid) < sizeof(config->ssid) ? strlen(ssid) : sizeof(config->ssid);
+void secure_softap_config(softap_config* config, const char* ssid, const char* password)
+{
+  size_t ssidLen     = strlen(ssid) < sizeof(config->ssid) ? strlen(ssid) : sizeof(config->ssid);
   size_t passwordLen = strlen(password) < sizeof(config->password) ? strlen(password) : sizeof(config->password);
 
   memset(config->ssid, 0, sizeof(config->ssid));
@@ -228,15 +237,16 @@ void secure_softap_config(softap_config* config, const char* ssid, const char* p
   memset(config->password, 0, sizeof(config->password));
   memcpy(config->password, password, passwordLen);
 
-  config->ssid_len = ssidLen;
-  config->channel = 1;
-  config->authmode = AUTH_WPA2_PSK;
+  config->ssid_len       = ssidLen;
+  config->channel        = 1;
+  config->authmode       = AUTH_WPA2_PSK;
   //    config->ssid_hidden = 1;
   config->max_connection = 4;
   //    config->beacon_interval = 1000;
 }
 
-void setup() {
+void setup()
+{
   // Reuse default Serial port rate, so the bootloader
   // messages are also readable.
 
@@ -287,7 +297,8 @@ void setup() {
   // ESP.deepSleep(15000);
 }
 
-void loop() {
+void loop()
+{
   Serial.print(F("system_get_time(): "));
   Serial.println(system_get_time());
   delay(1000);
diff --git a/libraries/esp8266/examples/UartDownload/UartDownload.ino b/libraries/esp8266/examples/UartDownload/UartDownload.ino
index 97a28813dc..181dfd4d27 100644
--- a/libraries/esp8266/examples/UartDownload/UartDownload.ino
+++ b/libraries/esp8266/examples/UartDownload/UartDownload.ino
@@ -42,35 +42,37 @@
 // state and clear it after it elapses.
 //
 // Change this to false if you do not want ESP_SYNC monitor always on.
-bool uartDownloadEnable = true;
+bool             uartDownloadEnable = true;
 
 // Buffer size to receive an ESP_SYNC packet into, larger than the expected
 // ESP_SYNC packet length.
-constexpr size_t pktBufSz = 64;
+constexpr size_t pktBufSz           = 64;
 
 // Enough time to receive 115 bytes at 115200bps.
 // More than enough to finish receiving an ESP_SYNC packet.
-constexpr size_t kSyncTimeoutMs = 10;
+constexpr size_t kSyncTimeoutMs     = 10;
 
 // The SLIP Frame end character, which is also used to start a frame.
-constexpr char slipFrameMarker = '\xC0';
+constexpr char   slipFrameMarker    = '\xC0';
 
 // General packet format:
 //   <0xC0><cmd><payload length><32 bit cksum><payload data ...><0xC0>
 // Slip packet for ESP_SYNC, minus the frame markers ('\xC0') captured from
 // esptool using the `--trace` option.
-const char syncPkt[] PROGMEM = "\x00\x08\x24\x00\x00\x00\x00\x00\x07\x07\x12\x20"
+const char       syncPkt[] PROGMEM  = "\x00\x08\x24\x00\x00\x00\x00\x00\x07\x07\x12\x20"
                                "UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU";
 
-constexpr size_t syncPktSz = sizeof(syncPkt) - 1; // Don't compare zero terminator char
+constexpr size_t syncPktSz = sizeof(syncPkt) - 1;  // Don't compare zero terminator char
 
 //
 //  Use the discovery of an ESP_SYNC packet, to trigger calling UART Download
 //  Mode. At entry we expect the Serial FIFO to start with the byte following
 //  the slipFrameMarker.
 //
-void proxyEspSync() {
-  if (!uartDownloadEnable) {
+void             proxyEspSync()
+{
+  if (!uartDownloadEnable)
+  {
     return;
   }
 
@@ -83,13 +85,14 @@ void proxyEspSync() {
 
   // To avoid a false trigger, only start UART Download Mode when we get an
   // exact match to the captured esptool ESP_SYNC packet.
-  if (syncPktSz == len && 0 == memcmp_P(buf, syncPkt, len)) {
+  if (syncPktSz == len && 0 == memcmp_P(buf, syncPkt, len))
+  {
     ESP.rebootIntoUartDownloadMode();
     // Does not return
   }
 
   // Assume RX FIFO data is garbled and flush all RX data.
-  while (0 <= Serial.read()) { } // Clear FIFO
+  while (0 <= Serial.read()) { }  // Clear FIFO
 
   // If your Serial requirements need a specific timeout value, you would
   // restore those here.
@@ -97,7 +100,8 @@ void proxyEspSync() {
 //
 ////////////////////////////////////////////////////////////////////////////////
 
-void setup() {
+void setup()
+{
   // For `proxyEspSync()` to work, the Serial.begin() speed needs to be
   // 115200bps. This is the data rate used by esptool.py. It expects the Boot
   // ROM to use its "auto-baud" feature to match up. Since `proxyEspSync()` is
@@ -121,8 +125,10 @@ void setup() {
   // ...
 }
 
-void cmdLoop(Print& oStream, int key) {
-  switch (key) {
+void cmdLoop(Print& oStream, int key)
+{
+  switch (key)
+  {
     case 'e':
       oStream.println(F("Enable monitor for detecting ESP_SYNC from esptool.py"));
       uartDownloadEnable = true;
@@ -146,7 +152,8 @@ void cmdLoop(Print& oStream, int key) {
 
     case '?':
       oStream.println(F("\r\nHot key help:"));
-      if (!uartDownloadEnable) {
+      if (!uartDownloadEnable)
+      {
         oStream.println(F("  e - Enable monitor for detecting ESP_SYNC from esptool.py"));
       }
       oStream.println(F("  D - Boot into UART download mode"));
@@ -161,19 +168,23 @@ void cmdLoop(Print& oStream, int key) {
   oStream.println();
 }
 
-void loop() {
-
+void loop()
+{
   // In this example, we can have Serial data from a user keystroke for our
   // command loop or the esptool trying to SYNC up for flashing.  If the
   // character matches the Slip Frame Marker (the 1st byte of the SYNC packet),
   // we intercept it and call our ESP_SYNC proxy to complete the verification
   // and reboot into the UART Downloader. Otherwise, process the keystroke as
   // normal.
-  if (0 < Serial.available()) {
+  if (0 < Serial.available())
+  {
     int keyPress = Serial.read();
-    if (slipFrameMarker == keyPress) {
+    if (slipFrameMarker == keyPress)
+    {
       proxyEspSync();
-    } else {
+    }
+    else
+    {
       cmdLoop(Serial, keyPress);
     }
   }
diff --git a/libraries/esp8266/examples/interactive/interactive.ino b/libraries/esp8266/examples/interactive/interactive.ino
index a13b817508..5ad3fc611f 100644
--- a/libraries/esp8266/examples/interactive/interactive.ino
+++ b/libraries/esp8266/examples/interactive/interactive.ino
@@ -16,20 +16,22 @@
 #endif
 
 const char* SSID = STASSID;
-const char* PSK = STAPSK;
+const char* PSK  = STAPSK;
 
-IPAddress staticip(192, 168, 1, 123);
-IPAddress gateway(192, 168, 1, 254);
-IPAddress subnet(255, 255, 255, 0);
+IPAddress   staticip(192, 168, 1, 123);
+IPAddress   gateway(192, 168, 1, 254);
+IPAddress   subnet(255, 255, 255, 0);
 
-void setup() {
+void        setup()
+{
   Serial.begin(115200);
   Serial.setDebugOutput(true);
 
   WiFi.mode(WIFI_STA);
   WiFi.begin(SSID, PSK);
   Serial.println("connecting");
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     delay(500);
     Serial.print(".");
   }
@@ -46,14 +48,16 @@ void setup() {
       "WL_DISCONNECTED     = 7\n");
 }
 
-void WiFiOn() {
+void WiFiOn()
+{
   wifi_fpm_do_wakeup();
   wifi_fpm_close();
   wifi_set_opmode(STATION_MODE);
   wifi_station_connect();
 }
 
-void WiFiOff() {
+void WiFiOff()
+{
   wifi_station_disconnect();
   wifi_set_opmode(NULL_MODE);
   wifi_set_sleep_type(MODEM_SLEEP_T);
@@ -61,10 +65,12 @@ void WiFiOff() {
   wifi_fpm_do_sleep(0xFFFFFFF);
 }
 
-void loop() {
+void loop()
+{
 #define TEST(name, var, varinit, func)   \
   static decltype(func) var = (varinit); \
-  if ((var) != (func)) {                 \
+  if ((var) != (func))                   \
+  {                                      \
     var = (func);                        \
     Serial.printf("**** %s: ", name);    \
     Serial.println(var);                 \
@@ -80,7 +86,8 @@ void loop() {
   TEST("STA-IP", localIp, (uint32_t)0, WiFi.localIP());
   TEST("AP-IP", apIp, (uint32_t)0, WiFi.softAPIP());
 
-  switch (Serial.read()) {
+  switch (Serial.read())
+  {
     case 'F':
       DO(WiFiOff());
     case 'N':
@@ -114,8 +121,8 @@ void loop() {
     case 'm':
       DO(WiFi.setSleepMode(WIFI_MODEM_SLEEP));
     case 'S':
-      DO(WiFi.config(staticip, gateway, subnet)); // use static address
+      DO(WiFi.config(staticip, gateway, subnet));  // use static address
     case 's':
-      DO(WiFi.config(0u, 0u, 0u)); // back to dhcp client
+      DO(WiFi.config(0u, 0u, 0u));  // back to dhcp client
   }
 }
diff --git a/libraries/esp8266/examples/irammem/irammem.ino b/libraries/esp8266/examples/irammem/irammem.ino
index 429b9a389c..853ebd3963 100644
--- a/libraries/esp8266/examples/irammem/irammem.ino
+++ b/libraries/esp8266/examples/irammem/irammem.ino
@@ -18,47 +18,59 @@
   different optimizations.
 */
 
-#pragma GCC push_options
+#pragma GCC                    push_options
 // reference
-#pragma GCC optimize("O0") // We expect -O0 to generate the correct results
-__attribute__((noinline)) void aliasTestReference(uint16_t* x) {
+#pragma GCC                    optimize("O0")  // We expect -O0 to generate the correct results
+__attribute__((noinline)) void aliasTestReference(uint16_t* x)
+{
   // Without adhearance to strict-aliasing, this sequence of code would fail
   // when optimized by GCC Version 10.3
   size_t len = 3;
-  for (size_t u = 0; u < len; u++) {
+  for (size_t u = 0; u < len; u++)
+  {
     uint16_t x1 = mmu_get_uint16(&x[0]);
-    for (size_t v = 0; v < len; v++) {
+    for (size_t v = 0; v < len; v++)
+    {
       x[v] = mmu_get_uint16(&x[v]) + x1;
     }
   }
 }
 // Tests
-#pragma GCC optimize("Os")
-__attribute__((noinline)) void aliasTestOs(uint16_t* x) {
+#pragma GCC                    optimize("Os")
+__attribute__((noinline)) void aliasTestOs(uint16_t* x)
+{
   size_t len = 3;
-  for (size_t u = 0; u < len; u++) {
+  for (size_t u = 0; u < len; u++)
+  {
     uint16_t x1 = mmu_get_uint16(&x[0]);
-    for (size_t v = 0; v < len; v++) {
+    for (size_t v = 0; v < len; v++)
+    {
       x[v] = mmu_get_uint16(&x[v]) + x1;
     }
   }
 }
-#pragma GCC optimize("O2")
-__attribute__((noinline)) void aliasTestO2(uint16_t* x) {
+#pragma GCC                    optimize("O2")
+__attribute__((noinline)) void aliasTestO2(uint16_t* x)
+{
   size_t len = 3;
-  for (size_t u = 0; u < len; u++) {
+  for (size_t u = 0; u < len; u++)
+  {
     uint16_t x1 = mmu_get_uint16(&x[0]);
-    for (size_t v = 0; v < len; v++) {
+    for (size_t v = 0; v < len; v++)
+    {
       x[v] = mmu_get_uint16(&x[v]) + x1;
     }
   }
 }
-#pragma GCC optimize("O3")
-__attribute__((noinline)) void aliasTestO3(uint16_t* x) {
+#pragma GCC                    optimize("O3")
+__attribute__((noinline)) void aliasTestO3(uint16_t* x)
+{
   size_t len = 3;
-  for (size_t u = 0; u < len; u++) {
+  for (size_t u = 0; u < len; u++)
+  {
     uint16_t x1 = mmu_get_uint16(&x[0]);
-    for (size_t v = 0; v < len; v++) {
+    for (size_t v = 0; v < len; v++)
+    {
       x[v] = mmu_get_uint16(&x[v]) + x1;
     }
   }
@@ -70,7 +82,8 @@ __attribute__((noinline)) void aliasTestO3(uint16_t* x) {
 #pragma GCC optimize("O0")
 __attribute__((noinline)) IRAM_ATTR
     uint32_t
-    timedRead_Reference(uint8_t* res) {
+    timedRead_Reference(uint8_t* res)
+{
   // This test case was verified with GCC 10.3
   // There is a code case that can result in 32-bit wide IRAM load from memory
   // being optimized down to an 8-bit memory access. In this test case we need
@@ -79,42 +92,46 @@ __attribute__((noinline)) IRAM_ATTR
   // function mmu_get_uint8() is preventing this. See comments for function
   // mmu_get_uint8(() in mmu_iram.h for more details.
   const uint8_t* x = (const uint8_t*)0x40100003ul;
-  uint32_t b = ESP.getCycleCount();
-  *res = mmu_get_uint8(x);
+  uint32_t       b = ESP.getCycleCount();
+  *res             = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC optimize("Os")
 __attribute__((noinline)) IRAM_ATTR
     uint32_t
-    timedRead_Os(uint8_t* res) {
+    timedRead_Os(uint8_t* res)
+{
   const uint8_t* x = (const uint8_t*)0x40100003ul;
-  uint32_t b = ESP.getCycleCount();
-  *res = mmu_get_uint8(x);
+  uint32_t       b = ESP.getCycleCount();
+  *res             = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC optimize("O2")
 __attribute__((noinline)) IRAM_ATTR
     uint32_t
-    timedRead_O2(uint8_t* res) {
+    timedRead_O2(uint8_t* res)
+{
   const uint8_t* x = (const uint8_t*)0x40100003ul;
-  uint32_t b = ESP.getCycleCount();
-  *res = mmu_get_uint8(x);
+  uint32_t       b = ESP.getCycleCount();
+  *res             = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC optimize("O3")
 __attribute__((noinline)) IRAM_ATTR
     uint32_t
-    timedRead_O3(uint8_t* res) {
+    timedRead_O3(uint8_t* res)
+{
   const uint8_t* x = (const uint8_t*)0x40100003ul;
-  uint32_t b = ESP.getCycleCount();
-  *res = mmu_get_uint8(x);
+  uint32_t       b = ESP.getCycleCount();
+  *res             = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC pop_options
 
-bool test4_32bit_loads() {
-  bool result = true;
-  uint8_t res;
+bool        test4_32bit_loads()
+{
+  bool     result = true;
+  uint8_t  res;
   uint32_t cycle_count_ref, cycle_count;
   Serial.printf("\r\nFor mmu_get_uint8, verify that 32-bit wide IRAM access is preserved across different optimizations:\r\n");
   cycle_count_ref = timedRead_Reference(&res);
@@ -127,57 +144,73 @@ bool test4_32bit_loads() {
   Serial.printf("  Option -O0, cycle count %5u - reference\r\n", cycle_count_ref);
   cycle_count = timedRead_Os(&res);
   Serial.printf("  Option -Os, cycle count %5u ", cycle_count);
-  if (cycle_count_ref > cycle_count) {
+  if (cycle_count_ref > cycle_count)
+  {
     Serial.printf("- passed\r\n");
-  } else {
+  }
+  else
+  {
     result = false;
     Serial.printf("- failed\r\n");
   }
   cycle_count = timedRead_O2(&res);
   Serial.printf("  Option -O2, cycle count %5u ", cycle_count);
-  if (cycle_count_ref > cycle_count) {
+  if (cycle_count_ref > cycle_count)
+  {
     Serial.printf("- passed\r\n");
-  } else {
+  }
+  else
+  {
     result = false;
     Serial.printf("- failed\r\n");
   }
   cycle_count = timedRead_O3(&res);
   Serial.printf("  Option -O3, cycle count %5u ", cycle_count);
-  if (cycle_count_ref > cycle_count) {
+  if (cycle_count_ref > cycle_count)
+  {
     Serial.printf("- passed\r\n");
-  } else {
+  }
+  else
+  {
     result = false;
     Serial.printf("- failed\r\n");
   }
   return result;
 }
 
-void printPunFail(uint16_t* ref, uint16_t* x, size_t sz) {
+void printPunFail(uint16_t* ref, uint16_t* x, size_t sz)
+{
   Serial.printf("    Expected:");
-  for (size_t i = 0; i < sz; i++) {
+  for (size_t i = 0; i < sz; i++)
+  {
     Serial.printf(" %3u", ref[i]);
   }
   Serial.printf("\r\n    Got:     ");
-  for (size_t i = 0; i < sz; i++) {
+  for (size_t i = 0; i < sz; i++)
+  {
     Serial.printf(" %3u", x[i]);
   }
   Serial.printf("\r\n");
 }
 
-bool testPunning() {
-  bool result = true;
+bool testPunning()
+{
+  bool                       result  = true;
   // Get reference result for verifing test
   alignas(uint32_t) uint16_t x_ref[] = { 1, 2, 3, 0 };
-  aliasTestReference(x_ref); // -O0
+  aliasTestReference(x_ref);  // -O0
   Serial.printf("mmu_get_uint16() strict-aliasing tests with different optimizations:\r\n");
 
   {
     alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
     aliasTestOs(x);
     Serial.printf("  Option -Os ");
-    if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
+    if (0 == memcmp(x_ref, x, sizeof(x_ref)))
+    {
       Serial.printf("- passed\r\n");
-    } else {
+    }
+    else
+    {
       result = false;
       Serial.printf("- failed\r\n");
       printPunFail(x_ref, x, sizeof(x_ref) / sizeof(uint16_t));
@@ -187,9 +220,12 @@ bool testPunning() {
     alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
     aliasTestO2(x);
     Serial.printf("  Option -O2 ");
-    if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
+    if (0 == memcmp(x_ref, x, sizeof(x_ref)))
+    {
       Serial.printf("- passed\r\n");
-    } else {
+    }
+    else
+    {
       result = false;
       Serial.printf("- failed\r\n");
       printPunFail(x_ref, x, sizeof(x_ref) / sizeof(uint16_t));
@@ -199,9 +235,12 @@ bool testPunning() {
     alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
     aliasTestO3(x);
     Serial.printf("  Option -O3 ");
-    if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
+    if (0 == memcmp(x_ref, x, sizeof(x_ref)))
+    {
       Serial.printf("- passed\r\n");
-    } else {
+    }
+    else
+    {
       result = false;
       Serial.printf("- failed\r\n");
       printPunFail(x_ref, x, sizeof(x_ref) / sizeof(uint16_t));
@@ -210,80 +249,96 @@ bool testPunning() {
   return result;
 }
 
-uint32_t cyclesToRead_nKx32(int n, unsigned int* x, uint32_t* res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead_nKx32(int n, unsigned int* x, uint32_t* res)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++) {
+  for (int i = 0; i < n * 1024; i++)
+  {
     sum += *(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx32(int n, unsigned int* x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx32(int n, unsigned int* x)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++) {
+  for (int i = 0; i < n * 1024; i++)
+  {
     sum += i;
     *(x++) = sum;
   }
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx16(int n, unsigned short* x, uint32_t* res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead_nKx16(int n, unsigned short* x, uint32_t* res)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++) {
+  for (int i = 0; i < n * 1024; i++)
+  {
     sum += *(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx16(int n, unsigned short* x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx16(int n, unsigned short* x)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++) {
+  for (int i = 0; i < n * 1024; i++)
+  {
     sum += i;
     *(x++) = sum;
   }
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKxs16(int n, short* x, int32_t* res) {
-  uint32_t b = ESP.getCycleCount();
-  int32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++) {
+uint32_t cyclesToRead_nKxs16(int n, short* x, int32_t* res)
+{
+  uint32_t b   = ESP.getCycleCount();
+  int32_t  sum = 0;
+  for (int i = 0; i < n * 1024; i++)
+  {
     sum += *(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKxs16(int n, short* x) {
-  uint32_t b = ESP.getCycleCount();
-  int32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++) {
+uint32_t cyclesToWrite_nKxs16(int n, short* x)
+{
+  uint32_t b   = ESP.getCycleCount();
+  int32_t  sum = 0;
+  for (int i = 0; i < n * 1024; i++)
+  {
     sum += i;
     *(x++) = sum;
   }
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx8(int n, unsigned char* x, uint32_t* res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead_nKx8(int n, unsigned char* x, uint32_t* res)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++) {
+  for (int i = 0; i < n * 1024; i++)
+  {
     sum += *(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx8(int n, unsigned char* x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx8(int n, unsigned char* x)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++) {
+  for (int i = 0; i < n * 1024; i++)
+  {
     sum += i;
     *(x++) = sum;
   }
@@ -291,20 +346,24 @@ uint32_t cyclesToWrite_nKx8(int n, unsigned char* x) {
 }
 
 // Compare with Inline
-uint32_t cyclesToRead_nKx16_viaInline(int n, unsigned short* x, uint32_t* res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead_nKx16_viaInline(int n, unsigned short* x, uint32_t* res)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++) {
-    sum += mmu_get_uint16(x++); //*(x++);
+  for (int i = 0; i < n * 1024; i++)
+  {
+    sum += mmu_get_uint16(x++);  //*(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short* x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short* x)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++) {
+  for (int i = 0; i < n * 1024; i++)
+  {
     sum += i;
     // *(x++) = sum;
     mmu_set_uint16(x++, sum);
@@ -312,20 +371,24 @@ uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short* x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKxs16_viaInline(int n, short* x, int32_t* res) {
-  uint32_t b = ESP.getCycleCount();
-  int32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++) {
-    sum += mmu_get_int16(x++); //*(x++);
+uint32_t cyclesToRead_nKxs16_viaInline(int n, short* x, int32_t* res)
+{
+  uint32_t b   = ESP.getCycleCount();
+  int32_t  sum = 0;
+  for (int i = 0; i < n * 1024; i++)
+  {
+    sum += mmu_get_int16(x++);  //*(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKxs16_viaInline(int n, short* x) {
-  uint32_t b = ESP.getCycleCount();
-  int32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++) {
+uint32_t cyclesToWrite_nKxs16_viaInline(int n, short* x)
+{
+  uint32_t b   = ESP.getCycleCount();
+  int32_t  sum = 0;
+  for (int i = 0; i < n * 1024; i++)
+  {
     sum += i;
     // *(x++) = sum;
     mmu_set_int16(x++, sum);
@@ -333,20 +396,24 @@ uint32_t cyclesToWrite_nKxs16_viaInline(int n, short* x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx8_viaInline(int n, unsigned char* x, uint32_t* res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead_nKx8_viaInline(int n, unsigned char* x, uint32_t* res)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++) {
-    sum += mmu_get_uint8(x++); //*(x++);
+  for (int i = 0; i < n * 1024; i++)
+  {
+    sum += mmu_get_uint8(x++);  //*(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char* x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char* x)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++) {
+  for (int i = 0; i < n * 1024; i++)
+  {
     sum += i;
     // *(x++) = sum;
     mmu_set_uint8(x++, sum);
@@ -354,11 +421,12 @@ uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char* x) {
   return ESP.getCycleCount() - b;
 }
 
-bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
+bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem)
+{
   uint32_t res, verify_res;
   uint32_t t;
-  bool success = true;
-  int sres, verify_sres;
+  bool     success = true;
+  int      sres, verify_sres;
 
   Serial.printf("\r\nPerformance numbers for 16 bit access - using inline macros or exception handling for IRAM.\r\n");
   ;
@@ -375,9 +443,12 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
   Serial.printf("IRAM Memory Write Inline:  %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx16_viaInline(nK, (uint16_t*)imem, &res);
   Serial.printf("IRAM Memory Read Inline:   %7d cycles for %dK by uint16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res);
-  if (res == verify_res) {
+  if (res == verify_res)
+  {
     Serial.printf("- passed\r\n");
-  } else {
+  }
+  else
+  {
     Serial.printf("!= (sum %08x ) - failed\r\n", verify_res);
     success = false;
   }
@@ -386,9 +457,12 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
   Serial.printf("IRAM Memory Write Inline:  %7d cycles for %dK by  int16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKxs16_viaInline(nK, (int16_t*)imem, &sres);
   Serial.printf("IRAM Memory Read Inline:   %7d cycles for %dK by  int16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), sres);
-  if (sres == verify_sres) {
+  if (sres == verify_sres)
+  {
     Serial.printf("- passed\r\n");
-  } else {
+  }
+  else
+  {
     Serial.printf("!= (sum %08x ) - failed\r\n", verify_sres);
     success = false;
   }
@@ -397,9 +471,12 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
   Serial.printf("IRAM Memory Write:         %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx16(nK, (uint16_t*)imem, &res);
   Serial.printf("IRAM Memory Read:          %7d cycles for %dK by uint16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res);
-  if (res == verify_res) {
+  if (res == verify_res)
+  {
     Serial.printf("- passed\r\n");
-  } else {
+  }
+  else
+  {
     Serial.printf("!= (sum %08x ) - failed\r\n", verify_res);
     success = false;
   }
@@ -407,9 +484,12 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
   Serial.printf("IRAM Memory Write:         %7d cycles for %dK by  int16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKxs16(nK, (int16_t*)imem, &sres);
   Serial.printf("IRAM Memory Read:          %7d cycles for %dK by  int16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), sres);
-  if (sres == verify_sres) {
+  if (sres == verify_sres)
+  {
     Serial.printf("- passed\r\n");
-  } else {
+  }
+  else
+  {
     Serial.printf("!= (sum %08x ) - failed\r\n", verify_sres);
     success = false;
   }
@@ -425,9 +505,12 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
   Serial.printf("IRAM Memory Write Inline:  %7d cycles for %dK by  uint8, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx8_viaInline(nK, (uint8_t*)imem, &res);
   Serial.printf("IRAM Memory Read Inline:   %7d cycles for %dK by  uint8, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res);
-  if (res == verify_res) {
+  if (res == verify_res)
+  {
     Serial.printf("- passed\r\n");
-  } else {
+  }
+  else
+  {
     Serial.printf("!= (sum %08x ) - failed\r\n", verify_res);
     success = false;
   }
@@ -436,9 +519,12 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
   Serial.printf("IRAM Memory Write:         %7d cycles for %dK by  uint8, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx8(nK, (uint8_t*)imem, &res);
   Serial.printf("IRAM Memory Read:          %7d cycles for %dK by  uint8, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res);
-  if (res == verify_res) {
+  if (res == verify_res)
+  {
     Serial.printf("- passed\r\n");
-  } else {
+  }
+  else
+  {
     Serial.printf("!= (sum %08x ) - failed\r\n", verify_res);
     success = false;
   }
@@ -447,7 +533,8 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
   return success;
 }
 
-void setup() {
+void setup()
+{
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
   // Serial.begin(74880);
@@ -468,7 +555,8 @@ void setup() {
   Serial.printf("DRAM free: %6d\r\n", ESP.getFreeHeap());
   uint32_t* mem = (uint32_t*)malloc(2 * 1024 * sizeof(uint32_t));
   Serial.printf("DRAM buffer: Address %p, free %d\r\n", mem, ESP.getFreeHeap());
-  if (!mem) {
+  if (!mem)
+  {
     return;
   }
 
@@ -494,13 +582,14 @@ void setup() {
     Serial.printf("IRAM buffer: Address %p, free %d\r\n", imem, ESP.getFreeHeap());
   }
 #endif
-  if (!imem) {
+  if (!imem)
+  {
     return;
   }
 
   uint32_t res;
   uint32_t t;
-  int nK = 1;
+  int      nK = 1;
   Serial.printf("\r\nPerformance numbers for 32 bit access - no exception handler or inline macros needed.\r\n");
   ;
   t = cyclesToWrite_nKx32(nK, mem);
@@ -514,9 +603,12 @@ void setup() {
   Serial.printf("IRAM Memory Read:          %7d cycles for %dK by uint32, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), res);
   Serial.println();
 
-  if (perfTest_nK(1, mem, imem) && testPunning() && test4_32bit_loads()) {
+  if (perfTest_nK(1, mem, imem) && testPunning() && test4_32bit_loads())
+  {
     Serial.println();
-  } else {
+  }
+  else
+  {
     Serial.println("\r\n*******************************");
     Serial.println("*******************************");
     Serial.println("**                           **");
@@ -531,7 +623,8 @@ void setup() {
   // Let's use IRAM heap to make a big ole' String
   ESP.setIramHeap();
   String s = "";
-  for (int i = 0; i < 100; i++) {
+  for (int i = 0; i < 100; i++)
+  {
     s += i;
     s += ' ';
   }
@@ -548,8 +641,9 @@ void setup() {
   {
     // Let's use IRAM heap to make a big ole' String
     HeapSelectIram ephemeral;
-    String s = "";
-    for (int i = 0; i < 100; i++) {
+    String         s = "";
+    for (int i = 0; i < 100; i++)
+    {
       s += i;
       s += ' ';
     }
@@ -572,7 +666,7 @@ void setup() {
   free(imem);
   free(mem);
   imem = NULL;
-  mem = NULL;
+  mem  = NULL;
 
   Serial.printf("DRAM free: %6d\r\n", ESP.getFreeHeap());
 #ifdef USE_SET_IRAM_HEAP
@@ -588,15 +682,16 @@ void setup() {
   {
     ETS_PRINTF("Try and allocate all of the heap in one chunk\n");
     HeapSelectIram ephemeral;
-    size_t free_iram = ESP.getFreeHeap();
+    size_t         free_iram = ESP.getFreeHeap();
     ETS_PRINTF("IRAM free: %6d\n", free_iram);
     uint32_t hfree;
     uint32_t hmax;
-    uint8_t hfrag;
+    uint8_t  hfrag;
     ESP.getHeapStats(&hfree, &hmax, &hfrag);
     ETS_PRINTF("ESP.getHeapStats(free: %u, max: %u, frag: %u)\n",
-        hfree, hmax, hfrag);
-    if (free_iram > UMM_OVERHEAD_ADJUST) {
+               hfree, hmax, hfrag);
+    if (free_iram > UMM_OVERHEAD_ADJUST)
+    {
       void* all = malloc(free_iram - UMM_OVERHEAD_ADJUST);
       ETS_PRINTF("%p = malloc(%u)\n", all, free_iram);
       umm_info(NULL, true);
@@ -610,19 +705,24 @@ void setup() {
   }
 }
 
-void processKey(Print& out, int hotKey) {
-  switch (hotKey) {
-    case 'd': {
+void processKey(Print& out, int hotKey)
+{
+  switch (hotKey)
+  {
+    case 'd':
+    {
       HeapSelectDram ephemeral;
       umm_info(NULL, true);
       break;
     }
-    case 'i': {
+    case 'i':
+    {
       HeapSelectIram ephemeral;
       umm_info(NULL, true);
       break;
     }
-    case 'h': {
+    case 'h':
+    {
       {
         HeapSelectIram ephemeral;
         Serial.printf(PSTR("IRAM ESP.getFreeHeap:  %u\n"), ESP.getFreeHeap());
@@ -659,8 +759,10 @@ void processKey(Print& out, int hotKey) {
   }
 }
 
-void loop(void) {
-  if (Serial.available() > 0) {
+void loop(void)
+{
+  if (Serial.available() > 0)
+  {
     int hotKey = Serial.read();
     processKey(Serial, hotKey);
   }
diff --git a/libraries/esp8266/examples/virtualmem/virtualmem.ino b/libraries/esp8266/examples/virtualmem/virtualmem.ino
index 3a2fc65fe1..e077b3bdaf 100644
--- a/libraries/esp8266/examples/virtualmem/virtualmem.ino
+++ b/libraries/esp8266/examples/virtualmem/virtualmem.ino
@@ -1,65 +1,78 @@
 
-uint32_t cyclesToRead1Kx32(unsigned int* x, uint32_t* res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead1Kx32(unsigned int* x, uint32_t* res)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < 1024; i++) {
+  for (int i = 0; i < 1024; i++)
+  {
     sum += *(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx32(unsigned int* x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite1Kx32(unsigned int* x)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < 1024; i++) {
+  for (int i = 0; i < 1024; i++)
+  {
     sum += i;
     *(x++) = sum;
   }
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead1Kx16(unsigned short* x, uint32_t* res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead1Kx16(unsigned short* x, uint32_t* res)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < 1024; i++) {
+  for (int i = 0; i < 1024; i++)
+  {
     sum += *(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx16(unsigned short* x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite1Kx16(unsigned short* x)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < 1024; i++) {
+  for (int i = 0; i < 1024; i++)
+  {
     sum += i;
     *(x++) = sum;
   }
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead1Kx8(unsigned char* x, uint32_t* res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead1Kx8(unsigned char* x, uint32_t* res)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < 1024; i++) {
+  for (int i = 0; i < 1024; i++)
+  {
     sum += *(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx8(unsigned char* x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite1Kx8(unsigned char* x)
+{
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < 1024; i++) {
+  for (int i = 0; i < 1024; i++)
+  {
     sum += i;
     *(x++) = sum;
   }
   return ESP.getCycleCount() - b;
 }
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   Serial.printf("\n");
 
@@ -110,7 +123,8 @@ void setup() {
   // Let's use external heap to make a big ole' String
   ESP.setExternalHeap();
   String s = "";
-  for (int i = 0; i < 100; i++) {
+  for (int i = 0; i < 100; i++)
+  {
     s += i;
     s += ' ';
   }
@@ -132,5 +146,6 @@ void setup() {
   ESP.resetHeap();
 }
 
-void loop() {
+void loop()
+{
 }
diff --git a/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino b/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
index c9139e6852..ca497e3394 100644
--- a/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
+++ b/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
@@ -34,26 +34,29 @@
 #define NAPT 200
 #define NAPT_PORT 3
 
-#define RX 13 // d1mini D7
-#define TX 15 // d1mini D8
+#define RX 13  // d1mini D7
+#define TX 15  // d1mini D8
 
-SoftwareSerial ppplink(RX, TX);
+SoftwareSerial  ppplink(RX, TX);
 HardwareSerial& logger = Serial;
-PPPServer ppp(&ppplink);
+PPPServer       ppp(&ppplink);
 
-void PPPConnectedCallback(netif* nif) {
+void            PPPConnectedCallback(netif* nif)
+{
   logger.printf("ppp: ip=%s/mask=%s/gw=%s\n",
-      IPAddress(&nif->ip_addr).toString().c_str(),
-      IPAddress(&nif->netmask).toString().c_str(),
-      IPAddress(&nif->gw).toString().c_str());
+                IPAddress(&nif->ip_addr).toString().c_str(),
+                IPAddress(&nif->netmask).toString().c_str(),
+                IPAddress(&nif->gw).toString().c_str());
 
   logger.printf("Heap before: %d\n", ESP.getFreeHeap());
   err_t ret = ip_napt_init(NAPT, NAPT_PORT);
   logger.printf("ip_napt_init(%d,%d): ret=%d (OK=%d)\n", NAPT, NAPT_PORT, (int)ret, (int)ERR_OK);
-  if (ret == ERR_OK) {
+  if (ret == ERR_OK)
+  {
     ret = ip_napt_enable_no(nif->num, 1);
     logger.printf("ip_napt_enable(nif): ret=%d (OK=%d)\n", (int)ret, (int)ERR_OK);
-    if (ret == ERR_OK) {
+    if (ret == ERR_OK)
+    {
       logger.printf("PPP client is NATed\n");
     }
 
@@ -64,25 +67,28 @@ void PPPConnectedCallback(netif* nif) {
     logger.printf("redirect443=%d\n", ip_portmap_add(IP_PROTO_TCP, ip_2_ip4(&nif->ip_addr)->addr, 443, ip_2_ip4(&nif->gw)->addr, 443));
   }
   logger.printf("Heap after napt init: %d\n", ESP.getFreeHeap());
-  if (ret != ERR_OK) {
+  if (ret != ERR_OK)
+  {
     logger.printf("NAPT initialization failed\n");
   }
 }
 
-void setup() {
+void setup()
+{
   logger.begin(LOGGERBAUD);
 
   WiFi.persistent(false);
   WiFi.mode(WIFI_STA);
   WiFi.begin(STASSID, STAPSK);
-  while (WiFi.status() != WL_CONNECTED) {
+  while (WiFi.status() != WL_CONNECTED)
+  {
     logger.print('.');
     delay(500);
   }
   logger.printf("\nSTA: %s (dns: %s / %s)\n",
-      WiFi.localIP().toString().c_str(),
-      WiFi.dnsIP(0).toString().c_str(),
-      WiFi.dnsIP(1).toString().c_str());
+                WiFi.localIP().toString().c_str(),
+                WiFi.dnsIP(0).toString().c_str(),
+                WiFi.dnsIP(1).toString().c_str());
 
   ppplink.begin(PPPLINKBAUD);
   ppplink.enableIntTx(true);
@@ -99,12 +105,14 @@ void setup() {
 
 #else
 
-void setup() {
+void setup()
+{
   Serial.begin(115200);
   Serial.printf("\n\nPPP/NAPT not supported in this configuration\n");
 }
 
 #endif
 
-void loop() {
+void loop()
+{
 }
diff --git a/libraries/lwIP_PPP/src/PPPServer.cpp b/libraries/lwIP_PPP/src/PPPServer.cpp
index 1b8279a56b..31c406b830 100644
--- a/libraries/lwIP_PPP/src/PPPServer.cpp
+++ b/libraries/lwIP_PPP/src/PPPServer.cpp
@@ -16,10 +16,8 @@
 
 #include "PPPServer.h"
 
-PPPServer::PPPServer(Stream* sio)
-    : _sio(sio)
-    , _cb(netif_status_cb_s)
-    , _enabled(false)
+PPPServer::PPPServer(Stream* sio) :
+    _sio(sio), _cb(netif_status_cb_s), _enabled(false)
 {
 }
 
@@ -41,8 +39,8 @@ bool PPPServer::handlePackets()
 
 void PPPServer::link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx)
 {
-    bool stop = true;
-    netif* nif = ppp_netif(pcb);
+    bool   stop = true;
+    netif* nif  = ppp_netif(pcb);
 
     switch (err_code)
     {
@@ -143,7 +141,7 @@ u32_t PPPServer::output_cb_s(ppp_pcb* pcb, u8_t* data, u32_t len, void* ctx)
 void PPPServer::netif_status_cb_s(netif* nif)
 {
     ets_printf("PPPNETIF: %c%c%d is %s\n", nif->name[0], nif->name[1], nif->num,
-        netif_is_up(nif) ? "UP" : "DOWN");
+               netif_is_up(nif) ? "UP" : "DOWN");
 #if LWIP_IPV4
     ets_printf("IPV4: Host at %s ", ip4addr_ntoa(netif_ip4_addr(nif)));
     ets_printf("mask %s ", ip4addr_ntoa(netif_ip4_netmask(nif)));
@@ -181,8 +179,8 @@ bool PPPServer::begin(const IPAddress& ourAddress, const IPAddress& peer)
 
     _enabled = true;
     if (!schedule_recurrent_function_us([&]()
-            { return this->handlePackets(); },
-            1000))
+                                        { return this->handlePackets(); },
+                                        1000))
     {
         netif_remove(&_netif);
         return false;
diff --git a/libraries/lwIP_PPP/src/PPPServer.h b/libraries/lwIP_PPP/src/PPPServer.h
index 326aa16f69..12ef5fa750 100644
--- a/libraries/lwIP_PPP/src/PPPServer.h
+++ b/libraries/lwIP_PPP/src/PPPServer.h
@@ -55,19 +55,19 @@ class PPPServer
 
 protected:
     static constexpr size_t _bufsize = 128;
-    Stream* _sio;
-    ppp_pcb* _ppp;
-    netif _netif;
+    Stream*                 _sio;
+    ppp_pcb*                _ppp;
+    netif                   _netif;
     void (*_cb)(netif*);
-    uint8_t _buf[_bufsize];
-    bool _enabled;
+    uint8_t      _buf[_bufsize];
+    bool         _enabled;
 
     // feed ppp from stream - to call on a regular basis or on interrupt
-    bool handlePackets();
+    bool         handlePackets();
 
     static u32_t output_cb_s(ppp_pcb* pcb, u8_t* data, u32_t len, void* ctx);
-    static void link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx);
-    static void netif_status_cb_s(netif* nif);
+    static void  link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx);
+    static void  netif_status_cb_s(netif* nif);
 };
 
 #endif  // __PPPSERVER_H
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
index 8ba961b969..4677dc4e65 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
@@ -44,7 +44,7 @@
 
 void serial_printf(const char* fmt, ...)
 {
-    char buf[128];
+    char    buf[128];
     va_list args;
     va_start(args, fmt);
     vsnprintf(buf, 128, fmt, args);
@@ -148,10 +148,8 @@ void serial_printf(const char* fmt, ...)
 // The ENC28J60 SPI Interface supports clock speeds up to 20 MHz
 static const SPISettings spiSettings(20000000, MSBFIRST, SPI_MODE0);
 
-ENC28J60::ENC28J60(int8_t cs, SPIClass& spi, int8_t intr)
-    : _bank(ERXTX_BANK)
-    , _cs(cs)
-    , _spi(spi)
+ENC28J60::ENC28J60(int8_t cs, SPIClass& spi, int8_t intr) :
+    _bank(ERXTX_BANK), _cs(cs), _spi(spi)
 {
     (void)intr;
 }
@@ -526,9 +524,9 @@ bool ENC28J60::reset(void)
 boolean
 ENC28J60::begin(const uint8_t* address)
 {
-    _localMac = address;
+    _localMac   = address;
 
-    bool ret = reset();
+    bool    ret = reset();
     uint8_t rev = readrev();
 
     PRINTF("ENC28J60 rev. B%d\n", rev);
@@ -597,7 +595,7 @@ ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen)
     if ((readreg(ESTAT) & ESTAT_TXABRT) != 0)
     {
         uint16_t erdpt;
-        uint8_t tsv[7];
+        uint8_t  tsv[7];
         erdpt = (readreg(ERDPTH) << 8) | readreg(ERDPTL);
         writereg(ERDPTL, (dataend + 1) & 0xff);
         writereg(ERDPTH, (dataend + 1) >> 8);
@@ -606,16 +604,16 @@ ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen)
         writereg(ERDPTH, erdpt >> 8);
         PRINTF("enc28j60: tx err: %d: %02x:%02x:%02x:%02x:%02x:%02x\n"
                "                  tsv: %02x%02x%02x%02x%02x%02x%02x\n",
-            datalen,
-            0xff & data[0], 0xff & data[1], 0xff & data[2],
-            0xff & data[3], 0xff & data[4], 0xff & data[5],
-            tsv[6], tsv[5], tsv[4], tsv[3], tsv[2], tsv[1], tsv[0]);
+               datalen,
+               0xff & data[0], 0xff & data[1], 0xff & data[2],
+               0xff & data[3], 0xff & data[4], 0xff & data[5],
+               tsv[6], tsv[5], tsv[4], tsv[3], tsv[2], tsv[1], tsv[0]);
     }
     else
     {
         PRINTF("enc28j60: tx: %d: %02x:%02x:%02x:%02x:%02x:%02x\n", datalen,
-            0xff & data[0], 0xff & data[1], 0xff & data[2],
-            0xff & data[3], 0xff & data[4], 0xff & data[5]);
+               0xff & data[0], 0xff & data[1], 0xff & data[2],
+               0xff & data[3], 0xff & data[4], 0xff & data[5]);
     }
 #endif
 
@@ -656,13 +654,13 @@ ENC28J60::readFrameSize()
     /* Read the next packet pointer */
     nxtpkt[0] = readdatabyte();
     nxtpkt[1] = readdatabyte();
-    _next = (nxtpkt[1] << 8) + nxtpkt[0];
+    _next     = (nxtpkt[1] << 8) + nxtpkt[0];
 
     PRINTF("enc28j60: nxtpkt 0x%02x%02x\n", _nxtpkt[1], _nxtpkt[0]);
 
     length[0] = readdatabyte();
     length[1] = readdatabyte();
-    _len = (length[1] << 8) + length[0];
+    _len      = (length[1] << 8) + length[0];
 
     PRINTF("enc28j60: length 0x%02x%02x\n", length[1], length[0]);
 
@@ -726,8 +724,8 @@ ENC28J60::readFrameData(uint8_t* buffer, uint16_t framesize)
         return 0;
     }
     PRINTF("enc28j60: rx: %d: %02x:%02x:%02x:%02x:%02x:%02x\n", _len,
-        0xff & buffer[0], 0xff & buffer[1], 0xff & buffer[2],
-        0xff & buffer[3], 0xff & buffer[4], 0xff & buffer[5]);
+           0xff & buffer[0], 0xff & buffer[1], 0xff & buffer[2],
+           0xff & buffer[3], 0xff & buffer[4], 0xff & buffer[5]);
 
     //received_packets++;
     //PRINTF("enc28j60: received_packets %d\n", received_packets);
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.h b/libraries/lwIP_enc28j60/src/utility/enc28j60.h
index fe5ef49576..b106a55845 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.h
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.h
@@ -60,7 +60,7 @@ class ENC28J60
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean begin(const uint8_t* address);
+    boolean          begin(const uint8_t* address);
 
     /**
         Send an Ethernet frame
@@ -96,7 +96,7 @@ class ENC28J60
         discard an Ethernet frame
         @param framesize readFrameSize()'s result
     */
-    void discardFrame(uint16_t framesize);
+    void     discardFrame(uint16_t framesize);
 
     /**
         Read an Ethernet frame data
@@ -110,37 +110,37 @@ class ENC28J60
     uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
 
 private:
-    uint8_t is_mac_mii_reg(uint8_t reg);
-    uint8_t readreg(uint8_t reg);
-    void writereg(uint8_t reg, uint8_t data);
-    void setregbitfield(uint8_t reg, uint8_t mask);
-    void clearregbitfield(uint8_t reg, uint8_t mask);
-    void setregbank(uint8_t new_bank);
-    void writedata(const uint8_t* data, int datalen);
-    void writedatabyte(uint8_t byte);
-    int readdata(uint8_t* buf, int len);
-    uint8_t readdatabyte(void);
-    void softreset(void);
-    uint8_t readrev(void);
-    bool reset(void);
-
-    void enc28j60_arch_spi_init(void);
-    uint8_t enc28j60_arch_spi_write(uint8_t data);
-    uint8_t enc28j60_arch_spi_read(void);
-    void enc28j60_arch_spi_select(void);
-    void enc28j60_arch_spi_deselect(void);
+    uint8_t        is_mac_mii_reg(uint8_t reg);
+    uint8_t        readreg(uint8_t reg);
+    void           writereg(uint8_t reg, uint8_t data);
+    void           setregbitfield(uint8_t reg, uint8_t mask);
+    void           clearregbitfield(uint8_t reg, uint8_t mask);
+    void           setregbank(uint8_t new_bank);
+    void           writedata(const uint8_t* data, int datalen);
+    void           writedatabyte(uint8_t byte);
+    int            readdata(uint8_t* buf, int len);
+    uint8_t        readdatabyte(void);
+    void           softreset(void);
+    uint8_t        readrev(void);
+    bool           reset(void);
+
+    void           enc28j60_arch_spi_init(void);
+    uint8_t        enc28j60_arch_spi_write(uint8_t data);
+    uint8_t        enc28j60_arch_spi_read(void);
+    void           enc28j60_arch_spi_select(void);
+    void           enc28j60_arch_spi_deselect(void);
 
     // Previously defined in contiki/core/sys/clock.h
-    void clock_delay_usec(uint16_t dt);
+    void           clock_delay_usec(uint16_t dt);
 
-    uint8_t _bank;
-    int8_t _cs;
-    SPIClass& _spi;
+    uint8_t        _bank;
+    int8_t         _cs;
+    SPIClass&      _spi;
 
     const uint8_t* _localMac;
 
     /* readFrame*() state */
-    uint16_t _next, _len;
+    uint16_t       _next, _len;
 };
 
 #endif /* ENC28J60_H */
diff --git a/libraries/lwIP_w5100/src/utility/w5100.cpp b/libraries/lwIP_w5100/src/utility/w5100.cpp
index aae85a154b..8dcf0a446b 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.cpp
+++ b/libraries/lwIP_w5100/src/utility/w5100.cpp
@@ -131,17 +131,17 @@ void Wiznet5100::wizchip_send_data(const uint8_t* wizdata, uint16_t len)
     uint16_t dst_mask;
     uint16_t dst_ptr;
 
-    ptr = getSn_TX_WR();
+    ptr      = getSn_TX_WR();
 
     dst_mask = ptr & TxBufferMask;
-    dst_ptr = TxBufferAddress + dst_mask;
+    dst_ptr  = TxBufferAddress + dst_mask;
 
     if (dst_mask + len > TxBufferLength)
     {
         size = TxBufferLength - dst_mask;
         wizchip_write_buf(dst_ptr, wizdata, size);
         wizdata += size;
-        size = len - size;
+        size    = len - size;
         dst_ptr = TxBufferAddress;
         wizchip_write_buf(dst_ptr, wizdata, size);
     }
@@ -162,17 +162,17 @@ void Wiznet5100::wizchip_recv_data(uint8_t* wizdata, uint16_t len)
     uint16_t src_mask;
     uint16_t src_ptr;
 
-    ptr = getSn_RX_RD();
+    ptr      = getSn_RX_RD();
 
     src_mask = ptr & RxBufferMask;
-    src_ptr = RxBufferAddress + src_mask;
+    src_ptr  = RxBufferAddress + src_mask;
 
     if ((src_mask + len) > RxBufferLength)
     {
         size = RxBufferLength - src_mask;
         wizchip_read_buf(src_ptr, wizdata, size);
         wizdata += size;
-        size = len - size;
+        size    = len - size;
         src_ptr = RxBufferAddress;
         wizchip_read_buf(src_ptr, wizdata, size);
     }
@@ -203,9 +203,8 @@ void Wiznet5100::wizchip_sw_reset()
     setSHAR(_mac_address);
 }
 
-Wiznet5100::Wiznet5100(int8_t cs, SPIClass& spi, int8_t intr)
-    : _spi(spi)
-    , _cs(cs)
+Wiznet5100::Wiznet5100(int8_t cs, SPIClass& spi, int8_t intr) :
+    _spi(spi), _cs(cs)
 {
     (void)intr;
 }
@@ -286,7 +285,7 @@ uint16_t Wiznet5100::readFrameSize()
         return 0;
     }
 
-    uint8_t head[2];
+    uint8_t  head[2];
     uint16_t data_len = 0;
 
     wizchip_recv_data(head, 2);
diff --git a/libraries/lwIP_w5100/src/utility/w5100.h b/libraries/lwIP_w5100/src/utility/w5100.h
index 12c09085ef..6182a26541 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.h
+++ b/libraries/lwIP_w5100/src/utility/w5100.h
@@ -55,12 +55,12 @@ class Wiznet5100
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean begin(const uint8_t* address);
+    boolean  begin(const uint8_t* address);
 
     /**
         Shut down the Ethernet controlled
     */
-    void end();
+    void     end();
 
     /**
         Send an Ethernet frame
@@ -96,7 +96,7 @@ class Wiznet5100
         discard an Ethernet frame
         @param framesize readFrameSize()'s result
     */
-    void discardFrame(uint16_t framesize);
+    void     discardFrame(uint16_t framesize);
 
     /**
         Read an Ethernet frame data
@@ -110,25 +110,25 @@ class Wiznet5100
     uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
 
 private:
-    static const uint16_t TxBufferAddress = 0x4000;                   /* Internal Tx buffer address of the iinchip */
-    static const uint16_t RxBufferAddress = 0x6000;                   /* Internal Rx buffer address of the iinchip */
-    static const uint8_t TxBufferSize = 0x3;                          /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
-    static const uint8_t RxBufferSize = 0x3;                          /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
-    static const uint16_t TxBufferLength = (1 << TxBufferSize) << 10; /* Length of Tx buffer in bytes */
-    static const uint16_t RxBufferLength = (1 << RxBufferSize) << 10; /* Length of Rx buffer in bytes */
-    static const uint16_t TxBufferMask = TxBufferLength - 1;
-    static const uint16_t RxBufferMask = RxBufferLength - 1;
+    static const uint16_t TxBufferAddress = 0x4000;                    /* Internal Tx buffer address of the iinchip */
+    static const uint16_t RxBufferAddress = 0x6000;                    /* Internal Rx buffer address of the iinchip */
+    static const uint8_t  TxBufferSize    = 0x3;                       /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
+    static const uint8_t  RxBufferSize    = 0x3;                       /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
+    static const uint16_t TxBufferLength  = (1 << TxBufferSize) << 10; /* Length of Tx buffer in bytes */
+    static const uint16_t RxBufferLength  = (1 << RxBufferSize) << 10; /* Length of Rx buffer in bytes */
+    static const uint16_t TxBufferMask    = TxBufferLength - 1;
+    static const uint16_t RxBufferMask    = RxBufferLength - 1;
 
-    SPIClass& _spi;
-    int8_t _cs;
-    uint8_t _mac_address[6];
+    SPIClass&             _spi;
+    int8_t                _cs;
+    uint8_t               _mac_address[6];
 
     /**
         Default function to select chip.
         @note This function help not to access wrong address. If you do not describe this function or register any functions,
         null function is called.
     */
-    inline void wizchip_cs_select()
+    inline void           wizchip_cs_select()
     {
         digitalWrite(_cs, LOW);
     }
@@ -148,7 +148,7 @@ class Wiznet5100
         @param address Register address
         @return The value of register
     */
-    uint8_t wizchip_read(uint16_t address);
+    uint8_t  wizchip_read(uint16_t address);
 
     /**
         Reads a 2 byte value from a register.
@@ -163,7 +163,7 @@ class Wiznet5100
         @param pBuf Pointer buffer to read data
         @param len Data length
     */
-    void wizchip_read_buf(uint16_t address, uint8_t* pBuf, uint16_t len);
+    void     wizchip_read_buf(uint16_t address, uint8_t* pBuf, uint16_t len);
 
     /**
         Write a 1 byte value to a register.
@@ -171,7 +171,7 @@ class Wiznet5100
         @param wb Write data
         @return void
     */
-    void wizchip_write(uint16_t address, uint8_t wb);
+    void     wizchip_write(uint16_t address, uint8_t wb);
 
     /**
         Write a 2 byte value to a register.
@@ -179,7 +179,7 @@ class Wiznet5100
         @param wb Write data
         @return void
     */
-    void wizchip_write_word(uint16_t address, uint16_t word);
+    void     wizchip_write_word(uint16_t address, uint16_t word);
 
     /**
         It writes sequence data to registers.
@@ -187,12 +187,12 @@ class Wiznet5100
         @param pBuf Pointer buffer to write data
         @param len Data length
     */
-    void wizchip_write_buf(uint16_t address, const uint8_t* pBuf, uint16_t len);
+    void     wizchip_write_buf(uint16_t address, const uint8_t* pBuf, uint16_t len);
 
     /**
         Reset WIZCHIP by softly.
     */
-    void wizchip_sw_reset(void);
+    void     wizchip_sw_reset(void);
 
     /**
         It copies data to internal TX memory
@@ -206,7 +206,7 @@ class Wiznet5100
         @param len Data length
         @sa wizchip_recv_data()
     */
-    void wizchip_send_data(const uint8_t* wizdata, uint16_t len);
+    void     wizchip_send_data(const uint8_t* wizdata, uint16_t len);
 
     /**
         It copies data to your buffer from internal RX memory
@@ -220,14 +220,14 @@ class Wiznet5100
         @param len Data length
         @sa wizchip_send_data()
     */
-    void wizchip_recv_data(uint8_t* wizdata, uint16_t len);
+    void     wizchip_recv_data(uint8_t* wizdata, uint16_t len);
 
     /**
         It discard the received data in RX memory.
         @details It discards the data of the length of <i>len(variable)</i> bytes in internal RX memory.
         @param len Data length
     */
-    void wizchip_recv_ignore(uint16_t len);
+    void     wizchip_recv_ignore(uint16_t len);
 
     /**
         Get @ref Sn_TX_FSR register
@@ -244,15 +244,15 @@ class Wiznet5100
     /** Common registers */
     enum
     {
-        MR = 0x0000,    ///< Mode Register address (R/W)
-        GAR = 0x0001,   ///< Gateway IP Register address (R/W)
+        MR   = 0x0000,  ///< Mode Register address (R/W)
+        GAR  = 0x0001,  ///< Gateway IP Register address (R/W)
         SUBR = 0x0005,  ///< Subnet mask Register address (R/W)
         SHAR = 0x0009,  ///< Source MAC Register address (R/W)
         SIPR = 0x000F,  ///< Source IP Register address (R/W)
-        IR = 0x0015,    ///< Interrupt Register (R/W)
-        IMR = 0x0016,   ///< Socket Interrupt Mask Register (R/W)
-        RTR = 0x0017,   ///< Timeout register address (1 is 100us) (R/W)
-        RCR = 0x0019,   ///< Retry count register (R/W)
+        IR   = 0x0015,  ///< Interrupt Register (R/W)
+        IMR  = 0x0016,  ///< Socket Interrupt Mask Register (R/W)
+        RTR  = 0x0017,  ///< Timeout register address (1 is 100us) (R/W)
+        RCR  = 0x0019,  ///< Retry count register (R/W)
         RMSR = 0x001A,  ///< Receive Memory Size
         TMSR = 0x001B,  ///< Transmit Memory Size
     };
@@ -260,86 +260,86 @@ class Wiznet5100
     /** Socket registers */
     enum
     {
-        Sn_MR = 0x0400,      ///< Socket Mode register(R/W)
-        Sn_CR = 0x0401,      ///< Socket command register (R/W)
-        Sn_IR = 0x0402,      ///< Socket interrupt register (R)
-        Sn_SR = 0x0403,      ///< Socket status register (R)
-        Sn_PORT = 0x0404,    ///< Source port register (R/W)
-        Sn_DHAR = 0x0406,    ///< Peer MAC register address (R/W)
-        Sn_DIPR = 0x040C,    ///< Peer IP register address (R/W)
-        Sn_DPORT = 0x0410,   ///< Peer port register address (R/W)
-        Sn_MSSR = 0x0412,    ///< Maximum Segment Size(Sn_MSSR0) register address (R/W)
-        Sn_PROTO = 0x0414,   ///< IP Protocol(PROTO) Register (R/W)
-        Sn_TOS = 0x0415,     ///< IP Type of Service(TOS) Register (R/W)
-        Sn_TTL = 0x0416,     ///< IP Time to live(TTL) Register (R/W)
+        Sn_MR     = 0x0400,  ///< Socket Mode register(R/W)
+        Sn_CR     = 0x0401,  ///< Socket command register (R/W)
+        Sn_IR     = 0x0402,  ///< Socket interrupt register (R)
+        Sn_SR     = 0x0403,  ///< Socket status register (R)
+        Sn_PORT   = 0x0404,  ///< Source port register (R/W)
+        Sn_DHAR   = 0x0406,  ///< Peer MAC register address (R/W)
+        Sn_DIPR   = 0x040C,  ///< Peer IP register address (R/W)
+        Sn_DPORT  = 0x0410,  ///< Peer port register address (R/W)
+        Sn_MSSR   = 0x0412,  ///< Maximum Segment Size(Sn_MSSR0) register address (R/W)
+        Sn_PROTO  = 0x0414,  ///< IP Protocol(PROTO) Register (R/W)
+        Sn_TOS    = 0x0415,  ///< IP Type of Service(TOS) Register (R/W)
+        Sn_TTL    = 0x0416,  ///< IP Time to live(TTL) Register (R/W)
         Sn_TX_FSR = 0x0420,  ///< Transmit free memory size register (R)
-        Sn_TX_RD = 0x0422,   ///< Transmit memory read pointer register address (R)
-        Sn_TX_WR = 0x0424,   ///< Transmit memory write pointer register address (R/W)
+        Sn_TX_RD  = 0x0422,  ///< Transmit memory read pointer register address (R)
+        Sn_TX_WR  = 0x0424,  ///< Transmit memory write pointer register address (R/W)
         Sn_RX_RSR = 0x0426,  ///< Received data size register (R)
-        Sn_RX_RD = 0x0428,   ///< Read point of Receive memory (R/W)
-        Sn_RX_WR = 0x042A,   ///< Write point of Receive memory (R)
+        Sn_RX_RD  = 0x0428,  ///< Read point of Receive memory (R/W)
+        Sn_RX_WR  = 0x042A,  ///< Write point of Receive memory (R)
     };
 
     /** Mode register values */
     enum
     {
         MR_RST = 0x80,  ///< Reset
-        MR_PB = 0x10,   ///< Ping block
-        MR_AI = 0x02,   ///< Address Auto-Increment in Indirect Bus Interface
+        MR_PB  = 0x10,  ///< Ping block
+        MR_AI  = 0x02,  ///< Address Auto-Increment in Indirect Bus Interface
         MR_IND = 0x01,  ///< Indirect Bus Interface mode
     };
 
     /** Socket Mode Register values @ref Sn_MR */
     enum
     {
-        Sn_MR_CLOSE = 0x00,   ///< Unused socket
-        Sn_MR_TCP = 0x01,     ///< TCP
-        Sn_MR_UDP = 0x02,     ///< UDP
-        Sn_MR_IPRAW = 0x03,   ///< IP LAYER RAW SOCK
+        Sn_MR_CLOSE  = 0x00,  ///< Unused socket
+        Sn_MR_TCP    = 0x01,  ///< TCP
+        Sn_MR_UDP    = 0x02,  ///< UDP
+        Sn_MR_IPRAW  = 0x03,  ///< IP LAYER RAW SOCK
         Sn_MR_MACRAW = 0x04,  ///< MAC LAYER RAW SOCK
-        Sn_MR_ND = 0x20,      ///< No Delayed Ack(TCP) flag
-        Sn_MR_MF = 0x40,      ///< Use MAC filter
-        Sn_MR_MULTI = 0x80,   ///< support multicating
+        Sn_MR_ND     = 0x20,  ///< No Delayed Ack(TCP) flag
+        Sn_MR_MF     = 0x40,  ///< Use MAC filter
+        Sn_MR_MULTI  = 0x80,  ///< support multicating
     };
 
     /** Socket Command Register values */
     enum
     {
-        Sn_CR_OPEN = 0x01,       ///< Initialise or open socket
-        Sn_CR_CLOSE = 0x10,      ///< Close socket
-        Sn_CR_SEND = 0x20,       ///< Update TX buffer pointer and send data
-        Sn_CR_SEND_MAC = 0x21,   ///< Send data with MAC address, so without ARP process
+        Sn_CR_OPEN      = 0x01,  ///< Initialise or open socket
+        Sn_CR_CLOSE     = 0x10,  ///< Close socket
+        Sn_CR_SEND      = 0x20,  ///< Update TX buffer pointer and send data
+        Sn_CR_SEND_MAC  = 0x21,  ///< Send data with MAC address, so without ARP process
         Sn_CR_SEND_KEEP = 0x22,  ///< Send keep alive message
-        Sn_CR_RECV = 0x40,       ///< Update RX buffer pointer and receive data
+        Sn_CR_RECV      = 0x40,  ///< Update RX buffer pointer and receive data
     };
 
     /** Socket Interrupt register values */
     enum
     {
-        Sn_IR_CON = 0x01,      ///< CON Interrupt
-        Sn_IR_DISCON = 0x02,   ///< DISCON Interrupt
-        Sn_IR_RECV = 0x04,     ///< RECV Interrupt
+        Sn_IR_CON     = 0x01,  ///< CON Interrupt
+        Sn_IR_DISCON  = 0x02,  ///< DISCON Interrupt
+        Sn_IR_RECV    = 0x04,  ///< RECV Interrupt
         Sn_IR_TIMEOUT = 0x08,  ///< TIMEOUT Interrupt
-        Sn_IR_SENDOK = 0x10,   ///< SEND_OK Interrupt
+        Sn_IR_SENDOK  = 0x10,  ///< SEND_OK Interrupt
     };
 
     /** Socket Status Register values */
     enum
     {
-        SOCK_CLOSED = 0x00,       ///< Closed
-        SOCK_INIT = 0x13,         ///< Initiate state
-        SOCK_LISTEN = 0x14,       ///< Listen state
-        SOCK_SYNSENT = 0x15,      ///< Connection state
-        SOCK_SYNRECV = 0x16,      ///< Connection state
+        SOCK_CLOSED      = 0x00,  ///< Closed
+        SOCK_INIT        = 0x13,  ///< Initiate state
+        SOCK_LISTEN      = 0x14,  ///< Listen state
+        SOCK_SYNSENT     = 0x15,  ///< Connection state
+        SOCK_SYNRECV     = 0x16,  ///< Connection state
         SOCK_ESTABLISHED = 0x17,  ///< Success to connect
-        SOCK_FIN_WAIT = 0x18,     ///< Closing state
-        SOCK_CLOSING = 0x1A,      ///< Closing state
-        SOCK_TIME_WAIT = 0x1B,    ///< Closing state
-        SOCK_CLOSE_WAIT = 0x1C,   ///< Closing state
-        SOCK_LAST_ACK = 0x1D,     ///< Closing state
-        SOCK_UDP = 0x22,          ///< UDP socket
-        SOCK_IPRAW = 0x32,        ///< IP raw mode socket
-        SOCK_MACRAW = 0x42,       ///< MAC raw mode socket
+        SOCK_FIN_WAIT    = 0x18,  ///< Closing state
+        SOCK_CLOSING     = 0x1A,  ///< Closing state
+        SOCK_TIME_WAIT   = 0x1B,  ///< Closing state
+        SOCK_CLOSE_WAIT  = 0x1C,  ///< Closing state
+        SOCK_LAST_ACK    = 0x1D,  ///< Closing state
+        SOCK_UDP         = 0x22,  ///< UDP socket
+        SOCK_IPRAW       = 0x32,  ///< IP raw mode socket
+        SOCK_MACRAW      = 0x42,  ///< MAC raw mode socket
     };
 
     /**
@@ -447,7 +447,7 @@ class Wiznet5100
         @param (uint8_t)cr Value to set @ref Sn_CR
         @sa getSn_CR()
     */
-    void setSn_CR(uint8_t cr);
+    void           setSn_CR(uint8_t cr);
 
     /**
         Get @ref Sn_CR register
diff --git a/libraries/lwIP_w5500/src/utility/w5500.cpp b/libraries/lwIP_w5500/src/utility/w5500.cpp
index 723e85ac19..cc4a1e245d 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.cpp
+++ b/libraries/lwIP_w5500/src/utility/w5500.cpp
@@ -243,7 +243,7 @@ void Wiznet5500::wizphy_reset()
 int8_t Wiznet5500::wizphy_setphypmode(uint8_t pmode)
 {
     uint8_t tmp = 0;
-    tmp = getPHYCFGR();
+    tmp         = getPHYCFGR();
     if ((tmp & PHYCFGR_OPMD) == 0)
     {
         return -1;
@@ -277,9 +277,8 @@ int8_t Wiznet5500::wizphy_setphypmode(uint8_t pmode)
     return -1;
 }
 
-Wiznet5500::Wiznet5500(int8_t cs, SPIClass& spi, int8_t intr)
-    : _spi(spi)
-    , _cs(cs)
+Wiznet5500::Wiznet5500(int8_t cs, SPIClass& spi, int8_t intr) :
+    _spi(spi), _cs(cs)
 {
     (void)intr;
 }
@@ -360,7 +359,7 @@ uint16_t Wiznet5500::readFrameSize()
         return 0;
     }
 
-    uint8_t head[2];
+    uint8_t  head[2];
     uint16_t data_len = 0;
 
     wizchip_recv_data(head, 2);
diff --git a/libraries/lwIP_w5500/src/utility/w5500.h b/libraries/lwIP_w5500/src/utility/w5500.h
index 232b0e7939..e067b59767 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.h
+++ b/libraries/lwIP_w5500/src/utility/w5500.h
@@ -55,12 +55,12 @@ class Wiznet5500
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean begin(const uint8_t* address);
+    boolean  begin(const uint8_t* address);
 
     /**
         Shut down the Ethernet controlled
     */
-    void end();
+    void     end();
 
     /**
         Send an Ethernet frame
@@ -96,7 +96,7 @@ class Wiznet5500
         discard an Ethernet frame
         @param framesize readFrameSize()'s result
     */
-    void discardFrame(uint16_t framesize);
+    void     discardFrame(uint16_t framesize);
 
     /**
         Read an Ethernet frame data
@@ -111,16 +111,16 @@ class Wiznet5500
 
 private:
     //< SPI interface Read operation in Control Phase
-    static const uint8_t AccessModeRead = (0x00 << 2);
+    static const uint8_t AccessModeRead   = (0x00 << 2);
 
     //< SPI interface Read operation in Control Phase
-    static const uint8_t AccessModeWrite = (0x01 << 2);
+    static const uint8_t AccessModeWrite  = (0x01 << 2);
 
     //< Common register block in Control Phase
-    static const uint8_t BlockSelectCReg = (0x00 << 3);
+    static const uint8_t BlockSelectCReg  = (0x00 << 3);
 
     //< Socket 0 register block in Control Phase
-    static const uint8_t BlockSelectSReg = (0x01 << 3);
+    static const uint8_t BlockSelectSReg  = (0x01 << 3);
 
     //< Socket 0 Tx buffer address block
     static const uint8_t BlockSelectTxBuf = (0x02 << 3);
@@ -128,16 +128,16 @@ class Wiznet5500
     //< Socket 0 Rx buffer address block
     static const uint8_t BlockSelectRxBuf = (0x03 << 3);
 
-    SPIClass& _spi;
-    int8_t _cs;
-    uint8_t _mac_address[6];
+    SPIClass&            _spi;
+    int8_t               _cs;
+    uint8_t              _mac_address[6];
 
     /**
         Default function to select chip.
         @note This function help not to access wrong address. If you do not describe this function or register any functions,
         null function is called.
     */
-    inline void wizchip_cs_select()
+    inline void          wizchip_cs_select()
     {
         digitalWrite(_cs, LOW);
     }
@@ -177,7 +177,7 @@ class Wiznet5500
         @param address Register address
         @return The value of register
     */
-    uint8_t wizchip_read(uint8_t block, uint16_t address);
+    uint8_t  wizchip_read(uint8_t block, uint16_t address);
 
     /**
         Reads a 2 byte value from a register.
@@ -192,7 +192,7 @@ class Wiznet5500
         @param pBuf Pointer buffer to read data
         @param len Data length
     */
-    void wizchip_read_buf(uint8_t block, uint16_t address, uint8_t* pBuf, uint16_t len);
+    void     wizchip_read_buf(uint8_t block, uint16_t address, uint8_t* pBuf, uint16_t len);
 
     /**
         Write a 1 byte value to a register.
@@ -200,7 +200,7 @@ class Wiznet5500
         @param wb Write data
         @return void
     */
-    void wizchip_write(uint8_t block, uint16_t address, uint8_t wb);
+    void     wizchip_write(uint8_t block, uint16_t address, uint8_t wb);
 
     /**
         Write a 2 byte value to a register.
@@ -208,7 +208,7 @@ class Wiznet5500
         @param wb Write data
         @return void
     */
-    void wizchip_write_word(uint8_t block, uint16_t address, uint16_t word);
+    void     wizchip_write_word(uint8_t block, uint16_t address, uint16_t word);
 
     /**
         It writes sequence data to registers.
@@ -216,7 +216,7 @@ class Wiznet5500
         @param pBuf Pointer buffer to write data
         @param len Data length
     */
-    void wizchip_write_buf(uint8_t block, uint16_t address, const uint8_t* pBuf, uint16_t len);
+    void     wizchip_write_buf(uint8_t block, uint16_t address, const uint8_t* pBuf, uint16_t len);
 
     /**
         Get @ref Sn_TX_FSR register
@@ -233,28 +233,28 @@ class Wiznet5500
     /**
         Reset WIZCHIP by softly.
     */
-    void wizchip_sw_reset();
+    void     wizchip_sw_reset();
 
     /**
         Get the link status of phy in WIZCHIP
     */
-    int8_t wizphy_getphylink();
+    int8_t   wizphy_getphylink();
 
     /**
         Get the power mode of PHY in WIZCHIP
     */
-    int8_t wizphy_getphypmode();
+    int8_t   wizphy_getphypmode();
 
     /**
         Reset Phy
     */
-    void wizphy_reset();
+    void     wizphy_reset();
 
     /**
         set the power mode of phy inside WIZCHIP. Refer to @ref PHYCFGR in W5500, @ref PHYSTATUS in W5200
         @param pmode Settig value of power down mode.
     */
-    int8_t wizphy_setphypmode(uint8_t pmode);
+    int8_t   wizphy_setphypmode(uint8_t pmode);
 
     /**
         It copies data to internal TX memory
@@ -268,7 +268,7 @@ class Wiznet5500
         @param len Data length
         @sa wizchip_recv_data()
     */
-    void wizchip_send_data(const uint8_t* wizdata, uint16_t len);
+    void     wizchip_send_data(const uint8_t* wizdata, uint16_t len);
 
     /**
         It copies data to your buffer from internal RX memory
@@ -282,77 +282,77 @@ class Wiznet5500
         @param len Data length
         @sa wizchip_send_data()
     */
-    void wizchip_recv_data(uint8_t* wizdata, uint16_t len);
+    void     wizchip_recv_data(uint8_t* wizdata, uint16_t len);
 
     /**
         It discard the received data in RX memory.
         @details It discards the data of the length of <i>len(variable)</i> bytes in internal RX memory.
         @param len Data length
     */
-    void wizchip_recv_ignore(uint16_t len);
+    void     wizchip_recv_ignore(uint16_t len);
 
     /** Common registers */
     enum
     {
-        MR = 0x0000,        ///< Mode Register address (R/W)
-        SHAR = 0x0009,      ///< Source MAC Register address (R/W)
+        MR       = 0x0000,  ///< Mode Register address (R/W)
+        SHAR     = 0x0009,  ///< Source MAC Register address (R/W)
         INTLEVEL = 0x0013,  ///< Set Interrupt low level timer register address (R/W)
-        IR = 0x0015,        ///< Interrupt Register (R/W)
-        _IMR_ = 0x0016,     ///< Interrupt mask register (R/W)
-        SIR = 0x0017,       ///< Socket Interrupt Register (R/W)
-        SIMR = 0x0018,      ///< Socket Interrupt Mask Register (R/W)
-        _RTR_ = 0x0019,     ///< Timeout register address (1 is 100us) (R/W)
-        _RCR_ = 0x001B,     ///< Retry count register (R/W)
-        UIPR = 0x0028,      ///< Unreachable IP register address in UDP mode (R)
-        UPORTR = 0x002C,    ///< Unreachable Port register address in UDP mode (R)
-        PHYCFGR = 0x002E,   ///< PHY Status Register (R/W)
+        IR       = 0x0015,  ///< Interrupt Register (R/W)
+        _IMR_    = 0x0016,  ///< Interrupt mask register (R/W)
+        SIR      = 0x0017,  ///< Socket Interrupt Register (R/W)
+        SIMR     = 0x0018,  ///< Socket Interrupt Mask Register (R/W)
+        _RTR_    = 0x0019,  ///< Timeout register address (1 is 100us) (R/W)
+        _RCR_    = 0x001B,  ///< Retry count register (R/W)
+        UIPR     = 0x0028,  ///< Unreachable IP register address in UDP mode (R)
+        UPORTR   = 0x002C,  ///< Unreachable Port register address in UDP mode (R)
+        PHYCFGR  = 0x002E,  ///< PHY Status Register (R/W)
         VERSIONR = 0x0039,  ///< Chip version register address (R)
     };
 
     /** Socket registers */
     enum
     {
-        Sn_MR = 0x0000,          ///< Socket Mode register (R/W)
-        Sn_CR = 0x0001,          ///< Socket command register (R/W)
-        Sn_IR = 0x0002,          ///< Socket interrupt register (R)
-        Sn_SR = 0x0003,          ///< Socket status register (R)
-        Sn_PORT = 0x0004,        ///< Source port register (R/W)
-        Sn_DHAR = 0x0006,        ///< Peer MAC register address (R/W)
-        Sn_DIPR = 0x000C,        ///< Peer IP register address (R/W)
-        Sn_DPORT = 0x0010,       ///< Peer port register address (R/W)
-        Sn_MSSR = 0x0012,        ///< Maximum Segment Size(Sn_MSSR0) register address (R/W)
-        Sn_TOS = 0x0015,         ///< IP Type of Service(TOS) Register (R/W)
-        Sn_TTL = 0x0016,         ///< IP Time to live(TTL) Register (R/W)
+        Sn_MR         = 0x0000,  ///< Socket Mode register (R/W)
+        Sn_CR         = 0x0001,  ///< Socket command register (R/W)
+        Sn_IR         = 0x0002,  ///< Socket interrupt register (R)
+        Sn_SR         = 0x0003,  ///< Socket status register (R)
+        Sn_PORT       = 0x0004,  ///< Source port register (R/W)
+        Sn_DHAR       = 0x0006,  ///< Peer MAC register address (R/W)
+        Sn_DIPR       = 0x000C,  ///< Peer IP register address (R/W)
+        Sn_DPORT      = 0x0010,  ///< Peer port register address (R/W)
+        Sn_MSSR       = 0x0012,  ///< Maximum Segment Size(Sn_MSSR0) register address (R/W)
+        Sn_TOS        = 0x0015,  ///< IP Type of Service(TOS) Register (R/W)
+        Sn_TTL        = 0x0016,  ///< IP Time to live(TTL) Register (R/W)
         Sn_RXBUF_SIZE = 0x001E,  ///< Receive memory size register (R/W)
         Sn_TXBUF_SIZE = 0x001F,  ///< Transmit memory size register (R/W)
-        Sn_TX_FSR = 0x0020,      ///< Transmit free memory size register (R)
-        Sn_TX_RD = 0x0022,       ///< Transmit memory read pointer register address (R)
-        Sn_TX_WR = 0x0024,       ///< Transmit memory write pointer register address (R/W)
-        Sn_RX_RSR = 0x0026,      ///< Received data size register (R)
-        Sn_RX_RD = 0x0028,       ///< Read point of Receive memory (R/W)
-        Sn_RX_WR = 0x002A,       ///< Write point of Receive memory (R)
-        Sn_IMR = 0x002C,         ///< Socket interrupt mask register (R)
-        Sn_FRAG = 0x002D,        ///< Fragment field value in IP header register (R/W)
-        Sn_KPALVTR = 0x002F,     ///< Keep Alive Timer register (R/W)
+        Sn_TX_FSR     = 0x0020,  ///< Transmit free memory size register (R)
+        Sn_TX_RD      = 0x0022,  ///< Transmit memory read pointer register address (R)
+        Sn_TX_WR      = 0x0024,  ///< Transmit memory write pointer register address (R/W)
+        Sn_RX_RSR     = 0x0026,  ///< Received data size register (R)
+        Sn_RX_RD      = 0x0028,  ///< Read point of Receive memory (R/W)
+        Sn_RX_WR      = 0x002A,  ///< Write point of Receive memory (R)
+        Sn_IMR        = 0x002C,  ///< Socket interrupt mask register (R)
+        Sn_FRAG       = 0x002D,  ///< Fragment field value in IP header register (R/W)
+        Sn_KPALVTR    = 0x002F,  ///< Keep Alive Timer register (R/W)
     };
 
     /** Mode register values */
     enum
     {
-        MR_RST = 0x80,    ///< Reset
-        MR_WOL = 0x20,    ///< Wake on LAN
-        MR_PB = 0x10,     ///< Ping block
+        MR_RST   = 0x80,  ///< Reset
+        MR_WOL   = 0x20,  ///< Wake on LAN
+        MR_PB    = 0x10,  ///< Ping block
         MR_PPPOE = 0x08,  ///< Enable PPPoE
-        MR_FARP = 0x02,   ///< Enable UDP_FORCE_ARP CHECK
+        MR_FARP  = 0x02,  ///< Enable UDP_FORCE_ARP CHECK
     };
 
     /* Interrupt Register values */
     enum
     {
         IR_CONFLICT = 0x80,  ///< Check IP conflict
-        IR_UNREACH = 0x40,   ///< Get the destination unreachable message in UDP sending
-        IR_PPPoE = 0x20,     ///< Get the PPPoE close message
-        IR_MP = 0x10,        ///< Get the magic packet interrupt
+        IR_UNREACH  = 0x40,  ///< Get the destination unreachable message in UDP sending
+        IR_PPPoE    = 0x20,  ///< Get the PPPoE close message
+        IR_MP       = 0x10,  ///< Get the magic packet interrupt
     };
 
     /* Interrupt Mask Register values */
@@ -367,92 +367,92 @@ class Wiznet5500
     /** Socket Mode Register values @ref Sn_MR */
     enum
     {
-        Sn_MR_CLOSE = 0x00,   ///< Unused socket
-        Sn_MR_TCP = 0x01,     ///< TCP
-        Sn_MR_UDP = 0x02,     ///< UDP
+        Sn_MR_CLOSE  = 0x00,  ///< Unused socket
+        Sn_MR_TCP    = 0x01,  ///< TCP
+        Sn_MR_UDP    = 0x02,  ///< UDP
         Sn_MR_MACRAW = 0x04,  ///< MAC LAYER RAW SOCK
         Sn_MR_UCASTB = 0x10,  ///< Unicast Block in UDP Multicasting
-        Sn_MR_ND = 0x20,      ///< No Delayed Ack(TCP), Multicast flag
+        Sn_MR_ND     = 0x20,  ///< No Delayed Ack(TCP), Multicast flag
         Sn_MR_BCASTB = 0x40,  ///< Broadcast block in UDP Multicasting
-        Sn_MR_MULTI = 0x80,   ///< Support UDP Multicasting
-        Sn_MR_MIP6B = 0x10,   ///< IPv6 packet Blocking in @ref Sn_MR_MACRAW mode
-        Sn_MR_MMB = 0x20,     ///< Multicast Blocking in @ref Sn_MR_MACRAW mode
-        Sn_MR_MFEN = 0x80,    ///< MAC filter enable in @ref Sn_MR_MACRAW mode
+        Sn_MR_MULTI  = 0x80,  ///< Support UDP Multicasting
+        Sn_MR_MIP6B  = 0x10,  ///< IPv6 packet Blocking in @ref Sn_MR_MACRAW mode
+        Sn_MR_MMB    = 0x20,  ///< Multicast Blocking in @ref Sn_MR_MACRAW mode
+        Sn_MR_MFEN   = 0x80,  ///< MAC filter enable in @ref Sn_MR_MACRAW mode
     };
 
     /** Socket Command Register values */
     enum
     {
-        Sn_CR_OPEN = 0x01,       ///< Initialise or open socket
-        Sn_CR_LISTEN = 0x02,     ///< Wait connection request in TCP mode (Server mode)
-        Sn_CR_CONNECT = 0x04,    ///< Send connection request in TCP mode (Client mode)
-        Sn_CR_DISCON = 0x08,     ///< Send closing request in TCP mode
-        Sn_CR_CLOSE = 0x10,      ///< Close socket
-        Sn_CR_SEND = 0x20,       ///< Update TX buffer pointer and send data
-        Sn_CR_SEND_MAC = 0x21,   ///< Send data with MAC address, so without ARP process
+        Sn_CR_OPEN      = 0x01,  ///< Initialise or open socket
+        Sn_CR_LISTEN    = 0x02,  ///< Wait connection request in TCP mode (Server mode)
+        Sn_CR_CONNECT   = 0x04,  ///< Send connection request in TCP mode (Client mode)
+        Sn_CR_DISCON    = 0x08,  ///< Send closing request in TCP mode
+        Sn_CR_CLOSE     = 0x10,  ///< Close socket
+        Sn_CR_SEND      = 0x20,  ///< Update TX buffer pointer and send data
+        Sn_CR_SEND_MAC  = 0x21,  ///< Send data with MAC address, so without ARP process
         Sn_CR_SEND_KEEP = 0x22,  ///< Send keep alive message
-        Sn_CR_RECV = 0x40,       ///< Update RX buffer pointer and receive data
+        Sn_CR_RECV      = 0x40,  ///< Update RX buffer pointer and receive data
     };
 
     /** Socket Interrupt register values */
     enum
     {
-        Sn_IR_CON = 0x01,      ///< CON Interrupt
-        Sn_IR_DISCON = 0x02,   ///< DISCON Interrupt
-        Sn_IR_RECV = 0x04,     ///< RECV Interrupt
+        Sn_IR_CON     = 0x01,  ///< CON Interrupt
+        Sn_IR_DISCON  = 0x02,  ///< DISCON Interrupt
+        Sn_IR_RECV    = 0x04,  ///< RECV Interrupt
         Sn_IR_TIMEOUT = 0x08,  ///< TIMEOUT Interrupt
-        Sn_IR_SENDOK = 0x10,   ///< SEND_OK Interrupt
+        Sn_IR_SENDOK  = 0x10,  ///< SEND_OK Interrupt
     };
 
     /** Socket Status Register values */
     enum
     {
-        SOCK_CLOSED = 0x00,       ///< Closed
-        SOCK_INIT = 0x13,         ///< Initiate state
-        SOCK_LISTEN = 0x14,       ///< Listen state
-        SOCK_SYNSENT = 0x15,      ///< Connection state
-        SOCK_SYNRECV = 0x16,      ///< Connection state
+        SOCK_CLOSED      = 0x00,  ///< Closed
+        SOCK_INIT        = 0x13,  ///< Initiate state
+        SOCK_LISTEN      = 0x14,  ///< Listen state
+        SOCK_SYNSENT     = 0x15,  ///< Connection state
+        SOCK_SYNRECV     = 0x16,  ///< Connection state
         SOCK_ESTABLISHED = 0x17,  ///< Success to connect
-        SOCK_FIN_WAIT = 0x18,     ///< Closing state
-        SOCK_CLOSING = 0x1A,      ///< Closing state
-        SOCK_TIME_WAIT = 0x1B,    ///< Closing state
-        SOCK_CLOSE_WAIT = 0x1C,   ///< Closing state
-        SOCK_LAST_ACK = 0x1D,     ///< Closing state
-        SOCK_UDP = 0x22,          ///< UDP socket
-        SOCK_MACRAW = 0x42,       ///< MAC raw mode socket
+        SOCK_FIN_WAIT    = 0x18,  ///< Closing state
+        SOCK_CLOSING     = 0x1A,  ///< Closing state
+        SOCK_TIME_WAIT   = 0x1B,  ///< Closing state
+        SOCK_CLOSE_WAIT  = 0x1C,  ///< Closing state
+        SOCK_LAST_ACK    = 0x1D,  ///< Closing state
+        SOCK_UDP         = 0x22,  ///< UDP socket
+        SOCK_MACRAW      = 0x42,  ///< MAC raw mode socket
     };
 
     /* PHYCFGR register value */
     enum
     {
-        PHYCFGR_RST = ~(1 << 7),  //< For PHY reset, must operate AND mask.
-        PHYCFGR_OPMD = (1 << 6),  // Configre PHY with OPMDC value
-        PHYCFGR_OPMDC_ALLA = (7 << 3),
+        PHYCFGR_RST         = ~(1 << 7),  //< For PHY reset, must operate AND mask.
+        PHYCFGR_OPMD        = (1 << 6),   // Configre PHY with OPMDC value
+        PHYCFGR_OPMDC_ALLA  = (7 << 3),
         PHYCFGR_OPMDC_PDOWN = (6 << 3),
-        PHYCFGR_OPMDC_NA = (5 << 3),
+        PHYCFGR_OPMDC_NA    = (5 << 3),
         PHYCFGR_OPMDC_100FA = (4 << 3),
-        PHYCFGR_OPMDC_100F = (3 << 3),
-        PHYCFGR_OPMDC_100H = (2 << 3),
-        PHYCFGR_OPMDC_10F = (1 << 3),
-        PHYCFGR_OPMDC_10H = (0 << 3),
-        PHYCFGR_DPX_FULL = (1 << 2),
-        PHYCFGR_DPX_HALF = (0 << 2),
-        PHYCFGR_SPD_100 = (1 << 1),
-        PHYCFGR_SPD_10 = (0 << 1),
-        PHYCFGR_LNK_ON = (1 << 0),
-        PHYCFGR_LNK_OFF = (0 << 0),
+        PHYCFGR_OPMDC_100F  = (3 << 3),
+        PHYCFGR_OPMDC_100H  = (2 << 3),
+        PHYCFGR_OPMDC_10F   = (1 << 3),
+        PHYCFGR_OPMDC_10H   = (0 << 3),
+        PHYCFGR_DPX_FULL    = (1 << 2),
+        PHYCFGR_DPX_HALF    = (0 << 2),
+        PHYCFGR_SPD_100     = (1 << 1),
+        PHYCFGR_SPD_10      = (0 << 1),
+        PHYCFGR_LNK_ON      = (1 << 0),
+        PHYCFGR_LNK_OFF     = (0 << 0),
     };
 
     enum
     {
-        PHY_SPEED_10 = 0,     ///< Link Speed 10
-        PHY_SPEED_100 = 1,    ///< Link Speed 100
+        PHY_SPEED_10    = 0,  ///< Link Speed 10
+        PHY_SPEED_100   = 1,  ///< Link Speed 100
         PHY_DUPLEX_HALF = 0,  ///< Link Half-Duplex
         PHY_DUPLEX_FULL = 1,  ///< Link Full-Duplex
-        PHY_LINK_OFF = 0,     ///< Link Off
-        PHY_LINK_ON = 1,      ///< Link On
-        PHY_POWER_NORM = 0,   ///< PHY power normal mode
-        PHY_POWER_DOWN = 1,   ///< PHY power down mode
+        PHY_LINK_OFF    = 0,  ///< Link Off
+        PHY_LINK_ON     = 1,  ///< Link On
+        PHY_POWER_NORM  = 0,  ///< PHY power normal mode
+        PHY_POWER_DOWN  = 1,  ///< PHY power down mode
     };
 
     /**
@@ -589,7 +589,7 @@ class Wiznet5500
         @param (uint8_t)cr Value to set @ref Sn_CR
         @sa getSn_CR()
     */
-    void setSn_CR(uint8_t cr);
+    void           setSn_CR(uint8_t cr);
 
     /**
         Get @ref Sn_CR register
diff --git a/tests/clang-format-arduino b/tests/clang-format-arduino
deleted file mode 100644
index 69b5a295f8..0000000000
--- a/tests/clang-format-arduino
+++ /dev/null
@@ -1,5 +0,0 @@
-BasedOnStyle: WebKit
-IndentWidth: 2
-SortIncludes: false
-BreakBeforeBraces: Attach
-IndentCaseLabels: true
diff --git a/tests/clang-format-core b/tests/clang-format-core
deleted file mode 100644
index 7d0d1d9c90..0000000000
--- a/tests/clang-format-core
+++ /dev/null
@@ -1,8 +0,0 @@
-BasedOnStyle: WebKit
-AlignTrailingComments: true
-BreakBeforeBraces: Allman
-ColumnLimit: 0
-IndentWidth: 4
-KeepEmptyLinesAtTheStartOfBlocks: false
-SpacesBeforeTrailingComments: 2
-SortIncludes: false
diff --git a/tests/device/libraries/BSTest/src/BSArduino.h b/tests/device/libraries/BSTest/src/BSArduino.h
index b70a265ea0..6ec933c7f9 100644
--- a/tests/device/libraries/BSTest/src/BSArduino.h
+++ b/tests/device/libraries/BSTest/src/BSArduino.h
@@ -7,8 +7,8 @@ namespace bs
 class ArduinoIOHelper
 {
 public:
-    ArduinoIOHelper(Stream& stream)
-        : m_stream(stream)
+    ArduinoIOHelper(Stream& stream) :
+        m_stream(stream)
     {
     }
 
@@ -16,9 +16,9 @@ class ArduinoIOHelper
     {
         va_list arg;
         va_start(arg, format);
-        char temp[128];
-        char* buffer = temp;
-        size_t len = vsnprintf(temp, sizeof(temp), format, arg);
+        char   temp[128];
+        char*  buffer = temp;
+        size_t len    = vsnprintf(temp, sizeof(temp), format, arg);
         va_end(arg);
         if (len > sizeof(temp) - 1)
         {
@@ -72,7 +72,7 @@ class ArduinoIOHelper
 
 typedef ArduinoIOHelper IOHelper;
 
-inline void fatal()
+inline void             fatal()
 {
     ESP.restart();
 }
diff --git a/tests/device/libraries/BSTest/src/BSArgs.h b/tests/device/libraries/BSTest/src/BSArgs.h
index b989802c2d..679ac5fb91 100644
--- a/tests/device/libraries/BSTest/src/BSArgs.h
+++ b/tests/device/libraries/BSTest/src/BSArgs.h
@@ -20,13 +20,13 @@ namespace protocol
     typedef enum
     {
         /* parsing the space between arguments */
-        SS_SPACE = 0x0,
+        SS_SPACE              = 0x0,
         /* parsing an argument which isn't quoted */
-        SS_ARG = 0x1,
+        SS_ARG                = 0x1,
         /* parsing a quoted argument */
-        SS_QUOTED_ARG = 0x2,
+        SS_QUOTED_ARG         = 0x2,
         /* parsing an escape sequence within unquoted argument */
-        SS_ARG_ESCAPED = SS_ARG | SS_FLAG_ESCAPE,
+        SS_ARG_ESCAPED        = SS_ARG | SS_FLAG_ESCAPE,
         /* parsing an escape sequence within a quoted argument */
         SS_QUOTED_ARG_ESCAPED = SS_QUOTED_ARG | SS_FLAG_ESCAPE,
     } split_state_t;
@@ -35,9 +35,9 @@ namespace protocol
 #define END_ARG()                      \
     do                                 \
     {                                  \
-        char_out = 0;                  \
+        char_out     = 0;              \
         argv[argc++] = next_arg_start; \
-        state = SS_SPACE;              \
+        state        = SS_SPACE;       \
     } while (0);
 
     /**
@@ -66,13 +66,13 @@ namespace protocol
  */
     inline size_t split_args(char* line, char** argv, size_t argv_size)
     {
-        const int QUOTE = '"';
-        const int ESCAPE = '\\';
-        const int SPACE = ' ';
-        split_state_t state = SS_SPACE;
-        size_t argc = 0;
-        char* next_arg_start = line;
-        char* out_ptr = line;
+        const int     QUOTE          = '"';
+        const int     ESCAPE         = '\\';
+        const int     SPACE          = ' ';
+        split_state_t state          = SS_SPACE;
+        size_t        argc           = 0;
+        char*         next_arg_start = line;
+        char*         out_ptr        = line;
         for (char* in_ptr = line; argc < argv_size - 1; ++in_ptr)
         {
             int char_in = (unsigned char)*in_ptr;
@@ -92,18 +92,18 @@ namespace protocol
                 else if (char_in == QUOTE)
                 {
                     next_arg_start = out_ptr;
-                    state = SS_QUOTED_ARG;
+                    state          = SS_QUOTED_ARG;
                 }
                 else if (char_in == ESCAPE)
                 {
                     next_arg_start = out_ptr;
-                    state = SS_ARG_ESCAPED;
+                    state          = SS_ARG_ESCAPED;
                 }
                 else
                 {
                     next_arg_start = out_ptr;
-                    state = SS_ARG;
-                    char_out = char_in;
+                    state          = SS_ARG;
+                    char_out       = char_in;
                 }
                 break;
 
diff --git a/tests/device/libraries/BSTest/src/BSProtocol.h b/tests/device/libraries/BSTest/src/BSProtocol.h
index 868e5cceba..97de150b56 100644
--- a/tests/device/libraries/BSTest/src/BSProtocol.h
+++ b/tests/device/libraries/BSTest/src/BSProtocol.h
@@ -74,7 +74,7 @@ namespace protocol
         {
             return false;
         }
-        char* argv[4];
+        char*  argv[4];
         size_t argc = split_args(line_buf, argv, sizeof(argv) / sizeof(argv[0]));
         if (argc == 0)
         {
diff --git a/tests/device/libraries/BSTest/src/BSStdio.h b/tests/device/libraries/BSTest/src/BSStdio.h
index 892ecaa9d4..eccde5ce54 100644
--- a/tests/device/libraries/BSTest/src/BSStdio.h
+++ b/tests/device/libraries/BSTest/src/BSStdio.h
@@ -41,7 +41,7 @@ class StdIOHelper
 
 typedef StdIOHelper IOHelper;
 
-inline void fatal()
+inline void         fatal()
 {
     throw std::runtime_error("fatal error");
 }
diff --git a/tests/device/libraries/BSTest/src/BSTest.h b/tests/device/libraries/BSTest/src/BSTest.h
index f792637e7e..4b3712f8f7 100644
--- a/tests/device/libraries/BSTest/src/BSTest.h
+++ b/tests/device/libraries/BSTest/src/BSTest.h
@@ -25,12 +25,8 @@ typedef void (*test_case_func_t)();
 class TestCase
 {
 public:
-    TestCase(TestCase* prev, test_case_func_t func, const char* file, size_t line, const char* name, const char* desc)
-        : m_func(func)
-        , m_file(file)
-        , m_line(line)
-        , m_name(name)
-        , m_desc(desc)
+    TestCase(TestCase* prev, test_case_func_t func, const char* file, size_t line, const char* name, const char* desc) :
+        m_func(func), m_file(file), m_line(line), m_name(name), m_desc(desc)
     {
         if (prev)
         {
@@ -69,12 +65,12 @@ class TestCase
     }
 
 protected:
-    TestCase* m_next = nullptr;
+    TestCase*        m_next = nullptr;
     test_case_func_t m_func;
-    const char* m_file;
-    size_t m_line;
-    const char* m_name;
-    const char* m_desc;
+    const char*      m_file;
+    size_t           m_line;
+    const char*      m_name;
+    const char*      m_desc;
 };
 
 struct Registry
@@ -89,15 +85,15 @@ struct Registry
         m_last = tc;
     }
     TestCase* m_first = nullptr;
-    TestCase* m_last = nullptr;
+    TestCase* m_last  = nullptr;
 };
 
 struct Env
 {
-    std::function<void(void)> m_check_pass;
+    std::function<void(void)>   m_check_pass;
     std::function<void(size_t)> m_check_fail;
     std::function<void(size_t)> m_fail;
-    Registry m_registry;
+    Registry                    m_registry;
 };
 
 extern Env g_env;
@@ -108,19 +104,19 @@ class Runner
     typedef Runner<IO> Tself;
 
 public:
-    Runner(IO& io)
-        : m_io(io)
+    Runner(IO& io) :
+        m_io(io)
     {
         g_env.m_check_pass = std::bind(&Tself::check_pass, this);
         g_env.m_check_fail = std::bind(&Tself::check_fail, this, std::placeholders::_1);
-        g_env.m_fail = std::bind(&Tself::fail, this, std::placeholders::_1);
+        g_env.m_fail       = std::bind(&Tself::fail, this, std::placeholders::_1);
     }
 
     ~Runner()
     {
         g_env.m_check_pass = 0;
         g_env.m_check_fail = 0;
-        g_env.m_fail = 0;
+        g_env.m_fail       = 0;
     }
 
     void run()
@@ -159,7 +155,7 @@ class Runner
         protocol::output_menu_end(m_io);
         while (true)
         {
-            int id;
+            int  id;
             char line_buf[BS_LINE_BUF_SIZE];
             if (!protocol::input_handle(m_io, line_buf, sizeof(line_buf), id))
             {
@@ -186,7 +182,7 @@ class Runner
     }
 
 protected:
-    IO& m_io;
+    IO&    m_io;
     size_t m_check_pass_count;
     size_t m_check_fail_count;
 };
@@ -248,12 +244,12 @@ inline void require(bool condition, size_t line)
     {                    \
         Env g_env;       \
     }
-#define BS_RUN(...)                                      \
-    do                                                   \
-    {                                                    \
-        bs::IOHelper helper = bs::IOHelper(__VA_ARGS__); \
-        bs::Runner<bs::IOHelper> runner(helper);         \
-        runner.run();                                    \
+#define BS_RUN(...)                                                  \
+    do                                                               \
+    {                                                                \
+        bs::IOHelper             helper = bs::IOHelper(__VA_ARGS__); \
+        bs::Runner<bs::IOHelper> runner(helper);                     \
+        runner.run();                                                \
     } while (0);
 
 #endif  //BSTEST_H
diff --git a/tests/device/test_libc/libm_string.c b/tests/device/test_libc/libm_string.c
index 68b9c5e139..9da92bcc61 100644
--- a/tests/device/test_libc/libm_string.c
+++ b/tests/device/test_libc/libm_string.c
@@ -16,14 +16,15 @@
 #define strcmp strcmp_P
 #define strncmp strncmp_P
 
-_CONST char* it = "<UNSET>"; /* Routine name for message routines. */
-static int errors = 0;
+_CONST char* it     = "<UNSET>"; /* Routine name for message routines. */
+static int   errors = 0;
 
 /* Complain if condition is not true.  */
 #define check(thing) checkit(thing, __LINE__)
 
 static void
-_DEFUN(checkit, (ok, l), int ok _AND int l)
+_DEFUN(checkit, (ok, l),
+       int ok _AND int l)
 
 {
     //  newfunc(it);
@@ -40,7 +41,8 @@ _DEFUN(checkit, (ok, l), int ok _AND int l)
 #define equal(a, b) funcqual(a, b, __LINE__);
 
 static void
-_DEFUN(funcqual, (a, b, l), char* a _AND char* b _AND int l)
+_DEFUN(funcqual, (a, b, l),
+       char* a _AND char* b _AND int l)
 {
     //  newfunc(it);
 
@@ -56,7 +58,7 @@ _DEFUN(funcqual, (a, b, l), char* a _AND char* b _AND int l)
 static char one[50];
 static char two[50];
 
-void libm_test_string()
+void        libm_test_string()
 {
     /* Test strcmp first because we use it to test other things.  */
     it = "strcmp";
diff --git a/tests/device/test_libc/memcpy-1.c b/tests/device/test_libc/memcpy-1.c
index b16d1bd4ed..a7fb9e9169 100644
--- a/tests/device/test_libc/memcpy-1.c
+++ b/tests/device/test_libc/memcpy-1.c
@@ -90,20 +90,20 @@ print_error(char const* msg, ...)
 }
 
 extern int rand_seed;
-void memcpy_main(void)
+void       memcpy_main(void)
 {
     /* Allocate buffers to read and write from.  */
     char src[BUFF_SIZE], dest[BUFF_SIZE], backup_src[BUFF_SIZE];
 
     /* Fill the source buffer with non-null values, reproducible random data. */
     srand(rand_seed);
-    int i, j;
+    int      i, j;
     unsigned sa;
     unsigned da;
     unsigned n;
     for (i = 0; i < BUFF_SIZE; i++)
     {
-        src[i] = (char)rand() | 1;
+        src[i]        = (char)rand() | 1;
         backup_src[i] = src[i];
     }
 
@@ -122,12 +122,11 @@ void memcpy_main(void)
 
                 /* Check return value.  */
                 if (ret != (dest + START_COPY + da))
-                    print_error(
-                        "\nFailed: wrong return value in memcpy of %u bytes "
-                        "with src_align %u and dst_align %u. "
-                        "Return value and dest should be the same"
-                        "(ret is %p, dest is %p)\n",
-                        n, sa, da, ret, dest + START_COPY + da);
+                    print_error("\nFailed: wrong return value in memcpy of %u bytes "
+                                "with src_align %u and dst_align %u. "
+                                "Return value and dest should be the same"
+                                "(ret is %p, dest is %p)\n",
+                                n, sa, da, ret, dest + START_COPY + da);
 
                 /* Check that content of the destination buffer
              is the same as the source buffer, and
@@ -136,39 +135,35 @@ void memcpy_main(void)
                     if ((unsigned)j < START_COPY + da)
                     {
                         if (dest[j] != 0)
-                            print_error(
-                                "\nFailed: after memcpy of %u bytes "
-                                "with src_align %u and dst_align %u, "
-                                "byte %u before the start of dest is not 0.\n",
-                                n, sa, da, START_COPY - j);
+                            print_error("\nFailed: after memcpy of %u bytes "
+                                        "with src_align %u and dst_align %u, "
+                                        "byte %u before the start of dest is not 0.\n",
+                                        n, sa, da, START_COPY - j);
                     }
                     else if ((unsigned)j < START_COPY + da + n)
                     {
                         i = j - START_COPY - da;
                         if (dest[j] != (src + sa)[i])
-                            print_error(
-                                "\nFailed: after memcpy of %u bytes "
-                                "with src_align %u and dst_align %u, "
-                                "byte %u in dest and src are not the same.\n",
-                                n, sa, da, i);
+                            print_error("\nFailed: after memcpy of %u bytes "
+                                        "with src_align %u and dst_align %u, "
+                                        "byte %u in dest and src are not the same.\n",
+                                        n, sa, da, i);
                     }
                     else if (dest[j] != 0)
                     {
-                        print_error(
-                            "\nFailed: after memcpy of %u bytes "
-                            "with src_align %u and dst_align %u, "
-                            "byte %u after the end of dest is not 0.\n",
-                            n, sa, da, j - START_COPY - da - n);
+                        print_error("\nFailed: after memcpy of %u bytes "
+                                    "with src_align %u and dst_align %u, "
+                                    "byte %u after the end of dest is not 0.\n",
+                                    n, sa, da, j - START_COPY - da - n);
                     }
 
                 /* Check src is not modified.  */
                 for (j = 0; j < BUFF_SIZE; j++)
                     if (src[i] != backup_src[i])
-                        print_error(
-                            "\nFailed: after memcpy of %u bytes "
-                            "with src_align %u and dst_align %u, "
-                            "byte %u of src is modified.\n",
-                            n, sa, da, j);
+                        print_error("\nFailed: after memcpy of %u bytes "
+                                    "with src_align %u and dst_align %u, "
+                                    "byte %u of src is modified.\n",
+                                    n, sa, da, j);
             }
 
     if (errors != 0)
diff --git a/tests/device/test_libc/memmove1.c b/tests/device/test_libc/memmove1.c
index 0d76f7cda7..63bbc0b190 100644
--- a/tests/device/test_libc/memmove1.c
+++ b/tests/device/test_libc/memmove1.c
@@ -92,7 +92,7 @@ void xmemmove(unsigned char* dest, unsigned char* src, size_t n)
     {
         errors++;
         DEBUGP("memmove of n bytes returned %p instead of dest=%p\n",
-            retp, dest);
+               retp, dest);
     }
 }
 
@@ -108,8 +108,8 @@ void fill(unsigned char dest[MAX * 3])
 
 void memmove_main(void)
 {
-    size_t i;
-    int errors = 0;
+    size_t        i;
+    int           errors = 0;
 
     /* Leave some room before and after the area tested, so we can detect
      overwrites of up to N bytes, N being the amount tested.  If you
@@ -156,7 +156,7 @@ void memmove_main(void)
                 errors++;
                 DEBUGP("memmove failed for %d bytes,"
                        " with src %d bytes before dest\n",
-                    i, j);
+                       i, j);
             }
         }
     }
@@ -178,7 +178,7 @@ void memmove_main(void)
                 errors++;
                 DEBUGP("memmove failed when moving %d bytes,"
                        " with src %d bytes after dest\n",
-                    i, j);
+                       i, j);
             }
         }
     }
diff --git a/tests/device/test_libc/strcmp-1.c b/tests/device/test_libc/strcmp-1.c
index bfabf8e967..6da8ef9a81 100644
--- a/tests/device/test_libc/strcmp-1.c
+++ b/tests/device/test_libc/strcmp-1.c
@@ -106,7 +106,7 @@
 #endif
 
 #define TOO_MANY_ERRORS 11
-static int errors = 0;
+static int  errors   = 0;
 
 const char* testname = "strcmp";
 
@@ -132,19 +132,19 @@ print_error(char const* msg, ...)
 }
 
 extern int rand_seed;
-void strcmp_main(void)
+void       strcmp_main(void)
 {
     /* Allocate buffers to read and write from.  */
     char src[BUFF_SIZE], dest[BUFF_SIZE];
 
     /* Fill the source buffer with non-null values, reproducible random data. */
     srand(rand_seed);
-    int i, j, zeros;
+    int      i, j, zeros;
     unsigned sa;
     unsigned da;
     unsigned n, m, len;
-    char* p;
-    int ret;
+    char*    p;
+    int      ret;
 
     /* Make calls to strcmp with block sizes ranging between 1 and
      MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
@@ -161,7 +161,7 @@ void strcmp_main(void)
                             /* Make a copy of the source.  */
                             for (i = 0; i < BUFF_SIZE; i++)
                             {
-                                src[i] = 'A' + (i % 26);
+                                src[i]  = 'A' + (i % 26);
                                 dest[i] = src[i];
                             }
                             delay(0);
@@ -179,7 +179,7 @@ void strcmp_main(void)
                             for (j = 0; j < (int)len; j++)
                                 *p++ = 'x';
                             /* Make dest 0-terminated.  */
-                            *p = '\0';
+                            *p  = '\0';
 
                             ret = strcmp(src + sa, dest + da);
 
@@ -190,35 +190,32 @@ void strcmp_main(void)
                                 {
                                     if (ret != 0)
                                     {
-                                        print_error(
-                                            "\nFailed: after %s of %u bytes "
-                                            "with src_align %u and dst_align %u, "
-                                            "dest after %d bytes is modified for %d bytes, "
-                                            "return value is %d, expected 0.\n",
-                                            testname, n, sa, da, m, len, ret);
+                                        print_error("\nFailed: after %s of %u bytes "
+                                                    "with src_align %u and dst_align %u, "
+                                                    "dest after %d bytes is modified for %d bytes, "
+                                                    "return value is %d, expected 0.\n",
+                                                    testname, n, sa, da, m, len, ret);
                                     }
                                 }
                                 else
                                 {
                                     if (ret >= 0)
-                                        print_error(
-                                            "\nFailed: after %s of %u bytes "
-                                            "with src_align %u and dst_align %u, "
-                                            "dest after %d bytes is modified for %d bytes, "
-                                            "return value is %d, expected negative.\n",
-                                            testname, n, sa, da, m, len, ret);
+                                        print_error("\nFailed: after %s of %u bytes "
+                                                    "with src_align %u and dst_align %u, "
+                                                    "dest after %d bytes is modified for %d bytes, "
+                                                    "return value is %d, expected negative.\n",
+                                                    testname, n, sa, da, m, len, ret);
                                 }
                             }
                             else if (m > n)
                             {
                                 if (ret >= 0)
                                 {
-                                    print_error(
-                                        "\nFailed: after %s of %u bytes "
-                                        "with src_align %u and dst_align %u, "
-                                        "dest after %d bytes is modified for %d bytes, "
-                                        "return value is %d, expected negative.\n",
-                                        testname, n, sa, da, m, len, ret);
+                                    print_error("\nFailed: after %s of %u bytes "
+                                                "with src_align %u and dst_align %u, "
+                                                "dest after %d bytes is modified for %d bytes, "
+                                                "return value is %d, expected negative.\n",
+                                                testname, n, sa, da, m, len, ret);
                                 }
                             }
                             else /* m < n */
@@ -226,59 +223,57 @@ void strcmp_main(void)
                                 if (len == 0)
                                 {
                                     if (ret <= 0)
-                                        print_error(
-                                            "\nFailed: after %s of %u bytes "
-                                            "with src_align %u and dst_align %u, "
-                                            "dest after %d bytes is modified for %d bytes, "
-                                            "return value is %d, expected positive.\n",
-                                            testname, n, sa, da, m, len, ret);
+                                        print_error("\nFailed: after %s of %u bytes "
+                                                    "with src_align %u and dst_align %u, "
+                                                    "dest after %d bytes is modified for %d bytes, "
+                                                    "return value is %d, expected positive.\n",
+                                                    testname, n, sa, da, m, len, ret);
                                 }
                                 else
                                 {
                                     if (ret >= 0)
-                                        print_error(
-                                            "\nFailed: after %s of %u bytes "
-                                            "with src_align %u and dst_align %u, "
-                                            "dest after %d bytes is modified for %d bytes, "
-                                            "return value is %d, expected negative.\n",
-                                            testname, n, sa, da, m, len, ret);
+                                        print_error("\nFailed: after %s of %u bytes "
+                                                    "with src_align %u and dst_align %u, "
+                                                    "dest after %d bytes is modified for %d bytes, "
+                                                    "return value is %d, expected negative.\n",
+                                                    testname, n, sa, da, m, len, ret);
                                 }
                             }
                         }
             }
 
     /* Check some corner cases.  */
-    src[1] = 'A';
+    src[1]  = 'A';
     dest[1] = 'A';
-    src[2] = 'B';
+    src[2]  = 'B';
     dest[2] = 'B';
-    src[3] = 'C';
+    src[3]  = 'C';
     dest[3] = 'C';
-    src[4] = '\0';
+    src[4]  = '\0';
     dest[4] = '\0';
 
-    src[0] = 0xc1;
+    src[0]  = 0xc1;
     dest[0] = 0x41;
-    ret = strcmp(src, dest);
+    ret     = strcmp(src, dest);
     if (ret <= 0)
         print_error("\nFailed: expected positive, return %d\n", ret);
 
-    src[0] = 0x01;
+    src[0]  = 0x01;
     dest[0] = 0x82;
-    ret = strcmp(src, dest);
+    ret     = strcmp(src, dest);
     if (ret >= 0)
         print_error("\nFailed: expected negative, return %d\n", ret);
 
     dest[0] = src[0] = 'D';
-    src[3] = 0xc1;
-    dest[3] = 0x41;
-    ret = strcmp(src, dest);
+    src[3]           = 0xc1;
+    dest[3]          = 0x41;
+    ret              = strcmp(src, dest);
     if (ret <= 0)
         print_error("\nFailed: expected positive, return %d\n", ret);
 
-    src[3] = 0x01;
+    src[3]  = 0x01;
     dest[3] = 0x82;
-    ret = strcmp(src, dest);
+    ret     = strcmp(src, dest);
     if (ret >= 0)
         print_error("\nFailed: expected negative, return %d\n", ret);
 
diff --git a/tests/device/test_libc/tstring.c b/tests/device/test_libc/tstring.c
index 9434523f85..5989626c5a 100644
--- a/tests/device/test_libc/tstring.c
+++ b/tests/device/test_libc/tstring.c
@@ -30,10 +30,10 @@ void eprintf(int line, char* result, char* expected, int size)
 {
     if (size != 0)
         printf("Failure at line %d, result is <%.*s>, should be <%s> of size %d\n",
-            line, size, result, expected, size);
+               line, size, result, expected, size);
     else
         printf("Failure at line %d, result is <%s>, should be <%s>\n",
-            line, result, expected);
+               line, result, expected);
 }
 
 void mycopy(char* target, char* source, int size)
@@ -58,34 +58,34 @@ void myset(char* target, char ch, int size)
 
 void tstring_main(void)
 {
-    char target[MAX_1] = "A";
-    char first_char;
-    char second_char;
-    char array[] = "abcdefghijklmnopqrstuvwxz";
-    char array2[] = "0123456789!@#$%^&*(";
-    char buffer2[MAX_1];
-    char buffer3[MAX_1];
-    char buffer4[MAX_1];
-    char buffer5[MAX_2];
-    char buffer6[MAX_2];
-    char buffer7[MAX_2];
-    char expected[MAX_1];
+    char  target[MAX_1] = "A";
+    char  first_char;
+    char  second_char;
+    char  array[]  = "abcdefghijklmnopqrstuvwxz";
+    char  array2[] = "0123456789!@#$%^&*(";
+    char  buffer2[MAX_1];
+    char  buffer3[MAX_1];
+    char  buffer4[MAX_1];
+    char  buffer5[MAX_2];
+    char  buffer6[MAX_2];
+    char  buffer7[MAX_2];
+    char  expected[MAX_1];
     char *tmp1, *tmp2, *tmp3, *tmp4, *tmp5, *tmp6, *tmp7;
-    int i, j, k, x, z, align_test_iterations;
-    z = 0;
+    int   i, j, k, x, z, align_test_iterations;
+    z               = 0;
 
     int test_failed = 0;
 
-    tmp1 = target;
-    tmp2 = buffer2;
-    tmp3 = buffer3;
-    tmp4 = buffer4;
-    tmp5 = buffer5;
-    tmp6 = buffer6;
-    tmp7 = buffer7;
+    tmp1            = target;
+    tmp2            = buffer2;
+    tmp3            = buffer3;
+    tmp4            = buffer4;
+    tmp5            = buffer5;
+    tmp6            = buffer6;
+    tmp7            = buffer7;
 
-    tmp2[0] = 'Z';
-    tmp2[1] = '\0';
+    tmp2[0]         = 'Z';
+    tmp2[1]         = '\0';
 
     if (memset(target, 'X', 0) != target || memcpy(target, "Y", 0) != target || memmove(target, "K", 0) != target || strncpy(tmp2, "4", 0) != tmp2 || strncat(tmp2, "123", 0) != tmp2 || strcat(target, "") != target)
     {
@@ -165,7 +165,7 @@ void tstring_main(void)
     }
 
     target[3] = '\0';
-    tmp5[0] = '\0';
+    tmp5[0]   = '\0';
     strncat(tmp5, "123", 2);
     if (memcmp(target, "ZZZ", 3) || strcmp(target, "ZZZ") || strcmp(tmp3, target) || strcmp(tmp4, target) || strncmp(target, "ZZZ", 4) || strncmp(target, "ZZY", 3) <= 0 || strncmp("ZZY", target, 4) >= 0 || memcmp(tmp5, "12", 3) || strlen(target) != 3)
     {
@@ -209,14 +209,14 @@ void tstring_main(void)
 
             for (x = 0; x < align_test_iterations; ++x)
             {
-                tmp1 = target + x;
-                tmp2 = buffer2 + x;
-                tmp3 = buffer3 + x;
-                tmp4 = buffer4 + x;
-                tmp5 = buffer5 + x;
-                tmp6 = buffer6 + x;
-
-                first_char = array[i % (sizeof(array) - 1)];
+                tmp1        = target + x;
+                tmp2        = buffer2 + x;
+                tmp3        = buffer3 + x;
+                tmp4        = buffer4 + x;
+                tmp5        = buffer5 + x;
+                tmp6        = buffer6 + x;
+
+                first_char  = array[i % (sizeof(array) - 1)];
                 second_char = array2[i % (sizeof(array2) - 1)];
                 memset(tmp1, first_char, i);
                 mycopy(tmp2, tmp1, i);
@@ -272,14 +272,14 @@ void tstring_main(void)
                     if (memcmp(tmp3, tmp4, i - k + 1) != 0 || strncmp(tmp3, tmp4, i - k + 1) != 0)
                     {
                         printf("Failure at line %d, comparing %.*s with %.*s\n",
-                            __LINE__, i, tmp3, i, tmp4);
+                               __LINE__, i, tmp3, i, tmp4);
                         test_failed = 1;
                     }
                     tmp4[i - k] = first_char + 1;
                     if (memcmp(tmp3, tmp4, i) >= 0 || strncmp(tmp3, tmp4, i) >= 0 || memcmp(tmp4, tmp3, i) <= 0 || strncmp(tmp4, tmp3, i) <= 0)
                     {
                         printf("Failure at line %d, comparing %.*s with %.*s\n",
-                            __LINE__, i, tmp3, i, tmp4);
+                               __LINE__, i, tmp3, i, tmp4);
                         test_failed = 1;
                     }
                     tmp4[i - k] = first_char;
diff --git a/tests/host/common/Arduino.cpp b/tests/host/common/Arduino.cpp
index 67bcc8ca34..64b000ebfb 100644
--- a/tests/host/common/Arduino.cpp
+++ b/tests/host/common/Arduino.cpp
@@ -21,7 +21,7 @@
 #include <Arduino.h>
 #include <Schedule.h>
 
-static struct timeval gtod0 = { 0, 0 };
+static struct timeval    gtod0 = { 0, 0 };
 
 extern "C" unsigned long millis()
 {
@@ -109,7 +109,7 @@ extern "C" void delayMicroseconds(unsigned int us)
 }
 
 #include "cont.h"
-cont_t* g_pcont = NULL;
+cont_t*         g_pcont = NULL;
 extern "C" void cont_suspend(cont_t*)
 {
 }
diff --git a/tests/host/common/ArduinoMain.cpp b/tests/host/common/ArduinoMain.cpp
index 13e570281d..6f48a04259 100644
--- a/tests/host/common/ArduinoMain.cpp
+++ b/tests/host/common/ArduinoMain.cpp
@@ -41,22 +41,22 @@
 
 #define MOCK_PORT_SHIFTER 9000
 
-bool user_exit = false;
-bool run_once = false;
-const char* host_interface = nullptr;
-size_t spiffs_kb = 1024;
-size_t littlefs_kb = 1024;
-bool ignore_sigint = false;
-bool restore_tty = false;
-bool mockdebug = false;
-int mock_port_shifter = MOCK_PORT_SHIFTER;
-const char* fspath = nullptr;
+bool        user_exit         = false;
+bool        run_once          = false;
+const char* host_interface    = nullptr;
+size_t      spiffs_kb         = 1024;
+size_t      littlefs_kb       = 1024;
+bool        ignore_sigint     = false;
+bool        restore_tty       = false;
+bool        mockdebug         = false;
+int         mock_port_shifter = MOCK_PORT_SHIFTER;
+const char* fspath            = nullptr;
 
 #define STDIN STDIN_FILENO
 
 static struct termios initial_settings;
 
-int mockverbose(const char* fmt, ...)
+int                   mockverbose(const char* fmt, ...)
 {
     va_list ap;
     va_start(ap, fmt);
@@ -84,7 +84,7 @@ static int mock_start_uart(void)
     settings.c_lflag &= ~(ECHO | ICANON);
     settings.c_iflag &= ~(ICRNL | INLCR | ISTRIP | IXON);
     settings.c_oflag |= (ONLCR);
-    settings.c_cc[VMIN] = 0;
+    settings.c_cc[VMIN]  = 0;
     settings.c_cc[VTIME] = 0;
     if (tcsetattr(STDIN, TCSANOW, &settings) < 0)
     {
@@ -201,7 +201,7 @@ void control_c(int sig)
 
 int main(int argc, char* const argv[])
 {
-    bool fast = false;
+    bool fast     = false;
     blocking_uart = false;  // global
 
     signal(SIGINT, control_c);
diff --git a/tests/host/common/ArduinoMainLittlefs.cpp b/tests/host/common/ArduinoMainLittlefs.cpp
index c85e0b9dbc..f2c1b8b8f0 100644
--- a/tests/host/common/ArduinoMainLittlefs.cpp
+++ b/tests/host/common/ArduinoMainLittlefs.cpp
@@ -3,7 +3,7 @@
 
 LittleFSMock* littlefs_mock = nullptr;
 
-void mock_start_littlefs(const String& fname, size_t size_kb, size_t block_kb, size_t page_b)
+void          mock_start_littlefs(const String& fname, size_t size_kb, size_t block_kb, size_t page_b)
 {
     littlefs_mock = new LittleFSMock(size_kb * 1024, block_kb * 1024, page_b, fname);
 }
diff --git a/tests/host/common/ArduinoMainSpiffs.cpp b/tests/host/common/ArduinoMainSpiffs.cpp
index 035cc9e752..e4a1c911fb 100644
--- a/tests/host/common/ArduinoMainSpiffs.cpp
+++ b/tests/host/common/ArduinoMainSpiffs.cpp
@@ -3,7 +3,7 @@
 
 SpiffsMock* spiffs_mock = nullptr;
 
-void mock_start_spiffs(const String& fname, size_t size_kb, size_t block_kb, size_t page_b)
+void        mock_start_spiffs(const String& fname, size_t size_kb, size_t block_kb, size_t page_b)
 {
     spiffs_mock = new SpiffsMock(size_kb * 1024, block_kb * 1024, page_b, fname);
 }
diff --git a/tests/host/common/ArduinoMainUdp.cpp b/tests/host/common/ArduinoMainUdp.cpp
index 18d3c591fe..4c43872dc5 100644
--- a/tests/host/common/ArduinoMainUdp.cpp
+++ b/tests/host/common/ArduinoMainUdp.cpp
@@ -35,7 +35,7 @@
 
 std::map<int, UdpContext*> udps;
 
-void register_udp(int sock, UdpContext* udp)
+void                       register_udp(int sock, UdpContext* udp)
 {
     if (udp)
         udps[sock] = udp;
@@ -49,7 +49,7 @@ void check_incoming_udp()
     for (auto& udp : udps)
     {
         pollfd p;
-        p.fd = udp.first;
+        p.fd     = udp.first;
         p.events = POLLIN;
         if (poll(&p, 1, 0) && p.revents == POLLIN)
         {
diff --git a/tests/host/common/ClientContextSocket.cpp b/tests/host/common/ClientContextSocket.cpp
index 34dcde16d8..4586969ca2 100644
--- a/tests/host/common/ClientContextSocket.cpp
+++ b/tests/host/common/ClientContextSocket.cpp
@@ -70,7 +70,7 @@ int mockConnect(uint32_t ipv4, int& sock, int port)
         return 0;
     }
     server.sin_family = AF_INET;
-    server.sin_port = htons(port);
+    server.sin_port   = htons(port);
     memcpy(&server.sin_addr, &ipv4, 4);
     if (::connect(sock, (struct sockaddr*)&server, sizeof(server)) == -1)
     {
@@ -83,8 +83,8 @@ int mockConnect(uint32_t ipv4, int& sock, int port)
 
 ssize_t mockFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize)
 {
-    size_t maxread = CCBUFSIZE - ccinbufsize;
-    ssize_t ret = ::read(sock, ccinbuf + ccinbufsize, maxread);
+    size_t  maxread = CCBUFSIZE - ccinbufsize;
+    ssize_t ret     = ::read(sock, ccinbuf + ccinbufsize, maxread);
 
     if (ret == 0)
     {
@@ -116,7 +116,7 @@ ssize_t mockPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char
         mockverbose("CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
 
     struct pollfd p;
-    size_t retsize = 0;
+    size_t        retsize = 0;
     do
     {
         if (usersize && usersize <= ccinbufsize)
@@ -144,7 +144,7 @@ ssize_t mockPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char
         }
 
         // wait for more data until timeout
-        p.fd = sock;
+        p.fd     = sock;
         p.events = POLLIN;
     } while (poll(&p, 1, timeout_ms) == 1);
 
@@ -173,9 +173,9 @@ ssize_t mockWrite(int sock, const uint8_t* data, size_t size, int timeout_ms)
     while (sent < size)
     {
         struct pollfd p;
-        p.fd = sock;
+        p.fd     = sock;
         p.events = POLLOUT;
-        int ret = poll(&p, 1, timeout_ms);
+        int ret  = poll(&p, 1, timeout_ms);
         if (ret == -1)
         {
             fprintf(stderr, MOCK "ClientContext::write(%d): %s\n", sock, strerror(errno));
diff --git a/tests/host/common/ClientContextTools.cpp b/tests/host/common/ClientContextTools.cpp
index b3236d9f41..4e2abc31b4 100644
--- a/tests/host/common/ClientContextTools.cpp
+++ b/tests/host/common/ClientContextTools.cpp
@@ -49,7 +49,7 @@ err_t dns_gethostbyname(const char* hostname, ip_addr_t* addr, dns_found_callbac
 }
 
 static struct tcp_pcb mock_tcp_pcb;
-tcp_pcb* tcp_new(void)
+tcp_pcb*              tcp_new(void)
 {
     // this is useless
     // ClientContext is setting the source port and we don't care here
diff --git a/tests/host/common/EEPROM.h b/tests/host/common/EEPROM.h
index 3a30906ec4..ec031c2b33 100644
--- a/tests/host/common/EEPROM.h
+++ b/tests/host/common/EEPROM.h
@@ -39,11 +39,11 @@ class EEPROMClass
     EEPROMClass(void);
     ~EEPROMClass();
 
-    void begin(size_t size);
+    void    begin(size_t size);
     uint8_t read(int address);
-    void write(int address, uint8_t val);
-    bool commit();
-    void end();
+    void    write(int address, uint8_t val);
+    bool    commit();
+    void    end();
 
     template <typename T>
     T& get(int const address, T& t)
@@ -65,14 +65,14 @@ class EEPROMClass
         return t;
     }
 
-    size_t length() { return _size; }
+    size_t  length() { return _size; }
 
     //uint8_t& operator[](int const address) { return read(address); }
     uint8_t operator[](int address) { return read(address); }
 
 protected:
     size_t _size = 0;
-    int _fd = -1;
+    int    _fd   = -1;
 };
 
 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_EEPROM)
diff --git a/tests/host/common/MockDigital.cpp b/tests/host/common/MockDigital.cpp
index 0820ea63f1..8ccc4d1095 100644
--- a/tests/host/common/MockDigital.cpp
+++ b/tests/host/common/MockDigital.cpp
@@ -33,7 +33,7 @@ extern "C"
     static uint8_t _mode[17];
     static uint8_t _gpio[17];
 
-    extern void pinMode(uint8_t pin, uint8_t mode)
+    extern void    pinMode(uint8_t pin, uint8_t mode)
     {
         if (pin < 17)
         {
diff --git a/tests/host/common/MockEEPROM.cpp b/tests/host/common/MockEEPROM.cpp
index 5dcb0ac18a..f9a7ca2db5 100644
--- a/tests/host/common/MockEEPROM.cpp
+++ b/tests/host/common/MockEEPROM.cpp
@@ -55,7 +55,8 @@ EEPROMClass::~EEPROMClass()
 void EEPROMClass::begin(size_t size)
 {
     _size = size;
-    if ((_fd = open(EEPROM_FILE_NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1 || ftruncate(_fd, size) == -1)
+    if ((_fd = open(EEPROM_FILE_NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1
+        || ftruncate(_fd, size) == -1)
     {
         fprintf(stderr, MOCK "EEPROM: cannot open/create '%s' for r/w: %s\n\r", EEPROM_FILE_NAME, strerror(errno));
         _fd = -1;
diff --git a/tests/host/common/MockEsp.cpp b/tests/host/common/MockEsp.cpp
index 29e2653965..f2a426331b 100644
--- a/tests/host/common/MockEsp.cpp
+++ b/tests/host/common/MockEsp.cpp
@@ -83,14 +83,14 @@ unsigned long long operator"" _GB(unsigned long long x)
 
 uint32_t _SPIFFS_start;
 
-void eboot_command_write(struct eboot_command* cmd)
+void     eboot_command_write(struct eboot_command* cmd)
 {
     (void)cmd;
 }
 
 EspClass ESP;
 
-void EspClass::restart()
+void     EspClass::restart()
 {
     mockverbose("Esp.restart(): exiting\n");
     exit(EXIT_SUCCESS);
@@ -145,7 +145,7 @@ uint32_t EspClass::getFlashChipSpeed()
 void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag)
 {
     uint32_t hf = 10 * 1024;
-    float hm = 1 * 1024;
+    float    hm = 1 * 1024;
 
     if (hfree)
         *hfree = hf;
diff --git a/tests/host/common/MockTools.cpp b/tests/host/common/MockTools.cpp
index e291486c5f..894c87b65e 100644
--- a/tests/host/common/MockTools.cpp
+++ b/tests/host/common/MockTools.cpp
@@ -39,11 +39,11 @@ extern "C"
     uint32_t lwip_ntohl(uint32_t netlong) { return ntohl(netlong); }
     uint16_t lwip_ntohs(uint16_t netshort) { return ntohs(netshort); }
 
-    char* ets_strcpy(char* d, const char* s) { return strcpy(d, s); }
-    char* ets_strncpy(char* d, const char* s, size_t n) { return strncpy(d, s, n); }
-    size_t ets_strlen(const char* s) { return strlen(s); }
+    char*    ets_strcpy(char* d, const char* s) { return strcpy(d, s); }
+    char*    ets_strncpy(char* d, const char* s, size_t n) { return strncpy(d, s, n); }
+    size_t   ets_strlen(const char* s) { return strlen(s); }
 
-    int ets_printf(const char* fmt, ...)
+    int      ets_printf(const char* fmt, ...)
     {
         va_list ap;
         va_start(ap, fmt);
@@ -52,23 +52,23 @@ extern "C"
         return len;
     }
 
-    void stack_thunk_add_ref() { }
-    void stack_thunk_del_ref() { }
-    void stack_thunk_repaint() { }
+    void     stack_thunk_add_ref() { }
+    void     stack_thunk_del_ref() { }
+    void     stack_thunk_repaint() { }
 
     uint32_t stack_thunk_get_refcnt() { return 0; }
     uint32_t stack_thunk_get_stack_top() { return 0; }
     uint32_t stack_thunk_get_stack_bot() { return 0; }
     uint32_t stack_thunk_get_cont_sp() { return 0; }
     uint32_t stack_thunk_get_max_usage() { return 0; }
-    void stack_thunk_dump_stack() { }
+    void     stack_thunk_dump_stack() { }
 
 // Thunking macro
 #define make_stack_thunk(fcnToThunk)
 };
 
 void configTime(int timezone, int daylightOffset_sec,
-    const char* server1, const char* server2, const char* server3)
+                const char* server1, const char* server2, const char* server3)
 {
     (void)server1;
     (void)server2;
diff --git a/tests/host/common/MockUART.cpp b/tests/host/common/MockUART.cpp
index b87ea3b0f9..d055e95d36 100644
--- a/tests/host/common/MockUART.cpp
+++ b/tests/host/common/MockUART.cpp
@@ -39,27 +39,27 @@
 
 extern "C"
 {
-    bool blocking_uart = true;  // system default
+    bool           blocking_uart   = true;  // system default
 
-    static int s_uart_debug_nr = UART1;
+    static int     s_uart_debug_nr = UART1;
 
-    static uart_t* UART[2] = { NULL, NULL };
+    static uart_t* UART[2]         = { NULL, NULL };
 
     struct uart_rx_buffer_
     {
-        size_t size;
-        size_t rpos;
-        size_t wpos;
+        size_t   size;
+        size_t   rpos;
+        size_t   wpos;
         uint8_t* buffer;
     };
 
     struct uart_
     {
-        int uart_nr;
-        int baud_rate;
-        bool rx_enabled;
-        bool tx_enabled;
-        bool rx_overrun;
+        int                     uart_nr;
+        int                     baud_rate;
+        bool                    rx_enabled;
+        bool                    tx_enabled;
+        bool                    rx_overrun;
         struct uart_rx_buffer_* rx_buffer;
     };
 
@@ -77,7 +77,7 @@ extern "C"
             {
                 if (w)
                 {
-                    FILE* out = uart_nr == UART0 ? stdout : stderr;
+                    FILE*   out = uart_nr == UART0 ? stdout : stderr;
                     timeval tv;
                     gettimeofday(&tv, nullptr);
                     const tm* tm = localtime(&tv.tv_sec);
@@ -103,7 +103,7 @@ extern "C"
     {
         struct uart_rx_buffer_* rx_buffer = uart->rx_buffer;
 
-        size_t nextPos = (rx_buffer->wpos + 1) % rx_buffer->size;
+        size_t                  nextPos   = (rx_buffer->wpos + 1) % rx_buffer->size;
         if (nextPos == rx_buffer->rpos)
         {
             uart->rx_overrun = true;
@@ -115,7 +115,7 @@ extern "C"
 #endif
         }
         rx_buffer->buffer[rx_buffer->wpos] = data;
-        rx_buffer->wpos = nextPos;
+        rx_buffer->wpos                    = nextPos;
     }
 
     // insert a new byte into the RX FIFO nuffer
@@ -150,7 +150,7 @@ extern "C"
         if (uart_rx_available_unsafe(uart->rx_buffer))
         {
             // take oldest sw data
-            int ret = uart->rx_buffer->buffer[uart->rx_buffer->rpos];
+            int ret               = uart->rx_buffer->buffer[uart->rx_buffer->rpos];
             uart->rx_buffer->rpos = (uart->rx_buffer->rpos + 1) % uart->rx_buffer->size;
             return ret;
         }
@@ -238,10 +238,10 @@ extern "C"
         if (new_wpos == new_size)
             new_wpos = 0;
 
-        uint8_t* old_buf = uart->rx_buffer->buffer;
-        uart->rx_buffer->rpos = 0;
-        uart->rx_buffer->wpos = new_wpos;
-        uart->rx_buffer->size = new_size;
+        uint8_t* old_buf        = uart->rx_buffer->buffer;
+        uart->rx_buffer->rpos   = 0;
+        uart->rx_buffer->wpos   = new_wpos;
+        uart->rx_buffer->size   = new_size;
         uart->rx_buffer->buffer = new_buf;
         free(old_buf);
         return uart->rx_buffer->size;
@@ -270,7 +270,7 @@ extern "C"
         if (uart == NULL || !uart->tx_enabled)
             return 0;
 
-        size_t ret = size;
+        size_t    ret     = size;
         const int uart_nr = uart->uart_nr;
         while (size--)
             uart_do_write_char(uart_nr, *buf++);
@@ -327,9 +327,9 @@ extern "C"
     uint8_t
     uart_get_bit_length(const int uart_nr)
     {
-        uint8_t width = ((uart_nr % 16) >> 2) + 5;
+        uint8_t width  = ((uart_nr % 16) >> 2) + 5;
         uint8_t parity = (uart_nr >> 5) + 1;
-        uint8_t stop = uart_nr % 4;
+        uint8_t stop   = uart_nr % 4;
         return (width + parity + stop + 1);
     }
 
@@ -343,7 +343,7 @@ extern "C"
         if (uart == NULL)
             return NULL;
 
-        uart->uart_nr = uart_nr;
+        uart->uart_nr    = uart_nr;
         uart->rx_overrun = false;
 
         switch (uart->uart_nr)
@@ -359,9 +359,9 @@ extern "C"
                     free(uart);
                     return NULL;
                 }
-                rx_buffer->size = rx_size;  //var this
-                rx_buffer->rpos = 0;
-                rx_buffer->wpos = 0;
+                rx_buffer->size   = rx_size;  //var this
+                rx_buffer->rpos   = 0;
+                rx_buffer->wpos   = 0;
                 rx_buffer->buffer = (uint8_t*)malloc(rx_buffer->size);
                 if (rx_buffer->buffer == NULL)
                 {
@@ -494,9 +494,9 @@ extern "C"
     }
 };
 
-size_t uart_peek_available(uart_t* uart) { return 0; }
+size_t      uart_peek_available(uart_t* uart) { return 0; }
 const char* uart_peek_buffer(uart_t* uart) { return nullptr; }
-void uart_peek_consume(uart_t* uart, size_t consume)
+void        uart_peek_consume(uart_t* uart, size_t consume)
 {
     (void)uart;
     (void)consume;
diff --git a/tests/host/common/MockWiFiServerSocket.cpp b/tests/host/common/MockWiFiServerSocket.cpp
index aee0ad817e..c5e1e6b662 100644
--- a/tests/host/common/MockWiFiServerSocket.cpp
+++ b/tests/host/common/MockWiFiServerSocket.cpp
@@ -46,8 +46,8 @@
 
 int serverAccept(int srvsock)
 {
-    int clisock;
-    socklen_t n;
+    int                clisock;
+    socklen_t          n;
     struct sockaddr_in client;
     n = sizeof(client);
     if ((clisock = accept(srvsock, (struct sockaddr*)&client, &n)) == -1)
@@ -73,8 +73,8 @@ void WiFiServer::begin(uint16_t port, uint8_t backlog)
 
 void WiFiServer::begin()
 {
-    int sock;
-    int mockport;
+    int                sock;
+    int                mockport;
     struct sockaddr_in server;
 
     mockport = _port;
@@ -99,8 +99,8 @@ void WiFiServer::begin()
         exit(EXIT_FAILURE);
     }
 
-    server.sin_family = AF_INET;
-    server.sin_port = htons(mockport);
+    server.sin_family      = AF_INET;
+    server.sin_port        = htons(mockport);
     server.sin_addr.s_addr = htonl(global_source_address);
     if (bind(sock, (struct sockaddr*)&server, sizeof(server)) == -1)
     {
@@ -121,7 +121,7 @@ void WiFiServer::begin()
 bool WiFiServer::hasClient()
 {
     struct pollfd p;
-    p.fd = pcb2int(_listen_pcb);
+    p.fd     = pcb2int(_listen_pcb);
     p.events = POLLIN;
     return poll(&p, 1, 0) && p.revents == POLLIN;
 }
diff --git a/tests/host/common/MocklwIP.cpp b/tests/host/common/MocklwIP.cpp
index 0b5dfa502b..387b71b326 100644
--- a/tests/host/common/MocklwIP.cpp
+++ b/tests/host/common/MocklwIP.cpp
@@ -9,9 +9,9 @@ extern "C"
 {
     extern netif netif0;
 
-    netif* netif_list = &netif0;
+    netif*       netif_list = &netif0;
 
-    err_t dhcp_renew(struct netif* netif)
+    err_t        dhcp_renew(struct netif* netif)
     {
         (void)netif;
         return ERR_OK;
diff --git a/tests/host/common/UdpContextSocket.cpp b/tests/host/common/UdpContextSocket.cpp
index 0b8a17a706..0b2d1760ed 100644
--- a/tests/host/common/UdpContextSocket.cpp
+++ b/tests/host/common/UdpContextSocket.cpp
@@ -79,7 +79,7 @@ bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
     (void)dstaddr;
     //servaddr.sin_addr.s_addr = htonl(global_source_address);
     servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
-    servaddr.sin_port = htons(mockport);
+    servaddr.sin_port        = htons(mockport);
 
     // Bind the socket with the server address
     if (bind(sock, (const struct sockaddr*)&servaddr, sizeof(servaddr)) < 0)
@@ -130,10 +130,10 @@ bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
 size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port)
 {
     struct sockaddr_storage addrbuf;
-    socklen_t addrbufsize = std::min((socklen_t)sizeof(addrbuf), (socklen_t)16);
+    socklen_t               addrbufsize = std::min((socklen_t)sizeof(addrbuf), (socklen_t)16);
 
-    size_t maxread = CCBUFSIZE - ccinbufsize;
-    ssize_t ret = ::recvfrom(sock, ccinbuf + ccinbufsize, maxread, 0 /*flags*/, (sockaddr*)&addrbuf, &addrbufsize);
+    size_t                  maxread     = CCBUFSIZE - ccinbufsize;
+    ssize_t                 ret         = ::recvfrom(sock, ccinbuf + ccinbufsize, maxread, 0 /*flags*/, (sockaddr*)&addrbuf, &addrbufsize);
     if (ret == -1)
     {
         if (errno != EAGAIN)
@@ -194,10 +194,10 @@ size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms,
     (void)timeout_ms;
     // Filling server information
     struct sockaddr_in peer;
-    peer.sin_family = AF_INET;
+    peer.sin_family      = AF_INET;
     peer.sin_addr.s_addr = ipv4;  //XXFIXME should use lwip_htonl?
-    peer.sin_port = htons(port);
-    int ret = ::sendto(sock, data, size, 0 /*flags*/, (const sockaddr*)&peer, sizeof(peer));
+    peer.sin_port        = htons(port);
+    int ret              = ::sendto(sock, data, size, 0 /*flags*/, (const sockaddr*)&peer, sizeof(peer));
     if (ret == -1)
     {
         fprintf(stderr, MOCK "UDPContext::write: write(%d): %s\n", sock, strerror(errno));
diff --git a/tests/host/common/c_types.h b/tests/host/common/c_types.h
index f8a665ee91..a89736f109 100644
--- a/tests/host/common/c_types.h
+++ b/tests/host/common/c_types.h
@@ -36,34 +36,34 @@
 #include <stdarg.h>
 #include <sys/cdefs.h>
 
-typedef signed char sint8_t;
-typedef signed short sint16_t;
-typedef signed long sint32_t;
-typedef signed long long sint64_t;
+typedef signed char        sint8_t;
+typedef signed short       sint16_t;
+typedef signed long        sint32_t;
+typedef signed long long   sint64_t;
 // CONFLICT typedef unsigned long long  u_int64_t;
-typedef float real32_t;
-typedef double real64_t;
+typedef float              real32_t;
+typedef double             real64_t;
 
 // CONFLICT typedef unsigned char       uint8;
-typedef unsigned char u8;
-typedef signed char sint8;
-typedef signed char int8;
-typedef signed char s8;
-typedef unsigned short uint16;
-typedef unsigned short u16;
-typedef signed short sint16;
-typedef signed short s16;
+typedef unsigned char      u8;
+typedef signed char        sint8;
+typedef signed char        int8;
+typedef signed char        s8;
+typedef unsigned short     uint16;
+typedef unsigned short     u16;
+typedef signed short       sint16;
+typedef signed short       s16;
 // CONFLICT typedef unsigned int        uint32;
-typedef unsigned int u_int;
-typedef unsigned int u32;
-typedef signed int sint32;
-typedef signed int s32;
-typedef int int32;
-typedef signed long long sint64;
+typedef unsigned int       u_int;
+typedef unsigned int       u32;
+typedef signed int         sint32;
+typedef signed int         s32;
+typedef int                int32;
+typedef signed long long   sint64;
 typedef unsigned long long uint64;
 typedef unsigned long long u64;
-typedef float real32;
-typedef double real64;
+typedef float              real32;
+typedef double             real64;
 
 #define __le16 u16
 
diff --git a/tests/host/common/flash_hal_mock.cpp b/tests/host/common/flash_hal_mock.cpp
index e4d912bd77..65d7c4d355 100644
--- a/tests/host/common/flash_hal_mock.cpp
+++ b/tests/host/common/flash_hal_mock.cpp
@@ -5,11 +5,11 @@
 
 extern "C"
 {
-    uint32_t s_phys_addr = 0;
-    uint32_t s_phys_size = 0;
-    uint32_t s_phys_page = 0;
+    uint32_t s_phys_addr  = 0;
+    uint32_t s_phys_size  = 0;
+    uint32_t s_phys_page  = 0;
     uint32_t s_phys_block = 0;
-    uint8_t* s_phys_data = nullptr;
+    uint8_t* s_phys_data  = nullptr;
 }
 
 int32_t flash_hal_read(uint32_t addr, uint32_t size, uint8_t* dst)
@@ -30,7 +30,7 @@ int32_t flash_hal_erase(uint32_t addr, uint32_t size)
     {
         abort();
     }
-    const uint32_t sector = addr / FLASH_SECTOR_SIZE;
+    const uint32_t sector      = addr / FLASH_SECTOR_SIZE;
     const uint32_t sectorCount = size / FLASH_SECTOR_SIZE;
     for (uint32_t i = 0; i < sectorCount; ++i)
     {
diff --git a/tests/host/common/include/ClientContext.h b/tests/host/common/include/ClientContext.h
index f10760aae4..1067334480 100644
--- a/tests/host/common/include/ClientContext.h
+++ b/tests/host/common/include/ClientContext.h
@@ -33,24 +33,16 @@ typedef void (*discard_cb_t)(void*, ClientContext*);
 class ClientContext
 {
 public:
-    ClientContext(tcp_pcb* pcb, discard_cb_t discard_cb, void* discard_cb_arg)
-        : _discard_cb(discard_cb)
-        , _discard_cb_arg(discard_cb_arg)
-        , _refcnt(0)
-        , _next(0)
-        , _sync(::getDefaultPrivateGlobalSyncValue())
-        , _sock(-1)
+    ClientContext(tcp_pcb* pcb, discard_cb_t discard_cb, void* discard_cb_arg) :
+        _discard_cb(discard_cb), _discard_cb_arg(discard_cb_arg), _refcnt(0), _next(0),
+        _sync(::getDefaultPrivateGlobalSyncValue()), _sock(-1)
     {
         (void)pcb;
     }
 
-    ClientContext(int sock)
-        : _discard_cb(nullptr)
-        , _discard_cb_arg(nullptr)
-        , _refcnt(0)
-        , _next(nullptr)
-        , _sync(::getDefaultPrivateGlobalSyncValue())
-        , _sock(sock)
+    ClientContext(int sock) :
+        _discard_cb(nullptr), _discard_cb_arg(nullptr), _refcnt(0), _next(nullptr),
+        _sync(::getDefaultPrivateGlobalSyncValue()), _sock(sock)
     {
     }
 
@@ -312,21 +304,21 @@ class ClientContext
     }
 
 private:
-    discard_cb_t _discard_cb = nullptr;
-    void* _discard_cb_arg = nullptr;
+    discard_cb_t   _discard_cb     = nullptr;
+    void*          _discard_cb_arg = nullptr;
 
-    int8_t _refcnt;
+    int8_t         _refcnt;
     ClientContext* _next;
 
-    bool _sync;
+    bool           _sync;
 
     // MOCK
 
-    int _sock = -1;
-    int _timeout_ms = 5000;
+    int            _sock       = -1;
+    int            _timeout_ms = 5000;
 
-    char _inbuf[CCBUFSIZE];
-    size_t _inbufsize = 0;
+    char           _inbuf[CCBUFSIZE];
+    size_t         _inbufsize = 0;
 };
 
 #endif  //CLIENTCONTEXT_H
diff --git a/tests/host/common/include/UdpContext.h b/tests/host/common/include/UdpContext.h
index a070108459..0b064b434f 100644
--- a/tests/host/common/include/UdpContext.h
+++ b/tests/host/common/include/UdpContext.h
@@ -39,9 +39,8 @@ class UdpContext
 public:
     typedef std::function<void(void)> rxhandler_t;
 
-    UdpContext()
-        : _on_rx(nullptr)
-        , _refcnt(0)
+    UdpContext() :
+        _on_rx(nullptr), _refcnt(0)
     {
         _sock = mockUDPSocket();
     }
@@ -65,7 +64,7 @@ class UdpContext
 
     bool connect(const ip_addr_t* addr, uint16_t port)
     {
-        _dst = *addr;
+        _dst     = *addr;
         _dstport = port;
         return true;
     }
@@ -218,10 +217,10 @@ class UdpContext
 
     err_t trySend(ip_addr_t* addr = 0, uint16_t port = 0, bool keepBuffer = true)
     {
-        uint32_t dst = addr ? addr->addr : _dst.addr;
+        uint32_t dst     = addr ? addr->addr : _dst.addr;
         uint16_t dstport = port ?: _dstport;
-        size_t wrt = mockUDPWrite(_sock, (const uint8_t*)_outbuf, _outbufsize, _timeout_ms, dst, dstport);
-        err_t ret = _outbufsize ? ERR_OK : ERR_ABRT;
+        size_t   wrt     = mockUDPWrite(_sock, (const uint8_t*)_outbuf, _outbufsize, _timeout_ms, dst, dstport);
+        err_t    ret     = _outbufsize ? ERR_OK : ERR_ABRT;
         if (!keepBuffer || wrt == _outbufsize)
             cancelBuffer();
         return ret;
@@ -238,9 +237,9 @@ class UdpContext
     }
 
     bool sendTimeout(ip_addr_t* addr, uint16_t port,
-        esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
+                     esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
     {
-        err_t err;
+        err_t                                 err;
         esp8266::polledTimeout::oneShotFastMs timeout(timeoutMs);
         while (((err = trySend(addr, port)) != ERR_OK) && !timeout)
             delay(0);
@@ -273,22 +272,22 @@ class UdpContext
             mockverbose("TODO unhandled udp address of size %d\n", (int)addrsize);
     }
 
-    int _sock = -1;
+    int         _sock = -1;
     rxhandler_t _on_rx;
-    int _refcnt = 0;
+    int         _refcnt = 0;
 
-    ip_addr_t _dst;
-    uint16_t _dstport;
+    ip_addr_t   _dst;
+    uint16_t    _dstport;
 
-    char _inbuf[CCBUFSIZE];
-    size_t _inbufsize = 0;
-    char _outbuf[CCBUFSIZE];
-    size_t _outbufsize = 0;
+    char        _inbuf[CCBUFSIZE];
+    size_t      _inbufsize = 0;
+    char        _outbuf[CCBUFSIZE];
+    size_t      _outbufsize = 0;
 
-    int _timeout_ms = 0;
+    int         _timeout_ms = 0;
 
-    uint8_t addrsize;
-    uint8_t addr[16];
+    uint8_t     addrsize;
+    uint8_t     addr[16];
 };
 
 extern "C" inline err_t igmp_joingroup(const ip4_addr_t* ifaddr, const ip4_addr_t* groupaddr)
diff --git a/tests/host/common/littlefs_mock.cpp b/tests/host/common/littlefs_mock.cpp
index ae5aa03be0..5110ebbf7b 100644
--- a/tests/host/common/littlefs_mock.cpp
+++ b/tests/host/common/littlefs_mock.cpp
@@ -46,11 +46,11 @@ LittleFSMock::LittleFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, con
     fprintf(stderr, "LittleFS: %zd bytes\n", fs_size);
 
     m_fs.resize(fs_size, 0xff);
-    s_phys_addr = 0;
-    s_phys_size = static_cast<uint32_t>(fs_size);
-    s_phys_page = static_cast<uint32_t>(fs_page);
+    s_phys_addr  = 0;
+    s_phys_size  = static_cast<uint32_t>(fs_size);
+    s_phys_page  = static_cast<uint32_t>(fs_page);
     s_phys_block = static_cast<uint32_t>(fs_block);
-    s_phys_data = m_fs.data();
+    s_phys_data  = m_fs.data();
     reset();
 }
 
@@ -63,11 +63,11 @@ void LittleFSMock::reset()
 LittleFSMock::~LittleFSMock()
 {
     save();
-    s_phys_addr = 0;
-    s_phys_size = 0;
-    s_phys_page = 0;
+    s_phys_addr  = 0;
+    s_phys_size  = 0;
+    s_phys_page  = 0;
     s_phys_block = 0;
-    s_phys_data = nullptr;
+    s_phys_data  = nullptr;
     m_fs.resize(0);
     LittleFS = FS(FSImplPtr(nullptr));
 }
diff --git a/tests/host/common/littlefs_mock.h b/tests/host/common/littlefs_mock.h
index 3d411c7027..794c36376c 100644
--- a/tests/host/common/littlefs_mock.h
+++ b/tests/host/common/littlefs_mock.h
@@ -35,12 +35,12 @@ class LittleFSMock
     ~LittleFSMock();
 
 protected:
-    void load();
-    void save();
+    void                 load();
+    void                 save();
 
     std::vector<uint8_t> m_fs;
-    String m_storage;
-    bool m_overwrite;
+    String               m_storage;
+    bool                 m_overwrite;
 };
 
 #define LITTLEFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage) LittleFSMock littlefs_mock(size_kb * 1024, block_kb * 1024, page_b, storage)
diff --git a/tests/host/common/md5.c b/tests/host/common/md5.c
index dfdb80fc80..762ad422a3 100644
--- a/tests/host/common/md5.c
+++ b/tests/host/common/md5.c
@@ -43,9 +43,9 @@
 
 typedef struct
 {
-    uint32_t state[4];  /* state (ABCD) */
-    uint32_t count[2];  /* number of bits, modulo 2^64 (lsb first) */
-    uint8_t buffer[64]; /* input buffer */
+    uint32_t state[4];   /* state (ABCD) */
+    uint32_t count[2];   /* number of bits, modulo 2^64 (lsb first) */
+    uint8_t  buffer[64]; /* input buffer */
 } MD5_CTX;
 
 /* Constants for MD5Transform routine.
@@ -68,9 +68,9 @@ typedef struct
 #define S44 21
 
 /* ----- static functions ----- */
-static void MD5Transform(uint32_t state[4], const uint8_t block[64]);
-static void Encode(uint8_t* output, uint32_t* input, uint32_t len);
-static void Decode(uint32_t* output, const uint8_t* input, uint32_t len);
+static void          MD5Transform(uint32_t state[4], const uint8_t block[64]);
+static void          Encode(uint8_t* output, uint32_t* input, uint32_t len);
+static void          Decode(uint32_t* output, const uint8_t* input, uint32_t len);
 
 static const uint8_t PADDING[64] = {
     0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -124,10 +124,10 @@ EXP_FUNC void STDCALL MD5Init(MD5_CTX* ctx)
 
     /* Load magic initialization constants.
      */
-    ctx->state[0] = 0x67452301;
-    ctx->state[1] = 0xefcdab89;
-    ctx->state[2] = 0x98badcfe;
-    ctx->state[3] = 0x10325476;
+    ctx->state[0]                 = 0x67452301;
+    ctx->state[1]                 = 0xefcdab89;
+    ctx->state[2]                 = 0x98badcfe;
+    ctx->state[3]                 = 0x10325476;
 }
 
 /**
@@ -136,7 +136,7 @@ EXP_FUNC void STDCALL MD5Init(MD5_CTX* ctx)
 EXP_FUNC void STDCALL MD5Update(MD5_CTX* ctx, const uint8_t* msg, int len)
 {
     uint32_t x;
-    int i, partLen;
+    int      i, partLen;
 
     /* Compute number of bytes mod 64 */
     x = (uint32_t)((ctx->count[0] >> 3) & 0x3F);
@@ -171,7 +171,7 @@ EXP_FUNC void STDCALL MD5Update(MD5_CTX* ctx, const uint8_t* msg, int len)
  */
 EXP_FUNC void STDCALL MD5Final(uint8_t* digest, MD5_CTX* ctx)
 {
-    uint8_t bits[8];
+    uint8_t  bits[8];
     uint32_t x, padLen;
 
     /* Save number of bits */
@@ -179,7 +179,7 @@ EXP_FUNC void STDCALL MD5Final(uint8_t* digest, MD5_CTX* ctx)
 
     /* Pad out to 56 mod 64.
      */
-    x = (uint32_t)((ctx->count[0] >> 3) & 0x3f);
+    x      = (uint32_t)((ctx->count[0] >> 3) & 0x3f);
     padLen = (x < 56) ? (56 - x) : (120 - x);
     MD5Update(ctx, PADDING, padLen);
 
@@ -288,7 +288,7 @@ static void Encode(uint8_t* output, uint32_t* input, uint32_t len)
 
     for (i = 0, j = 0; j < len; i++, j += 4)
     {
-        output[j] = (uint8_t)(input[i] & 0xff);
+        output[j]     = (uint8_t)(input[i] & 0xff);
         output[j + 1] = (uint8_t)((input[i] >> 8) & 0xff);
         output[j + 2] = (uint8_t)((input[i] >> 16) & 0xff);
         output[j + 3] = (uint8_t)((input[i] >> 24) & 0xff);
diff --git a/tests/host/common/mock.h b/tests/host/common/mock.h
index c9a6493468..149d1fe43d 100644
--- a/tests/host/common/mock.h
+++ b/tests/host/common/mock.h
@@ -61,8 +61,8 @@ extern "C"
 {
 #endif
     // TODO: #include <stdlib_noniso.h> ?
-    char* itoa(int val, char* s, int radix);
-    char* ltoa(long val, char* s, int radix);
+    char*  itoa(int val, char* s, int radix);
+    char*  ltoa(long val, char* s, int radix);
 
     size_t strlcat(char* dst, const char* src, size_t size);
     size_t strlcpy(char* dst, const char* src, size_t size);
@@ -74,7 +74,7 @@ extern "C"
 // exotic typedefs used in the sdk
 
 #include <stdint.h>
-typedef uint8_t uint8;
+typedef uint8_t  uint8;
 typedef uint32_t uint32;
 
 //
@@ -109,18 +109,18 @@ extern "C"
         putchar(c);
     }
 
-    int mockverbose(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
+    int                mockverbose(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
 
     extern const char* host_interface;  // cmdline parameter
-    extern bool serial_timestamp;
-    extern int mock_port_shifter;
-    extern bool blocking_uart;
-    extern uint32_t global_source_address;  // 0 = INADDR_ANY by default
+    extern bool        serial_timestamp;
+    extern int         mock_port_shifter;
+    extern bool        blocking_uart;
+    extern uint32_t    global_source_address;  // 0 = INADDR_ANY by default
 
 #define NO_GLOBAL_BINDING 0xffffffff
     extern uint32_t global_ipv4_netfmt;  // selected interface addresse to bind to
 
-    void loop_end();
+    void            loop_end();
 
 #ifdef __cplusplus
 }
@@ -145,23 +145,23 @@ extern "C"
 #endif
 
 // tcp
-int mockSockSetup(int sock);
-int mockConnect(uint32_t addr, int& sock, int port);
+int     mockSockSetup(int sock);
+int     mockConnect(uint32_t addr, int& sock, int port);
 ssize_t mockFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize);
 ssize_t mockPeekBytes(int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
 ssize_t mockRead(int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
 ssize_t mockWrite(int sock, const uint8_t* data, size_t size, int timeout_ms);
-int serverAccept(int sock);
+int     serverAccept(int sock);
 
 // udp
-void check_incoming_udp();
-int mockUDPSocket();
-bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast = 0);
-size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port);
-size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
-size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
-size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port);
-void mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize);
+void    check_incoming_udp();
+int     mockUDPSocket();
+bool    mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast = 0);
+size_t  mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port);
+size_t  mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
+size_t  mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
+size_t  mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port);
+void    mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize);
 
 class UdpContext;
 void register_udp(int sock, UdpContext* udp = nullptr);
diff --git a/tests/host/common/noniso.c b/tests/host/common/noniso.c
index 19343a5728..e1ed3f1b67 100644
--- a/tests/host/common/noniso.c
+++ b/tests/host/common/noniso.c
@@ -27,8 +27,8 @@ void reverse(char* begin, char* end)
     while (is < ie)
     {
         char tmp = *ie;
-        *ie = *is;
-        *is = tmp;
+        *ie      = *is;
+        *is      = tmp;
         ++is;
         --ie;
     }
@@ -42,13 +42,13 @@ char* utoa(unsigned value, char* result, int base)
         return result;
     }
 
-    char* out = result;
+    char*    out      = result;
     unsigned quotient = value;
 
     do
     {
         const unsigned tmp = quotient / base;
-        *out = "0123456789abcdef"[quotient - (tmp * base)];
+        *out               = "0123456789abcdef"[quotient - (tmp * base)];
         ++out;
         quotient = tmp;
     } while (quotient);
@@ -70,13 +70,13 @@ char* itoa(int value, char* result, int base)
         return utoa((unsigned)value, result, base);
     }
 
-    char* out = result;
-    int quotient = abs(value);
+    char* out      = result;
+    int   quotient = abs(value);
 
     do
     {
         const int tmp = quotient / base;
-        *out = "0123456789abcdef"[quotient - (tmp * base)];
+        *out          = "0123456789abcdef"[quotient - (tmp * base)];
         ++out;
         quotient = tmp;
     } while (quotient);
diff --git a/tests/host/common/queue.h b/tests/host/common/queue.h
index c1d8f7151a..638961efdb 100644
--- a/tests/host/common/queue.h
+++ b/tests/host/common/queue.h
@@ -141,18 +141,18 @@
         SLIST_FIRST((head)) = NULL; \
     } while (0)
 
-#define SLIST_INSERT_AFTER(slistelm, elm, field)                  \
-    do                                                            \
-    {                                                             \
-        SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \
-        SLIST_NEXT((slistelm), field) = (elm);                    \
+#define SLIST_INSERT_AFTER(slistelm, elm, field)                       \
+    do                                                                 \
+    {                                                                  \
+        SLIST_NEXT((elm), field)      = SLIST_NEXT((slistelm), field); \
+        SLIST_NEXT((slistelm), field) = (elm);                         \
     } while (0)
 
 #define SLIST_INSERT_HEAD(head, elm, field)             \
     do                                                  \
     {                                                   \
         SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
-        SLIST_FIRST((head)) = (elm);                    \
+        SLIST_FIRST((head))      = (elm);               \
     } while (0)
 
 #define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
@@ -182,11 +182,11 @@
 /*
  * Singly-linked Tail queue declarations.
  */
-#define STAILQ_HEAD(name, type)                                  \
-    struct name                                                  \
-    {                                                            \
-        struct type* stqh_first; /* first element */             \
-        struct type** stqh_last; /* addr of last next element */ \
+#define STAILQ_HEAD(name, type)                                   \
+    struct name                                                   \
+    {                                                             \
+        struct type*  stqh_first; /* first element */             \
+        struct type** stqh_last;  /* addr of last next element */ \
     }
 
 #define STAILQ_HEAD_INITIALIZER(head) \
@@ -209,7 +209,7 @@
         if (!STAILQ_EMPTY((head2)))                    \
         {                                              \
             *(head1)->stqh_last = (head2)->stqh_first; \
-            (head1)->stqh_last = (head2)->stqh_last;   \
+            (head1)->stqh_last  = (head2)->stqh_last;  \
             STAILQ_INIT((head2));                      \
         }                                              \
     } while (0)
@@ -223,11 +223,11 @@
          (var);                          \
          (var) = STAILQ_NEXT((var), field))
 
-#define STAILQ_INIT(head)                          \
-    do                                             \
-    {                                              \
-        STAILQ_FIRST((head)) = NULL;               \
-        (head)->stqh_last = &STAILQ_FIRST((head)); \
+#define STAILQ_INIT(head)                             \
+    do                                                \
+    {                                                 \
+        STAILQ_FIRST((head)) = NULL;                  \
+        (head)->stqh_last    = &STAILQ_FIRST((head)); \
     } while (0)
 
 #define STAILQ_INSERT_AFTER(head, tqelm, elm, field)                           \
@@ -246,12 +246,12 @@
         STAILQ_FIRST((head)) = (elm);                                   \
     } while (0)
 
-#define STAILQ_INSERT_TAIL(head, elm, field)            \
-    do                                                  \
-    {                                                   \
-        STAILQ_NEXT((elm), field) = NULL;               \
-        *(head)->stqh_last = (elm);                     \
-        (head)->stqh_last = &STAILQ_NEXT((elm), field); \
+#define STAILQ_INSERT_TAIL(head, elm, field)                    \
+    do                                                          \
+    {                                                           \
+        STAILQ_NEXT((elm), field) = NULL;                       \
+        *(head)->stqh_last        = (elm);                      \
+        (head)->stqh_last         = &STAILQ_NEXT((elm), field); \
     } while (0)
 
 #define STAILQ_LAST(head, type, field) \
@@ -307,7 +307,7 @@
 #define LIST_ENTRY(type)                                              \
     struct                                                            \
     {                                                                 \
-        struct type* le_next;  /* next element */                     \
+        struct type*  le_next; /* next element */                     \
         struct type** le_prev; /* address of previous next element */ \
     }
 
@@ -336,16 +336,16 @@
         if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)       \
             LIST_NEXT((listelm), field)->field.le_prev = &LIST_NEXT((elm), field); \
         LIST_NEXT((listelm), field) = (elm);                                       \
-        (elm)->field.le_prev = &LIST_NEXT((listelm), field);                       \
+        (elm)->field.le_prev        = &LIST_NEXT((listelm), field);                \
     } while (0)
 
-#define LIST_INSERT_BEFORE(listelm, elm, field)              \
-    do                                                       \
-    {                                                        \
-        (elm)->field.le_prev = (listelm)->field.le_prev;     \
-        LIST_NEXT((elm), field) = (listelm);                 \
-        *(listelm)->field.le_prev = (elm);                   \
-        (listelm)->field.le_prev = &LIST_NEXT((elm), field); \
+#define LIST_INSERT_BEFORE(listelm, elm, field)               \
+    do                                                        \
+    {                                                         \
+        (elm)->field.le_prev      = (listelm)->field.le_prev; \
+        LIST_NEXT((elm), field)   = (listelm);                \
+        *(listelm)->field.le_prev = (elm);                    \
+        (listelm)->field.le_prev  = &LIST_NEXT((elm), field); \
     } while (0)
 
 #define LIST_INSERT_HEAD(head, elm, field)                                \
@@ -353,7 +353,7 @@
     {                                                                     \
         if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL)       \
             LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field); \
-        LIST_FIRST((head)) = (elm);                                       \
+        LIST_FIRST((head))   = (elm);                                     \
         (elm)->field.le_prev = &LIST_FIRST((head));                       \
     } while (0)
 
@@ -370,11 +370,11 @@
 /*
  * Tail queue declarations.
  */
-#define TAILQ_HEAD(name, type)                                  \
-    struct name                                                 \
-    {                                                           \
-        struct type* tqh_first; /* first element */             \
-        struct type** tqh_last; /* addr of last next element */ \
+#define TAILQ_HEAD(name, type)                                   \
+    struct name                                                  \
+    {                                                            \
+        struct type*  tqh_first; /* first element */             \
+        struct type** tqh_last;  /* addr of last next element */ \
     }
 
 #define TAILQ_HEAD_INITIALIZER(head) \
@@ -385,23 +385,23 @@
 #define TAILQ_ENTRY(type)                                              \
     struct                                                             \
     {                                                                  \
-        struct type* tqe_next;  /* next element */                     \
+        struct type*  tqe_next; /* next element */                     \
         struct type** tqe_prev; /* address of previous next element */ \
     }
 
 /*
  * Tail queue functions.
  */
-#define TAILQ_CONCAT(head1, head2, field)                           \
-    do                                                              \
-    {                                                               \
-        if (!TAILQ_EMPTY(head2))                                    \
-        {                                                           \
-            *(head1)->tqh_last = (head2)->tqh_first;                \
-            (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
-            (head1)->tqh_last = (head2)->tqh_last;                  \
-            TAILQ_INIT((head2));                                    \
-        }                                                           \
+#define TAILQ_CONCAT(head1, head2, field)                            \
+    do                                                               \
+    {                                                                \
+        if (!TAILQ_EMPTY(head2))                                     \
+        {                                                            \
+            *(head1)->tqh_last                 = (head2)->tqh_first; \
+            (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last;  \
+            (head1)->tqh_last                  = (head2)->tqh_last;  \
+            TAILQ_INIT((head2));                                     \
+        }                                                            \
     } while (0)
 
 #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
@@ -418,11 +418,11 @@
          (var);                                           \
          (var) = TAILQ_PREV((var), headname, field))
 
-#define TAILQ_INIT(head)                         \
-    do                                           \
-    {                                            \
-        TAILQ_FIRST((head)) = NULL;              \
-        (head)->tqh_last = &TAILQ_FIRST((head)); \
+#define TAILQ_INIT(head)                            \
+    do                                              \
+    {                                               \
+        TAILQ_FIRST((head)) = NULL;                 \
+        (head)->tqh_last    = &TAILQ_FIRST((head)); \
     } while (0)
 
 #define TAILQ_INSERT_AFTER(head, listelm, elm, field)                             \
@@ -433,16 +433,16 @@
         else                                                                      \
             (head)->tqh_last = &TAILQ_NEXT((elm), field);                         \
         TAILQ_NEXT((listelm), field) = (elm);                                     \
-        (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field);                    \
+        (elm)->field.tqe_prev        = &TAILQ_NEXT((listelm), field);             \
     } while (0)
 
-#define TAILQ_INSERT_BEFORE(listelm, elm, field)               \
-    do                                                         \
-    {                                                          \
-        (elm)->field.tqe_prev = (listelm)->field.tqe_prev;     \
-        TAILQ_NEXT((elm), field) = (listelm);                  \
-        *(listelm)->field.tqe_prev = (elm);                    \
-        (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
+#define TAILQ_INSERT_BEFORE(listelm, elm, field)                \
+    do                                                          \
+    {                                                           \
+        (elm)->field.tqe_prev      = (listelm)->field.tqe_prev; \
+        TAILQ_NEXT((elm), field)   = (listelm);                 \
+        *(listelm)->field.tqe_prev = (elm);                     \
+        (listelm)->field.tqe_prev  = &TAILQ_NEXT((elm), field); \
     } while (0)
 
 #define TAILQ_INSERT_HEAD(head, elm, field)                                  \
@@ -452,17 +452,17 @@
             TAILQ_FIRST((head))->field.tqe_prev = &TAILQ_NEXT((elm), field); \
         else                                                                 \
             (head)->tqh_last = &TAILQ_NEXT((elm), field);                    \
-        TAILQ_FIRST((head)) = (elm);                                         \
+        TAILQ_FIRST((head))   = (elm);                                       \
         (elm)->field.tqe_prev = &TAILQ_FIRST((head));                        \
     } while (0)
 
-#define TAILQ_INSERT_TAIL(head, elm, field)           \
-    do                                                \
-    {                                                 \
-        TAILQ_NEXT((elm), field) = NULL;              \
-        (elm)->field.tqe_prev = (head)->tqh_last;     \
-        *(head)->tqh_last = (elm);                    \
-        (head)->tqh_last = &TAILQ_NEXT((elm), field); \
+#define TAILQ_INSERT_TAIL(head, elm, field)                   \
+    do                                                        \
+    {                                                         \
+        TAILQ_NEXT((elm), field) = NULL;                      \
+        (elm)->field.tqe_prev    = (head)->tqh_last;          \
+        *(head)->tqh_last        = (elm);                     \
+        (head)->tqh_last         = &TAILQ_NEXT((elm), field); \
     } while (0)
 
 #define TAILQ_LAST(head, headname) \
@@ -501,23 +501,23 @@ struct quehead
 static __inline void
 insque(void* a, void* b)
 {
-    struct quehead *element = (struct quehead*)a,
-                   *head = (struct quehead*)b;
+    struct quehead *element    = (struct quehead*)a,
+                   *head       = (struct quehead*)b;
 
-    element->qh_link = head->qh_link;
-    element->qh_rlink = head;
-    head->qh_link = element;
+    element->qh_link           = head->qh_link;
+    element->qh_rlink          = head;
+    head->qh_link              = element;
     element->qh_link->qh_rlink = element;
 }
 
 static __inline void
 remque(void* a)
 {
-    struct quehead* element = (struct quehead*)a;
+    struct quehead* element    = (struct quehead*)a;
 
     element->qh_link->qh_rlink = element->qh_rlink;
     element->qh_rlink->qh_link = element->qh_link;
-    element->qh_rlink = 0;
+    element->qh_rlink          = 0;
 }
 
 #else /* !__GNUC__ */
diff --git a/tests/host/common/sdfs_mock.cpp b/tests/host/common/sdfs_mock.cpp
index 8410fa7f8a..3a7c948b6a 100644
--- a/tests/host/common/sdfs_mock.cpp
+++ b/tests/host/common/sdfs_mock.cpp
@@ -18,4 +18,4 @@
 
 #define SDSIZE 16LL
 uint64_t _sdCardSizeB = 0;
-uint8_t* _sdCard = nullptr;
+uint8_t* _sdCard      = nullptr;
diff --git a/tests/host/common/spiffs_mock.cpp b/tests/host/common/spiffs_mock.cpp
index c6452a98f6..7e3085bb80 100644
--- a/tests/host/common/spiffs_mock.cpp
+++ b/tests/host/common/spiffs_mock.cpp
@@ -34,7 +34,7 @@
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
-FS SPIFFS(nullptr);
+FS                     SPIFFS(nullptr);
 
 SpiffsMock::SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage)
 {
@@ -45,11 +45,11 @@ SpiffsMock::SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const S
     fprintf(stderr, "SPIFFS: %zd bytes\n", fs_size);
 
     m_fs.resize(fs_size, 0xff);
-    s_phys_addr = 0;
-    s_phys_size = static_cast<uint32_t>(fs_size);
-    s_phys_page = static_cast<uint32_t>(fs_page);
+    s_phys_addr  = 0;
+    s_phys_size  = static_cast<uint32_t>(fs_size);
+    s_phys_page  = static_cast<uint32_t>(fs_page);
     s_phys_block = static_cast<uint32_t>(fs_block);
-    s_phys_data = m_fs.data();
+    s_phys_data  = m_fs.data();
     reset();
 }
 
@@ -62,11 +62,11 @@ void SpiffsMock::reset()
 SpiffsMock::~SpiffsMock()
 {
     save();
-    s_phys_addr = 0;
-    s_phys_size = 0;
-    s_phys_page = 0;
+    s_phys_addr  = 0;
+    s_phys_size  = 0;
+    s_phys_page  = 0;
     s_phys_block = 0;
-    s_phys_data = nullptr;
+    s_phys_data  = nullptr;
     m_fs.resize(0);
     SPIFFS = FS(FSImplPtr(nullptr));
 }
diff --git a/tests/host/common/spiffs_mock.h b/tests/host/common/spiffs_mock.h
index 76c4b4165f..a5ca568fa6 100644
--- a/tests/host/common/spiffs_mock.h
+++ b/tests/host/common/spiffs_mock.h
@@ -32,12 +32,12 @@ class SpiffsMock
     ~SpiffsMock();
 
 protected:
-    void load();
-    void save();
+    void                 load();
+    void                 save();
 
     std::vector<uint8_t> m_fs;
-    String m_storage;
-    bool m_overwrite;
+    String               m_storage;
+    bool                 m_overwrite;
 };
 
 #define SPIFFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage) SpiffsMock spiffs_mock(size_kb * 1024, block_kb * 1024, page_b, storage)
diff --git a/tests/host/common/strl.cpp b/tests/host/common/strl.cpp
index ce26d5b60e..0b0725b046 100644
--- a/tests/host/common/strl.cpp
+++ b/tests/host/common/strl.cpp
@@ -5,10 +5,10 @@
     '_cups_strlcat()' - Safely concatenate two strings.
 */
 
-size_t               /* O - Length of string */
-strlcat(char* dst,   /* O - Destination string */
-    const char* src, /* I - Source string */
-    size_t size)     /* I - Size of destination string buffer */
+size_t                   /* O - Length of string */
+strlcat(char*       dst, /* O - Destination string */
+        const char* src, /* I - Source string */
+        size_t      size)     /* I - Size of destination string buffer */
 {
     size_t srclen; /* Length of source string */
     size_t dstlen; /* Length of destination string */
@@ -52,10 +52,10 @@ strlcat(char* dst,   /* O - Destination string */
     '_cups_strlcpy()' - Safely copy two strings.
 */
 
-size_t               /* O - Length of string */
-strlcpy(char* dst,   /* O - Destination string */
-    const char* src, /* I - Source string */
-    size_t size)     /* I - Size of destination string buffer */
+size_t                   /* O - Length of string */
+strlcpy(char*       dst, /* O - Destination string */
+        const char* src, /* I - Source string */
+        size_t      size)     /* I - Size of destination string buffer */
 {
     size_t srclen; /* Length of source string */
 
diff --git a/tests/host/common/user_interface.cpp b/tests/host/common/user_interface.cpp
index aede8d2d39..f8cd9ae692 100644
--- a/tests/host/common/user_interface.cpp
+++ b/tests/host/common/user_interface.cpp
@@ -126,7 +126,7 @@ extern "C"
         config->bssid_set = 0;
         for (int i = 0; i < 6; i++)
             config->bssid[i] = i;
-        config->threshold.rssi = 1;
+        config->threshold.rssi     = 1;
         config->threshold.authmode = AUTH_WPA_PSK;
 #ifdef NONOSDK3V0
         config->open_and_wep_mode_disable = true;
@@ -159,18 +159,18 @@ extern "C"
 
     uint32_t global_ipv4_netfmt = 0;  // global binding
 
-    netif netif0;
+    netif    netif0;
     uint32_t global_source_address = INADDR_ANY;
 
-    bool wifi_get_ip_info(uint8 if_index, struct ip_info* info)
+    bool     wifi_get_ip_info(uint8 if_index, struct ip_info* info)
     {
         // emulate wifi_get_ip_info()
         // ignore if_index
         // use global option -i (host_interface) to select bound interface/address
 
         struct ifaddrs *ifAddrStruct = NULL, *ifa = NULL;
-        uint32_t ipv4 = lwip_htonl(0x7f000001);
-        uint32_t mask = lwip_htonl(0xff000000);
+        uint32_t        ipv4  = lwip_htonl(0x7f000001);
+        uint32_t        mask  = lwip_htonl(0xff000000);
         global_source_address = INADDR_ANY;  // =0
 
         if (getifaddrs(&ifAddrStruct) != 0)
@@ -223,15 +223,15 @@ extern "C"
 
         if (info)
         {
-            info->ip.addr = ipv4;
-            info->netmask.addr = mask;
-            info->gw.addr = ipv4;
+            info->ip.addr       = ipv4;
+            info->netmask.addr  = mask;
+            info->gw.addr       = ipv4;
 
             netif0.ip_addr.addr = ipv4;
             netif0.netmask.addr = mask;
-            netif0.gw.addr = ipv4;
-            netif0.flags = NETIF_FLAG_IGMP | NETIF_FLAG_UP | NETIF_FLAG_LINK_UP;
-            netif0.next = nullptr;
+            netif0.gw.addr      = ipv4;
+            netif0.flags        = NETIF_FLAG_IGMP | NETIF_FLAG_UP | NETIF_FLAG_LINK_UP;
+            netif0.next         = nullptr;
         }
 
         return true;
@@ -280,7 +280,7 @@ extern "C"
     }
 
     wifi_event_handler_cb_t wifi_event_handler_cb_emu = nullptr;
-    void wifi_set_event_handler_cb(wifi_event_handler_cb_t cb)
+    void                    wifi_set_event_handler_cb(wifi_event_handler_cb_t cb)
     {
         wifi_event_handler_cb_emu = cb;
         mockverbose("TODO: wifi_set_event_handler_cb set\n");
@@ -356,7 +356,7 @@ extern "C"
         return wifi_station_get_config(config);
     }
 
-    char wifi_station_get_hostname_str[128];
+    char        wifi_station_get_hostname_str[128];
     const char* wifi_station_get_hostname(void)
     {
         return strcpy(wifi_station_get_hostname_str, "esposix");
@@ -425,11 +425,11 @@ extern "C"
     {
         strcpy((char*)config->ssid, "apssid");
         strcpy((char*)config->password, "appasswd");
-        config->ssid_len = strlen("appasswd");
-        config->channel = 1;
-        config->authmode = AUTH_WPA2_PSK;
-        config->ssid_hidden = 0;
-        config->max_connection = 4;
+        config->ssid_len        = strlen("appasswd");
+        config->channel         = 1;
+        config->authmode        = AUTH_WPA2_PSK;
+        config->ssid_hidden     = 0;
+        config->max_connection  = 4;
         config->beacon_interval = 100;
         return true;
     }
@@ -487,7 +487,7 @@ extern "C"
     ///////////////////////////////////////
     // not user_interface
 
-    void ets_isr_mask(int intr)
+    void     ets_isr_mask(int intr)
     {
         (void)intr;
     }
diff --git a/tests/host/core/test_PolledTimeout.cpp b/tests/host/core/test_PolledTimeout.cpp
index b2c7a212b0..59b2131370 100644
--- a/tests/host/core/test_PolledTimeout.cpp
+++ b/tests/host/core/test_PolledTimeout.cpp
@@ -185,7 +185,7 @@ TEST_CASE("Periodic Timeout 10T 1000ms", "[polledTimeout]")
 
     Serial.println("Periodic 10T Timeout 1000ms");
 
-    int counter = 10;
+    int        counter = 10;
 
     periodicMs timeout(1000);
     before = millis();
@@ -209,8 +209,8 @@ TEST_CASE("Periodic Timeout 10T 1000ms", "[polledTimeout]")
 TEST_CASE("OneShot Timeout 3000ms reset to 1000ms custom yield", "[polledTimeout]")
 {
     using YieldOrSkipPolicy = esp8266::polledTimeout::YieldPolicy::YieldOrSkip;
-    using oneShotMsYield = esp8266::polledTimeout::timeoutTemplate<false, YieldOrSkipPolicy>;
-    using timeType = oneShotMsYield::timeType;
+    using oneShotMsYield    = esp8266::polledTimeout::timeoutTemplate<false, YieldOrSkipPolicy>;
+    using timeType          = oneShotMsYield::timeType;
     timeType before, after, delta;
 
     Serial.println("OneShot Timeout 3000ms");
diff --git a/tests/host/core/test_Print.cpp b/tests/host/core/test_Print.cpp
index 8e7f34729e..9926756a24 100644
--- a/tests/host/core/test_Print.cpp
+++ b/tests/host/core/test_Print.cpp
@@ -27,19 +27,19 @@ TEST_CASE("Print::write overrides all compile properly", "[core][Print]")
     REQUIRE(LittleFS.begin());
     auto p = LittleFS.open("test.bin", "w");
     REQUIRE(p);
-    uint8_t uint8 = 1;
-    uint16_t uint16 = 2;
-    uint32_t uint32 = 3;
-    size_t size = 4;
-    int8_t int8 = 1;
-    int16_t int16 = 2;
-    int32_t int32 = 3;
-    char c = 'h';
-    int i = 10;
-    long l = 11;
-    unsigned char uc = 20;
-    unsigned int ui = 21;
-    unsigned long ul = 22;
+    uint8_t       uint8  = 1;
+    uint16_t      uint16 = 2;
+    uint32_t      uint32 = 3;
+    size_t        size   = 4;
+    int8_t        int8   = 1;
+    int16_t       int16  = 2;
+    int32_t       int32  = 3;
+    char          c      = 'h';
+    int           i      = 10;
+    long          l      = 11;
+    unsigned char uc     = 20;
+    unsigned int  ui     = 21;
+    unsigned long ul     = 22;
     p.write(uint8);
     p.write(uint16);
     p.write(uint32);
@@ -60,7 +60,7 @@ TEST_CASE("Print::write overrides all compile properly", "[core][Print]")
     p = LittleFS.open("test.bin", "r");
     REQUIRE(p);
     uint8_t buff[16];
-    int len = p.read(buff, 16);
+    int     len = p.read(buff, 16);
     p.close();
     REQUIRE(len == 15);
     REQUIRE(buff[0] == 1);
diff --git a/tests/host/core/test_Updater.cpp b/tests/host/core/test_Updater.cpp
index 29447e2b21..8a1ec92bd8 100644
--- a/tests/host/core/test_Updater.cpp
+++ b/tests/host/core/test_Updater.cpp
@@ -20,7 +20,7 @@
 TEST_CASE("Updater fails when writes overflow requested size", "[core][Updater]")
 {
     UpdaterClass* u;
-    uint8_t buff[6000];
+    uint8_t       buff[6000];
     memset(buff, 0, sizeof(buff));
     u = new UpdaterClass();
     REQUIRE(u->begin(6000));
diff --git a/tests/host/core/test_md5builder.cpp b/tests/host/core/test_md5builder.cpp
index 53e76790e7..ec59569918 100644
--- a/tests/host/core/test_md5builder.cpp
+++ b/tests/host/core/test_md5builder.cpp
@@ -56,7 +56,7 @@ TEST_CASE("MD5Builder::addHexString works as expected", "[core][MD5Builder]")
 
 TEST_CASE("MD5Builder::addStream works", "[core][MD5Builder]")
 {
-    MD5Builder builder;
+    MD5Builder  builder;
     const char* str = "MD5Builder::addStream_works_longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong";
     {
         StreamString stream;
diff --git a/tests/host/core/test_pgmspace.cpp b/tests/host/core/test_pgmspace.cpp
index 5ebbf4c425..fd89dbe6db 100644
--- a/tests/host/core/test_pgmspace.cpp
+++ b/tests/host/core/test_pgmspace.cpp
@@ -22,7 +22,7 @@ TEST_CASE("strstr_P works as strstr", "[core][pgmspace]")
     auto t = [](const char* h, const char* n)
     {
         const char* strstr_P_result = strstr_P(h, n);
-        const char* strstr_result = strstr(h, n);
+        const char* strstr_result   = strstr(h, n);
         REQUIRE(strstr_P_result == strstr_result);
     };
 
diff --git a/tests/host/core/test_string.cpp b/tests/host/core/test_string.cpp
index 8f6b00eb4a..74300846fc 100644
--- a/tests/host/core/test_string.cpp
+++ b/tests/host/core/test_string.cpp
@@ -23,8 +23,8 @@ TEST_CASE("String::move", "[core][String]")
 {
     const char buffer[] = "this string goes over the sso limit";
 
-    String target;
-    String source(buffer);
+    String     target;
+    String     source(buffer);
 
     target = std::move(source);
     REQUIRE(source.c_str() != nullptr);
@@ -43,8 +43,8 @@ TEST_CASE("String::trim", "[core][String]")
 TEST_CASE("String::replace", "[core][String]")
 {
     String str;
-    str = "The quick brown fox jumped over the lazy dog.";
-    String find = "fox";
+    str            = "The quick brown fox jumped over the lazy dog.";
+    String find    = "fox";
     String replace = "vulpes vulpes";
     str.replace(find, replace);
     REQUIRE(str == "The quick brown vulpes vulpes jumped over the lazy dog.");
@@ -84,7 +84,7 @@ TEST_CASE("String constructors", "[core][String]")
     String s2(s1);
     REQUIRE(s1 == s2);
     String* s3 = new String("manos");
-    s2 = *s3;
+    s2         = *s3;
     delete s3;
     REQUIRE(s2 == "manos");
     s3 = new String("thisismuchlongerthantheother");
@@ -98,7 +98,7 @@ TEST_CASE("String constructors", "[core][String]")
     String flash = (F("hello from flash"));
     REQUIRE(flash == "hello from flash");
     const char textarray[6] = { 'h', 'e', 'l', 'l', 'o', 0 };
-    String hello(textarray);
+    String     hello(textarray);
     REQUIRE(hello == "hello");
     String hello2;
     hello2 = textarray;
@@ -156,7 +156,7 @@ TEST_CASE("String concantenation", "[core][String]")
     REQUIRE(str == "-100");
     // Non-zero-terminated array concatenation
     const char buff[] = "abcdefg";
-    String n;
+    String     n;
     n = "1234567890";  // Make it a SSO string, fill with non-0 data
     n = "1";           // Overwrite [1] with 0, but leave old junk in SSO space still
     n.concat(buff, 3);
@@ -211,7 +211,7 @@ TEST_CASE("String byte access", "[core][String]")
 TEST_CASE("String conversion", "[core][String]")
 {
     String s = "12345";
-    long l = s.toInt();
+    long   l = s.toInt();
     REQUIRE(l == 12345);
     s = "2147483647";
     l = s.toInt();
@@ -222,7 +222,7 @@ TEST_CASE("String conversion", "[core][String]")
     s = "-2147483648";
     l = s.toInt();
     REQUIRE(l == INT_MIN);
-    s = "3.14159";
+    s       = "3.14159";
     float f = s.toFloat();
     REQUIRE(fabs(f - 3.14159) < 0.0001);
 }
@@ -434,16 +434,16 @@ TEST_CASE("String SSO handles junk in memory", "[core][String]")
     // We fill the SSO space with garbage then construct an object in it and check consistency
     // This is NOT how you want to use Strings outside of this testing!
     unsigned char space[64];
-    String* s = (String*)space;
+    String*       s = (String*)space;
     memset(space, 0xff, 64);
     new (s) String;
     REQUIRE(*s == "");
     s->~String();
 
     // Tests from #5883
-    bool useURLencode = false;
-    const char euro[4] = { (char)0xe2, (char)0x82, (char)0xac, 0 };  // Unicode euro symbol
-    const char yen[3] = { (char)0xc2, (char)0xa5, 0 };               // Unicode yen symbol
+    bool       useURLencode = false;
+    const char euro[4]      = { (char)0xe2, (char)0x82, (char)0xac, 0 };  // Unicode euro symbol
+    const char yen[3]       = { (char)0xc2, (char)0xa5, 0 };              // Unicode yen symbol
 
     memset(space, 0xff, 64);
     new (s) String("%ssid%");
@@ -507,18 +507,18 @@ TEST_CASE("Strings with NULs", "[core][String]")
     String str("01234567");
     REQUIRE(str.length() == 8);
     char* ptr = (char*)str.c_str();
-    ptr[3] = 0;
+    ptr[3]    = 0;
     String str2;
     str2 = str;
     REQUIRE(str2.length() == 8);
     // Needs a buffer pointer
-    str = "0123456789012345678901234567890123456789";
-    ptr = (char*)str.c_str();
+    str    = "0123456789012345678901234567890123456789";
+    ptr    = (char*)str.c_str();
     ptr[3] = 0;
-    str2 = str;
+    str2   = str;
     REQUIRE(str2.length() == 40);
     String str3("a");
-    ptr = (char*)str3.c_str();
+    ptr  = (char*)str3.c_str();
     *ptr = 0;
     REQUIRE(str3.length() == 1);
     str3 += str3;
@@ -534,16 +534,16 @@ TEST_CASE("Strings with NULs", "[core][String]")
     str3 += str3;
     REQUIRE(str3.length() == 64);
     static char zeros[64] = { 0 };
-    const char* p = str3.c_str();
+    const char* p         = str3.c_str();
     REQUIRE(!memcmp(p, zeros, 64));
 }
 
 TEST_CASE("Replace and string expansion", "[core][String]")
 {
-    String s, l;
+    String      s, l;
     // Make these large enough to span SSO and non SSO
-    String whole = "#123456789012345678901234567890";
-    const char* res = "abcde123456789012345678901234567890";
+    String      whole = "#123456789012345678901234567890";
+    const char* res   = "abcde123456789012345678901234567890";
     for (size_t i = 1; i < whole.length(); i++)
     {
         s = whole.substring(0, i);
@@ -590,7 +590,7 @@ TEST_CASE("String chaining", "[core][String]")
     {
         String tmp(chunks[3]);
         tmp.reserve(2 * all.length());
-        auto* ptr = tmp.c_str();
+        auto*  ptr = tmp.c_str();
         String result("~1" + String(&chunks[0][0] + 2) + F(chunks[1]) + chunks[2] + std::move(tmp));
         REQUIRE(result == all);
         REQUIRE(static_cast<const void*>(result.c_str()) == static_cast<const void*>(ptr));
diff --git a/tests/host/fs/test_fs.cpp b/tests/host/fs/test_fs.cpp
index ae88591388..8b92106e8e 100644
--- a/tests/host/fs/test_fs.cpp
+++ b/tests/host/fs/test_fs.cpp
@@ -47,9 +47,9 @@ namespace spiffs_test
 TEST_CASE("SPIFFS checks the config object passed in", "[fs]")
 {
     SPIFFS_MOCK_DECLARE(64, 8, 512, "");
-    FSConfig f;
-    SPIFFSConfig s;
-    SDFSConfig d;
+    FSConfig       f;
+    SPIFFSConfig   s;
+    SDFSConfig     d;
     LittleFSConfig l;
 
     REQUIRE_FALSE(SPIFFS.setConfig(f));
@@ -82,9 +82,9 @@ namespace littlefs_test
 TEST_CASE("LittleFS checks the config object passed in", "[fs]")
 {
     LITTLEFS_MOCK_DECLARE(64, 8, 512, "");
-    FSConfig f;
-    SPIFFSConfig s;
-    SDFSConfig d;
+    FSConfig       f;
+    SPIFFSConfig   s;
+    SDFSConfig     d;
     LittleFSConfig l;
 
     REQUIRE_FALSE(LittleFS.setConfig(f));
@@ -119,9 +119,9 @@ namespace sdfs_test
 TEST_CASE("SDFS checks the config object passed in", "[fs]")
 {
     SDFS_MOCK_DECLARE(64, 8, 512, "");
-    FSConfig f;
-    SPIFFSConfig s;
-    SDFSConfig d;
+    FSConfig       f;
+    SPIFFSConfig   s;
+    SDFSConfig     d;
     LittleFSConfig l;
 
     REQUIRE_FALSE(SDFS.setConfig(f));
@@ -156,7 +156,7 @@ TEST_CASE("SD.h FILE_WRITE macro is append", "[fs]")
     File g = SD.open("/file2.txt", FILE_WRITE);
     g.write(0);
     g.close();
-    g = SD.open("/file2.txt", FILE_READ);
+    g         = SD.open("/file2.txt", FILE_READ);
     uint8_t u = 0x66;
     g.read(&u, 1);
     g.close();
diff --git a/tests/host/sys/pgmspace.h b/tests/host/sys/pgmspace.h
index 6ccd881a8c..321626542a 100644
--- a/tests/host/sys/pgmspace.h
+++ b/tests/host/sys/pgmspace.h
@@ -54,22 +54,10 @@
 // Wrapper inlines for _P functions
 #include <stdio.h>
 #include <string.h>
-inline const char* strstr_P(const char* haystack, const char* needle)
-{
-    return strstr(haystack, needle);
-}
-inline char* strcpy_P(char* dest, const char* src)
-{
-    return strcpy(dest, src);
-}
-inline size_t strlen_P(const char* s)
-{
-    return strlen(s);
-}
-inline int vsnprintf_P(char* str, size_t size, const char* format, va_list ap)
-{
-    return vsnprintf(str, size, format, ap);
-}
+inline const char* strstr_P(const char* haystack, const char* needle) { return strstr(haystack, needle); }
+inline char*       strcpy_P(char* dest, const char* src) { return strcpy(dest, src); }
+inline size_t      strlen_P(const char* s) { return strlen(s); }
+inline int         vsnprintf_P(char* str, size_t size, const char* format, va_list ap) { return vsnprintf(str, size, format, ap); }
 
 #define memcpy_P memcpy
 #define memmove_P memmove
diff --git a/tests/restyle.sh b/tests/restyle.sh
index c038133941..73b8b25c15 100755
--- a/tests/restyle.sh
+++ b/tests/restyle.sh
@@ -8,7 +8,36 @@ pwd
 test -d cores/esp8266
 test -d libraries
 
-# should be: all="cores/esp8266 libraries"
+#########################################
+
+makeClangConf()
+{
+    IndentWidth="$1"
+    IndentCaseLabels="$2"
+
+    cat << EOF > .clang-format
+BasedOnStyle: WebKit
+AlignTrailingComments: true
+BreakBeforeBraces: Allman
+ColumnLimit: 0
+KeepEmptyLinesAtTheStartOfBlocks: false
+SpacesBeforeTrailingComments: 2
+AlignTrailingComments: true
+SortIncludes: false
+BreakConstructorInitializers: AfterColon
+AlignConsecutiveAssignments: AcrossEmptyLinesAndComments
+AlignConsecutiveBitFields: AcrossEmptyLinesAndComments
+AlignConsecutiveDeclarations: AcrossEmptyLinesAndComments
+AlignAfterOpenBracket: Align
+
+IndentWidth: ${IndentWidth}
+IndentCaseLabels: ${IndentCaseLabels}
+EOF
+
+}
+
+#########################################
+# 'all' variable should be "cores/esp8266 libraries"
 
 all="
 libraries/ESP8266mDNS
@@ -23,9 +52,11 @@ libraries/Netdump
 tests
 "
 
-# core
+#########################################
+# restyling core
+
+makeClangConf 4 false
 
-cp tests/clang-format-core .clang-format
 for d in $all; do
     if [ -d "$d" ]; then
         echo "-------- directory $d:"
@@ -38,9 +69,11 @@ for d in $all; do
     fi
 done
 
-# examples
+#########################################
+# restyling arduino examples
+
+makeClangConf 2 true
 
-cp tests/clang-format-arduino .clang-format
 for d in libraries; do
     echo "-------- examples in $d:"
     find $d -name "*.ino" -exec clang-format-12 -i {} \;

From 242b3405e04ed7f48718f47fc792cfa0e7a5ee4c Mon Sep 17 00:00:00 2001
From: David Gauchard <gauchard@laas.fr>
Date: Thu, 20 Jan 2022 11:20:42 +0100
Subject: [PATCH 10/15] tuning

---
 cores/esp8266/LwipDhcpServer-NonOS.cpp        |   2 +-
 cores/esp8266/LwipDhcpServer.cpp              |  40 +-
 cores/esp8266/LwipDhcpServer.h                |  46 +-
 cores/esp8266/LwipIntf.h                      |   4 +-
 cores/esp8266/LwipIntfCB.cpp                  |   2 +-
 cores/esp8266/LwipIntfDev.h                   |  26 +-
 cores/esp8266/StreamSend.cpp                  |  12 +-
 cores/esp8266/core_esp8266_si2c.cpp           |  54 +-
 .../ArduinoOTA/examples/BasicOTA/BasicOTA.ino |  77 +--
 .../ArduinoOTA/examples/OTALeds/OTALeds.ino   |  31 +-
 .../examples/CaptivePortal/CaptivePortal.ino  |  10 +-
 .../CaptivePortalAdvanced.ino                 |  59 +-
 .../CaptivePortalAdvanced/credentials.ino     |   2 +-
 .../CaptivePortalAdvanced/handleHttp.ino      |  51 +-
 .../examples/CaptivePortalAdvanced/tools.ino  |  15 +-
 .../examples/DNSServer/DNSServer.ino          |   6 +-
 .../examples/eeprom_read/eeprom_read.ino      |   2 +-
 .../Arduino_Wifi_AVRISP.ino                   |  32 +-
 .../examples/Authorization/Authorization.ino  |  22 +-
 .../BasicHttpClient/BasicHttpClient.ino       |  29 +-
 .../BasicHttpsClient/BasicHttpsClient.ino     |  31 +-
 .../DigestAuthorization.ino                   |  50 +-
 .../PostHttpClient/PostHttpClient.ino         |  22 +-
 .../ReuseConnectionV2/ReuseConnectionV2.ino   |  35 +-
 .../StreamHttpClient/StreamHttpClient.ino     |  33 +-
 .../StreamHttpsClient/StreamHttpsClient.ino   |  45 +-
 .../SecureBearSSLUpdater.ino                  |  25 +-
 .../SecureWebUpdater/SecureWebUpdater.ino     |  21 +-
 .../examples/WebUpdater/WebUpdater.ino        |  15 +-
 .../LLMNR_Web_Server/LLMNR_Web_Server.ino     |  19 +-
 .../examples/ESP_NBNST/ESP_NBNST.ino          |  16 +-
 libraries/ESP8266SSDP/examples/SSDP/SSDP.ino  |  26 +-
 .../AdvancedWebServer/AdvancedWebServer.ino   |  36 +-
 .../examples/FSBrowser/FSBrowser.ino          | 283 +++------
 .../ESP8266WebServer/examples/Graph/Graph.ino | 121 ++--
 .../examples/HelloServer/HelloServer.ino      | 162 +++---
 .../HelloServerBearSSL/HelloServerBearSSL.ino |  52 +-
 .../HttpAdvancedAuth/HttpAdvancedAuth.ino     |  50 +-
 .../examples/HttpBasicAuth/HttpBasicAuth.ino  |  31 +-
 .../HttpHashCredAuth/HttpHashCredAuth.ino     |  80 +--
 .../examples/PathArgServer/PathArgServer.ino  |  39 +-
 .../examples/PostServer/PostServer.ino        |  52 +-
 .../ServerSentEvents/ServerSentEvents.ino     |  91 +--
 .../SimpleAuthentication.ino                  |  55 +-
 .../examples/WebServer/WebServer.ino          | 103 ++--
 .../examples/WebUpdate/WebUpdate.ino          |  61 +-
 .../BearSSL_CertStore/BearSSL_CertStore.ino   |  46 +-
 .../BearSSL_MaxFragmentLength.ino             |  46 +-
 .../BearSSL_Server/BearSSL_Server.ino         |  63 +-
 .../BearSSL_ServerClientCert.ino              |  52 +-
 .../BearSSL_Sessions/BearSSL_Sessions.ino     |  33 +-
 .../BearSSL_Validation/BearSSL_Validation.ino |  57 +-
 .../examples/HTTPSRequest/HTTPSRequest.ino    |  30 +-
 libraries/ESP8266WiFi/examples/IPv6/IPv6.ino  |  59 +-
 .../examples/NTPClient/NTPClient.ino          |  53 +-
 .../examples/PagerServer/PagerServer.ino      |  18 +-
 .../RangeExtender-NAPT/RangeExtender-NAPT.ino |  24 +-
 .../examples/StaticLease/StaticLease.ino      |  26 +-
 libraries/ESP8266WiFi/examples/Udp/Udp.ino    |  18 +-
 .../WiFiAccessPoint/WiFiAccessPoint.ino       |  13 +-
 .../examples/WiFiClient/WiFiClient.ino        |  35 +-
 .../WiFiClientBasic/WiFiClientBasic.ino       |  20 +-
 .../examples/WiFiEcho/WiFiEcho.ino            |  70 +--
 .../examples/WiFiEvents/WiFiEvents.ino        |  39 +-
 .../WiFiManualWebServer.ino                   |  28 +-
 .../examples/WiFiScan/WiFiScan.ino            |  20 +-
 .../examples/WiFiShutdown/WiFiShutdown.ino    |  14 +-
 .../WiFiTelnetToSerial/WiFiTelnetToSerial.ino |  59 +-
 .../examples/HelloEspnow/HelloEspnow.ino      | 149 ++---
 .../examples/HelloMesh/HelloMesh.ino          |  81 +--
 .../examples/HelloTcpIp/HelloTcpIp.ino        | 119 ++--
 .../examples/httpUpdate/httpUpdate.ino        |  27 +-
 .../httpUpdateLittleFS/httpUpdateLittleFS.ino |  18 +-
 .../httpUpdateSecure/httpUpdateSecure.ino     |  27 +-
 .../httpUpdateSigned/httpUpdateSigned.ino     |  15 +-
 .../LEAmDNS/mDNS_Clock/mDNS_Clock.ino         |  82 +--
 .../mDNS_ServiceMonitor.ino                   | 103 ++--
 .../OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino   |  53 +-
 .../mDNS-SD_Extended/mDNS-SD_Extended.ino     |  22 +-
 .../mDNS_Web_Server/mDNS_Web_Server.ino       |  39 +-
 libraries/ESP8266mDNS/src/LEAmDNS.cpp         |  22 +-
 libraries/ESP8266mDNS/src/LEAmDNS.h           | 540 +++++++++---------
 libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp |  38 +-
 libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp |  16 +-
 libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp |  38 +-
 .../ESP8266mDNS/src/LEAmDNS_Transfer.cpp      |  56 +-
 libraries/Hash/examples/sha1/sha1.ino         |   1 -
 .../InputSerialPlotter/InputSerialPlotter.ino |  15 +-
 .../I2S/examples/SimpleTone/SimpleTone.ino    |  22 +-
 .../LittleFS_Timestamp/LittleFS_Timestamp.ino |  81 +--
 .../LittleFS/examples/SpeedTest/SpeedTest.ino |  78 +--
 .../Netdump/examples/Netdump/Netdump.ino      |  62 +-
 libraries/Netdump/src/Netdump.cpp             |   4 +-
 libraries/Netdump/src/Netdump.h               |  28 +-
 libraries/Netdump/src/NetdumpIP.h             |  18 +-
 libraries/Netdump/src/NetdumpPacket.cpp       |   2 +-
 libraries/Netdump/src/NetdumpPacket.h         |  28 +-
 .../SD/examples/Datalogger/Datalogger.ino     |  21 +-
 libraries/SD/examples/DumpFile/DumpFile.ino   |  18 +-
 libraries/SD/examples/Files/Files.ino         |  30 +-
 libraries/SD/examples/ReadWrite/ReadWrite.ino |  26 +-
 libraries/SD/examples/listfiles/listfiles.ino |  28 +-
 .../SPISlave_Master/SPISlave_Master.ino       |  42 +-
 .../SPISlave_SafeMaster.ino                   |  45 +-
 .../examples/SPISlave_Test/SPISlave_Test.ino  |  52 +-
 libraries/Servo/examples/Sweep/Sweep.ino      |  16 +-
 .../examples/drawCircle/drawCircle.ino        |   6 +-
 .../examples/drawLines/drawLines.ino          |   6 +-
 .../examples/drawNumber/drawNumber.ino        |   6 +-
 .../examples/drawRectangle/drawRectangle.ino  |   6 +-
 .../examples/paint/paint.ino                  |  25 +-
 .../examples/shapes/shapes.ino                |   9 +-
 .../examples/text/text.ino                    |   6 +-
 .../examples/tftbmp/tftbmp.ino                |  72 +--
 .../examples/tftbmp2/tftbmp2.ino              | 116 ++--
 .../examples/TickerBasic/TickerBasic.ino      |  17 +-
 .../TickerFunctional/TickerFunctional.ino     |  35 +-
 libraries/Wire/Wire.cpp                       |   4 +-
 libraries/Wire/Wire.h                         |  38 +-
 .../examples/master_reader/master_reader.ino  |  16 +-
 .../examples/master_writer/master_writer.ino  |   9 +-
 .../slave_receiver/slave_receiver.ino         |  16 +-
 .../examples/slave_sender/slave_sender.ino    |   9 +-
 libraries/esp8266/examples/Blink/Blink.ino    |   6 +-
 .../BlinkPolledTimeout/BlinkPolledTimeout.ino |  24 +-
 .../BlinkWithoutDelay/BlinkWithoutDelay.ino   |  18 +-
 .../examples/CallBackList/CallBackGeneric.ino |  42 +-
 .../examples/CheckFlashCRC/CheckFlashCRC.ino  |  15 +-
 .../CheckFlashConfig/CheckFlashConfig.ino     |  13 +-
 .../examples/ConfigFile/ConfigFile.ino        |  40 +-
 .../FadePolledTimeout/FadePolledTimeout.ino   |  19 +-
 .../examples/HeapMetric/HeapMetric.ino        |  44 +-
 .../examples/HelloCrypto/HelloCrypto.ino      |  21 +-
 .../examples/HwdtStackDump/HwdtStackDump.ino  |  18 +-
 .../examples/HwdtStackDump/ProcessKey.ino     |  24 +-
 .../esp8266/examples/I2SInput/I2SInput.ino    |   2 +-
 .../examples/I2STransmit/I2STransmit.ino      |  23 +-
 .../examples/IramReserve/IramReserve.ino      |  30 +-
 .../examples/IramReserve/ProcessKey.ino       |  24 +-
 .../examples/LowPowerDemo/LowPowerDemo.ino    | 164 ++----
 libraries/esp8266/examples/MMU48K/MMU48K.ino  |  81 +--
 .../examples/NTP-TZ-DST/NTP-TZ-DST.ino        |  81 +--
 .../examples/RTCUserMemory/RTCUserMemory.ino  |  52 +-
 .../SerialDetectBaudrate.ino                  |  16 +-
 .../examples/SerialStress/SerialStress.ino    |  85 +--
 .../SigmaDeltaDemo/SigmaDeltaDemo.ino         |  18 +-
 .../examples/StreamString/StreamString.ino    |  35 +-
 .../examples/TestEspApi/TestEspApi.ino        |  43 +-
 .../examples/UartDownload/UartDownload.ino    |  44 +-
 .../examples/interactive/interactive.ino      |  27 +-
 .../esp8266/examples/irammem/irammem.ino      | 284 +++------
 .../examples/virtualmem/virtualmem.ino        |  45 +-
 .../lwIP_PPP/examples/PPPServer/PPPServer.ino |  24 +-
 libraries/lwIP_PPP/src/PPPServer.h            |   6 +-
 .../lwIP_enc28j60/src/utility/enc28j60.cpp    |   2 +-
 .../lwIP_enc28j60/src/utility/enc28j60.h      |  52 +-
 libraries/lwIP_w5100/src/utility/w5100.cpp    |   4 +-
 libraries/lwIP_w5100/src/utility/w5100.h      |  34 +-
 .../examples/TCPClient/TCPClient.ino          |  12 +-
 libraries/lwIP_w5500/src/utility/w5500.h      |  50 +-
 tests/device/libraries/BSTest/src/BSArduino.h |   2 +-
 tests/device/libraries/BSTest/src/BSArgs.h    |   8 +-
 tests/device/libraries/BSTest/src/BSStdio.h   |   2 +-
 tests/device/test_libc/libm_string.c          |   2 +-
 tests/device/test_libc/memmove1.c             |   4 +-
 tests/device/test_libc/strcmp-1.c             |   4 +-
 tests/device/test_libc/tstring.c              |  32 +-
 tests/host/common/Arduino.cpp                 |   2 +-
 tests/host/common/ArduinoMain.cpp             |   2 +-
 tests/host/common/ArduinoMainLittlefs.cpp     |   2 +-
 tests/host/common/ArduinoMainSpiffs.cpp       |   2 +-
 tests/host/common/ArduinoMainUdp.cpp          |   2 +-
 tests/host/common/EEPROM.h                    |   2 +-
 tests/host/common/MockDigital.cpp             |   2 +-
 tests/host/common/MockEsp.cpp                 |   4 +-
 tests/host/common/MockTools.cpp               |  14 +-
 tests/host/common/MockUART.cpp                |   8 +-
 tests/host/common/MocklwIP.cpp                |   4 +-
 tests/host/common/UdpContextSocket.cpp        |   4 +-
 tests/host/common/c_types.h                   |  28 +-
 tests/host/common/esp8266_peri.h              |   4 +-
 tests/host/common/include/ClientContext.h     |  14 +-
 tests/host/common/include/UdpContext.h        |  18 +-
 tests/host/common/littlefs_mock.h             |   4 +-
 tests/host/common/md5.c                       |  14 +-
 tests/host/common/mock.h                      |  24 +-
 tests/host/common/queue.h                     |   6 +-
 tests/host/common/spiffs_mock.cpp             |   2 +-
 tests/host/common/spiffs_mock.h               |   4 +-
 tests/host/common/user_interface.cpp          |  10 +-
 tests/host/core/test_PolledTimeout.cpp        |   2 +-
 tests/host/core/test_string.cpp               |   6 +-
 tests/restyle.sh                              |  13 +-
 193 files changed, 2721 insertions(+), 4409 deletions(-)

diff --git a/cores/esp8266/LwipDhcpServer-NonOS.cpp b/cores/esp8266/LwipDhcpServer-NonOS.cpp
index 56122c6074..aee22b6d5c 100644
--- a/cores/esp8266/LwipDhcpServer-NonOS.cpp
+++ b/cores/esp8266/LwipDhcpServer-NonOS.cpp
@@ -31,7 +31,7 @@
 extern netif netif_git[2];
 
 // global DHCP instance for softAP interface
-DhcpServer   dhcpSoftAP(&netif_git[SOFTAP_IF]);
+DhcpServer dhcpSoftAP(&netif_git[SOFTAP_IF]);
 
 extern "C"
 {
diff --git a/cores/esp8266/LwipDhcpServer.cpp b/cores/esp8266/LwipDhcpServer.cpp
index 8cc189a83a..fd25edbc50 100644
--- a/cores/esp8266/LwipDhcpServer.cpp
+++ b/cores/esp8266/LwipDhcpServer.cpp
@@ -175,9 +175,9 @@ const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__;
 #define LWIP_IS_OK(what, err) ((err) == ERR_OK)
 #endif
 
-const uint32 DhcpServer::magic_cookie    = 0x63538263;  // https://tools.ietf.org/html/rfc1497
+const uint32 DhcpServer::magic_cookie = 0x63538263;  // https://tools.ietf.org/html/rfc1497
 
-int          fw_has_started_softap_dhcps = 0;
+int fw_has_started_softap_dhcps = 0;
 
 ////////////////////////////////////////////////////////////////////////////////////
 
@@ -210,7 +210,7 @@ DhcpServer::DhcpServer(netif* netif) :
 // wifi_softap_set_station_info is missing in user_interface.h:
 extern "C" void wifi_softap_set_station_info(uint8_t* mac, struct ipv4_addr*);
 
-void            DhcpServer::dhcps_set_dns(int num, const ipv4_addr_t* dns)
+void DhcpServer::dhcps_set_dns(int num, const ipv4_addr_t* dns)
 {
     (void)num;
     if (!ip4_addr_isany(dns))
@@ -278,7 +278,7 @@ void DhcpServer::node_remove_from_list(list_node** phead, list_node* pdelete)
 {
     list_node* plist = nullptr;
 
-    plist            = *phead;
+    plist = *phead;
     if (plist == nullptr)
     {
         *phead = nullptr;
@@ -316,8 +316,8 @@ bool DhcpServer::add_dhcps_lease(uint8* macaddr)
     struct dhcps_pool* pdhcps_pool = nullptr;
     list_node*         pback_node  = nullptr;
 
-    uint32             start_ip    = dhcps_lease.start_ip.addr;
-    uint32             end_ip      = dhcps_lease.end_ip.addr;
+    uint32 start_ip = dhcps_lease.start_ip.addr;
+    uint32 end_ip   = dhcps_lease.end_ip.addr;
 
     for (pback_node = plist; pback_node != nullptr; pback_node = pback_node->pnext)
     {
@@ -503,12 +503,12 @@ void DhcpServer::create_msg(struct dhcps_msg* m)
 
     client.addr = client_address.addr;
 
-    m->op       = DHCP_REPLY;
-    m->htype    = DHCP_HTYPE_ETHERNET;
-    m->hlen     = 6;
-    m->hops     = 0;
-    m->secs     = 0;
-    m->flags    = htons(BOOTP_BROADCAST);
+    m->op    = DHCP_REPLY;
+    m->htype = DHCP_HTYPE_ETHERNET;
+    m->hlen  = 6;
+    m->hops  = 0;
+    m->secs  = 0;
+    m->flags = htons(BOOTP_BROADCAST);
 
     memcpy((char*)m->yiaddr, (char*)&client.addr, sizeof(m->yiaddr));
     memset((char*)m->ciaddr, 0, sizeof(m->ciaddr));
@@ -539,7 +539,7 @@ void DhcpServer::send_offer(struct dhcps_msg* m)
     end = add_offer_options(end);
     end = add_end(end);
 
-    p   = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM);
+    p = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM);
 #if DHCPS_DEBUG
     os_printf("udhcp: send_offer>>p->ref = %d\n", p->ref);
 #endif
@@ -602,7 +602,7 @@ void DhcpServer::send_nak(struct dhcps_msg* m)
     end = add_msg_type(&m->options[4], DHCPNAK);
     end = add_end(end);
 
-    p   = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM);
+    p = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM);
 #if DHCPS_DEBUG
     os_printf("udhcp: send_nak>>p->ref = %d\n", p->ref);
 #endif
@@ -661,7 +661,7 @@ void DhcpServer::send_ack(struct dhcps_msg* m)
     end = add_offer_options(end);
     end = add_end(end);
 
-    p   = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM);
+    p = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM);
 #if DHCPS_DEBUG
     os_printf("udhcp: send_ack>>p->ref = %d\n", p->ref);
 #endif
@@ -724,10 +724,10 @@ uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
 
     client.addr = client_address.addr;
 
-    u8_t* end   = optptr + len;
-    u16_t type  = 0;
+    u8_t* end  = optptr + len;
+    u16_t type = 0;
 
-    s.state     = DHCPS_STATE_IDLE;
+    s.state = DHCPS_STATE_IDLE;
 
     while (optptr < end)
     {
@@ -830,7 +830,7 @@ sint16_t DhcpServer::parse_msg(struct dhcps_msg* m, u16_t len)
         memcpy(&ip.addr, m->ciaddr, sizeof(ip.addr));
         client_address.addr = dhcps_client_update(m->chaddr, &ip);
 
-        sint16_t ret        = parse_options(&m->options[4], len);
+        sint16_t ret = parse_options(&m->options[4], len);
 
         if (ret == DHCPS_STATE_RELEASE)
         {
@@ -1071,7 +1071,7 @@ void DhcpServer::end()
 
     udp_disconnect(pcb_dhcps);
     udp_remove(pcb_dhcps);
-    pcb_dhcps                     = nullptr;
+    pcb_dhcps = nullptr;
 
     //udp_remove(pcb_dhcps);
     list_node*         pnode      = nullptr;
diff --git a/cores/esp8266/LwipDhcpServer.h b/cores/esp8266/LwipDhcpServer.h
index 73004cd075..821c3a68bd 100644
--- a/cores/esp8266/LwipDhcpServer.h
+++ b/cores/esp8266/LwipDhcpServer.h
@@ -39,11 +39,11 @@ class DhcpServer
     DhcpServer(netif* netif);
     ~DhcpServer();
 
-    void   setDns(int num, const ipv4_addr_t* dns);
+    void setDns(int num, const ipv4_addr_t* dns);
 
-    bool   begin(ip_info* info);
-    void   end();
-    bool   isRunning();
+    bool begin(ip_info* info);
+    void end();
+    bool isRunning();
 
     // this is the C interface encapsulated in a class
     // (originally dhcpserver.c in lwIP-v1.4 in NonOS-SDK)
@@ -61,7 +61,7 @@ class DhcpServer
     uint32 get_dhcps_lease_time(void);
     bool   add_dhcps_lease(uint8* macaddr);
 
-    void   dhcps_set_dns(int num, const ipv4_addr_t* dns);
+    void dhcps_set_dns(int num, const ipv4_addr_t* dns);
 
 protected:
     // legacy C structure and API to eventually turn into C++
@@ -93,24 +93,24 @@ class DhcpServer
                struct pbuf*     p,
                const ip_addr_t* addr,
                uint16_t         port);
-    void                kill_oldest_dhcps_pool(void);
-    void                dhcps_coarse_tmr(void);  // CURRENTLY NOT CALLED
-    void                dhcps_client_leave(u8* bssid, struct ipv4_addr* ip, bool force);
-    uint32              dhcps_client_update(u8* bssid, struct ipv4_addr* ip);
-
-    netif*              _netif;
-
-    struct udp_pcb*     pcb_dhcps;
-    ip_addr_t           broadcast_dhcps;
-    struct ipv4_addr    server_address;
-    struct ipv4_addr    client_address;
-    struct ipv4_addr    dns_address;
-    uint32              dhcps_lease_time;
-
-    struct dhcps_lease  dhcps_lease;
-    list_node*          plist;
-    uint8               offer;
-    bool                renew;
+    void   kill_oldest_dhcps_pool(void);
+    void   dhcps_coarse_tmr(void);  // CURRENTLY NOT CALLED
+    void   dhcps_client_leave(u8* bssid, struct ipv4_addr* ip, bool force);
+    uint32 dhcps_client_update(u8* bssid, struct ipv4_addr* ip);
+
+    netif* _netif;
+
+    struct udp_pcb*  pcb_dhcps;
+    ip_addr_t        broadcast_dhcps;
+    struct ipv4_addr server_address;
+    struct ipv4_addr client_address;
+    struct ipv4_addr dns_address;
+    uint32           dhcps_lease_time;
+
+    struct dhcps_lease dhcps_lease;
+    list_node*         plist;
+    uint8              offer;
+    bool               renew;
 
     static const uint32 magic_cookie;
 };
diff --git a/cores/esp8266/LwipIntf.h b/cores/esp8266/LwipIntf.h
index 13a8e56d3b..386906b0a1 100644
--- a/cores/esp8266/LwipIntf.h
+++ b/cores/esp8266/LwipIntf.h
@@ -26,8 +26,8 @@ class LwipIntf
     static bool ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3,
                                  IPAddress& gateway, IPAddress& netmask, IPAddress& dns1);
 
-    String      hostname();
-    bool        hostname(const String& aHostname)
+    String hostname();
+    bool   hostname(const String& aHostname)
     {
         return hostname(aHostname.c_str());
     }
diff --git a/cores/esp8266/LwipIntfCB.cpp b/cores/esp8266/LwipIntfCB.cpp
index a5e9b445ca..b79c6323fb 100644
--- a/cores/esp8266/LwipIntfCB.cpp
+++ b/cores/esp8266/LwipIntfCB.cpp
@@ -8,7 +8,7 @@
 static int       netifStatusChangeListLength = 0;
 LwipIntf::CBType netifStatusChangeList[NETIF_STATUS_CB_SIZE];
 
-extern "C" void  netif_status_changed(struct netif* netif)
+extern "C" void netif_status_changed(struct netif* netif)
 {
     // override the default empty weak function
     for (int i = 0; i < netifStatusChangeListLength; i++)
diff --git a/cores/esp8266/LwipIntfDev.h b/cores/esp8266/LwipIntfDev.h
index 9931daa3c5..08a2713ca0 100644
--- a/cores/esp8266/LwipIntfDev.h
+++ b/cores/esp8266/LwipIntfDev.h
@@ -39,10 +39,10 @@ class LwipIntfDev : public LwipIntf, public RawDev
         memset(&_netif, 0, sizeof(_netif));
     }
 
-    boolean      config(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3 = IPADDR_NONE, const IPAddress& dns2 = IPADDR_NONE);
+    boolean config(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3 = IPADDR_NONE, const IPAddress& dns2 = IPADDR_NONE);
 
     // default mac-address is inferred from esp8266's STA interface
-    boolean      begin(const uint8_t* macAddress = nullptr, const uint16_t mtu = DEFAULT_MTU);
+    boolean begin(const uint8_t* macAddress = nullptr, const uint16_t mtu = DEFAULT_MTU);
 
     const netif* getNetIf() const
     {
@@ -75,25 +75,25 @@ class LwipIntfDev : public LwipIntf, public RawDev
     wl_status_t status();
 
 protected:
-    err_t        netif_init();
-    void         netif_status_callback();
+    err_t netif_init();
+    void  netif_status_callback();
 
     static err_t netif_init_s(netif* netif);
     static err_t linkoutput_s(netif* netif, struct pbuf* p);
     static void  netif_status_callback_s(netif* netif);
 
     // called on a regular basis or on interrupt
-    err_t        handlePackets();
+    err_t handlePackets();
 
     // members
 
-    netif        _netif;
+    netif _netif;
 
-    uint16_t     _mtu;
-    int8_t       _intrPin;
-    uint8_t      _macAddress[6];
-    bool         _started;
-    bool         _default;
+    uint16_t _mtu;
+    int8_t   _intrPin;
+    uint8_t  _macAddress[6];
+    bool     _started;
+    bool     _default;
 };
 
 template <class RawDev>
@@ -286,11 +286,11 @@ err_t LwipIntfDev<RawDev>::netif_init()
     // lwIP's doc: This function typically first resolves the hardware
     // address, then sends the packet.  For ethernet physical layer, this is
     // usually lwIP's etharp_output()
-    _netif.output          = etharp_output;
+    _netif.output = etharp_output;
 
     // lwIP's doc: This function outputs the pbuf as-is on the link medium
     // (this must points to the raw ethernet driver, meaning: us)
-    _netif.linkoutput      = linkoutput_s;
+    _netif.linkoutput = linkoutput_s;
 
     _netif.status_callback = netif_status_callback_s;
 
diff --git a/cores/esp8266/StreamSend.cpp b/cores/esp8266/StreamSend.cpp
index 13f4e47cda..fb92b48cd8 100644
--- a/cores/esp8266/StreamSend.cpp
+++ b/cores/esp8266/StreamSend.cpp
@@ -61,8 +61,8 @@ size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int rea
     // "neverExpires (default, impossible)" is translated to default timeout
     esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
-    const size_t                          maxLen  = std::max((ssize_t)0, len);
-    size_t                                written = 0;
+    const size_t maxLen  = std::max((ssize_t)0, len);
+    size_t       written = 0;
 
     while (!maxLen || written < maxLen)
     {
@@ -151,8 +151,8 @@ size_t Stream::SendGenericRegularUntil(Print* to, const ssize_t len, const int r
     // "neverExpires (default, impossible)" is translated to default timeout
     esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
-    const size_t                          maxLen  = std::max((ssize_t)0, len);
-    size_t                                written = 0;
+    const size_t maxLen  = std::max((ssize_t)0, len);
+    size_t       written = 0;
 
     while (!maxLen || written < maxLen)
     {
@@ -227,8 +227,8 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
     // "neverExpires (default, impossible)" is translated to default timeout
     esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
-    const size_t                          maxLen  = std::max((ssize_t)0, len);
-    size_t                                written = 0;
+    const size_t maxLen  = std::max((ssize_t)0, len);
+    size_t       written = 0;
 
     while (!maxLen || written < maxLen)
     {
diff --git a/cores/esp8266/core_esp8266_si2c.cpp b/cores/esp8266/core_esp8266_si2c.cpp
index 7f26656564..3672f7a4e2 100644
--- a/cores/esp8266/core_esp8266_si2c.cpp
+++ b/cores/esp8266/core_esp8266_si2c.cpp
@@ -93,8 +93,8 @@ class Twi
                     TWIP_WRITE,
                     TWIP_BUS_ERR } twip_state
         = TWIP_IDLE;
-    volatile int     twip_status    = TW_NO_INFO;
-    volatile int     bitCount       = 0;
+    volatile int twip_status = TW_NO_INFO;
+    volatile int bitCount    = 0;
 
     volatile uint8_t twi_data       = 0x00;
     volatile int     twi_ack        = 0;
@@ -109,12 +109,12 @@ class Twi
         = TWI_READY;
     volatile uint8_t twi_error = 0xFF;
 
-    uint8_t          twi_txBuffer[TWI_BUFFER_LENGTH];
-    volatile int     twi_txBufferIndex  = 0;
-    volatile int     twi_txBufferLength = 0;
+    uint8_t      twi_txBuffer[TWI_BUFFER_LENGTH];
+    volatile int twi_txBufferIndex  = 0;
+    volatile int twi_txBufferLength = 0;
 
-    uint8_t          twi_rxBuffer[TWI_BUFFER_LENGTH];
-    volatile int     twi_rxBufferIndex = 0;
+    uint8_t      twi_rxBuffer[TWI_BUFFER_LENGTH];
+    volatile int twi_rxBufferIndex = 0;
 
     void (*twi_onSlaveTransmit)(void);
     void (*twi_onSlaveReceive)(uint8_t*, size_t);
@@ -131,8 +131,8 @@ class Twi
         TWI_SIG_RX    = 0x00000101,
         TWI_SIG_TX    = 0x00000102
     };
-    ETSEvent              eventTaskQueue[EVENTTASK_QUEUE_SIZE];
-    ETSTimer              timer;
+    ETSEvent eventTaskQueue[EVENTTASK_QUEUE_SIZE];
+    ETSTimer timer;
 
     // Event/IRQ callbacks, so they can't use "this" and need to be static
     static void IRAM_ATTR onSclChange(void);
@@ -141,20 +141,20 @@ class Twi
     static void IRAM_ATTR onTimer(void* unused);
 
     // Allow not linking in the slave code if there is no call to setAddress
-    bool                  _slaveEnabled = false;
+    bool _slaveEnabled = false;
 
     // Internal use functions
-    void IRAM_ATTR        busywait(unsigned int v);
-    bool                  write_start(void);
-    bool                  write_stop(void);
-    bool                  write_bit(bool bit);
-    bool                  read_bit(void);
-    bool                  write_byte(unsigned char byte);
-    unsigned char         read_byte(bool nack);
-    void IRAM_ATTR        onTwipEvent(uint8_t status);
+    void IRAM_ATTR busywait(unsigned int v);
+    bool           write_start(void);
+    bool           write_stop(void);
+    bool           write_bit(bool bit);
+    bool           read_bit(void);
+    bool           write_byte(unsigned char byte);
+    unsigned char  read_byte(bool nack);
+    void IRAM_ATTR onTwipEvent(uint8_t status);
 
     // Handle the case where a slave needs to stretch the clock with a time-limited busy wait
-    inline void           WAIT_CLOCK_STRETCH()
+    inline void WAIT_CLOCK_STRETCH()
     {
         esp8266::polledTimeout::oneShotFastUs  timeout(twi_clockStretchLimit);
         esp8266::polledTimeout::periodicFastUs yieldTimeout(5000);
@@ -549,7 +549,7 @@ void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
     case TW_SR_ARB_LOST_SLA_ACK:    // lost arbitration, returned ack
     case TW_SR_ARB_LOST_GCALL_ACK:  // lost arbitration, returned ack
         // enter slave receiver mode
-        twi_state         = TWI_SRX;
+        twi_state = TWI_SRX;
         // indicate that rx buffer can be overwritten and ack
         twi_rxBufferIndex = 0;
         reply(1);
@@ -593,9 +593,9 @@ void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
     case TW_ST_SLA_ACK:           // addressed, returned ack
     case TW_ST_ARB_LOST_SLA_ACK:  // arbitration lost, returned ack
         // enter slave transmitter mode
-        twi_state          = TWI_STX;
+        twi_state = TWI_STX;
         // ready the tx buffer index for iteration
-        twi_txBufferIndex  = 0;
+        twi_txBufferIndex = 0;
         // set tx buffer length to be zero, to verify if user changes it
         twi_txBufferLength = 0;
         // callback to user-defined callback over event task to allow for non-RAM-residing code
@@ -701,10 +701,10 @@ void IRAM_ATTR Twi::onSclChange(void)
 
     // Store bool return in int to reduce final code size.
 
-    sda                 = SDA_READ(twi.twi_sda);
-    scl                 = SCL_READ(twi.twi_scl);
+    sda = SDA_READ(twi.twi_sda);
+    scl = SCL_READ(twi.twi_scl);
 
-    twi.twip_status     = 0xF8;  // reset TWI status
+    twi.twip_status = 0xF8;  // reset TWI status
 
     int twip_state_mask = S2M(twi.twip_state);
     IFSTATE(S2M(TWIP_START) | S2M(TWIP_REP_START) | S2M(TWIP_SLA_W) | S2M(TWIP_READ))
@@ -898,8 +898,8 @@ void IRAM_ATTR Twi::onSdaChange(void)
     unsigned int scl;
 
     // Store bool return in int to reduce final code size.
-    sda                 = SDA_READ(twi.twi_sda);
-    scl                 = SCL_READ(twi.twi_scl);
+    sda = SDA_READ(twi.twi_sda);
+    scl = SCL_READ(twi.twi_scl);
 
     int twip_state_mask = S2M(twi.twip_state);
     if (scl) /* !DATA */
diff --git a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
index 1c7effc626..1a94864e90 100644
--- a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
+++ b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
@@ -11,14 +11,12 @@
 const char* ssid     = STASSID;
 const char* password = STAPSK;
 
-void        setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println("Booting");
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
-  while (WiFi.waitForConnectResult() != WL_CONNECTED)
-  {
+  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
     Serial.println("Connection Failed! Rebooting...");
     delay(5000);
     ESP.restart();
@@ -37,56 +35,39 @@ void        setup()
   // MD5(admin) = 21232f297a57a5a743894a0e4a801fc3
   // ArduinoOTA.setPasswordHash("21232f297a57a5a743894a0e4a801fc3");
 
-  ArduinoOTA.onStart([]()
-                     {
-                       String type;
-                       if (ArduinoOTA.getCommand() == U_FLASH)
-                       {
-                         type = "sketch";
-                       }
-                       else
-                       {  // U_FS
-                         type = "filesystem";
-                       }
+  ArduinoOTA.onStart([]() {
+    String type;
+    if (ArduinoOTA.getCommand() == U_FLASH) {
+      type = "sketch";
+    } else {  // U_FS
+      type = "filesystem";
+    }
 
-                       // NOTE: if updating FS this would be the place to unmount FS using FS.end()
-                       Serial.println("Start updating " + type);
-                     });
-  ArduinoOTA.onEnd([]()
-                   { Serial.println("\nEnd"); });
-  ArduinoOTA.onProgress([](unsigned int progress, unsigned int total)
-                        { Serial.printf("Progress: %u%%\r", (progress / (total / 100))); });
-  ArduinoOTA.onError([](ota_error_t error)
-                     {
-                       Serial.printf("Error[%u]: ", error);
-                       if (error == OTA_AUTH_ERROR)
-                       {
-                         Serial.println("Auth Failed");
-                       }
-                       else if (error == OTA_BEGIN_ERROR)
-                       {
-                         Serial.println("Begin Failed");
-                       }
-                       else if (error == OTA_CONNECT_ERROR)
-                       {
-                         Serial.println("Connect Failed");
-                       }
-                       else if (error == OTA_RECEIVE_ERROR)
-                       {
-                         Serial.println("Receive Failed");
-                       }
-                       else if (error == OTA_END_ERROR)
-                       {
-                         Serial.println("End Failed");
-                       }
-                     });
+    // NOTE: if updating FS this would be the place to unmount FS using FS.end()
+    Serial.println("Start updating " + type);
+  });
+  ArduinoOTA.onEnd([]() { Serial.println("\nEnd"); });
+  ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) { Serial.printf("Progress: %u%%\r", (progress / (total / 100))); });
+  ArduinoOTA.onError([](ota_error_t error) {
+    Serial.printf("Error[%u]: ", error);
+    if (error == OTA_AUTH_ERROR) {
+      Serial.println("Auth Failed");
+    } else if (error == OTA_BEGIN_ERROR) {
+      Serial.println("Begin Failed");
+    } else if (error == OTA_CONNECT_ERROR) {
+      Serial.println("Connect Failed");
+    } else if (error == OTA_RECEIVE_ERROR) {
+      Serial.println("Receive Failed");
+    } else if (error == OTA_END_ERROR) {
+      Serial.println("End Failed");
+    }
+  });
   ArduinoOTA.begin();
   Serial.println("Ready");
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 }
 
-void loop()
-{
+void loop() {
   ArduinoOTA.handle();
 }
diff --git a/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino b/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
index 347a7a8925..7c01e2e7cb 100644
--- a/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
+++ b/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
@@ -12,12 +12,11 @@ const char* ssid     = STASSID;
 const char* password = STAPSK;
 const char* host     = "OTA-LEDS";
 
-int         led_pin  = 13;
+int led_pin = 13;
 #define N_DIMMERS 3
-int  dimmer_pin[] = { 14, 5, 15 };
+int dimmer_pin[] = { 14, 5, 15 };
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
 
   /* switch on led */
@@ -29,8 +28,7 @@ void setup()
 
   WiFi.begin(ssid, password);
 
-  while (WiFi.waitForConnectResult() != WL_CONNECTED)
-  {
+  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
     WiFi.begin(ssid, password);
     Serial.println("Retrying connection...");
   }
@@ -41,41 +39,36 @@ void setup()
   analogWriteRange(1000);
   analogWrite(led_pin, 990);
 
-  for (int i = 0; i < N_DIMMERS; i++)
-  {
+  for (int i = 0; i < N_DIMMERS; i++) {
     pinMode(dimmer_pin[i], OUTPUT);
     analogWrite(dimmer_pin[i], 50);
   }
 
   ArduinoOTA.setHostname(host);
   ArduinoOTA.onStart([]() {  // switch off all the PWMs during upgrade
-    for (int i = 0; i < N_DIMMERS; i++)
-    {
+    for (int i = 0; i < N_DIMMERS; i++) {
       analogWrite(dimmer_pin[i], 0);
     }
     analogWrite(led_pin, 0);
   });
 
   ArduinoOTA.onEnd([]() {  // do a fancy thing with our board led at end
-    for (int i = 0; i < 30; i++)
-    {
+    for (int i = 0; i < 30; i++) {
       analogWrite(led_pin, (i * 100) % 1001);
       delay(50);
     }
   });
 
-  ArduinoOTA.onError([](ota_error_t error)
-                     {
-                       (void)error;
-                       ESP.restart();
-                     });
+  ArduinoOTA.onError([](ota_error_t error) {
+    (void)error;
+    ESP.restart();
+  });
 
   /* setup the OTA server */
   ArduinoOTA.begin();
   Serial.println("Ready");
 }
 
-void loop()
-{
+void loop() {
   ArduinoOTA.handle();
 }
diff --git a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino
index b59cda2d92..5b7b3f6b16 100644
--- a/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino
+++ b/libraries/DNSServer/examples/CaptivePortal/CaptivePortal.ino
@@ -2,9 +2,9 @@
 #include <DNSServer.h>
 #include <ESP8266WebServer.h>
 
-const byte DNS_PORT = 53;
-IPAddress apIP(172, 217, 28, 1);
-DNSServer dnsServer;
+const byte       DNS_PORT = 53;
+IPAddress        apIP(172, 217, 28, 1);
+DNSServer        dnsServer;
 ESP8266WebServer webServer(80);
 
 String responseHTML = ""
@@ -24,9 +24,7 @@ void setup() {
   dnsServer.start(DNS_PORT, "*", apIP);
 
   // replay to all requests with same HTML
-  webServer.onNotFound([]() {
-    webServer.send(200, "text/html", responseHTML);
-  });
+  webServer.onNotFound([]() { webServer.send(200, "text/html", responseHTML); });
   webServer.begin();
 }
 
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
index 44328a8fb1..21abb08a4e 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
@@ -23,38 +23,37 @@
 #define APPSK "12345678"
 #endif
 
-const char*      softAP_ssid     = APSSID;
-const char*      softAP_password = APPSK;
+const char* softAP_ssid     = APSSID;
+const char* softAP_password = APPSK;
 
 /* hostname for mDNS. Should work at least on windows. Try http://esp8266.local */
-const char*      myHostname      = "esp8266";
+const char* myHostname = "esp8266";
 
 /* Don't set this wifi credentials. They are configurated at runtime and stored on EEPROM */
-char             ssid[33]        = "";
-char             password[65]    = "";
+char ssid[33]     = "";
+char password[65] = "";
 
 // DNS server
-const byte       DNS_PORT        = 53;
-DNSServer        dnsServer;
+const byte DNS_PORT = 53;
+DNSServer  dnsServer;
 
 // Web server
 ESP8266WebServer server(80);
 
 /* Soft AP network parameters */
-IPAddress        apIP(172, 217, 28, 1);
-IPAddress        netMsk(255, 255, 255, 0);
+IPAddress apIP(172, 217, 28, 1);
+IPAddress netMsk(255, 255, 255, 0);
 
 /** Should I connect to WLAN asap? */
-boolean          connect;
+boolean connect;
 
 /** Last time I tried to connect to WLAN */
-unsigned long    lastConnectTry = 0;
+unsigned long lastConnectTry = 0;
 
 /** Current WLAN status */
-unsigned int     status         = WL_IDLE_STATUS;
+unsigned int status = WL_IDLE_STATUS;
 
-void             setup()
-{
+void setup() {
   delay(1000);
   Serial.begin(115200);
   Serial.println();
@@ -83,8 +82,7 @@ void             setup()
   connect = strlen(ssid) > 0;  // Request WLAN connect if there is a SSID
 }
 
-void connectWifi()
-{
+void connectWifi() {
   Serial.println("Connecting as wifi client...");
   WiFi.disconnect();
   WiFi.begin(ssid, password);
@@ -93,10 +91,8 @@ void connectWifi()
   Serial.println(connRes);
 }
 
-void loop()
-{
-  if (connect)
-  {
+void loop() {
+  if (connect) {
     Serial.println("Connect requested");
     connect = false;
     connectWifi();
@@ -104,19 +100,16 @@ void loop()
   }
   {
     unsigned int s = WiFi.status();
-    if (s == 0 && millis() > (lastConnectTry + 60000))
-    {
+    if (s == 0 && millis() > (lastConnectTry + 60000)) {
       /* If WLAN disconnected and idle try to connect */
       /* Don't set retry time too low as retry interfere the softAP operation */
       connect = true;
     }
-    if (status != s)
-    {  // WLAN status change
+    if (status != s) {  // WLAN status change
       Serial.print("Status: ");
       Serial.println(s);
       status = s;
-      if (s == WL_CONNECTED)
-      {
+      if (s == WL_CONNECTED) {
         /* Just connected to WLAN */
         Serial.println("");
         Serial.print("Connected to ");
@@ -125,24 +118,18 @@ void loop()
         Serial.println(WiFi.localIP());
 
         // Setup MDNS responder
-        if (!MDNS.begin(myHostname))
-        {
+        if (!MDNS.begin(myHostname)) {
           Serial.println("Error setting up MDNS responder!");
-        }
-        else
-        {
+        } else {
           Serial.println("mDNS responder started");
           // Add service to MDNS-SD
           MDNS.addService("http", "tcp", 80);
         }
-      }
-      else if (s == WL_NO_SSID_AVAIL)
-      {
+      } else if (s == WL_NO_SSID_AVAIL) {
         WiFi.disconnect();
       }
     }
-    if (s == WL_CONNECTED)
-    {
+    if (s == WL_CONNECTED) {
       MDNS.update();
     }
   }
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/credentials.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/credentials.ino
index a5e76fb7c4..844460e8c5 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/credentials.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/credentials.ino
@@ -7,7 +7,7 @@ void loadCredentials() {
   EEPROM.get(0 + sizeof(ssid) + sizeof(password), ok);
   EEPROM.end();
   if (String(ok) != String("OK")) {
-    ssid[0] = 0;
+    ssid[0]     = 0;
     password[0] = 0;
   }
   Serial.println("Recovered credentials:");
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
index a333748e60..5b88ae272a 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
@@ -1,8 +1,6 @@
 /** Handle root or redirect to captive portal */
-void handleRoot()
-{
-  if (captivePortal())
-  {  // If caprive portal redirect instead of displaying the page.
+void handleRoot() {
+  if (captivePortal()) {  // If caprive portal redirect instead of displaying the page.
     return;
   }
   server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
@@ -15,12 +13,9 @@ void handleRoot()
       "<meta name='viewport' content='width=device-width'>"
       "<title>CaptivePortal</title></head><body>"
       "<h1>HELLO WORLD!!</h1>");
-  if (server.client().localIP() == apIP)
-  {
+  if (server.client().localIP() == apIP) {
     Page += String(F("<p>You are connected through the soft AP: ")) + softAP_ssid + F("</p>");
-  }
-  else
-  {
+  } else {
     Page += String(F("<p>You are connected through the wifi network: ")) + ssid + F("</p>");
   }
   Page += F(
@@ -31,10 +26,8 @@ void handleRoot()
 }
 
 /** Redirect to captive portal if we got a request for another domain. Return true in that case so the page handler do not try to handle the request again. */
-boolean captivePortal()
-{
-  if (!isIp(server.hostHeader()) && server.hostHeader() != (String(myHostname) + ".local"))
-  {
+boolean captivePortal() {
+  if (!isIp(server.hostHeader()) && server.hostHeader() != (String(myHostname) + ".local")) {
     Serial.println("Request redirected to captive portal");
     server.sendHeader("Location", String("http://") + toStringIp(server.client().localIP()), true);
     server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to close the socket ourselves.
@@ -45,8 +38,7 @@ boolean captivePortal()
 }
 
 /** Wifi config page handler */
-void handleWifi()
-{
+void handleWifi() {
   server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
   server.sendHeader("Pragma", "no-cache");
   server.sendHeader("Expires", "-1");
@@ -57,12 +49,9 @@ void handleWifi()
       "<meta name='viewport' content='width=device-width'>"
       "<title>CaptivePortal</title></head><body>"
       "<h1>Wifi config</h1>");
-  if (server.client().localIP() == apIP)
-  {
+  if (server.client().localIP() == apIP) {
     Page += String(F("<p>You are connected through the soft AP: ")) + softAP_ssid + F("</p>");
-  }
-  else
-  {
+  } else {
     Page += String(F("<p>You are connected through the wifi network: ")) + ssid + F("</p>");
   }
   Page += String(F(
@@ -85,15 +74,11 @@ void handleWifi()
   Serial.println("scan start");
   int n = WiFi.scanNetworks();
   Serial.println("scan done");
-  if (n > 0)
-  {
-    for (int i = 0; i < n; i++)
-    {
+  if (n > 0) {
+    for (int i = 0; i < n; i++) {
       Page += String(F("\r\n<tr><td>SSID ")) + WiFi.SSID(i) + ((WiFi.encryptionType(i) == ENC_TYPE_NONE) ? F(" ") : F(" *")) + F(" (") + WiFi.RSSI(i) + F(")</td></tr>");
     }
-  }
-  else
-  {
+  } else {
     Page += F("<tr><td>No WLAN found</td></tr>");
   }
   Page += F(
@@ -109,8 +94,7 @@ void handleWifi()
 }
 
 /** Handle the WLAN save form and redirect to WLAN config page again */
-void handleWifiSave()
-{
+void handleWifiSave() {
   Serial.println("wifi save");
   server.arg("n").toCharArray(ssid, sizeof(ssid) - 1);
   server.arg("p").toCharArray(password, sizeof(password) - 1);
@@ -124,10 +108,8 @@ void handleWifiSave()
   connect = strlen(ssid) > 0;  // Request WLAN connect with new credentials if there is a SSID
 }
 
-void handleNotFound()
-{
-  if (captivePortal())
-  {  // If caprive portal redirect instead of displaying the error page.
+void handleNotFound() {
+  if (captivePortal()) {  // If caprive portal redirect instead of displaying the error page.
     return;
   }
   String message = F("File Not Found\n\n");
@@ -139,8 +121,7 @@ void handleNotFound()
   message += server.args();
   message += F("\n");
 
-  for (uint8_t i = 0; i < server.args(); i++)
-  {
+  for (uint8_t i = 0; i < server.args(); i++) {
     message += String(F(" ")) + server.argName(i) + F(": ") + server.arg(i) + F("\n");
   }
   server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/tools.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/tools.ino
index e8fb014d35..6ed7b05b7d 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/tools.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/tools.ino
@@ -1,11 +1,8 @@
 /** Is this an IP? */
-boolean isIp(String str)
-{
-  for (size_t i = 0; i < str.length(); i++)
-  {
+boolean isIp(String str) {
+  for (size_t i = 0; i < str.length(); i++) {
     int c = str.charAt(i);
-    if (c != '.' && (c < '0' || c > '9'))
-    {
+    if (c != '.' && (c < '0' || c > '9')) {
       return false;
     }
   }
@@ -13,11 +10,9 @@ boolean isIp(String str)
 }
 
 /** IP to String? */
-String toStringIp(IPAddress ip)
-{
+String toStringIp(IPAddress ip) {
   String res = "";
-  for (int i = 0; i < 3; i++)
-  {
+  for (int i = 0; i < 3; i++) {
     res += String((ip >> (8 * i)) & 0xFF) + ".";
   }
   res += String(((ip >> 8 * 3)) & 0xFF);
diff --git a/libraries/DNSServer/examples/DNSServer/DNSServer.ino b/libraries/DNSServer/examples/DNSServer/DNSServer.ino
index 2916d5ab3c..f3b65d5bee 100644
--- a/libraries/DNSServer/examples/DNSServer/DNSServer.ino
+++ b/libraries/DNSServer/examples/DNSServer/DNSServer.ino
@@ -2,9 +2,9 @@
 #include <DNSServer.h>
 #include <ESP8266WebServer.h>
 
-const byte DNS_PORT = 53;
-IPAddress apIP(192, 168, 1, 1);
-DNSServer dnsServer;
+const byte       DNS_PORT = 53;
+IPAddress        apIP(192, 168, 1, 1);
+DNSServer        dnsServer;
 ESP8266WebServer webServer(80);
 
 void setup() {
diff --git a/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino b/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino
index 3295fecf9f..212eff9952 100644
--- a/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino
+++ b/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino
@@ -9,7 +9,7 @@
 #include <EEPROM.h>
 
 // start reading from the first byte (address 0) of the EEPROM
-int address = 0;
+int  address = 0;
 byte value;
 
 void setup() {
diff --git a/libraries/ESP8266AVRISP/examples/Arduino_Wifi_AVRISP/Arduino_Wifi_AVRISP.ino b/libraries/ESP8266AVRISP/examples/Arduino_Wifi_AVRISP/Arduino_Wifi_AVRISP.ino
index b3db7894c6..e0682b220b 100644
--- a/libraries/ESP8266AVRISP/examples/Arduino_Wifi_AVRISP/Arduino_Wifi_AVRISP.ino
+++ b/libraries/ESP8266AVRISP/examples/Arduino_Wifi_AVRISP/Arduino_Wifi_AVRISP.ino
@@ -14,10 +14,9 @@ const char*    pass      = STAPSK;
 const uint16_t port      = 328;
 const uint8_t  reset_pin = 5;
 
-ESP8266AVRISP  avrprog(port, reset_pin);
+ESP8266AVRISP avrprog(port, reset_pin);
 
-void           setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println("");
   Serial.println("Arduino AVR-ISP over TCP");
@@ -25,8 +24,7 @@ void           setup()
 
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
-  while (WiFi.waitForConnectResult() != WL_CONNECTED)
-  {
+  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
     WiFi.begin(ssid, pass);
     Serial.println("WiFi failed, retrying.");
   }
@@ -48,28 +46,22 @@ void           setup()
   avrprog.begin();
 }
 
-void loop()
-{
+void loop() {
   static AVRISPState_t last_state = AVRISP_STATE_IDLE;
   AVRISPState_t        new_state  = avrprog.update();
-  if (last_state != new_state)
-  {
-    switch (new_state)
-    {
-      case AVRISP_STATE_IDLE:
-      {
+  if (last_state != new_state) {
+    switch (new_state) {
+      case AVRISP_STATE_IDLE: {
         Serial.printf("[AVRISP] now idle\r\n");
         // Use the SPI bus for other purposes
         break;
       }
-      case AVRISP_STATE_PENDING:
-      {
+      case AVRISP_STATE_PENDING: {
         Serial.printf("[AVRISP] connection pending\r\n");
         // Clean up your other purposes and prepare for programming mode
         break;
       }
-      case AVRISP_STATE_ACTIVE:
-      {
+      case AVRISP_STATE_ACTIVE: {
         Serial.printf("[AVRISP] programming mode\r\n");
         // Stand by for completion
         break;
@@ -78,13 +70,11 @@ void loop()
     last_state = new_state;
   }
   // Serve the client
-  if (last_state != AVRISP_STATE_IDLE)
-  {
+  if (last_state != AVRISP_STATE_IDLE) {
     avrprog.serve();
   }
 
-  if (WiFi.status() == WL_CONNECTED)
-  {
+  if (WiFi.status() == WL_CONNECTED) {
     MDNS.update();
   }
 }
diff --git a/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino b/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino
index add86f1f10..59a459a52c 100644
--- a/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino
+++ b/libraries/ESP8266HTTPClient/examples/Authorization/Authorization.ino
@@ -16,8 +16,7 @@
 
 ESP8266WiFiMulti WiFiMulti;
 
-void             setup()
-{
+void setup() {
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -25,8 +24,7 @@ void             setup()
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--)
-  {
+  for (uint8_t t = 4; t > 0; t--) {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -36,11 +34,9 @@ void             setup()
   WiFiMulti.addAP("SSID", "PASSWORD");
 }
 
-void loop()
-{
+void loop() {
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED))
-  {
+  if ((WiFiMulti.run() == WL_CONNECTED)) {
     WiFiClient client;
 
     HTTPClient http;
@@ -65,20 +61,16 @@ void loop()
     int httpCode = http.GET();
 
     // httpCode will be negative on error
-    if (httpCode > 0)
-    {
+    if (httpCode > 0) {
       // HTTP header has been send and Server response header has been handled
       Serial.printf("[HTTP] GET... code: %d\n", httpCode);
 
       // file found at server
-      if (httpCode == HTTP_CODE_OK)
-      {
+      if (httpCode == HTTP_CODE_OK) {
         String payload = http.getString();
         Serial.println(payload);
       }
-    }
-    else
-    {
+    } else {
       Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
     }
 
diff --git a/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino b/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
index 0ae48db06c..85190df74d 100644
--- a/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
@@ -16,8 +16,7 @@
 
 ESP8266WiFiMulti WiFiMulti;
 
-void             setup()
-{
+void setup() {
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -25,8 +24,7 @@ void             setup()
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--)
-  {
+  for (uint8_t t = 4; t > 0; t--) {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -36,45 +34,36 @@ void             setup()
   WiFiMulti.addAP("SSID", "PASSWORD");
 }
 
-void loop()
-{
+void loop() {
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED))
-  {
+  if ((WiFiMulti.run() == WL_CONNECTED)) {
     WiFiClient client;
 
     HTTPClient http;
 
     Serial.print("[HTTP] begin...\n");
-    if (http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html"))
-    {  // HTTP
+    if (http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html")) {  // HTTP
 
       Serial.print("[HTTP] GET...\n");
       // start connection and send HTTP header
       int httpCode = http.GET();
 
       // httpCode will be negative on error
-      if (httpCode > 0)
-      {
+      if (httpCode > 0) {
         // HTTP header has been send and Server response header has been handled
         Serial.printf("[HTTP] GET... code: %d\n", httpCode);
 
         // file found at server
-        if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY)
-        {
+        if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {
           String payload = http.getString();
           Serial.println(payload);
         }
-      }
-      else
-      {
+      } else {
         Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
       }
 
       http.end();
-    }
-    else
-    {
+    } else {
       Serial.printf("[HTTP} Unable to connect\n");
     }
   }
diff --git a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
index b91f8f116f..4a3618962d 100644
--- a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
@@ -14,12 +14,11 @@
 
 #include <WiFiClientSecureBearSSL.h>
 // Fingerprint for demo URL, expires on June 2, 2021, needs to be updated well before this date
-const uint8_t    fingerprint[20] = { 0x40, 0xaf, 0x00, 0x6b, 0xec, 0x90, 0x22, 0x41, 0x8e, 0xa3, 0xad, 0xfa, 0x1a, 0xe8, 0x25, 0x41, 0x1d, 0x1a, 0x54, 0xb3 };
+const uint8_t fingerprint[20] = { 0x40, 0xaf, 0x00, 0x6b, 0xec, 0x90, 0x22, 0x41, 0x8e, 0xa3, 0xad, 0xfa, 0x1a, 0xe8, 0x25, 0x41, 0x1d, 0x1a, 0x54, 0xb3 };
 
 ESP8266WiFiMulti WiFiMulti;
 
-void             setup()
-{
+void setup() {
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -27,8 +26,7 @@ void             setup()
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--)
-  {
+  for (uint8_t t = 4; t > 0; t--) {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -38,11 +36,9 @@ void             setup()
   WiFiMulti.addAP("SSID", "PASSWORD");
 }
 
-void loop()
-{
+void loop() {
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED))
-  {
+  if ((WiFiMulti.run() == WL_CONNECTED)) {
     std::unique_ptr<BearSSL::WiFiClientSecure> client(new BearSSL::WiFiClientSecure);
 
     client->setFingerprint(fingerprint);
@@ -52,35 +48,28 @@ void loop()
     HTTPClient https;
 
     Serial.print("[HTTPS] begin...\n");
-    if (https.begin(*client, "https://jigsaw.w3.org/HTTP/connection.html"))
-    {  // HTTPS
+    if (https.begin(*client, "https://jigsaw.w3.org/HTTP/connection.html")) {  // HTTPS
 
       Serial.print("[HTTPS] GET...\n");
       // start connection and send HTTP header
       int httpCode = https.GET();
 
       // httpCode will be negative on error
-      if (httpCode > 0)
-      {
+      if (httpCode > 0) {
         // HTTP header has been send and Server response header has been handled
         Serial.printf("[HTTPS] GET... code: %d\n", httpCode);
 
         // file found at server
-        if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY)
-        {
+        if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) {
           String payload = https.getString();
           Serial.println(payload);
         }
-      }
-      else
-      {
+      } else {
         Serial.printf("[HTTPS] GET... failed, error: %s\n", https.errorToString(httpCode).c_str());
       }
 
       https.end();
-    }
-    else
-    {
+    } else {
       Serial.printf("[HTTPS] Unable to connect\n");
     }
   }
diff --git a/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino b/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
index e7b838f01f..8786bd09a5 100644
--- a/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
+++ b/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
@@ -19,45 +19,40 @@
 const char* ssid         = STASSID;
 const char* ssidPassword = STAPSK;
 
-const char* username     = "admin";
-const char* password     = "admin";
+const char* username = "admin";
+const char* password = "admin";
 
-const char* server       = "http://httpbin.org";
-const char* uri          = "/digest-auth/auth/admin/admin/MD5";
+const char* server = "http://httpbin.org";
+const char* uri    = "/digest-auth/auth/admin/admin/MD5";
 
-String      exractParam(String& authReq, const String& param, const char delimit)
-{
+String exractParam(String& authReq, const String& param, const char delimit) {
   int _begin = authReq.indexOf(param);
-  if (_begin == -1)
-  {
+  if (_begin == -1) {
     return "";
   }
   return authReq.substring(_begin + param.length(), authReq.indexOf(delimit, _begin + param.length()));
 }
 
-String getCNonce(const int len)
-{
+String getCNonce(const int len) {
   static const char alphanum[] = "0123456789"
                                  "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                                  "abcdefghijklmnopqrstuvwxyz";
   String s = "";
 
-  for (int i = 0; i < len; ++i)
-  {
+  for (int i = 0; i < len; ++i) {
     s += alphanum[rand() % (sizeof(alphanum) - 1)];
   }
 
   return s;
 }
 
-String getDigestAuth(String& authReq, const String& username, const String& password, const String& method, const String& uri, unsigned int counter)
-{
+String getDigestAuth(String& authReq, const String& username, const String& password, const String& method, const String& uri, unsigned int counter) {
   // extracting required parameters for RFC 2069 simpler Digest
   String realm  = exractParam(authReq, "realm=\"", '"');
   String nonce  = exractParam(authReq, "nonce=\"", '"');
   String cNonce = getCNonce(8);
 
-  char   nc[9];
+  char nc[9];
   snprintf(nc, sizeof(nc), "%08x", counter);
 
   // parameters for the RFC 2617 newer Digest
@@ -75,7 +70,7 @@ String getDigestAuth(String& authReq, const String& username, const String& pass
   md5.begin();
   md5.add(h1 + ":" + nonce + ":" + String(nc) + ":" + cNonce + ":" + "auth" + ":" + h2);
   md5.calculate();
-  String response      = md5.toString();
+  String response = md5.toString();
 
   String authorization = "Digest username=\"" + username + "\", realm=\"" + realm + "\", nonce=\"" + nonce + "\", uri=\"" + uri + "\", algorithm=\"MD5\", qop=auth, nc=" + String(nc) + ", cnonce=\"" + cNonce + "\", response=\"" + response + "\"";
   Serial.println(authorization);
@@ -83,16 +78,14 @@ String getDigestAuth(String& authReq, const String& username, const String& pass
   return authorization;
 }
 
-void setup()
-{
+void setup() {
   randomSeed(RANDOM_REG32);
   Serial.begin(115200);
 
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, ssidPassword);
 
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -103,8 +96,7 @@ void setup()
   Serial.println(WiFi.localIP());
 }
 
-void loop()
-{
+void loop() {
   WiFiClient client;
   HTTPClient http;  //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
 
@@ -120,8 +112,7 @@ void loop()
   // start connection and send HTTP header
   int httpCode = http.GET();
 
-  if (httpCode > 0)
-  {
+  if (httpCode > 0) {
     String authReq = http.header("WWW-Authenticate");
     Serial.println(authReq);
 
@@ -133,18 +124,13 @@ void loop()
     http.addHeader("Authorization", authorization);
 
     int httpCode = http.GET();
-    if (httpCode > 0)
-    {
+    if (httpCode > 0) {
       String payload = http.getString();
       Serial.println(payload);
-    }
-    else
-    {
+    } else {
       Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
     }
-  }
-  else
-  {
+  } else {
     Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
   }
 
diff --git a/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino b/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
index 5ac3868708..04648a56eb 100644
--- a/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
@@ -23,8 +23,7 @@
 #define STAPSK "your-password"
 #endif
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
 
   Serial.println();
@@ -33,8 +32,7 @@ void setup()
 
   WiFi.begin(STASSID, STAPSK);
 
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -43,11 +41,9 @@ void setup()
   Serial.println(WiFi.localIP());
 }
 
-void loop()
-{
+void loop() {
   // wait for WiFi connection
-  if ((WiFi.status() == WL_CONNECTED))
-  {
+  if ((WiFi.status() == WL_CONNECTED)) {
     WiFiClient client;
     HTTPClient http;
 
@@ -61,22 +57,18 @@ void loop()
     int httpCode = http.POST("{\"hello\":\"world\"}");
 
     // httpCode will be negative on error
-    if (httpCode > 0)
-    {
+    if (httpCode > 0) {
       // HTTP header has been send and Server response header has been handled
       Serial.printf("[HTTP] POST... code: %d\n", httpCode);
 
       // file found at server
-      if (httpCode == HTTP_CODE_OK)
-      {
+      if (httpCode == HTTP_CODE_OK) {
         const String& payload = http.getString();
         Serial.println("received payload:\n<<");
         Serial.println(payload);
         Serial.println(">>");
       }
-    }
-    else
-    {
+    } else {
       Serial.printf("[HTTP] POST... failed, error: %s\n", http.errorToString(httpCode).c_str());
     }
 
diff --git a/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino b/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
index 9f5c29db5b..2f0961f645 100644
--- a/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
+++ b/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
@@ -17,11 +17,10 @@
 
 ESP8266WiFiMulti WiFiMulti;
 
-HTTPClient       http;
-WiFiClient       client;
+HTTPClient http;
+WiFiClient client;
 
-void             setup()
-{
+void setup() {
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -33,8 +32,7 @@ void             setup()
   WiFiMulti.addAP(STASSID, STAPSK);
 
   // wait for WiFi connection
-  while ((WiFiMulti.run() != WL_CONNECTED))
-  {
+  while ((WiFiMulti.run() != WL_CONNECTED)) {
     Serial.write('.');
     delay(500);
   }
@@ -47,28 +45,22 @@ void             setup()
   //http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
 }
 
-int  pass = 0;
+int pass = 0;
 
-void loop()
-{
+void loop() {
   // First 10 loop()s, retrieve the URL
-  if (pass < 10)
-  {
+  if (pass < 10) {
     pass++;
     Serial.printf("Reuse connection example, GET url for the %d time\n", pass);
     int httpCode = http.GET();
-    if (httpCode > 0)
-    {
+    if (httpCode > 0) {
       Serial.printf("[HTTP] GET... code: %d\n", httpCode);
 
       // file found at server
-      if (httpCode == HTTP_CODE_OK)
-      {
+      if (httpCode == HTTP_CODE_OK) {
         http.writeToStream(&Serial);
       }
-    }
-    else
-    {
+    } else {
       Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
       // Something went wrong with the connection, try to reconnect
       http.end();
@@ -76,13 +68,10 @@ void loop()
       //http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
     }
 
-    if (pass == 10)
-    {
+    if (pass == 10) {
       http.end();
       Serial.println("Done testing");
-    }
-    else
-    {
+    } else {
       Serial.println("\n\n\nWait 5 second...\n");
       delay(5000);
     }
diff --git a/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino b/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
index a165646677..397639b504 100644
--- a/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
@@ -14,8 +14,7 @@
 
 ESP8266WiFiMulti WiFiMulti;
 
-void             setup()
-{
+void setup() {
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -23,8 +22,7 @@ void             setup()
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--)
-  {
+  for (uint8_t t = 4; t > 0; t--) {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -34,11 +32,9 @@ void             setup()
   WiFiMulti.addAP("SSID", "PASSWORD");
 }
 
-void loop()
-{
+void loop() {
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED))
-  {
+  if ((WiFiMulti.run() == WL_CONNECTED)) {
     WiFiClient client;
     HTTPClient http;  //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
 
@@ -51,16 +47,14 @@ void loop()
     Serial.print("[HTTP] GET...\n");
     // start connection and send HTTP header
     int httpCode = http.GET();
-    if (httpCode > 0)
-    {
+    if (httpCode > 0) {
       // HTTP header has been send and Server response header has been handled
       Serial.printf("[HTTP] GET... code: %d\n", httpCode);
 
       // file found at server
-      if (httpCode == HTTP_CODE_OK)
-      {
+      if (httpCode == HTTP_CODE_OK) {
         // get length of document (is -1 when Server sends no Content-Length header)
-        int     len       = http.getSize();
+        int len = http.getSize();
 
         // create buffer for read
         uint8_t buff[128] = { 0 };
@@ -75,21 +69,18 @@ void loop()
         WiFiClient* stream = &client;
 
         // read all data from server
-        while (http.connected() && (len > 0 || len == -1))
-        {
+        while (http.connected() && (len > 0 || len == -1)) {
           // read up to 128 byte
           int c = stream->readBytes(buff, std::min((size_t)len, sizeof(buff)));
           Serial.printf("readBytes: %d\n", c);
-          if (!c)
-          {
+          if (!c) {
             Serial.println("read timeout");
           }
 
           // write it to Serial
           Serial.write(buff, c);
 
-          if (len > 0)
-          {
+          if (len > 0) {
             len -= c;
           }
         }
@@ -98,9 +89,7 @@ void loop()
         Serial.println();
         Serial.print("[HTTP] connection closed or file end.\n");
       }
-    }
-    else
-    {
+    } else {
       Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
     }
 
diff --git a/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
index 011ef3a569..cb280a3d27 100644
--- a/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
@@ -14,8 +14,7 @@
 
 ESP8266WiFiMulti WiFiMulti;
 
-void             setup()
-{
+void setup() {
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -23,8 +22,7 @@ void             setup()
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--)
-  {
+  for (uint8_t t = 4; t > 0; t--) {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -34,18 +32,15 @@ void             setup()
   WiFiMulti.addAP("SSID", "PASSWORD");
 }
 
-void loop()
-{
+void loop() {
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED))
-  {
+  if ((WiFiMulti.run() == WL_CONNECTED)) {
     std::unique_ptr<BearSSL::WiFiClientSecure> client(new BearSSL::WiFiClientSecure);
 
-    bool                                       mfln = client->probeMaxFragmentLength("tls.mbed.org", 443, 1024);
+    bool mfln = client->probeMaxFragmentLength("tls.mbed.org", 443, 1024);
     Serial.printf("\nConnecting to https://tls.mbed.org\n");
     Serial.printf("Maximum fragment Length negotiation supported: %s\n", mfln ? "yes" : "no");
-    if (mfln)
-    {
+    if (mfln) {
       client->setBufferSizes(1024, 1024);
     }
 
@@ -58,41 +53,35 @@ void loop()
 
     HTTPClient https;
 
-    if (https.begin(*client, "https://tls.mbed.org/"))
-    {
+    if (https.begin(*client, "https://tls.mbed.org/")) {
       Serial.print("[HTTPS] GET...\n");
       // start connection and send HTTP header
       int httpCode = https.GET();
-      if (httpCode > 0)
-      {
+      if (httpCode > 0) {
         // HTTP header has been send and Server response header has been handled
         Serial.printf("[HTTPS] GET... code: %d\n", httpCode);
 
         // file found at server
-        if (httpCode == HTTP_CODE_OK)
-        {
+        if (httpCode == HTTP_CODE_OK) {
           // get length of document (is -1 when Server sends no Content-Length header)
-          int            len       = https.getSize();
+          int len = https.getSize();
 
           // create buffer for read
           static uint8_t buff[128] = { 0 };
 
           // read all data from server
-          while (https.connected() && (len > 0 || len == -1))
-          {
+          while (https.connected() && (len > 0 || len == -1)) {
             // get available data size
             size_t size = client->available();
 
-            if (size)
-            {
+            if (size) {
               // read up to 128 byte
               int c = client->readBytes(buff, ((size > sizeof(buff)) ? sizeof(buff) : size));
 
               // write it to Serial
               Serial.write(buff, c);
 
-              if (len > 0)
-              {
+              if (len > 0) {
                 len -= c;
               }
             }
@@ -102,16 +91,12 @@ void loop()
           Serial.println();
           Serial.print("[HTTPS] connection closed or file end.\n");
         }
-      }
-      else
-      {
+      } else {
         Serial.printf("[HTTPS] GET... failed, error: %s\n", https.errorToString(httpCode).c_str());
       }
 
       https.end();
-    }
-    else
-    {
+    } else {
       Serial.printf("Unable to connect\n");
     }
   }
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino
index 0feea5c4f4..d30e8b342d 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino
@@ -24,17 +24,17 @@
 #define STAPSK "your-password"
 #endif
 
-const char*                   host            = "esp8266-webupdate";
-const char*                   update_path     = "/firmware";
-const char*                   update_username = "admin";
-const char*                   update_password = "admin";
-const char*                   ssid            = STASSID;
-const char*                   password        = STAPSK;
+const char* host            = "esp8266-webupdate";
+const char* update_path     = "/firmware";
+const char* update_username = "admin";
+const char* update_password = "admin";
+const char* ssid            = STASSID;
+const char* password        = STAPSK;
 
 ESP8266WebServerSecure        httpServer(443);
 ESP8266HTTPUpdateServerSecure httpUpdater;
 
-static const char             serverCert[] PROGMEM = R"EOF(
+static const char serverCert[] PROGMEM = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIDSzCCAjMCCQD2ahcfZAwXxDANBgkqhkiG9w0BAQsFADCBiTELMAkGA1UEBhMC
 VVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU9yYW5nZSBDb3VudHkx
@@ -57,7 +57,7 @@ JfUvYadSYxh3nblvA4OL+iEZiW8NE3hbW6WPXxvS7Euge0uWMPc4uEcnsE0ZVG3m
 -----END CERTIFICATE-----
 )EOF";
 
-static const char             serverKey[] PROGMEM  = R"EOF(
+static const char serverKey[] PROGMEM = R"EOF(
 -----BEGIN RSA PRIVATE KEY-----
 MIIEpQIBAAKCAQEA9UoHBtn4oNKXjRgIOQ/rLxK/iI0a8Q5mDxhfuwa9//FkftSI
 IFY8UhGk2YNJpnfKOyYWqbqwuJhIZJ2sEIWp2301OnavuGBrpKOgBJJljgH2l/4Z
@@ -87,16 +87,14 @@ gz5JWYhbD6c38khSzJb0pNXCo3EuYAVa36kDM96k1BtWuhRS10Q1VXk=
 -----END RSA PRIVATE KEY-----
 )EOF";
 
-void                          setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println();
   Serial.println("Booting Sketch...");
   WiFi.mode(WIFI_AP_STA);
   WiFi.begin(ssid, password);
 
-  while (WiFi.waitForConnectResult() != WL_CONNECTED)
-  {
+  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
     WiFi.begin(ssid, password);
     Serial.println("WiFi failed, retrying.");
   }
@@ -116,8 +114,7 @@ void                          setup()
                 host, update_path, update_username, update_password);
 }
 
-void loop()
-{
+void loop() {
   httpServer.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
index ace93bdf93..0270fa9723 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
@@ -13,26 +13,24 @@
 #define STAPSK "your-password"
 #endif
 
-const char*             host            = "esp8266-webupdate";
-const char*             update_path     = "/firmware";
-const char*             update_username = "admin";
-const char*             update_password = "admin";
-const char*             ssid            = STASSID;
-const char*             password        = STAPSK;
+const char* host            = "esp8266-webupdate";
+const char* update_path     = "/firmware";
+const char* update_username = "admin";
+const char* update_password = "admin";
+const char* ssid            = STASSID;
+const char* password        = STAPSK;
 
 ESP8266WebServer        httpServer(80);
 ESP8266HTTPUpdateServer httpUpdater;
 
-void                    setup(void)
-{
+void setup(void) {
   Serial.begin(115200);
   Serial.println();
   Serial.println("Booting Sketch...");
   WiFi.mode(WIFI_AP_STA);
   WiFi.begin(ssid, password);
 
-  while (WiFi.waitForConnectResult() != WL_CONNECTED)
-  {
+  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
     WiFi.begin(ssid, password);
     Serial.println("WiFi failed, retrying.");
   }
@@ -46,8 +44,7 @@ void                    setup(void)
   Serial.printf("HTTPUpdateServer ready! Open http://%s.local%s in your browser and login with username '%s' and password '%s'\n", host, update_path, update_username, update_password);
 }
 
-void loop(void)
-{
+void loop(void) {
   httpServer.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
index 411998b1dd..f7644aa683 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
@@ -13,23 +13,21 @@
 #define STAPSK "your-password"
 #endif
 
-const char*             host     = "esp8266-webupdate";
-const char*             ssid     = STASSID;
-const char*             password = STAPSK;
+const char* host     = "esp8266-webupdate";
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer        httpServer(80);
 ESP8266HTTPUpdateServer httpUpdater;
 
-void                    setup(void)
-{
+void setup(void) {
   Serial.begin(115200);
   Serial.println();
   Serial.println("Booting Sketch...");
   WiFi.mode(WIFI_AP_STA);
   WiFi.begin(ssid, password);
 
-  while (WiFi.waitForConnectResult() != WL_CONNECTED)
-  {
+  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
     WiFi.begin(ssid, password);
     Serial.println("WiFi failed, retrying.");
   }
@@ -43,8 +41,7 @@ void                    setup(void)
   Serial.printf("HTTPUpdateServer ready! Open http://%s.local/update in your browser\n", host);
 }
 
-void loop(void)
-{
+void loop(void) {
   httpServer.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino b/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
index ddc8f44432..c29a76fe98 100644
--- a/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
+++ b/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
@@ -65,23 +65,20 @@
 #define STAPSK "your-password"
 #endif
 
-const char*      ssid     = STASSID;
-const char*      password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer web_server(80);
 
-void             handle_http_not_found()
-{
+void handle_http_not_found() {
   web_server.send(404, "text/plain", "Not Found");
 }
 
-void handle_http_root()
-{
+void handle_http_root() {
   web_server.send(200, "text/plain", "It works!");
 }
 
-void setup(void)
-{
+void setup(void) {
   Serial.begin(115200);
 
   // Connect to WiFi network
@@ -90,8 +87,7 @@ void setup(void)
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -111,7 +107,6 @@ void setup(void)
   Serial.println("HTTP server started");
 }
 
-void loop(void)
-{
+void loop(void) {
   web_server.handleClient();
 }
diff --git a/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino b/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
index 3ecf5ea95e..22c8986fbf 100644
--- a/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
+++ b/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
@@ -7,14 +7,13 @@
 #define STAPSK "your-password"
 #endif
 
-const char*      ssid     = STASSID;
-const char*      password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer wwwserver(80);
 String           content;
 
-static void      handleRoot(void)
-{
+static void handleRoot(void) {
   content = F("<!DOCTYPE HTML>\n<html>Hello world from ESP8266");
   content += F("<p>");
   content += F("</html>");
@@ -22,8 +21,7 @@ static void      handleRoot(void)
   wwwserver.send(200, F("text/html"), content);
 }
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
 
   // Connect to WiFi network
@@ -32,8 +30,7 @@ void setup()
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -49,7 +46,6 @@ void setup()
   NBNS.begin("ESP");
 }
 
-void loop()
-{
+void loop() {
   wwwserver.handleClient();
 }
diff --git a/libraries/ESP8266SSDP/examples/SSDP/SSDP.ino b/libraries/ESP8266SSDP/examples/SSDP/SSDP.ino
index 7fff5454f5..081a41f154 100644
--- a/libraries/ESP8266SSDP/examples/SSDP/SSDP.ino
+++ b/libraries/ESP8266SSDP/examples/SSDP/SSDP.ino
@@ -7,26 +7,22 @@
 #define STAPSK "your-password"
 #endif
 
-const char*      ssid     = STASSID;
-const char*      password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer HTTP(80);
 
-void             setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println();
   Serial.println("Starting WiFi...");
 
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
-  if (WiFi.waitForConnectResult() == WL_CONNECTED)
-  {
+  if (WiFi.waitForConnectResult() == WL_CONNECTED) {
     Serial.printf("Starting HTTP...\n");
-    HTTP.on("/index.html", HTTP_GET, []()
-            { HTTP.send(200, "text/plain", "Hello World!"); });
-    HTTP.on("/description.xml", HTTP_GET, []()
-            { SSDP.schema(HTTP.client()); });
+    HTTP.on("/index.html", HTTP_GET, []() { HTTP.send(200, "text/plain", "Hello World!"); });
+    HTTP.on("/description.xml", HTTP_GET, []() { SSDP.schema(HTTP.client()); });
     HTTP.begin();
 
     Serial.printf("Starting SSDP...\n");
@@ -43,19 +39,15 @@ void             setup()
     SSDP.begin();
 
     Serial.printf("Ready!\n");
-  }
-  else
-  {
+  } else {
     Serial.printf("WiFi Failed\n");
-    while (1)
-    {
+    while (1) {
       delay(100);
     }
   }
 }
 
-void loop()
-{
+void loop() {
   HTTP.handleClient();
   delay(1);
 }
diff --git a/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino b/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
index c91e8779d8..cf11a89012 100644
--- a/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
+++ b/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
@@ -38,15 +38,14 @@
 #define STAPSK "your-password"
 #endif
 
-const char*      ssid     = STASSID;
-const char*      password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer server(80);
 
-const int        led = 13;
+const int led = 13;
 
-void             handleRoot()
-{
+void handleRoot() {
   digitalWrite(led, 1);
   char temp[400];
   int  sec = millis() / 1000;
@@ -75,8 +74,7 @@ void             handleRoot()
   digitalWrite(led, 0);
 }
 
-void handleNotFound()
-{
+void handleNotFound() {
   digitalWrite(led, 1);
   String message = "File Not Found\n\n";
   message += "URI: ";
@@ -87,8 +85,7 @@ void handleNotFound()
   message += server.args();
   message += "\n";
 
-  for (uint8_t i = 0; i < server.args(); i++)
-  {
+  for (uint8_t i = 0; i < server.args(); i++) {
     message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
   }
 
@@ -96,8 +93,7 @@ void handleNotFound()
   digitalWrite(led, 0);
 }
 
-void drawGraph()
-{
+void drawGraph() {
   String out;
   out.reserve(2600);
   char temp[70];
@@ -105,8 +101,7 @@ void drawGraph()
   out += "<rect width=\"400\" height=\"150\" fill=\"rgb(250, 230, 210)\" stroke-width=\"1\" stroke=\"rgb(0, 0, 0)\" />\n";
   out += "<g stroke=\"black\">\n";
   int y = rand() % 130;
-  for (int x = 10; x < 390; x += 10)
-  {
+  for (int x = 10; x < 390; x += 10) {
     int y2 = rand() % 130;
     sprintf(temp, "<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" stroke-width=\"1\" />\n", x, 140 - y, x + 10, 140 - y2);
     out += temp;
@@ -117,8 +112,7 @@ void drawGraph()
   server.send(200, "image/svg+xml", out);
 }
 
-void setup(void)
-{
+void setup(void) {
   pinMode(led, OUTPUT);
   digitalWrite(led, 0);
   Serial.begin(115200);
@@ -127,8 +121,7 @@ void setup(void)
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -139,22 +132,19 @@ void setup(void)
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-  if (MDNS.begin("esp8266"))
-  {
+  if (MDNS.begin("esp8266")) {
     Serial.println("MDNS responder started");
   }
 
   server.on("/", handleRoot);
   server.on("/test.svg", drawGraph);
-  server.on("/inline", []()
-            { server.send(200, "text/plain", "this works as well"); });
+  server.on("/inline", []() { server.send(200, "text/plain", "this works as well"); });
   server.onNotFound(handleNotFound);
   server.begin();
   Serial.println("HTTP server started");
 }
 
-void loop(void)
-{
+void loop(void) {
   server.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino b/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
index e816a49354..c29c5bd162 100644
--- a/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
+++ b/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
@@ -74,16 +74,16 @@ SDFSConfig  fileSystemConfig = SDFSConfig();
 #define STAPSK "your-password"
 #endif
 
-const char*       ssid     = STASSID;
-const char*       password = STAPSK;
-const char*       host     = "fsbrowser";
+const char* ssid     = STASSID;
+const char* password = STAPSK;
+const char* host     = "fsbrowser";
 
-ESP8266WebServer  server(80);
+ESP8266WebServer server(80);
 
-static bool       fsOK;
-String            unsupportedFiles = String();
+static bool fsOK;
+String      unsupportedFiles = String();
 
-File              uploadFile;
+File uploadFile;
 
 static const char TEXT_PLAIN[] PROGMEM     = "text/plain";
 static const char FS_INIT_ERROR[] PROGMEM  = "FS INIT ERROR";
@@ -92,29 +92,24 @@ static const char FILE_NOT_FOUND[] PROGMEM = "FileNotFound";
 ////////////////////////////////
 // Utils to return HTTP codes, and determine content-type
 
-void              replyOK()
-{
+void replyOK() {
   server.send(200, FPSTR(TEXT_PLAIN), "");
 }
 
-void replyOKWithMsg(String msg)
-{
+void replyOKWithMsg(String msg) {
   server.send(200, FPSTR(TEXT_PLAIN), msg);
 }
 
-void replyNotFound(String msg)
-{
+void replyNotFound(String msg) {
   server.send(404, FPSTR(TEXT_PLAIN), msg);
 }
 
-void replyBadRequest(String msg)
-{
+void replyBadRequest(String msg) {
   DBG_OUTPUT_PORT.println(msg);
   server.send(400, FPSTR(TEXT_PLAIN), msg + "\r\n");
 }
 
-void replyServerError(String msg)
-{
+void replyServerError(String msg) {
   DBG_OUTPUT_PORT.println(msg);
   server.send(500, FPSTR(TEXT_PLAIN), msg + "\r\n");
 }
@@ -124,19 +119,15 @@ void replyServerError(String msg)
    Checks filename for character combinations that are not supported by FSBrowser (alhtough valid on SPIFFS).
    Returns an empty String if supported, or detail of error(s) if unsupported
 */
-String checkForUnsupportedPath(String filename)
-{
+String checkForUnsupportedPath(String filename) {
   String error = String();
-  if (!filename.startsWith("/"))
-  {
+  if (!filename.startsWith("/")) {
     error += F("!NO_LEADING_SLASH! ");
   }
-  if (filename.indexOf("//") != -1)
-  {
+  if (filename.indexOf("//") != -1) {
     error += F("!DOUBLE_SLASH! ");
   }
-  if (filename.endsWith("/"))
-  {
+  if (filename.endsWith("/")) {
     error += F("!TRAILING_SLASH! ");
   }
   return error;
@@ -149,8 +140,7 @@ String checkForUnsupportedPath(String filename)
 /*
    Return the FS type, status and size info
 */
-void handleStatus()
-{
+void handleStatus() {
   DBG_OUTPUT_PORT.println("handleStatus");
   FSInfo fs_info;
   String json;
@@ -159,17 +149,14 @@ void handleStatus()
   json = "{\"type\":\"";
   json += fsName;
   json += "\", \"isOk\":";
-  if (fsOK)
-  {
+  if (fsOK) {
     fileSystem->info(fs_info);
     json += F("\"true\", \"totalBytes\":\"");
     json += fs_info.totalBytes;
     json += F("\", \"usedBytes\":\"");
     json += fs_info.usedBytes;
     json += "\"";
-  }
-  else
-  {
+  } else {
     json += "\"false\"";
   }
   json += F(",\"unsupportedFiles\":\"");
@@ -183,21 +170,17 @@ void handleStatus()
    Return the list of files in the directory specified by the "dir" query string parameter.
    Also demonstrates the use of chunked responses.
 */
-void handleFileList()
-{
-  if (!fsOK)
-  {
+void handleFileList() {
+  if (!fsOK) {
     return replyServerError(FPSTR(FS_INIT_ERROR));
   }
 
-  if (!server.hasArg("dir"))
-  {
+  if (!server.hasArg("dir")) {
     return replyBadRequest(F("DIR ARG MISSING"));
   }
 
   String path = server.arg("dir");
-  if (path != "/" && !fileSystem->exists(path))
-  {
+  if (path != "/" && !fileSystem->exists(path)) {
     return replyBadRequest("BAD PATH");
   }
 
@@ -206,8 +189,7 @@ void handleFileList()
   path.clear();
 
   // use HTTP/1.1 Chunked response to avoid building a huge temporary string
-  if (!server.chunkedResponseModeStart(200, "text/json"))
-  {
+  if (!server.chunkedResponseModeStart(200, "text/json")) {
     server.send(505, F("text/html"), F("HTTP1.1 required"));
     return;
   }
@@ -215,47 +197,36 @@ void handleFileList()
   // use the same string for every line
   String output;
   output.reserve(64);
-  while (dir.next())
-  {
+  while (dir.next()) {
 #ifdef USE_SPIFFS
     String error = checkForUnsupportedPath(dir.fileName());
-    if (error.length() > 0)
-    {
+    if (error.length() > 0) {
       DBG_OUTPUT_PORT.println(String("Ignoring ") + error + dir.fileName());
       continue;
     }
 #endif
-    if (output.length())
-    {
+    if (output.length()) {
       // send string from previous iteration
       // as an HTTP chunk
       server.sendContent(output);
       output = ',';
-    }
-    else
-    {
+    } else {
       output = '[';
     }
 
     output += "{\"type\":\"";
-    if (dir.isDirectory())
-    {
+    if (dir.isDirectory()) {
       output += "dir";
-    }
-    else
-    {
+    } else {
       output += F("file\",\"size\":\"");
       output += dir.fileSize();
     }
 
     output += F("\",\"name\":\"");
     // Always return names without leading "/"
-    if (dir.fileName()[0] == '/')
-    {
+    if (dir.fileName()[0] == '/') {
       output += &(dir.fileName()[1]);
-    }
-    else
-    {
+    } else {
       output += dir.fileName();
     }
 
@@ -271,40 +242,31 @@ void handleFileList()
 /*
    Read the given file from the filesystem and stream it back to the client
 */
-bool handleFileRead(String path)
-{
+bool handleFileRead(String path) {
   DBG_OUTPUT_PORT.println(String("handleFileRead: ") + path);
-  if (!fsOK)
-  {
+  if (!fsOK) {
     replyServerError(FPSTR(FS_INIT_ERROR));
     return true;
   }
 
-  if (path.endsWith("/"))
-  {
+  if (path.endsWith("/")) {
     path += "index.htm";
   }
 
   String contentType;
-  if (server.hasArg("download"))
-  {
+  if (server.hasArg("download")) {
     contentType = F("application/octet-stream");
-  }
-  else
-  {
+  } else {
     contentType = mime::getContentType(path);
   }
 
-  if (!fileSystem->exists(path))
-  {
+  if (!fileSystem->exists(path)) {
     // File not found, try gzip version
     path = path + ".gz";
   }
-  if (fileSystem->exists(path))
-  {
+  if (fileSystem->exists(path)) {
     File file = fileSystem->open(path, "r");
-    if (server.streamFile(file, contentType) != file.size())
-    {
+    if (server.streamFile(file, contentType) != file.size()) {
       DBG_OUTPUT_PORT.println("Sent less data than expected!");
     }
     file.close();
@@ -318,16 +280,11 @@ bool handleFileRead(String path)
    As some FS (e.g. LittleFS) delete the parent folder when the last child has been removed,
    return the path of the closest parent still existing
 */
-String lastExistingParent(String path)
-{
-  while (!path.isEmpty() && !fileSystem->exists(path))
-  {
-    if (path.lastIndexOf('/') > 0)
-    {
+String lastExistingParent(String path) {
+  while (!path.isEmpty() && !fileSystem->exists(path)) {
+    if (path.lastIndexOf('/') > 0) {
       path = path.substring(0, path.lastIndexOf('/'));
-    }
-    else
-    {
+    } else {
       path = String();  // No slash => the top folder does not exist
     }
   }
@@ -346,93 +303,71 @@ String lastExistingParent(String path)
    Rename folder  | parent of source folder
    Move folder    | parent of source folder, or remaining ancestor
 */
-void handleFileCreate()
-{
-  if (!fsOK)
-  {
+void handleFileCreate() {
+  if (!fsOK) {
     return replyServerError(FPSTR(FS_INIT_ERROR));
   }
 
   String path = server.arg("path");
-  if (path.isEmpty())
-  {
+  if (path.isEmpty()) {
     return replyBadRequest(F("PATH ARG MISSING"));
   }
 
 #ifdef USE_SPIFFS
-  if (checkForUnsupportedPath(path).length() > 0)
-  {
+  if (checkForUnsupportedPath(path).length() > 0) {
     return replyServerError(F("INVALID FILENAME"));
   }
 #endif
 
-  if (path == "/")
-  {
+  if (path == "/") {
     return replyBadRequest("BAD PATH");
   }
-  if (fileSystem->exists(path))
-  {
+  if (fileSystem->exists(path)) {
     return replyBadRequest(F("PATH FILE EXISTS"));
   }
 
   String src = server.arg("src");
-  if (src.isEmpty())
-  {
+  if (src.isEmpty()) {
     // No source specified: creation
     DBG_OUTPUT_PORT.println(String("handleFileCreate: ") + path);
-    if (path.endsWith("/"))
-    {
+    if (path.endsWith("/")) {
       // Create a folder
       path.remove(path.length() - 1);
-      if (!fileSystem->mkdir(path))
-      {
+      if (!fileSystem->mkdir(path)) {
         return replyServerError(F("MKDIR FAILED"));
       }
-    }
-    else
-    {
+    } else {
       // Create a file
       File file = fileSystem->open(path, "w");
-      if (file)
-      {
+      if (file) {
         file.write((const char*)0);
         file.close();
-      }
-      else
-      {
+      } else {
         return replyServerError(F("CREATE FAILED"));
       }
     }
-    if (path.lastIndexOf('/') > -1)
-    {
+    if (path.lastIndexOf('/') > -1) {
       path = path.substring(0, path.lastIndexOf('/'));
     }
     replyOKWithMsg(path);
-  }
-  else
-  {
+  } else {
     // Source specified: rename
-    if (src == "/")
-    {
+    if (src == "/") {
       return replyBadRequest("BAD SRC");
     }
-    if (!fileSystem->exists(src))
-    {
+    if (!fileSystem->exists(src)) {
       return replyBadRequest(F("SRC FILE NOT FOUND"));
     }
 
     DBG_OUTPUT_PORT.println(String("handleFileCreate: ") + path + " from " + src);
 
-    if (path.endsWith("/"))
-    {
+    if (path.endsWith("/")) {
       path.remove(path.length() - 1);
     }
-    if (src.endsWith("/"))
-    {
+    if (src.endsWith("/")) {
       src.remove(src.length() - 1);
     }
-    if (!fileSystem->rename(src, path))
-    {
+    if (!fileSystem->rename(src, path)) {
       return replyServerError(F("RENAME FAILED"));
     }
     replyOKWithMsg(lastExistingParent(src));
@@ -448,15 +383,13 @@ void handleFileCreate()
    This use is just for demonstration purpose, and FSBrowser might crash in case of deeply nested filesystems.
    Please don't do this on a production system.
 */
-void deleteRecursive(String path)
-{
+void deleteRecursive(String path) {
   File file  = fileSystem->open(path, "r");
   bool isDir = file.isDirectory();
   file.close();
 
   // If it's a plain file, delete it
-  if (!isDir)
-  {
+  if (!isDir) {
     fileSystem->remove(path);
     return;
   }
@@ -464,8 +397,7 @@ void deleteRecursive(String path)
   // Otherwise delete its contents first
   Dir dir = fileSystem->openDir(path);
 
-  while (dir.next())
-  {
+  while (dir.next()) {
     deleteRecursive(path + '/' + dir.fileName());
   }
 
@@ -480,22 +412,18 @@ void deleteRecursive(String path)
    Delete file    | parent of deleted file, or remaining ancestor
    Delete folder  | parent of deleted folder, or remaining ancestor
 */
-void handleFileDelete()
-{
-  if (!fsOK)
-  {
+void handleFileDelete() {
+  if (!fsOK) {
     return replyServerError(FPSTR(FS_INIT_ERROR));
   }
 
   String path = server.arg(0);
-  if (path.isEmpty() || path == "/")
-  {
+  if (path.isEmpty() || path == "/") {
     return replyBadRequest("BAD PATH");
   }
 
   DBG_OUTPUT_PORT.println(String("handleFileDelete: ") + path);
-  if (!fileSystem->exists(path))
-  {
+  if (!fileSystem->exists(path)) {
     return replyNotFound(FPSTR(FILE_NOT_FOUND));
   }
   deleteRecursive(path);
@@ -506,49 +434,36 @@ void handleFileDelete()
 /*
    Handle a file upload request
 */
-void handleFileUpload()
-{
-  if (!fsOK)
-  {
+void handleFileUpload() {
+  if (!fsOK) {
     return replyServerError(FPSTR(FS_INIT_ERROR));
   }
-  if (server.uri() != "/edit")
-  {
+  if (server.uri() != "/edit") {
     return;
   }
   HTTPUpload& upload = server.upload();
-  if (upload.status == UPLOAD_FILE_START)
-  {
+  if (upload.status == UPLOAD_FILE_START) {
     String filename = upload.filename;
     // Make sure paths always start with "/"
-    if (!filename.startsWith("/"))
-    {
+    if (!filename.startsWith("/")) {
       filename = "/" + filename;
     }
     DBG_OUTPUT_PORT.println(String("handleFileUpload Name: ") + filename);
     uploadFile = fileSystem->open(filename, "w");
-    if (!uploadFile)
-    {
+    if (!uploadFile) {
       return replyServerError(F("CREATE FAILED"));
     }
     DBG_OUTPUT_PORT.println(String("Upload: START, filename: ") + filename);
-  }
-  else if (upload.status == UPLOAD_FILE_WRITE)
-  {
-    if (uploadFile)
-    {
+  } else if (upload.status == UPLOAD_FILE_WRITE) {
+    if (uploadFile) {
       size_t bytesWritten = uploadFile.write(upload.buf, upload.currentSize);
-      if (bytesWritten != upload.currentSize)
-      {
+      if (bytesWritten != upload.currentSize) {
         return replyServerError(F("WRITE FAILED"));
       }
     }
     DBG_OUTPUT_PORT.println(String("Upload: WRITE, Bytes: ") + upload.currentSize);
-  }
-  else if (upload.status == UPLOAD_FILE_END)
-  {
-    if (uploadFile)
-    {
+  } else if (upload.status == UPLOAD_FILE_END) {
+    if (uploadFile) {
       uploadFile.close();
     }
     DBG_OUTPUT_PORT.println(String("Upload: END, Size: ") + upload.totalSize);
@@ -560,17 +475,14 @@ void handleFileUpload()
    First try to find and return the requested file from the filesystem,
    and if it fails, return a 404 page with debug information
 */
-void handleNotFound()
-{
-  if (!fsOK)
-  {
+void handleNotFound() {
+  if (!fsOK) {
     return replyServerError(FPSTR(FS_INIT_ERROR));
   }
 
   String uri = ESP8266WebServer::urlDecode(server.uri());  // required to read paths with blanks
 
-  if (handleFileRead(uri))
-  {
+  if (handleFileRead(uri)) {
     return;
   }
 
@@ -584,8 +496,7 @@ void handleNotFound()
   message += F("\nArguments: ");
   message += server.args();
   message += '\n';
-  for (uint8_t i = 0; i < server.args(); i++)
-  {
+  for (uint8_t i = 0; i < server.args(); i++) {
     message += F(" NAME:");
     message += server.argName(i);
     message += F("\n VALUE:");
@@ -606,10 +517,8 @@ void handleNotFound()
    embedded in the program code.
    Otherwise, fails with a 404 page with debug information
 */
-void handleGetEdit()
-{
-  if (handleFileRead(F("/edit/index.htm")))
-  {
+void handleGetEdit() {
+  if (handleFileRead(F("/edit/index.htm"))) {
     return;
   }
 
@@ -621,8 +530,7 @@ void handleGetEdit()
 #endif
 }
 
-void setup(void)
-{
+void setup(void) {
   ////////////////////////////////
   // SERIAL INIT
   DBG_OUTPUT_PORT.begin(115200);
@@ -641,13 +549,11 @@ void setup(void)
   // Debug: dump on console contents of filesystem with no filter and check filenames validity
   Dir dir = fileSystem->openDir("");
   DBG_OUTPUT_PORT.println(F("List of files at root of filesystem:"));
-  while (dir.next())
-  {
+  while (dir.next()) {
     String error    = checkForUnsupportedPath(dir.fileName());
     String fileInfo = dir.fileName() + (dir.isDirectory() ? " [DIR]" : String(" (") + dir.fileSize() + "b)");
     DBG_OUTPUT_PORT.println(error + fileInfo);
-    if (error.length() > 0)
-    {
+    if (error.length() > 0) {
       unsupportedFiles += error + fileInfo + '\n';
     }
   }
@@ -664,8 +570,7 @@ void setup(void)
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     DBG_OUTPUT_PORT.print(".");
   }
@@ -675,8 +580,7 @@ void setup(void)
 
   ////////////////////////////////
   // MDNS INIT
-  if (MDNS.begin(host))
-  {
+  if (MDNS.begin(host)) {
     MDNS.addService("http", "tcp", 80);
     DBG_OUTPUT_PORT.print(F("Open http://"));
     DBG_OUTPUT_PORT.print(host);
@@ -715,8 +619,7 @@ void setup(void)
   DBG_OUTPUT_PORT.println("HTTP server started");
 }
 
-void loop(void)
-{
+void loop(void) {
   server.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266WebServer/examples/Graph/Graph.ino b/libraries/ESP8266WebServer/examples/Graph/Graph.ino
index 5ce29247ed..6d2bf41f1a 100644
--- a/libraries/ESP8266WebServer/examples/Graph/Graph.ino
+++ b/libraries/ESP8266WebServer/examples/Graph/Graph.ino
@@ -63,13 +63,13 @@ SDFSConfig fileSystemConfig = SDFSConfig();
 // Indicate which digital I/Os should be displayed on the chart.
 // From GPIO16 to GPIO0, a '1' means the corresponding GPIO will be shown
 // e.g. 0b11111000000111111
-unsigned int      gpioMask;
+unsigned int gpioMask;
 
-const char*       ssid     = STASSID;
-const char*       password = STAPSK;
-const char*       host     = "graph";
+const char* ssid     = STASSID;
+const char* password = STAPSK;
+const char* host     = "graph";
 
-ESP8266WebServer  server(80);
+ESP8266WebServer server(80);
 
 static const char TEXT_PLAIN[] PROGMEM     = "text/plain";
 static const char FS_INIT_ERROR[] PROGMEM  = "FS INIT ERROR";
@@ -78,29 +78,24 @@ static const char FILE_NOT_FOUND[] PROGMEM = "FileNotFound";
 ////////////////////////////////
 // Utils to return HTTP codes
 
-void              replyOK()
-{
+void replyOK() {
   server.send(200, FPSTR(TEXT_PLAIN), "");
 }
 
-void replyOKWithMsg(String msg)
-{
+void replyOKWithMsg(String msg) {
   server.send(200, FPSTR(TEXT_PLAIN), msg);
 }
 
-void replyNotFound(String msg)
-{
+void replyNotFound(String msg) {
   server.send(404, FPSTR(TEXT_PLAIN), msg);
 }
 
-void replyBadRequest(String msg)
-{
+void replyBadRequest(String msg) {
   DBG_OUTPUT_PORT.println(msg);
   server.send(400, FPSTR(TEXT_PLAIN), msg + "\r\n");
 }
 
-void replyServerError(String msg)
-{
+void replyServerError(String msg) {
   DBG_OUTPUT_PORT.println(msg);
   server.send(500, FPSTR(TEXT_PLAIN), msg + "\r\n");
 }
@@ -111,27 +106,22 @@ void replyServerError(String msg)
 /*
    Read the given file from the filesystem and stream it back to the client
 */
-bool handleFileRead(String path)
-{
+bool handleFileRead(String path) {
   DBG_OUTPUT_PORT.println(String("handleFileRead: ") + path);
 
-  if (path.endsWith("/"))
-  {
+  if (path.endsWith("/")) {
     path += "index.htm";
   }
 
   String contentType = mime::getContentType(path);
 
-  if (!fileSystem->exists(path))
-  {
+  if (!fileSystem->exists(path)) {
     // File not found, try gzip version
     path = path + ".gz";
   }
-  if (fileSystem->exists(path))
-  {
+  if (fileSystem->exists(path)) {
     File file = fileSystem->open(path, "r");
-    if (server.streamFile(file, contentType) != file.size())
-    {
+    if (server.streamFile(file, contentType) != file.size()) {
       DBG_OUTPUT_PORT.println("Sent less data than expected!");
     }
     file.close();
@@ -146,12 +136,10 @@ bool handleFileRead(String path)
    First try to find and return the requested file from the filesystem,
    and if it fails, return a 404 page with debug information
 */
-void handleNotFound()
-{
+void handleNotFound() {
   String uri = ESP8266WebServer::urlDecode(server.uri());  // required to read paths with blanks
 
-  if (handleFileRead(uri))
-  {
+  if (handleFileRead(uri)) {
     return;
   }
 
@@ -165,8 +153,7 @@ void handleNotFound()
   message += F("\nArguments: ");
   message += server.args();
   message += '\n';
-  for (uint8_t i = 0; i < server.args(); i++)
-  {
+  for (uint8_t i = 0; i < server.args(); i++) {
     message += F(" NAME:");
     message += server.argName(i);
     message += F("\n VALUE:");
@@ -181,8 +168,7 @@ void handleNotFound()
   return replyNotFound(message);
 }
 
-void setup(void)
-{
+void setup(void) {
   ////////////////////////////////
   // SERIAL INIT
   DBG_OUTPUT_PORT.begin(115200);
@@ -210,8 +196,7 @@ void setup(void)
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     DBG_OUTPUT_PORT.print(".");
   }
@@ -221,8 +206,7 @@ void setup(void)
 
   ////////////////////////////////
   // MDNS INIT
-  if (MDNS.begin(host))
-  {
+  if (MDNS.begin(host)) {
     MDNS.addService("http", "tcp", 80);
     DBG_OUTPUT_PORT.print(F("Open http://"));
     DBG_OUTPUT_PORT.print(host);
@@ -233,23 +217,22 @@ void setup(void)
   // WEB SERVER INIT
 
   //get heap status, analog input value and all GPIO statuses in one json call
-  server.on("/espData", HTTP_GET, []()
-            {
-              String json;
-              json.reserve(88);
-              json = "{\"time\":";
-              json += millis();
-              json += ", \"heap\":";
-              json += ESP.getFreeHeap();
-              json += ", \"analog\":";
-              json += analogRead(A0);
-              json += ", \"gpioMask\":";
-              json += gpioMask;
-              json += ", \"gpioData\":";
-              json += (uint32_t)(((GPI | GPO) & 0xFFFF) | ((GP16I & 0x01) << 16));
-              json += "}";
-              server.send(200, "text/json", json);
-            });
+  server.on("/espData", HTTP_GET, []() {
+    String json;
+    json.reserve(88);
+    json = "{\"time\":";
+    json += millis();
+    json += ", \"heap\":";
+    json += ESP.getFreeHeap();
+    json += ", \"analog\":";
+    json += analogRead(A0);
+    json += ", \"gpioMask\":";
+    json += gpioMask;
+    json += ", \"gpioData\":";
+    json += (uint32_t)(((GPI | GPO) & 0xFFFF) | ((GP16I & 0x01) << 16));
+    json += "}";
+    server.send(200, "text/json", json);
+  });
 
   // Default handler for all URIs not defined above
   // Use it to read files from filesystem
@@ -266,13 +249,10 @@ void setup(void)
 }
 
 // Return default GPIO mask, that is all I/Os except SD card ones
-unsigned int defaultMask()
-{
+unsigned int defaultMask() {
   unsigned int mask = 0b11111111111111111;
-  for (auto pin = 0; pin <= 16; pin++)
-  {
-    if (isFlashInterfacePin(pin))
-    {
+  for (auto pin = 0; pin <= 16; pin++) {
+    if (isFlashInterfacePin(pin)) {
       mask &= ~(1 << pin);
     }
   }
@@ -284,30 +264,25 @@ int                                rgbValue = 0;
 esp8266::polledTimeout::periodicMs timeToChange(1000);
 bool                               modeChangeRequested = false;
 
-void                               loop(void)
-{
+void loop(void) {
   server.handleClient();
   MDNS.update();
 
-  if (digitalRead(4) == 0)
-  {
+  if (digitalRead(4) == 0) {
     // button pressed
     modeChangeRequested = true;
   }
 
   // see if one second has passed since last change, otherwise stop here
-  if (!timeToChange)
-  {
+  if (!timeToChange) {
     return;
   }
 
   // see if a mode change was requested
-  if (modeChangeRequested)
-  {
+  if (modeChangeRequested) {
     // increment mode (reset after 2)
     rgbMode++;
-    if (rgbMode > 2)
-    {
+    if (rgbMode > 2) {
       rgbMode = 0;
     }
 
@@ -315,8 +290,7 @@ void                               loop(void)
   }
 
   // act according to mode
-  switch (rgbMode)
-  {
+  switch (rgbMode) {
     case 0:  // off
       gpioMask = defaultMask();
       gpioMask &= ~(1 << 12);  // Hide GPIO 12
@@ -334,8 +308,7 @@ void                               loop(void)
 
       // increment value (reset after 7)
       rgbValue++;
-      if (rgbValue > 7)
-      {
+      if (rgbValue > 7) {
         rgbValue = 0;
       }
 
diff --git a/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino b/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
index b8fcaef016..e82f1af4d8 100644
--- a/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
+++ b/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
@@ -8,22 +8,20 @@
 #define STAPSK "your-password"
 #endif
 
-const char*      ssid     = STASSID;
-const char*      password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer server(80);
 
-const int        led = 13;
+const int led = 13;
 
-void             handleRoot()
-{
+void handleRoot() {
   digitalWrite(led, 1);
   server.send(200, "text/plain", "hello from esp8266!\r\n");
   digitalWrite(led, 0);
 }
 
-void handleNotFound()
-{
+void handleNotFound() {
   digitalWrite(led, 1);
   String message = "File Not Found\n\n";
   message += "URI: ";
@@ -33,16 +31,14 @@ void handleNotFound()
   message += "\nArguments: ";
   message += server.args();
   message += "\n";
-  for (uint8_t i = 0; i < server.args(); i++)
-  {
+  for (uint8_t i = 0; i < server.args(); i++) {
     message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
   }
   server.send(404, "text/plain", message);
   digitalWrite(led, 0);
 }
 
-void setup(void)
-{
+void setup(void) {
   pinMode(led, OUTPUT);
   digitalWrite(led, 0);
   Serial.begin(115200);
@@ -51,8 +47,7 @@ void setup(void)
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -62,99 +57,89 @@ void setup(void)
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-  if (MDNS.begin("esp8266"))
-  {
+  if (MDNS.begin("esp8266")) {
     Serial.println("MDNS responder started");
   }
 
   server.on("/", handleRoot);
 
-  server.on("/inline", []()
-            { server.send(200, "text/plain", "this works as well"); });
-
-  server.on("/gif", []()
-            {
-              static const uint8_t gif[] PROGMEM = {
-                0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x10, 0x00, 0x10, 0x00, 0x80, 0x01,
-                0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00,
-                0x10, 0x00, 0x10, 0x00, 0x00, 0x02, 0x19, 0x8c, 0x8f, 0xa9, 0xcb, 0x9d,
-                0x00, 0x5f, 0x74, 0xb4, 0x56, 0xb0, 0xb0, 0xd2, 0xf2, 0x35, 0x1e, 0x4c,
-                0x0c, 0x24, 0x5a, 0xe6, 0x89, 0xa6, 0x4d, 0x01, 0x00, 0x3b
-              };
-              char gif_colored[sizeof(gif)];
-              memcpy_P(gif_colored, gif, sizeof(gif));
-              // Set the background to a random set of colors
-              gif_colored[16] = millis() % 256;
-              gif_colored[17] = millis() % 256;
-              gif_colored[18] = millis() % 256;
-              server.send(200, "image/gif", gif_colored, sizeof(gif_colored));
-            });
+  server.on("/inline", []() { server.send(200, "text/plain", "this works as well"); });
+
+  server.on("/gif", []() {
+    static const uint8_t gif[] PROGMEM = {
+      0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x10, 0x00, 0x10, 0x00, 0x80, 0x01,
+      0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00,
+      0x10, 0x00, 0x10, 0x00, 0x00, 0x02, 0x19, 0x8c, 0x8f, 0xa9, 0xcb, 0x9d,
+      0x00, 0x5f, 0x74, 0xb4, 0x56, 0xb0, 0xb0, 0xd2, 0xf2, 0x35, 0x1e, 0x4c,
+      0x0c, 0x24, 0x5a, 0xe6, 0x89, 0xa6, 0x4d, 0x01, 0x00, 0x3b
+    };
+    char gif_colored[sizeof(gif)];
+    memcpy_P(gif_colored, gif, sizeof(gif));
+    // Set the background to a random set of colors
+    gif_colored[16] = millis() % 256;
+    gif_colored[17] = millis() % 256;
+    gif_colored[18] = millis() % 256;
+    server.send(200, "image/gif", gif_colored, sizeof(gif_colored));
+  });
 
   server.onNotFound(handleNotFound);
 
   /////////////////////////////////////////////////////////
   // Hook examples
 
-  server.addHook([](const String& method, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction contentType)
-                 {
-                   (void)method;       // GET, PUT, ...
-                   (void)url;          // example: /root/myfile.html
-                   (void)client;       // the webserver tcp client connection
-                   (void)contentType;  // contentType(".html") => "text/html"
-                   Serial.printf("A useless web hook has passed\n");
-                   Serial.printf("(this hook is in 0x%08x area (401x=IRAM 402x=FLASH))\n", esp_get_program_counter());
-                   return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
-                 });
-
-  server.addHook([](const String&, const String& url, WiFiClient*, ESP8266WebServer::ContentTypeFunction)
-                 {
-                   if (url.startsWith("/fail"))
-                   {
-                     Serial.printf("An always failing web hook has been triggered\n");
-                     return ESP8266WebServer::CLIENT_MUST_STOP;
-                   }
-                   return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
-                 });
-
-  server.addHook([](const String&, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction)
-                 {
-                   if (url.startsWith("/dump"))
-                   {
-                     Serial.printf("The dumper web hook is on the run\n");
+  server.addHook([](const String& method, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction contentType) {
+    (void)method;       // GET, PUT, ...
+    (void)url;          // example: /root/myfile.html
+    (void)client;       // the webserver tcp client connection
+    (void)contentType;  // contentType(".html") => "text/html"
+    Serial.printf("A useless web hook has passed\n");
+    Serial.printf("(this hook is in 0x%08x area (401x=IRAM 402x=FLASH))\n", esp_get_program_counter());
+    return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
+  });
+
+  server.addHook([](const String&, const String& url, WiFiClient*, ESP8266WebServer::ContentTypeFunction) {
+    if (url.startsWith("/fail")) {
+      Serial.printf("An always failing web hook has been triggered\n");
+      return ESP8266WebServer::CLIENT_MUST_STOP;
+    }
+    return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
+  });
+
+  server.addHook([](const String&, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction) {
+    if (url.startsWith("/dump")) {
+      Serial.printf("The dumper web hook is on the run\n");
 
       // Here the request is not interpreted, so we cannot for sure
       // swallow the exact amount matching the full request+content,
       // hence the tcp connection cannot be handled anymore by the
       // webserver.
 #ifdef STREAMSEND_API
-                     // we are lucky
-                     client->sendAll(Serial, 500);
+      // we are lucky
+      client->sendAll(Serial, 500);
 #else
-                     auto last = millis();
-                     while ((millis() - last) < 500)
-                     {
-                       char   buf[32];
-                       size_t len = client->read((uint8_t*)buf, sizeof(buf));
-                       if (len > 0)
-                       {
-                         Serial.printf("(<%d> chars)", (int)len);
-                         Serial.write(buf, len);
-                         last = millis();
-                       }
-                     }
+      auto last = millis();
+      while ((millis() - last) < 500) {
+        char   buf[32];
+        size_t len = client->read((uint8_t*)buf, sizeof(buf));
+        if (len > 0) {
+          Serial.printf("(<%d> chars)", (int)len);
+          Serial.write(buf, len);
+          last = millis();
+        }
+      }
 #endif
-                     // Two choices: return MUST STOP and webserver will close it
-                     //                       (we already have the example with '/fail' hook)
-                     // or                  IS GIVEN and webserver will forget it
-                     // trying with IS GIVEN and storing it on a dumb WiFiClient.
-                     // check the client connection: it should not immediately be closed
-                     // (make another '/dump' one to close the first)
-                     Serial.printf("\nTelling server to forget this connection\n");
-                     static WiFiClient forgetme = *client;  // stop previous one if present and transfer client refcounter
-                     return ESP8266WebServer::CLIENT_IS_GIVEN;
-                   }
-                   return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
-                 });
+      // Two choices: return MUST STOP and webserver will close it
+      //                       (we already have the example with '/fail' hook)
+      // or                  IS GIVEN and webserver will forget it
+      // trying with IS GIVEN and storing it on a dumb WiFiClient.
+      // check the client connection: it should not immediately be closed
+      // (make another '/dump' one to close the first)
+      Serial.printf("\nTelling server to forget this connection\n");
+      static WiFiClient forgetme = *client;  // stop previous one if present and transfer client refcounter
+      return ESP8266WebServer::CLIENT_IS_GIVEN;
+    }
+    return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
+  });
 
   // Hook examples
   /////////////////////////////////////////////////////////
@@ -163,8 +148,7 @@ void setup(void)
   Serial.println("HTTP server started");
 }
 
-void loop(void)
-{
+void loop(void) {
   server.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino b/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino
index fb531a4d6f..85f06bbf82 100644
--- a/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino
+++ b/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino
@@ -21,13 +21,13 @@
 #define STAPSK "your-password"
 #endif
 
-const char*                     ssid     = STASSID;
-const char*                     password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 BearSSL::ESP8266WebServerSecure server(443);
 BearSSL::ServerSessions         serverCache(5);
 
-static const char               serverCert[] PROGMEM = R"EOF(
+static const char serverCert[] PROGMEM = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIDSzCCAjMCCQD2ahcfZAwXxDANBgkqhkiG9w0BAQsFADCBiTELMAkGA1UEBhMC
 VVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU9yYW5nZSBDb3VudHkx
@@ -50,7 +50,7 @@ JfUvYadSYxh3nblvA4OL+iEZiW8NE3hbW6WPXxvS7Euge0uWMPc4uEcnsE0ZVG3m
 -----END CERTIFICATE-----
 )EOF";
 
-static const char               serverKey[] PROGMEM  = R"EOF(
+static const char serverKey[] PROGMEM = R"EOF(
 -----BEGIN RSA PRIVATE KEY-----
 MIIEpQIBAAKCAQEA9UoHBtn4oNKXjRgIOQ/rLxK/iI0a8Q5mDxhfuwa9//FkftSI
 IFY8UhGk2YNJpnfKOyYWqbqwuJhIZJ2sEIWp2301OnavuGBrpKOgBJJljgH2l/4Z
@@ -80,17 +80,15 @@ gz5JWYhbD6c38khSzJb0pNXCo3EuYAVa36kDM96k1BtWuhRS10Q1VXk=
 -----END RSA PRIVATE KEY-----
 )EOF";
 
-const int                       led                  = 13;
+const int led = 13;
 
-void                            handleRoot()
-{
+void handleRoot() {
   digitalWrite(led, 1);
   server.send(200, "text/plain", "Hello from esp8266 over HTTPS!");
   digitalWrite(led, 0);
 }
 
-void handleNotFound()
-{
+void handleNotFound() {
   digitalWrite(led, 1);
   String message = "File Not Found\n\n";
   message += "URI: ";
@@ -100,16 +98,14 @@ void handleNotFound()
   message += "\nArguments: ";
   message += server.args();
   message += "\n";
-  for (uint8_t i = 0; i < server.args(); i++)
-  {
+  for (uint8_t i = 0; i < server.args(); i++) {
     message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
   }
   server.send(404, "text/plain", message);
   digitalWrite(led, 0);
 }
 
-void setup(void)
-{
+void setup(void) {
   pinMode(led, OUTPUT);
   digitalWrite(led, 0);
   Serial.begin(115200);
@@ -117,8 +113,7 @@ void setup(void)
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -131,8 +126,7 @@ void setup(void)
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-  if (MDNS.begin("esp8266"))
-  {
+  if (MDNS.begin("esp8266")) {
     Serial.println("MDNS responder started");
   }
 
@@ -143,8 +137,7 @@ void setup(void)
 
   server.on("/", handleRoot);
 
-  server.on("/inline", []()
-            { server.send(200, "text/plain", "this works as well"); });
+  server.on("/inline", []() { server.send(200, "text/plain", "this works as well"); });
 
   server.onNotFound(handleNotFound);
 
@@ -154,24 +147,19 @@ void setup(void)
 
 extern "C" void stack_thunk_dump_stack();
 
-void            processKey(Print& out, int hotKey)
-{
-  switch (hotKey)
-  {
-    case 'd':
-    {
+void processKey(Print& out, int hotKey) {
+  switch (hotKey) {
+    case 'd': {
       HeapSelectDram ephemeral;
       umm_info(NULL, true);
       break;
     }
-    case 'i':
-    {
+    case 'i': {
       HeapSelectIram ephemeral;
       umm_info(NULL, true);
       break;
     }
-    case 'h':
-    {
+    case 'h': {
       {
         HeapSelectIram ephemeral;
         Serial.printf(PSTR("IRAM ESP.getFreeHeap:  %u\n"), ESP.getFreeHeap());
@@ -219,12 +207,10 @@ void            processKey(Print& out, int hotKey)
   }
 }
 
-void loop(void)
-{
+void loop(void) {
   server.handleClient();
   MDNS.update();
-  if (Serial.available() > 0)
-  {
+  if (Serial.available() > 0) {
     int hotKey = Serial.read();
     processKey(Serial, hotKey);
   }
diff --git a/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino b/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
index 23813a4159..7b5b8cf831 100644
--- a/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
@@ -14,46 +14,43 @@
 #define STAPSK "your-password"
 #endif
 
-const char*      ssid     = STASSID;
-const char*      password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer server(80);
 
-const char*      www_username     = "admin";
-const char*      www_password     = "esp8266";
+const char* www_username = "admin";
+const char* www_password = "esp8266";
 // allows you to set the realm of authentication Default:"Login Required"
-const char*      www_realm        = "Custom Auth Realm";
+const char* www_realm = "Custom Auth Realm";
 // the Content of the HTML response in case of Unautherized Access Default:empty
-String           authFailResponse = "Authentication Failed";
+String authFailResponse = "Authentication Failed";
 
-void             setup()
-{
+void setup() {
   Serial.begin(115200);
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
-  if (WiFi.waitForConnectResult() != WL_CONNECTED)
-  {
+  if (WiFi.waitForConnectResult() != WL_CONNECTED) {
     Serial.println("WiFi Connect Failed! Rebooting...");
     delay(1000);
     ESP.restart();
   }
   ArduinoOTA.begin();
 
-  server.on("/", []()
-            {
-              if (!server.authenticate(www_username, www_password))
-              //Basic Auth Method with Custom realm and Failure Response
-              //return server.requestAuthentication(BASIC_AUTH, www_realm, authFailResponse);
-              //Digest Auth Method with realm="Login Required" and empty Failure Response
-              //return server.requestAuthentication(DIGEST_AUTH);
-              //Digest Auth Method with Custom realm and empty Failure Response
-              //return server.requestAuthentication(DIGEST_AUTH, www_realm);
-              //Digest Auth Method with Custom realm and Failure Response
-              {
-                return server.requestAuthentication(DIGEST_AUTH, www_realm, authFailResponse);
-              }
-              server.send(200, "text/plain", "Login OK");
-            });
+  server.on("/", []() {
+    if (!server.authenticate(www_username, www_password))
+    //Basic Auth Method with Custom realm and Failure Response
+    //return server.requestAuthentication(BASIC_AUTH, www_realm, authFailResponse);
+    //Digest Auth Method with realm="Login Required" and empty Failure Response
+    //return server.requestAuthentication(DIGEST_AUTH);
+    //Digest Auth Method with Custom realm and empty Failure Response
+    //return server.requestAuthentication(DIGEST_AUTH, www_realm);
+    //Digest Auth Method with Custom realm and Failure Response
+    {
+      return server.requestAuthentication(DIGEST_AUTH, www_realm, authFailResponse);
+    }
+    server.send(200, "text/plain", "Login OK");
+  });
   server.begin();
 
   Serial.print("Open http://");
@@ -61,8 +58,7 @@ void             setup()
   Serial.println("/ in your browser to see it working");
 }
 
-void loop()
-{
+void loop() {
   ArduinoOTA.handle();
   server.handleClient();
 }
diff --git a/libraries/ESP8266WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino b/libraries/ESP8266WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino
index 7716fa4dca..565bb027d1 100644
--- a/libraries/ESP8266WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpBasicAuth/HttpBasicAuth.ino
@@ -8,35 +8,31 @@
 #define STAPSK "your-password"
 #endif
 
-const char*      ssid     = STASSID;
-const char*      password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer server(80);
 
-const char*      www_username = "admin";
-const char*      www_password = "esp8266";
+const char* www_username = "admin";
+const char* www_password = "esp8266";
 
-void             setup()
-{
+void setup() {
   Serial.begin(115200);
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
-  if (WiFi.waitForConnectResult() != WL_CONNECTED)
-  {
+  if (WiFi.waitForConnectResult() != WL_CONNECTED) {
     Serial.println("WiFi Connect Failed! Rebooting...");
     delay(1000);
     ESP.restart();
   }
   ArduinoOTA.begin();
 
-  server.on("/", []()
-            {
-              if (!server.authenticate(www_username, www_password))
-              {
-                return server.requestAuthentication();
-              }
-              server.send(200, "text/plain", "Login OK");
-            });
+  server.on("/", []() {
+    if (!server.authenticate(www_username, www_password)) {
+      return server.requestAuthentication();
+    }
+    server.send(200, "text/plain", "Login OK");
+  });
   server.begin();
 
   Serial.print("Open http://");
@@ -44,8 +40,7 @@ void             setup()
   Serial.println("/ in your browser to see it working");
 }
 
-void loop()
-{
+void loop() {
   ArduinoOTA.handle();
   server.handleClient();
 }
diff --git a/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino b/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
index 6bdb235db1..f71e4deb67 100644
--- a/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
@@ -21,16 +21,16 @@
 #define STAPSK "your-password"
 #endif
 
-const char*            ssid                 = STASSID;
-const char*            wifi_pw              = STAPSK;
+const char* ssid    = STASSID;
+const char* wifi_pw = STAPSK;
 
-const String           file_credentials     = R"(/credentials.txt)";  // LittleFS file name for the saved credentials
-const String           change_creds         = "changecreds";          // Address for a credential change
+const String file_credentials = R"(/credentials.txt)";  // LittleFS file name for the saved credentials
+const String change_creds     = "changecreds";          // Address for a credential change
 
 //The ESP8266WebServerSecure requires an encryption certificate and matching key.
 //These can generated with the bash script available in the ESP8266 Arduino repository.
 //These values can be used for testing but are available publicly so should not be used in production.
-static const char      serverCert[] PROGMEM = R"EOF(
+static const char serverCert[] PROGMEM = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIDSzCCAjMCCQD2ahcfZAwXxDANBgkqhkiG9w0BAQsFADCBiTELMAkGA1UEBhMC
 VVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDU9yYW5nZSBDb3VudHkx
@@ -52,7 +52,7 @@ JfUvYadSYxh3nblvA4OL+iEZiW8NE3hbW6WPXxvS7Euge0uWMPc4uEcnsE0ZVG3m
 5tAF1D5vAAwA8nfPysumlLsIjohJZo4lgnhB++AlOg==
 -----END CERTIFICATE-----
 )EOF";
-static const char      serverKey[] PROGMEM  = R"EOF(
+static const char serverKey[] PROGMEM  = R"EOF(
 -----BEGIN RSA PRIVATE KEY-----
 MIIEpQIBAAKCAQEA9UoHBtn4oNKXjRgIOQ/rLxK/iI0a8Q5mDxhfuwa9//FkftSI
 IFY8UhGk2YNJpnfKOyYWqbqwuJhIZJ2sEIWp2301OnavuGBrpKOgBJJljgH2l/4Z
@@ -85,18 +85,16 @@ gz5JWYhbD6c38khSzJb0pNXCo3EuYAVa36kDM96k1BtWuhRS10Q1VXk=
 ESP8266WebServerSecure server(443);
 
 //These are temporary credentials that will only be used if none are found saved in LittleFS.
-String                 login                 = "admin";
-const String           realm                 = "global";
-String                 H1                    = "";
-String                 authentication_failed = "User authentication has failed.";
+String       login                 = "admin";
+const String realm                 = "global";
+String       H1                    = "";
+String       authentication_failed = "User authentication has failed.";
 
-void                   setup()
-{
+void setup() {
   Serial.begin(115200);
 
   //Initialize LittleFS to save credentials
-  if (!LittleFS.begin())
-  {
+  if (!LittleFS.begin()) {
     Serial.println("LittleFS initialization error, programmer flash configured?");
     ESP.restart();
   }
@@ -107,8 +105,7 @@ void                   setup()
   //Initialize wifi
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, wifi_pw);
-  if (WiFi.waitForConnectResult() != WL_CONNECTED)
-  {
+  if (WiFi.waitForConnectResult() != WL_CONNECTED) {
     Serial.println("WiFi Connect Failed! Rebooting...");
     delay(1000);
     ESP.restart();
@@ -125,15 +122,13 @@ void                   setup()
   Serial.println("/ in your browser to see it working");
 }
 
-void loop()
-{
+void loop() {
   yield();
   server.handleClient();
 }
 
 //This function redirects home
-void redirect()
-{
+void redirect() {
   String url = "https://" + WiFi.localIP().toString();
   Serial.println("Redirect called. Redirecting to " + url);
   server.sendHeader("Location", url, true);
@@ -145,16 +140,12 @@ void redirect()
 }
 
 //This function checks whether the current session has been authenticated. If not, a request for credentials is sent.
-bool session_authenticated()
-{
+bool session_authenticated() {
   Serial.println("Checking authentication.");
-  if (server.authenticateDigest(login, H1))
-  {
+  if (server.authenticateDigest(login, H1)) {
     Serial.println("Authentication confirmed.");
     return true;
-  }
-  else
-  {
+  } else {
     Serial.println("Not authenticated. Requesting credentials.");
     server.requestAuthentication(DIGEST_AUTH, realm.c_str(), authentication_failed);
     redirect();
@@ -163,11 +154,9 @@ bool session_authenticated()
 }
 
 //This function sends a simple webpage for changing login credentials to the client
-void showcredentialpage()
-{
+void showcredentialpage() {
   Serial.println("Show credential page called.");
-  if (!session_authenticated())
-  {
+  if (!session_authenticated()) {
     return;
   }
 
@@ -200,8 +189,7 @@ void showcredentialpage()
 }
 
 //Saves credentials to LittleFS
-void savecredentials(String new_login, String new_password)
-{
+void savecredentials(String new_login, String new_password) {
   //Set global variables to new values
   login = new_login;
   H1    = ESP8266WebServer::credentialHash(new_login, realm, new_password);
@@ -209,8 +197,7 @@ void savecredentials(String new_login, String new_password)
   //Save new values to LittleFS for loading on next reboot
   Serial.println("Saving credentials.");
   File f = LittleFS.open(file_credentials, "w");  //open as a brand new file, discard old contents
-  if (f)
-  {
+  if (f) {
     Serial.println("Modifying credentials in file system.");
     f.println(login);
     f.println(H1);
@@ -222,13 +209,11 @@ void savecredentials(String new_login, String new_password)
 }
 
 //loads credentials from LittleFS
-void loadcredentials()
-{
+void loadcredentials() {
   Serial.println("Searching for credentials.");
   File f;
   f = LittleFS.open(file_credentials, "r");
-  if (f)
-  {
+  if (f) {
     Serial.println("Loading credentials from file system.");
     String mod     = f.readString();                           //read the file to a String
     int    index_1 = mod.indexOf('\n', 0);                     //locate the first line break
@@ -236,9 +221,7 @@ void loadcredentials()
     login          = mod.substring(0, index_1 - 1);            //get the first line (excluding the line break)
     H1             = mod.substring(index_1 + 1, index_2 - 1);  //get the second line (excluding the line break)
     f.close();
-  }
-  else
-  {
+  } else {
     String default_login    = "admin";
     String default_password = "changeme";
     Serial.println("None found. Setting to default credentials.");
@@ -250,11 +233,9 @@ void loadcredentials()
 }
 
 //This function handles a credential change from a client.
-void handlecredentialchange()
-{
+void handlecredentialchange() {
   Serial.println("Handle credential change called.");
-  if (!session_authenticated())
-  {
+  if (!session_authenticated()) {
     return;
   }
 
@@ -264,14 +245,11 @@ void handlecredentialchange()
   String pw1   = server.arg("password");
   String pw2   = server.arg("password_duplicate");
 
-  if (login != "" && pw1 != "" && pw1 == pw2)
-  {
+  if (login != "" && pw1 != "" && pw1 == pw2) {
     savecredentials(login, pw1);
     server.send(200, "text/plain", "Credentials updated");
     redirect();
-  }
-  else
-  {
+  } else {
     server.send(200, "text/plain", "Malformed credentials");
     redirect();
   }
diff --git a/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino b/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
index 7866659234..ff88a97158 100644
--- a/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
+++ b/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
@@ -11,21 +11,19 @@
 #define STAPSK "your-password"
 #endif
 
-const char*      ssid     = STASSID;
-const char*      password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer server(80);
 
-void             setup(void)
-{
+void setup(void) {
   Serial.begin(115200);
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -35,32 +33,27 @@ void             setup(void)
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-  if (MDNS.begin("esp8266"))
-  {
+  if (MDNS.begin("esp8266")) {
     Serial.println("MDNS responder started");
   }
 
-  server.on(F("/"), []()
-            { server.send(200, "text/plain", "hello from esp8266!"); });
+  server.on(F("/"), []() { server.send(200, "text/plain", "hello from esp8266!"); });
 
-  server.on(UriBraces("/users/{}"), []()
-            {
-              String user = server.pathArg(0);
-              server.send(200, "text/plain", "User: '" + user + "'");
-            });
+  server.on(UriBraces("/users/{}"), []() {
+    String user = server.pathArg(0);
+    server.send(200, "text/plain", "User: '" + user + "'");
+  });
 
-  server.on(UriRegex("^\\/users\\/([0-9]+)\\/devices\\/([0-9]+)$"), []()
-            {
-              String user   = server.pathArg(0);
-              String device = server.pathArg(1);
-              server.send(200, "text/plain", "User: '" + user + "' and Device: '" + device + "'");
-            });
+  server.on(UriRegex("^\\/users\\/([0-9]+)\\/devices\\/([0-9]+)$"), []() {
+    String user   = server.pathArg(0);
+    String device = server.pathArg(1);
+    server.send(200, "text/plain", "User: '" + user + "' and Device: '" + device + "'");
+  });
 
   server.begin();
   Serial.println("HTTP server started");
 }
 
-void loop(void)
-{
+void loop(void) {
   server.handleClient();
 }
diff --git a/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino b/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
index e25ce3fb72..d61675d23f 100644
--- a/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
+++ b/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
@@ -8,14 +8,14 @@
 #define STAPSK "your-password"
 #endif
 
-const char*      ssid     = STASSID;
-const char*      password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer server(80);
 
-const int        led       = LED_BUILTIN;
+const int led = LED_BUILTIN;
 
-const String     postForms = "<html>\
+const String postForms = "<html>\
   <head>\
     <title>ESP8266 Web Server POST handling</title>\
     <style>\
@@ -36,43 +36,33 @@ const String     postForms = "<html>\
   </body>\
 </html>";
 
-void             handleRoot()
-{
+void handleRoot() {
   digitalWrite(led, 1);
   server.send(200, "text/html", postForms);
   digitalWrite(led, 0);
 }
 
-void handlePlain()
-{
-  if (server.method() != HTTP_POST)
-  {
+void handlePlain() {
+  if (server.method() != HTTP_POST) {
     digitalWrite(led, 1);
     server.send(405, "text/plain", "Method Not Allowed");
     digitalWrite(led, 0);
-  }
-  else
-  {
+  } else {
     digitalWrite(led, 1);
     server.send(200, "text/plain", "POST body was:\n" + server.arg("plain"));
     digitalWrite(led, 0);
   }
 }
 
-void handleForm()
-{
-  if (server.method() != HTTP_POST)
-  {
+void handleForm() {
+  if (server.method() != HTTP_POST) {
     digitalWrite(led, 1);
     server.send(405, "text/plain", "Method Not Allowed");
     digitalWrite(led, 0);
-  }
-  else
-  {
+  } else {
     digitalWrite(led, 1);
     String message = "POST form was:\n";
-    for (uint8_t i = 0; i < server.args(); i++)
-    {
+    for (uint8_t i = 0; i < server.args(); i++) {
       message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
     }
     server.send(200, "text/plain", message);
@@ -80,8 +70,7 @@ void handleForm()
   }
 }
 
-void handleNotFound()
-{
+void handleNotFound() {
   digitalWrite(led, 1);
   String message = "File Not Found\n\n";
   message += "URI: ";
@@ -91,16 +80,14 @@ void handleNotFound()
   message += "\nArguments: ";
   message += server.args();
   message += "\n";
-  for (uint8_t i = 0; i < server.args(); i++)
-  {
+  for (uint8_t i = 0; i < server.args(); i++) {
     message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
   }
   server.send(404, "text/plain", message);
   digitalWrite(led, 0);
 }
 
-void setup(void)
-{
+void setup(void) {
   pinMode(led, OUTPUT);
   digitalWrite(led, 0);
   Serial.begin(115200);
@@ -108,8 +95,7 @@ void setup(void)
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -119,8 +105,7 @@ void setup(void)
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-  if (MDNS.begin("esp8266"))
-  {
+  if (MDNS.begin("esp8266")) {
     Serial.println("MDNS responder started");
   }
 
@@ -136,7 +121,6 @@ void setup(void)
   Serial.println("HTTP server started");
 }
 
-void loop(void)
-{
+void loop(void) {
   server.handleClient();
 }
diff --git a/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino b/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
index 73127f2941..1b9c421f26 100644
--- a/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
+++ b/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
@@ -31,8 +31,7 @@
     you can also try to start listening again before the KeepAliver timer expires or simply register your client again
 */
 
-extern "C"
-{
+extern "C" {
 #include "c_types.h"
 }
 #include <ESP8266WiFi.h>
@@ -50,11 +49,10 @@ const char*        ssid     = STASSID;
 const char*        password = STAPSK;
 const unsigned int port     = 80;
 
-ESP8266WebServer   server(port);
+ESP8266WebServer server(port);
 
 #define SSE_MAX_CHANNELS 8  // in this simplified example, only eight SSE clients subscription allowed
-struct SSESubscription
-{
+struct SSESubscription {
   IPAddress  clientIP;
   WiFiClient client;
   Ticker     keepAliveTimer;
@@ -69,8 +67,7 @@ typedef struct
 } sensorType;
 sensorType sensor[2];
 
-void       handleNotFound()
-{
+void handleNotFound() {
   Serial.println(F("Handle not found"));
   String message = "Handle Not Found\n\n";
   message += "URI: ";
@@ -80,28 +77,21 @@ void       handleNotFound()
   message += "\nArguments: ";
   message += server.args();
   message += "\n";
-  for (uint8_t i = 0; i < server.args(); i++)
-  {
+  for (uint8_t i = 0; i < server.args(); i++) {
     message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
   }
   server.send(404, "text/plain", message);
 }
 
-void SSEKeepAlive()
-{
-  for (uint8_t i = 0; i < SSE_MAX_CHANNELS; i++)
-  {
-    if (!(subscription[i].clientIP))
-    {
+void SSEKeepAlive() {
+  for (uint8_t i = 0; i < SSE_MAX_CHANNELS; i++) {
+    if (!(subscription[i].clientIP)) {
       continue;
     }
-    if (subscription[i].client.connected())
-    {
+    if (subscription[i].client.connected()) {
       Serial.printf_P(PSTR("SSEKeepAlive - client is still listening on channel %d\n"), i);
       subscription[i].client.println(F("event: event\ndata: { \"TYPE\":\"KEEP-ALIVE\" }\n"));  // Extra newline required by SSE standard
-    }
-    else
-    {
+    } else {
       Serial.printf_P(PSTR("SSEKeepAlive - client not listening on channel %d, remove subscription\n"), i);
       subscription[i].keepAliveTimer.detach();
       subscription[i].client.flush();
@@ -114,12 +104,10 @@ void SSEKeepAlive()
 
 // SSEHandler handles the client connection to the event bus (client event listener)
 // every 60 seconds it sends a keep alive event via Ticker
-void SSEHandler(uint8_t channel)
-{
+void SSEHandler(uint8_t channel) {
   WiFiClient       client = server.client();
   SSESubscription& s      = subscription[channel];
-  if (s.clientIP != client.remoteIP())
-  {  // IP addresses don't match, reject this client
+  if (s.clientIP != client.remoteIP()) {  // IP addresses don't match, reject this client
     Serial.printf_P(PSTR("SSEHandler - unregistered client with IP %s tries to listen\n"), server.client().remoteIP().toString().c_str());
     return handleNotFound();
   }
@@ -132,63 +120,50 @@ void SSEHandler(uint8_t channel)
   s.keepAliveTimer.attach_scheduled(30.0, SSEKeepAlive);  // Refresh time every 30s for demo
 }
 
-void handleAll()
-{
+void handleAll() {
   const char* uri        = server.uri().c_str();
   const char* restEvents = PSTR("/rest/events/");
-  if (strncmp_P(uri, restEvents, strlen_P(restEvents)))
-  {
+  if (strncmp_P(uri, restEvents, strlen_P(restEvents))) {
     return handleNotFound();
   }
   uri += strlen_P(restEvents);  // Skip the "/rest/events/" and get to the channel number
   unsigned int channel = atoi(uri);
-  if (channel < SSE_MAX_CHANNELS)
-  {
+  if (channel < SSE_MAX_CHANNELS) {
     return SSEHandler(channel);
   }
   handleNotFound();
 };
 
-void SSEBroadcastState(const char* sensorName, unsigned short prevSensorValue, unsigned short sensorValue)
-{
-  for (uint8_t i = 0; i < SSE_MAX_CHANNELS; i++)
-  {
-    if (!(subscription[i].clientIP))
-    {
+void SSEBroadcastState(const char* sensorName, unsigned short prevSensorValue, unsigned short sensorValue) {
+  for (uint8_t i = 0; i < SSE_MAX_CHANNELS; i++) {
+    if (!(subscription[i].clientIP)) {
       continue;
     }
     String IPaddrstr = IPAddress(subscription[i].clientIP).toString();
-    if (subscription[i].client.connected())
-    {
+    if (subscription[i].client.connected()) {
       Serial.printf_P(PSTR("broadcast status change to client IP %s on channel %d for %s with new state %d\n"),
                       IPaddrstr.c_str(), i, sensorName, sensorValue);
       subscription[i].client.printf_P(PSTR("event: event\ndata: {\"TYPE\":\"STATE\", \"%s\":{\"state\":%d, \"prevState\":%d}}\n\n"),
                                       sensorName, sensorValue, prevSensorValue);
-    }
-    else
-    {
+    } else {
       Serial.printf_P(PSTR("SSEBroadcastState - client %s registered on channel %d but not listening\n"), IPaddrstr.c_str(), i);
     }
   }
 }
 
 // Simulate sensors
-void updateSensor(sensorType& sensor)
-{
+void updateSensor(sensorType& sensor) {
   unsigned short newVal = (unsigned short)RANDOM_REG32;  // (not so good) random value for the sensor
   Serial.printf_P(PSTR("update sensor %s - previous state: %d, new state: %d\n"), sensor.name, sensor.value, newVal);
-  if (sensor.value != newVal)
-  {
+  if (sensor.value != newVal) {
     SSEBroadcastState(sensor.name, sensor.value, newVal);  // only broadcast if state is different
   }
   sensor.value = newVal;
   sensor.update.once(rand() % 20 + 10, std::bind(updateSensor, sensor));  // randomly update sensor
 }
 
-void handleSubscribe()
-{
-  if (subscriptionCount == SSE_MAX_CHANNELS - 1)
-  {
+void handleSubscribe() {
+  if (subscriptionCount == SSE_MAX_CHANNELS - 1) {
     return handleNotFound();  // We ran out of channels
   }
 
@@ -203,8 +178,7 @@ void handleSubscribe()
 
   ++subscriptionCount;
   for (channel = 0; channel < SSE_MAX_CHANNELS; channel++)  // Find first free slot
-    if (!subscription[channel].clientIP)
-    {
+    if (!subscription[channel].clientIP) {
       break;
     }
   subscription[channel] = { clientIP, server.client(), Ticker() };
@@ -215,28 +189,24 @@ void handleSubscribe()
   server.send_P(200, "text/plain", SSEurl.c_str());
 }
 
-void startServers()
-{
+void startServers() {
   server.on(F("/rest/events/subscribe"), handleSubscribe);
   server.onNotFound(handleAll);
   server.begin();
   Serial.println("HTTP server and  SSE EventSource started");
 }
 
-void setup(void)
-{
+void setup(void) {
   Serial.begin(115200);
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
   Serial.println("");
-  while (WiFi.status() != WL_CONNECTED)
-  {  // Wait for connection
+  while (WiFi.status() != WL_CONNECTED) {  // Wait for connection
     delay(500);
     Serial.print(".");
   }
   Serial.printf_P(PSTR("\nConnected to %s with IP address: %s\n"), ssid, WiFi.localIP().toString().c_str());
-  if (MDNS.begin("esp8266"))
-  {
+  if (MDNS.begin("esp8266")) {
     Serial.println("MDNS responder started");
   }
 
@@ -247,8 +217,7 @@ void setup(void)
   updateSensor(sensor[1]);
 }
 
-void loop(void)
-{
+void loop(void) {
   server.handleClient();
   MDNS.update();
   yield();
diff --git a/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino b/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
index 0f11a120ca..937bb6daaf 100644
--- a/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
+++ b/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
@@ -7,22 +7,19 @@
 #define STAPSK "your-password"
 #endif
 
-const char*      ssid     = STASSID;
-const char*      password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer server(80);
 
 //Check if header is present and correct
-bool             is_authenticated()
-{
+bool is_authenticated() {
   Serial.println("Enter is_authenticated");
-  if (server.hasHeader("Cookie"))
-  {
+  if (server.hasHeader("Cookie")) {
     Serial.print("Found cookie: ");
     String cookie = server.header("Cookie");
     Serial.println(cookie);
-    if (cookie.indexOf("ESPSESSIONID=1") != -1)
-    {
+    if (cookie.indexOf("ESPSESSIONID=1") != -1) {
       Serial.println("Authentication Successful");
       return true;
     }
@@ -32,17 +29,14 @@ bool             is_authenticated()
 }
 
 //login page, also called for disconnect
-void handleLogin()
-{
+void handleLogin() {
   String msg;
-  if (server.hasHeader("Cookie"))
-  {
+  if (server.hasHeader("Cookie")) {
     Serial.print("Found cookie: ");
     String cookie = server.header("Cookie");
     Serial.println(cookie);
   }
-  if (server.hasArg("DISCONNECT"))
-  {
+  if (server.hasArg("DISCONNECT")) {
     Serial.println("Disconnection");
     server.sendHeader("Location", "/login");
     server.sendHeader("Cache-Control", "no-cache");
@@ -50,10 +44,8 @@ void handleLogin()
     server.send(301);
     return;
   }
-  if (server.hasArg("USERNAME") && server.hasArg("PASSWORD"))
-  {
-    if (server.arg("USERNAME") == "admin" && server.arg("PASSWORD") == "admin")
-    {
+  if (server.hasArg("USERNAME") && server.hasArg("PASSWORD")) {
+    if (server.arg("USERNAME") == "admin" && server.arg("PASSWORD") == "admin") {
       server.sendHeader("Location", "/");
       server.sendHeader("Cache-Control", "no-cache");
       server.sendHeader("Set-Cookie", "ESPSESSIONID=1");
@@ -73,20 +65,17 @@ void handleLogin()
 }
 
 //root page can be accessed only if authentication is ok
-void handleRoot()
-{
+void handleRoot() {
   Serial.println("Enter handleRoot");
   String header;
-  if (!is_authenticated())
-  {
+  if (!is_authenticated()) {
     server.sendHeader("Location", "/login");
     server.sendHeader("Cache-Control", "no-cache");
     server.send(301);
     return;
   }
   String content = "<html><body><H2>hello, you successfully connected to esp8266!</H2><br>";
-  if (server.hasHeader("User-Agent"))
-  {
+  if (server.hasHeader("User-Agent")) {
     content += "the user agent used is : " + server.header("User-Agent") + "<br><br>";
   }
   content += "You can access this page until you <a href=\"/login?DISCONNECT=YES\">disconnect</a></body></html>";
@@ -94,8 +83,7 @@ void handleRoot()
 }
 
 //no need authentication
-void handleNotFound()
-{
+void handleNotFound() {
   String message = "File Not Found\n\n";
   message += "URI: ";
   message += server.uri();
@@ -104,23 +92,20 @@ void handleNotFound()
   message += "\nArguments: ";
   message += server.args();
   message += "\n";
-  for (uint8_t i = 0; i < server.args(); i++)
-  {
+  for (uint8_t i = 0; i < server.args(); i++) {
     message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
   }
   server.send(404, "text/plain", message);
 }
 
-void setup(void)
-{
+void setup(void) {
   Serial.begin(115200);
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -132,8 +117,7 @@ void setup(void)
 
   server.on("/", handleRoot);
   server.on("/login", handleLogin);
-  server.on("/inline", []()
-            { server.send(200, "text/plain", "this works without need of authentication"); });
+  server.on("/inline", []() { server.send(200, "text/plain", "this works without need of authentication"); });
 
   server.onNotFound(handleNotFound);
   //ask server to track these headers
@@ -142,7 +126,6 @@ void setup(void)
   Serial.println("HTTP server started");
 }
 
-void loop(void)
-{
+void loop(void) {
   server.handleClient();
 }
diff --git a/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino b/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
index 2f663ee57e..79c8574531 100644
--- a/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
+++ b/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
@@ -36,13 +36,11 @@ ESP8266WebServer server(80);
 
 // This function is called when the WebServer was requested without giving a filename.
 // This will redirect to the file index.htm when it is existing otherwise to the built-in $upload.htm page
-void handleRedirect()
-{
+void handleRedirect() {
   TRACE("Redirect...");
   String url = "/index.htm";
 
-  if (!LittleFS.exists(url))
-  {
+  if (!LittleFS.exists(url)) {
     url = "/$update.htm";
   }
 
@@ -52,16 +50,13 @@ void handleRedirect()
 
 // This function is called when the WebServer was requested to list all existing files in the filesystem.
 // a JSON array with file information is returned.
-void handleListFiles()
-{
+void handleListFiles() {
   Dir    dir = LittleFS.openDir("/");
   String result;
 
   result += "[\n";
-  while (dir.next())
-  {
-    if (result.length() > 4)
-    {
+  while (dir.next()) {
+    if (result.length() > 4) {
       result += ",";
     }
     result += "  {";
@@ -77,8 +72,7 @@ void handleListFiles()
 }  // handleListFiles()
 
 // This function is called when the sysInfo service was requested.
-void handleSysInfo()
-{
+void handleSysInfo() {
   String result;
 
   FSInfo fs_info;
@@ -98,15 +92,13 @@ void handleSysInfo()
 // ===== Request Handler class used to answer more complex requests =====
 
 // The FileServerHandler is registered to the web server to support DELETE and UPLOAD of files into the filesystem.
-class FileServerHandler : public RequestHandler
-{
+class FileServerHandler : public RequestHandler {
   public:
   // @brief Construct a new File Server Handler object
   // @param fs The file system to be used.
   // @param path Path to the root folder in the file system that is used for serving static data down and upload.
   // @param cache_header Cache Header to be used in replies.
-  FileServerHandler()
-  {
+  FileServerHandler() {
     TRACE("FileServerHandler is registered\n");
   }
 
@@ -114,34 +106,26 @@ class FileServerHandler : public RequestHandler
   // @param requestMethod method of the http request line.
   // @param requestUri request ressource from the http request line.
   // @return true when method can be handled.
-  bool canHandle(HTTPMethod requestMethod, const String UNUSED& _uri) override
-  {
+  bool canHandle(HTTPMethod requestMethod, const String UNUSED& _uri) override {
     return ((requestMethod == HTTP_POST) || (requestMethod == HTTP_DELETE));
   }  // canHandle()
 
-  bool canUpload(const String& uri) override
-  {
+  bool canUpload(const String& uri) override {
     // only allow upload on root fs level.
     return (uri == "/");
   }  // canUpload()
 
-  bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, const String& requestUri) override
-  {
+  bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, const String& requestUri) override {
     // ensure that filename starts with '/'
     String fName = requestUri;
-    if (!fName.startsWith("/"))
-    {
+    if (!fName.startsWith("/")) {
       fName = "/" + fName;
     }
 
-    if (requestMethod == HTTP_POST)
-    {
+    if (requestMethod == HTTP_POST) {
       // all done in upload. no other forms.
-    }
-    else if (requestMethod == HTTP_DELETE)
-    {
-      if (LittleFS.exists(fName))
-      {
+    } else if (requestMethod == HTTP_DELETE) {
+      if (LittleFS.exists(fName)) {
         LittleFS.remove(fName);
       }
     }  // if
@@ -151,37 +135,27 @@ class FileServerHandler : public RequestHandler
   }  // handle()
 
   // uploading process
-  void upload(ESP8266WebServer UNUSED& server, const String UNUSED& _requestUri, HTTPUpload& upload) override
-  {
+  void upload(ESP8266WebServer UNUSED& server, const String UNUSED& _requestUri, HTTPUpload& upload) override {
     // ensure that filename starts with '/'
     String fName = upload.filename;
-    if (!fName.startsWith("/"))
-    {
+    if (!fName.startsWith("/")) {
       fName = "/" + fName;
     }
 
-    if (upload.status == UPLOAD_FILE_START)
-    {
+    if (upload.status == UPLOAD_FILE_START) {
       // Open the file
-      if (LittleFS.exists(fName))
-      {
+      if (LittleFS.exists(fName)) {
         LittleFS.remove(fName);
       }  // if
       _fsUploadFile = LittleFS.open(fName, "w");
-    }
-    else if (upload.status == UPLOAD_FILE_WRITE)
-    {
+    } else if (upload.status == UPLOAD_FILE_WRITE) {
       // Write received bytes
-      if (_fsUploadFile)
-      {
+      if (_fsUploadFile) {
         _fsUploadFile.write(upload.buf, upload.currentSize);
       }
-    }
-    else if (upload.status == UPLOAD_FILE_END)
-    {
+    } else if (upload.status == UPLOAD_FILE_END) {
       // Close the file
-      if (_fsUploadFile)
-      {
+      if (_fsUploadFile) {
         _fsUploadFile.close();
       }
     }  // if
@@ -192,8 +166,7 @@ class FileServerHandler : public RequestHandler
 };
 
 // Setup everything to make the webserver work.
-void setup(void)
-{
+void setup(void) {
   delay(3000);  // wait for serial monitor to start completely.
 
   // Use Serial port for some trace information from the example
@@ -203,8 +176,7 @@ void setup(void)
   TRACE("Starting WebServer example...\n");
 
   TRACE("Mounting the filesystem...\n");
-  if (!LittleFS.begin())
-  {
+  if (!LittleFS.begin()) {
     TRACE("could not mount the filesystem...\n");
     delay(2000);
     ESP.restart();
@@ -212,12 +184,9 @@ void setup(void)
 
   // start WiFI
   WiFi.mode(WIFI_STA);
-  if (strlen(ssid) == 0)
-  {
+  if (strlen(ssid) == 0) {
     WiFi.begin();
-  }
-  else
-  {
+  } else {
     WiFi.begin(ssid, passPhrase);
   }
 
@@ -225,8 +194,7 @@ void setup(void)
   WiFi.setHostname(HOSTNAME);
 
   TRACE("Connect to WiFi...\n");
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     TRACE(".");
   }
@@ -239,8 +207,7 @@ void setup(void)
   TRACE("Register service handlers...\n");
 
   // serve a built-in htm page
-  server.on("/$upload.htm", []()
-            { server.send(200, "text/html", FPSTR(uploadContent)); });
+  server.on("/$upload.htm", []() { server.send(200, "text/html", FPSTR(uploadContent)); });
 
   // register a redirect handler when only domain name is given.
   server.on("/", HTTP_GET, handleRedirect);
@@ -262,19 +229,17 @@ void setup(void)
   server.serveStatic("/", LittleFS, "/");
 
   // handle cases when file is not found
-  server.onNotFound([]()
-                    {
-                      // standard not found in browser.
-                      server.send(404, "text/html", FPSTR(notFoundContent));
-                    });
+  server.onNotFound([]() {
+    // standard not found in browser.
+    server.send(404, "text/html", FPSTR(notFoundContent));
+  });
 
   server.begin();
   TRACE("hostname=%s\n", WiFi.getHostname());
 }  // setup
 
 // run the server...
-void loop(void)
-{
+void loop(void) {
   server.handleClient();
 }  // loop()
 
diff --git a/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino b/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
index 895c5079c4..19814e4b50 100644
--- a/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
+++ b/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
@@ -12,64 +12,48 @@
 #define STAPSK "your-password"
 #endif
 
-const char*      host     = "esp8266-webupdate";
-const char*      ssid     = STASSID;
-const char*      password = STAPSK;
+const char* host     = "esp8266-webupdate";
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer server(80);
 const char*      serverIndex = "<form method='POST' action='/update' enctype='multipart/form-data'><input type='file' name='update'><input type='submit' value='Update'></form>";
 
-void             setup(void)
-{
+void setup(void) {
   Serial.begin(115200);
   Serial.println();
   Serial.println("Booting Sketch...");
   WiFi.mode(WIFI_AP_STA);
   WiFi.begin(ssid, password);
-  if (WiFi.waitForConnectResult() == WL_CONNECTED)
-  {
+  if (WiFi.waitForConnectResult() == WL_CONNECTED) {
     MDNS.begin(host);
-    server.on("/", HTTP_GET, []()
-              {
-                server.sendHeader("Connection", "close");
-                server.send(200, "text/html", serverIndex);
-              });
+    server.on("/", HTTP_GET, []() {
+      server.sendHeader("Connection", "close");
+      server.send(200, "text/html", serverIndex);
+    });
     server.on(
-        "/update", HTTP_POST, []()
-        {
+        "/update", HTTP_POST, []() {
           server.sendHeader("Connection", "close");
           server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
-          ESP.restart();
-        },
-        []()
-        {
+          ESP.restart(); },
+        []() {
           HTTPUpload& upload = server.upload();
-          if (upload.status == UPLOAD_FILE_START)
-          {
+          if (upload.status == UPLOAD_FILE_START) {
             Serial.setDebugOutput(true);
             WiFiUDP::stopAll();
             Serial.printf("Update: %s\n", upload.filename.c_str());
             uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
-            if (!Update.begin(maxSketchSpace))
-            {  //start with max available size
+            if (!Update.begin(maxSketchSpace)) {  //start with max available size
               Update.printError(Serial);
             }
-          }
-          else if (upload.status == UPLOAD_FILE_WRITE)
-          {
-            if (Update.write(upload.buf, upload.currentSize) != upload.currentSize)
-            {
+          } else if (upload.status == UPLOAD_FILE_WRITE) {
+            if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
               Update.printError(Serial);
             }
-          }
-          else if (upload.status == UPLOAD_FILE_END)
-          {
-            if (Update.end(true))
-            {  //true to set the size to the current progress
+          } else if (upload.status == UPLOAD_FILE_END) {
+            if (Update.end(true)) {  //true to set the size to the current progress
               Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
-            }
-            else
-            {
+            } else {
               Update.printError(Serial);
             }
             Serial.setDebugOutput(false);
@@ -80,15 +64,12 @@ void             setup(void)
     MDNS.addService("http", "tcp", 80);
 
     Serial.printf("Ready! Open http://%s.local in your browser\n", host);
-  }
-  else
-  {
+  } else {
     Serial.println("WiFi Failed");
   }
 }
 
-void loop(void)
-{
+void loop(void) {
   server.handleClient();
   MDNS.update();
 }
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
index 02bec78a42..6d9b8b3161 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
@@ -44,8 +44,8 @@
 #define STAPSK "your-password"
 #endif
 
-const char*        ssid = STASSID;
-const char*        pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
 // A single, global CertStore which can be used by all
 // connections.  Needs to stay live the entire time any of
@@ -53,14 +53,12 @@ const char*        pass = STAPSK;
 BearSSL::CertStore certStore;
 
 // Set time via NTP, as required for x.509 validation
-void               setClock()
-{
+void setClock() {
   configTime(3 * 3600, 0, "pool.ntp.org", "time.nist.gov");
 
   Serial.print("Waiting for NTP time sync: ");
   time_t now = time(nullptr);
-  while (now < 8 * 3600 * 2)
-  {
+  while (now < 8 * 3600 * 2) {
     delay(500);
     Serial.print(".");
     now = time(nullptr);
@@ -73,17 +71,14 @@ void               setClock()
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump URL
-void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path)
-{
-  if (!path)
-  {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
+  if (!path) {
     path = "/";
   }
 
   Serial.printf("Trying: %s:443...", host);
   client->connect(host, port);
-  if (!client->connected())
-  {
+  if (!client->connected()) {
     Serial.printf("*** Can't connect. ***\n-------\n");
     return;
   }
@@ -95,22 +90,18 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   client->write("\r\nUser-Agent: ESP8266\r\n");
   client->write("\r\n");
   uint32_t to = millis() + 5000;
-  if (client->connected())
-  {
-    do
-    {
+  if (client->connected()) {
+    do {
       char tmp[32];
       memset(tmp, 0, 32);
       int rlen = client->read((uint8_t*)tmp, sizeof(tmp) - 1);
       yield();
-      if (rlen < 0)
-      {
+      if (rlen < 0) {
         break;
       }
       // Only print out first line up to \r, then abort connection
       char* nl = strchr(tmp, '\r');
-      if (nl)
-      {
+      if (nl) {
         *nl = 0;
         Serial.print(tmp);
         break;
@@ -122,8 +113,7 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   Serial.printf("\n-------\n");
 }
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println();
   Serial.println();
@@ -136,8 +126,7 @@ void setup()
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -151,8 +140,7 @@ void setup()
 
   int numCerts = certStore.initCertStore(LittleFS, PSTR("/certs.idx"), PSTR("/certs.ar"));
   Serial.printf("Number of CA certs read: %d\n", numCerts);
-  if (numCerts == 0)
-  {
+  if (numCerts == 0) {
     Serial.printf("No certs found. Did you run certs-from-mozilla.py and upload the LittleFS directory before running?\n");
     return;  // Can't connect to anything w/o certs!
   }
@@ -165,12 +153,10 @@ void setup()
   delete bear;
 }
 
-void loop()
-{
+void loop() {
   Serial.printf("\nPlease enter a website address (www.blah.com) to connect to: ");
   String site;
-  do
-  {
+  do {
     site = Serial.readString();
   } while (site == "");
   // Strip newline if present
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_MaxFragmentLength/BearSSL_MaxFragmentLength.ino b/libraries/ESP8266WiFi/examples/BearSSL_MaxFragmentLength/BearSSL_MaxFragmentLength.ino
index dea9f92649..965f07b0b5 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_MaxFragmentLength/BearSSL_MaxFragmentLength.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_MaxFragmentLength/BearSSL_MaxFragmentLength.ino
@@ -15,23 +15,19 @@
 const char* ssid = STASSID;
 const char* pass = STAPSK;
 
-void        fetch(BearSSL::WiFiClientSecure* client)
-{
+void fetch(BearSSL::WiFiClientSecure* client) {
   client->write("GET / HTTP/1.0\r\nHost: tls.mbed.org\r\nUser-Agent: ESP8266\r\n\r\n");
   client->flush();
   using oneShot = esp8266::polledTimeout::oneShot;
   oneShot timeout(5000);
-  do
-  {
+  do {
     char tmp[32];
     int  rlen = client->read((uint8_t*)tmp, sizeof(tmp) - 1);
     yield();
-    if (rlen < 0)
-    {
+    if (rlen < 0) {
       break;
     }
-    if (rlen == 0)
-    {
+    if (rlen == 0) {
       delay(10);  // Give background processes some time
       continue;
     }
@@ -42,8 +38,7 @@ void        fetch(BearSSL::WiFiClientSecure* client)
   Serial.printf("\n-------\n");
 }
 
-int fetchNoMaxFragmentLength()
-{
+int fetchNoMaxFragmentLength() {
   int ret = ESP.getFreeHeap();
 
   Serial.printf("\nConnecting to https://tls.mbed.org\n");
@@ -52,22 +47,18 @@ int fetchNoMaxFragmentLength()
   BearSSL::WiFiClientSecure client;
   client.setInsecure();
   client.connect("tls.mbed.org", 443);
-  if (client.connected())
-  {
+  if (client.connected()) {
     Serial.printf("Memory used: %d\n", ret - ESP.getFreeHeap());
     ret -= ESP.getFreeHeap();
     fetch(&client);
-  }
-  else
-  {
+  } else {
     Serial.printf("Unable to connect\n");
   }
   return ret;
 }
 
-int fetchMaxFragmentLength()
-{
-  int                       ret = ESP.getFreeHeap();
+int fetchMaxFragmentLength() {
+  int ret = ESP.getFreeHeap();
 
   // Servers which implement RFC6066's Maximum Fragment Length Negotiation
   // can be configured to limit the size of TLS fragments they transmit.
@@ -91,27 +82,22 @@ int fetchMaxFragmentLength()
   bool mfln = client.probeMaxFragmentLength("tls.mbed.org", 443, 512);
   Serial.printf("\nConnecting to https://tls.mbed.org\n");
   Serial.printf("MFLN supported: %s\n", mfln ? "yes" : "no");
-  if (mfln)
-  {
+  if (mfln) {
     client.setBufferSizes(512, 512);
   }
   client.connect("tls.mbed.org", 443);
-  if (client.connected())
-  {
+  if (client.connected()) {
     Serial.printf("MFLN status: %s\n", client.getMFLNStatus() ? "true" : "false");
     Serial.printf("Memory used: %d\n", ret - ESP.getFreeHeap());
     ret -= ESP.getFreeHeap();
     fetch(&client);
-  }
-  else
-  {
+  } else {
     Serial.printf("Unable to connect\n");
   }
   return ret;
 }
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
 
   delay(1000);
@@ -125,8 +111,7 @@ void setup()
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -137,8 +122,7 @@ void setup()
   Serial.println(WiFi.localIP());
 }
 
-void loop()
-{
+void loop() {
   Serial.printf("\n\n\n\n\n");
 
   yield();
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
index bcb08789b0..faba6838a6 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
@@ -42,8 +42,8 @@
 #define STAPSK "your-password"
 #endif
 
-const char*               ssid = STASSID;
-const char*               pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
 // The HTTPS server
 BearSSL::WiFiServerSecure server(443);
@@ -85,7 +85,7 @@ Zs0aiirNGTEymRX4rw26Qg==
 )EOF";
 
 // The server's public certificate which must be shared
-const char server_cert[] PROGMEM        = R"EOF(
+const char server_cert[] PROGMEM = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIDUTCCAjmgAwIBAgIJAOcfK7c3JQtnMA0GCSqGSIb3DQEBCwUAMD8xCzAJBgNV
 BAYTAkFVMQ0wCwYDVQQIDAROb25lMQ0wCwYDVQQKDAROb25lMRIwEAYDVQQDDAlF
@@ -109,7 +109,7 @@ UsQIIGpPVh1plR1vYNndDeBpRJSFkoJTkgAIrlFzSMwNebU0pg==
 )EOF";
 
 #else
-const char              server_cert[] PROGMEM        = R"EOF(
+const char server_cert[] PROGMEM = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIB0zCCAXqgAwIBAgIJALANi2eTiGD/MAoGCCqGSM49BAMCMEUxCzAJBgNVBAYT
 AkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRn
@@ -125,7 +125,7 @@ Af8wCgYIKoZIzj0EAwIDRwAwRAIgWvy7ofQTGZMNqxUfe4gjtkU+C9AkQtaOMW2U
 )EOF";
 
 // The server's private key which must be kept secret
-const char              server_private_key[] PROGMEM = R"EOF(
+const char server_private_key[] PROGMEM = R"EOF(
 -----BEGIN EC PARAMETERS-----
 BggqhkjOPQMBBw==
 -----END EC PARAMETERS-----
@@ -138,12 +138,17 @@ GBEnkz4KpKv7TkHoW+j7F5EMcLcSrUIpyw==
 
 #endif
 
-#define CACHE_SIZE 5  // Number of sessions to cache.
-#define USE_CACHE     // Enable SSL session caching.                                    \
-                      // Caching SSL sessions shortens the length of the SSL handshake. \
-                      // You can see the performance improvement by looking at the      \
-                      // Network tab of the developer tools of your browser.
-//#define DYNAMIC_CACHE // Whether to dynamically allocate the cache.
+// Number of sessions to cache.
+#define CACHE_SIZE 5
+
+// Enable SSL session caching.
+// Caching SSL sessions shortens the length of the SSL handshake.
+// You can see the performance improvement by looking at the
+// Network tab of the developer tools of your browser.
+#define USE_CACHE
+
+// Whether to dynamically allocate the cache.
+//#define DYNAMIC_CACHE
 
 #if defined(USE_CACHE) && defined(DYNAMIC_CACHE)
 // Dynamically allocated cache.
@@ -154,8 +159,7 @@ ServerSession           store[CACHE_SIZE];
 BearSSL::ServerSessions serverCache(store, CACHE_SIZE);
 #endif
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println();
   Serial.println();
@@ -166,8 +170,7 @@ void setup()
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -206,12 +209,10 @@ static const char* HTTP_RES = "HTTP/1.0 200 OK\r\n"
                               "</body>\r\n"
                               "</html>\r\n";
 
-void loop()
-{
+void loop() {
   static int                cnt;
   BearSSL::WiFiClientSecure incoming = server.accept();
-  if (!incoming)
-  {
+  if (!incoming) {
     return;
   }
   Serial.printf("Incoming connection...%d\n", cnt++);
@@ -219,33 +220,23 @@ void loop()
   // Ugly way to wait for \r\n (i.e. end of HTTP request which we don't actually parse here)
   uint32_t timeout = millis() + 1000;
   int      lcwn    = 0;
-  for (;;)
-  {
+  for (;;) {
     unsigned char x = 0;
-    if ((millis() > timeout) || (incoming.available() && incoming.read(&x, 1) < 0))
-    {
+    if ((millis() > timeout) || (incoming.available() && incoming.read(&x, 1) < 0)) {
       incoming.stop();
       Serial.printf("Connection error, closed\n");
       return;
-    }
-    else if (!x)
-    {
+    } else if (!x) {
       yield();
       continue;
-    }
-    else if (x == 0x0D)
-    {
+    } else if (x == 0x0D) {
       continue;
-    }
-    else if (x == 0x0A)
-    {
-      if (lcwn)
-      {
+    } else if (x == 0x0A) {
+      if (lcwn) {
         break;
       }
       lcwn = 1;
-    }
-    else
+    } else
       lcwn = 0;
   }
   incoming.write((uint8_t*)HTTP_RES, strlen(HTTP_RES));
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino b/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
index e10a443199..c6005f162e 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
@@ -70,15 +70,15 @@
 #define STAPSK "your-password"
 #endif
 
-const char*               ssid = STASSID;
-const char*               pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
 // The server which will require a client cert signed by the trusted CA
 BearSSL::WiFiServerSecure server(443);
 
 // The hardcoded certificate authority for this example.
 // Don't use it on your own apps!!!!!
-const char                ca_cert[] PROGMEM            = R"EOF(
+const char ca_cert[] PROGMEM = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIC1TCCAb2gAwIBAgIJAMPt1Ms37+hLMA0GCSqGSIb3DQEBCwUAMCExCzAJBgNV
 BAYTAlVTMRIwEAYDVQQDDAkxMjcuMC4wLjMwHhcNMTgwMzE0MDQyMTU0WhcNMjkw
@@ -100,7 +100,7 @@ X8yKI14mFOGxuvcygG8L2xxysW7Zq+9g+O7gW0Pm6RDYnUQmIwY83h1KFCtYCJdS
 )EOF";
 
 // The server's private key which must be kept secret
-const char                server_private_key[] PROGMEM = R"EOF(
+const char server_private_key[] PROGMEM = R"EOF(
 -----BEGIN RSA PRIVATE KEY-----
 MIIEowIBAAKCAQEAsRNVTvqP++YUh8NrbXwE83xVsDqcB3F76xcXNKFDERfVd2P/
 LvyDovCcoQtT0UCRgPcxRp894EuPH/Ru6Z2Lu85sV//i7ce27tc2WRFSfuhlRxHP
@@ -131,7 +131,7 @@ tPYglR5fjuRF/wnt3oX9JlQ2RtSbs+3naXH8JoherHaqNn8UpH0t
 )EOF";
 
 // The server's public certificate which must be shared
-const char                server_cert[] PROGMEM        = R"EOF(
+const char server_cert[] PROGMEM = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIDTzCCAjcCCQDPXvMRYOpeuDANBgkqhkiG9w0BAQsFADCBpjESMBAGA1UEAwwJ
 MTI3LjAuMC4xMQswCQYDVQQGEwJVUzElMCMGA1UECgwcTXkgT3duIENlcnRpZmlj
@@ -160,14 +160,12 @@ seoK24dHmt6tWmn/sbxX7Aa6TL/4mVlFoOgcaTJyVaY/BrY=
 // head of the app.
 
 // Set time via NTP, as required for x.509 validation
-void                      setClock()
-{
+void setClock() {
   configTime(3 * 3600, 0, "pool.ntp.org", "time.nist.gov");
 
   Serial.print("Waiting for NTP time sync: ");
   time_t now = time(nullptr);
-  while (now < 8 * 3600 * 2)
-  {
+  while (now < 8 * 3600 * 2) {
     delay(500);
     Serial.print(".");
     now = time(nullptr);
@@ -179,8 +177,7 @@ void                      setClock()
   Serial.print(asctime(&timeinfo));
 }
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println();
   Serial.println();
@@ -191,8 +188,7 @@ void setup()
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -228,11 +224,9 @@ static const char* HTTP_RES = "HTTP/1.0 200 OK\r\n"
                               "</body>\r\n"
                               "</html>\r\n";
 
-void loop()
-{
+void loop() {
   BearSSL::WiFiClientSecure incoming = server.accept();
-  if (!incoming)
-  {
+  if (!incoming) {
     return;
   }
   Serial.println("Incoming connection...\n");
@@ -240,33 +234,23 @@ void loop()
   // Ugly way to wait for \r\n (i.e. end of HTTP request which we don't actually parse here)
   uint32_t timeout = millis() + 1000;
   int      lcwn    = 0;
-  for (;;)
-  {
+  for (;;) {
     unsigned char x = 0;
-    if ((millis() > timeout) || (incoming.available() && incoming.read(&x, 1) < 0))
-    {
+    if ((millis() > timeout) || (incoming.available() && incoming.read(&x, 1) < 0)) {
       incoming.stop();
       Serial.printf("Connection error, closed\n");
       return;
-    }
-    else if (!x)
-    {
+    } else if (!x) {
       yield();
       continue;
-    }
-    else if (x == 0x0D)
-    {
+    } else if (x == 0x0D) {
       continue;
-    }
-    else if (x == 0x0A)
-    {
-      if (lcwn)
-      {
+    } else if (x == 0x0A) {
+      if (lcwn) {
         break;
       }
       lcwn = 1;
-    }
-    else
+    } else
       lcwn = 0;
   }
   incoming.write((uint8_t*)HTTP_RES, strlen(HTTP_RES));
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino b/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
index d6b74a6628..7e64df10a2 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
@@ -17,8 +17,7 @@ const char* pass = STAPSK;
 
 const char* path = "/";
 
-void        setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println();
   Serial.println();
@@ -27,8 +26,7 @@ void        setup()
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -41,8 +39,7 @@ void        setup()
 
   Serial.print("Waiting for NTP time sync: ");
   time_t now = time(nullptr);
-  while (now < 8 * 3600 * 2)
-  {
+  while (now < 8 * 3600 * 2) {
     delay(500);
     Serial.print(".");
     now = time(nullptr);
@@ -55,17 +52,14 @@ void        setup()
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump HTTP response
-void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path)
-{
-  if (!path)
-  {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
+  if (!path) {
     path = "/";
   }
 
   Serial.printf("Trying: %s:443...", host);
   client->connect(host, port);
-  if (!client->connected())
-  {
+  if (!client->connected()) {
     Serial.printf("*** Can't connect. ***\n-------\n");
     return;
   }
@@ -77,22 +71,18 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   client->write("\r\nUser-Agent: ESP8266\r\n");
   client->write("\r\n");
   uint32_t to = millis() + 5000;
-  if (client->connected())
-  {
-    do
-    {
+  if (client->connected()) {
+    do {
       char tmp[32];
       memset(tmp, 0, 32);
       int rlen = client->read((uint8_t*)tmp, sizeof(tmp) - 1);
       yield();
-      if (rlen < 0)
-      {
+      if (rlen < 0) {
         break;
       }
       // Only print out first line up to \r, then abort connection
       char* nl = strchr(tmp, '\r');
-      if (nl)
-      {
+      if (nl) {
         *nl = 0;
         Serial.print(tmp);
         break;
@@ -104,8 +94,7 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   Serial.printf("\n-------\n\n");
 }
 
-void loop()
-{
+void loop() {
   uint32_t                  start, finish;
   BearSSL::WiFiClientSecure client;
   BearSSL::X509List         cert(cert_DigiCert_High_Assurance_EV_Root_CA);
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino b/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
index 6341d09429..757cedd6d8 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
@@ -21,14 +21,12 @@ const char* pass = STAPSK;
 const char* path = "/";
 
 // Set time via NTP, as required for x.509 validation
-void        setClock()
-{
+void setClock() {
   configTime(3 * 3600, 0, "pool.ntp.org", "time.nist.gov");
 
   Serial.print("Waiting for NTP time sync: ");
   time_t now = time(nullptr);
-  while (now < 8 * 3600 * 2)
-  {
+  while (now < 8 * 3600 * 2) {
     delay(500);
     Serial.print(".");
     now = time(nullptr);
@@ -41,10 +39,8 @@ void        setClock()
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump HTTP response
-void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path)
-{
-  if (!path)
-  {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
+  if (!path) {
     path = "/";
   }
 
@@ -52,8 +48,7 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   uint32_t freeStackStart = ESP.getFreeContStack();
   Serial.printf("Trying: %s:443...", host);
   client->connect(host, port);
-  if (!client->connected())
-  {
+  if (!client->connected()) {
     Serial.printf("*** Can't connect. ***\n-------\n");
     return;
   }
@@ -65,22 +60,18 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   client->write("\r\nUser-Agent: ESP8266\r\n");
   client->write("\r\n");
   uint32_t to = millis() + 5000;
-  if (client->connected())
-  {
-    do
-    {
+  if (client->connected()) {
+    do {
       char tmp[32];
       memset(tmp, 0, 32);
       int rlen = client->read((uint8_t*)tmp, sizeof(tmp) - 1);
       yield();
-      if (rlen < 0)
-      {
+      if (rlen < 0) {
         break;
       }
       // Only print out first line up to \r, then abort connection
       char* nl = strchr(tmp, '\r');
-      if (nl)
-      {
+      if (nl) {
         *nl = 0;
         Serial.print(tmp);
         break;
@@ -94,8 +85,7 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   Serial.printf("BSSL stack used: %d\n-------\n\n", stack_thunk_get_max_usage());
 }
 
-void fetchNoConfig()
-{
+void fetchNoConfig() {
   Serial.printf(R"EOF(
 If there are no CAs or insecure options specified, BearSSL will not connect.
 Expect the following call to fail as none have been configured.
@@ -104,8 +94,7 @@ Expect the following call to fail as none have been configured.
   fetchURL(&client, gitlab_host, gitlab_port, path);
 }
 
-void fetchInsecure()
-{
+void fetchInsecure() {
   Serial.printf(R"EOF(
 This is absolutely *insecure*, but you can tell BearSSL not to check the
 certificate of the server.  In this mode it will accept ANY certificate,
@@ -116,8 +105,7 @@ which is subject to man-in-the-middle (MITM) attacks.
   fetchURL(&client, gitlab_host, gitlab_port, path);
 }
 
-void fetchFingerprint()
-{
+void fetchFingerprint() {
   Serial.printf(R"EOF(
 The SHA-1 fingerprint of an X.509 certificate can be used to validate it
 instead of the while certificate.  This is not nearly as secure as real
@@ -131,8 +119,7 @@ the root authorities, etc.).
   fetchURL(&client, gitlab_host, gitlab_port, path);
 }
 
-void fetchSelfSigned()
-{
+void fetchSelfSigned() {
   Serial.printf(R"EOF(
 It is also possible to accept *any* self-signed certificate.  This is
 absolutely insecure as anyone can make a self-signed certificate.
@@ -145,8 +132,7 @@ absolutely insecure as anyone can make a self-signed certificate.
   fetchURL(&client, "self-signed.badssl.com", 443, "/");
 }
 
-void fetchKnownKey()
-{
+void fetchKnownKey() {
   Serial.printf(R"EOF(
 The server certificate can be completely ignored and its public key
 hardcoded in your application. This should be secure as the public key
@@ -160,8 +146,7 @@ able to establish communications.
   fetchURL(&client, gitlab_host, gitlab_port, path);
 }
 
-void fetchCertAuthority()
-{
+void fetchCertAuthority() {
   Serial.printf(R"EOF(
 A specific certification authority can be passed in and used to validate
 a chain of certificates from a given server.  These will be validated
@@ -182,8 +167,7 @@ BearSSL does verify the notValidBefore/After fields.
   fetchURL(&client, gitlab_host, gitlab_port, path);
 }
 
-void fetchFaster()
-{
+void fetchFaster() {
   Serial.printf(R"EOF(
 The ciphers used to set up the SSL connection can be configured to
 only support faster but less secure ciphers.  If you care about security
@@ -209,8 +193,7 @@ may make sense
   Serial.printf("Using more secure: %dms\nUsing less secure ciphers: %dms\nUsing custom cipher list: %dms\n", delta, delta2, delta3);
 }
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println();
   Serial.println();
@@ -221,8 +204,7 @@ void setup()
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -241,7 +223,6 @@ void setup()
   fetchFaster();
 }
 
-void loop()
-{
+void loop() {
   // Nothing to do here
 }
diff --git a/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino b/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
index 0fe6258c40..9eb3c3150e 100644
--- a/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
+++ b/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
@@ -23,18 +23,16 @@
 const char* ssid     = STASSID;
 const char* password = STAPSK;
 
-X509List    cert(cert_DigiCert_High_Assurance_EV_Root_CA);
+X509List cert(cert_DigiCert_High_Assurance_EV_Root_CA);
 
-void        setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println();
   Serial.print("Connecting to ");
   Serial.println(ssid);
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -48,8 +46,7 @@ void        setup()
 
   Serial.print("Waiting for NTP time sync: ");
   time_t now = time(nullptr);
-  while (now < 8 * 3600 * 2)
-  {
+  while (now < 8 * 3600 * 2) {
     delay(500);
     Serial.print(".");
     now = time(nullptr);
@@ -68,8 +65,7 @@ void        setup()
   Serial.printf("Using certificate: %s\n", cert_DigiCert_High_Assurance_EV_Root_CA);
   client.setTrustAnchors(&cert);
 
-  if (!client.connect(github_host, github_port))
-  {
+  if (!client.connect(github_host, github_port)) {
     Serial.println("Connection failed");
     return;
   }
@@ -81,22 +77,17 @@ void        setup()
   client.print(String("GET ") + url + " HTTP/1.1\r\n" + "Host: " + github_host + "\r\n" + "User-Agent: BuildFailureDetectorESP8266\r\n" + "Connection: close\r\n\r\n");
 
   Serial.println("Request sent");
-  while (client.connected())
-  {
+  while (client.connected()) {
     String line = client.readStringUntil('\n');
-    if (line == "\r")
-    {
+    if (line == "\r") {
       Serial.println("Headers received");
       break;
     }
   }
   String line = client.readStringUntil('\n');
-  if (line.startsWith("{\"state\":\"success\""))
-  {
+  if (line.startsWith("{\"state\":\"success\"")) {
     Serial.println("esp8266/Arduino CI successful!");
-  }
-  else
-  {
+  } else {
     Serial.println("esp8266/Arduino CI has failed");
   }
   Serial.println("Reply was:");
@@ -106,6 +97,5 @@ void        setup()
   Serial.println("Closing connection");
 }
 
-void loop()
-{
+void loop() {
 }
diff --git a/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino b/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
index 56b767869c..e3f15fcd82 100644
--- a/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
+++ b/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
@@ -37,60 +37,48 @@ WiFiServer                         statusServer(TCP_PORT);
 WiFiUDP                            udp;
 esp8266::polledTimeout::periodicMs showStatusOnSerialNow(STATUSDELAY_MS);
 
-void                               fqdn(Print& out, const String& fqdn)
-{
+void fqdn(Print& out, const String& fqdn) {
   out.print(F("resolving "));
   out.print(fqdn);
   out.print(F(": "));
   IPAddress result;
-  if (WiFi.hostByName(fqdn.c_str(), result))
-  {
+  if (WiFi.hostByName(fqdn.c_str(), result)) {
     result.printTo(out);
     out.println();
-  }
-  else
-  {
+  } else {
     out.println(F("timeout or not found"));
   }
 }
 
 #if LWIP_IPV4 && LWIP_IPV6
-void fqdn_rt(Print& out, const String& fqdn, DNSResolveType resolveType)
-{
+void fqdn_rt(Print& out, const String& fqdn, DNSResolveType resolveType) {
   out.print(F("resolving "));
   out.print(fqdn);
   out.print(F(": "));
   IPAddress result;
-  if (WiFi.hostByName(fqdn.c_str(), result, 10000, resolveType))
-  {
+  if (WiFi.hostByName(fqdn.c_str(), result, 10000, resolveType)) {
     result.printTo(out);
     out.println();
-  }
-  else
-  {
+  } else {
     out.println(F("timeout or not found"));
   }
 }
 #endif
 
-void status(Print& out)
-{
+void status(Print& out) {
   out.println(F("------------------------------"));
   out.println(ESP.getFullVersion());
 
-  for (int i = 0; i < DNS_MAX_SERVERS; i++)
-  {
+  for (int i = 0; i < DNS_MAX_SERVERS; i++) {
     IPAddress dns = WiFi.dnsIP(i);
-    if (dns.isSet())
-    {
+    if (dns.isSet()) {
       out.printf("dns%d: %s\n", i, dns.toString().c_str());
     }
   }
 
   out.println(F("Try me at these addresses:"));
   out.println(F("(with 'telnet <addr> or 'nc -u <addr> 23')"));
-  for (auto a : addrList)
-  {
+  for (auto a : addrList) {
     out.printf("IF='%s' IPv6=%d local=%d hostname='%s' addr= %s",
                a.ifname().c_str(),
                a.isV6(),
@@ -98,8 +86,7 @@ void status(Print& out)
                a.ifhostname(),
                a.toString().c_str());
 
-    if (a.isLegacy())
-    {
+    if (a.isLegacy()) {
       out.printf(" / mask:%s / gw:%s",
                  a.netmask().toString().c_str(),
                  a.gw().toString().c_str());
@@ -119,8 +106,7 @@ void status(Print& out)
   out.println(F("------------------------------"));
 }
 
-void setup()
-{
+void setup() {
   WiFi.hostname("ipv6test");
 
   Serial.begin(115200);
@@ -156,14 +142,12 @@ void setup()
   //   (false for any other including 192.168./16 and 10./24 since NAT may be in the equation)
   // - IPV6 link-local addresses (fe80::/64)
 
-  for (bool configured = false; !configured;)
-  {
+  for (bool configured = false; !configured;) {
     for (auto addr : addrList)
       if ((configured = !addr.isLocal()
            // && addr.isV6() // uncomment when IPv6 is mandatory
            // && addr.ifnumber() == STATION_IF
-           ))
-      {
+           )) {
         break;
       }
     Serial.print('.');
@@ -187,18 +171,15 @@ void setup()
 
 unsigned long statusTimeMs = 0;
 
-void          loop()
-{
-  if (statusServer.hasClient())
-  {
+void loop() {
+  if (statusServer.hasClient()) {
     WiFiClient cli = statusServer.accept();
     status(cli);
   }
 
   // if there's data available, read a packet
   int packetSize = udp.parsePacket();
-  if (packetSize)
-  {
+  if (packetSize) {
     Serial.print(F("udp received "));
     Serial.print(packetSize);
     Serial.print(F(" bytes from "));
@@ -206,8 +187,7 @@ void          loop()
     Serial.print(F(" :"));
     Serial.println(udp.remotePort());
     int c;
-    while ((c = udp.read()) >= 0)
-    {
+    while ((c = udp.read()) >= 0) {
       Serial.write(c);
     }
 
@@ -217,8 +197,7 @@ void          loop()
     udp.endPacket();
   }
 
-  if (showStatusOnSerialNow)
-  {
+  if (showStatusOnSerialNow) {
     status(Serial);
   }
 }
diff --git a/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino b/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
index 5a24e2cf50..24018681e6 100644
--- a/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
+++ b/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
@@ -26,26 +26,25 @@
 #define STAPSK "your-password"
 #endif
 
-const char*  ssid      = STASSID;  // your network SSID (name)
-const char*  pass      = STAPSK;   // your network password
+const char* ssid = STASSID;  // your network SSID (name)
+const char* pass = STAPSK;   // your network password
 
 unsigned int localPort = 2390;  // local port to listen for UDP packets
 
 /* Don't hardwire the IP address or we won't get the benefits of the pool.
     Lookup the IP address for the host name instead */
 //IPAddress timeServer(129, 6, 15, 28); // time.nist.gov NTP server
-IPAddress    timeServerIP;  // time.nist.gov NTP server address
-const char*  ntpServerName   = "time.nist.gov";
+IPAddress   timeServerIP;  // time.nist.gov NTP server address
+const char* ntpServerName = "time.nist.gov";
 
-const int    NTP_PACKET_SIZE = 48;  // NTP time stamp is in the first 48 bytes of the message
+const int NTP_PACKET_SIZE = 48;  // NTP time stamp is in the first 48 bytes of the message
 
-byte         packetBuffer[NTP_PACKET_SIZE];  //buffer to hold incoming and outgoing packets
+byte packetBuffer[NTP_PACKET_SIZE];  //buffer to hold incoming and outgoing packets
 
 // A UDP instance to let us send and receive packets over UDP
-WiFiUDP      udp;
+WiFiUDP udp;
 
-void         setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println();
   Serial.println();
@@ -56,8 +55,7 @@ void         setup()
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -73,8 +71,7 @@ void         setup()
   Serial.println(udp.localPort());
 }
 
-void loop()
-{
+void loop() {
   //get a random server from the pool
   WiFi.hostByName(ntpServerName, timeServerIP);
 
@@ -83,12 +80,9 @@ void loop()
   delay(1000);
 
   int cb = udp.parsePacket();
-  if (!cb)
-  {
+  if (!cb) {
     Serial.println("no packet yet");
-  }
-  else
-  {
+  } else {
     Serial.print("packet received, length=");
     Serial.println(cb);
     // We've received a packet, read the data from it
@@ -97,8 +91,8 @@ void loop()
     //the timestamp starts at byte 40 of the received packet and is four bytes,
     // or two words, long. First, esxtract the two words:
 
-    unsigned long highWord      = word(packetBuffer[40], packetBuffer[41]);
-    unsigned long lowWord       = word(packetBuffer[42], packetBuffer[43]);
+    unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);
+    unsigned long lowWord  = word(packetBuffer[42], packetBuffer[43]);
     // combine the four bytes (two words) into a long integer
     // this is NTP time (seconds since Jan 1 1900):
     unsigned long secsSince1900 = highWord << 16 | lowWord;
@@ -110,7 +104,7 @@ void loop()
     // Unix time starts on Jan 1 1970. In seconds, that's 2208988800:
     const unsigned long seventyYears = 2208988800UL;
     // subtract seventy years:
-    unsigned long       epoch        = secsSince1900 - seventyYears;
+    unsigned long epoch = secsSince1900 - seventyYears;
     // print Unix time:
     Serial.println(epoch);
 
@@ -118,15 +112,13 @@ void loop()
     Serial.print("The UTC time is ");       // UTC is the time at Greenwich Meridian (GMT)
     Serial.print((epoch % 86400L) / 3600);  // print the hour (86400 equals secs per day)
     Serial.print(':');
-    if (((epoch % 3600) / 60) < 10)
-    {
+    if (((epoch % 3600) / 60) < 10) {
       // In the first 10 minutes of each hour, we'll want a leading '0'
       Serial.print('0');
     }
     Serial.print((epoch % 3600) / 60);  // print the minute (3600 equals secs per minute)
     Serial.print(':');
-    if ((epoch % 60) < 10)
-    {
+    if ((epoch % 60) < 10) {
       // In the first 10 seconds of each minute, we'll want a leading '0'
       Serial.print('0');
     }
@@ -137,17 +129,16 @@ void loop()
 }
 
 // send an NTP request to the time server at the given address
-void sendNTPpacket(IPAddress& address)
-{
+void sendNTPpacket(IPAddress& address) {
   Serial.println("sending NTP packet...");
   // set all bytes in the buffer to 0
   memset(packetBuffer, 0, NTP_PACKET_SIZE);
   // Initialize values needed to form NTP request
   // (see URL above for details on the packets)
-  packetBuffer[0]  = 0b11100011;  // LI, Version, Mode
-  packetBuffer[1]  = 0;           // Stratum, or type of clock
-  packetBuffer[2]  = 6;           // Polling Interval
-  packetBuffer[3]  = 0xEC;        // Peer Clock Precision
+  packetBuffer[0] = 0b11100011;  // LI, Version, Mode
+  packetBuffer[1] = 0;           // Stratum, or type of clock
+  packetBuffer[2] = 6;           // Polling Interval
+  packetBuffer[3] = 0xEC;        // Peer Clock Precision
   // 8 bytes of zero for Root Delay & Root Dispersion
   packetBuffer[12] = 49;
   packetBuffer[13] = 0x4E;
diff --git a/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino b/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
index 65754b12f4..d055921cdf 100644
--- a/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
+++ b/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
@@ -28,13 +28,12 @@
 #define STAPSK "your-password"
 #endif
 
-const char*       ssid     = STASSID;
-const char*       password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ArduinoWiFiServer server(2323);
 
-void              setup()
-{
+void setup() {
   Serial.begin(115200);
 
   Serial.println();
@@ -43,8 +42,7 @@ void              setup()
 
   WiFi.begin(ssid, password);
 
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -59,11 +57,9 @@ void              setup()
   Serial.println(" 2323");
 }
 
-void loop()
-{
-  WiFiClient client = server.available();  // returns first client which has data to read or a 'false' client
-  if (client)
-  {                                           // client is true only if it is connected and has data to read
+void loop() {
+  WiFiClient client = server.available();     // returns first client which has data to read or a 'false' client
+  if (client) {                               // client is true only if it is connected and has data to read
     String s = client.readStringUntil('\n');  // read the message incoming from one of the clients
     s.trim();                                 // trim eventual \r
     Serial.println(s);                        // print the message to Serial Monitor
diff --git a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
index 1dccfab67d..bb761a026a 100644
--- a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
+++ b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
@@ -22,8 +22,7 @@
 
 #include <NetDump.h>
 
-void dump(int netif_idx, const char* data, size_t len, int out, int success)
-{
+void dump(int netif_idx, const char* data, size_t len, int out, int success) {
   (void)success;
   Serial.print(out ? F("out ") : F(" in "));
   Serial.printf("%d ", netif_idx);
@@ -36,8 +35,7 @@ void dump(int netif_idx, const char* data, size_t len, int out, int success)
 }
 #endif
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.printf("\n\nNAPT Range extender\n");
   Serial.printf("Heap on start: %d\n", ESP.getFreeHeap());
@@ -49,8 +47,7 @@ void setup()
   // first, connect to STA so we can get a proper local DNS server
   WiFi.mode(WIFI_STA);
   WiFi.begin(STASSID, STAPSK);
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     Serial.print('.');
     delay(500);
   }
@@ -73,32 +70,27 @@ void setup()
   Serial.printf("Heap before: %d\n", ESP.getFreeHeap());
   err_t ret = ip_napt_init(NAPT, NAPT_PORT);
   Serial.printf("ip_napt_init(%d,%d): ret=%d (OK=%d)\n", NAPT, NAPT_PORT, (int)ret, (int)ERR_OK);
-  if (ret == ERR_OK)
-  {
+  if (ret == ERR_OK) {
     ret = ip_napt_enable_no(SOFTAP_IF, 1);
     Serial.printf("ip_napt_enable_no(SOFTAP_IF): ret=%d (OK=%d)\n", (int)ret, (int)ERR_OK);
-    if (ret == ERR_OK)
-    {
+    if (ret == ERR_OK) {
       Serial.printf("WiFi Network '%s' with same password is now NATed behind '%s'\n", STASSID "extender", STASSID);
     }
   }
   Serial.printf("Heap after napt init: %d\n", ESP.getFreeHeap());
-  if (ret != ERR_OK)
-  {
+  if (ret != ERR_OK) {
     Serial.printf("NAPT initialization failed\n");
   }
 }
 
 #else
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.printf("\n\nNAPT not supported in this configuration\n");
 }
 
 #endif
 
-void loop()
-{
+void loop() {
 }
diff --git a/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino b/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
index e057fc3ada..e1de8fe630 100644
--- a/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
+++ b/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
@@ -7,32 +7,30 @@
 #include <LwipDhcpServer.h>
 
 /* Set these to your desired credentials. */
-const char*      ssid     = "ESPap";
-const char*      password = "thereisnospoon";
+const char* ssid     = "ESPap";
+const char* password = "thereisnospoon";
 
 ESP8266WebServer server(80);
 
 /* Set the IP Address you want for your AP */
-IPAddress        apIP(192, 168, 0, 1);
+IPAddress apIP(192, 168, 0, 1);
 
 /* Go to http://192.168.0.1 in a web browser to see current lease */
-void             handleRoot()
-{
+void handleRoot() {
   String               result;
   char                 wifiClientMac[18];
   unsigned char        number_client;
   struct station_info* stat_info;
 
-  int                  i = 1;
+  int i = 1;
 
-  number_client          = wifi_softap_get_station_num();
-  stat_info              = wifi_softap_get_station_info();
+  number_client = wifi_softap_get_station_num();
+  stat_info     = wifi_softap_get_station_info();
 
-  result                 = "<html><body><h1>Total Connected Clients : ";
+  result = "<html><body><h1>Total Connected Clients : ";
   result += String(number_client);
   result += "</h1></br>";
-  while (stat_info != NULL)
-  {
+  while (stat_info != NULL) {
     result += "Client ";
     result += String(i);
     result += " = ";
@@ -50,8 +48,7 @@ void             handleRoot()
   server.send(200, "text/html", result);
 }
 
-void setup()
-{
+void setup() {
   /* List of mac address for static lease */
   uint8 mac_CAM[6] = { 0x00, 0x0C, 0x43, 0x01, 0x60, 0x15 };
   uint8 mac_PC[6]  = { 0xb4, 0x52, 0x7e, 0x9a, 0x19, 0xa5 };
@@ -90,7 +87,6 @@ void setup()
   Serial.println("HTTP server started");
 }
 
-void loop()
-{
+void loop() {
   server.handleClient();
 }
diff --git a/libraries/ESP8266WiFi/examples/Udp/Udp.ino b/libraries/ESP8266WiFi/examples/Udp/Udp.ino
index 10c4905e63..0954603e6d 100644
--- a/libraries/ESP8266WiFi/examples/Udp/Udp.ino
+++ b/libraries/ESP8266WiFi/examples/Udp/Udp.ino
@@ -25,18 +25,16 @@
 unsigned int localPort = 8888;  // local port to listen on
 
 // buffers for receiving and sending data
-char         packetBuffer[UDP_TX_PACKET_MAX_SIZE + 1];  //buffer to hold incoming packet,
-char         ReplyBuffer[] = "acknowledged\r\n";        // a string to send back
+char packetBuffer[UDP_TX_PACKET_MAX_SIZE + 1];  //buffer to hold incoming packet,
+char ReplyBuffer[] = "acknowledged\r\n";        // a string to send back
 
-WiFiUDP      Udp;
+WiFiUDP Udp;
 
-void         setup()
-{
+void setup() {
   Serial.begin(115200);
   WiFi.mode(WIFI_STA);
   WiFi.begin(STASSID, STAPSK);
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     Serial.print('.');
     delay(500);
   }
@@ -46,12 +44,10 @@ void         setup()
   Udp.begin(localPort);
 }
 
-void loop()
-{
+void loop() {
   // if there's data available, read a packet
   int packetSize = Udp.parsePacket();
-  if (packetSize)
-  {
+  if (packetSize) {
     Serial.printf("Received packet of size %d from %s:%d\n    (to %s:%d, free heap = %d B)\n",
                   packetSize,
                   Udp.remoteIP().toString().c_str(), Udp.remotePort(),
diff --git a/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino b/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
index e807d9e45f..11d79620e5 100644
--- a/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
@@ -40,21 +40,19 @@
 #endif
 
 /* Set these to your desired credentials. */
-const char*      ssid     = APSSID;
-const char*      password = APPSK;
+const char* ssid     = APSSID;
+const char* password = APPSK;
 
 ESP8266WebServer server(80);
 
 /* Just a little test message.  Go to http://192.168.4.1 in a web browser
    connected to this access point to see it.
 */
-void             handleRoot()
-{
+void handleRoot() {
   server.send(200, "text/html", "<h1>You are connected</h1>");
 }
 
-void setup()
-{
+void setup() {
   delay(1000);
   Serial.begin(115200);
   Serial.println();
@@ -70,7 +68,6 @@ void setup()
   Serial.println("HTTP server started");
 }
 
-void loop()
-{
+void loop() {
   server.handleClient();
 }
diff --git a/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino b/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino
index 2083f8cf2e..9474d5e0b1 100644
--- a/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino
@@ -10,14 +10,13 @@
 #define STAPSK "your-password"
 #endif
 
-const char*    ssid     = STASSID;
-const char*    password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
-const char*    host     = "djxmmx.net";
-const uint16_t port     = 17;
+const char*    host = "djxmmx.net";
+const uint16_t port = 17;
 
-void           setup()
-{
+void setup() {
   Serial.begin(115200);
 
   // We start by connecting to a WiFi network
@@ -33,8 +32,7 @@ void           setup()
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
 
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -45,8 +43,7 @@ void           setup()
   Serial.println(WiFi.localIP());
 }
 
-void loop()
-{
+void loop() {
   static bool wait = false;
 
   Serial.print("connecting to ");
@@ -56,8 +53,7 @@ void loop()
 
   // Use WiFiClient class to create TCP connections
   WiFiClient client;
-  if (!client.connect(host, port))
-  {
+  if (!client.connect(host, port)) {
     Serial.println("connection failed");
     delay(5000);
     return;
@@ -65,17 +61,14 @@ void loop()
 
   // This will send a string to the server
   Serial.println("sending data to server");
-  if (client.connected())
-  {
+  if (client.connected()) {
     client.println("hello from ESP8266");
   }
 
   // wait for data to be available
   unsigned long timeout = millis();
-  while (client.available() == 0)
-  {
-    if (millis() - timeout > 5000)
-    {
+  while (client.available() == 0) {
+    if (millis() - timeout > 5000) {
       Serial.println(">>> Client Timeout !");
       client.stop();
       delay(60000);
@@ -86,8 +79,7 @@ void loop()
   // Read all the lines of the reply from server and print them to Serial
   Serial.println("receiving from remote server");
   // not testing 'client.connected()' since we do not need to send data here
-  while (client.available())
-  {
+  while (client.available()) {
     char ch = static_cast<char>(client.read());
     Serial.print(ch);
   }
@@ -97,8 +89,7 @@ void loop()
   Serial.println("closing connection");
   client.stop();
 
-  if (wait)
-  {
+  if (wait) {
     delay(300000);  // execute once every 5 minutes, don't flood remote service
   }
   wait = true;
diff --git a/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino b/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
index 7aa4b0baef..515f770cca 100644
--- a/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
@@ -12,16 +12,15 @@
 #define STAPSK "your-password"
 #endif
 
-const char*      ssid     = STASSID;
-const char*      password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
-const char*      host     = "192.168.1.1";
-const uint16_t   port     = 3000;
+const char*    host = "192.168.1.1";
+const uint16_t port = 3000;
 
 ESP8266WiFiMulti WiFiMulti;
 
-void             setup()
-{
+void setup() {
   Serial.begin(115200);
 
   // We start by connecting to a WiFi network
@@ -32,8 +31,7 @@ void             setup()
   Serial.println();
   Serial.print("Wait for WiFi... ");
 
-  while (WiFiMulti.run() != WL_CONNECTED)
-  {
+  while (WiFiMulti.run() != WL_CONNECTED) {
     Serial.print(".");
     delay(500);
   }
@@ -46,8 +44,7 @@ void             setup()
   delay(500);
 }
 
-void loop()
-{
+void loop() {
   Serial.print("connecting to ");
   Serial.print(host);
   Serial.print(':');
@@ -56,8 +53,7 @@ void loop()
   // Use WiFiClient class to create TCP connections
   WiFiClient client;
 
-  if (!client.connect(host, port))
-  {
+  if (!client.connect(host, port)) {
     Serial.println("connection failed");
     Serial.println("wait 5 sec...");
     delay(5000);
diff --git a/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino b/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
index 6488c2266a..2b5ad66bc8 100644
--- a/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
@@ -14,10 +14,10 @@
 #define STAPSK "your-password"
 #endif
 
-constexpr int                          port = 23;
+constexpr int port = 23;
 
-WiFiServer                             server(port);
-WiFiClient                             client;
+WiFiServer server(port);
+WiFiClient client;
 
 constexpr size_t                       sizes[]  = { 0, 512, 384, 256, 128, 64, 16, 8, 4 };
 constexpr uint32_t                     breathMs = 200;
@@ -26,8 +26,7 @@ esp8266::polledTimeout::periodicFastMs test(2000);
 int                                    t = 1;  // test (1, 2 or 3, see below)
 int                                    s = 0;  // sizes[] index
 
-void                                   setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println(ESP.getFullVersion());
 
@@ -35,8 +34,7 @@ void                                   setup()
   WiFi.begin(STASSID, STAPSK);
   Serial.print("\nConnecting to ");
   Serial.println(STASSID);
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     Serial.print('.');
     delay(500);
   }
@@ -55,42 +53,34 @@ void                                   setup()
                 port);
 }
 
-void loop()
-{
+void loop() {
   MDNS.update();
 
   static uint32_t tot = 0;
   static uint32_t cnt = 0;
-  if (test && cnt)
-  {
+  if (test && cnt) {
     Serial.printf("measured-block-size=%u min-free-stack=%u", tot / cnt, ESP.getFreeContStack());
-    if (t == 2 && sizes[s])
-    {
+    if (t == 2 && sizes[s]) {
       Serial.printf(" (blocks: at most %d bytes)", sizes[s]);
     }
-    if (t == 3 && sizes[s])
-    {
+    if (t == 3 && sizes[s]) {
       Serial.printf(" (blocks: exactly %d bytes)", sizes[s]);
     }
-    if (t == 3 && !sizes[s])
-    {
+    if (t == 3 && !sizes[s]) {
       Serial.printf(" (blocks: any size)");
     }
     Serial.printf("\n");
   }
 
   //check if there are any new clients
-  if (server.hasClient())
-  {
+  if (server.hasClient()) {
     client = server.accept();
     Serial.println("New client");
   }
 
-  if (Serial.available())
-  {
+  if (Serial.available()) {
     s = (s + 1) % (sizeof(sizes) / sizeof(sizes[0]));
-    switch (Serial.read())
-    {
+    switch (Serial.read()) {
       case '1':
         if (t != 1)
           s = 0;
@@ -120,11 +110,9 @@ void loop()
 
   enoughMs.reset(breathMs);
 
-  if (t == 1)
-  {
+  if (t == 1) {
     // byte by byte
-    while (client.available() && client.availableForWrite() && !enoughMs)
-    {
+    while (client.available() && client.availableForWrite() && !enoughMs) {
       // working char by char is not efficient
       client.write(client.read());
       cnt++;
@@ -132,18 +120,15 @@ void loop()
     }
   }
 
-  else if (t == 2)
-  {
+  else if (t == 2) {
     // block by block through a local buffer (2 copies)
-    while (client.available() && client.availableForWrite() && !enoughMs)
-    {
+    while (client.available() && client.availableForWrite() && !enoughMs) {
       size_t maxTo = std::min(client.available(), client.availableForWrite());
       maxTo        = std::min(maxTo, sizes[s]);
       uint8_t buf[maxTo];
       size_t  tcp_got  = client.read(buf, maxTo);
       size_t  tcp_sent = client.write(buf, tcp_got);
-      if (tcp_sent != maxTo)
-      {
+      if (tcp_sent != maxTo) {
         Serial.printf("len mismatch: available:%zd tcp-read:%zd serial-write:%zd\n", maxTo, tcp_got, tcp_sent);
       }
       tot += tcp_sent;
@@ -151,21 +136,16 @@ void loop()
     }
   }
 
-  else if (t == 3)
-  {
+  else if (t == 3) {
     // stream to print, possibly with only one copy
-    if (sizes[s])
-    {
+    if (sizes[s]) {
       tot += client.sendSize(&client, sizes[s]);
-    }
-    else
-    {
+    } else {
       tot += client.sendAvailable(&client);
     }
     cnt++;
 
-    switch (client.getLastSendReport())
-    {
+    switch (client.getLastSendReport()) {
       case Stream::Report::Success:
         break;
       case Stream::Report::TimedOut:
@@ -183,14 +163,12 @@ void loop()
     }
   }
 
-  else if (t == 4)
-  {
+  else if (t == 4) {
     // stream to print, possibly with only one copy
     tot += client.sendAll(&client);  // this one might not exit until peer close
     cnt++;
 
-    switch (client.getLastSendReport())
-    {
+    switch (client.getLastSendReport()) {
       case Stream::Report::Success:
         break;
       case Stream::Report::TimedOut:
diff --git a/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino b/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
index 1595abb544..9c094c1013 100644
--- a/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
@@ -21,18 +21,17 @@
 #define APPSK "esp8266"
 #endif
 
-const char*      ssid     = APSSID;
-const char*      password = APPSK;
+const char* ssid     = APSSID;
+const char* password = APPSK;
 
 WiFiEventHandler stationConnectedHandler;
 WiFiEventHandler stationDisconnectedHandler;
 WiFiEventHandler probeRequestPrintHandler;
 WiFiEventHandler probeRequestBlinkHandler;
 
-bool             blinkFlag;
+bool blinkFlag;
 
-void             setup()
-{
+void setup() {
   Serial.begin(115200);
   pinMode(LED_BUILTIN, OUTPUT);
   digitalWrite(LED_BUILTIN, HIGH);
@@ -47,55 +46,48 @@ void             setup()
   // Register event handlers.
   // Callback functions will be called as long as these handler objects exist.
   // Call "onStationConnected" each time a station connects
-  stationConnectedHandler    = WiFi.onSoftAPModeStationConnected(&onStationConnected);
+  stationConnectedHandler = WiFi.onSoftAPModeStationConnected(&onStationConnected);
   // Call "onStationDisconnected" each time a station disconnects
   stationDisconnectedHandler = WiFi.onSoftAPModeStationDisconnected(&onStationDisconnected);
   // Call "onProbeRequestPrint" and "onProbeRequestBlink" each time
   // a probe request is received.
   // Former will print MAC address of the station and RSSI to Serial,
   // latter will blink an LED.
-  probeRequestPrintHandler   = WiFi.onSoftAPModeProbeRequestReceived(&onProbeRequestPrint);
-  probeRequestBlinkHandler   = WiFi.onSoftAPModeProbeRequestReceived(&onProbeRequestBlink);
+  probeRequestPrintHandler = WiFi.onSoftAPModeProbeRequestReceived(&onProbeRequestPrint);
+  probeRequestBlinkHandler = WiFi.onSoftAPModeProbeRequestReceived(&onProbeRequestBlink);
 }
 
-void onStationConnected(const WiFiEventSoftAPModeStationConnected& evt)
-{
+void onStationConnected(const WiFiEventSoftAPModeStationConnected& evt) {
   Serial.print("Station connected: ");
   Serial.println(macToString(evt.mac));
 }
 
-void onStationDisconnected(const WiFiEventSoftAPModeStationDisconnected& evt)
-{
+void onStationDisconnected(const WiFiEventSoftAPModeStationDisconnected& evt) {
   Serial.print("Station disconnected: ");
   Serial.println(macToString(evt.mac));
 }
 
-void onProbeRequestPrint(const WiFiEventSoftAPModeProbeRequestReceived& evt)
-{
+void onProbeRequestPrint(const WiFiEventSoftAPModeProbeRequestReceived& evt) {
   Serial.print("Probe request from: ");
   Serial.print(macToString(evt.mac));
   Serial.print(" RSSI: ");
   Serial.println(evt.rssi);
 }
 
-void onProbeRequestBlink(const WiFiEventSoftAPModeProbeRequestReceived&)
-{
+void onProbeRequestBlink(const WiFiEventSoftAPModeProbeRequestReceived&) {
   // We can't use "delay" or other blocking functions in the event handler.
   // Therefore we set a flag here and then check it inside "loop" function.
   blinkFlag = true;
 }
 
-void loop()
-{
-  if (millis() > 10000 && probeRequestPrintHandler)
-  {
+void loop() {
+  if (millis() > 10000 && probeRequestPrintHandler) {
     // After 10 seconds, disable the probe request event handler which prints.
     // Other three event handlers remain active.
     Serial.println("Not printing probe requests any more (LED should still blink)");
     probeRequestPrintHandler = WiFiEventHandler();
   }
-  if (blinkFlag)
-  {
+  if (blinkFlag) {
     blinkFlag = false;
     digitalWrite(LED_BUILTIN, LOW);
     delay(100);
@@ -104,8 +96,7 @@ void loop()
   delay(10);
 }
 
-String macToString(const unsigned char* mac)
-{
+String macToString(const unsigned char* mac) {
   char buf[20];
   snprintf(buf, sizeof(buf), "%02x:%02x:%02x:%02x:%02x:%02x",
            mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
diff --git a/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino b/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
index 1aff11f4d6..a585092bdd 100644
--- a/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
@@ -19,10 +19,9 @@ const char* password = STAPSK;
 
 // Create an instance of the server
 // specify the port to listen on as an argument
-WiFiServer  server(80);
+WiFiServer server(80);
 
-void        setup()
-{
+void setup() {
   Serial.begin(115200);
 
   // prepare LED
@@ -38,8 +37,7 @@ void        setup()
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
 
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(F("."));
   }
@@ -54,12 +52,10 @@ void        setup()
   Serial.println(WiFi.localIP());
 }
 
-void loop()
-{
+void loop() {
   // Check if a client has connected
   WiFiClient client = server.accept();
-  if (!client)
-  {
+  if (!client) {
     return;
   }
   Serial.println(F("new client"));
@@ -73,16 +69,11 @@ void loop()
 
   // Match the request
   int val;
-  if (req.indexOf(F("/gpio/0")) != -1)
-  {
+  if (req.indexOf(F("/gpio/0")) != -1) {
     val = 0;
-  }
-  else if (req.indexOf(F("/gpio/1")) != -1)
-  {
+  } else if (req.indexOf(F("/gpio/1")) != -1) {
     val = 1;
-  }
-  else
-  {
+  } else {
     Serial.println(F("invalid request"));
     val = digitalRead(LED_BUILTIN);
   }
@@ -92,8 +83,7 @@ void loop()
 
   // read/ignore the rest of the request
   // do not client.flush(): it is for output only, see below
-  while (client.available())
-  {
+  while (client.available()) {
     // byte by byte is not very efficient
     client.read();
   }
diff --git a/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino b/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
index f5356d4f2d..30542af4e0 100644
--- a/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
@@ -6,8 +6,7 @@
 
 #include <ESP8266WiFi.h>
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println(F("\nESP8266 WiFi scan example"));
 
@@ -19,8 +18,7 @@ void setup()
   delay(100);
 }
 
-void loop()
-{
+void loop() {
   String   ssid;
   int32_t  rssi;
   uint8_t  encryptionType;
@@ -33,17 +31,13 @@ void loop()
 
   scanResult = WiFi.scanNetworks(/*async=*/false, /*hidden=*/true);
 
-  if (scanResult == 0)
-  {
+  if (scanResult == 0) {
     Serial.println(F("No networks found"));
-  }
-  else if (scanResult > 0)
-  {
+  } else if (scanResult > 0) {
     Serial.printf(PSTR("%d networks found:\n"), scanResult);
 
     // Print unsorted scan results
-    for (int8_t i = 0; i < scanResult; i++)
-    {
+    for (int8_t i = 0; i < scanResult; i++) {
       WiFi.getNetworkInfo(i, ssid, encryptionType, rssi, bssid, channel, hidden);
 
       Serial.printf(PSTR("  %02d: [CH %02d] [%02X:%02X:%02X:%02X:%02X:%02X] %ddBm %c %c %s\n"),
@@ -57,9 +51,7 @@ void loop()
                     ssid.c_str());
       yield();
     }
-  }
-  else
-  {
+  } else {
     Serial.printf(PSTR("WiFi scan error %d"), scanResult);
   }
 
diff --git a/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino b/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
index 3ab8d6584c..f246f98d68 100644
--- a/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
@@ -19,13 +19,12 @@
 #include <ESP8266WiFi.h>
 #include <include/WiFiState.h>  // WiFiState structure details
 
-WiFiState   state;
+WiFiState state;
 
 const char* ssid     = STASSID;
 const char* password = STAPSK;
 
-void        setup()
-{
+void setup() {
   Serial.begin(74880);
   //Serial.setDebugOutput(true);  // If you need debug output
   Serial.println("Trying to resume WiFi connection...");
@@ -41,15 +40,13 @@ void        setup()
   unsigned long start = millis();
 
   if (!WiFi.resumeFromShutdown(state)
-      || (WiFi.waitForConnectResult(10000) != WL_CONNECTED))
-  {
+      || (WiFi.waitForConnectResult(10000) != WL_CONNECTED)) {
     Serial.println("Cannot resume WiFi connection, connecting via begin...");
     WiFi.persistent(false);
 
     if (!WiFi.mode(WIFI_STA)
         || !WiFi.begin(ssid, password)
-        || (WiFi.waitForConnectResult(10000) != WL_CONNECTED))
-    {
+        || (WiFi.waitForConnectResult(10000) != WL_CONNECTED)) {
       WiFi.mode(WIFI_OFF);
       Serial.println("Cannot connect!");
       Serial.flush();
@@ -78,7 +75,6 @@ void        setup()
   ESP.deepSleep(10e6, RF_DISABLED);
 }
 
-void loop()
-{
+void loop() {
   // Nothing to do here.
 }
diff --git a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
index 8bd69fb751..9dafae4cf4 100644
--- a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
@@ -71,13 +71,12 @@ SoftwareSerial* logger = nullptr;
 const char* ssid     = STASSID;
 const char* password = STAPSK;
 
-const int   port     = 23;
+const int port = 23;
 
-WiFiServer  server(port);
-WiFiClient  serverClients[MAX_SRV_CLIENTS];
+WiFiServer server(port);
+WiFiClient serverClients[MAX_SRV_CLIENTS];
 
-void        setup()
-{
+void setup() {
   Serial.begin(BAUD_SERIAL);
   Serial.setRxBufferSize(RXBUFFERSIZE);
 
@@ -106,8 +105,7 @@ void        setup()
   WiFi.begin(ssid, password);
   logger->print("\nConnecting to ");
   logger->println(ssid);
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     logger->print('.');
     delay(500);
   }
@@ -124,16 +122,13 @@ void        setup()
   logger->printf(" %d' to connect\n", port);
 }
 
-void loop()
-{
+void loop() {
   //check if there are any new clients
-  if (server.hasClient())
-  {
+  if (server.hasClient()) {
     //find free/disconnected spot
     int i;
     for (i = 0; i < MAX_SRV_CLIENTS; i++)
-      if (!serverClients[i])
-      {  // equivalent to !serverClients[i].connected()
+      if (!serverClients[i]) {  // equivalent to !serverClients[i].connected()
         serverClients[i] = server.accept();
         logger->print("New client: index ");
         logger->print(i);
@@ -141,8 +136,7 @@ void loop()
       }
 
     //no free/disconnected spot so reject
-    if (i == MAX_SRV_CLIENTS)
-    {
+    if (i == MAX_SRV_CLIENTS) {
       server.accept().println("busy");
       // hints: server.accept() is a WiFiClient with short-term scope
       // when out of scope, a WiFiClient will
@@ -157,23 +151,20 @@ void loop()
   // Incredibly, this code is faster than the buffered one below - #4620 is needed
   // loopback/3000000baud average 348KB/s
   for (int i = 0; i < MAX_SRV_CLIENTS; i++)
-    while (serverClients[i].available() && Serial.availableForWrite() > 0)
-    {
+    while (serverClients[i].available() && Serial.availableForWrite() > 0) {
       // working char by char is not very efficient
       Serial.write(serverClients[i].read());
     }
 #else
   // loopback/3000000baud average: 312KB/s
   for (int i = 0; i < MAX_SRV_CLIENTS; i++)
-    while (serverClients[i].available() && Serial.availableForWrite() > 0)
-    {
+    while (serverClients[i].available() && Serial.availableForWrite() > 0) {
       size_t maxToSerial = std::min(serverClients[i].available(), Serial.availableForWrite());
       maxToSerial        = std::min(maxToSerial, (size_t)STACK_PROTECTOR);
       uint8_t buf[maxToSerial];
       size_t  tcp_got     = serverClients[i].read(buf, maxToSerial);
       size_t  serial_sent = Serial.write(buf, tcp_got);
-      if (serial_sent != maxToSerial)
-      {
+      if (serial_sent != maxToSerial) {
         logger->printf("len mismatch: available:%zd tcp-read:%zd serial-write:%zd\n", maxToSerial, tcp_got, serial_sent);
       }
     }
@@ -183,22 +174,15 @@ void loop()
   // client.availableForWrite() returns 0 when !client.connected()
   int maxToTcp = 0;
   for (int i = 0; i < MAX_SRV_CLIENTS; i++)
-    if (serverClients[i])
-    {
+    if (serverClients[i]) {
       int afw = serverClients[i].availableForWrite();
-      if (afw)
-      {
-        if (!maxToTcp)
-        {
+      if (afw) {
+        if (!maxToTcp) {
           maxToTcp = afw;
-        }
-        else
-        {
+        } else {
           maxToTcp = std::min(maxToTcp, afw);
         }
-      }
-      else
-      {
+      } else {
         // warn but ignore congested clients
         logger->println("one client is congested");
       }
@@ -207,8 +191,7 @@ void loop()
   //check UART for data
   size_t len = std::min(Serial.available(), maxToTcp);
   len        = std::min(len, (size_t)STACK_PROTECTOR);
-  if (len)
-  {
+  if (len) {
     uint8_t sbuf[len];
     int     serial_got = Serial.readBytes(sbuf, len);
     // push UART data to all connected telnet clients
@@ -216,11 +199,9 @@ void loop()
       // if client.availableForWrite() was 0 (congested)
       // and increased since then,
       // ensure write space is sufficient:
-      if (serverClients[i].availableForWrite() >= serial_got)
-      {
+      if (serverClients[i].availableForWrite() >= serial_got) {
         size_t tcp_sent = serverClients[i].write(sbuf, serial_got);
-        if (tcp_sent != len)
-        {
+        if (tcp_sent != len) {
           logger->printf("len mismatch: available:%zd serial-read:%zd tcp-write:%zd\n", len, serial_got, tcp_sent);
         }
       }
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino b/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
index 8e296e0324..34f21be030 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
@@ -6,7 +6,7 @@
 #include <TypeConversionFunctions.h>
 #include <assert.h>
 
-namespace TypeCast                                      = MeshTypeConversionFunctions;
+namespace TypeCast = MeshTypeConversionFunctions;
 
 /**
    NOTE: Although we could define the strings below as normal String variables,
@@ -19,23 +19,23 @@ namespace TypeCast                                      = MeshTypeConversionFunc
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char         exampleMeshName[] PROGMEM        = "MeshNode_";                    // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
-constexpr char         exampleWiFiPassword[] PROGMEM    = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
+constexpr char exampleMeshName[] PROGMEM     = "MeshNode_";                    // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
+constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
 
 // A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a default Kok set, but it can be replaced if desired.
 // All ESP-NOW keys below must match in an encrypted connection pair for encrypted communication to be possible.
 // Note that it is also possible to use Strings as key seeds instead of arrays.
-uint8_t                espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting transmissions of encrypted connections.
+uint8_t espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting transmissions of encrypted connections.
                                              0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11 };
-uint8_t                espnowEncryptionKok[16]          = { 0x22, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting the encrypted connection key.
+uint8_t espnowEncryptionKok[16]          = { 0x22, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting the encrypted connection key.
                                     0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x33 };
-uint8_t                espnowHashKey[16]                = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44,  // This is the secret key used for HMAC during encrypted connection requests.
+uint8_t espnowHashKey[16]                = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44,  // This is the secret key used for HMAC during encrypted connection requests.
                               0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD };
 
-unsigned int           requestNumber                    = 0;
-unsigned int           responseNumber                   = 0;
+unsigned int requestNumber  = 0;
+unsigned int responseNumber = 0;
 
-const char             broadcastMetadataDelimiter       = 23;  // 23 = End-of-Transmission-Block (ETB) control character in ASCII
+const char broadcastMetadataDelimiter = 23;  // 23 = End-of-Transmission-Block (ETB) control character in ASCII
 
 String                 manageRequest(const String& request, MeshBackendBase& meshInstance);
 TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance);
@@ -43,7 +43,7 @@ void                   networkFilter(int numberOfNetworks, MeshBackendBase& mesh
 bool                   broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance);
 
 /* Create the mesh node object */
-EspnowMeshBackend      espnowNode = EspnowMeshBackend(manageRequest, manageResponse, networkFilter, broadcastFilter, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
+EspnowMeshBackend espnowNode = EspnowMeshBackend(manageRequest, manageResponse, networkFilter, broadcastFilter, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
 
 /**
    Callback for when other nodes send you a request
@@ -52,21 +52,15 @@ EspnowMeshBackend      espnowNode = EspnowMeshBackend(manageRequest, manageRespo
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
 */
-String                 manageRequest(const String& request, MeshBackendBase& meshInstance)
-{
+String manageRequest(const String& request, MeshBackendBase& meshInstance) {
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance))
-  {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  }
-  else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance))
-  {
+  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
     (void)tcpIpInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
     Serial.print(F("TCP/IP: "));
-  }
-  else
-  {
+  } else {
     Serial.print(F("UNKNOWN!: "));
   }
 
@@ -76,12 +70,9 @@ String                 manageRequest(const String& request, MeshBackendBase& mes
   // Note that request.substring will not work as expected if the String contains null values as data.
   Serial.print(F("Request received: "));
 
-  if (request.charAt(0) == 0)
-  {
+  if (request.charAt(0) == 0) {
     Serial.println(request);  // substring will not work for multiStrings.
-  }
-  else
-  {
+  } else {
     Serial.println(request.substring(0, 100));
   }
 
@@ -96,18 +87,14 @@ String                 manageRequest(const String& request, MeshBackendBase& mes
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The status code resulting from the response, as an int
 */
-TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance)
-{
+TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance) {
   TransmissionStatusType statusCode = TransmissionStatusType::TRANSMISSION_COMPLETE;
 
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance))
-  {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  }
-  else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance))
-  {
+  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
     Serial.print(F("TCP/IP: "));
 
     // Getting the sent message like this will work as long as ONLY(!) TCP/IP is used.
@@ -116,9 +103,7 @@ TransmissionStatusType manageResponse(const String& response, MeshBackendBase& m
     // So for ESP-NOW, adding unique identifiers in the response and request is required to associate a response with a request.
     Serial.print(F("Request sent: "));
     Serial.println(tcpIpInstance->getCurrentMessage().substring(0, 100));
-  }
-  else
-  {
+  } else {
     Serial.print(F("UNKNOWN!: "));
   }
 
@@ -138,31 +123,22 @@ TransmissionStatusType manageResponse(const String& response, MeshBackendBase& m
    @param numberOfNetworks The number of networks found in the WiFi scan.
    @param meshInstance The MeshBackendBase instance that called the function.
 */
-void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance)
-{
+void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
   // Note that the network index of a given node may change whenever a new scan is done.
-  for (int networkIndex = 0; networkIndex < numberOfNetworks; ++networkIndex)
-  {
+  for (int networkIndex = 0; networkIndex < numberOfNetworks; ++networkIndex) {
     String currentSSID   = WiFi.SSID(networkIndex);
     int    meshNameIndex = currentSSID.indexOf(meshInstance.getMeshName());
 
     /* Connect to any _suitable_ APs which contain meshInstance.getMeshName() */
-    if (meshNameIndex >= 0)
-    {
+    if (meshNameIndex >= 0) {
       uint64_t targetNodeID = TypeCast::stringToUint64(currentSSID.substring(meshNameIndex + meshInstance.getMeshName().length()));
 
-      if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID()))
-      {
-        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance))
-        {
+      if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID())) {
+        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
           espnowInstance->connectionQueue().emplace_back(networkIndex);
-        }
-        else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance))
-        {
+        } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
           tcpIpInstance->connectionQueue().emplace_back(networkIndex);
-        }
-        else
-        {
+        } else {
           Serial.println(F("Invalid mesh backend!"));
         }
       }
@@ -182,26 +158,21 @@ void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance)
 
    @return True if the broadcast should be accepted. False otherwise.
 */
-bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance)
-{
+bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance) {
   // This example broadcastFilter will accept a transmission if it contains the broadcastMetadataDelimiter
   // and as metaData either no targetMeshName or a targetMeshName that matches the MeshName of meshInstance.
 
   int32_t metadataEndIndex = firstTransmission.indexOf(broadcastMetadataDelimiter);
 
-  if (metadataEndIndex == -1)
-  {
+  if (metadataEndIndex == -1) {
     return false;  // broadcastMetadataDelimiter not found
   }
 
   String targetMeshName = firstTransmission.substring(0, metadataEndIndex);
 
-  if (!targetMeshName.isEmpty() && meshInstance.getMeshName() != targetMeshName)
-  {
+  if (!targetMeshName.isEmpty() && meshInstance.getMeshName() != targetMeshName) {
     return false;  // Broadcast is for another mesh network
-  }
-  else
-  {
+  } else {
     // Remove metadata from message and mark as accepted broadcast.
     // Note that when you modify firstTransmission it is best to avoid using substring or other String methods that rely on null values for String length determination.
     // Otherwise your broadcasts cannot include null values in the message bytes.
@@ -221,8 +192,7 @@ bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance)
 
    @return True if attemptTransmission should continue with the next entry in the connectionQueue. False if attemptTransmission should stop.
 */
-bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance)
-{
+bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
   // Currently this is exactly the same as the default hook, but you can modify it to alter the behaviour of attemptTransmission.
 
   (void)meshInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
@@ -245,8 +215,7 @@ bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance)
    @return True if the response transmission process should continue with the next response in the waiting list.
            False if the response transmission process should stop once processing of the just sent response is complete.
 */
-bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String& response, const uint8_t* recipientMac, uint32_t responseIndex, EspnowMeshBackend& meshInstance)
-{
+bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String& response, const uint8_t* recipientMac, uint32_t responseIndex, EspnowMeshBackend& meshInstance) {
   // Currently this is exactly the same as the default hook, but you can modify it to alter the behaviour of sendEspnowResponses.
 
   (void)transmissionSuccessful;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
@@ -258,8 +227,7 @@ bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String& r
   return true;
 }
 
-void setup()
-{
+void setup() {
   // Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
   // This will however delay node WiFi start-up by about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to connect to.
   WiFi.persistent(false);
@@ -315,8 +283,7 @@ void setup()
 }
 
 int32_t timeOfLastScan = -10000;
-void    loop()
-{
+void    loop() {
   // The performEspnowMaintenance() method performs all the background operations for the EspnowMeshBackend.
   // It is recommended to place it in the beginning of the loop(), unless there is a need to put it elsewhere.
   // Among other things, the method cleans up old Espnow log entries (freeing up RAM) and sends the responses you provide to Espnow requests.
@@ -326,8 +293,7 @@ void    loop()
   //Should not be used inside responseHandler, requestHandler, networkFilter or broadcastFilter callbacks since performEspnowMaintenance() can alter the ESP-NOW state.
   EspnowMeshBackend::performEspnowMaintenance();
 
-  if (millis() - timeOfLastScan > 10000)
-  {  // Give other nodes some time to connect between data transfers.
+  if (millis() - timeOfLastScan > 10000) {  // Give other nodes some time to connect between data transfers.
     Serial.println(F("\nPerforming unencrypted ESP-NOW transmissions."));
 
     uint32_t startTime = millis();
@@ -341,34 +307,22 @@ void    loop()
     espnowDelay(100);
 
     // One way to check how attemptTransmission worked out
-    if (espnowNode.latestTransmissionSuccessful())
-    {
+    if (espnowNode.latestTransmissionSuccessful()) {
       Serial.println(F("Transmission successful."));
     }
 
     // Another way to check how attemptTransmission worked out
-    if (espnowNode.latestTransmissionOutcomes().empty())
-    {
+    if (espnowNode.latestTransmissionOutcomes().empty()) {
       Serial.println(F("No mesh AP found."));
-    }
-    else
-    {
-      for (TransmissionOutcome& transmissionOutcome : espnowNode.latestTransmissionOutcomes())
-      {
-        if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED)
-        {
+    } else {
+      for (TransmissionOutcome& transmissionOutcome : espnowNode.latestTransmissionOutcomes()) {
+        if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED) {
           Serial.println(String(F("Transmission failed to mesh AP ")) + transmissionOutcome.SSID());
-        }
-        else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED)
-        {
+        } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED) {
           Serial.println(String(F("Connection failed to mesh AP ")) + transmissionOutcome.SSID());
-        }
-        else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE)
-        {
+        } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE) {
           // No need to do anything, transmission was successful.
-        }
-        else
-        {
+        } else {
           Serial.println(String(F("Invalid transmission status for ")) + transmissionOutcome.SSID() + String('!'));
           assert(F("Invalid transmission status returned from responseHandler!") && false);
         }
@@ -376,7 +330,7 @@ void    loop()
 
       Serial.println(F("\nPerforming ESP-NOW broadcast."));
 
-      startTime                = millis();
+      startTime = millis();
 
       // Remove espnowNode.getMeshName() from the broadcastMetadata below to broadcast to all ESP-NOW nodes regardless of MeshName.
       // Note that data that comes before broadcastMetadataDelimiter should not contain any broadcastMetadataDelimiter characters,
@@ -402,8 +356,7 @@ void    loop()
       uint8_t targetBSSID[6] { 0 };
 
       // We can create encrypted connections to individual nodes so that all ESP-NOW communication with the node will be encrypted.
-      if (espnowNode.constConnectionQueue()[0].getBSSID(targetBSSID) && espnowNode.requestEncryptedConnection(targetBSSID) == EncryptedConnectionStatus::CONNECTION_ESTABLISHED)
-      {
+      if (espnowNode.constConnectionQueue()[0].getBSSID(targetBSSID) && espnowNode.requestEncryptedConnection(targetBSSID) == EncryptedConnectionStatus::CONNECTION_ESTABLISHED) {
         // The WiFi scan will detect the AP MAC, but this will automatically be converted to the encrypted STA MAC by the framework.
         String peerMac = TypeCast::macToString(targetBSSID);
 
@@ -441,8 +394,7 @@ void    loop()
         Serial.println();
         // If we want to remove the encrypted connection on both nodes, we can do it like this.
         EncryptedConnectionRemovalOutcome removalOutcome = espnowNode.requestEncryptedConnectionRemoval(targetBSSID);
-        if (removalOutcome == EncryptedConnectionRemovalOutcome::REMOVAL_SUCCEEDED)
-        {
+        if (removalOutcome == EncryptedConnectionRemovalOutcome::REMOVAL_SUCCEEDED) {
           Serial.println(peerMac + F(" is no longer encrypted!"));
 
           espnowMessage = String(F("This message is only received by node ")) + peerMac + F(". Transmitting in this way will not change the transmission state of the sender.");
@@ -453,8 +405,7 @@ void    loop()
           Serial.println();
 
           // Of course, we can also just create a temporary encrypted connection that will remove itself once its duration has passed.
-          if (espnowNode.requestTemporaryEncryptedConnection(targetBSSID, 1000) == EncryptedConnectionStatus::CONNECTION_ESTABLISHED)
-          {
+          if (espnowNode.requestTemporaryEncryptedConnection(targetBSSID, 1000) == EncryptedConnectionStatus::CONNECTION_ESTABLISHED) {
             espnowDelay(42);
             uint32_t remainingDuration = 0;
             EspnowMeshBackend::getConnectionInfo(targetBSSID, &remainingDuration);
@@ -479,9 +430,7 @@ void    loop()
           Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
           espnowNode.attemptAutoEncryptingTransmission(espnowMessage);
           espnowDelay(100);  // Wait for response.
-        }
-        else
-        {
+        } else {
           Serial.println(String(F("Ooops! Encrypted connection removal failed. Status: ")) + String(static_cast<int>(removalOutcome)));
         }
 
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino b/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
index f6be58d9e8..811b07f0ab 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
@@ -15,7 +15,7 @@
 #include <assert.h>
 #include <FloodingMesh.h>
 
-namespace TypeCast                              = MeshTypeConversionFunctions;
+namespace TypeCast = MeshTypeConversionFunctions;
 
 /**
    NOTE: Although we could define the strings below as normal String variables,
@@ -28,26 +28,26 @@ namespace TypeCast                              = MeshTypeConversionFunctions;
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char exampleMeshName[] PROGMEM        = "MeshNode_";                    // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
-constexpr char exampleWiFiPassword[] PROGMEM    = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
+constexpr char exampleMeshName[] PROGMEM     = "MeshNode_";                    // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
+constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
 
 // A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a default Kok set, but it can be replaced if desired.
 // All ESP-NOW keys below must match in an encrypted connection pair for encrypted communication to be possible.
 // Note that it is also possible to use Strings as key seeds instead of arrays.
-uint8_t        espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting transmissions of encrypted connections.
+uint8_t espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting transmissions of encrypted connections.
                                              0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11 };
-uint8_t        espnowHashKey[16]                = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44,  // This is the secret key used for HMAC during encrypted connection requests.
+uint8_t espnowHashKey[16]                = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44,  // This is the secret key used for HMAC during encrypted connection requests.
                               0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD };
 
-bool           meshMessageHandler(String& message, FloodingMesh& meshInstance);
+bool meshMessageHandler(String& message, FloodingMesh& meshInstance);
 
 /* Create the mesh node object */
-FloodingMesh   floodingMesh = FloodingMesh(meshMessageHandler, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
+FloodingMesh floodingMesh = FloodingMesh(meshMessageHandler, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
 
-bool           theOne       = true;
-String         theOneMac;
+bool   theOne = true;
+String theOneMac;
 
-bool           useLED = false;  // Change this to true if you wish the onboard LED to mark The One.
+bool useLED = false;  // Change this to true if you wish the onboard LED to mark The One.
 
 /**
    Callback for when a message is received from the mesh network.
@@ -60,48 +60,37 @@ bool           useLED = false;  // Change this to true if you wish the onboard L
    @param meshInstance The FloodingMesh instance that received the message.
    @return True if this node should forward the received message to other nodes. False otherwise.
 */
-bool           meshMessageHandler(String& message, FloodingMesh& meshInstance)
-{
+bool meshMessageHandler(String& message, FloodingMesh& meshInstance) {
   int32_t delimiterIndex = message.indexOf(meshInstance.metadataDelimiter());
-  if (delimiterIndex == 0)
-  {
+  if (delimiterIndex == 0) {
     Serial.print(String(F("Message received from STA MAC ")) + meshInstance.getEspnowMeshBackend().getSenderMac() + F(": "));
     Serial.println(message.substring(2, 102));
 
     String potentialMac = message.substring(2, 14);
 
-    if (potentialMac >= theOneMac)
-    {
-      if (potentialMac > theOneMac)
-      {
+    if (potentialMac >= theOneMac) {
+      if (potentialMac > theOneMac) {
         theOne    = false;
         theOneMac = potentialMac;
       }
 
-      if (useLED && !theOne)
-      {
+      if (useLED && !theOne) {
         bool ledState = message.charAt(1) == '1';
         digitalWrite(LED_BUILTIN, ledState);  // Turn LED on/off (LED_BUILTIN is active low)
       }
 
       return true;
-    }
-    else
-    {
+    } else {
       return false;
     }
-  }
-  else if (delimiterIndex > 0)
-  {
-    if (meshInstance.getOriginMac() == theOneMac)
-    {
-      uint32_t        totalBroadcasts = strtoul(message.c_str(), nullptr, 0);  // strtoul stops reading input when an invalid character is discovered.
+  } else if (delimiterIndex > 0) {
+    if (meshInstance.getOriginMac() == theOneMac) {
+      uint32_t totalBroadcasts = strtoul(message.c_str(), nullptr, 0);  // strtoul stops reading input when an invalid character is discovered.
 
       // Static variables are only initialized once.
-      static uint32_t firstBroadcast  = totalBroadcasts;
+      static uint32_t firstBroadcast = totalBroadcasts;
 
-      if (totalBroadcasts - firstBroadcast >= 100)
-      {                                               // Wait a little to avoid start-up glitches
+      if (totalBroadcasts - firstBroadcast >= 100) {  // Wait a little to avoid start-up glitches
         static uint32_t missedBroadcasts        = 1;  // Starting at one to compensate for initial -1 below.
         static uint32_t previousTotalBroadcasts = totalBroadcasts;
         static uint32_t totalReceivedBroadcasts = 0;
@@ -110,19 +99,15 @@ bool           meshMessageHandler(String& message, FloodingMesh& meshInstance)
         missedBroadcasts += totalBroadcasts - previousTotalBroadcasts - 1;  // We expect an increment by 1.
         previousTotalBroadcasts = totalBroadcasts;
 
-        if (totalReceivedBroadcasts % 50 == 0)
-        {
+        if (totalReceivedBroadcasts % 50 == 0) {
           Serial.println(String(F("missed/total: ")) + String(missedBroadcasts) + '/' + String(totalReceivedBroadcasts));
         }
-        if (totalReceivedBroadcasts % 500 == 0)
-        {
+        if (totalReceivedBroadcasts % 500 == 0) {
           Serial.println(String(F("Benchmark message: ")) + message.substring(0, 100));
         }
       }
     }
-  }
-  else
-  {
+  } else {
     // Only show first 100 characters because printing a large String takes a lot of time, which is a bad thing for a callback function.
     // If you need to print the whole String it is better to store it and print it in the loop() later.
     Serial.print(String(F("Message with origin ")) + meshInstance.getOriginMac() + F(" received: "));
@@ -132,8 +117,7 @@ bool           meshMessageHandler(String& message, FloodingMesh& meshInstance)
   return true;
 }
 
-void setup()
-{
+void setup() {
   // Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
   // This will however delay node WiFi start-up by about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to connect to.
   WiFi.persistent(false);
@@ -155,8 +139,7 @@ void setup()
   uint8_t apMacArray[6] { 0 };
   theOneMac = TypeCast::macToString(WiFi.softAPmacAddress(apMacArray));
 
-  if (useLED)
-  {
+  if (useLED) {
     pinMode(LED_BUILTIN, OUTPUT);    // Initialize the LED_BUILTIN pin as an output
     digitalWrite(LED_BUILTIN, LOW);  // Turn LED on (LED_BUILTIN is active low)
   }
@@ -172,8 +155,7 @@ void setup()
 }
 
 int32_t timeOfLastProclamation = -10000;
-void    loop()
-{
+void    loop() {
   static bool     ledState       = 1;
   static uint32_t benchmarkCount = 0;
   static uint32_t loopStart      = millis();
@@ -190,10 +172,8 @@ void    loop()
   // Unencrypted: TransmissionStatusType floodingMesh.getEspnowMeshBackend().attemptTransmission(message, EspnowNetworkInfo(recipientMac));
   // Encrypted (slow): floodingMesh.getEspnowMeshBackend().attemptAutoEncryptingTransmission(message, EspnowNetworkInfo(recipientMac));
 
-  if (theOne)
-  {
-    if (millis() - timeOfLastProclamation > 10000)
-    {
+  if (theOne) {
+    if (millis() - timeOfLastProclamation > 10000) {
       uint32_t startTime = millis();
       ledState           = ledState ^ bool(benchmarkCount);  // Make other nodes' LEDs alternate between on and off once benchmarking begins.
 
@@ -205,8 +185,7 @@ void    loop()
       floodingMeshDelay(20);
     }
 
-    if (millis() - loopStart > 23000)
-    {  // Start benchmarking the mesh once three proclamations have been made
+    if (millis() - loopStart > 23000) {  // Start benchmarking the mesh once three proclamations have been made
       uint32_t startTime = millis();
       floodingMesh.broadcast(String(benchmarkCount++) + String(floodingMesh.metadataDelimiter()) + F(": Not a spoon in sight."));
       Serial.println(String(F("Benchmark broadcast done in ")) + String(millis() - startTime) + F(" ms."));
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino b/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
index bbfb7b74f0..8321b2a94c 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
@@ -6,7 +6,7 @@
 #include <TypeConversionFunctions.h>
 #include <assert.h>
 
-namespace TypeCast                                   = MeshTypeConversionFunctions;
+namespace TypeCast = MeshTypeConversionFunctions;
 
 /**
    NOTE: Although we could define the strings below as normal String variables,
@@ -19,18 +19,18 @@ namespace TypeCast                                   = MeshTypeConversionFunctio
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char         exampleMeshName[] PROGMEM     = "MeshNode_";
-constexpr char         exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
+constexpr char exampleMeshName[] PROGMEM     = "MeshNode_";
+constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
 
-unsigned int           requestNumber                 = 0;
-unsigned int           responseNumber                = 0;
+unsigned int requestNumber  = 0;
+unsigned int responseNumber = 0;
 
 String                 manageRequest(const String& request, MeshBackendBase& meshInstance);
 TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance);
 void                   networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance);
 
 /* Create the mesh node object */
-TcpIpMeshBackend       tcpIpNode = TcpIpMeshBackend(manageRequest, manageResponse, networkFilter, FPSTR(exampleWiFiPassword), FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
+TcpIpMeshBackend tcpIpNode = TcpIpMeshBackend(manageRequest, manageResponse, networkFilter, FPSTR(exampleWiFiPassword), FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
 
 /**
    Callback for when other nodes send you a request
@@ -39,21 +39,15 @@ TcpIpMeshBackend       tcpIpNode = TcpIpMeshBackend(manageRequest, manageRespons
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
 */
-String                 manageRequest(const String& request, MeshBackendBase& meshInstance)
-{
+String manageRequest(const String& request, MeshBackendBase& meshInstance) {
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance))
-  {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  }
-  else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance))
-  {
+  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
     (void)tcpIpInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
     Serial.print(F("TCP/IP: "));
-  }
-  else
-  {
+  } else {
     Serial.print(F("UNKNOWN!: "));
   }
 
@@ -75,18 +69,14 @@ String                 manageRequest(const String& request, MeshBackendBase& mes
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The status code resulting from the response, as an int
 */
-TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance)
-{
+TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance) {
   TransmissionStatusType statusCode = TransmissionStatusType::TRANSMISSION_COMPLETE;
 
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance))
-  {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  }
-  else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance))
-  {
+  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
     Serial.print(F("TCP/IP: "));
 
     // Getting the sent message like this will work as long as ONLY(!) TCP/IP is used.
@@ -95,9 +85,7 @@ TransmissionStatusType manageResponse(const String& response, MeshBackendBase& m
     // So for ESP-NOW, adding unique identifiers in the response and request is required to associate a response with a request.
     Serial.print(F("Request sent: "));
     Serial.println(tcpIpInstance->getCurrentMessage().substring(0, 100));
-  }
-  else
-  {
+  } else {
     Serial.print(F("UNKNOWN!: "));
   }
 
@@ -117,31 +105,22 @@ TransmissionStatusType manageResponse(const String& response, MeshBackendBase& m
    @param numberOfNetworks The number of networks found in the WiFi scan.
    @param meshInstance The MeshBackendBase instance that called the function.
 */
-void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance)
-{
+void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
   // Note that the network index of a given node may change whenever a new scan is done.
-  for (int networkIndex = 0; networkIndex < numberOfNetworks; ++networkIndex)
-  {
+  for (int networkIndex = 0; networkIndex < numberOfNetworks; ++networkIndex) {
     String currentSSID   = WiFi.SSID(networkIndex);
     int    meshNameIndex = currentSSID.indexOf(meshInstance.getMeshName());
 
     /* Connect to any _suitable_ APs which contain meshInstance.getMeshName() */
-    if (meshNameIndex >= 0)
-    {
+    if (meshNameIndex >= 0) {
       uint64_t targetNodeID = TypeCast::stringToUint64(currentSSID.substring(meshNameIndex + meshInstance.getMeshName().length()));
 
-      if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID()))
-      {
-        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance))
-        {
+      if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID())) {
+        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
           espnowInstance->connectionQueue().emplace_back(networkIndex);
-        }
-        else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance))
-        {
+        } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
           tcpIpInstance->connectionQueue().emplace_back(networkIndex);
-        }
-        else
-        {
+        } else {
           Serial.println(F("Invalid mesh backend!"));
         }
       }
@@ -160,29 +139,23 @@ void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance)
 
    @return True if attemptTransmission should continue with the next entry in the connectionQueue. False if attemptTransmission should stop.
 */
-bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance)
-{
+bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
   // The default hook only returns true and does nothing else.
 
-  if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance))
-  {
-    if (tcpIpInstance->latestTransmissionOutcomes().back().transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE)
-    {
+  if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+    if (tcpIpInstance->latestTransmissionOutcomes().back().transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE) {
       // Our last request got a response, so time to create a new request.
       meshInstance.setMessage(String(F("Hello world request #")) + String(++requestNumber) + F(" from ")
                               + meshInstance.getMeshName() + meshInstance.getNodeID() + String('.'));
     }
-  }
-  else
-  {
+  } else {
     Serial.println(F("Invalid mesh backend!"));
   }
 
   return true;
 }
 
-void setup()
-{
+void setup() {
   // Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
   // This will however delay node WiFi start-up by about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to connect to.
   WiFi.persistent(false);
@@ -212,54 +185,38 @@ void setup()
 }
 
 int32_t timeOfLastScan = -10000;
-void    loop()
-{
-  if (millis() - timeOfLastScan > 3000  // Give other nodes some time to connect between data transfers.
-      || (WiFi.status() != WL_CONNECTED && millis() - timeOfLastScan > 2000))
-  {  // Scan for networks with two second intervals when not already connected.
+void    loop() {
+  if (millis() - timeOfLastScan > 3000                                           // Give other nodes some time to connect between data transfers.
+      || (WiFi.status() != WL_CONNECTED && millis() - timeOfLastScan > 2000)) {  // Scan for networks with two second intervals when not already connected.
 
     // attemptTransmission(message, scan, scanAllWiFiChannels, concludingDisconnect, initialDisconnect = false)
     tcpIpNode.attemptTransmission(tcpIpNode.getMessage(), true, false, false);
     timeOfLastScan = millis();
 
     // One way to check how attemptTransmission worked out
-    if (tcpIpNode.latestTransmissionSuccessful())
-    {
+    if (tcpIpNode.latestTransmissionSuccessful()) {
       Serial.println(F("Transmission successful."));
     }
 
     // Another way to check how attemptTransmission worked out
-    if (tcpIpNode.latestTransmissionOutcomes().empty())
-    {
+    if (tcpIpNode.latestTransmissionOutcomes().empty()) {
       Serial.println(F("No mesh AP found."));
-    }
-    else
-    {
-      for (TransmissionOutcome& transmissionOutcome : tcpIpNode.latestTransmissionOutcomes())
-      {
-        if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED)
-        {
+    } else {
+      for (TransmissionOutcome& transmissionOutcome : tcpIpNode.latestTransmissionOutcomes()) {
+        if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED) {
           Serial.println(String(F("Transmission failed to mesh AP ")) + transmissionOutcome.SSID());
-        }
-        else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED)
-        {
+        } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED) {
           Serial.println(String(F("Connection failed to mesh AP ")) + transmissionOutcome.SSID());
-        }
-        else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE)
-        {
+        } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE) {
           // No need to do anything, transmission was successful.
-        }
-        else
-        {
+        } else {
           Serial.println(String(F("Invalid transmission status for ")) + transmissionOutcome.SSID() + String('!'));
           assert(F("Invalid transmission status returned from responseHandler!") && false);
         }
       }
     }
     Serial.println();
-  }
-  else
-  {
+  } else {
     /* Accept any incoming connections */
     tcpIpNode.acceptRequests();
   }
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino b/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
index 0ca32a1e79..419330d227 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
@@ -20,8 +20,7 @@
 
 ESP8266WiFiMulti WiFiMulti;
 
-void             setup()
-{
+void setup() {
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -29,8 +28,7 @@ void             setup()
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--)
-  {
+  for (uint8_t t = 4; t > 0; t--) {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -40,31 +38,25 @@ void             setup()
   WiFiMulti.addAP(APSSID, APPSK);
 }
 
-void update_started()
-{
+void update_started() {
   Serial.println("CALLBACK:  HTTP update process started");
 }
 
-void update_finished()
-{
+void update_finished() {
   Serial.println("CALLBACK:  HTTP update process finished");
 }
 
-void update_progress(int cur, int total)
-{
+void update_progress(int cur, int total) {
   Serial.printf("CALLBACK:  HTTP update process at %d of %d bytes...\n", cur, total);
 }
 
-void update_error(int err)
-{
+void update_error(int err) {
   Serial.printf("CALLBACK:  HTTP update fatal error code %d\n", err);
 }
 
-void loop()
-{
+void loop() {
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED))
-  {
+  if ((WiFiMulti.run() == WL_CONNECTED)) {
     WiFiClient client;
 
     // The line below is optional. It can be used to blink the LED on the board during flashing
@@ -85,8 +77,7 @@ void loop()
     // Or:
     //t_httpUpdate_return ret = ESPhttpUpdate.update(client, "server", 80, "file.bin");
 
-    switch (ret)
-    {
+    switch (ret) {
       case HTTP_UPDATE_FAILED:
         Serial.printf("HTTP_UPDATE_FAILD Error (%d): %s\n", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
         break;
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
index 99ee75d5fc..784eea2828 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
@@ -20,8 +20,7 @@ ESP8266WiFiMulti WiFiMulti;
 #define APPSK "APPSK"
 #endif
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -29,8 +28,7 @@ void setup()
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--)
-  {
+  for (uint8_t t = 4; t > 0; t--) {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -40,11 +38,9 @@ void setup()
   WiFiMulti.addAP(APSSID, APPSK);
 }
 
-void loop()
-{
+void loop() {
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED))
-  {
+  if ((WiFiMulti.run() == WL_CONNECTED)) {
     Serial.println("Update LittleFS...");
 
     WiFiClient client;
@@ -58,13 +54,11 @@ void loop()
     ESPhttpUpdate.setLedPin(LED_BUILTIN, LOW);
 
     t_httpUpdate_return ret = ESPhttpUpdate.updateFS(client, "http://server/spiffs.bin");
-    if (ret == HTTP_UPDATE_OK)
-    {
+    if (ret == HTTP_UPDATE_OK) {
       Serial.println("Update sketch...");
       ret = ESPhttpUpdate.update(client, "http://server/file.bin");
 
-      switch (ret)
-      {
+      switch (ret) {
         case HTTP_UPDATE_FAILED:
           Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
           break;
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
index 696fd9de2b..928d360716 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
@@ -30,14 +30,12 @@ ESP8266WiFiMulti WiFiMulti;
 BearSSL::CertStore certStore;
 
 // Set time via NTP, as required for x.509 validation
-void               setClock()
-{
+void setClock() {
   configTime(0, 0, "pool.ntp.org", "time.nist.gov");  // UTC
 
   Serial.print(F("Waiting for NTP time sync: "));
   time_t now = time(nullptr);
-  while (now < 8 * 3600 * 2)
-  {
+  while (now < 8 * 3600 * 2) {
     yield();
     delay(500);
     Serial.print(F("."));
@@ -51,8 +49,7 @@ void               setClock()
   Serial.print(asctime(&timeinfo));
 }
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -60,8 +57,7 @@ void setup()
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--)
-  {
+  for (uint8_t t = 4; t > 0; t--) {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -75,25 +71,21 @@ void setup()
   int numCerts = certStore.initCertStore(LittleFS, PSTR("/certs.idx"), PSTR("/certs.ar"));
   Serial.print(F("Number of CA certs read: "));
   Serial.println(numCerts);
-  if (numCerts == 0)
-  {
+  if (numCerts == 0) {
     Serial.println(F("No certs found. Did you run certs-from-mozill.py and upload the LittleFS directory before running?"));
     return;  // Can't connect to anything w/o certs!
   }
 }
 
-void loop()
-{
+void loop() {
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED))
-  {
+  if ((WiFiMulti.run() == WL_CONNECTED)) {
     setClock();
 
     BearSSL::WiFiClientSecure client;
     bool                      mfln = client.probeMaxFragmentLength("server", 443, 1024);  // server must be the same as in ESPhttpUpdate.update()
     Serial.printf("MFLN supported: %s\n", mfln ? "yes" : "no");
-    if (mfln)
-    {
+    if (mfln) {
       client.setBufferSizes(1024, 1024);
     }
     client.setCertStore(&certStore);
@@ -110,8 +102,7 @@ void loop()
     // Or:
     //t_httpUpdate_return ret = ESPhttpUpdate.update(client, "server", 443, "file.bin");
 
-    switch (ret)
-    {
+    switch (ret) {
       case HTTP_UPDATE_FAILED:
         Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s\n", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
         break;
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
index e0e999ef58..9b4adcfb5c 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
@@ -55,8 +55,7 @@ BearSSL::HashSHA256*      hash;
 BearSSL::SigningVerifier* sign;
 #endif
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -64,8 +63,7 @@ void setup()
   Serial.println();
   Serial.println();
 
-  for (uint8_t t = 4; t > 0; t--)
-  {
+  for (uint8_t t = 4; t > 0; t--) {
     Serial.printf("[SETUP] WAIT %d...\n", t);
     Serial.flush();
     delay(1000);
@@ -81,11 +79,9 @@ void setup()
 #endif
 }
 
-void loop()
-{
+void loop() {
   // wait for WiFi connection
-  if ((WiFiMulti.run() == WL_CONNECTED))
-  {
+  if ((WiFiMulti.run() == WL_CONNECTED)) {
     WiFiClient client;
 
 #if MANUAL_SIGNING
@@ -99,8 +95,7 @@ void loop()
 
     t_httpUpdate_return ret = ESPhttpUpdate.update(client, "http://192.168.1.8/esp8266.bin");
 
-    switch (ret)
-    {
+    switch (ret) {
       case HTTP_UPDATE_FAILED:
         Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s\n", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
         break;
diff --git a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
index 6473cb69d3..de76d53816 100644
--- a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
+++ b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
@@ -53,27 +53,25 @@
 #define STAPSK "your-password"
 #endif
 
-const char*                 ssid                 = STASSID;
-const char*                 password             = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 char*                       pcHostDomain         = 0;      // Negotiated host domain
 bool                        bHostDomainConfirmed = false;  // Flags the confirmation of the host domain
 MDNSResponder::hMDNSService hMDNSService         = 0;      // The handle of the clock service in the MDNS responder
 
 // HTTP server at port 'SERVICE_PORT' will respond to HTTP requests
-ESP8266WebServer            server(SERVICE_PORT);
+ESP8266WebServer server(SERVICE_PORT);
 
 /*
    getTimeString
 */
-const char*                 getTimeString(void)
-{
+const char* getTimeString(void) {
   static char acTimeString[32];
   time_t      now = time(nullptr);
   ctime_r(&now, acTimeString);
   size_t stLength;
-  while (((stLength = strlen(acTimeString))) && ('\n' == acTimeString[stLength - 1]))
-  {
+  while (((stLength = strlen(acTimeString))) && ('\n' == acTimeString[stLength - 1])) {
     acTimeString[stLength - 1] = 0;  // Remove trailing line break...
   }
   return acTimeString;
@@ -84,14 +82,12 @@ const char*                 getTimeString(void)
 
    Set time via NTP
 */
-void setClock(void)
-{
+void setClock(void) {
   configTime((TIMEZONE_OFFSET * 3600), (DST_OFFSET * 3600), "pool.ntp.org", "time.nist.gov", "time.windows.com");
 
   Serial.print("Waiting for NTP time sync: ");
-  time_t now = time(nullptr);  // Secs since 01.01.1970 (when uninitialized starts with (8 * 3600 = 28800)
-  while (now < 8 * 3600 * 2)
-  {  // Wait for realistic value
+  time_t now = time(nullptr);   // Secs since 01.01.1970 (when uninitialized starts with (8 * 3600 = 28800)
+  while (now < 8 * 3600 * 2) {  // Wait for realistic value
     delay(500);
     Serial.print(".");
     now = time(nullptr);
@@ -103,10 +99,8 @@ void setClock(void)
 /*
    setStationHostname
 */
-bool setStationHostname(const char* p_pcHostname)
-{
-  if (p_pcHostname)
-  {
+bool setStationHostname(const char* p_pcHostname) {
+  if (p_pcHostname) {
     WiFi.hostname(p_pcHostname);
     Serial.printf("setDeviceHostname: Station hostname is set to '%s'\n", p_pcHostname);
   }
@@ -122,12 +116,10 @@ bool setStationHostname(const char* p_pcHostname)
    This can be triggered by calling MDNS.announce().
 
 */
-void MDNSDynamicServiceTxtCallback(const MDNSResponder::hMDNSService p_hService)
-{
+void MDNSDynamicServiceTxtCallback(const MDNSResponder::hMDNSService p_hService) {
   Serial.println("MDNSDynamicServiceTxtCallback");
 
-  if (hMDNSService == p_hService)
-  {
+  if (hMDNSService == p_hService) {
     Serial.printf("Updating curtime TXT item to: %s\n", getTimeString());
     MDNS.addDynamicServiceTxt(p_hService, "curtime", getTimeString());
   }
@@ -143,26 +135,21 @@ void MDNSDynamicServiceTxtCallback(const MDNSResponder::hMDNSService p_hService)
    restarted via p_pMDNSResponder->setHostname().
 
 */
-void hostProbeResult(String p_pcDomainName, bool p_bProbeResult)
-{
+void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
   Serial.println("MDNSProbeResultCallback");
   Serial.printf("MDNSProbeResultCallback: Host domain '%s.local' is %s\n", p_pcDomainName.c_str(), (p_bProbeResult ? "free" : "already USED!"));
-  if (true == p_bProbeResult)
-  {
+  if (true == p_bProbeResult) {
     // Set station hostname
     setStationHostname(pcHostDomain);
 
-    if (!bHostDomainConfirmed)
-    {
+    if (!bHostDomainConfirmed) {
       // Hostname free -> setup clock service
       bHostDomainConfirmed = true;
 
-      if (!hMDNSService)
-      {
+      if (!hMDNSService) {
         // Add a 'clock.tcp' service to port 'SERVICE_PORT', using the host domain as instance domain
         hMDNSService = MDNS.addService(0, "espclk", "tcp", SERVICE_PORT);
-        if (hMDNSService)
-        {
+        if (hMDNSService) {
           // Add a simple static MDNS service TXT item
           MDNS.addServiceTxt(hMDNSService, "port#", SERVICE_PORT);
           // Set the callback function for dynamic service TXTs
@@ -170,16 +157,11 @@ void hostProbeResult(String p_pcDomainName, bool p_bProbeResult)
         }
       }
     }
-  }
-  else
-  {
+  } else {
     // Change hostname, use '-' as divider between base name and index
-    if (MDNSResponder::indexDomain(pcHostDomain, "-", 0))
-    {
+    if (MDNSResponder::indexDomain(pcHostDomain, "-", 0)) {
       MDNS.setHostname(pcHostDomain);
-    }
-    else
-    {
+    } else {
       Serial.println("MDNSProbeResultCallback: FAILED to update hostname!");
     }
   }
@@ -189,8 +171,7 @@ void hostProbeResult(String p_pcDomainName, bool p_bProbeResult)
    handleHTTPClient
 */
 
-void handleHTTPRequest()
-{
+void handleHTTPRequest() {
   Serial.println("");
   Serial.println("HTTP Request");
 
@@ -216,8 +197,7 @@ void handleHTTPRequest()
 /*
    setup
 */
-void setup(void)
-{
+void setup(void) {
   Serial.begin(115200);
 
   // Connect to WiFi network
@@ -226,8 +206,7 @@ void setup(void)
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -243,11 +222,9 @@ void setup(void)
   // Setup MDNS responder
   MDNS.setHostProbeResultCallback(hostProbeResult);
   // Init the (currently empty) host domain string with 'esp8266'
-  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) || (!MDNS.begin(pcHostDomain)))
-  {
+  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) || (!MDNS.begin(pcHostDomain))) {
     Serial.println("Error setting up MDNS responder!");
-    while (1)
-    {  // STOP
+    while (1) {  // STOP
       delay(1000);
     }
   }
@@ -262,18 +239,15 @@ void setup(void)
 /*
    loop
 */
-void loop(void)
-{
+void loop(void) {
   // Check if a request has come in
   server.handleClient();
   // Allow MDNS processing
   MDNS.update();
 
   static esp8266::polledTimeout::periodicMs timeout(UPDATE_CYCLE);
-  if (timeout.expired())
-  {
-    if (hMDNSService)
-    {
+  if (timeout.expired()) {
+    if (hMDNSService) {
       // Just trigger a new MDNS announcement, this will lead to a call to
       // 'MDNSDynamicServiceTxtCallback', which will update the time TXT item
       MDNS.announce();
diff --git a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
index 1eb8ddbf6a..0da915d45d 100644
--- a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
+++ b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
@@ -45,27 +45,25 @@
 #define STAPSK "your-password"
 #endif
 
-const char*                      ssid                 = STASSID;
-const char*                      password             = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 char*                            pcHostDomain         = 0;      // Negotiated host domain
 bool                             bHostDomainConfirmed = false;  // Flags the confirmation of the host domain
 MDNSResponder::hMDNSService      hMDNSService         = 0;      // The handle of the http service in the MDNS responder
 MDNSResponder::hMDNSServiceQuery hMDNSServiceQuery    = 0;      // The handle of the 'http.tcp' service query in the MDNS responder
 
-const String                     cstrNoHTTPServices   = "Currently no 'http.tcp' services in the local network!<br/>";
-String                           strHTTPServices      = cstrNoHTTPServices;
+const String cstrNoHTTPServices = "Currently no 'http.tcp' services in the local network!<br/>";
+String       strHTTPServices    = cstrNoHTTPServices;
 
 // HTTP server at port 'SERVICE_PORT' will respond to HTTP requests
-ESP8266WebServer                 server(SERVICE_PORT);
+ESP8266WebServer server(SERVICE_PORT);
 
 /*
    setStationHostname
 */
-bool                             setStationHostname(const char* p_pcHostname)
-{
-  if (p_pcHostname)
-  {
+bool setStationHostname(const char* p_pcHostname) {
+  if (p_pcHostname) {
     WiFi.hostname(p_pcHostname);
     Serial.printf("setStationHostname: Station hostname is set to '%s'\n", p_pcHostname);
     return true;
@@ -76,11 +74,9 @@ bool                             setStationHostname(const char* p_pcHostname)
    MDNSServiceQueryCallback
 */
 
-void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSResponder::AnswerType answerType, bool p_bSetContent)
-{
+void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSResponder::AnswerType answerType, bool p_bSetContent) {
   String answerInfo;
-  switch (answerType)
-  {
+  switch (answerType) {
     case MDNSResponder::AnswerType::ServiceDomain:
       answerInfo = "ServiceDomain " + String(serviceInfo.serviceDomain());
       break;
@@ -89,15 +85,13 @@ void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSRe
       break;
     case MDNSResponder::AnswerType::IP4Address:
       answerInfo = "IP4Address ";
-      for (IPAddress ip : serviceInfo.IP4Adresses())
-      {
+      for (IPAddress ip : serviceInfo.IP4Adresses()) {
         answerInfo += "- " + ip.toString();
       };
       break;
     case MDNSResponder::AnswerType::Txt:
       answerInfo = "TXT " + String(serviceInfo.strKeyValue());
-      for (auto kv : serviceInfo.keyValues())
-      {
+      for (auto kv : serviceInfo.keyValues()) {
         answerInfo += "\nkv : " + String(kv.first) + " : " + String(kv.second);
       }
       break;
@@ -114,8 +108,7 @@ void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSRe
 
 void serviceProbeResult(String                            p_pcServiceName,
                         const MDNSResponder::hMDNSService p_hMDNSService,
-                        bool                              p_bProbeResult)
-{
+                        bool                              p_bProbeResult) {
   (void)p_hMDNSService;
   Serial.printf("MDNSServiceProbeResultCallback: Service %s probe %s\n", p_pcServiceName.c_str(), (p_bProbeResult ? "succeeded." : "failed!"));
 }
@@ -131,26 +124,21 @@ void serviceProbeResult(String                            p_pcServiceName,
 
 */
 
-void hostProbeResult(String p_pcDomainName, bool p_bProbeResult)
-{
+void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
   Serial.printf("MDNSHostProbeResultCallback: Host domain '%s.local' is %s\n", p_pcDomainName.c_str(), (p_bProbeResult ? "free" : "already USED!"));
 
-  if (true == p_bProbeResult)
-  {
+  if (true == p_bProbeResult) {
     // Set station hostname
     setStationHostname(pcHostDomain);
 
-    if (!bHostDomainConfirmed)
-    {
+    if (!bHostDomainConfirmed) {
       // Hostname free -> setup clock service
       bHostDomainConfirmed = true;
 
-      if (!hMDNSService)
-      {
+      if (!hMDNSService) {
         // Add a 'http.tcp' service to port 'SERVICE_PORT', using the host domain as instance domain
         hMDNSService = MDNS.addService(0, "http", "tcp", SERVICE_PORT);
-        if (hMDNSService)
-        {
+        if (hMDNSService) {
           MDNS.setServiceProbeResultCallback(hMDNSService, serviceProbeResult);
 
           // Add some '_http._tcp' protocol specific MDNS service TXT items
@@ -161,30 +149,21 @@ void hostProbeResult(String p_pcDomainName, bool p_bProbeResult)
         }
 
         // Install dynamic 'http.tcp' service query
-        if (!hMDNSServiceQuery)
-        {
+        if (!hMDNSServiceQuery) {
           hMDNSServiceQuery = MDNS.installServiceQuery("http", "tcp", MDNSServiceQueryCallback);
-          if (hMDNSServiceQuery)
-          {
+          if (hMDNSServiceQuery) {
             Serial.printf("MDNSProbeResultCallback: Service query for 'http.tcp' services installed.\n");
-          }
-          else
-          {
+          } else {
             Serial.printf("MDNSProbeResultCallback: FAILED to install service query for 'http.tcp' services!\n");
           }
         }
       }
     }
-  }
-  else
-  {
+  } else {
     // Change hostname, use '-' as divider between base name and index
-    if (MDNSResponder::indexDomain(pcHostDomain, "-", 0))
-    {
+    if (MDNSResponder::indexDomain(pcHostDomain, "-", 0)) {
       MDNS.setHostname(pcHostDomain);
-    }
-    else
-    {
+    } else {
       Serial.println("MDNSProbeResultCallback: FAILED to update hostname!");
     }
   }
@@ -193,8 +172,7 @@ void hostProbeResult(String p_pcDomainName, bool p_bProbeResult)
 /*
    HTTP request function (not found is handled by server)
 */
-void handleHTTPRequest()
-{
+void handleHTTPRequest() {
   Serial.println("");
   Serial.println("HTTP Request");
 
@@ -204,29 +182,23 @@ void handleHTTPRequest()
   s += WiFi.hostname() + ".local at " + WiFi.localIP().toString() + "</h3></head>";
   s += "<br/><h4>Local HTTP services are :</h4>";
   s += "<ol>";
-  for (auto info : MDNS.answerInfo(hMDNSServiceQuery))
-  {
+  for (auto info : MDNS.answerInfo(hMDNSServiceQuery)) {
     s += "<li>";
     s += info.serviceDomain();
-    if (info.hostDomainAvailable())
-    {
+    if (info.hostDomainAvailable()) {
       s += "<br/>Hostname: ";
       s += String(info.hostDomain());
       s += (info.hostPortAvailable()) ? (":" + String(info.hostPort())) : "";
     }
-    if (info.IP4AddressAvailable())
-    {
+    if (info.IP4AddressAvailable()) {
       s += "<br/>IP4:";
-      for (auto ip : info.IP4Adresses())
-      {
+      for (auto ip : info.IP4Adresses()) {
         s += " " + ip.toString();
       }
     }
-    if (info.txtAvailable())
-    {
+    if (info.txtAvailable()) {
       s += "<br/>TXT:<br/>";
-      for (auto kv : info.keyValues())
-      {
+      for (auto kv : info.keyValues()) {
         s += "\t" + String(kv.first) + " : " + String(kv.second) + "<br/>";
       }
     }
@@ -242,8 +214,7 @@ void handleHTTPRequest()
 /*
    setup
 */
-void setup(void)
-{
+void setup(void) {
   Serial.begin(115200);
   Serial.setDebugOutput(false);
 
@@ -253,8 +224,7 @@ void setup(void)
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -271,11 +241,9 @@ void setup(void)
   MDNS.setHostProbeResultCallback(hostProbeResult);
 
   // Init the (currently empty) host domain string with 'esp8266'
-  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) || (!MDNS.begin(pcHostDomain)))
-  {
+  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) || (!MDNS.begin(pcHostDomain))) {
     Serial.println(" Error setting up MDNS responder!");
-    while (1)
-    {  // STOP
+    while (1) {  // STOP
       delay(1000);
     }
   }
@@ -286,8 +254,7 @@ void setup(void)
   Serial.println("HTTP server started");
 }
 
-void loop(void)
-{
+void loop(void) {
   // Check if a request has come in
   server.handleClient();
   // Allow MDNS processing
diff --git a/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino b/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
index 67de198769..290fef2938 100644
--- a/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
+++ b/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
@@ -58,12 +58,10 @@ const char* ap_default_psk  = APPSK;   ///< Default PSK.
    and the WiFi PSK in the second line.
    Line separator can be \r\n (CR LF) \r or \n.
 */
-bool        loadConfig(String* ssid, String* pass)
-{
+bool loadConfig(String* ssid, String* pass) {
   // open file for reading.
   File configFile = LittleFS.open("/cl_conf.txt", "r");
-  if (!configFile)
-  {
+  if (!configFile) {
     Serial.println("Failed to open cl_conf.txt.");
 
     return false;
@@ -79,19 +77,16 @@ bool        loadConfig(String* ssid, String* pass)
   int8_t  pos = content.indexOf("\r\n");
   uint8_t le  = 2;
   // check for linux and mac line ending.
-  if (pos == -1)
-  {
+  if (pos == -1) {
     le  = 1;
     pos = content.indexOf("\n");
-    if (pos == -1)
-    {
+    if (pos == -1) {
       pos = content.indexOf("\r");
     }
   }
 
   // If there is no second line: Some information is missing.
-  if (pos == -1)
-  {
+  if (pos == -1) {
     Serial.println("Infvalid content.");
     Serial.println(content);
 
@@ -122,12 +117,10 @@ bool        loadConfig(String* ssid, String* pass)
    @param pass PSK as string pointer,
    @return True or False.
 */
-bool saveConfig(String* ssid, String* pass)
-{
+bool saveConfig(String* ssid, String* pass) {
   // Open config file for writing.
   File configFile = LittleFS.open("/cl_conf.txt", "w");
-  if (!configFile)
-  {
+  if (!configFile) {
     Serial.println("Failed to open cl_conf.txt for writing");
 
     return false;
@@ -145,8 +138,7 @@ bool saveConfig(String* ssid, String* pass)
 /**
    @brief Arduino setup function.
 */
-void setup()
-{
+void setup() {
   String station_ssid = "";
   String station_psk  = "";
 
@@ -168,15 +160,13 @@ void setup()
   //Serial.println(WiFi.hostname());
 
   // Initialize file system.
-  if (!LittleFS.begin())
-  {
+  if (!LittleFS.begin()) {
     Serial.println("Failed to mount file system");
     return;
   }
 
   // Load wifi connection information.
-  if (!loadConfig(&station_ssid, &station_psk))
-  {
+  if (!loadConfig(&station_ssid, &station_psk)) {
     station_ssid = STASSID;
     station_psk  = STAPSK;
 
@@ -185,15 +175,13 @@ void setup()
 
   // Check WiFi connection
   // ... check mode
-  if (WiFi.getMode() != WIFI_STA)
-  {
+  if (WiFi.getMode() != WIFI_STA) {
     WiFi.mode(WIFI_STA);
     delay(10);
   }
 
   // ... Compare file config with sdk config.
-  if (WiFi.SSID() != station_ssid || WiFi.psk() != station_psk)
-  {
+  if (WiFi.SSID() != station_ssid || WiFi.psk() != station_psk) {
     Serial.println("WiFi config changed.");
 
     // ... Try to connect to WiFi station.
@@ -205,9 +193,7 @@ void setup()
 
     // ... Uncomment this for debugging output.
     //WiFi.printDiag(Serial);
-  }
-  else
-  {
+  } else {
     // ... Begin with sdk config.
     WiFi.begin();
   }
@@ -216,8 +202,7 @@ void setup()
 
   // ... Give ESP 10 seconds to connect to station.
   unsigned long startTime = millis();
-  while (WiFi.status() != WL_CONNECTED && millis() - startTime < 10000)
-  {
+  while (WiFi.status() != WL_CONNECTED && millis() - startTime < 10000) {
     Serial.write('.');
     //Serial.print(WiFi.status());
     delay(500);
@@ -225,14 +210,11 @@ void setup()
   Serial.println();
 
   // Check connection
-  if (WiFi.status() == WL_CONNECTED)
-  {
+  if (WiFi.status() == WL_CONNECTED) {
     // ... print IP Address
     Serial.print("IP address: ");
     Serial.println(WiFi.localIP());
-  }
-  else
-  {
+  } else {
     Serial.println("Can not connect to WiFi station. Go into AP mode.");
 
     // Go into software AP mode.
@@ -254,8 +236,7 @@ void setup()
 /**
    @brief Arduino loop function.
 */
-void loop()
-{
+void loop() {
   // Handle OTA server.
   ArduinoOTA.handle();
 }
diff --git a/libraries/ESP8266mDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino b/libraries/ESP8266mDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino
index 4ba4a713e6..d07595db18 100644
--- a/libraries/ESP8266mDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino
+++ b/libraries/ESP8266mDNS/examples/mDNS-SD_Extended/mDNS-SD_Extended.ino
@@ -21,8 +21,7 @@ const char* ssid           = STASSID;
 const char* password       = STAPSK;
 char        hostString[16] = { 0 };
 
-void        setup()
-{
+void setup() {
   Serial.begin(115200);
   delay(100);
   Serial.println("\r\nsetup()");
@@ -34,8 +33,7 @@ void        setup()
 
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(250);
     Serial.print(".");
   }
@@ -45,8 +43,7 @@ void        setup()
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-  if (!MDNS.begin(hostString))
-  {
+  if (!MDNS.begin(hostString)) {
     Serial.println("Error setting up MDNS responder!");
   }
   Serial.println("mDNS responder started");
@@ -55,16 +52,12 @@ void        setup()
   Serial.println("Sending mDNS query");
   int n = MDNS.queryService("esp", "tcp");  // Send out query for esp tcp services
   Serial.println("mDNS query done");
-  if (n == 0)
-  {
+  if (n == 0) {
     Serial.println("no services found");
-  }
-  else
-  {
+  } else {
     Serial.print(n);
     Serial.println(" service(s) found");
-    for (int i = 0; i < n; ++i)
-    {
+    for (int i = 0; i < n; ++i) {
       // Print details for each service found
       Serial.print(i + 1);
       Serial.print(": ");
@@ -81,8 +74,7 @@ void        setup()
   Serial.println("loop() next");
 }
 
-void loop()
-{
+void loop() {
   // put your main code here, to run repeatedly:
   MDNS.update();
 }
diff --git a/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino b/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
index 0fa0e52327..ea3cbbd699 100644
--- a/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
+++ b/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
@@ -28,10 +28,9 @@ const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 // TCP server at port 80 will respond to HTTP requests
-WiFiServer  server(80);
+WiFiServer server(80);
 
-void        setup(void)
-{
+void setup(void) {
   Serial.begin(115200);
 
   // Connect to WiFi network
@@ -40,8 +39,7 @@ void        setup(void)
   Serial.println("");
 
   // Wait for connection
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -56,11 +54,9 @@ void        setup(void)
   //   the fully-qualified domain name is "esp8266.local"
   // - second argument is the IP address to advertise
   //   we send our IP address on the WiFi network
-  if (!MDNS.begin("esp8266"))
-  {
+  if (!MDNS.begin("esp8266")) {
     Serial.println("Error setting up MDNS responder!");
-    while (1)
-    {
+    while (1) {
       delay(1000);
     }
   }
@@ -74,34 +70,30 @@ void        setup(void)
   MDNS.addService("http", "tcp", 80);
 }
 
-void loop(void)
-{
+void loop(void) {
   MDNS.update();
 
   // Check if a client has connected
   WiFiClient client = server.accept();
-  if (!client)
-  {
+  if (!client) {
     return;
   }
   Serial.println("");
   Serial.println("New client");
 
   // Wait for data from client to become available
-  while (client.connected() && !client.available())
-  {
+  while (client.connected() && !client.available()) {
     delay(1);
   }
 
   // Read the first line of HTTP request
-  String req        = client.readStringUntil('\r');
+  String req = client.readStringUntil('\r');
 
   // First line of HTTP request looks like "GET /path HTTP/1.1"
   // Retrieve the "/path" part by finding the spaces
-  int    addr_start = req.indexOf(' ');
-  int    addr_end   = req.indexOf(' ', addr_start + 1);
-  if (addr_start == -1 || addr_end == -1)
-  {
+  int addr_start = req.indexOf(' ');
+  int addr_end   = req.indexOf(' ', addr_start + 1);
+  if (addr_start == -1 || addr_end == -1) {
     Serial.print("Invalid request: ");
     Serial.println(req);
     return;
@@ -112,17 +104,14 @@ void loop(void)
   client.flush();
 
   String s;
-  if (req == "/")
-  {
+  if (req == "/") {
     IPAddress ip    = WiFi.localIP();
     String    ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);
     s               = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>Hello from ESP8266 at ";
     s += ipStr;
     s += "</html>\r\n\r\n";
     Serial.println("Sending 200");
-  }
-  else
-  {
+  } else {
     s = "HTTP/1.1 404 Not Found\r\n\r\n";
     Serial.println("Sending 404");
   }
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.cpp b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
index b2d7d25e5a..56e0568edc 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
@@ -168,7 +168,7 @@ namespace MDNSImplementation
             m_HostProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
 
             // Replace 'auto-set' service names
-            bResult                                = true;
+            bResult = true;
             for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
             {
                 if (pService->m_bAutoName)
@@ -408,7 +408,7 @@ namespace MDNSImplementation
     bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
                                          const MDNSResponder::hMDNSTxt     p_hTxt)
     {
-        bool            bResult  = false;
+        bool bResult = false;
 
         stcMDNSService* pService = _findService(p_hService);
         if (pService)
@@ -432,7 +432,7 @@ namespace MDNSImplementation
     bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
                                          const char*                       p_pcKey)
     {
-        bool            bResult  = false;
+        bool bResult = false;
 
         stcMDNSService* pService = _findService(p_hService);
         if (pService)
@@ -458,7 +458,7 @@ namespace MDNSImplementation
                                          const char* p_pcProtocol,
                                          const char* p_pcKey)
     {
-        bool            bResult  = false;
+        bool bResult = false;
 
         stcMDNSService* pService = _findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol);
         if (pService)
@@ -518,14 +518,14 @@ namespace MDNSImplementation
     bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::hMDNSService                      p_hService,
                                                      MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
     {
-        bool            bResult  = false;
+        bool bResult = false;
 
         stcMDNSService* pService = _findService(p_hService);
         if (pService)
         {
             pService->m_fnTxtCallback = p_fnCallback;
 
-            bResult                   = true;
+            bResult = true;
         }
         DEBUG_EX_ERR(if (!bResult)
                      {
@@ -543,7 +543,7 @@ namespace MDNSImplementation
     {
         //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt (%s=%s)\n"), p_pcKey, p_pcValue););
 
-        hMDNSTxt        hTxt     = 0;
+        hMDNSTxt hTxt = 0;
 
         stcMDNSService* pService = _findService(p_hService);
         if (pService)
@@ -667,7 +667,7 @@ namespace MDNSImplementation
 
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService '%s.%s'\n"), p_pcService, p_pcProtocol););
 
-        uint32_t             u32Result     = 0;
+        uint32_t u32Result = 0;
 
         stcMDNSServiceQuery* pServiceQuery = 0;
         if ((p_pcService) && (os_strlen(p_pcService)) && (p_pcProtocol) && (os_strlen(p_pcProtocol)) && (p_u16Timeout) && (_removeLegacyServiceQuery()) && ((pServiceQuery = _allocServiceQuery())) && (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
@@ -816,7 +816,7 @@ namespace MDNSImplementation
                                                                         const char*                                 p_pcProtocol,
                                                                         MDNSResponder::MDNSServiceQueryCallbackFunc p_fnCallback)
     {
-        hMDNSServiceQuery    hResult       = 0;
+        hMDNSServiceQuery hResult = 0;
 
         stcMDNSServiceQuery* pServiceQuery = 0;
         if ((p_pcService) && (os_strlen(p_pcService)) && (p_pcProtocol) && (os_strlen(p_pcProtocol)) && (p_fnCallback) && ((pServiceQuery = _allocServiceQuery())) && (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
@@ -1110,14 +1110,14 @@ namespace MDNSImplementation
     bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
                                                       MDNSResponder::MDNSServiceProbeFn p_fnCallback)
     {
-        bool            bResult  = false;
+        bool bResult = false;
 
         stcMDNSService* pService = _findService(p_hService);
         if (pService)
         {
             pService->m_ProbeInformation.m_fnServiceProbeResultCallback = p_fnCallback;
 
-            bResult                                                     = true;
+            bResult = true;
         }
         return bResult;
     }
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.h b/libraries/ESP8266mDNS/src/LEAmDNS.h
index b27c1302d0..cc353d6175 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.h
@@ -212,27 +212,27 @@ namespace MDNSImplementation
         // the current hostname is used. If the hostname is changed later, the instance names for
         // these 'auto-named' services are changed to the new name also (and probing is restarted).
         // The usual '_' before p_pcService (eg. http) and protocol (eg. tcp) may be given.
-        hMDNSService        addService(const char* p_pcName,
-                                       const char* p_pcService,
-                                       const char* p_pcProtocol,
-                                       uint16_t    p_u16Port);
+        hMDNSService addService(const char* p_pcName,
+                                const char* p_pcService,
+                                const char* p_pcProtocol,
+                                uint16_t    p_u16Port);
         // Removes a service from the MDNS responder
-        bool                removeService(const hMDNSService p_hService);
-        bool                removeService(const char* p_pcInstanceName,
-                                          const char* p_pcServiceName,
-                                          const char* p_pcProtocol);
+        bool removeService(const hMDNSService p_hService);
+        bool removeService(const char* p_pcInstanceName,
+                           const char* p_pcServiceName,
+                           const char* p_pcProtocol);
         // for compatibility...
-        bool                addService(const String& p_strServiceName,
-                                       const String& p_strProtocol,
-                                       uint16_t      p_u16Port);
+        bool addService(const String& p_strServiceName,
+                        const String& p_strProtocol,
+                        uint16_t      p_u16Port);
 
         // Change the services instance name (and restart probing).
-        bool                setServiceName(const hMDNSService p_hService,
-                                           const char*        p_pcInstanceName);
+        bool setServiceName(const hMDNSService p_hService,
+                            const char*        p_pcInstanceName);
         //for compatibility
         //Warning: this has the side effect of changing the hostname.
         //TODO: implement instancename different from hostname
-        void                setInstanceName(const char* p_pcHostname)
+        void setInstanceName(const char* p_pcHostname)
         {
             setHostname(p_pcHostname);
         }
@@ -245,49 +245,49 @@ namespace MDNSImplementation
         /**
         hMDNSTxt (opaque handle to access the TXT items)
     */
-        typedef void*                                              hMDNSTxt;
+        typedef void* hMDNSTxt;
 
         // Add a (static) MDNS TXT item ('key' = 'value') to the service
-        hMDNSTxt                                                   addServiceTxt(const hMDNSService p_hService,
-                                                                                 const char*        p_pcKey,
-                                                                                 const char*        p_pcValue);
-        hMDNSTxt                                                   addServiceTxt(const hMDNSService p_hService,
-                                                                                 const char*        p_pcKey,
-                                                                                 uint32_t           p_u32Value);
-        hMDNSTxt                                                   addServiceTxt(const hMDNSService p_hService,
-                                                                                 const char*        p_pcKey,
-                                                                                 uint16_t           p_u16Value);
-        hMDNSTxt                                                   addServiceTxt(const hMDNSService p_hService,
-                                                                                 const char*        p_pcKey,
-                                                                                 uint8_t            p_u8Value);
-        hMDNSTxt                                                   addServiceTxt(const hMDNSService p_hService,
-                                                                                 const char*        p_pcKey,
-                                                                                 int32_t            p_i32Value);
-        hMDNSTxt                                                   addServiceTxt(const hMDNSService p_hService,
-                                                                                 const char*        p_pcKey,
-                                                                                 int16_t            p_i16Value);
-        hMDNSTxt                                                   addServiceTxt(const hMDNSService p_hService,
-                                                                                 const char*        p_pcKey,
-                                                                                 int8_t             p_i8Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                               const char*        p_pcKey,
+                               const char*        p_pcValue);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                               const char*        p_pcKey,
+                               uint32_t           p_u32Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                               const char*        p_pcKey,
+                               uint16_t           p_u16Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                               const char*        p_pcKey,
+                               uint8_t            p_u8Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                               const char*        p_pcKey,
+                               int32_t            p_i32Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                               const char*        p_pcKey,
+                               int16_t            p_i16Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                               const char*        p_pcKey,
+                               int8_t             p_i8Value);
 
         // Remove an existing (static) MDNS TXT item from the service
-        bool                                                       removeServiceTxt(const hMDNSService p_hService,
-                                                                                    const hMDNSTxt     p_hTxt);
-        bool                                                       removeServiceTxt(const hMDNSService p_hService,
-                                                                                    const char*        p_pcKey);
-        bool                                                       removeServiceTxt(const char* p_pcinstanceName,
-                                                                                    const char* p_pcServiceName,
-                                                                                    const char* p_pcProtocol,
-                                                                                    const char* p_pcKey);
+        bool removeServiceTxt(const hMDNSService p_hService,
+                              const hMDNSTxt     p_hTxt);
+        bool removeServiceTxt(const hMDNSService p_hService,
+                              const char*        p_pcKey);
+        bool removeServiceTxt(const char* p_pcinstanceName,
+                              const char* p_pcServiceName,
+                              const char* p_pcProtocol,
+                              const char* p_pcKey);
         // for compatibility...
-        bool                                                       addServiceTxt(const char* p_pcService,
-                                                                                 const char* p_pcProtocol,
-                                                                                 const char* p_pcKey,
-                                                                                 const char* p_pcValue);
-        bool                                                       addServiceTxt(const String& p_strService,
-                                                                                 const String& p_strProtocol,
-                                                                                 const String& p_strKey,
-                                                                                 const String& p_strValue);
+        bool addServiceTxt(const char* p_pcService,
+                           const char* p_pcProtocol,
+                           const char* p_pcKey,
+                           const char* p_pcValue);
+        bool addServiceTxt(const String& p_strService,
+                           const String& p_strProtocol,
+                           const String& p_strKey,
+                           const String& p_strValue);
 
         /**
         MDNSDynamicServiceTxtCallbackFn
@@ -298,62 +298,62 @@ namespace MDNSImplementation
 
         // Set a global callback for dynamic MDNS TXT items. The callback function is called
         // every time, a TXT item is needed for one of the installed services.
-        bool                                                       setDynamicServiceTxtCallback(MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
+        bool setDynamicServiceTxtCallback(MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
         // Set a service specific callback for dynamic MDNS TXT items. The callback function
         // is called every time, a TXT item is needed for the given service.
-        bool                                                       setDynamicServiceTxtCallback(const hMDNSService                p_hService,
-                                                                                                MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
+        bool setDynamicServiceTxtCallback(const hMDNSService                p_hService,
+                                          MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
 
         // Add a (dynamic) MDNS TXT item ('key' = 'value') to the service
         // Dynamic TXT items are removed right after one-time use. So they need to be added
         // every time the value s needed (via callback).
-        hMDNSTxt                                                   addDynamicServiceTxt(hMDNSService p_hService,
-                                                                                        const char*  p_pcKey,
-                                                                                        const char*  p_pcValue);
-        hMDNSTxt                                                   addDynamicServiceTxt(hMDNSService p_hService,
-                                                                                        const char*  p_pcKey,
-                                                                                        uint32_t     p_u32Value);
-        hMDNSTxt                                                   addDynamicServiceTxt(hMDNSService p_hService,
-                                                                                        const char*  p_pcKey,
-                                                                                        uint16_t     p_u16Value);
-        hMDNSTxt                                                   addDynamicServiceTxt(hMDNSService p_hService,
-                                                                                        const char*  p_pcKey,
-                                                                                        uint8_t      p_u8Value);
-        hMDNSTxt                                                   addDynamicServiceTxt(hMDNSService p_hService,
-                                                                                        const char*  p_pcKey,
-                                                                                        int32_t      p_i32Value);
-        hMDNSTxt                                                   addDynamicServiceTxt(hMDNSService p_hService,
-                                                                                        const char*  p_pcKey,
-                                                                                        int16_t      p_i16Value);
-        hMDNSTxt                                                   addDynamicServiceTxt(hMDNSService p_hService,
-                                                                                        const char*  p_pcKey,
-                                                                                        int8_t       p_i8Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                      const char*  p_pcKey,
+                                      const char*  p_pcValue);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                      const char*  p_pcKey,
+                                      uint32_t     p_u32Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                      const char*  p_pcKey,
+                                      uint16_t     p_u16Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                      const char*  p_pcKey,
+                                      uint8_t      p_u8Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                      const char*  p_pcKey,
+                                      int32_t      p_i32Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                      const char*  p_pcKey,
+                                      int16_t      p_i16Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                      const char*  p_pcKey,
+                                      int8_t       p_i8Value);
 
         // Perform a (static) service query. The function returns after p_u16Timeout milliseconds
         // The answers (the number of received answers is returned) can be retrieved by calling
         // - answerHostname (or hostname)
         // - answerIP (or IP)
         // - answerPort (or port)
-        uint32_t                                                   queryService(const char*    p_pcService,
-                                                                                const char*    p_pcProtocol,
-                                                                                const uint16_t p_u16Timeout = MDNS_QUERYSERVICES_WAIT_TIME);
-        bool                                                       removeQuery(void);
+        uint32_t queryService(const char*    p_pcService,
+                              const char*    p_pcProtocol,
+                              const uint16_t p_u16Timeout = MDNS_QUERYSERVICES_WAIT_TIME);
+        bool     removeQuery(void);
         // for compatibility...
-        uint32_t                                                   queryService(const String& p_strService,
-                                                                                const String& p_strProtocol);
+        uint32_t queryService(const String& p_strService,
+                              const String& p_strProtocol);
 
-        const char*                                                answerHostname(const uint32_t p_u32AnswerIndex);
-        IPAddress                                                  answerIP(const uint32_t p_u32AnswerIndex);
-        uint16_t                                                   answerPort(const uint32_t p_u32AnswerIndex);
+        const char* answerHostname(const uint32_t p_u32AnswerIndex);
+        IPAddress   answerIP(const uint32_t p_u32AnswerIndex);
+        uint16_t    answerPort(const uint32_t p_u32AnswerIndex);
         // for compatibility...
-        String                                                     hostname(const uint32_t p_u32AnswerIndex);
-        IPAddress                                                  IP(const uint32_t p_u32AnswerIndex);
-        uint16_t                                                   port(const uint32_t p_u32AnswerIndex);
+        String    hostname(const uint32_t p_u32AnswerIndex);
+        IPAddress IP(const uint32_t p_u32AnswerIndex);
+        uint16_t  port(const uint32_t p_u32AnswerIndex);
 
         /**
         hMDNSServiceQuery (opaque handle to access dynamic service queries)
     */
-        typedef const void*                                        hMDNSServiceQuery;
+        typedef const void* hMDNSServiceQuery;
 
         /**
         enuServiceQueryAnswerType
@@ -394,7 +394,7 @@ namespace MDNSImplementation
                                    AnswerType             answerType,    // flag for the updated answer item
                                    bool                   p_bSetContent  // true: Answer component set, false: component deleted
                                    )>
-                                                    MDNSServiceQueryCallbackFunc;
+            MDNSServiceQueryCallbackFunc;
 
         // Install a dynamic service query. For every received answer (part) the given callback
         // function is called. The query will be updated every time, the TTL for an answer
@@ -407,21 +407,21 @@ namespace MDNSImplementation
         // - hasAnswerIP6Address/answerIP6Address
         // - hasAnswerPort/answerPort
         // - hasAnswerTxts/answerTxts
-        hMDNSServiceQuery                           installServiceQuery(const char*                  p_pcService,
-                                                                        const char*                  p_pcProtocol,
-                                                                        MDNSServiceQueryCallbackFunc p_fnCallback);
+        hMDNSServiceQuery installServiceQuery(const char*                  p_pcService,
+                                              const char*                  p_pcProtocol,
+                                              MDNSServiceQueryCallbackFunc p_fnCallback);
         // Remove a dynamic service query
-        bool                                        removeServiceQuery(hMDNSServiceQuery p_hServiceQuery);
+        bool removeServiceQuery(hMDNSServiceQuery p_hServiceQuery);
 
         uint32_t                                    answerCount(const hMDNSServiceQuery p_hServiceQuery);
         std::vector<MDNSResponder::MDNSServiceInfo> answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery);
 
-        const char*                                 answerServiceDomain(const hMDNSServiceQuery p_hServiceQuery,
-                                                                        const uint32_t          p_u32AnswerIndex);
-        bool                                        hasAnswerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
-                                                                        const uint32_t          p_u32AnswerIndex);
-        const char*                                 answerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
-                                                                     const uint32_t          p_u32AnswerIndex);
+        const char* answerServiceDomain(const hMDNSServiceQuery p_hServiceQuery,
+                                        const uint32_t          p_u32AnswerIndex);
+        bool        hasAnswerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
+                                        const uint32_t          p_u32AnswerIndex);
+        const char* answerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
+                                     const uint32_t          p_u32AnswerIndex);
 #ifdef MDNS_IP4_SUPPORT
         bool      hasAnswerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
                                       const uint32_t          p_u32AnswerIndex);
@@ -440,12 +440,12 @@ namespace MDNSImplementation
                                    const uint32_t          p_u32AnswerIndex,
                                    const uint32_t          p_u32AddressIndex);
 #endif
-        bool        hasAnswerPort(const hMDNSServiceQuery p_hServiceQuery,
-                                  const uint32_t          p_u32AnswerIndex);
-        uint16_t    answerPort(const hMDNSServiceQuery p_hServiceQuery,
+        bool     hasAnswerPort(const hMDNSServiceQuery p_hServiceQuery,
+                               const uint32_t          p_u32AnswerIndex);
+        uint16_t answerPort(const hMDNSServiceQuery p_hServiceQuery,
+                            const uint32_t          p_u32AnswerIndex);
+        bool     hasAnswerTxts(const hMDNSServiceQuery p_hServiceQuery,
                                const uint32_t          p_u32AnswerIndex);
-        bool        hasAnswerTxts(const hMDNSServiceQuery p_hServiceQuery,
-                                  const uint32_t          p_u32AnswerIndex);
         // Get the TXT items as a ';'-separated string
         const char* answerTxts(const hMDNSServiceQuery p_hServiceQuery,
                                const uint32_t          p_u32AnswerIndex);
@@ -472,40 +472,40 @@ namespace MDNSImplementation
                                    const char*        p_pcServiceName,
                                    const hMDNSService p_hMDNSService,
                                    bool               p_bProbeResult)>
-                     MDNSServiceProbeFn1;
+            MDNSServiceProbeFn1;
 
         // Set a global callback function for host and service probe results
         // The callback function is called, when the probing for the host domain
         // (or a service domain, which hasn't got a service specific callback)
         // Succeeds or fails.
         // In case of failure, the failed domain name should be changed.
-        bool         setHostProbeResultCallback(MDNSHostProbeFn p_fnCallback);
-        bool         setHostProbeResultCallback(MDNSHostProbeFn1 p_fnCallback);
+        bool setHostProbeResultCallback(MDNSHostProbeFn p_fnCallback);
+        bool setHostProbeResultCallback(MDNSHostProbeFn1 p_fnCallback);
 
         // Set a service specific probe result callback
-        bool         setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-                                                   MDNSServiceProbeFn                p_fnCallback);
-        bool         setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-                                                   MDNSServiceProbeFn1               p_fnCallback);
+        bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+                                           MDNSServiceProbeFn                p_fnCallback);
+        bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+                                           MDNSServiceProbeFn1               p_fnCallback);
 
         // Application should call this whenever AP is configured/disabled
-        bool         notifyAPChange(void);
+        bool notifyAPChange(void);
 
         // 'update' should be called in every 'loop' to run the MDNS processing
-        bool         update(void);
+        bool update(void);
 
         // 'announce' can be called every time, the configuration of some service
         // changes. Mainly, this would be changed content of TXT items.
-        bool         announce(void);
+        bool announce(void);
 
         // Enable OTA update
         hMDNSService enableArduino(uint16_t p_u16Port,
                                    bool     p_bAuthUpload = false);
 
         // Domain name helper
-        static bool  indexDomain(char*&      p_rpcDomain,
-                                 const char* p_pcDivider       = "-",
-                                 const char* p_pcDefaultDomain = 0);
+        static bool indexDomain(char*&      p_rpcDomain,
+                                const char* p_pcDivider       = "-",
+                                const char* p_pcDefaultDomain = 0);
 
         /** STRUCTS **/
 
@@ -627,25 +627,25 @@ namespace MDNSImplementation
             stcMDNSServiceTxt& operator=(const stcMDNSServiceTxt& p_Other);
             bool               clear(void);
 
-            char*              allocKey(size_t p_stLength);
-            bool               setKey(const char* p_pcKey,
-                                      size_t      p_stLength);
-            bool               setKey(const char* p_pcKey);
-            bool               releaseKey(void);
+            char* allocKey(size_t p_stLength);
+            bool  setKey(const char* p_pcKey,
+                         size_t      p_stLength);
+            bool  setKey(const char* p_pcKey);
+            bool  releaseKey(void);
 
-            char*              allocValue(size_t p_stLength);
-            bool               setValue(const char* p_pcValue,
-                                        size_t      p_stLength);
-            bool               setValue(const char* p_pcValue);
-            bool               releaseValue(void);
+            char* allocValue(size_t p_stLength);
+            bool  setValue(const char* p_pcValue,
+                           size_t      p_stLength);
+            bool  setValue(const char* p_pcValue);
+            bool  releaseValue(void);
 
-            bool               set(const char* p_pcKey,
-                                   const char* p_pcValue,
-                                   bool        p_bTemp = false);
+            bool set(const char* p_pcKey,
+                     const char* p_pcValue,
+                     bool        p_bTemp = false);
 
-            bool               update(const char* p_pcValue);
+            bool update(const char* p_pcValue);
 
-            size_t             length(void) const;
+            size_t length(void) const;
         };
 
         /**
@@ -659,30 +659,30 @@ namespace MDNSImplementation
             stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other);
             ~stcMDNSServiceTxts(void);
 
-            stcMDNSServiceTxts&      operator=(const stcMDNSServiceTxts& p_Other);
+            stcMDNSServiceTxts& operator=(const stcMDNSServiceTxts& p_Other);
 
-            bool                     clear(void);
+            bool clear(void);
 
-            bool                     add(stcMDNSServiceTxt* p_pTxt);
-            bool                     remove(stcMDNSServiceTxt* p_pTxt);
+            bool add(stcMDNSServiceTxt* p_pTxt);
+            bool remove(stcMDNSServiceTxt* p_pTxt);
 
-            bool                     removeTempTxts(void);
+            bool removeTempTxts(void);
 
             stcMDNSServiceTxt*       find(const char* p_pcKey);
             const stcMDNSServiceTxt* find(const char* p_pcKey) const;
             stcMDNSServiceTxt*       find(const stcMDNSServiceTxt* p_pTxt);
 
-            uint16_t                 length(void) const;
+            uint16_t length(void) const;
 
-            size_t                   c_strLength(void) const;
-            bool                     c_str(char* p_pcBuffer);
+            size_t c_strLength(void) const;
+            bool   c_str(char* p_pcBuffer);
 
-            size_t                   bufferLength(void) const;
-            bool                     buffer(char* p_pcBuffer);
+            size_t bufferLength(void) const;
+            bool   buffer(char* p_pcBuffer);
 
-            bool                     compare(const stcMDNSServiceTxts& p_Other) const;
-            bool                     operator==(const stcMDNSServiceTxts& p_Other) const;
-            bool                     operator!=(const stcMDNSServiceTxts& p_Other) const;
+            bool compare(const stcMDNSServiceTxts& p_Other) const;
+            bool operator==(const stcMDNSServiceTxts& p_Other) const;
+            bool operator!=(const stcMDNSServiceTxts& p_Other) const;
         };
 
         /**
@@ -691,10 +691,10 @@ namespace MDNSImplementation
         typedef enum _enuContentFlags
         {
             // Host
-            ContentFlag_A        = 0x01,
-            ContentFlag_PTR_IP4  = 0x02,
-            ContentFlag_PTR_IP6  = 0x04,
-            ContentFlag_AAAA     = 0x08,
+            ContentFlag_A       = 0x01,
+            ContentFlag_PTR_IP4 = 0x02,
+            ContentFlag_PTR_IP6 = 0x04,
+            ContentFlag_AAAA    = 0x08,
             // Service
             ContentFlag_PTR_TYPE = 0x10,
             ContentFlag_PTR_NAME = 0x20,
@@ -748,18 +748,18 @@ namespace MDNSImplementation
 
             stcMDNS_RRDomain& operator=(const stcMDNS_RRDomain& p_Other);
 
-            bool              clear(void);
+            bool clear(void);
 
-            bool              addLabel(const char* p_pcLabel,
-                                       bool        p_bPrependUnderline = false);
+            bool addLabel(const char* p_pcLabel,
+                          bool        p_bPrependUnderline = false);
 
-            bool              compare(const stcMDNS_RRDomain& p_Other) const;
-            bool              operator==(const stcMDNS_RRDomain& p_Other) const;
-            bool              operator!=(const stcMDNS_RRDomain& p_Other) const;
-            bool              operator>(const stcMDNS_RRDomain& p_Other) const;
+            bool compare(const stcMDNS_RRDomain& p_Other) const;
+            bool operator==(const stcMDNS_RRDomain& p_Other) const;
+            bool operator!=(const stcMDNS_RRDomain& p_Other) const;
+            bool operator>(const stcMDNS_RRDomain& p_Other) const;
 
-            size_t            c_strLength(void) const;
-            bool              c_str(char* p_pcBuffer);
+            size_t c_strLength(void) const;
+            bool   c_str(char* p_pcBuffer);
         };
 
         /**
@@ -790,7 +790,7 @@ namespace MDNSImplementation
 
             stcMDNS_RRHeader& operator=(const stcMDNS_RRHeader& p_Other);
 
-            bool              clear(void);
+            bool clear(void);
         };
 
         /**
@@ -833,7 +833,7 @@ namespace MDNSImplementation
 
             enuAnswerType answerType(void) const;
 
-            bool          clear(void);
+            bool clear(void);
 
         protected:
             stcMDNS_RRAnswer(enuAnswerType           p_AnswerType,
@@ -953,10 +953,10 @@ namespace MDNSImplementation
             uint8_t                           m_u8SentCount;  // Used for probes and announcements
             esp8266::polledTimeout::oneShotMs m_Timeout;      // Used for probes and announcements
             //clsMDNSTimeFlag                   m_TimeFlag;     // Used for probes and announcements
-            bool                              m_bConflict;
-            bool                              m_bTiebreakNeeded;
-            MDNSHostProbeFn                   m_fnHostProbeResultCallback;
-            MDNSServiceProbeFn                m_fnServiceProbeResultCallback;
+            bool               m_bConflict;
+            bool               m_bTiebreakNeeded;
+            MDNSHostProbeFn    m_fnHostProbeResultCallback;
+            MDNSServiceProbeFn m_fnServiceProbeResultCallback;
 
             stcProbeInformation(void);
 
@@ -1012,14 +1012,14 @@ namespace MDNSImplementation
                     /**
                     timeoutLevel_t
                 */
-                    typedef uint8_t                   timeoutLevel_t;
+                    typedef uint8_t timeoutLevel_t;
                     /**
                     TIMEOUTLEVELs
                 */
-                    const timeoutLevel_t              TIMEOUTLEVEL_UNSET    = 0;
-                    const timeoutLevel_t              TIMEOUTLEVEL_BASE     = 80;
-                    const timeoutLevel_t              TIMEOUTLEVEL_INTERVAL = 5;
-                    const timeoutLevel_t              TIMEOUTLEVEL_FINAL    = 100;
+                    const timeoutLevel_t TIMEOUTLEVEL_UNSET    = 0;
+                    const timeoutLevel_t TIMEOUTLEVEL_BASE     = 80;
+                    const timeoutLevel_t TIMEOUTLEVEL_INTERVAL = 5;
+                    const timeoutLevel_t TIMEOUTLEVEL_FINAL    = 100;
 
                     uint32_t                          m_u32TTL;
                     esp8266::polledTimeout::oneShotMs m_TTLTimeout;
@@ -1028,13 +1028,13 @@ namespace MDNSImplementation
                     using timeoutBase = decltype(m_TTLTimeout);
 
                     stcTTL(void);
-                    bool                  set(uint32_t p_u32TTL);
+                    bool set(uint32_t p_u32TTL);
 
-                    bool                  flagged(void);
-                    bool                  restart(void);
+                    bool flagged(void);
+                    bool restart(void);
 
-                    bool                  prepareDeletion(void);
-                    bool                  finalTimeoutLevel(void) const;
+                    bool prepareDeletion(void);
+                    bool finalTimeoutLevel(void) const;
 
                     timeoutBase::timeType timeout(void) const;
                 };
@@ -1067,7 +1067,7 @@ namespace MDNSImplementation
                 };
 #endif
 
-                stcAnswer*         m_pNext;
+                stcAnswer* m_pNext;
                 // The service domain is the first 'answer' (from PTR answer, using service and protocol) to be set
                 // Defines the key for additional answer, like host domain, etc.
                 stcMDNS_RRDomain   m_ServiceDomain;  // 1. level answer (PTR), eg. MyESP._http._tcp.local
@@ -1091,7 +1091,7 @@ namespace MDNSImplementation
                 stcAnswer(void);
                 ~stcAnswer(void);
 
-                bool  clear(void);
+                bool clear(void);
 
                 char* allocServiceDomain(size_t p_stLength);
                 bool  releaseServiceDomain(void);
@@ -1136,18 +1136,18 @@ namespace MDNSImplementation
             stcMDNSServiceQuery(void);
             ~stcMDNSServiceQuery(void);
 
-            bool             clear(void);
+            bool clear(void);
 
             uint32_t         answerCount(void) const;
             const stcAnswer* answerAtIndex(uint32_t p_u32Index) const;
             stcAnswer*       answerAtIndex(uint32_t p_u32Index);
             uint32_t         indexOfAnswer(const stcAnswer* p_pAnswer) const;
 
-            bool             addAnswer(stcAnswer* p_pAnswer);
-            bool             removeAnswer(stcAnswer* p_pAnswer);
+            bool addAnswer(stcAnswer* p_pAnswer);
+            bool removeAnswer(stcAnswer* p_pAnswer);
 
-            stcAnswer*       findAnswerForServiceDomain(const stcMDNS_RRDomain& p_ServiceDomain);
-            stcAnswer*       findAnswerForHostDomain(const stcMDNS_RRDomain& p_HostDomain);
+            stcAnswer* findAnswerForServiceDomain(const stcMDNS_RRDomain& p_ServiceDomain);
+            stcAnswer* findAnswerForHostDomain(const stcMDNS_RRDomain& p_HostDomain);
         };
 
         /**
@@ -1187,10 +1187,10 @@ namespace MDNSImplementation
             stcMDNSSendParameter(void);
             ~stcMDNSSendParameter(void);
 
-            bool     clear(void);
-            bool     clearCachedNames(void);
+            bool clear(void);
+            bool clearCachedNames(void);
 
-            bool     shiftOffset(uint16_t p_u16Shift);
+            bool shiftOffset(uint16_t p_u16Shift);
 
             bool     addDomainCacheItem(const void* p_pHostnameOrService,
                                         bool        p_bAdditionalData,
@@ -1209,20 +1209,20 @@ namespace MDNSImplementation
 
         /** CONTROL **/
         /* MAINTENANCE */
-        bool                              _process(bool p_bUserContext);
-        bool                              _restart(void);
+        bool _process(bool p_bUserContext);
+        bool _restart(void);
 
         /* RECEIVING */
-        bool                              _parseMessage(void);
-        bool                              _parseQuery(const stcMDNS_MsgHeader& p_Header);
-
-        bool                              _parseResponse(const stcMDNS_MsgHeader& p_Header);
-        bool                              _processAnswers(const stcMDNS_RRAnswer* p_pPTRAnswers);
-        bool                              _processPTRAnswer(const stcMDNS_RRAnswerPTR* p_pPTRAnswer,
-                                                            bool&                      p_rbFoundNewKeyAnswer);
-        bool                              _processSRVAnswer(const stcMDNS_RRAnswerSRV* p_pSRVAnswer,
-                                                            bool&                      p_rbFoundNewKeyAnswer);
-        bool                              _processTXTAnswer(const stcMDNS_RRAnswerTXT* p_pTXTAnswer);
+        bool _parseMessage(void);
+        bool _parseQuery(const stcMDNS_MsgHeader& p_Header);
+
+        bool _parseResponse(const stcMDNS_MsgHeader& p_Header);
+        bool _processAnswers(const stcMDNS_RRAnswer* p_pPTRAnswers);
+        bool _processPTRAnswer(const stcMDNS_RRAnswerPTR* p_pPTRAnswer,
+                               bool&                      p_rbFoundNewKeyAnswer);
+        bool _processSRVAnswer(const stcMDNS_RRAnswerSRV* p_pSRVAnswer,
+                               bool&                      p_rbFoundNewKeyAnswer);
+        bool _processTXTAnswer(const stcMDNS_RRAnswerTXT* p_pTXTAnswer);
 #ifdef MDNS_IP4_SUPPORT
         bool _processAAnswer(const stcMDNS_RRAnswerA* p_pAAnswer);
 #endif
@@ -1231,34 +1231,34 @@ namespace MDNSImplementation
 #endif
 
         /* PROBING */
-        bool    _updateProbeStatus(void);
-        bool    _resetProbeStatus(bool p_bRestart = true);
-        bool    _hasProbesWaitingForAnswers(void) const;
-        bool    _sendHostProbe(void);
-        bool    _sendServiceProbe(stcMDNSService& p_rService);
-        bool    _cancelProbingForHost(void);
-        bool    _cancelProbingForService(stcMDNSService& p_rService);
+        bool _updateProbeStatus(void);
+        bool _resetProbeStatus(bool p_bRestart = true);
+        bool _hasProbesWaitingForAnswers(void) const;
+        bool _sendHostProbe(void);
+        bool _sendServiceProbe(stcMDNSService& p_rService);
+        bool _cancelProbingForHost(void);
+        bool _cancelProbingForService(stcMDNSService& p_rService);
 
         /* ANNOUNCE */
-        bool    _announce(bool p_bAnnounce,
-                          bool p_bIncludeServices);
-        bool    _announceService(stcMDNSService& p_rService,
-                                 bool            p_bAnnounce = true);
+        bool _announce(bool p_bAnnounce,
+                       bool p_bIncludeServices);
+        bool _announceService(stcMDNSService& p_rService,
+                              bool            p_bAnnounce = true);
 
         /* SERVICE QUERY CACHE */
-        bool    _hasServiceQueriesWaitingForAnswers(void) const;
-        bool    _checkServiceQueryCache(void);
+        bool _hasServiceQueriesWaitingForAnswers(void) const;
+        bool _checkServiceQueryCache(void);
 
         /** TRANSFER **/
         /* SENDING */
-        bool    _sendMDNSMessage(stcMDNSSendParameter& p_SendParameter);
-        bool    _sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter);
-        bool    _prepareMDNSMessage(stcMDNSSendParameter& p_SendParameter,
-                                    IPAddress             p_IPAddress);
-        bool    _sendMDNSServiceQuery(const stcMDNSServiceQuery& p_ServiceQuery);
-        bool    _sendMDNSQuery(const stcMDNS_RRDomain&         p_QueryDomain,
-                               uint16_t                        p_u16QueryType,
-                               stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers = 0);
+        bool _sendMDNSMessage(stcMDNSSendParameter& p_SendParameter);
+        bool _sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter);
+        bool _prepareMDNSMessage(stcMDNSSendParameter& p_SendParameter,
+                                 IPAddress             p_IPAddress);
+        bool _sendMDNSServiceQuery(const stcMDNSServiceQuery& p_ServiceQuery);
+        bool _sendMDNSQuery(const stcMDNS_RRDomain&         p_QueryDomain,
+                            uint16_t                        p_u16QueryType,
+                            stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers = 0);
 
         uint8_t _replyMaskForHost(const stcMDNS_RRHeader& p_RRHeader,
                                   bool*                   p_pbFullNameMatch = 0) const;
@@ -1267,8 +1267,8 @@ namespace MDNSImplementation
                                      bool*                   p_pbFullNameMatch = 0) const;
 
         /* RESOURCE RECORD */
-        bool    _readRRQuestion(stcMDNS_RRQuestion& p_rQuestion);
-        bool    _readRRAnswer(stcMDNS_RRAnswer*& p_rpAnswer);
+        bool _readRRQuestion(stcMDNS_RRQuestion& p_rQuestion);
+        bool _readRRAnswer(stcMDNS_RRAnswer*& p_rpAnswer);
 #ifdef MDNS_IP4_SUPPORT
         bool _readRRAnswerA(stcMDNS_RRAnswerA& p_rRRAnswerA,
                             uint16_t           p_u16RDLength);
@@ -1375,68 +1375,68 @@ namespace MDNSImplementation
         bool _writeMDNSAnswer_PTR_IP6(IPAddress             p_IPAddress,
                                       stcMDNSSendParameter& p_rSendParameter);
 #endif
-        bool                     _writeMDNSAnswer_SRV(stcMDNSService&       p_rService,
-                                                      stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_SRV(stcMDNSService&       p_rService,
+                                  stcMDNSSendParameter& p_rSendParameter);
 
         /** HELPERS **/
         /* UDP CONTEXT */
-        bool                     _callProcess(void);
-        bool                     _allocUDPContext(void);
-        bool                     _releaseUDPContext(void);
+        bool _callProcess(void);
+        bool _allocUDPContext(void);
+        bool _releaseUDPContext(void);
 
         /* SERVICE QUERY */
-        stcMDNSServiceQuery*     _allocServiceQuery(void);
-        bool                     _removeServiceQuery(stcMDNSServiceQuery* p_pServiceQuery);
-        bool                     _removeLegacyServiceQuery(void);
-        stcMDNSServiceQuery*     _findServiceQuery(hMDNSServiceQuery p_hServiceQuery);
-        stcMDNSServiceQuery*     _findLegacyServiceQuery(void);
-        bool                     _releaseServiceQueries(void);
-        stcMDNSServiceQuery*     _findNextServiceQueryByServiceType(const stcMDNS_RRDomain&    p_ServiceDomain,
-                                                                    const stcMDNSServiceQuery* p_pPrevServiceQuery);
+        stcMDNSServiceQuery* _allocServiceQuery(void);
+        bool                 _removeServiceQuery(stcMDNSServiceQuery* p_pServiceQuery);
+        bool                 _removeLegacyServiceQuery(void);
+        stcMDNSServiceQuery* _findServiceQuery(hMDNSServiceQuery p_hServiceQuery);
+        stcMDNSServiceQuery* _findLegacyServiceQuery(void);
+        bool                 _releaseServiceQueries(void);
+        stcMDNSServiceQuery* _findNextServiceQueryByServiceType(const stcMDNS_RRDomain&    p_ServiceDomain,
+                                                                const stcMDNSServiceQuery* p_pPrevServiceQuery);
 
         /* HOSTNAME */
-        bool                     _setHostname(const char* p_pcHostname);
-        bool                     _releaseHostname(void);
+        bool _setHostname(const char* p_pcHostname);
+        bool _releaseHostname(void);
 
         /* SERVICE */
-        stcMDNSService*          _allocService(const char* p_pcName,
-                                               const char* p_pcService,
-                                               const char* p_pcProtocol,
-                                               uint16_t    p_u16Port);
-        bool                     _releaseService(stcMDNSService* p_pService);
-        bool                     _releaseServices(void);
-
-        stcMDNSService*          _findService(const char* p_pcName,
-                                              const char* p_pcService,
-                                              const char* p_pcProtocol);
-        stcMDNSService*          _findService(const hMDNSService p_hService);
+        stcMDNSService* _allocService(const char* p_pcName,
+                                      const char* p_pcService,
+                                      const char* p_pcProtocol,
+                                      uint16_t    p_u16Port);
+        bool            _releaseService(stcMDNSService* p_pService);
+        bool            _releaseServices(void);
+
+        stcMDNSService* _findService(const char* p_pcName,
+                                     const char* p_pcService,
+                                     const char* p_pcProtocol);
+        stcMDNSService* _findService(const hMDNSService p_hService);
 
-        size_t                   _countServices(void) const;
+        size_t _countServices(void) const;
 
         /* SERVICE TXT */
-        stcMDNSServiceTxt*       _allocServiceTxt(stcMDNSService* p_pService,
-                                                  const char*     p_pcKey,
-                                                  const char*     p_pcValue,
-                                                  bool            p_bTemp);
-        bool                     _releaseServiceTxt(stcMDNSService*    p_pService,
-                                                    stcMDNSServiceTxt* p_pTxt);
-        stcMDNSServiceTxt*       _updateServiceTxt(stcMDNSService*    p_pService,
-                                                   stcMDNSServiceTxt* p_pTxt,
-                                                   const char*        p_pcValue,
-                                                   bool               p_bTemp);
-
-        stcMDNSServiceTxt*       _findServiceTxt(stcMDNSService* p_pService,
-                                                 const char*     p_pcKey);
-        stcMDNSServiceTxt*       _findServiceTxt(stcMDNSService* p_pService,
-                                                 const hMDNSTxt  p_hTxt);
-
-        stcMDNSServiceTxt*       _addServiceTxt(stcMDNSService* p_pService,
-                                                const char*     p_pcKey,
-                                                const char*     p_pcValue,
-                                                bool            p_bTemp);
-
-        stcMDNSServiceTxt*       _answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
-                                                 const uint32_t          p_u32AnswerIndex);
+        stcMDNSServiceTxt* _allocServiceTxt(stcMDNSService* p_pService,
+                                            const char*     p_pcKey,
+                                            const char*     p_pcValue,
+                                            bool            p_bTemp);
+        bool               _releaseServiceTxt(stcMDNSService*    p_pService,
+                                              stcMDNSServiceTxt* p_pTxt);
+        stcMDNSServiceTxt* _updateServiceTxt(stcMDNSService*    p_pService,
+                                             stcMDNSServiceTxt* p_pTxt,
+                                             const char*        p_pcValue,
+                                             bool               p_bTemp);
+
+        stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
+                                           const char*     p_pcKey);
+        stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
+                                           const hMDNSTxt  p_hTxt);
+
+        stcMDNSServiceTxt* _addServiceTxt(stcMDNSService* p_pService,
+                                          const char*     p_pcKey,
+                                          const char*     p_pcValue,
+                                          bool            p_bTemp);
+
+        stcMDNSServiceTxt* _answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
+                                           const uint32_t          p_u32AnswerIndex);
 
         bool                     _collectServiceTxts(stcMDNSService& p_rService);
         bool                     _releaseTempServiceTxts(stcMDNSService& p_rService);
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
index 27b24fae3d..7abc5a2309 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
@@ -113,7 +113,7 @@ namespace MDNSImplementation
                                   IPAddress(m_pUDPContext->getDestAddress()).toString().c_str(), m_pUDPContext->getLocalPort()););
         //DEBUG_EX_INFO(_udpDump(););
 
-        bool              bResult = false;
+        bool bResult = false;
 
         stcMDNS_MsgHeader header;
         if (_readMDNSMsgHeader(header))
@@ -167,7 +167,7 @@ namespace MDNSImplementation
 */
     bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
     {
-        bool                 bResult = true;
+        bool bResult = true;
 
         stcMDNSSendParameter sendParameter;
         uint8_t              u8HostOrServiceReplies = 0;
@@ -515,7 +515,7 @@ namespace MDNSImplementation
                 sendParameter.m_bResponse    = true;
                 sendParameter.m_bAuthorative = true;
 
-                bResult                      = _sendMDNSMessage(sendParameter);
+                bResult = _sendMDNSMessage(sendParameter);
             }
             DEBUG_EX_INFO(
                 else
@@ -710,7 +710,7 @@ namespace MDNSImplementation
             bool bFoundNewKeyAnswer;
             do
             {
-                bFoundNewKeyAnswer                = false;
+                bFoundNewKeyAnswer = false;
 
                 const stcMDNS_RRAnswer* pRRAnswer = p_pAnswers;
                 while ((pRRAnswer) && (bResult))
@@ -1303,13 +1303,13 @@ namespace MDNSImplementation
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe (%s, %lu)\n"), m_pcHostname, millis()););
 
-        bool                 bResult = true;
+        bool bResult = true;
 
         // Requests for host domain
         stcMDNSSendParameter sendParameter;
         sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
 
-        sendParameter.m_pQuestions  = new stcMDNS_RRQuestion;
+        sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
         if (((bResult = (0 != sendParameter.m_pQuestions))) && ((bResult = _buildDomainForHost(m_pcHostname, sendParameter.m_pQuestions->m_Header.m_Domain))))
         {
             //sendParameter.m_pQuestions->m_bUnicast = true;
@@ -1356,13 +1356,13 @@ namespace MDNSImplementation
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe (%s.%s.%s, %lu)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, millis()););
 
-        bool                 bResult = true;
+        bool bResult = true;
 
         // Requests for service instance domain
         stcMDNSSendParameter sendParameter;
         sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
 
-        sendParameter.m_pQuestions  = new stcMDNS_RRQuestion;
+        sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
         if (((bResult = (0 != sendParameter.m_pQuestions))) && ((bResult = _buildDomainForService(p_rService, true, sendParameter.m_pQuestions->m_Header.m_Domain))))
         {
             sendParameter.m_pQuestions->m_bUnicast                       = true;
@@ -1370,7 +1370,7 @@ namespace MDNSImplementation
             sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
 
             // Add known answers
-            p_rService.m_u8ReplyMask                                     = (ContentFlag_SRV | ContentFlag_PTR_NAME);  // Add SRV and PTR NAME answers
+            p_rService.m_u8ReplyMask = (ContentFlag_SRV | ContentFlag_PTR_NAME);  // Add SRV and PTR NAME answers
         }
         else
         {
@@ -1452,16 +1452,16 @@ namespace MDNSImplementation
     bool MDNSResponder::_announce(bool p_bAnnounce,
                                   bool p_bIncludeServices)
     {
-        bool                 bResult = false;
+        bool bResult = false;
 
         stcMDNSSendParameter sendParameter;
         if (ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus)
         {
-            bResult                         = true;
+            bResult = true;
 
-            sendParameter.m_bResponse       = true;  // Announces are 'Unsolicited authoritative responses'
-            sendParameter.m_bAuthorative    = true;
-            sendParameter.m_bUnannounce     = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
+            sendParameter.m_bResponse    = true;  // Announces are 'Unsolicited authoritative responses'
+            sendParameter.m_bAuthorative = true;
+            sendParameter.m_bUnannounce  = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
 
             // Announce host
             sendParameter.m_u8HostReplyMask = 0;
@@ -1503,20 +1503,20 @@ namespace MDNSImplementation
     bool MDNSResponder::_announceService(stcMDNSService& p_rService,
                                          bool            p_bAnnounce /*= true*/)
     {
-        bool                 bResult = false;
+        bool bResult = false;
 
         stcMDNSSendParameter sendParameter;
         if (ProbingStatus_Done == p_rService.m_ProbeInformation.m_ProbingStatus)
         {
-            sendParameter.m_bResponse       = true;  // Announces are 'Unsolicited authoritative responses'
-            sendParameter.m_bAuthorative    = true;
-            sendParameter.m_bUnannounce     = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
+            sendParameter.m_bResponse    = true;  // Announces are 'Unsolicited authoritative responses'
+            sendParameter.m_bAuthorative = true;
+            sendParameter.m_bUnannounce  = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
 
             // DON'T announce host
             sendParameter.m_u8HostReplyMask = 0;
 
             // Announce services (service type, name, SRV (location) and TXTs)
-            p_rService.m_u8ReplyMask        = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
+            p_rService.m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
             DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: Announcing service %s.%s.%s (content 0x%X)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, p_rService.m_u8ReplyMask););
 
             bResult = true;
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
index be553ea96f..7aa16df0c0 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
@@ -56,7 +56,7 @@ namespace MDNSImplementation
                                                const char* p_pcDivider /*= "-"*/,
                                                const char* p_pcDefaultDomain /*= 0*/)
     {
-        bool        bResult   = false;
+        bool bResult = false;
 
         // Ensure a divider exists; use '-' as default
         const char* pcDivider = (p_pcDivider ?: "-");
@@ -83,7 +83,7 @@ namespace MDNSImplementation
                         delete[] p_rpcDomain;
                         p_rpcDomain = pNewHostname;
 
-                        bResult     = true;
+                        bResult = true;
                     }
                     else
                     {
@@ -107,7 +107,7 @@ namespace MDNSImplementation
                     delete[] p_rpcDomain;
                     p_rpcDomain = pNewHostname;
 
-                    bResult     = true;
+                    bResult = true;
                 }
                 else
                 {
@@ -120,8 +120,8 @@ namespace MDNSImplementation
             // No given host domain, use base or default
             const char* cpcDefaultName = (p_pcDefaultDomain ?: "esp8266");
 
-            size_t      stLength       = strlen(cpcDefaultName) + 1;  // '\0'
-            p_rpcDomain                = new char[stLength];
+            size_t stLength = strlen(cpcDefaultName) + 1;  // '\0'
+            p_rpcDomain     = new char[stLength];
             if (p_rpcDomain)
             {
                 strncpy(p_rpcDomain, cpcDefaultName, stLength);
@@ -318,7 +318,7 @@ namespace MDNSImplementation
     {
         stcMDNSServiceQuery* pMatchingServiceQuery = 0;
 
-        stcMDNSServiceQuery* pServiceQuery         = (p_pPrevServiceQuery ? p_pPrevServiceQuery->m_pNext : m_pServiceQueries);
+        stcMDNSServiceQuery* pServiceQuery = (p_pPrevServiceQuery ? p_pPrevServiceQuery->m_pNext : m_pServiceQueries);
         while (pServiceQuery)
         {
             if (p_ServiceTypeDomain == pServiceQuery->m_ServiceTypeDomain)
@@ -399,8 +399,8 @@ namespace MDNSImplementation
             pService->m_u16Port   = p_u16Port;
 
             // Add to list (or start list)
-            pService->m_pNext     = m_pServices;
-            m_pServices           = pService;
+            pService->m_pNext = m_pServices;
+            m_pServices       = pService;
         }
         return pService;
     }
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
index 325df90cc3..d569223f2f 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
@@ -374,9 +374,9 @@ namespace MDNSImplementation
 */
     bool MDNSResponder::stcMDNSServiceTxts::removeTempTxts(void)
     {
-        bool               bResult = true;
+        bool bResult = true;
 
-        stcMDNSServiceTxt* pTxt    = m_pTxts;
+        stcMDNSServiceTxt* pTxt = m_pTxts;
         while ((bResult) && (pTxt))
         {
             stcMDNSServiceTxt* pNext = pTxt->m_pNext;
@@ -448,9 +448,9 @@ namespace MDNSImplementation
 */
     uint16_t MDNSResponder::stcMDNSServiceTxts::length(void) const
     {
-        uint16_t           u16Length = 0;
+        uint16_t u16Length = 0;
 
-        stcMDNSServiceTxt* pTxt      = m_pTxts;
+        stcMDNSServiceTxt* pTxt = m_pTxts;
         while (pTxt)
         {
             u16Length += 1;               // Length byte
@@ -479,7 +479,7 @@ namespace MDNSImplementation
 
         if (p_pcBuffer)
         {
-            bResult     = true;
+            bResult = true;
 
             *p_pcBuffer = 0;
             for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
@@ -527,7 +527,7 @@ namespace MDNSImplementation
 
         if (p_pcBuffer)
         {
-            bResult     = true;
+            bResult = true;
 
             *p_pcBuffer = 0;
             for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
@@ -684,7 +684,7 @@ namespace MDNSImplementation
     bool MDNSResponder::stcMDNS_RRDomain::addLabel(const char* p_pcLabel,
                                                    bool        p_bPrependUnderline /*= false*/)
     {
-        bool   bResult  = false;
+        bool bResult = false;
 
         size_t stLength = (p_pcLabel
                                ? (strlen(p_pcLabel) + (p_bPrependUnderline ? 1 : 0))
@@ -770,7 +770,7 @@ namespace MDNSImplementation
 */
     size_t MDNSResponder::stcMDNS_RRDomain::c_strLength(void) const
     {
-        size_t         stLength       = 0;
+        size_t stLength = 0;
 
         unsigned char* pucLabelLength = (unsigned char*)m_acName;
         while (*pucLabelLength)
@@ -1793,7 +1793,7 @@ namespace MDNSImplementation
 */
     uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount(void) const
     {
-        uint32_t       u32Count    = 0;
+        uint32_t u32Count = 0;
 
         stcIP4Address* pIP4Address = m_pIP4Addresses;
         while (pIP4Address)
@@ -1920,7 +1920,7 @@ namespace MDNSImplementation
 */
     uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount(void) const
     {
-        uint32_t       u32Count    = 0;
+        uint32_t u32Count = 0;
 
         stcIP6Address* pIP6Address = m_pIP6Addresses;
         while (pIP6Address)
@@ -2020,9 +2020,9 @@ namespace MDNSImplementation
 */
     uint32_t MDNSResponder::stcMDNSServiceQuery::answerCount(void) const
     {
-        uint32_t   u32Count = 0;
+        uint32_t u32Count = 0;
 
-        stcAnswer* pAnswer  = m_pAnswers;
+        stcAnswer* pAnswer = m_pAnswers;
         while (pAnswer)
         {
             ++u32Count;
@@ -2213,13 +2213,13 @@ namespace MDNSImplementation
         m_u8HostReplyMask = 0;
         m_u16Offset       = 0;
 
-        m_bLegacyQuery    = false;
-        m_bResponse       = false;
-        m_bAuthorative    = false;
-        m_bUnicast        = false;
-        m_bUnannounce     = false;
+        m_bLegacyQuery = false;
+        m_bResponse    = false;
+        m_bAuthorative = false;
+        m_bUnicast     = false;
+        m_bUnannounce  = false;
 
-        m_bCacheFlush     = true;
+        m_bCacheFlush = true;
 
         while (m_pQuestions)
         {
@@ -2265,7 +2265,7 @@ namespace MDNSImplementation
                                                                  bool        p_bAdditionalData,
                                                                  uint16_t    p_u16Offset)
     {
-        bool                bResult  = false;
+        bool bResult = false;
 
         stcDomainCacheItem* pNewItem = 0;
         if ((p_pHostnameOrService) && (p_u16Offset) && ((pNewItem = new stcDomainCacheItem(p_pHostnameOrService, p_bAdditionalData, p_u16Offset))))
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
index c1eac04946..d66509adb5 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
@@ -72,7 +72,7 @@ namespace MDNSImplementation
     Any reply flags in installed services are removed at the end!
 
 */
-    bool               MDNSResponder::_sendMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    bool MDNSResponder::_sendMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         bool bResult = true;
 
@@ -162,9 +162,9 @@ namespace MDNSImplementation
         stcMDNS_MsgHeader msgHeader(p_rSendParameter.m_u16ID, p_rSendParameter.m_bResponse, 0, p_rSendParameter.m_bAuthorative);
         // If this is a response, the answers are anwers,
         // else this is a query or probe and the answers go into auth section
-        uint16_t&         ru16Answers = (p_rSendParameter.m_bResponse
-                                             ? msgHeader.m_u16ANCount
-                                             : msgHeader.m_u16NSCount);
+        uint16_t& ru16Answers = (p_rSendParameter.m_bResponse
+                                     ? msgHeader.m_u16ANCount
+                                     : msgHeader.m_u16NSCount);
 
         /**
         enuSequence
@@ -361,14 +361,14 @@ namespace MDNSImplementation
                                        uint16_t                               p_u16QueryType,
                                        stcMDNSServiceQuery::stcAnswer*        p_pKnownAnswers /*= 0*/)
     {
-        bool                 bResult = false;
+        bool bResult = false;
 
         stcMDNSSendParameter sendParameter;
         if (0 != ((sendParameter.m_pQuestions = new stcMDNS_RRQuestion)))
         {
-            sendParameter.m_pQuestions->m_Header.m_Domain                = p_QueryDomain;
+            sendParameter.m_pQuestions->m_Header.m_Domain = p_QueryDomain;
 
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type  = p_u16QueryType;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = p_u16QueryType;
             // It seems, that some mDNS implementations don't support 'unicast response' questions...
             sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (/*0x8000 |*/ DNS_RRCLASS_IN);  // /*Unicast &*/ INternet
 
@@ -434,7 +434,7 @@ namespace MDNSImplementation
     {
         //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer\n")););
 
-        bool             bResult = false;
+        bool bResult = false;
 
         stcMDNS_RRHeader header;
         uint32_t         u32TTL;
@@ -569,19 +569,19 @@ namespace MDNSImplementation
         p_rRRAnswerTXT.clear();
         if (p_u16RDLength)
         {
-            bResult                  = false;
+            bResult = false;
 
             unsigned char* pucBuffer = new unsigned char[p_u16RDLength];
             if (pucBuffer)
             {
                 if (_udpReadBuffer(pucBuffer, p_u16RDLength))
                 {
-                    bResult                        = true;
+                    bResult = true;
 
                     const unsigned char* pucCursor = pucBuffer;
                     while ((pucCursor < (pucBuffer + p_u16RDLength)) && (bResult))
                     {
-                        bResult                     = false;
+                        bResult = false;
 
                         stcMDNSServiceTxt* pTxt     = 0;
                         unsigned char      ucLength = *pucCursor++;  // Length of the next txt item
@@ -747,7 +747,7 @@ namespace MDNSImplementation
 
         if (MDNS_DOMAIN_MAX_REDIRCTION >= p_u8Depth)
         {
-            bResult       = true;
+            bResult = true;
 
             uint8_t u8Len = 0;
             do
@@ -1047,9 +1047,9 @@ namespace MDNSImplementation
 */
     bool MDNSResponder::_udpDump(bool p_bMovePointer /*= false*/)
     {
-        const uint8_t cu8BytesPerLine  = 16;
+        const uint8_t cu8BytesPerLine = 16;
 
-        uint32_t      u32StartPosition = m_pUDPContext->tell();
+        uint32_t u32StartPosition = m_pUDPContext->tell();
         DEBUG_OUTPUT.println("UDP Context Dump:");
         uint32_t u32Counter = 0;
         uint8_t  u8Byte     = 0;
@@ -1109,7 +1109,7 @@ namespace MDNSImplementation
 */
     bool MDNSResponder::_readMDNSMsgHeader(MDNSResponder::stcMDNS_MsgHeader& p_rMsgHeader)
     {
-        bool    bResult = false;
+        bool bResult = false;
 
         uint8_t u8B1;
         uint8_t u8B2;
@@ -1121,9 +1121,9 @@ namespace MDNSImplementation
             p_rMsgHeader.m_1bTC     = (u8B1 & 0x02);  // Truncation flag
             p_rMsgHeader.m_1bRD     = (u8B1 & 0x01);  // Recursion desired
 
-            p_rMsgHeader.m_1bRA     = (u8B2 & 0x80);  // Recursion available
-            p_rMsgHeader.m_3bZ      = (u8B2 & 0x70);  // Zero
-            p_rMsgHeader.m_4bRCode  = (u8B2 & 0x0F);  // Response code
+            p_rMsgHeader.m_1bRA    = (u8B2 & 0x80);  // Recursion available
+            p_rMsgHeader.m_3bZ     = (u8B2 & 0x70);  // Zero
+            p_rMsgHeader.m_4bRCode = (u8B2 & 0x0F);  // Response code
 
             /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
                 (unsigned)p_rMsgHeader.m_u16ID,
@@ -1133,7 +1133,7 @@ namespace MDNSImplementation
                 (unsigned)p_rMsgHeader.m_u16ANCount,
                 (unsigned)p_rMsgHeader.m_u16NSCount,
                 (unsigned)p_rMsgHeader.m_u16ARCount););*/
-            bResult                 = true;
+            bResult = true;
         }
         DEBUG_EX_ERR(if (!bResult)
                      {
@@ -1251,7 +1251,7 @@ namespace MDNSImplementation
                                              MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
-        uint16_t         u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostname, false);
+        uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostname, false);
 
         stcMDNS_RRDomain hostDomain;
         bool             bResult = (u16CachedDomainOffset
@@ -1290,7 +1290,7 @@ namespace MDNSImplementation
                                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
-        uint16_t         u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName);
+        uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName);
 
         stcMDNS_RRDomain serviceDomain;
         bool             bResult = (u16CachedDomainOffset
@@ -1477,7 +1477,7 @@ namespace MDNSImplementation
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT\n")););
 
-        bool                 bResult = false;
+        bool bResult = false;
 
         stcMDNS_RRAttributes attributes(DNS_RRTYPE_TXT,
                                         ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
@@ -1584,9 +1584,9 @@ namespace MDNSImplementation
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV\n")););
 
-        uint16_t             u16CachedDomainOffset = (p_rSendParameter.m_bLegacyQuery
-                                                          ? 0
-                                                          : p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostname, false));
+        uint16_t u16CachedDomainOffset = (p_rSendParameter.m_bLegacyQuery
+                                              ? 0
+                                              : p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostname, false));
 
         stcMDNS_RRAttributes attributes(DNS_RRTYPE_SRV,
                                         ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
@@ -1604,9 +1604,9 @@ namespace MDNSImplementation
                                 (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                                                                                              // Weight
                                 (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                                                                                         // Port
                                 (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostname, false, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(hostDomain, p_rSendParameter)))  // Host, eg. esp8266.local
-                             // Cache available for domain
-                                             : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
-                                (_write16((sizeof(uint16_t /*Prio*/) +                                                        // RDLength
+                                                                                                                                                                                              // Cache available for domain
+                                             : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&                                                                  // Valid offset
+                                (_write16((sizeof(uint16_t /*Prio*/) +                                                                                                                        // RDLength
                                            sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + 2),
                                           p_rSendParameter))
                                 &&                                                                                          // Length of 'C0xx'
diff --git a/libraries/Hash/examples/sha1/sha1.ino b/libraries/Hash/examples/sha1/sha1.ino
index e9260ed9c5..945c385e6e 100644
--- a/libraries/Hash/examples/sha1/sha1.ino
+++ b/libraries/Hash/examples/sha1/sha1.ino
@@ -9,7 +9,6 @@ void setup() {
 }
 
 void loop() {
-
   // usage as String
   // SHA1:a9993e364706816aba3e25717850c26c9cd0d89d
 
diff --git a/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino b/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino
index 1c7c7dca22..50b3206cc7 100644
--- a/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino
+++ b/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino
@@ -9,33 +9,28 @@
 
 #include <I2S.h>
 
-void setup()
-{
+void setup() {
   // Open serial communications and wait for port to open:
   // A baud rate of 115200 is used instead of 9600 for a faster data rate
   // on non-native USB ports
   Serial.begin(115200);
-  while (!Serial)
-  {
+  while (!Serial) {
     ;  // wait for serial port to connect. Needed for native USB port only
   }
 
   // start I2S at 8 kHz with 24-bits per sample
-  if (!I2S.begin(I2S_PHILIPS_MODE, 8000, 24))
-  {
+  if (!I2S.begin(I2S_PHILIPS_MODE, 8000, 24)) {
     Serial.println("Failed to initialize I2S!");
     while (1)
       ;  // do nothing
   }
 }
 
-void loop()
-{
+void loop() {
   // read a sample
   int sample = I2S.read();
 
-  if (sample)
-  {
+  if (sample) {
     // if it's non-zero print value to serial
     Serial.println(sample);
   }
diff --git a/libraries/I2S/examples/SimpleTone/SimpleTone.ino b/libraries/I2S/examples/SimpleTone/SimpleTone.ino
index a7ad2b5195..535cbf5c0b 100644
--- a/libraries/I2S/examples/SimpleTone/SimpleTone.ino
+++ b/libraries/I2S/examples/SimpleTone/SimpleTone.ino
@@ -10,33 +10,29 @@
 
 #include <I2S.h>
 
-const int frequency      = 440;   // frequency of square wave in Hz
-const int amplitude      = 500;   // amplitude of square wave
-const int sampleRate     = 8000;  // sample rate in Hz
+const int frequency  = 440;   // frequency of square wave in Hz
+const int amplitude  = 500;   // amplitude of square wave
+const int sampleRate = 8000;  // sample rate in Hz
 
 const int halfWavelength = (sampleRate / frequency);  // half wavelength of square wave
 
-short     sample         = amplitude;  // current sample value
-int       count          = 0;
+short sample = amplitude;  // current sample value
+int   count  = 0;
 
-void      setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println("I2S simple tone");
 
   // start I2S at the sample rate with 16-bits per sample
-  if (!I2S.begin(I2S_PHILIPS_MODE, sampleRate, 16))
-  {
+  if (!I2S.begin(I2S_PHILIPS_MODE, sampleRate, 16)) {
     Serial.println("Failed to initialize I2S!");
     while (1)
       ;  // do nothing
   }
 }
 
-void loop()
-{
-  if (count % halfWavelength == 0)
-  {
+void loop() {
+  if (count % halfWavelength == 0) {
     // invert the sample every half wavelength count multiple to generate square wave
     sample = -1 * sample;
   }
diff --git a/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino b/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
index 4ee3f3b424..628c7490ee 100644
--- a/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
+++ b/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
@@ -12,20 +12,18 @@
 #define STAPSK "your-password"
 #endif
 
-const char* ssid        = STASSID;
-const char* pass        = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
-long        timezone    = 2;
-byte        daysavetime = 1;
+long timezone    = 2;
+byte daysavetime = 1;
 
-void        listDir(const char* dirname)
-{
+void listDir(const char* dirname) {
   Serial.printf("Listing directory: %s\n", dirname);
 
   Dir root = LittleFS.openDir(dirname);
 
-  while (root.next())
-  {
+  while (root.next()) {
     File file = root.openFile("r");
     Serial.print("  FILE: ");
     Serial.print(root.fileName());
@@ -41,96 +39,74 @@ void        listDir(const char* dirname)
   }
 }
 
-void readFile(const char* path)
-{
+void readFile(const char* path) {
   Serial.printf("Reading file: %s\n", path);
 
   File file = LittleFS.open(path, "r");
-  if (!file)
-  {
+  if (!file) {
     Serial.println("Failed to open file for reading");
     return;
   }
 
   Serial.print("Read from file: ");
-  while (file.available())
-  {
+  while (file.available()) {
     Serial.write(file.read());
   }
   file.close();
 }
 
-void writeFile(const char* path, const char* message)
-{
+void writeFile(const char* path, const char* message) {
   Serial.printf("Writing file: %s\n", path);
 
   File file = LittleFS.open(path, "w");
-  if (!file)
-  {
+  if (!file) {
     Serial.println("Failed to open file for writing");
     return;
   }
-  if (file.print(message))
-  {
+  if (file.print(message)) {
     Serial.println("File written");
-  }
-  else
-  {
+  } else {
     Serial.println("Write failed");
   }
   delay(2000);  // Make sure the CREATE and LASTWRITE times are different
   file.close();
 }
 
-void appendFile(const char* path, const char* message)
-{
+void appendFile(const char* path, const char* message) {
   Serial.printf("Appending to file: %s\n", path);
 
   File file = LittleFS.open(path, "a");
-  if (!file)
-  {
+  if (!file) {
     Serial.println("Failed to open file for appending");
     return;
   }
-  if (file.print(message))
-  {
+  if (file.print(message)) {
     Serial.println("Message appended");
-  }
-  else
-  {
+  } else {
     Serial.println("Append failed");
   }
   file.close();
 }
 
-void renameFile(const char* path1, const char* path2)
-{
+void renameFile(const char* path1, const char* path2) {
   Serial.printf("Renaming file %s to %s\n", path1, path2);
-  if (LittleFS.rename(path1, path2))
-  {
+  if (LittleFS.rename(path1, path2)) {
     Serial.println("File renamed");
-  }
-  else
-  {
+  } else {
     Serial.println("Rename failed");
   }
 }
 
-void deleteFile(const char* path)
-{
+void deleteFile(const char* path) {
   Serial.printf("Deleting file: %s\n", path);
-  if (LittleFS.remove(path))
-  {
+  if (LittleFS.remove(path)) {
     Serial.println("File deleted");
-  }
-  else
-  {
+  } else {
     Serial.println("Delete failed");
   }
 }
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   // We start by connecting to a WiFi network
   Serial.println();
@@ -140,8 +116,7 @@ void setup()
 
   WiFi.begin(ssid, pass);
 
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -159,8 +134,7 @@ void setup()
   Serial.println("Formatting LittleFS filesystem");
   LittleFS.format();
   Serial.println("Mount LittleFS");
-  if (!LittleFS.begin())
-  {
+  if (!LittleFS.begin()) {
     Serial.println("LittleFS mount failed");
     return;
   }
@@ -176,8 +150,7 @@ void setup()
   Serial.println("Timestamp should be valid, data should be good.");
   LittleFS.end();
   Serial.println("Now mount it");
-  if (!LittleFS.begin())
-  {
+  if (!LittleFS.begin()) {
     Serial.println("LittleFS mount failed");
     return;
   }
diff --git a/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino b/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
index 43b648a0fb..47963b177f 100644
--- a/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
+++ b/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
@@ -15,64 +15,48 @@
 #define TESTSIZEKB 512
 
 // Format speed in bytes/second.  Static buffer so not re-entrant safe
-const char* rate(unsigned long start, unsigned long stop, unsigned long bytes)
-{
+const char* rate(unsigned long start, unsigned long stop, unsigned long bytes) {
   static char buff[64];
-  if (stop == start)
-  {
+  if (stop == start) {
     strcpy_P(buff, PSTR("Inf b/s"));
-  }
-  else
-  {
+  } else {
     unsigned long delta = stop - start;
     float         r     = 1000.0 * (float)bytes / (float)delta;
-    if (r >= 1000000.0)
-    {
+    if (r >= 1000000.0) {
       sprintf_P(buff, PSTR("%0.2f MB/s"), r / 1000000.0);
-    }
-    else if (r >= 1000.0)
-    {
+    } else if (r >= 1000.0) {
       sprintf_P(buff, PSTR("%0.2f KB/s"), r / 1000.0);
-    }
-    else
-    {
+    } else {
       sprintf_P(buff, PSTR("%d bytes/s"), (int)r);
     }
   }
   return buff;
 }
 
-void DoTest(FS* fs)
-{
-  if (!fs->format())
-  {
+void DoTest(FS* fs) {
+  if (!fs->format()) {
     Serial.printf("Unable to format(), aborting\n");
     return;
   }
-  if (!fs->begin())
-  {
+  if (!fs->begin()) {
     Serial.printf("Unable to begin(), aborting\n");
     return;
   }
 
   uint8_t data[256];
-  for (int i = 0; i < 256; i++)
-  {
+  for (int i = 0; i < 256; i++) {
     data[i] = (uint8_t)i;
   }
 
   Serial.printf("Creating %dKB file, may take a while...\n", TESTSIZEKB);
   unsigned long start = millis();
   File          f     = fs->open("/testwrite.bin", "w");
-  if (!f)
-  {
+  if (!f) {
     Serial.printf("Unable to open file for writing, aborting\n");
     return;
   }
-  for (int i = 0; i < TESTSIZEKB; i++)
-  {
-    for (int j = 0; j < 4; j++)
-    {
+  for (int i = 0; i < TESTSIZEKB; i++) {
+    for (int j = 0; j < 4; j++) {
       f.write(data, 256);
     }
   }
@@ -87,10 +71,8 @@ void DoTest(FS* fs)
   Serial.printf("Reading %dKB file sequentially in 256b chunks\n", TESTSIZEKB);
   start = millis();
   f     = fs->open("/testwrite.bin", "r");
-  for (int i = 0; i < TESTSIZEKB; i++)
-  {
-    for (int j = 0; j < 4; j++)
-    {
+  for (int i = 0; i < TESTSIZEKB; i++) {
+    for (int j = 0; j < 4; j++) {
       f.read(data, 256);
     }
   }
@@ -102,10 +84,8 @@ void DoTest(FS* fs)
   start = millis();
   f     = fs->open("/testwrite.bin", "r");
   f.read();
-  for (int i = 0; i < TESTSIZEKB; i++)
-  {
-    for (int j = 0; j < 4; j++)
-    {
+  for (int i = 0; i < TESTSIZEKB; i++) {
+    for (int j = 0; j < 4; j++) {
       f.read(data + 1, 256);
     }
   }
@@ -116,17 +96,13 @@ void DoTest(FS* fs)
   Serial.printf("Reading %dKB file in reverse by 256b chunks\n", TESTSIZEKB);
   start = millis();
   f     = fs->open("/testwrite.bin", "r");
-  for (int i = 0; i < TESTSIZEKB; i++)
-  {
-    for (int j = 0; j < 4; j++)
-    {
-      if (!f.seek(256 + 256 * j * i, SeekEnd))
-      {
+  for (int i = 0; i < TESTSIZEKB; i++) {
+    for (int j = 0; j < 4; j++) {
+      if (!f.seek(256 + 256 * j * i, SeekEnd)) {
         Serial.printf("Unable to seek to %d, aborting\n", -256 - 256 * j * i);
         return;
       }
-      if (256 != f.read(data, 256))
-      {
+      if (256 != f.read(data, 256)) {
         Serial.printf("Unable to read 256 bytes, aborting\n");
         return;
       }
@@ -139,8 +115,7 @@ void DoTest(FS* fs)
   Serial.printf("Writing 64K file in 1-byte chunks\n");
   start = millis();
   f     = fs->open("/test1b.bin", "w");
-  for (int i = 0; i < 65536; i++)
-  {
+  for (int i = 0; i < 65536; i++) {
     f.write((uint8_t*)&i, 1);
   }
   f.close();
@@ -150,8 +125,7 @@ void DoTest(FS* fs)
   Serial.printf("Reading 64K file in 1-byte chunks\n");
   start = millis();
   f     = fs->open("/test1b.bin", "r");
-  for (int i = 0; i < 65536; i++)
-  {
+  for (int i = 0; i < 65536; i++) {
     char c;
     f.read((uint8_t*)&c, 1);
   }
@@ -169,8 +143,7 @@ void DoTest(FS* fs)
   f.close();
 }
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.printf("Beginning test\n");
   Serial.flush();
@@ -178,7 +151,6 @@ void setup()
   Serial.println("done");
 }
 
-void loop()
-{
+void loop() {
   delay(10000);
 }
diff --git a/libraries/Netdump/examples/Netdump/Netdump.ino b/libraries/Netdump/examples/Netdump/Netdump.ino
index 931fa14f17..6d7975616f 100644
--- a/libraries/Netdump/examples/Netdump/Netdump.ino
+++ b/libraries/Netdump/examples/Netdump/Netdump.ino
@@ -15,46 +15,41 @@ using namespace NetCapture;
 #define STAPSK "your-password"
 #endif
 
-const char*               ssid     = STASSID;
-const char*               password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
-Netdump                   nd;
+Netdump nd;
 
 //FS* filesystem = &SPIFFS;
-FS*                       filesystem = &LittleFS;
+FS* filesystem = &LittleFS;
 
-ESP8266WebServer          webServer(80);    // Used for sending commands
-WiFiServer                tcpServer(8000);  // Used to show netcat option.
-File                      tracefile;
+ESP8266WebServer webServer(80);    // Used for sending commands
+WiFiServer       tcpServer(8000);  // Used to show netcat option.
+File             tracefile;
 
 std::map<PacketType, int> packetCount;
 
-enum class SerialOption : uint8_t
-{
+enum class SerialOption : uint8_t {
   AllFull,
   LocalNone,
   HTTPChar
 };
 
-void startSerial(SerialOption option)
-{
-  switch (option)
-  {
+void startSerial(SerialOption option) {
+  switch (option) {
     case SerialOption::AllFull:  //All Packets, show packet summary.
       nd.printDump(Serial, Packet::PacketDetail::FULL);
       break;
 
     case SerialOption::LocalNone:  // Only local IP traffic, full details
       nd.printDump(Serial, Packet::PacketDetail::NONE,
-                   [](Packet n)
-                   {
+                   [](Packet n) {
                      return (n.hasIP(WiFi.localIP()));
                    });
       break;
     case SerialOption::HTTPChar:  // Only HTTP traffic, show packet content as chars
       nd.printDump(Serial, Packet::PacketDetail::CHAR,
-                   [](Packet n)
-                   {
+                   [](Packet n) {
                      return (n.isHTTP());
                    });
       break;
@@ -63,66 +58,56 @@ void startSerial(SerialOption option)
   };
 }
 
-void startTracefile()
-{
+void startTracefile() {
   // To file all traffic, format pcap file
   tracefile = filesystem->open("/tr.pcap", "w");
   nd.fileDump(tracefile);
 }
 
-void startTcpDump()
-{
+void startTcpDump() {
   // To tcpserver, all traffic.
   tcpServer.begin();
   nd.tcpDump(tcpServer);
 }
 
-void setup(void)
-{
+void setup(void) {
   Serial.begin(115200);
 
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
 
-  if (WiFi.waitForConnectResult() != WL_CONNECTED)
-  {
+  if (WiFi.waitForConnectResult() != WL_CONNECTED) {
     Serial.println("WiFi Failed, stopping sketch");
-    while (1)
-    {
+    while (1) {
       delay(1000);
     }
   }
 
-  if (!MDNS.begin("netdumphost"))
-  {
+  if (!MDNS.begin("netdumphost")) {
     Serial.println("Error setting up MDNS responder!");
   }
 
   filesystem->begin();
 
   webServer.on("/list",
-               []()
-               {
+               []() {
                  Dir    dir = filesystem->openDir("/");
                  String d   = "<h1>File list</h1>";
-                 while (dir.next())
-                 {
+                 while (dir.next()) {
                    d.concat("<li>" + dir.fileName() + "</li>");
                  }
                  webServer.send(200, "text.html", d);
                });
 
   webServer.on("/req",
-               []()
-               {
+               []() {
                  static int rq = 0;
                  String     a  = "<h1>You are connected, Number of requests = " + String(rq++) + "</h1>";
                  webServer.send(200, "text/html", a);
                });
 
   webServer.on("/reset",
-               []()
-               {
+               []() {
                  nd.reset();
                  tracefile.close();
                  tcpServer.close();
@@ -159,8 +144,7 @@ void setup(void)
   */
 }
 
-void loop(void)
-{
+void loop(void) {
   webServer.handleClient();
   MDNS.update();
 }
diff --git a/libraries/Netdump/src/Netdump.cpp b/libraries/Netdump/src/Netdump.cpp
index f14b4bb9a0..6af00c4f20 100644
--- a/libraries/Netdump/src/Netdump.cpp
+++ b/libraries/Netdump/src/Netdump.cpp
@@ -137,8 +137,8 @@ void Netdump::printDumpProcess(Print& out, Packet::PacketDetail ndd, const Packe
 
 void Netdump::fileDumpProcess(File& outfile, const Packet& np) const
 {
-    size_t         incl_len = np.getPacketSize() > maxPcapLength ? maxPcapLength : np.getPacketSize();
-    uint32_t       pcapHeader[4];
+    size_t   incl_len = np.getPacketSize() > maxPcapLength ? maxPcapLength : np.getPacketSize();
+    uint32_t pcapHeader[4];
 
     struct timeval tv;
     gettimeofday(&tv, nullptr);
diff --git a/libraries/Netdump/src/Netdump.h b/libraries/Netdump/src/Netdump.h
index 36bfda434f..28360864a7 100644
--- a/libraries/Netdump/src/Netdump.h
+++ b/libraries/Netdump/src/Netdump.h
@@ -54,29 +54,29 @@ class Netdump
     bool tcpDump(WiFiServer& tcpDumpServer, const Filter nf = nullptr);
 
 private:
-    Callback                                    netDumpCallback = nullptr;
-    Filter                                      netDumpFilter   = nullptr;
+    Callback netDumpCallback = nullptr;
+    Filter   netDumpFilter   = nullptr;
 
     static void                                 capture(int netif_idx, const char* data, size_t len, int out, int success);
     static CallBackList<LwipCallback>           lwipCallback;
     CallBackList<LwipCallback>::CallBackHandler lwipHandler;
 
-    void                                        netdumpCapture(int netif_idx, const char* data, size_t len, int out, int success);
+    void netdumpCapture(int netif_idx, const char* data, size_t len, int out, int success);
 
-    void                                        printDumpProcess(Print& out, Packet::PacketDetail ndd, const Packet& np) const;
-    void                                        fileDumpProcess(File& outfile, const Packet& np) const;
-    void                                        tcpDumpProcess(const Packet& np);
-    void                                        tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf);
+    void printDumpProcess(Print& out, Packet::PacketDetail ndd, const Packet& np) const;
+    void fileDumpProcess(File& outfile, const Packet& np) const;
+    void tcpDumpProcess(const Packet& np);
+    void tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf);
 
-    void                                        writePcapHeader(Stream& s) const;
+    void writePcapHeader(Stream& s) const;
 
-    WiFiClient                                  tcpDumpClient;
-    char*                                       packetBuffer  = nullptr;
-    int                                         bufferIndex   = 0;
+    WiFiClient tcpDumpClient;
+    char*      packetBuffer = nullptr;
+    int        bufferIndex  = 0;
 
-    static constexpr int                        tcpBufferSize = 2048;
-    static constexpr int                        maxPcapLength = 1024;
-    static constexpr uint32_t                   pcapMagic     = 0xa1b2c3d4;
+    static constexpr int      tcpBufferSize = 2048;
+    static constexpr int      maxPcapLength = 1024;
+    static constexpr uint32_t pcapMagic     = 0xa1b2c3d4;
 };
 
 }  // namespace NetCapture
diff --git a/libraries/Netdump/src/NetdumpIP.h b/libraries/Netdump/src/NetdumpIP.h
index e23963f347..41b1677869 100644
--- a/libraries/Netdump/src/NetdumpIP.h
+++ b/libraries/Netdump/src/NetdumpIP.h
@@ -30,7 +30,7 @@ class NetdumpIP
         return rawip[index];
     }
 
-    bool   fromString(const char* address);
+    bool fromString(const char* address);
 
     String toString();
 
@@ -41,11 +41,11 @@ class NetdumpIP
         IPV4,
         IPV6
     };
-    IPversion ipv       = IPversion::UNSET;
+    IPversion ipv = IPversion::UNSET;
 
-    uint8_t   rawip[16] = { 0 };
+    uint8_t rawip[16] = { 0 };
 
-    void      setV4()
+    void setV4()
     {
         ipv = IPversion::IPV4;
     };
@@ -74,12 +74,12 @@ class NetdumpIP
         return (ipv != IPversion::UNSET);
     };
 
-    bool   compareRaw(IPversion v, const uint8_t* a, const uint8_t* b) const;
-    bool   compareIP(const IPAddress& ip) const;
-    bool   compareIP(const NetdumpIP& nip) const;
+    bool compareRaw(IPversion v, const uint8_t* a, const uint8_t* b) const;
+    bool compareIP(const IPAddress& ip) const;
+    bool compareIP(const NetdumpIP& nip) const;
 
-    bool   fromString4(const char* address);
-    bool   fromString6(const char* address);
+    bool fromString4(const char* address);
+    bool fromString6(const char* address);
 
     size_t printTo(Print& p);
 
diff --git a/libraries/Netdump/src/NetdumpPacket.cpp b/libraries/Netdump/src/NetdumpPacket.cpp
index 44a2e614be..e3243cc887 100644
--- a/libraries/Netdump/src/NetdumpPacket.cpp
+++ b/libraries/Netdump/src/NetdumpPacket.cpp
@@ -33,7 +33,7 @@ void Packet::printDetail(Print& out, const String& indent, const char* data, siz
 
     uint16_t charCount = (pd == PacketDetail::CHAR) ? 80 : 24;
 
-    size_t   start     = 0;
+    size_t start = 0;
     while (start < size)
     {
         size_t end = start + charCount;
diff --git a/libraries/Netdump/src/NetdumpPacket.h b/libraries/Netdump/src/NetdumpPacket.h
index d1a6e59ab1..1c11f4ee84 100644
--- a/libraries/Netdump/src/NetdumpPacket.h
+++ b/libraries/Netdump/src/NetdumpPacket.h
@@ -274,26 +274,26 @@ class Packet
         return (isIP() && ((getSrcPort() == p) || (getDstPort() == p)));
     }
 
-    const String                   toString() const;
-    const String                   toString(PacketDetail netdumpDetail) const;
-    void                           printDetail(Print& out, const String& indent, const char* data, size_t size, PacketDetail pd) const;
+    const String toString() const;
+    const String toString(PacketDetail netdumpDetail) const;
+    void         printDetail(Print& out, const String& indent, const char* data, size_t size, PacketDetail pd) const;
 
     const PacketType               packetType() const;
     const std::vector<PacketType>& allPacketTypes() const;
 
 private:
-    void                    setPacketType(PacketType);
-    void                    setPacketTypes();
+    void setPacketType(PacketType);
+    void setPacketTypes();
 
-    void                    MACtoString(int dataIdx, StreamString& sstr) const;
-    void                    ARPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
-    void                    DNStoString(PacketDetail netdumpDetail, StreamString& sstr) const;
-    void                    UDPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
-    void                    TCPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
-    void                    ICMPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
-    void                    IGMPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
-    void                    IPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
-    void                    UKNWtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void MACtoString(int dataIdx, StreamString& sstr) const;
+    void ARPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void DNStoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void UDPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void TCPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void ICMPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void IGMPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void IPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
+    void UKNWtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
 
     time_t                  packetTime;
     int                     netif_idx;
diff --git a/libraries/SD/examples/Datalogger/Datalogger.ino b/libraries/SD/examples/Datalogger/Datalogger.ino
index 4a6147aee2..d75a2e1c8e 100644
--- a/libraries/SD/examples/Datalogger/Datalogger.ino
+++ b/libraries/SD/examples/Datalogger/Datalogger.ino
@@ -25,16 +25,14 @@
 
 const int chipSelect = 4;
 
-void      setup()
-{
+void setup() {
   // Open serial communications and wait for port to open:
   Serial.begin(115200);
 
   Serial.print("Initializing SD card...");
 
   // see if the card is present and can be initialized:
-  if (!SD.begin(chipSelect))
-  {
+  if (!SD.begin(chipSelect)) {
     Serial.println("Card failed, or not present");
     // don't do anything more:
     return;
@@ -42,18 +40,15 @@ void      setup()
   Serial.println("card initialized.");
 }
 
-void loop()
-{
+void loop() {
   // make a string for assembling the data to log:
   String dataString = "";
 
   // read three sensors and append to the string:
-  for (int analogPin = 0; analogPin < 3; analogPin++)
-  {
+  for (int analogPin = 0; analogPin < 3; analogPin++) {
     int sensor = analogRead(analogPin);
     dataString += String(sensor);
-    if (analogPin < 2)
-    {
+    if (analogPin < 2) {
       dataString += ",";
     }
   }
@@ -63,16 +58,14 @@ void loop()
   File dataFile = SD.open("datalog.txt", FILE_WRITE);
 
   // if the file is available, write to it:
-  if (dataFile)
-  {
+  if (dataFile) {
     dataFile.println(dataString);
     dataFile.close();
     // print to the serial port too:
     Serial.println(dataString);
   }
   // if the file isn't open, pop up an error:
-  else
-  {
+  else {
     Serial.println("error opening datalog.txt");
   }
 }
diff --git a/libraries/SD/examples/DumpFile/DumpFile.ino b/libraries/SD/examples/DumpFile/DumpFile.ino
index be5a026394..038cfc1c01 100644
--- a/libraries/SD/examples/DumpFile/DumpFile.ino
+++ b/libraries/SD/examples/DumpFile/DumpFile.ino
@@ -25,16 +25,14 @@
 
 const int chipSelect = 4;
 
-void      setup()
-{
+void setup() {
   // Open serial communications and wait for port to open:
   Serial.begin(115200);
 
   Serial.print("Initializing SD card...");
 
   // see if the card is present and can be initialized:
-  if (!SD.begin(chipSelect))
-  {
+  if (!SD.begin(chipSelect)) {
     Serial.println("Card failed, or not present");
     // don't do anything more:
     return;
@@ -46,21 +44,17 @@ void      setup()
   File dataFile = SD.open("datalog.txt");
 
   // if the file is available, write to it:
-  if (dataFile)
-  {
-    while (dataFile.available())
-    {
+  if (dataFile) {
+    while (dataFile.available()) {
       Serial.write(dataFile.read());
     }
     dataFile.close();
   }
   // if the file isn't open, pop up an error:
-  else
-  {
+  else {
     Serial.println("error opening datalog.txt");
   }
 }
 
-void loop()
-{
+void loop() {
 }
diff --git a/libraries/SD/examples/Files/Files.ino b/libraries/SD/examples/Files/Files.ino
index bb4bbd7abe..f162837dcf 100644
--- a/libraries/SD/examples/Files/Files.ino
+++ b/libraries/SD/examples/Files/Files.ino
@@ -22,26 +22,21 @@
 
 File myFile;
 
-void setup()
-{
+void setup() {
   // Open serial communications and wait for port to open:
   Serial.begin(115200);
 
   Serial.print("Initializing SD card...");
 
-  if (!SD.begin(4))
-  {
+  if (!SD.begin(4)) {
     Serial.println("initialization failed!");
     return;
   }
   Serial.println("initialization done.");
 
-  if (SD.exists("example.txt"))
-  {
+  if (SD.exists("example.txt")) {
     Serial.println("example.txt exists.");
-  }
-  else
-  {
+  } else {
     Serial.println("example.txt doesn't exist.");
   }
 
@@ -51,12 +46,9 @@ void setup()
   myFile.close();
 
   // Check to see if the file exists:
-  if (SD.exists("example.txt"))
-  {
+  if (SD.exists("example.txt")) {
     Serial.println("example.txt exists.");
-  }
-  else
-  {
+  } else {
     Serial.println("example.txt doesn't exist.");
   }
 
@@ -64,17 +56,13 @@ void setup()
   Serial.println("Removing example.txt...");
   SD.remove("example.txt");
 
-  if (SD.exists("example.txt"))
-  {
+  if (SD.exists("example.txt")) {
     Serial.println("example.txt exists.");
-  }
-  else
-  {
+  } else {
     Serial.println("example.txt doesn't exist.");
   }
 }
 
-void loop()
-{
+void loop() {
   // nothing happens after setup finishes.
 }
diff --git a/libraries/SD/examples/ReadWrite/ReadWrite.ino b/libraries/SD/examples/ReadWrite/ReadWrite.ino
index e738fbb4b0..680bb33296 100644
--- a/libraries/SD/examples/ReadWrite/ReadWrite.ino
+++ b/libraries/SD/examples/ReadWrite/ReadWrite.ino
@@ -23,15 +23,13 @@
 
 File myFile;
 
-void setup()
-{
+void setup() {
   // Open serial communications and wait for port to open:
   Serial.begin(115200);
 
   Serial.print("Initializing SD card...");
 
-  if (!SD.begin(4))
-  {
+  if (!SD.begin(4)) {
     Serial.println("initialization failed!");
     return;
   }
@@ -42,42 +40,34 @@ void setup()
   myFile = SD.open("test.txt", FILE_WRITE);
 
   // if the file opened okay, write to it:
-  if (myFile)
-  {
+  if (myFile) {
     Serial.print("Writing to test.txt...");
     myFile.println("testing 1, 2, 3.");
     // close the file:
     myFile.close();
     Serial.println("done.");
-  }
-  else
-  {
+  } else {
     // if the file didn't open, print an error:
     Serial.println("error opening test.txt");
   }
 
   // re-open the file for reading:
   myFile = SD.open("test.txt");
-  if (myFile)
-  {
+  if (myFile) {
     Serial.println("test.txt:");
 
     // read from the file until there's nothing else in it:
-    while (myFile.available())
-    {
+    while (myFile.available()) {
       Serial.write(myFile.read());
     }
     // close the file:
     myFile.close();
-  }
-  else
-  {
+  } else {
     // if the file didn't open, print an error:
     Serial.println("error opening test.txt");
   }
 }
 
-void loop()
-{
+void loop() {
   // nothing happens after setup
 }
diff --git a/libraries/SD/examples/listfiles/listfiles.ino b/libraries/SD/examples/listfiles/listfiles.ino
index 56403560fa..9ce85c26ae 100644
--- a/libraries/SD/examples/listfiles/listfiles.ino
+++ b/libraries/SD/examples/listfiles/listfiles.ino
@@ -26,15 +26,13 @@
 
 File root;
 
-void setup()
-{
+void setup() {
   // Open serial communications and wait for port to open:
   Serial.begin(115200);
 
   Serial.print("Initializing SD card...");
 
-  if (!SD.begin(SS))
-  {
+  if (!SD.begin(SS)) {
     Serial.println("initialization failed!");
     return;
   }
@@ -47,33 +45,25 @@ void setup()
   Serial.println("done!");
 }
 
-void loop()
-{
+void loop() {
   // nothing happens after setup finishes.
 }
 
-void printDirectory(File dir, int numTabs)
-{
-  while (true)
-  {
+void printDirectory(File dir, int numTabs) {
+  while (true) {
     File entry = dir.openNextFile();
-    if (!entry)
-    {
+    if (!entry) {
       // no more files
       break;
     }
-    for (uint8_t i = 0; i < numTabs; i++)
-    {
+    for (uint8_t i = 0; i < numTabs; i++) {
       Serial.print('\t');
     }
     Serial.print(entry.name());
-    if (entry.isDirectory())
-    {
+    if (entry.isDirectory()) {
       Serial.println("/");
       printDirectory(entry, numTabs + 1);
-    }
-    else
-    {
+    } else {
       // files have sizes, directories do not
       Serial.print("\t\t");
       Serial.print(entry.size(), DEC);
diff --git a/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino b/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
index 9fb1c274d6..93ea348cc6 100644
--- a/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
+++ b/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
@@ -16,22 +16,19 @@
 */
 #include <SPI.h>
 
-class ESPMaster
-{
+class ESPMaster {
   private:
   uint8_t _ss_pin;
 
   public:
   ESPMaster(uint8_t pin) :
       _ss_pin(pin) { }
-  void begin()
-  {
+  void begin() {
     pinMode(_ss_pin, OUTPUT);
     digitalWrite(_ss_pin, HIGH);
   }
 
-  uint32_t readStatus()
-  {
+  uint32_t readStatus() {
     digitalWrite(_ss_pin, LOW);
     SPI.transfer(0x04);
     uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
@@ -39,8 +36,7 @@ class ESPMaster
     return status;
   }
 
-  void writeStatus(uint32_t status)
-  {
+  void writeStatus(uint32_t status) {
     digitalWrite(_ss_pin, LOW);
     SPI.transfer(0x01);
     SPI.transfer(status & 0xFF);
@@ -50,53 +46,45 @@ class ESPMaster
     digitalWrite(_ss_pin, HIGH);
   }
 
-  void readData(uint8_t* data)
-  {
+  void readData(uint8_t* data) {
     digitalWrite(_ss_pin, LOW);
     SPI.transfer(0x03);
     SPI.transfer(0x00);
-    for (uint8_t i = 0; i < 32; i++)
-    {
+    for (uint8_t i = 0; i < 32; i++) {
       data[i] = SPI.transfer(0);
     }
     digitalWrite(_ss_pin, HIGH);
   }
 
-  void writeData(uint8_t* data, size_t len)
-  {
+  void writeData(uint8_t* data, size_t len) {
     uint8_t i = 0;
     digitalWrite(_ss_pin, LOW);
     SPI.transfer(0x02);
     SPI.transfer(0x00);
-    while (len-- && i < 32)
-    {
+    while (len-- && i < 32) {
       SPI.transfer(data[i++]);
     }
-    while (i++ < 32)
-    {
+    while (i++ < 32) {
       SPI.transfer(0);
     }
     digitalWrite(_ss_pin, HIGH);
   }
 
-  String readData()
-  {
+  String readData() {
     char data[33];
     data[32] = 0;
     readData((uint8_t*)data);
     return String(data);
   }
 
-  void writeData(const char* data)
-  {
+  void writeData(const char* data) {
     writeData((uint8_t*)data, strlen(data));
   }
 };
 
 ESPMaster esp(SS);
 
-void      send(const char* message)
-{
+void send(const char* message) {
   Serial.print("Master: ");
   Serial.println(message);
   esp.writeData(message);
@@ -106,8 +94,7 @@ void      send(const char* message)
   Serial.println();
 }
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   SPI.begin();
   esp.begin();
@@ -115,8 +102,7 @@ void setup()
   send("Hello Slave!");
 }
 
-void loop()
-{
+void loop() {
   delay(1000);
   send("Are you alive?");
 }
diff --git a/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino b/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
index 778d1aa0ea..0da735fc74 100644
--- a/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
+++ b/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
@@ -17,12 +17,10 @@
 */
 #include <SPI.h>
 
-class ESPSafeMaster
-{
+class ESPSafeMaster {
   private:
   uint8_t _ss_pin;
-  void    _pulseSS()
-  {
+  void    _pulseSS() {
     digitalWrite(_ss_pin, HIGH);
     delayMicroseconds(5);
     digitalWrite(_ss_pin, LOW);
@@ -31,14 +29,12 @@ class ESPSafeMaster
   public:
   ESPSafeMaster(uint8_t pin) :
       _ss_pin(pin) { }
-  void begin()
-  {
+  void begin() {
     pinMode(_ss_pin, OUTPUT);
     _pulseSS();
   }
 
-  uint32_t readStatus()
-  {
+  uint32_t readStatus() {
     _pulseSS();
     SPI.transfer(0x04);
     uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
@@ -46,8 +42,7 @@ class ESPSafeMaster
     return status;
   }
 
-  void writeStatus(uint32_t status)
-  {
+  void writeStatus(uint32_t status) {
     _pulseSS();
     SPI.transfer(0x01);
     SPI.transfer(status & 0xFF);
@@ -57,53 +52,45 @@ class ESPSafeMaster
     _pulseSS();
   }
 
-  void readData(uint8_t* data)
-  {
+  void readData(uint8_t* data) {
     _pulseSS();
     SPI.transfer(0x03);
     SPI.transfer(0x00);
-    for (uint8_t i = 0; i < 32; i++)
-    {
+    for (uint8_t i = 0; i < 32; i++) {
       data[i] = SPI.transfer(0);
     }
     _pulseSS();
   }
 
-  void writeData(uint8_t* data, size_t len)
-  {
+  void writeData(uint8_t* data, size_t len) {
     uint8_t i = 0;
     _pulseSS();
     SPI.transfer(0x02);
     SPI.transfer(0x00);
-    while (len-- && i < 32)
-    {
+    while (len-- && i < 32) {
       SPI.transfer(data[i++]);
     }
-    while (i++ < 32)
-    {
+    while (i++ < 32) {
       SPI.transfer(0);
     }
     _pulseSS();
   }
 
-  String readData()
-  {
+  String readData() {
     char data[33];
     data[32] = 0;
     readData((uint8_t*)data);
     return String(data);
   }
 
-  void writeData(const char* data)
-  {
+  void writeData(const char* data) {
     writeData((uint8_t*)data, strlen(data));
   }
 };
 
 ESPSafeMaster esp(SS);
 
-void          send(const char* message)
-{
+void send(const char* message) {
   Serial.print("Master: ");
   Serial.println(message);
   esp.writeData(message);
@@ -113,8 +100,7 @@ void          send(const char* message)
   Serial.println();
 }
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   SPI.begin();
   esp.begin();
@@ -122,8 +108,7 @@ void setup()
   send("Hello Slave!");
 }
 
-void loop()
-{
+void loop() {
   delay(1000);
   send("Are you alive?");
 }
diff --git a/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino b/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
index f84f883353..89fe7d2dd4 100644
--- a/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
+++ b/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
@@ -17,52 +17,42 @@
 
 #include "SPISlave.h"
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.setDebugOutput(true);
 
   // data has been received from the master. Beware that len is always 32
   // and the buffer is autofilled with zeroes if data is less than 32 bytes long
   // It's up to the user to implement protocol for handling data length
-  SPISlave.onData([](uint8_t* data, size_t len)
-                  {
-                    String message = String((char*)data);
-                    (void)len;
-                    if (message.equals("Hello Slave!"))
-                    {
-                      SPISlave.setData("Hello Master!");
-                    }
-                    else if (message.equals("Are you alive?"))
-                    {
-                      char answer[33];
-                      sprintf(answer, "Alive for %lu seconds!", millis() / 1000);
-                      SPISlave.setData(answer);
-                    }
-                    else
-                    {
-                      SPISlave.setData("Say what?");
-                    }
-                    Serial.printf("Question: %s\n", (char*)data);
-                  });
+  SPISlave.onData([](uint8_t* data, size_t len) {
+    String message = String((char*)data);
+    (void)len;
+    if (message.equals("Hello Slave!")) {
+      SPISlave.setData("Hello Master!");
+    } else if (message.equals("Are you alive?")) {
+      char answer[33];
+      sprintf(answer, "Alive for %lu seconds!", millis() / 1000);
+      SPISlave.setData(answer);
+    } else {
+      SPISlave.setData("Say what?");
+    }
+    Serial.printf("Question: %s\n", (char*)data);
+  });
 
   // The master has read out outgoing data buffer
   // that buffer can be set with SPISlave.setData
-  SPISlave.onDataSent([]()
-                      { Serial.println("Answer Sent"); });
+  SPISlave.onDataSent([]() { Serial.println("Answer Sent"); });
 
   // status has been received from the master.
   // The status register is a special register that bot the slave and the master can write to and read from.
   // Can be used to exchange small data or status information
-  SPISlave.onStatus([](uint32_t data)
-                    {
-                      Serial.printf("Status: %u\n", data);
-                      SPISlave.setStatus(millis());  //set next status
-                    });
+  SPISlave.onStatus([](uint32_t data) {
+    Serial.printf("Status: %u\n", data);
+    SPISlave.setStatus(millis());  //set next status
+  });
 
   // The master has read the status register
-  SPISlave.onStatusSent([]()
-                        { Serial.println("Status Sent"); });
+  SPISlave.onStatusSent([]() { Serial.println("Status Sent"); });
 
   // Setup SPI Slave registers and pins
   SPISlave.begin();
diff --git a/libraries/Servo/examples/Sweep/Sweep.ino b/libraries/Servo/examples/Sweep/Sweep.ino
index bc9fbcf57d..914709a4cf 100644
--- a/libraries/Servo/examples/Sweep/Sweep.ino
+++ b/libraries/Servo/examples/Sweep/Sweep.ino
@@ -15,24 +15,20 @@
 Servo myservo;  // create servo object to control a servo
 // twelve servo objects can be created on most boards
 
-void  setup()
-{
+void setup() {
   myservo.attach(2);  // attaches the servo on GIO2 to the servo object
 }
 
-void loop()
-{
+void loop() {
   int pos;
 
-  for (pos = 0; pos <= 180; pos += 1)
-  {  // goes from 0 degrees to 180 degrees
+  for (pos = 0; pos <= 180; pos += 1) {  // goes from 0 degrees to 180 degrees
     // in steps of 1 degree
     myservo.write(pos);  // tell servo to go to position in variable 'pos'
     delay(15);           // waits 15ms for the servo to reach the position
   }
-  for (pos = 180; pos >= 0; pos -= 1)
-  {                      // goes from 180 degrees to 0 degrees
-    myservo.write(pos);  // tell servo to go to position in variable 'pos'
-    delay(15);           // waits 15ms for the servo to reach the position
+  for (pos = 180; pos >= 0; pos -= 1) {  // goes from 180 degrees to 0 degrees
+    myservo.write(pos);                  // tell servo to go to position in variable 'pos'
+    delay(15);                           // waits 15ms for the servo to reach the position
   }
 }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino b/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
index 175f231179..29d7c48527 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
@@ -7,8 +7,7 @@
 #include <TFTv2.h>
 #include <SPI.h>
 
-void setup()
-{
+void setup() {
   TFT_BL_ON;  //turn on the background light
 
   Tft.TFTinit();  //init TFT library
@@ -22,8 +21,7 @@ void setup()
   Tft.fillCircle(200, 200, 30, BLUE);  //center: (200, 200), r = 30 ,color : BLUE
 }
 
-void loop()
-{
+void loop() {
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino b/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
index b958b581ae..b2b6d3c293 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
@@ -7,8 +7,7 @@
 #include <stdint.h>
 #include <TFTv2.h>
 #include <SPI.h>
-void setup()
-{
+void setup() {
   TFT_BL_ON;      // turn on the background light
   Tft.TFTinit();  //init TFT library
 
@@ -21,8 +20,7 @@ void setup()
   //start: (30, 60), high: 150, color: blue
 }
 
-void loop()
-{
+void loop() {
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino b/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
index 5ff2e50bab..be303b6988 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
@@ -8,8 +8,7 @@
 #include <TFTv2.h>
 #include <SPI.h>
 
-void setup()
-{
+void setup() {
   TFT_BL_ON;  // turn on the background light
 
   Tft.TFTinit();  // init TFT library
@@ -29,8 +28,7 @@ void setup()
   Tft.drawFloat(1.2345, 4, 0, 250, 4, RED);  // draw a float number: 1.2345 Location: (0, 250), size: 4, decimal: 4, color: RED
 }
 
-void loop()
-{
+void loop() {
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino b/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
index 6837de553e..fe61bae0af 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
@@ -7,8 +7,7 @@
 #include <TFTv2.h>
 #include <SPI.h>
 
-void setup()
-{
+void setup() {
   TFT_BL_ON;      // turn on the background light
   Tft.TFTinit();  // init TFT library
 
@@ -17,8 +16,7 @@ void setup()
   Tft.drawRectangle(100, 170, 120, 60, BLUE);
 }
 
-void loop()
-{
+void loop() {
 }
 /*********************************************************************************************************
   END FILE
diff --git a/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino b/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
index ec62914fa1..41c5ed3306 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
@@ -12,41 +12,34 @@ unsigned int colors[8]        = { BLACK, RED, GREEN, BLUE, CYAN, YELLOW, WHITE,
 // between X+ and X- Use any multimeter to read it
 // The 2.8" TFT Touch shield has 300 ohms across the X plate
 
-TouchScreen  ts               = TouchScreen(XP, YP, XM, YM);  //init TouchScreen port pins
+TouchScreen ts = TouchScreen(XP, YP, XM, YM);  //init TouchScreen port pins
 
-void         setup()
-{
+void setup() {
   Tft.TFTinit();  //init TFT library
   Serial.begin(115200);
   //Draw the pallet
-  for (int i = 0; i < 8; i++)
-  {
+  for (int i = 0; i < 8; i++) {
     Tft.fillRectangle(i * 30, 0, 30, ColorPaletteHigh, colors[i]);
   }
 }
 
-void loop()
-{
+void loop() {
   // a point object holds x y and z coordinates.
   Point p = ts.getPoint();
 
   //map the ADC value read to into pixel coordinates
 
-  p.x     = map(p.x, TS_MINX, TS_MAXX, 0, 240);
-  p.y     = map(p.y, TS_MINY, TS_MAXY, 0, 320);
+  p.x = map(p.x, TS_MINX, TS_MAXX, 0, 240);
+  p.y = map(p.y, TS_MINY, TS_MAXY, 0, 320);
 
   // we have some minimum pressure we consider 'valid'
   // pressure of 0 means no pressing!
 
-  if (p.z > __PRESURE)
-  {
+  if (p.z > __PRESURE) {
     // Detect  paint brush color change
-    if (p.y < ColorPaletteHigh + 2)
-    {
+    if (p.y < ColorPaletteHigh + 2) {
       color = colors[p.x / 30];
-    }
-    else
-    {
+    } else {
       Tft.fillCircle(p.x, p.y, 2, color);
     }
   }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino b/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
index 62591d49e3..185cd0c97a 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
@@ -4,16 +4,13 @@
 #include <TFTv2.h>
 #include <SPI.h>
 
-void setup()
-{
+void setup() {
   TFT_BL_ON;      // turn on the background light
   Tft.TFTinit();  // init TFT library
 }
 
-void loop()
-{
-  for (int r = 0; r < 115; r = r + 2)
-  {                                               //set r : 0--115
+void loop() {
+  for (int r = 0; r < 115; r = r + 2) {           //set r : 0--115
     Tft.drawCircle(119, 160, r, random(0xFFFF));  //draw circle, center:(119, 160), color: random
   }
   delay(10);
diff --git a/libraries/TFT_Touch_Shield_V2/examples/text/text.ino b/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
index 87ff67865b..2d27e11185 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
@@ -7,8 +7,7 @@
 #include <TFTv2.h>
 #include <SPI.h>
 
-void setup()
-{
+void setup() {
   TFT_BL_ON;      // turn on the background light
   Tft.TFTinit();  // init TFT library
 
@@ -27,6 +26,5 @@ void setup()
   Tft.drawString("World!!", 60, 220, 4, WHITE);  // draw string: "world!!", (80, 230), size: 4, color: WHITE
 }
 
-void loop()
-{
+void loop() {
 }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino b/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino
index c7b45f30e6..ab66b5e182 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino
@@ -19,16 +19,16 @@
 #define MAX_BMP 10       // bmp file num
 #define FILENAME_LEN 20  // max file name length
 
-const int     PIN_SD_CS                      = 4;  // pin of sd card
+const int PIN_SD_CS = 4;  // pin of sd card
 
-const int     __Gnbmp_height                 = 320;  // bmp height
-const int     __Gnbmp_width                  = 240;  // bmp width
+const int __Gnbmp_height = 320;  // bmp height
+const int __Gnbmp_width  = 240;  // bmp width
 
-unsigned char __Gnbmp_image_offset           = 0;  // offset
+unsigned char __Gnbmp_image_offset = 0;  // offset
 
-int           __Gnfile_num                   = 3;  // num of file
+int __Gnfile_num = 3;  // num of file
 
-char          __Gsbmp_files[3][FILENAME_LEN] = {
+char __Gsbmp_files[3][FILENAME_LEN] = {
   // add file name here
   "flower.BMP",
   "hibiscus.bmp",
@@ -37,8 +37,7 @@ char          __Gsbmp_files[3][FILENAME_LEN] = {
 
 File bmpFile;
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
 
   pinMode(PIN_SD_CS, OUTPUT);
@@ -49,8 +48,7 @@ void setup()
   Sd2Card card;
   card.init(SPI_FULL_SPEED, PIN_SD_CS);
 
-  if (!SD.begin(PIN_SD_CS))
-  {
+  if (!SD.begin(PIN_SD_CS)) {
     Serial.println("failed!");
     while (1)
       ;  // init fail, die here
@@ -61,20 +59,16 @@ void setup()
   TFT_BL_ON;
 }
 
-void loop()
-{
-  for (unsigned char i = 0; i < __Gnfile_num; i++)
-  {
+void loop() {
+  for (unsigned char i = 0; i < __Gnfile_num; i++) {
     bmpFile = SD.open(__Gsbmp_files[i]);
-    if (!bmpFile)
-    {
+    if (!bmpFile) {
       Serial.println("didn't find image");
       while (1)
         ;
     }
 
-    if (!bmpReadHeader(bmpFile))
-    {
+    if (!bmpReadHeader(bmpFile)) {
       Serial.println("bad bmp");
       return;
     }
@@ -96,26 +90,22 @@ void loop()
 #define BUFFPIXEL 60      // must be a divisor of 240
 #define BUFFPIXEL_X3 180  // BUFFPIXELx3
 
-void bmpdraw(File f, int x, int y)
-{
+void bmpdraw(File f, int x, int y) {
   bmpFile.seek(__Gnbmp_image_offset);
 
   uint32_t time = millis();
 
-  uint8_t  sdbuffer[BUFFPIXEL_X3];  // 3 * pixels to buffer
+  uint8_t sdbuffer[BUFFPIXEL_X3];  // 3 * pixels to buffer
 
-  for (int i = 0; i < __Gnbmp_height; i++)
-  {
-    for (int j = 0; j < (240 / BUFFPIXEL); j++)
-    {
+  for (int i = 0; i < __Gnbmp_height; i++) {
+    for (int j = 0; j < (240 / BUFFPIXEL); j++) {
       bmpFile.read(sdbuffer, BUFFPIXEL_X3);
-      uint8_t      buffidx  = 0;
-      int          offset_x = j * BUFFPIXEL;
+      uint8_t buffidx  = 0;
+      int     offset_x = j * BUFFPIXEL;
 
       unsigned int __color[BUFFPIXEL];
 
-      for (int k = 0; k < BUFFPIXEL; k++)
-      {
+      for (int k = 0; k < BUFFPIXEL; k++) {
         __color[k] = sdbuffer[buffidx + 2] >> 3;                      // read
         __color[k] = __color[k] << 6 | (sdbuffer[buffidx + 1] >> 2);  // green
         __color[k] = __color[k] << 5 | (sdbuffer[buffidx + 0] >> 3);  // blue
@@ -130,8 +120,7 @@ void bmpdraw(File f, int x, int y)
       TFT_DC_HIGH;
       TFT_CS_LOW;
 
-      for (int m = 0; m < BUFFPIXEL; m++)
-      {
+      for (int m = 0; m < BUFFPIXEL; m++) {
         SPI.transfer(__color[m] >> 8);
         SPI.transfer(__color[m]);
       }
@@ -144,14 +133,12 @@ void bmpdraw(File f, int x, int y)
   Serial.println(" ms");
 }
 
-boolean bmpReadHeader(File f)
-{
+boolean bmpReadHeader(File f) {
   // read header
   uint32_t tmp;
   uint8_t  bmpDepth;
 
-  if (read16(f) != 0x4D42)
-  {
+  if (read16(f) != 0x4D42) {
     // magic bytes missing
     return false;
   }
@@ -176,13 +163,11 @@ boolean bmpReadHeader(File f)
   int bmp_width  = read32(f);
   int bmp_height = read32(f);
 
-  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height)
-  {  // if image is not 320x240, return false
+  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) {  // if image is not 320x240, return false
     return false;
   }
 
-  if (read16(f) != 1)
-  {
+  if (read16(f) != 1) {
     return false;
   }
 
@@ -190,8 +175,7 @@ boolean bmpReadHeader(File f)
   Serial.print("bitdepth ");
   Serial.println(bmpDepth, DEC);
 
-  if (read32(f) != 0)
-  {
+  if (read32(f) != 0) {
     // compression not supported!
     return false;
   }
@@ -207,8 +191,7 @@ boolean bmpReadHeader(File f)
 // (the data is stored in little endian format!)
 
 // LITTLE ENDIAN!
-uint16_t read16(File f)
-{
+uint16_t read16(File f) {
   uint16_t d;
   uint8_t  b;
   b = f.read();
@@ -219,8 +202,7 @@ uint16_t read16(File f)
 }
 
 // LITTLE ENDIAN!
-uint32_t read32(File f)
-{
+uint32_t read32(File f) {
   uint32_t d;
   uint16_t b;
 
diff --git a/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino b/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
index 0f3a9caa24..70b2eef3fb 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
@@ -21,12 +21,12 @@
 #define MAX_BMP 10       // bmp file num
 #define FILENAME_LEN 20  // max file name length
 
-const int  PIN_SD_CS            = 4;  // pin of sd card
+const int PIN_SD_CS = 4;  // pin of sd card
 
-const long __Gnbmp_height       = 320;  // bmp height
-const long __Gnbmp_width        = 240;  // bmp width
+const long __Gnbmp_height = 320;  // bmp height
+const long __Gnbmp_width  = 240;  // bmp width
 
-long       __Gnbmp_image_offset = 0;
+long __Gnbmp_image_offset = 0;
 ;
 
 int  __Gnfile_num = 0;                      // num of file
@@ -35,28 +35,23 @@ char __Gsbmp_files[MAX_BMP][FILENAME_LEN];  // file name
 File bmpFile;
 
 // if bmp file return 1, else return 0
-bool checkBMP(char* _name, char r_name[])
-{
+bool checkBMP(char* _name, char r_name[]) {
   int len = 0;
 
-  if (NULL == _name)
-  {
+  if (NULL == _name) {
     return false;
   }
 
-  while (*_name)
-  {
+  while (*_name) {
     r_name[len++] = *(_name++);
-    if (len > FILENAME_LEN)
-    {
+    if (len > FILENAME_LEN) {
       return false;
     }
   }
 
   r_name[len] = '\0';
 
-  if (len < 5)
-  {
+  if (len < 5) {
     return false;
   }
 
@@ -64,8 +59,7 @@ bool checkBMP(char* _name, char r_name[])
   if (r_name[len - 4] == '.'
       && (r_name[len - 3] == 'b' || (r_name[len - 3] == 'B'))
       && (r_name[len - 2] == 'm' || (r_name[len - 2] == 'M'))
-      && (r_name[len - 1] == 'p' || (r_name[len - 1] == 'P')))
-  {
+      && (r_name[len - 1] == 'p' || (r_name[len - 1] == 'P'))) {
     return true;
   }
 
@@ -73,26 +67,21 @@ bool checkBMP(char* _name, char r_name[])
 }
 
 // search root to find bmp file
-void searchDirectory()
-{
+void searchDirectory() {
   File root = SD.open("/");  // root
-  while (true)
-  {
+  while (true) {
     File entry = root.openNextFile();
 
-    if (!entry)
-    {
+    if (!entry) {
       break;
     }
 
-    if (!entry.isDirectory())
-    {
+    if (!entry.isDirectory()) {
       char* ptmp = entry.name();
 
-      char  __Name[20];
+      char __Name[20];
 
-      if (checkBMP(ptmp, __Name))
-      {
+      if (checkBMP(ptmp, __Name)) {
         Serial.println(__Name);
 
         strcpy(__Gsbmp_files[__Gnfile_num++], __Name);
@@ -105,14 +94,12 @@ void searchDirectory()
   Serial.print(__Gnfile_num);
   Serial.println(" file: ");
 
-  for (int i = 0; i < __Gnfile_num; i++)
-  {
+  for (int i = 0; i < __Gnfile_num; i++) {
     Serial.println(__Gsbmp_files[i]);
   }
 }
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
 
   pinMode(PIN_SD_CS, OUTPUT);
@@ -123,8 +110,7 @@ void setup()
   Sd2Card card;
   card.init(SPI_FULL_SPEED, PIN_SD_CS);
 
-  if (!SD.begin(PIN_SD_CS))
-  {
+  if (!SD.begin(PIN_SD_CS)) {
     Serial.println("failed!");
     while (1)
       ;  // init fail, die here
@@ -137,8 +123,7 @@ void setup()
   TFT_BL_ON;
 }
 
-void loop()
-{
+void loop() {
   /*
       static int dirCtrl = 0;
       for(unsigned char i=0; i<__Gnfile_num; i++)
@@ -166,15 +151,13 @@ void loop()
 
   bmpFile = SD.open("pfvm_1.bmp");
 
-  if (!bmpFile)
-  {
+  if (!bmpFile) {
     Serial.println("didn't find image");
     while (1)
       ;
   }
 
-  if (!bmpReadHeader(bmpFile))
-  {
+  if (!bmpReadHeader(bmpFile)) {
     Serial.println("bad bmp");
     return;
   }
@@ -201,35 +184,29 @@ void loop()
 
 // dir - 1: up to down
 // dir - 2: down to up
-void bmpdraw(File f, int x, int y, int dir)
-{
-  if (bmpFile.seek(__Gnbmp_image_offset))
-  {
+void bmpdraw(File f, int x, int y, int dir) {
+  if (bmpFile.seek(__Gnbmp_image_offset)) {
     Serial.print("pos = ");
     Serial.println(bmpFile.position());
   }
 
   uint32_t time = millis();
 
-  uint8_t  sdbuffer[BUFFPIXEL_X3];  // 3 * pixels to buffer
+  uint8_t sdbuffer[BUFFPIXEL_X3];  // 3 * pixels to buffer
 
-  for (int i = 0; i < __Gnbmp_height; i++)
-  {
-    if (dir)
-    {
+  for (int i = 0; i < __Gnbmp_height; i++) {
+    if (dir) {
       bmpFile.seek(__Gnbmp_image_offset + (__Gnbmp_height - 1 - i) * 240 * 3);
     }
 
-    for (int j = 0; j < (240 / BUFFPIXEL); j++)
-    {
+    for (int j = 0; j < (240 / BUFFPIXEL); j++) {
       bmpFile.read(sdbuffer, BUFFPIXEL_X3);
-      uint8_t      buffidx  = 0;
-      int          offset_x = j * BUFFPIXEL;
+      uint8_t buffidx  = 0;
+      int     offset_x = j * BUFFPIXEL;
 
       unsigned int __color[BUFFPIXEL];
 
-      for (int k = 0; k < BUFFPIXEL; k++)
-      {
+      for (int k = 0; k < BUFFPIXEL; k++) {
         __color[k] = sdbuffer[buffidx + 2] >> 3;                      // read
         __color[k] = __color[k] << 6 | (sdbuffer[buffidx + 1] >> 2);  // green
         __color[k] = __color[k] << 5 | (sdbuffer[buffidx + 0] >> 3);  // blue
@@ -239,12 +216,9 @@ void bmpdraw(File f, int x, int y, int dir)
 
       Tft.setCol(offset_x, offset_x + BUFFPIXEL);
 
-      if (dir)
-      {
+      if (dir) {
         Tft.setPage(i, i);
-      }
-      else
-      {
+      } else {
         Tft.setPage(__Gnbmp_height - i - 1, __Gnbmp_height - i - 1);
       }
 
@@ -253,8 +227,7 @@ void bmpdraw(File f, int x, int y, int dir)
       TFT_DC_HIGH;
       TFT_CS_LOW;
 
-      for (int m = 0; m < BUFFPIXEL; m++)
-      {
+      for (int m = 0; m < BUFFPIXEL; m++) {
         SPI.transfer(__color[m] >> 8);
         SPI.transfer(__color[m]);
 
@@ -269,14 +242,12 @@ void bmpdraw(File f, int x, int y, int dir)
   Serial.println(" ms");
 }
 
-boolean bmpReadHeader(File f)
-{
+boolean bmpReadHeader(File f) {
   // read header
   uint32_t tmp;
   uint8_t  bmpDepth;
 
-  if (read16(f) != 0x4D42)
-  {
+  if (read16(f) != 0x4D42) {
     // magic bytes missing
     return false;
   }
@@ -301,13 +272,11 @@ boolean bmpReadHeader(File f)
   int bmp_width  = read32(f);
   int bmp_height = read32(f);
 
-  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height)
-  {  // if image is not 320x240, return false
+  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) {  // if image is not 320x240, return false
     return false;
   }
 
-  if (read16(f) != 1)
-  {
+  if (read16(f) != 1) {
     return false;
   }
 
@@ -315,8 +284,7 @@ boolean bmpReadHeader(File f)
   Serial.print("bitdepth ");
   Serial.println(bmpDepth, DEC);
 
-  if (read32(f) != 0)
-  {
+  if (read32(f) != 0) {
     // compression not supported!
     return false;
   }
@@ -332,8 +300,7 @@ boolean bmpReadHeader(File f)
 // (the data is stored in little endian format!)
 
 // LITTLE ENDIAN!
-uint16_t read16(File f)
-{
+uint16_t read16(File f) {
   uint16_t d;
   uint8_t  b;
   b = f.read();
@@ -344,8 +311,7 @@ uint16_t read16(File f)
 }
 
 // LITTLE ENDIAN!
-uint32_t read32(File f)
-{
+uint32_t read32(File f) {
   uint32_t d;
   uint16_t b;
 
diff --git a/libraries/Ticker/examples/TickerBasic/TickerBasic.ino b/libraries/Ticker/examples/TickerBasic/TickerBasic.ino
index 70d8d32d7f..2fabd98315 100644
--- a/libraries/Ticker/examples/TickerBasic/TickerBasic.ino
+++ b/libraries/Ticker/examples/TickerBasic/TickerBasic.ino
@@ -16,28 +16,24 @@
 
 Ticker flipper;
 
-int    count = 0;
+int count = 0;
 
-void   flip()
-{
+void flip() {
   int state = digitalRead(LED_BUILTIN);  // get the current state of GPIO1 pin
   digitalWrite(LED_BUILTIN, !state);     // set pin to the opposite state
 
   ++count;
   // when the counter reaches a certain value, start blinking like crazy
-  if (count == 20)
-  {
+  if (count == 20) {
     flipper.attach(0.1, flip);
   }
   // when the counter reaches yet another value, stop blinking
-  else if (count == 120)
-  {
+  else if (count == 120) {
     flipper.detach();
   }
 }
 
-void setup()
-{
+void setup() {
   pinMode(LED_BUILTIN, OUTPUT);
   digitalWrite(LED_BUILTIN, LOW);
 
@@ -45,6 +41,5 @@ void setup()
   flipper.attach(0.3, flip);
 }
 
-void loop()
-{
+void loop() {
 }
diff --git a/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino b/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
index 0226049611..50b3f5127d 100644
--- a/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
+++ b/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
@@ -7,12 +7,10 @@
 #define LED4 14
 #define LED5 15
 
-class ExampleClass
-{
+class ExampleClass {
   public:
   ExampleClass(int pin, int duration) :
-      _pin(pin), _duration(duration)
-  {
+      _pin(pin), _duration(duration) {
     pinMode(_pin, OUTPUT);
     _myTicker.attach_ms(_duration, std::bind(&ExampleClass::classBlink, this));
   }
@@ -21,36 +19,31 @@ class ExampleClass
   int    _pin, _duration;
   Ticker _myTicker;
 
-  void   classBlink()
-  {
+  void classBlink() {
     digitalWrite(_pin, !digitalRead(_pin));
   }
 };
 
-void staticBlink()
-{
+void staticBlink() {
   digitalWrite(LED2, !digitalRead(LED2));
 }
 
-void scheduledBlink()
-{
+void scheduledBlink() {
   digitalWrite(LED3, !digitalRead(LED2));
 }
 
-void parameterBlink(int p)
-{
+void parameterBlink(int p) {
   digitalWrite(p, !digitalRead(p));
 }
 
-Ticker       staticTicker;
-Ticker       scheduledTicker;
-Ticker       parameterTicker;
-Ticker       lambdaTicker;
+Ticker staticTicker;
+Ticker scheduledTicker;
+Ticker parameterTicker;
+Ticker lambdaTicker;
 
 ExampleClass example(LED1, 100);
 
-void         setup()
-{
+void setup() {
   pinMode(LED2, OUTPUT);
   staticTicker.attach_ms(100, staticBlink);
 
@@ -61,10 +54,8 @@ void         setup()
   parameterTicker.attach_ms(100, std::bind(parameterBlink, LED4));
 
   pinMode(LED5, OUTPUT);
-  lambdaTicker.attach_ms(100, []()
-                         { digitalWrite(LED5, !digitalRead(LED5)); });
+  lambdaTicker.attach_ms(100, []() { digitalWrite(LED5, !digitalRead(LED5)); });
 }
 
-void loop()
-{
+void loop() {
 }
diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp
index a5606bddc3..82ae6b2521 100644
--- a/libraries/Wire/Wire.cpp
+++ b/libraries/Wire/Wire.cpp
@@ -44,12 +44,12 @@ uint8_t TwoWire::rxBuffer[I2C_BUFFER_LENGTH];
 size_t  TwoWire::rxBufferIndex  = 0;
 size_t  TwoWire::rxBufferLength = 0;
 
-uint8_t TwoWire::txAddress      = 0;
+uint8_t TwoWire::txAddress = 0;
 uint8_t TwoWire::txBuffer[I2C_BUFFER_LENGTH];
 size_t  TwoWire::txBufferIndex  = 0;
 size_t  TwoWire::txBufferLength = 0;
 
-uint8_t TwoWire::transmitting   = 0;
+uint8_t TwoWire::transmitting = 0;
 void (*TwoWire::user_onRequest)(void);
 void (*TwoWire::user_onReceive)(size_t);
 
diff --git a/libraries/Wire/Wire.h b/libraries/Wire/Wire.h
index bba50fa3f6..784874d73b 100644
--- a/libraries/Wire/Wire.h
+++ b/libraries/Wire/Wire.h
@@ -53,25 +53,25 @@ class TwoWire : public Stream
 
 public:
     TwoWire();
-    void           begin(int sda, int scl);
-    void           begin(int sda, int scl, uint8_t address);
-    void           pins(int sda, int scl) __attribute__((deprecated));  // use begin(sda, scl) in new code
-    void           begin();
-    void           begin(uint8_t);
-    void           begin(int);
-    void           setClock(uint32_t);
-    void           setClockStretchLimit(uint32_t);
-    void           beginTransmission(uint8_t);
-    void           beginTransmission(int);
-    uint8_t        endTransmission(void);
-    uint8_t        endTransmission(uint8_t);
-    size_t         requestFrom(uint8_t address, size_t size, bool sendStop);
-    uint8_t        status();
-
-    uint8_t        requestFrom(uint8_t, uint8_t);
-    uint8_t        requestFrom(uint8_t, uint8_t, uint8_t);
-    uint8_t        requestFrom(int, int);
-    uint8_t        requestFrom(int, int, int);
+    void    begin(int sda, int scl);
+    void    begin(int sda, int scl, uint8_t address);
+    void    pins(int sda, int scl) __attribute__((deprecated));  // use begin(sda, scl) in new code
+    void    begin();
+    void    begin(uint8_t);
+    void    begin(int);
+    void    setClock(uint32_t);
+    void    setClockStretchLimit(uint32_t);
+    void    beginTransmission(uint8_t);
+    void    beginTransmission(int);
+    uint8_t endTransmission(void);
+    uint8_t endTransmission(uint8_t);
+    size_t  requestFrom(uint8_t address, size_t size, bool sendStop);
+    uint8_t status();
+
+    uint8_t requestFrom(uint8_t, uint8_t);
+    uint8_t requestFrom(uint8_t, uint8_t, uint8_t);
+    uint8_t requestFrom(int, int);
+    uint8_t requestFrom(int, int, int);
 
     virtual size_t write(uint8_t);
     virtual size_t write(const uint8_t*, size_t);
diff --git a/libraries/Wire/examples/master_reader/master_reader.ino b/libraries/Wire/examples/master_reader/master_reader.ino
index 478ce34309..73f45e0ae0 100644
--- a/libraries/Wire/examples/master_reader/master_reader.ino
+++ b/libraries/Wire/examples/master_reader/master_reader.ino
@@ -16,25 +16,21 @@
 const int16_t I2C_MASTER = 0x42;
 const int16_t I2C_SLAVE  = 0x08;
 
-void          setup()
-{
+void setup() {
   Serial.begin(115200);                      // start serial for output
   Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER);  // join i2c bus (address optional for master)
 }
 
-void loop()
-{
+void loop() {
   using periodic = esp8266::polledTimeout::periodicMs;
   static periodic nextPing(1000);
 
-  if (nextPing)
-  {
+  if (nextPing) {
     Wire.requestFrom(I2C_SLAVE, 6);  // request 6 bytes from slave device #8
 
-    while (Wire.available())
-    {                        // slave may send less than requested
-      char c = Wire.read();  // receive a byte as character
-      Serial.print(c);       // print the character
+    while (Wire.available()) {  // slave may send less than requested
+      char c = Wire.read();     // receive a byte as character
+      Serial.print(c);          // print the character
     }
   }
 }
diff --git a/libraries/Wire/examples/master_writer/master_writer.ino b/libraries/Wire/examples/master_writer/master_writer.ino
index d1d8887cee..727ff0a09d 100644
--- a/libraries/Wire/examples/master_writer/master_writer.ino
+++ b/libraries/Wire/examples/master_writer/master_writer.ino
@@ -16,20 +16,17 @@
 const int16_t I2C_MASTER = 0x42;
 const int16_t I2C_SLAVE  = 0x08;
 
-void          setup()
-{
+void setup() {
   Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER);  // join i2c bus (address optional for master)
 }
 
 byte x = 0;
 
-void loop()
-{
+void loop() {
   using periodic = esp8266::polledTimeout::periodicMs;
   static periodic nextPing(1000);
 
-  if (nextPing)
-  {
+  if (nextPing) {
     Wire.beginTransmission(I2C_SLAVE);  // transmit to device #8
     Wire.write("x is ");                // sends five bytes
     Wire.write(x);                      // sends one byte
diff --git a/libraries/Wire/examples/slave_receiver/slave_receiver.ino b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
index 1bad5d1adb..0db1c5926f 100644
--- a/libraries/Wire/examples/slave_receiver/slave_receiver.ino
+++ b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
@@ -16,27 +16,23 @@
 const int16_t I2C_MASTER = 0x42;
 const int16_t I2C_SLAVE  = 0x08;
 
-void          setup()
-{
+void setup() {
   Serial.begin(115200);  // start serial for output
 
   Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE);  // new syntax: join i2c bus (address required for slave)
   Wire.onReceive(receiveEvent);             // register event
 }
 
-void loop()
-{
+void loop() {
 }
 
 // function that executes whenever data is received from master
 // this function is registered as an event, see setup()
-void receiveEvent(size_t howMany)
-{
+void receiveEvent(size_t howMany) {
   (void)howMany;
-  while (1 < Wire.available())
-  {                        // loop through all but the last
-    char c = Wire.read();  // receive byte as a character
-    Serial.print(c);       // print the character
+  while (1 < Wire.available()) {  // loop through all but the last
+    char c = Wire.read();         // receive byte as a character
+    Serial.print(c);              // print the character
   }
   int x = Wire.read();  // receive byte as an integer
   Serial.println(x);    // print the integer
diff --git a/libraries/Wire/examples/slave_sender/slave_sender.ino b/libraries/Wire/examples/slave_sender/slave_sender.ino
index eeadfe1c3f..7937cac918 100644
--- a/libraries/Wire/examples/slave_sender/slave_sender.ino
+++ b/libraries/Wire/examples/slave_sender/slave_sender.ino
@@ -15,20 +15,17 @@
 const int16_t I2C_MASTER = 0x42;
 const int16_t I2C_SLAVE  = 0x08;
 
-void          setup()
-{
+void setup() {
   Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE);  // join i2c bus with address #8
   Wire.onRequest(requestEvent);             // register event
 }
 
-void loop()
-{
+void loop() {
 }
 
 // function that executes whenever data is requested by master
 // this function is registered as an event, see setup()
-void requestEvent()
-{
+void requestEvent() {
   Wire.write("hello\n");  // respond with message of 6 bytes
   // as expected by master
 }
diff --git a/libraries/esp8266/examples/Blink/Blink.ino b/libraries/esp8266/examples/Blink/Blink.ino
index eddbbdb1a5..d2083049dd 100644
--- a/libraries/esp8266/examples/Blink/Blink.ino
+++ b/libraries/esp8266/examples/Blink/Blink.ino
@@ -9,14 +9,12 @@
   Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
 */
 
-void setup()
-{
+void setup() {
   pinMode(LED_BUILTIN, OUTPUT);  // Initialize the LED_BUILTIN pin as an output
 }
 
 // the loop function runs over and over again forever
-void loop()
-{
+void loop() {
   digitalWrite(LED_BUILTIN, LOW);  // Turn the LED on (Note that LOW is the voltage level
   // but actually the LED is on; this is because
   // it is active low on the ESP-01)
diff --git a/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino b/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
index 58b6387e81..66536a335d 100644
--- a/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
+++ b/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
@@ -24,26 +24,22 @@
 
 #include <PolledTimeout.h>
 
-void ledOn()
-{
+void ledOn() {
   digitalWrite(LED_BUILTIN, LOW);  // Turn the LED on (Note that LOW is the voltage level
 }
 
-void ledOff()
-{
+void ledOff() {
   digitalWrite(LED_BUILTIN, HIGH);  // Turn the LED off by making the voltage HIGH
 }
 
-void ledToggle()
-{
+void ledToggle() {
   digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));  // Change the state of the LED
 }
 
 esp8266::polledTimeout::periodicFastUs halfPeriod(500000);  //use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace
 
 // the setup function runs only once at start
-void                                   setup()
-{
+void setup() {
   Serial.begin(115200);
 
   Serial.println();
@@ -68,8 +64,7 @@ void                                   setup()
 
   //STEP2: wait for ON timeout
   oneShotMs timeoutOn(2000);
-  while (!timeoutOn)
-  {
+  while (!timeoutOn) {
     yield();
   }
 
@@ -78,8 +73,7 @@ void                                   setup()
 
   //STEP4: wait for OFF timeout to assure the led is kept off for this time before exiting setup
   oneShotMs timeoutOff(2000);
-  while (!timeoutOff)
-  {
+  while (!timeoutOff) {
     yield();
   }
 
@@ -88,10 +82,8 @@ void                                   setup()
 }
 
 // the loop function runs over and over again forever
-void loop()
-{
-  if (halfPeriod)
-  {
+void loop() {
+  if (halfPeriod) {
     ledToggle();
   }
 }
diff --git a/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino b/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
index 3c63eec3cc..16dd33aa15 100644
--- a/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
+++ b/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
@@ -10,28 +10,22 @@
   Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
 */
 
-int           ledState       = LOW;
+int ledState = LOW;
 
 unsigned long previousMillis = 0;
 const long    interval       = 1000;
 
-void          setup()
-{
+void setup() {
   pinMode(LED_BUILTIN, OUTPUT);
 }
 
-void loop()
-{
+void loop() {
   unsigned long currentMillis = millis();
-  if (currentMillis - previousMillis >= interval)
-  {
+  if (currentMillis - previousMillis >= interval) {
     previousMillis = currentMillis;
-    if (ledState == LOW)
-    {
+    if (ledState == LOW) {
       ledState = HIGH;  // Note that this switches the LED *off*
-    }
-    else
-    {
+    } else {
       ledState = LOW;  // Note that this switches the LED *on*
     }
     digitalWrite(LED_BUILTIN, ledState);
diff --git a/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino b/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
index 257e94c125..3110d23ac2 100644
--- a/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
+++ b/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
@@ -4,8 +4,7 @@
 
 using namespace experimental::CBListImplentation;
 
-class exampleClass
-{
+class exampleClass {
   public:
   exampleClass() {};
 
@@ -14,36 +13,30 @@ class exampleClass
 
   CallBackList<exCallBack> myHandlers;
 
-  exHandler                setHandler(exCallBack cb)
-  {
+  exHandler setHandler(exCallBack cb) {
     return myHandlers.add(cb);
   }
 
-  void removeHandler(exHandler hnd)
-  {
+  void removeHandler(exHandler hnd) {
     myHandlers.remove(hnd);
   }
 
-  void trigger(int t)
-  {
+  void trigger(int t) {
     myHandlers.execute(t);
   }
 };
 
 exampleClass myExample;
 
-void         cb1(int in)
-{
+void cb1(int in) {
   Serial.printf("Callback 1, in = %d\n", in);
 }
 
-void cb2(int in)
-{
+void cb2(int in) {
   Serial.printf("Callback 2, in = %d\n", in);
 }
 
-void cb3(int in, int s)
-{
+void cb3(int in, int s) {
   Serial.printf("Callback 3, in = %d, s = %d\n", in, s);
 }
 
@@ -52,21 +45,16 @@ exampleClass::exHandler e1 = myExample.setHandler(cb1);
 exampleClass::exHandler e2 = myExample.setHandler(cb2);
 exampleClass::exHandler e3 = myExample.setHandler(std::bind(cb3, std::placeholders::_1, 10));
 
-void                    setup()
-{
+void setup() {
   Serial.begin(115200);
 
-  tk.attach_ms(2000, []()
-               {
-                 Serial.printf("trigger %d\n", (uint32_t)millis());
-                 myExample.trigger(millis());
-               });
-  tk2.once_ms(10000, []()
-              { myExample.removeHandler(e2); });
-  tk3.once_ms(20000, []()
-              { e3.reset(); });
+  tk.attach_ms(2000, []() {
+    Serial.printf("trigger %d\n", (uint32_t)millis());
+    myExample.trigger(millis());
+  });
+  tk2.once_ms(10000, []() { myExample.removeHandler(e2); });
+  tk3.once_ms(20000, []() { e3.reset(); });
 }
 
-void loop()
-{
+void loop() {
 }
diff --git a/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino b/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
index 787f2c742f..cbd25c8bcb 100644
--- a/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
+++ b/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
@@ -5,16 +5,14 @@
    Released to the Public Domain by Earle F. Philhower, III <earlephilhower@yahoo.com>
 */
 
-extern "C"
-{
+extern "C" {
 #include "spi_flash.h"
 }
 // Artificially create a space in PROGMEM that fills multiple sectors so
 // we can corrupt one without crashing the system
 const int corruptme[SPI_FLASH_SEC_SIZE * 4] PROGMEM = { 0 };
 
-void      setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.printf("Starting\n");
   Serial.printf("CRC check: %s\n", ESP.checkFlashCRC() ? "OK" : "ERROR");
@@ -24,11 +22,11 @@ void      setup()
   // Find a page aligned spot inside the array
   ptr += 2 * SPI_FLASH_SEC_SIZE;
   ptr &= ~(SPI_FLASH_SEC_SIZE - 1);  // Sectoralign
-  uint32_t  sector = ((((uint32_t)ptr - 0x40200000) / SPI_FLASH_SEC_SIZE));
+  uint32_t sector = ((((uint32_t)ptr - 0x40200000) / SPI_FLASH_SEC_SIZE));
 
   // Create a sector with 1 bit set (i.e. fake corruption)
-  uint32_t* space  = (uint32_t*)calloc(SPI_FLASH_SEC_SIZE, 1);
-  space[42]        = 64;
+  uint32_t* space = (uint32_t*)calloc(SPI_FLASH_SEC_SIZE, 1);
+  space[42]       = 64;
 
   // Write it into flash at the spot in question
   spi_flash_erase_sector(sector);
@@ -42,6 +40,5 @@ void      setup()
   Serial.printf("CRC check: %s\n", ESP.checkFlashCRC() ? "OK" : "ERROR");
 }
 
-void loop()
-{
+void loop() {
 }
diff --git a/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino b/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
index 7150e8c833..ce4919f14e 100644
--- a/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
+++ b/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
@@ -5,13 +5,11 @@
 
 */
 
-void setup(void)
-{
+void setup(void) {
   Serial.begin(115200);
 }
 
-void loop()
-{
+void loop() {
   uint32_t    realSize = ESP.getFlashChipRealSize();
   uint32_t    ideSize  = ESP.getFlashChipSize();
   FlashMode_t ideMode  = ESP.getFlashChipMode();
@@ -26,12 +24,9 @@ void loop()
                                               : ideMode == FM_DOUT                       ? "DOUT"
                                                                                          : "UNKNOWN"));
 
-  if (ideSize != realSize)
-  {
+  if (ideSize != realSize) {
     Serial.println("Flash Chip configuration wrong!\n");
-  }
-  else
-  {
+  } else {
     Serial.println("Flash Chip configuration ok.\n");
   }
 
diff --git a/libraries/esp8266/examples/ConfigFile/ConfigFile.ino b/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
index 879e994d59..aec83fc8e4 100644
--- a/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
+++ b/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
@@ -14,19 +14,16 @@
 // more and possibly updated information can be found at:
 // https://arduinojson.org/v6/example/config/
 
-bool loadConfig()
-{
+bool loadConfig() {
   File configFile = LittleFS.open("/config.json", "r");
-  if (!configFile)
-  {
+  if (!configFile) {
     Serial.println("Failed to open config file");
     return false;
   }
 
   StaticJsonDocument<200> doc;
   auto                    error = deserializeJson(doc, configFile);
-  if (error)
-  {
+  if (error) {
     Serial.println("Failed to parse config file");
     return false;
   }
@@ -44,15 +41,13 @@ bool loadConfig()
   return true;
 }
 
-bool saveConfig()
-{
+bool saveConfig() {
   StaticJsonDocument<200> doc;
   doc["serverName"]  = "api.example.com";
   doc["accessToken"] = "128du9as8du12eoue8da98h123ueh9h98";
 
-  File configFile    = LittleFS.open("/config.json", "w");
-  if (!configFile)
-  {
+  File configFile = LittleFS.open("/config.json", "w");
+  if (!configFile) {
     Serial.println("Failed to open config file for writing");
     return false;
   }
@@ -61,38 +56,29 @@ bool saveConfig()
   return true;
 }
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println("");
   delay(1000);
   Serial.println("Mounting FS...");
 
-  if (!LittleFS.begin())
-  {
+  if (!LittleFS.begin()) {
     Serial.println("Failed to mount file system");
     return;
   }
 
-  if (!saveConfig())
-  {
+  if (!saveConfig()) {
     Serial.println("Failed to save config");
-  }
-  else
-  {
+  } else {
     Serial.println("Config saved");
   }
 
-  if (!loadConfig())
-  {
+  if (!loadConfig()) {
     Serial.println("Failed to load config");
-  }
-  else
-  {
+  } else {
     Serial.println("Config loaded");
   }
 }
 
-void loop()
-{
+void loop() {
 }
diff --git a/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino b/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
index d5c01b31c7..b2efbeb4c1 100644
--- a/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
+++ b/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
@@ -28,8 +28,7 @@
 esp8266::polledTimeout::periodicFastUs stepPeriod(50000);
 
 // the setup function runs only once at start
-void                                   setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println();
 
@@ -48,28 +47,22 @@ void                                   setup()
   digitalWrite(LED_BUILTIN, LOW);  // Turn the LED on (Note that LOW is the voltage level
 
   oneShotMs timeoutOn(2000);
-  while (!timeoutOn)
-  {
+  while (!timeoutOn) {
     yield();
   }
 
   stepPeriod.reset();
 }
 
-void loop()
-{
+void loop() {
   static int val   = 0;
   static int delta = 100;
-  if (stepPeriod)
-  {
+  if (stepPeriod) {
     val += delta;
-    if (val < 0)
-    {
+    if (val < 0) {
       val   = 100;
       delta = 100;
-    }
-    else if (val > 1000)
-    {
+    } else if (val > 1000) {
       val   = 900;
       delta = -100;
     }
diff --git a/libraries/esp8266/examples/HeapMetric/HeapMetric.ino b/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
index 47a20b21e3..3ec3f0cf98 100644
--- a/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
+++ b/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
@@ -6,8 +6,7 @@
 #include <umm_malloc/umm_malloc.h>
 #include <umm_malloc/umm_heap_select.h>
 
-void stats(const char* what)
-{
+void stats(const char* what) {
   // we could use getFreeHeap() getMaxFreeBlockSize() and getHeapFragmentation()
   // or all at once:
   uint32_t free;
@@ -20,8 +19,7 @@ void stats(const char* what)
   Serial.println(what);
 }
 
-void tryit(int blocksize)
-{
+void tryit(int blocksize) {
   void** p;
   int    blocks;
 
@@ -54,56 +52,48 @@ void tryit(int blocksize)
     calculation of multiple elements combined with the rounding up for the
     8-byte alignment of each allocation can make for some tricky calculations.
   */
-  int    rawMemoryMaxFreeBlockSize = ESP.getMaxFreeBlockSize();
+  int rawMemoryMaxFreeBlockSize = ESP.getMaxFreeBlockSize();
   // Remove the space for overhead component of the blocks*sizeof(void*) array.
-  int    maxFreeBlockSize          = rawMemoryMaxFreeBlockSize - UMM_OVERHEAD_ADJUST;
+  int maxFreeBlockSize = rawMemoryMaxFreeBlockSize - UMM_OVERHEAD_ADJUST;
   // Initial estimate to use all of the MaxFreeBlock with multiples of 8 rounding up.
-  blocks                           = maxFreeBlockSize / (((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + sizeof(void*));
+  blocks = maxFreeBlockSize / (((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + sizeof(void*));
   /*
     While we allowed for the 8-byte alignment overhead for blocks*blocksize we
     were unable to compensate in advance for the later 8-byte aligning needed
     for the blocks*sizeof(void*) allocation. Thus blocks may be off by one count.
     We now validate the estimate and adjust as needed.
   */
-  int rawMemoryEstimate            = blocks * ((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + ((blocks * sizeof(void*) + UMM_OVERHEAD_ADJUST + 7) & ~7);
-  if (rawMemoryMaxFreeBlockSize < rawMemoryEstimate)
-  {
+  int rawMemoryEstimate = blocks * ((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + ((blocks * sizeof(void*) + UMM_OVERHEAD_ADJUST + 7) & ~7);
+  if (rawMemoryMaxFreeBlockSize < rawMemoryEstimate) {
     --blocks;
   }
   Serial.printf("\nFilling memory with blocks of %d bytes each\n", blocksize);
   stats("before");
 
   p = (void**)malloc(sizeof(void*) * blocks);
-  for (int i = 0; i < blocks; i++)
-  {
+  for (int i = 0; i < blocks; i++) {
     p[i] = malloc(blocksize);
   }
   stats("array and blocks allocation");
 
-  for (int i = 0; i < blocks; i += 2)
-  {
-    if (p[i])
-    {
+  for (int i = 0; i < blocks; i += 2) {
+    if (p[i]) {
       free(p[i]);
     }
     p[i] = nullptr;
   }
   stats("freeing every other blocks");
 
-  for (int i = 0; i < (blocks - 1); i += 4)
-  {
-    if (p[i + 1])
-    {
+  for (int i = 0; i < (blocks - 1); i += 4) {
+    if (p[i + 1]) {
       free(p[i + 1]);
     }
     p[i + 1] = nullptr;
   }
   stats("freeing every other remaining blocks");
 
-  for (int i = 0; i < blocks; i++)
-  {
-    if (p[i])
-    {
+  for (int i = 0; i < blocks; i++) {
+    if (p[i]) {
       free(p[i]);
     }
   }
@@ -113,8 +103,7 @@ void tryit(int blocksize)
   stats("after");
 }
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   WiFi.mode(WIFI_OFF);
   delay(50);
@@ -166,6 +155,5 @@ void setup()
 #endif
 }
 
-void loop()
-{
+void loop() {
 }
diff --git a/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino b/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
index c49a7a4867..80544815a2 100644
--- a/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
+++ b/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
@@ -8,7 +8,7 @@
 #include <TypeConversion.h>
 #include <Crypto.h>
 
-namespace TypeCast                 = experimental::TypeConversion;
+namespace TypeCast = experimental::TypeConversion;
 
 /**
    NOTE: Although we could define the strings below as normal String variables,
@@ -23,8 +23,7 @@ namespace TypeCast                 = experimental::TypeConversion;
 */
 constexpr char masterKey[] PROGMEM = "w86vn@rpfA O+S";  // Use 8 random characters or more
 
-void           setup()
-{
+void setup() {
   // Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
   // This will however delay node WiFi start-up by about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to connect to.
   WiFi.persistent(false);
@@ -35,8 +34,7 @@ void           setup()
   Serial.println();
 }
 
-void loop()
-{
+void loop() {
   // This serves only to demonstrate the library use. See the header file for a full list of functions.
 
   using namespace experimental::crypto;
@@ -44,13 +42,13 @@ void loop()
   String exampleData = F("Hello Crypto World!");
   Serial.println(String(F("This is our example data: ")) + exampleData);
 
-  uint8_t         resultArray[SHA256::NATURAL_LENGTH] { 0 };
-  uint8_t         derivedKey[ENCRYPTION_KEY_LENGTH] { 0 };
+  uint8_t resultArray[SHA256::NATURAL_LENGTH] { 0 };
+  uint8_t derivedKey[ENCRYPTION_KEY_LENGTH] { 0 };
 
   static uint32_t encryptionCounter = 0;
 
   // Generate the salt to use for HKDF
-  uint8_t         hkdfSalt[16] { 0 };
+  uint8_t hkdfSalt[16] { 0 };
   getNonceGenerator()(hkdfSalt, sizeof hkdfSalt);
 
   // Generate the key to use for HMAC and encryption
@@ -82,12 +80,9 @@ void loop()
   bool decryptionSucceeded = ChaCha20Poly1305::decrypt(dataToEncrypt.begin(), dataToEncrypt.length(), derivedKey, &encryptionCounter, sizeof encryptionCounter, resultingNonce, resultingTag);
   encryptionCounter++;
 
-  if (decryptionSucceeded)
-  {
+  if (decryptionSucceeded) {
     Serial.print(F("Decryption succeeded. Result: "));
-  }
-  else
-  {
+  } else {
     Serial.print(F("Decryption failed. Result: "));
   }
 
diff --git a/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino b/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
index 1c5733ea6d..62ff6498f3 100644
--- a/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
+++ b/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
@@ -34,21 +34,19 @@ const char* password = STAPSK;
 // This block is just for putting something on the BearSSL stack
 // to show that it has not been zeroed out before HWDT stack dump
 // gets to runs.
-extern "C"
-{
+extern "C" {
 #if CORE_MOCK
 #define thunk_ets_uart_printf ets_uart_printf
 
 #else
-  int thunk_ets_uart_printf(const char* format, ...) __attribute__((format(printf, 1, 2)));
-  // Second stack thunked helper - this macro creates the global function thunk_ets_uart_printf
-  make_stack_thunk(ets_uart_printf);
+int thunk_ets_uart_printf(const char* format, ...) __attribute__((format(printf, 1, 2)));
+// Second stack thunked helper - this macro creates the global function thunk_ets_uart_printf
+make_stack_thunk(ets_uart_printf);
 #endif
 };
 ////////////////////////////////////////////////////////////////////
 
-void setup(void)
-{
+void setup(void) {
   WiFi.persistent(false);  // w/o this a flash write occurs at every boot
   WiFi.mode(WIFI_OFF);
   Serial.begin(115200);
@@ -96,10 +94,8 @@ void setup(void)
   processKey(Serial, '?');
 }
 
-void loop(void)
-{
-  if (Serial.available() > 0)
-  {
+void loop(void) {
+  if (Serial.available() > 0) {
     int hotKey = Serial.read();
     processKey(Serial, hotKey);
   }
diff --git a/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino b/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
index fd21931219..45e2d63da4 100644
--- a/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
+++ b/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
@@ -4,10 +4,8 @@ int  divideA_B(int a, int b);
 
 int* nullPointer = NULL;
 
-void processKey(Print& out, int hotKey)
-{
-  switch (hotKey)
-  {
+void processKey(Print& out, int hotKey) {
+  switch (hotKey) {
     case 'r':
       out.printf_P(PSTR("Reset, ESP.reset(); ...\r\n"));
       ESP.reset();
@@ -16,19 +14,16 @@ void processKey(Print& out, int hotKey)
       out.printf_P(PSTR("Restart, ESP.restart(); ...\r\n"));
       ESP.restart();
       break;
-    case 's':
-    {
+    case 's': {
       uint32_t startTime = millis();
       out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
       ets_install_putc1(ets_putc);
-      while (true)
-      {
+      while (true) {
         ets_printf("%9lu\r", (millis() - startTime));
         ets_delay_us(250000);
         // stay in an loop blocking other system activity.
       }
-    }
-    break;
+    } break;
     case 'h':
       out.printf_P(PSTR("Now crashing with Hardware WDT. This will take about 6 seconds.\r\n"));
       asm volatile("mov.n a2, %0\n\t"
@@ -46,8 +41,7 @@ void processKey(Print& out, int hotKey)
         // the system and crash.
         ets_install_putc1(ets_putc);
         xt_rsil(15);
-        while (true)
-        {
+        while (true) {
           ets_printf("%9lu\r", (millis() - startTime));
           ets_delay_us(250000);
           // stay in an loop blocking other system activity.
@@ -112,14 +106,12 @@ void processKey(Print& out, int hotKey)
 
 // With the current toolchain 10.1, using this to divide by zero will *not* be
 // caught at compile time.
-int __attribute__((noinline)) divideA_B(int a, int b)
-{
+int __attribute__((noinline)) divideA_B(int a, int b) {
   return (a / b);
 }
 
 // With the current toolchain 10.1, using this to divide by zero *will* be
 // caught at compile time. And a hard coded breakpoint will be inserted.
-int divideA_B_bp(int a, int b)
-{
+int divideA_B_bp(int a, int b) {
   return (a / b);
 }
diff --git a/libraries/esp8266/examples/I2SInput/I2SInput.ino b/libraries/esp8266/examples/I2SInput/I2SInput.ino
index 836da2685b..6e2e11b07b 100644
--- a/libraries/esp8266/examples/I2SInput/I2SInput.ino
+++ b/libraries/esp8266/examples/I2SInput/I2SInput.ino
@@ -35,7 +35,7 @@ void setup() {
   WiFi.forceSleepBegin();
   delay(500);
 
-  i2s_rxtx_begin(true, false); // Enable I2S RX
+  i2s_rxtx_begin(true, false);  // Enable I2S RX
   i2s_set_rate(11025);
 
   delay(1000);
diff --git a/libraries/esp8266/examples/I2STransmit/I2STransmit.ino b/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
index 67b0658fd3..b14b3a7d15 100644
--- a/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
+++ b/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
@@ -18,18 +18,17 @@
 #endif
 
 // Set your network here
-const char*     SSID = STASSID;
-const char*     PASS = STAPSK;
+const char* SSID = STASSID;
+const char* PASS = STAPSK;
 
-WiFiUDP         udp;
+WiFiUDP udp;
 // Set your listener PC's IP here:
 const IPAddress listener = { 192, 168, 1, 2 };
 const int       port     = 8266;
 
-int16_t         buffer[100][2];  // Temp staging for samples
+int16_t buffer[100][2];  // Temp staging for samples
 
-void            setup()
-{
+void setup() {
   Serial.begin(115200);
 
   // Connect to WiFi network
@@ -40,8 +39,7 @@ void            setup()
 
   WiFi.begin(SSID, PASS);
 
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -64,21 +62,18 @@ void            setup()
   udp.endPacket();
 }
 
-void loop()
-{
+void loop() {
   static uint32_t cnt = 0;
   // Each loop will send 100 raw samples (400 bytes)
   // UDP needs to be < TCP_MSS which can be 500 bytes in LWIP2
-  for (int i = 0; i < 100; i++)
-  {
+  for (int i = 0; i < 100; i++) {
     i2s_read_sample(&buffer[i][0], &buffer[i][1], true);
   }
   udp.beginPacket(listener, port);
   udp.write((uint8_t*)buffer, sizeof(buffer));
   udp.endPacket();
   cnt++;
-  if ((cnt % 100) == 0)
-  {
+  if ((cnt % 100) == 0) {
     Serial.printf("%" PRIu32 "\n", cnt);
   }
 }
diff --git a/libraries/esp8266/examples/IramReserve/IramReserve.ino b/libraries/esp8266/examples/IramReserve/IramReserve.ino
index 8e51d3a117..e1ad8c6b74 100644
--- a/libraries/esp8266/examples/IramReserve/IramReserve.ino
+++ b/libraries/esp8266/examples/IramReserve/IramReserve.ino
@@ -24,8 +24,7 @@
 #endif
 
 // durable - as in long life, persisting across reboots.
-struct durable
-{
+struct durable {
   uint32_t bootCounter;
   uint32_t chksum;
 };
@@ -57,21 +56,18 @@ extern struct rst_info resetInfo;
   REASON_EXT_SYS_RST, you could add additional logic to set and verify a CRC or
   XOR sum on the IRAM data (or just a section of the IRAM data).
 */
-inline bool            is_iram_valid(void)
-{
+inline bool is_iram_valid(void) {
   return (REASON_WDT_RST <= resetInfo.reason && REASON_SOFT_RESTART >= resetInfo.reason);
 }
 
-void setup()
-{
+void setup() {
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
   Serial.begin(115200);
   delay(10);
   Serial.printf_P(PSTR("\r\nSetup ...\r\n"));
 
-  if (!is_iram_valid())
-  {
+  if (!is_iram_valid()) {
     DURABLE->bootCounter = 0;
   }
 
@@ -82,10 +78,8 @@ void setup()
   processKey(Serial, '?');
 }
 
-void loop(void)
-{
-  if (Serial.available() > 0)
-  {
+void loop(void) {
+  if (Serial.available() > 0) {
     int hotKey = Serial.read();
     processKey(Serial, hotKey);
   }
@@ -102,8 +96,7 @@ void loop(void)
 
 extern "C" void _text_end(void);
 
-extern "C" void umm_init_iram(void)
-{
+extern "C" void umm_init_iram(void) {
   /*
     Calculate the start of 2nd heap, staying clear of possible segment alignment
     adjustments and checksums. These can affect the persistence of data across
@@ -113,15 +106,13 @@ extern "C" void umm_init_iram(void)
   sec_heap &= ~7;
   size_t sec_heap_sz = 0xC000UL - (sec_heap - (uintptr_t)XCHAL_INSTRAM1_VADDR);
   sec_heap_sz -= IRAM_RESERVE_SZ;  // Shrink IRAM heap
-  if (0xC000UL > sec_heap_sz)
-  {
+  if (0xC000UL > sec_heap_sz) {
     umm_init_iram_ex((void*)sec_heap, sec_heap_sz, true);
   }
 }
 
 #else
-void setup()
-{
+void setup() {
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
   Serial.begin(115200);
@@ -129,7 +120,6 @@ void setup()
   Serial.println("\r\n\r\nThis sketch requires Tools Option: 'MMU: 16KB cache + 48KB IRAM and 2nd Heap (shared)'");
 }
 
-void loop(void)
-{
+void loop(void) {
 }
 #endif
diff --git a/libraries/esp8266/examples/IramReserve/ProcessKey.ino b/libraries/esp8266/examples/IramReserve/ProcessKey.ino
index fd21931219..45e2d63da4 100644
--- a/libraries/esp8266/examples/IramReserve/ProcessKey.ino
+++ b/libraries/esp8266/examples/IramReserve/ProcessKey.ino
@@ -4,10 +4,8 @@ int  divideA_B(int a, int b);
 
 int* nullPointer = NULL;
 
-void processKey(Print& out, int hotKey)
-{
-  switch (hotKey)
-  {
+void processKey(Print& out, int hotKey) {
+  switch (hotKey) {
     case 'r':
       out.printf_P(PSTR("Reset, ESP.reset(); ...\r\n"));
       ESP.reset();
@@ -16,19 +14,16 @@ void processKey(Print& out, int hotKey)
       out.printf_P(PSTR("Restart, ESP.restart(); ...\r\n"));
       ESP.restart();
       break;
-    case 's':
-    {
+    case 's': {
       uint32_t startTime = millis();
       out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
       ets_install_putc1(ets_putc);
-      while (true)
-      {
+      while (true) {
         ets_printf("%9lu\r", (millis() - startTime));
         ets_delay_us(250000);
         // stay in an loop blocking other system activity.
       }
-    }
-    break;
+    } break;
     case 'h':
       out.printf_P(PSTR("Now crashing with Hardware WDT. This will take about 6 seconds.\r\n"));
       asm volatile("mov.n a2, %0\n\t"
@@ -46,8 +41,7 @@ void processKey(Print& out, int hotKey)
         // the system and crash.
         ets_install_putc1(ets_putc);
         xt_rsil(15);
-        while (true)
-        {
+        while (true) {
           ets_printf("%9lu\r", (millis() - startTime));
           ets_delay_us(250000);
           // stay in an loop blocking other system activity.
@@ -112,14 +106,12 @@ void processKey(Print& out, int hotKey)
 
 // With the current toolchain 10.1, using this to divide by zero will *not* be
 // caught at compile time.
-int __attribute__((noinline)) divideA_B(int a, int b)
-{
+int __attribute__((noinline)) divideA_B(int a, int b) {
   return (a / b);
 }
 
 // With the current toolchain 10.1, using this to divide by zero *will* be
 // caught at compile time. And a hard coded breakpoint will be inserted.
-int divideA_B_bp(int a, int b)
-{
+int divideA_B_bp(int a, int b) {
   return (a / b);
 }
diff --git a/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino b/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
index e1efcbc2a5..306b53f8ec 100644
--- a/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
+++ b/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
@@ -84,8 +84,7 @@ uint32_t    timeout = 30E3;  // 30 second timeout on the WiFi connection
 
 // This structure is stored in RTC memory to save the WiFi state and reset count (number of Deep Sleeps),
 // and it reconnects twice as fast as the first connection; it's used several places in this demo
-struct nv_s
-{
+struct nv_s {
   WiFiState wss;  // core's WiFi save state
 
   struct
@@ -96,9 +95,9 @@ struct nv_s
   } rtcData;
 };
 
-static nv_s*                       nv         = (nv_s*)RTC_USER_MEM;  // user RTC RAM area
+static nv_s* nv = (nv_s*)RTC_USER_MEM;  // user RTC RAM area
 
-uint32_t                           resetCount = 0;  // keeps track of the number of Deep Sleep tests / resets
+uint32_t resetCount = 0;  // keeps track of the number of Deep Sleep tests / resets
 
 const uint32_t                     blinkDelay = 100;      // fast blink rate for the LED when waiting for the user
 esp8266::polledTimeout::periodicMs blinkLED(blinkDelay);  // LED blink delay without delay()
@@ -106,15 +105,13 @@ esp8266::polledTimeout::oneShotMs  altDelay(blinkDelay);  // tight loop to simul
 esp8266::polledTimeout::oneShotMs  wifiTimeout(timeout);  // 30 second timeout on WiFi connection
 // use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace
 
-void                               wakeupCallback()
-{                 // unlike ISRs, you can do a print() from a callback function
-  testPoint_LOW;  // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW
-  printMillis();  // show time difference across sleep; millis is wrong as the CPU eventually stops
+void wakeupCallback() {  // unlike ISRs, you can do a print() from a callback function
+  testPoint_LOW;         // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW
+  printMillis();         // show time difference across sleep; millis is wrong as the CPU eventually stops
   Serial.println(F("Woke from Light Sleep - this is the callback"));
 }
 
-void setup()
-{
+void setup() {
 #ifdef TESTPOINT
   pinMode(testPointPin, OUTPUT);  // test point for Light Sleep and Deep Sleep tests
   testPoint_LOW;                  // Deep Sleep reset doesn't clear GPIOs, testPoint LOW shows boot time
@@ -128,31 +125,26 @@ void setup()
   String resetCause = ESP.getResetReason();
   Serial.println(resetCause);
   resetCount = 0;
-  if ((resetCause == "External System") || (resetCause == "Power on"))
-  {
+  if ((resetCause == "External System") || (resetCause == "Power on")) {
     Serial.println(F("I'm awake and starting the Low Power tests"));
   }
 
   // Read previous resets (Deep Sleeps) from RTC memory, if any
   uint32_t crcOfData = crc32((uint8_t*)&nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
-  if ((crcOfData = nv->rtcData.crc32) && (resetCause == "Deep-Sleep Wake"))
-  {
+  if ((crcOfData = nv->rtcData.crc32) && (resetCause == "Deep-Sleep Wake")) {
     resetCount = nv->rtcData.rstCount;  // read the previous reset count
     resetCount++;
   }
   nv->rtcData.rstCount = resetCount;  // update the reset count & CRC
   updateRTCcrc();
 
-  if (resetCount == 1)
-  {  // show that millis() is cleared across the Deep Sleep reset
+  if (resetCount == 1) {  // show that millis() is cleared across the Deep Sleep reset
     printMillis();
   }
 }  // end of setup()
 
-void loop()
-{
-  if (resetCount == 0)
-  {  // if first loop() since power on or external reset
+void loop() {
+  if (resetCount == 0) {  // if first loop() since power on or external reset
     runTest1();
     runTest2();
     runTest3();
@@ -161,43 +153,32 @@ void loop()
     runTest6();
     runTest7();  // first Deep Sleep test, all these end with a RESET
   }
-  if (resetCount < 4)
-  {
+  if (resetCount < 4) {
     initWiFi();  // optional re-init of WiFi for the Deep Sleep tests
   }
-  if (resetCount == 1)
-  {
+  if (resetCount == 1) {
     runTest8();
-  }
-  else if (resetCount == 2)
-  {
+  } else if (resetCount == 2) {
     runTest9();
-  }
-  else if (resetCount == 3)
-  {
+  } else if (resetCount == 3) {
     runTest10();
-  }
-  else if (resetCount == 4)
-  {
+  } else if (resetCount == 4) {
     resetTests();
   }
 }  //end of loop()
 
-void runTest1()
-{
+void runTest1() {
   Serial.println(F("\n1st test - running with WiFi unconfigured"));
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
   waitPushbutton(false, blinkDelay);
 }
 
-void runTest2()
-{
+void runTest2() {
   Serial.println(F("\n2nd test - Automatic Modem Sleep"));
   Serial.println(F("connecting WiFi, please wait until the LED blinks"));
   initWiFi();
-  if (WiFi.localIP())
-  {  // won't go into Automatic Sleep without an active WiFi connection
+  if (WiFi.localIP()) {  // won't go into Automatic Sleep without an active WiFi connection
     Serial.println(F("The amperage will drop in 7 seconds."));
     readVoltage();  // read internal VCC
     Serial.println(F("press the switch to continue"));
@@ -208,15 +189,12 @@ void runTest2()
          At 100 mS and above it's essentially all delay() time.  On an oscilloscope you'll see the
          time between beacons at > 67 mA more often with less delay() percentage. You can change
          the '90' mS to other values to see the effect it has on Automatic Modem Sleep. */
-  }
-  else
-  {
+  } else {
     Serial.println(F("no WiFi connection, test skipped"));
   }
 }
 
-void runTest3()
-{
+void runTest3() {
   Serial.println(F("\n3rd test - Forced Modem Sleep"));
   WiFi.shutdown(nv->wss);  // shut the modem down and save the WiFi state for faster reconnection
   //  WiFi.forceSleepBegin(delay_in_uS);  // alternate method of Forced Modem Sleep for an optional timed shutdown,
@@ -230,8 +208,7 @@ void runTest3()
       to get minimum amperage.*/
 }
 
-void runTest4()
-{
+void runTest4() {
   Serial.println(F("\n4th test - Automatic Light Sleep"));
   Serial.println(F("reconnecting WiFi with forceSleepWake"));
   Serial.println(F("Automatic Light Sleep begins after WiFi connects (LED blinks)"));
@@ -243,12 +220,10 @@ void runTest4()
   WiFi.setSleepMode(WIFI_LIGHT_SLEEP, 3);  // Automatic Light Sleep, DTIM listen interval = 3
   // at higher DTIM intervals you'll have a hard time establishing and maintaining a connection
   wifiTimeout.reset(timeout);
-  while (((!WiFi.localIP()) || (WiFi.status() != WL_CONNECTED)) && (!wifiTimeout))
-  {
+  while (((!WiFi.localIP()) || (WiFi.status() != WL_CONNECTED)) && (!wifiTimeout)) {
     yield();
   }
-  if ((WiFi.status() == WL_CONNECTED) && WiFi.localIP())
-  {
+  if ((WiFi.status() == WL_CONNECTED) && WiFi.localIP()) {
     // won't go into Automatic Sleep without an active WiFi connection
     float reConn = (millis() - wifiBegin);
     Serial.print(F("WiFi connect time = "));
@@ -258,15 +233,12 @@ void runTest4()
     waitPushbutton(true, 350); /* Below 100 mS delay it only goes into 'Automatic Modem Sleep',
         and below ~ 350 mS delay() the 'Automatic Light Sleep' is less frequent.  Above 500 mS
         delay() doesn't make significant improvement in power savings. */
-  }
-  else
-  {
+  } else {
     Serial.println(F("no WiFi connection, test skipped"));
   }
 }
 
-void runTest5()
-{
+void runTest5() {
   Serial.println(F("\n5th test - Timed Light Sleep, wake in 10 seconds"));
   Serial.println(F("Press the button when you're ready to proceed"));
   waitPushbutton(true, blinkDelay);
@@ -289,8 +261,7 @@ void runTest5()
   Serial.println(F("Woke up!"));  // the interrupt callback hits before this is executed
 }
 
-void runTest6()
-{
+void runTest6() {
   Serial.println(F("\n6th test - Forced Light Sleep, wake with GPIO interrupt"));
   Serial.flush();
   WiFi.mode(WIFI_OFF);      // you must turn the modem off; using disconnect won't work
@@ -309,14 +280,12 @@ void runTest6()
   Serial.println(F("Woke up!"));  // the interrupt callback hits before this is executed*/
 }
 
-void runTest7()
-{
+void runTest7() {
   Serial.println(F("\n7th test - Deep Sleep for 10 seconds, reset and wake with RF_DEFAULT"));
   initWiFi();     // initialize WiFi since we turned it off in the last test
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
-  while (!digitalRead(WAKE_UP_PIN))
-  {  // wait for them to release the switch from the previous test
+  while (!digitalRead(WAKE_UP_PIN)) {  // wait for them to release the switch from the previous test
     delay(10);
   }
   delay(50);                          // debounce time for the switch, pushbutton released
@@ -335,8 +304,7 @@ void runTest7()
   Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
-void runTest8()
-{
+void runTest8() {
   Serial.println(F("\n8th test - in RF_DEFAULT, Deep Sleep for 10 seconds, reset and wake with RFCAL"));
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
@@ -350,8 +318,7 @@ void runTest8()
   Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
-void runTest9()
-{
+void runTest9() {
   Serial.println(F("\n9th test - in RFCAL, Deep Sleep Instant for 10 seconds, reset and wake with NO_RFCAL"));
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
@@ -364,8 +331,7 @@ void runTest9()
   Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
-void runTest10()
-{
+void runTest10() {
   Serial.println(F("\n10th test - in NO_RFCAL, Deep Sleep Instant for 10 seconds, reset and wake with RF_DISABLED"));
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
@@ -378,8 +344,7 @@ void runTest10()
   Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
-void resetTests()
-{
+void resetTests() {
   readVoltage();  // read internal VCC
   Serial.println(F("\nTests completed, in RF_DISABLED, press the switch to do an ESP.restart()"));
   memset(&nv->wss, 0, sizeof(nv->wss) * 2);  // wipe saved WiFi states, comment this if you want to keep them
@@ -387,78 +352,61 @@ void resetTests()
   ESP.restart();
 }
 
-void waitPushbutton(bool usesDelay, unsigned int delayTime)
-{  // loop until they press the switch
+void waitPushbutton(bool usesDelay, unsigned int delayTime) {  // loop until they press the switch
   // note: 2 different modes, as 3 of the power saving modes need a delay() to activate fully
-  if (!usesDelay)
-  {  // quick interception of pushbutton press, no delay() used
+  if (!usesDelay) {  // quick interception of pushbutton press, no delay() used
     blinkLED.reset(delayTime);
-    while (digitalRead(WAKE_UP_PIN))
-    {  // wait for a pushbutton press
-      if (blinkLED)
-      {
+    while (digitalRead(WAKE_UP_PIN)) {  // wait for a pushbutton press
+      if (blinkLED) {
         digitalWrite(LED, !digitalRead(LED));  // toggle the activity LED
       }
       yield();  // this would be a good place for ArduinoOTA.handle();
     }
-  }
-  else
-  {  // long delay() for the 3 modes that need it, but it misses quick switch presses
-    while (digitalRead(WAKE_UP_PIN))
-    {                                        // wait for a pushbutton press
+  } else {                                   // long delay() for the 3 modes that need it, but it misses quick switch presses
+    while (digitalRead(WAKE_UP_PIN)) {       // wait for a pushbutton press
       digitalWrite(LED, !digitalRead(LED));  // toggle the activity LED
       delay(delayTime);                      // another good place for ArduinoOTA.handle();
-      if (delayTime < 100)
-      {
+      if (delayTime < 100) {
         altDelay.reset(100 - delayTime);  // pad the time < 100 mS with some real CPU cycles
-        while (!altDelay)
-        {  // this simulates 'your program running', not delay() time
+        while (!altDelay) {               // this simulates 'your program running', not delay() time
         }
       }
     }
   }
-  delay(50);  // debounce time for the switch, pushbutton pressed
-  while (!digitalRead(WAKE_UP_PIN))
-  {  // now wait for them to release the pushbutton
+  delay(50);                           // debounce time for the switch, pushbutton pressed
+  while (!digitalRead(WAKE_UP_PIN)) {  // now wait for them to release the pushbutton
     delay(10);
   }
   delay(50);  // debounce time for the switch, pushbutton released
 }
 
-void readVoltage()
-{  // read internal VCC
+void readVoltage() {  // read internal VCC
   float volts = ESP.getVcc();
   Serial.printf("The internal VCC reads %1.2f volts\n", volts / 1000);
 }
 
-void printMillis()
-{
+void printMillis() {
   Serial.print(F("millis() = "));  // show that millis() isn't correct across most Sleep modes
   Serial.println(millis());
   Serial.flush();  // needs a Serial.flush() else it may not print the whole message before sleeping
 }
 
-void updateRTCcrc()
-{  // updates the reset count CRC
+void updateRTCcrc() {  // updates the reset count CRC
   nv->rtcData.crc32 = crc32((uint8_t*)&nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
 }
 
-void initWiFi()
-{
+void initWiFi() {
   digitalWrite(LED, LOW);         // give a visual indication that we're alive but busy with WiFi
   uint32_t wifiBegin = millis();  // how long does it take to connect
-  if ((crc32((uint8_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss)) && !WiFi.shutdownValidCRC(nv->wss)))
-  {
+  if ((crc32((uint8_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss)) && !WiFi.shutdownValidCRC(nv->wss))) {
     // if good copy of wss, overwrite invalid (primary) copy
     memcpy((uint32_t*)&nv->wss, (uint32_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss));
   }
-  if (WiFi.shutdownValidCRC(nv->wss))
-  {                                                                                      // if we have a valid WiFi saved state
+  if (WiFi.shutdownValidCRC(nv->wss)) {                                                  // if we have a valid WiFi saved state
     memcpy((uint32_t*)&nv->rtcData.rstCount + 1, (uint32_t*)&nv->wss, sizeof(nv->wss));  // save a copy of it
     Serial.println(F("resuming WiFi"));
   }
-  if (!(WiFi.resumeFromShutdown(nv->wss)))
-  {  // couldn't resume, or no valid saved WiFi state yet
+  if (!(WiFi.resumeFromShutdown(nv->wss))) {  // couldn't resume, or no valid saved WiFi state yet
     /* Explicitly set the ESP8266 as a WiFi-client (STAtion mode), otherwise by default it
       would try to act as both a client and an access-point and could cause network issues
       with other WiFi devices on your network. */
@@ -473,12 +421,10 @@ void initWiFi()
     DEBUG_PRINTLN(WiFi.macAddress());
   }
   wifiTimeout.reset(timeout);
-  while (((!WiFi.localIP()) || (WiFi.status() != WL_CONNECTED)) && (!wifiTimeout))
-  {
+  while (((!WiFi.localIP()) || (WiFi.status() != WL_CONNECTED)) && (!wifiTimeout)) {
     yield();
   }
-  if ((WiFi.status() == WL_CONNECTED) && WiFi.localIP())
-  {
+  if ((WiFi.status() == WL_CONNECTED) && WiFi.localIP()) {
     DEBUG_PRINTLN(F("WiFi connected"));
     Serial.print(F("WiFi connect time = "));
     float reConn = (millis() - wifiBegin);
@@ -487,9 +433,7 @@ void initWiFi()
     DEBUG_PRINTLN(WiFi.gatewayIP());
     DEBUG_PRINT(F("my IP address: "));
     DEBUG_PRINTLN(WiFi.localIP());
-  }
-  else
-  {
+  } else {
     Serial.println(F("WiFi timed out and didn't connect"));
   }
   WiFi.setAutoReconnect(true);
diff --git a/libraries/esp8266/examples/MMU48K/MMU48K.ino b/libraries/esp8266/examples/MMU48K/MMU48K.ino
index a0fad297d5..6faeb15363 100644
--- a/libraries/esp8266/examples/MMU48K/MMU48K.ino
+++ b/libraries/esp8266/examples/MMU48K/MMU48K.ino
@@ -13,14 +13,14 @@ uint32_t timed_byte_read(char* pc, uint32_t* o);
 uint32_t timed_byte_read2(char* pc, uint32_t* o);
 int      divideA_B(int a, int b);
 
-int*     nullPointer       = NULL;
+int* nullPointer = NULL;
 
-char*    probe_b           = NULL;
-short*   probe_s           = NULL;
-char*    probe_c           = (char*)0x40110000;
-short*   unaligned_probe_s = NULL;
+char*  probe_b           = NULL;
+short* probe_s           = NULL;
+char*  probe_c           = (char*)0x40110000;
+short* unaligned_probe_s = NULL;
 
-uint32_t read_var          = 0x11223344;
+uint32_t read_var = 0x11223344;
 
 /*
   Notes,
@@ -42,11 +42,9 @@ uint32_t         gobble[256] IRAM_ATTR;
 constexpr size_t gobble_sz = sizeof(gobble);
 #endif
 
-bool isValid(uint32_t* probe)
-{
+bool isValid(uint32_t* probe) {
   bool rc = true;
-  if (NULL == probe)
-  {
+  if (NULL == probe) {
     ets_uart_printf("\nNULL memory pointer %p ...\n", probe);
     return false;
   }
@@ -54,14 +52,12 @@ bool isValid(uint32_t* probe)
   ets_uart_printf("\nTesting for valid memory at %p ...\n", probe);
   uint32_t savePS   = xt_rsil(15);
   uint32_t saveData = *probe;
-  for (size_t i = 0; i < 32; i++)
-  {
+  for (size_t i = 0; i < 32; i++) {
     *probe = BIT(i);
     asm volatile("" ::
                      : "memory");
     uint32_t val = *probe;
-    if (val != BIT(i))
-    {
+    if (val != BIT(i)) {
       ets_uart_printf("  Read 0x%08X != Wrote 0x%08X\n", val, (uint32_t)BIT(i));
       rc = false;
     }
@@ -72,20 +68,16 @@ bool isValid(uint32_t* probe)
   return rc;
 }
 
-void dump_mem32(const void* addr, const size_t len)
-{
+void dump_mem32(const void* addr, const size_t len) {
   uint32_t* addr32 = (uint32_t*)addr;
   ets_uart_printf("\n");
-  if ((uintptr_t)addr32 & 3)
-  {
+  if ((uintptr_t)addr32 & 3) {
     ets_uart_printf("non-32-bit access\n");
     ets_delay_us(12000);
   }
-  for (size_t i = 0; i < len;)
-  {
+  for (size_t i = 0; i < len;) {
     ets_uart_printf("%p: ", &addr32[i]);
-    do
-    {
+    do {
       ets_uart_printf(" 0x%08x", addr32[i]);
     } while (i++, (i & 3) && (i < len));
     ets_uart_printf("\n");
@@ -95,20 +87,17 @@ void dump_mem32(const void* addr, const size_t len)
 
 extern "C" void _text_end(void);
 // extern void *_text_end;
-void            print_mmu_status(Print& oStream)
-{
+void print_mmu_status(Print& oStream) {
   oStream.println();
   oStream.printf_P(PSTR("MMU Configuration"));
   oStream.println();
   oStream.println();
   uint32_t iram_bank_reg = ESP8266_DREG(0x24);
-  if (0 == (iram_bank_reg & 0x10))
-  {  // if bit clear, is enabled
+  if (0 == (iram_bank_reg & 0x10)) {  // if bit clear, is enabled
     oStream.printf_P(PSTR("  IRAM block mapped to:    0x40108000"));
     oStream.println();
   }
-  if (0 == (iram_bank_reg & 0x08))
-  {
+  if (0 == (iram_bank_reg & 0x08)) {
     oStream.printf_P(PSTR("  IRAM block mapped to:    0x4010C000"));
     oStream.println();
   }
@@ -133,8 +122,7 @@ void            print_mmu_status(Print& oStream)
 #endif
 }
 
-void setup()
-{
+void setup() {
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
   // Serial.begin(74880);
@@ -161,11 +149,9 @@ void setup()
 #endif
 
 #if (MMU_IRAM_SIZE > 0x8000) || defined(MMU_IRAM_HEAP) || defined(MMU_SEC_HEAP)
-  if (isValid(gobble))
-  {
+  if (isValid(gobble)) {
     // Put something in our new memory
-    for (size_t i = 0; i < (gobble_sz / 4); i++)
-    {
+    for (size_t i = 0; i < (gobble_sz / 4); i++) {
       gobble[i] = (uint32_t)&gobble[i];
     }
 
@@ -185,12 +171,9 @@ void setup()
   unaligned_probe_s = (short*)((uintptr_t)gobble + 1);
 }
 
-void processKey(Print& out, int hotKey)
-{
-  switch (hotKey)
-  {
-    case 't':
-    {
+void processKey(Print& out, int hotKey) {
+  switch (hotKey) {
+    case 't': {
       uint32_t tmp;
       out.printf_P(PSTR("Test how much time is added by exception handling"));
       out.println();
@@ -242,8 +225,7 @@ void processKey(Print& out, int hotKey)
       out.printf_P(PSTR("Read Byte from iRAM, 0x%02X at %p"), probe_b[0], probe_b);
       out.println();
       break;
-    case 'B':
-    {
+    case 'B': {
       out.printf_P(PSTR("Load/Store exception by writing byte to iRAM"));
       out.println();
       char val = 0x55;
@@ -262,8 +244,7 @@ void processKey(Print& out, int hotKey)
       out.printf_P(PSTR("Read short from iRAM, 0x%04X at %p"), probe_s[0], probe_s);
       out.println();
       break;
-    case 'S':
-    {
+    case 'S': {
       out.printf_P(PSTR("Load/Store exception by writing short to iRAM"));
       out.println();
       short int val = 0x0AA0;
@@ -327,21 +308,17 @@ void processKey(Print& out, int hotKey)
   }
 }
 
-void serialClientLoop(void)
-{
-  if (Serial.available() > 0)
-  {
+void serialClientLoop(void) {
+  if (Serial.available() > 0) {
     int hotKey = Serial.read();
     processKey(Serial, hotKey);
   }
 }
 
-void loop()
-{
+void loop() {
   serialClientLoop();
 }
 
-int __attribute__((noinline)) divideA_B(int a, int b)
-{
+int __attribute__((noinline)) divideA_B(int a, int b) {
   return (a / b);
 }
diff --git a/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino b/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
index 1039347bda..ce72d96f74 100644
--- a/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
+++ b/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
@@ -52,14 +52,14 @@
 #include <sntp.h>  // sntp_servermode_dhcp()
 
 // for testing purpose:
-extern "C" int                            clock_gettime(clockid_t unused, struct timespec* tp);
+extern "C" int clock_gettime(clockid_t unused, struct timespec* tp);
 
 ////////////////////////////////////////////////////////
 
-static timeval                            tv;
-static timespec                           tp;
-static time_t                             now;
-static uint32_t                           now_ms, now_us;
+static timeval  tv;
+static timespec tp;
+static time_t   now;
+static uint32_t now_ms, now_us;
 
 static esp8266::polledTimeout::periodicMs showTimeNow(60000);
 static int                                time_machine_days     = 0;  // 0 = present
@@ -88,8 +88,7 @@ static bool                               time_machine_run_once = false;
   Serial.print(" " #w "="); \
   Serial.print(tm->tm_##w);
 
-void printTm(const char* what, const tm* tm)
-{
+void printTm(const char* what, const tm* tm) {
   Serial.print(what);
   PTM(isdst);
   PTM(yday);
@@ -102,8 +101,7 @@ void printTm(const char* what, const tm* tm)
   PTM(sec);
 }
 
-void showTime()
-{
+void showTime() {
   gettimeofday(&tv, nullptr);
   clock_gettime(0, &tp);
   now    = time(nullptr);
@@ -148,19 +146,14 @@ void showTime()
   Serial.print(ctime(&now));
 
   // lwIP v2 is able to list more details about the currently configured SNTP servers
-  for (int i = 0; i < SNTP_MAX_SERVERS; i++)
-  {
+  for (int i = 0; i < SNTP_MAX_SERVERS; i++) {
     IPAddress   sntp = *sntp_getserver(i);
     const char* name = sntp_getservername(i);
-    if (sntp.isSet())
-    {
+    if (sntp.isSet()) {
       Serial.printf("sntp%d:     ", i);
-      if (name)
-      {
+      if (name) {
         Serial.printf("%s (%s) ", name, sntp.toString().c_str());
-      }
-      else
-      {
+      } else {
         Serial.printf("%s ", sntp.toString().c_str());
       }
       Serial.printf("- IPv6: %s - Reachability: %o\n",
@@ -176,11 +169,9 @@ void showTime()
   time_t  prevtime = time(nullptr);
   gettimeofday(&prevtv, nullptr);
 
-  while (true)
-  {
+  while (true) {
     gettimeofday(&tv, nullptr);
-    if (tv.tv_sec != prevtv.tv_sec)
-    {
+    if (tv.tv_sec != prevtv.tv_sec) {
       Serial.printf("time(): %u   gettimeofday(): %u.%06u  seconds are unchanged\n",
                     (uint32_t)prevtime,
                     (uint32_t)prevtv.tv_sec, (uint32_t)prevtv.tv_usec);
@@ -196,43 +187,33 @@ void showTime()
   Serial.println();
 }
 
-void time_is_set(bool from_sntp /* <= this parameter is optional */)
-{
+void time_is_set(bool from_sntp /* <= this parameter is optional */) {
   // in CONT stack, unlike ISRs,
   // any function is allowed in this callback
 
-  if (time_machine_days == 0)
-  {
-    if (time_machine_running)
-    {
+  if (time_machine_days == 0) {
+    if (time_machine_running) {
       time_machine_run_once = true;
       time_machine_running  = false;
-    }
-    else
-    {
+    } else {
       time_machine_running = from_sntp && !time_machine_run_once;
     }
-    if (time_machine_running)
-    {
+    if (time_machine_running) {
       Serial.printf("\n-- \n-- Starting time machine demo to show libc's "
                     "automatic DST handling\n-- \n");
     }
   }
 
   Serial.print("settimeofday(");
-  if (from_sntp)
-  {
+  if (from_sntp) {
     Serial.print("SNTP");
-  }
-  else
-  {
+  } else {
     Serial.print("USER");
   }
   Serial.print(")");
 
   // time machine demo
-  if (time_machine_running)
-  {
+  if (time_machine_running) {
     now          = time(nullptr);
     const tm* tm = localtime(&now);
     Serial.printf(": future=%3ddays: DST=%s - ",
@@ -242,25 +223,19 @@ void time_is_set(bool from_sntp /* <= this parameter is optional */)
     gettimeofday(&tv, nullptr);
     constexpr int days = 30;
     time_machine_days += days;
-    if (time_machine_days > 360)
-    {
+    if (time_machine_days > 360) {
       tv.tv_sec -= (time_machine_days - days) * 60 * 60 * 24;
       time_machine_days = 0;
-    }
-    else
-    {
+    } else {
       tv.tv_sec += days * 60 * 60 * 24;
     }
     settimeofday(&tv, nullptr);
-  }
-  else
-  {
+  } else {
     Serial.println();
   }
 }
 
-void setup()
-{
+void setup() {
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
 
@@ -308,10 +283,8 @@ void setup()
   showTime();
 }
 
-void loop()
-{
-  if (showTimeNow)
-  {
+void loop() {
+  if (showTimeNow) {
     showTime();
   }
 }
diff --git a/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino b/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
index 89e4145c72..b96067b800 100644
--- a/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
+++ b/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
@@ -16,7 +16,7 @@
 uint32_t calculateCRC32(const uint8_t* data, size_t length);
 
 // helper function to dump memory contents as hex
-void     printMemory();
+void printMemory();
 
 // Structure which will be stored in RTC memory.
 // First field is CRC32, which is calculated based on the
@@ -29,15 +29,13 @@ struct
   byte     data[508];
 } rtcData;
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.println();
   delay(1000);
 
   // Read struct from RTC memory
-  if (ESP.rtcUserMemoryRead(0, (uint32_t*)&rtcData, sizeof(rtcData)))
-  {
+  if (ESP.rtcUserMemoryRead(0, (uint32_t*)&rtcData, sizeof(rtcData))) {
     Serial.println("Read: ");
     printMemory();
     Serial.println();
@@ -46,26 +44,21 @@ void setup()
     Serial.println(crcOfData, HEX);
     Serial.print("CRC32 read from RTC: ");
     Serial.println(rtcData.crc32, HEX);
-    if (crcOfData != rtcData.crc32)
-    {
+    if (crcOfData != rtcData.crc32) {
       Serial.println("CRC32 in RTC memory doesn't match CRC32 of data. Data is probably invalid!");
-    }
-    else
-    {
+    } else {
       Serial.println("CRC32 check ok, data is probably valid.");
     }
   }
 
   // Generate new data set for the struct
-  for (size_t i = 0; i < sizeof(rtcData.data); i++)
-  {
+  for (size_t i = 0; i < sizeof(rtcData.data); i++) {
     rtcData.data[i] = random(0, 128);
   }
   // Update CRC32 of data
   rtcData.crc32 = calculateCRC32((uint8_t*)&rtcData.data[0], sizeof(rtcData.data));
   // Write struct to RTC memory
-  if (ESP.rtcUserMemoryWrite(0, (uint32_t*)&rtcData, sizeof(rtcData)))
-  {
+  if (ESP.rtcUserMemoryWrite(0, (uint32_t*)&rtcData, sizeof(rtcData))) {
     Serial.println("Write: ");
     printMemory();
     Serial.println();
@@ -75,26 +68,20 @@ void setup()
   ESP.deepSleep(5e6);
 }
 
-void loop()
-{
+void loop() {
 }
 
-uint32_t calculateCRC32(const uint8_t* data, size_t length)
-{
+uint32_t calculateCRC32(const uint8_t* data, size_t length) {
   uint32_t crc = 0xffffffff;
-  while (length--)
-  {
+  while (length--) {
     uint8_t c = *data++;
-    for (uint32_t i = 0x80; i > 0; i >>= 1)
-    {
+    for (uint32_t i = 0x80; i > 0; i >>= 1) {
       bool bit = crc & 0x80000000;
-      if (c & i)
-      {
+      if (c & i) {
         bit = !bit;
       }
       crc <<= 1;
-      if (bit)
-      {
+      if (bit) {
         crc ^= 0x04c11db7;
       }
     }
@@ -103,20 +90,15 @@ uint32_t calculateCRC32(const uint8_t* data, size_t length)
 }
 
 //prints all rtcData, including the leading crc32
-void printMemory()
-{
+void printMemory() {
   char     buf[3];
   uint8_t* ptr = (uint8_t*)&rtcData;
-  for (size_t i = 0; i < sizeof(rtcData); i++)
-  {
+  for (size_t i = 0; i < sizeof(rtcData); i++) {
     sprintf(buf, "%02X", ptr[i]);
     Serial.print(buf);
-    if ((i + 1) % 32 == 0)
-    {
+    if ((i + 1) % 32 == 0) {
       Serial.println();
-    }
-    else
-    {
+    } else {
       Serial.print(" ");
     }
   }
diff --git a/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino b/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
index bdf660244f..2b1cd01129 100644
--- a/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
+++ b/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
@@ -1,7 +1,6 @@
 #define TIMEOUT (10000UL)  // Maximum time to wait for serial activity to start
 
-void setup()
-{
+void setup() {
   // put your setup code here, to run once:
 
   Serial.begin(115200);
@@ -10,13 +9,11 @@ void setup()
   // There must be activity on the serial port for the baudrate to be detected
   unsigned long detectedBaudrate = Serial.detectBaudrate(TIMEOUT);
 
-  if (detectedBaudrate)
-  {
+  if (detectedBaudrate) {
     Serial.printf("\nDetected baudrate is %lu, switching to that baudrate now...\n", detectedBaudrate);
 
     // Wait for printf to finish
-    while (Serial.availableForWrite() != UART_TX_FIFO_SIZE)
-    {
+    while (Serial.availableForWrite() != UART_TX_FIFO_SIZE) {
       yield();
     }
 
@@ -25,14 +22,11 @@ void setup()
 
     // After this, any writing to Serial will print gibberish on the serial monitor if the baudrate doesn't match
     Serial.begin(detectedBaudrate);
-  }
-  else
-  {
+  } else {
     Serial.println("\nNothing detected");
   }
 }
 
-void loop()
-{
+void loop() {
   // put your main code here, to run repeatedly:
 }
diff --git a/libraries/esp8266/examples/SerialStress/SerialStress.ino b/libraries/esp8266/examples/SerialStress/SerialStress.ino
index 6c22ce8c7b..4e34da7201 100644
--- a/libraries/esp8266/examples/SerialStress/SerialStress.ino
+++ b/libraries/esp8266/examples/SerialStress/SerialStress.ino
@@ -21,10 +21,10 @@
 #define TIMEOUT 5000
 #define DEBUG(x...)  //x
 
-uint8_t         buf[BUFFER_SIZE];
-uint8_t         temp[BUFFER_SIZE];
-bool            reading              = true;
-size_t          testReadBytesTimeout = 0;
+uint8_t buf[BUFFER_SIZE];
+uint8_t temp[BUFFER_SIZE];
+bool    reading              = true;
+size_t  testReadBytesTimeout = 0;
 
 static size_t   out_idx = 0, in_idx = 0;
 static size_t   local_receive_size = 0;
@@ -34,36 +34,30 @@ static uint64_t in_total = 0, in_prev = 0;
 static uint64_t start_ms, last_ms;
 static uint64_t timeout;
 
-Stream*         logger;
+Stream* logger;
 
-void            error(const char* what)
-{
+void error(const char* what) {
   logger->printf("\nerror: %s after %ld minutes\nread idx:  %d\nwrite idx: %d\ntotal:     %ld\nlast read: %d\nmaxavail:  %d\n",
                  what, (long)((millis() - start_ms) / 60000), in_idx, out_idx, (long)in_total, (int)local_receive_size, maxavail);
-  if (Serial.hasOverrun())
-  {
+  if (Serial.hasOverrun()) {
     logger->printf("overrun!\n");
   }
   logger->printf("should be (size=%d idx=%d..%d):\n    ", BUFFER_SIZE, in_idx, in_idx + local_receive_size - 1);
-  for (size_t i = in_idx; i < in_idx + local_receive_size; i++)
-  {
+  for (size_t i = in_idx; i < in_idx + local_receive_size; i++) {
     logger->printf("%02x(%c) ", buf[i], (unsigned char)((buf[i] > 31 && buf[i] < 128) ? buf[i] : '.'));
   }
   logger->print("\n\nis: ");
-  for (size_t i = 0; i < local_receive_size; i++)
-  {
+  for (size_t i = 0; i < local_receive_size; i++) {
     logger->printf("%02x(%c) ", temp[i], (unsigned char)((temp[i] > 31 && temp[i] < 128) ? temp[i] : '.'));
   }
   logger->println("\n\n");
 
-  while (true)
-  {
+  while (true) {
     delay(1000);
   }
 }
 
-void setup()
-{
+void setup() {
   pinMode(LED_BUILTIN, OUTPUT);
 
   Serial.begin(BAUD);
@@ -90,8 +84,7 @@ void setup()
   logger->printf("press 't' to toggle timeout testing on readBytes\n");
 
   // prepare send/compare buffer
-  for (size_t i = 0; i < sizeof buf; i++)
-  {
+  for (size_t i = 0; i < sizeof buf; i++) {
     buf[i] = (uint8_t)i;
   }
 
@@ -100,8 +93,7 @@ void setup()
 
   while (Serial.read() == -1)
     ;
-  if (Serial.hasOverrun())
-  {
+  if (Serial.hasOverrun()) {
     logger->print("overrun?\n");
   }
 
@@ -109,72 +101,58 @@ void setup()
   logger->println("setup done");
 }
 
-void loop()
-{
+void loop() {
   size_t maxlen = Serial.availableForWrite();
   // check remaining space in buffer
-  if (maxlen > BUFFER_SIZE - out_idx)
-  {
+  if (maxlen > BUFFER_SIZE - out_idx) {
     maxlen = BUFFER_SIZE - out_idx;
   }
   // check if not cycling more than buffer size relatively to input
   size_t in_out = out_idx == in_idx ? BUFFER_SIZE : (in_idx + BUFFER_SIZE - out_idx - 1) % BUFFER_SIZE;
-  if (maxlen > in_out)
-  {
+  if (maxlen > in_out) {
     maxlen = in_out;
   }
   DEBUG(logger->printf("(aw%i/w%i", Serial.availableForWrite(), maxlen));
   size_t local_written_size = Serial.write(buf + out_idx, maxlen);
   DEBUG(logger->printf(":w%i/aw%i/ar%i)\n", local_written_size, Serial.availableForWrite(), Serial.available()));
-  if (local_written_size > maxlen)
-  {
+  if (local_written_size > maxlen) {
     error("bad write");
   }
-  if ((out_idx += local_written_size) == BUFFER_SIZE)
-  {
+  if ((out_idx += local_written_size) == BUFFER_SIZE) {
     out_idx = 0;
   }
   yield();
 
   DEBUG(logger->printf("----------\n"));
 
-  if (Serial.hasOverrun())
-  {
+  if (Serial.hasOverrun()) {
     logger->printf("rx overrun!\n");
   }
-  if (Serial.hasRxError())
-  {
+  if (Serial.hasRxError()) {
     logger->printf("rx error!\n");
   }
 
-  if (reading)
-  {
+  if (reading) {
     // receive data
     maxlen = Serial.available() + testReadBytesTimeout;
-    if (maxlen > maxavail)
-    {
+    if (maxlen > maxavail) {
       maxavail = maxlen;
     }
     // check space in temp receive buffer
-    if (maxlen > BUFFER_SIZE - in_idx)
-    {
+    if (maxlen > BUFFER_SIZE - in_idx) {
       maxlen = BUFFER_SIZE - in_idx;
     }
     DEBUG(logger->printf("(ar%i/r%i", Serial.available(), maxlen));
     local_receive_size = Serial.readBytes(temp, maxlen);
     DEBUG(logger->printf(":r%i/ar%i)\n", local_receive_size, Serial.available()));
-    if (local_receive_size > maxlen)
-    {
+    if (local_receive_size > maxlen) {
       error("bad read");
     }
-    if (local_receive_size)
-    {
-      if (memcmp(buf + in_idx, temp, local_receive_size) != 0)
-      {
+    if (local_receive_size) {
+      if (memcmp(buf + in_idx, temp, local_receive_size) != 0) {
         error("fail");
       }
-      if ((in_idx += local_receive_size) == BUFFER_SIZE)
-      {
+      if ((in_idx += local_receive_size) == BUFFER_SIZE) {
         in_idx = 0;
       }
       in_total += local_receive_size;
@@ -183,13 +161,11 @@ void loop()
   }
 
   // say something on data every second
-  if ((size_for_led += local_written_size) >= size_for_1sec || millis() > timeout)
-  {
+  if ((size_for_led += local_written_size) >= size_for_1sec || millis() > timeout) {
     digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
     size_for_led = 0;
 
-    if (in_prev == in_total)
-    {
+    if (in_prev == in_total) {
       error("receiving nothing?\n");
     }
 
@@ -203,8 +179,7 @@ void loop()
   }
 
   if (logger->available())
-    switch (logger->read())
-    {
+    switch (logger->read()) {
       case 's':
         logger->println("now stopping reading, keeping writing");
         reading = false;
diff --git a/libraries/esp8266/examples/SigmaDeltaDemo/SigmaDeltaDemo.ino b/libraries/esp8266/examples/SigmaDeltaDemo/SigmaDeltaDemo.ino
index 83b919387e..2be0f88e9f 100644
--- a/libraries/esp8266/examples/SigmaDeltaDemo/SigmaDeltaDemo.ino
+++ b/libraries/esp8266/examples/SigmaDeltaDemo/SigmaDeltaDemo.ino
@@ -2,8 +2,7 @@
 
 #include "sigma_delta.h"
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   pinMode(LED_BUILTIN, OUTPUT);  // blinkie & sigma-delta mix
   uint32_t reqFreq = 1000;
@@ -16,8 +15,7 @@ void setup()
   Serial.printf("Frequency = %u\n", realFreq);
 }
 
-void loop()
-{
+void loop() {
   uint8_t duty, iRepeat;
 
   Serial.println("Attaching the built in led to the sigma delta source now\n");
@@ -25,16 +23,13 @@ void loop()
   sigmaDeltaAttachPin(LED_BUILTIN);
 
   Serial.println("Dimming builtin led...\n");
-  for (iRepeat = 0; iRepeat < 10; iRepeat++)
-  {
-    for (duty = 0; duty < 255; duty = duty + 5)
-    {
+  for (iRepeat = 0; iRepeat < 10; iRepeat++) {
+    for (duty = 0; duty < 255; duty = duty + 5) {
       sigmaDeltaWrite(0, duty);
       delay(10);
     }
 
-    for (duty = 255; duty > 0; duty = duty - 5)
-    {
+    for (duty = 255; duty > 0; duty = duty - 5) {
       sigmaDeltaWrite(0, duty);
       delay(10);
     }
@@ -42,8 +37,7 @@ void loop()
 
   Serial.println("Detaching builtin led & playing a blinkie\n");
   sigmaDeltaDetachPin(LED_BUILTIN);
-  for (iRepeat = 0; iRepeat < 20; iRepeat++)
-  {
+  for (iRepeat = 0; iRepeat < 20; iRepeat++) {
     digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
     delay(500);
   }
diff --git a/libraries/esp8266/examples/StreamString/StreamString.ino b/libraries/esp8266/examples/StreamString/StreamString.ino
index 66de2494dc..d4571a0bfb 100644
--- a/libraries/esp8266/examples/StreamString/StreamString.ino
+++ b/libraries/esp8266/examples/StreamString/StreamString.ino
@@ -4,19 +4,14 @@
 #include <StreamDev.h>
 #include <StreamString.h>
 
-void loop()
-{
+void loop() {
   delay(1000);
 }
 
-void checksketch(const char* what, const char* res1, const char* res2)
-{
-  if (strcmp(res1, res2) == 0)
-  {
+void checksketch(const char* what, const char* res1, const char* res2) {
+  if (strcmp(res1, res2) == 0) {
     Serial << "PASSED: Test " << what << " (result: '" << res1 << "')\n";
-  }
-  else
-  {
+  } else {
     Serial << "FAILED: Test " << what << ": '" << res1 << "' <> '" << res2 << "' !\n";
   }
 }
@@ -25,21 +20,19 @@ void checksketch(const char* what, const char* res1, const char* res2)
 #define check(what, res1, res2) checksketch(what, res1, res2)
 #endif
 
-void testStringPtrProgmem()
-{
+void testStringPtrProgmem() {
   static const char inProgmem[] PROGMEM = "I am in progmem";
   auto              inProgmem2          = F("I am too in progmem");
 
-  int               heap                = (int)ESP.getFreeHeap();
-  auto              stream1             = StreamConstPtr(inProgmem, sizeof(inProgmem) - 1);
-  auto              stream2             = StreamConstPtr(inProgmem2);
+  int  heap    = (int)ESP.getFreeHeap();
+  auto stream1 = StreamConstPtr(inProgmem, sizeof(inProgmem) - 1);
+  auto stream2 = StreamConstPtr(inProgmem2);
   Serial << stream1 << " - " << stream2 << "\n";
   heap -= (int)ESP.getFreeHeap();
   check("NO heap occupation while streaming progmem strings", String(heap).c_str(), "0");
 }
 
-void testStreamString()
-{
+void testStreamString() {
   String       inputString = "hello";
   StreamString result;
 
@@ -166,12 +159,9 @@ void testStreamString()
     Serial << stream << "\n";
     heap -= (int)ESP.getFreeHeap();
     String heapStr(heap);
-    if (heap != 0)
-    {
+    if (heap != 0) {
       check("heap is occupied by String/StreamString(progmem)", heapStr.c_str(), heapStr.c_str());
-    }
-    else
-    {
+    } else {
       check("ERROR: heap should be occupied by String/StreamString(progmem)", heapStr.c_str(), "-1");
     }
   }
@@ -184,8 +174,7 @@ void testStreamString()
 
 #ifndef TEST_CASE
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   delay(1000);
 
diff --git a/libraries/esp8266/examples/TestEspApi/TestEspApi.ino b/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
index 4ad5faf876..dd7727f9b7 100644
--- a/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
+++ b/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
@@ -10,8 +10,7 @@
 */
 
 #ifdef ESP8266
-extern "C"
-{
+extern "C" {
 #include "user_interface.h"
 }
 #endif
@@ -19,7 +18,7 @@ extern "C"
 // Set up output serial port (could be a SoftwareSerial
 // if really wanted).
 
-Stream&           ehConsolePort(Serial);
+Stream& ehConsolePort(Serial);
 
 // Wired to the blue LED on an ESP-01 board, active LOW.
 //
@@ -27,7 +26,7 @@ Stream&           ehConsolePort(Serial);
 // calls, as TX is wired to the same pin.
 //
 // UNLESS: You swap the TX pin using the alternate pinout.
-const uint8_t     LED_PIN       = 1;
+const uint8_t LED_PIN = 1;
 
 const char* const RST_REASONS[] = {
   "REASON_DEFAULT_RST",
@@ -114,13 +113,11 @@ const char* const EVENT_REASONS_200[] {
   "REASON_NO_AP_FOUND"
 };
 
-void wifi_event_handler_cb(System_Event_t* event)
-{
+void wifi_event_handler_cb(System_Event_t* event) {
   ehConsolePort.print(EVENT_NAMES[event->event]);
   ehConsolePort.print(" (");
 
-  switch (event->event)
-  {
+  switch (event->event) {
     case EVENT_STAMODE_CONNECTED:
       break;
     case EVENT_STAMODE_DISCONNECTED:
@@ -130,21 +127,18 @@ void wifi_event_handler_cb(System_Event_t* event)
     case EVENT_STAMODE_GOT_IP:
       break;
     case EVENT_SOFTAPMODE_STACONNECTED:
-    case EVENT_SOFTAPMODE_STADISCONNECTED:
-    {
+    case EVENT_SOFTAPMODE_STADISCONNECTED: {
       char mac[32] = { 0 };
       snprintf(mac, 32, MACSTR ", aid: %d", MAC2STR(event->event_info.sta_connected.mac), event->event_info.sta_connected.aid);
 
       ehConsolePort.print(mac);
-    }
-    break;
+    } break;
   }
 
   ehConsolePort.println(")");
 }
 
-void print_softap_config(Stream& consolePort, softap_config const& config)
-{
+void print_softap_config(Stream& consolePort, softap_config const& config) {
   consolePort.println();
   consolePort.println(F("SoftAP Configuration"));
   consolePort.println(F("--------------------"));
@@ -178,8 +172,7 @@ void print_softap_config(Stream& consolePort, softap_config const& config)
   consolePort.println();
 }
 
-void print_system_info(Stream& consolePort)
-{
+void print_system_info(Stream& consolePort) {
   const rst_info* resetInfo = system_get_rst_info();
   consolePort.print(F("system_get_rst_info() reset reason: "));
   consolePort.println(RST_REASONS[resetInfo->reason]);
@@ -217,8 +210,7 @@ void print_system_info(Stream& consolePort)
   consolePort.println(FLASH_SIZE_MAP_NAMES[system_get_flash_size_map()]);
 }
 
-void print_wifi_general(Stream& consolePort)
-{
+void print_wifi_general(Stream& consolePort) {
   consolePort.print(F("wifi_get_channel(): "));
   consolePort.println(wifi_get_channel());
 
@@ -226,8 +218,7 @@ void print_wifi_general(Stream& consolePort)
   consolePort.println(PHY_MODE_NAMES[wifi_get_phy_mode()]);
 }
 
-void secure_softap_config(softap_config* config, const char* ssid, const char* password)
-{
+void secure_softap_config(softap_config* config, const char* ssid, const char* password) {
   size_t ssidLen     = strlen(ssid) < sizeof(config->ssid) ? strlen(ssid) : sizeof(config->ssid);
   size_t passwordLen = strlen(password) < sizeof(config->password) ? strlen(password) : sizeof(config->password);
 
@@ -237,16 +228,15 @@ void secure_softap_config(softap_config* config, const char* ssid, const char* p
   memset(config->password, 0, sizeof(config->password));
   memcpy(config->password, password, passwordLen);
 
-  config->ssid_len       = ssidLen;
-  config->channel        = 1;
-  config->authmode       = AUTH_WPA2_PSK;
+  config->ssid_len = ssidLen;
+  config->channel  = 1;
+  config->authmode = AUTH_WPA2_PSK;
   //    config->ssid_hidden = 1;
   config->max_connection = 4;
   //    config->beacon_interval = 1000;
 }
 
-void setup()
-{
+void setup() {
   // Reuse default Serial port rate, so the bootloader
   // messages are also readable.
 
@@ -297,8 +287,7 @@ void setup()
   // ESP.deepSleep(15000);
 }
 
-void loop()
-{
+void loop() {
   Serial.print(F("system_get_time(): "));
   Serial.println(system_get_time());
   delay(1000);
diff --git a/libraries/esp8266/examples/UartDownload/UartDownload.ino b/libraries/esp8266/examples/UartDownload/UartDownload.ino
index 181dfd4d27..6d86441998 100644
--- a/libraries/esp8266/examples/UartDownload/UartDownload.ino
+++ b/libraries/esp8266/examples/UartDownload/UartDownload.ino
@@ -42,24 +42,24 @@
 // state and clear it after it elapses.
 //
 // Change this to false if you do not want ESP_SYNC monitor always on.
-bool             uartDownloadEnable = true;
+bool uartDownloadEnable = true;
 
 // Buffer size to receive an ESP_SYNC packet into, larger than the expected
 // ESP_SYNC packet length.
-constexpr size_t pktBufSz           = 64;
+constexpr size_t pktBufSz = 64;
 
 // Enough time to receive 115 bytes at 115200bps.
 // More than enough to finish receiving an ESP_SYNC packet.
-constexpr size_t kSyncTimeoutMs     = 10;
+constexpr size_t kSyncTimeoutMs = 10;
 
 // The SLIP Frame end character, which is also used to start a frame.
-constexpr char   slipFrameMarker    = '\xC0';
+constexpr char slipFrameMarker = '\xC0';
 
 // General packet format:
 //   <0xC0><cmd><payload length><32 bit cksum><payload data ...><0xC0>
 // Slip packet for ESP_SYNC, minus the frame markers ('\xC0') captured from
 // esptool using the `--trace` option.
-const char       syncPkt[] PROGMEM  = "\x00\x08\x24\x00\x00\x00\x00\x00\x07\x07\x12\x20"
+const char syncPkt[] PROGMEM = "\x00\x08\x24\x00\x00\x00\x00\x00\x07\x07\x12\x20"
                                "UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU";
 
 constexpr size_t syncPktSz = sizeof(syncPkt) - 1;  // Don't compare zero terminator char
@@ -69,10 +69,8 @@ constexpr size_t syncPktSz = sizeof(syncPkt) - 1;  // Don't compare zero termina
 //  Mode. At entry we expect the Serial FIFO to start with the byte following
 //  the slipFrameMarker.
 //
-void             proxyEspSync()
-{
-  if (!uartDownloadEnable)
-  {
+void proxyEspSync() {
+  if (!uartDownloadEnable) {
     return;
   }
 
@@ -85,8 +83,7 @@ void             proxyEspSync()
 
   // To avoid a false trigger, only start UART Download Mode when we get an
   // exact match to the captured esptool ESP_SYNC packet.
-  if (syncPktSz == len && 0 == memcmp_P(buf, syncPkt, len))
-  {
+  if (syncPktSz == len && 0 == memcmp_P(buf, syncPkt, len)) {
     ESP.rebootIntoUartDownloadMode();
     // Does not return
   }
@@ -100,8 +97,7 @@ void             proxyEspSync()
 //
 ////////////////////////////////////////////////////////////////////////////////
 
-void setup()
-{
+void setup() {
   // For `proxyEspSync()` to work, the Serial.begin() speed needs to be
   // 115200bps. This is the data rate used by esptool.py. It expects the Boot
   // ROM to use its "auto-baud" feature to match up. Since `proxyEspSync()` is
@@ -125,10 +121,8 @@ void setup()
   // ...
 }
 
-void cmdLoop(Print& oStream, int key)
-{
-  switch (key)
-  {
+void cmdLoop(Print& oStream, int key) {
+  switch (key) {
     case 'e':
       oStream.println(F("Enable monitor for detecting ESP_SYNC from esptool.py"));
       uartDownloadEnable = true;
@@ -152,8 +146,7 @@ void cmdLoop(Print& oStream, int key)
 
     case '?':
       oStream.println(F("\r\nHot key help:"));
-      if (!uartDownloadEnable)
-      {
+      if (!uartDownloadEnable) {
         oStream.println(F("  e - Enable monitor for detecting ESP_SYNC from esptool.py"));
       }
       oStream.println(F("  D - Boot into UART download mode"));
@@ -168,23 +161,18 @@ void cmdLoop(Print& oStream, int key)
   oStream.println();
 }
 
-void loop()
-{
+void loop() {
   // In this example, we can have Serial data from a user keystroke for our
   // command loop or the esptool trying to SYNC up for flashing.  If the
   // character matches the Slip Frame Marker (the 1st byte of the SYNC packet),
   // we intercept it and call our ESP_SYNC proxy to complete the verification
   // and reboot into the UART Downloader. Otherwise, process the keystroke as
   // normal.
-  if (0 < Serial.available())
-  {
+  if (0 < Serial.available()) {
     int keyPress = Serial.read();
-    if (slipFrameMarker == keyPress)
-    {
+    if (slipFrameMarker == keyPress) {
       proxyEspSync();
-    }
-    else
-    {
+    } else {
       cmdLoop(Serial, keyPress);
     }
   }
diff --git a/libraries/esp8266/examples/interactive/interactive.ino b/libraries/esp8266/examples/interactive/interactive.ino
index 5ad3fc611f..1206dba83d 100644
--- a/libraries/esp8266/examples/interactive/interactive.ino
+++ b/libraries/esp8266/examples/interactive/interactive.ino
@@ -18,20 +18,18 @@
 const char* SSID = STASSID;
 const char* PSK  = STAPSK;
 
-IPAddress   staticip(192, 168, 1, 123);
-IPAddress   gateway(192, 168, 1, 254);
-IPAddress   subnet(255, 255, 255, 0);
+IPAddress staticip(192, 168, 1, 123);
+IPAddress gateway(192, 168, 1, 254);
+IPAddress subnet(255, 255, 255, 0);
 
-void        setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.setDebugOutput(true);
 
   WiFi.mode(WIFI_STA);
   WiFi.begin(SSID, PSK);
   Serial.println("connecting");
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
@@ -48,16 +46,14 @@ void        setup()
       "WL_DISCONNECTED     = 7\n");
 }
 
-void WiFiOn()
-{
+void WiFiOn() {
   wifi_fpm_do_wakeup();
   wifi_fpm_close();
   wifi_set_opmode(STATION_MODE);
   wifi_station_connect();
 }
 
-void WiFiOff()
-{
+void WiFiOff() {
   wifi_station_disconnect();
   wifi_set_opmode(NULL_MODE);
   wifi_set_sleep_type(MODEM_SLEEP_T);
@@ -65,12 +61,10 @@ void WiFiOff()
   wifi_fpm_do_sleep(0xFFFFFFF);
 }
 
-void loop()
-{
+void loop() {
 #define TEST(name, var, varinit, func)   \
   static decltype(func) var = (varinit); \
-  if ((var) != (func))                   \
-  {                                      \
+  if ((var) != (func)) {                 \
     var = (func);                        \
     Serial.printf("**** %s: ", name);    \
     Serial.println(var);                 \
@@ -86,8 +80,7 @@ void loop()
   TEST("STA-IP", localIp, (uint32_t)0, WiFi.localIP());
   TEST("AP-IP", apIp, (uint32_t)0, WiFi.softAPIP());
 
-  switch (Serial.read())
-  {
+  switch (Serial.read()) {
     case 'F':
       DO(WiFiOff());
     case 'N':
diff --git a/libraries/esp8266/examples/irammem/irammem.ino b/libraries/esp8266/examples/irammem/irammem.ino
index 853ebd3963..ea9597bee8 100644
--- a/libraries/esp8266/examples/irammem/irammem.ino
+++ b/libraries/esp8266/examples/irammem/irammem.ino
@@ -18,59 +18,47 @@
   different optimizations.
 */
 
-#pragma GCC                    push_options
+#pragma GCC push_options
 // reference
 #pragma GCC                    optimize("O0")  // We expect -O0 to generate the correct results
-__attribute__((noinline)) void aliasTestReference(uint16_t* x)
-{
+__attribute__((noinline)) void aliasTestReference(uint16_t* x) {
   // Without adhearance to strict-aliasing, this sequence of code would fail
   // when optimized by GCC Version 10.3
   size_t len = 3;
-  for (size_t u = 0; u < len; u++)
-  {
+  for (size_t u = 0; u < len; u++) {
     uint16_t x1 = mmu_get_uint16(&x[0]);
-    for (size_t v = 0; v < len; v++)
-    {
+    for (size_t v = 0; v < len; v++) {
       x[v] = mmu_get_uint16(&x[v]) + x1;
     }
   }
 }
 // Tests
 #pragma GCC                    optimize("Os")
-__attribute__((noinline)) void aliasTestOs(uint16_t* x)
-{
+__attribute__((noinline)) void aliasTestOs(uint16_t* x) {
   size_t len = 3;
-  for (size_t u = 0; u < len; u++)
-  {
+  for (size_t u = 0; u < len; u++) {
     uint16_t x1 = mmu_get_uint16(&x[0]);
-    for (size_t v = 0; v < len; v++)
-    {
+    for (size_t v = 0; v < len; v++) {
       x[v] = mmu_get_uint16(&x[v]) + x1;
     }
   }
 }
 #pragma GCC                    optimize("O2")
-__attribute__((noinline)) void aliasTestO2(uint16_t* x)
-{
+__attribute__((noinline)) void aliasTestO2(uint16_t* x) {
   size_t len = 3;
-  for (size_t u = 0; u < len; u++)
-  {
+  for (size_t u = 0; u < len; u++) {
     uint16_t x1 = mmu_get_uint16(&x[0]);
-    for (size_t v = 0; v < len; v++)
-    {
+    for (size_t v = 0; v < len; v++) {
       x[v] = mmu_get_uint16(&x[v]) + x1;
     }
   }
 }
 #pragma GCC                    optimize("O3")
-__attribute__((noinline)) void aliasTestO3(uint16_t* x)
-{
+__attribute__((noinline)) void aliasTestO3(uint16_t* x) {
   size_t len = 3;
-  for (size_t u = 0; u < len; u++)
-  {
+  for (size_t u = 0; u < len; u++) {
     uint16_t x1 = mmu_get_uint16(&x[0]);
-    for (size_t v = 0; v < len; v++)
-    {
+    for (size_t v = 0; v < len; v++) {
       x[v] = mmu_get_uint16(&x[v]) + x1;
     }
   }
@@ -82,8 +70,7 @@ __attribute__((noinline)) void aliasTestO3(uint16_t* x)
 #pragma GCC optimize("O0")
 __attribute__((noinline)) IRAM_ATTR
     uint32_t
-    timedRead_Reference(uint8_t* res)
-{
+    timedRead_Reference(uint8_t* res) {
   // This test case was verified with GCC 10.3
   // There is a code case that can result in 32-bit wide IRAM load from memory
   // being optimized down to an 8-bit memory access. In this test case we need
@@ -99,8 +86,7 @@ __attribute__((noinline)) IRAM_ATTR
 #pragma GCC optimize("Os")
 __attribute__((noinline)) IRAM_ATTR
     uint32_t
-    timedRead_Os(uint8_t* res)
-{
+    timedRead_Os(uint8_t* res) {
   const uint8_t* x = (const uint8_t*)0x40100003ul;
   uint32_t       b = ESP.getCycleCount();
   *res             = mmu_get_uint8(x);
@@ -109,8 +95,7 @@ __attribute__((noinline)) IRAM_ATTR
 #pragma GCC optimize("O2")
 __attribute__((noinline)) IRAM_ATTR
     uint32_t
-    timedRead_O2(uint8_t* res)
-{
+    timedRead_O2(uint8_t* res) {
   const uint8_t* x = (const uint8_t*)0x40100003ul;
   uint32_t       b = ESP.getCycleCount();
   *res             = mmu_get_uint8(x);
@@ -119,8 +104,7 @@ __attribute__((noinline)) IRAM_ATTR
 #pragma GCC optimize("O3")
 __attribute__((noinline)) IRAM_ATTR
     uint32_t
-    timedRead_O3(uint8_t* res)
-{
+    timedRead_O3(uint8_t* res) {
   const uint8_t* x = (const uint8_t*)0x40100003ul;
   uint32_t       b = ESP.getCycleCount();
   *res             = mmu_get_uint8(x);
@@ -128,8 +112,7 @@ __attribute__((noinline)) IRAM_ATTR
 }
 #pragma GCC pop_options
 
-bool        test4_32bit_loads()
-{
+bool test4_32bit_loads() {
   bool     result = true;
   uint8_t  res;
   uint32_t cycle_count_ref, cycle_count;
@@ -144,58 +127,45 @@ bool        test4_32bit_loads()
   Serial.printf("  Option -O0, cycle count %5u - reference\r\n", cycle_count_ref);
   cycle_count = timedRead_Os(&res);
   Serial.printf("  Option -Os, cycle count %5u ", cycle_count);
-  if (cycle_count_ref > cycle_count)
-  {
+  if (cycle_count_ref > cycle_count) {
     Serial.printf("- passed\r\n");
-  }
-  else
-  {
+  } else {
     result = false;
     Serial.printf("- failed\r\n");
   }
   cycle_count = timedRead_O2(&res);
   Serial.printf("  Option -O2, cycle count %5u ", cycle_count);
-  if (cycle_count_ref > cycle_count)
-  {
+  if (cycle_count_ref > cycle_count) {
     Serial.printf("- passed\r\n");
-  }
-  else
-  {
+  } else {
     result = false;
     Serial.printf("- failed\r\n");
   }
   cycle_count = timedRead_O3(&res);
   Serial.printf("  Option -O3, cycle count %5u ", cycle_count);
-  if (cycle_count_ref > cycle_count)
-  {
+  if (cycle_count_ref > cycle_count) {
     Serial.printf("- passed\r\n");
-  }
-  else
-  {
+  } else {
     result = false;
     Serial.printf("- failed\r\n");
   }
   return result;
 }
 
-void printPunFail(uint16_t* ref, uint16_t* x, size_t sz)
-{
+void printPunFail(uint16_t* ref, uint16_t* x, size_t sz) {
   Serial.printf("    Expected:");
-  for (size_t i = 0; i < sz; i++)
-  {
+  for (size_t i = 0; i < sz; i++) {
     Serial.printf(" %3u", ref[i]);
   }
   Serial.printf("\r\n    Got:     ");
-  for (size_t i = 0; i < sz; i++)
-  {
+  for (size_t i = 0; i < sz; i++) {
     Serial.printf(" %3u", x[i]);
   }
   Serial.printf("\r\n");
 }
 
-bool testPunning()
-{
-  bool                       result  = true;
+bool testPunning() {
+  bool result = true;
   // Get reference result for verifing test
   alignas(uint32_t) uint16_t x_ref[] = { 1, 2, 3, 0 };
   aliasTestReference(x_ref);  // -O0
@@ -205,12 +175,9 @@ bool testPunning()
     alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
     aliasTestOs(x);
     Serial.printf("  Option -Os ");
-    if (0 == memcmp(x_ref, x, sizeof(x_ref)))
-    {
+    if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
       Serial.printf("- passed\r\n");
-    }
-    else
-    {
+    } else {
       result = false;
       Serial.printf("- failed\r\n");
       printPunFail(x_ref, x, sizeof(x_ref) / sizeof(uint16_t));
@@ -220,12 +187,9 @@ bool testPunning()
     alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
     aliasTestO2(x);
     Serial.printf("  Option -O2 ");
-    if (0 == memcmp(x_ref, x, sizeof(x_ref)))
-    {
+    if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
       Serial.printf("- passed\r\n");
-    }
-    else
-    {
+    } else {
       result = false;
       Serial.printf("- failed\r\n");
       printPunFail(x_ref, x, sizeof(x_ref) / sizeof(uint16_t));
@@ -235,12 +199,9 @@ bool testPunning()
     alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
     aliasTestO3(x);
     Serial.printf("  Option -O3 ");
-    if (0 == memcmp(x_ref, x, sizeof(x_ref)))
-    {
+    if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
       Serial.printf("- passed\r\n");
-    }
-    else
-    {
+    } else {
       result = false;
       Serial.printf("- failed\r\n");
       printPunFail(x_ref, x, sizeof(x_ref) / sizeof(uint16_t));
@@ -249,96 +210,80 @@ bool testPunning()
   return result;
 }
 
-uint32_t cyclesToRead_nKx32(int n, unsigned int* x, uint32_t* res)
-{
+uint32_t cyclesToRead_nKx32(int n, unsigned int* x, uint32_t* res) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++)
-  {
+  for (int i = 0; i < n * 1024; i++) {
     sum += *(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx32(int n, unsigned int* x)
-{
+uint32_t cyclesToWrite_nKx32(int n, unsigned int* x) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++)
-  {
+  for (int i = 0; i < n * 1024; i++) {
     sum += i;
     *(x++) = sum;
   }
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx16(int n, unsigned short* x, uint32_t* res)
-{
+uint32_t cyclesToRead_nKx16(int n, unsigned short* x, uint32_t* res) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++)
-  {
+  for (int i = 0; i < n * 1024; i++) {
     sum += *(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx16(int n, unsigned short* x)
-{
+uint32_t cyclesToWrite_nKx16(int n, unsigned short* x) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++)
-  {
+  for (int i = 0; i < n * 1024; i++) {
     sum += i;
     *(x++) = sum;
   }
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKxs16(int n, short* x, int32_t* res)
-{
+uint32_t cyclesToRead_nKxs16(int n, short* x, int32_t* res) {
   uint32_t b   = ESP.getCycleCount();
   int32_t  sum = 0;
-  for (int i = 0; i < n * 1024; i++)
-  {
+  for (int i = 0; i < n * 1024; i++) {
     sum += *(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKxs16(int n, short* x)
-{
+uint32_t cyclesToWrite_nKxs16(int n, short* x) {
   uint32_t b   = ESP.getCycleCount();
   int32_t  sum = 0;
-  for (int i = 0; i < n * 1024; i++)
-  {
+  for (int i = 0; i < n * 1024; i++) {
     sum += i;
     *(x++) = sum;
   }
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx8(int n, unsigned char* x, uint32_t* res)
-{
+uint32_t cyclesToRead_nKx8(int n, unsigned char* x, uint32_t* res) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++)
-  {
+  for (int i = 0; i < n * 1024; i++) {
     sum += *(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx8(int n, unsigned char* x)
-{
+uint32_t cyclesToWrite_nKx8(int n, unsigned char* x) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++)
-  {
+  for (int i = 0; i < n * 1024; i++) {
     sum += i;
     *(x++) = sum;
   }
@@ -346,24 +291,20 @@ uint32_t cyclesToWrite_nKx8(int n, unsigned char* x)
 }
 
 // Compare with Inline
-uint32_t cyclesToRead_nKx16_viaInline(int n, unsigned short* x, uint32_t* res)
-{
+uint32_t cyclesToRead_nKx16_viaInline(int n, unsigned short* x, uint32_t* res) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++)
-  {
+  for (int i = 0; i < n * 1024; i++) {
     sum += mmu_get_uint16(x++);  //*(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short* x)
-{
+uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short* x) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++)
-  {
+  for (int i = 0; i < n * 1024; i++) {
     sum += i;
     // *(x++) = sum;
     mmu_set_uint16(x++, sum);
@@ -371,24 +312,20 @@ uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short* x)
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKxs16_viaInline(int n, short* x, int32_t* res)
-{
+uint32_t cyclesToRead_nKxs16_viaInline(int n, short* x, int32_t* res) {
   uint32_t b   = ESP.getCycleCount();
   int32_t  sum = 0;
-  for (int i = 0; i < n * 1024; i++)
-  {
+  for (int i = 0; i < n * 1024; i++) {
     sum += mmu_get_int16(x++);  //*(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKxs16_viaInline(int n, short* x)
-{
+uint32_t cyclesToWrite_nKxs16_viaInline(int n, short* x) {
   uint32_t b   = ESP.getCycleCount();
   int32_t  sum = 0;
-  for (int i = 0; i < n * 1024; i++)
-  {
+  for (int i = 0; i < n * 1024; i++) {
     sum += i;
     // *(x++) = sum;
     mmu_set_int16(x++, sum);
@@ -396,24 +333,20 @@ uint32_t cyclesToWrite_nKxs16_viaInline(int n, short* x)
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx8_viaInline(int n, unsigned char* x, uint32_t* res)
-{
+uint32_t cyclesToRead_nKx8_viaInline(int n, unsigned char* x, uint32_t* res) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++)
-  {
+  for (int i = 0; i < n * 1024; i++) {
     sum += mmu_get_uint8(x++);  //*(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char* x)
-{
+uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char* x) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < n * 1024; i++)
-  {
+  for (int i = 0; i < n * 1024; i++) {
     sum += i;
     // *(x++) = sum;
     mmu_set_uint8(x++, sum);
@@ -421,8 +354,7 @@ uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char* x)
   return ESP.getCycleCount() - b;
 }
 
-bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem)
-{
+bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
   uint32_t res, verify_res;
   uint32_t t;
   bool     success = true;
@@ -443,12 +375,9 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem)
   Serial.printf("IRAM Memory Write Inline:  %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx16_viaInline(nK, (uint16_t*)imem, &res);
   Serial.printf("IRAM Memory Read Inline:   %7d cycles for %dK by uint16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res);
-  if (res == verify_res)
-  {
+  if (res == verify_res) {
     Serial.printf("- passed\r\n");
-  }
-  else
-  {
+  } else {
     Serial.printf("!= (sum %08x ) - failed\r\n", verify_res);
     success = false;
   }
@@ -457,12 +386,9 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem)
   Serial.printf("IRAM Memory Write Inline:  %7d cycles for %dK by  int16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKxs16_viaInline(nK, (int16_t*)imem, &sres);
   Serial.printf("IRAM Memory Read Inline:   %7d cycles for %dK by  int16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), sres);
-  if (sres == verify_sres)
-  {
+  if (sres == verify_sres) {
     Serial.printf("- passed\r\n");
-  }
-  else
-  {
+  } else {
     Serial.printf("!= (sum %08x ) - failed\r\n", verify_sres);
     success = false;
   }
@@ -471,12 +397,9 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem)
   Serial.printf("IRAM Memory Write:         %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx16(nK, (uint16_t*)imem, &res);
   Serial.printf("IRAM Memory Read:          %7d cycles for %dK by uint16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res);
-  if (res == verify_res)
-  {
+  if (res == verify_res) {
     Serial.printf("- passed\r\n");
-  }
-  else
-  {
+  } else {
     Serial.printf("!= (sum %08x ) - failed\r\n", verify_res);
     success = false;
   }
@@ -484,12 +407,9 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem)
   Serial.printf("IRAM Memory Write:         %7d cycles for %dK by  int16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKxs16(nK, (int16_t*)imem, &sres);
   Serial.printf("IRAM Memory Read:          %7d cycles for %dK by  int16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), sres);
-  if (sres == verify_sres)
-  {
+  if (sres == verify_sres) {
     Serial.printf("- passed\r\n");
-  }
-  else
-  {
+  } else {
     Serial.printf("!= (sum %08x ) - failed\r\n", verify_sres);
     success = false;
   }
@@ -505,12 +425,9 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem)
   Serial.printf("IRAM Memory Write Inline:  %7d cycles for %dK by  uint8, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx8_viaInline(nK, (uint8_t*)imem, &res);
   Serial.printf("IRAM Memory Read Inline:   %7d cycles for %dK by  uint8, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res);
-  if (res == verify_res)
-  {
+  if (res == verify_res) {
     Serial.printf("- passed\r\n");
-  }
-  else
-  {
+  } else {
     Serial.printf("!= (sum %08x ) - failed\r\n", verify_res);
     success = false;
   }
@@ -519,12 +436,9 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem)
   Serial.printf("IRAM Memory Write:         %7d cycles for %dK by  uint8, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx8(nK, (uint8_t*)imem, &res);
   Serial.printf("IRAM Memory Read:          %7d cycles for %dK by  uint8, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res);
-  if (res == verify_res)
-  {
+  if (res == verify_res) {
     Serial.printf("- passed\r\n");
-  }
-  else
-  {
+  } else {
     Serial.printf("!= (sum %08x ) - failed\r\n", verify_res);
     success = false;
   }
@@ -533,8 +447,7 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem)
   return success;
 }
 
-void setup()
-{
+void setup() {
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
   // Serial.begin(74880);
@@ -555,8 +468,7 @@ void setup()
   Serial.printf("DRAM free: %6d\r\n", ESP.getFreeHeap());
   uint32_t* mem = (uint32_t*)malloc(2 * 1024 * sizeof(uint32_t));
   Serial.printf("DRAM buffer: Address %p, free %d\r\n", mem, ESP.getFreeHeap());
-  if (!mem)
-  {
+  if (!mem) {
     return;
   }
 
@@ -582,8 +494,7 @@ void setup()
     Serial.printf("IRAM buffer: Address %p, free %d\r\n", imem, ESP.getFreeHeap());
   }
 #endif
-  if (!imem)
-  {
+  if (!imem) {
     return;
   }
 
@@ -603,12 +514,9 @@ void setup()
   Serial.printf("IRAM Memory Read:          %7d cycles for %dK by uint32, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), res);
   Serial.println();
 
-  if (perfTest_nK(1, mem, imem) && testPunning() && test4_32bit_loads())
-  {
+  if (perfTest_nK(1, mem, imem) && testPunning() && test4_32bit_loads()) {
     Serial.println();
-  }
-  else
-  {
+  } else {
     Serial.println("\r\n*******************************");
     Serial.println("*******************************");
     Serial.println("**                           **");
@@ -623,8 +531,7 @@ void setup()
   // Let's use IRAM heap to make a big ole' String
   ESP.setIramHeap();
   String s = "";
-  for (int i = 0; i < 100; i++)
-  {
+  for (int i = 0; i < 100; i++) {
     s += i;
     s += ' ';
   }
@@ -642,8 +549,7 @@ void setup()
     // Let's use IRAM heap to make a big ole' String
     HeapSelectIram ephemeral;
     String         s = "";
-    for (int i = 0; i < 100; i++)
-    {
+    for (int i = 0; i < 100; i++) {
       s += i;
       s += ' ';
     }
@@ -690,8 +596,7 @@ void setup()
     ESP.getHeapStats(&hfree, &hmax, &hfrag);
     ETS_PRINTF("ESP.getHeapStats(free: %u, max: %u, frag: %u)\n",
                hfree, hmax, hfrag);
-    if (free_iram > UMM_OVERHEAD_ADJUST)
-    {
+    if (free_iram > UMM_OVERHEAD_ADJUST) {
       void* all = malloc(free_iram - UMM_OVERHEAD_ADJUST);
       ETS_PRINTF("%p = malloc(%u)\n", all, free_iram);
       umm_info(NULL, true);
@@ -705,24 +610,19 @@ void setup()
   }
 }
 
-void processKey(Print& out, int hotKey)
-{
-  switch (hotKey)
-  {
-    case 'd':
-    {
+void processKey(Print& out, int hotKey) {
+  switch (hotKey) {
+    case 'd': {
       HeapSelectDram ephemeral;
       umm_info(NULL, true);
       break;
     }
-    case 'i':
-    {
+    case 'i': {
       HeapSelectIram ephemeral;
       umm_info(NULL, true);
       break;
     }
-    case 'h':
-    {
+    case 'h': {
       {
         HeapSelectIram ephemeral;
         Serial.printf(PSTR("IRAM ESP.getFreeHeap:  %u\n"), ESP.getFreeHeap());
@@ -759,10 +659,8 @@ void processKey(Print& out, int hotKey)
   }
 }
 
-void loop(void)
-{
-  if (Serial.available() > 0)
-  {
+void loop(void) {
+  if (Serial.available() > 0) {
     int hotKey = Serial.read();
     processKey(Serial, hotKey);
   }
diff --git a/libraries/esp8266/examples/virtualmem/virtualmem.ino b/libraries/esp8266/examples/virtualmem/virtualmem.ino
index e077b3bdaf..c5374d245c 100644
--- a/libraries/esp8266/examples/virtualmem/virtualmem.ino
+++ b/libraries/esp8266/examples/virtualmem/virtualmem.ino
@@ -1,78 +1,65 @@
 
-uint32_t cyclesToRead1Kx32(unsigned int* x, uint32_t* res)
-{
+uint32_t cyclesToRead1Kx32(unsigned int* x, uint32_t* res) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < 1024; i++)
-  {
+  for (int i = 0; i < 1024; i++) {
     sum += *(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx32(unsigned int* x)
-{
+uint32_t cyclesToWrite1Kx32(unsigned int* x) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < 1024; i++)
-  {
+  for (int i = 0; i < 1024; i++) {
     sum += i;
     *(x++) = sum;
   }
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead1Kx16(unsigned short* x, uint32_t* res)
-{
+uint32_t cyclesToRead1Kx16(unsigned short* x, uint32_t* res) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < 1024; i++)
-  {
+  for (int i = 0; i < 1024; i++) {
     sum += *(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx16(unsigned short* x)
-{
+uint32_t cyclesToWrite1Kx16(unsigned short* x) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < 1024; i++)
-  {
+  for (int i = 0; i < 1024; i++) {
     sum += i;
     *(x++) = sum;
   }
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead1Kx8(unsigned char* x, uint32_t* res)
-{
+uint32_t cyclesToRead1Kx8(unsigned char* x, uint32_t* res) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < 1024; i++)
-  {
+  for (int i = 0; i < 1024; i++) {
     sum += *(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx8(unsigned char* x)
-{
+uint32_t cyclesToWrite1Kx8(unsigned char* x) {
   uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
-  for (int i = 0; i < 1024; i++)
-  {
+  for (int i = 0; i < 1024; i++) {
     sum += i;
     *(x++) = sum;
   }
   return ESP.getCycleCount() - b;
 }
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.printf("\n");
 
@@ -123,8 +110,7 @@ void setup()
   // Let's use external heap to make a big ole' String
   ESP.setExternalHeap();
   String s = "";
-  for (int i = 0; i < 100; i++)
-  {
+  for (int i = 0; i < 100; i++) {
     s += i;
     s += ' ';
   }
@@ -146,6 +132,5 @@ void setup()
   ESP.resetHeap();
 }
 
-void loop()
-{
+void loop() {
 }
diff --git a/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino b/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
index ca497e3394..fc265a2136 100644
--- a/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
+++ b/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
@@ -41,8 +41,7 @@ SoftwareSerial  ppplink(RX, TX);
 HardwareSerial& logger = Serial;
 PPPServer       ppp(&ppplink);
 
-void            PPPConnectedCallback(netif* nif)
-{
+void PPPConnectedCallback(netif* nif) {
   logger.printf("ppp: ip=%s/mask=%s/gw=%s\n",
                 IPAddress(&nif->ip_addr).toString().c_str(),
                 IPAddress(&nif->netmask).toString().c_str(),
@@ -51,12 +50,10 @@ void            PPPConnectedCallback(netif* nif)
   logger.printf("Heap before: %d\n", ESP.getFreeHeap());
   err_t ret = ip_napt_init(NAPT, NAPT_PORT);
   logger.printf("ip_napt_init(%d,%d): ret=%d (OK=%d)\n", NAPT, NAPT_PORT, (int)ret, (int)ERR_OK);
-  if (ret == ERR_OK)
-  {
+  if (ret == ERR_OK) {
     ret = ip_napt_enable_no(nif->num, 1);
     logger.printf("ip_napt_enable(nif): ret=%d (OK=%d)\n", (int)ret, (int)ERR_OK);
-    if (ret == ERR_OK)
-    {
+    if (ret == ERR_OK) {
       logger.printf("PPP client is NATed\n");
     }
 
@@ -67,21 +64,18 @@ void            PPPConnectedCallback(netif* nif)
     logger.printf("redirect443=%d\n", ip_portmap_add(IP_PROTO_TCP, ip_2_ip4(&nif->ip_addr)->addr, 443, ip_2_ip4(&nif->gw)->addr, 443));
   }
   logger.printf("Heap after napt init: %d\n", ESP.getFreeHeap());
-  if (ret != ERR_OK)
-  {
+  if (ret != ERR_OK) {
     logger.printf("NAPT initialization failed\n");
   }
 }
 
-void setup()
-{
+void setup() {
   logger.begin(LOGGERBAUD);
 
   WiFi.persistent(false);
   WiFi.mode(WIFI_STA);
   WiFi.begin(STASSID, STAPSK);
-  while (WiFi.status() != WL_CONNECTED)
-  {
+  while (WiFi.status() != WL_CONNECTED) {
     logger.print('.');
     delay(500);
   }
@@ -105,14 +99,12 @@ void setup()
 
 #else
 
-void setup()
-{
+void setup() {
   Serial.begin(115200);
   Serial.printf("\n\nPPP/NAPT not supported in this configuration\n");
 }
 
 #endif
 
-void loop()
-{
+void loop() {
 }
diff --git a/libraries/lwIP_PPP/src/PPPServer.h b/libraries/lwIP_PPP/src/PPPServer.h
index 12ef5fa750..260ebfe2d8 100644
--- a/libraries/lwIP_PPP/src/PPPServer.h
+++ b/libraries/lwIP_PPP/src/PPPServer.h
@@ -59,11 +59,11 @@ class PPPServer
     ppp_pcb*                _ppp;
     netif                   _netif;
     void (*_cb)(netif*);
-    uint8_t      _buf[_bufsize];
-    bool         _enabled;
+    uint8_t _buf[_bufsize];
+    bool    _enabled;
 
     // feed ppp from stream - to call on a regular basis or on interrupt
-    bool         handlePackets();
+    bool handlePackets();
 
     static u32_t output_cb_s(ppp_pcb* pcb, u8_t* data, u32_t len, void* ctx);
     static void  link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx);
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
index 4677dc4e65..224fe742b8 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
@@ -524,7 +524,7 @@ bool ENC28J60::reset(void)
 boolean
 ENC28J60::begin(const uint8_t* address)
 {
-    _localMac   = address;
+    _localMac = address;
 
     bool    ret = reset();
     uint8_t rev = readrev();
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.h b/libraries/lwIP_enc28j60/src/utility/enc28j60.h
index b106a55845..07f71f96ff 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.h
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.h
@@ -60,7 +60,7 @@ class ENC28J60
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean          begin(const uint8_t* address);
+    boolean begin(const uint8_t* address);
 
     /**
         Send an Ethernet frame
@@ -96,7 +96,7 @@ class ENC28J60
         discard an Ethernet frame
         @param framesize readFrameSize()'s result
     */
-    void     discardFrame(uint16_t framesize);
+    void discardFrame(uint16_t framesize);
 
     /**
         Read an Ethernet frame data
@@ -110,37 +110,37 @@ class ENC28J60
     uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
 
 private:
-    uint8_t        is_mac_mii_reg(uint8_t reg);
-    uint8_t        readreg(uint8_t reg);
-    void           writereg(uint8_t reg, uint8_t data);
-    void           setregbitfield(uint8_t reg, uint8_t mask);
-    void           clearregbitfield(uint8_t reg, uint8_t mask);
-    void           setregbank(uint8_t new_bank);
-    void           writedata(const uint8_t* data, int datalen);
-    void           writedatabyte(uint8_t byte);
-    int            readdata(uint8_t* buf, int len);
-    uint8_t        readdatabyte(void);
-    void           softreset(void);
-    uint8_t        readrev(void);
-    bool           reset(void);
-
-    void           enc28j60_arch_spi_init(void);
-    uint8_t        enc28j60_arch_spi_write(uint8_t data);
-    uint8_t        enc28j60_arch_spi_read(void);
-    void           enc28j60_arch_spi_select(void);
-    void           enc28j60_arch_spi_deselect(void);
+    uint8_t is_mac_mii_reg(uint8_t reg);
+    uint8_t readreg(uint8_t reg);
+    void    writereg(uint8_t reg, uint8_t data);
+    void    setregbitfield(uint8_t reg, uint8_t mask);
+    void    clearregbitfield(uint8_t reg, uint8_t mask);
+    void    setregbank(uint8_t new_bank);
+    void    writedata(const uint8_t* data, int datalen);
+    void    writedatabyte(uint8_t byte);
+    int     readdata(uint8_t* buf, int len);
+    uint8_t readdatabyte(void);
+    void    softreset(void);
+    uint8_t readrev(void);
+    bool    reset(void);
+
+    void    enc28j60_arch_spi_init(void);
+    uint8_t enc28j60_arch_spi_write(uint8_t data);
+    uint8_t enc28j60_arch_spi_read(void);
+    void    enc28j60_arch_spi_select(void);
+    void    enc28j60_arch_spi_deselect(void);
 
     // Previously defined in contiki/core/sys/clock.h
-    void           clock_delay_usec(uint16_t dt);
+    void clock_delay_usec(uint16_t dt);
 
-    uint8_t        _bank;
-    int8_t         _cs;
-    SPIClass&      _spi;
+    uint8_t   _bank;
+    int8_t    _cs;
+    SPIClass& _spi;
 
     const uint8_t* _localMac;
 
     /* readFrame*() state */
-    uint16_t       _next, _len;
+    uint16_t _next, _len;
 };
 
 #endif /* ENC28J60_H */
diff --git a/libraries/lwIP_w5100/src/utility/w5100.cpp b/libraries/lwIP_w5100/src/utility/w5100.cpp
index 8dcf0a446b..70e3197afb 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.cpp
+++ b/libraries/lwIP_w5100/src/utility/w5100.cpp
@@ -131,7 +131,7 @@ void Wiznet5100::wizchip_send_data(const uint8_t* wizdata, uint16_t len)
     uint16_t dst_mask;
     uint16_t dst_ptr;
 
-    ptr      = getSn_TX_WR();
+    ptr = getSn_TX_WR();
 
     dst_mask = ptr & TxBufferMask;
     dst_ptr  = TxBufferAddress + dst_mask;
@@ -162,7 +162,7 @@ void Wiznet5100::wizchip_recv_data(uint8_t* wizdata, uint16_t len)
     uint16_t src_mask;
     uint16_t src_ptr;
 
-    ptr      = getSn_RX_RD();
+    ptr = getSn_RX_RD();
 
     src_mask = ptr & RxBufferMask;
     src_ptr  = RxBufferAddress + src_mask;
diff --git a/libraries/lwIP_w5100/src/utility/w5100.h b/libraries/lwIP_w5100/src/utility/w5100.h
index 6182a26541..ebe11d210f 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.h
+++ b/libraries/lwIP_w5100/src/utility/w5100.h
@@ -55,12 +55,12 @@ class Wiznet5100
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean  begin(const uint8_t* address);
+    boolean begin(const uint8_t* address);
 
     /**
         Shut down the Ethernet controlled
     */
-    void     end();
+    void end();
 
     /**
         Send an Ethernet frame
@@ -96,7 +96,7 @@ class Wiznet5100
         discard an Ethernet frame
         @param framesize readFrameSize()'s result
     */
-    void     discardFrame(uint16_t framesize);
+    void discardFrame(uint16_t framesize);
 
     /**
         Read an Ethernet frame data
@@ -119,16 +119,16 @@ class Wiznet5100
     static const uint16_t TxBufferMask    = TxBufferLength - 1;
     static const uint16_t RxBufferMask    = RxBufferLength - 1;
 
-    SPIClass&             _spi;
-    int8_t                _cs;
-    uint8_t               _mac_address[6];
+    SPIClass& _spi;
+    int8_t    _cs;
+    uint8_t   _mac_address[6];
 
     /**
         Default function to select chip.
         @note This function help not to access wrong address. If you do not describe this function or register any functions,
         null function is called.
     */
-    inline void           wizchip_cs_select()
+    inline void wizchip_cs_select()
     {
         digitalWrite(_cs, LOW);
     }
@@ -148,7 +148,7 @@ class Wiznet5100
         @param address Register address
         @return The value of register
     */
-    uint8_t  wizchip_read(uint16_t address);
+    uint8_t wizchip_read(uint16_t address);
 
     /**
         Reads a 2 byte value from a register.
@@ -163,7 +163,7 @@ class Wiznet5100
         @param pBuf Pointer buffer to read data
         @param len Data length
     */
-    void     wizchip_read_buf(uint16_t address, uint8_t* pBuf, uint16_t len);
+    void wizchip_read_buf(uint16_t address, uint8_t* pBuf, uint16_t len);
 
     /**
         Write a 1 byte value to a register.
@@ -171,7 +171,7 @@ class Wiznet5100
         @param wb Write data
         @return void
     */
-    void     wizchip_write(uint16_t address, uint8_t wb);
+    void wizchip_write(uint16_t address, uint8_t wb);
 
     /**
         Write a 2 byte value to a register.
@@ -179,7 +179,7 @@ class Wiznet5100
         @param wb Write data
         @return void
     */
-    void     wizchip_write_word(uint16_t address, uint16_t word);
+    void wizchip_write_word(uint16_t address, uint16_t word);
 
     /**
         It writes sequence data to registers.
@@ -187,12 +187,12 @@ class Wiznet5100
         @param pBuf Pointer buffer to write data
         @param len Data length
     */
-    void     wizchip_write_buf(uint16_t address, const uint8_t* pBuf, uint16_t len);
+    void wizchip_write_buf(uint16_t address, const uint8_t* pBuf, uint16_t len);
 
     /**
         Reset WIZCHIP by softly.
     */
-    void     wizchip_sw_reset(void);
+    void wizchip_sw_reset(void);
 
     /**
         It copies data to internal TX memory
@@ -206,7 +206,7 @@ class Wiznet5100
         @param len Data length
         @sa wizchip_recv_data()
     */
-    void     wizchip_send_data(const uint8_t* wizdata, uint16_t len);
+    void wizchip_send_data(const uint8_t* wizdata, uint16_t len);
 
     /**
         It copies data to your buffer from internal RX memory
@@ -220,14 +220,14 @@ class Wiznet5100
         @param len Data length
         @sa wizchip_send_data()
     */
-    void     wizchip_recv_data(uint8_t* wizdata, uint16_t len);
+    void wizchip_recv_data(uint8_t* wizdata, uint16_t len);
 
     /**
         It discard the received data in RX memory.
         @details It discards the data of the length of <i>len(variable)</i> bytes in internal RX memory.
         @param len Data length
     */
-    void     wizchip_recv_ignore(uint16_t len);
+    void wizchip_recv_ignore(uint16_t len);
 
     /**
         Get @ref Sn_TX_FSR register
@@ -447,7 +447,7 @@ class Wiznet5100
         @param (uint8_t)cr Value to set @ref Sn_CR
         @sa getSn_CR()
     */
-    void           setSn_CR(uint8_t cr);
+    void setSn_CR(uint8_t cr);
 
     /**
         Get @ref Sn_CR register
diff --git a/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino b/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino
index bdece2d88b..1cd0ef9137 100644
--- a/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino
+++ b/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino
@@ -8,24 +8,24 @@
 //or #include <W5100lwIP.h>
 //or #include <ENC28J60lwIP.h>
 
-#include <WiFiClient.h> // WiFiClient (-> TCPClient)
+#include <WiFiClient.h>  // WiFiClient (-> TCPClient)
 
-const char* host = "djxmmx.net";
+const char*    host = "djxmmx.net";
 const uint16_t port = 17;
 
 using TCPClient = WiFiClient;
 
-#define CSPIN 16 // wemos/lolin/nodemcu D0
+#define CSPIN 16  // wemos/lolin/nodemcu D0
 Wiznet5500lwIP eth(CSPIN);
 
 void setup() {
   Serial.begin(115200);
 
   SPI.begin();
-  SPI.setClockDivider(SPI_CLOCK_DIV4); // 4 MHz?
+  SPI.setClockDivider(SPI_CLOCK_DIV4);  // 4 MHz?
   SPI.setBitOrder(MSBFIRST);
   SPI.setDataMode(SPI_MODE0);
-  eth.setDefault(); // use ethernet for default route
+  eth.setDefault();  // use ethernet for default route
   if (!eth.begin()) {
     Serial.println("ethernet hardware not found ... sleeping");
     while (1) {
@@ -89,7 +89,7 @@ void loop() {
   client.stop();
 
   if (wait) {
-    delay(300000); // execute once every 5 minutes, don't flood remote service
+    delay(300000);  // execute once every 5 minutes, don't flood remote service
   }
   wait = true;
 }
diff --git a/libraries/lwIP_w5500/src/utility/w5500.h b/libraries/lwIP_w5500/src/utility/w5500.h
index e067b59767..181e38848a 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.h
+++ b/libraries/lwIP_w5500/src/utility/w5500.h
@@ -55,12 +55,12 @@ class Wiznet5500
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean  begin(const uint8_t* address);
+    boolean begin(const uint8_t* address);
 
     /**
         Shut down the Ethernet controlled
     */
-    void     end();
+    void end();
 
     /**
         Send an Ethernet frame
@@ -96,7 +96,7 @@ class Wiznet5500
         discard an Ethernet frame
         @param framesize readFrameSize()'s result
     */
-    void     discardFrame(uint16_t framesize);
+    void discardFrame(uint16_t framesize);
 
     /**
         Read an Ethernet frame data
@@ -111,16 +111,16 @@ class Wiznet5500
 
 private:
     //< SPI interface Read operation in Control Phase
-    static const uint8_t AccessModeRead   = (0x00 << 2);
+    static const uint8_t AccessModeRead = (0x00 << 2);
 
     //< SPI interface Read operation in Control Phase
-    static const uint8_t AccessModeWrite  = (0x01 << 2);
+    static const uint8_t AccessModeWrite = (0x01 << 2);
 
     //< Common register block in Control Phase
-    static const uint8_t BlockSelectCReg  = (0x00 << 3);
+    static const uint8_t BlockSelectCReg = (0x00 << 3);
 
     //< Socket 0 register block in Control Phase
-    static const uint8_t BlockSelectSReg  = (0x01 << 3);
+    static const uint8_t BlockSelectSReg = (0x01 << 3);
 
     //< Socket 0 Tx buffer address block
     static const uint8_t BlockSelectTxBuf = (0x02 << 3);
@@ -128,16 +128,16 @@ class Wiznet5500
     //< Socket 0 Rx buffer address block
     static const uint8_t BlockSelectRxBuf = (0x03 << 3);
 
-    SPIClass&            _spi;
-    int8_t               _cs;
-    uint8_t              _mac_address[6];
+    SPIClass& _spi;
+    int8_t    _cs;
+    uint8_t   _mac_address[6];
 
     /**
         Default function to select chip.
         @note This function help not to access wrong address. If you do not describe this function or register any functions,
         null function is called.
     */
-    inline void          wizchip_cs_select()
+    inline void wizchip_cs_select()
     {
         digitalWrite(_cs, LOW);
     }
@@ -177,7 +177,7 @@ class Wiznet5500
         @param address Register address
         @return The value of register
     */
-    uint8_t  wizchip_read(uint8_t block, uint16_t address);
+    uint8_t wizchip_read(uint8_t block, uint16_t address);
 
     /**
         Reads a 2 byte value from a register.
@@ -192,7 +192,7 @@ class Wiznet5500
         @param pBuf Pointer buffer to read data
         @param len Data length
     */
-    void     wizchip_read_buf(uint8_t block, uint16_t address, uint8_t* pBuf, uint16_t len);
+    void wizchip_read_buf(uint8_t block, uint16_t address, uint8_t* pBuf, uint16_t len);
 
     /**
         Write a 1 byte value to a register.
@@ -200,7 +200,7 @@ class Wiznet5500
         @param wb Write data
         @return void
     */
-    void     wizchip_write(uint8_t block, uint16_t address, uint8_t wb);
+    void wizchip_write(uint8_t block, uint16_t address, uint8_t wb);
 
     /**
         Write a 2 byte value to a register.
@@ -208,7 +208,7 @@ class Wiznet5500
         @param wb Write data
         @return void
     */
-    void     wizchip_write_word(uint8_t block, uint16_t address, uint16_t word);
+    void wizchip_write_word(uint8_t block, uint16_t address, uint16_t word);
 
     /**
         It writes sequence data to registers.
@@ -216,7 +216,7 @@ class Wiznet5500
         @param pBuf Pointer buffer to write data
         @param len Data length
     */
-    void     wizchip_write_buf(uint8_t block, uint16_t address, const uint8_t* pBuf, uint16_t len);
+    void wizchip_write_buf(uint8_t block, uint16_t address, const uint8_t* pBuf, uint16_t len);
 
     /**
         Get @ref Sn_TX_FSR register
@@ -233,28 +233,28 @@ class Wiznet5500
     /**
         Reset WIZCHIP by softly.
     */
-    void     wizchip_sw_reset();
+    void wizchip_sw_reset();
 
     /**
         Get the link status of phy in WIZCHIP
     */
-    int8_t   wizphy_getphylink();
+    int8_t wizphy_getphylink();
 
     /**
         Get the power mode of PHY in WIZCHIP
     */
-    int8_t   wizphy_getphypmode();
+    int8_t wizphy_getphypmode();
 
     /**
         Reset Phy
     */
-    void     wizphy_reset();
+    void wizphy_reset();
 
     /**
         set the power mode of phy inside WIZCHIP. Refer to @ref PHYCFGR in W5500, @ref PHYSTATUS in W5200
         @param pmode Settig value of power down mode.
     */
-    int8_t   wizphy_setphypmode(uint8_t pmode);
+    int8_t wizphy_setphypmode(uint8_t pmode);
 
     /**
         It copies data to internal TX memory
@@ -268,7 +268,7 @@ class Wiznet5500
         @param len Data length
         @sa wizchip_recv_data()
     */
-    void     wizchip_send_data(const uint8_t* wizdata, uint16_t len);
+    void wizchip_send_data(const uint8_t* wizdata, uint16_t len);
 
     /**
         It copies data to your buffer from internal RX memory
@@ -282,14 +282,14 @@ class Wiznet5500
         @param len Data length
         @sa wizchip_send_data()
     */
-    void     wizchip_recv_data(uint8_t* wizdata, uint16_t len);
+    void wizchip_recv_data(uint8_t* wizdata, uint16_t len);
 
     /**
         It discard the received data in RX memory.
         @details It discards the data of the length of <i>len(variable)</i> bytes in internal RX memory.
         @param len Data length
     */
-    void     wizchip_recv_ignore(uint16_t len);
+    void wizchip_recv_ignore(uint16_t len);
 
     /** Common registers */
     enum
@@ -589,7 +589,7 @@ class Wiznet5500
         @param (uint8_t)cr Value to set @ref Sn_CR
         @sa getSn_CR()
     */
-    void           setSn_CR(uint8_t cr);
+    void setSn_CR(uint8_t cr);
 
     /**
         Get @ref Sn_CR register
diff --git a/tests/device/libraries/BSTest/src/BSArduino.h b/tests/device/libraries/BSTest/src/BSArduino.h
index 6ec933c7f9..82e1b89826 100644
--- a/tests/device/libraries/BSTest/src/BSArduino.h
+++ b/tests/device/libraries/BSTest/src/BSArduino.h
@@ -72,7 +72,7 @@ class ArduinoIOHelper
 
 typedef ArduinoIOHelper IOHelper;
 
-inline void             fatal()
+inline void fatal()
 {
     ESP.restart();
 }
diff --git a/tests/device/libraries/BSTest/src/BSArgs.h b/tests/device/libraries/BSTest/src/BSArgs.h
index 679ac5fb91..e8e41b8cbb 100644
--- a/tests/device/libraries/BSTest/src/BSArgs.h
+++ b/tests/device/libraries/BSTest/src/BSArgs.h
@@ -20,13 +20,13 @@ namespace protocol
     typedef enum
     {
         /* parsing the space between arguments */
-        SS_SPACE              = 0x0,
+        SS_SPACE = 0x0,
         /* parsing an argument which isn't quoted */
-        SS_ARG                = 0x1,
+        SS_ARG = 0x1,
         /* parsing a quoted argument */
-        SS_QUOTED_ARG         = 0x2,
+        SS_QUOTED_ARG = 0x2,
         /* parsing an escape sequence within unquoted argument */
-        SS_ARG_ESCAPED        = SS_ARG | SS_FLAG_ESCAPE,
+        SS_ARG_ESCAPED = SS_ARG | SS_FLAG_ESCAPE,
         /* parsing an escape sequence within a quoted argument */
         SS_QUOTED_ARG_ESCAPED = SS_QUOTED_ARG | SS_FLAG_ESCAPE,
     } split_state_t;
diff --git a/tests/device/libraries/BSTest/src/BSStdio.h b/tests/device/libraries/BSTest/src/BSStdio.h
index eccde5ce54..892ecaa9d4 100644
--- a/tests/device/libraries/BSTest/src/BSStdio.h
+++ b/tests/device/libraries/BSTest/src/BSStdio.h
@@ -41,7 +41,7 @@ class StdIOHelper
 
 typedef StdIOHelper IOHelper;
 
-inline void         fatal()
+inline void fatal()
 {
     throw std::runtime_error("fatal error");
 }
diff --git a/tests/device/test_libc/libm_string.c b/tests/device/test_libc/libm_string.c
index 9da92bcc61..5ee879c11a 100644
--- a/tests/device/test_libc/libm_string.c
+++ b/tests/device/test_libc/libm_string.c
@@ -58,7 +58,7 @@ _DEFUN(funcqual, (a, b, l),
 static char one[50];
 static char two[50];
 
-void        libm_test_string()
+void libm_test_string()
 {
     /* Test strcmp first because we use it to test other things.  */
     it = "strcmp";
diff --git a/tests/device/test_libc/memmove1.c b/tests/device/test_libc/memmove1.c
index 63bbc0b190..6fd2ceabef 100644
--- a/tests/device/test_libc/memmove1.c
+++ b/tests/device/test_libc/memmove1.c
@@ -108,8 +108,8 @@ void fill(unsigned char dest[MAX * 3])
 
 void memmove_main(void)
 {
-    size_t        i;
-    int           errors = 0;
+    size_t i;
+    int    errors = 0;
 
     /* Leave some room before and after the area tested, so we can detect
      overwrites of up to N bytes, N being the amount tested.  If you
diff --git a/tests/device/test_libc/strcmp-1.c b/tests/device/test_libc/strcmp-1.c
index 6da8ef9a81..d51e14b46c 100644
--- a/tests/device/test_libc/strcmp-1.c
+++ b/tests/device/test_libc/strcmp-1.c
@@ -106,7 +106,7 @@
 #endif
 
 #define TOO_MANY_ERRORS 11
-static int  errors   = 0;
+static int errors = 0;
 
 const char* testname = "strcmp";
 
@@ -179,7 +179,7 @@ void       strcmp_main(void)
                             for (j = 0; j < (int)len; j++)
                                 *p++ = 'x';
                             /* Make dest 0-terminated.  */
-                            *p  = '\0';
+                            *p = '\0';
 
                             ret = strcmp(src + sa, dest + da);
 
diff --git a/tests/device/test_libc/tstring.c b/tests/device/test_libc/tstring.c
index 5989626c5a..8d1f242f5e 100644
--- a/tests/device/test_libc/tstring.c
+++ b/tests/device/test_libc/tstring.c
@@ -72,20 +72,20 @@ void tstring_main(void)
     char  expected[MAX_1];
     char *tmp1, *tmp2, *tmp3, *tmp4, *tmp5, *tmp6, *tmp7;
     int   i, j, k, x, z, align_test_iterations;
-    z               = 0;
+    z = 0;
 
     int test_failed = 0;
 
-    tmp1            = target;
-    tmp2            = buffer2;
-    tmp3            = buffer3;
-    tmp4            = buffer4;
-    tmp5            = buffer5;
-    tmp6            = buffer6;
-    tmp7            = buffer7;
+    tmp1 = target;
+    tmp2 = buffer2;
+    tmp3 = buffer3;
+    tmp4 = buffer4;
+    tmp5 = buffer5;
+    tmp6 = buffer6;
+    tmp7 = buffer7;
 
-    tmp2[0]         = 'Z';
-    tmp2[1]         = '\0';
+    tmp2[0] = 'Z';
+    tmp2[1] = '\0';
 
     if (memset(target, 'X', 0) != target || memcpy(target, "Y", 0) != target || memmove(target, "K", 0) != target || strncpy(tmp2, "4", 0) != tmp2 || strncat(tmp2, "123", 0) != tmp2 || strcat(target, "") != target)
     {
@@ -209,12 +209,12 @@ void tstring_main(void)
 
             for (x = 0; x < align_test_iterations; ++x)
             {
-                tmp1        = target + x;
-                tmp2        = buffer2 + x;
-                tmp3        = buffer3 + x;
-                tmp4        = buffer4 + x;
-                tmp5        = buffer5 + x;
-                tmp6        = buffer6 + x;
+                tmp1 = target + x;
+                tmp2 = buffer2 + x;
+                tmp3 = buffer3 + x;
+                tmp4 = buffer4 + x;
+                tmp5 = buffer5 + x;
+                tmp6 = buffer6 + x;
 
                 first_char  = array[i % (sizeof(array) - 1)];
                 second_char = array2[i % (sizeof(array2) - 1)];
diff --git a/tests/host/common/Arduino.cpp b/tests/host/common/Arduino.cpp
index 64b000ebfb..b67d2d429e 100644
--- a/tests/host/common/Arduino.cpp
+++ b/tests/host/common/Arduino.cpp
@@ -21,7 +21,7 @@
 #include <Arduino.h>
 #include <Schedule.h>
 
-static struct timeval    gtod0 = { 0, 0 };
+static struct timeval gtod0 = { 0, 0 };
 
 extern "C" unsigned long millis()
 {
diff --git a/tests/host/common/ArduinoMain.cpp b/tests/host/common/ArduinoMain.cpp
index 6f48a04259..7a759011cf 100644
--- a/tests/host/common/ArduinoMain.cpp
+++ b/tests/host/common/ArduinoMain.cpp
@@ -56,7 +56,7 @@ const char* fspath            = nullptr;
 
 static struct termios initial_settings;
 
-int                   mockverbose(const char* fmt, ...)
+int mockverbose(const char* fmt, ...)
 {
     va_list ap;
     va_start(ap, fmt);
diff --git a/tests/host/common/ArduinoMainLittlefs.cpp b/tests/host/common/ArduinoMainLittlefs.cpp
index f2c1b8b8f0..c85e0b9dbc 100644
--- a/tests/host/common/ArduinoMainLittlefs.cpp
+++ b/tests/host/common/ArduinoMainLittlefs.cpp
@@ -3,7 +3,7 @@
 
 LittleFSMock* littlefs_mock = nullptr;
 
-void          mock_start_littlefs(const String& fname, size_t size_kb, size_t block_kb, size_t page_b)
+void mock_start_littlefs(const String& fname, size_t size_kb, size_t block_kb, size_t page_b)
 {
     littlefs_mock = new LittleFSMock(size_kb * 1024, block_kb * 1024, page_b, fname);
 }
diff --git a/tests/host/common/ArduinoMainSpiffs.cpp b/tests/host/common/ArduinoMainSpiffs.cpp
index e4a1c911fb..035cc9e752 100644
--- a/tests/host/common/ArduinoMainSpiffs.cpp
+++ b/tests/host/common/ArduinoMainSpiffs.cpp
@@ -3,7 +3,7 @@
 
 SpiffsMock* spiffs_mock = nullptr;
 
-void        mock_start_spiffs(const String& fname, size_t size_kb, size_t block_kb, size_t page_b)
+void mock_start_spiffs(const String& fname, size_t size_kb, size_t block_kb, size_t page_b)
 {
     spiffs_mock = new SpiffsMock(size_kb * 1024, block_kb * 1024, page_b, fname);
 }
diff --git a/tests/host/common/ArduinoMainUdp.cpp b/tests/host/common/ArduinoMainUdp.cpp
index 4c43872dc5..cfcaacef2a 100644
--- a/tests/host/common/ArduinoMainUdp.cpp
+++ b/tests/host/common/ArduinoMainUdp.cpp
@@ -35,7 +35,7 @@
 
 std::map<int, UdpContext*> udps;
 
-void                       register_udp(int sock, UdpContext* udp)
+void register_udp(int sock, UdpContext* udp)
 {
     if (udp)
         udps[sock] = udp;
diff --git a/tests/host/common/EEPROM.h b/tests/host/common/EEPROM.h
index ec031c2b33..dce99c7efd 100644
--- a/tests/host/common/EEPROM.h
+++ b/tests/host/common/EEPROM.h
@@ -65,7 +65,7 @@ class EEPROMClass
         return t;
     }
 
-    size_t  length() { return _size; }
+    size_t length() { return _size; }
 
     //uint8_t& operator[](int const address) { return read(address); }
     uint8_t operator[](int address) { return read(address); }
diff --git a/tests/host/common/MockDigital.cpp b/tests/host/common/MockDigital.cpp
index 8ccc4d1095..0820ea63f1 100644
--- a/tests/host/common/MockDigital.cpp
+++ b/tests/host/common/MockDigital.cpp
@@ -33,7 +33,7 @@ extern "C"
     static uint8_t _mode[17];
     static uint8_t _gpio[17];
 
-    extern void    pinMode(uint8_t pin, uint8_t mode)
+    extern void pinMode(uint8_t pin, uint8_t mode)
     {
         if (pin < 17)
         {
diff --git a/tests/host/common/MockEsp.cpp b/tests/host/common/MockEsp.cpp
index f2a426331b..6db348af55 100644
--- a/tests/host/common/MockEsp.cpp
+++ b/tests/host/common/MockEsp.cpp
@@ -83,14 +83,14 @@ unsigned long long operator"" _GB(unsigned long long x)
 
 uint32_t _SPIFFS_start;
 
-void     eboot_command_write(struct eboot_command* cmd)
+void eboot_command_write(struct eboot_command* cmd)
 {
     (void)cmd;
 }
 
 EspClass ESP;
 
-void     EspClass::restart()
+void EspClass::restart()
 {
     mockverbose("Esp.restart(): exiting\n");
     exit(EXIT_SUCCESS);
diff --git a/tests/host/common/MockTools.cpp b/tests/host/common/MockTools.cpp
index 894c87b65e..c1fbb2ae16 100644
--- a/tests/host/common/MockTools.cpp
+++ b/tests/host/common/MockTools.cpp
@@ -39,11 +39,11 @@ extern "C"
     uint32_t lwip_ntohl(uint32_t netlong) { return ntohl(netlong); }
     uint16_t lwip_ntohs(uint16_t netshort) { return ntohs(netshort); }
 
-    char*    ets_strcpy(char* d, const char* s) { return strcpy(d, s); }
-    char*    ets_strncpy(char* d, const char* s, size_t n) { return strncpy(d, s, n); }
-    size_t   ets_strlen(const char* s) { return strlen(s); }
+    char*  ets_strcpy(char* d, const char* s) { return strcpy(d, s); }
+    char*  ets_strncpy(char* d, const char* s, size_t n) { return strncpy(d, s, n); }
+    size_t ets_strlen(const char* s) { return strlen(s); }
 
-    int      ets_printf(const char* fmt, ...)
+    int ets_printf(const char* fmt, ...)
     {
         va_list ap;
         va_start(ap, fmt);
@@ -52,9 +52,9 @@ extern "C"
         return len;
     }
 
-    void     stack_thunk_add_ref() { }
-    void     stack_thunk_del_ref() { }
-    void     stack_thunk_repaint() { }
+    void stack_thunk_add_ref() { }
+    void stack_thunk_del_ref() { }
+    void stack_thunk_repaint() { }
 
     uint32_t stack_thunk_get_refcnt() { return 0; }
     uint32_t stack_thunk_get_stack_top() { return 0; }
diff --git a/tests/host/common/MockUART.cpp b/tests/host/common/MockUART.cpp
index d055e95d36..12e4599c75 100644
--- a/tests/host/common/MockUART.cpp
+++ b/tests/host/common/MockUART.cpp
@@ -39,11 +39,11 @@
 
 extern "C"
 {
-    bool           blocking_uart   = true;  // system default
+    bool blocking_uart = true;  // system default
 
-    static int     s_uart_debug_nr = UART1;
+    static int s_uart_debug_nr = UART1;
 
-    static uart_t* UART[2]         = { NULL, NULL };
+    static uart_t* UART[2] = { NULL, NULL };
 
     struct uart_rx_buffer_
     {
@@ -103,7 +103,7 @@ extern "C"
     {
         struct uart_rx_buffer_* rx_buffer = uart->rx_buffer;
 
-        size_t                  nextPos   = (rx_buffer->wpos + 1) % rx_buffer->size;
+        size_t nextPos = (rx_buffer->wpos + 1) % rx_buffer->size;
         if (nextPos == rx_buffer->rpos)
         {
             uart->rx_overrun = true;
diff --git a/tests/host/common/MocklwIP.cpp b/tests/host/common/MocklwIP.cpp
index 387b71b326..0b5dfa502b 100644
--- a/tests/host/common/MocklwIP.cpp
+++ b/tests/host/common/MocklwIP.cpp
@@ -9,9 +9,9 @@ extern "C"
 {
     extern netif netif0;
 
-    netif*       netif_list = &netif0;
+    netif* netif_list = &netif0;
 
-    err_t        dhcp_renew(struct netif* netif)
+    err_t dhcp_renew(struct netif* netif)
     {
         (void)netif;
         return ERR_OK;
diff --git a/tests/host/common/UdpContextSocket.cpp b/tests/host/common/UdpContextSocket.cpp
index 0b2d1760ed..161821a294 100644
--- a/tests/host/common/UdpContextSocket.cpp
+++ b/tests/host/common/UdpContextSocket.cpp
@@ -132,8 +132,8 @@ size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& a
     struct sockaddr_storage addrbuf;
     socklen_t               addrbufsize = std::min((socklen_t)sizeof(addrbuf), (socklen_t)16);
 
-    size_t                  maxread     = CCBUFSIZE - ccinbufsize;
-    ssize_t                 ret         = ::recvfrom(sock, ccinbuf + ccinbufsize, maxread, 0 /*flags*/, (sockaddr*)&addrbuf, &addrbufsize);
+    size_t  maxread = CCBUFSIZE - ccinbufsize;
+    ssize_t ret     = ::recvfrom(sock, ccinbuf + ccinbufsize, maxread, 0 /*flags*/, (sockaddr*)&addrbuf, &addrbufsize);
     if (ret == -1)
     {
         if (errno != EAGAIN)
diff --git a/tests/host/common/c_types.h b/tests/host/common/c_types.h
index a89736f109..249c423682 100644
--- a/tests/host/common/c_types.h
+++ b/tests/host/common/c_types.h
@@ -36,23 +36,23 @@
 #include <stdarg.h>
 #include <sys/cdefs.h>
 
-typedef signed char        sint8_t;
-typedef signed short       sint16_t;
-typedef signed long        sint32_t;
-typedef signed long long   sint64_t;
+typedef signed char      sint8_t;
+typedef signed short     sint16_t;
+typedef signed long      sint32_t;
+typedef signed long long sint64_t;
 // CONFLICT typedef unsigned long long  u_int64_t;
-typedef float              real32_t;
-typedef double             real64_t;
+typedef float  real32_t;
+typedef double real64_t;
 
 // CONFLICT typedef unsigned char       uint8;
-typedef unsigned char      u8;
-typedef signed char        sint8;
-typedef signed char        int8;
-typedef signed char        s8;
-typedef unsigned short     uint16;
-typedef unsigned short     u16;
-typedef signed short       sint16;
-typedef signed short       s16;
+typedef unsigned char  u8;
+typedef signed char    sint8;
+typedef signed char    int8;
+typedef signed char    s8;
+typedef unsigned short uint16;
+typedef unsigned short u16;
+typedef signed short   sint16;
+typedef signed short   s16;
 // CONFLICT typedef unsigned int        uint32;
 typedef unsigned int       u_int;
 typedef unsigned int       u32;
diff --git a/tests/host/common/esp8266_peri.h b/tests/host/common/esp8266_peri.h
index 4a1a3cd031..4dcd6cb9cd 100644
--- a/tests/host/common/esp8266_peri.h
+++ b/tests/host/common/esp8266_peri.h
@@ -2,8 +2,8 @@
 #ifndef FAKE_ESP8266_PERI_H
 #define FAKE_ESP8266_PERI_H
 
-const int GPI = 0;
-const int GPO = 0;
+const int GPI   = 0;
+const int GPO   = 0;
 const int GP16I = 0;
 
 #endif
diff --git a/tests/host/common/include/ClientContext.h b/tests/host/common/include/ClientContext.h
index 1067334480..b3c32211e2 100644
--- a/tests/host/common/include/ClientContext.h
+++ b/tests/host/common/include/ClientContext.h
@@ -304,21 +304,21 @@ class ClientContext
     }
 
 private:
-    discard_cb_t   _discard_cb     = nullptr;
-    void*          _discard_cb_arg = nullptr;
+    discard_cb_t _discard_cb     = nullptr;
+    void*        _discard_cb_arg = nullptr;
 
     int8_t         _refcnt;
     ClientContext* _next;
 
-    bool           _sync;
+    bool _sync;
 
     // MOCK
 
-    int            _sock       = -1;
-    int            _timeout_ms = 5000;
+    int _sock       = -1;
+    int _timeout_ms = 5000;
 
-    char           _inbuf[CCBUFSIZE];
-    size_t         _inbufsize = 0;
+    char   _inbuf[CCBUFSIZE];
+    size_t _inbufsize = 0;
 };
 
 #endif  //CLIENTCONTEXT_H
diff --git a/tests/host/common/include/UdpContext.h b/tests/host/common/include/UdpContext.h
index 0b064b434f..0e3942b2db 100644
--- a/tests/host/common/include/UdpContext.h
+++ b/tests/host/common/include/UdpContext.h
@@ -276,18 +276,18 @@ class UdpContext
     rxhandler_t _on_rx;
     int         _refcnt = 0;
 
-    ip_addr_t   _dst;
-    uint16_t    _dstport;
+    ip_addr_t _dst;
+    uint16_t  _dstport;
 
-    char        _inbuf[CCBUFSIZE];
-    size_t      _inbufsize = 0;
-    char        _outbuf[CCBUFSIZE];
-    size_t      _outbufsize = 0;
+    char   _inbuf[CCBUFSIZE];
+    size_t _inbufsize = 0;
+    char   _outbuf[CCBUFSIZE];
+    size_t _outbufsize = 0;
 
-    int         _timeout_ms = 0;
+    int _timeout_ms = 0;
 
-    uint8_t     addrsize;
-    uint8_t     addr[16];
+    uint8_t addrsize;
+    uint8_t addr[16];
 };
 
 extern "C" inline err_t igmp_joingroup(const ip4_addr_t* ifaddr, const ip4_addr_t* groupaddr)
diff --git a/tests/host/common/littlefs_mock.h b/tests/host/common/littlefs_mock.h
index 794c36376c..53f4a5a5f7 100644
--- a/tests/host/common/littlefs_mock.h
+++ b/tests/host/common/littlefs_mock.h
@@ -35,8 +35,8 @@ class LittleFSMock
     ~LittleFSMock();
 
 protected:
-    void                 load();
-    void                 save();
+    void load();
+    void save();
 
     std::vector<uint8_t> m_fs;
     String               m_storage;
diff --git a/tests/host/common/md5.c b/tests/host/common/md5.c
index 762ad422a3..863ac80026 100644
--- a/tests/host/common/md5.c
+++ b/tests/host/common/md5.c
@@ -68,9 +68,9 @@ typedef struct
 #define S44 21
 
 /* ----- static functions ----- */
-static void          MD5Transform(uint32_t state[4], const uint8_t block[64]);
-static void          Encode(uint8_t* output, uint32_t* input, uint32_t len);
-static void          Decode(uint32_t* output, const uint8_t* input, uint32_t len);
+static void MD5Transform(uint32_t state[4], const uint8_t block[64]);
+static void Encode(uint8_t* output, uint32_t* input, uint32_t len);
+static void Decode(uint32_t* output, const uint8_t* input, uint32_t len);
 
 static const uint8_t PADDING[64] = {
     0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -124,10 +124,10 @@ EXP_FUNC void STDCALL MD5Init(MD5_CTX* ctx)
 
     /* Load magic initialization constants.
      */
-    ctx->state[0]                 = 0x67452301;
-    ctx->state[1]                 = 0xefcdab89;
-    ctx->state[2]                 = 0x98badcfe;
-    ctx->state[3]                 = 0x10325476;
+    ctx->state[0] = 0x67452301;
+    ctx->state[1] = 0xefcdab89;
+    ctx->state[2] = 0x98badcfe;
+    ctx->state[3] = 0x10325476;
 }
 
 /**
diff --git a/tests/host/common/mock.h b/tests/host/common/mock.h
index 149d1fe43d..d11714df0e 100644
--- a/tests/host/common/mock.h
+++ b/tests/host/common/mock.h
@@ -61,8 +61,8 @@ extern "C"
 {
 #endif
     // TODO: #include <stdlib_noniso.h> ?
-    char*  itoa(int val, char* s, int radix);
-    char*  ltoa(long val, char* s, int radix);
+    char* itoa(int val, char* s, int radix);
+    char* ltoa(long val, char* s, int radix);
 
     size_t strlcat(char* dst, const char* src, size_t size);
     size_t strlcpy(char* dst, const char* src, size_t size);
@@ -109,7 +109,7 @@ extern "C"
         putchar(c);
     }
 
-    int                mockverbose(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
+    int mockverbose(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
 
     extern const char* host_interface;  // cmdline parameter
     extern bool        serial_timestamp;
@@ -120,7 +120,7 @@ extern "C"
 #define NO_GLOBAL_BINDING 0xffffffff
     extern uint32_t global_ipv4_netfmt;  // selected interface addresse to bind to
 
-    void            loop_end();
+    void loop_end();
 
 #ifdef __cplusplus
 }
@@ -154,14 +154,14 @@ ssize_t mockWrite(int sock, const uint8_t* data, size_t size, int timeout_ms);
 int     serverAccept(int sock);
 
 // udp
-void    check_incoming_udp();
-int     mockUDPSocket();
-bool    mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast = 0);
-size_t  mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port);
-size_t  mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
-size_t  mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
-size_t  mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port);
-void    mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize);
+void   check_incoming_udp();
+int    mockUDPSocket();
+bool   mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast = 0);
+size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port);
+size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
+size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
+size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port);
+void   mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize);
 
 class UdpContext;
 void register_udp(int sock, UdpContext* udp = nullptr);
diff --git a/tests/host/common/queue.h b/tests/host/common/queue.h
index 638961efdb..6d7e015045 100644
--- a/tests/host/common/queue.h
+++ b/tests/host/common/queue.h
@@ -501,8 +501,8 @@ struct quehead
 static __inline void
 insque(void* a, void* b)
 {
-    struct quehead *element    = (struct quehead*)a,
-                   *head       = (struct quehead*)b;
+    struct quehead *element = (struct quehead*)a,
+                   *head    = (struct quehead*)b;
 
     element->qh_link           = head->qh_link;
     element->qh_rlink          = head;
@@ -513,7 +513,7 @@ insque(void* a, void* b)
 static __inline void
 remque(void* a)
 {
-    struct quehead* element    = (struct quehead*)a;
+    struct quehead* element = (struct quehead*)a;
 
     element->qh_link->qh_rlink = element->qh_rlink;
     element->qh_rlink->qh_link = element->qh_link;
diff --git a/tests/host/common/spiffs_mock.cpp b/tests/host/common/spiffs_mock.cpp
index 7e3085bb80..c54cab3053 100644
--- a/tests/host/common/spiffs_mock.cpp
+++ b/tests/host/common/spiffs_mock.cpp
@@ -34,7 +34,7 @@
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
-FS                     SPIFFS(nullptr);
+FS SPIFFS(nullptr);
 
 SpiffsMock::SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage)
 {
diff --git a/tests/host/common/spiffs_mock.h b/tests/host/common/spiffs_mock.h
index a5ca568fa6..18217a7ac5 100644
--- a/tests/host/common/spiffs_mock.h
+++ b/tests/host/common/spiffs_mock.h
@@ -32,8 +32,8 @@ class SpiffsMock
     ~SpiffsMock();
 
 protected:
-    void                 load();
-    void                 save();
+    void load();
+    void save();
 
     std::vector<uint8_t> m_fs;
     String               m_storage;
diff --git a/tests/host/common/user_interface.cpp b/tests/host/common/user_interface.cpp
index f8cd9ae692..3b7f1226b5 100644
--- a/tests/host/common/user_interface.cpp
+++ b/tests/host/common/user_interface.cpp
@@ -162,7 +162,7 @@ extern "C"
     netif    netif0;
     uint32_t global_source_address = INADDR_ANY;
 
-    bool     wifi_get_ip_info(uint8 if_index, struct ip_info* info)
+    bool wifi_get_ip_info(uint8 if_index, struct ip_info* info)
     {
         // emulate wifi_get_ip_info()
         // ignore if_index
@@ -223,9 +223,9 @@ extern "C"
 
         if (info)
         {
-            info->ip.addr       = ipv4;
-            info->netmask.addr  = mask;
-            info->gw.addr       = ipv4;
+            info->ip.addr      = ipv4;
+            info->netmask.addr = mask;
+            info->gw.addr      = ipv4;
 
             netif0.ip_addr.addr = ipv4;
             netif0.netmask.addr = mask;
@@ -487,7 +487,7 @@ extern "C"
     ///////////////////////////////////////
     // not user_interface
 
-    void     ets_isr_mask(int intr)
+    void ets_isr_mask(int intr)
     {
         (void)intr;
     }
diff --git a/tests/host/core/test_PolledTimeout.cpp b/tests/host/core/test_PolledTimeout.cpp
index 59b2131370..b03a2af624 100644
--- a/tests/host/core/test_PolledTimeout.cpp
+++ b/tests/host/core/test_PolledTimeout.cpp
@@ -185,7 +185,7 @@ TEST_CASE("Periodic Timeout 10T 1000ms", "[polledTimeout]")
 
     Serial.println("Periodic 10T Timeout 1000ms");
 
-    int        counter = 10;
+    int counter = 10;
 
     periodicMs timeout(1000);
     before = millis();
diff --git a/tests/host/core/test_string.cpp b/tests/host/core/test_string.cpp
index 74300846fc..b0f4012aef 100644
--- a/tests/host/core/test_string.cpp
+++ b/tests/host/core/test_string.cpp
@@ -23,8 +23,8 @@ TEST_CASE("String::move", "[core][String]")
 {
     const char buffer[] = "this string goes over the sso limit";
 
-    String     target;
-    String     source(buffer);
+    String target;
+    String source(buffer);
 
     target = std::move(source);
     REQUIRE(source.c_str() != nullptr);
@@ -540,7 +540,7 @@ TEST_CASE("Strings with NULs", "[core][String]")
 
 TEST_CASE("Replace and string expansion", "[core][String]")
 {
-    String      s, l;
+    String s, l;
     // Make these large enough to span SSO and non SSO
     String      whole = "#123456789012345678901234567890";
     const char* res   = "abcde123456789012345678901234567890";
diff --git a/tests/restyle.sh b/tests/restyle.sh
index 73b8b25c15..3f49bb07d7 100755
--- a/tests/restyle.sh
+++ b/tests/restyle.sh
@@ -14,6 +14,7 @@ makeClangConf()
 {
     IndentWidth="$1"
     IndentCaseLabels="$2"
+    BreakBeforeBraces="$3"
 
     cat << EOF > .clang-format
 BasedOnStyle: WebKit
@@ -25,11 +26,11 @@ SpacesBeforeTrailingComments: 2
 AlignTrailingComments: true
 SortIncludes: false
 BreakConstructorInitializers: AfterColon
-AlignConsecutiveAssignments: AcrossEmptyLinesAndComments
-AlignConsecutiveBitFields: AcrossEmptyLinesAndComments
-AlignConsecutiveDeclarations: AcrossEmptyLinesAndComments
+AlignConsecutiveAssignments: Consecutive
+AlignConsecutiveBitFields: Consecutive
+AlignConsecutiveDeclarations: Consecutive
 AlignAfterOpenBracket: Align
-
+BreakBeforeBraces: ${BreakBeforeBraces}
 IndentWidth: ${IndentWidth}
 IndentCaseLabels: ${IndentCaseLabels}
 EOF
@@ -55,7 +56,7 @@ tests
 #########################################
 # restyling core
 
-makeClangConf 4 false
+makeClangConf 4 false Allman
 
 for d in $all; do
     if [ -d "$d" ]; then
@@ -72,7 +73,7 @@ done
 #########################################
 # restyling arduino examples
 
-makeClangConf 2 true
+makeClangConf 2 true Attach
 
 for d in libraries; do
     echo "-------- examples in $d:"

From 9c427d7a001a21b008d333dc228b659343007522 Mon Sep 17 00:00:00 2001
From: David Gauchard <gauchard@laas.fr>
Date: Thu, 20 Jan 2022 14:11:10 +0100
Subject: [PATCH 11/15] move comment

---
 cores/esp8266/LwipDhcpServer-NonOS.cpp        |    7 +-
 cores/esp8266/LwipDhcpServer.cpp              |  496 +--
 cores/esp8266/LwipDhcpServer.h                |   88 +-
 cores/esp8266/LwipIntf.cpp                    |   15 +-
 cores/esp8266/LwipIntf.h                      |   13 +-
 cores/esp8266/LwipIntfCB.cpp                  |   18 +-
 cores/esp8266/LwipIntfDev.h                   |   67 +-
 cores/esp8266/StreamSend.cpp                  |   46 +-
 cores/esp8266/StreamString.h                  |   73 +-
 cores/esp8266/core_esp8266_si2c.cpp           |  268 +-
 cores/esp8266/debug.cpp                       |    2 +-
 cores/esp8266/debug.h                         |   44 +-
 .../ArduinoOTA/examples/BasicOTA/BasicOTA.ino |   14 +-
 .../ArduinoOTA/examples/OTALeds/OTALeds.ino   |   13 +-
 .../CaptivePortalAdvanced.ino                 |   25 +-
 .../CaptivePortalAdvanced/handleHttp.ino      |   89 +-
 .../BasicHttpClient/BasicHttpClient.ino       |    4 +
 .../BasicHttpsClient/BasicHttpsClient.ino     |    6 +-
 .../DigestAuthorization.ino                   |   31 +-
 .../PostHttpClient/PostHttpClient.ino         |    7 +-
 .../ReuseConnectionV2/ReuseConnectionV2.ino   |    5 +-
 .../StreamHttpClient/StreamHttpClient.ino     |    8 +-
 .../StreamHttpsClient/StreamHttpsClient.ino   |    8 +-
 .../SecureWebUpdater/SecureWebUpdater.ino     |   13 +-
 .../examples/WebUpdater/WebUpdater.ino        |    9 +-
 .../LLMNR_Web_Server/LLMNR_Web_Server.ino     |    4 +-
 .../examples/ESP_NBNST/ESP_NBNST.ino          |    7 +-
 .../AdvancedWebServer/AdvancedWebServer.ino   |   20 +-
 .../examples/FSBrowser/FSBrowser.ino          |   52 +-
 .../ESP8266WebServer/examples/Graph/Graph.ino |   43 +-
 .../examples/HelloServer/HelloServer.ino      |   26 +-
 .../HttpAdvancedAuth/HttpAdvancedAuth.ino     |   18 +-
 .../HttpHashCredAuth/HttpHashCredAuth.ino     |   99 +-
 .../examples/PathArgServer/PathArgServer.ino  |   12 +-
 .../examples/PostServer/PostServer.ino        |    2 +-
 .../ServerSentEvents/ServerSentEvents.ino     |   57 +-
 .../SimpleAuthentication.ino                  |   11 +-
 .../examples/WebServer/WebServer.ino          |  163 +-
 .../examples/WebUpdate/WebUpdate.ino          |   65 +-
 .../BearSSL_CertStore/BearSSL_CertStore.ino   |   19 +-
 .../BearSSL_Server/BearSSL_Server.ino         |   58 +-
 .../BearSSL_ServerClientCert.ino              |   46 +-
 .../BearSSL_Sessions/BearSSL_Sessions.ino     |   20 +-
 .../BearSSL_Validation/BearSSL_Validation.ino |   19 +-
 .../examples/HTTPSRequest/HTTPSRequest.ino    |    9 +-
 libraries/ESP8266WiFi/examples/IPv6/IPv6.ino  |   30 +-
 .../examples/NTPClient/NTPClient.ino          |   46 +-
 .../examples/PagerServer/PagerServer.ino      |   20 +-
 .../RangeExtender-NAPT/RangeExtender-NAPT.ino |    9 +-
 .../examples/StaticLease/StaticLease.ino      |   17 +-
 libraries/ESP8266WiFi/examples/Udp/Udp.ino    |   12 +-
 .../WiFiAccessPoint/WiFiAccessPoint.ino       |    6 +-
 .../WiFiClientBasic/WiFiClientBasic.ino       |    6 +-
 .../examples/WiFiEcho/WiFiEcho.ino            |   90 +-
 .../examples/WiFiEvents/WiFiEvents.ino        |    2 +-
 .../WiFiManualWebServer.ino                   |    6 +-
 .../examples/WiFiScan/WiFiScan.ino            |   12 +-
 .../examples/WiFiShutdown/WiFiShutdown.ino    |    8 +-
 .../WiFiTelnetToSerial/WiFiTelnetToSerial.ino |   23 +-
 .../examples/HelloEspnow/HelloEspnow.ino      |  103 +-
 .../examples/HelloMesh/HelloMesh.ino          |   56 +-
 .../examples/HelloTcpIp/HelloTcpIp.ino        |   54 +-
 .../examples/httpUpdate/httpUpdate.ino        |    8 +-
 .../httpUpdateLittleFS/httpUpdateLittleFS.ino |    6 +-
 .../httpUpdateSecure/httpUpdateSecure.ino     |    9 +-
 .../httpUpdateSigned/httpUpdateSigned.ino     |   24 +-
 .../LEAmDNS/mDNS_Clock/mDNS_Clock.ino         |   52 +-
 .../mDNS_ServiceMonitor.ino                   |   58 +-
 .../OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino   |   38 +-
 .../mDNS_Web_Server/mDNS_Web_Server.ino       |   15 +-
 libraries/ESP8266mDNS/src/ESP8266mDNS.cpp     |    1 +
 libraries/ESP8266mDNS/src/ESP8266mDNS.h       |    6 +-
 libraries/ESP8266mDNS/src/LEAmDNS.cpp         | 1636 +++++-----
 libraries/ESP8266mDNS/src/LEAmDNS.h           | 2115 ++++++-------
 libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp | 2799 +++++++++--------
 libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp |  952 +++---
 libraries/ESP8266mDNS/src/LEAmDNS_Priv.h      |   64 +-
 libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp | 2770 ++++++++--------
 .../ESP8266mDNS/src/LEAmDNS_Transfer.cpp      | 2248 +++++++------
 libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h  |    2 +-
 libraries/Hash/examples/sha1/sha1.ino         |    1 +
 .../I2S/examples/SimpleTone/SimpleTone.ino    |   16 +-
 .../LittleFS_Timestamp/LittleFS_Timestamp.ino |   31 +-
 .../LittleFS/examples/SpeedTest/SpeedTest.ino |   27 +-
 .../Netdump/examples/Netdump/Netdump.ino      |   70 +-
 libraries/Netdump/src/Netdump.cpp             |   63 +-
 libraries/Netdump/src/NetdumpIP.cpp           |   58 +-
 libraries/Netdump/src/NetdumpIP.h             |   24 +-
 libraries/Netdump/src/NetdumpPacket.cpp       |  129 +-
 libraries/Netdump/src/NetdumpPacket.h         |   54 +-
 libraries/Netdump/src/PacketType.cpp          |   58 +-
 libraries/Netdump/src/PacketType.h            |    5 +-
 libraries/SD/examples/DumpFile/DumpFile.ino   |    1 +
 libraries/SD/examples/listfiles/listfiles.ino |   11 +-
 .../SPISlave_Master/SPISlave_Master.ino       |  105 +-
 .../SPISlave_SafeMaster.ino                   |  116 +-
 .../examples/SPISlave_Test/SPISlave_Test.ino  |   20 +-
 .../examples/drawCircle/drawCircle.ino        |   13 +-
 .../examples/drawLines/drawLines.ino          |    7 +-
 .../examples/drawNumber/drawNumber.ino        |   20 +-
 .../examples/drawRectangle/drawRectangle.ino  |    1 +
 .../examples/paint/paint.ino                  |    8 +-
 .../examples/shapes/shapes.ino                |    8 +-
 .../examples/text/text.ino                    |   17 +-
 .../examples/tftbmp2/tftbmp2.ino              |   82 +-
 .../TickerFunctional/TickerFunctional.ino     |   41 +-
 libraries/Wire/Wire.cpp                       |   42 +-
 libraries/Wire/Wire.h                         |   49 +-
 .../examples/master_reader/master_reader.ino  |   15 +-
 .../examples/master_writer/master_writer.ino  |   13 +-
 .../slave_receiver/slave_receiver.ino         |   22 +-
 .../examples/slave_sender/slave_sender.ino    |    9 +-
 libraries/esp8266/examples/Blink/Blink.ino    |    4 +-
 .../BlinkPolledTimeout/BlinkPolledTimeout.ino |   15 +-
 .../BlinkWithoutDelay/BlinkWithoutDelay.ino   |    2 +-
 .../examples/CallBackList/CallBackGeneric.ino |   36 +-
 .../examples/CheckFlashCRC/CheckFlashCRC.ino  |    7 +-
 .../CheckFlashConfig/CheckFlashConfig.ino     |   12 +-
 .../examples/ConfigFile/ConfigFile.ino        |    7 +-
 .../FadePolledTimeout/FadePolledTimeout.ino   |   13 +-
 .../examples/HeapMetric/HeapMetric.ino        |   13 +-
 .../examples/HelloCrypto/HelloCrypto.ino      |   14 +-
 .../examples/HwdtStackDump/HwdtStackDump.ino  |   17 +-
 .../examples/HwdtStackDump/ProcessKey.ino     |   25 +-
 .../esp8266/examples/I2SInput/I2SInput.ino    |    2 +-
 .../examples/I2STransmit/I2STransmit.ino      |   13 +-
 .../examples/IramReserve/IramReserve.ino      |   17 +-
 .../examples/IramReserve/ProcessKey.ino       |   25 +-
 .../examples/LowPowerDemo/LowPowerDemo.ino    |  145 +-
 libraries/esp8266/examples/MMU48K/MMU48K.ino  |  150 +-
 .../examples/NTP-TZ-DST/NTP-TZ-DST.ino        |   56 +-
 .../examples/RTCUserMemory/RTCUserMemory.ino  |   21 +-
 .../SerialDetectBaudrate.ino                  |    4 +-
 .../examples/SerialStress/SerialStress.ino    |   45 +-
 .../examples/StreamString/StreamString.ino    |   13 +-
 .../examples/TestEspApi/TestEspApi.ino        |   44 +-
 .../examples/UartDownload/UartDownload.ino    |   25 +-
 .../examples/interactive/interactive.ino      |   90 +-
 .../esp8266/examples/irammem/irammem.ino      |  212 +-
 .../examples/virtualmem/virtualmem.ino        |   30 +-
 .../lwIP_PPP/examples/PPPServer/PPPServer.ino |   11 +-
 libraries/lwIP_PPP/src/PPPServer.cpp          |   44 +-
 libraries/lwIP_PPP/src/PPPServer.h            |   18 +-
 .../lwIP_enc28j60/src/utility/enc28j60.cpp    |  114 +-
 .../lwIP_enc28j60/src/utility/enc28j60.h      |   41 +-
 libraries/lwIP_w5100/src/utility/w5100.cpp    |   49 +-
 libraries/lwIP_w5100/src/utility/w5100.h      |  175 +-
 .../examples/TCPClient/TCPClient.ino          |   12 +-
 libraries/lwIP_w5500/src/utility/w5500.cpp    |   31 +-
 libraries/lwIP_w5500/src/utility/w5500.h      |  231 +-
 tests/device/libraries/BSTest/src/BSArduino.h |   41 +-
 tests/device/libraries/BSTest/src/BSArgs.h    |  222 +-
 .../device/libraries/BSTest/src/BSProtocol.h  |  183 +-
 tests/device/libraries/BSTest/src/BSStdio.h   |   15 +-
 tests/device/libraries/BSTest/src/BSTest.h    |  122 +-
 tests/device/libraries/BSTest/test/test.cpp   |   16 +-
 tests/device/test_libc/libm_string.c          |  886 +++---
 tests/device/test_libc/memcpy-1.c             |  171 +-
 tests/device/test_libc/memmove1.c             |  189 +-
 tests/device/test_libc/strcmp-1.c             |  325 +-
 tests/device/test_libc/tstring.c              |  459 +--
 tests/host/common/Arduino.cpp                 |   16 +-
 tests/host/common/ArduinoCatch.cpp            |    1 +
 tests/host/common/ArduinoMain.cpp             |  481 ++-
 tests/host/common/ClientContextSocket.cpp     |  249 +-
 tests/host/common/EEPROM.h                    |   65 +-
 tests/host/common/HostWiring.cpp              |   64 +-
 tests/host/common/MockEEPROM.cpp              |   48 +-
 tests/host/common/MockEsp.cpp                 |  171 +-
 tests/host/common/MockSPI.cpp                 |    8 +-
 tests/host/common/MockTools.cpp               |   60 +-
 tests/host/common/MockUART.cpp                |  809 +++--
 tests/host/common/MockWiFiServer.cpp          |   25 +-
 tests/host/common/MockWiFiServerSocket.cpp    |  139 +-
 tests/host/common/MocklwIP.cpp                |  108 +-
 tests/host/common/UdpContextSocket.cpp        |  299 +-
 tests/host/common/WMath.cpp                   |   30 +-
 tests/host/common/c_types.h                   |   76 +-
 tests/host/common/include/ClientContext.h     |   86 +-
 tests/host/common/include/UdpContext.h        |   41 +-
 tests/host/common/littlefs_mock.cpp           |   11 +-
 tests/host/common/littlefs_mock.h             |   13 +-
 tests/host/common/md5.c                       |  227 +-
 tests/host/common/mock.h                      |   91 +-
 tests/host/common/noniso.c                    |   73 +-
 tests/host/common/pins_arduino.h              |    1 +
 tests/host/common/queue.h                     |  675 ++--
 tests/host/common/spiffs_mock.cpp             |   12 +-
 tests/host/common/spiffs_mock.h               |   13 +-
 tests/host/common/user_interface.cpp          |   94 +-
 tests/host/core/test_PolledTimeout.cpp        |  303 +-
 tests/host/core/test_md5builder.cpp           |   34 +-
 tests/host/core/test_pgmspace.cpp             |    7 +-
 tests/host/core/test_string.cpp               |  544 ++--
 tests/host/fs/test_fs.cpp                     |   41 +-
 tests/host/sys/pgmspace.h                     |   52 +-
 196 files changed, 13328 insertions(+), 12609 deletions(-)
 mode change 100644 => 100755 libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino

diff --git a/cores/esp8266/LwipDhcpServer-NonOS.cpp b/cores/esp8266/LwipDhcpServer-NonOS.cpp
index aee22b6d5c..0bd04ebcfe 100644
--- a/cores/esp8266/LwipDhcpServer-NonOS.cpp
+++ b/cores/esp8266/LwipDhcpServer-NonOS.cpp
@@ -23,7 +23,7 @@
 // these functions must exists as-is with "C" interface,
 // nonos-sdk calls them at boot time and later
 
-#include <lwip/init.h>  // LWIP_VERSION
+#include <lwip/init.h> // LWIP_VERSION
 
 #include <lwip/netif.h>
 #include "LwipDhcpServer.h"
@@ -35,7 +35,8 @@ DhcpServer dhcpSoftAP(&netif_git[SOFTAP_IF]);
 
 extern "C"
 {
-    void dhcps_start(struct ip_info* info, netif* apnetif)
+
+    void dhcps_start(struct ip_info *info, netif* apnetif)
     {
         // apnetif is esp interface, replaced by lwip2's
         // netif_git[SOFTAP_IF] interface in constructor
@@ -60,4 +61,4 @@ extern "C"
         dhcpSoftAP.end();
     }
 
-}  // extern "C"
+} // extern "C"
diff --git a/cores/esp8266/LwipDhcpServer.cpp b/cores/esp8266/LwipDhcpServer.cpp
index fd25edbc50..86f8849a91 100644
--- a/cores/esp8266/LwipDhcpServer.cpp
+++ b/cores/esp8266/LwipDhcpServer.cpp
@@ -34,9 +34,9 @@
 // (better is enemy of [good = already working])
 // ^^ this comment is supposed to be removed after the first commit
 
-#include <lwip/init.h>  // LWIP_VERSION
+#include <lwip/init.h> // LWIP_VERSION
 
-#define DHCPS_LEASE_TIME_DEF (120)
+#define DHCPS_LEASE_TIME_DEF    (120)
 
 #define USE_DNS
 
@@ -59,30 +59,30 @@ typedef struct dhcps_state
 
 typedef struct dhcps_msg
 {
-    uint8_t  op, htype, hlen, hops;
-    uint8_t  xid[4];
+    uint8_t op, htype, hlen, hops;
+    uint8_t xid[4];
     uint16_t secs, flags;
-    uint8_t  ciaddr[4];
-    uint8_t  yiaddr[4];
-    uint8_t  siaddr[4];
-    uint8_t  giaddr[4];
-    uint8_t  chaddr[16];
-    uint8_t  sname[64];
-    uint8_t  file[128];
-    uint8_t  options[312];
+    uint8_t ciaddr[4];
+    uint8_t yiaddr[4];
+    uint8_t siaddr[4];
+    uint8_t giaddr[4];
+    uint8_t chaddr[16];
+    uint8_t sname[64];
+    uint8_t file[128];
+    uint8_t options[312];
 } dhcps_msg;
 
 #ifndef LWIP_OPEN_SRC
 struct dhcps_lease
 {
-    bool             enable;
+    bool enable;
     struct ipv4_addr start_ip;
     struct ipv4_addr end_ip;
 };
 
 enum dhcps_offer_option
 {
-    OFFER_START  = 0x00,
+    OFFER_START = 0x00,
     OFFER_ROUTER = 0x01,
     OFFER_END
 };
@@ -103,49 +103,50 @@ typedef enum
 struct dhcps_pool
 {
     struct ipv4_addr ip;
-    uint8            mac[6];
-    uint32           lease_timer;
-    dhcps_type_t     type;
-    dhcps_state_t    state;
+    uint8 mac[6];
+    uint32 lease_timer;
+    dhcps_type_t type;
+    dhcps_state_t state;
+
 };
 
-#define DHCPS_LEASE_TIMER dhcps_lease_time  //0x05A0
+#define DHCPS_LEASE_TIMER  dhcps_lease_time  //0x05A0
 #define DHCPS_MAX_LEASE 0x64
 #define BOOTP_BROADCAST 0x8000
 
-#define DHCP_REQUEST 1
-#define DHCP_REPLY 2
+#define DHCP_REQUEST        1
+#define DHCP_REPLY          2
 #define DHCP_HTYPE_ETHERNET 1
-#define DHCP_HLEN_ETHERNET 6
-#define DHCP_MSG_LEN 236
-
-#define DHCPS_SERVER_PORT 67
-#define DHCPS_CLIENT_PORT 68
-
-#define DHCPDISCOVER 1
-#define DHCPOFFER 2
-#define DHCPREQUEST 3
-#define DHCPDECLINE 4
-#define DHCPACK 5
-#define DHCPNAK 6
-#define DHCPRELEASE 7
-
-#define DHCP_OPTION_SUBNET_MASK 1
-#define DHCP_OPTION_ROUTER 3
-#define DHCP_OPTION_DNS_SERVER 6
-#define DHCP_OPTION_REQ_IPADDR 50
-#define DHCP_OPTION_LEASE_TIME 51
-#define DHCP_OPTION_MSG_TYPE 53
-#define DHCP_OPTION_SERVER_ID 54
+#define DHCP_HLEN_ETHERNET  6
+#define DHCP_MSG_LEN      236
+
+#define DHCPS_SERVER_PORT  67
+#define DHCPS_CLIENT_PORT  68
+
+#define DHCPDISCOVER  1
+#define DHCPOFFER     2
+#define DHCPREQUEST   3
+#define DHCPDECLINE   4
+#define DHCPACK       5
+#define DHCPNAK       6
+#define DHCPRELEASE   7
+
+#define DHCP_OPTION_SUBNET_MASK   1
+#define DHCP_OPTION_ROUTER        3
+#define DHCP_OPTION_DNS_SERVER    6
+#define DHCP_OPTION_REQ_IPADDR   50
+#define DHCP_OPTION_LEASE_TIME   51
+#define DHCP_OPTION_MSG_TYPE     53
+#define DHCP_OPTION_SERVER_ID    54
 #define DHCP_OPTION_INTERFACE_MTU 26
 #define DHCP_OPTION_PERFORM_ROUTER_DISCOVERY 31
 #define DHCP_OPTION_BROADCAST_ADDRESS 28
-#define DHCP_OPTION_REQ_LIST 55
-#define DHCP_OPTION_END 255
+#define DHCP_OPTION_REQ_LIST     55
+#define DHCP_OPTION_END         255
 
 //#define USE_CLASS_B_NET 1
-#define DHCPS_DEBUG 0
-#define MAX_STATION_NUM 8
+#define DHCPS_DEBUG          0
+#define MAX_STATION_NUM      8
 
 #define DHCPS_STATE_OFFER 1
 #define DHCPS_STATE_DECLINE 2
@@ -154,41 +155,31 @@ struct dhcps_pool
 #define DHCPS_STATE_IDLE 5
 #define DHCPS_STATE_RELEASE 6
 
-#define dhcps_router_enabled(offer) ((offer & OFFER_ROUTER) != 0)
+#define   dhcps_router_enabled(offer)	((offer & OFFER_ROUTER) != 0)
 
 #ifdef MEMLEAK_DEBUG
 const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__;
 #endif
 
 #if DHCPS_DEBUG
-#define LWIP_IS_OK(what, err) (                                     \
-    {                                                               \
-        int ret = 1, errval = (err);                                \
-        if (errval != ERR_OK)                                       \
-        {                                                           \
-            os_printf("DHCPS ERROR: %s (lwip:%d)\n", what, errval); \
-            ret = 0;                                                \
-        }                                                           \
-        ret;                                                        \
-    })
+#define LWIP_IS_OK(what,err) ({ int ret = 1, errval = (err); if (errval != ERR_OK) { os_printf("DHCPS ERROR: %s (lwip:%d)\n", what, errval); ret = 0; } ret; })
 #else
-#define LWIP_IS_OK(what, err) ((err) == ERR_OK)
+#define LWIP_IS_OK(what,err) ((err) == ERR_OK)
 #endif
 
-const uint32 DhcpServer::magic_cookie = 0x63538263;  // https://tools.ietf.org/html/rfc1497
+const uint32 DhcpServer::magic_cookie = 0x63538263; // https://tools.ietf.org/html/rfc1497
 
 int fw_has_started_softap_dhcps = 0;
 
 ////////////////////////////////////////////////////////////////////////////////////
 
-DhcpServer::DhcpServer(netif* netif) :
-    _netif(netif)
+DhcpServer::DhcpServer(netif* netif): _netif(netif)
 {
-    pcb_dhcps        = nullptr;
+    pcb_dhcps = nullptr;
     dns_address.addr = 0;
-    plist            = nullptr;
-    offer            = 0xFF;
-    renew            = false;
+    plist = nullptr;
+    offer = 0xFF;
+    renew = false;
     dhcps_lease_time = DHCPS_LEASE_TIME_DEF;  //minute
 
     if (netif->num == SOFTAP_IF && fw_has_started_softap_dhcps == 1)
@@ -197,13 +188,14 @@ DhcpServer::DhcpServer(netif* netif) :
         // 1. `fw_has_started_softap_dhcps` is already initialized to 1
         // 2. global ctor DhcpServer's `dhcpSoftAP(&netif_git[SOFTAP_IF])` is called
         // 3. (that's here) => begin(legacy-values) is called
-        ip_info ip = {
-            { 0x0104a8c0 },  // IP 192.168.4.1
-            { 0x00ffffff },  // netmask 255.255.255.0
-            { 0 }            // gateway 0.0.0.0
+        ip_info ip =
+        {
+            { 0x0104a8c0 }, // IP 192.168.4.1
+            { 0x00ffffff }, // netmask 255.255.255.0
+            { 0 }           // gateway 0.0.0.0
         };
         begin(&ip);
-        fw_has_started_softap_dhcps = 2;  // not 1, ending initial boot sequence
+        fw_has_started_softap_dhcps = 2; // not 1, ending initial boot sequence
     }
 };
 
@@ -225,25 +217,25 @@ void DhcpServer::dhcps_set_dns(int num, const ipv4_addr_t* dns)
     Parameters   : arg -- Additional argument to pass to the callback function
     Returns      : none
 *******************************************************************************/
-void DhcpServer::node_insert_to_list(list_node** phead, list_node* pinsert)
+void DhcpServer::node_insert_to_list(list_node **phead, list_node* pinsert)
 {
-    list_node*         plist       = nullptr;
-    struct dhcps_pool* pdhcps_pool = nullptr;
-    struct dhcps_pool* pdhcps_node = nullptr;
+    list_node *plist = nullptr;
+    struct dhcps_pool *pdhcps_pool = nullptr;
+    struct dhcps_pool *pdhcps_node = nullptr;
     if (*phead == nullptr)
     {
         *phead = pinsert;
     }
     else
     {
-        plist       = *phead;
+        plist = *phead;
         pdhcps_node = (struct dhcps_pool*)pinsert->pnode;
         pdhcps_pool = (struct dhcps_pool*)plist->pnode;
 
         if (pdhcps_node->ip.addr < pdhcps_pool->ip.addr)
         {
             pinsert->pnext = plist;
-            *phead         = pinsert;
+            *phead = pinsert;
         }
         else
         {
@@ -253,7 +245,7 @@ void DhcpServer::node_insert_to_list(list_node** phead, list_node* pinsert)
                 if (pdhcps_node->ip.addr < pdhcps_pool->ip.addr)
                 {
                     pinsert->pnext = plist->pnext;
-                    plist->pnext   = pinsert;
+                    plist->pnext = pinsert;
                     break;
                 }
                 plist = plist->pnext;
@@ -274,9 +266,9 @@ void DhcpServer::node_insert_to_list(list_node** phead, list_node* pinsert)
     Parameters   : arg -- Additional argument to pass to the callback function
     Returns      : none
 *******************************************************************************/
-void DhcpServer::node_remove_from_list(list_node** phead, list_node* pdelete)
+void DhcpServer::node_remove_from_list(list_node **phead, list_node* pdelete)
 {
-    list_node* plist = nullptr;
+    list_node *plist = nullptr;
 
     plist = *phead;
     if (plist == nullptr)
@@ -287,7 +279,7 @@ void DhcpServer::node_remove_from_list(list_node** phead, list_node* pdelete)
     {
         if (plist == pdelete)
         {
-            *phead         = plist->pnext;
+            *phead = plist->pnext;
             pdelete->pnext = nullptr;
         }
         else
@@ -296,7 +288,7 @@ void DhcpServer::node_remove_from_list(list_node** phead, list_node* pdelete)
             {
                 if (plist->pnext == pdelete)
                 {
-                    plist->pnext   = pdelete->pnext;
+                    plist->pnext = pdelete->pnext;
                     pdelete->pnext = nullptr;
                 }
                 plist = plist->pnext;
@@ -311,13 +303,13 @@ void DhcpServer::node_remove_from_list(list_node** phead, list_node* pdelete)
     Parameters   : mac address
     Returns      : true if ok and false if this mac already exist or if all ip are already reserved
 *******************************************************************************/
-bool DhcpServer::add_dhcps_lease(uint8* macaddr)
+bool DhcpServer::add_dhcps_lease(uint8 *macaddr)
 {
-    struct dhcps_pool* pdhcps_pool = nullptr;
-    list_node*         pback_node  = nullptr;
+    struct dhcps_pool *pdhcps_pool = nullptr;
+    list_node *pback_node = nullptr;
 
     uint32 start_ip = dhcps_lease.start_ip.addr;
-    uint32 end_ip   = dhcps_lease.end_ip.addr;
+    uint32 end_ip = dhcps_lease.end_ip.addr;
 
     for (pback_node = plist; pback_node != nullptr; pback_node = pback_node->pnext)
     {
@@ -343,15 +335,15 @@ bool DhcpServer::add_dhcps_lease(uint8* macaddr)
         return false;
     }
 
-    pdhcps_pool          = (struct dhcps_pool*)zalloc(sizeof(struct dhcps_pool));
+    pdhcps_pool = (struct dhcps_pool *)zalloc(sizeof(struct dhcps_pool));
     pdhcps_pool->ip.addr = start_ip;
     memcpy(pdhcps_pool->mac, macaddr, sizeof(pdhcps_pool->mac));
     pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-    pdhcps_pool->type        = DHCPS_TYPE_STATIC;
-    pdhcps_pool->state       = DHCPS_STATE_ONLINE;
-    pback_node               = (list_node*)zalloc(sizeof(list_node));
-    pback_node->pnode        = pdhcps_pool;
-    pback_node->pnext        = nullptr;
+    pdhcps_pool->type = DHCPS_TYPE_STATIC;
+    pdhcps_pool->state = DHCPS_STATE_ONLINE;
+    pback_node = (list_node *)zalloc(sizeof(list_node));
+    pback_node->pnode = pdhcps_pool;
+    pback_node->pnext = nullptr;
     node_insert_to_list(&plist, pback_node);
 
     return true;
@@ -367,8 +359,9 @@ bool DhcpServer::add_dhcps_lease(uint8* macaddr)
     @return uint8_t* DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-uint8_t* DhcpServer::add_msg_type(uint8_t* optptr, uint8_t type)
+uint8_t* DhcpServer::add_msg_type(uint8_t *optptr, uint8_t type)
 {
+
     *optptr++ = DHCP_OPTION_MSG_TYPE;
     *optptr++ = 1;
     *optptr++ = type;
@@ -383,7 +376,7 @@ uint8_t* DhcpServer::add_msg_type(uint8_t* optptr, uint8_t type)
     @return uint8_t* DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-uint8_t* DhcpServer::add_offer_options(uint8_t* optptr)
+uint8_t* DhcpServer::add_offer_options(uint8_t *optptr)
 {
     //struct ipv4_addr ipadd;
     //ipadd.addr = server_address.addr;
@@ -455,19 +448,19 @@ uint8_t* DhcpServer::add_offer_options(uint8_t* optptr)
     *optptr++ = DHCP_OPTION_INTERFACE_MTU;
     *optptr++ = 2;
     *optptr++ = 0x05;
-    *optptr++ = 0xdc;  // 1500
+    *optptr++ = 0xdc; // 1500
 
     *optptr++ = DHCP_OPTION_PERFORM_ROUTER_DISCOVERY;
     *optptr++ = 1;
     *optptr++ = 0x00;
 
-#if 0  // vendor specific uninitialized (??)
+#if 0 // vendor specific uninitialized (??)
     *optptr++ = 43; // vendor specific
     *optptr++ = 6;
     // uninitialized ?
 #endif
 
-#if 0  // already set (DHCP_OPTION_SUBNET_MASK==1) (??)
+#if 0 // already set (DHCP_OPTION_SUBNET_MASK==1) (??)
     *optptr++ = 0x01;
     *optptr++ = 4;
     *optptr++ = 0;
@@ -490,34 +483,35 @@ uint8_t* DhcpServer::add_offer_options(uint8_t* optptr)
     @return uint8_t* DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-uint8_t* DhcpServer::add_end(uint8_t* optptr)
+uint8_t* DhcpServer::add_end(uint8_t *optptr)
 {
+
     *optptr++ = DHCP_OPTION_END;
     return optptr;
 }
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
-void DhcpServer::create_msg(struct dhcps_msg* m)
+void DhcpServer::create_msg(struct dhcps_msg *m)
 {
     struct ipv4_addr client;
 
     client.addr = client_address.addr;
 
-    m->op    = DHCP_REPLY;
+    m->op = DHCP_REPLY;
     m->htype = DHCP_HTYPE_ETHERNET;
-    m->hlen  = 6;
-    m->hops  = 0;
-    m->secs  = 0;
+    m->hlen = 6;
+    m->hops = 0;
+    m->secs = 0;
     m->flags = htons(BOOTP_BROADCAST);
 
-    memcpy((char*)m->yiaddr, (char*)&client.addr, sizeof(m->yiaddr));
-    memset((char*)m->ciaddr, 0, sizeof(m->ciaddr));
-    memset((char*)m->siaddr, 0, sizeof(m->siaddr));
-    memset((char*)m->giaddr, 0, sizeof(m->giaddr));
-    memset((char*)m->sname, 0, sizeof(m->sname));
-    memset((char*)m->file, 0, sizeof(m->file));
-    memset((char*)m->options, 0, sizeof(m->options));
-    memcpy((char*)m->options, &magic_cookie, sizeof(magic_cookie));
+    memcpy((char *) m->yiaddr, (char *) &client.addr, sizeof(m->yiaddr));
+    memset((char *) m->ciaddr, 0, sizeof(m->ciaddr));
+    memset((char *) m->siaddr, 0, sizeof(m->siaddr));
+    memset((char *) m->giaddr, 0, sizeof(m->giaddr));
+    memset((char *) m->sname, 0, sizeof(m->sname));
+    memset((char *) m->file, 0, sizeof(m->file));
+    memset((char *) m->options, 0, sizeof(m->options));
+    memcpy((char *) m->options, &magic_cookie, sizeof(magic_cookie));
 }
 ///////////////////////////////////////////////////////////////////////////////////
 /*
@@ -526,13 +520,13 @@ void DhcpServer::create_msg(struct dhcps_msg* m)
     @param -- m DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-void DhcpServer::send_offer(struct dhcps_msg* m)
+void DhcpServer::send_offer(struct dhcps_msg *m)
 {
-    uint8_t*     end;
+    uint8_t *end;
     struct pbuf *p, *q;
-    u8_t*        data;
-    u16_t        cnt = 0;
-    u16_t        i;
+    u8_t *data;
+    u16_t cnt = 0;
+    u16_t i;
     create_msg(m);
 
     end = add_msg_type(&m->options[4], DHCPOFFER);
@@ -545,6 +539,7 @@ void DhcpServer::send_offer(struct dhcps_msg* m)
 #endif
     if (p != nullptr)
     {
+
 #if DHCPS_DEBUG
         os_printf("dhcps: send_offer>>pbuf_alloc succeed\n");
         os_printf("dhcps: send_offer>>p->tot_len = %d\n", p->tot_len);
@@ -553,10 +548,10 @@ void DhcpServer::send_offer(struct dhcps_msg* m)
         q = p;
         while (q != nullptr)
         {
-            data = (u8_t*)q->payload;
+            data = (u8_t *)q->payload;
             for (i = 0; i < q->len; i++)
             {
-                data[i] = ((u8_t*)m)[cnt++];
+                data[i] = ((u8_t *) m)[cnt++];
             }
 
             q = q->next;
@@ -564,6 +559,7 @@ void DhcpServer::send_offer(struct dhcps_msg* m)
     }
     else
     {
+
 #if DHCPS_DEBUG
         os_printf("dhcps: send_offer>>pbuf_alloc failed\n");
 #endif
@@ -590,13 +586,14 @@ void DhcpServer::send_offer(struct dhcps_msg* m)
     @param m DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-void DhcpServer::send_nak(struct dhcps_msg* m)
+void DhcpServer::send_nak(struct dhcps_msg *m)
 {
-    u8_t*        end;
+
+    u8_t *end;
     struct pbuf *p, *q;
-    u8_t*        data;
-    u16_t        cnt = 0;
-    u16_t        i;
+    u8_t *data;
+    u16_t cnt = 0;
+    u16_t i;
     create_msg(m);
 
     end = add_msg_type(&m->options[4], DHCPNAK);
@@ -608,6 +605,7 @@ void DhcpServer::send_nak(struct dhcps_msg* m)
 #endif
     if (p != nullptr)
     {
+
 #if DHCPS_DEBUG
         os_printf("dhcps: send_nak>>pbuf_alloc succeed\n");
         os_printf("dhcps: send_nak>>p->tot_len = %d\n", p->tot_len);
@@ -616,10 +614,10 @@ void DhcpServer::send_nak(struct dhcps_msg* m)
         q = p;
         while (q != nullptr)
         {
-            data = (u8_t*)q->payload;
+            data = (u8_t *)q->payload;
             for (i = 0; i < q->len; i++)
             {
-                data[i] = ((u8_t*)m)[cnt++];
+                data[i] = ((u8_t *) m)[cnt++];
             }
 
             q = q->next;
@@ -627,6 +625,7 @@ void DhcpServer::send_nak(struct dhcps_msg* m)
     }
     else
     {
+
 #if DHCPS_DEBUG
         os_printf("dhcps: send_nak>>pbuf_alloc failed\n");
 #endif
@@ -648,13 +647,14 @@ void DhcpServer::send_nak(struct dhcps_msg* m)
     @param m DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-void DhcpServer::send_ack(struct dhcps_msg* m)
+void DhcpServer::send_ack(struct dhcps_msg *m)
 {
-    u8_t*        end;
+
+    u8_t *end;
     struct pbuf *p, *q;
-    u8_t*        data;
-    u16_t        cnt = 0;
-    u16_t        i;
+    u8_t *data;
+    u16_t cnt = 0;
+    u16_t i;
     create_msg(m);
 
     end = add_msg_type(&m->options[4], DHCPACK);
@@ -667,6 +667,7 @@ void DhcpServer::send_ack(struct dhcps_msg* m)
 #endif
     if (p != nullptr)
     {
+
 #if DHCPS_DEBUG
         os_printf("dhcps: send_ack>>pbuf_alloc succeed\n");
         os_printf("dhcps: send_ack>>p->tot_len = %d\n", p->tot_len);
@@ -675,10 +676,10 @@ void DhcpServer::send_ack(struct dhcps_msg* m)
         q = p;
         while (q != nullptr)
         {
-            data = (u8_t*)q->payload;
+            data = (u8_t *)q->payload;
             for (i = 0; i < q->len; i++)
             {
-                data[i] = ((u8_t*)m)[cnt++];
+                data[i] = ((u8_t *) m)[cnt++];
             }
 
             q = q->next;
@@ -686,6 +687,7 @@ void DhcpServer::send_ack(struct dhcps_msg* m)
     }
     else
     {
+
 #if DHCPS_DEBUG
         os_printf("dhcps: send_ack>>pbuf_alloc failed\n");
 #endif
@@ -716,15 +718,15 @@ void DhcpServer::send_ack(struct dhcps_msg* m)
     @return uint8_t* DHCP Server
 */
 ///////////////////////////////////////////////////////////////////////////////////
-uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
+uint8_t DhcpServer::parse_options(uint8_t *optptr, sint16_t len)
 {
-    struct ipv4_addr   client;
-    bool               is_dhcp_parse_end = false;
+    struct ipv4_addr client;
+    bool is_dhcp_parse_end = false;
     struct dhcps_state s;
 
     client.addr = client_address.addr;
 
-    u8_t* end  = optptr + len;
+    u8_t *end = optptr + len;
     u16_t type = 0;
 
     s.state = DHCPS_STATE_IDLE;
@@ -734,15 +736,16 @@ uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
 #if DHCPS_DEBUG
         os_printf("dhcps: (sint16_t)*optptr = %d\n", (sint16_t)*optptr);
 #endif
-        switch ((sint16_t)*optptr)
+        switch ((sint16_t) *optptr)
         {
+
         case DHCP_OPTION_MSG_TYPE:  //53
             type = *(optptr + 2);
             break;
 
-        case DHCP_OPTION_REQ_IPADDR:  //50
+        case DHCP_OPTION_REQ_IPADDR://50
             //os_printf("dhcps:0x%08x,0x%08x\n",client.addr,*(uint32*)(optptr+2));
-            if (memcmp((char*)&client.addr, (char*)optptr + 2, 4) == 0)
+            if (memcmp((char *) &client.addr, (char *) optptr + 2, 4) == 0)
             {
 #if DHCPS_DEBUG
                 os_printf("dhcps: DHCP_OPTION_REQ_IPADDR = 0 ok\n");
@@ -774,14 +777,14 @@ uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
 
     switch (type)
     {
-    case DHCPDISCOVER:  //1
+    case DHCPDISCOVER://1
         s.state = DHCPS_STATE_OFFER;
 #if DHCPS_DEBUG
         os_printf("dhcps: DHCPD_STATE_OFFER\n");
 #endif
         break;
 
-    case DHCPREQUEST:  //3
+    case DHCPREQUEST://3
         if (!(s.state == DHCPS_STATE_ACK || s.state == DHCPS_STATE_NAK))
         {
             if (renew == true)
@@ -798,14 +801,14 @@ uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
         }
         break;
 
-    case DHCPDECLINE:  //4
+    case DHCPDECLINE://4
         s.state = DHCPS_STATE_IDLE;
 #if DHCPS_DEBUG
         os_printf("dhcps: DHCPD_STATE_IDLE\n");
 #endif
         break;
 
-    case DHCPRELEASE:  //7
+    case DHCPRELEASE://7
         s.state = DHCPS_STATE_RELEASE;
 #if DHCPS_DEBUG
         os_printf("dhcps: DHCPD_STATE_IDLE\n");
@@ -819,12 +822,11 @@ uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
 }
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
-sint16_t DhcpServer::parse_msg(struct dhcps_msg* m, u16_t len)
+sint16_t DhcpServer::parse_msg(struct dhcps_msg *m, u16_t len)
 {
-    if (memcmp((char*)m->options,
+    if (memcmp((char *)m->options,
                &magic_cookie,
-               sizeof(magic_cookie))
-        == 0)
+               sizeof(magic_cookie)) == 0)
     {
         struct ipv4_addr ip;
         memcpy(&ip.addr, m->ciaddr, sizeof(ip.addr));
@@ -834,7 +836,7 @@ sint16_t DhcpServer::parse_msg(struct dhcps_msg* m, u16_t len)
 
         if (ret == DHCPS_STATE_RELEASE)
         {
-            dhcps_client_leave(m->chaddr, &ip, true);  // force to delete
+            dhcps_client_leave(m->chaddr, &ip, true); // force to delete
             client_address.addr = ip.addr;
         }
 
@@ -855,32 +857,32 @@ sint16_t DhcpServer::parse_msg(struct dhcps_msg* m, u16_t len)
 */
 ///////////////////////////////////////////////////////////////////////////////////
 
-void DhcpServer::S_handle_dhcp(void*            arg,
-                               struct udp_pcb*  pcb,
-                               struct pbuf*     p,
-                               const ip_addr_t* addr,
-                               uint16_t         port)
+void DhcpServer::S_handle_dhcp(void *arg,
+                               struct udp_pcb *pcb,
+                               struct pbuf *p,
+                               const ip_addr_t *addr,
+                               uint16_t port)
 {
     DhcpServer* instance = reinterpret_cast<DhcpServer*>(arg);
     instance->handle_dhcp(pcb, p, addr, port);
 }
 
 void DhcpServer::handle_dhcp(
-    struct udp_pcb*  pcb,
-    struct pbuf*     p,
-    const ip_addr_t* addr,
-    uint16_t         port)
+    struct udp_pcb *pcb,
+    struct pbuf *p,
+    const ip_addr_t *addr,
+    uint16_t port)
 {
     (void)pcb;
     (void)addr;
     (void)port;
 
-    struct dhcps_msg* pmsg_dhcps    = nullptr;
-    sint16_t          tlen          = 0;
-    u16_t             i             = 0;
-    u16_t             dhcps_msg_cnt = 0;
-    u8_t*             p_dhcps_msg   = nullptr;
-    u8_t*             data          = nullptr;
+    struct dhcps_msg *pmsg_dhcps = nullptr;
+    sint16_t tlen = 0;
+    u16_t i = 0;
+    u16_t dhcps_msg_cnt = 0;
+    u8_t *p_dhcps_msg = nullptr;
+    u8_t *data = nullptr;
 
 #if DHCPS_DEBUG
     os_printf("dhcps: handle_dhcp-> receive a packet\n");
@@ -890,15 +892,15 @@ void DhcpServer::handle_dhcp(
         return;
     }
 
-    pmsg_dhcps = (struct dhcps_msg*)zalloc(sizeof(struct dhcps_msg));
+    pmsg_dhcps = (struct dhcps_msg *)zalloc(sizeof(struct dhcps_msg));
     if (nullptr == pmsg_dhcps)
     {
         pbuf_free(p);
         return;
     }
-    p_dhcps_msg = (u8_t*)pmsg_dhcps;
-    tlen        = p->tot_len;
-    data        = (u8_t*)p->payload;
+    p_dhcps_msg = (u8_t *)pmsg_dhcps;
+    tlen = p->tot_len;
+    data = (u8_t*)p->payload;
 
 #if DHCPS_DEBUG
     os_printf("dhcps: handle_dhcp-> p->tot_len = %d\n", tlen);
@@ -931,13 +933,14 @@ void DhcpServer::handle_dhcp(
 
     switch (parse_msg(pmsg_dhcps, tlen - 240))
     {
-    case DHCPS_STATE_OFFER:  //1
+
+    case DHCPS_STATE_OFFER://1
 #if DHCPS_DEBUG
         os_printf("dhcps: handle_dhcp-> DHCPD_STATE_OFFER\n");
 #endif
         send_offer(pmsg_dhcps);
         break;
-    case DHCPS_STATE_ACK:  //3
+    case DHCPS_STATE_ACK://3
 #if DHCPS_DEBUG
         os_printf("dhcps: handle_dhcp-> DHCPD_STATE_ACK\n");
 #endif
@@ -947,13 +950,13 @@ void DhcpServer::handle_dhcp(
             wifi_softap_set_station_info(pmsg_dhcps->chaddr, &client_address);
         }
         break;
-    case DHCPS_STATE_NAK:  //4
+    case DHCPS_STATE_NAK://4
 #if DHCPS_DEBUG
         os_printf("dhcps: handle_dhcp-> DHCPD_STATE_NAK\n");
 #endif
         send_nak(pmsg_dhcps);
         break;
-    default:
+    default :
         break;
     }
 #if DHCPS_DEBUG
@@ -968,12 +971,12 @@ void DhcpServer::init_dhcps_lease(uint32 ip)
 {
     uint32 softap_ip = 0, local_ip = 0;
     uint32 start_ip = 0;
-    uint32 end_ip   = 0;
+    uint32 end_ip = 0;
     if (dhcps_lease.enable == true)
     {
         softap_ip = htonl(ip);
-        start_ip  = htonl(dhcps_lease.start_ip.addr);
-        end_ip    = htonl(dhcps_lease.end_ip.addr);
+        start_ip = htonl(dhcps_lease.start_ip.addr);
+        end_ip = htonl(dhcps_lease.end_ip.addr);
         /*config ip information can't contain local ip*/
         if ((start_ip <= softap_ip) && (softap_ip <= end_ip))
         {
@@ -984,7 +987,7 @@ void DhcpServer::init_dhcps_lease(uint32 ip)
             /*config ip information must be in the same segment as the local ip*/
             softap_ip >>= 8;
             if (((start_ip >> 8 != softap_ip) || (end_ip >> 8 != softap_ip))
-                || (end_ip - start_ip > DHCPS_MAX_LEASE))
+                    || (end_ip - start_ip > DHCPS_MAX_LEASE))
             {
                 dhcps_lease.enable = false;
             }
@@ -1002,14 +1005,14 @@ void DhcpServer::init_dhcps_lease(uint32 ip)
         }
         else
         {
-            local_ip++;
+            local_ip ++;
         }
 
         bzero(&dhcps_lease, sizeof(dhcps_lease));
         dhcps_lease.start_ip.addr = softap_ip | local_ip;
-        dhcps_lease.end_ip.addr   = softap_ip | (local_ip + DHCPS_MAX_LEASE - 1);
+        dhcps_lease.end_ip.addr = softap_ip | (local_ip + DHCPS_MAX_LEASE - 1);
         dhcps_lease.start_ip.addr = htonl(dhcps_lease.start_ip.addr);
-        dhcps_lease.end_ip.addr   = htonl(dhcps_lease.end_ip.addr);
+        dhcps_lease.end_ip.addr = htonl(dhcps_lease.end_ip.addr);
     }
     //  dhcps_lease.start_ip.addr = htonl(dhcps_lease.start_ip.addr);
     //  dhcps_lease.end_ip.addr= htonl(dhcps_lease.end_ip.addr);
@@ -1017,7 +1020,7 @@ void DhcpServer::init_dhcps_lease(uint32 ip)
 }
 ///////////////////////////////////////////////////////////////////////////////////
 
-bool DhcpServer::begin(struct ip_info* info)
+bool DhcpServer::begin(struct ip_info *info)
 {
     if (pcb_dhcps != nullptr)
     {
@@ -1050,9 +1053,9 @@ bool DhcpServer::begin(struct ip_info* info)
 
     if (_netif->num == SOFTAP_IF)
     {
-        wifi_set_ip_info(SOFTAP_IF, info);  // added for lwip-git, not sure whether useful
+        wifi_set_ip_info(SOFTAP_IF, info);    // added for lwip-git, not sure whether useful
     }
-    _netif->flags |= NETIF_FLAG_UP | NETIF_FLAG_LINK_UP;  // added for lwip-git
+    _netif->flags |= NETIF_FLAG_UP | NETIF_FLAG_LINK_UP; // added for lwip-git
 
     return true;
 }
@@ -1074,17 +1077,17 @@ void DhcpServer::end()
     pcb_dhcps = nullptr;
 
     //udp_remove(pcb_dhcps);
-    list_node*         pnode      = nullptr;
-    list_node*         pback_node = nullptr;
-    struct dhcps_pool* dhcp_node  = nullptr;
-    struct ipv4_addr   ip_zero;
+    list_node *pnode = nullptr;
+    list_node *pback_node = nullptr;
+    struct dhcps_pool* dhcp_node = nullptr;
+    struct ipv4_addr ip_zero;
 
     memset(&ip_zero, 0x0, sizeof(ip_zero));
     pnode = plist;
     while (pnode != nullptr)
     {
         pback_node = pnode;
-        pnode      = pback_node->pnext;
+        pnode = pback_node->pnext;
         node_remove_from_list(&plist, pback_node);
         dhcp_node = (struct dhcps_pool*)pback_node->pnode;
         //dhcps_client_leave(dhcp_node->mac,&dhcp_node->ip,true); // force to delete
@@ -1104,6 +1107,7 @@ bool DhcpServer::isRunning()
     return !!_netif->state;
 }
 
+
 /******************************************************************************
     FunctionName : set_dhcps_lease
     Description  : set the lease information of DHCP server
@@ -1111,11 +1115,11 @@ bool DhcpServer::isRunning()
                             Little-Endian.
     Returns      : true or false
 *******************************************************************************/
-bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
+bool DhcpServer::set_dhcps_lease(struct dhcps_lease *please)
 {
     uint32 softap_ip = 0;
-    uint32 start_ip  = 0;
-    uint32 end_ip    = 0;
+    uint32 start_ip = 0;
+    uint32 end_ip = 0;
 
     if (_netif->num == SOFTAP_IF || _netif->num == STATION_IF)
     {
@@ -1137,8 +1141,8 @@ bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
         // - is wrong
         // - limited to /24 address plans
         softap_ip = htonl(ip_2_ip4(&_netif->ip_addr)->addr);
-        start_ip  = htonl(please->start_ip.addr);
-        end_ip    = htonl(please->end_ip.addr);
+        start_ip = htonl(please->start_ip.addr);
+        end_ip = htonl(please->end_ip.addr);
         /*config ip information can't contain local ip*/
         if ((start_ip <= softap_ip) && (softap_ip <= end_ip))
         {
@@ -1148,7 +1152,7 @@ bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
         /*config ip information must be in the same segment as the local ip*/
         softap_ip >>= 8;
         if ((start_ip >> 8 != softap_ip)
-            || (end_ip >> 8 != softap_ip))
+                || (end_ip >> 8 != softap_ip))
         {
             return false;
         }
@@ -1162,7 +1166,7 @@ bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
         //      dhcps_lease.start_ip.addr = start_ip;
         //      dhcps_lease.end_ip.addr = end_ip;
         dhcps_lease.start_ip.addr = please->start_ip.addr;
-        dhcps_lease.end_ip.addr   = please->end_ip.addr;
+        dhcps_lease.end_ip.addr = please->end_ip.addr;
     }
     dhcps_lease.enable = please->enable;
     //  dhcps_lease_flag = false;
@@ -1176,7 +1180,7 @@ bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
                             Little-Endian.
     Returns      : true or false
 *******************************************************************************/
-bool DhcpServer::get_dhcps_lease(struct dhcps_lease* please)
+bool DhcpServer::get_dhcps_lease(struct dhcps_lease *please)
 {
     if (_netif->num == SOFTAP_IF)
     {
@@ -1215,33 +1219,32 @@ bool DhcpServer::get_dhcps_lease(struct dhcps_lease* please)
     //      please->end_ip.addr = dhcps_lease.end_ip.addr;
     //  }
     please->start_ip.addr = dhcps_lease.start_ip.addr;
-    please->end_ip.addr   = dhcps_lease.end_ip.addr;
+    please->end_ip.addr = dhcps_lease.end_ip.addr;
     return true;
 }
 
 void DhcpServer::kill_oldest_dhcps_pool(void)
 {
-    list_node *        pre = nullptr, *p = nullptr;
-    list_node *        minpre = nullptr, *minp = nullptr;
+    list_node *pre = nullptr, *p = nullptr;
+    list_node *minpre = nullptr, *minp = nullptr;
     struct dhcps_pool *pdhcps_pool = nullptr, *pmin_pool = nullptr;
-    pre    = plist;
-    p      = pre->pnext;
+    pre = plist;
+    p = pre->pnext;
     minpre = pre;
-    minp   = p;
+    minp = p;
     while (p != nullptr)
     {
         pdhcps_pool = (struct dhcps_pool*)p->pnode;
-        pmin_pool   = (struct dhcps_pool*)minp->pnode;
+        pmin_pool = (struct dhcps_pool*)minp->pnode;
         if (pdhcps_pool->lease_timer < pmin_pool->lease_timer)
         {
-            minp   = p;
+            minp = p;
             minpre = pre;
         }
         pre = p;
-        p   = p->pnext;
+        p = p->pnext;
     }
-    minpre->pnext      = minp->pnext;
-    pdhcps_pool->state = DHCPS_STATE_OFFLINE;
+    minpre->pnext = minp->pnext; pdhcps_pool->state = DHCPS_STATE_OFFLINE;
     free(minp->pnode);
     minp->pnode = nullptr;
     free(minp);
@@ -1250,22 +1253,22 @@ void DhcpServer::kill_oldest_dhcps_pool(void)
 
 void DhcpServer::dhcps_coarse_tmr(void)
 {
-    uint8              num_dhcps_pool = 0;
-    list_node*         pback_node     = nullptr;
-    list_node*         pnode          = nullptr;
-    struct dhcps_pool* pdhcps_pool    = nullptr;
-    pnode                             = plist;
+    uint8 num_dhcps_pool = 0;
+    list_node *pback_node = nullptr;
+    list_node *pnode = nullptr;
+    struct dhcps_pool *pdhcps_pool = nullptr;
+    pnode = plist;
     while (pnode != nullptr)
     {
         pdhcps_pool = (struct dhcps_pool*)pnode->pnode;
         if (pdhcps_pool->type == DHCPS_TYPE_DYNAMIC)
         {
-            pdhcps_pool->lease_timer--;
+            pdhcps_pool->lease_timer --;
         }
         if (pdhcps_pool->lease_timer == 0)
         {
             pback_node = pnode;
-            pnode      = pback_node->pnext;
+            pnode = pback_node->pnext;
             node_remove_from_list(&plist, pback_node);
             free(pback_node->pnode);
             pback_node->pnode = nullptr;
@@ -1274,8 +1277,8 @@ void DhcpServer::dhcps_coarse_tmr(void)
         }
         else
         {
-            pnode = pnode->pnext;
-            num_dhcps_pool++;
+            pnode = pnode ->pnext;
+            num_dhcps_pool ++;
         }
     }
 
@@ -1302,10 +1305,10 @@ bool DhcpServer::set_dhcps_offer_option(uint8 level, void* optarg)
     switch (level)
     {
     case OFFER_ROUTER:
-        offer      = (*(uint8*)optarg) & 0x01;
+        offer = (*(uint8 *)optarg) & 0x01;
         offer_flag = true;
         break;
-    default:
+    default :
         offer_flag = false;
         break;
     }
@@ -1355,15 +1358,15 @@ bool DhcpServer::reset_dhcps_lease_time(void)
     return true;
 }
 
-uint32 DhcpServer::get_dhcps_lease_time(void)  // minute
+uint32 DhcpServer::get_dhcps_lease_time(void) // minute
 {
     return dhcps_lease_time;
 }
 
-void DhcpServer::dhcps_client_leave(u8* bssid, struct ipv4_addr* ip, bool force)
+void DhcpServer::dhcps_client_leave(u8 *bssid, struct ipv4_addr *ip, bool force)
 {
-    struct dhcps_pool* pdhcps_pool = nullptr;
-    list_node*         pback_node  = nullptr;
+    struct dhcps_pool *pdhcps_pool = nullptr;
+    list_node *pback_node = nullptr;
 
     if ((bssid == nullptr) || (ip == nullptr))
     {
@@ -1409,16 +1412,16 @@ void DhcpServer::dhcps_client_leave(u8* bssid, struct ipv4_addr* ip, bool force)
     }
 }
 
-uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
+uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
 {
-    struct dhcps_pool* pdhcps_pool = nullptr;
-    list_node*         pback_node  = nullptr;
-    list_node*         pmac_node   = nullptr;
-    list_node*         pip_node    = nullptr;
-    bool               flag        = false;
-    uint32             start_ip    = dhcps_lease.start_ip.addr;
-    uint32             end_ip      = dhcps_lease.end_ip.addr;
-    dhcps_type_t       type        = DHCPS_TYPE_DYNAMIC;
+    struct dhcps_pool *pdhcps_pool = nullptr;
+    list_node *pback_node = nullptr;
+    list_node *pmac_node = nullptr;
+    list_node *pip_node = nullptr;
+    bool flag = false;
+    uint32 start_ip = dhcps_lease.start_ip.addr;
+    uint32 end_ip = dhcps_lease.end_ip.addr;
+    dhcps_type_t type = DHCPS_TYPE_DYNAMIC;
     if (bssid == nullptr)
     {
         return IPADDR_ANY;
@@ -1498,7 +1501,7 @@ uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
         }
     }
 
-    if (pmac_node != nullptr)  // update new ip
+    if (pmac_node != nullptr)   // update new ip
     {
         if (pip_node != nullptr)
         {
@@ -1522,12 +1525,13 @@ uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
             else
             {
                 renew = true;
-                type  = DHCPS_TYPE_DYNAMIC;
+                type = DHCPS_TYPE_DYNAMIC;
             }
 
             pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-            pdhcps_pool->type        = type;
-            pdhcps_pool->state       = DHCPS_STATE_ONLINE;
+            pdhcps_pool->type = type;
+            pdhcps_pool->state = DHCPS_STATE_ONLINE;
+
         }
         else
         {
@@ -1540,21 +1544,21 @@ uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
             {
                 pdhcps_pool->ip.addr = start_ip;
             }
-            else  // no ip to distribute
+            else        // no ip to distribute
             {
                 return IPADDR_ANY;
             }
 
             node_remove_from_list(&plist, pmac_node);
             pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-            pdhcps_pool->type        = type;
-            pdhcps_pool->state       = DHCPS_STATE_ONLINE;
+            pdhcps_pool->type = type;
+            pdhcps_pool->state = DHCPS_STATE_ONLINE;
             node_insert_to_list(&plist, pmac_node);
         }
     }
-    else  // new station
+    else     // new station
     {
-        if (pip_node != nullptr)  // maybe ip has used
+        if (pip_node != nullptr)   // maybe ip has used
         {
             pdhcps_pool = (struct dhcps_pool*)pip_node->pnode;
             if (pdhcps_pool->state != DHCPS_STATE_OFFLINE)
@@ -1563,12 +1567,12 @@ uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
             }
             memcpy(pdhcps_pool->mac, bssid, sizeof(pdhcps_pool->mac));
             pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-            pdhcps_pool->type        = type;
-            pdhcps_pool->state       = DHCPS_STATE_ONLINE;
+            pdhcps_pool->type = type;
+            pdhcps_pool->state = DHCPS_STATE_ONLINE;
         }
         else
         {
-            pdhcps_pool = (struct dhcps_pool*)zalloc(sizeof(struct dhcps_pool));
+            pdhcps_pool = (struct dhcps_pool *)zalloc(sizeof(struct dhcps_pool));
             if (ip != nullptr)
             {
                 pdhcps_pool->ip.addr = ip->addr;
@@ -1577,7 +1581,7 @@ uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
             {
                 pdhcps_pool->ip.addr = start_ip;
             }
-            else  // no ip to distribute
+            else        // no ip to distribute
             {
                 free(pdhcps_pool);
                 return IPADDR_ANY;
@@ -1589,11 +1593,11 @@ uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
             }
             memcpy(pdhcps_pool->mac, bssid, sizeof(pdhcps_pool->mac));
             pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-            pdhcps_pool->type        = type;
-            pdhcps_pool->state       = DHCPS_STATE_ONLINE;
-            pback_node               = (list_node*)zalloc(sizeof(list_node));
-            pback_node->pnode        = pdhcps_pool;
-            pback_node->pnext        = nullptr;
+            pdhcps_pool->type = type;
+            pdhcps_pool->state = DHCPS_STATE_ONLINE;
+            pback_node = (list_node *)zalloc(sizeof(list_node));
+            pback_node->pnode = pdhcps_pool;
+            pback_node->pnext = nullptr;
             node_insert_to_list(&plist, pback_node);
         }
     }
diff --git a/cores/esp8266/LwipDhcpServer.h b/cores/esp8266/LwipDhcpServer.h
index 821c3a68bd..e93166981d 100644
--- a/cores/esp8266/LwipDhcpServer.h
+++ b/cores/esp8266/LwipDhcpServer.h
@@ -31,11 +31,12 @@
 #ifndef __DHCPS_H__
 #define __DHCPS_H__
 
-#include <lwip/init.h>  // LWIP_VERSION
+#include <lwip/init.h> // LWIP_VERSION
 
 class DhcpServer
 {
 public:
+
     DhcpServer(netif* netif);
     ~DhcpServer();
 
@@ -52,71 +53,72 @@ class DhcpServer
 
     // legacy public C structure and API to eventually turn into C++
 
-    void   init_dhcps_lease(uint32 ip);
-    bool   set_dhcps_lease(struct dhcps_lease* please);
-    bool   get_dhcps_lease(struct dhcps_lease* please);
-    bool   set_dhcps_offer_option(uint8 level, void* optarg);
-    bool   set_dhcps_lease_time(uint32 minute);
-    bool   reset_dhcps_lease_time(void);
+    void init_dhcps_lease(uint32 ip);
+    bool set_dhcps_lease(struct dhcps_lease *please);
+    bool get_dhcps_lease(struct dhcps_lease *please);
+    bool set_dhcps_offer_option(uint8 level, void* optarg);
+    bool set_dhcps_lease_time(uint32 minute);
+    bool reset_dhcps_lease_time(void);
     uint32 get_dhcps_lease_time(void);
-    bool   add_dhcps_lease(uint8* macaddr);
+    bool add_dhcps_lease(uint8 *macaddr);
 
     void dhcps_set_dns(int num, const ipv4_addr_t* dns);
 
 protected:
+
     // legacy C structure and API to eventually turn into C++
 
     typedef struct _list_node
     {
-        void*              pnode;
-        struct _list_node* pnext;
+        void *pnode;
+        struct _list_node *pnext;
     } list_node;
 
-    void        node_insert_to_list(list_node** phead, list_node* pinsert);
-    void        node_remove_from_list(list_node** phead, list_node* pdelete);
-    uint8_t*    add_msg_type(uint8_t* optptr, uint8_t type);
-    uint8_t*    add_offer_options(uint8_t* optptr);
-    uint8_t*    add_end(uint8_t* optptr);
-    void        create_msg(struct dhcps_msg* m);
-    void        send_offer(struct dhcps_msg* m);
-    void        send_nak(struct dhcps_msg* m);
-    void        send_ack(struct dhcps_msg* m);
-    uint8_t     parse_options(uint8_t* optptr, sint16_t len);
-    sint16_t    parse_msg(struct dhcps_msg* m, u16_t len);
-    static void S_handle_dhcp(void*            arg,
-                              struct udp_pcb*  pcb,
-                              struct pbuf*     p,
-                              const ip_addr_t* addr,
-                              uint16_t         port);
-    void        handle_dhcp(
-               struct udp_pcb*  pcb,
-               struct pbuf*     p,
-               const ip_addr_t* addr,
-               uint16_t         port);
-    void   kill_oldest_dhcps_pool(void);
-    void   dhcps_coarse_tmr(void);  // CURRENTLY NOT CALLED
-    void   dhcps_client_leave(u8* bssid, struct ipv4_addr* ip, bool force);
-    uint32 dhcps_client_update(u8* bssid, struct ipv4_addr* ip);
+    void node_insert_to_list(list_node **phead, list_node* pinsert);
+    void node_remove_from_list(list_node **phead, list_node* pdelete);
+    uint8_t* add_msg_type(uint8_t *optptr, uint8_t type);
+    uint8_t* add_offer_options(uint8_t *optptr);
+    uint8_t* add_end(uint8_t *optptr);
+    void create_msg(struct dhcps_msg *m);
+    void send_offer(struct dhcps_msg *m);
+    void send_nak(struct dhcps_msg *m);
+    void send_ack(struct dhcps_msg *m);
+    uint8_t parse_options(uint8_t *optptr, sint16_t len);
+    sint16_t parse_msg(struct dhcps_msg *m, u16_t len);
+    static void S_handle_dhcp(void *arg,
+                              struct udp_pcb *pcb,
+                              struct pbuf *p,
+                              const ip_addr_t *addr,
+                              uint16_t port);
+    void handle_dhcp(
+        struct udp_pcb *pcb,
+        struct pbuf *p,
+        const ip_addr_t *addr,
+        uint16_t port);
+    void kill_oldest_dhcps_pool(void);
+    void dhcps_coarse_tmr(void); // CURRENTLY NOT CALLED
+    void dhcps_client_leave(u8 *bssid, struct ipv4_addr *ip, bool force);
+    uint32 dhcps_client_update(u8 *bssid, struct ipv4_addr *ip);
 
     netif* _netif;
 
-    struct udp_pcb*  pcb_dhcps;
-    ip_addr_t        broadcast_dhcps;
+    struct udp_pcb *pcb_dhcps;
+    ip_addr_t broadcast_dhcps;
     struct ipv4_addr server_address;
     struct ipv4_addr client_address;
     struct ipv4_addr dns_address;
-    uint32           dhcps_lease_time;
+    uint32 dhcps_lease_time;
 
     struct dhcps_lease dhcps_lease;
-    list_node*         plist;
-    uint8              offer;
-    bool               renew;
+    list_node *plist;
+    uint8 offer;
+    bool renew;
 
     static const uint32 magic_cookie;
 };
 
 // SoftAP DHCP server always exists and is started on boot
 extern DhcpServer dhcpSoftAP;
-extern "C" int    fw_has_started_softap_dhcps;
+extern "C" int fw_has_started_softap_dhcps;
 
-#endif  // __DHCPS_H__
+#endif // __DHCPS_H__
diff --git a/cores/esp8266/LwipIntf.cpp b/cores/esp8266/LwipIntf.cpp
index b4ae7e06e9..b4a4807b9a 100644
--- a/cores/esp8266/LwipIntf.cpp
+++ b/cores/esp8266/LwipIntf.cpp
@@ -1,13 +1,12 @@
 
-extern "C"
-{
+extern "C" {
 #include "lwip/err.h"
 #include "lwip/ip_addr.h"
 #include "lwip/dns.h"
 #include "lwip/dhcp.h"
-#include "lwip/init.h"  // LWIP_VERSION_
+#include "lwip/init.h" // LWIP_VERSION_
 #if LWIP_IPV6
-#include "lwip/netif.h"  // struct netif
+#include "lwip/netif.h" // struct netif
 #endif
 
 #include <user_interface.h>
@@ -31,14 +30,14 @@ bool LwipIntf::ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1
     //To allow compatibility, check first octet of 3rd arg. If 255, interpret as ESP order, otherwise Arduino order.
     gateway = arg1;
     netmask = arg2;
-    dns1    = arg3;
+    dns1 = arg3;
 
     if (netmask[0] != 255)
     {
         //octet is not 255 => interpret as Arduino order
         gateway = arg2;
-        netmask = arg3[0] == 0 ? IPAddress(255, 255, 255, 0) : arg3;  //arg order is arduino and 4th arg not given => assign it arduino default
-        dns1    = arg1;
+        netmask = arg3[0] == 0 ? IPAddress(255, 255, 255, 0) : arg3; //arg order is arduino and 4th arg not given => assign it arduino default
+        dns1 = arg1;
     }
 
     // check whether all is IPv4 (or gateway not set)
@@ -144,6 +143,7 @@ bool LwipIntf::hostname(const char* aHostname)
     // harmless for AP, also compatible with ethernet adapters (to come)
     for (netif* intf = netif_list; intf; intf = intf->next)
     {
+
         // unconditionally update all known interfaces
         intf->hostname = wifi_station_get_hostname();
 
@@ -162,3 +162,4 @@ bool LwipIntf::hostname(const char* aHostname)
 
     return ret && compliant;
 }
+
diff --git a/cores/esp8266/LwipIntf.h b/cores/esp8266/LwipIntf.h
index 386906b0a1..d73c2d825a 100644
--- a/cores/esp8266/LwipIntf.h
+++ b/cores/esp8266/LwipIntf.h
@@ -10,7 +10,8 @@
 class LwipIntf
 {
 public:
-    using CBType = std::function<void(netif*)>;
+
+    using CBType = std::function <void(netif*)>;
 
     static bool stateUpCB(LwipIntf::CBType&& cb);
 
@@ -23,11 +24,12 @@ class LwipIntf
     // arg3     | dns1       netmask
     //
     // result stored into gateway/netmask/dns1
-    static bool ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3,
-                                 IPAddress& gateway, IPAddress& netmask, IPAddress& dns1);
+    static
+    bool ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3,
+                          IPAddress& gateway, IPAddress& netmask, IPAddress& dns1);
 
     String hostname();
-    bool   hostname(const String& aHostname)
+    bool hostname(const String& aHostname)
     {
         return hostname(aHostname.c_str());
     }
@@ -40,7 +42,8 @@ class LwipIntf
     const char* getHostname();
 
 protected:
+
     static bool stateChangeSysCB(LwipIntf::CBType&& cb);
 };
 
-#endif  // _LWIPINTF_H
+#endif // _LWIPINTF_H
diff --git a/cores/esp8266/LwipIntfCB.cpp b/cores/esp8266/LwipIntfCB.cpp
index b79c6323fb..1e495c5fd3 100644
--- a/cores/esp8266/LwipIntfCB.cpp
+++ b/cores/esp8266/LwipIntfCB.cpp
@@ -5,8 +5,8 @@
 
 #define NETIF_STATUS_CB_SIZE 3
 
-static int       netifStatusChangeListLength = 0;
-LwipIntf::CBType netifStatusChangeList[NETIF_STATUS_CB_SIZE];
+static int netifStatusChangeListLength = 0;
+LwipIntf::CBType netifStatusChangeList [NETIF_STATUS_CB_SIZE];
 
 extern "C" void netif_status_changed(struct netif* netif)
 {
@@ -33,10 +33,12 @@ bool LwipIntf::stateChangeSysCB(LwipIntf::CBType&& cb)
 
 bool LwipIntf::stateUpCB(LwipIntf::CBType&& cb)
 {
-    return stateChangeSysCB([cb](netif* nif)
-                            {
-                                if (netif_is_up(nif))
-                                    schedule_function([cb, nif]()
-                                                      { cb(nif); });
-                            });
+    return stateChangeSysCB([cb](netif * nif)
+    {
+        if (netif_is_up(nif))
+            schedule_function([cb, nif]()
+        {
+            cb(nif);
+        });
+    });
 }
diff --git a/cores/esp8266/LwipIntfDev.h b/cores/esp8266/LwipIntfDev.h
index 08a2713ca0..f8290d7cd6 100644
--- a/cores/esp8266/LwipIntfDev.h
+++ b/cores/esp8266/LwipIntfDev.h
@@ -14,7 +14,7 @@
 #include <lwip/dns.h>
 #include <lwip/apps/sntp.h>
 
-#include <user_interface.h>  // wifi_get_macaddr()
+#include <user_interface.h>	// wifi_get_macaddr()
 
 #include "SPI.h"
 #include "Schedule.h"
@@ -26,10 +26,12 @@
 #endif
 
 template <class RawDev>
-class LwipIntfDev : public LwipIntf, public RawDev
+class LwipIntfDev: public LwipIntf, public RawDev
 {
+
 public:
-    LwipIntfDev(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1) :
+
+    LwipIntfDev(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1):
         RawDev(cs, spi, intr),
         _mtu(DEFAULT_MTU),
         _intrPin(intr),
@@ -42,22 +44,22 @@ class LwipIntfDev : public LwipIntf, public RawDev
     boolean config(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3 = IPADDR_NONE, const IPAddress& dns2 = IPADDR_NONE);
 
     // default mac-address is inferred from esp8266's STA interface
-    boolean begin(const uint8_t* macAddress = nullptr, const uint16_t mtu = DEFAULT_MTU);
+    boolean begin(const uint8_t *macAddress = nullptr, const uint16_t mtu = DEFAULT_MTU);
 
     const netif* getNetIf() const
     {
         return &_netif;
     }
 
-    IPAddress localIP() const
+    IPAddress    localIP() const
     {
         return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.ip_addr)));
     }
-    IPAddress subnetMask() const
+    IPAddress    subnetMask() const
     {
         return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.netmask)));
     }
-    IPAddress gatewayIP() const
+    IPAddress    gatewayIP() const
     {
         return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.gw)));
     }
@@ -75,11 +77,12 @@ class LwipIntfDev : public LwipIntf, public RawDev
     wl_status_t status();
 
 protected:
+
     err_t netif_init();
     void  netif_status_callback();
 
     static err_t netif_init_s(netif* netif);
-    static err_t linkoutput_s(netif* netif, struct pbuf* p);
+    static err_t linkoutput_s(netif *netif, struct pbuf *p);
     static void  netif_status_callback_s(netif* netif);
 
     // called on a regular basis or on interrupt
@@ -87,13 +90,14 @@ class LwipIntfDev : public LwipIntf, public RawDev
 
     // members
 
-    netif _netif;
+    netif       _netif;
+
+    uint16_t    _mtu;
+    int8_t      _intrPin;
+    uint8_t     _macAddress[6];
+    bool        _started;
+    bool        _default;
 
-    uint16_t _mtu;
-    int8_t   _intrPin;
-    uint8_t  _macAddress[6];
-    bool     _started;
-    bool     _default;
 };
 
 template <class RawDev>
@@ -158,9 +162,9 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
         memset(_macAddress, 0, 6);
         _macAddress[0] = 0xEE;
 #endif
-        _macAddress[3] += _netif.num;  // alter base mac address
-        _macAddress[0] &= 0xfe;        // set as locally administered, unicast, per
-        _macAddress[0] |= 0x02;        // https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local
+        _macAddress[3] += _netif.num;   // alter base mac address
+        _macAddress[0] &= 0xfe;         // set as locally administered, unicast, per
+        _macAddress[0] |= 0x02;         // https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local
     }
 
     if (!RawDev::begin(_macAddress))
@@ -218,11 +222,10 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
     }
 
     if (_intrPin < 0 && !schedule_recurrent_function_us([&]()
-                                                        {
-                                                            this->handlePackets();
-                                                            return true;
-                                                        },
-                                                        100))
+{
+    this->handlePackets();
+        return true;
+    }, 100))
     {
         netif_remove(&_netif);
         return false;
@@ -238,7 +241,7 @@ wl_status_t LwipIntfDev<RawDev>::status()
 }
 
 template <class RawDev>
-err_t LwipIntfDev<RawDev>::linkoutput_s(netif* netif, struct pbuf* pbuf)
+err_t LwipIntfDev<RawDev>::linkoutput_s(netif *netif, struct pbuf *pbuf)
 {
     LwipIntfDev* ths = (LwipIntfDev*)netif->state;
 
@@ -252,7 +255,7 @@ err_t LwipIntfDev<RawDev>::linkoutput_s(netif* netif, struct pbuf* pbuf)
 #if PHY_HAS_CAPTURE
     if (phy_capture)
     {
-        phy_capture(ths->_netif.num, (const char*)pbuf->payload, pbuf->len, /*out*/ 1, /*success*/ len == pbuf->len);
+        phy_capture(ths->_netif.num, (const char*)pbuf->payload, pbuf->len, /*out*/1, /*success*/len == pbuf->len);
     }
 #endif
 
@@ -274,11 +277,12 @@ void LwipIntfDev<RawDev>::netif_status_callback_s(struct netif* netif)
 template <class RawDev>
 err_t LwipIntfDev<RawDev>::netif_init()
 {
-    _netif.name[0]      = 'e';
-    _netif.name[1]      = '0' + _netif.num;
-    _netif.mtu          = _mtu;
+    _netif.name[0] = 'e';
+    _netif.name[1] = '0' + _netif.num;
+    _netif.mtu = _mtu;
     _netif.chksum_flags = NETIF_CHECKSUM_ENABLE_ALL;
-    _netif.flags        = NETIF_FLAG_ETHARP
+    _netif.flags =
+        NETIF_FLAG_ETHARP
         | NETIF_FLAG_IGMP
         | NETIF_FLAG_BROADCAST
         | NETIF_FLAG_LINK_UP;
@@ -324,7 +328,7 @@ err_t LwipIntfDev<RawDev>::handlePackets()
     while (1)
     {
         if (++pkt == 10)
-        // prevent starvation
+            // prevent starvation
         {
             return ERR_OK;
         }
@@ -370,7 +374,7 @@ err_t LwipIntfDev<RawDev>::handlePackets()
 #if PHY_HAS_CAPTURE
         if (phy_capture)
         {
-            phy_capture(_netif.num, (const char*)pbuf->payload, tot_len, /*out*/ 0, /*success*/ err == ERR_OK);
+            phy_capture(_netif.num, (const char*)pbuf->payload, tot_len, /*out*/0, /*success*/err == ERR_OK);
         }
 #endif
 
@@ -380,6 +384,7 @@ err_t LwipIntfDev<RawDev>::handlePackets()
             return err;
         }
         // (else) allocated pbuf is now lwIP's responsibility
+
     }
 }
 
@@ -393,4 +398,4 @@ void LwipIntfDev<RawDev>::setDefault()
     }
 }
 
-#endif  // _LWIPINTFDEV_H
+#endif // _LWIPINTFDEV_H
diff --git a/cores/esp8266/StreamSend.cpp b/cores/esp8266/StreamSend.cpp
index fb92b48cd8..693e340cff 100644
--- a/cores/esp8266/StreamSend.cpp
+++ b/cores/esp8266/StreamSend.cpp
@@ -19,19 +19,20 @@
     parsing functions based on TextFinder library by Michael Margolis
 */
 
+
 #include <Arduino.h>
 #include <StreamDev.h>
 
-size_t Stream::sendGeneric(Print*                                                to,
-                           const ssize_t                                         len,
-                           const int                                             readUntilChar,
+size_t Stream::sendGeneric(Print* to,
+                           const ssize_t len,
+                           const int readUntilChar,
                            const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
 {
     setReport(Report::Success);
 
     if (len == 0)
     {
-        return 0;  // conveniently avoids timeout for no requested data
+        return 0;    // conveniently avoids timeout for no requested data
     }
 
     // There are two timeouts:
@@ -56,13 +57,14 @@ size_t Stream::sendGeneric(Print*
     return SendGenericRegular(to, len, timeoutMs);
 }
 
+
 size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int readUntilChar, const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
 {
     // "neverExpires (default, impossible)" is translated to default timeout
     esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
-    const size_t maxLen  = std::max((ssize_t)0, len);
-    size_t       written = 0;
+    const size_t maxLen = std::max((ssize_t)0, len);
+    size_t written = 0;
 
     while (!maxLen || written < maxLen)
     {
@@ -88,13 +90,13 @@ size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int rea
         if (w)
         {
             const char* directbuf = peekBuffer();
-            bool        foundChar = false;
+            bool foundChar = false;
             if (readUntilChar >= 0)
             {
                 const char* last = (const char*)memchr(directbuf, readUntilChar, w);
                 if (last)
                 {
-                    w         = std::min((size_t)(last - directbuf), w);
+                    w = std::min((size_t)(last - directbuf), w);
                     foundChar = true;
                 }
             }
@@ -102,7 +104,7 @@ size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int rea
             {
                 peekConsume(w);
                 written += w;
-                timedOut.reset();  // something has been written
+                timedOut.reset(); // something has been written
             }
             if (foundChar)
             {
@@ -151,8 +153,8 @@ size_t Stream::SendGenericRegularUntil(Print* to, const ssize_t len, const int r
     // "neverExpires (default, impossible)" is translated to default timeout
     esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
-    const size_t maxLen  = std::max((ssize_t)0, len);
-    size_t       written = 0;
+    const size_t maxLen = std::max((ssize_t)0, len);
+    size_t written = 0;
 
     while (!maxLen || written < maxLen)
     {
@@ -184,7 +186,7 @@ size_t Stream::SendGenericRegularUntil(Print* to, const ssize_t len, const int r
                 break;
             }
             written += 1;
-            timedOut.reset();  // something has been written
+            timedOut.reset(); // something has been written
         }
 
         if (timedOut)
@@ -227,8 +229,8 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
     // "neverExpires (default, impossible)" is translated to default timeout
     esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
-    const size_t maxLen  = std::max((ssize_t)0, len);
-    size_t       written = 0;
+    const size_t maxLen = std::max((ssize_t)0, len);
+    size_t written = 0;
 
     while (!maxLen || written < maxLen)
     {
@@ -241,7 +243,7 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
 
         size_t w = to->availableForWrite();
         if (w == 0 && !to->outputCanTimeout())
-        // no more data can be written, ever
+            // no more data can be written, ever
         {
             break;
         }
@@ -254,7 +256,7 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
         w = std::min(w, (decltype(w))temporaryStackBufferSize);
         if (w)
         {
-            char    temp[w];
+            char temp[w];
             ssize_t r = read(temp, w);
             if (r < 0)
             {
@@ -268,7 +270,7 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
                 setReport(Report::WriteError);
                 break;
             }
-            timedOut.reset();  // something has been written
+            timedOut.reset(); // something has been written
         }
 
         if (timedOut)
@@ -303,19 +305,19 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
     return written;
 }
 
-Stream& operator<<(Stream& out, String& string)
+Stream& operator << (Stream& out, String& string)
 {
     StreamConstPtr(string).sendAll(out);
     return out;
 }
 
-Stream& operator<<(Stream& out, StreamString& stream)
+Stream& operator << (Stream& out, StreamString& stream)
 {
     stream.sendAll(out);
     return out;
 }
 
-Stream& operator<<(Stream& out, Stream& stream)
+Stream& operator << (Stream& out, Stream& stream)
 {
     if (stream.streamRemaining() < 0)
     {
@@ -337,13 +339,13 @@ Stream& operator<<(Stream& out, Stream& stream)
     return out;
 }
 
-Stream& operator<<(Stream& out, const char* text)
+Stream& operator << (Stream& out, const char* text)
 {
     StreamConstPtr(text, strlen_P(text)).sendAll(out);
     return out;
 }
 
-Stream& operator<<(Stream& out, const __FlashStringHelper* text)
+Stream& operator << (Stream& out, const __FlashStringHelper* text)
 {
     StreamConstPtr(text).sendAll(out);
     return out;
diff --git a/cores/esp8266/StreamString.h b/cores/esp8266/StreamString.h
index a16f8ce6a4..be11669a79 100644
--- a/cores/esp8266/StreamString.h
+++ b/cores/esp8266/StreamString.h
@@ -32,15 +32,16 @@
 // S2Stream points to a String and makes it a Stream
 // (it is also the helper for StreamString)
 
-class S2Stream : public Stream
+class S2Stream: public Stream
 {
 public:
-    S2Stream(String& string, int peekPointer = -1) :
+
+    S2Stream(String& string, int peekPointer = -1):
         string(&string), peekPointer(peekPointer)
     {
     }
 
-    S2Stream(String* string, int peekPointer = -1) :
+    S2Stream(String* string, int peekPointer = -1):
         string(string), peekPointer(peekPointer)
     {
     }
@@ -206,15 +207,18 @@ class S2Stream : public Stream
     }
 
 protected:
+
     String* string;
-    int     peekPointer;  // -1:String is consumed / >=0:resettable pointer
+    int peekPointer; // -1:String is consumed / >=0:resettable pointer
 };
 
+
 // StreamString is a S2Stream holding the String
 
-class StreamString : public String, public S2Stream
+class StreamString: public String, public S2Stream
 {
 protected:
+
     void resetpp()
     {
         if (peekPointer > 0)
@@ -224,68 +228,55 @@ class StreamString : public String, public S2Stream
     }
 
 public:
-    StreamString(StreamString&& bro) :
-        String(bro), S2Stream(this) { }
-    StreamString(const StreamString& bro) :
-        String(bro), S2Stream(this) { }
+
+    StreamString(StreamString&& bro): String(bro), S2Stream(this) { }
+    StreamString(const StreamString& bro): String(bro), S2Stream(this) { }
 
     // duplicate String constructors and operator=:
 
-    StreamString(const char* text = nullptr) :
-        String(text), S2Stream(this) { }
-    StreamString(const String& string) :
-        String(string), S2Stream(this) { }
-    StreamString(const __FlashStringHelper* str) :
-        String(str), S2Stream(this) { }
-    StreamString(String&& string) :
-        String(string), S2Stream(this) { }
-
-    explicit StreamString(char c) :
-        String(c), S2Stream(this) { }
-    explicit StreamString(unsigned char c, unsigned char base = 10) :
-        String(c, base), S2Stream(this) { }
-    explicit StreamString(int i, unsigned char base = 10) :
-        String(i, base), S2Stream(this) { }
-    explicit StreamString(unsigned int i, unsigned char base = 10) :
-        String(i, base), S2Stream(this) { }
-    explicit StreamString(long l, unsigned char base = 10) :
-        String(l, base), S2Stream(this) { }
-    explicit StreamString(unsigned long l, unsigned char base = 10) :
-        String(l, base), S2Stream(this) { }
-    explicit StreamString(float f, unsigned char decimalPlaces = 2) :
-        String(f, decimalPlaces), S2Stream(this) { }
-    explicit StreamString(double d, unsigned char decimalPlaces = 2) :
-        String(d, decimalPlaces), S2Stream(this) { }
-
-    StreamString& operator=(const StreamString& rhs)
+    StreamString(const char* text = nullptr): String(text), S2Stream(this) { }
+    StreamString(const String& string): String(string), S2Stream(this) { }
+    StreamString(const __FlashStringHelper *str): String(str), S2Stream(this) { }
+    StreamString(String&& string): String(string), S2Stream(this) { }
+
+    explicit StreamString(char c): String(c), S2Stream(this) { }
+    explicit StreamString(unsigned char c, unsigned char base = 10): String(c, base), S2Stream(this) { }
+    explicit StreamString(int i, unsigned char base = 10): String(i, base), S2Stream(this) { }
+    explicit StreamString(unsigned int i, unsigned char base = 10): String(i, base), S2Stream(this) { }
+    explicit StreamString(long l, unsigned char base = 10): String(l, base), S2Stream(this) { }
+    explicit StreamString(unsigned long l, unsigned char base = 10): String(l, base), S2Stream(this) { }
+    explicit StreamString(float f, unsigned char decimalPlaces = 2): String(f, decimalPlaces), S2Stream(this) { }
+    explicit StreamString(double d, unsigned char decimalPlaces = 2): String(d, decimalPlaces), S2Stream(this) { }
+
+    StreamString& operator= (const StreamString& rhs)
     {
         String::operator=(rhs);
         resetpp();
         return *this;
     }
 
-    StreamString& operator=(const String& rhs)
+    StreamString& operator= (const String& rhs)
     {
         String::operator=(rhs);
         resetpp();
         return *this;
     }
 
-    StreamString& operator=(const char* cstr)
+    StreamString& operator= (const char* cstr)
     {
         String::operator=(cstr);
         resetpp();
         return *this;
     }
 
-    StreamString& operator=(const __FlashStringHelper* str)
+    StreamString& operator= (const __FlashStringHelper* str)
     {
         String::operator=(str);
         resetpp();
         return *this;
     }
 
-    StreamString& operator=(String&& rval)
+    StreamString& operator= (String&& rval)
     {
         String::operator=(rval);
         resetpp();
@@ -293,4 +284,4 @@ class StreamString : public String, public S2Stream
     }
 };
 
-#endif  // __STREAMSTRING_H
+#endif // __STREAMSTRING_H
diff --git a/cores/esp8266/core_esp8266_si2c.cpp b/cores/esp8266/core_esp8266_si2c.cpp
index 3672f7a4e2..e01dffe080 100644
--- a/cores/esp8266/core_esp8266_si2c.cpp
+++ b/cores/esp8266/core_esp8266_si2c.cpp
@@ -24,8 +24,9 @@
 #include "wiring_private.h"
 #include "PolledTimeout.h"
 
-extern "C"
-{
+
+
+extern "C" {
 #include "twi_util.h"
 #include "ets_sys.h"
 };
@@ -56,111 +57,78 @@ static inline __attribute__((always_inline)) bool SCL_READ(const int twi_scl)
     return (GPI & (1 << twi_scl)) != 0;
 }
 
+
 // Implement as a class to reduce code size by allowing access to many global variables with a single base pointer
 class Twi
 {
 private:
-    unsigned int  preferred_si2c_clock  = 100000;
-    uint32_t      twi_dcount            = 18;
-    unsigned char twi_sda               = 0;
-    unsigned char twi_scl               = 0;
-    unsigned char twi_addr              = 0;
-    uint32_t      twi_clockStretchLimit = 0;
+    unsigned int preferred_si2c_clock = 100000;
+    uint32_t twi_dcount = 18;
+    unsigned char twi_sda = 0;
+    unsigned char twi_scl = 0;
+    unsigned char twi_addr = 0;
+    uint32_t twi_clockStretchLimit = 0;
 
     // These are int-wide, even though they could all fit in a byte, to reduce code size and avoid any potential
     // issues about RmW on packed bytes.  The int-wide variations of asm instructions are smaller than the equivalent
     // byte-wide ones, and since these emums are used everywhere, the difference adds up fast.  There is only a single
     // instance of the class, though, so the extra 12 bytes of RAM used here saves a lot more IRAM.
-    volatile enum { TWIPM_UNKNOWN = 0,
-                    TWIPM_IDLE,
-                    TWIPM_ADDRESSED,
-                    TWIPM_WAIT } twip_mode
-        = TWIPM_IDLE;
-    volatile enum { TWIP_UNKNOWN = 0,
-                    TWIP_IDLE,
-                    TWIP_START,
-                    TWIP_SEND_ACK,
-                    TWIP_WAIT_ACK,
-                    TWIP_WAIT_STOP,
-                    TWIP_SLA_W,
-                    TWIP_SLA_R,
-                    TWIP_REP_START,
-                    TWIP_READ,
-                    TWIP_STOP,
-                    TWIP_REC_ACK,
-                    TWIP_READ_ACK,
-                    TWIP_RWAIT_ACK,
-                    TWIP_WRITE,
-                    TWIP_BUS_ERR } twip_state
-        = TWIP_IDLE;
+    volatile enum { TWIPM_UNKNOWN = 0, TWIPM_IDLE, TWIPM_ADDRESSED, TWIPM_WAIT} twip_mode = TWIPM_IDLE;
+    volatile enum { TWIP_UNKNOWN = 0, TWIP_IDLE, TWIP_START, TWIP_SEND_ACK, TWIP_WAIT_ACK, TWIP_WAIT_STOP, TWIP_SLA_W, TWIP_SLA_R, TWIP_REP_START, TWIP_READ, TWIP_STOP, TWIP_REC_ACK, TWIP_READ_ACK, TWIP_RWAIT_ACK, TWIP_WRITE, TWIP_BUS_ERR } twip_state = TWIP_IDLE;
     volatile int twip_status = TW_NO_INFO;
-    volatile int bitCount    = 0;
-
-    volatile uint8_t twi_data       = 0x00;
-    volatile int     twi_ack        = 0;
-    volatile int     twi_ack_rec    = 0;
-    volatile int     twi_timeout_ms = 10;
-
-    volatile enum { TWI_READY = 0,
-                    TWI_MRX,
-                    TWI_MTX,
-                    TWI_SRX,
-                    TWI_STX } twi_state
-        = TWI_READY;
+    volatile int bitCount = 0;
+
+    volatile uint8_t twi_data = 0x00;
+    volatile int twi_ack = 0;
+    volatile int twi_ack_rec = 0;
+    volatile int twi_timeout_ms = 10;
+
+    volatile enum { TWI_READY = 0, TWI_MRX, TWI_MTX, TWI_SRX, TWI_STX } twi_state = TWI_READY;
     volatile uint8_t twi_error = 0xFF;
 
-    uint8_t      twi_txBuffer[TWI_BUFFER_LENGTH];
-    volatile int twi_txBufferIndex  = 0;
+    uint8_t twi_txBuffer[TWI_BUFFER_LENGTH];
+    volatile int twi_txBufferIndex = 0;
     volatile int twi_txBufferLength = 0;
 
-    uint8_t      twi_rxBuffer[TWI_BUFFER_LENGTH];
+    uint8_t twi_rxBuffer[TWI_BUFFER_LENGTH];
     volatile int twi_rxBufferIndex = 0;
 
     void (*twi_onSlaveTransmit)(void);
     void (*twi_onSlaveReceive)(uint8_t*, size_t);
 
     // ETS queue/timer interfaces
-    enum
-    {
-        EVENTTASK_QUEUE_SIZE = 1,
-        EVENTTASK_QUEUE_PRIO = 2
-    };
-    enum
-    {
-        TWI_SIG_RANGE = 0x00000100,
-        TWI_SIG_RX    = 0x00000101,
-        TWI_SIG_TX    = 0x00000102
-    };
+    enum { EVENTTASK_QUEUE_SIZE = 1, EVENTTASK_QUEUE_PRIO = 2 };
+    enum { TWI_SIG_RANGE = 0x00000100, TWI_SIG_RX = 0x00000101, TWI_SIG_TX = 0x00000102 };
     ETSEvent eventTaskQueue[EVENTTASK_QUEUE_SIZE];
     ETSTimer timer;
 
     // Event/IRQ callbacks, so they can't use "this" and need to be static
     static void IRAM_ATTR onSclChange(void);
     static void IRAM_ATTR onSdaChange(void);
-    static void           eventTask(ETSEvent* e);
-    static void IRAM_ATTR onTimer(void* unused);
+    static void eventTask(ETSEvent *e);
+    static void IRAM_ATTR onTimer(void *unused);
 
     // Allow not linking in the slave code if there is no call to setAddress
     bool _slaveEnabled = false;
 
     // Internal use functions
     void IRAM_ATTR busywait(unsigned int v);
-    bool           write_start(void);
-    bool           write_stop(void);
-    bool           write_bit(bool bit);
-    bool           read_bit(void);
-    bool           write_byte(unsigned char byte);
-    unsigned char  read_byte(bool nack);
+    bool write_start(void);
+    bool write_stop(void);
+    bool write_bit(bool bit);
+    bool read_bit(void);
+    bool write_byte(unsigned char byte);
+    unsigned char read_byte(bool nack);
     void IRAM_ATTR onTwipEvent(uint8_t status);
 
     // Handle the case where a slave needs to stretch the clock with a time-limited busy wait
     inline void WAIT_CLOCK_STRETCH()
     {
-        esp8266::polledTimeout::oneShotFastUs  timeout(twi_clockStretchLimit);
+        esp8266::polledTimeout::oneShotFastUs timeout(twi_clockStretchLimit);
         esp8266::polledTimeout::periodicFastUs yieldTimeout(5000);
-        while (!timeout && !SCL_READ(twi_scl))  // outer loop is stretch duration up to stretch limit
+        while (!timeout && !SCL_READ(twi_scl)) // outer loop is stretch duration up to stretch limit
         {
-            if (yieldTimeout)  // inner loop yields every 5ms
+            if (yieldTimeout)   // inner loop yields every 5ms
             {
                 yield();
             }
@@ -171,19 +139,19 @@ class Twi
     void twi_scl_valley(void);
 
 public:
-    void           setClock(unsigned int freq);
-    void           setClockStretchLimit(uint32_t limit);
-    void           init(unsigned char sda, unsigned char scl);
-    void           setAddress(uint8_t address);
-    unsigned char  writeTo(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop);
-    unsigned char  readFrom(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop);
-    uint8_t        status();
-    uint8_t        transmit(const uint8_t* data, uint8_t length);
-    void           attachSlaveRxEvent(void (*function)(uint8_t*, size_t));
-    void           attachSlaveTxEvent(void (*function)(void));
+    void setClock(unsigned int freq);
+    void setClockStretchLimit(uint32_t limit);
+    void init(unsigned char sda, unsigned char scl);
+    void setAddress(uint8_t address);
+    unsigned char writeTo(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop);
+    unsigned char readFrom(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop);
+    uint8_t status();
+    uint8_t transmit(const uint8_t* data, uint8_t length);
+    void attachSlaveRxEvent(void (*function)(uint8_t*, size_t));
+    void attachSlaveTxEvent(void (*function)(void));
     void IRAM_ATTR reply(uint8_t ack);
     void IRAM_ATTR releaseBus(void);
-    void           enableSlave();
+    void enableSlave();
 };
 
 static Twi twi;
@@ -207,8 +175,8 @@ void Twi::setClock(unsigned int freq)
     {
         freq = 400000;
     }
-    twi_dcount = (500000000 / freq);                    // half-cycle period in ns
-    twi_dcount = (1000 * (twi_dcount - 1120)) / 62500;  // (half cycle - overhead) / busywait loop time
+    twi_dcount = (500000000 / freq);  // half-cycle period in ns
+    twi_dcount = (1000 * (twi_dcount - 1120)) / 62500; // (half cycle - overhead) / busywait loop time
 
 #else
 
@@ -216,8 +184,8 @@ void Twi::setClock(unsigned int freq)
     {
         freq = 800000;
     }
-    twi_dcount = (500000000 / freq);                   // half-cycle period in ns
-    twi_dcount = (1000 * (twi_dcount - 560)) / 31250;  // (half cycle - overhead) / busywait loop time
+    twi_dcount = (500000000 / freq);  // half-cycle period in ns
+    twi_dcount = (1000 * (twi_dcount - 560)) / 31250; // (half cycle - overhead) / busywait loop time
 
 #endif
 }
@@ -227,6 +195,8 @@ void Twi::setClockStretchLimit(uint32_t limit)
     twi_clockStretchLimit = limit;
 }
 
+
+
 void Twi::init(unsigned char sda, unsigned char scl)
 {
     // set timer function
@@ -240,7 +210,7 @@ void Twi::init(unsigned char sda, unsigned char scl)
     pinMode(twi_sda, INPUT_PULLUP);
     pinMode(twi_scl, INPUT_PULLUP);
     twi_setClock(preferred_si2c_clock);
-    twi_setClockStretchLimit(150000L);  // default value is 150 mS
+    twi_setClockStretchLimit(150000L); // default value is 150 mS
 }
 
 void Twi::setAddress(uint8_t address)
@@ -264,7 +234,7 @@ void IRAM_ATTR Twi::busywait(unsigned int v)
     unsigned int i;
     for (i = 0; i < v; i++)  // loop time is 5 machine cycles: 31.25ns @ 160MHz, 62.5ns @ 80MHz
     {
-        __asm__ __volatile__("nop");  // minimum element to keep GCC from optimizing this function out.
+        __asm__ __volatile__("nop"); // minimum element to keep GCC from optimizing this function out.
     }
 }
 
@@ -338,7 +308,7 @@ bool Twi::write_byte(unsigned char byte)
         write_bit(byte & 0x80);
         byte <<= 1;
     }
-    return !read_bit();  //NACK/ACK
+    return !read_bit();//NACK/ACK
 }
 
 unsigned char Twi::read_byte(bool nack)
@@ -353,7 +323,7 @@ unsigned char Twi::read_byte(bool nack)
     return byte;
 }
 
-unsigned char Twi::writeTo(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop)
+unsigned char Twi::writeTo(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop)
 {
     unsigned int i;
     if (!write_start())
@@ -366,7 +336,7 @@ unsigned char Twi::writeTo(unsigned char address, unsigned char* buf, unsigned i
         {
             write_stop();
         }
-        return 2;  //received NACK on transmit of address
+        return 2; //received NACK on transmit of address
     }
     for (i = 0; i < len; i++)
     {
@@ -376,7 +346,7 @@ unsigned char Twi::writeTo(unsigned char address, unsigned char* buf, unsigned i
             {
                 write_stop();
             }
-            return 3;  //received NACK on transmit of data
+            return 3;//received NACK on transmit of data
         }
     }
     if (sendStop)
@@ -411,7 +381,7 @@ unsigned char Twi::readFrom(unsigned char address, unsigned char* buf, unsigned
         {
             write_stop();
         }
-        return 2;  //received NACK on transmit of address
+        return 2;//received NACK on transmit of address
     }
     for (i = 0; i < (len - 1); i++)
     {
@@ -454,12 +424,12 @@ uint8_t Twi::status()
     }
 
     int clockCount = 20;
-    while (!SDA_READ(twi_sda) && clockCount-- > 0)  // if SDA low, read the bits slaves have to sent to a max
+    while (!SDA_READ(twi_sda) && clockCount-- > 0)   // if SDA low, read the bits slaves have to sent to a max
     {
         read_bit();
         if (!SCL_READ(twi_scl))
         {
-            return I2C_SCL_HELD_LOW_AFTER_READ;  // I2C bus error. SCL held low beyond slave clock stretch time
+            return I2C_SCL_HELD_LOW_AFTER_READ; // I2C bus error. SCL held low beyond slave clock stretch time
         }
     }
     if (!SDA_READ(twi_sda))
@@ -515,47 +485,49 @@ void IRAM_ATTR Twi::reply(uint8_t ack)
     if (ack)
     {
         //TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT) | _BV(TWEA);
-        SCL_HIGH(twi.twi_scl);  // _BV(TWINT)
-        twi_ack = 1;            // _BV(TWEA)
+        SCL_HIGH(twi.twi_scl);      // _BV(TWINT)
+        twi_ack = 1;    // _BV(TWEA)
     }
     else
     {
         //TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT);
-        SCL_HIGH(twi.twi_scl);  // _BV(TWINT)
-        twi_ack = 0;            // ~_BV(TWEA)
+        SCL_HIGH(twi.twi_scl);      // _BV(TWINT)
+        twi_ack = 0;    // ~_BV(TWEA)
     }
 }
 
+
 void IRAM_ATTR Twi::releaseBus(void)
 {
     // release bus
     //TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT);
-    SCL_HIGH(twi.twi_scl);  // _BV(TWINT)
-    twi_ack = 1;            // _BV(TWEA)
+    SCL_HIGH(twi.twi_scl);      // _BV(TWINT)
+    twi_ack = 1;    // _BV(TWEA)
     SDA_HIGH(twi.twi_sda);
 
     // update twi state
     twi_state = TWI_READY;
 }
 
+
 void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
 {
     twip_status = status;
     switch (status)
     {
     // Slave Receiver
-    case TW_SR_SLA_ACK:             // addressed, returned ack
-    case TW_SR_GCALL_ACK:           // addressed generally, returned ack
-    case TW_SR_ARB_LOST_SLA_ACK:    // lost arbitration, returned ack
-    case TW_SR_ARB_LOST_GCALL_ACK:  // lost arbitration, returned ack
+    case TW_SR_SLA_ACK:   // addressed, returned ack
+    case TW_SR_GCALL_ACK: // addressed generally, returned ack
+    case TW_SR_ARB_LOST_SLA_ACK:   // lost arbitration, returned ack
+    case TW_SR_ARB_LOST_GCALL_ACK: // lost arbitration, returned ack
         // enter slave receiver mode
         twi_state = TWI_SRX;
         // indicate that rx buffer can be overwritten and ack
         twi_rxBufferIndex = 0;
         reply(1);
         break;
-    case TW_SR_DATA_ACK:        // data received, returned ack
-    case TW_SR_GCALL_DATA_ACK:  // data received generally, returned ack
+    case TW_SR_DATA_ACK:       // data received, returned ack
+    case TW_SR_GCALL_DATA_ACK: // data received generally, returned ack
         // if there is still room in the rx buffer
         if (twi_rxBufferIndex < TWI_BUFFER_LENGTH)
         {
@@ -569,7 +541,7 @@ void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
             reply(0);
         }
         break;
-    case TW_SR_STOP:  // stop or repeated start condition received
+    case TW_SR_STOP: // stop or repeated start condition received
         // put a null char after data if there's room
         if (twi_rxBufferIndex < TWI_BUFFER_LENGTH)
         {
@@ -583,15 +555,15 @@ void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
         twi_rxBufferIndex = 0;
         break;
 
-    case TW_SR_DATA_NACK:        // data received, returned nack
-    case TW_SR_GCALL_DATA_NACK:  // data received generally, returned nack
+    case TW_SR_DATA_NACK:       // data received, returned nack
+    case TW_SR_GCALL_DATA_NACK: // data received generally, returned nack
         // nack back at master
         reply(0);
         break;
 
     // Slave Transmitter
-    case TW_ST_SLA_ACK:           // addressed, returned ack
-    case TW_ST_ARB_LOST_SLA_ACK:  // arbitration lost, returned ack
+    case TW_ST_SLA_ACK:          // addressed, returned ack
+    case TW_ST_ARB_LOST_SLA_ACK: // arbitration lost, returned ack
         // enter slave transmitter mode
         twi_state = TWI_STX;
         // ready the tx buffer index for iteration
@@ -604,7 +576,7 @@ void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
         ets_post(EVENTTASK_QUEUE_PRIO, TWI_SIG_TX, 0);
         break;
 
-    case TW_ST_DATA_ACK:  // byte sent, ack returned
+    case TW_ST_DATA_ACK: // byte sent, ack returned
         // copy data to output register
         twi_data = twi_txBuffer[twi_txBufferIndex++];
 
@@ -630,32 +602,33 @@ void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
             reply(0);
         }
         break;
-    case TW_ST_DATA_NACK:  // received nack, we are done
-    case TW_ST_LAST_DATA:  // received ack, but we are done already!
+    case TW_ST_DATA_NACK: // received nack, we are done
+    case TW_ST_LAST_DATA: // received ack, but we are done already!
         // leave slave receiver state
         releaseBus();
         break;
 
     // All
-    case TW_NO_INFO:  // no state information
+    case TW_NO_INFO:   // no state information
         break;
-    case TW_BUS_ERROR:  // bus error, illegal stop/start
+    case TW_BUS_ERROR: // bus error, illegal stop/start
         twi_error = TW_BUS_ERROR;
         break;
     }
 }
 
-void IRAM_ATTR Twi::onTimer(void* unused)
+void IRAM_ATTR Twi::onTimer(void *unused)
 {
     (void)unused;
     twi.releaseBus();
     twi.onTwipEvent(TW_BUS_ERROR);
-    twi.twip_mode  = TWIPM_WAIT;
+    twi.twip_mode = TWIPM_WAIT;
     twi.twip_state = TWIP_BUS_ERR;
 }
 
-void Twi::eventTask(ETSEvent* e)
+void Twi::eventTask(ETSEvent *e)
 {
+
     if (e == NULL)
     {
         return;
@@ -670,7 +643,7 @@ void Twi::eventTask(ETSEvent* e)
         if (twi.twi_txBufferLength == 0)
         {
             twi.twi_txBufferLength = 1;
-            twi.twi_txBuffer[0]    = 0x00;
+            twi.twi_txBuffer[0] = 0x00;
         }
 
         // Initiate transmission
@@ -690,7 +663,7 @@ void Twi::eventTask(ETSEvent* e)
 // compared to the logical-or of all states with the same branch.  This removes the need
 // for a large series of straight-line compares.  The biggest win is when multiple states
 // all have the same branch (onSdaChange), but for others there is some benefit, still.
-#define S2M(x) (1 << (x))
+#define S2M(x) (1<<(x))
 // Shorthand for if the state is any of the or'd bitmask x
 #define IFSTATE(x) if (twip_state_mask & (x))
 
@@ -704,7 +677,7 @@ void IRAM_ATTR Twi::onSclChange(void)
     sda = SDA_READ(twi.twi_sda);
     scl = SCL_READ(twi.twi_scl);
 
-    twi.twip_status = 0xF8;  // reset TWI status
+    twi.twip_status = 0xF8;     // reset TWI status
 
     int twip_state_mask = S2M(twi.twip_state);
     IFSTATE(S2M(TWIP_START) | S2M(TWIP_REP_START) | S2M(TWIP_SLA_W) | S2M(TWIP_READ))
@@ -779,13 +752,13 @@ void IRAM_ATTR Twi::onSclChange(void)
                 }
                 else
                 {
-                    SCL_LOW(twi.twi_scl);  // clock stretching
+                    SCL_LOW(twi.twi_scl);   // clock stretching
                     SDA_HIGH(twi.twi_sda);
                     twi.twip_mode = TWIPM_ADDRESSED;
                     if (!(twi.twi_data & 0x01))
                     {
                         twi.onTwipEvent(TW_SR_SLA_ACK);
-                        twi.bitCount   = 8;
+                        twi.bitCount = 8;
                         twi.twip_state = TWIP_SLA_W;
                     }
                     else
@@ -797,18 +770,18 @@ void IRAM_ATTR Twi::onSclChange(void)
             }
             else
             {
-                SCL_LOW(twi.twi_scl);  // clock stretching
+                SCL_LOW(twi.twi_scl);   // clock stretching
                 SDA_HIGH(twi.twi_sda);
                 if (!twi.twi_ack)
                 {
                     twi.onTwipEvent(TW_SR_DATA_NACK);
-                    twi.twip_mode  = TWIPM_WAIT;
+                    twi.twip_mode = TWIPM_WAIT;
                     twi.twip_state = TWIP_WAIT_STOP;
                 }
                 else
                 {
                     twi.onTwipEvent(TW_SR_DATA_ACK);
-                    twi.bitCount   = 8;
+                    twi.bitCount = 8;
                     twi.twip_state = TWIP_READ;
                 }
             }
@@ -864,7 +837,7 @@ void IRAM_ATTR Twi::onSclChange(void)
         else
         {
             twi.twi_ack_rec = !sda;
-            twi.twip_state  = TWIP_RWAIT_ACK;
+            twi.twip_state = TWIP_RWAIT_ACK;
         }
     }
     else IFSTATE(S2M(TWIP_RWAIT_ACK))
@@ -875,7 +848,7 @@ void IRAM_ATTR Twi::onSclChange(void)
         }
         else
         {
-            SCL_LOW(twi.twi_scl);  // clock stretching
+            SCL_LOW(twi.twi_scl);   // clock stretching
             if (twi.twi_ack && twi.twi_ack_rec)
             {
                 twi.onTwipEvent(TW_ST_DATA_ACK);
@@ -885,7 +858,7 @@ void IRAM_ATTR Twi::onSclChange(void)
             {
                 // we have no more data to send and/or the master doesn't want anymore
                 twi.onTwipEvent(twi.twi_ack_rec ? TW_ST_LAST_DATA : TW_ST_DATA_NACK);
-                twi.twip_mode  = TWIPM_WAIT;
+                twi.twip_mode = TWIPM_WAIT;
                 twi.twip_state = TWIP_WAIT_STOP;
             }
         }
@@ -902,7 +875,7 @@ void IRAM_ATTR Twi::onSdaChange(void)
     scl = SCL_READ(twi.twi_scl);
 
     int twip_state_mask = S2M(twi.twip_state);
-    if (scl) /* !DATA */
+    if (scl)   /* !DATA */
     {
         IFSTATE(S2M(TWIP_IDLE))
         {
@@ -913,17 +886,17 @@ void IRAM_ATTR Twi::onSdaChange(void)
             else
             {
                 // START
-                twi.bitCount   = 8;
+                twi.bitCount = 8;
                 twi.twip_state = TWIP_START;
-                ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true);  // Once, ms
+                ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true); // Once, ms
             }
         }
         else IFSTATE(S2M(TWIP_START) | S2M(TWIP_REP_START) | S2M(TWIP_SEND_ACK) | S2M(TWIP_WAIT_ACK) | S2M(TWIP_SLA_R) | S2M(TWIP_REC_ACK) | S2M(TWIP_READ_ACK) | S2M(TWIP_RWAIT_ACK) | S2M(TWIP_WRITE))
         {
             // START or STOP
-            SDA_HIGH(twi.twi_sda);  // Should not be necessary
+            SDA_HIGH(twi.twi_sda);   // Should not be necessary
             twi.onTwipEvent(TW_BUS_ERROR);
-            twi.twip_mode  = TWIPM_WAIT;
+            twi.twip_mode = TWIPM_WAIT;
             twi.twip_state = TWIP_BUS_ERR;
         }
         else IFSTATE(S2M(TWIP_WAIT_STOP) | S2M(TWIP_BUS_ERR))
@@ -931,10 +904,10 @@ void IRAM_ATTR Twi::onSdaChange(void)
             if (sda)
             {
                 // STOP
-                SCL_LOW(twi.twi_scl);  // generates a low SCL pulse after STOP
+                SCL_LOW(twi.twi_scl);   // generates a low SCL pulse after STOP
                 ets_timer_disarm(&twi.timer);
                 twi.twip_state = TWIP_IDLE;
-                twi.twip_mode  = TWIPM_IDLE;
+                twi.twip_mode = TWIPM_IDLE;
                 SCL_HIGH(twi.twi_scl);
             }
             else
@@ -946,9 +919,9 @@ void IRAM_ATTR Twi::onSdaChange(void)
                 }
                 else
                 {
-                    twi.bitCount   = 8;
+                    twi.bitCount = 8;
                     twi.twip_state = TWIP_REP_START;
-                    ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true);  // Once, ms
+                    ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true); // Once, ms
                 }
             }
         }
@@ -959,28 +932,28 @@ void IRAM_ATTR Twi::onSdaChange(void)
             {
                 // inside byte transfer - error
                 twi.onTwipEvent(TW_BUS_ERROR);
-                twi.twip_mode  = TWIPM_WAIT;
+                twi.twip_mode = TWIPM_WAIT;
                 twi.twip_state = TWIP_BUS_ERR;
             }
             else
             {
                 // during first bit in byte transfer - ok
-                SCL_LOW(twi.twi_scl);  // clock stretching
+                SCL_LOW(twi.twi_scl);   // clock stretching
                 twi.onTwipEvent(TW_SR_STOP);
                 if (sda)
                 {
                     // STOP
                     ets_timer_disarm(&twi.timer);
                     twi.twip_state = TWIP_IDLE;
-                    twi.twip_mode  = TWIPM_IDLE;
+                    twi.twip_mode = TWIPM_IDLE;
                 }
                 else
                 {
                     // START
                     twi.bitCount = 8;
-                    ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true);  // Once, ms
+                    ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true); // Once, ms
                     twi.twip_state = TWIP_REP_START;
-                    twi.twip_mode  = TWIPM_IDLE;
+                    twi.twip_mode = TWIPM_IDLE;
                 }
             }
         }
@@ -988,8 +961,8 @@ void IRAM_ATTR Twi::onSdaChange(void)
 }
 
 // C wrappers for the object, since API is exposed only as C
-extern "C"
-{
+extern "C" {
+
     void twi_init(unsigned char sda, unsigned char scl)
     {
         return twi.init(sda, scl);
@@ -1010,12 +983,12 @@ extern "C"
         twi.setClockStretchLimit(limit);
     }
 
-    uint8_t twi_writeTo(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop)
+    uint8_t twi_writeTo(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop)
     {
         return twi.writeTo(address, buf, len, sendStop);
     }
 
-    uint8_t twi_readFrom(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop)
+    uint8_t twi_readFrom(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop)
     {
         return twi.readFrom(address, buf, len, sendStop);
     }
@@ -1025,7 +998,7 @@ extern "C"
         return twi.status();
     }
 
-    uint8_t twi_transmit(const uint8_t* buf, uint8_t len)
+    uint8_t twi_transmit(const uint8_t * buf, uint8_t len)
     {
         return twi.transmit(buf, len);
     }
@@ -1054,4 +1027,5 @@ extern "C"
     {
         twi.enableSlave();
     }
+
 };
diff --git a/cores/esp8266/debug.cpp b/cores/esp8266/debug.cpp
index 327aace64e..06af1e424b 100644
--- a/cores/esp8266/debug.cpp
+++ b/cores/esp8266/debug.cpp
@@ -30,7 +30,7 @@ void __iamslow(const char* what)
 #endif
 
 IRAM_ATTR
-void hexdump(const void* mem, uint32_t len, uint8_t cols)
+void hexdump(const void *mem, uint32_t len, uint8_t cols)
 {
     const char* src = (const char*)mem;
     os_printf("\n[HEXDUMP] Address: %p len: 0x%X (%d)", src, len, len);
diff --git a/cores/esp8266/debug.h b/cores/esp8266/debug.h
index 025687a5af..263d3e9149 100644
--- a/cores/esp8266/debug.h
+++ b/cores/esp8266/debug.h
@@ -5,54 +5,44 @@
 #include <stdint.h>
 
 #ifdef DEBUG_ESP_CORE
-#define DEBUGV(fmt, ...) ::printf((PGM_P)PSTR(fmt), ##__VA_ARGS__)
+#define DEBUGV(fmt, ...) ::printf((PGM_P)PSTR(fmt), ## __VA_ARGS__)
 #endif
 
 #ifndef DEBUGV
-#define DEBUGV(...) \
-    do              \
-    {               \
-        (void)0;    \
-    } while (0)
+#define DEBUGV(...) do { (void)0; } while (0)
 #endif
 
 #ifdef __cplusplus
-extern "C" void hexdump(const void* mem, uint32_t len, uint8_t cols = 16);
+extern "C" void hexdump(const void *mem, uint32_t len, uint8_t cols = 16);
 #else
-void hexdump(const void* mem, uint32_t len, uint8_t cols);
+void hexdump(const void *mem, uint32_t len, uint8_t cols);
 #endif
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
-    void __unhandled_exception(const char* str) __attribute__((noreturn));
-    void __panic_func(const char* file, int line, const char* func) __attribute__((noreturn));
+void __unhandled_exception(const char *str) __attribute__((noreturn));
+void __panic_func(const char* file, int line, const char* func) __attribute__((noreturn));
 #define panic() __panic_func(PSTR(__FILE__), __LINE__, __func__)
 
 #ifdef DEBUG_ESP_CORE
-    extern void __iamslow(const char* what);
-#define IAMSLOW()                                  \
-    do                                             \
-    {                                              \
-        static bool once = false;                  \
-        if (!once)                                 \
-        {                                          \
-            once = true;                           \
+extern void __iamslow(const char* what);
+#define IAMSLOW() \
+    do { \
+        static bool once = false; \
+        if (!once) { \
+            once = true; \
             __iamslow((PGM_P)FPSTR(__FUNCTION__)); \
-        }                                          \
+        } \
     } while (0)
 #else
-#define IAMSLOW() \
-    do            \
-    {             \
-        (void)0;  \
-    } while (0)
+#define IAMSLOW() do { (void)0; } while (0)
 #endif
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif  //ARD_DEBUG_H
+
+#endif//ARD_DEBUG_H
diff --git a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
index 1a94864e90..ddc5629741 100644
--- a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
+++ b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
@@ -5,10 +5,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 void setup() {
@@ -39,15 +39,19 @@ void setup() {
     String type;
     if (ArduinoOTA.getCommand() == U_FLASH) {
       type = "sketch";
-    } else {  // U_FS
+    } else { // U_FS
       type = "filesystem";
     }
 
     // NOTE: if updating FS this would be the place to unmount FS using FS.end()
     Serial.println("Start updating " + type);
   });
-  ArduinoOTA.onEnd([]() { Serial.println("\nEnd"); });
-  ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) { Serial.printf("Progress: %u%%\r", (progress / (total / 100))); });
+  ArduinoOTA.onEnd([]() {
+    Serial.println("\nEnd");
+  });
+  ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
+    Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
+  });
   ArduinoOTA.onError([](ota_error_t error) {
     Serial.printf("Error[%u]: ", error);
     if (error == OTA_AUTH_ERROR) {
diff --git a/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino b/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
index 7c01e2e7cb..7d05074e15 100644
--- a/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
+++ b/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
@@ -5,16 +5,16 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
-const char* host     = "OTA-LEDS";
+const char* host = "OTA-LEDS";
 
 int led_pin = 13;
 #define N_DIMMERS 3
-int dimmer_pin[] = { 14, 5, 15 };
+int dimmer_pin[] = {14, 5, 15};
 
 void setup() {
   Serial.begin(115200);
@@ -45,14 +45,14 @@ void setup() {
   }
 
   ArduinoOTA.setHostname(host);
-  ArduinoOTA.onStart([]() {  // switch off all the PWMs during upgrade
+  ArduinoOTA.onStart([]() { // switch off all the PWMs during upgrade
     for (int i = 0; i < N_DIMMERS; i++) {
       analogWrite(dimmer_pin[i], 0);
     }
     analogWrite(led_pin, 0);
   });
 
-  ArduinoOTA.onEnd([]() {  // do a fancy thing with our board led at end
+  ArduinoOTA.onEnd([]() { // do a fancy thing with our board led at end
     for (int i = 0; i < 30; i++) {
       analogWrite(led_pin, (i * 100) % 1001);
       delay(50);
@@ -67,6 +67,7 @@ void setup() {
   /* setup the OTA server */
   ArduinoOTA.begin();
   Serial.println("Ready");
+
 }
 
 void loop() {
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
index 21abb08a4e..5f1f5020a1 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
@@ -20,22 +20,22 @@
 /* Set these to your desired softAP credentials. They are not configurable at runtime */
 #ifndef APSSID
 #define APSSID "ESP_ap"
-#define APPSK "12345678"
+#define APPSK  "12345678"
 #endif
 
-const char* softAP_ssid     = APSSID;
-const char* softAP_password = APPSK;
+const char *softAP_ssid = APSSID;
+const char *softAP_password = APPSK;
 
 /* hostname for mDNS. Should work at least on windows. Try http://esp8266.local */
-const char* myHostname = "esp8266";
+const char *myHostname = "esp8266";
 
 /* Don't set this wifi credentials. They are configurated at runtime and stored on EEPROM */
-char ssid[33]     = "";
+char ssid[33] = "";
 char password[65] = "";
 
 // DNS server
 const byte DNS_PORT = 53;
-DNSServer  dnsServer;
+DNSServer dnsServer;
 
 // Web server
 ESP8266WebServer server(80);
@@ -44,6 +44,7 @@ ESP8266WebServer server(80);
 IPAddress apIP(172, 217, 28, 1);
 IPAddress netMsk(255, 255, 255, 0);
 
+
 /** Should I connect to WLAN asap? */
 boolean connect;
 
@@ -61,7 +62,7 @@ void setup() {
   /* You can remove the password parameter if you want the AP to be open. */
   WiFi.softAPConfig(apIP, apIP, netMsk);
   WiFi.softAP(softAP_ssid, softAP_password);
-  delay(500);  // Without delay I've seen the IP address blank
+  delay(500); // Without delay I've seen the IP address blank
   Serial.print("AP IP address: ");
   Serial.println(WiFi.softAPIP());
 
@@ -74,12 +75,12 @@ void setup() {
   server.on("/wifi", handleWifi);
   server.on("/wifisave", handleWifiSave);
   server.on("/generate_204", handleRoot);  //Android captive portal. Maybe not needed. Might be handled by notFound handler.
-  server.on("/fwlink", handleRoot);        //Microsoft captive portal. Maybe not needed. Might be handled by notFound handler.
+  server.on("/fwlink", handleRoot);  //Microsoft captive portal. Maybe not needed. Might be handled by notFound handler.
   server.onNotFound(handleNotFound);
-  server.begin();  // Web server start
+  server.begin(); // Web server start
   Serial.println("HTTP server started");
-  loadCredentials();           // Load WLAN credentials from network
-  connect = strlen(ssid) > 0;  // Request WLAN connect if there is a SSID
+  loadCredentials(); // Load WLAN credentials from network
+  connect = strlen(ssid) > 0; // Request WLAN connect if there is a SSID
 }
 
 void connectWifi() {
@@ -105,7 +106,7 @@ void loop() {
       /* Don't set retry time too low as retry interfere the softAP operation */
       connect = true;
     }
-    if (status != s) {  // WLAN status change
+    if (status != s) { // WLAN status change
       Serial.print("Status: ");
       Serial.println(s);
       status = s;
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
index 5b88ae272a..dc286c1840 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
@@ -1,6 +1,6 @@
 /** Handle root or redirect to captive portal */
 void handleRoot() {
-  if (captivePortal()) {  // If caprive portal redirect instead of displaying the page.
+  if (captivePortal()) { // If caprive portal redirect instead of displaying the page.
     return;
   }
   server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
@@ -9,18 +9,18 @@ void handleRoot() {
 
   String Page;
   Page += F(
-      "<!DOCTYPE html><html lang='en'><head>"
-      "<meta name='viewport' content='width=device-width'>"
-      "<title>CaptivePortal</title></head><body>"
-      "<h1>HELLO WORLD!!</h1>");
+            "<!DOCTYPE html><html lang='en'><head>"
+            "<meta name='viewport' content='width=device-width'>"
+            "<title>CaptivePortal</title></head><body>"
+            "<h1>HELLO WORLD!!</h1>");
   if (server.client().localIP() == apIP) {
     Page += String(F("<p>You are connected through the soft AP: ")) + softAP_ssid + F("</p>");
   } else {
     Page += String(F("<p>You are connected through the wifi network: ")) + ssid + F("</p>");
   }
   Page += F(
-      "<p>You may want to <a href='/wifi'>config the wifi connection</a>.</p>"
-      "</body></html>");
+            "<p>You may want to <a href='/wifi'>config the wifi connection</a>.</p>"
+            "</body></html>");
 
   server.send(200, "text/html", Page);
 }
@@ -30,8 +30,8 @@ boolean captivePortal() {
   if (!isIp(server.hostHeader()) && server.hostHeader() != (String(myHostname) + ".local")) {
     Serial.println("Request redirected to captive portal");
     server.sendHeader("Location", String("http://") + toStringIp(server.client().localIP()), true);
-    server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to close the socket ourselves.
-    server.client().stop();              // Stop is needed because we sent no content length
+    server.send(302, "text/plain", "");   // Empty content inhibits Content-length header so we have to close the socket ourselves.
+    server.client().stop(); // Stop is needed because we sent no content length
     return true;
   }
   return false;
@@ -45,32 +45,37 @@ void handleWifi() {
 
   String Page;
   Page += F(
-      "<!DOCTYPE html><html lang='en'><head>"
-      "<meta name='viewport' content='width=device-width'>"
-      "<title>CaptivePortal</title></head><body>"
-      "<h1>Wifi config</h1>");
+            "<!DOCTYPE html><html lang='en'><head>"
+            "<meta name='viewport' content='width=device-width'>"
+            "<title>CaptivePortal</title></head><body>"
+            "<h1>Wifi config</h1>");
   if (server.client().localIP() == apIP) {
     Page += String(F("<p>You are connected through the soft AP: ")) + softAP_ssid + F("</p>");
   } else {
     Page += String(F("<p>You are connected through the wifi network: ")) + ssid + F("</p>");
   }
-  Page += String(F(
-              "\r\n<br />"
-              "<table><tr><th align='left'>SoftAP config</th></tr>"
-              "<tr><td>SSID "))
-      + String(softAP_ssid) + F("</td></tr>"
-                                "<tr><td>IP ")
-      + toStringIp(WiFi.softAPIP()) + F("</td></tr>"
-                                        "</table>"
-                                        "\r\n<br />"
-                                        "<table><tr><th align='left'>WLAN config</th></tr>"
-                                        "<tr><td>SSID ")
-      + String(ssid) + F("</td></tr>"
-                         "<tr><td>IP ")
-      + toStringIp(WiFi.localIP()) + F("</td></tr>"
-                                       "</table>"
-                                       "\r\n<br />"
-                                       "<table><tr><th align='left'>WLAN list (refresh if any missing)</th></tr>");
+  Page +=
+    String(F(
+             "\r\n<br />"
+             "<table><tr><th align='left'>SoftAP config</th></tr>"
+             "<tr><td>SSID ")) +
+    String(softAP_ssid) +
+    F("</td></tr>"
+      "<tr><td>IP ") +
+    toStringIp(WiFi.softAPIP()) +
+    F("</td></tr>"
+      "</table>"
+      "\r\n<br />"
+      "<table><tr><th align='left'>WLAN config</th></tr>"
+      "<tr><td>SSID ") +
+    String(ssid) +
+    F("</td></tr>"
+      "<tr><td>IP ") +
+    toStringIp(WiFi.localIP()) +
+    F("</td></tr>"
+      "</table>"
+      "\r\n<br />"
+      "<table><tr><th align='left'>WLAN list (refresh if any missing)</th></tr>");
   Serial.println("scan start");
   int n = WiFi.scanNetworks();
   Serial.println("scan done");
@@ -82,15 +87,15 @@ void handleWifi() {
     Page += F("<tr><td>No WLAN found</td></tr>");
   }
   Page += F(
-      "</table>"
-      "\r\n<br /><form method='POST' action='wifisave'><h4>Connect to network:</h4>"
-      "<input type='text' placeholder='network' name='n'/>"
-      "<br /><input type='password' placeholder='password' name='p'/>"
-      "<br /><input type='submit' value='Connect/Disconnect'/></form>"
-      "<p>You may want to <a href='/'>return to the home page</a>.</p>"
-      "</body></html>");
+            "</table>"
+            "\r\n<br /><form method='POST' action='wifisave'><h4>Connect to network:</h4>"
+            "<input type='text' placeholder='network' name='n'/>"
+            "<br /><input type='password' placeholder='password' name='p'/>"
+            "<br /><input type='submit' value='Connect/Disconnect'/></form>"
+            "<p>You may want to <a href='/'>return to the home page</a>.</p>"
+            "</body></html>");
   server.send(200, "text/html", Page);
-  server.client().stop();  // Stop is needed because we sent no content length
+  server.client().stop(); // Stop is needed because we sent no content length
 }
 
 /** Handle the WLAN save form and redirect to WLAN config page again */
@@ -102,14 +107,14 @@ void handleWifiSave() {
   server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
   server.sendHeader("Pragma", "no-cache");
   server.sendHeader("Expires", "-1");
-  server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to close the socket ourselves.
-  server.client().stop();              // Stop is needed because we sent no content length
+  server.send(302, "text/plain", "");    // Empty content inhibits Content-length header so we have to close the socket ourselves.
+  server.client().stop(); // Stop is needed because we sent no content length
   saveCredentials();
-  connect = strlen(ssid) > 0;  // Request WLAN connect with new credentials if there is a SSID
+  connect = strlen(ssid) > 0; // Request WLAN connect with new credentials if there is a SSID
 }
 
 void handleNotFound() {
-  if (captivePortal()) {  // If caprive portal redirect instead of displaying the error page.
+  if (captivePortal()) { // If caprive portal redirect instead of displaying the error page.
     return;
   }
   String message = F("File Not Found\n\n");
diff --git a/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino b/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
index 85190df74d..21a97172ef 100644
--- a/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
@@ -17,6 +17,7 @@
 ESP8266WiFiMulti WiFiMulti;
 
 void setup() {
+
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -32,11 +33,13 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP("SSID", "PASSWORD");
+
 }
 
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
+
     WiFiClient client;
 
     HTTPClient http;
@@ -44,6 +47,7 @@ void loop() {
     Serial.print("[HTTP] begin...\n");
     if (http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html")) {  // HTTP
 
+
       Serial.print("[HTTP] GET...\n");
       // start connection and send HTTP header
       int httpCode = http.GET();
diff --git a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
index 4a3618962d..aaa4af2b4d 100644
--- a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
@@ -14,11 +14,12 @@
 
 #include <WiFiClientSecureBearSSL.h>
 // Fingerprint for demo URL, expires on June 2, 2021, needs to be updated well before this date
-const uint8_t fingerprint[20] = { 0x40, 0xaf, 0x00, 0x6b, 0xec, 0x90, 0x22, 0x41, 0x8e, 0xa3, 0xad, 0xfa, 0x1a, 0xe8, 0x25, 0x41, 0x1d, 0x1a, 0x54, 0xb3 };
+const uint8_t fingerprint[20] = {0x40, 0xaf, 0x00, 0x6b, 0xec, 0x90, 0x22, 0x41, 0x8e, 0xa3, 0xad, 0xfa, 0x1a, 0xe8, 0x25, 0x41, 0x1d, 0x1a, 0x54, 0xb3};
 
 ESP8266WiFiMulti WiFiMulti;
 
 void setup() {
+
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -39,7 +40,8 @@ void setup() {
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
-    std::unique_ptr<BearSSL::WiFiClientSecure> client(new BearSSL::WiFiClientSecure);
+
+    std::unique_ptr<BearSSL::WiFiClientSecure>client(new BearSSL::WiFiClientSecure);
 
     client->setFingerprint(fingerprint);
     // Or, if you happy to ignore the SSL certificate, then use the following line instead:
diff --git a/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino b/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
index 8786bd09a5..db8fe8cbd4 100644
--- a/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
+++ b/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
@@ -13,17 +13,17 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid         = STASSID;
+const char* ssid = STASSID;
 const char* ssidPassword = STAPSK;
 
-const char* username = "admin";
-const char* password = "admin";
+const char *username = "admin";
+const char *password = "admin";
 
-const char* server = "http://httpbin.org";
-const char* uri    = "/digest-auth/auth/admin/admin/MD5";
+const char *server = "http://httpbin.org";
+const char *uri = "/digest-auth/auth/admin/admin/MD5";
 
 String exractParam(String& authReq, const String& param, const char delimit) {
   int _begin = authReq.indexOf(param);
@@ -34,9 +34,10 @@ String exractParam(String& authReq, const String& param, const char delimit) {
 }
 
 String getCNonce(const int len) {
-  static const char alphanum[] = "0123456789"
-                                 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-                                 "abcdefghijklmnopqrstuvwxyz";
+  static const char alphanum[] =
+    "0123456789"
+    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+    "abcdefghijklmnopqrstuvwxyz";
   String s = "";
 
   for (int i = 0; i < len; ++i) {
@@ -48,8 +49,8 @@ String getCNonce(const int len) {
 
 String getDigestAuth(String& authReq, const String& username, const String& password, const String& method, const String& uri, unsigned int counter) {
   // extracting required parameters for RFC 2069 simpler Digest
-  String realm  = exractParam(authReq, "realm=\"", '"');
-  String nonce  = exractParam(authReq, "nonce=\"", '"');
+  String realm = exractParam(authReq, "realm=\"", '"');
+  String nonce = exractParam(authReq, "nonce=\"", '"');
   String cNonce = getCNonce(8);
 
   char nc[9];
@@ -72,7 +73,8 @@ String getDigestAuth(String& authReq, const String& username, const String& pass
   md5.calculate();
   String response = md5.toString();
 
-  String authorization = "Digest username=\"" + username + "\", realm=\"" + realm + "\", nonce=\"" + nonce + "\", uri=\"" + uri + "\", algorithm=\"MD5\", qop=auth, nc=" + String(nc) + ", cnonce=\"" + cNonce + "\", response=\"" + response + "\"";
+  String authorization = "Digest username=\"" + username + "\", realm=\"" + realm + "\", nonce=\"" + nonce +
+                         "\", uri=\"" + uri + "\", algorithm=\"MD5\", qop=auth, nc=" + String(nc) + ", cnonce=\"" + cNonce + "\", response=\"" + response + "\"";
   Serial.println(authorization);
 
   return authorization;
@@ -98,14 +100,15 @@ void setup() {
 
 void loop() {
   WiFiClient client;
-  HTTPClient http;  //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
+  HTTPClient http; //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
 
   Serial.print("[HTTP] begin...\n");
 
   // configure traged server and url
   http.begin(client, String(server) + String(uri));
 
-  const char* keys[] = { "WWW-Authenticate" };
+
+  const char *keys[] = {"WWW-Authenticate"};
   http.collectHeaders(keys, 1);
 
   Serial.print("[HTTP] GET...\n");
diff --git a/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino b/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
index 04648a56eb..936e235eeb 100644
--- a/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
@@ -20,10 +20,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
 void setup() {
+
   Serial.begin(115200);
 
   Serial.println();
@@ -39,17 +40,19 @@ void setup() {
   Serial.println("");
   Serial.print("Connected! IP address: ");
   Serial.println(WiFi.localIP());
+
 }
 
 void loop() {
   // wait for WiFi connection
   if ((WiFi.status() == WL_CONNECTED)) {
+
     WiFiClient client;
     HTTPClient http;
 
     Serial.print("[HTTP] begin...\n");
     // configure traged server and url
-    http.begin(client, "http://" SERVER_IP "/postplain/");  //HTTP
+    http.begin(client, "http://" SERVER_IP "/postplain/"); //HTTP
     http.addHeader("Content-Type", "application/json");
 
     Serial.print("[HTTP] POST...\n");
diff --git a/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino b/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
index 2f0961f645..42a89beced 100644
--- a/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
+++ b/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
@@ -6,13 +6,14 @@
    This example reuses the http connection and also restores the connection if the connection is lost
 */
 
+
 #include <ESP8266WiFi.h>
 #include <ESP8266WiFiMulti.h>
 #include <ESP8266HTTPClient.h>
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
 ESP8266WiFiMulti WiFiMulti;
@@ -21,6 +22,7 @@ HTTPClient http;
 WiFiClient client;
 
 void setup() {
+
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -41,6 +43,7 @@ void setup() {
   // allow reuse (if server supports it)
   http.setReuse(true);
 
+
   http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html");
   //http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
 }
diff --git a/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino b/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
index 397639b504..7e1593f52b 100644
--- a/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
@@ -15,6 +15,7 @@
 ESP8266WiFiMulti WiFiMulti;
 
 void setup() {
+
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -30,13 +31,15 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP("SSID", "PASSWORD");
+
 }
 
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
+
     WiFiClient client;
-    HTTPClient http;  //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
+    HTTPClient http; //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
 
     Serial.print("[HTTP] begin...\n");
 
@@ -53,6 +56,7 @@ void loop() {
 
       // file found at server
       if (httpCode == HTTP_CODE_OK) {
+
         // get length of document (is -1 when Server sends no Content-Length header)
         int len = http.getSize();
 
@@ -66,7 +70,7 @@ void loop() {
         // or "by hand"
 
         // get tcp stream
-        WiFiClient* stream = &client;
+        WiFiClient * stream = &client;
 
         // read all data from server
         while (http.connected() && (len > 0 || len == -1)) {
diff --git a/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
index cb280a3d27..8098986650 100644
--- a/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
@@ -15,6 +15,7 @@
 ESP8266WiFiMulti WiFiMulti;
 
 void setup() {
+
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -30,11 +31,13 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP("SSID", "PASSWORD");
+
 }
 
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
+
     std::unique_ptr<BearSSL::WiFiClientSecure> client(new BearSSL::WiFiClientSecure);
 
     bool mfln = client->probeMaxFragmentLength("tls.mbed.org", 443, 1024);
@@ -47,13 +50,14 @@ void loop() {
     Serial.print("[HTTPS] begin...\n");
 
     // configure server and url
-    const uint8_t fingerprint[20] = { 0x15, 0x77, 0xdc, 0x04, 0x7c, 0x00, 0xf8, 0x70, 0x09, 0x34, 0x24, 0xf4, 0xd3, 0xa1, 0x7a, 0x6c, 0x1e, 0xa3, 0xe0, 0x2a };
+    const uint8_t fingerprint[20] = {0x15, 0x77, 0xdc, 0x04, 0x7c, 0x00, 0xf8, 0x70, 0x09, 0x34, 0x24, 0xf4, 0xd3, 0xa1, 0x7a, 0x6c, 0x1e, 0xa3, 0xe0, 0x2a};
 
     client->setFingerprint(fingerprint);
 
     HTTPClient https;
 
     if (https.begin(*client, "https://tls.mbed.org/")) {
+
       Serial.print("[HTTPS] GET...\n");
       // start connection and send HTTP header
       int httpCode = https.GET();
@@ -63,6 +67,7 @@ void loop() {
 
         // file found at server
         if (httpCode == HTTP_CODE_OK) {
+
           // get length of document (is -1 when Server sends no Content-Length header)
           int len = https.getSize();
 
@@ -90,6 +95,7 @@ void loop() {
 
           Serial.println();
           Serial.print("[HTTPS] connection closed or file end.\n");
+
         }
       } else {
         Serial.printf("[HTTPS] GET... failed, error: %s\n", https.errorToString(httpCode).c_str());
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
index 0270fa9723..11e23a929d 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
@@ -10,20 +10,21 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* host            = "esp8266-webupdate";
-const char* update_path     = "/firmware";
+const char* host = "esp8266-webupdate";
+const char* update_path = "/firmware";
 const char* update_username = "admin";
 const char* update_password = "admin";
-const char* ssid            = STASSID;
-const char* password        = STAPSK;
+const char* ssid = STASSID;
+const char* password = STAPSK;
 
-ESP8266WebServer        httpServer(80);
+ESP8266WebServer httpServer(80);
 ESP8266HTTPUpdateServer httpUpdater;
 
 void setup(void) {
+
   Serial.begin(115200);
   Serial.println();
   Serial.println("Booting Sketch...");
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
index f7644aa683..fea3c4023a 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
@@ -10,17 +10,18 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* host     = "esp8266-webupdate";
-const char* ssid     = STASSID;
+const char* host = "esp8266-webupdate";
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
-ESP8266WebServer        httpServer(80);
+ESP8266WebServer httpServer(80);
 ESP8266HTTPUpdateServer httpUpdater;
 
 void setup(void) {
+
   Serial.begin(115200);
   Serial.println();
   Serial.println("Booting Sketch...");
diff --git a/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino b/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
index c29a76fe98..6b29bb5141 100644
--- a/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
+++ b/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
@@ -62,10 +62,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 ESP8266WebServer web_server(80);
diff --git a/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino b/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
old mode 100644
new mode 100755
index 22c8986fbf..57f5529850
--- a/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
+++ b/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
@@ -4,14 +4,14 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 ESP8266WebServer wwwserver(80);
-String           content;
+String content;
 
 static void handleRoot(void) {
   content = F("<!DOCTYPE HTML>\n<html>Hello world from ESP8266");
@@ -40,6 +40,7 @@ void setup() {
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
+
   wwwserver.on("/", handleRoot);
   wwwserver.begin();
 
diff --git a/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino b/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
index cf11a89012..2fc8508ca0 100644
--- a/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
+++ b/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
@@ -35,11 +35,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
-const char* password = STAPSK;
+const char *ssid = STASSID;
+const char *password = STAPSK;
 
 ESP8266WebServer server(80);
 
@@ -48,9 +48,9 @@ const int led = 13;
 void handleRoot() {
   digitalWrite(led, 1);
   char temp[400];
-  int  sec = millis() / 1000;
-  int  min = sec / 60;
-  int  hr  = min / 60;
+  int sec = millis() / 1000;
+  int min = sec / 60;
+  int hr = min / 60;
 
   snprintf(temp, 400,
 
@@ -69,7 +69,8 @@ void handleRoot() {
   </body>\
 </html>",
 
-           hr, min % 60, sec % 60);
+           hr, min % 60, sec % 60
+          );
   server.send(200, "text/html", temp);
   digitalWrite(led, 0);
 }
@@ -138,7 +139,9 @@ void setup(void) {
 
   server.on("/", handleRoot);
   server.on("/test.svg", drawGraph);
-  server.on("/inline", []() { server.send(200, "text/plain", "this works as well"); });
+  server.on("/inline", []() {
+    server.send(200, "text/plain", "this works as well");
+  });
   server.onNotFound(handleNotFound);
   server.begin();
   Serial.println("HTTP server started");
@@ -148,3 +151,4 @@ void loop(void) {
   server.handleClient();
   MDNS.update();
 }
+
diff --git a/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino b/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
index c29c5bd162..39f69fe3ff 100644
--- a/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
+++ b/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
@@ -49,44 +49,45 @@
 
 #if defined USE_SPIFFS
 #include <FS.h>
-const char*   fsName           = "SPIFFS";
-FS*           fileSystem       = &SPIFFS;
-SPIFFSConfig  fileSystemConfig = SPIFFSConfig();
+const char* fsName = "SPIFFS";
+FS* fileSystem = &SPIFFS;
+SPIFFSConfig fileSystemConfig = SPIFFSConfig();
 #elif defined USE_LITTLEFS
 #include <LittleFS.h>
-const char*    fsName           = "LittleFS";
-FS*            fileSystem       = &LittleFS;
+const char* fsName = "LittleFS";
+FS* fileSystem = &LittleFS;
 LittleFSConfig fileSystemConfig = LittleFSConfig();
 #elif defined USE_SDFS
 #include <SDFS.h>
-const char* fsName           = "SDFS";
-FS*         fileSystem       = &SDFS;
-SDFSConfig  fileSystemConfig = SDFSConfig();
+const char* fsName = "SDFS";
+FS* fileSystem = &SDFS;
+SDFSConfig fileSystemConfig = SDFSConfig();
 // fileSystemConfig.setCSPin(chipSelectPin);
 #else
 #error Please select a filesystem first by uncommenting one of the "#define USE_xxx" lines at the beginning of the sketch.
 #endif
 
+
 #define DBG_OUTPUT_PORT Serial
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
-const char* host     = "fsbrowser";
+const char* host = "fsbrowser";
 
 ESP8266WebServer server(80);
 
 static bool fsOK;
-String      unsupportedFiles = String();
+String unsupportedFiles = String();
 
 File uploadFile;
 
-static const char TEXT_PLAIN[] PROGMEM     = "text/plain";
-static const char FS_INIT_ERROR[] PROGMEM  = "FS INIT ERROR";
+static const char TEXT_PLAIN[] PROGMEM = "text/plain";
+static const char FS_INIT_ERROR[] PROGMEM = "FS INIT ERROR";
 static const char FILE_NOT_FOUND[] PROGMEM = "FileNotFound";
 
 ////////////////////////////////
@@ -134,6 +135,7 @@ String checkForUnsupportedPath(String filename) {
 }
 #endif
 
+
 ////////////////////////////////
 // Request handlers
 
@@ -166,6 +168,7 @@ void handleStatus() {
   server.send(200, "application/json", json);
 }
 
+
 /*
    Return the list of files in the directory specified by the "dir" query string parameter.
    Also demonstrates the use of chunked responses.
@@ -239,6 +242,7 @@ void handleFileList() {
   server.chunkedResponseFinalize();
 }
 
+
 /*
    Read the given file from the filesystem and stream it back to the client
 */
@@ -276,6 +280,7 @@ bool handleFileRead(String path) {
   return false;
 }
 
+
 /*
    As some FS (e.g. LittleFS) delete the parent folder when the last child has been removed,
    return the path of the closest parent still existing
@@ -340,7 +345,7 @@ void handleFileCreate() {
       // Create a file
       File file = fileSystem->open(path, "w");
       if (file) {
-        file.write((const char*)0);
+        file.write((const char *)0);
         file.close();
       } else {
         return replyServerError(F("CREATE FAILED"));
@@ -374,6 +379,7 @@ void handleFileCreate() {
   }
 }
 
+
 /*
    Delete the file or folder designed by the given path.
    If it's a file, delete it.
@@ -384,7 +390,7 @@ void handleFileCreate() {
    Please don't do this on a production system.
 */
 void deleteRecursive(String path) {
-  File file  = fileSystem->open(path, "r");
+  File file = fileSystem->open(path, "r");
   bool isDir = file.isDirectory();
   file.close();
 
@@ -405,6 +411,7 @@ void deleteRecursive(String path) {
   fileSystem->rmdir(path);
 }
 
+
 /*
    Handle a file deletion request
    Operation      | req.responseText
@@ -470,6 +477,7 @@ void handleFileUpload() {
   }
 }
 
+
 /*
    The "Not Found" handler catches all URI not explicitly declared in code
    First try to find and return the requested file from the filesystem,
@@ -480,7 +488,7 @@ void handleNotFound() {
     return replyServerError(FPSTR(FS_INIT_ERROR));
   }
 
-  String uri = ESP8266WebServer::urlDecode(server.uri());  // required to read paths with blanks
+  String uri = ESP8266WebServer::urlDecode(server.uri()); // required to read paths with blanks
 
   if (handleFileRead(uri)) {
     return;
@@ -528,6 +536,7 @@ void handleGetEdit() {
 #else
   replyNotFound(FPSTR(FILE_NOT_FOUND));
 #endif
+
 }
 
 void setup(void) {
@@ -550,7 +559,7 @@ void setup(void) {
   Dir dir = fileSystem->openDir("");
   DBG_OUTPUT_PORT.println(F("List of files at root of filesystem:"));
   while (dir.next()) {
-    String error    = checkForUnsupportedPath(dir.fileName());
+    String error = checkForUnsupportedPath(dir.fileName());
     String fileInfo = dir.fileName() + (dir.isDirectory() ? " [DIR]" : String(" (") + dir.fileSize() + "b)");
     DBG_OUTPUT_PORT.println(error + fileInfo);
     if (error.length() > 0) {
@@ -600,15 +609,15 @@ void setup(void) {
   server.on("/edit", HTTP_GET, handleGetEdit);
 
   // Create file
-  server.on("/edit", HTTP_PUT, handleFileCreate);
+  server.on("/edit",  HTTP_PUT, handleFileCreate);
 
   // Delete file
-  server.on("/edit", HTTP_DELETE, handleFileDelete);
+  server.on("/edit",  HTTP_DELETE, handleFileDelete);
 
   // Upload file
   // - first callback is called after the request has ended with all parsed arguments
   // - second callback handles file upload at that location
-  server.on("/edit", HTTP_POST, replyOK, handleFileUpload);
+  server.on("/edit",  HTTP_POST, replyOK, handleFileUpload);
 
   // Default handler for all URIs not defined above
   // Use it to read files from filesystem
@@ -619,6 +628,7 @@ void setup(void) {
   DBG_OUTPUT_PORT.println("HTTP server started");
 }
 
+
 void loop(void) {
   server.handleClient();
   MDNS.update();
diff --git a/libraries/ESP8266WebServer/examples/Graph/Graph.ino b/libraries/ESP8266WebServer/examples/Graph/Graph.ino
index 6d2bf41f1a..b0eb5f847b 100644
--- a/libraries/ESP8266WebServer/examples/Graph/Graph.ino
+++ b/libraries/ESP8266WebServer/examples/Graph/Graph.ino
@@ -38,26 +38,27 @@
 
 #if defined USE_SPIFFS
 #include <FS.h>
-FS*           fileSystem       = &SPIFFS;
-SPIFFSConfig  fileSystemConfig = SPIFFSConfig();
+FS* fileSystem = &SPIFFS;
+SPIFFSConfig fileSystemConfig = SPIFFSConfig();
 #elif defined USE_LITTLEFS
 #include <LittleFS.h>
-FS*            fileSystem       = &LittleFS;
+FS* fileSystem = &LittleFS;
 LittleFSConfig fileSystemConfig = LittleFSConfig();
 #elif defined USE_SDFS
 #include <SDFS.h>
-FS*        fileSystem       = &SDFS;
+FS* fileSystem = &SDFS;
 SDFSConfig fileSystemConfig = SDFSConfig();
 // fileSystemConfig.setCSPin(chipSelectPin);
 #else
 #error Please select a filesystem first by uncommenting one of the "#define USE_xxx" lines at the beginning of the sketch.
 #endif
 
+
 #define DBG_OUTPUT_PORT Serial
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
 // Indicate which digital I/Os should be displayed on the chart.
@@ -65,14 +66,14 @@ SDFSConfig fileSystemConfig = SDFSConfig();
 // e.g. 0b11111000000111111
 unsigned int gpioMask;
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
-const char* host     = "graph";
+const char* host = "graph";
 
 ESP8266WebServer server(80);
 
-static const char TEXT_PLAIN[] PROGMEM     = "text/plain";
-static const char FS_INIT_ERROR[] PROGMEM  = "FS INIT ERROR";
+static const char TEXT_PLAIN[] PROGMEM = "text/plain";
+static const char FS_INIT_ERROR[] PROGMEM = "FS INIT ERROR";
 static const char FILE_NOT_FOUND[] PROGMEM = "FileNotFound";
 
 ////////////////////////////////
@@ -131,13 +132,14 @@ bool handleFileRead(String path) {
   return false;
 }
 
+
 /*
    The "Not Found" handler catches all URI not explicitly declared in code
    First try to find and return the requested file from the filesystem,
    and if it fails, return a 404 page with debug information
 */
 void handleNotFound() {
-  String uri = ESP8266WebServer::urlDecode(server.uri());  // required to read paths with blanks
+  String uri = ESP8266WebServer::urlDecode(server.uri()); // required to read paths with blanks
 
   if (handleFileRead(uri)) {
     return;
@@ -238,6 +240,7 @@ void setup(void) {
   // Use it to read files from filesystem
   server.onNotFound(handleNotFound);
 
+
   // Start server
   server.begin();
   DBG_OUTPUT_PORT.println("HTTP server started");
@@ -246,6 +249,7 @@ void setup(void) {
   DBG_OUTPUT_PORT.println(" 0 (OFF):    outputs are off and hidden from chart");
   DBG_OUTPUT_PORT.println(" 1 (AUTO):   outputs are rotated automatically every second");
   DBG_OUTPUT_PORT.println(" 2 (MANUAL): outputs can be toggled from the web page");
+
 }
 
 // Return default GPIO mask, that is all I/Os except SD card ones
@@ -259,10 +263,10 @@ unsigned int defaultMask() {
   return mask;
 }
 
-int                                rgbMode  = 1;  // 0=off - 1=auto - 2=manual
-int                                rgbValue = 0;
+int rgbMode = 1; // 0=off - 1=auto - 2=manual
+int rgbValue = 0;
 esp8266::polledTimeout::periodicMs timeToChange(1000);
-bool                               modeChangeRequested = false;
+bool modeChangeRequested = false;
 
 void loop(void) {
   server.handleClient();
@@ -291,11 +295,11 @@ void loop(void) {
 
   // act according to mode
   switch (rgbMode) {
-    case 0:  // off
+    case 0: // off
       gpioMask = defaultMask();
-      gpioMask &= ~(1 << 12);  // Hide GPIO 12
-      gpioMask &= ~(1 << 13);  // Hide GPIO 13
-      gpioMask &= ~(1 << 15);  // Hide GPIO 15
+      gpioMask &= ~(1 << 12); // Hide GPIO 12
+      gpioMask &= ~(1 << 13); // Hide GPIO 13
+      gpioMask &= ~(1 << 15); // Hide GPIO 15
 
       // reset outputs
       digitalWrite(12, 0);
@@ -303,7 +307,7 @@ void loop(void) {
       digitalWrite(15, 0);
       break;
 
-    case 1:  // auto
+    case 1: // auto
       gpioMask = defaultMask();
 
       // increment value (reset after 7)
@@ -318,10 +322,11 @@ void loop(void) {
       digitalWrite(15, rgbValue & 0b100);
       break;
 
-    case 2:  // manual
+    case 2: // manual
       gpioMask = defaultMask();
 
       // keep outputs unchanged
       break;
   }
 }
+
diff --git a/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino b/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
index e82f1af4d8..7fdee1667a 100644
--- a/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
+++ b/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
@@ -5,10 +5,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 ESP8266WebServer server(80);
@@ -63,7 +63,9 @@ void setup(void) {
 
   server.on("/", handleRoot);
 
-  server.on("/inline", []() { server.send(200, "text/plain", "this works as well"); });
+  server.on("/inline", []() {
+    server.send(200, "text/plain", "this works as well");
+  });
 
   server.on("/gif", []() {
     static const uint8_t gif[] PROGMEM = {
@@ -87,17 +89,17 @@ void setup(void) {
   /////////////////////////////////////////////////////////
   // Hook examples
 
-  server.addHook([](const String& method, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction contentType) {
-    (void)method;       // GET, PUT, ...
-    (void)url;          // example: /root/myfile.html
-    (void)client;       // the webserver tcp client connection
-    (void)contentType;  // contentType(".html") => "text/html"
+  server.addHook([](const String & method, const String & url, WiFiClient * client, ESP8266WebServer::ContentTypeFunction contentType) {
+    (void)method;      // GET, PUT, ...
+    (void)url;         // example: /root/myfile.html
+    (void)client;      // the webserver tcp client connection
+    (void)contentType; // contentType(".html") => "text/html"
     Serial.printf("A useless web hook has passed\n");
     Serial.printf("(this hook is in 0x%08x area (401x=IRAM 402x=FLASH))\n", esp_get_program_counter());
     return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
   });
 
-  server.addHook([](const String&, const String& url, WiFiClient*, ESP8266WebServer::ContentTypeFunction) {
+  server.addHook([](const String&, const String & url, WiFiClient*, ESP8266WebServer::ContentTypeFunction) {
     if (url.startsWith("/fail")) {
       Serial.printf("An always failing web hook has been triggered\n");
       return ESP8266WebServer::CLIENT_MUST_STOP;
@@ -105,7 +107,7 @@ void setup(void) {
     return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
   });
 
-  server.addHook([](const String&, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction) {
+  server.addHook([](const String&, const String & url, WiFiClient * client, ESP8266WebServer::ContentTypeFunction) {
     if (url.startsWith("/dump")) {
       Serial.printf("The dumper web hook is on the run\n");
 
@@ -119,7 +121,7 @@ void setup(void) {
 #else
       auto last = millis();
       while ((millis() - last) < 500) {
-        char   buf[32];
+        char buf[32];
         size_t len = client->read((uint8_t*)buf, sizeof(buf));
         if (len > 0) {
           Serial.printf("(<%d> chars)", (int)len);
@@ -135,7 +137,7 @@ void setup(void) {
       // check the client connection: it should not immediately be closed
       // (make another '/dump' one to close the first)
       Serial.printf("\nTelling server to forget this connection\n");
-      static WiFiClient forgetme = *client;  // stop previous one if present and transfer client refcounter
+      static WiFiClient forgetme = *client; // stop previous one if present and transfer client refcounter
       return ESP8266WebServer::CLIENT_IS_GIVEN;
     }
     return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
diff --git a/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino b/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
index 7b5b8cf831..857048cf0b 100644
--- a/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
@@ -11,10 +11,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 ESP8266WebServer server(80);
@@ -39,13 +39,13 @@ void setup() {
 
   server.on("/", []() {
     if (!server.authenticate(www_username, www_password))
-    //Basic Auth Method with Custom realm and Failure Response
-    //return server.requestAuthentication(BASIC_AUTH, www_realm, authFailResponse);
-    //Digest Auth Method with realm="Login Required" and empty Failure Response
-    //return server.requestAuthentication(DIGEST_AUTH);
-    //Digest Auth Method with Custom realm and empty Failure Response
-    //return server.requestAuthentication(DIGEST_AUTH, www_realm);
-    //Digest Auth Method with Custom realm and Failure Response
+      //Basic Auth Method with Custom realm and Failure Response
+      //return server.requestAuthentication(BASIC_AUTH, www_realm, authFailResponse);
+      //Digest Auth Method with realm="Login Required" and empty Failure Response
+      //return server.requestAuthentication(DIGEST_AUTH);
+      //Digest Auth Method with Custom realm and empty Failure Response
+      //return server.requestAuthentication(DIGEST_AUTH, www_realm);
+      //Digest Auth Method with Custom realm and Failure Response
     {
       return server.requestAuthentication(DIGEST_AUTH, www_realm, authFailResponse);
     }
diff --git a/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino b/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
index f71e4deb67..c2ceaca53d 100644
--- a/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
@@ -18,14 +18,14 @@
 //Unfortunately it is not possible to have persistent WiFi credentials stored as anything but plain text. Obfuscation would be the only feasible barrier.
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid    = STASSID;
+const char* ssid = STASSID;
 const char* wifi_pw = STAPSK;
 
-const String file_credentials = R"(/credentials.txt)";  // LittleFS file name for the saved credentials
-const String change_creds     = "changecreds";          // Address for a credential change
+const String file_credentials = R"(/credentials.txt)"; // LittleFS file name for the saved credentials
+const String change_creds =  "changecreds";            // Address for a credential change
 
 //The ESP8266WebServerSecure requires an encryption certificate and matching key.
 //These can generated with the bash script available in the ESP8266 Arduino repository.
@@ -52,7 +52,7 @@ JfUvYadSYxh3nblvA4OL+iEZiW8NE3hbW6WPXxvS7Euge0uWMPc4uEcnsE0ZVG3m
 5tAF1D5vAAwA8nfPysumlLsIjohJZo4lgnhB++AlOg==
 -----END CERTIFICATE-----
 )EOF";
-static const char serverKey[] PROGMEM  = R"EOF(
+static const char serverKey[] PROGMEM =  R"EOF(
 -----BEGIN RSA PRIVATE KEY-----
 MIIEpQIBAAKCAQEA9UoHBtn4oNKXjRgIOQ/rLxK/iI0a8Q5mDxhfuwa9//FkftSI
 IFY8UhGk2YNJpnfKOyYWqbqwuJhIZJ2sEIWp2301OnavuGBrpKOgBJJljgH2l/4Z
@@ -85,19 +85,19 @@ gz5JWYhbD6c38khSzJb0pNXCo3EuYAVa36kDM96k1BtWuhRS10Q1VXk=
 ESP8266WebServerSecure server(443);
 
 //These are temporary credentials that will only be used if none are found saved in LittleFS.
-String       login                 = "admin";
-const String realm                 = "global";
-String       H1                    = "";
-String       authentication_failed = "User authentication has failed.";
+String login = "admin";
+const String realm = "global";
+String H1 = "";
+String authentication_failed = "User authentication has failed.";
 
 void setup() {
   Serial.begin(115200);
 
   //Initialize LittleFS to save credentials
-  if (!LittleFS.begin()) {
-    Serial.println("LittleFS initialization error, programmer flash configured?");
+  if(!LittleFS.begin()){
+		Serial.println("LittleFS initialization error, programmer flash configured?");
     ESP.restart();
-  }
+	}
 
   //Attempt to load credentials. If the file does not yet exist, they will be set to the default values above
   loadcredentials();
@@ -112,8 +112,8 @@ void setup() {
   }
 
   server.getServer().setRSACert(new BearSSL::X509List(serverCert), new BearSSL::PrivateKey(serverKey));
-  server.on("/", showcredentialpage);                     //for this simple example, just show a simple page for changing credentials at the root
-  server.on("/" + change_creds, handlecredentialchange);  //handles submission of credentials from the client
+  server.on("/",showcredentialpage); //for this simple example, just show a simple page for changing credentials at the root
+  server.on("/" + change_creds,handlecredentialchange); //handles submission of credentials from the client
   server.onNotFound(redirect);
   server.begin();
 
@@ -128,35 +128,35 @@ void loop() {
 }
 
 //This function redirects home
-void redirect() {
+void redirect(){
   String url = "https://" + WiFi.localIP().toString();
   Serial.println("Redirect called. Redirecting to " + url);
   server.sendHeader("Location", url, true);
   Serial.println("Header sent.");
-  server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to close the socket ourselves.
+  server.send( 302, "text/plain", ""); // Empty content inhibits Content-length header so we have to close the socket ourselves.
   Serial.println("Empty page sent.");
-  server.client().stop();  // Stop is needed because we sent no content length
+  server.client().stop(); // Stop is needed because we sent no content length
   Serial.println("Client stopped.");
 }
 
 //This function checks whether the current session has been authenticated. If not, a request for credentials is sent.
 bool session_authenticated() {
   Serial.println("Checking authentication.");
-  if (server.authenticateDigest(login, H1)) {
+  if (server.authenticateDigest(login,H1)) {
     Serial.println("Authentication confirmed.");
     return true;
-  } else {
+  } else  {
     Serial.println("Not authenticated. Requesting credentials.");
-    server.requestAuthentication(DIGEST_AUTH, realm.c_str(), authentication_failed);
+    server.requestAuthentication(DIGEST_AUTH,realm.c_str(),authentication_failed);
     redirect();
     return false;
   }
 }
 
 //This function sends a simple webpage for changing login credentials to the client
-void showcredentialpage() {
+void showcredentialpage(){
   Serial.println("Show credential page called.");
-  if (!session_authenticated()) {
+  if(!session_authenticated()){
     return;
   }
 
@@ -165,12 +165,11 @@ void showcredentialpage() {
   String page;
   page = R"(<html>)";
 
-  page +=
-      R"(
+  page+=
+  R"(
   <h2>Login Credentials</h2><br>
 
-  <form action=")"
-      + change_creds + R"(" method="post">
+  <form action=")" + change_creds + R"(" method="post">
   Login:<br>
   <input type="text" name="login"><br>
   Password:<br>
@@ -179,7 +178,8 @@ void showcredentialpage() {
   <input type="password" name="password_duplicate"><br>
   <p><button type="submit" name="newcredentials">Change Credentials</button></p>
   </form><br>
-  )";
+  )"
+  ;
 
   page += R"(</html>)";
 
@@ -189,15 +189,16 @@ void showcredentialpage() {
 }
 
 //Saves credentials to LittleFS
-void savecredentials(String new_login, String new_password) {
+void savecredentials(String new_login, String new_password)
+{
   //Set global variables to new values
-  login = new_login;
-  H1    = ESP8266WebServer::credentialHash(new_login, realm, new_password);
+  login=new_login;
+  H1=ESP8266WebServer::credentialHash(new_login,realm,new_password);
 
   //Save new values to LittleFS for loading on next reboot
   Serial.println("Saving credentials.");
-  File f = LittleFS.open(file_credentials, "w");  //open as a brand new file, discard old contents
-  if (f) {
+  File f=LittleFS.open(file_credentials,"w"); //open as a brand new file, discard old contents
+  if(f){
     Serial.println("Modifying credentials in file system.");
     f.println(login);
     f.println(H1);
@@ -209,44 +210,46 @@ void savecredentials(String new_login, String new_password) {
 }
 
 //loads credentials from LittleFS
-void loadcredentials() {
+void loadcredentials()
+{
   Serial.println("Searching for credentials.");
   File f;
-  f = LittleFS.open(file_credentials, "r");
-  if (f) {
+  f=LittleFS.open(file_credentials,"r");
+  if(f){
     Serial.println("Loading credentials from file system.");
-    String mod     = f.readString();                           //read the file to a String
-    int    index_1 = mod.indexOf('\n', 0);                     //locate the first line break
-    int    index_2 = mod.indexOf('\n', index_1 + 1);           //locate the second line break
-    login          = mod.substring(0, index_1 - 1);            //get the first line (excluding the line break)
-    H1             = mod.substring(index_1 + 1, index_2 - 1);  //get the second line (excluding the line break)
+    String mod=f.readString(); //read the file to a String
+    int index_1=mod.indexOf('\n',0); //locate the first line break
+    int index_2=mod.indexOf('\n',index_1+1); //locate the second line break
+    login=mod.substring(0,index_1-1); //get the first line (excluding the line break)
+    H1=mod.substring(index_1+1,index_2-1); //get the second line (excluding the line break)
     f.close();
   } else {
-    String default_login    = "admin";
+    String default_login = "admin";
     String default_password = "changeme";
     Serial.println("None found. Setting to default credentials.");
     Serial.println("user:" + default_login);
     Serial.println("password:" + default_password);
-    login = default_login;
-    H1    = ESP8266WebServer::credentialHash(default_login, realm, default_password);
+    login=default_login;
+    H1=ESP8266WebServer::credentialHash(default_login,realm,default_password);
   }
 }
 
 //This function handles a credential change from a client.
 void handlecredentialchange() {
   Serial.println("Handle credential change called.");
-  if (!session_authenticated()) {
+  if(!session_authenticated()){
     return;
   }
 
   Serial.println("Handling credential change request from client.");
 
   String login = server.arg("login");
-  String pw1   = server.arg("password");
-  String pw2   = server.arg("password_duplicate");
+  String pw1 = server.arg("password");
+  String pw2 = server.arg("password_duplicate");
+
+  if(login != "" && pw1 != "" && pw1 == pw2){
 
-  if (login != "" && pw1 != "" && pw1 == pw2) {
-    savecredentials(login, pw1);
+    savecredentials(login,pw1);
     server.send(200, "text/plain", "Credentials updated");
     redirect();
   } else {
diff --git a/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino b/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
index ff88a97158..dc998986e5 100644
--- a/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
+++ b/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
@@ -8,11 +8,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
-const char* password = STAPSK;
+const char *ssid = STASSID;
+const char *password = STAPSK;
 
 ESP8266WebServer server(80);
 
@@ -37,7 +37,9 @@ void setup(void) {
     Serial.println("MDNS responder started");
   }
 
-  server.on(F("/"), []() { server.send(200, "text/plain", "hello from esp8266!"); });
+  server.on(F("/"), []() {
+    server.send(200, "text/plain", "hello from esp8266!");
+  });
 
   server.on(UriBraces("/users/{}"), []() {
     String user = server.pathArg(0);
@@ -45,7 +47,7 @@ void setup(void) {
   });
 
   server.on(UriRegex("^\\/users\\/([0-9]+)\\/devices\\/([0-9]+)$"), []() {
-    String user   = server.pathArg(0);
+    String user = server.pathArg(0);
     String device = server.pathArg(1);
     server.send(200, "text/plain", "User: '" + user + "' and Device: '" + device + "'");
   });
diff --git a/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino b/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
index d61675d23f..da1703807a 100644
--- a/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
+++ b/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
@@ -5,7 +5,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
 const char* ssid     = STASSID;
diff --git a/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino b/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
index 1b9c421f26..77ae1e958e 100644
--- a/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
+++ b/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
@@ -42,28 +42,27 @@ extern "C" {
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char*        ssid     = STASSID;
-const char*        password = STAPSK;
-const unsigned int port     = 80;
+const char* ssid = STASSID;
+const char* password = STAPSK;
+const unsigned int port = 80;
 
 ESP8266WebServer server(port);
 
 #define SSE_MAX_CHANNELS 8  // in this simplified example, only eight SSE clients subscription allowed
 struct SSESubscription {
-  IPAddress  clientIP;
+  IPAddress clientIP;
   WiFiClient client;
-  Ticker     keepAliveTimer;
+  Ticker keepAliveTimer;
 } subscription[SSE_MAX_CHANNELS];
 uint8_t subscriptionCount = 0;
 
-typedef struct
-{
-  const char*    name;
+typedef struct {
+  const char *name;
   unsigned short value;
-  Ticker         update;
+  Ticker update;
 } sensorType;
 sensorType sensor[2];
 
@@ -90,7 +89,7 @@ void SSEKeepAlive() {
     }
     if (subscription[i].client.connected()) {
       Serial.printf_P(PSTR("SSEKeepAlive - client is still listening on channel %d\n"), i);
-      subscription[i].client.println(F("event: event\ndata: { \"TYPE\":\"KEEP-ALIVE\" }\n"));  // Extra newline required by SSE standard
+      subscription[i].client.println(F("event: event\ndata: { \"TYPE\":\"KEEP-ALIVE\" }\n"));   // Extra newline required by SSE standard
     } else {
       Serial.printf_P(PSTR("SSEKeepAlive - client not listening on channel %d, remove subscription\n"), i);
       subscription[i].keepAliveTimer.detach();
@@ -105,28 +104,28 @@ void SSEKeepAlive() {
 // SSEHandler handles the client connection to the event bus (client event listener)
 // every 60 seconds it sends a keep alive event via Ticker
 void SSEHandler(uint8_t channel) {
-  WiFiClient       client = server.client();
-  SSESubscription& s      = subscription[channel];
-  if (s.clientIP != client.remoteIP()) {  // IP addresses don't match, reject this client
+  WiFiClient client = server.client();
+  SSESubscription &s = subscription[channel];
+  if (s.clientIP != client.remoteIP()) { // IP addresses don't match, reject this client
     Serial.printf_P(PSTR("SSEHandler - unregistered client with IP %s tries to listen\n"), server.client().remoteIP().toString().c_str());
     return handleNotFound();
   }
   client.setNoDelay(true);
   client.setSync(true);
   Serial.printf_P(PSTR("SSEHandler - registered client with IP %s is listening\n"), IPAddress(s.clientIP).toString().c_str());
-  s.client = client;                                // capture SSE server client connection
-  server.setContentLength(CONTENT_LENGTH_UNKNOWN);  // the payload can go on forever
+  s.client = client; // capture SSE server client connection
+  server.setContentLength(CONTENT_LENGTH_UNKNOWN); // the payload can go on forever
   server.sendContent_P(PSTR("HTTP/1.1 200 OK\nContent-Type: text/event-stream;\nConnection: keep-alive\nCache-Control: no-cache\nAccess-Control-Allow-Origin: *\n\n"));
   s.keepAliveTimer.attach_scheduled(30.0, SSEKeepAlive);  // Refresh time every 30s for demo
 }
 
 void handleAll() {
-  const char* uri        = server.uri().c_str();
-  const char* restEvents = PSTR("/rest/events/");
+  const char *uri = server.uri().c_str();
+  const char *restEvents = PSTR("/rest/events/");
   if (strncmp_P(uri, restEvents, strlen_P(restEvents))) {
     return handleNotFound();
   }
-  uri += strlen_P(restEvents);  // Skip the "/rest/events/" and get to the channel number
+  uri += strlen_P(restEvents); // Skip the "/rest/events/" and get to the channel number
   unsigned int channel = atoi(uri);
   if (channel < SSE_MAX_CHANNELS) {
     return SSEHandler(channel);
@@ -134,7 +133,7 @@ void handleAll() {
   handleNotFound();
 };
 
-void SSEBroadcastState(const char* sensorName, unsigned short prevSensorValue, unsigned short sensorValue) {
+void SSEBroadcastState(const char *sensorName, unsigned short prevSensorValue, unsigned short sensorValue) {
   for (uint8_t i = 0; i < SSE_MAX_CHANNELS; i++) {
     if (!(subscription[i].clientIP)) {
       continue;
@@ -152,8 +151,8 @@ void SSEBroadcastState(const char* sensorName, unsigned short prevSensorValue, u
 }
 
 // Simulate sensors
-void updateSensor(sensorType& sensor) {
-  unsigned short newVal = (unsigned short)RANDOM_REG32;  // (not so good) random value for the sensor
+void updateSensor(sensorType &sensor) {
+  unsigned short newVal = (unsigned short)RANDOM_REG32; // (not so good) random value for the sensor
   Serial.printf_P(PSTR("update sensor %s - previous state: %d, new state: %d\n"), sensor.name, sensor.value, newVal);
   if (sensor.value != newVal) {
     SSEBroadcastState(sensor.name, sensor.value, newVal);  // only broadcast if state is different
@@ -167,9 +166,9 @@ void handleSubscribe() {
     return handleNotFound();  // We ran out of channels
   }
 
-  uint8_t   channel;
-  IPAddress clientIP = server.client().remoteIP();  // get IP address of client
-  String    SSEurl   = F("http://");
+  uint8_t channel;
+  IPAddress clientIP = server.client().remoteIP();   // get IP address of client
+  String SSEurl = F("http://");
   SSEurl += WiFi.localIP().toString();
   SSEurl += F(":");
   SSEurl += port;
@@ -177,11 +176,11 @@ void handleSubscribe() {
   SSEurl += F("/rest/events/");
 
   ++subscriptionCount;
-  for (channel = 0; channel < SSE_MAX_CHANNELS; channel++)  // Find first free slot
+  for (channel = 0; channel < SSE_MAX_CHANNELS; channel++) // Find first free slot
     if (!subscription[channel].clientIP) {
       break;
     }
-  subscription[channel] = { clientIP, server.client(), Ticker() };
+  subscription[channel] = {clientIP, server.client(), Ticker()};
   SSEurl += channel;
   Serial.printf_P(PSTR("Allocated channel %d, on uri %s\n"), channel, SSEurl.substring(offset).c_str());
   //server.on(SSEurl.substring(offset), std::bind(SSEHandler, &(subscription[channel])));
@@ -201,7 +200,7 @@ void setup(void) {
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
   Serial.println("");
-  while (WiFi.status() != WL_CONNECTED) {  // Wait for connection
+  while (WiFi.status() != WL_CONNECTED) {   // Wait for connection
     delay(500);
     Serial.print(".");
   }
@@ -210,7 +209,7 @@ void setup(void) {
     Serial.println("MDNS responder started");
   }
 
-  startServers();  // start web and SSE servers
+  startServers();   // start web and SSE servers
   sensor[0].name = "sensorA";
   sensor[1].name = "sensorB";
   updateSensor(sensor[0]);
diff --git a/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino b/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
index 937bb6daaf..2cba08fe9c 100644
--- a/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
+++ b/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
@@ -4,10 +4,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 ESP8266WebServer server(80);
@@ -45,7 +45,7 @@ void handleLogin() {
     return;
   }
   if (server.hasArg("USERNAME") && server.hasArg("PASSWORD")) {
-    if (server.arg("USERNAME") == "admin" && server.arg("PASSWORD") == "admin") {
+    if (server.arg("USERNAME") == "admin" &&  server.arg("PASSWORD") == "admin") {
       server.sendHeader("Location", "/");
       server.sendHeader("Cache-Control", "no-cache");
       server.sendHeader("Set-Cookie", "ESPSESSIONID=1");
@@ -115,9 +115,12 @@ void setup(void) {
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
+
   server.on("/", handleRoot);
   server.on("/login", handleLogin);
-  server.on("/inline", []() { server.send(200, "text/plain", "this works without need of authentication"); });
+  server.on("/inline", []() {
+    server.send(200, "text/plain", "this works without need of authentication");
+  });
 
   server.onNotFound(handleNotFound);
   //ask server to track these headers
diff --git a/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino b/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
index 79c8574531..08107586fd 100644
--- a/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
+++ b/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
@@ -9,10 +9,10 @@
 #include <Arduino.h>
 #include <ESP8266WebServer.h>
 
-#include "secrets.h"  // add WLAN Credentials in here.
+#include "secrets.h" // add WLAN Credentials in here.
 
-#include <FS.h>        // File System for Web Server Files
-#include <LittleFS.h>  // This file system is used.
+#include <FS.h>       // File System for Web Server Files
+#include <LittleFS.h> // This file system is used.
 
 // mark parameters not used in example
 #define UNUSED __attribute__((unused))
@@ -32,6 +32,7 @@ ESP8266WebServer server(80);
 // The text of builtin files are in this header file
 #include "builtinfiles.h"
 
+
 // ===== Simple functions used to answer simple GET requests =====
 
 // This function is called when the WebServer was requested without giving a filename.
@@ -46,12 +47,13 @@ void handleRedirect() {
 
   server.sendHeader("Location", url, true);
   server.send(302);
-}  // handleRedirect()
+} // handleRedirect()
+
 
 // This function is called when the WebServer was requested to list all existing files in the filesystem.
 // a JSON array with file information is returned.
 void handleListFiles() {
-  Dir    dir = LittleFS.openDir("/");
+  Dir dir = LittleFS.openDir("/");
   String result;
 
   result += "[\n";
@@ -65,11 +67,12 @@ void handleListFiles() {
     result += " \"time\": " + String(dir.fileTime());
     result += " }\n";
     // jc.addProperty("size", dir.fileSize());
-  }  // while
+  } // while
   result += "]";
   server.sendHeader("Cache-Control", "no-cache");
   server.send(200, "text/javascript; charset=utf-8", result);
-}  // handleListFiles()
+} // handleListFiles()
+
 
 // This function is called when the sysInfo service was requested.
 void handleSysInfo() {
@@ -87,87 +90,96 @@ void handleSysInfo() {
 
   server.sendHeader("Cache-Control", "no-cache");
   server.send(200, "text/javascript; charset=utf-8", result);
-}  // handleSysInfo()
+} // handleSysInfo()
+
 
 // ===== Request Handler class used to answer more complex requests =====
 
 // The FileServerHandler is registered to the web server to support DELETE and UPLOAD of files into the filesystem.
 class FileServerHandler : public RequestHandler {
   public:
-  // @brief Construct a new File Server Handler object
-  // @param fs The file system to be used.
-  // @param path Path to the root folder in the file system that is used for serving static data down and upload.
-  // @param cache_header Cache Header to be used in replies.
-  FileServerHandler() {
-    TRACE("FileServerHandler is registered\n");
-  }
-
-  // @brief check incoming request. Can handle POST for uploads and DELETE.
-  // @param requestMethod method of the http request line.
-  // @param requestUri request ressource from the http request line.
-  // @return true when method can be handled.
-  bool canHandle(HTTPMethod requestMethod, const String UNUSED& _uri) override {
-    return ((requestMethod == HTTP_POST) || (requestMethod == HTTP_DELETE));
-  }  // canHandle()
-
-  bool canUpload(const String& uri) override {
-    // only allow upload on root fs level.
-    return (uri == "/");
-  }  // canUpload()
-
-  bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, const String& requestUri) override {
-    // ensure that filename starts with '/'
-    String fName = requestUri;
-    if (!fName.startsWith("/")) {
-      fName = "/" + fName;
+    // @brief Construct a new File Server Handler object
+    // @param fs The file system to be used.
+    // @param path Path to the root folder in the file system that is used for serving static data down and upload.
+    // @param cache_header Cache Header to be used in replies.
+    FileServerHandler() {
+      TRACE("FileServerHandler is registered\n");
     }
 
-    if (requestMethod == HTTP_POST) {
-      // all done in upload. no other forms.
-    } else if (requestMethod == HTTP_DELETE) {
-      if (LittleFS.exists(fName)) {
-        LittleFS.remove(fName);
-      }
-    }  // if
-
-    server.send(200);  // all done.
-    return (true);
-  }  // handle()
-
-  // uploading process
-  void upload(ESP8266WebServer UNUSED& server, const String UNUSED& _requestUri, HTTPUpload& upload) override {
-    // ensure that filename starts with '/'
-    String fName = upload.filename;
-    if (!fName.startsWith("/")) {
-      fName = "/" + fName;
-    }
 
-    if (upload.status == UPLOAD_FILE_START) {
-      // Open the file
-      if (LittleFS.exists(fName)) {
-        LittleFS.remove(fName);
-      }  // if
-      _fsUploadFile = LittleFS.open(fName, "w");
-    } else if (upload.status == UPLOAD_FILE_WRITE) {
-      // Write received bytes
-      if (_fsUploadFile) {
-        _fsUploadFile.write(upload.buf, upload.currentSize);
+    // @brief check incoming request. Can handle POST for uploads and DELETE.
+    // @param requestMethod method of the http request line.
+    // @param requestUri request ressource from the http request line.
+    // @return true when method can be handled.
+    bool canHandle(HTTPMethod requestMethod, const String UNUSED &_uri) override {
+      return ((requestMethod == HTTP_POST) || (requestMethod == HTTP_DELETE));
+    } // canHandle()
+
+
+    bool canUpload(const String &uri) override {
+      // only allow upload on root fs level.
+      return (uri == "/");
+    } // canUpload()
+
+
+    bool handle(ESP8266WebServer &server, HTTPMethod requestMethod, const String &requestUri) override {
+      // ensure that filename starts with '/'
+      String fName = requestUri;
+      if (!fName.startsWith("/")) {
+        fName = "/" + fName;
       }
-    } else if (upload.status == UPLOAD_FILE_END) {
-      // Close the file
-      if (_fsUploadFile) {
-        _fsUploadFile.close();
+
+      if (requestMethod == HTTP_POST) {
+        // all done in upload. no other forms.
+
+      } else if (requestMethod == HTTP_DELETE) {
+        if (LittleFS.exists(fName)) {
+          LittleFS.remove(fName);
+        }
+      } // if
+
+      server.send(200); // all done.
+      return (true);
+    } // handle()
+
+
+    // uploading process
+    void upload(ESP8266WebServer UNUSED &server, const String UNUSED &_requestUri, HTTPUpload &upload) override {
+      // ensure that filename starts with '/'
+      String fName = upload.filename;
+      if (!fName.startsWith("/")) {
+        fName = "/" + fName;
       }
-    }  // if
-  }    // upload()
+
+      if (upload.status == UPLOAD_FILE_START) {
+        // Open the file
+        if (LittleFS.exists(fName)) {
+          LittleFS.remove(fName);
+        } // if
+        _fsUploadFile = LittleFS.open(fName, "w");
+
+      } else if (upload.status == UPLOAD_FILE_WRITE) {
+        // Write received bytes
+        if (_fsUploadFile) {
+          _fsUploadFile.write(upload.buf, upload.currentSize);
+        }
+
+      } else if (upload.status == UPLOAD_FILE_END) {
+        // Close the file
+        if (_fsUploadFile) {
+          _fsUploadFile.close();
+        }
+      } // if
+    }   // upload()
 
   protected:
-  File _fsUploadFile;
+    File _fsUploadFile;
 };
 
+
 // Setup everything to make the webserver work.
 void setup(void) {
-  delay(3000);  // wait for serial monitor to start completely.
+  delay(3000); // wait for serial monitor to start completely.
 
   // Use Serial port for some trace information from the example
   Serial.begin(115200);
@@ -207,7 +219,9 @@ void setup(void) {
   TRACE("Register service handlers...\n");
 
   // serve a built-in htm page
-  server.on("/$upload.htm", []() { server.send(200, "text/html", FPSTR(uploadContent)); });
+  server.on("/$upload.htm", []() {
+    server.send(200, "text/html", FPSTR(uploadContent));
+  });
 
   // register a redirect handler when only domain name is given.
   server.on("/", HTTP_GET, handleRedirect);
@@ -236,11 +250,12 @@ void setup(void) {
 
   server.begin();
   TRACE("hostname=%s\n", WiFi.getHostname());
-}  // setup
+} // setup
+
 
 // run the server...
 void loop(void) {
   server.handleClient();
-}  // loop()
+} // loop()
 
 // end.
diff --git a/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino b/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
index 19814e4b50..17646fd172 100644
--- a/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
+++ b/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
@@ -9,15 +9,15 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* host     = "esp8266-webupdate";
-const char* ssid     = STASSID;
+const char* host = "esp8266-webupdate";
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 ESP8266WebServer server(80);
-const char*      serverIndex = "<form method='POST' action='/update' enctype='multipart/form-data'><input type='file' name='update'><input type='submit' value='Update'></form>";
+const char* serverIndex = "<form method='POST' action='/update' enctype='multipart/form-data'><input type='file' name='update'><input type='submit' value='Update'></form>";
 
 void setup(void) {
   Serial.begin(115200);
@@ -31,35 +31,34 @@ void setup(void) {
       server.sendHeader("Connection", "close");
       server.send(200, "text/html", serverIndex);
     });
-    server.on(
-        "/update", HTTP_POST, []() {
-          server.sendHeader("Connection", "close");
-          server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
-          ESP.restart(); },
-        []() {
-          HTTPUpload& upload = server.upload();
-          if (upload.status == UPLOAD_FILE_START) {
-            Serial.setDebugOutput(true);
-            WiFiUDP::stopAll();
-            Serial.printf("Update: %s\n", upload.filename.c_str());
-            uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
-            if (!Update.begin(maxSketchSpace)) {  //start with max available size
-              Update.printError(Serial);
-            }
-          } else if (upload.status == UPLOAD_FILE_WRITE) {
-            if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
-              Update.printError(Serial);
-            }
-          } else if (upload.status == UPLOAD_FILE_END) {
-            if (Update.end(true)) {  //true to set the size to the current progress
-              Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
-            } else {
-              Update.printError(Serial);
-            }
-            Serial.setDebugOutput(false);
-          }
-          yield();
-        });
+    server.on("/update", HTTP_POST, []() {
+      server.sendHeader("Connection", "close");
+      server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
+      ESP.restart();
+    }, []() {
+      HTTPUpload& upload = server.upload();
+      if (upload.status == UPLOAD_FILE_START) {
+        Serial.setDebugOutput(true);
+        WiFiUDP::stopAll();
+        Serial.printf("Update: %s\n", upload.filename.c_str());
+        uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
+        if (!Update.begin(maxSketchSpace)) { //start with max available size
+          Update.printError(Serial);
+        }
+      } else if (upload.status == UPLOAD_FILE_WRITE) {
+        if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
+          Update.printError(Serial);
+        }
+      } else if (upload.status == UPLOAD_FILE_END) {
+        if (Update.end(true)) { //true to set the size to the current progress
+          Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
+        } else {
+          Update.printError(Serial);
+        }
+        Serial.setDebugOutput(false);
+      }
+      yield();
+    });
     server.begin();
     MDNS.addService("http", "tcp", 80);
 
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
index 6d9b8b3161..a599a0395a 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
@@ -41,11 +41,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* pass = STAPSK;
+const char *ssid = STASSID;
+const char *pass = STAPSK;
 
 // A single, global CertStore which can be used by all
 // connections.  Needs to stay live the entire time any of
@@ -71,7 +71,7 @@ void setClock() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump URL
-void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
+void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_t port, const char *path) {
   if (!path) {
     path = "/";
   }
@@ -100,7 +100,7 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
         break;
       }
       // Only print out first line up to \r, then abort connection
-      char* nl = strchr(tmp, '\r');
+      char *nl = strchr(tmp, '\r');
       if (nl) {
         *nl = 0;
         Serial.print(tmp);
@@ -136,16 +136,16 @@ void setup() {
   Serial.println("IP address: ");
   Serial.println(WiFi.localIP());
 
-  setClock();  // Required for X.509 validation
+  setClock(); // Required for X.509 validation
 
   int numCerts = certStore.initCertStore(LittleFS, PSTR("/certs.idx"), PSTR("/certs.ar"));
   Serial.printf("Number of CA certs read: %d\n", numCerts);
   if (numCerts == 0) {
     Serial.printf("No certs found. Did you run certs-from-mozilla.py and upload the LittleFS directory before running?\n");
-    return;  // Can't connect to anything w/o certs!
+    return; // Can't connect to anything w/o certs!
   }
 
-  BearSSL::WiFiClientSecure* bear = new BearSSL::WiFiClientSecure();
+  BearSSL::WiFiClientSecure *bear = new BearSSL::WiFiClientSecure();
   // Integrate the cert store with this connection
   bear->setCertStore(&certStore);
   Serial.printf("Attempting to fetch https://github.com/...\n");
@@ -164,9 +164,10 @@ void loop() {
   site.replace(String("\n"), emptyString);
   Serial.printf("https://%s/\n", site.c_str());
 
-  BearSSL::WiFiClientSecure* bear = new BearSSL::WiFiClientSecure();
+  BearSSL::WiFiClientSecure *bear = new BearSSL::WiFiClientSecure();
   // Integrate the cert store with this connection
   bear->setCertStore(&certStore);
   fetchURL(bear, site.c_str(), 443, "/");
   delete bear;
 }
+
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
index faba6838a6..40330725a1 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
@@ -39,11 +39,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* pass = STAPSK;
+const char *ssid = STASSID;
+const char *pass = STAPSK;
 
 // The HTTPS server
 BearSSL::WiFiServerSecure server(443);
@@ -138,24 +138,19 @@ GBEnkz4KpKv7TkHoW+j7F5EMcLcSrUIpyw==
 
 #endif
 
-// Number of sessions to cache.
-#define CACHE_SIZE 5
-
-// Enable SSL session caching.
+#define CACHE_SIZE 5 // Number of sessions to cache.
 // Caching SSL sessions shortens the length of the SSL handshake.
 // You can see the performance improvement by looking at the
 // Network tab of the developer tools of your browser.
-#define USE_CACHE
-
-// Whether to dynamically allocate the cache.
-//#define DYNAMIC_CACHE
+#define USE_CACHE // Enable SSL session caching.
+//#define DYNAMIC_CACHE // Whether to dynamically allocate the cache.
 
 #if defined(USE_CACHE) && defined(DYNAMIC_CACHE)
 // Dynamically allocated cache.
 BearSSL::ServerSessions serverCache(CACHE_SIZE);
 #elif defined(USE_CACHE)
 // Statically allocated cache.
-ServerSession           store[CACHE_SIZE];
+ServerSession store[CACHE_SIZE];
 BearSSL::ServerSessions serverCache(store, CACHE_SIZE);
 #endif
 
@@ -181,12 +176,12 @@ void setup() {
   Serial.println(WiFi.localIP());
 
   // Attach the server private cert/key combo
-  BearSSL::X509List*   serverCertList = new BearSSL::X509List(server_cert);
-  BearSSL::PrivateKey* serverPrivKey  = new BearSSL::PrivateKey(server_private_key);
+  BearSSL::X509List *serverCertList = new BearSSL::X509List(server_cert);
+  BearSSL::PrivateKey *serverPrivKey = new BearSSL::PrivateKey(server_private_key);
 #ifndef USE_EC
   server.setRSACert(serverCertList, serverPrivKey);
 #else
-  server.setECCert(serverCertList, BR_KEYTYPE_KEYX | BR_KEYTYPE_SIGN, serverPrivKey);
+  server.setECCert(serverCertList, BR_KEYTYPE_KEYX|BR_KEYTYPE_SIGN, serverPrivKey);
 #endif
 
   // Set the server's cache
@@ -198,30 +193,31 @@ void setup() {
   server.begin();
 }
 
-static const char* HTTP_RES = "HTTP/1.0 200 OK\r\n"
-                              "Connection: close\r\n"
-                              "Content-Length: 62\r\n"
-                              "Content-Type: text/html; charset=iso-8859-1\r\n"
-                              "\r\n"
-                              "<html>\r\n"
-                              "<body>\r\n"
-                              "<p>Hello from ESP8266!</p>\r\n"
-                              "</body>\r\n"
-                              "</html>\r\n";
+static const char *HTTP_RES =
+        "HTTP/1.0 200 OK\r\n"
+        "Connection: close\r\n"
+        "Content-Length: 62\r\n"
+        "Content-Type: text/html; charset=iso-8859-1\r\n"
+        "\r\n"
+        "<html>\r\n"
+        "<body>\r\n"
+        "<p>Hello from ESP8266!</p>\r\n"
+        "</body>\r\n"
+        "</html>\r\n";
 
 void loop() {
-  static int                cnt;
+  static int cnt;
   BearSSL::WiFiClientSecure incoming = server.accept();
   if (!incoming) {
     return;
   }
-  Serial.printf("Incoming connection...%d\n", cnt++);
-
+  Serial.printf("Incoming connection...%d\n",cnt++);
+  
   // Ugly way to wait for \r\n (i.e. end of HTTP request which we don't actually parse here)
-  uint32_t timeout = millis() + 1000;
-  int      lcwn    = 0;
+  uint32_t timeout=millis() + 1000;
+  int lcwn = 0;
   for (;;) {
-    unsigned char x = 0;
+    unsigned char x=0;
     if ((millis() > timeout) || (incoming.available() && incoming.read(&x, 1) < 0)) {
       incoming.stop();
       Serial.printf("Connection error, closed\n");
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino b/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
index c6005f162e..3e88019cf4 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
@@ -67,11 +67,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* pass = STAPSK;
+const char *ssid = STASSID;
+const char *pass = STAPSK;
 
 // The server which will require a client cert signed by the trusted CA
 BearSSL::WiFiServerSecure server(443);
@@ -160,7 +160,8 @@ seoK24dHmt6tWmn/sbxX7Aa6TL/4mVlFoOgcaTJyVaY/BrY=
 // head of the app.
 
 // Set time via NTP, as required for x.509 validation
-void setClock() {
+void setClock()
+{
   configTime(3 * 3600, 0, "pool.ntp.org", "time.nist.gov");
 
   Serial.print("Waiting for NTP time sync: ");
@@ -198,31 +199,32 @@ void setup() {
   Serial.println("IP address: ");
   Serial.println(WiFi.localIP());
 
-  setClock();  // Required for X.509 validation
+  setClock(); // Required for X.509 validation
 
   // Attach the server private cert/key combo
-  BearSSL::X509List*   serverCertList = new BearSSL::X509List(server_cert);
-  BearSSL::PrivateKey* serverPrivKey  = new BearSSL::PrivateKey(server_private_key);
+  BearSSL::X509List *serverCertList = new BearSSL::X509List(server_cert);
+  BearSSL::PrivateKey *serverPrivKey = new BearSSL::PrivateKey(server_private_key);
   server.setRSACert(serverCertList, serverPrivKey);
 
   // Require a certificate validated by the trusted CA
-  BearSSL::X509List* serverTrustedCA = new BearSSL::X509List(ca_cert);
+  BearSSL::X509List *serverTrustedCA = new BearSSL::X509List(ca_cert);
   server.setClientTrustAnchor(serverTrustedCA);
 
   // Actually start accepting connections
   server.begin();
 }
 
-static const char* HTTP_RES = "HTTP/1.0 200 OK\r\n"
-                              "Connection: close\r\n"
-                              "Content-Length: 59\r\n"
-                              "Content-Type: text/html; charset=iso-8859-1\r\n"
-                              "\r\n"
-                              "<html>\r\n"
-                              "<body>\r\n"
-                              "<p>Hello my friend!</p>\r\n"
-                              "</body>\r\n"
-                              "</html>\r\n";
+static const char *HTTP_RES =
+        "HTTP/1.0 200 OK\r\n"
+        "Connection: close\r\n"
+        "Content-Length: 59\r\n"
+        "Content-Type: text/html; charset=iso-8859-1\r\n"
+        "\r\n"
+        "<html>\r\n"
+        "<body>\r\n"
+        "<p>Hello my friend!</p>\r\n"
+        "</body>\r\n"
+        "</html>\r\n";
 
 void loop() {
   BearSSL::WiFiClientSecure incoming = server.accept();
@@ -230,12 +232,12 @@ void loop() {
     return;
   }
   Serial.println("Incoming connection...\n");
-
+  
   // Ugly way to wait for \r\n (i.e. end of HTTP request which we don't actually parse here)
-  uint32_t timeout = millis() + 1000;
-  int      lcwn    = 0;
+  uint32_t timeout=millis() + 1000;
+  int lcwn = 0;
   for (;;) {
-    unsigned char x = 0;
+    unsigned char x=0;
     if ((millis() > timeout) || (incoming.available() && incoming.read(&x, 1) < 0)) {
       incoming.stop();
       Serial.printf("Connection error, closed\n");
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino b/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
index 7e64df10a2..fa03c7fa38 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
@@ -9,13 +9,13 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* pass = STAPSK;
+const char *ssid = STASSID;
+const char *pass = STAPSK;
 
-const char* path = "/";
+const char *   path = "/";
 
 void setup() {
   Serial.begin(115200);
@@ -52,7 +52,7 @@ void setup() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump HTTP response
-void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
+void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_t port, const char *path) {
   if (!path) {
     path = "/";
   }
@@ -81,7 +81,7 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
         break;
       }
       // Only print out first line up to \r, then abort connection
-      char* nl = strchr(tmp, '\r');
+      char *nl = strchr(tmp, '\r');
       if (nl) {
         *nl = 0;
         Serial.print(tmp);
@@ -94,10 +94,11 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
   Serial.printf("\n-------\n\n");
 }
 
+
 void loop() {
-  uint32_t                  start, finish;
+  uint32_t start, finish;
   BearSSL::WiFiClientSecure client;
-  BearSSL::X509List         cert(cert_DigiCert_High_Assurance_EV_Root_CA);
+  BearSSL::X509List cert(cert_DigiCert_High_Assurance_EV_Root_CA);
 
   Serial.printf("Connecting without sessions...");
   start = millis();
@@ -129,5 +130,6 @@ void loop() {
   finish = millis();
   Serial.printf("Total time: %dms\n", finish - start);
 
-  delay(10000);  // Avoid DDOSing github
+  delay(10000); // Avoid DDOSing github
 }
+
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino b/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
index 757cedd6d8..b91570da11 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
@@ -12,13 +12,13 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* pass = STAPSK;
+const char *ssid = STASSID;
+const char *pass = STAPSK;
 
-const char* path = "/";
+const char *   path = "/";
 
 // Set time via NTP, as required for x.509 validation
 void setClock() {
@@ -39,7 +39,7 @@ void setClock() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump HTTP response
-void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
+void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_t port, const char *path) {
   if (!path) {
     path = "/";
   }
@@ -70,7 +70,7 @@ void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_
         break;
       }
       // Only print out first line up to \r, then abort connection
-      char* nl = strchr(tmp, '\r');
+      char *nl = strchr(tmp, '\r');
       if (nl) {
         *nl = 0;
         Serial.print(tmp);
@@ -141,7 +141,7 @@ private and not shared.  A MITM without the private key would not be
 able to establish communications.
 )EOF");
   BearSSL::WiFiClientSecure client;
-  BearSSL::PublicKey        key(pubkey_gitlab_com);
+  BearSSL::PublicKey key(pubkey_gitlab_com);
   client.setKnownKey(&key);
   fetchURL(&client, gitlab_host, gitlab_port, path);
 }
@@ -157,7 +157,7 @@ BearSSL does verify the notValidBefore/After fields.
 )EOF");
 
   BearSSL::WiFiClientSecure client;
-  BearSSL::X509List         cert(cert_USERTrust_RSA_Certification_Authority);
+  BearSSL::X509List cert(cert_USERTrust_RSA_Certification_Authority);
   client.setTrustAnchors(&cert);
   Serial.printf("Try validating without setting the time (should fail)\n");
   fetchURL(&client, gitlab_host, gitlab_port, path);
@@ -183,7 +183,7 @@ may make sense
   client.setCiphersLessSecure();
   now = millis();
   fetchURL(&client, gitlab_host, gitlab_port, path);
-  uint32_t              delta2       = millis() - now;
+  uint32_t delta2 = millis() - now;
   std::vector<uint16_t> myCustomList = { BR_TLS_RSA_WITH_AES_256_CBC_SHA256, BR_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, BR_TLS_RSA_WITH_3DES_EDE_CBC_SHA };
   client.setInsecure();
   client.setCiphers(myCustomList);
@@ -223,6 +223,7 @@ void setup() {
   fetchFaster();
 }
 
+
 void loop() {
   // Nothing to do here
 }
diff --git a/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino b/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
index 9eb3c3150e..9ccf3b6b37 100644
--- a/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
+++ b/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
@@ -17,10 +17,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 X509List cert(cert_DigiCert_High_Assurance_EV_Root_CA);
@@ -74,7 +74,10 @@ void setup() {
   Serial.print("Requesting URL: ");
   Serial.println(url);
 
-  client.print(String("GET ") + url + " HTTP/1.1\r\n" + "Host: " + github_host + "\r\n" + "User-Agent: BuildFailureDetectorESP8266\r\n" + "Connection: close\r\n\r\n");
+  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
+               "Host: " + github_host + "\r\n" +
+               "User-Agent: BuildFailureDetectorESP8266\r\n" +
+               "Connection: close\r\n\r\n");
 
   Serial.println("Request sent");
   while (client.connected()) {
diff --git a/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino b/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
index e3f15fcd82..560d9bfe46 100644
--- a/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
+++ b/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
@@ -23,18 +23,18 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-#define FQDN F("www.google.com")    // with both IPv4 & IPv6 addresses
-#define FQDN2 F("www.yahoo.com")    // with both IPv4 & IPv6 addresses
-#define FQDN6 F("ipv6.google.com")  // does not resolve in IPv4
+#define FQDN  F("www.google.com")  // with both IPv4 & IPv6 addresses
+#define FQDN2 F("www.yahoo.com")   // with both IPv4 & IPv6 addresses
+#define FQDN6 F("ipv6.google.com") // does not resolve in IPv4
 #define STATUSDELAY_MS 10000
 #define TCP_PORT 23
 #define UDP_PORT 23
 
-WiFiServer                         statusServer(TCP_PORT);
-WiFiUDP                            udp;
+WiFiServer statusServer(TCP_PORT);
+WiFiUDP udp;
 esp8266::polledTimeout::periodicMs showStatusOnSerialNow(STATUSDELAY_MS);
 
 void fqdn(Print& out, const String& fqdn) {
@@ -93,6 +93,7 @@ void status(Print& out) {
     }
 
     out.println();
+
   }
 
   // lwIP's dns client will ask for IPv4 first (by default)
@@ -100,8 +101,8 @@ void status(Print& out) {
   fqdn(out, FQDN);
   fqdn(out, FQDN6);
 #if LWIP_IPV4 && LWIP_IPV6
-  fqdn_rt(out, FQDN, DNSResolveType::DNS_AddrType_IPv4_IPv6);   // IPv4 before IPv6
-  fqdn_rt(out, FQDN2, DNSResolveType::DNS_AddrType_IPv6_IPv4);  // IPv6 before IPv4
+  fqdn_rt(out, FQDN,  DNSResolveType::DNS_AddrType_IPv4_IPv6); // IPv4 before IPv6
+  fqdn_rt(out, FQDN2, DNSResolveType::DNS_AddrType_IPv6_IPv4); // IPv6 before IPv4
 #endif
   out.println(F("------------------------------"));
 }
@@ -124,7 +125,7 @@ void setup() {
 
   status(Serial);
 
-#if 0  // 0: legacy connecting loop - 1: wait for IPv6
+#if 0 // 0: legacy connecting loop - 1: wait for IPv6
 
   // legacy loop (still valid with IPv4 only)
 
@@ -145,9 +146,9 @@ void setup() {
   for (bool configured = false; !configured;) {
     for (auto addr : addrList)
       if ((configured = !addr.isLocal()
-           // && addr.isV6() // uncomment when IPv6 is mandatory
-           // && addr.ifnumber() == STATION_IF
-           )) {
+                        // && addr.isV6() // uncomment when IPv6 is mandatory
+                        // && addr.ifnumber() == STATION_IF
+          )) {
         break;
       }
     Serial.print('.');
@@ -172,6 +173,7 @@ void setup() {
 unsigned long statusTimeMs = 0;
 
 void loop() {
+
   if (statusServer.hasClient()) {
     WiFiClient cli = statusServer.accept();
     status(cli);
@@ -186,7 +188,7 @@ void loop() {
     udp.remoteIP().printTo(Serial);
     Serial.print(F(" :"));
     Serial.println(udp.remotePort());
-    int c;
+    int  c;
     while ((c = udp.read()) >= 0) {
       Serial.write(c);
     }
@@ -197,7 +199,9 @@ void loop() {
     udp.endPacket();
   }
 
+
   if (showStatusOnSerialNow) {
     status(Serial);
   }
+
 }
diff --git a/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino b/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
index 24018681e6..927e78fee9 100644
--- a/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
+++ b/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
@@ -23,23 +23,24 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid = STASSID;  // your network SSID (name)
-const char* pass = STAPSK;   // your network password
+const char * ssid = STASSID; // your network SSID (name)
+const char * pass = STAPSK;  // your network password
 
-unsigned int localPort = 2390;  // local port to listen for UDP packets
+
+unsigned int localPort = 2390;      // local port to listen for UDP packets
 
 /* Don't hardwire the IP address or we won't get the benefits of the pool.
     Lookup the IP address for the host name instead */
 //IPAddress timeServer(129, 6, 15, 28); // time.nist.gov NTP server
-IPAddress   timeServerIP;  // time.nist.gov NTP server address
+IPAddress timeServerIP; // time.nist.gov NTP server address
 const char* ntpServerName = "time.nist.gov";
 
-const int NTP_PACKET_SIZE = 48;  // NTP time stamp is in the first 48 bytes of the message
+const int NTP_PACKET_SIZE = 48; // NTP time stamp is in the first 48 bytes of the message
 
-byte packetBuffer[NTP_PACKET_SIZE];  //buffer to hold incoming and outgoing packets
+byte packetBuffer[ NTP_PACKET_SIZE]; //buffer to hold incoming and outgoing packets
 
 // A UDP instance to let us send and receive packets over UDP
 WiFiUDP udp;
@@ -75,7 +76,7 @@ void loop() {
   //get a random server from the pool
   WiFi.hostByName(ntpServerName, timeServerIP);
 
-  sendNTPpacket(timeServerIP);  // send an NTP packet to a time server
+  sendNTPpacket(timeServerIP); // send an NTP packet to a time server
   // wait to see if a reply is available
   delay(1000);
 
@@ -86,13 +87,13 @@ void loop() {
     Serial.print("packet received, length=");
     Serial.println(cb);
     // We've received a packet, read the data from it
-    udp.read(packetBuffer, NTP_PACKET_SIZE);  // read the packet into the buffer
+    udp.read(packetBuffer, NTP_PACKET_SIZE); // read the packet into the buffer
 
     //the timestamp starts at byte 40 of the received packet and is four bytes,
     // or two words, long. First, esxtract the two words:
 
     unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);
-    unsigned long lowWord  = word(packetBuffer[42], packetBuffer[43]);
+    unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]);
     // combine the four bytes (two words) into a long integer
     // this is NTP time (seconds since Jan 1 1900):
     unsigned long secsSince1900 = highWord << 16 | lowWord;
@@ -108,21 +109,22 @@ void loop() {
     // print Unix time:
     Serial.println(epoch);
 
+
     // print the hour, minute and second:
     Serial.print("The UTC time is ");       // UTC is the time at Greenwich Meridian (GMT)
-    Serial.print((epoch % 86400L) / 3600);  // print the hour (86400 equals secs per day)
+    Serial.print((epoch  % 86400L) / 3600); // print the hour (86400 equals secs per day)
     Serial.print(':');
     if (((epoch % 3600) / 60) < 10) {
       // In the first 10 minutes of each hour, we'll want a leading '0'
       Serial.print('0');
     }
-    Serial.print((epoch % 3600) / 60);  // print the minute (3600 equals secs per minute)
+    Serial.print((epoch  % 3600) / 60); // print the minute (3600 equals secs per minute)
     Serial.print(':');
     if ((epoch % 60) < 10) {
       // In the first 10 seconds of each minute, we'll want a leading '0'
       Serial.print('0');
     }
-    Serial.println(epoch % 60);  // print the second
+    Serial.println(epoch % 60); // print the second
   }
   // wait ten seconds before asking for the time again
   delay(10000);
@@ -135,19 +137,19 @@ void sendNTPpacket(IPAddress& address) {
   memset(packetBuffer, 0, NTP_PACKET_SIZE);
   // Initialize values needed to form NTP request
   // (see URL above for details on the packets)
-  packetBuffer[0] = 0b11100011;  // LI, Version, Mode
-  packetBuffer[1] = 0;           // Stratum, or type of clock
-  packetBuffer[2] = 6;           // Polling Interval
-  packetBuffer[3] = 0xEC;        // Peer Clock Precision
+  packetBuffer[0] = 0b11100011;   // LI, Version, Mode
+  packetBuffer[1] = 0;     // Stratum, or type of clock
+  packetBuffer[2] = 6;     // Polling Interval
+  packetBuffer[3] = 0xEC;  // Peer Clock Precision
   // 8 bytes of zero for Root Delay & Root Dispersion
-  packetBuffer[12] = 49;
-  packetBuffer[13] = 0x4E;
-  packetBuffer[14] = 49;
-  packetBuffer[15] = 52;
+  packetBuffer[12]  = 49;
+  packetBuffer[13]  = 0x4E;
+  packetBuffer[14]  = 49;
+  packetBuffer[15]  = 52;
 
   // all NTP fields have been given values, now
   // you can send a packet requesting a timestamp:
-  udp.beginPacket(address, 123);  //NTP requests are to port 123
+  udp.beginPacket(address, 123); //NTP requests are to port 123
   udp.write(packetBuffer, NTP_PACKET_SIZE);
   udp.endPacket();
 }
diff --git a/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino b/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
index d055921cdf..43f8fe981c 100644
--- a/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
+++ b/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
@@ -25,7 +25,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
 const char* ssid     = STASSID;
@@ -34,6 +34,7 @@ const char* password = STAPSK;
 ArduinoWiFiServer server(2323);
 
 void setup() {
+
   Serial.begin(115200);
 
   Serial.println();
@@ -58,13 +59,14 @@ void setup() {
 }
 
 void loop() {
-  WiFiClient client = server.available();     // returns first client which has data to read or a 'false' client
-  if (client) {                               // client is true only if it is connected and has data to read
-    String s = client.readStringUntil('\n');  // read the message incoming from one of the clients
-    s.trim();                                 // trim eventual \r
-    Serial.println(s);                        // print the message to Serial Monitor
-    client.print("echo: ");                   // this is only for the sending client
-    server.println(s);                        // send the message to all connected clients
-    server.flush();                           // flush the buffers
+
+  WiFiClient client = server.available(); // returns first client which has data to read or a 'false' client
+  if (client) { // client is true only if it is connected and has data to read
+    String s = client.readStringUntil('\n'); // read the message incoming from one of the clients
+    s.trim(); // trim eventual \r
+    Serial.println(s); // print the message to Serial Monitor
+    client.print("echo: "); // this is only for the sending client
+    server.println(s); // send the message to all connected clients
+    server.flush(); // flush the buffers
   }
 }
diff --git a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
index bb761a026a..a98e894873 100644
--- a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
+++ b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
@@ -7,7 +7,7 @@
 
 #ifndef STASSID
 #define STASSID "mynetwork"
-#define STAPSK "mynetworkpassword"
+#define STAPSK  "mynetworkpassword"
 #endif
 
 #include <ESP8266WiFi.h>
@@ -61,9 +61,9 @@ void setup() {
   dhcpSoftAP.dhcps_set_dns(1, WiFi.dnsIP(1));
 
   WiFi.softAPConfig(  // enable AP, with android-compatible google domain
-      IPAddress(172, 217, 28, 254),
-      IPAddress(172, 217, 28, 254),
-      IPAddress(255, 255, 255, 0));
+    IPAddress(172, 217, 28, 254),
+    IPAddress(172, 217, 28, 254),
+    IPAddress(255, 255, 255, 0));
   WiFi.softAP(STASSID "extender", STAPSK);
   Serial.printf("AP: %s\n", WiFi.softAPIP().toString().c_str());
 
@@ -94,3 +94,4 @@ void setup() {
 
 void loop() {
 }
+
diff --git a/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino b/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
index e1de8fe630..e4520c4720 100644
--- a/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
+++ b/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
@@ -7,8 +7,8 @@
 #include <LwipDhcpServer.h>
 
 /* Set these to your desired credentials. */
-const char* ssid     = "ESPap";
-const char* password = "thereisnospoon";
+const char *ssid = "ESPap";
+const char *password = "thereisnospoon";
 
 ESP8266WebServer server(80);
 
@@ -17,20 +17,21 @@ IPAddress apIP(192, 168, 0, 1);
 
 /* Go to http://192.168.0.1 in a web browser to see current lease */
 void handleRoot() {
-  String               result;
-  char                 wifiClientMac[18];
-  unsigned char        number_client;
-  struct station_info* stat_info;
+  String result;
+  char wifiClientMac[18];
+  unsigned char number_client;
+  struct station_info *stat_info;
 
   int i = 1;
 
   number_client = wifi_softap_get_station_num();
-  stat_info     = wifi_softap_get_station_info();
+  stat_info = wifi_softap_get_station_info();
 
   result = "<html><body><h1>Total Connected Clients : ";
   result += String(number_client);
   result += "</h1></br>";
   while (stat_info != NULL) {
+
     result += "Client ";
     result += String(i);
     result += " = ";
@@ -51,7 +52,7 @@ void handleRoot() {
 void setup() {
   /* List of mac address for static lease */
   uint8 mac_CAM[6] = { 0x00, 0x0C, 0x43, 0x01, 0x60, 0x15 };
-  uint8 mac_PC[6]  = { 0xb4, 0x52, 0x7e, 0x9a, 0x19, 0xa5 };
+  uint8 mac_PC[6] = { 0xb4, 0x52, 0x7e, 0x9a, 0x19, 0xa5 };
 
   Serial.begin(115200);
   Serial.println();
diff --git a/libraries/ESP8266WiFi/examples/Udp/Udp.ino b/libraries/ESP8266WiFi/examples/Udp/Udp.ino
index 0954603e6d..7ec287b392 100644
--- a/libraries/ESP8266WiFi/examples/Udp/Udp.ino
+++ b/libraries/ESP8266WiFi/examples/Udp/Udp.ino
@@ -14,19 +14,20 @@
   adapted from Ethernet library examples
 */
 
+
 #include <ESP8266WiFi.h>
 #include <WiFiUdp.h>
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-unsigned int localPort = 8888;  // local port to listen on
+unsigned int localPort = 8888;      // local port to listen on
 
 // buffers for receiving and sending data
-char packetBuffer[UDP_TX_PACKET_MAX_SIZE + 1];  //buffer to hold incoming packet,
-char ReplyBuffer[] = "acknowledged\r\n";        // a string to send back
+char packetBuffer[UDP_TX_PACKET_MAX_SIZE + 1]; //buffer to hold incoming packet,
+char  ReplyBuffer[] = "acknowledged\r\n";       // a string to send back
 
 WiFiUDP Udp;
 
@@ -55,7 +56,7 @@ void loop() {
                   ESP.getFreeHeap());
 
     // read the packet into packetBufffer
-    int n           = Udp.read(packetBuffer, UDP_TX_PACKET_MAX_SIZE);
+    int n = Udp.read(packetBuffer, UDP_TX_PACKET_MAX_SIZE);
     packetBuffer[n] = 0;
     Serial.println("Contents:");
     Serial.println(packetBuffer);
@@ -65,6 +66,7 @@ void loop() {
     Udp.write(ReplyBuffer);
     Udp.endPacket();
   }
+
 }
 
 /*
diff --git a/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino b/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
index 11d79620e5..6fea68f590 100644
--- a/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
@@ -36,12 +36,12 @@
 
 #ifndef APSSID
 #define APSSID "ESPap"
-#define APPSK "thereisnospoon"
+#define APPSK  "thereisnospoon"
 #endif
 
 /* Set these to your desired credentials. */
-const char* ssid     = APSSID;
-const char* password = APPSK;
+const char *ssid = APSSID;
+const char *password = APPSK;
 
 ESP8266WebServer server(80);
 
diff --git a/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino b/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
index 515f770cca..e442282e37 100644
--- a/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
@@ -9,13 +9,13 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
 const char* ssid     = STASSID;
 const char* password = STAPSK;
 
-const char*    host = "192.168.1.1";
+const char* host = "192.168.1.1";
 const uint16_t port = 3000;
 
 ESP8266WiFiMulti WiFiMulti;
@@ -44,6 +44,7 @@ void setup() {
   delay(500);
 }
 
+
 void loop() {
   Serial.print("connecting to ");
   Serial.print(host);
@@ -74,3 +75,4 @@ void loop() {
   Serial.println("wait 5 sec...");
   delay(5000);
 }
+
diff --git a/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino b/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
index 2b5ad66bc8..f902e019a9 100644
--- a/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
@@ -7,11 +7,11 @@
 #include <ESP8266WiFi.h>
 #include <ESP8266mDNS.h>
 #include <PolledTimeout.h>
-#include <algorithm>  // std::min
+#include <algorithm> // std::min
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
 constexpr int port = 23;
@@ -19,14 +19,15 @@ constexpr int port = 23;
 WiFiServer server(port);
 WiFiClient client;
 
-constexpr size_t                       sizes[]  = { 0, 512, 384, 256, 128, 64, 16, 8, 4 };
-constexpr uint32_t                     breathMs = 200;
-esp8266::polledTimeout::oneShotFastMs  enoughMs(breathMs);
+constexpr size_t sizes [] = { 0, 512, 384, 256, 128, 64, 16, 8, 4 };
+constexpr uint32_t breathMs = 200;
+esp8266::polledTimeout::oneShotFastMs enoughMs(breathMs);
 esp8266::polledTimeout::periodicFastMs test(2000);
-int                                    t = 1;  // test (1, 2 or 3, see below)
-int                                    s = 0;  // sizes[] index
+int t = 1; // test (1, 2 or 3, see below)
+int s = 0; // sizes[] index
 
 void setup() {
+
   Serial.begin(115200);
   Serial.println(ESP.getFullVersion());
 
@@ -53,7 +54,9 @@ void setup() {
                 port);
 }
 
+
 void loop() {
+
   MDNS.update();
 
   static uint32_t tot = 0;
@@ -81,28 +84,10 @@ void loop() {
   if (Serial.available()) {
     s = (s + 1) % (sizeof(sizes) / sizeof(sizes[0]));
     switch (Serial.read()) {
-      case '1':
-        if (t != 1)
-          s = 0;
-        t = 1;
-        Serial.println("byte-by-byte (watch then press 2, 3 or 4)");
-        break;
-      case '2':
-        if (t != 2)
-          s = 1;
-        t = 2;
-        Serial.printf("through buffer (watch then press 2 again, or 1, 3 or 4)\n");
-        break;
-      case '3':
-        if (t != 3)
-          s = 0;
-        t = 3;
-        Serial.printf("direct access (sendAvailable - watch then press 3 again, or 1, 2 or 4)\n");
-        break;
-      case '4':
-        t = 4;
-        Serial.printf("direct access (sendAll - close peer to stop, then press 1, 2 or 3 before restarting peer)\n");
-        break;
+      case '1': if (t != 1) s = 0; t = 1; Serial.println("byte-by-byte (watch then press 2, 3 or 4)"); break;
+      case '2': if (t != 2) s = 1; t = 2; Serial.printf("through buffer (watch then press 2 again, or 1, 3 or 4)\n"); break;
+      case '3': if (t != 3) s = 0; t = 3; Serial.printf("direct access (sendAvailable - watch then press 3 again, or 1, 2 or 4)\n"); break;
+      case '4':                    t = 4; Serial.printf("direct access (sendAll - close peer to stop, then press 1, 2 or 3 before restarting peer)\n"); break;
     }
     tot = cnt = 0;
     ESP.resetFreeContStack();
@@ -124,10 +109,10 @@ void loop() {
     // block by block through a local buffer (2 copies)
     while (client.available() && client.availableForWrite() && !enoughMs) {
       size_t maxTo = std::min(client.available(), client.availableForWrite());
-      maxTo        = std::min(maxTo, sizes[s]);
+      maxTo = std::min(maxTo, sizes[s]);
       uint8_t buf[maxTo];
-      size_t  tcp_got  = client.read(buf, maxTo);
-      size_t  tcp_sent = client.write(buf, tcp_got);
+      size_t tcp_got = client.read(buf, maxTo);
+      size_t tcp_sent = client.write(buf, tcp_got);
       if (tcp_sent != maxTo) {
         Serial.printf("len mismatch: available:%zd tcp-read:%zd serial-write:%zd\n", maxTo, tcp_got, tcp_sent);
       }
@@ -146,43 +131,26 @@ void loop() {
     cnt++;
 
     switch (client.getLastSendReport()) {
-      case Stream::Report::Success:
-        break;
-      case Stream::Report::TimedOut:
-        Serial.println("Stream::send: timeout");
-        break;
-      case Stream::Report::ReadError:
-        Serial.println("Stream::send: read error");
-        break;
-      case Stream::Report::WriteError:
-        Serial.println("Stream::send: write error");
-        break;
-      case Stream::Report::ShortOperation:
-        Serial.println("Stream::send: short transfer");
-        break;
+      case Stream::Report::Success: break;
+      case Stream::Report::TimedOut: Serial.println("Stream::send: timeout"); break;
+      case Stream::Report::ReadError: Serial.println("Stream::send: read error"); break;
+      case Stream::Report::WriteError: Serial.println("Stream::send: write error"); break;
+      case Stream::Report::ShortOperation: Serial.println("Stream::send: short transfer"); break;
     }
   }
 
   else if (t == 4) {
     // stream to print, possibly with only one copy
-    tot += client.sendAll(&client);  // this one might not exit until peer close
+    tot += client.sendAll(&client); // this one might not exit until peer close
     cnt++;
 
     switch (client.getLastSendReport()) {
-      case Stream::Report::Success:
-        break;
-      case Stream::Report::TimedOut:
-        Serial.println("Stream::send: timeout");
-        break;
-      case Stream::Report::ReadError:
-        Serial.println("Stream::send: read error");
-        break;
-      case Stream::Report::WriteError:
-        Serial.println("Stream::send: write error");
-        break;
-      case Stream::Report::ShortOperation:
-        Serial.println("Stream::send: short transfer");
-        break;
+      case Stream::Report::Success: break;
+      case Stream::Report::TimedOut: Serial.println("Stream::send: timeout"); break;
+      case Stream::Report::ReadError: Serial.println("Stream::send: read error"); break;
+      case Stream::Report::WriteError: Serial.println("Stream::send: write error"); break;
+      case Stream::Report::ShortOperation: Serial.println("Stream::send: short transfer"); break;
     }
   }
+
 }
diff --git a/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino b/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
index 9c094c1013..d72985a9c1 100644
--- a/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
@@ -18,7 +18,7 @@
 
 #ifndef APSSID
 #define APSSID "esp8266"
-#define APPSK "esp8266"
+#define APPSK  "esp8266"
 #endif
 
 const char* ssid     = APSSID;
diff --git a/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino b/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
index a585092bdd..56c04a3a53 100644
--- a/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
@@ -11,10 +11,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 // Create an instance of the server
@@ -60,7 +60,7 @@ void loop() {
   }
   Serial.println(F("new client"));
 
-  client.setTimeout(5000);  // default is 1000
+  client.setTimeout(5000); // default is 1000
 
   // Read the first line of the request
   String req = client.readStringUntil('\r');
diff --git a/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino b/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
index 30542af4e0..b546df4a7d 100644
--- a/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
@@ -19,13 +19,13 @@ void setup() {
 }
 
 void loop() {
-  String   ssid;
-  int32_t  rssi;
-  uint8_t  encryptionType;
+  String ssid;
+  int32_t rssi;
+  uint8_t encryptionType;
   uint8_t* bssid;
-  int32_t  channel;
-  bool     hidden;
-  int      scanResult;
+  int32_t channel;
+  bool hidden;
+  int scanResult;
 
   Serial.println(F("Starting WiFi scan..."));
 
diff --git a/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino b/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
index f246f98d68..b03357c143 100644
--- a/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
@@ -17,11 +17,11 @@
 #endif
 
 #include <ESP8266WiFi.h>
-#include <include/WiFiState.h>  // WiFiState structure details
+#include <include/WiFiState.h> // WiFiState structure details
 
 WiFiState state;
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 void setup() {
@@ -36,7 +36,7 @@ void setup() {
   // Here you can do whatever you need to do that doesn't need a WiFi connection.
   // ---
 
-  ESP.rtcUserMemoryRead(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t*>(&state), sizeof(state));
+  ESP.rtcUserMemoryRead(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t *>(&state), sizeof(state));
   unsigned long start = millis();
 
   if (!WiFi.resumeFromShutdown(state)
@@ -64,7 +64,7 @@ void setup() {
   // ---
 
   WiFi.shutdown(state);
-  ESP.rtcUserMemoryWrite(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t*>(&state), sizeof(state));
+  ESP.rtcUserMemoryWrite(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t *>(&state), sizeof(state));
 
   // ---
   // Here you can do whatever you need to do that doesn't need a WiFi connection anymore.
diff --git a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
index 9dafae4cf4..7ddcdd6d07 100644
--- a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
@@ -20,11 +20,11 @@
 */
 #include <ESP8266WiFi.h>
 
-#include <algorithm>  // std::min
+#include <algorithm> // std::min
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
 /*
@@ -64,11 +64,11 @@ SoftwareSerial* logger = nullptr;
 #define logger (&Serial1)
 #endif
 
-#define STACK_PROTECTOR 512  // bytes
+#define STACK_PROTECTOR  512 // bytes
 
 //how many clients should be able to telnet to this ESP8266
 #define MAX_SRV_CLIENTS 2
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 const int port = 23;
@@ -77,6 +77,7 @@ WiFiServer server(port);
 WiFiClient serverClients[MAX_SRV_CLIENTS];
 
 void setup() {
+
   Serial.begin(BAUD_SERIAL);
   Serial.setRxBufferSize(RXBUFFERSIZE);
 
@@ -97,7 +98,7 @@ void setup() {
   logger->printf("Serial receive buffer size: %d bytes\n", RXBUFFERSIZE);
 
 #if SERIAL_LOOPBACK
-  USC0(0) |= (1 << UCLBE);  // incomplete HardwareSerial API
+  USC0(0) |= (1 << UCLBE); // incomplete HardwareSerial API
   logger->println("Serial Internal Loopback enabled");
 #endif
 
@@ -128,7 +129,7 @@ void loop() {
     //find free/disconnected spot
     int i;
     for (i = 0; i < MAX_SRV_CLIENTS; i++)
-      if (!serverClients[i]) {  // equivalent to !serverClients[i].connected()
+      if (!serverClients[i]) { // equivalent to !serverClients[i].connected()
         serverClients[i] = server.accept();
         logger->print("New client: index ");
         logger->print(i);
@@ -160,10 +161,10 @@ void loop() {
   for (int i = 0; i < MAX_SRV_CLIENTS; i++)
     while (serverClients[i].available() && Serial.availableForWrite() > 0) {
       size_t maxToSerial = std::min(serverClients[i].available(), Serial.availableForWrite());
-      maxToSerial        = std::min(maxToSerial, (size_t)STACK_PROTECTOR);
+      maxToSerial = std::min(maxToSerial, (size_t)STACK_PROTECTOR);
       uint8_t buf[maxToSerial];
-      size_t  tcp_got     = serverClients[i].read(buf, maxToSerial);
-      size_t  serial_sent = Serial.write(buf, tcp_got);
+      size_t tcp_got = serverClients[i].read(buf, maxToSerial);
+      size_t serial_sent = Serial.write(buf, tcp_got);
       if (serial_sent != maxToSerial) {
         logger->printf("len mismatch: available:%zd tcp-read:%zd serial-write:%zd\n", maxToSerial, tcp_got, serial_sent);
       }
@@ -190,10 +191,10 @@ void loop() {
 
   //check UART for data
   size_t len = std::min(Serial.available(), maxToTcp);
-  len        = std::min(len, (size_t)STACK_PROTECTOR);
+  len = std::min(len, (size_t)STACK_PROTECTOR);
   if (len) {
     uint8_t sbuf[len];
-    int     serial_got = Serial.readBytes(sbuf, len);
+    int serial_got = Serial.readBytes(sbuf, len);
     // push UART data to all connected telnet clients
     for (int i = 0; i < MAX_SRV_CLIENTS; i++)
       // if client.availableForWrite() was 0 (congested)
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino b/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
index 34f21be030..443d52e2bb 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
@@ -1,4 +1,4 @@
-#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
+#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
 
 #include <ESP8266WiFi.h>
 #include <EspnowMeshBackend.h>
@@ -19,28 +19,31 @@ namespace TypeCast = MeshTypeConversionFunctions;
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char exampleMeshName[] PROGMEM     = "MeshNode_";                    // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
-constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
+constexpr char exampleMeshName[] PROGMEM = "MeshNode_"; // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
+constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO"; // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
 
 // A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a default Kok set, but it can be replaced if desired.
 // All ESP-NOW keys below must match in an encrypted connection pair for encrypted communication to be possible.
 // Note that it is also possible to use Strings as key seeds instead of arrays.
-uint8_t espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting transmissions of encrypted connections.
-                                             0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11 };
-uint8_t espnowEncryptionKok[16]          = { 0x22, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting the encrypted connection key.
-                                    0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x33 };
-uint8_t espnowHashKey[16]                = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44,  // This is the secret key used for HMAC during encrypted connection requests.
-                              0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD };
-
-unsigned int requestNumber  = 0;
+uint8_t espnowEncryptedConnectionKey[16] = {0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting transmissions of encrypted connections.
+                                            0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11
+                                           };
+uint8_t espnowEncryptionKok[16] = {0x22, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting the encrypted connection key.
+                                   0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x33
+                                  };
+uint8_t espnowHashKey[16] = {0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44, // This is the secret key used for HMAC during encrypted connection requests.
+                             0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD
+                            };
+
+unsigned int requestNumber = 0;
 unsigned int responseNumber = 0;
 
-const char broadcastMetadataDelimiter = 23;  // 23 = End-of-Transmission-Block (ETB) control character in ASCII
+const char broadcastMetadataDelimiter = 23; // 23 = End-of-Transmission-Block (ETB) control character in ASCII
 
-String                 manageRequest(const String& request, MeshBackendBase& meshInstance);
-TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance);
-void                   networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance);
-bool                   broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance);
+String manageRequest(const String &request, MeshBackendBase &meshInstance);
+TransmissionStatusType manageResponse(const String &response, MeshBackendBase &meshInstance);
+void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance);
+bool broadcastFilter(String &firstTransmission, EspnowMeshBackend &meshInstance);
 
 /* Create the mesh node object */
 EspnowMeshBackend espnowNode = EspnowMeshBackend(manageRequest, manageResponse, networkFilter, broadcastFilter, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
@@ -52,13 +55,13 @@ EspnowMeshBackend espnowNode = EspnowMeshBackend(manageRequest, manageResponse,
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
 */
-String manageRequest(const String& request, MeshBackendBase& meshInstance) {
+String manageRequest(const String &request, MeshBackendBase &meshInstance) {
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+  if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
-    (void)tcpIpInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
+    (void)tcpIpInstance; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
     Serial.print(F("TCP/IP: "));
   } else {
     Serial.print(F("UNKNOWN!: "));
@@ -87,14 +90,14 @@ String manageRequest(const String& request, MeshBackendBase& meshInstance) {
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The status code resulting from the response, as an int
 */
-TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance) {
+TransmissionStatusType manageResponse(const String &response, MeshBackendBase &meshInstance) {
   TransmissionStatusType statusCode = TransmissionStatusType::TRANSMISSION_COMPLETE;
 
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+  if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+  } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
     Serial.print(F("TCP/IP: "));
 
     // Getting the sent message like this will work as long as ONLY(!) TCP/IP is used.
@@ -123,20 +126,20 @@ TransmissionStatusType manageResponse(const String& response, MeshBackendBase& m
    @param numberOfNetworks The number of networks found in the WiFi scan.
    @param meshInstance The MeshBackendBase instance that called the function.
 */
-void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
+void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance) {
   // Note that the network index of a given node may change whenever a new scan is done.
   for (int networkIndex = 0; networkIndex < numberOfNetworks; ++networkIndex) {
-    String currentSSID   = WiFi.SSID(networkIndex);
-    int    meshNameIndex = currentSSID.indexOf(meshInstance.getMeshName());
+    String currentSSID = WiFi.SSID(networkIndex);
+    int meshNameIndex = currentSSID.indexOf(meshInstance.getMeshName());
 
     /* Connect to any _suitable_ APs which contain meshInstance.getMeshName() */
     if (meshNameIndex >= 0) {
       uint64_t targetNodeID = TypeCast::stringToUint64(currentSSID.substring(meshNameIndex + meshInstance.getMeshName().length()));
 
       if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID())) {
-        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+        if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
           espnowInstance->connectionQueue().emplace_back(networkIndex);
-        } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+        } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
           tcpIpInstance->connectionQueue().emplace_back(networkIndex);
         } else {
           Serial.println(F("Invalid mesh backend!"));
@@ -158,7 +161,7 @@ void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
 
    @return True if the broadcast should be accepted. False otherwise.
 */
-bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance) {
+bool broadcastFilter(String &firstTransmission, EspnowMeshBackend &meshInstance) {
   // This example broadcastFilter will accept a transmission if it contains the broadcastMetadataDelimiter
   // and as metaData either no targetMeshName or a targetMeshName that matches the MeshName of meshInstance.
 
@@ -171,7 +174,7 @@ bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance)
   String targetMeshName = firstTransmission.substring(0, metadataEndIndex);
 
   if (!targetMeshName.isEmpty() && meshInstance.getMeshName() != targetMeshName) {
-    return false;  // Broadcast is for another mesh network
+    return false; // Broadcast is for another mesh network
   } else {
     // Remove metadata from message and mark as accepted broadcast.
     // Note that when you modify firstTransmission it is best to avoid using substring or other String methods that rely on null values for String length determination.
@@ -192,10 +195,10 @@ bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance)
 
    @return True if attemptTransmission should continue with the next entry in the connectionQueue. False if attemptTransmission should stop.
 */
-bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
+bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase &meshInstance) {
   // Currently this is exactly the same as the default hook, but you can modify it to alter the behaviour of attemptTransmission.
 
-  (void)meshInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  (void)meshInstance; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
 
   return true;
 }
@@ -215,10 +218,10 @@ bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
    @return True if the response transmission process should continue with the next response in the waiting list.
            False if the response transmission process should stop once processing of the just sent response is complete.
 */
-bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String& response, const uint8_t* recipientMac, uint32_t responseIndex, EspnowMeshBackend& meshInstance) {
+bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String &response, const uint8_t *recipientMac, uint32_t responseIndex, EspnowMeshBackend &meshInstance) {
   // Currently this is exactly the same as the default hook, but you can modify it to alter the behaviour of sendEspnowResponses.
 
-  (void)transmissionSuccessful;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  (void)transmissionSuccessful; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
   (void)response;
   (void)recipientMac;
   (void)responseIndex;
@@ -283,7 +286,7 @@ void setup() {
 }
 
 int32_t timeOfLastScan = -10000;
-void    loop() {
+void loop() {
   // The performEspnowMaintenance() method performs all the background operations for the EspnowMeshBackend.
   // It is recommended to place it in the beginning of the loop(), unless there is a need to put it elsewhere.
   // Among other things, the method cleans up old Espnow log entries (freeing up RAM) and sends the responses you provide to Espnow requests.
@@ -293,7 +296,7 @@ void    loop() {
   //Should not be used inside responseHandler, requestHandler, networkFilter or broadcastFilter callbacks since performEspnowMaintenance() can alter the ESP-NOW state.
   EspnowMeshBackend::performEspnowMaintenance();
 
-  if (millis() - timeOfLastScan > 10000) {  // Give other nodes some time to connect between data transfers.
+  if (millis() - timeOfLastScan > 10000) { // Give other nodes some time to connect between data transfers.
     Serial.println(F("\nPerforming unencrypted ESP-NOW transmissions."));
 
     uint32_t startTime = millis();
@@ -315,7 +318,7 @@ void    loop() {
     if (espnowNode.latestTransmissionOutcomes().empty()) {
       Serial.println(F("No mesh AP found."));
     } else {
-      for (TransmissionOutcome& transmissionOutcome : espnowNode.latestTransmissionOutcomes()) {
+      for (TransmissionOutcome &transmissionOutcome : espnowNode.latestTransmissionOutcomes()) {
         if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED) {
           Serial.println(String(F("Transmission failed to mesh AP ")) + transmissionOutcome.SSID());
         } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED) {
@@ -336,24 +339,24 @@ void    loop() {
       // Note that data that comes before broadcastMetadataDelimiter should not contain any broadcastMetadataDelimiter characters,
       // otherwise the broadcastFilter function used in this example file will not work.
       String broadcastMetadata = espnowNode.getMeshName() + String(broadcastMetadataDelimiter);
-      String broadcastMessage  = String(F("Broadcast #")) + String(requestNumber) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
+      String broadcastMessage = String(F("Broadcast #")) + String(requestNumber) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
       espnowNode.broadcast(broadcastMetadata + broadcastMessage);
       Serial.println(String(F("Broadcast to all mesh nodes done in ")) + String(millis() - startTime) + F(" ms."));
 
-      espnowDelay(100);  // Wait for responses (broadcasts can receive an unlimited number of responses, other transmissions can only receive one response).
+      espnowDelay(100); // Wait for responses (broadcasts can receive an unlimited number of responses, other transmissions can only receive one response).
 
       // If you have a data array containing null values it is possible to transmit the raw data by making the array into a multiString as shown below.
       // You can use String::c_str() or String::begin() to retrieve the data array later.
       // Note that certain String methods such as String::substring use null values to determine String length, which means they will not work as normal with multiStrings.
-      uint8_t dataArray[]   = { 0, '\'', 0, '\'', ' ', '(', 'n', 'u', 'l', 'l', ')', ' ', 'v', 'a', 'l', 'u', 'e' };
-      String  espnowMessage = TypeCast::uint8ArrayToMultiString(dataArray, sizeof dataArray) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
+      uint8_t dataArray[] = {0, '\'', 0, '\'', ' ', '(', 'n', 'u', 'l', 'l', ')', ' ', 'v', 'a', 'l', 'u', 'e'};
+      String espnowMessage = TypeCast::uint8ArrayToMultiString(dataArray, sizeof dataArray) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
       Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
       espnowNode.attemptTransmission(espnowMessage, false);
-      espnowDelay(100);  // Wait for response.
+      espnowDelay(100); // Wait for response.
 
       Serial.println(F("\nPerforming encrypted ESP-NOW transmissions."));
 
-      uint8_t targetBSSID[6] { 0 };
+      uint8_t targetBSSID[6] {0};
 
       // We can create encrypted connections to individual nodes so that all ESP-NOW communication with the node will be encrypted.
       if (espnowNode.constConnectionQueue()[0].getBSSID(targetBSSID) && espnowNode.requestEncryptedConnection(targetBSSID) == EncryptedConnectionStatus::CONNECTION_ESTABLISHED) {
@@ -366,7 +369,7 @@ void    loop() {
         String espnowMessage = String(F("This message is encrypted only when received by node ")) + peerMac;
         Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
         espnowNode.attemptTransmission(espnowMessage, false);
-        espnowDelay(100);  // Wait for response.
+        espnowDelay(100); // Wait for response.
 
         // A connection can be serialized and stored for later use.
         // Note that this saves the current state only, so if encrypted communication between the nodes happen after this, the stored state is invalid.
@@ -380,7 +383,7 @@ void    loop() {
         espnowMessage = String(F("This message is no longer encrypted when received by node ")) + peerMac;
         Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
         espnowNode.attemptTransmission(espnowMessage, false);
-        espnowDelay(100);  // Wait for response.
+        espnowDelay(100); // Wait for response.
         Serial.println(F("Cannot read the encrypted response..."));
 
         // Let's re-add our stored connection so we can communicate properly with targetBSSID again!
@@ -389,7 +392,7 @@ void    loop() {
         espnowMessage = String(F("This message is once again encrypted when received by node ")) + peerMac;
         Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
         espnowNode.attemptTransmission(espnowMessage, false);
-        espnowDelay(100);  // Wait for response.
+        espnowDelay(100); // Wait for response.
 
         Serial.println();
         // If we want to remove the encrypted connection on both nodes, we can do it like this.
@@ -400,7 +403,7 @@ void    loop() {
           espnowMessage = String(F("This message is only received by node ")) + peerMac + F(". Transmitting in this way will not change the transmission state of the sender.");
           Serial.println(String(F("Transmitting: ")) + espnowMessage);
           espnowNode.attemptTransmission(espnowMessage, EspnowNetworkInfo(targetBSSID));
-          espnowDelay(100);  // Wait for response.
+          espnowDelay(100); // Wait for response.
 
           Serial.println();
 
@@ -420,7 +423,7 @@ void    loop() {
             espnowMessage = String(F("Due to encrypted connection expiration, this message is no longer encrypted when received by node ")) + peerMac;
             Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
             espnowNode.attemptTransmission(espnowMessage, false);
-            espnowDelay(100);  // Wait for response.
+            espnowDelay(100); // Wait for response.
           }
 
           // Or if we prefer we can just let the library automatically create brief encrypted connections which are long enough to transmit an encrypted message.
@@ -429,9 +432,9 @@ void    loop() {
           espnowMessage = F("This message is always encrypted, regardless of receiver.");
           Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
           espnowNode.attemptAutoEncryptingTransmission(espnowMessage);
-          espnowDelay(100);  // Wait for response.
+          espnowDelay(100); // Wait for response.
         } else {
-          Serial.println(String(F("Ooops! Encrypted connection removal failed. Status: ")) + String(static_cast<int>(removalOutcome)));
+          Serial.println(String(F("Ooops! Encrypted connection removal failed. Status: ")) +  String(static_cast<int>(removalOutcome)));
         }
 
         // Finally, should you ever want to stop other parties from sending unencrypted messages to the node
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino b/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
index 811b07f0ab..3ae8567e16 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
@@ -8,7 +8,7 @@
    Or "floodingMesh.getEspnowMeshBackend().setBroadcastTransmissionRedundancy(uint8_t redundancy)" (default 1) at the cost of longer transmission times.
 */
 
-#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
+#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
 
 #include <ESP8266WiFi.h>
 #include <TypeConversionFunctions.h>
@@ -28,26 +28,28 @@ namespace TypeCast = MeshTypeConversionFunctions;
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char exampleMeshName[] PROGMEM     = "MeshNode_";                    // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
-constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
+constexpr char exampleMeshName[] PROGMEM = "MeshNode_"; // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
+constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO"; // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
 
 // A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a default Kok set, but it can be replaced if desired.
 // All ESP-NOW keys below must match in an encrypted connection pair for encrypted communication to be possible.
 // Note that it is also possible to use Strings as key seeds instead of arrays.
-uint8_t espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting transmissions of encrypted connections.
-                                             0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11 };
-uint8_t espnowHashKey[16]                = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44,  // This is the secret key used for HMAC during encrypted connection requests.
-                              0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD };
+uint8_t espnowEncryptedConnectionKey[16] = {0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting transmissions of encrypted connections.
+                                            0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11
+                                           };
+uint8_t espnowHashKey[16] = {0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44, // This is the secret key used for HMAC during encrypted connection requests.
+                             0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD
+                            };
 
-bool meshMessageHandler(String& message, FloodingMesh& meshInstance);
+bool meshMessageHandler(String &message, FloodingMesh &meshInstance);
 
 /* Create the mesh node object */
 FloodingMesh floodingMesh = FloodingMesh(meshMessageHandler, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
 
-bool   theOne = true;
+bool theOne = true;
 String theOneMac;
 
-bool useLED = false;  // Change this to true if you wish the onboard LED to mark The One.
+bool useLED = false; // Change this to true if you wish the onboard LED to mark The One.
 
 /**
    Callback for when a message is received from the mesh network.
@@ -60,7 +62,7 @@ bool useLED = false;  // Change this to true if you wish the onboard LED to mark
    @param meshInstance The FloodingMesh instance that received the message.
    @return True if this node should forward the received message to other nodes. False otherwise.
 */
-bool meshMessageHandler(String& message, FloodingMesh& meshInstance) {
+bool meshMessageHandler(String &message, FloodingMesh &meshInstance) {
   int32_t delimiterIndex = message.indexOf(meshInstance.metadataDelimiter());
   if (delimiterIndex == 0) {
     Serial.print(String(F("Message received from STA MAC ")) + meshInstance.getEspnowMeshBackend().getSenderMac() + F(": "));
@@ -70,13 +72,13 @@ bool meshMessageHandler(String& message, FloodingMesh& meshInstance) {
 
     if (potentialMac >= theOneMac) {
       if (potentialMac > theOneMac) {
-        theOne    = false;
+        theOne = false;
         theOneMac = potentialMac;
       }
 
       if (useLED && !theOne) {
         bool ledState = message.charAt(1) == '1';
-        digitalWrite(LED_BUILTIN, ledState);  // Turn LED on/off (LED_BUILTIN is active low)
+        digitalWrite(LED_BUILTIN, ledState); // Turn LED on/off (LED_BUILTIN is active low)
       }
 
       return true;
@@ -85,18 +87,18 @@ bool meshMessageHandler(String& message, FloodingMesh& meshInstance) {
     }
   } else if (delimiterIndex > 0) {
     if (meshInstance.getOriginMac() == theOneMac) {
-      uint32_t totalBroadcasts = strtoul(message.c_str(), nullptr, 0);  // strtoul stops reading input when an invalid character is discovered.
+      uint32_t totalBroadcasts = strtoul(message.c_str(), nullptr, 0); // strtoul stops reading input when an invalid character is discovered.
 
       // Static variables are only initialized once.
       static uint32_t firstBroadcast = totalBroadcasts;
 
-      if (totalBroadcasts - firstBroadcast >= 100) {  // Wait a little to avoid start-up glitches
-        static uint32_t missedBroadcasts        = 1;  // Starting at one to compensate for initial -1 below.
+      if (totalBroadcasts - firstBroadcast >= 100) { // Wait a little to avoid start-up glitches
+        static uint32_t missedBroadcasts = 1; // Starting at one to compensate for initial -1 below.
         static uint32_t previousTotalBroadcasts = totalBroadcasts;
         static uint32_t totalReceivedBroadcasts = 0;
         totalReceivedBroadcasts++;
 
-        missedBroadcasts += totalBroadcasts - previousTotalBroadcasts - 1;  // We expect an increment by 1.
+        missedBroadcasts += totalBroadcasts - previousTotalBroadcasts - 1; // We expect an increment by 1.
         previousTotalBroadcasts = totalBroadcasts;
 
         if (totalReceivedBroadcasts % 50 == 0) {
@@ -134,14 +136,14 @@ void setup() {
   Serial.println(F("Setting up mesh node..."));
 
   floodingMesh.begin();
-  floodingMesh.activateAP();  // Required to receive messages
+  floodingMesh.activateAP(); // Required to receive messages
 
-  uint8_t apMacArray[6] { 0 };
+  uint8_t apMacArray[6] {0};
   theOneMac = TypeCast::macToString(WiFi.softAPmacAddress(apMacArray));
 
   if (useLED) {
-    pinMode(LED_BUILTIN, OUTPUT);    // Initialize the LED_BUILTIN pin as an output
-    digitalWrite(LED_BUILTIN, LOW);  // Turn LED on (LED_BUILTIN is active low)
+    pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
+    digitalWrite(LED_BUILTIN, LOW); // Turn LED on (LED_BUILTIN is active low)
   }
 
   // Uncomment the lines below to use automatic AEAD encryption/decryption of messages sent/received via broadcast() and encryptedBroadcast().
@@ -151,14 +153,14 @@ void setup() {
   //floodingMesh.getEspnowMeshBackend().setEspnowMessageEncryptionKey(F("ChangeThisKeySeed_TODO")); // The message encryption key should always be set manually. Otherwise a default key (all zeroes) is used.
   //floodingMesh.getEspnowMeshBackend().setUseEncryptedMessages(true);
 
-  floodingMeshDelay(5000);  // Give some time for user to start the nodes
+  floodingMeshDelay(5000); // Give some time for user to start the nodes
 }
 
 int32_t timeOfLastProclamation = -10000;
-void    loop() {
-  static bool     ledState       = 1;
+void loop() {
+  static bool ledState = 1;
   static uint32_t benchmarkCount = 0;
-  static uint32_t loopStart      = millis();
+  static uint32_t loopStart = millis();
 
   // The floodingMeshDelay() method performs all the background operations for the FloodingMesh (via FloodingMesh::performMeshMaintenance()).
   // It is recommended to place one of these methods in the beginning of the loop(), unless there is a need to put them elsewhere.
@@ -175,7 +177,7 @@ void    loop() {
   if (theOne) {
     if (millis() - timeOfLastProclamation > 10000) {
       uint32_t startTime = millis();
-      ledState           = ledState ^ bool(benchmarkCount);  // Make other nodes' LEDs alternate between on and off once benchmarking begins.
+      ledState = ledState ^ bool(benchmarkCount); // Make other nodes' LEDs alternate between on and off once benchmarking begins.
 
       // Note: The maximum length of an unencrypted broadcast message is given by floodingMesh.maxUnencryptedMessageLength(). It is around 670 bytes by default.
       floodingMesh.broadcast(String(floodingMesh.metadataDelimiter()) + String(ledState) + theOneMac + F(" is The One."));
@@ -185,7 +187,7 @@ void    loop() {
       floodingMeshDelay(20);
     }
 
-    if (millis() - loopStart > 23000) {  // Start benchmarking the mesh once three proclamations have been made
+    if (millis() - loopStart > 23000) { // Start benchmarking the mesh once three proclamations have been made
       uint32_t startTime = millis();
       floodingMesh.broadcast(String(benchmarkCount++) + String(floodingMesh.metadataDelimiter()) + F(": Not a spoon in sight."));
       Serial.println(String(F("Benchmark broadcast done in ")) + String(millis() - startTime) + F(" ms."));
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino b/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
index 8321b2a94c..f68b81f181 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
@@ -1,4 +1,4 @@
-#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
+#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
 
 #include <ESP8266WiFi.h>
 #include <TcpIpMeshBackend.h>
@@ -19,15 +19,15 @@ namespace TypeCast = MeshTypeConversionFunctions;
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char exampleMeshName[] PROGMEM     = "MeshNode_";
-constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
+constexpr char exampleMeshName[] PROGMEM = "MeshNode_";
+constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO"; // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
 
-unsigned int requestNumber  = 0;
+unsigned int requestNumber = 0;
 unsigned int responseNumber = 0;
 
-String                 manageRequest(const String& request, MeshBackendBase& meshInstance);
-TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance);
-void                   networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance);
+String manageRequest(const String &request, MeshBackendBase &meshInstance);
+TransmissionStatusType manageResponse(const String &response, MeshBackendBase &meshInstance);
+void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance);
 
 /* Create the mesh node object */
 TcpIpMeshBackend tcpIpNode = TcpIpMeshBackend(manageRequest, manageResponse, networkFilter, FPSTR(exampleWiFiPassword), FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
@@ -39,13 +39,13 @@ TcpIpMeshBackend tcpIpNode = TcpIpMeshBackend(manageRequest, manageResponse, net
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
 */
-String manageRequest(const String& request, MeshBackendBase& meshInstance) {
+String manageRequest(const String &request, MeshBackendBase &meshInstance) {
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+  if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
-    (void)tcpIpInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
+    (void)tcpIpInstance; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
     Serial.print(F("TCP/IP: "));
   } else {
     Serial.print(F("UNKNOWN!: "));
@@ -69,14 +69,14 @@ String manageRequest(const String& request, MeshBackendBase& meshInstance) {
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The status code resulting from the response, as an int
 */
-TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance) {
+TransmissionStatusType manageResponse(const String &response, MeshBackendBase &meshInstance) {
   TransmissionStatusType statusCode = TransmissionStatusType::TRANSMISSION_COMPLETE;
 
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+  if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+  } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
     Serial.print(F("TCP/IP: "));
 
     // Getting the sent message like this will work as long as ONLY(!) TCP/IP is used.
@@ -105,20 +105,20 @@ TransmissionStatusType manageResponse(const String& response, MeshBackendBase& m
    @param numberOfNetworks The number of networks found in the WiFi scan.
    @param meshInstance The MeshBackendBase instance that called the function.
 */
-void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
+void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance) {
   // Note that the network index of a given node may change whenever a new scan is done.
   for (int networkIndex = 0; networkIndex < numberOfNetworks; ++networkIndex) {
-    String currentSSID   = WiFi.SSID(networkIndex);
-    int    meshNameIndex = currentSSID.indexOf(meshInstance.getMeshName());
+    String currentSSID = WiFi.SSID(networkIndex);
+    int meshNameIndex = currentSSID.indexOf(meshInstance.getMeshName());
 
     /* Connect to any _suitable_ APs which contain meshInstance.getMeshName() */
     if (meshNameIndex >= 0) {
       uint64_t targetNodeID = TypeCast::stringToUint64(currentSSID.substring(meshNameIndex + meshInstance.getMeshName().length()));
 
       if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID())) {
-        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+        if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
           espnowInstance->connectionQueue().emplace_back(networkIndex);
-        } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+        } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
           tcpIpInstance->connectionQueue().emplace_back(networkIndex);
         } else {
           Serial.println(F("Invalid mesh backend!"));
@@ -139,10 +139,10 @@ void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
 
    @return True if attemptTransmission should continue with the next entry in the connectionQueue. False if attemptTransmission should stop.
 */
-bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
+bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase &meshInstance) {
   // The default hook only returns true and does nothing else.
 
-  if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+  if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
     if (tcpIpInstance->latestTransmissionOutcomes().back().transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE) {
       // Our last request got a response, so time to create a new request.
       meshInstance.setMessage(String(F("Hello world request #")) + String(++requestNumber) + F(" from ")
@@ -174,8 +174,8 @@ void setup() {
 
   /* Initialise the mesh node */
   tcpIpNode.begin();
-  tcpIpNode.activateAP();                             // Each AP requires a separate server port.
-  tcpIpNode.setStaticIP(IPAddress(192, 168, 4, 22));  // Activate static IP mode to speed up connection times.
+  tcpIpNode.activateAP(); // Each AP requires a separate server port.
+  tcpIpNode.setStaticIP(IPAddress(192, 168, 4, 22)); // Activate static IP mode to speed up connection times.
 
   // Storing our message in the TcpIpMeshBackend instance is not required, but can be useful for organizing code, especially when using many TcpIpMeshBackend instances.
   // Note that calling the multi-recipient tcpIpNode.attemptTransmission will replace the stored message with whatever message is transmitted.
@@ -185,9 +185,9 @@ void setup() {
 }
 
 int32_t timeOfLastScan = -10000;
-void    loop() {
-  if (millis() - timeOfLastScan > 3000                                           // Give other nodes some time to connect between data transfers.
-      || (WiFi.status() != WL_CONNECTED && millis() - timeOfLastScan > 2000)) {  // Scan for networks with two second intervals when not already connected.
+void loop() {
+  if (millis() - timeOfLastScan > 3000 // Give other nodes some time to connect between data transfers.
+      || (WiFi.status() != WL_CONNECTED && millis() - timeOfLastScan > 2000)) { // Scan for networks with two second intervals when not already connected.
 
     // attemptTransmission(message, scan, scanAllWiFiChannels, concludingDisconnect, initialDisconnect = false)
     tcpIpNode.attemptTransmission(tcpIpNode.getMessage(), true, false, false);
@@ -202,7 +202,7 @@ void    loop() {
     if (tcpIpNode.latestTransmissionOutcomes().empty()) {
       Serial.println(F("No mesh AP found."));
     } else {
-      for (TransmissionOutcome& transmissionOutcome : tcpIpNode.latestTransmissionOutcomes()) {
+      for (TransmissionOutcome &transmissionOutcome : tcpIpNode.latestTransmissionOutcomes()) {
         if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED) {
           Serial.println(String(F("Transmission failed to mesh AP ")) + transmissionOutcome.SSID());
         } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED) {
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino b/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
index 419330d227..19c555a235 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
@@ -15,12 +15,13 @@
 
 #ifndef APSSID
 #define APSSID "APSSID"
-#define APPSK "APPSK"
+#define APPSK  "APPSK"
 #endif
 
 ESP8266WiFiMulti WiFiMulti;
 
 void setup() {
+
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -36,6 +37,8 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP(APSSID, APPSK);
+
+
 }
 
 void update_started() {
@@ -54,9 +57,11 @@ void update_error(int err) {
   Serial.printf("CALLBACK:  HTTP update fatal error code %d\n", err);
 }
 
+
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
+
     WiFiClient client;
 
     // The line below is optional. It can be used to blink the LED on the board during flashing
@@ -92,3 +97,4 @@ void loop() {
     }
   }
 }
+
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
index 784eea2828..6541d047fd 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
@@ -17,10 +17,11 @@ ESP8266WiFiMulti WiFiMulti;
 
 #ifndef APSSID
 #define APSSID "APSSID"
-#define APPSK "APPSK"
+#define APPSK  "APPSK"
 #endif
 
 void setup() {
+
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -36,11 +37,13 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP(APSSID, APPSK);
+
 }
 
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
+
     Serial.println("Update LittleFS...");
 
     WiFiClient client;
@@ -74,3 +77,4 @@ void loop() {
     }
   }
 }
+
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
index 928d360716..beb613897c 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
@@ -18,7 +18,7 @@
 
 #ifndef APSSID
 #define APSSID "APSSID"
-#define APPSK "APPSK"
+#define APPSK  "APPSK"
 #endif
 
 ESP8266WiFiMulti WiFiMulti;
@@ -50,6 +50,7 @@ void setClock() {
 }
 
 void setup() {
+
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -73,17 +74,18 @@ void setup() {
   Serial.println(numCerts);
   if (numCerts == 0) {
     Serial.println(F("No certs found. Did you run certs-from-mozill.py and upload the LittleFS directory before running?"));
-    return;  // Can't connect to anything w/o certs!
+    return; // Can't connect to anything w/o certs!
   }
 }
 
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
+
     setClock();
 
     BearSSL::WiFiClientSecure client;
-    bool                      mfln = client.probeMaxFragmentLength("server", 443, 1024);  // server must be the same as in ESPhttpUpdate.update()
+    bool mfln = client.probeMaxFragmentLength("server", 443, 1024);  // server must be the same as in ESPhttpUpdate.update()
     Serial.printf("MFLN supported: %s\n", mfln ? "yes" : "no");
     if (mfln) {
       client.setBufferSizes(1024, 1024);
@@ -102,6 +104,7 @@ void loop() {
     // Or:
     //t_httpUpdate_return ret = ESPhttpUpdate.update(client, "server", 443, "file.bin");
 
+
     switch (ret) {
       case HTTP_UPDATE_FAILED:
         Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s\n", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
index 9b4adcfb5c..e196ef6419 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
@@ -23,7 +23,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
 ESP8266WiFiMulti WiFiMulti;
@@ -50,12 +50,13 @@ TQIDAQAB
 -----END PUBLIC KEY-----
 )EOF";
 #if MANUAL_SIGNING
-BearSSL::PublicKey*       signPubKey = nullptr;
-BearSSL::HashSHA256*      hash;
-BearSSL::SigningVerifier* sign;
+BearSSL::PublicKey *signPubKey = nullptr;
+BearSSL::HashSHA256 *hash;
+BearSSL::SigningVerifier *sign;
 #endif
 
 void setup() {
+
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -72,22 +73,24 @@ void setup() {
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP(STASSID, STAPSK);
 
-#if MANUAL_SIGNING
+  #if MANUAL_SIGNING
   signPubKey = new BearSSL::PublicKey(pubkey);
-  hash       = new BearSSL::HashSHA256();
-  sign       = new BearSSL::SigningVerifier(signPubKey);
-#endif
+  hash = new BearSSL::HashSHA256();
+  sign = new BearSSL::SigningVerifier(signPubKey);
+  #endif
 }
 
+
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
+
     WiFiClient client;
 
-#if MANUAL_SIGNING
+    #if MANUAL_SIGNING
     // Ensure all updates are signed appropriately.  W/o this call, all will be accepted.
     Update.installSignature(hash, sign);
-#endif
+    #endif
     // If the key files are present in the build directory, signing will be
     // enabled using them automatically
 
@@ -111,3 +114,4 @@ void loop() {
   }
   delay(10000);
 }
+
diff --git a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
index de76d53816..f0a9de1225 100644
--- a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
+++ b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
@@ -31,6 +31,7 @@
 
 */
 
+
 #include <ESP8266WiFi.h>
 #include <WiFiClient.h>
 #include <ESP8266WebServer.h>
@@ -42,41 +43,44 @@
    Global defines and vars
 */
 
-#define TIMEZONE_OFFSET 1        // CET
-#define DST_OFFSET 1             // CEST
-#define UPDATE_CYCLE (1 * 1000)  // every second
+#define TIMEZONE_OFFSET     1                                   // CET
+#define DST_OFFSET          1                                   // CEST
+#define UPDATE_CYCLE        (1 * 1000)                          // every second
 
-#define SERVICE_PORT 80  // HTTP port
+#define SERVICE_PORT        80                                  // HTTP port
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
-const char* password = STAPSK;
+const char*                   ssid                    = STASSID;
+const char*                   password                = STAPSK;
 
-char*                       pcHostDomain         = 0;      // Negotiated host domain
-bool                        bHostDomainConfirmed = false;  // Flags the confirmation of the host domain
-MDNSResponder::hMDNSService hMDNSService         = 0;      // The handle of the clock service in the MDNS responder
+char*                         pcHostDomain            = 0;        // Negotiated host domain
+bool                          bHostDomainConfirmed    = false;    // Flags the confirmation of the host domain
+MDNSResponder::hMDNSService   hMDNSService            = 0;        // The handle of the clock service in the MDNS responder
 
 // HTTP server at port 'SERVICE_PORT' will respond to HTTP requests
-ESP8266WebServer server(SERVICE_PORT);
+ESP8266WebServer              server(SERVICE_PORT);
 
 /*
    getTimeString
 */
 const char* getTimeString(void) {
-  static char acTimeString[32];
-  time_t      now = time(nullptr);
+
+  static char   acTimeString[32];
+  time_t now = time(nullptr);
   ctime_r(&now, acTimeString);
-  size_t stLength;
-  while (((stLength = strlen(acTimeString))) && ('\n' == acTimeString[stLength - 1])) {
-    acTimeString[stLength - 1] = 0;  // Remove trailing line break...
+  size_t    stLength;
+  while (((stLength = strlen(acTimeString))) &&
+         ('\n' == acTimeString[stLength - 1])) {
+    acTimeString[stLength - 1] = 0; // Remove trailing line break...
   }
   return acTimeString;
 }
 
+
 /*
    setClock
 
@@ -96,10 +100,12 @@ void setClock(void) {
   Serial.printf("Current time: %s\n", getTimeString());
 }
 
+
 /*
    setStationHostname
 */
 bool setStationHostname(const char* p_pcHostname) {
+
   if (p_pcHostname) {
     WiFi.hostname(p_pcHostname);
     Serial.printf("setDeviceHostname: Station hostname is set to '%s'\n", p_pcHostname);
@@ -107,6 +113,7 @@ bool setStationHostname(const char* p_pcHostname) {
   return true;
 }
 
+
 /*
    MDNSDynamicServiceTxtCallback
 
@@ -125,6 +132,7 @@ void MDNSDynamicServiceTxtCallback(const MDNSResponder::hMDNSService p_hService)
   }
 }
 
+
 /*
    MDNSProbeResultCallback
 
@@ -136,6 +144,7 @@ void MDNSDynamicServiceTxtCallback(const MDNSResponder::hMDNSService p_hService)
 
 */
 void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
+
   Serial.println("MDNSProbeResultCallback");
   Serial.printf("MDNSProbeResultCallback: Host domain '%s.local' is %s\n", p_pcDomainName.c_str(), (p_bProbeResult ? "free" : "already USED!"));
   if (true == p_bProbeResult) {
@@ -167,6 +176,7 @@ void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
   }
 }
 
+
 /*
    handleHTTPClient
 */
@@ -176,8 +186,7 @@ void handleHTTPRequest() {
   Serial.println("HTTP Request");
 
   // Get current time
-  time_t now = time(nullptr);
-  ;
+  time_t now = time(nullptr);;
   struct tm timeinfo;
   gmtime_r(&now, &timeinfo);
 
@@ -222,9 +231,10 @@ void setup(void) {
   // Setup MDNS responder
   MDNS.setHostProbeResultCallback(hostProbeResult);
   // Init the (currently empty) host domain string with 'esp8266'
-  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) || (!MDNS.begin(pcHostDomain))) {
+  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) ||
+      (!MDNS.begin(pcHostDomain))) {
     Serial.println("Error setting up MDNS responder!");
-    while (1) {  // STOP
+    while (1) { // STOP
       delay(1000);
     }
   }
@@ -240,6 +250,7 @@ void setup(void) {
    loop
 */
 void loop(void) {
+
   // Check if a request has come in
   server.handleClient();
   // Allow MDNS processing
@@ -247,6 +258,7 @@ void loop(void) {
 
   static esp8266::polledTimeout::periodicMs timeout(UPDATE_CYCLE);
   if (timeout.expired()) {
+
     if (hMDNSService) {
       // Just trigger a new MDNS announcement, this will lead to a call to
       // 'MDNSDynamicServiceTxtCallback', which will update the time TXT item
diff --git a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
index 0da915d45d..17b29ec57c 100644
--- a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
+++ b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
@@ -29,6 +29,7 @@
 
 */
 
+
 #include <ESP8266WiFi.h>
 #include <WiFiClient.h>
 #include <ESP8266WebServer.h>
@@ -38,31 +39,33 @@
    Global defines and vars
 */
 
-#define SERVICE_PORT 80  // HTTP port
+#define SERVICE_PORT                                    80                                  // HTTP port
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
-const char* password = STAPSK;
+const char*                                    ssid                    = STASSID;
+const char*                                    password                = STAPSK;
 
-char*                            pcHostDomain         = 0;      // Negotiated host domain
-bool                             bHostDomainConfirmed = false;  // Flags the confirmation of the host domain
-MDNSResponder::hMDNSService      hMDNSService         = 0;      // The handle of the http service in the MDNS responder
-MDNSResponder::hMDNSServiceQuery hMDNSServiceQuery    = 0;      // The handle of the 'http.tcp' service query in the MDNS responder
+char*                                          pcHostDomain            = 0;        // Negotiated host domain
+bool                                           bHostDomainConfirmed    = false;    // Flags the confirmation of the host domain
+MDNSResponder::hMDNSService                    hMDNSService            = 0;        // The handle of the http service in the MDNS responder
+MDNSResponder::hMDNSServiceQuery               hMDNSServiceQuery       = 0;        // The handle of the 'http.tcp' service query in the MDNS responder
 
-const String cstrNoHTTPServices = "Currently no 'http.tcp' services in the local network!<br/>";
-String       strHTTPServices    = cstrNoHTTPServices;
+const String                                   cstrNoHTTPServices      = "Currently no 'http.tcp' services in the local network!<br/>";
+String                                         strHTTPServices         = cstrNoHTTPServices;
 
 // HTTP server at port 'SERVICE_PORT' will respond to HTTP requests
-ESP8266WebServer server(SERVICE_PORT);
+ESP8266WebServer                                     server(SERVICE_PORT);
+
 
 /*
    setStationHostname
 */
 bool setStationHostname(const char* p_pcHostname) {
+
   if (p_pcHostname) {
     WiFi.hostname(p_pcHostname);
     Serial.printf("setStationHostname: Station hostname is set to '%s'\n", p_pcHostname);
@@ -77,25 +80,25 @@ bool setStationHostname(const char* p_pcHostname) {
 void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSResponder::AnswerType answerType, bool p_bSetContent) {
   String answerInfo;
   switch (answerType) {
-    case MDNSResponder::AnswerType::ServiceDomain:
+    case MDNSResponder::AnswerType::ServiceDomain :
       answerInfo = "ServiceDomain " + String(serviceInfo.serviceDomain());
       break;
-    case MDNSResponder::AnswerType::HostDomainAndPort:
+    case MDNSResponder::AnswerType::HostDomainAndPort :
       answerInfo = "HostDomainAndPort " + String(serviceInfo.hostDomain()) + ":" + String(serviceInfo.hostPort());
       break;
-    case MDNSResponder::AnswerType::IP4Address:
+    case MDNSResponder::AnswerType::IP4Address :
       answerInfo = "IP4Address ";
       for (IPAddress ip : serviceInfo.IP4Adresses()) {
         answerInfo += "- " + ip.toString();
       };
       break;
-    case MDNSResponder::AnswerType::Txt:
+    case MDNSResponder::AnswerType::Txt :
       answerInfo = "TXT " + String(serviceInfo.strKeyValue());
       for (auto kv : serviceInfo.keyValues()) {
         answerInfo += "\nkv : " + String(kv.first) + " : " + String(kv.second);
       }
       break;
-    default:
+    default :
       answerInfo = "Unknown Answertype";
   }
   Serial.printf("Answer %s %s\n", answerInfo.c_str(), p_bSetContent ? "Modified" : "Deleted");
@@ -106,10 +109,10 @@ void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSRe
    Probe result callback for Services
 */
 
-void serviceProbeResult(String                            p_pcServiceName,
+void serviceProbeResult(String p_pcServiceName,
                         const MDNSResponder::hMDNSService p_hMDNSService,
-                        bool                              p_bProbeResult) {
-  (void)p_hMDNSService;
+                        bool p_bProbeResult) {
+  (void) p_hMDNSService;
   Serial.printf("MDNSServiceProbeResultCallback: Service %s probe %s\n", p_pcServiceName.c_str(), (p_bProbeResult ? "succeeded." : "failed!"));
 }
 
@@ -125,6 +128,7 @@ void serviceProbeResult(String                            p_pcServiceName,
 */
 
 void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
+
   Serial.printf("MDNSHostProbeResultCallback: Host domain '%s.local' is %s\n", p_pcDomainName.c_str(), (p_bProbeResult ? "free" : "already USED!"));
 
   if (true == p_bProbeResult) {
@@ -176,13 +180,13 @@ void handleHTTPRequest() {
   Serial.println("");
   Serial.println("HTTP Request");
 
-  IPAddress ip    = WiFi.localIP();
-  String    ipStr = ip.toString();
-  String    s     = "<!DOCTYPE HTML>\r\n<html><h3><head>Hello from ";
+  IPAddress ip = WiFi.localIP();
+  String ipStr = ip.toString();
+  String s = "<!DOCTYPE HTML>\r\n<html><h3><head>Hello from ";
   s += WiFi.hostname() + ".local at " + WiFi.localIP().toString() + "</h3></head>";
   s += "<br/><h4>Local HTTP services are :</h4>";
   s += "<ol>";
-  for (auto info : MDNS.answerInfo(hMDNSServiceQuery)) {
+  for (auto info :  MDNS.answerInfo(hMDNSServiceQuery)) {
     s += "<li>";
     s += info.serviceDomain();
     if (info.hostDomainAvailable()) {
@@ -241,9 +245,10 @@ void setup(void) {
   MDNS.setHostProbeResultCallback(hostProbeResult);
 
   // Init the (currently empty) host domain string with 'esp8266'
-  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) || (!MDNS.begin(pcHostDomain))) {
+  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) ||
+      (!MDNS.begin(pcHostDomain))) {
     Serial.println(" Error setting up MDNS responder!");
-    while (1) {  // STOP
+    while (1) { // STOP
       delay(1000);
     }
   }
@@ -260,3 +265,6 @@ void loop(void) {
   // Allow MDNS processing
   MDNS.update();
 }
+
+
+
diff --git a/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino b/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
index 290fef2938..87d03900f3 100644
--- a/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
+++ b/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
@@ -14,12 +14,12 @@
 
 #ifndef APSSID
 #define APSSID "your-apssid"
-#define APPSK "your-password"
+#define APPSK  "your-password"
 #endif
 
 #ifndef STASSID
 #define STASSID "your-sta"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
 // includes
@@ -30,19 +30,20 @@
 #include <ArduinoOTA.h>
 #include <ESP8266mDNS.h>
 
+
 /**
    @brief mDNS and OTA Constants
    @{
 */
-#define HOSTNAME "ESP8266-OTA-"  ///< Hostname. The setup function adds the Chip ID at the end.
+#define HOSTNAME "ESP8266-OTA-" ///< Hostname. The setup function adds the Chip ID at the end.
 /// @}
 
 /**
    @brief Default WiFi connection information.
    @{
 */
-const char* ap_default_ssid = APSSID;  ///< Default SSID.
-const char* ap_default_psk  = APPSK;   ///< Default PSK.
+const char* ap_default_ssid = APSSID; ///< Default SSID.
+const char* ap_default_psk = APPSK; ///< Default PSK.
 /// @}
 
 /// Uncomment the next line for verbose output over UART.
@@ -58,7 +59,7 @@ const char* ap_default_psk  = APPSK;   ///< Default PSK.
    and the WiFi PSK in the second line.
    Line separator can be \r\n (CR LF) \r or \n.
 */
-bool loadConfig(String* ssid, String* pass) {
+bool loadConfig(String *ssid, String *pass) {
   // open file for reading.
   File configFile = LittleFS.open("/cl_conf.txt", "r");
   if (!configFile) {
@@ -74,11 +75,11 @@ bool loadConfig(String* ssid, String* pass) {
   content.trim();
 
   // Check if there is a second line available.
-  int8_t  pos = content.indexOf("\r\n");
-  uint8_t le  = 2;
+  int8_t pos = content.indexOf("\r\n");
+  uint8_t le = 2;
   // check for linux and mac line ending.
   if (pos == -1) {
-    le  = 1;
+    le = 1;
     pos = content.indexOf("\n");
     if (pos == -1) {
       pos = content.indexOf("\r");
@@ -109,7 +110,8 @@ bool loadConfig(String* ssid, String* pass) {
 #endif
 
   return true;
-}  // loadConfig
+} // loadConfig
+
 
 /**
    @brief Save WiFi SSID and PSK to configuration file.
@@ -117,7 +119,7 @@ bool loadConfig(String* ssid, String* pass) {
    @param pass PSK as string pointer,
    @return True or False.
 */
-bool saveConfig(String* ssid, String* pass) {
+bool saveConfig(String *ssid, String *pass) {
   // Open config file for writing.
   File configFile = LittleFS.open("/cl_conf.txt", "w");
   if (!configFile) {
@@ -133,14 +135,15 @@ bool saveConfig(String* ssid, String* pass) {
   configFile.close();
 
   return true;
-}  // saveConfig
+} // saveConfig
+
 
 /**
    @brief Arduino setup function.
 */
 void setup() {
   String station_ssid = "";
-  String station_psk  = "";
+  String station_psk = "";
 
   Serial.begin(115200);
 
@@ -159,6 +162,7 @@ void setup() {
   Serial.println("Hostname: " + hostname);
   //Serial.println(WiFi.hostname());
 
+
   // Initialize file system.
   if (!LittleFS.begin()) {
     Serial.println("Failed to mount file system");
@@ -166,9 +170,9 @@ void setup() {
   }
 
   // Load wifi connection information.
-  if (!loadConfig(&station_ssid, &station_psk)) {
+  if (! loadConfig(&station_ssid, &station_psk)) {
     station_ssid = STASSID;
-    station_psk  = STAPSK;
+    station_psk = STAPSK;
 
     Serial.println("No WiFi connection information available.");
   }
@@ -229,10 +233,11 @@ void setup() {
   }
 
   // Start OTA server.
-  ArduinoOTA.setHostname((const char*)hostname.c_str());
+  ArduinoOTA.setHostname((const char *)hostname.c_str());
   ArduinoOTA.begin();
 }
 
+
 /**
    @brief Arduino loop function.
 */
@@ -240,3 +245,4 @@ void loop() {
   // Handle OTA server.
   ArduinoOTA.handle();
 }
+
diff --git a/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino b/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
index ea3cbbd699..e85714d821 100644
--- a/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
+++ b/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
@@ -15,16 +15,17 @@
 
 */
 
+
 #include <ESP8266WiFi.h>
 #include <ESP8266mDNS.h>
 #include <WiFiClient.h>
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 // TCP server at port 80 will respond to HTTP requests
@@ -71,6 +72,7 @@ void setup(void) {
 }
 
 void loop(void) {
+
   MDNS.update();
 
   // Check if a client has connected
@@ -92,7 +94,7 @@ void loop(void) {
   // First line of HTTP request looks like "GET /path HTTP/1.1"
   // Retrieve the "/path" part by finding the spaces
   int addr_start = req.indexOf(' ');
-  int addr_end   = req.indexOf(' ', addr_start + 1);
+  int addr_end = req.indexOf(' ', addr_start + 1);
   if (addr_start == -1 || addr_end == -1) {
     Serial.print("Invalid request: ");
     Serial.println(req);
@@ -105,9 +107,9 @@ void loop(void) {
 
   String s;
   if (req == "/") {
-    IPAddress ip    = WiFi.localIP();
-    String    ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);
-    s               = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>Hello from ESP8266 at ";
+    IPAddress ip = WiFi.localIP();
+    String ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);
+    s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>Hello from ESP8266 at ";
     s += ipStr;
     s += "</html>\r\n\r\n";
     Serial.println("Sending 200");
@@ -119,3 +121,4 @@ void loop(void) {
 
   Serial.println("Done with client");
 }
+
diff --git a/libraries/ESP8266mDNS/src/ESP8266mDNS.cpp b/libraries/ESP8266mDNS/src/ESP8266mDNS.cpp
index 821b7010af..b5d7aac277 100644
--- a/libraries/ESP8266mDNS/src/ESP8266mDNS.cpp
+++ b/libraries/ESP8266mDNS/src/ESP8266mDNS.cpp
@@ -30,3 +30,4 @@
 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_MDNS)
 MDNSResponder MDNS;
 #endif
+
diff --git a/libraries/ESP8266mDNS/src/ESP8266mDNS.h b/libraries/ESP8266mDNS/src/ESP8266mDNS.h
index 3b6ccc6449..8b035a7986 100644
--- a/libraries/ESP8266mDNS/src/ESP8266mDNS.h
+++ b/libraries/ESP8266mDNS/src/ESP8266mDNS.h
@@ -41,13 +41,13 @@
 #ifndef __ESP8266MDNS_H
 #define __ESP8266MDNS_H
 
-#include "LEAmDNS.h"  // LEA
+#include "LEAmDNS.h"            // LEA
 
 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_MDNS)
 // Maps the implementation to use to the global namespace type
-using MDNSResponder = esp8266::MDNSImplementation::MDNSResponder;  // LEA
+using MDNSResponder = esp8266::MDNSImplementation::MDNSResponder;                // LEA
 
 extern MDNSResponder MDNS;
 #endif
 
-#endif  // __ESP8266MDNS_H
+#endif // __ESP8266MDNS_H
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.cpp b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
index 56e0568edc..4908a67e06 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
@@ -27,17 +27,19 @@
 
 #include "ESP8266mDNS.h"
 #include "LEAmDNS_Priv.h"
-#include <LwipIntf.h>  // LwipIntf::stateUpCB()
+#include <LwipIntf.h> // LwipIntf::stateUpCB()
 #include <lwip/igmp.h>
 #include <lwip/prot/dns.h>
 
 namespace esp8266
 {
+
 /*
     LEAmDNS
 */
 namespace MDNSImplementation
 {
+
 /**
     STRINGIZE
 */
@@ -48,35 +50,37 @@ namespace MDNSImplementation
 #define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
 #endif
 
-    /**
+
+/**
     INTERFACE
 */
 
-    /**
+/**
     MDNSResponder::MDNSResponder
 */
-    MDNSResponder::MDNSResponder(void) :
-        m_pServices(0),
+MDNSResponder::MDNSResponder(void)
+    :   m_pServices(0),
         m_pUDPContext(0),
         m_pcHostname(0),
         m_pServiceQueries(0),
         m_fnServiceTxtCallback(0)
-    {
-    }
+{
+}
 
-    /*
+/*
     MDNSResponder::~MDNSResponder
 */
-    MDNSResponder::~MDNSResponder(void)
-    {
-        _resetProbeStatus(false);
-        _releaseServiceQueries();
-        _releaseHostname();
-        _releaseUDPContext();
-        _releaseServices();
-    }
+MDNSResponder::~MDNSResponder(void)
+{
+
+    _resetProbeStatus(false);
+    _releaseServiceQueries();
+    _releaseHostname();
+    _releaseUDPContext();
+    _releaseServices();
+}
 
-    /*
+/*
     MDNSResponder::begin
 
     Set the host domain (for probing) and install WiFi event handlers for
@@ -85,60 +89,62 @@ namespace MDNSImplementation
     Finally the responder is (re)started
 
 */
-    bool MDNSResponder::begin(const char* p_pcHostname, const IPAddress& /*p_IPAddress*/, uint32_t /*p_u32TTL*/)
-    {
-        bool bResult = false;
+bool MDNSResponder::begin(const char* p_pcHostname, const IPAddress& /*p_IPAddress*/, uint32_t /*p_u32TTL*/)
+{
+    bool    bResult = false;
 
-        if (_setHostname(p_pcHostname))
-        {
-            bResult = _restart();
-        }
+    if (_setHostname(p_pcHostname))
+    {
+        bResult = _restart();
+    }
 
-        LwipIntf::stateUpCB(
-            [this](netif* intf)
-            {
-                (void)intf;
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] new Interface '%c%c' is UP! restarting\n"), intf->name[0], intf->name[1]));
-                _restart();
-            });
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] begin: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
-                     });
-
-        return bResult;
+    LwipIntf::stateUpCB
+    (
+        [this](netif * intf)
+    {
+        (void)intf;
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] new Interface '%c%c' is UP! restarting\n"), intf->name[0], intf->name[1]));
+        _restart();
     }
+    );
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] begin: FAILED for '%s'!\n"), (p_pcHostname ? : "-"));
+    });
+
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::close
 
     Ends the MDNS responder.
     Announced services are unannounced (by multicasting a goodbye message)
 
 */
-    bool MDNSResponder::close(void)
-    {
-        bool bResult = false;
+bool MDNSResponder::close(void)
+{
+    bool    bResult = false;
 
-        if (0 != m_pUDPContext)
-        {
-            _announce(false, true);
-            _resetProbeStatus(false);  // Stop probing
-            _releaseServiceQueries();
-            _releaseServices();
-            _releaseUDPContext();
-            _releaseHostname();
+    if (0 != m_pUDPContext)
+    {
+        _announce(false, true);
+        _resetProbeStatus(false);   // Stop probing
+        _releaseServiceQueries();
+        _releaseServices();
+        _releaseUDPContext();
+        _releaseHostname();
 
-            bResult = true;
-        }
-        else
-        {
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] close: Ignoring call to close!\n")););
-        }
-        return bResult;
+        bResult = true;
+    }
+    else
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] close: Ignoring call to close!\n")););
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::end
 
     Ends the MDNS responder.
@@ -146,12 +152,12 @@ namespace MDNSImplementation
 
 */
 
-    bool MDNSResponder::end(void)
-    {
-        return close();
-    }
+bool MDNSResponder::end(void)
+{
+    return close();
+}
 
-    /*
+/*
     MDNSResponder::setHostname
 
     Replaces the current hostname and restarts probing.
@@ -159,45 +165,48 @@ namespace MDNSImplementation
     name), the instance names are replaced also (and the probing is restarted).
 
 */
-    bool MDNSResponder::setHostname(const char* p_pcHostname)
+bool MDNSResponder::setHostname(const char* p_pcHostname)
+{
+
+    bool    bResult = false;
+
+    if (_setHostname(p_pcHostname))
     {
-        bool bResult = false;
+        m_HostProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
 
-        if (_setHostname(p_pcHostname))
+        // Replace 'auto-set' service names
+        bResult = true;
+        for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
         {
-            m_HostProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
-
-            // Replace 'auto-set' service names
-            bResult = true;
-            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+            if (pService->m_bAutoName)
             {
-                if (pService->m_bAutoName)
-                {
-                    bResult                                      = pService->setName(p_pcHostname);
-                    pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
-                }
+                bResult = pService->setName(p_pcHostname);
+                pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
             }
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setHostname: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
-                     });
-        return bResult;
     }
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setHostname: FAILED for '%s'!\n"), (p_pcHostname ? : "-"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::setHostname (LEGACY)
 */
-    bool MDNSResponder::setHostname(const String& p_strHostname)
-    {
-        return setHostname(p_strHostname.c_str());
-    }
+bool MDNSResponder::setHostname(const String& p_strHostname)
+{
 
-    /*
+    return setHostname(p_strHostname.c_str());
+}
+
+
+/*
     SERVICES
 */
 
-    /*
+/*
     MDNSResponder::addService
 
     Add service; using hostname if no name is explicitly provided for the service
@@ -205,447 +214,466 @@ namespace MDNSImplementation
     may be given. If not, it is added automatically.
 
 */
-    MDNSResponder::hMDNSService MDNSResponder::addService(const char* p_pcName,
-                                                          const char* p_pcService,
-                                                          const char* p_pcProtocol,
-                                                          uint16_t    p_u16Port)
+MDNSResponder::hMDNSService MDNSResponder::addService(const char* p_pcName,
+        const char* p_pcService,
+        const char* p_pcProtocol,
+        uint16_t p_u16Port)
+{
+
+    hMDNSService    hResult = 0;
+
+    if (((!p_pcName) ||                                                     // NO name OR
+            (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcName))) &&           // Fitting name
+            (p_pcService) &&
+            (MDNS_SERVICE_NAME_LENGTH >= os_strlen(p_pcService)) &&
+            (p_pcProtocol) &&
+            ((MDNS_SERVICE_PROTOCOL_LENGTH - 1) != os_strlen(p_pcProtocol)) &&
+            (p_u16Port))
     {
-        hMDNSService hResult = 0;
 
-        if (((!p_pcName) ||  // NO name OR
-             (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcName)))
-            &&  // Fitting name
-            (p_pcService) && (MDNS_SERVICE_NAME_LENGTH >= os_strlen(p_pcService)) && (p_pcProtocol) && ((MDNS_SERVICE_PROTOCOL_LENGTH - 1) != os_strlen(p_pcProtocol)) && (p_u16Port))
+        if (!_findService((p_pcName ? : m_pcHostname), p_pcService, p_pcProtocol))  // Not already used
         {
-            if (!_findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol))  // Not already used
+            if (0 != (hResult = (hMDNSService)_allocService(p_pcName, p_pcService, p_pcProtocol, p_u16Port)))
             {
-                if (0 != (hResult = (hMDNSService)_allocService(p_pcName, p_pcService, p_pcProtocol, p_u16Port)))
-                {
-                    // Start probing
-                    ((stcMDNSService*)hResult)->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
-                }
+
+                // Start probing
+                ((stcMDNSService*)hResult)->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
             }
-        }  // else: bad arguments
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: %s to add '%s.%s.%s'!\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcName ?: "-"), p_pcService, p_pcProtocol););
-        DEBUG_EX_ERR(if (!hResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: FAILED to add '%s.%s.%s'!\n"), (p_pcName ?: "-"), p_pcService, p_pcProtocol);
-                     });
-        return hResult;
-    }
+        }
+    }   // else: bad arguments
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: %s to add '%s.%s.%s'!\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcName ? : "-"), p_pcService, p_pcProtocol););
+    DEBUG_EX_ERR(if (!hResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: FAILED to add '%s.%s.%s'!\n"), (p_pcName ? : "-"), p_pcService, p_pcProtocol);
+    });
+    return hResult;
+}
 
-    /*
+/*
     MDNSResponder::removeService
 
     Unanounce a service (by sending a goodbye message) and remove it
     from the MDNS responder
 
 */
-    bool MDNSResponder::removeService(const MDNSResponder::hMDNSService p_hService)
-    {
-        stcMDNSService* pService = 0;
-        bool            bResult  = (((pService = _findService(p_hService))) && (_announceService(*pService, false)) && (_releaseService(pService)));
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeService: FAILED!\n"));
-                     });
-        return bResult;
-    }
+bool MDNSResponder::removeService(const MDNSResponder::hMDNSService p_hService)
+{
+
+    stcMDNSService* pService = 0;
+    bool    bResult = (((pService = _findService(p_hService))) &&
+                       (_announceService(*pService, false)) &&
+                       (_releaseService(pService)));
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeService: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::removeService
 */
-    bool MDNSResponder::removeService(const char* p_pcName,
-                                      const char* p_pcService,
-                                      const char* p_pcProtocol)
-    {
-        return removeService((hMDNSService)_findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol));
-    }
+bool MDNSResponder::removeService(const char* p_pcName,
+                                  const char* p_pcService,
+                                  const char* p_pcProtocol)
+{
+
+    return removeService((hMDNSService)_findService((p_pcName ? : m_pcHostname), p_pcService, p_pcProtocol));
+}
 
-    /*
+/*
     MDNSResponder::addService (LEGACY)
 */
-    bool MDNSResponder::addService(const String& p_strService,
-                                   const String& p_strProtocol,
-                                   uint16_t      p_u16Port)
-    {
-        return (0 != addService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str(), p_u16Port));
-    }
+bool MDNSResponder::addService(const String& p_strService,
+                               const String& p_strProtocol,
+                               uint16_t p_u16Port)
+{
+
+    return (0 != addService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str(), p_u16Port));
+}
 
-    /*
+/*
     MDNSResponder::setServiceName
 */
-    bool MDNSResponder::setServiceName(const MDNSResponder::hMDNSService p_hService,
-                                       const char*                       p_pcInstanceName)
-    {
-        stcMDNSService* pService = 0;
-        bool            bResult  = (((!p_pcInstanceName) || (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcInstanceName))) && ((pService = _findService(p_hService))) && (pService->setName(p_pcInstanceName)) && ((pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart)));
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setServiceName: FAILED for '%s'!\n"), (p_pcInstanceName ?: "-"));
-                     });
-        return bResult;
-    }
+bool MDNSResponder::setServiceName(const MDNSResponder::hMDNSService p_hService,
+                                   const char* p_pcInstanceName)
+{
+
+    stcMDNSService* pService = 0;
+    bool    bResult = (((!p_pcInstanceName) ||
+                        (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcInstanceName))) &&
+                       ((pService = _findService(p_hService))) &&
+                       (pService->setName(p_pcInstanceName)) &&
+                       ((pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart)));
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setServiceName: FAILED for '%s'!\n"), (p_pcInstanceName ? : "-"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     SERVICE TXT
 */
 
-    /*
+/*
     MDNSResponder::addServiceTxt
 
     Add a static service TXT item ('Key'='Value') to a service.
 
 */
-    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                         const char*                       p_pcKey,
-                                                         const char*                       p_pcValue)
+MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        const char* p_pcValue)
+{
+
+    hMDNSTxt    hTxt = 0;
+    stcMDNSService* pService = _findService(p_hService);
+    if (pService)
     {
-        hMDNSTxt        hTxt     = 0;
-        stcMDNSService* pService = _findService(p_hService);
-        if (pService)
-        {
-            hTxt = (hMDNSTxt)_addServiceTxt(pService, p_pcKey, p_pcValue, false);
-        }
-        DEBUG_EX_ERR(if (!hTxt)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
-                     });
-        return hTxt;
+        hTxt = (hMDNSTxt)_addServiceTxt(pService, p_pcKey, p_pcValue, false);
     }
+    DEBUG_EX_ERR(if (!hTxt)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ? : "-"), (p_pcValue ? : "-"));
+    });
+    return hTxt;
+}
 
-    /*
+/*
     MDNSResponder::addServiceTxt (uint32_t)
 
     Formats: http://www.cplusplus.com/reference/cstdio/printf/
 */
-    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                         const char*                       p_pcKey,
-                                                         uint32_t                          p_u32Value)
-    {
-        char acBuffer[32];
-        *acBuffer = 0;
-        sprintf(acBuffer, "%u", p_u32Value);
+MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        uint32_t p_u32Value)
+{
+    char    acBuffer[32];   *acBuffer = 0;
+    sprintf(acBuffer, "%u", p_u32Value);
 
-        return addServiceTxt(p_hService, p_pcKey, acBuffer);
-    }
+    return addServiceTxt(p_hService, p_pcKey, acBuffer);
+}
 
-    /*
+/*
     MDNSResponder::addServiceTxt (uint16_t)
 */
-    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                         const char*                       p_pcKey,
-                                                         uint16_t                          p_u16Value)
-    {
-        char acBuffer[16];
-        *acBuffer = 0;
-        sprintf(acBuffer, "%hu", p_u16Value);
+MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        uint16_t p_u16Value)
+{
+    char    acBuffer[16];   *acBuffer = 0;
+    sprintf(acBuffer, "%hu", p_u16Value);
 
-        return addServiceTxt(p_hService, p_pcKey, acBuffer);
-    }
+    return addServiceTxt(p_hService, p_pcKey, acBuffer);
+}
 
-    /*
+/*
     MDNSResponder::addServiceTxt (uint8_t)
 */
-    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                         const char*                       p_pcKey,
-                                                         uint8_t                           p_u8Value)
-    {
-        char acBuffer[8];
-        *acBuffer = 0;
-        sprintf(acBuffer, "%hhu", p_u8Value);
+MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        uint8_t p_u8Value)
+{
+    char    acBuffer[8];    *acBuffer = 0;
+    sprintf(acBuffer, "%hhu", p_u8Value);
 
-        return addServiceTxt(p_hService, p_pcKey, acBuffer);
-    }
+    return addServiceTxt(p_hService, p_pcKey, acBuffer);
+}
 
-    /*
+/*
     MDNSResponder::addServiceTxt (int32_t)
 */
-    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                         const char*                       p_pcKey,
-                                                         int32_t                           p_i32Value)
-    {
-        char acBuffer[32];
-        *acBuffer = 0;
-        sprintf(acBuffer, "%i", p_i32Value);
+MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        int32_t p_i32Value)
+{
+    char    acBuffer[32];   *acBuffer = 0;
+    sprintf(acBuffer, "%i", p_i32Value);
 
-        return addServiceTxt(p_hService, p_pcKey, acBuffer);
-    }
+    return addServiceTxt(p_hService, p_pcKey, acBuffer);
+}
 
-    /*
+/*
     MDNSResponder::addServiceTxt (int16_t)
 */
-    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                         const char*                       p_pcKey,
-                                                         int16_t                           p_i16Value)
-    {
-        char acBuffer[16];
-        *acBuffer = 0;
-        sprintf(acBuffer, "%hi", p_i16Value);
+MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        int16_t p_i16Value)
+{
+    char    acBuffer[16];   *acBuffer = 0;
+    sprintf(acBuffer, "%hi", p_i16Value);
 
-        return addServiceTxt(p_hService, p_pcKey, acBuffer);
-    }
+    return addServiceTxt(p_hService, p_pcKey, acBuffer);
+}
 
-    /*
+/*
     MDNSResponder::addServiceTxt (int8_t)
 */
-    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                         const char*                       p_pcKey,
-                                                         int8_t                            p_i8Value)
-    {
-        char acBuffer[8];
-        *acBuffer = 0;
-        sprintf(acBuffer, "%hhi", p_i8Value);
+MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        int8_t p_i8Value)
+{
+    char    acBuffer[8];    *acBuffer = 0;
+    sprintf(acBuffer, "%hhi", p_i8Value);
 
-        return addServiceTxt(p_hService, p_pcKey, acBuffer);
-    }
+    return addServiceTxt(p_hService, p_pcKey, acBuffer);
+}
 
-    /*
+/*
     MDNSResponder::removeServiceTxt
 
     Remove a static service TXT item from a service.
 */
-    bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                         const MDNSResponder::hMDNSTxt     p_hTxt)
-    {
-        bool bResult = false;
+bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
+                                     const MDNSResponder::hMDNSTxt p_hTxt)
+{
+
+    bool    bResult = false;
 
-        stcMDNSService* pService = _findService(p_hService);
-        if (pService)
+    stcMDNSService* pService = _findService(p_hService);
+    if (pService)
+    {
+        stcMDNSServiceTxt*  pTxt = _findServiceTxt(pService, p_hTxt);
+        if (pTxt)
         {
-            stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_hTxt);
-            if (pTxt)
-            {
-                bResult = _releaseServiceTxt(pService, pTxt);
-            }
+            bResult = _releaseServiceTxt(pService, pTxt);
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED!\n"));
-                     });
-        return bResult;
     }
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::removeServiceTxt
 */
-    bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                         const char*                       p_pcKey)
-    {
-        bool bResult = false;
+bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
+                                     const char* p_pcKey)
+{
 
-        stcMDNSService* pService = _findService(p_hService);
-        if (pService)
+    bool    bResult = false;
+
+    stcMDNSService* pService = _findService(p_hService);
+    if (pService)
+    {
+        stcMDNSServiceTxt*  pTxt = _findServiceTxt(pService, p_pcKey);
+        if (pTxt)
         {
-            stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_pcKey);
-            if (pTxt)
-            {
-                bResult = _releaseServiceTxt(pService, pTxt);
-            }
+            bResult = _releaseServiceTxt(pService, pTxt);
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED for '%s'!\n"), (p_pcKey ?: "-"));
-                     });
-        return bResult;
     }
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED for '%s'!\n"), (p_pcKey ? : "-"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::removeServiceTxt
 */
-    bool MDNSResponder::removeServiceTxt(const char* p_pcName,
-                                         const char* p_pcService,
-                                         const char* p_pcProtocol,
-                                         const char* p_pcKey)
-    {
-        bool bResult = false;
+bool MDNSResponder::removeServiceTxt(const char* p_pcName,
+                                     const char* p_pcService,
+                                     const char* p_pcProtocol,
+                                     const char* p_pcKey)
+{
+
+    bool    bResult = false;
 
-        stcMDNSService* pService = _findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol);
-        if (pService)
+    stcMDNSService* pService = _findService((p_pcName ? : m_pcHostname), p_pcService, p_pcProtocol);
+    if (pService)
+    {
+        stcMDNSServiceTxt*  pTxt = _findServiceTxt(pService, p_pcKey);
+        if (pTxt)
         {
-            stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_pcKey);
-            if (pTxt)
-            {
-                bResult = _releaseServiceTxt(pService, pTxt);
-            }
+            bResult = _releaseServiceTxt(pService, pTxt);
         }
-        return bResult;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::addServiceTxt (LEGACY)
 */
-    bool MDNSResponder::addServiceTxt(const char* p_pcService,
-                                      const char* p_pcProtocol,
-                                      const char* p_pcKey,
-                                      const char* p_pcValue)
-    {
-        return (0 != _addServiceTxt(_findService(m_pcHostname, p_pcService, p_pcProtocol), p_pcKey, p_pcValue, false));
-    }
+bool MDNSResponder::addServiceTxt(const char* p_pcService,
+                                  const char* p_pcProtocol,
+                                  const char* p_pcKey,
+                                  const char* p_pcValue)
+{
 
-    /*
+    return (0 != _addServiceTxt(_findService(m_pcHostname, p_pcService, p_pcProtocol), p_pcKey, p_pcValue, false));
+}
+
+/*
     MDNSResponder::addServiceTxt (LEGACY)
 */
-    bool MDNSResponder::addServiceTxt(const String& p_strService,
-                                      const String& p_strProtocol,
-                                      const String& p_strKey,
-                                      const String& p_strValue)
-    {
-        return (0 != _addServiceTxt(_findService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str()), p_strKey.c_str(), p_strValue.c_str(), false));
-    }
+bool MDNSResponder::addServiceTxt(const String& p_strService,
+                                  const String& p_strProtocol,
+                                  const String& p_strKey,
+                                  const String& p_strValue)
+{
 
-    /*
+    return (0 != _addServiceTxt(_findService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str()), p_strKey.c_str(), p_strValue.c_str(), false));
+}
+
+/*
     MDNSResponder::setDynamicServiceTxtCallback (global)
 
     Set a global callback for dynamic service TXT items. The callback is called, whenever
     service TXT items are needed.
 
 */
-    bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
-    {
-        m_fnServiceTxtCallback = p_fnCallback;
+bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
+{
 
-        return true;
-    }
+    m_fnServiceTxtCallback = p_fnCallback;
 
-    /*
+    return true;
+}
+
+/*
     MDNSResponder::setDynamicServiceTxtCallback (service specific)
 
     Set a service specific callback for dynamic service TXT items. The callback is called, whenever
     service TXT items are needed for the given service.
 
 */
-    bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::hMDNSService                      p_hService,
-                                                     MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
-    {
-        bool bResult = false;
+bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::hMDNSService p_hService,
+        MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
+{
 
-        stcMDNSService* pService = _findService(p_hService);
-        if (pService)
-        {
-            pService->m_fnTxtCallback = p_fnCallback;
+    bool    bResult = false;
 
-            bResult = true;
-        }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setDynamicServiceTxtCallback: FAILED!\n"));
-                     });
-        return bResult;
+    stcMDNSService* pService = _findService(p_hService);
+    if (pService)
+    {
+        pService->m_fnTxtCallback = p_fnCallback;
+
+        bResult = true;
     }
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setDynamicServiceTxtCallback: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::addDynamicServiceTxt
 */
-    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                                const char*                 p_pcKey,
-                                                                const char*                 p_pcValue)
-    {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt (%s=%s)\n"), p_pcKey, p_pcValue););
+MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        const char* p_pcValue)
+{
+    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt (%s=%s)\n"), p_pcKey, p_pcValue););
 
-        hMDNSTxt hTxt = 0;
+    hMDNSTxt        hTxt = 0;
 
-        stcMDNSService* pService = _findService(p_hService);
-        if (pService)
-        {
-            hTxt = _addServiceTxt(pService, p_pcKey, p_pcValue, true);
-        }
-        DEBUG_EX_ERR(if (!hTxt)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
-                     });
-        return hTxt;
+    stcMDNSService* pService = _findService(p_hService);
+    if (pService)
+    {
+        hTxt = _addServiceTxt(pService, p_pcKey, p_pcValue, true);
     }
+    DEBUG_EX_ERR(if (!hTxt)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ? : "-"), (p_pcValue ? : "-"));
+    });
+    return hTxt;
+}
 
-    /*
+/*
     MDNSResponder::addDynamicServiceTxt (uint32_t)
 */
-    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                                const char*                 p_pcKey,
-                                                                uint32_t                    p_u32Value)
-    {
-        char acBuffer[32];
-        *acBuffer = 0;
-        sprintf(acBuffer, "%u", p_u32Value);
+MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        uint32_t p_u32Value)
+{
 
-        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-    }
+    char    acBuffer[32];   *acBuffer = 0;
+    sprintf(acBuffer, "%u", p_u32Value);
 
-    /*
+    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+}
+
+/*
     MDNSResponder::addDynamicServiceTxt (uint16_t)
 */
-    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                                const char*                 p_pcKey,
-                                                                uint16_t                    p_u16Value)
-    {
-        char acBuffer[16];
-        *acBuffer = 0;
-        sprintf(acBuffer, "%hu", p_u16Value);
+MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        uint16_t p_u16Value)
+{
 
-        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-    }
+    char    acBuffer[16];   *acBuffer = 0;
+    sprintf(acBuffer, "%hu", p_u16Value);
+
+    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+}
 
-    /*
+/*
     MDNSResponder::addDynamicServiceTxt (uint8_t)
 */
-    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                                const char*                 p_pcKey,
-                                                                uint8_t                     p_u8Value)
-    {
-        char acBuffer[8];
-        *acBuffer = 0;
-        sprintf(acBuffer, "%hhu", p_u8Value);
+MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        uint8_t p_u8Value)
+{
 
-        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-    }
+    char    acBuffer[8];    *acBuffer = 0;
+    sprintf(acBuffer, "%hhu", p_u8Value);
+
+    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+}
 
-    /*
+/*
     MDNSResponder::addDynamicServiceTxt (int32_t)
 */
-    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                                const char*                 p_pcKey,
-                                                                int32_t                     p_i32Value)
-    {
-        char acBuffer[32];
-        *acBuffer = 0;
-        sprintf(acBuffer, "%i", p_i32Value);
+MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        int32_t p_i32Value)
+{
 
-        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-    }
+    char    acBuffer[32];   *acBuffer = 0;
+    sprintf(acBuffer, "%i", p_i32Value);
+
+    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+}
 
-    /*
+/*
     MDNSResponder::addDynamicServiceTxt (int16_t)
 */
-    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                                const char*                 p_pcKey,
-                                                                int16_t                     p_i16Value)
-    {
-        char acBuffer[16];
-        *acBuffer = 0;
-        sprintf(acBuffer, "%hi", p_i16Value);
+MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        int16_t p_i16Value)
+{
 
-        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-    }
+    char    acBuffer[16];   *acBuffer = 0;
+    sprintf(acBuffer, "%hi", p_i16Value);
+
+    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+}
 
-    /*
+/*
     MDNSResponder::addDynamicServiceTxt (int8_t)
 */
-    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                                const char*                 p_pcKey,
-                                                                int8_t                      p_i8Value)
-    {
-        char acBuffer[8];
-        *acBuffer = 0;
-        sprintf(acBuffer, "%hhi", p_i8Value);
+MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+        const char* p_pcKey,
+        int8_t p_i8Value)
+{
 
-        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-    }
+    char    acBuffer[8];    *acBuffer = 0;
+    sprintf(acBuffer, "%hhi", p_i8Value);
 
-    /**
+    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+}
+
+
+/**
     STATIC SERVICE QUERY (LEGACY)
 */
 
-    /*
+/*
     MDNSResponder::queryService
 
     Perform a (blocking) static service query.
@@ -655,151 +683,172 @@ namespace MDNSImplementation
     - answerPort (or 'port')
 
 */
-    uint32_t MDNSResponder::queryService(const char*    p_pcService,
-                                         const char*    p_pcProtocol,
-                                         const uint16_t p_u16Timeout /*= MDNS_QUERYSERVICES_WAIT_TIME*/)
+uint32_t MDNSResponder::queryService(const char* p_pcService,
+                                     const char* p_pcProtocol,
+                                     const uint16_t p_u16Timeout /*= MDNS_QUERYSERVICES_WAIT_TIME*/)
+{
+    if (0 == m_pUDPContext)
     {
-        if (0 == m_pUDPContext)
-        {
-            // safeguard against misuse
-            return 0;
-        }
+        // safeguard against misuse
+        return 0;
+    }
 
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService '%s.%s'\n"), p_pcService, p_pcProtocol););
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService '%s.%s'\n"), p_pcService, p_pcProtocol););
 
-        uint32_t u32Result = 0;
+    uint32_t    u32Result = 0;
 
-        stcMDNSServiceQuery* pServiceQuery = 0;
-        if ((p_pcService) && (os_strlen(p_pcService)) && (p_pcProtocol) && (os_strlen(p_pcProtocol)) && (p_u16Timeout) && (_removeLegacyServiceQuery()) && ((pServiceQuery = _allocServiceQuery())) && (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
-        {
-            pServiceQuery->m_bLegacyQuery = true;
+    stcMDNSServiceQuery*    pServiceQuery = 0;
+    if ((p_pcService) &&
+            (os_strlen(p_pcService)) &&
+            (p_pcProtocol) &&
+            (os_strlen(p_pcProtocol)) &&
+            (p_u16Timeout) &&
+            (_removeLegacyServiceQuery()) &&
+            ((pServiceQuery = _allocServiceQuery())) &&
+            (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
+    {
 
-            if (_sendMDNSServiceQuery(*pServiceQuery))
-            {
-                // Wait for answers to arrive
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: Waiting %u ms for answers...\n"), p_u16Timeout););
-                delay(p_u16Timeout);
+        pServiceQuery->m_bLegacyQuery = true;
 
-                // All answers should have arrived by now -> stop adding new answers
-                pServiceQuery->m_bAwaitingAnswers = false;
-                u32Result                         = pServiceQuery->answerCount();
-            }
-            else  // FAILED to send query
-            {
-                _removeServiceQuery(pServiceQuery);
-            }
+        if (_sendMDNSServiceQuery(*pServiceQuery))
+        {
+            // Wait for answers to arrive
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: Waiting %u ms for answers...\n"), p_u16Timeout););
+            delay(p_u16Timeout);
+
+            // All answers should have arrived by now -> stop adding new answers
+            pServiceQuery->m_bAwaitingAnswers = false;
+            u32Result = pServiceQuery->answerCount();
         }
-        else
+        else    // FAILED to send query
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: INVALID input data!\n")););
+            _removeServiceQuery(pServiceQuery);
         }
-        return u32Result;
     }
+    else
+    {
+        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: INVALID input data!\n")););
+    }
+    return u32Result;
+}
 
-    /*
+/*
     MDNSResponder::removeQuery
 
     Remove the last static service query (and all answers).
 
 */
-    bool MDNSResponder::removeQuery(void)
-    {
-        return _removeLegacyServiceQuery();
-    }
+bool MDNSResponder::removeQuery(void)
+{
 
-    /*
+    return _removeLegacyServiceQuery();
+}
+
+/*
     MDNSResponder::queryService (LEGACY)
 */
-    uint32_t MDNSResponder::queryService(const String& p_strService,
-                                         const String& p_strProtocol)
-    {
-        return queryService(p_strService.c_str(), p_strProtocol.c_str());
-    }
+uint32_t MDNSResponder::queryService(const String& p_strService,
+                                     const String& p_strProtocol)
+{
+
+    return queryService(p_strService.c_str(), p_strProtocol.c_str());
+}
 
-    /*
+/*
     MDNSResponder::answerHostname
 */
-    const char* MDNSResponder::answerHostname(const uint32_t p_u32AnswerIndex)
+const char* MDNSResponder::answerHostname(const uint32_t p_u32AnswerIndex)
+{
+
+    stcMDNSServiceQuery*            pServiceQuery = _findLegacyServiceQuery();
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+
+    if ((pSQAnswer) &&
+            (pSQAnswer->m_HostDomain.m_u16NameLength) &&
+            (!pSQAnswer->m_pcHostDomain))
     {
-        stcMDNSServiceQuery*            pServiceQuery = _findLegacyServiceQuery();
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
 
-        if ((pSQAnswer) && (pSQAnswer->m_HostDomain.m_u16NameLength) && (!pSQAnswer->m_pcHostDomain))
+        char*   pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
+        if (pcHostDomain)
         {
-            char* pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
-            if (pcHostDomain)
-            {
-                pSQAnswer->m_HostDomain.c_str(pcHostDomain);
-            }
+            pSQAnswer->m_HostDomain.c_str(pcHostDomain);
         }
-        return (pSQAnswer ? pSQAnswer->m_pcHostDomain : 0);
     }
+    return (pSQAnswer ? pSQAnswer->m_pcHostDomain : 0);
+}
 
 #ifdef MDNS_IP4_SUPPORT
-    /*
+/*
     MDNSResponder::answerIP
 */
-    IPAddress MDNSResponder::answerIP(const uint32_t p_u32AnswerIndex)
-    {
-        const stcMDNSServiceQuery*                           pServiceQuery = _findLegacyServiceQuery();
-        const stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        const stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address   = (((pSQAnswer) && (pSQAnswer->m_pIP4Addresses)) ? pSQAnswer->IP4AddressAtIndex(0) : 0);
-        return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
-    }
+IPAddress MDNSResponder::answerIP(const uint32_t p_u32AnswerIndex)
+{
+
+    const stcMDNSServiceQuery*                              pServiceQuery = _findLegacyServiceQuery();
+    const stcMDNSServiceQuery::stcAnswer*                   pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    const stcMDNSServiceQuery::stcAnswer::stcIP4Address*    pIP4Address = (((pSQAnswer) && (pSQAnswer->m_pIP4Addresses)) ? pSQAnswer->IP4AddressAtIndex(0) : 0);
+    return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
+}
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-    /*
+/*
     MDNSResponder::answerIP6
 */
-    IPAddress MDNSResponder::answerIP6(const uint32_t p_u32AnswerIndex)
-    {
-        const stcMDNSServiceQuery*                           pServiceQuery = _findLegacyServiceQuery();
-        const stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        const stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address   = (((pSQAnswer) && (pSQAnswer->m_pIP6Addresses)) ? pSQAnswer->IP6AddressAtIndex(0) : 0);
-        return (pIP6Address ? pIP6Address->m_IPAddress : IP6Address());
-    }
+IPAddress MDNSResponder::answerIP6(const uint32_t p_u32AnswerIndex)
+{
+
+    const stcMDNSServiceQuery*                              pServiceQuery = _findLegacyServiceQuery();
+    const stcMDNSServiceQuery::stcAnswer*                   pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    const stcMDNSServiceQuery::stcAnswer::stcIP6Address*    pIP6Address = (((pSQAnswer) && (pSQAnswer->m_pIP6Addresses)) ? pSQAnswer->IP6AddressAtIndex(0) : 0);
+    return (pIP6Address ? pIP6Address->m_IPAddress : IP6Address());
+}
 #endif
 
-    /*
+/*
     MDNSResponder::answerPort
 */
-    uint16_t MDNSResponder::answerPort(const uint32_t p_u32AnswerIndex)
-    {
-        const stcMDNSServiceQuery*            pServiceQuery = _findLegacyServiceQuery();
-        const stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
-    }
+uint16_t MDNSResponder::answerPort(const uint32_t p_u32AnswerIndex)
+{
+
+    const stcMDNSServiceQuery*              pServiceQuery = _findLegacyServiceQuery();
+    const stcMDNSServiceQuery::stcAnswer*   pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
+}
 
-    /*
+/*
     MDNSResponder::hostname (LEGACY)
 */
-    String MDNSResponder::hostname(const uint32_t p_u32AnswerIndex)
-    {
-        return String(answerHostname(p_u32AnswerIndex));
-    }
+String MDNSResponder::hostname(const uint32_t p_u32AnswerIndex)
+{
+
+    return String(answerHostname(p_u32AnswerIndex));
+}
 
-    /*
+/*
     MDNSResponder::IP (LEGACY)
 */
-    IPAddress MDNSResponder::IP(const uint32_t p_u32AnswerIndex)
-    {
-        return answerIP(p_u32AnswerIndex);
-    }
+IPAddress MDNSResponder::IP(const uint32_t p_u32AnswerIndex)
+{
+
+    return answerIP(p_u32AnswerIndex);
+}
 
-    /*
+/*
     MDNSResponder::port (LEGACY)
 */
-    uint16_t MDNSResponder::port(const uint32_t p_u32AnswerIndex)
-    {
-        return answerPort(p_u32AnswerIndex);
-    }
+uint16_t MDNSResponder::port(const uint32_t p_u32AnswerIndex)
+{
 
-    /**
+    return answerPort(p_u32AnswerIndex);
+}
+
+
+/**
     DYNAMIC SERVICE QUERY
 */
 
-    /*
+/*
     MDNSResponder::installServiceQuery
 
     Add a dynamic service query and a corresponding callback to the MDNS responder.
@@ -812,269 +861,306 @@ namespace MDNSImplementation
     - answerTxts
 
 */
-    MDNSResponder::hMDNSServiceQuery MDNSResponder::installServiceQuery(const char*                                 p_pcService,
-                                                                        const char*                                 p_pcProtocol,
-                                                                        MDNSResponder::MDNSServiceQueryCallbackFunc p_fnCallback)
+MDNSResponder::hMDNSServiceQuery MDNSResponder::installServiceQuery(const char* p_pcService,
+        const char* p_pcProtocol,
+        MDNSResponder::MDNSServiceQueryCallbackFunc p_fnCallback)
+{
+    hMDNSServiceQuery       hResult = 0;
+
+    stcMDNSServiceQuery*    pServiceQuery = 0;
+    if ((p_pcService) &&
+            (os_strlen(p_pcService)) &&
+            (p_pcProtocol) &&
+            (os_strlen(p_pcProtocol)) &&
+            (p_fnCallback) &&
+            ((pServiceQuery = _allocServiceQuery())) &&
+            (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
     {
-        hMDNSServiceQuery hResult = 0;
 
-        stcMDNSServiceQuery* pServiceQuery = 0;
-        if ((p_pcService) && (os_strlen(p_pcService)) && (p_pcProtocol) && (os_strlen(p_pcProtocol)) && (p_fnCallback) && ((pServiceQuery = _allocServiceQuery())) && (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
-        {
-            pServiceQuery->m_fnCallback   = p_fnCallback;
-            pServiceQuery->m_bLegacyQuery = false;
+        pServiceQuery->m_fnCallback = p_fnCallback;
+        pServiceQuery->m_bLegacyQuery = false;
 
-            if (_sendMDNSServiceQuery(*pServiceQuery))
-            {
-                pServiceQuery->m_u8SentCount = 1;
-                pServiceQuery->m_ResendTimeout.reset(MDNS_DYNAMIC_QUERY_RESEND_DELAY);
+        if (_sendMDNSServiceQuery(*pServiceQuery))
+        {
+            pServiceQuery->m_u8SentCount = 1;
+            pServiceQuery->m_ResendTimeout.reset(MDNS_DYNAMIC_QUERY_RESEND_DELAY);
 
-                hResult = (hMDNSServiceQuery)pServiceQuery;
-            }
-            else
-            {
-                _removeServiceQuery(pServiceQuery);
-            }
+            hResult = (hMDNSServiceQuery)pServiceQuery;
+        }
+        else
+        {
+            _removeServiceQuery(pServiceQuery);
         }
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: %s for '%s.%s'!\n\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
-        DEBUG_EX_ERR(if (!hResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: FAILED for '%s.%s'!\n\n"), (p_pcService ?: "-"), (p_pcProtocol ?: "-"));
-                     });
-        return hResult;
     }
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: %s for '%s.%s'!\n\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcService ? : "-"), (p_pcProtocol ? : "-")););
+    DEBUG_EX_ERR(if (!hResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: FAILED for '%s.%s'!\n\n"), (p_pcService ? : "-"), (p_pcProtocol ? : "-"));
+    });
+    return hResult;
+}
 
-    /*
+/*
     MDNSResponder::removeServiceQuery
 
     Remove a dynamic service query (and all collected answers) from the MDNS responder
 
 */
-    bool MDNSResponder::removeServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
-    {
-        stcMDNSServiceQuery* pServiceQuery = 0;
-        bool                 bResult       = (((pServiceQuery = _findServiceQuery(p_hServiceQuery))) && (_removeServiceQuery(pServiceQuery)));
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceQuery: FAILED!\n"));
-                     });
-        return bResult;
-    }
+bool MDNSResponder::removeServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
+{
 
-    /*
+    stcMDNSServiceQuery*    pServiceQuery = 0;
+    bool    bResult = (((pServiceQuery = _findServiceQuery(p_hServiceQuery))) &&
+                       (_removeServiceQuery(pServiceQuery)));
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceQuery: FAILED!\n"));
+    });
+    return bResult;
+}
+
+/*
     MDNSResponder::answerCount
 */
-    uint32_t MDNSResponder::answerCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
-    {
-        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        return (pServiceQuery ? pServiceQuery->answerCount() : 0);
-    }
+uint32_t MDNSResponder::answerCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
+{
 
-    std::vector<MDNSResponder::MDNSServiceInfo> MDNSResponder::answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
+    stcMDNSServiceQuery*    pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    return (pServiceQuery ? pServiceQuery->answerCount() : 0);
+}
+
+std::vector<MDNSResponder::MDNSServiceInfo>  MDNSResponder::answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
+{
+    std::vector<MDNSResponder::MDNSServiceInfo> tempVector;
+    for (uint32_t i = 0; i < answerCount(p_hServiceQuery); i++)
     {
-        std::vector<MDNSResponder::MDNSServiceInfo> tempVector;
-        for (uint32_t i = 0; i < answerCount(p_hServiceQuery); i++)
-        {
-            tempVector.emplace_back(*this, p_hServiceQuery, i);
-        }
-        return tempVector;
+        tempVector.emplace_back(*this, p_hServiceQuery, i);
     }
+    return tempVector;
+}
 
-    /*
+/*
     MDNSResponder::answerServiceDomain
 
     Returns the domain for the given service.
     If not already existing, the string is allocated, filled and attached to the answer.
 
 */
-    const char* MDNSResponder::answerServiceDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                                   const uint32_t                         p_u32AnswerIndex)
+const char* MDNSResponder::answerServiceDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+{
+
+    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    // Fill m_pcServiceDomain (if not already done)
+    if ((pSQAnswer) &&
+            (pSQAnswer->m_ServiceDomain.m_u16NameLength) &&
+            (!pSQAnswer->m_pcServiceDomain))
     {
-        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        // Fill m_pcServiceDomain (if not already done)
-        if ((pSQAnswer) && (pSQAnswer->m_ServiceDomain.m_u16NameLength) && (!pSQAnswer->m_pcServiceDomain))
+
+        pSQAnswer->m_pcServiceDomain = pSQAnswer->allocServiceDomain(pSQAnswer->m_ServiceDomain.c_strLength());
+        if (pSQAnswer->m_pcServiceDomain)
         {
-            pSQAnswer->m_pcServiceDomain = pSQAnswer->allocServiceDomain(pSQAnswer->m_ServiceDomain.c_strLength());
-            if (pSQAnswer->m_pcServiceDomain)
-            {
-                pSQAnswer->m_ServiceDomain.c_str(pSQAnswer->m_pcServiceDomain);
-            }
+            pSQAnswer->m_ServiceDomain.c_str(pSQAnswer->m_pcServiceDomain);
         }
-        return (pSQAnswer ? pSQAnswer->m_pcServiceDomain : 0);
     }
+    return (pSQAnswer ? pSQAnswer->m_pcServiceDomain : 0);
+}
 
-    /*
+/*
     MDNSResponder::hasAnswerHostDomain
 */
-    bool MDNSResponder::hasAnswerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                            const uint32_t                         p_u32AnswerIndex)
-    {
-        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
-    }
+bool MDNSResponder::hasAnswerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                        const uint32_t p_u32AnswerIndex)
+{
 
-    /*
+    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    return ((pSQAnswer) &&
+            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
+}
+
+/*
     MDNSResponder::answerHostDomain
 
     Returns the host domain for the given service.
     If not already existing, the string is allocated, filled and attached to the answer.
 
 */
-    const char* MDNSResponder::answerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                                const uint32_t                         p_u32AnswerIndex)
+const char* MDNSResponder::answerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+{
+
+    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    // Fill m_pcHostDomain (if not already done)
+    if ((pSQAnswer) &&
+            (pSQAnswer->m_HostDomain.m_u16NameLength) &&
+            (!pSQAnswer->m_pcHostDomain))
     {
-        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        // Fill m_pcHostDomain (if not already done)
-        if ((pSQAnswer) && (pSQAnswer->m_HostDomain.m_u16NameLength) && (!pSQAnswer->m_pcHostDomain))
+
+        pSQAnswer->m_pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
+        if (pSQAnswer->m_pcHostDomain)
         {
-            pSQAnswer->m_pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
-            if (pSQAnswer->m_pcHostDomain)
-            {
-                pSQAnswer->m_HostDomain.c_str(pSQAnswer->m_pcHostDomain);
-            }
+            pSQAnswer->m_HostDomain.c_str(pSQAnswer->m_pcHostDomain);
         }
-        return (pSQAnswer ? pSQAnswer->m_pcHostDomain : 0);
     }
+    return (pSQAnswer ? pSQAnswer->m_pcHostDomain : 0);
+}
 
 #ifdef MDNS_IP4_SUPPORT
-    /*
+/*
     MDNSResponder::hasAnswerIP4Address
 */
-    bool MDNSResponder::hasAnswerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                            const uint32_t                         p_u32AnswerIndex)
-    {
-        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_IP4Address));
-    }
+bool MDNSResponder::hasAnswerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                        const uint32_t p_u32AnswerIndex)
+{
+
+    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    return ((pSQAnswer) &&
+            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_IP4Address));
+}
 
-    /*
+/*
     MDNSResponder::answerIP4AddressCount
 */
-    uint32_t MDNSResponder::answerIP4AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                                  const uint32_t                         p_u32AnswerIndex)
-    {
-        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        return (pSQAnswer ? pSQAnswer->IP4AddressCount() : 0);
-    }
+uint32_t MDNSResponder::answerIP4AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+{
 
-    /*
+    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    return (pSQAnswer ? pSQAnswer->IP4AddressCount() : 0);
+}
+
+/*
     MDNSResponder::answerIP4Address
 */
-    IPAddress MDNSResponder::answerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                              const uint32_t                         p_u32AnswerIndex,
-                                              const uint32_t                         p_u32AddressIndex)
-    {
-        stcMDNSServiceQuery*                           pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address   = (pSQAnswer ? pSQAnswer->IP4AddressAtIndex(p_u32AddressIndex) : 0);
-        return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
-    }
+IPAddress MDNSResponder::answerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex,
+        const uint32_t p_u32AddressIndex)
+{
+
+    stcMDNSServiceQuery*                            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer*                 pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    stcMDNSServiceQuery::stcAnswer::stcIP4Address*  pIP4Address = (pSQAnswer ? pSQAnswer->IP4AddressAtIndex(p_u32AddressIndex) : 0);
+    return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
+}
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-    /*
+/*
     MDNSResponder::hasAnswerIP6Address
 */
-    bool MDNSResponder::hasAnswerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                            const uint32_t                         p_u32AnswerIndex)
-    {
-        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostIP6Address));
-    }
+bool MDNSResponder::hasAnswerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                        const uint32_t p_u32AnswerIndex)
+{
 
-    /*
+    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    return ((pSQAnswer) &&
+            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostIP6Address));
+}
+
+/*
     MDNSResponder::answerIP6AddressCount
 */
-    uint32_t MDNSResponder::answerIP6AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                                  const uint32_t                         p_u32AnswerIndex)
-    {
-        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        return (pSQAnswer ? pSQAnswer->IP6AddressCount() : 0);
-    }
+uint32_t MDNSResponder::answerIP6AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+{
+
+    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    return (pSQAnswer ? pSQAnswer->IP6AddressCount() : 0);
+}
 
-    /*
+/*
     MDNSResponder::answerIP6Address
 */
-    IPAddress MDNSResponder::answerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                              const uint32_t                         p_u32AnswerIndex,
-                                              const uint32_t                         p_u32AddressIndex)
-    {
-        stcMDNSServiceQuery*                           pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address   = (pSQAnswer ? pSQAnswer->IP6AddressAtIndex(p_u32AddressIndex) : 0);
-        return (pIP6Address ? pIP6Address->m_IPAddress : IPAddress());
-    }
+IPAddress MDNSResponder::answerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex,
+        const uint32_t p_u32AddressIndex)
+{
+
+    stcMDNSServiceQuery*                            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer*                 pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    stcMDNSServiceQuery::stcAnswer::stcIP6Address*  pIP6Address = (pSQAnswer ? pSQAnswer->IP6AddressAtIndex(p_u32AddressIndex) : 0);
+    return (pIP6Address ? pIP6Address->m_IPAddress : IPAddress());
+}
 #endif
 
-    /*
+/*
     MDNSResponder::hasAnswerPort
 */
-    bool MDNSResponder::hasAnswerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                      const uint32_t                         p_u32AnswerIndex)
-    {
-        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
-    }
+bool MDNSResponder::hasAnswerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                  const uint32_t p_u32AnswerIndex)
+{
 
-    /*
+    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    return ((pSQAnswer) &&
+            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
+}
+
+/*
     MDNSResponder::answerPort
 */
-    uint16_t MDNSResponder::answerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                       const uint32_t                         p_u32AnswerIndex)
-    {
-        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
-    }
+uint16_t MDNSResponder::answerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                   const uint32_t p_u32AnswerIndex)
+{
+
+    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
+}
 
-    /*
+/*
     MDNSResponder::hasAnswerTxts
 */
-    bool MDNSResponder::hasAnswerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                      const uint32_t                         p_u32AnswerIndex)
-    {
-        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_Txts));
-    }
+bool MDNSResponder::hasAnswerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                  const uint32_t p_u32AnswerIndex)
+{
+
+    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    return ((pSQAnswer) &&
+            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_Txts));
+}
 
-    /*
+/*
     MDNSResponder::answerTxts
 
     Returns all TXT items for the given service as a ';'-separated string.
     If not already existing; the string is allocated, filled and attached to the answer.
 
 */
-    const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                          const uint32_t                         p_u32AnswerIndex)
+const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                      const uint32_t p_u32AnswerIndex)
+{
+
+    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    // Fill m_pcTxts (if not already done)
+    if ((pSQAnswer) &&
+            (pSQAnswer->m_Txts.m_pTxts) &&
+            (!pSQAnswer->m_pcTxts))
     {
-        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        // Fill m_pcTxts (if not already done)
-        if ((pSQAnswer) && (pSQAnswer->m_Txts.m_pTxts) && (!pSQAnswer->m_pcTxts))
+
+        pSQAnswer->m_pcTxts = pSQAnswer->allocTxts(pSQAnswer->m_Txts.c_strLength());
+        if (pSQAnswer->m_pcTxts)
         {
-            pSQAnswer->m_pcTxts = pSQAnswer->allocTxts(pSQAnswer->m_Txts.c_strLength());
-            if (pSQAnswer->m_pcTxts)
-            {
-                pSQAnswer->m_Txts.c_str(pSQAnswer->m_pcTxts);
-            }
+            pSQAnswer->m_Txts.c_str(pSQAnswer->m_pcTxts);
         }
-        return (pSQAnswer ? pSQAnswer->m_pcTxts : 0);
     }
+    return (pSQAnswer ? pSQAnswer->m_pcTxts : 0);
+}
 
-    /*
+/*
     PROBING
 */
 
-    /*
+/*
     MDNSResponder::setProbeResultCallback
 
     Set a global callback for probe results. The callback is called, when probing
@@ -1084,21 +1170,24 @@ namespace MDNSImplementation
     When succeeded, the host or service domain will be announced by the MDNS responder.
 
 */
-    bool MDNSResponder::setHostProbeResultCallback(MDNSResponder::MDNSHostProbeFn p_fnCallback)
-    {
-        m_HostProbeInformation.m_fnHostProbeResultCallback = p_fnCallback;
+bool MDNSResponder::setHostProbeResultCallback(MDNSResponder::MDNSHostProbeFn p_fnCallback)
+{
 
-        return true;
-    }
+    m_HostProbeInformation.m_fnHostProbeResultCallback = p_fnCallback;
+
+    return true;
+}
 
-    bool MDNSResponder::setHostProbeResultCallback(MDNSHostProbeFn1 pfn)
+bool MDNSResponder::setHostProbeResultCallback(MDNSHostProbeFn1 pfn)
+{
+    using namespace std::placeholders;
+    return setHostProbeResultCallback([this, pfn](const char* p_pcDomainName, bool p_bProbeResult)
     {
-        using namespace std::placeholders;
-        return setHostProbeResultCallback([this, pfn](const char* p_pcDomainName, bool p_bProbeResult)
-                                          { pfn(*this, p_pcDomainName, p_bProbeResult); });
-    }
+        pfn(*this, p_pcDomainName, p_bProbeResult);
+    });
+}
 
-    /*
+/*
     MDNSResponder::setServiceProbeResultCallback
 
     Set a service specific callback for probe results. The callback is called, when probing
@@ -1107,172 +1196,189 @@ namespace MDNSImplementation
     When succeeded, the service domain will be announced by the MDNS responder.
 
 */
-    bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-                                                      MDNSResponder::MDNSServiceProbeFn p_fnCallback)
-    {
-        bool bResult = false;
+bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+        MDNSResponder::MDNSServiceProbeFn p_fnCallback)
+{
 
-        stcMDNSService* pService = _findService(p_hService);
-        if (pService)
-        {
-            pService->m_ProbeInformation.m_fnServiceProbeResultCallback = p_fnCallback;
+    bool    bResult = false;
 
-            bResult = true;
-        }
-        return bResult;
+    stcMDNSService* pService = _findService(p_hService);
+    if (pService)
+    {
+        pService->m_ProbeInformation.m_fnServiceProbeResultCallback = p_fnCallback;
+
+        bResult = true;
     }
+    return bResult;
+}
 
-    bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService  p_hService,
-                                                      MDNSResponder::MDNSServiceProbeFn1 p_fnCallback)
+bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+        MDNSResponder::MDNSServiceProbeFn1 p_fnCallback)
+{
+    using namespace std::placeholders;
+    return setServiceProbeResultCallback(p_hService, [this, p_fnCallback](const char* p_pcServiceName, const hMDNSService p_hMDNSService, bool p_bProbeResult)
     {
-        using namespace std::placeholders;
-        return setServiceProbeResultCallback(p_hService, [this, p_fnCallback](const char* p_pcServiceName, const hMDNSService p_hMDNSService, bool p_bProbeResult)
-                                             { p_fnCallback(*this, p_pcServiceName, p_hMDNSService, p_bProbeResult); });
-    }
+        p_fnCallback(*this, p_pcServiceName, p_hMDNSService, p_bProbeResult);
+    });
+}
 
-    /*
+
+/*
     MISC
 */
 
-    /*
+/*
     MDNSResponder::notifyAPChange
 
     Should be called, whenever the AP for the MDNS responder changes.
     A bit of this is caught by the event callbacks installed in the constructor.
 
 */
-    bool MDNSResponder::notifyAPChange(void)
-    {
-        return _restart();
-    }
+bool MDNSResponder::notifyAPChange(void)
+{
+
+    return _restart();
+}
 
-    /*
+/*
     MDNSResponder::update
 
     Should be called in every 'loop'.
 
 */
-    bool MDNSResponder::update(void)
-    {
-        return _process(true);
-    }
+bool MDNSResponder::update(void)
+{
+    return _process(true);
+}
 
-    /*
+/*
     MDNSResponder::announce
 
     Should be called, if the 'configuration' changes. Mainly this will be changes in the TXT items...
 */
-    bool MDNSResponder::announce(void)
-    {
-        return (_announce(true, true));
-    }
+bool MDNSResponder::announce(void)
+{
+
+    return (_announce(true, true));
+}
 
-    /*
+/*
     MDNSResponder::enableArduino
 
     Enable the OTA update service.
 
 */
-    MDNSResponder::hMDNSService MDNSResponder::enableArduino(uint16_t p_u16Port,
-                                                             bool     p_bAuthUpload /*= false*/)
+MDNSResponder::hMDNSService MDNSResponder::enableArduino(uint16_t p_u16Port,
+        bool p_bAuthUpload /*= false*/)
+{
+
+    hMDNSService    hService = addService(0, "arduino", "tcp", p_u16Port);
+    if (hService)
     {
-        hMDNSService hService = addService(0, "arduino", "tcp", p_u16Port);
-        if (hService)
+        if ((!addServiceTxt(hService, "tcp_check", "no")) ||
+                (!addServiceTxt(hService, "ssh_upload", "no")) ||
+                (!addServiceTxt(hService, "board", STRINGIZE_VALUE_OF(ARDUINO_BOARD))) ||
+                (!addServiceTxt(hService, "auth_upload", (p_bAuthUpload) ? "yes" : "no")))
         {
-            if ((!addServiceTxt(hService, "tcp_check", "no")) || (!addServiceTxt(hService, "ssh_upload", "no")) || (!addServiceTxt(hService, "board", STRINGIZE_VALUE_OF(ARDUINO_BOARD))) || (!addServiceTxt(hService, "auth_upload", (p_bAuthUpload) ? "yes" : "no")))
-            {
-                removeService(hService);
-                hService = 0;
-            }
+
+            removeService(hService);
+            hService = 0;
         }
-        return hService;
     }
+    return hService;
+}
 
-    /*
+/*
 
     MULTICAST GROUPS
 
 */
 
-    /*
+/*
     MDNSResponder::_joinMulticastGroups
 */
-    bool MDNSResponder::_joinMulticastGroups(void)
-    {
-        bool bResult = false;
+bool MDNSResponder::_joinMulticastGroups(void)
+{
+    bool    bResult = false;
 
-        // Join multicast group(s)
-        for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+    // Join multicast group(s)
+    for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+    {
+        if (netif_is_up(pNetIf))
         {
-            if (netif_is_up(pNetIf))
-            {
 #ifdef MDNS_IP4_SUPPORT
-                ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
-                if (!(pNetIf->flags & NETIF_FLAG_IGMP))
-                {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: Setting flag: flags & NETIF_FLAG_IGMP\n")););
-                    pNetIf->flags |= NETIF_FLAG_IGMP;
-
-                    if (ERR_OK != igmp_start(pNetIf))
-                    {
-                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_start FAILED!\n")););
-                    }
-                }
+            ip_addr_t   multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
+            if (!(pNetIf->flags & NETIF_FLAG_IGMP))
+            {
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: Setting flag: flags & NETIF_FLAG_IGMP\n")););
+                pNetIf->flags |= NETIF_FLAG_IGMP;
 
-                if ((ERR_OK == igmp_joingroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4))))
+                if (ERR_OK != igmp_start(pNetIf))
                 {
-                    bResult = true;
-                }
-                else
-                {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_joingroup_netif(" NETIFID_STR ": %s) FAILED!\n"),
-                                                       NETIFID_VAL(pNetIf), IPAddress(multicast_addr_V4).toString().c_str()););
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_start FAILED!\n")););
                 }
+            }
+
+            if ((ERR_OK == igmp_joingroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4))))
+            {
+                bResult = true;
+            }
+            else
+            {
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_joingroup_netif(" NETIFID_STR ": %s) FAILED!\n"),
+                                                   NETIFID_VAL(pNetIf), IPAddress(multicast_addr_V4).toString().c_str()););
+            }
 #endif
 
 #ifdef MDNS_IPV6_SUPPORT
-                ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
-                bResult                     = ((bResult) && (ERR_OK == mld6_joingroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6))));
-                DEBUG_EX_ERR_IF(!bResult, DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: mld6_joingroup_netif (" NETIFID_STR ") FAILED!\n"), NETIFID_VAL(pNetIf)));
+            ip_addr_t   multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
+            bResult = ((bResult) &&
+                       (ERR_OK == mld6_joingroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6))));
+            DEBUG_EX_ERR_IF(!bResult, DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: mld6_joingroup_netif (" NETIFID_STR ") FAILED!\n"),
+                            NETIFID_VAL(pNetIf)));
 #endif
-            }
         }
-        return bResult;
     }
+    return bResult;
+}
 
-    /*
+/*
     clsLEAmDNS2_Host::_leaveMulticastGroups
 */
-    bool MDNSResponder::_leaveMulticastGroups()
-    {
-        bool bResult = false;
+bool MDNSResponder::_leaveMulticastGroups()
+{
+    bool    bResult = false;
 
-        for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+    for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+    {
+        if (netif_is_up(pNetIf))
         {
-            if (netif_is_up(pNetIf))
-            {
-                bResult = true;
+            bResult = true;
 
-                // Leave multicast group(s)
+            // Leave multicast group(s)
 #ifdef MDNS_IP4_SUPPORT
-                ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
-                if (ERR_OK != igmp_leavegroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4)))
-                {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
-                }
+            ip_addr_t   multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
+            if (ERR_OK != igmp_leavegroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4)))
+            {
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
+            }
 #endif
 #ifdef MDNS_IPV6_SUPPORT
-                ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
-                if (ERR_OK != mld6_leavegroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6) /*&(multicast_addr_V6.u_addr.ip6)*/))
-                {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
-                }
-#endif
+            ip_addr_t   multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
+            if (ERR_OK != mld6_leavegroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6)/*&(multicast_addr_V6.u_addr.ip6)*/))
+            {
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
             }
+#endif
         }
-        return bResult;
     }
+    return bResult;
+}
+
+
+
+} //namespace MDNSImplementation
+
+} //namespace esp8266
 
-}  //namespace MDNSImplementation
 
-}  //namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.h b/libraries/ESP8266mDNS/src/LEAmDNS.h
index cc353d6175..670de02ed0 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.h
@@ -102,7 +102,7 @@
 #ifndef MDNS_H
 #define MDNS_H
 
-#include <functional>  // for UdpContext.h
+#include <functional>   // for UdpContext.h
 #include "WiFiUdp.h"
 #include "lwip/udp.h"
 #include "debug.h"
@@ -111,15 +111,19 @@
 #include <PolledTimeout.h>
 #include <map>
 
+
 #include "ESP8266WiFi.h"
 
+
 namespace esp8266
 {
+
 /**
     LEAmDNS
 */
 namespace MDNSImplementation
 {
+
 //this should be defined at build time
 #ifndef ARDUINO_BOARD
 #define ARDUINO_BOARD "generic"
@@ -131,1328 +135,1329 @@ namespace MDNSImplementation
 #endif
 
 #ifdef MDNS_IP4_SUPPORT
-#define MDNS_IP4_SIZE 4
+#define MDNS_IP4_SIZE               4
 #endif
 #ifdef MDNS_IP6_SUPPORT
-#define MDNS_IP6_SIZE 16
+#define MDNS_IP6_SIZE               16
 #endif
 /*
     Maximum length for all service txts for one service
 */
-#define MDNS_SERVICE_TXT_MAXLENGTH 1300
+#define MDNS_SERVICE_TXT_MAXLENGTH      1300
 /*
     Maximum length for a full domain name eg. MyESP._http._tcp.local
 */
-#define MDNS_DOMAIN_MAXLENGTH 256
+#define MDNS_DOMAIN_MAXLENGTH           256
 /*
     Maximum length of on label in a domain name (length info fits into 6 bits)
 */
-#define MDNS_DOMAIN_LABEL_MAXLENGTH 63
+#define MDNS_DOMAIN_LABEL_MAXLENGTH     63
 /*
     Maximum length of a service name eg. http
 */
-#define MDNS_SERVICE_NAME_LENGTH 15
+#define MDNS_SERVICE_NAME_LENGTH        15
 /*
     Maximum length of a service protocol name eg. tcp
 */
-#define MDNS_SERVICE_PROTOCOL_LENGTH 3
+#define MDNS_SERVICE_PROTOCOL_LENGTH    3
 /*
     Default timeout for static service queries
 */
-#define MDNS_QUERYSERVICES_WAIT_TIME 1000
+#define MDNS_QUERYSERVICES_WAIT_TIME    1000
 
 /*
     Timeout for udpContext->sendtimeout()
 */
-#define MDNS_UDPCONTEXT_TIMEOUT 50
+#define MDNS_UDPCONTEXT_TIMEOUT  50
 
-    /**
+/**
     MDNSResponder
 */
-    class MDNSResponder
+class MDNSResponder
+{
+public:
+    /* INTERFACE */
+
+    MDNSResponder(void);
+    virtual ~MDNSResponder(void);
+
+    // Start the MDNS responder by setting the default hostname
+    // Later call MDNS::update() in every 'loop' to run the process loop
+    // (probing, announcing, responding, ...)
+    // if interfaceAddress is not specified, default interface is STA, or AP when STA is not set
+    bool begin(const char* p_pcHostname, const IPAddress& p_IPAddress = INADDR_ANY, uint32_t p_u32TTL = 120 /*ignored*/);
+    bool begin(const String& p_strHostname, const IPAddress& p_IPAddress = INADDR_ANY, uint32_t p_u32TTL = 120 /*ignored*/)
     {
-    public:
-        /* INTERFACE */
-
-        MDNSResponder(void);
-        virtual ~MDNSResponder(void);
-
-        // Start the MDNS responder by setting the default hostname
-        // Later call MDNS::update() in every 'loop' to run the process loop
-        // (probing, announcing, responding, ...)
-        // if interfaceAddress is not specified, default interface is STA, or AP when STA is not set
-        bool begin(const char* p_pcHostname, const IPAddress& p_IPAddress = INADDR_ANY, uint32_t p_u32TTL = 120 /*ignored*/);
-        bool begin(const String& p_strHostname, const IPAddress& p_IPAddress = INADDR_ANY, uint32_t p_u32TTL = 120 /*ignored*/)
-        {
-            return begin(p_strHostname.c_str(), p_IPAddress, p_u32TTL);
-        }
-        bool _joinMulticastGroups(void);
-        bool _leaveMulticastGroups(void);
-
-        // Finish MDNS processing
-        bool close(void);
-        // for esp32 compatibility
-        bool end(void);
-        // Change hostname (probing is restarted)
-        bool setHostname(const char* p_pcHostname);
-        // for compatibility...
-        bool setHostname(const String& p_strHostname);
-
-        bool isRunning(void)
-        {
-            return (m_pUDPContext != 0);
-        }
+        return begin(p_strHostname.c_str(), p_IPAddress, p_u32TTL);
+    }
+    bool _joinMulticastGroups(void);
+    bool _leaveMulticastGroups(void);
+
+    // Finish MDNS processing
+    bool close(void);
+    // for esp32 compatibility
+    bool end(void);
+    // Change hostname (probing is restarted)
+    bool setHostname(const char* p_pcHostname);
+    // for compatibility...
+    bool setHostname(const String& p_strHostname);
+
+    bool isRunning(void)
+    {
+        return (m_pUDPContext != 0);
+    }
 
-        /**
+    /**
         hMDNSService (opaque handle to access the service)
     */
-        typedef const void* hMDNSService;
-
-        // Add a new service to the MDNS responder. If no name (instance name) is given (p_pcName = 0)
-        // the current hostname is used. If the hostname is changed later, the instance names for
-        // these 'auto-named' services are changed to the new name also (and probing is restarted).
-        // The usual '_' before p_pcService (eg. http) and protocol (eg. tcp) may be given.
-        hMDNSService addService(const char* p_pcName,
-                                const char* p_pcService,
-                                const char* p_pcProtocol,
-                                uint16_t    p_u16Port);
-        // Removes a service from the MDNS responder
-        bool removeService(const hMDNSService p_hService);
-        bool removeService(const char* p_pcInstanceName,
-                           const char* p_pcServiceName,
-                           const char* p_pcProtocol);
-        // for compatibility...
-        bool addService(const String& p_strServiceName,
-                        const String& p_strProtocol,
-                        uint16_t      p_u16Port);
-
-        // Change the services instance name (and restart probing).
-        bool setServiceName(const hMDNSService p_hService,
-                            const char*        p_pcInstanceName);
-        //for compatibility
-        //Warning: this has the side effect of changing the hostname.
-        //TODO: implement instancename different from hostname
-        void setInstanceName(const char* p_pcHostname)
-        {
-            setHostname(p_pcHostname);
-        }
-        // for esp32 compatibility
-        void setInstanceName(const String& s_pcHostname)
-        {
-            setInstanceName(s_pcHostname.c_str());
-        }
+    typedef const void*     hMDNSService;
+
+    // Add a new service to the MDNS responder. If no name (instance name) is given (p_pcName = 0)
+    // the current hostname is used. If the hostname is changed later, the instance names for
+    // these 'auto-named' services are changed to the new name also (and probing is restarted).
+    // The usual '_' before p_pcService (eg. http) and protocol (eg. tcp) may be given.
+    hMDNSService addService(const char* p_pcName,
+                            const char* p_pcService,
+                            const char* p_pcProtocol,
+                            uint16_t p_u16Port);
+    // Removes a service from the MDNS responder
+    bool removeService(const hMDNSService p_hService);
+    bool removeService(const char* p_pcInstanceName,
+                       const char* p_pcServiceName,
+                       const char* p_pcProtocol);
+    // for compatibility...
+    bool addService(const String& p_strServiceName,
+                    const String& p_strProtocol,
+                    uint16_t p_u16Port);
+
+
+    // Change the services instance name (and restart probing).
+    bool setServiceName(const hMDNSService p_hService,
+                        const char* p_pcInstanceName);
+    //for compatibility
+    //Warning: this has the side effect of changing the hostname.
+    //TODO: implement instancename different from hostname
+    void setInstanceName(const char* p_pcHostname)
+    {
+        setHostname(p_pcHostname);
+    }
+    // for esp32 compatibility
+    void setInstanceName(const String& s_pcHostname)
+    {
+        setInstanceName(s_pcHostname.c_str());
+    }
 
-        /**
+    /**
         hMDNSTxt (opaque handle to access the TXT items)
     */
-        typedef void* hMDNSTxt;
-
-        // Add a (static) MDNS TXT item ('key' = 'value') to the service
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                               const char*        p_pcKey,
-                               const char*        p_pcValue);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                               const char*        p_pcKey,
-                               uint32_t           p_u32Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                               const char*        p_pcKey,
-                               uint16_t           p_u16Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                               const char*        p_pcKey,
-                               uint8_t            p_u8Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                               const char*        p_pcKey,
-                               int32_t            p_i32Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                               const char*        p_pcKey,
-                               int16_t            p_i16Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                               const char*        p_pcKey,
-                               int8_t             p_i8Value);
-
-        // Remove an existing (static) MDNS TXT item from the service
-        bool removeServiceTxt(const hMDNSService p_hService,
-                              const hMDNSTxt     p_hTxt);
-        bool removeServiceTxt(const hMDNSService p_hService,
-                              const char*        p_pcKey);
-        bool removeServiceTxt(const char* p_pcinstanceName,
-                              const char* p_pcServiceName,
-                              const char* p_pcProtocol,
-                              const char* p_pcKey);
-        // for compatibility...
-        bool addServiceTxt(const char* p_pcService,
-                           const char* p_pcProtocol,
+    typedef void*   hMDNSTxt;
+
+    // Add a (static) MDNS TXT item ('key' = 'value') to the service
+    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
                            const char* p_pcKey,
                            const char* p_pcValue);
-        bool addServiceTxt(const String& p_strService,
-                           const String& p_strProtocol,
-                           const String& p_strKey,
-                           const String& p_strValue);
+    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                           const char* p_pcKey,
+                           uint32_t p_u32Value);
+    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                           const char* p_pcKey,
+                           uint16_t p_u16Value);
+    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                           const char* p_pcKey,
+                           uint8_t p_u8Value);
+    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                           const char* p_pcKey,
+                           int32_t p_i32Value);
+    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                           const char* p_pcKey,
+                           int16_t p_i16Value);
+    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                           const char* p_pcKey,
+                           int8_t p_i8Value);
+
+    // Remove an existing (static) MDNS TXT item from the service
+    bool removeServiceTxt(const hMDNSService p_hService,
+                          const hMDNSTxt p_hTxt);
+    bool removeServiceTxt(const hMDNSService p_hService,
+                          const char* p_pcKey);
+    bool removeServiceTxt(const char* p_pcinstanceName,
+                          const char* p_pcServiceName,
+                          const char* p_pcProtocol,
+                          const char* p_pcKey);
+    // for compatibility...
+    bool addServiceTxt(const char* p_pcService,
+                       const char* p_pcProtocol,
+                       const char* p_pcKey,
+                       const char* p_pcValue);
+    bool addServiceTxt(const String& p_strService,
+                       const String& p_strProtocol,
+                       const String& p_strKey,
+                       const String& p_strValue);
 
-        /**
+    /**
         MDNSDynamicServiceTxtCallbackFn
         Callback function for dynamic MDNS TXT items
     */
 
-        typedef std::function<void(const hMDNSService p_hService)> MDNSDynamicServiceTxtCallbackFunc;
-
-        // Set a global callback for dynamic MDNS TXT items. The callback function is called
-        // every time, a TXT item is needed for one of the installed services.
-        bool setDynamicServiceTxtCallback(MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
-        // Set a service specific callback for dynamic MDNS TXT items. The callback function
-        // is called every time, a TXT item is needed for the given service.
-        bool setDynamicServiceTxtCallback(const hMDNSService                p_hService,
-                                          MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
-
-        // Add a (dynamic) MDNS TXT item ('key' = 'value') to the service
-        // Dynamic TXT items are removed right after one-time use. So they need to be added
-        // every time the value s needed (via callback).
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                      const char*  p_pcKey,
-                                      const char*  p_pcValue);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                      const char*  p_pcKey,
-                                      uint32_t     p_u32Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                      const char*  p_pcKey,
-                                      uint16_t     p_u16Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                      const char*  p_pcKey,
-                                      uint8_t      p_u8Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                      const char*  p_pcKey,
-                                      int32_t      p_i32Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                      const char*  p_pcKey,
-                                      int16_t      p_i16Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                      const char*  p_pcKey,
-                                      int8_t       p_i8Value);
-
-        // Perform a (static) service query. The function returns after p_u16Timeout milliseconds
-        // The answers (the number of received answers is returned) can be retrieved by calling
-        // - answerHostname (or hostname)
-        // - answerIP (or IP)
-        // - answerPort (or port)
-        uint32_t queryService(const char*    p_pcService,
-                              const char*    p_pcProtocol,
-                              const uint16_t p_u16Timeout = MDNS_QUERYSERVICES_WAIT_TIME);
-        bool     removeQuery(void);
-        // for compatibility...
-        uint32_t queryService(const String& p_strService,
-                              const String& p_strProtocol);
-
-        const char* answerHostname(const uint32_t p_u32AnswerIndex);
-        IPAddress   answerIP(const uint32_t p_u32AnswerIndex);
-        uint16_t    answerPort(const uint32_t p_u32AnswerIndex);
-        // for compatibility...
-        String    hostname(const uint32_t p_u32AnswerIndex);
-        IPAddress IP(const uint32_t p_u32AnswerIndex);
-        uint16_t  port(const uint32_t p_u32AnswerIndex);
+    typedef std::function<void(const hMDNSService p_hService)> MDNSDynamicServiceTxtCallbackFunc;
+
+    // Set a global callback for dynamic MDNS TXT items. The callback function is called
+    // every time, a TXT item is needed for one of the installed services.
+    bool setDynamicServiceTxtCallback(MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
+    // Set a service specific callback for dynamic MDNS TXT items. The callback function
+    // is called every time, a TXT item is needed for the given service.
+    bool setDynamicServiceTxtCallback(const hMDNSService p_hService,
+                                      MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
+
+    // Add a (dynamic) MDNS TXT item ('key' = 'value') to the service
+    // Dynamic TXT items are removed right after one-time use. So they need to be added
+    // every time the value s needed (via callback).
+    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                  const char* p_pcKey,
+                                  const char* p_pcValue);
+    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                  const char* p_pcKey,
+                                  uint32_t p_u32Value);
+    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                  const char* p_pcKey,
+                                  uint16_t p_u16Value);
+    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                  const char* p_pcKey,
+                                  uint8_t p_u8Value);
+    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                  const char* p_pcKey,
+                                  int32_t p_i32Value);
+    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                  const char* p_pcKey,
+                                  int16_t p_i16Value);
+    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                  const char* p_pcKey,
+                                  int8_t p_i8Value);
+
+    // Perform a (static) service query. The function returns after p_u16Timeout milliseconds
+    // The answers (the number of received answers is returned) can be retrieved by calling
+    // - answerHostname (or hostname)
+    // - answerIP (or IP)
+    // - answerPort (or port)
+    uint32_t queryService(const char* p_pcService,
+                          const char* p_pcProtocol,
+                          const uint16_t p_u16Timeout = MDNS_QUERYSERVICES_WAIT_TIME);
+    bool removeQuery(void);
+    // for compatibility...
+    uint32_t queryService(const String& p_strService,
+                          const String& p_strProtocol);
+
+    const char* answerHostname(const uint32_t p_u32AnswerIndex);
+    IPAddress answerIP(const uint32_t p_u32AnswerIndex);
+    uint16_t answerPort(const uint32_t p_u32AnswerIndex);
+    // for compatibility...
+    String hostname(const uint32_t p_u32AnswerIndex);
+    IPAddress IP(const uint32_t p_u32AnswerIndex);
+    uint16_t port(const uint32_t p_u32AnswerIndex);
 
-        /**
+    /**
         hMDNSServiceQuery (opaque handle to access dynamic service queries)
     */
-        typedef const void* hMDNSServiceQuery;
+    typedef const void*     hMDNSServiceQuery;
 
-        /**
+    /**
         enuServiceQueryAnswerType
     */
-        typedef enum _enuServiceQueryAnswerType
-        {
-            ServiceQueryAnswerType_ServiceDomain     = (1 << 0),  // Service instance name
-            ServiceQueryAnswerType_HostDomainAndPort = (1 << 1),  // Host domain and service port
-            ServiceQueryAnswerType_Txts              = (1 << 2),  // TXT items
+    typedef enum _enuServiceQueryAnswerType
+    {
+        ServiceQueryAnswerType_ServiceDomain        = (1 << 0), // Service instance name
+        ServiceQueryAnswerType_HostDomainAndPort    = (1 << 1), // Host domain and service port
+        ServiceQueryAnswerType_Txts                 = (1 << 2), // TXT items
 #ifdef MDNS_IP4_SUPPORT
-            ServiceQueryAnswerType_IP4Address = (1 << 3),  // IP4 address
+        ServiceQueryAnswerType_IP4Address           = (1 << 3), // IP4 address
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            ServiceQueryAnswerType_IP6Address = (1 << 4),  // IP6 address
+        ServiceQueryAnswerType_IP6Address           = (1 << 4), // IP6 address
 #endif
-        } enuServiceQueryAnswerType;
+    } enuServiceQueryAnswerType;
 
-        enum class AnswerType : uint32_t
-        {
-            Unknown           = 0,
-            ServiceDomain     = ServiceQueryAnswerType_ServiceDomain,
-            HostDomainAndPort = ServiceQueryAnswerType_HostDomainAndPort,
-            Txt               = ServiceQueryAnswerType_Txts,
+    enum class AnswerType : uint32_t
+    {
+        Unknown                             = 0,
+        ServiceDomain                       = ServiceQueryAnswerType_ServiceDomain,
+        HostDomainAndPort                   = ServiceQueryAnswerType_HostDomainAndPort,
+        Txt                                 = ServiceQueryAnswerType_Txts,
 #ifdef MDNS_IP4_SUPPORT
-            IP4Address = ServiceQueryAnswerType_IP4Address,
+        IP4Address                          = ServiceQueryAnswerType_IP4Address,
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            IP6Address = ServiceQueryAnswerType_IP6Address,
+        IP6Address                          = ServiceQueryAnswerType_IP6Address,
 #endif
-        };
+    };
 
-        /**
+    /**
         MDNSServiceQueryCallbackFn
         Callback function for received answers for dynamic service queries
     */
-        struct MDNSServiceInfo;  // forward declaration
-        typedef std::function<void(const MDNSServiceInfo& mdnsServiceInfo,
-                                   AnswerType             answerType,    // flag for the updated answer item
-                                   bool                   p_bSetContent  // true: Answer component set, false: component deleted
-                                   )>
-            MDNSServiceQueryCallbackFunc;
-
-        // Install a dynamic service query. For every received answer (part) the given callback
-        // function is called. The query will be updated every time, the TTL for an answer
-        // has timed-out.
-        // The answers can also be retrieved by calling
-        // - answerCount
-        // - answerServiceDomain
-        // - hasAnswerHostDomain/answerHostDomain
-        // - hasAnswerIP4Address/answerIP4Address
-        // - hasAnswerIP6Address/answerIP6Address
-        // - hasAnswerPort/answerPort
-        // - hasAnswerTxts/answerTxts
-        hMDNSServiceQuery installServiceQuery(const char*                  p_pcService,
-                                              const char*                  p_pcProtocol,
-                                              MDNSServiceQueryCallbackFunc p_fnCallback);
-        // Remove a dynamic service query
-        bool removeServiceQuery(hMDNSServiceQuery p_hServiceQuery);
-
-        uint32_t                                    answerCount(const hMDNSServiceQuery p_hServiceQuery);
-        std::vector<MDNSResponder::MDNSServiceInfo> answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery);
-
-        const char* answerServiceDomain(const hMDNSServiceQuery p_hServiceQuery,
-                                        const uint32_t          p_u32AnswerIndex);
-        bool        hasAnswerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
-                                        const uint32_t          p_u32AnswerIndex);
-        const char* answerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
-                                     const uint32_t          p_u32AnswerIndex);
+    struct MDNSServiceInfo; // forward declaration
+    typedef std::function<void(const MDNSServiceInfo& mdnsServiceInfo,
+                               AnswerType answerType,     // flag for the updated answer item
+                               bool p_bSetContent                      // true: Answer component set, false: component deleted
+                              )> MDNSServiceQueryCallbackFunc;
+
+    // Install a dynamic service query. For every received answer (part) the given callback
+    // function is called. The query will be updated every time, the TTL for an answer
+    // has timed-out.
+    // The answers can also be retrieved by calling
+    // - answerCount
+    // - answerServiceDomain
+    // - hasAnswerHostDomain/answerHostDomain
+    // - hasAnswerIP4Address/answerIP4Address
+    // - hasAnswerIP6Address/answerIP6Address
+    // - hasAnswerPort/answerPort
+    // - hasAnswerTxts/answerTxts
+    hMDNSServiceQuery installServiceQuery(const char* p_pcService,
+                                          const char* p_pcProtocol,
+                                          MDNSServiceQueryCallbackFunc p_fnCallback);
+    // Remove a dynamic service query
+    bool removeServiceQuery(hMDNSServiceQuery p_hServiceQuery);
+
+    uint32_t answerCount(const hMDNSServiceQuery p_hServiceQuery);
+    std::vector<MDNSResponder::MDNSServiceInfo> answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery);
+
+    const char* answerServiceDomain(const hMDNSServiceQuery p_hServiceQuery,
+                                    const uint32_t p_u32AnswerIndex);
+    bool hasAnswerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
+                             const uint32_t p_u32AnswerIndex);
+    const char* answerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
+                                 const uint32_t p_u32AnswerIndex);
 #ifdef MDNS_IP4_SUPPORT
-        bool      hasAnswerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
-                                      const uint32_t          p_u32AnswerIndex);
-        uint32_t  answerIP4AddressCount(const hMDNSServiceQuery p_hServiceQuery,
-                                        const uint32_t          p_u32AnswerIndex);
-        IPAddress answerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
-                                   const uint32_t          p_u32AnswerIndex,
-                                   const uint32_t          p_u32AddressIndex);
+    bool hasAnswerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
+                             const uint32_t p_u32AnswerIndex);
+    uint32_t answerIP4AddressCount(const hMDNSServiceQuery p_hServiceQuery,
+                                   const uint32_t p_u32AnswerIndex);
+    IPAddress answerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
+                               const uint32_t p_u32AnswerIndex,
+                               const uint32_t p_u32AddressIndex);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        bool      hasAnswerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
-                                      const uint32_t          p_u32AnswerIndex);
-        uint32_t  answerIP6AddressCount(const hMDNSServiceQuery p_hServiceQuery,
-                                        const uint32_t          p_u32AnswerIndex);
-        IPAddress answerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
-                                   const uint32_t          p_u32AnswerIndex,
-                                   const uint32_t          p_u32AddressIndex);
+    bool hasAnswerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
+                             const uint32_t p_u32AnswerIndex);
+    uint32_t answerIP6AddressCount(const hMDNSServiceQuery p_hServiceQuery,
+                                   const uint32_t p_u32AnswerIndex);
+    IPAddress answerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
+                               const uint32_t p_u32AnswerIndex,
+                               const uint32_t p_u32AddressIndex);
 #endif
-        bool     hasAnswerPort(const hMDNSServiceQuery p_hServiceQuery,
-                               const uint32_t          p_u32AnswerIndex);
-        uint16_t answerPort(const hMDNSServiceQuery p_hServiceQuery,
-                            const uint32_t          p_u32AnswerIndex);
-        bool     hasAnswerTxts(const hMDNSServiceQuery p_hServiceQuery,
-                               const uint32_t          p_u32AnswerIndex);
-        // Get the TXT items as a ';'-separated string
-        const char* answerTxts(const hMDNSServiceQuery p_hServiceQuery,
-                               const uint32_t          p_u32AnswerIndex);
+    bool hasAnswerPort(const hMDNSServiceQuery p_hServiceQuery,
+                       const uint32_t p_u32AnswerIndex);
+    uint16_t answerPort(const hMDNSServiceQuery p_hServiceQuery,
+                        const uint32_t p_u32AnswerIndex);
+    bool hasAnswerTxts(const hMDNSServiceQuery p_hServiceQuery,
+                       const uint32_t p_u32AnswerIndex);
+    // Get the TXT items as a ';'-separated string
+    const char* answerTxts(const hMDNSServiceQuery p_hServiceQuery,
+                           const uint32_t p_u32AnswerIndex);
 
-        /**
+    /**
         MDNSProbeResultCallbackFn
         Callback function for (host and service domain) probe results
     */
-        typedef std::function<void(const char* p_pcDomainName,
-                                   bool        p_bProbeResult)>
-            MDNSHostProbeFn;
-
-        typedef std::function<void(MDNSResponder& resp,
-                                   const char*    p_pcDomainName,
-                                   bool           p_bProbeResult)>
-            MDNSHostProbeFn1;
-
-        typedef std::function<void(const char*        p_pcServiceName,
-                                   const hMDNSService p_hMDNSService,
-                                   bool               p_bProbeResult)>
-            MDNSServiceProbeFn;
-
-        typedef std::function<void(MDNSResponder&     resp,
-                                   const char*        p_pcServiceName,
-                                   const hMDNSService p_hMDNSService,
-                                   bool               p_bProbeResult)>
-            MDNSServiceProbeFn1;
-
-        // Set a global callback function for host and service probe results
-        // The callback function is called, when the probing for the host domain
-        // (or a service domain, which hasn't got a service specific callback)
-        // Succeeds or fails.
-        // In case of failure, the failed domain name should be changed.
-        bool setHostProbeResultCallback(MDNSHostProbeFn p_fnCallback);
-        bool setHostProbeResultCallback(MDNSHostProbeFn1 p_fnCallback);
-
-        // Set a service specific probe result callback
-        bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-                                           MDNSServiceProbeFn                p_fnCallback);
-        bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-                                           MDNSServiceProbeFn1               p_fnCallback);
-
-        // Application should call this whenever AP is configured/disabled
-        bool notifyAPChange(void);
-
-        // 'update' should be called in every 'loop' to run the MDNS processing
-        bool update(void);
-
-        // 'announce' can be called every time, the configuration of some service
-        // changes. Mainly, this would be changed content of TXT items.
-        bool announce(void);
-
-        // Enable OTA update
-        hMDNSService enableArduino(uint16_t p_u16Port,
-                                   bool     p_bAuthUpload = false);
-
-        // Domain name helper
-        static bool indexDomain(char*&      p_rpcDomain,
-                                const char* p_pcDivider       = "-",
-                                const char* p_pcDefaultDomain = 0);
-
-        /** STRUCTS **/
-
-    public:
-        /**
+    typedef std::function<void(const char* p_pcDomainName,
+                               bool p_bProbeResult)> MDNSHostProbeFn;
+
+    typedef std::function<void(MDNSResponder& resp,
+                               const char* p_pcDomainName,
+                               bool p_bProbeResult)> MDNSHostProbeFn1;
+
+    typedef std::function<void(const char* p_pcServiceName,
+                               const hMDNSService p_hMDNSService,
+                               bool p_bProbeResult)> MDNSServiceProbeFn;
+
+    typedef std::function<void(MDNSResponder& resp,
+                               const char* p_pcServiceName,
+                               const hMDNSService p_hMDNSService,
+                               bool p_bProbeResult)> MDNSServiceProbeFn1;
+
+    // Set a global callback function for host and service probe results
+    // The callback function is called, when the probing for the host domain
+    // (or a service domain, which hasn't got a service specific callback)
+    // Succeeds or fails.
+    // In case of failure, the failed domain name should be changed.
+    bool setHostProbeResultCallback(MDNSHostProbeFn p_fnCallback);
+    bool setHostProbeResultCallback(MDNSHostProbeFn1 p_fnCallback);
+
+    // Set a service specific probe result callback
+    bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+                                       MDNSServiceProbeFn p_fnCallback);
+    bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+                                       MDNSServiceProbeFn1 p_fnCallback);
+
+    // Application should call this whenever AP is configured/disabled
+    bool notifyAPChange(void);
+
+    // 'update' should be called in every 'loop' to run the MDNS processing
+    bool update(void);
+
+    // 'announce' can be called every time, the configuration of some service
+    // changes. Mainly, this would be changed content of TXT items.
+    bool announce(void);
+
+    // Enable OTA update
+    hMDNSService enableArduino(uint16_t p_u16Port,
+                               bool p_bAuthUpload = false);
+
+    // Domain name helper
+    static bool indexDomain(char*& p_rpcDomain,
+                            const char* p_pcDivider = "-",
+                            const char* p_pcDefaultDomain = 0);
+
+    /** STRUCTS **/
+
+public:
+    /**
         MDNSServiceInfo, used in application callbacks
     */
-        struct MDNSServiceInfo
+    struct MDNSServiceInfo
+    {
+        MDNSServiceInfo(MDNSResponder& p_pM, MDNSResponder::hMDNSServiceQuery p_hS, uint32_t p_u32A)
+            : p_pMDNSResponder(p_pM),
+              p_hServiceQuery(p_hS),
+              p_u32AnswerIndex(p_u32A)
+        {};
+        struct CompareKey
         {
-            MDNSServiceInfo(MDNSResponder& p_pM, MDNSResponder::hMDNSServiceQuery p_hS, uint32_t p_u32A) :
-                p_pMDNSResponder(p_pM),
-                p_hServiceQuery(p_hS),
-                p_u32AnswerIndex(p_u32A) {};
-            struct CompareKey
+            bool operator()(char const *a, char const *b) const
             {
-                bool operator()(char const* a, char const* b) const
-                {
-                    return strcmp(a, b) < 0;
-                }
-            };
-            using KeyValueMap = std::map<const char*, const char*, CompareKey>;
-
-        protected:
-            MDNSResponder&                   p_pMDNSResponder;
-            MDNSResponder::hMDNSServiceQuery p_hServiceQuery;
-            uint32_t                         p_u32AnswerIndex;
-            KeyValueMap                      keyValueMap;
-
-        public:
-            const char* serviceDomain()
-            {
-                return p_pMDNSResponder.answerServiceDomain(p_hServiceQuery, p_u32AnswerIndex);
-            };
-            bool hostDomainAvailable()
-            {
-                return (p_pMDNSResponder.hasAnswerHostDomain(p_hServiceQuery, p_u32AnswerIndex));
-            }
-            const char* hostDomain()
-            {
-                return (hostDomainAvailable()) ? p_pMDNSResponder.answerHostDomain(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
-            };
-            bool hostPortAvailable()
-            {
-                return (p_pMDNSResponder.hasAnswerPort(p_hServiceQuery, p_u32AnswerIndex));
+                return strcmp(a, b) < 0;
             }
-            uint16_t hostPort()
-            {
-                return (hostPortAvailable()) ? p_pMDNSResponder.answerPort(p_hServiceQuery, p_u32AnswerIndex) : 0;
-            };
-            bool IP4AddressAvailable()
-            {
-                return (p_pMDNSResponder.hasAnswerIP4Address(p_hServiceQuery, p_u32AnswerIndex));
-            }
-            std::vector<IPAddress> IP4Adresses()
+        };
+        using KeyValueMap = std::map<const char*, const char*, CompareKey>;
+    protected:
+        MDNSResponder& p_pMDNSResponder;
+        MDNSResponder::hMDNSServiceQuery p_hServiceQuery;
+        uint32_t p_u32AnswerIndex;
+        KeyValueMap keyValueMap;
+    public:
+        const char* serviceDomain()
+        {
+            return p_pMDNSResponder.answerServiceDomain(p_hServiceQuery, p_u32AnswerIndex);
+        };
+        bool hostDomainAvailable()
+        {
+            return (p_pMDNSResponder.hasAnswerHostDomain(p_hServiceQuery, p_u32AnswerIndex));
+        }
+        const char* hostDomain()
+        {
+            return (hostDomainAvailable()) ?
+                   p_pMDNSResponder.answerHostDomain(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
+        };
+        bool hostPortAvailable()
+        {
+            return (p_pMDNSResponder.hasAnswerPort(p_hServiceQuery, p_u32AnswerIndex));
+        }
+        uint16_t hostPort()
+        {
+            return (hostPortAvailable()) ?
+                   p_pMDNSResponder.answerPort(p_hServiceQuery, p_u32AnswerIndex) : 0;
+        };
+        bool IP4AddressAvailable()
+        {
+            return (p_pMDNSResponder.hasAnswerIP4Address(p_hServiceQuery, p_u32AnswerIndex));
+        }
+        std::vector<IPAddress> IP4Adresses()
+        {
+            std::vector<IPAddress> internalIP;
+            if (IP4AddressAvailable())
             {
-                std::vector<IPAddress> internalIP;
-                if (IP4AddressAvailable())
+                uint16_t cntIP4Adress = p_pMDNSResponder.answerIP4AddressCount(p_hServiceQuery, p_u32AnswerIndex);
+                for (uint32_t u2 = 0; u2 < cntIP4Adress; ++u2)
                 {
-                    uint16_t cntIP4Adress = p_pMDNSResponder.answerIP4AddressCount(p_hServiceQuery, p_u32AnswerIndex);
-                    for (uint32_t u2 = 0; u2 < cntIP4Adress; ++u2)
-                    {
-                        internalIP.emplace_back(p_pMDNSResponder.answerIP4Address(p_hServiceQuery, p_u32AnswerIndex, u2));
-                    }
+                    internalIP.emplace_back(p_pMDNSResponder.answerIP4Address(p_hServiceQuery, p_u32AnswerIndex, u2));
                 }
-                return internalIP;
-            };
-            bool txtAvailable()
-            {
-                return (p_pMDNSResponder.hasAnswerTxts(p_hServiceQuery, p_u32AnswerIndex));
             }
-            const char* strKeyValue()
-            {
-                return (txtAvailable()) ? p_pMDNSResponder.answerTxts(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
-            };
-            const KeyValueMap& keyValues()
+            return internalIP;
+        };
+        bool txtAvailable()
+        {
+            return (p_pMDNSResponder.hasAnswerTxts(p_hServiceQuery, p_u32AnswerIndex));
+        }
+        const char* strKeyValue()
+        {
+            return (txtAvailable()) ?
+                   p_pMDNSResponder.answerTxts(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
+        };
+        const KeyValueMap& keyValues()
+        {
+            if (txtAvailable() && keyValueMap.size() == 0)
             {
-                if (txtAvailable() && keyValueMap.size() == 0)
+                for (auto kv = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); kv != nullptr; kv = kv->m_pNext)
                 {
-                    for (auto kv = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); kv != nullptr; kv = kv->m_pNext)
-                    {
-                        keyValueMap.emplace(std::pair<const char*, const char*>(kv->m_pcKey, kv->m_pcValue));
-                    }
+                    keyValueMap.emplace(std::pair<const char*, const char*>(kv->m_pcKey, kv->m_pcValue));
                 }
-                return keyValueMap;
             }
-            const char* value(const char* key)
-            {
-                char* result = nullptr;
+            return keyValueMap;
+        }
+        const char* value(const char* key)
+        {
+            char* result = nullptr;
 
-                for (stcMDNSServiceTxt* pTxt = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); pTxt; pTxt = pTxt->m_pNext)
+            for (stcMDNSServiceTxt* pTxt = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); pTxt; pTxt = pTxt->m_pNext)
+            {
+                if ((key) &&
+                        (0 == strcmp(pTxt->m_pcKey, key)))
                 {
-                    if ((key) && (0 == strcmp(pTxt->m_pcKey, key)))
-                    {
-                        result = pTxt->m_pcValue;
-                        break;
-                    }
+                    result = pTxt->m_pcValue;
+                    break;
                 }
-                return result;
             }
-        };
+            return result;
+        }
+    };
+protected:
 
-    protected:
-        /**
+    /**
         stcMDNSServiceTxt
     */
-        struct stcMDNSServiceTxt
-        {
-            stcMDNSServiceTxt* m_pNext;
-            char*              m_pcKey;
-            char*              m_pcValue;
-            bool               m_bTemp;
-
-            stcMDNSServiceTxt(const char* p_pcKey   = 0,
-                              const char* p_pcValue = 0,
-                              bool        p_bTemp   = false);
-            stcMDNSServiceTxt(const stcMDNSServiceTxt& p_Other);
-            ~stcMDNSServiceTxt(void);
-
-            stcMDNSServiceTxt& operator=(const stcMDNSServiceTxt& p_Other);
-            bool               clear(void);
-
-            char* allocKey(size_t p_stLength);
-            bool  setKey(const char* p_pcKey,
-                         size_t      p_stLength);
-            bool  setKey(const char* p_pcKey);
-            bool  releaseKey(void);
-
-            char* allocValue(size_t p_stLength);
-            bool  setValue(const char* p_pcValue,
-                           size_t      p_stLength);
-            bool  setValue(const char* p_pcValue);
-            bool  releaseValue(void);
-
-            bool set(const char* p_pcKey,
-                     const char* p_pcValue,
-                     bool        p_bTemp = false);
-
-            bool update(const char* p_pcValue);
-
-            size_t length(void) const;
-        };
+    struct stcMDNSServiceTxt
+    {
+        stcMDNSServiceTxt* m_pNext;
+        char*              m_pcKey;
+        char*              m_pcValue;
+        bool               m_bTemp;
+
+        stcMDNSServiceTxt(const char* p_pcKey = 0,
+                          const char* p_pcValue = 0,
+                          bool p_bTemp = false);
+        stcMDNSServiceTxt(const stcMDNSServiceTxt& p_Other);
+        ~stcMDNSServiceTxt(void);
+
+        stcMDNSServiceTxt& operator=(const stcMDNSServiceTxt& p_Other);
+        bool clear(void);
+
+        char* allocKey(size_t p_stLength);
+        bool setKey(const char* p_pcKey,
+                    size_t p_stLength);
+        bool setKey(const char* p_pcKey);
+        bool releaseKey(void);
+
+        char* allocValue(size_t p_stLength);
+        bool setValue(const char* p_pcValue,
+                      size_t p_stLength);
+        bool setValue(const char* p_pcValue);
+        bool releaseValue(void);
+
+        bool set(const char* p_pcKey,
+                 const char* p_pcValue,
+                 bool p_bTemp = false);
+
+        bool update(const char* p_pcValue);
+
+        size_t length(void) const;
+    };
 
-        /**
+    /**
         stcMDNSTxts
     */
-        struct stcMDNSServiceTxts
-        {
-            stcMDNSServiceTxt* m_pTxts;
+    struct stcMDNSServiceTxts
+    {
+        stcMDNSServiceTxt*  m_pTxts;
 
-            stcMDNSServiceTxts(void);
-            stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other);
-            ~stcMDNSServiceTxts(void);
+        stcMDNSServiceTxts(void);
+        stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other);
+        ~stcMDNSServiceTxts(void);
 
-            stcMDNSServiceTxts& operator=(const stcMDNSServiceTxts& p_Other);
+        stcMDNSServiceTxts& operator=(const stcMDNSServiceTxts& p_Other);
 
-            bool clear(void);
+        bool clear(void);
 
-            bool add(stcMDNSServiceTxt* p_pTxt);
-            bool remove(stcMDNSServiceTxt* p_pTxt);
+        bool add(stcMDNSServiceTxt* p_pTxt);
+        bool remove(stcMDNSServiceTxt* p_pTxt);
 
-            bool removeTempTxts(void);
+        bool removeTempTxts(void);
 
-            stcMDNSServiceTxt*       find(const char* p_pcKey);
-            const stcMDNSServiceTxt* find(const char* p_pcKey) const;
-            stcMDNSServiceTxt*       find(const stcMDNSServiceTxt* p_pTxt);
+        stcMDNSServiceTxt* find(const char* p_pcKey);
+        const stcMDNSServiceTxt* find(const char* p_pcKey) const;
+        stcMDNSServiceTxt* find(const stcMDNSServiceTxt* p_pTxt);
 
-            uint16_t length(void) const;
+        uint16_t length(void) const;
 
-            size_t c_strLength(void) const;
-            bool   c_str(char* p_pcBuffer);
+        size_t c_strLength(void) const;
+        bool c_str(char* p_pcBuffer);
 
-            size_t bufferLength(void) const;
-            bool   buffer(char* p_pcBuffer);
+        size_t bufferLength(void) const;
+        bool buffer(char* p_pcBuffer);
 
-            bool compare(const stcMDNSServiceTxts& p_Other) const;
-            bool operator==(const stcMDNSServiceTxts& p_Other) const;
-            bool operator!=(const stcMDNSServiceTxts& p_Other) const;
-        };
+        bool compare(const stcMDNSServiceTxts& p_Other) const;
+        bool operator==(const stcMDNSServiceTxts& p_Other) const;
+        bool operator!=(const stcMDNSServiceTxts& p_Other) const;
+    };
 
-        /**
+    /**
         enuContentFlags
     */
-        typedef enum _enuContentFlags
-        {
-            // Host
-            ContentFlag_A       = 0x01,
-            ContentFlag_PTR_IP4 = 0x02,
-            ContentFlag_PTR_IP6 = 0x04,
-            ContentFlag_AAAA    = 0x08,
-            // Service
-            ContentFlag_PTR_TYPE = 0x10,
-            ContentFlag_PTR_NAME = 0x20,
-            ContentFlag_TXT      = 0x40,
-            ContentFlag_SRV      = 0x80,
-        } enuContentFlags;
+    typedef enum _enuContentFlags
+    {
+        // Host
+        ContentFlag_A           = 0x01,
+        ContentFlag_PTR_IP4     = 0x02,
+        ContentFlag_PTR_IP6     = 0x04,
+        ContentFlag_AAAA        = 0x08,
+        // Service
+        ContentFlag_PTR_TYPE    = 0x10,
+        ContentFlag_PTR_NAME    = 0x20,
+        ContentFlag_TXT         = 0x40,
+        ContentFlag_SRV         = 0x80,
+    } enuContentFlags;
 
-        /**
+    /**
         stcMDNS_MsgHeader
     */
-        struct stcMDNS_MsgHeader
-        {
-            uint16_t      m_u16ID;         // Identifier
-            bool          m_1bQR     : 1;  // Query/Response flag
-            unsigned char m_4bOpcode : 4;  // Operation code
-            bool          m_1bAA     : 1;  // Authoritative Answer flag
-            bool          m_1bTC     : 1;  // Truncation flag
-            bool          m_1bRD     : 1;  // Recursion desired
-            bool          m_1bRA     : 1;  // Recursion available
-            unsigned char m_3bZ      : 3;  // Zero
-            unsigned char m_4bRCode  : 4;  // Response code
-            uint16_t      m_u16QDCount;    // Question count
-            uint16_t      m_u16ANCount;    // Answer count
-            uint16_t      m_u16NSCount;    // Authority Record count
-            uint16_t      m_u16ARCount;    // Additional Record count
-
-            stcMDNS_MsgHeader(uint16_t      p_u16ID      = 0,
-                              bool          p_bQR        = false,
-                              unsigned char p_ucOpcode   = 0,
-                              bool          p_bAA        = false,
-                              bool          p_bTC        = false,
-                              bool          p_bRD        = false,
-                              bool          p_bRA        = false,
-                              unsigned char p_ucRCode    = 0,
-                              uint16_t      p_u16QDCount = 0,
-                              uint16_t      p_u16ANCount = 0,
-                              uint16_t      p_u16NSCount = 0,
-                              uint16_t      p_u16ARCount = 0);
-        };
+    struct stcMDNS_MsgHeader
+    {
+        uint16_t        m_u16ID;            // Identifier
+        bool            m_1bQR      : 1;    // Query/Response flag
+        unsigned char   m_4bOpcode  : 4;    // Operation code
+        bool            m_1bAA      : 1;    // Authoritative Answer flag
+        bool            m_1bTC      : 1;    // Truncation flag
+        bool            m_1bRD      : 1;    // Recursion desired
+        bool            m_1bRA      : 1;    // Recursion available
+        unsigned char   m_3bZ       : 3;    // Zero
+        unsigned char   m_4bRCode   : 4;    // Response code
+        uint16_t        m_u16QDCount;       // Question count
+        uint16_t        m_u16ANCount;       // Answer count
+        uint16_t        m_u16NSCount;       // Authority Record count
+        uint16_t        m_u16ARCount;       // Additional Record count
+
+        stcMDNS_MsgHeader(uint16_t p_u16ID = 0,
+                          bool p_bQR = false,
+                          unsigned char p_ucOpcode = 0,
+                          bool p_bAA = false,
+                          bool p_bTC = false,
+                          bool p_bRD = false,
+                          bool p_bRA = false,
+                          unsigned char p_ucRCode = 0,
+                          uint16_t p_u16QDCount = 0,
+                          uint16_t p_u16ANCount = 0,
+                          uint16_t p_u16NSCount = 0,
+                          uint16_t p_u16ARCount = 0);
+    };
 
-        /**
+    /**
         stcMDNS_RRDomain
     */
-        struct stcMDNS_RRDomain
-        {
-            char     m_acName[MDNS_DOMAIN_MAXLENGTH];  // Encoded domain name
-            uint16_t m_u16NameLength;                  // Length (incl. '\0')
+    struct stcMDNS_RRDomain
+    {
+        char            m_acName[MDNS_DOMAIN_MAXLENGTH];    // Encoded domain name
+        uint16_t        m_u16NameLength;                    // Length (incl. '\0')
 
-            stcMDNS_RRDomain(void);
-            stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other);
+        stcMDNS_RRDomain(void);
+        stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other);
 
-            stcMDNS_RRDomain& operator=(const stcMDNS_RRDomain& p_Other);
+        stcMDNS_RRDomain& operator=(const stcMDNS_RRDomain& p_Other);
 
-            bool clear(void);
+        bool clear(void);
 
-            bool addLabel(const char* p_pcLabel,
-                          bool        p_bPrependUnderline = false);
+        bool addLabel(const char* p_pcLabel,
+                      bool p_bPrependUnderline = false);
 
-            bool compare(const stcMDNS_RRDomain& p_Other) const;
-            bool operator==(const stcMDNS_RRDomain& p_Other) const;
-            bool operator!=(const stcMDNS_RRDomain& p_Other) const;
-            bool operator>(const stcMDNS_RRDomain& p_Other) const;
+        bool compare(const stcMDNS_RRDomain& p_Other) const;
+        bool operator==(const stcMDNS_RRDomain& p_Other) const;
+        bool operator!=(const stcMDNS_RRDomain& p_Other) const;
+        bool operator>(const stcMDNS_RRDomain& p_Other) const;
 
-            size_t c_strLength(void) const;
-            bool   c_str(char* p_pcBuffer);
-        };
+        size_t c_strLength(void) const;
+        bool c_str(char* p_pcBuffer);
+    };
 
-        /**
+    /**
         stcMDNS_RRAttributes
     */
-        struct stcMDNS_RRAttributes
-        {
-            uint16_t m_u16Type;   // Type
-            uint16_t m_u16Class;  // Class, nearly always 'IN'
+    struct stcMDNS_RRAttributes
+    {
+        uint16_t            m_u16Type;      // Type
+        uint16_t            m_u16Class;     // Class, nearly always 'IN'
 
-            stcMDNS_RRAttributes(uint16_t p_u16Type  = 0,
-                                 uint16_t p_u16Class = 1 /*DNS_RRCLASS_IN Internet*/);
-            stcMDNS_RRAttributes(const stcMDNS_RRAttributes& p_Other);
+        stcMDNS_RRAttributes(uint16_t p_u16Type = 0,
+                             uint16_t p_u16Class = 1 /*DNS_RRCLASS_IN Internet*/);
+        stcMDNS_RRAttributes(const stcMDNS_RRAttributes& p_Other);
 
-            stcMDNS_RRAttributes& operator=(const stcMDNS_RRAttributes& p_Other);
-        };
+        stcMDNS_RRAttributes& operator=(const stcMDNS_RRAttributes& p_Other);
+    };
 
-        /**
+    /**
         stcMDNS_RRHeader
     */
-        struct stcMDNS_RRHeader
-        {
-            stcMDNS_RRDomain     m_Domain;
-            stcMDNS_RRAttributes m_Attributes;
+    struct stcMDNS_RRHeader
+    {
+        stcMDNS_RRDomain        m_Domain;
+        stcMDNS_RRAttributes    m_Attributes;
 
-            stcMDNS_RRHeader(void);
-            stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other);
+        stcMDNS_RRHeader(void);
+        stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other);
 
-            stcMDNS_RRHeader& operator=(const stcMDNS_RRHeader& p_Other);
+        stcMDNS_RRHeader& operator=(const stcMDNS_RRHeader& p_Other);
 
-            bool clear(void);
-        };
+        bool clear(void);
+    };
 
-        /**
+    /**
         stcMDNS_RRQuestion
     */
-        struct stcMDNS_RRQuestion
-        {
-            stcMDNS_RRQuestion* m_pNext;
-            stcMDNS_RRHeader    m_Header;
-            bool                m_bUnicast;  // Unicast reply requested
+    struct stcMDNS_RRQuestion
+    {
+        stcMDNS_RRQuestion*     m_pNext;
+        stcMDNS_RRHeader        m_Header;
+        bool                    m_bUnicast;     // Unicast reply requested
 
-            stcMDNS_RRQuestion(void);
-        };
+        stcMDNS_RRQuestion(void);
+    };
 
-        /**
+    /**
         enuAnswerType
     */
-        typedef enum _enuAnswerType
-        {
-            AnswerType_A,
-            AnswerType_PTR,
-            AnswerType_TXT,
-            AnswerType_AAAA,
-            AnswerType_SRV,
-            AnswerType_Generic
-        } enuAnswerType;
+    typedef enum _enuAnswerType
+    {
+        AnswerType_A,
+        AnswerType_PTR,
+        AnswerType_TXT,
+        AnswerType_AAAA,
+        AnswerType_SRV,
+        AnswerType_Generic
+    } enuAnswerType;
 
-        /**
+    /**
         stcMDNS_RRAnswer
     */
-        struct stcMDNS_RRAnswer
-        {
-            stcMDNS_RRAnswer*   m_pNext;
-            const enuAnswerType m_AnswerType;
-            stcMDNS_RRHeader    m_Header;
-            bool                m_bCacheFlush;  // Cache flush command bit
-            uint32_t            m_u32TTL;       // Validity time in seconds
+    struct stcMDNS_RRAnswer
+    {
+        stcMDNS_RRAnswer*   m_pNext;
+        const enuAnswerType m_AnswerType;
+        stcMDNS_RRHeader    m_Header;
+        bool                m_bCacheFlush;  // Cache flush command bit
+        uint32_t            m_u32TTL;       // Validity time in seconds
 
-            virtual ~stcMDNS_RRAnswer(void);
+        virtual ~stcMDNS_RRAnswer(void);
 
-            enuAnswerType answerType(void) const;
+        enuAnswerType answerType(void) const;
 
-            bool clear(void);
+        bool clear(void);
 
-        protected:
-            stcMDNS_RRAnswer(enuAnswerType           p_AnswerType,
-                             const stcMDNS_RRHeader& p_Header,
-                             uint32_t                p_u32TTL);
-        };
+    protected:
+        stcMDNS_RRAnswer(enuAnswerType p_AnswerType,
+                         const stcMDNS_RRHeader& p_Header,
+                         uint32_t p_u32TTL);
+    };
 
 #ifdef MDNS_IP4_SUPPORT
-        /**
+    /**
         stcMDNS_RRAnswerA
     */
-        struct stcMDNS_RRAnswerA : public stcMDNS_RRAnswer
-        {
-            IPAddress m_IPAddress;
+    struct stcMDNS_RRAnswerA : public stcMDNS_RRAnswer
+    {
+        IPAddress           m_IPAddress;
 
-            stcMDNS_RRAnswerA(const stcMDNS_RRHeader& p_Header,
-                              uint32_t                p_u32TTL);
-            ~stcMDNS_RRAnswerA(void);
+        stcMDNS_RRAnswerA(const stcMDNS_RRHeader& p_Header,
+                          uint32_t p_u32TTL);
+        ~stcMDNS_RRAnswerA(void);
 
-            bool clear(void);
-        };
+        bool clear(void);
+    };
 #endif
 
-        /**
+    /**
         stcMDNS_RRAnswerPTR
     */
-        struct stcMDNS_RRAnswerPTR : public stcMDNS_RRAnswer
-        {
-            stcMDNS_RRDomain m_PTRDomain;
+    struct stcMDNS_RRAnswerPTR : public stcMDNS_RRAnswer
+    {
+        stcMDNS_RRDomain    m_PTRDomain;
 
-            stcMDNS_RRAnswerPTR(const stcMDNS_RRHeader& p_Header,
-                                uint32_t                p_u32TTL);
-            ~stcMDNS_RRAnswerPTR(void);
+        stcMDNS_RRAnswerPTR(const stcMDNS_RRHeader& p_Header,
+                            uint32_t p_u32TTL);
+        ~stcMDNS_RRAnswerPTR(void);
 
-            bool clear(void);
-        };
+        bool clear(void);
+    };
 
-        /**
+    /**
         stcMDNS_RRAnswerTXT
     */
-        struct stcMDNS_RRAnswerTXT : public stcMDNS_RRAnswer
-        {
-            stcMDNSServiceTxts m_Txts;
+    struct stcMDNS_RRAnswerTXT : public stcMDNS_RRAnswer
+    {
+        stcMDNSServiceTxts  m_Txts;
 
-            stcMDNS_RRAnswerTXT(const stcMDNS_RRHeader& p_Header,
-                                uint32_t                p_u32TTL);
-            ~stcMDNS_RRAnswerTXT(void);
+        stcMDNS_RRAnswerTXT(const stcMDNS_RRHeader& p_Header,
+                            uint32_t p_u32TTL);
+        ~stcMDNS_RRAnswerTXT(void);
 
-            bool clear(void);
-        };
+        bool clear(void);
+    };
 
 #ifdef MDNS_IP6_SUPPORT
-        /**
+    /**
         stcMDNS_RRAnswerAAAA
     */
-        struct stcMDNS_RRAnswerAAAA : public stcMDNS_RRAnswer
-        {
-            //TODO: IP6Address          m_IPAddress;
+    struct stcMDNS_RRAnswerAAAA : public stcMDNS_RRAnswer
+    {
+        //TODO: IP6Address          m_IPAddress;
 
-            stcMDNS_RRAnswerAAAA(const stcMDNS_RRHeader& p_Header,
-                                 uint32_t                p_u32TTL);
-            ~stcMDNS_RRAnswerAAAA(void);
+        stcMDNS_RRAnswerAAAA(const stcMDNS_RRHeader& p_Header,
+                             uint32_t p_u32TTL);
+        ~stcMDNS_RRAnswerAAAA(void);
 
-            bool clear(void);
-        };
+        bool clear(void);
+    };
 #endif
 
-        /**
+    /**
         stcMDNS_RRAnswerSRV
     */
-        struct stcMDNS_RRAnswerSRV : public stcMDNS_RRAnswer
-        {
-            uint16_t         m_u16Priority;
-            uint16_t         m_u16Weight;
-            uint16_t         m_u16Port;
-            stcMDNS_RRDomain m_SRVDomain;
+    struct stcMDNS_RRAnswerSRV : public stcMDNS_RRAnswer
+    {
+        uint16_t            m_u16Priority;
+        uint16_t            m_u16Weight;
+        uint16_t            m_u16Port;
+        stcMDNS_RRDomain    m_SRVDomain;
 
-            stcMDNS_RRAnswerSRV(const stcMDNS_RRHeader& p_Header,
-                                uint32_t                p_u32TTL);
-            ~stcMDNS_RRAnswerSRV(void);
+        stcMDNS_RRAnswerSRV(const stcMDNS_RRHeader& p_Header,
+                            uint32_t p_u32TTL);
+        ~stcMDNS_RRAnswerSRV(void);
 
-            bool clear(void);
-        };
+        bool clear(void);
+    };
 
-        /**
+    /**
         stcMDNS_RRAnswerGeneric
     */
-        struct stcMDNS_RRAnswerGeneric : public stcMDNS_RRAnswer
-        {
-            uint16_t m_u16RDLength;  // Length of variable answer
-            uint8_t* m_pu8RDData;    // Offset of start of variable answer in packet
+    struct stcMDNS_RRAnswerGeneric : public stcMDNS_RRAnswer
+    {
+        uint16_t            m_u16RDLength;  // Length of variable answer
+        uint8_t*            m_pu8RDData;    // Offset of start of variable answer in packet
 
-            stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
-                                    uint32_t                p_u32TTL);
-            ~stcMDNS_RRAnswerGeneric(void);
+        stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
+                                uint32_t p_u32TTL);
+        ~stcMDNS_RRAnswerGeneric(void);
 
-            bool clear(void);
-        };
+        bool clear(void);
+    };
 
-        /**
+
+    /**
         enuProbingStatus
     */
-        typedef enum _enuProbingStatus
-        {
-            ProbingStatus_WaitingForData,
-            ProbingStatus_ReadyToStart,
-            ProbingStatus_InProgress,
-            ProbingStatus_Done
-        } enuProbingStatus;
+    typedef enum _enuProbingStatus
+    {
+        ProbingStatus_WaitingForData,
+        ProbingStatus_ReadyToStart,
+        ProbingStatus_InProgress,
+        ProbingStatus_Done
+    } enuProbingStatus;
 
-        /**
+    /**
         stcProbeInformation
     */
-        struct stcProbeInformation
-        {
-            enuProbingStatus                  m_ProbingStatus;
-            uint8_t                           m_u8SentCount;  // Used for probes and announcements
-            esp8266::polledTimeout::oneShotMs m_Timeout;      // Used for probes and announcements
-            //clsMDNSTimeFlag                   m_TimeFlag;     // Used for probes and announcements
-            bool               m_bConflict;
-            bool               m_bTiebreakNeeded;
-            MDNSHostProbeFn    m_fnHostProbeResultCallback;
-            MDNSServiceProbeFn m_fnServiceProbeResultCallback;
-
-            stcProbeInformation(void);
-
-            bool clear(bool p_bClearUserdata = false);
-        };
+    struct stcProbeInformation
+    {
+        enuProbingStatus                  m_ProbingStatus;
+        uint8_t                           m_u8SentCount;  // Used for probes and announcements
+        esp8266::polledTimeout::oneShotMs m_Timeout;      // Used for probes and announcements
+        //clsMDNSTimeFlag                   m_TimeFlag;     // Used for probes and announcements
+        bool                              m_bConflict;
+        bool                              m_bTiebreakNeeded;
+        MDNSHostProbeFn   				m_fnHostProbeResultCallback;
+        MDNSServiceProbeFn 				m_fnServiceProbeResultCallback;
+
+        stcProbeInformation(void);
+
+        bool clear(bool p_bClearUserdata = false);
+    };
 
-        /**
+
+    /**
         stcMDNSService
     */
-        struct stcMDNSService
-        {
-            stcMDNSService*                   m_pNext;
-            char*                             m_pcName;
-            bool                              m_bAutoName;  // Name was set automatically to hostname (if no name was supplied)
-            char*                             m_pcService;
-            char*                             m_pcProtocol;
-            uint16_t                          m_u16Port;
-            uint8_t                           m_u8ReplyMask;
-            stcMDNSServiceTxts                m_Txts;
-            MDNSDynamicServiceTxtCallbackFunc m_fnTxtCallback;
-            stcProbeInformation               m_ProbeInformation;
-
-            stcMDNSService(const char* p_pcName     = 0,
-                           const char* p_pcService  = 0,
-                           const char* p_pcProtocol = 0);
-            ~stcMDNSService(void);
-
-            bool setName(const char* p_pcName);
-            bool releaseName(void);
-
-            bool setService(const char* p_pcService);
-            bool releaseService(void);
-
-            bool setProtocol(const char* p_pcProtocol);
-            bool releaseProtocol(void);
-        };
+    struct stcMDNSService
+    {
+        stcMDNSService*                 m_pNext;
+        char*                           m_pcName;
+        bool                            m_bAutoName;    // Name was set automatically to hostname (if no name was supplied)
+        char*                           m_pcService;
+        char*                           m_pcProtocol;
+        uint16_t                        m_u16Port;
+        uint8_t                         m_u8ReplyMask;
+        stcMDNSServiceTxts              m_Txts;
+        MDNSDynamicServiceTxtCallbackFunc m_fnTxtCallback;
+        stcProbeInformation             m_ProbeInformation;
+
+        stcMDNSService(const char* p_pcName = 0,
+                       const char* p_pcService = 0,
+                       const char* p_pcProtocol = 0);
+        ~stcMDNSService(void);
+
+        bool setName(const char* p_pcName);
+        bool releaseName(void);
+
+        bool setService(const char* p_pcService);
+        bool releaseService(void);
+
+        bool setProtocol(const char* p_pcProtocol);
+        bool releaseProtocol(void);
+    };
 
-        /**
+    /**
         stcMDNSServiceQuery
     */
-        struct stcMDNSServiceQuery
-        {
-            /**
+    struct stcMDNSServiceQuery
+    {
+        /**
             stcAnswer
         */
-            struct stcAnswer
-            {
-                /**
+        struct stcAnswer
+        {
+            /**
                 stcTTL
             */
-                struct stcTTL
-                {
-                    /**
+            struct stcTTL
+            {
+                /**
                     timeoutLevel_t
                 */
-                    typedef uint8_t timeoutLevel_t;
-                    /**
+                typedef uint8_t timeoutLevel_t;
+                /**
                     TIMEOUTLEVELs
                 */
-                    const timeoutLevel_t TIMEOUTLEVEL_UNSET    = 0;
-                    const timeoutLevel_t TIMEOUTLEVEL_BASE     = 80;
-                    const timeoutLevel_t TIMEOUTLEVEL_INTERVAL = 5;
-                    const timeoutLevel_t TIMEOUTLEVEL_FINAL    = 100;
+                const timeoutLevel_t    TIMEOUTLEVEL_UNSET      = 0;
+                const timeoutLevel_t    TIMEOUTLEVEL_BASE       = 80;
+                const timeoutLevel_t    TIMEOUTLEVEL_INTERVAL   = 5;
+                const timeoutLevel_t    TIMEOUTLEVEL_FINAL      = 100;
 
-                    uint32_t                          m_u32TTL;
-                    esp8266::polledTimeout::oneShotMs m_TTLTimeout;
-                    timeoutLevel_t                    m_timeoutLevel;
+                uint32_t                          m_u32TTL;
+                esp8266::polledTimeout::oneShotMs m_TTLTimeout;
+                timeoutLevel_t                    m_timeoutLevel;
 
-                    using timeoutBase = decltype(m_TTLTimeout);
+                using timeoutBase = decltype(m_TTLTimeout);
 
-                    stcTTL(void);
-                    bool set(uint32_t p_u32TTL);
+                stcTTL(void);
+                bool set(uint32_t p_u32TTL);
 
-                    bool flagged(void);
-                    bool restart(void);
+                bool flagged(void);
+                bool restart(void);
 
-                    bool prepareDeletion(void);
-                    bool finalTimeoutLevel(void) const;
+                bool prepareDeletion(void);
+                bool finalTimeoutLevel(void) const;
 
-                    timeoutBase::timeType timeout(void) const;
-                };
+                timeoutBase::timeType timeout(void) const;
+            };
 #ifdef MDNS_IP4_SUPPORT
-                /**
+            /**
                 stcIP4Address
             */
-                struct stcIP4Address
-                {
-                    stcIP4Address* m_pNext;
-                    IPAddress      m_IPAddress;
-                    stcTTL         m_TTL;
+            struct stcIP4Address
+            {
+                stcIP4Address*  m_pNext;
+                IPAddress       m_IPAddress;
+                stcTTL          m_TTL;
 
-                    stcIP4Address(IPAddress p_IPAddress,
-                                  uint32_t  p_u32TTL = 0);
-                };
+                stcIP4Address(IPAddress p_IPAddress,
+                              uint32_t p_u32TTL = 0);
+            };
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                /**
+            /**
                 stcIP6Address
             */
-                struct stcIP6Address
-                {
-                    stcIP6Address* m_pNext;
-                    IP6Address     m_IPAddress;
-                    stcTTL         m_TTL;
+            struct stcIP6Address
+            {
+                stcIP6Address*  m_pNext;
+                IP6Address      m_IPAddress;
+                stcTTL          m_TTL;
 
-                    stcIP6Address(IPAddress p_IPAddress,
-                                  uint32_t  p_u32TTL = 0);
-                };
+                stcIP6Address(IPAddress p_IPAddress,
+                              uint32_t p_u32TTL = 0);
+            };
 #endif
 
-                stcAnswer* m_pNext;
-                // The service domain is the first 'answer' (from PTR answer, using service and protocol) to be set
-                // Defines the key for additional answer, like host domain, etc.
-                stcMDNS_RRDomain   m_ServiceDomain;  // 1. level answer (PTR), eg. MyESP._http._tcp.local
-                char*              m_pcServiceDomain;
-                stcTTL             m_TTLServiceDomain;
-                stcMDNS_RRDomain   m_HostDomain;  // 2. level answer (SRV, using service domain), eg. esp8266.local
-                char*              m_pcHostDomain;
-                uint16_t           m_u16Port;  // 2. level answer (SRV, using service domain), eg. 5000
-                stcTTL             m_TTLHostDomainAndPort;
-                stcMDNSServiceTxts m_Txts;  // 2. level answer (TXT, using service domain), eg. c#=1
-                char*              m_pcTxts;
-                stcTTL             m_TTLTxts;
+            stcAnswer*          m_pNext;
+            // The service domain is the first 'answer' (from PTR answer, using service and protocol) to be set
+            // Defines the key for additional answer, like host domain, etc.
+            stcMDNS_RRDomain    m_ServiceDomain;    // 1. level answer (PTR), eg. MyESP._http._tcp.local
+            char*               m_pcServiceDomain;
+            stcTTL              m_TTLServiceDomain;
+            stcMDNS_RRDomain    m_HostDomain;       // 2. level answer (SRV, using service domain), eg. esp8266.local
+            char*               m_pcHostDomain;
+            uint16_t            m_u16Port;          // 2. level answer (SRV, using service domain), eg. 5000
+            stcTTL              m_TTLHostDomainAndPort;
+            stcMDNSServiceTxts  m_Txts;             // 2. level answer (TXT, using service domain), eg. c#=1
+            char*               m_pcTxts;
+            stcTTL              m_TTLTxts;
 #ifdef MDNS_IP4_SUPPORT
-                stcIP4Address* m_pIP4Addresses;  // 3. level answer (A, using host domain), eg. 123.456.789.012
+            stcIP4Address*      m_pIP4Addresses;    // 3. level answer (A, using host domain), eg. 123.456.789.012
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                stcIP6Address* m_pIP6Addresses;  // 3. level answer (AAAA, using host domain), eg. 1234::09
+            stcIP6Address*      m_pIP6Addresses;    // 3. level answer (AAAA, using host domain), eg. 1234::09
 #endif
-                uint32_t m_u32ContentFlags;
+            uint32_t            m_u32ContentFlags;
 
-                stcAnswer(void);
-                ~stcAnswer(void);
+            stcAnswer(void);
+            ~stcAnswer(void);
 
-                bool clear(void);
+            bool clear(void);
 
-                char* allocServiceDomain(size_t p_stLength);
-                bool  releaseServiceDomain(void);
+            char* allocServiceDomain(size_t p_stLength);
+            bool releaseServiceDomain(void);
 
-                char* allocHostDomain(size_t p_stLength);
-                bool  releaseHostDomain(void);
+            char* allocHostDomain(size_t p_stLength);
+            bool releaseHostDomain(void);
 
-                char* allocTxts(size_t p_stLength);
-                bool  releaseTxts(void);
+            char* allocTxts(size_t p_stLength);
+            bool releaseTxts(void);
 
 #ifdef MDNS_IP4_SUPPORT
-                bool                 releaseIP4Addresses(void);
-                bool                 addIP4Address(stcIP4Address* p_pIP4Address);
-                bool                 removeIP4Address(stcIP4Address* p_pIP4Address);
-                const stcIP4Address* findIP4Address(const IPAddress& p_IPAddress) const;
-                stcIP4Address*       findIP4Address(const IPAddress& p_IPAddress);
-                uint32_t             IP4AddressCount(void) const;
-                const stcIP4Address* IP4AddressAtIndex(uint32_t p_u32Index) const;
-                stcIP4Address*       IP4AddressAtIndex(uint32_t p_u32Index);
+            bool releaseIP4Addresses(void);
+            bool addIP4Address(stcIP4Address* p_pIP4Address);
+            bool removeIP4Address(stcIP4Address* p_pIP4Address);
+            const stcIP4Address* findIP4Address(const IPAddress& p_IPAddress) const;
+            stcIP4Address* findIP4Address(const IPAddress& p_IPAddress);
+            uint32_t IP4AddressCount(void) const;
+            const stcIP4Address* IP4AddressAtIndex(uint32_t p_u32Index) const;
+            stcIP4Address* IP4AddressAtIndex(uint32_t p_u32Index);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                bool                 releaseIP6Addresses(void);
-                bool                 addIP6Address(stcIP6Address* p_pIP6Address);
-                bool                 removeIP6Address(stcIP6Address* p_pIP6Address);
-                const stcIP6Address* findIP6Address(const IPAddress& p_IPAddress) const;
-                stcIP6Address*       findIP6Address(const IPAddress& p_IPAddress);
-                uint32_t             IP6AddressCount(void) const;
-                const stcIP6Address* IP6AddressAtIndex(uint32_t p_u32Index) const;
-                stcIP6Address*       IP6AddressAtIndex(uint32_t p_u32Index);
+            bool releaseIP6Addresses(void);
+            bool addIP6Address(stcIP6Address* p_pIP6Address);
+            bool removeIP6Address(stcIP6Address* p_pIP6Address);
+            const stcIP6Address* findIP6Address(const IPAddress& p_IPAddress) const;
+            stcIP6Address* findIP6Address(const IPAddress& p_IPAddress);
+            uint32_t IP6AddressCount(void) const;
+            const stcIP6Address* IP6AddressAtIndex(uint32_t p_u32Index) const;
+            stcIP6Address* IP6AddressAtIndex(uint32_t p_u32Index);
 #endif
-            };
+        };
 
-            stcMDNSServiceQuery*              m_pNext;
-            stcMDNS_RRDomain                  m_ServiceTypeDomain;  // eg. _http._tcp.local
-            MDNSServiceQueryCallbackFunc      m_fnCallback;
-            bool                              m_bLegacyQuery;
-            uint8_t                           m_u8SentCount;
-            esp8266::polledTimeout::oneShotMs m_ResendTimeout;
-            bool                              m_bAwaitingAnswers;
-            stcAnswer*                        m_pAnswers;
+        stcMDNSServiceQuery*              m_pNext;
+        stcMDNS_RRDomain                  m_ServiceTypeDomain;    // eg. _http._tcp.local
+        MDNSServiceQueryCallbackFunc      m_fnCallback;
+        bool                              m_bLegacyQuery;
+        uint8_t                           m_u8SentCount;
+        esp8266::polledTimeout::oneShotMs m_ResendTimeout;
+        bool                              m_bAwaitingAnswers;
+        stcAnswer*                        m_pAnswers;
 
-            stcMDNSServiceQuery(void);
-            ~stcMDNSServiceQuery(void);
+        stcMDNSServiceQuery(void);
+        ~stcMDNSServiceQuery(void);
 
-            bool clear(void);
+        bool clear(void);
 
-            uint32_t         answerCount(void) const;
-            const stcAnswer* answerAtIndex(uint32_t p_u32Index) const;
-            stcAnswer*       answerAtIndex(uint32_t p_u32Index);
-            uint32_t         indexOfAnswer(const stcAnswer* p_pAnswer) const;
+        uint32_t answerCount(void) const;
+        const stcAnswer* answerAtIndex(uint32_t p_u32Index) const;
+        stcAnswer* answerAtIndex(uint32_t p_u32Index);
+        uint32_t indexOfAnswer(const stcAnswer* p_pAnswer) const;
 
-            bool addAnswer(stcAnswer* p_pAnswer);
-            bool removeAnswer(stcAnswer* p_pAnswer);
+        bool addAnswer(stcAnswer* p_pAnswer);
+        bool removeAnswer(stcAnswer* p_pAnswer);
 
-            stcAnswer* findAnswerForServiceDomain(const stcMDNS_RRDomain& p_ServiceDomain);
-            stcAnswer* findAnswerForHostDomain(const stcMDNS_RRDomain& p_HostDomain);
-        };
+        stcAnswer* findAnswerForServiceDomain(const stcMDNS_RRDomain& p_ServiceDomain);
+        stcAnswer* findAnswerForHostDomain(const stcMDNS_RRDomain& p_HostDomain);
+    };
 
-        /**
+    /**
         stcMDNSSendParameter
     */
-        struct stcMDNSSendParameter
-        {
-        protected:
-            /**
+    struct stcMDNSSendParameter
+    {
+    protected:
+        /**
             stcDomainCacheItem
         */
-            struct stcDomainCacheItem
-            {
-                stcDomainCacheItem* m_pNext;
-                const void*         m_pHostnameOrService;  // Opaque id for host or service domain (pointer)
-                bool                m_bAdditionalData;     // Opaque flag for special info (service domain included)
-                uint16_t            m_u16Offset;           // Offset in UDP output buffer
-
-                stcDomainCacheItem(const void* p_pHostnameOrService,
-                                   bool        p_bAdditionalData,
-                                   uint32_t    p_u16Offset);
-            };
-
-        public:
-            uint16_t            m_u16ID;              // Query ID (used only in lagacy queries)
-            stcMDNS_RRQuestion* m_pQuestions;         // A list of queries
-            uint8_t             m_u8HostReplyMask;    // Flags for reply components/answers
-            bool                m_bLegacyQuery;       // Flag: Legacy query
-            bool                m_bResponse;          // Flag: Response to a query
-            bool                m_bAuthorative;       // Flag: Authoritative (owner) response
-            bool                m_bCacheFlush;        // Flag: Clients should flush their caches
-            bool                m_bUnicast;           // Flag: Unicast response
-            bool                m_bUnannounce;        // Flag: Unannounce service
-            uint16_t            m_u16Offset;          // Current offset in UDP write buffer (mainly for domain cache)
-            stcDomainCacheItem* m_pDomainCacheItems;  // Cached host and service domains
-
-            stcMDNSSendParameter(void);
-            ~stcMDNSSendParameter(void);
-
-            bool clear(void);
-            bool clearCachedNames(void);
-
-            bool shiftOffset(uint16_t p_u16Shift);
-
-            bool     addDomainCacheItem(const void* p_pHostnameOrService,
-                                        bool        p_bAdditionalData,
-                                        uint16_t    p_u16Offset);
-            uint16_t findCachedDomainOffset(const void* p_pHostnameOrService,
-                                            bool        p_bAdditionalData) const;
+        struct stcDomainCacheItem
+        {
+            stcDomainCacheItem*     m_pNext;
+            const void*             m_pHostnameOrService;   // Opaque id for host or service domain (pointer)
+            bool                    m_bAdditionalData;      // Opaque flag for special info (service domain included)
+            uint16_t                m_u16Offset;            // Offset in UDP output buffer
+
+            stcDomainCacheItem(const void* p_pHostnameOrService,
+                               bool p_bAdditionalData,
+                               uint32_t p_u16Offset);
         };
 
-        // Instance variables
-        stcMDNSService*                   m_pServices;
-        UdpContext*                       m_pUDPContext;
-        char*                             m_pcHostname;
-        stcMDNSServiceQuery*              m_pServiceQueries;
-        MDNSDynamicServiceTxtCallbackFunc m_fnServiceTxtCallback;
-        stcProbeInformation               m_HostProbeInformation;
-
-        /** CONTROL **/
-        /* MAINTENANCE */
-        bool _process(bool p_bUserContext);
-        bool _restart(void);
-
-        /* RECEIVING */
-        bool _parseMessage(void);
-        bool _parseQuery(const stcMDNS_MsgHeader& p_Header);
-
-        bool _parseResponse(const stcMDNS_MsgHeader& p_Header);
-        bool _processAnswers(const stcMDNS_RRAnswer* p_pPTRAnswers);
-        bool _processPTRAnswer(const stcMDNS_RRAnswerPTR* p_pPTRAnswer,
-                               bool&                      p_rbFoundNewKeyAnswer);
-        bool _processSRVAnswer(const stcMDNS_RRAnswerSRV* p_pSRVAnswer,
-                               bool&                      p_rbFoundNewKeyAnswer);
-        bool _processTXTAnswer(const stcMDNS_RRAnswerTXT* p_pTXTAnswer);
+    public:
+        uint16_t                m_u16ID;                    // Query ID (used only in lagacy queries)
+        stcMDNS_RRQuestion*     m_pQuestions;               // A list of queries
+        uint8_t                 m_u8HostReplyMask;          // Flags for reply components/answers
+        bool                    m_bLegacyQuery;             // Flag: Legacy query
+        bool                    m_bResponse;                // Flag: Response to a query
+        bool                    m_bAuthorative;             // Flag: Authoritative (owner) response
+        bool                    m_bCacheFlush;              // Flag: Clients should flush their caches
+        bool                    m_bUnicast;                 // Flag: Unicast response
+        bool                    m_bUnannounce;              // Flag: Unannounce service
+        uint16_t                m_u16Offset;                // Current offset in UDP write buffer (mainly for domain cache)
+        stcDomainCacheItem*     m_pDomainCacheItems;        // Cached host and service domains
+
+        stcMDNSSendParameter(void);
+        ~stcMDNSSendParameter(void);
+
+        bool clear(void);
+        bool clearCachedNames(void);
+
+        bool shiftOffset(uint16_t p_u16Shift);
+
+        bool addDomainCacheItem(const void* p_pHostnameOrService,
+                                bool p_bAdditionalData,
+                                uint16_t p_u16Offset);
+        uint16_t findCachedDomainOffset(const void* p_pHostnameOrService,
+                                        bool p_bAdditionalData) const;
+    };
+
+    // Instance variables
+    stcMDNSService*                 m_pServices;
+    UdpContext*                     m_pUDPContext;
+    char*                           m_pcHostname;
+    stcMDNSServiceQuery*            m_pServiceQueries;
+    MDNSDynamicServiceTxtCallbackFunc m_fnServiceTxtCallback;
+    stcProbeInformation             m_HostProbeInformation;
+
+    /** CONTROL **/
+    /* MAINTENANCE */
+    bool _process(bool p_bUserContext);
+    bool _restart(void);
+
+    /* RECEIVING */
+    bool _parseMessage(void);
+    bool _parseQuery(const stcMDNS_MsgHeader& p_Header);
+
+    bool _parseResponse(const stcMDNS_MsgHeader& p_Header);
+    bool _processAnswers(const stcMDNS_RRAnswer* p_pPTRAnswers);
+    bool _processPTRAnswer(const stcMDNS_RRAnswerPTR* p_pPTRAnswer,
+                           bool& p_rbFoundNewKeyAnswer);
+    bool _processSRVAnswer(const stcMDNS_RRAnswerSRV* p_pSRVAnswer,
+                           bool& p_rbFoundNewKeyAnswer);
+    bool _processTXTAnswer(const stcMDNS_RRAnswerTXT* p_pTXTAnswer);
 #ifdef MDNS_IP4_SUPPORT
-        bool _processAAnswer(const stcMDNS_RRAnswerA* p_pAAnswer);
+    bool _processAAnswer(const stcMDNS_RRAnswerA* p_pAAnswer);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        bool _processAAAAAnswer(const stcMDNS_RRAnswerAAAA* p_pAAAAAnswer);
+    bool _processAAAAAnswer(const stcMDNS_RRAnswerAAAA* p_pAAAAAnswer);
 #endif
 
-        /* PROBING */
-        bool _updateProbeStatus(void);
-        bool _resetProbeStatus(bool p_bRestart = true);
-        bool _hasProbesWaitingForAnswers(void) const;
-        bool _sendHostProbe(void);
-        bool _sendServiceProbe(stcMDNSService& p_rService);
-        bool _cancelProbingForHost(void);
-        bool _cancelProbingForService(stcMDNSService& p_rService);
-
-        /* ANNOUNCE */
-        bool _announce(bool p_bAnnounce,
-                       bool p_bIncludeServices);
-        bool _announceService(stcMDNSService& p_rService,
-                              bool            p_bAnnounce = true);
-
-        /* SERVICE QUERY CACHE */
-        bool _hasServiceQueriesWaitingForAnswers(void) const;
-        bool _checkServiceQueryCache(void);
-
-        /** TRANSFER **/
-        /* SENDING */
-        bool _sendMDNSMessage(stcMDNSSendParameter& p_SendParameter);
-        bool _sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter);
-        bool _prepareMDNSMessage(stcMDNSSendParameter& p_SendParameter,
-                                 IPAddress             p_IPAddress);
-        bool _sendMDNSServiceQuery(const stcMDNSServiceQuery& p_ServiceQuery);
-        bool _sendMDNSQuery(const stcMDNS_RRDomain&         p_QueryDomain,
-                            uint16_t                        p_u16QueryType,
-                            stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers = 0);
-
-        uint8_t _replyMaskForHost(const stcMDNS_RRHeader& p_RRHeader,
-                                  bool*                   p_pbFullNameMatch = 0) const;
-        uint8_t _replyMaskForService(const stcMDNS_RRHeader& p_RRHeader,
-                                     const stcMDNSService&   p_Service,
-                                     bool*                   p_pbFullNameMatch = 0) const;
-
-        /* RESOURCE RECORD */
-        bool _readRRQuestion(stcMDNS_RRQuestion& p_rQuestion);
-        bool _readRRAnswer(stcMDNS_RRAnswer*& p_rpAnswer);
+    /* PROBING */
+    bool _updateProbeStatus(void);
+    bool _resetProbeStatus(bool p_bRestart = true);
+    bool _hasProbesWaitingForAnswers(void) const;
+    bool _sendHostProbe(void);
+    bool _sendServiceProbe(stcMDNSService& p_rService);
+    bool _cancelProbingForHost(void);
+    bool _cancelProbingForService(stcMDNSService& p_rService);
+
+    /* ANNOUNCE */
+    bool _announce(bool p_bAnnounce,
+                   bool p_bIncludeServices);
+    bool _announceService(stcMDNSService& p_rService,
+                          bool p_bAnnounce = true);
+
+    /* SERVICE QUERY CACHE */
+    bool _hasServiceQueriesWaitingForAnswers(void) const;
+    bool _checkServiceQueryCache(void);
+
+    /** TRANSFER **/
+    /* SENDING */
+    bool _sendMDNSMessage(stcMDNSSendParameter& p_SendParameter);
+    bool _sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter);
+    bool _prepareMDNSMessage(stcMDNSSendParameter& p_SendParameter,
+                             IPAddress p_IPAddress);
+    bool _sendMDNSServiceQuery(const stcMDNSServiceQuery& p_ServiceQuery);
+    bool _sendMDNSQuery(const stcMDNS_RRDomain& p_QueryDomain,
+                        uint16_t p_u16QueryType,
+                        stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers = 0);
+
+    uint8_t _replyMaskForHost(const stcMDNS_RRHeader& p_RRHeader,
+                              bool* p_pbFullNameMatch = 0) const;
+    uint8_t _replyMaskForService(const stcMDNS_RRHeader& p_RRHeader,
+                                 const stcMDNSService& p_Service,
+                                 bool* p_pbFullNameMatch = 0) const;
+
+    /* RESOURCE RECORD */
+    bool _readRRQuestion(stcMDNS_RRQuestion& p_rQuestion);
+    bool _readRRAnswer(stcMDNS_RRAnswer*& p_rpAnswer);
 #ifdef MDNS_IP4_SUPPORT
-        bool _readRRAnswerA(stcMDNS_RRAnswerA& p_rRRAnswerA,
-                            uint16_t           p_u16RDLength);
+    bool _readRRAnswerA(stcMDNS_RRAnswerA& p_rRRAnswerA,
+                        uint16_t p_u16RDLength);
 #endif
-        bool _readRRAnswerPTR(stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
-                              uint16_t             p_u16RDLength);
-        bool _readRRAnswerTXT(stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
-                              uint16_t             p_u16RDLength);
+    bool _readRRAnswerPTR(stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
+                          uint16_t p_u16RDLength);
+    bool _readRRAnswerTXT(stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
+                          uint16_t p_u16RDLength);
 #ifdef MDNS_IP6_SUPPORT
-        bool _readRRAnswerAAAA(stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
-                               uint16_t              p_u16RDLength);
+    bool _readRRAnswerAAAA(stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
+                           uint16_t p_u16RDLength);
 #endif
-        bool _readRRAnswerSRV(stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
-                              uint16_t             p_u16RDLength);
-        bool _readRRAnswerGeneric(stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
-                                  uint16_t                 p_u16RDLength);
-
-        bool _readRRHeader(stcMDNS_RRHeader& p_rHeader);
-        bool _readRRDomain(stcMDNS_RRDomain& p_rRRDomain);
-        bool _readRRDomain_Loop(stcMDNS_RRDomain& p_rRRDomain,
-                                uint8_t           p_u8Depth);
-        bool _readRRAttributes(stcMDNS_RRAttributes& p_rAttributes);
-
-        /* DOMAIN NAMES */
-        bool _buildDomainForHost(const char*       p_pcHostname,
-                                 stcMDNS_RRDomain& p_rHostDomain) const;
-        bool _buildDomainForDNSSD(stcMDNS_RRDomain& p_rDNSSDDomain) const;
-        bool _buildDomainForService(const stcMDNSService& p_Service,
-                                    bool                  p_bIncludeName,
-                                    stcMDNS_RRDomain&     p_rServiceDomain) const;
-        bool _buildDomainForService(const char*       p_pcService,
-                                    const char*       p_pcProtocol,
-                                    stcMDNS_RRDomain& p_rServiceDomain) const;
+    bool _readRRAnswerSRV(stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
+                          uint16_t p_u16RDLength);
+    bool _readRRAnswerGeneric(stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
+                              uint16_t p_u16RDLength);
+
+    bool _readRRHeader(stcMDNS_RRHeader& p_rHeader);
+    bool _readRRDomain(stcMDNS_RRDomain& p_rRRDomain);
+    bool _readRRDomain_Loop(stcMDNS_RRDomain& p_rRRDomain,
+                            uint8_t p_u8Depth);
+    bool _readRRAttributes(stcMDNS_RRAttributes& p_rAttributes);
+
+    /* DOMAIN NAMES */
+    bool _buildDomainForHost(const char* p_pcHostname,
+                             stcMDNS_RRDomain& p_rHostDomain) const;
+    bool _buildDomainForDNSSD(stcMDNS_RRDomain& p_rDNSSDDomain) const;
+    bool _buildDomainForService(const stcMDNSService& p_Service,
+                                bool p_bIncludeName,
+                                stcMDNS_RRDomain& p_rServiceDomain) const;
+    bool _buildDomainForService(const char* p_pcService,
+                                const char* p_pcProtocol,
+                                stcMDNS_RRDomain& p_rServiceDomain) const;
 #ifdef MDNS_IP4_SUPPORT
-        bool _buildDomainForReverseIP4(IPAddress         p_IP4Address,
-                                       stcMDNS_RRDomain& p_rReverseIP4Domain) const;
+    bool _buildDomainForReverseIP4(IPAddress p_IP4Address,
+                                   stcMDNS_RRDomain& p_rReverseIP4Domain) const;
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        bool _buildDomainForReverseIP6(IPAddress         p_IP4Address,
-                                       stcMDNS_RRDomain& p_rReverseIP6Domain) const;
+    bool _buildDomainForReverseIP6(IPAddress p_IP4Address,
+                                   stcMDNS_RRDomain& p_rReverseIP6Domain) const;
 #endif
 
-        /* UDP */
-        bool _udpReadBuffer(unsigned char* p_pBuffer,
-                            size_t         p_stLength);
-        bool _udpRead8(uint8_t& p_ru8Value);
-        bool _udpRead16(uint16_t& p_ru16Value);
-        bool _udpRead32(uint32_t& p_ru32Value);
+    /* UDP */
+    bool _udpReadBuffer(unsigned char* p_pBuffer,
+                        size_t p_stLength);
+    bool _udpRead8(uint8_t& p_ru8Value);
+    bool _udpRead16(uint16_t& p_ru16Value);
+    bool _udpRead32(uint32_t& p_ru32Value);
 
-        bool _udpAppendBuffer(const unsigned char* p_pcBuffer,
-                              size_t               p_stLength);
-        bool _udpAppend8(uint8_t p_u8Value);
-        bool _udpAppend16(uint16_t p_u16Value);
-        bool _udpAppend32(uint32_t p_u32Value);
+    bool _udpAppendBuffer(const unsigned char* p_pcBuffer,
+                          size_t p_stLength);
+    bool _udpAppend8(uint8_t p_u8Value);
+    bool _udpAppend16(uint16_t p_u16Value);
+    bool _udpAppend32(uint32_t p_u32Value);
 
 #if not defined ESP_8266_MDNS_INCLUDE || defined DEBUG_ESP_MDNS_RESPONDER
-        bool _udpDump(bool p_bMovePointer = false);
-        bool _udpDump(unsigned p_uOffset,
-                      unsigned p_uLength);
+    bool _udpDump(bool p_bMovePointer = false);
+    bool _udpDump(unsigned p_uOffset,
+                  unsigned p_uLength);
 #endif
 
-        /* READ/WRITE MDNS STRUCTS */
-        bool _readMDNSMsgHeader(stcMDNS_MsgHeader& p_rMsgHeader);
-
-        bool _write8(uint8_t               p_u8Value,
-                     stcMDNSSendParameter& p_rSendParameter);
-        bool _write16(uint16_t              p_u16Value,
-                      stcMDNSSendParameter& p_rSendParameter);
-        bool _write32(uint32_t              p_u32Value,
-                      stcMDNSSendParameter& p_rSendParameter);
-
-        bool _writeMDNSMsgHeader(const stcMDNS_MsgHeader& p_MsgHeader,
-                                 stcMDNSSendParameter&    p_rSendParameter);
-        bool _writeMDNSRRAttributes(const stcMDNS_RRAttributes& p_Attributes,
-                                    stcMDNSSendParameter&       p_rSendParameter);
-        bool _writeMDNSRRDomain(const stcMDNS_RRDomain& p_Domain,
-                                stcMDNSSendParameter&   p_rSendParameter);
-        bool _writeMDNSHostDomain(const char*           m_pcHostname,
-                                  bool                  p_bPrependRDLength,
-                                  stcMDNSSendParameter& p_rSendParameter);
-        bool _writeMDNSServiceDomain(const stcMDNSService& p_Service,
-                                     bool                  p_bIncludeName,
-                                     bool                  p_bPrependRDLength,
-                                     stcMDNSSendParameter& p_rSendParameter);
+    /* READ/WRITE MDNS STRUCTS */
+    bool _readMDNSMsgHeader(stcMDNS_MsgHeader& p_rMsgHeader);
+
+    bool _write8(uint8_t p_u8Value,
+                 stcMDNSSendParameter& p_rSendParameter);
+    bool _write16(uint16_t p_u16Value,
+                  stcMDNSSendParameter& p_rSendParameter);
+    bool _write32(uint32_t p_u32Value,
+                  stcMDNSSendParameter& p_rSendParameter);
 
-        bool _writeMDNSQuestion(stcMDNS_RRQuestion&   p_Question,
+    bool _writeMDNSMsgHeader(const stcMDNS_MsgHeader& p_MsgHeader,
+                             stcMDNSSendParameter& p_rSendParameter);
+    bool _writeMDNSRRAttributes(const stcMDNS_RRAttributes& p_Attributes,
                                 stcMDNSSendParameter& p_rSendParameter);
+    bool _writeMDNSRRDomain(const stcMDNS_RRDomain& p_Domain,
+                            stcMDNSSendParameter& p_rSendParameter);
+    bool _writeMDNSHostDomain(const char* m_pcHostname,
+                              bool p_bPrependRDLength,
+                              stcMDNSSendParameter& p_rSendParameter);
+    bool _writeMDNSServiceDomain(const stcMDNSService& p_Service,
+                                 bool p_bIncludeName,
+                                 bool p_bPrependRDLength,
+                                 stcMDNSSendParameter& p_rSendParameter);
+
+    bool _writeMDNSQuestion(stcMDNS_RRQuestion& p_Question,
+                            stcMDNSSendParameter& p_rSendParameter);
 
 #ifdef MDNS_IP4_SUPPORT
-        bool _writeMDNSAnswer_A(IPAddress             p_IPAddress,
-                                stcMDNSSendParameter& p_rSendParameter);
-        bool _writeMDNSAnswer_PTR_IP4(IPAddress             p_IPAddress,
-                                      stcMDNSSendParameter& p_rSendParameter);
-#endif
-        bool _writeMDNSAnswer_PTR_TYPE(stcMDNSService&       p_rService,
-                                       stcMDNSSendParameter& p_rSendParameter);
-        bool _writeMDNSAnswer_PTR_NAME(stcMDNSService&       p_rService,
-                                       stcMDNSSendParameter& p_rSendParameter);
-        bool _writeMDNSAnswer_TXT(stcMDNSService&       p_rService,
+    bool _writeMDNSAnswer_A(IPAddress p_IPAddress,
+                            stcMDNSSendParameter& p_rSendParameter);
+    bool _writeMDNSAnswer_PTR_IP4(IPAddress p_IPAddress,
                                   stcMDNSSendParameter& p_rSendParameter);
-#ifdef MDNS_IP6_SUPPORT
-        bool _writeMDNSAnswer_AAAA(IPAddress             p_IPAddress,
-                                   stcMDNSSendParameter& p_rSendParameter);
-        bool _writeMDNSAnswer_PTR_IP6(IPAddress             p_IPAddress,
-                                      stcMDNSSendParameter& p_rSendParameter);
 #endif
-        bool _writeMDNSAnswer_SRV(stcMDNSService&       p_rService,
+    bool _writeMDNSAnswer_PTR_TYPE(stcMDNSService& p_rService,
+                                   stcMDNSSendParameter& p_rSendParameter);
+    bool _writeMDNSAnswer_PTR_NAME(stcMDNSService& p_rService,
+                                   stcMDNSSendParameter& p_rSendParameter);
+    bool _writeMDNSAnswer_TXT(stcMDNSService& p_rService,
+                              stcMDNSSendParameter& p_rSendParameter);
+#ifdef MDNS_IP6_SUPPORT
+    bool _writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
+                               stcMDNSSendParameter& p_rSendParameter);
+    bool _writeMDNSAnswer_PTR_IP6(IPAddress p_IPAddress,
                                   stcMDNSSendParameter& p_rSendParameter);
-
-        /** HELPERS **/
-        /* UDP CONTEXT */
-        bool _callProcess(void);
-        bool _allocUDPContext(void);
-        bool _releaseUDPContext(void);
-
-        /* SERVICE QUERY */
-        stcMDNSServiceQuery* _allocServiceQuery(void);
-        bool                 _removeServiceQuery(stcMDNSServiceQuery* p_pServiceQuery);
-        bool                 _removeLegacyServiceQuery(void);
-        stcMDNSServiceQuery* _findServiceQuery(hMDNSServiceQuery p_hServiceQuery);
-        stcMDNSServiceQuery* _findLegacyServiceQuery(void);
-        bool                 _releaseServiceQueries(void);
-        stcMDNSServiceQuery* _findNextServiceQueryByServiceType(const stcMDNS_RRDomain&    p_ServiceDomain,
-                                                                const stcMDNSServiceQuery* p_pPrevServiceQuery);
-
-        /* HOSTNAME */
-        bool _setHostname(const char* p_pcHostname);
-        bool _releaseHostname(void);
-
-        /* SERVICE */
-        stcMDNSService* _allocService(const char* p_pcName,
-                                      const char* p_pcService,
-                                      const char* p_pcProtocol,
-                                      uint16_t    p_u16Port);
-        bool            _releaseService(stcMDNSService* p_pService);
-        bool            _releaseServices(void);
-
-        stcMDNSService* _findService(const char* p_pcName,
-                                     const char* p_pcService,
-                                     const char* p_pcProtocol);
-        stcMDNSService* _findService(const hMDNSService p_hService);
-
-        size_t _countServices(void) const;
-
-        /* SERVICE TXT */
-        stcMDNSServiceTxt* _allocServiceTxt(stcMDNSService* p_pService,
-                                            const char*     p_pcKey,
-                                            const char*     p_pcValue,
-                                            bool            p_bTemp);
-        bool               _releaseServiceTxt(stcMDNSService*    p_pService,
-                                              stcMDNSServiceTxt* p_pTxt);
-        stcMDNSServiceTxt* _updateServiceTxt(stcMDNSService*    p_pService,
-                                             stcMDNSServiceTxt* p_pTxt,
-                                             const char*        p_pcValue,
-                                             bool               p_bTemp);
-
-        stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
-                                           const char*     p_pcKey);
-        stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
-                                           const hMDNSTxt  p_hTxt);
-
-        stcMDNSServiceTxt* _addServiceTxt(stcMDNSService* p_pService,
-                                          const char*     p_pcKey,
-                                          const char*     p_pcValue,
-                                          bool            p_bTemp);
-
-        stcMDNSServiceTxt* _answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
-                                           const uint32_t          p_u32AnswerIndex);
-
-        bool                     _collectServiceTxts(stcMDNSService& p_rService);
-        bool                     _releaseTempServiceTxts(stcMDNSService& p_rService);
-        const stcMDNSServiceTxt* _serviceTxts(const char* p_pcName,
-                                              const char* p_pcService,
-                                              const char* p_pcProtocol);
-
-        /* MISC */
+#endif
+    bool _writeMDNSAnswer_SRV(stcMDNSService& p_rService,
+                              stcMDNSSendParameter& p_rSendParameter);
+
+    /** HELPERS **/
+    /* UDP CONTEXT */
+    bool _callProcess(void);
+    bool _allocUDPContext(void);
+    bool _releaseUDPContext(void);
+
+    /* SERVICE QUERY */
+    stcMDNSServiceQuery* _allocServiceQuery(void);
+    bool _removeServiceQuery(stcMDNSServiceQuery* p_pServiceQuery);
+    bool _removeLegacyServiceQuery(void);
+    stcMDNSServiceQuery* _findServiceQuery(hMDNSServiceQuery p_hServiceQuery);
+    stcMDNSServiceQuery* _findLegacyServiceQuery(void);
+    bool _releaseServiceQueries(void);
+    stcMDNSServiceQuery* _findNextServiceQueryByServiceType(const stcMDNS_RRDomain& p_ServiceDomain,
+            const stcMDNSServiceQuery* p_pPrevServiceQuery);
+
+    /* HOSTNAME */
+    bool _setHostname(const char* p_pcHostname);
+    bool _releaseHostname(void);
+
+    /* SERVICE */
+    stcMDNSService* _allocService(const char* p_pcName,
+                                  const char* p_pcService,
+                                  const char* p_pcProtocol,
+                                  uint16_t p_u16Port);
+    bool _releaseService(stcMDNSService* p_pService);
+    bool _releaseServices(void);
+
+    stcMDNSService* _findService(const char* p_pcName,
+                                 const char* p_pcService,
+                                 const char* p_pcProtocol);
+    stcMDNSService* _findService(const hMDNSService p_hService);
+
+    size_t _countServices(void) const;
+
+    /* SERVICE TXT */
+    stcMDNSServiceTxt* _allocServiceTxt(stcMDNSService* p_pService,
+                                        const char* p_pcKey,
+                                        const char* p_pcValue,
+                                        bool p_bTemp);
+    bool _releaseServiceTxt(stcMDNSService* p_pService,
+                            stcMDNSServiceTxt* p_pTxt);
+    stcMDNSServiceTxt* _updateServiceTxt(stcMDNSService* p_pService,
+                                         stcMDNSServiceTxt* p_pTxt,
+                                         const char* p_pcValue,
+                                         bool p_bTemp);
+
+    stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
+                                       const char* p_pcKey);
+    stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
+                                       const hMDNSTxt p_hTxt);
+
+    stcMDNSServiceTxt* _addServiceTxt(stcMDNSService* p_pService,
+                                      const char* p_pcKey,
+                                      const char* p_pcValue,
+                                      bool p_bTemp);
+
+    stcMDNSServiceTxt* _answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
+                                       const uint32_t p_u32AnswerIndex);
+
+    bool _collectServiceTxts(stcMDNSService& p_rService);
+    bool _releaseTempServiceTxts(stcMDNSService& p_rService);
+    const stcMDNSServiceTxt* _serviceTxts(const char* p_pcName,
+                                          const char* p_pcService,
+                                          const char* p_pcProtocol);
+
+    /* MISC */
 #if not defined ESP_8266_MDNS_INCLUDE || defined DEBUG_ESP_MDNS_RESPONDER
-        bool _printRRDomain(const stcMDNS_RRDomain& p_rRRDomain) const;
-        bool _printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAnswer) const;
+    bool _printRRDomain(const stcMDNS_RRDomain& p_rRRDomain) const;
+    bool _printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAnswer) const;
 #endif
-    };
+};
 
-}  // namespace MDNSImplementation
+}// namespace MDNSImplementation
 
-}  // namespace esp8266
+}// namespace esp8266
 
-#endif  // MDNS_H
+#endif // MDNS_H
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
index 7abc5a2309..bf1b1cde26 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
@@ -33,8 +33,7 @@
     ESP8266mDNS Control.cpp
 */
 
-extern "C"
-{
+extern "C" {
 #include "user_interface.h"
 }
 
@@ -49,15 +48,17 @@ namespace esp8266
 */
 namespace MDNSImplementation
 {
-    /**
+
+/**
     CONTROL
 */
 
-    /**
+
+/**
     MAINTENANCE
 */
 
-    /*
+/*
     MDNSResponder::_process
 
     Run the MDNS process.
@@ -65,90 +66,96 @@ namespace MDNSImplementation
     should be called in every 'loop' by calling 'MDNS::update()'.
 
 */
-    bool MDNSResponder::_process(bool p_bUserContext)
+bool MDNSResponder::_process(bool p_bUserContext)
+{
+
+    bool    bResult = true;
+
+    if (!p_bUserContext)
     {
-        bool bResult = true;
 
-        if (!p_bUserContext)
-        {
-            if ((m_pUDPContext) &&        // UDPContext available AND
-                (m_pUDPContext->next()))  // has content
-            {
-                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _update: Calling _parseMessage\n")););
-                bResult = _parseMessage();
-                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parsePacket %s\n"), (bResult ? "succeeded" : "FAILED")););
-            }
-        }
-        else
+        if ((m_pUDPContext) &&          // UDPContext available AND
+                (m_pUDPContext->next()))    // has content
         {
-            bResult = _updateProbeStatus() &&  // Probing
-                _checkServiceQueryCache();     // Service query cache check
+
+            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _update: Calling _parseMessage\n")););
+            bResult = _parseMessage();
+            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parsePacket %s\n"), (bResult ? "succeeded" : "FAILED")););
         }
-        return bResult;
     }
+    else
+    {
+        bResult =  _updateProbeStatus() &&              // Probing
+                   _checkServiceQueryCache();           // Service query cache check
+    }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_restart
 */
-    bool MDNSResponder::_restart(void)
-    {
-        return ((_resetProbeStatus(true /*restart*/)) &&  // Stop and restart probing
-                (_allocUDPContext()));                    // Restart UDP
-    }
+bool MDNSResponder::_restart(void)
+{
 
-    /**
+    return ((_resetProbeStatus(true/*restart*/)) &&  // Stop and restart probing
+            (_allocUDPContext()));                   // Restart UDP
+}
+
+/**
     RECEIVING
 */
 
-    /*
+/*
     MDNSResponder::_parseMessage
 */
-    bool MDNSResponder::_parseMessage(void)
+bool MDNSResponder::_parseMessage(void)
+{
+    DEBUG_EX_INFO(
+        unsigned long   ulStartTime = millis();
+        unsigned        uStartMemory = ESP.getFreeHeap();
+        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage (Time: %lu ms, heap: %u bytes, from %s(%u), to %s(%u))\n"), ulStartTime, uStartMemory,
+                              IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), m_pUDPContext->getRemotePort(),
+                              IPAddress(m_pUDPContext->getDestAddress()).toString().c_str(), m_pUDPContext->getLocalPort());
+    );
+    //DEBUG_EX_INFO(_udpDump(););
+
+    bool    bResult = false;
+
+    stcMDNS_MsgHeader   header;
+    if (_readMDNSMsgHeader(header))
     {
-        DEBUG_EX_INFO(
-            unsigned long ulStartTime  = millis();
-            unsigned      uStartMemory = ESP.getFreeHeap();
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage (Time: %lu ms, heap: %u bytes, from %s(%u), to %s(%u))\n"), ulStartTime, uStartMemory,
-                                  IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), m_pUDPContext->getRemotePort(),
-                                  IPAddress(m_pUDPContext->getDestAddress()).toString().c_str(), m_pUDPContext->getLocalPort()););
-        //DEBUG_EX_INFO(_udpDump(););
-
-        bool bResult = false;
-
-        stcMDNS_MsgHeader header;
-        if (_readMDNSMsgHeader(header))
+        if (0 == header.m_4bOpcode)     // A standard query
         {
-            if (0 == header.m_4bOpcode)  // A standard query
+            if (header.m_1bQR)          // Received a response -> answers to a query
             {
-                if (header.m_1bQR)  // Received a response -> answers to a query
-                {
-                    //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading answers: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
-                    bResult = _parseResponse(header);
-                }
-                else  // Received a query (Questions)
-                {
-                    //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading query: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
-                    bResult = _parseQuery(header);
-                }
+                //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading answers: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
+                bResult = _parseResponse(header);
             }
-            else
+            else                        // Received a query (Questions)
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Received UNEXPECTED opcode:%u. Ignoring message!\n"), header.m_4bOpcode););
-                m_pUDPContext->flush();
+                //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading query: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
+                bResult = _parseQuery(header);
             }
         }
         else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: FAILED to read header\n")););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Received UNEXPECTED opcode:%u. Ignoring message!\n"), header.m_4bOpcode););
             m_pUDPContext->flush();
         }
-        DEBUG_EX_INFO(
-            unsigned uFreeHeap = ESP.getFreeHeap();
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Done (%s after %lu ms, ate %i bytes, remaining %u)\n\n"), (bResult ? "Succeeded" : "FAILED"), (millis() - ulStartTime), (uStartMemory - uFreeHeap), uFreeHeap););
-        return bResult;
     }
+    else
+    {
+        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: FAILED to read header\n")););
+        m_pUDPContext->flush();
+    }
+    DEBUG_EX_INFO(
+        unsigned    uFreeHeap = ESP.getFreeHeap();
+        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Done (%s after %lu ms, ate %i bytes, remaining %u)\n\n"), (bResult ? "Succeeded" : "FAILED"), (millis() - ulStartTime), (uStartMemory - uFreeHeap), uFreeHeap);
+    );
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_parseQuery
 
     Queries are of interest in two cases:
@@ -165,393 +172,427 @@ namespace MDNSImplementation
 
     1.
 */
-    bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
+bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
+{
+
+    bool    bResult = true;
+
+    stcMDNSSendParameter    sendParameter;
+    uint8_t                 u8HostOrServiceReplies = 0;
+    for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
     {
-        bool bResult = true;
 
-        stcMDNSSendParameter sendParameter;
-        uint8_t              u8HostOrServiceReplies = 0;
-        for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
+        stcMDNS_RRQuestion  questionRR;
+        if ((bResult = _readRRQuestion(questionRR)))
+        {
+            // Define host replies, BUT only answer queries after probing is done
+            u8HostOrServiceReplies =
+                sendParameter.m_u8HostReplyMask |= (((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus))
+                                                    ? _replyMaskForHost(questionRR.m_Header, 0)
+                                                    : 0);
+            DEBUG_EX_INFO(if (u8HostOrServiceReplies)
         {
-            stcMDNS_RRQuestion questionRR;
-            if ((bResult = _readRRQuestion(questionRR)))
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Host reply needed 0x%X\n"), u8HostOrServiceReplies);
+            });
+
+            // Check tiebreak need for host domain
+            if (ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus)
             {
-                // Define host replies, BUT only answer queries after probing is done
-                u8HostOrServiceReplies = sendParameter.m_u8HostReplyMask |= (((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus))
-                                                                                 ? _replyMaskForHost(questionRR.m_Header, 0)
-                                                                                 : 0);
-                DEBUG_EX_INFO(if (u8HostOrServiceReplies)
-                              {
-                                  DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Host reply needed 0x%X\n"), u8HostOrServiceReplies);
-                              });
-
-                // Check tiebreak need for host domain
-                if (ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus)
+                bool    bFullNameMatch = false;
+                if ((_replyMaskForHost(questionRR.m_Header, &bFullNameMatch)) &&
+                        (bFullNameMatch))
                 {
-                    bool bFullNameMatch = false;
-                    if ((_replyMaskForHost(questionRR.m_Header, &bFullNameMatch)) && (bFullNameMatch))
-                    {
-                        // We're in 'probing' state and someone is asking for our host domain: this might be
-                        // a race-condition: Two host with the same domain names try simutanously to probe their domains
-                        // See: RFC 6762, 8.2 (Tiebraking)
-                        // However, we're using a max. reduced approach for tiebreaking here: The higher IP-address wins!
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for host domain detected while probing.\n")););
+                    // We're in 'probing' state and someone is asking for our host domain: this might be
+                    // a race-condition: Two host with the same domain names try simutanously to probe their domains
+                    // See: RFC 6762, 8.2 (Tiebraking)
+                    // However, we're using a max. reduced approach for tiebreaking here: The higher IP-address wins!
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for host domain detected while probing.\n")););
 
-                        m_HostProbeInformation.m_bTiebreakNeeded = true;
-                    }
+                    m_HostProbeInformation.m_bTiebreakNeeded = true;
                 }
+            }
 
-                // Define service replies
-                for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+            // Define service replies
+            for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+            {
+                // Define service replies, BUT only answer queries after probing is done
+                uint8_t u8ReplyMaskForQuestion = (((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus))
+                                                  ? _replyMaskForService(questionRR.m_Header, *pService, 0)
+                                                  : 0);
+                u8HostOrServiceReplies |= (pService->m_u8ReplyMask |= u8ReplyMaskForQuestion);
+                DEBUG_EX_INFO(if (u8ReplyMaskForQuestion)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service reply needed for (%s.%s.%s): 0x%X (%s)\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol, u8ReplyMaskForQuestion, IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str());
+                });
+
+                // Check tiebreak need for service domain
+                if (ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus)
                 {
-                    // Define service replies, BUT only answer queries after probing is done
-                    uint8_t u8ReplyMaskForQuestion = (((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus))
-                                                          ? _replyMaskForService(questionRR.m_Header, *pService, 0)
-                                                          : 0);
-                    u8HostOrServiceReplies |= (pService->m_u8ReplyMask |= u8ReplyMaskForQuestion);
-                    DEBUG_EX_INFO(if (u8ReplyMaskForQuestion)
-                                  {
-                                      DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service reply needed for (%s.%s.%s): 0x%X (%s)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, u8ReplyMaskForQuestion, IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str());
-                                  });
-
-                    // Check tiebreak need for service domain
-                    if (ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus)
+                    bool    bFullNameMatch = false;
+                    if ((_replyMaskForService(questionRR.m_Header, *pService, &bFullNameMatch)) &&
+                            (bFullNameMatch))
                     {
-                        bool bFullNameMatch = false;
-                        if ((_replyMaskForService(questionRR.m_Header, *pService, &bFullNameMatch)) && (bFullNameMatch))
-                        {
-                            // We're in 'probing' state and someone is asking for this service domain: this might be
-                            // a race-condition: Two services with the same domain names try simutanously to probe their domains
-                            // See: RFC 6762, 8.2 (Tiebraking)
-                            // However, we're using a max. reduced approach for tiebreaking here: The 'higher' SRV host wins!
-                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for service domain %s.%s.%s detected while probing.\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                        // We're in 'probing' state and someone is asking for this service domain: this might be
+                        // a race-condition: Two services with the same domain names try simutanously to probe their domains
+                        // See: RFC 6762, 8.2 (Tiebraking)
+                        // However, we're using a max. reduced approach for tiebreaking here: The 'higher' SRV host wins!
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for service domain %s.%s.%s detected while probing.\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
 
-                            pService->m_ProbeInformation.m_bTiebreakNeeded = true;
-                        }
+                        pService->m_ProbeInformation.m_bTiebreakNeeded = true;
                     }
                 }
+            }
 
-                // Handle unicast and legacy specialities
-                // If only one question asks for unicast reply, the whole reply packet is send unicast
-                if (((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) ||  // Unicast (maybe legacy) query OR
-                     (questionRR.m_bUnicast))
-                    &&  // Expressivly unicast query
+            // Handle unicast and legacy specialities
+            // If only one question asks for unicast reply, the whole reply packet is send unicast
+            if (((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) ||     // Unicast (maybe legacy) query OR
+                    (questionRR.m_bUnicast)) &&                                // Expressivly unicast query
                     (!sendParameter.m_bUnicast))
+            {
+
+                sendParameter.m_bUnicast = true;
+                sendParameter.m_bCacheFlush = false;
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Unicast response for %s!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
+
+                if ((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) &&  // Unicast (maybe legacy) query AND
+                        (1 == p_MsgHeader.m_u16QDCount) &&                          // Only one question AND
+                        ((sendParameter.m_u8HostReplyMask) ||                       //  Host replies OR
+                         (u8HostOrServiceReplies)))                                 //  Host or service replies available
                 {
-                    sendParameter.m_bUnicast    = true;
-                    sendParameter.m_bCacheFlush = false;
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Unicast response for %s!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
-
-                    if ((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) &&  // Unicast (maybe legacy) query AND
-                        (1 == p_MsgHeader.m_u16QDCount) &&                      // Only one question AND
-                        ((sendParameter.m_u8HostReplyMask) ||                   //  Host replies OR
-                         (u8HostOrServiceReplies)))                             //  Host or service replies available
+                    // We're a match for this legacy query, BUT
+                    // make sure, that the query comes from a local host
+                    ip_info IPInfo_Local;
+                    ip_info IPInfo_Remote;
+                    if (((IPInfo_Remote.ip.addr = m_pUDPContext->getRemoteAddress())) &&
+                            (((wifi_get_ip_info(SOFTAP_IF, &IPInfo_Local)) &&
+                              (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask))) ||  // Remote IP in SOFTAP's subnet OR
+                             ((wifi_get_ip_info(STATION_IF, &IPInfo_Local)) &&
+                              (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask)))))   // Remote IP in STATION's subnet
                     {
-                        // We're a match for this legacy query, BUT
-                        // make sure, that the query comes from a local host
-                        ip_info IPInfo_Local;
-                        ip_info IPInfo_Remote;
-                        if (((IPInfo_Remote.ip.addr = m_pUDPContext->getRemoteAddress())) && (((wifi_get_ip_info(SOFTAP_IF, &IPInfo_Local)) && (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask))) ||  // Remote IP in SOFTAP's subnet OR
-                                                                                              ((wifi_get_ip_info(STATION_IF, &IPInfo_Local)) && (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask)))))  // Remote IP in STATION's subnet
-                        {
-                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from local host %s, id %u!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), p_MsgHeader.m_u16ID););
 
-                            sendParameter.m_u16ID        = p_MsgHeader.m_u16ID;
-                            sendParameter.m_bLegacyQuery = true;
-                            sendParameter.m_pQuestions   = new stcMDNS_RRQuestion;
-                            if ((bResult = (0 != sendParameter.m_pQuestions)))
-                            {
-                                sendParameter.m_pQuestions->m_Header.m_Domain                = questionRR.m_Header.m_Domain;
-                                sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type  = questionRR.m_Header.m_Attributes.m_u16Type;
-                                sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = questionRR.m_Header.m_Attributes.m_u16Class;
-                            }
-                            else
-                            {
-                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to add legacy question!\n")););
-                            }
+                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from local host %s, id %u!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), p_MsgHeader.m_u16ID););
+
+                        sendParameter.m_u16ID = p_MsgHeader.m_u16ID;
+                        sendParameter.m_bLegacyQuery = true;
+                        sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
+                        if ((bResult = (0 != sendParameter.m_pQuestions)))
+                        {
+                            sendParameter.m_pQuestions->m_Header.m_Domain = questionRR.m_Header.m_Domain;
+                            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = questionRR.m_Header.m_Attributes.m_u16Type;
+                            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = questionRR.m_Header.m_Attributes.m_u16Class;
                         }
                         else
                         {
-                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from NON-LOCAL host!\n")););
-                            bResult = false;
+                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to add legacy question!\n")););
                         }
                     }
+                    else
+                    {
+                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from NON-LOCAL host!\n")););
+                        bResult = false;
+                    }
                 }
             }
-            else
-            {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read question!\n")););
-            }
-        }  // for questions
+        }
+        else
+        {
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read question!\n")););
+        }
+    }   // for questions
 
-        //DEBUG_EX_INFO(if (u8HostOrServiceReplies) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Reply needed: %u (%s: %s->%s)\n"), u8HostOrServiceReplies, clsTimeSyncer::timestr(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), IPAddress(m_pUDPContext->getDestAddress()).toString().c_str()); } );
+    //DEBUG_EX_INFO(if (u8HostOrServiceReplies) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Reply needed: %u (%s: %s->%s)\n"), u8HostOrServiceReplies, clsTimeSyncer::timestr(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), IPAddress(m_pUDPContext->getDestAddress()).toString().c_str()); } );
 
-        // Handle known answers
-        uint32_t u32Answers = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
-        DEBUG_EX_INFO(if ((u8HostOrServiceReplies) && (u32Answers))
-                      {
-                          DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Known answers(%u):\n"), u32Answers);
-                      });
+    // Handle known answers
+    uint32_t    u32Answers = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
+    DEBUG_EX_INFO(if ((u8HostOrServiceReplies) && (u32Answers))
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Known answers(%u):\n"), u32Answers);
+    });
 
-        for (uint32_t an = 0; ((bResult) && (an < u32Answers)); ++an)
+    for (uint32_t an = 0; ((bResult) && (an < u32Answers)); ++an)
+    {
+        stcMDNS_RRAnswer*   pKnownRRAnswer = 0;
+        if (((bResult = _readRRAnswer(pKnownRRAnswer))) &&
+                (pKnownRRAnswer))
         {
-            stcMDNS_RRAnswer* pKnownRRAnswer = 0;
-            if (((bResult = _readRRAnswer(pKnownRRAnswer))) && (pKnownRRAnswer))
+
+            if ((DNS_RRTYPE_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Type) &&      // No ANY type answer
+                    (DNS_RRCLASS_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Class))      // No ANY class answer
             {
-                if ((DNS_RRTYPE_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Type) &&  // No ANY type answer
-                    (DNS_RRCLASS_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Class))  // No ANY class answer
+
+                // Find match between planned answer (sendParameter.m_u8HostReplyMask) and this 'known answer'
+                uint8_t u8HostMatchMask = (sendParameter.m_u8HostReplyMask & _replyMaskForHost(pKnownRRAnswer->m_Header));
+                if ((u8HostMatchMask) &&                                            // The RR in the known answer matches an RR we are planning to send, AND
+                        ((MDNS_HOST_TTL / 2) <= pKnownRRAnswer->m_u32TTL))              // The TTL of the known answer is longer than half of the new host TTL (120s)
                 {
-                    // Find match between planned answer (sendParameter.m_u8HostReplyMask) and this 'known answer'
-                    uint8_t u8HostMatchMask = (sendParameter.m_u8HostReplyMask & _replyMaskForHost(pKnownRRAnswer->m_Header));
-                    if ((u8HostMatchMask) &&                                // The RR in the known answer matches an RR we are planning to send, AND
-                        ((MDNS_HOST_TTL / 2) <= pKnownRRAnswer->m_u32TTL))  // The TTL of the known answer is longer than half of the new host TTL (120s)
+
+                    // Compare contents
+                    if (AnswerType_PTR == pKnownRRAnswer->answerType())
                     {
-                        // Compare contents
-                        if (AnswerType_PTR == pKnownRRAnswer->answerType())
+                        stcMDNS_RRDomain    hostDomain;
+                        if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
+                                (((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain == hostDomain))
                         {
-                            stcMDNS_RRDomain hostDomain;
-                            if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain == hostDomain))
-                            {
-                                // Host domain match
+                            // Host domain match
 #ifdef MDNS_IP4_SUPPORT
-                                if (u8HostMatchMask & ContentFlag_PTR_IP4)
-                                {
-                                    // IP4 PTR was asked for, but is already known -> skipping
-                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 PTR already known... skipping!\n")););
-                                    sendParameter.m_u8HostReplyMask &= ~ContentFlag_PTR_IP4;
-                                }
+                            if (u8HostMatchMask & ContentFlag_PTR_IP4)
+                            {
+                                // IP4 PTR was asked for, but is already known -> skipping
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 PTR already known... skipping!\n")););
+                                sendParameter.m_u8HostReplyMask &= ~ContentFlag_PTR_IP4;
+                            }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                                if (u8HostMatchMask & ContentFlag_PTR_IP6)
-                                {
-                                    // IP6 PTR was asked for, but is already known -> skipping
-                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 PTR already known... skipping!\n")););
-                                    sendParameter.m_u8HostReplyMask &= ~ContentFlag_PTR_IP6;
-                                }
-#endif
-                            }
-                        }
-                        else if (u8HostMatchMask & ContentFlag_A)
-                        {
-                            // IP4 address was asked for
-#ifdef MDNS_IP4_SUPPORT
-                            if ((AnswerType_A == pKnownRRAnswer->answerType()) && (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == m_pUDPContext->getInputNetif()->ip_addr))
+                            if (u8HostMatchMask & ContentFlag_PTR_IP6)
                             {
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 address already known... skipping!\n")););
-                                sendParameter.m_u8HostReplyMask &= ~ContentFlag_A;
-                            }  // else: RData NOT IP4 length !!
+                                // IP6 PTR was asked for, but is already known -> skipping
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 PTR already known... skipping!\n")););
+                                sendParameter.m_u8HostReplyMask &= ~ContentFlag_PTR_IP6;
+                            }
 #endif
                         }
-                        else if (u8HostMatchMask & ContentFlag_AAAA)
+                    }
+                    else if (u8HostMatchMask & ContentFlag_A)
+                    {
+                        // IP4 address was asked for
+#ifdef MDNS_IP4_SUPPORT
+                        if ((AnswerType_A == pKnownRRAnswer->answerType()) &&
+                                (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == m_pUDPContext->getInputNetif()->ip_addr))
                         {
-                            // IP6 address was asked for
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 address already known... skipping!\n")););
+                            sendParameter.m_u8HostReplyMask &= ~ContentFlag_A;
+                        }   // else: RData NOT IP4 length !!
+#endif
+                    }
+                    else if (u8HostMatchMask & ContentFlag_AAAA)
+                    {
+                        // IP6 address was asked for
 #ifdef MDNS_IP6_SUPPORT
-                            if ((AnswerType_AAAA == pAnswerRR->answerType()) && (((stcMDNS_RRAnswerAAAA*)pAnswerRR)->m_IPAddress == _getResponseMulticastInterface()))
-                            {
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 address already known... skipping!\n")););
-                                sendParameter.m_u8HostReplyMask &= ~ContentFlag_AAAA;
-                            }  // else: RData NOT IP6 length !!
+                        if ((AnswerType_AAAA == pAnswerRR->answerType()) &&
+                                (((stcMDNS_RRAnswerAAAA*)pAnswerRR)->m_IPAddress == _getResponseMulticastInterface()))
+                        {
+
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 address already known... skipping!\n")););
+                            sendParameter.m_u8HostReplyMask &= ~ContentFlag_AAAA;
+                        }   // else: RData NOT IP6 length !!
 #endif
-                        }
-                    }  // Host match /*and TTL*/
+                    }
+                }   // Host match /*and TTL*/
 
-                    //
-                    // Check host tiebreak possibility
-                    if (m_HostProbeInformation.m_bTiebreakNeeded)
+                //
+                // Check host tiebreak possibility
+                if (m_HostProbeInformation.m_bTiebreakNeeded)
+                {
+                    stcMDNS_RRDomain    hostDomain;
+                    if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
+                            (pKnownRRAnswer->m_Header.m_Domain == hostDomain))
                     {
-                        stcMDNS_RRDomain hostDomain;
-                        if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (pKnownRRAnswer->m_Header.m_Domain == hostDomain))
-                        {
-                            // Host domain match
+                        // Host domain match
 #ifdef MDNS_IP4_SUPPORT
-                            if (AnswerType_A == pKnownRRAnswer->answerType())
+                        if (AnswerType_A == pKnownRRAnswer->answerType())
+                        {
+
+                            IPAddress localIPAddress(m_pUDPContext->getInputNetif()->ip_addr);
+                            if (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == localIPAddress)
                             {
-                                IPAddress localIPAddress(m_pUDPContext->getInputNetif()->ip_addr);
-                                if (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == localIPAddress)
+                                // SAME IP address -> We've received an old message from ourselves (same IP)
+                                DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (was an old message)!\n")););
+                                m_HostProbeInformation.m_bTiebreakNeeded = false;
+                            }
+                            else
+                            {
+                                if ((uint32_t)(((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress) > (uint32_t)localIPAddress)   // The OTHER IP is 'higher' -> LOST
                                 {
-                                    // SAME IP address -> We've received an old message from ourselves (same IP)
-                                    DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (was an old message)!\n")););
+                                    // LOST tiebreak
+                                    DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) LOST (lower)!\n")););
+                                    _cancelProbingForHost();
                                     m_HostProbeInformation.m_bTiebreakNeeded = false;
                                 }
-                                else
+                                else    // WON tiebreak
                                 {
-                                    if ((uint32_t)(((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress) > (uint32_t)localIPAddress)  // The OTHER IP is 'higher' -> LOST
-                                    {
-                                        // LOST tiebreak
-                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) LOST (lower)!\n")););
-                                        _cancelProbingForHost();
-                                        m_HostProbeInformation.m_bTiebreakNeeded = false;
-                                    }
-                                    else  // WON tiebreak
-                                    {
-                                        //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
-                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (higher IP)!\n")););
-                                        m_HostProbeInformation.m_bTiebreakNeeded = false;
-                                    }
+                                    //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
+                                    DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (higher IP)!\n")););
+                                    m_HostProbeInformation.m_bTiebreakNeeded = false;
                                 }
                             }
+                        }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                            if (AnswerType_AAAA == pAnswerRR->answerType())
-                            {
-                                // TODO
-                            }
-#endif
+                        if (AnswerType_AAAA == pAnswerRR->answerType())
+                        {
+                            // TODO
                         }
-                    }  // Host tiebreak possibility
+#endif
+                    }
+                }   // Host tiebreak possibility
+
+                // Check service answers
+                for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+                {
+
+                    uint8_t u8ServiceMatchMask = (pService->m_u8ReplyMask & _replyMaskForService(pKnownRRAnswer->m_Header, *pService));
 
-                    // Check service answers
-                    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+                    if ((u8ServiceMatchMask) &&                                 // The RR in the known answer matches an RR we are planning to send, AND
+                            ((MDNS_SERVICE_TTL / 2) <= pKnownRRAnswer->m_u32TTL))   // The TTL of the known answer is longer than half of the new service TTL (4500s)
                     {
-                        uint8_t u8ServiceMatchMask = (pService->m_u8ReplyMask & _replyMaskForService(pKnownRRAnswer->m_Header, *pService));
 
-                        if ((u8ServiceMatchMask) &&                                // The RR in the known answer matches an RR we are planning to send, AND
-                            ((MDNS_SERVICE_TTL / 2) <= pKnownRRAnswer->m_u32TTL))  // The TTL of the known answer is longer than half of the new service TTL (4500s)
+                        if (AnswerType_PTR == pKnownRRAnswer->answerType())
                         {
-                            if (AnswerType_PTR == pKnownRRAnswer->answerType())
+                            stcMDNS_RRDomain    serviceDomain;
+                            if ((u8ServiceMatchMask & ContentFlag_PTR_TYPE) &&
+                                    (_buildDomainForService(*pService, false, serviceDomain)) &&
+                                    (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
                             {
-                                stcMDNS_RRDomain serviceDomain;
-                                if ((u8ServiceMatchMask & ContentFlag_PTR_TYPE) && (_buildDomainForService(*pService, false, serviceDomain)) && (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
-                                {
-                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service type PTR already known... skipping!\n")););
-                                    pService->m_u8ReplyMask &= ~ContentFlag_PTR_TYPE;
-                                }
-                                if ((u8ServiceMatchMask & ContentFlag_PTR_NAME) && (_buildDomainForService(*pService, true, serviceDomain)) && (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
-                                {
-                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service name PTR already known... skipping!\n")););
-                                    pService->m_u8ReplyMask &= ~ContentFlag_PTR_NAME;
-                                }
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service type PTR already known... skipping!\n")););
+                                pService->m_u8ReplyMask &= ~ContentFlag_PTR_TYPE;
                             }
-                            else if (u8ServiceMatchMask & ContentFlag_SRV)
+                            if ((u8ServiceMatchMask & ContentFlag_PTR_NAME) &&
+                                    (_buildDomainForService(*pService, true, serviceDomain)) &&
+                                    (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
                             {
-                                DEBUG_EX_ERR(if (AnswerType_SRV != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (SRV)!\n")););
-                                stcMDNS_RRDomain hostDomain;
-                                if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))  // Host domain match
-                                {
-                                    if ((MDNS_SRV_PRIORITY == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Priority) && (MDNS_SRV_WEIGHT == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Weight) && (pService->m_u16Port == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Port))
-                                    {
-                                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service SRV answer already known... skipping!\n")););
-                                        pService->m_u8ReplyMask &= ~ContentFlag_SRV;
-                                    }  // else: Small differences -> send update message
-                                }
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service name PTR already known... skipping!\n")););
+                                pService->m_u8ReplyMask &= ~ContentFlag_PTR_NAME;
                             }
-                            else if (u8ServiceMatchMask & ContentFlag_TXT)
+                        }
+                        else if (u8ServiceMatchMask & ContentFlag_SRV)
+                        {
+                            DEBUG_EX_ERR(if (AnswerType_SRV != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (SRV)!\n")););
+                            stcMDNS_RRDomain    hostDomain;
+                            if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
+                                    (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))    // Host domain match
                             {
-                                DEBUG_EX_ERR(if (AnswerType_TXT != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (TXT)!\n")););
-                                _collectServiceTxts(*pService);
-                                if (pService->m_Txts == ((stcMDNS_RRAnswerTXT*)pKnownRRAnswer)->m_Txts)
+
+                                if ((MDNS_SRV_PRIORITY == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Priority) &&
+                                        (MDNS_SRV_WEIGHT == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Weight) &&
+                                        (pService->m_u16Port == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Port))
                                 {
-                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service TXT answer already known... skipping!\n")););
-                                    pService->m_u8ReplyMask &= ~ContentFlag_TXT;
-                                }
-                                _releaseTempServiceTxts(*pService);
+
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service SRV answer already known... skipping!\n")););
+                                    pService->m_u8ReplyMask &= ~ContentFlag_SRV;
+                                }   // else: Small differences -> send update message
+                            }
+                        }
+                        else if (u8ServiceMatchMask & ContentFlag_TXT)
+                        {
+                            DEBUG_EX_ERR(if (AnswerType_TXT != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (TXT)!\n")););
+                            _collectServiceTxts(*pService);
+                            if (pService->m_Txts == ((stcMDNS_RRAnswerTXT*)pKnownRRAnswer)->m_Txts)
+                            {
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service TXT answer already known... skipping!\n")););
+                                pService->m_u8ReplyMask &= ~ContentFlag_TXT;
                             }
-                        }  // Service match and enough TTL
+                            _releaseTempServiceTxts(*pService);
+                        }
+                    }   // Service match and enough TTL
 
-                        //
-                        // Check service tiebreak possibility
-                        if (pService->m_ProbeInformation.m_bTiebreakNeeded)
+                    //
+                    // Check service tiebreak possibility
+                    if (pService->m_ProbeInformation.m_bTiebreakNeeded)
+                    {
+                        stcMDNS_RRDomain    serviceDomain;
+                        if ((_buildDomainForService(*pService, true, serviceDomain)) &&
+                                (pKnownRRAnswer->m_Header.m_Domain == serviceDomain))
                         {
-                            stcMDNS_RRDomain serviceDomain;
-                            if ((_buildDomainForService(*pService, true, serviceDomain)) && (pKnownRRAnswer->m_Header.m_Domain == serviceDomain))
+                            // Service domain match
+                            if (AnswerType_SRV == pKnownRRAnswer->answerType())
                             {
-                                // Service domain match
-                                if (AnswerType_SRV == pKnownRRAnswer->answerType())
+                                stcMDNS_RRDomain    hostDomain;
+                                if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
+                                        (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))    // Host domain match
+                                {
+
+                                    // We've received an old message from ourselves (same SRV)
+                                    DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (was an old message)!\n")););
+                                    pService->m_ProbeInformation.m_bTiebreakNeeded = false;
+                                }
+                                else
                                 {
-                                    stcMDNS_RRDomain hostDomain;
-                                    if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))  // Host domain match
+                                    if (((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain > hostDomain)   // The OTHER domain is 'higher' -> LOST
                                     {
-                                        // We've received an old message from ourselves (same SRV)
-                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (was an old message)!\n")););
+                                        // LOST tiebreak
+                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) LOST (lower)!\n")););
+                                        _cancelProbingForService(*pService);
                                         pService->m_ProbeInformation.m_bTiebreakNeeded = false;
                                     }
-                                    else
+                                    else    // WON tiebreak
                                     {
-                                        if (((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain > hostDomain)  // The OTHER domain is 'higher' -> LOST
-                                        {
-                                            // LOST tiebreak
-                                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) LOST (lower)!\n")););
-                                            _cancelProbingForService(*pService);
-                                            pService->m_ProbeInformation.m_bTiebreakNeeded = false;
-                                        }
-                                        else  // WON tiebreak
-                                        {
-                                            //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
-                                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (higher)!\n")););
-                                            pService->m_ProbeInformation.m_bTiebreakNeeded = false;
-                                        }
+                                        //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
+                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (higher)!\n")););
+                                        pService->m_ProbeInformation.m_bTiebreakNeeded = false;
                                     }
                                 }
                             }
-                        }  // service tiebreak possibility
-                    }      // for services
-                }          // ANY answers
-            }
-            else
-            {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read known answer!\n")););
-            }
+                        }
+                    }   // service tiebreak possibility
+                }   // for services
+            }   // ANY answers
+        }
+        else
+        {
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read known answer!\n")););
+        }
 
-            if (pKnownRRAnswer)
-            {
-                delete pKnownRRAnswer;
-                pKnownRRAnswer = 0;
-            }
-        }  // for answers
+        if (pKnownRRAnswer)
+        {
+            delete pKnownRRAnswer;
+            pKnownRRAnswer = 0;
+        }
+    }   // for answers
 
-        if (bResult)
+    if (bResult)
+    {
+        // Check, if a reply is needed
+        uint8_t u8ReplyNeeded = sendParameter.m_u8HostReplyMask;
+        for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
         {
-            // Check, if a reply is needed
-            uint8_t u8ReplyNeeded = sendParameter.m_u8HostReplyMask;
-            for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
-            {
-                u8ReplyNeeded |= pService->m_u8ReplyMask;
-            }
+            u8ReplyNeeded |= pService->m_u8ReplyMask;
+        }
 
-            if (u8ReplyNeeded)
-            {
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Sending answer(0x%X)...\n"), u8ReplyNeeded););
+        if (u8ReplyNeeded)
+        {
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Sending answer(0x%X)...\n"), u8ReplyNeeded););
 
-                sendParameter.m_bResponse    = true;
-                sendParameter.m_bAuthorative = true;
+            sendParameter.m_bResponse = true;
+            sendParameter.m_bAuthorative = true;
 
-                bResult = _sendMDNSMessage(sendParameter);
-            }
-            DEBUG_EX_INFO(
-                else
-                {
-                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: No reply needed\n"));
-                });
+            bResult = _sendMDNSMessage(sendParameter);
         }
-        else
+        DEBUG_EX_INFO(
+            else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Something FAILED!\n")););
-            m_pUDPContext->flush();
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: No reply needed\n"));
         }
+        );
+    }
+    else
+    {
+        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Something FAILED!\n")););
+        m_pUDPContext->flush();
+    }
 
-        //
-        // Check and reset tiebreak-states
-        if (m_HostProbeInformation.m_bTiebreakNeeded)
-        {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for host domain!\n")););
-            m_HostProbeInformation.m_bTiebreakNeeded = false;
-        }
-        for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+    //
+    // Check and reset tiebreak-states
+    if (m_HostProbeInformation.m_bTiebreakNeeded)
+    {
+        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for host domain!\n")););
+        m_HostProbeInformation.m_bTiebreakNeeded = false;
+    }
+    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+    {
+        if (pService->m_ProbeInformation.m_bTiebreakNeeded)
         {
-            if (pService->m_ProbeInformation.m_bTiebreakNeeded)
-            {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for service domain (%s.%s.%s)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
-                pService->m_ProbeInformation.m_bTiebreakNeeded = false;
-            }
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for service domain (%s.%s.%s)\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+            pService->m_ProbeInformation.m_bTiebreakNeeded = false;
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED!\n"));
-                     });
-        return bResult;
     }
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_parseResponse
 
     Responses are of interest in two cases:
@@ -578,81 +619,84 @@ namespace MDNSImplementation
                TXT - links the instance name to services TXTs
       Level 3: A/AAAA - links the host domain to an IP address
 */
-    bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
+bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
+{
+    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse\n")););
+    //DEBUG_EX_INFO(_udpDump(););
+
+    bool    bResult = false;
+
+    // A response should be the result of a query or a probe
+    if ((_hasServiceQueriesWaitingForAnswers()) ||          // Waiting for query answers OR
+            (_hasProbesWaitingForAnswers()))                    // Probe responses
     {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse\n")););
-        //DEBUG_EX_INFO(_udpDump(););
 
-        bool bResult = false;
+        DEBUG_EX_INFO(
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response\n"));
+            //_udpDump();
+        );
 
-        // A response should be the result of a query or a probe
-        if ((_hasServiceQueriesWaitingForAnswers()) ||  // Waiting for query answers OR
-            (_hasProbesWaitingForAnswers()))            // Probe responses
+        bResult = true;
+        //
+        // Ignore questions here
+        stcMDNS_RRQuestion  dummyRRQ;
+        for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
         {
-            DEBUG_EX_INFO(
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response\n"));
-                //_udpDump();
-            );
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response containing a question... ignoring!\n")););
+            bResult = _readRRQuestion(dummyRRQ);
+        }   // for queries
 
-            bResult = true;
-            //
-            // Ignore questions here
-            stcMDNS_RRQuestion dummyRRQ;
-            for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
+        //
+        // Read and collect answers
+        stcMDNS_RRAnswer*   pCollectedRRAnswers = 0;
+        uint32_t            u32NumberOfAnswerRRs = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
+        for (uint32_t an = 0; ((bResult) && (an < u32NumberOfAnswerRRs)); ++an)
+        {
+            stcMDNS_RRAnswer*   pRRAnswer = 0;
+            if (((bResult = _readRRAnswer(pRRAnswer))) &&
+                    (pRRAnswer))
             {
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response containing a question... ignoring!\n")););
-                bResult = _readRRQuestion(dummyRRQ);
-            }  // for queries
-
-            //
-            // Read and collect answers
-            stcMDNS_RRAnswer* pCollectedRRAnswers  = 0;
-            uint32_t          u32NumberOfAnswerRRs = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
-            for (uint32_t an = 0; ((bResult) && (an < u32NumberOfAnswerRRs)); ++an)
+                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: ADDING answer!\n")););
+                pRRAnswer->m_pNext = pCollectedRRAnswers;
+                pCollectedRRAnswers = pRRAnswer;
+            }
+            else
             {
-                stcMDNS_RRAnswer* pRRAnswer = 0;
-                if (((bResult = _readRRAnswer(pRRAnswer))) && (pRRAnswer))
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answer!\n")););
+                if (pRRAnswer)
                 {
-                    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: ADDING answer!\n")););
-                    pRRAnswer->m_pNext  = pCollectedRRAnswers;
-                    pCollectedRRAnswers = pRRAnswer;
+                    delete pRRAnswer;
+                    pRRAnswer = 0;
                 }
-                else
-                {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answer!\n")););
-                    if (pRRAnswer)
-                    {
-                        delete pRRAnswer;
-                        pRRAnswer = 0;
-                    }
-                    bResult = false;
-                }
-            }  // for answers
-
-            //
-            // Process answers
-            if (bResult)
-            {
-                bResult = ((!pCollectedRRAnswers) || (_processAnswers(pCollectedRRAnswers)));
-            }
-            else  // Some failure while reading answers
-            {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answers!\n")););
-                m_pUDPContext->flush();
+                bResult = false;
             }
+        }   // for answers
 
-            // Delete collected answers
-            while (pCollectedRRAnswers)
-            {
-                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: DELETING answer!\n")););
-                stcMDNS_RRAnswer* pNextAnswer = pCollectedRRAnswers->m_pNext;
-                delete pCollectedRRAnswers;
-                pCollectedRRAnswers = pNextAnswer;
-            }
+        //
+        // Process answers
+        if (bResult)
+        {
+            bResult = ((!pCollectedRRAnswers) ||
+                       (_processAnswers(pCollectedRRAnswers)));
         }
-        else  // Received an unexpected response -> ignore
+        else    // Some failure while reading answers
         {
-            /*  DEBUG_EX_INFO(
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answers!\n")););
+            m_pUDPContext->flush();
+        }
+
+        // Delete collected answers
+        while (pCollectedRRAnswers)
+        {
+            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: DELETING answer!\n")););
+            stcMDNS_RRAnswer*   pNextAnswer = pCollectedRRAnswers->m_pNext;
+            delete pCollectedRRAnswers;
+            pCollectedRRAnswers = pNextAnswer;
+        }
+    }
+    else    // Received an unexpected response -> ignore
+    {
+        /*  DEBUG_EX_INFO(
                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received an unexpected response... ignoring!\nDUMP:\n"));
                 bool    bDumpResult = true;
                 for (uint16_t qd=0; ((bDumpResult) && (qd<p_MsgHeader.m_u16QDCount)); ++qd) {
@@ -672,17 +716,17 @@ namespace MDNSImplementation
                     esp_suspend();
                 }
             );*/
-            m_pUDPContext->flush();
-            bResult = true;
-        }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED!\n"));
-                     });
-        return bResult;
+        m_pUDPContext->flush();
+        bResult = true;
     }
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_processAnswers
     Host:
     A (0x01):               eg. esp8266.local A OP TTL 123.456.789.012
@@ -696,427 +740,462 @@ namespace MDNSImplementation
     TXT (0x10):             eg. MyESP._http._tcp.local TXT OP TTL c#=1
 
 */
-    bool MDNSResponder::_processAnswers(const MDNSResponder::stcMDNS_RRAnswer* p_pAnswers)
+bool MDNSResponder::_processAnswers(const MDNSResponder::stcMDNS_RRAnswer* p_pAnswers)
+{
+
+    bool    bResult = false;
+
+    if (p_pAnswers)
     {
-        bool bResult = false;
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Processing answers...\n")););
+        bResult = true;
 
-        if (p_pAnswers)
+        // Answers may arrive in an unexpected order. So we loop our answers as long, as we
+        // can connect new information to service queries
+        bool    bFoundNewKeyAnswer;
+        do
         {
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Processing answers...\n")););
-            bResult = true;
+            bFoundNewKeyAnswer = false;
 
-            // Answers may arrive in an unexpected order. So we loop our answers as long, as we
-            // can connect new information to service queries
-            bool bFoundNewKeyAnswer;
-            do
+            const stcMDNS_RRAnswer* pRRAnswer = p_pAnswers;
+            while ((pRRAnswer) &&
+                    (bResult))
             {
-                bFoundNewKeyAnswer = false;
-
-                const stcMDNS_RRAnswer* pRRAnswer = p_pAnswers;
-                while ((pRRAnswer) && (bResult))
+                // 1. level answer (PTR)
+                if (AnswerType_PTR == pRRAnswer->answerType())
                 {
-                    // 1. level answer (PTR)
-                    if (AnswerType_PTR == pRRAnswer->answerType())
-                    {
-                        // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
-                        bResult = _processPTRAnswer((stcMDNS_RRAnswerPTR*)pRRAnswer, bFoundNewKeyAnswer);  // May 'enable' new SRV or TXT answers to be linked to queries
-                    }
-                    // 2. level answers
-                    // SRV -> host domain and port
-                    else if (AnswerType_SRV == pRRAnswer->answerType())
-                    {
-                        // eg. MyESP_http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
-                        bResult = _processSRVAnswer((stcMDNS_RRAnswerSRV*)pRRAnswer, bFoundNewKeyAnswer);  // May 'enable' new A/AAAA answers to be linked to queries
-                    }
-                    // TXT -> Txts
-                    else if (AnswerType_TXT == pRRAnswer->answerType())
-                    {
-                        // eg. MyESP_http._tcp.local TXT xxxx xx c#=1
-                        bResult = _processTXTAnswer((stcMDNS_RRAnswerTXT*)pRRAnswer);
-                    }
-                    // 3. level answers
+                    // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
+                    bResult = _processPTRAnswer((stcMDNS_RRAnswerPTR*)pRRAnswer, bFoundNewKeyAnswer);   // May 'enable' new SRV or TXT answers to be linked to queries
+                }
+                // 2. level answers
+                // SRV -> host domain and port
+                else if (AnswerType_SRV == pRRAnswer->answerType())
+                {
+                    // eg. MyESP_http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
+                    bResult = _processSRVAnswer((stcMDNS_RRAnswerSRV*)pRRAnswer, bFoundNewKeyAnswer);   // May 'enable' new A/AAAA answers to be linked to queries
+                }
+                // TXT -> Txts
+                else if (AnswerType_TXT == pRRAnswer->answerType())
+                {
+                    // eg. MyESP_http._tcp.local TXT xxxx xx c#=1
+                    bResult = _processTXTAnswer((stcMDNS_RRAnswerTXT*)pRRAnswer);
+                }
+                // 3. level answers
 #ifdef MDNS_IP4_SUPPORT
-                    // A -> IP4Address
-                    else if (AnswerType_A == pRRAnswer->answerType())
-                    {
-                        // eg. esp8266.local A xxxx xx 192.168.2.120
-                        bResult = _processAAnswer((stcMDNS_RRAnswerA*)pRRAnswer);
-                    }
+                // A -> IP4Address
+                else if (AnswerType_A == pRRAnswer->answerType())
+                {
+                    // eg. esp8266.local A xxxx xx 192.168.2.120
+                    bResult = _processAAnswer((stcMDNS_RRAnswerA*)pRRAnswer);
+                }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                    // AAAA -> IP6Address
-                    else if (AnswerType_AAAA == pRRAnswer->answerType())
-                    {
-                        // eg. esp8266.local AAAA xxxx xx 09cf::0c
-                        bResult = _processAAAAAnswer((stcMDNS_RRAnswerAAAA*)pRRAnswer);
-                    }
+                // AAAA -> IP6Address
+                else if (AnswerType_AAAA == pRRAnswer->answerType())
+                {
+                    // eg. esp8266.local AAAA xxxx xx 09cf::0c
+                    bResult = _processAAAAAnswer((stcMDNS_RRAnswerAAAA*)pRRAnswer);
+                }
 #endif
 
-                    // Finally check for probing conflicts
-                    // Host domain
-                    if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) && ((AnswerType_A == pRRAnswer->answerType()) || (AnswerType_AAAA == pRRAnswer->answerType())))
+                // Finally check for probing conflicts
+                // Host domain
+                if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&
+                        ((AnswerType_A == pRRAnswer->answerType()) ||
+                         (AnswerType_AAAA == pRRAnswer->answerType())))
+                {
+
+                    stcMDNS_RRDomain    hostDomain;
+                    if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
+                            (pRRAnswer->m_Header.m_Domain == hostDomain))
                     {
-                        stcMDNS_RRDomain hostDomain;
-                        if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (pRRAnswer->m_Header.m_Domain == hostDomain))
-                        {
-                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.local\n"), m_pcHostname););
-                            _cancelProbingForHost();
-                        }
+
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.local\n"), m_pcHostname););
+                        _cancelProbingForHost();
                     }
-                    // Service domains
-                    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+                }
+                // Service domains
+                for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+                {
+                    if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&
+                            ((AnswerType_TXT == pRRAnswer->answerType()) ||
+                             (AnswerType_SRV == pRRAnswer->answerType())))
                     {
-                        if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) && ((AnswerType_TXT == pRRAnswer->answerType()) || (AnswerType_SRV == pRRAnswer->answerType())))
+
+                        stcMDNS_RRDomain    serviceDomain;
+                        if ((_buildDomainForService(*pService, true, serviceDomain)) &&
+                                (pRRAnswer->m_Header.m_Domain == serviceDomain))
                         {
-                            stcMDNS_RRDomain serviceDomain;
-                            if ((_buildDomainForService(*pService, true, serviceDomain)) && (pRRAnswer->m_Header.m_Domain == serviceDomain))
-                            {
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.%s.%s\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
-                                _cancelProbingForService(*pService);
-                            }
+
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.%s.%s\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                            _cancelProbingForService(*pService);
                         }
                     }
+                }
 
-                    pRRAnswer = pRRAnswer->m_pNext;  // Next collected answer
-                }                                    // while (answers)
-            } while ((bFoundNewKeyAnswer) && (bResult));
-        }  // else: No answers provided
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: FAILED!\n"));
-                     });
-        return bResult;
-    }
+                pRRAnswer = pRRAnswer->m_pNext; // Next collected answer
+            }   // while (answers)
+        } while ((bFoundNewKeyAnswer) &&
+                 (bResult));
+    }   // else: No answers provided
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_processPTRAnswer
 */
-    bool MDNSResponder::_processPTRAnswer(const MDNSResponder::stcMDNS_RRAnswerPTR* p_pPTRAnswer,
-                                          bool&                                     p_rbFoundNewKeyAnswer)
+bool MDNSResponder::_processPTRAnswer(const MDNSResponder::stcMDNS_RRAnswerPTR* p_pPTRAnswer,
+                                      bool& p_rbFoundNewKeyAnswer)
+{
+
+    bool    bResult = false;
+
+    if ((bResult = (0 != p_pPTRAnswer)))
     {
-        bool bResult = false;
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Processing PTR answers...\n")););
+        // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
+        // Check pending service queries for eg. '_http._tcp'
 
-        if ((bResult = (0 != p_pPTRAnswer)))
+        stcMDNSServiceQuery*    pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, 0);
+        while (pServiceQuery)
         {
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Processing PTR answers...\n")););
-            // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
-            // Check pending service queries for eg. '_http._tcp'
-
-            stcMDNSServiceQuery* pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, 0);
-            while (pServiceQuery)
+            if (pServiceQuery->m_bAwaitingAnswers)
             {
-                if (pServiceQuery->m_bAwaitingAnswers)
+                // Find answer for service domain (eg. MyESP._http._tcp.local)
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pPTRAnswer->m_PTRDomain);
+                if (pSQAnswer)      // existing answer
                 {
-                    // Find answer for service domain (eg. MyESP._http._tcp.local)
-                    stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pPTRAnswer->m_PTRDomain);
-                    if (pSQAnswer)  // existing answer
+                    if (p_pPTRAnswer->m_u32TTL)     // Received update message
                     {
-                        if (p_pPTRAnswer->m_u32TTL)  // Received update message
-                        {
-                            pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);  // Update TTL tag
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Updated TTL(%d) for "), (int)p_pPTRAnswer->m_u32TTL);
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR("\n")););
-                        }
-                        else  // received goodbye-message
-                        {
-                            pSQAnswer->m_TTLServiceDomain.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: 'Goodbye' received for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR("\n")););
-                        }
+                        pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);    // Update TTL tag
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Updated TTL(%d) for "), (int)p_pPTRAnswer->m_u32TTL);
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR("\n"));
+                        );
                     }
-                    else if ((p_pPTRAnswer->m_u32TTL) &&                          // Not just a goodbye-message
-                             ((pSQAnswer = new stcMDNSServiceQuery::stcAnswer)))  // Not yet included -> add answer
+                    else                            // received goodbye-message
                     {
-                        pSQAnswer->m_ServiceDomain = p_pPTRAnswer->m_PTRDomain;
-                        pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_ServiceDomain;
-                        pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);
-                        pSQAnswer->releaseServiceDomain();
-
-                        bResult               = pServiceQuery->addAnswer(pSQAnswer);
-                        p_rbFoundNewKeyAnswer = true;
-                        if (pServiceQuery->m_fnCallback)
-                        {
-                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain), true);
-                        }
+                        pSQAnswer->m_TTLServiceDomain.prepareDeletion();    // Prepare answer deletion according to RFC 6762, 10.1
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: 'Goodbye' received for "));
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR("\n"));
+                        );
+                    }
+                }
+                else if ((p_pPTRAnswer->m_u32TTL) &&                                // Not just a goodbye-message
+                         ((pSQAnswer = new stcMDNSServiceQuery::stcAnswer)))        // Not yet included -> add answer
+                {
+                    pSQAnswer->m_ServiceDomain = p_pPTRAnswer->m_PTRDomain;
+                    pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_ServiceDomain;
+                    pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);
+                    pSQAnswer->releaseServiceDomain();
+
+                    bResult = pServiceQuery->addAnswer(pSQAnswer);
+                    p_rbFoundNewKeyAnswer = true;
+                    if (pServiceQuery->m_fnCallback)
+                    {
+                        MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                        pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain), true);
                     }
                 }
-                pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, pServiceQuery);
             }
-        }  // else: No p_pPTRAnswer
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: FAILED!\n"));
-                     });
-        return bResult;
-    }
+            pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, pServiceQuery);
+        }
+    }   // else: No p_pPTRAnswer
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_processSRVAnswer
 */
-    bool MDNSResponder::_processSRVAnswer(const MDNSResponder::stcMDNS_RRAnswerSRV* p_pSRVAnswer,
-                                          bool&                                     p_rbFoundNewKeyAnswer)
+bool MDNSResponder::_processSRVAnswer(const MDNSResponder::stcMDNS_RRAnswerSRV* p_pSRVAnswer,
+                                      bool& p_rbFoundNewKeyAnswer)
+{
+
+    bool    bResult = false;
+
+    if ((bResult = (0 != p_pSRVAnswer)))
     {
-        bool bResult = false;
+        // eg. MyESP._http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
 
-        if ((bResult = (0 != p_pSRVAnswer)))
+        stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
+        while (pServiceQuery)
         {
-            // eg. MyESP._http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
-
-            stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
-            while (pServiceQuery)
+            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pSRVAnswer->m_Header.m_Domain);
+            if (pSQAnswer)      // Answer for this service domain (eg. MyESP._http._tcp.local) available
             {
-                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pSRVAnswer->m_Header.m_Domain);
-                if (pSQAnswer)  // Answer for this service domain (eg. MyESP._http._tcp.local) available
+                if (p_pSRVAnswer->m_u32TTL)     // First or update message (TTL != 0)
                 {
-                    if (p_pSRVAnswer->m_u32TTL)  // First or update message (TTL != 0)
+                    pSQAnswer->m_TTLHostDomainAndPort.set(p_pSRVAnswer->m_u32TTL);    // Update TTL tag
+                    DEBUG_EX_INFO(
+                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: Updated TTL(%d) for "), (int)p_pSRVAnswer->m_u32TTL);
+                        _printRRDomain(pSQAnswer->m_ServiceDomain);
+                        DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
+                    );
+                    // Host domain & Port
+                    if ((pSQAnswer->m_HostDomain != p_pSRVAnswer->m_SRVDomain) ||
+                            (pSQAnswer->m_u16Port != p_pSRVAnswer->m_u16Port))
                     {
-                        pSQAnswer->m_TTLHostDomainAndPort.set(p_pSRVAnswer->m_u32TTL);  // Update TTL tag
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: Updated TTL(%d) for "), (int)p_pSRVAnswer->m_u32TTL);
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")););
-                        // Host domain & Port
-                        if ((pSQAnswer->m_HostDomain != p_pSRVAnswer->m_SRVDomain) || (pSQAnswer->m_u16Port != p_pSRVAnswer->m_u16Port))
-                        {
-                            pSQAnswer->m_HostDomain = p_pSRVAnswer->m_SRVDomain;
-                            pSQAnswer->releaseHostDomain();
-                            pSQAnswer->m_u16Port = p_pSRVAnswer->m_u16Port;
-                            pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_HostDomainAndPort;
 
-                            p_rbFoundNewKeyAnswer = true;
-                            if (pServiceQuery->m_fnCallback)
-                            {
-                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_HostDomainAndPort), true);
-                            }
+                        pSQAnswer->m_HostDomain = p_pSRVAnswer->m_SRVDomain;
+                        pSQAnswer->releaseHostDomain();
+                        pSQAnswer->m_u16Port = p_pSRVAnswer->m_u16Port;
+                        pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_HostDomainAndPort;
+
+                        p_rbFoundNewKeyAnswer = true;
+                        if (pServiceQuery->m_fnCallback)
+                        {
+                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_HostDomainAndPort), true);
                         }
                     }
-                    else  // Goodby message
-                    {
-                        pSQAnswer->m_TTLHostDomainAndPort.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: 'Goodbye' received for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")););
-                    }
                 }
-                pServiceQuery = pServiceQuery->m_pNext;
-            }  // while(service query)
-        }      // else: No p_pSRVAnswer
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: FAILED!\n"));
-                     });
-        return bResult;
-    }
+                else                        // Goodby message
+                {
+                    pSQAnswer->m_TTLHostDomainAndPort.prepareDeletion();    // Prepare answer deletion according to RFC 6762, 10.1
+                    DEBUG_EX_INFO(
+                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: 'Goodbye' received for "));
+                        _printRRDomain(pSQAnswer->m_ServiceDomain);
+                        DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
+                    );
+                }
+            }
+            pServiceQuery = pServiceQuery->m_pNext;
+        }   // while(service query)
+    }   // else: No p_pSRVAnswer
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_processTXTAnswer
 */
-    bool MDNSResponder::_processTXTAnswer(const MDNSResponder::stcMDNS_RRAnswerTXT* p_pTXTAnswer)
+bool MDNSResponder::_processTXTAnswer(const MDNSResponder::stcMDNS_RRAnswerTXT* p_pTXTAnswer)
+{
+
+    bool    bResult = false;
+
+    if ((bResult = (0 != p_pTXTAnswer)))
     {
-        bool bResult = false;
+        // eg. MyESP._http._tcp.local TXT xxxx xx c#=1
 
-        if ((bResult = (0 != p_pTXTAnswer)))
+        stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
+        while (pServiceQuery)
         {
-            // eg. MyESP._http._tcp.local TXT xxxx xx c#=1
-
-            stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
-            while (pServiceQuery)
+            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pTXTAnswer->m_Header.m_Domain);
+            if (pSQAnswer)      // Answer for this service domain (eg. MyESP._http._tcp.local) available
             {
-                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pTXTAnswer->m_Header.m_Domain);
-                if (pSQAnswer)  // Answer for this service domain (eg. MyESP._http._tcp.local) available
+                if (p_pTXTAnswer->m_u32TTL)     // First or update message
                 {
-                    if (p_pTXTAnswer->m_u32TTL)  // First or update message
+                    pSQAnswer->m_TTLTxts.set(p_pTXTAnswer->m_u32TTL); // Update TTL tag
+                    DEBUG_EX_INFO(
+                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: Updated TTL(%d) for "), (int)p_pTXTAnswer->m_u32TTL);
+                        _printRRDomain(pSQAnswer->m_ServiceDomain);
+                        DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
+                    );
+                    if (!pSQAnswer->m_Txts.compare(p_pTXTAnswer->m_Txts))
                     {
-                        pSQAnswer->m_TTLTxts.set(p_pTXTAnswer->m_u32TTL);  // Update TTL tag
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: Updated TTL(%d) for "), (int)p_pTXTAnswer->m_u32TTL);
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")););
-                        if (!pSQAnswer->m_Txts.compare(p_pTXTAnswer->m_Txts))
-                        {
-                            pSQAnswer->m_Txts = p_pTXTAnswer->m_Txts;
-                            pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_Txts;
-                            pSQAnswer->releaseTxts();
+                        pSQAnswer->m_Txts = p_pTXTAnswer->m_Txts;
+                        pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_Txts;
+                        pSQAnswer->releaseTxts();
 
-                            if (pServiceQuery->m_fnCallback)
-                            {
-                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), true);
-                            }
+                        if (pServiceQuery->m_fnCallback)
+                        {
+                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), true);
                         }
                     }
-                    else  // Goodby message
-                    {
-                        pSQAnswer->m_TTLTxts.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: 'Goodbye' received for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")););
-                    }
                 }
-                pServiceQuery = pServiceQuery->m_pNext;
-            }  // while(service query)
-        }      // else: No p_pTXTAnswer
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: FAILED!\n"));
-                     });
-        return bResult;
-    }
+                else                        // Goodby message
+                {
+                    pSQAnswer->m_TTLTxts.prepareDeletion(); // Prepare answer deletion according to RFC 6762, 10.1
+                    DEBUG_EX_INFO(
+                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: 'Goodbye' received for "));
+                        _printRRDomain(pSQAnswer->m_ServiceDomain);
+                        DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
+                    );
+                }
+            }
+            pServiceQuery = pServiceQuery->m_pNext;
+        }   // while(service query)
+    }   // else: No p_pTXTAnswer
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: FAILED!\n"));
+    });
+    return bResult;
+}
 
 #ifdef MDNS_IP4_SUPPORT
-    /*
+/*
     MDNSResponder::_processAAnswer
 */
-    bool MDNSResponder::_processAAnswer(const MDNSResponder::stcMDNS_RRAnswerA* p_pAAnswer)
+bool MDNSResponder::_processAAnswer(const MDNSResponder::stcMDNS_RRAnswerA* p_pAAnswer)
+{
+
+    bool    bResult = false;
+
+    if ((bResult = (0 != p_pAAnswer)))
     {
-        bool bResult = false;
+        // eg. esp8266.local A xxxx xx 192.168.2.120
 
-        if ((bResult = (0 != p_pAAnswer)))
+        stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
+        while (pServiceQuery)
         {
-            // eg. esp8266.local A xxxx xx 192.168.2.120
-
-            stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
-            while (pServiceQuery)
+            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAnswer->m_Header.m_Domain);
+            if (pSQAnswer)      // Answer for this host domain (eg. esp8266.local) available
             {
-                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAnswer->m_Header.m_Domain);
-                if (pSQAnswer)  // Answer for this host domain (eg. esp8266.local) available
+                stcMDNSServiceQuery::stcAnswer::stcIP4Address*  pIP4Address = pSQAnswer->findIP4Address(p_pAAnswer->m_IPAddress);
+                if (pIP4Address)
                 {
-                    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = pSQAnswer->findIP4Address(p_pAAnswer->m_IPAddress);
-                    if (pIP4Address)
+                    // Already known IP4 address
+                    if (p_pAAnswer->m_u32TTL)   // Valid TTL -> Update answers TTL
                     {
-                        // Already known IP4 address
-                        if (p_pAAnswer->m_u32TTL)  // Valid TTL -> Update answers TTL
-                        {
-                            pIP4Address->m_TTL.set(p_pAAnswer->m_u32TTL);
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%d) for "), (int)p_pAAnswer->m_u32TTL);
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" IP4Address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str()););
-                        }
-                        else  // 'Goodbye' message for known IP4 address
-                        {
-                            pIP4Address->m_TTL.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str()););
-                        }
+                        pIP4Address->m_TTL.set(p_pAAnswer->m_u32TTL);
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%d) for "), (int)p_pAAnswer->m_u32TTL);
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" IP4Address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str());
+                        );
                     }
-                    else
+                    else                        // 'Goodbye' message for known IP4 address
                     {
-                        // Until now unknown IP4 address -> Add (if the message isn't just a 'Goodbye' note)
-                        if (p_pAAnswer->m_u32TTL)  // NOT just a 'Goodbye' message
+                        pIP4Address->m_TTL.prepareDeletion();   // Prepare answer deletion according to RFC 6762, 10.1
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str());
+                        );
+                    }
+                }
+                else
+                {
+                    // Until now unknown IP4 address -> Add (if the message isn't just a 'Goodbye' note)
+                    if (p_pAAnswer->m_u32TTL)   // NOT just a 'Goodbye' message
+                    {
+                        pIP4Address = new stcMDNSServiceQuery::stcAnswer::stcIP4Address(p_pAAnswer->m_IPAddress, p_pAAnswer->m_u32TTL);
+                        if ((pIP4Address) &&
+                                (pSQAnswer->addIP4Address(pIP4Address)))
                         {
-                            pIP4Address = new stcMDNSServiceQuery::stcAnswer::stcIP4Address(p_pAAnswer->m_IPAddress, p_pAAnswer->m_u32TTL);
-                            if ((pIP4Address) && (pSQAnswer->addIP4Address(pIP4Address)))
-                            {
-                                pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
-                                if (pServiceQuery->m_fnCallback)
-                                {
-                                    MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                    pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), true);
-                                }
-                            }
-                            else
+
+                            pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
+                            if (pServiceQuery->m_fnCallback)
                             {
-                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP4 address (%s)!\n"), p_pAAnswer->m_IPAddress.toString().c_str()););
+                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), true);
                             }
                         }
+                        else
+                        {
+                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP4 address (%s)!\n"), p_pAAnswer->m_IPAddress.toString().c_str()););
+                        }
                     }
                 }
-                pServiceQuery = pServiceQuery->m_pNext;
-            }  // while(service query)
-        }      // else: No p_pAAnswer
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED!\n"));
-                     });
-        return bResult;
-    }
+            }
+            pServiceQuery = pServiceQuery->m_pNext;
+        }   // while(service query)
+    }   // else: No p_pAAnswer
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED!\n"));
+    });
+    return bResult;
+}
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-    /*
+/*
     MDNSResponder::_processAAAAAnswer
 */
-    bool MDNSResponder::_processAAAAAnswer(const MDNSResponder::stcMDNS_RRAnswerAAAA* p_pAAAAAnswer)
+bool MDNSResponder::_processAAAAAnswer(const MDNSResponder::stcMDNS_RRAnswerAAAA* p_pAAAAAnswer)
+{
+
+    bool    bResult = false;
+
+    if ((bResult = (0 != p_pAAAAAnswer)))
     {
-        bool bResult = false;
+        // eg. esp8266.local AAAA xxxx xx 0bf3::0c
 
-        if ((bResult = (0 != p_pAAAAAnswer)))
+        stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
+        while (pServiceQuery)
         {
-            // eg. esp8266.local AAAA xxxx xx 0bf3::0c
-
-            stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
-            while (pServiceQuery)
+            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAAAAnswer->m_Header.m_Domain);
+            if (pSQAnswer)      // Answer for this host domain (eg. esp8266.local) available
             {
-                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAAAAnswer->m_Header.m_Domain);
-                if (pSQAnswer)  // Answer for this host domain (eg. esp8266.local) available
+                stcIP6Address*  pIP6Address = pSQAnswer->findIP6Address(p_pAAAAAnswer->m_IPAddress);
+                if (pIP6Address)
                 {
-                    stcIP6Address* pIP6Address = pSQAnswer->findIP6Address(p_pAAAAAnswer->m_IPAddress);
-                    if (pIP6Address)
+                    // Already known IP6 address
+                    if (p_pAAAAAnswer->m_u32TTL)   // Valid TTL -> Update answers TTL
                     {
-                        // Already known IP6 address
-                        if (p_pAAAAAnswer->m_u32TTL)  // Valid TTL -> Update answers TTL
-                        {
-                            pIP6Address->m_TTL.set(p_pAAAAAnswer->m_u32TTL);
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%lu) for "), p_pAAAAAnswer->m_u32TTL);
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str()););
-                        }
-                        else  // 'Goodbye' message for known IP6 address
-                        {
-                            pIP6Address->m_TTL.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str()););
-                        }
+                        pIP6Address->m_TTL.set(p_pAAAAAnswer->m_u32TTL);
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%lu) for "), p_pAAAAAnswer->m_u32TTL);
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str());
+                        );
                     }
-                    else
+                    else                        // 'Goodbye' message for known IP6 address
                     {
-                        // Until now unknown IP6 address -> Add (if the message isn't just a 'Goodbye' note)
-                        if (p_pAAAAAnswer->m_u32TTL)  // NOT just a 'Goodbye' message
+                        pIP6Address->m_TTL.prepareDeletion();   // Prepare answer deletion according to RFC 6762, 10.1
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str());
+                        );
+                    }
+                }
+                else
+                {
+                    // Until now unknown IP6 address -> Add (if the message isn't just a 'Goodbye' note)
+                    if (p_pAAAAAnswer->m_u32TTL)   // NOT just a 'Goodbye' message
+                    {
+                        pIP6Address = new stcIP6Address(p_pAAAAAnswer->m_IPAddress, p_pAAAAAnswer->m_u32TTL);
+                        if ((pIP6Address) &&
+                                (pSQAnswer->addIP6Address(pIP6Address)))
                         {
-                            pIP6Address = new stcIP6Address(p_pAAAAAnswer->m_IPAddress, p_pAAAAAnswer->m_u32TTL);
-                            if ((pIP6Address) && (pSQAnswer->addIP6Address(pIP6Address)))
-                            {
-                                pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP6Address;
 
-                                if (pServiceQuery->m_fnCallback)
-                                {
-                                    pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, true, pServiceQuery->m_pUserdata);
-                                }
-                            }
-                            else
+                            pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP6Address;
+
+                            if (pServiceQuery->m_fnCallback)
                             {
-                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP6 address (%s)!\n"), p_pAAAAAnswer->m_IPAddress.toString().c_str()););
+                                pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, true, pServiceQuery->m_pUserdata);
                             }
                         }
+                        else
+                        {
+                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP6 address (%s)!\n"), p_pAAAAAnswer->m_IPAddress.toString().c_str()););
+                        }
                     }
                 }
-                pServiceQuery = pServiceQuery->m_pNext;
-            }  // while(service query)
-        }      // else: No p_pAAAAAnswer
+            }
+            pServiceQuery = pServiceQuery->m_pNext;
+        }   // while(service query)
+    }   // else: No p_pAAAAAnswer
 
-        return bResult;
-    }
+    return bResult;
+}
 #endif
 
-    /*
+
+/*
     PROBING
 */
 
-    /*
+/*
     MDNSResponder::_updateProbeStatus
 
     Manages the (outgoing) probing process.
@@ -1128,130 +1207,138 @@ namespace MDNSImplementation
     Conflict management is handled in '_parseResponse ff.'
     Tiebraking is handled in 'parseQuery ff.'
 */
-    bool MDNSResponder::_updateProbeStatus(void)
+bool MDNSResponder::_updateProbeStatus(void)
+{
+
+    bool    bResult = true;
+
+    //
+    // Probe host domain
+    if (ProbingStatus_ReadyToStart == m_HostProbeInformation.m_ProbingStatus)
     {
-        bool bResult = true;
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Starting host probing...\n")););
 
-        //
-        // Probe host domain
-        if (ProbingStatus_ReadyToStart == m_HostProbeInformation.m_ProbingStatus)
-        {
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Starting host probing...\n")););
+        // First probe delay SHOULD be random 0-250 ms
+        m_HostProbeInformation.m_Timeout.reset(rand() % MDNS_PROBE_DELAY);
+        m_HostProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
+    }
+    else if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&                // Probing AND
+             (m_HostProbeInformation.m_Timeout.expired()))                                          // Time for next probe
+    {
 
-            // First probe delay SHOULD be random 0-250 ms
-            m_HostProbeInformation.m_Timeout.reset(rand() % MDNS_PROBE_DELAY);
-            m_HostProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
-        }
-        else if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing AND
-                 (m_HostProbeInformation.m_Timeout.expired()))                            // Time for next probe
+        if (MDNS_PROBE_COUNT > m_HostProbeInformation.m_u8SentCount)                                // Send next probe
         {
-            if (MDNS_PROBE_COUNT > m_HostProbeInformation.m_u8SentCount)  // Send next probe
+            if ((bResult = _sendHostProbe()))
             {
-                if ((bResult = _sendHostProbe()))
-                {
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Did sent host probe\n\n")););
-                    m_HostProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);
-                    ++m_HostProbeInformation.m_u8SentCount;
-                }
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Did sent host probe\n\n")););
+                m_HostProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);
+                ++m_HostProbeInformation.m_u8SentCount;
             }
-            else  // Probing finished
+        }
+        else                                                                                        // Probing finished
+        {
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host probing.\n")););
+            m_HostProbeInformation.m_ProbingStatus = ProbingStatus_Done;
+            m_HostProbeInformation.m_Timeout.resetToNeverExpires();
+            if (m_HostProbeInformation.m_fnHostProbeResultCallback)
             {
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host probing.\n")););
-                m_HostProbeInformation.m_ProbingStatus = ProbingStatus_Done;
-                m_HostProbeInformation.m_Timeout.resetToNeverExpires();
-                if (m_HostProbeInformation.m_fnHostProbeResultCallback)
-                {
-                    m_HostProbeInformation.m_fnHostProbeResultCallback(m_pcHostname, true);
-                }
+                m_HostProbeInformation.m_fnHostProbeResultCallback(m_pcHostname, true);
+            }
 
-                // Prepare to announce host
-                m_HostProbeInformation.m_u8SentCount = 0;
+            // Prepare to announce host
+            m_HostProbeInformation.m_u8SentCount = 0;
+            m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared host announcing.\n\n")););
+        }
+    }   // else: Probing already finished OR waiting for next time slot
+    else if ((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus) &&
+             (m_HostProbeInformation.m_Timeout.expired()))
+    {
+
+        if ((bResult = _announce(true, false)))     // Don't announce services here
+        {
+            ++m_HostProbeInformation.m_u8SentCount;
+
+            if (MDNS_ANNOUNCE_COUNT > m_HostProbeInformation.m_u8SentCount)
+            {
                 m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared host announcing.\n\n")););
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing host (%d).\n\n"), m_HostProbeInformation.m_u8SentCount););
             }
-        }  // else: Probing already finished OR waiting for next time slot
-        else if ((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus) && (m_HostProbeInformation.m_Timeout.expired()))
-        {
-            if ((bResult = _announce(true, false)))  // Don't announce services here
+            else
             {
-                ++m_HostProbeInformation.m_u8SentCount;
-
-                if (MDNS_ANNOUNCE_COUNT > m_HostProbeInformation.m_u8SentCount)
-                {
-                    m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing host (%d).\n\n"), m_HostProbeInformation.m_u8SentCount););
-                }
-                else
-                {
-                    m_HostProbeInformation.m_Timeout.resetToNeverExpires();
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host announcing.\n\n")););
-                }
+                m_HostProbeInformation.m_Timeout.resetToNeverExpires();
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host announcing.\n\n")););
             }
         }
+    }
 
-        //
-        // Probe services
-        for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+    //
+    // Probe services
+    for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+    {
+        if (ProbingStatus_ReadyToStart == pService->m_ProbeInformation.m_ProbingStatus)         // Ready to get started
+        {
+
+            pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);                     // More or equal than first probe for host domain
+            pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
+        }
+        else if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing AND
+                 (pService->m_ProbeInformation.m_Timeout.expired()))               // Time for next probe
         {
-            if (ProbingStatus_ReadyToStart == pService->m_ProbeInformation.m_ProbingStatus)  // Ready to get started
+
+            if (MDNS_PROBE_COUNT > pService->m_ProbeInformation.m_u8SentCount)                  // Send next probe
             {
-                pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);  // More or equal than first probe for host domain
-                pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
+                if ((bResult = _sendServiceProbe(*pService)))
+                {
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Did sent service probe (%u)\n\n"), (pService->m_ProbeInformation.m_u8SentCount + 1)););
+                    pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);
+                    ++pService->m_ProbeInformation.m_u8SentCount;
+                }
             }
-            else if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing AND
-                     (pService->m_ProbeInformation.m_Timeout.expired()))                            // Time for next probe
+            else                                                                                        // Probing finished
             {
-                if (MDNS_PROBE_COUNT > pService->m_ProbeInformation.m_u8SentCount)  // Send next probe
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service probing %s.%s.%s\n\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_Done;
+                pService->m_ProbeInformation.m_Timeout.resetToNeverExpires();
+                if (pService->m_ProbeInformation.m_fnServiceProbeResultCallback)
                 {
-                    if ((bResult = _sendServiceProbe(*pService)))
-                    {
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Did sent service probe (%u)\n\n"), (pService->m_ProbeInformation.m_u8SentCount + 1)););
-                        pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);
-                        ++pService->m_ProbeInformation.m_u8SentCount;
-                    }
+                    pService->m_ProbeInformation.m_fnServiceProbeResultCallback(pService->m_pcName, pService, true);
                 }
-                else  // Probing finished
+                // Prepare to announce service
+                pService->m_ProbeInformation.m_u8SentCount = 0;
+                pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared service announcing.\n\n")););
+            }
+        }   // else: Probing already finished OR waiting for next time slot
+        else if ((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus) &&
+                 (pService->m_ProbeInformation.m_Timeout.expired()))
+        {
+
+            if ((bResult = _announceService(*pService)))     // Announce service
+            {
+                ++pService->m_ProbeInformation.m_u8SentCount;
+
+                if (MDNS_ANNOUNCE_COUNT > pService->m_ProbeInformation.m_u8SentCount)
                 {
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service probing %s.%s.%s\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
-                    pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_Done;
-                    pService->m_ProbeInformation.m_Timeout.resetToNeverExpires();
-                    if (pService->m_ProbeInformation.m_fnServiceProbeResultCallback)
-                    {
-                        pService->m_ProbeInformation.m_fnServiceProbeResultCallback(pService->m_pcName, pService, true);
-                    }
-                    // Prepare to announce service
-                    pService->m_ProbeInformation.m_u8SentCount = 0;
                     pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared service announcing.\n\n")););
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing service %s.%s.%s (%d)\n\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_ProbeInformation.m_u8SentCount););
                 }
-            }  // else: Probing already finished OR waiting for next time slot
-            else if ((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus) && (pService->m_ProbeInformation.m_Timeout.expired()))
-            {
-                if ((bResult = _announceService(*pService)))  // Announce service
+                else
                 {
-                    ++pService->m_ProbeInformation.m_u8SentCount;
-
-                    if (MDNS_ANNOUNCE_COUNT > pService->m_ProbeInformation.m_u8SentCount)
-                    {
-                        pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing service %s.%s.%s (%d)\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_ProbeInformation.m_u8SentCount););
-                    }
-                    else
-                    {
-                        pService->m_ProbeInformation.m_Timeout.resetToNeverExpires();
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service announcing for %s.%s.%s\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
-                    }
+                    pService->m_ProbeInformation.m_Timeout.resetToNeverExpires();
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service announcing for %s.%s.%s\n\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
                 }
             }
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: FAILED!\n\n"));
-                     });
-        return bResult;
     }
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: FAILED!\n\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_resetProbeStatus
 
     Resets the probe status.
@@ -1259,36 +1346,38 @@ namespace MDNSImplementation
     when running 'updateProbeStatus' (which is done in every '_update' loop), the probing
     process is restarted.
 */
-    bool MDNSResponder::_resetProbeStatus(bool p_bRestart /*= true*/)
-    {
-        m_HostProbeInformation.clear(false);
-        m_HostProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
+bool MDNSResponder::_resetProbeStatus(bool p_bRestart /*= true*/)
+{
 
-        for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
-        {
-            pService->m_ProbeInformation.clear(false);
-            pService->m_ProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
-        }
-        return true;
+    m_HostProbeInformation.clear(false);
+    m_HostProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
+
+    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+    {
+        pService->m_ProbeInformation.clear(false);
+        pService->m_ProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::_hasProbesWaitingForAnswers
 */
-    bool MDNSResponder::_hasProbesWaitingForAnswers(void) const
-    {
-        bool bResult = ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing
-                        (0 < m_HostProbeInformation.m_u8SentCount));                             // And really probing
+bool MDNSResponder::_hasProbesWaitingForAnswers(void) const
+{
 
-        for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
-        {
-            bResult = ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing
-                       (0 < pService->m_ProbeInformation.m_u8SentCount));                             // And really probing
-        }
-        return bResult;
+    bool    bResult = ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&      // Probing
+                       (0 < m_HostProbeInformation.m_u8SentCount));                                 // And really probing
+
+    for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
+    {
+        bResult = ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&    // Probing
+                   (0 < pService->m_ProbeInformation.m_u8SentCount));                               // And really probing
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_sendHostProbe
 
     Asks (probes) in the local network for the planned host domain
@@ -1299,48 +1388,51 @@ namespace MDNSImplementation
     Host domain:
     - A/AAAA (eg. esp8266.esp -> 192.168.2.120)
 */
-    bool MDNSResponder::_sendHostProbe(void)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe (%s, %lu)\n"), m_pcHostname, millis()););
+bool MDNSResponder::_sendHostProbe(void)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe (%s, %lu)\n"), m_pcHostname, millis()););
 
-        bool bResult = true;
+    bool    bResult = true;
 
-        // Requests for host domain
-        stcMDNSSendParameter sendParameter;
-        sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
+    // Requests for host domain
+    stcMDNSSendParameter    sendParameter;
+    sendParameter.m_bCacheFlush = false;    // RFC 6762 10.2
 
-        sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
-        if (((bResult = (0 != sendParameter.m_pQuestions))) && ((bResult = _buildDomainForHost(m_pcHostname, sendParameter.m_pQuestions->m_Header.m_Domain))))
-        {
-            //sendParameter.m_pQuestions->m_bUnicast = true;
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type  = DNS_RRTYPE_ANY;
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
+    sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
+    if (((bResult = (0 != sendParameter.m_pQuestions))) &&
+            ((bResult = _buildDomainForHost(m_pcHostname, sendParameter.m_pQuestions->m_Header.m_Domain))))
+    {
 
-            // Add known answers
+        //sendParameter.m_pQuestions->m_bUnicast = true;
+        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY;
+        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);   // Unicast & INternet
+
+        // Add known answers
 #ifdef MDNS_IP4_SUPPORT
-            sendParameter.m_u8HostReplyMask |= ContentFlag_A;  // Add A answer
+        sendParameter.m_u8HostReplyMask |= ContentFlag_A;                                   // Add A answer
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;  // Add AAAA answer
+        sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;                                // Add AAAA answer
 #endif
-        }
-        else
+    }
+    else
+    {
+        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED to create host question!\n")););
+        if (sendParameter.m_pQuestions)
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED to create host question!\n")););
-            if (sendParameter.m_pQuestions)
-            {
-                delete sendParameter.m_pQuestions;
-                sendParameter.m_pQuestions = 0;
-            }
+            delete sendParameter.m_pQuestions;
+            sendParameter.m_pQuestions = 0;
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED!\n"));
-                     });
-        return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED!\n"));
+    });
+    return ((bResult) &&
+            (_sendMDNSMessage(sendParameter)));
+}
 
-    /*
+/*
     MDNSResponder::_sendServiceProbe
 
     Asks (probes) in the local network for the planned service instance domain
@@ -1352,87 +1444,94 @@ namespace MDNSImplementation
     - SRV (eg. MyESP._http._tcp.local -> 5000 esp8266.local)
     - PTR NAME (eg. _http._tcp.local -> MyESP._http._tcp.local) (TODO: Check if needed, maybe TXT is better)
 */
-    bool MDNSResponder::_sendServiceProbe(stcMDNSService& p_rService)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe (%s.%s.%s, %lu)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, millis()););
+bool MDNSResponder::_sendServiceProbe(stcMDNSService& p_rService)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe (%s.%s.%s, %lu)\n"), (p_rService.m_pcName ? : m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, millis()););
 
-        bool bResult = true;
+    bool    bResult = true;
 
-        // Requests for service instance domain
-        stcMDNSSendParameter sendParameter;
-        sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
+    // Requests for service instance domain
+    stcMDNSSendParameter    sendParameter;
+    sendParameter.m_bCacheFlush = false;    // RFC 6762 10.2
 
-        sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
-        if (((bResult = (0 != sendParameter.m_pQuestions))) && ((bResult = _buildDomainForService(p_rService, true, sendParameter.m_pQuestions->m_Header.m_Domain))))
-        {
-            sendParameter.m_pQuestions->m_bUnicast                       = true;
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type  = DNS_RRTYPE_ANY;
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
+    sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
+    if (((bResult = (0 != sendParameter.m_pQuestions))) &&
+            ((bResult = _buildDomainForService(p_rService, true, sendParameter.m_pQuestions->m_Header.m_Domain))))
+    {
 
-            // Add known answers
-            p_rService.m_u8ReplyMask = (ContentFlag_SRV | ContentFlag_PTR_NAME);  // Add SRV and PTR NAME answers
-        }
-        else
+        sendParameter.m_pQuestions->m_bUnicast = true;
+        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY;
+        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);   // Unicast & INternet
+
+        // Add known answers
+        p_rService.m_u8ReplyMask = (ContentFlag_SRV | ContentFlag_PTR_NAME);                // Add SRV and PTR NAME answers
+    }
+    else
+    {
+        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED to create service question!\n")););
+        if (sendParameter.m_pQuestions)
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED to create service question!\n")););
-            if (sendParameter.m_pQuestions)
-            {
-                delete sendParameter.m_pQuestions;
-                sendParameter.m_pQuestions = 0;
-            }
+            delete sendParameter.m_pQuestions;
+            sendParameter.m_pQuestions = 0;
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED!\n"));
-                     });
-        return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED!\n"));
+    });
+    return ((bResult) &&
+            (_sendMDNSMessage(sendParameter)));
+}
 
-    /*
+/*
     MDNSResponder::_cancelProbingForHost
 */
-    bool MDNSResponder::_cancelProbingForHost(void)
-    {
-        bool bResult = false;
+bool MDNSResponder::_cancelProbingForHost(void)
+{
 
-        m_HostProbeInformation.clear(false);
-        // Send host notification
-        if (m_HostProbeInformation.m_fnHostProbeResultCallback)
-        {
-            m_HostProbeInformation.m_fnHostProbeResultCallback(m_pcHostname, false);
+    bool    bResult = false;
+
+    m_HostProbeInformation.clear(false);
+    // Send host notification
+    if (m_HostProbeInformation.m_fnHostProbeResultCallback)
+    {
+        m_HostProbeInformation.m_fnHostProbeResultCallback(m_pcHostname, false);
 
-            bResult = true;
-        }
+        bResult = true;
+    }
 
-        for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
-        {
-            bResult = _cancelProbingForService(*pService);
-        }
-        return bResult;
+    for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
+    {
+        bResult = _cancelProbingForService(*pService);
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_cancelProbingForService
 */
-    bool MDNSResponder::_cancelProbingForService(stcMDNSService& p_rService)
-    {
-        bool bResult = false;
+bool MDNSResponder::_cancelProbingForService(stcMDNSService& p_rService)
+{
 
-        p_rService.m_ProbeInformation.clear(false);
-        // Send notification
-        if (p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback)
-        {
-            p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback(p_rService.m_pcName, &p_rService, false);
-            bResult = true;
-        }
-        return bResult;
+    bool    bResult = false;
+
+    p_rService.m_ProbeInformation.clear(false);
+    // Send notification
+    if (p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback)
+    {
+        p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback(p_rService.m_pcName, &p_rService, false);
+        bResult = true;
     }
+    return bResult;
+}
+
+
 
-    /**
+/**
     ANNOUNCING
 */
 
-    /*
+/*
     MDNSResponder::_announce
 
     Announces the host domain:
@@ -1449,108 +1548,116 @@ namespace MDNSImplementation
     Goodbye messages are created by setting the TTL for the answer to 0, this happens
     inside the '_writeXXXAnswer' procs via 'sendParameter.m_bUnannounce = true'
 */
-    bool MDNSResponder::_announce(bool p_bAnnounce,
-                                  bool p_bIncludeServices)
+bool MDNSResponder::_announce(bool p_bAnnounce,
+                              bool p_bIncludeServices)
+{
+
+    bool    bResult = false;
+
+    stcMDNSSendParameter    sendParameter;
+    if (ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus)
     {
-        bool bResult = false;
 
-        stcMDNSSendParameter sendParameter;
-        if (ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus)
-        {
-            bResult = true;
+        bResult = true;
 
-            sendParameter.m_bResponse    = true;  // Announces are 'Unsolicited authoritative responses'
-            sendParameter.m_bAuthorative = true;
-            sendParameter.m_bUnannounce  = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
+        sendParameter.m_bResponse = true;           // Announces are 'Unsolicited authoritative responses'
+        sendParameter.m_bAuthorative = true;
+        sendParameter.m_bUnannounce = !p_bAnnounce; // When unannouncing, the TTL is set to '0' while creating the answers
 
-            // Announce host
-            sendParameter.m_u8HostReplyMask = 0;
+        // Announce host
+        sendParameter.m_u8HostReplyMask = 0;
 #ifdef MDNS_IP4_SUPPORT
-            sendParameter.m_u8HostReplyMask |= ContentFlag_A;        // A answer
-            sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP4;  // PTR_IP4 answer
+        sendParameter.m_u8HostReplyMask |= ContentFlag_A;                   // A answer
+        sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP4;             // PTR_IP4 answer
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;     // AAAA answer
-            sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP6;  // PTR_IP6 answer
+        sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;                // AAAA answer
+        sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP6;             // PTR_IP6 answer
 #endif
 
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing host %s (content 0x%X)\n"), m_pcHostname, sendParameter.m_u8HostReplyMask););
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing host %s (content 0x%X)\n"), m_pcHostname, sendParameter.m_u8HostReplyMask););
 
-            if (p_bIncludeServices)
+        if (p_bIncludeServices)
+        {
+            // Announce services (service type, name, SRV (location) and TXTs)
+            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
             {
-                // Announce services (service type, name, SRV (location) and TXTs)
-                for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+                if (ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus)
                 {
-                    if (ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus)
-                    {
-                        pService->m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
+                    pService->m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
 
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing service %s.%s.%s (content %u)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_u8ReplyMask););
-                    }
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing service %s.%s.%s (content %u)\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_u8ReplyMask););
                 }
             }
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: FAILED!\n"));
-                     });
-        return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: FAILED!\n"));
+    });
+    return ((bResult) &&
+            (_sendMDNSMessage(sendParameter)));
+}
 
-    /*
+/*
     MDNSResponder::_announceService
 */
-    bool MDNSResponder::_announceService(stcMDNSService& p_rService,
-                                         bool            p_bAnnounce /*= true*/)
+bool MDNSResponder::_announceService(stcMDNSService& p_rService,
+                                     bool p_bAnnounce /*= true*/)
+{
+
+    bool    bResult = false;
+
+    stcMDNSSendParameter    sendParameter;
+    if (ProbingStatus_Done == p_rService.m_ProbeInformation.m_ProbingStatus)
     {
-        bool bResult = false;
 
-        stcMDNSSendParameter sendParameter;
-        if (ProbingStatus_Done == p_rService.m_ProbeInformation.m_ProbingStatus)
-        {
-            sendParameter.m_bResponse    = true;  // Announces are 'Unsolicited authoritative responses'
-            sendParameter.m_bAuthorative = true;
-            sendParameter.m_bUnannounce  = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
+        sendParameter.m_bResponse = true;           // Announces are 'Unsolicited authoritative responses'
+        sendParameter.m_bAuthorative = true;
+        sendParameter.m_bUnannounce = !p_bAnnounce; // When unannouncing, the TTL is set to '0' while creating the answers
 
-            // DON'T announce host
-            sendParameter.m_u8HostReplyMask = 0;
+        // DON'T announce host
+        sendParameter.m_u8HostReplyMask = 0;
 
-            // Announce services (service type, name, SRV (location) and TXTs)
-            p_rService.m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: Announcing service %s.%s.%s (content 0x%X)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, p_rService.m_u8ReplyMask););
+        // Announce services (service type, name, SRV (location) and TXTs)
+        p_rService.m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: Announcing service %s.%s.%s (content 0x%X)\n"), (p_rService.m_pcName ? : m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, p_rService.m_u8ReplyMask););
 
-            bResult = true;
-        }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: FAILED!\n"));
-                     });
-        return ((bResult) && (_sendMDNSMessage(sendParameter)));
+        bResult = true;
     }
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: FAILED!\n"));
+    });
+    return ((bResult) &&
+            (_sendMDNSMessage(sendParameter)));
+}
 
-    /**
+
+/**
     SERVICE QUERY CACHE
 */
 
-    /*
+/*
     MDNSResponder::_hasServiceQueriesWaitingForAnswers
 */
-    bool MDNSResponder::_hasServiceQueriesWaitingForAnswers(void) const
-    {
-        bool bOpenQueries = false;
+bool MDNSResponder::_hasServiceQueriesWaitingForAnswers(void) const
+{
 
-        for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; pServiceQuery; pServiceQuery = pServiceQuery->m_pNext)
+    bool    bOpenQueries = false;
+
+    for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; pServiceQuery; pServiceQuery = pServiceQuery->m_pNext)
+    {
+        if (pServiceQuery->m_bAwaitingAnswers)
         {
-            if (pServiceQuery->m_bAwaitingAnswers)
-            {
-                bOpenQueries = true;
-                break;
-            }
+            bOpenQueries = true;
+            break;
         }
-        return bOpenQueries;
     }
+    return bOpenQueries;
+}
 
-    /*
+/*
     MDNSResponder::_checkServiceQueryCache
 
     For any 'living' service query (m_bAwaitingAnswers == true) all available answers (their components)
@@ -1559,268 +1666,312 @@ namespace MDNSImplementation
     When no update arrived (in time), the component is removed from the answer (cache).
 
 */
-    bool MDNSResponder::_checkServiceQueryCache(void)
+bool MDNSResponder::_checkServiceQueryCache(void)
+{
+
+    bool        bResult = true;
+
+    DEBUG_EX_INFO(
+        bool    printedInfo = false;
+    );
+    for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; ((bResult) && (pServiceQuery)); pServiceQuery = pServiceQuery->m_pNext)
     {
-        bool bResult = true;
 
-        DEBUG_EX_INFO(
-            bool printedInfo = false;);
-        for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; ((bResult) && (pServiceQuery)); pServiceQuery = pServiceQuery->m_pNext)
+        //
+        // Resend dynamic service queries, if not already done often enough
+        if ((!pServiceQuery->m_bLegacyQuery) &&
+                (MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount) &&
+                (pServiceQuery->m_ResendTimeout.expired()))
         {
-            //
-            // Resend dynamic service queries, if not already done often enough
-            if ((!pServiceQuery->m_bLegacyQuery) && (MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount) && (pServiceQuery->m_ResendTimeout.expired()))
+
+            if ((bResult = _sendMDNSServiceQuery(*pServiceQuery)))
             {
-                if ((bResult = _sendMDNSServiceQuery(*pServiceQuery)))
-                {
-                    ++pServiceQuery->m_u8SentCount;
-                    pServiceQuery->m_ResendTimeout.reset((MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount)
-                                                             ? (MDNS_DYNAMIC_QUERY_RESEND_DELAY * (pServiceQuery->m_u8SentCount - 1))
-                                                             : esp8266::polledTimeout::oneShotMs::neverExpires);
-                }
-                DEBUG_EX_INFO(
-                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: %s to resend service query!"), (bResult ? "Succeeded" : "FAILED"));
-                    printedInfo = true;);
+                ++pServiceQuery->m_u8SentCount;
+                pServiceQuery->m_ResendTimeout.reset((MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount)
+                                                     ? (MDNS_DYNAMIC_QUERY_RESEND_DELAY * (pServiceQuery->m_u8SentCount - 1))
+                                                     : esp8266::polledTimeout::oneShotMs::neverExpires);
             }
+            DEBUG_EX_INFO(
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: %s to resend service query!"), (bResult ? "Succeeded" : "FAILED"));
+                printedInfo = true;
+            );
+        }
 
-            //
-            // Schedule updates for cached answers
-            if (pServiceQuery->m_bAwaitingAnswers)
+        //
+        // Schedule updates for cached answers
+        if (pServiceQuery->m_bAwaitingAnswers)
+        {
+            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->m_pAnswers;
+            while ((bResult) &&
+                    (pSQAnswer))
             {
-                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->m_pAnswers;
-                while ((bResult) && (pSQAnswer))
+                stcMDNSServiceQuery::stcAnswer* pNextSQAnswer = pSQAnswer->m_pNext;
+
+                // 1. level answer
+                if ((bResult) &&
+                        (pSQAnswer->m_TTLServiceDomain.flagged()))
                 {
-                    stcMDNSServiceQuery::stcAnswer* pNextSQAnswer = pSQAnswer->m_pNext;
 
-                    // 1. level answer
-                    if ((bResult) && (pSQAnswer->m_TTLServiceDomain.flagged()))
+                    if (!pSQAnswer->m_TTLServiceDomain.finalTimeoutLevel())
                     {
-                        if (!pSQAnswer->m_TTLServiceDomain.finalTimeoutLevel())
+
+                        bResult = ((_sendMDNSServiceQuery(*pServiceQuery)) &&
+                                   (pSQAnswer->m_TTLServiceDomain.restart()));
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: PTR update scheduled for "));
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" %s\n"), (bResult ? "OK" : "FAILURE"));
+                            printedInfo = true;
+                        );
+                    }
+                    else
+                    {
+                        // Timed out! -> Delete
+                        if (pServiceQuery->m_fnCallback)
                         {
-                            bResult = ((_sendMDNSServiceQuery(*pServiceQuery)) && (pSQAnswer->m_TTLServiceDomain.restart()));
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: PTR update scheduled for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" %s\n"), (bResult ? "OK" : "FAILURE"));
-                                printedInfo = true;);
+                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain), false);
                         }
-                        else
-                        {
-                            // Timed out! -> Delete
-                            if (pServiceQuery->m_fnCallback)
-                            {
-                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain), false);
-                            }
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove PTR answer for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                                printedInfo = true;);
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove PTR answer for "));
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR("\n"));
+                            printedInfo = true;
+                        );
 
-                            bResult   = pServiceQuery->removeAnswer(pSQAnswer);
-                            pSQAnswer = 0;
-                            continue;  // Don't use this answer anymore
-                        }
-                    }  // ServiceDomain flagged
+                        bResult = pServiceQuery->removeAnswer(pSQAnswer);
+                        pSQAnswer = 0;
+                        continue;   // Don't use this answer anymore
+                    }
+                }   // ServiceDomain flagged
+
+                // 2. level answers
+                // HostDomain & Port (from SRV)
+                if ((bResult) &&
+                        (pSQAnswer->m_TTLHostDomainAndPort.flagged()))
+                {
 
-                    // 2. level answers
-                    // HostDomain & Port (from SRV)
-                    if ((bResult) && (pSQAnswer->m_TTLHostDomainAndPort.flagged()))
+                    if (!pSQAnswer->m_TTLHostDomainAndPort.finalTimeoutLevel())
                     {
-                        if (!pSQAnswer->m_TTLHostDomainAndPort.finalTimeoutLevel())
-                        {
-                            bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_SRV)) && (pSQAnswer->m_TTLHostDomainAndPort.restart()));
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: SRV update scheduled for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" host domain and port %s\n"), (bResult ? "OK" : "FAILURE"));
-                                printedInfo = true;);
-                        }
-                        else
-                        {
-                            // Timed out! -> Delete
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove SRV answer for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
-                                printedInfo = true;);
-                            // Delete
-                            pSQAnswer->m_HostDomain.clear();
-                            pSQAnswer->releaseHostDomain();
-                            pSQAnswer->m_u16Port = 0;
-                            pSQAnswer->m_TTLHostDomainAndPort.set(0);
-                            uint32_t u32ContentFlags = ServiceQueryAnswerType_HostDomainAndPort;
-                            // As the host domain is the base for the IP4- and IP6Address, remove these too
+
+                        bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_SRV)) &&
+                                   (pSQAnswer->m_TTLHostDomainAndPort.restart()));
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: SRV update scheduled for "));
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" host domain and port %s\n"), (bResult ? "OK" : "FAILURE"));
+                            printedInfo = true;
+                        );
+                    }
+                    else
+                    {
+                        // Timed out! -> Delete
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove SRV answer for "));
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
+                            printedInfo = true;
+                        );
+                        // Delete
+                        pSQAnswer->m_HostDomain.clear();
+                        pSQAnswer->releaseHostDomain();
+                        pSQAnswer->m_u16Port = 0;
+                        pSQAnswer->m_TTLHostDomainAndPort.set(0);
+                        uint32_t    u32ContentFlags = ServiceQueryAnswerType_HostDomainAndPort;
+                        // As the host domain is the base for the IP4- and IP6Address, remove these too
 #ifdef MDNS_IP4_SUPPORT
-                            pSQAnswer->releaseIP4Addresses();
-                            u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
+                        pSQAnswer->releaseIP4Addresses();
+                        u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                            pSQAnswer->releaseIP6Addresses();
-                            u32ContentFlags |= ServiceQueryAnswerType_IP6Address;
+                        pSQAnswer->releaseIP6Addresses();
+                        u32ContentFlags |= ServiceQueryAnswerType_IP6Address;
 #endif
 
-                            // Remove content flags for deleted answer parts
-                            pSQAnswer->m_u32ContentFlags &= ~u32ContentFlags;
-                            if (pServiceQuery->m_fnCallback)
-                            {
-                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(u32ContentFlags), false);
-                            }
+                        // Remove content flags for deleted answer parts
+                        pSQAnswer->m_u32ContentFlags &= ~u32ContentFlags;
+                        if (pServiceQuery->m_fnCallback)
+                        {
+                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(u32ContentFlags), false);
                         }
-                    }  // HostDomainAndPort flagged
+                    }
+                }   // HostDomainAndPort flagged
+
+                // Txts (from TXT)
+                if ((bResult) &&
+                        (pSQAnswer->m_TTLTxts.flagged()))
+                {
 
-                    // Txts (from TXT)
-                    if ((bResult) && (pSQAnswer->m_TTLTxts.flagged()))
+                    if (!pSQAnswer->m_TTLTxts.finalTimeoutLevel())
+                    {
+
+                        bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_TXT)) &&
+                                   (pSQAnswer->m_TTLTxts.restart()));
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: TXT update scheduled for "));
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" TXTs %s\n"), (bResult ? "OK" : "FAILURE"));
+                            printedInfo = true;
+                        );
+                    }
+                    else
                     {
-                        if (!pSQAnswer->m_TTLTxts.finalTimeoutLevel())
+                        // Timed out! -> Delete
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove TXT answer for "));
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
+                            printedInfo = true;
+                        );
+                        // Delete
+                        pSQAnswer->m_Txts.clear();
+                        pSQAnswer->m_TTLTxts.set(0);
+
+                        // Remove content flags for deleted answer parts
+                        pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_Txts;
+
+                        if (pServiceQuery->m_fnCallback)
                         {
-                            bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_TXT)) && (pSQAnswer->m_TTLTxts.restart()));
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: TXT update scheduled for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" TXTs %s\n"), (bResult ? "OK" : "FAILURE"));
-                                printedInfo = true;);
+                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), false);
+                        }
+                    }
+                }   // TXTs flagged
+
+                // 3. level answers
+#ifdef MDNS_IP4_SUPPORT
+                // IP4Address (from A)
+                stcMDNSServiceQuery::stcAnswer::stcIP4Address*  pIP4Address = pSQAnswer->m_pIP4Addresses;
+                bool                                            bAUpdateQuerySent = false;
+                while ((pIP4Address) &&
+                        (bResult))
+                {
+
+                    stcMDNSServiceQuery::stcAnswer::stcIP4Address*  pNextIP4Address = pIP4Address->m_pNext; // Get 'next' early, as 'current' may be deleted at the end...
+
+                    if (pIP4Address->m_TTL.flagged())
+                    {
+
+                        if (!pIP4Address->m_TTL.finalTimeoutLevel())    // Needs update
+                        {
+
+                            if ((bAUpdateQuerySent) ||
+                                    ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_A))))
+                            {
+
+                                pIP4Address->m_TTL.restart();
+                                bAUpdateQuerySent = true;
+
+                                DEBUG_EX_INFO(
+                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP4 update scheduled for "));
+                                    _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                    DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), (pIP4Address->m_IPAddress.toString().c_str()));
+                                    printedInfo = true;
+                                );
+                            }
                         }
                         else
                         {
                             // Timed out! -> Delete
                             DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove TXT answer for "));
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove IP4 answer for "));
                                 _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
-                                printedInfo = true;);
-                            // Delete
-                            pSQAnswer->m_Txts.clear();
-                            pSQAnswer->m_TTLTxts.set(0);
-
-                            // Remove content flags for deleted answer parts
-                            pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_Txts;
-
+                                DEBUG_OUTPUT.printf_P(PSTR(" IP4 address\n"));
+                                printedInfo = true;
+                            );
+                            pSQAnswer->removeIP4Address(pIP4Address);
+                            if (!pSQAnswer->m_pIP4Addresses)    // NO IP4 address left -> remove content flag
+                            {
+                                pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP4Address;
+                            }
+                            // Notify client
                             if (pServiceQuery->m_fnCallback)
                             {
                                 MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), false);
+                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), false);
                             }
                         }
-                    }  // TXTs flagged
+                    }   // IP4 flagged
 
-                    // 3. level answers
-#ifdef MDNS_IP4_SUPPORT
-                    // IP4Address (from A)
-                    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address       = pSQAnswer->m_pIP4Addresses;
-                    bool                                           bAUpdateQuerySent = false;
-                    while ((pIP4Address) && (bResult))
+                    pIP4Address = pNextIP4Address;  // Next
+                }   // while
+#endif
+#ifdef MDNS_IP6_SUPPORT
+                // IP6Address (from AAAA)
+                stcMDNSServiceQuery::stcAnswer::stcIP6Address*  pIP6Address = pSQAnswer->m_pIP6Addresses;
+                bool                                            bAAAAUpdateQuerySent = false;
+                while ((pIP6Address) &&
+                        (bResult))
+                {
+
+                    stcMDNSServiceQuery::stcAnswer::stcIP6Address*  pNextIP6Address = pIP6Address->m_pNext; // Get 'next' early, as 'current' may be deleted at the end...
+
+                    if (pIP6Address->m_TTL.flagged())
                     {
-                        stcMDNSServiceQuery::stcAnswer::stcIP4Address* pNextIP4Address = pIP4Address->m_pNext;  // Get 'next' early, as 'current' may be deleted at the end...
 
-                        if (pIP4Address->m_TTL.flagged())
+                        if (!pIP6Address->m_TTL.finalTimeoutLevel())    // Needs update
                         {
-                            if (!pIP4Address->m_TTL.finalTimeoutLevel())  // Needs update
-                            {
-                                if ((bAUpdateQuerySent) || ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_A))))
-                                {
-                                    pIP4Address->m_TTL.restart();
-                                    bAUpdateQuerySent = true;
-
-                                    DEBUG_EX_INFO(
-                                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP4 update scheduled for "));
-                                        _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                        DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), (pIP4Address->m_IPAddress.toString().c_str()));
-                                        printedInfo = true;);
-                                }
-                            }
-                            else
+
+                            if ((bAAAAUpdateQuerySent) ||
+                                    ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_AAAA))))
                             {
-                                // Timed out! -> Delete
+
+                                pIP6Address->m_TTL.restart();
+                                bAAAAUpdateQuerySent = true;
+
                                 DEBUG_EX_INFO(
-                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove IP4 answer for "));
+                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP6 update scheduled for "));
                                     _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                    DEBUG_OUTPUT.printf_P(PSTR(" IP4 address\n"));
-                                    printedInfo = true;);
-                                pSQAnswer->removeIP4Address(pIP4Address);
-                                if (!pSQAnswer->m_pIP4Addresses)  // NO IP4 address left -> remove content flag
-                                {
-                                    pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP4Address;
-                                }
-                                // Notify client
-                                if (pServiceQuery->m_fnCallback)
-                                {
-                                    MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                    pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), false);
-                                }
+                                    DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), (pIP6Address->m_IPAddress.toString().c_str()));
+                                    printedInfo = true;
+                                );
                             }
-                        }  // IP4 flagged
-
-                        pIP4Address = pNextIP4Address;  // Next
-                    }                                   // while
-#endif
-#ifdef MDNS_IP6_SUPPORT
-                    // IP6Address (from AAAA)
-                    stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address          = pSQAnswer->m_pIP6Addresses;
-                    bool                                           bAAAAUpdateQuerySent = false;
-                    while ((pIP6Address) && (bResult))
-                    {
-                        stcMDNSServiceQuery::stcAnswer::stcIP6Address* pNextIP6Address = pIP6Address->m_pNext;  // Get 'next' early, as 'current' may be deleted at the end...
-
-                        if (pIP6Address->m_TTL.flagged())
+                        }
+                        else
                         {
-                            if (!pIP6Address->m_TTL.finalTimeoutLevel())  // Needs update
+                            // Timed out! -> Delete
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove answer for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" IP6Address\n"));
+                                printedInfo = true;
+                            );
+                            pSQAnswer->removeIP6Address(pIP6Address);
+                            if (!pSQAnswer->m_pIP6Addresses)    // NO IP6 address left -> remove content flag
                             {
-                                if ((bAAAAUpdateQuerySent) || ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_AAAA))))
-                                {
-                                    pIP6Address->m_TTL.restart();
-                                    bAAAAUpdateQuerySent = true;
-
-                                    DEBUG_EX_INFO(
-                                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP6 update scheduled for "));
-                                        _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                        DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), (pIP6Address->m_IPAddress.toString().c_str()));
-                                        printedInfo = true;);
-                                }
+                                pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP6Address;
                             }
-                            else
+                            // Notify client
+                            if (pServiceQuery->m_fnCallback)
                             {
-                                // Timed out! -> Delete
-                                DEBUG_EX_INFO(
-                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove answer for "));
-                                    _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                    DEBUG_OUTPUT.printf_P(PSTR(" IP6Address\n"));
-                                    printedInfo = true;);
-                                pSQAnswer->removeIP6Address(pIP6Address);
-                                if (!pSQAnswer->m_pIP6Addresses)  // NO IP6 address left -> remove content flag
-                                {
-                                    pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP6Address;
-                                }
-                                // Notify client
-                                if (pServiceQuery->m_fnCallback)
-                                {
-                                    pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, false, pServiceQuery->m_pUserdata);
-                                }
+                                pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, false, pServiceQuery->m_pUserdata);
                             }
-                        }  // IP6 flagged
+                        }
+                    }   // IP6 flagged
 
-                        pIP6Address = pNextIP6Address;  // Next
-                    }                                   // while
+                    pIP6Address = pNextIP6Address;  // Next
+                }   // while
 #endif
-                    pSQAnswer = pNextSQAnswer;
-                }
+                pSQAnswer = pNextSQAnswer;
             }
         }
-        DEBUG_EX_INFO(
-            if (printedInfo)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("\n"));
-            });
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: FAILED!\n"));
-                     });
-        return bResult;
     }
+    DEBUG_EX_INFO(
+        if (printedInfo)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("\n"));
+    }
+    );
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+
+/*
     MDNSResponder::_replyMaskForHost
 
     Determines the relevant host answers for the given question.
@@ -1829,71 +1980,79 @@ namespace MDNSImplementation
 
     In addition, a full name match (question domain == host domain) is marked.
 */
-    uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
-                                             bool*                                  p_pbFullNameMatch /*= 0*/) const
-    {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost\n")););
+uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
+        bool* p_pbFullNameMatch /*= 0*/) const
+{
+    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost\n")););
 
-        uint8_t u8ReplyMask = 0;
-        (p_pbFullNameMatch ? * p_pbFullNameMatch = false : 0);
+    uint8_t u8ReplyMask = 0;
+    (p_pbFullNameMatch ? *p_pbFullNameMatch = false : 0);
+
+    if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) ||
+            (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
+    {
 
-        if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) || (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
+        if ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) ||
+                (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
         {
-            if ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
-            {
-                // PTR request
+            // PTR request
 #ifdef MDNS_IP4_SUPPORT
-                stcMDNS_RRDomain reverseIP4Domain;
-                for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+            stcMDNS_RRDomain    reverseIP4Domain;
+            for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+            {
+                if (netif_is_up(pNetIf))
                 {
-                    if (netif_is_up(pNetIf))
+                    if ((_buildDomainForReverseIP4(pNetIf->ip_addr, reverseIP4Domain)) &&
+                            (p_RRHeader.m_Domain == reverseIP4Domain))
                     {
-                        if ((_buildDomainForReverseIP4(pNetIf->ip_addr, reverseIP4Domain)) && (p_RRHeader.m_Domain == reverseIP4Domain))
-                        {
-                            // Reverse domain match
-                            u8ReplyMask |= ContentFlag_PTR_IP4;
-                        }
+                        // Reverse domain match
+                        u8ReplyMask |= ContentFlag_PTR_IP4;
                     }
                 }
+            }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                // TODO
+            // TODO
 #endif
-            }  // Address qeuest
+        }   // Address qeuest
 
-            stcMDNS_RRDomain hostDomain;
-            if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (p_RRHeader.m_Domain == hostDomain))  // Host domain match
-            {
-                (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
+        stcMDNS_RRDomain    hostDomain;
+        if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
+                (p_RRHeader.m_Domain == hostDomain))    // Host domain match
+        {
+
+            (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
 
 #ifdef MDNS_IP4_SUPPORT
-                if ((DNS_RRTYPE_A == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
-                {
-                    // IP4 address request
-                    u8ReplyMask |= ContentFlag_A;
-                }
+            if ((DNS_RRTYPE_A == p_RRHeader.m_Attributes.m_u16Type) ||
+                    (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+            {
+                // IP4 address request
+                u8ReplyMask |= ContentFlag_A;
+            }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                if ((DNS_RRTYPE_AAAA == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
-                {
-                    // IP6 address request
-                    u8ReplyMask |= ContentFlag_AAAA;
-                }
-#endif
+            if ((DNS_RRTYPE_AAAA == p_RRHeader.m_Attributes.m_u16Type) ||
+                    (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+            {
+                // IP6 address request
+                u8ReplyMask |= ContentFlag_AAAA;
             }
+#endif
         }
-        else
-        {
-            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
-        }
-        DEBUG_EX_INFO(if (u8ReplyMask)
-                      {
-                          DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: 0x%X\n"), u8ReplyMask);
-                      });
-        return u8ReplyMask;
     }
+    else
+    {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
+    }
+    DEBUG_EX_INFO(if (u8ReplyMask)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: 0x%X\n"), u8ReplyMask);
+    });
+    return u8ReplyMask;
+}
 
-    /*
+/*
     MDNSResponder::_replyMaskForService
 
     Determines the relevant service answers for the given question
@@ -1905,59 +2064,69 @@ namespace MDNSImplementation
 
     In addition, a full name match (question domain == service instance domain) is marked.
 */
-    uint8_t MDNSResponder::_replyMaskForService(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
-                                                const MDNSResponder::stcMDNSService&   p_Service,
-                                                bool*                                  p_pbFullNameMatch /*= 0*/) const
+uint8_t MDNSResponder::_replyMaskForService(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
+        const MDNSResponder::stcMDNSService& p_Service,
+        bool* p_pbFullNameMatch /*= 0*/) const
+{
+
+    uint8_t u8ReplyMask = 0;
+    (p_pbFullNameMatch ? *p_pbFullNameMatch = false : 0);
+
+    if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) ||
+            (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
     {
-        uint8_t u8ReplyMask = 0;
-        (p_pbFullNameMatch ? * p_pbFullNameMatch = false : 0);
 
-        if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) || (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
+        stcMDNS_RRDomain    DNSSDDomain;
+        if ((_buildDomainForDNSSD(DNSSDDomain)) &&                          // _services._dns-sd._udp.local
+                (p_RRHeader.m_Domain == DNSSDDomain) &&
+                ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) ||
+                 (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
         {
-            stcMDNS_RRDomain DNSSDDomain;
-            if ((_buildDomainForDNSSD(DNSSDDomain)) &&  // _services._dns-sd._udp.local
-                (p_RRHeader.m_Domain == DNSSDDomain) && ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
-            {
-                // Common service info requested
-                u8ReplyMask |= ContentFlag_PTR_TYPE;
-            }
+            // Common service info requested
+            u8ReplyMask |= ContentFlag_PTR_TYPE;
+        }
 
-            stcMDNS_RRDomain serviceDomain;
-            if ((_buildDomainForService(p_Service, false, serviceDomain)) &&  // eg. _http._tcp.local
-                (p_RRHeader.m_Domain == serviceDomain) && ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
-            {
-                // Special service info requested
-                u8ReplyMask |= ContentFlag_PTR_NAME;
-            }
+        stcMDNS_RRDomain    serviceDomain;
+        if ((_buildDomainForService(p_Service, false, serviceDomain)) &&    // eg. _http._tcp.local
+                (p_RRHeader.m_Domain == serviceDomain) &&
+                ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) ||
+                 (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
+        {
+            // Special service info requested
+            u8ReplyMask |= ContentFlag_PTR_NAME;
+        }
 
-            if ((_buildDomainForService(p_Service, true, serviceDomain)) &&  // eg. MyESP._http._tcp.local
+        if ((_buildDomainForService(p_Service, true, serviceDomain)) &&     // eg. MyESP._http._tcp.local
                 (p_RRHeader.m_Domain == serviceDomain))
-            {
-                (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
+        {
 
-                if ((DNS_RRTYPE_SRV == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
-                {
-                    // Instance info SRV requested
-                    u8ReplyMask |= ContentFlag_SRV;
-                }
-                if ((DNS_RRTYPE_TXT == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
-                {
-                    // Instance info TXT requested
-                    u8ReplyMask |= ContentFlag_TXT;
-                }
+            (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
+
+            if ((DNS_RRTYPE_SRV == p_RRHeader.m_Attributes.m_u16Type) ||
+                    (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+            {
+                // Instance info SRV requested
+                u8ReplyMask |= ContentFlag_SRV;
+            }
+            if ((DNS_RRTYPE_TXT == p_RRHeader.m_Attributes.m_u16Type) ||
+                    (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+            {
+                // Instance info TXT requested
+                u8ReplyMask |= ContentFlag_TXT;
             }
         }
-        else
-        {
-            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
-        }
-        DEBUG_EX_INFO(if (u8ReplyMask)
-                      {
-                          DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService(%s.%s.%s): 0x%X\n"), p_Service.m_pcName, p_Service.m_pcService, p_Service.m_pcProtocol, u8ReplyMask);
-                      });
-        return u8ReplyMask;
     }
+    else
+    {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
+    }
+    DEBUG_EX_INFO(if (u8ReplyMask)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService(%s.%s.%s): 0x%X\n"), p_Service.m_pcName, p_Service.m_pcService, p_Service.m_pcProtocol, u8ReplyMask);
+    });
+    return u8ReplyMask;
+}
 
-}  // namespace MDNSImplementation
+} // namespace MDNSImplementation
 
-}  // namespace esp8266
+} // namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
index 7aa16df0c0..d4014db993 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
@@ -23,7 +23,7 @@
 */
 
 #include <lwip/igmp.h>
-#include <stdlib_noniso.h>  // strrstr()
+#include <stdlib_noniso.h> // strrstr()
 
 #include "ESP8266mDNS.h"
 #include "LEAmDNS_lwIPdefs.h"
@@ -31,16 +31,18 @@
 
 namespace esp8266
 {
+
 /*
     LEAmDNS
 */
 namespace MDNSImplementation
 {
-    /**
+
+/**
     HELPERS
 */
 
-    /*
+/*
     MDNSResponder::indexDomain (static)
 
     Updates the given domain 'p_rpcHostname' by appending a delimiter and an index number.
@@ -52,57 +54,37 @@ namespace MDNSImplementation
     if no default is given, 'esp8266' is used.
 
 */
-    /*static*/ bool MDNSResponder::indexDomain(char*&      p_rpcDomain,
-                                               const char* p_pcDivider /*= "-"*/,
-                                               const char* p_pcDefaultDomain /*= 0*/)
-    {
-        bool bResult = false;
+/*static*/ bool MDNSResponder::indexDomain(char*& p_rpcDomain,
+        const char* p_pcDivider /*= "-"*/,
+        const char* p_pcDefaultDomain /*= 0*/)
+{
 
-        // Ensure a divider exists; use '-' as default
-        const char* pcDivider = (p_pcDivider ?: "-");
+    bool    bResult = false;
 
-        if (p_rpcDomain)
+    // Ensure a divider exists; use '-' as default
+    const char*   pcDivider = (p_pcDivider ? : "-");
+
+    if (p_rpcDomain)
+    {
+        const char* pFoundDivider = strrstr(p_rpcDomain, pcDivider);
+        if (pFoundDivider)      // maybe already extended
         {
-            const char* pFoundDivider = strrstr(p_rpcDomain, pcDivider);
-            if (pFoundDivider)  // maybe already extended
+            char*         pEnd = 0;
+            unsigned long ulIndex = strtoul((pFoundDivider + strlen(pcDivider)), &pEnd, 10);
+            if ((ulIndex) &&
+                    ((pEnd - p_rpcDomain) == (ptrdiff_t)strlen(p_rpcDomain)) &&
+                    (!*pEnd))         // Valid (old) index found
             {
-                char*         pEnd    = 0;
-                unsigned long ulIndex = strtoul((pFoundDivider + strlen(pcDivider)), &pEnd, 10);
-                if ((ulIndex) && ((pEnd - p_rpcDomain) == (ptrdiff_t)strlen(p_rpcDomain)) && (!*pEnd))  // Valid (old) index found
-                {
-                    char acIndexBuffer[16];
-                    sprintf(acIndexBuffer, "%lu", (++ulIndex));
-                    size_t stLength     = ((pFoundDivider - p_rpcDomain + strlen(pcDivider)) + strlen(acIndexBuffer) + 1);
-                    char*  pNewHostname = new char[stLength];
-                    if (pNewHostname)
-                    {
-                        memcpy(pNewHostname, p_rpcDomain, (pFoundDivider - p_rpcDomain + strlen(pcDivider)));
-                        pNewHostname[pFoundDivider - p_rpcDomain + strlen(pcDivider)] = 0;
-                        strcat(pNewHostname, acIndexBuffer);
-
-                        delete[] p_rpcDomain;
-                        p_rpcDomain = pNewHostname;
-
-                        bResult = true;
-                    }
-                    else
-                    {
-                        DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
-                    }
-                }
-                else
-                {
-                    pFoundDivider = 0;  // Flag the need to (base) extend the hostname
-                }
-            }
 
-            if (!pFoundDivider)  // not yet extended (or failed to increment extension) -> start indexing
-            {
-                size_t stLength     = strlen(p_rpcDomain) + (strlen(pcDivider) + 1 + 1);  // Name + Divider + '2' + '\0'
-                char*  pNewHostname = new char[stLength];
+                char    acIndexBuffer[16];
+                sprintf(acIndexBuffer, "%lu", (++ulIndex));
+                size_t  stLength = ((pFoundDivider - p_rpcDomain + strlen(pcDivider)) + strlen(acIndexBuffer) + 1);
+                char*   pNewHostname = new char[stLength];
                 if (pNewHostname)
                 {
-                    sprintf(pNewHostname, "%s%s2", p_rpcDomain, pcDivider);
+                    memcpy(pNewHostname, p_rpcDomain, (pFoundDivider - p_rpcDomain + strlen(pcDivider)));
+                    pNewHostname[pFoundDivider - p_rpcDomain + strlen(pcDivider)] = 0;
+                    strcat(pNewHostname, acIndexBuffer);
 
                     delete[] p_rpcDomain;
                     p_rpcDomain = pNewHostname;
@@ -114,17 +96,23 @@ namespace MDNSImplementation
                     DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
                 }
             }
+            else
+            {
+                pFoundDivider = 0;  // Flag the need to (base) extend the hostname
+            }
         }
-        else
-        {
-            // No given host domain, use base or default
-            const char* cpcDefaultName = (p_pcDefaultDomain ?: "esp8266");
 
-            size_t stLength = strlen(cpcDefaultName) + 1;  // '\0'
-            p_rpcDomain     = new char[stLength];
-            if (p_rpcDomain)
+        if (!pFoundDivider)     // not yet extended (or failed to increment extension) -> start indexing
+        {
+            size_t    stLength = strlen(p_rpcDomain) + (strlen(pcDivider) + 1 + 1);   // Name + Divider + '2' + '\0'
+            char*     pNewHostname = new char[stLength];
+            if (pNewHostname)
             {
-                strncpy(p_rpcDomain, cpcDefaultName, stLength);
+                sprintf(pNewHostname, "%s%s2", p_rpcDomain, pcDivider);
+
+                delete[] p_rpcDomain;
+                p_rpcDomain = pNewHostname;
+
                 bResult = true;
             }
             else
@@ -132,22 +120,41 @@ namespace MDNSImplementation
                 DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
             }
         }
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] indexDomain: %s\n"), p_rpcDomain););
-        return bResult;
     }
+    else
+    {
+        // No given host domain, use base or default
+        const char* cpcDefaultName = (p_pcDefaultDomain ? : "esp8266");
 
-    /*
+        size_t      stLength = strlen(cpcDefaultName) + 1;   // '\0'
+        p_rpcDomain = new char[stLength];
+        if (p_rpcDomain)
+        {
+            strncpy(p_rpcDomain, cpcDefaultName, stLength);
+            bResult = true;
+        }
+        else
+        {
+            DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
+        }
+    }
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] indexDomain: %s\n"), p_rpcDomain););
+    return bResult;
+}
+
+
+/*
     UDP CONTEXT
 */
 
-    bool MDNSResponder::_callProcess(void)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf("[MDNSResponder] _callProcess (%lu, triggered by: %s)\n", millis(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
+bool MDNSResponder::_callProcess(void)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf("[MDNSResponder] _callProcess (%lu, triggered by: %s)\n", millis(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
 
-        return _process(false);
-    }
+    return _process(false);
+}
 
-    /*
+/*
     MDNSResponder::_allocUDPContext
 
     (Re-)Creates the one-and-only UDP context for the MDNS responder.
@@ -157,579 +164,638 @@ namespace MDNSImplementation
     is called from the WiFi stack side of the ESP stack system.
 
 */
-    bool MDNSResponder::_allocUDPContext(void)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.println("[MDNSResponder] _allocUDPContext"););
+bool MDNSResponder::_allocUDPContext(void)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.println("[MDNSResponder] _allocUDPContext"););
 
-        _releaseUDPContext();
-        _joinMulticastGroups();
+    _releaseUDPContext();
+    _joinMulticastGroups();
 
-        m_pUDPContext = new UdpContext;
-        m_pUDPContext->ref();
+    m_pUDPContext = new UdpContext;
+    m_pUDPContext->ref();
 
-        if (m_pUDPContext->listen(IP4_ADDR_ANY, DNS_MQUERY_PORT))
-        {
-            m_pUDPContext->setMulticastTTL(MDNS_MULTICAST_TTL);
-            m_pUDPContext->onRx(std::bind(&MDNSResponder::_callProcess, this));
-        }
-        else
-        {
-            return false;
-        }
-
-        return true;
+    if (m_pUDPContext->listen(IP4_ADDR_ANY, DNS_MQUERY_PORT))
+    {
+        m_pUDPContext->setMulticastTTL(MDNS_MULTICAST_TTL);
+        m_pUDPContext->onRx(std::bind(&MDNSResponder::_callProcess, this));
+    }
+    else
+    {
+        return false;
     }
 
-    /*
+    return true;
+}
+
+/*
     MDNSResponder::_releaseUDPContext
 */
-    bool MDNSResponder::_releaseUDPContext(void)
+bool MDNSResponder::_releaseUDPContext(void)
+{
+
+    if (m_pUDPContext)
     {
-        if (m_pUDPContext)
-        {
-            m_pUDPContext->unref();
-            m_pUDPContext = 0;
-            _leaveMulticastGroups();
-        }
-        return true;
+        m_pUDPContext->unref();
+        m_pUDPContext = 0;
+        _leaveMulticastGroups();
     }
+    return true;
+}
+
 
-    /*
+/*
     SERVICE QUERY
 */
 
-    /*
+/*
     MDNSResponder::_allocServiceQuery
 */
-    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_allocServiceQuery(void)
+MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_allocServiceQuery(void)
+{
+
+    stcMDNSServiceQuery*    pServiceQuery = new stcMDNSServiceQuery;
+    if (pServiceQuery)
     {
-        stcMDNSServiceQuery* pServiceQuery = new stcMDNSServiceQuery;
-        if (pServiceQuery)
-        {
-            // Link to query list
-            pServiceQuery->m_pNext = m_pServiceQueries;
-            m_pServiceQueries      = pServiceQuery;
-        }
-        return m_pServiceQueries;
+        // Link to query list
+        pServiceQuery->m_pNext = m_pServiceQueries;
+        m_pServiceQueries = pServiceQuery;
     }
+    return m_pServiceQueries;
+}
 
-    /*
+/*
     MDNSResponder::_removeServiceQuery
 */
-    bool MDNSResponder::_removeServiceQuery(MDNSResponder::stcMDNSServiceQuery* p_pServiceQuery)
-    {
-        bool bResult = false;
+bool MDNSResponder::_removeServiceQuery(MDNSResponder::stcMDNSServiceQuery* p_pServiceQuery)
+{
+
+    bool    bResult = false;
 
-        if (p_pServiceQuery)
+    if (p_pServiceQuery)
+    {
+        stcMDNSServiceQuery*    pPred = m_pServiceQueries;
+        while ((pPred) &&
+                (pPred->m_pNext != p_pServiceQuery))
         {
-            stcMDNSServiceQuery* pPred = m_pServiceQueries;
-            while ((pPred) && (pPred->m_pNext != p_pServiceQuery))
-            {
-                pPred = pPred->m_pNext;
-            }
-            if (pPred)
+            pPred = pPred->m_pNext;
+        }
+        if (pPred)
+        {
+            pPred->m_pNext = p_pServiceQuery->m_pNext;
+            delete p_pServiceQuery;
+            bResult = true;
+        }
+        else    // No predecessor
+        {
+            if (m_pServiceQueries == p_pServiceQuery)
             {
-                pPred->m_pNext = p_pServiceQuery->m_pNext;
+                m_pServiceQueries = p_pServiceQuery->m_pNext;
                 delete p_pServiceQuery;
                 bResult = true;
             }
-            else  // No predecessor
+            else
             {
-                if (m_pServiceQueries == p_pServiceQuery)
-                {
-                    m_pServiceQueries = p_pServiceQuery->m_pNext;
-                    delete p_pServiceQuery;
-                    bResult = true;
-                }
-                else
-                {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.println("[MDNSResponder] _releaseServiceQuery: INVALID service query!"););
-                }
+                DEBUG_EX_ERR(DEBUG_OUTPUT.println("[MDNSResponder] _releaseServiceQuery: INVALID service query!"););
             }
         }
-        return bResult;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_removeLegacyServiceQuery
 */
-    bool MDNSResponder::_removeLegacyServiceQuery(void)
-    {
-        stcMDNSServiceQuery* pLegacyServiceQuery = _findLegacyServiceQuery();
-        return (pLegacyServiceQuery ? _removeServiceQuery(pLegacyServiceQuery) : true);
-    }
+bool MDNSResponder::_removeLegacyServiceQuery(void)
+{
+
+    stcMDNSServiceQuery*    pLegacyServiceQuery = _findLegacyServiceQuery();
+    return (pLegacyServiceQuery ? _removeServiceQuery(pLegacyServiceQuery) : true);
+}
 
-    /*
+/*
     MDNSResponder::_findServiceQuery
 
     'Convert' hMDNSServiceQuery to stcMDNSServiceQuery* (ensure existence)
 
 */
-    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
+MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
+{
+
+    stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
+    while (pServiceQuery)
     {
-        stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
-        while (pServiceQuery)
+        if ((hMDNSServiceQuery)pServiceQuery == p_hServiceQuery)
         {
-            if ((hMDNSServiceQuery)pServiceQuery == p_hServiceQuery)
-            {
-                break;
-            }
-            pServiceQuery = pServiceQuery->m_pNext;
+            break;
         }
-        return pServiceQuery;
+        pServiceQuery = pServiceQuery->m_pNext;
     }
+    return pServiceQuery;
+}
 
-    /*
+/*
     MDNSResponder::_findLegacyServiceQuery
 */
-    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findLegacyServiceQuery(void)
+MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findLegacyServiceQuery(void)
+{
+
+    stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
+    while (pServiceQuery)
     {
-        stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
-        while (pServiceQuery)
+        if (pServiceQuery->m_bLegacyQuery)
         {
-            if (pServiceQuery->m_bLegacyQuery)
-            {
-                break;
-            }
-            pServiceQuery = pServiceQuery->m_pNext;
+            break;
         }
-        return pServiceQuery;
+        pServiceQuery = pServiceQuery->m_pNext;
     }
+    return pServiceQuery;
+}
 
-    /*
+/*
     MDNSResponder::_releaseServiceQueries
 */
-    bool MDNSResponder::_releaseServiceQueries(void)
+bool MDNSResponder::_releaseServiceQueries(void)
+{
+    while (m_pServiceQueries)
     {
-        while (m_pServiceQueries)
-        {
-            stcMDNSServiceQuery* pNext = m_pServiceQueries->m_pNext;
-            delete m_pServiceQueries;
-            m_pServiceQueries = pNext;
-        }
-        return true;
+        stcMDNSServiceQuery*    pNext = m_pServiceQueries->m_pNext;
+        delete m_pServiceQueries;
+        m_pServiceQueries = pNext;
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::_findNextServiceQueryByServiceType
 */
-    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findNextServiceQueryByServiceType(const stcMDNS_RRDomain&    p_ServiceTypeDomain,
-                                                                                          const stcMDNSServiceQuery* p_pPrevServiceQuery)
-    {
-        stcMDNSServiceQuery* pMatchingServiceQuery = 0;
+MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findNextServiceQueryByServiceType(const stcMDNS_RRDomain& p_ServiceTypeDomain,
+        const stcMDNSServiceQuery* p_pPrevServiceQuery)
+{
+    stcMDNSServiceQuery*    pMatchingServiceQuery = 0;
 
-        stcMDNSServiceQuery* pServiceQuery = (p_pPrevServiceQuery ? p_pPrevServiceQuery->m_pNext : m_pServiceQueries);
-        while (pServiceQuery)
+    stcMDNSServiceQuery*    pServiceQuery = (p_pPrevServiceQuery ? p_pPrevServiceQuery->m_pNext : m_pServiceQueries);
+    while (pServiceQuery)
+    {
+        if (p_ServiceTypeDomain == pServiceQuery->m_ServiceTypeDomain)
         {
-            if (p_ServiceTypeDomain == pServiceQuery->m_ServiceTypeDomain)
-            {
-                pMatchingServiceQuery = pServiceQuery;
-                break;
-            }
-            pServiceQuery = pServiceQuery->m_pNext;
+            pMatchingServiceQuery = pServiceQuery;
+            break;
         }
-        return pMatchingServiceQuery;
+        pServiceQuery = pServiceQuery->m_pNext;
     }
+    return pMatchingServiceQuery;
+}
+
 
-    /*
+/*
     HOSTNAME
 */
 
-    /*
+/*
     MDNSResponder::_setHostname
 */
-    bool MDNSResponder::_setHostname(const char* p_pcHostname)
-    {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _allocHostname (%s)\n"), p_pcHostname););
+bool MDNSResponder::_setHostname(const char* p_pcHostname)
+{
+    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _allocHostname (%s)\n"), p_pcHostname););
 
-        bool bResult = false;
+    bool    bResult = false;
 
-        _releaseHostname();
+    _releaseHostname();
 
-        size_t stLength = 0;
-        if ((p_pcHostname) && (MDNS_DOMAIN_LABEL_MAXLENGTH >= (stLength = strlen(p_pcHostname))))  // char max size for a single label
+    size_t  stLength = 0;
+    if ((p_pcHostname) &&
+            (MDNS_DOMAIN_LABEL_MAXLENGTH >= (stLength = strlen(p_pcHostname))))   // char max size for a single label
+    {
+        // Copy in hostname characters as lowercase
+        if ((bResult = (0 != (m_pcHostname = new char[stLength + 1]))))
         {
-            // Copy in hostname characters as lowercase
-            if ((bResult = (0 != (m_pcHostname = new char[stLength + 1]))))
-            {
 #ifdef MDNS_FORCE_LOWERCASE_HOSTNAME
-                size_t i = 0;
-                for (; i < stLength; ++i)
-                {
-                    m_pcHostname[i] = (isupper(p_pcHostname[i]) ? tolower(p_pcHostname[i]) : p_pcHostname[i]);
-                }
-                m_pcHostname[i] = 0;
+            size_t i = 0;
+            for (; i < stLength; ++i)
+            {
+                m_pcHostname[i] = (isupper(p_pcHostname[i]) ? tolower(p_pcHostname[i]) : p_pcHostname[i]);
+            }
+            m_pcHostname[i] = 0;
 #else
-                strncpy(m_pcHostname, p_pcHostname, (stLength + 1));
+            strncpy(m_pcHostname, p_pcHostname, (stLength + 1));
 #endif
-            }
         }
-        return bResult;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_releaseHostname
 */
-    bool MDNSResponder::_releaseHostname(void)
+bool MDNSResponder::_releaseHostname(void)
+{
+
+    if (m_pcHostname)
     {
-        if (m_pcHostname)
-        {
-            delete[] m_pcHostname;
-            m_pcHostname = 0;
-        }
-        return true;
+        delete[] m_pcHostname;
+        m_pcHostname = 0;
     }
+    return true;
+}
+
 
-    /*
+/*
     SERVICE
 */
 
-    /*
+/*
     MDNSResponder::_allocService
 */
-    MDNSResponder::stcMDNSService* MDNSResponder::_allocService(const char* p_pcName,
-                                                                const char* p_pcService,
-                                                                const char* p_pcProtocol,
-                                                                uint16_t    p_u16Port)
+MDNSResponder::stcMDNSService* MDNSResponder::_allocService(const char* p_pcName,
+        const char* p_pcService,
+        const char* p_pcProtocol,
+        uint16_t p_u16Port)
+{
+
+    stcMDNSService* pService = 0;
+    if (((!p_pcName) ||
+            (MDNS_DOMAIN_LABEL_MAXLENGTH >= strlen(p_pcName))) &&
+            (p_pcService) &&
+            (MDNS_SERVICE_NAME_LENGTH >= strlen(p_pcService)) &&
+            (p_pcProtocol) &&
+            (MDNS_SERVICE_PROTOCOL_LENGTH >= strlen(p_pcProtocol)) &&
+            (p_u16Port) &&
+            (0 != (pService = new stcMDNSService)) &&
+            (pService->setName(p_pcName ? : m_pcHostname)) &&
+            (pService->setService(p_pcService)) &&
+            (pService->setProtocol(p_pcProtocol)))
     {
-        stcMDNSService* pService = 0;
-        if (((!p_pcName) || (MDNS_DOMAIN_LABEL_MAXLENGTH >= strlen(p_pcName))) && (p_pcService) && (MDNS_SERVICE_NAME_LENGTH >= strlen(p_pcService)) && (p_pcProtocol) && (MDNS_SERVICE_PROTOCOL_LENGTH >= strlen(p_pcProtocol)) && (p_u16Port) && (0 != (pService = new stcMDNSService)) && (pService->setName(p_pcName ?: m_pcHostname)) && (pService->setService(p_pcService)) && (pService->setProtocol(p_pcProtocol)))
-        {
-            pService->m_bAutoName = (0 == p_pcName);
-            pService->m_u16Port   = p_u16Port;
 
-            // Add to list (or start list)
-            pService->m_pNext = m_pServices;
-            m_pServices       = pService;
-        }
-        return pService;
+        pService->m_bAutoName = (0 == p_pcName);
+        pService->m_u16Port = p_u16Port;
+
+        // Add to list (or start list)
+        pService->m_pNext = m_pServices;
+        m_pServices = pService;
     }
+    return pService;
+}
 
-    /*
+/*
     MDNSResponder::_releaseService
 */
-    bool MDNSResponder::_releaseService(MDNSResponder::stcMDNSService* p_pService)
-    {
-        bool bResult = false;
+bool MDNSResponder::_releaseService(MDNSResponder::stcMDNSService* p_pService)
+{
+
+    bool    bResult = false;
 
-        if (p_pService)
+    if (p_pService)
+    {
+        stcMDNSService* pPred = m_pServices;
+        while ((pPred) &&
+                (pPred->m_pNext != p_pService))
         {
-            stcMDNSService* pPred = m_pServices;
-            while ((pPred) && (pPred->m_pNext != p_pService))
-            {
-                pPred = pPred->m_pNext;
-            }
-            if (pPred)
+            pPred = pPred->m_pNext;
+        }
+        if (pPred)
+        {
+            pPred->m_pNext = p_pService->m_pNext;
+            delete p_pService;
+            bResult = true;
+        }
+        else    // No predecessor
+        {
+            if (m_pServices == p_pService)
             {
-                pPred->m_pNext = p_pService->m_pNext;
+                m_pServices = p_pService->m_pNext;
                 delete p_pService;
                 bResult = true;
             }
-            else  // No predecessor
+            else
             {
-                if (m_pServices == p_pService)
-                {
-                    m_pServices = p_pService->m_pNext;
-                    delete p_pService;
-                    bResult = true;
-                }
-                else
-                {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.println("[MDNSResponder] _releaseService: INVALID service!"););
-                }
+                DEBUG_EX_ERR(DEBUG_OUTPUT.println("[MDNSResponder] _releaseService: INVALID service!"););
             }
         }
-        return bResult;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_releaseServices
 */
-    bool MDNSResponder::_releaseServices(void)
+bool MDNSResponder::_releaseServices(void)
+{
+
+    stcMDNSService* pService = m_pServices;
+    while (pService)
     {
-        stcMDNSService* pService = m_pServices;
-        while (pService)
-        {
-            _releaseService(pService);
-            pService = m_pServices;
-        }
-        return true;
+        _releaseService(pService);
+        pService = m_pServices;
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::_findService
 */
-    MDNSResponder::stcMDNSService* MDNSResponder::_findService(const char* p_pcName,
-                                                               const char* p_pcService,
-                                                               const char* p_pcProtocol)
+MDNSResponder::stcMDNSService* MDNSResponder::_findService(const char* p_pcName,
+        const char* p_pcService,
+        const char* p_pcProtocol)
+{
+
+    stcMDNSService* pService = m_pServices;
+    while (pService)
     {
-        stcMDNSService* pService = m_pServices;
-        while (pService)
+        if ((0 == strcmp(pService->m_pcName, p_pcName)) &&
+                (0 == strcmp(pService->m_pcService, p_pcService)) &&
+                (0 == strcmp(pService->m_pcProtocol, p_pcProtocol)))
         {
-            if ((0 == strcmp(pService->m_pcName, p_pcName)) && (0 == strcmp(pService->m_pcService, p_pcService)) && (0 == strcmp(pService->m_pcProtocol, p_pcProtocol)))
-            {
-                break;
-            }
-            pService = pService->m_pNext;
+
+            break;
         }
-        return pService;
+        pService = pService->m_pNext;
     }
+    return pService;
+}
 
-    /*
+/*
     MDNSResponder::_findService
 */
-    MDNSResponder::stcMDNSService* MDNSResponder::_findService(const MDNSResponder::hMDNSService p_hService)
+MDNSResponder::stcMDNSService* MDNSResponder::_findService(const MDNSResponder::hMDNSService p_hService)
+{
+
+    stcMDNSService* pService = m_pServices;
+    while (pService)
     {
-        stcMDNSService* pService = m_pServices;
-        while (pService)
+        if (p_hService == (hMDNSService)pService)
         {
-            if (p_hService == (hMDNSService)pService)
-            {
-                break;
-            }
-            pService = pService->m_pNext;
+            break;
         }
-        return pService;
+        pService = pService->m_pNext;
     }
+    return pService;
+}
 
-    /*
+
+/*
     SERVICE TXT
 */
 
-    /*
+/*
     MDNSResponder::_allocServiceTxt
 */
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_allocServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                                                      const char*                    p_pcKey,
-                                                                      const char*                    p_pcValue,
-                                                                      bool                           p_bTemp)
+MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_allocServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+        const char* p_pcKey,
+        const char* p_pcValue,
+        bool p_bTemp)
+{
+
+    stcMDNSServiceTxt*  pTxt = 0;
+
+    if ((p_pService) &&
+            (p_pcKey) &&
+            (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() +
+                                           1 +                                 // Length byte
+                                           (p_pcKey ? strlen(p_pcKey) : 0) +
+                                           1 +                                 // '='
+                                           (p_pcValue ? strlen(p_pcValue) : 0))))
     {
-        stcMDNSServiceTxt* pTxt = 0;
 
-        if ((p_pService) && (p_pcKey) && (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() + 1 +      // Length byte
-                                                                        (p_pcKey ? strlen(p_pcKey) : 0) + 1 +  // '='
-                                                                        (p_pcValue ? strlen(p_pcValue) : 0))))
+        pTxt = new stcMDNSServiceTxt;
+        if (pTxt)
         {
-            pTxt = new stcMDNSServiceTxt;
-            if (pTxt)
+            size_t  stLength = (p_pcKey ? strlen(p_pcKey) : 0);
+            pTxt->m_pcKey = new char[stLength + 1];
+            if (pTxt->m_pcKey)
             {
-                size_t stLength = (p_pcKey ? strlen(p_pcKey) : 0);
-                pTxt->m_pcKey   = new char[stLength + 1];
-                if (pTxt->m_pcKey)
-                {
-                    strncpy(pTxt->m_pcKey, p_pcKey, stLength);
-                    pTxt->m_pcKey[stLength] = 0;
-                }
+                strncpy(pTxt->m_pcKey, p_pcKey, stLength); pTxt->m_pcKey[stLength] = 0;
+            }
 
-                if (p_pcValue)
+            if (p_pcValue)
+            {
+                stLength = (p_pcValue ? strlen(p_pcValue) : 0);
+                pTxt->m_pcValue = new char[stLength + 1];
+                if (pTxt->m_pcValue)
                 {
-                    stLength        = (p_pcValue ? strlen(p_pcValue) : 0);
-                    pTxt->m_pcValue = new char[stLength + 1];
-                    if (pTxt->m_pcValue)
-                    {
-                        strncpy(pTxt->m_pcValue, p_pcValue, stLength);
-                        pTxt->m_pcValue[stLength] = 0;
-                    }
+                    strncpy(pTxt->m_pcValue, p_pcValue, stLength); pTxt->m_pcValue[stLength] = 0;
                 }
-                pTxt->m_bTemp = p_bTemp;
-
-                // Add to list (or start list)
-                p_pService->m_Txts.add(pTxt);
             }
+            pTxt->m_bTemp = p_bTemp;
+
+            // Add to list (or start list)
+            p_pService->m_Txts.add(pTxt);
         }
-        return pTxt;
     }
+    return pTxt;
+}
 
-    /*
+/*
     MDNSResponder::_releaseServiceTxt
 */
-    bool MDNSResponder::_releaseServiceTxt(MDNSResponder::stcMDNSService*    p_pService,
-                                           MDNSResponder::stcMDNSServiceTxt* p_pTxt)
-    {
-        return ((p_pService) && (p_pTxt) && (p_pService->m_Txts.remove(p_pTxt)));
-    }
+bool MDNSResponder::_releaseServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+                                       MDNSResponder::stcMDNSServiceTxt* p_pTxt)
+{
 
-    /*
+    return ((p_pService) &&
+            (p_pTxt) &&
+            (p_pService->m_Txts.remove(p_pTxt)));
+}
+
+/*
     MDNSResponder::_updateServiceTxt
 */
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_updateServiceTxt(MDNSResponder::stcMDNSService*    p_pService,
-                                                                       MDNSResponder::stcMDNSServiceTxt* p_pTxt,
-                                                                       const char*                       p_pcValue,
-                                                                       bool                              p_bTemp)
+MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_updateServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+        MDNSResponder::stcMDNSServiceTxt* p_pTxt,
+        const char* p_pcValue,
+        bool p_bTemp)
+{
+
+    if ((p_pService) &&
+            (p_pTxt) &&
+            (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() -
+                                           (p_pTxt->m_pcValue ? strlen(p_pTxt->m_pcValue) : 0) +
+                                           (p_pcValue ? strlen(p_pcValue) : 0))))
     {
-        if ((p_pService) && (p_pTxt) && (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() - (p_pTxt->m_pcValue ? strlen(p_pTxt->m_pcValue) : 0) + (p_pcValue ? strlen(p_pcValue) : 0))))
-        {
-            p_pTxt->update(p_pcValue);
-            p_pTxt->m_bTemp = p_bTemp;
-        }
-        return p_pTxt;
+        p_pTxt->update(p_pcValue);
+        p_pTxt->m_bTemp = p_bTemp;
     }
+    return p_pTxt;
+}
 
-    /*
+/*
     MDNSResponder::_findServiceTxt
 */
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                                                     const char*                    p_pcKey)
-    {
-        return (p_pService ? p_pService->m_Txts.find(p_pcKey) : 0);
-    }
+MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+        const char* p_pcKey)
+{
+
+    return (p_pService ? p_pService->m_Txts.find(p_pcKey) : 0);
+}
 
-    /*
+/*
     MDNSResponder::_findServiceTxt
 */
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                                                     const hMDNSTxt                 p_hTxt)
-    {
-        return (((p_pService) && (p_hTxt)) ? p_pService->m_Txts.find((stcMDNSServiceTxt*)p_hTxt) : 0);
-    }
+MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+        const hMDNSTxt p_hTxt)
+{
 
-    /*
+    return (((p_pService) && (p_hTxt)) ? p_pService->m_Txts.find((stcMDNSServiceTxt*)p_hTxt) : 0);
+}
+
+/*
     MDNSResponder::_addServiceTxt
 */
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_addServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                                                    const char*                    p_pcKey,
-                                                                    const char*                    p_pcValue,
-                                                                    bool                           p_bTemp)
+MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_addServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+        const char* p_pcKey,
+        const char* p_pcValue,
+        bool p_bTemp)
+{
+    stcMDNSServiceTxt*  pResult = 0;
+
+    if ((p_pService) &&
+            (p_pcKey) &&
+            (strlen(p_pcKey)))
     {
-        stcMDNSServiceTxt* pResult = 0;
 
-        if ((p_pService) && (p_pcKey) && (strlen(p_pcKey)))
+        stcMDNSServiceTxt*  pTxt = p_pService->m_Txts.find(p_pcKey);
+        if (pTxt)
         {
-            stcMDNSServiceTxt* pTxt = p_pService->m_Txts.find(p_pcKey);
-            if (pTxt)
-            {
-                pResult = _updateServiceTxt(p_pService, pTxt, p_pcValue, p_bTemp);
-            }
-            else
-            {
-                pResult = _allocServiceTxt(p_pService, p_pcKey, p_pcValue, p_bTemp);
-            }
+            pResult = _updateServiceTxt(p_pService, pTxt, p_pcValue, p_bTemp);
+        }
+        else
+        {
+            pResult = _allocServiceTxt(p_pService, p_pcKey, p_pcValue, p_bTemp);
         }
-        return pResult;
     }
+    return pResult;
+}
 
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
-                                                                     const uint32_t          p_u32AnswerIndex)
-    {
-        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        // Fill m_pcTxts (if not already done)
-        return (pSQAnswer) ? pSQAnswer->m_Txts.m_pTxts : 0;
-    }
+MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
+        const uint32_t p_u32AnswerIndex)
+{
+    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+    // Fill m_pcTxts (if not already done)
+    return (pSQAnswer) ?  pSQAnswer->m_Txts.m_pTxts : 0;
+}
 
-    /*
+/*
     MDNSResponder::_collectServiceTxts
 */
-    bool MDNSResponder::_collectServiceTxts(MDNSResponder::stcMDNSService& p_rService)
+bool MDNSResponder::_collectServiceTxts(MDNSResponder::stcMDNSService& p_rService)
+{
+
+    // Call Dynamic service callbacks
+    if (m_fnServiceTxtCallback)
     {
-        // Call Dynamic service callbacks
-        if (m_fnServiceTxtCallback)
-        {
-            m_fnServiceTxtCallback((hMDNSService)&p_rService);
-        }
-        if (p_rService.m_fnTxtCallback)
-        {
-            p_rService.m_fnTxtCallback((hMDNSService)&p_rService);
-        }
-        return true;
+        m_fnServiceTxtCallback((hMDNSService)&p_rService);
+    }
+    if (p_rService.m_fnTxtCallback)
+    {
+        p_rService.m_fnTxtCallback((hMDNSService)&p_rService);
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::_releaseTempServiceTxts
 */
-    bool MDNSResponder::_releaseTempServiceTxts(MDNSResponder::stcMDNSService& p_rService)
-    {
-        return (p_rService.m_Txts.removeTempTxts());
-    }
+bool MDNSResponder::_releaseTempServiceTxts(MDNSResponder::stcMDNSService& p_rService)
+{
 
-    /*
+    return (p_rService.m_Txts.removeTempTxts());
+}
+
+
+/*
     MISC
 */
 
 #ifdef DEBUG_ESP_MDNS_RESPONDER
-    /*
+/*
     MDNSResponder::_printRRDomain
 */
-    bool MDNSResponder::_printRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_RRDomain) const
-    {
-        //DEBUG_OUTPUT.printf_P(PSTR("Domain: "));
+bool MDNSResponder::_printRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_RRDomain) const
+{
 
-        const char* pCursor  = p_RRDomain.m_acName;
-        uint8_t     u8Length = *pCursor++;
-        if (u8Length)
+    //DEBUG_OUTPUT.printf_P(PSTR("Domain: "));
+
+    const char* pCursor = p_RRDomain.m_acName;
+    uint8_t     u8Length = *pCursor++;
+    if (u8Length)
+    {
+        while (u8Length)
         {
-            while (u8Length)
+            for (uint8_t u = 0; u < u8Length; ++u)
             {
-                for (uint8_t u = 0; u < u8Length; ++u)
-                {
-                    DEBUG_OUTPUT.printf_P(PSTR("%c"), *(pCursor++));
-                }
-                u8Length = *pCursor++;
-                if (u8Length)
-                {
-                    DEBUG_OUTPUT.printf_P(PSTR("."));
-                }
+                DEBUG_OUTPUT.printf_P(PSTR("%c"), *(pCursor++));
+            }
+            u8Length = *pCursor++;
+            if (u8Length)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("."));
             }
         }
-        else  // empty domain
-        {
-            DEBUG_OUTPUT.printf_P(PSTR("-empty-"));
-        }
-        //DEBUG_OUTPUT.printf_P(PSTR("\n"));
-
-        return true;
     }
+    else    // empty domain
+    {
+        DEBUG_OUTPUT.printf_P(PSTR("-empty-"));
+    }
+    //DEBUG_OUTPUT.printf_P(PSTR("\n"));
 
-    /*
+    return true;
+}
+
+/*
     MDNSResponder::_printRRAnswer
 */
-    bool MDNSResponder::_printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAnswer) const
+bool MDNSResponder::_printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAnswer) const
+{
+
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] RRAnswer: "));
+    _printRRDomain(p_RRAnswer.m_Header.m_Domain);
+    DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, "), p_RRAnswer.m_Header.m_Attributes.m_u16Type, p_RRAnswer.m_Header.m_Attributes.m_u16Class, p_RRAnswer.m_u32TTL);
+    switch (p_RRAnswer.m_Header.m_Attributes.m_u16Type & (~0x8000))     // Topmost bit might carry 'cache flush' flag
     {
-        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] RRAnswer: "));
-        _printRRDomain(p_RRAnswer.m_Header.m_Domain);
-        DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, "), p_RRAnswer.m_Header.m_Attributes.m_u16Type, p_RRAnswer.m_Header.m_Attributes.m_u16Class, p_RRAnswer.m_u32TTL);
-        switch (p_RRAnswer.m_Header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
-        {
 #ifdef MDNS_IP4_SUPPORT
-        case DNS_RRTYPE_A:
-            DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((const stcMDNS_RRAnswerA*)&p_RRAnswer)->m_IPAddress.toString().c_str());
-            break;
+    case DNS_RRTYPE_A:
+        DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((const stcMDNS_RRAnswerA*)&p_RRAnswer)->m_IPAddress.toString().c_str());
+        break;
 #endif
-        case DNS_RRTYPE_PTR:
-            DEBUG_OUTPUT.printf_P(PSTR("PTR "));
-            _printRRDomain(((const stcMDNS_RRAnswerPTR*)&p_RRAnswer)->m_PTRDomain);
-            break;
-        case DNS_RRTYPE_TXT:
+    case DNS_RRTYPE_PTR:
+        DEBUG_OUTPUT.printf_P(PSTR("PTR "));
+        _printRRDomain(((const stcMDNS_RRAnswerPTR*)&p_RRAnswer)->m_PTRDomain);
+        break;
+    case DNS_RRTYPE_TXT:
+    {
+        size_t  stTxtLength = ((const stcMDNS_RRAnswerTXT*)&p_RRAnswer)->m_Txts.c_strLength();
+        char*   pTxts = new char[stTxtLength];
+        if (pTxts)
         {
-            size_t stTxtLength = ((const stcMDNS_RRAnswerTXT*)&p_RRAnswer)->m_Txts.c_strLength();
-            char*  pTxts       = new char[stTxtLength];
-            if (pTxts)
-            {
-                ((/*const c_str()!!*/ stcMDNS_RRAnswerTXT*)&p_RRAnswer)->m_Txts.c_str(pTxts);
-                DEBUG_OUTPUT.printf_P(PSTR("TXT(%zu) %s"), stTxtLength, pTxts);
-                delete[] pTxts;
-            }
-            break;
+            ((/*const c_str()!!*/stcMDNS_RRAnswerTXT*)&p_RRAnswer)->m_Txts.c_str(pTxts);
+            DEBUG_OUTPUT.printf_P(PSTR("TXT(%zu) %s"), stTxtLength, pTxts);
+            delete[] pTxts;
         }
+        break;
+    }
 #ifdef MDNS_IP6_SUPPORT
-        case DNS_RRTYPE_AAAA:
-            DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
-            break;
+    case DNS_RRTYPE_AAAA:
+        DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
+        break;
 #endif
-        case DNS_RRTYPE_SRV:
-            DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_u16Port);
-            _printRRDomain(((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_SRVDomain);
-            break;
-        default:
-            DEBUG_OUTPUT.printf_P(PSTR("generic "));
-            break;
-        }
-        DEBUG_OUTPUT.printf_P(PSTR("\n"));
-
-        return true;
+    case DNS_RRTYPE_SRV:
+        DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_u16Port);
+        _printRRDomain(((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_SRVDomain);
+        break;
+    default:
+        DEBUG_OUTPUT.printf_P(PSTR("generic "));
+        break;
     }
+    DEBUG_OUTPUT.printf_P(PSTR("\n"));
+
+    return true;
+}
 #endif
 
-}  // namespace MDNSImplementation
+}   // namespace MDNSImplementation
+
+} // namespace esp8266
+
+
+
 
-}  // namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h b/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
index f57e48f0c5..49fc5bb608 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
@@ -27,15 +27,17 @@
 
 namespace esp8266
 {
+
 /*
     LEAmDNS
 */
 
 namespace MDNSImplementation
 {
+
 // Enable class debug functions
 #define ESP_8266_MDNS_INCLUDE
-    //#define DEBUG_ESP_MDNS_RESPONDER
+//#define DEBUG_ESP_MDNS_RESPONDER
 
 #if !defined(DEBUG_ESP_MDNS_RESPONDER) && defined(DEBUG_ESP_MDNS)
 #define DEBUG_ESP_MDNS_RESPONDER
@@ -60,7 +62,7 @@ namespace MDNSImplementation
 
 #ifdef DEBUG_ESP_MDNS_RESPONDER
 #ifdef DEBUG_ESP_MDNS_INFO
-#define DEBUG_EX_INFO(A) A
+#define DEBUG_EX_INFO(A)    A
 #else
 #define DEBUG_EX_INFO(A)
 #endif
@@ -70,12 +72,12 @@ namespace MDNSImplementation
 #define DEBUG_EX_ERR(A)
 #endif
 #ifdef DEBUG_ESP_MDNS_TX
-#define DEBUG_EX_TX(A) A
+#define DEBUG_EX_TX(A)  A
 #else
 #define DEBUG_EX_TX(A)
 #endif
 #ifdef DEBUG_ESP_MDNS_RX
-#define DEBUG_EX_RX(A) A
+#define DEBUG_EX_RX(A)  A
 #else
 #define DEBUG_EX_RX(A)
 #endif
@@ -86,26 +88,10 @@ namespace MDNSImplementation
 #define DEBUG_OUTPUT Serial
 #endif
 #else
-#define DEBUG_EX_INFO(A) \
-    do                   \
-    {                    \
-        (void)0;         \
-    } while (0)
-#define DEBUG_EX_ERR(A) \
-    do                  \
-    {                   \
-        (void)0;        \
-    } while (0)
-#define DEBUG_EX_TX(A) \
-    do                 \
-    {                  \
-        (void)0;       \
-    } while (0)
-#define DEBUG_EX_RX(A) \
-    do                 \
-    {                  \
-        (void)0;       \
-    } while (0)
+#define DEBUG_EX_INFO(A)    do { (void)0; } while (0)
+#define DEBUG_EX_ERR(A)     do { (void)0; } while (0)
+#define DEBUG_EX_TX(A)      do { (void)0; } while (0)
+#define DEBUG_EX_RX(A)      do { (void)0; } while (0)
 #endif
 
 /*  already defined in lwIP ('lwip/prot/dns.h')
@@ -125,43 +111,44 @@ namespace MDNSImplementation
 
     However, RFC 3171 seems to force 255 instead
 */
-#define MDNS_MULTICAST_TTL 255 /*1*/
+#define MDNS_MULTICAST_TTL              255/*1*/
 
 /*
     This is the MDNS record TTL
     Host level records are set to 2min (120s)
     service level records are set to 75min (4500s)
 */
-#define MDNS_HOST_TTL 120
-#define MDNS_SERVICE_TTL 4500
+#define MDNS_HOST_TTL                   120
+#define MDNS_SERVICE_TTL                4500
 
 /*
     Compressed labels are flagged by the two topmost bits of the length byte being set
 */
-#define MDNS_DOMAIN_COMPRESS_MARK 0xC0
+#define MDNS_DOMAIN_COMPRESS_MARK       0xC0
 /*
     Avoid endless recursion because of malformed compressed labels
 */
-#define MDNS_DOMAIN_MAX_REDIRCTION 6
+#define MDNS_DOMAIN_MAX_REDIRCTION      6
 
 /*
     Default service priority and weight in SRV answers
 */
-#define MDNS_SRV_PRIORITY 0
-#define MDNS_SRV_WEIGHT 0
+#define MDNS_SRV_PRIORITY               0
+#define MDNS_SRV_WEIGHT                 0
 
 /*
     Delay between and number of probes for host and service domains
     Delay between and number of announces for host and service domains
     Delay between and number of service queries; the delay is multiplied by the resent number in '_checkServiceQueryCache'
 */
-#define MDNS_PROBE_DELAY 250
-#define MDNS_PROBE_COUNT 3
-#define MDNS_ANNOUNCE_DELAY 1000
-#define MDNS_ANNOUNCE_COUNT 8
+#define MDNS_PROBE_DELAY                250
+#define MDNS_PROBE_COUNT                3
+#define MDNS_ANNOUNCE_DELAY             1000
+#define MDNS_ANNOUNCE_COUNT             8
 #define MDNS_DYNAMIC_QUERY_RESEND_COUNT 5
 #define MDNS_DYNAMIC_QUERY_RESEND_DELAY 5000
 
+
 /*
     Force host domain to use only lowercase letters
 */
@@ -180,14 +167,15 @@ namespace MDNSImplementation
 #ifdef F
 #undef F
 #endif
-#define F(A) A
+#define F(A)    A
 #endif
 
-}  // namespace MDNSImplementation
+}   // namespace MDNSImplementation
 
-}  // namespace esp8266
+} // namespace esp8266
 
 // Include the main header, so the submodlues only need to include this header
 #include "LEAmDNS.h"
 
+
 #endif  // MDNS_PRIV_H
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
index d569223f2f..786287457d 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
@@ -28,16 +28,18 @@
 
 namespace esp8266
 {
+
 /*
     LEAmDNS
 */
 namespace MDNSImplementation
 {
-    /**
+
+/**
     STRUCTS
 */
 
-    /**
+/**
     MDNSResponder::stcMDNSServiceTxt
 
     One MDNS TXT item.
@@ -47,215 +49,233 @@ namespace MDNSImplementation
     Output as byte array 'c#=1' is supported.
 */
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt constructor
 */
-    MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const char* p_pcKey /*= 0*/,
-                                                        const char* p_pcValue /*= 0*/,
-                                                        bool        p_bTemp /*= false*/) :
-        m_pNext(0),
+MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const char* p_pcKey /*= 0*/,
+        const char* p_pcValue /*= 0*/,
+        bool p_bTemp /*= false*/)
+    :   m_pNext(0),
         m_pcKey(0),
         m_pcValue(0),
         m_bTemp(p_bTemp)
-    {
-        setKey(p_pcKey);
-        setValue(p_pcValue);
-    }
+{
 
-    /*
+    setKey(p_pcKey);
+    setValue(p_pcValue);
+}
+
+/*
     MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt copy-constructor
 */
-    MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const MDNSResponder::stcMDNSServiceTxt& p_Other) :
-        m_pNext(0),
+MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const MDNSResponder::stcMDNSServiceTxt& p_Other)
+    :   m_pNext(0),
         m_pcKey(0),
         m_pcValue(0),
         m_bTemp(false)
-    {
-        operator=(p_Other);
-    }
+{
+
+    operator=(p_Other);
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt destructor
 */
-    MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt(void)
-    {
-        clear();
-    }
+MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt(void)
+{
+
+    clear();
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxt::operator=
 */
-    MDNSResponder::stcMDNSServiceTxt& MDNSResponder::stcMDNSServiceTxt::operator=(const MDNSResponder::stcMDNSServiceTxt& p_Other)
+MDNSResponder::stcMDNSServiceTxt& MDNSResponder::stcMDNSServiceTxt::operator=(const MDNSResponder::stcMDNSServiceTxt& p_Other)
+{
+
+    if (&p_Other != this)
     {
-        if (&p_Other != this)
-        {
-            clear();
-            set(p_Other.m_pcKey, p_Other.m_pcValue, p_Other.m_bTemp);
-        }
-        return *this;
+        clear();
+        set(p_Other.m_pcKey, p_Other.m_pcValue, p_Other.m_bTemp);
     }
+    return *this;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxt::clear
 */
-    bool MDNSResponder::stcMDNSServiceTxt::clear(void)
-    {
-        releaseKey();
-        releaseValue();
-        return true;
-    }
+bool MDNSResponder::stcMDNSServiceTxt::clear(void)
+{
 
-    /*
+    releaseKey();
+    releaseValue();
+    return true;
+}
+
+/*
     MDNSResponder::stcMDNSServiceTxt::allocKey
 */
-    char* MDNSResponder::stcMDNSServiceTxt::allocKey(size_t p_stLength)
+char* MDNSResponder::stcMDNSServiceTxt::allocKey(size_t p_stLength)
+{
+
+    releaseKey();
+    if (p_stLength)
     {
-        releaseKey();
-        if (p_stLength)
-        {
-            m_pcKey = new char[p_stLength + 1];
-        }
-        return m_pcKey;
+        m_pcKey = new char[p_stLength + 1];
     }
+    return m_pcKey;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxt::setKey
 */
-    bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey,
-                                                  size_t      p_stLength)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey,
+        size_t p_stLength)
+{
 
-        releaseKey();
-        if (p_stLength)
+    bool bResult = false;
+
+    releaseKey();
+    if (p_stLength)
+    {
+        if (allocKey(p_stLength))
         {
-            if (allocKey(p_stLength))
-            {
-                strncpy(m_pcKey, p_pcKey, p_stLength);
-                m_pcKey[p_stLength] = 0;
-                bResult             = true;
-            }
+            strncpy(m_pcKey, p_pcKey, p_stLength);
+            m_pcKey[p_stLength] = 0;
+            bResult = true;
         }
-        return bResult;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxt::setKey
 */
-    bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey)
-    {
-        return setKey(p_pcKey, (p_pcKey ? strlen(p_pcKey) : 0));
-    }
+bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey)
+{
+
+    return setKey(p_pcKey, (p_pcKey ? strlen(p_pcKey) : 0));
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxt::releaseKey
 */
-    bool MDNSResponder::stcMDNSServiceTxt::releaseKey(void)
+bool MDNSResponder::stcMDNSServiceTxt::releaseKey(void)
+{
+
+    if (m_pcKey)
     {
-        if (m_pcKey)
-        {
-            delete[] m_pcKey;
-            m_pcKey = 0;
-        }
-        return true;
+        delete[] m_pcKey;
+        m_pcKey = 0;
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxt::allocValue
 */
-    char* MDNSResponder::stcMDNSServiceTxt::allocValue(size_t p_stLength)
+char* MDNSResponder::stcMDNSServiceTxt::allocValue(size_t p_stLength)
+{
+
+    releaseValue();
+    if (p_stLength)
     {
-        releaseValue();
-        if (p_stLength)
-        {
-            m_pcValue = new char[p_stLength + 1];
-        }
-        return m_pcValue;
+        m_pcValue = new char[p_stLength + 1];
     }
+    return m_pcValue;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxt::setValue
 */
-    bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue,
-                                                    size_t      p_stLength)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue,
+        size_t p_stLength)
+{
 
-        releaseValue();
-        if (p_stLength)
-        {
-            if (allocValue(p_stLength))
-            {
-                strncpy(m_pcValue, p_pcValue, p_stLength);
-                m_pcValue[p_stLength] = 0;
-                bResult               = true;
-            }
-        }
-        else  // No value -> also OK
+    bool bResult = false;
+
+    releaseValue();
+    if (p_stLength)
+    {
+        if (allocValue(p_stLength))
         {
+            strncpy(m_pcValue, p_pcValue, p_stLength);
+            m_pcValue[p_stLength] = 0;
             bResult = true;
         }
-        return bResult;
     }
+    else    // No value -> also OK
+    {
+        bResult = true;
+    }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxt::setValue
 */
-    bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue)
-    {
-        return setValue(p_pcValue, (p_pcValue ? strlen(p_pcValue) : 0));
-    }
+bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue)
+{
 
-    /*
+    return setValue(p_pcValue, (p_pcValue ? strlen(p_pcValue) : 0));
+}
+
+/*
     MDNSResponder::stcMDNSServiceTxt::releaseValue
 */
-    bool MDNSResponder::stcMDNSServiceTxt::releaseValue(void)
+bool MDNSResponder::stcMDNSServiceTxt::releaseValue(void)
+{
+
+    if (m_pcValue)
     {
-        if (m_pcValue)
-        {
-            delete[] m_pcValue;
-            m_pcValue = 0;
-        }
-        return true;
+        delete[] m_pcValue;
+        m_pcValue = 0;
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxt::set
 */
-    bool MDNSResponder::stcMDNSServiceTxt::set(const char* p_pcKey,
-                                               const char* p_pcValue,
-                                               bool        p_bTemp /*= false*/)
-    {
-        m_bTemp = p_bTemp;
-        return ((setKey(p_pcKey)) && (setValue(p_pcValue)));
-    }
+bool MDNSResponder::stcMDNSServiceTxt::set(const char* p_pcKey,
+        const char* p_pcValue,
+        bool p_bTemp /*= false*/)
+{
+
+    m_bTemp = p_bTemp;
+    return ((setKey(p_pcKey)) &&
+            (setValue(p_pcValue)));
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxt::update
 */
-    bool MDNSResponder::stcMDNSServiceTxt::update(const char* p_pcValue)
-    {
-        return setValue(p_pcValue);
-    }
+bool MDNSResponder::stcMDNSServiceTxt::update(const char* p_pcValue)
+{
 
-    /*
+    return setValue(p_pcValue);
+}
+
+/*
     MDNSResponder::stcMDNSServiceTxt::length
 
     length of eg. 'c#=1' without any closing '\0'
 */
-    size_t MDNSResponder::stcMDNSServiceTxt::length(void) const
+size_t MDNSResponder::stcMDNSServiceTxt::length(void) const
+{
+
+    size_t  stLength = 0;
+    if (m_pcKey)
     {
-        size_t stLength = 0;
-        if (m_pcKey)
-        {
-            stLength += strlen(m_pcKey);                      // Key
-            stLength += 1;                                    // '='
-            stLength += (m_pcValue ? strlen(m_pcValue) : 0);  // Value
-        }
-        return stLength;
+        stLength += strlen(m_pcKey);                     // Key
+        stLength += 1;                                      // '='
+        stLength += (m_pcValue ? strlen(m_pcValue) : 0); // Value
     }
+    return stLength;
+}
 
-    /**
+
+/**
     MDNSResponder::stcMDNSServiceTxts
 
     A list of zero or more MDNS TXT items.
@@ -267,364 +287,397 @@ namespace MDNSImplementation
 
 */
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts constructor
 */
-    MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(void) :
-        m_pTxts(0)
-    {
-    }
+MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(void)
+    :   m_pTxts(0)
+{
+
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts copy-constructor
 */
-    MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other) :
-        m_pTxts(0)
-    {
-        operator=(p_Other);
-    }
+MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other)
+    :   m_pTxts(0)
+{
 
-    /*
+    operator=(p_Other);
+}
+
+/*
     MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts destructor
 */
-    MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts(void)
-    {
-        clear();
-    }
+MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts(void)
+{
 
-    /*
+    clear();
+}
+
+/*
     MDNSResponder::stcMDNSServiceTxts::operator=
 */
-    MDNSResponder::stcMDNSServiceTxts& MDNSResponder::stcMDNSServiceTxts::operator=(const stcMDNSServiceTxts& p_Other)
+MDNSResponder::stcMDNSServiceTxts& MDNSResponder::stcMDNSServiceTxts::operator=(const stcMDNSServiceTxts& p_Other)
+{
+
+    if (this != &p_Other)
     {
-        if (this != &p_Other)
-        {
-            clear();
+        clear();
 
-            for (stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; pOtherTxt; pOtherTxt = pOtherTxt->m_pNext)
-            {
-                add(new stcMDNSServiceTxt(*pOtherTxt));
-            }
+        for (stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; pOtherTxt; pOtherTxt = pOtherTxt->m_pNext)
+        {
+            add(new stcMDNSServiceTxt(*pOtherTxt));
         }
-        return *this;
     }
+    return *this;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::clear
 */
-    bool MDNSResponder::stcMDNSServiceTxts::clear(void)
+bool MDNSResponder::stcMDNSServiceTxts::clear(void)
+{
+
+    while (m_pTxts)
     {
-        while (m_pTxts)
-        {
-            stcMDNSServiceTxt* pNext = m_pTxts->m_pNext;
-            delete m_pTxts;
-            m_pTxts = pNext;
-        }
-        return true;
+        stcMDNSServiceTxt* pNext = m_pTxts->m_pNext;
+        delete m_pTxts;
+        m_pTxts = pNext;
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::add
 */
-    bool MDNSResponder::stcMDNSServiceTxts::add(MDNSResponder::stcMDNSServiceTxt* p_pTxt)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNSServiceTxts::add(MDNSResponder::stcMDNSServiceTxt* p_pTxt)
+{
 
-        if (p_pTxt)
-        {
-            p_pTxt->m_pNext = m_pTxts;
-            m_pTxts         = p_pTxt;
-            bResult         = true;
-        }
-        return bResult;
+    bool bResult = false;
+
+    if (p_pTxt)
+    {
+        p_pTxt->m_pNext = m_pTxts;
+        m_pTxts = p_pTxt;
+        bResult = true;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::remove
 */
-    bool MDNSResponder::stcMDNSServiceTxts::remove(stcMDNSServiceTxt* p_pTxt)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNSServiceTxts::remove(stcMDNSServiceTxt* p_pTxt)
+{
+
+    bool    bResult = false;
 
-        if (p_pTxt)
+    if (p_pTxt)
+    {
+        stcMDNSServiceTxt*  pPred = m_pTxts;
+        while ((pPred) &&
+                (pPred->m_pNext != p_pTxt))
         {
-            stcMDNSServiceTxt* pPred = m_pTxts;
-            while ((pPred) && (pPred->m_pNext != p_pTxt))
-            {
-                pPred = pPred->m_pNext;
-            }
-            if (pPred)
-            {
-                pPred->m_pNext = p_pTxt->m_pNext;
-                delete p_pTxt;
-                bResult = true;
-            }
-            else if (m_pTxts == p_pTxt)  // No predecessor, but first item
-            {
-                m_pTxts = p_pTxt->m_pNext;
-                delete p_pTxt;
-                bResult = true;
-            }
+            pPred = pPred->m_pNext;
+        }
+        if (pPred)
+        {
+            pPred->m_pNext = p_pTxt->m_pNext;
+            delete p_pTxt;
+            bResult = true;
+        }
+        else if (m_pTxts == p_pTxt)     // No predecessor, but first item
+        {
+            m_pTxts = p_pTxt->m_pNext;
+            delete p_pTxt;
+            bResult = true;
         }
-        return bResult;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::removeTempTxts
 */
-    bool MDNSResponder::stcMDNSServiceTxts::removeTempTxts(void)
-    {
-        bool bResult = true;
+bool MDNSResponder::stcMDNSServiceTxts::removeTempTxts(void)
+{
 
-        stcMDNSServiceTxt* pTxt = m_pTxts;
-        while ((bResult) && (pTxt))
+    bool    bResult = true;
+
+    stcMDNSServiceTxt*  pTxt = m_pTxts;
+    while ((bResult) &&
+            (pTxt))
+    {
+        stcMDNSServiceTxt*  pNext = pTxt->m_pNext;
+        if (pTxt->m_bTemp)
         {
-            stcMDNSServiceTxt* pNext = pTxt->m_pNext;
-            if (pTxt->m_bTemp)
-            {
-                bResult = remove(pTxt);
-            }
-            pTxt = pNext;
+            bResult = remove(pTxt);
         }
-        return bResult;
+        pTxt = pNext;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::find
 */
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey)
-    {
-        stcMDNSServiceTxt* pResult = 0;
+MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey)
+{
+
+    stcMDNSServiceTxt* pResult = 0;
 
-        for (stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
+    for (stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
+    {
+        if ((p_pcKey) &&
+                (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
         {
-            if ((p_pcKey) && (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
-            {
-                pResult = pTxt;
-                break;
-            }
+            pResult = pTxt;
+            break;
         }
-        return pResult;
     }
+    return pResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::find
 */
-    const MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey) const
-    {
-        const stcMDNSServiceTxt* pResult = 0;
+const MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey) const
+{
+
+    const stcMDNSServiceTxt*   pResult = 0;
 
-        for (const stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
+    for (const stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
+    {
+        if ((p_pcKey) &&
+                (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
         {
-            if ((p_pcKey) && (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
-            {
-                pResult = pTxt;
-                break;
-            }
+
+            pResult = pTxt;
+            break;
         }
-        return pResult;
     }
+    return pResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::find
 */
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const stcMDNSServiceTxt* p_pTxt)
-    {
-        stcMDNSServiceTxt* pResult = 0;
+MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const stcMDNSServiceTxt* p_pTxt)
+{
 
-        for (stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
+    stcMDNSServiceTxt* pResult = 0;
+
+    for (stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
+    {
+        if (p_pTxt == pTxt)
         {
-            if (p_pTxt == pTxt)
-            {
-                pResult = pTxt;
-                break;
-            }
+            pResult = pTxt;
+            break;
         }
-        return pResult;
     }
+    return pResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::length
 */
-    uint16_t MDNSResponder::stcMDNSServiceTxts::length(void) const
-    {
-        uint16_t u16Length = 0;
+uint16_t MDNSResponder::stcMDNSServiceTxts::length(void) const
+{
 
-        stcMDNSServiceTxt* pTxt = m_pTxts;
-        while (pTxt)
-        {
-            u16Length += 1;               // Length byte
-            u16Length += pTxt->length();  // Text
-            pTxt = pTxt->m_pNext;
-        }
-        return u16Length;
+    uint16_t    u16Length = 0;
+
+    stcMDNSServiceTxt*  pTxt = m_pTxts;
+    while (pTxt)
+    {
+        u16Length += 1;                 // Length byte
+        u16Length += pTxt->length();    // Text
+        pTxt = pTxt->m_pNext;
     }
+    return u16Length;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::c_strLength
 
     (incl. closing '\0'). Length bytes place is used for delimiting ';' and closing '\0'
 */
-    size_t MDNSResponder::stcMDNSServiceTxts::c_strLength(void) const
-    {
-        return length();
-    }
+size_t MDNSResponder::stcMDNSServiceTxts::c_strLength(void) const
+{
 
-    /*
+    return length();
+}
+
+/*
     MDNSResponder::stcMDNSServiceTxts::c_str
 */
-    bool MDNSResponder::stcMDNSServiceTxts::c_str(char* p_pcBuffer)
+bool MDNSResponder::stcMDNSServiceTxts::c_str(char* p_pcBuffer)
+{
+
+    bool bResult = false;
+
+    if (p_pcBuffer)
     {
-        bool bResult = false;
+        bResult = true;
 
-        if (p_pcBuffer)
+        *p_pcBuffer = 0;
+        for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
         {
-            bResult = true;
-
-            *p_pcBuffer = 0;
-            for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
+            size_t  stLength;
+            if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0)))))
             {
-                size_t stLength;
-                if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0)))))
+                if (pTxt != m_pTxts)
+                {
+                    *p_pcBuffer++ = ';';
+                }
+                strncpy(p_pcBuffer, pTxt->m_pcKey, stLength); p_pcBuffer[stLength] = 0;
+                p_pcBuffer += stLength;
+                *p_pcBuffer++ = '=';
+                if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0)))
                 {
-                    if (pTxt != m_pTxts)
-                    {
-                        *p_pcBuffer++ = ';';
-                    }
-                    strncpy(p_pcBuffer, pTxt->m_pcKey, stLength);
-                    p_pcBuffer[stLength] = 0;
+                    strncpy(p_pcBuffer, pTxt->m_pcValue, stLength); p_pcBuffer[stLength] = 0;
                     p_pcBuffer += stLength;
-                    *p_pcBuffer++ = '=';
-                    if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0)))
-                    {
-                        strncpy(p_pcBuffer, pTxt->m_pcValue, stLength);
-                        p_pcBuffer[stLength] = 0;
-                        p_pcBuffer += stLength;
-                    }
                 }
             }
-            *p_pcBuffer++ = 0;
         }
-        return bResult;
+        *p_pcBuffer++ = 0;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::bufferLength
 
     (incl. closing '\0').
 */
-    size_t MDNSResponder::stcMDNSServiceTxts::bufferLength(void) const
-    {
-        return (length() + 1);
-    }
+size_t MDNSResponder::stcMDNSServiceTxts::bufferLength(void) const
+{
+
+    return (length() + 1);
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::toBuffer
 */
-    bool MDNSResponder::stcMDNSServiceTxts::buffer(char* p_pcBuffer)
+bool MDNSResponder::stcMDNSServiceTxts::buffer(char* p_pcBuffer)
+{
+
+    bool bResult = false;
+
+    if (p_pcBuffer)
     {
-        bool bResult = false;
+        bResult = true;
 
-        if (p_pcBuffer)
+        *p_pcBuffer = 0;
+        for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
         {
-            bResult = true;
-
-            *p_pcBuffer = 0;
-            for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
+            *(unsigned char*)p_pcBuffer++ = pTxt->length();
+            size_t  stLength;
+            if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0)))))
             {
-                *(unsigned char*)p_pcBuffer++ = pTxt->length();
-                size_t stLength;
-                if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0)))))
+                memcpy(p_pcBuffer, pTxt->m_pcKey, stLength);
+                p_pcBuffer += stLength;
+                *p_pcBuffer++ = '=';
+                if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0)))
                 {
-                    memcpy(p_pcBuffer, pTxt->m_pcKey, stLength);
+                    memcpy(p_pcBuffer, pTxt->m_pcValue, stLength);
                     p_pcBuffer += stLength;
-                    *p_pcBuffer++ = '=';
-                    if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0)))
-                    {
-                        memcpy(p_pcBuffer, pTxt->m_pcValue, stLength);
-                        p_pcBuffer += stLength;
-                    }
                 }
             }
-            *p_pcBuffer++ = 0;
         }
-        return bResult;
+        *p_pcBuffer++ = 0;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::compare
 */
-    bool MDNSResponder::stcMDNSServiceTxts::compare(const MDNSResponder::stcMDNSServiceTxts& p_Other) const
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNSServiceTxts::compare(const MDNSResponder::stcMDNSServiceTxts& p_Other) const
+{
+
+    bool    bResult = false;
 
-        if ((bResult = (length() == p_Other.length())))
+    if ((bResult = (length() == p_Other.length())))
+    {
+        // Compare A->B
+        for (const stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
         {
-            // Compare A->B
-            for (const stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
-            {
-                const stcMDNSServiceTxt* pOtherTxt = p_Other.find(pTxt->m_pcKey);
-                bResult                            = ((pOtherTxt) && (pTxt->m_pcValue) && (pOtherTxt->m_pcValue) && (strlen(pTxt->m_pcValue) == strlen(pOtherTxt->m_pcValue)) && (0 == strcmp(pTxt->m_pcValue, pOtherTxt->m_pcValue)));
-            }
-            // Compare B->A
-            for (const stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; ((bResult) && (pOtherTxt)); pOtherTxt = pOtherTxt->m_pNext)
-            {
-                const stcMDNSServiceTxt* pTxt = find(pOtherTxt->m_pcKey);
-                bResult                       = ((pTxt) && (pOtherTxt->m_pcValue) && (pTxt->m_pcValue) && (strlen(pOtherTxt->m_pcValue) == strlen(pTxt->m_pcValue)) && (0 == strcmp(pOtherTxt->m_pcValue, pTxt->m_pcValue)));
-            }
+            const stcMDNSServiceTxt*    pOtherTxt = p_Other.find(pTxt->m_pcKey);
+            bResult = ((pOtherTxt) &&
+                       (pTxt->m_pcValue) &&
+                       (pOtherTxt->m_pcValue) &&
+                       (strlen(pTxt->m_pcValue) == strlen(pOtherTxt->m_pcValue)) &&
+                       (0 == strcmp(pTxt->m_pcValue, pOtherTxt->m_pcValue)));
+        }
+        // Compare B->A
+        for (const stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; ((bResult) && (pOtherTxt)); pOtherTxt = pOtherTxt->m_pNext)
+        {
+            const stcMDNSServiceTxt*    pTxt = find(pOtherTxt->m_pcKey);
+            bResult = ((pTxt) &&
+                       (pOtherTxt->m_pcValue) &&
+                       (pTxt->m_pcValue) &&
+                       (strlen(pOtherTxt->m_pcValue) == strlen(pTxt->m_pcValue)) &&
+                       (0 == strcmp(pOtherTxt->m_pcValue, pTxt->m_pcValue)));
         }
-        return bResult;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::operator==
 */
-    bool MDNSResponder::stcMDNSServiceTxts::operator==(const stcMDNSServiceTxts& p_Other) const
-    {
-        return compare(p_Other);
-    }
+bool MDNSResponder::stcMDNSServiceTxts::operator==(const stcMDNSServiceTxts& p_Other) const
+{
+
+    return compare(p_Other);
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceTxts::operator!=
 */
-    bool MDNSResponder::stcMDNSServiceTxts::operator!=(const stcMDNSServiceTxts& p_Other) const
-    {
-        return !compare(p_Other);
-    }
+bool MDNSResponder::stcMDNSServiceTxts::operator!=(const stcMDNSServiceTxts& p_Other) const
+{
 
-    /**
+    return !compare(p_Other);
+}
+
+
+/**
     MDNSResponder::stcMDNS_MsgHeader
 
     A MDNS message header.
 
 */
 
-    /*
+/*
     MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader
 */
-    MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader(uint16_t      p_u16ID /*= 0*/,
-                                                        bool          p_bQR /*= false*/,
-                                                        unsigned char p_ucOpcode /*= 0*/,
-                                                        bool          p_bAA /*= false*/,
-                                                        bool          p_bTC /*= false*/,
-                                                        bool          p_bRD /*= false*/,
-                                                        bool          p_bRA /*= false*/,
-                                                        unsigned char p_ucRCode /*= 0*/,
-                                                        uint16_t      p_u16QDCount /*= 0*/,
-                                                        uint16_t      p_u16ANCount /*= 0*/,
-                                                        uint16_t      p_u16NSCount /*= 0*/,
-                                                        uint16_t      p_u16ARCount /*= 0*/) :
-        m_u16ID(p_u16ID),
+MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader(uint16_t p_u16ID /*= 0*/,
+        bool p_bQR /*= false*/,
+        unsigned char p_ucOpcode /*= 0*/,
+        bool p_bAA /*= false*/,
+        bool p_bTC /*= false*/,
+        bool p_bRD /*= false*/,
+        bool p_bRA /*= false*/,
+        unsigned char p_ucRCode /*= 0*/,
+        uint16_t p_u16QDCount /*= 0*/,
+        uint16_t p_u16ANCount /*= 0*/,
+        uint16_t p_u16NSCount /*= 0*/,
+        uint16_t p_u16ARCount /*= 0*/)
+    :   m_u16ID(p_u16ID),
         m_1bQR(p_bQR), m_4bOpcode(p_ucOpcode), m_1bAA(p_bAA), m_1bTC(p_bTC), m_1bRD(p_bRD),
         m_1bRA(p_bRA), m_3bZ(0), m_4bRCode(p_ucRCode),
         m_u16QDCount(p_u16QDCount),
         m_u16ANCount(p_u16ANCount),
         m_u16NSCount(p_u16NSCount),
         m_u16ARCount(p_u16ARCount)
-    {
-    }
+{
+
+}
+
 
-    /**
+/**
     MDNSResponder::stcMDNS_RRDomain
 
     A MDNS domain object.
@@ -637,272 +690,297 @@ namespace MDNSImplementation
 
 */
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain constructor
 */
-    MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(void) :
-        m_u16NameLength(0)
-    {
-        clear();
-    }
+MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(void)
+    :   m_u16NameLength(0)
+{
+
+    clear();
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain copy-constructor
 */
-    MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other) :
-        m_u16NameLength(0)
-    {
-        operator=(p_Other);
-    }
+MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other)
+    :   m_u16NameLength(0)
+{
 
-    /*
+    operator=(p_Other);
+}
+
+/*
     MDNSResponder::stcMDNS_RRDomain::operator =
 */
-    MDNSResponder::stcMDNS_RRDomain& MDNSResponder::stcMDNS_RRDomain::operator=(const stcMDNS_RRDomain& p_Other)
+MDNSResponder::stcMDNS_RRDomain& MDNSResponder::stcMDNS_RRDomain::operator=(const stcMDNS_RRDomain& p_Other)
+{
+
+    if (&p_Other != this)
     {
-        if (&p_Other != this)
-        {
-            memcpy(m_acName, p_Other.m_acName, sizeof(m_acName));
-            m_u16NameLength = p_Other.m_u16NameLength;
-        }
-        return *this;
+        memcpy(m_acName, p_Other.m_acName, sizeof(m_acName));
+        m_u16NameLength = p_Other.m_u16NameLength;
     }
+    return *this;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRDomain::clear
 */
-    bool MDNSResponder::stcMDNS_RRDomain::clear(void)
-    {
-        memset(m_acName, 0, sizeof(m_acName));
-        m_u16NameLength = 0;
-        return true;
-    }
+bool MDNSResponder::stcMDNS_RRDomain::clear(void)
+{
 
-    /*
+    memset(m_acName, 0, sizeof(m_acName));
+    m_u16NameLength = 0;
+    return true;
+}
+
+/*
     MDNSResponder::stcMDNS_RRDomain::addLabel
 */
-    bool MDNSResponder::stcMDNS_RRDomain::addLabel(const char* p_pcLabel,
-                                                   bool        p_bPrependUnderline /*= false*/)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNS_RRDomain::addLabel(const char* p_pcLabel,
+        bool p_bPrependUnderline /*= false*/)
+{
+
+    bool    bResult = false;
 
-        size_t stLength = (p_pcLabel
-                               ? (strlen(p_pcLabel) + (p_bPrependUnderline ? 1 : 0))
-                               : 0);
-        if ((MDNS_DOMAIN_LABEL_MAXLENGTH >= stLength) && (MDNS_DOMAIN_MAXLENGTH >= (m_u16NameLength + (1 + stLength))))
+    size_t  stLength = (p_pcLabel
+                        ? (strlen(p_pcLabel) + (p_bPrependUnderline ? 1 : 0))
+                        : 0);
+    if ((MDNS_DOMAIN_LABEL_MAXLENGTH >= stLength) &&
+            (MDNS_DOMAIN_MAXLENGTH >= (m_u16NameLength + (1 + stLength))))
+    {
+        // Length byte
+        m_acName[m_u16NameLength] = (unsigned char)stLength;    // Might be 0!
+        ++m_u16NameLength;
+        // Label
+        if (stLength)
         {
-            // Length byte
-            m_acName[m_u16NameLength] = (unsigned char)stLength;  // Might be 0!
-            ++m_u16NameLength;
-            // Label
-            if (stLength)
+            if (p_bPrependUnderline)
             {
-                if (p_bPrependUnderline)
-                {
-                    m_acName[m_u16NameLength++] = '_';
-                    --stLength;
-                }
-                strncpy(&(m_acName[m_u16NameLength]), p_pcLabel, stLength);
-                m_acName[m_u16NameLength + stLength] = 0;
-                m_u16NameLength += stLength;
+                m_acName[m_u16NameLength++] = '_';
+                --stLength;
             }
-            bResult = true;
+            strncpy(&(m_acName[m_u16NameLength]), p_pcLabel, stLength); m_acName[m_u16NameLength + stLength] = 0;
+            m_u16NameLength += stLength;
         }
-        return bResult;
+        bResult = true;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRDomain::compare
 */
-    bool MDNSResponder::stcMDNS_RRDomain::compare(const stcMDNS_RRDomain& p_Other) const
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNS_RRDomain::compare(const stcMDNS_RRDomain& p_Other) const
+{
 
-        if (m_u16NameLength == p_Other.m_u16NameLength)
+    bool    bResult = false;
+
+    if (m_u16NameLength == p_Other.m_u16NameLength)
+    {
+        const char* pT = m_acName;
+        const char* pO = p_Other.m_acName;
+        while ((pT) &&
+                (pO) &&
+                (*((unsigned char*)pT) == *((unsigned char*)pO)) &&                  // Same length AND
+                (0 == strncasecmp((pT + 1), (pO + 1), *((unsigned char*)pT))))     // Same content
         {
-            const char* pT = m_acName;
-            const char* pO = p_Other.m_acName;
-            while ((pT) && (pO) && (*((unsigned char*)pT) == *((unsigned char*)pO)) &&  // Same length AND
-                   (0 == strncasecmp((pT + 1), (pO + 1), *((unsigned char*)pT))))       // Same content
+            if (*((unsigned char*)pT))              // Not 0
             {
-                if (*((unsigned char*)pT))  // Not 0
-                {
-                    pT += (1 + *((unsigned char*)pT));  // Shift by length byte and length
-                    pO += (1 + *((unsigned char*)pO));
-                }
-                else  // Is 0 -> Successfully reached the end
-                {
-                    bResult = true;
-                    break;
-                }
+                pT += (1 + * ((unsigned char*)pT)); // Shift by length byte and length
+                pO += (1 + * ((unsigned char*)pO));
+            }
+            else                                    // Is 0 -> Successfully reached the end
+            {
+                bResult = true;
+                break;
             }
         }
-        return bResult;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRDomain::operator ==
 */
-    bool MDNSResponder::stcMDNS_RRDomain::operator==(const stcMDNS_RRDomain& p_Other) const
-    {
-        return compare(p_Other);
-    }
+bool MDNSResponder::stcMDNS_RRDomain::operator==(const stcMDNS_RRDomain& p_Other) const
+{
 
-    /*
+    return compare(p_Other);
+}
+
+/*
     MDNSResponder::stcMDNS_RRDomain::operator !=
 */
-    bool MDNSResponder::stcMDNS_RRDomain::operator!=(const stcMDNS_RRDomain& p_Other) const
-    {
-        return !compare(p_Other);
-    }
+bool MDNSResponder::stcMDNS_RRDomain::operator!=(const stcMDNS_RRDomain& p_Other) const
+{
+
+    return !compare(p_Other);
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRDomain::operator >
 */
-    bool MDNSResponder::stcMDNS_RRDomain::operator>(const stcMDNS_RRDomain& p_Other) const
-    {
-        // TODO: Check, if this is a good idea...
-        return !compare(p_Other);
-    }
+bool MDNSResponder::stcMDNS_RRDomain::operator>(const stcMDNS_RRDomain& p_Other) const
+{
 
-    /*
+    // TODO: Check, if this is a good idea...
+    return !compare(p_Other);
+}
+
+/*
     MDNSResponder::stcMDNS_RRDomain::c_strLength
 */
-    size_t MDNSResponder::stcMDNS_RRDomain::c_strLength(void) const
-    {
-        size_t stLength = 0;
+size_t MDNSResponder::stcMDNS_RRDomain::c_strLength(void) const
+{
 
-        unsigned char* pucLabelLength = (unsigned char*)m_acName;
-        while (*pucLabelLength)
-        {
-            stLength += (*pucLabelLength + 1 /* +1 for '.' or '\0'*/);
-            pucLabelLength += (*pucLabelLength + 1);
-        }
-        return stLength;
+    size_t          stLength = 0;
+
+    unsigned char*  pucLabelLength = (unsigned char*)m_acName;
+    while (*pucLabelLength)
+    {
+        stLength += (*pucLabelLength + 1 /* +1 for '.' or '\0'*/);
+        pucLabelLength += (*pucLabelLength + 1);
     }
+    return stLength;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRDomain::c_str
 */
-    bool MDNSResponder::stcMDNS_RRDomain::c_str(char* p_pcBuffer)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNS_RRDomain::c_str(char* p_pcBuffer)
+{
 
-        if (p_pcBuffer)
+    bool bResult = false;
+
+    if (p_pcBuffer)
+    {
+        *p_pcBuffer = 0;
+        unsigned char* pucLabelLength = (unsigned char*)m_acName;
+        while (*pucLabelLength)
         {
-            *p_pcBuffer                   = 0;
-            unsigned char* pucLabelLength = (unsigned char*)m_acName;
-            while (*pucLabelLength)
-            {
-                memcpy(p_pcBuffer, (const char*)(pucLabelLength + 1), *pucLabelLength);
-                p_pcBuffer += *pucLabelLength;
-                pucLabelLength += (*pucLabelLength + 1);
-                *p_pcBuffer++ = (*pucLabelLength ? '.' : '\0');
-            }
-            bResult = true;
+            memcpy(p_pcBuffer, (const char*)(pucLabelLength + 1), *pucLabelLength);
+            p_pcBuffer += *pucLabelLength;
+            pucLabelLength += (*pucLabelLength + 1);
+            *p_pcBuffer++ = (*pucLabelLength ? '.' : '\0');
         }
-        return bResult;
+        bResult = true;
     }
+    return bResult;
+}
 
-    /**
+
+/**
     MDNSResponder::stcMDNS_RRAttributes
 
     A MDNS attributes object.
 
 */
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes constructor
 */
-    MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(uint16_t p_u16Type /*= 0*/,
-                                                              uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/) :
-        m_u16Type(p_u16Type),
+MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(uint16_t p_u16Type /*= 0*/,
+        uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/)
+    :   m_u16Type(p_u16Type),
         m_u16Class(p_u16Class)
-    {
-    }
+{
+
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes copy-constructor
 */
-    MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
-    {
-        operator=(p_Other);
-    }
+MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
+{
 
-    /*
+    operator=(p_Other);
+}
+
+/*
     MDNSResponder::stcMDNS_RRAttributes::operator =
 */
-    MDNSResponder::stcMDNS_RRAttributes& MDNSResponder::stcMDNS_RRAttributes::operator=(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
+MDNSResponder::stcMDNS_RRAttributes& MDNSResponder::stcMDNS_RRAttributes::operator=(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
+{
+
+    if (&p_Other != this)
     {
-        if (&p_Other != this)
-        {
-            m_u16Type  = p_Other.m_u16Type;
-            m_u16Class = p_Other.m_u16Class;
-        }
-        return *this;
+        m_u16Type = p_Other.m_u16Type;
+        m_u16Class = p_Other.m_u16Class;
     }
+    return *this;
+}
 
-    /**
+
+/**
     MDNSResponder::stcMDNS_RRHeader
 
     A MDNS record header (domain and attributes) object.
 
 */
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader constructor
 */
-    MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(void)
-    {
-    }
+MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(void)
+{
+
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader copy-constructor
 */
-    MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other)
-    {
-        operator=(p_Other);
-    }
+MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other)
+{
 
-    /*
+    operator=(p_Other);
+}
+
+/*
     MDNSResponder::stcMDNS_RRHeader::operator =
 */
-    MDNSResponder::stcMDNS_RRHeader& MDNSResponder::stcMDNS_RRHeader::operator=(const MDNSResponder::stcMDNS_RRHeader& p_Other)
+MDNSResponder::stcMDNS_RRHeader& MDNSResponder::stcMDNS_RRHeader::operator=(const MDNSResponder::stcMDNS_RRHeader& p_Other)
+{
+
+    if (&p_Other != this)
     {
-        if (&p_Other != this)
-        {
-            m_Domain     = p_Other.m_Domain;
-            m_Attributes = p_Other.m_Attributes;
-        }
-        return *this;
+        m_Domain = p_Other.m_Domain;
+        m_Attributes = p_Other.m_Attributes;
     }
+    return *this;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRHeader::clear
 */
-    bool MDNSResponder::stcMDNS_RRHeader::clear(void)
-    {
-        m_Domain.clear();
-        return true;
-    }
+bool MDNSResponder::stcMDNS_RRHeader::clear(void)
+{
 
-    /**
+    m_Domain.clear();
+    return true;
+}
+
+
+/**
     MDNSResponder::stcMDNS_RRQuestion
 
     A MDNS question record object (header + question flags)
 
 */
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion constructor
 */
-    MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion(void) :
-        m_pNext(0),
+MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion(void)
+    :   m_pNext(0),
         m_bUnicast(false)
-    {
-    }
+{
+
+}
 
-    /**
+
+/**
     MDNSResponder::stcMDNS_RRAnswer
 
     A MDNS answer record object (header + answer content).
@@ -910,48 +988,53 @@ namespace MDNSImplementation
 
 */
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer constructor
 */
-    MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer(enuAnswerType                          p_AnswerType,
-                                                      const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                      uint32_t                               p_u32TTL) :
-        m_pNext(0),
+MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer(enuAnswerType p_AnswerType,
+        const MDNSResponder::stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL)
+    :   m_pNext(0),
         m_AnswerType(p_AnswerType),
         m_Header(p_Header),
         m_u32TTL(p_u32TTL)
-    {
-        // Extract 'cache flush'-bit
-        m_bCacheFlush = (m_Header.m_Attributes.m_u16Class & 0x8000);
-        m_Header.m_Attributes.m_u16Class &= (~0x8000);
-    }
+{
+
+    // Extract 'cache flush'-bit
+    m_bCacheFlush = (m_Header.m_Attributes.m_u16Class & 0x8000);
+    m_Header.m_Attributes.m_u16Class &= (~0x8000);
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer destructor
 */
-    MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer(void)
-    {
-    }
+MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer(void)
+{
 
-    /*
+}
+
+/*
     MDNSResponder::stcMDNS_RRAnswer::answerType
 */
-    MDNSResponder::enuAnswerType MDNSResponder::stcMDNS_RRAnswer::answerType(void) const
-    {
-        return m_AnswerType;
-    }
+MDNSResponder::enuAnswerType MDNSResponder::stcMDNS_RRAnswer::answerType(void) const
+{
+
+    return m_AnswerType;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswer::clear
 */
-    bool MDNSResponder::stcMDNS_RRAnswer::clear(void)
-    {
-        m_pNext = 0;
-        m_Header.clear();
-        return true;
-    }
+bool MDNSResponder::stcMDNS_RRAnswer::clear(void)
+{
 
-    /**
+    m_pNext = 0;
+    m_Header.clear();
+    return true;
+}
+
+
+/**
     MDNSResponder::stcMDNS_RRAnswerA
 
     A MDNS A answer object.
@@ -960,35 +1043,39 @@ namespace MDNSImplementation
 */
 
 #ifdef MDNS_IP4_SUPPORT
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA constructor
 */
-    MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                        uint32_t                               p_u32TTL) :
-        stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL),
+MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL)
+    :   stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL),
         m_IPAddress(0, 0, 0, 0)
-    {
-    }
+{
+
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA destructor
 */
-    MDNSResponder::stcMDNS_RRAnswerA::~stcMDNS_RRAnswerA(void)
-    {
-        clear();
-    }
+MDNSResponder::stcMDNS_RRAnswerA::~stcMDNS_RRAnswerA(void)
+{
+
+    clear();
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerA::clear
 */
-    bool MDNSResponder::stcMDNS_RRAnswerA::clear(void)
-    {
-        m_IPAddress = IPAddress(0, 0, 0, 0);
-        return true;
-    }
+bool MDNSResponder::stcMDNS_RRAnswerA::clear(void)
+{
+
+    m_IPAddress = IPAddress(0, 0, 0, 0);
+    return true;
+}
 #endif
 
-    /**
+
+/**
     MDNSResponder::stcMDNS_RRAnswerPTR
 
     A MDNS PTR answer object.
@@ -996,33 +1083,37 @@ namespace MDNSImplementation
 
 */
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR constructor
 */
-    MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                            uint32_t                               p_u32TTL) :
-        stcMDNS_RRAnswer(AnswerType_PTR, p_Header, p_u32TTL)
-    {
-    }
+MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL)
+    :   stcMDNS_RRAnswer(AnswerType_PTR, p_Header, p_u32TTL)
+{
+
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR destructor
 */
-    MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR(void)
-    {
-        clear();
-    }
+MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR(void)
+{
+
+    clear();
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerPTR::clear
 */
-    bool MDNSResponder::stcMDNS_RRAnswerPTR::clear(void)
-    {
-        m_PTRDomain.clear();
-        return true;
-    }
+bool MDNSResponder::stcMDNS_RRAnswerPTR::clear(void)
+{
 
-    /**
+    m_PTRDomain.clear();
+    return true;
+}
+
+
+/**
     MDNSResponder::stcMDNS_RRAnswerTXT
 
     A MDNS TXT answer object.
@@ -1030,33 +1121,37 @@ namespace MDNSImplementation
 
 */
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT constructor
 */
-    MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                            uint32_t                               p_u32TTL) :
-        stcMDNS_RRAnswer(AnswerType_TXT, p_Header, p_u32TTL)
-    {
-    }
+MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL)
+    :   stcMDNS_RRAnswer(AnswerType_TXT, p_Header, p_u32TTL)
+{
+
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT destructor
 */
-    MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT(void)
-    {
-        clear();
-    }
+MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT(void)
+{
+
+    clear();
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerTXT::clear
 */
-    bool MDNSResponder::stcMDNS_RRAnswerTXT::clear(void)
-    {
-        m_Txts.clear();
-        return true;
-    }
+bool MDNSResponder::stcMDNS_RRAnswerTXT::clear(void)
+{
+
+    m_Txts.clear();
+    return true;
+}
 
-    /**
+
+/**
     MDNSResponder::stcMDNS_RRAnswerAAAA
 
     A MDNS AAAA answer object.
@@ -1065,33 +1160,37 @@ namespace MDNSImplementation
 */
 
 #ifdef MDNS_IP6_SUPPORT
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA constructor
 */
-    MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                              uint32_t                               p_u32TTL) :
-        stcMDNS_RRAnswer(AnswerType_AAAA, p_Header, p_u32TTL)
-    {
-    }
+MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL)
+    :   stcMDNS_RRAnswer(AnswerType_AAAA, p_Header, p_u32TTL)
+{
+
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA destructor
 */
-    MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA(void)
-    {
-        clear();
-    }
+MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA(void)
+{
+
+    clear();
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerAAAA::clear
 */
-    bool MDNSResponder::stcMDNS_RRAnswerAAAA::clear(void)
-    {
-        return true;
-    }
+bool MDNSResponder::stcMDNS_RRAnswerAAAA::clear(void)
+{
+
+    return true;
+}
 #endif
 
-    /**
+
+/**
     MDNSResponder::stcMDNS_RRAnswerSRV
 
     A MDNS SRV answer object.
@@ -1099,39 +1198,43 @@ namespace MDNSImplementation
 
 */
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV constructor
 */
-    MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                            uint32_t                               p_u32TTL) :
-        stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL),
+MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL)
+    :   stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL),
         m_u16Priority(0),
         m_u16Weight(0),
         m_u16Port(0)
-    {
-    }
+{
+
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV destructor
 */
-    MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV(void)
-    {
-        clear();
-    }
+MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV(void)
+{
+
+    clear();
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerSRV::clear
 */
-    bool MDNSResponder::stcMDNS_RRAnswerSRV::clear(void)
-    {
-        m_u16Priority = 0;
-        m_u16Weight   = 0;
-        m_u16Port     = 0;
-        m_SRVDomain.clear();
-        return true;
-    }
+bool MDNSResponder::stcMDNS_RRAnswerSRV::clear(void)
+{
+
+    m_u16Priority = 0;
+    m_u16Weight = 0;
+    m_u16Port = 0;
+    m_SRVDomain.clear();
+    return true;
+}
 
-    /**
+
+/**
     MDNSResponder::stcMDNS_RRAnswerGeneric
 
     An unknown (generic) MDNS answer object.
@@ -1139,80 +1242,85 @@ namespace MDNSImplementation
 
 */
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric constructor
 */
-    MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
-                                                                    uint32_t                p_u32TTL) :
-        stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL),
+MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL)
+    :   stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL),
         m_u16RDLength(0),
         m_pu8RDData(0)
-    {
-    }
+{
+
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric destructor
 */
-    MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric(void)
-    {
-        clear();
-    }
+MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric(void)
+{
+
+    clear();
+}
 
-    /*
+/*
     MDNSResponder::stcMDNS_RRAnswerGeneric::clear
 */
-    bool MDNSResponder::stcMDNS_RRAnswerGeneric::clear(void)
-    {
-        if (m_pu8RDData)
-        {
-            delete[] m_pu8RDData;
-            m_pu8RDData = 0;
-        }
-        m_u16RDLength = 0;
+bool MDNSResponder::stcMDNS_RRAnswerGeneric::clear(void)
+{
 
-        return true;
+    if (m_pu8RDData)
+    {
+        delete[] m_pu8RDData;
+        m_pu8RDData = 0;
     }
+    m_u16RDLength = 0;
+
+    return true;
+}
 
-    /**
+
+/**
     MDNSResponder::stcProbeInformation
 
     Probing status information for a host or service domain
 
 */
 
-    /*
+/*
     MDNSResponder::stcProbeInformation::stcProbeInformation constructor
 */
-    MDNSResponder::stcProbeInformation::stcProbeInformation(void) :
-        m_ProbingStatus(ProbingStatus_WaitingForData),
+MDNSResponder::stcProbeInformation::stcProbeInformation(void)
+    :   m_ProbingStatus(ProbingStatus_WaitingForData),
         m_u8SentCount(0),
         m_Timeout(esp8266::polledTimeout::oneShotMs::neverExpires),
         m_bConflict(false),
         m_bTiebreakNeeded(false),
         m_fnHostProbeResultCallback(0),
         m_fnServiceProbeResultCallback(0)
-    {
-    }
+{
+}
 
-    /*
+/*
     MDNSResponder::stcProbeInformation::clear
 */
-    bool MDNSResponder::stcProbeInformation::clear(bool p_bClearUserdata /*= false*/)
+bool MDNSResponder::stcProbeInformation::clear(bool p_bClearUserdata /*= false*/)
+{
+
+    m_ProbingStatus = ProbingStatus_WaitingForData;
+    m_u8SentCount = 0;
+    m_Timeout.resetToNeverExpires();
+    m_bConflict = false;
+    m_bTiebreakNeeded = false;
+    if (p_bClearUserdata)
     {
-        m_ProbingStatus = ProbingStatus_WaitingForData;
-        m_u8SentCount   = 0;
-        m_Timeout.resetToNeverExpires();
-        m_bConflict       = false;
-        m_bTiebreakNeeded = false;
-        if (p_bClearUserdata)
-        {
-            m_fnHostProbeResultCallback    = 0;
-            m_fnServiceProbeResultCallback = 0;
-        }
-        return true;
+        m_fnHostProbeResultCallback = 0;
+        m_fnServiceProbeResultCallback = 0;
     }
+    return true;
+}
 
-    /**
+/**
     MDNSResponder::stcMDNSService
 
     A MDNS service object (to be announced by the MDNS responder)
@@ -1223,13 +1331,13 @@ namespace MDNSImplementation
     reset in '_sendMDNSMessage' afterwards.
 */
 
-    /*
+/*
     MDNSResponder::stcMDNSService::stcMDNSService constructor
 */
-    MDNSResponder::stcMDNSService::stcMDNSService(const char* p_pcName /*= 0*/,
-                                                  const char* p_pcService /*= 0*/,
-                                                  const char* p_pcProtocol /*= 0*/) :
-        m_pNext(0),
+MDNSResponder::stcMDNSService::stcMDNSService(const char* p_pcName /*= 0*/,
+        const char* p_pcService /*= 0*/,
+        const char* p_pcProtocol /*= 0*/)
+    :   m_pNext(0),
         m_pcName(0),
         m_bAutoName(false),
         m_pcService(0),
@@ -1237,134 +1345,143 @@ namespace MDNSImplementation
         m_u16Port(0),
         m_u8ReplyMask(0),
         m_fnTxtCallback(0)
-    {
-        setName(p_pcName);
-        setService(p_pcService);
-        setProtocol(p_pcProtocol);
-    }
+{
+
+    setName(p_pcName);
+    setService(p_pcService);
+    setProtocol(p_pcProtocol);
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSService::~stcMDNSService destructor
 */
-    MDNSResponder::stcMDNSService::~stcMDNSService(void)
-    {
-        releaseName();
-        releaseService();
-        releaseProtocol();
-    }
+MDNSResponder::stcMDNSService::~stcMDNSService(void)
+{
+
+    releaseName();
+    releaseService();
+    releaseProtocol();
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSService::setName
 */
-    bool MDNSResponder::stcMDNSService::setName(const char* p_pcName)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNSService::setName(const char* p_pcName)
+{
 
-        releaseName();
-        size_t stLength = (p_pcName ? strlen(p_pcName) : 0);
-        if (stLength)
-        {
-            if ((bResult = (0 != (m_pcName = new char[stLength + 1]))))
-            {
-                strncpy(m_pcName, p_pcName, stLength);
-                m_pcName[stLength] = 0;
-            }
-        }
-        else
+    bool bResult = false;
+
+    releaseName();
+    size_t stLength = (p_pcName ? strlen(p_pcName) : 0);
+    if (stLength)
+    {
+        if ((bResult = (0 != (m_pcName = new char[stLength + 1]))))
         {
-            bResult = true;
+            strncpy(m_pcName, p_pcName, stLength);
+            m_pcName[stLength] = 0;
         }
-        return bResult;
     }
+    else
+    {
+        bResult = true;
+    }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSService::releaseName
 */
-    bool MDNSResponder::stcMDNSService::releaseName(void)
+bool MDNSResponder::stcMDNSService::releaseName(void)
+{
+
+    if (m_pcName)
     {
-        if (m_pcName)
-        {
-            delete[] m_pcName;
-            m_pcName = 0;
-        }
-        return true;
+        delete[] m_pcName;
+        m_pcName = 0;
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSService::setService
 */
-    bool MDNSResponder::stcMDNSService::setService(const char* p_pcService)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNSService::setService(const char* p_pcService)
+{
 
-        releaseService();
-        size_t stLength = (p_pcService ? strlen(p_pcService) : 0);
-        if (stLength)
-        {
-            if ((bResult = (0 != (m_pcService = new char[stLength + 1]))))
-            {
-                strncpy(m_pcService, p_pcService, stLength);
-                m_pcService[stLength] = 0;
-            }
-        }
-        else
+    bool bResult = false;
+
+    releaseService();
+    size_t stLength = (p_pcService ? strlen(p_pcService) : 0);
+    if (stLength)
+    {
+        if ((bResult = (0 != (m_pcService = new char[stLength + 1]))))
         {
-            bResult = true;
+            strncpy(m_pcService, p_pcService, stLength);
+            m_pcService[stLength] = 0;
         }
-        return bResult;
     }
+    else
+    {
+        bResult = true;
+    }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSService::releaseService
 */
-    bool MDNSResponder::stcMDNSService::releaseService(void)
+bool MDNSResponder::stcMDNSService::releaseService(void)
+{
+
+    if (m_pcService)
     {
-        if (m_pcService)
-        {
-            delete[] m_pcService;
-            m_pcService = 0;
-        }
-        return true;
+        delete[] m_pcService;
+        m_pcService = 0;
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSService::setProtocol
 */
-    bool MDNSResponder::stcMDNSService::setProtocol(const char* p_pcProtocol)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNSService::setProtocol(const char* p_pcProtocol)
+{
 
-        releaseProtocol();
-        size_t stLength = (p_pcProtocol ? strlen(p_pcProtocol) : 0);
-        if (stLength)
-        {
-            if ((bResult = (0 != (m_pcProtocol = new char[stLength + 1]))))
-            {
-                strncpy(m_pcProtocol, p_pcProtocol, stLength);
-                m_pcProtocol[stLength] = 0;
-            }
-        }
-        else
+    bool bResult = false;
+
+    releaseProtocol();
+    size_t stLength = (p_pcProtocol ? strlen(p_pcProtocol) : 0);
+    if (stLength)
+    {
+        if ((bResult = (0 != (m_pcProtocol = new char[stLength + 1]))))
         {
-            bResult = true;
+            strncpy(m_pcProtocol, p_pcProtocol, stLength);
+            m_pcProtocol[stLength] = 0;
         }
-        return bResult;
     }
+    else
+    {
+        bResult = true;
+    }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSService::releaseProtocol
 */
-    bool MDNSResponder::stcMDNSService::releaseProtocol(void)
+bool MDNSResponder::stcMDNSService::releaseProtocol(void)
+{
+
+    if (m_pcProtocol)
     {
-        if (m_pcProtocol)
-        {
-            delete[] m_pcProtocol;
-            m_pcProtocol = 0;
-        }
-        return true;
+        delete[] m_pcProtocol;
+        m_pcProtocol = 0;
     }
+    return true;
+}
+
 
-    /**
+/**
     MDNSResponder::stcMDNSServiceQuery
 
     A MDNS service query object.
@@ -1375,7 +1492,7 @@ namespace MDNSImplementation
 
 */
 
-    /**
+/**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer
 
     One answer for a service query.
@@ -1396,7 +1513,7 @@ namespace MDNSImplementation
 
 */
 
-    /**
+/**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL
 
     The TTL (Time-To-Live) for an specific answer content.
@@ -1445,7 +1562,8 @@ namespace MDNSImplementation
             (m_TTLTimeFlag.flagged()));
     }*/
 
-    /**
+
+/**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL
 
     The TTL (Time-To-Live) for an specific answer content.
@@ -1455,128 +1573,141 @@ namespace MDNSImplementation
 
 */
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL constructor
 */
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL(void) :
-        m_u32TTL(0),
+MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL(void)
+    :   m_u32TTL(0),
         m_TTLTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
         m_timeoutLevel(TIMEOUTLEVEL_UNSET)
-    {
-    }
+{
 
-    /*
+}
+
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set(uint32_t p_u32TTL)
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set(uint32_t p_u32TTL)
+{
+
+    m_u32TTL = p_u32TTL;
+    if (m_u32TTL)
     {
-        m_u32TTL = p_u32TTL;
-        if (m_u32TTL)
-        {
-            m_timeoutLevel = TIMEOUTLEVEL_BASE;  // Set to 80%
-            m_TTLTimeout.reset(timeout());
-        }
-        else
-        {
-            m_timeoutLevel = TIMEOUTLEVEL_UNSET;  // undef
-            m_TTLTimeout.resetToNeverExpires();
-        }
-        return true;
+        m_timeoutLevel = TIMEOUTLEVEL_BASE;             // Set to 80%
+        m_TTLTimeout.reset(timeout());
+    }
+    else
+    {
+        m_timeoutLevel = TIMEOUTLEVEL_UNSET;            // undef
+        m_TTLTimeout.resetToNeverExpires();
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::flagged
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::flagged(void)
-    {
-        return ((m_u32TTL) && (TIMEOUTLEVEL_UNSET != m_timeoutLevel) && (m_TTLTimeout.expired()));
-    }
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::flagged(void)
+{
+
+    return ((m_u32TTL) &&
+            (TIMEOUTLEVEL_UNSET != m_timeoutLevel) &&
+            (m_TTLTimeout.expired()));
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::restart
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::restart(void)
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::restart(void)
+{
+
+    bool    bResult = true;
+
+    if ((TIMEOUTLEVEL_BASE <= m_timeoutLevel) &&    // >= 80% AND
+            (TIMEOUTLEVEL_FINAL > m_timeoutLevel))      // < 100%
     {
-        bool bResult = true;
 
-        if ((TIMEOUTLEVEL_BASE <= m_timeoutLevel) &&  // >= 80% AND
-            (TIMEOUTLEVEL_FINAL > m_timeoutLevel))    // < 100%
-        {
-            m_timeoutLevel += TIMEOUTLEVEL_INTERVAL;  // increment by 5%
-            m_TTLTimeout.reset(timeout());
-        }
-        else
-        {
-            bResult = false;
-            m_TTLTimeout.resetToNeverExpires();
-            m_timeoutLevel = TIMEOUTLEVEL_UNSET;
-        }
-        return bResult;
+        m_timeoutLevel += TIMEOUTLEVEL_INTERVAL;    // increment by 5%
+        m_TTLTimeout.reset(timeout());
+    }
+    else
+    {
+        bResult = false;
+        m_TTLTimeout.resetToNeverExpires();
+        m_timeoutLevel = TIMEOUTLEVEL_UNSET;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::prepareDeletion
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::prepareDeletion(void)
-    {
-        m_timeoutLevel = TIMEOUTLEVEL_FINAL;
-        m_TTLTimeout.reset(1 * 1000);  // See RFC 6762, 10.1
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::prepareDeletion(void)
+{
 
-        return true;
-    }
+    m_timeoutLevel = TIMEOUTLEVEL_FINAL;
+    m_TTLTimeout.reset(1 * 1000);   // See RFC 6762, 10.1
 
-    /*
+    return true;
+}
+
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel(void) const
-    {
-        return (TIMEOUTLEVEL_FINAL == m_timeoutLevel);
-    }
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel(void) const
+{
 
-    /*
+    return (TIMEOUTLEVEL_FINAL == m_timeoutLevel);
+}
+
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout
 */
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::timeType MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout(void) const
+MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::timeType MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout(void) const
+{
+    if (TIMEOUTLEVEL_BASE == m_timeoutLevel)            // 80%
     {
-        if (TIMEOUTLEVEL_BASE == m_timeoutLevel)  // 80%
-        {
-            return (m_u32TTL * 800L);  // to milliseconds
-        }
-        else if ((TIMEOUTLEVEL_BASE < m_timeoutLevel) &&  // >80% AND
-                 (TIMEOUTLEVEL_FINAL >= m_timeoutLevel))  // <= 100%
-        {
-            return (m_u32TTL * 50L);
-        }  // else: invalid
-        return MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::neverExpires;
+        return (m_u32TTL * 800L);                  // to milliseconds
     }
+    else if ((TIMEOUTLEVEL_BASE < m_timeoutLevel) &&    // >80% AND
+             (TIMEOUTLEVEL_FINAL >= m_timeoutLevel))    // <= 100%
+    {
+
+        return (m_u32TTL * 50L);
+    }   // else: invalid
+    return MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::neverExpires;
+}
+
 
 #ifdef MDNS_IP4_SUPPORT
-    /**
+/**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address
 
 */
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address constructor
 */
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address(IPAddress p_IPAddress,
-                                                                                uint32_t  p_u32TTL /*= 0*/) :
-        m_pNext(0),
+MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address(IPAddress p_IPAddress,
+        uint32_t p_u32TTL /*= 0*/)
+    :   m_pNext(0),
         m_IPAddress(p_IPAddress)
-    {
-        m_TTL.set(p_u32TTL);
-    }
+{
+
+    m_TTL.set(p_u32TTL);
+}
 #endif
 
-    /**
+
+/**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer
 */
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer constructor
 */
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer(void) :
-        m_pNext(0),
+MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer(void)
+    :   m_pNext(0),
         m_pcServiceDomain(0),
         m_pcHostDomain(0),
         m_u16Port(0),
@@ -1588,375 +1719,404 @@ namespace MDNSImplementation
         m_pIP6Addresses(0),
 #endif
         m_u32ContentFlags(0)
-    {
-    }
+{
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer destructor
 */
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer(void)
-    {
-        clear();
-    }
+MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer(void)
+{
 
-    /*
+    clear();
+}
+
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear(void)
-    {
-        return ((releaseTxts()) &&
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear(void)
+{
+
+    return ((releaseTxts()) &&
 #ifdef MDNS_IP4_SUPPORT
-                (releaseIP4Addresses()) &&
+            (releaseIP4Addresses()) &&
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                (releaseIP6Addresses())
+            (releaseIP6Addresses())
 #endif
-                    (releaseHostDomain())
-                && (releaseServiceDomain()));
-    }
+            (releaseHostDomain()) &&
+            (releaseServiceDomain()));
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocServiceDomain
 
     Alloc memory for the char array representation of the service domain.
 
 */
-    char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocServiceDomain(size_t p_stLength)
+char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocServiceDomain(size_t p_stLength)
+{
+
+    releaseServiceDomain();
+    if (p_stLength)
     {
-        releaseServiceDomain();
-        if (p_stLength)
-        {
-            m_pcServiceDomain = new char[p_stLength];
-        }
-        return m_pcServiceDomain;
+        m_pcServiceDomain = new char[p_stLength];
     }
+    return m_pcServiceDomain;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseServiceDomain
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseServiceDomain(void)
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseServiceDomain(void)
+{
+
+    if (m_pcServiceDomain)
     {
-        if (m_pcServiceDomain)
-        {
-            delete[] m_pcServiceDomain;
-            m_pcServiceDomain = 0;
-        }
-        return true;
+        delete[] m_pcServiceDomain;
+        m_pcServiceDomain = 0;
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocHostDomain
 
     Alloc memory for the char array representation of the host domain.
 
 */
-    char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocHostDomain(size_t p_stLength)
+char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocHostDomain(size_t p_stLength)
+{
+
+    releaseHostDomain();
+    if (p_stLength)
     {
-        releaseHostDomain();
-        if (p_stLength)
-        {
-            m_pcHostDomain = new char[p_stLength];
-        }
-        return m_pcHostDomain;
+        m_pcHostDomain = new char[p_stLength];
     }
+    return m_pcHostDomain;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseHostDomain
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseHostDomain(void)
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseHostDomain(void)
+{
+
+    if (m_pcHostDomain)
     {
-        if (m_pcHostDomain)
-        {
-            delete[] m_pcHostDomain;
-            m_pcHostDomain = 0;
-        }
-        return true;
+        delete[] m_pcHostDomain;
+        m_pcHostDomain = 0;
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocTxts
 
     Alloc memory for the char array representation of the TXT items.
 
 */
-    char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocTxts(size_t p_stLength)
+char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocTxts(size_t p_stLength)
+{
+
+    releaseTxts();
+    if (p_stLength)
     {
-        releaseTxts();
-        if (p_stLength)
-        {
-            m_pcTxts = new char[p_stLength];
-        }
-        return m_pcTxts;
+        m_pcTxts = new char[p_stLength];
     }
+    return m_pcTxts;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseTxts
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseTxts(void)
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseTxts(void)
+{
+
+    if (m_pcTxts)
     {
-        if (m_pcTxts)
-        {
-            delete[] m_pcTxts;
-            m_pcTxts = 0;
-        }
-        return true;
+        delete[] m_pcTxts;
+        m_pcTxts = 0;
     }
+    return true;
+}
 
 #ifdef MDNS_IP4_SUPPORT
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP4Addresses
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP4Addresses(void)
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP4Addresses(void)
+{
+
+    while (m_pIP4Addresses)
     {
-        while (m_pIP4Addresses)
-        {
-            stcIP4Address* pNext = m_pIP4Addresses->m_pNext;
-            delete m_pIP4Addresses;
-            m_pIP4Addresses = pNext;
-        }
-        return true;
+        stcIP4Address*  pNext = m_pIP4Addresses->m_pNext;
+        delete m_pIP4Addresses;
+        m_pIP4Addresses = pNext;
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
+{
 
-        if (p_pIP4Address)
-        {
-            p_pIP4Address->m_pNext = m_pIP4Addresses;
-            m_pIP4Addresses        = p_pIP4Address;
-            bResult                = true;
-        }
-        return bResult;
+    bool bResult = false;
+
+    if (p_pIP4Address)
+    {
+        p_pIP4Address->m_pNext = m_pIP4Addresses;
+        m_pIP4Addresses = p_pIP4Address;
+        bResult = true;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
+{
+
+    bool    bResult = false;
 
-        if (p_pIP4Address)
+    if (p_pIP4Address)
+    {
+        stcIP4Address*  pPred = m_pIP4Addresses;
+        while ((pPred) &&
+                (pPred->m_pNext != p_pIP4Address))
         {
-            stcIP4Address* pPred = m_pIP4Addresses;
-            while ((pPred) && (pPred->m_pNext != p_pIP4Address))
-            {
-                pPred = pPred->m_pNext;
-            }
-            if (pPred)
-            {
-                pPred->m_pNext = p_pIP4Address->m_pNext;
-                delete p_pIP4Address;
-                bResult = true;
-            }
-            else if (m_pIP4Addresses == p_pIP4Address)  // No predecessor, but first item
-            {
-                m_pIP4Addresses = p_pIP4Address->m_pNext;
-                delete p_pIP4Address;
-                bResult = true;
-            }
+            pPred = pPred->m_pNext;
+        }
+        if (pPred)
+        {
+            pPred->m_pNext = p_pIP4Address->m_pNext;
+            delete p_pIP4Address;
+            bResult = true;
+        }
+        else if (m_pIP4Addresses == p_pIP4Address)     // No predecessor, but first item
+        {
+            m_pIP4Addresses = p_pIP4Address->m_pNext;
+            delete p_pIP4Address;
+            bResult = true;
         }
-        return bResult;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address (const)
 */
-    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress) const
-    {
-        return (stcIP4Address*)(((const stcAnswer*)this)->findIP4Address(p_IPAddress));
-    }
+const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress) const
+{
 
-    /*
+    return (stcIP4Address*)(((const stcAnswer*)this)->findIP4Address(p_IPAddress));
+}
+
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address
 */
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress)
+MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress)
+{
+
+    stcIP4Address*  pIP4Address = m_pIP4Addresses;
+    while (pIP4Address)
     {
-        stcIP4Address* pIP4Address = m_pIP4Addresses;
-        while (pIP4Address)
+        if (pIP4Address->m_IPAddress == p_IPAddress)
         {
-            if (pIP4Address->m_IPAddress == p_IPAddress)
-            {
-                break;
-            }
-            pIP4Address = pIP4Address->m_pNext;
+            break;
         }
-        return pIP4Address;
+        pIP4Address = pIP4Address->m_pNext;
     }
+    return pIP4Address;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount
 */
-    uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount(void) const
-    {
-        uint32_t u32Count = 0;
+uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount(void) const
+{
 
-        stcIP4Address* pIP4Address = m_pIP4Addresses;
-        while (pIP4Address)
-        {
-            ++u32Count;
-            pIP4Address = pIP4Address->m_pNext;
-        }
-        return u32Count;
+    uint32_t    u32Count = 0;
+
+    stcIP4Address*  pIP4Address = m_pIP4Addresses;
+    while (pIP4Address)
+    {
+        ++u32Count;
+        pIP4Address = pIP4Address->m_pNext;
     }
+    return u32Count;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex
 */
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index)
-    {
-        return (stcIP4Address*)(((const stcAnswer*)this)->IP4AddressAtIndex(p_u32Index));
-    }
+MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index)
+{
 
-    /*
+    return (stcIP4Address*)(((const stcAnswer*)this)->IP4AddressAtIndex(p_u32Index));
+}
+
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex (const)
 */
-    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index) const
+const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index) const
+{
+
+    const stcIP4Address*    pIP4Address = 0;
+
+    if (((uint32_t)(-1) != p_u32Index) &&
+            (m_pIP4Addresses))
     {
-        const stcIP4Address* pIP4Address = 0;
 
-        if (((uint32_t)(-1) != p_u32Index) && (m_pIP4Addresses))
-        {
-            uint32_t u32Index;
-            for (pIP4Address = m_pIP4Addresses, u32Index = 0; ((pIP4Address) && (u32Index < p_u32Index)); pIP4Address = pIP4Address->m_pNext, ++u32Index)
-                ;
-        }
-        return pIP4Address;
+        uint32_t    u32Index;
+        for (pIP4Address = m_pIP4Addresses, u32Index = 0; ((pIP4Address) && (u32Index < p_u32Index)); pIP4Address = pIP4Address->m_pNext, ++u32Index);
     }
+    return pIP4Address;
+}
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP6Addresses
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP6Addresses(void)
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP6Addresses(void)
+{
+
+    while (m_pIP6Addresses)
     {
-        while (m_pIP6Addresses)
-        {
-            stcIP6Address* pNext = m_pIP6Addresses->m_pNext;
-            delete m_pIP6Addresses;
-            m_pIP6Addresses = pNext;
-        }
-        return true;
+        stcIP6Address*  pNext = m_pIP6Addresses->m_pNext;
+        delete m_pIP6Addresses;
+        m_pIP6Addresses = pNext;
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
+{
 
-        if (p_pIP6Address)
-        {
-            p_pIP6Address->m_pNext = m_pIP6Addresses;
-            m_pIP6Addresses        = p_pIP6Address;
-            bResult                = true;
-        }
-        return bResult;
+    bool bResult = false;
+
+    if (p_pIP6Address)
+    {
+        p_pIP6Address->m_pNext = m_pIP6Addresses;
+        m_pIP6Addresses = p_pIP6Address;
+        bResult = true;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address
 */
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
+{
+
+    bool    bResult = false;
 
-        if (p_pIP6Address)
+    if (p_pIP6Address)
+    {
+        stcIP6Address*  pPred = m_pIP6Addresses;
+        while ((pPred) &&
+                (pPred->m_pNext != p_pIP6Address))
         {
-            stcIP6Address* pPred = m_pIP6Addresses;
-            while ((pPred) && (pPred->m_pNext != p_pIP6Address))
-            {
-                pPred = pPred->m_pNext;
-            }
-            if (pPred)
-            {
-                pPred->m_pNext = p_pIP6Address->m_pNext;
-                delete p_pIP6Address;
-                bResult = true;
-            }
-            else if (m_pIP6Addresses == p_pIP6Address)  // No predecessor, but first item
-            {
-                m_pIP6Addresses = p_pIP6Address->m_pNext;
-                delete p_pIP6Address;
-                bResult = true;
-            }
+            pPred = pPred->m_pNext;
+        }
+        if (pPred)
+        {
+            pPred->m_pNext = p_pIP6Address->m_pNext;
+            delete p_pIP6Address;
+            bResult = true;
+        }
+        else if (m_pIP6Addresses == p_pIP6Address)     // No predecessor, but first item
+        {
+            m_pIP6Addresses = p_pIP6Address->m_pNext;
+            delete p_pIP6Address;
+            bResult = true;
         }
-        return bResult;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address
 */
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IP6Address& p_IPAddress)
-    {
-        return (stcIP6Address*)(((const stcAnswer*)this)->findIP6Address(p_IPAddress));
-    }
+MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IP6Address& p_IPAddress)
+{
+
+    return (stcIP6Address*)(((const stcAnswer*)this)->findIP6Address(p_IPAddress));
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address (const)
 */
-    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IPAddress& p_IPAddress) const
+const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IPAddress& p_IPAddress) const
+{
+
+    const stcIP6Address*    pIP6Address = m_pIP6Addresses;
+    while (pIP6Address)
     {
-        const stcIP6Address* pIP6Address = m_pIP6Addresses;
-        while (pIP6Address)
+        if (p_IP6Address->m_IPAddress == p_IPAddress)
         {
-            if (p_IP6Address->m_IPAddress == p_IPAddress)
-            {
-                break;
-            }
-            pIP6Address = pIP6Address->m_pNext;
+            break;
         }
-        return pIP6Address;
+        pIP6Address = pIP6Address->m_pNext;
     }
+    return pIP6Address;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount
 */
-    uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount(void) const
-    {
-        uint32_t u32Count = 0;
+uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount(void) const
+{
 
-        stcIP6Address* pIP6Address = m_pIP6Addresses;
-        while (pIP6Address)
-        {
-            ++u32Count;
-            pIP6Address = pIP6Address->m_pNext;
-        }
-        return u32Count;
+    uint32_t    u32Count = 0;
+
+    stcIP6Address*  pIP6Address = m_pIP6Addresses;
+    while (pIP6Address)
+    {
+        ++u32Count;
+        pIP6Address = pIP6Address->m_pNext;
     }
+    return u32Count;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex (const)
 */
-    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index) const
-    {
-        return (stcIP6Address*)(((const stcAnswer*)this)->IP6AddressAtIndex(p_u32Index));
-    }
+const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index) const
+{
 
-    /*
+    return (stcIP6Address*)(((const stcAnswer*)this)->IP6AddressAtIndex(p_u32Index));
+}
+
+/*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex
 */
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index)
+MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index)
+{
+
+    stcIP6Address*    pIP6Address = 0;
+
+    if (((uint32_t)(-1) != p_u32Index) &&
+            (m_pIP6Addresses))
     {
-        stcIP6Address* pIP6Address = 0;
 
-        if (((uint32_t)(-1) != p_u32Index) && (m_pIP6Addresses))
-        {
-            uint32_t u32Index;
-            for (pIP6Address = m_pIP6Addresses, u32Index = 0; ((pIP6Address) && (u32Index < p_u32Index)); pIP6Address = pIP6Address->m_pNext, ++u32Index)
-                ;
-        }
-        return pIP6Address;
+        uint32_t    u32Index;
+        for (pIP6Address = m_pIP6Addresses, u32Index = 0; ((pIP6Address) && (u32Index < p_u32Index)); pIP6Address = pIP6Address->m_pNext, ++u32Index);
     }
+    return pIP6Address;
+}
 #endif
 
-    /**
+
+/**
     MDNSResponder::stcMDNSServiceQuery
 
     A service query object.
@@ -1973,186 +2133,200 @@ namespace MDNSImplementation
     Service query object may be connected to a linked list.
 */
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery constructor
 */
-    MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery(void) :
-        m_pNext(0),
+MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery(void)
+    :   m_pNext(0),
         m_fnCallback(0),
         m_bLegacyQuery(false),
         m_u8SentCount(0),
         m_ResendTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
         m_bAwaitingAnswers(true),
         m_pAnswers(0)
-    {
-        clear();
-    }
+{
 
-    /*
+    clear();
+}
+
+/*
     MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery destructor
 */
-    MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery(void)
-    {
-        clear();
-    }
+MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery(void)
+{
+
+    clear();
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::clear
 */
-    bool MDNSResponder::stcMDNSServiceQuery::clear(void)
+bool MDNSResponder::stcMDNSServiceQuery::clear(void)
+{
+
+    m_fnCallback = 0;
+    m_bLegacyQuery = false;
+    m_u8SentCount = 0;
+    m_ResendTimeout.resetToNeverExpires();
+    m_bAwaitingAnswers = true;
+    while (m_pAnswers)
     {
-        m_fnCallback   = 0;
-        m_bLegacyQuery = false;
-        m_u8SentCount  = 0;
-        m_ResendTimeout.resetToNeverExpires();
-        m_bAwaitingAnswers = true;
-        while (m_pAnswers)
-        {
-            stcAnswer* pNext = m_pAnswers->m_pNext;
-            delete m_pAnswers;
-            m_pAnswers = pNext;
-        }
-        return true;
+        stcAnswer*  pNext = m_pAnswers->m_pNext;
+        delete m_pAnswers;
+        m_pAnswers = pNext;
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::answerCount
 */
-    uint32_t MDNSResponder::stcMDNSServiceQuery::answerCount(void) const
-    {
-        uint32_t u32Count = 0;
+uint32_t MDNSResponder::stcMDNSServiceQuery::answerCount(void) const
+{
 
-        stcAnswer* pAnswer = m_pAnswers;
-        while (pAnswer)
-        {
-            ++u32Count;
-            pAnswer = pAnswer->m_pNext;
-        }
-        return u32Count;
+    uint32_t    u32Count = 0;
+
+    stcAnswer*  pAnswer = m_pAnswers;
+    while (pAnswer)
+    {
+        ++u32Count;
+        pAnswer = pAnswer->m_pNext;
     }
+    return u32Count;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::answerAtIndex
 */
-    const MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index) const
+const MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index) const
+{
+
+    const stcAnswer*    pAnswer = 0;
+
+    if (((uint32_t)(-1) != p_u32Index) &&
+            (m_pAnswers))
     {
-        const stcAnswer* pAnswer = 0;
 
-        if (((uint32_t)(-1) != p_u32Index) && (m_pAnswers))
-        {
-            uint32_t u32Index;
-            for (pAnswer = m_pAnswers, u32Index = 0; ((pAnswer) && (u32Index < p_u32Index)); pAnswer = pAnswer->m_pNext, ++u32Index)
-                ;
-        }
-        return pAnswer;
+        uint32_t    u32Index;
+        for (pAnswer = m_pAnswers, u32Index = 0; ((pAnswer) && (u32Index < p_u32Index)); pAnswer = pAnswer->m_pNext, ++u32Index);
     }
+    return pAnswer;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::answerAtIndex
 */
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index)
-    {
-        return (stcAnswer*)(((const stcMDNSServiceQuery*)this)->answerAtIndex(p_u32Index));
-    }
+MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index)
+{
+
+    return (stcAnswer*)(((const stcMDNSServiceQuery*)this)->answerAtIndex(p_u32Index));
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::indexOfAnswer
 */
-    uint32_t MDNSResponder::stcMDNSServiceQuery::indexOfAnswer(const MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer) const
-    {
-        uint32_t u32Index = 0;
+uint32_t MDNSResponder::stcMDNSServiceQuery::indexOfAnswer(const MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer) const
+{
 
-        for (const stcAnswer* pAnswer = m_pAnswers; pAnswer; pAnswer = pAnswer->m_pNext, ++u32Index)
+    uint32_t    u32Index = 0;
+
+    for (const stcAnswer* pAnswer = m_pAnswers; pAnswer; pAnswer = pAnswer->m_pNext, ++u32Index)
+    {
+        if (pAnswer == p_pAnswer)
         {
-            if (pAnswer == p_pAnswer)
-            {
-                return u32Index;
-            }
+            return u32Index;
         }
-        return ((uint32_t)(-1));
     }
+    return ((uint32_t)(-1));
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::addAnswer
 */
-    bool MDNSResponder::stcMDNSServiceQuery::addAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNSServiceQuery::addAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
+{
 
-        if (p_pAnswer)
-        {
-            p_pAnswer->m_pNext = m_pAnswers;
-            m_pAnswers         = p_pAnswer;
-            bResult            = true;
-        }
-        return bResult;
+    bool    bResult = false;
+
+    if (p_pAnswer)
+    {
+        p_pAnswer->m_pNext = m_pAnswers;
+        m_pAnswers = p_pAnswer;
+        bResult = true;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::removeAnswer
 */
-    bool MDNSResponder::stcMDNSServiceQuery::removeAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
-    {
-        bool bResult = false;
+bool MDNSResponder::stcMDNSServiceQuery::removeAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
+{
+
+    bool    bResult = false;
 
-        if (p_pAnswer)
+    if (p_pAnswer)
+    {
+        stcAnswer*  pPred = m_pAnswers;
+        while ((pPred) &&
+                (pPred->m_pNext != p_pAnswer))
         {
-            stcAnswer* pPred = m_pAnswers;
-            while ((pPred) && (pPred->m_pNext != p_pAnswer))
-            {
-                pPred = pPred->m_pNext;
-            }
-            if (pPred)
-            {
-                pPred->m_pNext = p_pAnswer->m_pNext;
-                delete p_pAnswer;
-                bResult = true;
-            }
-            else if (m_pAnswers == p_pAnswer)  // No predecessor, but first item
-            {
-                m_pAnswers = p_pAnswer->m_pNext;
-                delete p_pAnswer;
-                bResult = true;
-            }
+            pPred = pPred->m_pNext;
+        }
+        if (pPred)
+        {
+            pPred->m_pNext = p_pAnswer->m_pNext;
+            delete p_pAnswer;
+            bResult = true;
+        }
+        else if (m_pAnswers == p_pAnswer)   // No predecessor, but first item
+        {
+            m_pAnswers = p_pAnswer->m_pNext;
+            delete p_pAnswer;
+            bResult = true;
         }
-        return bResult;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::findAnswerForServiceDomain
 */
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForServiceDomain(const MDNSResponder::stcMDNS_RRDomain& p_ServiceDomain)
+MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForServiceDomain(const MDNSResponder::stcMDNS_RRDomain& p_ServiceDomain)
+{
+
+    stcAnswer*  pAnswer = m_pAnswers;
+    while (pAnswer)
     {
-        stcAnswer* pAnswer = m_pAnswers;
-        while (pAnswer)
+        if (pAnswer->m_ServiceDomain == p_ServiceDomain)
         {
-            if (pAnswer->m_ServiceDomain == p_ServiceDomain)
-            {
-                break;
-            }
-            pAnswer = pAnswer->m_pNext;
+            break;
         }
-        return pAnswer;
+        pAnswer = pAnswer->m_pNext;
     }
+    return pAnswer;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSServiceQuery::findAnswerForHostDomain
 */
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForHostDomain(const MDNSResponder::stcMDNS_RRDomain& p_HostDomain)
+MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForHostDomain(const MDNSResponder::stcMDNS_RRDomain& p_HostDomain)
+{
+
+    stcAnswer*  pAnswer = m_pAnswers;
+    while (pAnswer)
     {
-        stcAnswer* pAnswer = m_pAnswers;
-        while (pAnswer)
+        if (pAnswer->m_HostDomain == p_HostDomain)
         {
-            if (pAnswer->m_HostDomain == p_HostDomain)
-            {
-                break;
-            }
-            pAnswer = pAnswer->m_pNext;
+            break;
         }
-        return pAnswer;
+        pAnswer = pAnswer->m_pNext;
     }
+    return pAnswer;
+}
 
-    /**
+
+/**
     MDNSResponder::stcMDNSSendParameter
 
     A 'collection' of properties and flags for one MDNS query or response.
@@ -2162,138 +2336,152 @@ namespace MDNSImplementation
 
 */
 
-    /**
+/**
     MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem
 
     A cached host or service domain, incl. the offset in the UDP output buffer.
 
 */
 
-    /*
+/*
     MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem constructor
 */
-    MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem(const void* p_pHostnameOrService,
-                                                                                bool        p_bAdditionalData,
-                                                                                uint32_t    p_u16Offset) :
-        m_pNext(0),
+MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem(const void* p_pHostnameOrService,
+        bool p_bAdditionalData,
+        uint32_t p_u16Offset)
+    :   m_pNext(0),
         m_pHostnameOrService(p_pHostnameOrService),
         m_bAdditionalData(p_bAdditionalData),
         m_u16Offset(p_u16Offset)
-    {
-    }
+{
 
-    /**
+}
+
+/**
     MDNSResponder::stcMDNSSendParameter
 */
 
-    /*
+/*
     MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter constructor
 */
-    MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter(void) :
-        m_pQuestions(0),
+MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter(void)
+    :   m_pQuestions(0),
         m_pDomainCacheItems(0)
-    {
-        clear();
-    }
+{
+
+    clear();
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter destructor
 */
-    MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter(void)
-    {
-        clear();
-    }
+MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter(void)
+{
 
-    /*
+    clear();
+}
+
+/*
     MDNSResponder::stcMDNSSendParameter::clear
 */
-    bool MDNSResponder::stcMDNSSendParameter::clear(void)
-    {
-        m_u16ID           = 0;
-        m_u8HostReplyMask = 0;
-        m_u16Offset       = 0;
+bool MDNSResponder::stcMDNSSendParameter::clear(void)
+{
 
-        m_bLegacyQuery = false;
-        m_bResponse    = false;
-        m_bAuthorative = false;
-        m_bUnicast     = false;
-        m_bUnannounce  = false;
+    m_u16ID = 0;
+    m_u8HostReplyMask = 0;
+    m_u16Offset = 0;
 
-        m_bCacheFlush = true;
+    m_bLegacyQuery = false;
+    m_bResponse = false;
+    m_bAuthorative = false;
+    m_bUnicast = false;
+    m_bUnannounce = false;
 
-        while (m_pQuestions)
-        {
-            stcMDNS_RRQuestion* pNext = m_pQuestions->m_pNext;
-            delete m_pQuestions;
-            m_pQuestions = pNext;
-        }
+    m_bCacheFlush = true;
 
-        return clearCachedNames();
-        ;
+    while (m_pQuestions)
+    {
+        stcMDNS_RRQuestion* pNext = m_pQuestions->m_pNext;
+        delete m_pQuestions;
+        m_pQuestions = pNext;
     }
-    /*
+
+    return clearCachedNames();;
+}
+/*
     MDNSResponder::stcMDNSSendParameter::clear cached names
 */
-    bool MDNSResponder::stcMDNSSendParameter::clearCachedNames(void)
-    {
-        m_u16Offset = 0;
+bool MDNSResponder::stcMDNSSendParameter::clearCachedNames(void)
+{
 
-        while (m_pDomainCacheItems)
-        {
-            stcDomainCacheItem* pNext = m_pDomainCacheItems->m_pNext;
-            delete m_pDomainCacheItems;
-            m_pDomainCacheItems = pNext;
-        }
-        m_pDomainCacheItems = nullptr;
+    m_u16Offset = 0;
 
-        return true;
+    while (m_pDomainCacheItems)
+    {
+        stcDomainCacheItem* pNext = m_pDomainCacheItems->m_pNext;
+        delete m_pDomainCacheItems;
+        m_pDomainCacheItems = pNext;
     }
+    m_pDomainCacheItems = nullptr;
+
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSSendParameter::shiftOffset
 */
-    bool MDNSResponder::stcMDNSSendParameter::shiftOffset(uint16_t p_u16Shift)
-    {
-        m_u16Offset += p_u16Shift;
-        return true;
-    }
+bool MDNSResponder::stcMDNSSendParameter::shiftOffset(uint16_t p_u16Shift)
+{
 
-    /*
+    m_u16Offset += p_u16Shift;
+    return true;
+}
+
+/*
     MDNSResponder::stcMDNSSendParameter::addDomainCacheItem
 */
-    bool MDNSResponder::stcMDNSSendParameter::addDomainCacheItem(const void* p_pHostnameOrService,
-                                                                 bool        p_bAdditionalData,
-                                                                 uint16_t    p_u16Offset)
+bool MDNSResponder::stcMDNSSendParameter::addDomainCacheItem(const void* p_pHostnameOrService,
+        bool p_bAdditionalData,
+        uint16_t p_u16Offset)
+{
+
+    bool    bResult = false;
+
+    stcDomainCacheItem* pNewItem = 0;
+    if ((p_pHostnameOrService) &&
+            (p_u16Offset) &&
+            ((pNewItem = new stcDomainCacheItem(p_pHostnameOrService, p_bAdditionalData, p_u16Offset))))
     {
-        bool bResult = false;
 
-        stcDomainCacheItem* pNewItem = 0;
-        if ((p_pHostnameOrService) && (p_u16Offset) && ((pNewItem = new stcDomainCacheItem(p_pHostnameOrService, p_bAdditionalData, p_u16Offset))))
-        {
-            pNewItem->m_pNext = m_pDomainCacheItems;
-            bResult           = ((m_pDomainCacheItems = pNewItem));
-        }
-        return bResult;
+        pNewItem->m_pNext = m_pDomainCacheItems;
+        bResult = ((m_pDomainCacheItems = pNewItem));
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset
 */
-    uint16_t MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset(const void* p_pHostnameOrService,
-                                                                         bool        p_bAdditionalData) const
-    {
-        const stcDomainCacheItem* pCacheItem = m_pDomainCacheItems;
+uint16_t MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset(const void* p_pHostnameOrService,
+        bool p_bAdditionalData) const
+{
+
+    const stcDomainCacheItem*   pCacheItem = m_pDomainCacheItems;
 
-        for (; pCacheItem; pCacheItem = pCacheItem->m_pNext)
+    for (; pCacheItem; pCacheItem = pCacheItem->m_pNext)
+    {
+        if ((pCacheItem->m_pHostnameOrService == p_pHostnameOrService) &&
+                (pCacheItem->m_bAdditionalData == p_bAdditionalData))   // Found cache item
         {
-            if ((pCacheItem->m_pHostnameOrService == p_pHostnameOrService) && (pCacheItem->m_bAdditionalData == p_bAdditionalData))  // Found cache item
-            {
-                break;
-            }
+            break;
         }
-        return (pCacheItem ? pCacheItem->m_u16Offset : 0);
     }
+    return (pCacheItem ? pCacheItem->m_u16Offset : 0);
+}
+
+}   // namespace MDNSImplementation
+
+} // namespace esp8266
+
 
-}  // namespace MDNSImplementation
 
-}  // namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
index d66509adb5..ebe66dff1c 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
@@ -22,8 +22,7 @@
 
 */
 
-extern "C"
-{
+extern "C" {
 #include "user_interface.h"
 }
 
@@ -31,39 +30,43 @@ extern "C"
 #include "LEAmDNS_lwIPdefs.h"
 #include "LEAmDNS_Priv.h"
 
+
 namespace esp8266
 {
+
 /*
     LEAmDNS
 */
 namespace MDNSImplementation
 {
-    /**
+
+/**
     CONST STRINGS
 */
-    static const char* scpcLocal    = "local";
-    static const char* scpcServices = "services";
-    static const char* scpcDNSSD    = "dns-sd";
-    static const char* scpcUDP      = "udp";
-    //static const char*                    scpcTCP                 = "tcp";
+static const char*                      scpcLocal               = "local";
+static const char*                      scpcServices            = "services";
+static const char*                      scpcDNSSD               = "dns-sd";
+static const char*                      scpcUDP                 = "udp";
+//static const char*                    scpcTCP                 = "tcp";
 
 #ifdef MDNS_IP4_SUPPORT
-    static const char* scpcReverseIP4Domain = "in-addr";
+static const char*                  scpcReverseIP4Domain    = "in-addr";
 #endif
 #ifdef MDNS_IP6_SUPPORT
-    static const char* scpcReverseIP6Domain = "ip6";
+static const char*                  scpcReverseIP6Domain    = "ip6";
 #endif
-    static const char* scpcReverseTopDomain = "arpa";
+static const char*                      scpcReverseTopDomain    = "arpa";
 
-    /**
+/**
     TRANSFER
 */
 
-    /**
+
+/**
     SENDING
 */
 
-    /*
+/*
     MDNSResponder::_sendMDNSMessage
 
     Unicast responses are prepared and sent directly to the querier.
@@ -72,77 +75,82 @@ namespace MDNSImplementation
     Any reply flags in installed services are removed at the end!
 
 */
-    bool MDNSResponder::_sendMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        bool bResult = true;
+bool MDNSResponder::_sendMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
 
-        if (p_rSendParameter.m_bResponse && p_rSendParameter.m_bUnicast)  // Unicast response  -> Send to querier
-        {
-            DEBUG_EX_ERR(if (!m_pUDPContext->getRemoteAddress())
-                         {
-                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: MISSING remote address for response!\n"));
-                         });
-            IPAddress ipRemote;
-            ipRemote = m_pUDPContext->getRemoteAddress();
-            bResult  = ((_prepareMDNSMessage(p_rSendParameter, m_pUDPContext->getInputNetif()->ip_addr)) && (m_pUDPContext->sendTimeout(ipRemote, m_pUDPContext->getRemotePort(), MDNS_UDPCONTEXT_TIMEOUT)));
-        }
-        else  // Multicast response
-        {
-            bResult = _sendMDNSMessage_Multicast(p_rSendParameter);
-        }
+    bool    bResult = true;
 
-        // Finally clear service reply masks
-        for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
-        {
-            pService->m_u8ReplyMask = 0;
-        }
+    if (p_rSendParameter.m_bResponse &&
+            p_rSendParameter.m_bUnicast)    // Unicast response  -> Send to querier
+    {
+        DEBUG_EX_ERR(if (!m_pUDPContext->getRemoteAddress())
+    {
+        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: MISSING remote address for response!\n"));
+        });
+        IPAddress   ipRemote;
+        ipRemote = m_pUDPContext->getRemoteAddress();
+        bResult = ((_prepareMDNSMessage(p_rSendParameter, m_pUDPContext->getInputNetif()->ip_addr)) &&
+                   (m_pUDPContext->sendTimeout(ipRemote, m_pUDPContext->getRemotePort(), MDNS_UDPCONTEXT_TIMEOUT)));
+    }
+    else                                // Multicast response
+    {
+        bResult = _sendMDNSMessage_Multicast(p_rSendParameter);
+    }
 
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: FAILED!\n"));
-                     });
-        return bResult;
+    // Finally clear service reply masks
+    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+    {
+        pService->m_u8ReplyMask = 0;
     }
 
-    /*
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: FAILED!\n"));
+    });
+    return bResult;
+}
+
+/*
     MDNSResponder::_sendMDNSMessage_Multicast
 
     Fills the UDP output buffer (via _prepareMDNSMessage) and sends the buffer
     via the selected WiFi interface (Station or AP)
 */
-    bool MDNSResponder::_sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        bool bResult = false;
+bool MDNSResponder::_sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
 
-        for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+    bool    bResult = false;
+
+    for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+    {
+        if (netif_is_up(pNetIf))
         {
-            if (netif_is_up(pNetIf))
-            {
-                IPAddress fromIPAddress;
-                //fromIPAddress = _getResponseMulticastInterface();
-                fromIPAddress = pNetIf->ip_addr;
-                m_pUDPContext->setMulticastInterface(fromIPAddress);
+            IPAddress   fromIPAddress;
+            //fromIPAddress = _getResponseMulticastInterface();
+            fromIPAddress = pNetIf->ip_addr;
+            m_pUDPContext->setMulticastInterface(fromIPAddress);
 
 #ifdef MDNS_IP4_SUPPORT
-                IPAddress toMulticastAddress(DNS_MQUERY_IPV4_GROUP_INIT);
+            IPAddress   toMulticastAddress(DNS_MQUERY_IPV4_GROUP_INIT);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                //TODO: set multicast address
-                IPAddress toMulticastAddress(DNS_MQUERY_IPV6_GROUP_INIT);
+            //TODO: set multicast address
+            IPAddress   toMulticastAddress(DNS_MQUERY_IPV6_GROUP_INIT);
 #endif
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: Will send to '%s'.\n"), toMulticastAddress.toString().c_str()););
-                bResult = ((_prepareMDNSMessage(p_rSendParameter, fromIPAddress)) && (m_pUDPContext->sendTimeout(toMulticastAddress, DNS_MQUERY_PORT, MDNS_UDPCONTEXT_TIMEOUT)));
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: Will send to '%s'.\n"), toMulticastAddress.toString().c_str()););
+            bResult = ((_prepareMDNSMessage(p_rSendParameter, fromIPAddress)) &&
+                       (m_pUDPContext->sendTimeout(toMulticastAddress, DNS_MQUERY_PORT, MDNS_UDPCONTEXT_TIMEOUT)));
 
-                DEBUG_EX_ERR(if (!bResult)
-                             {
-                                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: FAILED!\n"));
-                             });
-            }
+            DEBUG_EX_ERR(if (!bResult)
+        {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: FAILED!\n"));
+            });
         }
-        return bResult;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_prepareMDNSMessage
 
     The MDNS message is composed in a two-step process.
@@ -151,275 +159,293 @@ namespace MDNSImplementation
     output buffer.
 
 */
-    bool MDNSResponder::_prepareMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter,
-                                            IPAddress                            p_IPAddress)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage\n")););
-        bool bResult = true;
-        p_rSendParameter.clearCachedNames();  // Need to remove cached names, p_SendParameter might have been used before on other interface
-
-        // Prepare header; count answers
-        stcMDNS_MsgHeader msgHeader(p_rSendParameter.m_u16ID, p_rSendParameter.m_bResponse, 0, p_rSendParameter.m_bAuthorative);
-        // If this is a response, the answers are anwers,
-        // else this is a query or probe and the answers go into auth section
-        uint16_t& ru16Answers = (p_rSendParameter.m_bResponse
-                                     ? msgHeader.m_u16ANCount
-                                     : msgHeader.m_u16NSCount);
-
-        /**
+bool MDNSResponder::_prepareMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter,
+                                        IPAddress p_IPAddress)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage\n")););
+    bool    bResult = true;
+    p_rSendParameter.clearCachedNames(); // Need to remove cached names, p_SendParameter might have been used before on other interface
+
+    // Prepare header; count answers
+    stcMDNS_MsgHeader  msgHeader(p_rSendParameter.m_u16ID, p_rSendParameter.m_bResponse, 0, p_rSendParameter.m_bAuthorative);
+    // If this is a response, the answers are anwers,
+    // else this is a query or probe and the answers go into auth section
+    uint16_t&           ru16Answers = (p_rSendParameter.m_bResponse
+                                       ? msgHeader.m_u16ANCount
+                                       : msgHeader.m_u16NSCount);
+
+    /**
         enuSequence
     */
-        enum enuSequence
+    enum enuSequence
+    {
+        Sequence_Count  = 0,
+        Sequence_Send   = 1
+    };
+
+    // Two step sequence: 'Count' and 'Send'
+    for (uint32_t sequence = Sequence_Count; ((bResult) && (sequence <= Sequence_Send)); ++sequence)
+    {
+        DEBUG_EX_INFO(
+            if (Sequence_Send == sequence)
+    {
+        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
+                              (unsigned)msgHeader.m_u16ID,
+                              (unsigned)msgHeader.m_1bQR, (unsigned)msgHeader.m_4bOpcode, (unsigned)msgHeader.m_1bAA, (unsigned)msgHeader.m_1bTC, (unsigned)msgHeader.m_1bRD,
+                              (unsigned)msgHeader.m_1bRA, (unsigned)msgHeader.m_4bRCode,
+                              (unsigned)msgHeader.m_u16QDCount,
+                              (unsigned)msgHeader.m_u16ANCount,
+                              (unsigned)msgHeader.m_u16NSCount,
+                              (unsigned)msgHeader.m_u16ARCount);
+        }
+        );
+        // Count/send
+        // Header
+        bResult = ((Sequence_Count == sequence)
+                   ? true
+                   : _writeMDNSMsgHeader(msgHeader, p_rSendParameter));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSMsgHeader FAILED!\n")););
+        // Questions
+        for (stcMDNS_RRQuestion* pQuestion = p_rSendParameter.m_pQuestions; ((bResult) && (pQuestion)); pQuestion = pQuestion->m_pNext)
         {
-            Sequence_Count = 0,
-            Sequence_Send  = 1
-        };
+            ((Sequence_Count == sequence)
+             ? ++msgHeader.m_u16QDCount
+             : (bResult = _writeMDNSQuestion(*pQuestion, p_rSendParameter)));
+            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSQuestion FAILED!\n")););
+        }
 
-        // Two step sequence: 'Count' and 'Send'
-        for (uint32_t sequence = Sequence_Count; ((bResult) && (sequence <= Sequence_Send)); ++sequence)
+        // Answers and authoritative answers
+#ifdef MDNS_IP4_SUPPORT
+        if ((bResult) &&
+                (p_rSendParameter.m_u8HostReplyMask & ContentFlag_A))
         {
-            DEBUG_EX_INFO(
-                if (Sequence_Send == sequence)
-                {
-                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
-                                          (unsigned)msgHeader.m_u16ID,
-                                          (unsigned)msgHeader.m_1bQR, (unsigned)msgHeader.m_4bOpcode, (unsigned)msgHeader.m_1bAA, (unsigned)msgHeader.m_1bTC, (unsigned)msgHeader.m_1bRD,
-                                          (unsigned)msgHeader.m_1bRA, (unsigned)msgHeader.m_4bRCode,
-                                          (unsigned)msgHeader.m_u16QDCount,
-                                          (unsigned)msgHeader.m_u16ANCount,
-                                          (unsigned)msgHeader.m_u16NSCount,
-                                          (unsigned)msgHeader.m_u16ARCount);
-                });
-            // Count/send
-            // Header
-            bResult = ((Sequence_Count == sequence)
-                           ? true
-                           : _writeMDNSMsgHeader(msgHeader, p_rSendParameter));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSMsgHeader FAILED!\n")););
-            // Questions
-            for (stcMDNS_RRQuestion* pQuestion = p_rSendParameter.m_pQuestions; ((bResult) && (pQuestion)); pQuestion = pQuestion->m_pNext)
+            ((Sequence_Count == sequence)
+             ? ++ru16Answers
+             : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
+            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(A) FAILED!\n")););
+        }
+        if ((bResult) &&
+                (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP4))
+        {
+            ((Sequence_Count == sequence)
+             ? ++ru16Answers
+             : (bResult = _writeMDNSAnswer_PTR_IP4(p_IPAddress, p_rSendParameter)));
+            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP4 FAILED!\n")););
+        }
+#endif
+#ifdef MDNS_IP6_SUPPORT
+        if ((bResult) &&
+                (p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA))
+        {
+            ((Sequence_Count == sequence)
+             ? ++ru16Answers
+             : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
+            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(A) FAILED!\n")););
+        }
+        if ((bResult) &&
+                (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP6))
+        {
+            ((Sequence_Count == sequence)
+             ? ++ru16Answers
+             : (bResult = _writeMDNSAnswer_PTR_IP6(p_IPAddress, p_rSendParameter)));
+            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP6 FAILED!\n")););
+        }
+#endif
+
+        for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+        {
+            if ((bResult) &&
+                    (pService->m_u8ReplyMask & ContentFlag_PTR_TYPE))
             {
                 ((Sequence_Count == sequence)
-                     ? ++msgHeader.m_u16QDCount
-                     : (bResult = _writeMDNSQuestion(*pQuestion, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSQuestion FAILED!\n")););
+                 ? ++ru16Answers
+                 : (bResult = _writeMDNSAnswer_PTR_TYPE(*pService, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_TYPE FAILED!\n")););
             }
-
-            // Answers and authoritative answers
-#ifdef MDNS_IP4_SUPPORT
-            if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_A))
+            if ((bResult) &&
+                    (pService->m_u8ReplyMask & ContentFlag_PTR_NAME))
             {
                 ((Sequence_Count == sequence)
-                     ? ++ru16Answers
-                     : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(A) FAILED!\n")););
+                 ? ++ru16Answers
+                 : (bResult = _writeMDNSAnswer_PTR_NAME(*pService, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_NAME FAILED!\n")););
             }
-            if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP4))
+            if ((bResult) &&
+                    (pService->m_u8ReplyMask & ContentFlag_SRV))
             {
                 ((Sequence_Count == sequence)
-                     ? ++ru16Answers
-                     : (bResult = _writeMDNSAnswer_PTR_IP4(p_IPAddress, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP4 FAILED!\n")););
+                 ? ++ru16Answers
+                 : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(A) FAILED!\n")););
             }
+            if ((bResult) &&
+                    (pService->m_u8ReplyMask & ContentFlag_TXT))
+            {
+                ((Sequence_Count == sequence)
+                 ? ++ru16Answers
+                 : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(A) FAILED!\n")););
+            }
+        }   // for services
+
+        // Additional answers
+#ifdef MDNS_IP4_SUPPORT
+        bool    bNeedsAdditionalAnswerA = false;
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA))
+        bool    bNeedsAdditionalAnswerAAAA = false;
+#endif
+        for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+        {
+            if ((bResult) &&
+                    (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) && // If PTR_NAME is requested, AND
+                    (!(pService->m_u8ReplyMask & ContentFlag_SRV)))     // NOT SRV -> add SRV as additional answer
             {
                 ((Sequence_Count == sequence)
-                     ? ++ru16Answers
-                     : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(A) FAILED!\n")););
+                 ? ++msgHeader.m_u16ARCount
+                 : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(B) FAILED!\n")););
             }
-            if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP6))
+            if ((bResult) &&
+                    (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) && // If PTR_NAME is requested, AND
+                    (!(pService->m_u8ReplyMask & ContentFlag_TXT)))     // NOT TXT -> add TXT as additional answer
             {
                 ((Sequence_Count == sequence)
-                     ? ++ru16Answers
-                     : (bResult = _writeMDNSAnswer_PTR_IP6(p_IPAddress, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP6 FAILED!\n")););
+                 ? ++msgHeader.m_u16ARCount
+                 : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(B) FAILED!\n")););
             }
-#endif
-
-            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+            if ((pService->m_u8ReplyMask & (ContentFlag_PTR_NAME | ContentFlag_SRV)) ||         // If service instance name or SRV OR
+                    (p_rSendParameter.m_u8HostReplyMask & (ContentFlag_A | ContentFlag_AAAA)))      // any host IP address is requested
             {
-                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_TYPE))
-                {
-                    ((Sequence_Count == sequence)
-                         ? ++ru16Answers
-                         : (bResult = _writeMDNSAnswer_PTR_TYPE(*pService, p_rSendParameter)));
-                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_TYPE FAILED!\n")););
-                }
-                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME))
-                {
-                    ((Sequence_Count == sequence)
-                         ? ++ru16Answers
-                         : (bResult = _writeMDNSAnswer_PTR_NAME(*pService, p_rSendParameter)));
-                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_NAME FAILED!\n")););
-                }
-                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_SRV))
-                {
-                    ((Sequence_Count == sequence)
-                         ? ++ru16Answers
-                         : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
-                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(A) FAILED!\n")););
-                }
-                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_TXT))
+#ifdef MDNS_IP4_SUPPORT
+                if ((bResult) &&
+                        (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_A)))            // Add IP4 address
                 {
-                    ((Sequence_Count == sequence)
-                         ? ++ru16Answers
-                         : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
-                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(A) FAILED!\n")););
+                    bNeedsAdditionalAnswerA = true;
                 }
-            }  // for services
-
-            // Additional answers
-#ifdef MDNS_IP4_SUPPORT
-            bool bNeedsAdditionalAnswerA = false;
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            bool bNeedsAdditionalAnswerAAAA = false;
-#endif
-            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
-            {
-                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) &&  // If PTR_NAME is requested, AND
-                    (!(pService->m_u8ReplyMask & ContentFlag_SRV)))                   // NOT SRV -> add SRV as additional answer
+                if ((bResult) &&
+                        (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA)))         // Add IP6 address
                 {
-                    ((Sequence_Count == sequence)
-                         ? ++msgHeader.m_u16ARCount
-                         : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
-                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(B) FAILED!\n")););
+                    bNeedsAdditionalAnswerAAAA = true;
                 }
-                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) &&  // If PTR_NAME is requested, AND
-                    (!(pService->m_u8ReplyMask & ContentFlag_TXT)))                   // NOT TXT -> add TXT as additional answer
-                {
-                    ((Sequence_Count == sequence)
-                         ? ++msgHeader.m_u16ARCount
-                         : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
-                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(B) FAILED!\n")););
-                }
-                if ((pService->m_u8ReplyMask & (ContentFlag_PTR_NAME | ContentFlag_SRV)) ||     // If service instance name or SRV OR
-                    (p_rSendParameter.m_u8HostReplyMask & (ContentFlag_A | ContentFlag_AAAA)))  // any host IP address is requested
-                {
-#ifdef MDNS_IP4_SUPPORT
-                    if ((bResult) && (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_A)))  // Add IP4 address
-                    {
-                        bNeedsAdditionalAnswerA = true;
-                    }
-#endif
-#ifdef MDNS_IP6_SUPPORT
-                    if ((bResult) && (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA)))  // Add IP6 address
-                    {
-                        bNeedsAdditionalAnswerAAAA = true;
-                    }
 #endif
-                }
-            }  // for services
+            }
+        }   // for services
 
-            // Answer A needed?
+        // Answer A needed?
 #ifdef MDNS_IP4_SUPPORT
-            if ((bResult) && (bNeedsAdditionalAnswerA))
-            {
-                ((Sequence_Count == sequence)
-                     ? ++msgHeader.m_u16ARCount
-                     : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(B) FAILED!\n")););
-            }
+        if ((bResult) &&
+                (bNeedsAdditionalAnswerA))
+        {
+            ((Sequence_Count == sequence)
+             ? ++msgHeader.m_u16ARCount
+             : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
+            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(B) FAILED!\n")););
+        }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            // Answer AAAA needed?
-            if ((bResult) && (bNeedsAdditionalAnswerAAAA))
-            {
-                ((Sequence_Count == sequence)
-                     ? ++msgHeader.m_u16ARCount
-                     : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(B) FAILED!\n")););
-            }
+        // Answer AAAA needed?
+        if ((bResult) &&
+                (bNeedsAdditionalAnswerAAAA))
+        {
+            ((Sequence_Count == sequence)
+             ? ++msgHeader.m_u16ARCount
+             : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
+            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(B) FAILED!\n")););
+        }
 #endif
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: Loop %i FAILED!\n"), sequence););
-        }  // for sequence
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: FAILED!\n")););
-        return bResult;
-    }
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: Loop %i FAILED!\n"), sequence););
+    }   // for sequence
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: FAILED!\n")););
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_sendMDNSServiceQuery
 
     Creates and sends a PTR query for the given service domain.
 
 */
-    bool MDNSResponder::_sendMDNSServiceQuery(const MDNSResponder::stcMDNSServiceQuery& p_ServiceQuery)
-    {
-        return _sendMDNSQuery(p_ServiceQuery.m_ServiceTypeDomain, DNS_RRTYPE_PTR);
-    }
+bool MDNSResponder::_sendMDNSServiceQuery(const MDNSResponder::stcMDNSServiceQuery& p_ServiceQuery)
+{
+
+    return _sendMDNSQuery(p_ServiceQuery.m_ServiceTypeDomain, DNS_RRTYPE_PTR);
+}
 
-    /*
+/*
     MDNSResponder::_sendMDNSQuery
 
     Creates and sends a query for the given domain and query type.
 
 */
-    bool MDNSResponder::_sendMDNSQuery(const MDNSResponder::stcMDNS_RRDomain& p_QueryDomain,
-                                       uint16_t                               p_u16QueryType,
-                                       stcMDNSServiceQuery::stcAnswer*        p_pKnownAnswers /*= 0*/)
-    {
-        bool bResult = false;
+bool MDNSResponder::_sendMDNSQuery(const MDNSResponder::stcMDNS_RRDomain& p_QueryDomain,
+                                   uint16_t p_u16QueryType,
+                                   stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers /*= 0*/)
+{
 
-        stcMDNSSendParameter sendParameter;
-        if (0 != ((sendParameter.m_pQuestions = new stcMDNS_RRQuestion)))
-        {
-            sendParameter.m_pQuestions->m_Header.m_Domain = p_QueryDomain;
+    bool                    bResult = false;
 
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = p_u16QueryType;
-            // It seems, that some mDNS implementations don't support 'unicast response' questions...
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (/*0x8000 |*/ DNS_RRCLASS_IN);  // /*Unicast &*/ INternet
+    stcMDNSSendParameter    sendParameter;
+    if (0 != ((sendParameter.m_pQuestions = new stcMDNS_RRQuestion)))
+    {
+        sendParameter.m_pQuestions->m_Header.m_Domain = p_QueryDomain;
 
-            // TODO: Add known answer to the query
-            (void)p_pKnownAnswers;
+        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = p_u16QueryType;
+        // It seems, that some mDNS implementations don't support 'unicast response' questions...
+        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (/*0x8000 |*/ DNS_RRCLASS_IN);   // /*Unicast &*/ INternet
 
-            bResult = _sendMDNSMessage(sendParameter);
-        }  // else: FAILED to alloc question
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSQuery: FAILED to alloc question!\n")););
-        return bResult;
-    }
+        // TODO: Add known answer to the query
+        (void)p_pKnownAnswers;
 
-    /**
+        bResult = _sendMDNSMessage(sendParameter);
+    }   // else: FAILED to alloc question
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSQuery: FAILED to alloc question!\n")););
+    return bResult;
+}
+
+/**
     HELPERS
 */
 
-    /**
+/**
     RESOURCE RECORDS
 */
 
-    /*
+/*
     MDNSResponder::_readRRQuestion
 
     Reads a question (eg. MyESP._http._tcp.local ANY IN) from the UPD input buffer.
 
 */
-    bool MDNSResponder::_readRRQuestion(MDNSResponder::stcMDNS_RRQuestion& p_rRRQuestion)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion\n")););
+bool MDNSResponder::_readRRQuestion(MDNSResponder::stcMDNS_RRQuestion& p_rRRQuestion)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion\n")););
 
-        bool bResult = false;
+    bool    bResult = false;
 
-        if ((bResult = _readRRHeader(p_rRRQuestion.m_Header)))
-        {
-            // Extract unicast flag from class field
-            p_rRRQuestion.m_bUnicast = (p_rRRQuestion.m_Header.m_Attributes.m_u16Class & 0x8000);
-            p_rRRQuestion.m_Header.m_Attributes.m_u16Class &= (~0x8000);
-
-            DEBUG_EX_INFO(
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion "));
-                _printRRDomain(p_rRRQuestion.m_Header.m_Domain);
-                DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X %s\n"), (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Type, (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Class, (p_rRRQuestion.m_bUnicast ? "Unicast" : "Multicast")););
-        }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion: FAILED!\n"));
-                     });
-        return bResult;
+    if ((bResult = _readRRHeader(p_rRRQuestion.m_Header)))
+    {
+        // Extract unicast flag from class field
+        p_rRRQuestion.m_bUnicast = (p_rRRQuestion.m_Header.m_Attributes.m_u16Class & 0x8000);
+        p_rRRQuestion.m_Header.m_Attributes.m_u16Class &= (~0x8000);
+
+        DEBUG_EX_INFO(
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion "));
+            _printRRDomain(p_rRRQuestion.m_Header.m_Domain);
+            DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X %s\n"), (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Type, (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Class, (p_rRRQuestion.m_bUnicast ? "Unicast" : "Multicast"));
+        );
     }
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_readRRAnswer
 
     Reads an answer (eg. _http._tcp.local PTR OP TTL MyESP._http._tcp.local)
@@ -430,307 +456,335 @@ namespace MDNSImplementation
     from the input buffer).
 
 */
-    bool MDNSResponder::_readRRAnswer(MDNSResponder::stcMDNS_RRAnswer*& p_rpRRAnswer)
-    {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer\n")););
+bool MDNSResponder::_readRRAnswer(MDNSResponder::stcMDNS_RRAnswer*& p_rpRRAnswer)
+{
+    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer\n")););
 
-        bool bResult = false;
+    bool    bResult = false;
 
-        stcMDNS_RRHeader header;
-        uint32_t         u32TTL;
-        uint16_t         u16RDLength;
-        if ((_readRRHeader(header)) && (_udpRead32(u32TTL)) && (_udpRead16(u16RDLength)))
-        {
-            /*  DEBUG_EX_INFO(
+    stcMDNS_RRHeader    header;
+    uint32_t            u32TTL;
+    uint16_t            u16RDLength;
+    if ((_readRRHeader(header)) &&
+            (_udpRead32(u32TTL)) &&
+            (_udpRead16(u16RDLength)))
+    {
+
+        /*  DEBUG_EX_INFO(
                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: Reading 0x%04X answer (class:0x%04X, TTL:%u, RDLength:%u) for "), header.m_Attributes.m_u16Type, header.m_Attributes.m_u16Class, u32TTL, u16RDLength);
                 _printRRDomain(header.m_Domain);
                 DEBUG_OUTPUT.printf_P(PSTR("\n"));
                 );*/
 
-            switch (header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
+        switch (header.m_Attributes.m_u16Type & (~0x8000))      // Topmost bit might carry 'cache flush' flag
+        {
+#ifdef MDNS_IP4_SUPPORT
+        case DNS_RRTYPE_A:
+            p_rpRRAnswer = new stcMDNS_RRAnswerA(header, u32TTL);
+            bResult = _readRRAnswerA(*(stcMDNS_RRAnswerA*&)p_rpRRAnswer, u16RDLength);
+            break;
+#endif
+        case DNS_RRTYPE_PTR:
+            p_rpRRAnswer = new stcMDNS_RRAnswerPTR(header, u32TTL);
+            bResult = _readRRAnswerPTR(*(stcMDNS_RRAnswerPTR*&)p_rpRRAnswer, u16RDLength);
+            break;
+        case DNS_RRTYPE_TXT:
+            p_rpRRAnswer = new stcMDNS_RRAnswerTXT(header, u32TTL);
+            bResult = _readRRAnswerTXT(*(stcMDNS_RRAnswerTXT*&)p_rpRRAnswer, u16RDLength);
+            break;
+#ifdef MDNS_IP6_SUPPORT
+        case DNS_RRTYPE_AAAA:
+            p_rpRRAnswer = new stcMDNS_RRAnswerAAAA(header, u32TTL);
+            bResult = _readRRAnswerAAAA(*(stcMDNS_RRAnswerAAAA*&)p_rpRRAnswer, u16RDLength);
+            break;
+#endif
+        case DNS_RRTYPE_SRV:
+            p_rpRRAnswer = new stcMDNS_RRAnswerSRV(header, u32TTL);
+            bResult = _readRRAnswerSRV(*(stcMDNS_RRAnswerSRV*&)p_rpRRAnswer, u16RDLength);
+            break;
+        default:
+            p_rpRRAnswer = new stcMDNS_RRAnswerGeneric(header, u32TTL);
+            bResult = _readRRAnswerGeneric(*(stcMDNS_RRAnswerGeneric*&)p_rpRRAnswer, u16RDLength);
+            break;
+        }
+        DEBUG_EX_INFO(
+            if ((bResult) &&
+                (p_rpRRAnswer))
+    {
+        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: "));
+            _printRRDomain(p_rpRRAnswer->m_Header.m_Domain);
+            DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, RDLength:%u "), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type, p_rpRRAnswer->m_Header.m_Attributes.m_u16Class, p_rpRRAnswer->m_u32TTL, u16RDLength);
+            switch (header.m_Attributes.m_u16Type & (~0x8000))      // Topmost bit might carry 'cache flush' flag
             {
 #ifdef MDNS_IP4_SUPPORT
             case DNS_RRTYPE_A:
-                p_rpRRAnswer = new stcMDNS_RRAnswerA(header, u32TTL);
-                bResult      = _readRRAnswerA(*(stcMDNS_RRAnswerA*&)p_rpRRAnswer, u16RDLength);
+                DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
                 break;
 #endif
             case DNS_RRTYPE_PTR:
-                p_rpRRAnswer = new stcMDNS_RRAnswerPTR(header, u32TTL);
-                bResult      = _readRRAnswerPTR(*(stcMDNS_RRAnswerPTR*&)p_rpRRAnswer, u16RDLength);
+                DEBUG_OUTPUT.printf_P(PSTR("PTR "));
+                _printRRDomain(((stcMDNS_RRAnswerPTR*&)p_rpRRAnswer)->m_PTRDomain);
                 break;
             case DNS_RRTYPE_TXT:
-                p_rpRRAnswer = new stcMDNS_RRAnswerTXT(header, u32TTL);
-                bResult      = _readRRAnswerTXT(*(stcMDNS_RRAnswerTXT*&)p_rpRRAnswer, u16RDLength);
+            {
+                size_t  stTxtLength = ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_strLength();
+                char*   pTxts = new char[stTxtLength];
+                if (pTxts)
+                {
+                    ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_str(pTxts);
+                    DEBUG_OUTPUT.printf_P(PSTR("TXT(%zu) %s"), stTxtLength, pTxts);
+                    delete[] pTxts;
+                }
                 break;
+            }
 #ifdef MDNS_IP6_SUPPORT
             case DNS_RRTYPE_AAAA:
-                p_rpRRAnswer = new stcMDNS_RRAnswerAAAA(header, u32TTL);
-                bResult      = _readRRAnswerAAAA(*(stcMDNS_RRAnswerAAAA*&)p_rpRRAnswer, u16RDLength);
+                DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
                 break;
 #endif
             case DNS_RRTYPE_SRV:
-                p_rpRRAnswer = new stcMDNS_RRAnswerSRV(header, u32TTL);
-                bResult      = _readRRAnswerSRV(*(stcMDNS_RRAnswerSRV*&)p_rpRRAnswer, u16RDLength);
+                DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_u16Port);
+                _printRRDomain(((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_SRVDomain);
                 break;
             default:
-                p_rpRRAnswer = new stcMDNS_RRAnswerGeneric(header, u32TTL);
-                bResult      = _readRRAnswerGeneric(*(stcMDNS_RRAnswerGeneric*&)p_rpRRAnswer, u16RDLength);
+                DEBUG_OUTPUT.printf_P(PSTR("generic "));
                 break;
             }
-            DEBUG_EX_INFO(
-                if ((bResult) && (p_rpRRAnswer))
-                {
-                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: "));
-                    _printRRDomain(p_rpRRAnswer->m_Header.m_Domain);
-                    DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, RDLength:%u "), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type, p_rpRRAnswer->m_Header.m_Attributes.m_u16Class, p_rpRRAnswer->m_u32TTL, u16RDLength);
-                    switch (header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
-                    {
-#ifdef MDNS_IP4_SUPPORT
-                    case DNS_RRTYPE_A:
-                        DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
-                        break;
-#endif
-                    case DNS_RRTYPE_PTR:
-                        DEBUG_OUTPUT.printf_P(PSTR("PTR "));
-                        _printRRDomain(((stcMDNS_RRAnswerPTR*&)p_rpRRAnswer)->m_PTRDomain);
-                        break;
-                    case DNS_RRTYPE_TXT:
-                    {
-                        size_t stTxtLength = ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_strLength();
-                        char*  pTxts       = new char[stTxtLength];
-                        if (pTxts)
-                        {
-                            ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_str(pTxts);
-                            DEBUG_OUTPUT.printf_P(PSTR("TXT(%zu) %s"), stTxtLength, pTxts);
-                            delete[] pTxts;
-                        }
-                        break;
-                    }
-#ifdef MDNS_IP6_SUPPORT
-                    case DNS_RRTYPE_AAAA:
-                        DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
-                        break;
-#endif
-                    case DNS_RRTYPE_SRV:
-                        DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_u16Port);
-                        _printRRDomain(((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_SRVDomain);
-                        break;
-                    default:
-                        DEBUG_OUTPUT.printf_P(PSTR("generic "));
-                        break;
-                    }
-                    DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                } else
-                {
-                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED to read specific answer of type 0x%04X!\n"), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type);
-                });  // DEBUG_EX_INFO
+            DEBUG_OUTPUT.printf_P(PSTR("\n"));
         }
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED!\n")););
-        return bResult;
+        else
+        {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED to read specific answer of type 0x%04X!\n"), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type);
+        }
+        );  // DEBUG_EX_INFO
     }
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED!\n")););
+    return bResult;
+}
 
 #ifdef MDNS_IP4_SUPPORT
-    /*
+/*
     MDNSResponder::_readRRAnswerA
 */
-    bool MDNSResponder::_readRRAnswerA(MDNSResponder::stcMDNS_RRAnswerA& p_rRRAnswerA,
-                                       uint16_t                          p_u16RDLength)
-    {
-        uint32_t u32IP4Address;
-        bool     bResult = ((MDNS_IP4_SIZE == p_u16RDLength) && (_udpReadBuffer((unsigned char*)&u32IP4Address, MDNS_IP4_SIZE)) && ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IP4Address))));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerA: FAILED!\n")););
-        return bResult;
-    }
+bool MDNSResponder::_readRRAnswerA(MDNSResponder::stcMDNS_RRAnswerA& p_rRRAnswerA,
+                                   uint16_t p_u16RDLength)
+{
+
+    uint32_t    u32IP4Address;
+    bool        bResult = ((MDNS_IP4_SIZE == p_u16RDLength) &&
+                           (_udpReadBuffer((unsigned char*)&u32IP4Address, MDNS_IP4_SIZE)) &&
+                           ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IP4Address))));
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerA: FAILED!\n")););
+    return bResult;
+}
 #endif
 
-    /*
+/*
     MDNSResponder::_readRRAnswerPTR
 */
-    bool MDNSResponder::_readRRAnswerPTR(MDNSResponder::stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
-                                         uint16_t                            p_u16RDLength)
-    {
-        bool bResult = ((p_u16RDLength) && (_readRRDomain(p_rRRAnswerPTR.m_PTRDomain)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerPTR: FAILED!\n")););
-        return bResult;
-    }
+bool MDNSResponder::_readRRAnswerPTR(MDNSResponder::stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
+                                     uint16_t p_u16RDLength)
+{
+
+    bool    bResult = ((p_u16RDLength) &&
+                       (_readRRDomain(p_rRRAnswerPTR.m_PTRDomain)));
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerPTR: FAILED!\n")););
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_readRRAnswerTXT
 
     Read TXT items from a buffer like 4c#=15ff=20
 */
-    bool MDNSResponder::_readRRAnswerTXT(MDNSResponder::stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
-                                         uint16_t                            p_u16RDLength)
+bool MDNSResponder::_readRRAnswerTXT(MDNSResponder::stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
+                                     uint16_t p_u16RDLength)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: RDLength:%u\n"), p_u16RDLength););
+    bool    bResult = true;
+
+    p_rRRAnswerTXT.clear();
+    if (p_u16RDLength)
     {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: RDLength:%u\n"), p_u16RDLength););
-        bool bResult = true;
+        bResult = false;
 
-        p_rRRAnswerTXT.clear();
-        if (p_u16RDLength)
+        unsigned char*  pucBuffer = new unsigned char[p_u16RDLength];
+        if (pucBuffer)
         {
-            bResult = false;
-
-            unsigned char* pucBuffer = new unsigned char[p_u16RDLength];
-            if (pucBuffer)
+            if (_udpReadBuffer(pucBuffer, p_u16RDLength))
             {
-                if (_udpReadBuffer(pucBuffer, p_u16RDLength))
+                bResult = true;
+
+                const unsigned char*    pucCursor = pucBuffer;
+                while ((pucCursor < (pucBuffer + p_u16RDLength)) &&
+                        (bResult))
                 {
-                    bResult = true;
+                    bResult = false;
 
-                    const unsigned char* pucCursor = pucBuffer;
-                    while ((pucCursor < (pucBuffer + p_u16RDLength)) && (bResult))
+                    stcMDNSServiceTxt*      pTxt = 0;
+                    unsigned char   ucLength = *pucCursor++;    // Length of the next txt item
+                    if (ucLength)
                     {
-                        bResult = false;
-
-                        stcMDNSServiceTxt* pTxt     = 0;
-                        unsigned char      ucLength = *pucCursor++;  // Length of the next txt item
-                        if (ucLength)
+                        DEBUG_EX_INFO(
+                            static char sacBuffer[64]; *sacBuffer = 0;
+                            uint8_t u8MaxLength = ((ucLength > (sizeof(sacBuffer) - 1)) ? (sizeof(sacBuffer) - 1) : ucLength);
+                            os_strncpy(sacBuffer, (const char*)pucCursor, u8MaxLength); sacBuffer[u8MaxLength] = 0;
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: Item(%u): %s\n"), ucLength, sacBuffer);
+                        );
+
+                        unsigned char*  pucEqualSign = (unsigned char*)os_strchr((const char*)pucCursor, '=');  // Position of the '=' sign
+                        unsigned char   ucKeyLength;
+                        if ((pucEqualSign) &&
+                                ((ucKeyLength = (pucEqualSign - pucCursor))))
                         {
-                            DEBUG_EX_INFO(
-                                static char sacBuffer[64]; *sacBuffer                                              = 0;
-                                uint8_t     u8MaxLength                                                            = ((ucLength > (sizeof(sacBuffer) - 1)) ? (sizeof(sacBuffer) - 1) : ucLength);
-                                os_strncpy(sacBuffer, (const char*)pucCursor, u8MaxLength); sacBuffer[u8MaxLength] = 0;
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: Item(%u): %s\n"), ucLength, sacBuffer););
-
-                            unsigned char* pucEqualSign = (unsigned char*)os_strchr((const char*)pucCursor, '=');  // Position of the '=' sign
-                            unsigned char  ucKeyLength;
-                            if ((pucEqualSign) && ((ucKeyLength = (pucEqualSign - pucCursor))))
-                            {
-                                unsigned char ucValueLength = (ucLength - (pucEqualSign - pucCursor + 1));
-                                bResult                     = (((pTxt = new stcMDNSServiceTxt)) && (pTxt->setKey((const char*)pucCursor, ucKeyLength)) && (pTxt->setValue((const char*)(pucEqualSign + 1), ucValueLength)));
-                            }
-                            else
-                            {
-                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: INVALID TXT format (No '=')!\n")););
-                            }
-                            pucCursor += ucLength;
+                            unsigned char   ucValueLength = (ucLength - (pucEqualSign - pucCursor + 1));
+                            bResult = (((pTxt = new stcMDNSServiceTxt)) &&
+                                       (pTxt->setKey((const char*)pucCursor, ucKeyLength)) &&
+                                       (pTxt->setValue((const char*)(pucEqualSign + 1), ucValueLength)));
                         }
-                        else  // no/zero length TXT
+                        else
                         {
-                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: TXT answer contains no items.\n")););
-                            bResult = true;
+                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: INVALID TXT format (No '=')!\n")););
                         }
+                        pucCursor += ucLength;
+                    }
+                    else    // no/zero length TXT
+                    {
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: TXT answer contains no items.\n")););
+                        bResult = true;
+                    }
 
-                        if ((bResult) && (pTxt))  // Everything is fine so far
+                    if ((bResult) &&
+                            (pTxt))     // Everything is fine so far
+                    {
+                        // Link TXT item to answer TXTs
+                        pTxt->m_pNext = p_rRRAnswerTXT.m_Txts.m_pTxts;
+                        p_rRRAnswerTXT.m_Txts.m_pTxts = pTxt;
+                    }
+                    else            // At least no TXT (might be OK, if length was 0) OR an error
+                    {
+                        if (!bResult)
                         {
-                            // Link TXT item to answer TXTs
-                            pTxt->m_pNext                 = p_rRRAnswerTXT.m_Txts.m_pTxts;
-                            p_rRRAnswerTXT.m_Txts.m_pTxts = pTxt;
+                            DEBUG_EX_ERR(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT item!\n"));
+                                DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
+                                _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
+                                DEBUG_OUTPUT.printf_P(PSTR("\n"));
+                            );
                         }
-                        else  // At least no TXT (might be OK, if length was 0) OR an error
+                        if (pTxt)
                         {
-                            if (!bResult)
-                            {
-                                DEBUG_EX_ERR(
-                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT item!\n"));
-                                    DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
-                                    _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
-                                    DEBUG_OUTPUT.printf_P(PSTR("\n")););
-                            }
-                            if (pTxt)
-                            {
-                                delete pTxt;
-                                pTxt = 0;
-                            }
-                            p_rRRAnswerTXT.clear();
+                            delete pTxt;
+                            pTxt = 0;
                         }
-                    }  // while
+                        p_rRRAnswerTXT.clear();
+                    }
+                }   // while
 
-                    DEBUG_EX_ERR(
-                        if (!bResult)  // Some failure
-                        {
-                            DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
-                            _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
-                            DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                        });
-                }
-                else
-                {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT content!\n")););
+                DEBUG_EX_ERR(
+                    if (!bResult)   // Some failure
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
+                    _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
+                    DEBUG_OUTPUT.printf_P(PSTR("\n"));
                 }
-                // Clean up
-                delete[] pucBuffer;
+                );
             }
             else
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to alloc buffer for TXT content!\n")););
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT content!\n")););
             }
+            // Clean up
+            delete[] pucBuffer;
         }
         else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: WARNING! No content!\n")););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to alloc buffer for TXT content!\n")););
         }
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED!\n")););
-        return bResult;
     }
-
-#ifdef MDNS_IP6_SUPPORT
-    bool MDNSResponder::_readRRAnswerAAAA(MDNSResponder::stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
-                                          uint16_t                             p_u16RDLength)
+    else
     {
-        bool bResult = false;
-        // TODO: Implement
-        return bResult;
+        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: WARNING! No content!\n")););
     }
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED!\n")););
+    return bResult;
+}
+
+#ifdef MDNS_IP6_SUPPORT
+bool MDNSResponder::_readRRAnswerAAAA(MDNSResponder::stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
+                                      uint16_t p_u16RDLength)
+{
+    bool    bResult = false;
+    // TODO: Implement
+    return bResult;
+}
 #endif
 
-    /*
+/*
     MDNSResponder::_readRRAnswerSRV
 */
-    bool MDNSResponder::_readRRAnswerSRV(MDNSResponder::stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
-                                         uint16_t                            p_u16RDLength)
-    {
-        bool bResult = (((3 * sizeof(uint16_t)) < p_u16RDLength) && (_udpRead16(p_rRRAnswerSRV.m_u16Priority)) && (_udpRead16(p_rRRAnswerSRV.m_u16Weight)) && (_udpRead16(p_rRRAnswerSRV.m_u16Port)) && (_readRRDomain(p_rRRAnswerSRV.m_SRVDomain)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerSRV: FAILED!\n")););
-        return bResult;
-    }
+bool MDNSResponder::_readRRAnswerSRV(MDNSResponder::stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
+                                     uint16_t p_u16RDLength)
+{
+
+    bool    bResult = (((3 * sizeof(uint16_t)) < p_u16RDLength) &&
+                       (_udpRead16(p_rRRAnswerSRV.m_u16Priority)) &&
+                       (_udpRead16(p_rRRAnswerSRV.m_u16Weight)) &&
+                       (_udpRead16(p_rRRAnswerSRV.m_u16Port)) &&
+                       (_readRRDomain(p_rRRAnswerSRV.m_SRVDomain)));
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerSRV: FAILED!\n")););
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_readRRAnswerGeneric
 */
-    bool MDNSResponder::_readRRAnswerGeneric(MDNSResponder::stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
-                                             uint16_t                                p_u16RDLength)
+bool MDNSResponder::_readRRAnswerGeneric(MDNSResponder::stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
+        uint16_t p_u16RDLength)
+{
+    bool    bResult = (0 == p_u16RDLength);
+
+    p_rRRAnswerGeneric.clear();
+    if (((p_rRRAnswerGeneric.m_u16RDLength = p_u16RDLength)) &&
+            ((p_rRRAnswerGeneric.m_pu8RDData = new unsigned char[p_rRRAnswerGeneric.m_u16RDLength])))
     {
-        bool bResult = (0 == p_u16RDLength);
 
-        p_rRRAnswerGeneric.clear();
-        if (((p_rRRAnswerGeneric.m_u16RDLength = p_u16RDLength)) && ((p_rRRAnswerGeneric.m_pu8RDData = new unsigned char[p_rRRAnswerGeneric.m_u16RDLength])))
-        {
-            bResult = _udpReadBuffer(p_rRRAnswerGeneric.m_pu8RDData, p_rRRAnswerGeneric.m_u16RDLength);
-        }
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerGeneric: FAILED!\n")););
-        return bResult;
+        bResult = _udpReadBuffer(p_rRRAnswerGeneric.m_pu8RDData, p_rRRAnswerGeneric.m_u16RDLength);
     }
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerGeneric: FAILED!\n")););
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_readRRHeader
 */
-    bool MDNSResponder::_readRRHeader(MDNSResponder::stcMDNS_RRHeader& p_rRRHeader)
-    {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader\n")););
+bool MDNSResponder::_readRRHeader(MDNSResponder::stcMDNS_RRHeader& p_rRRHeader)
+{
+    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader\n")););
 
-        bool bResult = ((_readRRDomain(p_rRRHeader.m_Domain)) && (_readRRAttributes(p_rRRHeader.m_Attributes)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader: FAILED!\n")););
-        return bResult;
-    }
+    bool    bResult = ((_readRRDomain(p_rRRHeader.m_Domain)) &&
+                       (_readRRAttributes(p_rRRHeader.m_Attributes)));
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader: FAILED!\n")););
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_readRRDomain
 
     Reads a (maybe multilevel compressed) domain from the UDP input buffer.
 
 */
-    bool MDNSResponder::_readRRDomain(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain)
-    {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain\n")););
+bool MDNSResponder::_readRRDomain(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain)
+{
+    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain\n")););
 
-        bool bResult = ((p_rRRDomain.clear()) && (_readRRDomain_Loop(p_rRRDomain, 0)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain: FAILED!\n")););
-        return bResult;
-    }
+    bool    bResult = ((p_rRRDomain.clear()) &&
+                       (_readRRDomain_Loop(p_rRRDomain, 0)));
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain: FAILED!\n")););
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_readRRDomain_Loop
 
     Reads a domain from the UDP input buffer. For every compression level, the functions
@@ -738,363 +792,412 @@ namespace MDNSImplementation
     the maximum recursion depth is set by MDNS_DOMAIN_MAX_REDIRCTION.
 
 */
-    bool MDNSResponder::_readRRDomain_Loop(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain,
-                                           uint8_t                          p_u8Depth)
-    {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u)\n"), p_u8Depth););
+bool MDNSResponder::_readRRDomain_Loop(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain,
+                                       uint8_t p_u8Depth)
+{
+    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u)\n"), p_u8Depth););
 
-        bool bResult = false;
+    bool    bResult = false;
 
-        if (MDNS_DOMAIN_MAX_REDIRCTION >= p_u8Depth)
+    if (MDNS_DOMAIN_MAX_REDIRCTION >= p_u8Depth)
+    {
+        bResult = true;
+
+        uint8_t u8Len = 0;
+        do
         {
-            bResult = true;
+            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Offset:%u p0:%02x\n"), p_u8Depth, m_pUDPContext->tell(), m_pUDPContext->peek()););
+            _udpRead8(u8Len);
 
-            uint8_t u8Len = 0;
-            do
+            if (u8Len & MDNS_DOMAIN_COMPRESS_MARK)
             {
-                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Offset:%u p0:%02x\n"), p_u8Depth, m_pUDPContext->tell(), m_pUDPContext->peek()););
+                // Compressed label(s)
+                uint16_t    u16Offset = ((u8Len & ~MDNS_DOMAIN_COMPRESS_MARK) << 8);    // Implicit BE to LE conversion!
                 _udpRead8(u8Len);
+                u16Offset |= u8Len;
 
-                if (u8Len & MDNS_DOMAIN_COMPRESS_MARK)
+                if (m_pUDPContext->isValidOffset(u16Offset))
                 {
-                    // Compressed label(s)
-                    uint16_t u16Offset = ((u8Len & ~MDNS_DOMAIN_COMPRESS_MARK) << 8);  // Implicit BE to LE conversion!
-                    _udpRead8(u8Len);
-                    u16Offset |= u8Len;
+                    size_t  stCurrentPosition = m_pUDPContext->tell();      // Prepare return from recursion
 
-                    if (m_pUDPContext->isValidOffset(u16Offset))
+                    //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Redirecting from %u to %u!\n"), p_u8Depth, stCurrentPosition, u16Offset););
+                    m_pUDPContext->seek(u16Offset);
+                    if (_readRRDomain_Loop(p_rRRDomain, p_u8Depth + 1))     // Do recursion
                     {
-                        size_t stCurrentPosition = m_pUDPContext->tell();  // Prepare return from recursion
-
-                        //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Redirecting from %u to %u!\n"), p_u8Depth, stCurrentPosition, u16Offset););
-                        m_pUDPContext->seek(u16Offset);
-                        if (_readRRDomain_Loop(p_rRRDomain, p_u8Depth + 1))  // Do recursion
-                        {
-                            //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Succeeded to read redirected label! Returning to %u\n"), p_u8Depth, stCurrentPosition););
-                            m_pUDPContext->seek(stCurrentPosition);  // Restore after recursion
-                        }
-                        else
-                        {
-                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): FAILED to read redirected label!\n"), p_u8Depth););
-                            bResult = false;
-                        }
+                        //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Succeeded to read redirected label! Returning to %u\n"), p_u8Depth, stCurrentPosition););
+                        m_pUDPContext->seek(stCurrentPosition);             // Restore after recursion
                     }
                     else
                     {
-                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): INVALID offset in redirection!\n"), p_u8Depth););
+                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): FAILED to read redirected label!\n"), p_u8Depth););
                         bResult = false;
                     }
-                    break;
                 }
                 else
                 {
-                    // Normal (uncompressed) label (maybe '\0' only)
-                    if (MDNS_DOMAIN_MAXLENGTH > (p_rRRDomain.m_u16NameLength + u8Len))
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): INVALID offset in redirection!\n"), p_u8Depth););
+                    bResult = false;
+                }
+                break;
+            }
+            else
+            {
+                // Normal (uncompressed) label (maybe '\0' only)
+                if (MDNS_DOMAIN_MAXLENGTH > (p_rRRDomain.m_u16NameLength + u8Len))
+                {
+                    // Add length byte
+                    p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength] = u8Len;
+                    ++(p_rRRDomain.m_u16NameLength);
+                    if (u8Len)      // Add name
                     {
-                        // Add length byte
-                        p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength] = u8Len;
-                        ++(p_rRRDomain.m_u16NameLength);
-                        if (u8Len)  // Add name
+                        if ((bResult = _udpReadBuffer((unsigned char*) & (p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]), u8Len)))
                         {
-                            if ((bResult = _udpReadBuffer((unsigned char*)&(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]), u8Len)))
-                            {
-                                /*  DEBUG_EX_INFO(
+                            /*  DEBUG_EX_INFO(
                                     p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength + u8Len] = 0;  // Closing '\0' for printing
                                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Domain label (%u): %s\n"), p_u8Depth, (unsigned)(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength - 1]), &(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]));
                                     );*/
 
-                                p_rRRDomain.m_u16NameLength += u8Len;
-                            }
+                            p_rRRDomain.m_u16NameLength += u8Len;
                         }
-                        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(2) offset:%u p0:%x\n"), m_pUDPContext->tell(), m_pUDPContext->peek()););
-                    }
-                    else
-                    {
-                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Domain name too long (%u + %u)!\n"), p_u8Depth, p_rRRDomain.m_u16NameLength, u8Len););
-                        bResult = false;
-                        break;
                     }
+                    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(2) offset:%u p0:%x\n"), m_pUDPContext->tell(), m_pUDPContext->peek()););
                 }
-            } while ((bResult) && (0 != u8Len));
-        }
-        else
-        {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Too many redirections!\n"), p_u8Depth););
-        }
-        return bResult;
+                else
+                {
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Domain name too long (%u + %u)!\n"), p_u8Depth, p_rRRDomain.m_u16NameLength, u8Len););
+                    bResult = false;
+                    break;
+                }
+            }
+        } while ((bResult) &&
+                 (0 != u8Len));
+    }
+    else
+    {
+        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Too many redirections!\n"), p_u8Depth););
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_readRRAttributes
 */
-    bool MDNSResponder::_readRRAttributes(MDNSResponder::stcMDNS_RRAttributes& p_rRRAttributes)
-    {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes\n")););
+bool MDNSResponder::_readRRAttributes(MDNSResponder::stcMDNS_RRAttributes& p_rRRAttributes)
+{
+    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes\n")););
+
+    bool    bResult = ((_udpRead16(p_rRRAttributes.m_u16Type)) &&
+                       (_udpRead16(p_rRRAttributes.m_u16Class)));
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes: FAILED!\n")););
+    return bResult;
+}
 
-        bool bResult = ((_udpRead16(p_rRRAttributes.m_u16Type)) && (_udpRead16(p_rRRAttributes.m_u16Class)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes: FAILED!\n")););
-        return bResult;
-    }
 
-    /*
+/*
     DOMAIN NAMES
 */
 
-    /*
+/*
     MDNSResponder::_buildDomainForHost
 
     Builds a MDNS host domain (eg. esp8266.local) for the given hostname.
 
 */
-    bool MDNSResponder::_buildDomainForHost(const char*                      p_pcHostname,
-                                            MDNSResponder::stcMDNS_RRDomain& p_rHostDomain) const
-    {
-        p_rHostDomain.clear();
-        bool bResult = ((p_pcHostname) && (*p_pcHostname) && (p_rHostDomain.addLabel(p_pcHostname)) && (p_rHostDomain.addLabel(scpcLocal)) && (p_rHostDomain.addLabel(0)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForHost: FAILED!\n")););
-        return bResult;
-    }
+bool MDNSResponder::_buildDomainForHost(const char* p_pcHostname,
+                                        MDNSResponder::stcMDNS_RRDomain& p_rHostDomain) const
+{
+
+    p_rHostDomain.clear();
+    bool    bResult = ((p_pcHostname) &&
+                       (*p_pcHostname) &&
+                       (p_rHostDomain.addLabel(p_pcHostname)) &&
+                       (p_rHostDomain.addLabel(scpcLocal)) &&
+                       (p_rHostDomain.addLabel(0)));
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForHost: FAILED!\n")););
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_buildDomainForDNSSD
 
     Builds the '_services._dns-sd._udp.local' domain.
     Used while detecting generic service enum question (DNS-SD) and answering these questions.
 
 */
-    bool MDNSResponder::_buildDomainForDNSSD(MDNSResponder::stcMDNS_RRDomain& p_rDNSSDDomain) const
-    {
-        p_rDNSSDDomain.clear();
-        bool bResult = ((p_rDNSSDDomain.addLabel(scpcServices, true)) && (p_rDNSSDDomain.addLabel(scpcDNSSD, true)) && (p_rDNSSDDomain.addLabel(scpcUDP, true)) && (p_rDNSSDDomain.addLabel(scpcLocal)) && (p_rDNSSDDomain.addLabel(0)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForDNSSD: FAILED!\n")););
-        return bResult;
-    }
+bool MDNSResponder::_buildDomainForDNSSD(MDNSResponder::stcMDNS_RRDomain& p_rDNSSDDomain) const
+{
+
+    p_rDNSSDDomain.clear();
+    bool    bResult = ((p_rDNSSDDomain.addLabel(scpcServices, true)) &&
+                       (p_rDNSSDDomain.addLabel(scpcDNSSD, true)) &&
+                       (p_rDNSSDDomain.addLabel(scpcUDP, true)) &&
+                       (p_rDNSSDDomain.addLabel(scpcLocal)) &&
+                       (p_rDNSSDDomain.addLabel(0)));
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForDNSSD: FAILED!\n")););
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_buildDomainForService
 
     Builds the domain for the given service (eg. _http._tcp.local or
     MyESP._http._tcp.local (if p_bIncludeName is set)).
 
 */
-    bool MDNSResponder::_buildDomainForService(const MDNSResponder::stcMDNSService& p_Service,
-                                               bool                                 p_bIncludeName,
-                                               MDNSResponder::stcMDNS_RRDomain&     p_rServiceDomain) const
-    {
-        p_rServiceDomain.clear();
-        bool bResult = (((!p_bIncludeName) || (p_rServiceDomain.addLabel(p_Service.m_pcName))) && (p_rServiceDomain.addLabel(p_Service.m_pcService, true)) && (p_rServiceDomain.addLabel(p_Service.m_pcProtocol, true)) && (p_rServiceDomain.addLabel(scpcLocal)) && (p_rServiceDomain.addLabel(0)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED!\n")););
-        return bResult;
-    }
+bool MDNSResponder::_buildDomainForService(const MDNSResponder::stcMDNSService& p_Service,
+        bool p_bIncludeName,
+        MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
+{
+
+    p_rServiceDomain.clear();
+    bool    bResult = (((!p_bIncludeName) ||
+                        (p_rServiceDomain.addLabel(p_Service.m_pcName))) &&
+                       (p_rServiceDomain.addLabel(p_Service.m_pcService, true)) &&
+                       (p_rServiceDomain.addLabel(p_Service.m_pcProtocol, true)) &&
+                       (p_rServiceDomain.addLabel(scpcLocal)) &&
+                       (p_rServiceDomain.addLabel(0)));
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED!\n")););
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_buildDomainForService
 
     Builds the domain for the given service properties (eg. _http._tcp.local).
     The usual prepended '_' are added, if missing in the input strings.
 
 */
-    bool MDNSResponder::_buildDomainForService(const char*                      p_pcService,
-                                               const char*                      p_pcProtocol,
-                                               MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
-    {
-        p_rServiceDomain.clear();
-        bool bResult = ((p_pcService) && (p_pcProtocol) && (p_rServiceDomain.addLabel(p_pcService, ('_' != *p_pcService))) && (p_rServiceDomain.addLabel(p_pcProtocol, ('_' != *p_pcProtocol))) && (p_rServiceDomain.addLabel(scpcLocal)) && (p_rServiceDomain.addLabel(0)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED for (%s.%s)!\n"), (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
-        return bResult;
-    }
+bool MDNSResponder::_buildDomainForService(const char* p_pcService,
+        const char* p_pcProtocol,
+        MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
+{
+
+    p_rServiceDomain.clear();
+    bool    bResult = ((p_pcService) &&
+                       (p_pcProtocol) &&
+                       (p_rServiceDomain.addLabel(p_pcService, ('_' != *p_pcService))) &&
+                       (p_rServiceDomain.addLabel(p_pcProtocol, ('_' != *p_pcProtocol))) &&
+                       (p_rServiceDomain.addLabel(scpcLocal)) &&
+                       (p_rServiceDomain.addLabel(0)));
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED for (%s.%s)!\n"), (p_pcService ? : "-"), (p_pcProtocol ? : "-")););
+    return bResult;
+}
 
 #ifdef MDNS_IP4_SUPPORT
-    /*
+/*
     MDNSResponder::_buildDomainForReverseIP4
 
     The IP4 address is stringized by printing the four address bytes into a char buffer in reverse order
     and adding 'in-addr.arpa' (eg. 012.789.456.123.in-addr.arpa).
     Used while detecting reverse IP4 questions and answering these
 */
-    bool MDNSResponder::_buildDomainForReverseIP4(IPAddress                        p_IP4Address,
-                                                  MDNSResponder::stcMDNS_RRDomain& p_rReverseIP4Domain) const
-    {
-        bool bResult = true;
+bool MDNSResponder::_buildDomainForReverseIP4(IPAddress p_IP4Address,
+        MDNSResponder::stcMDNS_RRDomain& p_rReverseIP4Domain) const
+{
 
-        p_rReverseIP4Domain.clear();
+    bool    bResult = true;
 
-        char acBuffer[32];
-        for (int i = MDNS_IP4_SIZE; ((bResult) && (i >= 1)); --i)
-        {
-            itoa(p_IP4Address[i - 1], acBuffer, 10);
-            bResult = p_rReverseIP4Domain.addLabel(acBuffer);
-        }
-        bResult = ((bResult) && (p_rReverseIP4Domain.addLabel(scpcReverseIP4Domain)) && (p_rReverseIP4Domain.addLabel(scpcReverseTopDomain)) && (p_rReverseIP4Domain.addLabel(0)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForReverseIP4: FAILED!\n")););
-        return bResult;
+    p_rReverseIP4Domain.clear();
+
+    char    acBuffer[32];
+    for (int i = MDNS_IP4_SIZE; ((bResult) && (i >= 1)); --i)
+    {
+        itoa(p_IP4Address[i - 1], acBuffer, 10);
+        bResult = p_rReverseIP4Domain.addLabel(acBuffer);
     }
+    bResult = ((bResult) &&
+               (p_rReverseIP4Domain.addLabel(scpcReverseIP4Domain)) &&
+               (p_rReverseIP4Domain.addLabel(scpcReverseTopDomain)) &&
+               (p_rReverseIP4Domain.addLabel(0)));
+    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForReverseIP4: FAILED!\n")););
+    return bResult;
+}
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-    /*
+/*
     MDNSResponder::_buildDomainForReverseIP6
 
     Used while detecting reverse IP6 questions and answering these
 */
-    bool MDNSResponder::_buildDomainForReverseIP6(IPAddress                        p_IP4Address,
-                                                  MDNSResponder::stcMDNS_RRDomain& p_rReverseIP6Domain) const
-    {
-        // TODO: Implement
-        return false;
-    }
+bool MDNSResponder::_buildDomainForReverseIP6(IPAddress p_IP4Address,
+        MDNSResponder::stcMDNS_RRDomain& p_rReverseIP6Domain) const
+{
+    // TODO: Implement
+    return false;
+}
 #endif
 
-    /*
+
+/*
     UDP
 */
 
-    /*
+/*
     MDNSResponder::_udpReadBuffer
 */
-    bool MDNSResponder::_udpReadBuffer(unsigned char* p_pBuffer,
-                                       size_t         p_stLength)
-    {
-        bool bResult = ((m_pUDPContext) && (true /*m_pUDPContext->getSize() > p_stLength*/) && (p_pBuffer) && (p_stLength) && ((p_stLength == m_pUDPContext->read((char*)p_pBuffer, p_stLength))));
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpReadBuffer: FAILED!\n"));
-                     });
-        return bResult;
-    }
+bool MDNSResponder::_udpReadBuffer(unsigned char* p_pBuffer,
+                                   size_t p_stLength)
+{
 
-    /*
+    bool    bResult = ((m_pUDPContext) &&
+                       (true/*m_pUDPContext->getSize() > p_stLength*/) &&
+                       (p_pBuffer) &&
+                       (p_stLength) &&
+                       ((p_stLength == m_pUDPContext->read((char*)p_pBuffer, p_stLength))));
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpReadBuffer: FAILED!\n"));
+    });
+    return bResult;
+}
+
+/*
     MDNSResponder::_udpRead8
 */
-    bool MDNSResponder::_udpRead8(uint8_t& p_ru8Value)
-    {
-        return _udpReadBuffer((unsigned char*)&p_ru8Value, sizeof(p_ru8Value));
-    }
+bool MDNSResponder::_udpRead8(uint8_t& p_ru8Value)
+{
+
+    return _udpReadBuffer((unsigned char*)&p_ru8Value, sizeof(p_ru8Value));
+}
 
-    /*
+/*
     MDNSResponder::_udpRead16
 */
-    bool MDNSResponder::_udpRead16(uint16_t& p_ru16Value)
-    {
-        bool bResult = false;
+bool MDNSResponder::_udpRead16(uint16_t& p_ru16Value)
+{
 
-        if (_udpReadBuffer((unsigned char*)&p_ru16Value, sizeof(p_ru16Value)))
-        {
-            p_ru16Value = lwip_ntohs(p_ru16Value);
-            bResult     = true;
-        }
-        return bResult;
+    bool    bResult = false;
+
+    if (_udpReadBuffer((unsigned char*)&p_ru16Value, sizeof(p_ru16Value)))
+    {
+        p_ru16Value = lwip_ntohs(p_ru16Value);
+        bResult = true;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_udpRead32
 */
-    bool MDNSResponder::_udpRead32(uint32_t& p_ru32Value)
-    {
-        bool bResult = false;
+bool MDNSResponder::_udpRead32(uint32_t& p_ru32Value)
+{
 
-        if (_udpReadBuffer((unsigned char*)&p_ru32Value, sizeof(p_ru32Value)))
-        {
-            p_ru32Value = lwip_ntohl(p_ru32Value);
-            bResult     = true;
-        }
-        return bResult;
+    bool    bResult = false;
+
+    if (_udpReadBuffer((unsigned char*)&p_ru32Value, sizeof(p_ru32Value)))
+    {
+        p_ru32Value = lwip_ntohl(p_ru32Value);
+        bResult = true;
     }
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_udpAppendBuffer
 */
-    bool MDNSResponder::_udpAppendBuffer(const unsigned char* p_pcBuffer,
-                                         size_t               p_stLength)
-    {
-        bool bResult = ((m_pUDPContext) && (p_pcBuffer) && (p_stLength) && (p_stLength == m_pUDPContext->append((const char*)p_pcBuffer, p_stLength)));
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpAppendBuffer: FAILED!\n"));
-                     });
-        return bResult;
-    }
+bool MDNSResponder::_udpAppendBuffer(const unsigned char* p_pcBuffer,
+                                     size_t p_stLength)
+{
+
+    bool bResult = ((m_pUDPContext) &&
+                    (p_pcBuffer) &&
+                    (p_stLength) &&
+                    (p_stLength == m_pUDPContext->append((const char*)p_pcBuffer, p_stLength)));
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpAppendBuffer: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_udpAppend8
 */
-    bool MDNSResponder::_udpAppend8(uint8_t p_u8Value)
-    {
-        return (_udpAppendBuffer((unsigned char*)&p_u8Value, sizeof(p_u8Value)));
-    }
+bool MDNSResponder::_udpAppend8(uint8_t p_u8Value)
+{
 
-    /*
+    return (_udpAppendBuffer((unsigned char*)&p_u8Value, sizeof(p_u8Value)));
+}
+
+/*
     MDNSResponder::_udpAppend16
 */
-    bool MDNSResponder::_udpAppend16(uint16_t p_u16Value)
-    {
-        p_u16Value = lwip_htons(p_u16Value);
-        return (_udpAppendBuffer((unsigned char*)&p_u16Value, sizeof(p_u16Value)));
-    }
+bool MDNSResponder::_udpAppend16(uint16_t p_u16Value)
+{
+
+    p_u16Value = lwip_htons(p_u16Value);
+    return (_udpAppendBuffer((unsigned char*)&p_u16Value, sizeof(p_u16Value)));
+}
 
-    /*
+/*
     MDNSResponder::_udpAppend32
 */
-    bool MDNSResponder::_udpAppend32(uint32_t p_u32Value)
-    {
-        p_u32Value = lwip_htonl(p_u32Value);
-        return (_udpAppendBuffer((unsigned char*)&p_u32Value, sizeof(p_u32Value)));
-    }
+bool MDNSResponder::_udpAppend32(uint32_t p_u32Value)
+{
+
+    p_u32Value = lwip_htonl(p_u32Value);
+    return (_udpAppendBuffer((unsigned char*)&p_u32Value, sizeof(p_u32Value)));
+}
 
 #ifdef DEBUG_ESP_MDNS_RESPONDER
-    /*
+/*
     MDNSResponder::_udpDump
 */
-    bool MDNSResponder::_udpDump(bool p_bMovePointer /*= false*/)
-    {
-        const uint8_t cu8BytesPerLine = 16;
+bool MDNSResponder::_udpDump(bool p_bMovePointer /*= false*/)
+{
 
-        uint32_t u32StartPosition = m_pUDPContext->tell();
-        DEBUG_OUTPUT.println("UDP Context Dump:");
-        uint32_t u32Counter = 0;
-        uint8_t  u8Byte     = 0;
+    const uint8_t   cu8BytesPerLine = 16;
 
-        while (_udpRead8(u8Byte))
-        {
-            DEBUG_OUTPUT.printf_P(PSTR("%02x %s"), u8Byte, ((++u32Counter % cu8BytesPerLine) ? "" : "\n"));
-        }
-        DEBUG_OUTPUT.printf_P(PSTR("%sDone: %u bytes\n"), (((u32Counter) && (u32Counter % cu8BytesPerLine)) ? "\n" : ""), u32Counter);
+    uint32_t        u32StartPosition = m_pUDPContext->tell();
+    DEBUG_OUTPUT.println("UDP Context Dump:");
+    uint32_t    u32Counter = 0;
+    uint8_t     u8Byte = 0;
 
-        if (!p_bMovePointer)  // Restore
-        {
-            m_pUDPContext->seek(u32StartPosition);
-        }
-        return true;
+    while (_udpRead8(u8Byte))
+    {
+        DEBUG_OUTPUT.printf_P(PSTR("%02x %s"), u8Byte, ((++u32Counter % cu8BytesPerLine) ? "" : "\n"));
+    }
+    DEBUG_OUTPUT.printf_P(PSTR("%sDone: %u bytes\n"), (((u32Counter) && (u32Counter % cu8BytesPerLine)) ? "\n" : ""), u32Counter);
+
+    if (!p_bMovePointer)    // Restore
+    {
+        m_pUDPContext->seek(u32StartPosition);
     }
+    return true;
+}
 
-    /*
+/*
     MDNSResponder::_udpDump
 */
-    bool MDNSResponder::_udpDump(unsigned p_uOffset,
-                                 unsigned p_uLength)
+bool MDNSResponder::_udpDump(unsigned p_uOffset,
+                             unsigned p_uLength)
+{
+
+    if ((m_pUDPContext) &&
+            (m_pUDPContext->isValidOffset(p_uOffset)))
     {
-        if ((m_pUDPContext) && (m_pUDPContext->isValidOffset(p_uOffset)))
-        {
-            unsigned uCurrentPosition = m_pUDPContext->tell();  // Remember start position
+        unsigned    uCurrentPosition = m_pUDPContext->tell();   // Remember start position
 
-            m_pUDPContext->seek(p_uOffset);
-            uint8_t u8Byte;
-            for (unsigned u = 0; ((u < p_uLength) && (_udpRead8(u8Byte))); ++u)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("%02x "), u8Byte);
-            }
-            // Return to start position
-            m_pUDPContext->seek(uCurrentPosition);
+        m_pUDPContext->seek(p_uOffset);
+        uint8_t u8Byte;
+        for (unsigned u = 0; ((u < p_uLength) && (_udpRead8(u8Byte))); ++u)
+        {
+            DEBUG_OUTPUT.printf_P(PSTR("%02x "), u8Byte);
         }
-        return true;
+        // Return to start position
+        m_pUDPContext->seek(uCurrentPosition);
     }
+    return true;
+}
 #endif
 
-    /**
+
+/**
     READ/WRITE MDNS STRUCTS
 */
 
-    /*
+/*
     MDNSResponder::_readMDNSMsgHeader
 
     Read a MDNS header from the UDP input buffer.
@@ -1107,25 +1210,33 @@ namespace MDNSImplementation
     In addition, bitfield memory order is undefined in C standard (GCC doesn't order them in the coded direction...), so they
     need some mapping here
 */
-    bool MDNSResponder::_readMDNSMsgHeader(MDNSResponder::stcMDNS_MsgHeader& p_rMsgHeader)
+bool MDNSResponder::_readMDNSMsgHeader(MDNSResponder::stcMDNS_MsgHeader& p_rMsgHeader)
+{
+
+    bool    bResult = false;
+
+    uint8_t u8B1;
+    uint8_t u8B2;
+    if ((_udpRead16(p_rMsgHeader.m_u16ID)) &&
+            (_udpRead8(u8B1)) &&
+            (_udpRead8(u8B2)) &&
+            (_udpRead16(p_rMsgHeader.m_u16QDCount)) &&
+            (_udpRead16(p_rMsgHeader.m_u16ANCount)) &&
+            (_udpRead16(p_rMsgHeader.m_u16NSCount)) &&
+            (_udpRead16(p_rMsgHeader.m_u16ARCount)))
     {
-        bool bResult = false;
 
-        uint8_t u8B1;
-        uint8_t u8B2;
-        if ((_udpRead16(p_rMsgHeader.m_u16ID)) && (_udpRead8(u8B1)) && (_udpRead8(u8B2)) && (_udpRead16(p_rMsgHeader.m_u16QDCount)) && (_udpRead16(p_rMsgHeader.m_u16ANCount)) && (_udpRead16(p_rMsgHeader.m_u16NSCount)) && (_udpRead16(p_rMsgHeader.m_u16ARCount)))
-        {
-            p_rMsgHeader.m_1bQR     = (u8B1 & 0x80);  // Query/Respond flag
-            p_rMsgHeader.m_4bOpcode = (u8B1 & 0x78);  // Operation code (0: Standard query, others ignored)
-            p_rMsgHeader.m_1bAA     = (u8B1 & 0x04);  // Authoritative answer
-            p_rMsgHeader.m_1bTC     = (u8B1 & 0x02);  // Truncation flag
-            p_rMsgHeader.m_1bRD     = (u8B1 & 0x01);  // Recursion desired
+        p_rMsgHeader.m_1bQR     = (u8B1 & 0x80);    // Query/Respond flag
+        p_rMsgHeader.m_4bOpcode = (u8B1 & 0x78);    // Operation code (0: Standard query, others ignored)
+        p_rMsgHeader.m_1bAA     = (u8B1 & 0x04);    // Authoritative answer
+        p_rMsgHeader.m_1bTC     = (u8B1 & 0x02);    // Truncation flag
+        p_rMsgHeader.m_1bRD     = (u8B1 & 0x01);    // Recursion desired
 
-            p_rMsgHeader.m_1bRA    = (u8B2 & 0x80);  // Recursion available
-            p_rMsgHeader.m_3bZ     = (u8B2 & 0x70);  // Zero
-            p_rMsgHeader.m_4bRCode = (u8B2 & 0x0F);  // Response code
+        p_rMsgHeader.m_1bRA     = (u8B2 & 0x80);    // Recursion available
+        p_rMsgHeader.m_3bZ      = (u8B2 & 0x70);    // Zero
+        p_rMsgHeader.m_4bRCode  = (u8B2 & 0x0F);    // Response code
 
-            /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
+        /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
                 (unsigned)p_rMsgHeader.m_u16ID,
                 (unsigned)p_rMsgHeader.m_1bQR, (unsigned)p_rMsgHeader.m_4bOpcode, (unsigned)p_rMsgHeader.m_1bAA, (unsigned)p_rMsgHeader.m_1bTC, (unsigned)p_rMsgHeader.m_1bRD,
                 (unsigned)p_rMsgHeader.m_1bRA, (unsigned)p_rMsgHeader.m_4bRCode,
@@ -1133,43 +1244,49 @@ namespace MDNSImplementation
                 (unsigned)p_rMsgHeader.m_u16ANCount,
                 (unsigned)p_rMsgHeader.m_u16NSCount,
                 (unsigned)p_rMsgHeader.m_u16ARCount););*/
-            bResult = true;
-        }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: FAILED!\n"));
-                     });
-        return bResult;
+        bResult = true;
     }
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_write8
 */
-    bool MDNSResponder::_write8(uint8_t                              p_u8Value,
-                                MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        return ((_udpAppend8(p_u8Value)) && (p_rSendParameter.shiftOffset(sizeof(p_u8Value))));
-    }
+bool MDNSResponder::_write8(uint8_t p_u8Value,
+                            MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+
+    return ((_udpAppend8(p_u8Value)) &&
+            (p_rSendParameter.shiftOffset(sizeof(p_u8Value))));
+}
 
-    /*
+/*
     MDNSResponder::_write16
 */
-    bool MDNSResponder::_write16(uint16_t                             p_u16Value,
-                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        return ((_udpAppend16(p_u16Value)) && (p_rSendParameter.shiftOffset(sizeof(p_u16Value))));
-    }
+bool MDNSResponder::_write16(uint16_t p_u16Value,
+                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+
+    return ((_udpAppend16(p_u16Value)) &&
+            (p_rSendParameter.shiftOffset(sizeof(p_u16Value))));
+}
 
-    /*
+/*
     MDNSResponder::_write32
 */
-    bool MDNSResponder::_write32(uint32_t                             p_u32Value,
-                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        return ((_udpAppend32(p_u32Value)) && (p_rSendParameter.shiftOffset(sizeof(p_u32Value))));
-    }
+bool MDNSResponder::_write32(uint32_t p_u32Value,
+                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+
+    return ((_udpAppend32(p_u32Value)) &&
+            (p_rSendParameter.shiftOffset(sizeof(p_u32Value))));
+}
 
-    /*
+/*
     MDNSResponder::_writeMDNSMsgHeader
 
     Write MDNS header to the UDP output buffer.
@@ -1178,10 +1295,10 @@ namespace MDNSImplementation
     In addition, bitfield memory order is undefined in C standard (GCC doesn't order them in the coded direction...), so they
     need some mapping here
 */
-    bool MDNSResponder::_writeMDNSMsgHeader(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader,
-                                            MDNSResponder::stcMDNSSendParameter&    p_rSendParameter)
-    {
-        /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
+bool MDNSResponder::_writeMDNSMsgHeader(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader,
+                                        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+    /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
             (unsigned)p_MsgHeader.m_u16ID,
             (unsigned)p_MsgHeader.m_1bQR, (unsigned)p_MsgHeader.m_4bOpcode, (unsigned)p_MsgHeader.m_1bAA, (unsigned)p_MsgHeader.m_1bTC, (unsigned)p_MsgHeader.m_1bRD,
             (unsigned)p_MsgHeader.m_1bRA, (unsigned)p_MsgHeader.m_4bRCode,
@@ -1190,48 +1307,58 @@ namespace MDNSImplementation
             (unsigned)p_MsgHeader.m_u16NSCount,
             (unsigned)p_MsgHeader.m_u16ARCount););*/
 
-        uint8_t u8B1((p_MsgHeader.m_1bQR << 7) | (p_MsgHeader.m_4bOpcode << 3) | (p_MsgHeader.m_1bAA << 2) | (p_MsgHeader.m_1bTC << 1) | (p_MsgHeader.m_1bRD));
-        uint8_t u8B2((p_MsgHeader.m_1bRA << 7) | (p_MsgHeader.m_3bZ << 4) | (p_MsgHeader.m_4bRCode));
-        bool    bResult = ((_write16(p_MsgHeader.m_u16ID, p_rSendParameter)) && (_write8(u8B1, p_rSendParameter)) && (_write8(u8B2, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter)));
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: FAILED!\n"));
-                     });
-        return bResult;
-    }
+    uint8_t u8B1((p_MsgHeader.m_1bQR << 7) | (p_MsgHeader.m_4bOpcode << 3) | (p_MsgHeader.m_1bAA << 2) | (p_MsgHeader.m_1bTC << 1) | (p_MsgHeader.m_1bRD));
+    uint8_t u8B2((p_MsgHeader.m_1bRA << 7) | (p_MsgHeader.m_3bZ << 4) | (p_MsgHeader.m_4bRCode));
+    bool    bResult = ((_write16(p_MsgHeader.m_u16ID, p_rSendParameter)) &&
+                       (_write8(u8B1, p_rSendParameter)) &&
+                       (_write8(u8B2, p_rSendParameter)) &&
+                       (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter)) &&
+                       (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter)) &&
+                       (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter)) &&
+                       (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter)));
+
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_writeRRAttributes
 */
-    bool MDNSResponder::_writeMDNSRRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Attributes,
-                                               MDNSResponder::stcMDNSSendParameter&       p_rSendParameter)
-    {
-        bool bResult = ((_write16(p_Attributes.m_u16Type, p_rSendParameter)) && (_write16(p_Attributes.m_u16Class, p_rSendParameter)));
+bool MDNSResponder::_writeMDNSRRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Attributes,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
 
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRAttributes: FAILED!\n"));
-                     });
-        return bResult;
-    }
+    bool    bResult = ((_write16(p_Attributes.m_u16Type, p_rSendParameter)) &&
+                       (_write16(p_Attributes.m_u16Class, p_rSendParameter)));
 
-    /*
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRAttributes: FAILED!\n"));
+    });
+    return bResult;
+}
+
+/*
     MDNSResponder::_writeMDNSRRDomain
 */
-    bool MDNSResponder::_writeMDNSRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_Domain,
-                                           MDNSResponder::stcMDNSSendParameter&   p_rSendParameter)
-    {
-        bool bResult = ((_udpAppendBuffer((const unsigned char*)p_Domain.m_acName, p_Domain.m_u16NameLength)) && (p_rSendParameter.shiftOffset(p_Domain.m_u16NameLength)));
+bool MDNSResponder::_writeMDNSRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_Domain,
+                                       MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
 
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRDomain: FAILED!\n"));
-                     });
-        return bResult;
-    }
+    bool    bResult = ((_udpAppendBuffer((const unsigned char*)p_Domain.m_acName, p_Domain.m_u16NameLength)) &&
+                       (p_rSendParameter.shiftOffset(p_Domain.m_u16NameLength)));
+
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRDomain: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_writeMDNSHostDomain
 
     Write a host domain to the UDP output buffer.
@@ -1246,33 +1373,38 @@ namespace MDNSImplementation
     and written to the output buffer.
 
 */
-    bool MDNSResponder::_writeMDNSHostDomain(const char*                          p_pcHostname,
-                                             bool                                 p_bPrependRDLength,
-                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
-        uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostname, false);
-
-        stcMDNS_RRDomain hostDomain;
-        bool             bResult = (u16CachedDomainOffset
-                            // Found cached domain -> mark as compressed domain
-                                        ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
-                               ((!p_bPrependRDLength) || (_write16(2, p_rSendParameter))) &&                                 // Length of 'Cxxx'
-                               (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&    // Compression mark (and offset)
-                               (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
-                            // No cached domain -> add this domain to cache and write full domain name
-                                        : ((_buildDomainForHost(p_pcHostname, hostDomain)) &&                                      // eg. esp8266.local
-                               ((!p_bPrependRDLength) || (_write16(hostDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
-                               (p_rSendParameter.addDomainCacheItem((const void*)p_pcHostname, false, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(hostDomain, p_rSendParameter))));
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSHostDomain: FAILED!\n"));
-                     });
-        return bResult;
-    }
+bool MDNSResponder::_writeMDNSHostDomain(const char* p_pcHostname,
+        bool p_bPrependRDLength,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+
+    // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
+    uint16_t            u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostname, false);
+
+    stcMDNS_RRDomain    hostDomain;
+    bool    bResult = (u16CachedDomainOffset
+                       // Found cached domain -> mark as compressed domain
+                       ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) && // Valid offset
+                          ((!p_bPrependRDLength) ||
+                           (_write16(2, p_rSendParameter))) &&                                     // Length of 'Cxxx'
+                          (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&   // Compression mark (and offset)
+                          (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
+                       // No cached domain -> add this domain to cache and write full domain name
+                       : ((_buildDomainForHost(p_pcHostname, hostDomain)) &&                       // eg. esp8266.local
+                          ((!p_bPrependRDLength) ||
+                           (_write16(hostDomain.m_u16NameLength, p_rSendParameter))) &&            // RDLength (if needed)
+                          (p_rSendParameter.addDomainCacheItem((const void*)p_pcHostname, false, p_rSendParameter.m_u16Offset)) &&
+                          (_writeMDNSRRDomain(hostDomain, p_rSendParameter))));
+
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSHostDomain: FAILED!\n"));
+    });
+    return bResult;
 
-    /*
+}
+
+/*
     MDNSResponder::_writeMDNSServiceDomain
 
     Write a service domain to the UDP output buffer.
@@ -1284,34 +1416,39 @@ namespace MDNSImplementation
     the instance name (p_bIncludeName is set) and thoose who don't.
 
 */
-    bool MDNSResponder::_writeMDNSServiceDomain(const MDNSResponder::stcMDNSService& p_Service,
-                                                bool                                 p_bIncludeName,
-                                                bool                                 p_bPrependRDLength,
-                                                MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
-        uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName);
-
-        stcMDNS_RRDomain serviceDomain;
-        bool             bResult = (u16CachedDomainOffset
-                            // Found cached domain -> mark as compressed domain
-                                        ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
-                               ((!p_bPrependRDLength) || (_write16(2, p_rSendParameter))) &&                                 // Length of 'Cxxx'
-                               (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&    // Compression mark (and offset)
-                               (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
-                            // No cached domain -> add this domain to cache and write full domain name
-                                        : ((_buildDomainForService(p_Service, p_bIncludeName, serviceDomain)) &&                      // eg. MyESP._http._tcp.local
-                               ((!p_bPrependRDLength) || (_write16(serviceDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
-                               (p_rSendParameter.addDomainCacheItem((const void*)&p_Service, p_bIncludeName, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(serviceDomain, p_rSendParameter))));
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSServiceDomain: FAILED!\n"));
-                     });
-        return bResult;
-    }
+bool MDNSResponder::_writeMDNSServiceDomain(const MDNSResponder::stcMDNSService& p_Service,
+        bool p_bIncludeName,
+        bool p_bPrependRDLength,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+
+    // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
+    uint16_t            u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName);
+
+    stcMDNS_RRDomain    serviceDomain;
+    bool    bResult = (u16CachedDomainOffset
+                       // Found cached domain -> mark as compressed domain
+                       ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) && // Valid offset
+                          ((!p_bPrependRDLength) ||
+                           (_write16(2, p_rSendParameter))) &&                                     // Length of 'Cxxx'
+                          (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&   // Compression mark (and offset)
+                          (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
+                       // No cached domain -> add this domain to cache and write full domain name
+                       : ((_buildDomainForService(p_Service, p_bIncludeName, serviceDomain)) &&    // eg. MyESP._http._tcp.local
+                          ((!p_bPrependRDLength) ||
+                           (_write16(serviceDomain.m_u16NameLength, p_rSendParameter))) &&         // RDLength (if needed)
+                          (p_rSendParameter.addDomainCacheItem((const void*)&p_Service, p_bIncludeName, p_rSendParameter.m_u16Offset)) &&
+                          (_writeMDNSRRDomain(serviceDomain, p_rSendParameter))));
+
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSServiceDomain: FAILED!\n"));
+    });
+    return bResult;
 
-    /*
+}
+
+/*
     MDNSResponder::_writeMDNSQuestion
 
     Write a MDNS question to the UDP output buffer
@@ -1321,22 +1458,25 @@ namespace MDNSImplementation
     QCLASS (16bit, eg. IN)
 
 */
-    bool MDNSResponder::_writeMDNSQuestion(MDNSResponder::stcMDNS_RRQuestion&   p_Question,
-                                           MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion\n")););
+bool MDNSResponder::_writeMDNSQuestion(MDNSResponder::stcMDNS_RRQuestion& p_Question,
+                                       MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion\n")););
 
-        bool bResult = ((_writeMDNSRRDomain(p_Question.m_Header.m_Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(p_Question.m_Header.m_Attributes, p_rSendParameter)));
+    bool    bResult = ((_writeMDNSRRDomain(p_Question.m_Header.m_Domain, p_rSendParameter)) &&
+                       (_writeMDNSRRAttributes(p_Question.m_Header.m_Attributes, p_rSendParameter)));
+
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion: FAILED!\n"));
+    });
+    return bResult;
+
+}
 
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion: FAILED!\n"));
-                     });
-        return bResult;
-    }
 
 #ifdef MDNS_IP4_SUPPORT
-    /*
+/*
     MDNSResponder::_writeMDNSAnswer_A
 
     Write a MDNS A answer to the UDP output buffer.
@@ -1351,28 +1491,30 @@ namespace MDNSImplementation
     eg. esp8266.local A 0x8001 120 4 123.456.789.012
     Ref: http://www.zytrax.com/books/dns/ch8/a.html
 */
-    bool MDNSResponder::_writeMDNSAnswer_A(IPAddress                            p_IPAddress,
-                                           MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A (%s)\n"), p_IPAddress.toString().c_str()););
-
-        stcMDNS_RRAttributes attributes(DNS_RRTYPE_A,
-                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
-        const unsigned char  aucIPAddress[MDNS_IP4_SIZE] = { p_IPAddress[0], p_IPAddress[1], p_IPAddress[2], p_IPAddress[3] };
-        bool                 bResult                     = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
-                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                       // TTL
-                        (_write16(MDNS_IP4_SIZE, p_rSendParameter)) &&                                                                              // RDLength
-                        (_udpAppendBuffer(aucIPAddress, MDNS_IP4_SIZE)) &&                                                                          // RData
-                        (p_rSendParameter.shiftOffset(MDNS_IP4_SIZE)));
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A: FAILED!\n"));
-                     });
-        return bResult;
-    }
+bool MDNSResponder::_writeMDNSAnswer_A(IPAddress p_IPAddress,
+                                       MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A (%s)\n"), p_IPAddress.toString().c_str()););
+
+    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_A,
+                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
+    const unsigned char     aucIPAddress[MDNS_IP4_SIZE] = { p_IPAddress[0], p_IPAddress[1], p_IPAddress[2], p_IPAddress[3] };
+    bool    bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) &&
+                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&        // TYPE & CLASS
+                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&    // TTL
+                       (_write16(MDNS_IP4_SIZE, p_rSendParameter)) &&                   // RDLength
+                       (_udpAppendBuffer(aucIPAddress, MDNS_IP4_SIZE)) &&               // RData
+                       (p_rSendParameter.shiftOffset(MDNS_IP4_SIZE)));
+
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A: FAILED!\n"));
+    });
+    return bResult;
+
+}
 
-    /*
+/*
     MDNSResponder::_writeMDNSAnswer_PTR_IP4
 
     Write a MDNS reverse IP4 PTR answer to the UDP output buffer.
@@ -1381,29 +1523,30 @@ namespace MDNSImplementation
     eg. 012.789.456.123.in-addr.arpa PTR 0x8001 120 15 esp8266.local
     Used while answering reverse IP4 questions
 */
-    bool MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress                            p_IPAddress,
-                                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4 (%s)\n"), p_IPAddress.toString().c_str()););
-
-        stcMDNS_RRDomain     reverseIP4Domain;
-        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
-                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
-        stcMDNS_RRDomain     hostDomain;
-        bool                 bResult = ((_buildDomainForReverseIP4(p_IPAddress, reverseIP4Domain)) &&                                                          // 012.789.456.123.in-addr.arpa
-                        (_writeMDNSRRDomain(reverseIP4Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
-                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                  // TTL
-                        (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                                                         // RDLength & RData (host domain, eg. esp8266.local)
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4: FAILED!\n"));
-                     });
-        return bResult;
-    }
+bool MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress p_IPAddress,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4 (%s)\n"), p_IPAddress.toString().c_str()););
+
+    stcMDNS_RRDomain        reverseIP4Domain;
+    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_PTR,
+                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
+    stcMDNS_RRDomain        hostDomain;
+    bool    bResult = ((_buildDomainForReverseIP4(p_IPAddress, reverseIP4Domain)) &&    // 012.789.456.123.in-addr.arpa
+                       (_writeMDNSRRDomain(reverseIP4Domain, p_rSendParameter)) &&
+                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&        // TYPE & CLASS
+                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&    // TTL
+                       (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));   // RDLength & RData (host domain, eg. esp8266.local)
+
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4: FAILED!\n"));
+    });
+    return bResult;
+}
 #endif
 
-    /*
+/*
     MDNSResponder::_writeMDNSAnswer_PTR_TYPE
 
     Write a MDNS PTR answer to the UDP output buffer.
@@ -1413,27 +1556,28 @@ namespace MDNSImplementation
     eg. _services._dns-sd._udp.local PTR 0x8001 5400 xx _http._tcp.local
     http://www.zytrax.com/books/dns/ch8/ptr.html
 */
-    bool MDNSResponder::_writeMDNSAnswer_PTR_TYPE(MDNSResponder::stcMDNSService&       p_rService,
-                                                  MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE\n")););
-
-        stcMDNS_RRDomain     dnssdDomain;
-        stcMDNS_RRDomain     serviceDomain;
-        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);                                                                                  // No cache flush! only INternet
-        bool                 bResult = ((_buildDomainForDNSSD(dnssdDomain)) &&                                                                            // _services._dns-sd._udp.local
-                        (_writeMDNSRRDomain(dnssdDomain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
-                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&                          // TTL
-                        (_writeMDNSServiceDomain(p_rService, false, true, p_rSendParameter)));                                            // RDLength & RData (service domain, eg. _http._tcp.local)
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE: FAILED!\n"));
-                     });
-        return bResult;
-    }
+bool MDNSResponder::_writeMDNSAnswer_PTR_TYPE(MDNSResponder::stcMDNSService& p_rService,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE\n")););
+
+    stcMDNS_RRDomain        dnssdDomain;
+    stcMDNS_RRDomain        serviceDomain;
+    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);	// No cache flush! only INternet
+    bool    bResult = ((_buildDomainForDNSSD(dnssdDomain)) &&                                   // _services._dns-sd._udp.local
+                       (_writeMDNSRRDomain(dnssdDomain, p_rSendParameter)) &&
+                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                // TYPE & CLASS
+                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) && // TTL
+                       (_writeMDNSServiceDomain(p_rService, false, true, p_rSendParameter)));   // RDLength & RData (service domain, eg. _http._tcp.local)
+
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_writeMDNSAnswer_PTR_NAME
 
     Write a MDNS PTR answer to the UDP output buffer.
@@ -1443,25 +1587,26 @@ namespace MDNSImplementation
     eg. _http.tcp.local PTR 0x8001 120 xx myESP._http._tcp.local
     http://www.zytrax.com/books/dns/ch8/ptr.html
 */
-    bool MDNSResponder::_writeMDNSAnswer_PTR_NAME(MDNSResponder::stcMDNSService&       p_rService,
-                                                  MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME\n")););
-
-        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);                                                          // No cache flush! only INternet
-        bool                 bResult = ((_writeMDNSServiceDomain(p_rService, false, false, p_rSendParameter)) &&                  // _http._tcp.local
-                        (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
-                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
-                        (_writeMDNSServiceDomain(p_rService, true, true, p_rSendParameter)));                     // RDLength & RData (service domain, eg. MyESP._http._tcp.local)
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME: FAILED!\n"));
-                     });
-        return bResult;
-    }
+bool MDNSResponder::_writeMDNSAnswer_PTR_NAME(MDNSResponder::stcMDNSService& p_rService,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME\n")););
+
+    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);	// No cache flush! only INternet
+    bool    bResult = ((_writeMDNSServiceDomain(p_rService, false, false, p_rSendParameter)) && // _http._tcp.local
+                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                    // TYPE & CLASS
+                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) && // TTL
+                       (_writeMDNSServiceDomain(p_rService, true, true, p_rSendParameter)));        // RDLength & RData (service domain, eg. MyESP._http._tcp.local)
+
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME: FAILED!\n"));
+    });
+    return bResult;
+}
+
 
-    /*
+/*
     MDNSResponder::_writeMDNSAnswer_TXT
 
     Write a MDNS TXT answer to the UDP output buffer.
@@ -1472,49 +1617,55 @@ namespace MDNSImplementation
     eg. myESP._http._tcp.local TXT 0x8001 120 4 c#=1
     http://www.zytrax.com/books/dns/ch8/txt.html
 */
-    bool MDNSResponder::_writeMDNSAnswer_TXT(MDNSResponder::stcMDNSService&       p_rService,
-                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT\n")););
+bool MDNSResponder::_writeMDNSAnswer_TXT(MDNSResponder::stcMDNSService& p_rService,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT\n")););
+
+    bool                    bResult = false;
 
-        bool bResult = false;
+    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_TXT,
+                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
 
-        stcMDNS_RRAttributes attributes(DNS_RRTYPE_TXT,
-                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+    if ((_collectServiceTxts(p_rService)) &&
+            (_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&     // MyESP._http._tcp.local
+            (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                   // TYPE & CLASS
+            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&    // TTL
+            (_write16(p_rService.m_Txts.length(), p_rSendParameter)))                   // RDLength
+    {
 
-        if ((_collectServiceTxts(p_rService)) && (_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&  // MyESP._http._tcp.local
-            (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                                     // TYPE & CLASS
-            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&                      // TTL
-            (_write16(p_rService.m_Txts.length(), p_rSendParameter)))                                                     // RDLength
+        bResult = true;
+        // RData    Txts
+        for (stcMDNSServiceTxt* pTxt = p_rService.m_Txts.m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
         {
-            bResult = true;
-            // RData    Txts
-            for (stcMDNSServiceTxt* pTxt = p_rService.m_Txts.m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
-            {
-                unsigned char ucLengthByte = pTxt->length();
-                bResult                    = ((_udpAppendBuffer((unsigned char*)&ucLengthByte, sizeof(ucLengthByte))) &&                                                                                                  // Length
-                           (p_rSendParameter.shiftOffset(sizeof(ucLengthByte))) && ((size_t)os_strlen(pTxt->m_pcKey) == m_pUDPContext->append(pTxt->m_pcKey, os_strlen(pTxt->m_pcKey))) &&             // Key
-                           (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcKey))) && (1 == m_pUDPContext->append("=", 1)) &&                                                                 // =
-                           (p_rSendParameter.shiftOffset(1)) && ((!pTxt->m_pcValue) || (((size_t)os_strlen(pTxt->m_pcValue) == m_pUDPContext->append(pTxt->m_pcValue, os_strlen(pTxt->m_pcValue))) &&  // Value
-                                                                                        (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcValue))))));
-
-                DEBUG_EX_ERR(if (!bResult)
-                             {
-                                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED to write %sTxt %s=%s!\n"), (pTxt->m_bTemp ? "temp. " : ""), (pTxt->m_pcKey ?: "?"), (pTxt->m_pcValue ?: "?"));
-                             });
-            }
+            unsigned char       ucLengthByte = pTxt->length();
+            bResult = ((_udpAppendBuffer((unsigned char*)&ucLengthByte, sizeof(ucLengthByte))) &&   // Length
+                       (p_rSendParameter.shiftOffset(sizeof(ucLengthByte))) &&
+                       ((size_t)os_strlen(pTxt->m_pcKey) == m_pUDPContext->append(pTxt->m_pcKey, os_strlen(pTxt->m_pcKey))) &&          // Key
+                       (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcKey))) &&
+                       (1 == m_pUDPContext->append("=", 1)) &&                                                                          // =
+                       (p_rSendParameter.shiftOffset(1)) &&
+                       ((!pTxt->m_pcValue) ||
+                        (((size_t)os_strlen(pTxt->m_pcValue) == m_pUDPContext->append(pTxt->m_pcValue, os_strlen(pTxt->m_pcValue))) &&  // Value
+                         (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcValue))))));
+
+            DEBUG_EX_ERR(if (!bResult)
+        {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED to write %sTxt %s=%s!\n"), (pTxt->m_bTemp ? "temp. " : ""), (pTxt->m_pcKey ? : "?"), (pTxt->m_pcValue ? : "?"));
+            });
         }
-        _releaseTempServiceTxts(p_rService);
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED!\n"));
-                     });
-        return bResult;
     }
+    _releaseTempServiceTxts(p_rService);
+
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED!\n"));
+    });
+    return bResult;
+}
 
 #ifdef MDNS_IP6_SUPPORT
-    /*
+/*
     MDNSResponder::_writeMDNSAnswer_AAAA
 
     Write a MDNS AAAA answer to the UDP output buffer.
@@ -1523,27 +1674,27 @@ namespace MDNSImplementation
     eg. esp8266.local AAAA 0x8001 120 16 xxxx::xx
     http://www.zytrax.com/books/dns/ch8/aaaa.html
 */
-    bool MDNSResponder::_writeMDNSAnswer_AAAA(IPAddress                            p_IPAddress,
-                                              MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA\n")););
-
-        stcMDNS_RRAttributes attributes(DNS_RRTYPE_AAAA,
-                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));                          // Cache flush? & INternet
-        bool                 bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) &&                            // esp8266.local
-                        (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                   // TYPE & CLASS
-                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&       // TTL
-                        (_write16(MDNS_IP6_SIZE, p_rSendParameter)) &&                                              // RDLength
-                        (false /*TODO: IP6 version of: _udpAppendBuffer((uint32_t)p_IPAddress, MDNS_IP4_SIZE)*/));  // RData
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA: FAILED!\n"));
-                     });
-        return bResult;
-    }
+bool MDNSResponder::_writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA\n")););
+
+    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_AAAA,
+                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
+    bool    bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) && // esp8266.local
+                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&            // TYPE & CLASS
+                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&    // TTL
+                       (_write16(MDNS_IP6_SIZE, p_rSendParameter)) &&                       // RDLength
+                       (false /*TODO: IP6 version of: _udpAppendBuffer((uint32_t)p_IPAddress, MDNS_IP4_SIZE)*/));   // RData
+
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA: FAILED!\n"));
+    });
+    return bResult;
+}
 
-    /*
+/*
     MDNSResponder::_writeMDNSAnswer_PTR_IP6
 
     Write a MDNS reverse IP6 PTR answer to the UDP output buffer.
@@ -1552,77 +1703,86 @@ namespace MDNSImplementation
     eg. xxxx::xx.in6.arpa PTR 0x8001 120 15 esp8266.local
     Used while answering reverse IP6 questions
 */
-    bool MDNSResponder::_writeMDNSAnswer_PTR_IP6(IPAddress                            p_IPAddress,
-                                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6\n")););
-
-        stcMDNS_RRDomain     reverseIP6Domain;
-        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
-                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));                                                     // Cache flush? & INternet
-        bool                 bResult = ((_buildDomainForReverseIP6(p_IPAddress, reverseIP6Domain)) &&                                                          // xxxx::xx.ip6.arpa
-                        (_writeMDNSRRDomain(reverseIP6Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
-                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                  // TTL
-                        (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                                                         // RDLength & RData (host domain, eg. esp8266.local)
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6: FAILED!\n"));
-                     });
-        return bResult;
-    }
+bool MDNSResponder::_writeMDNSAnswer_PTR_IP6(IPAddress p_IPAddress,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6\n")););
+
+    stcMDNS_RRDomain        reverseIP6Domain;
+    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_PTR,
+                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
+    bool    bResult = ((_buildDomainForReverseIP6(p_IPAddress, reverseIP6Domain)) &&        // xxxx::xx.ip6.arpa
+                       (_writeMDNSRRDomain(reverseIP6Domain, p_rSendParameter)) &&
+                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&            // TYPE & CLASS
+                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&    // TTL
+                       (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));       // RDLength & RData (host domain, eg. esp8266.local)
+
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6: FAILED!\n"));
+    });
+    return bResult;
+}
 #endif
 
-    /*
+/*
     MDNSResponder::_writeMDNSAnswer_SRV
 
     eg. MyESP._http.tcp.local SRV 0x8001 120 0 0 60068 esp8266.local
     http://www.zytrax.com/books/dns/ch8/srv.html ???? Include instance name ????
 */
-    bool MDNSResponder::_writeMDNSAnswer_SRV(MDNSResponder::stcMDNSService&       p_rService,
-                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV\n")););
-
-        uint16_t u16CachedDomainOffset = (p_rSendParameter.m_bLegacyQuery
-                                              ? 0
-                                              : p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostname, false));
-
-        stcMDNS_RRAttributes attributes(DNS_RRTYPE_SRV,
-                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
-        stcMDNS_RRDomain     hostDomain;
-        bool                 bResult = ((_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&                   // MyESP._http._tcp.local
-                        (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
-                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
-                        (!u16CachedDomainOffset
-                             // No cache for domain name (or no compression allowed)
-                                             ? ((_buildDomainForHost(m_pcHostname, hostDomain)) && (_write16((sizeof(uint16_t /*Prio*/) +  // RDLength
-                                                                                              sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + hostDomain.m_u16NameLength),
-                                                                                             p_rSendParameter))
-                                &&                                                                                                                                                            // Domain length
-                                (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&                                                                                                            // Priority
-                                (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                                                                                              // Weight
-                                (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                                                                                         // Port
-                                (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostname, false, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(hostDomain, p_rSendParameter)))  // Host, eg. esp8266.local
-                                                                                                                                                                                              // Cache available for domain
-                                             : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&                                                                  // Valid offset
-                                (_write16((sizeof(uint16_t /*Prio*/) +                                                                                                                        // RDLength
-                                           sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + 2),
-                                          p_rSendParameter))
-                                &&                                                                                          // Length of 'C0xx'
-                                (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&                                          // Priority
-                                (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                            // Weight
-                                (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                       // Port
-                                (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&  // Compression mark (and offset)
-                                (_write8((uint8_t)u16CachedDomainOffset, p_rSendParameter)))));                             // Offset
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV: FAILED!\n"));
-                     });
-        return bResult;
-    }
+bool MDNSResponder::_writeMDNSAnswer_SRV(MDNSResponder::stcMDNSService& p_rService,
+        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+{
+    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV\n")););
+
+    uint16_t                u16CachedDomainOffset = (p_rSendParameter.m_bLegacyQuery
+            ? 0
+            : p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostname, false));
+
+    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_SRV,
+                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
+    stcMDNS_RRDomain        hostDomain;
+    bool    bResult = ((_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&  // MyESP._http._tcp.local
+                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                // TYPE & CLASS
+                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) && // TTL
+                       (!u16CachedDomainOffset
+                        // No cache for domain name (or no compression allowed)
+                        ? ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
+                           (_write16((sizeof(uint16_t /*Prio*/) +                           // RDLength
+                                      sizeof(uint16_t /*Weight*/) +
+                                      sizeof(uint16_t /*Port*/) +
+                                      hostDomain.m_u16NameLength), p_rSendParameter)) &&    // Domain length
+                           (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&               // Priority
+                           (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                 // Weight
+                           (_write16(p_rService.m_u16Port, p_rSendParameter)) &&            // Port
+                           (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostname, false, p_rSendParameter.m_u16Offset)) &&
+                           (_writeMDNSRRDomain(hostDomain, p_rSendParameter)))              // Host, eg. esp8266.local
+                        // Cache available for domain
+                        : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) && // Valid offset
+                           (_write16((sizeof(uint16_t /*Prio*/) +                           // RDLength
+                                      sizeof(uint16_t /*Weight*/) +
+                                      sizeof(uint16_t /*Port*/) +
+                                      2), p_rSendParameter)) &&                             // Length of 'C0xx'
+                           (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&               // Priority
+                           (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                 // Weight
+                           (_write16(p_rService.m_u16Port, p_rSendParameter)) &&            // Port
+                           (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&   // Compression mark (and offset)
+                           (_write8((uint8_t)u16CachedDomainOffset, p_rSendParameter)))));  // Offset
+
+    DEBUG_EX_ERR(if (!bResult)
+{
+    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV: FAILED!\n"));
+    });
+    return bResult;
+}
+
+}   // namespace MDNSImplementation
+
+} // namespace esp8266
+
+
+
+
 
-}  // namespace MDNSImplementation
 
-}  // namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h b/libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h
index ea2128a9ed..3686440f10 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h
@@ -27,4 +27,4 @@
 
 #include <lwip/prot/dns.h>  // DNS_RRTYPE_xxx, DNS_MQUERY_PORT
 
-#endif  // MDNS_LWIPDEFS_H
+#endif // MDNS_LWIPDEFS_H
diff --git a/libraries/Hash/examples/sha1/sha1.ino b/libraries/Hash/examples/sha1/sha1.ino
index 945c385e6e..e9260ed9c5 100644
--- a/libraries/Hash/examples/sha1/sha1.ino
+++ b/libraries/Hash/examples/sha1/sha1.ino
@@ -9,6 +9,7 @@ void setup() {
 }
 
 void loop() {
+
   // usage as String
   // SHA1:a9993e364706816aba3e25717850c26c9cd0d89d
 
diff --git a/libraries/I2S/examples/SimpleTone/SimpleTone.ino b/libraries/I2S/examples/SimpleTone/SimpleTone.ino
index 535cbf5c0b..6959ae74ba 100644
--- a/libraries/I2S/examples/SimpleTone/SimpleTone.ino
+++ b/libraries/I2S/examples/SimpleTone/SimpleTone.ino
@@ -10,14 +10,14 @@
 
 #include <I2S.h>
 
-const int frequency  = 440;   // frequency of square wave in Hz
-const int amplitude  = 500;   // amplitude of square wave
-const int sampleRate = 8000;  // sample rate in Hz
+const int frequency = 440; // frequency of square wave in Hz
+const int amplitude = 500; // amplitude of square wave
+const int sampleRate = 8000; // sample rate in Hz
 
-const int halfWavelength = (sampleRate / frequency);  // half wavelength of square wave
+const int halfWavelength = (sampleRate / frequency); // half wavelength of square wave
 
-short sample = amplitude;  // current sample value
-int   count  = 0;
+short sample = amplitude; // current sample value
+int count = 0;
 
 void setup() {
   Serial.begin(115200);
@@ -26,8 +26,7 @@ void setup() {
   // start I2S at the sample rate with 16-bits per sample
   if (!I2S.begin(I2S_PHILIPS_MODE, sampleRate, 16)) {
     Serial.println("Failed to initialize I2S!");
-    while (1)
-      ;  // do nothing
+    while (1); // do nothing
   }
 }
 
@@ -44,3 +43,4 @@ void loop() {
   // increment the counter for the next sample
   count++;
 }
+
diff --git a/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino b/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
index 628c7490ee..40e02087dc 100644
--- a/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
+++ b/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
@@ -9,16 +9,17 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* pass = STAPSK;
+const char *ssid = STASSID;
+const char *pass = STAPSK;
 
-long timezone    = 2;
+long timezone = 2;
 byte daysavetime = 1;
 
-void listDir(const char* dirname) {
+
+void listDir(const char * dirname) {
   Serial.printf("Listing directory: %s\n", dirname);
 
   Dir root = LittleFS.openDir(dirname);
@@ -32,14 +33,15 @@ void listDir(const char* dirname) {
     time_t cr = file.getCreationTime();
     time_t lw = file.getLastWrite();
     file.close();
-    struct tm* tmstruct = localtime(&cr);
+    struct tm * tmstruct = localtime(&cr);
     Serial.printf("    CREATION: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
     tmstruct = localtime(&lw);
     Serial.printf("  LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
   }
 }
 
-void readFile(const char* path) {
+
+void readFile(const char * path) {
   Serial.printf("Reading file: %s\n", path);
 
   File file = LittleFS.open(path, "r");
@@ -55,7 +57,7 @@ void readFile(const char* path) {
   file.close();
 }
 
-void writeFile(const char* path, const char* message) {
+void writeFile(const char * path, const char * message) {
   Serial.printf("Writing file: %s\n", path);
 
   File file = LittleFS.open(path, "w");
@@ -68,11 +70,11 @@ void writeFile(const char* path, const char* message) {
   } else {
     Serial.println("Write failed");
   }
-  delay(2000);  // Make sure the CREATE and LASTWRITE times are different
+  delay(2000); // Make sure the CREATE and LASTWRITE times are different
   file.close();
 }
 
-void appendFile(const char* path, const char* message) {
+void appendFile(const char * path, const char * message) {
   Serial.printf("Appending to file: %s\n", path);
 
   File file = LittleFS.open(path, "a");
@@ -88,7 +90,7 @@ void appendFile(const char* path, const char* message) {
   file.close();
 }
 
-void renameFile(const char* path1, const char* path2) {
+void renameFile(const char * path1, const char * path2) {
   Serial.printf("Renaming file %s to %s\n", path1, path2);
   if (LittleFS.rename(path1, path2)) {
     Serial.println("File renamed");
@@ -97,7 +99,7 @@ void renameFile(const char* path1, const char* path2) {
   }
 }
 
-void deleteFile(const char* path) {
+void deleteFile(const char * path) {
   Serial.printf("Deleting file: %s\n", path);
   if (LittleFS.remove(path)) {
     Serial.println("File deleted");
@@ -125,7 +127,7 @@ void setup() {
   Serial.println(WiFi.localIP());
   Serial.println("Contacting Time Server");
   configTime(3600 * timezone, daysavetime * 3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org");
-  struct tm tmstruct;
+  struct tm tmstruct ;
   delay(2000);
   tmstruct.tm_year = 0;
   getLocalTime(&tmstruct, 5000);
@@ -156,6 +158,9 @@ void setup() {
   }
   readFile("/hello.txt");
   listDir("/");
+
+
 }
 
 void loop() { }
+
diff --git a/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino b/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
index 47963b177f..35e0ac66e6 100644
--- a/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
+++ b/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
@@ -15,13 +15,13 @@
 #define TESTSIZEKB 512
 
 // Format speed in bytes/second.  Static buffer so not re-entrant safe
-const char* rate(unsigned long start, unsigned long stop, unsigned long bytes) {
+const char *rate(unsigned long start, unsigned long stop, unsigned long bytes) {
   static char buff[64];
   if (stop == start) {
     strcpy_P(buff, PSTR("Inf b/s"));
   } else {
     unsigned long delta = stop - start;
-    float         r     = 1000.0 * (float)bytes / (float)delta;
+    float r = 1000.0 * (float)bytes / (float)delta;
     if (r >= 1000000.0) {
       sprintf_P(buff, PSTR("%0.2f MB/s"), r / 1000000.0);
     } else if (r >= 1000.0) {
@@ -33,7 +33,7 @@ const char* rate(unsigned long start, unsigned long stop, unsigned long bytes) {
   return buff;
 }
 
-void DoTest(FS* fs) {
+void DoTest(FS *fs) {
   if (!fs->format()) {
     Serial.printf("Unable to format(), aborting\n");
     return;
@@ -45,12 +45,12 @@ void DoTest(FS* fs) {
 
   uint8_t data[256];
   for (int i = 0; i < 256; i++) {
-    data[i] = (uint8_t)i;
+    data[i] = (uint8_t) i;
   }
 
   Serial.printf("Creating %dKB file, may take a while...\n", TESTSIZEKB);
   unsigned long start = millis();
-  File          f     = fs->open("/testwrite.bin", "w");
+  File f = fs->open("/testwrite.bin", "w");
   if (!f) {
     Serial.printf("Unable to open file for writing, aborting\n");
     return;
@@ -70,7 +70,7 @@ void DoTest(FS* fs) {
 
   Serial.printf("Reading %dKB file sequentially in 256b chunks\n", TESTSIZEKB);
   start = millis();
-  f     = fs->open("/testwrite.bin", "r");
+  f = fs->open("/testwrite.bin", "r");
   for (int i = 0; i < TESTSIZEKB; i++) {
     for (int j = 0; j < 4; j++) {
       f.read(data, 256);
@@ -82,7 +82,7 @@ void DoTest(FS* fs) {
 
   Serial.printf("Reading %dKB file MISALIGNED in flash and RAM sequentially in 256b chunks\n", TESTSIZEKB);
   start = millis();
-  f     = fs->open("/testwrite.bin", "r");
+  f = fs->open("/testwrite.bin", "r");
   f.read();
   for (int i = 0; i < TESTSIZEKB; i++) {
     for (int j = 0; j < 4; j++) {
@@ -95,7 +95,7 @@ void DoTest(FS* fs) {
 
   Serial.printf("Reading %dKB file in reverse by 256b chunks\n", TESTSIZEKB);
   start = millis();
-  f     = fs->open("/testwrite.bin", "r");
+  f = fs->open("/testwrite.bin", "r");
   for (int i = 0; i < TESTSIZEKB; i++) {
     for (int j = 0; j < 4; j++) {
       if (!f.seek(256 + 256 * j * i, SeekEnd)) {
@@ -114,7 +114,7 @@ void DoTest(FS* fs) {
 
   Serial.printf("Writing 64K file in 1-byte chunks\n");
   start = millis();
-  f     = fs->open("/test1b.bin", "w");
+  f = fs->open("/test1b.bin", "w");
   for (int i = 0; i < 65536; i++) {
     f.write((uint8_t*)&i, 1);
   }
@@ -124,7 +124,7 @@ void DoTest(FS* fs) {
 
   Serial.printf("Reading 64K file in 1-byte chunks\n");
   start = millis();
-  f     = fs->open("/test1b.bin", "r");
+  f = fs->open("/test1b.bin", "r");
   for (int i = 0; i < 65536; i++) {
     char c;
     f.read((uint8_t*)&c, 1);
@@ -133,9 +133,10 @@ void DoTest(FS* fs) {
   stop = millis();
   Serial.printf("==> Time to read 64KB in 1b chunks = %lu milliseconds = %s\n", stop - start, rate(start, stop, 65536));
 
-  start         = millis();
-  auto dest     = fs->open("/test1bw.bin", "w");
-  f             = fs->open("/test1b.bin", "r");
+
+  start = millis();
+  auto dest = fs->open("/test1bw.bin", "w");
+  f = fs->open("/test1b.bin", "r");
   auto copysize = f.sendAll(dest);
   dest.close();
   stop = millis();
diff --git a/libraries/Netdump/examples/Netdump/Netdump.ino b/libraries/Netdump/examples/Netdump/Netdump.ino
index 6d7975616f..dbba63869b 100644
--- a/libraries/Netdump/examples/Netdump/Netdump.ino
+++ b/libraries/Netdump/examples/Netdump/Netdump.ino
@@ -12,10 +12,10 @@ using namespace NetCapture;
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 Netdump nd;
@@ -37,23 +37,25 @@ enum class SerialOption : uint8_t {
 
 void startSerial(SerialOption option) {
   switch (option) {
-    case SerialOption::AllFull:  //All Packets, show packet summary.
+    case SerialOption::AllFull : //All Packets, show packet summary.
       nd.printDump(Serial, Packet::PacketDetail::FULL);
       break;
 
-    case SerialOption::LocalNone:  // Only local IP traffic, full details
+    case SerialOption::LocalNone : // Only local IP traffic, full details
       nd.printDump(Serial, Packet::PacketDetail::NONE,
-                   [](Packet n) {
-                     return (n.hasIP(WiFi.localIP()));
-                   });
+      [](Packet n) {
+        return (n.hasIP(WiFi.localIP()));
+      }
+                  );
       break;
-    case SerialOption::HTTPChar:  // Only HTTP traffic, show packet content as chars
+    case SerialOption::HTTPChar : // Only HTTP traffic, show packet content as chars
       nd.printDump(Serial, Packet::PacketDetail::CHAR,
-                   [](Packet n) {
-                     return (n.isHTTP());
-                   });
+      [](Packet n) {
+        return (n.isHTTP());
+      }
+                  );
       break;
-    default:
+    default :
       Serial.printf("No valid SerialOption provided\r\n");
   };
 }
@@ -90,34 +92,37 @@ void setup(void) {
   filesystem->begin();
 
   webServer.on("/list",
-               []() {
-                 Dir    dir = filesystem->openDir("/");
-                 String d   = "<h1>File list</h1>";
-                 while (dir.next()) {
-                   d.concat("<li>" + dir.fileName() + "</li>");
-                 }
-                 webServer.send(200, "text.html", d);
-               });
+  []() {
+    Dir dir = filesystem->openDir("/");
+    String d = "<h1>File list</h1>";
+    while (dir.next()) {
+      d.concat("<li>" + dir.fileName() + "</li>");
+    }
+    webServer.send(200, "text.html", d);
+  }
+              );
 
   webServer.on("/req",
-               []() {
-                 static int rq = 0;
-                 String     a  = "<h1>You are connected, Number of requests = " + String(rq++) + "</h1>";
-                 webServer.send(200, "text/html", a);
-               });
+  []() {
+    static int rq = 0;
+    String a = "<h1>You are connected, Number of requests = " + String(rq++) + "</h1>";
+    webServer.send(200, "text/html", a);
+  }
+              );
 
   webServer.on("/reset",
-               []() {
-                 nd.reset();
-                 tracefile.close();
-                 tcpServer.close();
-                 webServer.send(200, "text.html", "<h1>Netdump session reset</h1>");
-               });
+  []() {
+    nd.reset();
+    tracefile.close();
+    tcpServer.close();
+    webServer.send(200, "text.html", "<h1>Netdump session reset</h1>");
+  }
+              );
 
   webServer.serveStatic("/", *filesystem, "/");
   webServer.begin();
 
-  startSerial(SerialOption::AllFull);  // Serial output examples, use enum SerialOption for selection
+  startSerial(SerialOption::AllFull); // Serial output examples, use enum SerialOption for selection
 
   //  startTcpDump();     // tcpdump option
   //  startTracefile();  // output to SPIFFS or LittleFS
@@ -148,3 +153,4 @@ void loop(void) {
   webServer.handleClient();
   MDNS.update();
 }
+
diff --git a/libraries/Netdump/src/Netdump.cpp b/libraries/Netdump/src/Netdump.cpp
index 6af00c4f20..4d4deb05b2 100644
--- a/libraries/Netdump/src/Netdump.cpp
+++ b/libraries/Netdump/src/Netdump.cpp
@@ -23,8 +23,10 @@
 #include <lwip/init.h>
 #include "Schedule.h"
 
+
 namespace NetCapture
 {
+
 CallBackList<Netdump::LwipCallback> Netdump::lwipCallback;
 
 Netdump::Netdump()
@@ -67,20 +69,24 @@ void Netdump::reset()
 void Netdump::printDump(Print& out, Packet::PacketDetail ndd, const Filter nf)
 {
     out.printf_P(PSTR("netDump starting\r\n"));
-    setCallback([&out, ndd, this](const Packet& ndp)
-                { printDumpProcess(out, ndd, ndp); },
-                nf);
+    setCallback([&out, ndd, this](const Packet & ndp)
+    {
+        printDumpProcess(out, ndd, ndp);
+    }, nf);
 }
 
 void Netdump::fileDump(File& outfile, const Filter nf)
 {
+
     writePcapHeader(outfile);
-    setCallback([&outfile, this](const Packet& ndp)
-                { fileDumpProcess(outfile, ndp); },
-                nf);
+    setCallback([&outfile, this](const Packet & ndp)
+    {
+        fileDumpProcess(outfile, ndp);
+    }, nf);
 }
-bool Netdump::tcpDump(WiFiServer& tcpDumpServer, const Filter nf)
+bool Netdump::tcpDump(WiFiServer &tcpDumpServer, const Filter nf)
 {
+
     if (!packetBuffer)
     {
         packetBuffer = new (std::nothrow) char[tcpBufferSize];
@@ -93,7 +99,9 @@ bool Netdump::tcpDump(WiFiServer& tcpDumpServer, const Filter nf)
     bufferIndex = 0;
 
     schedule_function([&tcpDumpServer, this, nf]()
-                      { tcpDumpLoop(tcpDumpServer, nf); });
+    {
+        tcpDumpLoop(tcpDumpServer, nf);
+    });
     return true;
 }
 
@@ -101,7 +109,7 @@ void Netdump::capture(int netif_idx, const char* data, size_t len, int out, int
 {
     if (lwipCallback.execute(netif_idx, data, len, out, success) == 0)
     {
-        phy_capture = nullptr;  // No active callback/netdump instances, will be set again by new object.
+        phy_capture = nullptr; // No active callback/netdump instances, will be set again by new object.
     }
 }
 
@@ -110,7 +118,7 @@ void Netdump::netdumpCapture(int netif_idx, const char* data, size_t len, int ou
     if (netDumpCallback)
     {
         Packet np(millis(), netif_idx, data, len, out, success);
-        if (netDumpFilter && !netDumpFilter(np))
+        if (netDumpFilter  && !netDumpFilter(np))
         {
             return;
         }
@@ -123,8 +131,8 @@ void Netdump::writePcapHeader(Stream& s) const
     uint32_t pcapHeader[6];
     pcapHeader[0] = 0xa1b2c3d4;     // pcap magic number
     pcapHeader[1] = 0x00040002;     // pcap major/minor version
-    pcapHeader[2] = 0;              // pcap UTC correction in seconds
-    pcapHeader[3] = 0;              // pcap time stamp accuracy
+    pcapHeader[2] = 0;			     // pcap UTC correction in seconds
+    pcapHeader[3] = 0;			     // pcap time stamp accuracy
     pcapHeader[4] = maxPcapLength;  // pcap max packet length per record
     pcapHeader[5] = 1;              // pacp data linkt type = ethernet
     s.write(reinterpret_cast<char*>(pcapHeader), 24);
@@ -137,7 +145,7 @@ void Netdump::printDumpProcess(Print& out, Packet::PacketDetail ndd, const Packe
 
 void Netdump::fileDumpProcess(File& outfile, const Packet& np) const
 {
-    size_t   incl_len = np.getPacketSize() > maxPcapLength ? maxPcapLength : np.getPacketSize();
+    size_t incl_len = np.getPacketSize() > maxPcapLength ? maxPcapLength : np.getPacketSize();
     uint32_t pcapHeader[4];
 
     struct timeval tv;
@@ -146,7 +154,7 @@ void Netdump::fileDumpProcess(File& outfile, const Packet& np) const
     pcapHeader[1] = tv.tv_usec;
     pcapHeader[2] = incl_len;
     pcapHeader[3] = np.getPacketSize();
-    outfile.write(reinterpret_cast<char*>(pcapHeader), 16);  // pcap record header
+    outfile.write(reinterpret_cast<char*>(pcapHeader), 16); // pcap record header
 
     outfile.write(np.rawData(), incl_len);
 }
@@ -160,16 +168,16 @@ void Netdump::tcpDumpProcess(const Packet& np)
     }
     size_t incl_len = np.getPacketSize() > maxPcapLength ? maxPcapLength : np.getPacketSize();
 
-    if (bufferIndex + 16 + incl_len < tcpBufferSize)  // only add if enough space available
+    if (bufferIndex + 16 + incl_len < tcpBufferSize) // only add if enough space available
     {
         struct timeval tv;
         gettimeofday(&tv, nullptr);
         uint32_t* pcapHeader = reinterpret_cast<uint32_t*>(&packetBuffer[bufferIndex]);
-        pcapHeader[0]        = tv.tv_sec;  // add pcap record header
-        pcapHeader[1]        = tv.tv_usec;
-        pcapHeader[2]        = incl_len;
-        pcapHeader[3]        = np.getPacketSize();
-        bufferIndex += 16;  // pcap header size
+        pcapHeader[0] = tv.tv_sec;      // add pcap record header
+        pcapHeader[1] = tv.tv_usec;
+        pcapHeader[2] = incl_len;
+        pcapHeader[3] = np.getPacketSize();
+        bufferIndex += 16; // pcap header size
         memcpy(&packetBuffer[bufferIndex], np.rawData(), incl_len);
         bufferIndex += incl_len;
     }
@@ -181,7 +189,7 @@ void Netdump::tcpDumpProcess(const Packet& np)
     }
 }
 
-void Netdump::tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf)
+void Netdump::tcpDumpLoop(WiFiServer &tcpDumpServer, const Filter nf)
 {
     if (tcpDumpServer.hasClient())
     {
@@ -191,9 +199,10 @@ void Netdump::tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf)
         bufferIndex = 0;
         writePcapHeader(tcpDumpClient);
 
-        setCallback([this](const Packet& ndp)
-                    { tcpDumpProcess(ndp); },
-                    nf);
+        setCallback([this](const Packet & ndp)
+        {
+            tcpDumpProcess(ndp);
+        }, nf);
     }
     if (!tcpDumpClient || !tcpDumpClient.connected())
     {
@@ -208,8 +217,10 @@ void Netdump::tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf)
     if (tcpDumpServer.status() != CLOSED)
     {
         schedule_function([&tcpDumpServer, this, nf]()
-                          { tcpDumpLoop(tcpDumpServer, nf); });
+        {
+            tcpDumpLoop(tcpDumpServer, nf);
+        });
     }
 }
 
-}  // namespace NetCapture
+} // namespace NetCapture
diff --git a/libraries/Netdump/src/NetdumpIP.cpp b/libraries/Netdump/src/NetdumpIP.cpp
index 2f2676cbba..56936c744a 100644
--- a/libraries/Netdump/src/NetdumpIP.cpp
+++ b/libraries/Netdump/src/NetdumpIP.cpp
@@ -23,6 +23,7 @@
 
 namespace NetCapture
 {
+
 NetdumpIP::NetdumpIP()
 {
 }
@@ -36,7 +37,7 @@ NetdumpIP::NetdumpIP(uint8_t first_octet, uint8_t second_octet, uint8_t third_oc
     (*this)[3] = fourth_octet;
 }
 
-NetdumpIP::NetdumpIP(const uint8_t* address, bool v4)
+NetdumpIP::NetdumpIP(const uint8_t *address, bool v4)
 {
     uint8_t cnt;
     if (v4)
@@ -87,7 +88,7 @@ NetdumpIP::NetdumpIP(const String& ip)
     }
 }
 
-bool NetdumpIP::fromString(const char* address)
+bool NetdumpIP::fromString(const char *address)
 {
     if (!fromString4(address))
     {
@@ -96,12 +97,12 @@ bool NetdumpIP::fromString(const char* address)
     return true;
 }
 
-bool NetdumpIP::fromString4(const char* address)
+bool NetdumpIP::fromString4(const char *address)
 {
     // TODO: (IPv4) add support for "a", "a.b", "a.b.c" formats
 
-    uint16_t acc  = 0;  // Accumulator
-    uint8_t  dots = 0;
+    uint16_t acc = 0; // Accumulator
+    uint8_t dots = 0;
 
     while (*address)
     {
@@ -123,7 +124,7 @@ bool NetdumpIP::fromString4(const char* address)
                 return false;
             }
             (*this)[dots++] = acc;
-            acc             = 0;
+            acc = 0;
         }
         else
         {
@@ -143,12 +144,12 @@ bool NetdumpIP::fromString4(const char* address)
     return true;
 }
 
-bool NetdumpIP::fromString6(const char* address)
+bool NetdumpIP::fromString6(const char *address)
 {
     // TODO: test test test
 
-    uint32_t acc  = 0;  // Accumulator
-    int      dots = 0, doubledots = -1;
+    uint32_t acc = 0; // Accumulator
+    int dots = 0, doubledots = -1;
 
     while (*address)
     {
@@ -161,7 +162,7 @@ bool NetdumpIP::fromString6(const char* address)
             }
             acc = acc * 16 + (c - '0');
             if (acc > 0xffff)
-            // Value out of range
+                // Value out of range
             {
                 return false;
             }
@@ -171,7 +172,7 @@ bool NetdumpIP::fromString6(const char* address)
             if (*address == ':')
             {
                 if (doubledots >= 0)
-                // :: allowed once
+                    // :: allowed once
                 {
                     return false;
                 }
@@ -180,22 +181,22 @@ bool NetdumpIP::fromString6(const char* address)
                 address++;
             }
             if (dots == 7)
-            // too many separators
+                // too many separators
             {
                 return false;
             }
             reinterpret_cast<uint16_t*>(rawip)[dots++] = PP_HTONS(acc);
-            acc                                        = 0;
+            acc = 0;
         }
         else
-        // Invalid char
+            // Invalid char
         {
             return false;
         }
     }
 
     if (doubledots == -1 && dots != 7)
-    // Too few separators
+        // Too few separators
     {
         return false;
     }
@@ -222,11 +223,12 @@ String NetdumpIP::toString()
     StreamString sstr;
     if (isV6())
     {
-        sstr.reserve(40);  // 8 shorts x 4 chars each + 7 colons + nullterm
+        sstr.reserve(40); // 8 shorts x 4 chars each + 7 colons + nullterm
+
     }
     else
     {
-        sstr.reserve(16);  // 4 bytes with 3 chars max + 3 dots + nullterm, or '(IP unset)'
+        sstr.reserve(16); // 4 bytes with 3 chars max + 3 dots + nullterm, or '(IP unset)'
     }
     printTo(sstr);
     return sstr;
@@ -251,7 +253,7 @@ size_t NetdumpIP::printTo(Print& p)
             {
                 n += p.printf_P(PSTR("%x"), bit);
                 if (count0 > 0)
-                // no more hiding 0
+                    // no more hiding 0
                 {
                     count0 = -8;
                 }
@@ -278,7 +280,7 @@ size_t NetdumpIP::printTo(Print& p)
     return n;
 }
 
-bool NetdumpIP::compareRaw(IPversion v, const uint8_t* a, const uint8_t* b) const
+bool NetdumpIP::compareRaw(IPversion v, const uint8_t* a,  const uint8_t* b) const
 {
     for (int i = 0; i < (v == IPversion::IPV4 ? 4 : 16); i++)
     {
@@ -294,7 +296,7 @@ bool NetdumpIP::compareIP(const IPAddress& ip) const
 {
     switch (ipv)
     {
-    case IPversion::UNSET:
+    case IPversion::UNSET :
         if (ip.isSet())
         {
             return false;
@@ -304,7 +306,7 @@ bool NetdumpIP::compareIP(const IPAddress& ip) const
             return true;
         }
         break;
-    case IPversion::IPV4:
+    case IPversion::IPV4 :
         if (ip.isV6() || !ip.isSet())
         {
             return false;
@@ -314,7 +316,7 @@ bool NetdumpIP::compareIP(const IPAddress& ip) const
             return compareRaw(IPversion::IPV4, rawip, reinterpret_cast<const uint8_t*>(&ip.v4()));
         }
         break;
-    case IPversion::IPV6:
+    case IPversion::IPV6 :
         if (ip.isV4() || !ip.isSet())
         {
             return false;
@@ -324,7 +326,7 @@ bool NetdumpIP::compareIP(const IPAddress& ip) const
             return compareRaw(IPversion::IPV6, rawip, reinterpret_cast<const uint8_t*>(ip.raw6()));
         }
         break;
-    default:
+    default :
         return false;
         break;
     }
@@ -334,7 +336,7 @@ bool NetdumpIP::compareIP(const NetdumpIP& nip) const
 {
     switch (ipv)
     {
-    case IPversion::UNSET:
+    case IPversion::UNSET :
         if (nip.isSet())
         {
             return false;
@@ -344,7 +346,7 @@ bool NetdumpIP::compareIP(const NetdumpIP& nip) const
             return true;
         }
         break;
-    case IPversion::IPV4:
+    case IPversion::IPV4 :
         if (nip.isV6() || !nip.isSet())
         {
             return false;
@@ -354,7 +356,7 @@ bool NetdumpIP::compareIP(const NetdumpIP& nip) const
             return compareRaw(IPversion::IPV4, rawip, nip.rawip);
         }
         break;
-    case IPversion::IPV6:
+    case IPversion::IPV6 :
         if (nip.isV4() || !nip.isSet())
         {
             return false;
@@ -364,10 +366,10 @@ bool NetdumpIP::compareIP(const NetdumpIP& nip) const
             return compareRaw(IPversion::IPV6, rawip, nip.rawip);
         }
         break;
-    default:
+    default :
         return false;
         break;
     }
 }
 
-}  // namespace NetCapture
+} // namespace NetCapture
diff --git a/libraries/Netdump/src/NetdumpIP.h b/libraries/Netdump/src/NetdumpIP.h
index 41b1677869..8a450c374a 100644
--- a/libraries/Netdump/src/NetdumpIP.h
+++ b/libraries/Netdump/src/NetdumpIP.h
@@ -15,13 +15,14 @@
 
 namespace NetCapture
 {
+
 class NetdumpIP
 {
 public:
     NetdumpIP();
 
     NetdumpIP(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet);
-    NetdumpIP(const uint8_t* address, bool V4 = true);
+    NetdumpIP(const uint8_t *address, bool V4 = true);
     NetdumpIP(const IPAddress& ip);
     NetdumpIP(const String& ip);
 
@@ -30,20 +31,15 @@ class NetdumpIP
         return rawip[index];
     }
 
-    bool fromString(const char* address);
+    bool fromString(const char *address);
 
     String toString();
 
 private:
-    enum class IPversion
-    {
-        UNSET,
-        IPV4,
-        IPV6
-    };
+    enum class IPversion {UNSET, IPV4, IPV6};
     IPversion ipv = IPversion::UNSET;
 
-    uint8_t rawip[16] = { 0 };
+    uint8_t rawip[16] = {0};
 
     void setV4()
     {
@@ -74,15 +70,14 @@ class NetdumpIP
         return (ipv != IPversion::UNSET);
     };
 
-    bool compareRaw(IPversion v, const uint8_t* a, const uint8_t* b) const;
+    bool compareRaw(IPversion v, const uint8_t* a,  const uint8_t* b) const;
     bool compareIP(const IPAddress& ip) const;
     bool compareIP(const NetdumpIP& nip) const;
 
-    bool fromString4(const char* address);
-    bool fromString6(const char* address);
+    bool fromString4(const char *address);
+    bool fromString6(const char *address);
 
     size_t printTo(Print& p);
-
 public:
     bool operator==(const IPAddress& addr) const
     {
@@ -100,8 +95,9 @@ class NetdumpIP
     {
         return !compareIP(addr);
     };
+
 };
 
-}  // namespace NetCapture
+} // namespace NetCapture
 
 #endif /* LIBRARIES_ESPGOODIES_HR_SRC_NETDUMP_NETDUMPIP_H_ */
diff --git a/libraries/Netdump/src/NetdumpPacket.cpp b/libraries/Netdump/src/NetdumpPacket.cpp
index e3243cc887..bb4e09920c 100644
--- a/libraries/Netdump/src/NetdumpPacket.cpp
+++ b/libraries/Netdump/src/NetdumpPacket.cpp
@@ -24,6 +24,7 @@
 
 namespace NetCapture
 {
+
 void Packet::printDetail(Print& out, const String& indent, const char* data, size_t size, PacketDetail pd) const
 {
     if (pd == PacketDetail::NONE)
@@ -158,17 +159,16 @@ void Packet::MACtoString(int dataIdx, StreamString& sstr) const
             sstr.print(':');
         }
     }
+
 }
 
 void Packet::ARPtoString(PacketDetail netdumpDetail, StreamString& sstr) const
 {
     switch (getARPType())
     {
-    case 1:
-        sstr.printf_P(PSTR("who has %s tell %s"), getIP(ETH_HDR_LEN + 24).toString().c_str(), getIP(ETH_HDR_LEN + 14).toString().c_str());
+    case 1 : sstr.printf_P(PSTR("who has %s tell %s"), getIP(ETH_HDR_LEN + 24).toString().c_str(), getIP(ETH_HDR_LEN + 14).toString().c_str());
         break;
-    case 2:
-        sstr.printf_P(PSTR("%s is at "), getIP(ETH_HDR_LEN + 14).toString().c_str());
+    case 2 : sstr.printf_P(PSTR("%s is at "), getIP(ETH_HDR_LEN + 14).toString().c_str());
         MACtoString(ETH_HDR_LEN + 8, sstr);
         break;
     }
@@ -217,7 +217,7 @@ void Packet::TCPtoString(PacketDetail netdumpDetail, StreamString& sstr) const
     sstr.printf_P(PSTR("%d:%d "), getSrcPort(), getDstPort());
     uint16_t flags = getTcpFlags();
     sstr.print('[');
-    const char chars[] = "FSRPAUECN";
+    const char chars [] = "FSRPAUECN";
     for (uint8_t i = 0; i < sizeof chars; i++)
         if (flags & (1 << i))
         {
@@ -237,36 +237,20 @@ void Packet::ICMPtoString(PacketDetail, StreamString& sstr) const
     {
         switch (getIcmpType())
         {
-        case 0:
-            sstr.printf_P(PSTR("ping reply"));
-            break;
-        case 8:
-            sstr.printf_P(PSTR("ping request"));
-            break;
-        default:
-            sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType());
-            break;
+        case 0 : sstr.printf_P(PSTR("ping reply")); break;
+        case 8 : sstr.printf_P(PSTR("ping request")); break;
+        default: sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType()); break;
         }
     }
     if (isIPv6())
     {
         switch (getIcmpType())
         {
-        case 129:
-            sstr.printf_P(PSTR("ping reply"));
-            break;
-        case 128:
-            sstr.printf_P(PSTR("ping request"));
-            break;
-        case 135:
-            sstr.printf_P(PSTR("Neighbour solicitation"));
-            break;
-        case 136:
-            sstr.printf_P(PSTR("Neighbour advertisement"));
-            break;
-        default:
-            sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType());
-            break;
+        case 129 : sstr.printf_P(PSTR("ping reply")); break;
+        case 128 : sstr.printf_P(PSTR("ping request")); break;
+        case 135 : sstr.printf_P(PSTR("Neighbour solicitation")); break;
+        case 136 : sstr.printf_P(PSTR("Neighbour advertisement")); break;
+        default: sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType()); break;
         }
     }
     sstr.printf_P(PSTR("\r\n"));
@@ -276,42 +260,18 @@ void Packet::IGMPtoString(PacketDetail, StreamString& sstr) const
 {
     switch (getIgmpType())
     {
-    case 1:
-        sstr.printf_P(PSTR("Create Group Request"));
-        break;
-    case 2:
-        sstr.printf_P(PSTR("Create Group Reply"));
-        break;
-    case 3:
-        sstr.printf_P(PSTR("Join Group Request"));
-        break;
-    case 4:
-        sstr.printf_P(PSTR("Join Group Reply"));
-        break;
-    case 5:
-        sstr.printf_P(PSTR("Leave Group Request"));
-        break;
-    case 6:
-        sstr.printf_P(PSTR("Leave Group Reply"));
-        break;
-    case 7:
-        sstr.printf_P(PSTR("Confirm Group Request"));
-        break;
-    case 8:
-        sstr.printf_P(PSTR("Confirm Group Reply"));
-        break;
-    case 0x11:
-        sstr.printf_P(PSTR("Group Membership Query"));
-        break;
-    case 0x12:
-        sstr.printf_P(PSTR("IGMPv1 Membership Report"));
-        break;
-    case 0x22:
-        sstr.printf_P(PSTR("IGMPv3 Membership Report"));
-        break;
-    default:
-        sstr.printf_P(PSTR("type(0x%02x)"), getIgmpType());
-        break;
+    case 1 : sstr.printf_P(PSTR("Create Group Request")); break;
+    case 2 : sstr.printf_P(PSTR("Create Group Reply")); break;
+    case 3 : sstr.printf_P(PSTR("Join Group Request")); break;
+    case 4 : sstr.printf_P(PSTR("Join Group Reply")); break;
+    case 5 : sstr.printf_P(PSTR("Leave Group Request")); break;
+    case 6 : sstr.printf_P(PSTR("Leave Group Reply")); break;
+    case 7 : sstr.printf_P(PSTR("Confirm Group Request")); break;
+    case 8 : sstr.printf_P(PSTR("Confirm Group Reply")); break;
+    case 0x11 : sstr.printf_P(PSTR("Group Membership Query")); break;
+    case 0x12 : sstr.printf_P(PSTR("IGMPv1 Membership Report")); break;
+    case 0x22 : sstr.printf_P(PSTR("IGMPv3 Membership Report")); break;
+    default: sstr.printf_P(PSTR("type(0x%02x)"), getIgmpType()); break;
     }
     sstr.printf_P(PSTR("\r\n"));
 }
@@ -338,6 +298,7 @@ const String Packet::toString() const
     return toString(PacketDetail::NONE);
 }
 
+
 const String Packet::toString(PacketDetail netdumpDetail) const
 {
     StreamString sstr;
@@ -359,56 +320,56 @@ const String Packet::toString(PacketDetail netdumpDetail) const
 
     switch (thisPacketType)
     {
-    case PacketType::ARP:
+    case PacketType::ARP :
     {
         ARPtoString(netdumpDetail, sstr);
         break;
     }
-    case PacketType::MDNS:
-    case PacketType::DNS:
+    case PacketType::MDNS :
+    case PacketType::DNS :
     {
         DNStoString(netdumpDetail, sstr);
         break;
     }
-    case PacketType::SSDP:
-    case PacketType::DHCP:
-    case PacketType::WSDD:
-    case PacketType::NETBIOS:
-    case PacketType::SMB:
-    case PacketType::OTA:
-    case PacketType::UDP:
+    case PacketType::SSDP :
+    case PacketType::DHCP :
+    case PacketType::WSDD :
+    case PacketType::NETBIOS :
+    case PacketType::SMB :
+    case PacketType::OTA :
+    case PacketType::UDP :
     {
         UDPtoString(netdumpDetail, sstr);
         break;
     }
-    case PacketType::TCP:
-    case PacketType::HTTP:
+    case PacketType::TCP :
+    case PacketType::HTTP :
     {
         TCPtoString(netdumpDetail, sstr);
         break;
     }
-    case PacketType::ICMP:
+    case PacketType::ICMP :
     {
         ICMPtoString(netdumpDetail, sstr);
         break;
     }
-    case PacketType::IGMP:
+    case PacketType::IGMP :
     {
         IGMPtoString(netdumpDetail, sstr);
         break;
     }
-    case PacketType::IPv4:
-    case PacketType::IPv6:
+    case PacketType::IPv4 :
+    case PacketType::IPv6 :
     {
         IPtoString(netdumpDetail, sstr);
         break;
     }
-    case PacketType::UKNW:
+    case PacketType::UKNW :
     {
         UKNWtoString(netdumpDetail, sstr);
         break;
     }
-    default:
+    default :
     {
         sstr.printf_P(PSTR("Non identified packet\r\n"));
         break;
@@ -417,4 +378,4 @@ const String Packet::toString(PacketDetail netdumpDetail) const
     return sstr;
 }
 
-}  // namespace NetCapture
+} // namespace NetCapture
diff --git a/libraries/Netdump/src/NetdumpPacket.h b/libraries/Netdump/src/NetdumpPacket.h
index 1c11f4ee84..a898ef230f 100644
--- a/libraries/Netdump/src/NetdumpPacket.h
+++ b/libraries/Netdump/src/NetdumpPacket.h
@@ -31,13 +31,14 @@
 
 namespace NetCapture
 {
+
 int constexpr ETH_HDR_LEN = 14;
 
 class Packet
 {
 public:
-    Packet(unsigned long msec, int n, const char* d, size_t l, int o, int s) :
-        packetTime(msec), netif_idx(n), data(d), packetLength(l), out(o), success(s)
+    Packet(unsigned long msec, int n, const char* d, size_t l, int o, int s)
+        : packetTime(msec), netif_idx(n), data(d), packetLength(l), out(o), success(s)
     {
         setPacketTypes();
     };
@@ -74,7 +75,7 @@ class Packet
     {
         return ntoh16(idx + 2) | (((uint32_t)ntoh16(idx)) << 16);
     };
-    uint8_t byteData(uint16_t idx) const
+    uint8_t  byteData(uint16_t idx) const
     {
         return data[idx];
     }
@@ -86,17 +87,17 @@ class Packet
     {
         return ntoh16(12);
     };
-    uint8_t ipType() const
+    uint8_t  ipType() const
     {
         return isIP() ? isIPv4() ? data[ETH_HDR_LEN + 9] : data[ETH_HDR_LEN + 6] : 0;
     };
     uint16_t getIpHdrLen() const
     {
-        return isIPv4() ? (((unsigned char)data[ETH_HDR_LEN]) & 0x0f) << 2 : 40;  // IPv6 is fixed length
+        return isIPv4() ? (((unsigned char)data[ETH_HDR_LEN]) & 0x0f) << 2 : 40 ;   // IPv6 is fixed length
     }
     uint16_t getIpTotalLen() const
     {
-        return isIP() ? isIPv4() ? ntoh16(ETH_HDR_LEN + 2) : (packetLength - ETH_HDR_LEN) : 0;
+        return isIP() ? isIPv4() ? ntoh16(ETH_HDR_LEN + 2) : (packetLength - ETH_HDR_LEN)   :  0;
     }
     uint32_t getTcpSeq() const
     {
@@ -114,20 +115,20 @@ class Packet
     {
         return isTCP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 14) : 0;
     }
-    uint8_t getTcpHdrLen() const
+    uint8_t  getTcpHdrLen() const
     {
         return isTCP() ? (data[ETH_HDR_LEN + getIpHdrLen() + 12] >> 4) * 4 : 0;
-    };  //Header len is in multiple of 4 bytes
+    };//Header len is in multiple of 4 bytes
     uint16_t getTcpLen() const
     {
-        return isTCP() ? getIpTotalLen() - getIpHdrLen() - getTcpHdrLen() : 0;
+        return isTCP() ? getIpTotalLen() - getIpHdrLen() - getTcpHdrLen() : 0 ;
     };
 
-    uint8_t getIcmpType() const
+    uint8_t  getIcmpType() const
     {
         return isICMP() ? data[ETH_HDR_LEN + getIpHdrLen() + 0] : 0;
     }
-    uint8_t getIgmpType() const
+    uint8_t  getIgmpType() const
     {
         return isIGMP() ? data[ETH_HDR_LEN + getIpHdrLen() + 0] : 0;
     }
@@ -135,11 +136,11 @@ class Packet
     {
         return isARP() ? data[ETH_HDR_LEN + 7] : 0;
     }
-    bool is_ARP_who() const
+    bool    is_ARP_who() const
     {
         return (getARPType() == 1);
     }
-    bool is_ARP_is() const
+    bool    is_ARP_is() const
     {
         return (getARPType() == 2);
     }
@@ -243,7 +244,7 @@ class Packet
         return ip;
     };
 
-    bool hasIP(NetdumpIP ip) const
+    bool      hasIP(NetdumpIP ip) const
     {
         return (isIP() && ((ip == sourceIP()) || (ip == destIP())));
     }
@@ -269,19 +270,21 @@ class Packet
     {
         return isIP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 2) : 0;
     }
-    bool hasPort(uint16_t p) const
+    bool     hasPort(uint16_t p) const
     {
         return (isIP() && ((getSrcPort() == p) || (getDstPort() == p)));
     }
 
     const String toString() const;
     const String toString(PacketDetail netdumpDetail) const;
-    void         printDetail(Print& out, const String& indent, const char* data, size_t size, PacketDetail pd) const;
+    void printDetail(Print& out, const String& indent, const char* data, size_t size, PacketDetail pd) const;
 
-    const PacketType               packetType() const;
+    const PacketType packetType() const;
     const std::vector<PacketType>& allPacketTypes() const;
 
+
 private:
+
     void setPacketType(PacketType);
     void setPacketTypes();
 
@@ -295,16 +298,17 @@ class Packet
     void IPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
     void UKNWtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
 
-    time_t                  packetTime;
-    int                     netif_idx;
-    const char*             data;
-    size_t                  packetLength;
-    int                     out;
-    int                     success;
-    PacketType              thisPacketType;
+
+    time_t packetTime;
+    int netif_idx;
+    const char* data;
+    size_t packetLength;
+    int out;
+    int success;
+    PacketType thisPacketType;
     std::vector<PacketType> thisAllPacketTypes;
 };
 
-}  // namespace NetCapture
+} // namespace NetCapture
 
 #endif /* __NETDUMP_PACKET_H */
diff --git a/libraries/Netdump/src/PacketType.cpp b/libraries/Netdump/src/PacketType.cpp
index b2d6f84e75..565aa55f0a 100644
--- a/libraries/Netdump/src/PacketType.cpp
+++ b/libraries/Netdump/src/PacketType.cpp
@@ -9,6 +9,7 @@
 
 namespace NetCapture
 {
+
 PacketType::PacketType()
 {
 }
@@ -17,44 +18,25 @@ String PacketType::toString() const
 {
     switch (ptype)
     {
-    case PType::ARP:
-        return PSTR("ARP");
-    case PType::IP:
-        return PSTR("IP");
-    case PType::UDP:
-        return PSTR("UDP");
-    case PType::MDNS:
-        return PSTR("MDNS");
-    case PType::DNS:
-        return PSTR("DNS");
-    case PType::SSDP:
-        return PSTR("SSDP");
-    case PType::DHCP:
-        return PSTR("DHCP");
-    case PType::WSDD:
-        return PSTR("WSDD");
-    case PType::NETBIOS:
-        return PSTR("NBIO");
-    case PType::SMB:
-        return PSTR("SMB");
-    case PType::OTA:
-        return PSTR("OTA");
-    case PType::TCP:
-        return PSTR("TCP");
-    case PType::HTTP:
-        return PSTR("HTTP");
-    case PType::ICMP:
-        return PSTR("ICMP");
-    case PType::IGMP:
-        return PSTR("IGMP");
-    case PType::IPv4:
-        return PSTR("IPv4");
-    case PType::IPv6:
-        return PSTR("IPv6");
-    case PType::UKNW:
-        return PSTR("UKNW");
-    default:
-        return PSTR("ERR");
+    case PType::ARP :    return PSTR("ARP");
+    case PType::IP :     return PSTR("IP");
+    case PType::UDP :    return PSTR("UDP");
+    case PType::MDNS :   return PSTR("MDNS");
+    case PType::DNS :    return PSTR("DNS");
+    case PType::SSDP :   return PSTR("SSDP");
+    case PType::DHCP :   return PSTR("DHCP");
+    case PType::WSDD :   return PSTR("WSDD");
+    case PType::NETBIOS: return PSTR("NBIO");
+    case PType::SMB :    return PSTR("SMB");
+    case PType::OTA :    return PSTR("OTA");
+    case PType::TCP :    return PSTR("TCP");
+    case PType::HTTP :   return PSTR("HTTP");
+    case PType::ICMP :   return PSTR("ICMP");
+    case PType::IGMP :   return PSTR("IGMP");
+    case PType::IPv4:    return PSTR("IPv4");
+    case PType::IPv6:    return PSTR("IPv6");
+    case PType::UKNW :   return PSTR("UKNW");
+    default :            return PSTR("ERR");
     };
 }
 
diff --git a/libraries/Netdump/src/PacketType.h b/libraries/Netdump/src/PacketType.h
index 28d96ae7bc..8f4aa5ce79 100644
--- a/libraries/Netdump/src/PacketType.h
+++ b/libraries/Netdump/src/PacketType.h
@@ -11,9 +11,11 @@
 
 namespace NetCapture
 {
+
 class PacketType
 {
 public:
+
     enum PType : int
     {
         ARP,
@@ -37,8 +39,7 @@ class PacketType
     };
 
     PacketType();
-    PacketType(PType pt) :
-        ptype(pt) {};
+    PacketType(PType pt) : ptype(pt) {};
 
     operator PType() const
     {
diff --git a/libraries/SD/examples/DumpFile/DumpFile.ino b/libraries/SD/examples/DumpFile/DumpFile.ino
index 038cfc1c01..3574652890 100644
--- a/libraries/SD/examples/DumpFile/DumpFile.ino
+++ b/libraries/SD/examples/DumpFile/DumpFile.ino
@@ -58,3 +58,4 @@ void setup() {
 
 void loop() {
 }
+
diff --git a/libraries/SD/examples/listfiles/listfiles.ino b/libraries/SD/examples/listfiles/listfiles.ino
index 9ce85c26ae..55478d7080 100644
--- a/libraries/SD/examples/listfiles/listfiles.ino
+++ b/libraries/SD/examples/listfiles/listfiles.ino
@@ -51,8 +51,9 @@ void loop() {
 
 void printDirectory(File dir, int numTabs) {
   while (true) {
-    File entry = dir.openNextFile();
-    if (!entry) {
+
+    File entry =  dir.openNextFile();
+    if (! entry) {
       // no more files
       break;
     }
@@ -67,9 +68,9 @@ void printDirectory(File dir, int numTabs) {
       // files have sizes, directories do not
       Serial.print("\t\t");
       Serial.print(entry.size(), DEC);
-      time_t     cr       = entry.getCreationTime();
-      time_t     lw       = entry.getLastWrite();
-      struct tm* tmstruct = localtime(&cr);
+      time_t cr = entry.getCreationTime();
+      time_t lw = entry.getLastWrite();
+      struct tm * tmstruct = localtime(&cr);
       Serial.printf("\tCREATION: %d-%02d-%02d %02d:%02d:%02d", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
       tmstruct = localtime(&lw);
       Serial.printf("\tLAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
diff --git a/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino b/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
index 93ea348cc6..528e52ed81 100644
--- a/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
+++ b/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
@@ -18,73 +18,72 @@
 
 class ESPMaster {
   private:
-  uint8_t _ss_pin;
+    uint8_t _ss_pin;
 
   public:
-  ESPMaster(uint8_t pin) :
-      _ss_pin(pin) { }
-  void begin() {
-    pinMode(_ss_pin, OUTPUT);
-    digitalWrite(_ss_pin, HIGH);
-  }
-
-  uint32_t readStatus() {
-    digitalWrite(_ss_pin, LOW);
-    SPI.transfer(0x04);
-    uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
-    digitalWrite(_ss_pin, HIGH);
-    return status;
-  }
+    ESPMaster(uint8_t pin): _ss_pin(pin) {}
+    void begin() {
+      pinMode(_ss_pin, OUTPUT);
+      digitalWrite(_ss_pin, HIGH);
+    }
 
-  void writeStatus(uint32_t status) {
-    digitalWrite(_ss_pin, LOW);
-    SPI.transfer(0x01);
-    SPI.transfer(status & 0xFF);
-    SPI.transfer((status >> 8) & 0xFF);
-    SPI.transfer((status >> 16) & 0xFF);
-    SPI.transfer((status >> 24) & 0xFF);
-    digitalWrite(_ss_pin, HIGH);
-  }
+    uint32_t readStatus() {
+      digitalWrite(_ss_pin, LOW);
+      SPI.transfer(0x04);
+      uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
+      digitalWrite(_ss_pin, HIGH);
+      return status;
+    }
 
-  void readData(uint8_t* data) {
-    digitalWrite(_ss_pin, LOW);
-    SPI.transfer(0x03);
-    SPI.transfer(0x00);
-    for (uint8_t i = 0; i < 32; i++) {
-      data[i] = SPI.transfer(0);
+    void writeStatus(uint32_t status) {
+      digitalWrite(_ss_pin, LOW);
+      SPI.transfer(0x01);
+      SPI.transfer(status & 0xFF);
+      SPI.transfer((status >> 8) & 0xFF);
+      SPI.transfer((status >> 16) & 0xFF);
+      SPI.transfer((status >> 24) & 0xFF);
+      digitalWrite(_ss_pin, HIGH);
     }
-    digitalWrite(_ss_pin, HIGH);
-  }
 
-  void writeData(uint8_t* data, size_t len) {
-    uint8_t i = 0;
-    digitalWrite(_ss_pin, LOW);
-    SPI.transfer(0x02);
-    SPI.transfer(0x00);
-    while (len-- && i < 32) {
-      SPI.transfer(data[i++]);
+    void readData(uint8_t * data) {
+      digitalWrite(_ss_pin, LOW);
+      SPI.transfer(0x03);
+      SPI.transfer(0x00);
+      for (uint8_t i = 0; i < 32; i++) {
+        data[i] = SPI.transfer(0);
+      }
+      digitalWrite(_ss_pin, HIGH);
     }
-    while (i++ < 32) {
-      SPI.transfer(0);
+
+    void writeData(uint8_t * data, size_t len) {
+      uint8_t i = 0;
+      digitalWrite(_ss_pin, LOW);
+      SPI.transfer(0x02);
+      SPI.transfer(0x00);
+      while (len-- && i < 32) {
+        SPI.transfer(data[i++]);
+      }
+      while (i++ < 32) {
+        SPI.transfer(0);
+      }
+      digitalWrite(_ss_pin, HIGH);
     }
-    digitalWrite(_ss_pin, HIGH);
-  }
 
-  String readData() {
-    char data[33];
-    data[32] = 0;
-    readData((uint8_t*)data);
-    return String(data);
-  }
+    String readData() {
+      char data[33];
+      data[32] = 0;
+      readData((uint8_t *)data);
+      return String(data);
+    }
 
-  void writeData(const char* data) {
-    writeData((uint8_t*)data, strlen(data));
-  }
+    void writeData(const char * data) {
+      writeData((uint8_t *)data, strlen(data));
+    }
 };
 
 ESPMaster esp(SS);
 
-void send(const char* message) {
+void send(const char * message) {
   Serial.print("Master: ");
   Serial.println(message);
   esp.writeData(message);
diff --git a/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino b/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
index 0da735fc74..04c23c4502 100644
--- a/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
+++ b/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
@@ -19,78 +19,76 @@
 
 class ESPSafeMaster {
   private:
-  uint8_t _ss_pin;
-  void    _pulseSS() {
-    digitalWrite(_ss_pin, HIGH);
-    delayMicroseconds(5);
-    digitalWrite(_ss_pin, LOW);
-  }
-
+    uint8_t _ss_pin;
+    void _pulseSS() {
+      digitalWrite(_ss_pin, HIGH);
+      delayMicroseconds(5);
+      digitalWrite(_ss_pin, LOW);
+    }
   public:
-  ESPSafeMaster(uint8_t pin) :
-      _ss_pin(pin) { }
-  void begin() {
-    pinMode(_ss_pin, OUTPUT);
-    _pulseSS();
-  }
-
-  uint32_t readStatus() {
-    _pulseSS();
-    SPI.transfer(0x04);
-    uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
-    _pulseSS();
-    return status;
-  }
+    ESPSafeMaster(uint8_t pin): _ss_pin(pin) {}
+    void begin() {
+      pinMode(_ss_pin, OUTPUT);
+      _pulseSS();
+    }
 
-  void writeStatus(uint32_t status) {
-    _pulseSS();
-    SPI.transfer(0x01);
-    SPI.transfer(status & 0xFF);
-    SPI.transfer((status >> 8) & 0xFF);
-    SPI.transfer((status >> 16) & 0xFF);
-    SPI.transfer((status >> 24) & 0xFF);
-    _pulseSS();
-  }
+    uint32_t readStatus() {
+      _pulseSS();
+      SPI.transfer(0x04);
+      uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
+      _pulseSS();
+      return status;
+    }
 
-  void readData(uint8_t* data) {
-    _pulseSS();
-    SPI.transfer(0x03);
-    SPI.transfer(0x00);
-    for (uint8_t i = 0; i < 32; i++) {
-      data[i] = SPI.transfer(0);
+    void writeStatus(uint32_t status) {
+      _pulseSS();
+      SPI.transfer(0x01);
+      SPI.transfer(status & 0xFF);
+      SPI.transfer((status >> 8) & 0xFF);
+      SPI.transfer((status >> 16) & 0xFF);
+      SPI.transfer((status >> 24) & 0xFF);
+      _pulseSS();
     }
-    _pulseSS();
-  }
 
-  void writeData(uint8_t* data, size_t len) {
-    uint8_t i = 0;
-    _pulseSS();
-    SPI.transfer(0x02);
-    SPI.transfer(0x00);
-    while (len-- && i < 32) {
-      SPI.transfer(data[i++]);
+    void readData(uint8_t * data) {
+      _pulseSS();
+      SPI.transfer(0x03);
+      SPI.transfer(0x00);
+      for (uint8_t i = 0; i < 32; i++) {
+        data[i] = SPI.transfer(0);
+      }
+      _pulseSS();
     }
-    while (i++ < 32) {
-      SPI.transfer(0);
+
+    void writeData(uint8_t * data, size_t len) {
+      uint8_t i = 0;
+      _pulseSS();
+      SPI.transfer(0x02);
+      SPI.transfer(0x00);
+      while (len-- && i < 32) {
+        SPI.transfer(data[i++]);
+      }
+      while (i++ < 32) {
+        SPI.transfer(0);
+      }
+      _pulseSS();
     }
-    _pulseSS();
-  }
 
-  String readData() {
-    char data[33];
-    data[32] = 0;
-    readData((uint8_t*)data);
-    return String(data);
-  }
+    String readData() {
+      char data[33];
+      data[32] = 0;
+      readData((uint8_t *)data);
+      return String(data);
+    }
 
-  void writeData(const char* data) {
-    writeData((uint8_t*)data, strlen(data));
-  }
+    void writeData(const char * data) {
+      writeData((uint8_t *)data, strlen(data));
+    }
 };
 
 ESPSafeMaster esp(SS);
 
-void send(const char* message) {
+void send(const char * message) {
   Serial.print("Master: ");
   Serial.println(message);
   esp.writeData(message);
diff --git a/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino b/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
index 89fe7d2dd4..0be83fd298 100644
--- a/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
+++ b/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
@@ -24,9 +24,9 @@ void setup() {
   // data has been received from the master. Beware that len is always 32
   // and the buffer is autofilled with zeroes if data is less than 32 bytes long
   // It's up to the user to implement protocol for handling data length
-  SPISlave.onData([](uint8_t* data, size_t len) {
-    String message = String((char*)data);
-    (void)len;
+  SPISlave.onData([](uint8_t * data, size_t len) {
+    String message = String((char *)data);
+    (void) len;
     if (message.equals("Hello Slave!")) {
       SPISlave.setData("Hello Master!");
     } else if (message.equals("Are you alive?")) {
@@ -36,23 +36,27 @@ void setup() {
     } else {
       SPISlave.setData("Say what?");
     }
-    Serial.printf("Question: %s\n", (char*)data);
+    Serial.printf("Question: %s\n", (char *)data);
   });
 
   // The master has read out outgoing data buffer
   // that buffer can be set with SPISlave.setData
-  SPISlave.onDataSent([]() { Serial.println("Answer Sent"); });
+  SPISlave.onDataSent([]() {
+    Serial.println("Answer Sent");
+  });
 
   // status has been received from the master.
   // The status register is a special register that bot the slave and the master can write to and read from.
   // Can be used to exchange small data or status information
   SPISlave.onStatus([](uint32_t data) {
     Serial.printf("Status: %u\n", data);
-    SPISlave.setStatus(millis());  //set next status
+    SPISlave.setStatus(millis()); //set next status
   });
 
   // The master has read the status register
-  SPISlave.onStatusSent([]() { Serial.println("Status Sent"); });
+  SPISlave.onStatusSent([]() {
+    Serial.println("Status Sent");
+  });
 
   // Setup SPI Slave registers and pins
   SPISlave.begin();
@@ -65,4 +69,4 @@ void setup() {
   SPISlave.setData("Ask me a question!");
 }
 
-void loop() { }
+void loop() {}
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino b/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
index 29d7c48527..fbc22a861c 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
@@ -8,20 +8,21 @@
 #include <SPI.h>
 
 void setup() {
-  TFT_BL_ON;  //turn on the background light
+  TFT_BL_ON;                                          //turn on the background light
 
-  Tft.TFTinit();  //init TFT library
+  Tft.TFTinit();                                      //init TFT library
 
-  Tft.drawCircle(100, 100, 30, YELLOW);  //center: (100, 100), r = 30 ,color : YELLOW
+  Tft.drawCircle(100, 100, 30, YELLOW);               //center: (100, 100), r = 30 ,color : YELLOW
 
-  Tft.drawCircle(100, 200, 40, CYAN);  // center: (100, 200), r = 10 ,color : CYAN
+  Tft.drawCircle(100, 200, 40, CYAN);                 // center: (100, 200), r = 10 ,color : CYAN
 
-  Tft.fillCircle(200, 100, 30, RED);  //center: (200, 100), r = 30 ,color : RED
+  Tft.fillCircle(200, 100, 30, RED);                  //center: (200, 100), r = 30 ,color : RED
 
-  Tft.fillCircle(200, 200, 30, BLUE);  //center: (200, 200), r = 30 ,color : BLUE
+  Tft.fillCircle(200, 200, 30, BLUE);                 //center: (200, 200), r = 30 ,color : BLUE
 }
 
 void loop() {
+
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino b/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
index b2b6d3c293..a777044d3e 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
@@ -8,10 +8,10 @@
 #include <TFTv2.h>
 #include <SPI.h>
 void setup() {
-  TFT_BL_ON;      // turn on the background light
-  Tft.TFTinit();  //init TFT library
+  TFT_BL_ON;                                  // turn on the background light
+  Tft.TFTinit();                              //init TFT library
 
-  Tft.drawLine(0, 0, 239, 319, RED);  //start: (0, 0) end: (239, 319), color : RED
+  Tft.drawLine(0, 0, 239, 319, RED);          //start: (0, 0) end: (239, 319), color : RED
 
   Tft.drawVerticalLine(60, 100, 100, GREEN);  // Draw a vertical line
   // start: (60, 100) length: 100 color: green
@@ -21,6 +21,7 @@ void setup() {
 }
 
 void loop() {
+
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino b/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
index be303b6988..ed62233796 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
@@ -9,26 +9,28 @@
 #include <SPI.h>
 
 void setup() {
-  TFT_BL_ON;  // turn on the background light
+  TFT_BL_ON;                                      // turn on the background light
 
-  Tft.TFTinit();  // init TFT library
+  Tft.TFTinit();                                  // init TFT library
 
-  Tft.drawNumber(1024, 0, 0, 1, RED);  // draw a integer: 1024, Location: (0, 0),  size: 1, color: RED
+  Tft.drawNumber(1024, 0, 0, 1, RED);             // draw a integer: 1024, Location: (0, 0),  size: 1, color: RED
 
-  Tft.drawNumber(1024, 0, 20, 2, BLUE);  // draw a integer: 1024, Location: (0, 20), size: 2, color: BLUE
+  Tft.drawNumber(1024, 0, 20, 2, BLUE);           // draw a integer: 1024, Location: (0, 20), size: 2, color: BLUE
 
-  Tft.drawNumber(1024, 0, 50, 3, GREEN);  // draw a integer: 1024, Location: (0, 50), size: 3, color: GREEN
+  Tft.drawNumber(1024, 0, 50, 3, GREEN);          // draw a integer: 1024, Location: (0, 50), size: 3, color: GREEN
 
-  Tft.drawNumber(1024, 0, 90, 4, BLUE);  // draw a integer: 1024, Location: (0, 90), size:4, color: BLUE
+  Tft.drawNumber(1024, 0, 90, 4, BLUE);           // draw a integer: 1024, Location: (0, 90), size:4, color: BLUE
 
-  Tft.drawFloat(1.2345, 0, 150, 4, YELLOW);  // draw a float number: 1.2345, Location: (0, 150), size: 4, color: YELLOW
+  Tft.drawFloat(1.2345, 0, 150, 4, YELLOW);       // draw a float number: 1.2345, Location: (0, 150), size: 4, color: YELLOW
 
-  Tft.drawFloat(1.2345, 2, 0, 200, 4, BLUE);  // draw a float number: 1.2345: Location: (0, 200), size: 4, decimal: 2, color: BLUE
+  Tft.drawFloat(1.2345, 2, 0, 200, 4, BLUE);      // draw a float number: 1.2345: Location: (0, 200), size: 4, decimal: 2, color: BLUE
+
+  Tft.drawFloat(1.2345, 4, 0, 250, 4, RED);       // draw a float number: 1.2345 Location: (0, 250), size: 4, decimal: 4, color: RED
 
-  Tft.drawFloat(1.2345, 4, 0, 250, 4, RED);  // draw a float number: 1.2345 Location: (0, 250), size: 4, decimal: 4, color: RED
 }
 
 void loop() {
+
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino b/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
index fe61bae0af..a2d7af8709 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
@@ -17,6 +17,7 @@ void setup() {
 }
 
 void loop() {
+
 }
 /*********************************************************************************************************
   END FILE
diff --git a/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino b/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
index 41c5ed3306..dc13088b9f 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
@@ -4,15 +4,15 @@
 #include <TFTv2.h>
 #include <SPI.h>
 
-int          ColorPaletteHigh = 30;
-int          color            = WHITE;  //Paint brush color
-unsigned int colors[8]        = { BLACK, RED, GREEN, BLUE, CYAN, YELLOW, WHITE, GRAY1 };
+int ColorPaletteHigh = 30;
+int color = WHITE;  //Paint brush color
+unsigned int colors[8] = {BLACK, RED, GREEN, BLUE, CYAN, YELLOW, WHITE, GRAY1};
 
 // For better pressure precision, we need to know the resistance
 // between X+ and X- Use any multimeter to read it
 // The 2.8" TFT Touch shield has 300 ohms across the X plate
 
-TouchScreen ts = TouchScreen(XP, YP, XM, YM);  //init TouchScreen port pins
+TouchScreen ts = TouchScreen(XP, YP, XM, YM); //init TouchScreen port pins
 
 void setup() {
   Tft.TFTinit();  //init TFT library
diff --git a/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino b/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
index 185cd0c97a..6607a01cff 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
@@ -5,13 +5,13 @@
 #include <SPI.h>
 
 void setup() {
-  TFT_BL_ON;      // turn on the background light
-  Tft.TFTinit();  // init TFT library
+  TFT_BL_ON;                                          // turn on the background light
+  Tft.TFTinit();                                      // init TFT library
 }
 
 void loop() {
-  for (int r = 0; r < 115; r = r + 2) {           //set r : 0--115
-    Tft.drawCircle(119, 160, r, random(0xFFFF));  //draw circle, center:(119, 160), color: random
+  for (int r = 0; r < 115; r = r + 2) {               //set r : 0--115
+    Tft.drawCircle(119, 160, r, random(0xFFFF));    //draw circle, center:(119, 160), color: random
   }
   delay(10);
 }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/text/text.ino b/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
index 2d27e11185..03308f6891 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
@@ -11,20 +11,23 @@ void setup() {
   TFT_BL_ON;      // turn on the background light
   Tft.TFTinit();  // init TFT library
 
-  Tft.drawChar('S', 0, 0, 1, RED);  // draw char: 'S', (0, 0), size: 1, color: RED
+  Tft.drawChar('S', 0, 0, 1, RED);            // draw char: 'S', (0, 0), size: 1, color: RED
 
-  Tft.drawChar('E', 10, 10, 2, BLUE);  // draw char: 'E', (10, 10), size: 2, color: BLUE
+  Tft.drawChar('E', 10, 10, 2, BLUE);         // draw char: 'E', (10, 10), size: 2, color: BLUE
 
-  Tft.drawChar('E', 20, 40, 3, GREEN);  // draw char: 'E', (20, 40), size: 3, color: GREEN
+  Tft.drawChar('E', 20, 40, 3, GREEN);        // draw char: 'E', (20, 40), size: 3, color: GREEN
 
-  Tft.drawChar('E', 30, 80, 4, YELLOW);  // draw char: 'E', (30, 80), size: 4, color: YELLOW
+  Tft.drawChar('E', 30, 80, 4, YELLOW);       // draw char: 'E', (30, 80), size: 4, color: YELLOW
 
-  Tft.drawChar('D', 40, 120, 4, YELLOW);  // draw char: 'D', (40, 120), size: 4, color: YELLOW
+  Tft.drawChar('D', 40, 120, 4, YELLOW);      // draw char: 'D', (40, 120), size: 4, color: YELLOW
+
+  Tft.drawString("Hello", 0, 180, 3, CYAN);   // draw string: "hello", (0, 180), size: 3, color: CYAN
+
+  Tft.drawString("World!!", 60, 220, 4, WHITE); // draw string: "world!!", (80, 230), size: 4, color: WHITE
 
-  Tft.drawString("Hello", 0, 180, 3, CYAN);  // draw string: "hello", (0, 180), size: 3, color: CYAN
 
-  Tft.drawString("World!!", 60, 220, 4, WHITE);  // draw string: "world!!", (80, 230), size: 4, color: WHITE
 }
 
 void loop() {
+
 }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino b/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
index 70b2eef3fb..03423a4ef5 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
@@ -18,24 +18,23 @@
 
 #include "TFTv2.h"
 
-#define MAX_BMP 10       // bmp file num
-#define FILENAME_LEN 20  // max file name length
+#define MAX_BMP         10                      // bmp file num
+#define FILENAME_LEN    20                      // max file name length
 
-const int PIN_SD_CS = 4;  // pin of sd card
+const int PIN_SD_CS = 4;                        // pin of sd card
 
-const long __Gnbmp_height = 320;  // bmp height
-const long __Gnbmp_width  = 240;  // bmp width
+const long __Gnbmp_height = 320;                 // bmp height
+const long __Gnbmp_width  = 240;                 // bmp width
 
-long __Gnbmp_image_offset = 0;
-;
+long __Gnbmp_image_offset  = 0;;
 
-int  __Gnfile_num = 0;                      // num of file
-char __Gsbmp_files[MAX_BMP][FILENAME_LEN];  // file name
+int __Gnfile_num = 0;                           // num of file
+char __Gsbmp_files[MAX_BMP][FILENAME_LEN];      // file name
 
 File bmpFile;
 
 // if bmp file return 1, else return 0
-bool checkBMP(char* _name, char r_name[]) {
+bool checkBMP(char *_name, char r_name[]) {
   int len = 0;
 
   if (NULL == _name) {
@@ -56,28 +55,29 @@ bool checkBMP(char* _name, char r_name[]) {
   }
 
   // if xxx.bmp or xxx.BMP
-  if (r_name[len - 4] == '.'
-      && (r_name[len - 3] == 'b' || (r_name[len - 3] == 'B'))
-      && (r_name[len - 2] == 'm' || (r_name[len - 2] == 'M'))
+  if (r_name[len - 4] == '.' \
+      && (r_name[len - 3] == 'b' || (r_name[len - 3] == 'B')) \
+      && (r_name[len - 2] == 'm' || (r_name[len - 2] == 'M')) \
       && (r_name[len - 1] == 'p' || (r_name[len - 1] == 'P'))) {
     return true;
   }
 
   return false;
+
 }
 
 // search root to find bmp file
 void searchDirectory() {
-  File root = SD.open("/");  // root
+  File root = SD.open("/");                       // root
   while (true) {
-    File entry = root.openNextFile();
+    File entry =  root.openNextFile();
 
-    if (!entry) {
+    if (! entry) {
       break;
     }
 
     if (!entry.isDirectory()) {
-      char* ptmp = entry.name();
+      char *ptmp = entry.name();
 
       char __Name[20];
 
@@ -99,7 +99,9 @@ void searchDirectory() {
   }
 }
 
+
 void setup() {
+
   Serial.begin(115200);
 
   pinMode(PIN_SD_CS, OUTPUT);
@@ -112,8 +114,7 @@ void setup() {
 
   if (!SD.begin(PIN_SD_CS)) {
     Serial.println("failed!");
-    while (1)
-      ;  // init fail, die here
+    while (1);                              // init fail, die here
   }
 
   Serial.println("SD OK!");
@@ -149,15 +150,15 @@ void loop() {
       }
   */
 
+
   bmpFile = SD.open("pfvm_1.bmp");
 
-  if (!bmpFile) {
+  if (! bmpFile) {
     Serial.println("didn't find image");
-    while (1)
-      ;
+    while (1);
   }
 
-  if (!bmpReadHeader(bmpFile)) {
+  if (! bmpReadHeader(bmpFile)) {
     Serial.println("bad bmp");
     return;
   }
@@ -165,8 +166,7 @@ void loop() {
   bmpdraw(bmpFile, 0, 0, 1);
   bmpFile.close();
 
-  while (1)
-    ;
+  while (1);
 }
 
 /*********************************************/
@@ -176,15 +176,17 @@ void loop() {
 // more RAM but makes the drawing a little faster. 20 pixels' worth
 // is probably a good place
 
-#define BUFFPIXEL 60      // must be a divisor of 240
-#define BUFFPIXEL_X3 180  // BUFFPIXELx3
+#define BUFFPIXEL       60                          // must be a divisor of 240 
+#define BUFFPIXEL_X3    180                         // BUFFPIXELx3
 
-#define UP_DOWN 1
-#define DOWN_UP 0
+
+#define UP_DOWN     1
+#define DOWN_UP     0
 
 // dir - 1: up to down
 // dir - 2: down to up
 void bmpdraw(File f, int x, int y, int dir) {
+
   if (bmpFile.seek(__Gnbmp_image_offset)) {
     Serial.print("pos = ");
     Serial.println(bmpFile.position());
@@ -192,7 +194,7 @@ void bmpdraw(File f, int x, int y, int dir) {
 
   uint32_t time = millis();
 
-  uint8_t sdbuffer[BUFFPIXEL_X3];  // 3 * pixels to buffer
+  uint8_t sdbuffer[BUFFPIXEL_X3];                                         // 3 * pixels to buffer
 
   for (int i = 0; i < __Gnbmp_height; i++) {
     if (dir) {
@@ -200,16 +202,17 @@ void bmpdraw(File f, int x, int y, int dir) {
     }
 
     for (int j = 0; j < (240 / BUFFPIXEL); j++) {
+
       bmpFile.read(sdbuffer, BUFFPIXEL_X3);
-      uint8_t buffidx  = 0;
-      int     offset_x = j * BUFFPIXEL;
+      uint8_t buffidx = 0;
+      int offset_x = j * BUFFPIXEL;
 
       unsigned int __color[BUFFPIXEL];
 
       for (int k = 0; k < BUFFPIXEL; k++) {
-        __color[k] = sdbuffer[buffidx + 2] >> 3;                      // read
-        __color[k] = __color[k] << 6 | (sdbuffer[buffidx + 1] >> 2);  // green
-        __color[k] = __color[k] << 5 | (sdbuffer[buffidx + 0] >> 3);  // blue
+        __color[k] = sdbuffer[buffidx + 2] >> 3;                    // read
+        __color[k] = __color[k] << 6 | (sdbuffer[buffidx + 1] >> 2); // green
+        __color[k] = __color[k] << 5 | (sdbuffer[buffidx + 0] >> 3); // blue
 
         buffidx += 3;
       }
@@ -236,6 +239,7 @@ void bmpdraw(File f, int x, int y, int dir) {
 
       TFT_CS_HIGH;
     }
+
   }
 
   Serial.print(millis() - time, DEC);
@@ -245,7 +249,7 @@ void bmpdraw(File f, int x, int y, int dir) {
 boolean bmpReadHeader(File f) {
   // read header
   uint32_t tmp;
-  uint8_t  bmpDepth;
+  uint8_t bmpDepth;
 
   if (read16(f) != 0x4D42) {
     // magic bytes missing
@@ -269,10 +273,10 @@ boolean bmpReadHeader(File f) {
   Serial.print("header size ");
   Serial.println(tmp, DEC);
 
-  int bmp_width  = read32(f);
+  int bmp_width = read32(f);
   int bmp_height = read32(f);
 
-  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) {  // if image is not 320x240, return false
+  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) {   // if image is not 320x240, return false
     return false;
   }
 
@@ -302,7 +306,7 @@ boolean bmpReadHeader(File f) {
 // LITTLE ENDIAN!
 uint16_t read16(File f) {
   uint16_t d;
-  uint8_t  b;
+  uint8_t b;
   b = f.read();
   d = f.read();
   d <<= 8;
diff --git a/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino b/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
index 50b3f5127d..33c9435982 100644
--- a/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
+++ b/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
@@ -1,27 +1,27 @@
 #include "Arduino.h"
 #include "Ticker.h"
 
-#define LED1 2
-#define LED2 4
-#define LED3 12
-#define LED4 14
-#define LED5 15
+#define LED1  2
+#define LED2  4
+#define LED3  12
+#define LED4  14
+#define LED5  15
+
 
 class ExampleClass {
   public:
-  ExampleClass(int pin, int duration) :
-      _pin(pin), _duration(duration) {
-    pinMode(_pin, OUTPUT);
-    _myTicker.attach_ms(_duration, std::bind(&ExampleClass::classBlink, this));
-  }
-  ~ExampleClass() {};
-
-  int    _pin, _duration;
-  Ticker _myTicker;
-
-  void classBlink() {
-    digitalWrite(_pin, !digitalRead(_pin));
-  }
+    ExampleClass(int pin, int duration) : _pin(pin), _duration(duration) {
+      pinMode(_pin, OUTPUT);
+      _myTicker.attach_ms(_duration, std::bind(&ExampleClass::classBlink, this));
+    }
+    ~ExampleClass() {};
+
+    int _pin, _duration;
+    Ticker _myTicker;
+
+    void classBlink() {
+      digitalWrite(_pin, !digitalRead(_pin));
+    }
 };
 
 void staticBlink() {
@@ -43,6 +43,7 @@ Ticker lambdaTicker;
 
 ExampleClass example(LED1, 100);
 
+
 void setup() {
   pinMode(LED2, OUTPUT);
   staticTicker.attach_ms(100, staticBlink);
@@ -54,7 +55,9 @@ void setup() {
   parameterTicker.attach_ms(100, std::bind(parameterBlink, LED4));
 
   pinMode(LED5, OUTPUT);
-  lambdaTicker.attach_ms(100, []() { digitalWrite(LED5, !digitalRead(LED5)); });
+  lambdaTicker.attach_ms(100, []() {
+    digitalWrite(LED5, !digitalRead(LED5));
+  });
 }
 
 void loop() {
diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp
index 82ae6b2521..e9fc796bbf 100644
--- a/libraries/Wire/Wire.cpp
+++ b/libraries/Wire/Wire.cpp
@@ -22,8 +22,7 @@
     Modified January 2017 by Bjorn Hammarberg (bjoham@esp8266.com) - i2c slave support
 */
 
-extern "C"
-{
+extern "C" {
 #include <stdlib.h>
 #include <string.h>
 #include <inttypes.h>
@@ -32,6 +31,7 @@ extern "C"
 #include "twi.h"
 #include "Wire.h"
 
+
 //Some boards don't have these pins available, and hence don't support Wire.
 //Check here for compile-time error.
 #if !defined(PIN_WIRE_SDA) || !defined(PIN_WIRE_SCL)
@@ -41,13 +41,13 @@ extern "C"
 // Initialize Class Variables //////////////////////////////////////////////////
 
 uint8_t TwoWire::rxBuffer[I2C_BUFFER_LENGTH];
-size_t  TwoWire::rxBufferIndex  = 0;
-size_t  TwoWire::rxBufferLength = 0;
+size_t TwoWire::rxBufferIndex = 0;
+size_t TwoWire::rxBufferLength = 0;
 
 uint8_t TwoWire::txAddress = 0;
 uint8_t TwoWire::txBuffer[I2C_BUFFER_LENGTH];
-size_t  TwoWire::txBufferIndex  = 0;
-size_t  TwoWire::txBufferLength = 0;
+size_t TwoWire::txBufferIndex = 0;
+size_t TwoWire::txBufferLength = 0;
 
 uint8_t TwoWire::transmitting = 0;
 void (*TwoWire::user_onRequest)(void);
@@ -58,7 +58,7 @@ static int default_scl_pin = SCL;
 
 // Constructors ////////////////////////////////////////////////////////////////
 
-TwoWire::TwoWire() { }
+TwoWire::TwoWire() {}
 
 // Public Methods //////////////////////////////////////////////////////////////
 
@@ -126,8 +126,8 @@ size_t TwoWire::requestFrom(uint8_t address, size_t size, bool sendStop)
     {
         size = I2C_BUFFER_LENGTH;
     }
-    size_t read    = (twi_readFrom(address, rxBuffer, size, sendStop) == 0) ? size : 0;
-    rxBufferIndex  = 0;
+    size_t read = (twi_readFrom(address, rxBuffer, size, sendStop) == 0) ? size : 0;
+    rxBufferIndex = 0;
     rxBufferLength = read;
     return read;
 }
@@ -154,9 +154,9 @@ uint8_t TwoWire::requestFrom(int address, int quantity, int sendStop)
 
 void TwoWire::beginTransmission(uint8_t address)
 {
-    transmitting   = 1;
-    txAddress      = address;
-    txBufferIndex  = 0;
+    transmitting = 1;
+    txAddress = address;
+    txBufferIndex = 0;
     txBufferLength = 0;
 }
 
@@ -167,10 +167,10 @@ void TwoWire::beginTransmission(int address)
 
 uint8_t TwoWire::endTransmission(uint8_t sendStop)
 {
-    int8_t ret     = twi_writeTo(txAddress, txBuffer, txBufferLength, sendStop);
-    txBufferIndex  = 0;
+    int8_t ret = twi_writeTo(txAddress, txBuffer, txBufferLength, sendStop);
+    txBufferIndex = 0;
     txBufferLength = 0;
-    transmitting   = 0;
+    transmitting = 0;
     return ret;
 }
 
@@ -199,7 +199,7 @@ size_t TwoWire::write(uint8_t data)
     return 1;
 }
 
-size_t TwoWire::write(const uint8_t* data, size_t quantity)
+size_t TwoWire::write(const uint8_t *data, size_t quantity)
 {
     if (transmitting)
     {
@@ -255,9 +255,9 @@ int TwoWire::peek(void)
 
 void TwoWire::flush(void)
 {
-    rxBufferIndex  = 0;
+    rxBufferIndex = 0;
     rxBufferLength = 0;
-    txBufferIndex  = 0;
+    txBufferIndex = 0;
     txBufferLength = 0;
 }
 
@@ -283,7 +283,7 @@ void TwoWire::onReceiveService(uint8_t* inBytes, size_t numBytes)
     }
 
     // set rx iterator vars
-    rxBufferIndex  = 0;
+    rxBufferIndex = 0;
     rxBufferLength = numBytes;
 
     // alert user program
@@ -300,7 +300,7 @@ void TwoWire::onRequestService(void)
 
     // reset tx buffer iterator vars
     // !!! this will kill any pending pre-master sendTo() activity
-    txBufferIndex  = 0;
+    txBufferIndex = 0;
     txBufferLength = 0;
 
     // alert user program
@@ -312,7 +312,7 @@ void TwoWire::onReceive(void (*function)(int))
     // arduino api compatibility fixer:
     // really hope size parameter will not exceed 2^31 :)
     static_assert(sizeof(int) == sizeof(size_t), "something is wrong in Arduino kingdom");
-    user_onReceive = reinterpret_cast<void (*)(size_t)>(function);
+    user_onReceive = reinterpret_cast<void(*)(size_t)>(function);
 }
 
 void TwoWire::onReceive(void (*function)(size_t))
diff --git a/libraries/Wire/Wire.h b/libraries/Wire/Wire.h
index 784874d73b..be73f10fe6 100644
--- a/libraries/Wire/Wire.h
+++ b/libraries/Wire/Wire.h
@@ -27,6 +27,7 @@
 #include <inttypes.h>
 #include "Stream.h"
 
+
 #ifndef I2C_BUFFER_LENGTH
 // DEPRECATED: Do not use BUFFER_LENGTH, prefer I2C_BUFFER_LENGTH
 #define BUFFER_LENGTH 128
@@ -37,35 +38,34 @@ class TwoWire : public Stream
 {
 private:
     static uint8_t rxBuffer[];
-    static size_t  rxBufferIndex;
-    static size_t  rxBufferLength;
+    static size_t rxBufferIndex;
+    static size_t rxBufferLength;
 
     static uint8_t txAddress;
     static uint8_t txBuffer[];
-    static size_t  txBufferIndex;
-    static size_t  txBufferLength;
+    static size_t txBufferIndex;
+    static size_t txBufferLength;
 
     static uint8_t transmitting;
     static void (*user_onRequest)(void);
     static void (*user_onReceive)(size_t);
     static void onRequestService(void);
     static void onReceiveService(uint8_t*, size_t);
-
 public:
     TwoWire();
-    void    begin(int sda, int scl);
-    void    begin(int sda, int scl, uint8_t address);
-    void    pins(int sda, int scl) __attribute__((deprecated));  // use begin(sda, scl) in new code
-    void    begin();
-    void    begin(uint8_t);
-    void    begin(int);
-    void    setClock(uint32_t);
-    void    setClockStretchLimit(uint32_t);
-    void    beginTransmission(uint8_t);
-    void    beginTransmission(int);
+    void begin(int sda, int scl);
+    void begin(int sda, int scl, uint8_t address);
+    void pins(int sda, int scl) __attribute__((deprecated)); // use begin(sda, scl) in new code
+    void begin();
+    void begin(uint8_t);
+    void begin(int);
+    void setClock(uint32_t);
+    void setClockStretchLimit(uint32_t);
+    void beginTransmission(uint8_t);
+    void beginTransmission(int);
     uint8_t endTransmission(void);
     uint8_t endTransmission(uint8_t);
-    size_t  requestFrom(uint8_t address, size_t size, bool sendStop);
+    size_t requestFrom(uint8_t address, size_t size, bool sendStop);
     uint8_t status();
 
     uint8_t requestFrom(uint8_t, uint8_t);
@@ -74,14 +74,14 @@ class TwoWire : public Stream
     uint8_t requestFrom(int, int, int);
 
     virtual size_t write(uint8_t);
-    virtual size_t write(const uint8_t*, size_t);
-    virtual int    available(void);
-    virtual int    read(void);
-    virtual int    peek(void);
-    virtual void   flush(void);
-    void           onReceive(void (*)(int));     // arduino api
-    void           onReceive(void (*)(size_t));  // legacy esp8266 backward compatibility
-    void           onRequest(void (*)(void));
+    virtual size_t write(const uint8_t *, size_t);
+    virtual int available(void);
+    virtual int read(void);
+    virtual int peek(void);
+    virtual void flush(void);
+    void onReceive(void (*)(int));      // arduino api
+    void onReceive(void (*)(size_t));   // legacy esp8266 backward compatibility
+    void onRequest(void (*)(void));
 
     using Print::write;
 };
@@ -91,3 +91,4 @@ extern TwoWire Wire;
 #endif
 
 #endif
+
diff --git a/libraries/Wire/examples/master_reader/master_reader.ino b/libraries/Wire/examples/master_reader/master_reader.ino
index 73f45e0ae0..323830f847 100644
--- a/libraries/Wire/examples/master_reader/master_reader.ino
+++ b/libraries/Wire/examples/master_reader/master_reader.ino
@@ -8,17 +8,18 @@
 
 // This example code is in the public domain.
 
+
 #include <Wire.h>
 #include <PolledTimeout.h>
 
 #define SDA_PIN 4
 #define SCL_PIN 5
 const int16_t I2C_MASTER = 0x42;
-const int16_t I2C_SLAVE  = 0x08;
+const int16_t I2C_SLAVE = 0x08;
 
 void setup() {
-  Serial.begin(115200);                      // start serial for output
-  Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER);  // join i2c bus (address optional for master)
+  Serial.begin(115200);  // start serial for output
+  Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER);        // join i2c bus (address optional for master)
 }
 
 void loop() {
@@ -26,11 +27,11 @@ void loop() {
   static periodic nextPing(1000);
 
   if (nextPing) {
-    Wire.requestFrom(I2C_SLAVE, 6);  // request 6 bytes from slave device #8
+    Wire.requestFrom(I2C_SLAVE, 6);    // request 6 bytes from slave device #8
 
-    while (Wire.available()) {  // slave may send less than requested
-      char c = Wire.read();     // receive a byte as character
-      Serial.print(c);          // print the character
+    while (Wire.available()) { // slave may send less than requested
+      char c = Wire.read(); // receive a byte as character
+      Serial.print(c);         // print the character
     }
   }
 }
diff --git a/libraries/Wire/examples/master_writer/master_writer.ino b/libraries/Wire/examples/master_writer/master_writer.ino
index 727ff0a09d..1e9719e23c 100644
--- a/libraries/Wire/examples/master_writer/master_writer.ino
+++ b/libraries/Wire/examples/master_writer/master_writer.ino
@@ -8,16 +8,17 @@
 
 // This example code is in the public domain.
 
+
 #include <Wire.h>
 #include <PolledTimeout.h>
 
 #define SDA_PIN 4
 #define SCL_PIN 5
 const int16_t I2C_MASTER = 0x42;
-const int16_t I2C_SLAVE  = 0x08;
+const int16_t I2C_SLAVE = 0x08;
 
 void setup() {
-  Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER);  // join i2c bus (address optional for master)
+  Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER); // join i2c bus (address optional for master)
 }
 
 byte x = 0;
@@ -27,10 +28,10 @@ void loop() {
   static periodic nextPing(1000);
 
   if (nextPing) {
-    Wire.beginTransmission(I2C_SLAVE);  // transmit to device #8
-    Wire.write("x is ");                // sends five bytes
-    Wire.write(x);                      // sends one byte
-    Wire.endTransmission();             // stop transmitting
+    Wire.beginTransmission(I2C_SLAVE); // transmit to device #8
+    Wire.write("x is ");        // sends five bytes
+    Wire.write(x);              // sends one byte
+    Wire.endTransmission();    // stop transmitting
 
     x++;
   }
diff --git a/libraries/Wire/examples/slave_receiver/slave_receiver.ino b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
index 0db1c5926f..270cc43129 100644
--- a/libraries/Wire/examples/slave_receiver/slave_receiver.ino
+++ b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
@@ -8,19 +8,20 @@
 
 // This example code is in the public domain.
 
+
 #include <Wire.h>
 
 #define SDA_PIN 4
 #define SCL_PIN 5
 
 const int16_t I2C_MASTER = 0x42;
-const int16_t I2C_SLAVE  = 0x08;
+const int16_t I2C_SLAVE = 0x08;
 
 void setup() {
-  Serial.begin(115200);  // start serial for output
+  Serial.begin(115200);           // start serial for output
 
-  Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE);  // new syntax: join i2c bus (address required for slave)
-  Wire.onReceive(receiveEvent);             // register event
+  Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE); // new syntax: join i2c bus (address required for slave)
+  Wire.onReceive(receiveEvent); // register event
 }
 
 void loop() {
@@ -29,11 +30,12 @@ void loop() {
 // function that executes whenever data is received from master
 // this function is registered as an event, see setup()
 void receiveEvent(size_t howMany) {
-  (void)howMany;
-  while (1 < Wire.available()) {  // loop through all but the last
-    char c = Wire.read();         // receive byte as a character
-    Serial.print(c);              // print the character
+
+  (void) howMany;
+  while (1 < Wire.available()) { // loop through all but the last
+    char c = Wire.read(); // receive byte as a character
+    Serial.print(c);         // print the character
   }
-  int x = Wire.read();  // receive byte as an integer
-  Serial.println(x);    // print the integer
+  int x = Wire.read();    // receive byte as an integer
+  Serial.println(x);         // print the integer
 }
diff --git a/libraries/Wire/examples/slave_sender/slave_sender.ino b/libraries/Wire/examples/slave_sender/slave_sender.ino
index 7937cac918..e177be8538 100644
--- a/libraries/Wire/examples/slave_sender/slave_sender.ino
+++ b/libraries/Wire/examples/slave_sender/slave_sender.ino
@@ -8,16 +8,17 @@
 
 // This example code is in the public domain.
 
+
 #include <Wire.h>
 
 #define SDA_PIN 4
 #define SCL_PIN 5
 const int16_t I2C_MASTER = 0x42;
-const int16_t I2C_SLAVE  = 0x08;
+const int16_t I2C_SLAVE = 0x08;
 
 void setup() {
-  Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE);  // join i2c bus with address #8
-  Wire.onRequest(requestEvent);             // register event
+  Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE);                // join i2c bus with address #8
+  Wire.onRequest(requestEvent); // register event
 }
 
 void loop() {
@@ -26,6 +27,6 @@ void loop() {
 // function that executes whenever data is requested by master
 // this function is registered as an event, see setup()
 void requestEvent() {
-  Wire.write("hello\n");  // respond with message of 6 bytes
+  Wire.write("hello\n"); // respond with message of 6 bytes
   // as expected by master
 }
diff --git a/libraries/esp8266/examples/Blink/Blink.ino b/libraries/esp8266/examples/Blink/Blink.ino
index d2083049dd..de23fb519f 100644
--- a/libraries/esp8266/examples/Blink/Blink.ino
+++ b/libraries/esp8266/examples/Blink/Blink.ino
@@ -10,12 +10,12 @@
 */
 
 void setup() {
-  pinMode(LED_BUILTIN, OUTPUT);  // Initialize the LED_BUILTIN pin as an output
+  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
 }
 
 // the loop function runs over and over again forever
 void loop() {
-  digitalWrite(LED_BUILTIN, LOW);  // Turn the LED on (Note that LOW is the voltage level
+  digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
   // but actually the LED is on; this is because
   // it is active low on the ESP-01)
   delay(1000);                      // Wait for a second
diff --git a/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino b/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
index 66536a335d..11e2aff482 100644
--- a/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
+++ b/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
@@ -22,10 +22,11 @@
   Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
 */
 
+
 #include <PolledTimeout.h>
 
 void ledOn() {
-  digitalWrite(LED_BUILTIN, LOW);  // Turn the LED on (Note that LOW is the voltage level
+  digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
 }
 
 void ledOff() {
@@ -36,7 +37,8 @@ void ledToggle() {
   digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));  // Change the state of the LED
 }
 
-esp8266::polledTimeout::periodicFastUs halfPeriod(500000);  //use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace
+
+esp8266::polledTimeout::periodicFastUs halfPeriod(500000); //use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace
 
 // the setup function runs only once at start
 void setup() {
@@ -48,16 +50,16 @@ void setup() {
   Serial.printf("periodic/oneShotFastUs::timeMax() = %u us\n", (uint32_t)esp8266::polledTimeout::periodicFastUs::timeMax());
   Serial.printf("periodic/oneShotFastNs::timeMax() = %u ns\n", (uint32_t)esp8266::polledTimeout::periodicFastNs::timeMax());
 
-#if 0  // 1 for debugging polledTimeout
+#if 0 // 1 for debugging polledTimeout
   Serial.printf("periodic/oneShotMs::rangeCompensate     = %u\n", (uint32_t)esp8266::polledTimeout::periodicMs::rangeCompensate);
   Serial.printf("periodic/oneShotFastMs::rangeCompensate = %u\n", (uint32_t)esp8266::polledTimeout::periodicFastMs::rangeCompensate);
   Serial.printf("periodic/oneShotFastUs::rangeCompensate = %u\n", (uint32_t)esp8266::polledTimeout::periodicFastUs::rangeCompensate);
   Serial.printf("periodic/oneShotFastNs::rangeCompensate = %u\n", (uint32_t)esp8266::polledTimeout::periodicFastNs::rangeCompensate);
 #endif
 
-  pinMode(LED_BUILTIN, OUTPUT);  // Initialize the LED_BUILTIN pin as an output
+  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
 
-  using esp8266::polledTimeout::oneShotMs;  //import the type to the local namespace
+  using esp8266::polledTimeout::oneShotMs; //import the type to the local namespace
 
   //STEP1; turn the led ON
   ledOn();
@@ -78,9 +80,10 @@ void setup() {
   }
 
   //Done with STEPs, do other stuff
-  halfPeriod.reset();  //halfPeriod is global, so it gets inited on sketch start. Clear it here to make it ready for loop, where it's actually used.
+  halfPeriod.reset(); //halfPeriod is global, so it gets inited on sketch start. Clear it here to make it ready for loop, where it's actually used.
 }
 
+
 // the loop function runs over and over again forever
 void loop() {
   if (halfPeriod) {
diff --git a/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino b/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
index 16dd33aa15..24689f3a44 100644
--- a/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
+++ b/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
@@ -13,7 +13,7 @@
 int ledState = LOW;
 
 unsigned long previousMillis = 0;
-const long    interval       = 1000;
+const long interval = 1000;
 
 void setup() {
   pinMode(LED_BUILTIN, OUTPUT);
diff --git a/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino b/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
index 3110d23ac2..ce4dac2470 100644
--- a/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
+++ b/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
@@ -6,24 +6,24 @@ using namespace experimental::CBListImplentation;
 
 class exampleClass {
   public:
-  exampleClass() {};
+    exampleClass() {};
 
-  using exCallBack = std::function<void(int)>;
-  using exHandler  = CallBackList<exCallBack>::CallBackHandler;
+    using exCallBack = std::function<void(int)>;
+    using exHandler  = CallBackList<exCallBack>::CallBackHandler;
 
-  CallBackList<exCallBack> myHandlers;
+    CallBackList<exCallBack> myHandlers;
 
-  exHandler setHandler(exCallBack cb) {
-    return myHandlers.add(cb);
-  }
+    exHandler setHandler(exCallBack cb) {
+      return myHandlers.add(cb);
+    }
 
-  void removeHandler(exHandler hnd) {
-    myHandlers.remove(hnd);
-  }
+    void removeHandler(exHandler hnd) {
+      myHandlers.remove(hnd);
+    }
 
-  void trigger(int t) {
-    myHandlers.execute(t);
-  }
+    void trigger(int t) {
+      myHandlers.execute(t);
+    }
 };
 
 exampleClass myExample;
@@ -40,7 +40,7 @@ void cb3(int in, int s) {
   Serial.printf("Callback 3, in = %d, s = %d\n", in, s);
 }
 
-Ticker                  tk, tk2, tk3;
+Ticker tk, tk2, tk3;
 exampleClass::exHandler e1 = myExample.setHandler(cb1);
 exampleClass::exHandler e2 = myExample.setHandler(cb2);
 exampleClass::exHandler e3 = myExample.setHandler(std::bind(cb3, std::placeholders::_1, 10));
@@ -52,8 +52,12 @@ void setup() {
     Serial.printf("trigger %d\n", (uint32_t)millis());
     myExample.trigger(millis());
   });
-  tk2.once_ms(10000, []() { myExample.removeHandler(e2); });
-  tk3.once_ms(20000, []() { e3.reset(); });
+  tk2.once_ms(10000, []() {
+    myExample.removeHandler(e2);
+  });
+  tk3.once_ms(20000, []() {
+    e3.reset();
+  });
 }
 
 void loop() {
diff --git a/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino b/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
index cbd25c8bcb..fa520722f6 100644
--- a/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
+++ b/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
@@ -21,12 +21,12 @@ void setup() {
   uint32_t ptr = (uint32_t)corruptme;
   // Find a page aligned spot inside the array
   ptr += 2 * SPI_FLASH_SEC_SIZE;
-  ptr &= ~(SPI_FLASH_SEC_SIZE - 1);  // Sectoralign
+  ptr &= ~(SPI_FLASH_SEC_SIZE - 1); // Sectoralign
   uint32_t sector = ((((uint32_t)ptr - 0x40200000) / SPI_FLASH_SEC_SIZE));
 
   // Create a sector with 1 bit set (i.e. fake corruption)
-  uint32_t* space = (uint32_t*)calloc(SPI_FLASH_SEC_SIZE, 1);
-  space[42]       = 64;
+  uint32_t *space = (uint32_t*)calloc(SPI_FLASH_SEC_SIZE, 1);
+  space[42] = 64;
 
   // Write it into flash at the spot in question
   spi_flash_erase_sector(sector);
@@ -40,5 +40,6 @@ void setup() {
   Serial.printf("CRC check: %s\n", ESP.checkFlashCRC() ? "OK" : "ERROR");
 }
 
+
 void loop() {
 }
diff --git a/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino b/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
index ce4919f14e..9c3a54d7da 100644
--- a/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
+++ b/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
@@ -10,19 +10,17 @@ void setup(void) {
 }
 
 void loop() {
-  uint32_t    realSize = ESP.getFlashChipRealSize();
-  uint32_t    ideSize  = ESP.getFlashChipSize();
-  FlashMode_t ideMode  = ESP.getFlashChipMode();
+
+  uint32_t realSize = ESP.getFlashChipRealSize();
+  uint32_t ideSize = ESP.getFlashChipSize();
+  FlashMode_t ideMode = ESP.getFlashChipMode();
 
   Serial.printf("Flash real id:   %08X\n", ESP.getFlashChipId());
   Serial.printf("Flash real size: %u bytes\n\n", realSize);
 
   Serial.printf("Flash ide  size: %u bytes\n", ideSize);
   Serial.printf("Flash ide speed: %u Hz\n", ESP.getFlashChipSpeed());
-  Serial.printf("Flash ide mode:  %s\n", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT"
-                                              : ideMode == FM_DIO                        ? "DIO"
-                                              : ideMode == FM_DOUT                       ? "DOUT"
-                                                                                         : "UNKNOWN"));
+  Serial.printf("Flash ide mode:  %s\n", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT" : ideMode == FM_DIO ? "DIO" : ideMode == FM_DOUT ? "DOUT" : "UNKNOWN"));
 
   if (ideSize != realSize) {
     Serial.println("Flash Chip configuration wrong!\n");
diff --git a/libraries/esp8266/examples/ConfigFile/ConfigFile.ino b/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
index aec83fc8e4..59693edb31 100644
--- a/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
+++ b/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
@@ -22,13 +22,13 @@ bool loadConfig() {
   }
 
   StaticJsonDocument<200> doc;
-  auto                    error = deserializeJson(doc, configFile);
+  auto error = deserializeJson(doc, configFile);
   if (error) {
     Serial.println("Failed to parse config file");
     return false;
   }
 
-  const char* serverName  = doc["serverName"];
+  const char* serverName = doc["serverName"];
   const char* accessToken = doc["accessToken"];
 
   // Real world application would store these values in some variables for
@@ -43,7 +43,7 @@ bool loadConfig() {
 
 bool saveConfig() {
   StaticJsonDocument<200> doc;
-  doc["serverName"]  = "api.example.com";
+  doc["serverName"] = "api.example.com";
   doc["accessToken"] = "128du9as8du12eoue8da98h123ueh9h98";
 
   File configFile = LittleFS.open("/config.json", "w");
@@ -67,6 +67,7 @@ void setup() {
     return;
   }
 
+
   if (!saveConfig()) {
     Serial.println("Failed to save config");
   } else {
diff --git a/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino b/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
index b2efbeb4c1..1f192dd01c 100644
--- a/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
+++ b/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
@@ -39,12 +39,12 @@ void setup() {
   // PWM-Locked generator:   https://github.com/esp8266/Arduino/pull/7231
   enablePhaseLockedWaveform();
 
-  pinMode(LED_BUILTIN, OUTPUT);  // Initialize the LED_BUILTIN pin as an output
+  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
   analogWriteRange(1000);
 
-  using esp8266::polledTimeout::oneShotMs;  //import the type to the local namespace
+  using esp8266::polledTimeout::oneShotMs; //import the type to the local namespace
 
-  digitalWrite(LED_BUILTIN, LOW);  // Turn the LED on (Note that LOW is the voltage level
+  digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
 
   oneShotMs timeoutOn(2000);
   while (!timeoutOn) {
@@ -54,16 +54,17 @@ void setup() {
   stepPeriod.reset();
 }
 
+
 void loop() {
-  static int val   = 0;
+  static int val = 0;
   static int delta = 100;
   if (stepPeriod) {
     val += delta;
     if (val < 0) {
-      val   = 100;
+      val = 100;
       delta = 100;
     } else if (val > 1000) {
-      val   = 900;
+      val = 900;
       delta = -100;
     }
     analogWrite(LED_BUILTIN, val);
diff --git a/libraries/esp8266/examples/HeapMetric/HeapMetric.ino b/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
index 3ec3f0cf98..5c7a27dbbe 100644
--- a/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
+++ b/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
@@ -11,7 +11,7 @@ void stats(const char* what) {
   // or all at once:
   uint32_t free;
   uint32_t max;
-  uint8_t  frag;
+  uint8_t frag;
   ESP.getHeapStats(&free, &max, &frag);
 
   Serial.printf("free: %7u - max: %7u - frag: %3d%% <- ", free, max, frag);
@@ -21,7 +21,7 @@ void stats(const char* what) {
 
 void tryit(int blocksize) {
   void** p;
-  int    blocks;
+  int blocks;
 
   /*
     heap-used ~= blocks*sizeof(void*) + blocks*blocksize
@@ -52,18 +52,21 @@ void tryit(int blocksize) {
     calculation of multiple elements combined with the rounding up for the
     8-byte alignment of each allocation can make for some tricky calculations.
   */
-  int rawMemoryMaxFreeBlockSize = ESP.getMaxFreeBlockSize();
+  int rawMemoryMaxFreeBlockSize =  ESP.getMaxFreeBlockSize();
   // Remove the space for overhead component of the blocks*sizeof(void*) array.
   int maxFreeBlockSize = rawMemoryMaxFreeBlockSize - UMM_OVERHEAD_ADJUST;
   // Initial estimate to use all of the MaxFreeBlock with multiples of 8 rounding up.
-  blocks = maxFreeBlockSize / (((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + sizeof(void*));
+  blocks = maxFreeBlockSize /
+           (((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + sizeof(void*));
   /*
     While we allowed for the 8-byte alignment overhead for blocks*blocksize we
     were unable to compensate in advance for the later 8-byte aligning needed
     for the blocks*sizeof(void*) allocation. Thus blocks may be off by one count.
     We now validate the estimate and adjust as needed.
   */
-  int rawMemoryEstimate = blocks * ((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + ((blocks * sizeof(void*) + UMM_OVERHEAD_ADJUST + 7) & ~7);
+  int rawMemoryEstimate =
+    blocks * ((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) +
+    ((blocks * sizeof(void*) + UMM_OVERHEAD_ADJUST + 7) & ~7);
   if (rawMemoryMaxFreeBlockSize < rawMemoryEstimate) {
     --blocks;
   }
diff --git a/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino b/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
index 80544815a2..1fb90134c2 100644
--- a/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
+++ b/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
@@ -21,7 +21,7 @@ namespace TypeCast = experimental::TypeConversion;
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char masterKey[] PROGMEM = "w86vn@rpfA O+S";  // Use 8 random characters or more
+constexpr char masterKey[] PROGMEM = "w86vn@rpfA O+S"; // Use 8 random characters or more
 
 void setup() {
   // Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
@@ -47,12 +47,13 @@ void loop() {
 
   static uint32_t encryptionCounter = 0;
 
+
   // Generate the salt to use for HKDF
   uint8_t hkdfSalt[16] { 0 };
   getNonceGenerator()(hkdfSalt, sizeof hkdfSalt);
 
   // Generate the key to use for HMAC and encryption
-  HKDF hkdfInstance(FPSTR(masterKey), (sizeof masterKey) - 1, hkdfSalt, sizeof hkdfSalt);  // (sizeof masterKey) - 1 removes the terminating null value of the c-string
+  HKDF hkdfInstance(FPSTR(masterKey), (sizeof masterKey) - 1, hkdfSalt, sizeof hkdfSalt); // (sizeof masterKey) - 1 removes the terminating null value of the c-string
   hkdfInstance.produce(derivedKey, sizeof derivedKey);
 
   // Hash
@@ -60,16 +61,18 @@ void loop() {
   Serial.println(String(F("\nThis is the SHA256 hash of our example data, in HEX format:\n")) + TypeCast::uint8ArrayToHexString(resultArray, sizeof resultArray));
   Serial.println(String(F("This is the SHA256 hash of our example data, in HEX format, using String output:\n")) + SHA256::hash(exampleData));
 
+
   // HMAC
   // Note that HMAC output length is limited
   SHA256::hmac(exampleData.c_str(), exampleData.length(), derivedKey, sizeof derivedKey, resultArray, sizeof resultArray);
   Serial.println(String(F("\nThis is the SHA256 HMAC of our example data, in HEX format:\n")) + TypeCast::uint8ArrayToHexString(resultArray, sizeof resultArray));
   Serial.println(String(F("This is the SHA256 HMAC of our example data, in HEX format, using String output:\n")) + SHA256::hmac(exampleData, derivedKey, sizeof derivedKey, SHA256::NATURAL_LENGTH));
 
+
   // Authenticated Encryption with Associated Data (AEAD)
-  String  dataToEncrypt = F("This data is not encrypted.");
-  uint8_t resultingNonce[12] { 0 };  // The nonce is always 12 bytes
-  uint8_t resultingTag[16] { 0 };    // The tag is always 16 bytes
+  String dataToEncrypt = F("This data is not encrypted.");
+  uint8_t resultingNonce[12] { 0 }; // The nonce is always 12 bytes
+  uint8_t resultingTag[16] { 0 }; // The tag is always 16 bytes
 
   Serial.println(String(F("\nThis is the data to encrypt: ")) + dataToEncrypt);
 
@@ -88,6 +91,7 @@ void loop() {
 
   Serial.println(dataToEncrypt);
 
+
   Serial.println(F("\n##########################################################################################################\n"));
 
   delay(10000);
diff --git a/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino b/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
index 62ff6498f3..ff1c41e93b 100644
--- a/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
+++ b/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
@@ -19,15 +19,15 @@
 #include <ESP8266WiFi.h>
 #include <Esp.h>
 #include <user_interface.h>
-#include <coredecls.h>  // g_pcont - only needed for this debug demo
+#include <coredecls.h> // g_pcont - only needed for this debug demo
 #include <StackThunk.h>
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* ssid     = STASSID;
+const char* ssid = STASSID;
 const char* password = STAPSK;
 
 ////////////////////////////////////////////////////////////////////
@@ -39,18 +39,18 @@ extern "C" {
 #define thunk_ets_uart_printf ets_uart_printf
 
 #else
-int thunk_ets_uart_printf(const char* format, ...) __attribute__((format(printf, 1, 2)));
-// Second stack thunked helper - this macro creates the global function thunk_ets_uart_printf
-make_stack_thunk(ets_uart_printf);
+  int thunk_ets_uart_printf(const char *format, ...) __attribute__((format(printf, 1, 2)));
+  // Second stack thunked helper - this macro creates the global function thunk_ets_uart_printf
+  make_stack_thunk(ets_uart_printf);
 #endif
 };
 ////////////////////////////////////////////////////////////////////
 
 void setup(void) {
-  WiFi.persistent(false);  // w/o this a flash write occurs at every boot
+  WiFi.persistent(false); // w/o this a flash write occurs at every boot
   WiFi.mode(WIFI_OFF);
   Serial.begin(115200);
-  delay(20);  // This delay helps when using the 'Modified Serial monitor' otherwise it is not needed.
+  delay(20);    // This delay helps when using the 'Modified Serial monitor' otherwise it is not needed.
   Serial.println();
   Serial.println();
   Serial.println(F("The Hardware Watchdog Timer Demo is starting ..."));
@@ -94,6 +94,7 @@ void setup(void) {
   processKey(Serial, '?');
 }
 
+
 void loop(void) {
   if (Serial.available() > 0) {
     int hotKey = Serial.read();
diff --git a/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino b/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
index 45e2d63da4..7d182bf377 100644
--- a/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
+++ b/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
@@ -1,6 +1,6 @@
 #include <esp8266_undocumented.h>
-void crashMeIfYouCan(void) __attribute__((weak));
-int  divideA_B(int a, int b);
+void crashMeIfYouCan(void)__attribute__((weak));
+int divideA_B(int a, int b);
 
 int* nullPointer = NULL;
 
@@ -15,15 +15,16 @@ void processKey(Print& out, int hotKey) {
       ESP.restart();
       break;
     case 's': {
-      uint32_t startTime = millis();
-      out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
-      ets_install_putc1(ets_putc);
-      while (true) {
-        ets_printf("%9lu\r", (millis() - startTime));
-        ets_delay_us(250000);
-        // stay in an loop blocking other system activity.
+        uint32_t startTime = millis();
+        out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
+        ets_install_putc1(ets_putc);
+        while (true) {
+          ets_printf("%9lu\r", (millis() - startTime));
+          ets_delay_us(250000);
+          // stay in an loop blocking other system activity.
+        }
       }
-    } break;
+      break;
     case 'h':
       out.printf_P(PSTR("Now crashing with Hardware WDT. This will take about 6 seconds.\r\n"));
       asm volatile("mov.n a2, %0\n\t"
@@ -31,9 +32,7 @@ void processKey(Print& out, int hotKey) {
                    "mov.n a4, %2\n\t"
                    "mov.n a5, %3\n\t"
                    "mov.n a6, %4\n\t"
-                   :
-                   : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa)
-                   : "memory");
+                   : : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa) : "memory");
       // Could not find these in the stack dump, unless interrupts were enabled.
       {
         uint32_t startTime = millis();
diff --git a/libraries/esp8266/examples/I2SInput/I2SInput.ino b/libraries/esp8266/examples/I2SInput/I2SInput.ino
index 6e2e11b07b..836da2685b 100644
--- a/libraries/esp8266/examples/I2SInput/I2SInput.ino
+++ b/libraries/esp8266/examples/I2SInput/I2SInput.ino
@@ -35,7 +35,7 @@ void setup() {
   WiFi.forceSleepBegin();
   delay(500);
 
-  i2s_rxtx_begin(true, false);  // Enable I2S RX
+  i2s_rxtx_begin(true, false); // Enable I2S RX
   i2s_set_rate(11025);
 
   delay(1000);
diff --git a/libraries/esp8266/examples/I2STransmit/I2STransmit.ino b/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
index b14b3a7d15..2eaab265d2 100644
--- a/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
+++ b/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
@@ -14,19 +14,19 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
 // Set your network here
-const char* SSID = STASSID;
-const char* PASS = STAPSK;
+const char *SSID = STASSID;
+const char *PASS = STAPSK;
 
 WiFiUDP udp;
 // Set your listener PC's IP here:
 const IPAddress listener = { 192, 168, 1, 2 };
-const int       port     = 8266;
+const int port = 8266;
 
-int16_t buffer[100][2];  // Temp staging for samples
+int16_t buffer[100][2]; // Temp staging for samples
 
 void setup() {
   Serial.begin(115200);
@@ -48,7 +48,7 @@ void setup() {
   Serial.print("My IP: ");
   Serial.println(WiFi.localIP());
 
-  i2s_rxtx_begin(true, false);  // Enable I2S RX
+  i2s_rxtx_begin(true, false); // Enable I2S RX
   i2s_set_rate(11025);
 
   Serial.print("\nStart the listener on ");
@@ -60,6 +60,7 @@ void setup() {
   udp.beginPacket(listener, port);
   udp.write("I2S Receiver\r\n");
   udp.endPacket();
+
 }
 
 void loop() {
diff --git a/libraries/esp8266/examples/IramReserve/IramReserve.ino b/libraries/esp8266/examples/IramReserve/IramReserve.ino
index e1ad8c6b74..96d7479da4 100644
--- a/libraries/esp8266/examples/IramReserve/IramReserve.ino
+++ b/libraries/esp8266/examples/IramReserve/IramReserve.ino
@@ -18,9 +18,9 @@
 #if defined(UMM_HEAP_IRAM)
 
 #if defined(CORE_MOCK)
-#define XCHAL_INSTRAM1_VADDR 0x40100000
+#define XCHAL_INSTRAM1_VADDR		0x40100000
 #else
-#include <sys/config.h>  // For config/core-isa.h
+#include <sys/config.h> // For config/core-isa.h
 #endif
 
 // durable - as in long life, persisting across reboots.
@@ -29,6 +29,7 @@ struct durable {
   uint32_t chksum;
 };
 
+
 // Leave a durable block of IRAM after the 2nd heap.
 
 // The block should be in 8-byte increments and fall on an 8-byte alignment.
@@ -38,7 +39,7 @@ struct durable {
 #define IRAM_RESERVE ((uintptr_t)XCHAL_INSTRAM1_VADDR + 0xC000UL - IRAM_RESERVE_SZ)
 
 // Define a reference with the right properties to make access easier.
-#define DURABLE ((struct durable*)IRAM_RESERVE)
+#define DURABLE ((struct durable *)IRAM_RESERVE)
 #define INCREMENT_BOOTCOUNT() (DURABLE->bootCounter)++
 
 extern struct rst_info resetInfo;
@@ -57,9 +58,11 @@ extern struct rst_info resetInfo;
   XOR sum on the IRAM data (or just a section of the IRAM data).
 */
 inline bool is_iram_valid(void) {
-  return (REASON_WDT_RST <= resetInfo.reason && REASON_SOFT_RESTART >= resetInfo.reason);
+  return (REASON_WDT_RST      <= resetInfo.reason &&
+          REASON_SOFT_RESTART >= resetInfo.reason);
 }
 
+
 void setup() {
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
@@ -76,6 +79,7 @@ void setup() {
   Serial.printf("Number of reboots at %u\r\n", DURABLE->bootCounter);
   Serial.printf("\r\nSome less than direct, ways to restart:\r\n");
   processKey(Serial, '?');
+
 }
 
 void loop(void) {
@@ -105,9 +109,10 @@ extern "C" void umm_init_iram(void) {
   uintptr_t sec_heap = (uintptr_t)_text_end + 32;
   sec_heap &= ~7;
   size_t sec_heap_sz = 0xC000UL - (sec_heap - (uintptr_t)XCHAL_INSTRAM1_VADDR);
-  sec_heap_sz -= IRAM_RESERVE_SZ;  // Shrink IRAM heap
+  sec_heap_sz -= IRAM_RESERVE_SZ; // Shrink IRAM heap
   if (0xC000UL > sec_heap_sz) {
-    umm_init_iram_ex((void*)sec_heap, sec_heap_sz, true);
+
+    umm_init_iram_ex((void *)sec_heap, sec_heap_sz, true);
   }
 }
 
diff --git a/libraries/esp8266/examples/IramReserve/ProcessKey.ino b/libraries/esp8266/examples/IramReserve/ProcessKey.ino
index 45e2d63da4..7d182bf377 100644
--- a/libraries/esp8266/examples/IramReserve/ProcessKey.ino
+++ b/libraries/esp8266/examples/IramReserve/ProcessKey.ino
@@ -1,6 +1,6 @@
 #include <esp8266_undocumented.h>
-void crashMeIfYouCan(void) __attribute__((weak));
-int  divideA_B(int a, int b);
+void crashMeIfYouCan(void)__attribute__((weak));
+int divideA_B(int a, int b);
 
 int* nullPointer = NULL;
 
@@ -15,15 +15,16 @@ void processKey(Print& out, int hotKey) {
       ESP.restart();
       break;
     case 's': {
-      uint32_t startTime = millis();
-      out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
-      ets_install_putc1(ets_putc);
-      while (true) {
-        ets_printf("%9lu\r", (millis() - startTime));
-        ets_delay_us(250000);
-        // stay in an loop blocking other system activity.
+        uint32_t startTime = millis();
+        out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
+        ets_install_putc1(ets_putc);
+        while (true) {
+          ets_printf("%9lu\r", (millis() - startTime));
+          ets_delay_us(250000);
+          // stay in an loop blocking other system activity.
+        }
       }
-    } break;
+      break;
     case 'h':
       out.printf_P(PSTR("Now crashing with Hardware WDT. This will take about 6 seconds.\r\n"));
       asm volatile("mov.n a2, %0\n\t"
@@ -31,9 +32,7 @@ void processKey(Print& out, int hotKey) {
                    "mov.n a4, %2\n\t"
                    "mov.n a5, %3\n\t"
                    "mov.n a6, %4\n\t"
-                   :
-                   : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa)
-                   : "memory");
+                   : : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa) : "memory");
       // Could not find these in the stack dump, unless interrupts were enabled.
       {
         uint32_t startTime = millis();
diff --git a/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino b/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
index 306b53f8ec..2c22416e0d 100644
--- a/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
+++ b/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
@@ -38,14 +38,14 @@
   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA  */
 
 #include <ESP8266WiFi.h>
-#include <coredecls.h>  // crc32()
+#include <coredecls.h>         // crc32()
 #include <PolledTimeout.h>
-#include <include/WiFiState.h>  // WiFiState structure details
+#include <include/WiFiState.h> // WiFiState structure details
 
 //#define DEBUG  // prints WiFi connection info to serial, uncomment if you want WiFi messages
 #ifdef DEBUG
-#define DEBUG_PRINTLN(x) Serial.println(x)
-#define DEBUG_PRINT(x) Serial.print(x)
+#define DEBUG_PRINTLN(x)  Serial.println(x)
+#define DEBUG_PRINT(x)  Serial.print(x)
 #else
 #define DEBUG_PRINTLN(x)
 #define DEBUG_PRINT(x)
@@ -63,14 +63,14 @@ ADC_MODE(ADC_VCC);  // allows you to monitor the internal VCC level; it varies w
 // don't connect anything to the analog input pin(s)!
 
 // enter your WiFi configuration below
-const char* AP_SSID = "SSID";      // your router's SSID here
+const char* AP_SSID = "SSID";  // your router's SSID here
 const char* AP_PASS = "password";  // your router's password here
-IPAddress   staticIP(0, 0, 0, 0);  // parameters below are for your static IP address, if used
-IPAddress   gateway(0, 0, 0, 0);
-IPAddress   subnet(0, 0, 0, 0);
-IPAddress   dns1(0, 0, 0, 0);
-IPAddress   dns2(0, 0, 0, 0);
-uint32_t    timeout = 30E3;  // 30 second timeout on the WiFi connection
+IPAddress staticIP(0, 0, 0, 0); // parameters below are for your static IP address, if used
+IPAddress gateway(0, 0, 0, 0);
+IPAddress subnet(0, 0, 0, 0);
+IPAddress dns1(0, 0, 0, 0);
+IPAddress dns2(0, 0, 0, 0);
+uint32_t timeout = 30E3;  // 30 second timeout on the WiFi connection
 
 //#define TESTPOINT  //  used to track the timing of several test cycles (optional)
 #ifdef TESTPOINT
@@ -85,39 +85,38 @@ uint32_t    timeout = 30E3;  // 30 second timeout on the WiFi connection
 // This structure is stored in RTC memory to save the WiFi state and reset count (number of Deep Sleeps),
 // and it reconnects twice as fast as the first connection; it's used several places in this demo
 struct nv_s {
-  WiFiState wss;  // core's WiFi save state
+  WiFiState wss; // core's WiFi save state
 
-  struct
-  {
+  struct {
     uint32_t crc32;
     uint32_t rstCount;  // stores the Deep Sleep reset count
     // you can add anything else here that you want to save, must be 4-byte aligned
   } rtcData;
 };
 
-static nv_s* nv = (nv_s*)RTC_USER_MEM;  // user RTC RAM area
+static nv_s* nv = (nv_s*)RTC_USER_MEM; // user RTC RAM area
 
 uint32_t resetCount = 0;  // keeps track of the number of Deep Sleep tests / resets
 
-const uint32_t                     blinkDelay = 100;      // fast blink rate for the LED when waiting for the user
+const uint32_t blinkDelay = 100; // fast blink rate for the LED when waiting for the user
 esp8266::polledTimeout::periodicMs blinkLED(blinkDelay);  // LED blink delay without delay()
-esp8266::polledTimeout::oneShotMs  altDelay(blinkDelay);  // tight loop to simulate user code
-esp8266::polledTimeout::oneShotMs  wifiTimeout(timeout);  // 30 second timeout on WiFi connection
+esp8266::polledTimeout::oneShotMs altDelay(blinkDelay);  // tight loop to simulate user code
+esp8266::polledTimeout::oneShotMs wifiTimeout(timeout);  // 30 second timeout on WiFi connection
 // use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace
 
 void wakeupCallback() {  // unlike ISRs, you can do a print() from a callback function
-  testPoint_LOW;         // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW
-  printMillis();         // show time difference across sleep; millis is wrong as the CPU eventually stops
+  testPoint_LOW;  // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW
+  printMillis();  // show time difference across sleep; millis is wrong as the CPU eventually stops
   Serial.println(F("Woke from Light Sleep - this is the callback"));
 }
 
 void setup() {
 #ifdef TESTPOINT
   pinMode(testPointPin, OUTPUT);  // test point for Light Sleep and Deep Sleep tests
-  testPoint_LOW;                  // Deep Sleep reset doesn't clear GPIOs, testPoint LOW shows boot time
+  testPoint_LOW;  // Deep Sleep reset doesn't clear GPIOs, testPoint LOW shows boot time
 #endif
-  pinMode(LED, OUTPUT);                // activity and status indicator
-  digitalWrite(LED, LOW);              // turn on the LED
+  pinMode(LED, OUTPUT);  // activity and status indicator
+  digitalWrite(LED, LOW);  // turn on the LED
   pinMode(WAKE_UP_PIN, INPUT_PULLUP);  // polled to advance tests, interrupt for Forced Light Sleep
   Serial.begin(115200);
   Serial.println();
@@ -130,12 +129,12 @@ void setup() {
   }
 
   // Read previous resets (Deep Sleeps) from RTC memory, if any
-  uint32_t crcOfData = crc32((uint8_t*)&nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
+  uint32_t crcOfData = crc32((uint8_t*) &nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
   if ((crcOfData = nv->rtcData.crc32) && (resetCause == "Deep-Sleep Wake")) {
     resetCount = nv->rtcData.rstCount;  // read the previous reset count
     resetCount++;
   }
-  nv->rtcData.rstCount = resetCount;  // update the reset count & CRC
+  nv->rtcData.rstCount = resetCount; // update the reset count & CRC
   updateRTCcrc();
 
   if (resetCount == 1) {  // show that millis() is cleared across the Deep Sleep reset
@@ -165,7 +164,7 @@ void loop() {
   } else if (resetCount == 4) {
     resetTests();
   }
-}  //end of loop()
+} //end of loop()
 
 void runTest1() {
   Serial.println(F("\n1st test - running with WiFi unconfigured"));
@@ -182,7 +181,7 @@ void runTest2() {
     Serial.println(F("The amperage will drop in 7 seconds."));
     readVoltage();  // read internal VCC
     Serial.println(F("press the switch to continue"));
-    waitPushbutton(true, 90); /* This is using a special feature: below 100 mS blink delay,
+    waitPushbutton(true, 90);  /* This is using a special feature: below 100 mS blink delay,
          the LED blink delay is padding 100 mS time with 'program cycles' to fill the 100 mS.
          At 90 mS delay, 90% of the blink time is delay(), and 10% is 'your program running'.
          Below 90% you'll see a difference in the average amperage: less delay() = more amperage.
@@ -202,7 +201,7 @@ void runTest3() {
   //  delay(10);  // it doesn't always go to sleep unless you delay(10); yield() wasn't reliable
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
-  waitPushbutton(true, 99); /* Using the same < 100 mS feature. If you drop the delay below 100, you
+  waitPushbutton(true, 99);  /* Using the same < 100 mS feature. If you drop the delay below 100, you
       will see the effect of program time vs. delay() time on minimum amperage.  Above ~ 97 (97% of the
       time in delay) there is little change in amperage, so you need to spend maximum time in delay()
       to get minimum amperage.*/
@@ -216,7 +215,7 @@ void runTest4() {
   // and WiFi reconnects after the forceSleepWake more quickly
   digitalWrite(LED, LOW);  // visual cue that we're reconnecting WiFi
   uint32_t wifiBegin = millis();
-  WiFi.forceSleepWake();                   // reconnect with previous STA mode and connection settings
+  WiFi.forceSleepWake();  // reconnect with previous STA mode and connection settings
   WiFi.setSleepMode(WIFI_LIGHT_SLEEP, 3);  // Automatic Light Sleep, DTIM listen interval = 3
   // at higher DTIM intervals you'll have a hard time establishing and maintaining a connection
   wifiTimeout.reset(timeout);
@@ -230,7 +229,7 @@ void runTest4() {
     Serial.printf("%1.2f seconds\n", reConn / 1000);
     readVoltage();  // read internal VCC
     Serial.println(F("long press of the switch to continue"));
-    waitPushbutton(true, 350); /* Below 100 mS delay it only goes into 'Automatic Modem Sleep',
+    waitPushbutton(true, 350);  /* Below 100 mS delay it only goes into 'Automatic Modem Sleep',
         and below ~ 350 mS delay() the 'Automatic Light Sleep' is less frequent.  Above 500 mS
         delay() doesn't make significant improvement in power savings. */
   } else {
@@ -242,61 +241,61 @@ void runTest5() {
   Serial.println(F("\n5th test - Timed Light Sleep, wake in 10 seconds"));
   Serial.println(F("Press the button when you're ready to proceed"));
   waitPushbutton(true, blinkDelay);
-  WiFi.mode(WIFI_OFF);      // you must turn the modem off; using disconnect won't work
-  readVoltage();            // read internal VCC
-  printMillis();            // show millis() across sleep, including Serial.flush()
+  WiFi.mode(WIFI_OFF);  // you must turn the modem off; using disconnect won't work
+  readVoltage();  // read internal VCC
+  printMillis();  // show millis() across sleep, including Serial.flush()
   digitalWrite(LED, HIGH);  // turn the LED off so they know the CPU isn't running
-  testPoint_HIGH;           // testPoint LOW in callback tracks delay from testPoint HIGH to LOW
-  extern os_timer_t* timer_list;
+  testPoint_HIGH;  // testPoint LOW in callback tracks delay from testPoint HIGH to LOW
+  extern os_timer_t *timer_list;
   timer_list = nullptr;  // stop (but don't disable) the 4 OS timers
   wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
   gpio_pin_wakeup_enable(GPIO_ID_PIN(WAKE_UP_PIN), GPIO_PIN_INTR_LOLEVEL);  // GPIO wakeup (optional)
   // only LOLEVEL or HILEVEL interrupts work, no edge, that's an SDK or CPU limitation
-  wifi_fpm_set_wakeup_cb(wakeupCallback);  // set wakeup callback
+  wifi_fpm_set_wakeup_cb(wakeupCallback); // set wakeup callback
   // the callback is optional, but without it the modem will wake in 10 seconds then delay(10 seconds)
   // with the callback the sleep time is only 10 seconds total, no extra delay() afterward
   wifi_fpm_open();
-  wifi_fpm_do_sleep(10E6);        // Sleep range = 10000 ~ 268,435,454 uS (0xFFFFFFE, 2^28-1)
-  delay(10e3 + 1);                // delay needs to be 1 mS longer than sleep or it only goes into Modem Sleep
+  wifi_fpm_do_sleep(10E6);  // Sleep range = 10000 ~ 268,435,454 uS (0xFFFFFFE, 2^28-1)
+  delay(10e3 + 1); // delay needs to be 1 mS longer than sleep or it only goes into Modem Sleep
   Serial.println(F("Woke up!"));  // the interrupt callback hits before this is executed
 }
 
 void runTest6() {
   Serial.println(F("\n6th test - Forced Light Sleep, wake with GPIO interrupt"));
   Serial.flush();
-  WiFi.mode(WIFI_OFF);      // you must turn the modem off; using disconnect won't work
+  WiFi.mode(WIFI_OFF);  // you must turn the modem off; using disconnect won't work
   digitalWrite(LED, HIGH);  // turn the LED off so they know the CPU isn't running
-  readVoltage();            // read internal VCC
+  readVoltage();  // read internal VCC
   Serial.println(F("CPU going to sleep, pull WAKE_UP_PIN low to wake it (press the switch)"));
-  printMillis();   // show millis() across sleep, including Serial.flush()
+  printMillis();  // show millis() across sleep, including Serial.flush()
   testPoint_HIGH;  // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW in callback
   wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
   gpio_pin_wakeup_enable(GPIO_ID_PIN(WAKE_UP_PIN), GPIO_PIN_INTR_LOLEVEL);
   // only LOLEVEL or HILEVEL interrupts work, no edge, that's an SDK or CPU limitation
-  wifi_fpm_set_wakeup_cb(wakeupCallback);  // Set wakeup callback (optional)
+  wifi_fpm_set_wakeup_cb(wakeupCallback); // Set wakeup callback (optional)
   wifi_fpm_open();
-  wifi_fpm_do_sleep(0xFFFFFFF);   // only 0xFFFFFFF, any other value and it won't disconnect the RTC timer
-  delay(10);                      // it goes to sleep during this delay() and waits for an interrupt
+  wifi_fpm_do_sleep(0xFFFFFFF);  // only 0xFFFFFFF, any other value and it won't disconnect the RTC timer
+  delay(10);  // it goes to sleep during this delay() and waits for an interrupt
   Serial.println(F("Woke up!"));  // the interrupt callback hits before this is executed*/
 }
 
 void runTest7() {
   Serial.println(F("\n7th test - Deep Sleep for 10 seconds, reset and wake with RF_DEFAULT"));
-  initWiFi();     // initialize WiFi since we turned it off in the last test
+  initWiFi();  // initialize WiFi since we turned it off in the last test
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
   while (!digitalRead(WAKE_UP_PIN)) {  // wait for them to release the switch from the previous test
     delay(10);
   }
-  delay(50);                          // debounce time for the switch, pushbutton released
+  delay(50);  // debounce time for the switch, pushbutton released
   waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
-  digitalWrite(LED, LOW);             // turn the LED on, at least briefly
+  digitalWrite(LED, LOW);  // turn the LED on, at least briefly
   //WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep,
   // and no extended RFCAL as it goes into Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  printMillis();                         // show time difference across sleep
-  testPoint_HIGH;                        // testPoint set HIGH to track Deep Sleep period, cleared at startup()
-  ESP.deepSleep(10E6, WAKE_RF_DEFAULT);  // good night!  D0 fires a reset in 10 seconds...
+  printMillis();  // show time difference across sleep
+  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  ESP.deepSleep(10E6, WAKE_RF_DEFAULT); // good night!  D0 fires a reset in 10 seconds...
   // if you do ESP.deepSleep(0, mode); it needs a RESET to come out of sleep (RTC is disconnected)
   // maximum timed Deep Sleep interval ~ 3 to 4 hours depending on the RTC timer, see the README
   // the 2 uA GPIO amperage during Deep Sleep can't drive the LED so it's not lit now, although
@@ -312,9 +311,9 @@ void runTest8() {
   //WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep,
   // and no extended RFCAL as it goes into Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush();                                  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH;                                  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
-  ESP.deepSleep(10E6, WAKE_RFCAL);                 // good night!  D0 fires a reset in 10 seconds...
+  Serial.flush();  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  ESP.deepSleep(10E6, WAKE_RFCAL); // good night!  D0 fires a reset in 10 seconds...
   Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
@@ -323,11 +322,11 @@ void runTest9() {
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
   waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
-  WiFi.shutdown(nv->wss);             // Forced Modem Sleep for a more Instant Deep Sleep
+  WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush();                                  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH;                                  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
-  ESP.deepSleepInstant(10E6, WAKE_NO_RFCAL);       // good night!  D0 fires a reset in 10 seconds...
+  Serial.flush();  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  ESP.deepSleepInstant(10E6, WAKE_NO_RFCAL); // good night!  D0 fires a reset in 10 seconds...
   Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
@@ -338,9 +337,9 @@ void runTest10() {
   waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
   //WiFi.forceSleepBegin();  // Forced Modem Sleep for a more Instant Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush();                                  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH;                                  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
-  ESP.deepSleepInstant(10E6, WAKE_RF_DISABLED);    // good night!  D0 fires a reset in 10 seconds...
+  Serial.flush();  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  ESP.deepSleepInstant(10E6, WAKE_RF_DISABLED); // good night!  D0 fires a reset in 10 seconds...
   Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
@@ -362,25 +361,25 @@ void waitPushbutton(bool usesDelay, unsigned int delayTime) {  // loop until the
       }
       yield();  // this would be a good place for ArduinoOTA.handle();
     }
-  } else {                                   // long delay() for the 3 modes that need it, but it misses quick switch presses
-    while (digitalRead(WAKE_UP_PIN)) {       // wait for a pushbutton press
+  } else {  // long delay() for the 3 modes that need it, but it misses quick switch presses
+    while (digitalRead(WAKE_UP_PIN)) {  // wait for a pushbutton press
       digitalWrite(LED, !digitalRead(LED));  // toggle the activity LED
-      delay(delayTime);                      // another good place for ArduinoOTA.handle();
+      delay(delayTime);  // another good place for ArduinoOTA.handle();
       if (delayTime < 100) {
         altDelay.reset(100 - delayTime);  // pad the time < 100 mS with some real CPU cycles
-        while (!altDelay) {               // this simulates 'your program running', not delay() time
+        while (!altDelay) {  // this simulates 'your program running', not delay() time
         }
       }
     }
   }
-  delay(50);                           // debounce time for the switch, pushbutton pressed
+  delay(50);  // debounce time for the switch, pushbutton pressed
   while (!digitalRead(WAKE_UP_PIN)) {  // now wait for them to release the pushbutton
     delay(10);
   }
   delay(50);  // debounce time for the switch, pushbutton released
 }
 
-void readVoltage() {  // read internal VCC
+void readVoltage() { // read internal VCC
   float volts = ESP.getVcc();
   Serial.printf("The internal VCC reads %1.2f volts\n", volts / 1000);
 }
@@ -392,18 +391,18 @@ void printMillis() {
 }
 
 void updateRTCcrc() {  // updates the reset count CRC
-  nv->rtcData.crc32 = crc32((uint8_t*)&nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
+  nv->rtcData.crc32 = crc32((uint8_t*) &nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
 }
 
 void initWiFi() {
-  digitalWrite(LED, LOW);         // give a visual indication that we're alive but busy with WiFi
+  digitalWrite(LED, LOW);  // give a visual indication that we're alive but busy with WiFi
   uint32_t wifiBegin = millis();  // how long does it take to connect
-  if ((crc32((uint8_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss)) && !WiFi.shutdownValidCRC(nv->wss))) {
+  if ((crc32((uint8_t*) &nv->rtcData.rstCount + 1, sizeof(nv->wss)) && !WiFi.shutdownValidCRC(nv->wss))) {
     // if good copy of wss, overwrite invalid (primary) copy
-    memcpy((uint32_t*)&nv->wss, (uint32_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss));
+    memcpy((uint32_t*) &nv->wss, (uint32_t*) &nv->rtcData.rstCount + 1, sizeof(nv->wss));
   }
-  if (WiFi.shutdownValidCRC(nv->wss)) {                                                  // if we have a valid WiFi saved state
-    memcpy((uint32_t*)&nv->rtcData.rstCount + 1, (uint32_t*)&nv->wss, sizeof(nv->wss));  // save a copy of it
+  if (WiFi.shutdownValidCRC(nv->wss)) {  // if we have a valid WiFi saved state
+    memcpy((uint32_t*) &nv->rtcData.rstCount + 1, (uint32_t*) &nv->wss, sizeof(nv->wss)); // save a copy of it
     Serial.println(F("resuming WiFi"));
   }
   if (!(WiFi.resumeFromShutdown(nv->wss))) {  // couldn't resume, or no valid saved WiFi state yet
@@ -412,7 +411,7 @@ void initWiFi() {
       with other WiFi devices on your network. */
     WiFi.persistent(false);  // don't store the connection each time to save wear on the flash
     WiFi.mode(WIFI_STA);
-    WiFi.setOutputPower(10);                 // reduce RF output power, increase if it won't connect
+    WiFi.setOutputPower(10);  // reduce RF output power, increase if it won't connect
     WiFi.config(staticIP, gateway, subnet);  // if using static IP, enter parameters at the top
     WiFi.begin(AP_SSID, AP_PASS);
     Serial.print(F("connecting to WiFi "));
diff --git a/libraries/esp8266/examples/MMU48K/MMU48K.ino b/libraries/esp8266/examples/MMU48K/MMU48K.ino
index 6faeb15363..d75d91232b 100644
--- a/libraries/esp8266/examples/MMU48K/MMU48K.ino
+++ b/libraries/esp8266/examples/MMU48K/MMU48K.ino
@@ -4,21 +4,21 @@
 #include <umm_malloc/umm_heap_select.h>
 
 #if defined(CORE_MOCK)
-#define XCHAL_INSTRAM1_VADDR 0x40100000
+#define XCHAL_INSTRAM1_VADDR		0x40100000
 #else
-#include <sys/config.h>  // For config/core-isa.h
+#include <sys/config.h> // For config/core-isa.h
 #endif
 
-uint32_t timed_byte_read(char* pc, uint32_t* o);
-uint32_t timed_byte_read2(char* pc, uint32_t* o);
-int      divideA_B(int a, int b);
+uint32_t timed_byte_read(char *pc, uint32_t * o);
+uint32_t timed_byte_read2(char *pc, uint32_t * o);
+int divideA_B(int a, int b);
 
 int* nullPointer = NULL;
 
-char*  probe_b           = NULL;
-short* probe_s           = NULL;
-char*  probe_c           = (char*)0x40110000;
-short* unaligned_probe_s = NULL;
+char *probe_b  = NULL;
+short *probe_s = NULL;
+char *probe_c  = (char *)0x40110000;
+short *unaligned_probe_s = NULL;
 
 uint32_t read_var = 0x11223344;
 
@@ -30,19 +30,19 @@ uint32_t read_var = 0x11223344;
 */
 
 #if defined(MMU_IRAM_HEAP) || defined(MMU_SEC_HEAP)
-uint32_t* gobble;
-size_t    gobble_sz;
+uint32_t *gobble;
+size_t gobble_sz;
 
-#elif (MMU_IRAM_SIZE > 32 * 1024)
-uint32_t         gobble[4 * 1024] IRAM_ATTR;
+#elif (MMU_IRAM_SIZE > 32*1024)
+uint32_t gobble[4 * 1024] IRAM_ATTR;
 constexpr size_t gobble_sz = sizeof(gobble);
 
 #else
-uint32_t         gobble[256] IRAM_ATTR;
+uint32_t gobble[256] IRAM_ATTR;
 constexpr size_t gobble_sz = sizeof(gobble);
 #endif
 
-bool isValid(uint32_t* probe) {
+bool  isValid(uint32_t *probe) {
   bool rc = true;
   if (NULL == probe) {
     ets_uart_printf("\nNULL memory pointer %p ...\n", probe);
@@ -50,12 +50,11 @@ bool isValid(uint32_t* probe) {
   }
 
   ets_uart_printf("\nTesting for valid memory at %p ...\n", probe);
-  uint32_t savePS   = xt_rsil(15);
+  uint32_t savePS = xt_rsil(15);
   uint32_t saveData = *probe;
   for (size_t i = 0; i < 32; i++) {
     *probe = BIT(i);
-    asm volatile("" ::
-                     : "memory");
+    asm volatile("" ::: "memory");
     uint32_t val = *probe;
     if (val != BIT(i)) {
       ets_uart_printf("  Read 0x%08X != Wrote 0x%08X\n", val, (uint32_t)BIT(i));
@@ -68,8 +67,9 @@ bool isValid(uint32_t* probe) {
   return rc;
 }
 
-void dump_mem32(const void* addr, const size_t len) {
-  uint32_t* addr32 = (uint32_t*)addr;
+
+void dump_mem32(const void * addr, const size_t len) {
+  uint32_t *addr32 = (uint32_t *)addr;
   ets_uart_printf("\n");
   if ((uintptr_t)addr32 & 3) {
     ets_uart_printf("non-32-bit access\n");
@@ -122,6 +122,7 @@ void print_mmu_status(Print& oStream) {
 #endif
 }
 
+
 void setup() {
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
@@ -136,15 +137,15 @@ void setup() {
   {
     HeapSelectIram ephemeral;
     // Serial.printf_P(PSTR("ESP.getFreeHeap(): %u\n"), ESP.getFreeHeap());
-    gobble_sz = ESP.getFreeHeap() - UMM_OVERHEAD_ADJUST;  // - 4096;
-    gobble    = (uint32_t*)malloc(gobble_sz);
+    gobble_sz = ESP.getFreeHeap() - UMM_OVERHEAD_ADJUST; // - 4096;
+    gobble = (uint32_t *)malloc(gobble_sz);
   }
   Serial.printf_P(PSTR("\r\nmalloc() from IRAM Heap:\r\n"));
   Serial.printf_P(PSTR("  gobble_sz: %u\r\n"), gobble_sz);
   Serial.printf_P(PSTR("  gobble:    %p\r\n"), gobble);
 
 #elif defined(MMU_SEC_HEAP)
-  gobble    = (uint32_t*)MMU_SEC_HEAP;
+  gobble = (uint32_t *)MMU_SEC_HEAP;
   gobble_sz = MMU_SEC_HEAP_SIZE;
 #endif
 
@@ -164,40 +165,41 @@ void setup() {
 
   // Lets peak over the edge
   Serial.printf_P(PSTR("\r\nPeek over the edge of memory at 0x4010C000\r\n"));
-  dump_mem32((void*)(0x4010C000 - 16 * 4), 32);
+  dump_mem32((void *)(0x4010C000 - 16 * 4), 32);
+
+  probe_b = (char *)gobble;
+  probe_s = (short *)((uintptr_t)gobble);
+  unaligned_probe_s = (short *)((uintptr_t)gobble + 1);
 
-  probe_b           = (char*)gobble;
-  probe_s           = (short*)((uintptr_t)gobble);
-  unaligned_probe_s = (short*)((uintptr_t)gobble + 1);
 }
 
 void processKey(Print& out, int hotKey) {
   switch (hotKey) {
     case 't': {
-      uint32_t tmp;
-      out.printf_P(PSTR("Test how much time is added by exception handling"));
-      out.println();
-      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char*)0x40200003, &tmp), tmp);
-      out.println();
-      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char*)0x40200003, &tmp), tmp);
-      out.println();
-      out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char*)0x40108000, &tmp), tmp);
-      out.println();
-      out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char*)((uintptr_t)&read_var + 1), &tmp), tmp);
-      out.println();
-      out.printf_P(PSTR("Test how much time is used by the inline function method"));
-      out.println();
-      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)0x40200003, &tmp), tmp);
-      out.println();
-      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)0x40200003, &tmp), tmp);
-      out.println();
-      out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)0x40108000, &tmp), tmp);
-      out.println();
-      out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)((uintptr_t)&read_var + 1), &tmp), tmp);
-      out.println();
-      out.println();
-      break;
-    }
+        uint32_t tmp;
+        out.printf_P(PSTR("Test how much time is added by exception handling"));
+        out.println();
+        out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char *)0x40200003, &tmp), tmp);
+        out.println();
+        out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char *)0x40200003, &tmp), tmp);
+        out.println();
+        out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char *)0x40108000, &tmp), tmp);
+        out.println();
+        out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char *)((uintptr_t)&read_var + 1), &tmp), tmp);
+        out.println();
+        out.printf_P(PSTR("Test how much time is used by the inline function method"));
+        out.println();
+        out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)0x40200003, &tmp), tmp);
+        out.println();
+        out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)0x40200003, &tmp), tmp);
+        out.println();
+        out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)0x40108000, &tmp), tmp);
+        out.println();
+        out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)((uintptr_t)&read_var + 1), &tmp), tmp);
+        out.println();
+        out.println();
+        break;
+      }
     case '9':
       out.printf_P(PSTR("Unaligned exception by reading short"));
       out.println();
@@ -226,17 +228,17 @@ void processKey(Print& out, int hotKey) {
       out.println();
       break;
     case 'B': {
-      out.printf_P(PSTR("Load/Store exception by writing byte to iRAM"));
-      out.println();
-      char val = 0x55;
-      out.printf_P(PSTR("Write byte, 0x%02X, to iRAM at %p"), val, probe_b);
-      out.println();
-      out.flush();
-      probe_b[0] = val;
-      out.printf_P(PSTR("Read Byte back from iRAM, 0x%02X at %p"), probe_b[0], probe_b);
-      out.println();
-      break;
-    }
+        out.printf_P(PSTR("Load/Store exception by writing byte to iRAM"));
+        out.println();
+        char val = 0x55;
+        out.printf_P(PSTR("Write byte, 0x%02X, to iRAM at %p"), val, probe_b);
+        out.println();
+        out.flush();
+        probe_b[0] = val;
+        out.printf_P(PSTR("Read Byte back from iRAM, 0x%02X at %p"), probe_b[0], probe_b);
+        out.println();
+        break;
+      }
     case 's':
       out.printf_P(PSTR("Load/Store exception by reading short from iRAM"));
       out.println();
@@ -245,17 +247,17 @@ void processKey(Print& out, int hotKey) {
       out.println();
       break;
     case 'S': {
-      out.printf_P(PSTR("Load/Store exception by writing short to iRAM"));
-      out.println();
-      short int val = 0x0AA0;
-      out.printf_P(PSTR("Write short, 0x%04X, to iRAM at %p"), val, probe_s);
-      out.println();
-      out.flush();
-      probe_s[0] = val;
-      out.printf_P(PSTR("Read short back from iRAM, 0x%04X at %p"), probe_s[0], probe_s);
-      out.println();
-      break;
-    }
+        out.printf_P(PSTR("Load/Store exception by writing short to iRAM"));
+        out.println();
+        short int val = 0x0AA0;
+        out.printf_P(PSTR("Write short, 0x%04X, to iRAM at %p"), val, probe_s);
+        out.println();
+        out.flush();
+        probe_s[0] = val;
+        out.printf_P(PSTR("Read short back from iRAM, 0x%04X at %p"), probe_s[0], probe_s);
+        out.println();
+        break;
+      }
     case 'R':
       out.printf_P(PSTR("Restart, ESP.restart(); ..."));
       out.println();
@@ -308,6 +310,7 @@ void processKey(Print& out, int hotKey) {
   }
 }
 
+
 void serialClientLoop(void) {
   if (Serial.available() > 0) {
     int hotKey = Serial.read();
@@ -319,6 +322,7 @@ void loop() {
   serialClientLoop();
 }
 
+
 int __attribute__((noinline)) divideA_B(int a, int b) {
   return (a / b);
 }
diff --git a/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino b/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
index ce72d96f74..f6c2df08fc 100644
--- a/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
+++ b/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
@@ -12,13 +12,15 @@
   This example code is in the public domain.
 */
 
+
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
 // initial time (possibly given by an external RTC)
-#define RTC_UTC_TEST 1510592825  // 1510592825 = Monday 13 November 2017 17:07:05 UTC
+#define RTC_UTC_TEST 1510592825 // 1510592825 = Monday 13 November 2017 17:07:05 UTC
+
 
 // This database is autogenerated from IANA timezone database
 //    https://www.iana.org/time-zones
@@ -42,29 +44,29 @@
 ////////////////////////////////////////////////////////
 
 #include <ESP8266WiFi.h>
-#include <coredecls.h>  // settimeofday_cb()
+#include <coredecls.h>                  // settimeofday_cb()
 #include <Schedule.h>
 #include <PolledTimeout.h>
 
-#include <time.h>      // time() ctime()
-#include <sys/time.h>  // struct timeval
+#include <time.h>                       // time() ctime()
+#include <sys/time.h>                   // struct timeval
 
-#include <sntp.h>  // sntp_servermode_dhcp()
+#include <sntp.h>                       // sntp_servermode_dhcp()
 
 // for testing purpose:
-extern "C" int clock_gettime(clockid_t unused, struct timespec* tp);
+extern "C" int clock_gettime(clockid_t unused, struct timespec *tp);
 
 ////////////////////////////////////////////////////////
 
-static timeval  tv;
+static timeval tv;
 static timespec tp;
-static time_t   now;
+static time_t now;
 static uint32_t now_ms, now_us;
 
 static esp8266::polledTimeout::periodicMs showTimeNow(60000);
-static int                                time_machine_days     = 0;  // 0 = present
-static bool                               time_machine_running  = false;
-static bool                               time_machine_run_once = false;
+static int time_machine_days = 0; // 0 = present
+static bool time_machine_running = false;
+static bool time_machine_run_once = false;
 
 // OPTIONAL: change SNTP startup delay
 // a weak function is already defined and returns 0 (RFC violation)
@@ -84,27 +86,21 @@ static bool                               time_machine_run_once = false;
 //    return 15000; // 15s
 //}
 
-#define PTM(w)              \
+#define PTM(w) \
   Serial.print(" " #w "="); \
   Serial.print(tm->tm_##w);
 
 void printTm(const char* what, const tm* tm) {
   Serial.print(what);
-  PTM(isdst);
-  PTM(yday);
-  PTM(wday);
-  PTM(year);
-  PTM(mon);
-  PTM(mday);
-  PTM(hour);
-  PTM(min);
-  PTM(sec);
+  PTM(isdst); PTM(yday); PTM(wday);
+  PTM(year);  PTM(mon);  PTM(mday);
+  PTM(hour);  PTM(min);  PTM(sec);
 }
 
 void showTime() {
   gettimeofday(&tv, nullptr);
   clock_gettime(0, &tp);
-  now    = time(nullptr);
+  now = time(nullptr);
   now_ms = millis();
   now_us = micros();
 
@@ -139,7 +135,7 @@ void showTime() {
   Serial.println((uint32_t)now);
 
   // timezone and demo in the future
-  Serial.printf("timezone:  %s\n", getenv("TZ") ?: "(none)");
+  Serial.printf("timezone:  %s\n", getenv("TZ") ? : "(none)");
 
   // human readable
   Serial.print("ctime:     ");
@@ -147,7 +143,7 @@ void showTime() {
 
   // lwIP v2 is able to list more details about the currently configured SNTP servers
   for (int i = 0; i < SNTP_MAX_SERVERS; i++) {
-    IPAddress   sntp = *sntp_getserver(i);
+    IPAddress sntp = *sntp_getserver(i);
     const char* name = sntp_getservername(i);
     if (sntp.isSet()) {
       Serial.printf("sntp%d:     ", i);
@@ -166,7 +162,7 @@ void showTime() {
 
   // show subsecond synchronisation
   timeval prevtv;
-  time_t  prevtime = time(nullptr);
+  time_t prevtime = time(nullptr);
   gettimeofday(&prevtv, nullptr);
 
   while (true) {
@@ -194,7 +190,7 @@ void time_is_set(bool from_sntp /* <= this parameter is optional */) {
   if (time_machine_days == 0) {
     if (time_machine_running) {
       time_machine_run_once = true;
-      time_machine_running  = false;
+      time_machine_running = false;
     } else {
       time_machine_running = from_sntp && !time_machine_run_once;
     }
@@ -214,7 +210,7 @@ void time_is_set(bool from_sntp /* <= this parameter is optional */) {
 
   // time machine demo
   if (time_machine_running) {
-    now          = time(nullptr);
+    now = time(nullptr);
     const tm* tm = localtime(&now);
     Serial.printf(": future=%3ddays: DST=%s - ",
                   time_machine_days,
@@ -251,8 +247,8 @@ void setup() {
   // setup RTC time
   // it will be used until NTP server will send us real current time
   Serial.println("Manually setting some time from some RTC:");
-  time_t  rtc = RTC_UTC_TEST;
-  timeval tv  = { rtc, 0 };
+  time_t rtc = RTC_UTC_TEST;
+  timeval tv = { rtc, 0 };
   settimeofday(&tv, nullptr);
 
   // NTP servers may be overridden by your DHCP server for a more local one
diff --git a/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino b/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
index b96067b800..9736995c74 100644
--- a/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
+++ b/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
@@ -13,7 +13,7 @@
 // This example code is in the public domain.
 
 // CRC function used to ensure data validity
-uint32_t calculateCRC32(const uint8_t* data, size_t length);
+uint32_t calculateCRC32(const uint8_t *data, size_t length);
 
 // helper function to dump memory contents as hex
 void printMemory();
@@ -23,10 +23,9 @@ void printMemory();
 // rest of structure contents.
 // Any fields can go after CRC32.
 // We use byte array as an example.
-struct
-{
+struct {
   uint32_t crc32;
-  byte     data[508];
+  byte data[508];
 } rtcData;
 
 void setup() {
@@ -35,11 +34,11 @@ void setup() {
   delay(1000);
 
   // Read struct from RTC memory
-  if (ESP.rtcUserMemoryRead(0, (uint32_t*)&rtcData, sizeof(rtcData))) {
+  if (ESP.rtcUserMemoryRead(0, (uint32_t*) &rtcData, sizeof(rtcData))) {
     Serial.println("Read: ");
     printMemory();
     Serial.println();
-    uint32_t crcOfData = calculateCRC32((uint8_t*)&rtcData.data[0], sizeof(rtcData.data));
+    uint32_t crcOfData = calculateCRC32((uint8_t*) &rtcData.data[0], sizeof(rtcData.data));
     Serial.print("CRC32 of data: ");
     Serial.println(crcOfData, HEX);
     Serial.print("CRC32 read from RTC: ");
@@ -56,9 +55,9 @@ void setup() {
     rtcData.data[i] = random(0, 128);
   }
   // Update CRC32 of data
-  rtcData.crc32 = calculateCRC32((uint8_t*)&rtcData.data[0], sizeof(rtcData.data));
+  rtcData.crc32 = calculateCRC32((uint8_t*) &rtcData.data[0], sizeof(rtcData.data));
   // Write struct to RTC memory
-  if (ESP.rtcUserMemoryWrite(0, (uint32_t*)&rtcData, sizeof(rtcData))) {
+  if (ESP.rtcUserMemoryWrite(0, (uint32_t*) &rtcData, sizeof(rtcData))) {
     Serial.println("Write: ");
     printMemory();
     Serial.println();
@@ -71,7 +70,7 @@ void setup() {
 void loop() {
 }
 
-uint32_t calculateCRC32(const uint8_t* data, size_t length) {
+uint32_t calculateCRC32(const uint8_t *data, size_t length) {
   uint32_t crc = 0xffffffff;
   while (length--) {
     uint8_t c = *data++;
@@ -91,8 +90,8 @@ uint32_t calculateCRC32(const uint8_t* data, size_t length) {
 
 //prints all rtcData, including the leading crc32
 void printMemory() {
-  char     buf[3];
-  uint8_t* ptr = (uint8_t*)&rtcData;
+  char buf[3];
+  uint8_t *ptr = (uint8_t *)&rtcData;
   for (size_t i = 0; i < sizeof(rtcData); i++) {
     sprintf(buf, "%02X", ptr[i]);
     Serial.print(buf);
diff --git a/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino b/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
index 2b1cd01129..61967c691f 100644
--- a/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
+++ b/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
@@ -1,4 +1,4 @@
-#define TIMEOUT (10000UL)  // Maximum time to wait for serial activity to start
+#define TIMEOUT (10000UL)     // Maximum time to wait for serial activity to start
 
 void setup() {
   // put your setup code here, to run once:
@@ -29,4 +29,6 @@ void setup() {
 
 void loop() {
   // put your main code here, to run repeatedly:
+
 }
+
diff --git a/libraries/esp8266/examples/SerialStress/SerialStress.ino b/libraries/esp8266/examples/SerialStress/SerialStress.ino
index 4e34da7201..a19eb9f270 100644
--- a/libraries/esp8266/examples/SerialStress/SerialStress.ino
+++ b/libraries/esp8266/examples/SerialStress/SerialStress.ino
@@ -11,25 +11,25 @@
 #include <ESP8266WiFi.h>
 #include <SoftwareSerial.h>
 
-#define SSBAUD 115200        // logger on console for humans
-#define BAUD 3000000         // hardware serial stress test
-#define BUFFER_SIZE 4096     // may be useless to use more than 2*SERIAL_SIZE_RX
-#define SERIAL_SIZE_RX 1024  // Serial.setRxBufferSize()
+#define SSBAUD          115200  // logger on console for humans
+#define BAUD            3000000 // hardware serial stress test
+#define BUFFER_SIZE     4096    // may be useless to use more than 2*SERIAL_SIZE_RX
+#define SERIAL_SIZE_RX  1024    // Serial.setRxBufferSize()
 
-#define FAKE_INCREASED_AVAILABLE 100  // test readBytes's timeout
+#define FAKE_INCREASED_AVAILABLE 100 // test readBytes's timeout
 
 #define TIMEOUT 5000
-#define DEBUG(x...)  //x
+#define DEBUG(x...) //x
 
-uint8_t buf[BUFFER_SIZE];
-uint8_t temp[BUFFER_SIZE];
-bool    reading              = true;
-size_t  testReadBytesTimeout = 0;
+uint8_t buf [BUFFER_SIZE];
+uint8_t temp [BUFFER_SIZE];
+bool reading = true;
+size_t testReadBytesTimeout = 0;
 
-static size_t   out_idx = 0, in_idx = 0;
-static size_t   local_receive_size = 0;
-static size_t   size_for_1sec, size_for_led = 0;
-static size_t   maxavail = 0;
+static size_t out_idx = 0, in_idx = 0;
+static size_t local_receive_size = 0;
+static size_t size_for_1sec, size_for_led = 0;
+static size_t maxavail = 0;
 static uint64_t in_total = 0, in_prev = 0;
 static uint64_t start_ms, last_ms;
 static uint64_t timeout;
@@ -61,7 +61,7 @@ void setup() {
   pinMode(LED_BUILTIN, OUTPUT);
 
   Serial.begin(BAUD);
-  Serial.swap();  // RX=GPIO13 TX=GPIO15
+  Serial.swap(); // RX=GPIO13 TX=GPIO15
   Serial.setRxBufferSize(SERIAL_SIZE_RX);
 
   // using HardwareSerial0 pins,
@@ -78,7 +78,7 @@ void setup() {
   logger->printf("\n\nBAUD: %d - CoreRxBuffer: %d bytes - TestBuffer: %d bytes\n",
                  baud, SERIAL_SIZE_RX, BUFFER_SIZE);
 
-  size_for_1sec = baud / 10;  // 8n1=10baudFor8bits
+  size_for_1sec = baud / 10; // 8n1=10baudFor8bits
   logger->printf("led changes state every %zd bytes (= 1 second)\n", size_for_1sec);
   logger->printf("press 's' to stop reading, not writing (induces overrun)\n");
   logger->printf("press 't' to toggle timeout testing on readBytes\n");
@@ -91,8 +91,7 @@ void setup() {
   // bind RX and TX
   USC0(0) |= (1 << UCLBE);
 
-  while (Serial.read() == -1)
-    ;
+  while (Serial.read() == -1);
   if (Serial.hasOverrun()) {
     logger->print("overrun?\n");
   }
@@ -108,7 +107,9 @@ void loop() {
     maxlen = BUFFER_SIZE - out_idx;
   }
   // check if not cycling more than buffer size relatively to input
-  size_t in_out = out_idx == in_idx ? BUFFER_SIZE : (in_idx + BUFFER_SIZE - out_idx - 1) % BUFFER_SIZE;
+  size_t in_out = out_idx == in_idx ?
+                  BUFFER_SIZE :
+                  (in_idx + BUFFER_SIZE - out_idx - 1) % BUFFER_SIZE;
   if (maxlen > in_out) {
     maxlen = in_out;
   }
@@ -169,9 +170,9 @@ void loop() {
       error("receiving nothing?\n");
     }
 
-    unsigned long now_ms     = millis();
-    int           bwkbps_avg = ((((uint64_t)in_total) * 8000) / (now_ms - start_ms)) >> 10;
-    int           bwkbps_now = (((in_total - in_prev) * 8000) / (now_ms - last_ms)) >> 10;
+    unsigned long now_ms = millis();
+    int bwkbps_avg = ((((uint64_t)in_total) * 8000) / (now_ms - start_ms)) >> 10;
+    int bwkbps_now = (((in_total - in_prev) * 8000) / (now_ms - last_ms)) >> 10 ;
     logger->printf("bwavg=%d bwnow=%d kbps maxavail=%i\n", bwkbps_avg, bwkbps_now, maxavail);
 
     in_prev = in_total;
diff --git a/libraries/esp8266/examples/StreamString/StreamString.ino b/libraries/esp8266/examples/StreamString/StreamString.ino
index d4571a0bfb..c9c6b46025 100644
--- a/libraries/esp8266/examples/StreamString/StreamString.ino
+++ b/libraries/esp8266/examples/StreamString/StreamString.ino
@@ -21,10 +21,10 @@ void checksketch(const char* what, const char* res1, const char* res2) {
 #endif
 
 void testStringPtrProgmem() {
-  static const char inProgmem[] PROGMEM = "I am in progmem";
-  auto              inProgmem2          = F("I am too in progmem");
+  static const char inProgmem [] PROGMEM = "I am in progmem";
+  auto inProgmem2 = F("I am too in progmem");
 
-  int  heap    = (int)ESP.getFreeHeap();
+  int heap = (int)ESP.getFreeHeap();
   auto stream1 = StreamConstPtr(inProgmem, sizeof(inProgmem) - 1);
   auto stream2 = StreamConstPtr(inProgmem2);
   Serial << stream1 << " - " << stream2 << "\n";
@@ -33,7 +33,7 @@ void testStringPtrProgmem() {
 }
 
 void testStreamString() {
-  String       inputString = "hello";
+  String inputString = "hello";
   StreamString result;
 
   // By default, reading a S2Stream(String) or a StreamString will consume the String.
@@ -46,6 +46,7 @@ void testStreamString() {
   // In non-default non-consume mode, it will just move a pointer.  That one
   // can be ::resetPointer(pos) anytime.  See the example below.
 
+
   // The String included in 'result' will not be modified by read:
   // (this is not the default)
   result.resetPointer();
@@ -109,7 +110,7 @@ void testStreamString() {
     result.clear();
     S2Stream input(inputString);
     // reading stream will consume the string
-    input.setConsume();  // can be omitted, this is the default
+    input.setConsume(); // can be omitted, this is the default
 
     input.sendSize(result, 1);
     input.sendSize(result, 2);
@@ -154,7 +155,7 @@ void testStreamString() {
 
   // .. but it does when S2Stream or StreamString is used
   {
-    int  heap   = (int)ESP.getFreeHeap();
+    int heap = (int)ESP.getFreeHeap();
     auto stream = StreamString(F("I am in progmem"));
     Serial << stream << "\n";
     heap -= (int)ESP.getFreeHeap();
diff --git a/libraries/esp8266/examples/TestEspApi/TestEspApi.ino b/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
index dd7727f9b7..49ff525898 100644
--- a/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
+++ b/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
@@ -28,7 +28,7 @@ Stream& ehConsolePort(Serial);
 // UNLESS: You swap the TX pin using the alternate pinout.
 const uint8_t LED_PIN = 1;
 
-const char* const RST_REASONS[] = {
+const char * const RST_REASONS[] = {
   "REASON_DEFAULT_RST",
   "REASON_WDT_RST",
   "REASON_EXCEPTION_RST",
@@ -38,7 +38,7 @@ const char* const RST_REASONS[] = {
   "REASON_EXT_SYS_RST"
 };
 
-const char* const FLASH_SIZE_MAP_NAMES[] = {
+const char * const FLASH_SIZE_MAP_NAMES[] = {
   "FLASH_SIZE_4M_MAP_256_256",
   "FLASH_SIZE_2M",
   "FLASH_SIZE_8M_MAP_512_512",
@@ -48,14 +48,14 @@ const char* const FLASH_SIZE_MAP_NAMES[] = {
   "FLASH_SIZE_32M_MAP_1024_1024"
 };
 
-const char* const OP_MODE_NAMES[] {
+const char * const OP_MODE_NAMES[] {
   "NULL_MODE",
   "STATION_MODE",
   "SOFTAP_MODE",
   "STATIONAP_MODE"
 };
 
-const char* const AUTH_MODE_NAMES[] {
+const char * const AUTH_MODE_NAMES[] {
   "AUTH_OPEN",
   "AUTH_WEP",
   "AUTH_WPA_PSK",
@@ -64,14 +64,14 @@ const char* const AUTH_MODE_NAMES[] {
   "AUTH_MAX"
 };
 
-const char* const PHY_MODE_NAMES[] {
+const char * const PHY_MODE_NAMES[] {
   "",
   "PHY_MODE_11B",
   "PHY_MODE_11G",
   "PHY_MODE_11N"
 };
 
-const char* const EVENT_NAMES[] {
+const char * const EVENT_NAMES[] {
   "EVENT_STAMODE_CONNECTED",
   "EVENT_STAMODE_DISCONNECTED",
   "EVENT_STAMODE_AUTHMODE_CHANGE",
@@ -81,7 +81,7 @@ const char* const EVENT_NAMES[] {
   "EVENT_MAX"
 };
 
-const char* const EVENT_REASONS[] {
+const char * const EVENT_REASONS[] {
   "",
   "REASON_UNSPECIFIED",
   "REASON_AUTH_EXPIRE",
@@ -108,12 +108,12 @@ const char* const EVENT_REASONS[] {
   "REASON_CIPHER_SUITE_REJECTED",
 };
 
-const char* const EVENT_REASONS_200[] {
+const char * const EVENT_REASONS_200[] {
   "REASON_BEACON_TIMEOUT",
   "REASON_NO_AP_FOUND"
 };
 
-void wifi_event_handler_cb(System_Event_t* event) {
+void wifi_event_handler_cb(System_Event_t * event) {
   ehConsolePort.print(EVENT_NAMES[event->event]);
   ehConsolePort.print(" (");
 
@@ -128,26 +128,27 @@ void wifi_event_handler_cb(System_Event_t* event) {
       break;
     case EVENT_SOFTAPMODE_STACONNECTED:
     case EVENT_SOFTAPMODE_STADISCONNECTED: {
-      char mac[32] = { 0 };
-      snprintf(mac, 32, MACSTR ", aid: %d", MAC2STR(event->event_info.sta_connected.mac), event->event_info.sta_connected.aid);
+        char mac[32] = {0};
+        snprintf(mac, 32, MACSTR ", aid: %d", MAC2STR(event->event_info.sta_connected.mac), event->event_info.sta_connected.aid);
 
-      ehConsolePort.print(mac);
-    } break;
+        ehConsolePort.print(mac);
+      }
+      break;
   }
 
   ehConsolePort.println(")");
 }
 
-void print_softap_config(Stream& consolePort, softap_config const& config) {
+void print_softap_config(Stream & consolePort, softap_config const& config) {
   consolePort.println();
   consolePort.println(F("SoftAP Configuration"));
   consolePort.println(F("--------------------"));
 
   consolePort.print(F("ssid:            "));
-  consolePort.println((char*)config.ssid);
+  consolePort.println((char *) config.ssid);
 
   consolePort.print(F("password:        "));
-  consolePort.println((char*)config.password);
+  consolePort.println((char *) config.password);
 
   consolePort.print(F("ssid_len:        "));
   consolePort.println(config.ssid_len);
@@ -172,8 +173,8 @@ void print_softap_config(Stream& consolePort, softap_config const& config) {
   consolePort.println();
 }
 
-void print_system_info(Stream& consolePort) {
-  const rst_info* resetInfo = system_get_rst_info();
+void print_system_info(Stream & consolePort) {
+  const rst_info * resetInfo = system_get_rst_info();
   consolePort.print(F("system_get_rst_info() reset reason: "));
   consolePort.println(RST_REASONS[resetInfo->reason]);
 
@@ -210,7 +211,7 @@ void print_system_info(Stream& consolePort) {
   consolePort.println(FLASH_SIZE_MAP_NAMES[system_get_flash_size_map()]);
 }
 
-void print_wifi_general(Stream& consolePort) {
+void print_wifi_general(Stream & consolePort) {
   consolePort.print(F("wifi_get_channel(): "));
   consolePort.println(wifi_get_channel());
 
@@ -218,8 +219,8 @@ void print_wifi_general(Stream& consolePort) {
   consolePort.println(PHY_MODE_NAMES[wifi_get_phy_mode()]);
 }
 
-void secure_softap_config(softap_config* config, const char* ssid, const char* password) {
-  size_t ssidLen     = strlen(ssid) < sizeof(config->ssid) ? strlen(ssid) : sizeof(config->ssid);
+void secure_softap_config(softap_config * config, const char * ssid, const char * password) {
+  size_t ssidLen     = strlen(ssid)     < sizeof(config->ssid)     ? strlen(ssid)     : sizeof(config->ssid);
   size_t passwordLen = strlen(password) < sizeof(config->password) ? strlen(password) : sizeof(config->password);
 
   memset(config->ssid, 0, sizeof(config->ssid));
@@ -292,3 +293,4 @@ void loop() {
   Serial.println(system_get_time());
   delay(1000);
 }
+
diff --git a/libraries/esp8266/examples/UartDownload/UartDownload.ino b/libraries/esp8266/examples/UartDownload/UartDownload.ino
index 6d86441998..cf581c8890 100644
--- a/libraries/esp8266/examples/UartDownload/UartDownload.ino
+++ b/libraries/esp8266/examples/UartDownload/UartDownload.ino
@@ -59,10 +59,11 @@ constexpr char slipFrameMarker = '\xC0';
 //   <0xC0><cmd><payload length><32 bit cksum><payload data ...><0xC0>
 // Slip packet for ESP_SYNC, minus the frame markers ('\xC0') captured from
 // esptool using the `--trace` option.
-const char syncPkt[] PROGMEM = "\x00\x08\x24\x00\x00\x00\x00\x00\x07\x07\x12\x20"
-                               "UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU";
+const char syncPkt[] PROGMEM =
+  "\x00\x08\x24\x00\x00\x00\x00\x00\x07\x07\x12\x20"
+  "UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU";
 
-constexpr size_t syncPktSz = sizeof(syncPkt) - 1;  // Don't compare zero terminator char
+constexpr size_t syncPktSz = sizeof(syncPkt) - 1; // Don't compare zero terminator char
 
 //
 //  Use the discovery of an ESP_SYNC packet, to trigger calling UART Download
@@ -89,7 +90,7 @@ void proxyEspSync() {
   }
 
   // Assume RX FIFO data is garbled and flush all RX data.
-  while (0 <= Serial.read()) { }  // Clear FIFO
+  while (0 <= Serial.read()) {} // Clear FIFO
 
   // If your Serial requirements need a specific timeout value, you would
   // restore those here.
@@ -111,12 +112,12 @@ void setup() {
   Serial.begin(115200);
 
   Serial.println(F(
-      "\r\n\r\n"
-      "Boot UART Download Demo - initialization started.\r\n"
-      "\r\n"
-      "For a quick test to see the UART Download work,\r\n"
-      "stop your serial terminal APP and run:\r\n"
-      "  esptool.py --chip esp8266 --before no_reset --after soft_reset flash_id\r\n"));
+                   "\r\n\r\n"
+                   "Boot UART Download Demo - initialization started.\r\n"
+                   "\r\n"
+                   "For a quick test to see the UART Download work,\r\n"
+                   "stop your serial terminal APP and run:\r\n"
+                   "  esptool.py --chip esp8266 --before no_reset --after soft_reset flash_id\r\n"));
 
   // ...
 }
@@ -142,7 +143,7 @@ void cmdLoop(Print& oStream, int key) {
       ESP.restart();
       break;
 
-      // ...
+    // ...
 
     case '?':
       oStream.println(F("\r\nHot key help:"));
@@ -161,7 +162,9 @@ void cmdLoop(Print& oStream, int key) {
   oStream.println();
 }
 
+
 void loop() {
+
   // In this example, we can have Serial data from a user keystroke for our
   // command loop or the esptool trying to SYNC up for flashing.  If the
   // character matches the Slip Frame Marker (the 1st byte of the SYNC packet),
diff --git a/libraries/esp8266/examples/interactive/interactive.ino b/libraries/esp8266/examples/interactive/interactive.ino
index 1206dba83d..b3bd1ff931 100644
--- a/libraries/esp8266/examples/interactive/interactive.ino
+++ b/libraries/esp8266/examples/interactive/interactive.ino
@@ -12,11 +12,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
-const char* SSID = STASSID;
-const char* PSK  = STAPSK;
+const char * SSID = STASSID;
+const char * PSK = STAPSK;
 
 IPAddress staticip(192, 168, 1, 123);
 IPAddress gateway(192, 168, 1, 254);
@@ -36,14 +36,15 @@ void setup() {
   Serial.println();
   Serial.println(WiFi.localIP());
   Serial.print(
-      "WL_IDLE_STATUS      = 0\n"
-      "WL_NO_SSID_AVAIL    = 1\n"
-      "WL_SCAN_COMPLETED   = 2\n"
-      "WL_CONNECTED        = 3\n"
-      "WL_CONNECT_FAILED   = 4\n"
-      "WL_CONNECTION_LOST  = 5\n"
-      "WL_WRONG_PASSWORD   = 6\n"
-      "WL_DISCONNECTED     = 7\n");
+    "WL_IDLE_STATUS      = 0\n"
+    "WL_NO_SSID_AVAIL    = 1\n"
+    "WL_SCAN_COMPLETED   = 2\n"
+    "WL_CONNECTED        = 3\n"
+    "WL_CONNECT_FAILED   = 4\n"
+    "WL_CONNECTION_LOST  = 5\n"
+    "WL_WRONG_PASSWORD   = 6\n"
+    "WL_DISCONNECTED     = 7\n"
+  );
 }
 
 void WiFiOn() {
@@ -62,18 +63,11 @@ void WiFiOff() {
 }
 
 void loop() {
-#define TEST(name, var, varinit, func)   \
+#define TEST(name, var, varinit, func) \
   static decltype(func) var = (varinit); \
-  if ((var) != (func)) {                 \
-    var = (func);                        \
-    Serial.printf("**** %s: ", name);    \
-    Serial.println(var);                 \
-  }
+  if ((var) != (func)) { var = (func); Serial.printf("**** %s: ", name); Serial.println(var); }
 
-#define DO(x...)         \
-  Serial.println(F(#x)); \
-  x;                     \
-  break
+#define DO(x...) Serial.println(F( #x )); x; break
 
   TEST("Free Heap", freeHeap, 0, ESP.getFreeHeap());
   TEST("WiFiStatus", status, WL_IDLE_STATUS, WiFi.status());
@@ -81,41 +75,23 @@ void loop() {
   TEST("AP-IP", apIp, (uint32_t)0, WiFi.softAPIP());
 
   switch (Serial.read()) {
-    case 'F':
-      DO(WiFiOff());
-    case 'N':
-      DO(WiFiOn());
-    case '1':
-      DO(WiFi.mode(WIFI_AP));
-    case '2':
-      DO(WiFi.mode(WIFI_AP_STA));
-    case '3':
-      DO(WiFi.mode(WIFI_STA));
-    case 'R':
-      DO(if (((GPI >> 16) & 0xf) == 1) ESP.reset() /* else must hard reset */);
-    case 'd':
-      DO(WiFi.disconnect());
-    case 'b':
-      DO(WiFi.begin());
-    case 'B':
-      DO(WiFi.begin(SSID, PSK));
-    case 'r':
-      DO(WiFi.reconnect());
-    case 'c':
-      DO(wifi_station_connect());
-    case 'a':
-      DO(WiFi.setAutoReconnect(false));
-    case 'A':
-      DO(WiFi.setAutoReconnect(true));
-    case 'n':
-      DO(WiFi.setSleepMode(WIFI_NONE_SLEEP));
-    case 'l':
-      DO(WiFi.setSleepMode(WIFI_LIGHT_SLEEP));
-    case 'm':
-      DO(WiFi.setSleepMode(WIFI_MODEM_SLEEP));
-    case 'S':
-      DO(WiFi.config(staticip, gateway, subnet));  // use static address
-    case 's':
-      DO(WiFi.config(0u, 0u, 0u));  // back to dhcp client
+    case 'F': DO(WiFiOff());
+    case 'N': DO(WiFiOn());
+    case '1': DO(WiFi.mode(WIFI_AP));
+    case '2': DO(WiFi.mode(WIFI_AP_STA));
+    case '3': DO(WiFi.mode(WIFI_STA));
+    case 'R': DO(if (((GPI >> 16) & 0xf) == 1) ESP.reset() /* else must hard reset */);
+    case 'd': DO(WiFi.disconnect());
+    case 'b': DO(WiFi.begin());
+    case 'B': DO(WiFi.begin(SSID, PSK));
+    case 'r': DO(WiFi.reconnect());
+    case 'c': DO(wifi_station_connect());
+    case 'a': DO(WiFi.setAutoReconnect(false));
+    case 'A': DO(WiFi.setAutoReconnect(true));
+    case 'n': DO(WiFi.setSleepMode(WIFI_NONE_SLEEP));
+    case 'l': DO(WiFi.setSleepMode(WIFI_LIGHT_SLEEP));
+    case 'm': DO(WiFi.setSleepMode(WIFI_MODEM_SLEEP));
+    case 'S': DO(WiFi.config(staticip, gateway, subnet)); // use static address
+    case 's': DO(WiFi.config(0u, 0u, 0u));                // back to dhcp client
   }
 }
diff --git a/libraries/esp8266/examples/irammem/irammem.ino b/libraries/esp8266/examples/irammem/irammem.ino
index ea9597bee8..5cd1db7b36 100644
--- a/libraries/esp8266/examples/irammem/irammem.ino
+++ b/libraries/esp8266/examples/irammem/irammem.ino
@@ -9,6 +9,7 @@
 
 // #define USE_SET_IRAM_HEAP
 
+
 #ifndef ETS_PRINTF
 #define ETS_PRINTF ets_uart_printf
 #endif
@@ -20,8 +21,9 @@
 
 #pragma GCC push_options
 // reference
-#pragma GCC                    optimize("O0")  // We expect -O0 to generate the correct results
-__attribute__((noinline)) void aliasTestReference(uint16_t* x) {
+#pragma GCC optimize("O0")   // We expect -O0 to generate the correct results
+__attribute__((noinline))
+void aliasTestReference(uint16_t *x) {
   // Without adhearance to strict-aliasing, this sequence of code would fail
   // when optimized by GCC Version 10.3
   size_t len = 3;
@@ -33,8 +35,9 @@ __attribute__((noinline)) void aliasTestReference(uint16_t* x) {
   }
 }
 // Tests
-#pragma GCC                    optimize("Os")
-__attribute__((noinline)) void aliasTestOs(uint16_t* x) {
+#pragma GCC optimize("Os")
+__attribute__((noinline))
+void aliasTestOs(uint16_t *x) {
   size_t len = 3;
   for (size_t u = 0; u < len; u++) {
     uint16_t x1 = mmu_get_uint16(&x[0]);
@@ -43,8 +46,9 @@ __attribute__((noinline)) void aliasTestOs(uint16_t* x) {
     }
   }
 }
-#pragma GCC                    optimize("O2")
-__attribute__((noinline)) void aliasTestO2(uint16_t* x) {
+#pragma GCC optimize("O2")
+__attribute__((noinline))
+void aliasTestO2(uint16_t *x) {
   size_t len = 3;
   for (size_t u = 0; u < len; u++) {
     uint16_t x1 = mmu_get_uint16(&x[0]);
@@ -53,8 +57,9 @@ __attribute__((noinline)) void aliasTestO2(uint16_t* x) {
     }
   }
 }
-#pragma GCC                    optimize("O3")
-__attribute__((noinline)) void aliasTestO3(uint16_t* x) {
+#pragma GCC optimize("O3")
+__attribute__((noinline))
+void aliasTestO3(uint16_t *x) {
   size_t len = 3;
   for (size_t u = 0; u < len; u++) {
     uint16_t x1 = mmu_get_uint16(&x[0]);
@@ -69,8 +74,7 @@ __attribute__((noinline)) void aliasTestO3(uint16_t* x) {
 // the exception handler. For this case the -O0 version will appear faster.
 #pragma GCC optimize("O0")
 __attribute__((noinline)) IRAM_ATTR
-    uint32_t
-    timedRead_Reference(uint8_t* res) {
+uint32_t timedRead_Reference(uint8_t *res) {
   // This test case was verified with GCC 10.3
   // There is a code case that can result in 32-bit wide IRAM load from memory
   // being optimized down to an 8-bit memory access. In this test case we need
@@ -78,43 +82,40 @@ __attribute__((noinline)) IRAM_ATTR
   // This section verifies that the workaround implimented by the inline
   // function mmu_get_uint8() is preventing this. See comments for function
   // mmu_get_uint8(() in mmu_iram.h for more details.
-  const uint8_t* x = (const uint8_t*)0x40100003ul;
-  uint32_t       b = ESP.getCycleCount();
-  *res             = mmu_get_uint8(x);
+  const uint8_t *x = (const uint8_t *)0x40100003ul;
+  uint32_t b = ESP.getCycleCount();
+  *res = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC optimize("Os")
 __attribute__((noinline)) IRAM_ATTR
-    uint32_t
-    timedRead_Os(uint8_t* res) {
-  const uint8_t* x = (const uint8_t*)0x40100003ul;
-  uint32_t       b = ESP.getCycleCount();
-  *res             = mmu_get_uint8(x);
+uint32_t timedRead_Os(uint8_t *res) {
+  const uint8_t *x = (const uint8_t *)0x40100003ul;
+  uint32_t b = ESP.getCycleCount();
+  *res = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC optimize("O2")
 __attribute__((noinline)) IRAM_ATTR
-    uint32_t
-    timedRead_O2(uint8_t* res) {
-  const uint8_t* x = (const uint8_t*)0x40100003ul;
-  uint32_t       b = ESP.getCycleCount();
-  *res             = mmu_get_uint8(x);
+uint32_t timedRead_O2(uint8_t *res) {
+  const uint8_t *x = (const uint8_t *)0x40100003ul;
+  uint32_t b = ESP.getCycleCount();
+  *res = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC optimize("O3")
 __attribute__((noinline)) IRAM_ATTR
-    uint32_t
-    timedRead_O3(uint8_t* res) {
-  const uint8_t* x = (const uint8_t*)0x40100003ul;
-  uint32_t       b = ESP.getCycleCount();
-  *res             = mmu_get_uint8(x);
+uint32_t timedRead_O3(uint8_t *res) {
+  const uint8_t *x = (const uint8_t *)0x40100003ul;
+  uint32_t b = ESP.getCycleCount();
+  *res = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC pop_options
 
 bool test4_32bit_loads() {
-  bool     result = true;
-  uint8_t  res;
+  bool result = true;
+  uint8_t res;
   uint32_t cycle_count_ref, cycle_count;
   Serial.printf("\r\nFor mmu_get_uint8, verify that 32-bit wide IRAM access is preserved across different optimizations:\r\n");
   cycle_count_ref = timedRead_Reference(&res);
@@ -152,7 +153,7 @@ bool test4_32bit_loads() {
   return result;
 }
 
-void printPunFail(uint16_t* ref, uint16_t* x, size_t sz) {
+void printPunFail(uint16_t *ref, uint16_t *x, size_t sz) {
   Serial.printf("    Expected:");
   for (size_t i = 0; i < sz; i++) {
     Serial.printf(" %3u", ref[i]);
@@ -167,12 +168,12 @@ void printPunFail(uint16_t* ref, uint16_t* x, size_t sz) {
 bool testPunning() {
   bool result = true;
   // Get reference result for verifing test
-  alignas(uint32_t) uint16_t x_ref[] = { 1, 2, 3, 0 };
+  alignas(uint32_t) uint16_t x_ref[] = {1, 2, 3, 0};
   aliasTestReference(x_ref);  // -O0
   Serial.printf("mmu_get_uint16() strict-aliasing tests with different optimizations:\r\n");
 
   {
-    alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
+    alignas(alignof(uint32_t)) uint16_t x[] = {1, 2, 3, 0};
     aliasTestOs(x);
     Serial.printf("  Option -Os ");
     if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
@@ -184,7 +185,7 @@ bool testPunning() {
     }
   }
   {
-    alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
+    alignas(alignof(uint32_t)) uint16_t x[] = {1, 2, 3, 0};
     aliasTestO2(x);
     Serial.printf("  Option -O2 ");
     if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
@@ -196,7 +197,7 @@ bool testPunning() {
     }
   }
   {
-    alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
+    alignas(alignof(uint32_t)) uint16_t x[] = {1, 2, 3, 0};
     aliasTestO3(x);
     Serial.printf("  Option -O3 ");
     if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
@@ -210,8 +211,9 @@ bool testPunning() {
   return result;
 }
 
-uint32_t cyclesToRead_nKx32(int n, unsigned int* x, uint32_t* res) {
-  uint32_t b   = ESP.getCycleCount();
+
+uint32_t cyclesToRead_nKx32(int n, unsigned int *x, uint32_t *res) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += *(x++);
@@ -220,8 +222,8 @@ uint32_t cyclesToRead_nKx32(int n, unsigned int* x, uint32_t* res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx32(int n, unsigned int* x) {
-  uint32_t b   = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx32(int n, unsigned int *x) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += i;
@@ -230,8 +232,8 @@ uint32_t cyclesToWrite_nKx32(int n, unsigned int* x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx16(int n, unsigned short* x, uint32_t* res) {
-  uint32_t b   = ESP.getCycleCount();
+uint32_t cyclesToRead_nKx16(int n, unsigned short *x, uint32_t *res) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += *(x++);
@@ -240,8 +242,8 @@ uint32_t cyclesToRead_nKx16(int n, unsigned short* x, uint32_t* res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx16(int n, unsigned short* x) {
-  uint32_t b   = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx16(int n, unsigned short *x) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += i;
@@ -250,9 +252,9 @@ uint32_t cyclesToWrite_nKx16(int n, unsigned short* x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKxs16(int n, short* x, int32_t* res) {
-  uint32_t b   = ESP.getCycleCount();
-  int32_t  sum = 0;
+uint32_t cyclesToRead_nKxs16(int n, short *x, int32_t *res) {
+  uint32_t b = ESP.getCycleCount();
+  int32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += *(x++);
   }
@@ -260,9 +262,9 @@ uint32_t cyclesToRead_nKxs16(int n, short* x, int32_t* res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKxs16(int n, short* x) {
-  uint32_t b   = ESP.getCycleCount();
-  int32_t  sum = 0;
+uint32_t cyclesToWrite_nKxs16(int n, short *x) {
+  uint32_t b = ESP.getCycleCount();
+  int32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += i;
     *(x++) = sum;
@@ -270,8 +272,8 @@ uint32_t cyclesToWrite_nKxs16(int n, short* x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx8(int n, unsigned char* x, uint32_t* res) {
-  uint32_t b   = ESP.getCycleCount();
+uint32_t cyclesToRead_nKx8(int n, unsigned char*x, uint32_t *res) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += *(x++);
@@ -280,8 +282,8 @@ uint32_t cyclesToRead_nKx8(int n, unsigned char* x, uint32_t* res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx8(int n, unsigned char* x) {
-  uint32_t b   = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx8(int n, unsigned char*x) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += i;
@@ -291,18 +293,18 @@ uint32_t cyclesToWrite_nKx8(int n, unsigned char* x) {
 }
 
 // Compare with Inline
-uint32_t cyclesToRead_nKx16_viaInline(int n, unsigned short* x, uint32_t* res) {
-  uint32_t b   = ESP.getCycleCount();
+uint32_t cyclesToRead_nKx16_viaInline(int n, unsigned short *x, uint32_t *res) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
-    sum += mmu_get_uint16(x++);  //*(x++);
+    sum += mmu_get_uint16(x++); //*(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short* x) {
-  uint32_t b   = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short *x) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += i;
@@ -312,19 +314,19 @@ uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short* x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKxs16_viaInline(int n, short* x, int32_t* res) {
-  uint32_t b   = ESP.getCycleCount();
-  int32_t  sum = 0;
+uint32_t cyclesToRead_nKxs16_viaInline(int n, short *x, int32_t *res) {
+  uint32_t b = ESP.getCycleCount();
+  int32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
-    sum += mmu_get_int16(x++);  //*(x++);
+    sum += mmu_get_int16(x++); //*(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKxs16_viaInline(int n, short* x) {
-  uint32_t b   = ESP.getCycleCount();
-  int32_t  sum = 0;
+uint32_t cyclesToWrite_nKxs16_viaInline(int n, short *x) {
+  uint32_t b = ESP.getCycleCount();
+  int32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += i;
     // *(x++) = sum;
@@ -333,18 +335,18 @@ uint32_t cyclesToWrite_nKxs16_viaInline(int n, short* x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx8_viaInline(int n, unsigned char* x, uint32_t* res) {
-  uint32_t b   = ESP.getCycleCount();
+uint32_t cyclesToRead_nKx8_viaInline(int n, unsigned char*x, uint32_t *res) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
-    sum += mmu_get_uint8(x++);  //*(x++);
+    sum += mmu_get_uint8(x++); //*(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char* x) {
-  uint32_t b   = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char*x) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += i;
@@ -354,14 +356,14 @@ uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char* x) {
   return ESP.getCycleCount() - b;
 }
 
-bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
+
+bool perfTest_nK(int nK, uint32_t *mem, uint32_t *imem) {
   uint32_t res, verify_res;
   uint32_t t;
-  bool     success = true;
-  int      sres, verify_sres;
+  bool success = true;
+  int sres, verify_sres;
 
-  Serial.printf("\r\nPerformance numbers for 16 bit access - using inline macros or exception handling for IRAM.\r\n");
-  ;
+  Serial.printf("\r\nPerformance numbers for 16 bit access - using inline macros or exception handling for IRAM.\r\n");;
   t = cyclesToWrite_nKx16(nK, (uint16_t*)mem);
   Serial.printf("DRAM Memory Write:         %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx16(nK, (uint16_t*)mem, &verify_res);
@@ -414,8 +416,7 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
     success = false;
   }
 
-  Serial.printf("\r\nPerformance numbers for 8 bit access - using inline macros or exception handling for IRAM access.\r\n");
-  ;
+  Serial.printf("\r\nPerformance numbers for 8 bit access - using inline macros or exception handling for IRAM access.\r\n");;
   t = cyclesToWrite_nKx8(nK, (uint8_t*)mem);
   Serial.printf("DRAM Memory Write:         %7d cycles for %dK by  uint8, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx8(nK, (uint8_t*)mem, &verify_res);
@@ -466,7 +467,7 @@ void setup() {
   // IRAM region.  It will continue to use the builtin DRAM until we request
   // otherwise.
   Serial.printf("DRAM free: %6d\r\n", ESP.getFreeHeap());
-  uint32_t* mem = (uint32_t*)malloc(2 * 1024 * sizeof(uint32_t));
+  uint32_t *mem = (uint32_t *)malloc(2 * 1024 * sizeof(uint32_t));
   Serial.printf("DRAM buffer: Address %p, free %d\r\n", mem, ESP.getFreeHeap());
   if (!mem) {
     return;
@@ -476,12 +477,12 @@ void setup() {
 #ifdef USE_SET_IRAM_HEAP
   ESP.setIramHeap();
   Serial.printf("IRAM free: %6d\r\n", ESP.getFreeHeap());
-  uint32_t* imem = (uint32_t*)malloc(2 * 1024 * sizeof(uint32_t));
+  uint32_t *imem = (uint32_t *)malloc(2 * 1024 * sizeof(uint32_t));
   Serial.printf("IRAM buffer: Address %p, free %d\r\n", imem, ESP.getFreeHeap());
   // Make sure we go back to the DRAM heap for other allocations.  Don't forget to ESP.resetHeap()!
   ESP.resetHeap();
 #else
-  uint32_t* imem;
+  uint32_t *imem;
   {
     HeapSelectIram ephemeral;
     // This class effectively does this
@@ -490,7 +491,7 @@ void setup() {
     //  ...
     // umm_set_heap_by_id(_heap_id);
     Serial.printf("IRAM free: %6d\r\n", ESP.getFreeHeap());
-    imem = (uint32_t*)malloc(2 * 1024 * sizeof(uint32_t));
+    imem = (uint32_t *)malloc(2 * 1024 * sizeof(uint32_t));
     Serial.printf("IRAM buffer: Address %p, free %d\r\n", imem, ESP.getFreeHeap());
   }
 #endif
@@ -500,9 +501,8 @@ void setup() {
 
   uint32_t res;
   uint32_t t;
-  int      nK = 1;
-  Serial.printf("\r\nPerformance numbers for 32 bit access - no exception handler or inline macros needed.\r\n");
-  ;
+  int nK = 1;
+  Serial.printf("\r\nPerformance numbers for 32 bit access - no exception handler or inline macros needed.\r\n");;
   t = cyclesToWrite_nKx32(nK, mem);
   Serial.printf("DRAM Memory Write:         %7d cycles for %dK by uint32, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx32(nK, mem, &res);
@@ -514,6 +514,7 @@ void setup() {
   Serial.printf("IRAM Memory Read:          %7d cycles for %dK by uint32, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), res);
   Serial.println();
 
+
   if (perfTest_nK(1, mem, imem) && testPunning() && test4_32bit_loads()) {
     Serial.println();
   } else {
@@ -548,7 +549,7 @@ void setup() {
   {
     // Let's use IRAM heap to make a big ole' String
     HeapSelectIram ephemeral;
-    String         s = "";
+    String s = "";
     for (int i = 0; i < 100; i++) {
       s += i;
       s += ' ';
@@ -572,7 +573,7 @@ void setup() {
   free(imem);
   free(mem);
   imem = NULL;
-  mem  = NULL;
+  mem = NULL;
 
   Serial.printf("DRAM free: %6d\r\n", ESP.getFreeHeap());
 #ifdef USE_SET_IRAM_HEAP
@@ -588,16 +589,16 @@ void setup() {
   {
     ETS_PRINTF("Try and allocate all of the heap in one chunk\n");
     HeapSelectIram ephemeral;
-    size_t         free_iram = ESP.getFreeHeap();
+    size_t free_iram = ESP.getFreeHeap();
     ETS_PRINTF("IRAM free: %6d\n", free_iram);
     uint32_t hfree;
     uint32_t hmax;
-    uint8_t  hfrag;
+    uint8_t hfrag;
     ESP.getHeapStats(&hfree, &hmax, &hfrag);
     ETS_PRINTF("ESP.getHeapStats(free: %u, max: %u, frag: %u)\n",
                hfree, hmax, hfrag);
     if (free_iram > UMM_OVERHEAD_ADJUST) {
-      void* all = malloc(free_iram - UMM_OVERHEAD_ADJUST);
+      void *all = malloc(free_iram - UMM_OVERHEAD_ADJUST);
       ETS_PRINTF("%p = malloc(%u)\n", all, free_iram);
       umm_info(NULL, true);
 
@@ -613,26 +614,26 @@ void setup() {
 void processKey(Print& out, int hotKey) {
   switch (hotKey) {
     case 'd': {
-      HeapSelectDram ephemeral;
-      umm_info(NULL, true);
-      break;
-    }
+        HeapSelectDram ephemeral;
+        umm_info(NULL, true);
+        break;
+      }
     case 'i': {
-      HeapSelectIram ephemeral;
-      umm_info(NULL, true);
-      break;
-    }
-    case 'h': {
-      {
         HeapSelectIram ephemeral;
-        Serial.printf(PSTR("IRAM ESP.getFreeHeap:  %u\n"), ESP.getFreeHeap());
+        umm_info(NULL, true);
+        break;
       }
-      {
-        HeapSelectDram ephemeral;
-        Serial.printf(PSTR("DRAM ESP.getFreeHeap:  %u\r\n"), ESP.getFreeHeap());
+    case 'h': {
+        {
+          HeapSelectIram ephemeral;
+          Serial.printf(PSTR("IRAM ESP.getFreeHeap:  %u\n"), ESP.getFreeHeap());
+        }
+        {
+          HeapSelectDram ephemeral;
+          Serial.printf(PSTR("DRAM ESP.getFreeHeap:  %u\r\n"), ESP.getFreeHeap());
+        }
+        break;
       }
-      break;
-    }
     case 'R':
       out.printf_P(PSTR("Restart, ESP.restart(); ...\r\n"));
       ESP.restart();
@@ -659,6 +660,7 @@ void processKey(Print& out, int hotKey) {
   }
 }
 
+
 void loop(void) {
   if (Serial.available() > 0) {
     int hotKey = Serial.read();
diff --git a/libraries/esp8266/examples/virtualmem/virtualmem.ino b/libraries/esp8266/examples/virtualmem/virtualmem.ino
index c5374d245c..47b9396cc7 100644
--- a/libraries/esp8266/examples/virtualmem/virtualmem.ino
+++ b/libraries/esp8266/examples/virtualmem/virtualmem.ino
@@ -1,6 +1,6 @@
 
-uint32_t cyclesToRead1Kx32(unsigned int* x, uint32_t* res) {
-  uint32_t b   = ESP.getCycleCount();
+uint32_t cyclesToRead1Kx32(unsigned int *x, uint32_t *res) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
     sum += *(x++);
@@ -9,8 +9,8 @@ uint32_t cyclesToRead1Kx32(unsigned int* x, uint32_t* res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx32(unsigned int* x) {
-  uint32_t b   = ESP.getCycleCount();
+uint32_t cyclesToWrite1Kx32(unsigned int *x) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
     sum += i;
@@ -19,8 +19,9 @@ uint32_t cyclesToWrite1Kx32(unsigned int* x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead1Kx16(unsigned short* x, uint32_t* res) {
-  uint32_t b   = ESP.getCycleCount();
+
+uint32_t cyclesToRead1Kx16(unsigned short *x, uint32_t *res) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
     sum += *(x++);
@@ -29,8 +30,8 @@ uint32_t cyclesToRead1Kx16(unsigned short* x, uint32_t* res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx16(unsigned short* x) {
-  uint32_t b   = ESP.getCycleCount();
+uint32_t cyclesToWrite1Kx16(unsigned short *x) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
     sum += i;
@@ -39,8 +40,8 @@ uint32_t cyclesToWrite1Kx16(unsigned short* x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead1Kx8(unsigned char* x, uint32_t* res) {
-  uint32_t b   = ESP.getCycleCount();
+uint32_t cyclesToRead1Kx8(unsigned char*x, uint32_t *res) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
     sum += *(x++);
@@ -49,8 +50,8 @@ uint32_t cyclesToRead1Kx8(unsigned char* x, uint32_t* res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx8(unsigned char* x) {
-  uint32_t b   = ESP.getCycleCount();
+uint32_t cyclesToWrite1Kx8(unsigned char*x) {
+  uint32_t b = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
     sum += i;
@@ -65,12 +66,12 @@ void setup() {
 
   // Enabling VM does not change malloc to use the external region.  It will continue to
   // use the normal RAM until we request otherwise.
-  uint32_t* mem = (uint32_t*)malloc(1024 * sizeof(uint32_t));
+  uint32_t *mem = (uint32_t *)malloc(1024 * sizeof(uint32_t));
   Serial.printf("Internal buffer: Address %p, free %d\n", mem, ESP.getFreeHeap());
 
   // Now request from the VM heap
   ESP.setExternalHeap();
-  uint32_t* vm = (uint32_t*)malloc(1024 * sizeof(uint32_t));
+  uint32_t *vm = (uint32_t *)malloc(1024 * sizeof(uint32_t));
   Serial.printf("External buffer: Address %p, free %d\n", vm, ESP.getFreeHeap());
   // Make sure we go back to the internal heap for other allocations.  Don't forget to ESP.resetHeap()!
   ESP.resetHeap();
@@ -133,4 +134,5 @@ void setup() {
 }
 
 void loop() {
+
 }
diff --git a/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino b/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
index fc265a2136..ed2943c278 100644
--- a/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
+++ b/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
@@ -25,7 +25,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK "your-password"
+#define STAPSK  "your-password"
 #endif
 
 #define LOGGERBAUD 115200
@@ -34,12 +34,12 @@
 #define NAPT 200
 #define NAPT_PORT 3
 
-#define RX 13  // d1mini D7
-#define TX 15  // d1mini D8
+#define RX 13 // d1mini D7
+#define TX 15 // d1mini D8
 
-SoftwareSerial  ppplink(RX, TX);
+SoftwareSerial ppplink(RX, TX);
 HardwareSerial& logger = Serial;
-PPPServer       ppp(&ppplink);
+PPPServer ppp(&ppplink);
 
 void PPPConnectedCallback(netif* nif) {
   logger.printf("ppp: ip=%s/mask=%s/gw=%s\n",
@@ -97,6 +97,7 @@ void setup() {
   logger.printf("ppp: %d\n", ret);
 }
 
+
 #else
 
 void setup() {
diff --git a/libraries/lwIP_PPP/src/PPPServer.cpp b/libraries/lwIP_PPP/src/PPPServer.cpp
index 31c406b830..98fddd7777 100644
--- a/libraries/lwIP_PPP/src/PPPServer.cpp
+++ b/libraries/lwIP_PPP/src/PPPServer.cpp
@@ -16,8 +16,7 @@
 
 #include "PPPServer.h"
 
-PPPServer::PPPServer(Stream* sio) :
-    _sio(sio), _cb(netif_status_cb_s), _enabled(false)
+PPPServer::PPPServer(Stream* sio): _sio(sio), _cb(netif_status_cb_s), _enabled(false)
 {
 }
 
@@ -39,15 +38,15 @@ bool PPPServer::handlePackets()
 
 void PPPServer::link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx)
 {
-    bool   stop = true;
-    netif* nif  = ppp_netif(pcb);
+    bool stop = true;
+    netif* nif = ppp_netif(pcb);
 
     switch (err_code)
     {
-    case PPPERR_NONE: /* No error. */
+    case PPPERR_NONE:               /* No error. */
     {
 #if LWIP_DNS
-        const ip_addr_t* ns;
+        const ip_addr_t *ns;
 #endif /* LWIP_DNS */
         ets_printf("ppp_link_status_cb: PPPERR_NONE\n\r");
 #if LWIP_IPV4
@@ -69,54 +68,54 @@ void PPPServer::link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx)
         ets_printf("   our6_ipaddr = %s\n\r", ip6addr_ntoa(netif_ip6_addr(nif, 0)));
 #endif /* PPP_IPV6_SUPPORT */
     }
-        stop = false;
-        break;
+    stop = false;
+    break;
 
-    case PPPERR_PARAM: /* Invalid parameter. */
+    case PPPERR_PARAM:             /* Invalid parameter. */
         ets_printf("ppp_link_status_cb: PPPERR_PARAM\n");
         break;
 
-    case PPPERR_OPEN: /* Unable to open PPP session. */
+    case PPPERR_OPEN:              /* Unable to open PPP session. */
         ets_printf("ppp_link_status_cb: PPPERR_OPEN\n");
         break;
 
-    case PPPERR_DEVICE: /* Invalid I/O device for PPP. */
+    case PPPERR_DEVICE:            /* Invalid I/O device for PPP. */
         ets_printf("ppp_link_status_cb: PPPERR_DEVICE\n");
         break;
 
-    case PPPERR_ALLOC: /* Unable to allocate resources. */
+    case PPPERR_ALLOC:             /* Unable to allocate resources. */
         ets_printf("ppp_link_status_cb: PPPERR_ALLOC\n");
         break;
 
-    case PPPERR_USER: /* User interrupt. */
+    case PPPERR_USER:              /* User interrupt. */
         ets_printf("ppp_link_status_cb: PPPERR_USER\n");
         break;
 
-    case PPPERR_CONNECT: /* Connection lost. */
+    case PPPERR_CONNECT:           /* Connection lost. */
         ets_printf("ppp_link_status_cb: PPPERR_CONNECT\n");
         break;
 
-    case PPPERR_AUTHFAIL: /* Failed authentication challenge. */
+    case PPPERR_AUTHFAIL:          /* Failed authentication challenge. */
         ets_printf("ppp_link_status_cb: PPPERR_AUTHFAIL\n");
         break;
 
-    case PPPERR_PROTOCOL: /* Failed to meet protocol. */
+    case PPPERR_PROTOCOL:          /* Failed to meet protocol. */
         ets_printf("ppp_link_status_cb: PPPERR_PROTOCOL\n");
         break;
 
-    case PPPERR_PEERDEAD: /* Connection timeout. */
+    case PPPERR_PEERDEAD:          /* Connection timeout. */
         ets_printf("ppp_link_status_cb: PPPERR_PEERDEAD\n");
         break;
 
-    case PPPERR_IDLETIMEOUT: /* Idle Timeout. */
+    case PPPERR_IDLETIMEOUT:       /* Idle Timeout. */
         ets_printf("ppp_link_status_cb: PPPERR_IDLETIMEOUT\n");
         break;
 
-    case PPPERR_CONNECTTIME: /* PPPERR_CONNECTTIME. */
+    case PPPERR_CONNECTTIME:       /* PPPERR_CONNECTTIME. */
         ets_printf("ppp_link_status_cb: PPPERR_CONNECTTIME\n");
         break;
 
-    case PPPERR_LOOPBACK: /* Connection timeout. */
+    case PPPERR_LOOPBACK:          /* Connection timeout. */
         ets_printf("ppp_link_status_cb: PPPERR_LOOPBACK\n");
         break;
 
@@ -179,8 +178,9 @@ bool PPPServer::begin(const IPAddress& ourAddress, const IPAddress& peer)
 
     _enabled = true;
     if (!schedule_recurrent_function_us([&]()
-                                        { return this->handlePackets(); },
-                                        1000))
+{
+    return this->handlePackets();
+    }, 1000))
     {
         netif_remove(&_netif);
         return false;
diff --git a/libraries/lwIP_PPP/src/PPPServer.h b/libraries/lwIP_PPP/src/PPPServer.h
index 260ebfe2d8..e2c95658a6 100644
--- a/libraries/lwIP_PPP/src/PPPServer.h
+++ b/libraries/lwIP_PPP/src/PPPServer.h
@@ -27,6 +27,7 @@
 
 */
 
+
 #ifndef __PPPSERVER_H
 #define __PPPSERVER_H
 
@@ -39,6 +40,7 @@
 class PPPServer
 {
 public:
+
     PPPServer(Stream* sio);
 
     bool begin(const IPAddress& ourAddress, const IPAddress& peer = IPAddress(172, 31, 255, 254));
@@ -54,20 +56,22 @@ class PPPServer
     }
 
 protected:
+
     static constexpr size_t _bufsize = 128;
-    Stream*                 _sio;
-    ppp_pcb*                _ppp;
-    netif                   _netif;
+    Stream* _sio;
+    ppp_pcb* _ppp;
+    netif _netif;
     void (*_cb)(netif*);
     uint8_t _buf[_bufsize];
-    bool    _enabled;
+    bool _enabled;
 
     // feed ppp from stream - to call on a regular basis or on interrupt
     bool handlePackets();
 
     static u32_t output_cb_s(ppp_pcb* pcb, u8_t* data, u32_t len, void* ctx);
-    static void  link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx);
-    static void  netif_status_cb_s(netif* nif);
+    static void link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx);
+    static void netif_status_cb_s(netif* nif);
+
 };
 
-#endif  // __PPPSERVER_H
+#endif // __PPPSERVER_H
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
index 224fe742b8..42d1af7fc2 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
@@ -42,9 +42,10 @@
 
 #include "enc28j60.h"
 
-void serial_printf(const char* fmt, ...)
+
+void serial_printf(const char *fmt, ...)
 {
-    char    buf[128];
+    char buf[128];
     va_list args;
     va_start(args, fmt);
     vsnprintf(buf, 128, fmt, args);
@@ -56,15 +57,11 @@ void serial_printf(const char* fmt, ...)
 #if DEBUG
 #define PRINTF(...) printf(__VA_ARGS__)
 #else
-#define PRINTF(...) \
-    do              \
-    {               \
-        (void)0;    \
-    } while (0)
+#define PRINTF(...) do { (void)0; } while (0)
 #endif
 
-#define EIE 0x1b
-#define EIR 0x1c
+#define EIE   0x1b
+#define EIR   0x1c
 #define ESTAT 0x1d
 #define ECON2 0x1e
 #define ECON1 0x1f
@@ -72,13 +69,13 @@ void serial_printf(const char* fmt, ...)
 #define ESTAT_CLKRDY 0x01
 #define ESTAT_TXABRT 0x02
 
-#define ECON1_RXEN 0x04
-#define ECON1_TXRTS 0x08
+#define ECON1_RXEN   0x04
+#define ECON1_TXRTS  0x08
 
 #define ECON2_AUTOINC 0x80
-#define ECON2_PKTDEC 0x40
+#define ECON2_PKTDEC  0x40
 
-#define EIR_TXIF 0x08
+#define EIR_TXIF      0x08
 
 #define ERXTX_BANK 0x00
 
@@ -98,19 +95,19 @@ void serial_printf(const char* fmt, ...)
 #define ERXRDPTH 0x0d
 
 #define RX_BUF_START 0x0000
-#define RX_BUF_END 0x0fff
+#define RX_BUF_END   0x0fff
 
 #define TX_BUF_START 0x1200
 
 /* MACONx registers are in bank 2 */
 #define MACONX_BANK 0x02
 
-#define MACON1 0x00
-#define MACON3 0x02
-#define MACON4 0x03
+#define MACON1  0x00
+#define MACON3  0x02
+#define MACON4  0x03
 #define MABBIPG 0x04
-#define MAIPGL 0x06
-#define MAIPGH 0x07
+#define MAIPGL  0x06
+#define MAIPGH  0x07
 #define MAMXFLL 0x0a
 #define MAMXFLH 0x0b
 
@@ -119,9 +116,9 @@ void serial_printf(const char* fmt, ...)
 #define MACON1_MARXEN 0x01
 
 #define MACON3_PADCFG_FULL 0xe0
-#define MACON3_TXCRCEN 0x10
-#define MACON3_FRMLNEN 0x02
-#define MACON3_FULDPX 0x01
+#define MACON3_TXCRCEN     0x10
+#define MACON3_FRMLNEN     0x02
+#define MACON3_FULDPX      0x01
 
 #define MAX_MAC_LENGTH 1518
 
@@ -139,33 +136,36 @@ void serial_printf(const char* fmt, ...)
 #define ERXFCON 0x18
 #define EPKTCNT 0x19
 
-#define ERXFCON_UCEN 0x80
+#define ERXFCON_UCEN  0x80
 #define ERXFCON_ANDOR 0x40
 #define ERXFCON_CRCEN 0x20
-#define ERXFCON_MCEN 0x02
-#define ERXFCON_BCEN 0x01
+#define ERXFCON_MCEN  0x02
+#define ERXFCON_BCEN  0x01
 
 // The ENC28J60 SPI Interface supports clock speeds up to 20 MHz
 static const SPISettings spiSettings(20000000, MSBFIRST, SPI_MODE0);
 
-ENC28J60::ENC28J60(int8_t cs, SPIClass& spi, int8_t intr) :
+ENC28J60::ENC28J60(int8_t cs, SPIClass& spi, int8_t intr):
     _bank(ERXTX_BANK), _cs(cs), _spi(spi)
 {
     (void)intr;
 }
 
-void ENC28J60::enc28j60_arch_spi_select(void)
+void
+ENC28J60::enc28j60_arch_spi_select(void)
 {
     SPI.beginTransaction(spiSettings);
     digitalWrite(_cs, LOW);
 }
 
-void ENC28J60::enc28j60_arch_spi_deselect(void)
+void
+ENC28J60::enc28j60_arch_spi_deselect(void)
 {
     digitalWrite(_cs, HIGH);
     SPI.endTransaction();
 }
 
+
 /*---------------------------------------------------------------------------*/
 uint8_t
 ENC28J60::is_mac_mii_reg(uint8_t reg)
@@ -200,7 +200,8 @@ ENC28J60::readreg(uint8_t reg)
     return r;
 }
 /*---------------------------------------------------------------------------*/
-void ENC28J60::writereg(uint8_t reg, uint8_t data)
+void
+ENC28J60::writereg(uint8_t reg, uint8_t data)
 {
     enc28j60_arch_spi_select();
     SPI.transfer(0x40 | (reg & 0x1f));
@@ -208,7 +209,8 @@ void ENC28J60::writereg(uint8_t reg, uint8_t data)
     enc28j60_arch_spi_deselect();
 }
 /*---------------------------------------------------------------------------*/
-void ENC28J60::setregbitfield(uint8_t reg, uint8_t mask)
+void
+ENC28J60::setregbitfield(uint8_t reg, uint8_t mask)
 {
     if (is_mac_mii_reg(reg))
     {
@@ -223,7 +225,8 @@ void ENC28J60::setregbitfield(uint8_t reg, uint8_t mask)
     }
 }
 /*---------------------------------------------------------------------------*/
-void ENC28J60::clearregbitfield(uint8_t reg, uint8_t mask)
+void
+ENC28J60::clearregbitfield(uint8_t reg, uint8_t mask)
 {
     if (is_mac_mii_reg(reg))
     {
@@ -238,13 +241,15 @@ void ENC28J60::clearregbitfield(uint8_t reg, uint8_t mask)
     }
 }
 /*---------------------------------------------------------------------------*/
-void ENC28J60::setregbank(uint8_t new_bank)
+void
+ENC28J60::setregbank(uint8_t new_bank)
 {
     writereg(ECON1, (readreg(ECON1) & 0xfc) | (new_bank & 0x03));
     _bank = new_bank;
 }
 /*---------------------------------------------------------------------------*/
-void ENC28J60::writedata(const uint8_t* data, int datalen)
+void
+ENC28J60::writedata(const uint8_t *data, int datalen)
 {
     int i;
     enc28j60_arch_spi_select();
@@ -257,12 +262,14 @@ void ENC28J60::writedata(const uint8_t* data, int datalen)
     enc28j60_arch_spi_deselect();
 }
 /*---------------------------------------------------------------------------*/
-void ENC28J60::writedatabyte(uint8_t byte)
+void
+ENC28J60::writedatabyte(uint8_t byte)
 {
     writedata(&byte, 1);
 }
 /*---------------------------------------------------------------------------*/
-int ENC28J60::readdata(uint8_t* buf, int len)
+int
+ENC28J60::readdata(uint8_t *buf, int len)
 {
     int i;
     enc28j60_arch_spi_select();
@@ -285,7 +292,8 @@ ENC28J60::readdatabyte(void)
 }
 
 /*---------------------------------------------------------------------------*/
-void ENC28J60::softreset(void)
+void
+ENC28J60::softreset(void)
 {
     enc28j60_arch_spi_select();
     /* The System Command (soft reset) is 1 1 1 1 1 1 1 1 */
@@ -316,7 +324,8 @@ ENC28J60::readrev(void)
 
 /*---------------------------------------------------------------------------*/
 
-bool ENC28J60::reset(void)
+bool
+ENC28J60::reset(void)
 {
     PRINTF("enc28j60: resetting chip\n");
 
@@ -389,7 +398,7 @@ bool ENC28J60::reset(void)
 
     /* Wait for OST */
     PRINTF("waiting for ESTAT_CLKRDY\n");
-    while ((readreg(ESTAT) & ESTAT_CLKRDY) == 0) { };
+    while ((readreg(ESTAT) & ESTAT_CLKRDY) == 0) {};
     PRINTF("ESTAT_CLKRDY\n");
 
     setregbank(ERXTX_BANK);
@@ -461,7 +470,8 @@ bool ENC28J60::reset(void)
     setregbitfield(MACON1, MACON1_MARXEN | MACON1_TXPAUS | MACON1_RXPAUS);
 
     /* Set padding, crc, full duplex */
-    setregbitfield(MACON3, MACON3_PADCFG_FULL | MACON3_TXCRCEN | MACON3_FULDPX | MACON3_FRMLNEN);
+    setregbitfield(MACON3, MACON3_PADCFG_FULL | MACON3_TXCRCEN | MACON3_FULDPX |
+                   MACON3_FRMLNEN);
 
     /* Don't modify MACON4 */
 
@@ -522,11 +532,11 @@ bool ENC28J60::reset(void)
 }
 /*---------------------------------------------------------------------------*/
 boolean
-ENC28J60::begin(const uint8_t* address)
+ENC28J60::begin(const uint8_t *address)
 {
     _localMac = address;
 
-    bool    ret = reset();
+    bool ret = reset();
     uint8_t rev = readrev();
 
     PRINTF("ENC28J60 rev. B%d\n", rev);
@@ -537,7 +547,7 @@ ENC28J60::begin(const uint8_t* address)
 /*---------------------------------------------------------------------------*/
 
 uint16_t
-ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen)
+ENC28J60::sendFrame(const uint8_t *data, uint16_t datalen)
 {
     uint16_t dataend;
 
@@ -588,14 +598,13 @@ ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen)
 
     /* Send the packet */
     setregbitfield(ECON1, ECON1_TXRTS);
-    while ((readreg(ECON1) & ECON1_TXRTS) > 0)
-        ;
+    while ((readreg(ECON1) & ECON1_TXRTS) > 0);
 
 #if DEBUG
     if ((readreg(ESTAT) & ESTAT_TXABRT) != 0)
     {
         uint16_t erdpt;
-        uint8_t  tsv[7];
+        uint8_t tsv[7];
         erdpt = (readreg(ERDPTH) << 8) | readreg(ERDPTL);
         writereg(ERDPTL, (dataend + 1) & 0xff);
         writereg(ERDPTH, (dataend + 1) >> 8);
@@ -603,8 +612,7 @@ ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen)
         writereg(ERDPTL, erdpt & 0xff);
         writereg(ERDPTH, erdpt >> 8);
         PRINTF("enc28j60: tx err: %d: %02x:%02x:%02x:%02x:%02x:%02x\n"
-               "                  tsv: %02x%02x%02x%02x%02x%02x%02x\n",
-               datalen,
+               "                  tsv: %02x%02x%02x%02x%02x%02x%02x\n", datalen,
                0xff & data[0], 0xff & data[1], 0xff & data[2],
                0xff & data[3], 0xff & data[4], 0xff & data[5],
                tsv[6], tsv[5], tsv[4], tsv[3], tsv[2], tsv[1], tsv[0]);
@@ -625,7 +633,7 @@ ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen)
 /*---------------------------------------------------------------------------*/
 
 uint16_t
-ENC28J60::readFrame(uint8_t* buffer, uint16_t bufsize)
+ENC28J60::readFrame(uint8_t *buffer, uint16_t bufsize)
 {
     readFrameSize();
     return readFrameData(buffer, bufsize);
@@ -654,13 +662,13 @@ ENC28J60::readFrameSize()
     /* Read the next packet pointer */
     nxtpkt[0] = readdatabyte();
     nxtpkt[1] = readdatabyte();
-    _next     = (nxtpkt[1] << 8) + nxtpkt[0];
+    _next = (nxtpkt[1] << 8) + nxtpkt[0];
 
     PRINTF("enc28j60: nxtpkt 0x%02x%02x\n", _nxtpkt[1], _nxtpkt[0]);
 
     length[0] = readdatabyte();
     length[1] = readdatabyte();
-    _len      = (length[1] << 8) + length[0];
+    _len = (length[1] << 8) + length[0];
 
     PRINTF("enc28j60: length 0x%02x%02x\n", length[1], length[0]);
 
@@ -674,17 +682,19 @@ ENC28J60::readFrameSize()
     return _len;
 }
 
-void ENC28J60::discardFrame(uint16_t framesize)
+void
+ENC28J60::discardFrame(uint16_t framesize)
 {
     (void)framesize;
     (void)readFrameData(nullptr, 0);
 }
 
 uint16_t
-ENC28J60::readFrameData(uint8_t* buffer, uint16_t framesize)
+ENC28J60::readFrameData(uint8_t *buffer, uint16_t framesize)
 {
     if (framesize < _len)
     {
+
         buffer = nullptr;
 
         /* flush rx fifo */
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.h b/libraries/lwIP_enc28j60/src/utility/enc28j60.h
index 07f71f96ff..07ec39e929 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.h
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.h
@@ -46,6 +46,7 @@
 */
 class ENC28J60
 {
+
 public:
     /**
         Constructor that uses the default hardware SPI pins
@@ -60,7 +61,7 @@ class ENC28J60
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean begin(const uint8_t* address);
+    boolean begin(const uint8_t *address);
 
     /**
         Send an Ethernet frame
@@ -68,7 +69,7 @@ class ENC28J60
         @param datalen the length of the data in the packet
         @return the number of bytes transmitted
     */
-    virtual uint16_t sendFrame(const uint8_t* data, uint16_t datalen);
+    virtual uint16_t sendFrame(const uint8_t *data, uint16_t datalen);
 
     /**
         Read an Ethernet frame
@@ -77,9 +78,10 @@ class ENC28J60
         @return the length of the received packet
                or 0 if no packet was received
     */
-    virtual uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
+    virtual uint16_t readFrame(uint8_t *buffer, uint16_t bufsize);
 
 protected:
+
     static constexpr bool interruptIsPossible()
     {
         return false;
@@ -107,37 +109,38 @@ class ENC28J60
         @return the length of the received frame
                or 0 if a problem occurred
     */
-    uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
+    uint16_t readFrameData(uint8_t *frame, uint16_t framesize);
 
 private:
+
     uint8_t is_mac_mii_reg(uint8_t reg);
     uint8_t readreg(uint8_t reg);
-    void    writereg(uint8_t reg, uint8_t data);
-    void    setregbitfield(uint8_t reg, uint8_t mask);
-    void    clearregbitfield(uint8_t reg, uint8_t mask);
-    void    setregbank(uint8_t new_bank);
-    void    writedata(const uint8_t* data, int datalen);
-    void    writedatabyte(uint8_t byte);
-    int     readdata(uint8_t* buf, int len);
+    void writereg(uint8_t reg, uint8_t data);
+    void setregbitfield(uint8_t reg, uint8_t mask);
+    void clearregbitfield(uint8_t reg, uint8_t mask);
+    void setregbank(uint8_t new_bank);
+    void writedata(const uint8_t *data, int datalen);
+    void writedatabyte(uint8_t byte);
+    int readdata(uint8_t *buf, int len);
     uint8_t readdatabyte(void);
-    void    softreset(void);
+    void softreset(void);
     uint8_t readrev(void);
-    bool    reset(void);
+    bool reset(void);
 
-    void    enc28j60_arch_spi_init(void);
+    void enc28j60_arch_spi_init(void);
     uint8_t enc28j60_arch_spi_write(uint8_t data);
     uint8_t enc28j60_arch_spi_read(void);
-    void    enc28j60_arch_spi_select(void);
-    void    enc28j60_arch_spi_deselect(void);
+    void enc28j60_arch_spi_select(void);
+    void enc28j60_arch_spi_deselect(void);
 
     // Previously defined in contiki/core/sys/clock.h
     void clock_delay_usec(uint16_t dt);
 
-    uint8_t   _bank;
-    int8_t    _cs;
+    uint8_t _bank;
+    int8_t _cs;
     SPIClass& _spi;
 
-    const uint8_t* _localMac;
+    const uint8_t *_localMac;
 
     /* readFrame*() state */
     uint16_t _next, _len;
diff --git a/libraries/lwIP_w5100/src/utility/w5100.cpp b/libraries/lwIP_w5100/src/utility/w5100.cpp
index 70e3197afb..6377aa5b63 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.cpp
+++ b/libraries/lwIP_w5100/src/utility/w5100.cpp
@@ -35,14 +35,15 @@
 #include <SPI.h>
 #include "w5100.h"
 
+
 uint8_t Wiznet5100::wizchip_read(uint16_t address)
 {
     uint8_t ret;
 
     wizchip_cs_select();
     _spi.transfer(0x0F);
-    _spi.transfer((address & 0xFF00) >> 8);
-    _spi.transfer((address & 0x00FF) >> 0);
+    _spi.transfer((address & 0xFF00) >>  8);
+    _spi.transfer((address & 0x00FF) >>  0);
     ret = _spi.transfer(0);
     wizchip_cs_deselect();
 
@@ -54,6 +55,7 @@ uint16_t Wiznet5100::wizchip_read_word(uint16_t address)
     return ((uint16_t)wizchip_read(address) << 8) + wizchip_read(address + 1);
 }
 
+
 void Wiznet5100::wizchip_read_buf(uint16_t address, uint8_t* pBuf, uint16_t len)
 {
     for (uint16_t i = 0; i < len; i++)
@@ -66,16 +68,16 @@ void Wiznet5100::wizchip_write(uint16_t address, uint8_t wb)
 {
     wizchip_cs_select();
     _spi.transfer(0xF0);
-    _spi.transfer((address & 0xFF00) >> 8);
-    _spi.transfer((address & 0x00FF) >> 0);
-    _spi.transfer(wb);  // Data write (write 1byte data)
+    _spi.transfer((address & 0xFF00) >>  8);
+    _spi.transfer((address & 0x00FF) >>  0);
+    _spi.transfer(wb);    // Data write (write 1byte data)
     wizchip_cs_deselect();
 }
 
 void Wiznet5100::wizchip_write_word(uint16_t address, uint16_t word)
 {
     wizchip_write(address, (uint8_t)(word >> 8));
-    wizchip_write(address + 1, (uint8_t)word);
+    wizchip_write(address + 1, (uint8_t) word);
 }
 
 void Wiznet5100::wizchip_write_buf(uint16_t address, const uint8_t* pBuf, uint16_t len)
@@ -92,8 +94,7 @@ void Wiznet5100::setSn_CR(uint8_t cr)
     wizchip_write(Sn_CR, cr);
 
     // Now wait for the command to complete
-    while (wizchip_read(Sn_CR))
-        ;
+    while (wizchip_read(Sn_CR));
 }
 
 uint16_t Wiznet5100::getSn_TX_FSR()
@@ -110,6 +111,7 @@ uint16_t Wiznet5100::getSn_TX_FSR()
     return val;
 }
 
+
 uint16_t Wiznet5100::getSn_RX_RSR()
 {
     uint16_t val = 0, val1 = 0;
@@ -124,7 +126,7 @@ uint16_t Wiznet5100::getSn_RX_RSR()
     return val;
 }
 
-void Wiznet5100::wizchip_send_data(const uint8_t* wizdata, uint16_t len)
+void Wiznet5100::wizchip_send_data(const uint8_t *wizdata, uint16_t len)
 {
     uint16_t ptr;
     uint16_t size;
@@ -134,14 +136,14 @@ void Wiznet5100::wizchip_send_data(const uint8_t* wizdata, uint16_t len)
     ptr = getSn_TX_WR();
 
     dst_mask = ptr & TxBufferMask;
-    dst_ptr  = TxBufferAddress + dst_mask;
+    dst_ptr = TxBufferAddress + dst_mask;
 
     if (dst_mask + len > TxBufferLength)
     {
         size = TxBufferLength - dst_mask;
         wizchip_write_buf(dst_ptr, wizdata, size);
         wizdata += size;
-        size    = len - size;
+        size = len - size;
         dst_ptr = TxBufferAddress;
         wizchip_write_buf(dst_ptr, wizdata, size);
     }
@@ -155,7 +157,7 @@ void Wiznet5100::wizchip_send_data(const uint8_t* wizdata, uint16_t len)
     setSn_TX_WR(ptr);
 }
 
-void Wiznet5100::wizchip_recv_data(uint8_t* wizdata, uint16_t len)
+void Wiznet5100::wizchip_recv_data(uint8_t *wizdata, uint16_t len)
 {
     uint16_t ptr;
     uint16_t size;
@@ -165,14 +167,15 @@ void Wiznet5100::wizchip_recv_data(uint8_t* wizdata, uint16_t len)
     ptr = getSn_RX_RD();
 
     src_mask = ptr & RxBufferMask;
-    src_ptr  = RxBufferAddress + src_mask;
+    src_ptr = RxBufferAddress + src_mask;
+
 
     if ((src_mask + len) > RxBufferLength)
     {
         size = RxBufferLength - src_mask;
         wizchip_read_buf(src_ptr, wizdata, size);
         wizdata += size;
-        size    = len - size;
+        size = len - size;
         src_ptr = RxBufferAddress;
         wizchip_read_buf(src_ptr, wizdata, size);
     }
@@ -198,18 +201,19 @@ void Wiznet5100::wizchip_recv_ignore(uint16_t len)
 void Wiznet5100::wizchip_sw_reset()
 {
     setMR(MR_RST);
-    getMR();  // for delay
+    getMR(); // for delay
 
     setSHAR(_mac_address);
 }
 
-Wiznet5100::Wiznet5100(int8_t cs, SPIClass& spi, int8_t intr) :
+
+Wiznet5100::Wiznet5100(int8_t cs, SPIClass& spi, int8_t intr):
     _spi(spi), _cs(cs)
 {
     (void)intr;
 }
 
-boolean Wiznet5100::begin(const uint8_t* mac_address)
+boolean Wiznet5100::begin(const uint8_t *mac_address)
 {
     memcpy(_mac_address, mac_address, 6);
 
@@ -253,11 +257,10 @@ void Wiznet5100::end()
     setSn_IR(0xFF);
 
     // Wait for socket to change to closed
-    while (getSn_SR() != SOCK_CLOSED)
-        ;
+    while (getSn_SR() != SOCK_CLOSED);
 }
 
-uint16_t Wiznet5100::readFrame(uint8_t* buffer, uint16_t bufsize)
+uint16_t Wiznet5100::readFrame(uint8_t *buffer, uint16_t bufsize)
 {
     uint16_t data_len = readFrameSize();
 
@@ -285,7 +288,7 @@ uint16_t Wiznet5100::readFrameSize()
         return 0;
     }
 
-    uint8_t  head[2];
+    uint8_t head[2];
     uint16_t data_len = 0;
 
     wizchip_recv_data(head, 2);
@@ -304,7 +307,7 @@ void Wiznet5100::discardFrame(uint16_t framesize)
     setSn_CR(Sn_CR_RECV);
 }
 
-uint16_t Wiznet5100::readFrameData(uint8_t* buffer, uint16_t framesize)
+uint16_t Wiznet5100::readFrameData(uint8_t *buffer, uint16_t framesize)
 {
     wizchip_recv_data(buffer, framesize);
     setSn_CR(Sn_CR_RECV);
@@ -326,7 +329,7 @@ uint16_t Wiznet5100::readFrameData(uint8_t* buffer, uint16_t framesize)
 #endif
 }
 
-uint16_t Wiznet5100::sendFrame(const uint8_t* buf, uint16_t len)
+uint16_t Wiznet5100::sendFrame(const uint8_t *buf, uint16_t len)
 {
     // Wait for space in the transmit buffer
     while (1)
diff --git a/libraries/lwIP_w5100/src/utility/w5100.h b/libraries/lwIP_w5100/src/utility/w5100.h
index ebe11d210f..43b9f0b9f3 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.h
+++ b/libraries/lwIP_w5100/src/utility/w5100.h
@@ -32,15 +32,17 @@
 
 // original sources: https://github.com/njh/W5100MacRaw
 
-#ifndef W5100_H
-#define W5100_H
+#ifndef	W5100_H
+#define	W5100_H
 
 #include <stdint.h>
 #include <Arduino.h>
 #include <SPI.h>
 
+
 class Wiznet5100
 {
+
 public:
     /**
         Constructor that uses the default hardware SPI pins
@@ -55,7 +57,7 @@ class Wiznet5100
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean begin(const uint8_t* address);
+    boolean begin(const uint8_t *address);
 
     /**
         Shut down the Ethernet controlled
@@ -68,7 +70,7 @@ class Wiznet5100
         @param datalen the length of the data in the packet
         @return the number of bytes transmitted
     */
-    uint16_t sendFrame(const uint8_t* data, uint16_t datalen);
+    uint16_t sendFrame(const uint8_t *data, uint16_t datalen);
 
     /**
         Read an Ethernet frame
@@ -77,9 +79,10 @@ class Wiznet5100
         @return the length of the received packet
                or 0 if no packet was received
     */
-    uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
+    uint16_t readFrame(uint8_t *buffer, uint16_t bufsize);
 
 protected:
+
     static constexpr bool interruptIsPossible()
     {
         return false;
@@ -107,21 +110,23 @@ class Wiznet5100
         @return the length of the received frame
                or 0 if a problem occurred
     */
-    uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
+    uint16_t readFrameData(uint8_t *frame, uint16_t framesize);
+
 
 private:
-    static const uint16_t TxBufferAddress = 0x4000;                    /* Internal Tx buffer address of the iinchip */
-    static const uint16_t RxBufferAddress = 0x6000;                    /* Internal Rx buffer address of the iinchip */
-    static const uint8_t  TxBufferSize    = 0x3;                       /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
-    static const uint8_t  RxBufferSize    = 0x3;                       /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
-    static const uint16_t TxBufferLength  = (1 << TxBufferSize) << 10; /* Length of Tx buffer in bytes */
-    static const uint16_t RxBufferLength  = (1 << RxBufferSize) << 10; /* Length of Rx buffer in bytes */
-    static const uint16_t TxBufferMask    = TxBufferLength - 1;
-    static const uint16_t RxBufferMask    = RxBufferLength - 1;
+    static const uint16_t TxBufferAddress = 0x4000;  /* Internal Tx buffer address of the iinchip */
+    static const uint16_t RxBufferAddress = 0x6000;  /* Internal Rx buffer address of the iinchip */
+    static const uint8_t TxBufferSize = 0x3; /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
+    static const uint8_t RxBufferSize = 0x3; /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
+    static const uint16_t TxBufferLength = (1 << TxBufferSize) << 10; /* Length of Tx buffer in bytes */
+    static const uint16_t RxBufferLength = (1 << RxBufferSize) << 10; /* Length of Rx buffer in bytes */
+    static const uint16_t TxBufferMask = TxBufferLength - 1;
+    static const uint16_t RxBufferMask = RxBufferLength - 1;
+
 
     SPIClass& _spi;
-    int8_t    _cs;
-    uint8_t   _mac_address[6];
+    int8_t _cs;
+    uint8_t _mac_address[6];
 
     /**
         Default function to select chip.
@@ -189,6 +194,7 @@ class Wiznet5100
     */
     void wizchip_write_buf(uint16_t address, const uint8_t* pBuf, uint16_t len);
 
+
     /**
         Reset WIZCHIP by softly.
     */
@@ -206,7 +212,7 @@ class Wiznet5100
         @param len Data length
         @sa wizchip_recv_data()
     */
-    void wizchip_send_data(const uint8_t* wizdata, uint16_t len);
+    void wizchip_send_data(const uint8_t *wizdata, uint16_t len);
 
     /**
         It copies data to your buffer from internal RX memory
@@ -220,7 +226,7 @@ class Wiznet5100
         @param len Data length
         @sa wizchip_send_data()
     */
-    void wizchip_recv_data(uint8_t* wizdata, uint16_t len);
+    void wizchip_recv_data(uint8_t *wizdata, uint16_t len);
 
     /**
         It discard the received data in RX memory.
@@ -241,105 +247,106 @@ class Wiznet5100
     */
     uint16_t getSn_RX_RSR();
 
+
     /** Common registers */
     enum
     {
-        MR   = 0x0000,  ///< Mode Register address (R/W)
-        GAR  = 0x0001,  ///< Gateway IP Register address (R/W)
-        SUBR = 0x0005,  ///< Subnet mask Register address (R/W)
-        SHAR = 0x0009,  ///< Source MAC Register address (R/W)
-        SIPR = 0x000F,  ///< Source IP Register address (R/W)
-        IR   = 0x0015,  ///< Interrupt Register (R/W)
-        IMR  = 0x0016,  ///< Socket Interrupt Mask Register (R/W)
-        RTR  = 0x0017,  ///< Timeout register address (1 is 100us) (R/W)
-        RCR  = 0x0019,  ///< Retry count register (R/W)
-        RMSR = 0x001A,  ///< Receive Memory Size
-        TMSR = 0x001B,  ///< Transmit Memory Size
+        MR = 0x0000,        ///< Mode Register address (R/W)
+        GAR = 0x0001,       ///< Gateway IP Register address (R/W)
+        SUBR = 0x0005,      ///< Subnet mask Register address (R/W)
+        SHAR = 0x0009,      ///< Source MAC Register address (R/W)
+        SIPR = 0x000F,      ///< Source IP Register address (R/W)
+        IR = 0x0015,        ///< Interrupt Register (R/W)
+        IMR = 0x0016,       ///< Socket Interrupt Mask Register (R/W)
+        RTR = 0x0017,       ///< Timeout register address (1 is 100us) (R/W)
+        RCR = 0x0019,       ///< Retry count register (R/W)
+        RMSR = 0x001A,      ///< Receive Memory Size
+        TMSR = 0x001B,      ///< Transmit Memory Size
     };
 
     /** Socket registers */
     enum
     {
-        Sn_MR     = 0x0400,  ///< Socket Mode register(R/W)
-        Sn_CR     = 0x0401,  ///< Socket command register (R/W)
-        Sn_IR     = 0x0402,  ///< Socket interrupt register (R)
-        Sn_SR     = 0x0403,  ///< Socket status register (R)
-        Sn_PORT   = 0x0404,  ///< Source port register (R/W)
-        Sn_DHAR   = 0x0406,  ///< Peer MAC register address (R/W)
-        Sn_DIPR   = 0x040C,  ///< Peer IP register address (R/W)
-        Sn_DPORT  = 0x0410,  ///< Peer port register address (R/W)
-        Sn_MSSR   = 0x0412,  ///< Maximum Segment Size(Sn_MSSR0) register address (R/W)
-        Sn_PROTO  = 0x0414,  ///< IP Protocol(PROTO) Register (R/W)
-        Sn_TOS    = 0x0415,  ///< IP Type of Service(TOS) Register (R/W)
-        Sn_TTL    = 0x0416,  ///< IP Time to live(TTL) Register (R/W)
-        Sn_TX_FSR = 0x0420,  ///< Transmit free memory size register (R)
-        Sn_TX_RD  = 0x0422,  ///< Transmit memory read pointer register address (R)
-        Sn_TX_WR  = 0x0424,  ///< Transmit memory write pointer register address (R/W)
-        Sn_RX_RSR = 0x0426,  ///< Received data size register (R)
-        Sn_RX_RD  = 0x0428,  ///< Read point of Receive memory (R/W)
-        Sn_RX_WR  = 0x042A,  ///< Write point of Receive memory (R)
+        Sn_MR = 0x0400,     ///< Socket Mode register(R/W)
+        Sn_CR = 0x0401,     ///< Socket command register (R/W)
+        Sn_IR = 0x0402,     ///< Socket interrupt register (R)
+        Sn_SR = 0x0403,     ///< Socket status register (R)
+        Sn_PORT = 0x0404,   ///< Source port register (R/W)
+        Sn_DHAR = 0x0406,   ///< Peer MAC register address (R/W)
+        Sn_DIPR = 0x040C,   ///< Peer IP register address (R/W)
+        Sn_DPORT = 0x0410,  ///< Peer port register address (R/W)
+        Sn_MSSR = 0x0412,   ///< Maximum Segment Size(Sn_MSSR0) register address (R/W)
+        Sn_PROTO = 0x0414,  ///< IP Protocol(PROTO) Register (R/W)
+        Sn_TOS = 0x0415,    ///< IP Type of Service(TOS) Register (R/W)
+        Sn_TTL = 0x0416,    ///< IP Time to live(TTL) Register (R/W)
+        Sn_TX_FSR = 0x0420, ///< Transmit free memory size register (R)
+        Sn_TX_RD = 0x0422,  ///< Transmit memory read pointer register address (R)
+        Sn_TX_WR = 0x0424,  ///< Transmit memory write pointer register address (R/W)
+        Sn_RX_RSR = 0x0426, ///< Received data size register (R)
+        Sn_RX_RD = 0x0428,  ///< Read point of Receive memory (R/W)
+        Sn_RX_WR = 0x042A,  ///< Write point of Receive memory (R)
     };
 
     /** Mode register values */
     enum
     {
-        MR_RST = 0x80,  ///< Reset
-        MR_PB  = 0x10,  ///< Ping block
-        MR_AI  = 0x02,  ///< Address Auto-Increment in Indirect Bus Interface
-        MR_IND = 0x01,  ///< Indirect Bus Interface mode
+        MR_RST = 0x80,    ///< Reset
+        MR_PB = 0x10,     ///< Ping block
+        MR_AI = 0x02,     ///< Address Auto-Increment in Indirect Bus Interface
+        MR_IND = 0x01,    ///< Indirect Bus Interface mode
     };
 
     /** Socket Mode Register values @ref Sn_MR */
     enum
     {
-        Sn_MR_CLOSE  = 0x00,  ///< Unused socket
-        Sn_MR_TCP    = 0x01,  ///< TCP
-        Sn_MR_UDP    = 0x02,  ///< UDP
-        Sn_MR_IPRAW  = 0x03,  ///< IP LAYER RAW SOCK
-        Sn_MR_MACRAW = 0x04,  ///< MAC LAYER RAW SOCK
-        Sn_MR_ND     = 0x20,  ///< No Delayed Ack(TCP) flag
-        Sn_MR_MF     = 0x40,  ///< Use MAC filter
-        Sn_MR_MULTI  = 0x80,  ///< support multicating
+        Sn_MR_CLOSE = 0x00,  ///< Unused socket
+        Sn_MR_TCP = 0x01,    ///< TCP
+        Sn_MR_UDP = 0x02,    ///< UDP
+        Sn_MR_IPRAW = 0x03,  ///< IP LAYER RAW SOCK
+        Sn_MR_MACRAW = 0x04, ///< MAC LAYER RAW SOCK
+        Sn_MR_ND = 0x20,     ///< No Delayed Ack(TCP) flag
+        Sn_MR_MF = 0x40,     ///< Use MAC filter
+        Sn_MR_MULTI = 0x80,  ///< support multicating
     };
 
     /** Socket Command Register values */
     enum
     {
-        Sn_CR_OPEN      = 0x01,  ///< Initialise or open socket
-        Sn_CR_CLOSE     = 0x10,  ///< Close socket
-        Sn_CR_SEND      = 0x20,  ///< Update TX buffer pointer and send data
-        Sn_CR_SEND_MAC  = 0x21,  ///< Send data with MAC address, so without ARP process
-        Sn_CR_SEND_KEEP = 0x22,  ///< Send keep alive message
-        Sn_CR_RECV      = 0x40,  ///< Update RX buffer pointer and receive data
+        Sn_CR_OPEN = 0x01,      ///< Initialise or open socket
+        Sn_CR_CLOSE = 0x10,     ///< Close socket
+        Sn_CR_SEND = 0x20,      ///< Update TX buffer pointer and send data
+        Sn_CR_SEND_MAC = 0x21,  ///< Send data with MAC address, so without ARP process
+        Sn_CR_SEND_KEEP = 0x22, ///< Send keep alive message
+        Sn_CR_RECV = 0x40,      ///< Update RX buffer pointer and receive data
     };
 
     /** Socket Interrupt register values */
     enum
     {
-        Sn_IR_CON     = 0x01,  ///< CON Interrupt
-        Sn_IR_DISCON  = 0x02,  ///< DISCON Interrupt
-        Sn_IR_RECV    = 0x04,  ///< RECV Interrupt
+        Sn_IR_CON = 0x01,      ///< CON Interrupt
+        Sn_IR_DISCON = 0x02,   ///< DISCON Interrupt
+        Sn_IR_RECV = 0x04,     ///< RECV Interrupt
         Sn_IR_TIMEOUT = 0x08,  ///< TIMEOUT Interrupt
-        Sn_IR_SENDOK  = 0x10,  ///< SEND_OK Interrupt
+        Sn_IR_SENDOK = 0x10,   ///< SEND_OK Interrupt
     };
 
     /** Socket Status Register values */
     enum
     {
-        SOCK_CLOSED      = 0x00,  ///< Closed
-        SOCK_INIT        = 0x13,  ///< Initiate state
-        SOCK_LISTEN      = 0x14,  ///< Listen state
-        SOCK_SYNSENT     = 0x15,  ///< Connection state
-        SOCK_SYNRECV     = 0x16,  ///< Connection state
-        SOCK_ESTABLISHED = 0x17,  ///< Success to connect
-        SOCK_FIN_WAIT    = 0x18,  ///< Closing state
-        SOCK_CLOSING     = 0x1A,  ///< Closing state
-        SOCK_TIME_WAIT   = 0x1B,  ///< Closing state
-        SOCK_CLOSE_WAIT  = 0x1C,  ///< Closing state
-        SOCK_LAST_ACK    = 0x1D,  ///< Closing state
-        SOCK_UDP         = 0x22,  ///< UDP socket
-        SOCK_IPRAW       = 0x32,  ///< IP raw mode socket
-        SOCK_MACRAW      = 0x42,  ///< MAC raw mode socket
+        SOCK_CLOSED = 0x00,      ///< Closed
+        SOCK_INIT = 0x13,        ///< Initiate state
+        SOCK_LISTEN = 0x14,      ///< Listen state
+        SOCK_SYNSENT = 0x15,     ///< Connection state
+        SOCK_SYNRECV = 0x16,     ///< Connection state
+        SOCK_ESTABLISHED = 0x17, ///< Success to connect
+        SOCK_FIN_WAIT = 0x18,    ///< Closing state
+        SOCK_CLOSING = 0x1A,     ///< Closing state
+        SOCK_TIME_WAIT = 0x1B,   ///< Closing state
+        SOCK_CLOSE_WAIT = 0x1C,  ///< Closing state
+        SOCK_LAST_ACK = 0x1D,    ///< Closing state
+        SOCK_UDP = 0x22,         ///< UDP socket
+        SOCK_IPRAW = 0x32,       ///< IP raw mode socket
+        SOCK_MACRAW = 0x42,      ///< MAC raw mode socket
     };
 
     /**
@@ -489,4 +496,4 @@ class Wiznet5100
     }
 };
 
-#endif  // W5100_H
+#endif // W5100_H
diff --git a/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino b/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino
index 1cd0ef9137..bdece2d88b 100644
--- a/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino
+++ b/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino
@@ -8,24 +8,24 @@
 //or #include <W5100lwIP.h>
 //or #include <ENC28J60lwIP.h>
 
-#include <WiFiClient.h>  // WiFiClient (-> TCPClient)
+#include <WiFiClient.h> // WiFiClient (-> TCPClient)
 
-const char*    host = "djxmmx.net";
+const char* host = "djxmmx.net";
 const uint16_t port = 17;
 
 using TCPClient = WiFiClient;
 
-#define CSPIN 16  // wemos/lolin/nodemcu D0
+#define CSPIN 16 // wemos/lolin/nodemcu D0
 Wiznet5500lwIP eth(CSPIN);
 
 void setup() {
   Serial.begin(115200);
 
   SPI.begin();
-  SPI.setClockDivider(SPI_CLOCK_DIV4);  // 4 MHz?
+  SPI.setClockDivider(SPI_CLOCK_DIV4); // 4 MHz?
   SPI.setBitOrder(MSBFIRST);
   SPI.setDataMode(SPI_MODE0);
-  eth.setDefault();  // use ethernet for default route
+  eth.setDefault(); // use ethernet for default route
   if (!eth.begin()) {
     Serial.println("ethernet hardware not found ... sleeping");
     while (1) {
@@ -89,7 +89,7 @@ void loop() {
   client.stop();
 
   if (wait) {
-    delay(300000);  // execute once every 5 minutes, don't flood remote service
+    delay(300000); // execute once every 5 minutes, don't flood remote service
   }
   wait = true;
 }
diff --git a/libraries/lwIP_w5500/src/utility/w5500.cpp b/libraries/lwIP_w5500/src/utility/w5500.cpp
index cc4a1e245d..b3c3ce0162 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.cpp
+++ b/libraries/lwIP_w5500/src/utility/w5500.cpp
@@ -35,6 +35,7 @@
 #include <SPI.h>
 #include "w5500.h"
 
+
 uint8_t Wiznet5500::wizchip_read(uint8_t block, uint16_t address)
 {
     uint8_t ret;
@@ -94,7 +95,7 @@ void Wiznet5500::wizchip_write(uint8_t block, uint16_t address, uint8_t wb)
 void Wiznet5500::wizchip_write_word(uint8_t block, uint16_t address, uint16_t word)
 {
     wizchip_write(block, address, (uint8_t)(word >> 8));
-    wizchip_write(block, address + 1, (uint8_t)word);
+    wizchip_write(block, address + 1, (uint8_t) word);
 }
 
 void Wiznet5500::wizchip_write_buf(uint8_t block, uint16_t address, const uint8_t* pBuf, uint16_t len)
@@ -122,8 +123,7 @@ void Wiznet5500::setSn_CR(uint8_t cr)
     wizchip_write(BlockSelectSReg, Sn_CR, cr);
 
     // Now wait for the command to complete
-    while (wizchip_read(BlockSelectSReg, Sn_CR))
-        ;
+    while (wizchip_read(BlockSelectSReg, Sn_CR));
 }
 
 uint16_t Wiznet5500::getSn_TX_FSR()
@@ -140,6 +140,7 @@ uint16_t Wiznet5500::getSn_TX_FSR()
     return val;
 }
 
+
 uint16_t Wiznet5500::getSn_RX_RSR()
 {
     uint16_t val = 0, val1 = 0;
@@ -154,7 +155,7 @@ uint16_t Wiznet5500::getSn_RX_RSR()
     return val;
 }
 
-void Wiznet5500::wizchip_send_data(const uint8_t* wizdata, uint16_t len)
+void Wiznet5500::wizchip_send_data(const uint8_t *wizdata, uint16_t len)
 {
     uint16_t ptr = 0;
 
@@ -170,7 +171,7 @@ void Wiznet5500::wizchip_send_data(const uint8_t* wizdata, uint16_t len)
     setSn_TX_WR(ptr);
 }
 
-void Wiznet5500::wizchip_recv_data(uint8_t* wizdata, uint16_t len)
+void Wiznet5500::wizchip_recv_data(uint8_t *wizdata, uint16_t len)
 {
     uint16_t ptr;
 
@@ -197,7 +198,7 @@ void Wiznet5500::wizchip_recv_ignore(uint16_t len)
 void Wiznet5500::wizchip_sw_reset()
 {
     setMR(MR_RST);
-    getMR();  // for delay
+    getMR(); // for delay
 
     setSHAR(_mac_address);
 }
@@ -243,7 +244,7 @@ void Wiznet5500::wizphy_reset()
 int8_t Wiznet5500::wizphy_setphypmode(uint8_t pmode)
 {
     uint8_t tmp = 0;
-    tmp         = getPHYCFGR();
+    tmp = getPHYCFGR();
     if ((tmp & PHYCFGR_OPMD) == 0)
     {
         return -1;
@@ -277,13 +278,14 @@ int8_t Wiznet5500::wizphy_setphypmode(uint8_t pmode)
     return -1;
 }
 
-Wiznet5500::Wiznet5500(int8_t cs, SPIClass& spi, int8_t intr) :
+
+Wiznet5500::Wiznet5500(int8_t cs, SPIClass& spi, int8_t intr):
     _spi(spi), _cs(cs)
 {
     (void)intr;
 }
 
-boolean Wiznet5500::begin(const uint8_t* mac_address)
+boolean Wiznet5500::begin(const uint8_t *mac_address)
 {
     memcpy(_mac_address, mac_address, 6);
 
@@ -327,11 +329,10 @@ void Wiznet5500::end()
     setSn_IR(0xFF);
 
     // Wait for socket to change to closed
-    while (getSn_SR() != SOCK_CLOSED)
-        ;
+    while (getSn_SR() != SOCK_CLOSED);
 }
 
-uint16_t Wiznet5500::readFrame(uint8_t* buffer, uint16_t bufsize)
+uint16_t Wiznet5500::readFrame(uint8_t *buffer, uint16_t bufsize)
 {
     uint16_t data_len = readFrameSize();
 
@@ -359,7 +360,7 @@ uint16_t Wiznet5500::readFrameSize()
         return 0;
     }
 
-    uint8_t  head[2];
+    uint8_t head[2];
     uint16_t data_len = 0;
 
     wizchip_recv_data(head, 2);
@@ -378,7 +379,7 @@ void Wiznet5500::discardFrame(uint16_t framesize)
     setSn_CR(Sn_CR_RECV);
 }
 
-uint16_t Wiznet5500::readFrameData(uint8_t* buffer, uint16_t framesize)
+uint16_t Wiznet5500::readFrameData(uint8_t *buffer, uint16_t framesize)
 {
     wizchip_recv_data(buffer, framesize);
     setSn_CR(Sn_CR_RECV);
@@ -401,7 +402,7 @@ uint16_t Wiznet5500::readFrameData(uint8_t* buffer, uint16_t framesize)
 #endif
 }
 
-uint16_t Wiznet5500::sendFrame(const uint8_t* buf, uint16_t len)
+uint16_t Wiznet5500::sendFrame(const uint8_t *buf, uint16_t len)
 {
     // Wait for space in the transmit buffer
     while (1)
diff --git a/libraries/lwIP_w5500/src/utility/w5500.h b/libraries/lwIP_w5500/src/utility/w5500.h
index 181e38848a..85b253a4bf 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.h
+++ b/libraries/lwIP_w5500/src/utility/w5500.h
@@ -39,8 +39,11 @@
 #include <Arduino.h>
 #include <SPI.h>
 
+
+
 class Wiznet5500
 {
+
 public:
     /**
         Constructor that uses the default hardware SPI pins
@@ -48,6 +51,7 @@ class Wiznet5500
     */
     Wiznet5500(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1);
 
+
     /**
         Initialise the Ethernet controller
         Must be called before sending or receiving Ethernet frames
@@ -55,7 +59,7 @@ class Wiznet5500
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean begin(const uint8_t* address);
+    boolean begin(const uint8_t *address);
 
     /**
         Shut down the Ethernet controlled
@@ -68,7 +72,7 @@ class Wiznet5500
         @param datalen the length of the data in the packet
         @return the number of bytes transmitted
     */
-    uint16_t sendFrame(const uint8_t* data, uint16_t datalen);
+    uint16_t sendFrame(const uint8_t *data, uint16_t datalen);
 
     /**
         Read an Ethernet frame
@@ -77,9 +81,10 @@ class Wiznet5500
         @return the length of the received packet
                or 0 if no packet was received
     */
-    uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
+    uint16_t readFrame(uint8_t *buffer, uint16_t bufsize);
 
 protected:
+
     static constexpr bool interruptIsPossible()
     {
         return false;
@@ -107,9 +112,11 @@ class Wiznet5500
         @return the length of the received frame
                or 0 if a problem occurred
     */
-    uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
+    uint16_t readFrameData(uint8_t *frame, uint16_t framesize);
+
 
 private:
+
     //< SPI interface Read operation in Control Phase
     static const uint8_t AccessModeRead = (0x00 << 2);
 
@@ -128,9 +135,11 @@ class Wiznet5500
     //< Socket 0 Rx buffer address block
     static const uint8_t BlockSelectRxBuf = (0x03 << 3);
 
+
+
     SPIClass& _spi;
-    int8_t    _cs;
-    uint8_t   _mac_address[6];
+    int8_t _cs;
+    uint8_t _mac_address[6];
 
     /**
         Default function to select chip.
@@ -172,6 +181,7 @@ class Wiznet5500
         _spi.transfer(wb);
     }
 
+
     /**
         Read a 1 byte value from a register.
         @param address Register address
@@ -230,6 +240,7 @@ class Wiznet5500
     */
     uint16_t getSn_RX_RSR();
 
+
     /**
         Reset WIZCHIP by softly.
     */
@@ -268,7 +279,7 @@ class Wiznet5500
         @param len Data length
         @sa wizchip_recv_data()
     */
-    void wizchip_send_data(const uint8_t* wizdata, uint16_t len);
+    void wizchip_send_data(const uint8_t *wizdata, uint16_t len);
 
     /**
         It copies data to your buffer from internal RX memory
@@ -282,7 +293,7 @@ class Wiznet5500
         @param len Data length
         @sa wizchip_send_data()
     */
-    void wizchip_recv_data(uint8_t* wizdata, uint16_t len);
+    void wizchip_recv_data(uint8_t *wizdata, uint16_t len);
 
     /**
         It discard the received data in RX memory.
@@ -291,170 +302,174 @@ class Wiznet5500
     */
     void wizchip_recv_ignore(uint16_t len);
 
+
+
     /** Common registers */
     enum
     {
-        MR       = 0x0000,  ///< Mode Register address (R/W)
-        SHAR     = 0x0009,  ///< Source MAC Register address (R/W)
+        MR = 0x0000,        ///< Mode Register address (R/W)
+        SHAR = 0x0009,      ///< Source MAC Register address (R/W)
         INTLEVEL = 0x0013,  ///< Set Interrupt low level timer register address (R/W)
-        IR       = 0x0015,  ///< Interrupt Register (R/W)
-        _IMR_    = 0x0016,  ///< Interrupt mask register (R/W)
-        SIR      = 0x0017,  ///< Socket Interrupt Register (R/W)
-        SIMR     = 0x0018,  ///< Socket Interrupt Mask Register (R/W)
-        _RTR_    = 0x0019,  ///< Timeout register address (1 is 100us) (R/W)
-        _RCR_    = 0x001B,  ///< Retry count register (R/W)
-        UIPR     = 0x0028,  ///< Unreachable IP register address in UDP mode (R)
-        UPORTR   = 0x002C,  ///< Unreachable Port register address in UDP mode (R)
-        PHYCFGR  = 0x002E,  ///< PHY Status Register (R/W)
+        IR = 0x0015,        ///< Interrupt Register (R/W)
+        _IMR_ = 0x0016,     ///< Interrupt mask register (R/W)
+        SIR = 0x0017,       ///< Socket Interrupt Register (R/W)
+        SIMR = 0x0018,      ///< Socket Interrupt Mask Register (R/W)
+        _RTR_ = 0x0019,     ///< Timeout register address (1 is 100us) (R/W)
+        _RCR_ = 0x001B,     ///< Retry count register (R/W)
+        UIPR = 0x0028,      ///< Unreachable IP register address in UDP mode (R)
+        UPORTR = 0x002C,    ///< Unreachable Port register address in UDP mode (R)
+        PHYCFGR = 0x002E,   ///< PHY Status Register (R/W)
         VERSIONR = 0x0039,  ///< Chip version register address (R)
     };
 
     /** Socket registers */
     enum
     {
-        Sn_MR         = 0x0000,  ///< Socket Mode register (R/W)
-        Sn_CR         = 0x0001,  ///< Socket command register (R/W)
-        Sn_IR         = 0x0002,  ///< Socket interrupt register (R)
-        Sn_SR         = 0x0003,  ///< Socket status register (R)
-        Sn_PORT       = 0x0004,  ///< Source port register (R/W)
-        Sn_DHAR       = 0x0006,  ///< Peer MAC register address (R/W)
-        Sn_DIPR       = 0x000C,  ///< Peer IP register address (R/W)
-        Sn_DPORT      = 0x0010,  ///< Peer port register address (R/W)
-        Sn_MSSR       = 0x0012,  ///< Maximum Segment Size(Sn_MSSR0) register address (R/W)
-        Sn_TOS        = 0x0015,  ///< IP Type of Service(TOS) Register (R/W)
-        Sn_TTL        = 0x0016,  ///< IP Time to live(TTL) Register (R/W)
+        Sn_MR = 0x0000,          ///< Socket Mode register (R/W)
+        Sn_CR = 0x0001,          ///< Socket command register (R/W)
+        Sn_IR = 0x0002,          ///< Socket interrupt register (R)
+        Sn_SR = 0x0003,          ///< Socket status register (R)
+        Sn_PORT = 0x0004,        ///< Source port register (R/W)
+        Sn_DHAR = 0x0006,        ///< Peer MAC register address (R/W)
+        Sn_DIPR = 0x000C,        ///< Peer IP register address (R/W)
+        Sn_DPORT = 0x0010,       ///< Peer port register address (R/W)
+        Sn_MSSR = 0x0012,        ///< Maximum Segment Size(Sn_MSSR0) register address (R/W)
+        Sn_TOS = 0x0015,         ///< IP Type of Service(TOS) Register (R/W)
+        Sn_TTL = 0x0016,         ///< IP Time to live(TTL) Register (R/W)
         Sn_RXBUF_SIZE = 0x001E,  ///< Receive memory size register (R/W)
         Sn_TXBUF_SIZE = 0x001F,  ///< Transmit memory size register (R/W)
-        Sn_TX_FSR     = 0x0020,  ///< Transmit free memory size register (R)
-        Sn_TX_RD      = 0x0022,  ///< Transmit memory read pointer register address (R)
-        Sn_TX_WR      = 0x0024,  ///< Transmit memory write pointer register address (R/W)
-        Sn_RX_RSR     = 0x0026,  ///< Received data size register (R)
-        Sn_RX_RD      = 0x0028,  ///< Read point of Receive memory (R/W)
-        Sn_RX_WR      = 0x002A,  ///< Write point of Receive memory (R)
-        Sn_IMR        = 0x002C,  ///< Socket interrupt mask register (R)
-        Sn_FRAG       = 0x002D,  ///< Fragment field value in IP header register (R/W)
-        Sn_KPALVTR    = 0x002F,  ///< Keep Alive Timer register (R/W)
+        Sn_TX_FSR = 0x0020,      ///< Transmit free memory size register (R)
+        Sn_TX_RD = 0x0022,       ///< Transmit memory read pointer register address (R)
+        Sn_TX_WR = 0x0024,       ///< Transmit memory write pointer register address (R/W)
+        Sn_RX_RSR = 0x0026,      ///< Received data size register (R)
+        Sn_RX_RD = 0x0028,       ///< Read point of Receive memory (R/W)
+        Sn_RX_WR = 0x002A,       ///< Write point of Receive memory (R)
+        Sn_IMR = 0x002C,         ///< Socket interrupt mask register (R)
+        Sn_FRAG = 0x002D,        ///< Fragment field value in IP header register (R/W)
+        Sn_KPALVTR = 0x002F,     ///< Keep Alive Timer register (R/W)
     };
 
     /** Mode register values */
     enum
     {
-        MR_RST   = 0x80,  ///< Reset
-        MR_WOL   = 0x20,  ///< Wake on LAN
-        MR_PB    = 0x10,  ///< Ping block
+        MR_RST = 0x80,    ///< Reset
+        MR_WOL = 0x20,    ///< Wake on LAN
+        MR_PB = 0x10,     ///< Ping block
         MR_PPPOE = 0x08,  ///< Enable PPPoE
-        MR_FARP  = 0x02,  ///< Enable UDP_FORCE_ARP CHECK
+        MR_FARP = 0x02,   ///< Enable UDP_FORCE_ARP CHECK
     };
 
     /* Interrupt Register values */
     enum
     {
         IR_CONFLICT = 0x80,  ///< Check IP conflict
-        IR_UNREACH  = 0x40,  ///< Get the destination unreachable message in UDP sending
-        IR_PPPoE    = 0x20,  ///< Get the PPPoE close message
-        IR_MP       = 0x10,  ///< Get the magic packet interrupt
+        IR_UNREACH = 0x40,   ///< Get the destination unreachable message in UDP sending
+        IR_PPPoE = 0x20,     ///< Get the PPPoE close message
+        IR_MP = 0x10,        ///< Get the magic packet interrupt
     };
 
     /* Interrupt Mask Register values */
     enum
     {
-        IM_IR7 = 0x80,  ///< IP Conflict Interrupt Mask
-        IM_IR6 = 0x40,  ///< Destination unreachable Interrupt Mask
-        IM_IR5 = 0x20,  ///< PPPoE Close Interrupt Mask
-        IM_IR4 = 0x10,  ///< Magic Packet Interrupt Mask
+        IM_IR7 = 0x80,   ///< IP Conflict Interrupt Mask
+        IM_IR6 = 0x40,   ///< Destination unreachable Interrupt Mask
+        IM_IR5 = 0x20,   ///< PPPoE Close Interrupt Mask
+        IM_IR4 = 0x10,   ///< Magic Packet Interrupt Mask
     };
 
     /** Socket Mode Register values @ref Sn_MR */
     enum
     {
-        Sn_MR_CLOSE  = 0x00,  ///< Unused socket
-        Sn_MR_TCP    = 0x01,  ///< TCP
-        Sn_MR_UDP    = 0x02,  ///< UDP
-        Sn_MR_MACRAW = 0x04,  ///< MAC LAYER RAW SOCK
-        Sn_MR_UCASTB = 0x10,  ///< Unicast Block in UDP Multicasting
-        Sn_MR_ND     = 0x20,  ///< No Delayed Ack(TCP), Multicast flag
-        Sn_MR_BCASTB = 0x40,  ///< Broadcast block in UDP Multicasting
-        Sn_MR_MULTI  = 0x80,  ///< Support UDP Multicasting
-        Sn_MR_MIP6B  = 0x10,  ///< IPv6 packet Blocking in @ref Sn_MR_MACRAW mode
-        Sn_MR_MMB    = 0x20,  ///< Multicast Blocking in @ref Sn_MR_MACRAW mode
-        Sn_MR_MFEN   = 0x80,  ///< MAC filter enable in @ref Sn_MR_MACRAW mode
+        Sn_MR_CLOSE = 0x00,  ///< Unused socket
+        Sn_MR_TCP = 0x01,    ///< TCP
+        Sn_MR_UDP = 0x02,    ///< UDP
+        Sn_MR_MACRAW = 0x04, ///< MAC LAYER RAW SOCK
+        Sn_MR_UCASTB = 0x10, ///< Unicast Block in UDP Multicasting
+        Sn_MR_ND = 0x20,     ///< No Delayed Ack(TCP), Multicast flag
+        Sn_MR_BCASTB = 0x40, ///< Broadcast block in UDP Multicasting
+        Sn_MR_MULTI = 0x80,  ///< Support UDP Multicasting
+        Sn_MR_MIP6B = 0x10,  ///< IPv6 packet Blocking in @ref Sn_MR_MACRAW mode
+        Sn_MR_MMB = 0x20,    ///< Multicast Blocking in @ref Sn_MR_MACRAW mode
+        Sn_MR_MFEN = 0x80,   ///< MAC filter enable in @ref Sn_MR_MACRAW mode
     };
 
     /** Socket Command Register values */
     enum
     {
-        Sn_CR_OPEN      = 0x01,  ///< Initialise or open socket
-        Sn_CR_LISTEN    = 0x02,  ///< Wait connection request in TCP mode (Server mode)
-        Sn_CR_CONNECT   = 0x04,  ///< Send connection request in TCP mode (Client mode)
-        Sn_CR_DISCON    = 0x08,  ///< Send closing request in TCP mode
-        Sn_CR_CLOSE     = 0x10,  ///< Close socket
-        Sn_CR_SEND      = 0x20,  ///< Update TX buffer pointer and send data
-        Sn_CR_SEND_MAC  = 0x21,  ///< Send data with MAC address, so without ARP process
-        Sn_CR_SEND_KEEP = 0x22,  ///< Send keep alive message
-        Sn_CR_RECV      = 0x40,  ///< Update RX buffer pointer and receive data
+        Sn_CR_OPEN = 0x01,      ///< Initialise or open socket
+        Sn_CR_LISTEN = 0x02,    ///< Wait connection request in TCP mode (Server mode)
+        Sn_CR_CONNECT = 0x04,   ///< Send connection request in TCP mode (Client mode)
+        Sn_CR_DISCON = 0x08,    ///< Send closing request in TCP mode
+        Sn_CR_CLOSE = 0x10,     ///< Close socket
+        Sn_CR_SEND = 0x20,      ///< Update TX buffer pointer and send data
+        Sn_CR_SEND_MAC = 0x21,  ///< Send data with MAC address, so without ARP process
+        Sn_CR_SEND_KEEP = 0x22, ///< Send keep alive message
+        Sn_CR_RECV = 0x40,      ///< Update RX buffer pointer and receive data
     };
 
     /** Socket Interrupt register values */
     enum
     {
-        Sn_IR_CON     = 0x01,  ///< CON Interrupt
-        Sn_IR_DISCON  = 0x02,  ///< DISCON Interrupt
-        Sn_IR_RECV    = 0x04,  ///< RECV Interrupt
+        Sn_IR_CON = 0x01,      ///< CON Interrupt
+        Sn_IR_DISCON = 0x02,   ///< DISCON Interrupt
+        Sn_IR_RECV = 0x04,     ///< RECV Interrupt
         Sn_IR_TIMEOUT = 0x08,  ///< TIMEOUT Interrupt
-        Sn_IR_SENDOK  = 0x10,  ///< SEND_OK Interrupt
+        Sn_IR_SENDOK = 0x10,   ///< SEND_OK Interrupt
     };
 
     /** Socket Status Register values */
     enum
     {
-        SOCK_CLOSED      = 0x00,  ///< Closed
-        SOCK_INIT        = 0x13,  ///< Initiate state
-        SOCK_LISTEN      = 0x14,  ///< Listen state
-        SOCK_SYNSENT     = 0x15,  ///< Connection state
-        SOCK_SYNRECV     = 0x16,  ///< Connection state
-        SOCK_ESTABLISHED = 0x17,  ///< Success to connect
-        SOCK_FIN_WAIT    = 0x18,  ///< Closing state
-        SOCK_CLOSING     = 0x1A,  ///< Closing state
-        SOCK_TIME_WAIT   = 0x1B,  ///< Closing state
-        SOCK_CLOSE_WAIT  = 0x1C,  ///< Closing state
-        SOCK_LAST_ACK    = 0x1D,  ///< Closing state
-        SOCK_UDP         = 0x22,  ///< UDP socket
-        SOCK_MACRAW      = 0x42,  ///< MAC raw mode socket
+        SOCK_CLOSED = 0x00,      ///< Closed
+        SOCK_INIT = 0x13,        ///< Initiate state
+        SOCK_LISTEN = 0x14,      ///< Listen state
+        SOCK_SYNSENT = 0x15,     ///< Connection state
+        SOCK_SYNRECV = 0x16,     ///< Connection state
+        SOCK_ESTABLISHED = 0x17, ///< Success to connect
+        SOCK_FIN_WAIT = 0x18,    ///< Closing state
+        SOCK_CLOSING = 0x1A,     ///< Closing state
+        SOCK_TIME_WAIT = 0x1B,   ///< Closing state
+        SOCK_CLOSE_WAIT = 0x1C,  ///< Closing state
+        SOCK_LAST_ACK = 0x1D,    ///< Closing state
+        SOCK_UDP = 0x22,         ///< UDP socket
+        SOCK_MACRAW = 0x42,      ///< MAC raw mode socket
     };
 
+
     /* PHYCFGR register value */
     enum
     {
-        PHYCFGR_RST         = ~(1 << 7),  //< For PHY reset, must operate AND mask.
-        PHYCFGR_OPMD        = (1 << 6),   // Configre PHY with OPMDC value
-        PHYCFGR_OPMDC_ALLA  = (7 << 3),
+        PHYCFGR_RST = ~(1 << 7), //< For PHY reset, must operate AND mask.
+        PHYCFGR_OPMD = (1 << 6), // Configre PHY with OPMDC value
+        PHYCFGR_OPMDC_ALLA = (7 << 3),
         PHYCFGR_OPMDC_PDOWN = (6 << 3),
-        PHYCFGR_OPMDC_NA    = (5 << 3),
+        PHYCFGR_OPMDC_NA = (5 << 3),
         PHYCFGR_OPMDC_100FA = (4 << 3),
-        PHYCFGR_OPMDC_100F  = (3 << 3),
-        PHYCFGR_OPMDC_100H  = (2 << 3),
-        PHYCFGR_OPMDC_10F   = (1 << 3),
-        PHYCFGR_OPMDC_10H   = (0 << 3),
-        PHYCFGR_DPX_FULL    = (1 << 2),
-        PHYCFGR_DPX_HALF    = (0 << 2),
-        PHYCFGR_SPD_100     = (1 << 1),
-        PHYCFGR_SPD_10      = (0 << 1),
-        PHYCFGR_LNK_ON      = (1 << 0),
-        PHYCFGR_LNK_OFF     = (0 << 0),
+        PHYCFGR_OPMDC_100F = (3 << 3),
+        PHYCFGR_OPMDC_100H = (2 << 3),
+        PHYCFGR_OPMDC_10F = (1 << 3),
+        PHYCFGR_OPMDC_10H = (0 << 3),
+        PHYCFGR_DPX_FULL = (1 << 2),
+        PHYCFGR_DPX_HALF = (0 << 2),
+        PHYCFGR_SPD_100 = (1 << 1),
+        PHYCFGR_SPD_10 = (0 << 1),
+        PHYCFGR_LNK_ON = (1 << 0),
+        PHYCFGR_LNK_OFF = (0 << 0),
     };
 
     enum
     {
-        PHY_SPEED_10    = 0,  ///< Link Speed 10
-        PHY_SPEED_100   = 1,  ///< Link Speed 100
+        PHY_SPEED_10 = 0,     ///< Link Speed 10
+        PHY_SPEED_100 = 1,    ///< Link Speed 100
         PHY_DUPLEX_HALF = 0,  ///< Link Half-Duplex
         PHY_DUPLEX_FULL = 1,  ///< Link Full-Duplex
-        PHY_LINK_OFF    = 0,  ///< Link Off
-        PHY_LINK_ON     = 1,  ///< Link On
-        PHY_POWER_NORM  = 0,  ///< PHY power normal mode
-        PHY_POWER_DOWN  = 1,  ///< PHY power down mode
+        PHY_LINK_OFF = 0,     ///< Link Off
+        PHY_LINK_ON = 1,      ///< Link On
+        PHY_POWER_NORM = 0,   ///< PHY power normal mode
+        PHY_POWER_DOWN = 1,   ///< PHY power down mode
     };
 
+
     /**
         Set Mode Register
         @param (uint8_t)mr The value to be set.
@@ -749,4 +764,4 @@ class Wiznet5500
     }
 };
 
-#endif  // W5500_H
+#endif // W5500_H
diff --git a/tests/device/libraries/BSTest/src/BSArduino.h b/tests/device/libraries/BSTest/src/BSArduino.h
index 82e1b89826..2fd4dc66e0 100644
--- a/tests/device/libraries/BSTest/src/BSArduino.h
+++ b/tests/device/libraries/BSTest/src/BSArduino.h
@@ -7,33 +7,29 @@ namespace bs
 class ArduinoIOHelper
 {
 public:
-    ArduinoIOHelper(Stream& stream) :
-        m_stream(stream)
+    ArduinoIOHelper(Stream& stream) : m_stream(stream)
     {
     }
 
-    size_t printf(const char* format, ...)
+    size_t printf(const char *format, ...)
     {
         va_list arg;
         va_start(arg, format);
-        char   temp[128];
-        char*  buffer = temp;
-        size_t len    = vsnprintf(temp, sizeof(temp), format, arg);
+        char temp[128];
+        char* buffer = temp;
+        size_t len = vsnprintf(temp, sizeof(temp), format, arg);
         va_end(arg);
-        if (len > sizeof(temp) - 1)
-        {
+        if (len > sizeof(temp) - 1) {
             buffer = new char[len + 1];
-            if (!buffer)
-            {
+            if (!buffer) {
                 return 0;
             }
             va_start(arg, format);
             ets_vsnprintf(buffer, len + 1, format, arg);
             va_end(arg);
         }
-        len = m_stream.write((const uint8_t*)buffer, len);
-        if (buffer != temp)
-        {
+        len = m_stream.write((const uint8_t*) buffer, len);
+        if (buffer != temp) {
             delete[] buffer;
         }
         return len;
@@ -44,20 +40,16 @@ class ArduinoIOHelper
         size_t len = 0;
         // Can't use Stream::readBytesUntil here because it can't tell the
         // difference between timing out and receiving the terminator.
-        while (len < dest_size - 1)
-        {
+        while (len < dest_size - 1) {
             int c = m_stream.read();
-            if (c < 0)
-            {
+            if (c < 0) {
                 delay(1);
                 continue;
             }
-            if (c == '\r')
-            {
+            if (c == '\r') {
                 continue;
             }
-            if (c == '\n')
-            {
+            if (c == '\n') {
                 dest[len] = 0;
                 break;
             }
@@ -72,11 +64,10 @@ class ArduinoIOHelper
 
 typedef ArduinoIOHelper IOHelper;
 
-inline void fatal()
-{
+inline void fatal() {
     ESP.restart();
 }
 
-}  // namespace bs
+} // namespace bs
 
-#endif  //BS_ARDUINO_H
+#endif //BS_ARDUINO_H
diff --git a/tests/device/libraries/BSTest/src/BSArgs.h b/tests/device/libraries/BSTest/src/BSArgs.h
index e8e41b8cbb..060bcdf18c 100644
--- a/tests/device/libraries/BSTest/src/BSArgs.h
+++ b/tests/device/libraries/BSTest/src/BSArgs.h
@@ -15,32 +15,31 @@ namespace bs
 {
 namespace protocol
 {
+
 #define SS_FLAG_ESCAPE 0x8
 
-    typedef enum
-    {
-        /* parsing the space between arguments */
-        SS_SPACE = 0x0,
-        /* parsing an argument which isn't quoted */
-        SS_ARG = 0x1,
-        /* parsing a quoted argument */
-        SS_QUOTED_ARG = 0x2,
-        /* parsing an escape sequence within unquoted argument */
-        SS_ARG_ESCAPED = SS_ARG | SS_FLAG_ESCAPE,
-        /* parsing an escape sequence within a quoted argument */
-        SS_QUOTED_ARG_ESCAPED = SS_QUOTED_ARG | SS_FLAG_ESCAPE,
-    } split_state_t;
+typedef enum {
+    /* parsing the space between arguments */
+    SS_SPACE = 0x0,
+    /* parsing an argument which isn't quoted */
+    SS_ARG = 0x1,
+    /* parsing a quoted argument */
+    SS_QUOTED_ARG = 0x2,
+    /* parsing an escape sequence within unquoted argument */
+    SS_ARG_ESCAPED = SS_ARG | SS_FLAG_ESCAPE,
+    /* parsing an escape sequence within a quoted argument */
+    SS_QUOTED_ARG_ESCAPED = SS_QUOTED_ARG | SS_FLAG_ESCAPE,
+} split_state_t;
 
 /* helper macro, called when done with an argument */
-#define END_ARG()                      \
-    do                                 \
-    {                                  \
-        char_out     = 0;              \
-        argv[argc++] = next_arg_start; \
-        state        = SS_SPACE;       \
-    } while (0);
-
-    /**
+#define END_ARG() do { \
+        char_out = 0;   \
+        argv[argc++] = next_arg_start;  \
+        state = SS_SPACE;   \
+    } while(0);
+
+
+/**
  * @brief Split command line into arguments in place
  *
  * - This function finds whitespace-separated arguments in the given input line.
@@ -64,114 +63,89 @@ namespace protocol
  * @param argv_size number of elements in argv_array (max. number of arguments will be argv_size - 1)
  * @return number of arguments found (argc)
  */
-    inline size_t split_args(char* line, char** argv, size_t argv_size)
-    {
-        const int     QUOTE          = '"';
-        const int     ESCAPE         = '\\';
-        const int     SPACE          = ' ';
-        split_state_t state          = SS_SPACE;
-        size_t        argc           = 0;
-        char*         next_arg_start = line;
-        char*         out_ptr        = line;
-        for (char* in_ptr = line; argc < argv_size - 1; ++in_ptr)
-        {
-            int char_in = (unsigned char)*in_ptr;
-            if (char_in == 0)
-            {
-                break;
+inline size_t split_args(char *line, char **argv, size_t argv_size)
+{
+    const int QUOTE = '"';
+    const int ESCAPE = '\\';
+    const int SPACE = ' ';
+    split_state_t state = SS_SPACE;
+    size_t argc = 0;
+    char *next_arg_start = line;
+    char *out_ptr = line;
+    for (char *in_ptr = line; argc < argv_size - 1; ++in_ptr) {
+        int char_in = (unsigned char) *in_ptr;
+        if (char_in == 0) {
+            break;
+        }
+        int char_out = -1;
+
+        switch (state) {
+        case SS_SPACE:
+            if (char_in == SPACE) {
+                /* skip space */
+            } else if (char_in == QUOTE) {
+                next_arg_start = out_ptr;
+                state = SS_QUOTED_ARG;
+            } else if (char_in == ESCAPE) {
+                next_arg_start = out_ptr;
+                state = SS_ARG_ESCAPED;
+            } else {
+                next_arg_start = out_ptr;
+                state = SS_ARG;
+                char_out = char_in;
             }
-            int char_out = -1;
-
-            switch (state)
-            {
-            case SS_SPACE:
-                if (char_in == SPACE)
-                {
-                    /* skip space */
-                }
-                else if (char_in == QUOTE)
-                {
-                    next_arg_start = out_ptr;
-                    state          = SS_QUOTED_ARG;
-                }
-                else if (char_in == ESCAPE)
-                {
-                    next_arg_start = out_ptr;
-                    state          = SS_ARG_ESCAPED;
-                }
-                else
-                {
-                    next_arg_start = out_ptr;
-                    state          = SS_ARG;
-                    char_out       = char_in;
-                }
-                break;
-
-            case SS_QUOTED_ARG:
-                if (char_in == QUOTE)
-                {
-                    END_ARG();
-                }
-                else if (char_in == ESCAPE)
-                {
-                    state = SS_QUOTED_ARG_ESCAPED;
-                }
-                else
-                {
-                    char_out = char_in;
-                }
-                break;
-
-            case SS_ARG_ESCAPED:
-            case SS_QUOTED_ARG_ESCAPED:
-                if (char_in == ESCAPE || char_in == QUOTE || char_in == SPACE)
-                {
-                    char_out = char_in;
-                }
-                else
-                {
-                    /* unrecognized escape character, skip */
-                }
-                state = (split_state_t)(state & (~SS_FLAG_ESCAPE));
-                break;
-
-            case SS_ARG:
-                if (char_in == SPACE)
-                {
-                    END_ARG();
-                }
-                else if (char_in == ESCAPE)
-                {
-                    state = SS_ARG_ESCAPED;
-                }
-                else
-                {
-                    char_out = char_in;
-                }
-                break;
+            break;
+
+        case SS_QUOTED_ARG:
+            if (char_in == QUOTE) {
+                END_ARG();
+            } else if (char_in == ESCAPE) {
+                state = SS_QUOTED_ARG_ESCAPED;
+            } else {
+                char_out = char_in;
             }
-            /* need to output anything? */
-            if (char_out >= 0)
-            {
-                *out_ptr = char_out;
-                ++out_ptr;
+            break;
+
+        case SS_ARG_ESCAPED:
+        case SS_QUOTED_ARG_ESCAPED:
+            if (char_in == ESCAPE || char_in == QUOTE || char_in == SPACE) {
+                char_out = char_in;
+            } else {
+                /* unrecognized escape character, skip */
+            }
+            state = (split_state_t) (state & (~SS_FLAG_ESCAPE));
+            break;
+
+        case SS_ARG:
+            if (char_in == SPACE) {
+                END_ARG();
+            } else if (char_in == ESCAPE) {
+                state = SS_ARG_ESCAPED;
+            } else {
+                char_out = char_in;
             }
+            break;
         }
-        /* make sure the final argument is terminated */
-        *out_ptr = 0;
-        /* finalize the last argument */
-        if (state != SS_SPACE && argc < argv_size - 1)
-        {
-            argv[argc++] = next_arg_start;
+        /* need to output anything? */
+        if (char_out >= 0) {
+            *out_ptr = char_out;
+            ++out_ptr;
         }
-        /* add a NULL at the end of argv */
-        argv[argc] = NULL;
-
-        return argc;
     }
+    /* make sure the final argument is terminated */
+    *out_ptr = 0;
+    /* finalize the last argument */
+    if (state != SS_SPACE && argc < argv_size - 1) {
+        argv[argc++] = next_arg_start;
+    }
+    /* add a NULL at the end of argv */
+    argv[argc] = NULL;
+
+    return argc;
+}
 
-}  // namespace bs
+} // namespace bs
 
-}  // namespace protocol
+} // namespace protocol
 
-#endif  //BS_ARGS_H
+#endif //BS_ARGS_H
diff --git a/tests/device/libraries/BSTest/src/BSProtocol.h b/tests/device/libraries/BSTest/src/BSProtocol.h
index 97de150b56..05a874f956 100644
--- a/tests/device/libraries/BSTest/src/BSProtocol.h
+++ b/tests/device/libraries/BSTest/src/BSProtocol.h
@@ -11,117 +11,108 @@ namespace bs
 {
 namespace protocol
 {
-    template <typename IO>
-    void output_test_start(IO& io, const char* file, size_t line, const char* name, const char* desc)
-    {
-        io.printf(BS_LINE_PREFIX "start file=\"%s\" line=%d name=\"%s\" desc=\"%s\"\n", file, line, name, desc);
-    }
+template<typename IO>
+void output_test_start(IO& io, const char* file, size_t line, const char* name, const char* desc)
+{
+    io.printf(BS_LINE_PREFIX "start file=\"%s\" line=%d name=\"%s\" desc=\"%s\"\n", file, line, name, desc);
+}
 
-    template <typename IO>
-    void output_check_failure(IO& io, size_t line)
-    {
-        io.printf(BS_LINE_PREFIX "check_failure line=%d\n", line);
-    }
+template<typename IO>
+void output_check_failure(IO& io, size_t line)
+{
+    io.printf(BS_LINE_PREFIX "check_failure line=%d\n", line);
+}
 
-    template <typename IO>
-    void output_test_end(IO& io, bool success, size_t checks, size_t failed_checks, size_t line = 0)
-    {
-        io.printf(BS_LINE_PREFIX "end line=%d result=%d checks=%d failed_checks=%d\n", line, success, checks, failed_checks);
-    }
+template<typename IO>
+void output_test_end(IO& io, bool success, size_t checks, size_t failed_checks, size_t line=0)
+{
+    io.printf(BS_LINE_PREFIX "end line=%d result=%d checks=%d failed_checks=%d\n", line, success, checks, failed_checks);
+}
 
-    template <typename IO>
-    void output_menu_begin(IO& io)
-    {
-        io.printf(BS_LINE_PREFIX "menu_begin\n");
-    }
+template<typename IO>
+void output_menu_begin(IO& io)
+{
+    io.printf(BS_LINE_PREFIX "menu_begin\n");
+}
 
-    template <typename IO>
-    void output_menu_item(IO& io, int index, const char* name, const char* desc)
-    {
-        io.printf(BS_LINE_PREFIX "item id=%d name=\"%s\" desc=\"%s\"\n", index, name, desc);
-    }
+template<typename IO>
+void output_menu_item(IO& io, int index, const char* name, const char* desc)
+{
+    io.printf(BS_LINE_PREFIX "item id=%d name=\"%s\" desc=\"%s\"\n", index, name, desc);
+}
 
-    template <typename IO>
-    void output_menu_end(IO& io)
-    {
-        io.printf(BS_LINE_PREFIX "menu_end\n");
-    }
+template<typename IO>
+void output_menu_end(IO& io)
+{
+    io.printf(BS_LINE_PREFIX "menu_end\n");
+}
 
-    template <typename IO>
-    void output_setenv_result(IO& io, const char* key, const char* value)
-    {
-        io.printf(BS_LINE_PREFIX "setenv key=\"%s\" value=\"%s\"\n", key, value);
-    }
+template<typename IO>
+void output_setenv_result(IO& io, const char* key, const char* value)
+{
+    io.printf(BS_LINE_PREFIX "setenv key=\"%s\" value=\"%s\"\n", key, value);
+}
 
-    template <typename IO>
-    void output_getenv_result(IO& io, const char* key, const char* value)
-    {
-        (void)key;
-        io.printf(BS_LINE_PREFIX "getenv value=\"%s\"\n", value);
-    }
+template<typename IO>
+void output_getenv_result(IO& io, const char* key, const char* value)
+{
+    (void) key;
+    io.printf(BS_LINE_PREFIX "getenv value=\"%s\"\n", value);
+}
 
-    template <typename IO>
-    void output_pretest_result(IO& io, bool res)
-    {
-        io.printf(BS_LINE_PREFIX "pretest result=%d\n", res ? 1 : 0);
-    }
+template<typename IO>
+void output_pretest_result(IO& io, bool res)
+{
+    io.printf(BS_LINE_PREFIX "pretest result=%d\n", res?1:0);
+}
 
-    template <typename IO>
-    bool input_handle(IO& io, char* line_buf, size_t line_buf_size, int& test_num)
-    {
-        int cb_read = io.read_line(line_buf, line_buf_size);
-        if (cb_read == 0 || line_buf[0] == '\n')
-        {
-            return false;
-        }
-        char*  argv[4];
-        size_t argc = split_args(line_buf, argv, sizeof(argv) / sizeof(argv[0]));
-        if (argc == 0)
-        {
-            return false;
-        }
-        if (strcmp(argv[0], "setenv") == 0)
-        {
-            if (argc != 3)
-            {
-                return false;
-            }
-            setenv(argv[1], argv[2], 1);
-            output_setenv_result(io, argv[1], argv[2]);
-            test_num = -1;
-            return false; /* we didn't get the test number yet, so return false */
-        }
-        if (strcmp(argv[0], "getenv") == 0)
-        {
-            if (argc != 2)
-            {
-                return false;
-            }
-            const char* value = getenv(argv[1]);
-            output_getenv_result(io, argv[1], (value != NULL) ? value : "");
+template<typename IO>
+bool input_handle(IO& io, char* line_buf, size_t line_buf_size, int& test_num)
+{
+    int cb_read = io.read_line(line_buf, line_buf_size);
+    if (cb_read == 0 || line_buf[0] == '\n') {
+        return false;
+    }
+    char* argv[4];
+    size_t argc = split_args(line_buf, argv, sizeof(argv)/sizeof(argv[0]));
+    if (argc == 0) {
+        return false;
+    }
+    if (strcmp(argv[0], "setenv") == 0) {
+        if (argc != 3) {
             return false;
         }
-        if (strcmp(argv[0], "pretest") == 0)
-        {
-            if (argc != 1)
-            {
-                return false;
-            }
-            bool res = ::pretest();
-            output_pretest_result(io, res);
+        setenv(argv[1], argv[2], 1);
+        output_setenv_result(io, argv[1], argv[2]);
+        test_num = -1;
+        return false;   /* we didn't get the test number yet, so return false */
+    }
+    if (strcmp(argv[0], "getenv") == 0) {
+        if (argc != 2) {
             return false;
         }
-        /* not one of the commands, try to parse as test number */
-        char* endptr;
-        test_num = (int)strtol(argv[0], &endptr, 10);
-        if (endptr != argv[0] + strlen(argv[0]))
-        {
+        const char* value = getenv(argv[1]);
+        output_getenv_result(io, argv[1], (value != NULL) ? value : "");
+        return false;
+    }
+    if (strcmp(argv[0], "pretest") == 0) {
+        if (argc != 1) {
             return false;
         }
-        return true;
+        bool res = ::pretest();
+        output_pretest_result(io, res);
+        return false;
+    }
+    /* not one of the commands, try to parse as test number */
+    char* endptr;
+    test_num = (int) strtol(argv[0], &endptr, 10);
+    if (endptr != argv[0] + strlen(argv[0])) {
+        return false;
     }
+    return true;
+}
 
-}  // ::protocol
-}  // ::bs
+} // ::protocol
+} // ::bs
 
-#endif  //BS_PROTOCOL_H
+#endif //BS_PROTOCOL_H
diff --git a/tests/device/libraries/BSTest/src/BSStdio.h b/tests/device/libraries/BSTest/src/BSStdio.h
index 892ecaa9d4..4d1bfb56f0 100644
--- a/tests/device/libraries/BSTest/src/BSStdio.h
+++ b/tests/device/libraries/BSTest/src/BSStdio.h
@@ -13,7 +13,7 @@ class StdIOHelper
     {
     }
 
-    size_t printf(const char* format, ...)
+    size_t printf(const char *format, ...)
     {
         va_list arg;
         va_start(arg, format);
@@ -25,13 +25,11 @@ class StdIOHelper
     size_t read_line(char* dest, size_t dest_size)
     {
         char* res = fgets(dest, dest_size, stdin);
-        if (res == NULL)
-        {
+        if (res == NULL) {
             return 0;
         }
         size_t len = strlen(dest);
-        if (dest[len - 1] == '\n')
-        {
+        if (dest[len - 1] == '\n') {
             dest[len - 1] = 0;
             len--;
         }
@@ -41,11 +39,10 @@ class StdIOHelper
 
 typedef StdIOHelper IOHelper;
 
-inline void fatal()
-{
+inline void fatal() {
     throw std::runtime_error("fatal error");
 }
 
-}  // namespace bs
+} // namespace bs
 
-#endif  //BS_STDIO_H
+#endif //BS_STDIO_H
diff --git a/tests/device/libraries/BSTest/src/BSTest.h b/tests/device/libraries/BSTest/src/BSTest.h
index 4b3712f8f7..11b4ee9f6e 100644
--- a/tests/device/libraries/BSTest/src/BSTest.h
+++ b/tests/device/libraries/BSTest/src/BSTest.h
@@ -20,16 +20,15 @@
 
 namespace bs
 {
-typedef void (*test_case_func_t)();
+typedef void(*test_case_func_t)();
 
 class TestCase
 {
 public:
-    TestCase(TestCase* prev, test_case_func_t func, const char* file, size_t line, const char* name, const char* desc) :
-        m_func(func), m_file(file), m_line(line), m_name(name), m_desc(desc)
+    TestCase(TestCase* prev, test_case_func_t func, const char* file, size_t line, const char* name, const char* desc)
+        : m_func(func), m_file(file), m_line(line), m_name(name), m_desc(desc)
     {
-        if (prev)
-        {
+        if (prev) {
             prev->m_next = this;
         }
     }
@@ -61,69 +60,63 @@ class TestCase
 
     const char* desc() const
     {
-        return (m_desc) ? m_desc : "";
+        return (m_desc)?m_desc:"";
     }
 
 protected:
-    TestCase*        m_next = nullptr;
+    TestCase* m_next = nullptr;
     test_case_func_t m_func;
-    const char*      m_file;
-    size_t           m_line;
-    const char*      m_name;
-    const char*      m_desc;
+    const char* m_file;
+    size_t m_line;
+    const char* m_name;
+    const char* m_desc;
 };
 
-struct Registry
-{
+struct Registry {
     void add(test_case_func_t func, const char* file, size_t line, const char* name, const char* desc)
     {
         TestCase* tc = new TestCase(m_last, func, file, line, name, desc);
-        if (!m_first)
-        {
+        if (!m_first) {
             m_first = tc;
         }
         m_last = tc;
     }
     TestCase* m_first = nullptr;
-    TestCase* m_last  = nullptr;
+    TestCase* m_last = nullptr;
 };
 
-struct Env
-{
-    std::function<void(void)>   m_check_pass;
+struct Env {
+    std::function<void(void)> m_check_pass;
     std::function<void(size_t)> m_check_fail;
     std::function<void(size_t)> m_fail;
-    Registry                    m_registry;
+    Registry m_registry;
 };
 
 extern Env g_env;
 
-template <typename IO>
+template<typename IO>
 class Runner
 {
     typedef Runner<IO> Tself;
-
 public:
-    Runner(IO& io) :
-        m_io(io)
+    Runner(IO& io) : m_io(io)
     {
         g_env.m_check_pass = std::bind(&Tself::check_pass, this);
         g_env.m_check_fail = std::bind(&Tself::check_fail, this, std::placeholders::_1);
-        g_env.m_fail       = std::bind(&Tself::fail, this, std::placeholders::_1);
+        g_env.m_fail = std::bind(&Tself::fail, this, std::placeholders::_1);
     }
 
     ~Runner()
     {
         g_env.m_check_pass = 0;
         g_env.m_check_fail = 0;
-        g_env.m_fail       = 0;
+        g_env.m_fail = 0;
     }
 
     void run()
     {
-        do
-        {
-        } while (do_menu());
+        do {
+        } while(do_menu());
     }
 
     void check_pass()
@@ -148,28 +141,22 @@ class Runner
     {
         protocol::output_menu_begin(m_io);
         int id = 1;
-        for (TestCase* tc = g_env.m_registry.m_first; tc; tc = tc->next(), ++id)
-        {
+        for (TestCase* tc = g_env.m_registry.m_first; tc; tc = tc->next(), ++id) {
             protocol::output_menu_item(m_io, id, tc->name(), tc->desc());
         }
         protocol::output_menu_end(m_io);
-        while (true)
-        {
-            int  id;
+        while(true) {
+            int id;
             char line_buf[BS_LINE_BUF_SIZE];
-            if (!protocol::input_handle(m_io, line_buf, sizeof(line_buf), id))
-            {
+            if (!protocol::input_handle(m_io, line_buf, sizeof(line_buf), id)) {
                 continue;
             }
-            if (id < 0)
-            {
+            if (id < 0) {
                 return true;
             }
             TestCase* tc = g_env.m_registry.m_first;
-            for (int i = 0; i != id - 1 && tc; ++i, tc = tc->next())
-                ;
-            if (!tc)
-            {
+            for (int i = 0; i != id - 1 && tc; ++i, tc = tc->next());
+            if (!tc) {
                 bs::fatal();
             }
             m_check_pass_count = 0;
@@ -182,7 +169,7 @@ class Runner
     }
 
 protected:
-    IO&    m_io;
+    IO& m_io;
     size_t m_check_pass_count;
     size_t m_check_fail_count;
 };
@@ -198,58 +185,39 @@ class AutoReg
 
 inline void check(bool condition, size_t line)
 {
-    if (!condition)
-    {
+    if (!condition) {
         g_env.m_check_fail(line);
-    }
-    else
-    {
+    } else {
         g_env.m_check_pass();
     }
 }
 
 inline void require(bool condition, size_t line)
 {
-    if (!condition)
-    {
+    if (!condition) {
         g_env.m_check_fail(line);
         g_env.m_fail(line);
-    }
-    else
-    {
+    } else {
         g_env.m_check_pass();
     }
 }
 
-}  // ::bs
+} // ::bs
 
-#define BS_NAME_LINE2(name, line) name##line
-#define BS_NAME_LINE(name, line) BS_NAME_LINE2(name, line)
-#define BS_UNIQUE_NAME(name) BS_NAME_LINE(name, __LINE__)
+#define BS_NAME_LINE2( name, line ) name##line
+#define BS_NAME_LINE( name, line ) BS_NAME_LINE2( name, line )
+#define BS_UNIQUE_NAME( name ) BS_NAME_LINE( name, __LINE__ )
 
-#define TEST_CASE(...)                                                                                             \
-    static void BS_UNIQUE_NAME(TEST_FUNC__)();                                                                     \
-    namespace                                                                                                      \
-    {                                                                                                              \
-        bs::AutoReg BS_UNIQUE_NAME(test_autoreg__)(&BS_UNIQUE_NAME(TEST_FUNC__), __FILE__, __LINE__, __VA_ARGS__); \
-    }                                                                                                              \
-    static void BS_UNIQUE_NAME(TEST_FUNC__)()
+#define TEST_CASE( ... ) \
+    static void BS_UNIQUE_NAME( TEST_FUNC__ )(); \
+    namespace{ bs::AutoReg BS_UNIQUE_NAME( test_autoreg__ )( &BS_UNIQUE_NAME( TEST_FUNC__ ), __FILE__, __LINE__, __VA_ARGS__ ); }\
+    static void BS_UNIQUE_NAME(  TEST_FUNC__ )()
 
 #define CHECK(condition) bs::check((condition), __LINE__)
 #define REQUIRE(condition) bs::require((condition), __LINE__)
 #define FAIL() bs::g_env.m_fail(__LINE__)
 
-#define BS_ENV_DECLARE() \
-    namespace bs         \
-    {                    \
-        Env g_env;       \
-    }
-#define BS_RUN(...)                                                  \
-    do                                                               \
-    {                                                                \
-        bs::IOHelper             helper = bs::IOHelper(__VA_ARGS__); \
-        bs::Runner<bs::IOHelper> runner(helper);                     \
-        runner.run();                                                \
-    } while (0);
+#define BS_ENV_DECLARE() namespace bs { Env g_env; }
+#define BS_RUN(...) do { bs::IOHelper helper = bs::IOHelper(__VA_ARGS__); bs::Runner<bs::IOHelper> runner(helper); runner.run(); } while(0);
 
-#endif  //BSTEST_H
+#endif //BSTEST_H
diff --git a/tests/device/libraries/BSTest/test/test.cpp b/tests/device/libraries/BSTest/test/test.cpp
index 553f8013be..863373e0de 100644
--- a/tests/device/libraries/BSTest/test/test.cpp
+++ b/tests/device/libraries/BSTest/test/test.cpp
@@ -3,23 +3,21 @@
 
 BS_ENV_DECLARE();
 
+
 int main()
 {
-    while (true)
-    {
-        try
-        {
+    while(true) {
+        try{
             BS_RUN();
             return 0;
-        }
-        catch (...)
-        {
+        }catch(...) {
             printf("Exception\n\n");
         }
     }
     return 1;
 }
 
+
 TEST_CASE("this test runs successfully", "[bluesmoke]")
 {
     CHECK(1 + 1 == 2);
@@ -40,13 +38,16 @@ TEST_CASE("another test which fails and crashes", "[bluesmoke][fail]")
     REQUIRE(false);
 }
 
+
 TEST_CASE("third test which should be skipped", "[.]")
 {
     FAIL();
 }
 
+
 TEST_CASE("this test also runs successfully", "[bluesmoke]")
 {
+
 }
 
 TEST_CASE("environment variables can be set and read from python", "[bluesmoke]")
@@ -56,3 +57,4 @@ TEST_CASE("environment variables can be set and read from python", "[bluesmoke]"
     CHECK(strcmp(res, "42") == 0);
     setenv("VAR_FROM_TEST", "24", 1);
 }
+
diff --git a/tests/device/test_libc/libm_string.c b/tests/device/test_libc/libm_string.c
index 5ee879c11a..17f29098cd 100644
--- a/tests/device/test_libc/libm_string.c
+++ b/tests/device/test_libc/libm_string.c
@@ -3,6 +3,8 @@
 #include <stdlib.h>
 #include <errno.h>
 
+
+
 #define memcmp memcmp_P
 #define memcpy memcpy_P
 #define memmem memmem_P
@@ -16,408 +18,416 @@
 #define strcmp strcmp_P
 #define strncmp strncmp_P
 
-_CONST char* it     = "<UNSET>"; /* Routine name for message routines. */
-static int   errors = 0;
+
+_CONST char *it = "<UNSET>";	/* Routine name for message routines. */
+static int  errors = 0;
 
 /* Complain if condition is not true.  */
 #define check(thing) checkit(thing, __LINE__)
 
 static void
-_DEFUN(checkit, (ok, l),
-       int ok _AND int l)
+_DEFUN(checkit,(ok,l),
+       int ok _AND
+       int l )
 
 {
-    //  newfunc(it);
-    //  line(l);
-
-    if (!ok)
-    {
-        printf("string.c:%d %s\n", l, it);
-        ++errors;
-    }
+//  newfunc(it);
+//  line(l);
+  
+  if (!ok)
+  {
+    printf("string.c:%d %s\n", l, it);
+    ++errors;
+  }
 }
 
+
+
 /* Complain if first two args don't strcmp as equal.  */
-#define equal(a, b) funcqual(a, b, __LINE__);
+#define equal(a, b)  funcqual(a,b,__LINE__);
 
 static void
-_DEFUN(funcqual, (a, b, l),
-       char* a _AND char* b _AND int l)
+_DEFUN(funcqual,(a,b,l),
+       char *a _AND
+       char *b _AND
+       int l)
 {
-    //  newfunc(it);
-
-    //  line(l);
-    if (a == NULL && b == NULL)
-        return;
-    if (strcmp(a, b))
-    {
-        printf("string.c:%d (%s)\n", l, it);
+//  newfunc(it);
+  
+//  line(l);
+  if (a == NULL && b == NULL) return;
+  if (strcmp(a,b)) {
+      printf("string.c:%d (%s)\n", l, it);  
     }
 }
 
+
+
 static char one[50];
 static char two[50];
 
+
 void libm_test_string()
 {
-    /* Test strcmp first because we use it to test other things.  */
-    it = "strcmp";
-    check(strcmp("", "") == 0);       /* Trivial case. */
-    check(strcmp("a", "a") == 0);     /* Identity. */
-    check(strcmp("abc", "abc") == 0); /* Multicharacter. */
-    check(strcmp("abc", "abcd") < 0); /* Length mismatches. */
-    check(strcmp("abcd", "abc") > 0);
-    check(strcmp("abcd", "abce") < 0); /* Honest miscompares. */
-    check(strcmp("abce", "abcd") > 0);
-    check(strcmp("a\103", "a") > 0); /* Tricky if char signed. */
-    check(strcmp("a\103", "a\003") > 0);
-
-    /* Test strcpy next because we need it to set up other tests.  */
-    it = "strcpy";
-    check(strcpy(one, "abcd") == one); /* Returned value. */
-    equal(one, "abcd");                /* Basic test. */
-
-    (void)strcpy(one, "x");
-    equal(one, "x");      /* Writeover. */
-    equal(one + 2, "cd"); /* Wrote too much? */
-
-    (void)strcpy(two, "hi there");
-    (void)strcpy(one, two);
-    equal(one, "hi there"); /* Basic test encore. */
-    equal(two, "hi there"); /* Stomped on source? */
-
-    (void)strcpy(one, "");
-    equal(one, ""); /* Boundary condition. */
-
-    /* strcat.  */
-    it = "strcat";
-    (void)strcpy(one, "ijk");
-    check(strcat(one, "lmn") == one); /* Returned value. */
-    equal(one, "ijklmn");             /* Basic test. */
-
-    (void)strcpy(one, "x");
-    (void)strcat(one, "yz");
-    equal(one, "xyz");    /* Writeover. */
-    equal(one + 4, "mn"); /* Wrote too much? */
-
-    (void)strcpy(one, "gh");
-    (void)strcpy(two, "ef");
-    (void)strcat(one, two);
-    equal(one, "ghef"); /* Basic test encore. */
-    equal(two, "ef");   /* Stomped on source? */
-
-    (void)strcpy(one, "");
-    (void)strcat(one, "");
-    equal(one, ""); /* Boundary conditions. */
-    (void)strcpy(one, "ab");
-    (void)strcat(one, "");
-    equal(one, "ab");
-    (void)strcpy(one, "");
-    (void)strcat(one, "cd");
-    equal(one, "cd");
-
-    /* strncat - first test it as strcat, with big counts,
+  /* Test strcmp first because we use it to test other things.  */
+  it = "strcmp";
+  check(strcmp("", "") == 0); /* Trivial case. */
+  check(strcmp("a", "a") == 0); /* Identity. */
+  check(strcmp("abc", "abc") == 0); /* Multicharacter. */
+  check(strcmp("abc", "abcd") < 0); /* Length mismatches. */
+  check(strcmp("abcd", "abc") > 0);
+  check(strcmp("abcd", "abce") < 0);	/* Honest miscompares. */
+  check(strcmp("abce", "abcd") > 0);
+  check(strcmp("a\103", "a") > 0); /* Tricky if char signed. */
+  check(strcmp("a\103", "a\003") > 0);
+
+  /* Test strcpy next because we need it to set up other tests.  */
+  it = "strcpy";
+  check(strcpy(one, "abcd") == one);	/* Returned value. */
+  equal(one, "abcd");	/* Basic test. */
+
+  (void) strcpy(one, "x");
+  equal(one, "x");		/* Writeover. */
+  equal(one+2, "cd");	/* Wrote too much? */
+
+  (void) strcpy(two, "hi there");
+  (void) strcpy(one, two);
+  equal(one, "hi there");	/* Basic test encore. */
+  equal(two, "hi there");	/* Stomped on source? */
+
+  (void) strcpy(one, "");
+  equal(one, "");		/* Boundary condition. */
+
+  /* strcat.  */
+  it = "strcat";
+  (void) strcpy(one, "ijk");
+  check(strcat(one, "lmn") == one); /* Returned value. */
+  equal(one, "ijklmn");	/* Basic test. */
+
+  (void) strcpy(one, "x");
+  (void) strcat(one, "yz");
+  equal(one, "xyz");		/* Writeover. */
+  equal(one+4, "mn");	/* Wrote too much? */
+
+  (void) strcpy(one, "gh");
+  (void) strcpy(two, "ef");
+  (void) strcat(one, two);
+  equal(one, "ghef");	/* Basic test encore. */
+  equal(two, "ef");		/* Stomped on source? */
+
+  (void) strcpy(one, "");
+  (void) strcat(one, "");
+  equal(one, "");		/* Boundary conditions. */
+  (void) strcpy(one, "ab");
+  (void) strcat(one, "");
+  equal(one, "ab");
+  (void) strcpy(one, "");
+  (void) strcat(one, "cd");
+  equal(one, "cd");
+
+  /* strncat - first test it as strcat, with big counts,
      then test the count mechanism.  */
-    it = "strncat";
-    (void)strcpy(one, "ijk");
-    check(strncat(one, "lmn", 99) == one); /* Returned value. */
-    equal(one, "ijklmn");                  /* Basic test. */
-
-    (void)strcpy(one, "x");
-    (void)strncat(one, "yz", 99);
-    equal(one, "xyz");    /* Writeover. */
-    equal(one + 4, "mn"); /* Wrote too much? */
-
-    (void)strcpy(one, "gh");
-    (void)strcpy(two, "ef");
-    (void)strncat(one, two, 99);
-    equal(one, "ghef"); /* Basic test encore. */
-    equal(two, "ef");   /* Stomped on source? */
-
-    (void)strcpy(one, "");
-    (void)strncat(one, "", 99);
-    equal(one, ""); /* Boundary conditions. */
-    (void)strcpy(one, "ab");
-    (void)strncat(one, "", 99);
-    equal(one, "ab");
-    (void)strcpy(one, "");
-    (void)strncat(one, "cd", 99);
-    equal(one, "cd");
-
-    (void)strcpy(one, "ab");
-    (void)strncat(one, "cdef", 2);
-    equal(one, "abcd"); /* Count-limited. */
-
-    (void)strncat(one, "gh", 0);
-    equal(one, "abcd"); /* Zero count. */
-
-    (void)strncat(one, "gh", 2);
-    equal(one, "abcdgh"); /* Count _AND length equal. */
-    it = "strncmp";
-    /* strncmp - first test as strcmp with big counts";*/
-    check(strncmp("", "", 99) == 0);       /* Trivial case. */
-    check(strncmp("a", "a", 99) == 0);     /* Identity. */
-    check(strncmp("abc", "abc", 99) == 0); /* Multicharacter. */
-    check(strncmp("abc", "abcd", 99) < 0); /* Length unequal. */
-    check(strncmp("abcd", "abc", 99) > 0);
-    check(strncmp("abcd", "abce", 99) < 0); /* Honestly unequal. */
-    check(strncmp("abce", "abcd", 99) > 0);
-    check(strncmp("abce", "abcd", 3) == 0); /* Count limited. */
-    check(strncmp("abce", "abc", 3) == 0);  /* Count == length. */
-    check(strncmp("abcd", "abce", 4) < 0);  /* Nudging limit. */
-    check(strncmp("abc", "def", 0) == 0);   /* Zero count. */
-
-    /* strncpy - testing is a bit different because of odd semantics.  */
-    it = "strncpy";
-    check(strncpy(one, "abc", 4) == one); /* Returned value. */
-    equal(one, "abc");                    /* Did the copy go right? */
-
-    (void)strcpy(one, "abcdefgh");
-    (void)strncpy(one, "xyz", 2);
-    equal(one, "xycdefgh"); /* Copy cut by count. */
-
-    (void)strcpy(one, "abcdefgh");
-    (void)strncpy(one, "xyz", 3); /* Copy cut just before NUL. */
-    equal(one, "xyzdefgh");
-
-    (void)strcpy(one, "abcdefgh");
-    (void)strncpy(one, "xyz", 4); /* Copy just includes NUL. */
-    equal(one, "xyz");
-    equal(one + 4, "efgh"); /* Wrote too much? */
-
-    (void)strcpy(one, "abcdefgh");
-    (void)strncpy(one, "xyz", 5); /* Copy includes padding. */
-    equal(one, "xyz");
-    equal(one + 4, "");
-    equal(one + 5, "fgh");
-
-    (void)strcpy(one, "abc");
-    (void)strncpy(one, "xyz", 0); /* Zero-length copy. */
-    equal(one, "abc");
-
-    (void)strncpy(one, "", 2); /* Zero-length source. */
-    equal(one, "");
-    equal(one + 1, "");
-    equal(one + 2, "c");
-
-    (void)strcpy(one, "hi there");
-    (void)strncpy(two, one, 9);
-    equal(two, "hi there"); /* Just paranoia. */
-    equal(one, "hi there"); /* Stomped on source? */
-
-    /* strlen.  */
-    it = "strlen";
-    check(strlen("") == 0);     /* Empty. */
-    check(strlen("a") == 1);    /* Single char. */
-    check(strlen("abcd") == 4); /* Multiple chars. */
-
-    /* strchr.  */
-    it = "strchr";
-    check(strchr("abcd", 'z') == NULL); /* Not found. */
-    (void)strcpy(one, "abcd");
-    check(strchr(one, 'c') == one + 2);  /* Basic test. */
-    check(strchr(one, 'd') == one + 3);  /* End of string. */
-    check(strchr(one, 'a') == one);      /* Beginning. */
-    check(strchr(one, '\0') == one + 4); /* Finding NUL. */
-    (void)strcpy(one, "ababa");
-    check(strchr(one, 'b') == one + 1); /* Finding first. */
-    (void)strcpy(one, "");
-    check(strchr(one, 'b') == NULL); /* Empty string. */
-    check(strchr(one, '\0') == one); /* NUL in empty string. */
-
-    /* index - just like strchr.  */
-    it = "index";
-    check(index("abcd", 'z') == NULL); /* Not found. */
-    (void)strcpy(one, "abcd");
-    check(index(one, 'c') == one + 2);  /* Basic test. */
-    check(index(one, 'd') == one + 3);  /* End of string. */
-    check(index(one, 'a') == one);      /* Beginning. */
-    check(index(one, '\0') == one + 4); /* Finding NUL. */
-    (void)strcpy(one, "ababa");
-    check(index(one, 'b') == one + 1); /* Finding first. */
-    (void)strcpy(one, "");
-    check(index(one, 'b') == NULL); /* Empty string. */
-    check(index(one, '\0') == one); /* NUL in empty string. */
-
-    /* strrchr.  */
-    it = "strrchr";
-    check(strrchr("abcd", 'z') == NULL); /* Not found. */
-    (void)strcpy(one, "abcd");
-    check(strrchr(one, 'c') == one + 2);  /* Basic test. */
-    check(strrchr(one, 'd') == one + 3);  /* End of string. */
-    check(strrchr(one, 'a') == one);      /* Beginning. */
-    check(strrchr(one, '\0') == one + 4); /* Finding NUL. */
-    (void)strcpy(one, "ababa");
-    check(strrchr(one, 'b') == one + 3); /* Finding last. */
-    (void)strcpy(one, "");
-    check(strrchr(one, 'b') == NULL); /* Empty string. */
-    check(strrchr(one, '\0') == one); /* NUL in empty string. */
-
-    /* rindex - just like strrchr.  */
-    it = "rindex";
-    check(rindex("abcd", 'z') == NULL); /* Not found. */
-    (void)strcpy(one, "abcd");
-    check(rindex(one, 'c') == one + 2);  /* Basic test. */
-    check(rindex(one, 'd') == one + 3);  /* End of string. */
-    check(rindex(one, 'a') == one);      /* Beginning. */
-    check(rindex(one, '\0') == one + 4); /* Finding NUL. */
-    (void)strcpy(one, "ababa");
-    check(rindex(one, 'b') == one + 3); /* Finding last. */
-    (void)strcpy(one, "");
-    check(rindex(one, 'b') == NULL); /* Empty string. */
-    check(rindex(one, '\0') == one); /* NUL in empty string. */
-
-    /* strpbrk - somewhat like strchr.  */
-    it = "strpbrk";
-    check(strpbrk("abcd", "z") == NULL); /* Not found. */
-    (void)strcpy(one, "abcd");
-    check(strpbrk(one, "c") == one + 2);  /* Basic test. */
-    check(strpbrk(one, "d") == one + 3);  /* End of string. */
-    check(strpbrk(one, "a") == one);      /* Beginning. */
-    check(strpbrk(one, "") == NULL);      /* Empty search list. */
-    check(strpbrk(one, "cb") == one + 1); /* Multiple search. */
-    (void)strcpy(one, "abcabdea");
-    check(strpbrk(one, "b") == one + 1);  /* Finding first. */
-    check(strpbrk(one, "cb") == one + 1); /* With multiple search. */
-    check(strpbrk(one, "db") == one + 1); /* Another variant. */
-    (void)strcpy(one, "");
-    check(strpbrk(one, "bc") == NULL); /* Empty string. */
-    check(strpbrk(one, "") == NULL);   /* Both strings empty. */
-
-    /* strstr - somewhat like strchr.  */
-    it = "strstr";
-    check(strstr("z", "abcd") == NULL);   /* Not found. */
-    check(strstr("abx", "abcd") == NULL); /* Dead end. */
-    (void)strcpy(one, "abcd");
-    check(strstr(one, "c") == one + 2);  /* Basic test. */
-    check(strstr(one, "bc") == one + 1); /* Multichar. */
-    check(strstr(one, "d") == one + 3);  /* End of string. */
-    check(strstr(one, "cd") == one + 2); /* Tail of string. */
-    check(strstr(one, "abc") == one);    /* Beginning. */
-    check(strstr(one, "abcd") == one);   /* Exact match. */
-    check(strstr(one, "de") == NULL);    /* Past end. */
-    check(strstr(one, "") == one);       /* Finding empty. */
-    (void)strcpy(one, "ababa");
-    check(strstr(one, "ba") == one + 1); /* Finding first. */
-    (void)strcpy(one, "");
-    check(strstr(one, "b") == NULL); /* Empty string. */
-    check(strstr(one, "") == one);   /* Empty in empty string. */
-    (void)strcpy(one, "bcbca");
-    check(strstr(one, "bca") == one + 2); /* False start. */
-    (void)strcpy(one, "bbbcabbca");
-    check(strstr(one, "bbca") == one + 1); /* With overlap. */
-
-    /* strspn.  */
-    it = "strspn";
-    check(strspn("abcba", "abc") == 5); /* Whole string. */
-    check(strspn("abcba", "ab") == 2);  /* Partial. */
-    check(strspn("abc", "qx") == 0);    /* None. */
-    check(strspn("", "ab") == 0);       /* Null string. */
-    check(strspn("abc", "") == 0);      /* Null search list. */
-
-    /* strcspn.  */
-    it = "strcspn";
-    check(strcspn("abcba", "qx") == 5); /* Whole string. */
-    check(strcspn("abcba", "cx") == 2); /* Partial. */
-    check(strcspn("abc", "abc") == 0);  /* None. */
-    check(strcspn("", "ab") == 0);      /* Null string. */
-    check(strcspn("abc", "") == 3);     /* Null search list. */
-
-    /* strtok - the hard one.  */
-    it = "strtok";
-    (void)strcpy(one, "first, second, third");
-    equal(strtok(one, ", "), "first"); /* Basic test. */
-    equal(one, "first");
-    equal(strtok((char*)NULL, ", "), "second");
-    equal(strtok((char*)NULL, ", "), "third");
-    check(strtok((char*)NULL, ", ") == NULL);
-    (void)strcpy(one, ", first, ");
-    equal(strtok(one, ", "), "first"); /* Extra delims, 1 tok. */
-    check(strtok((char*)NULL, ", ") == NULL);
-    (void)strcpy(one, "1a, 1b; 2a, 2b");
-    equal(strtok(one, ", "), "1a"); /* Changing delim lists. */
-    equal(strtok((char*)NULL, "; "), "1b");
-    equal(strtok((char*)NULL, ", "), "2a");
-    (void)strcpy(two, "x-y");
-    equal(strtok(two, "-"), "x"); /* New string before done. */
-    equal(strtok((char*)NULL, "-"), "y");
-    check(strtok((char*)NULL, "-") == NULL);
-    (void)strcpy(one, "a,b, c,, ,d");
-    equal(strtok(one, ", "), "a"); /* Different separators. */
-    equal(strtok((char*)NULL, ", "), "b");
-    equal(strtok((char*)NULL, " ,"), "c"); /* Permute list too. */
-    equal(strtok((char*)NULL, " ,"), "d");
-    check(strtok((char*)NULL, ", ") == NULL);
-    check(strtok((char*)NULL, ", ") == NULL); /* Persistence. */
-    (void)strcpy(one, ", ");
-    check(strtok(one, ", ") == NULL); /* No tokens. */
-    (void)strcpy(one, "");
-    check(strtok(one, ", ") == NULL); /* Empty string. */
-    (void)strcpy(one, "abc");
-    equal(strtok(one, ", "), "abc"); /* No delimiters. */
-    check(strtok((char*)NULL, ", ") == NULL);
-    (void)strcpy(one, "abc");
-    equal(strtok(one, ""), "abc"); /* Empty delimiter list. */
-    check(strtok((char*)NULL, "") == NULL);
-    (void)strcpy(one, "abcdefgh");
-    (void)strcpy(one, "a,b,c");
-    equal(strtok(one, ","), "a"); /* Basics again... */
-    equal(strtok((char*)NULL, ","), "b");
-    equal(strtok((char*)NULL, ","), "c");
-    check(strtok((char*)NULL, ",") == NULL);
-    equal(one + 6, "gh"); /* Stomped past end? */
-    equal(one, "a");      /* Stomped old tokens? */
-    equal(one + 2, "b");
-    equal(one + 4, "c");
-
-    /* memcmp.  */
-    it = "memcmp";
-    check(memcmp("a", "a", 1) == 0);      /* Identity. */
-    check(memcmp("abc", "abc", 3) == 0);  /* Multicharacter. */
-    check(memcmp("abcd", "abce", 4) < 0); /* Honestly unequal. */
-    check(memcmp("abce", "abcd", 4));
-    check(memcmp("alph", "beta", 4) < 0);
-    check(memcmp("abce", "abcd", 3) == 0); /* Count limited. */
-    check(memcmp("abc", "def", 0) == 0);   /* Zero count. */
-
-    /* memcmp should test strings as unsigned */
-    one[0] = 0xfe;
-    two[0] = 0x03;
-    check(memcmp(one, two, 1) > 0);
-
-    /* memchr.  */
-    it = "memchr";
-    check(memchr("abcd", 'z', 4) == NULL); /* Not found. */
-    (void)strcpy(one, "abcd");
-    check(memchr(one, 'c', 4) == one + 2);  /* Basic test. */
-    check(memchr(one, 'd', 4) == one + 3);  /* End of string. */
-    check(memchr(one, 'a', 4) == one);      /* Beginning. */
-    check(memchr(one, '\0', 5) == one + 4); /* Finding NUL. */
-    (void)strcpy(one, "ababa");
-    check(memchr(one, 'b', 5) == one + 1); /* Finding first. */
-    check(memchr(one, 'b', 0) == NULL);    /* Zero count. */
-    check(memchr(one, 'a', 1) == one);     /* Singleton case. */
-    (void)strcpy(one, "a\203b");
-    check(memchr(one, 0203, 3) == one + 1); /* Unsignedness. */
-
-    /* memcpy - need not work for overlap.  */
-    it = "memcpy";
-    check(memcpy(one, "abc", 4) == one); /* Returned value. */
-    equal(one, "abc");                   /* Did the copy go right? */
-
-    (void)strcpy(one, "abcdefgh");
-    (void)memcpy(one + 1, "xyz", 2);
-    equal(one, "axydefgh"); /* Basic test. */
-
-    (void)strcpy(one, "abc");
-    (void)memcpy(one, "xyz", 0);
-    equal(one, "abc"); /* Zero-length copy. */
-
-    (void)strcpy(one, "hi there");
-    (void)strcpy(two, "foo");
-    (void)memcpy(two, one, 9);
-    equal(two, "hi there"); /* Just paranoia. */
-    equal(one, "hi there"); /* Stomped on source? */
+  it = "strncat";
+  (void) strcpy(one, "ijk");
+  check(strncat(one, "lmn", 99) == one); /* Returned value. */
+  equal(one, "ijklmn");	/* Basic test. */
+
+  (void) strcpy(one, "x");
+  (void) strncat(one, "yz", 99);
+  equal(one, "xyz");		/* Writeover. */
+  equal(one+4, "mn");	/* Wrote too much? */
+
+  (void) strcpy(one, "gh");
+  (void) strcpy(two, "ef");
+  (void) strncat(one, two, 99);
+  equal(one, "ghef");	/* Basic test encore. */
+  equal(two, "ef");		/* Stomped on source? */
+
+  (void) strcpy(one, "");
+  (void) strncat(one, "", 99);
+  equal(one, "");		/* Boundary conditions. */
+  (void) strcpy(one, "ab");
+  (void) strncat(one, "", 99);
+  equal(one, "ab");
+  (void) strcpy(one, "");
+  (void) strncat(one, "cd", 99);
+  equal(one, "cd");
+
+  (void) strcpy(one, "ab");
+  (void) strncat(one, "cdef", 2);
+  equal(one, "abcd");	/* Count-limited. */
+
+  (void) strncat(one, "gh", 0);
+  equal(one, "abcd");	/* Zero count. */
+
+  (void) strncat(one, "gh", 2);
+  equal(one, "abcdgh");	/* Count _AND length equal. */
+  it = "strncmp";
+  /* strncmp - first test as strcmp with big counts";*/
+  check(strncmp("", "", 99) == 0); /* Trivial case. */
+  check(strncmp("a", "a", 99) == 0);	/* Identity. */
+  check(strncmp("abc", "abc", 99) == 0); /* Multicharacter. */
+  check(strncmp("abc", "abcd", 99) < 0); /* Length unequal. */
+  check(strncmp("abcd", "abc",99) > 0);
+  check(strncmp("abcd", "abce", 99) < 0); /* Honestly unequal. */
+  check(strncmp("abce", "abcd",99)>0);
+  check(strncmp("abce", "abcd", 3) == 0); /* Count limited. */
+  check(strncmp("abce", "abc", 3) == 0); /* Count == length. */
+  check(strncmp("abcd", "abce", 4) < 0); /* Nudging limit. */
+  check(strncmp("abc", "def", 0) == 0); /* Zero count. */
+
+  /* strncpy - testing is a bit different because of odd semantics.  */
+  it = "strncpy";
+  check(strncpy(one, "abc", 4) == one); /* Returned value. */
+  equal(one, "abc");		/* Did the copy go right? */
+
+  (void) strcpy(one, "abcdefgh");
+  (void) strncpy(one, "xyz", 2);
+  equal(one, "xycdefgh");	/* Copy cut by count. */
+
+  (void) strcpy(one, "abcdefgh");
+  (void) strncpy(one, "xyz", 3); /* Copy cut just before NUL. */
+  equal(one, "xyzdefgh");
+
+  (void) strcpy(one, "abcdefgh");
+  (void) strncpy(one, "xyz", 4); /* Copy just includes NUL. */
+  equal(one, "xyz");
+  equal(one+4, "efgh");	/* Wrote too much? */
+
+  (void) strcpy(one, "abcdefgh");
+  (void) strncpy(one, "xyz", 5); /* Copy includes padding. */
+  equal(one, "xyz");
+  equal(one+4, "");
+  equal(one+5, "fgh");
+
+  (void) strcpy(one, "abc");
+  (void) strncpy(one, "xyz", 0); /* Zero-length copy. */
+  equal(one, "abc");	
+
+  (void) strncpy(one, "", 2);	/* Zero-length source. */
+  equal(one, "");
+  equal(one+1, "");	
+  equal(one+2, "c");
+
+  (void) strcpy(one, "hi there");
+  (void) strncpy(two, one, 9);
+  equal(two, "hi there");	/* Just paranoia. */
+  equal(one, "hi there");	/* Stomped on source? */
+
+  /* strlen.  */
+  it = "strlen";
+  check(strlen("") == 0);	/* Empty. */
+  check(strlen("a") == 1);	/* Single char. */
+  check(strlen("abcd") == 4); /* Multiple chars. */
+
+  /* strchr.  */
+  it = "strchr";
+  check(strchr("abcd", 'z') == NULL); /* Not found. */
+  (void) strcpy(one, "abcd");
+  check(strchr(one, 'c') == one+2); /* Basic test. */
+  check(strchr(one, 'd') == one+3); /* End of string. */
+  check(strchr(one, 'a') == one); /* Beginning. */
+  check(strchr(one, '\0') == one+4);	/* Finding NUL. */
+  (void) strcpy(one, "ababa");
+  check(strchr(one, 'b') == one+1); /* Finding first. */
+  (void) strcpy(one, "");
+  check(strchr(one, 'b') == NULL); /* Empty string. */
+  check(strchr(one, '\0') == one); /* NUL in empty string. */
+
+  /* index - just like strchr.  */
+  it = "index";
+  check(index("abcd", 'z') == NULL);	/* Not found. */
+  (void) strcpy(one, "abcd");
+  check(index(one, 'c') == one+2); /* Basic test. */
+  check(index(one, 'd') == one+3); /* End of string. */
+  check(index(one, 'a') == one); /* Beginning. */
+  check(index(one, '\0') == one+4); /* Finding NUL. */
+  (void) strcpy(one, "ababa");
+  check(index(one, 'b') == one+1); /* Finding first. */
+  (void) strcpy(one, "");
+  check(index(one, 'b') == NULL); /* Empty string. */
+  check(index(one, '\0') == one); /* NUL in empty string. */
+
+  /* strrchr.  */
+  it = "strrchr";
+  check(strrchr("abcd", 'z') == NULL); /* Not found. */
+  (void) strcpy(one, "abcd");
+  check(strrchr(one, 'c') == one+2);	/* Basic test. */
+  check(strrchr(one, 'd') == one+3);	/* End of string. */
+  check(strrchr(one, 'a') == one); /* Beginning. */
+  check(strrchr(one, '\0') == one+4); /* Finding NUL. */
+  (void) strcpy(one, "ababa");
+  check(strrchr(one, 'b') == one+3);	/* Finding last. */
+  (void) strcpy(one, "");
+  check(strrchr(one, 'b') == NULL); /* Empty string. */
+  check(strrchr(one, '\0') == one); /* NUL in empty string. */
+
+  /* rindex - just like strrchr.  */
+  it = "rindex";
+  check(rindex("abcd", 'z') == NULL); /* Not found. */
+  (void) strcpy(one, "abcd");
+  check(rindex(one, 'c') == one+2); /* Basic test. */
+  check(rindex(one, 'd') == one+3); /* End of string. */
+  check(rindex(one, 'a') == one); /* Beginning. */
+  check(rindex(one, '\0') == one+4);	/* Finding NUL. */
+  (void) strcpy(one, "ababa");
+  check(rindex(one, 'b') == one+3); /* Finding last. */
+  (void) strcpy(one, "");
+  check(rindex(one, 'b') == NULL); /* Empty string. */
+  check(rindex(one, '\0') == one); /* NUL in empty string. */
+
+  /* strpbrk - somewhat like strchr.  */
+  it = "strpbrk";
+  check(strpbrk("abcd", "z") == NULL); /* Not found. */
+  (void) strcpy(one, "abcd");
+  check(strpbrk(one, "c") == one+2);	/* Basic test. */
+  check(strpbrk(one, "d") == one+3);	/* End of string. */
+  check(strpbrk(one, "a") == one); /* Beginning. */
+  check(strpbrk(one, "") == NULL); /* Empty search list. */
+  check(strpbrk(one, "cb") == one+1); /* Multiple search. */
+  (void) strcpy(one, "abcabdea");
+  check(strpbrk(one, "b") == one+1);	/* Finding first. */
+  check(strpbrk(one, "cb") == one+1); /* With multiple search. */
+  check(strpbrk(one, "db") == one+1); /* Another variant. */
+  (void) strcpy(one, "");
+  check(strpbrk(one, "bc") == NULL); /* Empty string. */
+  check(strpbrk(one, "") == NULL); /* Both strings empty. */
+
+  /* strstr - somewhat like strchr.  */
+  it = "strstr";
+  check(strstr("z", "abcd") == NULL); /* Not found. */
+  check(strstr("abx", "abcd") == NULL); /* Dead end. */
+  (void) strcpy(one, "abcd");
+  check(strstr(one,"c") == one+2); /* Basic test. */
+  check(strstr(one, "bc") == one+1);	/* Multichar. */
+  check(strstr(one,"d") == one+3); /* End of string. */
+  check(strstr(one,"cd") == one+2);	/* Tail of string. */
+  check(strstr(one,"abc") == one); /* Beginning. */
+  check(strstr(one,"abcd") == one);	/* Exact match. */
+  check(strstr(one,"de") == NULL);	/* Past end. */
+  check(strstr(one,"") == one); /* Finding empty. */
+  (void) strcpy(one, "ababa");
+  check(strstr(one,"ba") == one+1); /* Finding first. */
+  (void) strcpy(one, "");
+  check(strstr(one, "b") == NULL); /* Empty string. */
+  check(strstr(one,"") == one); /* Empty in empty string. */
+  (void) strcpy(one, "bcbca");
+  check(strstr(one,"bca") == one+2); /* False start. */
+  (void) strcpy(one, "bbbcabbca");
+  check(strstr(one,"bbca") == one+1); /* With overlap. */
+
+  /* strspn.  */
+  it = "strspn";
+  check(strspn("abcba", "abc") == 5); /* Whole string. */
+  check(strspn("abcba", "ab") == 2);	/* Partial. */
+  check(strspn("abc", "qx") == 0); /* None. */
+  check(strspn("", "ab") == 0); /* Null string. */
+  check(strspn("abc", "") == 0); /* Null search list. */
+
+  /* strcspn.  */
+  it = "strcspn";
+  check(strcspn("abcba", "qx") == 5); /* Whole string. */
+  check(strcspn("abcba", "cx") == 2); /* Partial. */
+  check(strcspn("abc", "abc") == 0);	/* None. */
+  check(strcspn("", "ab") == 0); /* Null string. */
+  check(strcspn("abc", "") == 3); /* Null search list. */
+
+  /* strtok - the hard one.  */
+  it = "strtok";
+  (void) strcpy(one, "first, second, third");
+  equal(strtok(one, ", "), "first");	/* Basic test. */
+  equal(one, "first");
+  equal(strtok((char *)NULL, ", "), "second");
+  equal(strtok((char *)NULL, ", "), "third");
+  check(strtok((char *)NULL, ", ") == NULL);
+  (void) strcpy(one, ", first, ");
+  equal(strtok(one, ", "), "first");	/* Extra delims, 1 tok. */
+  check(strtok((char *)NULL, ", ") == NULL);
+  (void) strcpy(one, "1a, 1b; 2a, 2b");
+  equal(strtok(one, ", "), "1a"); /* Changing delim lists. */
+  equal(strtok((char *)NULL, "; "), "1b");
+  equal(strtok((char *)NULL, ", "), "2a");
+  (void) strcpy(two, "x-y");
+  equal(strtok(two, "-"), "x"); /* New string before done. */
+  equal(strtok((char *)NULL, "-"), "y");
+  check(strtok((char *)NULL, "-") == NULL);
+  (void) strcpy(one, "a,b, c,, ,d");
+  equal(strtok(one, ", "), "a"); /* Different separators. */
+  equal(strtok((char *)NULL, ", "), "b");
+  equal(strtok((char *)NULL, " ,"), "c"); /* Permute list too. */
+  equal(strtok((char *)NULL, " ,"), "d");
+  check(strtok((char *)NULL, ", ") == NULL);
+  check(strtok((char *)NULL, ", ") == NULL); /* Persistence. */
+  (void) strcpy(one, ", ");
+  check(strtok(one, ", ") == NULL);	/* No tokens. */
+  (void) strcpy(one, "");
+  check(strtok(one, ", ") == NULL);	/* Empty string. */
+  (void) strcpy(one, "abc");
+  equal(strtok(one, ", "), "abc"); /* No delimiters. */
+  check(strtok((char *)NULL, ", ") == NULL);
+  (void) strcpy(one, "abc");
+  equal(strtok(one, ""), "abc"); /* Empty delimiter list. */
+  check(strtok((char *)NULL, "") == NULL);
+  (void) strcpy(one, "abcdefgh");
+  (void) strcpy(one, "a,b,c");
+  equal(strtok(one, ","), "a"); /* Basics again... */
+  equal(strtok((char *)NULL, ","), "b");
+  equal(strtok((char *)NULL, ","), "c");
+  check(strtok((char *)NULL, ",") == NULL);
+  equal(one+6, "gh");	/* Stomped past end? */
+  equal(one, "a");		/* Stomped old tokens? */
+  equal(one+2, "b");
+  equal(one+4, "c");
+
+  /* memcmp.  */
+  it = "memcmp";
+  check(memcmp("a", "a", 1) == 0); /* Identity. */
+  check(memcmp("abc", "abc", 3) == 0); /* Multicharacter. */
+  check(memcmp("abcd", "abce", 4) < 0); /* Honestly unequal. */
+  check(memcmp("abce", "abcd",4));
+  check(memcmp("alph", "beta", 4) < 0);
+  check(memcmp("abce", "abcd", 3) == 0); /* Count limited. */
+  check(memcmp("abc", "def", 0) == 0); /* Zero count. */
+
+  /* memcmp should test strings as unsigned */
+  one[0] = 0xfe;
+  two[0] = 0x03;
+  check(memcmp(one, two,1) > 0);
+  
+  
+  /* memchr.  */
+  it = "memchr";
+  check(memchr("abcd", 'z', 4) == NULL); /* Not found. */
+  (void) strcpy(one, "abcd");
+  check(memchr(one, 'c', 4) == one+2); /* Basic test. */
+  check(memchr(one, 'd', 4) == one+3); /* End of string. */
+  check(memchr(one, 'a', 4) == one);	/* Beginning. */
+  check(memchr(one, '\0', 5) == one+4); /* Finding NUL. */
+  (void) strcpy(one, "ababa");
+  check(memchr(one, 'b', 5) == one+1); /* Finding first. */
+  check(memchr(one, 'b', 0) == NULL); /* Zero count. */
+  check(memchr(one, 'a', 1) == one);	/* Singleton case. */
+  (void) strcpy(one, "a\203b");
+  check(memchr(one, 0203, 3) == one+1); /* Unsignedness. */
+
+  /* memcpy - need not work for overlap.  */
+  it = "memcpy";
+  check(memcpy(one, "abc", 4) == one); /* Returned value. */
+  equal(one, "abc");		/* Did the copy go right? */
+
+  (void) strcpy(one, "abcdefgh");
+  (void) memcpy(one+1, "xyz", 2);
+  equal(one, "axydefgh");	/* Basic test. */
+
+  (void) strcpy(one, "abc");
+  (void) memcpy(one, "xyz", 0);
+  equal(one, "abc");		/* Zero-length copy. */
+
+  (void) strcpy(one, "hi there");
+  (void) strcpy(two, "foo");
+  (void) memcpy(two, one, 9);
+  equal(two, "hi there");	/* Just paranoia. */
+  equal(one, "hi there");	/* Stomped on source? */
 #if 0
   /* memmove - must work on overlap.  */
   it = "memmove";
@@ -489,69 +499,68 @@ void libm_test_string()
   check(memccpy(two, one, 'x', 1) == two+1); /* Singleton. */
   equal(two, "xbcdlebee");
 #endif
-    /* memset.  */
-    it = "memset";
-    (void)strcpy(one, "abcdefgh");
-    check(memset(one + 1, 'x', 3) == one + 1); /* Return value. */
-    equal(one, "axxxefgh");                    /* Basic test. */
+  /* memset.  */
+  it = "memset";
+  (void) strcpy(one, "abcdefgh");
+  check(memset(one+1, 'x', 3) == one+1); /* Return value. */
+  equal(one, "axxxefgh");	/* Basic test. */
 
-    (void)memset(one + 2, 'y', 0);
-    equal(one, "axxxefgh"); /* Zero-length set. */
+  (void) memset(one+2, 'y', 0);
+  equal(one, "axxxefgh");	/* Zero-length set. */
 
-    (void)memset(one + 5, 0, 1);
-    equal(one, "axxxe");  /* Zero fill. */
-    equal(one + 6, "gh"); /* _AND the leftover. */
+  (void) memset(one+5, 0, 1);
+  equal(one, "axxxe");	/* Zero fill. */
+  equal(one+6, "gh");	/* _AND the leftover. */
 
-    (void)memset(one + 2, 010045, 1);
-    equal(one, "ax\045xe"); /* Unsigned char convert. */
+  (void) memset(one+2, 010045, 1);
+  equal(one, "ax\045xe");	/* Unsigned char convert. */
 
-    /* bcopy - much like memcpy.
+  /* bcopy - much like memcpy.
      Berklix manual is silent about overlap, so don't test it.  */
-    it = "bcopy";
-    (void)bcopy("abc", one, 4);
-    equal(one, "abc"); /* Simple copy. */
-
-    (void)strcpy(one, "abcdefgh");
-    (void)bcopy("xyz", one + 1, 2);
-    equal(one, "axydefgh"); /* Basic test. */
-
-    (void)strcpy(one, "abc");
-    (void)bcopy("xyz", one, 0);
-    equal(one, "abc"); /* Zero-length copy. */
-
-    (void)strcpy(one, "hi there");
-    (void)strcpy(two, "foo");
-    (void)bcopy(one, two, 9);
-    equal(two, "hi there"); /* Just paranoia. */
-    equal(one, "hi there"); /* Stomped on source? */
-
-    /* bzero.  */
-    it = "bzero";
-    (void)strcpy(one, "abcdef");
-    bzero(one + 2, 2);
-    equal(one, "ab"); /* Basic test. */
-    equal(one + 3, "");
-    equal(one + 4, "ef");
-
-    (void)strcpy(one, "abcdef");
-    bzero(one + 2, 0);
-    equal(one, "abcdef"); /* Zero-length copy. */
-
-    /* bcmp - somewhat like memcmp.  */
-    it = "bcmp";
-    check(bcmp("a", "a", 1) == 0);       /* Identity. */
-    check(bcmp("abc", "abc", 3) == 0);   /* Multicharacter. */
-    check(bcmp("abcd", "abce", 4) != 0); /* Honestly unequal. */
-    check(bcmp("abce", "abcd", 4));
-    check(bcmp("alph", "beta", 4) != 0);
-    check(bcmp("abce", "abcd", 3) == 0); /* Count limited. */
-    check(bcmp("abc", "def", 0) == 0);   /* Zero count. */
-
-    if (errors)
-        abort();
-    printf("ok\n");
-
-#if 0 /* strerror - VERY system-dependent.  */
+  it = "bcopy";
+  (void) bcopy("abc", one, 4);
+  equal(one, "abc");		/* Simple copy. */
+
+  (void) strcpy(one, "abcdefgh");
+  (void) bcopy("xyz", one+1, 2);
+  equal(one, "axydefgh");	/* Basic test. */
+
+  (void) strcpy(one, "abc");
+  (void) bcopy("xyz", one, 0);
+  equal(one, "abc");		/* Zero-length copy. */
+
+  (void) strcpy(one, "hi there");
+  (void) strcpy(two, "foo");
+  (void) bcopy(one, two, 9);
+  equal(two, "hi there");	/* Just paranoia. */
+  equal(one, "hi there");	/* Stomped on source? */
+
+  /* bzero.  */
+  it = "bzero";
+  (void) strcpy(one, "abcdef");
+  bzero(one+2, 2);
+  equal(one, "ab");		/* Basic test. */
+  equal(one+3, "");
+  equal(one+4, "ef");
+
+  (void) strcpy(one, "abcdef");
+  bzero(one+2, 0);
+  equal(one, "abcdef");	/* Zero-length copy. */
+
+  /* bcmp - somewhat like memcmp.  */
+  it = "bcmp";
+  check(bcmp("a", "a", 1) == 0); /* Identity. */
+  check(bcmp("abc", "abc", 3) == 0);	/* Multicharacter. */
+  check(bcmp("abcd", "abce", 4) != 0); /* Honestly unequal. */
+  check(bcmp("abce", "abcd",4));
+  check(bcmp("alph", "beta", 4) != 0);
+  check(bcmp("abce", "abcd", 3) == 0); /* Count limited. */
+  check(bcmp("abc", "def", 0) == 0);	/* Zero count. */
+
+  if (errors) abort();
+  printf("ok\n");
+
+#if 0  /* strerror - VERY system-dependent.  */
 {
   extern CONST unsigned int _sys_nerr;
   extern CONST char *CONST _sys_errlist[];
@@ -563,3 +572,4 @@ void libm_test_string()
 }
 #endif
 }
+
diff --git a/tests/device/test_libc/memcpy-1.c b/tests/device/test_libc/memcpy-1.c
index a7fb9e9169..2485af0923 100644
--- a/tests/device/test_libc/memcpy-1.c
+++ b/tests/device/test_libc/memcpy-1.c
@@ -31,6 +31,7 @@
 #include <stdio.h>
 #include <stdarg.h>
 
+
 #define memcmp memcmp_P
 #define memcpy memcpy_P
 #define memmem memmem_P
@@ -69,105 +70,105 @@
 static int errors = 0;
 
 static void
-print_error(char const* msg, ...)
-{
-    errors++;
-    if (errors == TOO_MANY_ERRORS)
+print_error (char const* msg, ...)
+{   
+  errors++;
+  if (errors == TOO_MANY_ERRORS)
     {
-        fprintf(stderr, "Too many errors.\n");
+      fprintf (stderr, "Too many errors.\n");
     }
-    else if (errors < TOO_MANY_ERRORS)
+  else if (errors < TOO_MANY_ERRORS)
     {
-        va_list ap;
-        va_start(ap, msg);
-        vfprintf(stderr, msg, ap);
-        va_end(ap);
+      va_list ap;
+      va_start (ap, msg);
+      vfprintf (stderr, msg, ap);
+      va_end (ap);
     }
-    else
+  else
     {
-        /* Further errors omitted.  */
+      /* Further errors omitted.  */
     }
 }
 
 extern int rand_seed;
-void       memcpy_main(void)
+void memcpy_main(void)
 {
-    /* Allocate buffers to read and write from.  */
-    char src[BUFF_SIZE], dest[BUFF_SIZE], backup_src[BUFF_SIZE];
-
-    /* Fill the source buffer with non-null values, reproducible random data. */
-    srand(rand_seed);
-    int      i, j;
-    unsigned sa;
-    unsigned da;
-    unsigned n;
-    for (i = 0; i < BUFF_SIZE; i++)
+  /* Allocate buffers to read and write from.  */
+  char src[BUFF_SIZE], dest[BUFF_SIZE], backup_src[BUFF_SIZE];
+
+  /* Fill the source buffer with non-null values, reproducible random data. */
+  srand (rand_seed);
+  int i, j;
+  unsigned sa;
+  unsigned da;
+  unsigned n;
+  for (i = 0; i < BUFF_SIZE; i++)
     {
-        src[i]        = (char)rand() | 1;
-        backup_src[i] = src[i];
+      src[i] = (char)rand () | 1;
+      backup_src[i] = src[i];
     }
 
-    /* Make calls to memcpy with block sizes ranging between 1 and
+  /* Make calls to memcpy with block sizes ranging between 1 and
      MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
-    for (sa = 0; sa <= MAX_OFFSET; sa++)
-        for (da = 0; da <= MAX_OFFSET; da++)
-            for (n = 1; n <= MAX_BLOCK_SIZE; n++)
-            {
-                //printf (".");
-                /* Zero dest so we can check it properly after the copying.  */
-                for (j = 0; j < BUFF_SIZE; j++)
-                    dest[j] = 0;
-
-                void* ret = memcpy(dest + START_COPY + da, src + sa, n);
-
-                /* Check return value.  */
-                if (ret != (dest + START_COPY + da))
-                    print_error("\nFailed: wrong return value in memcpy of %u bytes "
-                                "with src_align %u and dst_align %u. "
-                                "Return value and dest should be the same"
-                                "(ret is %p, dest is %p)\n",
-                                n, sa, da, ret, dest + START_COPY + da);
-
-                /* Check that content of the destination buffer
+  for (sa = 0; sa <= MAX_OFFSET; sa++)
+    for (da = 0; da <= MAX_OFFSET; da++)
+      for (n = 1; n <= MAX_BLOCK_SIZE; n++)
+        {
+          //printf (".");
+          /* Zero dest so we can check it properly after the copying.  */
+          for (j = 0; j < BUFF_SIZE; j++)
+            dest[j] = 0;
+          
+          void *ret = memcpy (dest + START_COPY + da, src + sa, n);
+          
+          /* Check return value.  */
+          if (ret != (dest + START_COPY + da))
+            print_error ("\nFailed: wrong return value in memcpy of %u bytes "
+                         "with src_align %u and dst_align %u. "
+                         "Return value and dest should be the same"
+                         "(ret is %p, dest is %p)\n",
+                         n, sa, da, ret, dest + START_COPY + da);
+          
+          /* Check that content of the destination buffer
              is the same as the source buffer, and
              memory outside destination buffer is not modified.  */
-                for (j = 0; j < BUFF_SIZE; j++)
-                    if ((unsigned)j < START_COPY + da)
-                    {
-                        if (dest[j] != 0)
-                            print_error("\nFailed: after memcpy of %u bytes "
-                                        "with src_align %u and dst_align %u, "
-                                        "byte %u before the start of dest is not 0.\n",
-                                        n, sa, da, START_COPY - j);
-                    }
-                    else if ((unsigned)j < START_COPY + da + n)
-                    {
-                        i = j - START_COPY - da;
-                        if (dest[j] != (src + sa)[i])
-                            print_error("\nFailed: after memcpy of %u bytes "
-                                        "with src_align %u and dst_align %u, "
-                                        "byte %u in dest and src are not the same.\n",
-                                        n, sa, da, i);
-                    }
-                    else if (dest[j] != 0)
-                    {
-                        print_error("\nFailed: after memcpy of %u bytes "
-                                    "with src_align %u and dst_align %u, "
-                                    "byte %u after the end of dest is not 0.\n",
-                                    n, sa, da, j - START_COPY - da - n);
-                    }
-
-                /* Check src is not modified.  */
-                for (j = 0; j < BUFF_SIZE; j++)
-                    if (src[i] != backup_src[i])
-                        print_error("\nFailed: after memcpy of %u bytes "
-                                    "with src_align %u and dst_align %u, "
-                                    "byte %u of src is modified.\n",
-                                    n, sa, da, j);
-            }
-
-    if (errors != 0)
-        abort();
-
-    printf("ok\n");
+          for (j = 0; j < BUFF_SIZE; j++)
+            if ((unsigned)j < START_COPY + da)
+              {
+                if (dest[j] != 0)
+                  print_error ("\nFailed: after memcpy of %u bytes "
+                               "with src_align %u and dst_align %u, "
+                               "byte %u before the start of dest is not 0.\n",
+                               n, sa, da, START_COPY - j);
+              }
+            else if ((unsigned)j < START_COPY + da + n)
+              {
+                i = j - START_COPY - da;
+                if (dest[j] != (src + sa)[i])
+                  print_error ("\nFailed: after memcpy of %u bytes "
+                               "with src_align %u and dst_align %u, "
+                               "byte %u in dest and src are not the same.\n",
+                               n, sa, da, i);
+              }
+            else if (dest[j] != 0)
+              {
+                print_error ("\nFailed: after memcpy of %u bytes "
+                             "with src_align %u and dst_align %u, "
+                             "byte %u after the end of dest is not 0.\n",
+                             n, sa, da, j - START_COPY - da - n);
+              }
+
+          /* Check src is not modified.  */
+          for (j = 0; j < BUFF_SIZE; j++)
+            if (src[i] != backup_src[i])
+              print_error ("\nFailed: after memcpy of %u bytes "
+                           "with src_align %u and dst_align %u, "
+                           "byte %u of src is modified.\n",
+                           n, sa, da, j);
+        }
+
+  if (errors != 0)
+    abort ();
+
+  printf("ok\n");
 }
diff --git a/tests/device/test_libc/memmove1.c b/tests/device/test_libc/memmove1.c
index 6fd2ceabef..f64feae759 100644
--- a/tests/device/test_libc/memmove1.c
+++ b/tests/device/test_libc/memmove1.c
@@ -55,135 +55,140 @@
 #define TOO_MANY_ERRORS 11
 int errors = 0;
 
-#define DEBUGP                              \
-    if (errors == TOO_MANY_ERRORS)          \
-        printf("Further errors omitted\n"); \
-    else if (errors < TOO_MANY_ERRORS)      \
-    printf
+#define DEBUGP					\
+ if (errors == TOO_MANY_ERRORS)			\
+   printf ("Further errors omitted\n");		\
+ else if (errors < TOO_MANY_ERRORS)		\
+   printf
 
 /* A safe target-independent memmove.  */
 
-void mymemmove(unsigned char* dest, unsigned char* src, size_t n)
+void
+mymemmove (unsigned char *dest, unsigned char *src, size_t n)
 {
-    if ((src <= dest && src + n <= dest)
-        || src >= dest)
-        while (n-- > 0)
-            *dest++ = *src++;
-    else
+  if ((src <= dest && src + n <= dest)
+      || src >= dest)
+    while (n-- > 0)
+      *dest++ = *src++;
+  else
     {
-        dest += n;
-        src += n;
-        while (n-- > 0)
-            *--dest = *--src;
+      dest += n;
+      src += n;
+      while (n-- > 0)
+	*--dest = *--src;
     }
 }
 
 /* It's either the noinline attribute or forcing the test framework to
    pass -fno-builtin-memmove.  */
-void xmemmove(unsigned char* dest, unsigned char* src, size_t n)
-    __attribute__((__noinline__));
+void
+xmemmove (unsigned char *dest, unsigned char *src, size_t n)
+     __attribute__ ((__noinline__));
 
-void xmemmove(unsigned char* dest, unsigned char* src, size_t n)
+void
+xmemmove (unsigned char *dest, unsigned char *src, size_t n)
 {
-    void* retp;
-    retp = memmove(dest, src, n);
+  void *retp;
+  retp = memmove (dest, src, n);
 
-    if (retp != dest)
+  if (retp != dest)
     {
-        errors++;
-        DEBUGP("memmove of n bytes returned %p instead of dest=%p\n",
-               retp, dest);
+      errors++;
+      DEBUGP ("memmove of n bytes returned %p instead of dest=%p\n",
+	      retp, dest);
     }
 }
 
+
 /* Fill the array with something we can associate with a position, but
    not exactly the same as the position index.  */
 
-void fill(unsigned char dest[MAX * 3])
+void
+fill (unsigned char dest[MAX*3])
 {
-    size_t i;
-    for (i = 0; i < MAX * 3; i++)
-        dest[i] = (10 + i) % MAX;
+  size_t i;
+  for (i = 0; i < MAX*3; i++)
+    dest[i] = (10 + i) % MAX;
 }
 
 void memmove_main(void)
 {
-    size_t i;
-    int    errors = 0;
+  size_t i;
+  int errors = 0;
 
-    /* Leave some room before and after the area tested, so we can detect
+  /* Leave some room before and after the area tested, so we can detect
      overwrites of up to N bytes, N being the amount tested.  If you
      want to test using valgrind, make these malloced instead.  */
-    unsigned char from_test[MAX * 3];
-    unsigned char to_test[MAX * 3];
-    unsigned char from_known[MAX * 3];
-    unsigned char to_known[MAX * 3];
+  unsigned char from_test[MAX*3];
+  unsigned char to_test[MAX*3];
+  unsigned char from_known[MAX*3];
+  unsigned char to_known[MAX*3];
 
-    /* Non-overlap.  */
-    for (i = 0; i < MAX; i++)
+  /* Non-overlap.  */
+  for (i = 0; i < MAX; i++)
     {
-        /* Do the memmove first before setting the known array, so we know
+      /* Do the memmove first before setting the known array, so we know
          it didn't change any of the known array.  */
-        fill(from_test);
-        fill(to_test);
-        xmemmove(to_test + MAX, 1 + from_test + MAX, i);
-
-        fill(from_known);
-        fill(to_known);
-        mymemmove(to_known + MAX, 1 + from_known + MAX, i);
-
-        if (memcmp(to_known, to_test, sizeof(to_known)) != 0)
-        {
-            errors++;
-            DEBUGP("memmove failed non-overlap test for %d bytes\n", i);
-        }
+      fill (from_test);
+      fill (to_test);
+      xmemmove (to_test + MAX, 1 + from_test + MAX, i);
+
+      fill (from_known);
+      fill (to_known);
+      mymemmove (to_known + MAX, 1 + from_known + MAX, i);
+
+      if (memcmp (to_known, to_test, sizeof (to_known)) != 0)
+	{
+	  errors++;
+	  DEBUGP ("memmove failed non-overlap test for %d bytes\n", i);
+	}
     }
 
-    /* Overlap-from-before.  */
-    for (i = 0; i < MAX; i++)
+  /* Overlap-from-before.  */
+  for (i = 0; i < MAX; i++)
     {
-        size_t j;
-        for (j = 0; j < i; j++)
-        {
-            fill(to_test);
-            xmemmove(to_test + MAX * 2 - i, to_test + MAX * 2 - i - j, i);
-
-            fill(to_known);
-            mymemmove(to_known + MAX * 2 - i, to_known + MAX * 2 - i - j, i);
-
-            if (memcmp(to_known, to_test, sizeof(to_known)) != 0)
-            {
-                errors++;
-                DEBUGP("memmove failed for %d bytes,"
-                       " with src %d bytes before dest\n",
-                       i, j);
-            }
-        }
+      size_t j;
+      for (j = 0; j < i; j++)
+	{
+	  fill (to_test);
+	  xmemmove (to_test + MAX * 2 - i, to_test + MAX * 2 - i - j, i);
+
+	  fill (to_known);
+	  mymemmove (to_known + MAX * 2 - i, to_known + MAX * 2 - i - j, i);
+
+	  if (memcmp (to_known, to_test, sizeof (to_known)) != 0)
+	    {
+	      errors++;
+	      DEBUGP ("memmove failed for %d bytes,"
+		      " with src %d bytes before dest\n",
+		      i, j);
+	    }
+	}
     }
 
-    /* Overlap-from-after.  */
-    for (i = 0; i < MAX; i++)
+  /* Overlap-from-after.  */
+  for (i = 0; i < MAX; i++)
     {
-        size_t j;
-        for (j = 0; j < i; j++)
-        {
-            fill(to_test);
-            xmemmove(to_test + MAX, to_test + MAX + j, i);
-
-            fill(to_known);
-            mymemmove(to_known + MAX, to_known + MAX + j, i);
-
-            if (memcmp(to_known, to_test, sizeof(to_known)) != 0)
-            {
-                errors++;
-                DEBUGP("memmove failed when moving %d bytes,"
-                       " with src %d bytes after dest\n",
-                       i, j);
-            }
-        }
+      size_t j;
+      for (j = 0; j < i; j++)
+	{
+	  fill (to_test);
+	  xmemmove (to_test + MAX, to_test + MAX + j, i);
+
+	  fill (to_known);
+	  mymemmove (to_known + MAX, to_known + MAX + j, i);
+
+	  if (memcmp (to_known, to_test, sizeof (to_known)) != 0)
+	    {
+	      errors++;
+	      DEBUGP ("memmove failed when moving %d bytes,"
+		      " with src %d bytes after dest\n",
+		      i, j);
+	    }
+	}
     }
 
-    if (errors != 0)
-        abort();
-    printf("ok\n");
+  if (errors != 0)
+    abort ();
+  printf("ok\n");
 }
diff --git a/tests/device/test_libc/strcmp-1.c b/tests/device/test_libc/strcmp-1.c
index d51e14b46c..7c1883a085 100644
--- a/tests/device/test_libc/strcmp-1.c
+++ b/tests/device/test_libc/strcmp-1.c
@@ -46,6 +46,7 @@
 
 #define BUFF_SIZE 256
 
+
 /* The macro LONG_TEST controls whether a short or a more comprehensive test
    of strcmp should be performed.  */
 #ifdef LONG_TEST
@@ -105,184 +106,186 @@
 #error "Buffer overrun: MAX_OFFSET + MAX_BLOCK_SIZE + MAX_DIFF + MAX_LEN + MAX_ZEROS >= BUFF_SIZE."
 #endif
 
+
 #define TOO_MANY_ERRORS 11
 static int errors = 0;
 
-const char* testname = "strcmp";
+const char *testname = "strcmp";
 
 static void
-print_error(char const* msg, ...)
+print_error (char const* msg, ...)
 {
-    errors++;
-    if (errors == TOO_MANY_ERRORS)
+  errors++;
+  if (errors == TOO_MANY_ERRORS)
     {
-        fprintf(stderr, "Too many errors.\n");
+      fprintf (stderr, "Too many errors.\n");
     }
-    else if (errors < TOO_MANY_ERRORS)
+  else if (errors < TOO_MANY_ERRORS)
     {
-        va_list ap;
-        va_start(ap, msg);
-        vfprintf(stderr, msg, ap);
-        va_end(ap);
+      va_list ap;
+      va_start (ap, msg);
+      vfprintf (stderr, msg, ap);
+      va_end (ap);
     }
-    else
+  else
     {
-        /* Further errors omitted.  */
+      /* Further errors omitted.  */
     }
 }
 
+
 extern int rand_seed;
-void       strcmp_main(void)
+void strcmp_main(void)
 {
-    /* Allocate buffers to read and write from.  */
-    char src[BUFF_SIZE], dest[BUFF_SIZE];
-
-    /* Fill the source buffer with non-null values, reproducible random data. */
-    srand(rand_seed);
-    int      i, j, zeros;
-    unsigned sa;
-    unsigned da;
-    unsigned n, m, len;
-    char*    p;
-    int      ret;
-
-    /* Make calls to strcmp with block sizes ranging between 1 and
+  /* Allocate buffers to read and write from.  */
+  char src[BUFF_SIZE], dest[BUFF_SIZE];
+
+  /* Fill the source buffer with non-null values, reproducible random data. */
+  srand (rand_seed);
+  int i, j, zeros;
+  unsigned sa;
+  unsigned da;
+  unsigned n, m, len;
+  char *p;
+  int ret;
+
+  /* Make calls to strcmp with block sizes ranging between 1 and
      MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
-    for (sa = 0; sa <= MAX_OFFSET; sa++)
-        for (da = 0; da <= MAX_OFFSET; da++)
-            for (n = 1; n <= MAX_BLOCK_SIZE; n++)
-            {
-                for (m = 1; m < n + MAX_DIFF; m++)
-                    for (len = 0; len < MAX_LEN; len++)
-                        for (zeros = 1; zeros < MAX_ZEROS; zeros++)
-                        {
-                            if (n - m > MAX_DIFF)
-                                continue;
-                            /* Make a copy of the source.  */
-                            for (i = 0; i < BUFF_SIZE; i++)
-                            {
-                                src[i]  = 'A' + (i % 26);
-                                dest[i] = src[i];
-                            }
-                            delay(0);
-                            memcpy(dest + da, src + sa, n);
-
-                            /* Make src 0-terminated.  */
-                            p = src + sa + n - 1;
-                            for (i = 0; i < zeros; i++)
-                            {
-                                *p++ = '\0';
-                            }
-
-                            /* Modify dest.  */
-                            p = dest + da + m - 1;
-                            for (j = 0; j < (int)len; j++)
-                                *p++ = 'x';
-                            /* Make dest 0-terminated.  */
-                            *p = '\0';
-
-                            ret = strcmp(src + sa, dest + da);
-
-                            /* Check return value.  */
-                            if (n == m)
-                            {
-                                if (len == 0)
-                                {
-                                    if (ret != 0)
-                                    {
-                                        print_error("\nFailed: after %s of %u bytes "
-                                                    "with src_align %u and dst_align %u, "
-                                                    "dest after %d bytes is modified for %d bytes, "
-                                                    "return value is %d, expected 0.\n",
-                                                    testname, n, sa, da, m, len, ret);
-                                    }
-                                }
-                                else
-                                {
-                                    if (ret >= 0)
-                                        print_error("\nFailed: after %s of %u bytes "
-                                                    "with src_align %u and dst_align %u, "
-                                                    "dest after %d bytes is modified for %d bytes, "
-                                                    "return value is %d, expected negative.\n",
-                                                    testname, n, sa, da, m, len, ret);
-                                }
-                            }
-                            else if (m > n)
-                            {
-                                if (ret >= 0)
-                                {
-                                    print_error("\nFailed: after %s of %u bytes "
-                                                "with src_align %u and dst_align %u, "
-                                                "dest after %d bytes is modified for %d bytes, "
-                                                "return value is %d, expected negative.\n",
-                                                testname, n, sa, da, m, len, ret);
-                                }
-                            }
-                            else /* m < n */
-                            {
-                                if (len == 0)
-                                {
-                                    if (ret <= 0)
-                                        print_error("\nFailed: after %s of %u bytes "
-                                                    "with src_align %u and dst_align %u, "
-                                                    "dest after %d bytes is modified for %d bytes, "
-                                                    "return value is %d, expected positive.\n",
-                                                    testname, n, sa, da, m, len, ret);
-                                }
-                                else
-                                {
-                                    if (ret >= 0)
-                                        print_error("\nFailed: after %s of %u bytes "
-                                                    "with src_align %u and dst_align %u, "
-                                                    "dest after %d bytes is modified for %d bytes, "
-                                                    "return value is %d, expected negative.\n",
-                                                    testname, n, sa, da, m, len, ret);
-                                }
-                            }
-                        }
-            }
-
-    /* Check some corner cases.  */
-    src[1]  = 'A';
-    dest[1] = 'A';
-    src[2]  = 'B';
-    dest[2] = 'B';
-    src[3]  = 'C';
-    dest[3] = 'C';
-    src[4]  = '\0';
-    dest[4] = '\0';
-
-    src[0]  = 0xc1;
-    dest[0] = 0x41;
-    ret     = strcmp(src, dest);
-    if (ret <= 0)
-        print_error("\nFailed: expected positive, return %d\n", ret);
-
-    src[0]  = 0x01;
-    dest[0] = 0x82;
-    ret     = strcmp(src, dest);
-    if (ret >= 0)
-        print_error("\nFailed: expected negative, return %d\n", ret);
-
-    dest[0] = src[0] = 'D';
-    src[3]           = 0xc1;
-    dest[3]          = 0x41;
-    ret              = strcmp(src, dest);
-    if (ret <= 0)
-        print_error("\nFailed: expected positive, return %d\n", ret);
-
-    src[3]  = 0x01;
-    dest[3] = 0x82;
-    ret     = strcmp(src, dest);
-    if (ret >= 0)
-        print_error("\nFailed: expected negative, return %d\n", ret);
-
-    //printf ("\n");
-    if (errors != 0)
+  for (sa = 0; sa <= MAX_OFFSET; sa++)
+    for (da = 0; da <= MAX_OFFSET; da++)
+      for (n = 1; n <= MAX_BLOCK_SIZE; n++)
+	{
+	for (m = 1;  m < n + MAX_DIFF; m++)
+	  for (len = 0; len < MAX_LEN; len++)
+	    for  (zeros = 1; zeros < MAX_ZEROS; zeros++)
+	    {
+	      if (n - m > MAX_DIFF)
+		continue;
+	      /* Make a copy of the source.  */
+	      for (i = 0; i < BUFF_SIZE; i++)
+		{
+		  src[i] = 'A' + (i % 26);
+		  dest[i] = src[i];
+		}
+   delay(0);
+	      memcpy (dest + da, src + sa, n);
+
+	      /* Make src 0-terminated.  */
+	      p = src + sa + n - 1;
+	      for (i = 0; i < zeros; i++)
+		{
+		  *p++ = '\0';
+		}
+
+	      /* Modify dest.  */
+	      p = dest + da + m - 1;
+	      for (j = 0; j < (int)len; j++)
+		*p++ = 'x';
+	      /* Make dest 0-terminated.  */
+	      *p = '\0';
+
+	      ret = strcmp (src + sa, dest + da);
+
+	      /* Check return value.  */
+	      if (n == m)
+		{
+		  if (len == 0)
+		    {
+		      if (ret != 0)
+			{
+			print_error ("\nFailed: after %s of %u bytes "
+				     "with src_align %u and dst_align %u, "
+				     "dest after %d bytes is modified for %d bytes, "
+				     "return value is %d, expected 0.\n",
+				     testname, n, sa, da, m, len, ret);
+			}
+		    }
+		  else
+		    {
+		      if (ret >= 0)
+			print_error ("\nFailed: after %s of %u bytes "
+				     "with src_align %u and dst_align %u, "
+				     "dest after %d bytes is modified for %d bytes, "
+				     "return value is %d, expected negative.\n",
+				     testname, n, sa, da, m, len, ret);
+		    }
+		}
+	      else if (m > n)
+		{
+		  if (ret >= 0)
+		    {
+		      print_error ("\nFailed: after %s of %u bytes "
+				   "with src_align %u and dst_align %u, "
+				   "dest after %d bytes is modified for %d bytes, "
+				   "return value is %d, expected negative.\n",
+				   testname, n, sa, da, m, len, ret);
+		    }
+		}
+	      else  /* m < n */
+		{
+		  if (len == 0)
+		    {
+		      if (ret <= 0)
+			print_error ("\nFailed: after %s of %u bytes "
+				     "with src_align %u and dst_align %u, "
+				     "dest after %d bytes is modified for %d bytes, "
+				     "return value is %d, expected positive.\n",
+				     testname, n, sa, da, m, len, ret);
+		    }
+		  else
+		    {
+		      if (ret >= 0)
+			print_error ("\nFailed: after %s of %u bytes "
+				     "with src_align %u and dst_align %u, "
+				     "dest after %d bytes is modified for %d bytes, "
+				     "return value is %d, expected negative.\n",
+				     testname, n, sa, da, m, len, ret);
+		    }
+		}
+	    }
+	}
+
+  /* Check some corner cases.  */
+  src[1] = 'A';
+  dest[1] = 'A';
+  src[2] = 'B';
+  dest[2] = 'B';
+  src[3] = 'C';
+  dest[3] = 'C';
+  src[4] = '\0';
+  dest[4] = '\0';
+
+  src[0] = 0xc1;
+  dest[0] = 0x41;
+  ret = strcmp (src, dest);
+  if (ret <= 0)
+    print_error ("\nFailed: expected positive, return %d\n", ret);
+
+  src[0] = 0x01;
+  dest[0] = 0x82;
+  ret = strcmp (src, dest);
+  if (ret >= 0)
+    print_error ("\nFailed: expected negative, return %d\n", ret);
+
+  dest[0] = src[0] = 'D';
+  src[3] = 0xc1;
+  dest[3] = 0x41;
+  ret = strcmp (src, dest);
+  if (ret <= 0)
+    print_error ("\nFailed: expected positive, return %d\n", ret);
+
+  src[3] = 0x01;
+  dest[3] = 0x82;
+  ret = strcmp (src, dest);
+  if (ret >= 0)
+    print_error ("\nFailed: expected negative, return %d\n", ret);
+
+  //printf ("\n");
+  if (errors != 0)
     {
-        printf("ERROR. FAILED.\n");
-        abort();
+      printf ("ERROR. FAILED.\n");
+      abort ();
     }
-    //exit (0);
-    printf("ok\n");
+  //exit (0);
+  printf("ok\n");
 }
diff --git a/tests/device/test_libc/tstring.c b/tests/device/test_libc/tstring.c
index 8d1f242f5e..7e806b1027 100644
--- a/tests/device/test_libc/tstring.c
+++ b/tests/device/test_libc/tstring.c
@@ -26,271 +26,336 @@
 
 #define MAX_2 (2 * MAX_1 + MAX_1 / 10)
 
-void eprintf(int line, char* result, char* expected, int size)
+void eprintf (int line, char *result, char *expected, int size)
 {
-    if (size != 0)
-        printf("Failure at line %d, result is <%.*s>, should be <%s> of size %d\n",
-               line, size, result, expected, size);
-    else
-        printf("Failure at line %d, result is <%s>, should be <%s>\n",
-               line, result, expected);
+  if (size != 0)
+    printf ("Failure at line %d, result is <%.*s>, should be <%s> of size %d\n",
+             line, size, result, expected, size);
+  else
+    printf ("Failure at line %d, result is <%s>, should be <%s>\n",
+             line, result, expected);
 }
 
-void mycopy(char* target, char* source, int size)
+void mycopy (char *target, char *source, int size)
 {
-    int i;
+  int i;
 
-    for (i = 0; i < size; ++i)
+  for (i = 0; i < size; ++i)
     {
-        target[i] = source[i];
+      target[i] = source[i];
     }
 }
 
-void myset(char* target, char ch, int size)
+void myset (char *target, char ch, int size)
 {
-    int i;
-
-    for (i = 0; i < size; ++i)
+  int i;
+  
+  for (i = 0; i < size; ++i)
     {
-        target[i] = ch;
+      target[i] = ch;
     }
 }
 
 void tstring_main(void)
 {
-    char  target[MAX_1] = "A";
-    char  first_char;
-    char  second_char;
-    char  array[]  = "abcdefghijklmnopqrstuvwxz";
-    char  array2[] = "0123456789!@#$%^&*(";
-    char  buffer2[MAX_1];
-    char  buffer3[MAX_1];
-    char  buffer4[MAX_1];
-    char  buffer5[MAX_2];
-    char  buffer6[MAX_2];
-    char  buffer7[MAX_2];
-    char  expected[MAX_1];
-    char *tmp1, *tmp2, *tmp3, *tmp4, *tmp5, *tmp6, *tmp7;
-    int   i, j, k, x, z, align_test_iterations;
-    z = 0;
-
-    int test_failed = 0;
-
-    tmp1 = target;
-    tmp2 = buffer2;
-    tmp3 = buffer3;
-    tmp4 = buffer4;
-    tmp5 = buffer5;
-    tmp6 = buffer6;
-    tmp7 = buffer7;
-
-    tmp2[0] = 'Z';
-    tmp2[1] = '\0';
-
-    if (memset(target, 'X', 0) != target || memcpy(target, "Y", 0) != target || memmove(target, "K", 0) != target || strncpy(tmp2, "4", 0) != tmp2 || strncat(tmp2, "123", 0) != tmp2 || strcat(target, "") != target)
+  char target[MAX_1] = "A";
+  char first_char;
+  char second_char;
+  char array[] = "abcdefghijklmnopqrstuvwxz";
+  char array2[] = "0123456789!@#$%^&*(";
+  char buffer2[MAX_1];
+  char buffer3[MAX_1];
+  char buffer4[MAX_1];
+  char buffer5[MAX_2];
+  char buffer6[MAX_2];
+  char buffer7[MAX_2];
+  char expected[MAX_1];
+  char *tmp1, *tmp2, *tmp3, *tmp4, *tmp5, *tmp6, *tmp7;
+  int i, j, k, x, z, align_test_iterations;
+  z = 0;
+  
+  int test_failed = 0;
+
+  tmp1 = target;
+  tmp2 = buffer2;
+  tmp3 = buffer3;
+  tmp4 = buffer4;
+  tmp5 = buffer5;
+  tmp6 = buffer6;
+  tmp7 = buffer7;
+
+  tmp2[0] = 'Z';
+  tmp2[1] = '\0';
+
+  if (memset (target, 'X', 0) != target ||
+      memcpy (target, "Y", 0) != target ||
+      memmove (target, "K", 0) != target ||
+      strncpy (tmp2, "4", 0) != tmp2 ||
+      strncat (tmp2, "123", 0) != tmp2 ||
+      strcat (target, "") != target)
     {
-        eprintf(__LINE__, target, "A", 0);
-        test_failed = 1;
+      eprintf (__LINE__, target, "A", 0);
+      test_failed = 1;
     }
 
-    if (strcmp(target, "A") || strlen(target) != 1 || memchr(target, 'A', 0) != NULL
-        || memcmp(target, "J", 0) || strncmp(target, "A", 1) || strncmp(target, "J", 0) || tmp2[0] != 'Z' || tmp2[1] != '\0')
+  if (strcmp (target, "A") || strlen(target) != 1 || memchr (target, 'A', 0) != NULL
+      || memcmp (target, "J", 0) || strncmp (target, "A", 1) || strncmp (target, "J", 0) ||
+      tmp2[0] != 'Z' || tmp2[1] != '\0')
     {
-        eprintf(__LINE__, target, "A", 0);
-        test_failed = 1;
+      eprintf (__LINE__, target, "A", 0);
+      test_failed = 1;
     }
 
-    tmp2[2] = 'A';
-    if (strcpy(target, "") != target || strncpy(tmp2, "", 4) != tmp2 || strcat(target, "") != target)
+  tmp2[2] = 'A';
+  if (strcpy (target, "") != target ||
+      strncpy (tmp2, "", 4) != tmp2 ||
+      strcat (target, "") != target)
     {
-        eprintf(__LINE__, target, "", 0);
-        test_failed = 1;
+      eprintf (__LINE__, target, "", 0);
+      test_failed = 1;
     }
 
-    if (target[0] != '\0' || strncmp(target, "", 1) || memcmp(tmp2, "\0\0\0\0", 4))
+  if (target[0] != '\0' || strncmp (target, "", 1) ||
+      memcmp (tmp2, "\0\0\0\0", 4))
     {
-        eprintf(__LINE__, target, "", 0);
-        test_failed = 1;
+      eprintf (__LINE__, target, "", 0);
+      test_failed = 1;
     }
 
-    tmp2[2] = 'A';
-    if (strncat(tmp2, "1", 3) != tmp2 || memcmp(tmp2, "1\0A", 3))
+  tmp2[2] = 'A';
+  if (strncat (tmp2, "1", 3) != tmp2 ||
+      memcmp (tmp2, "1\0A", 3))
     {
-        eprintf(__LINE__, tmp2, "1\0A", 3);
-        test_failed = 1;
+      eprintf (__LINE__, tmp2, "1\0A", 3);
+      test_failed = 1;
     }
 
-    if (strcpy(tmp3, target) != tmp3 || strcat(tmp3, "X") != tmp3 || strncpy(tmp2, "X", 2) != tmp2 || memset(target, tmp2[0], 1) != target)
+  if (strcpy (tmp3, target) != tmp3 ||
+      strcat (tmp3, "X") != tmp3 ||
+      strncpy (tmp2, "X", 2) != tmp2 ||
+      memset (target, tmp2[0], 1) != target)
     {
-        eprintf(__LINE__, target, "X", 0);
-        test_failed = 1;
+      eprintf (__LINE__, target, "X", 0);
+      test_failed = 1;
     }
 
-    if (strcmp(target, "X") || strlen(target) != 1 || memchr(target, 'X', 2) != target || strchr(target, 'X') != target || memchr(target, 'Y', 2) != NULL || strchr(target, 'Y') != NULL || strcmp(tmp3, target) || strncmp(tmp3, target, 2) || memcmp(target, "K", 0) || strncmp(target, tmp3, 3))
+  if (strcmp (target, "X") || strlen (target) != 1 ||
+      memchr (target, 'X', 2) != target ||
+      strchr (target, 'X') != target ||
+      memchr (target, 'Y', 2) != NULL ||
+      strchr (target, 'Y') != NULL ||
+      strcmp (tmp3, target) ||
+      strncmp (tmp3, target, 2) ||
+      memcmp (target, "K", 0) ||
+      strncmp (target, tmp3, 3))
     {
-        eprintf(__LINE__, target, "X", 0);
-        test_failed = 1;
+      eprintf (__LINE__, target, "X", 0);
+      test_failed = 1;
     }
 
-    if (strcpy(tmp3, "Y") != tmp3 || strcat(tmp3, "Y") != tmp3 || memset(target, 'Y', 2) != target)
+  if (strcpy (tmp3, "Y") != tmp3 ||
+      strcat (tmp3, "Y") != tmp3 ||
+      memset (target, 'Y', 2) != target)
     {
-        eprintf(__LINE__, target, "Y", 0);
-        test_failed = 1;
+      eprintf (__LINE__, target, "Y", 0);
+      test_failed = 1;
     }
 
-    target[2] = '\0';
-    if (memcmp(target, "YY", 2) || strcmp(target, "YY") || strlen(target) != 2 || memchr(target, 'Y', 2) != target || strcmp(tmp3, target) || strncmp(target, tmp3, 3) || strncmp(target, tmp3, 4) || strncmp(target, tmp3, 2) || strchr(target, 'Y') != target)
+  target[2] = '\0';
+  if (memcmp (target, "YY", 2) || strcmp (target, "YY") ||
+      strlen (target) != 2 || memchr (target, 'Y', 2) != target ||
+      strcmp (tmp3, target) ||
+      strncmp (target, tmp3, 3) ||
+      strncmp (target, tmp3, 4) ||
+      strncmp (target, tmp3, 2) ||
+      strchr (target, 'Y') != target)
     {
-        eprintf(__LINE__, target, "YY", 2);
-        test_failed = 1;
+      eprintf (__LINE__, target, "YY", 2);
+      test_failed = 1;
     }
 
-    strcpy(target, "WW");
-    if (memcmp(target, "WW", 2) || strcmp(target, "WW") || strlen(target) != 2 || memchr(target, 'W', 2) != target || strchr(target, 'W') != target)
+  strcpy (target, "WW");
+  if (memcmp (target, "WW", 2) || strcmp (target, "WW") ||
+      strlen (target) != 2 || memchr (target, 'W', 2) != target ||
+      strchr (target, 'W') != target)
     {
-        eprintf(__LINE__, target, "WW", 2);
-        test_failed = 1;
+      eprintf (__LINE__, target, "WW", 2);
+      test_failed = 1;
     }
 
-    if (strncpy(target, "XX", 16) != target || memcmp(target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16))
+  if (strncpy (target, "XX", 16) != target ||
+      memcmp (target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16))
     {
-        eprintf(__LINE__, target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16);
-        test_failed = 1;
+      eprintf (__LINE__, target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16);
+      test_failed = 1;
     }
 
-    if (strcpy(tmp3, "ZZ") != tmp3 || strcat(tmp3, "Z") != tmp3 || memcpy(tmp4, "Z", 2) != tmp4 || strcat(tmp4, "ZZ") != tmp4 || memset(target, 'Z', 3) != target)
+  if (strcpy (tmp3, "ZZ") != tmp3 ||
+      strcat (tmp3, "Z") != tmp3 ||
+      memcpy (tmp4, "Z", 2) != tmp4 ||
+      strcat (tmp4, "ZZ") != tmp4 ||
+      memset (target, 'Z', 3) != target)
     {
-        eprintf(__LINE__, target, "ZZZ", 3);
-        test_failed = 1;
+      eprintf (__LINE__, target, "ZZZ", 3);
+      test_failed = 1;
     }
 
-    target[3] = '\0';
-    tmp5[0]   = '\0';
-    strncat(tmp5, "123", 2);
-    if (memcmp(target, "ZZZ", 3) || strcmp(target, "ZZZ") || strcmp(tmp3, target) || strcmp(tmp4, target) || strncmp(target, "ZZZ", 4) || strncmp(target, "ZZY", 3) <= 0 || strncmp("ZZY", target, 4) >= 0 || memcmp(tmp5, "12", 3) || strlen(target) != 3)
+  target[3] = '\0';
+  tmp5[0] = '\0';
+  strncat (tmp5, "123", 2);
+  if (memcmp (target, "ZZZ", 3) || strcmp (target, "ZZZ") ||
+      strcmp (tmp3, target) || strcmp (tmp4, target) ||
+      strncmp (target, "ZZZ", 4) || strncmp (target, "ZZY", 3) <= 0 ||
+      strncmp ("ZZY", target, 4) >= 0 ||
+      memcmp (tmp5, "12", 3) ||
+      strlen (target) != 3)
     {
-        eprintf(__LINE__, target, "ZZZ", 3);
-        test_failed = 1;
+      eprintf (__LINE__, target, "ZZZ", 3);
+      test_failed = 1;
     }
 
-    target[2] = 'K';
-    if (memcmp(target, "ZZZ", 2) || strcmp(target, "ZZZ") >= 0 || memcmp(target, "ZZZ", 3) >= 0 || strlen(target) != 3 || memchr(target, 'K', 3) != target + 2 || strncmp(target, "ZZZ", 2) || strncmp(target, "ZZZ", 4) >= 0 || strchr(target, 'K') != target + 2)
+  target[2] = 'K';
+  if (memcmp (target, "ZZZ", 2) || strcmp (target, "ZZZ") >= 0 ||
+      memcmp (target, "ZZZ", 3) >= 0 || strlen (target) != 3 ||
+      memchr (target, 'K', 3) != target + 2 ||
+      strncmp (target, "ZZZ", 2) || strncmp (target, "ZZZ", 4) >= 0 ||
+      strchr (target, 'K') != target + 2)
     {
-        eprintf(__LINE__, target, "ZZK", 3);
-        test_failed = 1;
+      eprintf (__LINE__, target, "ZZK", 3);
+      test_failed = 1;
     }
-
-    strcpy(target, "AAA");
-    if (memcmp(target, "AAA", 3) || strcmp(target, "AAA") || strncmp(target, "AAA", 3) || strlen(target) != 3)
+  
+  strcpy (target, "AAA");
+  if (memcmp (target, "AAA", 3) || strcmp (target, "AAA") ||
+      strncmp (target, "AAA", 3) ||
+      strlen (target) != 3)
     {
-        eprintf(__LINE__, target, "AAA", 3);
-        test_failed = 1;
+      eprintf (__LINE__, target, "AAA", 3);
+      test_failed = 1;
     }
-
-    j = 5;
-    while (j < MAX_1)
+  
+  j = 5;
+  while (j < MAX_1)
     {
-        for (i = j - 1; i <= j + 1; ++i)
+      for (i = j-1; i <= j+1; ++i)
         {
-            /* don't bother checking unaligned data in the larger
+	  /* don't bother checking unaligned data in the larger
 	     sizes since it will waste time without performing additional testing */
-            if ((size_t)i <= 16 * sizeof(long))
-            {
-                align_test_iterations = 2 * sizeof(long);
-                if ((size_t)i <= 2 * sizeof(long) + 1)
-                    z = 2;
-                else
-                    z = 2 * sizeof(long);
+	  if ((size_t)i <= 16 * sizeof(long))
+	    {
+	      align_test_iterations = 2*sizeof(long);
+              if ((size_t)i <= 2 * sizeof(long) + 1)
+                z = 2;
+	      else
+	        z = 2 * sizeof(long);
             }
-            else
+	  else
             {
-                align_test_iterations = 1;
+	      align_test_iterations = 1;
             }
 
-            for (x = 0; x < align_test_iterations; ++x)
-            {
-                tmp1 = target + x;
-                tmp2 = buffer2 + x;
-                tmp3 = buffer3 + x;
-                tmp4 = buffer4 + x;
-                tmp5 = buffer5 + x;
-                tmp6 = buffer6 + x;
-
-                first_char  = array[i % (sizeof(array) - 1)];
-                second_char = array2[i % (sizeof(array2) - 1)];
-                memset(tmp1, first_char, i);
-                mycopy(tmp2, tmp1, i);
-                myset(tmp2 + z, second_char, i - z - 1);
-                if (memcpy(tmp1 + z, tmp2 + z, i - z - 1) != tmp1 + z)
-                {
-                    printf("error at line %d\n", __LINE__);
-                    test_failed = 1;
-                }
-
-                tmp1[i] = '\0';
-                tmp2[i] = '\0';
-                if (strcpy(expected, tmp2) != expected)
-                {
-                    printf("error at line %d\n", __LINE__);
-                    test_failed = 1;
-                }
-                tmp2[i - z] = first_char + 1;
-                if (memmove(tmp2 + z + 1, tmp2 + z, i - z - 1) != tmp2 + z + 1 || memset(tmp3, first_char, i) != tmp3)
-                {
-                    printf("error at line %d\n", __LINE__);
-                    test_failed = 1;
-                }
-
-                myset(tmp4, first_char, i);
-                tmp5[0] = '\0';
-                if (strncpy(tmp5, tmp1, i + 1) != tmp5 || strcat(tmp5, tmp1) != tmp5)
-                {
-                    printf("error at line %d\n", __LINE__);
-                    test_failed = 1;
-                }
-                mycopy(tmp6, tmp1, i);
-                mycopy(tmp6 + i, tmp1, i + 1);
-
-                tmp7[2 * i + z] = second_char;
-                strcpy(tmp7, tmp1);
-
-                (void)strchr(tmp1, second_char);
-
-                if (memcmp(tmp1, expected, i) || strcmp(tmp1, expected) || strncmp(tmp1, expected, i) || strncmp(tmp1, expected, i + 1) || strcmp(tmp1, tmp2) >= 0 || memcmp(tmp1, tmp2, i) >= 0 || strncmp(tmp1, tmp2, i + 1) >= 0 || (int)strlen(tmp1) != i || memchr(tmp1, first_char, i) != tmp1 || strchr(tmp1, first_char) != tmp1 || memchr(tmp1, second_char, i) != tmp1 + z || strchr(tmp1, second_char) != tmp1 + z || strcmp(tmp5, tmp6) || strncat(tmp7, tmp1, i + 2) != tmp7 || strcmp(tmp7, tmp6) || tmp7[2 * i + z] != second_char)
-                {
-                    eprintf(__LINE__, tmp1, expected, 0);
-                    printf("x is %d\n", x);
-                    printf("i is %d\n", i);
-                    printf("tmp1 is <%p>\n", tmp1);
-                    printf("tmp5 is <%p> <%s>\n", tmp5, tmp5);
-                    printf("tmp6 is <%p> <%s>\n", tmp6, tmp6);
-                    test_failed = 1;
-                }
-
-                for (k = 1; k <= align_test_iterations && k <= i; ++k)
-                {
-                    if (memcmp(tmp3, tmp4, i - k + 1) != 0 || strncmp(tmp3, tmp4, i - k + 1) != 0)
-                    {
-                        printf("Failure at line %d, comparing %.*s with %.*s\n",
-                               __LINE__, i, tmp3, i, tmp4);
-                        test_failed = 1;
-                    }
-                    tmp4[i - k] = first_char + 1;
-                    if (memcmp(tmp3, tmp4, i) >= 0 || strncmp(tmp3, tmp4, i) >= 0 || memcmp(tmp4, tmp3, i) <= 0 || strncmp(tmp4, tmp3, i) <= 0)
-                    {
-                        printf("Failure at line %d, comparing %.*s with %.*s\n",
-                               __LINE__, i, tmp3, i, tmp4);
-                        test_failed = 1;
-                    }
-                    tmp4[i - k] = first_char;
-                }
-            }
+	  for (x = 0; x < align_test_iterations; ++x)
+	    {
+	      tmp1 = target + x;
+	      tmp2 = buffer2 + x;
+	      tmp3 = buffer3 + x;
+	      tmp4 = buffer4 + x;
+	      tmp5 = buffer5 + x;
+	      tmp6 = buffer6 + x;
+
+	      first_char = array[i % (sizeof(array) - 1)];
+	      second_char = array2[i % (sizeof(array2) - 1)];
+	      memset (tmp1, first_char, i);
+	      mycopy (tmp2, tmp1, i);
+	      myset (tmp2 + z, second_char, i - z - 1);
+	      if (memcpy (tmp1 + z, tmp2 + z, i - z - 1) != tmp1 + z)
+		{
+		  printf ("error at line %d\n", __LINE__);
+		  test_failed = 1;
+		}
+
+	      tmp1[i] = '\0';
+	      tmp2[i] = '\0';
+	      if (strcpy (expected, tmp2) != expected)
+		{
+		  printf ("error at line %d\n", __LINE__);
+		  test_failed = 1;
+		}
+	      tmp2[i-z] = first_char + 1;
+	      if (memmove (tmp2 + z + 1, tmp2 + z, i - z - 1) != tmp2 + z + 1 ||
+		  memset (tmp3, first_char, i) != tmp3)
+		{
+		  printf ("error at line %d\n", __LINE__);
+		  test_failed = 1;
+		}
+
+	      myset (tmp4, first_char, i);
+	      tmp5[0] = '\0';
+	      if (strncpy (tmp5, tmp1, i+1) != tmp5 ||
+		  strcat (tmp5, tmp1) != tmp5)
+		{
+		  printf ("error at line %d\n", __LINE__);
+		  test_failed = 1;
+		}
+	      mycopy (tmp6, tmp1, i);
+	      mycopy (tmp6 + i, tmp1, i + 1);
+
+	      tmp7[2*i+z] = second_char;
+              strcpy (tmp7, tmp1);
+         
+	      (void)strchr (tmp1, second_char);
+ 
+	      if (memcmp (tmp1, expected, i) || strcmp (tmp1, expected) ||
+		  strncmp (tmp1, expected, i) ||
+                  strncmp (tmp1, expected, i+1) ||
+		  strcmp (tmp1, tmp2) >= 0 || memcmp (tmp1, tmp2, i) >= 0 ||
+		  strncmp (tmp1, tmp2, i+1) >= 0 ||
+		  (int)strlen (tmp1) != i || memchr (tmp1, first_char, i) != tmp1 ||
+		  strchr (tmp1, first_char) != tmp1 ||
+		  memchr (tmp1, second_char, i) != tmp1 + z ||
+		  strchr (tmp1, second_char) != tmp1 + z ||
+		  strcmp (tmp5, tmp6) ||
+		  strncat (tmp7, tmp1, i+2) != tmp7 ||
+		  strcmp (tmp7, tmp6) ||
+		  tmp7[2*i+z] != second_char)
+		{
+		  eprintf (__LINE__, tmp1, expected, 0);
+		  printf ("x is %d\n",x);
+		  printf ("i is %d\n", i);
+		  printf ("tmp1 is <%p>\n", tmp1);
+		  printf ("tmp5 is <%p> <%s>\n", tmp5, tmp5);
+		  printf ("tmp6 is <%p> <%s>\n", tmp6, tmp6);
+		  test_failed = 1;
+		}
+
+	      for (k = 1; k <= align_test_iterations && k <= i; ++k)
+		{
+		  if (memcmp (tmp3, tmp4, i - k + 1) != 0 ||
+		      strncmp (tmp3, tmp4, i - k + 1) != 0)
+		    {
+		      printf ("Failure at line %d, comparing %.*s with %.*s\n",
+			      __LINE__, i, tmp3, i, tmp4);
+		      test_failed = 1;
+		    }
+		  tmp4[i-k] = first_char + 1;
+		  if (memcmp (tmp3, tmp4, i) >= 0 ||
+		      strncmp (tmp3, tmp4, i) >= 0 ||
+		      memcmp (tmp4, tmp3, i) <= 0 ||
+		      strncmp (tmp4, tmp3, i) <= 0)
+		    {
+		      printf ("Failure at line %d, comparing %.*s with %.*s\n",
+			      __LINE__, i, tmp3, i, tmp4);
+		      test_failed = 1;
+		    }
+		  tmp4[i-k] = first_char;
+		}
+	    }              
         }
-        j = ((2 * j) >> 2) << 2;
+      j = ((2 * j) >> 2) << 2;
     }
 
-    if (test_failed)
-        abort();
+  if (test_failed)
+    abort();
 
-    printf("ok\n");
+  printf("ok\n"); 
 }
diff --git a/tests/host/common/Arduino.cpp b/tests/host/common/Arduino.cpp
index b67d2d429e..1c651e7e1f 100644
--- a/tests/host/common/Arduino.cpp
+++ b/tests/host/common/Arduino.cpp
@@ -41,6 +41,7 @@ extern "C" unsigned long micros()
     return ((time.tv_sec - gtod0.tv_sec) * 1000000) + time.tv_usec - gtod0.tv_usec;
 }
 
+
 extern "C" void yield()
 {
     run_scheduled_recurrent_functions();
@@ -57,7 +58,7 @@ extern "C" bool can_yield()
     return true;
 }
 
-extern "C" void optimistic_yield(uint32_t interval_us)
+extern "C" void optimistic_yield (uint32_t interval_us)
 {
     (void)interval_us;
 }
@@ -74,24 +75,21 @@ extern "C" void esp_yield()
 {
 }
 
-extern "C" void esp_delay(unsigned long ms)
+extern "C" void esp_delay (unsigned long ms)
 {
     usleep(ms * 1000);
 }
 
-bool esp_try_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms)
-{
+bool esp_try_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms) {
     uint32_t expired = millis() - start_ms;
-    if (expired >= timeout_ms)
-    {
+    if (expired >= timeout_ms) {
         return true;
     }
     esp_delay(std::min((timeout_ms - expired), intvl_ms));
     return false;
 }
 
-extern "C" void __panic_func(const char* file, int line, const char* func)
-{
+extern "C" void __panic_func(const char* file, int line, const char* func) {
     (void)file;
     (void)line;
     (void)func;
@@ -109,7 +107,7 @@ extern "C" void delayMicroseconds(unsigned int us)
 }
 
 #include "cont.h"
-cont_t*         g_pcont = NULL;
+cont_t* g_pcont = NULL;
 extern "C" void cont_suspend(cont_t*)
 {
 }
diff --git a/tests/host/common/ArduinoCatch.cpp b/tests/host/common/ArduinoCatch.cpp
index c0e835495d..6a1e3cca23 100644
--- a/tests/host/common/ArduinoCatch.cpp
+++ b/tests/host/common/ArduinoCatch.cpp
@@ -17,3 +17,4 @@
 #include <catch.hpp>
 #include <sys/time.h>
 #include "Arduino.h"
+
diff --git a/tests/host/common/ArduinoMain.cpp b/tests/host/common/ArduinoMain.cpp
index 7a759011cf..ddda929d46 100644
--- a/tests/host/common/ArduinoMain.cpp
+++ b/tests/host/common/ArduinoMain.cpp
@@ -30,7 +30,7 @@
 */
 
 #include <Arduino.h>
-#include <user_interface.h>  // wifi_get_ip_info()
+#include <user_interface.h> // wifi_get_ip_info()
 
 #include <signal.h>
 #include <unistd.h>
@@ -41,281 +41,280 @@
 
 #define MOCK_PORT_SHIFTER 9000
 
-bool        user_exit         = false;
-bool        run_once          = false;
-const char* host_interface    = nullptr;
-size_t      spiffs_kb         = 1024;
-size_t      littlefs_kb       = 1024;
-bool        ignore_sigint     = false;
-bool        restore_tty       = false;
-bool        mockdebug         = false;
-int         mock_port_shifter = MOCK_PORT_SHIFTER;
-const char* fspath            = nullptr;
+bool user_exit = false;
+bool run_once = false;
+const char* host_interface = nullptr;
+size_t spiffs_kb = 1024;
+size_t littlefs_kb = 1024;
+bool ignore_sigint = false;
+bool restore_tty = false;
+bool mockdebug = false;
+int mock_port_shifter = MOCK_PORT_SHIFTER;
+const char* fspath = nullptr;
 
 #define STDIN STDIN_FILENO
 
 static struct termios initial_settings;
 
-int mockverbose(const char* fmt, ...)
+int mockverbose (const char* fmt, ...)
 {
-    va_list ap;
-    va_start(ap, fmt);
-    if (mockdebug)
-        return fprintf(stderr, MOCK) + vfprintf(stderr, fmt, ap);
-    return 0;
+	va_list ap;
+	va_start(ap, fmt);
+	if (mockdebug)
+		return fprintf(stderr, MOCK) + vfprintf(stderr, fmt, ap);
+	return 0;
 }
 
 static int mock_start_uart(void)
 {
-    struct termios settings;
-
-    if (!isatty(STDIN))
-    {
-        perror("setting tty in raw mode: isatty(STDIN)");
-        return -1;
-    }
-    if (tcgetattr(STDIN, &initial_settings) < 0)
-    {
-        perror("setting tty in raw mode: tcgetattr(STDIN)");
-        return -1;
-    }
-    settings = initial_settings;
-    settings.c_lflag &= ~(ignore_sigint ? ISIG : 0);
-    settings.c_lflag &= ~(ECHO | ICANON);
-    settings.c_iflag &= ~(ICRNL | INLCR | ISTRIP | IXON);
-    settings.c_oflag |= (ONLCR);
-    settings.c_cc[VMIN]  = 0;
-    settings.c_cc[VTIME] = 0;
-    if (tcsetattr(STDIN, TCSANOW, &settings) < 0)
-    {
-        perror("setting tty in raw mode: tcsetattr(STDIN)");
-        return -1;
-    }
-    restore_tty = true;
-    return 0;
+	struct termios settings;
+
+	if (!isatty(STDIN))
+	{
+		perror("setting tty in raw mode: isatty(STDIN)");
+		return -1;
+	}
+	if (tcgetattr(STDIN, &initial_settings) < 0)
+	{
+		perror("setting tty in raw mode: tcgetattr(STDIN)");
+		return -1;
+	}
+	settings = initial_settings;
+	settings.c_lflag &= ~(ignore_sigint ? ISIG : 0);
+	settings.c_lflag &= ~(ECHO	| ICANON);
+	settings.c_iflag &= ~(ICRNL | INLCR | ISTRIP | IXON);
+	settings.c_oflag |=	(ONLCR);
+	settings.c_cc[VMIN]	= 0;
+	settings.c_cc[VTIME] = 0;
+	if (tcsetattr(STDIN, TCSANOW, &settings) < 0)
+	{
+		perror("setting tty in raw mode: tcsetattr(STDIN)");
+		return -1;
+	}
+	restore_tty = true;
+	return 0;
 }
 
 static int mock_stop_uart(void)
 {
-    if (!restore_tty)
-        return 0;
-    if (!isatty(STDIN))
-    {
-        perror("restoring tty: isatty(STDIN)");
-        return -1;
-    }
-    if (tcsetattr(STDIN, TCSANOW, &initial_settings) < 0)
-    {
-        perror("restoring tty: tcsetattr(STDIN)");
-        return -1;
-    }
-    printf("\e[?25h");  // show cursor
-    return (0);
+	if (!restore_tty) return 0;
+	if (!isatty(STDIN)) {
+		perror("restoring tty: isatty(STDIN)");
+		return -1;
+	}
+	if (tcsetattr(STDIN, TCSANOW, &initial_settings) < 0)
+	{
+		perror("restoring tty: tcsetattr(STDIN)");
+		return -1;
+	}
+	printf("\e[?25h"); // show cursor
+	return (0);
 }
 
 static uint8_t mock_read_uart(void)
 {
-    uint8_t ch = 0;
-    return (read(STDIN, &ch, 1) == 1) ? ch : 0;
+	uint8_t ch = 0;
+	return (read(STDIN, &ch, 1) == 1) ? ch : 0;
 }
 
-void help(const char* argv0, int exitcode)
+void help (const char* argv0, int exitcode)
 {
-    printf(
-        "%s - compiled with esp8266/arduino emulator\n"
-        "options:\n"
-        "\t-h\n"
-        "\tnetwork:\n"
-        "\t-i <interface> - use this interface for IP address\n"
-        "\t-l             - bind tcp/udp servers to interface only (not 0.0.0.0)\n"
-        "\t-s             - port shifter (default: %d, when root: 0)\n"
+	printf(
+		"%s - compiled with esp8266/arduino emulator\n"
+		"options:\n"
+		"\t-h\n"
+		"\tnetwork:\n"
+		"\t-i <interface> - use this interface for IP address\n"
+		"\t-l             - bind tcp/udp servers to interface only (not 0.0.0.0)\n"
+		"\t-s             - port shifter (default: %d, when root: 0)\n"
         "\tterminal:\n"
-        "\t-b             - blocking tty/mocked-uart (default: not blocking tty)\n"
-        "\t-T             - show timestamp on output\n"
-        "\tFS:\n"
-        "\t-P             - path for fs-persistent files (default: %s-)\n"
-        "\t-S             - spiffs size in KBytes (default: %zd)\n"
-        "\t-L             - littlefs size in KBytes (default: %zd)\n"
-        "\t                 (spiffs, littlefs: negative value will force mismatched size)\n"
+		"\t-b             - blocking tty/mocked-uart (default: not blocking tty)\n"
+		"\t-T             - show timestamp on output\n"
+		"\tFS:\n"
+		"\t-P             - path for fs-persistent files (default: %s-)\n"
+		"\t-S             - spiffs size in KBytes (default: %zd)\n"
+		"\t-L             - littlefs size in KBytes (default: %zd)\n"
+		"\t                 (spiffs, littlefs: negative value will force mismatched size)\n"
         "\tgeneral:\n"
-        "\t-c             - ignore CTRL-C (send it via Serial)\n"
-        "\t-f             - no throttle (possibly 100%%CPU)\n"
-        "\t-1             - run loop once then exit (for host testing)\n"
-        "\t-v             - verbose\n",
-        argv0, MOCK_PORT_SHIFTER, argv0, spiffs_kb, littlefs_kb);
-    exit(exitcode);
+		"\t-c             - ignore CTRL-C (send it via Serial)\n"
+		"\t-f             - no throttle (possibly 100%%CPU)\n"
+		"\t-1             - run loop once then exit (for host testing)\n"
+		"\t-v             - verbose\n"
+		, argv0, MOCK_PORT_SHIFTER, argv0, spiffs_kb, littlefs_kb);
+	exit(exitcode);
 }
 
-static struct option options[] = {
-    { "help", no_argument, NULL, 'h' },
-    { "fast", no_argument, NULL, 'f' },
-    { "local", no_argument, NULL, 'l' },
-    { "sigint", no_argument, NULL, 'c' },
-    { "blockinguart", no_argument, NULL, 'b' },
-    { "verbose", no_argument, NULL, 'v' },
-    { "timestamp", no_argument, NULL, 'T' },
-    { "interface", required_argument, NULL, 'i' },
-    { "fspath", required_argument, NULL, 'P' },
-    { "spiffskb", required_argument, NULL, 'S' },
-    { "littlefskb", required_argument, NULL, 'L' },
-    { "portshifter", required_argument, NULL, 's' },
-    { "once", no_argument, NULL, '1' },
+static struct option options[] =
+{
+	{ "help",           no_argument,        NULL, 'h' },
+	{ "fast",           no_argument,        NULL, 'f' },
+	{ "local",          no_argument,        NULL, 'l' },
+	{ "sigint",         no_argument,        NULL, 'c' },
+	{ "blockinguart",   no_argument,        NULL, 'b' },
+	{ "verbose",        no_argument,        NULL, 'v' },
+	{ "timestamp",      no_argument,        NULL, 'T' },
+	{ "interface",      required_argument,  NULL, 'i' },
+	{ "fspath",         required_argument,  NULL, 'P' },
+	{ "spiffskb",       required_argument,  NULL, 'S' },
+	{ "littlefskb",     required_argument,  NULL, 'L' },
+	{ "portshifter",    required_argument,  NULL, 's' },
+	{ "once",           no_argument,        NULL, '1' },
 };
 
-void cleanup()
+void cleanup ()
 {
-    mock_stop_spiffs();
-    mock_stop_littlefs();
-    mock_stop_uart();
+	mock_stop_spiffs();
+	mock_stop_littlefs();
+	mock_stop_uart();
 }
 
-void make_fs_filename(String& name, const char* fspath, const char* argv0)
+void make_fs_filename (String& name, const char* fspath, const char* argv0)
 {
-    name.clear();
-    if (fspath)
-    {
-        int lastSlash = -1;
-        for (int i = 0; argv0[i]; i++)
-            if (argv0[i] == '/')
-                lastSlash = i;
-        name = fspath;
-        name += '/';
-        name += &argv0[lastSlash + 1];
-    }
-    else
-        name = argv0;
+	name.clear();
+	if (fspath)
+	{
+		int lastSlash = -1;
+		for (int i = 0; argv0[i]; i++)
+			if (argv0[i] == '/')
+				lastSlash = i;
+		name = fspath;
+		name += '/';
+		name += &argv0[lastSlash + 1];
+	}
+	else
+		name = argv0;
 }
 
-void control_c(int sig)
+void control_c (int sig)
 {
-    (void)sig;
-
-    if (user_exit)
-    {
-        fprintf(stderr, MOCK "stuck, killing\n");
-        cleanup();
-        exit(1);
-    }
-    user_exit = true;
+	(void)sig;
+
+	if (user_exit)
+	{
+		fprintf(stderr, MOCK "stuck, killing\n");
+		cleanup();
+		exit(1);
+	}
+	user_exit = true;
 }
 
-int main(int argc, char* const argv[])
+int main (int argc, char* const argv [])
 {
-    bool fast     = false;
-    blocking_uart = false;  // global
-
-    signal(SIGINT, control_c);
-    signal(SIGTERM, control_c);
-    if (geteuid() == 0)
-        mock_port_shifter = 0;
-    else
-        mock_port_shifter = MOCK_PORT_SHIFTER;
-
-    for (;;)
-    {
-        int n = getopt_long(argc, argv, "hlcfbvTi:S:s:L:P:1", options, NULL);
-        if (n < 0)
-            break;
-        switch (n)
-        {
-        case 'h':
-            help(argv[0], EXIT_SUCCESS);
-            break;
-        case 'i':
-            host_interface = optarg;
-            break;
-        case 'l':
-            global_ipv4_netfmt = NO_GLOBAL_BINDING;
-            break;
-        case 's':
-            mock_port_shifter = atoi(optarg);
-            break;
-        case 'c':
-            ignore_sigint = true;
-            break;
-        case 'f':
-            fast = true;
-            break;
-        case 'S':
-            spiffs_kb = atoi(optarg);
-            break;
-        case 'L':
-            littlefs_kb = atoi(optarg);
-            break;
-        case 'P':
-            fspath = optarg;
-            break;
-        case 'b':
-            blocking_uart = true;
-            break;
-        case 'v':
-            mockdebug = true;
-            break;
-        case 'T':
-            serial_timestamp = true;
-            break;
-        case '1':
-            run_once = true;
-            break;
-        default:
-            help(argv[0], EXIT_FAILURE);
-        }
-    }
-
-    mockverbose("server port shifter: %d\n", mock_port_shifter);
-
-    if (spiffs_kb)
-    {
-        String name;
-        make_fs_filename(name, fspath, argv[0]);
-        name += "-spiffs";
-        name += String(spiffs_kb > 0 ? spiffs_kb : -spiffs_kb, DEC);
-        name += "KB";
-        mock_start_spiffs(name, spiffs_kb);
-    }
-
-    if (littlefs_kb)
-    {
-        String name;
-        make_fs_filename(name, fspath, argv[0]);
-        name += "-littlefs";
-        name += String(littlefs_kb > 0 ? littlefs_kb : -littlefs_kb, DEC);
-        name += "KB";
-        mock_start_littlefs(name, littlefs_kb);
-    }
-
-    // setup global global_ipv4_netfmt
-    wifi_get_ip_info(0, nullptr);
-
-    if (!blocking_uart)
-    {
-        // set stdin to non blocking mode
-        mock_start_uart();
-    }
-
-    // install exit handler in case Esp.restart() is called
-    atexit(cleanup);
-
-    // first call to millis(): now is millis() and micros() beginning
-    millis();
-
-    setup();
-    while (!user_exit)
-    {
-        uint8_t data = mock_read_uart();
-
-        if (data)
-            uart_new_data(UART0, data);
-        if (!fast)
-            usleep(1000);  // not 100% cpu, ~1000 loops per second
-        loop();
-        loop_end();
-        check_incoming_udp();
-
-        if (run_once)
-            user_exit = true;
-    }
-    cleanup();
-
-    return 0;
+	bool fast = false;
+	blocking_uart = false; // global
+
+	signal(SIGINT, control_c);
+	signal(SIGTERM, control_c);
+	if (geteuid() == 0)
+		mock_port_shifter = 0;
+	else
+		mock_port_shifter = MOCK_PORT_SHIFTER;
+
+	for (;;)
+	{
+		int n = getopt_long(argc, argv, "hlcfbvTi:S:s:L:P:1", options, NULL);
+		if (n < 0)
+			break;
+		switch (n)
+		{
+		case 'h':
+			help(argv[0], EXIT_SUCCESS);
+			break;
+		case 'i':
+			host_interface = optarg;
+			break;
+		case 'l':
+			global_ipv4_netfmt = NO_GLOBAL_BINDING;
+			break;
+		case 's':
+			mock_port_shifter = atoi(optarg);
+			break;
+		case 'c':
+			ignore_sigint = true;
+			break;
+		case 'f':
+			fast = true;
+			break;
+		case 'S':
+			spiffs_kb = atoi(optarg);
+			break;
+		case 'L':
+			littlefs_kb = atoi(optarg);
+			break;
+		case 'P':
+			fspath = optarg;
+			break;
+		case 'b':
+			blocking_uart = true;
+			break;
+		case 'v':
+			mockdebug = true;
+			break;
+		case 'T':
+			serial_timestamp = true;
+			break;
+		case '1':
+			run_once = true;
+			break;
+		default:
+			help(argv[0], EXIT_FAILURE);
+		}
+	}
+
+	mockverbose("server port shifter: %d\n", mock_port_shifter);
+
+	if (spiffs_kb)
+	{
+		String name;
+		make_fs_filename(name, fspath, argv[0]);
+		name += "-spiffs";
+		name += String(spiffs_kb > 0? spiffs_kb: -spiffs_kb, DEC);
+		name += "KB";
+		mock_start_spiffs(name, spiffs_kb);
+	}
+
+	if (littlefs_kb)
+	{
+		String name;
+		make_fs_filename(name, fspath, argv[0]);
+		name += "-littlefs";
+		name += String(littlefs_kb > 0? littlefs_kb: -littlefs_kb, DEC);
+		name += "KB";
+		mock_start_littlefs(name, littlefs_kb);
+	}
+
+	// setup global global_ipv4_netfmt
+	wifi_get_ip_info(0, nullptr);
+
+	if (!blocking_uart)
+	{
+		// set stdin to non blocking mode
+		mock_start_uart();
+	}
+
+	// install exit handler in case Esp.restart() is called
+	atexit(cleanup);
+
+	// first call to millis(): now is millis() and micros() beginning
+	millis();
+
+	setup();
+	while (!user_exit)
+	{
+		uint8_t data = mock_read_uart();
+
+		if (data)
+			uart_new_data(UART0, data);
+		if (!fast)
+			usleep(1000); // not 100% cpu, ~1000 loops per second
+		loop();
+		loop_end();
+		check_incoming_udp();
+
+		if (run_once)
+			user_exit = true;
+	}
+	cleanup();
+
+	return 0;
 }
diff --git a/tests/host/common/ClientContextSocket.cpp b/tests/host/common/ClientContextSocket.cpp
index 4586969ca2..2d1d7c6e83 100644
--- a/tests/host/common/ClientContextSocket.cpp
+++ b/tests/host/common/ClientContextSocket.cpp
@@ -39,167 +39,168 @@
 #include <fcntl.h>
 #include <errno.h>
 
-int mockSockSetup(int sock)
+int mockSockSetup (int sock)
 {
-    if (fcntl(sock, F_SETFL, O_NONBLOCK) == -1)
-    {
-        perror("socket fcntl(O_NONBLOCK)");
-        close(sock);
-        return -1;
-    }
+	if (fcntl(sock, F_SETFL, O_NONBLOCK) == -1)
+	{
+		perror("socket fcntl(O_NONBLOCK)");
+		close(sock);
+		return -1;
+	}
 
 #ifndef MSG_NOSIGNAL
-    int i = 1;
-    if (setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof i) == -1)
-    {
-        perror("sockopt(SO_NOSIGPIPE)(macOS)");
-        close(sock);
-        return -1;
-    }
+	int i = 1;
+	if (setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof i) == -1)
+	{
+		perror("sockopt(SO_NOSIGPIPE)(macOS)");
+		close(sock);
+		return -1;
+	}
 #endif
 
-    return sock;
+	return sock;
 }
 
-int mockConnect(uint32_t ipv4, int& sock, int port)
+int mockConnect (uint32_t ipv4, int& sock, int port)
 {
-    struct sockaddr_in server;
-    if ((sock = ::socket(AF_INET, SOCK_STREAM, 0)) == -1)
-    {
-        perror(MOCK "ClientContext:connect: ::socket()");
-        return 0;
-    }
-    server.sin_family = AF_INET;
-    server.sin_port   = htons(port);
-    memcpy(&server.sin_addr, &ipv4, 4);
-    if (::connect(sock, (struct sockaddr*)&server, sizeof(server)) == -1)
-    {
-        perror(MOCK "ClientContext::connect: ::connect()");
-        return 0;
-    }
-
-    return mockSockSetup(sock) == -1 ? 0 : 1;
+	struct sockaddr_in server;
+	if ((sock = ::socket(AF_INET, SOCK_STREAM, 0)) == -1)
+	{
+		perror(MOCK "ClientContext:connect: ::socket()");
+		return 0;
+	}
+	server.sin_family = AF_INET;
+	server.sin_port = htons(port);
+	memcpy(&server.sin_addr, &ipv4, 4);
+	if (::connect(sock, (struct sockaddr*)&server, sizeof(server)) == -1)
+	{
+		perror(MOCK "ClientContext::connect: ::connect()");
+		return 0;
+	}
+
+	return mockSockSetup(sock) == -1? 0: 1;
 }
 
-ssize_t mockFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize)
+ssize_t mockFillInBuf (int sock, char* ccinbuf, size_t& ccinbufsize)
 {
-    size_t  maxread = CCBUFSIZE - ccinbufsize;
-    ssize_t ret     = ::read(sock, ccinbuf + ccinbufsize, maxread);
-
-    if (ret == 0)
-    {
-        // connection closed
-        // nothing is read
-        return 0;
-    }
-
-    if (ret == -1)
-    {
-        if (errno != EAGAIN)
-        {
-            fprintf(stderr, MOCK "ClientContext::(read/peek fd=%i): filling buffer for %zd bytes: %s\n", sock, maxread, strerror(errno));
+	size_t maxread = CCBUFSIZE - ccinbufsize;
+	ssize_t ret = ::read(sock, ccinbuf + ccinbufsize, maxread);
+
+	if (ret == 0)
+	{
+		// connection closed
+		// nothing is read
+		return 0;
+	}
+
+	if (ret == -1)
+	{
+		if (errno != EAGAIN)
+		{
+			fprintf(stderr, MOCK "ClientContext::(read/peek fd=%i): filling buffer for %zd bytes: %s\n", sock, maxread, strerror(errno));
             // error
-            return -1;
-        }
-        ret = 0;
-    }
+			return -1;
+		}
+		ret = 0;
+	}
 
-    ccinbufsize += ret;
-    return ret;
+	ccinbufsize += ret;
+	return ret;
 }
 
-ssize_t mockPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+ssize_t mockPeekBytes (int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
 {
     // usersize==0: peekAvailable()
 
-    if (usersize > CCBUFSIZE)
-        mockverbose("CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
-
-    struct pollfd p;
-    size_t        retsize = 0;
-    do
-    {
-        if (usersize && usersize <= ccinbufsize)
-        {
-            // data already buffered
-            retsize = usersize;
-            break;
-        }
-
-        // check incoming data data
-        if (mockFillInBuf(sock, ccinbuf, ccinbufsize) < 0)
-        {
-            return -1;
-        }
+	if (usersize > CCBUFSIZE)
+		mockverbose("CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
+
+	struct pollfd p;
+	size_t retsize = 0;
+	do
+	{
+		if (usersize && usersize <= ccinbufsize)
+		{
+			// data already buffered
+			retsize = usersize;
+			break;
+		}
+		
+		// check incoming data data
+		if (mockFillInBuf(sock, ccinbuf, ccinbufsize) < 0)
+		{
+			return -1;
+	    }
 
         if (usersize == 0 && ccinbufsize)
             // peekAvailable
             return ccinbufsize;
 
-        if (usersize <= ccinbufsize)
-        {
-            // data just received
-            retsize = usersize;
-            break;
-        }
-
-        // wait for more data until timeout
-        p.fd     = sock;
-        p.events = POLLIN;
-    } while (poll(&p, 1, timeout_ms) == 1);
-
+		if (usersize <= ccinbufsize)
+		{
+			// data just received
+			retsize = usersize;
+			break;
+		}
+		
+		// wait for more data until timeout
+		p.fd = sock;
+		p.events = POLLIN;
+	} while (poll(&p, 1, timeout_ms) == 1);
+	
     if (dst)
     {
         memcpy(dst, ccinbuf, retsize);
     }
 
-    return retsize;
+	return retsize;
 }
 
-ssize_t mockRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+ssize_t mockRead (int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
 {
-    ssize_t copied = mockPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
-    if (copied < 0)
-        return -1;
-    // swallow (XXX use a circular buffer)
-    memmove(ccinbuf, ccinbuf + copied, ccinbufsize - copied);
-    ccinbufsize -= copied;
-    return copied;
+	ssize_t copied = mockPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
+	if (copied < 0)
+		return -1;
+	// swallow (XXX use a circular buffer)
+	memmove(ccinbuf, ccinbuf + copied, ccinbufsize - copied);
+	ccinbufsize -= copied;
+	return copied;
 }
-
-ssize_t mockWrite(int sock, const uint8_t* data, size_t size, int timeout_ms)
+	
+ssize_t mockWrite (int sock, const uint8_t* data, size_t size, int timeout_ms)
 {
-    size_t sent = 0;
-    while (sent < size)
-    {
-        struct pollfd p;
-        p.fd     = sock;
-        p.events = POLLOUT;
-        int ret  = poll(&p, 1, timeout_ms);
-        if (ret == -1)
-        {
-            fprintf(stderr, MOCK "ClientContext::write(%d): %s\n", sock, strerror(errno));
-            return -1;
-        }
-        if (ret)
-        {
+	size_t sent = 0;
+	while (sent < size)
+	{
+
+		struct pollfd p;
+		p.fd = sock;
+		p.events = POLLOUT;
+		int ret = poll(&p, 1, timeout_ms);
+		if (ret == -1)
+		{
+			fprintf(stderr, MOCK "ClientContext::write(%d): %s\n", sock, strerror(errno));
+			return -1;
+		}
+		if (ret)
+		{
 #ifndef MSG_NOSIGNAL
-            ret = ::write(sock, data + sent, size - sent);
+			ret = ::write(sock, data + sent, size - sent);
 #else
-            ret = ::send(sock, data + sent, size - sent, MSG_NOSIGNAL);
+			ret = ::send(sock, data + sent, size - sent, MSG_NOSIGNAL);
 #endif
-            if (ret == -1)
-            {
-                fprintf(stderr, MOCK "ClientContext::write/send(%d): %s\n", sock, strerror(errno));
-                return -1;
-            }
-            sent += ret;
-            if (sent < size)
-                fprintf(stderr, MOCK "ClientContext::write: sent %d bytes (%zd / %zd)\n", ret, sent, size);
-        }
-    }
+			if (ret == -1)
+			{
+				fprintf(stderr, MOCK "ClientContext::write/send(%d): %s\n", sock, strerror(errno));
+				return -1;
+			}
+			sent += ret;
+			if (sent < size)
+				fprintf(stderr, MOCK "ClientContext::write: sent %d bytes (%zd / %zd)\n", ret, sent, size);
+		}
+	}
 #ifdef DEBUG_ESP_WIFI
     mockverbose(MOCK "ClientContext::write: total sent %zd bytes\n", sent);
 #endif
-    return sent;
+	return sent;
 }
diff --git a/tests/host/common/EEPROM.h b/tests/host/common/EEPROM.h
index dce99c7efd..a1e47546de 100644
--- a/tests/host/common/EEPROM.h
+++ b/tests/host/common/EEPROM.h
@@ -32,47 +32,46 @@
 #ifndef EEPROM_MOCK
 #define EEPROM_MOCK
 
-class EEPROMClass
-{
+class EEPROMClass {
 public:
-    EEPROMClass(uint32_t sector);
-    EEPROMClass(void);
-    ~EEPROMClass();
+  EEPROMClass(uint32_t sector);
+  EEPROMClass(void);
+  ~EEPROMClass();
 
-    void    begin(size_t size);
-    uint8_t read(int address);
-    void    write(int address, uint8_t val);
-    bool    commit();
-    void    end();
+  void begin(size_t size);
+  uint8_t read(int address);
+  void write(int address, uint8_t val);
+  bool commit();
+  void end();
 
-    template <typename T>
-    T& get(int const address, T& t)
-    {
-        if (address < 0 || address + sizeof(T) > _size)
-            return t;
-        for (size_t i = 0; i < sizeof(T); i++)
-            ((uint8_t*)&t)[i] = read(i);
-        return t;
-    }
+  template<typename T> 
+  T& get(int const address, T& t)
+  {
+    if (address < 0 || address + sizeof(T) > _size)
+      return t;
+    for (size_t i = 0; i < sizeof(T); i++)
+        ((uint8_t*)&t)[i] = read(i);
+    return t;
+  }
 
-    template <typename T>
-    const T& put(int const address, const T& t)
-    {
-        if (address < 0 || address + sizeof(T) > _size)
-            return t;
-        for (size_t i = 0; i < sizeof(T); i++)
-            write(i, ((uint8_t*)&t)[i]);
-        return t;
-    }
+  template<typename T> 
+  const T& put(int const address, const T& t)
+  {
+    if (address < 0 || address + sizeof(T) > _size)
+      return t;
+    for (size_t i = 0; i < sizeof(T); i++)
+        write(i, ((uint8_t*)&t)[i]);
+    return t;
+  }
 
-    size_t length() { return _size; }
+  size_t length() { return _size; }
 
-    //uint8_t& operator[](int const address) { return read(address); }
-    uint8_t operator[](int address) { return read(address); }
+  //uint8_t& operator[](int const address) { return read(address); }
+  uint8_t operator[] (int address) { return read(address); }
 
 protected:
-    size_t _size = 0;
-    int    _fd   = -1;
+  size_t _size = 0;
+  int _fd = -1;
 };
 
 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_EEPROM)
diff --git a/tests/host/common/HostWiring.cpp b/tests/host/common/HostWiring.cpp
index 638457762e..765d4297b6 100644
--- a/tests/host/common/HostWiring.cpp
+++ b/tests/host/common/HostWiring.cpp
@@ -37,67 +37,49 @@
 #define VERBOSE(x...) mockverbose(x)
 #endif
 
-void pinMode(uint8_t pin, uint8_t mode)
+void pinMode (uint8_t pin, uint8_t mode)
 {
-#define xxx(mode)            \
-    case mode:               \
-        m = STRHELPER(mode); \
-        break
-    const char* m;
-    switch (mode)
-    {
-    case INPUT:
-        m = "INPUT";
-        break;
-    case OUTPUT:
-        m = "OUTPUT";
-        break;
-    case INPUT_PULLUP:
-        m = "INPUT_PULLUP";
-        break;
-    case OUTPUT_OPEN_DRAIN:
-        m = "OUTPUT_OPEN_DRAIN";
-        break;
-    case INPUT_PULLDOWN_16:
-        m = "INPUT_PULLDOWN_16";
-        break;
-    case WAKEUP_PULLUP:
-        m = "WAKEUP_PULLUP";
-        break;
-    case WAKEUP_PULLDOWN:
-        m = "WAKEUP_PULLDOWN";
-        break;
-    default:
-        m = "(special)";
-    }
-    VERBOSE("gpio%d: mode='%s'\n", pin, m);
+	#define xxx(mode) case mode: m=STRHELPER(mode); break
+	const char* m;
+	switch (mode)
+	{
+	case INPUT: m="INPUT"; break;
+	case OUTPUT: m="OUTPUT"; break;
+	case INPUT_PULLUP: m="INPUT_PULLUP"; break;
+	case OUTPUT_OPEN_DRAIN: m="OUTPUT_OPEN_DRAIN"; break;
+	case INPUT_PULLDOWN_16: m="INPUT_PULLDOWN_16"; break;
+	case WAKEUP_PULLUP: m="WAKEUP_PULLUP"; break;
+	case WAKEUP_PULLDOWN: m="WAKEUP_PULLDOWN"; break;
+	default: m="(special)";
+	}
+	VERBOSE("gpio%d: mode='%s'\n", pin, m);
 }
 
 void digitalWrite(uint8_t pin, uint8_t val)
 {
-    VERBOSE("digitalWrite(pin=%d val=%d)\n", pin, val);
+	VERBOSE("digitalWrite(pin=%d val=%d)\n", pin, val);
 }
 
 void analogWrite(uint8_t pin, int val)
 {
-    VERBOSE("analogWrite(pin=%d, val=%d\n", pin, val);
+	VERBOSE("analogWrite(pin=%d, val=%d\n", pin, val);
 }
 
 int analogRead(uint8_t pin)
 {
-    (void)pin;
-    return 512;
+	(void)pin;
+	return 512;
 }
 
 void analogWriteRange(uint32_t range)
 {
-    VERBOSE("analogWriteRange(range=%d)\n", range);
+	VERBOSE("analogWriteRange(range=%d)\n", range);
 }
 
 int digitalRead(uint8_t pin)
 {
-    VERBOSE("digitalRead(%d)\n", pin);
+	VERBOSE("digitalRead(%d)\n", pin);
 
-    // pin 0 is most likely a low active input
-    return pin ? 0 : 1;
+	// pin 0 is most likely a low active input
+	return pin ? 0 : 1;
 }
diff --git a/tests/host/common/MockEEPROM.cpp b/tests/host/common/MockEEPROM.cpp
index f9a7ca2db5..6357c73dd2 100644
--- a/tests/host/common/MockEEPROM.cpp
+++ b/tests/host/common/MockEEPROM.cpp
@@ -42,52 +42,52 @@
 
 #define EEPROM_FILE_NAME "eeprom"
 
-EEPROMClass::EEPROMClass()
+EEPROMClass::EEPROMClass ()
 {
 }
 
-EEPROMClass::~EEPROMClass()
+EEPROMClass::~EEPROMClass ()
 {
-    if (_fd >= 0)
-        close(_fd);
+	if (_fd >= 0)
+		close(_fd);
 }
 
 void EEPROMClass::begin(size_t size)
 {
-    _size = size;
-    if ((_fd = open(EEPROM_FILE_NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1
-        || ftruncate(_fd, size) == -1)
-    {
-        fprintf(stderr, MOCK "EEPROM: cannot open/create '%s' for r/w: %s\n\r", EEPROM_FILE_NAME, strerror(errno));
-        _fd = -1;
-    }
+	_size = size;
+	if (   (_fd = open(EEPROM_FILE_NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1
+	    || ftruncate(_fd, size) == -1)
+	{
+		fprintf(stderr, MOCK "EEPROM: cannot open/create '%s' for r/w: %s\n\r", EEPROM_FILE_NAME, strerror(errno));
+		_fd = -1;
+	}
 }
 
 void EEPROMClass::end()
 {
-    if (_fd != -1)
-        close(_fd);
+	if (_fd != -1)
+		close(_fd);
 }
 
 bool EEPROMClass::commit()
 {
-    return true;
+	return true;
 }
 
-uint8_t EEPROMClass::read(int x)
+uint8_t EEPROMClass::read (int x)
 {
-    char c = 0;
-    if (pread(_fd, &c, 1, x) != 1)
-        fprintf(stderr, MOCK "eeprom: %s\n\r", strerror(errno));
-    return c;
+	char c = 0;
+	if (pread(_fd, &c, 1, x) != 1)
+		fprintf(stderr, MOCK "eeprom: %s\n\r", strerror(errno));
+	return c;
 }
 
-void EEPROMClass::write(int x, uint8_t c)
+void EEPROMClass::write (int x, uint8_t c)
 {
-    if (x > (int)_size)
-        fprintf(stderr, MOCK "### eeprom beyond\r\n");
-    else if (pwrite(_fd, &c, 1, x) != 1)
-        fprintf(stderr, MOCK "eeprom: %s\n\r", strerror(errno));
+	if (x > (int)_size)
+		fprintf(stderr, MOCK "### eeprom beyond\r\n");
+	else if (pwrite(_fd, &c, 1, x) != 1)
+		fprintf(stderr, MOCK "eeprom: %s\n\r", strerror(errno));
 }
 
 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_EEPROM)
diff --git a/tests/host/common/MockEsp.cpp b/tests/host/common/MockEsp.cpp
index 6db348af55..d11a39e940 100644
--- a/tests/host/common/MockEsp.cpp
+++ b/tests/host/common/MockEsp.cpp
@@ -36,210 +36,195 @@
 
 #include <stdlib.h>
 
-unsigned long long operator"" _kHz(unsigned long long x)
-{
+unsigned long long operator"" _kHz(unsigned long long x) {
     return x * 1000;
 }
 
-unsigned long long operator"" _MHz(unsigned long long x)
-{
+unsigned long long operator"" _MHz(unsigned long long x) {
     return x * 1000 * 1000;
 }
 
-unsigned long long operator"" _GHz(unsigned long long x)
-{
+unsigned long long operator"" _GHz(unsigned long long x) {
     return x * 1000 * 1000 * 1000;
 }
 
-unsigned long long operator"" _kBit(unsigned long long x)
-{
+unsigned long long operator"" _kBit(unsigned long long x) {
     return x * 1024;
 }
 
-unsigned long long operator"" _MBit(unsigned long long x)
-{
+unsigned long long operator"" _MBit(unsigned long long x) {
     return x * 1024 * 1024;
 }
 
-unsigned long long operator"" _GBit(unsigned long long x)
-{
+unsigned long long operator"" _GBit(unsigned long long x) {
     return x * 1024 * 1024 * 1024;
 }
 
-unsigned long long operator"" _kB(unsigned long long x)
-{
+unsigned long long operator"" _kB(unsigned long long x) {
     return x * 1024;
 }
 
-unsigned long long operator"" _MB(unsigned long long x)
-{
+unsigned long long operator"" _MB(unsigned long long x) {
     return x * 1024 * 1024;
 }
 
-unsigned long long operator"" _GB(unsigned long long x)
-{
+unsigned long long operator"" _GB(unsigned long long x) {
     return x * 1024 * 1024 * 1024;
 }
 
 uint32_t _SPIFFS_start;
 
-void eboot_command_write(struct eboot_command* cmd)
+void eboot_command_write (struct eboot_command* cmd)
 {
-    (void)cmd;
+	(void)cmd;
 }
 
 EspClass ESP;
 
-void EspClass::restart()
+void EspClass::restart ()
 {
-    mockverbose("Esp.restart(): exiting\n");
-    exit(EXIT_SUCCESS);
+	mockverbose("Esp.restart(): exiting\n");
+	exit(EXIT_SUCCESS);
 }
 
 uint32_t EspClass::getChipId()
 {
-    return 0xee1337;
+	return 0xee1337;
 }
 
 bool EspClass::checkFlashConfig(bool needsEquals)
 {
-    (void)needsEquals;
-    return true;
+	(void) needsEquals;
+	return true;
 }
 
 uint32_t EspClass::getSketchSize()
 {
-    return 400000;
+	return 400000;
 }
 
 uint32_t EspClass::getFreeHeap()
 {
-    return 30000;
+	return 30000;
 }
 
 uint32_t EspClass::getMaxFreeBlockSize()
 {
-    return 20000;
+	return 20000;
 }
 
 String EspClass::getResetReason()
 {
-    return "Power on";
+  return "Power on";
 }
 
 uint32_t EspClass::getFreeSketchSpace()
 {
-    return 4 * 1024 * 1024;
+  return 4 * 1024 * 1024;
 }
 
-const char* EspClass::getSdkVersion()
+const char *EspClass::getSdkVersion()
 {
-    return "2.5.0";
+  return "2.5.0";
 }
 
 uint32_t EspClass::getFlashChipSpeed()
 {
-    return 40;
+  return 40;
 }
 
-void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag)
-{
-    uint32_t hf = 10 * 1024;
-    float    hm = 1 * 1024;
+void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag) {
+  uint32_t hf = 10 * 1024;
+  float hm = 1 * 1024;
 
-    if (hfree)
-        *hfree = hf;
-    if (hmax)
-        *hmax = hm;
-    if (hfrag)
-        *hfrag = 100 - (sqrt(hm) * 100) / hf;
+  if (hfree) *hfree = hf;
+  if (hmax) *hmax = hm;
+  if (hfrag) *hfrag = 100 - (sqrt(hm) * 100) / hf;
 }
 
 bool EspClass::flashEraseSector(uint32_t sector)
 {
-    (void)sector;
-    return true;
+	(void) sector;
+	return true;
 }
 
 FlashMode_t EspClass::getFlashChipMode()
 {
-    return FM_DOUT;
+	return FM_DOUT;
 }
 
 FlashMode_t EspClass::magicFlashChipMode(uint8_t byte)
 {
-    (void)byte;
-    return FM_DOUT;
+	(void) byte;
+	return FM_DOUT;
 }
 
-bool EspClass::flashWrite(uint32_t offset, const uint32_t* data, size_t size)
+bool EspClass::flashWrite(uint32_t offset, const uint32_t *data, size_t size)
 {
-    (void)offset;
-    (void)data;
-    (void)size;
-    return true;
+	(void)offset;
+	(void)data;
+	(void)size;
+	return true;
 }
 
-bool EspClass::flashWrite(uint32_t offset, const uint8_t* data, size_t size)
+bool EspClass::flashWrite(uint32_t offset, const uint8_t *data, size_t size)
 {
-    (void)offset;
-    (void)data;
-    (void)size;
-    return true;
+	(void)offset;
+	(void)data;
+	(void)size;
+	return true;
 }
 
-bool EspClass::flashRead(uint32_t offset, uint32_t* data, size_t size)
+bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size)
 {
-    (void)offset;
-    (void)data;
-    (void)size;
-    return true;
+	(void)offset;
+	(void)data;
+	(void)size;
+	return true;
 }
 
-bool EspClass::flashRead(uint32_t offset, uint8_t* data, size_t size)
+bool EspClass::flashRead(uint32_t offset, uint8_t *data, size_t size)
 {
-    (void)offset;
-    (void)data;
-    (void)size;
-    return true;
+	(void)offset;
+	(void)data;
+	(void)size;
+	return true;
 }
 
-uint32_t EspClass::magicFlashChipSize(uint8_t byte)
-{
-    switch (byte & 0x0F)
-    {
-    case 0x0:  // 4 Mbit (512KB)
-        return (512_kB);
-    case 0x1:  // 2 MBit (256KB)
-        return (256_kB);
-    case 0x2:  // 8 MBit (1MB)
-        return (1_MB);
-    case 0x3:  // 16 MBit (2MB)
-        return (2_MB);
-    case 0x4:  // 32 MBit (4MB)
-        return (4_MB);
-    case 0x8:  // 64 MBit (8MB)
-        return (8_MB);
-    case 0x9:  // 128 MBit (16MB)
-        return (16_MB);
-    default:  // fail?
-        return 0;
+uint32_t EspClass::magicFlashChipSize(uint8_t byte) {
+    switch(byte & 0x0F) {
+        case 0x0: // 4 Mbit (512KB)
+            return (512_kB);
+        case 0x1: // 2 MBit (256KB)
+            return (256_kB);
+        case 0x2: // 8 MBit (1MB)
+            return (1_MB);
+        case 0x3: // 16 MBit (2MB)
+            return (2_MB);
+        case 0x4: // 32 MBit (4MB)
+            return (4_MB);
+        case 0x8: // 64 MBit (8MB)
+            return (8_MB);
+        case 0x9: // 128 MBit (16MB)
+            return (16_MB);
+        default: // fail?
+            return 0;
     }
 }
 
 uint32_t EspClass::getFlashChipRealSize(void)
 {
-    return magicFlashChipSize(4);
+	return magicFlashChipSize(4);
 }
 
 uint32_t EspClass::getFlashChipSize(void)
 {
-    return magicFlashChipSize(4);
+	return magicFlashChipSize(4);
 }
 
-String EspClass::getFullVersion()
+String EspClass::getFullVersion ()
 {
-    return "emulation-on-host";
+	return "emulation-on-host";
 }
 
 uint32_t EspClass::getFreeContStack()
diff --git a/tests/host/common/MockSPI.cpp b/tests/host/common/MockSPI.cpp
index 629970f436..251cad914a 100644
--- a/tests/host/common/MockSPI.cpp
+++ b/tests/host/common/MockSPI.cpp
@@ -35,13 +35,13 @@
 SPIClass SPI;
 #endif
 
-SPIClass::SPIClass()
+SPIClass::SPIClass ()
 {
 }
 
 uint8_t SPIClass::transfer(uint8_t data)
 {
-    return data;
+	return data;
 }
 
 void SPIClass::begin()
@@ -54,10 +54,10 @@ void SPIClass::end()
 
 void SPIClass::setFrequency(uint32_t freq)
 {
-    (void)freq;
+	(void)freq;
 }
 
 void SPIClass::setHwCs(bool use)
 {
-    (void)use;
+	(void)use;
 }
diff --git a/tests/host/common/MockTools.cpp b/tests/host/common/MockTools.cpp
index c1fbb2ae16..5eb7969de7 100644
--- a/tests/host/common/MockTools.cpp
+++ b/tests/host/common/MockTools.cpp
@@ -34,45 +34,47 @@
 
 extern "C"
 {
-    uint32_t lwip_htonl(uint32_t hostlong) { return htonl(hostlong); }
-    uint16_t lwip_htons(uint16_t hostshort) { return htons(hostshort); }
-    uint32_t lwip_ntohl(uint32_t netlong) { return ntohl(netlong); }
-    uint16_t lwip_ntohs(uint16_t netshort) { return ntohs(netshort); }
 
-    char*  ets_strcpy(char* d, const char* s) { return strcpy(d, s); }
-    char*  ets_strncpy(char* d, const char* s, size_t n) { return strncpy(d, s, n); }
-    size_t ets_strlen(const char* s) { return strlen(s); }
+uint32_t lwip_htonl (uint32_t hostlong)  { return htonl(hostlong);  }
+uint16_t lwip_htons (uint16_t hostshort) { return htons(hostshort); }
+uint32_t lwip_ntohl (uint32_t netlong)   { return ntohl(netlong);   }
+uint16_t lwip_ntohs (uint16_t netshort)  { return ntohs(netshort);  }
 
-    int ets_printf(const char* fmt, ...)
-    {
+char* ets_strcpy (char* d, const char* s) { return strcpy(d, s); }
+char* ets_strncpy (char* d, const char* s, size_t n) { return strncpy(d, s, n); }
+size_t ets_strlen (const char* s) { return strlen(s); }
+
+int ets_printf (const char* fmt, ...)
+{
         va_list ap;
         va_start(ap, fmt);
-        int len = vprintf(fmt, ap);
-        va_end(ap);
-        return len;
-    }
-
-    void stack_thunk_add_ref() { }
-    void stack_thunk_del_ref() { }
-    void stack_thunk_repaint() { }
-
-    uint32_t stack_thunk_get_refcnt() { return 0; }
-    uint32_t stack_thunk_get_stack_top() { return 0; }
-    uint32_t stack_thunk_get_stack_bot() { return 0; }
-    uint32_t stack_thunk_get_cont_sp() { return 0; }
-    uint32_t stack_thunk_get_max_usage() { return 0; }
-    void     stack_thunk_dump_stack() { }
+	int len = vprintf(fmt, ap);
+	va_end(ap);
+	return len;
+}
+
+void stack_thunk_add_ref() { }
+void stack_thunk_del_ref() { }
+void stack_thunk_repaint() { }
+
+uint32_t stack_thunk_get_refcnt() { return 0; }
+uint32_t stack_thunk_get_stack_top() { return 0; }
+uint32_t stack_thunk_get_stack_bot() { return 0; }
+uint32_t stack_thunk_get_cont_sp() { return 0; }
+uint32_t stack_thunk_get_max_usage() { return 0; }
+void stack_thunk_dump_stack() { }
 
 // Thunking macro
 #define make_stack_thunk(fcnToThunk)
+
 };
 
 void configTime(int timezone, int daylightOffset_sec,
-                const char* server1, const char* server2, const char* server3)
+                           const char* server1, const char* server2, const char* server3)
 {
-    (void)server1;
-    (void)server2;
-    (void)server3;
+	(void)server1;
+	(void)server2;
+	(void)server3;
 
-    mockverbose("configTime: TODO (tz=%dH offset=%dS) (time will be host's)\n", timezone, daylightOffset_sec);
+	mockverbose("configTime: TODO (tz=%dH offset=%dS) (time will be host's)\n", timezone, daylightOffset_sec);
 }
diff --git a/tests/host/common/MockUART.cpp b/tests/host/common/MockUART.cpp
index 12e4599c75..dc6514ae40 100644
--- a/tests/host/common/MockUART.cpp
+++ b/tests/host/common/MockUART.cpp
@@ -28,476 +28,475 @@
  is responsible for feeding the RX FIFO new data by calling uart_new_data().
  */
 
-#include <unistd.h>    // write
-#include <sys/time.h>  // gettimeofday
-#include <time.h>      // localtime
+#include <unistd.h> // write
+#include <sys/time.h> // gettimeofday
+#include <time.h> // localtime
 
 #include "Arduino.h"
 #include "uart.h"
 
 //#define UART_DISCARD_NEWEST
 
-extern "C"
-{
-    bool blocking_uart = true;  // system default
+extern "C" {
 
-    static int s_uart_debug_nr = UART1;
+bool blocking_uart = true; // system default
 
-    static uart_t* UART[2] = { NULL, NULL };
+static int s_uart_debug_nr = UART1;
 
-    struct uart_rx_buffer_
-    {
-        size_t   size;
-        size_t   rpos;
-        size_t   wpos;
-        uint8_t* buffer;
-    };
+static uart_t *UART[2] = { NULL, NULL };
 
-    struct uart_
-    {
-        int                     uart_nr;
-        int                     baud_rate;
-        bool                    rx_enabled;
-        bool                    tx_enabled;
-        bool                    rx_overrun;
-        struct uart_rx_buffer_* rx_buffer;
-    };
-
-    bool serial_timestamp = false;
-
-    // write one byte to the emulated UART
-    static void
-    uart_do_write_char(const int uart_nr, char c)
-    {
-        static bool w = false;
-
-        if (uart_nr >= UART0 && uart_nr <= UART1)
-        {
-            if (serial_timestamp && (c == '\n' || c == '\r'))
-            {
-                if (w)
-                {
-                    FILE*   out = uart_nr == UART0 ? stdout : stderr;
-                    timeval tv;
-                    gettimeofday(&tv, nullptr);
-                    const tm* tm = localtime(&tv.tv_sec);
-                    fprintf(out, "\r\n%d:%02d:%02d.%06d: ", tm->tm_hour, tm->tm_min, tm->tm_sec, (int)tv.tv_usec);
-                    fflush(out);
-                    w = false;
-                }
-            }
-            else
-            {
+struct uart_rx_buffer_
+{
+	size_t size;
+	size_t rpos;
+	size_t wpos;
+	uint8_t * buffer;
+};
+
+struct uart_
+{
+	int uart_nr;
+	int baud_rate;
+	bool rx_enabled;
+	bool tx_enabled;
+	bool rx_overrun;
+	struct uart_rx_buffer_ * rx_buffer;
+};
+
+bool serial_timestamp = false;
+
+// write one byte to the emulated UART
+static void
+uart_do_write_char(const int uart_nr, char c)
+{
+	static bool w = false;
+
+	if (uart_nr >= UART0 && uart_nr <= UART1)
+	{
+		if (serial_timestamp && (c == '\n' || c == '\r'))
+		{
+			if (w)
+			{
+				FILE* out = uart_nr == UART0? stdout: stderr;
+				timeval tv;
+				gettimeofday(&tv, nullptr);
+				const tm* tm = localtime(&tv.tv_sec);
+				fprintf(out, "\r\n%d:%02d:%02d.%06d: ", tm->tm_hour, tm->tm_min, tm->tm_sec, (int)tv.tv_usec);
+				fflush(out);
+				w = false;
+			}
+		}
+		else
+		{
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunused-result"
-                write(uart_nr + 1, &c, 1);
+			write(uart_nr + 1, &c, 1);
 #pragma GCC diagnostic pop
-                w = true;
-            }
-        }
-    }
+			w = true;
+		}
+	}
+}
 
-    // write a new byte into the RX FIFO buffer
-    static void
-    uart_handle_data(uart_t* uart, uint8_t data)
-    {
-        struct uart_rx_buffer_* rx_buffer = uart->rx_buffer;
+// write a new byte into the RX FIFO buffer
+static void
+uart_handle_data(uart_t* uart, uint8_t data)
+{
+	struct uart_rx_buffer_ *rx_buffer = uart->rx_buffer;
 
-        size_t nextPos = (rx_buffer->wpos + 1) % rx_buffer->size;
-        if (nextPos == rx_buffer->rpos)
-        {
-            uart->rx_overrun = true;
+	size_t nextPos = (rx_buffer->wpos + 1) % rx_buffer->size;
+	if(nextPos == rx_buffer->rpos)
+	{
+		uart->rx_overrun = true;
 #ifdef UART_DISCARD_NEWEST
-            return;
+		return;
 #else
-            if (++rx_buffer->rpos == rx_buffer->size)
-                rx_buffer->rpos = 0;
+		if (++rx_buffer->rpos == rx_buffer->size)
+			rx_buffer->rpos = 0;
 #endif
-        }
-        rx_buffer->buffer[rx_buffer->wpos] = data;
-        rx_buffer->wpos                    = nextPos;
-    }
-
-    // insert a new byte into the RX FIFO nuffer
-    void
-    uart_new_data(const int uart_nr, uint8_t data)
-    {
-        uart_t* uart = UART[uart_nr];
+	}
+	rx_buffer->buffer[rx_buffer->wpos] = data;
+	rx_buffer->wpos = nextPos;
+}
 
-        if (uart == NULL || !uart->rx_enabled)
-        {
-            return;
-        }
+// insert a new byte into the RX FIFO nuffer
+void
+uart_new_data(const int uart_nr, uint8_t data)
+{
+	uart_t* uart = UART[uart_nr];
 
-        uart_handle_data(uart, data);
-    }
+	if(uart == NULL || !uart->rx_enabled) {
+		return;
+	}
 
-    static size_t
-    uart_rx_available_unsafe(const struct uart_rx_buffer_* rx_buffer)
-    {
-        size_t ret = rx_buffer->wpos - rx_buffer->rpos;
+	uart_handle_data(uart, data);
+}
 
-        if (rx_buffer->wpos < rx_buffer->rpos)
-            ret = (rx_buffer->wpos + rx_buffer->size) - rx_buffer->rpos;
+static size_t
+uart_rx_available_unsafe(const struct uart_rx_buffer_ * rx_buffer)
+{
+	size_t ret = rx_buffer->wpos - rx_buffer->rpos;
 
-        return ret;
-    }
+	if(rx_buffer->wpos < rx_buffer->rpos)
+		ret = (rx_buffer->wpos + rx_buffer->size) - rx_buffer->rpos;
 
-    // taking data straight from fifo, only needed in uart_resize_rx_buffer()
-    static int
-    uart_read_char_unsafe(uart_t* uart)
-    {
-        if (uart_rx_available_unsafe(uart->rx_buffer))
-        {
-            // take oldest sw data
-            int ret               = uart->rx_buffer->buffer[uart->rx_buffer->rpos];
-            uart->rx_buffer->rpos = (uart->rx_buffer->rpos + 1) % uart->rx_buffer->size;
-            return ret;
-        }
-        // unavailable
-        return -1;
-    }
+	return ret;
+}
 
-    /**********************************************************/
-    /************ UART API FUNCTIONS **************************/
-    /**********************************************************/
+// taking data straight from fifo, only needed in uart_resize_rx_buffer()
+static int
+uart_read_char_unsafe(uart_t* uart)
+{
+	if (uart_rx_available_unsafe(uart->rx_buffer))
+	{
+		// take oldest sw data
+		int ret = uart->rx_buffer->buffer[uart->rx_buffer->rpos];
+		uart->rx_buffer->rpos = (uart->rx_buffer->rpos + 1) % uart->rx_buffer->size;
+		return ret;
+	}
+	// unavailable
+	return -1;
+}
 
-    size_t
-    uart_rx_available(uart_t* uart)
-    {
-        if (uart == NULL || !uart->rx_enabled)
-            return 0;
+/**********************************************************/
+/************ UART API FUNCTIONS **************************/
+/**********************************************************/
 
-        return uart_rx_available_unsafe(uart->rx_buffer);
-    }
+size_t
+uart_rx_available(uart_t* uart)
+{
+	if(uart == NULL || !uart->rx_enabled)
+		return 0;
 
-    int
-    uart_peek_char(uart_t* uart)
-    {
-        if (uart == NULL || !uart->rx_enabled)
-            return -1;
+	return uart_rx_available_unsafe(uart->rx_buffer);
+}
 
-        if (!uart_rx_available_unsafe(uart->rx_buffer))
-            return -1;
+int
+uart_peek_char(uart_t* uart)
+{
+	if(uart == NULL || !uart->rx_enabled)
+		return -1;
 
-        return uart->rx_buffer->buffer[uart->rx_buffer->rpos];
-    }
+	if (!uart_rx_available_unsafe(uart->rx_buffer))
+		return -1;
 
-    int
-    uart_read_char(uart_t* uart)
-    {
-        uint8_t ret;
-        return uart_read(uart, (char*)&ret, 1) ? ret : -1;
-    }
+	return uart->rx_buffer->buffer[uart->rx_buffer->rpos];
+}
 
-    size_t
-    uart_read(uart_t* uart, char* userbuffer, size_t usersize)
-    {
-        if (uart == NULL || !uart->rx_enabled)
-            return 0;
-
-        if (!blocking_uart)
-        {
-            char c;
-            if (read(0, &c, 1) == 1)
-                uart_new_data(0, c);
-        }
-
-        size_t ret = 0;
-        while (ret < usersize && uart_rx_available_unsafe(uart->rx_buffer))
-        {
-            // pour sw buffer to user's buffer
-            // get largest linear length from sw buffer
-            size_t chunk = uart->rx_buffer->rpos < uart->rx_buffer->wpos ? uart->rx_buffer->wpos - uart->rx_buffer->rpos : uart->rx_buffer->size - uart->rx_buffer->rpos;
-            if (ret + chunk > usersize)
-                chunk = usersize - ret;
-            memcpy(userbuffer + ret, uart->rx_buffer->buffer + uart->rx_buffer->rpos, chunk);
-            uart->rx_buffer->rpos = (uart->rx_buffer->rpos + chunk) % uart->rx_buffer->size;
-            ret += chunk;
-        }
-        return ret;
-    }
+int
+uart_read_char(uart_t* uart)
+{
+	uint8_t ret;
+	return uart_read(uart, (char*)&ret, 1) ? ret : -1;
+}
 
-    size_t
-    uart_resize_rx_buffer(uart_t* uart, size_t new_size)
-    {
-        if (uart == NULL || !uart->rx_enabled)
-            return 0;
-
-        if (uart->rx_buffer->size == new_size)
-            return uart->rx_buffer->size;
-
-        uint8_t* new_buf = (uint8_t*)malloc(new_size);
-        if (!new_buf)
-            return uart->rx_buffer->size;
-
-        size_t new_wpos = 0;
-        // if uart_rx_available_unsafe() returns non-0, uart_read_char_unsafe() can't return -1
-        while (uart_rx_available_unsafe(uart->rx_buffer) && new_wpos < new_size)
-            new_buf[new_wpos++] = uart_read_char_unsafe(uart);
-        if (new_wpos == new_size)
-            new_wpos = 0;
-
-        uint8_t* old_buf        = uart->rx_buffer->buffer;
-        uart->rx_buffer->rpos   = 0;
-        uart->rx_buffer->wpos   = new_wpos;
-        uart->rx_buffer->size   = new_size;
-        uart->rx_buffer->buffer = new_buf;
-        free(old_buf);
-        return uart->rx_buffer->size;
-    }
+size_t
+uart_read(uart_t* uart, char* userbuffer, size_t usersize)
+{
+	if(uart == NULL || !uart->rx_enabled)
+		return 0;
+
+    if (!blocking_uart)
+    {
+        char c;
+        if (read(0, &c, 1) == 1)
+            uart_new_data(0, c);
+    }
+
+	size_t ret = 0;
+	while (ret < usersize && uart_rx_available_unsafe(uart->rx_buffer))
+	{
+		// pour sw buffer to user's buffer
+		// get largest linear length from sw buffer
+		size_t chunk = uart->rx_buffer->rpos < uart->rx_buffer->wpos ?
+		               uart->rx_buffer->wpos - uart->rx_buffer->rpos :
+		               uart->rx_buffer->size - uart->rx_buffer->rpos;
+		if (ret + chunk > usersize)
+			chunk = usersize - ret;
+		memcpy(userbuffer + ret, uart->rx_buffer->buffer + uart->rx_buffer->rpos, chunk);
+		uart->rx_buffer->rpos = (uart->rx_buffer->rpos + chunk) % uart->rx_buffer->size;
+		ret += chunk;
+	}
+	return ret;
+}
 
-    size_t
-    uart_get_rx_buffer_size(uart_t* uart)
-    {
-        return uart && uart->rx_enabled ? uart->rx_buffer->size : 0;
-    }
+size_t
+uart_resize_rx_buffer(uart_t* uart, size_t new_size)
+{
+	if(uart == NULL || !uart->rx_enabled)
+		return 0;
+
+	if(uart->rx_buffer->size == new_size)
+		return uart->rx_buffer->size;
+
+	uint8_t * new_buf = (uint8_t*)malloc(new_size);
+	if(!new_buf)
+		return uart->rx_buffer->size;
+
+	size_t new_wpos = 0;
+	// if uart_rx_available_unsafe() returns non-0, uart_read_char_unsafe() can't return -1
+	while(uart_rx_available_unsafe(uart->rx_buffer) && new_wpos < new_size)
+		new_buf[new_wpos++] = uart_read_char_unsafe(uart);
+	if (new_wpos == new_size)
+		new_wpos = 0;
+
+	uint8_t * old_buf = uart->rx_buffer->buffer;
+	uart->rx_buffer->rpos = 0;
+	uart->rx_buffer->wpos = new_wpos;
+	uart->rx_buffer->size = new_size;
+	uart->rx_buffer->buffer = new_buf;
+	free(old_buf);
+	return uart->rx_buffer->size;
+}
 
-    size_t
-    uart_write_char(uart_t* uart, char c)
-    {
-        if (uart == NULL || !uart->tx_enabled)
-            return 0;
+size_t
+uart_get_rx_buffer_size(uart_t* uart)
+{
+	return uart && uart->rx_enabled ? uart->rx_buffer->size : 0;
+}
 
-        uart_do_write_char(uart->uart_nr, c);
+size_t
+uart_write_char(uart_t* uart, char c)
+{
+	if(uart == NULL || !uart->tx_enabled)
+		return 0;
 
-        return 1;
-    }
+	uart_do_write_char(uart->uart_nr, c);
 
-    size_t
-    uart_write(uart_t* uart, const char* buf, size_t size)
-    {
-        if (uart == NULL || !uart->tx_enabled)
-            return 0;
+	return 1;
+}
 
-        size_t    ret     = size;
-        const int uart_nr = uart->uart_nr;
-        while (size--)
-            uart_do_write_char(uart_nr, *buf++);
+size_t
+uart_write(uart_t* uart, const char* buf, size_t size)
+{
+	if(uart == NULL || !uart->tx_enabled)
+		return 0;
 
-        return ret;
-    }
+	size_t ret = size;
+	const int uart_nr = uart->uart_nr;
+	while (size--)
+		uart_do_write_char(uart_nr, *buf++);
 
-    size_t
-    uart_tx_free(uart_t* uart)
-    {
-        if (uart == NULL || !uart->tx_enabled)
-            return 0;
+	return ret;
+}
 
-        return UART_TX_FIFO_SIZE;
-    }
+size_t
+uart_tx_free(uart_t* uart)
+{
+	if(uart == NULL || !uart->tx_enabled)
+		return 0;
 
-    void
-    uart_wait_tx_empty(uart_t* uart)
-    {
-        (void)uart;
-    }
+	return UART_TX_FIFO_SIZE;
+}
 
-    void
-    uart_flush(uart_t* uart)
-    {
-        if (uart == NULL)
-            return;
-
-        if (uart->rx_enabled)
-        {
-            uart->rx_buffer->rpos = 0;
-            uart->rx_buffer->wpos = 0;
-        }
-    }
+void
+uart_wait_tx_empty(uart_t* uart)
+{
+	(void) uart;
+}
 
-    void
-    uart_set_baudrate(uart_t* uart, int baud_rate)
-    {
-        if (uart == NULL)
-            return;
+void
+uart_flush(uart_t* uart)
+{
+	if(uart == NULL)
+		return;
+
+	if(uart->rx_enabled)
+	{
+		uart->rx_buffer->rpos = 0;
+		uart->rx_buffer->wpos = 0;
+	}
+}
 
-        uart->baud_rate = baud_rate;
-    }
+void
+uart_set_baudrate(uart_t* uart, int baud_rate)
+{
+	if(uart == NULL)
+		return;
 
-    int
-    uart_get_baudrate(uart_t* uart)
-    {
-        if (uart == NULL)
-            return 0;
+	uart->baud_rate = baud_rate;
+}
 
-        return uart->baud_rate;
-    }
+int
+uart_get_baudrate(uart_t* uart)
+{
+	if(uart == NULL)
+		return 0;
 
-    uint8_t
-    uart_get_bit_length(const int uart_nr)
-    {
-        uint8_t width  = ((uart_nr % 16) >> 2) + 5;
-        uint8_t parity = (uart_nr >> 5) + 1;
-        uint8_t stop   = uart_nr % 4;
-        return (width + parity + stop + 1);
-    }
+	return uart->baud_rate;
+}
 
-    uart_t*
-    uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, size_t rx_size, bool invert)
-    {
-        (void)config;
-        (void)tx_pin;
-        (void)invert;
-        uart_t* uart = (uart_t*)malloc(sizeof(uart_t));
-        if (uart == NULL)
-            return NULL;
-
-        uart->uart_nr    = uart_nr;
-        uart->rx_overrun = false;
-
-        switch (uart->uart_nr)
-        {
-        case UART0:
-            uart->rx_enabled = (mode != UART_TX_ONLY);
-            uart->tx_enabled = (mode != UART_RX_ONLY);
-            if (uart->rx_enabled)
-            {
-                struct uart_rx_buffer_* rx_buffer = (struct uart_rx_buffer_*)malloc(sizeof(struct uart_rx_buffer_));
-                if (rx_buffer == NULL)
-                {
-                    free(uart);
-                    return NULL;
-                }
-                rx_buffer->size   = rx_size;  //var this
-                rx_buffer->rpos   = 0;
-                rx_buffer->wpos   = 0;
-                rx_buffer->buffer = (uint8_t*)malloc(rx_buffer->size);
-                if (rx_buffer->buffer == NULL)
-                {
-                    free(rx_buffer);
-                    free(uart);
-                    return NULL;
-                }
-                uart->rx_buffer = rx_buffer;
-            }
-            break;
-
-        case UART1:
-            // Note: uart_interrupt_handler does not support RX on UART 1.
-            uart->rx_enabled = false;
-            uart->tx_enabled = (mode != UART_RX_ONLY);
-            break;
-
-        case UART_NO:
-        default:
-            // big fail!
-            free(uart);
-            return NULL;
-        }
-
-        uart_set_baudrate(uart, baudrate);
-
-        UART[uart_nr] = uart;
-
-        return uart;
-    }
+uint8_t
+uart_get_bit_length(const int uart_nr)
+{
+	uint8_t width = ((uart_nr % 16) >> 2) + 5;
+	uint8_t parity = (uart_nr >> 5) + 1;
+	uint8_t stop = uart_nr % 4;
+	return (width + parity + stop + 1);
+}
 
-    void
-    uart_uninit(uart_t* uart)
-    {
-        if (uart == NULL)
-            return;
-
-        if (uart->rx_enabled)
-        {
-            free(uart->rx_buffer->buffer);
-            free(uart->rx_buffer);
-        }
-        free(uart);
-    }
+uart_t*
+uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, size_t rx_size, bool invert)
+{
+	(void) config;
+	(void) tx_pin;
+	(void) invert;
+	uart_t* uart = (uart_t*) malloc(sizeof(uart_t));
+	if(uart == NULL)
+		return NULL;
+
+	uart->uart_nr = uart_nr;
+	uart->rx_overrun = false;
+
+	switch(uart->uart_nr)
+	{
+	case UART0:
+		uart->rx_enabled = (mode != UART_TX_ONLY);
+		uart->tx_enabled = (mode != UART_RX_ONLY);
+		if(uart->rx_enabled)
+		{
+			struct uart_rx_buffer_ * rx_buffer = (struct uart_rx_buffer_ *)malloc(sizeof(struct uart_rx_buffer_));
+			if(rx_buffer == NULL)
+			{
+				free(uart);
+				return NULL;
+			}
+			rx_buffer->size = rx_size;//var this
+			rx_buffer->rpos = 0;
+			rx_buffer->wpos = 0;
+			rx_buffer->buffer = (uint8_t *)malloc(rx_buffer->size);
+			if(rx_buffer->buffer == NULL)
+			{
+				free(rx_buffer);
+				free(uart);
+				return NULL;
+			}
+			uart->rx_buffer = rx_buffer;
+		}
+		break;
+
+	case UART1:
+		// Note: uart_interrupt_handler does not support RX on UART 1.
+		uart->rx_enabled = false;
+		uart->tx_enabled = (mode != UART_RX_ONLY);
+		break;
+
+	case UART_NO:
+	default:
+		// big fail!
+		free(uart);
+		return NULL;
+	}
+
+	uart_set_baudrate(uart, baudrate);
+
+	UART[uart_nr] = uart;
+
+	return uart;
+}
 
-    bool
-    uart_swap(uart_t* uart, int tx_pin)
-    {
-        (void)uart;
-        (void)tx_pin;
-        return true;
-    }
+void
+uart_uninit(uart_t* uart)
+{
+	if(uart == NULL)
+		return;
+
+	if(uart->rx_enabled) {
+		free(uart->rx_buffer->buffer);
+		free(uart->rx_buffer);
+	}
+	free(uart);
+}
 
-    bool
-    uart_set_tx(uart_t* uart, int tx_pin)
-    {
-        (void)uart;
-        (void)tx_pin;
-        return true;
-    }
+bool
+uart_swap(uart_t* uart, int tx_pin)
+{
+	(void) uart;
+	(void) tx_pin;
+	return true;
+}
 
-    bool
-    uart_set_pins(uart_t* uart, int tx, int rx)
-    {
-        (void)uart;
-        (void)tx;
-        (void)rx;
-        return true;
-    }
+bool
+uart_set_tx(uart_t* uart, int tx_pin)
+{
+	(void) uart;
+	(void) tx_pin;
+	return true;
+}
 
-    bool
-    uart_tx_enabled(uart_t* uart)
-    {
-        if (uart == NULL)
-            return false;
+bool
+uart_set_pins(uart_t* uart, int tx, int rx)
+{
+	(void) uart;
+	(void) tx;
+	(void) rx;
+	return true;
+}
 
-        return uart->tx_enabled;
-    }
+bool
+uart_tx_enabled(uart_t* uart)
+{
+	if(uart == NULL)
+		return false;
 
-    bool
-    uart_rx_enabled(uart_t* uart)
-    {
-        if (uart == NULL)
-            return false;
+	return uart->tx_enabled;
+}
 
-        return uart->rx_enabled;
-    }
+bool
+uart_rx_enabled(uart_t* uart)
+{
+	if(uart == NULL)
+		return false;
 
-    bool
-    uart_has_overrun(uart_t* uart)
-    {
-        if (uart == NULL || !uart->rx_overrun)
-            return false;
+	return uart->rx_enabled;
+}
 
-        // clear flag
-        uart->rx_overrun = false;
-        return true;
-    }
+bool
+uart_has_overrun(uart_t* uart)
+{
+	if(uart == NULL || !uart->rx_overrun)
+		return false;
 
-    bool
-    uart_has_rx_error(uart_t* uart)
-    {
-        (void)uart;
-        return false;
-    }
+	// clear flag
+	uart->rx_overrun = false;
+	return true;
+}
 
-    void
-    uart_set_debug(int uart_nr)
-    {
-        (void)uart_nr;
-    }
+bool
+uart_has_rx_error(uart_t* uart)
+{
+	(void) uart;
+	return false;
+}
 
-    int
-    uart_get_debug()
-    {
-        return s_uart_debug_nr;
-    }
+void
+uart_set_debug(int uart_nr)
+{
+	(void)uart_nr;
+}
 
-    void
-    uart_start_detect_baudrate(int uart_nr)
-    {
-        (void)uart_nr;
-    }
+int
+uart_get_debug()
+{
+	return s_uart_debug_nr;
+}
 
-    int
-    uart_detect_baudrate(int uart_nr)
-    {
-        (void)uart_nr;
-        return 115200;
-    }
-};
+void
+uart_start_detect_baudrate(int uart_nr)
+{
+	(void) uart_nr;
+}
 
-size_t      uart_peek_available(uart_t* uart) { return 0; }
-const char* uart_peek_buffer(uart_t* uart) { return nullptr; }
-void        uart_peek_consume(uart_t* uart, size_t consume)
+int
+uart_detect_baudrate(int uart_nr)
 {
-    (void)uart;
-    (void)consume;
+	(void) uart_nr;
+	return 115200;
 }
+
+};
+
+
+size_t uart_peek_available (uart_t* uart) { return 0; }
+const char* uart_peek_buffer (uart_t* uart) { return nullptr; }
+void uart_peek_consume (uart_t* uart, size_t consume) { (void)uart; (void)consume; }
+
diff --git a/tests/host/common/MockWiFiServer.cpp b/tests/host/common/MockWiFiServer.cpp
index f199a2b588..dba66362d3 100644
--- a/tests/host/common/MockWiFiServer.cpp
+++ b/tests/host/common/MockWiFiServer.cpp
@@ -44,31 +44,32 @@ extern "C" const ip_addr_t ip_addr_any = IPADDR4_INIT(IPADDR_ANY);
 
 // lwIP API side of WiFiServer
 
-WiFiServer::WiFiServer(const IPAddress& addr, uint16_t port)
+WiFiServer::WiFiServer (const IPAddress& addr, uint16_t port)
 {
-    (void)addr;
-    _port = port;
+	(void)addr;
+	_port = port;
 }
 
-WiFiServer::WiFiServer(uint16_t port)
+WiFiServer::WiFiServer (uint16_t port)
 {
-    _port = port;
+	_port = port;
 }
 
-WiFiClient WiFiServer::available(uint8_t* status)
+WiFiClient WiFiServer::available (uint8_t* status)
 {
-    (void)status;
-    return accept();
+	(void)status;
+	return accept();
 }
 
-WiFiClient WiFiServer::accept()
+WiFiClient WiFiServer::accept ()
 {
-    if (hasClient())
-        return WiFiClient(new ClientContext(serverAccept(pcb2int(_listen_pcb))));
-    return WiFiClient();
+	if (hasClient())
+		return WiFiClient(new ClientContext(serverAccept(pcb2int(_listen_pcb))));
+	return WiFiClient();
 }
 
 // static declaration
 
 #include <include/UdpContext.h>
 uint32_t UdpContext::staticMCastAddr = 0;
+
diff --git a/tests/host/common/MockWiFiServerSocket.cpp b/tests/host/common/MockWiFiServerSocket.cpp
index c5e1e6b662..9ab344bf50 100644
--- a/tests/host/common/MockWiFiServerSocket.cpp
+++ b/tests/host/common/MockWiFiServerSocket.cpp
@@ -44,26 +44,26 @@
 
 // host socket internal side of WiFiServer
 
-int serverAccept(int srvsock)
+int serverAccept (int srvsock)
 {
-    int                clisock;
-    socklen_t          n;
-    struct sockaddr_in client;
-    n = sizeof(client);
-    if ((clisock = accept(srvsock, (struct sockaddr*)&client, &n)) == -1)
-    {
-        perror(MOCK "accept()");
-        exit(EXIT_FAILURE);
-    }
-    return mockSockSetup(clisock);
+	int clisock;
+	socklen_t n;
+	struct sockaddr_in client;
+	n = sizeof(client);
+	if ((clisock = accept(srvsock, (struct sockaddr*)&client, &n)) == -1)
+	{
+		perror(MOCK "accept()");
+		exit(EXIT_FAILURE);
+	}
+	return mockSockSetup(clisock);
 }
 
-void WiFiServer::begin(uint16_t port)
+void WiFiServer::begin (uint16_t port)
 {
     return begin(port, !0);
 }
 
-void WiFiServer::begin(uint16_t port, uint8_t backlog)
+void WiFiServer::begin (uint16_t port, uint8_t backlog)
 {
     if (!backlog)
         return;
@@ -71,74 +71,75 @@ void WiFiServer::begin(uint16_t port, uint8_t backlog)
     return begin();
 }
 
-void WiFiServer::begin()
+void WiFiServer::begin ()
 {
-    int                sock;
-    int                mockport;
-    struct sockaddr_in server;
-
-    mockport = _port;
-    if (mockport < 1024 && mock_port_shifter)
-    {
-        mockport += mock_port_shifter;
-        fprintf(stderr, MOCK "=====> WiFiServer port: %d shifted to %d (use option -s) <=====\n", _port, mockport);
-    }
-    else
-        fprintf(stderr, MOCK "=====> WiFiServer port: %d <=====\n", mockport);
-
-    if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1)
-    {
-        perror(MOCK "socket()");
-        exit(EXIT_FAILURE);
-    }
-
-    int optval = 1;
-    if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)) == -1)
-    {
-        perror(MOCK "reuseport");
-        exit(EXIT_FAILURE);
-    }
-
-    server.sin_family      = AF_INET;
-    server.sin_port        = htons(mockport);
-    server.sin_addr.s_addr = htonl(global_source_address);
-    if (bind(sock, (struct sockaddr*)&server, sizeof(server)) == -1)
-    {
-        perror(MOCK "bind()");
-        exit(EXIT_FAILURE);
-    }
-
-    if (listen(sock, 1) == -1)
-    {
-        perror(MOCK "listen()");
-        exit(EXIT_FAILURE);
-    }
-
-    // store int into pointer
-    _listen_pcb = int2pcb(sock);
+	int sock;
+	int mockport;
+	struct sockaddr_in server;
+
+	mockport = _port;
+	if (mockport < 1024 && mock_port_shifter)
+	{
+		mockport += mock_port_shifter;
+		fprintf(stderr, MOCK "=====> WiFiServer port: %d shifted to %d (use option -s) <=====\n", _port, mockport);
+	}
+	else
+		fprintf(stderr, MOCK "=====> WiFiServer port: %d <=====\n", mockport);
+
+	if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1)
+	{
+		perror(MOCK "socket()");
+		exit(EXIT_FAILURE);
+	}
+
+	int optval = 1;
+	if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)) == -1)
+	{
+		perror(MOCK "reuseport");
+		exit(EXIT_FAILURE);
+	}
+
+	server.sin_family = AF_INET;
+	server.sin_port = htons(mockport);
+	server.sin_addr.s_addr = htonl(global_source_address);
+	if (bind(sock, (struct sockaddr*)&server, sizeof(server)) == -1)
+	{
+		perror(MOCK "bind()");
+		exit(EXIT_FAILURE);
+	}
+
+	if (listen(sock, 1) == -1)
+	{
+		perror(MOCK "listen()");
+		exit(EXIT_FAILURE);
+	}
+
+
+	// store int into pointer
+	_listen_pcb = int2pcb(sock);
 }
 
-bool WiFiServer::hasClient()
+bool WiFiServer::hasClient ()
 {
-    struct pollfd p;
-    p.fd     = pcb2int(_listen_pcb);
-    p.events = POLLIN;
-    return poll(&p, 1, 0) && p.revents == POLLIN;
+	struct pollfd p;
+	p.fd = pcb2int(_listen_pcb);
+	p.events = POLLIN;
+	return poll(&p, 1, 0) && p.revents == POLLIN;
 }
 
-void WiFiServer::close()
+void WiFiServer::close ()
 {
-    if (pcb2int(_listen_pcb) >= 0)
-        ::close(pcb2int(_listen_pcb));
-    _listen_pcb = int2pcb(-1);
+	if (pcb2int(_listen_pcb) >= 0)
+		::close(pcb2int(_listen_pcb));
+	_listen_pcb = int2pcb(-1);
 }
 
-void WiFiServer::stop()
+void WiFiServer::stop ()
 {
     close();
 }
 
-size_t WiFiServer::hasClientData()
+size_t WiFiServer::hasClientData ()
 {
     // Trivial Mocking:
     // There is no waiting list of clients in this trivial mocking code,
@@ -148,7 +149,7 @@ size_t WiFiServer::hasClientData()
     return 0;
 }
 
-bool WiFiServer::hasMaxPendingClients()
+bool WiFiServer::hasMaxPendingClients ()
 {
     // Mocking code does not consider the waiting client list,
     // so it will return ::hasClient() here meaning:
diff --git a/tests/host/common/MocklwIP.cpp b/tests/host/common/MocklwIP.cpp
index 0b5dfa502b..1e19f20fc7 100644
--- a/tests/host/common/MocklwIP.cpp
+++ b/tests/host/common/MocklwIP.cpp
@@ -7,56 +7,58 @@ esp8266::AddressListImplementation::AddressList addrList;
 
 extern "C"
 {
-    extern netif netif0;
-
-    netif* netif_list = &netif0;
-
-    err_t dhcp_renew(struct netif* netif)
-    {
-        (void)netif;
-        return ERR_OK;
-    }
-
-    void sntp_setserver(u8_t, const ip_addr_t)
-    {
-    }
-
-    const ip_addr_t* sntp_getserver(u8_t)
-    {
-        return IP_ADDR_ANY;
-    }
-
-    err_t etharp_request(struct netif* netif, const ip4_addr_t* ipaddr)
-    {
-        (void)netif;
-        (void)ipaddr;
-        return ERR_OK;
-    }
-
-    err_t igmp_start(struct netif* netif)
-    {
-        (void)netif;
-        return ERR_OK;
-    }
-
-    err_t igmp_joingroup_netif(struct netif* netif, const ip4_addr_t* groupaddr)
-    {
-        (void)netif;
-        (void)groupaddr;
-        return ERR_OK;
-    }
-
-    err_t igmp_leavegroup_netif(struct netif* netif, const ip4_addr_t* groupaddr)
-    {
-        (void)netif;
-        (void)groupaddr;
-        return ERR_OK;
-    }
-
-    struct netif* netif_get_by_index(u8_t idx)
-    {
-        (void)idx;
-        return &netif0;
-    }
-
-}  // extern "C"
+
+extern netif netif0;
+
+netif* netif_list = &netif0;
+
+err_t dhcp_renew(struct netif *netif)
+{
+	(void)netif;
+	return ERR_OK;
+}
+
+void sntp_setserver(u8_t, const ip_addr_t)
+{
+}
+
+const ip_addr_t* sntp_getserver(u8_t)
+{
+    return IP_ADDR_ANY;
+}
+
+err_t etharp_request(struct netif *netif, const ip4_addr_t *ipaddr)
+{
+    (void)netif;
+    (void)ipaddr;
+    return ERR_OK;
+}
+
+err_t igmp_start(struct netif* netif)
+{
+    (void)netif;
+    return ERR_OK;
+}
+
+err_t igmp_joingroup_netif(struct netif *netif, const ip4_addr_t *groupaddr)
+{
+    (void)netif;
+    (void)groupaddr;
+    return ERR_OK;
+}
+
+err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr)
+{
+    (void)netif;
+    (void)groupaddr;
+    return ERR_OK;
+}
+
+struct netif* netif_get_by_index(u8_t idx)
+{
+    (void)idx;
+    return &netif0;
+}
+
+
+} // extern "C"
diff --git a/tests/host/common/UdpContextSocket.cpp b/tests/host/common/UdpContextSocket.cpp
index 161821a294..4212bb0ee4 100644
--- a/tests/host/common/UdpContextSocket.cpp
+++ b/tests/host/common/UdpContextSocket.cpp
@@ -39,175 +39,176 @@
 #include <assert.h>
 #include <net/if.h>
 
-int mockUDPSocket()
+int mockUDPSocket ()
 {
-    int s;
-    if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1 || fcntl(s, F_SETFL, O_NONBLOCK) == -1)
-    {
-        fprintf(stderr, MOCK "UDP socket: %s", strerror(errno));
-        exit(EXIT_FAILURE);
-    }
-    return s;
+	int s;
+	if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1 || fcntl(s, F_SETFL, O_NONBLOCK) == -1)
+	{
+		fprintf(stderr, MOCK "UDP socket: %s", strerror(errno));
+		exit(EXIT_FAILURE);
+	}
+	return s;
 }
 
-bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
+bool mockUDPListen (int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
 {
-    int optval;
-    int mockport;
-
-    mockport = port;
-    if (mockport < 1024 && mock_port_shifter)
-    {
-        mockport += mock_port_shifter;
-        fprintf(stderr, MOCK "=====> UdpServer port: %d shifted to %d (use option -s) <=====\n", port, mockport);
-    }
-    else
-        fprintf(stderr, MOCK "=====> UdpServer port: %d <=====\n", mockport);
-
-    optval = 1;
-    if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)) == -1)
-        fprintf(stderr, MOCK "SO_REUSEPORT failed\n");
-    optval = 1;
-    if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) == -1)
-        fprintf(stderr, MOCK "SO_REUSEADDR failed\n");
-
-    struct sockaddr_in servaddr;
-    memset(&servaddr, 0, sizeof(servaddr));
-
-    // Filling server information
-    servaddr.sin_family = AF_INET;
-    (void)dstaddr;
-    //servaddr.sin_addr.s_addr = htonl(global_source_address);
-    servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
-    servaddr.sin_port        = htons(mockport);
-
-    // Bind the socket with the server address
-    if (bind(sock, (const struct sockaddr*)&servaddr, sizeof(servaddr)) < 0)
-    {
-        fprintf(stderr, MOCK "UDP bind on port %d failed: %s\n", mockport, strerror(errno));
-        return false;
-    }
-    else
-        mockverbose("UDP server on port %d (sock=%d)\n", mockport, sock);
-
-    if (!mcast)
-        mcast = inet_addr("224.0.0.1");  // all hosts group
-    if (mcast)
-    {
-        // https://web.cs.wpi.edu/~claypool/courses/4514-B99/samples/multicast.c
-        // https://stackoverflow.com/questions/12681097/c-choose-interface-for-udp-multicast-socket
-
-        struct ip_mreq mreq;
-        mreq.imr_multiaddr.s_addr = mcast;
-        //mreq.imr_interface.s_addr = htonl(global_source_address);
-        mreq.imr_interface.s_addr = htonl(INADDR_ANY);
-
-        if (host_interface)
-        {
+	int optval;
+	int mockport;
+
+	mockport = port;
+	if (mockport < 1024 && mock_port_shifter)
+	{
+		mockport += mock_port_shifter;
+		fprintf(stderr, MOCK "=====> UdpServer port: %d shifted to %d (use option -s) <=====\n", port, mockport);
+	}
+	else
+		fprintf(stderr, MOCK "=====> UdpServer port: %d <=====\n", mockport);
+
+	optval = 1;
+	if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)) == -1)
+		fprintf(stderr, MOCK "SO_REUSEPORT failed\n");
+	optval = 1;
+	if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) == -1)
+		fprintf(stderr, MOCK "SO_REUSEADDR failed\n");
+
+	struct sockaddr_in servaddr;
+	memset(&servaddr, 0, sizeof(servaddr));
+
+	// Filling server information
+	servaddr.sin_family = AF_INET;
+	(void) dstaddr;
+	//servaddr.sin_addr.s_addr = htonl(global_source_address);
+	servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
+	servaddr.sin_port = htons(mockport);
+
+	// Bind the socket with the server address
+	if (bind(sock, (const struct sockaddr *)&servaddr, sizeof(servaddr)) < 0)
+	{
+		fprintf(stderr, MOCK "UDP bind on port %d failed: %s\n", mockport, strerror(errno));
+		return false;
+	}
+	else
+		mockverbose("UDP server on port %d (sock=%d)\n", mockport, sock);
+
+	if (!mcast)
+		mcast = inet_addr("224.0.0.1"); // all hosts group
+	if (mcast)
+	{
+		// https://web.cs.wpi.edu/~claypool/courses/4514-B99/samples/multicast.c
+		// https://stackoverflow.com/questions/12681097/c-choose-interface-for-udp-multicast-socket
+
+		struct ip_mreq mreq;
+		mreq.imr_multiaddr.s_addr = mcast;
+		//mreq.imr_interface.s_addr = htonl(global_source_address);
+		mreq.imr_interface.s_addr = htonl(INADDR_ANY);
+
+		if (host_interface)
+		{
 #if __APPLE__
-            int idx = if_nametoindex(host_interface);
-            if (setsockopt(sock, IPPROTO_TCP, IP_BOUND_IF, &idx, sizeof(idx)) == -1)
+			int idx = if_nametoindex(host_interface);
+			if (setsockopt(sock, IPPROTO_TCP, IP_BOUND_IF, &idx, sizeof(idx)) == -1)
 #else
-            if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, host_interface, strlen(host_interface)) == -1)
+			if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, host_interface, strlen(host_interface)) == -1)
 #endif
-                fprintf(stderr, MOCK "UDP multicast: can't setup bind/output on interface %s: %s\n", host_interface, strerror(errno));
-            if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, &mreq.imr_interface, sizeof(struct in_addr)) == -1)
-                fprintf(stderr, MOCK "UDP multicast: can't setup bind/input on interface %s: %s\n", host_interface, strerror(errno));
-        }
-
-        if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0)
-        {
-            fprintf(stderr, MOCK "can't join multicast group addr %08x\n", (int)mcast);
-            return false;
-        }
-        else
-            mockverbose("joined multicast group addr %08lx\n", (long)ntohl(mcast));
-    }
-
-    return true;
+				fprintf(stderr, MOCK "UDP multicast: can't setup bind/output on interface %s: %s\n", host_interface, strerror(errno));
+			if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, &mreq.imr_interface, sizeof(struct in_addr)) == -1)
+				fprintf(stderr, MOCK "UDP multicast: can't setup bind/input on interface %s: %s\n", host_interface, strerror(errno));
+		}
+
+		if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0)
+		{
+			fprintf(stderr, MOCK "can't join multicast group addr %08x\n", (int)mcast);
+			return false;
+		}
+		else
+			mockverbose("joined multicast group addr %08lx\n", (long)ntohl(mcast));
+	}
+
+	return true;
 }
 
-size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port)
+
+size_t mockUDPFillInBuf (int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port)
 {
-    struct sockaddr_storage addrbuf;
-    socklen_t               addrbufsize = std::min((socklen_t)sizeof(addrbuf), (socklen_t)16);
-
-    size_t  maxread = CCBUFSIZE - ccinbufsize;
-    ssize_t ret     = ::recvfrom(sock, ccinbuf + ccinbufsize, maxread, 0 /*flags*/, (sockaddr*)&addrbuf, &addrbufsize);
-    if (ret == -1)
-    {
-        if (errno != EAGAIN)
-            fprintf(stderr, MOCK "UDPContext::(read/peek): filling buffer for %zd bytes: %s\n", maxread, strerror(errno));
-        ret = 0;
-    }
-
-    if (ret > 0)
-    {
-        port = ntohs(((sockaddr_in*)&addrbuf)->sin_port);
-        if (addrbuf.ss_family == AF_INET)
-            memcpy(&addr[0], &(((sockaddr_in*)&addrbuf)->sin_addr.s_addr), addrsize = 4);
-        else
-        {
-            fprintf(stderr, MOCK "TODO UDP+IPv6\n");
-            exit(EXIT_FAILURE);
-        }
-    }
-
-    return ccinbufsize += ret;
+	struct sockaddr_storage addrbuf;
+	socklen_t addrbufsize = std::min((socklen_t)sizeof(addrbuf), (socklen_t)16);
+
+	size_t maxread = CCBUFSIZE - ccinbufsize;
+	ssize_t ret = ::recvfrom(sock, ccinbuf + ccinbufsize, maxread, 0/*flags*/, (sockaddr*)&addrbuf, &addrbufsize);
+	if (ret == -1)
+	{
+		if (errno != EAGAIN)
+			fprintf(stderr, MOCK "UDPContext::(read/peek): filling buffer for %zd bytes: %s\n", maxread, strerror(errno));
+		ret = 0;
+	}
+
+	if (ret > 0)
+	{
+		port = ntohs(((sockaddr_in*)&addrbuf)->sin_port);
+		if (addrbuf.ss_family == AF_INET)
+			memcpy(&addr[0], &(((sockaddr_in*)&addrbuf)->sin_addr.s_addr), addrsize = 4);
+		else
+		{
+			fprintf(stderr, MOCK "TODO UDP+IPv6\n");
+			exit(EXIT_FAILURE);
+		}
+	}
+
+	return ccinbufsize += ret;
 }
 
-size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+size_t mockUDPPeekBytes (int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
 {
-    (void)sock;
-    (void)timeout_ms;
-    if (usersize > CCBUFSIZE)
-        fprintf(stderr, MOCK "CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
-
-    size_t retsize = 0;
-    if (ccinbufsize)
-    {
-        // data already buffered
-        retsize = usersize;
-        if (retsize > ccinbufsize)
-            retsize = ccinbufsize;
-    }
-    memcpy(dst, ccinbuf, retsize);
-    return retsize;
+	(void) sock;
+	(void) timeout_ms;  
+	if (usersize > CCBUFSIZE)
+		fprintf(stderr, MOCK "CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
+
+	size_t retsize = 0;
+	if (ccinbufsize)
+	{
+		// data already buffered
+		retsize = usersize;
+		if (retsize > ccinbufsize)
+			retsize = ccinbufsize;
+	}
+	memcpy(dst, ccinbuf, retsize);
+	return retsize;
 }
 
-void mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize)
+void mockUDPSwallow (size_t copied, char* ccinbuf, size_t& ccinbufsize)
 {
-    // poor man buffer
-    memmove(ccinbuf, ccinbuf + copied, ccinbufsize - copied);
-    ccinbufsize -= copied;
+	// poor man buffer
+	memmove(ccinbuf, ccinbuf + copied, ccinbufsize - copied);
+	ccinbufsize -= copied;
 }
 
-size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+size_t mockUDPRead (int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
 {
-    size_t copied = mockUDPPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
-    mockUDPSwallow(copied, ccinbuf, ccinbufsize);
-    return copied;
+	size_t copied = mockUDPPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
+	mockUDPSwallow(copied, ccinbuf, ccinbufsize);
+	return copied;
 }
 
-size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port)
+size_t mockUDPWrite (int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port)
 {
-    (void)timeout_ms;
-    // Filling server information
-    struct sockaddr_in peer;
-    peer.sin_family      = AF_INET;
-    peer.sin_addr.s_addr = ipv4;  //XXFIXME should use lwip_htonl?
-    peer.sin_port        = htons(port);
-    int ret              = ::sendto(sock, data, size, 0 /*flags*/, (const sockaddr*)&peer, sizeof(peer));
-    if (ret == -1)
-    {
-        fprintf(stderr, MOCK "UDPContext::write: write(%d): %s\n", sock, strerror(errno));
-        return 0;
-    }
-    if (ret != (int)size)
-    {
-        fprintf(stderr, MOCK "UDPContext::write: short write (%d < %zd) (TODO)\n", ret, size);
-        exit(EXIT_FAILURE);
-    }
-
-    return ret;
+	(void) timeout_ms;
+	// Filling server information
+	struct sockaddr_in peer;
+	peer.sin_family = AF_INET;
+	peer.sin_addr.s_addr = ipv4; //XXFIXME should use lwip_htonl?
+	peer.sin_port = htons(port);
+	int ret = ::sendto(sock, data, size, 0/*flags*/, (const sockaddr*)&peer, sizeof(peer));
+	if (ret == -1)
+	{
+		fprintf(stderr, MOCK "UDPContext::write: write(%d): %s\n", sock, strerror(errno));
+		return 0;
+	}
+	if (ret != (int)size)
+	{
+		fprintf(stderr, MOCK "UDPContext::write: short write (%d < %zd) (TODO)\n", ret, size);
+		exit(EXIT_FAILURE);
+	}
+
+	return ret;
 }
diff --git a/tests/host/common/WMath.cpp b/tests/host/common/WMath.cpp
index 99b83a31f0..4fdf07fa2e 100644
--- a/tests/host/common/WMath.cpp
+++ b/tests/host/common/WMath.cpp
@@ -23,50 +23,40 @@
  $Id$
  */
 
-extern "C"
-{
+extern "C" {
 #include <stdlib.h>
 #include <stdint.h>
 }
 
-void randomSeed(unsigned long seed)
-{
-    if (seed != 0)
-    {
+void randomSeed(unsigned long seed) {
+    if(seed != 0) {
         srand(seed);
     }
 }
 
-long random(long howbig)
-{
-    if (howbig == 0)
-    {
+long random(long howbig) {
+    if(howbig == 0) {
         return 0;
     }
     return (rand()) % howbig;
 }
 
-long random(long howsmall, long howbig)
-{
-    if (howsmall >= howbig)
-    {
+long random(long howsmall, long howbig) {
+    if(howsmall >= howbig) {
         return howsmall;
     }
     long diff = howbig - howsmall;
     return random(diff) + howsmall;
 }
 
-long map(long x, long in_min, long in_max, long out_min, long out_max)
-{
+long map(long x, long in_min, long in_max, long out_min, long out_max) {
     return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
 }
 
-uint16_t makeWord(unsigned int w)
-{
+uint16_t makeWord(unsigned int w) {
     return w;
 }
 
-uint16_t makeWord(unsigned char h, unsigned char l)
-{
+uint16_t makeWord(unsigned char h, unsigned char l) {
     return (h << 8) | l;
 }
diff --git a/tests/host/common/c_types.h b/tests/host/common/c_types.h
index 249c423682..a4c784c7fb 100644
--- a/tests/host/common/c_types.h
+++ b/tests/host/common/c_types.h
@@ -36,46 +36,45 @@
 #include <stdarg.h>
 #include <sys/cdefs.h>
 
-typedef signed char      sint8_t;
-typedef signed short     sint16_t;
-typedef signed long      sint32_t;
-typedef signed long long sint64_t;
+typedef signed char         sint8_t;
+typedef signed short        sint16_t;
+typedef signed long         sint32_t;
+typedef signed long long    sint64_t;
 // CONFLICT typedef unsigned long long  u_int64_t;
-typedef float  real32_t;
-typedef double real64_t;
+typedef float               real32_t;
+typedef double              real64_t;
 
 // CONFLICT typedef unsigned char       uint8;
-typedef unsigned char  u8;
-typedef signed char    sint8;
-typedef signed char    int8;
-typedef signed char    s8;
-typedef unsigned short uint16;
-typedef unsigned short u16;
-typedef signed short   sint16;
-typedef signed short   s16;
+typedef unsigned char       u8;
+typedef signed char         sint8;
+typedef signed char         int8;
+typedef signed char         s8;
+typedef unsigned short      uint16;
+typedef unsigned short      u16;
+typedef signed short        sint16;
+typedef signed short        s16;
 // CONFLICT typedef unsigned int        uint32;
-typedef unsigned int       u_int;
-typedef unsigned int       u32;
-typedef signed int         sint32;
-typedef signed int         s32;
-typedef int                int32;
-typedef signed long long   sint64;
-typedef unsigned long long uint64;
-typedef unsigned long long u64;
-typedef float              real32;
-typedef double             real64;
+typedef unsigned int        u_int;
+typedef unsigned int        u32;
+typedef signed int          sint32;
+typedef signed int          s32;
+typedef int                 int32;
+typedef signed long long    sint64;
+typedef unsigned long long  uint64;
+typedef unsigned long long  u64;
+typedef float               real32;
+typedef double              real64;
 
-#define __le16 u16
+#define __le16      u16
 
-#define LOCAL static
+#define LOCAL       static
 
 #ifndef NULL
-#define NULL (void*)0
+#define NULL (void *)0
 #endif /* NULL */
 
 /* probably should not put STATUS here */
-typedef enum
-{
+typedef enum {
     OK = 0,
     FAIL,
     PENDING,
@@ -83,10 +82,10 @@ typedef enum
     CANCEL,
 } STATUS;
 
-#define BIT(nr) (1UL << (nr))
+#define BIT(nr)                 (1UL << (nr))
 
-#define REG_SET_BIT(_r, _b) (*(volatile uint32_t*)(_r) |= (_b))
-#define REG_CLR_BIT(_r, _b) (*(volatile uint32_t*)(_r) &= ~(_b))
+#define REG_SET_BIT(_r, _b)  (*(volatile uint32_t*)(_r) |= (_b))
+#define REG_CLR_BIT(_r, _b)  (*(volatile uint32_t*)(_r) &= ~(_b))
 
 #define DMEM_ATTR __attribute__((section(".bss")))
 #define SHMEM_ATTR
@@ -94,9 +93,9 @@ typedef enum
 #ifdef ICACHE_FLASH
 #define __ICACHE_STRINGIZE_NX(A) #A
 #define __ICACHE_STRINGIZE(A) __ICACHE_STRINGIZE_NX(A)
-#define ICACHE_FLASH_ATTR __attribute__((section("\".irom0.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
-#define IRAM_ATTR __attribute__((section("\".iram.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
-#define ICACHE_RODATA_ATTR __attribute__((section("\".irom.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
+#define ICACHE_FLASH_ATTR   __attribute__((section("\".irom0.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
+#define IRAM_ATTR     __attribute__((section("\".iram.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
+#define ICACHE_RODATA_ATTR  __attribute__((section("\".irom.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
 #else
 #define ICACHE_FLASH_ATTR
 #define IRAM_ATTR
@@ -109,9 +108,10 @@ typedef enum
 #define STORE_ATTR __attribute__((aligned(4)))
 
 #ifndef __cplusplus
-#define BOOL bool
-#define TRUE true
-#define FALSE false
+#define BOOL            bool
+#define TRUE            true
+#define FALSE           false
+
 
 #endif /* !__cplusplus */
 
diff --git a/tests/host/common/include/ClientContext.h b/tests/host/common/include/ClientContext.h
index b3c32211e2..bd9c9b80a5 100644
--- a/tests/host/common/include/ClientContext.h
+++ b/tests/host/common/include/ClientContext.h
@@ -26,7 +26,7 @@ class WiFiClient;
 
 #include <assert.h>
 
-bool getDefaultPrivateGlobalSyncValue();
+bool getDefaultPrivateGlobalSyncValue ();
 
 typedef void (*discard_cb_t)(void*, ClientContext*);
 
@@ -39,19 +39,19 @@ class ClientContext
     {
         (void)pcb;
     }
-
-    ClientContext(int sock) :
+    
+    ClientContext (int sock) :
         _discard_cb(nullptr), _discard_cb_arg(nullptr), _refcnt(0), _next(nullptr),
         _sync(::getDefaultPrivateGlobalSyncValue()), _sock(sock)
     {
     }
-
+    
     err_t abort()
     {
         if (_sock >= 0)
         {
             ::close(_sock);
-            mockverbose("socket %d closed\n", _sock);
+	    mockverbose("socket %d closed\n", _sock);
         }
         _sock = -1;
         return ERR_ABRT;
@@ -88,12 +88,11 @@ class ClientContext
     void unref()
     {
         DEBUGV(":ur %d\r\n", _refcnt);
-        if (--_refcnt == 0)
-        {
+        if(--_refcnt == 0) {
             discard_received();
             close();
             if (_discard_cb)
-                _discard_cb(_discard_cb_arg, this);
+                 _discard_cb(_discard_cb_arg, this);
             DEBUGV(":del\r\n");
             delete this;
         }
@@ -173,10 +172,10 @@ class ClientContext
     int read()
     {
         char c;
-        return read(&c, 1) ? (unsigned char)c : -1;
+        return read(&c, 1)? (unsigned char)c: -1;
     }
 
-    size_t read(char* dst, size_t size)
+    size_t read (char* dst, size_t size)
     {
         ssize_t ret = mockRead(_sock, dst, size, 0, _inbuf, _inbufsize);
         if (ret < 0)
@@ -190,10 +189,10 @@ class ClientContext
     int peek()
     {
         char c;
-        return peekBytes(&c, 1) ? c : -1;
+        return peekBytes(&c, 1)? c: -1;
     }
 
-    size_t peekBytes(char* dst, size_t size)
+    size_t peekBytes(char *dst, size_t size)
     {
         ssize_t ret = mockPeekBytes(_sock, dst, size, _timeout_ms, _inbuf, _inbufsize);
         if (ret < 0)
@@ -217,60 +216,60 @@ class ClientContext
 
     uint8_t state()
     {
-        (void)getSize();  // read on socket to force detect closed peer
-        return _sock >= 0 ? ESTABLISHED : CLOSED;
+	(void)getSize(); // read on socket to force detect closed peer
+        return _sock >= 0? ESTABLISHED: CLOSED;
     }
 
     size_t write(const char* data, size_t size)
     {
-        ssize_t ret = mockWrite(_sock, (const uint8_t*)data, size, _timeout_ms);
-        if (ret < 0)
-        {
-            abort();
-            return 0;
-        }
-        return ret;
+	ssize_t ret = mockWrite(_sock, (const uint8_t*)data, size, _timeout_ms);
+	if (ret < 0)
+	{
+	    abort();
+	    return 0;
+	}
+	return ret;
     }
 
-    void keepAlive(uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC, uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC, uint8_t count = TCP_DEFAULT_KEEPALIVE_COUNT)
+    void keepAlive (uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC, uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC, uint8_t count = TCP_DEFAULT_KEEPALIVE_COUNT)
     {
-        (void)idle_sec;
-        (void)intv_sec;
-        (void)count;
+        (void) idle_sec;
+        (void) intv_sec;
+        (void) count;
         mockverbose("TODO ClientContext::keepAlive()\n");
     }
 
-    bool isKeepAliveEnabled() const
+    bool isKeepAliveEnabled () const
     {
         mockverbose("TODO ClientContext::isKeepAliveEnabled()\n");
         return false;
     }
 
-    uint16_t getKeepAliveIdle() const
+    uint16_t getKeepAliveIdle () const
     {
         mockverbose("TODO ClientContext::getKeepAliveIdle()\n");
         return 0;
     }
 
-    uint16_t getKeepAliveInterval() const
+    uint16_t getKeepAliveInterval () const
     {
         mockverbose("TODO ClientContext::getKeepAliveInternal()\n");
         return 0;
     }
 
-    uint8_t getKeepAliveCount() const
+    uint8_t getKeepAliveCount () const
     {
         mockverbose("TODO ClientContext::getKeepAliveCount()\n");
         return 0;
     }
 
-    bool getSync() const
+    bool getSync () const
     {
         mockverbose("TODO ClientContext::getSync()\n");
         return _sync;
     }
 
-    void setSync(bool sync)
+    void setSync (bool sync)
     {
         mockverbose("TODO ClientContext::setSync()\n");
         _sync = sync;
@@ -278,13 +277,13 @@ class ClientContext
 
     // return a pointer to available data buffer (size = peekAvailable())
     // semantic forbids any kind of read() before calling peekConsume()
-    const char* peekBuffer()
+    const char* peekBuffer ()
     {
         return _inbuf;
     }
 
     // return number of byte accessible by peekBuffer()
-    size_t peekAvailable()
+    size_t peekAvailable ()
     {
         ssize_t ret = mockPeekBytes(_sock, nullptr, 0, 0, _inbuf, _inbufsize);
         if (ret < 0)
@@ -296,7 +295,7 @@ class ClientContext
     }
 
     // consume bytes after use (see peekBuffer)
-    void peekConsume(size_t consume)
+    void peekConsume (size_t consume)
     {
         assert(consume <= _inbufsize);
         memmove(_inbuf, _inbuf + consume, _inbufsize - consume);
@@ -304,21 +303,22 @@ class ClientContext
     }
 
 private:
-    discard_cb_t _discard_cb     = nullptr;
-    void*        _discard_cb_arg = nullptr;
 
-    int8_t         _refcnt;
-    ClientContext* _next;
+    discard_cb_t _discard_cb = nullptr;
+    void* _discard_cb_arg = nullptr;
 
+    int8_t _refcnt;
+    ClientContext* _next;
+    
     bool _sync;
-
+    
     // MOCK
-
-    int _sock       = -1;
+    
+    int _sock = -1;
     int _timeout_ms = 5000;
 
-    char   _inbuf[CCBUFSIZE];
+    char _inbuf [CCBUFSIZE];
     size_t _inbufsize = 0;
 };
 
-#endif  //CLIENTCONTEXT_H
+#endif //CLIENTCONTEXT_H
diff --git a/tests/host/common/include/UdpContext.h b/tests/host/common/include/UdpContext.h
index 0e3942b2db..bf104bc40f 100644
--- a/tests/host/common/include/UdpContext.h
+++ b/tests/host/common/include/UdpContext.h
@@ -37,10 +37,10 @@ extern netif netif0;
 class UdpContext
 {
 public:
+
     typedef std::function<void(void)> rxhandler_t;
 
-    UdpContext() :
-        _on_rx(nullptr), _refcnt(0)
+    UdpContext(): _on_rx(nullptr), _refcnt(0)
     {
         _sock = mockUDPSocket();
     }
@@ -64,7 +64,7 @@ class UdpContext
 
     bool connect(const ip_addr_t* addr, uint16_t port)
     {
-        _dst     = *addr;
+        _dst = *addr;
         _dstport = port;
         return true;
     }
@@ -156,13 +156,13 @@ class UdpContext
     IPAddress getDestAddress()
     {
         mockverbose("TODO: implement UDP getDestAddress\n");
-        return 0;  //ip_hdr* iphdr = GET_IP_HDR(_rx_buf);
+        return 0; //ip_hdr* iphdr = GET_IP_HDR(_rx_buf);
     }
 
     uint16_t getLocalPort()
     {
         mockverbose("TODO: implement UDP getLocalPort\n");
-        return 0;  //
+        return 0; //
     }
 
     bool next()
@@ -191,7 +191,7 @@ class UdpContext
     int peek()
     {
         char c;
-        return mockUDPPeekBytes(_sock, &c, 1, _timeout_ms, _inbuf, _inbufsize) ?: -1;
+        return mockUDPPeekBytes(_sock, &c, 1, _timeout_ms, _inbuf, _inbufsize) ? : -1;
     }
 
     void flush()
@@ -217,10 +217,10 @@ class UdpContext
 
     err_t trySend(ip_addr_t* addr = 0, uint16_t port = 0, bool keepBuffer = true)
     {
-        uint32_t dst     = addr ? addr->addr : _dst.addr;
-        uint16_t dstport = port ?: _dstport;
-        size_t   wrt     = mockUDPWrite(_sock, (const uint8_t*)_outbuf, _outbufsize, _timeout_ms, dst, dstport);
-        err_t    ret     = _outbufsize ? ERR_OK : ERR_ABRT;
+        uint32_t dst = addr ? addr->addr : _dst.addr;
+        uint16_t dstport = port ? : _dstport;
+        size_t wrt = mockUDPWrite(_sock, (const uint8_t*)_outbuf, _outbufsize, _timeout_ms, dst, dstport);
+        err_t ret = _outbufsize ? ERR_OK : ERR_ABRT;
         if (!keepBuffer || wrt == _outbufsize)
             cancelBuffer();
         return ret;
@@ -239,7 +239,7 @@ class UdpContext
     bool sendTimeout(ip_addr_t* addr, uint16_t port,
                      esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
     {
-        err_t                                 err;
+        err_t err;
         esp8266::polledTimeout::oneShotFastMs timeout(timeoutMs);
         while (((err = trySend(addr, port)) != ERR_OK) && !timeout)
             delay(0);
@@ -250,14 +250,15 @@ class UdpContext
 
     void mock_cb(void)
     {
-        if (_on_rx)
-            _on_rx();
+        if (_on_rx) _on_rx();
     }
 
 public:
+
     static uint32_t staticMCastAddr;
 
 private:
+
     void translate_addr()
     {
         if (addrsize == 4)
@@ -272,16 +273,16 @@ class UdpContext
             mockverbose("TODO unhandled udp address of size %d\n", (int)addrsize);
     }
 
-    int         _sock = -1;
+    int _sock = -1;
     rxhandler_t _on_rx;
-    int         _refcnt = 0;
+    int _refcnt = 0;
 
     ip_addr_t _dst;
-    uint16_t  _dstport;
+    uint16_t _dstport;
 
-    char   _inbuf[CCBUFSIZE];
+    char _inbuf [CCBUFSIZE];
     size_t _inbufsize = 0;
-    char   _outbuf[CCBUFSIZE];
+    char _outbuf [CCBUFSIZE];
     size_t _outbufsize = 0;
 
     int _timeout_ms = 0;
@@ -290,11 +291,11 @@ class UdpContext
     uint8_t addr[16];
 };
 
-extern "C" inline err_t igmp_joingroup(const ip4_addr_t* ifaddr, const ip4_addr_t* groupaddr)
+extern "C" inline err_t igmp_joingroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr)
 {
     (void)ifaddr;
     UdpContext::staticMCastAddr = groupaddr->addr;
     return ERR_OK;
 }
 
-#endif  //UDPCONTEXT_H
+#endif//UDPCONTEXT_H
diff --git a/tests/host/common/littlefs_mock.cpp b/tests/host/common/littlefs_mock.cpp
index 5110ebbf7b..0d99e82b1e 100644
--- a/tests/host/common/littlefs_mock.cpp
+++ b/tests/host/common/littlefs_mock.cpp
@@ -16,6 +16,7 @@
  all copies or substantial portions of the Software.
 */
 
+
 #include "littlefs_mock.h"
 #include "spiffs_mock.h"
 #include "spiffs/spiffs.h"
@@ -72,18 +73,18 @@ LittleFSMock::~LittleFSMock()
     LittleFS = FS(FSImplPtr(nullptr));
 }
 
-void LittleFSMock::load()
+void LittleFSMock::load ()
 {
     if (!m_fs.size() || !m_storage.length())
         return;
-
+    
     int fs = ::open(m_storage.c_str(), O_RDONLY);
     if (fs == -1)
     {
         fprintf(stderr, "LittleFS: loading '%s': %s\n", m_storage.c_str(), strerror(errno));
         return;
     }
-
+    
     off_t flen = lseek(fs, 0, SEEK_END);
     if (flen == (off_t)-1)
     {
@@ -91,7 +92,7 @@ void LittleFSMock::load()
         return;
     }
     lseek(fs, 0, SEEK_SET);
-
+    
     if (flen != (off_t)m_fs.size())
     {
         fprintf(stderr, "LittleFS: size of '%s': %d does not match requested size %zd\n", m_storage.c_str(), (int)flen, m_fs.size());
@@ -112,7 +113,7 @@ void LittleFSMock::load()
     ::close(fs);
 }
 
-void LittleFSMock::save()
+void LittleFSMock::save ()
 {
     if (!m_fs.size() || !m_storage.length())
         return;
diff --git a/tests/host/common/littlefs_mock.h b/tests/host/common/littlefs_mock.h
index 53f4a5a5f7..0905fa9322 100644
--- a/tests/host/common/littlefs_mock.h
+++ b/tests/host/common/littlefs_mock.h
@@ -27,20 +27,19 @@
 
 #define DEFAULT_LITTLEFS_FILE_NAME "littlefs.bin"
 
-class LittleFSMock
-{
+class LittleFSMock {
 public:
     LittleFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString);
     void reset();
     ~LittleFSMock();
-
+    
 protected:
-    void load();
-    void save();
+    void load ();
+    void save ();
 
     std::vector<uint8_t> m_fs;
-    String               m_storage;
-    bool                 m_overwrite;
+    String m_storage;
+    bool m_overwrite;
 };
 
 #define LITTLEFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage) LittleFSMock littlefs_mock(size_kb * 1024, block_kb * 1024, page_b, storage)
diff --git a/tests/host/common/md5.c b/tests/host/common/md5.c
index 863ac80026..4b58f261f3 100644
--- a/tests/host/common/md5.c
+++ b/tests/host/common/md5.c
@@ -39,15 +39,16 @@
 #define EXP_FUNC extern
 #define STDCALL
 
-#define MD5_SIZE 16
+#define MD5_SIZE    16 
 
-typedef struct
+typedef struct 
 {
-    uint32_t state[4];   /* state (ABCD) */
-    uint32_t count[2];   /* number of bits, modulo 2^64 (lsb first) */
-    uint8_t  buffer[64]; /* input buffer */
+  uint32_t state[4];        /* state (ABCD) */
+  uint32_t count[2];        /* number of bits, modulo 2^64 (lsb first) */
+  uint8_t buffer[64];       /* input buffer */
 } MD5_CTX;
 
+
 /* Constants for MD5Transform routine.
  */
 #define S11 7
@@ -69,10 +70,11 @@ typedef struct
 
 /* ----- static functions ----- */
 static void MD5Transform(uint32_t state[4], const uint8_t block[64]);
-static void Encode(uint8_t* output, uint32_t* input, uint32_t len);
-static void Decode(uint32_t* output, const uint8_t* input, uint32_t len);
+static void Encode(uint8_t *output, uint32_t *input, uint32_t len);
+static void Decode(uint32_t *output, const uint8_t *input, uint32_t len);
 
-static const uint8_t PADDING[64] = {
+static const uint8_t PADDING[64] = 
+{
     0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
@@ -86,39 +88,35 @@ static const uint8_t PADDING[64] = {
 #define I(x, y, z) ((y) ^ ((x) | (~z)))
 
 /* ROTATE_LEFT rotates x left n bits.  */
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
+#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
 
 /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
    Rotation is separate from addition to prevent recomputation.  */
-#define FF(a, b, c, d, x, s, ac)                        \
-    {                                                   \
-        (a) += F((b), (c), (d)) + (x) + (uint32_t)(ac); \
-        (a) = ROTATE_LEFT((a), (s));                    \
-        (a) += (b);                                     \
-    }
-#define GG(a, b, c, d, x, s, ac)                        \
-    {                                                   \
-        (a) += G((b), (c), (d)) + (x) + (uint32_t)(ac); \
-        (a) = ROTATE_LEFT((a), (s));                    \
-        (a) += (b);                                     \
-    }
-#define HH(a, b, c, d, x, s, ac)                        \
-    {                                                   \
-        (a) += H((b), (c), (d)) + (x) + (uint32_t)(ac); \
-        (a) = ROTATE_LEFT((a), (s));                    \
-        (a) += (b);                                     \
-    }
-#define II(a, b, c, d, x, s, ac)                        \
-    {                                                   \
-        (a) += I((b), (c), (d)) + (x) + (uint32_t)(ac); \
-        (a) = ROTATE_LEFT((a), (s));                    \
-        (a) += (b);                                     \
-    }
+#define FF(a, b, c, d, x, s, ac) { \
+    (a) += F ((b), (c), (d)) + (x) + (uint32_t)(ac); \
+    (a) = ROTATE_LEFT ((a), (s)); \
+    (a) += (b); \
+  }
+#define GG(a, b, c, d, x, s, ac) { \
+    (a) += G ((b), (c), (d)) + (x) + (uint32_t)(ac); \
+    (a) = ROTATE_LEFT ((a), (s)); \
+    (a) += (b); \
+  }
+#define HH(a, b, c, d, x, s, ac) { \
+    (a) += H ((b), (c), (d)) + (x) + (uint32_t)(ac); \
+    (a) = ROTATE_LEFT ((a), (s)); \
+    (a) += (b); \
+  }
+#define II(a, b, c, d, x, s, ac) { \
+    (a) += I ((b), (c), (d)) + (x) + (uint32_t)(ac); \
+    (a) = ROTATE_LEFT ((a), (s)); \
+    (a) += (b); \
+  }
 
 /**
  * MD5 initialization - begins an MD5 operation, writing a new ctx.
  */
-EXP_FUNC void STDCALL MD5Init(MD5_CTX* ctx)
+EXP_FUNC void STDCALL MD5Init(MD5_CTX *ctx)
 {
     ctx->count[0] = ctx->count[1] = 0;
 
@@ -133,10 +131,10 @@ EXP_FUNC void STDCALL MD5Init(MD5_CTX* ctx)
 /**
  * Accepts an array of octets as the next portion of the message.
  */
-EXP_FUNC void STDCALL MD5Update(MD5_CTX* ctx, const uint8_t* msg, int len)
+EXP_FUNC void STDCALL MD5Update(MD5_CTX *ctx, const uint8_t * msg, int len)
 {
     uint32_t x;
-    int      i, partLen;
+    int i, partLen;
 
     /* Compute number of bytes mod 64 */
     x = (uint32_t)((ctx->count[0] >> 3) & 0x3F);
@@ -149,7 +147,7 @@ EXP_FUNC void STDCALL MD5Update(MD5_CTX* ctx, const uint8_t* msg, int len)
     partLen = 64 - x;
 
     /* Transform as many times as possible.  */
-    if (len >= partLen)
+    if (len >= partLen) 
     {
         memcpy(&ctx->buffer[x], msg, partLen);
         MD5Transform(ctx->state, ctx->buffer);
@@ -163,15 +161,15 @@ EXP_FUNC void STDCALL MD5Update(MD5_CTX* ctx, const uint8_t* msg, int len)
         i = 0;
 
     /* Buffer remaining input */
-    memcpy(&ctx->buffer[x], &msg[i], len - i);
+    memcpy(&ctx->buffer[x], &msg[i], len-i);
 }
 
 /**
  * Return the 128-bit message digest into the user's array
  */
-EXP_FUNC void STDCALL MD5Final(uint8_t* digest, MD5_CTX* ctx)
+EXP_FUNC void STDCALL MD5Final(uint8_t *digest, MD5_CTX *ctx)
 {
-    uint8_t  bits[8];
+    uint8_t bits[8];
     uint32_t x, padLen;
 
     /* Save number of bits */
@@ -179,7 +177,7 @@ EXP_FUNC void STDCALL MD5Final(uint8_t* digest, MD5_CTX* ctx)
 
     /* Pad out to 56 mod 64.
      */
-    x      = (uint32_t)((ctx->count[0] >> 3) & 0x3f);
+    x = (uint32_t)((ctx->count[0] >> 3) & 0x3f);
     padLen = (x < 56) ? (56 - x) : (120 - x);
     MD5Update(ctx, PADDING, padLen);
 
@@ -195,82 +193,82 @@ EXP_FUNC void STDCALL MD5Final(uint8_t* digest, MD5_CTX* ctx)
  */
 static void MD5Transform(uint32_t state[4], const uint8_t block[64])
 {
-    uint32_t a = state[0], b = state[1], c = state[2],
+    uint32_t a = state[0], b = state[1], c = state[2], 
              d = state[3], x[MD5_SIZE];
 
     Decode(x, block, 64);
 
     /* Round 1 */
-    FF(a, b, c, d, x[0], S11, 0xd76aa478);  /* 1 */
-    FF(d, a, b, c, x[1], S12, 0xe8c7b756);  /* 2 */
-    FF(c, d, a, b, x[2], S13, 0x242070db);  /* 3 */
-    FF(b, c, d, a, x[3], S14, 0xc1bdceee);  /* 4 */
-    FF(a, b, c, d, x[4], S11, 0xf57c0faf);  /* 5 */
-    FF(d, a, b, c, x[5], S12, 0x4787c62a);  /* 6 */
-    FF(c, d, a, b, x[6], S13, 0xa8304613);  /* 7 */
-    FF(b, c, d, a, x[7], S14, 0xfd469501);  /* 8 */
-    FF(a, b, c, d, x[8], S11, 0x698098d8);  /* 9 */
-    FF(d, a, b, c, x[9], S12, 0x8b44f7af);  /* 10 */
-    FF(c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
-    FF(b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
-    FF(a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
-    FF(d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
-    FF(c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
-    FF(b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
+    FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
+    FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
+    FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
+    FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
+    FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
+    FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
+    FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
+    FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
+    FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
+    FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
+    FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
+    FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
+    FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
+    FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
+    FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
+    FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
 
     /* Round 2 */
-    GG(a, b, c, d, x[1], S21, 0xf61e2562);  /* 17 */
-    GG(d, a, b, c, x[6], S22, 0xc040b340);  /* 18 */
-    GG(c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
-    GG(b, c, d, a, x[0], S24, 0xe9b6c7aa);  /* 20 */
-    GG(a, b, c, d, x[5], S21, 0xd62f105d);  /* 21 */
-    GG(d, a, b, c, x[10], S22, 0x2441453);  /* 22 */
-    GG(c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
-    GG(b, c, d, a, x[4], S24, 0xe7d3fbc8);  /* 24 */
-    GG(a, b, c, d, x[9], S21, 0x21e1cde6);  /* 25 */
-    GG(d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
-    GG(c, d, a, b, x[3], S23, 0xf4d50d87);  /* 27 */
-    GG(b, c, d, a, x[8], S24, 0x455a14ed);  /* 28 */
-    GG(a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
-    GG(d, a, b, c, x[2], S22, 0xfcefa3f8);  /* 30 */
-    GG(c, d, a, b, x[7], S23, 0x676f02d9);  /* 31 */
-    GG(b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
+    GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
+    GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
+    GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
+    GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
+    GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
+    GG (d, a, b, c, x[10], S22,  0x2441453); /* 22 */
+    GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
+    GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
+    GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
+    GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
+    GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
+    GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
+    GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
+    GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
+    GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
+    GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
 
     /* Round 3 */
-    HH(a, b, c, d, x[5], S31, 0xfffa3942);  /* 33 */
-    HH(d, a, b, c, x[8], S32, 0x8771f681);  /* 34 */
-    HH(c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
-    HH(b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
-    HH(a, b, c, d, x[1], S31, 0xa4beea44);  /* 37 */
-    HH(d, a, b, c, x[4], S32, 0x4bdecfa9);  /* 38 */
-    HH(c, d, a, b, x[7], S33, 0xf6bb4b60);  /* 39 */
-    HH(b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
-    HH(a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
-    HH(d, a, b, c, x[0], S32, 0xeaa127fa);  /* 42 */
-    HH(c, d, a, b, x[3], S33, 0xd4ef3085);  /* 43 */
-    HH(b, c, d, a, x[6], S34, 0x4881d05);   /* 44 */
-    HH(a, b, c, d, x[9], S31, 0xd9d4d039);  /* 45 */
-    HH(d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
-    HH(c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
-    HH(b, c, d, a, x[2], S34, 0xc4ac5665);  /* 48 */
+    HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
+    HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
+    HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
+    HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
+    HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
+    HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
+    HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
+    HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
+    HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
+    HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
+    HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
+    HH (b, c, d, a, x[ 6], S34,  0x4881d05); /* 44 */
+    HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
+    HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
+    HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
+    HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
 
     /* Round 4 */
-    II(a, b, c, d, x[0], S41, 0xf4292244);  /* 49 */
-    II(d, a, b, c, x[7], S42, 0x432aff97);  /* 50 */
-    II(c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
-    II(b, c, d, a, x[5], S44, 0xfc93a039);  /* 52 */
-    II(a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
-    II(d, a, b, c, x[3], S42, 0x8f0ccc92);  /* 54 */
-    II(c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
-    II(b, c, d, a, x[1], S44, 0x85845dd1);  /* 56 */
-    II(a, b, c, d, x[8], S41, 0x6fa87e4f);  /* 57 */
-    II(d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
-    II(c, d, a, b, x[6], S43, 0xa3014314);  /* 59 */
-    II(b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
-    II(a, b, c, d, x[4], S41, 0xf7537e82);  /* 61 */
-    II(d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
-    II(c, d, a, b, x[2], S43, 0x2ad7d2bb);  /* 63 */
-    II(b, c, d, a, x[9], S44, 0xeb86d391);  /* 64 */
+    II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
+    II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
+    II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
+    II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
+    II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
+    II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
+    II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
+    II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
+    II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
+    II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
+    II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
+    II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
+    II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
+    II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
+    II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
+    II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
 
     state[0] += a;
     state[1] += b;
@@ -282,16 +280,16 @@ static void MD5Transform(uint32_t state[4], const uint8_t block[64])
  * Encodes input (uint32_t) into output (uint8_t). Assumes len is
  *   a multiple of 4.
  */
-static void Encode(uint8_t* output, uint32_t* input, uint32_t len)
+static void Encode(uint8_t *output, uint32_t *input, uint32_t len)
 {
     uint32_t i, j;
 
-    for (i = 0, j = 0; j < len; i++, j += 4)
+    for (i = 0, j = 0; j < len; i++, j += 4) 
     {
-        output[j]     = (uint8_t)(input[i] & 0xff);
-        output[j + 1] = (uint8_t)((input[i] >> 8) & 0xff);
-        output[j + 2] = (uint8_t)((input[i] >> 16) & 0xff);
-        output[j + 3] = (uint8_t)((input[i] >> 24) & 0xff);
+        output[j] = (uint8_t)(input[i] & 0xff);
+        output[j+1] = (uint8_t)((input[i] >> 8) & 0xff);
+        output[j+2] = (uint8_t)((input[i] >> 16) & 0xff);
+        output[j+3] = (uint8_t)((input[i] >> 24) & 0xff);
     }
 }
 
@@ -299,10 +297,11 @@ static void Encode(uint8_t* output, uint32_t* input, uint32_t len)
  *  Decodes input (uint8_t) into output (uint32_t). Assumes len is
  *   a multiple of 4.
  */
-static void Decode(uint32_t* output, const uint8_t* input, uint32_t len)
+static void Decode(uint32_t *output, const uint8_t *input, uint32_t len)
 {
     uint32_t i, j;
 
     for (i = 0, j = 0; j < len; i++, j += 4)
-        output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j + 1]) << 8) | (((uint32_t)input[j + 2]) << 16) | (((uint32_t)input[j + 3]) << 24);
+        output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j+1]) << 8) |
+            (((uint32_t)input[j+2]) << 16) | (((uint32_t)input[j+3]) << 24);
 }
diff --git a/tests/host/common/mock.h b/tests/host/common/mock.h
index d11714df0e..56919ee60a 100644
--- a/tests/host/common/mock.h
+++ b/tests/host/common/mock.h
@@ -30,7 +30,7 @@
 */
 
 #define CORE_MOCK 1
-#define MOCK "(mock) "  // TODO: provide common logging API instead of adding this string everywhere?
+#define MOCK "(mock) " // TODO: provide common logging API instead of adding this string everywhere?
 
 //
 
@@ -57,15 +57,15 @@
 #include <stddef.h>
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
-    // TODO: #include <stdlib_noniso.h> ?
-    char* itoa(int val, char* s, int radix);
-    char* ltoa(long val, char* s, int radix);
+// TODO: #include <stdlib_noniso.h> ?
+char* itoa (int val, char *s, int radix);
+char* ltoa (long val, char *s, int radix);
 
-    size_t strlcat(char* dst, const char* src, size_t size);
-    size_t strlcpy(char* dst, const char* src, size_t size);
+
+size_t strlcat(char *dst, const char *src, size_t size);
+size_t strlcpy(char *dst, const char *src, size_t size);
 
 #ifdef __cplusplus
 }
@@ -74,7 +74,7 @@ extern "C"
 // exotic typedefs used in the sdk
 
 #include <stdint.h>
-typedef uint8_t  uint8;
+typedef uint8_t uint8;
 typedef uint32_t uint32;
 
 //
@@ -97,30 +97,26 @@ uint32_t esp_get_cycle_count();
 //
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 #include <osapi.h>
-    int ets_printf(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
+int ets_printf (const char* fmt, ...) __attribute__ ((format (printf, 1, 2)));
 #define os_printf_plus printf
 #define ets_vsnprintf vsnprintf
-    inline void ets_putc(char c)
-    {
-        putchar(c);
-    }
+inline void ets_putc (char c) { putchar(c); }
 
-    int mockverbose(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
+int mockverbose (const char* fmt, ...) __attribute__ ((format (printf, 1, 2)));
 
-    extern const char* host_interface;  // cmdline parameter
-    extern bool        serial_timestamp;
-    extern int         mock_port_shifter;
-    extern bool        blocking_uart;
-    extern uint32_t    global_source_address;  // 0 = INADDR_ANY by default
+extern const char* host_interface; // cmdline parameter
+extern bool serial_timestamp;
+extern int mock_port_shifter;
+extern bool blocking_uart;
+extern uint32_t global_source_address; // 0 = INADDR_ANY by default
 
 #define NO_GLOBAL_BINDING 0xffffffff
-    extern uint32_t global_ipv4_netfmt;  // selected interface addresse to bind to
+extern uint32_t global_ipv4_netfmt; // selected interface addresse to bind to
 
-    void loop_end();
+void loop_end();
 
 #ifdef __cplusplus
 }
@@ -136,42 +132,41 @@ extern "C"
 
 // uart
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
-    void uart_new_data(const int uart_nr, uint8_t data);
+void uart_new_data(const int uart_nr, uint8_t data);
 #ifdef __cplusplus
 }
 #endif
 
 // tcp
-int     mockSockSetup(int sock);
-int     mockConnect(uint32_t addr, int& sock, int port);
-ssize_t mockFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize);
-ssize_t mockPeekBytes(int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
-ssize_t mockRead(int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
-ssize_t mockWrite(int sock, const uint8_t* data, size_t size, int timeout_ms);
-int     serverAccept(int sock);
+int    mockSockSetup  (int sock);
+int    mockConnect    (uint32_t addr, int& sock, int port);
+ssize_t mockFillInBuf (int sock, char* ccinbuf, size_t& ccinbufsize);
+ssize_t mockPeekBytes (int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
+ssize_t mockRead      (int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
+ssize_t mockWrite     (int sock, const uint8_t* data, size_t size, int timeout_ms);
+int serverAccept (int sock);
 
 // udp
-void   check_incoming_udp();
-int    mockUDPSocket();
-bool   mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast = 0);
-size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port);
-size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
-size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
-size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port);
-void   mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize);
+void check_incoming_udp ();
+int mockUDPSocket ();
+bool mockUDPListen (int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast = 0);
+size_t mockUDPFillInBuf (int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port);
+size_t mockUDPPeekBytes (int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
+size_t mockUDPRead (int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
+size_t mockUDPWrite (int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port);
+void mockUDPSwallow (size_t copied, char* ccinbuf, size_t& ccinbufsize);
 
 class UdpContext;
-void register_udp(int sock, UdpContext* udp = nullptr);
+void register_udp (int sock, UdpContext* udp = nullptr);
 
 //
 
-void mock_start_spiffs(const String& fname, size_t size_kb, size_t block_kb = 8, size_t page_b = 512);
-void mock_stop_spiffs();
-void mock_start_littlefs(const String& fname, size_t size_kb, size_t block_kb = 8, size_t page_b = 512);
-void mock_stop_littlefs();
+void mock_start_spiffs (const String& fname, size_t size_kb, size_t block_kb = 8, size_t page_b = 512);
+void mock_stop_spiffs ();
+void mock_start_littlefs (const String& fname, size_t size_kb, size_t block_kb = 8, size_t page_b = 512);
+void mock_stop_littlefs ();
 
 //
 
@@ -179,4 +174,4 @@ void mock_stop_littlefs();
 
 //
 
-#endif  // __cplusplus
+#endif // __cplusplus
diff --git a/tests/host/common/noniso.c b/tests/host/common/noniso.c
index e1ed3f1b67..869a4b7f8e 100644
--- a/tests/host/common/noniso.c
+++ b/tests/host/common/noniso.c
@@ -13,6 +13,7 @@
  all copies or substantial portions of the Software.
 */
 
+
 #include <stdlib.h>
 #include <string.h>
 #include <stdbool.h>
@@ -20,69 +21,61 @@
 #include <math.h>
 #include "stdlib_noniso.h"
 
-void reverse(char* begin, char* end)
-{
-    char* is = begin;
-    char* ie = end - 1;
-    while (is < ie)
-    {
+
+void reverse(char* begin, char* end) {
+    char *is = begin;
+    char *ie = end - 1;
+    while(is < ie) {
         char tmp = *ie;
-        *ie      = *is;
-        *is      = tmp;
+        *ie = *is;
+        *is = tmp;
         ++is;
         --ie;
     }
 }
 
-char* utoa(unsigned value, char* result, int base)
-{
-    if (base < 2 || base > 16)
-    {
+char* utoa(unsigned value, char* result, int base) {
+    if(base < 2 || base > 16) {
         *result = 0;
         return result;
     }
 
-    char*    out      = result;
+    char* out = result;
     unsigned quotient = value;
 
-    do
-    {
+    do {
         const unsigned tmp = quotient / base;
-        *out               = "0123456789abcdef"[quotient - (tmp * base)];
+        *out = "0123456789abcdef"[quotient - (tmp * base)];
         ++out;
         quotient = tmp;
-    } while (quotient);
+    } while(quotient);
 
     reverse(result, out);
     *out = 0;
     return result;
 }
 
-char* itoa(int value, char* result, int base)
-{
-    if (base < 2 || base > 16)
-    {
+char* itoa(int value, char* result, int base) {
+    if(base < 2 || base > 16) {
         *result = 0;
         return result;
     }
-    if (base != 10)
-    {
-        return utoa((unsigned)value, result, base);
-    }
+    if (base != 10) {
+	return utoa((unsigned)value, result, base);
+   }
 
-    char* out      = result;
-    int   quotient = abs(value);
+    char* out = result;
+    int quotient = abs(value);
 
-    do
-    {
+    do {
         const int tmp = quotient / base;
-        *out          = "0123456789abcdef"[quotient - (tmp * base)];
+        *out = "0123456789abcdef"[quotient - (tmp * base)];
         ++out;
         quotient = tmp;
-    } while (quotient);
+    } while(quotient);
 
     // Apply negative sign
-    if (value < 0)
+    if(value < 0)
         *out++ = '-';
 
     reverse(result, out);
@@ -90,19 +83,17 @@ char* itoa(int value, char* result, int base)
     return result;
 }
 
-int atoi(const char* s)
-{
-    return (int)atol(s);
+int atoi(const char* s) {
+    return (int) atol(s);
 }
 
-long atol(const char* s)
-{
-    char* tmp;
+long atol(const char* s) {
+    char * tmp;
     return strtol(s, &tmp, 10);
 }
 
-double atof(const char* s)
-{
-    char* tmp;
+double atof(const char* s) {
+    char * tmp;
     return strtod(s, &tmp);
 }
+
diff --git a/tests/host/common/pins_arduino.h b/tests/host/common/pins_arduino.h
index c3a66453b7..ad051ed24a 100644
--- a/tests/host/common/pins_arduino.h
+++ b/tests/host/common/pins_arduino.h
@@ -15,4 +15,5 @@
 #ifndef pins_arduino_h
 #define pins_arduino_h
 
+
 #endif /* pins_arduino_h */
diff --git a/tests/host/common/queue.h b/tests/host/common/queue.h
index 6d7e015045..af637ca030 100644
--- a/tests/host/common/queue.h
+++ b/tests/host/common/queue.h
@@ -35,9 +35,9 @@
  */
 
 #ifndef _SYS_QUEUE_H_
-#define _SYS_QUEUE_H_
+#define	_SYS_QUEUE_H_
 
-#include <machine/ansi.h> /* for __offsetof */
+#include <machine/ansi.h>	/* for __offsetof */
 
 /*
  * This file defines four types of data structures: singly-linked lists,
@@ -106,382 +106,322 @@
 /*
  * Singly-linked List declarations.
  */
-#define SLIST_HEAD(name, type)                      \
-    struct name                                     \
-    {                                               \
-        struct type* slh_first; /* first element */ \
-    }
-
-#define SLIST_HEAD_INITIALIZER(head) \
-    {                                \
-        NULL                         \
-    }
-
-#define SLIST_ENTRY(type)                         \
-    struct                                        \
-    {                                             \
-        struct type* sle_next; /* next element */ \
-    }
+#define	SLIST_HEAD(name, type)						\
+struct name {								\
+	struct type *slh_first;	/* first element */			\
+}
 
+#define	SLIST_HEAD_INITIALIZER(head)					\
+	{ NULL }
+ 
+#define	SLIST_ENTRY(type)						\
+struct {								\
+	struct type *sle_next;	/* next element */			\
+}
+ 
 /*
  * Singly-linked List functions.
  */
-#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
-
-#define SLIST_FIRST(head) ((head)->slh_first)
-
-#define SLIST_FOREACH(var, head, field) \
-    for ((var) = SLIST_FIRST((head));   \
-         (var);                         \
-         (var) = SLIST_NEXT((var), field))
-
-#define SLIST_INIT(head)            \
-    do                              \
-    {                               \
-        SLIST_FIRST((head)) = NULL; \
-    } while (0)
-
-#define SLIST_INSERT_AFTER(slistelm, elm, field)                       \
-    do                                                                 \
-    {                                                                  \
-        SLIST_NEXT((elm), field)      = SLIST_NEXT((slistelm), field); \
-        SLIST_NEXT((slistelm), field) = (elm);                         \
-    } while (0)
-
-#define SLIST_INSERT_HEAD(head, elm, field)             \
-    do                                                  \
-    {                                                   \
-        SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
-        SLIST_FIRST((head))      = (elm);               \
-    } while (0)
-
-#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
-
-#define SLIST_REMOVE(head, elm, type, field)                                          \
-    do                                                                                \
-    {                                                                                 \
-        if (SLIST_FIRST((head)) == (elm))                                             \
-        {                                                                             \
-            SLIST_REMOVE_HEAD((head), field);                                         \
-        }                                                                             \
-        else                                                                          \
-        {                                                                             \
-            struct type* curelm = SLIST_FIRST((head));                                \
-            while (SLIST_NEXT(curelm, field) != (elm))                                \
-                curelm = SLIST_NEXT(curelm, field);                                   \
-            SLIST_NEXT(curelm, field) = SLIST_NEXT(SLIST_NEXT(curelm, field), field); \
-        }                                                                             \
-    } while (0)
-
-#define SLIST_REMOVE_HEAD(head, field)                                \
-    do                                                                \
-    {                                                                 \
-        SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
-    } while (0)
+#define	SLIST_EMPTY(head)	((head)->slh_first == NULL)
+
+#define	SLIST_FIRST(head)	((head)->slh_first)
+
+#define	SLIST_FOREACH(var, head, field)					\
+	for ((var) = SLIST_FIRST((head));				\
+	    (var);							\
+	    (var) = SLIST_NEXT((var), field))
+
+#define	SLIST_INIT(head) do {						\
+	SLIST_FIRST((head)) = NULL;					\
+} while (0)
+
+#define	SLIST_INSERT_AFTER(slistelm, elm, field) do {			\
+	SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field);	\
+	SLIST_NEXT((slistelm), field) = (elm);				\
+} while (0)
+
+#define	SLIST_INSERT_HEAD(head, elm, field) do {			\
+	SLIST_NEXT((elm), field) = SLIST_FIRST((head));			\
+	SLIST_FIRST((head)) = (elm);					\
+} while (0)
+
+#define	SLIST_NEXT(elm, field)	((elm)->field.sle_next)
+
+#define	SLIST_REMOVE(head, elm, type, field) do {			\
+	if (SLIST_FIRST((head)) == (elm)) {				\
+		SLIST_REMOVE_HEAD((head), field);			\
+	}								\
+	else {								\
+		struct type *curelm = SLIST_FIRST((head));		\
+		while (SLIST_NEXT(curelm, field) != (elm))		\
+			curelm = SLIST_NEXT(curelm, field);		\
+		SLIST_NEXT(curelm, field) =				\
+		    SLIST_NEXT(SLIST_NEXT(curelm, field), field);	\
+	}								\
+} while (0)
+
+#define	SLIST_REMOVE_HEAD(head, field) do {				\
+	SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field);	\
+} while (0)
 
 /*
  * Singly-linked Tail queue declarations.
  */
-#define STAILQ_HEAD(name, type)                                   \
-    struct name                                                   \
-    {                                                             \
-        struct type*  stqh_first; /* first element */             \
-        struct type** stqh_last;  /* addr of last next element */ \
-    }
-
-#define STAILQ_HEAD_INITIALIZER(head) \
-    {                                 \
-        NULL, &(head).stqh_first      \
-    }
-
-#define STAILQ_ENTRY(type)                         \
-    struct                                         \
-    {                                              \
-        struct type* stqe_next; /* next element */ \
-    }
+#define	STAILQ_HEAD(name, type)						\
+struct name {								\
+	struct type *stqh_first;/* first element */			\
+	struct type **stqh_last;/* addr of last next element */		\
+}
+
+#define	STAILQ_HEAD_INITIALIZER(head)					\
+	{ NULL, &(head).stqh_first }
+
+#define	STAILQ_ENTRY(type)						\
+struct {								\
+	struct type *stqe_next;	/* next element */			\
+}
 
 /*
  * Singly-linked Tail queue functions.
  */
-#define STAILQ_CONCAT(head1, head2)                    \
-    do                                                 \
-    {                                                  \
-        if (!STAILQ_EMPTY((head2)))                    \
-        {                                              \
-            *(head1)->stqh_last = (head2)->stqh_first; \
-            (head1)->stqh_last  = (head2)->stqh_last;  \
-            STAILQ_INIT((head2));                      \
-        }                                              \
-    } while (0)
-
-#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
-
-#define STAILQ_FIRST(head) ((head)->stqh_first)
-
-#define STAILQ_FOREACH(var, head, field) \
-    for ((var) = STAILQ_FIRST((head));   \
-         (var);                          \
-         (var) = STAILQ_NEXT((var), field))
-
-#define STAILQ_INIT(head)                             \
-    do                                                \
-    {                                                 \
-        STAILQ_FIRST((head)) = NULL;                  \
-        (head)->stqh_last    = &STAILQ_FIRST((head)); \
-    } while (0)
-
-#define STAILQ_INSERT_AFTER(head, tqelm, elm, field)                           \
-    do                                                                         \
-    {                                                                          \
-        if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL) \
-            (head)->stqh_last = &STAILQ_NEXT((elm), field);                    \
-        STAILQ_NEXT((tqelm), field) = (elm);                                   \
-    } while (0)
-
-#define STAILQ_INSERT_HEAD(head, elm, field)                            \
-    do                                                                  \
-    {                                                                   \
-        if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
-            (head)->stqh_last = &STAILQ_NEXT((elm), field);             \
-        STAILQ_FIRST((head)) = (elm);                                   \
-    } while (0)
-
-#define STAILQ_INSERT_TAIL(head, elm, field)                    \
-    do                                                          \
-    {                                                           \
-        STAILQ_NEXT((elm), field) = NULL;                       \
-        *(head)->stqh_last        = (elm);                      \
-        (head)->stqh_last         = &STAILQ_NEXT((elm), field); \
-    } while (0)
-
-#define STAILQ_LAST(head, type, field) \
-    (STAILQ_EMPTY((head)) ? NULL : ((struct type*)((char*)((head)->stqh_last) - __offsetof(struct type, field))))
-
-#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
-
-#define STAILQ_REMOVE(head, elm, type, field)                                                          \
-    do                                                                                                 \
-    {                                                                                                  \
-        if (STAILQ_FIRST((head)) == (elm))                                                             \
-        {                                                                                              \
-            STAILQ_REMOVE_HEAD((head), field);                                                         \
-        }                                                                                              \
-        else                                                                                           \
-        {                                                                                              \
-            struct type* curelm = STAILQ_FIRST((head));                                                \
-            while (STAILQ_NEXT(curelm, field) != (elm))                                                \
-                curelm = STAILQ_NEXT(curelm, field);                                                   \
-            if ((STAILQ_NEXT(curelm, field) = STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL) \
-                (head)->stqh_last = &STAILQ_NEXT((curelm), field);                                     \
-        }                                                                                              \
-    } while (0)
-
-#define STAILQ_REMOVE_HEAD(head, field)                                                \
-    do                                                                                 \
-    {                                                                                  \
-        if ((STAILQ_FIRST((head)) = STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
-            (head)->stqh_last = &STAILQ_FIRST((head));                                 \
-    } while (0)
-
-#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field)                      \
-    do                                                                  \
-    {                                                                   \
-        if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \
-            (head)->stqh_last = &STAILQ_FIRST((head));                  \
-    } while (0)
+#define	STAILQ_CONCAT(head1, head2) do {				\
+	if (!STAILQ_EMPTY((head2))) {					\
+		*(head1)->stqh_last = (head2)->stqh_first;		\
+		(head1)->stqh_last = (head2)->stqh_last;		\
+		STAILQ_INIT((head2));					\
+	}								\
+} while (0)
+
+#define	STAILQ_EMPTY(head)	((head)->stqh_first == NULL)
+
+#define	STAILQ_FIRST(head)	((head)->stqh_first)
+
+#define	STAILQ_FOREACH(var, head, field)				\
+	for((var) = STAILQ_FIRST((head));				\
+	   (var);							\
+	   (var) = STAILQ_NEXT((var), field))
+
+#define	STAILQ_INIT(head) do {						\
+	STAILQ_FIRST((head)) = NULL;					\
+	(head)->stqh_last = &STAILQ_FIRST((head));			\
+} while (0)
+
+#define	STAILQ_INSERT_AFTER(head, tqelm, elm, field) do {		\
+	if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
+		(head)->stqh_last = &STAILQ_NEXT((elm), field);		\
+	STAILQ_NEXT((tqelm), field) = (elm);				\
+} while (0)
+
+#define	STAILQ_INSERT_HEAD(head, elm, field) do {			\
+	if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL)	\
+		(head)->stqh_last = &STAILQ_NEXT((elm), field);		\
+	STAILQ_FIRST((head)) = (elm);					\
+} while (0)
+
+#define	STAILQ_INSERT_TAIL(head, elm, field) do {			\
+	STAILQ_NEXT((elm), field) = NULL;				\
+	*(head)->stqh_last = (elm);					\
+	(head)->stqh_last = &STAILQ_NEXT((elm), field);			\
+} while (0)
+
+#define	STAILQ_LAST(head, type, field)					\
+	(STAILQ_EMPTY((head)) ?						\
+		NULL :							\
+	        ((struct type *)					\
+		((char *)((head)->stqh_last) - __offsetof(struct type, field))))
+
+#define	STAILQ_NEXT(elm, field)	((elm)->field.stqe_next)
+
+#define	STAILQ_REMOVE(head, elm, type, field) do {			\
+	if (STAILQ_FIRST((head)) == (elm)) {				\
+		STAILQ_REMOVE_HEAD((head), field);			\
+	}								\
+	else {								\
+		struct type *curelm = STAILQ_FIRST((head));		\
+		while (STAILQ_NEXT(curelm, field) != (elm))		\
+			curelm = STAILQ_NEXT(curelm, field);		\
+		if ((STAILQ_NEXT(curelm, field) =			\
+		     STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL)\
+			(head)->stqh_last = &STAILQ_NEXT((curelm), field);\
+	}								\
+} while (0)
+
+#define	STAILQ_REMOVE_HEAD(head, field) do {				\
+	if ((STAILQ_FIRST((head)) =					\
+	     STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL)		\
+		(head)->stqh_last = &STAILQ_FIRST((head));		\
+} while (0)
+
+#define	STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do {			\
+	if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL)	\
+		(head)->stqh_last = &STAILQ_FIRST((head));		\
+} while (0)
 
 /*
  * List declarations.
  */
-#define LIST_HEAD(name, type)                      \
-    struct name                                    \
-    {                                              \
-        struct type* lh_first; /* first element */ \
-    }
-
-#define LIST_HEAD_INITIALIZER(head) \
-    {                               \
-        NULL                        \
-    }
-
-#define LIST_ENTRY(type)                                              \
-    struct                                                            \
-    {                                                                 \
-        struct type*  le_next; /* next element */                     \
-        struct type** le_prev; /* address of previous next element */ \
-    }
+#define	LIST_HEAD(name, type)						\
+struct name {								\
+	struct type *lh_first;	/* first element */			\
+}
+
+#define	LIST_HEAD_INITIALIZER(head)					\
+	{ NULL }
+
+#define	LIST_ENTRY(type)						\
+struct {								\
+	struct type *le_next;	/* next element */			\
+	struct type **le_prev;	/* address of previous next element */	\
+}
 
 /*
  * List functions.
  */
 
-#define LIST_EMPTY(head) ((head)->lh_first == NULL)
-
-#define LIST_FIRST(head) ((head)->lh_first)
-
-#define LIST_FOREACH(var, head, field) \
-    for ((var) = LIST_FIRST((head));   \
-         (var);                        \
-         (var) = LIST_NEXT((var), field))
-
-#define LIST_INIT(head)            \
-    do                             \
-    {                              \
-        LIST_FIRST((head)) = NULL; \
-    } while (0)
-
-#define LIST_INSERT_AFTER(listelm, elm, field)                                     \
-    do                                                                             \
-    {                                                                              \
-        if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)       \
-            LIST_NEXT((listelm), field)->field.le_prev = &LIST_NEXT((elm), field); \
-        LIST_NEXT((listelm), field) = (elm);                                       \
-        (elm)->field.le_prev        = &LIST_NEXT((listelm), field);                \
-    } while (0)
-
-#define LIST_INSERT_BEFORE(listelm, elm, field)               \
-    do                                                        \
-    {                                                         \
-        (elm)->field.le_prev      = (listelm)->field.le_prev; \
-        LIST_NEXT((elm), field)   = (listelm);                \
-        *(listelm)->field.le_prev = (elm);                    \
-        (listelm)->field.le_prev  = &LIST_NEXT((elm), field); \
-    } while (0)
-
-#define LIST_INSERT_HEAD(head, elm, field)                                \
-    do                                                                    \
-    {                                                                     \
-        if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL)       \
-            LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field); \
-        LIST_FIRST((head))   = (elm);                                     \
-        (elm)->field.le_prev = &LIST_FIRST((head));                       \
-    } while (0)
-
-#define LIST_NEXT(elm, field) ((elm)->field.le_next)
-
-#define LIST_REMOVE(elm, field)                                            \
-    do                                                                     \
-    {                                                                      \
-        if (LIST_NEXT((elm), field) != NULL)                               \
-            LIST_NEXT((elm), field)->field.le_prev = (elm)->field.le_prev; \
-        *(elm)->field.le_prev = LIST_NEXT((elm), field);                   \
-    } while (0)
+#define	LIST_EMPTY(head)	((head)->lh_first == NULL)
+
+#define	LIST_FIRST(head)	((head)->lh_first)
+
+#define	LIST_FOREACH(var, head, field)					\
+	for ((var) = LIST_FIRST((head));				\
+	    (var);							\
+	    (var) = LIST_NEXT((var), field))
+
+#define	LIST_INIT(head) do {						\
+	LIST_FIRST((head)) = NULL;					\
+} while (0)
+
+#define	LIST_INSERT_AFTER(listelm, elm, field) do {			\
+	if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
+		LIST_NEXT((listelm), field)->field.le_prev =		\
+		    &LIST_NEXT((elm), field);				\
+	LIST_NEXT((listelm), field) = (elm);				\
+	(elm)->field.le_prev = &LIST_NEXT((listelm), field);		\
+} while (0)
+
+#define	LIST_INSERT_BEFORE(listelm, elm, field) do {			\
+	(elm)->field.le_prev = (listelm)->field.le_prev;		\
+	LIST_NEXT((elm), field) = (listelm);				\
+	*(listelm)->field.le_prev = (elm);				\
+	(listelm)->field.le_prev = &LIST_NEXT((elm), field);		\
+} while (0)
+
+#define	LIST_INSERT_HEAD(head, elm, field) do {				\
+	if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL)	\
+		LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
+	LIST_FIRST((head)) = (elm);					\
+	(elm)->field.le_prev = &LIST_FIRST((head));			\
+} while (0)
+
+#define	LIST_NEXT(elm, field)	((elm)->field.le_next)
+
+#define	LIST_REMOVE(elm, field) do {					\
+	if (LIST_NEXT((elm), field) != NULL)				\
+		LIST_NEXT((elm), field)->field.le_prev = 		\
+		    (elm)->field.le_prev;				\
+	*(elm)->field.le_prev = LIST_NEXT((elm), field);		\
+} while (0)
 
 /*
  * Tail queue declarations.
  */
-#define TAILQ_HEAD(name, type)                                   \
-    struct name                                                  \
-    {                                                            \
-        struct type*  tqh_first; /* first element */             \
-        struct type** tqh_last;  /* addr of last next element */ \
-    }
-
-#define TAILQ_HEAD_INITIALIZER(head) \
-    {                                \
-        NULL, &(head).tqh_first      \
-    }
-
-#define TAILQ_ENTRY(type)                                              \
-    struct                                                             \
-    {                                                                  \
-        struct type*  tqe_next; /* next element */                     \
-        struct type** tqe_prev; /* address of previous next element */ \
-    }
+#define	TAILQ_HEAD(name, type)						\
+struct name {								\
+	struct type *tqh_first;	/* first element */			\
+	struct type **tqh_last;	/* addr of last next element */		\
+}
+
+#define	TAILQ_HEAD_INITIALIZER(head)					\
+	{ NULL, &(head).tqh_first }
+
+#define	TAILQ_ENTRY(type)						\
+struct {								\
+	struct type *tqe_next;	/* next element */			\
+	struct type **tqe_prev;	/* address of previous next element */	\
+}
 
 /*
  * Tail queue functions.
  */
-#define TAILQ_CONCAT(head1, head2, field)                            \
-    do                                                               \
-    {                                                                \
-        if (!TAILQ_EMPTY(head2))                                     \
-        {                                                            \
-            *(head1)->tqh_last                 = (head2)->tqh_first; \
-            (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last;  \
-            (head1)->tqh_last                  = (head2)->tqh_last;  \
-            TAILQ_INIT((head2));                                     \
-        }                                                            \
-    } while (0)
-
-#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
-
-#define TAILQ_FIRST(head) ((head)->tqh_first)
-
-#define TAILQ_FOREACH(var, head, field) \
-    for ((var) = TAILQ_FIRST((head));   \
-         (var);                         \
-         (var) = TAILQ_NEXT((var), field))
-
-#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
-    for ((var) = TAILQ_LAST((head), headname);            \
-         (var);                                           \
-         (var) = TAILQ_PREV((var), headname, field))
-
-#define TAILQ_INIT(head)                            \
-    do                                              \
-    {                                               \
-        TAILQ_FIRST((head)) = NULL;                 \
-        (head)->tqh_last    = &TAILQ_FIRST((head)); \
-    } while (0)
-
-#define TAILQ_INSERT_AFTER(head, listelm, elm, field)                             \
-    do                                                                            \
-    {                                                                             \
-        if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)    \
-            TAILQ_NEXT((elm), field)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
-        else                                                                      \
-            (head)->tqh_last = &TAILQ_NEXT((elm), field);                         \
-        TAILQ_NEXT((listelm), field) = (elm);                                     \
-        (elm)->field.tqe_prev        = &TAILQ_NEXT((listelm), field);             \
-    } while (0)
-
-#define TAILQ_INSERT_BEFORE(listelm, elm, field)                \
-    do                                                          \
-    {                                                           \
-        (elm)->field.tqe_prev      = (listelm)->field.tqe_prev; \
-        TAILQ_NEXT((elm), field)   = (listelm);                 \
-        *(listelm)->field.tqe_prev = (elm);                     \
-        (listelm)->field.tqe_prev  = &TAILQ_NEXT((elm), field); \
-    } while (0)
-
-#define TAILQ_INSERT_HEAD(head, elm, field)                                  \
-    do                                                                       \
-    {                                                                        \
-        if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL)        \
-            TAILQ_FIRST((head))->field.tqe_prev = &TAILQ_NEXT((elm), field); \
-        else                                                                 \
-            (head)->tqh_last = &TAILQ_NEXT((elm), field);                    \
-        TAILQ_FIRST((head))   = (elm);                                       \
-        (elm)->field.tqe_prev = &TAILQ_FIRST((head));                        \
-    } while (0)
-
-#define TAILQ_INSERT_TAIL(head, elm, field)                   \
-    do                                                        \
-    {                                                         \
-        TAILQ_NEXT((elm), field) = NULL;                      \
-        (elm)->field.tqe_prev    = (head)->tqh_last;          \
-        *(head)->tqh_last        = (elm);                     \
-        (head)->tqh_last         = &TAILQ_NEXT((elm), field); \
-    } while (0)
-
-#define TAILQ_LAST(head, headname) \
-    (*(((struct headname*)((head)->tqh_last))->tqh_last))
-
-#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
-
-#define TAILQ_PREV(elm, headname, field) \
-    (*(((struct headname*)((elm)->field.tqe_prev))->tqh_last))
-
-#define TAILQ_REMOVE(head, elm, field)                                        \
-    do                                                                        \
-    {                                                                         \
-        if ((TAILQ_NEXT((elm), field)) != NULL)                               \
-            TAILQ_NEXT((elm), field)->field.tqe_prev = (elm)->field.tqe_prev; \
-        else                                                                  \
-            (head)->tqh_last = (elm)->field.tqe_prev;                         \
-        *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field);                    \
-    } while (0)
+#define	TAILQ_CONCAT(head1, head2, field) do {				\
+	if (!TAILQ_EMPTY(head2)) {					\
+		*(head1)->tqh_last = (head2)->tqh_first;		\
+		(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last;	\
+		(head1)->tqh_last = (head2)->tqh_last;			\
+		TAILQ_INIT((head2));					\
+	}								\
+} while (0)
+
+#define	TAILQ_EMPTY(head)	((head)->tqh_first == NULL)
+
+#define	TAILQ_FIRST(head)	((head)->tqh_first)
+
+#define	TAILQ_FOREACH(var, head, field)					\
+	for ((var) = TAILQ_FIRST((head));				\
+	    (var);							\
+	    (var) = TAILQ_NEXT((var), field))
+
+#define	TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
+	for ((var) = TAILQ_LAST((head), headname);			\
+	    (var);							\
+	    (var) = TAILQ_PREV((var), headname, field))
+
+#define	TAILQ_INIT(head) do {						\
+	TAILQ_FIRST((head)) = NULL;					\
+	(head)->tqh_last = &TAILQ_FIRST((head));			\
+} while (0)
+
+#define	TAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
+	if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
+		TAILQ_NEXT((elm), field)->field.tqe_prev = 		\
+		    &TAILQ_NEXT((elm), field);				\
+	else								\
+		(head)->tqh_last = &TAILQ_NEXT((elm), field);		\
+	TAILQ_NEXT((listelm), field) = (elm);				\
+	(elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field);		\
+} while (0)
+
+#define	TAILQ_INSERT_BEFORE(listelm, elm, field) do {			\
+	(elm)->field.tqe_prev = (listelm)->field.tqe_prev;		\
+	TAILQ_NEXT((elm), field) = (listelm);				\
+	*(listelm)->field.tqe_prev = (elm);				\
+	(listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field);		\
+} while (0)
+
+#define	TAILQ_INSERT_HEAD(head, elm, field) do {			\
+	if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL)	\
+		TAILQ_FIRST((head))->field.tqe_prev =			\
+		    &TAILQ_NEXT((elm), field);				\
+	else								\
+		(head)->tqh_last = &TAILQ_NEXT((elm), field);		\
+	TAILQ_FIRST((head)) = (elm);					\
+	(elm)->field.tqe_prev = &TAILQ_FIRST((head));			\
+} while (0)
+
+#define	TAILQ_INSERT_TAIL(head, elm, field) do {			\
+	TAILQ_NEXT((elm), field) = NULL;				\
+	(elm)->field.tqe_prev = (head)->tqh_last;			\
+	*(head)->tqh_last = (elm);					\
+	(head)->tqh_last = &TAILQ_NEXT((elm), field);			\
+} while (0)
+
+#define	TAILQ_LAST(head, headname)					\
+	(*(((struct headname *)((head)->tqh_last))->tqh_last))
+
+#define	TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+
+#define	TAILQ_PREV(elm, headname, field)				\
+	(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+
+#define	TAILQ_REMOVE(head, elm, field) do {				\
+	if ((TAILQ_NEXT((elm), field)) != NULL)				\
+		TAILQ_NEXT((elm), field)->field.tqe_prev = 		\
+		    (elm)->field.tqe_prev;				\
+	else								\
+		(head)->tqh_last = (elm)->field.tqe_prev;		\
+	*(elm)->field.tqe_prev = TAILQ_NEXT((elm), field);		\
+} while (0)
+
 
 #ifdef _KERNEL
 
@@ -490,40 +430,39 @@
  * They bogusly assumes that all queue heads look alike.
  */
 
-struct quehead
-{
-    struct quehead* qh_link;
-    struct quehead* qh_rlink;
+struct quehead {
+	struct quehead *qh_link;
+	struct quehead *qh_rlink;
 };
 
-#ifdef __GNUC__
+#ifdef	__GNUC__
 
 static __inline void
-insque(void* a, void* b)
+insque(void *a, void *b)
 {
-    struct quehead *element = (struct quehead*)a,
-                   *head    = (struct quehead*)b;
+	struct quehead *element = (struct quehead *)a,
+		 *head = (struct quehead *)b;
 
-    element->qh_link           = head->qh_link;
-    element->qh_rlink          = head;
-    head->qh_link              = element;
-    element->qh_link->qh_rlink = element;
+	element->qh_link = head->qh_link;
+	element->qh_rlink = head;
+	head->qh_link = element;
+	element->qh_link->qh_rlink = element;
 }
 
 static __inline void
-remque(void* a)
+remque(void *a)
 {
-    struct quehead* element = (struct quehead*)a;
+	struct quehead *element = (struct quehead *)a;
 
-    element->qh_link->qh_rlink = element->qh_rlink;
-    element->qh_rlink->qh_link = element->qh_link;
-    element->qh_rlink          = 0;
+	element->qh_link->qh_rlink = element->qh_rlink;
+	element->qh_rlink->qh_link = element->qh_link;
+	element->qh_rlink = 0;
 }
 
 #else /* !__GNUC__ */
 
-void insque(void* a, void* b);
-void remque(void* a);
+void	insque(void *a, void *b);
+void	remque(void *a);
 
 #endif /* __GNUC__ */
 
diff --git a/tests/host/common/spiffs_mock.cpp b/tests/host/common/spiffs_mock.cpp
index c54cab3053..c7f9f53aba 100644
--- a/tests/host/common/spiffs_mock.cpp
+++ b/tests/host/common/spiffs_mock.cpp
@@ -13,6 +13,7 @@
  all copies or substantial portions of the Software.
 */
 
+
 #include "spiffs_mock.h"
 #include "spiffs/spiffs.h"
 #include "debug.h"
@@ -71,18 +72,18 @@ SpiffsMock::~SpiffsMock()
     SPIFFS = FS(FSImplPtr(nullptr));
 }
 
-void SpiffsMock::load()
+void SpiffsMock::load ()
 {
     if (!m_fs.size() || !m_storage.length())
         return;
-
+    
     int fs = ::open(m_storage.c_str(), O_RDONLY);
     if (fs == -1)
     {
         fprintf(stderr, "SPIFFS: loading '%s': %s\n", m_storage.c_str(), strerror(errno));
         return;
     }
-
+    
     off_t flen = lseek(fs, 0, SEEK_END);
     if (flen == (off_t)-1)
     {
@@ -90,7 +91,7 @@ void SpiffsMock::load()
         return;
     }
     lseek(fs, 0, SEEK_SET);
-
+    
     if (flen != (off_t)m_fs.size())
     {
         fprintf(stderr, "SPIFFS: size of '%s': %d does not match requested size %zd\n", m_storage.c_str(), (int)flen, m_fs.size());
@@ -111,7 +112,7 @@ void SpiffsMock::load()
     ::close(fs);
 }
 
-void SpiffsMock::save()
+void SpiffsMock::save ()
 {
     if (!m_fs.size() || !m_storage.length())
         return;
@@ -131,3 +132,4 @@ void SpiffsMock::save()
 }
 
 #pragma GCC diagnostic pop
+
diff --git a/tests/host/common/spiffs_mock.h b/tests/host/common/spiffs_mock.h
index 18217a7ac5..4c265964f5 100644
--- a/tests/host/common/spiffs_mock.h
+++ b/tests/host/common/spiffs_mock.h
@@ -24,20 +24,19 @@
 
 #define DEFAULT_SPIFFS_FILE_NAME "spiffs.bin"
 
-class SpiffsMock
-{
+class SpiffsMock {
 public:
     SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString);
     void reset();
     ~SpiffsMock();
-
+    
 protected:
-    void load();
-    void save();
+    void load ();
+    void save ();
 
     std::vector<uint8_t> m_fs;
-    String               m_storage;
-    bool                 m_overwrite;
+    String m_storage;
+    bool m_overwrite;
 };
 
 #define SPIFFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage) SpiffsMock spiffs_mock(size_kb * 1024, block_kb * 1024, page_b, storage)
diff --git a/tests/host/common/user_interface.cpp b/tests/host/common/user_interface.cpp
index 3b7f1226b5..4e03d77786 100644
--- a/tests/host/common/user_interface.cpp
+++ b/tests/host/common/user_interface.cpp
@@ -43,7 +43,7 @@
 
 #include <LwipDhcpServer.h>
 
-bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
+bool DhcpServer::set_dhcps_lease(struct dhcps_lease *please)
 {
     (void)please;
     return false;
@@ -62,22 +62,22 @@ bool DhcpServer::set_dhcps_offer_option(uint8 level, void* optarg)
     return false;
 }
 
-void DhcpServer::end()
+void DhcpServer::end ()
 {
 }
 
-bool DhcpServer::begin(struct ip_info* info)
+bool DhcpServer::begin (struct ip_info *info)
 {
     (void)info;
     return false;
 }
 
-DhcpServer::DhcpServer(netif* netif)
+DhcpServer::DhcpServer (netif* netif)
 {
     (void)netif;
 }
 
-DhcpServer::~DhcpServer()
+DhcpServer::~DhcpServer ()
 {
     end();
 }
@@ -86,6 +86,7 @@ DhcpServer dhcpSoftAP(nullptr);
 
 extern "C"
 {
+
 #include <user_interface.h>
 #include <lwip/netif.h>
 
@@ -119,14 +120,14 @@ extern "C"
         return 1;
     }
 
-    bool wifi_station_get_config(struct station_config* config)
+    bool wifi_station_get_config(struct station_config *config)
     {
         strcpy((char*)config->ssid, "emulated-ssid");
         strcpy((char*)config->password, "emulated-ssid-password");
         config->bssid_set = 0;
         for (int i = 0; i < 6; i++)
             config->bssid[i] = i;
-        config->threshold.rssi     = 1;
+        config->threshold.rssi = 1;
         config->threshold.authmode = AUTH_WPA_PSK;
 #ifdef NONOSDK3V0
         config->open_and_wep_mode_disable = true;
@@ -157,21 +158,21 @@ extern "C"
         (void)type;
     }
 
-    uint32_t global_ipv4_netfmt = 0;  // global binding
+    uint32_t global_ipv4_netfmt = 0; // global binding
 
-    netif    netif0;
+    netif netif0;
     uint32_t global_source_address = INADDR_ANY;
 
-    bool wifi_get_ip_info(uint8 if_index, struct ip_info* info)
+    bool wifi_get_ip_info(uint8 if_index, struct ip_info *info)
     {
         // emulate wifi_get_ip_info()
         // ignore if_index
         // use global option -i (host_interface) to select bound interface/address
 
-        struct ifaddrs *ifAddrStruct = NULL, *ifa = NULL;
-        uint32_t        ipv4  = lwip_htonl(0x7f000001);
-        uint32_t        mask  = lwip_htonl(0xff000000);
-        global_source_address = INADDR_ANY;  // =0
+        struct ifaddrs * ifAddrStruct = NULL, * ifa = NULL;
+        uint32_t ipv4 = lwip_htonl(0x7f000001);
+        uint32_t mask = lwip_htonl(0xff000000);
+        global_source_address = INADDR_ANY; // =0
 
         if (getifaddrs(&ifAddrStruct) != 0)
         {
@@ -186,10 +187,10 @@ extern "C"
         {
             mockverbose("host: interface: %s", ifa->ifa_name);
             if (ifa->ifa_addr
-                && ifa->ifa_addr->sa_family == AF_INET  // ip_info is IPv4 only
-            )
+                    && ifa->ifa_addr->sa_family == AF_INET // ip_info is IPv4 only
+               )
             {
-                auto test_ipv4 = lwip_ntohl(*(uint32_t*)&((struct sockaddr_in*)ifa->ifa_addr)->sin_addr);
+                auto test_ipv4 = lwip_ntohl(*(uint32_t*) & ((struct sockaddr_in*)ifa->ifa_addr)->sin_addr);
                 mockverbose(" IPV4 (0x%08lx)", test_ipv4);
                 if ((test_ipv4 & 0xff000000) == 0x7f000000)
                     // 127./8
@@ -199,8 +200,8 @@ extern "C"
                     if (!host_interface || (host_interface && strcmp(ifa->ifa_name, host_interface) == 0))
                     {
                         // use the first non-local interface, or, if specified, the one selected by user on cmdline
-                        ipv4 = *(uint32_t*)&((struct sockaddr_in*)ifa->ifa_addr)->sin_addr;
-                        mask = *(uint32_t*)&((struct sockaddr_in*)ifa->ifa_netmask)->sin_addr;
+                        ipv4 = *(uint32_t*) & ((struct sockaddr_in*)ifa->ifa_addr)->sin_addr;
+                        mask = *(uint32_t*) & ((struct sockaddr_in*)ifa->ifa_netmask)->sin_addr;
                         mockverbose(" (selected)\n");
                         if (host_interface)
                             global_source_address = ntohl(ipv4);
@@ -223,15 +224,15 @@ extern "C"
 
         if (info)
         {
-            info->ip.addr      = ipv4;
+            info->ip.addr = ipv4;
             info->netmask.addr = mask;
-            info->gw.addr      = ipv4;
+            info->gw.addr = ipv4;
 
             netif0.ip_addr.addr = ipv4;
             netif0.netmask.addr = mask;
-            netif0.gw.addr      = ipv4;
-            netif0.flags        = NETIF_FLAG_IGMP | NETIF_FLAG_UP | NETIF_FLAG_LINK_UP;
-            netif0.next         = nullptr;
+            netif0.gw.addr = ipv4;
+            netif0.flags = NETIF_FLAG_IGMP | NETIF_FLAG_UP | NETIF_FLAG_LINK_UP;
+            netif0.next = nullptr;
         }
 
         return true;
@@ -242,7 +243,7 @@ extern "C"
         return 1;
     }
 
-    bool wifi_get_macaddr(uint8 if_index, uint8* macaddr)
+    bool wifi_get_macaddr(uint8 if_index, uint8 *macaddr)
     {
         (void)if_index;
         macaddr[0] = 0xde;
@@ -266,7 +267,7 @@ extern "C"
         return MIN_SLEEP_T;
     }
 
-#endif  // nonos-sdk-pre-3
+#endif // nonos-sdk-pre-3
 
     sleep_type_t wifi_get_sleep_type(void)
     {
@@ -280,13 +281,13 @@ extern "C"
     }
 
     wifi_event_handler_cb_t wifi_event_handler_cb_emu = nullptr;
-    void                    wifi_set_event_handler_cb(wifi_event_handler_cb_t cb)
+    void wifi_set_event_handler_cb(wifi_event_handler_cb_t cb)
     {
         wifi_event_handler_cb_emu = cb;
         mockverbose("TODO: wifi_set_event_handler_cb set\n");
     }
 
-    bool wifi_set_ip_info(uint8 if_index, struct ip_info* info)
+    bool wifi_set_ip_info(uint8 if_index, struct ip_info *info)
     {
         (void)if_index;
         (void)info;
@@ -351,12 +352,12 @@ extern "C"
         return true;
     }
 
-    bool wifi_station_get_config_default(struct station_config* config)
+    bool wifi_station_get_config_default(struct station_config *config)
     {
         return wifi_station_get_config(config);
     }
 
-    char        wifi_station_get_hostname_str[128];
+    char wifi_station_get_hostname_str [128];
     const char* wifi_station_get_hostname(void)
     {
         return strcpy(wifi_station_get_hostname_str, "esposix");
@@ -377,19 +378,19 @@ extern "C"
         return set != 0;
     }
 
-    bool wifi_station_set_config(struct station_config* config)
+    bool wifi_station_set_config(struct station_config *config)
     {
         (void)config;
         return true;
     }
 
-    bool wifi_station_set_config_current(struct station_config* config)
+    bool wifi_station_set_config_current(struct station_config *config)
     {
         (void)config;
         return true;
     }
 
-    bool wifi_station_set_hostname(const char* name)
+    bool wifi_station_set_hostname(const char *name)
     {
         (void)name;
         return true;
@@ -421,20 +422,20 @@ extern "C"
         return true;
     }
 
-    bool wifi_softap_get_config(struct softap_config* config)
+    bool wifi_softap_get_config(struct softap_config *config)
     {
         strcpy((char*)config->ssid, "apssid");
         strcpy((char*)config->password, "appasswd");
-        config->ssid_len        = strlen("appasswd");
-        config->channel         = 1;
-        config->authmode        = AUTH_WPA2_PSK;
-        config->ssid_hidden     = 0;
-        config->max_connection  = 4;
+        config->ssid_len = strlen("appasswd");
+        config->channel = 1;
+        config->authmode = AUTH_WPA2_PSK;
+        config->ssid_hidden = 0;
+        config->max_connection = 4;
         config->beacon_interval = 100;
         return true;
     }
 
-    bool wifi_softap_get_config_default(struct softap_config* config)
+    bool wifi_softap_get_config_default(struct softap_config *config)
     {
         return wifi_softap_get_config(config);
     }
@@ -444,19 +445,19 @@ extern "C"
         return 2;
     }
 
-    bool wifi_softap_set_config(struct softap_config* config)
+    bool wifi_softap_set_config(struct softap_config *config)
     {
         (void)config;
         return true;
     }
 
-    bool wifi_softap_set_config_current(struct softap_config* config)
+    bool wifi_softap_set_config_current(struct softap_config *config)
     {
         (void)config;
         return true;
     }
 
-    bool wifi_softap_set_dhcps_lease(struct dhcps_lease* please)
+    bool wifi_softap_set_dhcps_lease(struct dhcps_lease *please)
     {
         (void)please;
         return true;
@@ -475,7 +476,7 @@ extern "C"
         return true;
     }
 
-    bool wifi_station_scan(struct scan_config* config, scan_done_cb_t cb)
+    bool wifi_station_scan(struct scan_config *config, scan_done_cb_t cb)
     {
         (void)config;
         cb(nullptr, FAIL);
@@ -497,7 +498,7 @@ extern "C"
         (void)intr;
     }
 
-    void dns_setserver(u8_t numdns, ip_addr_t* dnsserver)
+    void dns_setserver(u8_t numdns, ip_addr_t *dnsserver)
     {
         (void)numdns;
         (void)dnsserver;
@@ -510,6 +511,7 @@ extern "C"
         return addr;
     }
 
+
 #include <smartconfig.h>
     bool smartconfig_start(sc_callback_t cb, ...)
     {
@@ -528,4 +530,4 @@ extern "C"
         return NONE_SLEEP_T;
     }
 
-}  // extern "C"
+} // extern "C"
diff --git a/tests/host/core/test_PolledTimeout.cpp b/tests/host/core/test_PolledTimeout.cpp
index b03a2af624..37b31d8544 100644
--- a/tests/host/core/test_PolledTimeout.cpp
+++ b/tests/host/core/test_PolledTimeout.cpp
@@ -2,240 +2,245 @@
 #include "PolledTimeout.h"
 
 #define mockverbose printf
-#include "common/MockEsp.cpp"  // getCycleCount
+#include "common/MockEsp.cpp" // getCycleCount
 
 //This won't work for
-template <typename argT>
+template<typename argT>
 inline bool
 fuzzycomp(argT a, argT b)
 {
-    const argT epsilon = 10;
-    return (std::max(a, b) - std::min(a, b) <= epsilon);
+  const argT epsilon = 10;
+  return (std::max(a,b) - std::min(a,b) <= epsilon);
 }
 
 TEST_CASE("OneShot Timeout 500000000ns (0.5s)", "[polledTimeout]")
 {
-    using esp8266::polledTimeout::oneShotFastNs;
-    using timeType = oneShotFastNs::timeType;
-    timeType before, after, delta;
+  using esp8266::polledTimeout::oneShotFastNs;
+  using timeType = oneShotFastNs::timeType;
+  timeType before, after, delta;
 
-    Serial.println("OneShot Timeout 500000000ns (0.5s)");
+  Serial.println("OneShot Timeout 500000000ns (0.5s)");
 
-    oneShotFastNs timeout(500000000);
-    before = micros();
-    while (!timeout.expired())
-        yield();
-    after = micros();
+  oneShotFastNs timeout(500000000);
+  before = micros();
+  while(!timeout.expired())
+    yield();
+  after = micros();
 
-    delta = after - before;
-    Serial.printf("delta = %u\n", delta);
+  delta = after - before;
+  Serial.printf("delta = %u\n", delta);
 
-    REQUIRE(fuzzycomp(delta / 1000, (timeType)500));
+  REQUIRE(fuzzycomp(delta/1000, (timeType)500));
 
-    Serial.print("reset\n");
 
-    timeout.reset();
-    before = micros();
-    while (!timeout)
-        yield();
-    after = micros();
+  Serial.print("reset\n");
 
-    delta = after - before;
-    Serial.printf("delta = %u\n", delta);
+  timeout.reset();
+  before = micros();
+  while(!timeout)
+    yield();
+  after = micros();
 
-    REQUIRE(fuzzycomp(delta / 1000, (timeType)500));
+  delta = after - before;
+  Serial.printf("delta = %u\n", delta);
+
+  REQUIRE(fuzzycomp(delta/1000, (timeType)500));
 }
 
 TEST_CASE("OneShot Timeout 3000000us", "[polledTimeout]")
 {
-    using esp8266::polledTimeout::oneShotFastUs;
-    using timeType = oneShotFastUs::timeType;
-    timeType before, after, delta;
+  using esp8266::polledTimeout::oneShotFastUs;
+  using timeType = oneShotFastUs::timeType;
+  timeType before, after, delta;
+
+  Serial.println("OneShot Timeout 3000000us");
 
-    Serial.println("OneShot Timeout 3000000us");
+  oneShotFastUs timeout(3000000);
+  before = micros();
+  while(!timeout.expired())
+    yield();
+  after = micros();
 
-    oneShotFastUs timeout(3000000);
-    before = micros();
-    while (!timeout.expired())
-        yield();
-    after = micros();
+  delta = after - before;
+  Serial.printf("delta = %u\n", delta);
 
-    delta = after - before;
-    Serial.printf("delta = %u\n", delta);
+  REQUIRE(fuzzycomp(delta/1000, (timeType)3000));
 
-    REQUIRE(fuzzycomp(delta / 1000, (timeType)3000));
 
-    Serial.print("reset\n");
+  Serial.print("reset\n");
 
-    timeout.reset();
-    before = micros();
-    while (!timeout)
-        yield();
-    after = micros();
+  timeout.reset();
+  before = micros();
+  while(!timeout)
+    yield();
+  after = micros();
 
-    delta = after - before;
-    Serial.printf("delta = %u\n", delta);
+  delta = after - before;
+  Serial.printf("delta = %u\n", delta);
 
-    REQUIRE(fuzzycomp(delta / 1000, (timeType)3000));
+  REQUIRE(fuzzycomp(delta/1000, (timeType)3000));
 }
 
 TEST_CASE("OneShot Timeout 3000ms", "[polledTimeout]")
 {
-    using esp8266::polledTimeout::oneShotMs;
-    using timeType = oneShotMs::timeType;
-    timeType before, after, delta;
+  using esp8266::polledTimeout::oneShotMs;
+  using timeType = oneShotMs::timeType;
+  timeType before, after, delta;
 
-    Serial.println("OneShot Timeout 3000ms");
+  Serial.println("OneShot Timeout 3000ms");
 
-    oneShotMs timeout(3000);
-    before = millis();
-    while (!timeout.expired())
-        yield();
-    after = millis();
+  oneShotMs timeout(3000);
+  before = millis();
+  while(!timeout.expired())
+    yield();
+  after = millis();
 
-    delta = after - before;
-    Serial.printf("delta = %lu\n", delta);
+  delta = after - before;
+  Serial.printf("delta = %lu\n", delta);
 
-    REQUIRE(fuzzycomp(delta, (timeType)3000));
+  REQUIRE(fuzzycomp(delta, (timeType)3000));
 
-    Serial.print("reset\n");
 
-    timeout.reset();
-    before = millis();
-    while (!timeout)
-        yield();
-    after = millis();
+  Serial.print("reset\n");
 
-    delta = after - before;
-    Serial.printf("delta = %lu\n", delta);
+  timeout.reset();
+  before = millis();
+  while(!timeout)
+    yield();
+  after = millis();
 
-    REQUIRE(fuzzycomp(delta, (timeType)3000));
+  delta = after - before;
+  Serial.printf("delta = %lu\n", delta);
+
+  REQUIRE(fuzzycomp(delta, (timeType)3000));
 }
 
 TEST_CASE("OneShot Timeout 3000ms reset to 1000ms", "[polledTimeout]")
 {
-    using esp8266::polledTimeout::oneShotMs;
-    using timeType = oneShotMs::timeType;
-    timeType before, after, delta;
+  using esp8266::polledTimeout::oneShotMs;
+  using timeType = oneShotMs::timeType;
+  timeType before, after, delta;
+
+  Serial.println("OneShot Timeout 3000ms");
 
-    Serial.println("OneShot Timeout 3000ms");
+  oneShotMs timeout(3000);
+  before = millis();
+  while(!timeout.expired())
+    yield();
+  after = millis();
 
-    oneShotMs timeout(3000);
-    before = millis();
-    while (!timeout.expired())
-        yield();
-    after = millis();
+  delta = after - before;
+  Serial.printf("delta = %lu\n", delta);
 
-    delta = after - before;
-    Serial.printf("delta = %lu\n", delta);
+  REQUIRE(fuzzycomp(delta, (timeType)3000));
 
-    REQUIRE(fuzzycomp(delta, (timeType)3000));
 
-    Serial.print("reset\n");
+  Serial.print("reset\n");
 
-    timeout.reset(1000);
-    before = millis();
-    while (!timeout)
-        yield();
-    after = millis();
+  timeout.reset(1000);
+  before = millis();
+  while(!timeout)
+    yield();
+  after = millis();
 
-    delta = after - before;
-    Serial.printf("delta = %lu\n", delta);
+  delta = after - before;
+  Serial.printf("delta = %lu\n", delta);
 
-    REQUIRE(fuzzycomp(delta, (timeType)1000));
+  REQUIRE(fuzzycomp(delta, (timeType)1000));
 }
 
 TEST_CASE("Periodic Timeout 1T 3000ms", "[polledTimeout]")
 {
-    using esp8266::polledTimeout::periodicMs;
-    using timeType = periodicMs::timeType;
-    timeType before, after, delta;
+  using esp8266::polledTimeout::periodicMs;
+  using timeType = periodicMs::timeType;
+  timeType before, after, delta;
 
-    Serial.println("Periodic Timeout 1T 3000ms");
+  Serial.println("Periodic Timeout 1T 3000ms");
 
-    periodicMs timeout(3000);
-    before = millis();
-    while (!timeout)
-        yield();
-    after = millis();
+  periodicMs timeout(3000);
+  before = millis();
+  while(!timeout)
+    yield();
+  after = millis();
 
-    delta = after - before;
-    Serial.printf("delta = %lu\n", delta);
+  delta = after - before;
+  Serial.printf("delta = %lu\n", delta);
 
-    REQUIRE(fuzzycomp(delta, (timeType)3000));
+  REQUIRE(fuzzycomp(delta, (timeType)3000));
 
-    Serial.print("no reset needed\n");
+  Serial.print("no reset needed\n");
 
-    before = millis();
-    while (!timeout)
-        yield();
-    after = millis();
+  before = millis();
+  while(!timeout)
+    yield();
+  after = millis();
 
-    delta = after - before;
-    Serial.printf("delta = %lu\n", delta);
+  delta = after - before;
+  Serial.printf("delta = %lu\n", delta);
 
-    REQUIRE(fuzzycomp(delta, (timeType)3000));
+  REQUIRE(fuzzycomp(delta, (timeType)3000));
 }
 
 TEST_CASE("Periodic Timeout 10T 1000ms", "[polledTimeout]")
 {
-    using esp8266::polledTimeout::periodicMs;
-    using timeType = periodicMs::timeType;
-    timeType before, after, delta;
+  using esp8266::polledTimeout::periodicMs;
+  using timeType = periodicMs::timeType;
+  timeType before, after, delta;
 
-    Serial.println("Periodic 10T Timeout 1000ms");
+  Serial.println("Periodic 10T Timeout 1000ms");
 
-    int counter = 10;
+  int counter = 10;
 
-    periodicMs timeout(1000);
-    before = millis();
-    while (1)
+  periodicMs timeout(1000);
+  before = millis();
+  while(1)
+  {
+    if(timeout)
     {
-        if (timeout)
-        {
-            Serial.print("*");
-            if (!--counter)
-                break;
-            yield();
-        }
+      Serial.print("*");
+      if(!--counter)
+        break;
+      yield();
     }
-    after = millis();
+  }
+  after = millis();
 
-    delta = after - before;
-    Serial.printf("\ndelta = %lu\n", delta);
-    REQUIRE(fuzzycomp(delta, (timeType)10000));
+  delta = after - before;
+  Serial.printf("\ndelta = %lu\n", delta);
+  REQUIRE(fuzzycomp(delta, (timeType)10000));
 }
 
 TEST_CASE("OneShot Timeout 3000ms reset to 1000ms custom yield", "[polledTimeout]")
 {
-    using YieldOrSkipPolicy = esp8266::polledTimeout::YieldPolicy::YieldOrSkip;
-    using oneShotMsYield    = esp8266::polledTimeout::timeoutTemplate<false, YieldOrSkipPolicy>;
-    using timeType          = oneShotMsYield::timeType;
-    timeType before, after, delta;
+  using YieldOrSkipPolicy = esp8266::polledTimeout::YieldPolicy::YieldOrSkip;
+  using oneShotMsYield = esp8266::polledTimeout::timeoutTemplate<false, YieldOrSkipPolicy>;
+  using timeType = oneShotMsYield::timeType;
+  timeType before, after, delta;
 
-    Serial.println("OneShot Timeout 3000ms");
+  Serial.println("OneShot Timeout 3000ms");
 
-    oneShotMsYield timeout(3000);
-    before = millis();
-    while (!timeout.expired())
-        ;
-    after = millis();
 
-    delta = after - before;
-    Serial.printf("delta = %lu\n", delta);
+  oneShotMsYield timeout(3000);
+  before = millis();
+  while(!timeout.expired());
+  after = millis();
 
-    REQUIRE(fuzzycomp(delta, (timeType)3000));
+  delta = after - before;
+  Serial.printf("delta = %lu\n", delta);
 
-    Serial.print("reset\n");
+  REQUIRE(fuzzycomp(delta, (timeType)3000));
 
-    timeout.reset(1000);
-    before = millis();
-    while (!timeout)
-        ;
-    after = millis();
 
-    delta = after - before;
-    Serial.printf("delta = %lu\n", delta);
+  Serial.print("reset\n");
 
-    REQUIRE(fuzzycomp(delta, (timeType)1000));
+  timeout.reset(1000);
+  before = millis();
+  while(!timeout);
+  after = millis();
+
+  delta = after - before;
+  Serial.printf("delta = %lu\n", delta);
+
+  REQUIRE(fuzzycomp(delta, (timeType)1000));
 }
+
diff --git a/tests/host/core/test_md5builder.cpp b/tests/host/core/test_md5builder.cpp
index ec59569918..0041c2eb72 100644
--- a/tests/host/core/test_md5builder.cpp
+++ b/tests/host/core/test_md5builder.cpp
@@ -32,31 +32,29 @@ TEST_CASE("MD5Builder::add works as expected", "[core][MD5Builder]")
     REQUIRE(builder.toString() == "9edb67f2b22c604fab13e2fd1d6056d7");
 }
 
+
 TEST_CASE("MD5Builder::addHexString works as expected", "[core][MD5Builder]")
 {
-    WHEN("A char array is parsed")
-    {
-        MD5Builder builder;
-        builder.begin();
-        const char* myPayload = "1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696F6e73";
-        builder.addHexString(myPayload);
-        builder.calculate();
-        REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
+    WHEN("A char array is parsed"){
+      MD5Builder builder;
+      builder.begin();
+      const char * myPayload = "1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696F6e73";
+      builder.addHexString(myPayload);
+      builder.calculate();
+      REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
     }
 
-    WHEN("A Arduino String is parsed")
-    {
-        MD5Builder builder;
-        builder.begin();
-        builder.addHexString(String("1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696f6e73"));
-        builder.calculate();
-        REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
+    WHEN("A Arduino String is parsed"){
+      MD5Builder builder;
+      builder.begin();
+      builder.addHexString(String("1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696f6e73"));
+      builder.calculate();
+      REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
     }
 }
 
-TEST_CASE("MD5Builder::addStream works", "[core][MD5Builder]")
-{
-    MD5Builder  builder;
+TEST_CASE("MD5Builder::addStream works", "[core][MD5Builder]"){
+    MD5Builder builder;
     const char* str = "MD5Builder::addStream_works_longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong";
     {
         StreamString stream;
diff --git a/tests/host/core/test_pgmspace.cpp b/tests/host/core/test_pgmspace.cpp
index fd89dbe6db..f44221c2b4 100644
--- a/tests/host/core/test_pgmspace.cpp
+++ b/tests/host/core/test_pgmspace.cpp
@@ -19,16 +19,15 @@
 
 TEST_CASE("strstr_P works as strstr", "[core][pgmspace]")
 {
-    auto t = [](const char* h, const char* n)
-    {
+    auto t = [](const char* h, const char* n) {
         const char* strstr_P_result = strstr_P(h, n);
-        const char* strstr_result   = strstr(h, n);
+        const char* strstr_result = strstr(h, n);
         REQUIRE(strstr_P_result == strstr_result);
     };
 
     // Test case data is from avr-libc, original copyright (c) 2007  Dmitry Xmelkov
     // See avr-libc/tests/simulate/pmstring/strstr_P.c
-    t("", "");
+    t ("", "");
     t("12345", "");
     t("ababac", "abac");
     t("", "a");
diff --git a/tests/host/core/test_string.cpp b/tests/host/core/test_string.cpp
index b0f4012aef..cd844545d0 100644
--- a/tests/host/core/test_string.cpp
+++ b/tests/host/core/test_string.cpp
@@ -43,8 +43,8 @@ TEST_CASE("String::trim", "[core][String]")
 TEST_CASE("String::replace", "[core][String]")
 {
     String str;
-    str            = "The quick brown fox jumped over the lazy dog.";
-    String find    = "fox";
+    str = "The quick brown fox jumped over the lazy dog.";
+    String find = "fox";
     String replace = "vulpes vulpes";
     str.replace(find, replace);
     REQUIRE(str == "The quick brown vulpes vulpes jumped over the lazy dog.");
@@ -52,10 +52,10 @@ TEST_CASE("String::replace", "[core][String]")
 
 TEST_CASE("String(value, base)", "[core][String]")
 {
-    String strbase2(9999, 2);
-    String strbase8(9999, 8);
-    String strbase10(9999, 10);
-    String strbase16(9999, 16);
+    String strbase2(9999,2);
+    String strbase8(9999,8);
+    String strbase10(9999,10);
+    String strbase16(9999,16);
     REQUIRE(strbase2 == "10011100001111");
     REQUIRE(strbase8 == "23417");
     REQUIRE(strbase10 == "9999");
@@ -64,7 +64,7 @@ TEST_CASE("String(value, base)", "[core][String]")
     String strnegf(-2.123, 3);
     REQUIRE(strnegi == "-9999");
     REQUIRE(strnegf == "-2.123");
-    String strbase16l((long)999999, 16);
+    String strbase16l((long)999999,16);
     REQUIRE(strbase16l == "f423f");
 }
 
@@ -83,8 +83,8 @@ TEST_CASE("String constructors", "[core][String]")
     String s1("abcd");
     String s2(s1);
     REQUIRE(s1 == s2);
-    String* s3 = new String("manos");
-    s2         = *s3;
+    String *s3 = new String("manos");
+    s2 = *s3;
     delete s3;
     REQUIRE(s2 == "manos");
     s3 = new String("thisismuchlongerthantheother");
@@ -97,8 +97,8 @@ TEST_CASE("String constructors", "[core][String]")
     REQUIRE(ssh == "3.14159_abcd");
     String flash = (F("hello from flash"));
     REQUIRE(flash == "hello from flash");
-    const char textarray[6] = { 'h', 'e', 'l', 'l', 'o', 0 };
-    String     hello(textarray);
+    const char textarray[6] = {'h', 'e', 'l', 'l', 'o', 0};
+    String hello(textarray);
     REQUIRE(hello == "hello");
     String hello2;
     hello2 = textarray;
@@ -156,19 +156,19 @@ TEST_CASE("String concantenation", "[core][String]")
     REQUIRE(str == "-100");
     // Non-zero-terminated array concatenation
     const char buff[] = "abcdefg";
-    String     n;
-    n = "1234567890";  // Make it a SSO string, fill with non-0 data
-    n = "1";           // Overwrite [1] with 0, but leave old junk in SSO space still
+    String n;
+    n = "1234567890"; // Make it a SSO string, fill with non-0 data
+    n = "1"; // Overwrite [1] with 0, but leave old junk in SSO space still
     n.concat(buff, 3);
-    REQUIRE(n == "1abc");  // Ensure the trailing 0 is always present even w/this funky concat
-    for (int i = 0; i < 20; i++)
-        n.concat(buff, 1);  // Add 20 'a's to go from SSO to normal string
+    REQUIRE(n == "1abc"); // Ensure the trailing 0 is always present even w/this funky concat
+    for (int i=0; i<20; i++)
+        n.concat(buff, 1); // Add 20 'a's to go from SSO to normal string
     REQUIRE(n == "1abcaaaaaaaaaaaaaaaaaaaa");
     n = "";
-    for (int i = 0; i <= 5; i++)
+    for (int i=0; i<=5; i++)
         n.concat(buff, i);
     REQUIRE(n == "aababcabcdabcde");
-    n.concat(buff, 0);  // And check no add'n
+    n.concat(buff, 0); // And check no add'n
     REQUIRE(n == "aababcabcdabcde");
 }
 
@@ -211,7 +211,7 @@ TEST_CASE("String byte access", "[core][String]")
 TEST_CASE("String conversion", "[core][String]")
 {
     String s = "12345";
-    long   l = s.toInt();
+    long l = s.toInt();
     REQUIRE(l == 12345);
     s = "2147483647";
     l = s.toInt();
@@ -222,9 +222,9 @@ TEST_CASE("String conversion", "[core][String]")
     s = "-2147483648";
     l = s.toInt();
     REQUIRE(l == INT_MIN);
-    s       = "3.14159";
+    s = "3.14159";
     float f = s.toFloat();
-    REQUIRE(fabs(f - 3.14159) < 0.0001);
+    REQUIRE( fabs(f - 3.14159) < 0.0001 );
 }
 
 TEST_CASE("String case", "[core][String]")
@@ -246,7 +246,7 @@ TEST_CASE("String nulls", "[core][String]")
     s.trim();
     s.toUpperCase();
     s.toLowerCase();
-    s.remove(1, 1);
+    s.remove(1,1);
     s.remove(10);
     s.replace("taco", "burrito");
     s.replace('a', 'b');
@@ -268,7 +268,7 @@ TEST_CASE("String nulls", "[core][String]")
     REQUIRE(s == "");
     REQUIRE(s.length() == 0);
     s.setCharAt(1, 't');
-    REQUIRE(s.startsWith("abc", 0) == false);
+    REQUIRE(s.startsWith("abc",0) == false);
     REQUIRE(s.startsWith("def") == false);
     REQUIRE(s.equalsConstantTime("def") == false);
     REQUIRE(s.equalsConstantTime("") == true);
@@ -299,128 +299,125 @@ TEST_CASE("String sizes near 8b", "[core][String]")
     String s15("12345678901234");
     String s16("123456789012345");
     String s17("1234567890123456");
-    REQUIRE(!strcmp(s7.c_str(), "123456"));
-    REQUIRE(!strcmp(s8.c_str(), "1234567"));
-    REQUIRE(!strcmp(s9.c_str(), "12345678"));
-    REQUIRE(!strcmp(s15.c_str(), "12345678901234"));
-    REQUIRE(!strcmp(s16.c_str(), "123456789012345"));
-    REQUIRE(!strcmp(s17.c_str(), "1234567890123456"));
+    REQUIRE(!strcmp(s7.c_str(),"123456"));
+    REQUIRE(!strcmp(s8.c_str(),"1234567"));
+    REQUIRE(!strcmp(s9.c_str(),"12345678"));
+    REQUIRE(!strcmp(s15.c_str(),"12345678901234"));
+    REQUIRE(!strcmp(s16.c_str(),"123456789012345"));
+    REQUIRE(!strcmp(s17.c_str(),"1234567890123456"));
     s7 += '_';
     s8 += '_';
     s9 += '_';
     s15 += '_';
     s16 += '_';
     s17 += '_';
-    REQUIRE(!strcmp(s7.c_str(), "123456_"));
-    REQUIRE(!strcmp(s8.c_str(), "1234567_"));
-    REQUIRE(!strcmp(s9.c_str(), "12345678_"));
-    REQUIRE(!strcmp(s15.c_str(), "12345678901234_"));
-    REQUIRE(!strcmp(s16.c_str(), "123456789012345_"));
-    REQUIRE(!strcmp(s17.c_str(), "1234567890123456_"));
+    REQUIRE(!strcmp(s7.c_str(),"123456_"));
+    REQUIRE(!strcmp(s8.c_str(),"1234567_"));
+    REQUIRE(!strcmp(s9.c_str(),"12345678_"));
+    REQUIRE(!strcmp(s15.c_str(),"12345678901234_"));
+    REQUIRE(!strcmp(s16.c_str(),"123456789012345_"));
+    REQUIRE(!strcmp(s17.c_str(),"1234567890123456_"));
 }
 
 TEST_CASE("String SSO works", "[core][String]")
 {
-    // This test assumes that SSO_SIZE==8, if that changes the test must as well
-    String s;
-    s += "0";
-    REQUIRE(s == "0");
-    REQUIRE(s.length() == 1);
-    const char* savesso = s.c_str();
-    s += 1;
-    REQUIRE(s.c_str() == savesso);
-    REQUIRE(s == "01");
-    REQUIRE(s.length() == 2);
-    s += "2";
-    REQUIRE(s.c_str() == savesso);
-    REQUIRE(s == "012");
-    REQUIRE(s.length() == 3);
-    s += 3;
-    REQUIRE(s.c_str() == savesso);
-    REQUIRE(s == "0123");
-    REQUIRE(s.length() == 4);
-    s += "4";
-    REQUIRE(s.c_str() == savesso);
-    REQUIRE(s == "01234");
-    REQUIRE(s.length() == 5);
-    s += "5";
-    REQUIRE(s.c_str() == savesso);
-    REQUIRE(s == "012345");
-    REQUIRE(s.length() == 6);
-    s += "6";
+  // This test assumes that SSO_SIZE==8, if that changes the test must as well
+  String s;
+  s += "0";
+  REQUIRE(s == "0");
+  REQUIRE(s.length() == 1);
+  const char *savesso = s.c_str();
+  s += 1;
+  REQUIRE(s.c_str() == savesso);
+  REQUIRE(s == "01");
+  REQUIRE(s.length() == 2);
+  s += "2";
+  REQUIRE(s.c_str() == savesso);
+  REQUIRE(s == "012");
+  REQUIRE(s.length() == 3);
+  s += 3;
+  REQUIRE(s.c_str() == savesso);
+  REQUIRE(s == "0123");
+  REQUIRE(s.length() == 4);
+  s += "4";
+  REQUIRE(s.c_str() == savesso);
+  REQUIRE(s == "01234");
+  REQUIRE(s.length() == 5);
+  s += "5";
+  REQUIRE(s.c_str() == savesso);
+  REQUIRE(s == "012345");
+  REQUIRE(s.length() == 6);
+  s += "6";
+  REQUIRE(s.c_str() == savesso);
+  REQUIRE(s == "0123456");
+  REQUIRE(s.length() == 7);
+  s += "7";
+  REQUIRE(s.c_str() == savesso);
+  REQUIRE(s == "01234567");
+  REQUIRE(s.length() == 8);
+  s += "8";
+  REQUIRE(s.c_str() == savesso);
+  REQUIRE(s == "012345678");
+  REQUIRE(s.length() == 9);
+  s += "9";
+  REQUIRE(s.c_str() == savesso);
+  REQUIRE(s == "0123456789");
+  REQUIRE(s.length() == 10);
+  if (sizeof(savesso) == 4) {
+    s += "a";
+    REQUIRE(s.c_str() != savesso);
+    REQUIRE(s == "0123456789a");
+    REQUIRE(s.length() == 11);
+    s += "b";
+    REQUIRE(s.c_str() != savesso);
+    REQUIRE(s == "0123456789ab");
+    REQUIRE(s.length() == 12);
+    s += "c";
+    REQUIRE(s.c_str() != savesso);
+    REQUIRE(s == "0123456789abc");
+    REQUIRE(s.length() == 13);
+  } else {
+  s += "a";
     REQUIRE(s.c_str() == savesso);
-    REQUIRE(s == "0123456");
-    REQUIRE(s.length() == 7);
-    s += "7";
+    REQUIRE(s == "0123456789a");
+    REQUIRE(s.length() == 11);
+    s += "bcde";
     REQUIRE(s.c_str() == savesso);
-    REQUIRE(s == "01234567");
-    REQUIRE(s.length() == 8);
-    s += "8";
-    REQUIRE(s.c_str() == savesso);
-    REQUIRE(s == "012345678");
-    REQUIRE(s.length() == 9);
-    s += "9";
-    REQUIRE(s.c_str() == savesso);
-    REQUIRE(s == "0123456789");
-    REQUIRE(s.length() == 10);
-    if (sizeof(savesso) == 4)
-    {
-        s += "a";
-        REQUIRE(s.c_str() != savesso);
-        REQUIRE(s == "0123456789a");
-        REQUIRE(s.length() == 11);
-        s += "b";
-        REQUIRE(s.c_str() != savesso);
-        REQUIRE(s == "0123456789ab");
-        REQUIRE(s.length() == 12);
-        s += "c";
-        REQUIRE(s.c_str() != savesso);
-        REQUIRE(s == "0123456789abc");
-        REQUIRE(s.length() == 13);
-    }
-    else
-    {
-        s += "a";
-        REQUIRE(s.c_str() == savesso);
-        REQUIRE(s == "0123456789a");
-        REQUIRE(s.length() == 11);
-        s += "bcde";
-        REQUIRE(s.c_str() == savesso);
-        REQUIRE(s == "0123456789abcde");
-        REQUIRE(s.length() == 15);
-        s += "fghi";
-        REQUIRE(s.c_str() != savesso);
-        REQUIRE(s == "0123456789abcdefghi");
-        REQUIRE(s.length() == 19);
-        s += "j";
-        REQUIRE(s.c_str() != savesso);
-        REQUIRE(s == "0123456789abcdefghij");
-        REQUIRE(s.length() == 20);
-        s += "k";
-        REQUIRE(s.c_str() != savesso);
-        REQUIRE(s == "0123456789abcdefghijk");
-        REQUIRE(s.length() == 21);
-        s += "l";
-        REQUIRE(s.c_str() != savesso);
-        REQUIRE(s == "0123456789abcdefghijkl");
-        REQUIRE(s.length() == 22);
-        s += "m";
-        REQUIRE(s.c_str() != savesso);
-        REQUIRE(s == "0123456789abcdefghijklm");
-        REQUIRE(s.length() == 23);
-        s += "nopq";
-        REQUIRE(s.c_str() != savesso);
-        REQUIRE(s == "0123456789abcdefghijklmnopq");
-        REQUIRE(s.length() == 27);
-        s += "rstu";
-        REQUIRE(s.c_str() != savesso);
-        REQUIRE(s == "0123456789abcdefghijklmnopqrstu");
-        REQUIRE(s.length() == 31);
-    }
-    s = "0123456789abcde";
-    s = s.substring(s.indexOf('a'));
-    REQUIRE(s == "abcde");
-    REQUIRE(s.length() == 5);
+    REQUIRE(s == "0123456789abcde");
+    REQUIRE(s.length() == 15);
+    s += "fghi";
+    REQUIRE(s.c_str() != savesso);
+    REQUIRE(s == "0123456789abcdefghi");
+    REQUIRE(s.length() == 19);
+    s += "j";
+    REQUIRE(s.c_str() != savesso);
+    REQUIRE(s == "0123456789abcdefghij");
+    REQUIRE(s.length() == 20);
+    s += "k";
+    REQUIRE(s.c_str() != savesso);
+    REQUIRE(s == "0123456789abcdefghijk");
+    REQUIRE(s.length() == 21);
+    s += "l";
+    REQUIRE(s.c_str() != savesso);
+    REQUIRE(s == "0123456789abcdefghijkl");
+    REQUIRE(s.length() == 22);
+    s += "m";
+    REQUIRE(s.c_str() != savesso);
+    REQUIRE(s == "0123456789abcdefghijklm");
+    REQUIRE(s.length() == 23);
+    s += "nopq";
+    REQUIRE(s.c_str() != savesso);
+    REQUIRE(s == "0123456789abcdefghijklmnopq");
+    REQUIRE(s.length() == 27);
+    s += "rstu";
+    REQUIRE(s.c_str() != savesso);
+    REQUIRE(s == "0123456789abcdefghijklmnopqrstu");
+    REQUIRE(s.length() == 31);
+  }
+  s = "0123456789abcde";
+  s = s.substring(s.indexOf('a'));
+  REQUIRE(s == "abcde");
+  REQUIRE(s.length() == 5);
 }
 
 #include <new>
@@ -429,67 +426,70 @@ void repl(const String& key, const String& val, String& s, boolean useURLencode)
     s.replace(key, val);
 }
 
+
 TEST_CASE("String SSO handles junk in memory", "[core][String]")
 {
-    // We fill the SSO space with garbage then construct an object in it and check consistency
-    // This is NOT how you want to use Strings outside of this testing!
-    unsigned char space[64];
-    String*       s = (String*)space;
-    memset(space, 0xff, 64);
-    new (s) String;
-    REQUIRE(*s == "");
-    s->~String();
-
-    // Tests from #5883
-    bool       useURLencode = false;
-    const char euro[4]      = { (char)0xe2, (char)0x82, (char)0xac, 0 };  // Unicode euro symbol
-    const char yen[3]       = { (char)0xc2, (char)0xa5, 0 };              // Unicode yen symbol
-
-    memset(space, 0xff, 64);
-    new (s) String("%ssid%");
-    repl(("%ssid%"), "MikroTik", *s, useURLencode);
-    REQUIRE(*s == "MikroTik");
-    s->~String();
-
-    memset(space, 0xff, 64);
-    new (s) String("{E}");
-    repl(("{E}"), euro, *s, useURLencode);
-    REQUIRE(*s == "€");
-    s->~String();
-    memset(space, 0xff, 64);
-    new (s) String("&euro;");
-    repl(("&euro;"), euro, *s, useURLencode);
-    REQUIRE(*s == "€");
-    s->~String();
-    memset(space, 0xff, 64);
-    new (s) String("{Y}");
-    repl(("{Y}"), yen, *s, useURLencode);
-    REQUIRE(*s == "¥");
-    s->~String();
-    memset(space, 0xff, 64);
-    new (s) String("&yen;");
-    repl(("&yen;"), yen, *s, useURLencode);
-    REQUIRE(*s == "¥");
-    s->~String();
-
-    memset(space, 0xff, 64);
-    new (s) String("%sysname%");
-    repl(("%sysname%"), "CO2_defect", *s, useURLencode);
-    REQUIRE(*s == "CO2_defect");
-    s->~String();
+  // We fill the SSO space with garbage then construct an object in it and check consistency
+  // This is NOT how you want to use Strings outside of this testing!
+  unsigned char space[64];
+  String *s = (String*)space;
+  memset(space, 0xff, 64);
+  new(s) String;
+  REQUIRE(*s == "");
+  s->~String();
+
+  // Tests from #5883
+  bool useURLencode = false;
+  const char euro[4] = {(char)0xe2, (char)0x82, (char)0xac, 0}; // Unicode euro symbol
+  const char yen[3]   = {(char)0xc2, (char)0xa5, 0}; // Unicode yen symbol
+
+  memset(space, 0xff, 64);
+  new(s) String("%ssid%");
+  repl(("%ssid%"), "MikroTik", *s, useURLencode);
+  REQUIRE(*s == "MikroTik");
+  s->~String();
+
+  memset(space, 0xff, 64);
+  new(s) String("{E}");
+  repl(("{E}"), euro, *s, useURLencode);
+  REQUIRE(*s == "€");
+  s->~String();
+  memset(space, 0xff, 64);
+  new(s) String("&euro;");
+  repl(("&euro;"), euro, *s, useURLencode);
+  REQUIRE(*s == "€");
+  s->~String();
+  memset(space, 0xff, 64);
+  new(s) String("{Y}");
+  repl(("{Y}"), yen, *s, useURLencode);
+  REQUIRE(*s == "¥");
+  s->~String();
+  memset(space, 0xff, 64);
+  new(s) String("&yen;");
+  repl(("&yen;"), yen, *s, useURLencode);
+  REQUIRE(*s == "¥");
+  s->~String();
+
+  memset(space, 0xff, 64);
+  new(s) String("%sysname%");
+  repl(("%sysname%"), "CO2_defect", *s, useURLencode);
+  REQUIRE(*s == "CO2_defect");
+  s->~String();
 }
 
+
 TEST_CASE("Issue #5949 - Overlapping src/dest in replace", "[core][String]")
 {
-    String blah = "blah";
-    blah.replace("xx", "y");
-    REQUIRE(blah == "blah");
-    blah.replace("x", "yy");
-    REQUIRE(blah == "blah");
-    blah.replace(blah, blah);
-    REQUIRE(blah == "blah");
+  String blah = "blah";
+  blah.replace("xx", "y");
+  REQUIRE(blah == "blah");
+  blah.replace("x", "yy");
+  REQUIRE(blah == "blah");
+  blah.replace(blah, blah);
+  REQUIRE(blah == "blah");
 }
 
+
 TEST_CASE("Issue #2736 - StreamString SSO fix", "[core][StreamString]")
 {
     StreamString s;
@@ -502,104 +502,102 @@ TEST_CASE("Issue #2736 - StreamString SSO fix", "[core][StreamString]")
 
 TEST_CASE("Strings with NULs", "[core][String]")
 {
-    // The following should never be done in a real app! This is only to inject 0s in the middle of a string.
-    // Fits in SSO...
-    String str("01234567");
-    REQUIRE(str.length() == 8);
-    char* ptr = (char*)str.c_str();
-    ptr[3]    = 0;
-    String str2;
-    str2 = str;
-    REQUIRE(str2.length() == 8);
-    // Needs a buffer pointer
-    str    = "0123456789012345678901234567890123456789";
-    ptr    = (char*)str.c_str();
-    ptr[3] = 0;
-    str2   = str;
-    REQUIRE(str2.length() == 40);
-    String str3("a");
-    ptr  = (char*)str3.c_str();
-    *ptr = 0;
-    REQUIRE(str3.length() == 1);
-    str3 += str3;
-    REQUIRE(str3.length() == 2);
-    str3 += str3;
-    REQUIRE(str3.length() == 4);
-    str3 += str3;
-    REQUIRE(str3.length() == 8);
-    str3 += str3;
-    REQUIRE(str3.length() == 16);
-    str3 += str3;
-    REQUIRE(str3.length() == 32);
-    str3 += str3;
-    REQUIRE(str3.length() == 64);
-    static char zeros[64] = { 0 };
-    const char* p         = str3.c_str();
-    REQUIRE(!memcmp(p, zeros, 64));
+  // The following should never be done in a real app! This is only to inject 0s in the middle of a string.
+  // Fits in SSO...
+  String str("01234567");
+  REQUIRE(str.length() == 8);
+  char *ptr = (char *)str.c_str();
+  ptr[3] = 0;
+  String str2;
+  str2 = str;
+  REQUIRE(str2.length() == 8);
+  // Needs a buffer pointer
+  str = "0123456789012345678901234567890123456789";
+  ptr = (char *)str.c_str();
+  ptr[3] = 0;
+  str2 = str;
+  REQUIRE(str2.length() == 40);
+  String str3("a");
+  ptr = (char *)str3.c_str();
+  *ptr = 0;
+  REQUIRE(str3.length() == 1);
+  str3 += str3;
+  REQUIRE(str3.length() == 2);
+  str3 += str3;
+  REQUIRE(str3.length() == 4);
+  str3 += str3;
+  REQUIRE(str3.length() == 8);
+  str3 += str3;
+  REQUIRE(str3.length() == 16);
+  str3 += str3;
+  REQUIRE(str3.length() == 32);
+  str3 += str3;
+  REQUIRE(str3.length() == 64);
+  static char zeros[64] = {0};
+  const char *p = str3.c_str();
+  REQUIRE(!memcmp(p, zeros, 64));
 }
 
 TEST_CASE("Replace and string expansion", "[core][String]")
 {
-    String s, l;
-    // Make these large enough to span SSO and non SSO
-    String      whole = "#123456789012345678901234567890";
-    const char* res   = "abcde123456789012345678901234567890";
-    for (size_t i = 1; i < whole.length(); i++)
-    {
-        s = whole.substring(0, i);
-        l = s;
-        l.replace("#", "abcde");
-        char buff[64];
-        strcpy(buff, res);
-        buff[5 + i - 1] = 0;
-        REQUIRE(!strcmp(l.c_str(), buff));
-        REQUIRE(l.length() == strlen(buff));
-    }
+  String s, l;
+  // Make these large enough to span SSO and non SSO
+  String whole = "#123456789012345678901234567890";
+  const char *res = "abcde123456789012345678901234567890";
+  for (size_t i=1; i < whole.length(); i++) {
+    s = whole.substring(0, i);
+    l = s;
+    l.replace("#", "abcde");
+    char buff[64];
+    strcpy(buff, res);
+    buff[5 + i-1] = 0;
+    REQUIRE(!strcmp(l.c_str(), buff));
+    REQUIRE(l.length() == strlen(buff));
+  }
 }
 
 TEST_CASE("String chaining", "[core][String]")
 {
-    const char* chunks[] {
-        "~12345",
-        "67890",
-        "qwertyuiopasdfghjkl",
-        "zxcvbnm"
-    };
-
-    String all;
-    for (auto* chunk : chunks)
-    {
-        all += chunk;
-    }
-
-    // make sure we can chain a combination of things to form a String
-    REQUIRE((String(chunks[0]) + String(chunks[1]) + String(chunks[2]) + String(chunks[3])) == all);
-    REQUIRE((chunks[0] + String(chunks[1]) + F(chunks[2]) + chunks[3]) == all);
-    REQUIRE((String(chunks[0]) + F(chunks[1]) + F(chunks[2]) + String(chunks[3])) == all);
-    REQUIRE(('~' + String(&chunks[0][0] + 1) + chunks[1] + String(chunks[2]) + F(chunks[3])) == all);
-    REQUIRE((String(chunks[0]) + '6' + (&chunks[1][0] + 1) + String(chunks[2]) + F(chunks[3])) == all);
-
-    // these are still invalid (and also cannot compile at all):
-    // - `F(...)` + `F(...)`
-    // - `F(...)` + `const char*`
-    // - `const char*` + `F(...)`
-    // we need `String()` as either rhs or lhs
-
-    // ensure chaining reuses the buffer
-    // (internal details...)
-    {
-        String tmp(chunks[3]);
-        tmp.reserve(2 * all.length());
-        auto*  ptr = tmp.c_str();
-        String result("~1" + String(&chunks[0][0] + 2) + F(chunks[1]) + chunks[2] + std::move(tmp));
-        REQUIRE(result == all);
-        REQUIRE(static_cast<const void*>(result.c_str()) == static_cast<const void*>(ptr));
-    }
+  const char* chunks[] {
+    "~12345",
+    "67890",
+    "qwertyuiopasdfghjkl",
+    "zxcvbnm"
+  };
+
+  String all;
+  for (auto* chunk : chunks) {
+      all += chunk;
+  }
+
+  // make sure we can chain a combination of things to form a String
+  REQUIRE((String(chunks[0]) + String(chunks[1]) + String(chunks[2]) + String(chunks[3])) == all);
+  REQUIRE((chunks[0] + String(chunks[1]) + F(chunks[2]) + chunks[3]) == all);
+  REQUIRE((String(chunks[0]) + F(chunks[1]) + F(chunks[2]) + String(chunks[3])) == all);
+  REQUIRE(('~' + String(&chunks[0][0] + 1) + chunks[1] + String(chunks[2]) + F(chunks[3])) == all);
+  REQUIRE((String(chunks[0]) + '6' + (&chunks[1][0] + 1) + String(chunks[2]) + F(chunks[3])) == all);
+
+  // these are still invalid (and also cannot compile at all):
+  // - `F(...)` + `F(...)`
+  // - `F(...)` + `const char*`
+  // - `const char*` + `F(...)`
+  // we need `String()` as either rhs or lhs
+
+  // ensure chaining reuses the buffer
+  // (internal details...)
+  {
+    String tmp(chunks[3]);
+    tmp.reserve(2 * all.length());
+    auto* ptr = tmp.c_str();
+    String result("~1" + String(&chunks[0][0] + 2) + F(chunks[1]) + chunks[2] + std::move(tmp));
+    REQUIRE(result == all);
+    REQUIRE(static_cast<const void*>(result.c_str()) == static_cast<const void*>(ptr));
+  }
 }
 
 TEST_CASE("String concat OOB #8198", "[core][String]")
 {
-    char* p = (char*)malloc(16);
+    char *p = (char*)malloc(16);
     memset(p, 'x', 16);
     String s = "abcd";
     s.concat(p, 16);
diff --git a/tests/host/fs/test_fs.cpp b/tests/host/fs/test_fs.cpp
index 8b92106e8e..fb73a6a271 100644
--- a/tests/host/fs/test_fs.cpp
+++ b/tests/host/fs/test_fs.cpp
@@ -24,8 +24,8 @@
 #include "../../../libraries/SDFS/src/SDFS.h"
 #include "../../../libraries/SD/src/SD.h"
 
-namespace spiffs_test
-{
+
+namespace spiffs_test {
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
@@ -47,9 +47,9 @@ namespace spiffs_test
 TEST_CASE("SPIFFS checks the config object passed in", "[fs]")
 {
     SPIFFS_MOCK_DECLARE(64, 8, 512, "");
-    FSConfig       f;
-    SPIFFSConfig   s;
-    SDFSConfig     d;
+    FSConfig f;
+    SPIFFSConfig s;
+    SDFSConfig d;
     LittleFSConfig l;
 
     REQUIRE_FALSE(SPIFFS.setConfig(f));
@@ -61,8 +61,8 @@ TEST_CASE("SPIFFS checks the config object passed in", "[fs]")
 
 };
 
-namespace littlefs_test
-{
+
+namespace littlefs_test {
 #define FSTYPE LittleFS
 #define TESTPRE "LittleFS - "
 #define TESTPAT "[lfs]"
@@ -82,9 +82,9 @@ namespace littlefs_test
 TEST_CASE("LittleFS checks the config object passed in", "[fs]")
 {
     LITTLEFS_MOCK_DECLARE(64, 8, 512, "");
-    FSConfig       f;
-    SPIFFSConfig   s;
-    SDFSConfig     d;
+    FSConfig f;
+    SPIFFSConfig s;
+    SDFSConfig d;
     LittleFSConfig l;
 
     REQUIRE_FALSE(LittleFS.setConfig(f));
@@ -95,16 +95,15 @@ TEST_CASE("LittleFS checks the config object passed in", "[fs]")
 
 };
 
-namespace sdfs_test
-{
+namespace sdfs_test {
 #define FSTYPE SDFS
 #define TESTPRE "SDFS - "
 #define TESTPAT "[sdfs]"
 // SDFS supports long paths (MAXPATH)
-#define TOOLONGFILENAME "/"                                                                                                    \
-                        "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
-                        "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
-                        "12345678901234567890123456789012345678901234567890123456"
+#define TOOLONGFILENAME "/" \
+	"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
+	"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
+	"12345678901234567890123456789012345678901234567890123456"
 #define FS_MOCK_DECLARE SDFS_MOCK_DECLARE
 #define FS_MOCK_RESET SDFS_MOCK_RESET
 #define FS_HAS_DIRS
@@ -119,9 +118,9 @@ namespace sdfs_test
 TEST_CASE("SDFS checks the config object passed in", "[fs]")
 {
     SDFS_MOCK_DECLARE(64, 8, 512, "");
-    FSConfig       f;
-    SPIFFSConfig   s;
-    SDFSConfig     d;
+    FSConfig f;
+    SPIFFSConfig s;
+    SDFSConfig d;
     LittleFSConfig l;
 
     REQUIRE_FALSE(SDFS.setConfig(f));
@@ -143,7 +142,7 @@ TEST_CASE("SD.h FILE_WRITE macro is append", "[fs]")
     f.write(65);
     f.write("bbcc");
     f.write("theend", 6);
-    char block[3] = { 'x', 'y', 'z' };
+    char block[3]={'x','y','z'};
     f.write(block, 3);
     uint32_t bigone = 0x40404040;
     f.write((const uint8_t*)&bigone, 4);
@@ -156,7 +155,7 @@ TEST_CASE("SD.h FILE_WRITE macro is append", "[fs]")
     File g = SD.open("/file2.txt", FILE_WRITE);
     g.write(0);
     g.close();
-    g         = SD.open("/file2.txt", FILE_READ);
+    g = SD.open("/file2.txt", FILE_READ);
     uint8_t u = 0x66;
     g.read(&u, 1);
     g.close();
diff --git a/tests/host/sys/pgmspace.h b/tests/host/sys/pgmspace.h
index 321626542a..ecc4558351 100644
--- a/tests/host/sys/pgmspace.h
+++ b/tests/host/sys/pgmspace.h
@@ -15,11 +15,11 @@
 #endif
 
 #ifndef PGM_P
-#define PGM_P const char*
+#define PGM_P const char *
 #endif
 
 #ifndef PGM_VOID_P
-#define PGM_VOID_P const void*
+#define PGM_VOID_P const void *
 #endif
 
 #ifndef PSTR
@@ -27,37 +27,37 @@
 #endif
 
 #ifdef __cplusplus
-#define pgm_read_byte(addr) (*reinterpret_cast<const uint8_t*>(addr))
-#define pgm_read_word(addr) (*reinterpret_cast<const uint16_t*>(addr))
-#define pgm_read_dword(addr) (*reinterpret_cast<const uint32_t*>(addr))
-#define pgm_read_float(addr) (*reinterpret_cast<const float*>(addr))
-#define pgm_read_ptr(addr) (*reinterpret_cast<const void* const*>(addr))
+    #define pgm_read_byte(addr)             (*reinterpret_cast<const uint8_t*>(addr))
+    #define pgm_read_word(addr)             (*reinterpret_cast<const uint16_t*>(addr))
+    #define pgm_read_dword(addr)            (*reinterpret_cast<const uint32_t*>(addr))
+    #define pgm_read_float(addr)            (*reinterpret_cast<const float*>(addr))
+    #define pgm_read_ptr(addr)              (*reinterpret_cast<const void* const *>(addr))
 #else
-#define pgm_read_byte(addr) (*(const uint8_t*)(addr))
-#define pgm_read_word(addr) (*(const uint16_t*)(addr))
-#define pgm_read_dword(addr) (*(const uint32_t*)(addr))
-#define pgm_read_float(addr) (*(const float)(addr))
-#define pgm_read_ptr(addr) (*(const void* const*)(addr))
+    #define pgm_read_byte(addr)             (*(const uint8_t*)(addr))
+    #define pgm_read_word(addr)             (*(const uint16_t*)(addr))
+    #define pgm_read_dword(addr)            (*(const uint32_t*)(addr))
+    #define pgm_read_float(addr)            (*(const float)(addr))
+    #define pgm_read_ptr(addr)              (*(const void* const *)(addr))
 #endif
 
-#define pgm_read_byte_near(addr) pgm_read_byte(addr)
-#define pgm_read_word_near(addr) pgm_read_word(addr)
-#define pgm_read_dword_near(addr) pgm_read_dword(addr)
-#define pgm_read_float_near(addr) pgm_read_float(addr)
-#define pgm_read_ptr_near(addr) pgm_read_ptr(addr)
-#define pgm_read_byte_far(addr) pgm_read_byte(addr)
-#define pgm_read_word_far(addr) pgm_read_word(addr)
-#define pgm_read_dword_far(addr) pgm_read_dword(addr)
-#define pgm_read_float_far(addr) pgm_read_float(addr)
-#define pgm_read_ptr_far(addr) pgm_read_ptr(addr)
+#define pgm_read_byte_near(addr)        pgm_read_byte(addr)
+#define pgm_read_word_near(addr)        pgm_read_word(addr)
+#define pgm_read_dword_near(addr)       pgm_read_dword(addr)
+#define pgm_read_float_near(addr)       pgm_read_float(addr)
+#define pgm_read_ptr_near(addr)         pgm_read_ptr(addr)
+#define pgm_read_byte_far(addr)         pgm_read_byte(addr)
+#define pgm_read_word_far(addr)         pgm_read_word(addr)
+#define pgm_read_dword_far(addr)        pgm_read_dword(addr)
+#define pgm_read_float_far(addr)        pgm_read_float(addr)
+#define pgm_read_ptr_far(addr)          pgm_read_ptr(addr)
 
 // Wrapper inlines for _P functions
 #include <stdio.h>
 #include <string.h>
-inline const char* strstr_P(const char* haystack, const char* needle) { return strstr(haystack, needle); }
-inline char*       strcpy_P(char* dest, const char* src) { return strcpy(dest, src); }
-inline size_t      strlen_P(const char* s) { return strlen(s); }
-inline int         vsnprintf_P(char* str, size_t size, const char* format, va_list ap) { return vsnprintf(str, size, format, ap); }
+inline const char *strstr_P(const char *haystack, const char *needle) { return strstr(haystack, needle); }
+inline char *strcpy_P(char *dest, const char *src) { return strcpy(dest, src); }
+inline size_t strlen_P(const char *s) { return strlen(s); }
+inline int vsnprintf_P(char *str, size_t size, const char *format, va_list ap) { return vsnprintf(str, size, format, ap); }
 
 #define memcpy_P memcpy
 #define memmove_P memmove

From 8866c894a3b0b7b13eb4e1924e800b3a588142dd Mon Sep 17 00:00:00 2001
From: David Gauchard <gauchard@laas.fr>
Date: Thu, 20 Jan 2022 14:12:13 +0100
Subject: [PATCH 12/15] trying to reduce changes

---
 cores/esp8266/LwipDhcpServer-NonOS.cpp        |    7 +-
 cores/esp8266/LwipDhcpServer.cpp              |  496 ++-
 cores/esp8266/LwipDhcpServer.h                |   88 +-
 cores/esp8266/LwipIntf.cpp                    |   15 +-
 cores/esp8266/LwipIntf.h                      |   13 +-
 cores/esp8266/LwipIntfCB.cpp                  |   18 +-
 cores/esp8266/LwipIntfDev.h                   |   65 +-
 cores/esp8266/StreamSend.cpp                  |   46 +-
 cores/esp8266/StreamString.h                  |   69 +-
 cores/esp8266/core_esp8266_si2c.cpp           |  268 +-
 cores/esp8266/debug.cpp                       |    2 +-
 cores/esp8266/debug.h                         |   44 +-
 .../ArduinoOTA/examples/BasicOTA/BasicOTA.ino |    6 +-
 .../ArduinoOTA/examples/OTALeds/OTALeds.ino   |   13 +-
 .../CaptivePortalAdvanced.ino                 |   25 +-
 .../CaptivePortalAdvanced/handleHttp.ino      |   89 +-
 .../BasicHttpClient/BasicHttpClient.ino       |    4 -
 .../BasicHttpsClient/BasicHttpsClient.ino     |    6 +-
 .../DigestAuthorization.ino                   |   31 +-
 .../PostHttpClient/PostHttpClient.ino         |    7 +-
 .../ReuseConnectionV2/ReuseConnectionV2.ino   |    5 +-
 .../StreamHttpClient/StreamHttpClient.ino     |    8 +-
 .../StreamHttpsClient/StreamHttpsClient.ino   |    8 +-
 .../SecureWebUpdater/SecureWebUpdater.ino     |   13 +-
 .../examples/WebUpdater/WebUpdater.ino        |    9 +-
 .../LLMNR_Web_Server/LLMNR_Web_Server.ino     |    4 +-
 .../examples/ESP_NBNST/ESP_NBNST.ino          |    7 +-
 .../AdvancedWebServer/AdvancedWebServer.ino   |   16 +-
 .../examples/FSBrowser/FSBrowser.ino          |   52 +-
 .../ESP8266WebServer/examples/Graph/Graph.ino |   43 +-
 .../examples/HelloServer/HelloServer.ino      |   22 +-
 .../HttpAdvancedAuth/HttpAdvancedAuth.ino     |   18 +-
 .../HttpHashCredAuth/HttpHashCredAuth.ino     |   99 +-
 .../examples/PathArgServer/PathArgServer.ino  |    8 +-
 .../examples/PostServer/PostServer.ino        |    2 +-
 .../ServerSentEvents/ServerSentEvents.ino     |   54 +-
 .../SimpleAuthentication.ino                  |    7 +-
 .../examples/WebServer/WebServer.ino          |  160 +-
 .../examples/WebUpdate/WebUpdate.ino          |   17 +-
 .../BearSSL_CertStore/BearSSL_CertStore.ino   |   19 +-
 .../BearSSL_Server/BearSSL_Server.ino         |   51 +-
 .../BearSSL_ServerClientCert.ino              |   46 +-
 .../BearSSL_Sessions/BearSSL_Sessions.ino     |   20 +-
 .../BearSSL_Validation/BearSSL_Validation.ino |   19 +-
 .../examples/HTTPSRequest/HTTPSRequest.ino    |    9 +-
 libraries/ESP8266WiFi/examples/IPv6/IPv6.ino  |   30 +-
 .../examples/NTPClient/NTPClient.ino          |   46 +-
 .../examples/PagerServer/PagerServer.ino      |   20 +-
 .../RangeExtender-NAPT/RangeExtender-NAPT.ino |    9 +-
 .../examples/StaticLease/StaticLease.ino      |   17 +-
 libraries/ESP8266WiFi/examples/Udp/Udp.ino    |   12 +-
 .../WiFiAccessPoint/WiFiAccessPoint.ino       |    6 +-
 .../WiFiClientBasic/WiFiClientBasic.ino       |    6 +-
 .../examples/WiFiEcho/WiFiEcho.ino            |   90 +-
 .../examples/WiFiEvents/WiFiEvents.ino        |    2 +-
 .../WiFiManualWebServer.ino                   |    6 +-
 .../examples/WiFiScan/WiFiScan.ino            |   12 +-
 .../examples/WiFiShutdown/WiFiShutdown.ino    |    8 +-
 .../WiFiTelnetToSerial/WiFiTelnetToSerial.ino |   23 +-
 .../examples/HelloEspnow/HelloEspnow.ino      |  103 +-
 .../examples/HelloMesh/HelloMesh.ino          |   56 +-
 .../examples/HelloTcpIp/HelloTcpIp.ino        |   54 +-
 .../examples/httpUpdate/httpUpdate.ino        |    8 +-
 .../httpUpdateLittleFS/httpUpdateLittleFS.ino |    6 +-
 .../httpUpdateSecure/httpUpdateSecure.ino     |    9 +-
 .../httpUpdateSigned/httpUpdateSigned.ino     |   24 +-
 .../LEAmDNS/mDNS_Clock/mDNS_Clock.ino         |   52 +-
 .../mDNS_ServiceMonitor.ino                   |   58 +-
 .../OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino   |   38 +-
 .../mDNS_Web_Server/mDNS_Web_Server.ino       |   15 +-
 libraries/ESP8266mDNS/src/ESP8266mDNS.cpp     |    1 -
 libraries/ESP8266mDNS/src/ESP8266mDNS.h       |    6 +-
 libraries/ESP8266mDNS/src/LEAmDNS.cpp         | 1636 +++++-----
 libraries/ESP8266mDNS/src/LEAmDNS.h           | 2115 +++++++------
 libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp | 2799 ++++++++---------
 libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp |  952 +++---
 libraries/ESP8266mDNS/src/LEAmDNS_Priv.h      |   64 +-
 libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp | 2770 ++++++++--------
 .../ESP8266mDNS/src/LEAmDNS_Transfer.cpp      | 2252 ++++++-------
 libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h  |    2 +-
 libraries/Hash/examples/sha1/sha1.ino         |    1 -
 .../I2S/examples/SimpleTone/SimpleTone.ino    |   16 +-
 .../LittleFS_Timestamp/LittleFS_Timestamp.ino |   31 +-
 .../LittleFS/examples/SpeedTest/SpeedTest.ino |   27 +-
 .../Netdump/examples/Netdump/Netdump.ino      |   70 +-
 libraries/Netdump/src/Netdump.cpp             |   63 +-
 libraries/Netdump/src/NetdumpIP.cpp           |   58 +-
 libraries/Netdump/src/NetdumpIP.h             |   24 +-
 libraries/Netdump/src/NetdumpPacket.cpp       |  129 +-
 libraries/Netdump/src/NetdumpPacket.h         |   54 +-
 libraries/Netdump/src/PacketType.cpp          |   58 +-
 libraries/Netdump/src/PacketType.h            |    5 +-
 libraries/SD/examples/DumpFile/DumpFile.ino   |    1 -
 libraries/SD/examples/listfiles/listfiles.ino |   11 +-
 .../SPISlave_Master/SPISlave_Master.ino       |  105 +-
 .../SPISlave_SafeMaster.ino                   |  116 +-
 .../examples/SPISlave_Test/SPISlave_Test.ino  |   12 +-
 .../examples/drawCircle/drawCircle.ino        |   13 +-
 .../examples/drawLines/drawLines.ino          |    7 +-
 .../examples/drawNumber/drawNumber.ino        |   20 +-
 .../examples/drawRectangle/drawRectangle.ino  |    1 -
 .../examples/paint/paint.ino                  |    8 +-
 .../examples/shapes/shapes.ino                |    8 +-
 .../examples/text/text.ino                    |   17 +-
 .../examples/tftbmp2/tftbmp2.ino              |   82 +-
 .../TickerFunctional/TickerFunctional.ino     |   37 +-
 libraries/Wire/Wire.cpp                       |   42 +-
 libraries/Wire/Wire.h                         |   51 +-
 .../examples/master_reader/master_reader.ino  |   15 +-
 .../examples/master_writer/master_writer.ino  |   13 +-
 .../slave_receiver/slave_receiver.ino         |   22 +-
 .../examples/slave_sender/slave_sender.ino    |    9 +-
 libraries/esp8266/examples/Blink/Blink.ino    |    4 +-
 .../BlinkPolledTimeout/BlinkPolledTimeout.ino |   15 +-
 .../BlinkWithoutDelay/BlinkWithoutDelay.ino   |    2 +-
 .../examples/CallBackList/CallBackGeneric.ino |   28 +-
 .../examples/CheckFlashCRC/CheckFlashCRC.ino  |    7 +-
 .../CheckFlashConfig/CheckFlashConfig.ino     |   12 +-
 .../examples/ConfigFile/ConfigFile.ino        |    7 +-
 .../FadePolledTimeout/FadePolledTimeout.ino   |   13 +-
 .../examples/HeapMetric/HeapMetric.ino        |   13 +-
 .../examples/HelloCrypto/HelloCrypto.ino      |   14 +-
 .../examples/HwdtStackDump/HwdtStackDump.ino  |   17 +-
 .../examples/HwdtStackDump/ProcessKey.ino     |   25 +-
 .../esp8266/examples/I2SInput/I2SInput.ino    |    2 +-
 .../examples/I2STransmit/I2STransmit.ino      |   13 +-
 .../examples/IramReserve/IramReserve.ino      |   17 +-
 .../examples/IramReserve/ProcessKey.ino       |   25 +-
 .../examples/LowPowerDemo/LowPowerDemo.ino    |  142 +-
 libraries/esp8266/examples/MMU48K/MMU48K.ino  |  150 +-
 .../examples/NTP-TZ-DST/NTP-TZ-DST.ino        |   56 +-
 .../examples/RTCUserMemory/RTCUserMemory.ino  |   18 +-
 .../SerialDetectBaudrate.ino                  |    4 +-
 .../examples/SerialStress/SerialStress.ino    |   45 +-
 .../examples/StreamString/StreamString.ino    |   13 +-
 .../examples/TestEspApi/TestEspApi.ino        |   44 +-
 .../examples/UartDownload/UartDownload.ino    |   25 +-
 .../examples/interactive/interactive.ino      |   90 +-
 .../esp8266/examples/irammem/irammem.ino      |  212 +-
 .../examples/virtualmem/virtualmem.ino        |   30 +-
 .../lwIP_PPP/examples/PPPServer/PPPServer.ino |   11 +-
 libraries/lwIP_PPP/src/PPPServer.cpp          |   44 +-
 libraries/lwIP_PPP/src/PPPServer.h            |   18 +-
 .../lwIP_enc28j60/src/utility/enc28j60.cpp    |  114 +-
 .../lwIP_enc28j60/src/utility/enc28j60.h      |   41 +-
 libraries/lwIP_w5100/src/utility/w5100.cpp    |   49 +-
 libraries/lwIP_w5100/src/utility/w5100.h      |  175 +-
 .../examples/TCPClient/TCPClient.ino          |   12 +-
 libraries/lwIP_w5500/src/utility/w5500.cpp    |   31 +-
 libraries/lwIP_w5500/src/utility/w5500.h      |  231 +-
 tests/device/libraries/BSTest/src/BSArduino.h |   41 +-
 tests/device/libraries/BSTest/src/BSArgs.h    |  222 +-
 .../device/libraries/BSTest/src/BSProtocol.h  |  183 +-
 tests/device/libraries/BSTest/src/BSStdio.h   |   15 +-
 tests/device/libraries/BSTest/src/BSTest.h    |  122 +-
 tests/device/libraries/BSTest/test/test.cpp   |   16 +-
 tests/device/test_libc/libm_string.c          |  886 +++---
 tests/device/test_libc/memcpy-1.c             |  171 +-
 tests/device/test_libc/memmove1.c             |  189 +-
 tests/device/test_libc/strcmp-1.c             |  325 +-
 tests/device/test_libc/tstring.c              |  459 ++-
 tests/host/common/Arduino.cpp                 |   16 +-
 tests/host/common/ArduinoCatch.cpp            |    1 -
 tests/host/common/ArduinoMain.cpp             |  481 +--
 tests/host/common/ClientContextSocket.cpp     |  249 +-
 tests/host/common/EEPROM.h                    |   65 +-
 tests/host/common/HostWiring.cpp              |   64 +-
 tests/host/common/MockEEPROM.cpp              |   48 +-
 tests/host/common/MockEsp.cpp                 |  171 +-
 tests/host/common/MockSPI.cpp                 |    8 +-
 tests/host/common/MockTools.cpp               |   60 +-
 tests/host/common/MockUART.cpp                |  809 ++---
 tests/host/common/MockWiFiServer.cpp          |   25 +-
 tests/host/common/MockWiFiServerSocket.cpp    |  139 +-
 tests/host/common/MocklwIP.cpp                |  108 +-
 tests/host/common/UdpContextSocket.cpp        |  299 +-
 tests/host/common/WMath.cpp                   |   30 +-
 tests/host/common/c_types.h                   |   76 +-
 tests/host/common/include/ClientContext.h     |   86 +-
 tests/host/common/include/UdpContext.h        |   41 +-
 tests/host/common/littlefs_mock.cpp           |   11 +-
 tests/host/common/littlefs_mock.h             |   13 +-
 tests/host/common/md5.c                       |  227 +-
 tests/host/common/mock.h                      |   91 +-
 tests/host/common/noniso.c                    |   73 +-
 tests/host/common/pins_arduino.h              |    1 -
 tests/host/common/queue.h                     |  675 ++--
 tests/host/common/spiffs_mock.cpp             |   12 +-
 tests/host/common/spiffs_mock.h               |   13 +-
 tests/host/common/user_interface.cpp          |   94 +-
 tests/host/core/test_PolledTimeout.cpp        |  303 +-
 tests/host/core/test_md5builder.cpp           |   34 +-
 tests/host/core/test_pgmspace.cpp             |    7 +-
 tests/host/core/test_string.cpp               |  544 ++--
 tests/host/fs/test_fs.cpp                     |   47 +-
 tests/host/sys/pgmspace.h                     |   52 +-
 196 files changed, 12565 insertions(+), 13267 deletions(-)
 mode change 100755 => 100644 libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino

diff --git a/cores/esp8266/LwipDhcpServer-NonOS.cpp b/cores/esp8266/LwipDhcpServer-NonOS.cpp
index 0bd04ebcfe..aee22b6d5c 100644
--- a/cores/esp8266/LwipDhcpServer-NonOS.cpp
+++ b/cores/esp8266/LwipDhcpServer-NonOS.cpp
@@ -23,7 +23,7 @@
 // these functions must exists as-is with "C" interface,
 // nonos-sdk calls them at boot time and later
 
-#include <lwip/init.h> // LWIP_VERSION
+#include <lwip/init.h>  // LWIP_VERSION
 
 #include <lwip/netif.h>
 #include "LwipDhcpServer.h"
@@ -35,8 +35,7 @@ DhcpServer dhcpSoftAP(&netif_git[SOFTAP_IF]);
 
 extern "C"
 {
-
-    void dhcps_start(struct ip_info *info, netif* apnetif)
+    void dhcps_start(struct ip_info* info, netif* apnetif)
     {
         // apnetif is esp interface, replaced by lwip2's
         // netif_git[SOFTAP_IF] interface in constructor
@@ -61,4 +60,4 @@ extern "C"
         dhcpSoftAP.end();
     }
 
-} // extern "C"
+}  // extern "C"
diff --git a/cores/esp8266/LwipDhcpServer.cpp b/cores/esp8266/LwipDhcpServer.cpp
index 86f8849a91..fd25edbc50 100644
--- a/cores/esp8266/LwipDhcpServer.cpp
+++ b/cores/esp8266/LwipDhcpServer.cpp
@@ -34,9 +34,9 @@
 // (better is enemy of [good = already working])
 // ^^ this comment is supposed to be removed after the first commit
 
-#include <lwip/init.h> // LWIP_VERSION
+#include <lwip/init.h>  // LWIP_VERSION
 
-#define DHCPS_LEASE_TIME_DEF    (120)
+#define DHCPS_LEASE_TIME_DEF (120)
 
 #define USE_DNS
 
@@ -59,30 +59,30 @@ typedef struct dhcps_state
 
 typedef struct dhcps_msg
 {
-    uint8_t op, htype, hlen, hops;
-    uint8_t xid[4];
+    uint8_t  op, htype, hlen, hops;
+    uint8_t  xid[4];
     uint16_t secs, flags;
-    uint8_t ciaddr[4];
-    uint8_t yiaddr[4];
-    uint8_t siaddr[4];
-    uint8_t giaddr[4];
-    uint8_t chaddr[16];
-    uint8_t sname[64];
-    uint8_t file[128];
-    uint8_t options[312];
+    uint8_t  ciaddr[4];
+    uint8_t  yiaddr[4];
+    uint8_t  siaddr[4];
+    uint8_t  giaddr[4];
+    uint8_t  chaddr[16];
+    uint8_t  sname[64];
+    uint8_t  file[128];
+    uint8_t  options[312];
 } dhcps_msg;
 
 #ifndef LWIP_OPEN_SRC
 struct dhcps_lease
 {
-    bool enable;
+    bool             enable;
     struct ipv4_addr start_ip;
     struct ipv4_addr end_ip;
 };
 
 enum dhcps_offer_option
 {
-    OFFER_START = 0x00,
+    OFFER_START  = 0x00,
     OFFER_ROUTER = 0x01,
     OFFER_END
 };
@@ -103,50 +103,49 @@ typedef enum
 struct dhcps_pool
 {
     struct ipv4_addr ip;
-    uint8 mac[6];
-    uint32 lease_timer;
-    dhcps_type_t type;
-    dhcps_state_t state;
-
+    uint8            mac[6];
+    uint32           lease_timer;
+    dhcps_type_t     type;
+    dhcps_state_t    state;
 };
 
-#define DHCPS_LEASE_TIMER  dhcps_lease_time  //0x05A0
+#define DHCPS_LEASE_TIMER dhcps_lease_time  //0x05A0
 #define DHCPS_MAX_LEASE 0x64
 #define BOOTP_BROADCAST 0x8000
 
-#define DHCP_REQUEST        1
-#define DHCP_REPLY          2
+#define DHCP_REQUEST 1
+#define DHCP_REPLY 2
 #define DHCP_HTYPE_ETHERNET 1
-#define DHCP_HLEN_ETHERNET  6
-#define DHCP_MSG_LEN      236
-
-#define DHCPS_SERVER_PORT  67
-#define DHCPS_CLIENT_PORT  68
-
-#define DHCPDISCOVER  1
-#define DHCPOFFER     2
-#define DHCPREQUEST   3
-#define DHCPDECLINE   4
-#define DHCPACK       5
-#define DHCPNAK       6
-#define DHCPRELEASE   7
-
-#define DHCP_OPTION_SUBNET_MASK   1
-#define DHCP_OPTION_ROUTER        3
-#define DHCP_OPTION_DNS_SERVER    6
-#define DHCP_OPTION_REQ_IPADDR   50
-#define DHCP_OPTION_LEASE_TIME   51
-#define DHCP_OPTION_MSG_TYPE     53
-#define DHCP_OPTION_SERVER_ID    54
+#define DHCP_HLEN_ETHERNET 6
+#define DHCP_MSG_LEN 236
+
+#define DHCPS_SERVER_PORT 67
+#define DHCPS_CLIENT_PORT 68
+
+#define DHCPDISCOVER 1
+#define DHCPOFFER 2
+#define DHCPREQUEST 3
+#define DHCPDECLINE 4
+#define DHCPACK 5
+#define DHCPNAK 6
+#define DHCPRELEASE 7
+
+#define DHCP_OPTION_SUBNET_MASK 1
+#define DHCP_OPTION_ROUTER 3
+#define DHCP_OPTION_DNS_SERVER 6
+#define DHCP_OPTION_REQ_IPADDR 50
+#define DHCP_OPTION_LEASE_TIME 51
+#define DHCP_OPTION_MSG_TYPE 53
+#define DHCP_OPTION_SERVER_ID 54
 #define DHCP_OPTION_INTERFACE_MTU 26
 #define DHCP_OPTION_PERFORM_ROUTER_DISCOVERY 31
 #define DHCP_OPTION_BROADCAST_ADDRESS 28
-#define DHCP_OPTION_REQ_LIST     55
-#define DHCP_OPTION_END         255
+#define DHCP_OPTION_REQ_LIST 55
+#define DHCP_OPTION_END 255
 
 //#define USE_CLASS_B_NET 1
-#define DHCPS_DEBUG          0
-#define MAX_STATION_NUM      8
+#define DHCPS_DEBUG 0
+#define MAX_STATION_NUM 8
 
 #define DHCPS_STATE_OFFER 1
 #define DHCPS_STATE_DECLINE 2
@@ -155,31 +154,41 @@ struct dhcps_pool
 #define DHCPS_STATE_IDLE 5
 #define DHCPS_STATE_RELEASE 6
 
-#define   dhcps_router_enabled(offer)	((offer & OFFER_ROUTER) != 0)
+#define dhcps_router_enabled(offer) ((offer & OFFER_ROUTER) != 0)
 
 #ifdef MEMLEAK_DEBUG
 const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__;
 #endif
 
 #if DHCPS_DEBUG
-#define LWIP_IS_OK(what,err) ({ int ret = 1, errval = (err); if (errval != ERR_OK) { os_printf("DHCPS ERROR: %s (lwip:%d)\n", what, errval); ret = 0; } ret; })
+#define LWIP_IS_OK(what, err) (                                     \
+    {                                                               \
+        int ret = 1, errval = (err);                                \
+        if (errval != ERR_OK)                                       \
+        {                                                           \
+            os_printf("DHCPS ERROR: %s (lwip:%d)\n", what, errval); \
+            ret = 0;                                                \
+        }                                                           \
+        ret;                                                        \
+    })
 #else
-#define LWIP_IS_OK(what,err) ((err) == ERR_OK)
+#define LWIP_IS_OK(what, err) ((err) == ERR_OK)
 #endif
 
-const uint32 DhcpServer::magic_cookie = 0x63538263; // https://tools.ietf.org/html/rfc1497
+const uint32 DhcpServer::magic_cookie = 0x63538263;  // https://tools.ietf.org/html/rfc1497
 
 int fw_has_started_softap_dhcps = 0;
 
 ////////////////////////////////////////////////////////////////////////////////////
 
-DhcpServer::DhcpServer(netif* netif): _netif(netif)
+DhcpServer::DhcpServer(netif* netif) :
+    _netif(netif)
 {
-    pcb_dhcps = nullptr;
+    pcb_dhcps        = nullptr;
     dns_address.addr = 0;
-    plist = nullptr;
-    offer = 0xFF;
-    renew = false;
+    plist            = nullptr;
+    offer            = 0xFF;
+    renew            = false;
     dhcps_lease_time = DHCPS_LEASE_TIME_DEF;  //minute
 
     if (netif->num == SOFTAP_IF && fw_has_started_softap_dhcps == 1)
@@ -188,14 +197,13 @@ DhcpServer::DhcpServer(netif* netif): _netif(netif)
         // 1. `fw_has_started_softap_dhcps` is already initialized to 1
         // 2. global ctor DhcpServer's `dhcpSoftAP(&netif_git[SOFTAP_IF])` is called
         // 3. (that's here) => begin(legacy-values) is called
-        ip_info ip =
-        {
-            { 0x0104a8c0 }, // IP 192.168.4.1
-            { 0x00ffffff }, // netmask 255.255.255.0
-            { 0 }           // gateway 0.0.0.0
+        ip_info ip = {
+            { 0x0104a8c0 },  // IP 192.168.4.1
+            { 0x00ffffff },  // netmask 255.255.255.0
+            { 0 }            // gateway 0.0.0.0
         };
         begin(&ip);
-        fw_has_started_softap_dhcps = 2; // not 1, ending initial boot sequence
+        fw_has_started_softap_dhcps = 2;  // not 1, ending initial boot sequence
     }
 };
 
@@ -217,25 +225,25 @@ void DhcpServer::dhcps_set_dns(int num, const ipv4_addr_t* dns)
     Parameters   : arg -- Additional argument to pass to the callback function
     Returns      : none
 *******************************************************************************/
-void DhcpServer::node_insert_to_list(list_node **phead, list_node* pinsert)
+void DhcpServer::node_insert_to_list(list_node** phead, list_node* pinsert)
 {
-    list_node *plist = nullptr;
-    struct dhcps_pool *pdhcps_pool = nullptr;
-    struct dhcps_pool *pdhcps_node = nullptr;
+    list_node*         plist       = nullptr;
+    struct dhcps_pool* pdhcps_pool = nullptr;
+    struct dhcps_pool* pdhcps_node = nullptr;
     if (*phead == nullptr)
     {
         *phead = pinsert;
     }
     else
     {
-        plist = *phead;
+        plist       = *phead;
         pdhcps_node = (struct dhcps_pool*)pinsert->pnode;
         pdhcps_pool = (struct dhcps_pool*)plist->pnode;
 
         if (pdhcps_node->ip.addr < pdhcps_pool->ip.addr)
         {
             pinsert->pnext = plist;
-            *phead = pinsert;
+            *phead         = pinsert;
         }
         else
         {
@@ -245,7 +253,7 @@ void DhcpServer::node_insert_to_list(list_node **phead, list_node* pinsert)
                 if (pdhcps_node->ip.addr < pdhcps_pool->ip.addr)
                 {
                     pinsert->pnext = plist->pnext;
-                    plist->pnext = pinsert;
+                    plist->pnext   = pinsert;
                     break;
                 }
                 plist = plist->pnext;
@@ -266,9 +274,9 @@ void DhcpServer::node_insert_to_list(list_node **phead, list_node* pinsert)
     Parameters   : arg -- Additional argument to pass to the callback function
     Returns      : none
 *******************************************************************************/
-void DhcpServer::node_remove_from_list(list_node **phead, list_node* pdelete)
+void DhcpServer::node_remove_from_list(list_node** phead, list_node* pdelete)
 {
-    list_node *plist = nullptr;
+    list_node* plist = nullptr;
 
     plist = *phead;
     if (plist == nullptr)
@@ -279,7 +287,7 @@ void DhcpServer::node_remove_from_list(list_node **phead, list_node* pdelete)
     {
         if (plist == pdelete)
         {
-            *phead = plist->pnext;
+            *phead         = plist->pnext;
             pdelete->pnext = nullptr;
         }
         else
@@ -288,7 +296,7 @@ void DhcpServer::node_remove_from_list(list_node **phead, list_node* pdelete)
             {
                 if (plist->pnext == pdelete)
                 {
-                    plist->pnext = pdelete->pnext;
+                    plist->pnext   = pdelete->pnext;
                     pdelete->pnext = nullptr;
                 }
                 plist = plist->pnext;
@@ -303,13 +311,13 @@ void DhcpServer::node_remove_from_list(list_node **phead, list_node* pdelete)
     Parameters   : mac address
     Returns      : true if ok and false if this mac already exist or if all ip are already reserved
 *******************************************************************************/
-bool DhcpServer::add_dhcps_lease(uint8 *macaddr)
+bool DhcpServer::add_dhcps_lease(uint8* macaddr)
 {
-    struct dhcps_pool *pdhcps_pool = nullptr;
-    list_node *pback_node = nullptr;
+    struct dhcps_pool* pdhcps_pool = nullptr;
+    list_node*         pback_node  = nullptr;
 
     uint32 start_ip = dhcps_lease.start_ip.addr;
-    uint32 end_ip = dhcps_lease.end_ip.addr;
+    uint32 end_ip   = dhcps_lease.end_ip.addr;
 
     for (pback_node = plist; pback_node != nullptr; pback_node = pback_node->pnext)
     {
@@ -335,15 +343,15 @@ bool DhcpServer::add_dhcps_lease(uint8 *macaddr)
         return false;
     }
 
-    pdhcps_pool = (struct dhcps_pool *)zalloc(sizeof(struct dhcps_pool));
+    pdhcps_pool          = (struct dhcps_pool*)zalloc(sizeof(struct dhcps_pool));
     pdhcps_pool->ip.addr = start_ip;
     memcpy(pdhcps_pool->mac, macaddr, sizeof(pdhcps_pool->mac));
     pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-    pdhcps_pool->type = DHCPS_TYPE_STATIC;
-    pdhcps_pool->state = DHCPS_STATE_ONLINE;
-    pback_node = (list_node *)zalloc(sizeof(list_node));
-    pback_node->pnode = pdhcps_pool;
-    pback_node->pnext = nullptr;
+    pdhcps_pool->type        = DHCPS_TYPE_STATIC;
+    pdhcps_pool->state       = DHCPS_STATE_ONLINE;
+    pback_node               = (list_node*)zalloc(sizeof(list_node));
+    pback_node->pnode        = pdhcps_pool;
+    pback_node->pnext        = nullptr;
     node_insert_to_list(&plist, pback_node);
 
     return true;
@@ -359,9 +367,8 @@ bool DhcpServer::add_dhcps_lease(uint8 *macaddr)
     @return uint8_t* DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-uint8_t* DhcpServer::add_msg_type(uint8_t *optptr, uint8_t type)
+uint8_t* DhcpServer::add_msg_type(uint8_t* optptr, uint8_t type)
 {
-
     *optptr++ = DHCP_OPTION_MSG_TYPE;
     *optptr++ = 1;
     *optptr++ = type;
@@ -376,7 +383,7 @@ uint8_t* DhcpServer::add_msg_type(uint8_t *optptr, uint8_t type)
     @return uint8_t* DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-uint8_t* DhcpServer::add_offer_options(uint8_t *optptr)
+uint8_t* DhcpServer::add_offer_options(uint8_t* optptr)
 {
     //struct ipv4_addr ipadd;
     //ipadd.addr = server_address.addr;
@@ -448,19 +455,19 @@ uint8_t* DhcpServer::add_offer_options(uint8_t *optptr)
     *optptr++ = DHCP_OPTION_INTERFACE_MTU;
     *optptr++ = 2;
     *optptr++ = 0x05;
-    *optptr++ = 0xdc; // 1500
+    *optptr++ = 0xdc;  // 1500
 
     *optptr++ = DHCP_OPTION_PERFORM_ROUTER_DISCOVERY;
     *optptr++ = 1;
     *optptr++ = 0x00;
 
-#if 0 // vendor specific uninitialized (??)
+#if 0  // vendor specific uninitialized (??)
     *optptr++ = 43; // vendor specific
     *optptr++ = 6;
     // uninitialized ?
 #endif
 
-#if 0 // already set (DHCP_OPTION_SUBNET_MASK==1) (??)
+#if 0  // already set (DHCP_OPTION_SUBNET_MASK==1) (??)
     *optptr++ = 0x01;
     *optptr++ = 4;
     *optptr++ = 0;
@@ -483,35 +490,34 @@ uint8_t* DhcpServer::add_offer_options(uint8_t *optptr)
     @return uint8_t* DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-uint8_t* DhcpServer::add_end(uint8_t *optptr)
+uint8_t* DhcpServer::add_end(uint8_t* optptr)
 {
-
     *optptr++ = DHCP_OPTION_END;
     return optptr;
 }
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
-void DhcpServer::create_msg(struct dhcps_msg *m)
+void DhcpServer::create_msg(struct dhcps_msg* m)
 {
     struct ipv4_addr client;
 
     client.addr = client_address.addr;
 
-    m->op = DHCP_REPLY;
+    m->op    = DHCP_REPLY;
     m->htype = DHCP_HTYPE_ETHERNET;
-    m->hlen = 6;
-    m->hops = 0;
-    m->secs = 0;
+    m->hlen  = 6;
+    m->hops  = 0;
+    m->secs  = 0;
     m->flags = htons(BOOTP_BROADCAST);
 
-    memcpy((char *) m->yiaddr, (char *) &client.addr, sizeof(m->yiaddr));
-    memset((char *) m->ciaddr, 0, sizeof(m->ciaddr));
-    memset((char *) m->siaddr, 0, sizeof(m->siaddr));
-    memset((char *) m->giaddr, 0, sizeof(m->giaddr));
-    memset((char *) m->sname, 0, sizeof(m->sname));
-    memset((char *) m->file, 0, sizeof(m->file));
-    memset((char *) m->options, 0, sizeof(m->options));
-    memcpy((char *) m->options, &magic_cookie, sizeof(magic_cookie));
+    memcpy((char*)m->yiaddr, (char*)&client.addr, sizeof(m->yiaddr));
+    memset((char*)m->ciaddr, 0, sizeof(m->ciaddr));
+    memset((char*)m->siaddr, 0, sizeof(m->siaddr));
+    memset((char*)m->giaddr, 0, sizeof(m->giaddr));
+    memset((char*)m->sname, 0, sizeof(m->sname));
+    memset((char*)m->file, 0, sizeof(m->file));
+    memset((char*)m->options, 0, sizeof(m->options));
+    memcpy((char*)m->options, &magic_cookie, sizeof(magic_cookie));
 }
 ///////////////////////////////////////////////////////////////////////////////////
 /*
@@ -520,13 +526,13 @@ void DhcpServer::create_msg(struct dhcps_msg *m)
     @param -- m DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-void DhcpServer::send_offer(struct dhcps_msg *m)
+void DhcpServer::send_offer(struct dhcps_msg* m)
 {
-    uint8_t *end;
+    uint8_t*     end;
     struct pbuf *p, *q;
-    u8_t *data;
-    u16_t cnt = 0;
-    u16_t i;
+    u8_t*        data;
+    u16_t        cnt = 0;
+    u16_t        i;
     create_msg(m);
 
     end = add_msg_type(&m->options[4], DHCPOFFER);
@@ -539,7 +545,6 @@ void DhcpServer::send_offer(struct dhcps_msg *m)
 #endif
     if (p != nullptr)
     {
-
 #if DHCPS_DEBUG
         os_printf("dhcps: send_offer>>pbuf_alloc succeed\n");
         os_printf("dhcps: send_offer>>p->tot_len = %d\n", p->tot_len);
@@ -548,10 +553,10 @@ void DhcpServer::send_offer(struct dhcps_msg *m)
         q = p;
         while (q != nullptr)
         {
-            data = (u8_t *)q->payload;
+            data = (u8_t*)q->payload;
             for (i = 0; i < q->len; i++)
             {
-                data[i] = ((u8_t *) m)[cnt++];
+                data[i] = ((u8_t*)m)[cnt++];
             }
 
             q = q->next;
@@ -559,7 +564,6 @@ void DhcpServer::send_offer(struct dhcps_msg *m)
     }
     else
     {
-
 #if DHCPS_DEBUG
         os_printf("dhcps: send_offer>>pbuf_alloc failed\n");
 #endif
@@ -586,14 +590,13 @@ void DhcpServer::send_offer(struct dhcps_msg *m)
     @param m DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-void DhcpServer::send_nak(struct dhcps_msg *m)
+void DhcpServer::send_nak(struct dhcps_msg* m)
 {
-
-    u8_t *end;
+    u8_t*        end;
     struct pbuf *p, *q;
-    u8_t *data;
-    u16_t cnt = 0;
-    u16_t i;
+    u8_t*        data;
+    u16_t        cnt = 0;
+    u16_t        i;
     create_msg(m);
 
     end = add_msg_type(&m->options[4], DHCPNAK);
@@ -605,7 +608,6 @@ void DhcpServer::send_nak(struct dhcps_msg *m)
 #endif
     if (p != nullptr)
     {
-
 #if DHCPS_DEBUG
         os_printf("dhcps: send_nak>>pbuf_alloc succeed\n");
         os_printf("dhcps: send_nak>>p->tot_len = %d\n", p->tot_len);
@@ -614,10 +616,10 @@ void DhcpServer::send_nak(struct dhcps_msg *m)
         q = p;
         while (q != nullptr)
         {
-            data = (u8_t *)q->payload;
+            data = (u8_t*)q->payload;
             for (i = 0; i < q->len; i++)
             {
-                data[i] = ((u8_t *) m)[cnt++];
+                data[i] = ((u8_t*)m)[cnt++];
             }
 
             q = q->next;
@@ -625,7 +627,6 @@ void DhcpServer::send_nak(struct dhcps_msg *m)
     }
     else
     {
-
 #if DHCPS_DEBUG
         os_printf("dhcps: send_nak>>pbuf_alloc failed\n");
 #endif
@@ -647,14 +648,13 @@ void DhcpServer::send_nak(struct dhcps_msg *m)
     @param m DHCP msg
 */
 ///////////////////////////////////////////////////////////////////////////////////
-void DhcpServer::send_ack(struct dhcps_msg *m)
+void DhcpServer::send_ack(struct dhcps_msg* m)
 {
-
-    u8_t *end;
+    u8_t*        end;
     struct pbuf *p, *q;
-    u8_t *data;
-    u16_t cnt = 0;
-    u16_t i;
+    u8_t*        data;
+    u16_t        cnt = 0;
+    u16_t        i;
     create_msg(m);
 
     end = add_msg_type(&m->options[4], DHCPACK);
@@ -667,7 +667,6 @@ void DhcpServer::send_ack(struct dhcps_msg *m)
 #endif
     if (p != nullptr)
     {
-
 #if DHCPS_DEBUG
         os_printf("dhcps: send_ack>>pbuf_alloc succeed\n");
         os_printf("dhcps: send_ack>>p->tot_len = %d\n", p->tot_len);
@@ -676,10 +675,10 @@ void DhcpServer::send_ack(struct dhcps_msg *m)
         q = p;
         while (q != nullptr)
         {
-            data = (u8_t *)q->payload;
+            data = (u8_t*)q->payload;
             for (i = 0; i < q->len; i++)
             {
-                data[i] = ((u8_t *) m)[cnt++];
+                data[i] = ((u8_t*)m)[cnt++];
             }
 
             q = q->next;
@@ -687,7 +686,6 @@ void DhcpServer::send_ack(struct dhcps_msg *m)
     }
     else
     {
-
 #if DHCPS_DEBUG
         os_printf("dhcps: send_ack>>pbuf_alloc failed\n");
 #endif
@@ -718,15 +716,15 @@ void DhcpServer::send_ack(struct dhcps_msg *m)
     @return uint8_t* DHCP Server
 */
 ///////////////////////////////////////////////////////////////////////////////////
-uint8_t DhcpServer::parse_options(uint8_t *optptr, sint16_t len)
+uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
 {
-    struct ipv4_addr client;
-    bool is_dhcp_parse_end = false;
+    struct ipv4_addr   client;
+    bool               is_dhcp_parse_end = false;
     struct dhcps_state s;
 
     client.addr = client_address.addr;
 
-    u8_t *end = optptr + len;
+    u8_t* end  = optptr + len;
     u16_t type = 0;
 
     s.state = DHCPS_STATE_IDLE;
@@ -736,16 +734,15 @@ uint8_t DhcpServer::parse_options(uint8_t *optptr, sint16_t len)
 #if DHCPS_DEBUG
         os_printf("dhcps: (sint16_t)*optptr = %d\n", (sint16_t)*optptr);
 #endif
-        switch ((sint16_t) *optptr)
+        switch ((sint16_t)*optptr)
         {
-
         case DHCP_OPTION_MSG_TYPE:  //53
             type = *(optptr + 2);
             break;
 
-        case DHCP_OPTION_REQ_IPADDR://50
+        case DHCP_OPTION_REQ_IPADDR:  //50
             //os_printf("dhcps:0x%08x,0x%08x\n",client.addr,*(uint32*)(optptr+2));
-            if (memcmp((char *) &client.addr, (char *) optptr + 2, 4) == 0)
+            if (memcmp((char*)&client.addr, (char*)optptr + 2, 4) == 0)
             {
 #if DHCPS_DEBUG
                 os_printf("dhcps: DHCP_OPTION_REQ_IPADDR = 0 ok\n");
@@ -777,14 +774,14 @@ uint8_t DhcpServer::parse_options(uint8_t *optptr, sint16_t len)
 
     switch (type)
     {
-    case DHCPDISCOVER://1
+    case DHCPDISCOVER:  //1
         s.state = DHCPS_STATE_OFFER;
 #if DHCPS_DEBUG
         os_printf("dhcps: DHCPD_STATE_OFFER\n");
 #endif
         break;
 
-    case DHCPREQUEST://3
+    case DHCPREQUEST:  //3
         if (!(s.state == DHCPS_STATE_ACK || s.state == DHCPS_STATE_NAK))
         {
             if (renew == true)
@@ -801,14 +798,14 @@ uint8_t DhcpServer::parse_options(uint8_t *optptr, sint16_t len)
         }
         break;
 
-    case DHCPDECLINE://4
+    case DHCPDECLINE:  //4
         s.state = DHCPS_STATE_IDLE;
 #if DHCPS_DEBUG
         os_printf("dhcps: DHCPD_STATE_IDLE\n");
 #endif
         break;
 
-    case DHCPRELEASE://7
+    case DHCPRELEASE:  //7
         s.state = DHCPS_STATE_RELEASE;
 #if DHCPS_DEBUG
         os_printf("dhcps: DHCPD_STATE_IDLE\n");
@@ -822,11 +819,12 @@ uint8_t DhcpServer::parse_options(uint8_t *optptr, sint16_t len)
 }
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////
-sint16_t DhcpServer::parse_msg(struct dhcps_msg *m, u16_t len)
+sint16_t DhcpServer::parse_msg(struct dhcps_msg* m, u16_t len)
 {
-    if (memcmp((char *)m->options,
+    if (memcmp((char*)m->options,
                &magic_cookie,
-               sizeof(magic_cookie)) == 0)
+               sizeof(magic_cookie))
+        == 0)
     {
         struct ipv4_addr ip;
         memcpy(&ip.addr, m->ciaddr, sizeof(ip.addr));
@@ -836,7 +834,7 @@ sint16_t DhcpServer::parse_msg(struct dhcps_msg *m, u16_t len)
 
         if (ret == DHCPS_STATE_RELEASE)
         {
-            dhcps_client_leave(m->chaddr, &ip, true); // force to delete
+            dhcps_client_leave(m->chaddr, &ip, true);  // force to delete
             client_address.addr = ip.addr;
         }
 
@@ -857,32 +855,32 @@ sint16_t DhcpServer::parse_msg(struct dhcps_msg *m, u16_t len)
 */
 ///////////////////////////////////////////////////////////////////////////////////
 
-void DhcpServer::S_handle_dhcp(void *arg,
-                               struct udp_pcb *pcb,
-                               struct pbuf *p,
-                               const ip_addr_t *addr,
-                               uint16_t port)
+void DhcpServer::S_handle_dhcp(void*            arg,
+                               struct udp_pcb*  pcb,
+                               struct pbuf*     p,
+                               const ip_addr_t* addr,
+                               uint16_t         port)
 {
     DhcpServer* instance = reinterpret_cast<DhcpServer*>(arg);
     instance->handle_dhcp(pcb, p, addr, port);
 }
 
 void DhcpServer::handle_dhcp(
-    struct udp_pcb *pcb,
-    struct pbuf *p,
-    const ip_addr_t *addr,
-    uint16_t port)
+    struct udp_pcb*  pcb,
+    struct pbuf*     p,
+    const ip_addr_t* addr,
+    uint16_t         port)
 {
     (void)pcb;
     (void)addr;
     (void)port;
 
-    struct dhcps_msg *pmsg_dhcps = nullptr;
-    sint16_t tlen = 0;
-    u16_t i = 0;
-    u16_t dhcps_msg_cnt = 0;
-    u8_t *p_dhcps_msg = nullptr;
-    u8_t *data = nullptr;
+    struct dhcps_msg* pmsg_dhcps    = nullptr;
+    sint16_t          tlen          = 0;
+    u16_t             i             = 0;
+    u16_t             dhcps_msg_cnt = 0;
+    u8_t*             p_dhcps_msg   = nullptr;
+    u8_t*             data          = nullptr;
 
 #if DHCPS_DEBUG
     os_printf("dhcps: handle_dhcp-> receive a packet\n");
@@ -892,15 +890,15 @@ void DhcpServer::handle_dhcp(
         return;
     }
 
-    pmsg_dhcps = (struct dhcps_msg *)zalloc(sizeof(struct dhcps_msg));
+    pmsg_dhcps = (struct dhcps_msg*)zalloc(sizeof(struct dhcps_msg));
     if (nullptr == pmsg_dhcps)
     {
         pbuf_free(p);
         return;
     }
-    p_dhcps_msg = (u8_t *)pmsg_dhcps;
-    tlen = p->tot_len;
-    data = (u8_t*)p->payload;
+    p_dhcps_msg = (u8_t*)pmsg_dhcps;
+    tlen        = p->tot_len;
+    data        = (u8_t*)p->payload;
 
 #if DHCPS_DEBUG
     os_printf("dhcps: handle_dhcp-> p->tot_len = %d\n", tlen);
@@ -933,14 +931,13 @@ void DhcpServer::handle_dhcp(
 
     switch (parse_msg(pmsg_dhcps, tlen - 240))
     {
-
-    case DHCPS_STATE_OFFER://1
+    case DHCPS_STATE_OFFER:  //1
 #if DHCPS_DEBUG
         os_printf("dhcps: handle_dhcp-> DHCPD_STATE_OFFER\n");
 #endif
         send_offer(pmsg_dhcps);
         break;
-    case DHCPS_STATE_ACK://3
+    case DHCPS_STATE_ACK:  //3
 #if DHCPS_DEBUG
         os_printf("dhcps: handle_dhcp-> DHCPD_STATE_ACK\n");
 #endif
@@ -950,13 +947,13 @@ void DhcpServer::handle_dhcp(
             wifi_softap_set_station_info(pmsg_dhcps->chaddr, &client_address);
         }
         break;
-    case DHCPS_STATE_NAK://4
+    case DHCPS_STATE_NAK:  //4
 #if DHCPS_DEBUG
         os_printf("dhcps: handle_dhcp-> DHCPD_STATE_NAK\n");
 #endif
         send_nak(pmsg_dhcps);
         break;
-    default :
+    default:
         break;
     }
 #if DHCPS_DEBUG
@@ -971,12 +968,12 @@ void DhcpServer::init_dhcps_lease(uint32 ip)
 {
     uint32 softap_ip = 0, local_ip = 0;
     uint32 start_ip = 0;
-    uint32 end_ip = 0;
+    uint32 end_ip   = 0;
     if (dhcps_lease.enable == true)
     {
         softap_ip = htonl(ip);
-        start_ip = htonl(dhcps_lease.start_ip.addr);
-        end_ip = htonl(dhcps_lease.end_ip.addr);
+        start_ip  = htonl(dhcps_lease.start_ip.addr);
+        end_ip    = htonl(dhcps_lease.end_ip.addr);
         /*config ip information can't contain local ip*/
         if ((start_ip <= softap_ip) && (softap_ip <= end_ip))
         {
@@ -987,7 +984,7 @@ void DhcpServer::init_dhcps_lease(uint32 ip)
             /*config ip information must be in the same segment as the local ip*/
             softap_ip >>= 8;
             if (((start_ip >> 8 != softap_ip) || (end_ip >> 8 != softap_ip))
-                    || (end_ip - start_ip > DHCPS_MAX_LEASE))
+                || (end_ip - start_ip > DHCPS_MAX_LEASE))
             {
                 dhcps_lease.enable = false;
             }
@@ -1005,14 +1002,14 @@ void DhcpServer::init_dhcps_lease(uint32 ip)
         }
         else
         {
-            local_ip ++;
+            local_ip++;
         }
 
         bzero(&dhcps_lease, sizeof(dhcps_lease));
         dhcps_lease.start_ip.addr = softap_ip | local_ip;
-        dhcps_lease.end_ip.addr = softap_ip | (local_ip + DHCPS_MAX_LEASE - 1);
+        dhcps_lease.end_ip.addr   = softap_ip | (local_ip + DHCPS_MAX_LEASE - 1);
         dhcps_lease.start_ip.addr = htonl(dhcps_lease.start_ip.addr);
-        dhcps_lease.end_ip.addr = htonl(dhcps_lease.end_ip.addr);
+        dhcps_lease.end_ip.addr   = htonl(dhcps_lease.end_ip.addr);
     }
     //  dhcps_lease.start_ip.addr = htonl(dhcps_lease.start_ip.addr);
     //  dhcps_lease.end_ip.addr= htonl(dhcps_lease.end_ip.addr);
@@ -1020,7 +1017,7 @@ void DhcpServer::init_dhcps_lease(uint32 ip)
 }
 ///////////////////////////////////////////////////////////////////////////////////
 
-bool DhcpServer::begin(struct ip_info *info)
+bool DhcpServer::begin(struct ip_info* info)
 {
     if (pcb_dhcps != nullptr)
     {
@@ -1053,9 +1050,9 @@ bool DhcpServer::begin(struct ip_info *info)
 
     if (_netif->num == SOFTAP_IF)
     {
-        wifi_set_ip_info(SOFTAP_IF, info);    // added for lwip-git, not sure whether useful
+        wifi_set_ip_info(SOFTAP_IF, info);  // added for lwip-git, not sure whether useful
     }
-    _netif->flags |= NETIF_FLAG_UP | NETIF_FLAG_LINK_UP; // added for lwip-git
+    _netif->flags |= NETIF_FLAG_UP | NETIF_FLAG_LINK_UP;  // added for lwip-git
 
     return true;
 }
@@ -1077,17 +1074,17 @@ void DhcpServer::end()
     pcb_dhcps = nullptr;
 
     //udp_remove(pcb_dhcps);
-    list_node *pnode = nullptr;
-    list_node *pback_node = nullptr;
-    struct dhcps_pool* dhcp_node = nullptr;
-    struct ipv4_addr ip_zero;
+    list_node*         pnode      = nullptr;
+    list_node*         pback_node = nullptr;
+    struct dhcps_pool* dhcp_node  = nullptr;
+    struct ipv4_addr   ip_zero;
 
     memset(&ip_zero, 0x0, sizeof(ip_zero));
     pnode = plist;
     while (pnode != nullptr)
     {
         pback_node = pnode;
-        pnode = pback_node->pnext;
+        pnode      = pback_node->pnext;
         node_remove_from_list(&plist, pback_node);
         dhcp_node = (struct dhcps_pool*)pback_node->pnode;
         //dhcps_client_leave(dhcp_node->mac,&dhcp_node->ip,true); // force to delete
@@ -1107,7 +1104,6 @@ bool DhcpServer::isRunning()
     return !!_netif->state;
 }
 
-
 /******************************************************************************
     FunctionName : set_dhcps_lease
     Description  : set the lease information of DHCP server
@@ -1115,11 +1111,11 @@ bool DhcpServer::isRunning()
                             Little-Endian.
     Returns      : true or false
 *******************************************************************************/
-bool DhcpServer::set_dhcps_lease(struct dhcps_lease *please)
+bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
 {
     uint32 softap_ip = 0;
-    uint32 start_ip = 0;
-    uint32 end_ip = 0;
+    uint32 start_ip  = 0;
+    uint32 end_ip    = 0;
 
     if (_netif->num == SOFTAP_IF || _netif->num == STATION_IF)
     {
@@ -1141,8 +1137,8 @@ bool DhcpServer::set_dhcps_lease(struct dhcps_lease *please)
         // - is wrong
         // - limited to /24 address plans
         softap_ip = htonl(ip_2_ip4(&_netif->ip_addr)->addr);
-        start_ip = htonl(please->start_ip.addr);
-        end_ip = htonl(please->end_ip.addr);
+        start_ip  = htonl(please->start_ip.addr);
+        end_ip    = htonl(please->end_ip.addr);
         /*config ip information can't contain local ip*/
         if ((start_ip <= softap_ip) && (softap_ip <= end_ip))
         {
@@ -1152,7 +1148,7 @@ bool DhcpServer::set_dhcps_lease(struct dhcps_lease *please)
         /*config ip information must be in the same segment as the local ip*/
         softap_ip >>= 8;
         if ((start_ip >> 8 != softap_ip)
-                || (end_ip >> 8 != softap_ip))
+            || (end_ip >> 8 != softap_ip))
         {
             return false;
         }
@@ -1166,7 +1162,7 @@ bool DhcpServer::set_dhcps_lease(struct dhcps_lease *please)
         //      dhcps_lease.start_ip.addr = start_ip;
         //      dhcps_lease.end_ip.addr = end_ip;
         dhcps_lease.start_ip.addr = please->start_ip.addr;
-        dhcps_lease.end_ip.addr = please->end_ip.addr;
+        dhcps_lease.end_ip.addr   = please->end_ip.addr;
     }
     dhcps_lease.enable = please->enable;
     //  dhcps_lease_flag = false;
@@ -1180,7 +1176,7 @@ bool DhcpServer::set_dhcps_lease(struct dhcps_lease *please)
                             Little-Endian.
     Returns      : true or false
 *******************************************************************************/
-bool DhcpServer::get_dhcps_lease(struct dhcps_lease *please)
+bool DhcpServer::get_dhcps_lease(struct dhcps_lease* please)
 {
     if (_netif->num == SOFTAP_IF)
     {
@@ -1219,32 +1215,33 @@ bool DhcpServer::get_dhcps_lease(struct dhcps_lease *please)
     //      please->end_ip.addr = dhcps_lease.end_ip.addr;
     //  }
     please->start_ip.addr = dhcps_lease.start_ip.addr;
-    please->end_ip.addr = dhcps_lease.end_ip.addr;
+    please->end_ip.addr   = dhcps_lease.end_ip.addr;
     return true;
 }
 
 void DhcpServer::kill_oldest_dhcps_pool(void)
 {
-    list_node *pre = nullptr, *p = nullptr;
-    list_node *minpre = nullptr, *minp = nullptr;
+    list_node *        pre = nullptr, *p = nullptr;
+    list_node *        minpre = nullptr, *minp = nullptr;
     struct dhcps_pool *pdhcps_pool = nullptr, *pmin_pool = nullptr;
-    pre = plist;
-    p = pre->pnext;
+    pre    = plist;
+    p      = pre->pnext;
     minpre = pre;
-    minp = p;
+    minp   = p;
     while (p != nullptr)
     {
         pdhcps_pool = (struct dhcps_pool*)p->pnode;
-        pmin_pool = (struct dhcps_pool*)minp->pnode;
+        pmin_pool   = (struct dhcps_pool*)minp->pnode;
         if (pdhcps_pool->lease_timer < pmin_pool->lease_timer)
         {
-            minp = p;
+            minp   = p;
             minpre = pre;
         }
         pre = p;
-        p = p->pnext;
+        p   = p->pnext;
     }
-    minpre->pnext = minp->pnext; pdhcps_pool->state = DHCPS_STATE_OFFLINE;
+    minpre->pnext      = minp->pnext;
+    pdhcps_pool->state = DHCPS_STATE_OFFLINE;
     free(minp->pnode);
     minp->pnode = nullptr;
     free(minp);
@@ -1253,22 +1250,22 @@ void DhcpServer::kill_oldest_dhcps_pool(void)
 
 void DhcpServer::dhcps_coarse_tmr(void)
 {
-    uint8 num_dhcps_pool = 0;
-    list_node *pback_node = nullptr;
-    list_node *pnode = nullptr;
-    struct dhcps_pool *pdhcps_pool = nullptr;
-    pnode = plist;
+    uint8              num_dhcps_pool = 0;
+    list_node*         pback_node     = nullptr;
+    list_node*         pnode          = nullptr;
+    struct dhcps_pool* pdhcps_pool    = nullptr;
+    pnode                             = plist;
     while (pnode != nullptr)
     {
         pdhcps_pool = (struct dhcps_pool*)pnode->pnode;
         if (pdhcps_pool->type == DHCPS_TYPE_DYNAMIC)
         {
-            pdhcps_pool->lease_timer --;
+            pdhcps_pool->lease_timer--;
         }
         if (pdhcps_pool->lease_timer == 0)
         {
             pback_node = pnode;
-            pnode = pback_node->pnext;
+            pnode      = pback_node->pnext;
             node_remove_from_list(&plist, pback_node);
             free(pback_node->pnode);
             pback_node->pnode = nullptr;
@@ -1277,8 +1274,8 @@ void DhcpServer::dhcps_coarse_tmr(void)
         }
         else
         {
-            pnode = pnode ->pnext;
-            num_dhcps_pool ++;
+            pnode = pnode->pnext;
+            num_dhcps_pool++;
         }
     }
 
@@ -1305,10 +1302,10 @@ bool DhcpServer::set_dhcps_offer_option(uint8 level, void* optarg)
     switch (level)
     {
     case OFFER_ROUTER:
-        offer = (*(uint8 *)optarg) & 0x01;
+        offer      = (*(uint8*)optarg) & 0x01;
         offer_flag = true;
         break;
-    default :
+    default:
         offer_flag = false;
         break;
     }
@@ -1358,15 +1355,15 @@ bool DhcpServer::reset_dhcps_lease_time(void)
     return true;
 }
 
-uint32 DhcpServer::get_dhcps_lease_time(void) // minute
+uint32 DhcpServer::get_dhcps_lease_time(void)  // minute
 {
     return dhcps_lease_time;
 }
 
-void DhcpServer::dhcps_client_leave(u8 *bssid, struct ipv4_addr *ip, bool force)
+void DhcpServer::dhcps_client_leave(u8* bssid, struct ipv4_addr* ip, bool force)
 {
-    struct dhcps_pool *pdhcps_pool = nullptr;
-    list_node *pback_node = nullptr;
+    struct dhcps_pool* pdhcps_pool = nullptr;
+    list_node*         pback_node  = nullptr;
 
     if ((bssid == nullptr) || (ip == nullptr))
     {
@@ -1412,16 +1409,16 @@ void DhcpServer::dhcps_client_leave(u8 *bssid, struct ipv4_addr *ip, bool force)
     }
 }
 
-uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
+uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
 {
-    struct dhcps_pool *pdhcps_pool = nullptr;
-    list_node *pback_node = nullptr;
-    list_node *pmac_node = nullptr;
-    list_node *pip_node = nullptr;
-    bool flag = false;
-    uint32 start_ip = dhcps_lease.start_ip.addr;
-    uint32 end_ip = dhcps_lease.end_ip.addr;
-    dhcps_type_t type = DHCPS_TYPE_DYNAMIC;
+    struct dhcps_pool* pdhcps_pool = nullptr;
+    list_node*         pback_node  = nullptr;
+    list_node*         pmac_node   = nullptr;
+    list_node*         pip_node    = nullptr;
+    bool               flag        = false;
+    uint32             start_ip    = dhcps_lease.start_ip.addr;
+    uint32             end_ip      = dhcps_lease.end_ip.addr;
+    dhcps_type_t       type        = DHCPS_TYPE_DYNAMIC;
     if (bssid == nullptr)
     {
         return IPADDR_ANY;
@@ -1501,7 +1498,7 @@ uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
         }
     }
 
-    if (pmac_node != nullptr)   // update new ip
+    if (pmac_node != nullptr)  // update new ip
     {
         if (pip_node != nullptr)
         {
@@ -1525,13 +1522,12 @@ uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
             else
             {
                 renew = true;
-                type = DHCPS_TYPE_DYNAMIC;
+                type  = DHCPS_TYPE_DYNAMIC;
             }
 
             pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-            pdhcps_pool->type = type;
-            pdhcps_pool->state = DHCPS_STATE_ONLINE;
-
+            pdhcps_pool->type        = type;
+            pdhcps_pool->state       = DHCPS_STATE_ONLINE;
         }
         else
         {
@@ -1544,21 +1540,21 @@ uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
             {
                 pdhcps_pool->ip.addr = start_ip;
             }
-            else        // no ip to distribute
+            else  // no ip to distribute
             {
                 return IPADDR_ANY;
             }
 
             node_remove_from_list(&plist, pmac_node);
             pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-            pdhcps_pool->type = type;
-            pdhcps_pool->state = DHCPS_STATE_ONLINE;
+            pdhcps_pool->type        = type;
+            pdhcps_pool->state       = DHCPS_STATE_ONLINE;
             node_insert_to_list(&plist, pmac_node);
         }
     }
-    else     // new station
+    else  // new station
     {
-        if (pip_node != nullptr)   // maybe ip has used
+        if (pip_node != nullptr)  // maybe ip has used
         {
             pdhcps_pool = (struct dhcps_pool*)pip_node->pnode;
             if (pdhcps_pool->state != DHCPS_STATE_OFFLINE)
@@ -1567,12 +1563,12 @@ uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
             }
             memcpy(pdhcps_pool->mac, bssid, sizeof(pdhcps_pool->mac));
             pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-            pdhcps_pool->type = type;
-            pdhcps_pool->state = DHCPS_STATE_ONLINE;
+            pdhcps_pool->type        = type;
+            pdhcps_pool->state       = DHCPS_STATE_ONLINE;
         }
         else
         {
-            pdhcps_pool = (struct dhcps_pool *)zalloc(sizeof(struct dhcps_pool));
+            pdhcps_pool = (struct dhcps_pool*)zalloc(sizeof(struct dhcps_pool));
             if (ip != nullptr)
             {
                 pdhcps_pool->ip.addr = ip->addr;
@@ -1581,7 +1577,7 @@ uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
             {
                 pdhcps_pool->ip.addr = start_ip;
             }
-            else        // no ip to distribute
+            else  // no ip to distribute
             {
                 free(pdhcps_pool);
                 return IPADDR_ANY;
@@ -1593,11 +1589,11 @@ uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip)
             }
             memcpy(pdhcps_pool->mac, bssid, sizeof(pdhcps_pool->mac));
             pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER;
-            pdhcps_pool->type = type;
-            pdhcps_pool->state = DHCPS_STATE_ONLINE;
-            pback_node = (list_node *)zalloc(sizeof(list_node));
-            pback_node->pnode = pdhcps_pool;
-            pback_node->pnext = nullptr;
+            pdhcps_pool->type        = type;
+            pdhcps_pool->state       = DHCPS_STATE_ONLINE;
+            pback_node               = (list_node*)zalloc(sizeof(list_node));
+            pback_node->pnode        = pdhcps_pool;
+            pback_node->pnext        = nullptr;
             node_insert_to_list(&plist, pback_node);
         }
     }
diff --git a/cores/esp8266/LwipDhcpServer.h b/cores/esp8266/LwipDhcpServer.h
index e93166981d..821c3a68bd 100644
--- a/cores/esp8266/LwipDhcpServer.h
+++ b/cores/esp8266/LwipDhcpServer.h
@@ -31,12 +31,11 @@
 #ifndef __DHCPS_H__
 #define __DHCPS_H__
 
-#include <lwip/init.h> // LWIP_VERSION
+#include <lwip/init.h>  // LWIP_VERSION
 
 class DhcpServer
 {
 public:
-
     DhcpServer(netif* netif);
     ~DhcpServer();
 
@@ -53,72 +52,71 @@ class DhcpServer
 
     // legacy public C structure and API to eventually turn into C++
 
-    void init_dhcps_lease(uint32 ip);
-    bool set_dhcps_lease(struct dhcps_lease *please);
-    bool get_dhcps_lease(struct dhcps_lease *please);
-    bool set_dhcps_offer_option(uint8 level, void* optarg);
-    bool set_dhcps_lease_time(uint32 minute);
-    bool reset_dhcps_lease_time(void);
+    void   init_dhcps_lease(uint32 ip);
+    bool   set_dhcps_lease(struct dhcps_lease* please);
+    bool   get_dhcps_lease(struct dhcps_lease* please);
+    bool   set_dhcps_offer_option(uint8 level, void* optarg);
+    bool   set_dhcps_lease_time(uint32 minute);
+    bool   reset_dhcps_lease_time(void);
     uint32 get_dhcps_lease_time(void);
-    bool add_dhcps_lease(uint8 *macaddr);
+    bool   add_dhcps_lease(uint8* macaddr);
 
     void dhcps_set_dns(int num, const ipv4_addr_t* dns);
 
 protected:
-
     // legacy C structure and API to eventually turn into C++
 
     typedef struct _list_node
     {
-        void *pnode;
-        struct _list_node *pnext;
+        void*              pnode;
+        struct _list_node* pnext;
     } list_node;
 
-    void node_insert_to_list(list_node **phead, list_node* pinsert);
-    void node_remove_from_list(list_node **phead, list_node* pdelete);
-    uint8_t* add_msg_type(uint8_t *optptr, uint8_t type);
-    uint8_t* add_offer_options(uint8_t *optptr);
-    uint8_t* add_end(uint8_t *optptr);
-    void create_msg(struct dhcps_msg *m);
-    void send_offer(struct dhcps_msg *m);
-    void send_nak(struct dhcps_msg *m);
-    void send_ack(struct dhcps_msg *m);
-    uint8_t parse_options(uint8_t *optptr, sint16_t len);
-    sint16_t parse_msg(struct dhcps_msg *m, u16_t len);
-    static void S_handle_dhcp(void *arg,
-                              struct udp_pcb *pcb,
-                              struct pbuf *p,
-                              const ip_addr_t *addr,
-                              uint16_t port);
-    void handle_dhcp(
-        struct udp_pcb *pcb,
-        struct pbuf *p,
-        const ip_addr_t *addr,
-        uint16_t port);
-    void kill_oldest_dhcps_pool(void);
-    void dhcps_coarse_tmr(void); // CURRENTLY NOT CALLED
-    void dhcps_client_leave(u8 *bssid, struct ipv4_addr *ip, bool force);
-    uint32 dhcps_client_update(u8 *bssid, struct ipv4_addr *ip);
+    void        node_insert_to_list(list_node** phead, list_node* pinsert);
+    void        node_remove_from_list(list_node** phead, list_node* pdelete);
+    uint8_t*    add_msg_type(uint8_t* optptr, uint8_t type);
+    uint8_t*    add_offer_options(uint8_t* optptr);
+    uint8_t*    add_end(uint8_t* optptr);
+    void        create_msg(struct dhcps_msg* m);
+    void        send_offer(struct dhcps_msg* m);
+    void        send_nak(struct dhcps_msg* m);
+    void        send_ack(struct dhcps_msg* m);
+    uint8_t     parse_options(uint8_t* optptr, sint16_t len);
+    sint16_t    parse_msg(struct dhcps_msg* m, u16_t len);
+    static void S_handle_dhcp(void*            arg,
+                              struct udp_pcb*  pcb,
+                              struct pbuf*     p,
+                              const ip_addr_t* addr,
+                              uint16_t         port);
+    void        handle_dhcp(
+               struct udp_pcb*  pcb,
+               struct pbuf*     p,
+               const ip_addr_t* addr,
+               uint16_t         port);
+    void   kill_oldest_dhcps_pool(void);
+    void   dhcps_coarse_tmr(void);  // CURRENTLY NOT CALLED
+    void   dhcps_client_leave(u8* bssid, struct ipv4_addr* ip, bool force);
+    uint32 dhcps_client_update(u8* bssid, struct ipv4_addr* ip);
 
     netif* _netif;
 
-    struct udp_pcb *pcb_dhcps;
-    ip_addr_t broadcast_dhcps;
+    struct udp_pcb*  pcb_dhcps;
+    ip_addr_t        broadcast_dhcps;
     struct ipv4_addr server_address;
     struct ipv4_addr client_address;
     struct ipv4_addr dns_address;
-    uint32 dhcps_lease_time;
+    uint32           dhcps_lease_time;
 
     struct dhcps_lease dhcps_lease;
-    list_node *plist;
-    uint8 offer;
-    bool renew;
+    list_node*         plist;
+    uint8              offer;
+    bool               renew;
 
     static const uint32 magic_cookie;
 };
 
 // SoftAP DHCP server always exists and is started on boot
 extern DhcpServer dhcpSoftAP;
-extern "C" int fw_has_started_softap_dhcps;
+extern "C" int    fw_has_started_softap_dhcps;
 
-#endif // __DHCPS_H__
+#endif  // __DHCPS_H__
diff --git a/cores/esp8266/LwipIntf.cpp b/cores/esp8266/LwipIntf.cpp
index b4a4807b9a..b4ae7e06e9 100644
--- a/cores/esp8266/LwipIntf.cpp
+++ b/cores/esp8266/LwipIntf.cpp
@@ -1,12 +1,13 @@
 
-extern "C" {
+extern "C"
+{
 #include "lwip/err.h"
 #include "lwip/ip_addr.h"
 #include "lwip/dns.h"
 #include "lwip/dhcp.h"
-#include "lwip/init.h" // LWIP_VERSION_
+#include "lwip/init.h"  // LWIP_VERSION_
 #if LWIP_IPV6
-#include "lwip/netif.h" // struct netif
+#include "lwip/netif.h"  // struct netif
 #endif
 
 #include <user_interface.h>
@@ -30,14 +31,14 @@ bool LwipIntf::ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1
     //To allow compatibility, check first octet of 3rd arg. If 255, interpret as ESP order, otherwise Arduino order.
     gateway = arg1;
     netmask = arg2;
-    dns1 = arg3;
+    dns1    = arg3;
 
     if (netmask[0] != 255)
     {
         //octet is not 255 => interpret as Arduino order
         gateway = arg2;
-        netmask = arg3[0] == 0 ? IPAddress(255, 255, 255, 0) : arg3; //arg order is arduino and 4th arg not given => assign it arduino default
-        dns1 = arg1;
+        netmask = arg3[0] == 0 ? IPAddress(255, 255, 255, 0) : arg3;  //arg order is arduino and 4th arg not given => assign it arduino default
+        dns1    = arg1;
     }
 
     // check whether all is IPv4 (or gateway not set)
@@ -143,7 +144,6 @@ bool LwipIntf::hostname(const char* aHostname)
     // harmless for AP, also compatible with ethernet adapters (to come)
     for (netif* intf = netif_list; intf; intf = intf->next)
     {
-
         // unconditionally update all known interfaces
         intf->hostname = wifi_station_get_hostname();
 
@@ -162,4 +162,3 @@ bool LwipIntf::hostname(const char* aHostname)
 
     return ret && compliant;
 }
-
diff --git a/cores/esp8266/LwipIntf.h b/cores/esp8266/LwipIntf.h
index d73c2d825a..386906b0a1 100644
--- a/cores/esp8266/LwipIntf.h
+++ b/cores/esp8266/LwipIntf.h
@@ -10,8 +10,7 @@
 class LwipIntf
 {
 public:
-
-    using CBType = std::function <void(netif*)>;
+    using CBType = std::function<void(netif*)>;
 
     static bool stateUpCB(LwipIntf::CBType&& cb);
 
@@ -24,12 +23,11 @@ class LwipIntf
     // arg3     | dns1       netmask
     //
     // result stored into gateway/netmask/dns1
-    static
-    bool ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3,
-                          IPAddress& gateway, IPAddress& netmask, IPAddress& dns1);
+    static bool ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3,
+                                 IPAddress& gateway, IPAddress& netmask, IPAddress& dns1);
 
     String hostname();
-    bool hostname(const String& aHostname)
+    bool   hostname(const String& aHostname)
     {
         return hostname(aHostname.c_str());
     }
@@ -42,8 +40,7 @@ class LwipIntf
     const char* getHostname();
 
 protected:
-
     static bool stateChangeSysCB(LwipIntf::CBType&& cb);
 };
 
-#endif // _LWIPINTF_H
+#endif  // _LWIPINTF_H
diff --git a/cores/esp8266/LwipIntfCB.cpp b/cores/esp8266/LwipIntfCB.cpp
index 1e495c5fd3..b79c6323fb 100644
--- a/cores/esp8266/LwipIntfCB.cpp
+++ b/cores/esp8266/LwipIntfCB.cpp
@@ -5,8 +5,8 @@
 
 #define NETIF_STATUS_CB_SIZE 3
 
-static int netifStatusChangeListLength = 0;
-LwipIntf::CBType netifStatusChangeList [NETIF_STATUS_CB_SIZE];
+static int       netifStatusChangeListLength = 0;
+LwipIntf::CBType netifStatusChangeList[NETIF_STATUS_CB_SIZE];
 
 extern "C" void netif_status_changed(struct netif* netif)
 {
@@ -33,12 +33,10 @@ bool LwipIntf::stateChangeSysCB(LwipIntf::CBType&& cb)
 
 bool LwipIntf::stateUpCB(LwipIntf::CBType&& cb)
 {
-    return stateChangeSysCB([cb](netif * nif)
-    {
-        if (netif_is_up(nif))
-            schedule_function([cb, nif]()
-        {
-            cb(nif);
-        });
-    });
+    return stateChangeSysCB([cb](netif* nif)
+                            {
+                                if (netif_is_up(nif))
+                                    schedule_function([cb, nif]()
+                                                      { cb(nif); });
+                            });
 }
diff --git a/cores/esp8266/LwipIntfDev.h b/cores/esp8266/LwipIntfDev.h
index f8290d7cd6..2f9987029f 100644
--- a/cores/esp8266/LwipIntfDev.h
+++ b/cores/esp8266/LwipIntfDev.h
@@ -14,7 +14,7 @@
 #include <lwip/dns.h>
 #include <lwip/apps/sntp.h>
 
-#include <user_interface.h>	// wifi_get_macaddr()
+#include <user_interface.h>  // wifi_get_macaddr()
 
 #include "SPI.h"
 #include "Schedule.h"
@@ -28,10 +28,8 @@
 template <class RawDev>
 class LwipIntfDev: public LwipIntf, public RawDev
 {
-
 public:
-
-    LwipIntfDev(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1):
+    LwipIntfDev(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1) :
         RawDev(cs, spi, intr),
         _mtu(DEFAULT_MTU),
         _intrPin(intr),
@@ -44,22 +42,22 @@ class LwipIntfDev: public LwipIntf, public RawDev
     boolean config(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3 = IPADDR_NONE, const IPAddress& dns2 = IPADDR_NONE);
 
     // default mac-address is inferred from esp8266's STA interface
-    boolean begin(const uint8_t *macAddress = nullptr, const uint16_t mtu = DEFAULT_MTU);
+    boolean begin(const uint8_t* macAddress = nullptr, const uint16_t mtu = DEFAULT_MTU);
 
     const netif* getNetIf() const
     {
         return &_netif;
     }
 
-    IPAddress    localIP() const
+    IPAddress localIP() const
     {
         return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.ip_addr)));
     }
-    IPAddress    subnetMask() const
+    IPAddress subnetMask() const
     {
         return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.netmask)));
     }
-    IPAddress    gatewayIP() const
+    IPAddress gatewayIP() const
     {
         return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.gw)));
     }
@@ -77,12 +75,11 @@ class LwipIntfDev: public LwipIntf, public RawDev
     wl_status_t status();
 
 protected:
-
     err_t netif_init();
     void  netif_status_callback();
 
     static err_t netif_init_s(netif* netif);
-    static err_t linkoutput_s(netif *netif, struct pbuf *p);
+    static err_t linkoutput_s(netif* netif, struct pbuf* p);
     static void  netif_status_callback_s(netif* netif);
 
     // called on a regular basis or on interrupt
@@ -90,14 +87,13 @@ class LwipIntfDev: public LwipIntf, public RawDev
 
     // members
 
-    netif       _netif;
-
-    uint16_t    _mtu;
-    int8_t      _intrPin;
-    uint8_t     _macAddress[6];
-    bool        _started;
-    bool        _default;
+    netif _netif;
 
+    uint16_t _mtu;
+    int8_t   _intrPin;
+    uint8_t  _macAddress[6];
+    bool     _started;
+    bool     _default;
 };
 
 template <class RawDev>
@@ -162,9 +158,9 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
         memset(_macAddress, 0, 6);
         _macAddress[0] = 0xEE;
 #endif
-        _macAddress[3] += _netif.num;   // alter base mac address
-        _macAddress[0] &= 0xfe;         // set as locally administered, unicast, per
-        _macAddress[0] |= 0x02;         // https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local
+        _macAddress[3] += _netif.num;  // alter base mac address
+        _macAddress[0] &= 0xfe;        // set as locally administered, unicast, per
+        _macAddress[0] |= 0x02;        // https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local
     }
 
     if (!RawDev::begin(_macAddress))
@@ -222,10 +218,11 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
     }
 
     if (_intrPin < 0 && !schedule_recurrent_function_us([&]()
-{
-    this->handlePackets();
-        return true;
-    }, 100))
+                                                        {
+                                                            this->handlePackets();
+                                                            return true;
+                                                        },
+                                                        100))
     {
         netif_remove(&_netif);
         return false;
@@ -241,7 +238,7 @@ wl_status_t LwipIntfDev<RawDev>::status()
 }
 
 template <class RawDev>
-err_t LwipIntfDev<RawDev>::linkoutput_s(netif *netif, struct pbuf *pbuf)
+err_t LwipIntfDev<RawDev>::linkoutput_s(netif* netif, struct pbuf* pbuf)
 {
     LwipIntfDev* ths = (LwipIntfDev*)netif->state;
 
@@ -255,7 +252,7 @@ err_t LwipIntfDev<RawDev>::linkoutput_s(netif *netif, struct pbuf *pbuf)
 #if PHY_HAS_CAPTURE
     if (phy_capture)
     {
-        phy_capture(ths->_netif.num, (const char*)pbuf->payload, pbuf->len, /*out*/1, /*success*/len == pbuf->len);
+        phy_capture(ths->_netif.num, (const char*)pbuf->payload, pbuf->len, /*out*/ 1, /*success*/ len == pbuf->len);
     }
 #endif
 
@@ -277,12 +274,11 @@ void LwipIntfDev<RawDev>::netif_status_callback_s(struct netif* netif)
 template <class RawDev>
 err_t LwipIntfDev<RawDev>::netif_init()
 {
-    _netif.name[0] = 'e';
-    _netif.name[1] = '0' + _netif.num;
-    _netif.mtu = _mtu;
+    _netif.name[0]      = 'e';
+    _netif.name[1]      = '0' + _netif.num;
+    _netif.mtu          = _mtu;
     _netif.chksum_flags = NETIF_CHECKSUM_ENABLE_ALL;
-    _netif.flags =
-        NETIF_FLAG_ETHARP
+    _netif.flags        = NETIF_FLAG_ETHARP
         | NETIF_FLAG_IGMP
         | NETIF_FLAG_BROADCAST
         | NETIF_FLAG_LINK_UP;
@@ -328,7 +324,7 @@ err_t LwipIntfDev<RawDev>::handlePackets()
     while (1)
     {
         if (++pkt == 10)
-            // prevent starvation
+        // prevent starvation
         {
             return ERR_OK;
         }
@@ -374,7 +370,7 @@ err_t LwipIntfDev<RawDev>::handlePackets()
 #if PHY_HAS_CAPTURE
         if (phy_capture)
         {
-            phy_capture(_netif.num, (const char*)pbuf->payload, tot_len, /*out*/0, /*success*/err == ERR_OK);
+            phy_capture(_netif.num, (const char*)pbuf->payload, tot_len, /*out*/ 0, /*success*/ err == ERR_OK);
         }
 #endif
 
@@ -384,7 +380,6 @@ err_t LwipIntfDev<RawDev>::handlePackets()
             return err;
         }
         // (else) allocated pbuf is now lwIP's responsibility
-
     }
 }
 
@@ -398,4 +393,4 @@ void LwipIntfDev<RawDev>::setDefault()
     }
 }
 
-#endif // _LWIPINTFDEV_H
+#endif  // _LWIPINTFDEV_H
diff --git a/cores/esp8266/StreamSend.cpp b/cores/esp8266/StreamSend.cpp
index 693e340cff..fb92b48cd8 100644
--- a/cores/esp8266/StreamSend.cpp
+++ b/cores/esp8266/StreamSend.cpp
@@ -19,20 +19,19 @@
     parsing functions based on TextFinder library by Michael Margolis
 */
 
-
 #include <Arduino.h>
 #include <StreamDev.h>
 
-size_t Stream::sendGeneric(Print* to,
-                           const ssize_t len,
-                           const int readUntilChar,
+size_t Stream::sendGeneric(Print*                                                to,
+                           const ssize_t                                         len,
+                           const int                                             readUntilChar,
                            const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
 {
     setReport(Report::Success);
 
     if (len == 0)
     {
-        return 0;    // conveniently avoids timeout for no requested data
+        return 0;  // conveniently avoids timeout for no requested data
     }
 
     // There are two timeouts:
@@ -57,14 +56,13 @@ size_t Stream::sendGeneric(Print* to,
     return SendGenericRegular(to, len, timeoutMs);
 }
 
-
 size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int readUntilChar, const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
 {
     // "neverExpires (default, impossible)" is translated to default timeout
     esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
-    const size_t maxLen = std::max((ssize_t)0, len);
-    size_t written = 0;
+    const size_t maxLen  = std::max((ssize_t)0, len);
+    size_t       written = 0;
 
     while (!maxLen || written < maxLen)
     {
@@ -90,13 +88,13 @@ size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int rea
         if (w)
         {
             const char* directbuf = peekBuffer();
-            bool foundChar = false;
+            bool        foundChar = false;
             if (readUntilChar >= 0)
             {
                 const char* last = (const char*)memchr(directbuf, readUntilChar, w);
                 if (last)
                 {
-                    w = std::min((size_t)(last - directbuf), w);
+                    w         = std::min((size_t)(last - directbuf), w);
                     foundChar = true;
                 }
             }
@@ -104,7 +102,7 @@ size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int rea
             {
                 peekConsume(w);
                 written += w;
-                timedOut.reset(); // something has been written
+                timedOut.reset();  // something has been written
             }
             if (foundChar)
             {
@@ -153,8 +151,8 @@ size_t Stream::SendGenericRegularUntil(Print* to, const ssize_t len, const int r
     // "neverExpires (default, impossible)" is translated to default timeout
     esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
-    const size_t maxLen = std::max((ssize_t)0, len);
-    size_t written = 0;
+    const size_t maxLen  = std::max((ssize_t)0, len);
+    size_t       written = 0;
 
     while (!maxLen || written < maxLen)
     {
@@ -186,7 +184,7 @@ size_t Stream::SendGenericRegularUntil(Print* to, const ssize_t len, const int r
                 break;
             }
             written += 1;
-            timedOut.reset(); // something has been written
+            timedOut.reset();  // something has been written
         }
 
         if (timedOut)
@@ -229,8 +227,8 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
     // "neverExpires (default, impossible)" is translated to default timeout
     esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
-    const size_t maxLen = std::max((ssize_t)0, len);
-    size_t written = 0;
+    const size_t maxLen  = std::max((ssize_t)0, len);
+    size_t       written = 0;
 
     while (!maxLen || written < maxLen)
     {
@@ -243,7 +241,7 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
 
         size_t w = to->availableForWrite();
         if (w == 0 && !to->outputCanTimeout())
-            // no more data can be written, ever
+        // no more data can be written, ever
         {
             break;
         }
@@ -256,7 +254,7 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
         w = std::min(w, (decltype(w))temporaryStackBufferSize);
         if (w)
         {
-            char temp[w];
+            char    temp[w];
             ssize_t r = read(temp, w);
             if (r < 0)
             {
@@ -270,7 +268,7 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
                 setReport(Report::WriteError);
                 break;
             }
-            timedOut.reset(); // something has been written
+            timedOut.reset();  // something has been written
         }
 
         if (timedOut)
@@ -305,19 +303,19 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::p
     return written;
 }
 
-Stream& operator << (Stream& out, String& string)
+Stream& operator<<(Stream& out, String& string)
 {
     StreamConstPtr(string).sendAll(out);
     return out;
 }
 
-Stream& operator << (Stream& out, StreamString& stream)
+Stream& operator<<(Stream& out, StreamString& stream)
 {
     stream.sendAll(out);
     return out;
 }
 
-Stream& operator << (Stream& out, Stream& stream)
+Stream& operator<<(Stream& out, Stream& stream)
 {
     if (stream.streamRemaining() < 0)
     {
@@ -339,13 +337,13 @@ Stream& operator << (Stream& out, Stream& stream)
     return out;
 }
 
-Stream& operator << (Stream& out, const char* text)
+Stream& operator<<(Stream& out, const char* text)
 {
     StreamConstPtr(text, strlen_P(text)).sendAll(out);
     return out;
 }
 
-Stream& operator << (Stream& out, const __FlashStringHelper* text)
+Stream& operator<<(Stream& out, const __FlashStringHelper* text)
 {
     StreamConstPtr(text).sendAll(out);
     return out;
diff --git a/cores/esp8266/StreamString.h b/cores/esp8266/StreamString.h
index be11669a79..b1665135f9 100644
--- a/cores/esp8266/StreamString.h
+++ b/cores/esp8266/StreamString.h
@@ -35,13 +35,12 @@
 class S2Stream: public Stream
 {
 public:
-
-    S2Stream(String& string, int peekPointer = -1):
+    S2Stream(String& string, int peekPointer = -1) :
         string(&string), peekPointer(peekPointer)
     {
     }
 
-    S2Stream(String* string, int peekPointer = -1):
+    S2Stream(String* string, int peekPointer = -1) :
         string(string), peekPointer(peekPointer)
     {
     }
@@ -207,18 +206,15 @@ class S2Stream: public Stream
     }
 
 protected:
-
     String* string;
-    int peekPointer; // -1:String is consumed / >=0:resettable pointer
+    int     peekPointer;  // -1:String is consumed / >=0:resettable pointer
 };
 
-
 // StreamString is a S2Stream holding the String
 
 class StreamString: public String, public S2Stream
 {
 protected:
-
     void resetpp()
     {
         if (peekPointer > 0)
@@ -228,55 +224,68 @@ class StreamString: public String, public S2Stream
     }
 
 public:
-
-    StreamString(StreamString&& bro): String(bro), S2Stream(this) { }
-    StreamString(const StreamString& bro): String(bro), S2Stream(this) { }
+    StreamString(StreamString&& bro) :
+        String(bro), S2Stream(this) { }
+    StreamString(const StreamString& bro) :
+        String(bro), S2Stream(this) { }
 
     // duplicate String constructors and operator=:
 
-    StreamString(const char* text = nullptr): String(text), S2Stream(this) { }
-    StreamString(const String& string): String(string), S2Stream(this) { }
-    StreamString(const __FlashStringHelper *str): String(str), S2Stream(this) { }
-    StreamString(String&& string): String(string), S2Stream(this) { }
-
-    explicit StreamString(char c): String(c), S2Stream(this) { }
-    explicit StreamString(unsigned char c, unsigned char base = 10): String(c, base), S2Stream(this) { }
-    explicit StreamString(int i, unsigned char base = 10): String(i, base), S2Stream(this) { }
-    explicit StreamString(unsigned int i, unsigned char base = 10): String(i, base), S2Stream(this) { }
-    explicit StreamString(long l, unsigned char base = 10): String(l, base), S2Stream(this) { }
-    explicit StreamString(unsigned long l, unsigned char base = 10): String(l, base), S2Stream(this) { }
-    explicit StreamString(float f, unsigned char decimalPlaces = 2): String(f, decimalPlaces), S2Stream(this) { }
-    explicit StreamString(double d, unsigned char decimalPlaces = 2): String(d, decimalPlaces), S2Stream(this) { }
-
-    StreamString& operator= (const StreamString& rhs)
+    StreamString(const char* text = nullptr) :
+        String(text), S2Stream(this) { }
+    StreamString(const String& string) :
+        String(string), S2Stream(this) { }
+    StreamString(const __FlashStringHelper* str) :
+        String(str), S2Stream(this) { }
+    StreamString(String&& string) :
+        String(string), S2Stream(this) { }
+
+    explicit StreamString(char c) :
+        String(c), S2Stream(this) { }
+    explicit StreamString(unsigned char c, unsigned char base = 10) :
+        String(c, base), S2Stream(this) { }
+    explicit StreamString(int i, unsigned char base = 10) :
+        String(i, base), S2Stream(this) { }
+    explicit StreamString(unsigned int i, unsigned char base = 10) :
+        String(i, base), S2Stream(this) { }
+    explicit StreamString(long l, unsigned char base = 10) :
+        String(l, base), S2Stream(this) { }
+    explicit StreamString(unsigned long l, unsigned char base = 10) :
+        String(l, base), S2Stream(this) { }
+    explicit StreamString(float f, unsigned char decimalPlaces = 2) :
+        String(f, decimalPlaces), S2Stream(this) { }
+    explicit StreamString(double d, unsigned char decimalPlaces = 2) :
+        String(d, decimalPlaces), S2Stream(this) { }
+
+    StreamString& operator=(const StreamString& rhs)
     {
         String::operator=(rhs);
         resetpp();
         return *this;
     }
 
-    StreamString& operator= (const String& rhs)
+    StreamString& operator=(const String& rhs)
     {
         String::operator=(rhs);
         resetpp();
         return *this;
     }
 
-    StreamString& operator= (const char* cstr)
+    StreamString& operator=(const char* cstr)
     {
         String::operator=(cstr);
         resetpp();
         return *this;
     }
 
-    StreamString& operator= (const __FlashStringHelper* str)
+    StreamString& operator=(const __FlashStringHelper* str)
     {
         String::operator=(str);
         resetpp();
         return *this;
     }
 
-    StreamString& operator= (String&& rval)
+    StreamString& operator=(String&& rval)
     {
         String::operator=(rval);
         resetpp();
@@ -284,4 +293,4 @@ class StreamString: public String, public S2Stream
     }
 };
 
-#endif // __STREAMSTRING_H
+#endif  // __STREAMSTRING_H
diff --git a/cores/esp8266/core_esp8266_si2c.cpp b/cores/esp8266/core_esp8266_si2c.cpp
index e01dffe080..3672f7a4e2 100644
--- a/cores/esp8266/core_esp8266_si2c.cpp
+++ b/cores/esp8266/core_esp8266_si2c.cpp
@@ -24,9 +24,8 @@
 #include "wiring_private.h"
 #include "PolledTimeout.h"
 
-
-
-extern "C" {
+extern "C"
+{
 #include "twi_util.h"
 #include "ets_sys.h"
 };
@@ -57,78 +56,111 @@ static inline __attribute__((always_inline)) bool SCL_READ(const int twi_scl)
     return (GPI & (1 << twi_scl)) != 0;
 }
 
-
 // Implement as a class to reduce code size by allowing access to many global variables with a single base pointer
 class Twi
 {
 private:
-    unsigned int preferred_si2c_clock = 100000;
-    uint32_t twi_dcount = 18;
-    unsigned char twi_sda = 0;
-    unsigned char twi_scl = 0;
-    unsigned char twi_addr = 0;
-    uint32_t twi_clockStretchLimit = 0;
+    unsigned int  preferred_si2c_clock  = 100000;
+    uint32_t      twi_dcount            = 18;
+    unsigned char twi_sda               = 0;
+    unsigned char twi_scl               = 0;
+    unsigned char twi_addr              = 0;
+    uint32_t      twi_clockStretchLimit = 0;
 
     // These are int-wide, even though they could all fit in a byte, to reduce code size and avoid any potential
     // issues about RmW on packed bytes.  The int-wide variations of asm instructions are smaller than the equivalent
     // byte-wide ones, and since these emums are used everywhere, the difference adds up fast.  There is only a single
     // instance of the class, though, so the extra 12 bytes of RAM used here saves a lot more IRAM.
-    volatile enum { TWIPM_UNKNOWN = 0, TWIPM_IDLE, TWIPM_ADDRESSED, TWIPM_WAIT} twip_mode = TWIPM_IDLE;
-    volatile enum { TWIP_UNKNOWN = 0, TWIP_IDLE, TWIP_START, TWIP_SEND_ACK, TWIP_WAIT_ACK, TWIP_WAIT_STOP, TWIP_SLA_W, TWIP_SLA_R, TWIP_REP_START, TWIP_READ, TWIP_STOP, TWIP_REC_ACK, TWIP_READ_ACK, TWIP_RWAIT_ACK, TWIP_WRITE, TWIP_BUS_ERR } twip_state = TWIP_IDLE;
+    volatile enum { TWIPM_UNKNOWN = 0,
+                    TWIPM_IDLE,
+                    TWIPM_ADDRESSED,
+                    TWIPM_WAIT } twip_mode
+        = TWIPM_IDLE;
+    volatile enum { TWIP_UNKNOWN = 0,
+                    TWIP_IDLE,
+                    TWIP_START,
+                    TWIP_SEND_ACK,
+                    TWIP_WAIT_ACK,
+                    TWIP_WAIT_STOP,
+                    TWIP_SLA_W,
+                    TWIP_SLA_R,
+                    TWIP_REP_START,
+                    TWIP_READ,
+                    TWIP_STOP,
+                    TWIP_REC_ACK,
+                    TWIP_READ_ACK,
+                    TWIP_RWAIT_ACK,
+                    TWIP_WRITE,
+                    TWIP_BUS_ERR } twip_state
+        = TWIP_IDLE;
     volatile int twip_status = TW_NO_INFO;
-    volatile int bitCount = 0;
-
-    volatile uint8_t twi_data = 0x00;
-    volatile int twi_ack = 0;
-    volatile int twi_ack_rec = 0;
-    volatile int twi_timeout_ms = 10;
-
-    volatile enum { TWI_READY = 0, TWI_MRX, TWI_MTX, TWI_SRX, TWI_STX } twi_state = TWI_READY;
+    volatile int bitCount    = 0;
+
+    volatile uint8_t twi_data       = 0x00;
+    volatile int     twi_ack        = 0;
+    volatile int     twi_ack_rec    = 0;
+    volatile int     twi_timeout_ms = 10;
+
+    volatile enum { TWI_READY = 0,
+                    TWI_MRX,
+                    TWI_MTX,
+                    TWI_SRX,
+                    TWI_STX } twi_state
+        = TWI_READY;
     volatile uint8_t twi_error = 0xFF;
 
-    uint8_t twi_txBuffer[TWI_BUFFER_LENGTH];
-    volatile int twi_txBufferIndex = 0;
+    uint8_t      twi_txBuffer[TWI_BUFFER_LENGTH];
+    volatile int twi_txBufferIndex  = 0;
     volatile int twi_txBufferLength = 0;
 
-    uint8_t twi_rxBuffer[TWI_BUFFER_LENGTH];
+    uint8_t      twi_rxBuffer[TWI_BUFFER_LENGTH];
     volatile int twi_rxBufferIndex = 0;
 
     void (*twi_onSlaveTransmit)(void);
     void (*twi_onSlaveReceive)(uint8_t*, size_t);
 
     // ETS queue/timer interfaces
-    enum { EVENTTASK_QUEUE_SIZE = 1, EVENTTASK_QUEUE_PRIO = 2 };
-    enum { TWI_SIG_RANGE = 0x00000100, TWI_SIG_RX = 0x00000101, TWI_SIG_TX = 0x00000102 };
+    enum
+    {
+        EVENTTASK_QUEUE_SIZE = 1,
+        EVENTTASK_QUEUE_PRIO = 2
+    };
+    enum
+    {
+        TWI_SIG_RANGE = 0x00000100,
+        TWI_SIG_RX    = 0x00000101,
+        TWI_SIG_TX    = 0x00000102
+    };
     ETSEvent eventTaskQueue[EVENTTASK_QUEUE_SIZE];
     ETSTimer timer;
 
     // Event/IRQ callbacks, so they can't use "this" and need to be static
     static void IRAM_ATTR onSclChange(void);
     static void IRAM_ATTR onSdaChange(void);
-    static void eventTask(ETSEvent *e);
-    static void IRAM_ATTR onTimer(void *unused);
+    static void           eventTask(ETSEvent* e);
+    static void IRAM_ATTR onTimer(void* unused);
 
     // Allow not linking in the slave code if there is no call to setAddress
     bool _slaveEnabled = false;
 
     // Internal use functions
     void IRAM_ATTR busywait(unsigned int v);
-    bool write_start(void);
-    bool write_stop(void);
-    bool write_bit(bool bit);
-    bool read_bit(void);
-    bool write_byte(unsigned char byte);
-    unsigned char read_byte(bool nack);
+    bool           write_start(void);
+    bool           write_stop(void);
+    bool           write_bit(bool bit);
+    bool           read_bit(void);
+    bool           write_byte(unsigned char byte);
+    unsigned char  read_byte(bool nack);
     void IRAM_ATTR onTwipEvent(uint8_t status);
 
     // Handle the case where a slave needs to stretch the clock with a time-limited busy wait
     inline void WAIT_CLOCK_STRETCH()
     {
-        esp8266::polledTimeout::oneShotFastUs timeout(twi_clockStretchLimit);
+        esp8266::polledTimeout::oneShotFastUs  timeout(twi_clockStretchLimit);
         esp8266::polledTimeout::periodicFastUs yieldTimeout(5000);
-        while (!timeout && !SCL_READ(twi_scl)) // outer loop is stretch duration up to stretch limit
+        while (!timeout && !SCL_READ(twi_scl))  // outer loop is stretch duration up to stretch limit
         {
-            if (yieldTimeout)   // inner loop yields every 5ms
+            if (yieldTimeout)  // inner loop yields every 5ms
             {
                 yield();
             }
@@ -139,19 +171,19 @@ class Twi
     void twi_scl_valley(void);
 
 public:
-    void setClock(unsigned int freq);
-    void setClockStretchLimit(uint32_t limit);
-    void init(unsigned char sda, unsigned char scl);
-    void setAddress(uint8_t address);
-    unsigned char writeTo(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop);
-    unsigned char readFrom(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop);
-    uint8_t status();
-    uint8_t transmit(const uint8_t* data, uint8_t length);
-    void attachSlaveRxEvent(void (*function)(uint8_t*, size_t));
-    void attachSlaveTxEvent(void (*function)(void));
+    void           setClock(unsigned int freq);
+    void           setClockStretchLimit(uint32_t limit);
+    void           init(unsigned char sda, unsigned char scl);
+    void           setAddress(uint8_t address);
+    unsigned char  writeTo(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop);
+    unsigned char  readFrom(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop);
+    uint8_t        status();
+    uint8_t        transmit(const uint8_t* data, uint8_t length);
+    void           attachSlaveRxEvent(void (*function)(uint8_t*, size_t));
+    void           attachSlaveTxEvent(void (*function)(void));
     void IRAM_ATTR reply(uint8_t ack);
     void IRAM_ATTR releaseBus(void);
-    void enableSlave();
+    void           enableSlave();
 };
 
 static Twi twi;
@@ -175,8 +207,8 @@ void Twi::setClock(unsigned int freq)
     {
         freq = 400000;
     }
-    twi_dcount = (500000000 / freq);  // half-cycle period in ns
-    twi_dcount = (1000 * (twi_dcount - 1120)) / 62500; // (half cycle - overhead) / busywait loop time
+    twi_dcount = (500000000 / freq);                    // half-cycle period in ns
+    twi_dcount = (1000 * (twi_dcount - 1120)) / 62500;  // (half cycle - overhead) / busywait loop time
 
 #else
 
@@ -184,8 +216,8 @@ void Twi::setClock(unsigned int freq)
     {
         freq = 800000;
     }
-    twi_dcount = (500000000 / freq);  // half-cycle period in ns
-    twi_dcount = (1000 * (twi_dcount - 560)) / 31250; // (half cycle - overhead) / busywait loop time
+    twi_dcount = (500000000 / freq);                   // half-cycle period in ns
+    twi_dcount = (1000 * (twi_dcount - 560)) / 31250;  // (half cycle - overhead) / busywait loop time
 
 #endif
 }
@@ -195,8 +227,6 @@ void Twi::setClockStretchLimit(uint32_t limit)
     twi_clockStretchLimit = limit;
 }
 
-
-
 void Twi::init(unsigned char sda, unsigned char scl)
 {
     // set timer function
@@ -210,7 +240,7 @@ void Twi::init(unsigned char sda, unsigned char scl)
     pinMode(twi_sda, INPUT_PULLUP);
     pinMode(twi_scl, INPUT_PULLUP);
     twi_setClock(preferred_si2c_clock);
-    twi_setClockStretchLimit(150000L); // default value is 150 mS
+    twi_setClockStretchLimit(150000L);  // default value is 150 mS
 }
 
 void Twi::setAddress(uint8_t address)
@@ -234,7 +264,7 @@ void IRAM_ATTR Twi::busywait(unsigned int v)
     unsigned int i;
     for (i = 0; i < v; i++)  // loop time is 5 machine cycles: 31.25ns @ 160MHz, 62.5ns @ 80MHz
     {
-        __asm__ __volatile__("nop"); // minimum element to keep GCC from optimizing this function out.
+        __asm__ __volatile__("nop");  // minimum element to keep GCC from optimizing this function out.
     }
 }
 
@@ -308,7 +338,7 @@ bool Twi::write_byte(unsigned char byte)
         write_bit(byte & 0x80);
         byte <<= 1;
     }
-    return !read_bit();//NACK/ACK
+    return !read_bit();  //NACK/ACK
 }
 
 unsigned char Twi::read_byte(bool nack)
@@ -323,7 +353,7 @@ unsigned char Twi::read_byte(bool nack)
     return byte;
 }
 
-unsigned char Twi::writeTo(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop)
+unsigned char Twi::writeTo(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop)
 {
     unsigned int i;
     if (!write_start())
@@ -336,7 +366,7 @@ unsigned char Twi::writeTo(unsigned char address, unsigned char * buf, unsigned
         {
             write_stop();
         }
-        return 2; //received NACK on transmit of address
+        return 2;  //received NACK on transmit of address
     }
     for (i = 0; i < len; i++)
     {
@@ -346,7 +376,7 @@ unsigned char Twi::writeTo(unsigned char address, unsigned char * buf, unsigned
             {
                 write_stop();
             }
-            return 3;//received NACK on transmit of data
+            return 3;  //received NACK on transmit of data
         }
     }
     if (sendStop)
@@ -381,7 +411,7 @@ unsigned char Twi::readFrom(unsigned char address, unsigned char* buf, unsigned
         {
             write_stop();
         }
-        return 2;//received NACK on transmit of address
+        return 2;  //received NACK on transmit of address
     }
     for (i = 0; i < (len - 1); i++)
     {
@@ -424,12 +454,12 @@ uint8_t Twi::status()
     }
 
     int clockCount = 20;
-    while (!SDA_READ(twi_sda) && clockCount-- > 0)   // if SDA low, read the bits slaves have to sent to a max
+    while (!SDA_READ(twi_sda) && clockCount-- > 0)  // if SDA low, read the bits slaves have to sent to a max
     {
         read_bit();
         if (!SCL_READ(twi_scl))
         {
-            return I2C_SCL_HELD_LOW_AFTER_READ; // I2C bus error. SCL held low beyond slave clock stretch time
+            return I2C_SCL_HELD_LOW_AFTER_READ;  // I2C bus error. SCL held low beyond slave clock stretch time
         }
     }
     if (!SDA_READ(twi_sda))
@@ -485,49 +515,47 @@ void IRAM_ATTR Twi::reply(uint8_t ack)
     if (ack)
     {
         //TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT) | _BV(TWEA);
-        SCL_HIGH(twi.twi_scl);      // _BV(TWINT)
-        twi_ack = 1;    // _BV(TWEA)
+        SCL_HIGH(twi.twi_scl);  // _BV(TWINT)
+        twi_ack = 1;            // _BV(TWEA)
     }
     else
     {
         //TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT);
-        SCL_HIGH(twi.twi_scl);      // _BV(TWINT)
-        twi_ack = 0;    // ~_BV(TWEA)
+        SCL_HIGH(twi.twi_scl);  // _BV(TWINT)
+        twi_ack = 0;            // ~_BV(TWEA)
     }
 }
 
-
 void IRAM_ATTR Twi::releaseBus(void)
 {
     // release bus
     //TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT);
-    SCL_HIGH(twi.twi_scl);      // _BV(TWINT)
-    twi_ack = 1;    // _BV(TWEA)
+    SCL_HIGH(twi.twi_scl);  // _BV(TWINT)
+    twi_ack = 1;            // _BV(TWEA)
     SDA_HIGH(twi.twi_sda);
 
     // update twi state
     twi_state = TWI_READY;
 }
 
-
 void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
 {
     twip_status = status;
     switch (status)
     {
     // Slave Receiver
-    case TW_SR_SLA_ACK:   // addressed, returned ack
-    case TW_SR_GCALL_ACK: // addressed generally, returned ack
-    case TW_SR_ARB_LOST_SLA_ACK:   // lost arbitration, returned ack
-    case TW_SR_ARB_LOST_GCALL_ACK: // lost arbitration, returned ack
+    case TW_SR_SLA_ACK:             // addressed, returned ack
+    case TW_SR_GCALL_ACK:           // addressed generally, returned ack
+    case TW_SR_ARB_LOST_SLA_ACK:    // lost arbitration, returned ack
+    case TW_SR_ARB_LOST_GCALL_ACK:  // lost arbitration, returned ack
         // enter slave receiver mode
         twi_state = TWI_SRX;
         // indicate that rx buffer can be overwritten and ack
         twi_rxBufferIndex = 0;
         reply(1);
         break;
-    case TW_SR_DATA_ACK:       // data received, returned ack
-    case TW_SR_GCALL_DATA_ACK: // data received generally, returned ack
+    case TW_SR_DATA_ACK:        // data received, returned ack
+    case TW_SR_GCALL_DATA_ACK:  // data received generally, returned ack
         // if there is still room in the rx buffer
         if (twi_rxBufferIndex < TWI_BUFFER_LENGTH)
         {
@@ -541,7 +569,7 @@ void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
             reply(0);
         }
         break;
-    case TW_SR_STOP: // stop or repeated start condition received
+    case TW_SR_STOP:  // stop or repeated start condition received
         // put a null char after data if there's room
         if (twi_rxBufferIndex < TWI_BUFFER_LENGTH)
         {
@@ -555,15 +583,15 @@ void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
         twi_rxBufferIndex = 0;
         break;
 
-    case TW_SR_DATA_NACK:       // data received, returned nack
-    case TW_SR_GCALL_DATA_NACK: // data received generally, returned nack
+    case TW_SR_DATA_NACK:        // data received, returned nack
+    case TW_SR_GCALL_DATA_NACK:  // data received generally, returned nack
         // nack back at master
         reply(0);
         break;
 
     // Slave Transmitter
-    case TW_ST_SLA_ACK:          // addressed, returned ack
-    case TW_ST_ARB_LOST_SLA_ACK: // arbitration lost, returned ack
+    case TW_ST_SLA_ACK:           // addressed, returned ack
+    case TW_ST_ARB_LOST_SLA_ACK:  // arbitration lost, returned ack
         // enter slave transmitter mode
         twi_state = TWI_STX;
         // ready the tx buffer index for iteration
@@ -576,7 +604,7 @@ void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
         ets_post(EVENTTASK_QUEUE_PRIO, TWI_SIG_TX, 0);
         break;
 
-    case TW_ST_DATA_ACK: // byte sent, ack returned
+    case TW_ST_DATA_ACK:  // byte sent, ack returned
         // copy data to output register
         twi_data = twi_txBuffer[twi_txBufferIndex++];
 
@@ -602,33 +630,32 @@ void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
             reply(0);
         }
         break;
-    case TW_ST_DATA_NACK: // received nack, we are done
-    case TW_ST_LAST_DATA: // received ack, but we are done already!
+    case TW_ST_DATA_NACK:  // received nack, we are done
+    case TW_ST_LAST_DATA:  // received ack, but we are done already!
         // leave slave receiver state
         releaseBus();
         break;
 
     // All
-    case TW_NO_INFO:   // no state information
+    case TW_NO_INFO:  // no state information
         break;
-    case TW_BUS_ERROR: // bus error, illegal stop/start
+    case TW_BUS_ERROR:  // bus error, illegal stop/start
         twi_error = TW_BUS_ERROR;
         break;
     }
 }
 
-void IRAM_ATTR Twi::onTimer(void *unused)
+void IRAM_ATTR Twi::onTimer(void* unused)
 {
     (void)unused;
     twi.releaseBus();
     twi.onTwipEvent(TW_BUS_ERROR);
-    twi.twip_mode = TWIPM_WAIT;
+    twi.twip_mode  = TWIPM_WAIT;
     twi.twip_state = TWIP_BUS_ERR;
 }
 
-void Twi::eventTask(ETSEvent *e)
+void Twi::eventTask(ETSEvent* e)
 {
-
     if (e == NULL)
     {
         return;
@@ -643,7 +670,7 @@ void Twi::eventTask(ETSEvent *e)
         if (twi.twi_txBufferLength == 0)
         {
             twi.twi_txBufferLength = 1;
-            twi.twi_txBuffer[0] = 0x00;
+            twi.twi_txBuffer[0]    = 0x00;
         }
 
         // Initiate transmission
@@ -663,7 +690,7 @@ void Twi::eventTask(ETSEvent *e)
 // compared to the logical-or of all states with the same branch.  This removes the need
 // for a large series of straight-line compares.  The biggest win is when multiple states
 // all have the same branch (onSdaChange), but for others there is some benefit, still.
-#define S2M(x) (1<<(x))
+#define S2M(x) (1 << (x))
 // Shorthand for if the state is any of the or'd bitmask x
 #define IFSTATE(x) if (twip_state_mask & (x))
 
@@ -677,7 +704,7 @@ void IRAM_ATTR Twi::onSclChange(void)
     sda = SDA_READ(twi.twi_sda);
     scl = SCL_READ(twi.twi_scl);
 
-    twi.twip_status = 0xF8;     // reset TWI status
+    twi.twip_status = 0xF8;  // reset TWI status
 
     int twip_state_mask = S2M(twi.twip_state);
     IFSTATE(S2M(TWIP_START) | S2M(TWIP_REP_START) | S2M(TWIP_SLA_W) | S2M(TWIP_READ))
@@ -752,13 +779,13 @@ void IRAM_ATTR Twi::onSclChange(void)
                 }
                 else
                 {
-                    SCL_LOW(twi.twi_scl);   // clock stretching
+                    SCL_LOW(twi.twi_scl);  // clock stretching
                     SDA_HIGH(twi.twi_sda);
                     twi.twip_mode = TWIPM_ADDRESSED;
                     if (!(twi.twi_data & 0x01))
                     {
                         twi.onTwipEvent(TW_SR_SLA_ACK);
-                        twi.bitCount = 8;
+                        twi.bitCount   = 8;
                         twi.twip_state = TWIP_SLA_W;
                     }
                     else
@@ -770,18 +797,18 @@ void IRAM_ATTR Twi::onSclChange(void)
             }
             else
             {
-                SCL_LOW(twi.twi_scl);   // clock stretching
+                SCL_LOW(twi.twi_scl);  // clock stretching
                 SDA_HIGH(twi.twi_sda);
                 if (!twi.twi_ack)
                 {
                     twi.onTwipEvent(TW_SR_DATA_NACK);
-                    twi.twip_mode = TWIPM_WAIT;
+                    twi.twip_mode  = TWIPM_WAIT;
                     twi.twip_state = TWIP_WAIT_STOP;
                 }
                 else
                 {
                     twi.onTwipEvent(TW_SR_DATA_ACK);
-                    twi.bitCount = 8;
+                    twi.bitCount   = 8;
                     twi.twip_state = TWIP_READ;
                 }
             }
@@ -837,7 +864,7 @@ void IRAM_ATTR Twi::onSclChange(void)
         else
         {
             twi.twi_ack_rec = !sda;
-            twi.twip_state = TWIP_RWAIT_ACK;
+            twi.twip_state  = TWIP_RWAIT_ACK;
         }
     }
     else IFSTATE(S2M(TWIP_RWAIT_ACK))
@@ -848,7 +875,7 @@ void IRAM_ATTR Twi::onSclChange(void)
         }
         else
         {
-            SCL_LOW(twi.twi_scl);   // clock stretching
+            SCL_LOW(twi.twi_scl);  // clock stretching
             if (twi.twi_ack && twi.twi_ack_rec)
             {
                 twi.onTwipEvent(TW_ST_DATA_ACK);
@@ -858,7 +885,7 @@ void IRAM_ATTR Twi::onSclChange(void)
             {
                 // we have no more data to send and/or the master doesn't want anymore
                 twi.onTwipEvent(twi.twi_ack_rec ? TW_ST_LAST_DATA : TW_ST_DATA_NACK);
-                twi.twip_mode = TWIPM_WAIT;
+                twi.twip_mode  = TWIPM_WAIT;
                 twi.twip_state = TWIP_WAIT_STOP;
             }
         }
@@ -875,7 +902,7 @@ void IRAM_ATTR Twi::onSdaChange(void)
     scl = SCL_READ(twi.twi_scl);
 
     int twip_state_mask = S2M(twi.twip_state);
-    if (scl)   /* !DATA */
+    if (scl) /* !DATA */
     {
         IFSTATE(S2M(TWIP_IDLE))
         {
@@ -886,17 +913,17 @@ void IRAM_ATTR Twi::onSdaChange(void)
             else
             {
                 // START
-                twi.bitCount = 8;
+                twi.bitCount   = 8;
                 twi.twip_state = TWIP_START;
-                ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true); // Once, ms
+                ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true);  // Once, ms
             }
         }
         else IFSTATE(S2M(TWIP_START) | S2M(TWIP_REP_START) | S2M(TWIP_SEND_ACK) | S2M(TWIP_WAIT_ACK) | S2M(TWIP_SLA_R) | S2M(TWIP_REC_ACK) | S2M(TWIP_READ_ACK) | S2M(TWIP_RWAIT_ACK) | S2M(TWIP_WRITE))
         {
             // START or STOP
-            SDA_HIGH(twi.twi_sda);   // Should not be necessary
+            SDA_HIGH(twi.twi_sda);  // Should not be necessary
             twi.onTwipEvent(TW_BUS_ERROR);
-            twi.twip_mode = TWIPM_WAIT;
+            twi.twip_mode  = TWIPM_WAIT;
             twi.twip_state = TWIP_BUS_ERR;
         }
         else IFSTATE(S2M(TWIP_WAIT_STOP) | S2M(TWIP_BUS_ERR))
@@ -904,10 +931,10 @@ void IRAM_ATTR Twi::onSdaChange(void)
             if (sda)
             {
                 // STOP
-                SCL_LOW(twi.twi_scl);   // generates a low SCL pulse after STOP
+                SCL_LOW(twi.twi_scl);  // generates a low SCL pulse after STOP
                 ets_timer_disarm(&twi.timer);
                 twi.twip_state = TWIP_IDLE;
-                twi.twip_mode = TWIPM_IDLE;
+                twi.twip_mode  = TWIPM_IDLE;
                 SCL_HIGH(twi.twi_scl);
             }
             else
@@ -919,9 +946,9 @@ void IRAM_ATTR Twi::onSdaChange(void)
                 }
                 else
                 {
-                    twi.bitCount = 8;
+                    twi.bitCount   = 8;
                     twi.twip_state = TWIP_REP_START;
-                    ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true); // Once, ms
+                    ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true);  // Once, ms
                 }
             }
         }
@@ -932,28 +959,28 @@ void IRAM_ATTR Twi::onSdaChange(void)
             {
                 // inside byte transfer - error
                 twi.onTwipEvent(TW_BUS_ERROR);
-                twi.twip_mode = TWIPM_WAIT;
+                twi.twip_mode  = TWIPM_WAIT;
                 twi.twip_state = TWIP_BUS_ERR;
             }
             else
             {
                 // during first bit in byte transfer - ok
-                SCL_LOW(twi.twi_scl);   // clock stretching
+                SCL_LOW(twi.twi_scl);  // clock stretching
                 twi.onTwipEvent(TW_SR_STOP);
                 if (sda)
                 {
                     // STOP
                     ets_timer_disarm(&twi.timer);
                     twi.twip_state = TWIP_IDLE;
-                    twi.twip_mode = TWIPM_IDLE;
+                    twi.twip_mode  = TWIPM_IDLE;
                 }
                 else
                 {
                     // START
                     twi.bitCount = 8;
-                    ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true); // Once, ms
+                    ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true);  // Once, ms
                     twi.twip_state = TWIP_REP_START;
-                    twi.twip_mode = TWIPM_IDLE;
+                    twi.twip_mode  = TWIPM_IDLE;
                 }
             }
         }
@@ -961,8 +988,8 @@ void IRAM_ATTR Twi::onSdaChange(void)
 }
 
 // C wrappers for the object, since API is exposed only as C
-extern "C" {
-
+extern "C"
+{
     void twi_init(unsigned char sda, unsigned char scl)
     {
         return twi.init(sda, scl);
@@ -983,12 +1010,12 @@ extern "C" {
         twi.setClockStretchLimit(limit);
     }
 
-    uint8_t twi_writeTo(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop)
+    uint8_t twi_writeTo(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop)
     {
         return twi.writeTo(address, buf, len, sendStop);
     }
 
-    uint8_t twi_readFrom(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop)
+    uint8_t twi_readFrom(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop)
     {
         return twi.readFrom(address, buf, len, sendStop);
     }
@@ -998,7 +1025,7 @@ extern "C" {
         return twi.status();
     }
 
-    uint8_t twi_transmit(const uint8_t * buf, uint8_t len)
+    uint8_t twi_transmit(const uint8_t* buf, uint8_t len)
     {
         return twi.transmit(buf, len);
     }
@@ -1027,5 +1054,4 @@ extern "C" {
     {
         twi.enableSlave();
     }
-
 };
diff --git a/cores/esp8266/debug.cpp b/cores/esp8266/debug.cpp
index 06af1e424b..327aace64e 100644
--- a/cores/esp8266/debug.cpp
+++ b/cores/esp8266/debug.cpp
@@ -30,7 +30,7 @@ void __iamslow(const char* what)
 #endif
 
 IRAM_ATTR
-void hexdump(const void *mem, uint32_t len, uint8_t cols)
+void hexdump(const void* mem, uint32_t len, uint8_t cols)
 {
     const char* src = (const char*)mem;
     os_printf("\n[HEXDUMP] Address: %p len: 0x%X (%d)", src, len, len);
diff --git a/cores/esp8266/debug.h b/cores/esp8266/debug.h
index 263d3e9149..025687a5af 100644
--- a/cores/esp8266/debug.h
+++ b/cores/esp8266/debug.h
@@ -5,44 +5,54 @@
 #include <stdint.h>
 
 #ifdef DEBUG_ESP_CORE
-#define DEBUGV(fmt, ...) ::printf((PGM_P)PSTR(fmt), ## __VA_ARGS__)
+#define DEBUGV(fmt, ...) ::printf((PGM_P)PSTR(fmt), ##__VA_ARGS__)
 #endif
 
 #ifndef DEBUGV
-#define DEBUGV(...) do { (void)0; } while (0)
+#define DEBUGV(...) \
+    do              \
+    {               \
+        (void)0;    \
+    } while (0)
 #endif
 
 #ifdef __cplusplus
-extern "C" void hexdump(const void *mem, uint32_t len, uint8_t cols = 16);
+extern "C" void hexdump(const void* mem, uint32_t len, uint8_t cols = 16);
 #else
-void hexdump(const void *mem, uint32_t len, uint8_t cols);
+void hexdump(const void* mem, uint32_t len, uint8_t cols);
 #endif
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
-void __unhandled_exception(const char *str) __attribute__((noreturn));
-void __panic_func(const char* file, int line, const char* func) __attribute__((noreturn));
+    void __unhandled_exception(const char* str) __attribute__((noreturn));
+    void __panic_func(const char* file, int line, const char* func) __attribute__((noreturn));
 #define panic() __panic_func(PSTR(__FILE__), __LINE__, __func__)
 
 #ifdef DEBUG_ESP_CORE
-extern void __iamslow(const char* what);
-#define IAMSLOW() \
-    do { \
-        static bool once = false; \
-        if (!once) { \
-            once = true; \
+    extern void __iamslow(const char* what);
+#define IAMSLOW()                                  \
+    do                                             \
+    {                                              \
+        static bool once = false;                  \
+        if (!once)                                 \
+        {                                          \
+            once = true;                           \
             __iamslow((PGM_P)FPSTR(__FUNCTION__)); \
-        } \
+        }                                          \
     } while (0)
 #else
-#define IAMSLOW() do { (void)0; } while (0)
+#define IAMSLOW() \
+    do            \
+    {             \
+        (void)0;  \
+    } while (0)
 #endif
 
 #ifdef __cplusplus
 }
 #endif
 
-
-#endif//ARD_DEBUG_H
+#endif  //ARD_DEBUG_H
diff --git a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
index ddc5629741..e1caa3d909 100644
--- a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
+++ b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
@@ -5,10 +5,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 void setup() {
@@ -39,7 +39,7 @@ void setup() {
     String type;
     if (ArduinoOTA.getCommand() == U_FLASH) {
       type = "sketch";
-    } else { // U_FS
+    } else {  // U_FS
       type = "filesystem";
     }
 
diff --git a/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino b/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
index 7d05074e15..7c01e2e7cb 100644
--- a/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
+++ b/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
@@ -5,16 +5,16 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
-const char* host = "OTA-LEDS";
+const char* host     = "OTA-LEDS";
 
 int led_pin = 13;
 #define N_DIMMERS 3
-int dimmer_pin[] = {14, 5, 15};
+int dimmer_pin[] = { 14, 5, 15 };
 
 void setup() {
   Serial.begin(115200);
@@ -45,14 +45,14 @@ void setup() {
   }
 
   ArduinoOTA.setHostname(host);
-  ArduinoOTA.onStart([]() { // switch off all the PWMs during upgrade
+  ArduinoOTA.onStart([]() {  // switch off all the PWMs during upgrade
     for (int i = 0; i < N_DIMMERS; i++) {
       analogWrite(dimmer_pin[i], 0);
     }
     analogWrite(led_pin, 0);
   });
 
-  ArduinoOTA.onEnd([]() { // do a fancy thing with our board led at end
+  ArduinoOTA.onEnd([]() {  // do a fancy thing with our board led at end
     for (int i = 0; i < 30; i++) {
       analogWrite(led_pin, (i * 100) % 1001);
       delay(50);
@@ -67,7 +67,6 @@ void setup() {
   /* setup the OTA server */
   ArduinoOTA.begin();
   Serial.println("Ready");
-
 }
 
 void loop() {
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
index 5f1f5020a1..21abb08a4e 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
@@ -20,22 +20,22 @@
 /* Set these to your desired softAP credentials. They are not configurable at runtime */
 #ifndef APSSID
 #define APSSID "ESP_ap"
-#define APPSK  "12345678"
+#define APPSK "12345678"
 #endif
 
-const char *softAP_ssid = APSSID;
-const char *softAP_password = APPSK;
+const char* softAP_ssid     = APSSID;
+const char* softAP_password = APPSK;
 
 /* hostname for mDNS. Should work at least on windows. Try http://esp8266.local */
-const char *myHostname = "esp8266";
+const char* myHostname = "esp8266";
 
 /* Don't set this wifi credentials. They are configurated at runtime and stored on EEPROM */
-char ssid[33] = "";
+char ssid[33]     = "";
 char password[65] = "";
 
 // DNS server
 const byte DNS_PORT = 53;
-DNSServer dnsServer;
+DNSServer  dnsServer;
 
 // Web server
 ESP8266WebServer server(80);
@@ -44,7 +44,6 @@ ESP8266WebServer server(80);
 IPAddress apIP(172, 217, 28, 1);
 IPAddress netMsk(255, 255, 255, 0);
 
-
 /** Should I connect to WLAN asap? */
 boolean connect;
 
@@ -62,7 +61,7 @@ void setup() {
   /* You can remove the password parameter if you want the AP to be open. */
   WiFi.softAPConfig(apIP, apIP, netMsk);
   WiFi.softAP(softAP_ssid, softAP_password);
-  delay(500); // Without delay I've seen the IP address blank
+  delay(500);  // Without delay I've seen the IP address blank
   Serial.print("AP IP address: ");
   Serial.println(WiFi.softAPIP());
 
@@ -75,12 +74,12 @@ void setup() {
   server.on("/wifi", handleWifi);
   server.on("/wifisave", handleWifiSave);
   server.on("/generate_204", handleRoot);  //Android captive portal. Maybe not needed. Might be handled by notFound handler.
-  server.on("/fwlink", handleRoot);  //Microsoft captive portal. Maybe not needed. Might be handled by notFound handler.
+  server.on("/fwlink", handleRoot);        //Microsoft captive portal. Maybe not needed. Might be handled by notFound handler.
   server.onNotFound(handleNotFound);
-  server.begin(); // Web server start
+  server.begin();  // Web server start
   Serial.println("HTTP server started");
-  loadCredentials(); // Load WLAN credentials from network
-  connect = strlen(ssid) > 0; // Request WLAN connect if there is a SSID
+  loadCredentials();           // Load WLAN credentials from network
+  connect = strlen(ssid) > 0;  // Request WLAN connect if there is a SSID
 }
 
 void connectWifi() {
@@ -106,7 +105,7 @@ void loop() {
       /* Don't set retry time too low as retry interfere the softAP operation */
       connect = true;
     }
-    if (status != s) { // WLAN status change
+    if (status != s) {  // WLAN status change
       Serial.print("Status: ");
       Serial.println(s);
       status = s;
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
index dc286c1840..5b88ae272a 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
@@ -1,6 +1,6 @@
 /** Handle root or redirect to captive portal */
 void handleRoot() {
-  if (captivePortal()) { // If caprive portal redirect instead of displaying the page.
+  if (captivePortal()) {  // If caprive portal redirect instead of displaying the page.
     return;
   }
   server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
@@ -9,18 +9,18 @@ void handleRoot() {
 
   String Page;
   Page += F(
-            "<!DOCTYPE html><html lang='en'><head>"
-            "<meta name='viewport' content='width=device-width'>"
-            "<title>CaptivePortal</title></head><body>"
-            "<h1>HELLO WORLD!!</h1>");
+      "<!DOCTYPE html><html lang='en'><head>"
+      "<meta name='viewport' content='width=device-width'>"
+      "<title>CaptivePortal</title></head><body>"
+      "<h1>HELLO WORLD!!</h1>");
   if (server.client().localIP() == apIP) {
     Page += String(F("<p>You are connected through the soft AP: ")) + softAP_ssid + F("</p>");
   } else {
     Page += String(F("<p>You are connected through the wifi network: ")) + ssid + F("</p>");
   }
   Page += F(
-            "<p>You may want to <a href='/wifi'>config the wifi connection</a>.</p>"
-            "</body></html>");
+      "<p>You may want to <a href='/wifi'>config the wifi connection</a>.</p>"
+      "</body></html>");
 
   server.send(200, "text/html", Page);
 }
@@ -30,8 +30,8 @@ boolean captivePortal() {
   if (!isIp(server.hostHeader()) && server.hostHeader() != (String(myHostname) + ".local")) {
     Serial.println("Request redirected to captive portal");
     server.sendHeader("Location", String("http://") + toStringIp(server.client().localIP()), true);
-    server.send(302, "text/plain", "");   // Empty content inhibits Content-length header so we have to close the socket ourselves.
-    server.client().stop(); // Stop is needed because we sent no content length
+    server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to close the socket ourselves.
+    server.client().stop();              // Stop is needed because we sent no content length
     return true;
   }
   return false;
@@ -45,37 +45,32 @@ void handleWifi() {
 
   String Page;
   Page += F(
-            "<!DOCTYPE html><html lang='en'><head>"
-            "<meta name='viewport' content='width=device-width'>"
-            "<title>CaptivePortal</title></head><body>"
-            "<h1>Wifi config</h1>");
+      "<!DOCTYPE html><html lang='en'><head>"
+      "<meta name='viewport' content='width=device-width'>"
+      "<title>CaptivePortal</title></head><body>"
+      "<h1>Wifi config</h1>");
   if (server.client().localIP() == apIP) {
     Page += String(F("<p>You are connected through the soft AP: ")) + softAP_ssid + F("</p>");
   } else {
     Page += String(F("<p>You are connected through the wifi network: ")) + ssid + F("</p>");
   }
-  Page +=
-    String(F(
-             "\r\n<br />"
-             "<table><tr><th align='left'>SoftAP config</th></tr>"
-             "<tr><td>SSID ")) +
-    String(softAP_ssid) +
-    F("</td></tr>"
-      "<tr><td>IP ") +
-    toStringIp(WiFi.softAPIP()) +
-    F("</td></tr>"
-      "</table>"
-      "\r\n<br />"
-      "<table><tr><th align='left'>WLAN config</th></tr>"
-      "<tr><td>SSID ") +
-    String(ssid) +
-    F("</td></tr>"
-      "<tr><td>IP ") +
-    toStringIp(WiFi.localIP()) +
-    F("</td></tr>"
-      "</table>"
-      "\r\n<br />"
-      "<table><tr><th align='left'>WLAN list (refresh if any missing)</th></tr>");
+  Page += String(F(
+              "\r\n<br />"
+              "<table><tr><th align='left'>SoftAP config</th></tr>"
+              "<tr><td>SSID "))
+      + String(softAP_ssid) + F("</td></tr>"
+                                "<tr><td>IP ")
+      + toStringIp(WiFi.softAPIP()) + F("</td></tr>"
+                                        "</table>"
+                                        "\r\n<br />"
+                                        "<table><tr><th align='left'>WLAN config</th></tr>"
+                                        "<tr><td>SSID ")
+      + String(ssid) + F("</td></tr>"
+                         "<tr><td>IP ")
+      + toStringIp(WiFi.localIP()) + F("</td></tr>"
+                                       "</table>"
+                                       "\r\n<br />"
+                                       "<table><tr><th align='left'>WLAN list (refresh if any missing)</th></tr>");
   Serial.println("scan start");
   int n = WiFi.scanNetworks();
   Serial.println("scan done");
@@ -87,15 +82,15 @@ void handleWifi() {
     Page += F("<tr><td>No WLAN found</td></tr>");
   }
   Page += F(
-            "</table>"
-            "\r\n<br /><form method='POST' action='wifisave'><h4>Connect to network:</h4>"
-            "<input type='text' placeholder='network' name='n'/>"
-            "<br /><input type='password' placeholder='password' name='p'/>"
-            "<br /><input type='submit' value='Connect/Disconnect'/></form>"
-            "<p>You may want to <a href='/'>return to the home page</a>.</p>"
-            "</body></html>");
+      "</table>"
+      "\r\n<br /><form method='POST' action='wifisave'><h4>Connect to network:</h4>"
+      "<input type='text' placeholder='network' name='n'/>"
+      "<br /><input type='password' placeholder='password' name='p'/>"
+      "<br /><input type='submit' value='Connect/Disconnect'/></form>"
+      "<p>You may want to <a href='/'>return to the home page</a>.</p>"
+      "</body></html>");
   server.send(200, "text/html", Page);
-  server.client().stop(); // Stop is needed because we sent no content length
+  server.client().stop();  // Stop is needed because we sent no content length
 }
 
 /** Handle the WLAN save form and redirect to WLAN config page again */
@@ -107,14 +102,14 @@ void handleWifiSave() {
   server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
   server.sendHeader("Pragma", "no-cache");
   server.sendHeader("Expires", "-1");
-  server.send(302, "text/plain", "");    // Empty content inhibits Content-length header so we have to close the socket ourselves.
-  server.client().stop(); // Stop is needed because we sent no content length
+  server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to close the socket ourselves.
+  server.client().stop();              // Stop is needed because we sent no content length
   saveCredentials();
-  connect = strlen(ssid) > 0; // Request WLAN connect with new credentials if there is a SSID
+  connect = strlen(ssid) > 0;  // Request WLAN connect with new credentials if there is a SSID
 }
 
 void handleNotFound() {
-  if (captivePortal()) { // If caprive portal redirect instead of displaying the error page.
+  if (captivePortal()) {  // If caprive portal redirect instead of displaying the error page.
     return;
   }
   String message = F("File Not Found\n\n");
diff --git a/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino b/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
index 21a97172ef..85190df74d 100644
--- a/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/BasicHttpClient/BasicHttpClient.ino
@@ -17,7 +17,6 @@
 ESP8266WiFiMulti WiFiMulti;
 
 void setup() {
-
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -33,13 +32,11 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP("SSID", "PASSWORD");
-
 }
 
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
-
     WiFiClient client;
 
     HTTPClient http;
@@ -47,7 +44,6 @@ void loop() {
     Serial.print("[HTTP] begin...\n");
     if (http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html")) {  // HTTP
 
-
       Serial.print("[HTTP] GET...\n");
       // start connection and send HTTP header
       int httpCode = http.GET();
diff --git a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
index aaa4af2b4d..4a3618962d 100644
--- a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
@@ -14,12 +14,11 @@
 
 #include <WiFiClientSecureBearSSL.h>
 // Fingerprint for demo URL, expires on June 2, 2021, needs to be updated well before this date
-const uint8_t fingerprint[20] = {0x40, 0xaf, 0x00, 0x6b, 0xec, 0x90, 0x22, 0x41, 0x8e, 0xa3, 0xad, 0xfa, 0x1a, 0xe8, 0x25, 0x41, 0x1d, 0x1a, 0x54, 0xb3};
+const uint8_t fingerprint[20] = { 0x40, 0xaf, 0x00, 0x6b, 0xec, 0x90, 0x22, 0x41, 0x8e, 0xa3, 0xad, 0xfa, 0x1a, 0xe8, 0x25, 0x41, 0x1d, 0x1a, 0x54, 0xb3 };
 
 ESP8266WiFiMulti WiFiMulti;
 
 void setup() {
-
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -40,8 +39,7 @@ void setup() {
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
-
-    std::unique_ptr<BearSSL::WiFiClientSecure>client(new BearSSL::WiFiClientSecure);
+    std::unique_ptr<BearSSL::WiFiClientSecure> client(new BearSSL::WiFiClientSecure);
 
     client->setFingerprint(fingerprint);
     // Or, if you happy to ignore the SSL certificate, then use the following line instead:
diff --git a/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino b/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
index db8fe8cbd4..8786bd09a5 100644
--- a/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
+++ b/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
@@ -13,17 +13,17 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid         = STASSID;
 const char* ssidPassword = STAPSK;
 
-const char *username = "admin";
-const char *password = "admin";
+const char* username = "admin";
+const char* password = "admin";
 
-const char *server = "http://httpbin.org";
-const char *uri = "/digest-auth/auth/admin/admin/MD5";
+const char* server = "http://httpbin.org";
+const char* uri    = "/digest-auth/auth/admin/admin/MD5";
 
 String exractParam(String& authReq, const String& param, const char delimit) {
   int _begin = authReq.indexOf(param);
@@ -34,10 +34,9 @@ String exractParam(String& authReq, const String& param, const char delimit) {
 }
 
 String getCNonce(const int len) {
-  static const char alphanum[] =
-    "0123456789"
-    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-    "abcdefghijklmnopqrstuvwxyz";
+  static const char alphanum[] = "0123456789"
+                                 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                                 "abcdefghijklmnopqrstuvwxyz";
   String s = "";
 
   for (int i = 0; i < len; ++i) {
@@ -49,8 +48,8 @@ String getCNonce(const int len) {
 
 String getDigestAuth(String& authReq, const String& username, const String& password, const String& method, const String& uri, unsigned int counter) {
   // extracting required parameters for RFC 2069 simpler Digest
-  String realm = exractParam(authReq, "realm=\"", '"');
-  String nonce = exractParam(authReq, "nonce=\"", '"');
+  String realm  = exractParam(authReq, "realm=\"", '"');
+  String nonce  = exractParam(authReq, "nonce=\"", '"');
   String cNonce = getCNonce(8);
 
   char nc[9];
@@ -73,8 +72,7 @@ String getDigestAuth(String& authReq, const String& username, const String& pass
   md5.calculate();
   String response = md5.toString();
 
-  String authorization = "Digest username=\"" + username + "\", realm=\"" + realm + "\", nonce=\"" + nonce +
-                         "\", uri=\"" + uri + "\", algorithm=\"MD5\", qop=auth, nc=" + String(nc) + ", cnonce=\"" + cNonce + "\", response=\"" + response + "\"";
+  String authorization = "Digest username=\"" + username + "\", realm=\"" + realm + "\", nonce=\"" + nonce + "\", uri=\"" + uri + "\", algorithm=\"MD5\", qop=auth, nc=" + String(nc) + ", cnonce=\"" + cNonce + "\", response=\"" + response + "\"";
   Serial.println(authorization);
 
   return authorization;
@@ -100,15 +98,14 @@ void setup() {
 
 void loop() {
   WiFiClient client;
-  HTTPClient http; //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
+  HTTPClient http;  //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
 
   Serial.print("[HTTP] begin...\n");
 
   // configure traged server and url
   http.begin(client, String(server) + String(uri));
 
-
-  const char *keys[] = {"WWW-Authenticate"};
+  const char* keys[] = { "WWW-Authenticate" };
   http.collectHeaders(keys, 1);
 
   Serial.print("[HTTP] GET...\n");
diff --git a/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino b/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
index 936e235eeb..04648a56eb 100644
--- a/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
@@ -20,11 +20,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 void setup() {
-
   Serial.begin(115200);
 
   Serial.println();
@@ -40,19 +39,17 @@ void setup() {
   Serial.println("");
   Serial.print("Connected! IP address: ");
   Serial.println(WiFi.localIP());
-
 }
 
 void loop() {
   // wait for WiFi connection
   if ((WiFi.status() == WL_CONNECTED)) {
-
     WiFiClient client;
     HTTPClient http;
 
     Serial.print("[HTTP] begin...\n");
     // configure traged server and url
-    http.begin(client, "http://" SERVER_IP "/postplain/"); //HTTP
+    http.begin(client, "http://" SERVER_IP "/postplain/");  //HTTP
     http.addHeader("Content-Type", "application/json");
 
     Serial.print("[HTTP] POST...\n");
diff --git a/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino b/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
index 42a89beced..2f0961f645 100644
--- a/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
+++ b/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
@@ -6,14 +6,13 @@
    This example reuses the http connection and also restores the connection if the connection is lost
 */
 
-
 #include <ESP8266WiFi.h>
 #include <ESP8266WiFiMulti.h>
 #include <ESP8266HTTPClient.h>
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 ESP8266WiFiMulti WiFiMulti;
@@ -22,7 +21,6 @@ HTTPClient http;
 WiFiClient client;
 
 void setup() {
-
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -43,7 +41,6 @@ void setup() {
   // allow reuse (if server supports it)
   http.setReuse(true);
 
-
   http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html");
   //http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
 }
diff --git a/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino b/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
index 7e1593f52b..397639b504 100644
--- a/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
@@ -15,7 +15,6 @@
 ESP8266WiFiMulti WiFiMulti;
 
 void setup() {
-
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -31,15 +30,13 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP("SSID", "PASSWORD");
-
 }
 
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
-
     WiFiClient client;
-    HTTPClient http; //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
+    HTTPClient http;  //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
 
     Serial.print("[HTTP] begin...\n");
 
@@ -56,7 +53,6 @@ void loop() {
 
       // file found at server
       if (httpCode == HTTP_CODE_OK) {
-
         // get length of document (is -1 when Server sends no Content-Length header)
         int len = http.getSize();
 
@@ -70,7 +66,7 @@ void loop() {
         // or "by hand"
 
         // get tcp stream
-        WiFiClient * stream = &client;
+        WiFiClient* stream = &client;
 
         // read all data from server
         while (http.connected() && (len > 0 || len == -1)) {
diff --git a/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
index 8098986650..cb280a3d27 100644
--- a/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
@@ -15,7 +15,6 @@
 ESP8266WiFiMulti WiFiMulti;
 
 void setup() {
-
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -31,13 +30,11 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP("SSID", "PASSWORD");
-
 }
 
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
-
     std::unique_ptr<BearSSL::WiFiClientSecure> client(new BearSSL::WiFiClientSecure);
 
     bool mfln = client->probeMaxFragmentLength("tls.mbed.org", 443, 1024);
@@ -50,14 +47,13 @@ void loop() {
     Serial.print("[HTTPS] begin...\n");
 
     // configure server and url
-    const uint8_t fingerprint[20] = {0x15, 0x77, 0xdc, 0x04, 0x7c, 0x00, 0xf8, 0x70, 0x09, 0x34, 0x24, 0xf4, 0xd3, 0xa1, 0x7a, 0x6c, 0x1e, 0xa3, 0xe0, 0x2a};
+    const uint8_t fingerprint[20] = { 0x15, 0x77, 0xdc, 0x04, 0x7c, 0x00, 0xf8, 0x70, 0x09, 0x34, 0x24, 0xf4, 0xd3, 0xa1, 0x7a, 0x6c, 0x1e, 0xa3, 0xe0, 0x2a };
 
     client->setFingerprint(fingerprint);
 
     HTTPClient https;
 
     if (https.begin(*client, "https://tls.mbed.org/")) {
-
       Serial.print("[HTTPS] GET...\n");
       // start connection and send HTTP header
       int httpCode = https.GET();
@@ -67,7 +63,6 @@ void loop() {
 
         // file found at server
         if (httpCode == HTTP_CODE_OK) {
-
           // get length of document (is -1 when Server sends no Content-Length header)
           int len = https.getSize();
 
@@ -95,7 +90,6 @@ void loop() {
 
           Serial.println();
           Serial.print("[HTTPS] connection closed or file end.\n");
-
         }
       } else {
         Serial.printf("[HTTPS] GET... failed, error: %s\n", https.errorToString(httpCode).c_str());
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
index 11e23a929d..0270fa9723 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
@@ -10,21 +10,20 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* host = "esp8266-webupdate";
-const char* update_path = "/firmware";
+const char* host            = "esp8266-webupdate";
+const char* update_path     = "/firmware";
 const char* update_username = "admin";
 const char* update_password = "admin";
-const char* ssid = STASSID;
-const char* password = STAPSK;
+const char* ssid            = STASSID;
+const char* password        = STAPSK;
 
-ESP8266WebServer httpServer(80);
+ESP8266WebServer        httpServer(80);
 ESP8266HTTPUpdateServer httpUpdater;
 
 void setup(void) {
-
   Serial.begin(115200);
   Serial.println();
   Serial.println("Booting Sketch...");
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
index fea3c4023a..f7644aa683 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
@@ -10,18 +10,17 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* host = "esp8266-webupdate";
-const char* ssid = STASSID;
+const char* host     = "esp8266-webupdate";
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
-ESP8266WebServer httpServer(80);
+ESP8266WebServer        httpServer(80);
 ESP8266HTTPUpdateServer httpUpdater;
 
 void setup(void) {
-
   Serial.begin(115200);
   Serial.println();
   Serial.println("Booting Sketch...");
diff --git a/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino b/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
index 6b29bb5141..c29a76fe98 100644
--- a/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
+++ b/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
@@ -62,10 +62,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 ESP8266WebServer web_server(80);
diff --git a/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino b/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
old mode 100755
new mode 100644
index 57f5529850..22c8986fbf
--- a/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
+++ b/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
@@ -4,14 +4,14 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 ESP8266WebServer wwwserver(80);
-String content;
+String           content;
 
 static void handleRoot(void) {
   content = F("<!DOCTYPE HTML>\n<html>Hello world from ESP8266");
@@ -40,7 +40,6 @@ void setup() {
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-
   wwwserver.on("/", handleRoot);
   wwwserver.begin();
 
diff --git a/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino b/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
index 2fc8508ca0..52dc26494a 100644
--- a/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
+++ b/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
@@ -35,11 +35,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer server(80);
 
@@ -48,9 +48,9 @@ const int led = 13;
 void handleRoot() {
   digitalWrite(led, 1);
   char temp[400];
-  int sec = millis() / 1000;
-  int min = sec / 60;
-  int hr = min / 60;
+  int  sec = millis() / 1000;
+  int  min = sec / 60;
+  int  hr  = min / 60;
 
   snprintf(temp, 400,
 
@@ -69,8 +69,7 @@ void handleRoot() {
   </body>\
 </html>",
 
-           hr, min % 60, sec % 60
-          );
+           hr, min % 60, sec % 60);
   server.send(200, "text/html", temp);
   digitalWrite(led, 0);
 }
@@ -151,4 +150,3 @@ void loop(void) {
   server.handleClient();
   MDNS.update();
 }
-
diff --git a/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino b/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
index 39f69fe3ff..c29c5bd162 100644
--- a/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
+++ b/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
@@ -49,45 +49,44 @@
 
 #if defined USE_SPIFFS
 #include <FS.h>
-const char* fsName = "SPIFFS";
-FS* fileSystem = &SPIFFS;
-SPIFFSConfig fileSystemConfig = SPIFFSConfig();
+const char*   fsName           = "SPIFFS";
+FS*           fileSystem       = &SPIFFS;
+SPIFFSConfig  fileSystemConfig = SPIFFSConfig();
 #elif defined USE_LITTLEFS
 #include <LittleFS.h>
-const char* fsName = "LittleFS";
-FS* fileSystem = &LittleFS;
+const char*    fsName           = "LittleFS";
+FS*            fileSystem       = &LittleFS;
 LittleFSConfig fileSystemConfig = LittleFSConfig();
 #elif defined USE_SDFS
 #include <SDFS.h>
-const char* fsName = "SDFS";
-FS* fileSystem = &SDFS;
-SDFSConfig fileSystemConfig = SDFSConfig();
+const char* fsName           = "SDFS";
+FS*         fileSystem       = &SDFS;
+SDFSConfig  fileSystemConfig = SDFSConfig();
 // fileSystemConfig.setCSPin(chipSelectPin);
 #else
 #error Please select a filesystem first by uncommenting one of the "#define USE_xxx" lines at the beginning of the sketch.
 #endif
 
-
 #define DBG_OUTPUT_PORT Serial
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
-const char* host = "fsbrowser";
+const char* host     = "fsbrowser";
 
 ESP8266WebServer server(80);
 
 static bool fsOK;
-String unsupportedFiles = String();
+String      unsupportedFiles = String();
 
 File uploadFile;
 
-static const char TEXT_PLAIN[] PROGMEM = "text/plain";
-static const char FS_INIT_ERROR[] PROGMEM = "FS INIT ERROR";
+static const char TEXT_PLAIN[] PROGMEM     = "text/plain";
+static const char FS_INIT_ERROR[] PROGMEM  = "FS INIT ERROR";
 static const char FILE_NOT_FOUND[] PROGMEM = "FileNotFound";
 
 ////////////////////////////////
@@ -135,7 +134,6 @@ String checkForUnsupportedPath(String filename) {
 }
 #endif
 
-
 ////////////////////////////////
 // Request handlers
 
@@ -168,7 +166,6 @@ void handleStatus() {
   server.send(200, "application/json", json);
 }
 
-
 /*
    Return the list of files in the directory specified by the "dir" query string parameter.
    Also demonstrates the use of chunked responses.
@@ -242,7 +239,6 @@ void handleFileList() {
   server.chunkedResponseFinalize();
 }
 
-
 /*
    Read the given file from the filesystem and stream it back to the client
 */
@@ -280,7 +276,6 @@ bool handleFileRead(String path) {
   return false;
 }
 
-
 /*
    As some FS (e.g. LittleFS) delete the parent folder when the last child has been removed,
    return the path of the closest parent still existing
@@ -345,7 +340,7 @@ void handleFileCreate() {
       // Create a file
       File file = fileSystem->open(path, "w");
       if (file) {
-        file.write((const char *)0);
+        file.write((const char*)0);
         file.close();
       } else {
         return replyServerError(F("CREATE FAILED"));
@@ -379,7 +374,6 @@ void handleFileCreate() {
   }
 }
 
-
 /*
    Delete the file or folder designed by the given path.
    If it's a file, delete it.
@@ -390,7 +384,7 @@ void handleFileCreate() {
    Please don't do this on a production system.
 */
 void deleteRecursive(String path) {
-  File file = fileSystem->open(path, "r");
+  File file  = fileSystem->open(path, "r");
   bool isDir = file.isDirectory();
   file.close();
 
@@ -411,7 +405,6 @@ void deleteRecursive(String path) {
   fileSystem->rmdir(path);
 }
 
-
 /*
    Handle a file deletion request
    Operation      | req.responseText
@@ -477,7 +470,6 @@ void handleFileUpload() {
   }
 }
 
-
 /*
    The "Not Found" handler catches all URI not explicitly declared in code
    First try to find and return the requested file from the filesystem,
@@ -488,7 +480,7 @@ void handleNotFound() {
     return replyServerError(FPSTR(FS_INIT_ERROR));
   }
 
-  String uri = ESP8266WebServer::urlDecode(server.uri()); // required to read paths with blanks
+  String uri = ESP8266WebServer::urlDecode(server.uri());  // required to read paths with blanks
 
   if (handleFileRead(uri)) {
     return;
@@ -536,7 +528,6 @@ void handleGetEdit() {
 #else
   replyNotFound(FPSTR(FILE_NOT_FOUND));
 #endif
-
 }
 
 void setup(void) {
@@ -559,7 +550,7 @@ void setup(void) {
   Dir dir = fileSystem->openDir("");
   DBG_OUTPUT_PORT.println(F("List of files at root of filesystem:"));
   while (dir.next()) {
-    String error = checkForUnsupportedPath(dir.fileName());
+    String error    = checkForUnsupportedPath(dir.fileName());
     String fileInfo = dir.fileName() + (dir.isDirectory() ? " [DIR]" : String(" (") + dir.fileSize() + "b)");
     DBG_OUTPUT_PORT.println(error + fileInfo);
     if (error.length() > 0) {
@@ -609,15 +600,15 @@ void setup(void) {
   server.on("/edit", HTTP_GET, handleGetEdit);
 
   // Create file
-  server.on("/edit",  HTTP_PUT, handleFileCreate);
+  server.on("/edit", HTTP_PUT, handleFileCreate);
 
   // Delete file
-  server.on("/edit",  HTTP_DELETE, handleFileDelete);
+  server.on("/edit", HTTP_DELETE, handleFileDelete);
 
   // Upload file
   // - first callback is called after the request has ended with all parsed arguments
   // - second callback handles file upload at that location
-  server.on("/edit",  HTTP_POST, replyOK, handleFileUpload);
+  server.on("/edit", HTTP_POST, replyOK, handleFileUpload);
 
   // Default handler for all URIs not defined above
   // Use it to read files from filesystem
@@ -628,7 +619,6 @@ void setup(void) {
   DBG_OUTPUT_PORT.println("HTTP server started");
 }
 
-
 void loop(void) {
   server.handleClient();
   MDNS.update();
diff --git a/libraries/ESP8266WebServer/examples/Graph/Graph.ino b/libraries/ESP8266WebServer/examples/Graph/Graph.ino
index b0eb5f847b..6d2bf41f1a 100644
--- a/libraries/ESP8266WebServer/examples/Graph/Graph.ino
+++ b/libraries/ESP8266WebServer/examples/Graph/Graph.ino
@@ -38,27 +38,26 @@
 
 #if defined USE_SPIFFS
 #include <FS.h>
-FS* fileSystem = &SPIFFS;
-SPIFFSConfig fileSystemConfig = SPIFFSConfig();
+FS*           fileSystem       = &SPIFFS;
+SPIFFSConfig  fileSystemConfig = SPIFFSConfig();
 #elif defined USE_LITTLEFS
 #include <LittleFS.h>
-FS* fileSystem = &LittleFS;
+FS*            fileSystem       = &LittleFS;
 LittleFSConfig fileSystemConfig = LittleFSConfig();
 #elif defined USE_SDFS
 #include <SDFS.h>
-FS* fileSystem = &SDFS;
+FS*        fileSystem       = &SDFS;
 SDFSConfig fileSystemConfig = SDFSConfig();
 // fileSystemConfig.setCSPin(chipSelectPin);
 #else
 #error Please select a filesystem first by uncommenting one of the "#define USE_xxx" lines at the beginning of the sketch.
 #endif
 
-
 #define DBG_OUTPUT_PORT Serial
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 // Indicate which digital I/Os should be displayed on the chart.
@@ -66,14 +65,14 @@ SDFSConfig fileSystemConfig = SDFSConfig();
 // e.g. 0b11111000000111111
 unsigned int gpioMask;
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
-const char* host = "graph";
+const char* host     = "graph";
 
 ESP8266WebServer server(80);
 
-static const char TEXT_PLAIN[] PROGMEM = "text/plain";
-static const char FS_INIT_ERROR[] PROGMEM = "FS INIT ERROR";
+static const char TEXT_PLAIN[] PROGMEM     = "text/plain";
+static const char FS_INIT_ERROR[] PROGMEM  = "FS INIT ERROR";
 static const char FILE_NOT_FOUND[] PROGMEM = "FileNotFound";
 
 ////////////////////////////////
@@ -132,14 +131,13 @@ bool handleFileRead(String path) {
   return false;
 }
 
-
 /*
    The "Not Found" handler catches all URI not explicitly declared in code
    First try to find and return the requested file from the filesystem,
    and if it fails, return a 404 page with debug information
 */
 void handleNotFound() {
-  String uri = ESP8266WebServer::urlDecode(server.uri()); // required to read paths with blanks
+  String uri = ESP8266WebServer::urlDecode(server.uri());  // required to read paths with blanks
 
   if (handleFileRead(uri)) {
     return;
@@ -240,7 +238,6 @@ void setup(void) {
   // Use it to read files from filesystem
   server.onNotFound(handleNotFound);
 
-
   // Start server
   server.begin();
   DBG_OUTPUT_PORT.println("HTTP server started");
@@ -249,7 +246,6 @@ void setup(void) {
   DBG_OUTPUT_PORT.println(" 0 (OFF):    outputs are off and hidden from chart");
   DBG_OUTPUT_PORT.println(" 1 (AUTO):   outputs are rotated automatically every second");
   DBG_OUTPUT_PORT.println(" 2 (MANUAL): outputs can be toggled from the web page");
-
 }
 
 // Return default GPIO mask, that is all I/Os except SD card ones
@@ -263,10 +259,10 @@ unsigned int defaultMask() {
   return mask;
 }
 
-int rgbMode = 1; // 0=off - 1=auto - 2=manual
-int rgbValue = 0;
+int                                rgbMode  = 1;  // 0=off - 1=auto - 2=manual
+int                                rgbValue = 0;
 esp8266::polledTimeout::periodicMs timeToChange(1000);
-bool modeChangeRequested = false;
+bool                               modeChangeRequested = false;
 
 void loop(void) {
   server.handleClient();
@@ -295,11 +291,11 @@ void loop(void) {
 
   // act according to mode
   switch (rgbMode) {
-    case 0: // off
+    case 0:  // off
       gpioMask = defaultMask();
-      gpioMask &= ~(1 << 12); // Hide GPIO 12
-      gpioMask &= ~(1 << 13); // Hide GPIO 13
-      gpioMask &= ~(1 << 15); // Hide GPIO 15
+      gpioMask &= ~(1 << 12);  // Hide GPIO 12
+      gpioMask &= ~(1 << 13);  // Hide GPIO 13
+      gpioMask &= ~(1 << 15);  // Hide GPIO 15
 
       // reset outputs
       digitalWrite(12, 0);
@@ -307,7 +303,7 @@ void loop(void) {
       digitalWrite(15, 0);
       break;
 
-    case 1: // auto
+    case 1:  // auto
       gpioMask = defaultMask();
 
       // increment value (reset after 7)
@@ -322,11 +318,10 @@ void loop(void) {
       digitalWrite(15, rgbValue & 0b100);
       break;
 
-    case 2: // manual
+    case 2:  // manual
       gpioMask = defaultMask();
 
       // keep outputs unchanged
       break;
   }
 }
-
diff --git a/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino b/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
index 7fdee1667a..61e79ebaf8 100644
--- a/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
+++ b/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
@@ -5,10 +5,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 ESP8266WebServer server(80);
@@ -89,17 +89,17 @@ void setup(void) {
   /////////////////////////////////////////////////////////
   // Hook examples
 
-  server.addHook([](const String & method, const String & url, WiFiClient * client, ESP8266WebServer::ContentTypeFunction contentType) {
-    (void)method;      // GET, PUT, ...
-    (void)url;         // example: /root/myfile.html
-    (void)client;      // the webserver tcp client connection
-    (void)contentType; // contentType(".html") => "text/html"
+  server.addHook([](const String& method, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction contentType) {
+    (void)method;       // GET, PUT, ...
+    (void)url;          // example: /root/myfile.html
+    (void)client;       // the webserver tcp client connection
+    (void)contentType;  // contentType(".html") => "text/html"
     Serial.printf("A useless web hook has passed\n");
     Serial.printf("(this hook is in 0x%08x area (401x=IRAM 402x=FLASH))\n", esp_get_program_counter());
     return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
   });
 
-  server.addHook([](const String&, const String & url, WiFiClient*, ESP8266WebServer::ContentTypeFunction) {
+  server.addHook([](const String&, const String& url, WiFiClient*, ESP8266WebServer::ContentTypeFunction) {
     if (url.startsWith("/fail")) {
       Serial.printf("An always failing web hook has been triggered\n");
       return ESP8266WebServer::CLIENT_MUST_STOP;
@@ -107,7 +107,7 @@ void setup(void) {
     return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
   });
 
-  server.addHook([](const String&, const String & url, WiFiClient * client, ESP8266WebServer::ContentTypeFunction) {
+  server.addHook([](const String&, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction) {
     if (url.startsWith("/dump")) {
       Serial.printf("The dumper web hook is on the run\n");
 
@@ -121,7 +121,7 @@ void setup(void) {
 #else
       auto last = millis();
       while ((millis() - last) < 500) {
-        char buf[32];
+        char   buf[32];
         size_t len = client->read((uint8_t*)buf, sizeof(buf));
         if (len > 0) {
           Serial.printf("(<%d> chars)", (int)len);
@@ -137,7 +137,7 @@ void setup(void) {
       // check the client connection: it should not immediately be closed
       // (make another '/dump' one to close the first)
       Serial.printf("\nTelling server to forget this connection\n");
-      static WiFiClient forgetme = *client; // stop previous one if present and transfer client refcounter
+      static WiFiClient forgetme = *client;  // stop previous one if present and transfer client refcounter
       return ESP8266WebServer::CLIENT_IS_GIVEN;
     }
     return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
diff --git a/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino b/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
index 857048cf0b..7b5b8cf831 100644
--- a/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
@@ -11,10 +11,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 ESP8266WebServer server(80);
@@ -39,13 +39,13 @@ void setup() {
 
   server.on("/", []() {
     if (!server.authenticate(www_username, www_password))
-      //Basic Auth Method with Custom realm and Failure Response
-      //return server.requestAuthentication(BASIC_AUTH, www_realm, authFailResponse);
-      //Digest Auth Method with realm="Login Required" and empty Failure Response
-      //return server.requestAuthentication(DIGEST_AUTH);
-      //Digest Auth Method with Custom realm and empty Failure Response
-      //return server.requestAuthentication(DIGEST_AUTH, www_realm);
-      //Digest Auth Method with Custom realm and Failure Response
+    //Basic Auth Method with Custom realm and Failure Response
+    //return server.requestAuthentication(BASIC_AUTH, www_realm, authFailResponse);
+    //Digest Auth Method with realm="Login Required" and empty Failure Response
+    //return server.requestAuthentication(DIGEST_AUTH);
+    //Digest Auth Method with Custom realm and empty Failure Response
+    //return server.requestAuthentication(DIGEST_AUTH, www_realm);
+    //Digest Auth Method with Custom realm and Failure Response
     {
       return server.requestAuthentication(DIGEST_AUTH, www_realm, authFailResponse);
     }
diff --git a/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino b/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
index c2ceaca53d..f71e4deb67 100644
--- a/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
@@ -18,14 +18,14 @@
 //Unfortunately it is not possible to have persistent WiFi credentials stored as anything but plain text. Obfuscation would be the only feasible barrier.
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid    = STASSID;
 const char* wifi_pw = STAPSK;
 
-const String file_credentials = R"(/credentials.txt)"; // LittleFS file name for the saved credentials
-const String change_creds =  "changecreds";            // Address for a credential change
+const String file_credentials = R"(/credentials.txt)";  // LittleFS file name for the saved credentials
+const String change_creds     = "changecreds";          // Address for a credential change
 
 //The ESP8266WebServerSecure requires an encryption certificate and matching key.
 //These can generated with the bash script available in the ESP8266 Arduino repository.
@@ -52,7 +52,7 @@ JfUvYadSYxh3nblvA4OL+iEZiW8NE3hbW6WPXxvS7Euge0uWMPc4uEcnsE0ZVG3m
 5tAF1D5vAAwA8nfPysumlLsIjohJZo4lgnhB++AlOg==
 -----END CERTIFICATE-----
 )EOF";
-static const char serverKey[] PROGMEM =  R"EOF(
+static const char serverKey[] PROGMEM  = R"EOF(
 -----BEGIN RSA PRIVATE KEY-----
 MIIEpQIBAAKCAQEA9UoHBtn4oNKXjRgIOQ/rLxK/iI0a8Q5mDxhfuwa9//FkftSI
 IFY8UhGk2YNJpnfKOyYWqbqwuJhIZJ2sEIWp2301OnavuGBrpKOgBJJljgH2l/4Z
@@ -85,19 +85,19 @@ gz5JWYhbD6c38khSzJb0pNXCo3EuYAVa36kDM96k1BtWuhRS10Q1VXk=
 ESP8266WebServerSecure server(443);
 
 //These are temporary credentials that will only be used if none are found saved in LittleFS.
-String login = "admin";
-const String realm = "global";
-String H1 = "";
-String authentication_failed = "User authentication has failed.";
+String       login                 = "admin";
+const String realm                 = "global";
+String       H1                    = "";
+String       authentication_failed = "User authentication has failed.";
 
 void setup() {
   Serial.begin(115200);
 
   //Initialize LittleFS to save credentials
-  if(!LittleFS.begin()){
-		Serial.println("LittleFS initialization error, programmer flash configured?");
+  if (!LittleFS.begin()) {
+    Serial.println("LittleFS initialization error, programmer flash configured?");
     ESP.restart();
-	}
+  }
 
   //Attempt to load credentials. If the file does not yet exist, they will be set to the default values above
   loadcredentials();
@@ -112,8 +112,8 @@ void setup() {
   }
 
   server.getServer().setRSACert(new BearSSL::X509List(serverCert), new BearSSL::PrivateKey(serverKey));
-  server.on("/",showcredentialpage); //for this simple example, just show a simple page for changing credentials at the root
-  server.on("/" + change_creds,handlecredentialchange); //handles submission of credentials from the client
+  server.on("/", showcredentialpage);                     //for this simple example, just show a simple page for changing credentials at the root
+  server.on("/" + change_creds, handlecredentialchange);  //handles submission of credentials from the client
   server.onNotFound(redirect);
   server.begin();
 
@@ -128,35 +128,35 @@ void loop() {
 }
 
 //This function redirects home
-void redirect(){
+void redirect() {
   String url = "https://" + WiFi.localIP().toString();
   Serial.println("Redirect called. Redirecting to " + url);
   server.sendHeader("Location", url, true);
   Serial.println("Header sent.");
-  server.send( 302, "text/plain", ""); // Empty content inhibits Content-length header so we have to close the socket ourselves.
+  server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to close the socket ourselves.
   Serial.println("Empty page sent.");
-  server.client().stop(); // Stop is needed because we sent no content length
+  server.client().stop();  // Stop is needed because we sent no content length
   Serial.println("Client stopped.");
 }
 
 //This function checks whether the current session has been authenticated. If not, a request for credentials is sent.
 bool session_authenticated() {
   Serial.println("Checking authentication.");
-  if (server.authenticateDigest(login,H1)) {
+  if (server.authenticateDigest(login, H1)) {
     Serial.println("Authentication confirmed.");
     return true;
-  } else  {
+  } else {
     Serial.println("Not authenticated. Requesting credentials.");
-    server.requestAuthentication(DIGEST_AUTH,realm.c_str(),authentication_failed);
+    server.requestAuthentication(DIGEST_AUTH, realm.c_str(), authentication_failed);
     redirect();
     return false;
   }
 }
 
 //This function sends a simple webpage for changing login credentials to the client
-void showcredentialpage(){
+void showcredentialpage() {
   Serial.println("Show credential page called.");
-  if(!session_authenticated()){
+  if (!session_authenticated()) {
     return;
   }
 
@@ -165,11 +165,12 @@ void showcredentialpage(){
   String page;
   page = R"(<html>)";
 
-  page+=
-  R"(
+  page +=
+      R"(
   <h2>Login Credentials</h2><br>
 
-  <form action=")" + change_creds + R"(" method="post">
+  <form action=")"
+      + change_creds + R"(" method="post">
   Login:<br>
   <input type="text" name="login"><br>
   Password:<br>
@@ -178,8 +179,7 @@ void showcredentialpage(){
   <input type="password" name="password_duplicate"><br>
   <p><button type="submit" name="newcredentials">Change Credentials</button></p>
   </form><br>
-  )"
-  ;
+  )";
 
   page += R"(</html>)";
 
@@ -189,16 +189,15 @@ void showcredentialpage(){
 }
 
 //Saves credentials to LittleFS
-void savecredentials(String new_login, String new_password)
-{
+void savecredentials(String new_login, String new_password) {
   //Set global variables to new values
-  login=new_login;
-  H1=ESP8266WebServer::credentialHash(new_login,realm,new_password);
+  login = new_login;
+  H1    = ESP8266WebServer::credentialHash(new_login, realm, new_password);
 
   //Save new values to LittleFS for loading on next reboot
   Serial.println("Saving credentials.");
-  File f=LittleFS.open(file_credentials,"w"); //open as a brand new file, discard old contents
-  if(f){
+  File f = LittleFS.open(file_credentials, "w");  //open as a brand new file, discard old contents
+  if (f) {
     Serial.println("Modifying credentials in file system.");
     f.println(login);
     f.println(H1);
@@ -210,46 +209,44 @@ void savecredentials(String new_login, String new_password)
 }
 
 //loads credentials from LittleFS
-void loadcredentials()
-{
+void loadcredentials() {
   Serial.println("Searching for credentials.");
   File f;
-  f=LittleFS.open(file_credentials,"r");
-  if(f){
+  f = LittleFS.open(file_credentials, "r");
+  if (f) {
     Serial.println("Loading credentials from file system.");
-    String mod=f.readString(); //read the file to a String
-    int index_1=mod.indexOf('\n',0); //locate the first line break
-    int index_2=mod.indexOf('\n',index_1+1); //locate the second line break
-    login=mod.substring(0,index_1-1); //get the first line (excluding the line break)
-    H1=mod.substring(index_1+1,index_2-1); //get the second line (excluding the line break)
+    String mod     = f.readString();                           //read the file to a String
+    int    index_1 = mod.indexOf('\n', 0);                     //locate the first line break
+    int    index_2 = mod.indexOf('\n', index_1 + 1);           //locate the second line break
+    login          = mod.substring(0, index_1 - 1);            //get the first line (excluding the line break)
+    H1             = mod.substring(index_1 + 1, index_2 - 1);  //get the second line (excluding the line break)
     f.close();
   } else {
-    String default_login = "admin";
+    String default_login    = "admin";
     String default_password = "changeme";
     Serial.println("None found. Setting to default credentials.");
     Serial.println("user:" + default_login);
     Serial.println("password:" + default_password);
-    login=default_login;
-    H1=ESP8266WebServer::credentialHash(default_login,realm,default_password);
+    login = default_login;
+    H1    = ESP8266WebServer::credentialHash(default_login, realm, default_password);
   }
 }
 
 //This function handles a credential change from a client.
 void handlecredentialchange() {
   Serial.println("Handle credential change called.");
-  if(!session_authenticated()){
+  if (!session_authenticated()) {
     return;
   }
 
   Serial.println("Handling credential change request from client.");
 
   String login = server.arg("login");
-  String pw1 = server.arg("password");
-  String pw2 = server.arg("password_duplicate");
-
-  if(login != "" && pw1 != "" && pw1 == pw2){
+  String pw1   = server.arg("password");
+  String pw2   = server.arg("password_duplicate");
 
-    savecredentials(login,pw1);
+  if (login != "" && pw1 != "" && pw1 == pw2) {
+    savecredentials(login, pw1);
     server.send(200, "text/plain", "Credentials updated");
     redirect();
   } else {
diff --git a/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino b/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
index dc998986e5..4ac9b35e52 100644
--- a/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
+++ b/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
@@ -8,11 +8,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *password = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
 ESP8266WebServer server(80);
 
@@ -47,7 +47,7 @@ void setup(void) {
   });
 
   server.on(UriRegex("^\\/users\\/([0-9]+)\\/devices\\/([0-9]+)$"), []() {
-    String user = server.pathArg(0);
+    String user   = server.pathArg(0);
     String device = server.pathArg(1);
     server.send(200, "text/plain", "User: '" + user + "' and Device: '" + device + "'");
   });
diff --git a/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino b/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
index da1703807a..d61675d23f 100644
--- a/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
+++ b/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
@@ -5,7 +5,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid     = STASSID;
diff --git a/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino b/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
index 77ae1e958e..b94789ba7b 100644
--- a/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
+++ b/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
@@ -42,27 +42,27 @@ extern "C" {
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
-const char* password = STAPSK;
-const unsigned int port = 80;
+const char*        ssid     = STASSID;
+const char*        password = STAPSK;
+const unsigned int port     = 80;
 
 ESP8266WebServer server(port);
 
 #define SSE_MAX_CHANNELS 8  // in this simplified example, only eight SSE clients subscription allowed
 struct SSESubscription {
-  IPAddress clientIP;
+  IPAddress  clientIP;
   WiFiClient client;
-  Ticker keepAliveTimer;
+  Ticker     keepAliveTimer;
 } subscription[SSE_MAX_CHANNELS];
 uint8_t subscriptionCount = 0;
 
 typedef struct {
-  const char *name;
+  const char*    name;
   unsigned short value;
-  Ticker update;
+  Ticker         update;
 } sensorType;
 sensorType sensor[2];
 
@@ -89,7 +89,7 @@ void SSEKeepAlive() {
     }
     if (subscription[i].client.connected()) {
       Serial.printf_P(PSTR("SSEKeepAlive - client is still listening on channel %d\n"), i);
-      subscription[i].client.println(F("event: event\ndata: { \"TYPE\":\"KEEP-ALIVE\" }\n"));   // Extra newline required by SSE standard
+      subscription[i].client.println(F("event: event\ndata: { \"TYPE\":\"KEEP-ALIVE\" }\n"));  // Extra newline required by SSE standard
     } else {
       Serial.printf_P(PSTR("SSEKeepAlive - client not listening on channel %d, remove subscription\n"), i);
       subscription[i].keepAliveTimer.detach();
@@ -104,28 +104,28 @@ void SSEKeepAlive() {
 // SSEHandler handles the client connection to the event bus (client event listener)
 // every 60 seconds it sends a keep alive event via Ticker
 void SSEHandler(uint8_t channel) {
-  WiFiClient client = server.client();
-  SSESubscription &s = subscription[channel];
-  if (s.clientIP != client.remoteIP()) { // IP addresses don't match, reject this client
+  WiFiClient       client = server.client();
+  SSESubscription& s      = subscription[channel];
+  if (s.clientIP != client.remoteIP()) {  // IP addresses don't match, reject this client
     Serial.printf_P(PSTR("SSEHandler - unregistered client with IP %s tries to listen\n"), server.client().remoteIP().toString().c_str());
     return handleNotFound();
   }
   client.setNoDelay(true);
   client.setSync(true);
   Serial.printf_P(PSTR("SSEHandler - registered client with IP %s is listening\n"), IPAddress(s.clientIP).toString().c_str());
-  s.client = client; // capture SSE server client connection
-  server.setContentLength(CONTENT_LENGTH_UNKNOWN); // the payload can go on forever
+  s.client = client;                                // capture SSE server client connection
+  server.setContentLength(CONTENT_LENGTH_UNKNOWN);  // the payload can go on forever
   server.sendContent_P(PSTR("HTTP/1.1 200 OK\nContent-Type: text/event-stream;\nConnection: keep-alive\nCache-Control: no-cache\nAccess-Control-Allow-Origin: *\n\n"));
   s.keepAliveTimer.attach_scheduled(30.0, SSEKeepAlive);  // Refresh time every 30s for demo
 }
 
 void handleAll() {
-  const char *uri = server.uri().c_str();
-  const char *restEvents = PSTR("/rest/events/");
+  const char* uri        = server.uri().c_str();
+  const char* restEvents = PSTR("/rest/events/");
   if (strncmp_P(uri, restEvents, strlen_P(restEvents))) {
     return handleNotFound();
   }
-  uri += strlen_P(restEvents); // Skip the "/rest/events/" and get to the channel number
+  uri += strlen_P(restEvents);  // Skip the "/rest/events/" and get to the channel number
   unsigned int channel = atoi(uri);
   if (channel < SSE_MAX_CHANNELS) {
     return SSEHandler(channel);
@@ -133,7 +133,7 @@ void handleAll() {
   handleNotFound();
 };
 
-void SSEBroadcastState(const char *sensorName, unsigned short prevSensorValue, unsigned short sensorValue) {
+void SSEBroadcastState(const char* sensorName, unsigned short prevSensorValue, unsigned short sensorValue) {
   for (uint8_t i = 0; i < SSE_MAX_CHANNELS; i++) {
     if (!(subscription[i].clientIP)) {
       continue;
@@ -151,8 +151,8 @@ void SSEBroadcastState(const char *sensorName, unsigned short prevSensorValue, u
 }
 
 // Simulate sensors
-void updateSensor(sensorType &sensor) {
-  unsigned short newVal = (unsigned short)RANDOM_REG32; // (not so good) random value for the sensor
+void updateSensor(sensorType& sensor) {
+  unsigned short newVal = (unsigned short)RANDOM_REG32;  // (not so good) random value for the sensor
   Serial.printf_P(PSTR("update sensor %s - previous state: %d, new state: %d\n"), sensor.name, sensor.value, newVal);
   if (sensor.value != newVal) {
     SSEBroadcastState(sensor.name, sensor.value, newVal);  // only broadcast if state is different
@@ -166,9 +166,9 @@ void handleSubscribe() {
     return handleNotFound();  // We ran out of channels
   }
 
-  uint8_t channel;
-  IPAddress clientIP = server.client().remoteIP();   // get IP address of client
-  String SSEurl = F("http://");
+  uint8_t   channel;
+  IPAddress clientIP = server.client().remoteIP();  // get IP address of client
+  String    SSEurl   = F("http://");
   SSEurl += WiFi.localIP().toString();
   SSEurl += F(":");
   SSEurl += port;
@@ -176,11 +176,11 @@ void handleSubscribe() {
   SSEurl += F("/rest/events/");
 
   ++subscriptionCount;
-  for (channel = 0; channel < SSE_MAX_CHANNELS; channel++) // Find first free slot
+  for (channel = 0; channel < SSE_MAX_CHANNELS; channel++)  // Find first free slot
     if (!subscription[channel].clientIP) {
       break;
     }
-  subscription[channel] = {clientIP, server.client(), Ticker()};
+  subscription[channel] = { clientIP, server.client(), Ticker() };
   SSEurl += channel;
   Serial.printf_P(PSTR("Allocated channel %d, on uri %s\n"), channel, SSEurl.substring(offset).c_str());
   //server.on(SSEurl.substring(offset), std::bind(SSEHandler, &(subscription[channel])));
@@ -200,7 +200,7 @@ void setup(void) {
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, password);
   Serial.println("");
-  while (WiFi.status() != WL_CONNECTED) {   // Wait for connection
+  while (WiFi.status() != WL_CONNECTED) {  // Wait for connection
     delay(500);
     Serial.print(".");
   }
@@ -209,7 +209,7 @@ void setup(void) {
     Serial.println("MDNS responder started");
   }
 
-  startServers();   // start web and SSE servers
+  startServers();  // start web and SSE servers
   sensor[0].name = "sensorA";
   sensor[1].name = "sensorB";
   updateSensor(sensor[0]);
diff --git a/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino b/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
index 2cba08fe9c..731b8105ce 100644
--- a/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
+++ b/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
@@ -4,10 +4,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 ESP8266WebServer server(80);
@@ -45,7 +45,7 @@ void handleLogin() {
     return;
   }
   if (server.hasArg("USERNAME") && server.hasArg("PASSWORD")) {
-    if (server.arg("USERNAME") == "admin" &&  server.arg("PASSWORD") == "admin") {
+    if (server.arg("USERNAME") == "admin" && server.arg("PASSWORD") == "admin") {
       server.sendHeader("Location", "/");
       server.sendHeader("Cache-Control", "no-cache");
       server.sendHeader("Set-Cookie", "ESPSESSIONID=1");
@@ -115,7 +115,6 @@ void setup(void) {
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());
 
-
   server.on("/", handleRoot);
   server.on("/login", handleLogin);
   server.on("/inline", []() {
diff --git a/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino b/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
index 08107586fd..889c646877 100644
--- a/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
+++ b/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
@@ -9,10 +9,10 @@
 #include <Arduino.h>
 #include <ESP8266WebServer.h>
 
-#include "secrets.h" // add WLAN Credentials in here.
+#include "secrets.h"  // add WLAN Credentials in here.
 
-#include <FS.h>       // File System for Web Server Files
-#include <LittleFS.h> // This file system is used.
+#include <FS.h>        // File System for Web Server Files
+#include <LittleFS.h>  // This file system is used.
 
 // mark parameters not used in example
 #define UNUSED __attribute__((unused))
@@ -32,7 +32,6 @@ ESP8266WebServer server(80);
 // The text of builtin files are in this header file
 #include "builtinfiles.h"
 
-
 // ===== Simple functions used to answer simple GET requests =====
 
 // This function is called when the WebServer was requested without giving a filename.
@@ -47,13 +46,12 @@ void handleRedirect() {
 
   server.sendHeader("Location", url, true);
   server.send(302);
-} // handleRedirect()
-
+}  // handleRedirect()
 
 // This function is called when the WebServer was requested to list all existing files in the filesystem.
 // a JSON array with file information is returned.
 void handleListFiles() {
-  Dir dir = LittleFS.openDir("/");
+  Dir    dir = LittleFS.openDir("/");
   String result;
 
   result += "[\n";
@@ -67,12 +65,11 @@ void handleListFiles() {
     result += " \"time\": " + String(dir.fileTime());
     result += " }\n";
     // jc.addProperty("size", dir.fileSize());
-  } // while
+  }  // while
   result += "]";
   server.sendHeader("Cache-Control", "no-cache");
   server.send(200, "text/javascript; charset=utf-8", result);
-} // handleListFiles()
-
+}  // handleListFiles()
 
 // This function is called when the sysInfo service was requested.
 void handleSysInfo() {
@@ -90,96 +87,90 @@ void handleSysInfo() {
 
   server.sendHeader("Cache-Control", "no-cache");
   server.send(200, "text/javascript; charset=utf-8", result);
-} // handleSysInfo()
-
+}  // handleSysInfo()
 
 // ===== Request Handler class used to answer more complex requests =====
 
 // The FileServerHandler is registered to the web server to support DELETE and UPLOAD of files into the filesystem.
-class FileServerHandler : public RequestHandler {
+class FileServerHandler: public RequestHandler {
   public:
-    // @brief Construct a new File Server Handler object
-    // @param fs The file system to be used.
-    // @param path Path to the root folder in the file system that is used for serving static data down and upload.
-    // @param cache_header Cache Header to be used in replies.
-    FileServerHandler() {
-      TRACE("FileServerHandler is registered\n");
-    }
-
-
-    // @brief check incoming request. Can handle POST for uploads and DELETE.
-    // @param requestMethod method of the http request line.
-    // @param requestUri request ressource from the http request line.
-    // @return true when method can be handled.
-    bool canHandle(HTTPMethod requestMethod, const String UNUSED &_uri) override {
-      return ((requestMethod == HTTP_POST) || (requestMethod == HTTP_DELETE));
-    } // canHandle()
-
+  // @brief Construct a new File Server Handler object
+  // @param fs The file system to be used.
+  // @param path Path to the root folder in the file system that is used for serving static data down and upload.
+  // @param cache_header Cache Header to be used in replies.
+  FileServerHandler() {
+    TRACE("FileServerHandler is registered\n");
+  }
 
-    bool canUpload(const String &uri) override {
-      // only allow upload on root fs level.
-      return (uri == "/");
-    } // canUpload()
+  // @brief check incoming request. Can handle POST for uploads and DELETE.
+  // @param requestMethod method of the http request line.
+  // @param requestUri request ressource from the http request line.
+  // @return true when method can be handled.
+  bool canHandle(HTTPMethod requestMethod, const String UNUSED& _uri) override {
+    return ((requestMethod == HTTP_POST) || (requestMethod == HTTP_DELETE));
+  }  // canHandle()
+
+  bool canUpload(const String& uri) override {
+    // only allow upload on root fs level.
+    return (uri == "/");
+  }  // canUpload()
+
+  bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, const String& requestUri) override {
+    // ensure that filename starts with '/'
+    String fName = requestUri;
+    if (!fName.startsWith("/")) {
+      fName = "/" + fName;
+    }
 
+    if (requestMethod == HTTP_POST) {
+      // all done in upload. no other forms.
 
-    bool handle(ESP8266WebServer &server, HTTPMethod requestMethod, const String &requestUri) override {
-      // ensure that filename starts with '/'
-      String fName = requestUri;
-      if (!fName.startsWith("/")) {
-        fName = "/" + fName;
+    } else if (requestMethod == HTTP_DELETE) {
+      if (LittleFS.exists(fName)) {
+        LittleFS.remove(fName);
       }
+    }  // if
+
+    server.send(200);  // all done.
+    return (true);
+  }  // handle()
+
+  // uploading process
+  void upload(ESP8266WebServer UNUSED& server, const String UNUSED& _requestUri, HTTPUpload& upload) override {
+    // ensure that filename starts with '/'
+    String fName = upload.filename;
+    if (!fName.startsWith("/")) {
+      fName = "/" + fName;
+    }
 
-      if (requestMethod == HTTP_POST) {
-        // all done in upload. no other forms.
-
-      } else if (requestMethod == HTTP_DELETE) {
-        if (LittleFS.exists(fName)) {
-          LittleFS.remove(fName);
-        }
-      } // if
-
-      server.send(200); // all done.
-      return (true);
-    } // handle()
-
-
-    // uploading process
-    void upload(ESP8266WebServer UNUSED &server, const String UNUSED &_requestUri, HTTPUpload &upload) override {
-      // ensure that filename starts with '/'
-      String fName = upload.filename;
-      if (!fName.startsWith("/")) {
-        fName = "/" + fName;
+    if (upload.status == UPLOAD_FILE_START) {
+      // Open the file
+      if (LittleFS.exists(fName)) {
+        LittleFS.remove(fName);
+      }  // if
+      _fsUploadFile = LittleFS.open(fName, "w");
+
+    } else if (upload.status == UPLOAD_FILE_WRITE) {
+      // Write received bytes
+      if (_fsUploadFile) {
+        _fsUploadFile.write(upload.buf, upload.currentSize);
       }
 
-      if (upload.status == UPLOAD_FILE_START) {
-        // Open the file
-        if (LittleFS.exists(fName)) {
-          LittleFS.remove(fName);
-        } // if
-        _fsUploadFile = LittleFS.open(fName, "w");
-
-      } else if (upload.status == UPLOAD_FILE_WRITE) {
-        // Write received bytes
-        if (_fsUploadFile) {
-          _fsUploadFile.write(upload.buf, upload.currentSize);
-        }
-
-      } else if (upload.status == UPLOAD_FILE_END) {
-        // Close the file
-        if (_fsUploadFile) {
-          _fsUploadFile.close();
-        }
-      } // if
-    }   // upload()
+    } else if (upload.status == UPLOAD_FILE_END) {
+      // Close the file
+      if (_fsUploadFile) {
+        _fsUploadFile.close();
+      }
+    }  // if
+  }    // upload()
 
   protected:
-    File _fsUploadFile;
+  File _fsUploadFile;
 };
 
-
 // Setup everything to make the webserver work.
 void setup(void) {
-  delay(3000); // wait for serial monitor to start completely.
+  delay(3000);  // wait for serial monitor to start completely.
 
   // Use Serial port for some trace information from the example
   Serial.begin(115200);
@@ -250,12 +241,11 @@ void setup(void) {
 
   server.begin();
   TRACE("hostname=%s\n", WiFi.getHostname());
-} // setup
-
+}  // setup
 
 // run the server...
 void loop(void) {
   server.handleClient();
-} // loop()
+}  // loop()
 
 // end.
diff --git a/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino b/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
index 17646fd172..06a40aa5d4 100644
--- a/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
+++ b/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
@@ -9,15 +9,15 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* host = "esp8266-webupdate";
-const char* ssid = STASSID;
+const char* host     = "esp8266-webupdate";
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 ESP8266WebServer server(80);
-const char* serverIndex = "<form method='POST' action='/update' enctype='multipart/form-data'><input type='file' name='update'><input type='submit' value='Update'></form>";
+const char*      serverIndex = "<form method='POST' action='/update' enctype='multipart/form-data'><input type='file' name='update'><input type='submit' value='Update'></form>";
 
 void setup(void) {
   Serial.begin(115200);
@@ -31,11 +31,11 @@ void setup(void) {
       server.sendHeader("Connection", "close");
       server.send(200, "text/html", serverIndex);
     });
-    server.on("/update", HTTP_POST, []() {
+    server.on(
+        "/update", HTTP_POST, []() {
       server.sendHeader("Connection", "close");
       server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
-      ESP.restart();
-    }, []() {
+      ESP.restart(); }, []() {
       HTTPUpload& upload = server.upload();
       if (upload.status == UPLOAD_FILE_START) {
         Serial.setDebugOutput(true);
@@ -57,8 +57,7 @@ void setup(void) {
         }
         Serial.setDebugOutput(false);
       }
-      yield();
-    });
+      yield(); });
     server.begin();
     MDNS.addService("http", "tcp", 80);
 
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
index a599a0395a..6d9b8b3161 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
@@ -41,11 +41,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
 // A single, global CertStore which can be used by all
 // connections.  Needs to stay live the entire time any of
@@ -71,7 +71,7 @@ void setClock() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump URL
-void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_t port, const char *path) {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
   if (!path) {
     path = "/";
   }
@@ -100,7 +100,7 @@ void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_
         break;
       }
       // Only print out first line up to \r, then abort connection
-      char *nl = strchr(tmp, '\r');
+      char* nl = strchr(tmp, '\r');
       if (nl) {
         *nl = 0;
         Serial.print(tmp);
@@ -136,16 +136,16 @@ void setup() {
   Serial.println("IP address: ");
   Serial.println(WiFi.localIP());
 
-  setClock(); // Required for X.509 validation
+  setClock();  // Required for X.509 validation
 
   int numCerts = certStore.initCertStore(LittleFS, PSTR("/certs.idx"), PSTR("/certs.ar"));
   Serial.printf("Number of CA certs read: %d\n", numCerts);
   if (numCerts == 0) {
     Serial.printf("No certs found. Did you run certs-from-mozilla.py and upload the LittleFS directory before running?\n");
-    return; // Can't connect to anything w/o certs!
+    return;  // Can't connect to anything w/o certs!
   }
 
-  BearSSL::WiFiClientSecure *bear = new BearSSL::WiFiClientSecure();
+  BearSSL::WiFiClientSecure* bear = new BearSSL::WiFiClientSecure();
   // Integrate the cert store with this connection
   bear->setCertStore(&certStore);
   Serial.printf("Attempting to fetch https://github.com/...\n");
@@ -164,10 +164,9 @@ void loop() {
   site.replace(String("\n"), emptyString);
   Serial.printf("https://%s/\n", site.c_str());
 
-  BearSSL::WiFiClientSecure *bear = new BearSSL::WiFiClientSecure();
+  BearSSL::WiFiClientSecure* bear = new BearSSL::WiFiClientSecure();
   // Integrate the cert store with this connection
   bear->setCertStore(&certStore);
   fetchURL(bear, site.c_str(), 443, "/");
   delete bear;
 }
-
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
index 40330725a1..101a598a01 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
@@ -39,11 +39,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
 // The HTTPS server
 BearSSL::WiFiServerSecure server(443);
@@ -138,11 +138,11 @@ GBEnkz4KpKv7TkHoW+j7F5EMcLcSrUIpyw==
 
 #endif
 
-#define CACHE_SIZE 5 // Number of sessions to cache.
+#define CACHE_SIZE 5  // Number of sessions to cache.
 // Caching SSL sessions shortens the length of the SSL handshake.
 // You can see the performance improvement by looking at the
 // Network tab of the developer tools of your browser.
-#define USE_CACHE // Enable SSL session caching.
+#define USE_CACHE  // Enable SSL session caching.
 //#define DYNAMIC_CACHE // Whether to dynamically allocate the cache.
 
 #if defined(USE_CACHE) && defined(DYNAMIC_CACHE)
@@ -150,7 +150,7 @@ GBEnkz4KpKv7TkHoW+j7F5EMcLcSrUIpyw==
 BearSSL::ServerSessions serverCache(CACHE_SIZE);
 #elif defined(USE_CACHE)
 // Statically allocated cache.
-ServerSession store[CACHE_SIZE];
+ServerSession           store[CACHE_SIZE];
 BearSSL::ServerSessions serverCache(store, CACHE_SIZE);
 #endif
 
@@ -176,12 +176,12 @@ void setup() {
   Serial.println(WiFi.localIP());
 
   // Attach the server private cert/key combo
-  BearSSL::X509List *serverCertList = new BearSSL::X509List(server_cert);
-  BearSSL::PrivateKey *serverPrivKey = new BearSSL::PrivateKey(server_private_key);
+  BearSSL::X509List*   serverCertList = new BearSSL::X509List(server_cert);
+  BearSSL::PrivateKey* serverPrivKey  = new BearSSL::PrivateKey(server_private_key);
 #ifndef USE_EC
   server.setRSACert(serverCertList, serverPrivKey);
 #else
-  server.setECCert(serverCertList, BR_KEYTYPE_KEYX|BR_KEYTYPE_SIGN, serverPrivKey);
+  server.setECCert(serverCertList, BR_KEYTYPE_KEYX | BR_KEYTYPE_SIGN, serverPrivKey);
 #endif
 
   // Set the server's cache
@@ -193,31 +193,30 @@ void setup() {
   server.begin();
 }
 
-static const char *HTTP_RES =
-        "HTTP/1.0 200 OK\r\n"
-        "Connection: close\r\n"
-        "Content-Length: 62\r\n"
-        "Content-Type: text/html; charset=iso-8859-1\r\n"
-        "\r\n"
-        "<html>\r\n"
-        "<body>\r\n"
-        "<p>Hello from ESP8266!</p>\r\n"
-        "</body>\r\n"
-        "</html>\r\n";
+static const char* HTTP_RES = "HTTP/1.0 200 OK\r\n"
+                              "Connection: close\r\n"
+                              "Content-Length: 62\r\n"
+                              "Content-Type: text/html; charset=iso-8859-1\r\n"
+                              "\r\n"
+                              "<html>\r\n"
+                              "<body>\r\n"
+                              "<p>Hello from ESP8266!</p>\r\n"
+                              "</body>\r\n"
+                              "</html>\r\n";
 
 void loop() {
-  static int cnt;
+  static int                cnt;
   BearSSL::WiFiClientSecure incoming = server.accept();
   if (!incoming) {
     return;
   }
-  Serial.printf("Incoming connection...%d\n",cnt++);
-  
+  Serial.printf("Incoming connection...%d\n", cnt++);
+
   // Ugly way to wait for \r\n (i.e. end of HTTP request which we don't actually parse here)
-  uint32_t timeout=millis() + 1000;
-  int lcwn = 0;
+  uint32_t timeout = millis() + 1000;
+  int      lcwn    = 0;
   for (;;) {
-    unsigned char x=0;
+    unsigned char x = 0;
     if ((millis() > timeout) || (incoming.available() && incoming.read(&x, 1) < 0)) {
       incoming.stop();
       Serial.printf("Connection error, closed\n");
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino b/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
index 3e88019cf4..c6005f162e 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
@@ -67,11 +67,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
 // The server which will require a client cert signed by the trusted CA
 BearSSL::WiFiServerSecure server(443);
@@ -160,8 +160,7 @@ seoK24dHmt6tWmn/sbxX7Aa6TL/4mVlFoOgcaTJyVaY/BrY=
 // head of the app.
 
 // Set time via NTP, as required for x.509 validation
-void setClock()
-{
+void setClock() {
   configTime(3 * 3600, 0, "pool.ntp.org", "time.nist.gov");
 
   Serial.print("Waiting for NTP time sync: ");
@@ -199,32 +198,31 @@ void setup() {
   Serial.println("IP address: ");
   Serial.println(WiFi.localIP());
 
-  setClock(); // Required for X.509 validation
+  setClock();  // Required for X.509 validation
 
   // Attach the server private cert/key combo
-  BearSSL::X509List *serverCertList = new BearSSL::X509List(server_cert);
-  BearSSL::PrivateKey *serverPrivKey = new BearSSL::PrivateKey(server_private_key);
+  BearSSL::X509List*   serverCertList = new BearSSL::X509List(server_cert);
+  BearSSL::PrivateKey* serverPrivKey  = new BearSSL::PrivateKey(server_private_key);
   server.setRSACert(serverCertList, serverPrivKey);
 
   // Require a certificate validated by the trusted CA
-  BearSSL::X509List *serverTrustedCA = new BearSSL::X509List(ca_cert);
+  BearSSL::X509List* serverTrustedCA = new BearSSL::X509List(ca_cert);
   server.setClientTrustAnchor(serverTrustedCA);
 
   // Actually start accepting connections
   server.begin();
 }
 
-static const char *HTTP_RES =
-        "HTTP/1.0 200 OK\r\n"
-        "Connection: close\r\n"
-        "Content-Length: 59\r\n"
-        "Content-Type: text/html; charset=iso-8859-1\r\n"
-        "\r\n"
-        "<html>\r\n"
-        "<body>\r\n"
-        "<p>Hello my friend!</p>\r\n"
-        "</body>\r\n"
-        "</html>\r\n";
+static const char* HTTP_RES = "HTTP/1.0 200 OK\r\n"
+                              "Connection: close\r\n"
+                              "Content-Length: 59\r\n"
+                              "Content-Type: text/html; charset=iso-8859-1\r\n"
+                              "\r\n"
+                              "<html>\r\n"
+                              "<body>\r\n"
+                              "<p>Hello my friend!</p>\r\n"
+                              "</body>\r\n"
+                              "</html>\r\n";
 
 void loop() {
   BearSSL::WiFiClientSecure incoming = server.accept();
@@ -232,12 +230,12 @@ void loop() {
     return;
   }
   Serial.println("Incoming connection...\n");
-  
+
   // Ugly way to wait for \r\n (i.e. end of HTTP request which we don't actually parse here)
-  uint32_t timeout=millis() + 1000;
-  int lcwn = 0;
+  uint32_t timeout = millis() + 1000;
+  int      lcwn    = 0;
   for (;;) {
-    unsigned char x=0;
+    unsigned char x = 0;
     if ((millis() > timeout) || (incoming.available() && incoming.read(&x, 1) < 0)) {
       incoming.stop();
       Serial.printf("Connection error, closed\n");
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino b/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
index fa03c7fa38..7e64df10a2 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
@@ -9,13 +9,13 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
-const char *   path = "/";
+const char* path = "/";
 
 void setup() {
   Serial.begin(115200);
@@ -52,7 +52,7 @@ void setup() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump HTTP response
-void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_t port, const char *path) {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
   if (!path) {
     path = "/";
   }
@@ -81,7 +81,7 @@ void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_
         break;
       }
       // Only print out first line up to \r, then abort connection
-      char *nl = strchr(tmp, '\r');
+      char* nl = strchr(tmp, '\r');
       if (nl) {
         *nl = 0;
         Serial.print(tmp);
@@ -94,11 +94,10 @@ void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_
   Serial.printf("\n-------\n\n");
 }
 
-
 void loop() {
-  uint32_t start, finish;
+  uint32_t                  start, finish;
   BearSSL::WiFiClientSecure client;
-  BearSSL::X509List cert(cert_DigiCert_High_Assurance_EV_Root_CA);
+  BearSSL::X509List         cert(cert_DigiCert_High_Assurance_EV_Root_CA);
 
   Serial.printf("Connecting without sessions...");
   start = millis();
@@ -130,6 +129,5 @@ void loop() {
   finish = millis();
   Serial.printf("Total time: %dms\n", finish - start);
 
-  delay(10000); // Avoid DDOSing github
+  delay(10000);  // Avoid DDOSing github
 }
-
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino b/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
index b91570da11..757cedd6d8 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
@@ -12,13 +12,13 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
-const char *   path = "/";
+const char* path = "/";
 
 // Set time via NTP, as required for x.509 validation
 void setClock() {
@@ -39,7 +39,7 @@ void setClock() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump HTTP response
-void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_t port, const char *path) {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
   if (!path) {
     path = "/";
   }
@@ -70,7 +70,7 @@ void fetchURL(BearSSL::WiFiClientSecure *client, const char *host, const uint16_
         break;
       }
       // Only print out first line up to \r, then abort connection
-      char *nl = strchr(tmp, '\r');
+      char* nl = strchr(tmp, '\r');
       if (nl) {
         *nl = 0;
         Serial.print(tmp);
@@ -141,7 +141,7 @@ private and not shared.  A MITM without the private key would not be
 able to establish communications.
 )EOF");
   BearSSL::WiFiClientSecure client;
-  BearSSL::PublicKey key(pubkey_gitlab_com);
+  BearSSL::PublicKey        key(pubkey_gitlab_com);
   client.setKnownKey(&key);
   fetchURL(&client, gitlab_host, gitlab_port, path);
 }
@@ -157,7 +157,7 @@ BearSSL does verify the notValidBefore/After fields.
 )EOF");
 
   BearSSL::WiFiClientSecure client;
-  BearSSL::X509List cert(cert_USERTrust_RSA_Certification_Authority);
+  BearSSL::X509List         cert(cert_USERTrust_RSA_Certification_Authority);
   client.setTrustAnchors(&cert);
   Serial.printf("Try validating without setting the time (should fail)\n");
   fetchURL(&client, gitlab_host, gitlab_port, path);
@@ -183,7 +183,7 @@ may make sense
   client.setCiphersLessSecure();
   now = millis();
   fetchURL(&client, gitlab_host, gitlab_port, path);
-  uint32_t delta2 = millis() - now;
+  uint32_t              delta2       = millis() - now;
   std::vector<uint16_t> myCustomList = { BR_TLS_RSA_WITH_AES_256_CBC_SHA256, BR_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, BR_TLS_RSA_WITH_3DES_EDE_CBC_SHA };
   client.setInsecure();
   client.setCiphers(myCustomList);
@@ -223,7 +223,6 @@ void setup() {
   fetchFaster();
 }
 
-
 void loop() {
   // Nothing to do here
 }
diff --git a/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino b/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
index 9ccf3b6b37..9eb3c3150e 100644
--- a/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
+++ b/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
@@ -17,10 +17,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 X509List cert(cert_DigiCert_High_Assurance_EV_Root_CA);
@@ -74,10 +74,7 @@ void setup() {
   Serial.print("Requesting URL: ");
   Serial.println(url);
 
-  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
-               "Host: " + github_host + "\r\n" +
-               "User-Agent: BuildFailureDetectorESP8266\r\n" +
-               "Connection: close\r\n\r\n");
+  client.print(String("GET ") + url + " HTTP/1.1\r\n" + "Host: " + github_host + "\r\n" + "User-Agent: BuildFailureDetectorESP8266\r\n" + "Connection: close\r\n\r\n");
 
   Serial.println("Request sent");
   while (client.connected()) {
diff --git a/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino b/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
index 560d9bfe46..e3f15fcd82 100644
--- a/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
+++ b/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
@@ -23,18 +23,18 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-#define FQDN  F("www.google.com")  // with both IPv4 & IPv6 addresses
-#define FQDN2 F("www.yahoo.com")   // with both IPv4 & IPv6 addresses
-#define FQDN6 F("ipv6.google.com") // does not resolve in IPv4
+#define FQDN F("www.google.com")    // with both IPv4 & IPv6 addresses
+#define FQDN2 F("www.yahoo.com")    // with both IPv4 & IPv6 addresses
+#define FQDN6 F("ipv6.google.com")  // does not resolve in IPv4
 #define STATUSDELAY_MS 10000
 #define TCP_PORT 23
 #define UDP_PORT 23
 
-WiFiServer statusServer(TCP_PORT);
-WiFiUDP udp;
+WiFiServer                         statusServer(TCP_PORT);
+WiFiUDP                            udp;
 esp8266::polledTimeout::periodicMs showStatusOnSerialNow(STATUSDELAY_MS);
 
 void fqdn(Print& out, const String& fqdn) {
@@ -93,7 +93,6 @@ void status(Print& out) {
     }
 
     out.println();
-
   }
 
   // lwIP's dns client will ask for IPv4 first (by default)
@@ -101,8 +100,8 @@ void status(Print& out) {
   fqdn(out, FQDN);
   fqdn(out, FQDN6);
 #if LWIP_IPV4 && LWIP_IPV6
-  fqdn_rt(out, FQDN,  DNSResolveType::DNS_AddrType_IPv4_IPv6); // IPv4 before IPv6
-  fqdn_rt(out, FQDN2, DNSResolveType::DNS_AddrType_IPv6_IPv4); // IPv6 before IPv4
+  fqdn_rt(out, FQDN, DNSResolveType::DNS_AddrType_IPv4_IPv6);   // IPv4 before IPv6
+  fqdn_rt(out, FQDN2, DNSResolveType::DNS_AddrType_IPv6_IPv4);  // IPv6 before IPv4
 #endif
   out.println(F("------------------------------"));
 }
@@ -125,7 +124,7 @@ void setup() {
 
   status(Serial);
 
-#if 0 // 0: legacy connecting loop - 1: wait for IPv6
+#if 0  // 0: legacy connecting loop - 1: wait for IPv6
 
   // legacy loop (still valid with IPv4 only)
 
@@ -146,9 +145,9 @@ void setup() {
   for (bool configured = false; !configured;) {
     for (auto addr : addrList)
       if ((configured = !addr.isLocal()
-                        // && addr.isV6() // uncomment when IPv6 is mandatory
-                        // && addr.ifnumber() == STATION_IF
-          )) {
+           // && addr.isV6() // uncomment when IPv6 is mandatory
+           // && addr.ifnumber() == STATION_IF
+           )) {
         break;
       }
     Serial.print('.');
@@ -173,7 +172,6 @@ void setup() {
 unsigned long statusTimeMs = 0;
 
 void loop() {
-
   if (statusServer.hasClient()) {
     WiFiClient cli = statusServer.accept();
     status(cli);
@@ -188,7 +186,7 @@ void loop() {
     udp.remoteIP().printTo(Serial);
     Serial.print(F(" :"));
     Serial.println(udp.remotePort());
-    int  c;
+    int c;
     while ((c = udp.read()) >= 0) {
       Serial.write(c);
     }
@@ -199,9 +197,7 @@ void loop() {
     udp.endPacket();
   }
 
-
   if (showStatusOnSerialNow) {
     status(Serial);
   }
-
 }
diff --git a/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino b/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
index 927e78fee9..24018681e6 100644
--- a/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
+++ b/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
@@ -23,24 +23,23 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char * ssid = STASSID; // your network SSID (name)
-const char * pass = STAPSK;  // your network password
+const char* ssid = STASSID;  // your network SSID (name)
+const char* pass = STAPSK;   // your network password
 
-
-unsigned int localPort = 2390;      // local port to listen for UDP packets
+unsigned int localPort = 2390;  // local port to listen for UDP packets
 
 /* Don't hardwire the IP address or we won't get the benefits of the pool.
     Lookup the IP address for the host name instead */
 //IPAddress timeServer(129, 6, 15, 28); // time.nist.gov NTP server
-IPAddress timeServerIP; // time.nist.gov NTP server address
+IPAddress   timeServerIP;  // time.nist.gov NTP server address
 const char* ntpServerName = "time.nist.gov";
 
-const int NTP_PACKET_SIZE = 48; // NTP time stamp is in the first 48 bytes of the message
+const int NTP_PACKET_SIZE = 48;  // NTP time stamp is in the first 48 bytes of the message
 
-byte packetBuffer[ NTP_PACKET_SIZE]; //buffer to hold incoming and outgoing packets
+byte packetBuffer[NTP_PACKET_SIZE];  //buffer to hold incoming and outgoing packets
 
 // A UDP instance to let us send and receive packets over UDP
 WiFiUDP udp;
@@ -76,7 +75,7 @@ void loop() {
   //get a random server from the pool
   WiFi.hostByName(ntpServerName, timeServerIP);
 
-  sendNTPpacket(timeServerIP); // send an NTP packet to a time server
+  sendNTPpacket(timeServerIP);  // send an NTP packet to a time server
   // wait to see if a reply is available
   delay(1000);
 
@@ -87,13 +86,13 @@ void loop() {
     Serial.print("packet received, length=");
     Serial.println(cb);
     // We've received a packet, read the data from it
-    udp.read(packetBuffer, NTP_PACKET_SIZE); // read the packet into the buffer
+    udp.read(packetBuffer, NTP_PACKET_SIZE);  // read the packet into the buffer
 
     //the timestamp starts at byte 40 of the received packet and is four bytes,
     // or two words, long. First, esxtract the two words:
 
     unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);
-    unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]);
+    unsigned long lowWord  = word(packetBuffer[42], packetBuffer[43]);
     // combine the four bytes (two words) into a long integer
     // this is NTP time (seconds since Jan 1 1900):
     unsigned long secsSince1900 = highWord << 16 | lowWord;
@@ -109,22 +108,21 @@ void loop() {
     // print Unix time:
     Serial.println(epoch);
 
-
     // print the hour, minute and second:
     Serial.print("The UTC time is ");       // UTC is the time at Greenwich Meridian (GMT)
-    Serial.print((epoch  % 86400L) / 3600); // print the hour (86400 equals secs per day)
+    Serial.print((epoch % 86400L) / 3600);  // print the hour (86400 equals secs per day)
     Serial.print(':');
     if (((epoch % 3600) / 60) < 10) {
       // In the first 10 minutes of each hour, we'll want a leading '0'
       Serial.print('0');
     }
-    Serial.print((epoch  % 3600) / 60); // print the minute (3600 equals secs per minute)
+    Serial.print((epoch % 3600) / 60);  // print the minute (3600 equals secs per minute)
     Serial.print(':');
     if ((epoch % 60) < 10) {
       // In the first 10 seconds of each minute, we'll want a leading '0'
       Serial.print('0');
     }
-    Serial.println(epoch % 60); // print the second
+    Serial.println(epoch % 60);  // print the second
   }
   // wait ten seconds before asking for the time again
   delay(10000);
@@ -137,19 +135,19 @@ void sendNTPpacket(IPAddress& address) {
   memset(packetBuffer, 0, NTP_PACKET_SIZE);
   // Initialize values needed to form NTP request
   // (see URL above for details on the packets)
-  packetBuffer[0] = 0b11100011;   // LI, Version, Mode
-  packetBuffer[1] = 0;     // Stratum, or type of clock
-  packetBuffer[2] = 6;     // Polling Interval
-  packetBuffer[3] = 0xEC;  // Peer Clock Precision
+  packetBuffer[0] = 0b11100011;  // LI, Version, Mode
+  packetBuffer[1] = 0;           // Stratum, or type of clock
+  packetBuffer[2] = 6;           // Polling Interval
+  packetBuffer[3] = 0xEC;        // Peer Clock Precision
   // 8 bytes of zero for Root Delay & Root Dispersion
-  packetBuffer[12]  = 49;
-  packetBuffer[13]  = 0x4E;
-  packetBuffer[14]  = 49;
-  packetBuffer[15]  = 52;
+  packetBuffer[12] = 49;
+  packetBuffer[13] = 0x4E;
+  packetBuffer[14] = 49;
+  packetBuffer[15] = 52;
 
   // all NTP fields have been given values, now
   // you can send a packet requesting a timestamp:
-  udp.beginPacket(address, 123); //NTP requests are to port 123
+  udp.beginPacket(address, 123);  //NTP requests are to port 123
   udp.write(packetBuffer, NTP_PACKET_SIZE);
   udp.endPacket();
 }
diff --git a/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino b/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
index 43f8fe981c..d055921cdf 100644
--- a/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
+++ b/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
@@ -25,7 +25,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid     = STASSID;
@@ -34,7 +34,6 @@ const char* password = STAPSK;
 ArduinoWiFiServer server(2323);
 
 void setup() {
-
   Serial.begin(115200);
 
   Serial.println();
@@ -59,14 +58,13 @@ void setup() {
 }
 
 void loop() {
-
-  WiFiClient client = server.available(); // returns first client which has data to read or a 'false' client
-  if (client) { // client is true only if it is connected and has data to read
-    String s = client.readStringUntil('\n'); // read the message incoming from one of the clients
-    s.trim(); // trim eventual \r
-    Serial.println(s); // print the message to Serial Monitor
-    client.print("echo: "); // this is only for the sending client
-    server.println(s); // send the message to all connected clients
-    server.flush(); // flush the buffers
+  WiFiClient client = server.available();     // returns first client which has data to read or a 'false' client
+  if (client) {                               // client is true only if it is connected and has data to read
+    String s = client.readStringUntil('\n');  // read the message incoming from one of the clients
+    s.trim();                                 // trim eventual \r
+    Serial.println(s);                        // print the message to Serial Monitor
+    client.print("echo: ");                   // this is only for the sending client
+    server.println(s);                        // send the message to all connected clients
+    server.flush();                           // flush the buffers
   }
 }
diff --git a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
index a98e894873..bb761a026a 100644
--- a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
+++ b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
@@ -7,7 +7,7 @@
 
 #ifndef STASSID
 #define STASSID "mynetwork"
-#define STAPSK  "mynetworkpassword"
+#define STAPSK "mynetworkpassword"
 #endif
 
 #include <ESP8266WiFi.h>
@@ -61,9 +61,9 @@ void setup() {
   dhcpSoftAP.dhcps_set_dns(1, WiFi.dnsIP(1));
 
   WiFi.softAPConfig(  // enable AP, with android-compatible google domain
-    IPAddress(172, 217, 28, 254),
-    IPAddress(172, 217, 28, 254),
-    IPAddress(255, 255, 255, 0));
+      IPAddress(172, 217, 28, 254),
+      IPAddress(172, 217, 28, 254),
+      IPAddress(255, 255, 255, 0));
   WiFi.softAP(STASSID "extender", STAPSK);
   Serial.printf("AP: %s\n", WiFi.softAPIP().toString().c_str());
 
@@ -94,4 +94,3 @@ void setup() {
 
 void loop() {
 }
-
diff --git a/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino b/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
index e4520c4720..e1de8fe630 100644
--- a/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
+++ b/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
@@ -7,8 +7,8 @@
 #include <LwipDhcpServer.h>
 
 /* Set these to your desired credentials. */
-const char *ssid = "ESPap";
-const char *password = "thereisnospoon";
+const char* ssid     = "ESPap";
+const char* password = "thereisnospoon";
 
 ESP8266WebServer server(80);
 
@@ -17,21 +17,20 @@ IPAddress apIP(192, 168, 0, 1);
 
 /* Go to http://192.168.0.1 in a web browser to see current lease */
 void handleRoot() {
-  String result;
-  char wifiClientMac[18];
-  unsigned char number_client;
-  struct station_info *stat_info;
+  String               result;
+  char                 wifiClientMac[18];
+  unsigned char        number_client;
+  struct station_info* stat_info;
 
   int i = 1;
 
   number_client = wifi_softap_get_station_num();
-  stat_info = wifi_softap_get_station_info();
+  stat_info     = wifi_softap_get_station_info();
 
   result = "<html><body><h1>Total Connected Clients : ";
   result += String(number_client);
   result += "</h1></br>";
   while (stat_info != NULL) {
-
     result += "Client ";
     result += String(i);
     result += " = ";
@@ -52,7 +51,7 @@ void handleRoot() {
 void setup() {
   /* List of mac address for static lease */
   uint8 mac_CAM[6] = { 0x00, 0x0C, 0x43, 0x01, 0x60, 0x15 };
-  uint8 mac_PC[6] = { 0xb4, 0x52, 0x7e, 0x9a, 0x19, 0xa5 };
+  uint8 mac_PC[6]  = { 0xb4, 0x52, 0x7e, 0x9a, 0x19, 0xa5 };
 
   Serial.begin(115200);
   Serial.println();
diff --git a/libraries/ESP8266WiFi/examples/Udp/Udp.ino b/libraries/ESP8266WiFi/examples/Udp/Udp.ino
index 7ec287b392..0954603e6d 100644
--- a/libraries/ESP8266WiFi/examples/Udp/Udp.ino
+++ b/libraries/ESP8266WiFi/examples/Udp/Udp.ino
@@ -14,20 +14,19 @@
   adapted from Ethernet library examples
 */
 
-
 #include <ESP8266WiFi.h>
 #include <WiFiUdp.h>
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-unsigned int localPort = 8888;      // local port to listen on
+unsigned int localPort = 8888;  // local port to listen on
 
 // buffers for receiving and sending data
-char packetBuffer[UDP_TX_PACKET_MAX_SIZE + 1]; //buffer to hold incoming packet,
-char  ReplyBuffer[] = "acknowledged\r\n";       // a string to send back
+char packetBuffer[UDP_TX_PACKET_MAX_SIZE + 1];  //buffer to hold incoming packet,
+char ReplyBuffer[] = "acknowledged\r\n";        // a string to send back
 
 WiFiUDP Udp;
 
@@ -56,7 +55,7 @@ void loop() {
                   ESP.getFreeHeap());
 
     // read the packet into packetBufffer
-    int n = Udp.read(packetBuffer, UDP_TX_PACKET_MAX_SIZE);
+    int n           = Udp.read(packetBuffer, UDP_TX_PACKET_MAX_SIZE);
     packetBuffer[n] = 0;
     Serial.println("Contents:");
     Serial.println(packetBuffer);
@@ -66,7 +65,6 @@ void loop() {
     Udp.write(ReplyBuffer);
     Udp.endPacket();
   }
-
 }
 
 /*
diff --git a/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino b/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
index 6fea68f590..11d79620e5 100644
--- a/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
@@ -36,12 +36,12 @@
 
 #ifndef APSSID
 #define APSSID "ESPap"
-#define APPSK  "thereisnospoon"
+#define APPSK "thereisnospoon"
 #endif
 
 /* Set these to your desired credentials. */
-const char *ssid = APSSID;
-const char *password = APPSK;
+const char* ssid     = APSSID;
+const char* password = APPSK;
 
 ESP8266WebServer server(80);
 
diff --git a/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino b/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
index e442282e37..515f770cca 100644
--- a/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
@@ -9,13 +9,13 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 const char* ssid     = STASSID;
 const char* password = STAPSK;
 
-const char* host = "192.168.1.1";
+const char*    host = "192.168.1.1";
 const uint16_t port = 3000;
 
 ESP8266WiFiMulti WiFiMulti;
@@ -44,7 +44,6 @@ void setup() {
   delay(500);
 }
 
-
 void loop() {
   Serial.print("connecting to ");
   Serial.print(host);
@@ -75,4 +74,3 @@ void loop() {
   Serial.println("wait 5 sec...");
   delay(5000);
 }
-
diff --git a/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino b/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
index f902e019a9..2b5ad66bc8 100644
--- a/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
@@ -7,11 +7,11 @@
 #include <ESP8266WiFi.h>
 #include <ESP8266mDNS.h>
 #include <PolledTimeout.h>
-#include <algorithm> // std::min
+#include <algorithm>  // std::min
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 constexpr int port = 23;
@@ -19,15 +19,14 @@ constexpr int port = 23;
 WiFiServer server(port);
 WiFiClient client;
 
-constexpr size_t sizes [] = { 0, 512, 384, 256, 128, 64, 16, 8, 4 };
-constexpr uint32_t breathMs = 200;
-esp8266::polledTimeout::oneShotFastMs enoughMs(breathMs);
+constexpr size_t                       sizes[]  = { 0, 512, 384, 256, 128, 64, 16, 8, 4 };
+constexpr uint32_t                     breathMs = 200;
+esp8266::polledTimeout::oneShotFastMs  enoughMs(breathMs);
 esp8266::polledTimeout::periodicFastMs test(2000);
-int t = 1; // test (1, 2 or 3, see below)
-int s = 0; // sizes[] index
+int                                    t = 1;  // test (1, 2 or 3, see below)
+int                                    s = 0;  // sizes[] index
 
 void setup() {
-
   Serial.begin(115200);
   Serial.println(ESP.getFullVersion());
 
@@ -54,9 +53,7 @@ void setup() {
                 port);
 }
 
-
 void loop() {
-
   MDNS.update();
 
   static uint32_t tot = 0;
@@ -84,10 +81,28 @@ void loop() {
   if (Serial.available()) {
     s = (s + 1) % (sizeof(sizes) / sizeof(sizes[0]));
     switch (Serial.read()) {
-      case '1': if (t != 1) s = 0; t = 1; Serial.println("byte-by-byte (watch then press 2, 3 or 4)"); break;
-      case '2': if (t != 2) s = 1; t = 2; Serial.printf("through buffer (watch then press 2 again, or 1, 3 or 4)\n"); break;
-      case '3': if (t != 3) s = 0; t = 3; Serial.printf("direct access (sendAvailable - watch then press 3 again, or 1, 2 or 4)\n"); break;
-      case '4':                    t = 4; Serial.printf("direct access (sendAll - close peer to stop, then press 1, 2 or 3 before restarting peer)\n"); break;
+      case '1':
+        if (t != 1)
+          s = 0;
+        t = 1;
+        Serial.println("byte-by-byte (watch then press 2, 3 or 4)");
+        break;
+      case '2':
+        if (t != 2)
+          s = 1;
+        t = 2;
+        Serial.printf("through buffer (watch then press 2 again, or 1, 3 or 4)\n");
+        break;
+      case '3':
+        if (t != 3)
+          s = 0;
+        t = 3;
+        Serial.printf("direct access (sendAvailable - watch then press 3 again, or 1, 2 or 4)\n");
+        break;
+      case '4':
+        t = 4;
+        Serial.printf("direct access (sendAll - close peer to stop, then press 1, 2 or 3 before restarting peer)\n");
+        break;
     }
     tot = cnt = 0;
     ESP.resetFreeContStack();
@@ -109,10 +124,10 @@ void loop() {
     // block by block through a local buffer (2 copies)
     while (client.available() && client.availableForWrite() && !enoughMs) {
       size_t maxTo = std::min(client.available(), client.availableForWrite());
-      maxTo = std::min(maxTo, sizes[s]);
+      maxTo        = std::min(maxTo, sizes[s]);
       uint8_t buf[maxTo];
-      size_t tcp_got = client.read(buf, maxTo);
-      size_t tcp_sent = client.write(buf, tcp_got);
+      size_t  tcp_got  = client.read(buf, maxTo);
+      size_t  tcp_sent = client.write(buf, tcp_got);
       if (tcp_sent != maxTo) {
         Serial.printf("len mismatch: available:%zd tcp-read:%zd serial-write:%zd\n", maxTo, tcp_got, tcp_sent);
       }
@@ -131,26 +146,43 @@ void loop() {
     cnt++;
 
     switch (client.getLastSendReport()) {
-      case Stream::Report::Success: break;
-      case Stream::Report::TimedOut: Serial.println("Stream::send: timeout"); break;
-      case Stream::Report::ReadError: Serial.println("Stream::send: read error"); break;
-      case Stream::Report::WriteError: Serial.println("Stream::send: write error"); break;
-      case Stream::Report::ShortOperation: Serial.println("Stream::send: short transfer"); break;
+      case Stream::Report::Success:
+        break;
+      case Stream::Report::TimedOut:
+        Serial.println("Stream::send: timeout");
+        break;
+      case Stream::Report::ReadError:
+        Serial.println("Stream::send: read error");
+        break;
+      case Stream::Report::WriteError:
+        Serial.println("Stream::send: write error");
+        break;
+      case Stream::Report::ShortOperation:
+        Serial.println("Stream::send: short transfer");
+        break;
     }
   }
 
   else if (t == 4) {
     // stream to print, possibly with only one copy
-    tot += client.sendAll(&client); // this one might not exit until peer close
+    tot += client.sendAll(&client);  // this one might not exit until peer close
     cnt++;
 
     switch (client.getLastSendReport()) {
-      case Stream::Report::Success: break;
-      case Stream::Report::TimedOut: Serial.println("Stream::send: timeout"); break;
-      case Stream::Report::ReadError: Serial.println("Stream::send: read error"); break;
-      case Stream::Report::WriteError: Serial.println("Stream::send: write error"); break;
-      case Stream::Report::ShortOperation: Serial.println("Stream::send: short transfer"); break;
+      case Stream::Report::Success:
+        break;
+      case Stream::Report::TimedOut:
+        Serial.println("Stream::send: timeout");
+        break;
+      case Stream::Report::ReadError:
+        Serial.println("Stream::send: read error");
+        break;
+      case Stream::Report::WriteError:
+        Serial.println("Stream::send: write error");
+        break;
+      case Stream::Report::ShortOperation:
+        Serial.println("Stream::send: short transfer");
+        break;
     }
   }
-
 }
diff --git a/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino b/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
index d72985a9c1..9c094c1013 100644
--- a/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
@@ -18,7 +18,7 @@
 
 #ifndef APSSID
 #define APSSID "esp8266"
-#define APPSK  "esp8266"
+#define APPSK "esp8266"
 #endif
 
 const char* ssid     = APSSID;
diff --git a/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino b/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
index 56c04a3a53..a585092bdd 100644
--- a/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
@@ -11,10 +11,10 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 // Create an instance of the server
@@ -60,7 +60,7 @@ void loop() {
   }
   Serial.println(F("new client"));
 
-  client.setTimeout(5000); // default is 1000
+  client.setTimeout(5000);  // default is 1000
 
   // Read the first line of the request
   String req = client.readStringUntil('\r');
diff --git a/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino b/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
index b546df4a7d..30542af4e0 100644
--- a/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
@@ -19,13 +19,13 @@ void setup() {
 }
 
 void loop() {
-  String ssid;
-  int32_t rssi;
-  uint8_t encryptionType;
+  String   ssid;
+  int32_t  rssi;
+  uint8_t  encryptionType;
   uint8_t* bssid;
-  int32_t channel;
-  bool hidden;
-  int scanResult;
+  int32_t  channel;
+  bool     hidden;
+  int      scanResult;
 
   Serial.println(F("Starting WiFi scan..."));
 
diff --git a/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino b/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
index b03357c143..f246f98d68 100644
--- a/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
@@ -17,11 +17,11 @@
 #endif
 
 #include <ESP8266WiFi.h>
-#include <include/WiFiState.h> // WiFiState structure details
+#include <include/WiFiState.h>  // WiFiState structure details
 
 WiFiState state;
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 void setup() {
@@ -36,7 +36,7 @@ void setup() {
   // Here you can do whatever you need to do that doesn't need a WiFi connection.
   // ---
 
-  ESP.rtcUserMemoryRead(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t *>(&state), sizeof(state));
+  ESP.rtcUserMemoryRead(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t*>(&state), sizeof(state));
   unsigned long start = millis();
 
   if (!WiFi.resumeFromShutdown(state)
@@ -64,7 +64,7 @@ void setup() {
   // ---
 
   WiFi.shutdown(state);
-  ESP.rtcUserMemoryWrite(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t *>(&state), sizeof(state));
+  ESP.rtcUserMemoryWrite(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t*>(&state), sizeof(state));
 
   // ---
   // Here you can do whatever you need to do that doesn't need a WiFi connection anymore.
diff --git a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
index 7ddcdd6d07..9dafae4cf4 100644
--- a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
@@ -20,11 +20,11 @@
 */
 #include <ESP8266WiFi.h>
 
-#include <algorithm> // std::min
+#include <algorithm>  // std::min
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 /*
@@ -64,11 +64,11 @@ SoftwareSerial* logger = nullptr;
 #define logger (&Serial1)
 #endif
 
-#define STACK_PROTECTOR  512 // bytes
+#define STACK_PROTECTOR 512  // bytes
 
 //how many clients should be able to telnet to this ESP8266
 #define MAX_SRV_CLIENTS 2
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 const int port = 23;
@@ -77,7 +77,6 @@ WiFiServer server(port);
 WiFiClient serverClients[MAX_SRV_CLIENTS];
 
 void setup() {
-
   Serial.begin(BAUD_SERIAL);
   Serial.setRxBufferSize(RXBUFFERSIZE);
 
@@ -98,7 +97,7 @@ void setup() {
   logger->printf("Serial receive buffer size: %d bytes\n", RXBUFFERSIZE);
 
 #if SERIAL_LOOPBACK
-  USC0(0) |= (1 << UCLBE); // incomplete HardwareSerial API
+  USC0(0) |= (1 << UCLBE);  // incomplete HardwareSerial API
   logger->println("Serial Internal Loopback enabled");
 #endif
 
@@ -129,7 +128,7 @@ void loop() {
     //find free/disconnected spot
     int i;
     for (i = 0; i < MAX_SRV_CLIENTS; i++)
-      if (!serverClients[i]) { // equivalent to !serverClients[i].connected()
+      if (!serverClients[i]) {  // equivalent to !serverClients[i].connected()
         serverClients[i] = server.accept();
         logger->print("New client: index ");
         logger->print(i);
@@ -161,10 +160,10 @@ void loop() {
   for (int i = 0; i < MAX_SRV_CLIENTS; i++)
     while (serverClients[i].available() && Serial.availableForWrite() > 0) {
       size_t maxToSerial = std::min(serverClients[i].available(), Serial.availableForWrite());
-      maxToSerial = std::min(maxToSerial, (size_t)STACK_PROTECTOR);
+      maxToSerial        = std::min(maxToSerial, (size_t)STACK_PROTECTOR);
       uint8_t buf[maxToSerial];
-      size_t tcp_got = serverClients[i].read(buf, maxToSerial);
-      size_t serial_sent = Serial.write(buf, tcp_got);
+      size_t  tcp_got     = serverClients[i].read(buf, maxToSerial);
+      size_t  serial_sent = Serial.write(buf, tcp_got);
       if (serial_sent != maxToSerial) {
         logger->printf("len mismatch: available:%zd tcp-read:%zd serial-write:%zd\n", maxToSerial, tcp_got, serial_sent);
       }
@@ -191,10 +190,10 @@ void loop() {
 
   //check UART for data
   size_t len = std::min(Serial.available(), maxToTcp);
-  len = std::min(len, (size_t)STACK_PROTECTOR);
+  len        = std::min(len, (size_t)STACK_PROTECTOR);
   if (len) {
     uint8_t sbuf[len];
-    int serial_got = Serial.readBytes(sbuf, len);
+    int     serial_got = Serial.readBytes(sbuf, len);
     // push UART data to all connected telnet clients
     for (int i = 0; i < MAX_SRV_CLIENTS; i++)
       // if client.availableForWrite() was 0 (congested)
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino b/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
index 443d52e2bb..34f21be030 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
@@ -1,4 +1,4 @@
-#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
+#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
 
 #include <ESP8266WiFi.h>
 #include <EspnowMeshBackend.h>
@@ -19,31 +19,28 @@ namespace TypeCast = MeshTypeConversionFunctions;
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char exampleMeshName[] PROGMEM = "MeshNode_"; // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
-constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO"; // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
+constexpr char exampleMeshName[] PROGMEM     = "MeshNode_";                    // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
+constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
 
 // A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a default Kok set, but it can be replaced if desired.
 // All ESP-NOW keys below must match in an encrypted connection pair for encrypted communication to be possible.
 // Note that it is also possible to use Strings as key seeds instead of arrays.
-uint8_t espnowEncryptedConnectionKey[16] = {0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting transmissions of encrypted connections.
-                                            0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11
-                                           };
-uint8_t espnowEncryptionKok[16] = {0x22, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting the encrypted connection key.
-                                   0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x33
-                                  };
-uint8_t espnowHashKey[16] = {0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44, // This is the secret key used for HMAC during encrypted connection requests.
-                             0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD
-                            };
-
-unsigned int requestNumber = 0;
+uint8_t espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting transmissions of encrypted connections.
+                                             0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11 };
+uint8_t espnowEncryptionKok[16]          = { 0x22, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting the encrypted connection key.
+                                    0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x33 };
+uint8_t espnowHashKey[16]                = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44,  // This is the secret key used for HMAC during encrypted connection requests.
+                              0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD };
+
+unsigned int requestNumber  = 0;
 unsigned int responseNumber = 0;
 
-const char broadcastMetadataDelimiter = 23; // 23 = End-of-Transmission-Block (ETB) control character in ASCII
+const char broadcastMetadataDelimiter = 23;  // 23 = End-of-Transmission-Block (ETB) control character in ASCII
 
-String manageRequest(const String &request, MeshBackendBase &meshInstance);
-TransmissionStatusType manageResponse(const String &response, MeshBackendBase &meshInstance);
-void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance);
-bool broadcastFilter(String &firstTransmission, EspnowMeshBackend &meshInstance);
+String                 manageRequest(const String& request, MeshBackendBase& meshInstance);
+TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance);
+void                   networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance);
+bool                   broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance);
 
 /* Create the mesh node object */
 EspnowMeshBackend espnowNode = EspnowMeshBackend(manageRequest, manageResponse, networkFilter, broadcastFilter, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
@@ -55,13 +52,13 @@ EspnowMeshBackend espnowNode = EspnowMeshBackend(manageRequest, manageResponse,
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
 */
-String manageRequest(const String &request, MeshBackendBase &meshInstance) {
+String manageRequest(const String& request, MeshBackendBase& meshInstance) {
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
-    (void)tcpIpInstance; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+    (void)tcpIpInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
     Serial.print(F("TCP/IP: "));
   } else {
     Serial.print(F("UNKNOWN!: "));
@@ -90,14 +87,14 @@ String manageRequest(const String &request, MeshBackendBase &meshInstance) {
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The status code resulting from the response, as an int
 */
-TransmissionStatusType manageResponse(const String &response, MeshBackendBase &meshInstance) {
+TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance) {
   TransmissionStatusType statusCode = TransmissionStatusType::TRANSMISSION_COMPLETE;
 
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
+  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
     Serial.print(F("TCP/IP: "));
 
     // Getting the sent message like this will work as long as ONLY(!) TCP/IP is used.
@@ -126,20 +123,20 @@ TransmissionStatusType manageResponse(const String &response, MeshBackendBase &m
    @param numberOfNetworks The number of networks found in the WiFi scan.
    @param meshInstance The MeshBackendBase instance that called the function.
 */
-void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance) {
+void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
   // Note that the network index of a given node may change whenever a new scan is done.
   for (int networkIndex = 0; networkIndex < numberOfNetworks; ++networkIndex) {
-    String currentSSID = WiFi.SSID(networkIndex);
-    int meshNameIndex = currentSSID.indexOf(meshInstance.getMeshName());
+    String currentSSID   = WiFi.SSID(networkIndex);
+    int    meshNameIndex = currentSSID.indexOf(meshInstance.getMeshName());
 
     /* Connect to any _suitable_ APs which contain meshInstance.getMeshName() */
     if (meshNameIndex >= 0) {
       uint64_t targetNodeID = TypeCast::stringToUint64(currentSSID.substring(meshNameIndex + meshInstance.getMeshName().length()));
 
       if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID())) {
-        if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
+        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
           espnowInstance->connectionQueue().emplace_back(networkIndex);
-        } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
+        } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
           tcpIpInstance->connectionQueue().emplace_back(networkIndex);
         } else {
           Serial.println(F("Invalid mesh backend!"));
@@ -161,7 +158,7 @@ void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance) {
 
    @return True if the broadcast should be accepted. False otherwise.
 */
-bool broadcastFilter(String &firstTransmission, EspnowMeshBackend &meshInstance) {
+bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance) {
   // This example broadcastFilter will accept a transmission if it contains the broadcastMetadataDelimiter
   // and as metaData either no targetMeshName or a targetMeshName that matches the MeshName of meshInstance.
 
@@ -174,7 +171,7 @@ bool broadcastFilter(String &firstTransmission, EspnowMeshBackend &meshInstance)
   String targetMeshName = firstTransmission.substring(0, metadataEndIndex);
 
   if (!targetMeshName.isEmpty() && meshInstance.getMeshName() != targetMeshName) {
-    return false; // Broadcast is for another mesh network
+    return false;  // Broadcast is for another mesh network
   } else {
     // Remove metadata from message and mark as accepted broadcast.
     // Note that when you modify firstTransmission it is best to avoid using substring or other String methods that rely on null values for String length determination.
@@ -195,10 +192,10 @@ bool broadcastFilter(String &firstTransmission, EspnowMeshBackend &meshInstance)
 
    @return True if attemptTransmission should continue with the next entry in the connectionQueue. False if attemptTransmission should stop.
 */
-bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase &meshInstance) {
+bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
   // Currently this is exactly the same as the default hook, but you can modify it to alter the behaviour of attemptTransmission.
 
-  (void)meshInstance; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  (void)meshInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
 
   return true;
 }
@@ -218,10 +215,10 @@ bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase &meshInstance) {
    @return True if the response transmission process should continue with the next response in the waiting list.
            False if the response transmission process should stop once processing of the just sent response is complete.
 */
-bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String &response, const uint8_t *recipientMac, uint32_t responseIndex, EspnowMeshBackend &meshInstance) {
+bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String& response, const uint8_t* recipientMac, uint32_t responseIndex, EspnowMeshBackend& meshInstance) {
   // Currently this is exactly the same as the default hook, but you can modify it to alter the behaviour of sendEspnowResponses.
 
-  (void)transmissionSuccessful; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  (void)transmissionSuccessful;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
   (void)response;
   (void)recipientMac;
   (void)responseIndex;
@@ -286,7 +283,7 @@ void setup() {
 }
 
 int32_t timeOfLastScan = -10000;
-void loop() {
+void    loop() {
   // The performEspnowMaintenance() method performs all the background operations for the EspnowMeshBackend.
   // It is recommended to place it in the beginning of the loop(), unless there is a need to put it elsewhere.
   // Among other things, the method cleans up old Espnow log entries (freeing up RAM) and sends the responses you provide to Espnow requests.
@@ -296,7 +293,7 @@ void loop() {
   //Should not be used inside responseHandler, requestHandler, networkFilter or broadcastFilter callbacks since performEspnowMaintenance() can alter the ESP-NOW state.
   EspnowMeshBackend::performEspnowMaintenance();
 
-  if (millis() - timeOfLastScan > 10000) { // Give other nodes some time to connect between data transfers.
+  if (millis() - timeOfLastScan > 10000) {  // Give other nodes some time to connect between data transfers.
     Serial.println(F("\nPerforming unencrypted ESP-NOW transmissions."));
 
     uint32_t startTime = millis();
@@ -318,7 +315,7 @@ void loop() {
     if (espnowNode.latestTransmissionOutcomes().empty()) {
       Serial.println(F("No mesh AP found."));
     } else {
-      for (TransmissionOutcome &transmissionOutcome : espnowNode.latestTransmissionOutcomes()) {
+      for (TransmissionOutcome& transmissionOutcome : espnowNode.latestTransmissionOutcomes()) {
         if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED) {
           Serial.println(String(F("Transmission failed to mesh AP ")) + transmissionOutcome.SSID());
         } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED) {
@@ -339,24 +336,24 @@ void loop() {
       // Note that data that comes before broadcastMetadataDelimiter should not contain any broadcastMetadataDelimiter characters,
       // otherwise the broadcastFilter function used in this example file will not work.
       String broadcastMetadata = espnowNode.getMeshName() + String(broadcastMetadataDelimiter);
-      String broadcastMessage = String(F("Broadcast #")) + String(requestNumber) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
+      String broadcastMessage  = String(F("Broadcast #")) + String(requestNumber) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
       espnowNode.broadcast(broadcastMetadata + broadcastMessage);
       Serial.println(String(F("Broadcast to all mesh nodes done in ")) + String(millis() - startTime) + F(" ms."));
 
-      espnowDelay(100); // Wait for responses (broadcasts can receive an unlimited number of responses, other transmissions can only receive one response).
+      espnowDelay(100);  // Wait for responses (broadcasts can receive an unlimited number of responses, other transmissions can only receive one response).
 
       // If you have a data array containing null values it is possible to transmit the raw data by making the array into a multiString as shown below.
       // You can use String::c_str() or String::begin() to retrieve the data array later.
       // Note that certain String methods such as String::substring use null values to determine String length, which means they will not work as normal with multiStrings.
-      uint8_t dataArray[] = {0, '\'', 0, '\'', ' ', '(', 'n', 'u', 'l', 'l', ')', ' ', 'v', 'a', 'l', 'u', 'e'};
-      String espnowMessage = TypeCast::uint8ArrayToMultiString(dataArray, sizeof dataArray) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
+      uint8_t dataArray[]   = { 0, '\'', 0, '\'', ' ', '(', 'n', 'u', 'l', 'l', ')', ' ', 'v', 'a', 'l', 'u', 'e' };
+      String  espnowMessage = TypeCast::uint8ArrayToMultiString(dataArray, sizeof dataArray) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
       Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
       espnowNode.attemptTransmission(espnowMessage, false);
-      espnowDelay(100); // Wait for response.
+      espnowDelay(100);  // Wait for response.
 
       Serial.println(F("\nPerforming encrypted ESP-NOW transmissions."));
 
-      uint8_t targetBSSID[6] {0};
+      uint8_t targetBSSID[6] { 0 };
 
       // We can create encrypted connections to individual nodes so that all ESP-NOW communication with the node will be encrypted.
       if (espnowNode.constConnectionQueue()[0].getBSSID(targetBSSID) && espnowNode.requestEncryptedConnection(targetBSSID) == EncryptedConnectionStatus::CONNECTION_ESTABLISHED) {
@@ -369,7 +366,7 @@ void loop() {
         String espnowMessage = String(F("This message is encrypted only when received by node ")) + peerMac;
         Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
         espnowNode.attemptTransmission(espnowMessage, false);
-        espnowDelay(100); // Wait for response.
+        espnowDelay(100);  // Wait for response.
 
         // A connection can be serialized and stored for later use.
         // Note that this saves the current state only, so if encrypted communication between the nodes happen after this, the stored state is invalid.
@@ -383,7 +380,7 @@ void loop() {
         espnowMessage = String(F("This message is no longer encrypted when received by node ")) + peerMac;
         Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
         espnowNode.attemptTransmission(espnowMessage, false);
-        espnowDelay(100); // Wait for response.
+        espnowDelay(100);  // Wait for response.
         Serial.println(F("Cannot read the encrypted response..."));
 
         // Let's re-add our stored connection so we can communicate properly with targetBSSID again!
@@ -392,7 +389,7 @@ void loop() {
         espnowMessage = String(F("This message is once again encrypted when received by node ")) + peerMac;
         Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
         espnowNode.attemptTransmission(espnowMessage, false);
-        espnowDelay(100); // Wait for response.
+        espnowDelay(100);  // Wait for response.
 
         Serial.println();
         // If we want to remove the encrypted connection on both nodes, we can do it like this.
@@ -403,7 +400,7 @@ void loop() {
           espnowMessage = String(F("This message is only received by node ")) + peerMac + F(". Transmitting in this way will not change the transmission state of the sender.");
           Serial.println(String(F("Transmitting: ")) + espnowMessage);
           espnowNode.attemptTransmission(espnowMessage, EspnowNetworkInfo(targetBSSID));
-          espnowDelay(100); // Wait for response.
+          espnowDelay(100);  // Wait for response.
 
           Serial.println();
 
@@ -423,7 +420,7 @@ void loop() {
             espnowMessage = String(F("Due to encrypted connection expiration, this message is no longer encrypted when received by node ")) + peerMac;
             Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
             espnowNode.attemptTransmission(espnowMessage, false);
-            espnowDelay(100); // Wait for response.
+            espnowDelay(100);  // Wait for response.
           }
 
           // Or if we prefer we can just let the library automatically create brief encrypted connections which are long enough to transmit an encrypted message.
@@ -432,9 +429,9 @@ void loop() {
           espnowMessage = F("This message is always encrypted, regardless of receiver.");
           Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
           espnowNode.attemptAutoEncryptingTransmission(espnowMessage);
-          espnowDelay(100); // Wait for response.
+          espnowDelay(100);  // Wait for response.
         } else {
-          Serial.println(String(F("Ooops! Encrypted connection removal failed. Status: ")) +  String(static_cast<int>(removalOutcome)));
+          Serial.println(String(F("Ooops! Encrypted connection removal failed. Status: ")) + String(static_cast<int>(removalOutcome)));
         }
 
         // Finally, should you ever want to stop other parties from sending unencrypted messages to the node
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino b/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
index 3ae8567e16..811b07f0ab 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
@@ -8,7 +8,7 @@
    Or "floodingMesh.getEspnowMeshBackend().setBroadcastTransmissionRedundancy(uint8_t redundancy)" (default 1) at the cost of longer transmission times.
 */
 
-#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
+#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
 
 #include <ESP8266WiFi.h>
 #include <TypeConversionFunctions.h>
@@ -28,28 +28,26 @@ namespace TypeCast = MeshTypeConversionFunctions;
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char exampleMeshName[] PROGMEM = "MeshNode_"; // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
-constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO"; // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
+constexpr char exampleMeshName[] PROGMEM     = "MeshNode_";                    // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
+constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
 
 // A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a default Kok set, but it can be replaced if desired.
 // All ESP-NOW keys below must match in an encrypted connection pair for encrypted communication to be possible.
 // Note that it is also possible to use Strings as key seeds instead of arrays.
-uint8_t espnowEncryptedConnectionKey[16] = {0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, // This is the key for encrypting transmissions of encrypted connections.
-                                            0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11
-                                           };
-uint8_t espnowHashKey[16] = {0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44, // This is the secret key used for HMAC during encrypted connection requests.
-                             0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD
-                            };
+uint8_t espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting transmissions of encrypted connections.
+                                             0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11 };
+uint8_t espnowHashKey[16]                = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44,  // This is the secret key used for HMAC during encrypted connection requests.
+                              0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD };
 
-bool meshMessageHandler(String &message, FloodingMesh &meshInstance);
+bool meshMessageHandler(String& message, FloodingMesh& meshInstance);
 
 /* Create the mesh node object */
 FloodingMesh floodingMesh = FloodingMesh(meshMessageHandler, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
 
-bool theOne = true;
+bool   theOne = true;
 String theOneMac;
 
-bool useLED = false; // Change this to true if you wish the onboard LED to mark The One.
+bool useLED = false;  // Change this to true if you wish the onboard LED to mark The One.
 
 /**
    Callback for when a message is received from the mesh network.
@@ -62,7 +60,7 @@ bool useLED = false; // Change this to true if you wish the onboard LED to mark
    @param meshInstance The FloodingMesh instance that received the message.
    @return True if this node should forward the received message to other nodes. False otherwise.
 */
-bool meshMessageHandler(String &message, FloodingMesh &meshInstance) {
+bool meshMessageHandler(String& message, FloodingMesh& meshInstance) {
   int32_t delimiterIndex = message.indexOf(meshInstance.metadataDelimiter());
   if (delimiterIndex == 0) {
     Serial.print(String(F("Message received from STA MAC ")) + meshInstance.getEspnowMeshBackend().getSenderMac() + F(": "));
@@ -72,13 +70,13 @@ bool meshMessageHandler(String &message, FloodingMesh &meshInstance) {
 
     if (potentialMac >= theOneMac) {
       if (potentialMac > theOneMac) {
-        theOne = false;
+        theOne    = false;
         theOneMac = potentialMac;
       }
 
       if (useLED && !theOne) {
         bool ledState = message.charAt(1) == '1';
-        digitalWrite(LED_BUILTIN, ledState); // Turn LED on/off (LED_BUILTIN is active low)
+        digitalWrite(LED_BUILTIN, ledState);  // Turn LED on/off (LED_BUILTIN is active low)
       }
 
       return true;
@@ -87,18 +85,18 @@ bool meshMessageHandler(String &message, FloodingMesh &meshInstance) {
     }
   } else if (delimiterIndex > 0) {
     if (meshInstance.getOriginMac() == theOneMac) {
-      uint32_t totalBroadcasts = strtoul(message.c_str(), nullptr, 0); // strtoul stops reading input when an invalid character is discovered.
+      uint32_t totalBroadcasts = strtoul(message.c_str(), nullptr, 0);  // strtoul stops reading input when an invalid character is discovered.
 
       // Static variables are only initialized once.
       static uint32_t firstBroadcast = totalBroadcasts;
 
-      if (totalBroadcasts - firstBroadcast >= 100) { // Wait a little to avoid start-up glitches
-        static uint32_t missedBroadcasts = 1; // Starting at one to compensate for initial -1 below.
+      if (totalBroadcasts - firstBroadcast >= 100) {  // Wait a little to avoid start-up glitches
+        static uint32_t missedBroadcasts        = 1;  // Starting at one to compensate for initial -1 below.
         static uint32_t previousTotalBroadcasts = totalBroadcasts;
         static uint32_t totalReceivedBroadcasts = 0;
         totalReceivedBroadcasts++;
 
-        missedBroadcasts += totalBroadcasts - previousTotalBroadcasts - 1; // We expect an increment by 1.
+        missedBroadcasts += totalBroadcasts - previousTotalBroadcasts - 1;  // We expect an increment by 1.
         previousTotalBroadcasts = totalBroadcasts;
 
         if (totalReceivedBroadcasts % 50 == 0) {
@@ -136,14 +134,14 @@ void setup() {
   Serial.println(F("Setting up mesh node..."));
 
   floodingMesh.begin();
-  floodingMesh.activateAP(); // Required to receive messages
+  floodingMesh.activateAP();  // Required to receive messages
 
-  uint8_t apMacArray[6] {0};
+  uint8_t apMacArray[6] { 0 };
   theOneMac = TypeCast::macToString(WiFi.softAPmacAddress(apMacArray));
 
   if (useLED) {
-    pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
-    digitalWrite(LED_BUILTIN, LOW); // Turn LED on (LED_BUILTIN is active low)
+    pinMode(LED_BUILTIN, OUTPUT);    // Initialize the LED_BUILTIN pin as an output
+    digitalWrite(LED_BUILTIN, LOW);  // Turn LED on (LED_BUILTIN is active low)
   }
 
   // Uncomment the lines below to use automatic AEAD encryption/decryption of messages sent/received via broadcast() and encryptedBroadcast().
@@ -153,14 +151,14 @@ void setup() {
   //floodingMesh.getEspnowMeshBackend().setEspnowMessageEncryptionKey(F("ChangeThisKeySeed_TODO")); // The message encryption key should always be set manually. Otherwise a default key (all zeroes) is used.
   //floodingMesh.getEspnowMeshBackend().setUseEncryptedMessages(true);
 
-  floodingMeshDelay(5000); // Give some time for user to start the nodes
+  floodingMeshDelay(5000);  // Give some time for user to start the nodes
 }
 
 int32_t timeOfLastProclamation = -10000;
-void loop() {
-  static bool ledState = 1;
+void    loop() {
+  static bool     ledState       = 1;
   static uint32_t benchmarkCount = 0;
-  static uint32_t loopStart = millis();
+  static uint32_t loopStart      = millis();
 
   // The floodingMeshDelay() method performs all the background operations for the FloodingMesh (via FloodingMesh::performMeshMaintenance()).
   // It is recommended to place one of these methods in the beginning of the loop(), unless there is a need to put them elsewhere.
@@ -177,7 +175,7 @@ void loop() {
   if (theOne) {
     if (millis() - timeOfLastProclamation > 10000) {
       uint32_t startTime = millis();
-      ledState = ledState ^ bool(benchmarkCount); // Make other nodes' LEDs alternate between on and off once benchmarking begins.
+      ledState           = ledState ^ bool(benchmarkCount);  // Make other nodes' LEDs alternate between on and off once benchmarking begins.
 
       // Note: The maximum length of an unencrypted broadcast message is given by floodingMesh.maxUnencryptedMessageLength(). It is around 670 bytes by default.
       floodingMesh.broadcast(String(floodingMesh.metadataDelimiter()) + String(ledState) + theOneMac + F(" is The One."));
@@ -187,7 +185,7 @@ void loop() {
       floodingMeshDelay(20);
     }
 
-    if (millis() - loopStart > 23000) { // Start benchmarking the mesh once three proclamations have been made
+    if (millis() - loopStart > 23000) {  // Start benchmarking the mesh once three proclamations have been made
       uint32_t startTime = millis();
       floodingMesh.broadcast(String(benchmarkCount++) + String(floodingMesh.metadataDelimiter()) + F(": Not a spoon in sight."));
       Serial.println(String(F("Benchmark broadcast done in ")) + String(millis() - startTime) + F(" ms."));
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino b/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
index f68b81f181..8321b2a94c 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
@@ -1,4 +1,4 @@
-#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
+#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
 
 #include <ESP8266WiFi.h>
 #include <TcpIpMeshBackend.h>
@@ -19,15 +19,15 @@ namespace TypeCast = MeshTypeConversionFunctions;
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char exampleMeshName[] PROGMEM = "MeshNode_";
-constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO"; // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
+constexpr char exampleMeshName[] PROGMEM     = "MeshNode_";
+constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
 
-unsigned int requestNumber = 0;
+unsigned int requestNumber  = 0;
 unsigned int responseNumber = 0;
 
-String manageRequest(const String &request, MeshBackendBase &meshInstance);
-TransmissionStatusType manageResponse(const String &response, MeshBackendBase &meshInstance);
-void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance);
+String                 manageRequest(const String& request, MeshBackendBase& meshInstance);
+TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance);
+void                   networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance);
 
 /* Create the mesh node object */
 TcpIpMeshBackend tcpIpNode = TcpIpMeshBackend(manageRequest, manageResponse, networkFilter, FPSTR(exampleWiFiPassword), FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
@@ -39,13 +39,13 @@ TcpIpMeshBackend tcpIpNode = TcpIpMeshBackend(manageRequest, manageResponse, net
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
 */
-String manageRequest(const String &request, MeshBackendBase &meshInstance) {
+String manageRequest(const String& request, MeshBackendBase& meshInstance) {
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
-    (void)tcpIpInstance; // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+    (void)tcpIpInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
     Serial.print(F("TCP/IP: "));
   } else {
     Serial.print(F("UNKNOWN!: "));
@@ -69,14 +69,14 @@ String manageRequest(const String &request, MeshBackendBase &meshInstance) {
    @param meshInstance The MeshBackendBase instance that called the function.
    @return The status code resulting from the response, as an int
 */
-TransmissionStatusType manageResponse(const String &response, MeshBackendBase &meshInstance) {
+TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance) {
   TransmissionStatusType statusCode = TransmissionStatusType::TRANSMISSION_COMPLETE;
 
   // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
+  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
     String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
     Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
+  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
     Serial.print(F("TCP/IP: "));
 
     // Getting the sent message like this will work as long as ONLY(!) TCP/IP is used.
@@ -105,20 +105,20 @@ TransmissionStatusType manageResponse(const String &response, MeshBackendBase &m
    @param numberOfNetworks The number of networks found in the WiFi scan.
    @param meshInstance The MeshBackendBase instance that called the function.
 */
-void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance) {
+void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
   // Note that the network index of a given node may change whenever a new scan is done.
   for (int networkIndex = 0; networkIndex < numberOfNetworks; ++networkIndex) {
-    String currentSSID = WiFi.SSID(networkIndex);
-    int meshNameIndex = currentSSID.indexOf(meshInstance.getMeshName());
+    String currentSSID   = WiFi.SSID(networkIndex);
+    int    meshNameIndex = currentSSID.indexOf(meshInstance.getMeshName());
 
     /* Connect to any _suitable_ APs which contain meshInstance.getMeshName() */
     if (meshNameIndex >= 0) {
       uint64_t targetNodeID = TypeCast::stringToUint64(currentSSID.substring(meshNameIndex + meshInstance.getMeshName().length()));
 
       if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID())) {
-        if (EspnowMeshBackend *espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend *>(&meshInstance)) {
+        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
           espnowInstance->connectionQueue().emplace_back(networkIndex);
-        } else if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
+        } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
           tcpIpInstance->connectionQueue().emplace_back(networkIndex);
         } else {
           Serial.println(F("Invalid mesh backend!"));
@@ -139,10 +139,10 @@ void networkFilter(int numberOfNetworks, MeshBackendBase &meshInstance) {
 
    @return True if attemptTransmission should continue with the next entry in the connectionQueue. False if attemptTransmission should stop.
 */
-bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase &meshInstance) {
+bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
   // The default hook only returns true and does nothing else.
 
-  if (TcpIpMeshBackend *tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend *>(&meshInstance)) {
+  if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
     if (tcpIpInstance->latestTransmissionOutcomes().back().transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE) {
       // Our last request got a response, so time to create a new request.
       meshInstance.setMessage(String(F("Hello world request #")) + String(++requestNumber) + F(" from ")
@@ -174,8 +174,8 @@ void setup() {
 
   /* Initialise the mesh node */
   tcpIpNode.begin();
-  tcpIpNode.activateAP(); // Each AP requires a separate server port.
-  tcpIpNode.setStaticIP(IPAddress(192, 168, 4, 22)); // Activate static IP mode to speed up connection times.
+  tcpIpNode.activateAP();                             // Each AP requires a separate server port.
+  tcpIpNode.setStaticIP(IPAddress(192, 168, 4, 22));  // Activate static IP mode to speed up connection times.
 
   // Storing our message in the TcpIpMeshBackend instance is not required, but can be useful for organizing code, especially when using many TcpIpMeshBackend instances.
   // Note that calling the multi-recipient tcpIpNode.attemptTransmission will replace the stored message with whatever message is transmitted.
@@ -185,9 +185,9 @@ void setup() {
 }
 
 int32_t timeOfLastScan = -10000;
-void loop() {
-  if (millis() - timeOfLastScan > 3000 // Give other nodes some time to connect between data transfers.
-      || (WiFi.status() != WL_CONNECTED && millis() - timeOfLastScan > 2000)) { // Scan for networks with two second intervals when not already connected.
+void    loop() {
+  if (millis() - timeOfLastScan > 3000                                           // Give other nodes some time to connect between data transfers.
+      || (WiFi.status() != WL_CONNECTED && millis() - timeOfLastScan > 2000)) {  // Scan for networks with two second intervals when not already connected.
 
     // attemptTransmission(message, scan, scanAllWiFiChannels, concludingDisconnect, initialDisconnect = false)
     tcpIpNode.attemptTransmission(tcpIpNode.getMessage(), true, false, false);
@@ -202,7 +202,7 @@ void loop() {
     if (tcpIpNode.latestTransmissionOutcomes().empty()) {
       Serial.println(F("No mesh AP found."));
     } else {
-      for (TransmissionOutcome &transmissionOutcome : tcpIpNode.latestTransmissionOutcomes()) {
+      for (TransmissionOutcome& transmissionOutcome : tcpIpNode.latestTransmissionOutcomes()) {
         if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED) {
           Serial.println(String(F("Transmission failed to mesh AP ")) + transmissionOutcome.SSID());
         } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED) {
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino b/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
index 19c555a235..419330d227 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
@@ -15,13 +15,12 @@
 
 #ifndef APSSID
 #define APSSID "APSSID"
-#define APPSK  "APPSK"
+#define APPSK "APPSK"
 #endif
 
 ESP8266WiFiMulti WiFiMulti;
 
 void setup() {
-
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -37,8 +36,6 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP(APSSID, APPSK);
-
-
 }
 
 void update_started() {
@@ -57,11 +54,9 @@ void update_error(int err) {
   Serial.printf("CALLBACK:  HTTP update fatal error code %d\n", err);
 }
 
-
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
-
     WiFiClient client;
 
     // The line below is optional. It can be used to blink the LED on the board during flashing
@@ -97,4 +92,3 @@ void loop() {
     }
   }
 }
-
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
index 6541d047fd..784eea2828 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
@@ -17,11 +17,10 @@ ESP8266WiFiMulti WiFiMulti;
 
 #ifndef APSSID
 #define APSSID "APSSID"
-#define APPSK  "APPSK"
+#define APPSK "APPSK"
 #endif
 
 void setup() {
-
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -37,13 +36,11 @@ void setup() {
 
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP(APSSID, APPSK);
-
 }
 
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
-
     Serial.println("Update LittleFS...");
 
     WiFiClient client;
@@ -77,4 +74,3 @@ void loop() {
     }
   }
 }
-
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
index beb613897c..928d360716 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
@@ -18,7 +18,7 @@
 
 #ifndef APSSID
 #define APSSID "APSSID"
-#define APPSK  "APPSK"
+#define APPSK "APPSK"
 #endif
 
 ESP8266WiFiMulti WiFiMulti;
@@ -50,7 +50,6 @@ void setClock() {
 }
 
 void setup() {
-
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -74,18 +73,17 @@ void setup() {
   Serial.println(numCerts);
   if (numCerts == 0) {
     Serial.println(F("No certs found. Did you run certs-from-mozill.py and upload the LittleFS directory before running?"));
-    return; // Can't connect to anything w/o certs!
+    return;  // Can't connect to anything w/o certs!
   }
 }
 
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
-
     setClock();
 
     BearSSL::WiFiClientSecure client;
-    bool mfln = client.probeMaxFragmentLength("server", 443, 1024);  // server must be the same as in ESPhttpUpdate.update()
+    bool                      mfln = client.probeMaxFragmentLength("server", 443, 1024);  // server must be the same as in ESPhttpUpdate.update()
     Serial.printf("MFLN supported: %s\n", mfln ? "yes" : "no");
     if (mfln) {
       client.setBufferSizes(1024, 1024);
@@ -104,7 +102,6 @@ void loop() {
     // Or:
     //t_httpUpdate_return ret = ESPhttpUpdate.update(client, "server", 443, "file.bin");
 
-
     switch (ret) {
       case HTTP_UPDATE_FAILED:
         Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s\n", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
index e196ef6419..9b4adcfb5c 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
@@ -23,7 +23,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 ESP8266WiFiMulti WiFiMulti;
@@ -50,13 +50,12 @@ TQIDAQAB
 -----END PUBLIC KEY-----
 )EOF";
 #if MANUAL_SIGNING
-BearSSL::PublicKey *signPubKey = nullptr;
-BearSSL::HashSHA256 *hash;
-BearSSL::SigningVerifier *sign;
+BearSSL::PublicKey*       signPubKey = nullptr;
+BearSSL::HashSHA256*      hash;
+BearSSL::SigningVerifier* sign;
 #endif
 
 void setup() {
-
   Serial.begin(115200);
   // Serial.setDebugOutput(true);
 
@@ -73,24 +72,22 @@ void setup() {
   WiFi.mode(WIFI_STA);
   WiFiMulti.addAP(STASSID, STAPSK);
 
-  #if MANUAL_SIGNING
+#if MANUAL_SIGNING
   signPubKey = new BearSSL::PublicKey(pubkey);
-  hash = new BearSSL::HashSHA256();
-  sign = new BearSSL::SigningVerifier(signPubKey);
-  #endif
+  hash       = new BearSSL::HashSHA256();
+  sign       = new BearSSL::SigningVerifier(signPubKey);
+#endif
 }
 
-
 void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
-
     WiFiClient client;
 
-    #if MANUAL_SIGNING
+#if MANUAL_SIGNING
     // Ensure all updates are signed appropriately.  W/o this call, all will be accepted.
     Update.installSignature(hash, sign);
-    #endif
+#endif
     // If the key files are present in the build directory, signing will be
     // enabled using them automatically
 
@@ -114,4 +111,3 @@ void loop() {
   }
   delay(10000);
 }
-
diff --git a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
index f0a9de1225..de76d53816 100644
--- a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
+++ b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
@@ -31,7 +31,6 @@
 
 */
 
-
 #include <ESP8266WiFi.h>
 #include <WiFiClient.h>
 #include <ESP8266WebServer.h>
@@ -43,44 +42,41 @@
    Global defines and vars
 */
 
-#define TIMEZONE_OFFSET     1                                   // CET
-#define DST_OFFSET          1                                   // CEST
-#define UPDATE_CYCLE        (1 * 1000)                          // every second
+#define TIMEZONE_OFFSET 1        // CET
+#define DST_OFFSET 1             // CEST
+#define UPDATE_CYCLE (1 * 1000)  // every second
 
-#define SERVICE_PORT        80                                  // HTTP port
+#define SERVICE_PORT 80  // HTTP port
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char*                   ssid                    = STASSID;
-const char*                   password                = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
-char*                         pcHostDomain            = 0;        // Negotiated host domain
-bool                          bHostDomainConfirmed    = false;    // Flags the confirmation of the host domain
-MDNSResponder::hMDNSService   hMDNSService            = 0;        // The handle of the clock service in the MDNS responder
+char*                       pcHostDomain         = 0;      // Negotiated host domain
+bool                        bHostDomainConfirmed = false;  // Flags the confirmation of the host domain
+MDNSResponder::hMDNSService hMDNSService         = 0;      // The handle of the clock service in the MDNS responder
 
 // HTTP server at port 'SERVICE_PORT' will respond to HTTP requests
-ESP8266WebServer              server(SERVICE_PORT);
+ESP8266WebServer server(SERVICE_PORT);
 
 /*
    getTimeString
 */
 const char* getTimeString(void) {
-
-  static char   acTimeString[32];
-  time_t now = time(nullptr);
+  static char acTimeString[32];
+  time_t      now = time(nullptr);
   ctime_r(&now, acTimeString);
-  size_t    stLength;
-  while (((stLength = strlen(acTimeString))) &&
-         ('\n' == acTimeString[stLength - 1])) {
-    acTimeString[stLength - 1] = 0; // Remove trailing line break...
+  size_t stLength;
+  while (((stLength = strlen(acTimeString))) && ('\n' == acTimeString[stLength - 1])) {
+    acTimeString[stLength - 1] = 0;  // Remove trailing line break...
   }
   return acTimeString;
 }
 
-
 /*
    setClock
 
@@ -100,12 +96,10 @@ void setClock(void) {
   Serial.printf("Current time: %s\n", getTimeString());
 }
 
-
 /*
    setStationHostname
 */
 bool setStationHostname(const char* p_pcHostname) {
-
   if (p_pcHostname) {
     WiFi.hostname(p_pcHostname);
     Serial.printf("setDeviceHostname: Station hostname is set to '%s'\n", p_pcHostname);
@@ -113,7 +107,6 @@ bool setStationHostname(const char* p_pcHostname) {
   return true;
 }
 
-
 /*
    MDNSDynamicServiceTxtCallback
 
@@ -132,7 +125,6 @@ void MDNSDynamicServiceTxtCallback(const MDNSResponder::hMDNSService p_hService)
   }
 }
 
-
 /*
    MDNSProbeResultCallback
 
@@ -144,7 +136,6 @@ void MDNSDynamicServiceTxtCallback(const MDNSResponder::hMDNSService p_hService)
 
 */
 void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
-
   Serial.println("MDNSProbeResultCallback");
   Serial.printf("MDNSProbeResultCallback: Host domain '%s.local' is %s\n", p_pcDomainName.c_str(), (p_bProbeResult ? "free" : "already USED!"));
   if (true == p_bProbeResult) {
@@ -176,7 +167,6 @@ void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
   }
 }
 
-
 /*
    handleHTTPClient
 */
@@ -186,7 +176,8 @@ void handleHTTPRequest() {
   Serial.println("HTTP Request");
 
   // Get current time
-  time_t now = time(nullptr);;
+  time_t now = time(nullptr);
+  ;
   struct tm timeinfo;
   gmtime_r(&now, &timeinfo);
 
@@ -231,10 +222,9 @@ void setup(void) {
   // Setup MDNS responder
   MDNS.setHostProbeResultCallback(hostProbeResult);
   // Init the (currently empty) host domain string with 'esp8266'
-  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) ||
-      (!MDNS.begin(pcHostDomain))) {
+  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) || (!MDNS.begin(pcHostDomain))) {
     Serial.println("Error setting up MDNS responder!");
-    while (1) { // STOP
+    while (1) {  // STOP
       delay(1000);
     }
   }
@@ -250,7 +240,6 @@ void setup(void) {
    loop
 */
 void loop(void) {
-
   // Check if a request has come in
   server.handleClient();
   // Allow MDNS processing
@@ -258,7 +247,6 @@ void loop(void) {
 
   static esp8266::polledTimeout::periodicMs timeout(UPDATE_CYCLE);
   if (timeout.expired()) {
-
     if (hMDNSService) {
       // Just trigger a new MDNS announcement, this will lead to a call to
       // 'MDNSDynamicServiceTxtCallback', which will update the time TXT item
diff --git a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
index 17b29ec57c..0da915d45d 100644
--- a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
+++ b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
@@ -29,7 +29,6 @@
 
 */
 
-
 #include <ESP8266WiFi.h>
 #include <WiFiClient.h>
 #include <ESP8266WebServer.h>
@@ -39,33 +38,31 @@
    Global defines and vars
 */
 
-#define SERVICE_PORT                                    80                                  // HTTP port
+#define SERVICE_PORT 80  // HTTP port
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char*                                    ssid                    = STASSID;
-const char*                                    password                = STAPSK;
+const char* ssid     = STASSID;
+const char* password = STAPSK;
 
-char*                                          pcHostDomain            = 0;        // Negotiated host domain
-bool                                           bHostDomainConfirmed    = false;    // Flags the confirmation of the host domain
-MDNSResponder::hMDNSService                    hMDNSService            = 0;        // The handle of the http service in the MDNS responder
-MDNSResponder::hMDNSServiceQuery               hMDNSServiceQuery       = 0;        // The handle of the 'http.tcp' service query in the MDNS responder
+char*                            pcHostDomain         = 0;      // Negotiated host domain
+bool                             bHostDomainConfirmed = false;  // Flags the confirmation of the host domain
+MDNSResponder::hMDNSService      hMDNSService         = 0;      // The handle of the http service in the MDNS responder
+MDNSResponder::hMDNSServiceQuery hMDNSServiceQuery    = 0;      // The handle of the 'http.tcp' service query in the MDNS responder
 
-const String                                   cstrNoHTTPServices      = "Currently no 'http.tcp' services in the local network!<br/>";
-String                                         strHTTPServices         = cstrNoHTTPServices;
+const String cstrNoHTTPServices = "Currently no 'http.tcp' services in the local network!<br/>";
+String       strHTTPServices    = cstrNoHTTPServices;
 
 // HTTP server at port 'SERVICE_PORT' will respond to HTTP requests
-ESP8266WebServer                                     server(SERVICE_PORT);
-
+ESP8266WebServer server(SERVICE_PORT);
 
 /*
    setStationHostname
 */
 bool setStationHostname(const char* p_pcHostname) {
-
   if (p_pcHostname) {
     WiFi.hostname(p_pcHostname);
     Serial.printf("setStationHostname: Station hostname is set to '%s'\n", p_pcHostname);
@@ -80,25 +77,25 @@ bool setStationHostname(const char* p_pcHostname) {
 void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSResponder::AnswerType answerType, bool p_bSetContent) {
   String answerInfo;
   switch (answerType) {
-    case MDNSResponder::AnswerType::ServiceDomain :
+    case MDNSResponder::AnswerType::ServiceDomain:
       answerInfo = "ServiceDomain " + String(serviceInfo.serviceDomain());
       break;
-    case MDNSResponder::AnswerType::HostDomainAndPort :
+    case MDNSResponder::AnswerType::HostDomainAndPort:
       answerInfo = "HostDomainAndPort " + String(serviceInfo.hostDomain()) + ":" + String(serviceInfo.hostPort());
       break;
-    case MDNSResponder::AnswerType::IP4Address :
+    case MDNSResponder::AnswerType::IP4Address:
       answerInfo = "IP4Address ";
       for (IPAddress ip : serviceInfo.IP4Adresses()) {
         answerInfo += "- " + ip.toString();
       };
       break;
-    case MDNSResponder::AnswerType::Txt :
+    case MDNSResponder::AnswerType::Txt:
       answerInfo = "TXT " + String(serviceInfo.strKeyValue());
       for (auto kv : serviceInfo.keyValues()) {
         answerInfo += "\nkv : " + String(kv.first) + " : " + String(kv.second);
       }
       break;
-    default :
+    default:
       answerInfo = "Unknown Answertype";
   }
   Serial.printf("Answer %s %s\n", answerInfo.c_str(), p_bSetContent ? "Modified" : "Deleted");
@@ -109,10 +106,10 @@ void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSRe
    Probe result callback for Services
 */
 
-void serviceProbeResult(String p_pcServiceName,
+void serviceProbeResult(String                            p_pcServiceName,
                         const MDNSResponder::hMDNSService p_hMDNSService,
-                        bool p_bProbeResult) {
-  (void) p_hMDNSService;
+                        bool                              p_bProbeResult) {
+  (void)p_hMDNSService;
   Serial.printf("MDNSServiceProbeResultCallback: Service %s probe %s\n", p_pcServiceName.c_str(), (p_bProbeResult ? "succeeded." : "failed!"));
 }
 
@@ -128,7 +125,6 @@ void serviceProbeResult(String p_pcServiceName,
 */
 
 void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
-
   Serial.printf("MDNSHostProbeResultCallback: Host domain '%s.local' is %s\n", p_pcDomainName.c_str(), (p_bProbeResult ? "free" : "already USED!"));
 
   if (true == p_bProbeResult) {
@@ -180,13 +176,13 @@ void handleHTTPRequest() {
   Serial.println("");
   Serial.println("HTTP Request");
 
-  IPAddress ip = WiFi.localIP();
-  String ipStr = ip.toString();
-  String s = "<!DOCTYPE HTML>\r\n<html><h3><head>Hello from ";
+  IPAddress ip    = WiFi.localIP();
+  String    ipStr = ip.toString();
+  String    s     = "<!DOCTYPE HTML>\r\n<html><h3><head>Hello from ";
   s += WiFi.hostname() + ".local at " + WiFi.localIP().toString() + "</h3></head>";
   s += "<br/><h4>Local HTTP services are :</h4>";
   s += "<ol>";
-  for (auto info :  MDNS.answerInfo(hMDNSServiceQuery)) {
+  for (auto info : MDNS.answerInfo(hMDNSServiceQuery)) {
     s += "<li>";
     s += info.serviceDomain();
     if (info.hostDomainAvailable()) {
@@ -245,10 +241,9 @@ void setup(void) {
   MDNS.setHostProbeResultCallback(hostProbeResult);
 
   // Init the (currently empty) host domain string with 'esp8266'
-  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) ||
-      (!MDNS.begin(pcHostDomain))) {
+  if ((!MDNSResponder::indexDomain(pcHostDomain, 0, "esp8266")) || (!MDNS.begin(pcHostDomain))) {
     Serial.println(" Error setting up MDNS responder!");
-    while (1) { // STOP
+    while (1) {  // STOP
       delay(1000);
     }
   }
@@ -265,6 +260,3 @@ void loop(void) {
   // Allow MDNS processing
   MDNS.update();
 }
-
-
-
diff --git a/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino b/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
index 87d03900f3..290fef2938 100644
--- a/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
+++ b/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
@@ -14,12 +14,12 @@
 
 #ifndef APSSID
 #define APSSID "your-apssid"
-#define APPSK  "your-password"
+#define APPSK "your-password"
 #endif
 
 #ifndef STASSID
 #define STASSID "your-sta"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 // includes
@@ -30,20 +30,19 @@
 #include <ArduinoOTA.h>
 #include <ESP8266mDNS.h>
 
-
 /**
    @brief mDNS and OTA Constants
    @{
 */
-#define HOSTNAME "ESP8266-OTA-" ///< Hostname. The setup function adds the Chip ID at the end.
+#define HOSTNAME "ESP8266-OTA-"  ///< Hostname. The setup function adds the Chip ID at the end.
 /// @}
 
 /**
    @brief Default WiFi connection information.
    @{
 */
-const char* ap_default_ssid = APSSID; ///< Default SSID.
-const char* ap_default_psk = APPSK; ///< Default PSK.
+const char* ap_default_ssid = APSSID;  ///< Default SSID.
+const char* ap_default_psk  = APPSK;   ///< Default PSK.
 /// @}
 
 /// Uncomment the next line for verbose output over UART.
@@ -59,7 +58,7 @@ const char* ap_default_psk = APPSK; ///< Default PSK.
    and the WiFi PSK in the second line.
    Line separator can be \r\n (CR LF) \r or \n.
 */
-bool loadConfig(String *ssid, String *pass) {
+bool loadConfig(String* ssid, String* pass) {
   // open file for reading.
   File configFile = LittleFS.open("/cl_conf.txt", "r");
   if (!configFile) {
@@ -75,11 +74,11 @@ bool loadConfig(String *ssid, String *pass) {
   content.trim();
 
   // Check if there is a second line available.
-  int8_t pos = content.indexOf("\r\n");
-  uint8_t le = 2;
+  int8_t  pos = content.indexOf("\r\n");
+  uint8_t le  = 2;
   // check for linux and mac line ending.
   if (pos == -1) {
-    le = 1;
+    le  = 1;
     pos = content.indexOf("\n");
     if (pos == -1) {
       pos = content.indexOf("\r");
@@ -110,8 +109,7 @@ bool loadConfig(String *ssid, String *pass) {
 #endif
 
   return true;
-} // loadConfig
-
+}  // loadConfig
 
 /**
    @brief Save WiFi SSID and PSK to configuration file.
@@ -119,7 +117,7 @@ bool loadConfig(String *ssid, String *pass) {
    @param pass PSK as string pointer,
    @return True or False.
 */
-bool saveConfig(String *ssid, String *pass) {
+bool saveConfig(String* ssid, String* pass) {
   // Open config file for writing.
   File configFile = LittleFS.open("/cl_conf.txt", "w");
   if (!configFile) {
@@ -135,15 +133,14 @@ bool saveConfig(String *ssid, String *pass) {
   configFile.close();
 
   return true;
-} // saveConfig
-
+}  // saveConfig
 
 /**
    @brief Arduino setup function.
 */
 void setup() {
   String station_ssid = "";
-  String station_psk = "";
+  String station_psk  = "";
 
   Serial.begin(115200);
 
@@ -162,7 +159,6 @@ void setup() {
   Serial.println("Hostname: " + hostname);
   //Serial.println(WiFi.hostname());
 
-
   // Initialize file system.
   if (!LittleFS.begin()) {
     Serial.println("Failed to mount file system");
@@ -170,9 +166,9 @@ void setup() {
   }
 
   // Load wifi connection information.
-  if (! loadConfig(&station_ssid, &station_psk)) {
+  if (!loadConfig(&station_ssid, &station_psk)) {
     station_ssid = STASSID;
-    station_psk = STAPSK;
+    station_psk  = STAPSK;
 
     Serial.println("No WiFi connection information available.");
   }
@@ -233,11 +229,10 @@ void setup() {
   }
 
   // Start OTA server.
-  ArduinoOTA.setHostname((const char *)hostname.c_str());
+  ArduinoOTA.setHostname((const char*)hostname.c_str());
   ArduinoOTA.begin();
 }
 
-
 /**
    @brief Arduino loop function.
 */
@@ -245,4 +240,3 @@ void loop() {
   // Handle OTA server.
   ArduinoOTA.handle();
 }
-
diff --git a/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino b/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
index e85714d821..ea3cbbd699 100644
--- a/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
+++ b/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
@@ -15,17 +15,16 @@
 
 */
 
-
 #include <ESP8266WiFi.h>
 #include <ESP8266mDNS.h>
 #include <WiFiClient.h>
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 // TCP server at port 80 will respond to HTTP requests
@@ -72,7 +71,6 @@ void setup(void) {
 }
 
 void loop(void) {
-
   MDNS.update();
 
   // Check if a client has connected
@@ -94,7 +92,7 @@ void loop(void) {
   // First line of HTTP request looks like "GET /path HTTP/1.1"
   // Retrieve the "/path" part by finding the spaces
   int addr_start = req.indexOf(' ');
-  int addr_end = req.indexOf(' ', addr_start + 1);
+  int addr_end   = req.indexOf(' ', addr_start + 1);
   if (addr_start == -1 || addr_end == -1) {
     Serial.print("Invalid request: ");
     Serial.println(req);
@@ -107,9 +105,9 @@ void loop(void) {
 
   String s;
   if (req == "/") {
-    IPAddress ip = WiFi.localIP();
-    String ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);
-    s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>Hello from ESP8266 at ";
+    IPAddress ip    = WiFi.localIP();
+    String    ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);
+    s               = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>Hello from ESP8266 at ";
     s += ipStr;
     s += "</html>\r\n\r\n";
     Serial.println("Sending 200");
@@ -121,4 +119,3 @@ void loop(void) {
 
   Serial.println("Done with client");
 }
-
diff --git a/libraries/ESP8266mDNS/src/ESP8266mDNS.cpp b/libraries/ESP8266mDNS/src/ESP8266mDNS.cpp
index b5d7aac277..821b7010af 100644
--- a/libraries/ESP8266mDNS/src/ESP8266mDNS.cpp
+++ b/libraries/ESP8266mDNS/src/ESP8266mDNS.cpp
@@ -30,4 +30,3 @@
 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_MDNS)
 MDNSResponder MDNS;
 #endif
-
diff --git a/libraries/ESP8266mDNS/src/ESP8266mDNS.h b/libraries/ESP8266mDNS/src/ESP8266mDNS.h
index 8b035a7986..3b6ccc6449 100644
--- a/libraries/ESP8266mDNS/src/ESP8266mDNS.h
+++ b/libraries/ESP8266mDNS/src/ESP8266mDNS.h
@@ -41,13 +41,13 @@
 #ifndef __ESP8266MDNS_H
 #define __ESP8266MDNS_H
 
-#include "LEAmDNS.h"            // LEA
+#include "LEAmDNS.h"  // LEA
 
 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_MDNS)
 // Maps the implementation to use to the global namespace type
-using MDNSResponder = esp8266::MDNSImplementation::MDNSResponder;                // LEA
+using MDNSResponder = esp8266::MDNSImplementation::MDNSResponder;  // LEA
 
 extern MDNSResponder MDNS;
 #endif
 
-#endif // __ESP8266MDNS_H
+#endif  // __ESP8266MDNS_H
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.cpp b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
index 4908a67e06..56e0568edc 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
@@ -27,19 +27,17 @@
 
 #include "ESP8266mDNS.h"
 #include "LEAmDNS_Priv.h"
-#include <LwipIntf.h> // LwipIntf::stateUpCB()
+#include <LwipIntf.h>  // LwipIntf::stateUpCB()
 #include <lwip/igmp.h>
 #include <lwip/prot/dns.h>
 
 namespace esp8266
 {
-
 /*
     LEAmDNS
 */
 namespace MDNSImplementation
 {
-
 /**
     STRINGIZE
 */
@@ -50,37 +48,35 @@ namespace MDNSImplementation
 #define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
 #endif
 
-
-/**
+    /**
     INTERFACE
 */
 
-/**
+    /**
     MDNSResponder::MDNSResponder
 */
-MDNSResponder::MDNSResponder(void)
-    :   m_pServices(0),
+    MDNSResponder::MDNSResponder(void) :
+        m_pServices(0),
         m_pUDPContext(0),
         m_pcHostname(0),
         m_pServiceQueries(0),
         m_fnServiceTxtCallback(0)
-{
-}
+    {
+    }
 
-/*
+    /*
     MDNSResponder::~MDNSResponder
 */
-MDNSResponder::~MDNSResponder(void)
-{
-
-    _resetProbeStatus(false);
-    _releaseServiceQueries();
-    _releaseHostname();
-    _releaseUDPContext();
-    _releaseServices();
-}
+    MDNSResponder::~MDNSResponder(void)
+    {
+        _resetProbeStatus(false);
+        _releaseServiceQueries();
+        _releaseHostname();
+        _releaseUDPContext();
+        _releaseServices();
+    }
 
-/*
+    /*
     MDNSResponder::begin
 
     Set the host domain (for probing) and install WiFi event handlers for
@@ -89,62 +85,60 @@ MDNSResponder::~MDNSResponder(void)
     Finally the responder is (re)started
 
 */
-bool MDNSResponder::begin(const char* p_pcHostname, const IPAddress& /*p_IPAddress*/, uint32_t /*p_u32TTL*/)
-{
-    bool    bResult = false;
-
-    if (_setHostname(p_pcHostname))
+    bool MDNSResponder::begin(const char* p_pcHostname, const IPAddress& /*p_IPAddress*/, uint32_t /*p_u32TTL*/)
     {
-        bResult = _restart();
-    }
+        bool bResult = false;
 
-    LwipIntf::stateUpCB
-    (
-        [this](netif * intf)
-    {
-        (void)intf;
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] new Interface '%c%c' is UP! restarting\n"), intf->name[0], intf->name[1]));
-        _restart();
-    }
-    );
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] begin: FAILED for '%s'!\n"), (p_pcHostname ? : "-"));
-    });
+        if (_setHostname(p_pcHostname))
+        {
+            bResult = _restart();
+        }
 
-    return bResult;
-}
+        LwipIntf::stateUpCB(
+            [this](netif* intf)
+            {
+                (void)intf;
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] new Interface '%c%c' is UP! restarting\n"), intf->name[0], intf->name[1]));
+                _restart();
+            });
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] begin: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
+                     });
+
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::close
 
     Ends the MDNS responder.
     Announced services are unannounced (by multicasting a goodbye message)
 
 */
-bool MDNSResponder::close(void)
-{
-    bool    bResult = false;
-
-    if (0 != m_pUDPContext)
+    bool MDNSResponder::close(void)
     {
-        _announce(false, true);
-        _resetProbeStatus(false);   // Stop probing
-        _releaseServiceQueries();
-        _releaseServices();
-        _releaseUDPContext();
-        _releaseHostname();
+        bool bResult = false;
 
-        bResult = true;
-    }
-    else
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] close: Ignoring call to close!\n")););
+        if (0 != m_pUDPContext)
+        {
+            _announce(false, true);
+            _resetProbeStatus(false);  // Stop probing
+            _releaseServiceQueries();
+            _releaseServices();
+            _releaseUDPContext();
+            _releaseHostname();
+
+            bResult = true;
+        }
+        else
+        {
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] close: Ignoring call to close!\n")););
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::end
 
     Ends the MDNS responder.
@@ -152,12 +146,12 @@ bool MDNSResponder::close(void)
 
 */
 
-bool MDNSResponder::end(void)
-{
-    return close();
-}
+    bool MDNSResponder::end(void)
+    {
+        return close();
+    }
 
-/*
+    /*
     MDNSResponder::setHostname
 
     Replaces the current hostname and restarts probing.
@@ -165,48 +159,45 @@ bool MDNSResponder::end(void)
     name), the instance names are replaced also (and the probing is restarted).
 
 */
-bool MDNSResponder::setHostname(const char* p_pcHostname)
-{
-
-    bool    bResult = false;
-
-    if (_setHostname(p_pcHostname))
+    bool MDNSResponder::setHostname(const char* p_pcHostname)
     {
-        m_HostProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
+        bool bResult = false;
 
-        // Replace 'auto-set' service names
-        bResult = true;
-        for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+        if (_setHostname(p_pcHostname))
         {
-            if (pService->m_bAutoName)
+            m_HostProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
+
+            // Replace 'auto-set' service names
+            bResult = true;
+            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
             {
-                bResult = pService->setName(p_pcHostname);
-                pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
+                if (pService->m_bAutoName)
+                {
+                    bResult                                      = pService->setName(p_pcHostname);
+                    pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
+                }
             }
         }
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setHostname: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
+                     });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setHostname: FAILED for '%s'!\n"), (p_pcHostname ? : "-"));
-    });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::setHostname (LEGACY)
 */
-bool MDNSResponder::setHostname(const String& p_strHostname)
-{
-
-    return setHostname(p_strHostname.c_str());
-}
-
+    bool MDNSResponder::setHostname(const String& p_strHostname)
+    {
+        return setHostname(p_strHostname.c_str());
+    }
 
-/*
+    /*
     SERVICES
 */
 
-/*
+    /*
     MDNSResponder::addService
 
     Add service; using hostname if no name is explicitly provided for the service
@@ -214,466 +205,447 @@ bool MDNSResponder::setHostname(const String& p_strHostname)
     may be given. If not, it is added automatically.
 
 */
-MDNSResponder::hMDNSService MDNSResponder::addService(const char* p_pcName,
-        const char* p_pcService,
-        const char* p_pcProtocol,
-        uint16_t p_u16Port)
-{
-
-    hMDNSService    hResult = 0;
-
-    if (((!p_pcName) ||                                                     // NO name OR
-            (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcName))) &&           // Fitting name
-            (p_pcService) &&
-            (MDNS_SERVICE_NAME_LENGTH >= os_strlen(p_pcService)) &&
-            (p_pcProtocol) &&
-            ((MDNS_SERVICE_PROTOCOL_LENGTH - 1) != os_strlen(p_pcProtocol)) &&
-            (p_u16Port))
+    MDNSResponder::hMDNSService MDNSResponder::addService(const char* p_pcName,
+                                                          const char* p_pcService,
+                                                          const char* p_pcProtocol,
+                                                          uint16_t    p_u16Port)
     {
+        hMDNSService hResult = 0;
 
-        if (!_findService((p_pcName ? : m_pcHostname), p_pcService, p_pcProtocol))  // Not already used
+        if (((!p_pcName) ||  // NO name OR
+             (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcName)))
+            &&  // Fitting name
+            (p_pcService) && (MDNS_SERVICE_NAME_LENGTH >= os_strlen(p_pcService)) && (p_pcProtocol) && ((MDNS_SERVICE_PROTOCOL_LENGTH - 1) != os_strlen(p_pcProtocol)) && (p_u16Port))
         {
-            if (0 != (hResult = (hMDNSService)_allocService(p_pcName, p_pcService, p_pcProtocol, p_u16Port)))
+            if (!_findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol))  // Not already used
             {
-
-                // Start probing
-                ((stcMDNSService*)hResult)->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
+                if (0 != (hResult = (hMDNSService)_allocService(p_pcName, p_pcService, p_pcProtocol, p_u16Port)))
+                {
+                    // Start probing
+                    ((stcMDNSService*)hResult)->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
+                }
             }
-        }
-    }   // else: bad arguments
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: %s to add '%s.%s.%s'!\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcName ? : "-"), p_pcService, p_pcProtocol););
-    DEBUG_EX_ERR(if (!hResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: FAILED to add '%s.%s.%s'!\n"), (p_pcName ? : "-"), p_pcService, p_pcProtocol);
-    });
-    return hResult;
-}
+        }  // else: bad arguments
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: %s to add '%s.%s.%s'!\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcName ?: "-"), p_pcService, p_pcProtocol););
+        DEBUG_EX_ERR(if (!hResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: FAILED to add '%s.%s.%s'!\n"), (p_pcName ?: "-"), p_pcService, p_pcProtocol);
+                     });
+        return hResult;
+    }
 
-/*
+    /*
     MDNSResponder::removeService
 
     Unanounce a service (by sending a goodbye message) and remove it
     from the MDNS responder
 
 */
-bool MDNSResponder::removeService(const MDNSResponder::hMDNSService p_hService)
-{
-
-    stcMDNSService* pService = 0;
-    bool    bResult = (((pService = _findService(p_hService))) &&
-                       (_announceService(*pService, false)) &&
-                       (_releaseService(pService)));
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeService: FAILED!\n"));
-    });
-    return bResult;
-}
+    bool MDNSResponder::removeService(const MDNSResponder::hMDNSService p_hService)
+    {
+        stcMDNSService* pService = 0;
+        bool            bResult  = (((pService = _findService(p_hService))) && (_announceService(*pService, false)) && (_releaseService(pService)));
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeService: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::removeService
 */
-bool MDNSResponder::removeService(const char* p_pcName,
-                                  const char* p_pcService,
-                                  const char* p_pcProtocol)
-{
-
-    return removeService((hMDNSService)_findService((p_pcName ? : m_pcHostname), p_pcService, p_pcProtocol));
-}
+    bool MDNSResponder::removeService(const char* p_pcName,
+                                      const char* p_pcService,
+                                      const char* p_pcProtocol)
+    {
+        return removeService((hMDNSService)_findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol));
+    }
 
-/*
+    /*
     MDNSResponder::addService (LEGACY)
 */
-bool MDNSResponder::addService(const String& p_strService,
-                               const String& p_strProtocol,
-                               uint16_t p_u16Port)
-{
-
-    return (0 != addService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str(), p_u16Port));
-}
+    bool MDNSResponder::addService(const String& p_strService,
+                                   const String& p_strProtocol,
+                                   uint16_t      p_u16Port)
+    {
+        return (0 != addService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str(), p_u16Port));
+    }
 
-/*
+    /*
     MDNSResponder::setServiceName
 */
-bool MDNSResponder::setServiceName(const MDNSResponder::hMDNSService p_hService,
-                                   const char* p_pcInstanceName)
-{
-
-    stcMDNSService* pService = 0;
-    bool    bResult = (((!p_pcInstanceName) ||
-                        (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcInstanceName))) &&
-                       ((pService = _findService(p_hService))) &&
-                       (pService->setName(p_pcInstanceName)) &&
-                       ((pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart)));
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setServiceName: FAILED for '%s'!\n"), (p_pcInstanceName ? : "-"));
-    });
-    return bResult;
-}
+    bool MDNSResponder::setServiceName(const MDNSResponder::hMDNSService p_hService,
+                                       const char*                       p_pcInstanceName)
+    {
+        stcMDNSService* pService = 0;
+        bool            bResult  = (((!p_pcInstanceName) || (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcInstanceName))) && ((pService = _findService(p_hService))) && (pService->setName(p_pcInstanceName)) && ((pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart)));
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setServiceName: FAILED for '%s'!\n"), (p_pcInstanceName ?: "-"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     SERVICE TXT
 */
 
-/*
+    /*
     MDNSResponder::addServiceTxt
 
     Add a static service TXT item ('Key'='Value') to a service.
 
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        const char* p_pcValue)
-{
-
-    hMDNSTxt    hTxt = 0;
-    stcMDNSService* pService = _findService(p_hService);
-    if (pService)
+    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+                                                         const char*                       p_pcKey,
+                                                         const char*                       p_pcValue)
     {
-        hTxt = (hMDNSTxt)_addServiceTxt(pService, p_pcKey, p_pcValue, false);
+        hMDNSTxt        hTxt     = 0;
+        stcMDNSService* pService = _findService(p_hService);
+        if (pService)
+        {
+            hTxt = (hMDNSTxt)_addServiceTxt(pService, p_pcKey, p_pcValue, false);
+        }
+        DEBUG_EX_ERR(if (!hTxt)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
+                     });
+        return hTxt;
     }
-    DEBUG_EX_ERR(if (!hTxt)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ? : "-"), (p_pcValue ? : "-"));
-    });
-    return hTxt;
-}
 
-/*
+    /*
     MDNSResponder::addServiceTxt (uint32_t)
 
     Formats: http://www.cplusplus.com/reference/cstdio/printf/
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint32_t p_u32Value)
-{
-    char    acBuffer[32];   *acBuffer = 0;
-    sprintf(acBuffer, "%u", p_u32Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+                                                         const char*                       p_pcKey,
+                                                         uint32_t                          p_u32Value)
+    {
+        char acBuffer[32];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%u", p_u32Value);
 
-    return addServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addServiceTxt (uint16_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint16_t p_u16Value)
-{
-    char    acBuffer[16];   *acBuffer = 0;
-    sprintf(acBuffer, "%hu", p_u16Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+                                                         const char*                       p_pcKey,
+                                                         uint16_t                          p_u16Value)
+    {
+        char acBuffer[16];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hu", p_u16Value);
 
-    return addServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addServiceTxt (uint8_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint8_t p_u8Value)
-{
-    char    acBuffer[8];    *acBuffer = 0;
-    sprintf(acBuffer, "%hhu", p_u8Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+                                                         const char*                       p_pcKey,
+                                                         uint8_t                           p_u8Value)
+    {
+        char acBuffer[8];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hhu", p_u8Value);
 
-    return addServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addServiceTxt (int32_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int32_t p_i32Value)
-{
-    char    acBuffer[32];   *acBuffer = 0;
-    sprintf(acBuffer, "%i", p_i32Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+                                                         const char*                       p_pcKey,
+                                                         int32_t                           p_i32Value)
+    {
+        char acBuffer[32];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%i", p_i32Value);
 
-    return addServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addServiceTxt (int16_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int16_t p_i16Value)
-{
-    char    acBuffer[16];   *acBuffer = 0;
-    sprintf(acBuffer, "%hi", p_i16Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+                                                         const char*                       p_pcKey,
+                                                         int16_t                           p_i16Value)
+    {
+        char acBuffer[16];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hi", p_i16Value);
 
-    return addServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addServiceTxt (int8_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int8_t p_i8Value)
-{
-    char    acBuffer[8];    *acBuffer = 0;
-    sprintf(acBuffer, "%hhi", p_i8Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
+                                                         const char*                       p_pcKey,
+                                                         int8_t                            p_i8Value)
+    {
+        char acBuffer[8];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hhi", p_i8Value);
 
-    return addServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::removeServiceTxt
 
     Remove a static service TXT item from a service.
 */
-bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                     const MDNSResponder::hMDNSTxt p_hTxt)
-{
-
-    bool    bResult = false;
-
-    stcMDNSService* pService = _findService(p_hService);
-    if (pService)
+    bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
+                                         const MDNSResponder::hMDNSTxt     p_hTxt)
     {
-        stcMDNSServiceTxt*  pTxt = _findServiceTxt(pService, p_hTxt);
-        if (pTxt)
+        bool bResult = false;
+
+        stcMDNSService* pService = _findService(p_hService);
+        if (pService)
         {
-            bResult = _releaseServiceTxt(pService, pTxt);
+            stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_hTxt);
+            if (pTxt)
+            {
+                bResult = _releaseServiceTxt(pService, pTxt);
+            }
         }
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED!\n"));
+                     });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED!\n"));
-    });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::removeServiceTxt
 */
-bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                     const char* p_pcKey)
-{
-
-    bool    bResult = false;
-
-    stcMDNSService* pService = _findService(p_hService);
-    if (pService)
+    bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
+                                         const char*                       p_pcKey)
     {
-        stcMDNSServiceTxt*  pTxt = _findServiceTxt(pService, p_pcKey);
-        if (pTxt)
+        bool bResult = false;
+
+        stcMDNSService* pService = _findService(p_hService);
+        if (pService)
         {
-            bResult = _releaseServiceTxt(pService, pTxt);
+            stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_pcKey);
+            if (pTxt)
+            {
+                bResult = _releaseServiceTxt(pService, pTxt);
+            }
         }
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED for '%s'!\n"), (p_pcKey ?: "-"));
+                     });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED for '%s'!\n"), (p_pcKey ? : "-"));
-    });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::removeServiceTxt
 */
-bool MDNSResponder::removeServiceTxt(const char* p_pcName,
-                                     const char* p_pcService,
-                                     const char* p_pcProtocol,
-                                     const char* p_pcKey)
-{
-
-    bool    bResult = false;
-
-    stcMDNSService* pService = _findService((p_pcName ? : m_pcHostname), p_pcService, p_pcProtocol);
-    if (pService)
+    bool MDNSResponder::removeServiceTxt(const char* p_pcName,
+                                         const char* p_pcService,
+                                         const char* p_pcProtocol,
+                                         const char* p_pcKey)
     {
-        stcMDNSServiceTxt*  pTxt = _findServiceTxt(pService, p_pcKey);
-        if (pTxt)
+        bool bResult = false;
+
+        stcMDNSService* pService = _findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol);
+        if (pService)
         {
-            bResult = _releaseServiceTxt(pService, pTxt);
+            stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_pcKey);
+            if (pTxt)
+            {
+                bResult = _releaseServiceTxt(pService, pTxt);
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::addServiceTxt (LEGACY)
 */
-bool MDNSResponder::addServiceTxt(const char* p_pcService,
-                                  const char* p_pcProtocol,
-                                  const char* p_pcKey,
-                                  const char* p_pcValue)
-{
-
-    return (0 != _addServiceTxt(_findService(m_pcHostname, p_pcService, p_pcProtocol), p_pcKey, p_pcValue, false));
-}
+    bool MDNSResponder::addServiceTxt(const char* p_pcService,
+                                      const char* p_pcProtocol,
+                                      const char* p_pcKey,
+                                      const char* p_pcValue)
+    {
+        return (0 != _addServiceTxt(_findService(m_pcHostname, p_pcService, p_pcProtocol), p_pcKey, p_pcValue, false));
+    }
 
-/*
+    /*
     MDNSResponder::addServiceTxt (LEGACY)
 */
-bool MDNSResponder::addServiceTxt(const String& p_strService,
-                                  const String& p_strProtocol,
-                                  const String& p_strKey,
-                                  const String& p_strValue)
-{
-
-    return (0 != _addServiceTxt(_findService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str()), p_strKey.c_str(), p_strValue.c_str(), false));
-}
+    bool MDNSResponder::addServiceTxt(const String& p_strService,
+                                      const String& p_strProtocol,
+                                      const String& p_strKey,
+                                      const String& p_strValue)
+    {
+        return (0 != _addServiceTxt(_findService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str()), p_strKey.c_str(), p_strValue.c_str(), false));
+    }
 
-/*
+    /*
     MDNSResponder::setDynamicServiceTxtCallback (global)
 
     Set a global callback for dynamic service TXT items. The callback is called, whenever
     service TXT items are needed.
 
 */
-bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
-{
-
-    m_fnServiceTxtCallback = p_fnCallback;
+    bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
+    {
+        m_fnServiceTxtCallback = p_fnCallback;
 
-    return true;
-}
+        return true;
+    }
 
-/*
+    /*
     MDNSResponder::setDynamicServiceTxtCallback (service specific)
 
     Set a service specific callback for dynamic service TXT items. The callback is called, whenever
     service TXT items are needed for the given service.
 
 */
-bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::hMDNSService p_hService,
-        MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
-{
-
-    bool    bResult = false;
-
-    stcMDNSService* pService = _findService(p_hService);
-    if (pService)
+    bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::hMDNSService                      p_hService,
+                                                     MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
     {
-        pService->m_fnTxtCallback = p_fnCallback;
+        bool bResult = false;
+
+        stcMDNSService* pService = _findService(p_hService);
+        if (pService)
+        {
+            pService->m_fnTxtCallback = p_fnCallback;
 
-        bResult = true;
+            bResult = true;
+        }
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setDynamicServiceTxtCallback: FAILED!\n"));
+                     });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setDynamicServiceTxtCallback: FAILED!\n"));
-    });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::addDynamicServiceTxt
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        const char* p_pcValue)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt (%s=%s)\n"), p_pcKey, p_pcValue););
+    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+                                                                const char*                 p_pcKey,
+                                                                const char*                 p_pcValue)
+    {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt (%s=%s)\n"), p_pcKey, p_pcValue););
 
-    hMDNSTxt        hTxt = 0;
+        hMDNSTxt hTxt = 0;
 
-    stcMDNSService* pService = _findService(p_hService);
-    if (pService)
-    {
-        hTxt = _addServiceTxt(pService, p_pcKey, p_pcValue, true);
+        stcMDNSService* pService = _findService(p_hService);
+        if (pService)
+        {
+            hTxt = _addServiceTxt(pService, p_pcKey, p_pcValue, true);
+        }
+        DEBUG_EX_ERR(if (!hTxt)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
+                     });
+        return hTxt;
     }
-    DEBUG_EX_ERR(if (!hTxt)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ? : "-"), (p_pcValue ? : "-"));
-    });
-    return hTxt;
-}
 
-/*
+    /*
     MDNSResponder::addDynamicServiceTxt (uint32_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint32_t p_u32Value)
-{
-
-    char    acBuffer[32];   *acBuffer = 0;
-    sprintf(acBuffer, "%u", p_u32Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+                                                                const char*                 p_pcKey,
+                                                                uint32_t                    p_u32Value)
+    {
+        char acBuffer[32];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%u", p_u32Value);
 
-    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addDynamicServiceTxt (uint16_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint16_t p_u16Value)
-{
-
-    char    acBuffer[16];   *acBuffer = 0;
-    sprintf(acBuffer, "%hu", p_u16Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+                                                                const char*                 p_pcKey,
+                                                                uint16_t                    p_u16Value)
+    {
+        char acBuffer[16];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hu", p_u16Value);
 
-    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addDynamicServiceTxt (uint8_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        uint8_t p_u8Value)
-{
-
-    char    acBuffer[8];    *acBuffer = 0;
-    sprintf(acBuffer, "%hhu", p_u8Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+                                                                const char*                 p_pcKey,
+                                                                uint8_t                     p_u8Value)
+    {
+        char acBuffer[8];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hhu", p_u8Value);
 
-    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addDynamicServiceTxt (int32_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int32_t p_i32Value)
-{
-
-    char    acBuffer[32];   *acBuffer = 0;
-    sprintf(acBuffer, "%i", p_i32Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+                                                                const char*                 p_pcKey,
+                                                                int32_t                     p_i32Value)
+    {
+        char acBuffer[32];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%i", p_i32Value);
 
-    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addDynamicServiceTxt (int16_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int16_t p_i16Value)
-{
-
-    char    acBuffer[16];   *acBuffer = 0;
-    sprintf(acBuffer, "%hi", p_i16Value);
+    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+                                                                const char*                 p_pcKey,
+                                                                int16_t                     p_i16Value)
+    {
+        char acBuffer[16];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hi", p_i16Value);
 
-    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/*
+    /*
     MDNSResponder::addDynamicServiceTxt (int8_t)
 */
-MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-        const char* p_pcKey,
-        int8_t p_i8Value)
-{
-
-    char    acBuffer[8];    *acBuffer = 0;
-    sprintf(acBuffer, "%hhi", p_i8Value);
-
-    return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
-}
+    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
+                                                                const char*                 p_pcKey,
+                                                                int8_t                      p_i8Value)
+    {
+        char acBuffer[8];
+        *acBuffer = 0;
+        sprintf(acBuffer, "%hhi", p_i8Value);
 
+        return addDynamicServiceTxt(p_hService, p_pcKey, acBuffer);
+    }
 
-/**
+    /**
     STATIC SERVICE QUERY (LEGACY)
 */
 
-/*
+    /*
     MDNSResponder::queryService
 
     Perform a (blocking) static service query.
@@ -683,172 +655,151 @@ MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNS
     - answerPort (or 'port')
 
 */
-uint32_t MDNSResponder::queryService(const char* p_pcService,
-                                     const char* p_pcProtocol,
-                                     const uint16_t p_u16Timeout /*= MDNS_QUERYSERVICES_WAIT_TIME*/)
-{
-    if (0 == m_pUDPContext)
+    uint32_t MDNSResponder::queryService(const char*    p_pcService,
+                                         const char*    p_pcProtocol,
+                                         const uint16_t p_u16Timeout /*= MDNS_QUERYSERVICES_WAIT_TIME*/)
     {
-        // safeguard against misuse
-        return 0;
-    }
-
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService '%s.%s'\n"), p_pcService, p_pcProtocol););
-
-    uint32_t    u32Result = 0;
+        if (0 == m_pUDPContext)
+        {
+            // safeguard against misuse
+            return 0;
+        }
 
-    stcMDNSServiceQuery*    pServiceQuery = 0;
-    if ((p_pcService) &&
-            (os_strlen(p_pcService)) &&
-            (p_pcProtocol) &&
-            (os_strlen(p_pcProtocol)) &&
-            (p_u16Timeout) &&
-            (_removeLegacyServiceQuery()) &&
-            ((pServiceQuery = _allocServiceQuery())) &&
-            (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
-    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService '%s.%s'\n"), p_pcService, p_pcProtocol););
 
-        pServiceQuery->m_bLegacyQuery = true;
+        uint32_t u32Result = 0;
 
-        if (_sendMDNSServiceQuery(*pServiceQuery))
+        stcMDNSServiceQuery* pServiceQuery = 0;
+        if ((p_pcService) && (os_strlen(p_pcService)) && (p_pcProtocol) && (os_strlen(p_pcProtocol)) && (p_u16Timeout) && (_removeLegacyServiceQuery()) && ((pServiceQuery = _allocServiceQuery())) && (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
         {
-            // Wait for answers to arrive
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: Waiting %u ms for answers...\n"), p_u16Timeout););
-            delay(p_u16Timeout);
+            pServiceQuery->m_bLegacyQuery = true;
+
+            if (_sendMDNSServiceQuery(*pServiceQuery))
+            {
+                // Wait for answers to arrive
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: Waiting %u ms for answers...\n"), p_u16Timeout););
+                delay(p_u16Timeout);
 
-            // All answers should have arrived by now -> stop adding new answers
-            pServiceQuery->m_bAwaitingAnswers = false;
-            u32Result = pServiceQuery->answerCount();
+                // All answers should have arrived by now -> stop adding new answers
+                pServiceQuery->m_bAwaitingAnswers = false;
+                u32Result                         = pServiceQuery->answerCount();
+            }
+            else  // FAILED to send query
+            {
+                _removeServiceQuery(pServiceQuery);
+            }
         }
-        else    // FAILED to send query
+        else
         {
-            _removeServiceQuery(pServiceQuery);
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: INVALID input data!\n")););
         }
+        return u32Result;
     }
-    else
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: INVALID input data!\n")););
-    }
-    return u32Result;
-}
 
-/*
+    /*
     MDNSResponder::removeQuery
 
     Remove the last static service query (and all answers).
 
 */
-bool MDNSResponder::removeQuery(void)
-{
-
-    return _removeLegacyServiceQuery();
-}
+    bool MDNSResponder::removeQuery(void)
+    {
+        return _removeLegacyServiceQuery();
+    }
 
-/*
+    /*
     MDNSResponder::queryService (LEGACY)
 */
-uint32_t MDNSResponder::queryService(const String& p_strService,
-                                     const String& p_strProtocol)
-{
-
-    return queryService(p_strService.c_str(), p_strProtocol.c_str());
-}
+    uint32_t MDNSResponder::queryService(const String& p_strService,
+                                         const String& p_strProtocol)
+    {
+        return queryService(p_strService.c_str(), p_strProtocol.c_str());
+    }
 
-/*
+    /*
     MDNSResponder::answerHostname
 */
-const char* MDNSResponder::answerHostname(const uint32_t p_u32AnswerIndex)
-{
-
-    stcMDNSServiceQuery*            pServiceQuery = _findLegacyServiceQuery();
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-
-    if ((pSQAnswer) &&
-            (pSQAnswer->m_HostDomain.m_u16NameLength) &&
-            (!pSQAnswer->m_pcHostDomain))
+    const char* MDNSResponder::answerHostname(const uint32_t p_u32AnswerIndex)
     {
+        stcMDNSServiceQuery*            pServiceQuery = _findLegacyServiceQuery();
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
 
-        char*   pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
-        if (pcHostDomain)
+        if ((pSQAnswer) && (pSQAnswer->m_HostDomain.m_u16NameLength) && (!pSQAnswer->m_pcHostDomain))
         {
-            pSQAnswer->m_HostDomain.c_str(pcHostDomain);
+            char* pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
+            if (pcHostDomain)
+            {
+                pSQAnswer->m_HostDomain.c_str(pcHostDomain);
+            }
         }
+        return (pSQAnswer ? pSQAnswer->m_pcHostDomain : 0);
     }
-    return (pSQAnswer ? pSQAnswer->m_pcHostDomain : 0);
-}
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::answerIP
 */
-IPAddress MDNSResponder::answerIP(const uint32_t p_u32AnswerIndex)
-{
-
-    const stcMDNSServiceQuery*                              pServiceQuery = _findLegacyServiceQuery();
-    const stcMDNSServiceQuery::stcAnswer*                   pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    const stcMDNSServiceQuery::stcAnswer::stcIP4Address*    pIP4Address = (((pSQAnswer) && (pSQAnswer->m_pIP4Addresses)) ? pSQAnswer->IP4AddressAtIndex(0) : 0);
-    return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
-}
+    IPAddress MDNSResponder::answerIP(const uint32_t p_u32AnswerIndex)
+    {
+        const stcMDNSServiceQuery*                           pServiceQuery = _findLegacyServiceQuery();
+        const stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        const stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address   = (((pSQAnswer) && (pSQAnswer->m_pIP4Addresses)) ? pSQAnswer->IP4AddressAtIndex(0) : 0);
+        return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
+    }
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-/*
+    /*
     MDNSResponder::answerIP6
 */
-IPAddress MDNSResponder::answerIP6(const uint32_t p_u32AnswerIndex)
-{
-
-    const stcMDNSServiceQuery*                              pServiceQuery = _findLegacyServiceQuery();
-    const stcMDNSServiceQuery::stcAnswer*                   pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    const stcMDNSServiceQuery::stcAnswer::stcIP6Address*    pIP6Address = (((pSQAnswer) && (pSQAnswer->m_pIP6Addresses)) ? pSQAnswer->IP6AddressAtIndex(0) : 0);
-    return (pIP6Address ? pIP6Address->m_IPAddress : IP6Address());
-}
+    IPAddress MDNSResponder::answerIP6(const uint32_t p_u32AnswerIndex)
+    {
+        const stcMDNSServiceQuery*                           pServiceQuery = _findLegacyServiceQuery();
+        const stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        const stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address   = (((pSQAnswer) && (pSQAnswer->m_pIP6Addresses)) ? pSQAnswer->IP6AddressAtIndex(0) : 0);
+        return (pIP6Address ? pIP6Address->m_IPAddress : IP6Address());
+    }
 #endif
 
-/*
+    /*
     MDNSResponder::answerPort
 */
-uint16_t MDNSResponder::answerPort(const uint32_t p_u32AnswerIndex)
-{
-
-    const stcMDNSServiceQuery*              pServiceQuery = _findLegacyServiceQuery();
-    const stcMDNSServiceQuery::stcAnswer*   pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
-}
+    uint16_t MDNSResponder::answerPort(const uint32_t p_u32AnswerIndex)
+    {
+        const stcMDNSServiceQuery*            pServiceQuery = _findLegacyServiceQuery();
+        const stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
+    }
 
-/*
+    /*
     MDNSResponder::hostname (LEGACY)
 */
-String MDNSResponder::hostname(const uint32_t p_u32AnswerIndex)
-{
-
-    return String(answerHostname(p_u32AnswerIndex));
-}
+    String MDNSResponder::hostname(const uint32_t p_u32AnswerIndex)
+    {
+        return String(answerHostname(p_u32AnswerIndex));
+    }
 
-/*
+    /*
     MDNSResponder::IP (LEGACY)
 */
-IPAddress MDNSResponder::IP(const uint32_t p_u32AnswerIndex)
-{
-
-    return answerIP(p_u32AnswerIndex);
-}
+    IPAddress MDNSResponder::IP(const uint32_t p_u32AnswerIndex)
+    {
+        return answerIP(p_u32AnswerIndex);
+    }
 
-/*
+    /*
     MDNSResponder::port (LEGACY)
 */
-uint16_t MDNSResponder::port(const uint32_t p_u32AnswerIndex)
-{
-
-    return answerPort(p_u32AnswerIndex);
-}
-
+    uint16_t MDNSResponder::port(const uint32_t p_u32AnswerIndex)
+    {
+        return answerPort(p_u32AnswerIndex);
+    }
 
-/**
+    /**
     DYNAMIC SERVICE QUERY
 */
 
-/*
+    /*
     MDNSResponder::installServiceQuery
 
     Add a dynamic service query and a corresponding callback to the MDNS responder.
@@ -861,306 +812,269 @@ uint16_t MDNSResponder::port(const uint32_t p_u32AnswerIndex)
     - answerTxts
 
 */
-MDNSResponder::hMDNSServiceQuery MDNSResponder::installServiceQuery(const char* p_pcService,
-        const char* p_pcProtocol,
-        MDNSResponder::MDNSServiceQueryCallbackFunc p_fnCallback)
-{
-    hMDNSServiceQuery       hResult = 0;
-
-    stcMDNSServiceQuery*    pServiceQuery = 0;
-    if ((p_pcService) &&
-            (os_strlen(p_pcService)) &&
-            (p_pcProtocol) &&
-            (os_strlen(p_pcProtocol)) &&
-            (p_fnCallback) &&
-            ((pServiceQuery = _allocServiceQuery())) &&
-            (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
+    MDNSResponder::hMDNSServiceQuery MDNSResponder::installServiceQuery(const char*                                 p_pcService,
+                                                                        const char*                                 p_pcProtocol,
+                                                                        MDNSResponder::MDNSServiceQueryCallbackFunc p_fnCallback)
     {
+        hMDNSServiceQuery hResult = 0;
 
-        pServiceQuery->m_fnCallback = p_fnCallback;
-        pServiceQuery->m_bLegacyQuery = false;
-
-        if (_sendMDNSServiceQuery(*pServiceQuery))
+        stcMDNSServiceQuery* pServiceQuery = 0;
+        if ((p_pcService) && (os_strlen(p_pcService)) && (p_pcProtocol) && (os_strlen(p_pcProtocol)) && (p_fnCallback) && ((pServiceQuery = _allocServiceQuery())) && (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
         {
-            pServiceQuery->m_u8SentCount = 1;
-            pServiceQuery->m_ResendTimeout.reset(MDNS_DYNAMIC_QUERY_RESEND_DELAY);
+            pServiceQuery->m_fnCallback   = p_fnCallback;
+            pServiceQuery->m_bLegacyQuery = false;
 
-            hResult = (hMDNSServiceQuery)pServiceQuery;
-        }
-        else
-        {
-            _removeServiceQuery(pServiceQuery);
+            if (_sendMDNSServiceQuery(*pServiceQuery))
+            {
+                pServiceQuery->m_u8SentCount = 1;
+                pServiceQuery->m_ResendTimeout.reset(MDNS_DYNAMIC_QUERY_RESEND_DELAY);
+
+                hResult = (hMDNSServiceQuery)pServiceQuery;
+            }
+            else
+            {
+                _removeServiceQuery(pServiceQuery);
+            }
         }
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: %s for '%s.%s'!\n\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
+        DEBUG_EX_ERR(if (!hResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: FAILED for '%s.%s'!\n\n"), (p_pcService ?: "-"), (p_pcProtocol ?: "-"));
+                     });
+        return hResult;
     }
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: %s for '%s.%s'!\n\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcService ? : "-"), (p_pcProtocol ? : "-")););
-    DEBUG_EX_ERR(if (!hResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: FAILED for '%s.%s'!\n\n"), (p_pcService ? : "-"), (p_pcProtocol ? : "-"));
-    });
-    return hResult;
-}
 
-/*
+    /*
     MDNSResponder::removeServiceQuery
 
     Remove a dynamic service query (and all collected answers) from the MDNS responder
 
 */
-bool MDNSResponder::removeServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
-{
-
-    stcMDNSServiceQuery*    pServiceQuery = 0;
-    bool    bResult = (((pServiceQuery = _findServiceQuery(p_hServiceQuery))) &&
-                       (_removeServiceQuery(pServiceQuery)));
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceQuery: FAILED!\n"));
-    });
-    return bResult;
-}
+    bool MDNSResponder::removeServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
+    {
+        stcMDNSServiceQuery* pServiceQuery = 0;
+        bool                 bResult       = (((pServiceQuery = _findServiceQuery(p_hServiceQuery))) && (_removeServiceQuery(pServiceQuery)));
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceQuery: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::answerCount
 */
-uint32_t MDNSResponder::answerCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
-{
-
-    stcMDNSServiceQuery*    pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    return (pServiceQuery ? pServiceQuery->answerCount() : 0);
-}
+    uint32_t MDNSResponder::answerCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
+    {
+        stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        return (pServiceQuery ? pServiceQuery->answerCount() : 0);
+    }
 
-std::vector<MDNSResponder::MDNSServiceInfo>  MDNSResponder::answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
-{
-    std::vector<MDNSResponder::MDNSServiceInfo> tempVector;
-    for (uint32_t i = 0; i < answerCount(p_hServiceQuery); i++)
+    std::vector<MDNSResponder::MDNSServiceInfo> MDNSResponder::answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
     {
-        tempVector.emplace_back(*this, p_hServiceQuery, i);
+        std::vector<MDNSResponder::MDNSServiceInfo> tempVector;
+        for (uint32_t i = 0; i < answerCount(p_hServiceQuery); i++)
+        {
+            tempVector.emplace_back(*this, p_hServiceQuery, i);
+        }
+        return tempVector;
     }
-    return tempVector;
-}
 
-/*
+    /*
     MDNSResponder::answerServiceDomain
 
     Returns the domain for the given service.
     If not already existing, the string is allocated, filled and attached to the answer.
 
 */
-const char* MDNSResponder::answerServiceDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
-{
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    // Fill m_pcServiceDomain (if not already done)
-    if ((pSQAnswer) &&
-            (pSQAnswer->m_ServiceDomain.m_u16NameLength) &&
-            (!pSQAnswer->m_pcServiceDomain))
+    const char* MDNSResponder::answerServiceDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                                   const uint32_t                         p_u32AnswerIndex)
     {
-
-        pSQAnswer->m_pcServiceDomain = pSQAnswer->allocServiceDomain(pSQAnswer->m_ServiceDomain.c_strLength());
-        if (pSQAnswer->m_pcServiceDomain)
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        // Fill m_pcServiceDomain (if not already done)
+        if ((pSQAnswer) && (pSQAnswer->m_ServiceDomain.m_u16NameLength) && (!pSQAnswer->m_pcServiceDomain))
         {
-            pSQAnswer->m_ServiceDomain.c_str(pSQAnswer->m_pcServiceDomain);
+            pSQAnswer->m_pcServiceDomain = pSQAnswer->allocServiceDomain(pSQAnswer->m_ServiceDomain.c_strLength());
+            if (pSQAnswer->m_pcServiceDomain)
+            {
+                pSQAnswer->m_ServiceDomain.c_str(pSQAnswer->m_pcServiceDomain);
+            }
         }
+        return (pSQAnswer ? pSQAnswer->m_pcServiceDomain : 0);
     }
-    return (pSQAnswer ? pSQAnswer->m_pcServiceDomain : 0);
-}
 
-/*
+    /*
     MDNSResponder::hasAnswerHostDomain
 */
-bool MDNSResponder::hasAnswerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                        const uint32_t p_u32AnswerIndex)
-{
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return ((pSQAnswer) &&
-            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
-}
+    bool MDNSResponder::hasAnswerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                            const uint32_t                         p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
+    }
 
-/*
+    /*
     MDNSResponder::answerHostDomain
 
     Returns the host domain for the given service.
     If not already existing, the string is allocated, filled and attached to the answer.
 
 */
-const char* MDNSResponder::answerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
-{
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    // Fill m_pcHostDomain (if not already done)
-    if ((pSQAnswer) &&
-            (pSQAnswer->m_HostDomain.m_u16NameLength) &&
-            (!pSQAnswer->m_pcHostDomain))
+    const char* MDNSResponder::answerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                                const uint32_t                         p_u32AnswerIndex)
     {
-
-        pSQAnswer->m_pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
-        if (pSQAnswer->m_pcHostDomain)
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        // Fill m_pcHostDomain (if not already done)
+        if ((pSQAnswer) && (pSQAnswer->m_HostDomain.m_u16NameLength) && (!pSQAnswer->m_pcHostDomain))
         {
-            pSQAnswer->m_HostDomain.c_str(pSQAnswer->m_pcHostDomain);
+            pSQAnswer->m_pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
+            if (pSQAnswer->m_pcHostDomain)
+            {
+                pSQAnswer->m_HostDomain.c_str(pSQAnswer->m_pcHostDomain);
+            }
         }
+        return (pSQAnswer ? pSQAnswer->m_pcHostDomain : 0);
     }
-    return (pSQAnswer ? pSQAnswer->m_pcHostDomain : 0);
-}
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::hasAnswerIP4Address
 */
-bool MDNSResponder::hasAnswerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                        const uint32_t p_u32AnswerIndex)
-{
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return ((pSQAnswer) &&
-            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_IP4Address));
-}
+    bool MDNSResponder::hasAnswerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                            const uint32_t                         p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_IP4Address));
+    }
 
-/*
+    /*
     MDNSResponder::answerIP4AddressCount
 */
-uint32_t MDNSResponder::answerIP4AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
-{
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return (pSQAnswer ? pSQAnswer->IP4AddressCount() : 0);
-}
+    uint32_t MDNSResponder::answerIP4AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                                  const uint32_t                         p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return (pSQAnswer ? pSQAnswer->IP4AddressCount() : 0);
+    }
 
-/*
+    /*
     MDNSResponder::answerIP4Address
 */
-IPAddress MDNSResponder::answerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex,
-        const uint32_t p_u32AddressIndex)
-{
-
-    stcMDNSServiceQuery*                            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer*                 pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    stcMDNSServiceQuery::stcAnswer::stcIP4Address*  pIP4Address = (pSQAnswer ? pSQAnswer->IP4AddressAtIndex(p_u32AddressIndex) : 0);
-    return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
-}
+    IPAddress MDNSResponder::answerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                              const uint32_t                         p_u32AnswerIndex,
+                                              const uint32_t                         p_u32AddressIndex)
+    {
+        stcMDNSServiceQuery*                           pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address   = (pSQAnswer ? pSQAnswer->IP4AddressAtIndex(p_u32AddressIndex) : 0);
+        return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
+    }
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-/*
+    /*
     MDNSResponder::hasAnswerIP6Address
 */
-bool MDNSResponder::hasAnswerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                        const uint32_t p_u32AnswerIndex)
-{
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return ((pSQAnswer) &&
-            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostIP6Address));
-}
+    bool MDNSResponder::hasAnswerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                            const uint32_t                         p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostIP6Address));
+    }
 
-/*
+    /*
     MDNSResponder::answerIP6AddressCount
 */
-uint32_t MDNSResponder::answerIP6AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
-{
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return (pSQAnswer ? pSQAnswer->IP6AddressCount() : 0);
-}
+    uint32_t MDNSResponder::answerIP6AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                                  const uint32_t                         p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return (pSQAnswer ? pSQAnswer->IP6AddressCount() : 0);
+    }
 
-/*
+    /*
     MDNSResponder::answerIP6Address
 */
-IPAddress MDNSResponder::answerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex,
-        const uint32_t p_u32AddressIndex)
-{
-
-    stcMDNSServiceQuery*                            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer*                 pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    stcMDNSServiceQuery::stcAnswer::stcIP6Address*  pIP6Address = (pSQAnswer ? pSQAnswer->IP6AddressAtIndex(p_u32AddressIndex) : 0);
-    return (pIP6Address ? pIP6Address->m_IPAddress : IPAddress());
-}
+    IPAddress MDNSResponder::answerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                              const uint32_t                         p_u32AnswerIndex,
+                                              const uint32_t                         p_u32AddressIndex)
+    {
+        stcMDNSServiceQuery*                           pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address   = (pSQAnswer ? pSQAnswer->IP6AddressAtIndex(p_u32AddressIndex) : 0);
+        return (pIP6Address ? pIP6Address->m_IPAddress : IPAddress());
+    }
 #endif
 
-/*
+    /*
     MDNSResponder::hasAnswerPort
 */
-bool MDNSResponder::hasAnswerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                  const uint32_t p_u32AnswerIndex)
-{
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return ((pSQAnswer) &&
-            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
-}
+    bool MDNSResponder::hasAnswerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                      const uint32_t                         p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
+    }
 
-/*
+    /*
     MDNSResponder::answerPort
 */
-uint16_t MDNSResponder::answerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                   const uint32_t p_u32AnswerIndex)
-{
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
-}
+    uint16_t MDNSResponder::answerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                       const uint32_t                         p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
+    }
 
-/*
+    /*
     MDNSResponder::hasAnswerTxts
 */
-bool MDNSResponder::hasAnswerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                  const uint32_t p_u32AnswerIndex)
-{
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    return ((pSQAnswer) &&
-            (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_Txts));
-}
+    bool MDNSResponder::hasAnswerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                      const uint32_t                         p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_Txts));
+    }
 
-/*
+    /*
     MDNSResponder::answerTxts
 
     Returns all TXT items for the given service as a ';'-separated string.
     If not already existing; the string is allocated, filled and attached to the answer.
 
 */
-const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                      const uint32_t p_u32AnswerIndex)
-{
-
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    // Fill m_pcTxts (if not already done)
-    if ((pSQAnswer) &&
-            (pSQAnswer->m_Txts.m_pTxts) &&
-            (!pSQAnswer->m_pcTxts))
+    const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                          const uint32_t                         p_u32AnswerIndex)
     {
-
-        pSQAnswer->m_pcTxts = pSQAnswer->allocTxts(pSQAnswer->m_Txts.c_strLength());
-        if (pSQAnswer->m_pcTxts)
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        // Fill m_pcTxts (if not already done)
+        if ((pSQAnswer) && (pSQAnswer->m_Txts.m_pTxts) && (!pSQAnswer->m_pcTxts))
         {
-            pSQAnswer->m_Txts.c_str(pSQAnswer->m_pcTxts);
+            pSQAnswer->m_pcTxts = pSQAnswer->allocTxts(pSQAnswer->m_Txts.c_strLength());
+            if (pSQAnswer->m_pcTxts)
+            {
+                pSQAnswer->m_Txts.c_str(pSQAnswer->m_pcTxts);
+            }
         }
+        return (pSQAnswer ? pSQAnswer->m_pcTxts : 0);
     }
-    return (pSQAnswer ? pSQAnswer->m_pcTxts : 0);
-}
 
-/*
+    /*
     PROBING
 */
 
-/*
+    /*
     MDNSResponder::setProbeResultCallback
 
     Set a global callback for probe results. The callback is called, when probing
@@ -1170,24 +1084,21 @@ const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_h
     When succeeded, the host or service domain will be announced by the MDNS responder.
 
 */
-bool MDNSResponder::setHostProbeResultCallback(MDNSResponder::MDNSHostProbeFn p_fnCallback)
-{
-
-    m_HostProbeInformation.m_fnHostProbeResultCallback = p_fnCallback;
+    bool MDNSResponder::setHostProbeResultCallback(MDNSResponder::MDNSHostProbeFn p_fnCallback)
+    {
+        m_HostProbeInformation.m_fnHostProbeResultCallback = p_fnCallback;
 
-    return true;
-}
+        return true;
+    }
 
-bool MDNSResponder::setHostProbeResultCallback(MDNSHostProbeFn1 pfn)
-{
-    using namespace std::placeholders;
-    return setHostProbeResultCallback([this, pfn](const char* p_pcDomainName, bool p_bProbeResult)
+    bool MDNSResponder::setHostProbeResultCallback(MDNSHostProbeFn1 pfn)
     {
-        pfn(*this, p_pcDomainName, p_bProbeResult);
-    });
-}
+        using namespace std::placeholders;
+        return setHostProbeResultCallback([this, pfn](const char* p_pcDomainName, bool p_bProbeResult)
+                                          { pfn(*this, p_pcDomainName, p_bProbeResult); });
+    }
 
-/*
+    /*
     MDNSResponder::setServiceProbeResultCallback
 
     Set a service specific callback for probe results. The callback is called, when probing
@@ -1196,189 +1107,172 @@ bool MDNSResponder::setHostProbeResultCallback(MDNSHostProbeFn1 pfn)
     When succeeded, the service domain will be announced by the MDNS responder.
 
 */
-bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-        MDNSResponder::MDNSServiceProbeFn p_fnCallback)
-{
-
-    bool    bResult = false;
-
-    stcMDNSService* pService = _findService(p_hService);
-    if (pService)
+    bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+                                                      MDNSResponder::MDNSServiceProbeFn p_fnCallback)
     {
-        pService->m_ProbeInformation.m_fnServiceProbeResultCallback = p_fnCallback;
+        bool bResult = false;
+
+        stcMDNSService* pService = _findService(p_hService);
+        if (pService)
+        {
+            pService->m_ProbeInformation.m_fnServiceProbeResultCallback = p_fnCallback;
 
-        bResult = true;
+            bResult = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-        MDNSResponder::MDNSServiceProbeFn1 p_fnCallback)
-{
-    using namespace std::placeholders;
-    return setServiceProbeResultCallback(p_hService, [this, p_fnCallback](const char* p_pcServiceName, const hMDNSService p_hMDNSService, bool p_bProbeResult)
+    bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService  p_hService,
+                                                      MDNSResponder::MDNSServiceProbeFn1 p_fnCallback)
     {
-        p_fnCallback(*this, p_pcServiceName, p_hMDNSService, p_bProbeResult);
-    });
-}
-
+        using namespace std::placeholders;
+        return setServiceProbeResultCallback(p_hService, [this, p_fnCallback](const char* p_pcServiceName, const hMDNSService p_hMDNSService, bool p_bProbeResult)
+                                             { p_fnCallback(*this, p_pcServiceName, p_hMDNSService, p_bProbeResult); });
+    }
 
-/*
+    /*
     MISC
 */
 
-/*
+    /*
     MDNSResponder::notifyAPChange
 
     Should be called, whenever the AP for the MDNS responder changes.
     A bit of this is caught by the event callbacks installed in the constructor.
 
 */
-bool MDNSResponder::notifyAPChange(void)
-{
-
-    return _restart();
-}
+    bool MDNSResponder::notifyAPChange(void)
+    {
+        return _restart();
+    }
 
-/*
+    /*
     MDNSResponder::update
 
     Should be called in every 'loop'.
 
 */
-bool MDNSResponder::update(void)
-{
-    return _process(true);
-}
+    bool MDNSResponder::update(void)
+    {
+        return _process(true);
+    }
 
-/*
+    /*
     MDNSResponder::announce
 
     Should be called, if the 'configuration' changes. Mainly this will be changes in the TXT items...
 */
-bool MDNSResponder::announce(void)
-{
-
-    return (_announce(true, true));
-}
+    bool MDNSResponder::announce(void)
+    {
+        return (_announce(true, true));
+    }
 
-/*
+    /*
     MDNSResponder::enableArduino
 
     Enable the OTA update service.
 
 */
-MDNSResponder::hMDNSService MDNSResponder::enableArduino(uint16_t p_u16Port,
-        bool p_bAuthUpload /*= false*/)
-{
-
-    hMDNSService    hService = addService(0, "arduino", "tcp", p_u16Port);
-    if (hService)
+    MDNSResponder::hMDNSService MDNSResponder::enableArduino(uint16_t p_u16Port,
+                                                             bool     p_bAuthUpload /*= false*/)
     {
-        if ((!addServiceTxt(hService, "tcp_check", "no")) ||
-                (!addServiceTxt(hService, "ssh_upload", "no")) ||
-                (!addServiceTxt(hService, "board", STRINGIZE_VALUE_OF(ARDUINO_BOARD))) ||
-                (!addServiceTxt(hService, "auth_upload", (p_bAuthUpload) ? "yes" : "no")))
+        hMDNSService hService = addService(0, "arduino", "tcp", p_u16Port);
+        if (hService)
         {
-
-            removeService(hService);
-            hService = 0;
+            if ((!addServiceTxt(hService, "tcp_check", "no")) || (!addServiceTxt(hService, "ssh_upload", "no")) || (!addServiceTxt(hService, "board", STRINGIZE_VALUE_OF(ARDUINO_BOARD))) || (!addServiceTxt(hService, "auth_upload", (p_bAuthUpload) ? "yes" : "no")))
+            {
+                removeService(hService);
+                hService = 0;
+            }
         }
+        return hService;
     }
-    return hService;
-}
 
-/*
+    /*
 
     MULTICAST GROUPS
 
 */
 
-/*
+    /*
     MDNSResponder::_joinMulticastGroups
 */
-bool MDNSResponder::_joinMulticastGroups(void)
-{
-    bool    bResult = false;
-
-    // Join multicast group(s)
-    for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+    bool MDNSResponder::_joinMulticastGroups(void)
     {
-        if (netif_is_up(pNetIf))
+        bool bResult = false;
+
+        // Join multicast group(s)
+        for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
         {
-#ifdef MDNS_IP4_SUPPORT
-            ip_addr_t   multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
-            if (!(pNetIf->flags & NETIF_FLAG_IGMP))
+            if (netif_is_up(pNetIf))
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: Setting flag: flags & NETIF_FLAG_IGMP\n")););
-                pNetIf->flags |= NETIF_FLAG_IGMP;
-
-                if (ERR_OK != igmp_start(pNetIf))
+#ifdef MDNS_IP4_SUPPORT
+                ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
+                if (!(pNetIf->flags & NETIF_FLAG_IGMP))
                 {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_start FAILED!\n")););
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: Setting flag: flags & NETIF_FLAG_IGMP\n")););
+                    pNetIf->flags |= NETIF_FLAG_IGMP;
+
+                    if (ERR_OK != igmp_start(pNetIf))
+                    {
+                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_start FAILED!\n")););
+                    }
                 }
-            }
 
-            if ((ERR_OK == igmp_joingroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4))))
-            {
-                bResult = true;
-            }
-            else
-            {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_joingroup_netif(" NETIFID_STR ": %s) FAILED!\n"),
-                                                   NETIFID_VAL(pNetIf), IPAddress(multicast_addr_V4).toString().c_str()););
-            }
+                if ((ERR_OK == igmp_joingroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4))))
+                {
+                    bResult = true;
+                }
+                else
+                {
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_joingroup_netif(" NETIFID_STR ": %s) FAILED!\n"),
+                                                       NETIFID_VAL(pNetIf), IPAddress(multicast_addr_V4).toString().c_str()););
+                }
 #endif
 
 #ifdef MDNS_IPV6_SUPPORT
-            ip_addr_t   multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
-            bResult = ((bResult) &&
-                       (ERR_OK == mld6_joingroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6))));
-            DEBUG_EX_ERR_IF(!bResult, DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: mld6_joingroup_netif (" NETIFID_STR ") FAILED!\n"),
-                            NETIFID_VAL(pNetIf)));
+                ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
+                bResult                     = ((bResult) && (ERR_OK == mld6_joingroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6))));
+                DEBUG_EX_ERR_IF(!bResult, DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: mld6_joingroup_netif (" NETIFID_STR ") FAILED!\n"), NETIFID_VAL(pNetIf)));
 #endif
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     clsLEAmDNS2_Host::_leaveMulticastGroups
 */
-bool MDNSResponder::_leaveMulticastGroups()
-{
-    bool    bResult = false;
-
-    for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+    bool MDNSResponder::_leaveMulticastGroups()
     {
-        if (netif_is_up(pNetIf))
+        bool bResult = false;
+
+        for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
         {
-            bResult = true;
+            if (netif_is_up(pNetIf))
+            {
+                bResult = true;
 
-            // Leave multicast group(s)
+                // Leave multicast group(s)
 #ifdef MDNS_IP4_SUPPORT
-            ip_addr_t   multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
-            if (ERR_OK != igmp_leavegroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4)))
-            {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
-            }
+                ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
+                if (ERR_OK != igmp_leavegroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4)))
+                {
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
+                }
 #endif
 #ifdef MDNS_IPV6_SUPPORT
-            ip_addr_t   multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
-            if (ERR_OK != mld6_leavegroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6)/*&(multicast_addr_V6.u_addr.ip6)*/))
-            {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
-            }
+                ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
+                if (ERR_OK != mld6_leavegroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6) /*&(multicast_addr_V6.u_addr.ip6)*/))
+                {
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
+                }
 #endif
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
-
-
-
-} //namespace MDNSImplementation
-
-} //namespace esp8266
 
+}  //namespace MDNSImplementation
 
+}  //namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.h b/libraries/ESP8266mDNS/src/LEAmDNS.h
index 670de02ed0..3983b98cac 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.h
@@ -102,7 +102,7 @@
 #ifndef MDNS_H
 #define MDNS_H
 
-#include <functional>   // for UdpContext.h
+#include <functional>  // for UdpContext.h
 #include "WiFiUdp.h"
 #include "lwip/udp.h"
 #include "debug.h"
@@ -111,19 +111,15 @@
 #include <PolledTimeout.h>
 #include <map>
 
-
 #include "ESP8266WiFi.h"
 
-
 namespace esp8266
 {
-
 /**
     LEAmDNS
 */
 namespace MDNSImplementation
 {
-
 //this should be defined at build time
 #ifndef ARDUINO_BOARD
 #define ARDUINO_BOARD "generic"
@@ -135,1329 +131,1328 @@ namespace MDNSImplementation
 #endif
 
 #ifdef MDNS_IP4_SUPPORT
-#define MDNS_IP4_SIZE               4
+#define MDNS_IP4_SIZE 4
 #endif
 #ifdef MDNS_IP6_SUPPORT
-#define MDNS_IP6_SIZE               16
+#define MDNS_IP6_SIZE 16
 #endif
 /*
     Maximum length for all service txts for one service
 */
-#define MDNS_SERVICE_TXT_MAXLENGTH      1300
+#define MDNS_SERVICE_TXT_MAXLENGTH 1300
 /*
     Maximum length for a full domain name eg. MyESP._http._tcp.local
 */
-#define MDNS_DOMAIN_MAXLENGTH           256
+#define MDNS_DOMAIN_MAXLENGTH 256
 /*
     Maximum length of on label in a domain name (length info fits into 6 bits)
 */
-#define MDNS_DOMAIN_LABEL_MAXLENGTH     63
+#define MDNS_DOMAIN_LABEL_MAXLENGTH 63
 /*
     Maximum length of a service name eg. http
 */
-#define MDNS_SERVICE_NAME_LENGTH        15
+#define MDNS_SERVICE_NAME_LENGTH 15
 /*
     Maximum length of a service protocol name eg. tcp
 */
-#define MDNS_SERVICE_PROTOCOL_LENGTH    3
+#define MDNS_SERVICE_PROTOCOL_LENGTH 3
 /*
     Default timeout for static service queries
 */
-#define MDNS_QUERYSERVICES_WAIT_TIME    1000
+#define MDNS_QUERYSERVICES_WAIT_TIME 1000
 
 /*
     Timeout for udpContext->sendtimeout()
 */
-#define MDNS_UDPCONTEXT_TIMEOUT  50
+#define MDNS_UDPCONTEXT_TIMEOUT 50
 
-/**
+    /**
     MDNSResponder
 */
-class MDNSResponder
-{
-public:
-    /* INTERFACE */
-
-    MDNSResponder(void);
-    virtual ~MDNSResponder(void);
-
-    // Start the MDNS responder by setting the default hostname
-    // Later call MDNS::update() in every 'loop' to run the process loop
-    // (probing, announcing, responding, ...)
-    // if interfaceAddress is not specified, default interface is STA, or AP when STA is not set
-    bool begin(const char* p_pcHostname, const IPAddress& p_IPAddress = INADDR_ANY, uint32_t p_u32TTL = 120 /*ignored*/);
-    bool begin(const String& p_strHostname, const IPAddress& p_IPAddress = INADDR_ANY, uint32_t p_u32TTL = 120 /*ignored*/)
+    class MDNSResponder
     {
-        return begin(p_strHostname.c_str(), p_IPAddress, p_u32TTL);
-    }
-    bool _joinMulticastGroups(void);
-    bool _leaveMulticastGroups(void);
-
-    // Finish MDNS processing
-    bool close(void);
-    // for esp32 compatibility
-    bool end(void);
-    // Change hostname (probing is restarted)
-    bool setHostname(const char* p_pcHostname);
-    // for compatibility...
-    bool setHostname(const String& p_strHostname);
-
-    bool isRunning(void)
-    {
-        return (m_pUDPContext != 0);
-    }
+    public:
+        /* INTERFACE */
 
-    /**
+        MDNSResponder(void);
+        virtual ~MDNSResponder(void);
+
+        // Start the MDNS responder by setting the default hostname
+        // Later call MDNS::update() in every 'loop' to run the process loop
+        // (probing, announcing, responding, ...)
+        // if interfaceAddress is not specified, default interface is STA, or AP when STA is not set
+        bool begin(const char* p_pcHostname, const IPAddress& p_IPAddress = INADDR_ANY, uint32_t p_u32TTL = 120 /*ignored*/);
+        bool begin(const String& p_strHostname, const IPAddress& p_IPAddress = INADDR_ANY, uint32_t p_u32TTL = 120 /*ignored*/)
+        {
+            return begin(p_strHostname.c_str(), p_IPAddress, p_u32TTL);
+        }
+        bool _joinMulticastGroups(void);
+        bool _leaveMulticastGroups(void);
+
+        // Finish MDNS processing
+        bool close(void);
+        // for esp32 compatibility
+        bool end(void);
+        // Change hostname (probing is restarted)
+        bool setHostname(const char* p_pcHostname);
+        // for compatibility...
+        bool setHostname(const String& p_strHostname);
+
+        bool isRunning(void)
+        {
+            return (m_pUDPContext != 0);
+        }
+
+        /**
         hMDNSService (opaque handle to access the service)
     */
-    typedef const void*     hMDNSService;
-
-    // Add a new service to the MDNS responder. If no name (instance name) is given (p_pcName = 0)
-    // the current hostname is used. If the hostname is changed later, the instance names for
-    // these 'auto-named' services are changed to the new name also (and probing is restarted).
-    // The usual '_' before p_pcService (eg. http) and protocol (eg. tcp) may be given.
-    hMDNSService addService(const char* p_pcName,
-                            const char* p_pcService,
-                            const char* p_pcProtocol,
-                            uint16_t p_u16Port);
-    // Removes a service from the MDNS responder
-    bool removeService(const hMDNSService p_hService);
-    bool removeService(const char* p_pcInstanceName,
-                       const char* p_pcServiceName,
-                       const char* p_pcProtocol);
-    // for compatibility...
-    bool addService(const String& p_strServiceName,
-                    const String& p_strProtocol,
-                    uint16_t p_u16Port);
-
-
-    // Change the services instance name (and restart probing).
-    bool setServiceName(const hMDNSService p_hService,
-                        const char* p_pcInstanceName);
-    //for compatibility
-    //Warning: this has the side effect of changing the hostname.
-    //TODO: implement instancename different from hostname
-    void setInstanceName(const char* p_pcHostname)
-    {
-        setHostname(p_pcHostname);
-    }
-    // for esp32 compatibility
-    void setInstanceName(const String& s_pcHostname)
-    {
-        setInstanceName(s_pcHostname.c_str());
-    }
+        typedef const void* hMDNSService;
+
+        // Add a new service to the MDNS responder. If no name (instance name) is given (p_pcName = 0)
+        // the current hostname is used. If the hostname is changed later, the instance names for
+        // these 'auto-named' services are changed to the new name also (and probing is restarted).
+        // The usual '_' before p_pcService (eg. http) and protocol (eg. tcp) may be given.
+        hMDNSService addService(const char* p_pcName,
+                                const char* p_pcService,
+                                const char* p_pcProtocol,
+                                uint16_t    p_u16Port);
+        // Removes a service from the MDNS responder
+        bool removeService(const hMDNSService p_hService);
+        bool removeService(const char* p_pcInstanceName,
+                           const char* p_pcServiceName,
+                           const char* p_pcProtocol);
+        // for compatibility...
+        bool addService(const String& p_strServiceName,
+                        const String& p_strProtocol,
+                        uint16_t      p_u16Port);
+
+        // Change the services instance name (and restart probing).
+        bool setServiceName(const hMDNSService p_hService,
+                            const char*        p_pcInstanceName);
+        //for compatibility
+        //Warning: this has the side effect of changing the hostname.
+        //TODO: implement instancename different from hostname
+        void setInstanceName(const char* p_pcHostname)
+        {
+            setHostname(p_pcHostname);
+        }
+        // for esp32 compatibility
+        void setInstanceName(const String& s_pcHostname)
+        {
+            setInstanceName(s_pcHostname.c_str());
+        }
 
-    /**
+        /**
         hMDNSTxt (opaque handle to access the TXT items)
     */
-    typedef void*   hMDNSTxt;
-
-    // Add a (static) MDNS TXT item ('key' = 'value') to the service
-    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+        typedef void* hMDNSTxt;
+
+        // Add a (static) MDNS TXT item ('key' = 'value') to the service
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                               const char*        p_pcKey,
+                               const char*        p_pcValue);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                               const char*        p_pcKey,
+                               uint32_t           p_u32Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                               const char*        p_pcKey,
+                               uint16_t           p_u16Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                               const char*        p_pcKey,
+                               uint8_t            p_u8Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                               const char*        p_pcKey,
+                               int32_t            p_i32Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                               const char*        p_pcKey,
+                               int16_t            p_i16Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
+                               const char*        p_pcKey,
+                               int8_t             p_i8Value);
+
+        // Remove an existing (static) MDNS TXT item from the service
+        bool removeServiceTxt(const hMDNSService p_hService,
+                              const hMDNSTxt     p_hTxt);
+        bool removeServiceTxt(const hMDNSService p_hService,
+                              const char*        p_pcKey);
+        bool removeServiceTxt(const char* p_pcinstanceName,
+                              const char* p_pcServiceName,
+                              const char* p_pcProtocol,
+                              const char* p_pcKey);
+        // for compatibility...
+        bool addServiceTxt(const char* p_pcService,
+                           const char* p_pcProtocol,
                            const char* p_pcKey,
                            const char* p_pcValue);
-    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                           const char* p_pcKey,
-                           uint32_t p_u32Value);
-    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                           const char* p_pcKey,
-                           uint16_t p_u16Value);
-    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                           const char* p_pcKey,
-                           uint8_t p_u8Value);
-    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                           const char* p_pcKey,
-                           int32_t p_i32Value);
-    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                           const char* p_pcKey,
-                           int16_t p_i16Value);
-    hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                           const char* p_pcKey,
-                           int8_t p_i8Value);
-
-    // Remove an existing (static) MDNS TXT item from the service
-    bool removeServiceTxt(const hMDNSService p_hService,
-                          const hMDNSTxt p_hTxt);
-    bool removeServiceTxt(const hMDNSService p_hService,
-                          const char* p_pcKey);
-    bool removeServiceTxt(const char* p_pcinstanceName,
-                          const char* p_pcServiceName,
-                          const char* p_pcProtocol,
-                          const char* p_pcKey);
-    // for compatibility...
-    bool addServiceTxt(const char* p_pcService,
-                       const char* p_pcProtocol,
-                       const char* p_pcKey,
-                       const char* p_pcValue);
-    bool addServiceTxt(const String& p_strService,
-                       const String& p_strProtocol,
-                       const String& p_strKey,
-                       const String& p_strValue);
+        bool addServiceTxt(const String& p_strService,
+                           const String& p_strProtocol,
+                           const String& p_strKey,
+                           const String& p_strValue);
 
-    /**
+        /**
         MDNSDynamicServiceTxtCallbackFn
         Callback function for dynamic MDNS TXT items
     */
 
-    typedef std::function<void(const hMDNSService p_hService)> MDNSDynamicServiceTxtCallbackFunc;
-
-    // Set a global callback for dynamic MDNS TXT items. The callback function is called
-    // every time, a TXT item is needed for one of the installed services.
-    bool setDynamicServiceTxtCallback(MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
-    // Set a service specific callback for dynamic MDNS TXT items. The callback function
-    // is called every time, a TXT item is needed for the given service.
-    bool setDynamicServiceTxtCallback(const hMDNSService p_hService,
-                                      MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
-
-    // Add a (dynamic) MDNS TXT item ('key' = 'value') to the service
-    // Dynamic TXT items are removed right after one-time use. So they need to be added
-    // every time the value s needed (via callback).
-    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                  const char* p_pcKey,
-                                  const char* p_pcValue);
-    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                  const char* p_pcKey,
-                                  uint32_t p_u32Value);
-    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                  const char* p_pcKey,
-                                  uint16_t p_u16Value);
-    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                  const char* p_pcKey,
-                                  uint8_t p_u8Value);
-    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                  const char* p_pcKey,
-                                  int32_t p_i32Value);
-    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                  const char* p_pcKey,
-                                  int16_t p_i16Value);
-    hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                  const char* p_pcKey,
-                                  int8_t p_i8Value);
-
-    // Perform a (static) service query. The function returns after p_u16Timeout milliseconds
-    // The answers (the number of received answers is returned) can be retrieved by calling
-    // - answerHostname (or hostname)
-    // - answerIP (or IP)
-    // - answerPort (or port)
-    uint32_t queryService(const char* p_pcService,
-                          const char* p_pcProtocol,
-                          const uint16_t p_u16Timeout = MDNS_QUERYSERVICES_WAIT_TIME);
-    bool removeQuery(void);
-    // for compatibility...
-    uint32_t queryService(const String& p_strService,
-                          const String& p_strProtocol);
-
-    const char* answerHostname(const uint32_t p_u32AnswerIndex);
-    IPAddress answerIP(const uint32_t p_u32AnswerIndex);
-    uint16_t answerPort(const uint32_t p_u32AnswerIndex);
-    // for compatibility...
-    String hostname(const uint32_t p_u32AnswerIndex);
-    IPAddress IP(const uint32_t p_u32AnswerIndex);
-    uint16_t port(const uint32_t p_u32AnswerIndex);
+        typedef std::function<void(const hMDNSService p_hService)> MDNSDynamicServiceTxtCallbackFunc;
+
+        // Set a global callback for dynamic MDNS TXT items. The callback function is called
+        // every time, a TXT item is needed for one of the installed services.
+        bool setDynamicServiceTxtCallback(MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
+        // Set a service specific callback for dynamic MDNS TXT items. The callback function
+        // is called every time, a TXT item is needed for the given service.
+        bool setDynamicServiceTxtCallback(const hMDNSService                p_hService,
+                                          MDNSDynamicServiceTxtCallbackFunc p_fnCallback);
+
+        // Add a (dynamic) MDNS TXT item ('key' = 'value') to the service
+        // Dynamic TXT items are removed right after one-time use. So they need to be added
+        // every time the value s needed (via callback).
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                      const char*  p_pcKey,
+                                      const char*  p_pcValue);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                      const char*  p_pcKey,
+                                      uint32_t     p_u32Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                      const char*  p_pcKey,
+                                      uint16_t     p_u16Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                      const char*  p_pcKey,
+                                      uint8_t      p_u8Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                      const char*  p_pcKey,
+                                      int32_t      p_i32Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                      const char*  p_pcKey,
+                                      int16_t      p_i16Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
+                                      const char*  p_pcKey,
+                                      int8_t       p_i8Value);
+
+        // Perform a (static) service query. The function returns after p_u16Timeout milliseconds
+        // The answers (the number of received answers is returned) can be retrieved by calling
+        // - answerHostname (or hostname)
+        // - answerIP (or IP)
+        // - answerPort (or port)
+        uint32_t queryService(const char*    p_pcService,
+                              const char*    p_pcProtocol,
+                              const uint16_t p_u16Timeout = MDNS_QUERYSERVICES_WAIT_TIME);
+        bool     removeQuery(void);
+        // for compatibility...
+        uint32_t queryService(const String& p_strService,
+                              const String& p_strProtocol);
+
+        const char* answerHostname(const uint32_t p_u32AnswerIndex);
+        IPAddress   answerIP(const uint32_t p_u32AnswerIndex);
+        uint16_t    answerPort(const uint32_t p_u32AnswerIndex);
+        // for compatibility...
+        String    hostname(const uint32_t p_u32AnswerIndex);
+        IPAddress IP(const uint32_t p_u32AnswerIndex);
+        uint16_t  port(const uint32_t p_u32AnswerIndex);
 
-    /**
+        /**
         hMDNSServiceQuery (opaque handle to access dynamic service queries)
     */
-    typedef const void*     hMDNSServiceQuery;
+        typedef const void* hMDNSServiceQuery;
 
-    /**
+        /**
         enuServiceQueryAnswerType
     */
-    typedef enum _enuServiceQueryAnswerType
-    {
-        ServiceQueryAnswerType_ServiceDomain        = (1 << 0), // Service instance name
-        ServiceQueryAnswerType_HostDomainAndPort    = (1 << 1), // Host domain and service port
-        ServiceQueryAnswerType_Txts                 = (1 << 2), // TXT items
+        typedef enum _enuServiceQueryAnswerType
+        {
+            ServiceQueryAnswerType_ServiceDomain     = (1 << 0),  // Service instance name
+            ServiceQueryAnswerType_HostDomainAndPort = (1 << 1),  // Host domain and service port
+            ServiceQueryAnswerType_Txts              = (1 << 2),  // TXT items
 #ifdef MDNS_IP4_SUPPORT
-        ServiceQueryAnswerType_IP4Address           = (1 << 3), // IP4 address
+            ServiceQueryAnswerType_IP4Address = (1 << 3),  // IP4 address
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        ServiceQueryAnswerType_IP6Address           = (1 << 4), // IP6 address
+            ServiceQueryAnswerType_IP6Address = (1 << 4),  // IP6 address
 #endif
-    } enuServiceQueryAnswerType;
+        } enuServiceQueryAnswerType;
 
-    enum class AnswerType : uint32_t
-    {
-        Unknown                             = 0,
-        ServiceDomain                       = ServiceQueryAnswerType_ServiceDomain,
-        HostDomainAndPort                   = ServiceQueryAnswerType_HostDomainAndPort,
-        Txt                                 = ServiceQueryAnswerType_Txts,
+        enum class AnswerType : uint32_t
+        {
+            Unknown           = 0,
+            ServiceDomain     = ServiceQueryAnswerType_ServiceDomain,
+            HostDomainAndPort = ServiceQueryAnswerType_HostDomainAndPort,
+            Txt               = ServiceQueryAnswerType_Txts,
 #ifdef MDNS_IP4_SUPPORT
-        IP4Address                          = ServiceQueryAnswerType_IP4Address,
+            IP4Address = ServiceQueryAnswerType_IP4Address,
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        IP6Address                          = ServiceQueryAnswerType_IP6Address,
+            IP6Address = ServiceQueryAnswerType_IP6Address,
 #endif
-    };
+        };
 
-    /**
+        /**
         MDNSServiceQueryCallbackFn
         Callback function for received answers for dynamic service queries
     */
-    struct MDNSServiceInfo; // forward declaration
-    typedef std::function<void(const MDNSServiceInfo& mdnsServiceInfo,
-                               AnswerType answerType,     // flag for the updated answer item
-                               bool p_bSetContent                      // true: Answer component set, false: component deleted
-                              )> MDNSServiceQueryCallbackFunc;
-
-    // Install a dynamic service query. For every received answer (part) the given callback
-    // function is called. The query will be updated every time, the TTL for an answer
-    // has timed-out.
-    // The answers can also be retrieved by calling
-    // - answerCount
-    // - answerServiceDomain
-    // - hasAnswerHostDomain/answerHostDomain
-    // - hasAnswerIP4Address/answerIP4Address
-    // - hasAnswerIP6Address/answerIP6Address
-    // - hasAnswerPort/answerPort
-    // - hasAnswerTxts/answerTxts
-    hMDNSServiceQuery installServiceQuery(const char* p_pcService,
-                                          const char* p_pcProtocol,
-                                          MDNSServiceQueryCallbackFunc p_fnCallback);
-    // Remove a dynamic service query
-    bool removeServiceQuery(hMDNSServiceQuery p_hServiceQuery);
-
-    uint32_t answerCount(const hMDNSServiceQuery p_hServiceQuery);
-    std::vector<MDNSResponder::MDNSServiceInfo> answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery);
-
-    const char* answerServiceDomain(const hMDNSServiceQuery p_hServiceQuery,
-                                    const uint32_t p_u32AnswerIndex);
-    bool hasAnswerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
-                             const uint32_t p_u32AnswerIndex);
-    const char* answerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
-                                 const uint32_t p_u32AnswerIndex);
+        struct MDNSServiceInfo;  // forward declaration
+        typedef std::function<void(const MDNSServiceInfo& mdnsServiceInfo,
+                                   AnswerType             answerType,    // flag for the updated answer item
+                                   bool                   p_bSetContent  // true: Answer component set, false: component deleted
+                                   )>
+            MDNSServiceQueryCallbackFunc;
+
+        // Install a dynamic service query. For every received answer (part) the given callback
+        // function is called. The query will be updated every time, the TTL for an answer
+        // has timed-out.
+        // The answers can also be retrieved by calling
+        // - answerCount
+        // - answerServiceDomain
+        // - hasAnswerHostDomain/answerHostDomain
+        // - hasAnswerIP4Address/answerIP4Address
+        // - hasAnswerIP6Address/answerIP6Address
+        // - hasAnswerPort/answerPort
+        // - hasAnswerTxts/answerTxts
+        hMDNSServiceQuery installServiceQuery(const char*                  p_pcService,
+                                              const char*                  p_pcProtocol,
+                                              MDNSServiceQueryCallbackFunc p_fnCallback);
+        // Remove a dynamic service query
+        bool removeServiceQuery(hMDNSServiceQuery p_hServiceQuery);
+
+        uint32_t                                    answerCount(const hMDNSServiceQuery p_hServiceQuery);
+        std::vector<MDNSResponder::MDNSServiceInfo> answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery);
+
+        const char* answerServiceDomain(const hMDNSServiceQuery p_hServiceQuery,
+                                        const uint32_t          p_u32AnswerIndex);
+        bool        hasAnswerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
+                                        const uint32_t          p_u32AnswerIndex);
+        const char* answerHostDomain(const hMDNSServiceQuery p_hServiceQuery,
+                                     const uint32_t          p_u32AnswerIndex);
 #ifdef MDNS_IP4_SUPPORT
-    bool hasAnswerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
-                             const uint32_t p_u32AnswerIndex);
-    uint32_t answerIP4AddressCount(const hMDNSServiceQuery p_hServiceQuery,
-                                   const uint32_t p_u32AnswerIndex);
-    IPAddress answerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
-                               const uint32_t p_u32AnswerIndex,
-                               const uint32_t p_u32AddressIndex);
+        bool      hasAnswerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
+                                      const uint32_t          p_u32AnswerIndex);
+        uint32_t  answerIP4AddressCount(const hMDNSServiceQuery p_hServiceQuery,
+                                        const uint32_t          p_u32AnswerIndex);
+        IPAddress answerIP4Address(const hMDNSServiceQuery p_hServiceQuery,
+                                   const uint32_t          p_u32AnswerIndex,
+                                   const uint32_t          p_u32AddressIndex);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-    bool hasAnswerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
-                             const uint32_t p_u32AnswerIndex);
-    uint32_t answerIP6AddressCount(const hMDNSServiceQuery p_hServiceQuery,
-                                   const uint32_t p_u32AnswerIndex);
-    IPAddress answerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
-                               const uint32_t p_u32AnswerIndex,
-                               const uint32_t p_u32AddressIndex);
+        bool      hasAnswerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
+                                      const uint32_t          p_u32AnswerIndex);
+        uint32_t  answerIP6AddressCount(const hMDNSServiceQuery p_hServiceQuery,
+                                        const uint32_t          p_u32AnswerIndex);
+        IPAddress answerIP6Address(const hMDNSServiceQuery p_hServiceQuery,
+                                   const uint32_t          p_u32AnswerIndex,
+                                   const uint32_t          p_u32AddressIndex);
 #endif
-    bool hasAnswerPort(const hMDNSServiceQuery p_hServiceQuery,
-                       const uint32_t p_u32AnswerIndex);
-    uint16_t answerPort(const hMDNSServiceQuery p_hServiceQuery,
-                        const uint32_t p_u32AnswerIndex);
-    bool hasAnswerTxts(const hMDNSServiceQuery p_hServiceQuery,
-                       const uint32_t p_u32AnswerIndex);
-    // Get the TXT items as a ';'-separated string
-    const char* answerTxts(const hMDNSServiceQuery p_hServiceQuery,
-                           const uint32_t p_u32AnswerIndex);
+        bool     hasAnswerPort(const hMDNSServiceQuery p_hServiceQuery,
+                               const uint32_t          p_u32AnswerIndex);
+        uint16_t answerPort(const hMDNSServiceQuery p_hServiceQuery,
+                            const uint32_t          p_u32AnswerIndex);
+        bool     hasAnswerTxts(const hMDNSServiceQuery p_hServiceQuery,
+                               const uint32_t          p_u32AnswerIndex);
+        // Get the TXT items as a ';'-separated string
+        const char* answerTxts(const hMDNSServiceQuery p_hServiceQuery,
+                               const uint32_t          p_u32AnswerIndex);
 
-    /**
+        /**
         MDNSProbeResultCallbackFn
         Callback function for (host and service domain) probe results
     */
-    typedef std::function<void(const char* p_pcDomainName,
-                               bool p_bProbeResult)> MDNSHostProbeFn;
-
-    typedef std::function<void(MDNSResponder& resp,
-                               const char* p_pcDomainName,
-                               bool p_bProbeResult)> MDNSHostProbeFn1;
-
-    typedef std::function<void(const char* p_pcServiceName,
-                               const hMDNSService p_hMDNSService,
-                               bool p_bProbeResult)> MDNSServiceProbeFn;
-
-    typedef std::function<void(MDNSResponder& resp,
-                               const char* p_pcServiceName,
-                               const hMDNSService p_hMDNSService,
-                               bool p_bProbeResult)> MDNSServiceProbeFn1;
-
-    // Set a global callback function for host and service probe results
-    // The callback function is called, when the probing for the host domain
-    // (or a service domain, which hasn't got a service specific callback)
-    // Succeeds or fails.
-    // In case of failure, the failed domain name should be changed.
-    bool setHostProbeResultCallback(MDNSHostProbeFn p_fnCallback);
-    bool setHostProbeResultCallback(MDNSHostProbeFn1 p_fnCallback);
-
-    // Set a service specific probe result callback
-    bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-                                       MDNSServiceProbeFn p_fnCallback);
-    bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-                                       MDNSServiceProbeFn1 p_fnCallback);
-
-    // Application should call this whenever AP is configured/disabled
-    bool notifyAPChange(void);
-
-    // 'update' should be called in every 'loop' to run the MDNS processing
-    bool update(void);
-
-    // 'announce' can be called every time, the configuration of some service
-    // changes. Mainly, this would be changed content of TXT items.
-    bool announce(void);
-
-    // Enable OTA update
-    hMDNSService enableArduino(uint16_t p_u16Port,
-                               bool p_bAuthUpload = false);
-
-    // Domain name helper
-    static bool indexDomain(char*& p_rpcDomain,
-                            const char* p_pcDivider = "-",
-                            const char* p_pcDefaultDomain = 0);
-
-    /** STRUCTS **/
-
-public:
-    /**
+        typedef std::function<void(const char* p_pcDomainName,
+                                   bool        p_bProbeResult)>
+            MDNSHostProbeFn;
+
+        typedef std::function<void(MDNSResponder& resp,
+                                   const char*    p_pcDomainName,
+                                   bool           p_bProbeResult)>
+            MDNSHostProbeFn1;
+
+        typedef std::function<void(const char*        p_pcServiceName,
+                                   const hMDNSService p_hMDNSService,
+                                   bool               p_bProbeResult)>
+            MDNSServiceProbeFn;
+
+        typedef std::function<void(MDNSResponder&     resp,
+                                   const char*        p_pcServiceName,
+                                   const hMDNSService p_hMDNSService,
+                                   bool               p_bProbeResult)>
+            MDNSServiceProbeFn1;
+
+        // Set a global callback function for host and service probe results
+        // The callback function is called, when the probing for the host domain
+        // (or a service domain, which hasn't got a service specific callback)
+        // Succeeds or fails.
+        // In case of failure, the failed domain name should be changed.
+        bool setHostProbeResultCallback(MDNSHostProbeFn p_fnCallback);
+        bool setHostProbeResultCallback(MDNSHostProbeFn1 p_fnCallback);
+
+        // Set a service specific probe result callback
+        bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+                                           MDNSServiceProbeFn                p_fnCallback);
+        bool setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+                                           MDNSServiceProbeFn1               p_fnCallback);
+
+        // Application should call this whenever AP is configured/disabled
+        bool notifyAPChange(void);
+
+        // 'update' should be called in every 'loop' to run the MDNS processing
+        bool update(void);
+
+        // 'announce' can be called every time, the configuration of some service
+        // changes. Mainly, this would be changed content of TXT items.
+        bool announce(void);
+
+        // Enable OTA update
+        hMDNSService enableArduino(uint16_t p_u16Port,
+                                   bool     p_bAuthUpload = false);
+
+        // Domain name helper
+        static bool indexDomain(char*&      p_rpcDomain,
+                                const char* p_pcDivider       = "-",
+                                const char* p_pcDefaultDomain = 0);
+
+        /** STRUCTS **/
+
+    public:
+        /**
         MDNSServiceInfo, used in application callbacks
     */
-    struct MDNSServiceInfo
-    {
-        MDNSServiceInfo(MDNSResponder& p_pM, MDNSResponder::hMDNSServiceQuery p_hS, uint32_t p_u32A)
-            : p_pMDNSResponder(p_pM),
-              p_hServiceQuery(p_hS),
-              p_u32AnswerIndex(p_u32A)
-        {};
-        struct CompareKey
+        struct MDNSServiceInfo
         {
-            bool operator()(char const *a, char const *b) const
+            MDNSServiceInfo(MDNSResponder& p_pM, MDNSResponder::hMDNSServiceQuery p_hS, uint32_t p_u32A) :
+                p_pMDNSResponder(p_pM),
+                p_hServiceQuery(p_hS),
+                p_u32AnswerIndex(p_u32A) {};
+            struct CompareKey
             {
-                return strcmp(a, b) < 0;
+                bool operator()(char const* a, char const* b) const
+                {
+                    return strcmp(a, b) < 0;
+                }
+            };
+            using KeyValueMap = std::map<const char*, const char*, CompareKey>;
+
+        protected:
+            MDNSResponder&                   p_pMDNSResponder;
+            MDNSResponder::hMDNSServiceQuery p_hServiceQuery;
+            uint32_t                         p_u32AnswerIndex;
+            KeyValueMap                      keyValueMap;
+
+        public:
+            const char* serviceDomain()
+            {
+                return p_pMDNSResponder.answerServiceDomain(p_hServiceQuery, p_u32AnswerIndex);
+            };
+            bool hostDomainAvailable()
+            {
+                return (p_pMDNSResponder.hasAnswerHostDomain(p_hServiceQuery, p_u32AnswerIndex));
             }
-        };
-        using KeyValueMap = std::map<const char*, const char*, CompareKey>;
-    protected:
-        MDNSResponder& p_pMDNSResponder;
-        MDNSResponder::hMDNSServiceQuery p_hServiceQuery;
-        uint32_t p_u32AnswerIndex;
-        KeyValueMap keyValueMap;
-    public:
-        const char* serviceDomain()
-        {
-            return p_pMDNSResponder.answerServiceDomain(p_hServiceQuery, p_u32AnswerIndex);
-        };
-        bool hostDomainAvailable()
-        {
-            return (p_pMDNSResponder.hasAnswerHostDomain(p_hServiceQuery, p_u32AnswerIndex));
-        }
-        const char* hostDomain()
-        {
-            return (hostDomainAvailable()) ?
-                   p_pMDNSResponder.answerHostDomain(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
-        };
-        bool hostPortAvailable()
-        {
-            return (p_pMDNSResponder.hasAnswerPort(p_hServiceQuery, p_u32AnswerIndex));
-        }
-        uint16_t hostPort()
-        {
-            return (hostPortAvailable()) ?
-                   p_pMDNSResponder.answerPort(p_hServiceQuery, p_u32AnswerIndex) : 0;
-        };
-        bool IP4AddressAvailable()
-        {
-            return (p_pMDNSResponder.hasAnswerIP4Address(p_hServiceQuery, p_u32AnswerIndex));
-        }
-        std::vector<IPAddress> IP4Adresses()
-        {
-            std::vector<IPAddress> internalIP;
-            if (IP4AddressAvailable())
+            const char* hostDomain()
+            {
+                return (hostDomainAvailable()) ? p_pMDNSResponder.answerHostDomain(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
+            };
+            bool hostPortAvailable()
+            {
+                return (p_pMDNSResponder.hasAnswerPort(p_hServiceQuery, p_u32AnswerIndex));
+            }
+            uint16_t hostPort()
+            {
+                return (hostPortAvailable()) ? p_pMDNSResponder.answerPort(p_hServiceQuery, p_u32AnswerIndex) : 0;
+            };
+            bool IP4AddressAvailable()
+            {
+                return (p_pMDNSResponder.hasAnswerIP4Address(p_hServiceQuery, p_u32AnswerIndex));
+            }
+            std::vector<IPAddress> IP4Adresses()
             {
-                uint16_t cntIP4Adress = p_pMDNSResponder.answerIP4AddressCount(p_hServiceQuery, p_u32AnswerIndex);
-                for (uint32_t u2 = 0; u2 < cntIP4Adress; ++u2)
+                std::vector<IPAddress> internalIP;
+                if (IP4AddressAvailable())
                 {
-                    internalIP.emplace_back(p_pMDNSResponder.answerIP4Address(p_hServiceQuery, p_u32AnswerIndex, u2));
+                    uint16_t cntIP4Adress = p_pMDNSResponder.answerIP4AddressCount(p_hServiceQuery, p_u32AnswerIndex);
+                    for (uint32_t u2 = 0; u2 < cntIP4Adress; ++u2)
+                    {
+                        internalIP.emplace_back(p_pMDNSResponder.answerIP4Address(p_hServiceQuery, p_u32AnswerIndex, u2));
+                    }
                 }
+                return internalIP;
+            };
+            bool txtAvailable()
+            {
+                return (p_pMDNSResponder.hasAnswerTxts(p_hServiceQuery, p_u32AnswerIndex));
             }
-            return internalIP;
-        };
-        bool txtAvailable()
-        {
-            return (p_pMDNSResponder.hasAnswerTxts(p_hServiceQuery, p_u32AnswerIndex));
-        }
-        const char* strKeyValue()
-        {
-            return (txtAvailable()) ?
-                   p_pMDNSResponder.answerTxts(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
-        };
-        const KeyValueMap& keyValues()
-        {
-            if (txtAvailable() && keyValueMap.size() == 0)
+            const char* strKeyValue()
             {
-                for (auto kv = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); kv != nullptr; kv = kv->m_pNext)
+                return (txtAvailable()) ? p_pMDNSResponder.answerTxts(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
+            };
+            const KeyValueMap& keyValues()
+            {
+                if (txtAvailable() && keyValueMap.size() == 0)
                 {
-                    keyValueMap.emplace(std::pair<const char*, const char*>(kv->m_pcKey, kv->m_pcValue));
+                    for (auto kv = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); kv != nullptr; kv = kv->m_pNext)
+                    {
+                        keyValueMap.emplace(std::pair<const char*, const char*>(kv->m_pcKey, kv->m_pcValue));
+                    }
                 }
+                return keyValueMap;
             }
-            return keyValueMap;
-        }
-        const char* value(const char* key)
-        {
-            char* result = nullptr;
-
-            for (stcMDNSServiceTxt* pTxt = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); pTxt; pTxt = pTxt->m_pNext)
+            const char* value(const char* key)
             {
-                if ((key) &&
-                        (0 == strcmp(pTxt->m_pcKey, key)))
+                char* result = nullptr;
+
+                for (stcMDNSServiceTxt* pTxt = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); pTxt; pTxt = pTxt->m_pNext)
                 {
-                    result = pTxt->m_pcValue;
-                    break;
+                    if ((key) && (0 == strcmp(pTxt->m_pcKey, key)))
+                    {
+                        result = pTxt->m_pcValue;
+                        break;
+                    }
                 }
+                return result;
             }
-            return result;
-        }
-    };
-protected:
+        };
 
-    /**
+    protected:
+        /**
         stcMDNSServiceTxt
     */
-    struct stcMDNSServiceTxt
-    {
-        stcMDNSServiceTxt* m_pNext;
-        char*              m_pcKey;
-        char*              m_pcValue;
-        bool               m_bTemp;
-
-        stcMDNSServiceTxt(const char* p_pcKey = 0,
-                          const char* p_pcValue = 0,
-                          bool p_bTemp = false);
-        stcMDNSServiceTxt(const stcMDNSServiceTxt& p_Other);
-        ~stcMDNSServiceTxt(void);
-
-        stcMDNSServiceTxt& operator=(const stcMDNSServiceTxt& p_Other);
-        bool clear(void);
-
-        char* allocKey(size_t p_stLength);
-        bool setKey(const char* p_pcKey,
-                    size_t p_stLength);
-        bool setKey(const char* p_pcKey);
-        bool releaseKey(void);
-
-        char* allocValue(size_t p_stLength);
-        bool setValue(const char* p_pcValue,
-                      size_t p_stLength);
-        bool setValue(const char* p_pcValue);
-        bool releaseValue(void);
-
-        bool set(const char* p_pcKey,
-                 const char* p_pcValue,
-                 bool p_bTemp = false);
-
-        bool update(const char* p_pcValue);
-
-        size_t length(void) const;
-    };
+        struct stcMDNSServiceTxt
+        {
+            stcMDNSServiceTxt* m_pNext;
+            char*              m_pcKey;
+            char*              m_pcValue;
+            bool               m_bTemp;
+
+            stcMDNSServiceTxt(const char* p_pcKey   = 0,
+                              const char* p_pcValue = 0,
+                              bool        p_bTemp   = false);
+            stcMDNSServiceTxt(const stcMDNSServiceTxt& p_Other);
+            ~stcMDNSServiceTxt(void);
+
+            stcMDNSServiceTxt& operator=(const stcMDNSServiceTxt& p_Other);
+            bool               clear(void);
+
+            char* allocKey(size_t p_stLength);
+            bool  setKey(const char* p_pcKey,
+                         size_t      p_stLength);
+            bool  setKey(const char* p_pcKey);
+            bool  releaseKey(void);
+
+            char* allocValue(size_t p_stLength);
+            bool  setValue(const char* p_pcValue,
+                           size_t      p_stLength);
+            bool  setValue(const char* p_pcValue);
+            bool  releaseValue(void);
+
+            bool set(const char* p_pcKey,
+                     const char* p_pcValue,
+                     bool        p_bTemp = false);
+
+            bool update(const char* p_pcValue);
+
+            size_t length(void) const;
+        };
 
-    /**
+        /**
         stcMDNSTxts
     */
-    struct stcMDNSServiceTxts
-    {
-        stcMDNSServiceTxt*  m_pTxts;
+        struct stcMDNSServiceTxts
+        {
+            stcMDNSServiceTxt* m_pTxts;
 
-        stcMDNSServiceTxts(void);
-        stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other);
-        ~stcMDNSServiceTxts(void);
+            stcMDNSServiceTxts(void);
+            stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other);
+            ~stcMDNSServiceTxts(void);
 
-        stcMDNSServiceTxts& operator=(const stcMDNSServiceTxts& p_Other);
+            stcMDNSServiceTxts& operator=(const stcMDNSServiceTxts& p_Other);
 
-        bool clear(void);
+            bool clear(void);
 
-        bool add(stcMDNSServiceTxt* p_pTxt);
-        bool remove(stcMDNSServiceTxt* p_pTxt);
+            bool add(stcMDNSServiceTxt* p_pTxt);
+            bool remove(stcMDNSServiceTxt* p_pTxt);
 
-        bool removeTempTxts(void);
+            bool removeTempTxts(void);
 
-        stcMDNSServiceTxt* find(const char* p_pcKey);
-        const stcMDNSServiceTxt* find(const char* p_pcKey) const;
-        stcMDNSServiceTxt* find(const stcMDNSServiceTxt* p_pTxt);
+            stcMDNSServiceTxt*       find(const char* p_pcKey);
+            const stcMDNSServiceTxt* find(const char* p_pcKey) const;
+            stcMDNSServiceTxt*       find(const stcMDNSServiceTxt* p_pTxt);
 
-        uint16_t length(void) const;
+            uint16_t length(void) const;
 
-        size_t c_strLength(void) const;
-        bool c_str(char* p_pcBuffer);
+            size_t c_strLength(void) const;
+            bool   c_str(char* p_pcBuffer);
 
-        size_t bufferLength(void) const;
-        bool buffer(char* p_pcBuffer);
+            size_t bufferLength(void) const;
+            bool   buffer(char* p_pcBuffer);
 
-        bool compare(const stcMDNSServiceTxts& p_Other) const;
-        bool operator==(const stcMDNSServiceTxts& p_Other) const;
-        bool operator!=(const stcMDNSServiceTxts& p_Other) const;
-    };
+            bool compare(const stcMDNSServiceTxts& p_Other) const;
+            bool operator==(const stcMDNSServiceTxts& p_Other) const;
+            bool operator!=(const stcMDNSServiceTxts& p_Other) const;
+        };
 
-    /**
+        /**
         enuContentFlags
     */
-    typedef enum _enuContentFlags
-    {
-        // Host
-        ContentFlag_A           = 0x01,
-        ContentFlag_PTR_IP4     = 0x02,
-        ContentFlag_PTR_IP6     = 0x04,
-        ContentFlag_AAAA        = 0x08,
-        // Service
-        ContentFlag_PTR_TYPE    = 0x10,
-        ContentFlag_PTR_NAME    = 0x20,
-        ContentFlag_TXT         = 0x40,
-        ContentFlag_SRV         = 0x80,
-    } enuContentFlags;
+        typedef enum _enuContentFlags
+        {
+            // Host
+            ContentFlag_A       = 0x01,
+            ContentFlag_PTR_IP4 = 0x02,
+            ContentFlag_PTR_IP6 = 0x04,
+            ContentFlag_AAAA    = 0x08,
+            // Service
+            ContentFlag_PTR_TYPE = 0x10,
+            ContentFlag_PTR_NAME = 0x20,
+            ContentFlag_TXT      = 0x40,
+            ContentFlag_SRV      = 0x80,
+        } enuContentFlags;
 
-    /**
+        /**
         stcMDNS_MsgHeader
     */
-    struct stcMDNS_MsgHeader
-    {
-        uint16_t        m_u16ID;            // Identifier
-        bool            m_1bQR      : 1;    // Query/Response flag
-        unsigned char   m_4bOpcode  : 4;    // Operation code
-        bool            m_1bAA      : 1;    // Authoritative Answer flag
-        bool            m_1bTC      : 1;    // Truncation flag
-        bool            m_1bRD      : 1;    // Recursion desired
-        bool            m_1bRA      : 1;    // Recursion available
-        unsigned char   m_3bZ       : 3;    // Zero
-        unsigned char   m_4bRCode   : 4;    // Response code
-        uint16_t        m_u16QDCount;       // Question count
-        uint16_t        m_u16ANCount;       // Answer count
-        uint16_t        m_u16NSCount;       // Authority Record count
-        uint16_t        m_u16ARCount;       // Additional Record count
-
-        stcMDNS_MsgHeader(uint16_t p_u16ID = 0,
-                          bool p_bQR = false,
-                          unsigned char p_ucOpcode = 0,
-                          bool p_bAA = false,
-                          bool p_bTC = false,
-                          bool p_bRD = false,
-                          bool p_bRA = false,
-                          unsigned char p_ucRCode = 0,
-                          uint16_t p_u16QDCount = 0,
-                          uint16_t p_u16ANCount = 0,
-                          uint16_t p_u16NSCount = 0,
-                          uint16_t p_u16ARCount = 0);
-    };
+        struct stcMDNS_MsgHeader
+        {
+            uint16_t      m_u16ID;         // Identifier
+            bool          m_1bQR     : 1;  // Query/Response flag
+            unsigned char m_4bOpcode : 4;  // Operation code
+            bool          m_1bAA     : 1;  // Authoritative Answer flag
+            bool          m_1bTC     : 1;  // Truncation flag
+            bool          m_1bRD     : 1;  // Recursion desired
+            bool          m_1bRA     : 1;  // Recursion available
+            unsigned char m_3bZ      : 3;  // Zero
+            unsigned char m_4bRCode  : 4;  // Response code
+            uint16_t      m_u16QDCount;    // Question count
+            uint16_t      m_u16ANCount;    // Answer count
+            uint16_t      m_u16NSCount;    // Authority Record count
+            uint16_t      m_u16ARCount;    // Additional Record count
+
+            stcMDNS_MsgHeader(uint16_t      p_u16ID      = 0,
+                              bool          p_bQR        = false,
+                              unsigned char p_ucOpcode   = 0,
+                              bool          p_bAA        = false,
+                              bool          p_bTC        = false,
+                              bool          p_bRD        = false,
+                              bool          p_bRA        = false,
+                              unsigned char p_ucRCode    = 0,
+                              uint16_t      p_u16QDCount = 0,
+                              uint16_t      p_u16ANCount = 0,
+                              uint16_t      p_u16NSCount = 0,
+                              uint16_t      p_u16ARCount = 0);
+        };
 
-    /**
+        /**
         stcMDNS_RRDomain
     */
-    struct stcMDNS_RRDomain
-    {
-        char            m_acName[MDNS_DOMAIN_MAXLENGTH];    // Encoded domain name
-        uint16_t        m_u16NameLength;                    // Length (incl. '\0')
+        struct stcMDNS_RRDomain
+        {
+            char     m_acName[MDNS_DOMAIN_MAXLENGTH];  // Encoded domain name
+            uint16_t m_u16NameLength;                  // Length (incl. '\0')
 
-        stcMDNS_RRDomain(void);
-        stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other);
+            stcMDNS_RRDomain(void);
+            stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other);
 
-        stcMDNS_RRDomain& operator=(const stcMDNS_RRDomain& p_Other);
+            stcMDNS_RRDomain& operator=(const stcMDNS_RRDomain& p_Other);
 
-        bool clear(void);
+            bool clear(void);
 
-        bool addLabel(const char* p_pcLabel,
-                      bool p_bPrependUnderline = false);
+            bool addLabel(const char* p_pcLabel,
+                          bool        p_bPrependUnderline = false);
 
-        bool compare(const stcMDNS_RRDomain& p_Other) const;
-        bool operator==(const stcMDNS_RRDomain& p_Other) const;
-        bool operator!=(const stcMDNS_RRDomain& p_Other) const;
-        bool operator>(const stcMDNS_RRDomain& p_Other) const;
+            bool compare(const stcMDNS_RRDomain& p_Other) const;
+            bool operator==(const stcMDNS_RRDomain& p_Other) const;
+            bool operator!=(const stcMDNS_RRDomain& p_Other) const;
+            bool operator>(const stcMDNS_RRDomain& p_Other) const;
 
-        size_t c_strLength(void) const;
-        bool c_str(char* p_pcBuffer);
-    };
+            size_t c_strLength(void) const;
+            bool   c_str(char* p_pcBuffer);
+        };
 
-    /**
+        /**
         stcMDNS_RRAttributes
     */
-    struct stcMDNS_RRAttributes
-    {
-        uint16_t            m_u16Type;      // Type
-        uint16_t            m_u16Class;     // Class, nearly always 'IN'
+        struct stcMDNS_RRAttributes
+        {
+            uint16_t m_u16Type;   // Type
+            uint16_t m_u16Class;  // Class, nearly always 'IN'
 
-        stcMDNS_RRAttributes(uint16_t p_u16Type = 0,
-                             uint16_t p_u16Class = 1 /*DNS_RRCLASS_IN Internet*/);
-        stcMDNS_RRAttributes(const stcMDNS_RRAttributes& p_Other);
+            stcMDNS_RRAttributes(uint16_t p_u16Type  = 0,
+                                 uint16_t p_u16Class = 1 /*DNS_RRCLASS_IN Internet*/);
+            stcMDNS_RRAttributes(const stcMDNS_RRAttributes& p_Other);
 
-        stcMDNS_RRAttributes& operator=(const stcMDNS_RRAttributes& p_Other);
-    };
+            stcMDNS_RRAttributes& operator=(const stcMDNS_RRAttributes& p_Other);
+        };
 
-    /**
+        /**
         stcMDNS_RRHeader
     */
-    struct stcMDNS_RRHeader
-    {
-        stcMDNS_RRDomain        m_Domain;
-        stcMDNS_RRAttributes    m_Attributes;
+        struct stcMDNS_RRHeader
+        {
+            stcMDNS_RRDomain     m_Domain;
+            stcMDNS_RRAttributes m_Attributes;
 
-        stcMDNS_RRHeader(void);
-        stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other);
+            stcMDNS_RRHeader(void);
+            stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other);
 
-        stcMDNS_RRHeader& operator=(const stcMDNS_RRHeader& p_Other);
+            stcMDNS_RRHeader& operator=(const stcMDNS_RRHeader& p_Other);
 
-        bool clear(void);
-    };
+            bool clear(void);
+        };
 
-    /**
+        /**
         stcMDNS_RRQuestion
     */
-    struct stcMDNS_RRQuestion
-    {
-        stcMDNS_RRQuestion*     m_pNext;
-        stcMDNS_RRHeader        m_Header;
-        bool                    m_bUnicast;     // Unicast reply requested
+        struct stcMDNS_RRQuestion
+        {
+            stcMDNS_RRQuestion* m_pNext;
+            stcMDNS_RRHeader    m_Header;
+            bool                m_bUnicast;  // Unicast reply requested
 
-        stcMDNS_RRQuestion(void);
-    };
+            stcMDNS_RRQuestion(void);
+        };
 
-    /**
+        /**
         enuAnswerType
     */
-    typedef enum _enuAnswerType
-    {
-        AnswerType_A,
-        AnswerType_PTR,
-        AnswerType_TXT,
-        AnswerType_AAAA,
-        AnswerType_SRV,
-        AnswerType_Generic
-    } enuAnswerType;
+        typedef enum _enuAnswerType
+        {
+            AnswerType_A,
+            AnswerType_PTR,
+            AnswerType_TXT,
+            AnswerType_AAAA,
+            AnswerType_SRV,
+            AnswerType_Generic
+        } enuAnswerType;
 
-    /**
+        /**
         stcMDNS_RRAnswer
     */
-    struct stcMDNS_RRAnswer
-    {
-        stcMDNS_RRAnswer*   m_pNext;
-        const enuAnswerType m_AnswerType;
-        stcMDNS_RRHeader    m_Header;
-        bool                m_bCacheFlush;  // Cache flush command bit
-        uint32_t            m_u32TTL;       // Validity time in seconds
+        struct stcMDNS_RRAnswer
+        {
+            stcMDNS_RRAnswer*   m_pNext;
+            const enuAnswerType m_AnswerType;
+            stcMDNS_RRHeader    m_Header;
+            bool                m_bCacheFlush;  // Cache flush command bit
+            uint32_t            m_u32TTL;       // Validity time in seconds
 
-        virtual ~stcMDNS_RRAnswer(void);
+            virtual ~stcMDNS_RRAnswer(void);
 
-        enuAnswerType answerType(void) const;
+            enuAnswerType answerType(void) const;
 
-        bool clear(void);
+            bool clear(void);
 
-    protected:
-        stcMDNS_RRAnswer(enuAnswerType p_AnswerType,
-                         const stcMDNS_RRHeader& p_Header,
-                         uint32_t p_u32TTL);
-    };
+        protected:
+            stcMDNS_RRAnswer(enuAnswerType           p_AnswerType,
+                             const stcMDNS_RRHeader& p_Header,
+                             uint32_t                p_u32TTL);
+        };
 
 #ifdef MDNS_IP4_SUPPORT
-    /**
+        /**
         stcMDNS_RRAnswerA
     */
-    struct stcMDNS_RRAnswerA : public stcMDNS_RRAnswer
-    {
-        IPAddress           m_IPAddress;
+        struct stcMDNS_RRAnswerA: public stcMDNS_RRAnswer
+        {
+            IPAddress m_IPAddress;
 
-        stcMDNS_RRAnswerA(const stcMDNS_RRHeader& p_Header,
-                          uint32_t p_u32TTL);
-        ~stcMDNS_RRAnswerA(void);
+            stcMDNS_RRAnswerA(const stcMDNS_RRHeader& p_Header,
+                              uint32_t                p_u32TTL);
+            ~stcMDNS_RRAnswerA(void);
 
-        bool clear(void);
-    };
+            bool clear(void);
+        };
 #endif
 
-    /**
+        /**
         stcMDNS_RRAnswerPTR
     */
-    struct stcMDNS_RRAnswerPTR : public stcMDNS_RRAnswer
-    {
-        stcMDNS_RRDomain    m_PTRDomain;
+        struct stcMDNS_RRAnswerPTR: public stcMDNS_RRAnswer
+        {
+            stcMDNS_RRDomain m_PTRDomain;
 
-        stcMDNS_RRAnswerPTR(const stcMDNS_RRHeader& p_Header,
-                            uint32_t p_u32TTL);
-        ~stcMDNS_RRAnswerPTR(void);
+            stcMDNS_RRAnswerPTR(const stcMDNS_RRHeader& p_Header,
+                                uint32_t                p_u32TTL);
+            ~stcMDNS_RRAnswerPTR(void);
 
-        bool clear(void);
-    };
+            bool clear(void);
+        };
 
-    /**
+        /**
         stcMDNS_RRAnswerTXT
     */
-    struct stcMDNS_RRAnswerTXT : public stcMDNS_RRAnswer
-    {
-        stcMDNSServiceTxts  m_Txts;
+        struct stcMDNS_RRAnswerTXT: public stcMDNS_RRAnswer
+        {
+            stcMDNSServiceTxts m_Txts;
 
-        stcMDNS_RRAnswerTXT(const stcMDNS_RRHeader& p_Header,
-                            uint32_t p_u32TTL);
-        ~stcMDNS_RRAnswerTXT(void);
+            stcMDNS_RRAnswerTXT(const stcMDNS_RRHeader& p_Header,
+                                uint32_t                p_u32TTL);
+            ~stcMDNS_RRAnswerTXT(void);
 
-        bool clear(void);
-    };
+            bool clear(void);
+        };
 
 #ifdef MDNS_IP6_SUPPORT
-    /**
+        /**
         stcMDNS_RRAnswerAAAA
     */
-    struct stcMDNS_RRAnswerAAAA : public stcMDNS_RRAnswer
-    {
-        //TODO: IP6Address          m_IPAddress;
+        struct stcMDNS_RRAnswerAAAA: public stcMDNS_RRAnswer
+        {
+            //TODO: IP6Address          m_IPAddress;
 
-        stcMDNS_RRAnswerAAAA(const stcMDNS_RRHeader& p_Header,
-                             uint32_t p_u32TTL);
-        ~stcMDNS_RRAnswerAAAA(void);
+            stcMDNS_RRAnswerAAAA(const stcMDNS_RRHeader& p_Header,
+                                 uint32_t                p_u32TTL);
+            ~stcMDNS_RRAnswerAAAA(void);
 
-        bool clear(void);
-    };
+            bool clear(void);
+        };
 #endif
 
-    /**
+        /**
         stcMDNS_RRAnswerSRV
     */
-    struct stcMDNS_RRAnswerSRV : public stcMDNS_RRAnswer
-    {
-        uint16_t            m_u16Priority;
-        uint16_t            m_u16Weight;
-        uint16_t            m_u16Port;
-        stcMDNS_RRDomain    m_SRVDomain;
+        struct stcMDNS_RRAnswerSRV: public stcMDNS_RRAnswer
+        {
+            uint16_t         m_u16Priority;
+            uint16_t         m_u16Weight;
+            uint16_t         m_u16Port;
+            stcMDNS_RRDomain m_SRVDomain;
 
-        stcMDNS_RRAnswerSRV(const stcMDNS_RRHeader& p_Header,
-                            uint32_t p_u32TTL);
-        ~stcMDNS_RRAnswerSRV(void);
+            stcMDNS_RRAnswerSRV(const stcMDNS_RRHeader& p_Header,
+                                uint32_t                p_u32TTL);
+            ~stcMDNS_RRAnswerSRV(void);
 
-        bool clear(void);
-    };
+            bool clear(void);
+        };
 
-    /**
+        /**
         stcMDNS_RRAnswerGeneric
     */
-    struct stcMDNS_RRAnswerGeneric : public stcMDNS_RRAnswer
-    {
-        uint16_t            m_u16RDLength;  // Length of variable answer
-        uint8_t*            m_pu8RDData;    // Offset of start of variable answer in packet
-
-        stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
-                                uint32_t p_u32TTL);
-        ~stcMDNS_RRAnswerGeneric(void);
+        struct stcMDNS_RRAnswerGeneric: public stcMDNS_RRAnswer
+        {
+            uint16_t m_u16RDLength;  // Length of variable answer
+            uint8_t* m_pu8RDData;    // Offset of start of variable answer in packet
 
-        bool clear(void);
-    };
+            stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
+                                    uint32_t                p_u32TTL);
+            ~stcMDNS_RRAnswerGeneric(void);
 
+            bool clear(void);
+        };
 
-    /**
+        /**
         enuProbingStatus
     */
-    typedef enum _enuProbingStatus
-    {
-        ProbingStatus_WaitingForData,
-        ProbingStatus_ReadyToStart,
-        ProbingStatus_InProgress,
-        ProbingStatus_Done
-    } enuProbingStatus;
+        typedef enum _enuProbingStatus
+        {
+            ProbingStatus_WaitingForData,
+            ProbingStatus_ReadyToStart,
+            ProbingStatus_InProgress,
+            ProbingStatus_Done
+        } enuProbingStatus;
 
-    /**
+        /**
         stcProbeInformation
     */
-    struct stcProbeInformation
-    {
-        enuProbingStatus                  m_ProbingStatus;
-        uint8_t                           m_u8SentCount;  // Used for probes and announcements
-        esp8266::polledTimeout::oneShotMs m_Timeout;      // Used for probes and announcements
-        //clsMDNSTimeFlag                   m_TimeFlag;     // Used for probes and announcements
-        bool                              m_bConflict;
-        bool                              m_bTiebreakNeeded;
-        MDNSHostProbeFn   				m_fnHostProbeResultCallback;
-        MDNSServiceProbeFn 				m_fnServiceProbeResultCallback;
-
-        stcProbeInformation(void);
-
-        bool clear(bool p_bClearUserdata = false);
-    };
-
+        struct stcProbeInformation
+        {
+            enuProbingStatus                  m_ProbingStatus;
+            uint8_t                           m_u8SentCount;  // Used for probes and announcements
+            esp8266::polledTimeout::oneShotMs m_Timeout;      // Used for probes and announcements
+            //clsMDNSTimeFlag                   m_TimeFlag;     // Used for probes and announcements
+            bool               m_bConflict;
+            bool               m_bTiebreakNeeded;
+            MDNSHostProbeFn    m_fnHostProbeResultCallback;
+            MDNSServiceProbeFn m_fnServiceProbeResultCallback;
+
+            stcProbeInformation(void);
+
+            bool clear(bool p_bClearUserdata = false);
+        };
 
-    /**
+        /**
         stcMDNSService
     */
-    struct stcMDNSService
-    {
-        stcMDNSService*                 m_pNext;
-        char*                           m_pcName;
-        bool                            m_bAutoName;    // Name was set automatically to hostname (if no name was supplied)
-        char*                           m_pcService;
-        char*                           m_pcProtocol;
-        uint16_t                        m_u16Port;
-        uint8_t                         m_u8ReplyMask;
-        stcMDNSServiceTxts              m_Txts;
-        MDNSDynamicServiceTxtCallbackFunc m_fnTxtCallback;
-        stcProbeInformation             m_ProbeInformation;
-
-        stcMDNSService(const char* p_pcName = 0,
-                       const char* p_pcService = 0,
-                       const char* p_pcProtocol = 0);
-        ~stcMDNSService(void);
-
-        bool setName(const char* p_pcName);
-        bool releaseName(void);
-
-        bool setService(const char* p_pcService);
-        bool releaseService(void);
-
-        bool setProtocol(const char* p_pcProtocol);
-        bool releaseProtocol(void);
-    };
+        struct stcMDNSService
+        {
+            stcMDNSService*                   m_pNext;
+            char*                             m_pcName;
+            bool                              m_bAutoName;  // Name was set automatically to hostname (if no name was supplied)
+            char*                             m_pcService;
+            char*                             m_pcProtocol;
+            uint16_t                          m_u16Port;
+            uint8_t                           m_u8ReplyMask;
+            stcMDNSServiceTxts                m_Txts;
+            MDNSDynamicServiceTxtCallbackFunc m_fnTxtCallback;
+            stcProbeInformation               m_ProbeInformation;
+
+            stcMDNSService(const char* p_pcName     = 0,
+                           const char* p_pcService  = 0,
+                           const char* p_pcProtocol = 0);
+            ~stcMDNSService(void);
+
+            bool setName(const char* p_pcName);
+            bool releaseName(void);
+
+            bool setService(const char* p_pcService);
+            bool releaseService(void);
+
+            bool setProtocol(const char* p_pcProtocol);
+            bool releaseProtocol(void);
+        };
 
-    /**
+        /**
         stcMDNSServiceQuery
     */
-    struct stcMDNSServiceQuery
-    {
-        /**
-            stcAnswer
-        */
-        struct stcAnswer
+        struct stcMDNSServiceQuery
         {
             /**
-                stcTTL
-            */
-            struct stcTTL
+            stcAnswer
+        */
+            struct stcAnswer
             {
                 /**
+                stcTTL
+            */
+                struct stcTTL
+                {
+                    /**
                     timeoutLevel_t
                 */
-                typedef uint8_t timeoutLevel_t;
-                /**
+                    typedef uint8_t timeoutLevel_t;
+                    /**
                     TIMEOUTLEVELs
                 */
-                const timeoutLevel_t    TIMEOUTLEVEL_UNSET      = 0;
-                const timeoutLevel_t    TIMEOUTLEVEL_BASE       = 80;
-                const timeoutLevel_t    TIMEOUTLEVEL_INTERVAL   = 5;
-                const timeoutLevel_t    TIMEOUTLEVEL_FINAL      = 100;
+                    const timeoutLevel_t TIMEOUTLEVEL_UNSET    = 0;
+                    const timeoutLevel_t TIMEOUTLEVEL_BASE     = 80;
+                    const timeoutLevel_t TIMEOUTLEVEL_INTERVAL = 5;
+                    const timeoutLevel_t TIMEOUTLEVEL_FINAL    = 100;
 
-                uint32_t                          m_u32TTL;
-                esp8266::polledTimeout::oneShotMs m_TTLTimeout;
-                timeoutLevel_t                    m_timeoutLevel;
+                    uint32_t                          m_u32TTL;
+                    esp8266::polledTimeout::oneShotMs m_TTLTimeout;
+                    timeoutLevel_t                    m_timeoutLevel;
 
-                using timeoutBase = decltype(m_TTLTimeout);
+                    using timeoutBase = decltype(m_TTLTimeout);
 
-                stcTTL(void);
-                bool set(uint32_t p_u32TTL);
+                    stcTTL(void);
+                    bool set(uint32_t p_u32TTL);
 
-                bool flagged(void);
-                bool restart(void);
+                    bool flagged(void);
+                    bool restart(void);
 
-                bool prepareDeletion(void);
-                bool finalTimeoutLevel(void) const;
+                    bool prepareDeletion(void);
+                    bool finalTimeoutLevel(void) const;
 
-                timeoutBase::timeType timeout(void) const;
-            };
+                    timeoutBase::timeType timeout(void) const;
+                };
 #ifdef MDNS_IP4_SUPPORT
-            /**
+                /**
                 stcIP4Address
             */
-            struct stcIP4Address
-            {
-                stcIP4Address*  m_pNext;
-                IPAddress       m_IPAddress;
-                stcTTL          m_TTL;
+                struct stcIP4Address
+                {
+                    stcIP4Address* m_pNext;
+                    IPAddress      m_IPAddress;
+                    stcTTL         m_TTL;
 
-                stcIP4Address(IPAddress p_IPAddress,
-                              uint32_t p_u32TTL = 0);
-            };
+                    stcIP4Address(IPAddress p_IPAddress,
+                                  uint32_t  p_u32TTL = 0);
+                };
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            /**
+                /**
                 stcIP6Address
             */
-            struct stcIP6Address
-            {
-                stcIP6Address*  m_pNext;
-                IP6Address      m_IPAddress;
-                stcTTL          m_TTL;
+                struct stcIP6Address
+                {
+                    stcIP6Address* m_pNext;
+                    IP6Address     m_IPAddress;
+                    stcTTL         m_TTL;
 
-                stcIP6Address(IPAddress p_IPAddress,
-                              uint32_t p_u32TTL = 0);
-            };
+                    stcIP6Address(IPAddress p_IPAddress,
+                                  uint32_t  p_u32TTL = 0);
+                };
 #endif
 
-            stcAnswer*          m_pNext;
-            // The service domain is the first 'answer' (from PTR answer, using service and protocol) to be set
-            // Defines the key for additional answer, like host domain, etc.
-            stcMDNS_RRDomain    m_ServiceDomain;    // 1. level answer (PTR), eg. MyESP._http._tcp.local
-            char*               m_pcServiceDomain;
-            stcTTL              m_TTLServiceDomain;
-            stcMDNS_RRDomain    m_HostDomain;       // 2. level answer (SRV, using service domain), eg. esp8266.local
-            char*               m_pcHostDomain;
-            uint16_t            m_u16Port;          // 2. level answer (SRV, using service domain), eg. 5000
-            stcTTL              m_TTLHostDomainAndPort;
-            stcMDNSServiceTxts  m_Txts;             // 2. level answer (TXT, using service domain), eg. c#=1
-            char*               m_pcTxts;
-            stcTTL              m_TTLTxts;
+                stcAnswer* m_pNext;
+                // The service domain is the first 'answer' (from PTR answer, using service and protocol) to be set
+                // Defines the key for additional answer, like host domain, etc.
+                stcMDNS_RRDomain   m_ServiceDomain;  // 1. level answer (PTR), eg. MyESP._http._tcp.local
+                char*              m_pcServiceDomain;
+                stcTTL             m_TTLServiceDomain;
+                stcMDNS_RRDomain   m_HostDomain;  // 2. level answer (SRV, using service domain), eg. esp8266.local
+                char*              m_pcHostDomain;
+                uint16_t           m_u16Port;  // 2. level answer (SRV, using service domain), eg. 5000
+                stcTTL             m_TTLHostDomainAndPort;
+                stcMDNSServiceTxts m_Txts;  // 2. level answer (TXT, using service domain), eg. c#=1
+                char*              m_pcTxts;
+                stcTTL             m_TTLTxts;
 #ifdef MDNS_IP4_SUPPORT
-            stcIP4Address*      m_pIP4Addresses;    // 3. level answer (A, using host domain), eg. 123.456.789.012
+                stcIP4Address* m_pIP4Addresses;  // 3. level answer (A, using host domain), eg. 123.456.789.012
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            stcIP6Address*      m_pIP6Addresses;    // 3. level answer (AAAA, using host domain), eg. 1234::09
+                stcIP6Address* m_pIP6Addresses;  // 3. level answer (AAAA, using host domain), eg. 1234::09
 #endif
-            uint32_t            m_u32ContentFlags;
+                uint32_t m_u32ContentFlags;
 
-            stcAnswer(void);
-            ~stcAnswer(void);
+                stcAnswer(void);
+                ~stcAnswer(void);
 
-            bool clear(void);
+                bool clear(void);
 
-            char* allocServiceDomain(size_t p_stLength);
-            bool releaseServiceDomain(void);
+                char* allocServiceDomain(size_t p_stLength);
+                bool  releaseServiceDomain(void);
 
-            char* allocHostDomain(size_t p_stLength);
-            bool releaseHostDomain(void);
+                char* allocHostDomain(size_t p_stLength);
+                bool  releaseHostDomain(void);
 
-            char* allocTxts(size_t p_stLength);
-            bool releaseTxts(void);
+                char* allocTxts(size_t p_stLength);
+                bool  releaseTxts(void);
 
 #ifdef MDNS_IP4_SUPPORT
-            bool releaseIP4Addresses(void);
-            bool addIP4Address(stcIP4Address* p_pIP4Address);
-            bool removeIP4Address(stcIP4Address* p_pIP4Address);
-            const stcIP4Address* findIP4Address(const IPAddress& p_IPAddress) const;
-            stcIP4Address* findIP4Address(const IPAddress& p_IPAddress);
-            uint32_t IP4AddressCount(void) const;
-            const stcIP4Address* IP4AddressAtIndex(uint32_t p_u32Index) const;
-            stcIP4Address* IP4AddressAtIndex(uint32_t p_u32Index);
+                bool                 releaseIP4Addresses(void);
+                bool                 addIP4Address(stcIP4Address* p_pIP4Address);
+                bool                 removeIP4Address(stcIP4Address* p_pIP4Address);
+                const stcIP4Address* findIP4Address(const IPAddress& p_IPAddress) const;
+                stcIP4Address*       findIP4Address(const IPAddress& p_IPAddress);
+                uint32_t             IP4AddressCount(void) const;
+                const stcIP4Address* IP4AddressAtIndex(uint32_t p_u32Index) const;
+                stcIP4Address*       IP4AddressAtIndex(uint32_t p_u32Index);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            bool releaseIP6Addresses(void);
-            bool addIP6Address(stcIP6Address* p_pIP6Address);
-            bool removeIP6Address(stcIP6Address* p_pIP6Address);
-            const stcIP6Address* findIP6Address(const IPAddress& p_IPAddress) const;
-            stcIP6Address* findIP6Address(const IPAddress& p_IPAddress);
-            uint32_t IP6AddressCount(void) const;
-            const stcIP6Address* IP6AddressAtIndex(uint32_t p_u32Index) const;
-            stcIP6Address* IP6AddressAtIndex(uint32_t p_u32Index);
+                bool                 releaseIP6Addresses(void);
+                bool                 addIP6Address(stcIP6Address* p_pIP6Address);
+                bool                 removeIP6Address(stcIP6Address* p_pIP6Address);
+                const stcIP6Address* findIP6Address(const IPAddress& p_IPAddress) const;
+                stcIP6Address*       findIP6Address(const IPAddress& p_IPAddress);
+                uint32_t             IP6AddressCount(void) const;
+                const stcIP6Address* IP6AddressAtIndex(uint32_t p_u32Index) const;
+                stcIP6Address*       IP6AddressAtIndex(uint32_t p_u32Index);
 #endif
-        };
+            };
 
-        stcMDNSServiceQuery*              m_pNext;
-        stcMDNS_RRDomain                  m_ServiceTypeDomain;    // eg. _http._tcp.local
-        MDNSServiceQueryCallbackFunc      m_fnCallback;
-        bool                              m_bLegacyQuery;
-        uint8_t                           m_u8SentCount;
-        esp8266::polledTimeout::oneShotMs m_ResendTimeout;
-        bool                              m_bAwaitingAnswers;
-        stcAnswer*                        m_pAnswers;
+            stcMDNSServiceQuery*              m_pNext;
+            stcMDNS_RRDomain                  m_ServiceTypeDomain;  // eg. _http._tcp.local
+            MDNSServiceQueryCallbackFunc      m_fnCallback;
+            bool                              m_bLegacyQuery;
+            uint8_t                           m_u8SentCount;
+            esp8266::polledTimeout::oneShotMs m_ResendTimeout;
+            bool                              m_bAwaitingAnswers;
+            stcAnswer*                        m_pAnswers;
 
-        stcMDNSServiceQuery(void);
-        ~stcMDNSServiceQuery(void);
+            stcMDNSServiceQuery(void);
+            ~stcMDNSServiceQuery(void);
 
-        bool clear(void);
+            bool clear(void);
 
-        uint32_t answerCount(void) const;
-        const stcAnswer* answerAtIndex(uint32_t p_u32Index) const;
-        stcAnswer* answerAtIndex(uint32_t p_u32Index);
-        uint32_t indexOfAnswer(const stcAnswer* p_pAnswer) const;
+            uint32_t         answerCount(void) const;
+            const stcAnswer* answerAtIndex(uint32_t p_u32Index) const;
+            stcAnswer*       answerAtIndex(uint32_t p_u32Index);
+            uint32_t         indexOfAnswer(const stcAnswer* p_pAnswer) const;
 
-        bool addAnswer(stcAnswer* p_pAnswer);
-        bool removeAnswer(stcAnswer* p_pAnswer);
+            bool addAnswer(stcAnswer* p_pAnswer);
+            bool removeAnswer(stcAnswer* p_pAnswer);
 
-        stcAnswer* findAnswerForServiceDomain(const stcMDNS_RRDomain& p_ServiceDomain);
-        stcAnswer* findAnswerForHostDomain(const stcMDNS_RRDomain& p_HostDomain);
-    };
+            stcAnswer* findAnswerForServiceDomain(const stcMDNS_RRDomain& p_ServiceDomain);
+            stcAnswer* findAnswerForHostDomain(const stcMDNS_RRDomain& p_HostDomain);
+        };
 
-    /**
+        /**
         stcMDNSSendParameter
     */
-    struct stcMDNSSendParameter
-    {
-    protected:
-        /**
+        struct stcMDNSSendParameter
+        {
+        protected:
+            /**
             stcDomainCacheItem
         */
-        struct stcDomainCacheItem
-        {
-            stcDomainCacheItem*     m_pNext;
-            const void*             m_pHostnameOrService;   // Opaque id for host or service domain (pointer)
-            bool                    m_bAdditionalData;      // Opaque flag for special info (service domain included)
-            uint16_t                m_u16Offset;            // Offset in UDP output buffer
-
-            stcDomainCacheItem(const void* p_pHostnameOrService,
-                               bool p_bAdditionalData,
-                               uint32_t p_u16Offset);
-        };
+            struct stcDomainCacheItem
+            {
+                stcDomainCacheItem* m_pNext;
+                const void*         m_pHostnameOrService;  // Opaque id for host or service domain (pointer)
+                bool                m_bAdditionalData;     // Opaque flag for special info (service domain included)
+                uint16_t            m_u16Offset;           // Offset in UDP output buffer
+
+                stcDomainCacheItem(const void* p_pHostnameOrService,
+                                   bool        p_bAdditionalData,
+                                   uint32_t    p_u16Offset);
+            };
 
-    public:
-        uint16_t                m_u16ID;                    // Query ID (used only in lagacy queries)
-        stcMDNS_RRQuestion*     m_pQuestions;               // A list of queries
-        uint8_t                 m_u8HostReplyMask;          // Flags for reply components/answers
-        bool                    m_bLegacyQuery;             // Flag: Legacy query
-        bool                    m_bResponse;                // Flag: Response to a query
-        bool                    m_bAuthorative;             // Flag: Authoritative (owner) response
-        bool                    m_bCacheFlush;              // Flag: Clients should flush their caches
-        bool                    m_bUnicast;                 // Flag: Unicast response
-        bool                    m_bUnannounce;              // Flag: Unannounce service
-        uint16_t                m_u16Offset;                // Current offset in UDP write buffer (mainly for domain cache)
-        stcDomainCacheItem*     m_pDomainCacheItems;        // Cached host and service domains
-
-        stcMDNSSendParameter(void);
-        ~stcMDNSSendParameter(void);
-
-        bool clear(void);
-        bool clearCachedNames(void);
-
-        bool shiftOffset(uint16_t p_u16Shift);
-
-        bool addDomainCacheItem(const void* p_pHostnameOrService,
-                                bool p_bAdditionalData,
-                                uint16_t p_u16Offset);
-        uint16_t findCachedDomainOffset(const void* p_pHostnameOrService,
-                                        bool p_bAdditionalData) const;
-    };
+        public:
+            uint16_t            m_u16ID;              // Query ID (used only in lagacy queries)
+            stcMDNS_RRQuestion* m_pQuestions;         // A list of queries
+            uint8_t             m_u8HostReplyMask;    // Flags for reply components/answers
+            bool                m_bLegacyQuery;       // Flag: Legacy query
+            bool                m_bResponse;          // Flag: Response to a query
+            bool                m_bAuthorative;       // Flag: Authoritative (owner) response
+            bool                m_bCacheFlush;        // Flag: Clients should flush their caches
+            bool                m_bUnicast;           // Flag: Unicast response
+            bool                m_bUnannounce;        // Flag: Unannounce service
+            uint16_t            m_u16Offset;          // Current offset in UDP write buffer (mainly for domain cache)
+            stcDomainCacheItem* m_pDomainCacheItems;  // Cached host and service domains
+
+            stcMDNSSendParameter(void);
+            ~stcMDNSSendParameter(void);
 
-    // Instance variables
-    stcMDNSService*                 m_pServices;
-    UdpContext*                     m_pUDPContext;
-    char*                           m_pcHostname;
-    stcMDNSServiceQuery*            m_pServiceQueries;
-    MDNSDynamicServiceTxtCallbackFunc m_fnServiceTxtCallback;
-    stcProbeInformation             m_HostProbeInformation;
-
-    /** CONTROL **/
-    /* MAINTENANCE */
-    bool _process(bool p_bUserContext);
-    bool _restart(void);
-
-    /* RECEIVING */
-    bool _parseMessage(void);
-    bool _parseQuery(const stcMDNS_MsgHeader& p_Header);
-
-    bool _parseResponse(const stcMDNS_MsgHeader& p_Header);
-    bool _processAnswers(const stcMDNS_RRAnswer* p_pPTRAnswers);
-    bool _processPTRAnswer(const stcMDNS_RRAnswerPTR* p_pPTRAnswer,
-                           bool& p_rbFoundNewKeyAnswer);
-    bool _processSRVAnswer(const stcMDNS_RRAnswerSRV* p_pSRVAnswer,
-                           bool& p_rbFoundNewKeyAnswer);
-    bool _processTXTAnswer(const stcMDNS_RRAnswerTXT* p_pTXTAnswer);
+            bool clear(void);
+            bool clearCachedNames(void);
+
+            bool shiftOffset(uint16_t p_u16Shift);
+
+            bool     addDomainCacheItem(const void* p_pHostnameOrService,
+                                        bool        p_bAdditionalData,
+                                        uint16_t    p_u16Offset);
+            uint16_t findCachedDomainOffset(const void* p_pHostnameOrService,
+                                            bool        p_bAdditionalData) const;
+        };
+
+        // Instance variables
+        stcMDNSService*                   m_pServices;
+        UdpContext*                       m_pUDPContext;
+        char*                             m_pcHostname;
+        stcMDNSServiceQuery*              m_pServiceQueries;
+        MDNSDynamicServiceTxtCallbackFunc m_fnServiceTxtCallback;
+        stcProbeInformation               m_HostProbeInformation;
+
+        /** CONTROL **/
+        /* MAINTENANCE */
+        bool _process(bool p_bUserContext);
+        bool _restart(void);
+
+        /* RECEIVING */
+        bool _parseMessage(void);
+        bool _parseQuery(const stcMDNS_MsgHeader& p_Header);
+
+        bool _parseResponse(const stcMDNS_MsgHeader& p_Header);
+        bool _processAnswers(const stcMDNS_RRAnswer* p_pPTRAnswers);
+        bool _processPTRAnswer(const stcMDNS_RRAnswerPTR* p_pPTRAnswer,
+                               bool&                      p_rbFoundNewKeyAnswer);
+        bool _processSRVAnswer(const stcMDNS_RRAnswerSRV* p_pSRVAnswer,
+                               bool&                      p_rbFoundNewKeyAnswer);
+        bool _processTXTAnswer(const stcMDNS_RRAnswerTXT* p_pTXTAnswer);
 #ifdef MDNS_IP4_SUPPORT
-    bool _processAAnswer(const stcMDNS_RRAnswerA* p_pAAnswer);
+        bool _processAAnswer(const stcMDNS_RRAnswerA* p_pAAnswer);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-    bool _processAAAAAnswer(const stcMDNS_RRAnswerAAAA* p_pAAAAAnswer);
+        bool _processAAAAAnswer(const stcMDNS_RRAnswerAAAA* p_pAAAAAnswer);
 #endif
 
-    /* PROBING */
-    bool _updateProbeStatus(void);
-    bool _resetProbeStatus(bool p_bRestart = true);
-    bool _hasProbesWaitingForAnswers(void) const;
-    bool _sendHostProbe(void);
-    bool _sendServiceProbe(stcMDNSService& p_rService);
-    bool _cancelProbingForHost(void);
-    bool _cancelProbingForService(stcMDNSService& p_rService);
-
-    /* ANNOUNCE */
-    bool _announce(bool p_bAnnounce,
-                   bool p_bIncludeServices);
-    bool _announceService(stcMDNSService& p_rService,
-                          bool p_bAnnounce = true);
-
-    /* SERVICE QUERY CACHE */
-    bool _hasServiceQueriesWaitingForAnswers(void) const;
-    bool _checkServiceQueryCache(void);
-
-    /** TRANSFER **/
-    /* SENDING */
-    bool _sendMDNSMessage(stcMDNSSendParameter& p_SendParameter);
-    bool _sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter);
-    bool _prepareMDNSMessage(stcMDNSSendParameter& p_SendParameter,
-                             IPAddress p_IPAddress);
-    bool _sendMDNSServiceQuery(const stcMDNSServiceQuery& p_ServiceQuery);
-    bool _sendMDNSQuery(const stcMDNS_RRDomain& p_QueryDomain,
-                        uint16_t p_u16QueryType,
-                        stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers = 0);
-
-    uint8_t _replyMaskForHost(const stcMDNS_RRHeader& p_RRHeader,
-                              bool* p_pbFullNameMatch = 0) const;
-    uint8_t _replyMaskForService(const stcMDNS_RRHeader& p_RRHeader,
-                                 const stcMDNSService& p_Service,
-                                 bool* p_pbFullNameMatch = 0) const;
-
-    /* RESOURCE RECORD */
-    bool _readRRQuestion(stcMDNS_RRQuestion& p_rQuestion);
-    bool _readRRAnswer(stcMDNS_RRAnswer*& p_rpAnswer);
+        /* PROBING */
+        bool _updateProbeStatus(void);
+        bool _resetProbeStatus(bool p_bRestart = true);
+        bool _hasProbesWaitingForAnswers(void) const;
+        bool _sendHostProbe(void);
+        bool _sendServiceProbe(stcMDNSService& p_rService);
+        bool _cancelProbingForHost(void);
+        bool _cancelProbingForService(stcMDNSService& p_rService);
+
+        /* ANNOUNCE */
+        bool _announce(bool p_bAnnounce,
+                       bool p_bIncludeServices);
+        bool _announceService(stcMDNSService& p_rService,
+                              bool            p_bAnnounce = true);
+
+        /* SERVICE QUERY CACHE */
+        bool _hasServiceQueriesWaitingForAnswers(void) const;
+        bool _checkServiceQueryCache(void);
+
+        /** TRANSFER **/
+        /* SENDING */
+        bool _sendMDNSMessage(stcMDNSSendParameter& p_SendParameter);
+        bool _sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter);
+        bool _prepareMDNSMessage(stcMDNSSendParameter& p_SendParameter,
+                                 IPAddress             p_IPAddress);
+        bool _sendMDNSServiceQuery(const stcMDNSServiceQuery& p_ServiceQuery);
+        bool _sendMDNSQuery(const stcMDNS_RRDomain&         p_QueryDomain,
+                            uint16_t                        p_u16QueryType,
+                            stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers = 0);
+
+        uint8_t _replyMaskForHost(const stcMDNS_RRHeader& p_RRHeader,
+                                  bool*                   p_pbFullNameMatch = 0) const;
+        uint8_t _replyMaskForService(const stcMDNS_RRHeader& p_RRHeader,
+                                     const stcMDNSService&   p_Service,
+                                     bool*                   p_pbFullNameMatch = 0) const;
+
+        /* RESOURCE RECORD */
+        bool _readRRQuestion(stcMDNS_RRQuestion& p_rQuestion);
+        bool _readRRAnswer(stcMDNS_RRAnswer*& p_rpAnswer);
 #ifdef MDNS_IP4_SUPPORT
-    bool _readRRAnswerA(stcMDNS_RRAnswerA& p_rRRAnswerA,
-                        uint16_t p_u16RDLength);
+        bool _readRRAnswerA(stcMDNS_RRAnswerA& p_rRRAnswerA,
+                            uint16_t           p_u16RDLength);
 #endif
-    bool _readRRAnswerPTR(stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
-                          uint16_t p_u16RDLength);
-    bool _readRRAnswerTXT(stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
-                          uint16_t p_u16RDLength);
+        bool _readRRAnswerPTR(stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
+                              uint16_t             p_u16RDLength);
+        bool _readRRAnswerTXT(stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
+                              uint16_t             p_u16RDLength);
 #ifdef MDNS_IP6_SUPPORT
-    bool _readRRAnswerAAAA(stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
-                           uint16_t p_u16RDLength);
+        bool _readRRAnswerAAAA(stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
+                               uint16_t              p_u16RDLength);
 #endif
-    bool _readRRAnswerSRV(stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
-                          uint16_t p_u16RDLength);
-    bool _readRRAnswerGeneric(stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
-                              uint16_t p_u16RDLength);
-
-    bool _readRRHeader(stcMDNS_RRHeader& p_rHeader);
-    bool _readRRDomain(stcMDNS_RRDomain& p_rRRDomain);
-    bool _readRRDomain_Loop(stcMDNS_RRDomain& p_rRRDomain,
-                            uint8_t p_u8Depth);
-    bool _readRRAttributes(stcMDNS_RRAttributes& p_rAttributes);
-
-    /* DOMAIN NAMES */
-    bool _buildDomainForHost(const char* p_pcHostname,
-                             stcMDNS_RRDomain& p_rHostDomain) const;
-    bool _buildDomainForDNSSD(stcMDNS_RRDomain& p_rDNSSDDomain) const;
-    bool _buildDomainForService(const stcMDNSService& p_Service,
-                                bool p_bIncludeName,
-                                stcMDNS_RRDomain& p_rServiceDomain) const;
-    bool _buildDomainForService(const char* p_pcService,
-                                const char* p_pcProtocol,
-                                stcMDNS_RRDomain& p_rServiceDomain) const;
+        bool _readRRAnswerSRV(stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
+                              uint16_t             p_u16RDLength);
+        bool _readRRAnswerGeneric(stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
+                                  uint16_t                 p_u16RDLength);
+
+        bool _readRRHeader(stcMDNS_RRHeader& p_rHeader);
+        bool _readRRDomain(stcMDNS_RRDomain& p_rRRDomain);
+        bool _readRRDomain_Loop(stcMDNS_RRDomain& p_rRRDomain,
+                                uint8_t           p_u8Depth);
+        bool _readRRAttributes(stcMDNS_RRAttributes& p_rAttributes);
+
+        /* DOMAIN NAMES */
+        bool _buildDomainForHost(const char*       p_pcHostname,
+                                 stcMDNS_RRDomain& p_rHostDomain) const;
+        bool _buildDomainForDNSSD(stcMDNS_RRDomain& p_rDNSSDDomain) const;
+        bool _buildDomainForService(const stcMDNSService& p_Service,
+                                    bool                  p_bIncludeName,
+                                    stcMDNS_RRDomain&     p_rServiceDomain) const;
+        bool _buildDomainForService(const char*       p_pcService,
+                                    const char*       p_pcProtocol,
+                                    stcMDNS_RRDomain& p_rServiceDomain) const;
 #ifdef MDNS_IP4_SUPPORT
-    bool _buildDomainForReverseIP4(IPAddress p_IP4Address,
-                                   stcMDNS_RRDomain& p_rReverseIP4Domain) const;
+        bool _buildDomainForReverseIP4(IPAddress         p_IP4Address,
+                                       stcMDNS_RRDomain& p_rReverseIP4Domain) const;
 #endif
 #ifdef MDNS_IP6_SUPPORT
-    bool _buildDomainForReverseIP6(IPAddress p_IP4Address,
-                                   stcMDNS_RRDomain& p_rReverseIP6Domain) const;
+        bool _buildDomainForReverseIP6(IPAddress         p_IP4Address,
+                                       stcMDNS_RRDomain& p_rReverseIP6Domain) const;
 #endif
 
-    /* UDP */
-    bool _udpReadBuffer(unsigned char* p_pBuffer,
-                        size_t p_stLength);
-    bool _udpRead8(uint8_t& p_ru8Value);
-    bool _udpRead16(uint16_t& p_ru16Value);
-    bool _udpRead32(uint32_t& p_ru32Value);
+        /* UDP */
+        bool _udpReadBuffer(unsigned char* p_pBuffer,
+                            size_t         p_stLength);
+        bool _udpRead8(uint8_t& p_ru8Value);
+        bool _udpRead16(uint16_t& p_ru16Value);
+        bool _udpRead32(uint32_t& p_ru32Value);
 
-    bool _udpAppendBuffer(const unsigned char* p_pcBuffer,
-                          size_t p_stLength);
-    bool _udpAppend8(uint8_t p_u8Value);
-    bool _udpAppend16(uint16_t p_u16Value);
-    bool _udpAppend32(uint32_t p_u32Value);
+        bool _udpAppendBuffer(const unsigned char* p_pcBuffer,
+                              size_t               p_stLength);
+        bool _udpAppend8(uint8_t p_u8Value);
+        bool _udpAppend16(uint16_t p_u16Value);
+        bool _udpAppend32(uint32_t p_u32Value);
 
 #if not defined ESP_8266_MDNS_INCLUDE || defined DEBUG_ESP_MDNS_RESPONDER
-    bool _udpDump(bool p_bMovePointer = false);
-    bool _udpDump(unsigned p_uOffset,
-                  unsigned p_uLength);
+        bool _udpDump(bool p_bMovePointer = false);
+        bool _udpDump(unsigned p_uOffset,
+                      unsigned p_uLength);
 #endif
 
-    /* READ/WRITE MDNS STRUCTS */
-    bool _readMDNSMsgHeader(stcMDNS_MsgHeader& p_rMsgHeader);
-
-    bool _write8(uint8_t p_u8Value,
-                 stcMDNSSendParameter& p_rSendParameter);
-    bool _write16(uint16_t p_u16Value,
-                  stcMDNSSendParameter& p_rSendParameter);
-    bool _write32(uint32_t p_u32Value,
-                  stcMDNSSendParameter& p_rSendParameter);
+        /* READ/WRITE MDNS STRUCTS */
+        bool _readMDNSMsgHeader(stcMDNS_MsgHeader& p_rMsgHeader);
+
+        bool _write8(uint8_t               p_u8Value,
+                     stcMDNSSendParameter& p_rSendParameter);
+        bool _write16(uint16_t              p_u16Value,
+                      stcMDNSSendParameter& p_rSendParameter);
+        bool _write32(uint32_t              p_u32Value,
+                      stcMDNSSendParameter& p_rSendParameter);
+
+        bool _writeMDNSMsgHeader(const stcMDNS_MsgHeader& p_MsgHeader,
+                                 stcMDNSSendParameter&    p_rSendParameter);
+        bool _writeMDNSRRAttributes(const stcMDNS_RRAttributes& p_Attributes,
+                                    stcMDNSSendParameter&       p_rSendParameter);
+        bool _writeMDNSRRDomain(const stcMDNS_RRDomain& p_Domain,
+                                stcMDNSSendParameter&   p_rSendParameter);
+        bool _writeMDNSHostDomain(const char*           m_pcHostname,
+                                  bool                  p_bPrependRDLength,
+                                  stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSServiceDomain(const stcMDNSService& p_Service,
+                                     bool                  p_bIncludeName,
+                                     bool                  p_bPrependRDLength,
+                                     stcMDNSSendParameter& p_rSendParameter);
 
-    bool _writeMDNSMsgHeader(const stcMDNS_MsgHeader& p_MsgHeader,
-                             stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSRRAttributes(const stcMDNS_RRAttributes& p_Attributes,
+        bool _writeMDNSQuestion(stcMDNS_RRQuestion&   p_Question,
                                 stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSRRDomain(const stcMDNS_RRDomain& p_Domain,
-                            stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSHostDomain(const char* m_pcHostname,
-                              bool p_bPrependRDLength,
-                              stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSServiceDomain(const stcMDNSService& p_Service,
-                                 bool p_bIncludeName,
-                                 bool p_bPrependRDLength,
-                                 stcMDNSSendParameter& p_rSendParameter);
-
-    bool _writeMDNSQuestion(stcMDNS_RRQuestion& p_Question,
-                            stcMDNSSendParameter& p_rSendParameter);
 
 #ifdef MDNS_IP4_SUPPORT
-    bool _writeMDNSAnswer_A(IPAddress p_IPAddress,
-                            stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSAnswer_PTR_IP4(IPAddress p_IPAddress,
-                                  stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_A(IPAddress             p_IPAddress,
+                                stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_PTR_IP4(IPAddress             p_IPAddress,
+                                      stcMDNSSendParameter& p_rSendParameter);
 #endif
-    bool _writeMDNSAnswer_PTR_TYPE(stcMDNSService& p_rService,
-                                   stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSAnswer_PTR_NAME(stcMDNSService& p_rService,
-                                   stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSAnswer_TXT(stcMDNSService& p_rService,
-                              stcMDNSSendParameter& p_rSendParameter);
-#ifdef MDNS_IP6_SUPPORT
-    bool _writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
-                               stcMDNSSendParameter& p_rSendParameter);
-    bool _writeMDNSAnswer_PTR_IP6(IPAddress p_IPAddress,
+        bool _writeMDNSAnswer_PTR_TYPE(stcMDNSService&       p_rService,
+                                       stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_PTR_NAME(stcMDNSService&       p_rService,
+                                       stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_TXT(stcMDNSService&       p_rService,
                                   stcMDNSSendParameter& p_rSendParameter);
+#ifdef MDNS_IP6_SUPPORT
+        bool _writeMDNSAnswer_AAAA(IPAddress             p_IPAddress,
+                                   stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_PTR_IP6(IPAddress             p_IPAddress,
+                                      stcMDNSSendParameter& p_rSendParameter);
 #endif
-    bool _writeMDNSAnswer_SRV(stcMDNSService& p_rService,
-                              stcMDNSSendParameter& p_rSendParameter);
-
-    /** HELPERS **/
-    /* UDP CONTEXT */
-    bool _callProcess(void);
-    bool _allocUDPContext(void);
-    bool _releaseUDPContext(void);
-
-    /* SERVICE QUERY */
-    stcMDNSServiceQuery* _allocServiceQuery(void);
-    bool _removeServiceQuery(stcMDNSServiceQuery* p_pServiceQuery);
-    bool _removeLegacyServiceQuery(void);
-    stcMDNSServiceQuery* _findServiceQuery(hMDNSServiceQuery p_hServiceQuery);
-    stcMDNSServiceQuery* _findLegacyServiceQuery(void);
-    bool _releaseServiceQueries(void);
-    stcMDNSServiceQuery* _findNextServiceQueryByServiceType(const stcMDNS_RRDomain& p_ServiceDomain,
-            const stcMDNSServiceQuery* p_pPrevServiceQuery);
-
-    /* HOSTNAME */
-    bool _setHostname(const char* p_pcHostname);
-    bool _releaseHostname(void);
-
-    /* SERVICE */
-    stcMDNSService* _allocService(const char* p_pcName,
-                                  const char* p_pcService,
-                                  const char* p_pcProtocol,
-                                  uint16_t p_u16Port);
-    bool _releaseService(stcMDNSService* p_pService);
-    bool _releaseServices(void);
-
-    stcMDNSService* _findService(const char* p_pcName,
-                                 const char* p_pcService,
-                                 const char* p_pcProtocol);
-    stcMDNSService* _findService(const hMDNSService p_hService);
-
-    size_t _countServices(void) const;
-
-    /* SERVICE TXT */
-    stcMDNSServiceTxt* _allocServiceTxt(stcMDNSService* p_pService,
-                                        const char* p_pcKey,
-                                        const char* p_pcValue,
-                                        bool p_bTemp);
-    bool _releaseServiceTxt(stcMDNSService* p_pService,
-                            stcMDNSServiceTxt* p_pTxt);
-    stcMDNSServiceTxt* _updateServiceTxt(stcMDNSService* p_pService,
-                                         stcMDNSServiceTxt* p_pTxt,
-                                         const char* p_pcValue,
-                                         bool p_bTemp);
-
-    stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
-                                       const char* p_pcKey);
-    stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
-                                       const hMDNSTxt p_hTxt);
-
-    stcMDNSServiceTxt* _addServiceTxt(stcMDNSService* p_pService,
-                                      const char* p_pcKey,
-                                      const char* p_pcValue,
-                                      bool p_bTemp);
-
-    stcMDNSServiceTxt* _answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
-                                       const uint32_t p_u32AnswerIndex);
-
-    bool _collectServiceTxts(stcMDNSService& p_rService);
-    bool _releaseTempServiceTxts(stcMDNSService& p_rService);
-    const stcMDNSServiceTxt* _serviceTxts(const char* p_pcName,
-                                          const char* p_pcService,
-                                          const char* p_pcProtocol);
-
-    /* MISC */
+        bool _writeMDNSAnswer_SRV(stcMDNSService&       p_rService,
+                                  stcMDNSSendParameter& p_rSendParameter);
+
+        /** HELPERS **/
+        /* UDP CONTEXT */
+        bool _callProcess(void);
+        bool _allocUDPContext(void);
+        bool _releaseUDPContext(void);
+
+        /* SERVICE QUERY */
+        stcMDNSServiceQuery* _allocServiceQuery(void);
+        bool                 _removeServiceQuery(stcMDNSServiceQuery* p_pServiceQuery);
+        bool                 _removeLegacyServiceQuery(void);
+        stcMDNSServiceQuery* _findServiceQuery(hMDNSServiceQuery p_hServiceQuery);
+        stcMDNSServiceQuery* _findLegacyServiceQuery(void);
+        bool                 _releaseServiceQueries(void);
+        stcMDNSServiceQuery* _findNextServiceQueryByServiceType(const stcMDNS_RRDomain&    p_ServiceDomain,
+                                                                const stcMDNSServiceQuery* p_pPrevServiceQuery);
+
+        /* HOSTNAME */
+        bool _setHostname(const char* p_pcHostname);
+        bool _releaseHostname(void);
+
+        /* SERVICE */
+        stcMDNSService* _allocService(const char* p_pcName,
+                                      const char* p_pcService,
+                                      const char* p_pcProtocol,
+                                      uint16_t    p_u16Port);
+        bool            _releaseService(stcMDNSService* p_pService);
+        bool            _releaseServices(void);
+
+        stcMDNSService* _findService(const char* p_pcName,
+                                     const char* p_pcService,
+                                     const char* p_pcProtocol);
+        stcMDNSService* _findService(const hMDNSService p_hService);
+
+        size_t _countServices(void) const;
+
+        /* SERVICE TXT */
+        stcMDNSServiceTxt* _allocServiceTxt(stcMDNSService* p_pService,
+                                            const char*     p_pcKey,
+                                            const char*     p_pcValue,
+                                            bool            p_bTemp);
+        bool               _releaseServiceTxt(stcMDNSService*    p_pService,
+                                              stcMDNSServiceTxt* p_pTxt);
+        stcMDNSServiceTxt* _updateServiceTxt(stcMDNSService*    p_pService,
+                                             stcMDNSServiceTxt* p_pTxt,
+                                             const char*        p_pcValue,
+                                             bool               p_bTemp);
+
+        stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
+                                           const char*     p_pcKey);
+        stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
+                                           const hMDNSTxt  p_hTxt);
+
+        stcMDNSServiceTxt* _addServiceTxt(stcMDNSService* p_pService,
+                                          const char*     p_pcKey,
+                                          const char*     p_pcValue,
+                                          bool            p_bTemp);
+
+        stcMDNSServiceTxt* _answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
+                                           const uint32_t          p_u32AnswerIndex);
+
+        bool                     _collectServiceTxts(stcMDNSService& p_rService);
+        bool                     _releaseTempServiceTxts(stcMDNSService& p_rService);
+        const stcMDNSServiceTxt* _serviceTxts(const char* p_pcName,
+                                              const char* p_pcService,
+                                              const char* p_pcProtocol);
+
+        /* MISC */
 #if not defined ESP_8266_MDNS_INCLUDE || defined DEBUG_ESP_MDNS_RESPONDER
-    bool _printRRDomain(const stcMDNS_RRDomain& p_rRRDomain) const;
-    bool _printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAnswer) const;
+        bool _printRRDomain(const stcMDNS_RRDomain& p_rRRDomain) const;
+        bool _printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAnswer) const;
 #endif
-};
+    };
 
-}// namespace MDNSImplementation
+}  // namespace MDNSImplementation
 
-}// namespace esp8266
+}  // namespace esp8266
 
-#endif // MDNS_H
+#endif  // MDNS_H
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
index bf1b1cde26..7abc5a2309 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
@@ -33,7 +33,8 @@
     ESP8266mDNS Control.cpp
 */
 
-extern "C" {
+extern "C"
+{
 #include "user_interface.h"
 }
 
@@ -48,17 +49,15 @@ namespace esp8266
 */
 namespace MDNSImplementation
 {
-
-/**
+    /**
     CONTROL
 */
 
-
-/**
+    /**
     MAINTENANCE
 */
 
-/*
+    /*
     MDNSResponder::_process
 
     Run the MDNS process.
@@ -66,96 +65,90 @@ namespace MDNSImplementation
     should be called in every 'loop' by calling 'MDNS::update()'.
 
 */
-bool MDNSResponder::_process(bool p_bUserContext)
-{
-
-    bool    bResult = true;
-
-    if (!p_bUserContext)
+    bool MDNSResponder::_process(bool p_bUserContext)
     {
+        bool bResult = true;
 
-        if ((m_pUDPContext) &&          // UDPContext available AND
-                (m_pUDPContext->next()))    // has content
+        if (!p_bUserContext)
         {
-
-            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _update: Calling _parseMessage\n")););
-            bResult = _parseMessage();
-            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parsePacket %s\n"), (bResult ? "succeeded" : "FAILED")););
+            if ((m_pUDPContext) &&        // UDPContext available AND
+                (m_pUDPContext->next()))  // has content
+            {
+                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _update: Calling _parseMessage\n")););
+                bResult = _parseMessage();
+                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parsePacket %s\n"), (bResult ? "succeeded" : "FAILED")););
+            }
         }
+        else
+        {
+            bResult = _updateProbeStatus() &&  // Probing
+                _checkServiceQueryCache();     // Service query cache check
+        }
+        return bResult;
     }
-    else
-    {
-        bResult =  _updateProbeStatus() &&              // Probing
-                   _checkServiceQueryCache();           // Service query cache check
-    }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_restart
 */
-bool MDNSResponder::_restart(void)
-{
-
-    return ((_resetProbeStatus(true/*restart*/)) &&  // Stop and restart probing
-            (_allocUDPContext()));                   // Restart UDP
-}
+    bool MDNSResponder::_restart(void)
+    {
+        return ((_resetProbeStatus(true /*restart*/)) &&  // Stop and restart probing
+                (_allocUDPContext()));                    // Restart UDP
+    }
 
-/**
+    /**
     RECEIVING
 */
 
-/*
+    /*
     MDNSResponder::_parseMessage
 */
-bool MDNSResponder::_parseMessage(void)
-{
-    DEBUG_EX_INFO(
-        unsigned long   ulStartTime = millis();
-        unsigned        uStartMemory = ESP.getFreeHeap();
-        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage (Time: %lu ms, heap: %u bytes, from %s(%u), to %s(%u))\n"), ulStartTime, uStartMemory,
-                              IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), m_pUDPContext->getRemotePort(),
-                              IPAddress(m_pUDPContext->getDestAddress()).toString().c_str(), m_pUDPContext->getLocalPort());
-    );
-    //DEBUG_EX_INFO(_udpDump(););
-
-    bool    bResult = false;
-
-    stcMDNS_MsgHeader   header;
-    if (_readMDNSMsgHeader(header))
+    bool MDNSResponder::_parseMessage(void)
     {
-        if (0 == header.m_4bOpcode)     // A standard query
+        DEBUG_EX_INFO(
+            unsigned long ulStartTime  = millis();
+            unsigned      uStartMemory = ESP.getFreeHeap();
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage (Time: %lu ms, heap: %u bytes, from %s(%u), to %s(%u))\n"), ulStartTime, uStartMemory,
+                                  IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), m_pUDPContext->getRemotePort(),
+                                  IPAddress(m_pUDPContext->getDestAddress()).toString().c_str(), m_pUDPContext->getLocalPort()););
+        //DEBUG_EX_INFO(_udpDump(););
+
+        bool bResult = false;
+
+        stcMDNS_MsgHeader header;
+        if (_readMDNSMsgHeader(header))
         {
-            if (header.m_1bQR)          // Received a response -> answers to a query
+            if (0 == header.m_4bOpcode)  // A standard query
             {
-                //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading answers: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
-                bResult = _parseResponse(header);
+                if (header.m_1bQR)  // Received a response -> answers to a query
+                {
+                    //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading answers: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
+                    bResult = _parseResponse(header);
+                }
+                else  // Received a query (Questions)
+                {
+                    //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading query: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
+                    bResult = _parseQuery(header);
+                }
             }
-            else                        // Received a query (Questions)
+            else
             {
-                //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading query: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
-                bResult = _parseQuery(header);
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Received UNEXPECTED opcode:%u. Ignoring message!\n"), header.m_4bOpcode););
+                m_pUDPContext->flush();
             }
         }
         else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Received UNEXPECTED opcode:%u. Ignoring message!\n"), header.m_4bOpcode););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: FAILED to read header\n")););
             m_pUDPContext->flush();
         }
+        DEBUG_EX_INFO(
+            unsigned uFreeHeap = ESP.getFreeHeap();
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Done (%s after %lu ms, ate %i bytes, remaining %u)\n\n"), (bResult ? "Succeeded" : "FAILED"), (millis() - ulStartTime), (uStartMemory - uFreeHeap), uFreeHeap););
+        return bResult;
     }
-    else
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: FAILED to read header\n")););
-        m_pUDPContext->flush();
-    }
-    DEBUG_EX_INFO(
-        unsigned    uFreeHeap = ESP.getFreeHeap();
-        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Done (%s after %lu ms, ate %i bytes, remaining %u)\n\n"), (bResult ? "Succeeded" : "FAILED"), (millis() - ulStartTime), (uStartMemory - uFreeHeap), uFreeHeap);
-    );
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_parseQuery
 
     Queries are of interest in two cases:
@@ -172,427 +165,393 @@ bool MDNSResponder::_parseMessage(void)
 
     1.
 */
-bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
-{
-
-    bool    bResult = true;
-
-    stcMDNSSendParameter    sendParameter;
-    uint8_t                 u8HostOrServiceReplies = 0;
-    for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
+    bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
     {
+        bool bResult = true;
 
-        stcMDNS_RRQuestion  questionRR;
-        if ((bResult = _readRRQuestion(questionRR)))
-        {
-            // Define host replies, BUT only answer queries after probing is done
-            u8HostOrServiceReplies =
-                sendParameter.m_u8HostReplyMask |= (((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus))
-                                                    ? _replyMaskForHost(questionRR.m_Header, 0)
-                                                    : 0);
-            DEBUG_EX_INFO(if (u8HostOrServiceReplies)
+        stcMDNSSendParameter sendParameter;
+        uint8_t              u8HostOrServiceReplies = 0;
+        for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
         {
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Host reply needed 0x%X\n"), u8HostOrServiceReplies);
-            });
-
-            // Check tiebreak need for host domain
-            if (ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus)
+            stcMDNS_RRQuestion questionRR;
+            if ((bResult = _readRRQuestion(questionRR)))
             {
-                bool    bFullNameMatch = false;
-                if ((_replyMaskForHost(questionRR.m_Header, &bFullNameMatch)) &&
-                        (bFullNameMatch))
+                // Define host replies, BUT only answer queries after probing is done
+                u8HostOrServiceReplies = sendParameter.m_u8HostReplyMask |= (((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus))
+                                                                                 ? _replyMaskForHost(questionRR.m_Header, 0)
+                                                                                 : 0);
+                DEBUG_EX_INFO(if (u8HostOrServiceReplies)
+                              {
+                                  DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Host reply needed 0x%X\n"), u8HostOrServiceReplies);
+                              });
+
+                // Check tiebreak need for host domain
+                if (ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus)
                 {
-                    // We're in 'probing' state and someone is asking for our host domain: this might be
-                    // a race-condition: Two host with the same domain names try simutanously to probe their domains
-                    // See: RFC 6762, 8.2 (Tiebraking)
-                    // However, we're using a max. reduced approach for tiebreaking here: The higher IP-address wins!
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for host domain detected while probing.\n")););
+                    bool bFullNameMatch = false;
+                    if ((_replyMaskForHost(questionRR.m_Header, &bFullNameMatch)) && (bFullNameMatch))
+                    {
+                        // We're in 'probing' state and someone is asking for our host domain: this might be
+                        // a race-condition: Two host with the same domain names try simutanously to probe their domains
+                        // See: RFC 6762, 8.2 (Tiebraking)
+                        // However, we're using a max. reduced approach for tiebreaking here: The higher IP-address wins!
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for host domain detected while probing.\n")););
 
-                    m_HostProbeInformation.m_bTiebreakNeeded = true;
+                        m_HostProbeInformation.m_bTiebreakNeeded = true;
+                    }
                 }
-            }
 
-            // Define service replies
-            for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
-            {
-                // Define service replies, BUT only answer queries after probing is done
-                uint8_t u8ReplyMaskForQuestion = (((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus))
-                                                  ? _replyMaskForService(questionRR.m_Header, *pService, 0)
-                                                  : 0);
-                u8HostOrServiceReplies |= (pService->m_u8ReplyMask |= u8ReplyMaskForQuestion);
-                DEBUG_EX_INFO(if (u8ReplyMaskForQuestion)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service reply needed for (%s.%s.%s): 0x%X (%s)\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol, u8ReplyMaskForQuestion, IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str());
-                });
-
-                // Check tiebreak need for service domain
-                if (ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus)
+                // Define service replies
+                for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
                 {
-                    bool    bFullNameMatch = false;
-                    if ((_replyMaskForService(questionRR.m_Header, *pService, &bFullNameMatch)) &&
-                            (bFullNameMatch))
+                    // Define service replies, BUT only answer queries after probing is done
+                    uint8_t u8ReplyMaskForQuestion = (((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus))
+                                                          ? _replyMaskForService(questionRR.m_Header, *pService, 0)
+                                                          : 0);
+                    u8HostOrServiceReplies |= (pService->m_u8ReplyMask |= u8ReplyMaskForQuestion);
+                    DEBUG_EX_INFO(if (u8ReplyMaskForQuestion)
+                                  {
+                                      DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service reply needed for (%s.%s.%s): 0x%X (%s)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, u8ReplyMaskForQuestion, IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str());
+                                  });
+
+                    // Check tiebreak need for service domain
+                    if (ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus)
                     {
-                        // We're in 'probing' state and someone is asking for this service domain: this might be
-                        // a race-condition: Two services with the same domain names try simutanously to probe their domains
-                        // See: RFC 6762, 8.2 (Tiebraking)
-                        // However, we're using a max. reduced approach for tiebreaking here: The 'higher' SRV host wins!
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for service domain %s.%s.%s detected while probing.\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                        bool bFullNameMatch = false;
+                        if ((_replyMaskForService(questionRR.m_Header, *pService, &bFullNameMatch)) && (bFullNameMatch))
+                        {
+                            // We're in 'probing' state and someone is asking for this service domain: this might be
+                            // a race-condition: Two services with the same domain names try simutanously to probe their domains
+                            // See: RFC 6762, 8.2 (Tiebraking)
+                            // However, we're using a max. reduced approach for tiebreaking here: The 'higher' SRV host wins!
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for service domain %s.%s.%s detected while probing.\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
 
-                        pService->m_ProbeInformation.m_bTiebreakNeeded = true;
+                            pService->m_ProbeInformation.m_bTiebreakNeeded = true;
+                        }
                     }
                 }
-            }
 
-            // Handle unicast and legacy specialities
-            // If only one question asks for unicast reply, the whole reply packet is send unicast
-            if (((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) ||     // Unicast (maybe legacy) query OR
-                    (questionRR.m_bUnicast)) &&                                // Expressivly unicast query
+                // Handle unicast and legacy specialities
+                // If only one question asks for unicast reply, the whole reply packet is send unicast
+                if (((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) ||  // Unicast (maybe legacy) query OR
+                     (questionRR.m_bUnicast))
+                    &&  // Expressivly unicast query
                     (!sendParameter.m_bUnicast))
-            {
-
-                sendParameter.m_bUnicast = true;
-                sendParameter.m_bCacheFlush = false;
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Unicast response for %s!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
-
-                if ((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) &&  // Unicast (maybe legacy) query AND
-                        (1 == p_MsgHeader.m_u16QDCount) &&                          // Only one question AND
-                        ((sendParameter.m_u8HostReplyMask) ||                       //  Host replies OR
-                         (u8HostOrServiceReplies)))                                 //  Host or service replies available
                 {
-                    // We're a match for this legacy query, BUT
-                    // make sure, that the query comes from a local host
-                    ip_info IPInfo_Local;
-                    ip_info IPInfo_Remote;
-                    if (((IPInfo_Remote.ip.addr = m_pUDPContext->getRemoteAddress())) &&
-                            (((wifi_get_ip_info(SOFTAP_IF, &IPInfo_Local)) &&
-                              (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask))) ||  // Remote IP in SOFTAP's subnet OR
-                             ((wifi_get_ip_info(STATION_IF, &IPInfo_Local)) &&
-                              (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask)))))   // Remote IP in STATION's subnet
+                    sendParameter.m_bUnicast    = true;
+                    sendParameter.m_bCacheFlush = false;
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Unicast response for %s!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
+
+                    if ((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) &&  // Unicast (maybe legacy) query AND
+                        (1 == p_MsgHeader.m_u16QDCount) &&                      // Only one question AND
+                        ((sendParameter.m_u8HostReplyMask) ||                   //  Host replies OR
+                         (u8HostOrServiceReplies)))                             //  Host or service replies available
                     {
-
-                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from local host %s, id %u!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), p_MsgHeader.m_u16ID););
-
-                        sendParameter.m_u16ID = p_MsgHeader.m_u16ID;
-                        sendParameter.m_bLegacyQuery = true;
-                        sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
-                        if ((bResult = (0 != sendParameter.m_pQuestions)))
+                        // We're a match for this legacy query, BUT
+                        // make sure, that the query comes from a local host
+                        ip_info IPInfo_Local;
+                        ip_info IPInfo_Remote;
+                        if (((IPInfo_Remote.ip.addr = m_pUDPContext->getRemoteAddress())) && (((wifi_get_ip_info(SOFTAP_IF, &IPInfo_Local)) && (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask))) ||  // Remote IP in SOFTAP's subnet OR
+                                                                                              ((wifi_get_ip_info(STATION_IF, &IPInfo_Local)) && (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask)))))  // Remote IP in STATION's subnet
                         {
-                            sendParameter.m_pQuestions->m_Header.m_Domain = questionRR.m_Header.m_Domain;
-                            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = questionRR.m_Header.m_Attributes.m_u16Type;
-                            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = questionRR.m_Header.m_Attributes.m_u16Class;
+                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from local host %s, id %u!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), p_MsgHeader.m_u16ID););
+
+                            sendParameter.m_u16ID        = p_MsgHeader.m_u16ID;
+                            sendParameter.m_bLegacyQuery = true;
+                            sendParameter.m_pQuestions   = new stcMDNS_RRQuestion;
+                            if ((bResult = (0 != sendParameter.m_pQuestions)))
+                            {
+                                sendParameter.m_pQuestions->m_Header.m_Domain                = questionRR.m_Header.m_Domain;
+                                sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type  = questionRR.m_Header.m_Attributes.m_u16Type;
+                                sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = questionRR.m_Header.m_Attributes.m_u16Class;
+                            }
+                            else
+                            {
+                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to add legacy question!\n")););
+                            }
                         }
                         else
                         {
-                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to add legacy question!\n")););
+                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from NON-LOCAL host!\n")););
+                            bResult = false;
                         }
                     }
-                    else
-                    {
-                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from NON-LOCAL host!\n")););
-                        bResult = false;
-                    }
                 }
             }
-        }
-        else
-        {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read question!\n")););
-        }
-    }   // for questions
+            else
+            {
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read question!\n")););
+            }
+        }  // for questions
 
-    //DEBUG_EX_INFO(if (u8HostOrServiceReplies) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Reply needed: %u (%s: %s->%s)\n"), u8HostOrServiceReplies, clsTimeSyncer::timestr(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), IPAddress(m_pUDPContext->getDestAddress()).toString().c_str()); } );
+        //DEBUG_EX_INFO(if (u8HostOrServiceReplies) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Reply needed: %u (%s: %s->%s)\n"), u8HostOrServiceReplies, clsTimeSyncer::timestr(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), IPAddress(m_pUDPContext->getDestAddress()).toString().c_str()); } );
 
-    // Handle known answers
-    uint32_t    u32Answers = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
-    DEBUG_EX_INFO(if ((u8HostOrServiceReplies) && (u32Answers))
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Known answers(%u):\n"), u32Answers);
-    });
+        // Handle known answers
+        uint32_t u32Answers = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
+        DEBUG_EX_INFO(if ((u8HostOrServiceReplies) && (u32Answers))
+                      {
+                          DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Known answers(%u):\n"), u32Answers);
+                      });
 
-    for (uint32_t an = 0; ((bResult) && (an < u32Answers)); ++an)
-    {
-        stcMDNS_RRAnswer*   pKnownRRAnswer = 0;
-        if (((bResult = _readRRAnswer(pKnownRRAnswer))) &&
-                (pKnownRRAnswer))
+        for (uint32_t an = 0; ((bResult) && (an < u32Answers)); ++an)
         {
-
-            if ((DNS_RRTYPE_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Type) &&      // No ANY type answer
-                    (DNS_RRCLASS_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Class))      // No ANY class answer
+            stcMDNS_RRAnswer* pKnownRRAnswer = 0;
+            if (((bResult = _readRRAnswer(pKnownRRAnswer))) && (pKnownRRAnswer))
             {
-
-                // Find match between planned answer (sendParameter.m_u8HostReplyMask) and this 'known answer'
-                uint8_t u8HostMatchMask = (sendParameter.m_u8HostReplyMask & _replyMaskForHost(pKnownRRAnswer->m_Header));
-                if ((u8HostMatchMask) &&                                            // The RR in the known answer matches an RR we are planning to send, AND
-                        ((MDNS_HOST_TTL / 2) <= pKnownRRAnswer->m_u32TTL))              // The TTL of the known answer is longer than half of the new host TTL (120s)
+                if ((DNS_RRTYPE_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Type) &&  // No ANY type answer
+                    (DNS_RRCLASS_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Class))  // No ANY class answer
                 {
-
-                    // Compare contents
-                    if (AnswerType_PTR == pKnownRRAnswer->answerType())
+                    // Find match between planned answer (sendParameter.m_u8HostReplyMask) and this 'known answer'
+                    uint8_t u8HostMatchMask = (sendParameter.m_u8HostReplyMask & _replyMaskForHost(pKnownRRAnswer->m_Header));
+                    if ((u8HostMatchMask) &&                                // The RR in the known answer matches an RR we are planning to send, AND
+                        ((MDNS_HOST_TTL / 2) <= pKnownRRAnswer->m_u32TTL))  // The TTL of the known answer is longer than half of the new host TTL (120s)
                     {
-                        stcMDNS_RRDomain    hostDomain;
-                        if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                                (((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain == hostDomain))
+                        // Compare contents
+                        if (AnswerType_PTR == pKnownRRAnswer->answerType())
                         {
-                            // Host domain match
-#ifdef MDNS_IP4_SUPPORT
-                            if (u8HostMatchMask & ContentFlag_PTR_IP4)
+                            stcMDNS_RRDomain hostDomain;
+                            if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain == hostDomain))
                             {
-                                // IP4 PTR was asked for, but is already known -> skipping
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 PTR already known... skipping!\n")););
-                                sendParameter.m_u8HostReplyMask &= ~ContentFlag_PTR_IP4;
-                            }
+                                // Host domain match
+#ifdef MDNS_IP4_SUPPORT
+                                if (u8HostMatchMask & ContentFlag_PTR_IP4)
+                                {
+                                    // IP4 PTR was asked for, but is already known -> skipping
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 PTR already known... skipping!\n")););
+                                    sendParameter.m_u8HostReplyMask &= ~ContentFlag_PTR_IP4;
+                                }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                            if (u8HostMatchMask & ContentFlag_PTR_IP6)
-                            {
-                                // IP6 PTR was asked for, but is already known -> skipping
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 PTR already known... skipping!\n")););
-                                sendParameter.m_u8HostReplyMask &= ~ContentFlag_PTR_IP6;
-                            }
+                                if (u8HostMatchMask & ContentFlag_PTR_IP6)
+                                {
+                                    // IP6 PTR was asked for, but is already known -> skipping
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 PTR already known... skipping!\n")););
+                                    sendParameter.m_u8HostReplyMask &= ~ContentFlag_PTR_IP6;
+                                }
 #endif
+                            }
                         }
-                    }
-                    else if (u8HostMatchMask & ContentFlag_A)
-                    {
-                        // IP4 address was asked for
-#ifdef MDNS_IP4_SUPPORT
-                        if ((AnswerType_A == pKnownRRAnswer->answerType()) &&
-                                (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == m_pUDPContext->getInputNetif()->ip_addr))
+                        else if (u8HostMatchMask & ContentFlag_A)
                         {
-                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 address already known... skipping!\n")););
-                            sendParameter.m_u8HostReplyMask &= ~ContentFlag_A;
-                        }   // else: RData NOT IP4 length !!
+                            // IP4 address was asked for
+#ifdef MDNS_IP4_SUPPORT
+                            if ((AnswerType_A == pKnownRRAnswer->answerType()) && (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == m_pUDPContext->getInputNetif()->ip_addr))
+                            {
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 address already known... skipping!\n")););
+                                sendParameter.m_u8HostReplyMask &= ~ContentFlag_A;
+                            }  // else: RData NOT IP4 length !!
 #endif
-                    }
-                    else if (u8HostMatchMask & ContentFlag_AAAA)
-                    {
-                        // IP6 address was asked for
-#ifdef MDNS_IP6_SUPPORT
-                        if ((AnswerType_AAAA == pAnswerRR->answerType()) &&
-                                (((stcMDNS_RRAnswerAAAA*)pAnswerRR)->m_IPAddress == _getResponseMulticastInterface()))
+                        }
+                        else if (u8HostMatchMask & ContentFlag_AAAA)
                         {
-
-                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 address already known... skipping!\n")););
-                            sendParameter.m_u8HostReplyMask &= ~ContentFlag_AAAA;
-                        }   // else: RData NOT IP6 length !!
+                            // IP6 address was asked for
+#ifdef MDNS_IP6_SUPPORT
+                            if ((AnswerType_AAAA == pAnswerRR->answerType()) && (((stcMDNS_RRAnswerAAAA*)pAnswerRR)->m_IPAddress == _getResponseMulticastInterface()))
+                            {
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 address already known... skipping!\n")););
+                                sendParameter.m_u8HostReplyMask &= ~ContentFlag_AAAA;
+                            }  // else: RData NOT IP6 length !!
 #endif
-                    }
-                }   // Host match /*and TTL*/
+                        }
+                    }  // Host match /*and TTL*/
 
-                //
-                // Check host tiebreak possibility
-                if (m_HostProbeInformation.m_bTiebreakNeeded)
-                {
-                    stcMDNS_RRDomain    hostDomain;
-                    if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                            (pKnownRRAnswer->m_Header.m_Domain == hostDomain))
+                    //
+                    // Check host tiebreak possibility
+                    if (m_HostProbeInformation.m_bTiebreakNeeded)
                     {
-                        // Host domain match
-#ifdef MDNS_IP4_SUPPORT
-                        if (AnswerType_A == pKnownRRAnswer->answerType())
+                        stcMDNS_RRDomain hostDomain;
+                        if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (pKnownRRAnswer->m_Header.m_Domain == hostDomain))
                         {
-
-                            IPAddress localIPAddress(m_pUDPContext->getInputNetif()->ip_addr);
-                            if (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == localIPAddress)
-                            {
-                                // SAME IP address -> We've received an old message from ourselves (same IP)
-                                DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (was an old message)!\n")););
-                                m_HostProbeInformation.m_bTiebreakNeeded = false;
-                            }
-                            else
+                            // Host domain match
+#ifdef MDNS_IP4_SUPPORT
+                            if (AnswerType_A == pKnownRRAnswer->answerType())
                             {
-                                if ((uint32_t)(((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress) > (uint32_t)localIPAddress)   // The OTHER IP is 'higher' -> LOST
+                                IPAddress localIPAddress(m_pUDPContext->getInputNetif()->ip_addr);
+                                if (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == localIPAddress)
                                 {
-                                    // LOST tiebreak
-                                    DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) LOST (lower)!\n")););
-                                    _cancelProbingForHost();
+                                    // SAME IP address -> We've received an old message from ourselves (same IP)
+                                    DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (was an old message)!\n")););
                                     m_HostProbeInformation.m_bTiebreakNeeded = false;
                                 }
-                                else    // WON tiebreak
+                                else
                                 {
-                                    //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
-                                    DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (higher IP)!\n")););
-                                    m_HostProbeInformation.m_bTiebreakNeeded = false;
+                                    if ((uint32_t)(((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress) > (uint32_t)localIPAddress)  // The OTHER IP is 'higher' -> LOST
+                                    {
+                                        // LOST tiebreak
+                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) LOST (lower)!\n")););
+                                        _cancelProbingForHost();
+                                        m_HostProbeInformation.m_bTiebreakNeeded = false;
+                                    }
+                                    else  // WON tiebreak
+                                    {
+                                        //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
+                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (higher IP)!\n")););
+                                        m_HostProbeInformation.m_bTiebreakNeeded = false;
+                                    }
                                 }
                             }
-                        }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                        if (AnswerType_AAAA == pAnswerRR->answerType())
-                        {
-                            // TODO
-                        }
+                            if (AnswerType_AAAA == pAnswerRR->answerType())
+                            {
+                                // TODO
+                            }
 #endif
-                    }
-                }   // Host tiebreak possibility
-
-                // Check service answers
-                for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
-                {
-
-                    uint8_t u8ServiceMatchMask = (pService->m_u8ReplyMask & _replyMaskForService(pKnownRRAnswer->m_Header, *pService));
+                        }
+                    }  // Host tiebreak possibility
 
-                    if ((u8ServiceMatchMask) &&                                 // The RR in the known answer matches an RR we are planning to send, AND
-                            ((MDNS_SERVICE_TTL / 2) <= pKnownRRAnswer->m_u32TTL))   // The TTL of the known answer is longer than half of the new service TTL (4500s)
+                    // Check service answers
+                    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
                     {
+                        uint8_t u8ServiceMatchMask = (pService->m_u8ReplyMask & _replyMaskForService(pKnownRRAnswer->m_Header, *pService));
 
-                        if (AnswerType_PTR == pKnownRRAnswer->answerType())
+                        if ((u8ServiceMatchMask) &&                                // The RR in the known answer matches an RR we are planning to send, AND
+                            ((MDNS_SERVICE_TTL / 2) <= pKnownRRAnswer->m_u32TTL))  // The TTL of the known answer is longer than half of the new service TTL (4500s)
                         {
-                            stcMDNS_RRDomain    serviceDomain;
-                            if ((u8ServiceMatchMask & ContentFlag_PTR_TYPE) &&
-                                    (_buildDomainForService(*pService, false, serviceDomain)) &&
-                                    (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
-                            {
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service type PTR already known... skipping!\n")););
-                                pService->m_u8ReplyMask &= ~ContentFlag_PTR_TYPE;
-                            }
-                            if ((u8ServiceMatchMask & ContentFlag_PTR_NAME) &&
-                                    (_buildDomainForService(*pService, true, serviceDomain)) &&
-                                    (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
+                            if (AnswerType_PTR == pKnownRRAnswer->answerType())
                             {
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service name PTR already known... skipping!\n")););
-                                pService->m_u8ReplyMask &= ~ContentFlag_PTR_NAME;
+                                stcMDNS_RRDomain serviceDomain;
+                                if ((u8ServiceMatchMask & ContentFlag_PTR_TYPE) && (_buildDomainForService(*pService, false, serviceDomain)) && (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
+                                {
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service type PTR already known... skipping!\n")););
+                                    pService->m_u8ReplyMask &= ~ContentFlag_PTR_TYPE;
+                                }
+                                if ((u8ServiceMatchMask & ContentFlag_PTR_NAME) && (_buildDomainForService(*pService, true, serviceDomain)) && (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
+                                {
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service name PTR already known... skipping!\n")););
+                                    pService->m_u8ReplyMask &= ~ContentFlag_PTR_NAME;
+                                }
                             }
-                        }
-                        else if (u8ServiceMatchMask & ContentFlag_SRV)
-                        {
-                            DEBUG_EX_ERR(if (AnswerType_SRV != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (SRV)!\n")););
-                            stcMDNS_RRDomain    hostDomain;
-                            if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                                    (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))    // Host domain match
+                            else if (u8ServiceMatchMask & ContentFlag_SRV)
                             {
-
-                                if ((MDNS_SRV_PRIORITY == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Priority) &&
-                                        (MDNS_SRV_WEIGHT == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Weight) &&
-                                        (pService->m_u16Port == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Port))
+                                DEBUG_EX_ERR(if (AnswerType_SRV != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (SRV)!\n")););
+                                stcMDNS_RRDomain hostDomain;
+                                if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))  // Host domain match
                                 {
-
-                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service SRV answer already known... skipping!\n")););
-                                    pService->m_u8ReplyMask &= ~ContentFlag_SRV;
-                                }   // else: Small differences -> send update message
+                                    if ((MDNS_SRV_PRIORITY == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Priority) && (MDNS_SRV_WEIGHT == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Weight) && (pService->m_u16Port == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Port))
+                                    {
+                                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service SRV answer already known... skipping!\n")););
+                                        pService->m_u8ReplyMask &= ~ContentFlag_SRV;
+                                    }  // else: Small differences -> send update message
+                                }
                             }
-                        }
-                        else if (u8ServiceMatchMask & ContentFlag_TXT)
-                        {
-                            DEBUG_EX_ERR(if (AnswerType_TXT != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (TXT)!\n")););
-                            _collectServiceTxts(*pService);
-                            if (pService->m_Txts == ((stcMDNS_RRAnswerTXT*)pKnownRRAnswer)->m_Txts)
+                            else if (u8ServiceMatchMask & ContentFlag_TXT)
                             {
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service TXT answer already known... skipping!\n")););
-                                pService->m_u8ReplyMask &= ~ContentFlag_TXT;
+                                DEBUG_EX_ERR(if (AnswerType_TXT != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (TXT)!\n")););
+                                _collectServiceTxts(*pService);
+                                if (pService->m_Txts == ((stcMDNS_RRAnswerTXT*)pKnownRRAnswer)->m_Txts)
+                                {
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service TXT answer already known... skipping!\n")););
+                                    pService->m_u8ReplyMask &= ~ContentFlag_TXT;
+                                }
+                                _releaseTempServiceTxts(*pService);
                             }
-                            _releaseTempServiceTxts(*pService);
-                        }
-                    }   // Service match and enough TTL
+                        }  // Service match and enough TTL
 
-                    //
-                    // Check service tiebreak possibility
-                    if (pService->m_ProbeInformation.m_bTiebreakNeeded)
-                    {
-                        stcMDNS_RRDomain    serviceDomain;
-                        if ((_buildDomainForService(*pService, true, serviceDomain)) &&
-                                (pKnownRRAnswer->m_Header.m_Domain == serviceDomain))
+                        //
+                        // Check service tiebreak possibility
+                        if (pService->m_ProbeInformation.m_bTiebreakNeeded)
                         {
-                            // Service domain match
-                            if (AnswerType_SRV == pKnownRRAnswer->answerType())
+                            stcMDNS_RRDomain serviceDomain;
+                            if ((_buildDomainForService(*pService, true, serviceDomain)) && (pKnownRRAnswer->m_Header.m_Domain == serviceDomain))
                             {
-                                stcMDNS_RRDomain    hostDomain;
-                                if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                                        (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))    // Host domain match
-                                {
-
-                                    // We've received an old message from ourselves (same SRV)
-                                    DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (was an old message)!\n")););
-                                    pService->m_ProbeInformation.m_bTiebreakNeeded = false;
-                                }
-                                else
+                                // Service domain match
+                                if (AnswerType_SRV == pKnownRRAnswer->answerType())
                                 {
-                                    if (((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain > hostDomain)   // The OTHER domain is 'higher' -> LOST
+                                    stcMDNS_RRDomain hostDomain;
+                                    if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))  // Host domain match
                                     {
-                                        // LOST tiebreak
-                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) LOST (lower)!\n")););
-                                        _cancelProbingForService(*pService);
+                                        // We've received an old message from ourselves (same SRV)
+                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (was an old message)!\n")););
                                         pService->m_ProbeInformation.m_bTiebreakNeeded = false;
                                     }
-                                    else    // WON tiebreak
+                                    else
                                     {
-                                        //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
-                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (higher)!\n")););
-                                        pService->m_ProbeInformation.m_bTiebreakNeeded = false;
+                                        if (((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain > hostDomain)  // The OTHER domain is 'higher' -> LOST
+                                        {
+                                            // LOST tiebreak
+                                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) LOST (lower)!\n")););
+                                            _cancelProbingForService(*pService);
+                                            pService->m_ProbeInformation.m_bTiebreakNeeded = false;
+                                        }
+                                        else  // WON tiebreak
+                                        {
+                                            //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
+                                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (higher)!\n")););
+                                            pService->m_ProbeInformation.m_bTiebreakNeeded = false;
+                                        }
                                     }
                                 }
                             }
-                        }
-                    }   // service tiebreak possibility
-                }   // for services
-            }   // ANY answers
-        }
-        else
-        {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read known answer!\n")););
-        }
+                        }  // service tiebreak possibility
+                    }      // for services
+                }          // ANY answers
+            }
+            else
+            {
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read known answer!\n")););
+            }
 
-        if (pKnownRRAnswer)
-        {
-            delete pKnownRRAnswer;
-            pKnownRRAnswer = 0;
-        }
-    }   // for answers
+            if (pKnownRRAnswer)
+            {
+                delete pKnownRRAnswer;
+                pKnownRRAnswer = 0;
+            }
+        }  // for answers
 
-    if (bResult)
-    {
-        // Check, if a reply is needed
-        uint8_t u8ReplyNeeded = sendParameter.m_u8HostReplyMask;
-        for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+        if (bResult)
         {
-            u8ReplyNeeded |= pService->m_u8ReplyMask;
-        }
+            // Check, if a reply is needed
+            uint8_t u8ReplyNeeded = sendParameter.m_u8HostReplyMask;
+            for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+            {
+                u8ReplyNeeded |= pService->m_u8ReplyMask;
+            }
 
-        if (u8ReplyNeeded)
-        {
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Sending answer(0x%X)...\n"), u8ReplyNeeded););
+            if (u8ReplyNeeded)
+            {
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Sending answer(0x%X)...\n"), u8ReplyNeeded););
 
-            sendParameter.m_bResponse = true;
-            sendParameter.m_bAuthorative = true;
+                sendParameter.m_bResponse    = true;
+                sendParameter.m_bAuthorative = true;
 
-            bResult = _sendMDNSMessage(sendParameter);
+                bResult = _sendMDNSMessage(sendParameter);
+            }
+            DEBUG_EX_INFO(
+                else
+                {
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: No reply needed\n"));
+                });
         }
-        DEBUG_EX_INFO(
-            else
+        else
         {
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: No reply needed\n"));
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Something FAILED!\n")););
+            m_pUDPContext->flush();
         }
-        );
-    }
-    else
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Something FAILED!\n")););
-        m_pUDPContext->flush();
-    }
 
-    //
-    // Check and reset tiebreak-states
-    if (m_HostProbeInformation.m_bTiebreakNeeded)
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for host domain!\n")););
-        m_HostProbeInformation.m_bTiebreakNeeded = false;
-    }
-    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
-    {
-        if (pService->m_ProbeInformation.m_bTiebreakNeeded)
+        //
+        // Check and reset tiebreak-states
+        if (m_HostProbeInformation.m_bTiebreakNeeded)
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for service domain (%s.%s.%s)\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
-            pService->m_ProbeInformation.m_bTiebreakNeeded = false;
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for host domain!\n")););
+            m_HostProbeInformation.m_bTiebreakNeeded = false;
+        }
+        for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+        {
+            if (pService->m_ProbeInformation.m_bTiebreakNeeded)
+            {
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for service domain (%s.%s.%s)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                pService->m_ProbeInformation.m_bTiebreakNeeded = false;
+            }
         }
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED!\n"));
+                     });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED!\n"));
-    });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_parseResponse
 
     Responses are of interest in two cases:
@@ -619,84 +578,81 @@ bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHea
                TXT - links the instance name to services TXTs
       Level 3: A/AAAA - links the host domain to an IP address
 */
-bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse\n")););
-    //DEBUG_EX_INFO(_udpDump(););
-
-    bool    bResult = false;
-
-    // A response should be the result of a query or a probe
-    if ((_hasServiceQueriesWaitingForAnswers()) ||          // Waiting for query answers OR
-            (_hasProbesWaitingForAnswers()))                    // Probe responses
+    bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
     {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse\n")););
+        //DEBUG_EX_INFO(_udpDump(););
 
-        DEBUG_EX_INFO(
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response\n"));
-            //_udpDump();
-        );
+        bool bResult = false;
 
-        bResult = true;
-        //
-        // Ignore questions here
-        stcMDNS_RRQuestion  dummyRRQ;
-        for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
+        // A response should be the result of a query or a probe
+        if ((_hasServiceQueriesWaitingForAnswers()) ||  // Waiting for query answers OR
+            (_hasProbesWaitingForAnswers()))            // Probe responses
         {
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response containing a question... ignoring!\n")););
-            bResult = _readRRQuestion(dummyRRQ);
-        }   // for queries
+            DEBUG_EX_INFO(
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response\n"));
+                //_udpDump();
+            );
 
-        //
-        // Read and collect answers
-        stcMDNS_RRAnswer*   pCollectedRRAnswers = 0;
-        uint32_t            u32NumberOfAnswerRRs = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
-        for (uint32_t an = 0; ((bResult) && (an < u32NumberOfAnswerRRs)); ++an)
-        {
-            stcMDNS_RRAnswer*   pRRAnswer = 0;
-            if (((bResult = _readRRAnswer(pRRAnswer))) &&
-                    (pRRAnswer))
+            bResult = true;
+            //
+            // Ignore questions here
+            stcMDNS_RRQuestion dummyRRQ;
+            for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
             {
-                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: ADDING answer!\n")););
-                pRRAnswer->m_pNext = pCollectedRRAnswers;
-                pCollectedRRAnswers = pRRAnswer;
-            }
-            else
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response containing a question... ignoring!\n")););
+                bResult = _readRRQuestion(dummyRRQ);
+            }  // for queries
+
+            //
+            // Read and collect answers
+            stcMDNS_RRAnswer* pCollectedRRAnswers  = 0;
+            uint32_t          u32NumberOfAnswerRRs = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
+            for (uint32_t an = 0; ((bResult) && (an < u32NumberOfAnswerRRs)); ++an)
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answer!\n")););
-                if (pRRAnswer)
+                stcMDNS_RRAnswer* pRRAnswer = 0;
+                if (((bResult = _readRRAnswer(pRRAnswer))) && (pRRAnswer))
                 {
-                    delete pRRAnswer;
-                    pRRAnswer = 0;
+                    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: ADDING answer!\n")););
+                    pRRAnswer->m_pNext  = pCollectedRRAnswers;
+                    pCollectedRRAnswers = pRRAnswer;
                 }
-                bResult = false;
+                else
+                {
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answer!\n")););
+                    if (pRRAnswer)
+                    {
+                        delete pRRAnswer;
+                        pRRAnswer = 0;
+                    }
+                    bResult = false;
+                }
+            }  // for answers
+
+            //
+            // Process answers
+            if (bResult)
+            {
+                bResult = ((!pCollectedRRAnswers) || (_processAnswers(pCollectedRRAnswers)));
+            }
+            else  // Some failure while reading answers
+            {
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answers!\n")););
+                m_pUDPContext->flush();
             }
-        }   // for answers
 
-        //
-        // Process answers
-        if (bResult)
-        {
-            bResult = ((!pCollectedRRAnswers) ||
-                       (_processAnswers(pCollectedRRAnswers)));
-        }
-        else    // Some failure while reading answers
-        {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answers!\n")););
-            m_pUDPContext->flush();
+            // Delete collected answers
+            while (pCollectedRRAnswers)
+            {
+                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: DELETING answer!\n")););
+                stcMDNS_RRAnswer* pNextAnswer = pCollectedRRAnswers->m_pNext;
+                delete pCollectedRRAnswers;
+                pCollectedRRAnswers = pNextAnswer;
+            }
         }
-
-        // Delete collected answers
-        while (pCollectedRRAnswers)
+        else  // Received an unexpected response -> ignore
         {
-            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: DELETING answer!\n")););
-            stcMDNS_RRAnswer*   pNextAnswer = pCollectedRRAnswers->m_pNext;
-            delete pCollectedRRAnswers;
-            pCollectedRRAnswers = pNextAnswer;
-        }
-    }
-    else    // Received an unexpected response -> ignore
-    {
-        /*  DEBUG_EX_INFO(
+            /*  DEBUG_EX_INFO(
                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received an unexpected response... ignoring!\nDUMP:\n"));
                 bool    bDumpResult = true;
                 for (uint16_t qd=0; ((bDumpResult) && (qd<p_MsgHeader.m_u16QDCount)); ++qd) {
@@ -716,17 +672,17 @@ bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_Msg
                     esp_suspend();
                 }
             );*/
-        m_pUDPContext->flush();
-        bResult = true;
+            m_pUDPContext->flush();
+            bResult = true;
+        }
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED!\n"));
+                     });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED!\n"));
-    });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_processAnswers
     Host:
     A (0x01):               eg. esp8266.local A OP TTL 123.456.789.012
@@ -740,462 +696,427 @@ bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_Msg
     TXT (0x10):             eg. MyESP._http._tcp.local TXT OP TTL c#=1
 
 */
-bool MDNSResponder::_processAnswers(const MDNSResponder::stcMDNS_RRAnswer* p_pAnswers)
-{
-
-    bool    bResult = false;
-
-    if (p_pAnswers)
+    bool MDNSResponder::_processAnswers(const MDNSResponder::stcMDNS_RRAnswer* p_pAnswers)
     {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Processing answers...\n")););
-        bResult = true;
+        bool bResult = false;
 
-        // Answers may arrive in an unexpected order. So we loop our answers as long, as we
-        // can connect new information to service queries
-        bool    bFoundNewKeyAnswer;
-        do
+        if (p_pAnswers)
         {
-            bFoundNewKeyAnswer = false;
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Processing answers...\n")););
+            bResult = true;
 
-            const stcMDNS_RRAnswer* pRRAnswer = p_pAnswers;
-            while ((pRRAnswer) &&
-                    (bResult))
+            // Answers may arrive in an unexpected order. So we loop our answers as long, as we
+            // can connect new information to service queries
+            bool bFoundNewKeyAnswer;
+            do
             {
-                // 1. level answer (PTR)
-                if (AnswerType_PTR == pRRAnswer->answerType())
+                bFoundNewKeyAnswer = false;
+
+                const stcMDNS_RRAnswer* pRRAnswer = p_pAnswers;
+                while ((pRRAnswer) && (bResult))
                 {
-                    // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
-                    bResult = _processPTRAnswer((stcMDNS_RRAnswerPTR*)pRRAnswer, bFoundNewKeyAnswer);   // May 'enable' new SRV or TXT answers to be linked to queries
-                }
-                // 2. level answers
-                // SRV -> host domain and port
-                else if (AnswerType_SRV == pRRAnswer->answerType())
-                {
-                    // eg. MyESP_http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
-                    bResult = _processSRVAnswer((stcMDNS_RRAnswerSRV*)pRRAnswer, bFoundNewKeyAnswer);   // May 'enable' new A/AAAA answers to be linked to queries
-                }
-                // TXT -> Txts
-                else if (AnswerType_TXT == pRRAnswer->answerType())
-                {
-                    // eg. MyESP_http._tcp.local TXT xxxx xx c#=1
-                    bResult = _processTXTAnswer((stcMDNS_RRAnswerTXT*)pRRAnswer);
-                }
-                // 3. level answers
+                    // 1. level answer (PTR)
+                    if (AnswerType_PTR == pRRAnswer->answerType())
+                    {
+                        // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
+                        bResult = _processPTRAnswer((stcMDNS_RRAnswerPTR*)pRRAnswer, bFoundNewKeyAnswer);  // May 'enable' new SRV or TXT answers to be linked to queries
+                    }
+                    // 2. level answers
+                    // SRV -> host domain and port
+                    else if (AnswerType_SRV == pRRAnswer->answerType())
+                    {
+                        // eg. MyESP_http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
+                        bResult = _processSRVAnswer((stcMDNS_RRAnswerSRV*)pRRAnswer, bFoundNewKeyAnswer);  // May 'enable' new A/AAAA answers to be linked to queries
+                    }
+                    // TXT -> Txts
+                    else if (AnswerType_TXT == pRRAnswer->answerType())
+                    {
+                        // eg. MyESP_http._tcp.local TXT xxxx xx c#=1
+                        bResult = _processTXTAnswer((stcMDNS_RRAnswerTXT*)pRRAnswer);
+                    }
+                    // 3. level answers
 #ifdef MDNS_IP4_SUPPORT
-                // A -> IP4Address
-                else if (AnswerType_A == pRRAnswer->answerType())
-                {
-                    // eg. esp8266.local A xxxx xx 192.168.2.120
-                    bResult = _processAAnswer((stcMDNS_RRAnswerA*)pRRAnswer);
-                }
+                    // A -> IP4Address
+                    else if (AnswerType_A == pRRAnswer->answerType())
+                    {
+                        // eg. esp8266.local A xxxx xx 192.168.2.120
+                        bResult = _processAAnswer((stcMDNS_RRAnswerA*)pRRAnswer);
+                    }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                // AAAA -> IP6Address
-                else if (AnswerType_AAAA == pRRAnswer->answerType())
-                {
-                    // eg. esp8266.local AAAA xxxx xx 09cf::0c
-                    bResult = _processAAAAAnswer((stcMDNS_RRAnswerAAAA*)pRRAnswer);
-                }
+                    // AAAA -> IP6Address
+                    else if (AnswerType_AAAA == pRRAnswer->answerType())
+                    {
+                        // eg. esp8266.local AAAA xxxx xx 09cf::0c
+                        bResult = _processAAAAAnswer((stcMDNS_RRAnswerAAAA*)pRRAnswer);
+                    }
 #endif
 
-                // Finally check for probing conflicts
-                // Host domain
-                if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&
-                        ((AnswerType_A == pRRAnswer->answerType()) ||
-                         (AnswerType_AAAA == pRRAnswer->answerType())))
-                {
-
-                    stcMDNS_RRDomain    hostDomain;
-                    if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                            (pRRAnswer->m_Header.m_Domain == hostDomain))
+                    // Finally check for probing conflicts
+                    // Host domain
+                    if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) && ((AnswerType_A == pRRAnswer->answerType()) || (AnswerType_AAAA == pRRAnswer->answerType())))
                     {
-
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.local\n"), m_pcHostname););
-                        _cancelProbingForHost();
+                        stcMDNS_RRDomain hostDomain;
+                        if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (pRRAnswer->m_Header.m_Domain == hostDomain))
+                        {
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.local\n"), m_pcHostname););
+                            _cancelProbingForHost();
+                        }
                     }
-                }
-                // Service domains
-                for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
-                {
-                    if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&
-                            ((AnswerType_TXT == pRRAnswer->answerType()) ||
-                             (AnswerType_SRV == pRRAnswer->answerType())))
+                    // Service domains
+                    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
                     {
-
-                        stcMDNS_RRDomain    serviceDomain;
-                        if ((_buildDomainForService(*pService, true, serviceDomain)) &&
-                                (pRRAnswer->m_Header.m_Domain == serviceDomain))
+                        if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) && ((AnswerType_TXT == pRRAnswer->answerType()) || (AnswerType_SRV == pRRAnswer->answerType())))
                         {
-
-                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.%s.%s\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
-                            _cancelProbingForService(*pService);
+                            stcMDNS_RRDomain serviceDomain;
+                            if ((_buildDomainForService(*pService, true, serviceDomain)) && (pRRAnswer->m_Header.m_Domain == serviceDomain))
+                            {
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.%s.%s\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                                _cancelProbingForService(*pService);
+                            }
                         }
                     }
-                }
 
-                pRRAnswer = pRRAnswer->m_pNext; // Next collected answer
-            }   // while (answers)
-        } while ((bFoundNewKeyAnswer) &&
-                 (bResult));
-    }   // else: No answers provided
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: FAILED!\n"));
-    });
-    return bResult;
-}
+                    pRRAnswer = pRRAnswer->m_pNext;  // Next collected answer
+                }                                    // while (answers)
+            } while ((bFoundNewKeyAnswer) && (bResult));
+        }  // else: No answers provided
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_processPTRAnswer
 */
-bool MDNSResponder::_processPTRAnswer(const MDNSResponder::stcMDNS_RRAnswerPTR* p_pPTRAnswer,
-                                      bool& p_rbFoundNewKeyAnswer)
-{
-
-    bool    bResult = false;
-
-    if ((bResult = (0 != p_pPTRAnswer)))
+    bool MDNSResponder::_processPTRAnswer(const MDNSResponder::stcMDNS_RRAnswerPTR* p_pPTRAnswer,
+                                          bool&                                     p_rbFoundNewKeyAnswer)
     {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Processing PTR answers...\n")););
-        // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
-        // Check pending service queries for eg. '_http._tcp'
+        bool bResult = false;
 
-        stcMDNSServiceQuery*    pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, 0);
-        while (pServiceQuery)
+        if ((bResult = (0 != p_pPTRAnswer)))
         {
-            if (pServiceQuery->m_bAwaitingAnswers)
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Processing PTR answers...\n")););
+            // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
+            // Check pending service queries for eg. '_http._tcp'
+
+            stcMDNSServiceQuery* pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, 0);
+            while (pServiceQuery)
             {
-                // Find answer for service domain (eg. MyESP._http._tcp.local)
-                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pPTRAnswer->m_PTRDomain);
-                if (pSQAnswer)      // existing answer
+                if (pServiceQuery->m_bAwaitingAnswers)
                 {
-                    if (p_pPTRAnswer->m_u32TTL)     // Received update message
-                    {
-                        pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);    // Update TTL tag
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Updated TTL(%d) for "), (int)p_pPTRAnswer->m_u32TTL);
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                        );
-                    }
-                    else                            // received goodbye-message
+                    // Find answer for service domain (eg. MyESP._http._tcp.local)
+                    stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pPTRAnswer->m_PTRDomain);
+                    if (pSQAnswer)  // existing answer
                     {
-                        pSQAnswer->m_TTLServiceDomain.prepareDeletion();    // Prepare answer deletion according to RFC 6762, 10.1
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: 'Goodbye' received for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                        );
+                        if (p_pPTRAnswer->m_u32TTL)  // Received update message
+                        {
+                            pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);  // Update TTL tag
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Updated TTL(%d) for "), (int)p_pPTRAnswer->m_u32TTL);
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR("\n")););
+                        }
+                        else  // received goodbye-message
+                        {
+                            pSQAnswer->m_TTLServiceDomain.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: 'Goodbye' received for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR("\n")););
+                        }
                     }
-                }
-                else if ((p_pPTRAnswer->m_u32TTL) &&                                // Not just a goodbye-message
-                         ((pSQAnswer = new stcMDNSServiceQuery::stcAnswer)))        // Not yet included -> add answer
-                {
-                    pSQAnswer->m_ServiceDomain = p_pPTRAnswer->m_PTRDomain;
-                    pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_ServiceDomain;
-                    pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);
-                    pSQAnswer->releaseServiceDomain();
-
-                    bResult = pServiceQuery->addAnswer(pSQAnswer);
-                    p_rbFoundNewKeyAnswer = true;
-                    if (pServiceQuery->m_fnCallback)
+                    else if ((p_pPTRAnswer->m_u32TTL) &&                          // Not just a goodbye-message
+                             ((pSQAnswer = new stcMDNSServiceQuery::stcAnswer)))  // Not yet included -> add answer
                     {
-                        MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                        pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain), true);
+                        pSQAnswer->m_ServiceDomain = p_pPTRAnswer->m_PTRDomain;
+                        pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_ServiceDomain;
+                        pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);
+                        pSQAnswer->releaseServiceDomain();
+
+                        bResult               = pServiceQuery->addAnswer(pSQAnswer);
+                        p_rbFoundNewKeyAnswer = true;
+                        if (pServiceQuery->m_fnCallback)
+                        {
+                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain), true);
+                        }
                     }
                 }
+                pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, pServiceQuery);
             }
-            pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, pServiceQuery);
-        }
-    }   // else: No p_pPTRAnswer
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: FAILED!\n"));
-    });
-    return bResult;
-}
+        }  // else: No p_pPTRAnswer
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_processSRVAnswer
 */
-bool MDNSResponder::_processSRVAnswer(const MDNSResponder::stcMDNS_RRAnswerSRV* p_pSRVAnswer,
-                                      bool& p_rbFoundNewKeyAnswer)
-{
-
-    bool    bResult = false;
-
-    if ((bResult = (0 != p_pSRVAnswer)))
+    bool MDNSResponder::_processSRVAnswer(const MDNSResponder::stcMDNS_RRAnswerSRV* p_pSRVAnswer,
+                                          bool&                                     p_rbFoundNewKeyAnswer)
     {
-        // eg. MyESP._http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
+        bool bResult = false;
 
-        stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
-        while (pServiceQuery)
+        if ((bResult = (0 != p_pSRVAnswer)))
         {
-            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pSRVAnswer->m_Header.m_Domain);
-            if (pSQAnswer)      // Answer for this service domain (eg. MyESP._http._tcp.local) available
+            // eg. MyESP._http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
+
+            stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
+            while (pServiceQuery)
             {
-                if (p_pSRVAnswer->m_u32TTL)     // First or update message (TTL != 0)
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pSRVAnswer->m_Header.m_Domain);
+                if (pSQAnswer)  // Answer for this service domain (eg. MyESP._http._tcp.local) available
                 {
-                    pSQAnswer->m_TTLHostDomainAndPort.set(p_pSRVAnswer->m_u32TTL);    // Update TTL tag
-                    DEBUG_EX_INFO(
-                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: Updated TTL(%d) for "), (int)p_pSRVAnswer->m_u32TTL);
-                        _printRRDomain(pSQAnswer->m_ServiceDomain);
-                        DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
-                    );
-                    // Host domain & Port
-                    if ((pSQAnswer->m_HostDomain != p_pSRVAnswer->m_SRVDomain) ||
-                            (pSQAnswer->m_u16Port != p_pSRVAnswer->m_u16Port))
+                    if (p_pSRVAnswer->m_u32TTL)  // First or update message (TTL != 0)
                     {
-
-                        pSQAnswer->m_HostDomain = p_pSRVAnswer->m_SRVDomain;
-                        pSQAnswer->releaseHostDomain();
-                        pSQAnswer->m_u16Port = p_pSRVAnswer->m_u16Port;
-                        pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_HostDomainAndPort;
-
-                        p_rbFoundNewKeyAnswer = true;
-                        if (pServiceQuery->m_fnCallback)
+                        pSQAnswer->m_TTLHostDomainAndPort.set(p_pSRVAnswer->m_u32TTL);  // Update TTL tag
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: Updated TTL(%d) for "), (int)p_pSRVAnswer->m_u32TTL);
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")););
+                        // Host domain & Port
+                        if ((pSQAnswer->m_HostDomain != p_pSRVAnswer->m_SRVDomain) || (pSQAnswer->m_u16Port != p_pSRVAnswer->m_u16Port))
                         {
-                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_HostDomainAndPort), true);
+                            pSQAnswer->m_HostDomain = p_pSRVAnswer->m_SRVDomain;
+                            pSQAnswer->releaseHostDomain();
+                            pSQAnswer->m_u16Port = p_pSRVAnswer->m_u16Port;
+                            pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_HostDomainAndPort;
+
+                            p_rbFoundNewKeyAnswer = true;
+                            if (pServiceQuery->m_fnCallback)
+                            {
+                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_HostDomainAndPort), true);
+                            }
                         }
                     }
+                    else  // Goodby message
+                    {
+                        pSQAnswer->m_TTLHostDomainAndPort.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: 'Goodbye' received for "));
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")););
+                    }
                 }
-                else                        // Goodby message
-                {
-                    pSQAnswer->m_TTLHostDomainAndPort.prepareDeletion();    // Prepare answer deletion according to RFC 6762, 10.1
-                    DEBUG_EX_INFO(
-                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: 'Goodbye' received for "));
-                        _printRRDomain(pSQAnswer->m_ServiceDomain);
-                        DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
-                    );
-                }
-            }
-            pServiceQuery = pServiceQuery->m_pNext;
-        }   // while(service query)
-    }   // else: No p_pSRVAnswer
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: FAILED!\n"));
-    });
-    return bResult;
-}
+                pServiceQuery = pServiceQuery->m_pNext;
+            }  // while(service query)
+        }      // else: No p_pSRVAnswer
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_processTXTAnswer
 */
-bool MDNSResponder::_processTXTAnswer(const MDNSResponder::stcMDNS_RRAnswerTXT* p_pTXTAnswer)
-{
-
-    bool    bResult = false;
-
-    if ((bResult = (0 != p_pTXTAnswer)))
+    bool MDNSResponder::_processTXTAnswer(const MDNSResponder::stcMDNS_RRAnswerTXT* p_pTXTAnswer)
     {
-        // eg. MyESP._http._tcp.local TXT xxxx xx c#=1
+        bool bResult = false;
 
-        stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
-        while (pServiceQuery)
+        if ((bResult = (0 != p_pTXTAnswer)))
         {
-            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pTXTAnswer->m_Header.m_Domain);
-            if (pSQAnswer)      // Answer for this service domain (eg. MyESP._http._tcp.local) available
+            // eg. MyESP._http._tcp.local TXT xxxx xx c#=1
+
+            stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
+            while (pServiceQuery)
             {
-                if (p_pTXTAnswer->m_u32TTL)     // First or update message
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pTXTAnswer->m_Header.m_Domain);
+                if (pSQAnswer)  // Answer for this service domain (eg. MyESP._http._tcp.local) available
                 {
-                    pSQAnswer->m_TTLTxts.set(p_pTXTAnswer->m_u32TTL); // Update TTL tag
-                    DEBUG_EX_INFO(
-                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: Updated TTL(%d) for "), (int)p_pTXTAnswer->m_u32TTL);
-                        _printRRDomain(pSQAnswer->m_ServiceDomain);
-                        DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
-                    );
-                    if (!pSQAnswer->m_Txts.compare(p_pTXTAnswer->m_Txts))
+                    if (p_pTXTAnswer->m_u32TTL)  // First or update message
                     {
-                        pSQAnswer->m_Txts = p_pTXTAnswer->m_Txts;
-                        pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_Txts;
-                        pSQAnswer->releaseTxts();
-
-                        if (pServiceQuery->m_fnCallback)
+                        pSQAnswer->m_TTLTxts.set(p_pTXTAnswer->m_u32TTL);  // Update TTL tag
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: Updated TTL(%d) for "), (int)p_pTXTAnswer->m_u32TTL);
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")););
+                        if (!pSQAnswer->m_Txts.compare(p_pTXTAnswer->m_Txts))
                         {
-                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), true);
+                            pSQAnswer->m_Txts = p_pTXTAnswer->m_Txts;
+                            pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_Txts;
+                            pSQAnswer->releaseTxts();
+
+                            if (pServiceQuery->m_fnCallback)
+                            {
+                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), true);
+                            }
                         }
                     }
+                    else  // Goodby message
+                    {
+                        pSQAnswer->m_TTLTxts.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: 'Goodbye' received for "));
+                            _printRRDomain(pSQAnswer->m_ServiceDomain);
+                            DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")););
+                    }
                 }
-                else                        // Goodby message
-                {
-                    pSQAnswer->m_TTLTxts.prepareDeletion(); // Prepare answer deletion according to RFC 6762, 10.1
-                    DEBUG_EX_INFO(
-                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: 'Goodbye' received for "));
-                        _printRRDomain(pSQAnswer->m_ServiceDomain);
-                        DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
-                    );
-                }
-            }
-            pServiceQuery = pServiceQuery->m_pNext;
-        }   // while(service query)
-    }   // else: No p_pTXTAnswer
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: FAILED!\n"));
-    });
-    return bResult;
-}
+                pServiceQuery = pServiceQuery->m_pNext;
+            }  // while(service query)
+        }      // else: No p_pTXTAnswer
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::_processAAnswer
 */
-bool MDNSResponder::_processAAnswer(const MDNSResponder::stcMDNS_RRAnswerA* p_pAAnswer)
-{
-
-    bool    bResult = false;
-
-    if ((bResult = (0 != p_pAAnswer)))
+    bool MDNSResponder::_processAAnswer(const MDNSResponder::stcMDNS_RRAnswerA* p_pAAnswer)
     {
-        // eg. esp8266.local A xxxx xx 192.168.2.120
+        bool bResult = false;
 
-        stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
-        while (pServiceQuery)
+        if ((bResult = (0 != p_pAAnswer)))
         {
-            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAnswer->m_Header.m_Domain);
-            if (pSQAnswer)      // Answer for this host domain (eg. esp8266.local) available
+            // eg. esp8266.local A xxxx xx 192.168.2.120
+
+            stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
+            while (pServiceQuery)
             {
-                stcMDNSServiceQuery::stcAnswer::stcIP4Address*  pIP4Address = pSQAnswer->findIP4Address(p_pAAnswer->m_IPAddress);
-                if (pIP4Address)
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAnswer->m_Header.m_Domain);
+                if (pSQAnswer)  // Answer for this host domain (eg. esp8266.local) available
                 {
-                    // Already known IP4 address
-                    if (p_pAAnswer->m_u32TTL)   // Valid TTL -> Update answers TTL
-                    {
-                        pIP4Address->m_TTL.set(p_pAAnswer->m_u32TTL);
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%d) for "), (int)p_pAAnswer->m_u32TTL);
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" IP4Address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str());
-                        );
-                    }
-                    else                        // 'Goodbye' message for known IP4 address
+                    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = pSQAnswer->findIP4Address(p_pAAnswer->m_IPAddress);
+                    if (pIP4Address)
                     {
-                        pIP4Address->m_TTL.prepareDeletion();   // Prepare answer deletion according to RFC 6762, 10.1
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str());
-                        );
+                        // Already known IP4 address
+                        if (p_pAAnswer->m_u32TTL)  // Valid TTL -> Update answers TTL
+                        {
+                            pIP4Address->m_TTL.set(p_pAAnswer->m_u32TTL);
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%d) for "), (int)p_pAAnswer->m_u32TTL);
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" IP4Address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str()););
+                        }
+                        else  // 'Goodbye' message for known IP4 address
+                        {
+                            pIP4Address->m_TTL.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str()););
+                        }
                     }
-                }
-                else
-                {
-                    // Until now unknown IP4 address -> Add (if the message isn't just a 'Goodbye' note)
-                    if (p_pAAnswer->m_u32TTL)   // NOT just a 'Goodbye' message
+                    else
                     {
-                        pIP4Address = new stcMDNSServiceQuery::stcAnswer::stcIP4Address(p_pAAnswer->m_IPAddress, p_pAAnswer->m_u32TTL);
-                        if ((pIP4Address) &&
-                                (pSQAnswer->addIP4Address(pIP4Address)))
+                        // Until now unknown IP4 address -> Add (if the message isn't just a 'Goodbye' note)
+                        if (p_pAAnswer->m_u32TTL)  // NOT just a 'Goodbye' message
                         {
-
-                            pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
-                            if (pServiceQuery->m_fnCallback)
+                            pIP4Address = new stcMDNSServiceQuery::stcAnswer::stcIP4Address(p_pAAnswer->m_IPAddress, p_pAAnswer->m_u32TTL);
+                            if ((pIP4Address) && (pSQAnswer->addIP4Address(pIP4Address)))
                             {
-                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), true);
+                                pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
+                                if (pServiceQuery->m_fnCallback)
+                                {
+                                    MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                                    pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), true);
+                                }
+                            }
+                            else
+                            {
+                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP4 address (%s)!\n"), p_pAAnswer->m_IPAddress.toString().c_str()););
                             }
-                        }
-                        else
-                        {
-                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP4 address (%s)!\n"), p_pAAnswer->m_IPAddress.toString().c_str()););
                         }
                     }
                 }
-            }
-            pServiceQuery = pServiceQuery->m_pNext;
-        }   // while(service query)
-    }   // else: No p_pAAnswer
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED!\n"));
-    });
-    return bResult;
-}
+                pServiceQuery = pServiceQuery->m_pNext;
+            }  // while(service query)
+        }      // else: No p_pAAnswer
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED!\n"));
+                     });
+        return bResult;
+    }
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-/*
+    /*
     MDNSResponder::_processAAAAAnswer
 */
-bool MDNSResponder::_processAAAAAnswer(const MDNSResponder::stcMDNS_RRAnswerAAAA* p_pAAAAAnswer)
-{
-
-    bool    bResult = false;
-
-    if ((bResult = (0 != p_pAAAAAnswer)))
+    bool MDNSResponder::_processAAAAAnswer(const MDNSResponder::stcMDNS_RRAnswerAAAA* p_pAAAAAnswer)
     {
-        // eg. esp8266.local AAAA xxxx xx 0bf3::0c
+        bool bResult = false;
 
-        stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
-        while (pServiceQuery)
+        if ((bResult = (0 != p_pAAAAAnswer)))
         {
-            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAAAAnswer->m_Header.m_Domain);
-            if (pSQAnswer)      // Answer for this host domain (eg. esp8266.local) available
+            // eg. esp8266.local AAAA xxxx xx 0bf3::0c
+
+            stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
+            while (pServiceQuery)
             {
-                stcIP6Address*  pIP6Address = pSQAnswer->findIP6Address(p_pAAAAAnswer->m_IPAddress);
-                if (pIP6Address)
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAAAAnswer->m_Header.m_Domain);
+                if (pSQAnswer)  // Answer for this host domain (eg. esp8266.local) available
                 {
-                    // Already known IP6 address
-                    if (p_pAAAAAnswer->m_u32TTL)   // Valid TTL -> Update answers TTL
-                    {
-                        pIP6Address->m_TTL.set(p_pAAAAAnswer->m_u32TTL);
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%lu) for "), p_pAAAAAnswer->m_u32TTL);
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str());
-                        );
-                    }
-                    else                        // 'Goodbye' message for known IP6 address
+                    stcIP6Address* pIP6Address = pSQAnswer->findIP6Address(p_pAAAAAnswer->m_IPAddress);
+                    if (pIP6Address)
                     {
-                        pIP6Address->m_TTL.prepareDeletion();   // Prepare answer deletion according to RFC 6762, 10.1
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str());
-                        );
+                        // Already known IP6 address
+                        if (p_pAAAAAnswer->m_u32TTL)  // Valid TTL -> Update answers TTL
+                        {
+                            pIP6Address->m_TTL.set(p_pAAAAAnswer->m_u32TTL);
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%lu) for "), p_pAAAAAnswer->m_u32TTL);
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str()););
+                        }
+                        else  // 'Goodbye' message for known IP6 address
+                        {
+                            pIP6Address->m_TTL.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str()););
+                        }
                     }
-                }
-                else
-                {
-                    // Until now unknown IP6 address -> Add (if the message isn't just a 'Goodbye' note)
-                    if (p_pAAAAAnswer->m_u32TTL)   // NOT just a 'Goodbye' message
+                    else
                     {
-                        pIP6Address = new stcIP6Address(p_pAAAAAnswer->m_IPAddress, p_pAAAAAnswer->m_u32TTL);
-                        if ((pIP6Address) &&
-                                (pSQAnswer->addIP6Address(pIP6Address)))
+                        // Until now unknown IP6 address -> Add (if the message isn't just a 'Goodbye' note)
+                        if (p_pAAAAAnswer->m_u32TTL)  // NOT just a 'Goodbye' message
                         {
+                            pIP6Address = new stcIP6Address(p_pAAAAAnswer->m_IPAddress, p_pAAAAAnswer->m_u32TTL);
+                            if ((pIP6Address) && (pSQAnswer->addIP6Address(pIP6Address)))
+                            {
+                                pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP6Address;
 
-                            pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP6Address;
-
-                            if (pServiceQuery->m_fnCallback)
+                                if (pServiceQuery->m_fnCallback)
+                                {
+                                    pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, true, pServiceQuery->m_pUserdata);
+                                }
+                            }
+                            else
                             {
-                                pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, true, pServiceQuery->m_pUserdata);
+                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP6 address (%s)!\n"), p_pAAAAAnswer->m_IPAddress.toString().c_str()););
                             }
                         }
-                        else
-                        {
-                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP6 address (%s)!\n"), p_pAAAAAnswer->m_IPAddress.toString().c_str()););
-                        }
                     }
                 }
-            }
-            pServiceQuery = pServiceQuery->m_pNext;
-        }   // while(service query)
-    }   // else: No p_pAAAAAnswer
+                pServiceQuery = pServiceQuery->m_pNext;
+            }  // while(service query)
+        }      // else: No p_pAAAAAnswer
 
-    return bResult;
-}
+        return bResult;
+    }
 #endif
 
-
-/*
+    /*
     PROBING
 */
 
-/*
+    /*
     MDNSResponder::_updateProbeStatus
 
     Manages the (outgoing) probing process.
@@ -1207,138 +1128,130 @@ bool MDNSResponder::_processAAAAAnswer(const MDNSResponder::stcMDNS_RRAnswerAAAA
     Conflict management is handled in '_parseResponse ff.'
     Tiebraking is handled in 'parseQuery ff.'
 */
-bool MDNSResponder::_updateProbeStatus(void)
-{
-
-    bool    bResult = true;
-
-    //
-    // Probe host domain
-    if (ProbingStatus_ReadyToStart == m_HostProbeInformation.m_ProbingStatus)
-    {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Starting host probing...\n")););
-
-        // First probe delay SHOULD be random 0-250 ms
-        m_HostProbeInformation.m_Timeout.reset(rand() % MDNS_PROBE_DELAY);
-        m_HostProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
-    }
-    else if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&                // Probing AND
-             (m_HostProbeInformation.m_Timeout.expired()))                                          // Time for next probe
+    bool MDNSResponder::_updateProbeStatus(void)
     {
+        bool bResult = true;
 
-        if (MDNS_PROBE_COUNT > m_HostProbeInformation.m_u8SentCount)                                // Send next probe
-        {
-            if ((bResult = _sendHostProbe()))
-            {
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Did sent host probe\n\n")););
-                m_HostProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);
-                ++m_HostProbeInformation.m_u8SentCount;
-            }
-        }
-        else                                                                                        // Probing finished
+        //
+        // Probe host domain
+        if (ProbingStatus_ReadyToStart == m_HostProbeInformation.m_ProbingStatus)
         {
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host probing.\n")););
-            m_HostProbeInformation.m_ProbingStatus = ProbingStatus_Done;
-            m_HostProbeInformation.m_Timeout.resetToNeverExpires();
-            if (m_HostProbeInformation.m_fnHostProbeResultCallback)
-            {
-                m_HostProbeInformation.m_fnHostProbeResultCallback(m_pcHostname, true);
-            }
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Starting host probing...\n")););
 
-            // Prepare to announce host
-            m_HostProbeInformation.m_u8SentCount = 0;
-            m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared host announcing.\n\n")););
+            // First probe delay SHOULD be random 0-250 ms
+            m_HostProbeInformation.m_Timeout.reset(rand() % MDNS_PROBE_DELAY);
+            m_HostProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
         }
-    }   // else: Probing already finished OR waiting for next time slot
-    else if ((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus) &&
-             (m_HostProbeInformation.m_Timeout.expired()))
-    {
-
-        if ((bResult = _announce(true, false)))     // Don't announce services here
+        else if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing AND
+                 (m_HostProbeInformation.m_Timeout.expired()))                            // Time for next probe
         {
-            ++m_HostProbeInformation.m_u8SentCount;
-
-            if (MDNS_ANNOUNCE_COUNT > m_HostProbeInformation.m_u8SentCount)
+            if (MDNS_PROBE_COUNT > m_HostProbeInformation.m_u8SentCount)  // Send next probe
             {
-                m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing host (%d).\n\n"), m_HostProbeInformation.m_u8SentCount););
+                if ((bResult = _sendHostProbe()))
+                {
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Did sent host probe\n\n")););
+                    m_HostProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);
+                    ++m_HostProbeInformation.m_u8SentCount;
+                }
             }
-            else
+            else  // Probing finished
             {
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host probing.\n")););
+                m_HostProbeInformation.m_ProbingStatus = ProbingStatus_Done;
                 m_HostProbeInformation.m_Timeout.resetToNeverExpires();
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host announcing.\n\n")););
-            }
-        }
-    }
-
-    //
-    // Probe services
-    for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
-    {
-        if (ProbingStatus_ReadyToStart == pService->m_ProbeInformation.m_ProbingStatus)         // Ready to get started
-        {
+                if (m_HostProbeInformation.m_fnHostProbeResultCallback)
+                {
+                    m_HostProbeInformation.m_fnHostProbeResultCallback(m_pcHostname, true);
+                }
 
-            pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);                     // More or equal than first probe for host domain
-            pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
-        }
-        else if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing AND
-                 (pService->m_ProbeInformation.m_Timeout.expired()))               // Time for next probe
+                // Prepare to announce host
+                m_HostProbeInformation.m_u8SentCount = 0;
+                m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared host announcing.\n\n")););
+            }
+        }  // else: Probing already finished OR waiting for next time slot
+        else if ((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus) && (m_HostProbeInformation.m_Timeout.expired()))
         {
-
-            if (MDNS_PROBE_COUNT > pService->m_ProbeInformation.m_u8SentCount)                  // Send next probe
+            if ((bResult = _announce(true, false)))  // Don't announce services here
             {
-                if ((bResult = _sendServiceProbe(*pService)))
+                ++m_HostProbeInformation.m_u8SentCount;
+
+                if (MDNS_ANNOUNCE_COUNT > m_HostProbeInformation.m_u8SentCount)
                 {
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Did sent service probe (%u)\n\n"), (pService->m_ProbeInformation.m_u8SentCount + 1)););
-                    pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);
-                    ++pService->m_ProbeInformation.m_u8SentCount;
+                    m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing host (%d).\n\n"), m_HostProbeInformation.m_u8SentCount););
                 }
-            }
-            else                                                                                        // Probing finished
-            {
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service probing %s.%s.%s\n\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
-                pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_Done;
-                pService->m_ProbeInformation.m_Timeout.resetToNeverExpires();
-                if (pService->m_ProbeInformation.m_fnServiceProbeResultCallback)
+                else
                 {
-                    pService->m_ProbeInformation.m_fnServiceProbeResultCallback(pService->m_pcName, pService, true);
+                    m_HostProbeInformation.m_Timeout.resetToNeverExpires();
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host announcing.\n\n")););
                 }
-                // Prepare to announce service
-                pService->m_ProbeInformation.m_u8SentCount = 0;
-                pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared service announcing.\n\n")););
             }
-        }   // else: Probing already finished OR waiting for next time slot
-        else if ((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus) &&
-                 (pService->m_ProbeInformation.m_Timeout.expired()))
-        {
+        }
 
-            if ((bResult = _announceService(*pService)))     // Announce service
+        //
+        // Probe services
+        for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+        {
+            if (ProbingStatus_ReadyToStart == pService->m_ProbeInformation.m_ProbingStatus)  // Ready to get started
             {
-                ++pService->m_ProbeInformation.m_u8SentCount;
-
-                if (MDNS_ANNOUNCE_COUNT > pService->m_ProbeInformation.m_u8SentCount)
+                pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);  // More or equal than first probe for host domain
+                pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
+            }
+            else if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing AND
+                     (pService->m_ProbeInformation.m_Timeout.expired()))                            // Time for next probe
+            {
+                if (MDNS_PROBE_COUNT > pService->m_ProbeInformation.m_u8SentCount)  // Send next probe
                 {
-                    pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing service %s.%s.%s (%d)\n\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_ProbeInformation.m_u8SentCount););
+                    if ((bResult = _sendServiceProbe(*pService)))
+                    {
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Did sent service probe (%u)\n\n"), (pService->m_ProbeInformation.m_u8SentCount + 1)););
+                        pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);
+                        ++pService->m_ProbeInformation.m_u8SentCount;
+                    }
                 }
-                else
+                else  // Probing finished
                 {
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service probing %s.%s.%s\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                    pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_Done;
                     pService->m_ProbeInformation.m_Timeout.resetToNeverExpires();
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service announcing for %s.%s.%s\n\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                    if (pService->m_ProbeInformation.m_fnServiceProbeResultCallback)
+                    {
+                        pService->m_ProbeInformation.m_fnServiceProbeResultCallback(pService->m_pcName, pService, true);
+                    }
+                    // Prepare to announce service
+                    pService->m_ProbeInformation.m_u8SentCount = 0;
+                    pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared service announcing.\n\n")););
+                }
+            }  // else: Probing already finished OR waiting for next time slot
+            else if ((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus) && (pService->m_ProbeInformation.m_Timeout.expired()))
+            {
+                if ((bResult = _announceService(*pService)))  // Announce service
+                {
+                    ++pService->m_ProbeInformation.m_u8SentCount;
+
+                    if (MDNS_ANNOUNCE_COUNT > pService->m_ProbeInformation.m_u8SentCount)
+                    {
+                        pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing service %s.%s.%s (%d)\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_ProbeInformation.m_u8SentCount););
+                    }
+                    else
+                    {
+                        pService->m_ProbeInformation.m_Timeout.resetToNeverExpires();
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service announcing for %s.%s.%s\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                    }
                 }
             }
         }
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: FAILED!\n\n"));
+                     });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: FAILED!\n\n"));
-    });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_resetProbeStatus
 
     Resets the probe status.
@@ -1346,38 +1259,36 @@ bool MDNSResponder::_updateProbeStatus(void)
     when running 'updateProbeStatus' (which is done in every '_update' loop), the probing
     process is restarted.
 */
-bool MDNSResponder::_resetProbeStatus(bool p_bRestart /*= true*/)
-{
-
-    m_HostProbeInformation.clear(false);
-    m_HostProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
-
-    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+    bool MDNSResponder::_resetProbeStatus(bool p_bRestart /*= true*/)
     {
-        pService->m_ProbeInformation.clear(false);
-        pService->m_ProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
+        m_HostProbeInformation.clear(false);
+        m_HostProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
+
+        for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+        {
+            pService->m_ProbeInformation.clear(false);
+            pService->m_ProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::_hasProbesWaitingForAnswers
 */
-bool MDNSResponder::_hasProbesWaitingForAnswers(void) const
-{
-
-    bool    bResult = ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&      // Probing
-                       (0 < m_HostProbeInformation.m_u8SentCount));                                 // And really probing
-
-    for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
+    bool MDNSResponder::_hasProbesWaitingForAnswers(void) const
     {
-        bResult = ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&    // Probing
-                   (0 < pService->m_ProbeInformation.m_u8SentCount));                               // And really probing
+        bool bResult = ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing
+                        (0 < m_HostProbeInformation.m_u8SentCount));                             // And really probing
+
+        for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
+        {
+            bResult = ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing
+                       (0 < pService->m_ProbeInformation.m_u8SentCount));                             // And really probing
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_sendHostProbe
 
     Asks (probes) in the local network for the planned host domain
@@ -1388,51 +1299,48 @@ bool MDNSResponder::_hasProbesWaitingForAnswers(void) const
     Host domain:
     - A/AAAA (eg. esp8266.esp -> 192.168.2.120)
 */
-bool MDNSResponder::_sendHostProbe(void)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe (%s, %lu)\n"), m_pcHostname, millis()););
-
-    bool    bResult = true;
+    bool MDNSResponder::_sendHostProbe(void)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe (%s, %lu)\n"), m_pcHostname, millis()););
 
-    // Requests for host domain
-    stcMDNSSendParameter    sendParameter;
-    sendParameter.m_bCacheFlush = false;    // RFC 6762 10.2
+        bool bResult = true;
 
-    sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
-    if (((bResult = (0 != sendParameter.m_pQuestions))) &&
-            ((bResult = _buildDomainForHost(m_pcHostname, sendParameter.m_pQuestions->m_Header.m_Domain))))
-    {
+        // Requests for host domain
+        stcMDNSSendParameter sendParameter;
+        sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
 
-        //sendParameter.m_pQuestions->m_bUnicast = true;
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY;
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);   // Unicast & INternet
+        sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
+        if (((bResult = (0 != sendParameter.m_pQuestions))) && ((bResult = _buildDomainForHost(m_pcHostname, sendParameter.m_pQuestions->m_Header.m_Domain))))
+        {
+            //sendParameter.m_pQuestions->m_bUnicast = true;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type  = DNS_RRTYPE_ANY;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
 
-        // Add known answers
+            // Add known answers
 #ifdef MDNS_IP4_SUPPORT
-        sendParameter.m_u8HostReplyMask |= ContentFlag_A;                                   // Add A answer
+            sendParameter.m_u8HostReplyMask |= ContentFlag_A;  // Add A answer
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;                                // Add AAAA answer
+            sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;  // Add AAAA answer
 #endif
-    }
-    else
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED to create host question!\n")););
-        if (sendParameter.m_pQuestions)
+        }
+        else
         {
-            delete sendParameter.m_pQuestions;
-            sendParameter.m_pQuestions = 0;
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED to create host question!\n")););
+            if (sendParameter.m_pQuestions)
+            {
+                delete sendParameter.m_pQuestions;
+                sendParameter.m_pQuestions = 0;
+            }
         }
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED!\n"));
+                     });
+        return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED!\n"));
-    });
-    return ((bResult) &&
-            (_sendMDNSMessage(sendParameter)));
-}
 
-/*
+    /*
     MDNSResponder::_sendServiceProbe
 
     Asks (probes) in the local network for the planned service instance domain
@@ -1444,94 +1352,87 @@ bool MDNSResponder::_sendHostProbe(void)
     - SRV (eg. MyESP._http._tcp.local -> 5000 esp8266.local)
     - PTR NAME (eg. _http._tcp.local -> MyESP._http._tcp.local) (TODO: Check if needed, maybe TXT is better)
 */
-bool MDNSResponder::_sendServiceProbe(stcMDNSService& p_rService)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe (%s.%s.%s, %lu)\n"), (p_rService.m_pcName ? : m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, millis()););
+    bool MDNSResponder::_sendServiceProbe(stcMDNSService& p_rService)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe (%s.%s.%s, %lu)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, millis()););
 
-    bool    bResult = true;
+        bool bResult = true;
 
-    // Requests for service instance domain
-    stcMDNSSendParameter    sendParameter;
-    sendParameter.m_bCacheFlush = false;    // RFC 6762 10.2
+        // Requests for service instance domain
+        stcMDNSSendParameter sendParameter;
+        sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
 
-    sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
-    if (((bResult = (0 != sendParameter.m_pQuestions))) &&
-            ((bResult = _buildDomainForService(p_rService, true, sendParameter.m_pQuestions->m_Header.m_Domain))))
-    {
-
-        sendParameter.m_pQuestions->m_bUnicast = true;
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY;
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);   // Unicast & INternet
+        sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
+        if (((bResult = (0 != sendParameter.m_pQuestions))) && ((bResult = _buildDomainForService(p_rService, true, sendParameter.m_pQuestions->m_Header.m_Domain))))
+        {
+            sendParameter.m_pQuestions->m_bUnicast                       = true;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type  = DNS_RRTYPE_ANY;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
 
-        // Add known answers
-        p_rService.m_u8ReplyMask = (ContentFlag_SRV | ContentFlag_PTR_NAME);                // Add SRV and PTR NAME answers
-    }
-    else
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED to create service question!\n")););
-        if (sendParameter.m_pQuestions)
+            // Add known answers
+            p_rService.m_u8ReplyMask = (ContentFlag_SRV | ContentFlag_PTR_NAME);  // Add SRV and PTR NAME answers
+        }
+        else
         {
-            delete sendParameter.m_pQuestions;
-            sendParameter.m_pQuestions = 0;
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED to create service question!\n")););
+            if (sendParameter.m_pQuestions)
+            {
+                delete sendParameter.m_pQuestions;
+                sendParameter.m_pQuestions = 0;
+            }
         }
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED!\n"));
+                     });
+        return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED!\n"));
-    });
-    return ((bResult) &&
-            (_sendMDNSMessage(sendParameter)));
-}
 
-/*
+    /*
     MDNSResponder::_cancelProbingForHost
 */
-bool MDNSResponder::_cancelProbingForHost(void)
-{
-
-    bool    bResult = false;
-
-    m_HostProbeInformation.clear(false);
-    // Send host notification
-    if (m_HostProbeInformation.m_fnHostProbeResultCallback)
+    bool MDNSResponder::_cancelProbingForHost(void)
     {
-        m_HostProbeInformation.m_fnHostProbeResultCallback(m_pcHostname, false);
+        bool bResult = false;
+
+        m_HostProbeInformation.clear(false);
+        // Send host notification
+        if (m_HostProbeInformation.m_fnHostProbeResultCallback)
+        {
+            m_HostProbeInformation.m_fnHostProbeResultCallback(m_pcHostname, false);
 
-        bResult = true;
-    }
+            bResult = true;
+        }
 
-    for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
-    {
-        bResult = _cancelProbingForService(*pService);
+        for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
+        {
+            bResult = _cancelProbingForService(*pService);
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_cancelProbingForService
 */
-bool MDNSResponder::_cancelProbingForService(stcMDNSService& p_rService)
-{
-
-    bool    bResult = false;
-
-    p_rService.m_ProbeInformation.clear(false);
-    // Send notification
-    if (p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback)
+    bool MDNSResponder::_cancelProbingForService(stcMDNSService& p_rService)
     {
-        p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback(p_rService.m_pcName, &p_rService, false);
-        bResult = true;
-    }
-    return bResult;
-}
-
+        bool bResult = false;
 
+        p_rService.m_ProbeInformation.clear(false);
+        // Send notification
+        if (p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback)
+        {
+            p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback(p_rService.m_pcName, &p_rService, false);
+            bResult = true;
+        }
+        return bResult;
+    }
 
-/**
+    /**
     ANNOUNCING
 */
 
-/*
+    /*
     MDNSResponder::_announce
 
     Announces the host domain:
@@ -1548,116 +1449,108 @@ bool MDNSResponder::_cancelProbingForService(stcMDNSService& p_rService)
     Goodbye messages are created by setting the TTL for the answer to 0, this happens
     inside the '_writeXXXAnswer' procs via 'sendParameter.m_bUnannounce = true'
 */
-bool MDNSResponder::_announce(bool p_bAnnounce,
-                              bool p_bIncludeServices)
-{
-
-    bool    bResult = false;
-
-    stcMDNSSendParameter    sendParameter;
-    if (ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus)
+    bool MDNSResponder::_announce(bool p_bAnnounce,
+                                  bool p_bIncludeServices)
     {
+        bool bResult = false;
 
-        bResult = true;
+        stcMDNSSendParameter sendParameter;
+        if (ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus)
+        {
+            bResult = true;
 
-        sendParameter.m_bResponse = true;           // Announces are 'Unsolicited authoritative responses'
-        sendParameter.m_bAuthorative = true;
-        sendParameter.m_bUnannounce = !p_bAnnounce; // When unannouncing, the TTL is set to '0' while creating the answers
+            sendParameter.m_bResponse    = true;  // Announces are 'Unsolicited authoritative responses'
+            sendParameter.m_bAuthorative = true;
+            sendParameter.m_bUnannounce  = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
 
-        // Announce host
-        sendParameter.m_u8HostReplyMask = 0;
+            // Announce host
+            sendParameter.m_u8HostReplyMask = 0;
 #ifdef MDNS_IP4_SUPPORT
-        sendParameter.m_u8HostReplyMask |= ContentFlag_A;                   // A answer
-        sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP4;             // PTR_IP4 answer
+            sendParameter.m_u8HostReplyMask |= ContentFlag_A;        // A answer
+            sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP4;  // PTR_IP4 answer
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;                // AAAA answer
-        sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP6;             // PTR_IP6 answer
+            sendParameter.m_u8HostReplyMask |= ContentFlag_AAAA;     // AAAA answer
+            sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP6;  // PTR_IP6 answer
 #endif
 
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing host %s (content 0x%X)\n"), m_pcHostname, sendParameter.m_u8HostReplyMask););
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing host %s (content 0x%X)\n"), m_pcHostname, sendParameter.m_u8HostReplyMask););
 
-        if (p_bIncludeServices)
-        {
-            // Announce services (service type, name, SRV (location) and TXTs)
-            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+            if (p_bIncludeServices)
             {
-                if (ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus)
+                // Announce services (service type, name, SRV (location) and TXTs)
+                for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
                 {
-                    pService->m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
+                    if (ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus)
+                    {
+                        pService->m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
 
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing service %s.%s.%s (content %u)\n"), (pService->m_pcName ? : m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_u8ReplyMask););
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing service %s.%s.%s (content %u)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_u8ReplyMask););
+                    }
                 }
             }
         }
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: FAILED!\n"));
+                     });
+        return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: FAILED!\n"));
-    });
-    return ((bResult) &&
-            (_sendMDNSMessage(sendParameter)));
-}
 
-/*
+    /*
     MDNSResponder::_announceService
 */
-bool MDNSResponder::_announceService(stcMDNSService& p_rService,
-                                     bool p_bAnnounce /*= true*/)
-{
-
-    bool    bResult = false;
-
-    stcMDNSSendParameter    sendParameter;
-    if (ProbingStatus_Done == p_rService.m_ProbeInformation.m_ProbingStatus)
+    bool MDNSResponder::_announceService(stcMDNSService& p_rService,
+                                         bool            p_bAnnounce /*= true*/)
     {
+        bool bResult = false;
 
-        sendParameter.m_bResponse = true;           // Announces are 'Unsolicited authoritative responses'
-        sendParameter.m_bAuthorative = true;
-        sendParameter.m_bUnannounce = !p_bAnnounce; // When unannouncing, the TTL is set to '0' while creating the answers
+        stcMDNSSendParameter sendParameter;
+        if (ProbingStatus_Done == p_rService.m_ProbeInformation.m_ProbingStatus)
+        {
+            sendParameter.m_bResponse    = true;  // Announces are 'Unsolicited authoritative responses'
+            sendParameter.m_bAuthorative = true;
+            sendParameter.m_bUnannounce  = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
 
-        // DON'T announce host
-        sendParameter.m_u8HostReplyMask = 0;
+            // DON'T announce host
+            sendParameter.m_u8HostReplyMask = 0;
 
-        // Announce services (service type, name, SRV (location) and TXTs)
-        p_rService.m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: Announcing service %s.%s.%s (content 0x%X)\n"), (p_rService.m_pcName ? : m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, p_rService.m_u8ReplyMask););
+            // Announce services (service type, name, SRV (location) and TXTs)
+            p_rService.m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: Announcing service %s.%s.%s (content 0x%X)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, p_rService.m_u8ReplyMask););
 
-        bResult = true;
+            bResult = true;
+        }
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: FAILED!\n"));
+                     });
+        return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: FAILED!\n"));
-    });
-    return ((bResult) &&
-            (_sendMDNSMessage(sendParameter)));
-}
 
-
-/**
+    /**
     SERVICE QUERY CACHE
 */
 
-/*
+    /*
     MDNSResponder::_hasServiceQueriesWaitingForAnswers
 */
-bool MDNSResponder::_hasServiceQueriesWaitingForAnswers(void) const
-{
-
-    bool    bOpenQueries = false;
-
-    for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; pServiceQuery; pServiceQuery = pServiceQuery->m_pNext)
+    bool MDNSResponder::_hasServiceQueriesWaitingForAnswers(void) const
     {
-        if (pServiceQuery->m_bAwaitingAnswers)
+        bool bOpenQueries = false;
+
+        for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; pServiceQuery; pServiceQuery = pServiceQuery->m_pNext)
         {
-            bOpenQueries = true;
-            break;
+            if (pServiceQuery->m_bAwaitingAnswers)
+            {
+                bOpenQueries = true;
+                break;
+            }
         }
+        return bOpenQueries;
     }
-    return bOpenQueries;
-}
 
-/*
+    /*
     MDNSResponder::_checkServiceQueryCache
 
     For any 'living' service query (m_bAwaitingAnswers == true) all available answers (their components)
@@ -1666,312 +1559,268 @@ bool MDNSResponder::_hasServiceQueriesWaitingForAnswers(void) const
     When no update arrived (in time), the component is removed from the answer (cache).
 
 */
-bool MDNSResponder::_checkServiceQueryCache(void)
-{
-
-    bool        bResult = true;
-
-    DEBUG_EX_INFO(
-        bool    printedInfo = false;
-    );
-    for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; ((bResult) && (pServiceQuery)); pServiceQuery = pServiceQuery->m_pNext)
+    bool MDNSResponder::_checkServiceQueryCache(void)
     {
+        bool bResult = true;
 
-        //
-        // Resend dynamic service queries, if not already done often enough
-        if ((!pServiceQuery->m_bLegacyQuery) &&
-                (MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount) &&
-                (pServiceQuery->m_ResendTimeout.expired()))
+        DEBUG_EX_INFO(
+            bool printedInfo = false;);
+        for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; ((bResult) && (pServiceQuery)); pServiceQuery = pServiceQuery->m_pNext)
         {
-
-            if ((bResult = _sendMDNSServiceQuery(*pServiceQuery)))
+            //
+            // Resend dynamic service queries, if not already done often enough
+            if ((!pServiceQuery->m_bLegacyQuery) && (MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount) && (pServiceQuery->m_ResendTimeout.expired()))
             {
-                ++pServiceQuery->m_u8SentCount;
-                pServiceQuery->m_ResendTimeout.reset((MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount)
-                                                     ? (MDNS_DYNAMIC_QUERY_RESEND_DELAY * (pServiceQuery->m_u8SentCount - 1))
-                                                     : esp8266::polledTimeout::oneShotMs::neverExpires);
+                if ((bResult = _sendMDNSServiceQuery(*pServiceQuery)))
+                {
+                    ++pServiceQuery->m_u8SentCount;
+                    pServiceQuery->m_ResendTimeout.reset((MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount)
+                                                             ? (MDNS_DYNAMIC_QUERY_RESEND_DELAY * (pServiceQuery->m_u8SentCount - 1))
+                                                             : esp8266::polledTimeout::oneShotMs::neverExpires);
+                }
+                DEBUG_EX_INFO(
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: %s to resend service query!"), (bResult ? "Succeeded" : "FAILED"));
+                    printedInfo = true;);
             }
-            DEBUG_EX_INFO(
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: %s to resend service query!"), (bResult ? "Succeeded" : "FAILED"));
-                printedInfo = true;
-            );
-        }
 
-        //
-        // Schedule updates for cached answers
-        if (pServiceQuery->m_bAwaitingAnswers)
-        {
-            stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->m_pAnswers;
-            while ((bResult) &&
-                    (pSQAnswer))
+            //
+            // Schedule updates for cached answers
+            if (pServiceQuery->m_bAwaitingAnswers)
             {
-                stcMDNSServiceQuery::stcAnswer* pNextSQAnswer = pSQAnswer->m_pNext;
-
-                // 1. level answer
-                if ((bResult) &&
-                        (pSQAnswer->m_TTLServiceDomain.flagged()))
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->m_pAnswers;
+                while ((bResult) && (pSQAnswer))
                 {
+                    stcMDNSServiceQuery::stcAnswer* pNextSQAnswer = pSQAnswer->m_pNext;
 
-                    if (!pSQAnswer->m_TTLServiceDomain.finalTimeoutLevel())
+                    // 1. level answer
+                    if ((bResult) && (pSQAnswer->m_TTLServiceDomain.flagged()))
                     {
-
-                        bResult = ((_sendMDNSServiceQuery(*pServiceQuery)) &&
-                                   (pSQAnswer->m_TTLServiceDomain.restart()));
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: PTR update scheduled for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" %s\n"), (bResult ? "OK" : "FAILURE"));
-                            printedInfo = true;
-                        );
-                    }
-                    else
-                    {
-                        // Timed out! -> Delete
-                        if (pServiceQuery->m_fnCallback)
+                        if (!pSQAnswer->m_TTLServiceDomain.finalTimeoutLevel())
                         {
-                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain), false);
+                            bResult = ((_sendMDNSServiceQuery(*pServiceQuery)) && (pSQAnswer->m_TTLServiceDomain.restart()));
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: PTR update scheduled for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" %s\n"), (bResult ? "OK" : "FAILURE"));
+                                printedInfo = true;);
                         }
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove PTR answer for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                            printedInfo = true;
-                        );
-
-                        bResult = pServiceQuery->removeAnswer(pSQAnswer);
-                        pSQAnswer = 0;
-                        continue;   // Don't use this answer anymore
-                    }
-                }   // ServiceDomain flagged
-
-                // 2. level answers
-                // HostDomain & Port (from SRV)
-                if ((bResult) &&
-                        (pSQAnswer->m_TTLHostDomainAndPort.flagged()))
-                {
+                        else
+                        {
+                            // Timed out! -> Delete
+                            if (pServiceQuery->m_fnCallback)
+                            {
+                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain), false);
+                            }
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove PTR answer for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR("\n"));
+                                printedInfo = true;);
 
-                    if (!pSQAnswer->m_TTLHostDomainAndPort.finalTimeoutLevel())
-                    {
+                            bResult   = pServiceQuery->removeAnswer(pSQAnswer);
+                            pSQAnswer = 0;
+                            continue;  // Don't use this answer anymore
+                        }
+                    }  // ServiceDomain flagged
 
-                        bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_SRV)) &&
-                                   (pSQAnswer->m_TTLHostDomainAndPort.restart()));
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: SRV update scheduled for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" host domain and port %s\n"), (bResult ? "OK" : "FAILURE"));
-                            printedInfo = true;
-                        );
-                    }
-                    else
+                    // 2. level answers
+                    // HostDomain & Port (from SRV)
+                    if ((bResult) && (pSQAnswer->m_TTLHostDomainAndPort.flagged()))
                     {
-                        // Timed out! -> Delete
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove SRV answer for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
-                            printedInfo = true;
-                        );
-                        // Delete
-                        pSQAnswer->m_HostDomain.clear();
-                        pSQAnswer->releaseHostDomain();
-                        pSQAnswer->m_u16Port = 0;
-                        pSQAnswer->m_TTLHostDomainAndPort.set(0);
-                        uint32_t    u32ContentFlags = ServiceQueryAnswerType_HostDomainAndPort;
-                        // As the host domain is the base for the IP4- and IP6Address, remove these too
+                        if (!pSQAnswer->m_TTLHostDomainAndPort.finalTimeoutLevel())
+                        {
+                            bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_SRV)) && (pSQAnswer->m_TTLHostDomainAndPort.restart()));
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: SRV update scheduled for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" host domain and port %s\n"), (bResult ? "OK" : "FAILURE"));
+                                printedInfo = true;);
+                        }
+                        else
+                        {
+                            // Timed out! -> Delete
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove SRV answer for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
+                                printedInfo = true;);
+                            // Delete
+                            pSQAnswer->m_HostDomain.clear();
+                            pSQAnswer->releaseHostDomain();
+                            pSQAnswer->m_u16Port = 0;
+                            pSQAnswer->m_TTLHostDomainAndPort.set(0);
+                            uint32_t u32ContentFlags = ServiceQueryAnswerType_HostDomainAndPort;
+                            // As the host domain is the base for the IP4- and IP6Address, remove these too
 #ifdef MDNS_IP4_SUPPORT
-                        pSQAnswer->releaseIP4Addresses();
-                        u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
+                            pSQAnswer->releaseIP4Addresses();
+                            u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                        pSQAnswer->releaseIP6Addresses();
-                        u32ContentFlags |= ServiceQueryAnswerType_IP6Address;
+                            pSQAnswer->releaseIP6Addresses();
+                            u32ContentFlags |= ServiceQueryAnswerType_IP6Address;
 #endif
 
-                        // Remove content flags for deleted answer parts
-                        pSQAnswer->m_u32ContentFlags &= ~u32ContentFlags;
-                        if (pServiceQuery->m_fnCallback)
-                        {
-                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(u32ContentFlags), false);
-                        }
-                    }
-                }   // HostDomainAndPort flagged
-
-                // Txts (from TXT)
-                if ((bResult) &&
-                        (pSQAnswer->m_TTLTxts.flagged()))
-                {
-
-                    if (!pSQAnswer->m_TTLTxts.finalTimeoutLevel())
-                    {
-
-                        bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_TXT)) &&
-                                   (pSQAnswer->m_TTLTxts.restart()));
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: TXT update scheduled for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" TXTs %s\n"), (bResult ? "OK" : "FAILURE"));
-                            printedInfo = true;
-                        );
-                    }
-                    else
-                    {
-                        // Timed out! -> Delete
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove TXT answer for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
-                            printedInfo = true;
-                        );
-                        // Delete
-                        pSQAnswer->m_Txts.clear();
-                        pSQAnswer->m_TTLTxts.set(0);
-
-                        // Remove content flags for deleted answer parts
-                        pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_Txts;
-
-                        if (pServiceQuery->m_fnCallback)
-                        {
-                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), false);
+                            // Remove content flags for deleted answer parts
+                            pSQAnswer->m_u32ContentFlags &= ~u32ContentFlags;
+                            if (pServiceQuery->m_fnCallback)
+                            {
+                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(u32ContentFlags), false);
+                            }
                         }
-                    }
-                }   // TXTs flagged
-
-                // 3. level answers
-#ifdef MDNS_IP4_SUPPORT
-                // IP4Address (from A)
-                stcMDNSServiceQuery::stcAnswer::stcIP4Address*  pIP4Address = pSQAnswer->m_pIP4Addresses;
-                bool                                            bAUpdateQuerySent = false;
-                while ((pIP4Address) &&
-                        (bResult))
-                {
+                    }  // HostDomainAndPort flagged
 
-                    stcMDNSServiceQuery::stcAnswer::stcIP4Address*  pNextIP4Address = pIP4Address->m_pNext; // Get 'next' early, as 'current' may be deleted at the end...
-
-                    if (pIP4Address->m_TTL.flagged())
+                    // Txts (from TXT)
+                    if ((bResult) && (pSQAnswer->m_TTLTxts.flagged()))
                     {
-
-                        if (!pIP4Address->m_TTL.finalTimeoutLevel())    // Needs update
+                        if (!pSQAnswer->m_TTLTxts.finalTimeoutLevel())
                         {
-
-                            if ((bAUpdateQuerySent) ||
-                                    ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_A))))
-                            {
-
-                                pIP4Address->m_TTL.restart();
-                                bAUpdateQuerySent = true;
-
-                                DEBUG_EX_INFO(
-                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP4 update scheduled for "));
-                                    _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                    DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), (pIP4Address->m_IPAddress.toString().c_str()));
-                                    printedInfo = true;
-                                );
-                            }
+                            bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_TXT)) && (pSQAnswer->m_TTLTxts.restart()));
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: TXT update scheduled for "));
+                                _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                DEBUG_OUTPUT.printf_P(PSTR(" TXTs %s\n"), (bResult ? "OK" : "FAILURE"));
+                                printedInfo = true;);
                         }
                         else
                         {
                             // Timed out! -> Delete
                             DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove IP4 answer for "));
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove TXT answer for "));
                                 _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" IP4 address\n"));
-                                printedInfo = true;
-                            );
-                            pSQAnswer->removeIP4Address(pIP4Address);
-                            if (!pSQAnswer->m_pIP4Addresses)    // NO IP4 address left -> remove content flag
-                            {
-                                pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP4Address;
-                            }
-                            // Notify client
+                                DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
+                                printedInfo = true;);
+                            // Delete
+                            pSQAnswer->m_Txts.clear();
+                            pSQAnswer->m_TTLTxts.set(0);
+
+                            // Remove content flags for deleted answer parts
+                            pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_Txts;
+
                             if (pServiceQuery->m_fnCallback)
                             {
                                 MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), false);
+                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), false);
                             }
                         }
-                    }   // IP4 flagged
-
-                    pIP4Address = pNextIP4Address;  // Next
-                }   // while
-#endif
-#ifdef MDNS_IP6_SUPPORT
-                // IP6Address (from AAAA)
-                stcMDNSServiceQuery::stcAnswer::stcIP6Address*  pIP6Address = pSQAnswer->m_pIP6Addresses;
-                bool                                            bAAAAUpdateQuerySent = false;
-                while ((pIP6Address) &&
-                        (bResult))
-                {
-
-                    stcMDNSServiceQuery::stcAnswer::stcIP6Address*  pNextIP6Address = pIP6Address->m_pNext; // Get 'next' early, as 'current' may be deleted at the end...
+                    }  // TXTs flagged
 
-                    if (pIP6Address->m_TTL.flagged())
+                    // 3. level answers
+#ifdef MDNS_IP4_SUPPORT
+                    // IP4Address (from A)
+                    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address       = pSQAnswer->m_pIP4Addresses;
+                    bool                                           bAUpdateQuerySent = false;
+                    while ((pIP4Address) && (bResult))
                     {
+                        stcMDNSServiceQuery::stcAnswer::stcIP4Address* pNextIP4Address = pIP4Address->m_pNext;  // Get 'next' early, as 'current' may be deleted at the end...
 
-                        if (!pIP6Address->m_TTL.finalTimeoutLevel())    // Needs update
+                        if (pIP4Address->m_TTL.flagged())
                         {
-
-                            if ((bAAAAUpdateQuerySent) ||
-                                    ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_AAAA))))
+                            if (!pIP4Address->m_TTL.finalTimeoutLevel())  // Needs update
                             {
-
-                                pIP6Address->m_TTL.restart();
-                                bAAAAUpdateQuerySent = true;
-
+                                if ((bAUpdateQuerySent) || ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_A))))
+                                {
+                                    pIP4Address->m_TTL.restart();
+                                    bAUpdateQuerySent = true;
+
+                                    DEBUG_EX_INFO(
+                                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP4 update scheduled for "));
+                                        _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                        DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), (pIP4Address->m_IPAddress.toString().c_str()));
+                                        printedInfo = true;);
+                                }
+                            }
+                            else
+                            {
+                                // Timed out! -> Delete
                                 DEBUG_EX_INFO(
-                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP6 update scheduled for "));
+                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove IP4 answer for "));
                                     _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                    DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), (pIP6Address->m_IPAddress.toString().c_str()));
-                                    printedInfo = true;
-                                );
+                                    DEBUG_OUTPUT.printf_P(PSTR(" IP4 address\n"));
+                                    printedInfo = true;);
+                                pSQAnswer->removeIP4Address(pIP4Address);
+                                if (!pSQAnswer->m_pIP4Addresses)  // NO IP4 address left -> remove content flag
+                                {
+                                    pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP4Address;
+                                }
+                                // Notify client
+                                if (pServiceQuery->m_fnCallback)
+                                {
+                                    MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
+                                    pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), false);
+                                }
                             }
-                        }
-                        else
+                        }  // IP4 flagged
+
+                        pIP4Address = pNextIP4Address;  // Next
+                    }                                   // while
+#endif
+#ifdef MDNS_IP6_SUPPORT
+                    // IP6Address (from AAAA)
+                    stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address          = pSQAnswer->m_pIP6Addresses;
+                    bool                                           bAAAAUpdateQuerySent = false;
+                    while ((pIP6Address) && (bResult))
+                    {
+                        stcMDNSServiceQuery::stcAnswer::stcIP6Address* pNextIP6Address = pIP6Address->m_pNext;  // Get 'next' early, as 'current' may be deleted at the end...
+
+                        if (pIP6Address->m_TTL.flagged())
                         {
-                            // Timed out! -> Delete
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove answer for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" IP6Address\n"));
-                                printedInfo = true;
-                            );
-                            pSQAnswer->removeIP6Address(pIP6Address);
-                            if (!pSQAnswer->m_pIP6Addresses)    // NO IP6 address left -> remove content flag
+                            if (!pIP6Address->m_TTL.finalTimeoutLevel())  // Needs update
                             {
-                                pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP6Address;
+                                if ((bAAAAUpdateQuerySent) || ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_AAAA))))
+                                {
+                                    pIP6Address->m_TTL.restart();
+                                    bAAAAUpdateQuerySent = true;
+
+                                    DEBUG_EX_INFO(
+                                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP6 update scheduled for "));
+                                        _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                        DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), (pIP6Address->m_IPAddress.toString().c_str()));
+                                        printedInfo = true;);
+                                }
                             }
-                            // Notify client
-                            if (pServiceQuery->m_fnCallback)
+                            else
                             {
-                                pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, false, pServiceQuery->m_pUserdata);
+                                // Timed out! -> Delete
+                                DEBUG_EX_INFO(
+                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove answer for "));
+                                    _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                    DEBUG_OUTPUT.printf_P(PSTR(" IP6Address\n"));
+                                    printedInfo = true;);
+                                pSQAnswer->removeIP6Address(pIP6Address);
+                                if (!pSQAnswer->m_pIP6Addresses)  // NO IP6 address left -> remove content flag
+                                {
+                                    pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP6Address;
+                                }
+                                // Notify client
+                                if (pServiceQuery->m_fnCallback)
+                                {
+                                    pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, false, pServiceQuery->m_pUserdata);
+                                }
                             }
-                        }
-                    }   // IP6 flagged
+                        }  // IP6 flagged
 
-                    pIP6Address = pNextIP6Address;  // Next
-                }   // while
+                        pIP6Address = pNextIP6Address;  // Next
+                    }                                   // while
 #endif
-                pSQAnswer = pNextSQAnswer;
+                    pSQAnswer = pNextSQAnswer;
+                }
             }
         }
+        DEBUG_EX_INFO(
+            if (printedInfo)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("\n"));
+            });
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: FAILED!\n"));
+                     });
+        return bResult;
     }
-    DEBUG_EX_INFO(
-        if (printedInfo)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("\n"));
-    }
-    );
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: FAILED!\n"));
-    });
-    return bResult;
-}
 
-
-/*
+    /*
     MDNSResponder::_replyMaskForHost
 
     Determines the relevant host answers for the given question.
@@ -1980,79 +1829,71 @@ bool MDNSResponder::_checkServiceQueryCache(void)
 
     In addition, a full name match (question domain == host domain) is marked.
 */
-uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
-        bool* p_pbFullNameMatch /*= 0*/) const
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost\n")););
-
-    uint8_t u8ReplyMask = 0;
-    (p_pbFullNameMatch ? *p_pbFullNameMatch = false : 0);
-
-    if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) ||
-            (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
+    uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
+                                             bool*                                  p_pbFullNameMatch /*= 0*/) const
     {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost\n")););
+
+        uint8_t u8ReplyMask = 0;
+        (p_pbFullNameMatch ? * p_pbFullNameMatch = false : 0);
 
-        if ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) ||
-                (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+        if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) || (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
         {
-            // PTR request
-#ifdef MDNS_IP4_SUPPORT
-            stcMDNS_RRDomain    reverseIP4Domain;
-            for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+            if ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
             {
-                if (netif_is_up(pNetIf))
+                // PTR request
+#ifdef MDNS_IP4_SUPPORT
+                stcMDNS_RRDomain reverseIP4Domain;
+                for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
                 {
-                    if ((_buildDomainForReverseIP4(pNetIf->ip_addr, reverseIP4Domain)) &&
-                            (p_RRHeader.m_Domain == reverseIP4Domain))
+                    if (netif_is_up(pNetIf))
                     {
-                        // Reverse domain match
-                        u8ReplyMask |= ContentFlag_PTR_IP4;
+                        if ((_buildDomainForReverseIP4(pNetIf->ip_addr, reverseIP4Domain)) && (p_RRHeader.m_Domain == reverseIP4Domain))
+                        {
+                            // Reverse domain match
+                            u8ReplyMask |= ContentFlag_PTR_IP4;
+                        }
                     }
                 }
-            }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            // TODO
+                // TODO
 #endif
-        }   // Address qeuest
-
-        stcMDNS_RRDomain    hostDomain;
-        if ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                (p_RRHeader.m_Domain == hostDomain))    // Host domain match
-        {
+            }  // Address qeuest
 
-            (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
+            stcMDNS_RRDomain hostDomain;
+            if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (p_RRHeader.m_Domain == hostDomain))  // Host domain match
+            {
+                (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
 
 #ifdef MDNS_IP4_SUPPORT
-            if ((DNS_RRTYPE_A == p_RRHeader.m_Attributes.m_u16Type) ||
-                    (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
-            {
-                // IP4 address request
-                u8ReplyMask |= ContentFlag_A;
-            }
+                if ((DNS_RRTYPE_A == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                {
+                    // IP4 address request
+                    u8ReplyMask |= ContentFlag_A;
+                }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            if ((DNS_RRTYPE_AAAA == p_RRHeader.m_Attributes.m_u16Type) ||
-                    (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
-            {
-                // IP6 address request
-                u8ReplyMask |= ContentFlag_AAAA;
-            }
+                if ((DNS_RRTYPE_AAAA == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                {
+                    // IP6 address request
+                    u8ReplyMask |= ContentFlag_AAAA;
+                }
 #endif
+            }
         }
+        else
+        {
+            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
+        }
+        DEBUG_EX_INFO(if (u8ReplyMask)
+                      {
+                          DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: 0x%X\n"), u8ReplyMask);
+                      });
+        return u8ReplyMask;
     }
-    else
-    {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
-    }
-    DEBUG_EX_INFO(if (u8ReplyMask)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: 0x%X\n"), u8ReplyMask);
-    });
-    return u8ReplyMask;
-}
 
-/*
+    /*
     MDNSResponder::_replyMaskForService
 
     Determines the relevant service answers for the given question
@@ -2064,69 +1905,59 @@ uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader&
 
     In addition, a full name match (question domain == service instance domain) is marked.
 */
-uint8_t MDNSResponder::_replyMaskForService(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
-        const MDNSResponder::stcMDNSService& p_Service,
-        bool* p_pbFullNameMatch /*= 0*/) const
-{
-
-    uint8_t u8ReplyMask = 0;
-    (p_pbFullNameMatch ? *p_pbFullNameMatch = false : 0);
-
-    if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) ||
-            (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
+    uint8_t MDNSResponder::_replyMaskForService(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
+                                                const MDNSResponder::stcMDNSService&   p_Service,
+                                                bool*                                  p_pbFullNameMatch /*= 0*/) const
     {
+        uint8_t u8ReplyMask = 0;
+        (p_pbFullNameMatch ? * p_pbFullNameMatch = false : 0);
 
-        stcMDNS_RRDomain    DNSSDDomain;
-        if ((_buildDomainForDNSSD(DNSSDDomain)) &&                          // _services._dns-sd._udp.local
-                (p_RRHeader.m_Domain == DNSSDDomain) &&
-                ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) ||
-                 (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
+        if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) || (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
         {
-            // Common service info requested
-            u8ReplyMask |= ContentFlag_PTR_TYPE;
-        }
-
-        stcMDNS_RRDomain    serviceDomain;
-        if ((_buildDomainForService(p_Service, false, serviceDomain)) &&    // eg. _http._tcp.local
-                (p_RRHeader.m_Domain == serviceDomain) &&
-                ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) ||
-                 (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
-        {
-            // Special service info requested
-            u8ReplyMask |= ContentFlag_PTR_NAME;
-        }
-
-        if ((_buildDomainForService(p_Service, true, serviceDomain)) &&     // eg. MyESP._http._tcp.local
-                (p_RRHeader.m_Domain == serviceDomain))
-        {
-
-            (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
+            stcMDNS_RRDomain DNSSDDomain;
+            if ((_buildDomainForDNSSD(DNSSDDomain)) &&  // _services._dns-sd._udp.local
+                (p_RRHeader.m_Domain == DNSSDDomain) && ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
+            {
+                // Common service info requested
+                u8ReplyMask |= ContentFlag_PTR_TYPE;
+            }
 
-            if ((DNS_RRTYPE_SRV == p_RRHeader.m_Attributes.m_u16Type) ||
-                    (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+            stcMDNS_RRDomain serviceDomain;
+            if ((_buildDomainForService(p_Service, false, serviceDomain)) &&  // eg. _http._tcp.local
+                (p_RRHeader.m_Domain == serviceDomain) && ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
             {
-                // Instance info SRV requested
-                u8ReplyMask |= ContentFlag_SRV;
+                // Special service info requested
+                u8ReplyMask |= ContentFlag_PTR_NAME;
             }
-            if ((DNS_RRTYPE_TXT == p_RRHeader.m_Attributes.m_u16Type) ||
-                    (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+
+            if ((_buildDomainForService(p_Service, true, serviceDomain)) &&  // eg. MyESP._http._tcp.local
+                (p_RRHeader.m_Domain == serviceDomain))
             {
-                // Instance info TXT requested
-                u8ReplyMask |= ContentFlag_TXT;
+                (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
+
+                if ((DNS_RRTYPE_SRV == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                {
+                    // Instance info SRV requested
+                    u8ReplyMask |= ContentFlag_SRV;
+                }
+                if ((DNS_RRTYPE_TXT == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                {
+                    // Instance info TXT requested
+                    u8ReplyMask |= ContentFlag_TXT;
+                }
             }
         }
+        else
+        {
+            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
+        }
+        DEBUG_EX_INFO(if (u8ReplyMask)
+                      {
+                          DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService(%s.%s.%s): 0x%X\n"), p_Service.m_pcName, p_Service.m_pcService, p_Service.m_pcProtocol, u8ReplyMask);
+                      });
+        return u8ReplyMask;
     }
-    else
-    {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
-    }
-    DEBUG_EX_INFO(if (u8ReplyMask)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService(%s.%s.%s): 0x%X\n"), p_Service.m_pcName, p_Service.m_pcService, p_Service.m_pcProtocol, u8ReplyMask);
-    });
-    return u8ReplyMask;
-}
 
-} // namespace MDNSImplementation
+}  // namespace MDNSImplementation
 
-} // namespace esp8266
+}  // namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
index d4014db993..7aa16df0c0 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
@@ -23,7 +23,7 @@
 */
 
 #include <lwip/igmp.h>
-#include <stdlib_noniso.h> // strrstr()
+#include <stdlib_noniso.h>  // strrstr()
 
 #include "ESP8266mDNS.h"
 #include "LEAmDNS_lwIPdefs.h"
@@ -31,18 +31,16 @@
 
 namespace esp8266
 {
-
 /*
     LEAmDNS
 */
 namespace MDNSImplementation
 {
-
-/**
+    /**
     HELPERS
 */
 
-/*
+    /*
     MDNSResponder::indexDomain (static)
 
     Updates the given domain 'p_rpcHostname' by appending a delimiter and an index number.
@@ -54,37 +52,57 @@ namespace MDNSImplementation
     if no default is given, 'esp8266' is used.
 
 */
-/*static*/ bool MDNSResponder::indexDomain(char*& p_rpcDomain,
-        const char* p_pcDivider /*= "-"*/,
-        const char* p_pcDefaultDomain /*= 0*/)
-{
-
-    bool    bResult = false;
+    /*static*/ bool MDNSResponder::indexDomain(char*&      p_rpcDomain,
+                                               const char* p_pcDivider /*= "-"*/,
+                                               const char* p_pcDefaultDomain /*= 0*/)
+    {
+        bool bResult = false;
 
-    // Ensure a divider exists; use '-' as default
-    const char*   pcDivider = (p_pcDivider ? : "-");
+        // Ensure a divider exists; use '-' as default
+        const char* pcDivider = (p_pcDivider ?: "-");
 
-    if (p_rpcDomain)
-    {
-        const char* pFoundDivider = strrstr(p_rpcDomain, pcDivider);
-        if (pFoundDivider)      // maybe already extended
+        if (p_rpcDomain)
         {
-            char*         pEnd = 0;
-            unsigned long ulIndex = strtoul((pFoundDivider + strlen(pcDivider)), &pEnd, 10);
-            if ((ulIndex) &&
-                    ((pEnd - p_rpcDomain) == (ptrdiff_t)strlen(p_rpcDomain)) &&
-                    (!*pEnd))         // Valid (old) index found
+            const char* pFoundDivider = strrstr(p_rpcDomain, pcDivider);
+            if (pFoundDivider)  // maybe already extended
             {
+                char*         pEnd    = 0;
+                unsigned long ulIndex = strtoul((pFoundDivider + strlen(pcDivider)), &pEnd, 10);
+                if ((ulIndex) && ((pEnd - p_rpcDomain) == (ptrdiff_t)strlen(p_rpcDomain)) && (!*pEnd))  // Valid (old) index found
+                {
+                    char acIndexBuffer[16];
+                    sprintf(acIndexBuffer, "%lu", (++ulIndex));
+                    size_t stLength     = ((pFoundDivider - p_rpcDomain + strlen(pcDivider)) + strlen(acIndexBuffer) + 1);
+                    char*  pNewHostname = new char[stLength];
+                    if (pNewHostname)
+                    {
+                        memcpy(pNewHostname, p_rpcDomain, (pFoundDivider - p_rpcDomain + strlen(pcDivider)));
+                        pNewHostname[pFoundDivider - p_rpcDomain + strlen(pcDivider)] = 0;
+                        strcat(pNewHostname, acIndexBuffer);
+
+                        delete[] p_rpcDomain;
+                        p_rpcDomain = pNewHostname;
+
+                        bResult = true;
+                    }
+                    else
+                    {
+                        DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
+                    }
+                }
+                else
+                {
+                    pFoundDivider = 0;  // Flag the need to (base) extend the hostname
+                }
+            }
 
-                char    acIndexBuffer[16];
-                sprintf(acIndexBuffer, "%lu", (++ulIndex));
-                size_t  stLength = ((pFoundDivider - p_rpcDomain + strlen(pcDivider)) + strlen(acIndexBuffer) + 1);
-                char*   pNewHostname = new char[stLength];
+            if (!pFoundDivider)  // not yet extended (or failed to increment extension) -> start indexing
+            {
+                size_t stLength     = strlen(p_rpcDomain) + (strlen(pcDivider) + 1 + 1);  // Name + Divider + '2' + '\0'
+                char*  pNewHostname = new char[stLength];
                 if (pNewHostname)
                 {
-                    memcpy(pNewHostname, p_rpcDomain, (pFoundDivider - p_rpcDomain + strlen(pcDivider)));
-                    pNewHostname[pFoundDivider - p_rpcDomain + strlen(pcDivider)] = 0;
-                    strcat(pNewHostname, acIndexBuffer);
+                    sprintf(pNewHostname, "%s%s2", p_rpcDomain, pcDivider);
 
                     delete[] p_rpcDomain;
                     p_rpcDomain = pNewHostname;
@@ -96,23 +114,17 @@ namespace MDNSImplementation
                     DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
                 }
             }
-            else
-            {
-                pFoundDivider = 0;  // Flag the need to (base) extend the hostname
-            }
         }
-
-        if (!pFoundDivider)     // not yet extended (or failed to increment extension) -> start indexing
+        else
         {
-            size_t    stLength = strlen(p_rpcDomain) + (strlen(pcDivider) + 1 + 1);   // Name + Divider + '2' + '\0'
-            char*     pNewHostname = new char[stLength];
-            if (pNewHostname)
-            {
-                sprintf(pNewHostname, "%s%s2", p_rpcDomain, pcDivider);
-
-                delete[] p_rpcDomain;
-                p_rpcDomain = pNewHostname;
+            // No given host domain, use base or default
+            const char* cpcDefaultName = (p_pcDefaultDomain ?: "esp8266");
 
+            size_t stLength = strlen(cpcDefaultName) + 1;  // '\0'
+            p_rpcDomain     = new char[stLength];
+            if (p_rpcDomain)
+            {
+                strncpy(p_rpcDomain, cpcDefaultName, stLength);
                 bResult = true;
             }
             else
@@ -120,41 +132,22 @@ namespace MDNSImplementation
                 DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
             }
         }
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] indexDomain: %s\n"), p_rpcDomain););
+        return bResult;
     }
-    else
-    {
-        // No given host domain, use base or default
-        const char* cpcDefaultName = (p_pcDefaultDomain ? : "esp8266");
 
-        size_t      stLength = strlen(cpcDefaultName) + 1;   // '\0'
-        p_rpcDomain = new char[stLength];
-        if (p_rpcDomain)
-        {
-            strncpy(p_rpcDomain, cpcDefaultName, stLength);
-            bResult = true;
-        }
-        else
-        {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
-        }
-    }
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] indexDomain: %s\n"), p_rpcDomain););
-    return bResult;
-}
-
-
-/*
+    /*
     UDP CONTEXT
 */
 
-bool MDNSResponder::_callProcess(void)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf("[MDNSResponder] _callProcess (%lu, triggered by: %s)\n", millis(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
+    bool MDNSResponder::_callProcess(void)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf("[MDNSResponder] _callProcess (%lu, triggered by: %s)\n", millis(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
 
-    return _process(false);
-}
+        return _process(false);
+    }
 
-/*
+    /*
     MDNSResponder::_allocUDPContext
 
     (Re-)Creates the one-and-only UDP context for the MDNS responder.
@@ -164,638 +157,579 @@ bool MDNSResponder::_callProcess(void)
     is called from the WiFi stack side of the ESP stack system.
 
 */
-bool MDNSResponder::_allocUDPContext(void)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.println("[MDNSResponder] _allocUDPContext"););
+    bool MDNSResponder::_allocUDPContext(void)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.println("[MDNSResponder] _allocUDPContext"););
 
-    _releaseUDPContext();
-    _joinMulticastGroups();
+        _releaseUDPContext();
+        _joinMulticastGroups();
 
-    m_pUDPContext = new UdpContext;
-    m_pUDPContext->ref();
+        m_pUDPContext = new UdpContext;
+        m_pUDPContext->ref();
 
-    if (m_pUDPContext->listen(IP4_ADDR_ANY, DNS_MQUERY_PORT))
-    {
-        m_pUDPContext->setMulticastTTL(MDNS_MULTICAST_TTL);
-        m_pUDPContext->onRx(std::bind(&MDNSResponder::_callProcess, this));
-    }
-    else
-    {
-        return false;
-    }
+        if (m_pUDPContext->listen(IP4_ADDR_ANY, DNS_MQUERY_PORT))
+        {
+            m_pUDPContext->setMulticastTTL(MDNS_MULTICAST_TTL);
+            m_pUDPContext->onRx(std::bind(&MDNSResponder::_callProcess, this));
+        }
+        else
+        {
+            return false;
+        }
 
-    return true;
-}
+        return true;
+    }
 
-/*
+    /*
     MDNSResponder::_releaseUDPContext
 */
-bool MDNSResponder::_releaseUDPContext(void)
-{
-
-    if (m_pUDPContext)
+    bool MDNSResponder::_releaseUDPContext(void)
     {
-        m_pUDPContext->unref();
-        m_pUDPContext = 0;
-        _leaveMulticastGroups();
+        if (m_pUDPContext)
+        {
+            m_pUDPContext->unref();
+            m_pUDPContext = 0;
+            _leaveMulticastGroups();
+        }
+        return true;
     }
-    return true;
-}
-
 
-/*
+    /*
     SERVICE QUERY
 */
 
-/*
+    /*
     MDNSResponder::_allocServiceQuery
 */
-MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_allocServiceQuery(void)
-{
-
-    stcMDNSServiceQuery*    pServiceQuery = new stcMDNSServiceQuery;
-    if (pServiceQuery)
+    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_allocServiceQuery(void)
     {
-        // Link to query list
-        pServiceQuery->m_pNext = m_pServiceQueries;
-        m_pServiceQueries = pServiceQuery;
+        stcMDNSServiceQuery* pServiceQuery = new stcMDNSServiceQuery;
+        if (pServiceQuery)
+        {
+            // Link to query list
+            pServiceQuery->m_pNext = m_pServiceQueries;
+            m_pServiceQueries      = pServiceQuery;
+        }
+        return m_pServiceQueries;
     }
-    return m_pServiceQueries;
-}
 
-/*
+    /*
     MDNSResponder::_removeServiceQuery
 */
-bool MDNSResponder::_removeServiceQuery(MDNSResponder::stcMDNSServiceQuery* p_pServiceQuery)
-{
-
-    bool    bResult = false;
-
-    if (p_pServiceQuery)
+    bool MDNSResponder::_removeServiceQuery(MDNSResponder::stcMDNSServiceQuery* p_pServiceQuery)
     {
-        stcMDNSServiceQuery*    pPred = m_pServiceQueries;
-        while ((pPred) &&
-                (pPred->m_pNext != p_pServiceQuery))
-        {
-            pPred = pPred->m_pNext;
-        }
-        if (pPred)
-        {
-            pPred->m_pNext = p_pServiceQuery->m_pNext;
-            delete p_pServiceQuery;
-            bResult = true;
-        }
-        else    // No predecessor
+        bool bResult = false;
+
+        if (p_pServiceQuery)
         {
-            if (m_pServiceQueries == p_pServiceQuery)
+            stcMDNSServiceQuery* pPred = m_pServiceQueries;
+            while ((pPred) && (pPred->m_pNext != p_pServiceQuery))
+            {
+                pPred = pPred->m_pNext;
+            }
+            if (pPred)
             {
-                m_pServiceQueries = p_pServiceQuery->m_pNext;
+                pPred->m_pNext = p_pServiceQuery->m_pNext;
                 delete p_pServiceQuery;
                 bResult = true;
             }
-            else
+            else  // No predecessor
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.println("[MDNSResponder] _releaseServiceQuery: INVALID service query!"););
+                if (m_pServiceQueries == p_pServiceQuery)
+                {
+                    m_pServiceQueries = p_pServiceQuery->m_pNext;
+                    delete p_pServiceQuery;
+                    bResult = true;
+                }
+                else
+                {
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.println("[MDNSResponder] _releaseServiceQuery: INVALID service query!"););
+                }
             }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_removeLegacyServiceQuery
 */
-bool MDNSResponder::_removeLegacyServiceQuery(void)
-{
-
-    stcMDNSServiceQuery*    pLegacyServiceQuery = _findLegacyServiceQuery();
-    return (pLegacyServiceQuery ? _removeServiceQuery(pLegacyServiceQuery) : true);
-}
+    bool MDNSResponder::_removeLegacyServiceQuery(void)
+    {
+        stcMDNSServiceQuery* pLegacyServiceQuery = _findLegacyServiceQuery();
+        return (pLegacyServiceQuery ? _removeServiceQuery(pLegacyServiceQuery) : true);
+    }
 
-/*
+    /*
     MDNSResponder::_findServiceQuery
 
     'Convert' hMDNSServiceQuery to stcMDNSServiceQuery* (ensure existence)
 
 */
-MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
-{
-
-    stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
-    while (pServiceQuery)
+    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
     {
-        if ((hMDNSServiceQuery)pServiceQuery == p_hServiceQuery)
+        stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
+        while (pServiceQuery)
         {
-            break;
+            if ((hMDNSServiceQuery)pServiceQuery == p_hServiceQuery)
+            {
+                break;
+            }
+            pServiceQuery = pServiceQuery->m_pNext;
         }
-        pServiceQuery = pServiceQuery->m_pNext;
+        return pServiceQuery;
     }
-    return pServiceQuery;
-}
 
-/*
+    /*
     MDNSResponder::_findLegacyServiceQuery
 */
-MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findLegacyServiceQuery(void)
-{
-
-    stcMDNSServiceQuery*    pServiceQuery = m_pServiceQueries;
-    while (pServiceQuery)
+    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findLegacyServiceQuery(void)
     {
-        if (pServiceQuery->m_bLegacyQuery)
+        stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
+        while (pServiceQuery)
         {
-            break;
+            if (pServiceQuery->m_bLegacyQuery)
+            {
+                break;
+            }
+            pServiceQuery = pServiceQuery->m_pNext;
         }
-        pServiceQuery = pServiceQuery->m_pNext;
+        return pServiceQuery;
     }
-    return pServiceQuery;
-}
 
-/*
+    /*
     MDNSResponder::_releaseServiceQueries
 */
-bool MDNSResponder::_releaseServiceQueries(void)
-{
-    while (m_pServiceQueries)
+    bool MDNSResponder::_releaseServiceQueries(void)
     {
-        stcMDNSServiceQuery*    pNext = m_pServiceQueries->m_pNext;
-        delete m_pServiceQueries;
-        m_pServiceQueries = pNext;
+        while (m_pServiceQueries)
+        {
+            stcMDNSServiceQuery* pNext = m_pServiceQueries->m_pNext;
+            delete m_pServiceQueries;
+            m_pServiceQueries = pNext;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::_findNextServiceQueryByServiceType
 */
-MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findNextServiceQueryByServiceType(const stcMDNS_RRDomain& p_ServiceTypeDomain,
-        const stcMDNSServiceQuery* p_pPrevServiceQuery)
-{
-    stcMDNSServiceQuery*    pMatchingServiceQuery = 0;
-
-    stcMDNSServiceQuery*    pServiceQuery = (p_pPrevServiceQuery ? p_pPrevServiceQuery->m_pNext : m_pServiceQueries);
-    while (pServiceQuery)
+    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findNextServiceQueryByServiceType(const stcMDNS_RRDomain&    p_ServiceTypeDomain,
+                                                                                          const stcMDNSServiceQuery* p_pPrevServiceQuery)
     {
-        if (p_ServiceTypeDomain == pServiceQuery->m_ServiceTypeDomain)
+        stcMDNSServiceQuery* pMatchingServiceQuery = 0;
+
+        stcMDNSServiceQuery* pServiceQuery = (p_pPrevServiceQuery ? p_pPrevServiceQuery->m_pNext : m_pServiceQueries);
+        while (pServiceQuery)
         {
-            pMatchingServiceQuery = pServiceQuery;
-            break;
+            if (p_ServiceTypeDomain == pServiceQuery->m_ServiceTypeDomain)
+            {
+                pMatchingServiceQuery = pServiceQuery;
+                break;
+            }
+            pServiceQuery = pServiceQuery->m_pNext;
         }
-        pServiceQuery = pServiceQuery->m_pNext;
+        return pMatchingServiceQuery;
     }
-    return pMatchingServiceQuery;
-}
-
 
-/*
+    /*
     HOSTNAME
 */
 
-/*
+    /*
     MDNSResponder::_setHostname
 */
-bool MDNSResponder::_setHostname(const char* p_pcHostname)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _allocHostname (%s)\n"), p_pcHostname););
+    bool MDNSResponder::_setHostname(const char* p_pcHostname)
+    {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _allocHostname (%s)\n"), p_pcHostname););
 
-    bool    bResult = false;
+        bool bResult = false;
 
-    _releaseHostname();
+        _releaseHostname();
 
-    size_t  stLength = 0;
-    if ((p_pcHostname) &&
-            (MDNS_DOMAIN_LABEL_MAXLENGTH >= (stLength = strlen(p_pcHostname))))   // char max size for a single label
-    {
-        // Copy in hostname characters as lowercase
-        if ((bResult = (0 != (m_pcHostname = new char[stLength + 1]))))
+        size_t stLength = 0;
+        if ((p_pcHostname) && (MDNS_DOMAIN_LABEL_MAXLENGTH >= (stLength = strlen(p_pcHostname))))  // char max size for a single label
         {
-#ifdef MDNS_FORCE_LOWERCASE_HOSTNAME
-            size_t i = 0;
-            for (; i < stLength; ++i)
+            // Copy in hostname characters as lowercase
+            if ((bResult = (0 != (m_pcHostname = new char[stLength + 1]))))
             {
-                m_pcHostname[i] = (isupper(p_pcHostname[i]) ? tolower(p_pcHostname[i]) : p_pcHostname[i]);
-            }
-            m_pcHostname[i] = 0;
+#ifdef MDNS_FORCE_LOWERCASE_HOSTNAME
+                size_t i = 0;
+                for (; i < stLength; ++i)
+                {
+                    m_pcHostname[i] = (isupper(p_pcHostname[i]) ? tolower(p_pcHostname[i]) : p_pcHostname[i]);
+                }
+                m_pcHostname[i] = 0;
 #else
-            strncpy(m_pcHostname, p_pcHostname, (stLength + 1));
+                strncpy(m_pcHostname, p_pcHostname, (stLength + 1));
 #endif
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_releaseHostname
 */
-bool MDNSResponder::_releaseHostname(void)
-{
-
-    if (m_pcHostname)
+    bool MDNSResponder::_releaseHostname(void)
     {
-        delete[] m_pcHostname;
-        m_pcHostname = 0;
+        if (m_pcHostname)
+        {
+            delete[] m_pcHostname;
+            m_pcHostname = 0;
+        }
+        return true;
     }
-    return true;
-}
-
 
-/*
+    /*
     SERVICE
 */
 
-/*
+    /*
     MDNSResponder::_allocService
 */
-MDNSResponder::stcMDNSService* MDNSResponder::_allocService(const char* p_pcName,
-        const char* p_pcService,
-        const char* p_pcProtocol,
-        uint16_t p_u16Port)
-{
-
-    stcMDNSService* pService = 0;
-    if (((!p_pcName) ||
-            (MDNS_DOMAIN_LABEL_MAXLENGTH >= strlen(p_pcName))) &&
-            (p_pcService) &&
-            (MDNS_SERVICE_NAME_LENGTH >= strlen(p_pcService)) &&
-            (p_pcProtocol) &&
-            (MDNS_SERVICE_PROTOCOL_LENGTH >= strlen(p_pcProtocol)) &&
-            (p_u16Port) &&
-            (0 != (pService = new stcMDNSService)) &&
-            (pService->setName(p_pcName ? : m_pcHostname)) &&
-            (pService->setService(p_pcService)) &&
-            (pService->setProtocol(p_pcProtocol)))
+    MDNSResponder::stcMDNSService* MDNSResponder::_allocService(const char* p_pcName,
+                                                                const char* p_pcService,
+                                                                const char* p_pcProtocol,
+                                                                uint16_t    p_u16Port)
     {
+        stcMDNSService* pService = 0;
+        if (((!p_pcName) || (MDNS_DOMAIN_LABEL_MAXLENGTH >= strlen(p_pcName))) && (p_pcService) && (MDNS_SERVICE_NAME_LENGTH >= strlen(p_pcService)) && (p_pcProtocol) && (MDNS_SERVICE_PROTOCOL_LENGTH >= strlen(p_pcProtocol)) && (p_u16Port) && (0 != (pService = new stcMDNSService)) && (pService->setName(p_pcName ?: m_pcHostname)) && (pService->setService(p_pcService)) && (pService->setProtocol(p_pcProtocol)))
+        {
+            pService->m_bAutoName = (0 == p_pcName);
+            pService->m_u16Port   = p_u16Port;
 
-        pService->m_bAutoName = (0 == p_pcName);
-        pService->m_u16Port = p_u16Port;
-
-        // Add to list (or start list)
-        pService->m_pNext = m_pServices;
-        m_pServices = pService;
+            // Add to list (or start list)
+            pService->m_pNext = m_pServices;
+            m_pServices       = pService;
+        }
+        return pService;
     }
-    return pService;
-}
 
-/*
+    /*
     MDNSResponder::_releaseService
 */
-bool MDNSResponder::_releaseService(MDNSResponder::stcMDNSService* p_pService)
-{
-
-    bool    bResult = false;
-
-    if (p_pService)
+    bool MDNSResponder::_releaseService(MDNSResponder::stcMDNSService* p_pService)
     {
-        stcMDNSService* pPred = m_pServices;
-        while ((pPred) &&
-                (pPred->m_pNext != p_pService))
-        {
-            pPred = pPred->m_pNext;
-        }
-        if (pPred)
-        {
-            pPred->m_pNext = p_pService->m_pNext;
-            delete p_pService;
-            bResult = true;
-        }
-        else    // No predecessor
+        bool bResult = false;
+
+        if (p_pService)
         {
-            if (m_pServices == p_pService)
+            stcMDNSService* pPred = m_pServices;
+            while ((pPred) && (pPred->m_pNext != p_pService))
+            {
+                pPred = pPred->m_pNext;
+            }
+            if (pPred)
             {
-                m_pServices = p_pService->m_pNext;
+                pPred->m_pNext = p_pService->m_pNext;
                 delete p_pService;
                 bResult = true;
             }
-            else
+            else  // No predecessor
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.println("[MDNSResponder] _releaseService: INVALID service!"););
+                if (m_pServices == p_pService)
+                {
+                    m_pServices = p_pService->m_pNext;
+                    delete p_pService;
+                    bResult = true;
+                }
+                else
+                {
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.println("[MDNSResponder] _releaseService: INVALID service!"););
+                }
             }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_releaseServices
 */
-bool MDNSResponder::_releaseServices(void)
-{
-
-    stcMDNSService* pService = m_pServices;
-    while (pService)
+    bool MDNSResponder::_releaseServices(void)
     {
-        _releaseService(pService);
-        pService = m_pServices;
+        stcMDNSService* pService = m_pServices;
+        while (pService)
+        {
+            _releaseService(pService);
+            pService = m_pServices;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::_findService
 */
-MDNSResponder::stcMDNSService* MDNSResponder::_findService(const char* p_pcName,
-        const char* p_pcService,
-        const char* p_pcProtocol)
-{
-
-    stcMDNSService* pService = m_pServices;
-    while (pService)
+    MDNSResponder::stcMDNSService* MDNSResponder::_findService(const char* p_pcName,
+                                                               const char* p_pcService,
+                                                               const char* p_pcProtocol)
     {
-        if ((0 == strcmp(pService->m_pcName, p_pcName)) &&
-                (0 == strcmp(pService->m_pcService, p_pcService)) &&
-                (0 == strcmp(pService->m_pcProtocol, p_pcProtocol)))
+        stcMDNSService* pService = m_pServices;
+        while (pService)
         {
-
-            break;
+            if ((0 == strcmp(pService->m_pcName, p_pcName)) && (0 == strcmp(pService->m_pcService, p_pcService)) && (0 == strcmp(pService->m_pcProtocol, p_pcProtocol)))
+            {
+                break;
+            }
+            pService = pService->m_pNext;
         }
-        pService = pService->m_pNext;
+        return pService;
     }
-    return pService;
-}
 
-/*
+    /*
     MDNSResponder::_findService
 */
-MDNSResponder::stcMDNSService* MDNSResponder::_findService(const MDNSResponder::hMDNSService p_hService)
-{
-
-    stcMDNSService* pService = m_pServices;
-    while (pService)
+    MDNSResponder::stcMDNSService* MDNSResponder::_findService(const MDNSResponder::hMDNSService p_hService)
     {
-        if (p_hService == (hMDNSService)pService)
+        stcMDNSService* pService = m_pServices;
+        while (pService)
         {
-            break;
+            if (p_hService == (hMDNSService)pService)
+            {
+                break;
+            }
+            pService = pService->m_pNext;
         }
-        pService = pService->m_pNext;
+        return pService;
     }
-    return pService;
-}
 
-
-/*
+    /*
     SERVICE TXT
 */
 
-/*
+    /*
     MDNSResponder::_allocServiceTxt
 */
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_allocServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        const char* p_pcKey,
-        const char* p_pcValue,
-        bool p_bTemp)
-{
-
-    stcMDNSServiceTxt*  pTxt = 0;
-
-    if ((p_pService) &&
-            (p_pcKey) &&
-            (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() +
-                                           1 +                                 // Length byte
-                                           (p_pcKey ? strlen(p_pcKey) : 0) +
-                                           1 +                                 // '='
-                                           (p_pcValue ? strlen(p_pcValue) : 0))))
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_allocServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+                                                                      const char*                    p_pcKey,
+                                                                      const char*                    p_pcValue,
+                                                                      bool                           p_bTemp)
     {
+        stcMDNSServiceTxt* pTxt = 0;
 
-        pTxt = new stcMDNSServiceTxt;
-        if (pTxt)
+        if ((p_pService) && (p_pcKey) && (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() + 1 +      // Length byte
+                                                                        (p_pcKey ? strlen(p_pcKey) : 0) + 1 +  // '='
+                                                                        (p_pcValue ? strlen(p_pcValue) : 0))))
         {
-            size_t  stLength = (p_pcKey ? strlen(p_pcKey) : 0);
-            pTxt->m_pcKey = new char[stLength + 1];
-            if (pTxt->m_pcKey)
+            pTxt = new stcMDNSServiceTxt;
+            if (pTxt)
             {
-                strncpy(pTxt->m_pcKey, p_pcKey, stLength); pTxt->m_pcKey[stLength] = 0;
-            }
+                size_t stLength = (p_pcKey ? strlen(p_pcKey) : 0);
+                pTxt->m_pcKey   = new char[stLength + 1];
+                if (pTxt->m_pcKey)
+                {
+                    strncpy(pTxt->m_pcKey, p_pcKey, stLength);
+                    pTxt->m_pcKey[stLength] = 0;
+                }
 
-            if (p_pcValue)
-            {
-                stLength = (p_pcValue ? strlen(p_pcValue) : 0);
-                pTxt->m_pcValue = new char[stLength + 1];
-                if (pTxt->m_pcValue)
+                if (p_pcValue)
                 {
-                    strncpy(pTxt->m_pcValue, p_pcValue, stLength); pTxt->m_pcValue[stLength] = 0;
+                    stLength        = (p_pcValue ? strlen(p_pcValue) : 0);
+                    pTxt->m_pcValue = new char[stLength + 1];
+                    if (pTxt->m_pcValue)
+                    {
+                        strncpy(pTxt->m_pcValue, p_pcValue, stLength);
+                        pTxt->m_pcValue[stLength] = 0;
+                    }
                 }
-            }
-            pTxt->m_bTemp = p_bTemp;
+                pTxt->m_bTemp = p_bTemp;
 
-            // Add to list (or start list)
-            p_pService->m_Txts.add(pTxt);
+                // Add to list (or start list)
+                p_pService->m_Txts.add(pTxt);
+            }
         }
+        return pTxt;
     }
-    return pTxt;
-}
 
-/*
+    /*
     MDNSResponder::_releaseServiceTxt
 */
-bool MDNSResponder::_releaseServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                       MDNSResponder::stcMDNSServiceTxt* p_pTxt)
-{
-
-    return ((p_pService) &&
-            (p_pTxt) &&
-            (p_pService->m_Txts.remove(p_pTxt)));
-}
+    bool MDNSResponder::_releaseServiceTxt(MDNSResponder::stcMDNSService*    p_pService,
+                                           MDNSResponder::stcMDNSServiceTxt* p_pTxt)
+    {
+        return ((p_pService) && (p_pTxt) && (p_pService->m_Txts.remove(p_pTxt)));
+    }
 
-/*
+    /*
     MDNSResponder::_updateServiceTxt
 */
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_updateServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        MDNSResponder::stcMDNSServiceTxt* p_pTxt,
-        const char* p_pcValue,
-        bool p_bTemp)
-{
-
-    if ((p_pService) &&
-            (p_pTxt) &&
-            (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() -
-                                           (p_pTxt->m_pcValue ? strlen(p_pTxt->m_pcValue) : 0) +
-                                           (p_pcValue ? strlen(p_pcValue) : 0))))
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_updateServiceTxt(MDNSResponder::stcMDNSService*    p_pService,
+                                                                       MDNSResponder::stcMDNSServiceTxt* p_pTxt,
+                                                                       const char*                       p_pcValue,
+                                                                       bool                              p_bTemp)
     {
-        p_pTxt->update(p_pcValue);
-        p_pTxt->m_bTemp = p_bTemp;
+        if ((p_pService) && (p_pTxt) && (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() - (p_pTxt->m_pcValue ? strlen(p_pTxt->m_pcValue) : 0) + (p_pcValue ? strlen(p_pcValue) : 0))))
+        {
+            p_pTxt->update(p_pcValue);
+            p_pTxt->m_bTemp = p_bTemp;
+        }
+        return p_pTxt;
     }
-    return p_pTxt;
-}
 
-/*
+    /*
     MDNSResponder::_findServiceTxt
 */
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        const char* p_pcKey)
-{
-
-    return (p_pService ? p_pService->m_Txts.find(p_pcKey) : 0);
-}
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+                                                                     const char*                    p_pcKey)
+    {
+        return (p_pService ? p_pService->m_Txts.find(p_pcKey) : 0);
+    }
 
-/*
+    /*
     MDNSResponder::_findServiceTxt
 */
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        const hMDNSTxt p_hTxt)
-{
-
-    return (((p_pService) && (p_hTxt)) ? p_pService->m_Txts.find((stcMDNSServiceTxt*)p_hTxt) : 0);
-}
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+                                                                     const hMDNSTxt                 p_hTxt)
+    {
+        return (((p_pService) && (p_hTxt)) ? p_pService->m_Txts.find((stcMDNSServiceTxt*)p_hTxt) : 0);
+    }
 
-/*
+    /*
     MDNSResponder::_addServiceTxt
 */
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_addServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-        const char* p_pcKey,
-        const char* p_pcValue,
-        bool p_bTemp)
-{
-    stcMDNSServiceTxt*  pResult = 0;
-
-    if ((p_pService) &&
-            (p_pcKey) &&
-            (strlen(p_pcKey)))
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_addServiceTxt(MDNSResponder::stcMDNSService* p_pService,
+                                                                    const char*                    p_pcKey,
+                                                                    const char*                    p_pcValue,
+                                                                    bool                           p_bTemp)
     {
+        stcMDNSServiceTxt* pResult = 0;
 
-        stcMDNSServiceTxt*  pTxt = p_pService->m_Txts.find(p_pcKey);
-        if (pTxt)
-        {
-            pResult = _updateServiceTxt(p_pService, pTxt, p_pcValue, p_bTemp);
-        }
-        else
+        if ((p_pService) && (p_pcKey) && (strlen(p_pcKey)))
         {
-            pResult = _allocServiceTxt(p_pService, p_pcKey, p_pcValue, p_bTemp);
+            stcMDNSServiceTxt* pTxt = p_pService->m_Txts.find(p_pcKey);
+            if (pTxt)
+            {
+                pResult = _updateServiceTxt(p_pService, pTxt, p_pcValue, p_bTemp);
+            }
+            else
+            {
+                pResult = _allocServiceTxt(p_pService, p_pcKey, p_pcValue, p_bTemp);
+            }
         }
+        return pResult;
     }
-    return pResult;
-}
 
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
-        const uint32_t p_u32AnswerIndex)
-{
-    stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-    stcMDNSServiceQuery::stcAnswer* pSQAnswer = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-    // Fill m_pcTxts (if not already done)
-    return (pSQAnswer) ?  pSQAnswer->m_Txts.m_pTxts : 0;
-}
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
+                                                                     const uint32_t          p_u32AnswerIndex)
+    {
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        // Fill m_pcTxts (if not already done)
+        return (pSQAnswer) ? pSQAnswer->m_Txts.m_pTxts : 0;
+    }
 
-/*
+    /*
     MDNSResponder::_collectServiceTxts
 */
-bool MDNSResponder::_collectServiceTxts(MDNSResponder::stcMDNSService& p_rService)
-{
-
-    // Call Dynamic service callbacks
-    if (m_fnServiceTxtCallback)
-    {
-        m_fnServiceTxtCallback((hMDNSService)&p_rService);
-    }
-    if (p_rService.m_fnTxtCallback)
+    bool MDNSResponder::_collectServiceTxts(MDNSResponder::stcMDNSService& p_rService)
     {
-        p_rService.m_fnTxtCallback((hMDNSService)&p_rService);
+        // Call Dynamic service callbacks
+        if (m_fnServiceTxtCallback)
+        {
+            m_fnServiceTxtCallback((hMDNSService)&p_rService);
+        }
+        if (p_rService.m_fnTxtCallback)
+        {
+            p_rService.m_fnTxtCallback((hMDNSService)&p_rService);
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::_releaseTempServiceTxts
 */
-bool MDNSResponder::_releaseTempServiceTxts(MDNSResponder::stcMDNSService& p_rService)
-{
-
-    return (p_rService.m_Txts.removeTempTxts());
-}
-
+    bool MDNSResponder::_releaseTempServiceTxts(MDNSResponder::stcMDNSService& p_rService)
+    {
+        return (p_rService.m_Txts.removeTempTxts());
+    }
 
-/*
+    /*
     MISC
 */
 
 #ifdef DEBUG_ESP_MDNS_RESPONDER
-/*
+    /*
     MDNSResponder::_printRRDomain
 */
-bool MDNSResponder::_printRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_RRDomain) const
-{
-
-    //DEBUG_OUTPUT.printf_P(PSTR("Domain: "));
-
-    const char* pCursor = p_RRDomain.m_acName;
-    uint8_t     u8Length = *pCursor++;
-    if (u8Length)
+    bool MDNSResponder::_printRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_RRDomain) const
     {
-        while (u8Length)
+        //DEBUG_OUTPUT.printf_P(PSTR("Domain: "));
+
+        const char* pCursor  = p_RRDomain.m_acName;
+        uint8_t     u8Length = *pCursor++;
+        if (u8Length)
         {
-            for (uint8_t u = 0; u < u8Length; ++u)
+            while (u8Length)
             {
-                DEBUG_OUTPUT.printf_P(PSTR("%c"), *(pCursor++));
-            }
-            u8Length = *pCursor++;
-            if (u8Length)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("."));
+                for (uint8_t u = 0; u < u8Length; ++u)
+                {
+                    DEBUG_OUTPUT.printf_P(PSTR("%c"), *(pCursor++));
+                }
+                u8Length = *pCursor++;
+                if (u8Length)
+                {
+                    DEBUG_OUTPUT.printf_P(PSTR("."));
+                }
             }
         }
-    }
-    else    // empty domain
-    {
-        DEBUG_OUTPUT.printf_P(PSTR("-empty-"));
-    }
-    //DEBUG_OUTPUT.printf_P(PSTR("\n"));
+        else  // empty domain
+        {
+            DEBUG_OUTPUT.printf_P(PSTR("-empty-"));
+        }
+        //DEBUG_OUTPUT.printf_P(PSTR("\n"));
 
-    return true;
-}
+        return true;
+    }
 
-/*
+    /*
     MDNSResponder::_printRRAnswer
 */
-bool MDNSResponder::_printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAnswer) const
-{
-
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] RRAnswer: "));
-    _printRRDomain(p_RRAnswer.m_Header.m_Domain);
-    DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, "), p_RRAnswer.m_Header.m_Attributes.m_u16Type, p_RRAnswer.m_Header.m_Attributes.m_u16Class, p_RRAnswer.m_u32TTL);
-    switch (p_RRAnswer.m_Header.m_Attributes.m_u16Type & (~0x8000))     // Topmost bit might carry 'cache flush' flag
+    bool MDNSResponder::_printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAnswer) const
     {
+        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] RRAnswer: "));
+        _printRRDomain(p_RRAnswer.m_Header.m_Domain);
+        DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, "), p_RRAnswer.m_Header.m_Attributes.m_u16Type, p_RRAnswer.m_Header.m_Attributes.m_u16Class, p_RRAnswer.m_u32TTL);
+        switch (p_RRAnswer.m_Header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
+        {
 #ifdef MDNS_IP4_SUPPORT
-    case DNS_RRTYPE_A:
-        DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((const stcMDNS_RRAnswerA*)&p_RRAnswer)->m_IPAddress.toString().c_str());
-        break;
+        case DNS_RRTYPE_A:
+            DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((const stcMDNS_RRAnswerA*)&p_RRAnswer)->m_IPAddress.toString().c_str());
+            break;
 #endif
-    case DNS_RRTYPE_PTR:
-        DEBUG_OUTPUT.printf_P(PSTR("PTR "));
-        _printRRDomain(((const stcMDNS_RRAnswerPTR*)&p_RRAnswer)->m_PTRDomain);
-        break;
-    case DNS_RRTYPE_TXT:
-    {
-        size_t  stTxtLength = ((const stcMDNS_RRAnswerTXT*)&p_RRAnswer)->m_Txts.c_strLength();
-        char*   pTxts = new char[stTxtLength];
-        if (pTxts)
+        case DNS_RRTYPE_PTR:
+            DEBUG_OUTPUT.printf_P(PSTR("PTR "));
+            _printRRDomain(((const stcMDNS_RRAnswerPTR*)&p_RRAnswer)->m_PTRDomain);
+            break;
+        case DNS_RRTYPE_TXT:
         {
-            ((/*const c_str()!!*/stcMDNS_RRAnswerTXT*)&p_RRAnswer)->m_Txts.c_str(pTxts);
-            DEBUG_OUTPUT.printf_P(PSTR("TXT(%zu) %s"), stTxtLength, pTxts);
-            delete[] pTxts;
+            size_t stTxtLength = ((const stcMDNS_RRAnswerTXT*)&p_RRAnswer)->m_Txts.c_strLength();
+            char*  pTxts       = new char[stTxtLength];
+            if (pTxts)
+            {
+                ((/*const c_str()!!*/ stcMDNS_RRAnswerTXT*)&p_RRAnswer)->m_Txts.c_str(pTxts);
+                DEBUG_OUTPUT.printf_P(PSTR("TXT(%zu) %s"), stTxtLength, pTxts);
+                delete[] pTxts;
+            }
+            break;
         }
-        break;
-    }
 #ifdef MDNS_IP6_SUPPORT
-    case DNS_RRTYPE_AAAA:
-        DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
-        break;
+        case DNS_RRTYPE_AAAA:
+            DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
+            break;
 #endif
-    case DNS_RRTYPE_SRV:
-        DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_u16Port);
-        _printRRDomain(((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_SRVDomain);
-        break;
-    default:
-        DEBUG_OUTPUT.printf_P(PSTR("generic "));
-        break;
-    }
-    DEBUG_OUTPUT.printf_P(PSTR("\n"));
+        case DNS_RRTYPE_SRV:
+            DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_u16Port);
+            _printRRDomain(((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_SRVDomain);
+            break;
+        default:
+            DEBUG_OUTPUT.printf_P(PSTR("generic "));
+            break;
+        }
+        DEBUG_OUTPUT.printf_P(PSTR("\n"));
 
-    return true;
-}
+        return true;
+    }
 #endif
 
-}   // namespace MDNSImplementation
-
-} // namespace esp8266
-
-
-
+}  // namespace MDNSImplementation
 
+}  // namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h b/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
index 49fc5bb608..f57e48f0c5 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
@@ -27,17 +27,15 @@
 
 namespace esp8266
 {
-
 /*
     LEAmDNS
 */
 
 namespace MDNSImplementation
 {
-
 // Enable class debug functions
 #define ESP_8266_MDNS_INCLUDE
-//#define DEBUG_ESP_MDNS_RESPONDER
+    //#define DEBUG_ESP_MDNS_RESPONDER
 
 #if !defined(DEBUG_ESP_MDNS_RESPONDER) && defined(DEBUG_ESP_MDNS)
 #define DEBUG_ESP_MDNS_RESPONDER
@@ -62,7 +60,7 @@ namespace MDNSImplementation
 
 #ifdef DEBUG_ESP_MDNS_RESPONDER
 #ifdef DEBUG_ESP_MDNS_INFO
-#define DEBUG_EX_INFO(A)    A
+#define DEBUG_EX_INFO(A) A
 #else
 #define DEBUG_EX_INFO(A)
 #endif
@@ -72,12 +70,12 @@ namespace MDNSImplementation
 #define DEBUG_EX_ERR(A)
 #endif
 #ifdef DEBUG_ESP_MDNS_TX
-#define DEBUG_EX_TX(A)  A
+#define DEBUG_EX_TX(A) A
 #else
 #define DEBUG_EX_TX(A)
 #endif
 #ifdef DEBUG_ESP_MDNS_RX
-#define DEBUG_EX_RX(A)  A
+#define DEBUG_EX_RX(A) A
 #else
 #define DEBUG_EX_RX(A)
 #endif
@@ -88,10 +86,26 @@ namespace MDNSImplementation
 #define DEBUG_OUTPUT Serial
 #endif
 #else
-#define DEBUG_EX_INFO(A)    do { (void)0; } while (0)
-#define DEBUG_EX_ERR(A)     do { (void)0; } while (0)
-#define DEBUG_EX_TX(A)      do { (void)0; } while (0)
-#define DEBUG_EX_RX(A)      do { (void)0; } while (0)
+#define DEBUG_EX_INFO(A) \
+    do                   \
+    {                    \
+        (void)0;         \
+    } while (0)
+#define DEBUG_EX_ERR(A) \
+    do                  \
+    {                   \
+        (void)0;        \
+    } while (0)
+#define DEBUG_EX_TX(A) \
+    do                 \
+    {                  \
+        (void)0;       \
+    } while (0)
+#define DEBUG_EX_RX(A) \
+    do                 \
+    {                  \
+        (void)0;       \
+    } while (0)
 #endif
 
 /*  already defined in lwIP ('lwip/prot/dns.h')
@@ -111,44 +125,43 @@ namespace MDNSImplementation
 
     However, RFC 3171 seems to force 255 instead
 */
-#define MDNS_MULTICAST_TTL              255/*1*/
+#define MDNS_MULTICAST_TTL 255 /*1*/
 
 /*
     This is the MDNS record TTL
     Host level records are set to 2min (120s)
     service level records are set to 75min (4500s)
 */
-#define MDNS_HOST_TTL                   120
-#define MDNS_SERVICE_TTL                4500
+#define MDNS_HOST_TTL 120
+#define MDNS_SERVICE_TTL 4500
 
 /*
     Compressed labels are flagged by the two topmost bits of the length byte being set
 */
-#define MDNS_DOMAIN_COMPRESS_MARK       0xC0
+#define MDNS_DOMAIN_COMPRESS_MARK 0xC0
 /*
     Avoid endless recursion because of malformed compressed labels
 */
-#define MDNS_DOMAIN_MAX_REDIRCTION      6
+#define MDNS_DOMAIN_MAX_REDIRCTION 6
 
 /*
     Default service priority and weight in SRV answers
 */
-#define MDNS_SRV_PRIORITY               0
-#define MDNS_SRV_WEIGHT                 0
+#define MDNS_SRV_PRIORITY 0
+#define MDNS_SRV_WEIGHT 0
 
 /*
     Delay between and number of probes for host and service domains
     Delay between and number of announces for host and service domains
     Delay between and number of service queries; the delay is multiplied by the resent number in '_checkServiceQueryCache'
 */
-#define MDNS_PROBE_DELAY                250
-#define MDNS_PROBE_COUNT                3
-#define MDNS_ANNOUNCE_DELAY             1000
-#define MDNS_ANNOUNCE_COUNT             8
+#define MDNS_PROBE_DELAY 250
+#define MDNS_PROBE_COUNT 3
+#define MDNS_ANNOUNCE_DELAY 1000
+#define MDNS_ANNOUNCE_COUNT 8
 #define MDNS_DYNAMIC_QUERY_RESEND_COUNT 5
 #define MDNS_DYNAMIC_QUERY_RESEND_DELAY 5000
 
-
 /*
     Force host domain to use only lowercase letters
 */
@@ -167,15 +180,14 @@ namespace MDNSImplementation
 #ifdef F
 #undef F
 #endif
-#define F(A)    A
+#define F(A) A
 #endif
 
-}   // namespace MDNSImplementation
+}  // namespace MDNSImplementation
 
-} // namespace esp8266
+}  // namespace esp8266
 
 // Include the main header, so the submodlues only need to include this header
 #include "LEAmDNS.h"
 
-
 #endif  // MDNS_PRIV_H
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
index 786287457d..d569223f2f 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
@@ -28,18 +28,16 @@
 
 namespace esp8266
 {
-
 /*
     LEAmDNS
 */
 namespace MDNSImplementation
 {
-
-/**
+    /**
     STRUCTS
 */
 
-/**
+    /**
     MDNSResponder::stcMDNSServiceTxt
 
     One MDNS TXT item.
@@ -49,233 +47,215 @@ namespace MDNSImplementation
     Output as byte array 'c#=1' is supported.
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt constructor
 */
-MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const char* p_pcKey /*= 0*/,
-        const char* p_pcValue /*= 0*/,
-        bool p_bTemp /*= false*/)
-    :   m_pNext(0),
+    MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const char* p_pcKey /*= 0*/,
+                                                        const char* p_pcValue /*= 0*/,
+                                                        bool        p_bTemp /*= false*/) :
+        m_pNext(0),
         m_pcKey(0),
         m_pcValue(0),
         m_bTemp(p_bTemp)
-{
-
-    setKey(p_pcKey);
-    setValue(p_pcValue);
-}
+    {
+        setKey(p_pcKey);
+        setValue(p_pcValue);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt copy-constructor
 */
-MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const MDNSResponder::stcMDNSServiceTxt& p_Other)
-    :   m_pNext(0),
+    MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const MDNSResponder::stcMDNSServiceTxt& p_Other) :
+        m_pNext(0),
         m_pcKey(0),
         m_pcValue(0),
         m_bTemp(false)
-{
-
-    operator=(p_Other);
-}
+    {
+        operator=(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt destructor
 */
-MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt(void)
-{
-
-    clear();
-}
+    MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::operator=
 */
-MDNSResponder::stcMDNSServiceTxt& MDNSResponder::stcMDNSServiceTxt::operator=(const MDNSResponder::stcMDNSServiceTxt& p_Other)
-{
-
-    if (&p_Other != this)
+    MDNSResponder::stcMDNSServiceTxt& MDNSResponder::stcMDNSServiceTxt::operator=(const MDNSResponder::stcMDNSServiceTxt& p_Other)
     {
-        clear();
-        set(p_Other.m_pcKey, p_Other.m_pcValue, p_Other.m_bTemp);
+        if (&p_Other != this)
+        {
+            clear();
+            set(p_Other.m_pcKey, p_Other.m_pcValue, p_Other.m_bTemp);
+        }
+        return *this;
     }
-    return *this;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::clear
 */
-bool MDNSResponder::stcMDNSServiceTxt::clear(void)
-{
-
-    releaseKey();
-    releaseValue();
-    return true;
-}
+    bool MDNSResponder::stcMDNSServiceTxt::clear(void)
+    {
+        releaseKey();
+        releaseValue();
+        return true;
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::allocKey
 */
-char* MDNSResponder::stcMDNSServiceTxt::allocKey(size_t p_stLength)
-{
-
-    releaseKey();
-    if (p_stLength)
+    char* MDNSResponder::stcMDNSServiceTxt::allocKey(size_t p_stLength)
     {
-        m_pcKey = new char[p_stLength + 1];
+        releaseKey();
+        if (p_stLength)
+        {
+            m_pcKey = new char[p_stLength + 1];
+        }
+        return m_pcKey;
     }
-    return m_pcKey;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::setKey
 */
-bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey,
-        size_t p_stLength)
-{
-
-    bool bResult = false;
-
-    releaseKey();
-    if (p_stLength)
+    bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey,
+                                                  size_t      p_stLength)
     {
-        if (allocKey(p_stLength))
+        bool bResult = false;
+
+        releaseKey();
+        if (p_stLength)
         {
-            strncpy(m_pcKey, p_pcKey, p_stLength);
-            m_pcKey[p_stLength] = 0;
-            bResult = true;
+            if (allocKey(p_stLength))
+            {
+                strncpy(m_pcKey, p_pcKey, p_stLength);
+                m_pcKey[p_stLength] = 0;
+                bResult             = true;
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::setKey
 */
-bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey)
-{
-
-    return setKey(p_pcKey, (p_pcKey ? strlen(p_pcKey) : 0));
-}
+    bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey)
+    {
+        return setKey(p_pcKey, (p_pcKey ? strlen(p_pcKey) : 0));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::releaseKey
 */
-bool MDNSResponder::stcMDNSServiceTxt::releaseKey(void)
-{
-
-    if (m_pcKey)
+    bool MDNSResponder::stcMDNSServiceTxt::releaseKey(void)
     {
-        delete[] m_pcKey;
-        m_pcKey = 0;
+        if (m_pcKey)
+        {
+            delete[] m_pcKey;
+            m_pcKey = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::allocValue
 */
-char* MDNSResponder::stcMDNSServiceTxt::allocValue(size_t p_stLength)
-{
-
-    releaseValue();
-    if (p_stLength)
+    char* MDNSResponder::stcMDNSServiceTxt::allocValue(size_t p_stLength)
     {
-        m_pcValue = new char[p_stLength + 1];
+        releaseValue();
+        if (p_stLength)
+        {
+            m_pcValue = new char[p_stLength + 1];
+        }
+        return m_pcValue;
     }
-    return m_pcValue;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::setValue
 */
-bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue,
-        size_t p_stLength)
-{
-
-    bool bResult = false;
-
-    releaseValue();
-    if (p_stLength)
+    bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue,
+                                                    size_t      p_stLength)
     {
-        if (allocValue(p_stLength))
+        bool bResult = false;
+
+        releaseValue();
+        if (p_stLength)
+        {
+            if (allocValue(p_stLength))
+            {
+                strncpy(m_pcValue, p_pcValue, p_stLength);
+                m_pcValue[p_stLength] = 0;
+                bResult               = true;
+            }
+        }
+        else  // No value -> also OK
         {
-            strncpy(m_pcValue, p_pcValue, p_stLength);
-            m_pcValue[p_stLength] = 0;
             bResult = true;
         }
+        return bResult;
     }
-    else    // No value -> also OK
-    {
-        bResult = true;
-    }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::setValue
 */
-bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue)
-{
-
-    return setValue(p_pcValue, (p_pcValue ? strlen(p_pcValue) : 0));
-}
+    bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue)
+    {
+        return setValue(p_pcValue, (p_pcValue ? strlen(p_pcValue) : 0));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::releaseValue
 */
-bool MDNSResponder::stcMDNSServiceTxt::releaseValue(void)
-{
-
-    if (m_pcValue)
+    bool MDNSResponder::stcMDNSServiceTxt::releaseValue(void)
     {
-        delete[] m_pcValue;
-        m_pcValue = 0;
+        if (m_pcValue)
+        {
+            delete[] m_pcValue;
+            m_pcValue = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::set
 */
-bool MDNSResponder::stcMDNSServiceTxt::set(const char* p_pcKey,
-        const char* p_pcValue,
-        bool p_bTemp /*= false*/)
-{
-
-    m_bTemp = p_bTemp;
-    return ((setKey(p_pcKey)) &&
-            (setValue(p_pcValue)));
-}
+    bool MDNSResponder::stcMDNSServiceTxt::set(const char* p_pcKey,
+                                               const char* p_pcValue,
+                                               bool        p_bTemp /*= false*/)
+    {
+        m_bTemp = p_bTemp;
+        return ((setKey(p_pcKey)) && (setValue(p_pcValue)));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::update
 */
-bool MDNSResponder::stcMDNSServiceTxt::update(const char* p_pcValue)
-{
-
-    return setValue(p_pcValue);
-}
+    bool MDNSResponder::stcMDNSServiceTxt::update(const char* p_pcValue)
+    {
+        return setValue(p_pcValue);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxt::length
 
     length of eg. 'c#=1' without any closing '\0'
 */
-size_t MDNSResponder::stcMDNSServiceTxt::length(void) const
-{
-
-    size_t  stLength = 0;
-    if (m_pcKey)
+    size_t MDNSResponder::stcMDNSServiceTxt::length(void) const
     {
-        stLength += strlen(m_pcKey);                     // Key
-        stLength += 1;                                      // '='
-        stLength += (m_pcValue ? strlen(m_pcValue) : 0); // Value
+        size_t stLength = 0;
+        if (m_pcKey)
+        {
+            stLength += strlen(m_pcKey);                      // Key
+            stLength += 1;                                    // '='
+            stLength += (m_pcValue ? strlen(m_pcValue) : 0);  // Value
+        }
+        return stLength;
     }
-    return stLength;
-}
 
-
-/**
+    /**
     MDNSResponder::stcMDNSServiceTxts
 
     A list of zero or more MDNS TXT items.
@@ -287,397 +267,364 @@ size_t MDNSResponder::stcMDNSServiceTxt::length(void) const
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts constructor
 */
-MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(void)
-    :   m_pTxts(0)
-{
-
-}
+    MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(void) :
+        m_pTxts(0)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts copy-constructor
 */
-MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other)
-    :   m_pTxts(0)
-{
-
-    operator=(p_Other);
-}
+    MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other) :
+        m_pTxts(0)
+    {
+        operator=(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts destructor
 */
-MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts(void)
-{
-
-    clear();
-}
+    MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::operator=
 */
-MDNSResponder::stcMDNSServiceTxts& MDNSResponder::stcMDNSServiceTxts::operator=(const stcMDNSServiceTxts& p_Other)
-{
-
-    if (this != &p_Other)
+    MDNSResponder::stcMDNSServiceTxts& MDNSResponder::stcMDNSServiceTxts::operator=(const stcMDNSServiceTxts& p_Other)
     {
-        clear();
-
-        for (stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; pOtherTxt; pOtherTxt = pOtherTxt->m_pNext)
+        if (this != &p_Other)
         {
-            add(new stcMDNSServiceTxt(*pOtherTxt));
+            clear();
+
+            for (stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; pOtherTxt; pOtherTxt = pOtherTxt->m_pNext)
+            {
+                add(new stcMDNSServiceTxt(*pOtherTxt));
+            }
         }
+        return *this;
     }
-    return *this;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::clear
 */
-bool MDNSResponder::stcMDNSServiceTxts::clear(void)
-{
-
-    while (m_pTxts)
+    bool MDNSResponder::stcMDNSServiceTxts::clear(void)
     {
-        stcMDNSServiceTxt* pNext = m_pTxts->m_pNext;
-        delete m_pTxts;
-        m_pTxts = pNext;
+        while (m_pTxts)
+        {
+            stcMDNSServiceTxt* pNext = m_pTxts->m_pNext;
+            delete m_pTxts;
+            m_pTxts = pNext;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::add
 */
-bool MDNSResponder::stcMDNSServiceTxts::add(MDNSResponder::stcMDNSServiceTxt* p_pTxt)
-{
-
-    bool bResult = false;
-
-    if (p_pTxt)
+    bool MDNSResponder::stcMDNSServiceTxts::add(MDNSResponder::stcMDNSServiceTxt* p_pTxt)
     {
-        p_pTxt->m_pNext = m_pTxts;
-        m_pTxts = p_pTxt;
-        bResult = true;
+        bool bResult = false;
+
+        if (p_pTxt)
+        {
+            p_pTxt->m_pNext = m_pTxts;
+            m_pTxts         = p_pTxt;
+            bResult         = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::remove
 */
-bool MDNSResponder::stcMDNSServiceTxts::remove(stcMDNSServiceTxt* p_pTxt)
-{
-
-    bool    bResult = false;
-
-    if (p_pTxt)
+    bool MDNSResponder::stcMDNSServiceTxts::remove(stcMDNSServiceTxt* p_pTxt)
     {
-        stcMDNSServiceTxt*  pPred = m_pTxts;
-        while ((pPred) &&
-                (pPred->m_pNext != p_pTxt))
-        {
-            pPred = pPred->m_pNext;
-        }
-        if (pPred)
-        {
-            pPred->m_pNext = p_pTxt->m_pNext;
-            delete p_pTxt;
-            bResult = true;
-        }
-        else if (m_pTxts == p_pTxt)     // No predecessor, but first item
+        bool bResult = false;
+
+        if (p_pTxt)
         {
-            m_pTxts = p_pTxt->m_pNext;
-            delete p_pTxt;
-            bResult = true;
+            stcMDNSServiceTxt* pPred = m_pTxts;
+            while ((pPred) && (pPred->m_pNext != p_pTxt))
+            {
+                pPred = pPred->m_pNext;
+            }
+            if (pPred)
+            {
+                pPred->m_pNext = p_pTxt->m_pNext;
+                delete p_pTxt;
+                bResult = true;
+            }
+            else if (m_pTxts == p_pTxt)  // No predecessor, but first item
+            {
+                m_pTxts = p_pTxt->m_pNext;
+                delete p_pTxt;
+                bResult = true;
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::removeTempTxts
 */
-bool MDNSResponder::stcMDNSServiceTxts::removeTempTxts(void)
-{
-
-    bool    bResult = true;
-
-    stcMDNSServiceTxt*  pTxt = m_pTxts;
-    while ((bResult) &&
-            (pTxt))
+    bool MDNSResponder::stcMDNSServiceTxts::removeTempTxts(void)
     {
-        stcMDNSServiceTxt*  pNext = pTxt->m_pNext;
-        if (pTxt->m_bTemp)
+        bool bResult = true;
+
+        stcMDNSServiceTxt* pTxt = m_pTxts;
+        while ((bResult) && (pTxt))
         {
-            bResult = remove(pTxt);
+            stcMDNSServiceTxt* pNext = pTxt->m_pNext;
+            if (pTxt->m_bTemp)
+            {
+                bResult = remove(pTxt);
+            }
+            pTxt = pNext;
         }
-        pTxt = pNext;
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::find
 */
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey)
-{
-
-    stcMDNSServiceTxt* pResult = 0;
-
-    for (stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey)
     {
-        if ((p_pcKey) &&
-                (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
+        stcMDNSServiceTxt* pResult = 0;
+
+        for (stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
         {
-            pResult = pTxt;
-            break;
+            if ((p_pcKey) && (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
+            {
+                pResult = pTxt;
+                break;
+            }
         }
+        return pResult;
     }
-    return pResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::find
 */
-const MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey) const
-{
-
-    const stcMDNSServiceTxt*   pResult = 0;
-
-    for (const stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
+    const MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey) const
     {
-        if ((p_pcKey) &&
-                (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
-        {
+        const stcMDNSServiceTxt* pResult = 0;
 
-            pResult = pTxt;
-            break;
+        for (const stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
+        {
+            if ((p_pcKey) && (0 == strcmp(pTxt->m_pcKey, p_pcKey)))
+            {
+                pResult = pTxt;
+                break;
+            }
         }
+        return pResult;
     }
-    return pResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::find
 */
-MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const stcMDNSServiceTxt* p_pTxt)
-{
-
-    stcMDNSServiceTxt* pResult = 0;
-
-    for (stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
+    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const stcMDNSServiceTxt* p_pTxt)
     {
-        if (p_pTxt == pTxt)
+        stcMDNSServiceTxt* pResult = 0;
+
+        for (stcMDNSServiceTxt* pTxt = m_pTxts; pTxt; pTxt = pTxt->m_pNext)
         {
-            pResult = pTxt;
-            break;
+            if (p_pTxt == pTxt)
+            {
+                pResult = pTxt;
+                break;
+            }
         }
+        return pResult;
     }
-    return pResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::length
 */
-uint16_t MDNSResponder::stcMDNSServiceTxts::length(void) const
-{
-
-    uint16_t    u16Length = 0;
-
-    stcMDNSServiceTxt*  pTxt = m_pTxts;
-    while (pTxt)
+    uint16_t MDNSResponder::stcMDNSServiceTxts::length(void) const
     {
-        u16Length += 1;                 // Length byte
-        u16Length += pTxt->length();    // Text
-        pTxt = pTxt->m_pNext;
+        uint16_t u16Length = 0;
+
+        stcMDNSServiceTxt* pTxt = m_pTxts;
+        while (pTxt)
+        {
+            u16Length += 1;               // Length byte
+            u16Length += pTxt->length();  // Text
+            pTxt = pTxt->m_pNext;
+        }
+        return u16Length;
     }
-    return u16Length;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::c_strLength
 
     (incl. closing '\0'). Length bytes place is used for delimiting ';' and closing '\0'
 */
-size_t MDNSResponder::stcMDNSServiceTxts::c_strLength(void) const
-{
-
-    return length();
-}
+    size_t MDNSResponder::stcMDNSServiceTxts::c_strLength(void) const
+    {
+        return length();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::c_str
 */
-bool MDNSResponder::stcMDNSServiceTxts::c_str(char* p_pcBuffer)
-{
-
-    bool bResult = false;
-
-    if (p_pcBuffer)
+    bool MDNSResponder::stcMDNSServiceTxts::c_str(char* p_pcBuffer)
     {
-        bResult = true;
+        bool bResult = false;
 
-        *p_pcBuffer = 0;
-        for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
+        if (p_pcBuffer)
         {
-            size_t  stLength;
-            if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0)))))
+            bResult = true;
+
+            *p_pcBuffer = 0;
+            for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
             {
-                if (pTxt != m_pTxts)
-                {
-                    *p_pcBuffer++ = ';';
-                }
-                strncpy(p_pcBuffer, pTxt->m_pcKey, stLength); p_pcBuffer[stLength] = 0;
-                p_pcBuffer += stLength;
-                *p_pcBuffer++ = '=';
-                if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0)))
+                size_t stLength;
+                if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0)))))
                 {
-                    strncpy(p_pcBuffer, pTxt->m_pcValue, stLength); p_pcBuffer[stLength] = 0;
+                    if (pTxt != m_pTxts)
+                    {
+                        *p_pcBuffer++ = ';';
+                    }
+                    strncpy(p_pcBuffer, pTxt->m_pcKey, stLength);
+                    p_pcBuffer[stLength] = 0;
                     p_pcBuffer += stLength;
+                    *p_pcBuffer++ = '=';
+                    if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0)))
+                    {
+                        strncpy(p_pcBuffer, pTxt->m_pcValue, stLength);
+                        p_pcBuffer[stLength] = 0;
+                        p_pcBuffer += stLength;
+                    }
                 }
             }
+            *p_pcBuffer++ = 0;
         }
-        *p_pcBuffer++ = 0;
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::bufferLength
 
     (incl. closing '\0').
 */
-size_t MDNSResponder::stcMDNSServiceTxts::bufferLength(void) const
-{
-
-    return (length() + 1);
-}
+    size_t MDNSResponder::stcMDNSServiceTxts::bufferLength(void) const
+    {
+        return (length() + 1);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::toBuffer
 */
-bool MDNSResponder::stcMDNSServiceTxts::buffer(char* p_pcBuffer)
-{
-
-    bool bResult = false;
-
-    if (p_pcBuffer)
+    bool MDNSResponder::stcMDNSServiceTxts::buffer(char* p_pcBuffer)
     {
-        bResult = true;
+        bool bResult = false;
 
-        *p_pcBuffer = 0;
-        for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
+        if (p_pcBuffer)
         {
-            *(unsigned char*)p_pcBuffer++ = pTxt->length();
-            size_t  stLength;
-            if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0)))))
+            bResult = true;
+
+            *p_pcBuffer = 0;
+            for (stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
             {
-                memcpy(p_pcBuffer, pTxt->m_pcKey, stLength);
-                p_pcBuffer += stLength;
-                *p_pcBuffer++ = '=';
-                if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0)))
+                *(unsigned char*)p_pcBuffer++ = pTxt->length();
+                size_t stLength;
+                if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0)))))
                 {
-                    memcpy(p_pcBuffer, pTxt->m_pcValue, stLength);
+                    memcpy(p_pcBuffer, pTxt->m_pcKey, stLength);
                     p_pcBuffer += stLength;
+                    *p_pcBuffer++ = '=';
+                    if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0)))
+                    {
+                        memcpy(p_pcBuffer, pTxt->m_pcValue, stLength);
+                        p_pcBuffer += stLength;
+                    }
                 }
             }
+            *p_pcBuffer++ = 0;
         }
-        *p_pcBuffer++ = 0;
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::compare
 */
-bool MDNSResponder::stcMDNSServiceTxts::compare(const MDNSResponder::stcMDNSServiceTxts& p_Other) const
-{
-
-    bool    bResult = false;
-
-    if ((bResult = (length() == p_Other.length())))
+    bool MDNSResponder::stcMDNSServiceTxts::compare(const MDNSResponder::stcMDNSServiceTxts& p_Other) const
     {
-        // Compare A->B
-        for (const stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
-        {
-            const stcMDNSServiceTxt*    pOtherTxt = p_Other.find(pTxt->m_pcKey);
-            bResult = ((pOtherTxt) &&
-                       (pTxt->m_pcValue) &&
-                       (pOtherTxt->m_pcValue) &&
-                       (strlen(pTxt->m_pcValue) == strlen(pOtherTxt->m_pcValue)) &&
-                       (0 == strcmp(pTxt->m_pcValue, pOtherTxt->m_pcValue)));
-        }
-        // Compare B->A
-        for (const stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; ((bResult) && (pOtherTxt)); pOtherTxt = pOtherTxt->m_pNext)
+        bool bResult = false;
+
+        if ((bResult = (length() == p_Other.length())))
         {
-            const stcMDNSServiceTxt*    pTxt = find(pOtherTxt->m_pcKey);
-            bResult = ((pTxt) &&
-                       (pOtherTxt->m_pcValue) &&
-                       (pTxt->m_pcValue) &&
-                       (strlen(pOtherTxt->m_pcValue) == strlen(pTxt->m_pcValue)) &&
-                       (0 == strcmp(pOtherTxt->m_pcValue, pTxt->m_pcValue)));
+            // Compare A->B
+            for (const stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
+            {
+                const stcMDNSServiceTxt* pOtherTxt = p_Other.find(pTxt->m_pcKey);
+                bResult                            = ((pOtherTxt) && (pTxt->m_pcValue) && (pOtherTxt->m_pcValue) && (strlen(pTxt->m_pcValue) == strlen(pOtherTxt->m_pcValue)) && (0 == strcmp(pTxt->m_pcValue, pOtherTxt->m_pcValue)));
+            }
+            // Compare B->A
+            for (const stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; ((bResult) && (pOtherTxt)); pOtherTxt = pOtherTxt->m_pNext)
+            {
+                const stcMDNSServiceTxt* pTxt = find(pOtherTxt->m_pcKey);
+                bResult                       = ((pTxt) && (pOtherTxt->m_pcValue) && (pTxt->m_pcValue) && (strlen(pOtherTxt->m_pcValue) == strlen(pTxt->m_pcValue)) && (0 == strcmp(pOtherTxt->m_pcValue, pTxt->m_pcValue)));
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::operator==
 */
-bool MDNSResponder::stcMDNSServiceTxts::operator==(const stcMDNSServiceTxts& p_Other) const
-{
-
-    return compare(p_Other);
-}
+    bool MDNSResponder::stcMDNSServiceTxts::operator==(const stcMDNSServiceTxts& p_Other) const
+    {
+        return compare(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceTxts::operator!=
 */
-bool MDNSResponder::stcMDNSServiceTxts::operator!=(const stcMDNSServiceTxts& p_Other) const
-{
-
-    return !compare(p_Other);
-}
-
+    bool MDNSResponder::stcMDNSServiceTxts::operator!=(const stcMDNSServiceTxts& p_Other) const
+    {
+        return !compare(p_Other);
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_MsgHeader
 
     A MDNS message header.
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader
 */
-MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader(uint16_t p_u16ID /*= 0*/,
-        bool p_bQR /*= false*/,
-        unsigned char p_ucOpcode /*= 0*/,
-        bool p_bAA /*= false*/,
-        bool p_bTC /*= false*/,
-        bool p_bRD /*= false*/,
-        bool p_bRA /*= false*/,
-        unsigned char p_ucRCode /*= 0*/,
-        uint16_t p_u16QDCount /*= 0*/,
-        uint16_t p_u16ANCount /*= 0*/,
-        uint16_t p_u16NSCount /*= 0*/,
-        uint16_t p_u16ARCount /*= 0*/)
-    :   m_u16ID(p_u16ID),
+    MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader(uint16_t      p_u16ID /*= 0*/,
+                                                        bool          p_bQR /*= false*/,
+                                                        unsigned char p_ucOpcode /*= 0*/,
+                                                        bool          p_bAA /*= false*/,
+                                                        bool          p_bTC /*= false*/,
+                                                        bool          p_bRD /*= false*/,
+                                                        bool          p_bRA /*= false*/,
+                                                        unsigned char p_ucRCode /*= 0*/,
+                                                        uint16_t      p_u16QDCount /*= 0*/,
+                                                        uint16_t      p_u16ANCount /*= 0*/,
+                                                        uint16_t      p_u16NSCount /*= 0*/,
+                                                        uint16_t      p_u16ARCount /*= 0*/) :
+        m_u16ID(p_u16ID),
         m_1bQR(p_bQR), m_4bOpcode(p_ucOpcode), m_1bAA(p_bAA), m_1bTC(p_bTC), m_1bRD(p_bRD),
         m_1bRA(p_bRA), m_3bZ(0), m_4bRCode(p_ucRCode),
         m_u16QDCount(p_u16QDCount),
         m_u16ANCount(p_u16ANCount),
         m_u16NSCount(p_u16NSCount),
         m_u16ARCount(p_u16ARCount)
-{
-
-}
-
+    {
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRDomain
 
     A MDNS domain object.
@@ -690,297 +637,272 @@ MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader(uint16_t p_u16ID /*= 0*/,
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain constructor
 */
-MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(void)
-    :   m_u16NameLength(0)
-{
-
-    clear();
-}
+    MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(void) :
+        m_u16NameLength(0)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain copy-constructor
 */
-MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other)
-    :   m_u16NameLength(0)
-{
-
-    operator=(p_Other);
-}
+    MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other) :
+        m_u16NameLength(0)
+    {
+        operator=(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::operator =
 */
-MDNSResponder::stcMDNS_RRDomain& MDNSResponder::stcMDNS_RRDomain::operator=(const stcMDNS_RRDomain& p_Other)
-{
-
-    if (&p_Other != this)
+    MDNSResponder::stcMDNS_RRDomain& MDNSResponder::stcMDNS_RRDomain::operator=(const stcMDNS_RRDomain& p_Other)
     {
-        memcpy(m_acName, p_Other.m_acName, sizeof(m_acName));
-        m_u16NameLength = p_Other.m_u16NameLength;
+        if (&p_Other != this)
+        {
+            memcpy(m_acName, p_Other.m_acName, sizeof(m_acName));
+            m_u16NameLength = p_Other.m_u16NameLength;
+        }
+        return *this;
     }
-    return *this;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::clear
 */
-bool MDNSResponder::stcMDNS_RRDomain::clear(void)
-{
-
-    memset(m_acName, 0, sizeof(m_acName));
-    m_u16NameLength = 0;
-    return true;
-}
+    bool MDNSResponder::stcMDNS_RRDomain::clear(void)
+    {
+        memset(m_acName, 0, sizeof(m_acName));
+        m_u16NameLength = 0;
+        return true;
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::addLabel
 */
-bool MDNSResponder::stcMDNS_RRDomain::addLabel(const char* p_pcLabel,
-        bool p_bPrependUnderline /*= false*/)
-{
-
-    bool    bResult = false;
-
-    size_t  stLength = (p_pcLabel
-                        ? (strlen(p_pcLabel) + (p_bPrependUnderline ? 1 : 0))
-                        : 0);
-    if ((MDNS_DOMAIN_LABEL_MAXLENGTH >= stLength) &&
-            (MDNS_DOMAIN_MAXLENGTH >= (m_u16NameLength + (1 + stLength))))
+    bool MDNSResponder::stcMDNS_RRDomain::addLabel(const char* p_pcLabel,
+                                                   bool        p_bPrependUnderline /*= false*/)
     {
-        // Length byte
-        m_acName[m_u16NameLength] = (unsigned char)stLength;    // Might be 0!
-        ++m_u16NameLength;
-        // Label
-        if (stLength)
+        bool bResult = false;
+
+        size_t stLength = (p_pcLabel
+                               ? (strlen(p_pcLabel) + (p_bPrependUnderline ? 1 : 0))
+                               : 0);
+        if ((MDNS_DOMAIN_LABEL_MAXLENGTH >= stLength) && (MDNS_DOMAIN_MAXLENGTH >= (m_u16NameLength + (1 + stLength))))
         {
-            if (p_bPrependUnderline)
+            // Length byte
+            m_acName[m_u16NameLength] = (unsigned char)stLength;  // Might be 0!
+            ++m_u16NameLength;
+            // Label
+            if (stLength)
             {
-                m_acName[m_u16NameLength++] = '_';
-                --stLength;
+                if (p_bPrependUnderline)
+                {
+                    m_acName[m_u16NameLength++] = '_';
+                    --stLength;
+                }
+                strncpy(&(m_acName[m_u16NameLength]), p_pcLabel, stLength);
+                m_acName[m_u16NameLength + stLength] = 0;
+                m_u16NameLength += stLength;
             }
-            strncpy(&(m_acName[m_u16NameLength]), p_pcLabel, stLength); m_acName[m_u16NameLength + stLength] = 0;
-            m_u16NameLength += stLength;
+            bResult = true;
         }
-        bResult = true;
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::compare
 */
-bool MDNSResponder::stcMDNS_RRDomain::compare(const stcMDNS_RRDomain& p_Other) const
-{
-
-    bool    bResult = false;
-
-    if (m_u16NameLength == p_Other.m_u16NameLength)
+    bool MDNSResponder::stcMDNS_RRDomain::compare(const stcMDNS_RRDomain& p_Other) const
     {
-        const char* pT = m_acName;
-        const char* pO = p_Other.m_acName;
-        while ((pT) &&
-                (pO) &&
-                (*((unsigned char*)pT) == *((unsigned char*)pO)) &&                  // Same length AND
-                (0 == strncasecmp((pT + 1), (pO + 1), *((unsigned char*)pT))))     // Same content
+        bool bResult = false;
+
+        if (m_u16NameLength == p_Other.m_u16NameLength)
         {
-            if (*((unsigned char*)pT))              // Not 0
+            const char* pT = m_acName;
+            const char* pO = p_Other.m_acName;
+            while ((pT) && (pO) && (*((unsigned char*)pT) == *((unsigned char*)pO)) &&  // Same length AND
+                   (0 == strncasecmp((pT + 1), (pO + 1), *((unsigned char*)pT))))       // Same content
             {
-                pT += (1 + * ((unsigned char*)pT)); // Shift by length byte and length
-                pO += (1 + * ((unsigned char*)pO));
-            }
-            else                                    // Is 0 -> Successfully reached the end
-            {
-                bResult = true;
-                break;
+                if (*((unsigned char*)pT))  // Not 0
+                {
+                    pT += (1 + *((unsigned char*)pT));  // Shift by length byte and length
+                    pO += (1 + *((unsigned char*)pO));
+                }
+                else  // Is 0 -> Successfully reached the end
+                {
+                    bResult = true;
+                    break;
+                }
             }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::operator ==
 */
-bool MDNSResponder::stcMDNS_RRDomain::operator==(const stcMDNS_RRDomain& p_Other) const
-{
-
-    return compare(p_Other);
-}
+    bool MDNSResponder::stcMDNS_RRDomain::operator==(const stcMDNS_RRDomain& p_Other) const
+    {
+        return compare(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::operator !=
 */
-bool MDNSResponder::stcMDNS_RRDomain::operator!=(const stcMDNS_RRDomain& p_Other) const
-{
-
-    return !compare(p_Other);
-}
+    bool MDNSResponder::stcMDNS_RRDomain::operator!=(const stcMDNS_RRDomain& p_Other) const
+    {
+        return !compare(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRDomain::operator >
 */
-bool MDNSResponder::stcMDNS_RRDomain::operator>(const stcMDNS_RRDomain& p_Other) const
-{
-
-    // TODO: Check, if this is a good idea...
-    return !compare(p_Other);
-}
-
-/*
-    MDNSResponder::stcMDNS_RRDomain::c_strLength
-*/
-size_t MDNSResponder::stcMDNS_RRDomain::c_strLength(void) const
-{
-
-    size_t          stLength = 0;
-
-    unsigned char*  pucLabelLength = (unsigned char*)m_acName;
-    while (*pucLabelLength)
+    bool MDNSResponder::stcMDNS_RRDomain::operator>(const stcMDNS_RRDomain& p_Other) const
     {
-        stLength += (*pucLabelLength + 1 /* +1 for '.' or '\0'*/);
-        pucLabelLength += (*pucLabelLength + 1);
+        // TODO: Check, if this is a good idea...
+        return !compare(p_Other);
     }
-    return stLength;
-}
 
-/*
-    MDNSResponder::stcMDNS_RRDomain::c_str
+    /*
+    MDNSResponder::stcMDNS_RRDomain::c_strLength
 */
-bool MDNSResponder::stcMDNS_RRDomain::c_str(char* p_pcBuffer)
-{
-
-    bool bResult = false;
-
-    if (p_pcBuffer)
+    size_t MDNSResponder::stcMDNS_RRDomain::c_strLength(void) const
     {
-        *p_pcBuffer = 0;
+        size_t stLength = 0;
+
         unsigned char* pucLabelLength = (unsigned char*)m_acName;
         while (*pucLabelLength)
         {
-            memcpy(p_pcBuffer, (const char*)(pucLabelLength + 1), *pucLabelLength);
-            p_pcBuffer += *pucLabelLength;
+            stLength += (*pucLabelLength + 1 /* +1 for '.' or '\0'*/);
             pucLabelLength += (*pucLabelLength + 1);
-            *p_pcBuffer++ = (*pucLabelLength ? '.' : '\0');
         }
-        bResult = true;
+        return stLength;
     }
-    return bResult;
-}
 
+    /*
+    MDNSResponder::stcMDNS_RRDomain::c_str
+*/
+    bool MDNSResponder::stcMDNS_RRDomain::c_str(char* p_pcBuffer)
+    {
+        bool bResult = false;
+
+        if (p_pcBuffer)
+        {
+            *p_pcBuffer                   = 0;
+            unsigned char* pucLabelLength = (unsigned char*)m_acName;
+            while (*pucLabelLength)
+            {
+                memcpy(p_pcBuffer, (const char*)(pucLabelLength + 1), *pucLabelLength);
+                p_pcBuffer += *pucLabelLength;
+                pucLabelLength += (*pucLabelLength + 1);
+                *p_pcBuffer++ = (*pucLabelLength ? '.' : '\0');
+            }
+            bResult = true;
+        }
+        return bResult;
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRAttributes
 
     A MDNS attributes object.
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes constructor
 */
-MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(uint16_t p_u16Type /*= 0*/,
-        uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/)
-    :   m_u16Type(p_u16Type),
+    MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(uint16_t p_u16Type /*= 0*/,
+                                                              uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/) :
+        m_u16Type(p_u16Type),
         m_u16Class(p_u16Class)
-{
-
-}
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes copy-constructor
 */
-MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
-{
-
-    operator=(p_Other);
-}
+    MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
+    {
+        operator=(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAttributes::operator =
 */
-MDNSResponder::stcMDNS_RRAttributes& MDNSResponder::stcMDNS_RRAttributes::operator=(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
-{
-
-    if (&p_Other != this)
+    MDNSResponder::stcMDNS_RRAttributes& MDNSResponder::stcMDNS_RRAttributes::operator=(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
     {
-        m_u16Type = p_Other.m_u16Type;
-        m_u16Class = p_Other.m_u16Class;
+        if (&p_Other != this)
+        {
+            m_u16Type  = p_Other.m_u16Type;
+            m_u16Class = p_Other.m_u16Class;
+        }
+        return *this;
     }
-    return *this;
-}
 
-
-/**
+    /**
     MDNSResponder::stcMDNS_RRHeader
 
     A MDNS record header (domain and attributes) object.
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader constructor
 */
-MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(void)
-{
-
-}
+    MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(void)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader copy-constructor
 */
-MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other)
-{
-
-    operator=(p_Other);
-}
+    MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other)
+    {
+        operator=(p_Other);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRHeader::operator =
 */
-MDNSResponder::stcMDNS_RRHeader& MDNSResponder::stcMDNS_RRHeader::operator=(const MDNSResponder::stcMDNS_RRHeader& p_Other)
-{
-
-    if (&p_Other != this)
+    MDNSResponder::stcMDNS_RRHeader& MDNSResponder::stcMDNS_RRHeader::operator=(const MDNSResponder::stcMDNS_RRHeader& p_Other)
     {
-        m_Domain = p_Other.m_Domain;
-        m_Attributes = p_Other.m_Attributes;
+        if (&p_Other != this)
+        {
+            m_Domain     = p_Other.m_Domain;
+            m_Attributes = p_Other.m_Attributes;
+        }
+        return *this;
     }
-    return *this;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRHeader::clear
 */
-bool MDNSResponder::stcMDNS_RRHeader::clear(void)
-{
-
-    m_Domain.clear();
-    return true;
-}
-
+    bool MDNSResponder::stcMDNS_RRHeader::clear(void)
+    {
+        m_Domain.clear();
+        return true;
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRQuestion
 
     A MDNS question record object (header + question flags)
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion constructor
 */
-MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion(void)
-    :   m_pNext(0),
+    MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion(void) :
+        m_pNext(0),
         m_bUnicast(false)
-{
-
-}
-
+    {
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRAnswer
 
     A MDNS answer record object (header + answer content).
@@ -988,53 +910,48 @@ MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion(void)
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer constructor
 */
-MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer(enuAnswerType p_AnswerType,
-        const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-    :   m_pNext(0),
+    MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer(enuAnswerType                          p_AnswerType,
+                                                      const MDNSResponder::stcMDNS_RRHeader& p_Header,
+                                                      uint32_t                               p_u32TTL) :
+        m_pNext(0),
         m_AnswerType(p_AnswerType),
         m_Header(p_Header),
         m_u32TTL(p_u32TTL)
-{
-
-    // Extract 'cache flush'-bit
-    m_bCacheFlush = (m_Header.m_Attributes.m_u16Class & 0x8000);
-    m_Header.m_Attributes.m_u16Class &= (~0x8000);
-}
+    {
+        // Extract 'cache flush'-bit
+        m_bCacheFlush = (m_Header.m_Attributes.m_u16Class & 0x8000);
+        m_Header.m_Attributes.m_u16Class &= (~0x8000);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer destructor
 */
-MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer(void)
-{
-
-}
+    MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer(void)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswer::answerType
 */
-MDNSResponder::enuAnswerType MDNSResponder::stcMDNS_RRAnswer::answerType(void) const
-{
-
-    return m_AnswerType;
-}
+    MDNSResponder::enuAnswerType MDNSResponder::stcMDNS_RRAnswer::answerType(void) const
+    {
+        return m_AnswerType;
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswer::clear
 */
-bool MDNSResponder::stcMDNS_RRAnswer::clear(void)
-{
-
-    m_pNext = 0;
-    m_Header.clear();
-    return true;
-}
-
+    bool MDNSResponder::stcMDNS_RRAnswer::clear(void)
+    {
+        m_pNext = 0;
+        m_Header.clear();
+        return true;
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRAnswerA
 
     A MDNS A answer object.
@@ -1043,39 +960,35 @@ bool MDNSResponder::stcMDNS_RRAnswer::clear(void)
 */
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA constructor
 */
-MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-    :   stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL),
+    MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+                                                        uint32_t                               p_u32TTL) :
+        stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL),
         m_IPAddress(0, 0, 0, 0)
-{
-
-}
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA destructor
 */
-MDNSResponder::stcMDNS_RRAnswerA::~stcMDNS_RRAnswerA(void)
-{
-
-    clear();
-}
+    MDNSResponder::stcMDNS_RRAnswerA::~stcMDNS_RRAnswerA(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerA::clear
 */
-bool MDNSResponder::stcMDNS_RRAnswerA::clear(void)
-{
-
-    m_IPAddress = IPAddress(0, 0, 0, 0);
-    return true;
-}
+    bool MDNSResponder::stcMDNS_RRAnswerA::clear(void)
+    {
+        m_IPAddress = IPAddress(0, 0, 0, 0);
+        return true;
+    }
 #endif
 
-
-/**
+    /**
     MDNSResponder::stcMDNS_RRAnswerPTR
 
     A MDNS PTR answer object.
@@ -1083,37 +996,33 @@ bool MDNSResponder::stcMDNS_RRAnswerA::clear(void)
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR constructor
 */
-MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-    :   stcMDNS_RRAnswer(AnswerType_PTR, p_Header, p_u32TTL)
-{
-
-}
+    MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+                                                            uint32_t                               p_u32TTL) :
+        stcMDNS_RRAnswer(AnswerType_PTR, p_Header, p_u32TTL)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR destructor
 */
-MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR(void)
-{
-
-    clear();
-}
+    MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerPTR::clear
 */
-bool MDNSResponder::stcMDNS_RRAnswerPTR::clear(void)
-{
-
-    m_PTRDomain.clear();
-    return true;
-}
-
+    bool MDNSResponder::stcMDNS_RRAnswerPTR::clear(void)
+    {
+        m_PTRDomain.clear();
+        return true;
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRAnswerTXT
 
     A MDNS TXT answer object.
@@ -1121,37 +1030,33 @@ bool MDNSResponder::stcMDNS_RRAnswerPTR::clear(void)
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT constructor
 */
-MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-    :   stcMDNS_RRAnswer(AnswerType_TXT, p_Header, p_u32TTL)
-{
-
-}
+    MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+                                                            uint32_t                               p_u32TTL) :
+        stcMDNS_RRAnswer(AnswerType_TXT, p_Header, p_u32TTL)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT destructor
 */
-MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT(void)
-{
-
-    clear();
-}
+    MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerTXT::clear
 */
-bool MDNSResponder::stcMDNS_RRAnswerTXT::clear(void)
-{
-
-    m_Txts.clear();
-    return true;
-}
-
+    bool MDNSResponder::stcMDNS_RRAnswerTXT::clear(void)
+    {
+        m_Txts.clear();
+        return true;
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRAnswerAAAA
 
     A MDNS AAAA answer object.
@@ -1160,37 +1065,33 @@ bool MDNSResponder::stcMDNS_RRAnswerTXT::clear(void)
 */
 
 #ifdef MDNS_IP6_SUPPORT
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA constructor
 */
-MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-    :   stcMDNS_RRAnswer(AnswerType_AAAA, p_Header, p_u32TTL)
-{
-
-}
+    MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+                                                              uint32_t                               p_u32TTL) :
+        stcMDNS_RRAnswer(AnswerType_AAAA, p_Header, p_u32TTL)
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA destructor
 */
-MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA(void)
-{
-
-    clear();
-}
+    MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerAAAA::clear
 */
-bool MDNSResponder::stcMDNS_RRAnswerAAAA::clear(void)
-{
-
-    return true;
-}
+    bool MDNSResponder::stcMDNS_RRAnswerAAAA::clear(void)
+    {
+        return true;
+    }
 #endif
 
-
-/**
+    /**
     MDNSResponder::stcMDNS_RRAnswerSRV
 
     A MDNS SRV answer object.
@@ -1198,43 +1099,39 @@ bool MDNSResponder::stcMDNS_RRAnswerAAAA::clear(void)
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV constructor
 */
-MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-    :   stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL),
+    MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV(const MDNSResponder::stcMDNS_RRHeader& p_Header,
+                                                            uint32_t                               p_u32TTL) :
+        stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL),
         m_u16Priority(0),
         m_u16Weight(0),
         m_u16Port(0)
-{
-
-}
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV destructor
 */
-MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV(void)
-{
-
-    clear();
-}
+    MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerSRV::clear
 */
-bool MDNSResponder::stcMDNS_RRAnswerSRV::clear(void)
-{
-
-    m_u16Priority = 0;
-    m_u16Weight = 0;
-    m_u16Port = 0;
-    m_SRVDomain.clear();
-    return true;
-}
-
+    bool MDNSResponder::stcMDNS_RRAnswerSRV::clear(void)
+    {
+        m_u16Priority = 0;
+        m_u16Weight   = 0;
+        m_u16Port     = 0;
+        m_SRVDomain.clear();
+        return true;
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNS_RRAnswerGeneric
 
     An unknown (generic) MDNS answer object.
@@ -1242,85 +1139,80 @@ bool MDNSResponder::stcMDNS_RRAnswerSRV::clear(void)
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric constructor
 */
-MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
-        uint32_t p_u32TTL)
-    :   stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL),
+    MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
+                                                                    uint32_t                p_u32TTL) :
+        stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL),
         m_u16RDLength(0),
         m_pu8RDData(0)
-{
-
-}
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric destructor
 */
-MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric(void)
-{
-
-    clear();
-}
+    MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNS_RRAnswerGeneric::clear
 */
-bool MDNSResponder::stcMDNS_RRAnswerGeneric::clear(void)
-{
-
-    if (m_pu8RDData)
+    bool MDNSResponder::stcMDNS_RRAnswerGeneric::clear(void)
     {
-        delete[] m_pu8RDData;
-        m_pu8RDData = 0;
-    }
-    m_u16RDLength = 0;
-
-    return true;
-}
+        if (m_pu8RDData)
+        {
+            delete[] m_pu8RDData;
+            m_pu8RDData = 0;
+        }
+        m_u16RDLength = 0;
 
+        return true;
+    }
 
-/**
+    /**
     MDNSResponder::stcProbeInformation
 
     Probing status information for a host or service domain
 
 */
 
-/*
+    /*
     MDNSResponder::stcProbeInformation::stcProbeInformation constructor
 */
-MDNSResponder::stcProbeInformation::stcProbeInformation(void)
-    :   m_ProbingStatus(ProbingStatus_WaitingForData),
+    MDNSResponder::stcProbeInformation::stcProbeInformation(void) :
+        m_ProbingStatus(ProbingStatus_WaitingForData),
         m_u8SentCount(0),
         m_Timeout(esp8266::polledTimeout::oneShotMs::neverExpires),
         m_bConflict(false),
         m_bTiebreakNeeded(false),
         m_fnHostProbeResultCallback(0),
         m_fnServiceProbeResultCallback(0)
-{
-}
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcProbeInformation::clear
 */
-bool MDNSResponder::stcProbeInformation::clear(bool p_bClearUserdata /*= false*/)
-{
-
-    m_ProbingStatus = ProbingStatus_WaitingForData;
-    m_u8SentCount = 0;
-    m_Timeout.resetToNeverExpires();
-    m_bConflict = false;
-    m_bTiebreakNeeded = false;
-    if (p_bClearUserdata)
+    bool MDNSResponder::stcProbeInformation::clear(bool p_bClearUserdata /*= false*/)
     {
-        m_fnHostProbeResultCallback = 0;
-        m_fnServiceProbeResultCallback = 0;
+        m_ProbingStatus = ProbingStatus_WaitingForData;
+        m_u8SentCount   = 0;
+        m_Timeout.resetToNeverExpires();
+        m_bConflict       = false;
+        m_bTiebreakNeeded = false;
+        if (p_bClearUserdata)
+        {
+            m_fnHostProbeResultCallback    = 0;
+            m_fnServiceProbeResultCallback = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/**
+    /**
     MDNSResponder::stcMDNSService
 
     A MDNS service object (to be announced by the MDNS responder)
@@ -1331,13 +1223,13 @@ bool MDNSResponder::stcProbeInformation::clear(bool p_bClearUserdata /*= false*/
     reset in '_sendMDNSMessage' afterwards.
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSService::stcMDNSService constructor
 */
-MDNSResponder::stcMDNSService::stcMDNSService(const char* p_pcName /*= 0*/,
-        const char* p_pcService /*= 0*/,
-        const char* p_pcProtocol /*= 0*/)
-    :   m_pNext(0),
+    MDNSResponder::stcMDNSService::stcMDNSService(const char* p_pcName /*= 0*/,
+                                                  const char* p_pcService /*= 0*/,
+                                                  const char* p_pcProtocol /*= 0*/) :
+        m_pNext(0),
         m_pcName(0),
         m_bAutoName(false),
         m_pcService(0),
@@ -1345,143 +1237,134 @@ MDNSResponder::stcMDNSService::stcMDNSService(const char* p_pcName /*= 0*/,
         m_u16Port(0),
         m_u8ReplyMask(0),
         m_fnTxtCallback(0)
-{
-
-    setName(p_pcName);
-    setService(p_pcService);
-    setProtocol(p_pcProtocol);
-}
+    {
+        setName(p_pcName);
+        setService(p_pcService);
+        setProtocol(p_pcProtocol);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSService::~stcMDNSService destructor
 */
-MDNSResponder::stcMDNSService::~stcMDNSService(void)
-{
-
-    releaseName();
-    releaseService();
-    releaseProtocol();
-}
+    MDNSResponder::stcMDNSService::~stcMDNSService(void)
+    {
+        releaseName();
+        releaseService();
+        releaseProtocol();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSService::setName
 */
-bool MDNSResponder::stcMDNSService::setName(const char* p_pcName)
-{
-
-    bool bResult = false;
-
-    releaseName();
-    size_t stLength = (p_pcName ? strlen(p_pcName) : 0);
-    if (stLength)
+    bool MDNSResponder::stcMDNSService::setName(const char* p_pcName)
     {
-        if ((bResult = (0 != (m_pcName = new char[stLength + 1]))))
+        bool bResult = false;
+
+        releaseName();
+        size_t stLength = (p_pcName ? strlen(p_pcName) : 0);
+        if (stLength)
         {
-            strncpy(m_pcName, p_pcName, stLength);
-            m_pcName[stLength] = 0;
+            if ((bResult = (0 != (m_pcName = new char[stLength + 1]))))
+            {
+                strncpy(m_pcName, p_pcName, stLength);
+                m_pcName[stLength] = 0;
+            }
         }
+        else
+        {
+            bResult = true;
+        }
+        return bResult;
     }
-    else
-    {
-        bResult = true;
-    }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSService::releaseName
 */
-bool MDNSResponder::stcMDNSService::releaseName(void)
-{
-
-    if (m_pcName)
+    bool MDNSResponder::stcMDNSService::releaseName(void)
     {
-        delete[] m_pcName;
-        m_pcName = 0;
+        if (m_pcName)
+        {
+            delete[] m_pcName;
+            m_pcName = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSService::setService
 */
-bool MDNSResponder::stcMDNSService::setService(const char* p_pcService)
-{
-
-    bool bResult = false;
-
-    releaseService();
-    size_t stLength = (p_pcService ? strlen(p_pcService) : 0);
-    if (stLength)
+    bool MDNSResponder::stcMDNSService::setService(const char* p_pcService)
     {
-        if ((bResult = (0 != (m_pcService = new char[stLength + 1]))))
+        bool bResult = false;
+
+        releaseService();
+        size_t stLength = (p_pcService ? strlen(p_pcService) : 0);
+        if (stLength)
         {
-            strncpy(m_pcService, p_pcService, stLength);
-            m_pcService[stLength] = 0;
+            if ((bResult = (0 != (m_pcService = new char[stLength + 1]))))
+            {
+                strncpy(m_pcService, p_pcService, stLength);
+                m_pcService[stLength] = 0;
+            }
         }
+        else
+        {
+            bResult = true;
+        }
+        return bResult;
     }
-    else
-    {
-        bResult = true;
-    }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSService::releaseService
 */
-bool MDNSResponder::stcMDNSService::releaseService(void)
-{
-
-    if (m_pcService)
+    bool MDNSResponder::stcMDNSService::releaseService(void)
     {
-        delete[] m_pcService;
-        m_pcService = 0;
+        if (m_pcService)
+        {
+            delete[] m_pcService;
+            m_pcService = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSService::setProtocol
 */
-bool MDNSResponder::stcMDNSService::setProtocol(const char* p_pcProtocol)
-{
-
-    bool bResult = false;
-
-    releaseProtocol();
-    size_t stLength = (p_pcProtocol ? strlen(p_pcProtocol) : 0);
-    if (stLength)
+    bool MDNSResponder::stcMDNSService::setProtocol(const char* p_pcProtocol)
     {
-        if ((bResult = (0 != (m_pcProtocol = new char[stLength + 1]))))
+        bool bResult = false;
+
+        releaseProtocol();
+        size_t stLength = (p_pcProtocol ? strlen(p_pcProtocol) : 0);
+        if (stLength)
+        {
+            if ((bResult = (0 != (m_pcProtocol = new char[stLength + 1]))))
+            {
+                strncpy(m_pcProtocol, p_pcProtocol, stLength);
+                m_pcProtocol[stLength] = 0;
+            }
+        }
+        else
         {
-            strncpy(m_pcProtocol, p_pcProtocol, stLength);
-            m_pcProtocol[stLength] = 0;
+            bResult = true;
         }
+        return bResult;
     }
-    else
-    {
-        bResult = true;
-    }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSService::releaseProtocol
 */
-bool MDNSResponder::stcMDNSService::releaseProtocol(void)
-{
-
-    if (m_pcProtocol)
+    bool MDNSResponder::stcMDNSService::releaseProtocol(void)
     {
-        delete[] m_pcProtocol;
-        m_pcProtocol = 0;
+        if (m_pcProtocol)
+        {
+            delete[] m_pcProtocol;
+            m_pcProtocol = 0;
+        }
+        return true;
     }
-    return true;
-}
-
 
-/**
+    /**
     MDNSResponder::stcMDNSServiceQuery
 
     A MDNS service query object.
@@ -1492,7 +1375,7 @@ bool MDNSResponder::stcMDNSService::releaseProtocol(void)
 
 */
 
-/**
+    /**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer
 
     One answer for a service query.
@@ -1513,7 +1396,7 @@ bool MDNSResponder::stcMDNSService::releaseProtocol(void)
 
 */
 
-/**
+    /**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL
 
     The TTL (Time-To-Live) for an specific answer content.
@@ -1562,8 +1445,7 @@ bool MDNSResponder::stcMDNSService::releaseProtocol(void)
             (m_TTLTimeFlag.flagged()));
     }*/
 
-
-/**
+    /**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL
 
     The TTL (Time-To-Live) for an specific answer content.
@@ -1573,141 +1455,128 @@ bool MDNSResponder::stcMDNSService::releaseProtocol(void)
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL constructor
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL(void)
-    :   m_u32TTL(0),
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL(void) :
+        m_u32TTL(0),
         m_TTLTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
         m_timeoutLevel(TIMEOUTLEVEL_UNSET)
-{
-
-}
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set(uint32_t p_u32TTL)
-{
-
-    m_u32TTL = p_u32TTL;
-    if (m_u32TTL)
-    {
-        m_timeoutLevel = TIMEOUTLEVEL_BASE;             // Set to 80%
-        m_TTLTimeout.reset(timeout());
-    }
-    else
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set(uint32_t p_u32TTL)
     {
-        m_timeoutLevel = TIMEOUTLEVEL_UNSET;            // undef
-        m_TTLTimeout.resetToNeverExpires();
+        m_u32TTL = p_u32TTL;
+        if (m_u32TTL)
+        {
+            m_timeoutLevel = TIMEOUTLEVEL_BASE;  // Set to 80%
+            m_TTLTimeout.reset(timeout());
+        }
+        else
+        {
+            m_timeoutLevel = TIMEOUTLEVEL_UNSET;  // undef
+            m_TTLTimeout.resetToNeverExpires();
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::flagged
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::flagged(void)
-{
-
-    return ((m_u32TTL) &&
-            (TIMEOUTLEVEL_UNSET != m_timeoutLevel) &&
-            (m_TTLTimeout.expired()));
-}
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::flagged(void)
+    {
+        return ((m_u32TTL) && (TIMEOUTLEVEL_UNSET != m_timeoutLevel) && (m_TTLTimeout.expired()));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::restart
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::restart(void)
-{
-
-    bool    bResult = true;
-
-    if ((TIMEOUTLEVEL_BASE <= m_timeoutLevel) &&    // >= 80% AND
-            (TIMEOUTLEVEL_FINAL > m_timeoutLevel))      // < 100%
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::restart(void)
     {
+        bool bResult = true;
 
-        m_timeoutLevel += TIMEOUTLEVEL_INTERVAL;    // increment by 5%
-        m_TTLTimeout.reset(timeout());
-    }
-    else
-    {
-        bResult = false;
-        m_TTLTimeout.resetToNeverExpires();
-        m_timeoutLevel = TIMEOUTLEVEL_UNSET;
+        if ((TIMEOUTLEVEL_BASE <= m_timeoutLevel) &&  // >= 80% AND
+            (TIMEOUTLEVEL_FINAL > m_timeoutLevel))    // < 100%
+        {
+            m_timeoutLevel += TIMEOUTLEVEL_INTERVAL;  // increment by 5%
+            m_TTLTimeout.reset(timeout());
+        }
+        else
+        {
+            bResult = false;
+            m_TTLTimeout.resetToNeverExpires();
+            m_timeoutLevel = TIMEOUTLEVEL_UNSET;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::prepareDeletion
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::prepareDeletion(void)
-{
-
-    m_timeoutLevel = TIMEOUTLEVEL_FINAL;
-    m_TTLTimeout.reset(1 * 1000);   // See RFC 6762, 10.1
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::prepareDeletion(void)
+    {
+        m_timeoutLevel = TIMEOUTLEVEL_FINAL;
+        m_TTLTimeout.reset(1 * 1000);  // See RFC 6762, 10.1
 
-    return true;
-}
+        return true;
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel(void) const
-{
-
-    return (TIMEOUTLEVEL_FINAL == m_timeoutLevel);
-}
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel(void) const
+    {
+        return (TIMEOUTLEVEL_FINAL == m_timeoutLevel);
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::timeType MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout(void) const
-{
-    if (TIMEOUTLEVEL_BASE == m_timeoutLevel)            // 80%
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::timeType MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout(void) const
     {
-        return (m_u32TTL * 800L);                  // to milliseconds
+        if (TIMEOUTLEVEL_BASE == m_timeoutLevel)  // 80%
+        {
+            return (m_u32TTL * 800L);  // to milliseconds
+        }
+        else if ((TIMEOUTLEVEL_BASE < m_timeoutLevel) &&  // >80% AND
+                 (TIMEOUTLEVEL_FINAL >= m_timeoutLevel))  // <= 100%
+        {
+            return (m_u32TTL * 50L);
+        }  // else: invalid
+        return MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::neverExpires;
     }
-    else if ((TIMEOUTLEVEL_BASE < m_timeoutLevel) &&    // >80% AND
-             (TIMEOUTLEVEL_FINAL >= m_timeoutLevel))    // <= 100%
-    {
-
-        return (m_u32TTL * 50L);
-    }   // else: invalid
-    return MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::neverExpires;
-}
-
 
 #ifdef MDNS_IP4_SUPPORT
-/**
+    /**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address constructor
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address(IPAddress p_IPAddress,
-        uint32_t p_u32TTL /*= 0*/)
-    :   m_pNext(0),
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address(IPAddress p_IPAddress,
+                                                                                uint32_t  p_u32TTL /*= 0*/) :
+        m_pNext(0),
         m_IPAddress(p_IPAddress)
-{
-
-    m_TTL.set(p_u32TTL);
-}
+    {
+        m_TTL.set(p_u32TTL);
+    }
 #endif
 
-
-/**
+    /**
     MDNSResponder::stcMDNSServiceQuery::stcAnswer
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer constructor
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer(void)
-    :   m_pNext(0),
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer(void) :
+        m_pNext(0),
         m_pcServiceDomain(0),
         m_pcHostDomain(0),
         m_u16Port(0),
@@ -1719,404 +1588,375 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer(void)
         m_pIP6Addresses(0),
 #endif
         m_u32ContentFlags(0)
-{
-}
+    {
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer destructor
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer(void)
-{
-
-    clear();
-}
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear(void)
-{
-
-    return ((releaseTxts()) &&
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear(void)
+    {
+        return ((releaseTxts()) &&
 #ifdef MDNS_IP4_SUPPORT
-            (releaseIP4Addresses()) &&
+                (releaseIP4Addresses()) &&
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            (releaseIP6Addresses())
+                (releaseIP6Addresses())
 #endif
-            (releaseHostDomain()) &&
-            (releaseServiceDomain()));
-}
+                    (releaseHostDomain())
+                && (releaseServiceDomain()));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocServiceDomain
 
     Alloc memory for the char array representation of the service domain.
 
 */
-char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocServiceDomain(size_t p_stLength)
-{
-
-    releaseServiceDomain();
-    if (p_stLength)
+    char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocServiceDomain(size_t p_stLength)
     {
-        m_pcServiceDomain = new char[p_stLength];
+        releaseServiceDomain();
+        if (p_stLength)
+        {
+            m_pcServiceDomain = new char[p_stLength];
+        }
+        return m_pcServiceDomain;
     }
-    return m_pcServiceDomain;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseServiceDomain
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseServiceDomain(void)
-{
-
-    if (m_pcServiceDomain)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseServiceDomain(void)
     {
-        delete[] m_pcServiceDomain;
-        m_pcServiceDomain = 0;
+        if (m_pcServiceDomain)
+        {
+            delete[] m_pcServiceDomain;
+            m_pcServiceDomain = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocHostDomain
 
     Alloc memory for the char array representation of the host domain.
 
 */
-char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocHostDomain(size_t p_stLength)
-{
-
-    releaseHostDomain();
-    if (p_stLength)
+    char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocHostDomain(size_t p_stLength)
     {
-        m_pcHostDomain = new char[p_stLength];
+        releaseHostDomain();
+        if (p_stLength)
+        {
+            m_pcHostDomain = new char[p_stLength];
+        }
+        return m_pcHostDomain;
     }
-    return m_pcHostDomain;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseHostDomain
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseHostDomain(void)
-{
-
-    if (m_pcHostDomain)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseHostDomain(void)
     {
-        delete[] m_pcHostDomain;
-        m_pcHostDomain = 0;
+        if (m_pcHostDomain)
+        {
+            delete[] m_pcHostDomain;
+            m_pcHostDomain = 0;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocTxts
 
     Alloc memory for the char array representation of the TXT items.
 
 */
-char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocTxts(size_t p_stLength)
-{
-
-    releaseTxts();
-    if (p_stLength)
+    char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocTxts(size_t p_stLength)
     {
-        m_pcTxts = new char[p_stLength];
+        releaseTxts();
+        if (p_stLength)
+        {
+            m_pcTxts = new char[p_stLength];
+        }
+        return m_pcTxts;
     }
-    return m_pcTxts;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseTxts
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseTxts(void)
-{
-
-    if (m_pcTxts)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseTxts(void)
     {
-        delete[] m_pcTxts;
-        m_pcTxts = 0;
+        if (m_pcTxts)
+        {
+            delete[] m_pcTxts;
+            m_pcTxts = 0;
+        }
+        return true;
     }
-    return true;
-}
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP4Addresses
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP4Addresses(void)
-{
-
-    while (m_pIP4Addresses)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP4Addresses(void)
     {
-        stcIP4Address*  pNext = m_pIP4Addresses->m_pNext;
-        delete m_pIP4Addresses;
-        m_pIP4Addresses = pNext;
+        while (m_pIP4Addresses)
+        {
+            stcIP4Address* pNext = m_pIP4Addresses->m_pNext;
+            delete m_pIP4Addresses;
+            m_pIP4Addresses = pNext;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
-{
-
-    bool bResult = false;
-
-    if (p_pIP4Address)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
     {
-        p_pIP4Address->m_pNext = m_pIP4Addresses;
-        m_pIP4Addresses = p_pIP4Address;
-        bResult = true;
+        bool bResult = false;
+
+        if (p_pIP4Address)
+        {
+            p_pIP4Address->m_pNext = m_pIP4Addresses;
+            m_pIP4Addresses        = p_pIP4Address;
+            bResult                = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
-{
-
-    bool    bResult = false;
-
-    if (p_pIP4Address)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
     {
-        stcIP4Address*  pPred = m_pIP4Addresses;
-        while ((pPred) &&
-                (pPred->m_pNext != p_pIP4Address))
-        {
-            pPred = pPred->m_pNext;
-        }
-        if (pPred)
-        {
-            pPred->m_pNext = p_pIP4Address->m_pNext;
-            delete p_pIP4Address;
-            bResult = true;
-        }
-        else if (m_pIP4Addresses == p_pIP4Address)     // No predecessor, but first item
+        bool bResult = false;
+
+        if (p_pIP4Address)
         {
-            m_pIP4Addresses = p_pIP4Address->m_pNext;
-            delete p_pIP4Address;
-            bResult = true;
+            stcIP4Address* pPred = m_pIP4Addresses;
+            while ((pPred) && (pPred->m_pNext != p_pIP4Address))
+            {
+                pPred = pPred->m_pNext;
+            }
+            if (pPred)
+            {
+                pPred->m_pNext = p_pIP4Address->m_pNext;
+                delete p_pIP4Address;
+                bResult = true;
+            }
+            else if (m_pIP4Addresses == p_pIP4Address)  // No predecessor, but first item
+            {
+                m_pIP4Addresses = p_pIP4Address->m_pNext;
+                delete p_pIP4Address;
+                bResult = true;
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address (const)
 */
-const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress) const
-{
-
-    return (stcIP4Address*)(((const stcAnswer*)this)->findIP4Address(p_IPAddress));
-}
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress) const
+    {
+        return (stcIP4Address*)(((const stcAnswer*)this)->findIP4Address(p_IPAddress));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress)
-{
-
-    stcIP4Address*  pIP4Address = m_pIP4Addresses;
-    while (pIP4Address)
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress)
     {
-        if (pIP4Address->m_IPAddress == p_IPAddress)
+        stcIP4Address* pIP4Address = m_pIP4Addresses;
+        while (pIP4Address)
         {
-            break;
+            if (pIP4Address->m_IPAddress == p_IPAddress)
+            {
+                break;
+            }
+            pIP4Address = pIP4Address->m_pNext;
         }
-        pIP4Address = pIP4Address->m_pNext;
+        return pIP4Address;
     }
-    return pIP4Address;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount
 */
-uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount(void) const
-{
-
-    uint32_t    u32Count = 0;
-
-    stcIP4Address*  pIP4Address = m_pIP4Addresses;
-    while (pIP4Address)
+    uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount(void) const
     {
-        ++u32Count;
-        pIP4Address = pIP4Address->m_pNext;
+        uint32_t u32Count = 0;
+
+        stcIP4Address* pIP4Address = m_pIP4Addresses;
+        while (pIP4Address)
+        {
+            ++u32Count;
+            pIP4Address = pIP4Address->m_pNext;
+        }
+        return u32Count;
     }
-    return u32Count;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index)
-{
-
-    return (stcIP4Address*)(((const stcAnswer*)this)->IP4AddressAtIndex(p_u32Index));
-}
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index)
+    {
+        return (stcIP4Address*)(((const stcAnswer*)this)->IP4AddressAtIndex(p_u32Index));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex (const)
 */
-const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index) const
-{
-
-    const stcIP4Address*    pIP4Address = 0;
-
-    if (((uint32_t)(-1) != p_u32Index) &&
-            (m_pIP4Addresses))
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index) const
     {
+        const stcIP4Address* pIP4Address = 0;
 
-        uint32_t    u32Index;
-        for (pIP4Address = m_pIP4Addresses, u32Index = 0; ((pIP4Address) && (u32Index < p_u32Index)); pIP4Address = pIP4Address->m_pNext, ++u32Index);
+        if (((uint32_t)(-1) != p_u32Index) && (m_pIP4Addresses))
+        {
+            uint32_t u32Index;
+            for (pIP4Address = m_pIP4Addresses, u32Index = 0; ((pIP4Address) && (u32Index < p_u32Index)); pIP4Address = pIP4Address->m_pNext, ++u32Index)
+                ;
+        }
+        return pIP4Address;
     }
-    return pIP4Address;
-}
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP6Addresses
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP6Addresses(void)
-{
-
-    while (m_pIP6Addresses)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP6Addresses(void)
     {
-        stcIP6Address*  pNext = m_pIP6Addresses->m_pNext;
-        delete m_pIP6Addresses;
-        m_pIP6Addresses = pNext;
+        while (m_pIP6Addresses)
+        {
+            stcIP6Address* pNext = m_pIP6Addresses->m_pNext;
+            delete m_pIP6Addresses;
+            m_pIP6Addresses = pNext;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
-{
-
-    bool bResult = false;
-
-    if (p_pIP6Address)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
     {
-        p_pIP6Address->m_pNext = m_pIP6Addresses;
-        m_pIP6Addresses = p_pIP6Address;
-        bResult = true;
+        bool bResult = false;
+
+        if (p_pIP6Address)
+        {
+            p_pIP6Address->m_pNext = m_pIP6Addresses;
+            m_pIP6Addresses        = p_pIP6Address;
+            bResult                = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address
 */
-bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
-{
-
-    bool    bResult = false;
-
-    if (p_pIP6Address)
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
     {
-        stcIP6Address*  pPred = m_pIP6Addresses;
-        while ((pPred) &&
-                (pPred->m_pNext != p_pIP6Address))
-        {
-            pPred = pPred->m_pNext;
-        }
-        if (pPred)
-        {
-            pPred->m_pNext = p_pIP6Address->m_pNext;
-            delete p_pIP6Address;
-            bResult = true;
-        }
-        else if (m_pIP6Addresses == p_pIP6Address)     // No predecessor, but first item
+        bool bResult = false;
+
+        if (p_pIP6Address)
         {
-            m_pIP6Addresses = p_pIP6Address->m_pNext;
-            delete p_pIP6Address;
-            bResult = true;
+            stcIP6Address* pPred = m_pIP6Addresses;
+            while ((pPred) && (pPred->m_pNext != p_pIP6Address))
+            {
+                pPred = pPred->m_pNext;
+            }
+            if (pPred)
+            {
+                pPred->m_pNext = p_pIP6Address->m_pNext;
+                delete p_pIP6Address;
+                bResult = true;
+            }
+            else if (m_pIP6Addresses == p_pIP6Address)  // No predecessor, but first item
+            {
+                m_pIP6Addresses = p_pIP6Address->m_pNext;
+                delete p_pIP6Address;
+                bResult = true;
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IP6Address& p_IPAddress)
-{
-
-    return (stcIP6Address*)(((const stcAnswer*)this)->findIP6Address(p_IPAddress));
-}
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IP6Address& p_IPAddress)
+    {
+        return (stcIP6Address*)(((const stcAnswer*)this)->findIP6Address(p_IPAddress));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address (const)
 */
-const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IPAddress& p_IPAddress) const
-{
-
-    const stcIP6Address*    pIP6Address = m_pIP6Addresses;
-    while (pIP6Address)
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IPAddress& p_IPAddress) const
     {
-        if (p_IP6Address->m_IPAddress == p_IPAddress)
+        const stcIP6Address* pIP6Address = m_pIP6Addresses;
+        while (pIP6Address)
         {
-            break;
+            if (p_IP6Address->m_IPAddress == p_IPAddress)
+            {
+                break;
+            }
+            pIP6Address = pIP6Address->m_pNext;
         }
-        pIP6Address = pIP6Address->m_pNext;
+        return pIP6Address;
     }
-    return pIP6Address;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount
 */
-uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount(void) const
-{
-
-    uint32_t    u32Count = 0;
-
-    stcIP6Address*  pIP6Address = m_pIP6Addresses;
-    while (pIP6Address)
+    uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount(void) const
     {
-        ++u32Count;
-        pIP6Address = pIP6Address->m_pNext;
+        uint32_t u32Count = 0;
+
+        stcIP6Address* pIP6Address = m_pIP6Addresses;
+        while (pIP6Address)
+        {
+            ++u32Count;
+            pIP6Address = pIP6Address->m_pNext;
+        }
+        return u32Count;
     }
-    return u32Count;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex (const)
 */
-const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index) const
-{
-
-    return (stcIP6Address*)(((const stcAnswer*)this)->IP6AddressAtIndex(p_u32Index));
-}
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index) const
+    {
+        return (stcIP6Address*)(((const stcAnswer*)this)->IP6AddressAtIndex(p_u32Index));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index)
-{
-
-    stcIP6Address*    pIP6Address = 0;
-
-    if (((uint32_t)(-1) != p_u32Index) &&
-            (m_pIP6Addresses))
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index)
     {
+        stcIP6Address* pIP6Address = 0;
 
-        uint32_t    u32Index;
-        for (pIP6Address = m_pIP6Addresses, u32Index = 0; ((pIP6Address) && (u32Index < p_u32Index)); pIP6Address = pIP6Address->m_pNext, ++u32Index);
+        if (((uint32_t)(-1) != p_u32Index) && (m_pIP6Addresses))
+        {
+            uint32_t u32Index;
+            for (pIP6Address = m_pIP6Addresses, u32Index = 0; ((pIP6Address) && (u32Index < p_u32Index)); pIP6Address = pIP6Address->m_pNext, ++u32Index)
+                ;
+        }
+        return pIP6Address;
     }
-    return pIP6Address;
-}
 #endif
 
-
-/**
+    /**
     MDNSResponder::stcMDNSServiceQuery
 
     A service query object.
@@ -2133,200 +1973,186 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stc
     Service query object may be connected to a linked list.
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery constructor
 */
-MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery(void)
-    :   m_pNext(0),
+    MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery(void) :
+        m_pNext(0),
         m_fnCallback(0),
         m_bLegacyQuery(false),
         m_u8SentCount(0),
         m_ResendTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
         m_bAwaitingAnswers(true),
         m_pAnswers(0)
-{
-
-    clear();
-}
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery destructor
 */
-MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery(void)
-{
-
-    clear();
-}
+    MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::clear
 */
-bool MDNSResponder::stcMDNSServiceQuery::clear(void)
-{
-
-    m_fnCallback = 0;
-    m_bLegacyQuery = false;
-    m_u8SentCount = 0;
-    m_ResendTimeout.resetToNeverExpires();
-    m_bAwaitingAnswers = true;
-    while (m_pAnswers)
+    bool MDNSResponder::stcMDNSServiceQuery::clear(void)
     {
-        stcAnswer*  pNext = m_pAnswers->m_pNext;
-        delete m_pAnswers;
-        m_pAnswers = pNext;
+        m_fnCallback   = 0;
+        m_bLegacyQuery = false;
+        m_u8SentCount  = 0;
+        m_ResendTimeout.resetToNeverExpires();
+        m_bAwaitingAnswers = true;
+        while (m_pAnswers)
+        {
+            stcAnswer* pNext = m_pAnswers->m_pNext;
+            delete m_pAnswers;
+            m_pAnswers = pNext;
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::answerCount
 */
-uint32_t MDNSResponder::stcMDNSServiceQuery::answerCount(void) const
-{
-
-    uint32_t    u32Count = 0;
-
-    stcAnswer*  pAnswer = m_pAnswers;
-    while (pAnswer)
+    uint32_t MDNSResponder::stcMDNSServiceQuery::answerCount(void) const
     {
-        ++u32Count;
-        pAnswer = pAnswer->m_pNext;
+        uint32_t u32Count = 0;
+
+        stcAnswer* pAnswer = m_pAnswers;
+        while (pAnswer)
+        {
+            ++u32Count;
+            pAnswer = pAnswer->m_pNext;
+        }
+        return u32Count;
     }
-    return u32Count;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::answerAtIndex
 */
-const MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index) const
-{
-
-    const stcAnswer*    pAnswer = 0;
-
-    if (((uint32_t)(-1) != p_u32Index) &&
-            (m_pAnswers))
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index) const
     {
+        const stcAnswer* pAnswer = 0;
 
-        uint32_t    u32Index;
-        for (pAnswer = m_pAnswers, u32Index = 0; ((pAnswer) && (u32Index < p_u32Index)); pAnswer = pAnswer->m_pNext, ++u32Index);
+        if (((uint32_t)(-1) != p_u32Index) && (m_pAnswers))
+        {
+            uint32_t u32Index;
+            for (pAnswer = m_pAnswers, u32Index = 0; ((pAnswer) && (u32Index < p_u32Index)); pAnswer = pAnswer->m_pNext, ++u32Index)
+                ;
+        }
+        return pAnswer;
     }
-    return pAnswer;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::answerAtIndex
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index)
-{
-
-    return (stcAnswer*)(((const stcMDNSServiceQuery*)this)->answerAtIndex(p_u32Index));
-}
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index)
+    {
+        return (stcAnswer*)(((const stcMDNSServiceQuery*)this)->answerAtIndex(p_u32Index));
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::indexOfAnswer
 */
-uint32_t MDNSResponder::stcMDNSServiceQuery::indexOfAnswer(const MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer) const
-{
-
-    uint32_t    u32Index = 0;
-
-    for (const stcAnswer* pAnswer = m_pAnswers; pAnswer; pAnswer = pAnswer->m_pNext, ++u32Index)
+    uint32_t MDNSResponder::stcMDNSServiceQuery::indexOfAnswer(const MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer) const
     {
-        if (pAnswer == p_pAnswer)
+        uint32_t u32Index = 0;
+
+        for (const stcAnswer* pAnswer = m_pAnswers; pAnswer; pAnswer = pAnswer->m_pNext, ++u32Index)
         {
-            return u32Index;
+            if (pAnswer == p_pAnswer)
+            {
+                return u32Index;
+            }
         }
+        return ((uint32_t)(-1));
     }
-    return ((uint32_t)(-1));
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::addAnswer
 */
-bool MDNSResponder::stcMDNSServiceQuery::addAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
-{
-
-    bool    bResult = false;
-
-    if (p_pAnswer)
+    bool MDNSResponder::stcMDNSServiceQuery::addAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
     {
-        p_pAnswer->m_pNext = m_pAnswers;
-        m_pAnswers = p_pAnswer;
-        bResult = true;
+        bool bResult = false;
+
+        if (p_pAnswer)
+        {
+            p_pAnswer->m_pNext = m_pAnswers;
+            m_pAnswers         = p_pAnswer;
+            bResult            = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::removeAnswer
 */
-bool MDNSResponder::stcMDNSServiceQuery::removeAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
-{
-
-    bool    bResult = false;
-
-    if (p_pAnswer)
+    bool MDNSResponder::stcMDNSServiceQuery::removeAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
     {
-        stcAnswer*  pPred = m_pAnswers;
-        while ((pPred) &&
-                (pPred->m_pNext != p_pAnswer))
-        {
-            pPred = pPred->m_pNext;
-        }
-        if (pPred)
-        {
-            pPred->m_pNext = p_pAnswer->m_pNext;
-            delete p_pAnswer;
-            bResult = true;
-        }
-        else if (m_pAnswers == p_pAnswer)   // No predecessor, but first item
+        bool bResult = false;
+
+        if (p_pAnswer)
         {
-            m_pAnswers = p_pAnswer->m_pNext;
-            delete p_pAnswer;
-            bResult = true;
+            stcAnswer* pPred = m_pAnswers;
+            while ((pPred) && (pPred->m_pNext != p_pAnswer))
+            {
+                pPred = pPred->m_pNext;
+            }
+            if (pPred)
+            {
+                pPred->m_pNext = p_pAnswer->m_pNext;
+                delete p_pAnswer;
+                bResult = true;
+            }
+            else if (m_pAnswers == p_pAnswer)  // No predecessor, but first item
+            {
+                m_pAnswers = p_pAnswer->m_pNext;
+                delete p_pAnswer;
+                bResult = true;
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::findAnswerForServiceDomain
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForServiceDomain(const MDNSResponder::stcMDNS_RRDomain& p_ServiceDomain)
-{
-
-    stcAnswer*  pAnswer = m_pAnswers;
-    while (pAnswer)
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForServiceDomain(const MDNSResponder::stcMDNS_RRDomain& p_ServiceDomain)
     {
-        if (pAnswer->m_ServiceDomain == p_ServiceDomain)
+        stcAnswer* pAnswer = m_pAnswers;
+        while (pAnswer)
         {
-            break;
+            if (pAnswer->m_ServiceDomain == p_ServiceDomain)
+            {
+                break;
+            }
+            pAnswer = pAnswer->m_pNext;
         }
-        pAnswer = pAnswer->m_pNext;
+        return pAnswer;
     }
-    return pAnswer;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSServiceQuery::findAnswerForHostDomain
 */
-MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForHostDomain(const MDNSResponder::stcMDNS_RRDomain& p_HostDomain)
-{
-
-    stcAnswer*  pAnswer = m_pAnswers;
-    while (pAnswer)
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForHostDomain(const MDNSResponder::stcMDNS_RRDomain& p_HostDomain)
     {
-        if (pAnswer->m_HostDomain == p_HostDomain)
+        stcAnswer* pAnswer = m_pAnswers;
+        while (pAnswer)
         {
-            break;
+            if (pAnswer->m_HostDomain == p_HostDomain)
+            {
+                break;
+            }
+            pAnswer = pAnswer->m_pNext;
         }
-        pAnswer = pAnswer->m_pNext;
+        return pAnswer;
     }
-    return pAnswer;
-}
 
-
-/**
+    /**
     MDNSResponder::stcMDNSSendParameter
 
     A 'collection' of properties and flags for one MDNS query or response.
@@ -2336,152 +2162,138 @@ MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuer
 
 */
 
-/**
+    /**
     MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem
 
     A cached host or service domain, incl. the offset in the UDP output buffer.
 
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem constructor
 */
-MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem(const void* p_pHostnameOrService,
-        bool p_bAdditionalData,
-        uint32_t p_u16Offset)
-    :   m_pNext(0),
+    MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem(const void* p_pHostnameOrService,
+                                                                                bool        p_bAdditionalData,
+                                                                                uint32_t    p_u16Offset) :
+        m_pNext(0),
         m_pHostnameOrService(p_pHostnameOrService),
         m_bAdditionalData(p_bAdditionalData),
         m_u16Offset(p_u16Offset)
-{
-
-}
+    {
+    }
 
-/**
+    /**
     MDNSResponder::stcMDNSSendParameter
 */
 
-/*
+    /*
     MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter constructor
 */
-MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter(void)
-    :   m_pQuestions(0),
+    MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter(void) :
+        m_pQuestions(0),
         m_pDomainCacheItems(0)
-{
-
-    clear();
-}
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter destructor
 */
-MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter(void)
-{
-
-    clear();
-}
+    MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter(void)
+    {
+        clear();
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSSendParameter::clear
 */
-bool MDNSResponder::stcMDNSSendParameter::clear(void)
-{
+    bool MDNSResponder::stcMDNSSendParameter::clear(void)
+    {
+        m_u16ID           = 0;
+        m_u8HostReplyMask = 0;
+        m_u16Offset       = 0;
 
-    m_u16ID = 0;
-    m_u8HostReplyMask = 0;
-    m_u16Offset = 0;
+        m_bLegacyQuery = false;
+        m_bResponse    = false;
+        m_bAuthorative = false;
+        m_bUnicast     = false;
+        m_bUnannounce  = false;
 
-    m_bLegacyQuery = false;
-    m_bResponse = false;
-    m_bAuthorative = false;
-    m_bUnicast = false;
-    m_bUnannounce = false;
+        m_bCacheFlush = true;
 
-    m_bCacheFlush = true;
+        while (m_pQuestions)
+        {
+            stcMDNS_RRQuestion* pNext = m_pQuestions->m_pNext;
+            delete m_pQuestions;
+            m_pQuestions = pNext;
+        }
 
-    while (m_pQuestions)
-    {
-        stcMDNS_RRQuestion* pNext = m_pQuestions->m_pNext;
-        delete m_pQuestions;
-        m_pQuestions = pNext;
+        return clearCachedNames();
+        ;
     }
-
-    return clearCachedNames();;
-}
-/*
+    /*
     MDNSResponder::stcMDNSSendParameter::clear cached names
 */
-bool MDNSResponder::stcMDNSSendParameter::clearCachedNames(void)
-{
+    bool MDNSResponder::stcMDNSSendParameter::clearCachedNames(void)
+    {
+        m_u16Offset = 0;
 
-    m_u16Offset = 0;
+        while (m_pDomainCacheItems)
+        {
+            stcDomainCacheItem* pNext = m_pDomainCacheItems->m_pNext;
+            delete m_pDomainCacheItems;
+            m_pDomainCacheItems = pNext;
+        }
+        m_pDomainCacheItems = nullptr;
 
-    while (m_pDomainCacheItems)
-    {
-        stcDomainCacheItem* pNext = m_pDomainCacheItems->m_pNext;
-        delete m_pDomainCacheItems;
-        m_pDomainCacheItems = pNext;
+        return true;
     }
-    m_pDomainCacheItems = nullptr;
-
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSSendParameter::shiftOffset
 */
-bool MDNSResponder::stcMDNSSendParameter::shiftOffset(uint16_t p_u16Shift)
-{
-
-    m_u16Offset += p_u16Shift;
-    return true;
-}
+    bool MDNSResponder::stcMDNSSendParameter::shiftOffset(uint16_t p_u16Shift)
+    {
+        m_u16Offset += p_u16Shift;
+        return true;
+    }
 
-/*
+    /*
     MDNSResponder::stcMDNSSendParameter::addDomainCacheItem
 */
-bool MDNSResponder::stcMDNSSendParameter::addDomainCacheItem(const void* p_pHostnameOrService,
-        bool p_bAdditionalData,
-        uint16_t p_u16Offset)
-{
-
-    bool    bResult = false;
-
-    stcDomainCacheItem* pNewItem = 0;
-    if ((p_pHostnameOrService) &&
-            (p_u16Offset) &&
-            ((pNewItem = new stcDomainCacheItem(p_pHostnameOrService, p_bAdditionalData, p_u16Offset))))
+    bool MDNSResponder::stcMDNSSendParameter::addDomainCacheItem(const void* p_pHostnameOrService,
+                                                                 bool        p_bAdditionalData,
+                                                                 uint16_t    p_u16Offset)
     {
+        bool bResult = false;
 
-        pNewItem->m_pNext = m_pDomainCacheItems;
-        bResult = ((m_pDomainCacheItems = pNewItem));
+        stcDomainCacheItem* pNewItem = 0;
+        if ((p_pHostnameOrService) && (p_u16Offset) && ((pNewItem = new stcDomainCacheItem(p_pHostnameOrService, p_bAdditionalData, p_u16Offset))))
+        {
+            pNewItem->m_pNext = m_pDomainCacheItems;
+            bResult           = ((m_pDomainCacheItems = pNewItem));
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset
 */
-uint16_t MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset(const void* p_pHostnameOrService,
-        bool p_bAdditionalData) const
-{
-
-    const stcDomainCacheItem*   pCacheItem = m_pDomainCacheItems;
-
-    for (; pCacheItem; pCacheItem = pCacheItem->m_pNext)
+    uint16_t MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset(const void* p_pHostnameOrService,
+                                                                         bool        p_bAdditionalData) const
     {
-        if ((pCacheItem->m_pHostnameOrService == p_pHostnameOrService) &&
-                (pCacheItem->m_bAdditionalData == p_bAdditionalData))   // Found cache item
+        const stcDomainCacheItem* pCacheItem = m_pDomainCacheItems;
+
+        for (; pCacheItem; pCacheItem = pCacheItem->m_pNext)
         {
-            break;
+            if ((pCacheItem->m_pHostnameOrService == p_pHostnameOrService) && (pCacheItem->m_bAdditionalData == p_bAdditionalData))  // Found cache item
+            {
+                break;
+            }
         }
+        return (pCacheItem ? pCacheItem->m_u16Offset : 0);
     }
-    return (pCacheItem ? pCacheItem->m_u16Offset : 0);
-}
-
-}   // namespace MDNSImplementation
-
-} // namespace esp8266
-
 
+}  // namespace MDNSImplementation
 
+}  // namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
index ebe66dff1c..16c7397abe 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
@@ -22,7 +22,8 @@
 
 */
 
-extern "C" {
+extern "C"
+{
 #include "user_interface.h"
 }
 
@@ -30,43 +31,39 @@ extern "C" {
 #include "LEAmDNS_lwIPdefs.h"
 #include "LEAmDNS_Priv.h"
 
-
 namespace esp8266
 {
-
 /*
     LEAmDNS
 */
 namespace MDNSImplementation
 {
-
-/**
+    /**
     CONST STRINGS
 */
-static const char*                      scpcLocal               = "local";
-static const char*                      scpcServices            = "services";
-static const char*                      scpcDNSSD               = "dns-sd";
-static const char*                      scpcUDP                 = "udp";
-//static const char*                    scpcTCP                 = "tcp";
+    static const char* scpcLocal    = "local";
+    static const char* scpcServices = "services";
+    static const char* scpcDNSSD    = "dns-sd";
+    static const char* scpcUDP      = "udp";
+    //static const char*                    scpcTCP                 = "tcp";
 
 #ifdef MDNS_IP4_SUPPORT
-static const char*                  scpcReverseIP4Domain    = "in-addr";
+    static const char* scpcReverseIP4Domain = "in-addr";
 #endif
 #ifdef MDNS_IP6_SUPPORT
-static const char*                  scpcReverseIP6Domain    = "ip6";
+    static const char* scpcReverseIP6Domain = "ip6";
 #endif
-static const char*                      scpcReverseTopDomain    = "arpa";
+    static const char* scpcReverseTopDomain = "arpa";
 
-/**
+    /**
     TRANSFER
 */
 
-
-/**
+    /**
     SENDING
 */
 
-/*
+    /*
     MDNSResponder::_sendMDNSMessage
 
     Unicast responses are prepared and sent directly to the querier.
@@ -75,82 +72,77 @@ static const char*                      scpcReverseTopDomain    = "arpa";
     Any reply flags in installed services are removed at the end!
 
 */
-bool MDNSResponder::_sendMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
+    bool MDNSResponder::_sendMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        bool bResult = true;
 
-    bool    bResult = true;
+        if (p_rSendParameter.m_bResponse && p_rSendParameter.m_bUnicast)  // Unicast response  -> Send to querier
+        {
+            DEBUG_EX_ERR(if (!m_pUDPContext->getRemoteAddress())
+                         {
+                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: MISSING remote address for response!\n"));
+                         });
+            IPAddress ipRemote;
+            ipRemote = m_pUDPContext->getRemoteAddress();
+            bResult  = ((_prepareMDNSMessage(p_rSendParameter, m_pUDPContext->getInputNetif()->ip_addr)) && (m_pUDPContext->sendTimeout(ipRemote, m_pUDPContext->getRemotePort(), MDNS_UDPCONTEXT_TIMEOUT)));
+        }
+        else  // Multicast response
+        {
+            bResult = _sendMDNSMessage_Multicast(p_rSendParameter);
+        }
 
-    if (p_rSendParameter.m_bResponse &&
-            p_rSendParameter.m_bUnicast)    // Unicast response  -> Send to querier
-    {
-        DEBUG_EX_ERR(if (!m_pUDPContext->getRemoteAddress())
-    {
-        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: MISSING remote address for response!\n"));
-        });
-        IPAddress   ipRemote;
-        ipRemote = m_pUDPContext->getRemoteAddress();
-        bResult = ((_prepareMDNSMessage(p_rSendParameter, m_pUDPContext->getInputNetif()->ip_addr)) &&
-                   (m_pUDPContext->sendTimeout(ipRemote, m_pUDPContext->getRemotePort(), MDNS_UDPCONTEXT_TIMEOUT)));
-    }
-    else                                // Multicast response
-    {
-        bResult = _sendMDNSMessage_Multicast(p_rSendParameter);
-    }
+        // Finally clear service reply masks
+        for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+        {
+            pService->m_u8ReplyMask = 0;
+        }
 
-    // Finally clear service reply masks
-    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
-    {
-        pService->m_u8ReplyMask = 0;
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: FAILED!\n"));
+                     });
+        return bResult;
     }
 
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: FAILED!\n"));
-    });
-    return bResult;
-}
-
-/*
+    /*
     MDNSResponder::_sendMDNSMessage_Multicast
 
     Fills the UDP output buffer (via _prepareMDNSMessage) and sends the buffer
     via the selected WiFi interface (Station or AP)
 */
-bool MDNSResponder::_sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-
-    bool    bResult = false;
-
-    for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
+    bool MDNSResponder::_sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
-        if (netif_is_up(pNetIf))
+        bool bResult = false;
+
+        for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next)
         {
-            IPAddress   fromIPAddress;
-            //fromIPAddress = _getResponseMulticastInterface();
-            fromIPAddress = pNetIf->ip_addr;
-            m_pUDPContext->setMulticastInterface(fromIPAddress);
+            if (netif_is_up(pNetIf))
+            {
+                IPAddress fromIPAddress;
+                //fromIPAddress = _getResponseMulticastInterface();
+                fromIPAddress = pNetIf->ip_addr;
+                m_pUDPContext->setMulticastInterface(fromIPAddress);
 
 #ifdef MDNS_IP4_SUPPORT
-            IPAddress   toMulticastAddress(DNS_MQUERY_IPV4_GROUP_INIT);
+                IPAddress toMulticastAddress(DNS_MQUERY_IPV4_GROUP_INIT);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-            //TODO: set multicast address
-            IPAddress   toMulticastAddress(DNS_MQUERY_IPV6_GROUP_INIT);
+                //TODO: set multicast address
+                IPAddress toMulticastAddress(DNS_MQUERY_IPV6_GROUP_INIT);
 #endif
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: Will send to '%s'.\n"), toMulticastAddress.toString().c_str()););
-            bResult = ((_prepareMDNSMessage(p_rSendParameter, fromIPAddress)) &&
-                       (m_pUDPContext->sendTimeout(toMulticastAddress, DNS_MQUERY_PORT, MDNS_UDPCONTEXT_TIMEOUT)));
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: Will send to '%s'.\n"), toMulticastAddress.toString().c_str()););
+                bResult = ((_prepareMDNSMessage(p_rSendParameter, fromIPAddress)) && (m_pUDPContext->sendTimeout(toMulticastAddress, DNS_MQUERY_PORT, MDNS_UDPCONTEXT_TIMEOUT)));
 
-            DEBUG_EX_ERR(if (!bResult)
-        {
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: FAILED!\n"));
-            });
+                DEBUG_EX_ERR(if (!bResult)
+                             {
+                                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: FAILED!\n"));
+                             });
+            }
         }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_prepareMDNSMessage
 
     The MDNS message is composed in a two-step process.
@@ -159,293 +151,275 @@ bool MDNSResponder::_sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParamet
     output buffer.
 
 */
-bool MDNSResponder::_prepareMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter,
-                                        IPAddress p_IPAddress)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage\n")););
-    bool    bResult = true;
-    p_rSendParameter.clearCachedNames(); // Need to remove cached names, p_SendParameter might have been used before on other interface
-
-    // Prepare header; count answers
-    stcMDNS_MsgHeader  msgHeader(p_rSendParameter.m_u16ID, p_rSendParameter.m_bResponse, 0, p_rSendParameter.m_bAuthorative);
-    // If this is a response, the answers are anwers,
-    // else this is a query or probe and the answers go into auth section
-    uint16_t&           ru16Answers = (p_rSendParameter.m_bResponse
-                                       ? msgHeader.m_u16ANCount
-                                       : msgHeader.m_u16NSCount);
-
-    /**
+    bool MDNSResponder::_prepareMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter,
+                                            IPAddress                            p_IPAddress)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage\n")););
+        bool bResult = true;
+        p_rSendParameter.clearCachedNames();  // Need to remove cached names, p_SendParameter might have been used before on other interface
+
+        // Prepare header; count answers
+        stcMDNS_MsgHeader msgHeader(p_rSendParameter.m_u16ID, p_rSendParameter.m_bResponse, 0, p_rSendParameter.m_bAuthorative);
+        // If this is a response, the answers are anwers,
+        // else this is a query or probe and the answers go into auth section
+        uint16_t& ru16Answers = (p_rSendParameter.m_bResponse
+                                     ? msgHeader.m_u16ANCount
+                                     : msgHeader.m_u16NSCount);
+
+        /**
         enuSequence
     */
-    enum enuSequence
-    {
-        Sequence_Count  = 0,
-        Sequence_Send   = 1
-    };
-
-    // Two step sequence: 'Count' and 'Send'
-    for (uint32_t sequence = Sequence_Count; ((bResult) && (sequence <= Sequence_Send)); ++sequence)
-    {
-        DEBUG_EX_INFO(
-            if (Sequence_Send == sequence)
-    {
-        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
-                              (unsigned)msgHeader.m_u16ID,
-                              (unsigned)msgHeader.m_1bQR, (unsigned)msgHeader.m_4bOpcode, (unsigned)msgHeader.m_1bAA, (unsigned)msgHeader.m_1bTC, (unsigned)msgHeader.m_1bRD,
-                              (unsigned)msgHeader.m_1bRA, (unsigned)msgHeader.m_4bRCode,
-                              (unsigned)msgHeader.m_u16QDCount,
-                              (unsigned)msgHeader.m_u16ANCount,
-                              (unsigned)msgHeader.m_u16NSCount,
-                              (unsigned)msgHeader.m_u16ARCount);
-        }
-        );
-        // Count/send
-        // Header
-        bResult = ((Sequence_Count == sequence)
-                   ? true
-                   : _writeMDNSMsgHeader(msgHeader, p_rSendParameter));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSMsgHeader FAILED!\n")););
-        // Questions
-        for (stcMDNS_RRQuestion* pQuestion = p_rSendParameter.m_pQuestions; ((bResult) && (pQuestion)); pQuestion = pQuestion->m_pNext)
+        enum enuSequence
         {
-            ((Sequence_Count == sequence)
-             ? ++msgHeader.m_u16QDCount
-             : (bResult = _writeMDNSQuestion(*pQuestion, p_rSendParameter)));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSQuestion FAILED!\n")););
-        }
+            Sequence_Count = 0,
+            Sequence_Send  = 1
+        };
 
-        // Answers and authoritative answers
-#ifdef MDNS_IP4_SUPPORT
-        if ((bResult) &&
-                (p_rSendParameter.m_u8HostReplyMask & ContentFlag_A))
+        // Two step sequence: 'Count' and 'Send'
+        for (uint32_t sequence = Sequence_Count; ((bResult) && (sequence <= Sequence_Send)); ++sequence)
         {
-            ((Sequence_Count == sequence)
-             ? ++ru16Answers
-             : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(A) FAILED!\n")););
-        }
-        if ((bResult) &&
-                (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP4))
-        {
-            ((Sequence_Count == sequence)
-             ? ++ru16Answers
-             : (bResult = _writeMDNSAnswer_PTR_IP4(p_IPAddress, p_rSendParameter)));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP4 FAILED!\n")););
-        }
-#endif
-#ifdef MDNS_IP6_SUPPORT
-        if ((bResult) &&
-                (p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA))
-        {
-            ((Sequence_Count == sequence)
-             ? ++ru16Answers
-             : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(A) FAILED!\n")););
-        }
-        if ((bResult) &&
-                (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP6))
-        {
-            ((Sequence_Count == sequence)
-             ? ++ru16Answers
-             : (bResult = _writeMDNSAnswer_PTR_IP6(p_IPAddress, p_rSendParameter)));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP6 FAILED!\n")););
-        }
-#endif
-
-        for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
-        {
-            if ((bResult) &&
-                    (pService->m_u8ReplyMask & ContentFlag_PTR_TYPE))
-            {
-                ((Sequence_Count == sequence)
-                 ? ++ru16Answers
-                 : (bResult = _writeMDNSAnswer_PTR_TYPE(*pService, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_TYPE FAILED!\n")););
-            }
-            if ((bResult) &&
-                    (pService->m_u8ReplyMask & ContentFlag_PTR_NAME))
+            DEBUG_EX_INFO(
+                if (Sequence_Send == sequence)
+                {
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
+                                          (unsigned)msgHeader.m_u16ID,
+                                          (unsigned)msgHeader.m_1bQR, (unsigned)msgHeader.m_4bOpcode, (unsigned)msgHeader.m_1bAA, (unsigned)msgHeader.m_1bTC, (unsigned)msgHeader.m_1bRD,
+                                          (unsigned)msgHeader.m_1bRA, (unsigned)msgHeader.m_4bRCode,
+                                          (unsigned)msgHeader.m_u16QDCount,
+                                          (unsigned)msgHeader.m_u16ANCount,
+                                          (unsigned)msgHeader.m_u16NSCount,
+                                          (unsigned)msgHeader.m_u16ARCount);
+                });
+            // Count/send
+            // Header
+            bResult = ((Sequence_Count == sequence)
+                           ? true
+                           : _writeMDNSMsgHeader(msgHeader, p_rSendParameter));
+            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSMsgHeader FAILED!\n")););
+            // Questions
+            for (stcMDNS_RRQuestion* pQuestion = p_rSendParameter.m_pQuestions; ((bResult) && (pQuestion)); pQuestion = pQuestion->m_pNext)
             {
                 ((Sequence_Count == sequence)
-                 ? ++ru16Answers
-                 : (bResult = _writeMDNSAnswer_PTR_NAME(*pService, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_NAME FAILED!\n")););
+                     ? ++msgHeader.m_u16QDCount
+                     : (bResult = _writeMDNSQuestion(*pQuestion, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSQuestion FAILED!\n")););
             }
-            if ((bResult) &&
-                    (pService->m_u8ReplyMask & ContentFlag_SRV))
+
+            // Answers and authoritative answers
+#ifdef MDNS_IP4_SUPPORT
+            if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_A))
             {
                 ((Sequence_Count == sequence)
-                 ? ++ru16Answers
-                 : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(A) FAILED!\n")););
+                     ? ++ru16Answers
+                     : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(A) FAILED!\n")););
             }
-            if ((bResult) &&
-                    (pService->m_u8ReplyMask & ContentFlag_TXT))
+            if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP4))
             {
                 ((Sequence_Count == sequence)
-                 ? ++ru16Answers
-                 : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(A) FAILED!\n")););
+                     ? ++ru16Answers
+                     : (bResult = _writeMDNSAnswer_PTR_IP4(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP4 FAILED!\n")););
             }
-        }   // for services
-
-        // Additional answers
-#ifdef MDNS_IP4_SUPPORT
-        bool    bNeedsAdditionalAnswerA = false;
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        bool    bNeedsAdditionalAnswerAAAA = false;
-#endif
-        for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
-        {
-            if ((bResult) &&
-                    (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) && // If PTR_NAME is requested, AND
-                    (!(pService->m_u8ReplyMask & ContentFlag_SRV)))     // NOT SRV -> add SRV as additional answer
+            if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA))
             {
                 ((Sequence_Count == sequence)
-                 ? ++msgHeader.m_u16ARCount
-                 : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(B) FAILED!\n")););
+                     ? ++ru16Answers
+                     : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(A) FAILED!\n")););
             }
-            if ((bResult) &&
-                    (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) && // If PTR_NAME is requested, AND
-                    (!(pService->m_u8ReplyMask & ContentFlag_TXT)))     // NOT TXT -> add TXT as additional answer
+            if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP6))
             {
                 ((Sequence_Count == sequence)
-                 ? ++msgHeader.m_u16ARCount
-                 : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(B) FAILED!\n")););
+                     ? ++ru16Answers
+                     : (bResult = _writeMDNSAnswer_PTR_IP6(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP6 FAILED!\n")););
             }
-            if ((pService->m_u8ReplyMask & (ContentFlag_PTR_NAME | ContentFlag_SRV)) ||         // If service instance name or SRV OR
-                    (p_rSendParameter.m_u8HostReplyMask & (ContentFlag_A | ContentFlag_AAAA)))      // any host IP address is requested
+#endif
+
+            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
             {
-#ifdef MDNS_IP4_SUPPORT
-                if ((bResult) &&
-                        (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_A)))            // Add IP4 address
+                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_TYPE))
+                {
+                    ((Sequence_Count == sequence)
+                         ? ++ru16Answers
+                         : (bResult = _writeMDNSAnswer_PTR_TYPE(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_TYPE FAILED!\n")););
+                }
+                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME))
+                {
+                    ((Sequence_Count == sequence)
+                         ? ++ru16Answers
+                         : (bResult = _writeMDNSAnswer_PTR_NAME(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_NAME FAILED!\n")););
+                }
+                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_SRV))
                 {
-                    bNeedsAdditionalAnswerA = true;
+                    ((Sequence_Count == sequence)
+                         ? ++ru16Answers
+                         : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(A) FAILED!\n")););
                 }
+                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_TXT))
+                {
+                    ((Sequence_Count == sequence)
+                         ? ++ru16Answers
+                         : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(A) FAILED!\n")););
+                }
+            }  // for services
+
+            // Additional answers
+#ifdef MDNS_IP4_SUPPORT
+            bool bNeedsAdditionalAnswerA = false;
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                if ((bResult) &&
-                        (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA)))         // Add IP6 address
+            bool bNeedsAdditionalAnswerAAAA = false;
+#endif
+            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+            {
+                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) &&  // If PTR_NAME is requested, AND
+                    (!(pService->m_u8ReplyMask & ContentFlag_SRV)))                   // NOT SRV -> add SRV as additional answer
+                {
+                    ((Sequence_Count == sequence)
+                         ? ++msgHeader.m_u16ARCount
+                         : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(B) FAILED!\n")););
+                }
+                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) &&  // If PTR_NAME is requested, AND
+                    (!(pService->m_u8ReplyMask & ContentFlag_TXT)))                   // NOT TXT -> add TXT as additional answer
                 {
-                    bNeedsAdditionalAnswerAAAA = true;
+                    ((Sequence_Count == sequence)
+                         ? ++msgHeader.m_u16ARCount
+                         : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(B) FAILED!\n")););
                 }
+                if ((pService->m_u8ReplyMask & (ContentFlag_PTR_NAME | ContentFlag_SRV)) ||     // If service instance name or SRV OR
+                    (p_rSendParameter.m_u8HostReplyMask & (ContentFlag_A | ContentFlag_AAAA)))  // any host IP address is requested
+                {
+#ifdef MDNS_IP4_SUPPORT
+                    if ((bResult) && (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_A)))  // Add IP4 address
+                    {
+                        bNeedsAdditionalAnswerA = true;
+                    }
 #endif
-            }
-        }   // for services
+#ifdef MDNS_IP6_SUPPORT
+                    if ((bResult) && (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA)))  // Add IP6 address
+                    {
+                        bNeedsAdditionalAnswerAAAA = true;
+                    }
+#endif
+                }
+            }  // for services
 
-        // Answer A needed?
+            // Answer A needed?
 #ifdef MDNS_IP4_SUPPORT
-        if ((bResult) &&
-                (bNeedsAdditionalAnswerA))
-        {
-            ((Sequence_Count == sequence)
-             ? ++msgHeader.m_u16ARCount
-             : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(B) FAILED!\n")););
-        }
+            if ((bResult) && (bNeedsAdditionalAnswerA))
+            {
+                ((Sequence_Count == sequence)
+                     ? ++msgHeader.m_u16ARCount
+                     : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(B) FAILED!\n")););
+            }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-        // Answer AAAA needed?
-        if ((bResult) &&
-                (bNeedsAdditionalAnswerAAAA))
-        {
-            ((Sequence_Count == sequence)
-             ? ++msgHeader.m_u16ARCount
-             : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(B) FAILED!\n")););
-        }
+            // Answer AAAA needed?
+            if ((bResult) && (bNeedsAdditionalAnswerAAAA))
+            {
+                ((Sequence_Count == sequence)
+                     ? ++msgHeader.m_u16ARCount
+                     : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(B) FAILED!\n")););
+            }
 #endif
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: Loop %i FAILED!\n"), sequence););
-    }   // for sequence
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: FAILED!\n")););
-    return bResult;
-}
+            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: Loop %i FAILED!\n"), sequence););
+        }  // for sequence
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_sendMDNSServiceQuery
 
     Creates and sends a PTR query for the given service domain.
 
 */
-bool MDNSResponder::_sendMDNSServiceQuery(const MDNSResponder::stcMDNSServiceQuery& p_ServiceQuery)
-{
-
-    return _sendMDNSQuery(p_ServiceQuery.m_ServiceTypeDomain, DNS_RRTYPE_PTR);
-}
+    bool MDNSResponder::_sendMDNSServiceQuery(const MDNSResponder::stcMDNSServiceQuery& p_ServiceQuery)
+    {
+        return _sendMDNSQuery(p_ServiceQuery.m_ServiceTypeDomain, DNS_RRTYPE_PTR);
+    }
 
-/*
+    /*
     MDNSResponder::_sendMDNSQuery
 
     Creates and sends a query for the given domain and query type.
 
 */
-bool MDNSResponder::_sendMDNSQuery(const MDNSResponder::stcMDNS_RRDomain& p_QueryDomain,
-                                   uint16_t p_u16QueryType,
-                                   stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers /*= 0*/)
-{
-
-    bool                    bResult = false;
-
-    stcMDNSSendParameter    sendParameter;
-    if (0 != ((sendParameter.m_pQuestions = new stcMDNS_RRQuestion)))
+    bool MDNSResponder::_sendMDNSQuery(const MDNSResponder::stcMDNS_RRDomain& p_QueryDomain,
+                                       uint16_t                               p_u16QueryType,
+                                       stcMDNSServiceQuery::stcAnswer*        p_pKnownAnswers /*= 0*/)
     {
-        sendParameter.m_pQuestions->m_Header.m_Domain = p_QueryDomain;
+        bool bResult = false;
 
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = p_u16QueryType;
-        // It seems, that some mDNS implementations don't support 'unicast response' questions...
-        sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (/*0x8000 |*/ DNS_RRCLASS_IN);   // /*Unicast &*/ INternet
+        stcMDNSSendParameter sendParameter;
+        if (0 != ((sendParameter.m_pQuestions = new stcMDNS_RRQuestion)))
+        {
+            sendParameter.m_pQuestions->m_Header.m_Domain = p_QueryDomain;
 
-        // TODO: Add known answer to the query
-        (void)p_pKnownAnswers;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = p_u16QueryType;
+            // It seems, that some mDNS implementations don't support 'unicast response' questions...
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (/*0x8000 |*/ DNS_RRCLASS_IN);  // /*Unicast &*/ INternet
 
-        bResult = _sendMDNSMessage(sendParameter);
-    }   // else: FAILED to alloc question
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSQuery: FAILED to alloc question!\n")););
-    return bResult;
-}
+            // TODO: Add known answer to the query
+            (void)p_pKnownAnswers;
+
+            bResult = _sendMDNSMessage(sendParameter);
+        }  // else: FAILED to alloc question
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSQuery: FAILED to alloc question!\n")););
+        return bResult;
+    }
 
-/**
+    /**
     HELPERS
 */
 
-/**
+    /**
     RESOURCE RECORDS
 */
 
-/*
+    /*
     MDNSResponder::_readRRQuestion
 
     Reads a question (eg. MyESP._http._tcp.local ANY IN) from the UPD input buffer.
 
 */
-bool MDNSResponder::_readRRQuestion(MDNSResponder::stcMDNS_RRQuestion& p_rRRQuestion)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion\n")););
+    bool MDNSResponder::_readRRQuestion(MDNSResponder::stcMDNS_RRQuestion& p_rRRQuestion)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion\n")););
 
-    bool    bResult = false;
+        bool bResult = false;
 
-    if ((bResult = _readRRHeader(p_rRRQuestion.m_Header)))
-    {
-        // Extract unicast flag from class field
-        p_rRRQuestion.m_bUnicast = (p_rRRQuestion.m_Header.m_Attributes.m_u16Class & 0x8000);
-        p_rRRQuestion.m_Header.m_Attributes.m_u16Class &= (~0x8000);
-
-        DEBUG_EX_INFO(
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion "));
-            _printRRDomain(p_rRRQuestion.m_Header.m_Domain);
-            DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X %s\n"), (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Type, (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Class, (p_rRRQuestion.m_bUnicast ? "Unicast" : "Multicast"));
-        );
+        if ((bResult = _readRRHeader(p_rRRQuestion.m_Header)))
+        {
+            // Extract unicast flag from class field
+            p_rRRQuestion.m_bUnicast = (p_rRRQuestion.m_Header.m_Attributes.m_u16Class & 0x8000);
+            p_rRRQuestion.m_Header.m_Attributes.m_u16Class &= (~0x8000);
+
+            DEBUG_EX_INFO(
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion "));
+                _printRRDomain(p_rRRQuestion.m_Header.m_Domain);
+                DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X %s\n"), (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Type, (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Class, (p_rRRQuestion.m_bUnicast ? "Unicast" : "Multicast")););
+        }
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion: FAILED!\n"));
+                     });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion: FAILED!\n"));
-    });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_readRRAnswer
 
     Reads an answer (eg. _http._tcp.local PTR OP TTL MyESP._http._tcp.local)
@@ -456,335 +430,307 @@ bool MDNSResponder::_readRRQuestion(MDNSResponder::stcMDNS_RRQuestion& p_rRRQues
     from the input buffer).
 
 */
-bool MDNSResponder::_readRRAnswer(MDNSResponder::stcMDNS_RRAnswer*& p_rpRRAnswer)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer\n")););
-
-    bool    bResult = false;
-
-    stcMDNS_RRHeader    header;
-    uint32_t            u32TTL;
-    uint16_t            u16RDLength;
-    if ((_readRRHeader(header)) &&
-            (_udpRead32(u32TTL)) &&
-            (_udpRead16(u16RDLength)))
+    bool MDNSResponder::_readRRAnswer(MDNSResponder::stcMDNS_RRAnswer*& p_rpRRAnswer)
     {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer\n")););
+
+        bool bResult = false;
 
-        /*  DEBUG_EX_INFO(
+        stcMDNS_RRHeader header;
+        uint32_t         u32TTL;
+        uint16_t         u16RDLength;
+        if ((_readRRHeader(header)) && (_udpRead32(u32TTL)) && (_udpRead16(u16RDLength)))
+        {
+            /*  DEBUG_EX_INFO(
                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: Reading 0x%04X answer (class:0x%04X, TTL:%u, RDLength:%u) for "), header.m_Attributes.m_u16Type, header.m_Attributes.m_u16Class, u32TTL, u16RDLength);
                 _printRRDomain(header.m_Domain);
                 DEBUG_OUTPUT.printf_P(PSTR("\n"));
                 );*/
 
-        switch (header.m_Attributes.m_u16Type & (~0x8000))      // Topmost bit might carry 'cache flush' flag
-        {
-#ifdef MDNS_IP4_SUPPORT
-        case DNS_RRTYPE_A:
-            p_rpRRAnswer = new stcMDNS_RRAnswerA(header, u32TTL);
-            bResult = _readRRAnswerA(*(stcMDNS_RRAnswerA*&)p_rpRRAnswer, u16RDLength);
-            break;
-#endif
-        case DNS_RRTYPE_PTR:
-            p_rpRRAnswer = new stcMDNS_RRAnswerPTR(header, u32TTL);
-            bResult = _readRRAnswerPTR(*(stcMDNS_RRAnswerPTR*&)p_rpRRAnswer, u16RDLength);
-            break;
-        case DNS_RRTYPE_TXT:
-            p_rpRRAnswer = new stcMDNS_RRAnswerTXT(header, u32TTL);
-            bResult = _readRRAnswerTXT(*(stcMDNS_RRAnswerTXT*&)p_rpRRAnswer, u16RDLength);
-            break;
-#ifdef MDNS_IP6_SUPPORT
-        case DNS_RRTYPE_AAAA:
-            p_rpRRAnswer = new stcMDNS_RRAnswerAAAA(header, u32TTL);
-            bResult = _readRRAnswerAAAA(*(stcMDNS_RRAnswerAAAA*&)p_rpRRAnswer, u16RDLength);
-            break;
-#endif
-        case DNS_RRTYPE_SRV:
-            p_rpRRAnswer = new stcMDNS_RRAnswerSRV(header, u32TTL);
-            bResult = _readRRAnswerSRV(*(stcMDNS_RRAnswerSRV*&)p_rpRRAnswer, u16RDLength);
-            break;
-        default:
-            p_rpRRAnswer = new stcMDNS_RRAnswerGeneric(header, u32TTL);
-            bResult = _readRRAnswerGeneric(*(stcMDNS_RRAnswerGeneric*&)p_rpRRAnswer, u16RDLength);
-            break;
-        }
-        DEBUG_EX_INFO(
-            if ((bResult) &&
-                (p_rpRRAnswer))
-    {
-        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: "));
-            _printRRDomain(p_rpRRAnswer->m_Header.m_Domain);
-            DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, RDLength:%u "), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type, p_rpRRAnswer->m_Header.m_Attributes.m_u16Class, p_rpRRAnswer->m_u32TTL, u16RDLength);
-            switch (header.m_Attributes.m_u16Type & (~0x8000))      // Topmost bit might carry 'cache flush' flag
+            switch (header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
             {
 #ifdef MDNS_IP4_SUPPORT
             case DNS_RRTYPE_A:
-                DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
+                p_rpRRAnswer = new stcMDNS_RRAnswerA(header, u32TTL);
+                bResult      = _readRRAnswerA(*(stcMDNS_RRAnswerA*&)p_rpRRAnswer, u16RDLength);
                 break;
 #endif
             case DNS_RRTYPE_PTR:
-                DEBUG_OUTPUT.printf_P(PSTR("PTR "));
-                _printRRDomain(((stcMDNS_RRAnswerPTR*&)p_rpRRAnswer)->m_PTRDomain);
+                p_rpRRAnswer = new stcMDNS_RRAnswerPTR(header, u32TTL);
+                bResult      = _readRRAnswerPTR(*(stcMDNS_RRAnswerPTR*&)p_rpRRAnswer, u16RDLength);
                 break;
             case DNS_RRTYPE_TXT:
-            {
-                size_t  stTxtLength = ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_strLength();
-                char*   pTxts = new char[stTxtLength];
-                if (pTxts)
-                {
-                    ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_str(pTxts);
-                    DEBUG_OUTPUT.printf_P(PSTR("TXT(%zu) %s"), stTxtLength, pTxts);
-                    delete[] pTxts;
-                }
+                p_rpRRAnswer = new stcMDNS_RRAnswerTXT(header, u32TTL);
+                bResult      = _readRRAnswerTXT(*(stcMDNS_RRAnswerTXT*&)p_rpRRAnswer, u16RDLength);
                 break;
-            }
 #ifdef MDNS_IP6_SUPPORT
             case DNS_RRTYPE_AAAA:
-                DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
+                p_rpRRAnswer = new stcMDNS_RRAnswerAAAA(header, u32TTL);
+                bResult      = _readRRAnswerAAAA(*(stcMDNS_RRAnswerAAAA*&)p_rpRRAnswer, u16RDLength);
                 break;
 #endif
             case DNS_RRTYPE_SRV:
-                DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_u16Port);
-                _printRRDomain(((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_SRVDomain);
+                p_rpRRAnswer = new stcMDNS_RRAnswerSRV(header, u32TTL);
+                bResult      = _readRRAnswerSRV(*(stcMDNS_RRAnswerSRV*&)p_rpRRAnswer, u16RDLength);
                 break;
             default:
-                DEBUG_OUTPUT.printf_P(PSTR("generic "));
+                p_rpRRAnswer = new stcMDNS_RRAnswerGeneric(header, u32TTL);
+                bResult      = _readRRAnswerGeneric(*(stcMDNS_RRAnswerGeneric*&)p_rpRRAnswer, u16RDLength);
                 break;
             }
-            DEBUG_OUTPUT.printf_P(PSTR("\n"));
-        }
-        else
-        {
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED to read specific answer of type 0x%04X!\n"), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type);
+            DEBUG_EX_INFO(
+                if ((bResult) && (p_rpRRAnswer))
+                {
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: "));
+                    _printRRDomain(p_rpRRAnswer->m_Header.m_Domain);
+                    DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, RDLength:%u "), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type, p_rpRRAnswer->m_Header.m_Attributes.m_u16Class, p_rpRRAnswer->m_u32TTL, u16RDLength);
+                    switch (header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
+                    {
+#ifdef MDNS_IP4_SUPPORT
+                    case DNS_RRTYPE_A:
+                        DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
+                        break;
+#endif
+                    case DNS_RRTYPE_PTR:
+                        DEBUG_OUTPUT.printf_P(PSTR("PTR "));
+                        _printRRDomain(((stcMDNS_RRAnswerPTR*&)p_rpRRAnswer)->m_PTRDomain);
+                        break;
+                    case DNS_RRTYPE_TXT:
+                    {
+                        size_t stTxtLength = ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_strLength();
+                        char*  pTxts       = new char[stTxtLength];
+                        if (pTxts)
+                        {
+                            ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_str(pTxts);
+                            DEBUG_OUTPUT.printf_P(PSTR("TXT(%zu) %s"), stTxtLength, pTxts);
+                            delete[] pTxts;
+                        }
+                        break;
+                    }
+#ifdef MDNS_IP6_SUPPORT
+                    case DNS_RRTYPE_AAAA:
+                        DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
+                        break;
+#endif
+                    case DNS_RRTYPE_SRV:
+                        DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_u16Port);
+                        _printRRDomain(((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_SRVDomain);
+                        break;
+                    default:
+                        DEBUG_OUTPUT.printf_P(PSTR("generic "));
+                        break;
+                    }
+                    DEBUG_OUTPUT.printf_P(PSTR("\n"));
+                } else
+                {
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED to read specific answer of type 0x%04X!\n"), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type);
+                });  // DEBUG_EX_INFO
         }
-        );  // DEBUG_EX_INFO
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED!\n")););
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED!\n")););
-    return bResult;
-}
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::_readRRAnswerA
 */
-bool MDNSResponder::_readRRAnswerA(MDNSResponder::stcMDNS_RRAnswerA& p_rRRAnswerA,
-                                   uint16_t p_u16RDLength)
-{
-
-    uint32_t    u32IP4Address;
-    bool        bResult = ((MDNS_IP4_SIZE == p_u16RDLength) &&
-                           (_udpReadBuffer((unsigned char*)&u32IP4Address, MDNS_IP4_SIZE)) &&
-                           ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IP4Address))));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerA: FAILED!\n")););
-    return bResult;
-}
+    bool MDNSResponder::_readRRAnswerA(MDNSResponder::stcMDNS_RRAnswerA& p_rRRAnswerA,
+                                       uint16_t                          p_u16RDLength)
+    {
+        uint32_t u32IP4Address;
+        bool     bResult = ((MDNS_IP4_SIZE == p_u16RDLength) && (_udpReadBuffer((unsigned char*)&u32IP4Address, MDNS_IP4_SIZE)) && ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IP4Address))));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerA: FAILED!\n")););
+        return bResult;
+    }
 #endif
 
-/*
+    /*
     MDNSResponder::_readRRAnswerPTR
 */
-bool MDNSResponder::_readRRAnswerPTR(MDNSResponder::stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
-                                     uint16_t p_u16RDLength)
-{
-
-    bool    bResult = ((p_u16RDLength) &&
-                       (_readRRDomain(p_rRRAnswerPTR.m_PTRDomain)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerPTR: FAILED!\n")););
-    return bResult;
-}
+    bool MDNSResponder::_readRRAnswerPTR(MDNSResponder::stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
+                                         uint16_t                            p_u16RDLength)
+    {
+        bool bResult = ((p_u16RDLength) && (_readRRDomain(p_rRRAnswerPTR.m_PTRDomain)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerPTR: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_readRRAnswerTXT
 
     Read TXT items from a buffer like 4c#=15ff=20
 */
-bool MDNSResponder::_readRRAnswerTXT(MDNSResponder::stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
-                                     uint16_t p_u16RDLength)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: RDLength:%u\n"), p_u16RDLength););
-    bool    bResult = true;
-
-    p_rRRAnswerTXT.clear();
-    if (p_u16RDLength)
+    bool MDNSResponder::_readRRAnswerTXT(MDNSResponder::stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
+                                         uint16_t                            p_u16RDLength)
     {
-        bResult = false;
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: RDLength:%u\n"), p_u16RDLength););
+        bool bResult = true;
 
-        unsigned char*  pucBuffer = new unsigned char[p_u16RDLength];
-        if (pucBuffer)
+        p_rRRAnswerTXT.clear();
+        if (p_u16RDLength)
         {
-            if (_udpReadBuffer(pucBuffer, p_u16RDLength))
-            {
-                bResult = true;
+            bResult = false;
 
-                const unsigned char*    pucCursor = pucBuffer;
-                while ((pucCursor < (pucBuffer + p_u16RDLength)) &&
-                        (bResult))
+            unsigned char* pucBuffer = new unsigned char[p_u16RDLength];
+            if (pucBuffer)
+            {
+                if (_udpReadBuffer(pucBuffer, p_u16RDLength))
                 {
-                    bResult = false;
+                    bResult = true;
 
-                    stcMDNSServiceTxt*      pTxt = 0;
-                    unsigned char   ucLength = *pucCursor++;    // Length of the next txt item
-                    if (ucLength)
+                    const unsigned char* pucCursor = pucBuffer;
+                    while ((pucCursor < (pucBuffer + p_u16RDLength)) && (bResult))
                     {
-                        DEBUG_EX_INFO(
-                            static char sacBuffer[64]; *sacBuffer = 0;
-                            uint8_t u8MaxLength = ((ucLength > (sizeof(sacBuffer) - 1)) ? (sizeof(sacBuffer) - 1) : ucLength);
-                            os_strncpy(sacBuffer, (const char*)pucCursor, u8MaxLength); sacBuffer[u8MaxLength] = 0;
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: Item(%u): %s\n"), ucLength, sacBuffer);
-                        );
-
-                        unsigned char*  pucEqualSign = (unsigned char*)os_strchr((const char*)pucCursor, '=');  // Position of the '=' sign
-                        unsigned char   ucKeyLength;
-                        if ((pucEqualSign) &&
-                                ((ucKeyLength = (pucEqualSign - pucCursor))))
+                        bResult = false;
+
+                        stcMDNSServiceTxt* pTxt     = 0;
+                        unsigned char      ucLength = *pucCursor++;  // Length of the next txt item
+                        if (ucLength)
                         {
-                            unsigned char   ucValueLength = (ucLength - (pucEqualSign - pucCursor + 1));
-                            bResult = (((pTxt = new stcMDNSServiceTxt)) &&
-                                       (pTxt->setKey((const char*)pucCursor, ucKeyLength)) &&
-                                       (pTxt->setValue((const char*)(pucEqualSign + 1), ucValueLength)));
+                            DEBUG_EX_INFO(
+                                static char sacBuffer[64]; *sacBuffer                                              = 0;
+                                uint8_t     u8MaxLength                                                            = ((ucLength > (sizeof(sacBuffer) - 1)) ? (sizeof(sacBuffer) - 1) : ucLength);
+                                os_strncpy(sacBuffer, (const char*)pucCursor, u8MaxLength); sacBuffer[u8MaxLength] = 0;
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: Item(%u): %s\n"), ucLength, sacBuffer););
+
+                            unsigned char* pucEqualSign = (unsigned char*)os_strchr((const char*)pucCursor, '=');  // Position of the '=' sign
+                            unsigned char  ucKeyLength;
+                            if ((pucEqualSign) && ((ucKeyLength = (pucEqualSign - pucCursor))))
+                            {
+                                unsigned char ucValueLength = (ucLength - (pucEqualSign - pucCursor + 1));
+                                bResult                     = (((pTxt = new stcMDNSServiceTxt)) && (pTxt->setKey((const char*)pucCursor, ucKeyLength)) && (pTxt->setValue((const char*)(pucEqualSign + 1), ucValueLength)));
+                            }
+                            else
+                            {
+                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: INVALID TXT format (No '=')!\n")););
+                            }
+                            pucCursor += ucLength;
                         }
-                        else
+                        else  // no/zero length TXT
                         {
-                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: INVALID TXT format (No '=')!\n")););
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: TXT answer contains no items.\n")););
+                            bResult = true;
                         }
-                        pucCursor += ucLength;
-                    }
-                    else    // no/zero length TXT
-                    {
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: TXT answer contains no items.\n")););
-                        bResult = true;
-                    }
 
-                    if ((bResult) &&
-                            (pTxt))     // Everything is fine so far
-                    {
-                        // Link TXT item to answer TXTs
-                        pTxt->m_pNext = p_rRRAnswerTXT.m_Txts.m_pTxts;
-                        p_rRRAnswerTXT.m_Txts.m_pTxts = pTxt;
-                    }
-                    else            // At least no TXT (might be OK, if length was 0) OR an error
-                    {
-                        if (!bResult)
+                        if ((bResult) && (pTxt))  // Everything is fine so far
                         {
-                            DEBUG_EX_ERR(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT item!\n"));
-                                DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
-                                _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
-                                DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                            );
+                            // Link TXT item to answer TXTs
+                            pTxt->m_pNext                 = p_rRRAnswerTXT.m_Txts.m_pTxts;
+                            p_rRRAnswerTXT.m_Txts.m_pTxts = pTxt;
                         }
-                        if (pTxt)
+                        else  // At least no TXT (might be OK, if length was 0) OR an error
                         {
-                            delete pTxt;
-                            pTxt = 0;
+                            if (!bResult)
+                            {
+                                DEBUG_EX_ERR(
+                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT item!\n"));
+                                    DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
+                                    _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
+                                    DEBUG_OUTPUT.printf_P(PSTR("\n")););
+                            }
+                            if (pTxt)
+                            {
+                                delete pTxt;
+                                pTxt = 0;
+                            }
+                            p_rRRAnswerTXT.clear();
                         }
-                        p_rRRAnswerTXT.clear();
-                    }
-                }   // while
+                    }  // while
 
-                DEBUG_EX_ERR(
-                    if (!bResult)   // Some failure
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
-                    _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
-                    DEBUG_OUTPUT.printf_P(PSTR("\n"));
+                    DEBUG_EX_ERR(
+                        if (!bResult)  // Some failure
+                        {
+                            DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
+                            _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
+                            DEBUG_OUTPUT.printf_P(PSTR("\n"));
+                        });
+                }
+                else
+                {
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT content!\n")););
                 }
-                );
+                // Clean up
+                delete[] pucBuffer;
             }
             else
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT content!\n")););
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to alloc buffer for TXT content!\n")););
             }
-            // Clean up
-            delete[] pucBuffer;
         }
         else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to alloc buffer for TXT content!\n")););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: WARNING! No content!\n")););
         }
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED!\n")););
+        return bResult;
     }
-    else
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: WARNING! No content!\n")););
-    }
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED!\n")););
-    return bResult;
-}
 
 #ifdef MDNS_IP6_SUPPORT
-bool MDNSResponder::_readRRAnswerAAAA(MDNSResponder::stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
-                                      uint16_t p_u16RDLength)
-{
-    bool    bResult = false;
-    // TODO: Implement
-    return bResult;
-}
+    bool MDNSResponder::_readRRAnswerAAAA(MDNSResponder::stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
+                                          uint16_t                             p_u16RDLength)
+    {
+        bool bResult = false;
+        // TODO: Implement
+        return bResult;
+    }
 #endif
 
-/*
+    /*
     MDNSResponder::_readRRAnswerSRV
 */
-bool MDNSResponder::_readRRAnswerSRV(MDNSResponder::stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
-                                     uint16_t p_u16RDLength)
-{
-
-    bool    bResult = (((3 * sizeof(uint16_t)) < p_u16RDLength) &&
-                       (_udpRead16(p_rRRAnswerSRV.m_u16Priority)) &&
-                       (_udpRead16(p_rRRAnswerSRV.m_u16Weight)) &&
-                       (_udpRead16(p_rRRAnswerSRV.m_u16Port)) &&
-                       (_readRRDomain(p_rRRAnswerSRV.m_SRVDomain)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerSRV: FAILED!\n")););
-    return bResult;
-}
+    bool MDNSResponder::_readRRAnswerSRV(MDNSResponder::stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
+                                         uint16_t                            p_u16RDLength)
+    {
+        bool bResult = (((3 * sizeof(uint16_t)) < p_u16RDLength) && (_udpRead16(p_rRRAnswerSRV.m_u16Priority)) && (_udpRead16(p_rRRAnswerSRV.m_u16Weight)) && (_udpRead16(p_rRRAnswerSRV.m_u16Port)) && (_readRRDomain(p_rRRAnswerSRV.m_SRVDomain)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerSRV: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_readRRAnswerGeneric
 */
-bool MDNSResponder::_readRRAnswerGeneric(MDNSResponder::stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
-        uint16_t p_u16RDLength)
-{
-    bool    bResult = (0 == p_u16RDLength);
-
-    p_rRRAnswerGeneric.clear();
-    if (((p_rRRAnswerGeneric.m_u16RDLength = p_u16RDLength)) &&
-            ((p_rRRAnswerGeneric.m_pu8RDData = new unsigned char[p_rRRAnswerGeneric.m_u16RDLength])))
+    bool MDNSResponder::_readRRAnswerGeneric(MDNSResponder::stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
+                                             uint16_t                                p_u16RDLength)
     {
+        bool bResult = (0 == p_u16RDLength);
 
-        bResult = _udpReadBuffer(p_rRRAnswerGeneric.m_pu8RDData, p_rRRAnswerGeneric.m_u16RDLength);
+        p_rRRAnswerGeneric.clear();
+        if (((p_rRRAnswerGeneric.m_u16RDLength = p_u16RDLength)) && ((p_rRRAnswerGeneric.m_pu8RDData = new unsigned char[p_rRRAnswerGeneric.m_u16RDLength])))
+        {
+            bResult = _udpReadBuffer(p_rRRAnswerGeneric.m_pu8RDData, p_rRRAnswerGeneric.m_u16RDLength);
+        }
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerGeneric: FAILED!\n")););
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerGeneric: FAILED!\n")););
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_readRRHeader
 */
-bool MDNSResponder::_readRRHeader(MDNSResponder::stcMDNS_RRHeader& p_rRRHeader)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader\n")););
+    bool MDNSResponder::_readRRHeader(MDNSResponder::stcMDNS_RRHeader& p_rRRHeader)
+    {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader\n")););
 
-    bool    bResult = ((_readRRDomain(p_rRRHeader.m_Domain)) &&
-                       (_readRRAttributes(p_rRRHeader.m_Attributes)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader: FAILED!\n")););
-    return bResult;
-}
+        bool bResult = ((_readRRDomain(p_rRRHeader.m_Domain)) && (_readRRAttributes(p_rRRHeader.m_Attributes)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_readRRDomain
 
     Reads a (maybe multilevel compressed) domain from the UDP input buffer.
 
 */
-bool MDNSResponder::_readRRDomain(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain\n")););
+    bool MDNSResponder::_readRRDomain(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain)
+    {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain\n")););
 
-    bool    bResult = ((p_rRRDomain.clear()) &&
-                       (_readRRDomain_Loop(p_rRRDomain, 0)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain: FAILED!\n")););
-    return bResult;
-}
+        bool bResult = ((p_rRRDomain.clear()) && (_readRRDomain_Loop(p_rRRDomain, 0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_readRRDomain_Loop
 
     Reads a domain from the UDP input buffer. For every compression level, the functions
@@ -792,412 +738,363 @@ bool MDNSResponder::_readRRDomain(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain)
     the maximum recursion depth is set by MDNS_DOMAIN_MAX_REDIRCTION.
 
 */
-bool MDNSResponder::_readRRDomain_Loop(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain,
-                                       uint8_t p_u8Depth)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u)\n"), p_u8Depth););
-
-    bool    bResult = false;
-
-    if (MDNS_DOMAIN_MAX_REDIRCTION >= p_u8Depth)
+    bool MDNSResponder::_readRRDomain_Loop(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain,
+                                           uint8_t                          p_u8Depth)
     {
-        bResult = true;
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u)\n"), p_u8Depth););
+
+        bool bResult = false;
 
-        uint8_t u8Len = 0;
-        do
+        if (MDNS_DOMAIN_MAX_REDIRCTION >= p_u8Depth)
         {
-            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Offset:%u p0:%02x\n"), p_u8Depth, m_pUDPContext->tell(), m_pUDPContext->peek()););
-            _udpRead8(u8Len);
+            bResult = true;
 
-            if (u8Len & MDNS_DOMAIN_COMPRESS_MARK)
+            uint8_t u8Len = 0;
+            do
             {
-                // Compressed label(s)
-                uint16_t    u16Offset = ((u8Len & ~MDNS_DOMAIN_COMPRESS_MARK) << 8);    // Implicit BE to LE conversion!
+                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Offset:%u p0:%02x\n"), p_u8Depth, m_pUDPContext->tell(), m_pUDPContext->peek()););
                 _udpRead8(u8Len);
-                u16Offset |= u8Len;
 
-                if (m_pUDPContext->isValidOffset(u16Offset))
+                if (u8Len & MDNS_DOMAIN_COMPRESS_MARK)
                 {
-                    size_t  stCurrentPosition = m_pUDPContext->tell();      // Prepare return from recursion
+                    // Compressed label(s)
+                    uint16_t u16Offset = ((u8Len & ~MDNS_DOMAIN_COMPRESS_MARK) << 8);  // Implicit BE to LE conversion!
+                    _udpRead8(u8Len);
+                    u16Offset |= u8Len;
 
-                    //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Redirecting from %u to %u!\n"), p_u8Depth, stCurrentPosition, u16Offset););
-                    m_pUDPContext->seek(u16Offset);
-                    if (_readRRDomain_Loop(p_rRRDomain, p_u8Depth + 1))     // Do recursion
+                    if (m_pUDPContext->isValidOffset(u16Offset))
                     {
-                        //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Succeeded to read redirected label! Returning to %u\n"), p_u8Depth, stCurrentPosition););
-                        m_pUDPContext->seek(stCurrentPosition);             // Restore after recursion
+                        size_t stCurrentPosition = m_pUDPContext->tell();  // Prepare return from recursion
+
+                        //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Redirecting from %u to %u!\n"), p_u8Depth, stCurrentPosition, u16Offset););
+                        m_pUDPContext->seek(u16Offset);
+                        if (_readRRDomain_Loop(p_rRRDomain, p_u8Depth + 1))  // Do recursion
+                        {
+                            //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Succeeded to read redirected label! Returning to %u\n"), p_u8Depth, stCurrentPosition););
+                            m_pUDPContext->seek(stCurrentPosition);  // Restore after recursion
+                        }
+                        else
+                        {
+                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): FAILED to read redirected label!\n"), p_u8Depth););
+                            bResult = false;
+                        }
                     }
                     else
                     {
-                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): FAILED to read redirected label!\n"), p_u8Depth););
+                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): INVALID offset in redirection!\n"), p_u8Depth););
                         bResult = false;
                     }
+                    break;
                 }
                 else
                 {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): INVALID offset in redirection!\n"), p_u8Depth););
-                    bResult = false;
-                }
-                break;
-            }
-            else
-            {
-                // Normal (uncompressed) label (maybe '\0' only)
-                if (MDNS_DOMAIN_MAXLENGTH > (p_rRRDomain.m_u16NameLength + u8Len))
-                {
-                    // Add length byte
-                    p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength] = u8Len;
-                    ++(p_rRRDomain.m_u16NameLength);
-                    if (u8Len)      // Add name
+                    // Normal (uncompressed) label (maybe '\0' only)
+                    if (MDNS_DOMAIN_MAXLENGTH > (p_rRRDomain.m_u16NameLength + u8Len))
                     {
-                        if ((bResult = _udpReadBuffer((unsigned char*) & (p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]), u8Len)))
+                        // Add length byte
+                        p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength] = u8Len;
+                        ++(p_rRRDomain.m_u16NameLength);
+                        if (u8Len)  // Add name
                         {
-                            /*  DEBUG_EX_INFO(
+                            if ((bResult = _udpReadBuffer((unsigned char*)&(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]), u8Len)))
+                            {
+                                /*  DEBUG_EX_INFO(
                                     p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength + u8Len] = 0;  // Closing '\0' for printing
                                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Domain label (%u): %s\n"), p_u8Depth, (unsigned)(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength - 1]), &(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]));
                                     );*/
 
-                            p_rRRDomain.m_u16NameLength += u8Len;
+                                p_rRRDomain.m_u16NameLength += u8Len;
+                            }
                         }
+                        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(2) offset:%u p0:%x\n"), m_pUDPContext->tell(), m_pUDPContext->peek()););
+                    }
+                    else
+                    {
+                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Domain name too long (%u + %u)!\n"), p_u8Depth, p_rRRDomain.m_u16NameLength, u8Len););
+                        bResult = false;
+                        break;
                     }
-                    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(2) offset:%u p0:%x\n"), m_pUDPContext->tell(), m_pUDPContext->peek()););
-                }
-                else
-                {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Domain name too long (%u + %u)!\n"), p_u8Depth, p_rRRDomain.m_u16NameLength, u8Len););
-                    bResult = false;
-                    break;
                 }
-            }
-        } while ((bResult) &&
-                 (0 != u8Len));
-    }
-    else
-    {
-        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Too many redirections!\n"), p_u8Depth););
+            } while ((bResult) && (0 != u8Len));
+        }
+        else
+        {
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Too many redirections!\n"), p_u8Depth););
+        }
+        return bResult;
     }
-    return bResult;
-}
-
-/*
-    MDNSResponder::_readRRAttributes
-*/
-bool MDNSResponder::_readRRAttributes(MDNSResponder::stcMDNS_RRAttributes& p_rRRAttributes)
-{
-    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes\n")););
 
-    bool    bResult = ((_udpRead16(p_rRRAttributes.m_u16Type)) &&
-                       (_udpRead16(p_rRRAttributes.m_u16Class)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes: FAILED!\n")););
-    return bResult;
-}
+    /*
+    MDNSResponder::_readRRAttributes
+*/
+    bool MDNSResponder::_readRRAttributes(MDNSResponder::stcMDNS_RRAttributes& p_rRRAttributes)
+    {
+        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes\n")););
 
+        bool bResult = ((_udpRead16(p_rRRAttributes.m_u16Type)) && (_udpRead16(p_rRRAttributes.m_u16Class)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     DOMAIN NAMES
 */
 
-/*
+    /*
     MDNSResponder::_buildDomainForHost
 
     Builds a MDNS host domain (eg. esp8266.local) for the given hostname.
 
 */
-bool MDNSResponder::_buildDomainForHost(const char* p_pcHostname,
-                                        MDNSResponder::stcMDNS_RRDomain& p_rHostDomain) const
-{
-
-    p_rHostDomain.clear();
-    bool    bResult = ((p_pcHostname) &&
-                       (*p_pcHostname) &&
-                       (p_rHostDomain.addLabel(p_pcHostname)) &&
-                       (p_rHostDomain.addLabel(scpcLocal)) &&
-                       (p_rHostDomain.addLabel(0)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForHost: FAILED!\n")););
-    return bResult;
-}
+    bool MDNSResponder::_buildDomainForHost(const char*                      p_pcHostname,
+                                            MDNSResponder::stcMDNS_RRDomain& p_rHostDomain) const
+    {
+        p_rHostDomain.clear();
+        bool bResult = ((p_pcHostname) && (*p_pcHostname) && (p_rHostDomain.addLabel(p_pcHostname)) && (p_rHostDomain.addLabel(scpcLocal)) && (p_rHostDomain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForHost: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_buildDomainForDNSSD
 
     Builds the '_services._dns-sd._udp.local' domain.
     Used while detecting generic service enum question (DNS-SD) and answering these questions.
 
 */
-bool MDNSResponder::_buildDomainForDNSSD(MDNSResponder::stcMDNS_RRDomain& p_rDNSSDDomain) const
-{
-
-    p_rDNSSDDomain.clear();
-    bool    bResult = ((p_rDNSSDDomain.addLabel(scpcServices, true)) &&
-                       (p_rDNSSDDomain.addLabel(scpcDNSSD, true)) &&
-                       (p_rDNSSDDomain.addLabel(scpcUDP, true)) &&
-                       (p_rDNSSDDomain.addLabel(scpcLocal)) &&
-                       (p_rDNSSDDomain.addLabel(0)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForDNSSD: FAILED!\n")););
-    return bResult;
-}
+    bool MDNSResponder::_buildDomainForDNSSD(MDNSResponder::stcMDNS_RRDomain& p_rDNSSDDomain) const
+    {
+        p_rDNSSDDomain.clear();
+        bool bResult = ((p_rDNSSDDomain.addLabel(scpcServices, true)) && (p_rDNSSDDomain.addLabel(scpcDNSSD, true)) && (p_rDNSSDDomain.addLabel(scpcUDP, true)) && (p_rDNSSDDomain.addLabel(scpcLocal)) && (p_rDNSSDDomain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForDNSSD: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_buildDomainForService
 
     Builds the domain for the given service (eg. _http._tcp.local or
     MyESP._http._tcp.local (if p_bIncludeName is set)).
 
 */
-bool MDNSResponder::_buildDomainForService(const MDNSResponder::stcMDNSService& p_Service,
-        bool p_bIncludeName,
-        MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
-{
-
-    p_rServiceDomain.clear();
-    bool    bResult = (((!p_bIncludeName) ||
-                        (p_rServiceDomain.addLabel(p_Service.m_pcName))) &&
-                       (p_rServiceDomain.addLabel(p_Service.m_pcService, true)) &&
-                       (p_rServiceDomain.addLabel(p_Service.m_pcProtocol, true)) &&
-                       (p_rServiceDomain.addLabel(scpcLocal)) &&
-                       (p_rServiceDomain.addLabel(0)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED!\n")););
-    return bResult;
-}
+    bool MDNSResponder::_buildDomainForService(const MDNSResponder::stcMDNSService& p_Service,
+                                               bool                                 p_bIncludeName,
+                                               MDNSResponder::stcMDNS_RRDomain&     p_rServiceDomain) const
+    {
+        p_rServiceDomain.clear();
+        bool bResult = (((!p_bIncludeName) || (p_rServiceDomain.addLabel(p_Service.m_pcName))) && (p_rServiceDomain.addLabel(p_Service.m_pcService, true)) && (p_rServiceDomain.addLabel(p_Service.m_pcProtocol, true)) && (p_rServiceDomain.addLabel(scpcLocal)) && (p_rServiceDomain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED!\n")););
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_buildDomainForService
 
     Builds the domain for the given service properties (eg. _http._tcp.local).
     The usual prepended '_' are added, if missing in the input strings.
 
 */
-bool MDNSResponder::_buildDomainForService(const char* p_pcService,
-        const char* p_pcProtocol,
-        MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
-{
-
-    p_rServiceDomain.clear();
-    bool    bResult = ((p_pcService) &&
-                       (p_pcProtocol) &&
-                       (p_rServiceDomain.addLabel(p_pcService, ('_' != *p_pcService))) &&
-                       (p_rServiceDomain.addLabel(p_pcProtocol, ('_' != *p_pcProtocol))) &&
-                       (p_rServiceDomain.addLabel(scpcLocal)) &&
-                       (p_rServiceDomain.addLabel(0)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED for (%s.%s)!\n"), (p_pcService ? : "-"), (p_pcProtocol ? : "-")););
-    return bResult;
-}
+    bool MDNSResponder::_buildDomainForService(const char*                      p_pcService,
+                                               const char*                      p_pcProtocol,
+                                               MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
+    {
+        p_rServiceDomain.clear();
+        bool bResult = ((p_pcService) && (p_pcProtocol) && (p_rServiceDomain.addLabel(p_pcService, ('_' != *p_pcService))) && (p_rServiceDomain.addLabel(p_pcProtocol, ('_' != *p_pcProtocol))) && (p_rServiceDomain.addLabel(scpcLocal)) && (p_rServiceDomain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED for (%s.%s)!\n"), (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
+        return bResult;
+    }
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::_buildDomainForReverseIP4
 
     The IP4 address is stringized by printing the four address bytes into a char buffer in reverse order
     and adding 'in-addr.arpa' (eg. 012.789.456.123.in-addr.arpa).
     Used while detecting reverse IP4 questions and answering these
 */
-bool MDNSResponder::_buildDomainForReverseIP4(IPAddress p_IP4Address,
-        MDNSResponder::stcMDNS_RRDomain& p_rReverseIP4Domain) const
-{
-
-    bool    bResult = true;
+    bool MDNSResponder::_buildDomainForReverseIP4(IPAddress                        p_IP4Address,
+                                                  MDNSResponder::stcMDNS_RRDomain& p_rReverseIP4Domain) const
+    {
+        bool bResult = true;
 
-    p_rReverseIP4Domain.clear();
+        p_rReverseIP4Domain.clear();
 
-    char    acBuffer[32];
-    for (int i = MDNS_IP4_SIZE; ((bResult) && (i >= 1)); --i)
-    {
-        itoa(p_IP4Address[i - 1], acBuffer, 10);
-        bResult = p_rReverseIP4Domain.addLabel(acBuffer);
+        char acBuffer[32];
+        for (int i = MDNS_IP4_SIZE; ((bResult) && (i >= 1)); --i)
+        {
+            itoa(p_IP4Address[i - 1], acBuffer, 10);
+            bResult = p_rReverseIP4Domain.addLabel(acBuffer);
+        }
+        bResult = ((bResult) && (p_rReverseIP4Domain.addLabel(scpcReverseIP4Domain)) && (p_rReverseIP4Domain.addLabel(scpcReverseTopDomain)) && (p_rReverseIP4Domain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForReverseIP4: FAILED!\n")););
+        return bResult;
     }
-    bResult = ((bResult) &&
-               (p_rReverseIP4Domain.addLabel(scpcReverseIP4Domain)) &&
-               (p_rReverseIP4Domain.addLabel(scpcReverseTopDomain)) &&
-               (p_rReverseIP4Domain.addLabel(0)));
-    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForReverseIP4: FAILED!\n")););
-    return bResult;
-}
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
-/*
+    /*
     MDNSResponder::_buildDomainForReverseIP6
 
     Used while detecting reverse IP6 questions and answering these
 */
-bool MDNSResponder::_buildDomainForReverseIP6(IPAddress p_IP4Address,
-        MDNSResponder::stcMDNS_RRDomain& p_rReverseIP6Domain) const
-{
-    // TODO: Implement
-    return false;
-}
+    bool MDNSResponder::_buildDomainForReverseIP6(IPAddress                        p_IP4Address,
+                                                  MDNSResponder::stcMDNS_RRDomain& p_rReverseIP6Domain) const
+    {
+        // TODO: Implement
+        return false;
+    }
 #endif
 
-
-/*
+    /*
     UDP
 */
 
-/*
+    /*
     MDNSResponder::_udpReadBuffer
 */
-bool MDNSResponder::_udpReadBuffer(unsigned char* p_pBuffer,
-                                   size_t p_stLength)
-{
-
-    bool    bResult = ((m_pUDPContext) &&
-                       (true/*m_pUDPContext->getSize() > p_stLength*/) &&
-                       (p_pBuffer) &&
-                       (p_stLength) &&
-                       ((p_stLength == m_pUDPContext->read((char*)p_pBuffer, p_stLength))));
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpReadBuffer: FAILED!\n"));
-    });
-    return bResult;
-}
+    bool MDNSResponder::_udpReadBuffer(unsigned char* p_pBuffer,
+                                       size_t         p_stLength)
+    {
+        bool bResult = ((m_pUDPContext) && (true /*m_pUDPContext->getSize() > p_stLength*/) && (p_pBuffer) && (p_stLength) && ((p_stLength == m_pUDPContext->read((char*)p_pBuffer, p_stLength))));
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpReadBuffer: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_udpRead8
 */
-bool MDNSResponder::_udpRead8(uint8_t& p_ru8Value)
-{
-
-    return _udpReadBuffer((unsigned char*)&p_ru8Value, sizeof(p_ru8Value));
-}
+    bool MDNSResponder::_udpRead8(uint8_t& p_ru8Value)
+    {
+        return _udpReadBuffer((unsigned char*)&p_ru8Value, sizeof(p_ru8Value));
+    }
 
-/*
+    /*
     MDNSResponder::_udpRead16
 */
-bool MDNSResponder::_udpRead16(uint16_t& p_ru16Value)
-{
-
-    bool    bResult = false;
-
-    if (_udpReadBuffer((unsigned char*)&p_ru16Value, sizeof(p_ru16Value)))
+    bool MDNSResponder::_udpRead16(uint16_t& p_ru16Value)
     {
-        p_ru16Value = lwip_ntohs(p_ru16Value);
-        bResult = true;
+        bool bResult = false;
+
+        if (_udpReadBuffer((unsigned char*)&p_ru16Value, sizeof(p_ru16Value)))
+        {
+            p_ru16Value = lwip_ntohs(p_ru16Value);
+            bResult     = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_udpRead32
 */
-bool MDNSResponder::_udpRead32(uint32_t& p_ru32Value)
-{
-
-    bool    bResult = false;
-
-    if (_udpReadBuffer((unsigned char*)&p_ru32Value, sizeof(p_ru32Value)))
+    bool MDNSResponder::_udpRead32(uint32_t& p_ru32Value)
     {
-        p_ru32Value = lwip_ntohl(p_ru32Value);
-        bResult = true;
+        bool bResult = false;
+
+        if (_udpReadBuffer((unsigned char*)&p_ru32Value, sizeof(p_ru32Value)))
+        {
+            p_ru32Value = lwip_ntohl(p_ru32Value);
+            bResult     = true;
+        }
+        return bResult;
     }
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_udpAppendBuffer
 */
-bool MDNSResponder::_udpAppendBuffer(const unsigned char* p_pcBuffer,
-                                     size_t p_stLength)
-{
-
-    bool bResult = ((m_pUDPContext) &&
-                    (p_pcBuffer) &&
-                    (p_stLength) &&
-                    (p_stLength == m_pUDPContext->append((const char*)p_pcBuffer, p_stLength)));
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpAppendBuffer: FAILED!\n"));
-    });
-    return bResult;
-}
+    bool MDNSResponder::_udpAppendBuffer(const unsigned char* p_pcBuffer,
+                                         size_t               p_stLength)
+    {
+        bool bResult = ((m_pUDPContext) && (p_pcBuffer) && (p_stLength) && (p_stLength == m_pUDPContext->append((const char*)p_pcBuffer, p_stLength)));
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpAppendBuffer: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_udpAppend8
 */
-bool MDNSResponder::_udpAppend8(uint8_t p_u8Value)
-{
-
-    return (_udpAppendBuffer((unsigned char*)&p_u8Value, sizeof(p_u8Value)));
-}
+    bool MDNSResponder::_udpAppend8(uint8_t p_u8Value)
+    {
+        return (_udpAppendBuffer((unsigned char*)&p_u8Value, sizeof(p_u8Value)));
+    }
 
-/*
+    /*
     MDNSResponder::_udpAppend16
 */
-bool MDNSResponder::_udpAppend16(uint16_t p_u16Value)
-{
-
-    p_u16Value = lwip_htons(p_u16Value);
-    return (_udpAppendBuffer((unsigned char*)&p_u16Value, sizeof(p_u16Value)));
-}
+    bool MDNSResponder::_udpAppend16(uint16_t p_u16Value)
+    {
+        p_u16Value = lwip_htons(p_u16Value);
+        return (_udpAppendBuffer((unsigned char*)&p_u16Value, sizeof(p_u16Value)));
+    }
 
-/*
+    /*
     MDNSResponder::_udpAppend32
 */
-bool MDNSResponder::_udpAppend32(uint32_t p_u32Value)
-{
-
-    p_u32Value = lwip_htonl(p_u32Value);
-    return (_udpAppendBuffer((unsigned char*)&p_u32Value, sizeof(p_u32Value)));
-}
+    bool MDNSResponder::_udpAppend32(uint32_t p_u32Value)
+    {
+        p_u32Value = lwip_htonl(p_u32Value);
+        return (_udpAppendBuffer((unsigned char*)&p_u32Value, sizeof(p_u32Value)));
+    }
 
 #ifdef DEBUG_ESP_MDNS_RESPONDER
-/*
+    /*
     MDNSResponder::_udpDump
 */
-bool MDNSResponder::_udpDump(bool p_bMovePointer /*= false*/)
-{
-
-    const uint8_t   cu8BytesPerLine = 16;
+    bool MDNSResponder::_udpDump(bool p_bMovePointer /*= false*/)
+    {
+        const uint8_t cu8BytesPerLine = 16;
 
-    uint32_t        u32StartPosition = m_pUDPContext->tell();
-    DEBUG_OUTPUT.println("UDP Context Dump:");
-    uint32_t    u32Counter = 0;
-    uint8_t     u8Byte = 0;
+        uint32_t u32StartPosition = m_pUDPContext->tell();
+        DEBUG_OUTPUT.println("UDP Context Dump:");
+        uint32_t u32Counter = 0;
+        uint8_t  u8Byte     = 0;
 
-    while (_udpRead8(u8Byte))
-    {
-        DEBUG_OUTPUT.printf_P(PSTR("%02x %s"), u8Byte, ((++u32Counter % cu8BytesPerLine) ? "" : "\n"));
-    }
-    DEBUG_OUTPUT.printf_P(PSTR("%sDone: %u bytes\n"), (((u32Counter) && (u32Counter % cu8BytesPerLine)) ? "\n" : ""), u32Counter);
+        while (_udpRead8(u8Byte))
+        {
+            DEBUG_OUTPUT.printf_P(PSTR("%02x %s"), u8Byte, ((++u32Counter % cu8BytesPerLine) ? "" : "\n"));
+        }
+        DEBUG_OUTPUT.printf_P(PSTR("%sDone: %u bytes\n"), (((u32Counter) && (u32Counter % cu8BytesPerLine)) ? "\n" : ""), u32Counter);
 
-    if (!p_bMovePointer)    // Restore
-    {
-        m_pUDPContext->seek(u32StartPosition);
+        if (!p_bMovePointer)  // Restore
+        {
+            m_pUDPContext->seek(u32StartPosition);
+        }
+        return true;
     }
-    return true;
-}
 
-/*
+    /*
     MDNSResponder::_udpDump
 */
-bool MDNSResponder::_udpDump(unsigned p_uOffset,
-                             unsigned p_uLength)
-{
-
-    if ((m_pUDPContext) &&
-            (m_pUDPContext->isValidOffset(p_uOffset)))
+    bool MDNSResponder::_udpDump(unsigned p_uOffset,
+                                 unsigned p_uLength)
     {
-        unsigned    uCurrentPosition = m_pUDPContext->tell();   // Remember start position
-
-        m_pUDPContext->seek(p_uOffset);
-        uint8_t u8Byte;
-        for (unsigned u = 0; ((u < p_uLength) && (_udpRead8(u8Byte))); ++u)
+        if ((m_pUDPContext) && (m_pUDPContext->isValidOffset(p_uOffset)))
         {
-            DEBUG_OUTPUT.printf_P(PSTR("%02x "), u8Byte);
+            unsigned uCurrentPosition = m_pUDPContext->tell();  // Remember start position
+
+            m_pUDPContext->seek(p_uOffset);
+            uint8_t u8Byte;
+            for (unsigned u = 0; ((u < p_uLength) && (_udpRead8(u8Byte))); ++u)
+            {
+                DEBUG_OUTPUT.printf_P(PSTR("%02x "), u8Byte);
+            }
+            // Return to start position
+            m_pUDPContext->seek(uCurrentPosition);
         }
-        // Return to start position
-        m_pUDPContext->seek(uCurrentPosition);
+        return true;
     }
-    return true;
-}
 #endif
 
-
-/**
+    /**
     READ/WRITE MDNS STRUCTS
 */
 
-/*
+    /*
     MDNSResponder::_readMDNSMsgHeader
 
     Read a MDNS header from the UDP input buffer.
@@ -1210,33 +1107,25 @@ bool MDNSResponder::_udpDump(unsigned p_uOffset,
     In addition, bitfield memory order is undefined in C standard (GCC doesn't order them in the coded direction...), so they
     need some mapping here
 */
-bool MDNSResponder::_readMDNSMsgHeader(MDNSResponder::stcMDNS_MsgHeader& p_rMsgHeader)
-{
-
-    bool    bResult = false;
-
-    uint8_t u8B1;
-    uint8_t u8B2;
-    if ((_udpRead16(p_rMsgHeader.m_u16ID)) &&
-            (_udpRead8(u8B1)) &&
-            (_udpRead8(u8B2)) &&
-            (_udpRead16(p_rMsgHeader.m_u16QDCount)) &&
-            (_udpRead16(p_rMsgHeader.m_u16ANCount)) &&
-            (_udpRead16(p_rMsgHeader.m_u16NSCount)) &&
-            (_udpRead16(p_rMsgHeader.m_u16ARCount)))
+    bool MDNSResponder::_readMDNSMsgHeader(MDNSResponder::stcMDNS_MsgHeader& p_rMsgHeader)
     {
+        bool bResult = false;
 
-        p_rMsgHeader.m_1bQR     = (u8B1 & 0x80);    // Query/Respond flag
-        p_rMsgHeader.m_4bOpcode = (u8B1 & 0x78);    // Operation code (0: Standard query, others ignored)
-        p_rMsgHeader.m_1bAA     = (u8B1 & 0x04);    // Authoritative answer
-        p_rMsgHeader.m_1bTC     = (u8B1 & 0x02);    // Truncation flag
-        p_rMsgHeader.m_1bRD     = (u8B1 & 0x01);    // Recursion desired
+        uint8_t u8B1;
+        uint8_t u8B2;
+        if ((_udpRead16(p_rMsgHeader.m_u16ID)) && (_udpRead8(u8B1)) && (_udpRead8(u8B2)) && (_udpRead16(p_rMsgHeader.m_u16QDCount)) && (_udpRead16(p_rMsgHeader.m_u16ANCount)) && (_udpRead16(p_rMsgHeader.m_u16NSCount)) && (_udpRead16(p_rMsgHeader.m_u16ARCount)))
+        {
+            p_rMsgHeader.m_1bQR     = (u8B1 & 0x80);  // Query/Respond flag
+            p_rMsgHeader.m_4bOpcode = (u8B1 & 0x78);  // Operation code (0: Standard query, others ignored)
+            p_rMsgHeader.m_1bAA     = (u8B1 & 0x04);  // Authoritative answer
+            p_rMsgHeader.m_1bTC     = (u8B1 & 0x02);  // Truncation flag
+            p_rMsgHeader.m_1bRD     = (u8B1 & 0x01);  // Recursion desired
 
-        p_rMsgHeader.m_1bRA     = (u8B2 & 0x80);    // Recursion available
-        p_rMsgHeader.m_3bZ      = (u8B2 & 0x70);    // Zero
-        p_rMsgHeader.m_4bRCode  = (u8B2 & 0x0F);    // Response code
+            p_rMsgHeader.m_1bRA    = (u8B2 & 0x80);  // Recursion available
+            p_rMsgHeader.m_3bZ     = (u8B2 & 0x70);  // Zero
+            p_rMsgHeader.m_4bRCode = (u8B2 & 0x0F);  // Response code
 
-        /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
+            /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
                 (unsigned)p_rMsgHeader.m_u16ID,
                 (unsigned)p_rMsgHeader.m_1bQR, (unsigned)p_rMsgHeader.m_4bOpcode, (unsigned)p_rMsgHeader.m_1bAA, (unsigned)p_rMsgHeader.m_1bTC, (unsigned)p_rMsgHeader.m_1bRD,
                 (unsigned)p_rMsgHeader.m_1bRA, (unsigned)p_rMsgHeader.m_4bRCode,
@@ -1244,49 +1133,43 @@ bool MDNSResponder::_readMDNSMsgHeader(MDNSResponder::stcMDNS_MsgHeader& p_rMsgH
                 (unsigned)p_rMsgHeader.m_u16ANCount,
                 (unsigned)p_rMsgHeader.m_u16NSCount,
                 (unsigned)p_rMsgHeader.m_u16ARCount););*/
-        bResult = true;
+            bResult = true;
+        }
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: FAILED!\n"));
+                     });
+        return bResult;
     }
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: FAILED!\n"));
-    });
-    return bResult;
-}
 
-/*
+    /*
     MDNSResponder::_write8
 */
-bool MDNSResponder::_write8(uint8_t p_u8Value,
-                            MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-
-    return ((_udpAppend8(p_u8Value)) &&
-            (p_rSendParameter.shiftOffset(sizeof(p_u8Value))));
-}
+    bool MDNSResponder::_write8(uint8_t                              p_u8Value,
+                                MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        return ((_udpAppend8(p_u8Value)) && (p_rSendParameter.shiftOffset(sizeof(p_u8Value))));
+    }
 
-/*
+    /*
     MDNSResponder::_write16
 */
-bool MDNSResponder::_write16(uint16_t p_u16Value,
-                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-
-    return ((_udpAppend16(p_u16Value)) &&
-            (p_rSendParameter.shiftOffset(sizeof(p_u16Value))));
-}
+    bool MDNSResponder::_write16(uint16_t                             p_u16Value,
+                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        return ((_udpAppend16(p_u16Value)) && (p_rSendParameter.shiftOffset(sizeof(p_u16Value))));
+    }
 
-/*
+    /*
     MDNSResponder::_write32
 */
-bool MDNSResponder::_write32(uint32_t p_u32Value,
-                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-
-    return ((_udpAppend32(p_u32Value)) &&
-            (p_rSendParameter.shiftOffset(sizeof(p_u32Value))));
-}
+    bool MDNSResponder::_write32(uint32_t                             p_u32Value,
+                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        return ((_udpAppend32(p_u32Value)) && (p_rSendParameter.shiftOffset(sizeof(p_u32Value))));
+    }
 
-/*
+    /*
     MDNSResponder::_writeMDNSMsgHeader
 
     Write MDNS header to the UDP output buffer.
@@ -1295,10 +1178,10 @@ bool MDNSResponder::_write32(uint32_t p_u32Value,
     In addition, bitfield memory order is undefined in C standard (GCC doesn't order them in the coded direction...), so they
     need some mapping here
 */
-bool MDNSResponder::_writeMDNSMsgHeader(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader,
-                                        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
+    bool MDNSResponder::_writeMDNSMsgHeader(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader,
+                                            MDNSResponder::stcMDNSSendParameter&    p_rSendParameter)
+    {
+        /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
             (unsigned)p_MsgHeader.m_u16ID,
             (unsigned)p_MsgHeader.m_1bQR, (unsigned)p_MsgHeader.m_4bOpcode, (unsigned)p_MsgHeader.m_1bAA, (unsigned)p_MsgHeader.m_1bTC, (unsigned)p_MsgHeader.m_1bRD,
             (unsigned)p_MsgHeader.m_1bRA, (unsigned)p_MsgHeader.m_4bRCode,
@@ -1307,58 +1190,48 @@ bool MDNSResponder::_writeMDNSMsgHeader(const MDNSResponder::stcMDNS_MsgHeader&
             (unsigned)p_MsgHeader.m_u16NSCount,
             (unsigned)p_MsgHeader.m_u16ARCount););*/
 
-    uint8_t u8B1((p_MsgHeader.m_1bQR << 7) | (p_MsgHeader.m_4bOpcode << 3) | (p_MsgHeader.m_1bAA << 2) | (p_MsgHeader.m_1bTC << 1) | (p_MsgHeader.m_1bRD));
-    uint8_t u8B2((p_MsgHeader.m_1bRA << 7) | (p_MsgHeader.m_3bZ << 4) | (p_MsgHeader.m_4bRCode));
-    bool    bResult = ((_write16(p_MsgHeader.m_u16ID, p_rSendParameter)) &&
-                       (_write8(u8B1, p_rSendParameter)) &&
-                       (_write8(u8B2, p_rSendParameter)) &&
-                       (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter)) &&
-                       (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter)) &&
-                       (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter)) &&
-                       (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter)));
-
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: FAILED!\n"));
-    });
-    return bResult;
-}
+        uint8_t u8B1((p_MsgHeader.m_1bQR << 7) | (p_MsgHeader.m_4bOpcode << 3) | (p_MsgHeader.m_1bAA << 2) | (p_MsgHeader.m_1bTC << 1) | (p_MsgHeader.m_1bRD));
+        uint8_t u8B2((p_MsgHeader.m_1bRA << 7) | (p_MsgHeader.m_3bZ << 4) | (p_MsgHeader.m_4bRCode));
+        bool    bResult = ((_write16(p_MsgHeader.m_u16ID, p_rSendParameter)) && (_write8(u8B1, p_rSendParameter)) && (_write8(u8B2, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter)));
 
-/*
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: FAILED!\n"));
+                     });
+        return bResult;
+    }
+
+    /*
     MDNSResponder::_writeRRAttributes
 */
-bool MDNSResponder::_writeMDNSRRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Attributes,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-
-    bool    bResult = ((_write16(p_Attributes.m_u16Type, p_rSendParameter)) &&
-                       (_write16(p_Attributes.m_u16Class, p_rSendParameter)));
+    bool MDNSResponder::_writeMDNSRRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Attributes,
+                                               MDNSResponder::stcMDNSSendParameter&       p_rSendParameter)
+    {
+        bool bResult = ((_write16(p_Attributes.m_u16Type, p_rSendParameter)) && (_write16(p_Attributes.m_u16Class, p_rSendParameter)));
 
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRAttributes: FAILED!\n"));
-    });
-    return bResult;
-}
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRAttributes: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_writeMDNSRRDomain
 */
-bool MDNSResponder::_writeMDNSRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_Domain,
-                                       MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-
-    bool    bResult = ((_udpAppendBuffer((const unsigned char*)p_Domain.m_acName, p_Domain.m_u16NameLength)) &&
-                       (p_rSendParameter.shiftOffset(p_Domain.m_u16NameLength)));
+    bool MDNSResponder::_writeMDNSRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_Domain,
+                                           MDNSResponder::stcMDNSSendParameter&   p_rSendParameter)
+    {
+        bool bResult = ((_udpAppendBuffer((const unsigned char*)p_Domain.m_acName, p_Domain.m_u16NameLength)) && (p_rSendParameter.shiftOffset(p_Domain.m_u16NameLength)));
 
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRDomain: FAILED!\n"));
-    });
-    return bResult;
-}
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRDomain: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_writeMDNSHostDomain
 
     Write a host domain to the UDP output buffer.
@@ -1373,38 +1246,33 @@ bool MDNSResponder::_writeMDNSRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_
     and written to the output buffer.
 
 */
-bool MDNSResponder::_writeMDNSHostDomain(const char* p_pcHostname,
-        bool p_bPrependRDLength,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-
-    // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
-    uint16_t            u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostname, false);
-
-    stcMDNS_RRDomain    hostDomain;
-    bool    bResult = (u16CachedDomainOffset
-                       // Found cached domain -> mark as compressed domain
-                       ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) && // Valid offset
-                          ((!p_bPrependRDLength) ||
-                           (_write16(2, p_rSendParameter))) &&                                     // Length of 'Cxxx'
-                          (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&   // Compression mark (and offset)
-                          (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
-                       // No cached domain -> add this domain to cache and write full domain name
-                       : ((_buildDomainForHost(p_pcHostname, hostDomain)) &&                       // eg. esp8266.local
-                          ((!p_bPrependRDLength) ||
-                           (_write16(hostDomain.m_u16NameLength, p_rSendParameter))) &&            // RDLength (if needed)
-                          (p_rSendParameter.addDomainCacheItem((const void*)p_pcHostname, false, p_rSendParameter.m_u16Offset)) &&
-                          (_writeMDNSRRDomain(hostDomain, p_rSendParameter))));
-
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSHostDomain: FAILED!\n"));
-    });
-    return bResult;
-
-}
+    bool MDNSResponder::_writeMDNSHostDomain(const char*                          p_pcHostname,
+                                             bool                                 p_bPrependRDLength,
+                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
+        uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostname, false);
+
+        stcMDNS_RRDomain hostDomain;
+        bool             bResult = (u16CachedDomainOffset
+                            // Found cached domain -> mark as compressed domain
+                                        ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
+                               ((!p_bPrependRDLength) || (_write16(2, p_rSendParameter))) &&                                 // Length of 'Cxxx'
+                               (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&    // Compression mark (and offset)
+                               (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
+                            // No cached domain -> add this domain to cache and write full domain name
+                                        : ((_buildDomainForHost(p_pcHostname, hostDomain)) &&                                      // eg. esp8266.local
+                               ((!p_bPrependRDLength) || (_write16(hostDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
+                               (p_rSendParameter.addDomainCacheItem((const void*)p_pcHostname, false, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(hostDomain, p_rSendParameter))));
+
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSHostDomain: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_writeMDNSServiceDomain
 
     Write a service domain to the UDP output buffer.
@@ -1416,39 +1284,34 @@ bool MDNSResponder::_writeMDNSHostDomain(const char* p_pcHostname,
     the instance name (p_bIncludeName is set) and thoose who don't.
 
 */
-bool MDNSResponder::_writeMDNSServiceDomain(const MDNSResponder::stcMDNSService& p_Service,
-        bool p_bIncludeName,
-        bool p_bPrependRDLength,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-
-    // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
-    uint16_t            u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName);
-
-    stcMDNS_RRDomain    serviceDomain;
-    bool    bResult = (u16CachedDomainOffset
-                       // Found cached domain -> mark as compressed domain
-                       ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) && // Valid offset
-                          ((!p_bPrependRDLength) ||
-                           (_write16(2, p_rSendParameter))) &&                                     // Length of 'Cxxx'
-                          (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&   // Compression mark (and offset)
-                          (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
-                       // No cached domain -> add this domain to cache and write full domain name
-                       : ((_buildDomainForService(p_Service, p_bIncludeName, serviceDomain)) &&    // eg. MyESP._http._tcp.local
-                          ((!p_bPrependRDLength) ||
-                           (_write16(serviceDomain.m_u16NameLength, p_rSendParameter))) &&         // RDLength (if needed)
-                          (p_rSendParameter.addDomainCacheItem((const void*)&p_Service, p_bIncludeName, p_rSendParameter.m_u16Offset)) &&
-                          (_writeMDNSRRDomain(serviceDomain, p_rSendParameter))));
-
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSServiceDomain: FAILED!\n"));
-    });
-    return bResult;
-
-}
+    bool MDNSResponder::_writeMDNSServiceDomain(const MDNSResponder::stcMDNSService& p_Service,
+                                                bool                                 p_bIncludeName,
+                                                bool                                 p_bPrependRDLength,
+                                                MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
+        uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName);
+
+        stcMDNS_RRDomain serviceDomain;
+        bool             bResult = (u16CachedDomainOffset
+                            // Found cached domain -> mark as compressed domain
+                                        ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
+                               ((!p_bPrependRDLength) || (_write16(2, p_rSendParameter))) &&                                 // Length of 'Cxxx'
+                               (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&    // Compression mark (and offset)
+                               (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
+                            // No cached domain -> add this domain to cache and write full domain name
+                                        : ((_buildDomainForService(p_Service, p_bIncludeName, serviceDomain)) &&                      // eg. MyESP._http._tcp.local
+                               ((!p_bPrependRDLength) || (_write16(serviceDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
+                               (p_rSendParameter.addDomainCacheItem((const void*)&p_Service, p_bIncludeName, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(serviceDomain, p_rSendParameter))));
+
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSServiceDomain: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_writeMDNSQuestion
 
     Write a MDNS question to the UDP output buffer
@@ -1458,25 +1321,22 @@ bool MDNSResponder::_writeMDNSServiceDomain(const MDNSResponder::stcMDNSService&
     QCLASS (16bit, eg. IN)
 
 */
-bool MDNSResponder::_writeMDNSQuestion(MDNSResponder::stcMDNS_RRQuestion& p_Question,
-                                       MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion\n")););
-
-    bool    bResult = ((_writeMDNSRRDomain(p_Question.m_Header.m_Domain, p_rSendParameter)) &&
-                       (_writeMDNSRRAttributes(p_Question.m_Header.m_Attributes, p_rSendParameter)));
-
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion: FAILED!\n"));
-    });
-    return bResult;
+    bool MDNSResponder::_writeMDNSQuestion(MDNSResponder::stcMDNS_RRQuestion&   p_Question,
+                                           MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion\n")););
 
-}
+        bool bResult = ((_writeMDNSRRDomain(p_Question.m_Header.m_Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(p_Question.m_Header.m_Attributes, p_rSendParameter)));
 
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
 #ifdef MDNS_IP4_SUPPORT
-/*
+    /*
     MDNSResponder::_writeMDNSAnswer_A
 
     Write a MDNS A answer to the UDP output buffer.
@@ -1491,30 +1351,28 @@ bool MDNSResponder::_writeMDNSQuestion(MDNSResponder::stcMDNS_RRQuestion& p_Ques
     eg. esp8266.local A 0x8001 120 4 123.456.789.012
     Ref: http://www.zytrax.com/books/dns/ch8/a.html
 */
-bool MDNSResponder::_writeMDNSAnswer_A(IPAddress p_IPAddress,
-                                       MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A (%s)\n"), p_IPAddress.toString().c_str()););
-
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_A,
-                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
-    const unsigned char     aucIPAddress[MDNS_IP4_SIZE] = { p_IPAddress[0], p_IPAddress[1], p_IPAddress[2], p_IPAddress[3] };
-    bool    bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) &&
-                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&        // TYPE & CLASS
-                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&    // TTL
-                       (_write16(MDNS_IP4_SIZE, p_rSendParameter)) &&                   // RDLength
-                       (_udpAppendBuffer(aucIPAddress, MDNS_IP4_SIZE)) &&               // RData
-                       (p_rSendParameter.shiftOffset(MDNS_IP4_SIZE)));
-
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A: FAILED!\n"));
-    });
-    return bResult;
-
-}
+    bool MDNSResponder::_writeMDNSAnswer_A(IPAddress                            p_IPAddress,
+                                           MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A (%s)\n"), p_IPAddress.toString().c_str()););
+
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_A,
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+        const unsigned char  aucIPAddress[MDNS_IP4_SIZE] = { p_IPAddress[0], p_IPAddress[1], p_IPAddress[2], p_IPAddress[3] };
+        bool                 bResult                     = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                       // TTL
+                        (_write16(MDNS_IP4_SIZE, p_rSendParameter)) &&                                                                              // RDLength
+                        (_udpAppendBuffer(aucIPAddress, MDNS_IP4_SIZE)) &&                                                                          // RData
+                        (p_rSendParameter.shiftOffset(MDNS_IP4_SIZE)));
+
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_writeMDNSAnswer_PTR_IP4
 
     Write a MDNS reverse IP4 PTR answer to the UDP output buffer.
@@ -1523,30 +1381,29 @@ bool MDNSResponder::_writeMDNSAnswer_A(IPAddress p_IPAddress,
     eg. 012.789.456.123.in-addr.arpa PTR 0x8001 120 15 esp8266.local
     Used while answering reverse IP4 questions
 */
-bool MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress p_IPAddress,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4 (%s)\n"), p_IPAddress.toString().c_str()););
-
-    stcMDNS_RRDomain        reverseIP4Domain;
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_PTR,
-                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
-    stcMDNS_RRDomain        hostDomain;
-    bool    bResult = ((_buildDomainForReverseIP4(p_IPAddress, reverseIP4Domain)) &&    // 012.789.456.123.in-addr.arpa
-                       (_writeMDNSRRDomain(reverseIP4Domain, p_rSendParameter)) &&
-                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&        // TYPE & CLASS
-                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&    // TTL
-                       (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));   // RDLength & RData (host domain, eg. esp8266.local)
-
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4: FAILED!\n"));
-    });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress                            p_IPAddress,
+                                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4 (%s)\n"), p_IPAddress.toString().c_str()););
+
+        stcMDNS_RRDomain     reverseIP4Domain;
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+        stcMDNS_RRDomain     hostDomain;
+        bool                 bResult = ((_buildDomainForReverseIP4(p_IPAddress, reverseIP4Domain)) &&                                                          // 012.789.456.123.in-addr.arpa
+                        (_writeMDNSRRDomain(reverseIP4Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                  // TTL
+                        (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                                                         // RDLength & RData (host domain, eg. esp8266.local)
+
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4: FAILED!\n"));
+                     });
+        return bResult;
+    }
 #endif
 
-/*
+    /*
     MDNSResponder::_writeMDNSAnswer_PTR_TYPE
 
     Write a MDNS PTR answer to the UDP output buffer.
@@ -1556,28 +1413,27 @@ bool MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress p_IPAddress,
     eg. _services._dns-sd._udp.local PTR 0x8001 5400 xx _http._tcp.local
     http://www.zytrax.com/books/dns/ch8/ptr.html
 */
-bool MDNSResponder::_writeMDNSAnswer_PTR_TYPE(MDNSResponder::stcMDNSService& p_rService,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE\n")););
-
-    stcMDNS_RRDomain        dnssdDomain;
-    stcMDNS_RRDomain        serviceDomain;
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);	// No cache flush! only INternet
-    bool    bResult = ((_buildDomainForDNSSD(dnssdDomain)) &&                                   // _services._dns-sd._udp.local
-                       (_writeMDNSRRDomain(dnssdDomain, p_rSendParameter)) &&
-                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                // TYPE & CLASS
-                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) && // TTL
-                       (_writeMDNSServiceDomain(p_rService, false, true, p_rSendParameter)));   // RDLength & RData (service domain, eg. _http._tcp.local)
-
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE: FAILED!\n"));
-    });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSAnswer_PTR_TYPE(MDNSResponder::stcMDNSService&       p_rService,
+                                                  MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE\n")););
+
+        stcMDNS_RRDomain     dnssdDomain;
+        stcMDNS_RRDomain     serviceDomain;
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);                                                                                  // No cache flush! only INternet
+        bool                 bResult = ((_buildDomainForDNSSD(dnssdDomain)) &&                                                                            // _services._dns-sd._udp.local
+                        (_writeMDNSRRDomain(dnssdDomain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&                          // TTL
+                        (_writeMDNSServiceDomain(p_rService, false, true, p_rSendParameter)));                                            // RDLength & RData (service domain, eg. _http._tcp.local)
+
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_writeMDNSAnswer_PTR_NAME
 
     Write a MDNS PTR answer to the UDP output buffer.
@@ -1587,26 +1443,25 @@ bool MDNSResponder::_writeMDNSAnswer_PTR_TYPE(MDNSResponder::stcMDNSService& p_r
     eg. _http.tcp.local PTR 0x8001 120 xx myESP._http._tcp.local
     http://www.zytrax.com/books/dns/ch8/ptr.html
 */
-bool MDNSResponder::_writeMDNSAnswer_PTR_NAME(MDNSResponder::stcMDNSService& p_rService,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME\n")););
-
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);	// No cache flush! only INternet
-    bool    bResult = ((_writeMDNSServiceDomain(p_rService, false, false, p_rSendParameter)) && // _http._tcp.local
-                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                    // TYPE & CLASS
-                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) && // TTL
-                       (_writeMDNSServiceDomain(p_rService, true, true, p_rSendParameter)));        // RDLength & RData (service domain, eg. MyESP._http._tcp.local)
-
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME: FAILED!\n"));
-    });
-    return bResult;
-}
-
+    bool MDNSResponder::_writeMDNSAnswer_PTR_NAME(MDNSResponder::stcMDNSService&       p_rService,
+                                                  MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME\n")););
+
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);                                                          // No cache flush! only INternet
+        bool                 bResult = ((_writeMDNSServiceDomain(p_rService, false, false, p_rSendParameter)) &&                  // _http._tcp.local
+                        (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
+                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
+                        (_writeMDNSServiceDomain(p_rService, true, true, p_rSendParameter)));                     // RDLength & RData (service domain, eg. MyESP._http._tcp.local)
+
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_writeMDNSAnswer_TXT
 
     Write a MDNS TXT answer to the UDP output buffer.
@@ -1617,55 +1472,49 @@ bool MDNSResponder::_writeMDNSAnswer_PTR_NAME(MDNSResponder::stcMDNSService& p_r
     eg. myESP._http._tcp.local TXT 0x8001 120 4 c#=1
     http://www.zytrax.com/books/dns/ch8/txt.html
 */
-bool MDNSResponder::_writeMDNSAnswer_TXT(MDNSResponder::stcMDNSService& p_rService,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT\n")););
-
-    bool                    bResult = false;
+    bool MDNSResponder::_writeMDNSAnswer_TXT(MDNSResponder::stcMDNSService&       p_rService,
+                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT\n")););
 
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_TXT,
-                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
+        bool bResult = false;
 
-    if ((_collectServiceTxts(p_rService)) &&
-            (_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&     // MyESP._http._tcp.local
-            (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                   // TYPE & CLASS
-            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&    // TTL
-            (_write16(p_rService.m_Txts.length(), p_rSendParameter)))                   // RDLength
-    {
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_TXT,
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
 
-        bResult = true;
-        // RData    Txts
-        for (stcMDNSServiceTxt* pTxt = p_rService.m_Txts.m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
-        {
-            unsigned char       ucLengthByte = pTxt->length();
-            bResult = ((_udpAppendBuffer((unsigned char*)&ucLengthByte, sizeof(ucLengthByte))) &&   // Length
-                       (p_rSendParameter.shiftOffset(sizeof(ucLengthByte))) &&
-                       ((size_t)os_strlen(pTxt->m_pcKey) == m_pUDPContext->append(pTxt->m_pcKey, os_strlen(pTxt->m_pcKey))) &&          // Key
-                       (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcKey))) &&
-                       (1 == m_pUDPContext->append("=", 1)) &&                                                                          // =
-                       (p_rSendParameter.shiftOffset(1)) &&
-                       ((!pTxt->m_pcValue) ||
-                        (((size_t)os_strlen(pTxt->m_pcValue) == m_pUDPContext->append(pTxt->m_pcValue, os_strlen(pTxt->m_pcValue))) &&  // Value
-                         (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcValue))))));
-
-            DEBUG_EX_ERR(if (!bResult)
+        if ((_collectServiceTxts(p_rService)) && (_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&  // MyESP._http._tcp.local
+            (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                                     // TYPE & CLASS
+            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&                      // TTL
+            (_write16(p_rService.m_Txts.length(), p_rSendParameter)))                                                     // RDLength
         {
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED to write %sTxt %s=%s!\n"), (pTxt->m_bTemp ? "temp. " : ""), (pTxt->m_pcKey ? : "?"), (pTxt->m_pcValue ? : "?"));
-            });
+            bResult = true;
+            // RData    Txts
+            for (stcMDNSServiceTxt* pTxt = p_rService.m_Txts.m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
+            {
+                unsigned char ucLengthByte = pTxt->length();
+                bResult                    = ((_udpAppendBuffer((unsigned char*)&ucLengthByte, sizeof(ucLengthByte))) &&                                                                                                  // Length
+                           (p_rSendParameter.shiftOffset(sizeof(ucLengthByte))) && ((size_t)os_strlen(pTxt->m_pcKey) == m_pUDPContext->append(pTxt->m_pcKey, os_strlen(pTxt->m_pcKey))) &&             // Key
+                           (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcKey))) && (1 == m_pUDPContext->append("=", 1)) &&                                                                 // =
+                           (p_rSendParameter.shiftOffset(1)) && ((!pTxt->m_pcValue) || (((size_t)os_strlen(pTxt->m_pcValue) == m_pUDPContext->append(pTxt->m_pcValue, os_strlen(pTxt->m_pcValue))) &&  // Value
+                                                                                        (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcValue))))));
+
+                DEBUG_EX_ERR(if (!bResult)
+                             {
+                                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED to write %sTxt %s=%s!\n"), (pTxt->m_bTemp ? "temp. " : ""), (pTxt->m_pcKey ?: "?"), (pTxt->m_pcValue ?: "?"));
+                             });
+            }
         }
-    }
-    _releaseTempServiceTxts(p_rService);
+        _releaseTempServiceTxts(p_rService);
 
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED!\n"));
-    });
-    return bResult;
-}
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
 #ifdef MDNS_IP6_SUPPORT
-/*
+    /*
     MDNSResponder::_writeMDNSAnswer_AAAA
 
     Write a MDNS AAAA answer to the UDP output buffer.
@@ -1674,27 +1523,27 @@ bool MDNSResponder::_writeMDNSAnswer_TXT(MDNSResponder::stcMDNSService& p_rServi
     eg. esp8266.local AAAA 0x8001 120 16 xxxx::xx
     http://www.zytrax.com/books/dns/ch8/aaaa.html
 */
-bool MDNSResponder::_writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA\n")););
-
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_AAAA,
-                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
-    bool    bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) && // esp8266.local
-                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&            // TYPE & CLASS
-                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&    // TTL
-                       (_write16(MDNS_IP6_SIZE, p_rSendParameter)) &&                       // RDLength
-                       (false /*TODO: IP6 version of: _udpAppendBuffer((uint32_t)p_IPAddress, MDNS_IP4_SIZE)*/));   // RData
-
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA: FAILED!\n"));
-    });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSAnswer_AAAA(IPAddress                            p_IPAddress,
+                                              MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA\n")););
+
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_AAAA,
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));                          // Cache flush? & INternet
+        bool                 bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) &&                            // esp8266.local
+                        (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                   // TYPE & CLASS
+                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&       // TTL
+                        (_write16(MDNS_IP6_SIZE, p_rSendParameter)) &&                                              // RDLength
+                        (false /*TODO: IP6 version of: _udpAppendBuffer((uint32_t)p_IPAddress, MDNS_IP4_SIZE)*/));  // RData
+
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
-/*
+    /*
     MDNSResponder::_writeMDNSAnswer_PTR_IP6
 
     Write a MDNS reverse IP6 PTR answer to the UDP output buffer.
@@ -1703,86 +1552,77 @@ bool MDNSResponder::_writeMDNSAnswer_AAAA(IPAddress p_IPAddress,
     eg. xxxx::xx.in6.arpa PTR 0x8001 120 15 esp8266.local
     Used while answering reverse IP6 questions
 */
-bool MDNSResponder::_writeMDNSAnswer_PTR_IP6(IPAddress p_IPAddress,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6\n")););
-
-    stcMDNS_RRDomain        reverseIP6Domain;
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_PTR,
-                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
-    bool    bResult = ((_buildDomainForReverseIP6(p_IPAddress, reverseIP6Domain)) &&        // xxxx::xx.ip6.arpa
-                       (_writeMDNSRRDomain(reverseIP6Domain, p_rSendParameter)) &&
-                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&            // TYPE & CLASS
-                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&    // TTL
-                       (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));       // RDLength & RData (host domain, eg. esp8266.local)
-
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6: FAILED!\n"));
-    });
-    return bResult;
-}
+    bool MDNSResponder::_writeMDNSAnswer_PTR_IP6(IPAddress                            p_IPAddress,
+                                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6\n")););
+
+        stcMDNS_RRDomain     reverseIP6Domain;
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));                                                     // Cache flush? & INternet
+        bool                 bResult = ((_buildDomainForReverseIP6(p_IPAddress, reverseIP6Domain)) &&                                                          // xxxx::xx.ip6.arpa
+                        (_writeMDNSRRDomain(reverseIP6Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                  // TTL
+                        (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                                                         // RDLength & RData (host domain, eg. esp8266.local)
+
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6: FAILED!\n"));
+                     });
+        return bResult;
+    }
 #endif
 
-/*
+    /*
     MDNSResponder::_writeMDNSAnswer_SRV
 
     eg. MyESP._http.tcp.local SRV 0x8001 120 0 0 60068 esp8266.local
     http://www.zytrax.com/books/dns/ch8/srv.html ???? Include instance name ????
 */
-bool MDNSResponder::_writeMDNSAnswer_SRV(MDNSResponder::stcMDNSService& p_rService,
-        MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
-{
-    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV\n")););
-
-    uint16_t                u16CachedDomainOffset = (p_rSendParameter.m_bLegacyQuery
-            ? 0
-            : p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostname, false));
-
-    stcMDNS_RRAttributes    attributes(DNS_RRTYPE_SRV,
-                                       ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));   // Cache flush? & INternet
-    stcMDNS_RRDomain        hostDomain;
-    bool    bResult = ((_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&  // MyESP._http._tcp.local
-                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                // TYPE & CLASS
-                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) && // TTL
-                       (!u16CachedDomainOffset
-                        // No cache for domain name (or no compression allowed)
-                        ? ((_buildDomainForHost(m_pcHostname, hostDomain)) &&
-                           (_write16((sizeof(uint16_t /*Prio*/) +                           // RDLength
-                                      sizeof(uint16_t /*Weight*/) +
-                                      sizeof(uint16_t /*Port*/) +
-                                      hostDomain.m_u16NameLength), p_rSendParameter)) &&    // Domain length
-                           (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&               // Priority
-                           (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                 // Weight
-                           (_write16(p_rService.m_u16Port, p_rSendParameter)) &&            // Port
-                           (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostname, false, p_rSendParameter.m_u16Offset)) &&
-                           (_writeMDNSRRDomain(hostDomain, p_rSendParameter)))              // Host, eg. esp8266.local
-                        // Cache available for domain
-                        : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) && // Valid offset
-                           (_write16((sizeof(uint16_t /*Prio*/) +                           // RDLength
-                                      sizeof(uint16_t /*Weight*/) +
-                                      sizeof(uint16_t /*Port*/) +
-                                      2), p_rSendParameter)) &&                             // Length of 'C0xx'
-                           (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&               // Priority
-                           (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                 // Weight
-                           (_write16(p_rService.m_u16Port, p_rSendParameter)) &&            // Port
-                           (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&   // Compression mark (and offset)
-                           (_write8((uint8_t)u16CachedDomainOffset, p_rSendParameter)))));  // Offset
-
-    DEBUG_EX_ERR(if (!bResult)
-{
-    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV: FAILED!\n"));
-    });
-    return bResult;
-}
-
-}   // namespace MDNSImplementation
-
-} // namespace esp8266
-
-
-
-
+    bool MDNSResponder::_writeMDNSAnswer_SRV(MDNSResponder::stcMDNSService&       p_rService,
+                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    {
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV\n")););
+
+        uint16_t u16CachedDomainOffset = (p_rSendParameter.m_bLegacyQuery
+                                              ? 0
+                                              : p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostname, false));
+
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_SRV,
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+        stcMDNS_RRDomain     hostDomain;
+        bool                 bResult = ((_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&                   // MyESP._http._tcp.local
+                        (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
+                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
+                        (!u16CachedDomainOffset
+                             // No cache for domain name (or no compression allowed)
+                                             ? ((_buildDomainForHost(m_pcHostname, hostDomain)) && (_write16((sizeof(uint16_t /*Prio*/) +  // RDLength
+                                                                                              sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + hostDomain.m_u16NameLength),
+                                                                                             p_rSendParameter))
+                                &&                                                                                                                                                            // Domain length
+                                (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&                                                                                                            // Priority
+                                (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                                                                                              // Weight
+                                (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                                                                                         // Port
+                                (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostname, false, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(hostDomain, p_rSendParameter)))  // Host, eg. esp8266.local
+                             // Cache available for domain
+                                             : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
+                                (_write16((sizeof(uint16_t /*Prio*/) +                                                        // RDLength
+                                           sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + 2),
+                                          p_rSendParameter))
+                                &&                                                                                          // Length of 'C0xx'
+                                (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&                                          // Priority
+                                (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                            // Weight
+                                (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                       // Port
+                                (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&  // Compression mark (and offset)
+                                (_write8((uint8_t)u16CachedDomainOffset, p_rSendParameter)))));                             // Offset
+
+        DEBUG_EX_ERR(if (!bResult)
+                     {
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV: FAILED!\n"));
+                     });
+        return bResult;
+    }
 
+}  // namespace MDNSImplementation
 
+}  // namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h b/libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h
index 3686440f10..ea2128a9ed 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_lwIPdefs.h
@@ -27,4 +27,4 @@
 
 #include <lwip/prot/dns.h>  // DNS_RRTYPE_xxx, DNS_MQUERY_PORT
 
-#endif // MDNS_LWIPDEFS_H
+#endif  // MDNS_LWIPDEFS_H
diff --git a/libraries/Hash/examples/sha1/sha1.ino b/libraries/Hash/examples/sha1/sha1.ino
index e9260ed9c5..945c385e6e 100644
--- a/libraries/Hash/examples/sha1/sha1.ino
+++ b/libraries/Hash/examples/sha1/sha1.ino
@@ -9,7 +9,6 @@ void setup() {
 }
 
 void loop() {
-
   // usage as String
   // SHA1:a9993e364706816aba3e25717850c26c9cd0d89d
 
diff --git a/libraries/I2S/examples/SimpleTone/SimpleTone.ino b/libraries/I2S/examples/SimpleTone/SimpleTone.ino
index 6959ae74ba..535cbf5c0b 100644
--- a/libraries/I2S/examples/SimpleTone/SimpleTone.ino
+++ b/libraries/I2S/examples/SimpleTone/SimpleTone.ino
@@ -10,14 +10,14 @@
 
 #include <I2S.h>
 
-const int frequency = 440; // frequency of square wave in Hz
-const int amplitude = 500; // amplitude of square wave
-const int sampleRate = 8000; // sample rate in Hz
+const int frequency  = 440;   // frequency of square wave in Hz
+const int amplitude  = 500;   // amplitude of square wave
+const int sampleRate = 8000;  // sample rate in Hz
 
-const int halfWavelength = (sampleRate / frequency); // half wavelength of square wave
+const int halfWavelength = (sampleRate / frequency);  // half wavelength of square wave
 
-short sample = amplitude; // current sample value
-int count = 0;
+short sample = amplitude;  // current sample value
+int   count  = 0;
 
 void setup() {
   Serial.begin(115200);
@@ -26,7 +26,8 @@ void setup() {
   // start I2S at the sample rate with 16-bits per sample
   if (!I2S.begin(I2S_PHILIPS_MODE, sampleRate, 16)) {
     Serial.println("Failed to initialize I2S!");
-    while (1); // do nothing
+    while (1)
+      ;  // do nothing
   }
 }
 
@@ -43,4 +44,3 @@ void loop() {
   // increment the counter for the next sample
   count++;
 }
-
diff --git a/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino b/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
index 40e02087dc..628c7490ee 100644
--- a/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
+++ b/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
@@ -9,17 +9,16 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char *ssid = STASSID;
-const char *pass = STAPSK;
+const char* ssid = STASSID;
+const char* pass = STAPSK;
 
-long timezone = 2;
+long timezone    = 2;
 byte daysavetime = 1;
 
-
-void listDir(const char * dirname) {
+void listDir(const char* dirname) {
   Serial.printf("Listing directory: %s\n", dirname);
 
   Dir root = LittleFS.openDir(dirname);
@@ -33,15 +32,14 @@ void listDir(const char * dirname) {
     time_t cr = file.getCreationTime();
     time_t lw = file.getLastWrite();
     file.close();
-    struct tm * tmstruct = localtime(&cr);
+    struct tm* tmstruct = localtime(&cr);
     Serial.printf("    CREATION: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
     tmstruct = localtime(&lw);
     Serial.printf("  LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
   }
 }
 
-
-void readFile(const char * path) {
+void readFile(const char* path) {
   Serial.printf("Reading file: %s\n", path);
 
   File file = LittleFS.open(path, "r");
@@ -57,7 +55,7 @@ void readFile(const char * path) {
   file.close();
 }
 
-void writeFile(const char * path, const char * message) {
+void writeFile(const char* path, const char* message) {
   Serial.printf("Writing file: %s\n", path);
 
   File file = LittleFS.open(path, "w");
@@ -70,11 +68,11 @@ void writeFile(const char * path, const char * message) {
   } else {
     Serial.println("Write failed");
   }
-  delay(2000); // Make sure the CREATE and LASTWRITE times are different
+  delay(2000);  // Make sure the CREATE and LASTWRITE times are different
   file.close();
 }
 
-void appendFile(const char * path, const char * message) {
+void appendFile(const char* path, const char* message) {
   Serial.printf("Appending to file: %s\n", path);
 
   File file = LittleFS.open(path, "a");
@@ -90,7 +88,7 @@ void appendFile(const char * path, const char * message) {
   file.close();
 }
 
-void renameFile(const char * path1, const char * path2) {
+void renameFile(const char* path1, const char* path2) {
   Serial.printf("Renaming file %s to %s\n", path1, path2);
   if (LittleFS.rename(path1, path2)) {
     Serial.println("File renamed");
@@ -99,7 +97,7 @@ void renameFile(const char * path1, const char * path2) {
   }
 }
 
-void deleteFile(const char * path) {
+void deleteFile(const char* path) {
   Serial.printf("Deleting file: %s\n", path);
   if (LittleFS.remove(path)) {
     Serial.println("File deleted");
@@ -127,7 +125,7 @@ void setup() {
   Serial.println(WiFi.localIP());
   Serial.println("Contacting Time Server");
   configTime(3600 * timezone, daysavetime * 3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org");
-  struct tm tmstruct ;
+  struct tm tmstruct;
   delay(2000);
   tmstruct.tm_year = 0;
   getLocalTime(&tmstruct, 5000);
@@ -158,9 +156,6 @@ void setup() {
   }
   readFile("/hello.txt");
   listDir("/");
-
-
 }
 
 void loop() { }
-
diff --git a/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino b/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
index 35e0ac66e6..47963b177f 100644
--- a/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
+++ b/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
@@ -15,13 +15,13 @@
 #define TESTSIZEKB 512
 
 // Format speed in bytes/second.  Static buffer so not re-entrant safe
-const char *rate(unsigned long start, unsigned long stop, unsigned long bytes) {
+const char* rate(unsigned long start, unsigned long stop, unsigned long bytes) {
   static char buff[64];
   if (stop == start) {
     strcpy_P(buff, PSTR("Inf b/s"));
   } else {
     unsigned long delta = stop - start;
-    float r = 1000.0 * (float)bytes / (float)delta;
+    float         r     = 1000.0 * (float)bytes / (float)delta;
     if (r >= 1000000.0) {
       sprintf_P(buff, PSTR("%0.2f MB/s"), r / 1000000.0);
     } else if (r >= 1000.0) {
@@ -33,7 +33,7 @@ const char *rate(unsigned long start, unsigned long stop, unsigned long bytes) {
   return buff;
 }
 
-void DoTest(FS *fs) {
+void DoTest(FS* fs) {
   if (!fs->format()) {
     Serial.printf("Unable to format(), aborting\n");
     return;
@@ -45,12 +45,12 @@ void DoTest(FS *fs) {
 
   uint8_t data[256];
   for (int i = 0; i < 256; i++) {
-    data[i] = (uint8_t) i;
+    data[i] = (uint8_t)i;
   }
 
   Serial.printf("Creating %dKB file, may take a while...\n", TESTSIZEKB);
   unsigned long start = millis();
-  File f = fs->open("/testwrite.bin", "w");
+  File          f     = fs->open("/testwrite.bin", "w");
   if (!f) {
     Serial.printf("Unable to open file for writing, aborting\n");
     return;
@@ -70,7 +70,7 @@ void DoTest(FS *fs) {
 
   Serial.printf("Reading %dKB file sequentially in 256b chunks\n", TESTSIZEKB);
   start = millis();
-  f = fs->open("/testwrite.bin", "r");
+  f     = fs->open("/testwrite.bin", "r");
   for (int i = 0; i < TESTSIZEKB; i++) {
     for (int j = 0; j < 4; j++) {
       f.read(data, 256);
@@ -82,7 +82,7 @@ void DoTest(FS *fs) {
 
   Serial.printf("Reading %dKB file MISALIGNED in flash and RAM sequentially in 256b chunks\n", TESTSIZEKB);
   start = millis();
-  f = fs->open("/testwrite.bin", "r");
+  f     = fs->open("/testwrite.bin", "r");
   f.read();
   for (int i = 0; i < TESTSIZEKB; i++) {
     for (int j = 0; j < 4; j++) {
@@ -95,7 +95,7 @@ void DoTest(FS *fs) {
 
   Serial.printf("Reading %dKB file in reverse by 256b chunks\n", TESTSIZEKB);
   start = millis();
-  f = fs->open("/testwrite.bin", "r");
+  f     = fs->open("/testwrite.bin", "r");
   for (int i = 0; i < TESTSIZEKB; i++) {
     for (int j = 0; j < 4; j++) {
       if (!f.seek(256 + 256 * j * i, SeekEnd)) {
@@ -114,7 +114,7 @@ void DoTest(FS *fs) {
 
   Serial.printf("Writing 64K file in 1-byte chunks\n");
   start = millis();
-  f = fs->open("/test1b.bin", "w");
+  f     = fs->open("/test1b.bin", "w");
   for (int i = 0; i < 65536; i++) {
     f.write((uint8_t*)&i, 1);
   }
@@ -124,7 +124,7 @@ void DoTest(FS *fs) {
 
   Serial.printf("Reading 64K file in 1-byte chunks\n");
   start = millis();
-  f = fs->open("/test1b.bin", "r");
+  f     = fs->open("/test1b.bin", "r");
   for (int i = 0; i < 65536; i++) {
     char c;
     f.read((uint8_t*)&c, 1);
@@ -133,10 +133,9 @@ void DoTest(FS *fs) {
   stop = millis();
   Serial.printf("==> Time to read 64KB in 1b chunks = %lu milliseconds = %s\n", stop - start, rate(start, stop, 65536));
 
-
-  start = millis();
-  auto dest = fs->open("/test1bw.bin", "w");
-  f = fs->open("/test1b.bin", "r");
+  start         = millis();
+  auto dest     = fs->open("/test1bw.bin", "w");
+  f             = fs->open("/test1b.bin", "r");
   auto copysize = f.sendAll(dest);
   dest.close();
   stop = millis();
diff --git a/libraries/Netdump/examples/Netdump/Netdump.ino b/libraries/Netdump/examples/Netdump/Netdump.ino
index dbba63869b..6d7975616f 100644
--- a/libraries/Netdump/examples/Netdump/Netdump.ino
+++ b/libraries/Netdump/examples/Netdump/Netdump.ino
@@ -12,10 +12,10 @@ using namespace NetCapture;
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 Netdump nd;
@@ -37,25 +37,23 @@ enum class SerialOption : uint8_t {
 
 void startSerial(SerialOption option) {
   switch (option) {
-    case SerialOption::AllFull : //All Packets, show packet summary.
+    case SerialOption::AllFull:  //All Packets, show packet summary.
       nd.printDump(Serial, Packet::PacketDetail::FULL);
       break;
 
-    case SerialOption::LocalNone : // Only local IP traffic, full details
+    case SerialOption::LocalNone:  // Only local IP traffic, full details
       nd.printDump(Serial, Packet::PacketDetail::NONE,
-      [](Packet n) {
-        return (n.hasIP(WiFi.localIP()));
-      }
-                  );
+                   [](Packet n) {
+                     return (n.hasIP(WiFi.localIP()));
+                   });
       break;
-    case SerialOption::HTTPChar : // Only HTTP traffic, show packet content as chars
+    case SerialOption::HTTPChar:  // Only HTTP traffic, show packet content as chars
       nd.printDump(Serial, Packet::PacketDetail::CHAR,
-      [](Packet n) {
-        return (n.isHTTP());
-      }
-                  );
+                   [](Packet n) {
+                     return (n.isHTTP());
+                   });
       break;
-    default :
+    default:
       Serial.printf("No valid SerialOption provided\r\n");
   };
 }
@@ -92,37 +90,34 @@ void setup(void) {
   filesystem->begin();
 
   webServer.on("/list",
-  []() {
-    Dir dir = filesystem->openDir("/");
-    String d = "<h1>File list</h1>";
-    while (dir.next()) {
-      d.concat("<li>" + dir.fileName() + "</li>");
-    }
-    webServer.send(200, "text.html", d);
-  }
-              );
+               []() {
+                 Dir    dir = filesystem->openDir("/");
+                 String d   = "<h1>File list</h1>";
+                 while (dir.next()) {
+                   d.concat("<li>" + dir.fileName() + "</li>");
+                 }
+                 webServer.send(200, "text.html", d);
+               });
 
   webServer.on("/req",
-  []() {
-    static int rq = 0;
-    String a = "<h1>You are connected, Number of requests = " + String(rq++) + "</h1>";
-    webServer.send(200, "text/html", a);
-  }
-              );
+               []() {
+                 static int rq = 0;
+                 String     a  = "<h1>You are connected, Number of requests = " + String(rq++) + "</h1>";
+                 webServer.send(200, "text/html", a);
+               });
 
   webServer.on("/reset",
-  []() {
-    nd.reset();
-    tracefile.close();
-    tcpServer.close();
-    webServer.send(200, "text.html", "<h1>Netdump session reset</h1>");
-  }
-              );
+               []() {
+                 nd.reset();
+                 tracefile.close();
+                 tcpServer.close();
+                 webServer.send(200, "text.html", "<h1>Netdump session reset</h1>");
+               });
 
   webServer.serveStatic("/", *filesystem, "/");
   webServer.begin();
 
-  startSerial(SerialOption::AllFull); // Serial output examples, use enum SerialOption for selection
+  startSerial(SerialOption::AllFull);  // Serial output examples, use enum SerialOption for selection
 
   //  startTcpDump();     // tcpdump option
   //  startTracefile();  // output to SPIFFS or LittleFS
@@ -153,4 +148,3 @@ void loop(void) {
   webServer.handleClient();
   MDNS.update();
 }
-
diff --git a/libraries/Netdump/src/Netdump.cpp b/libraries/Netdump/src/Netdump.cpp
index 4d4deb05b2..6af00c4f20 100644
--- a/libraries/Netdump/src/Netdump.cpp
+++ b/libraries/Netdump/src/Netdump.cpp
@@ -23,10 +23,8 @@
 #include <lwip/init.h>
 #include "Schedule.h"
 
-
 namespace NetCapture
 {
-
 CallBackList<Netdump::LwipCallback> Netdump::lwipCallback;
 
 Netdump::Netdump()
@@ -69,24 +67,20 @@ void Netdump::reset()
 void Netdump::printDump(Print& out, Packet::PacketDetail ndd, const Filter nf)
 {
     out.printf_P(PSTR("netDump starting\r\n"));
-    setCallback([&out, ndd, this](const Packet & ndp)
-    {
-        printDumpProcess(out, ndd, ndp);
-    }, nf);
+    setCallback([&out, ndd, this](const Packet& ndp)
+                { printDumpProcess(out, ndd, ndp); },
+                nf);
 }
 
 void Netdump::fileDump(File& outfile, const Filter nf)
 {
-
     writePcapHeader(outfile);
-    setCallback([&outfile, this](const Packet & ndp)
-    {
-        fileDumpProcess(outfile, ndp);
-    }, nf);
+    setCallback([&outfile, this](const Packet& ndp)
+                { fileDumpProcess(outfile, ndp); },
+                nf);
 }
-bool Netdump::tcpDump(WiFiServer &tcpDumpServer, const Filter nf)
+bool Netdump::tcpDump(WiFiServer& tcpDumpServer, const Filter nf)
 {
-
     if (!packetBuffer)
     {
         packetBuffer = new (std::nothrow) char[tcpBufferSize];
@@ -99,9 +93,7 @@ bool Netdump::tcpDump(WiFiServer &tcpDumpServer, const Filter nf)
     bufferIndex = 0;
 
     schedule_function([&tcpDumpServer, this, nf]()
-    {
-        tcpDumpLoop(tcpDumpServer, nf);
-    });
+                      { tcpDumpLoop(tcpDumpServer, nf); });
     return true;
 }
 
@@ -109,7 +101,7 @@ void Netdump::capture(int netif_idx, const char* data, size_t len, int out, int
 {
     if (lwipCallback.execute(netif_idx, data, len, out, success) == 0)
     {
-        phy_capture = nullptr; // No active callback/netdump instances, will be set again by new object.
+        phy_capture = nullptr;  // No active callback/netdump instances, will be set again by new object.
     }
 }
 
@@ -118,7 +110,7 @@ void Netdump::netdumpCapture(int netif_idx, const char* data, size_t len, int ou
     if (netDumpCallback)
     {
         Packet np(millis(), netif_idx, data, len, out, success);
-        if (netDumpFilter  && !netDumpFilter(np))
+        if (netDumpFilter && !netDumpFilter(np))
         {
             return;
         }
@@ -131,8 +123,8 @@ void Netdump::writePcapHeader(Stream& s) const
     uint32_t pcapHeader[6];
     pcapHeader[0] = 0xa1b2c3d4;     // pcap magic number
     pcapHeader[1] = 0x00040002;     // pcap major/minor version
-    pcapHeader[2] = 0;			     // pcap UTC correction in seconds
-    pcapHeader[3] = 0;			     // pcap time stamp accuracy
+    pcapHeader[2] = 0;              // pcap UTC correction in seconds
+    pcapHeader[3] = 0;              // pcap time stamp accuracy
     pcapHeader[4] = maxPcapLength;  // pcap max packet length per record
     pcapHeader[5] = 1;              // pacp data linkt type = ethernet
     s.write(reinterpret_cast<char*>(pcapHeader), 24);
@@ -145,7 +137,7 @@ void Netdump::printDumpProcess(Print& out, Packet::PacketDetail ndd, const Packe
 
 void Netdump::fileDumpProcess(File& outfile, const Packet& np) const
 {
-    size_t incl_len = np.getPacketSize() > maxPcapLength ? maxPcapLength : np.getPacketSize();
+    size_t   incl_len = np.getPacketSize() > maxPcapLength ? maxPcapLength : np.getPacketSize();
     uint32_t pcapHeader[4];
 
     struct timeval tv;
@@ -154,7 +146,7 @@ void Netdump::fileDumpProcess(File& outfile, const Packet& np) const
     pcapHeader[1] = tv.tv_usec;
     pcapHeader[2] = incl_len;
     pcapHeader[3] = np.getPacketSize();
-    outfile.write(reinterpret_cast<char*>(pcapHeader), 16); // pcap record header
+    outfile.write(reinterpret_cast<char*>(pcapHeader), 16);  // pcap record header
 
     outfile.write(np.rawData(), incl_len);
 }
@@ -168,16 +160,16 @@ void Netdump::tcpDumpProcess(const Packet& np)
     }
     size_t incl_len = np.getPacketSize() > maxPcapLength ? maxPcapLength : np.getPacketSize();
 
-    if (bufferIndex + 16 + incl_len < tcpBufferSize) // only add if enough space available
+    if (bufferIndex + 16 + incl_len < tcpBufferSize)  // only add if enough space available
     {
         struct timeval tv;
         gettimeofday(&tv, nullptr);
         uint32_t* pcapHeader = reinterpret_cast<uint32_t*>(&packetBuffer[bufferIndex]);
-        pcapHeader[0] = tv.tv_sec;      // add pcap record header
-        pcapHeader[1] = tv.tv_usec;
-        pcapHeader[2] = incl_len;
-        pcapHeader[3] = np.getPacketSize();
-        bufferIndex += 16; // pcap header size
+        pcapHeader[0]        = tv.tv_sec;  // add pcap record header
+        pcapHeader[1]        = tv.tv_usec;
+        pcapHeader[2]        = incl_len;
+        pcapHeader[3]        = np.getPacketSize();
+        bufferIndex += 16;  // pcap header size
         memcpy(&packetBuffer[bufferIndex], np.rawData(), incl_len);
         bufferIndex += incl_len;
     }
@@ -189,7 +181,7 @@ void Netdump::tcpDumpProcess(const Packet& np)
     }
 }
 
-void Netdump::tcpDumpLoop(WiFiServer &tcpDumpServer, const Filter nf)
+void Netdump::tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf)
 {
     if (tcpDumpServer.hasClient())
     {
@@ -199,10 +191,9 @@ void Netdump::tcpDumpLoop(WiFiServer &tcpDumpServer, const Filter nf)
         bufferIndex = 0;
         writePcapHeader(tcpDumpClient);
 
-        setCallback([this](const Packet & ndp)
-        {
-            tcpDumpProcess(ndp);
-        }, nf);
+        setCallback([this](const Packet& ndp)
+                    { tcpDumpProcess(ndp); },
+                    nf);
     }
     if (!tcpDumpClient || !tcpDumpClient.connected())
     {
@@ -217,10 +208,8 @@ void Netdump::tcpDumpLoop(WiFiServer &tcpDumpServer, const Filter nf)
     if (tcpDumpServer.status() != CLOSED)
     {
         schedule_function([&tcpDumpServer, this, nf]()
-        {
-            tcpDumpLoop(tcpDumpServer, nf);
-        });
+                          { tcpDumpLoop(tcpDumpServer, nf); });
     }
 }
 
-} // namespace NetCapture
+}  // namespace NetCapture
diff --git a/libraries/Netdump/src/NetdumpIP.cpp b/libraries/Netdump/src/NetdumpIP.cpp
index 56936c744a..2f2676cbba 100644
--- a/libraries/Netdump/src/NetdumpIP.cpp
+++ b/libraries/Netdump/src/NetdumpIP.cpp
@@ -23,7 +23,6 @@
 
 namespace NetCapture
 {
-
 NetdumpIP::NetdumpIP()
 {
 }
@@ -37,7 +36,7 @@ NetdumpIP::NetdumpIP(uint8_t first_octet, uint8_t second_octet, uint8_t third_oc
     (*this)[3] = fourth_octet;
 }
 
-NetdumpIP::NetdumpIP(const uint8_t *address, bool v4)
+NetdumpIP::NetdumpIP(const uint8_t* address, bool v4)
 {
     uint8_t cnt;
     if (v4)
@@ -88,7 +87,7 @@ NetdumpIP::NetdumpIP(const String& ip)
     }
 }
 
-bool NetdumpIP::fromString(const char *address)
+bool NetdumpIP::fromString(const char* address)
 {
     if (!fromString4(address))
     {
@@ -97,12 +96,12 @@ bool NetdumpIP::fromString(const char *address)
     return true;
 }
 
-bool NetdumpIP::fromString4(const char *address)
+bool NetdumpIP::fromString4(const char* address)
 {
     // TODO: (IPv4) add support for "a", "a.b", "a.b.c" formats
 
-    uint16_t acc = 0; // Accumulator
-    uint8_t dots = 0;
+    uint16_t acc  = 0;  // Accumulator
+    uint8_t  dots = 0;
 
     while (*address)
     {
@@ -124,7 +123,7 @@ bool NetdumpIP::fromString4(const char *address)
                 return false;
             }
             (*this)[dots++] = acc;
-            acc = 0;
+            acc             = 0;
         }
         else
         {
@@ -144,12 +143,12 @@ bool NetdumpIP::fromString4(const char *address)
     return true;
 }
 
-bool NetdumpIP::fromString6(const char *address)
+bool NetdumpIP::fromString6(const char* address)
 {
     // TODO: test test test
 
-    uint32_t acc = 0; // Accumulator
-    int dots = 0, doubledots = -1;
+    uint32_t acc  = 0;  // Accumulator
+    int      dots = 0, doubledots = -1;
 
     while (*address)
     {
@@ -162,7 +161,7 @@ bool NetdumpIP::fromString6(const char *address)
             }
             acc = acc * 16 + (c - '0');
             if (acc > 0xffff)
-                // Value out of range
+            // Value out of range
             {
                 return false;
             }
@@ -172,7 +171,7 @@ bool NetdumpIP::fromString6(const char *address)
             if (*address == ':')
             {
                 if (doubledots >= 0)
-                    // :: allowed once
+                // :: allowed once
                 {
                     return false;
                 }
@@ -181,22 +180,22 @@ bool NetdumpIP::fromString6(const char *address)
                 address++;
             }
             if (dots == 7)
-                // too many separators
+            // too many separators
             {
                 return false;
             }
             reinterpret_cast<uint16_t*>(rawip)[dots++] = PP_HTONS(acc);
-            acc = 0;
+            acc                                        = 0;
         }
         else
-            // Invalid char
+        // Invalid char
         {
             return false;
         }
     }
 
     if (doubledots == -1 && dots != 7)
-        // Too few separators
+    // Too few separators
     {
         return false;
     }
@@ -223,12 +222,11 @@ String NetdumpIP::toString()
     StreamString sstr;
     if (isV6())
     {
-        sstr.reserve(40); // 8 shorts x 4 chars each + 7 colons + nullterm
-
+        sstr.reserve(40);  // 8 shorts x 4 chars each + 7 colons + nullterm
     }
     else
     {
-        sstr.reserve(16); // 4 bytes with 3 chars max + 3 dots + nullterm, or '(IP unset)'
+        sstr.reserve(16);  // 4 bytes with 3 chars max + 3 dots + nullterm, or '(IP unset)'
     }
     printTo(sstr);
     return sstr;
@@ -253,7 +251,7 @@ size_t NetdumpIP::printTo(Print& p)
             {
                 n += p.printf_P(PSTR("%x"), bit);
                 if (count0 > 0)
-                    // no more hiding 0
+                // no more hiding 0
                 {
                     count0 = -8;
                 }
@@ -280,7 +278,7 @@ size_t NetdumpIP::printTo(Print& p)
     return n;
 }
 
-bool NetdumpIP::compareRaw(IPversion v, const uint8_t* a,  const uint8_t* b) const
+bool NetdumpIP::compareRaw(IPversion v, const uint8_t* a, const uint8_t* b) const
 {
     for (int i = 0; i < (v == IPversion::IPV4 ? 4 : 16); i++)
     {
@@ -296,7 +294,7 @@ bool NetdumpIP::compareIP(const IPAddress& ip) const
 {
     switch (ipv)
     {
-    case IPversion::UNSET :
+    case IPversion::UNSET:
         if (ip.isSet())
         {
             return false;
@@ -306,7 +304,7 @@ bool NetdumpIP::compareIP(const IPAddress& ip) const
             return true;
         }
         break;
-    case IPversion::IPV4 :
+    case IPversion::IPV4:
         if (ip.isV6() || !ip.isSet())
         {
             return false;
@@ -316,7 +314,7 @@ bool NetdumpIP::compareIP(const IPAddress& ip) const
             return compareRaw(IPversion::IPV4, rawip, reinterpret_cast<const uint8_t*>(&ip.v4()));
         }
         break;
-    case IPversion::IPV6 :
+    case IPversion::IPV6:
         if (ip.isV4() || !ip.isSet())
         {
             return false;
@@ -326,7 +324,7 @@ bool NetdumpIP::compareIP(const IPAddress& ip) const
             return compareRaw(IPversion::IPV6, rawip, reinterpret_cast<const uint8_t*>(ip.raw6()));
         }
         break;
-    default :
+    default:
         return false;
         break;
     }
@@ -336,7 +334,7 @@ bool NetdumpIP::compareIP(const NetdumpIP& nip) const
 {
     switch (ipv)
     {
-    case IPversion::UNSET :
+    case IPversion::UNSET:
         if (nip.isSet())
         {
             return false;
@@ -346,7 +344,7 @@ bool NetdumpIP::compareIP(const NetdumpIP& nip) const
             return true;
         }
         break;
-    case IPversion::IPV4 :
+    case IPversion::IPV4:
         if (nip.isV6() || !nip.isSet())
         {
             return false;
@@ -356,7 +354,7 @@ bool NetdumpIP::compareIP(const NetdumpIP& nip) const
             return compareRaw(IPversion::IPV4, rawip, nip.rawip);
         }
         break;
-    case IPversion::IPV6 :
+    case IPversion::IPV6:
         if (nip.isV4() || !nip.isSet())
         {
             return false;
@@ -366,10 +364,10 @@ bool NetdumpIP::compareIP(const NetdumpIP& nip) const
             return compareRaw(IPversion::IPV6, rawip, nip.rawip);
         }
         break;
-    default :
+    default:
         return false;
         break;
     }
 }
 
-} // namespace NetCapture
+}  // namespace NetCapture
diff --git a/libraries/Netdump/src/NetdumpIP.h b/libraries/Netdump/src/NetdumpIP.h
index 8a450c374a..41b1677869 100644
--- a/libraries/Netdump/src/NetdumpIP.h
+++ b/libraries/Netdump/src/NetdumpIP.h
@@ -15,14 +15,13 @@
 
 namespace NetCapture
 {
-
 class NetdumpIP
 {
 public:
     NetdumpIP();
 
     NetdumpIP(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet);
-    NetdumpIP(const uint8_t *address, bool V4 = true);
+    NetdumpIP(const uint8_t* address, bool V4 = true);
     NetdumpIP(const IPAddress& ip);
     NetdumpIP(const String& ip);
 
@@ -31,15 +30,20 @@ class NetdumpIP
         return rawip[index];
     }
 
-    bool fromString(const char *address);
+    bool fromString(const char* address);
 
     String toString();
 
 private:
-    enum class IPversion {UNSET, IPV4, IPV6};
+    enum class IPversion
+    {
+        UNSET,
+        IPV4,
+        IPV6
+    };
     IPversion ipv = IPversion::UNSET;
 
-    uint8_t rawip[16] = {0};
+    uint8_t rawip[16] = { 0 };
 
     void setV4()
     {
@@ -70,14 +74,15 @@ class NetdumpIP
         return (ipv != IPversion::UNSET);
     };
 
-    bool compareRaw(IPversion v, const uint8_t* a,  const uint8_t* b) const;
+    bool compareRaw(IPversion v, const uint8_t* a, const uint8_t* b) const;
     bool compareIP(const IPAddress& ip) const;
     bool compareIP(const NetdumpIP& nip) const;
 
-    bool fromString4(const char *address);
-    bool fromString6(const char *address);
+    bool fromString4(const char* address);
+    bool fromString6(const char* address);
 
     size_t printTo(Print& p);
+
 public:
     bool operator==(const IPAddress& addr) const
     {
@@ -95,9 +100,8 @@ class NetdumpIP
     {
         return !compareIP(addr);
     };
-
 };
 
-} // namespace NetCapture
+}  // namespace NetCapture
 
 #endif /* LIBRARIES_ESPGOODIES_HR_SRC_NETDUMP_NETDUMPIP_H_ */
diff --git a/libraries/Netdump/src/NetdumpPacket.cpp b/libraries/Netdump/src/NetdumpPacket.cpp
index bb4e09920c..e3243cc887 100644
--- a/libraries/Netdump/src/NetdumpPacket.cpp
+++ b/libraries/Netdump/src/NetdumpPacket.cpp
@@ -24,7 +24,6 @@
 
 namespace NetCapture
 {
-
 void Packet::printDetail(Print& out, const String& indent, const char* data, size_t size, PacketDetail pd) const
 {
     if (pd == PacketDetail::NONE)
@@ -159,16 +158,17 @@ void Packet::MACtoString(int dataIdx, StreamString& sstr) const
             sstr.print(':');
         }
     }
-
 }
 
 void Packet::ARPtoString(PacketDetail netdumpDetail, StreamString& sstr) const
 {
     switch (getARPType())
     {
-    case 1 : sstr.printf_P(PSTR("who has %s tell %s"), getIP(ETH_HDR_LEN + 24).toString().c_str(), getIP(ETH_HDR_LEN + 14).toString().c_str());
+    case 1:
+        sstr.printf_P(PSTR("who has %s tell %s"), getIP(ETH_HDR_LEN + 24).toString().c_str(), getIP(ETH_HDR_LEN + 14).toString().c_str());
         break;
-    case 2 : sstr.printf_P(PSTR("%s is at "), getIP(ETH_HDR_LEN + 14).toString().c_str());
+    case 2:
+        sstr.printf_P(PSTR("%s is at "), getIP(ETH_HDR_LEN + 14).toString().c_str());
         MACtoString(ETH_HDR_LEN + 8, sstr);
         break;
     }
@@ -217,7 +217,7 @@ void Packet::TCPtoString(PacketDetail netdumpDetail, StreamString& sstr) const
     sstr.printf_P(PSTR("%d:%d "), getSrcPort(), getDstPort());
     uint16_t flags = getTcpFlags();
     sstr.print('[');
-    const char chars [] = "FSRPAUECN";
+    const char chars[] = "FSRPAUECN";
     for (uint8_t i = 0; i < sizeof chars; i++)
         if (flags & (1 << i))
         {
@@ -237,20 +237,36 @@ void Packet::ICMPtoString(PacketDetail, StreamString& sstr) const
     {
         switch (getIcmpType())
         {
-        case 0 : sstr.printf_P(PSTR("ping reply")); break;
-        case 8 : sstr.printf_P(PSTR("ping request")); break;
-        default: sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType()); break;
+        case 0:
+            sstr.printf_P(PSTR("ping reply"));
+            break;
+        case 8:
+            sstr.printf_P(PSTR("ping request"));
+            break;
+        default:
+            sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType());
+            break;
         }
     }
     if (isIPv6())
     {
         switch (getIcmpType())
         {
-        case 129 : sstr.printf_P(PSTR("ping reply")); break;
-        case 128 : sstr.printf_P(PSTR("ping request")); break;
-        case 135 : sstr.printf_P(PSTR("Neighbour solicitation")); break;
-        case 136 : sstr.printf_P(PSTR("Neighbour advertisement")); break;
-        default: sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType()); break;
+        case 129:
+            sstr.printf_P(PSTR("ping reply"));
+            break;
+        case 128:
+            sstr.printf_P(PSTR("ping request"));
+            break;
+        case 135:
+            sstr.printf_P(PSTR("Neighbour solicitation"));
+            break;
+        case 136:
+            sstr.printf_P(PSTR("Neighbour advertisement"));
+            break;
+        default:
+            sstr.printf_P(PSTR("type(0x%02x)"), getIcmpType());
+            break;
         }
     }
     sstr.printf_P(PSTR("\r\n"));
@@ -260,18 +276,42 @@ void Packet::IGMPtoString(PacketDetail, StreamString& sstr) const
 {
     switch (getIgmpType())
     {
-    case 1 : sstr.printf_P(PSTR("Create Group Request")); break;
-    case 2 : sstr.printf_P(PSTR("Create Group Reply")); break;
-    case 3 : sstr.printf_P(PSTR("Join Group Request")); break;
-    case 4 : sstr.printf_P(PSTR("Join Group Reply")); break;
-    case 5 : sstr.printf_P(PSTR("Leave Group Request")); break;
-    case 6 : sstr.printf_P(PSTR("Leave Group Reply")); break;
-    case 7 : sstr.printf_P(PSTR("Confirm Group Request")); break;
-    case 8 : sstr.printf_P(PSTR("Confirm Group Reply")); break;
-    case 0x11 : sstr.printf_P(PSTR("Group Membership Query")); break;
-    case 0x12 : sstr.printf_P(PSTR("IGMPv1 Membership Report")); break;
-    case 0x22 : sstr.printf_P(PSTR("IGMPv3 Membership Report")); break;
-    default: sstr.printf_P(PSTR("type(0x%02x)"), getIgmpType()); break;
+    case 1:
+        sstr.printf_P(PSTR("Create Group Request"));
+        break;
+    case 2:
+        sstr.printf_P(PSTR("Create Group Reply"));
+        break;
+    case 3:
+        sstr.printf_P(PSTR("Join Group Request"));
+        break;
+    case 4:
+        sstr.printf_P(PSTR("Join Group Reply"));
+        break;
+    case 5:
+        sstr.printf_P(PSTR("Leave Group Request"));
+        break;
+    case 6:
+        sstr.printf_P(PSTR("Leave Group Reply"));
+        break;
+    case 7:
+        sstr.printf_P(PSTR("Confirm Group Request"));
+        break;
+    case 8:
+        sstr.printf_P(PSTR("Confirm Group Reply"));
+        break;
+    case 0x11:
+        sstr.printf_P(PSTR("Group Membership Query"));
+        break;
+    case 0x12:
+        sstr.printf_P(PSTR("IGMPv1 Membership Report"));
+        break;
+    case 0x22:
+        sstr.printf_P(PSTR("IGMPv3 Membership Report"));
+        break;
+    default:
+        sstr.printf_P(PSTR("type(0x%02x)"), getIgmpType());
+        break;
     }
     sstr.printf_P(PSTR("\r\n"));
 }
@@ -298,7 +338,6 @@ const String Packet::toString() const
     return toString(PacketDetail::NONE);
 }
 
-
 const String Packet::toString(PacketDetail netdumpDetail) const
 {
     StreamString sstr;
@@ -320,56 +359,56 @@ const String Packet::toString(PacketDetail netdumpDetail) const
 
     switch (thisPacketType)
     {
-    case PacketType::ARP :
+    case PacketType::ARP:
     {
         ARPtoString(netdumpDetail, sstr);
         break;
     }
-    case PacketType::MDNS :
-    case PacketType::DNS :
+    case PacketType::MDNS:
+    case PacketType::DNS:
     {
         DNStoString(netdumpDetail, sstr);
         break;
     }
-    case PacketType::SSDP :
-    case PacketType::DHCP :
-    case PacketType::WSDD :
-    case PacketType::NETBIOS :
-    case PacketType::SMB :
-    case PacketType::OTA :
-    case PacketType::UDP :
+    case PacketType::SSDP:
+    case PacketType::DHCP:
+    case PacketType::WSDD:
+    case PacketType::NETBIOS:
+    case PacketType::SMB:
+    case PacketType::OTA:
+    case PacketType::UDP:
     {
         UDPtoString(netdumpDetail, sstr);
         break;
     }
-    case PacketType::TCP :
-    case PacketType::HTTP :
+    case PacketType::TCP:
+    case PacketType::HTTP:
     {
         TCPtoString(netdumpDetail, sstr);
         break;
     }
-    case PacketType::ICMP :
+    case PacketType::ICMP:
     {
         ICMPtoString(netdumpDetail, sstr);
         break;
     }
-    case PacketType::IGMP :
+    case PacketType::IGMP:
     {
         IGMPtoString(netdumpDetail, sstr);
         break;
     }
-    case PacketType::IPv4 :
-    case PacketType::IPv6 :
+    case PacketType::IPv4:
+    case PacketType::IPv6:
     {
         IPtoString(netdumpDetail, sstr);
         break;
     }
-    case PacketType::UKNW :
+    case PacketType::UKNW:
     {
         UKNWtoString(netdumpDetail, sstr);
         break;
     }
-    default :
+    default:
     {
         sstr.printf_P(PSTR("Non identified packet\r\n"));
         break;
@@ -378,4 +417,4 @@ const String Packet::toString(PacketDetail netdumpDetail) const
     return sstr;
 }
 
-} // namespace NetCapture
+}  // namespace NetCapture
diff --git a/libraries/Netdump/src/NetdumpPacket.h b/libraries/Netdump/src/NetdumpPacket.h
index a898ef230f..1c11f4ee84 100644
--- a/libraries/Netdump/src/NetdumpPacket.h
+++ b/libraries/Netdump/src/NetdumpPacket.h
@@ -31,14 +31,13 @@
 
 namespace NetCapture
 {
-
 int constexpr ETH_HDR_LEN = 14;
 
 class Packet
 {
 public:
-    Packet(unsigned long msec, int n, const char* d, size_t l, int o, int s)
-        : packetTime(msec), netif_idx(n), data(d), packetLength(l), out(o), success(s)
+    Packet(unsigned long msec, int n, const char* d, size_t l, int o, int s) :
+        packetTime(msec), netif_idx(n), data(d), packetLength(l), out(o), success(s)
     {
         setPacketTypes();
     };
@@ -75,7 +74,7 @@ class Packet
     {
         return ntoh16(idx + 2) | (((uint32_t)ntoh16(idx)) << 16);
     };
-    uint8_t  byteData(uint16_t idx) const
+    uint8_t byteData(uint16_t idx) const
     {
         return data[idx];
     }
@@ -87,17 +86,17 @@ class Packet
     {
         return ntoh16(12);
     };
-    uint8_t  ipType() const
+    uint8_t ipType() const
     {
         return isIP() ? isIPv4() ? data[ETH_HDR_LEN + 9] : data[ETH_HDR_LEN + 6] : 0;
     };
     uint16_t getIpHdrLen() const
     {
-        return isIPv4() ? (((unsigned char)data[ETH_HDR_LEN]) & 0x0f) << 2 : 40 ;   // IPv6 is fixed length
+        return isIPv4() ? (((unsigned char)data[ETH_HDR_LEN]) & 0x0f) << 2 : 40;  // IPv6 is fixed length
     }
     uint16_t getIpTotalLen() const
     {
-        return isIP() ? isIPv4() ? ntoh16(ETH_HDR_LEN + 2) : (packetLength - ETH_HDR_LEN)   :  0;
+        return isIP() ? isIPv4() ? ntoh16(ETH_HDR_LEN + 2) : (packetLength - ETH_HDR_LEN) : 0;
     }
     uint32_t getTcpSeq() const
     {
@@ -115,20 +114,20 @@ class Packet
     {
         return isTCP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 14) : 0;
     }
-    uint8_t  getTcpHdrLen() const
+    uint8_t getTcpHdrLen() const
     {
         return isTCP() ? (data[ETH_HDR_LEN + getIpHdrLen() + 12] >> 4) * 4 : 0;
-    };//Header len is in multiple of 4 bytes
+    };  //Header len is in multiple of 4 bytes
     uint16_t getTcpLen() const
     {
-        return isTCP() ? getIpTotalLen() - getIpHdrLen() - getTcpHdrLen() : 0 ;
+        return isTCP() ? getIpTotalLen() - getIpHdrLen() - getTcpHdrLen() : 0;
     };
 
-    uint8_t  getIcmpType() const
+    uint8_t getIcmpType() const
     {
         return isICMP() ? data[ETH_HDR_LEN + getIpHdrLen() + 0] : 0;
     }
-    uint8_t  getIgmpType() const
+    uint8_t getIgmpType() const
     {
         return isIGMP() ? data[ETH_HDR_LEN + getIpHdrLen() + 0] : 0;
     }
@@ -136,11 +135,11 @@ class Packet
     {
         return isARP() ? data[ETH_HDR_LEN + 7] : 0;
     }
-    bool    is_ARP_who() const
+    bool is_ARP_who() const
     {
         return (getARPType() == 1);
     }
-    bool    is_ARP_is() const
+    bool is_ARP_is() const
     {
         return (getARPType() == 2);
     }
@@ -244,7 +243,7 @@ class Packet
         return ip;
     };
 
-    bool      hasIP(NetdumpIP ip) const
+    bool hasIP(NetdumpIP ip) const
     {
         return (isIP() && ((ip == sourceIP()) || (ip == destIP())));
     }
@@ -270,21 +269,19 @@ class Packet
     {
         return isIP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 2) : 0;
     }
-    bool     hasPort(uint16_t p) const
+    bool hasPort(uint16_t p) const
     {
         return (isIP() && ((getSrcPort() == p) || (getDstPort() == p)));
     }
 
     const String toString() const;
     const String toString(PacketDetail netdumpDetail) const;
-    void printDetail(Print& out, const String& indent, const char* data, size_t size, PacketDetail pd) const;
+    void         printDetail(Print& out, const String& indent, const char* data, size_t size, PacketDetail pd) const;
 
-    const PacketType packetType() const;
+    const PacketType               packetType() const;
     const std::vector<PacketType>& allPacketTypes() const;
 
-
 private:
-
     void setPacketType(PacketType);
     void setPacketTypes();
 
@@ -298,17 +295,16 @@ class Packet
     void IPtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
     void UKNWtoString(PacketDetail netdumpDetail, StreamString& sstr) const;
 
-
-    time_t packetTime;
-    int netif_idx;
-    const char* data;
-    size_t packetLength;
-    int out;
-    int success;
-    PacketType thisPacketType;
+    time_t                  packetTime;
+    int                     netif_idx;
+    const char*             data;
+    size_t                  packetLength;
+    int                     out;
+    int                     success;
+    PacketType              thisPacketType;
     std::vector<PacketType> thisAllPacketTypes;
 };
 
-} // namespace NetCapture
+}  // namespace NetCapture
 
 #endif /* __NETDUMP_PACKET_H */
diff --git a/libraries/Netdump/src/PacketType.cpp b/libraries/Netdump/src/PacketType.cpp
index 565aa55f0a..b2d6f84e75 100644
--- a/libraries/Netdump/src/PacketType.cpp
+++ b/libraries/Netdump/src/PacketType.cpp
@@ -9,7 +9,6 @@
 
 namespace NetCapture
 {
-
 PacketType::PacketType()
 {
 }
@@ -18,25 +17,44 @@ String PacketType::toString() const
 {
     switch (ptype)
     {
-    case PType::ARP :    return PSTR("ARP");
-    case PType::IP :     return PSTR("IP");
-    case PType::UDP :    return PSTR("UDP");
-    case PType::MDNS :   return PSTR("MDNS");
-    case PType::DNS :    return PSTR("DNS");
-    case PType::SSDP :   return PSTR("SSDP");
-    case PType::DHCP :   return PSTR("DHCP");
-    case PType::WSDD :   return PSTR("WSDD");
-    case PType::NETBIOS: return PSTR("NBIO");
-    case PType::SMB :    return PSTR("SMB");
-    case PType::OTA :    return PSTR("OTA");
-    case PType::TCP :    return PSTR("TCP");
-    case PType::HTTP :   return PSTR("HTTP");
-    case PType::ICMP :   return PSTR("ICMP");
-    case PType::IGMP :   return PSTR("IGMP");
-    case PType::IPv4:    return PSTR("IPv4");
-    case PType::IPv6:    return PSTR("IPv6");
-    case PType::UKNW :   return PSTR("UKNW");
-    default :            return PSTR("ERR");
+    case PType::ARP:
+        return PSTR("ARP");
+    case PType::IP:
+        return PSTR("IP");
+    case PType::UDP:
+        return PSTR("UDP");
+    case PType::MDNS:
+        return PSTR("MDNS");
+    case PType::DNS:
+        return PSTR("DNS");
+    case PType::SSDP:
+        return PSTR("SSDP");
+    case PType::DHCP:
+        return PSTR("DHCP");
+    case PType::WSDD:
+        return PSTR("WSDD");
+    case PType::NETBIOS:
+        return PSTR("NBIO");
+    case PType::SMB:
+        return PSTR("SMB");
+    case PType::OTA:
+        return PSTR("OTA");
+    case PType::TCP:
+        return PSTR("TCP");
+    case PType::HTTP:
+        return PSTR("HTTP");
+    case PType::ICMP:
+        return PSTR("ICMP");
+    case PType::IGMP:
+        return PSTR("IGMP");
+    case PType::IPv4:
+        return PSTR("IPv4");
+    case PType::IPv6:
+        return PSTR("IPv6");
+    case PType::UKNW:
+        return PSTR("UKNW");
+    default:
+        return PSTR("ERR");
     };
 }
 
diff --git a/libraries/Netdump/src/PacketType.h b/libraries/Netdump/src/PacketType.h
index 8f4aa5ce79..28d96ae7bc 100644
--- a/libraries/Netdump/src/PacketType.h
+++ b/libraries/Netdump/src/PacketType.h
@@ -11,11 +11,9 @@
 
 namespace NetCapture
 {
-
 class PacketType
 {
 public:
-
     enum PType : int
     {
         ARP,
@@ -39,7 +37,8 @@ class PacketType
     };
 
     PacketType();
-    PacketType(PType pt) : ptype(pt) {};
+    PacketType(PType pt) :
+        ptype(pt) {};
 
     operator PType() const
     {
diff --git a/libraries/SD/examples/DumpFile/DumpFile.ino b/libraries/SD/examples/DumpFile/DumpFile.ino
index 3574652890..038cfc1c01 100644
--- a/libraries/SD/examples/DumpFile/DumpFile.ino
+++ b/libraries/SD/examples/DumpFile/DumpFile.ino
@@ -58,4 +58,3 @@ void setup() {
 
 void loop() {
 }
-
diff --git a/libraries/SD/examples/listfiles/listfiles.ino b/libraries/SD/examples/listfiles/listfiles.ino
index 55478d7080..9ce85c26ae 100644
--- a/libraries/SD/examples/listfiles/listfiles.ino
+++ b/libraries/SD/examples/listfiles/listfiles.ino
@@ -51,9 +51,8 @@ void loop() {
 
 void printDirectory(File dir, int numTabs) {
   while (true) {
-
-    File entry =  dir.openNextFile();
-    if (! entry) {
+    File entry = dir.openNextFile();
+    if (!entry) {
       // no more files
       break;
     }
@@ -68,9 +67,9 @@ void printDirectory(File dir, int numTabs) {
       // files have sizes, directories do not
       Serial.print("\t\t");
       Serial.print(entry.size(), DEC);
-      time_t cr = entry.getCreationTime();
-      time_t lw = entry.getLastWrite();
-      struct tm * tmstruct = localtime(&cr);
+      time_t     cr       = entry.getCreationTime();
+      time_t     lw       = entry.getLastWrite();
+      struct tm* tmstruct = localtime(&cr);
       Serial.printf("\tCREATION: %d-%02d-%02d %02d:%02d:%02d", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
       tmstruct = localtime(&lw);
       Serial.printf("\tLAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
diff --git a/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino b/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
index 528e52ed81..93ea348cc6 100644
--- a/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
+++ b/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
@@ -18,72 +18,73 @@
 
 class ESPMaster {
   private:
-    uint8_t _ss_pin;
+  uint8_t _ss_pin;
 
   public:
-    ESPMaster(uint8_t pin): _ss_pin(pin) {}
-    void begin() {
-      pinMode(_ss_pin, OUTPUT);
-      digitalWrite(_ss_pin, HIGH);
-    }
+  ESPMaster(uint8_t pin) :
+      _ss_pin(pin) { }
+  void begin() {
+    pinMode(_ss_pin, OUTPUT);
+    digitalWrite(_ss_pin, HIGH);
+  }
 
-    uint32_t readStatus() {
-      digitalWrite(_ss_pin, LOW);
-      SPI.transfer(0x04);
-      uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
-      digitalWrite(_ss_pin, HIGH);
-      return status;
-    }
+  uint32_t readStatus() {
+    digitalWrite(_ss_pin, LOW);
+    SPI.transfer(0x04);
+    uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
+    digitalWrite(_ss_pin, HIGH);
+    return status;
+  }
 
-    void writeStatus(uint32_t status) {
-      digitalWrite(_ss_pin, LOW);
-      SPI.transfer(0x01);
-      SPI.transfer(status & 0xFF);
-      SPI.transfer((status >> 8) & 0xFF);
-      SPI.transfer((status >> 16) & 0xFF);
-      SPI.transfer((status >> 24) & 0xFF);
-      digitalWrite(_ss_pin, HIGH);
-    }
+  void writeStatus(uint32_t status) {
+    digitalWrite(_ss_pin, LOW);
+    SPI.transfer(0x01);
+    SPI.transfer(status & 0xFF);
+    SPI.transfer((status >> 8) & 0xFF);
+    SPI.transfer((status >> 16) & 0xFF);
+    SPI.transfer((status >> 24) & 0xFF);
+    digitalWrite(_ss_pin, HIGH);
+  }
 
-    void readData(uint8_t * data) {
-      digitalWrite(_ss_pin, LOW);
-      SPI.transfer(0x03);
-      SPI.transfer(0x00);
-      for (uint8_t i = 0; i < 32; i++) {
-        data[i] = SPI.transfer(0);
-      }
-      digitalWrite(_ss_pin, HIGH);
+  void readData(uint8_t* data) {
+    digitalWrite(_ss_pin, LOW);
+    SPI.transfer(0x03);
+    SPI.transfer(0x00);
+    for (uint8_t i = 0; i < 32; i++) {
+      data[i] = SPI.transfer(0);
     }
+    digitalWrite(_ss_pin, HIGH);
+  }
 
-    void writeData(uint8_t * data, size_t len) {
-      uint8_t i = 0;
-      digitalWrite(_ss_pin, LOW);
-      SPI.transfer(0x02);
-      SPI.transfer(0x00);
-      while (len-- && i < 32) {
-        SPI.transfer(data[i++]);
-      }
-      while (i++ < 32) {
-        SPI.transfer(0);
-      }
-      digitalWrite(_ss_pin, HIGH);
+  void writeData(uint8_t* data, size_t len) {
+    uint8_t i = 0;
+    digitalWrite(_ss_pin, LOW);
+    SPI.transfer(0x02);
+    SPI.transfer(0x00);
+    while (len-- && i < 32) {
+      SPI.transfer(data[i++]);
     }
-
-    String readData() {
-      char data[33];
-      data[32] = 0;
-      readData((uint8_t *)data);
-      return String(data);
+    while (i++ < 32) {
+      SPI.transfer(0);
     }
+    digitalWrite(_ss_pin, HIGH);
+  }
 
-    void writeData(const char * data) {
-      writeData((uint8_t *)data, strlen(data));
-    }
+  String readData() {
+    char data[33];
+    data[32] = 0;
+    readData((uint8_t*)data);
+    return String(data);
+  }
+
+  void writeData(const char* data) {
+    writeData((uint8_t*)data, strlen(data));
+  }
 };
 
 ESPMaster esp(SS);
 
-void send(const char * message) {
+void send(const char* message) {
   Serial.print("Master: ");
   Serial.println(message);
   esp.writeData(message);
diff --git a/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino b/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
index 04c23c4502..0da735fc74 100644
--- a/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
+++ b/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
@@ -19,76 +19,78 @@
 
 class ESPSafeMaster {
   private:
-    uint8_t _ss_pin;
-    void _pulseSS() {
-      digitalWrite(_ss_pin, HIGH);
-      delayMicroseconds(5);
-      digitalWrite(_ss_pin, LOW);
-    }
+  uint8_t _ss_pin;
+  void    _pulseSS() {
+    digitalWrite(_ss_pin, HIGH);
+    delayMicroseconds(5);
+    digitalWrite(_ss_pin, LOW);
+  }
+
   public:
-    ESPSafeMaster(uint8_t pin): _ss_pin(pin) {}
-    void begin() {
-      pinMode(_ss_pin, OUTPUT);
-      _pulseSS();
-    }
+  ESPSafeMaster(uint8_t pin) :
+      _ss_pin(pin) { }
+  void begin() {
+    pinMode(_ss_pin, OUTPUT);
+    _pulseSS();
+  }
 
-    uint32_t readStatus() {
-      _pulseSS();
-      SPI.transfer(0x04);
-      uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
-      _pulseSS();
-      return status;
-    }
+  uint32_t readStatus() {
+    _pulseSS();
+    SPI.transfer(0x04);
+    uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
+    _pulseSS();
+    return status;
+  }
 
-    void writeStatus(uint32_t status) {
-      _pulseSS();
-      SPI.transfer(0x01);
-      SPI.transfer(status & 0xFF);
-      SPI.transfer((status >> 8) & 0xFF);
-      SPI.transfer((status >> 16) & 0xFF);
-      SPI.transfer((status >> 24) & 0xFF);
-      _pulseSS();
-    }
+  void writeStatus(uint32_t status) {
+    _pulseSS();
+    SPI.transfer(0x01);
+    SPI.transfer(status & 0xFF);
+    SPI.transfer((status >> 8) & 0xFF);
+    SPI.transfer((status >> 16) & 0xFF);
+    SPI.transfer((status >> 24) & 0xFF);
+    _pulseSS();
+  }
 
-    void readData(uint8_t * data) {
-      _pulseSS();
-      SPI.transfer(0x03);
-      SPI.transfer(0x00);
-      for (uint8_t i = 0; i < 32; i++) {
-        data[i] = SPI.transfer(0);
-      }
-      _pulseSS();
+  void readData(uint8_t* data) {
+    _pulseSS();
+    SPI.transfer(0x03);
+    SPI.transfer(0x00);
+    for (uint8_t i = 0; i < 32; i++) {
+      data[i] = SPI.transfer(0);
     }
+    _pulseSS();
+  }
 
-    void writeData(uint8_t * data, size_t len) {
-      uint8_t i = 0;
-      _pulseSS();
-      SPI.transfer(0x02);
-      SPI.transfer(0x00);
-      while (len-- && i < 32) {
-        SPI.transfer(data[i++]);
-      }
-      while (i++ < 32) {
-        SPI.transfer(0);
-      }
-      _pulseSS();
+  void writeData(uint8_t* data, size_t len) {
+    uint8_t i = 0;
+    _pulseSS();
+    SPI.transfer(0x02);
+    SPI.transfer(0x00);
+    while (len-- && i < 32) {
+      SPI.transfer(data[i++]);
     }
-
-    String readData() {
-      char data[33];
-      data[32] = 0;
-      readData((uint8_t *)data);
-      return String(data);
+    while (i++ < 32) {
+      SPI.transfer(0);
     }
+    _pulseSS();
+  }
 
-    void writeData(const char * data) {
-      writeData((uint8_t *)data, strlen(data));
-    }
+  String readData() {
+    char data[33];
+    data[32] = 0;
+    readData((uint8_t*)data);
+    return String(data);
+  }
+
+  void writeData(const char* data) {
+    writeData((uint8_t*)data, strlen(data));
+  }
 };
 
 ESPSafeMaster esp(SS);
 
-void send(const char * message) {
+void send(const char* message) {
   Serial.print("Master: ");
   Serial.println(message);
   esp.writeData(message);
diff --git a/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino b/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
index 0be83fd298..7ddfc92720 100644
--- a/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
+++ b/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
@@ -24,9 +24,9 @@ void setup() {
   // data has been received from the master. Beware that len is always 32
   // and the buffer is autofilled with zeroes if data is less than 32 bytes long
   // It's up to the user to implement protocol for handling data length
-  SPISlave.onData([](uint8_t * data, size_t len) {
-    String message = String((char *)data);
-    (void) len;
+  SPISlave.onData([](uint8_t* data, size_t len) {
+    String message = String((char*)data);
+    (void)len;
     if (message.equals("Hello Slave!")) {
       SPISlave.setData("Hello Master!");
     } else if (message.equals("Are you alive?")) {
@@ -36,7 +36,7 @@ void setup() {
     } else {
       SPISlave.setData("Say what?");
     }
-    Serial.printf("Question: %s\n", (char *)data);
+    Serial.printf("Question: %s\n", (char*)data);
   });
 
   // The master has read out outgoing data buffer
@@ -50,7 +50,7 @@ void setup() {
   // Can be used to exchange small data or status information
   SPISlave.onStatus([](uint32_t data) {
     Serial.printf("Status: %u\n", data);
-    SPISlave.setStatus(millis()); //set next status
+    SPISlave.setStatus(millis());  //set next status
   });
 
   // The master has read the status register
@@ -69,4 +69,4 @@ void setup() {
   SPISlave.setData("Ask me a question!");
 }
 
-void loop() {}
+void loop() { }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino b/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
index fbc22a861c..29d7c48527 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
@@ -8,21 +8,20 @@
 #include <SPI.h>
 
 void setup() {
-  TFT_BL_ON;                                          //turn on the background light
+  TFT_BL_ON;  //turn on the background light
 
-  Tft.TFTinit();                                      //init TFT library
+  Tft.TFTinit();  //init TFT library
 
-  Tft.drawCircle(100, 100, 30, YELLOW);               //center: (100, 100), r = 30 ,color : YELLOW
+  Tft.drawCircle(100, 100, 30, YELLOW);  //center: (100, 100), r = 30 ,color : YELLOW
 
-  Tft.drawCircle(100, 200, 40, CYAN);                 // center: (100, 200), r = 10 ,color : CYAN
+  Tft.drawCircle(100, 200, 40, CYAN);  // center: (100, 200), r = 10 ,color : CYAN
 
-  Tft.fillCircle(200, 100, 30, RED);                  //center: (200, 100), r = 30 ,color : RED
+  Tft.fillCircle(200, 100, 30, RED);  //center: (200, 100), r = 30 ,color : RED
 
-  Tft.fillCircle(200, 200, 30, BLUE);                 //center: (200, 200), r = 30 ,color : BLUE
+  Tft.fillCircle(200, 200, 30, BLUE);  //center: (200, 200), r = 30 ,color : BLUE
 }
 
 void loop() {
-
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino b/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
index a777044d3e..b2b6d3c293 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
@@ -8,10 +8,10 @@
 #include <TFTv2.h>
 #include <SPI.h>
 void setup() {
-  TFT_BL_ON;                                  // turn on the background light
-  Tft.TFTinit();                              //init TFT library
+  TFT_BL_ON;      // turn on the background light
+  Tft.TFTinit();  //init TFT library
 
-  Tft.drawLine(0, 0, 239, 319, RED);          //start: (0, 0) end: (239, 319), color : RED
+  Tft.drawLine(0, 0, 239, 319, RED);  //start: (0, 0) end: (239, 319), color : RED
 
   Tft.drawVerticalLine(60, 100, 100, GREEN);  // Draw a vertical line
   // start: (60, 100) length: 100 color: green
@@ -21,7 +21,6 @@ void setup() {
 }
 
 void loop() {
-
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino b/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
index ed62233796..be303b6988 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
@@ -9,28 +9,26 @@
 #include <SPI.h>
 
 void setup() {
-  TFT_BL_ON;                                      // turn on the background light
+  TFT_BL_ON;  // turn on the background light
 
-  Tft.TFTinit();                                  // init TFT library
+  Tft.TFTinit();  // init TFT library
 
-  Tft.drawNumber(1024, 0, 0, 1, RED);             // draw a integer: 1024, Location: (0, 0),  size: 1, color: RED
+  Tft.drawNumber(1024, 0, 0, 1, RED);  // draw a integer: 1024, Location: (0, 0),  size: 1, color: RED
 
-  Tft.drawNumber(1024, 0, 20, 2, BLUE);           // draw a integer: 1024, Location: (0, 20), size: 2, color: BLUE
+  Tft.drawNumber(1024, 0, 20, 2, BLUE);  // draw a integer: 1024, Location: (0, 20), size: 2, color: BLUE
 
-  Tft.drawNumber(1024, 0, 50, 3, GREEN);          // draw a integer: 1024, Location: (0, 50), size: 3, color: GREEN
+  Tft.drawNumber(1024, 0, 50, 3, GREEN);  // draw a integer: 1024, Location: (0, 50), size: 3, color: GREEN
 
-  Tft.drawNumber(1024, 0, 90, 4, BLUE);           // draw a integer: 1024, Location: (0, 90), size:4, color: BLUE
+  Tft.drawNumber(1024, 0, 90, 4, BLUE);  // draw a integer: 1024, Location: (0, 90), size:4, color: BLUE
 
-  Tft.drawFloat(1.2345, 0, 150, 4, YELLOW);       // draw a float number: 1.2345, Location: (0, 150), size: 4, color: YELLOW
+  Tft.drawFloat(1.2345, 0, 150, 4, YELLOW);  // draw a float number: 1.2345, Location: (0, 150), size: 4, color: YELLOW
 
-  Tft.drawFloat(1.2345, 2, 0, 200, 4, BLUE);      // draw a float number: 1.2345: Location: (0, 200), size: 4, decimal: 2, color: BLUE
-
-  Tft.drawFloat(1.2345, 4, 0, 250, 4, RED);       // draw a float number: 1.2345 Location: (0, 250), size: 4, decimal: 4, color: RED
+  Tft.drawFloat(1.2345, 2, 0, 200, 4, BLUE);  // draw a float number: 1.2345: Location: (0, 200), size: 4, decimal: 2, color: BLUE
 
+  Tft.drawFloat(1.2345, 4, 0, 250, 4, RED);  // draw a float number: 1.2345 Location: (0, 250), size: 4, decimal: 4, color: RED
 }
 
 void loop() {
-
 }
 
 /*********************************************************************************************************
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino b/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
index a2d7af8709..fe61bae0af 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
@@ -17,7 +17,6 @@ void setup() {
 }
 
 void loop() {
-
 }
 /*********************************************************************************************************
   END FILE
diff --git a/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino b/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
index dc13088b9f..41c5ed3306 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
@@ -4,15 +4,15 @@
 #include <TFTv2.h>
 #include <SPI.h>
 
-int ColorPaletteHigh = 30;
-int color = WHITE;  //Paint brush color
-unsigned int colors[8] = {BLACK, RED, GREEN, BLUE, CYAN, YELLOW, WHITE, GRAY1};
+int          ColorPaletteHigh = 30;
+int          color            = WHITE;  //Paint brush color
+unsigned int colors[8]        = { BLACK, RED, GREEN, BLUE, CYAN, YELLOW, WHITE, GRAY1 };
 
 // For better pressure precision, we need to know the resistance
 // between X+ and X- Use any multimeter to read it
 // The 2.8" TFT Touch shield has 300 ohms across the X plate
 
-TouchScreen ts = TouchScreen(XP, YP, XM, YM); //init TouchScreen port pins
+TouchScreen ts = TouchScreen(XP, YP, XM, YM);  //init TouchScreen port pins
 
 void setup() {
   Tft.TFTinit();  //init TFT library
diff --git a/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino b/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
index 6607a01cff..185cd0c97a 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
@@ -5,13 +5,13 @@
 #include <SPI.h>
 
 void setup() {
-  TFT_BL_ON;                                          // turn on the background light
-  Tft.TFTinit();                                      // init TFT library
+  TFT_BL_ON;      // turn on the background light
+  Tft.TFTinit();  // init TFT library
 }
 
 void loop() {
-  for (int r = 0; r < 115; r = r + 2) {               //set r : 0--115
-    Tft.drawCircle(119, 160, r, random(0xFFFF));    //draw circle, center:(119, 160), color: random
+  for (int r = 0; r < 115; r = r + 2) {           //set r : 0--115
+    Tft.drawCircle(119, 160, r, random(0xFFFF));  //draw circle, center:(119, 160), color: random
   }
   delay(10);
 }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/text/text.ino b/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
index 03308f6891..2d27e11185 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
@@ -11,23 +11,20 @@ void setup() {
   TFT_BL_ON;      // turn on the background light
   Tft.TFTinit();  // init TFT library
 
-  Tft.drawChar('S', 0, 0, 1, RED);            // draw char: 'S', (0, 0), size: 1, color: RED
+  Tft.drawChar('S', 0, 0, 1, RED);  // draw char: 'S', (0, 0), size: 1, color: RED
 
-  Tft.drawChar('E', 10, 10, 2, BLUE);         // draw char: 'E', (10, 10), size: 2, color: BLUE
+  Tft.drawChar('E', 10, 10, 2, BLUE);  // draw char: 'E', (10, 10), size: 2, color: BLUE
 
-  Tft.drawChar('E', 20, 40, 3, GREEN);        // draw char: 'E', (20, 40), size: 3, color: GREEN
+  Tft.drawChar('E', 20, 40, 3, GREEN);  // draw char: 'E', (20, 40), size: 3, color: GREEN
 
-  Tft.drawChar('E', 30, 80, 4, YELLOW);       // draw char: 'E', (30, 80), size: 4, color: YELLOW
+  Tft.drawChar('E', 30, 80, 4, YELLOW);  // draw char: 'E', (30, 80), size: 4, color: YELLOW
 
-  Tft.drawChar('D', 40, 120, 4, YELLOW);      // draw char: 'D', (40, 120), size: 4, color: YELLOW
-
-  Tft.drawString("Hello", 0, 180, 3, CYAN);   // draw string: "hello", (0, 180), size: 3, color: CYAN
-
-  Tft.drawString("World!!", 60, 220, 4, WHITE); // draw string: "world!!", (80, 230), size: 4, color: WHITE
+  Tft.drawChar('D', 40, 120, 4, YELLOW);  // draw char: 'D', (40, 120), size: 4, color: YELLOW
 
+  Tft.drawString("Hello", 0, 180, 3, CYAN);  // draw string: "hello", (0, 180), size: 3, color: CYAN
 
+  Tft.drawString("World!!", 60, 220, 4, WHITE);  // draw string: "world!!", (80, 230), size: 4, color: WHITE
 }
 
 void loop() {
-
 }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino b/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
index 03423a4ef5..70b2eef3fb 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
@@ -18,23 +18,24 @@
 
 #include "TFTv2.h"
 
-#define MAX_BMP         10                      // bmp file num
-#define FILENAME_LEN    20                      // max file name length
+#define MAX_BMP 10       // bmp file num
+#define FILENAME_LEN 20  // max file name length
 
-const int PIN_SD_CS = 4;                        // pin of sd card
+const int PIN_SD_CS = 4;  // pin of sd card
 
-const long __Gnbmp_height = 320;                 // bmp height
-const long __Gnbmp_width  = 240;                 // bmp width
+const long __Gnbmp_height = 320;  // bmp height
+const long __Gnbmp_width  = 240;  // bmp width
 
-long __Gnbmp_image_offset  = 0;;
+long __Gnbmp_image_offset = 0;
+;
 
-int __Gnfile_num = 0;                           // num of file
-char __Gsbmp_files[MAX_BMP][FILENAME_LEN];      // file name
+int  __Gnfile_num = 0;                      // num of file
+char __Gsbmp_files[MAX_BMP][FILENAME_LEN];  // file name
 
 File bmpFile;
 
 // if bmp file return 1, else return 0
-bool checkBMP(char *_name, char r_name[]) {
+bool checkBMP(char* _name, char r_name[]) {
   int len = 0;
 
   if (NULL == _name) {
@@ -55,29 +56,28 @@ bool checkBMP(char *_name, char r_name[]) {
   }
 
   // if xxx.bmp or xxx.BMP
-  if (r_name[len - 4] == '.' \
-      && (r_name[len - 3] == 'b' || (r_name[len - 3] == 'B')) \
-      && (r_name[len - 2] == 'm' || (r_name[len - 2] == 'M')) \
+  if (r_name[len - 4] == '.'
+      && (r_name[len - 3] == 'b' || (r_name[len - 3] == 'B'))
+      && (r_name[len - 2] == 'm' || (r_name[len - 2] == 'M'))
       && (r_name[len - 1] == 'p' || (r_name[len - 1] == 'P'))) {
     return true;
   }
 
   return false;
-
 }
 
 // search root to find bmp file
 void searchDirectory() {
-  File root = SD.open("/");                       // root
+  File root = SD.open("/");  // root
   while (true) {
-    File entry =  root.openNextFile();
+    File entry = root.openNextFile();
 
-    if (! entry) {
+    if (!entry) {
       break;
     }
 
     if (!entry.isDirectory()) {
-      char *ptmp = entry.name();
+      char* ptmp = entry.name();
 
       char __Name[20];
 
@@ -99,9 +99,7 @@ void searchDirectory() {
   }
 }
 
-
 void setup() {
-
   Serial.begin(115200);
 
   pinMode(PIN_SD_CS, OUTPUT);
@@ -114,7 +112,8 @@ void setup() {
 
   if (!SD.begin(PIN_SD_CS)) {
     Serial.println("failed!");
-    while (1);                              // init fail, die here
+    while (1)
+      ;  // init fail, die here
   }
 
   Serial.println("SD OK!");
@@ -150,15 +149,15 @@ void loop() {
       }
   */
 
-
   bmpFile = SD.open("pfvm_1.bmp");
 
-  if (! bmpFile) {
+  if (!bmpFile) {
     Serial.println("didn't find image");
-    while (1);
+    while (1)
+      ;
   }
 
-  if (! bmpReadHeader(bmpFile)) {
+  if (!bmpReadHeader(bmpFile)) {
     Serial.println("bad bmp");
     return;
   }
@@ -166,7 +165,8 @@ void loop() {
   bmpdraw(bmpFile, 0, 0, 1);
   bmpFile.close();
 
-  while (1);
+  while (1)
+    ;
 }
 
 /*********************************************/
@@ -176,17 +176,15 @@ void loop() {
 // more RAM but makes the drawing a little faster. 20 pixels' worth
 // is probably a good place
 
-#define BUFFPIXEL       60                          // must be a divisor of 240 
-#define BUFFPIXEL_X3    180                         // BUFFPIXELx3
+#define BUFFPIXEL 60      // must be a divisor of 240
+#define BUFFPIXEL_X3 180  // BUFFPIXELx3
 
-
-#define UP_DOWN     1
-#define DOWN_UP     0
+#define UP_DOWN 1
+#define DOWN_UP 0
 
 // dir - 1: up to down
 // dir - 2: down to up
 void bmpdraw(File f, int x, int y, int dir) {
-
   if (bmpFile.seek(__Gnbmp_image_offset)) {
     Serial.print("pos = ");
     Serial.println(bmpFile.position());
@@ -194,7 +192,7 @@ void bmpdraw(File f, int x, int y, int dir) {
 
   uint32_t time = millis();
 
-  uint8_t sdbuffer[BUFFPIXEL_X3];                                         // 3 * pixels to buffer
+  uint8_t sdbuffer[BUFFPIXEL_X3];  // 3 * pixels to buffer
 
   for (int i = 0; i < __Gnbmp_height; i++) {
     if (dir) {
@@ -202,17 +200,16 @@ void bmpdraw(File f, int x, int y, int dir) {
     }
 
     for (int j = 0; j < (240 / BUFFPIXEL); j++) {
-
       bmpFile.read(sdbuffer, BUFFPIXEL_X3);
-      uint8_t buffidx = 0;
-      int offset_x = j * BUFFPIXEL;
+      uint8_t buffidx  = 0;
+      int     offset_x = j * BUFFPIXEL;
 
       unsigned int __color[BUFFPIXEL];
 
       for (int k = 0; k < BUFFPIXEL; k++) {
-        __color[k] = sdbuffer[buffidx + 2] >> 3;                    // read
-        __color[k] = __color[k] << 6 | (sdbuffer[buffidx + 1] >> 2); // green
-        __color[k] = __color[k] << 5 | (sdbuffer[buffidx + 0] >> 3); // blue
+        __color[k] = sdbuffer[buffidx + 2] >> 3;                      // read
+        __color[k] = __color[k] << 6 | (sdbuffer[buffidx + 1] >> 2);  // green
+        __color[k] = __color[k] << 5 | (sdbuffer[buffidx + 0] >> 3);  // blue
 
         buffidx += 3;
       }
@@ -239,7 +236,6 @@ void bmpdraw(File f, int x, int y, int dir) {
 
       TFT_CS_HIGH;
     }
-
   }
 
   Serial.print(millis() - time, DEC);
@@ -249,7 +245,7 @@ void bmpdraw(File f, int x, int y, int dir) {
 boolean bmpReadHeader(File f) {
   // read header
   uint32_t tmp;
-  uint8_t bmpDepth;
+  uint8_t  bmpDepth;
 
   if (read16(f) != 0x4D42) {
     // magic bytes missing
@@ -273,10 +269,10 @@ boolean bmpReadHeader(File f) {
   Serial.print("header size ");
   Serial.println(tmp, DEC);
 
-  int bmp_width = read32(f);
+  int bmp_width  = read32(f);
   int bmp_height = read32(f);
 
-  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) {   // if image is not 320x240, return false
+  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) {  // if image is not 320x240, return false
     return false;
   }
 
@@ -306,7 +302,7 @@ boolean bmpReadHeader(File f) {
 // LITTLE ENDIAN!
 uint16_t read16(File f) {
   uint16_t d;
-  uint8_t b;
+  uint8_t  b;
   b = f.read();
   d = f.read();
   d <<= 8;
diff --git a/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino b/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
index 33c9435982..b9d2db5bcd 100644
--- a/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
+++ b/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
@@ -1,27 +1,27 @@
 #include "Arduino.h"
 #include "Ticker.h"
 
-#define LED1  2
-#define LED2  4
-#define LED3  12
-#define LED4  14
-#define LED5  15
-
+#define LED1 2
+#define LED2 4
+#define LED3 12
+#define LED4 14
+#define LED5 15
 
 class ExampleClass {
   public:
-    ExampleClass(int pin, int duration) : _pin(pin), _duration(duration) {
-      pinMode(_pin, OUTPUT);
-      _myTicker.attach_ms(_duration, std::bind(&ExampleClass::classBlink, this));
-    }
-    ~ExampleClass() {};
-
-    int _pin, _duration;
-    Ticker _myTicker;
-
-    void classBlink() {
-      digitalWrite(_pin, !digitalRead(_pin));
-    }
+  ExampleClass(int pin, int duration) :
+      _pin(pin), _duration(duration) {
+    pinMode(_pin, OUTPUT);
+    _myTicker.attach_ms(_duration, std::bind(&ExampleClass::classBlink, this));
+  }
+  ~ExampleClass() {};
+
+  int    _pin, _duration;
+  Ticker _myTicker;
+
+  void classBlink() {
+    digitalWrite(_pin, !digitalRead(_pin));
+  }
 };
 
 void staticBlink() {
@@ -43,7 +43,6 @@ Ticker lambdaTicker;
 
 ExampleClass example(LED1, 100);
 
-
 void setup() {
   pinMode(LED2, OUTPUT);
   staticTicker.attach_ms(100, staticBlink);
diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp
index e9fc796bbf..82ae6b2521 100644
--- a/libraries/Wire/Wire.cpp
+++ b/libraries/Wire/Wire.cpp
@@ -22,7 +22,8 @@
     Modified January 2017 by Bjorn Hammarberg (bjoham@esp8266.com) - i2c slave support
 */
 
-extern "C" {
+extern "C"
+{
 #include <stdlib.h>
 #include <string.h>
 #include <inttypes.h>
@@ -31,7 +32,6 @@ extern "C" {
 #include "twi.h"
 #include "Wire.h"
 
-
 //Some boards don't have these pins available, and hence don't support Wire.
 //Check here for compile-time error.
 #if !defined(PIN_WIRE_SDA) || !defined(PIN_WIRE_SCL)
@@ -41,13 +41,13 @@ extern "C" {
 // Initialize Class Variables //////////////////////////////////////////////////
 
 uint8_t TwoWire::rxBuffer[I2C_BUFFER_LENGTH];
-size_t TwoWire::rxBufferIndex = 0;
-size_t TwoWire::rxBufferLength = 0;
+size_t  TwoWire::rxBufferIndex  = 0;
+size_t  TwoWire::rxBufferLength = 0;
 
 uint8_t TwoWire::txAddress = 0;
 uint8_t TwoWire::txBuffer[I2C_BUFFER_LENGTH];
-size_t TwoWire::txBufferIndex = 0;
-size_t TwoWire::txBufferLength = 0;
+size_t  TwoWire::txBufferIndex  = 0;
+size_t  TwoWire::txBufferLength = 0;
 
 uint8_t TwoWire::transmitting = 0;
 void (*TwoWire::user_onRequest)(void);
@@ -58,7 +58,7 @@ static int default_scl_pin = SCL;
 
 // Constructors ////////////////////////////////////////////////////////////////
 
-TwoWire::TwoWire() {}
+TwoWire::TwoWire() { }
 
 // Public Methods //////////////////////////////////////////////////////////////
 
@@ -126,8 +126,8 @@ size_t TwoWire::requestFrom(uint8_t address, size_t size, bool sendStop)
     {
         size = I2C_BUFFER_LENGTH;
     }
-    size_t read = (twi_readFrom(address, rxBuffer, size, sendStop) == 0) ? size : 0;
-    rxBufferIndex = 0;
+    size_t read    = (twi_readFrom(address, rxBuffer, size, sendStop) == 0) ? size : 0;
+    rxBufferIndex  = 0;
     rxBufferLength = read;
     return read;
 }
@@ -154,9 +154,9 @@ uint8_t TwoWire::requestFrom(int address, int quantity, int sendStop)
 
 void TwoWire::beginTransmission(uint8_t address)
 {
-    transmitting = 1;
-    txAddress = address;
-    txBufferIndex = 0;
+    transmitting   = 1;
+    txAddress      = address;
+    txBufferIndex  = 0;
     txBufferLength = 0;
 }
 
@@ -167,10 +167,10 @@ void TwoWire::beginTransmission(int address)
 
 uint8_t TwoWire::endTransmission(uint8_t sendStop)
 {
-    int8_t ret = twi_writeTo(txAddress, txBuffer, txBufferLength, sendStop);
-    txBufferIndex = 0;
+    int8_t ret     = twi_writeTo(txAddress, txBuffer, txBufferLength, sendStop);
+    txBufferIndex  = 0;
     txBufferLength = 0;
-    transmitting = 0;
+    transmitting   = 0;
     return ret;
 }
 
@@ -199,7 +199,7 @@ size_t TwoWire::write(uint8_t data)
     return 1;
 }
 
-size_t TwoWire::write(const uint8_t *data, size_t quantity)
+size_t TwoWire::write(const uint8_t* data, size_t quantity)
 {
     if (transmitting)
     {
@@ -255,9 +255,9 @@ int TwoWire::peek(void)
 
 void TwoWire::flush(void)
 {
-    rxBufferIndex = 0;
+    rxBufferIndex  = 0;
     rxBufferLength = 0;
-    txBufferIndex = 0;
+    txBufferIndex  = 0;
     txBufferLength = 0;
 }
 
@@ -283,7 +283,7 @@ void TwoWire::onReceiveService(uint8_t* inBytes, size_t numBytes)
     }
 
     // set rx iterator vars
-    rxBufferIndex = 0;
+    rxBufferIndex  = 0;
     rxBufferLength = numBytes;
 
     // alert user program
@@ -300,7 +300,7 @@ void TwoWire::onRequestService(void)
 
     // reset tx buffer iterator vars
     // !!! this will kill any pending pre-master sendTo() activity
-    txBufferIndex = 0;
+    txBufferIndex  = 0;
     txBufferLength = 0;
 
     // alert user program
@@ -312,7 +312,7 @@ void TwoWire::onReceive(void (*function)(int))
     // arduino api compatibility fixer:
     // really hope size parameter will not exceed 2^31 :)
     static_assert(sizeof(int) == sizeof(size_t), "something is wrong in Arduino kingdom");
-    user_onReceive = reinterpret_cast<void(*)(size_t)>(function);
+    user_onReceive = reinterpret_cast<void (*)(size_t)>(function);
 }
 
 void TwoWire::onReceive(void (*function)(size_t))
diff --git a/libraries/Wire/Wire.h b/libraries/Wire/Wire.h
index be73f10fe6..0ff796c7ef 100644
--- a/libraries/Wire/Wire.h
+++ b/libraries/Wire/Wire.h
@@ -27,45 +27,45 @@
 #include <inttypes.h>
 #include "Stream.h"
 
-
 #ifndef I2C_BUFFER_LENGTH
 // DEPRECATED: Do not use BUFFER_LENGTH, prefer I2C_BUFFER_LENGTH
 #define BUFFER_LENGTH 128
 #define I2C_BUFFER_LENGTH BUFFER_LENGTH
 #endif
 
-class TwoWire : public Stream
+class TwoWire: public Stream
 {
 private:
     static uint8_t rxBuffer[];
-    static size_t rxBufferIndex;
-    static size_t rxBufferLength;
+    static size_t  rxBufferIndex;
+    static size_t  rxBufferLength;
 
     static uint8_t txAddress;
     static uint8_t txBuffer[];
-    static size_t txBufferIndex;
-    static size_t txBufferLength;
+    static size_t  txBufferIndex;
+    static size_t  txBufferLength;
 
     static uint8_t transmitting;
     static void (*user_onRequest)(void);
     static void (*user_onReceive)(size_t);
     static void onRequestService(void);
     static void onReceiveService(uint8_t*, size_t);
+
 public:
     TwoWire();
-    void begin(int sda, int scl);
-    void begin(int sda, int scl, uint8_t address);
-    void pins(int sda, int scl) __attribute__((deprecated)); // use begin(sda, scl) in new code
-    void begin();
-    void begin(uint8_t);
-    void begin(int);
-    void setClock(uint32_t);
-    void setClockStretchLimit(uint32_t);
-    void beginTransmission(uint8_t);
-    void beginTransmission(int);
+    void    begin(int sda, int scl);
+    void    begin(int sda, int scl, uint8_t address);
+    void    pins(int sda, int scl) __attribute__((deprecated));  // use begin(sda, scl) in new code
+    void    begin();
+    void    begin(uint8_t);
+    void    begin(int);
+    void    setClock(uint32_t);
+    void    setClockStretchLimit(uint32_t);
+    void    beginTransmission(uint8_t);
+    void    beginTransmission(int);
     uint8_t endTransmission(void);
     uint8_t endTransmission(uint8_t);
-    size_t requestFrom(uint8_t address, size_t size, bool sendStop);
+    size_t  requestFrom(uint8_t address, size_t size, bool sendStop);
     uint8_t status();
 
     uint8_t requestFrom(uint8_t, uint8_t);
@@ -74,14 +74,14 @@ class TwoWire : public Stream
     uint8_t requestFrom(int, int, int);
 
     virtual size_t write(uint8_t);
-    virtual size_t write(const uint8_t *, size_t);
-    virtual int available(void);
-    virtual int read(void);
-    virtual int peek(void);
-    virtual void flush(void);
-    void onReceive(void (*)(int));      // arduino api
-    void onReceive(void (*)(size_t));   // legacy esp8266 backward compatibility
-    void onRequest(void (*)(void));
+    virtual size_t write(const uint8_t*, size_t);
+    virtual int    available(void);
+    virtual int    read(void);
+    virtual int    peek(void);
+    virtual void   flush(void);
+    void           onReceive(void (*)(int));     // arduino api
+    void           onReceive(void (*)(size_t));  // legacy esp8266 backward compatibility
+    void           onRequest(void (*)(void));
 
     using Print::write;
 };
@@ -91,4 +91,3 @@ extern TwoWire Wire;
 #endif
 
 #endif
-
diff --git a/libraries/Wire/examples/master_reader/master_reader.ino b/libraries/Wire/examples/master_reader/master_reader.ino
index 323830f847..73f45e0ae0 100644
--- a/libraries/Wire/examples/master_reader/master_reader.ino
+++ b/libraries/Wire/examples/master_reader/master_reader.ino
@@ -8,18 +8,17 @@
 
 // This example code is in the public domain.
 
-
 #include <Wire.h>
 #include <PolledTimeout.h>
 
 #define SDA_PIN 4
 #define SCL_PIN 5
 const int16_t I2C_MASTER = 0x42;
-const int16_t I2C_SLAVE = 0x08;
+const int16_t I2C_SLAVE  = 0x08;
 
 void setup() {
-  Serial.begin(115200);  // start serial for output
-  Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER);        // join i2c bus (address optional for master)
+  Serial.begin(115200);                      // start serial for output
+  Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER);  // join i2c bus (address optional for master)
 }
 
 void loop() {
@@ -27,11 +26,11 @@ void loop() {
   static periodic nextPing(1000);
 
   if (nextPing) {
-    Wire.requestFrom(I2C_SLAVE, 6);    // request 6 bytes from slave device #8
+    Wire.requestFrom(I2C_SLAVE, 6);  // request 6 bytes from slave device #8
 
-    while (Wire.available()) { // slave may send less than requested
-      char c = Wire.read(); // receive a byte as character
-      Serial.print(c);         // print the character
+    while (Wire.available()) {  // slave may send less than requested
+      char c = Wire.read();     // receive a byte as character
+      Serial.print(c);          // print the character
     }
   }
 }
diff --git a/libraries/Wire/examples/master_writer/master_writer.ino b/libraries/Wire/examples/master_writer/master_writer.ino
index 1e9719e23c..727ff0a09d 100644
--- a/libraries/Wire/examples/master_writer/master_writer.ino
+++ b/libraries/Wire/examples/master_writer/master_writer.ino
@@ -8,17 +8,16 @@
 
 // This example code is in the public domain.
 
-
 #include <Wire.h>
 #include <PolledTimeout.h>
 
 #define SDA_PIN 4
 #define SCL_PIN 5
 const int16_t I2C_MASTER = 0x42;
-const int16_t I2C_SLAVE = 0x08;
+const int16_t I2C_SLAVE  = 0x08;
 
 void setup() {
-  Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER); // join i2c bus (address optional for master)
+  Wire.begin(SDA_PIN, SCL_PIN, I2C_MASTER);  // join i2c bus (address optional for master)
 }
 
 byte x = 0;
@@ -28,10 +27,10 @@ void loop() {
   static periodic nextPing(1000);
 
   if (nextPing) {
-    Wire.beginTransmission(I2C_SLAVE); // transmit to device #8
-    Wire.write("x is ");        // sends five bytes
-    Wire.write(x);              // sends one byte
-    Wire.endTransmission();    // stop transmitting
+    Wire.beginTransmission(I2C_SLAVE);  // transmit to device #8
+    Wire.write("x is ");                // sends five bytes
+    Wire.write(x);                      // sends one byte
+    Wire.endTransmission();             // stop transmitting
 
     x++;
   }
diff --git a/libraries/Wire/examples/slave_receiver/slave_receiver.ino b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
index 270cc43129..0db1c5926f 100644
--- a/libraries/Wire/examples/slave_receiver/slave_receiver.ino
+++ b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
@@ -8,20 +8,19 @@
 
 // This example code is in the public domain.
 
-
 #include <Wire.h>
 
 #define SDA_PIN 4
 #define SCL_PIN 5
 
 const int16_t I2C_MASTER = 0x42;
-const int16_t I2C_SLAVE = 0x08;
+const int16_t I2C_SLAVE  = 0x08;
 
 void setup() {
-  Serial.begin(115200);           // start serial for output
+  Serial.begin(115200);  // start serial for output
 
-  Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE); // new syntax: join i2c bus (address required for slave)
-  Wire.onReceive(receiveEvent); // register event
+  Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE);  // new syntax: join i2c bus (address required for slave)
+  Wire.onReceive(receiveEvent);             // register event
 }
 
 void loop() {
@@ -30,12 +29,11 @@ void loop() {
 // function that executes whenever data is received from master
 // this function is registered as an event, see setup()
 void receiveEvent(size_t howMany) {
-
-  (void) howMany;
-  while (1 < Wire.available()) { // loop through all but the last
-    char c = Wire.read(); // receive byte as a character
-    Serial.print(c);         // print the character
+  (void)howMany;
+  while (1 < Wire.available()) {  // loop through all but the last
+    char c = Wire.read();         // receive byte as a character
+    Serial.print(c);              // print the character
   }
-  int x = Wire.read();    // receive byte as an integer
-  Serial.println(x);         // print the integer
+  int x = Wire.read();  // receive byte as an integer
+  Serial.println(x);    // print the integer
 }
diff --git a/libraries/Wire/examples/slave_sender/slave_sender.ino b/libraries/Wire/examples/slave_sender/slave_sender.ino
index e177be8538..7937cac918 100644
--- a/libraries/Wire/examples/slave_sender/slave_sender.ino
+++ b/libraries/Wire/examples/slave_sender/slave_sender.ino
@@ -8,17 +8,16 @@
 
 // This example code is in the public domain.
 
-
 #include <Wire.h>
 
 #define SDA_PIN 4
 #define SCL_PIN 5
 const int16_t I2C_MASTER = 0x42;
-const int16_t I2C_SLAVE = 0x08;
+const int16_t I2C_SLAVE  = 0x08;
 
 void setup() {
-  Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE);                // join i2c bus with address #8
-  Wire.onRequest(requestEvent); // register event
+  Wire.begin(SDA_PIN, SCL_PIN, I2C_SLAVE);  // join i2c bus with address #8
+  Wire.onRequest(requestEvent);             // register event
 }
 
 void loop() {
@@ -27,6 +26,6 @@ void loop() {
 // function that executes whenever data is requested by master
 // this function is registered as an event, see setup()
 void requestEvent() {
-  Wire.write("hello\n"); // respond with message of 6 bytes
+  Wire.write("hello\n");  // respond with message of 6 bytes
   // as expected by master
 }
diff --git a/libraries/esp8266/examples/Blink/Blink.ino b/libraries/esp8266/examples/Blink/Blink.ino
index de23fb519f..d2083049dd 100644
--- a/libraries/esp8266/examples/Blink/Blink.ino
+++ b/libraries/esp8266/examples/Blink/Blink.ino
@@ -10,12 +10,12 @@
 */
 
 void setup() {
-  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
+  pinMode(LED_BUILTIN, OUTPUT);  // Initialize the LED_BUILTIN pin as an output
 }
 
 // the loop function runs over and over again forever
 void loop() {
-  digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
+  digitalWrite(LED_BUILTIN, LOW);  // Turn the LED on (Note that LOW is the voltage level
   // but actually the LED is on; this is because
   // it is active low on the ESP-01)
   delay(1000);                      // Wait for a second
diff --git a/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino b/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
index 11e2aff482..66536a335d 100644
--- a/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
+++ b/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
@@ -22,11 +22,10 @@
   Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
 */
 
-
 #include <PolledTimeout.h>
 
 void ledOn() {
-  digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
+  digitalWrite(LED_BUILTIN, LOW);  // Turn the LED on (Note that LOW is the voltage level
 }
 
 void ledOff() {
@@ -37,8 +36,7 @@ void ledToggle() {
   digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));  // Change the state of the LED
 }
 
-
-esp8266::polledTimeout::periodicFastUs halfPeriod(500000); //use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace
+esp8266::polledTimeout::periodicFastUs halfPeriod(500000);  //use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace
 
 // the setup function runs only once at start
 void setup() {
@@ -50,16 +48,16 @@ void setup() {
   Serial.printf("periodic/oneShotFastUs::timeMax() = %u us\n", (uint32_t)esp8266::polledTimeout::periodicFastUs::timeMax());
   Serial.printf("periodic/oneShotFastNs::timeMax() = %u ns\n", (uint32_t)esp8266::polledTimeout::periodicFastNs::timeMax());
 
-#if 0 // 1 for debugging polledTimeout
+#if 0  // 1 for debugging polledTimeout
   Serial.printf("periodic/oneShotMs::rangeCompensate     = %u\n", (uint32_t)esp8266::polledTimeout::periodicMs::rangeCompensate);
   Serial.printf("periodic/oneShotFastMs::rangeCompensate = %u\n", (uint32_t)esp8266::polledTimeout::periodicFastMs::rangeCompensate);
   Serial.printf("periodic/oneShotFastUs::rangeCompensate = %u\n", (uint32_t)esp8266::polledTimeout::periodicFastUs::rangeCompensate);
   Serial.printf("periodic/oneShotFastNs::rangeCompensate = %u\n", (uint32_t)esp8266::polledTimeout::periodicFastNs::rangeCompensate);
 #endif
 
-  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
+  pinMode(LED_BUILTIN, OUTPUT);  // Initialize the LED_BUILTIN pin as an output
 
-  using esp8266::polledTimeout::oneShotMs; //import the type to the local namespace
+  using esp8266::polledTimeout::oneShotMs;  //import the type to the local namespace
 
   //STEP1; turn the led ON
   ledOn();
@@ -80,10 +78,9 @@ void setup() {
   }
 
   //Done with STEPs, do other stuff
-  halfPeriod.reset(); //halfPeriod is global, so it gets inited on sketch start. Clear it here to make it ready for loop, where it's actually used.
+  halfPeriod.reset();  //halfPeriod is global, so it gets inited on sketch start. Clear it here to make it ready for loop, where it's actually used.
 }
 
-
 // the loop function runs over and over again forever
 void loop() {
   if (halfPeriod) {
diff --git a/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino b/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
index 24689f3a44..16dd33aa15 100644
--- a/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
+++ b/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
@@ -13,7 +13,7 @@
 int ledState = LOW;
 
 unsigned long previousMillis = 0;
-const long interval = 1000;
+const long    interval       = 1000;
 
 void setup() {
   pinMode(LED_BUILTIN, OUTPUT);
diff --git a/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino b/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
index ce4dac2470..2ce228eff9 100644
--- a/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
+++ b/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
@@ -6,24 +6,24 @@ using namespace experimental::CBListImplentation;
 
 class exampleClass {
   public:
-    exampleClass() {};
+  exampleClass() {};
 
-    using exCallBack = std::function<void(int)>;
-    using exHandler  = CallBackList<exCallBack>::CallBackHandler;
+  using exCallBack = std::function<void(int)>;
+  using exHandler  = CallBackList<exCallBack>::CallBackHandler;
 
-    CallBackList<exCallBack> myHandlers;
+  CallBackList<exCallBack> myHandlers;
 
-    exHandler setHandler(exCallBack cb) {
-      return myHandlers.add(cb);
-    }
+  exHandler setHandler(exCallBack cb) {
+    return myHandlers.add(cb);
+  }
 
-    void removeHandler(exHandler hnd) {
-      myHandlers.remove(hnd);
-    }
+  void removeHandler(exHandler hnd) {
+    myHandlers.remove(hnd);
+  }
 
-    void trigger(int t) {
-      myHandlers.execute(t);
-    }
+  void trigger(int t) {
+    myHandlers.execute(t);
+  }
 };
 
 exampleClass myExample;
@@ -40,7 +40,7 @@ void cb3(int in, int s) {
   Serial.printf("Callback 3, in = %d, s = %d\n", in, s);
 }
 
-Ticker tk, tk2, tk3;
+Ticker                  tk, tk2, tk3;
 exampleClass::exHandler e1 = myExample.setHandler(cb1);
 exampleClass::exHandler e2 = myExample.setHandler(cb2);
 exampleClass::exHandler e3 = myExample.setHandler(std::bind(cb3, std::placeholders::_1, 10));
diff --git a/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino b/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
index fa520722f6..cbd25c8bcb 100644
--- a/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
+++ b/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
@@ -21,12 +21,12 @@ void setup() {
   uint32_t ptr = (uint32_t)corruptme;
   // Find a page aligned spot inside the array
   ptr += 2 * SPI_FLASH_SEC_SIZE;
-  ptr &= ~(SPI_FLASH_SEC_SIZE - 1); // Sectoralign
+  ptr &= ~(SPI_FLASH_SEC_SIZE - 1);  // Sectoralign
   uint32_t sector = ((((uint32_t)ptr - 0x40200000) / SPI_FLASH_SEC_SIZE));
 
   // Create a sector with 1 bit set (i.e. fake corruption)
-  uint32_t *space = (uint32_t*)calloc(SPI_FLASH_SEC_SIZE, 1);
-  space[42] = 64;
+  uint32_t* space = (uint32_t*)calloc(SPI_FLASH_SEC_SIZE, 1);
+  space[42]       = 64;
 
   // Write it into flash at the spot in question
   spi_flash_erase_sector(sector);
@@ -40,6 +40,5 @@ void setup() {
   Serial.printf("CRC check: %s\n", ESP.checkFlashCRC() ? "OK" : "ERROR");
 }
 
-
 void loop() {
 }
diff --git a/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino b/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
index 9c3a54d7da..ce4919f14e 100644
--- a/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
+++ b/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
@@ -10,17 +10,19 @@ void setup(void) {
 }
 
 void loop() {
-
-  uint32_t realSize = ESP.getFlashChipRealSize();
-  uint32_t ideSize = ESP.getFlashChipSize();
-  FlashMode_t ideMode = ESP.getFlashChipMode();
+  uint32_t    realSize = ESP.getFlashChipRealSize();
+  uint32_t    ideSize  = ESP.getFlashChipSize();
+  FlashMode_t ideMode  = ESP.getFlashChipMode();
 
   Serial.printf("Flash real id:   %08X\n", ESP.getFlashChipId());
   Serial.printf("Flash real size: %u bytes\n\n", realSize);
 
   Serial.printf("Flash ide  size: %u bytes\n", ideSize);
   Serial.printf("Flash ide speed: %u Hz\n", ESP.getFlashChipSpeed());
-  Serial.printf("Flash ide mode:  %s\n", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT" : ideMode == FM_DIO ? "DIO" : ideMode == FM_DOUT ? "DOUT" : "UNKNOWN"));
+  Serial.printf("Flash ide mode:  %s\n", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT"
+                                              : ideMode == FM_DIO                        ? "DIO"
+                                              : ideMode == FM_DOUT                       ? "DOUT"
+                                                                                         : "UNKNOWN"));
 
   if (ideSize != realSize) {
     Serial.println("Flash Chip configuration wrong!\n");
diff --git a/libraries/esp8266/examples/ConfigFile/ConfigFile.ino b/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
index 59693edb31..aec83fc8e4 100644
--- a/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
+++ b/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
@@ -22,13 +22,13 @@ bool loadConfig() {
   }
 
   StaticJsonDocument<200> doc;
-  auto error = deserializeJson(doc, configFile);
+  auto                    error = deserializeJson(doc, configFile);
   if (error) {
     Serial.println("Failed to parse config file");
     return false;
   }
 
-  const char* serverName = doc["serverName"];
+  const char* serverName  = doc["serverName"];
   const char* accessToken = doc["accessToken"];
 
   // Real world application would store these values in some variables for
@@ -43,7 +43,7 @@ bool loadConfig() {
 
 bool saveConfig() {
   StaticJsonDocument<200> doc;
-  doc["serverName"] = "api.example.com";
+  doc["serverName"]  = "api.example.com";
   doc["accessToken"] = "128du9as8du12eoue8da98h123ueh9h98";
 
   File configFile = LittleFS.open("/config.json", "w");
@@ -67,7 +67,6 @@ void setup() {
     return;
   }
 
-
   if (!saveConfig()) {
     Serial.println("Failed to save config");
   } else {
diff --git a/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino b/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
index 1f192dd01c..b2efbeb4c1 100644
--- a/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
+++ b/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
@@ -39,12 +39,12 @@ void setup() {
   // PWM-Locked generator:   https://github.com/esp8266/Arduino/pull/7231
   enablePhaseLockedWaveform();
 
-  pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
+  pinMode(LED_BUILTIN, OUTPUT);  // Initialize the LED_BUILTIN pin as an output
   analogWriteRange(1000);
 
-  using esp8266::polledTimeout::oneShotMs; //import the type to the local namespace
+  using esp8266::polledTimeout::oneShotMs;  //import the type to the local namespace
 
-  digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (Note that LOW is the voltage level
+  digitalWrite(LED_BUILTIN, LOW);  // Turn the LED on (Note that LOW is the voltage level
 
   oneShotMs timeoutOn(2000);
   while (!timeoutOn) {
@@ -54,17 +54,16 @@ void setup() {
   stepPeriod.reset();
 }
 
-
 void loop() {
-  static int val = 0;
+  static int val   = 0;
   static int delta = 100;
   if (stepPeriod) {
     val += delta;
     if (val < 0) {
-      val = 100;
+      val   = 100;
       delta = 100;
     } else if (val > 1000) {
-      val = 900;
+      val   = 900;
       delta = -100;
     }
     analogWrite(LED_BUILTIN, val);
diff --git a/libraries/esp8266/examples/HeapMetric/HeapMetric.ino b/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
index 5c7a27dbbe..3ec3f0cf98 100644
--- a/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
+++ b/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
@@ -11,7 +11,7 @@ void stats(const char* what) {
   // or all at once:
   uint32_t free;
   uint32_t max;
-  uint8_t frag;
+  uint8_t  frag;
   ESP.getHeapStats(&free, &max, &frag);
 
   Serial.printf("free: %7u - max: %7u - frag: %3d%% <- ", free, max, frag);
@@ -21,7 +21,7 @@ void stats(const char* what) {
 
 void tryit(int blocksize) {
   void** p;
-  int blocks;
+  int    blocks;
 
   /*
     heap-used ~= blocks*sizeof(void*) + blocks*blocksize
@@ -52,21 +52,18 @@ void tryit(int blocksize) {
     calculation of multiple elements combined with the rounding up for the
     8-byte alignment of each allocation can make for some tricky calculations.
   */
-  int rawMemoryMaxFreeBlockSize =  ESP.getMaxFreeBlockSize();
+  int rawMemoryMaxFreeBlockSize = ESP.getMaxFreeBlockSize();
   // Remove the space for overhead component of the blocks*sizeof(void*) array.
   int maxFreeBlockSize = rawMemoryMaxFreeBlockSize - UMM_OVERHEAD_ADJUST;
   // Initial estimate to use all of the MaxFreeBlock with multiples of 8 rounding up.
-  blocks = maxFreeBlockSize /
-           (((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + sizeof(void*));
+  blocks = maxFreeBlockSize / (((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + sizeof(void*));
   /*
     While we allowed for the 8-byte alignment overhead for blocks*blocksize we
     were unable to compensate in advance for the later 8-byte aligning needed
     for the blocks*sizeof(void*) allocation. Thus blocks may be off by one count.
     We now validate the estimate and adjust as needed.
   */
-  int rawMemoryEstimate =
-    blocks * ((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) +
-    ((blocks * sizeof(void*) + UMM_OVERHEAD_ADJUST + 7) & ~7);
+  int rawMemoryEstimate = blocks * ((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + ((blocks * sizeof(void*) + UMM_OVERHEAD_ADJUST + 7) & ~7);
   if (rawMemoryMaxFreeBlockSize < rawMemoryEstimate) {
     --blocks;
   }
diff --git a/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino b/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
index 1fb90134c2..80544815a2 100644
--- a/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
+++ b/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
@@ -21,7 +21,7 @@ namespace TypeCast = experimental::TypeConversion;
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char masterKey[] PROGMEM = "w86vn@rpfA O+S"; // Use 8 random characters or more
+constexpr char masterKey[] PROGMEM = "w86vn@rpfA O+S";  // Use 8 random characters or more
 
 void setup() {
   // Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
@@ -47,13 +47,12 @@ void loop() {
 
   static uint32_t encryptionCounter = 0;
 
-
   // Generate the salt to use for HKDF
   uint8_t hkdfSalt[16] { 0 };
   getNonceGenerator()(hkdfSalt, sizeof hkdfSalt);
 
   // Generate the key to use for HMAC and encryption
-  HKDF hkdfInstance(FPSTR(masterKey), (sizeof masterKey) - 1, hkdfSalt, sizeof hkdfSalt); // (sizeof masterKey) - 1 removes the terminating null value of the c-string
+  HKDF hkdfInstance(FPSTR(masterKey), (sizeof masterKey) - 1, hkdfSalt, sizeof hkdfSalt);  // (sizeof masterKey) - 1 removes the terminating null value of the c-string
   hkdfInstance.produce(derivedKey, sizeof derivedKey);
 
   // Hash
@@ -61,18 +60,16 @@ void loop() {
   Serial.println(String(F("\nThis is the SHA256 hash of our example data, in HEX format:\n")) + TypeCast::uint8ArrayToHexString(resultArray, sizeof resultArray));
   Serial.println(String(F("This is the SHA256 hash of our example data, in HEX format, using String output:\n")) + SHA256::hash(exampleData));
 
-
   // HMAC
   // Note that HMAC output length is limited
   SHA256::hmac(exampleData.c_str(), exampleData.length(), derivedKey, sizeof derivedKey, resultArray, sizeof resultArray);
   Serial.println(String(F("\nThis is the SHA256 HMAC of our example data, in HEX format:\n")) + TypeCast::uint8ArrayToHexString(resultArray, sizeof resultArray));
   Serial.println(String(F("This is the SHA256 HMAC of our example data, in HEX format, using String output:\n")) + SHA256::hmac(exampleData, derivedKey, sizeof derivedKey, SHA256::NATURAL_LENGTH));
 
-
   // Authenticated Encryption with Associated Data (AEAD)
-  String dataToEncrypt = F("This data is not encrypted.");
-  uint8_t resultingNonce[12] { 0 }; // The nonce is always 12 bytes
-  uint8_t resultingTag[16] { 0 }; // The tag is always 16 bytes
+  String  dataToEncrypt = F("This data is not encrypted.");
+  uint8_t resultingNonce[12] { 0 };  // The nonce is always 12 bytes
+  uint8_t resultingTag[16] { 0 };    // The tag is always 16 bytes
 
   Serial.println(String(F("\nThis is the data to encrypt: ")) + dataToEncrypt);
 
@@ -91,7 +88,6 @@ void loop() {
 
   Serial.println(dataToEncrypt);
 
-
   Serial.println(F("\n##########################################################################################################\n"));
 
   delay(10000);
diff --git a/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino b/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
index ff1c41e93b..62ff6498f3 100644
--- a/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
+++ b/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
@@ -19,15 +19,15 @@
 #include <ESP8266WiFi.h>
 #include <Esp.h>
 #include <user_interface.h>
-#include <coredecls.h> // g_pcont - only needed for this debug demo
+#include <coredecls.h>  // g_pcont - only needed for this debug demo
 #include <StackThunk.h>
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char* ssid = STASSID;
+const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 ////////////////////////////////////////////////////////////////////
@@ -39,18 +39,18 @@ extern "C" {
 #define thunk_ets_uart_printf ets_uart_printf
 
 #else
-  int thunk_ets_uart_printf(const char *format, ...) __attribute__((format(printf, 1, 2)));
-  // Second stack thunked helper - this macro creates the global function thunk_ets_uart_printf
-  make_stack_thunk(ets_uart_printf);
+int thunk_ets_uart_printf(const char* format, ...) __attribute__((format(printf, 1, 2)));
+// Second stack thunked helper - this macro creates the global function thunk_ets_uart_printf
+make_stack_thunk(ets_uart_printf);
 #endif
 };
 ////////////////////////////////////////////////////////////////////
 
 void setup(void) {
-  WiFi.persistent(false); // w/o this a flash write occurs at every boot
+  WiFi.persistent(false);  // w/o this a flash write occurs at every boot
   WiFi.mode(WIFI_OFF);
   Serial.begin(115200);
-  delay(20);    // This delay helps when using the 'Modified Serial monitor' otherwise it is not needed.
+  delay(20);  // This delay helps when using the 'Modified Serial monitor' otherwise it is not needed.
   Serial.println();
   Serial.println();
   Serial.println(F("The Hardware Watchdog Timer Demo is starting ..."));
@@ -94,7 +94,6 @@ void setup(void) {
   processKey(Serial, '?');
 }
 
-
 void loop(void) {
   if (Serial.available() > 0) {
     int hotKey = Serial.read();
diff --git a/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino b/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
index 7d182bf377..45e2d63da4 100644
--- a/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
+++ b/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
@@ -1,6 +1,6 @@
 #include <esp8266_undocumented.h>
-void crashMeIfYouCan(void)__attribute__((weak));
-int divideA_B(int a, int b);
+void crashMeIfYouCan(void) __attribute__((weak));
+int  divideA_B(int a, int b);
 
 int* nullPointer = NULL;
 
@@ -15,16 +15,15 @@ void processKey(Print& out, int hotKey) {
       ESP.restart();
       break;
     case 's': {
-        uint32_t startTime = millis();
-        out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
-        ets_install_putc1(ets_putc);
-        while (true) {
-          ets_printf("%9lu\r", (millis() - startTime));
-          ets_delay_us(250000);
-          // stay in an loop blocking other system activity.
-        }
+      uint32_t startTime = millis();
+      out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
+      ets_install_putc1(ets_putc);
+      while (true) {
+        ets_printf("%9lu\r", (millis() - startTime));
+        ets_delay_us(250000);
+        // stay in an loop blocking other system activity.
       }
-      break;
+    } break;
     case 'h':
       out.printf_P(PSTR("Now crashing with Hardware WDT. This will take about 6 seconds.\r\n"));
       asm volatile("mov.n a2, %0\n\t"
@@ -32,7 +31,9 @@ void processKey(Print& out, int hotKey) {
                    "mov.n a4, %2\n\t"
                    "mov.n a5, %3\n\t"
                    "mov.n a6, %4\n\t"
-                   : : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa) : "memory");
+                   :
+                   : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa)
+                   : "memory");
       // Could not find these in the stack dump, unless interrupts were enabled.
       {
         uint32_t startTime = millis();
diff --git a/libraries/esp8266/examples/I2SInput/I2SInput.ino b/libraries/esp8266/examples/I2SInput/I2SInput.ino
index 836da2685b..6e2e11b07b 100644
--- a/libraries/esp8266/examples/I2SInput/I2SInput.ino
+++ b/libraries/esp8266/examples/I2SInput/I2SInput.ino
@@ -35,7 +35,7 @@ void setup() {
   WiFi.forceSleepBegin();
   delay(500);
 
-  i2s_rxtx_begin(true, false); // Enable I2S RX
+  i2s_rxtx_begin(true, false);  // Enable I2S RX
   i2s_set_rate(11025);
 
   delay(1000);
diff --git a/libraries/esp8266/examples/I2STransmit/I2STransmit.ino b/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
index 2eaab265d2..b14b3a7d15 100644
--- a/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
+++ b/libraries/esp8266/examples/I2STransmit/I2STransmit.ino
@@ -14,19 +14,19 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 // Set your network here
-const char *SSID = STASSID;
-const char *PASS = STAPSK;
+const char* SSID = STASSID;
+const char* PASS = STAPSK;
 
 WiFiUDP udp;
 // Set your listener PC's IP here:
 const IPAddress listener = { 192, 168, 1, 2 };
-const int port = 8266;
+const int       port     = 8266;
 
-int16_t buffer[100][2]; // Temp staging for samples
+int16_t buffer[100][2];  // Temp staging for samples
 
 void setup() {
   Serial.begin(115200);
@@ -48,7 +48,7 @@ void setup() {
   Serial.print("My IP: ");
   Serial.println(WiFi.localIP());
 
-  i2s_rxtx_begin(true, false); // Enable I2S RX
+  i2s_rxtx_begin(true, false);  // Enable I2S RX
   i2s_set_rate(11025);
 
   Serial.print("\nStart the listener on ");
@@ -60,7 +60,6 @@ void setup() {
   udp.beginPacket(listener, port);
   udp.write("I2S Receiver\r\n");
   udp.endPacket();
-
 }
 
 void loop() {
diff --git a/libraries/esp8266/examples/IramReserve/IramReserve.ino b/libraries/esp8266/examples/IramReserve/IramReserve.ino
index 96d7479da4..e1ad8c6b74 100644
--- a/libraries/esp8266/examples/IramReserve/IramReserve.ino
+++ b/libraries/esp8266/examples/IramReserve/IramReserve.ino
@@ -18,9 +18,9 @@
 #if defined(UMM_HEAP_IRAM)
 
 #if defined(CORE_MOCK)
-#define XCHAL_INSTRAM1_VADDR		0x40100000
+#define XCHAL_INSTRAM1_VADDR 0x40100000
 #else
-#include <sys/config.h> // For config/core-isa.h
+#include <sys/config.h>  // For config/core-isa.h
 #endif
 
 // durable - as in long life, persisting across reboots.
@@ -29,7 +29,6 @@ struct durable {
   uint32_t chksum;
 };
 
-
 // Leave a durable block of IRAM after the 2nd heap.
 
 // The block should be in 8-byte increments and fall on an 8-byte alignment.
@@ -39,7 +38,7 @@ struct durable {
 #define IRAM_RESERVE ((uintptr_t)XCHAL_INSTRAM1_VADDR + 0xC000UL - IRAM_RESERVE_SZ)
 
 // Define a reference with the right properties to make access easier.
-#define DURABLE ((struct durable *)IRAM_RESERVE)
+#define DURABLE ((struct durable*)IRAM_RESERVE)
 #define INCREMENT_BOOTCOUNT() (DURABLE->bootCounter)++
 
 extern struct rst_info resetInfo;
@@ -58,11 +57,9 @@ extern struct rst_info resetInfo;
   XOR sum on the IRAM data (or just a section of the IRAM data).
 */
 inline bool is_iram_valid(void) {
-  return (REASON_WDT_RST      <= resetInfo.reason &&
-          REASON_SOFT_RESTART >= resetInfo.reason);
+  return (REASON_WDT_RST <= resetInfo.reason && REASON_SOFT_RESTART >= resetInfo.reason);
 }
 
-
 void setup() {
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
@@ -79,7 +76,6 @@ void setup() {
   Serial.printf("Number of reboots at %u\r\n", DURABLE->bootCounter);
   Serial.printf("\r\nSome less than direct, ways to restart:\r\n");
   processKey(Serial, '?');
-
 }
 
 void loop(void) {
@@ -109,10 +105,9 @@ extern "C" void umm_init_iram(void) {
   uintptr_t sec_heap = (uintptr_t)_text_end + 32;
   sec_heap &= ~7;
   size_t sec_heap_sz = 0xC000UL - (sec_heap - (uintptr_t)XCHAL_INSTRAM1_VADDR);
-  sec_heap_sz -= IRAM_RESERVE_SZ; // Shrink IRAM heap
+  sec_heap_sz -= IRAM_RESERVE_SZ;  // Shrink IRAM heap
   if (0xC000UL > sec_heap_sz) {
-
-    umm_init_iram_ex((void *)sec_heap, sec_heap_sz, true);
+    umm_init_iram_ex((void*)sec_heap, sec_heap_sz, true);
   }
 }
 
diff --git a/libraries/esp8266/examples/IramReserve/ProcessKey.ino b/libraries/esp8266/examples/IramReserve/ProcessKey.ino
index 7d182bf377..45e2d63da4 100644
--- a/libraries/esp8266/examples/IramReserve/ProcessKey.ino
+++ b/libraries/esp8266/examples/IramReserve/ProcessKey.ino
@@ -1,6 +1,6 @@
 #include <esp8266_undocumented.h>
-void crashMeIfYouCan(void)__attribute__((weak));
-int divideA_B(int a, int b);
+void crashMeIfYouCan(void) __attribute__((weak));
+int  divideA_B(int a, int b);
 
 int* nullPointer = NULL;
 
@@ -15,16 +15,15 @@ void processKey(Print& out, int hotKey) {
       ESP.restart();
       break;
     case 's': {
-        uint32_t startTime = millis();
-        out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
-        ets_install_putc1(ets_putc);
-        while (true) {
-          ets_printf("%9lu\r", (millis() - startTime));
-          ets_delay_us(250000);
-          // stay in an loop blocking other system activity.
-        }
+      uint32_t startTime = millis();
+      out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n"));
+      ets_install_putc1(ets_putc);
+      while (true) {
+        ets_printf("%9lu\r", (millis() - startTime));
+        ets_delay_us(250000);
+        // stay in an loop blocking other system activity.
       }
-      break;
+    } break;
     case 'h':
       out.printf_P(PSTR("Now crashing with Hardware WDT. This will take about 6 seconds.\r\n"));
       asm volatile("mov.n a2, %0\n\t"
@@ -32,7 +31,9 @@ void processKey(Print& out, int hotKey) {
                    "mov.n a4, %2\n\t"
                    "mov.n a5, %3\n\t"
                    "mov.n a6, %4\n\t"
-                   : : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa) : "memory");
+                   :
+                   : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa)
+                   : "memory");
       // Could not find these in the stack dump, unless interrupts were enabled.
       {
         uint32_t startTime = millis();
diff --git a/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino b/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
index 2c22416e0d..fcaa98c725 100644
--- a/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
+++ b/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
@@ -38,14 +38,14 @@
   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA  */
 
 #include <ESP8266WiFi.h>
-#include <coredecls.h>         // crc32()
+#include <coredecls.h>  // crc32()
 #include <PolledTimeout.h>
-#include <include/WiFiState.h> // WiFiState structure details
+#include <include/WiFiState.h>  // WiFiState structure details
 
 //#define DEBUG  // prints WiFi connection info to serial, uncomment if you want WiFi messages
 #ifdef DEBUG
-#define DEBUG_PRINTLN(x)  Serial.println(x)
-#define DEBUG_PRINT(x)  Serial.print(x)
+#define DEBUG_PRINTLN(x) Serial.println(x)
+#define DEBUG_PRINT(x) Serial.print(x)
 #else
 #define DEBUG_PRINTLN(x)
 #define DEBUG_PRINT(x)
@@ -63,14 +63,14 @@ ADC_MODE(ADC_VCC);  // allows you to monitor the internal VCC level; it varies w
 // don't connect anything to the analog input pin(s)!
 
 // enter your WiFi configuration below
-const char* AP_SSID = "SSID";  // your router's SSID here
+const char* AP_SSID = "SSID";      // your router's SSID here
 const char* AP_PASS = "password";  // your router's password here
-IPAddress staticIP(0, 0, 0, 0); // parameters below are for your static IP address, if used
-IPAddress gateway(0, 0, 0, 0);
-IPAddress subnet(0, 0, 0, 0);
-IPAddress dns1(0, 0, 0, 0);
-IPAddress dns2(0, 0, 0, 0);
-uint32_t timeout = 30E3;  // 30 second timeout on the WiFi connection
+IPAddress   staticIP(0, 0, 0, 0);  // parameters below are for your static IP address, if used
+IPAddress   gateway(0, 0, 0, 0);
+IPAddress   subnet(0, 0, 0, 0);
+IPAddress   dns1(0, 0, 0, 0);
+IPAddress   dns2(0, 0, 0, 0);
+uint32_t    timeout = 30E3;  // 30 second timeout on the WiFi connection
 
 //#define TESTPOINT  //  used to track the timing of several test cycles (optional)
 #ifdef TESTPOINT
@@ -85,7 +85,7 @@ uint32_t timeout = 30E3;  // 30 second timeout on the WiFi connection
 // This structure is stored in RTC memory to save the WiFi state and reset count (number of Deep Sleeps),
 // and it reconnects twice as fast as the first connection; it's used several places in this demo
 struct nv_s {
-  WiFiState wss; // core's WiFi save state
+  WiFiState wss;  // core's WiFi save state
 
   struct {
     uint32_t crc32;
@@ -94,29 +94,29 @@ struct nv_s {
   } rtcData;
 };
 
-static nv_s* nv = (nv_s*)RTC_USER_MEM; // user RTC RAM area
+static nv_s* nv = (nv_s*)RTC_USER_MEM;  // user RTC RAM area
 
 uint32_t resetCount = 0;  // keeps track of the number of Deep Sleep tests / resets
 
-const uint32_t blinkDelay = 100; // fast blink rate for the LED when waiting for the user
+const uint32_t                     blinkDelay = 100;      // fast blink rate for the LED when waiting for the user
 esp8266::polledTimeout::periodicMs blinkLED(blinkDelay);  // LED blink delay without delay()
-esp8266::polledTimeout::oneShotMs altDelay(blinkDelay);  // tight loop to simulate user code
-esp8266::polledTimeout::oneShotMs wifiTimeout(timeout);  // 30 second timeout on WiFi connection
+esp8266::polledTimeout::oneShotMs  altDelay(blinkDelay);  // tight loop to simulate user code
+esp8266::polledTimeout::oneShotMs  wifiTimeout(timeout);  // 30 second timeout on WiFi connection
 // use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace
 
 void wakeupCallback() {  // unlike ISRs, you can do a print() from a callback function
-  testPoint_LOW;  // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW
-  printMillis();  // show time difference across sleep; millis is wrong as the CPU eventually stops
+  testPoint_LOW;         // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW
+  printMillis();         // show time difference across sleep; millis is wrong as the CPU eventually stops
   Serial.println(F("Woke from Light Sleep - this is the callback"));
 }
 
 void setup() {
 #ifdef TESTPOINT
   pinMode(testPointPin, OUTPUT);  // test point for Light Sleep and Deep Sleep tests
-  testPoint_LOW;  // Deep Sleep reset doesn't clear GPIOs, testPoint LOW shows boot time
+  testPoint_LOW;                  // Deep Sleep reset doesn't clear GPIOs, testPoint LOW shows boot time
 #endif
-  pinMode(LED, OUTPUT);  // activity and status indicator
-  digitalWrite(LED, LOW);  // turn on the LED
+  pinMode(LED, OUTPUT);                // activity and status indicator
+  digitalWrite(LED, LOW);              // turn on the LED
   pinMode(WAKE_UP_PIN, INPUT_PULLUP);  // polled to advance tests, interrupt for Forced Light Sleep
   Serial.begin(115200);
   Serial.println();
@@ -129,12 +129,12 @@ void setup() {
   }
 
   // Read previous resets (Deep Sleeps) from RTC memory, if any
-  uint32_t crcOfData = crc32((uint8_t*) &nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
+  uint32_t crcOfData = crc32((uint8_t*)&nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
   if ((crcOfData = nv->rtcData.crc32) && (resetCause == "Deep-Sleep Wake")) {
     resetCount = nv->rtcData.rstCount;  // read the previous reset count
     resetCount++;
   }
-  nv->rtcData.rstCount = resetCount; // update the reset count & CRC
+  nv->rtcData.rstCount = resetCount;  // update the reset count & CRC
   updateRTCcrc();
 
   if (resetCount == 1) {  // show that millis() is cleared across the Deep Sleep reset
@@ -164,7 +164,7 @@ void loop() {
   } else if (resetCount == 4) {
     resetTests();
   }
-} //end of loop()
+}  //end of loop()
 
 void runTest1() {
   Serial.println(F("\n1st test - running with WiFi unconfigured"));
@@ -181,7 +181,7 @@ void runTest2() {
     Serial.println(F("The amperage will drop in 7 seconds."));
     readVoltage();  // read internal VCC
     Serial.println(F("press the switch to continue"));
-    waitPushbutton(true, 90);  /* This is using a special feature: below 100 mS blink delay,
+    waitPushbutton(true, 90); /* This is using a special feature: below 100 mS blink delay,
          the LED blink delay is padding 100 mS time with 'program cycles' to fill the 100 mS.
          At 90 mS delay, 90% of the blink time is delay(), and 10% is 'your program running'.
          Below 90% you'll see a difference in the average amperage: less delay() = more amperage.
@@ -201,7 +201,7 @@ void runTest3() {
   //  delay(10);  // it doesn't always go to sleep unless you delay(10); yield() wasn't reliable
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
-  waitPushbutton(true, 99);  /* Using the same < 100 mS feature. If you drop the delay below 100, you
+  waitPushbutton(true, 99); /* Using the same < 100 mS feature. If you drop the delay below 100, you
       will see the effect of program time vs. delay() time on minimum amperage.  Above ~ 97 (97% of the
       time in delay) there is little change in amperage, so you need to spend maximum time in delay()
       to get minimum amperage.*/
@@ -215,7 +215,7 @@ void runTest4() {
   // and WiFi reconnects after the forceSleepWake more quickly
   digitalWrite(LED, LOW);  // visual cue that we're reconnecting WiFi
   uint32_t wifiBegin = millis();
-  WiFi.forceSleepWake();  // reconnect with previous STA mode and connection settings
+  WiFi.forceSleepWake();                   // reconnect with previous STA mode and connection settings
   WiFi.setSleepMode(WIFI_LIGHT_SLEEP, 3);  // Automatic Light Sleep, DTIM listen interval = 3
   // at higher DTIM intervals you'll have a hard time establishing and maintaining a connection
   wifiTimeout.reset(timeout);
@@ -229,7 +229,7 @@ void runTest4() {
     Serial.printf("%1.2f seconds\n", reConn / 1000);
     readVoltage();  // read internal VCC
     Serial.println(F("long press of the switch to continue"));
-    waitPushbutton(true, 350);  /* Below 100 mS delay it only goes into 'Automatic Modem Sleep',
+    waitPushbutton(true, 350); /* Below 100 mS delay it only goes into 'Automatic Modem Sleep',
         and below ~ 350 mS delay() the 'Automatic Light Sleep' is less frequent.  Above 500 mS
         delay() doesn't make significant improvement in power savings. */
   } else {
@@ -241,61 +241,61 @@ void runTest5() {
   Serial.println(F("\n5th test - Timed Light Sleep, wake in 10 seconds"));
   Serial.println(F("Press the button when you're ready to proceed"));
   waitPushbutton(true, blinkDelay);
-  WiFi.mode(WIFI_OFF);  // you must turn the modem off; using disconnect won't work
-  readVoltage();  // read internal VCC
-  printMillis();  // show millis() across sleep, including Serial.flush()
+  WiFi.mode(WIFI_OFF);      // you must turn the modem off; using disconnect won't work
+  readVoltage();            // read internal VCC
+  printMillis();            // show millis() across sleep, including Serial.flush()
   digitalWrite(LED, HIGH);  // turn the LED off so they know the CPU isn't running
-  testPoint_HIGH;  // testPoint LOW in callback tracks delay from testPoint HIGH to LOW
-  extern os_timer_t *timer_list;
+  testPoint_HIGH;           // testPoint LOW in callback tracks delay from testPoint HIGH to LOW
+  extern os_timer_t* timer_list;
   timer_list = nullptr;  // stop (but don't disable) the 4 OS timers
   wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
   gpio_pin_wakeup_enable(GPIO_ID_PIN(WAKE_UP_PIN), GPIO_PIN_INTR_LOLEVEL);  // GPIO wakeup (optional)
   // only LOLEVEL or HILEVEL interrupts work, no edge, that's an SDK or CPU limitation
-  wifi_fpm_set_wakeup_cb(wakeupCallback); // set wakeup callback
+  wifi_fpm_set_wakeup_cb(wakeupCallback);  // set wakeup callback
   // the callback is optional, but without it the modem will wake in 10 seconds then delay(10 seconds)
   // with the callback the sleep time is only 10 seconds total, no extra delay() afterward
   wifi_fpm_open();
-  wifi_fpm_do_sleep(10E6);  // Sleep range = 10000 ~ 268,435,454 uS (0xFFFFFFE, 2^28-1)
-  delay(10e3 + 1); // delay needs to be 1 mS longer than sleep or it only goes into Modem Sleep
+  wifi_fpm_do_sleep(10E6);        // Sleep range = 10000 ~ 268,435,454 uS (0xFFFFFFE, 2^28-1)
+  delay(10e3 + 1);                // delay needs to be 1 mS longer than sleep or it only goes into Modem Sleep
   Serial.println(F("Woke up!"));  // the interrupt callback hits before this is executed
 }
 
 void runTest6() {
   Serial.println(F("\n6th test - Forced Light Sleep, wake with GPIO interrupt"));
   Serial.flush();
-  WiFi.mode(WIFI_OFF);  // you must turn the modem off; using disconnect won't work
+  WiFi.mode(WIFI_OFF);      // you must turn the modem off; using disconnect won't work
   digitalWrite(LED, HIGH);  // turn the LED off so they know the CPU isn't running
-  readVoltage();  // read internal VCC
+  readVoltage();            // read internal VCC
   Serial.println(F("CPU going to sleep, pull WAKE_UP_PIN low to wake it (press the switch)"));
-  printMillis();  // show millis() across sleep, including Serial.flush()
+  printMillis();   // show millis() across sleep, including Serial.flush()
   testPoint_HIGH;  // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW in callback
   wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
   gpio_pin_wakeup_enable(GPIO_ID_PIN(WAKE_UP_PIN), GPIO_PIN_INTR_LOLEVEL);
   // only LOLEVEL or HILEVEL interrupts work, no edge, that's an SDK or CPU limitation
-  wifi_fpm_set_wakeup_cb(wakeupCallback); // Set wakeup callback (optional)
+  wifi_fpm_set_wakeup_cb(wakeupCallback);  // Set wakeup callback (optional)
   wifi_fpm_open();
-  wifi_fpm_do_sleep(0xFFFFFFF);  // only 0xFFFFFFF, any other value and it won't disconnect the RTC timer
-  delay(10);  // it goes to sleep during this delay() and waits for an interrupt
+  wifi_fpm_do_sleep(0xFFFFFFF);   // only 0xFFFFFFF, any other value and it won't disconnect the RTC timer
+  delay(10);                      // it goes to sleep during this delay() and waits for an interrupt
   Serial.println(F("Woke up!"));  // the interrupt callback hits before this is executed*/
 }
 
 void runTest7() {
   Serial.println(F("\n7th test - Deep Sleep for 10 seconds, reset and wake with RF_DEFAULT"));
-  initWiFi();  // initialize WiFi since we turned it off in the last test
+  initWiFi();     // initialize WiFi since we turned it off in the last test
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
   while (!digitalRead(WAKE_UP_PIN)) {  // wait for them to release the switch from the previous test
     delay(10);
   }
-  delay(50);  // debounce time for the switch, pushbutton released
+  delay(50);                          // debounce time for the switch, pushbutton released
   waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
-  digitalWrite(LED, LOW);  // turn the LED on, at least briefly
+  digitalWrite(LED, LOW);             // turn the LED on, at least briefly
   //WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep,
   // and no extended RFCAL as it goes into Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  printMillis();  // show time difference across sleep
-  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
-  ESP.deepSleep(10E6, WAKE_RF_DEFAULT); // good night!  D0 fires a reset in 10 seconds...
+  printMillis();                         // show time difference across sleep
+  testPoint_HIGH;                        // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  ESP.deepSleep(10E6, WAKE_RF_DEFAULT);  // good night!  D0 fires a reset in 10 seconds...
   // if you do ESP.deepSleep(0, mode); it needs a RESET to come out of sleep (RTC is disconnected)
   // maximum timed Deep Sleep interval ~ 3 to 4 hours depending on the RTC timer, see the README
   // the 2 uA GPIO amperage during Deep Sleep can't drive the LED so it's not lit now, although
@@ -311,9 +311,9 @@ void runTest8() {
   //WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep,
   // and no extended RFCAL as it goes into Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush();  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
-  ESP.deepSleep(10E6, WAKE_RFCAL); // good night!  D0 fires a reset in 10 seconds...
+  Serial.flush();                                  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH;                                  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  ESP.deepSleep(10E6, WAKE_RFCAL);                 // good night!  D0 fires a reset in 10 seconds...
   Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
@@ -322,11 +322,11 @@ void runTest9() {
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
   waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
-  WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep
+  WiFi.shutdown(nv->wss);             // Forced Modem Sleep for a more Instant Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush();  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
-  ESP.deepSleepInstant(10E6, WAKE_NO_RFCAL); // good night!  D0 fires a reset in 10 seconds...
+  Serial.flush();                                  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH;                                  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  ESP.deepSleepInstant(10E6, WAKE_NO_RFCAL);       // good night!  D0 fires a reset in 10 seconds...
   Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
@@ -337,9 +337,9 @@ void runTest10() {
   waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
   //WiFi.forceSleepBegin();  // Forced Modem Sleep for a more Instant Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush();  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
-  ESP.deepSleepInstant(10E6, WAKE_RF_DISABLED); // good night!  D0 fires a reset in 10 seconds...
+  Serial.flush();                                  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH;                                  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  ESP.deepSleepInstant(10E6, WAKE_RF_DISABLED);    // good night!  D0 fires a reset in 10 seconds...
   Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
@@ -361,25 +361,25 @@ void waitPushbutton(bool usesDelay, unsigned int delayTime) {  // loop until the
       }
       yield();  // this would be a good place for ArduinoOTA.handle();
     }
-  } else {  // long delay() for the 3 modes that need it, but it misses quick switch presses
-    while (digitalRead(WAKE_UP_PIN)) {  // wait for a pushbutton press
+  } else {                                   // long delay() for the 3 modes that need it, but it misses quick switch presses
+    while (digitalRead(WAKE_UP_PIN)) {       // wait for a pushbutton press
       digitalWrite(LED, !digitalRead(LED));  // toggle the activity LED
-      delay(delayTime);  // another good place for ArduinoOTA.handle();
+      delay(delayTime);                      // another good place for ArduinoOTA.handle();
       if (delayTime < 100) {
         altDelay.reset(100 - delayTime);  // pad the time < 100 mS with some real CPU cycles
-        while (!altDelay) {  // this simulates 'your program running', not delay() time
+        while (!altDelay) {               // this simulates 'your program running', not delay() time
         }
       }
     }
   }
-  delay(50);  // debounce time for the switch, pushbutton pressed
+  delay(50);                           // debounce time for the switch, pushbutton pressed
   while (!digitalRead(WAKE_UP_PIN)) {  // now wait for them to release the pushbutton
     delay(10);
   }
   delay(50);  // debounce time for the switch, pushbutton released
 }
 
-void readVoltage() { // read internal VCC
+void readVoltage() {  // read internal VCC
   float volts = ESP.getVcc();
   Serial.printf("The internal VCC reads %1.2f volts\n", volts / 1000);
 }
@@ -391,18 +391,18 @@ void printMillis() {
 }
 
 void updateRTCcrc() {  // updates the reset count CRC
-  nv->rtcData.crc32 = crc32((uint8_t*) &nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
+  nv->rtcData.crc32 = crc32((uint8_t*)&nv->rtcData.rstCount, sizeof(nv->rtcData.rstCount));
 }
 
 void initWiFi() {
-  digitalWrite(LED, LOW);  // give a visual indication that we're alive but busy with WiFi
+  digitalWrite(LED, LOW);         // give a visual indication that we're alive but busy with WiFi
   uint32_t wifiBegin = millis();  // how long does it take to connect
-  if ((crc32((uint8_t*) &nv->rtcData.rstCount + 1, sizeof(nv->wss)) && !WiFi.shutdownValidCRC(nv->wss))) {
+  if ((crc32((uint8_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss)) && !WiFi.shutdownValidCRC(nv->wss))) {
     // if good copy of wss, overwrite invalid (primary) copy
-    memcpy((uint32_t*) &nv->wss, (uint32_t*) &nv->rtcData.rstCount + 1, sizeof(nv->wss));
+    memcpy((uint32_t*)&nv->wss, (uint32_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss));
   }
-  if (WiFi.shutdownValidCRC(nv->wss)) {  // if we have a valid WiFi saved state
-    memcpy((uint32_t*) &nv->rtcData.rstCount + 1, (uint32_t*) &nv->wss, sizeof(nv->wss)); // save a copy of it
+  if (WiFi.shutdownValidCRC(nv->wss)) {                                                  // if we have a valid WiFi saved state
+    memcpy((uint32_t*)&nv->rtcData.rstCount + 1, (uint32_t*)&nv->wss, sizeof(nv->wss));  // save a copy of it
     Serial.println(F("resuming WiFi"));
   }
   if (!(WiFi.resumeFromShutdown(nv->wss))) {  // couldn't resume, or no valid saved WiFi state yet
@@ -411,7 +411,7 @@ void initWiFi() {
       with other WiFi devices on your network. */
     WiFi.persistent(false);  // don't store the connection each time to save wear on the flash
     WiFi.mode(WIFI_STA);
-    WiFi.setOutputPower(10);  // reduce RF output power, increase if it won't connect
+    WiFi.setOutputPower(10);                 // reduce RF output power, increase if it won't connect
     WiFi.config(staticIP, gateway, subnet);  // if using static IP, enter parameters at the top
     WiFi.begin(AP_SSID, AP_PASS);
     Serial.print(F("connecting to WiFi "));
diff --git a/libraries/esp8266/examples/MMU48K/MMU48K.ino b/libraries/esp8266/examples/MMU48K/MMU48K.ino
index d75d91232b..6faeb15363 100644
--- a/libraries/esp8266/examples/MMU48K/MMU48K.ino
+++ b/libraries/esp8266/examples/MMU48K/MMU48K.ino
@@ -4,21 +4,21 @@
 #include <umm_malloc/umm_heap_select.h>
 
 #if defined(CORE_MOCK)
-#define XCHAL_INSTRAM1_VADDR		0x40100000
+#define XCHAL_INSTRAM1_VADDR 0x40100000
 #else
-#include <sys/config.h> // For config/core-isa.h
+#include <sys/config.h>  // For config/core-isa.h
 #endif
 
-uint32_t timed_byte_read(char *pc, uint32_t * o);
-uint32_t timed_byte_read2(char *pc, uint32_t * o);
-int divideA_B(int a, int b);
+uint32_t timed_byte_read(char* pc, uint32_t* o);
+uint32_t timed_byte_read2(char* pc, uint32_t* o);
+int      divideA_B(int a, int b);
 
 int* nullPointer = NULL;
 
-char *probe_b  = NULL;
-short *probe_s = NULL;
-char *probe_c  = (char *)0x40110000;
-short *unaligned_probe_s = NULL;
+char*  probe_b           = NULL;
+short* probe_s           = NULL;
+char*  probe_c           = (char*)0x40110000;
+short* unaligned_probe_s = NULL;
 
 uint32_t read_var = 0x11223344;
 
@@ -30,19 +30,19 @@ uint32_t read_var = 0x11223344;
 */
 
 #if defined(MMU_IRAM_HEAP) || defined(MMU_SEC_HEAP)
-uint32_t *gobble;
-size_t gobble_sz;
+uint32_t* gobble;
+size_t    gobble_sz;
 
-#elif (MMU_IRAM_SIZE > 32*1024)
-uint32_t gobble[4 * 1024] IRAM_ATTR;
+#elif (MMU_IRAM_SIZE > 32 * 1024)
+uint32_t         gobble[4 * 1024] IRAM_ATTR;
 constexpr size_t gobble_sz = sizeof(gobble);
 
 #else
-uint32_t gobble[256] IRAM_ATTR;
+uint32_t         gobble[256] IRAM_ATTR;
 constexpr size_t gobble_sz = sizeof(gobble);
 #endif
 
-bool  isValid(uint32_t *probe) {
+bool isValid(uint32_t* probe) {
   bool rc = true;
   if (NULL == probe) {
     ets_uart_printf("\nNULL memory pointer %p ...\n", probe);
@@ -50,11 +50,12 @@ bool  isValid(uint32_t *probe) {
   }
 
   ets_uart_printf("\nTesting for valid memory at %p ...\n", probe);
-  uint32_t savePS = xt_rsil(15);
+  uint32_t savePS   = xt_rsil(15);
   uint32_t saveData = *probe;
   for (size_t i = 0; i < 32; i++) {
     *probe = BIT(i);
-    asm volatile("" ::: "memory");
+    asm volatile("" ::
+                     : "memory");
     uint32_t val = *probe;
     if (val != BIT(i)) {
       ets_uart_printf("  Read 0x%08X != Wrote 0x%08X\n", val, (uint32_t)BIT(i));
@@ -67,9 +68,8 @@ bool  isValid(uint32_t *probe) {
   return rc;
 }
 
-
-void dump_mem32(const void * addr, const size_t len) {
-  uint32_t *addr32 = (uint32_t *)addr;
+void dump_mem32(const void* addr, const size_t len) {
+  uint32_t* addr32 = (uint32_t*)addr;
   ets_uart_printf("\n");
   if ((uintptr_t)addr32 & 3) {
     ets_uart_printf("non-32-bit access\n");
@@ -122,7 +122,6 @@ void print_mmu_status(Print& oStream) {
 #endif
 }
 
-
 void setup() {
   WiFi.persistent(false);
   WiFi.mode(WIFI_OFF);
@@ -137,15 +136,15 @@ void setup() {
   {
     HeapSelectIram ephemeral;
     // Serial.printf_P(PSTR("ESP.getFreeHeap(): %u\n"), ESP.getFreeHeap());
-    gobble_sz = ESP.getFreeHeap() - UMM_OVERHEAD_ADJUST; // - 4096;
-    gobble = (uint32_t *)malloc(gobble_sz);
+    gobble_sz = ESP.getFreeHeap() - UMM_OVERHEAD_ADJUST;  // - 4096;
+    gobble    = (uint32_t*)malloc(gobble_sz);
   }
   Serial.printf_P(PSTR("\r\nmalloc() from IRAM Heap:\r\n"));
   Serial.printf_P(PSTR("  gobble_sz: %u\r\n"), gobble_sz);
   Serial.printf_P(PSTR("  gobble:    %p\r\n"), gobble);
 
 #elif defined(MMU_SEC_HEAP)
-  gobble = (uint32_t *)MMU_SEC_HEAP;
+  gobble    = (uint32_t*)MMU_SEC_HEAP;
   gobble_sz = MMU_SEC_HEAP_SIZE;
 #endif
 
@@ -165,41 +164,40 @@ void setup() {
 
   // Lets peak over the edge
   Serial.printf_P(PSTR("\r\nPeek over the edge of memory at 0x4010C000\r\n"));
-  dump_mem32((void *)(0x4010C000 - 16 * 4), 32);
-
-  probe_b = (char *)gobble;
-  probe_s = (short *)((uintptr_t)gobble);
-  unaligned_probe_s = (short *)((uintptr_t)gobble + 1);
+  dump_mem32((void*)(0x4010C000 - 16 * 4), 32);
 
+  probe_b           = (char*)gobble;
+  probe_s           = (short*)((uintptr_t)gobble);
+  unaligned_probe_s = (short*)((uintptr_t)gobble + 1);
 }
 
 void processKey(Print& out, int hotKey) {
   switch (hotKey) {
     case 't': {
-        uint32_t tmp;
-        out.printf_P(PSTR("Test how much time is added by exception handling"));
-        out.println();
-        out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char *)0x40200003, &tmp), tmp);
-        out.println();
-        out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char *)0x40200003, &tmp), tmp);
-        out.println();
-        out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char *)0x40108000, &tmp), tmp);
-        out.println();
-        out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char *)((uintptr_t)&read_var + 1), &tmp), tmp);
-        out.println();
-        out.printf_P(PSTR("Test how much time is used by the inline function method"));
-        out.println();
-        out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)0x40200003, &tmp), tmp);
-        out.println();
-        out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)0x40200003, &tmp), tmp);
-        out.println();
-        out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)0x40108000, &tmp), tmp);
-        out.println();
-        out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)((uintptr_t)&read_var + 1), &tmp), tmp);
-        out.println();
-        out.println();
-        break;
-      }
+      uint32_t tmp;
+      out.printf_P(PSTR("Test how much time is added by exception handling"));
+      out.println();
+      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char*)0x40200003, &tmp), tmp);
+      out.println();
+      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char*)0x40200003, &tmp), tmp);
+      out.println();
+      out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char*)0x40108000, &tmp), tmp);
+      out.println();
+      out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char*)((uintptr_t)&read_var + 1), &tmp), tmp);
+      out.println();
+      out.printf_P(PSTR("Test how much time is used by the inline function method"));
+      out.println();
+      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)0x40200003, &tmp), tmp);
+      out.println();
+      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)0x40200003, &tmp), tmp);
+      out.println();
+      out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)0x40108000, &tmp), tmp);
+      out.println();
+      out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)((uintptr_t)&read_var + 1), &tmp), tmp);
+      out.println();
+      out.println();
+      break;
+    }
     case '9':
       out.printf_P(PSTR("Unaligned exception by reading short"));
       out.println();
@@ -228,17 +226,17 @@ void processKey(Print& out, int hotKey) {
       out.println();
       break;
     case 'B': {
-        out.printf_P(PSTR("Load/Store exception by writing byte to iRAM"));
-        out.println();
-        char val = 0x55;
-        out.printf_P(PSTR("Write byte, 0x%02X, to iRAM at %p"), val, probe_b);
-        out.println();
-        out.flush();
-        probe_b[0] = val;
-        out.printf_P(PSTR("Read Byte back from iRAM, 0x%02X at %p"), probe_b[0], probe_b);
-        out.println();
-        break;
-      }
+      out.printf_P(PSTR("Load/Store exception by writing byte to iRAM"));
+      out.println();
+      char val = 0x55;
+      out.printf_P(PSTR("Write byte, 0x%02X, to iRAM at %p"), val, probe_b);
+      out.println();
+      out.flush();
+      probe_b[0] = val;
+      out.printf_P(PSTR("Read Byte back from iRAM, 0x%02X at %p"), probe_b[0], probe_b);
+      out.println();
+      break;
+    }
     case 's':
       out.printf_P(PSTR("Load/Store exception by reading short from iRAM"));
       out.println();
@@ -247,17 +245,17 @@ void processKey(Print& out, int hotKey) {
       out.println();
       break;
     case 'S': {
-        out.printf_P(PSTR("Load/Store exception by writing short to iRAM"));
-        out.println();
-        short int val = 0x0AA0;
-        out.printf_P(PSTR("Write short, 0x%04X, to iRAM at %p"), val, probe_s);
-        out.println();
-        out.flush();
-        probe_s[0] = val;
-        out.printf_P(PSTR("Read short back from iRAM, 0x%04X at %p"), probe_s[0], probe_s);
-        out.println();
-        break;
-      }
+      out.printf_P(PSTR("Load/Store exception by writing short to iRAM"));
+      out.println();
+      short int val = 0x0AA0;
+      out.printf_P(PSTR("Write short, 0x%04X, to iRAM at %p"), val, probe_s);
+      out.println();
+      out.flush();
+      probe_s[0] = val;
+      out.printf_P(PSTR("Read short back from iRAM, 0x%04X at %p"), probe_s[0], probe_s);
+      out.println();
+      break;
+    }
     case 'R':
       out.printf_P(PSTR("Restart, ESP.restart(); ..."));
       out.println();
@@ -310,7 +308,6 @@ void processKey(Print& out, int hotKey) {
   }
 }
 
-
 void serialClientLoop(void) {
   if (Serial.available() > 0) {
     int hotKey = Serial.read();
@@ -322,7 +319,6 @@ void loop() {
   serialClientLoop();
 }
 
-
 int __attribute__((noinline)) divideA_B(int a, int b) {
   return (a / b);
 }
diff --git a/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino b/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
index f6c2df08fc..ce72d96f74 100644
--- a/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
+++ b/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
@@ -12,15 +12,13 @@
   This example code is in the public domain.
 */
 
-
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 // initial time (possibly given by an external RTC)
-#define RTC_UTC_TEST 1510592825 // 1510592825 = Monday 13 November 2017 17:07:05 UTC
-
+#define RTC_UTC_TEST 1510592825  // 1510592825 = Monday 13 November 2017 17:07:05 UTC
 
 // This database is autogenerated from IANA timezone database
 //    https://www.iana.org/time-zones
@@ -44,29 +42,29 @@
 ////////////////////////////////////////////////////////
 
 #include <ESP8266WiFi.h>
-#include <coredecls.h>                  // settimeofday_cb()
+#include <coredecls.h>  // settimeofday_cb()
 #include <Schedule.h>
 #include <PolledTimeout.h>
 
-#include <time.h>                       // time() ctime()
-#include <sys/time.h>                   // struct timeval
+#include <time.h>      // time() ctime()
+#include <sys/time.h>  // struct timeval
 
-#include <sntp.h>                       // sntp_servermode_dhcp()
+#include <sntp.h>  // sntp_servermode_dhcp()
 
 // for testing purpose:
-extern "C" int clock_gettime(clockid_t unused, struct timespec *tp);
+extern "C" int clock_gettime(clockid_t unused, struct timespec* tp);
 
 ////////////////////////////////////////////////////////
 
-static timeval tv;
+static timeval  tv;
 static timespec tp;
-static time_t now;
+static time_t   now;
 static uint32_t now_ms, now_us;
 
 static esp8266::polledTimeout::periodicMs showTimeNow(60000);
-static int time_machine_days = 0; // 0 = present
-static bool time_machine_running = false;
-static bool time_machine_run_once = false;
+static int                                time_machine_days     = 0;  // 0 = present
+static bool                               time_machine_running  = false;
+static bool                               time_machine_run_once = false;
 
 // OPTIONAL: change SNTP startup delay
 // a weak function is already defined and returns 0 (RFC violation)
@@ -86,21 +84,27 @@ static bool time_machine_run_once = false;
 //    return 15000; // 15s
 //}
 
-#define PTM(w) \
+#define PTM(w)              \
   Serial.print(" " #w "="); \
   Serial.print(tm->tm_##w);
 
 void printTm(const char* what, const tm* tm) {
   Serial.print(what);
-  PTM(isdst); PTM(yday); PTM(wday);
-  PTM(year);  PTM(mon);  PTM(mday);
-  PTM(hour);  PTM(min);  PTM(sec);
+  PTM(isdst);
+  PTM(yday);
+  PTM(wday);
+  PTM(year);
+  PTM(mon);
+  PTM(mday);
+  PTM(hour);
+  PTM(min);
+  PTM(sec);
 }
 
 void showTime() {
   gettimeofday(&tv, nullptr);
   clock_gettime(0, &tp);
-  now = time(nullptr);
+  now    = time(nullptr);
   now_ms = millis();
   now_us = micros();
 
@@ -135,7 +139,7 @@ void showTime() {
   Serial.println((uint32_t)now);
 
   // timezone and demo in the future
-  Serial.printf("timezone:  %s\n", getenv("TZ") ? : "(none)");
+  Serial.printf("timezone:  %s\n", getenv("TZ") ?: "(none)");
 
   // human readable
   Serial.print("ctime:     ");
@@ -143,7 +147,7 @@ void showTime() {
 
   // lwIP v2 is able to list more details about the currently configured SNTP servers
   for (int i = 0; i < SNTP_MAX_SERVERS; i++) {
-    IPAddress sntp = *sntp_getserver(i);
+    IPAddress   sntp = *sntp_getserver(i);
     const char* name = sntp_getservername(i);
     if (sntp.isSet()) {
       Serial.printf("sntp%d:     ", i);
@@ -162,7 +166,7 @@ void showTime() {
 
   // show subsecond synchronisation
   timeval prevtv;
-  time_t prevtime = time(nullptr);
+  time_t  prevtime = time(nullptr);
   gettimeofday(&prevtv, nullptr);
 
   while (true) {
@@ -190,7 +194,7 @@ void time_is_set(bool from_sntp /* <= this parameter is optional */) {
   if (time_machine_days == 0) {
     if (time_machine_running) {
       time_machine_run_once = true;
-      time_machine_running = false;
+      time_machine_running  = false;
     } else {
       time_machine_running = from_sntp && !time_machine_run_once;
     }
@@ -210,7 +214,7 @@ void time_is_set(bool from_sntp /* <= this parameter is optional */) {
 
   // time machine demo
   if (time_machine_running) {
-    now = time(nullptr);
+    now          = time(nullptr);
     const tm* tm = localtime(&now);
     Serial.printf(": future=%3ddays: DST=%s - ",
                   time_machine_days,
@@ -247,8 +251,8 @@ void setup() {
   // setup RTC time
   // it will be used until NTP server will send us real current time
   Serial.println("Manually setting some time from some RTC:");
-  time_t rtc = RTC_UTC_TEST;
-  timeval tv = { rtc, 0 };
+  time_t  rtc = RTC_UTC_TEST;
+  timeval tv  = { rtc, 0 };
   settimeofday(&tv, nullptr);
 
   // NTP servers may be overridden by your DHCP server for a more local one
diff --git a/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino b/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
index 9736995c74..405105b7b8 100644
--- a/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
+++ b/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
@@ -13,7 +13,7 @@
 // This example code is in the public domain.
 
 // CRC function used to ensure data validity
-uint32_t calculateCRC32(const uint8_t *data, size_t length);
+uint32_t calculateCRC32(const uint8_t* data, size_t length);
 
 // helper function to dump memory contents as hex
 void printMemory();
@@ -25,7 +25,7 @@ void printMemory();
 // We use byte array as an example.
 struct {
   uint32_t crc32;
-  byte data[508];
+  byte     data[508];
 } rtcData;
 
 void setup() {
@@ -34,11 +34,11 @@ void setup() {
   delay(1000);
 
   // Read struct from RTC memory
-  if (ESP.rtcUserMemoryRead(0, (uint32_t*) &rtcData, sizeof(rtcData))) {
+  if (ESP.rtcUserMemoryRead(0, (uint32_t*)&rtcData, sizeof(rtcData))) {
     Serial.println("Read: ");
     printMemory();
     Serial.println();
-    uint32_t crcOfData = calculateCRC32((uint8_t*) &rtcData.data[0], sizeof(rtcData.data));
+    uint32_t crcOfData = calculateCRC32((uint8_t*)&rtcData.data[0], sizeof(rtcData.data));
     Serial.print("CRC32 of data: ");
     Serial.println(crcOfData, HEX);
     Serial.print("CRC32 read from RTC: ");
@@ -55,9 +55,9 @@ void setup() {
     rtcData.data[i] = random(0, 128);
   }
   // Update CRC32 of data
-  rtcData.crc32 = calculateCRC32((uint8_t*) &rtcData.data[0], sizeof(rtcData.data));
+  rtcData.crc32 = calculateCRC32((uint8_t*)&rtcData.data[0], sizeof(rtcData.data));
   // Write struct to RTC memory
-  if (ESP.rtcUserMemoryWrite(0, (uint32_t*) &rtcData, sizeof(rtcData))) {
+  if (ESP.rtcUserMemoryWrite(0, (uint32_t*)&rtcData, sizeof(rtcData))) {
     Serial.println("Write: ");
     printMemory();
     Serial.println();
@@ -70,7 +70,7 @@ void setup() {
 void loop() {
 }
 
-uint32_t calculateCRC32(const uint8_t *data, size_t length) {
+uint32_t calculateCRC32(const uint8_t* data, size_t length) {
   uint32_t crc = 0xffffffff;
   while (length--) {
     uint8_t c = *data++;
@@ -90,8 +90,8 @@ uint32_t calculateCRC32(const uint8_t *data, size_t length) {
 
 //prints all rtcData, including the leading crc32
 void printMemory() {
-  char buf[3];
-  uint8_t *ptr = (uint8_t *)&rtcData;
+  char     buf[3];
+  uint8_t* ptr = (uint8_t*)&rtcData;
   for (size_t i = 0; i < sizeof(rtcData); i++) {
     sprintf(buf, "%02X", ptr[i]);
     Serial.print(buf);
diff --git a/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino b/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
index 61967c691f..2b1cd01129 100644
--- a/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
+++ b/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
@@ -1,4 +1,4 @@
-#define TIMEOUT (10000UL)     // Maximum time to wait for serial activity to start
+#define TIMEOUT (10000UL)  // Maximum time to wait for serial activity to start
 
 void setup() {
   // put your setup code here, to run once:
@@ -29,6 +29,4 @@ void setup() {
 
 void loop() {
   // put your main code here, to run repeatedly:
-
 }
-
diff --git a/libraries/esp8266/examples/SerialStress/SerialStress.ino b/libraries/esp8266/examples/SerialStress/SerialStress.ino
index a19eb9f270..4e34da7201 100644
--- a/libraries/esp8266/examples/SerialStress/SerialStress.ino
+++ b/libraries/esp8266/examples/SerialStress/SerialStress.ino
@@ -11,25 +11,25 @@
 #include <ESP8266WiFi.h>
 #include <SoftwareSerial.h>
 
-#define SSBAUD          115200  // logger on console for humans
-#define BAUD            3000000 // hardware serial stress test
-#define BUFFER_SIZE     4096    // may be useless to use more than 2*SERIAL_SIZE_RX
-#define SERIAL_SIZE_RX  1024    // Serial.setRxBufferSize()
+#define SSBAUD 115200        // logger on console for humans
+#define BAUD 3000000         // hardware serial stress test
+#define BUFFER_SIZE 4096     // may be useless to use more than 2*SERIAL_SIZE_RX
+#define SERIAL_SIZE_RX 1024  // Serial.setRxBufferSize()
 
-#define FAKE_INCREASED_AVAILABLE 100 // test readBytes's timeout
+#define FAKE_INCREASED_AVAILABLE 100  // test readBytes's timeout
 
 #define TIMEOUT 5000
-#define DEBUG(x...) //x
+#define DEBUG(x...)  //x
 
-uint8_t buf [BUFFER_SIZE];
-uint8_t temp [BUFFER_SIZE];
-bool reading = true;
-size_t testReadBytesTimeout = 0;
+uint8_t buf[BUFFER_SIZE];
+uint8_t temp[BUFFER_SIZE];
+bool    reading              = true;
+size_t  testReadBytesTimeout = 0;
 
-static size_t out_idx = 0, in_idx = 0;
-static size_t local_receive_size = 0;
-static size_t size_for_1sec, size_for_led = 0;
-static size_t maxavail = 0;
+static size_t   out_idx = 0, in_idx = 0;
+static size_t   local_receive_size = 0;
+static size_t   size_for_1sec, size_for_led = 0;
+static size_t   maxavail = 0;
 static uint64_t in_total = 0, in_prev = 0;
 static uint64_t start_ms, last_ms;
 static uint64_t timeout;
@@ -61,7 +61,7 @@ void setup() {
   pinMode(LED_BUILTIN, OUTPUT);
 
   Serial.begin(BAUD);
-  Serial.swap(); // RX=GPIO13 TX=GPIO15
+  Serial.swap();  // RX=GPIO13 TX=GPIO15
   Serial.setRxBufferSize(SERIAL_SIZE_RX);
 
   // using HardwareSerial0 pins,
@@ -78,7 +78,7 @@ void setup() {
   logger->printf("\n\nBAUD: %d - CoreRxBuffer: %d bytes - TestBuffer: %d bytes\n",
                  baud, SERIAL_SIZE_RX, BUFFER_SIZE);
 
-  size_for_1sec = baud / 10; // 8n1=10baudFor8bits
+  size_for_1sec = baud / 10;  // 8n1=10baudFor8bits
   logger->printf("led changes state every %zd bytes (= 1 second)\n", size_for_1sec);
   logger->printf("press 's' to stop reading, not writing (induces overrun)\n");
   logger->printf("press 't' to toggle timeout testing on readBytes\n");
@@ -91,7 +91,8 @@ void setup() {
   // bind RX and TX
   USC0(0) |= (1 << UCLBE);
 
-  while (Serial.read() == -1);
+  while (Serial.read() == -1)
+    ;
   if (Serial.hasOverrun()) {
     logger->print("overrun?\n");
   }
@@ -107,9 +108,7 @@ void loop() {
     maxlen = BUFFER_SIZE - out_idx;
   }
   // check if not cycling more than buffer size relatively to input
-  size_t in_out = out_idx == in_idx ?
-                  BUFFER_SIZE :
-                  (in_idx + BUFFER_SIZE - out_idx - 1) % BUFFER_SIZE;
+  size_t in_out = out_idx == in_idx ? BUFFER_SIZE : (in_idx + BUFFER_SIZE - out_idx - 1) % BUFFER_SIZE;
   if (maxlen > in_out) {
     maxlen = in_out;
   }
@@ -170,9 +169,9 @@ void loop() {
       error("receiving nothing?\n");
     }
 
-    unsigned long now_ms = millis();
-    int bwkbps_avg = ((((uint64_t)in_total) * 8000) / (now_ms - start_ms)) >> 10;
-    int bwkbps_now = (((in_total - in_prev) * 8000) / (now_ms - last_ms)) >> 10 ;
+    unsigned long now_ms     = millis();
+    int           bwkbps_avg = ((((uint64_t)in_total) * 8000) / (now_ms - start_ms)) >> 10;
+    int           bwkbps_now = (((in_total - in_prev) * 8000) / (now_ms - last_ms)) >> 10;
     logger->printf("bwavg=%d bwnow=%d kbps maxavail=%i\n", bwkbps_avg, bwkbps_now, maxavail);
 
     in_prev = in_total;
diff --git a/libraries/esp8266/examples/StreamString/StreamString.ino b/libraries/esp8266/examples/StreamString/StreamString.ino
index c9c6b46025..d4571a0bfb 100644
--- a/libraries/esp8266/examples/StreamString/StreamString.ino
+++ b/libraries/esp8266/examples/StreamString/StreamString.ino
@@ -21,10 +21,10 @@ void checksketch(const char* what, const char* res1, const char* res2) {
 #endif
 
 void testStringPtrProgmem() {
-  static const char inProgmem [] PROGMEM = "I am in progmem";
-  auto inProgmem2 = F("I am too in progmem");
+  static const char inProgmem[] PROGMEM = "I am in progmem";
+  auto              inProgmem2          = F("I am too in progmem");
 
-  int heap = (int)ESP.getFreeHeap();
+  int  heap    = (int)ESP.getFreeHeap();
   auto stream1 = StreamConstPtr(inProgmem, sizeof(inProgmem) - 1);
   auto stream2 = StreamConstPtr(inProgmem2);
   Serial << stream1 << " - " << stream2 << "\n";
@@ -33,7 +33,7 @@ void testStringPtrProgmem() {
 }
 
 void testStreamString() {
-  String inputString = "hello";
+  String       inputString = "hello";
   StreamString result;
 
   // By default, reading a S2Stream(String) or a StreamString will consume the String.
@@ -46,7 +46,6 @@ void testStreamString() {
   // In non-default non-consume mode, it will just move a pointer.  That one
   // can be ::resetPointer(pos) anytime.  See the example below.
 
-
   // The String included in 'result' will not be modified by read:
   // (this is not the default)
   result.resetPointer();
@@ -110,7 +109,7 @@ void testStreamString() {
     result.clear();
     S2Stream input(inputString);
     // reading stream will consume the string
-    input.setConsume(); // can be omitted, this is the default
+    input.setConsume();  // can be omitted, this is the default
 
     input.sendSize(result, 1);
     input.sendSize(result, 2);
@@ -155,7 +154,7 @@ void testStreamString() {
 
   // .. but it does when S2Stream or StreamString is used
   {
-    int heap = (int)ESP.getFreeHeap();
+    int  heap   = (int)ESP.getFreeHeap();
     auto stream = StreamString(F("I am in progmem"));
     Serial << stream << "\n";
     heap -= (int)ESP.getFreeHeap();
diff --git a/libraries/esp8266/examples/TestEspApi/TestEspApi.ino b/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
index 49ff525898..dd7727f9b7 100644
--- a/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
+++ b/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
@@ -28,7 +28,7 @@ Stream& ehConsolePort(Serial);
 // UNLESS: You swap the TX pin using the alternate pinout.
 const uint8_t LED_PIN = 1;
 
-const char * const RST_REASONS[] = {
+const char* const RST_REASONS[] = {
   "REASON_DEFAULT_RST",
   "REASON_WDT_RST",
   "REASON_EXCEPTION_RST",
@@ -38,7 +38,7 @@ const char * const RST_REASONS[] = {
   "REASON_EXT_SYS_RST"
 };
 
-const char * const FLASH_SIZE_MAP_NAMES[] = {
+const char* const FLASH_SIZE_MAP_NAMES[] = {
   "FLASH_SIZE_4M_MAP_256_256",
   "FLASH_SIZE_2M",
   "FLASH_SIZE_8M_MAP_512_512",
@@ -48,14 +48,14 @@ const char * const FLASH_SIZE_MAP_NAMES[] = {
   "FLASH_SIZE_32M_MAP_1024_1024"
 };
 
-const char * const OP_MODE_NAMES[] {
+const char* const OP_MODE_NAMES[] {
   "NULL_MODE",
   "STATION_MODE",
   "SOFTAP_MODE",
   "STATIONAP_MODE"
 };
 
-const char * const AUTH_MODE_NAMES[] {
+const char* const AUTH_MODE_NAMES[] {
   "AUTH_OPEN",
   "AUTH_WEP",
   "AUTH_WPA_PSK",
@@ -64,14 +64,14 @@ const char * const AUTH_MODE_NAMES[] {
   "AUTH_MAX"
 };
 
-const char * const PHY_MODE_NAMES[] {
+const char* const PHY_MODE_NAMES[] {
   "",
   "PHY_MODE_11B",
   "PHY_MODE_11G",
   "PHY_MODE_11N"
 };
 
-const char * const EVENT_NAMES[] {
+const char* const EVENT_NAMES[] {
   "EVENT_STAMODE_CONNECTED",
   "EVENT_STAMODE_DISCONNECTED",
   "EVENT_STAMODE_AUTHMODE_CHANGE",
@@ -81,7 +81,7 @@ const char * const EVENT_NAMES[] {
   "EVENT_MAX"
 };
 
-const char * const EVENT_REASONS[] {
+const char* const EVENT_REASONS[] {
   "",
   "REASON_UNSPECIFIED",
   "REASON_AUTH_EXPIRE",
@@ -108,12 +108,12 @@ const char * const EVENT_REASONS[] {
   "REASON_CIPHER_SUITE_REJECTED",
 };
 
-const char * const EVENT_REASONS_200[] {
+const char* const EVENT_REASONS_200[] {
   "REASON_BEACON_TIMEOUT",
   "REASON_NO_AP_FOUND"
 };
 
-void wifi_event_handler_cb(System_Event_t * event) {
+void wifi_event_handler_cb(System_Event_t* event) {
   ehConsolePort.print(EVENT_NAMES[event->event]);
   ehConsolePort.print(" (");
 
@@ -128,27 +128,26 @@ void wifi_event_handler_cb(System_Event_t * event) {
       break;
     case EVENT_SOFTAPMODE_STACONNECTED:
     case EVENT_SOFTAPMODE_STADISCONNECTED: {
-        char mac[32] = {0};
-        snprintf(mac, 32, MACSTR ", aid: %d", MAC2STR(event->event_info.sta_connected.mac), event->event_info.sta_connected.aid);
+      char mac[32] = { 0 };
+      snprintf(mac, 32, MACSTR ", aid: %d", MAC2STR(event->event_info.sta_connected.mac), event->event_info.sta_connected.aid);
 
-        ehConsolePort.print(mac);
-      }
-      break;
+      ehConsolePort.print(mac);
+    } break;
   }
 
   ehConsolePort.println(")");
 }
 
-void print_softap_config(Stream & consolePort, softap_config const& config) {
+void print_softap_config(Stream& consolePort, softap_config const& config) {
   consolePort.println();
   consolePort.println(F("SoftAP Configuration"));
   consolePort.println(F("--------------------"));
 
   consolePort.print(F("ssid:            "));
-  consolePort.println((char *) config.ssid);
+  consolePort.println((char*)config.ssid);
 
   consolePort.print(F("password:        "));
-  consolePort.println((char *) config.password);
+  consolePort.println((char*)config.password);
 
   consolePort.print(F("ssid_len:        "));
   consolePort.println(config.ssid_len);
@@ -173,8 +172,8 @@ void print_softap_config(Stream & consolePort, softap_config const& config) {
   consolePort.println();
 }
 
-void print_system_info(Stream & consolePort) {
-  const rst_info * resetInfo = system_get_rst_info();
+void print_system_info(Stream& consolePort) {
+  const rst_info* resetInfo = system_get_rst_info();
   consolePort.print(F("system_get_rst_info() reset reason: "));
   consolePort.println(RST_REASONS[resetInfo->reason]);
 
@@ -211,7 +210,7 @@ void print_system_info(Stream & consolePort) {
   consolePort.println(FLASH_SIZE_MAP_NAMES[system_get_flash_size_map()]);
 }
 
-void print_wifi_general(Stream & consolePort) {
+void print_wifi_general(Stream& consolePort) {
   consolePort.print(F("wifi_get_channel(): "));
   consolePort.println(wifi_get_channel());
 
@@ -219,8 +218,8 @@ void print_wifi_general(Stream & consolePort) {
   consolePort.println(PHY_MODE_NAMES[wifi_get_phy_mode()]);
 }
 
-void secure_softap_config(softap_config * config, const char * ssid, const char * password) {
-  size_t ssidLen     = strlen(ssid)     < sizeof(config->ssid)     ? strlen(ssid)     : sizeof(config->ssid);
+void secure_softap_config(softap_config* config, const char* ssid, const char* password) {
+  size_t ssidLen     = strlen(ssid) < sizeof(config->ssid) ? strlen(ssid) : sizeof(config->ssid);
   size_t passwordLen = strlen(password) < sizeof(config->password) ? strlen(password) : sizeof(config->password);
 
   memset(config->ssid, 0, sizeof(config->ssid));
@@ -293,4 +292,3 @@ void loop() {
   Serial.println(system_get_time());
   delay(1000);
 }
-
diff --git a/libraries/esp8266/examples/UartDownload/UartDownload.ino b/libraries/esp8266/examples/UartDownload/UartDownload.ino
index cf581c8890..6d86441998 100644
--- a/libraries/esp8266/examples/UartDownload/UartDownload.ino
+++ b/libraries/esp8266/examples/UartDownload/UartDownload.ino
@@ -59,11 +59,10 @@ constexpr char slipFrameMarker = '\xC0';
 //   <0xC0><cmd><payload length><32 bit cksum><payload data ...><0xC0>
 // Slip packet for ESP_SYNC, minus the frame markers ('\xC0') captured from
 // esptool using the `--trace` option.
-const char syncPkt[] PROGMEM =
-  "\x00\x08\x24\x00\x00\x00\x00\x00\x07\x07\x12\x20"
-  "UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU";
+const char syncPkt[] PROGMEM = "\x00\x08\x24\x00\x00\x00\x00\x00\x07\x07\x12\x20"
+                               "UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU";
 
-constexpr size_t syncPktSz = sizeof(syncPkt) - 1; // Don't compare zero terminator char
+constexpr size_t syncPktSz = sizeof(syncPkt) - 1;  // Don't compare zero terminator char
 
 //
 //  Use the discovery of an ESP_SYNC packet, to trigger calling UART Download
@@ -90,7 +89,7 @@ void proxyEspSync() {
   }
 
   // Assume RX FIFO data is garbled and flush all RX data.
-  while (0 <= Serial.read()) {} // Clear FIFO
+  while (0 <= Serial.read()) { }  // Clear FIFO
 
   // If your Serial requirements need a specific timeout value, you would
   // restore those here.
@@ -112,12 +111,12 @@ void setup() {
   Serial.begin(115200);
 
   Serial.println(F(
-                   "\r\n\r\n"
-                   "Boot UART Download Demo - initialization started.\r\n"
-                   "\r\n"
-                   "For a quick test to see the UART Download work,\r\n"
-                   "stop your serial terminal APP and run:\r\n"
-                   "  esptool.py --chip esp8266 --before no_reset --after soft_reset flash_id\r\n"));
+      "\r\n\r\n"
+      "Boot UART Download Demo - initialization started.\r\n"
+      "\r\n"
+      "For a quick test to see the UART Download work,\r\n"
+      "stop your serial terminal APP and run:\r\n"
+      "  esptool.py --chip esp8266 --before no_reset --after soft_reset flash_id\r\n"));
 
   // ...
 }
@@ -143,7 +142,7 @@ void cmdLoop(Print& oStream, int key) {
       ESP.restart();
       break;
 
-    // ...
+      // ...
 
     case '?':
       oStream.println(F("\r\nHot key help:"));
@@ -162,9 +161,7 @@ void cmdLoop(Print& oStream, int key) {
   oStream.println();
 }
 
-
 void loop() {
-
   // In this example, we can have Serial data from a user keystroke for our
   // command loop or the esptool trying to SYNC up for flashing.  If the
   // character matches the Slip Frame Marker (the 1st byte of the SYNC packet),
diff --git a/libraries/esp8266/examples/interactive/interactive.ino b/libraries/esp8266/examples/interactive/interactive.ino
index b3bd1ff931..1206dba83d 100644
--- a/libraries/esp8266/examples/interactive/interactive.ino
+++ b/libraries/esp8266/examples/interactive/interactive.ino
@@ -12,11 +12,11 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
-const char * SSID = STASSID;
-const char * PSK = STAPSK;
+const char* SSID = STASSID;
+const char* PSK  = STAPSK;
 
 IPAddress staticip(192, 168, 1, 123);
 IPAddress gateway(192, 168, 1, 254);
@@ -36,15 +36,14 @@ void setup() {
   Serial.println();
   Serial.println(WiFi.localIP());
   Serial.print(
-    "WL_IDLE_STATUS      = 0\n"
-    "WL_NO_SSID_AVAIL    = 1\n"
-    "WL_SCAN_COMPLETED   = 2\n"
-    "WL_CONNECTED        = 3\n"
-    "WL_CONNECT_FAILED   = 4\n"
-    "WL_CONNECTION_LOST  = 5\n"
-    "WL_WRONG_PASSWORD   = 6\n"
-    "WL_DISCONNECTED     = 7\n"
-  );
+      "WL_IDLE_STATUS      = 0\n"
+      "WL_NO_SSID_AVAIL    = 1\n"
+      "WL_SCAN_COMPLETED   = 2\n"
+      "WL_CONNECTED        = 3\n"
+      "WL_CONNECT_FAILED   = 4\n"
+      "WL_CONNECTION_LOST  = 5\n"
+      "WL_WRONG_PASSWORD   = 6\n"
+      "WL_DISCONNECTED     = 7\n");
 }
 
 void WiFiOn() {
@@ -63,11 +62,18 @@ void WiFiOff() {
 }
 
 void loop() {
-#define TEST(name, var, varinit, func) \
+#define TEST(name, var, varinit, func)   \
   static decltype(func) var = (varinit); \
-  if ((var) != (func)) { var = (func); Serial.printf("**** %s: ", name); Serial.println(var); }
+  if ((var) != (func)) {                 \
+    var = (func);                        \
+    Serial.printf("**** %s: ", name);    \
+    Serial.println(var);                 \
+  }
 
-#define DO(x...) Serial.println(F( #x )); x; break
+#define DO(x...)         \
+  Serial.println(F(#x)); \
+  x;                     \
+  break
 
   TEST("Free Heap", freeHeap, 0, ESP.getFreeHeap());
   TEST("WiFiStatus", status, WL_IDLE_STATUS, WiFi.status());
@@ -75,23 +81,41 @@ void loop() {
   TEST("AP-IP", apIp, (uint32_t)0, WiFi.softAPIP());
 
   switch (Serial.read()) {
-    case 'F': DO(WiFiOff());
-    case 'N': DO(WiFiOn());
-    case '1': DO(WiFi.mode(WIFI_AP));
-    case '2': DO(WiFi.mode(WIFI_AP_STA));
-    case '3': DO(WiFi.mode(WIFI_STA));
-    case 'R': DO(if (((GPI >> 16) & 0xf) == 1) ESP.reset() /* else must hard reset */);
-    case 'd': DO(WiFi.disconnect());
-    case 'b': DO(WiFi.begin());
-    case 'B': DO(WiFi.begin(SSID, PSK));
-    case 'r': DO(WiFi.reconnect());
-    case 'c': DO(wifi_station_connect());
-    case 'a': DO(WiFi.setAutoReconnect(false));
-    case 'A': DO(WiFi.setAutoReconnect(true));
-    case 'n': DO(WiFi.setSleepMode(WIFI_NONE_SLEEP));
-    case 'l': DO(WiFi.setSleepMode(WIFI_LIGHT_SLEEP));
-    case 'm': DO(WiFi.setSleepMode(WIFI_MODEM_SLEEP));
-    case 'S': DO(WiFi.config(staticip, gateway, subnet)); // use static address
-    case 's': DO(WiFi.config(0u, 0u, 0u));                // back to dhcp client
+    case 'F':
+      DO(WiFiOff());
+    case 'N':
+      DO(WiFiOn());
+    case '1':
+      DO(WiFi.mode(WIFI_AP));
+    case '2':
+      DO(WiFi.mode(WIFI_AP_STA));
+    case '3':
+      DO(WiFi.mode(WIFI_STA));
+    case 'R':
+      DO(if (((GPI >> 16) & 0xf) == 1) ESP.reset() /* else must hard reset */);
+    case 'd':
+      DO(WiFi.disconnect());
+    case 'b':
+      DO(WiFi.begin());
+    case 'B':
+      DO(WiFi.begin(SSID, PSK));
+    case 'r':
+      DO(WiFi.reconnect());
+    case 'c':
+      DO(wifi_station_connect());
+    case 'a':
+      DO(WiFi.setAutoReconnect(false));
+    case 'A':
+      DO(WiFi.setAutoReconnect(true));
+    case 'n':
+      DO(WiFi.setSleepMode(WIFI_NONE_SLEEP));
+    case 'l':
+      DO(WiFi.setSleepMode(WIFI_LIGHT_SLEEP));
+    case 'm':
+      DO(WiFi.setSleepMode(WIFI_MODEM_SLEEP));
+    case 'S':
+      DO(WiFi.config(staticip, gateway, subnet));  // use static address
+    case 's':
+      DO(WiFi.config(0u, 0u, 0u));  // back to dhcp client
   }
 }
diff --git a/libraries/esp8266/examples/irammem/irammem.ino b/libraries/esp8266/examples/irammem/irammem.ino
index 5cd1db7b36..ea9597bee8 100644
--- a/libraries/esp8266/examples/irammem/irammem.ino
+++ b/libraries/esp8266/examples/irammem/irammem.ino
@@ -9,7 +9,6 @@
 
 // #define USE_SET_IRAM_HEAP
 
-
 #ifndef ETS_PRINTF
 #define ETS_PRINTF ets_uart_printf
 #endif
@@ -21,9 +20,8 @@
 
 #pragma GCC push_options
 // reference
-#pragma GCC optimize("O0")   // We expect -O0 to generate the correct results
-__attribute__((noinline))
-void aliasTestReference(uint16_t *x) {
+#pragma GCC                    optimize("O0")  // We expect -O0 to generate the correct results
+__attribute__((noinline)) void aliasTestReference(uint16_t* x) {
   // Without adhearance to strict-aliasing, this sequence of code would fail
   // when optimized by GCC Version 10.3
   size_t len = 3;
@@ -35,9 +33,8 @@ void aliasTestReference(uint16_t *x) {
   }
 }
 // Tests
-#pragma GCC optimize("Os")
-__attribute__((noinline))
-void aliasTestOs(uint16_t *x) {
+#pragma GCC                    optimize("Os")
+__attribute__((noinline)) void aliasTestOs(uint16_t* x) {
   size_t len = 3;
   for (size_t u = 0; u < len; u++) {
     uint16_t x1 = mmu_get_uint16(&x[0]);
@@ -46,9 +43,8 @@ void aliasTestOs(uint16_t *x) {
     }
   }
 }
-#pragma GCC optimize("O2")
-__attribute__((noinline))
-void aliasTestO2(uint16_t *x) {
+#pragma GCC                    optimize("O2")
+__attribute__((noinline)) void aliasTestO2(uint16_t* x) {
   size_t len = 3;
   for (size_t u = 0; u < len; u++) {
     uint16_t x1 = mmu_get_uint16(&x[0]);
@@ -57,9 +53,8 @@ void aliasTestO2(uint16_t *x) {
     }
   }
 }
-#pragma GCC optimize("O3")
-__attribute__((noinline))
-void aliasTestO3(uint16_t *x) {
+#pragma GCC                    optimize("O3")
+__attribute__((noinline)) void aliasTestO3(uint16_t* x) {
   size_t len = 3;
   for (size_t u = 0; u < len; u++) {
     uint16_t x1 = mmu_get_uint16(&x[0]);
@@ -74,7 +69,8 @@ void aliasTestO3(uint16_t *x) {
 // the exception handler. For this case the -O0 version will appear faster.
 #pragma GCC optimize("O0")
 __attribute__((noinline)) IRAM_ATTR
-uint32_t timedRead_Reference(uint8_t *res) {
+    uint32_t
+    timedRead_Reference(uint8_t* res) {
   // This test case was verified with GCC 10.3
   // There is a code case that can result in 32-bit wide IRAM load from memory
   // being optimized down to an 8-bit memory access. In this test case we need
@@ -82,40 +78,43 @@ uint32_t timedRead_Reference(uint8_t *res) {
   // This section verifies that the workaround implimented by the inline
   // function mmu_get_uint8() is preventing this. See comments for function
   // mmu_get_uint8(() in mmu_iram.h for more details.
-  const uint8_t *x = (const uint8_t *)0x40100003ul;
-  uint32_t b = ESP.getCycleCount();
-  *res = mmu_get_uint8(x);
+  const uint8_t* x = (const uint8_t*)0x40100003ul;
+  uint32_t       b = ESP.getCycleCount();
+  *res             = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC optimize("Os")
 __attribute__((noinline)) IRAM_ATTR
-uint32_t timedRead_Os(uint8_t *res) {
-  const uint8_t *x = (const uint8_t *)0x40100003ul;
-  uint32_t b = ESP.getCycleCount();
-  *res = mmu_get_uint8(x);
+    uint32_t
+    timedRead_Os(uint8_t* res) {
+  const uint8_t* x = (const uint8_t*)0x40100003ul;
+  uint32_t       b = ESP.getCycleCount();
+  *res             = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC optimize("O2")
 __attribute__((noinline)) IRAM_ATTR
-uint32_t timedRead_O2(uint8_t *res) {
-  const uint8_t *x = (const uint8_t *)0x40100003ul;
-  uint32_t b = ESP.getCycleCount();
-  *res = mmu_get_uint8(x);
+    uint32_t
+    timedRead_O2(uint8_t* res) {
+  const uint8_t* x = (const uint8_t*)0x40100003ul;
+  uint32_t       b = ESP.getCycleCount();
+  *res             = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC optimize("O3")
 __attribute__((noinline)) IRAM_ATTR
-uint32_t timedRead_O3(uint8_t *res) {
-  const uint8_t *x = (const uint8_t *)0x40100003ul;
-  uint32_t b = ESP.getCycleCount();
-  *res = mmu_get_uint8(x);
+    uint32_t
+    timedRead_O3(uint8_t* res) {
+  const uint8_t* x = (const uint8_t*)0x40100003ul;
+  uint32_t       b = ESP.getCycleCount();
+  *res             = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
 #pragma GCC pop_options
 
 bool test4_32bit_loads() {
-  bool result = true;
-  uint8_t res;
+  bool     result = true;
+  uint8_t  res;
   uint32_t cycle_count_ref, cycle_count;
   Serial.printf("\r\nFor mmu_get_uint8, verify that 32-bit wide IRAM access is preserved across different optimizations:\r\n");
   cycle_count_ref = timedRead_Reference(&res);
@@ -153,7 +152,7 @@ bool test4_32bit_loads() {
   return result;
 }
 
-void printPunFail(uint16_t *ref, uint16_t *x, size_t sz) {
+void printPunFail(uint16_t* ref, uint16_t* x, size_t sz) {
   Serial.printf("    Expected:");
   for (size_t i = 0; i < sz; i++) {
     Serial.printf(" %3u", ref[i]);
@@ -168,12 +167,12 @@ void printPunFail(uint16_t *ref, uint16_t *x, size_t sz) {
 bool testPunning() {
   bool result = true;
   // Get reference result for verifing test
-  alignas(uint32_t) uint16_t x_ref[] = {1, 2, 3, 0};
+  alignas(uint32_t) uint16_t x_ref[] = { 1, 2, 3, 0 };
   aliasTestReference(x_ref);  // -O0
   Serial.printf("mmu_get_uint16() strict-aliasing tests with different optimizations:\r\n");
 
   {
-    alignas(alignof(uint32_t)) uint16_t x[] = {1, 2, 3, 0};
+    alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
     aliasTestOs(x);
     Serial.printf("  Option -Os ");
     if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
@@ -185,7 +184,7 @@ bool testPunning() {
     }
   }
   {
-    alignas(alignof(uint32_t)) uint16_t x[] = {1, 2, 3, 0};
+    alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
     aliasTestO2(x);
     Serial.printf("  Option -O2 ");
     if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
@@ -197,7 +196,7 @@ bool testPunning() {
     }
   }
   {
-    alignas(alignof(uint32_t)) uint16_t x[] = {1, 2, 3, 0};
+    alignas(alignof(uint32_t)) uint16_t x[] = { 1, 2, 3, 0 };
     aliasTestO3(x);
     Serial.printf("  Option -O3 ");
     if (0 == memcmp(x_ref, x, sizeof(x_ref))) {
@@ -211,9 +210,8 @@ bool testPunning() {
   return result;
 }
 
-
-uint32_t cyclesToRead_nKx32(int n, unsigned int *x, uint32_t *res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead_nKx32(int n, unsigned int* x, uint32_t* res) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += *(x++);
@@ -222,8 +220,8 @@ uint32_t cyclesToRead_nKx32(int n, unsigned int *x, uint32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx32(int n, unsigned int *x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx32(int n, unsigned int* x) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += i;
@@ -232,8 +230,8 @@ uint32_t cyclesToWrite_nKx32(int n, unsigned int *x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx16(int n, unsigned short *x, uint32_t *res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead_nKx16(int n, unsigned short* x, uint32_t* res) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += *(x++);
@@ -242,8 +240,8 @@ uint32_t cyclesToRead_nKx16(int n, unsigned short *x, uint32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx16(int n, unsigned short *x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx16(int n, unsigned short* x) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += i;
@@ -252,9 +250,9 @@ uint32_t cyclesToWrite_nKx16(int n, unsigned short *x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKxs16(int n, short *x, int32_t *res) {
-  uint32_t b = ESP.getCycleCount();
-  int32_t sum = 0;
+uint32_t cyclesToRead_nKxs16(int n, short* x, int32_t* res) {
+  uint32_t b   = ESP.getCycleCount();
+  int32_t  sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += *(x++);
   }
@@ -262,9 +260,9 @@ uint32_t cyclesToRead_nKxs16(int n, short *x, int32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKxs16(int n, short *x) {
-  uint32_t b = ESP.getCycleCount();
-  int32_t sum = 0;
+uint32_t cyclesToWrite_nKxs16(int n, short* x) {
+  uint32_t b   = ESP.getCycleCount();
+  int32_t  sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += i;
     *(x++) = sum;
@@ -272,8 +270,8 @@ uint32_t cyclesToWrite_nKxs16(int n, short *x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx8(int n, unsigned char*x, uint32_t *res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead_nKx8(int n, unsigned char* x, uint32_t* res) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += *(x++);
@@ -282,8 +280,8 @@ uint32_t cyclesToRead_nKx8(int n, unsigned char*x, uint32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx8(int n, unsigned char*x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx8(int n, unsigned char* x) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += i;
@@ -293,18 +291,18 @@ uint32_t cyclesToWrite_nKx8(int n, unsigned char*x) {
 }
 
 // Compare with Inline
-uint32_t cyclesToRead_nKx16_viaInline(int n, unsigned short *x, uint32_t *res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead_nKx16_viaInline(int n, unsigned short* x, uint32_t* res) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
-    sum += mmu_get_uint16(x++); //*(x++);
+    sum += mmu_get_uint16(x++);  //*(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short *x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short* x) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += i;
@@ -314,19 +312,19 @@ uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short *x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKxs16_viaInline(int n, short *x, int32_t *res) {
-  uint32_t b = ESP.getCycleCount();
-  int32_t sum = 0;
+uint32_t cyclesToRead_nKxs16_viaInline(int n, short* x, int32_t* res) {
+  uint32_t b   = ESP.getCycleCount();
+  int32_t  sum = 0;
   for (int i = 0; i < n * 1024; i++) {
-    sum += mmu_get_int16(x++); //*(x++);
+    sum += mmu_get_int16(x++);  //*(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKxs16_viaInline(int n, short *x) {
-  uint32_t b = ESP.getCycleCount();
-  int32_t sum = 0;
+uint32_t cyclesToWrite_nKxs16_viaInline(int n, short* x) {
+  uint32_t b   = ESP.getCycleCount();
+  int32_t  sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += i;
     // *(x++) = sum;
@@ -335,18 +333,18 @@ uint32_t cyclesToWrite_nKxs16_viaInline(int n, short *x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead_nKx8_viaInline(int n, unsigned char*x, uint32_t *res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead_nKx8_viaInline(int n, unsigned char* x, uint32_t* res) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
-    sum += mmu_get_uint8(x++); //*(x++);
+    sum += mmu_get_uint8(x++);  //*(x++);
   }
   *res = sum;
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char*x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char* x) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < n * 1024; i++) {
     sum += i;
@@ -356,14 +354,14 @@ uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char*x) {
   return ESP.getCycleCount() - b;
 }
 
-
-bool perfTest_nK(int nK, uint32_t *mem, uint32_t *imem) {
+bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
   uint32_t res, verify_res;
   uint32_t t;
-  bool success = true;
-  int sres, verify_sres;
+  bool     success = true;
+  int      sres, verify_sres;
 
-  Serial.printf("\r\nPerformance numbers for 16 bit access - using inline macros or exception handling for IRAM.\r\n");;
+  Serial.printf("\r\nPerformance numbers for 16 bit access - using inline macros or exception handling for IRAM.\r\n");
+  ;
   t = cyclesToWrite_nKx16(nK, (uint16_t*)mem);
   Serial.printf("DRAM Memory Write:         %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx16(nK, (uint16_t*)mem, &verify_res);
@@ -416,7 +414,8 @@ bool perfTest_nK(int nK, uint32_t *mem, uint32_t *imem) {
     success = false;
   }
 
-  Serial.printf("\r\nPerformance numbers for 8 bit access - using inline macros or exception handling for IRAM access.\r\n");;
+  Serial.printf("\r\nPerformance numbers for 8 bit access - using inline macros or exception handling for IRAM access.\r\n");
+  ;
   t = cyclesToWrite_nKx8(nK, (uint8_t*)mem);
   Serial.printf("DRAM Memory Write:         %7d cycles for %dK by  uint8, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx8(nK, (uint8_t*)mem, &verify_res);
@@ -467,7 +466,7 @@ void setup() {
   // IRAM region.  It will continue to use the builtin DRAM until we request
   // otherwise.
   Serial.printf("DRAM free: %6d\r\n", ESP.getFreeHeap());
-  uint32_t *mem = (uint32_t *)malloc(2 * 1024 * sizeof(uint32_t));
+  uint32_t* mem = (uint32_t*)malloc(2 * 1024 * sizeof(uint32_t));
   Serial.printf("DRAM buffer: Address %p, free %d\r\n", mem, ESP.getFreeHeap());
   if (!mem) {
     return;
@@ -477,12 +476,12 @@ void setup() {
 #ifdef USE_SET_IRAM_HEAP
   ESP.setIramHeap();
   Serial.printf("IRAM free: %6d\r\n", ESP.getFreeHeap());
-  uint32_t *imem = (uint32_t *)malloc(2 * 1024 * sizeof(uint32_t));
+  uint32_t* imem = (uint32_t*)malloc(2 * 1024 * sizeof(uint32_t));
   Serial.printf("IRAM buffer: Address %p, free %d\r\n", imem, ESP.getFreeHeap());
   // Make sure we go back to the DRAM heap for other allocations.  Don't forget to ESP.resetHeap()!
   ESP.resetHeap();
 #else
-  uint32_t *imem;
+  uint32_t* imem;
   {
     HeapSelectIram ephemeral;
     // This class effectively does this
@@ -491,7 +490,7 @@ void setup() {
     //  ...
     // umm_set_heap_by_id(_heap_id);
     Serial.printf("IRAM free: %6d\r\n", ESP.getFreeHeap());
-    imem = (uint32_t *)malloc(2 * 1024 * sizeof(uint32_t));
+    imem = (uint32_t*)malloc(2 * 1024 * sizeof(uint32_t));
     Serial.printf("IRAM buffer: Address %p, free %d\r\n", imem, ESP.getFreeHeap());
   }
 #endif
@@ -501,8 +500,9 @@ void setup() {
 
   uint32_t res;
   uint32_t t;
-  int nK = 1;
-  Serial.printf("\r\nPerformance numbers for 32 bit access - no exception handler or inline macros needed.\r\n");;
+  int      nK = 1;
+  Serial.printf("\r\nPerformance numbers for 32 bit access - no exception handler or inline macros needed.\r\n");
+  ;
   t = cyclesToWrite_nKx32(nK, mem);
   Serial.printf("DRAM Memory Write:         %7d cycles for %dK by uint32, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
   t = cyclesToRead_nKx32(nK, mem, &res);
@@ -514,7 +514,6 @@ void setup() {
   Serial.printf("IRAM Memory Read:          %7d cycles for %dK by uint32, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), res);
   Serial.println();
 
-
   if (perfTest_nK(1, mem, imem) && testPunning() && test4_32bit_loads()) {
     Serial.println();
   } else {
@@ -549,7 +548,7 @@ void setup() {
   {
     // Let's use IRAM heap to make a big ole' String
     HeapSelectIram ephemeral;
-    String s = "";
+    String         s = "";
     for (int i = 0; i < 100; i++) {
       s += i;
       s += ' ';
@@ -573,7 +572,7 @@ void setup() {
   free(imem);
   free(mem);
   imem = NULL;
-  mem = NULL;
+  mem  = NULL;
 
   Serial.printf("DRAM free: %6d\r\n", ESP.getFreeHeap());
 #ifdef USE_SET_IRAM_HEAP
@@ -589,16 +588,16 @@ void setup() {
   {
     ETS_PRINTF("Try and allocate all of the heap in one chunk\n");
     HeapSelectIram ephemeral;
-    size_t free_iram = ESP.getFreeHeap();
+    size_t         free_iram = ESP.getFreeHeap();
     ETS_PRINTF("IRAM free: %6d\n", free_iram);
     uint32_t hfree;
     uint32_t hmax;
-    uint8_t hfrag;
+    uint8_t  hfrag;
     ESP.getHeapStats(&hfree, &hmax, &hfrag);
     ETS_PRINTF("ESP.getHeapStats(free: %u, max: %u, frag: %u)\n",
                hfree, hmax, hfrag);
     if (free_iram > UMM_OVERHEAD_ADJUST) {
-      void *all = malloc(free_iram - UMM_OVERHEAD_ADJUST);
+      void* all = malloc(free_iram - UMM_OVERHEAD_ADJUST);
       ETS_PRINTF("%p = malloc(%u)\n", all, free_iram);
       umm_info(NULL, true);
 
@@ -614,26 +613,26 @@ void setup() {
 void processKey(Print& out, int hotKey) {
   switch (hotKey) {
     case 'd': {
-        HeapSelectDram ephemeral;
-        umm_info(NULL, true);
-        break;
-      }
+      HeapSelectDram ephemeral;
+      umm_info(NULL, true);
+      break;
+    }
     case 'i': {
+      HeapSelectIram ephemeral;
+      umm_info(NULL, true);
+      break;
+    }
+    case 'h': {
+      {
         HeapSelectIram ephemeral;
-        umm_info(NULL, true);
-        break;
+        Serial.printf(PSTR("IRAM ESP.getFreeHeap:  %u\n"), ESP.getFreeHeap());
       }
-    case 'h': {
-        {
-          HeapSelectIram ephemeral;
-          Serial.printf(PSTR("IRAM ESP.getFreeHeap:  %u\n"), ESP.getFreeHeap());
-        }
-        {
-          HeapSelectDram ephemeral;
-          Serial.printf(PSTR("DRAM ESP.getFreeHeap:  %u\r\n"), ESP.getFreeHeap());
-        }
-        break;
+      {
+        HeapSelectDram ephemeral;
+        Serial.printf(PSTR("DRAM ESP.getFreeHeap:  %u\r\n"), ESP.getFreeHeap());
       }
+      break;
+    }
     case 'R':
       out.printf_P(PSTR("Restart, ESP.restart(); ...\r\n"));
       ESP.restart();
@@ -660,7 +659,6 @@ void processKey(Print& out, int hotKey) {
   }
 }
 
-
 void loop(void) {
   if (Serial.available() > 0) {
     int hotKey = Serial.read();
diff --git a/libraries/esp8266/examples/virtualmem/virtualmem.ino b/libraries/esp8266/examples/virtualmem/virtualmem.ino
index 47b9396cc7..c5374d245c 100644
--- a/libraries/esp8266/examples/virtualmem/virtualmem.ino
+++ b/libraries/esp8266/examples/virtualmem/virtualmem.ino
@@ -1,6 +1,6 @@
 
-uint32_t cyclesToRead1Kx32(unsigned int *x, uint32_t *res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead1Kx32(unsigned int* x, uint32_t* res) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
     sum += *(x++);
@@ -9,8 +9,8 @@ uint32_t cyclesToRead1Kx32(unsigned int *x, uint32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx32(unsigned int *x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite1Kx32(unsigned int* x) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
     sum += i;
@@ -19,9 +19,8 @@ uint32_t cyclesToWrite1Kx32(unsigned int *x) {
   return ESP.getCycleCount() - b;
 }
 
-
-uint32_t cyclesToRead1Kx16(unsigned short *x, uint32_t *res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead1Kx16(unsigned short* x, uint32_t* res) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
     sum += *(x++);
@@ -30,8 +29,8 @@ uint32_t cyclesToRead1Kx16(unsigned short *x, uint32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx16(unsigned short *x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite1Kx16(unsigned short* x) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
     sum += i;
@@ -40,8 +39,8 @@ uint32_t cyclesToWrite1Kx16(unsigned short *x) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToRead1Kx8(unsigned char*x, uint32_t *res) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToRead1Kx8(unsigned char* x, uint32_t* res) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
     sum += *(x++);
@@ -50,8 +49,8 @@ uint32_t cyclesToRead1Kx8(unsigned char*x, uint32_t *res) {
   return ESP.getCycleCount() - b;
 }
 
-uint32_t cyclesToWrite1Kx8(unsigned char*x) {
-  uint32_t b = ESP.getCycleCount();
+uint32_t cyclesToWrite1Kx8(unsigned char* x) {
+  uint32_t b   = ESP.getCycleCount();
   uint32_t sum = 0;
   for (int i = 0; i < 1024; i++) {
     sum += i;
@@ -66,12 +65,12 @@ void setup() {
 
   // Enabling VM does not change malloc to use the external region.  It will continue to
   // use the normal RAM until we request otherwise.
-  uint32_t *mem = (uint32_t *)malloc(1024 * sizeof(uint32_t));
+  uint32_t* mem = (uint32_t*)malloc(1024 * sizeof(uint32_t));
   Serial.printf("Internal buffer: Address %p, free %d\n", mem, ESP.getFreeHeap());
 
   // Now request from the VM heap
   ESP.setExternalHeap();
-  uint32_t *vm = (uint32_t *)malloc(1024 * sizeof(uint32_t));
+  uint32_t* vm = (uint32_t*)malloc(1024 * sizeof(uint32_t));
   Serial.printf("External buffer: Address %p, free %d\n", vm, ESP.getFreeHeap());
   // Make sure we go back to the internal heap for other allocations.  Don't forget to ESP.resetHeap()!
   ESP.resetHeap();
@@ -134,5 +133,4 @@ void setup() {
 }
 
 void loop() {
-
 }
diff --git a/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino b/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
index ed2943c278..fc265a2136 100644
--- a/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
+++ b/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
@@ -25,7 +25,7 @@
 
 #ifndef STASSID
 #define STASSID "your-ssid"
-#define STAPSK  "your-password"
+#define STAPSK "your-password"
 #endif
 
 #define LOGGERBAUD 115200
@@ -34,12 +34,12 @@
 #define NAPT 200
 #define NAPT_PORT 3
 
-#define RX 13 // d1mini D7
-#define TX 15 // d1mini D8
+#define RX 13  // d1mini D7
+#define TX 15  // d1mini D8
 
-SoftwareSerial ppplink(RX, TX);
+SoftwareSerial  ppplink(RX, TX);
 HardwareSerial& logger = Serial;
-PPPServer ppp(&ppplink);
+PPPServer       ppp(&ppplink);
 
 void PPPConnectedCallback(netif* nif) {
   logger.printf("ppp: ip=%s/mask=%s/gw=%s\n",
@@ -97,7 +97,6 @@ void setup() {
   logger.printf("ppp: %d\n", ret);
 }
 
-
 #else
 
 void setup() {
diff --git a/libraries/lwIP_PPP/src/PPPServer.cpp b/libraries/lwIP_PPP/src/PPPServer.cpp
index 98fddd7777..31c406b830 100644
--- a/libraries/lwIP_PPP/src/PPPServer.cpp
+++ b/libraries/lwIP_PPP/src/PPPServer.cpp
@@ -16,7 +16,8 @@
 
 #include "PPPServer.h"
 
-PPPServer::PPPServer(Stream* sio): _sio(sio), _cb(netif_status_cb_s), _enabled(false)
+PPPServer::PPPServer(Stream* sio) :
+    _sio(sio), _cb(netif_status_cb_s), _enabled(false)
 {
 }
 
@@ -38,15 +39,15 @@ bool PPPServer::handlePackets()
 
 void PPPServer::link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx)
 {
-    bool stop = true;
-    netif* nif = ppp_netif(pcb);
+    bool   stop = true;
+    netif* nif  = ppp_netif(pcb);
 
     switch (err_code)
     {
-    case PPPERR_NONE:               /* No error. */
+    case PPPERR_NONE: /* No error. */
     {
 #if LWIP_DNS
-        const ip_addr_t *ns;
+        const ip_addr_t* ns;
 #endif /* LWIP_DNS */
         ets_printf("ppp_link_status_cb: PPPERR_NONE\n\r");
 #if LWIP_IPV4
@@ -68,54 +69,54 @@ void PPPServer::link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx)
         ets_printf("   our6_ipaddr = %s\n\r", ip6addr_ntoa(netif_ip6_addr(nif, 0)));
 #endif /* PPP_IPV6_SUPPORT */
     }
-    stop = false;
-    break;
+        stop = false;
+        break;
 
-    case PPPERR_PARAM:             /* Invalid parameter. */
+    case PPPERR_PARAM: /* Invalid parameter. */
         ets_printf("ppp_link_status_cb: PPPERR_PARAM\n");
         break;
 
-    case PPPERR_OPEN:              /* Unable to open PPP session. */
+    case PPPERR_OPEN: /* Unable to open PPP session. */
         ets_printf("ppp_link_status_cb: PPPERR_OPEN\n");
         break;
 
-    case PPPERR_DEVICE:            /* Invalid I/O device for PPP. */
+    case PPPERR_DEVICE: /* Invalid I/O device for PPP. */
         ets_printf("ppp_link_status_cb: PPPERR_DEVICE\n");
         break;
 
-    case PPPERR_ALLOC:             /* Unable to allocate resources. */
+    case PPPERR_ALLOC: /* Unable to allocate resources. */
         ets_printf("ppp_link_status_cb: PPPERR_ALLOC\n");
         break;
 
-    case PPPERR_USER:              /* User interrupt. */
+    case PPPERR_USER: /* User interrupt. */
         ets_printf("ppp_link_status_cb: PPPERR_USER\n");
         break;
 
-    case PPPERR_CONNECT:           /* Connection lost. */
+    case PPPERR_CONNECT: /* Connection lost. */
         ets_printf("ppp_link_status_cb: PPPERR_CONNECT\n");
         break;
 
-    case PPPERR_AUTHFAIL:          /* Failed authentication challenge. */
+    case PPPERR_AUTHFAIL: /* Failed authentication challenge. */
         ets_printf("ppp_link_status_cb: PPPERR_AUTHFAIL\n");
         break;
 
-    case PPPERR_PROTOCOL:          /* Failed to meet protocol. */
+    case PPPERR_PROTOCOL: /* Failed to meet protocol. */
         ets_printf("ppp_link_status_cb: PPPERR_PROTOCOL\n");
         break;
 
-    case PPPERR_PEERDEAD:          /* Connection timeout. */
+    case PPPERR_PEERDEAD: /* Connection timeout. */
         ets_printf("ppp_link_status_cb: PPPERR_PEERDEAD\n");
         break;
 
-    case PPPERR_IDLETIMEOUT:       /* Idle Timeout. */
+    case PPPERR_IDLETIMEOUT: /* Idle Timeout. */
         ets_printf("ppp_link_status_cb: PPPERR_IDLETIMEOUT\n");
         break;
 
-    case PPPERR_CONNECTTIME:       /* PPPERR_CONNECTTIME. */
+    case PPPERR_CONNECTTIME: /* PPPERR_CONNECTTIME. */
         ets_printf("ppp_link_status_cb: PPPERR_CONNECTTIME\n");
         break;
 
-    case PPPERR_LOOPBACK:          /* Connection timeout. */
+    case PPPERR_LOOPBACK: /* Connection timeout. */
         ets_printf("ppp_link_status_cb: PPPERR_LOOPBACK\n");
         break;
 
@@ -178,9 +179,8 @@ bool PPPServer::begin(const IPAddress& ourAddress, const IPAddress& peer)
 
     _enabled = true;
     if (!schedule_recurrent_function_us([&]()
-{
-    return this->handlePackets();
-    }, 1000))
+                                        { return this->handlePackets(); },
+                                        1000))
     {
         netif_remove(&_netif);
         return false;
diff --git a/libraries/lwIP_PPP/src/PPPServer.h b/libraries/lwIP_PPP/src/PPPServer.h
index e2c95658a6..260ebfe2d8 100644
--- a/libraries/lwIP_PPP/src/PPPServer.h
+++ b/libraries/lwIP_PPP/src/PPPServer.h
@@ -27,7 +27,6 @@
 
 */
 
-
 #ifndef __PPPSERVER_H
 #define __PPPSERVER_H
 
@@ -40,7 +39,6 @@
 class PPPServer
 {
 public:
-
     PPPServer(Stream* sio);
 
     bool begin(const IPAddress& ourAddress, const IPAddress& peer = IPAddress(172, 31, 255, 254));
@@ -56,22 +54,20 @@ class PPPServer
     }
 
 protected:
-
     static constexpr size_t _bufsize = 128;
-    Stream* _sio;
-    ppp_pcb* _ppp;
-    netif _netif;
+    Stream*                 _sio;
+    ppp_pcb*                _ppp;
+    netif                   _netif;
     void (*_cb)(netif*);
     uint8_t _buf[_bufsize];
-    bool _enabled;
+    bool    _enabled;
 
     // feed ppp from stream - to call on a regular basis or on interrupt
     bool handlePackets();
 
     static u32_t output_cb_s(ppp_pcb* pcb, u8_t* data, u32_t len, void* ctx);
-    static void link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx);
-    static void netif_status_cb_s(netif* nif);
-
+    static void  link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx);
+    static void  netif_status_cb_s(netif* nif);
 };
 
-#endif // __PPPSERVER_H
+#endif  // __PPPSERVER_H
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
index 42d1af7fc2..224fe742b8 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
@@ -42,10 +42,9 @@
 
 #include "enc28j60.h"
 
-
-void serial_printf(const char *fmt, ...)
+void serial_printf(const char* fmt, ...)
 {
-    char buf[128];
+    char    buf[128];
     va_list args;
     va_start(args, fmt);
     vsnprintf(buf, 128, fmt, args);
@@ -57,11 +56,15 @@ void serial_printf(const char *fmt, ...)
 #if DEBUG
 #define PRINTF(...) printf(__VA_ARGS__)
 #else
-#define PRINTF(...) do { (void)0; } while (0)
+#define PRINTF(...) \
+    do              \
+    {               \
+        (void)0;    \
+    } while (0)
 #endif
 
-#define EIE   0x1b
-#define EIR   0x1c
+#define EIE 0x1b
+#define EIR 0x1c
 #define ESTAT 0x1d
 #define ECON2 0x1e
 #define ECON1 0x1f
@@ -69,13 +72,13 @@ void serial_printf(const char *fmt, ...)
 #define ESTAT_CLKRDY 0x01
 #define ESTAT_TXABRT 0x02
 
-#define ECON1_RXEN   0x04
-#define ECON1_TXRTS  0x08
+#define ECON1_RXEN 0x04
+#define ECON1_TXRTS 0x08
 
 #define ECON2_AUTOINC 0x80
-#define ECON2_PKTDEC  0x40
+#define ECON2_PKTDEC 0x40
 
-#define EIR_TXIF      0x08
+#define EIR_TXIF 0x08
 
 #define ERXTX_BANK 0x00
 
@@ -95,19 +98,19 @@ void serial_printf(const char *fmt, ...)
 #define ERXRDPTH 0x0d
 
 #define RX_BUF_START 0x0000
-#define RX_BUF_END   0x0fff
+#define RX_BUF_END 0x0fff
 
 #define TX_BUF_START 0x1200
 
 /* MACONx registers are in bank 2 */
 #define MACONX_BANK 0x02
 
-#define MACON1  0x00
-#define MACON3  0x02
-#define MACON4  0x03
+#define MACON1 0x00
+#define MACON3 0x02
+#define MACON4 0x03
 #define MABBIPG 0x04
-#define MAIPGL  0x06
-#define MAIPGH  0x07
+#define MAIPGL 0x06
+#define MAIPGH 0x07
 #define MAMXFLL 0x0a
 #define MAMXFLH 0x0b
 
@@ -116,9 +119,9 @@ void serial_printf(const char *fmt, ...)
 #define MACON1_MARXEN 0x01
 
 #define MACON3_PADCFG_FULL 0xe0
-#define MACON3_TXCRCEN     0x10
-#define MACON3_FRMLNEN     0x02
-#define MACON3_FULDPX      0x01
+#define MACON3_TXCRCEN 0x10
+#define MACON3_FRMLNEN 0x02
+#define MACON3_FULDPX 0x01
 
 #define MAX_MAC_LENGTH 1518
 
@@ -136,36 +139,33 @@ void serial_printf(const char *fmt, ...)
 #define ERXFCON 0x18
 #define EPKTCNT 0x19
 
-#define ERXFCON_UCEN  0x80
+#define ERXFCON_UCEN 0x80
 #define ERXFCON_ANDOR 0x40
 #define ERXFCON_CRCEN 0x20
-#define ERXFCON_MCEN  0x02
-#define ERXFCON_BCEN  0x01
+#define ERXFCON_MCEN 0x02
+#define ERXFCON_BCEN 0x01
 
 // The ENC28J60 SPI Interface supports clock speeds up to 20 MHz
 static const SPISettings spiSettings(20000000, MSBFIRST, SPI_MODE0);
 
-ENC28J60::ENC28J60(int8_t cs, SPIClass& spi, int8_t intr):
+ENC28J60::ENC28J60(int8_t cs, SPIClass& spi, int8_t intr) :
     _bank(ERXTX_BANK), _cs(cs), _spi(spi)
 {
     (void)intr;
 }
 
-void
-ENC28J60::enc28j60_arch_spi_select(void)
+void ENC28J60::enc28j60_arch_spi_select(void)
 {
     SPI.beginTransaction(spiSettings);
     digitalWrite(_cs, LOW);
 }
 
-void
-ENC28J60::enc28j60_arch_spi_deselect(void)
+void ENC28J60::enc28j60_arch_spi_deselect(void)
 {
     digitalWrite(_cs, HIGH);
     SPI.endTransaction();
 }
 
-
 /*---------------------------------------------------------------------------*/
 uint8_t
 ENC28J60::is_mac_mii_reg(uint8_t reg)
@@ -200,8 +200,7 @@ ENC28J60::readreg(uint8_t reg)
     return r;
 }
 /*---------------------------------------------------------------------------*/
-void
-ENC28J60::writereg(uint8_t reg, uint8_t data)
+void ENC28J60::writereg(uint8_t reg, uint8_t data)
 {
     enc28j60_arch_spi_select();
     SPI.transfer(0x40 | (reg & 0x1f));
@@ -209,8 +208,7 @@ ENC28J60::writereg(uint8_t reg, uint8_t data)
     enc28j60_arch_spi_deselect();
 }
 /*---------------------------------------------------------------------------*/
-void
-ENC28J60::setregbitfield(uint8_t reg, uint8_t mask)
+void ENC28J60::setregbitfield(uint8_t reg, uint8_t mask)
 {
     if (is_mac_mii_reg(reg))
     {
@@ -225,8 +223,7 @@ ENC28J60::setregbitfield(uint8_t reg, uint8_t mask)
     }
 }
 /*---------------------------------------------------------------------------*/
-void
-ENC28J60::clearregbitfield(uint8_t reg, uint8_t mask)
+void ENC28J60::clearregbitfield(uint8_t reg, uint8_t mask)
 {
     if (is_mac_mii_reg(reg))
     {
@@ -241,15 +238,13 @@ ENC28J60::clearregbitfield(uint8_t reg, uint8_t mask)
     }
 }
 /*---------------------------------------------------------------------------*/
-void
-ENC28J60::setregbank(uint8_t new_bank)
+void ENC28J60::setregbank(uint8_t new_bank)
 {
     writereg(ECON1, (readreg(ECON1) & 0xfc) | (new_bank & 0x03));
     _bank = new_bank;
 }
 /*---------------------------------------------------------------------------*/
-void
-ENC28J60::writedata(const uint8_t *data, int datalen)
+void ENC28J60::writedata(const uint8_t* data, int datalen)
 {
     int i;
     enc28j60_arch_spi_select();
@@ -262,14 +257,12 @@ ENC28J60::writedata(const uint8_t *data, int datalen)
     enc28j60_arch_spi_deselect();
 }
 /*---------------------------------------------------------------------------*/
-void
-ENC28J60::writedatabyte(uint8_t byte)
+void ENC28J60::writedatabyte(uint8_t byte)
 {
     writedata(&byte, 1);
 }
 /*---------------------------------------------------------------------------*/
-int
-ENC28J60::readdata(uint8_t *buf, int len)
+int ENC28J60::readdata(uint8_t* buf, int len)
 {
     int i;
     enc28j60_arch_spi_select();
@@ -292,8 +285,7 @@ ENC28J60::readdatabyte(void)
 }
 
 /*---------------------------------------------------------------------------*/
-void
-ENC28J60::softreset(void)
+void ENC28J60::softreset(void)
 {
     enc28j60_arch_spi_select();
     /* The System Command (soft reset) is 1 1 1 1 1 1 1 1 */
@@ -324,8 +316,7 @@ ENC28J60::readrev(void)
 
 /*---------------------------------------------------------------------------*/
 
-bool
-ENC28J60::reset(void)
+bool ENC28J60::reset(void)
 {
     PRINTF("enc28j60: resetting chip\n");
 
@@ -398,7 +389,7 @@ ENC28J60::reset(void)
 
     /* Wait for OST */
     PRINTF("waiting for ESTAT_CLKRDY\n");
-    while ((readreg(ESTAT) & ESTAT_CLKRDY) == 0) {};
+    while ((readreg(ESTAT) & ESTAT_CLKRDY) == 0) { };
     PRINTF("ESTAT_CLKRDY\n");
 
     setregbank(ERXTX_BANK);
@@ -470,8 +461,7 @@ ENC28J60::reset(void)
     setregbitfield(MACON1, MACON1_MARXEN | MACON1_TXPAUS | MACON1_RXPAUS);
 
     /* Set padding, crc, full duplex */
-    setregbitfield(MACON3, MACON3_PADCFG_FULL | MACON3_TXCRCEN | MACON3_FULDPX |
-                   MACON3_FRMLNEN);
+    setregbitfield(MACON3, MACON3_PADCFG_FULL | MACON3_TXCRCEN | MACON3_FULDPX | MACON3_FRMLNEN);
 
     /* Don't modify MACON4 */
 
@@ -532,11 +522,11 @@ ENC28J60::reset(void)
 }
 /*---------------------------------------------------------------------------*/
 boolean
-ENC28J60::begin(const uint8_t *address)
+ENC28J60::begin(const uint8_t* address)
 {
     _localMac = address;
 
-    bool ret = reset();
+    bool    ret = reset();
     uint8_t rev = readrev();
 
     PRINTF("ENC28J60 rev. B%d\n", rev);
@@ -547,7 +537,7 @@ ENC28J60::begin(const uint8_t *address)
 /*---------------------------------------------------------------------------*/
 
 uint16_t
-ENC28J60::sendFrame(const uint8_t *data, uint16_t datalen)
+ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen)
 {
     uint16_t dataend;
 
@@ -598,13 +588,14 @@ ENC28J60::sendFrame(const uint8_t *data, uint16_t datalen)
 
     /* Send the packet */
     setregbitfield(ECON1, ECON1_TXRTS);
-    while ((readreg(ECON1) & ECON1_TXRTS) > 0);
+    while ((readreg(ECON1) & ECON1_TXRTS) > 0)
+        ;
 
 #if DEBUG
     if ((readreg(ESTAT) & ESTAT_TXABRT) != 0)
     {
         uint16_t erdpt;
-        uint8_t tsv[7];
+        uint8_t  tsv[7];
         erdpt = (readreg(ERDPTH) << 8) | readreg(ERDPTL);
         writereg(ERDPTL, (dataend + 1) & 0xff);
         writereg(ERDPTH, (dataend + 1) >> 8);
@@ -612,7 +603,8 @@ ENC28J60::sendFrame(const uint8_t *data, uint16_t datalen)
         writereg(ERDPTL, erdpt & 0xff);
         writereg(ERDPTH, erdpt >> 8);
         PRINTF("enc28j60: tx err: %d: %02x:%02x:%02x:%02x:%02x:%02x\n"
-               "                  tsv: %02x%02x%02x%02x%02x%02x%02x\n", datalen,
+               "                  tsv: %02x%02x%02x%02x%02x%02x%02x\n",
+               datalen,
                0xff & data[0], 0xff & data[1], 0xff & data[2],
                0xff & data[3], 0xff & data[4], 0xff & data[5],
                tsv[6], tsv[5], tsv[4], tsv[3], tsv[2], tsv[1], tsv[0]);
@@ -633,7 +625,7 @@ ENC28J60::sendFrame(const uint8_t *data, uint16_t datalen)
 /*---------------------------------------------------------------------------*/
 
 uint16_t
-ENC28J60::readFrame(uint8_t *buffer, uint16_t bufsize)
+ENC28J60::readFrame(uint8_t* buffer, uint16_t bufsize)
 {
     readFrameSize();
     return readFrameData(buffer, bufsize);
@@ -662,13 +654,13 @@ ENC28J60::readFrameSize()
     /* Read the next packet pointer */
     nxtpkt[0] = readdatabyte();
     nxtpkt[1] = readdatabyte();
-    _next = (nxtpkt[1] << 8) + nxtpkt[0];
+    _next     = (nxtpkt[1] << 8) + nxtpkt[0];
 
     PRINTF("enc28j60: nxtpkt 0x%02x%02x\n", _nxtpkt[1], _nxtpkt[0]);
 
     length[0] = readdatabyte();
     length[1] = readdatabyte();
-    _len = (length[1] << 8) + length[0];
+    _len      = (length[1] << 8) + length[0];
 
     PRINTF("enc28j60: length 0x%02x%02x\n", length[1], length[0]);
 
@@ -682,19 +674,17 @@ ENC28J60::readFrameSize()
     return _len;
 }
 
-void
-ENC28J60::discardFrame(uint16_t framesize)
+void ENC28J60::discardFrame(uint16_t framesize)
 {
     (void)framesize;
     (void)readFrameData(nullptr, 0);
 }
 
 uint16_t
-ENC28J60::readFrameData(uint8_t *buffer, uint16_t framesize)
+ENC28J60::readFrameData(uint8_t* buffer, uint16_t framesize)
 {
     if (framesize < _len)
     {
-
         buffer = nullptr;
 
         /* flush rx fifo */
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.h b/libraries/lwIP_enc28j60/src/utility/enc28j60.h
index 07ec39e929..07f71f96ff 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.h
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.h
@@ -46,7 +46,6 @@
 */
 class ENC28J60
 {
-
 public:
     /**
         Constructor that uses the default hardware SPI pins
@@ -61,7 +60,7 @@ class ENC28J60
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean begin(const uint8_t *address);
+    boolean begin(const uint8_t* address);
 
     /**
         Send an Ethernet frame
@@ -69,7 +68,7 @@ class ENC28J60
         @param datalen the length of the data in the packet
         @return the number of bytes transmitted
     */
-    virtual uint16_t sendFrame(const uint8_t *data, uint16_t datalen);
+    virtual uint16_t sendFrame(const uint8_t* data, uint16_t datalen);
 
     /**
         Read an Ethernet frame
@@ -78,10 +77,9 @@ class ENC28J60
         @return the length of the received packet
                or 0 if no packet was received
     */
-    virtual uint16_t readFrame(uint8_t *buffer, uint16_t bufsize);
+    virtual uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
 
 protected:
-
     static constexpr bool interruptIsPossible()
     {
         return false;
@@ -109,38 +107,37 @@ class ENC28J60
         @return the length of the received frame
                or 0 if a problem occurred
     */
-    uint16_t readFrameData(uint8_t *frame, uint16_t framesize);
+    uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
 
 private:
-
     uint8_t is_mac_mii_reg(uint8_t reg);
     uint8_t readreg(uint8_t reg);
-    void writereg(uint8_t reg, uint8_t data);
-    void setregbitfield(uint8_t reg, uint8_t mask);
-    void clearregbitfield(uint8_t reg, uint8_t mask);
-    void setregbank(uint8_t new_bank);
-    void writedata(const uint8_t *data, int datalen);
-    void writedatabyte(uint8_t byte);
-    int readdata(uint8_t *buf, int len);
+    void    writereg(uint8_t reg, uint8_t data);
+    void    setregbitfield(uint8_t reg, uint8_t mask);
+    void    clearregbitfield(uint8_t reg, uint8_t mask);
+    void    setregbank(uint8_t new_bank);
+    void    writedata(const uint8_t* data, int datalen);
+    void    writedatabyte(uint8_t byte);
+    int     readdata(uint8_t* buf, int len);
     uint8_t readdatabyte(void);
-    void softreset(void);
+    void    softreset(void);
     uint8_t readrev(void);
-    bool reset(void);
+    bool    reset(void);
 
-    void enc28j60_arch_spi_init(void);
+    void    enc28j60_arch_spi_init(void);
     uint8_t enc28j60_arch_spi_write(uint8_t data);
     uint8_t enc28j60_arch_spi_read(void);
-    void enc28j60_arch_spi_select(void);
-    void enc28j60_arch_spi_deselect(void);
+    void    enc28j60_arch_spi_select(void);
+    void    enc28j60_arch_spi_deselect(void);
 
     // Previously defined in contiki/core/sys/clock.h
     void clock_delay_usec(uint16_t dt);
 
-    uint8_t _bank;
-    int8_t _cs;
+    uint8_t   _bank;
+    int8_t    _cs;
     SPIClass& _spi;
 
-    const uint8_t *_localMac;
+    const uint8_t* _localMac;
 
     /* readFrame*() state */
     uint16_t _next, _len;
diff --git a/libraries/lwIP_w5100/src/utility/w5100.cpp b/libraries/lwIP_w5100/src/utility/w5100.cpp
index 6377aa5b63..70e3197afb 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.cpp
+++ b/libraries/lwIP_w5100/src/utility/w5100.cpp
@@ -35,15 +35,14 @@
 #include <SPI.h>
 #include "w5100.h"
 
-
 uint8_t Wiznet5100::wizchip_read(uint16_t address)
 {
     uint8_t ret;
 
     wizchip_cs_select();
     _spi.transfer(0x0F);
-    _spi.transfer((address & 0xFF00) >>  8);
-    _spi.transfer((address & 0x00FF) >>  0);
+    _spi.transfer((address & 0xFF00) >> 8);
+    _spi.transfer((address & 0x00FF) >> 0);
     ret = _spi.transfer(0);
     wizchip_cs_deselect();
 
@@ -55,7 +54,6 @@ uint16_t Wiznet5100::wizchip_read_word(uint16_t address)
     return ((uint16_t)wizchip_read(address) << 8) + wizchip_read(address + 1);
 }
 
-
 void Wiznet5100::wizchip_read_buf(uint16_t address, uint8_t* pBuf, uint16_t len)
 {
     for (uint16_t i = 0; i < len; i++)
@@ -68,16 +66,16 @@ void Wiznet5100::wizchip_write(uint16_t address, uint8_t wb)
 {
     wizchip_cs_select();
     _spi.transfer(0xF0);
-    _spi.transfer((address & 0xFF00) >>  8);
-    _spi.transfer((address & 0x00FF) >>  0);
-    _spi.transfer(wb);    // Data write (write 1byte data)
+    _spi.transfer((address & 0xFF00) >> 8);
+    _spi.transfer((address & 0x00FF) >> 0);
+    _spi.transfer(wb);  // Data write (write 1byte data)
     wizchip_cs_deselect();
 }
 
 void Wiznet5100::wizchip_write_word(uint16_t address, uint16_t word)
 {
     wizchip_write(address, (uint8_t)(word >> 8));
-    wizchip_write(address + 1, (uint8_t) word);
+    wizchip_write(address + 1, (uint8_t)word);
 }
 
 void Wiznet5100::wizchip_write_buf(uint16_t address, const uint8_t* pBuf, uint16_t len)
@@ -94,7 +92,8 @@ void Wiznet5100::setSn_CR(uint8_t cr)
     wizchip_write(Sn_CR, cr);
 
     // Now wait for the command to complete
-    while (wizchip_read(Sn_CR));
+    while (wizchip_read(Sn_CR))
+        ;
 }
 
 uint16_t Wiznet5100::getSn_TX_FSR()
@@ -111,7 +110,6 @@ uint16_t Wiznet5100::getSn_TX_FSR()
     return val;
 }
 
-
 uint16_t Wiznet5100::getSn_RX_RSR()
 {
     uint16_t val = 0, val1 = 0;
@@ -126,7 +124,7 @@ uint16_t Wiznet5100::getSn_RX_RSR()
     return val;
 }
 
-void Wiznet5100::wizchip_send_data(const uint8_t *wizdata, uint16_t len)
+void Wiznet5100::wizchip_send_data(const uint8_t* wizdata, uint16_t len)
 {
     uint16_t ptr;
     uint16_t size;
@@ -136,14 +134,14 @@ void Wiznet5100::wizchip_send_data(const uint8_t *wizdata, uint16_t len)
     ptr = getSn_TX_WR();
 
     dst_mask = ptr & TxBufferMask;
-    dst_ptr = TxBufferAddress + dst_mask;
+    dst_ptr  = TxBufferAddress + dst_mask;
 
     if (dst_mask + len > TxBufferLength)
     {
         size = TxBufferLength - dst_mask;
         wizchip_write_buf(dst_ptr, wizdata, size);
         wizdata += size;
-        size = len - size;
+        size    = len - size;
         dst_ptr = TxBufferAddress;
         wizchip_write_buf(dst_ptr, wizdata, size);
     }
@@ -157,7 +155,7 @@ void Wiznet5100::wizchip_send_data(const uint8_t *wizdata, uint16_t len)
     setSn_TX_WR(ptr);
 }
 
-void Wiznet5100::wizchip_recv_data(uint8_t *wizdata, uint16_t len)
+void Wiznet5100::wizchip_recv_data(uint8_t* wizdata, uint16_t len)
 {
     uint16_t ptr;
     uint16_t size;
@@ -167,15 +165,14 @@ void Wiznet5100::wizchip_recv_data(uint8_t *wizdata, uint16_t len)
     ptr = getSn_RX_RD();
 
     src_mask = ptr & RxBufferMask;
-    src_ptr = RxBufferAddress + src_mask;
-
+    src_ptr  = RxBufferAddress + src_mask;
 
     if ((src_mask + len) > RxBufferLength)
     {
         size = RxBufferLength - src_mask;
         wizchip_read_buf(src_ptr, wizdata, size);
         wizdata += size;
-        size = len - size;
+        size    = len - size;
         src_ptr = RxBufferAddress;
         wizchip_read_buf(src_ptr, wizdata, size);
     }
@@ -201,19 +198,18 @@ void Wiznet5100::wizchip_recv_ignore(uint16_t len)
 void Wiznet5100::wizchip_sw_reset()
 {
     setMR(MR_RST);
-    getMR(); // for delay
+    getMR();  // for delay
 
     setSHAR(_mac_address);
 }
 
-
-Wiznet5100::Wiznet5100(int8_t cs, SPIClass& spi, int8_t intr):
+Wiznet5100::Wiznet5100(int8_t cs, SPIClass& spi, int8_t intr) :
     _spi(spi), _cs(cs)
 {
     (void)intr;
 }
 
-boolean Wiznet5100::begin(const uint8_t *mac_address)
+boolean Wiznet5100::begin(const uint8_t* mac_address)
 {
     memcpy(_mac_address, mac_address, 6);
 
@@ -257,10 +253,11 @@ void Wiznet5100::end()
     setSn_IR(0xFF);
 
     // Wait for socket to change to closed
-    while (getSn_SR() != SOCK_CLOSED);
+    while (getSn_SR() != SOCK_CLOSED)
+        ;
 }
 
-uint16_t Wiznet5100::readFrame(uint8_t *buffer, uint16_t bufsize)
+uint16_t Wiznet5100::readFrame(uint8_t* buffer, uint16_t bufsize)
 {
     uint16_t data_len = readFrameSize();
 
@@ -288,7 +285,7 @@ uint16_t Wiznet5100::readFrameSize()
         return 0;
     }
 
-    uint8_t head[2];
+    uint8_t  head[2];
     uint16_t data_len = 0;
 
     wizchip_recv_data(head, 2);
@@ -307,7 +304,7 @@ void Wiznet5100::discardFrame(uint16_t framesize)
     setSn_CR(Sn_CR_RECV);
 }
 
-uint16_t Wiznet5100::readFrameData(uint8_t *buffer, uint16_t framesize)
+uint16_t Wiznet5100::readFrameData(uint8_t* buffer, uint16_t framesize)
 {
     wizchip_recv_data(buffer, framesize);
     setSn_CR(Sn_CR_RECV);
@@ -329,7 +326,7 @@ uint16_t Wiznet5100::readFrameData(uint8_t *buffer, uint16_t framesize)
 #endif
 }
 
-uint16_t Wiznet5100::sendFrame(const uint8_t *buf, uint16_t len)
+uint16_t Wiznet5100::sendFrame(const uint8_t* buf, uint16_t len)
 {
     // Wait for space in the transmit buffer
     while (1)
diff --git a/libraries/lwIP_w5100/src/utility/w5100.h b/libraries/lwIP_w5100/src/utility/w5100.h
index 43b9f0b9f3..ebe11d210f 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.h
+++ b/libraries/lwIP_w5100/src/utility/w5100.h
@@ -32,17 +32,15 @@
 
 // original sources: https://github.com/njh/W5100MacRaw
 
-#ifndef	W5100_H
-#define	W5100_H
+#ifndef W5100_H
+#define W5100_H
 
 #include <stdint.h>
 #include <Arduino.h>
 #include <SPI.h>
 
-
 class Wiznet5100
 {
-
 public:
     /**
         Constructor that uses the default hardware SPI pins
@@ -57,7 +55,7 @@ class Wiznet5100
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean begin(const uint8_t *address);
+    boolean begin(const uint8_t* address);
 
     /**
         Shut down the Ethernet controlled
@@ -70,7 +68,7 @@ class Wiznet5100
         @param datalen the length of the data in the packet
         @return the number of bytes transmitted
     */
-    uint16_t sendFrame(const uint8_t *data, uint16_t datalen);
+    uint16_t sendFrame(const uint8_t* data, uint16_t datalen);
 
     /**
         Read an Ethernet frame
@@ -79,10 +77,9 @@ class Wiznet5100
         @return the length of the received packet
                or 0 if no packet was received
     */
-    uint16_t readFrame(uint8_t *buffer, uint16_t bufsize);
+    uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
 
 protected:
-
     static constexpr bool interruptIsPossible()
     {
         return false;
@@ -110,23 +107,21 @@ class Wiznet5100
         @return the length of the received frame
                or 0 if a problem occurred
     */
-    uint16_t readFrameData(uint8_t *frame, uint16_t framesize);
-
+    uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
 
 private:
-    static const uint16_t TxBufferAddress = 0x4000;  /* Internal Tx buffer address of the iinchip */
-    static const uint16_t RxBufferAddress = 0x6000;  /* Internal Rx buffer address of the iinchip */
-    static const uint8_t TxBufferSize = 0x3; /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
-    static const uint8_t RxBufferSize = 0x3; /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
-    static const uint16_t TxBufferLength = (1 << TxBufferSize) << 10; /* Length of Tx buffer in bytes */
-    static const uint16_t RxBufferLength = (1 << RxBufferSize) << 10; /* Length of Rx buffer in bytes */
-    static const uint16_t TxBufferMask = TxBufferLength - 1;
-    static const uint16_t RxBufferMask = RxBufferLength - 1;
-
+    static const uint16_t TxBufferAddress = 0x4000;                    /* Internal Tx buffer address of the iinchip */
+    static const uint16_t RxBufferAddress = 0x6000;                    /* Internal Rx buffer address of the iinchip */
+    static const uint8_t  TxBufferSize    = 0x3;                       /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
+    static const uint8_t  RxBufferSize    = 0x3;                       /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
+    static const uint16_t TxBufferLength  = (1 << TxBufferSize) << 10; /* Length of Tx buffer in bytes */
+    static const uint16_t RxBufferLength  = (1 << RxBufferSize) << 10; /* Length of Rx buffer in bytes */
+    static const uint16_t TxBufferMask    = TxBufferLength - 1;
+    static const uint16_t RxBufferMask    = RxBufferLength - 1;
 
     SPIClass& _spi;
-    int8_t _cs;
-    uint8_t _mac_address[6];
+    int8_t    _cs;
+    uint8_t   _mac_address[6];
 
     /**
         Default function to select chip.
@@ -194,7 +189,6 @@ class Wiznet5100
     */
     void wizchip_write_buf(uint16_t address, const uint8_t* pBuf, uint16_t len);
 
-
     /**
         Reset WIZCHIP by softly.
     */
@@ -212,7 +206,7 @@ class Wiznet5100
         @param len Data length
         @sa wizchip_recv_data()
     */
-    void wizchip_send_data(const uint8_t *wizdata, uint16_t len);
+    void wizchip_send_data(const uint8_t* wizdata, uint16_t len);
 
     /**
         It copies data to your buffer from internal RX memory
@@ -226,7 +220,7 @@ class Wiznet5100
         @param len Data length
         @sa wizchip_send_data()
     */
-    void wizchip_recv_data(uint8_t *wizdata, uint16_t len);
+    void wizchip_recv_data(uint8_t* wizdata, uint16_t len);
 
     /**
         It discard the received data in RX memory.
@@ -247,106 +241,105 @@ class Wiznet5100
     */
     uint16_t getSn_RX_RSR();
 
-
     /** Common registers */
     enum
     {
-        MR = 0x0000,        ///< Mode Register address (R/W)
-        GAR = 0x0001,       ///< Gateway IP Register address (R/W)
-        SUBR = 0x0005,      ///< Subnet mask Register address (R/W)
-        SHAR = 0x0009,      ///< Source MAC Register address (R/W)
-        SIPR = 0x000F,      ///< Source IP Register address (R/W)
-        IR = 0x0015,        ///< Interrupt Register (R/W)
-        IMR = 0x0016,       ///< Socket Interrupt Mask Register (R/W)
-        RTR = 0x0017,       ///< Timeout register address (1 is 100us) (R/W)
-        RCR = 0x0019,       ///< Retry count register (R/W)
-        RMSR = 0x001A,      ///< Receive Memory Size
-        TMSR = 0x001B,      ///< Transmit Memory Size
+        MR   = 0x0000,  ///< Mode Register address (R/W)
+        GAR  = 0x0001,  ///< Gateway IP Register address (R/W)
+        SUBR = 0x0005,  ///< Subnet mask Register address (R/W)
+        SHAR = 0x0009,  ///< Source MAC Register address (R/W)
+        SIPR = 0x000F,  ///< Source IP Register address (R/W)
+        IR   = 0x0015,  ///< Interrupt Register (R/W)
+        IMR  = 0x0016,  ///< Socket Interrupt Mask Register (R/W)
+        RTR  = 0x0017,  ///< Timeout register address (1 is 100us) (R/W)
+        RCR  = 0x0019,  ///< Retry count register (R/W)
+        RMSR = 0x001A,  ///< Receive Memory Size
+        TMSR = 0x001B,  ///< Transmit Memory Size
     };
 
     /** Socket registers */
     enum
     {
-        Sn_MR = 0x0400,     ///< Socket Mode register(R/W)
-        Sn_CR = 0x0401,     ///< Socket command register (R/W)
-        Sn_IR = 0x0402,     ///< Socket interrupt register (R)
-        Sn_SR = 0x0403,     ///< Socket status register (R)
-        Sn_PORT = 0x0404,   ///< Source port register (R/W)
-        Sn_DHAR = 0x0406,   ///< Peer MAC register address (R/W)
-        Sn_DIPR = 0x040C,   ///< Peer IP register address (R/W)
-        Sn_DPORT = 0x0410,  ///< Peer port register address (R/W)
-        Sn_MSSR = 0x0412,   ///< Maximum Segment Size(Sn_MSSR0) register address (R/W)
-        Sn_PROTO = 0x0414,  ///< IP Protocol(PROTO) Register (R/W)
-        Sn_TOS = 0x0415,    ///< IP Type of Service(TOS) Register (R/W)
-        Sn_TTL = 0x0416,    ///< IP Time to live(TTL) Register (R/W)
-        Sn_TX_FSR = 0x0420, ///< Transmit free memory size register (R)
-        Sn_TX_RD = 0x0422,  ///< Transmit memory read pointer register address (R)
-        Sn_TX_WR = 0x0424,  ///< Transmit memory write pointer register address (R/W)
-        Sn_RX_RSR = 0x0426, ///< Received data size register (R)
-        Sn_RX_RD = 0x0428,  ///< Read point of Receive memory (R/W)
-        Sn_RX_WR = 0x042A,  ///< Write point of Receive memory (R)
+        Sn_MR     = 0x0400,  ///< Socket Mode register(R/W)
+        Sn_CR     = 0x0401,  ///< Socket command register (R/W)
+        Sn_IR     = 0x0402,  ///< Socket interrupt register (R)
+        Sn_SR     = 0x0403,  ///< Socket status register (R)
+        Sn_PORT   = 0x0404,  ///< Source port register (R/W)
+        Sn_DHAR   = 0x0406,  ///< Peer MAC register address (R/W)
+        Sn_DIPR   = 0x040C,  ///< Peer IP register address (R/W)
+        Sn_DPORT  = 0x0410,  ///< Peer port register address (R/W)
+        Sn_MSSR   = 0x0412,  ///< Maximum Segment Size(Sn_MSSR0) register address (R/W)
+        Sn_PROTO  = 0x0414,  ///< IP Protocol(PROTO) Register (R/W)
+        Sn_TOS    = 0x0415,  ///< IP Type of Service(TOS) Register (R/W)
+        Sn_TTL    = 0x0416,  ///< IP Time to live(TTL) Register (R/W)
+        Sn_TX_FSR = 0x0420,  ///< Transmit free memory size register (R)
+        Sn_TX_RD  = 0x0422,  ///< Transmit memory read pointer register address (R)
+        Sn_TX_WR  = 0x0424,  ///< Transmit memory write pointer register address (R/W)
+        Sn_RX_RSR = 0x0426,  ///< Received data size register (R)
+        Sn_RX_RD  = 0x0428,  ///< Read point of Receive memory (R/W)
+        Sn_RX_WR  = 0x042A,  ///< Write point of Receive memory (R)
     };
 
     /** Mode register values */
     enum
     {
-        MR_RST = 0x80,    ///< Reset
-        MR_PB = 0x10,     ///< Ping block
-        MR_AI = 0x02,     ///< Address Auto-Increment in Indirect Bus Interface
-        MR_IND = 0x01,    ///< Indirect Bus Interface mode
+        MR_RST = 0x80,  ///< Reset
+        MR_PB  = 0x10,  ///< Ping block
+        MR_AI  = 0x02,  ///< Address Auto-Increment in Indirect Bus Interface
+        MR_IND = 0x01,  ///< Indirect Bus Interface mode
     };
 
     /** Socket Mode Register values @ref Sn_MR */
     enum
     {
-        Sn_MR_CLOSE = 0x00,  ///< Unused socket
-        Sn_MR_TCP = 0x01,    ///< TCP
-        Sn_MR_UDP = 0x02,    ///< UDP
-        Sn_MR_IPRAW = 0x03,  ///< IP LAYER RAW SOCK
-        Sn_MR_MACRAW = 0x04, ///< MAC LAYER RAW SOCK
-        Sn_MR_ND = 0x20,     ///< No Delayed Ack(TCP) flag
-        Sn_MR_MF = 0x40,     ///< Use MAC filter
-        Sn_MR_MULTI = 0x80,  ///< support multicating
+        Sn_MR_CLOSE  = 0x00,  ///< Unused socket
+        Sn_MR_TCP    = 0x01,  ///< TCP
+        Sn_MR_UDP    = 0x02,  ///< UDP
+        Sn_MR_IPRAW  = 0x03,  ///< IP LAYER RAW SOCK
+        Sn_MR_MACRAW = 0x04,  ///< MAC LAYER RAW SOCK
+        Sn_MR_ND     = 0x20,  ///< No Delayed Ack(TCP) flag
+        Sn_MR_MF     = 0x40,  ///< Use MAC filter
+        Sn_MR_MULTI  = 0x80,  ///< support multicating
     };
 
     /** Socket Command Register values */
     enum
     {
-        Sn_CR_OPEN = 0x01,      ///< Initialise or open socket
-        Sn_CR_CLOSE = 0x10,     ///< Close socket
-        Sn_CR_SEND = 0x20,      ///< Update TX buffer pointer and send data
-        Sn_CR_SEND_MAC = 0x21,  ///< Send data with MAC address, so without ARP process
-        Sn_CR_SEND_KEEP = 0x22, ///< Send keep alive message
-        Sn_CR_RECV = 0x40,      ///< Update RX buffer pointer and receive data
+        Sn_CR_OPEN      = 0x01,  ///< Initialise or open socket
+        Sn_CR_CLOSE     = 0x10,  ///< Close socket
+        Sn_CR_SEND      = 0x20,  ///< Update TX buffer pointer and send data
+        Sn_CR_SEND_MAC  = 0x21,  ///< Send data with MAC address, so without ARP process
+        Sn_CR_SEND_KEEP = 0x22,  ///< Send keep alive message
+        Sn_CR_RECV      = 0x40,  ///< Update RX buffer pointer and receive data
     };
 
     /** Socket Interrupt register values */
     enum
     {
-        Sn_IR_CON = 0x01,      ///< CON Interrupt
-        Sn_IR_DISCON = 0x02,   ///< DISCON Interrupt
-        Sn_IR_RECV = 0x04,     ///< RECV Interrupt
+        Sn_IR_CON     = 0x01,  ///< CON Interrupt
+        Sn_IR_DISCON  = 0x02,  ///< DISCON Interrupt
+        Sn_IR_RECV    = 0x04,  ///< RECV Interrupt
         Sn_IR_TIMEOUT = 0x08,  ///< TIMEOUT Interrupt
-        Sn_IR_SENDOK = 0x10,   ///< SEND_OK Interrupt
+        Sn_IR_SENDOK  = 0x10,  ///< SEND_OK Interrupt
     };
 
     /** Socket Status Register values */
     enum
     {
-        SOCK_CLOSED = 0x00,      ///< Closed
-        SOCK_INIT = 0x13,        ///< Initiate state
-        SOCK_LISTEN = 0x14,      ///< Listen state
-        SOCK_SYNSENT = 0x15,     ///< Connection state
-        SOCK_SYNRECV = 0x16,     ///< Connection state
-        SOCK_ESTABLISHED = 0x17, ///< Success to connect
-        SOCK_FIN_WAIT = 0x18,    ///< Closing state
-        SOCK_CLOSING = 0x1A,     ///< Closing state
-        SOCK_TIME_WAIT = 0x1B,   ///< Closing state
-        SOCK_CLOSE_WAIT = 0x1C,  ///< Closing state
-        SOCK_LAST_ACK = 0x1D,    ///< Closing state
-        SOCK_UDP = 0x22,         ///< UDP socket
-        SOCK_IPRAW = 0x32,       ///< IP raw mode socket
-        SOCK_MACRAW = 0x42,      ///< MAC raw mode socket
+        SOCK_CLOSED      = 0x00,  ///< Closed
+        SOCK_INIT        = 0x13,  ///< Initiate state
+        SOCK_LISTEN      = 0x14,  ///< Listen state
+        SOCK_SYNSENT     = 0x15,  ///< Connection state
+        SOCK_SYNRECV     = 0x16,  ///< Connection state
+        SOCK_ESTABLISHED = 0x17,  ///< Success to connect
+        SOCK_FIN_WAIT    = 0x18,  ///< Closing state
+        SOCK_CLOSING     = 0x1A,  ///< Closing state
+        SOCK_TIME_WAIT   = 0x1B,  ///< Closing state
+        SOCK_CLOSE_WAIT  = 0x1C,  ///< Closing state
+        SOCK_LAST_ACK    = 0x1D,  ///< Closing state
+        SOCK_UDP         = 0x22,  ///< UDP socket
+        SOCK_IPRAW       = 0x32,  ///< IP raw mode socket
+        SOCK_MACRAW      = 0x42,  ///< MAC raw mode socket
     };
 
     /**
@@ -496,4 +489,4 @@ class Wiznet5100
     }
 };
 
-#endif // W5100_H
+#endif  // W5100_H
diff --git a/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino b/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino
index bdece2d88b..1cd0ef9137 100644
--- a/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino
+++ b/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino
@@ -8,24 +8,24 @@
 //or #include <W5100lwIP.h>
 //or #include <ENC28J60lwIP.h>
 
-#include <WiFiClient.h> // WiFiClient (-> TCPClient)
+#include <WiFiClient.h>  // WiFiClient (-> TCPClient)
 
-const char* host = "djxmmx.net";
+const char*    host = "djxmmx.net";
 const uint16_t port = 17;
 
 using TCPClient = WiFiClient;
 
-#define CSPIN 16 // wemos/lolin/nodemcu D0
+#define CSPIN 16  // wemos/lolin/nodemcu D0
 Wiznet5500lwIP eth(CSPIN);
 
 void setup() {
   Serial.begin(115200);
 
   SPI.begin();
-  SPI.setClockDivider(SPI_CLOCK_DIV4); // 4 MHz?
+  SPI.setClockDivider(SPI_CLOCK_DIV4);  // 4 MHz?
   SPI.setBitOrder(MSBFIRST);
   SPI.setDataMode(SPI_MODE0);
-  eth.setDefault(); // use ethernet for default route
+  eth.setDefault();  // use ethernet for default route
   if (!eth.begin()) {
     Serial.println("ethernet hardware not found ... sleeping");
     while (1) {
@@ -89,7 +89,7 @@ void loop() {
   client.stop();
 
   if (wait) {
-    delay(300000); // execute once every 5 minutes, don't flood remote service
+    delay(300000);  // execute once every 5 minutes, don't flood remote service
   }
   wait = true;
 }
diff --git a/libraries/lwIP_w5500/src/utility/w5500.cpp b/libraries/lwIP_w5500/src/utility/w5500.cpp
index b3c3ce0162..cc4a1e245d 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.cpp
+++ b/libraries/lwIP_w5500/src/utility/w5500.cpp
@@ -35,7 +35,6 @@
 #include <SPI.h>
 #include "w5500.h"
 
-
 uint8_t Wiznet5500::wizchip_read(uint8_t block, uint16_t address)
 {
     uint8_t ret;
@@ -95,7 +94,7 @@ void Wiznet5500::wizchip_write(uint8_t block, uint16_t address, uint8_t wb)
 void Wiznet5500::wizchip_write_word(uint8_t block, uint16_t address, uint16_t word)
 {
     wizchip_write(block, address, (uint8_t)(word >> 8));
-    wizchip_write(block, address + 1, (uint8_t) word);
+    wizchip_write(block, address + 1, (uint8_t)word);
 }
 
 void Wiznet5500::wizchip_write_buf(uint8_t block, uint16_t address, const uint8_t* pBuf, uint16_t len)
@@ -123,7 +122,8 @@ void Wiznet5500::setSn_CR(uint8_t cr)
     wizchip_write(BlockSelectSReg, Sn_CR, cr);
 
     // Now wait for the command to complete
-    while (wizchip_read(BlockSelectSReg, Sn_CR));
+    while (wizchip_read(BlockSelectSReg, Sn_CR))
+        ;
 }
 
 uint16_t Wiznet5500::getSn_TX_FSR()
@@ -140,7 +140,6 @@ uint16_t Wiznet5500::getSn_TX_FSR()
     return val;
 }
 
-
 uint16_t Wiznet5500::getSn_RX_RSR()
 {
     uint16_t val = 0, val1 = 0;
@@ -155,7 +154,7 @@ uint16_t Wiznet5500::getSn_RX_RSR()
     return val;
 }
 
-void Wiznet5500::wizchip_send_data(const uint8_t *wizdata, uint16_t len)
+void Wiznet5500::wizchip_send_data(const uint8_t* wizdata, uint16_t len)
 {
     uint16_t ptr = 0;
 
@@ -171,7 +170,7 @@ void Wiznet5500::wizchip_send_data(const uint8_t *wizdata, uint16_t len)
     setSn_TX_WR(ptr);
 }
 
-void Wiznet5500::wizchip_recv_data(uint8_t *wizdata, uint16_t len)
+void Wiznet5500::wizchip_recv_data(uint8_t* wizdata, uint16_t len)
 {
     uint16_t ptr;
 
@@ -198,7 +197,7 @@ void Wiznet5500::wizchip_recv_ignore(uint16_t len)
 void Wiznet5500::wizchip_sw_reset()
 {
     setMR(MR_RST);
-    getMR(); // for delay
+    getMR();  // for delay
 
     setSHAR(_mac_address);
 }
@@ -244,7 +243,7 @@ void Wiznet5500::wizphy_reset()
 int8_t Wiznet5500::wizphy_setphypmode(uint8_t pmode)
 {
     uint8_t tmp = 0;
-    tmp = getPHYCFGR();
+    tmp         = getPHYCFGR();
     if ((tmp & PHYCFGR_OPMD) == 0)
     {
         return -1;
@@ -278,14 +277,13 @@ int8_t Wiznet5500::wizphy_setphypmode(uint8_t pmode)
     return -1;
 }
 
-
-Wiznet5500::Wiznet5500(int8_t cs, SPIClass& spi, int8_t intr):
+Wiznet5500::Wiznet5500(int8_t cs, SPIClass& spi, int8_t intr) :
     _spi(spi), _cs(cs)
 {
     (void)intr;
 }
 
-boolean Wiznet5500::begin(const uint8_t *mac_address)
+boolean Wiznet5500::begin(const uint8_t* mac_address)
 {
     memcpy(_mac_address, mac_address, 6);
 
@@ -329,10 +327,11 @@ void Wiznet5500::end()
     setSn_IR(0xFF);
 
     // Wait for socket to change to closed
-    while (getSn_SR() != SOCK_CLOSED);
+    while (getSn_SR() != SOCK_CLOSED)
+        ;
 }
 
-uint16_t Wiznet5500::readFrame(uint8_t *buffer, uint16_t bufsize)
+uint16_t Wiznet5500::readFrame(uint8_t* buffer, uint16_t bufsize)
 {
     uint16_t data_len = readFrameSize();
 
@@ -360,7 +359,7 @@ uint16_t Wiznet5500::readFrameSize()
         return 0;
     }
 
-    uint8_t head[2];
+    uint8_t  head[2];
     uint16_t data_len = 0;
 
     wizchip_recv_data(head, 2);
@@ -379,7 +378,7 @@ void Wiznet5500::discardFrame(uint16_t framesize)
     setSn_CR(Sn_CR_RECV);
 }
 
-uint16_t Wiznet5500::readFrameData(uint8_t *buffer, uint16_t framesize)
+uint16_t Wiznet5500::readFrameData(uint8_t* buffer, uint16_t framesize)
 {
     wizchip_recv_data(buffer, framesize);
     setSn_CR(Sn_CR_RECV);
@@ -402,7 +401,7 @@ uint16_t Wiznet5500::readFrameData(uint8_t *buffer, uint16_t framesize)
 #endif
 }
 
-uint16_t Wiznet5500::sendFrame(const uint8_t *buf, uint16_t len)
+uint16_t Wiznet5500::sendFrame(const uint8_t* buf, uint16_t len)
 {
     // Wait for space in the transmit buffer
     while (1)
diff --git a/libraries/lwIP_w5500/src/utility/w5500.h b/libraries/lwIP_w5500/src/utility/w5500.h
index 85b253a4bf..181e38848a 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.h
+++ b/libraries/lwIP_w5500/src/utility/w5500.h
@@ -39,11 +39,8 @@
 #include <Arduino.h>
 #include <SPI.h>
 
-
-
 class Wiznet5500
 {
-
 public:
     /**
         Constructor that uses the default hardware SPI pins
@@ -51,7 +48,6 @@ class Wiznet5500
     */
     Wiznet5500(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1);
 
-
     /**
         Initialise the Ethernet controller
         Must be called before sending or receiving Ethernet frames
@@ -59,7 +55,7 @@ class Wiznet5500
         @param address the local MAC address for the Ethernet interface
         @return Returns true if setting up the Ethernet interface was successful
     */
-    boolean begin(const uint8_t *address);
+    boolean begin(const uint8_t* address);
 
     /**
         Shut down the Ethernet controlled
@@ -72,7 +68,7 @@ class Wiznet5500
         @param datalen the length of the data in the packet
         @return the number of bytes transmitted
     */
-    uint16_t sendFrame(const uint8_t *data, uint16_t datalen);
+    uint16_t sendFrame(const uint8_t* data, uint16_t datalen);
 
     /**
         Read an Ethernet frame
@@ -81,10 +77,9 @@ class Wiznet5500
         @return the length of the received packet
                or 0 if no packet was received
     */
-    uint16_t readFrame(uint8_t *buffer, uint16_t bufsize);
+    uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
 
 protected:
-
     static constexpr bool interruptIsPossible()
     {
         return false;
@@ -112,11 +107,9 @@ class Wiznet5500
         @return the length of the received frame
                or 0 if a problem occurred
     */
-    uint16_t readFrameData(uint8_t *frame, uint16_t framesize);
-
+    uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
 
 private:
-
     //< SPI interface Read operation in Control Phase
     static const uint8_t AccessModeRead = (0x00 << 2);
 
@@ -135,11 +128,9 @@ class Wiznet5500
     //< Socket 0 Rx buffer address block
     static const uint8_t BlockSelectRxBuf = (0x03 << 3);
 
-
-
     SPIClass& _spi;
-    int8_t _cs;
-    uint8_t _mac_address[6];
+    int8_t    _cs;
+    uint8_t   _mac_address[6];
 
     /**
         Default function to select chip.
@@ -181,7 +172,6 @@ class Wiznet5500
         _spi.transfer(wb);
     }
 
-
     /**
         Read a 1 byte value from a register.
         @param address Register address
@@ -240,7 +230,6 @@ class Wiznet5500
     */
     uint16_t getSn_RX_RSR();
 
-
     /**
         Reset WIZCHIP by softly.
     */
@@ -279,7 +268,7 @@ class Wiznet5500
         @param len Data length
         @sa wizchip_recv_data()
     */
-    void wizchip_send_data(const uint8_t *wizdata, uint16_t len);
+    void wizchip_send_data(const uint8_t* wizdata, uint16_t len);
 
     /**
         It copies data to your buffer from internal RX memory
@@ -293,7 +282,7 @@ class Wiznet5500
         @param len Data length
         @sa wizchip_send_data()
     */
-    void wizchip_recv_data(uint8_t *wizdata, uint16_t len);
+    void wizchip_recv_data(uint8_t* wizdata, uint16_t len);
 
     /**
         It discard the received data in RX memory.
@@ -302,174 +291,170 @@ class Wiznet5500
     */
     void wizchip_recv_ignore(uint16_t len);
 
-
-
     /** Common registers */
     enum
     {
-        MR = 0x0000,        ///< Mode Register address (R/W)
-        SHAR = 0x0009,      ///< Source MAC Register address (R/W)
+        MR       = 0x0000,  ///< Mode Register address (R/W)
+        SHAR     = 0x0009,  ///< Source MAC Register address (R/W)
         INTLEVEL = 0x0013,  ///< Set Interrupt low level timer register address (R/W)
-        IR = 0x0015,        ///< Interrupt Register (R/W)
-        _IMR_ = 0x0016,     ///< Interrupt mask register (R/W)
-        SIR = 0x0017,       ///< Socket Interrupt Register (R/W)
-        SIMR = 0x0018,      ///< Socket Interrupt Mask Register (R/W)
-        _RTR_ = 0x0019,     ///< Timeout register address (1 is 100us) (R/W)
-        _RCR_ = 0x001B,     ///< Retry count register (R/W)
-        UIPR = 0x0028,      ///< Unreachable IP register address in UDP mode (R)
-        UPORTR = 0x002C,    ///< Unreachable Port register address in UDP mode (R)
-        PHYCFGR = 0x002E,   ///< PHY Status Register (R/W)
+        IR       = 0x0015,  ///< Interrupt Register (R/W)
+        _IMR_    = 0x0016,  ///< Interrupt mask register (R/W)
+        SIR      = 0x0017,  ///< Socket Interrupt Register (R/W)
+        SIMR     = 0x0018,  ///< Socket Interrupt Mask Register (R/W)
+        _RTR_    = 0x0019,  ///< Timeout register address (1 is 100us) (R/W)
+        _RCR_    = 0x001B,  ///< Retry count register (R/W)
+        UIPR     = 0x0028,  ///< Unreachable IP register address in UDP mode (R)
+        UPORTR   = 0x002C,  ///< Unreachable Port register address in UDP mode (R)
+        PHYCFGR  = 0x002E,  ///< PHY Status Register (R/W)
         VERSIONR = 0x0039,  ///< Chip version register address (R)
     };
 
     /** Socket registers */
     enum
     {
-        Sn_MR = 0x0000,          ///< Socket Mode register (R/W)
-        Sn_CR = 0x0001,          ///< Socket command register (R/W)
-        Sn_IR = 0x0002,          ///< Socket interrupt register (R)
-        Sn_SR = 0x0003,          ///< Socket status register (R)
-        Sn_PORT = 0x0004,        ///< Source port register (R/W)
-        Sn_DHAR = 0x0006,        ///< Peer MAC register address (R/W)
-        Sn_DIPR = 0x000C,        ///< Peer IP register address (R/W)
-        Sn_DPORT = 0x0010,       ///< Peer port register address (R/W)
-        Sn_MSSR = 0x0012,        ///< Maximum Segment Size(Sn_MSSR0) register address (R/W)
-        Sn_TOS = 0x0015,         ///< IP Type of Service(TOS) Register (R/W)
-        Sn_TTL = 0x0016,         ///< IP Time to live(TTL) Register (R/W)
+        Sn_MR         = 0x0000,  ///< Socket Mode register (R/W)
+        Sn_CR         = 0x0001,  ///< Socket command register (R/W)
+        Sn_IR         = 0x0002,  ///< Socket interrupt register (R)
+        Sn_SR         = 0x0003,  ///< Socket status register (R)
+        Sn_PORT       = 0x0004,  ///< Source port register (R/W)
+        Sn_DHAR       = 0x0006,  ///< Peer MAC register address (R/W)
+        Sn_DIPR       = 0x000C,  ///< Peer IP register address (R/W)
+        Sn_DPORT      = 0x0010,  ///< Peer port register address (R/W)
+        Sn_MSSR       = 0x0012,  ///< Maximum Segment Size(Sn_MSSR0) register address (R/W)
+        Sn_TOS        = 0x0015,  ///< IP Type of Service(TOS) Register (R/W)
+        Sn_TTL        = 0x0016,  ///< IP Time to live(TTL) Register (R/W)
         Sn_RXBUF_SIZE = 0x001E,  ///< Receive memory size register (R/W)
         Sn_TXBUF_SIZE = 0x001F,  ///< Transmit memory size register (R/W)
-        Sn_TX_FSR = 0x0020,      ///< Transmit free memory size register (R)
-        Sn_TX_RD = 0x0022,       ///< Transmit memory read pointer register address (R)
-        Sn_TX_WR = 0x0024,       ///< Transmit memory write pointer register address (R/W)
-        Sn_RX_RSR = 0x0026,      ///< Received data size register (R)
-        Sn_RX_RD = 0x0028,       ///< Read point of Receive memory (R/W)
-        Sn_RX_WR = 0x002A,       ///< Write point of Receive memory (R)
-        Sn_IMR = 0x002C,         ///< Socket interrupt mask register (R)
-        Sn_FRAG = 0x002D,        ///< Fragment field value in IP header register (R/W)
-        Sn_KPALVTR = 0x002F,     ///< Keep Alive Timer register (R/W)
+        Sn_TX_FSR     = 0x0020,  ///< Transmit free memory size register (R)
+        Sn_TX_RD      = 0x0022,  ///< Transmit memory read pointer register address (R)
+        Sn_TX_WR      = 0x0024,  ///< Transmit memory write pointer register address (R/W)
+        Sn_RX_RSR     = 0x0026,  ///< Received data size register (R)
+        Sn_RX_RD      = 0x0028,  ///< Read point of Receive memory (R/W)
+        Sn_RX_WR      = 0x002A,  ///< Write point of Receive memory (R)
+        Sn_IMR        = 0x002C,  ///< Socket interrupt mask register (R)
+        Sn_FRAG       = 0x002D,  ///< Fragment field value in IP header register (R/W)
+        Sn_KPALVTR    = 0x002F,  ///< Keep Alive Timer register (R/W)
     };
 
     /** Mode register values */
     enum
     {
-        MR_RST = 0x80,    ///< Reset
-        MR_WOL = 0x20,    ///< Wake on LAN
-        MR_PB = 0x10,     ///< Ping block
+        MR_RST   = 0x80,  ///< Reset
+        MR_WOL   = 0x20,  ///< Wake on LAN
+        MR_PB    = 0x10,  ///< Ping block
         MR_PPPOE = 0x08,  ///< Enable PPPoE
-        MR_FARP = 0x02,   ///< Enable UDP_FORCE_ARP CHECK
+        MR_FARP  = 0x02,  ///< Enable UDP_FORCE_ARP CHECK
     };
 
     /* Interrupt Register values */
     enum
     {
         IR_CONFLICT = 0x80,  ///< Check IP conflict
-        IR_UNREACH = 0x40,   ///< Get the destination unreachable message in UDP sending
-        IR_PPPoE = 0x20,     ///< Get the PPPoE close message
-        IR_MP = 0x10,        ///< Get the magic packet interrupt
+        IR_UNREACH  = 0x40,  ///< Get the destination unreachable message in UDP sending
+        IR_PPPoE    = 0x20,  ///< Get the PPPoE close message
+        IR_MP       = 0x10,  ///< Get the magic packet interrupt
     };
 
     /* Interrupt Mask Register values */
     enum
     {
-        IM_IR7 = 0x80,   ///< IP Conflict Interrupt Mask
-        IM_IR6 = 0x40,   ///< Destination unreachable Interrupt Mask
-        IM_IR5 = 0x20,   ///< PPPoE Close Interrupt Mask
-        IM_IR4 = 0x10,   ///< Magic Packet Interrupt Mask
+        IM_IR7 = 0x80,  ///< IP Conflict Interrupt Mask
+        IM_IR6 = 0x40,  ///< Destination unreachable Interrupt Mask
+        IM_IR5 = 0x20,  ///< PPPoE Close Interrupt Mask
+        IM_IR4 = 0x10,  ///< Magic Packet Interrupt Mask
     };
 
     /** Socket Mode Register values @ref Sn_MR */
     enum
     {
-        Sn_MR_CLOSE = 0x00,  ///< Unused socket
-        Sn_MR_TCP = 0x01,    ///< TCP
-        Sn_MR_UDP = 0x02,    ///< UDP
-        Sn_MR_MACRAW = 0x04, ///< MAC LAYER RAW SOCK
-        Sn_MR_UCASTB = 0x10, ///< Unicast Block in UDP Multicasting
-        Sn_MR_ND = 0x20,     ///< No Delayed Ack(TCP), Multicast flag
-        Sn_MR_BCASTB = 0x40, ///< Broadcast block in UDP Multicasting
-        Sn_MR_MULTI = 0x80,  ///< Support UDP Multicasting
-        Sn_MR_MIP6B = 0x10,  ///< IPv6 packet Blocking in @ref Sn_MR_MACRAW mode
-        Sn_MR_MMB = 0x20,    ///< Multicast Blocking in @ref Sn_MR_MACRAW mode
-        Sn_MR_MFEN = 0x80,   ///< MAC filter enable in @ref Sn_MR_MACRAW mode
+        Sn_MR_CLOSE  = 0x00,  ///< Unused socket
+        Sn_MR_TCP    = 0x01,  ///< TCP
+        Sn_MR_UDP    = 0x02,  ///< UDP
+        Sn_MR_MACRAW = 0x04,  ///< MAC LAYER RAW SOCK
+        Sn_MR_UCASTB = 0x10,  ///< Unicast Block in UDP Multicasting
+        Sn_MR_ND     = 0x20,  ///< No Delayed Ack(TCP), Multicast flag
+        Sn_MR_BCASTB = 0x40,  ///< Broadcast block in UDP Multicasting
+        Sn_MR_MULTI  = 0x80,  ///< Support UDP Multicasting
+        Sn_MR_MIP6B  = 0x10,  ///< IPv6 packet Blocking in @ref Sn_MR_MACRAW mode
+        Sn_MR_MMB    = 0x20,  ///< Multicast Blocking in @ref Sn_MR_MACRAW mode
+        Sn_MR_MFEN   = 0x80,  ///< MAC filter enable in @ref Sn_MR_MACRAW mode
     };
 
     /** Socket Command Register values */
     enum
     {
-        Sn_CR_OPEN = 0x01,      ///< Initialise or open socket
-        Sn_CR_LISTEN = 0x02,    ///< Wait connection request in TCP mode (Server mode)
-        Sn_CR_CONNECT = 0x04,   ///< Send connection request in TCP mode (Client mode)
-        Sn_CR_DISCON = 0x08,    ///< Send closing request in TCP mode
-        Sn_CR_CLOSE = 0x10,     ///< Close socket
-        Sn_CR_SEND = 0x20,      ///< Update TX buffer pointer and send data
-        Sn_CR_SEND_MAC = 0x21,  ///< Send data with MAC address, so without ARP process
-        Sn_CR_SEND_KEEP = 0x22, ///< Send keep alive message
-        Sn_CR_RECV = 0x40,      ///< Update RX buffer pointer and receive data
+        Sn_CR_OPEN      = 0x01,  ///< Initialise or open socket
+        Sn_CR_LISTEN    = 0x02,  ///< Wait connection request in TCP mode (Server mode)
+        Sn_CR_CONNECT   = 0x04,  ///< Send connection request in TCP mode (Client mode)
+        Sn_CR_DISCON    = 0x08,  ///< Send closing request in TCP mode
+        Sn_CR_CLOSE     = 0x10,  ///< Close socket
+        Sn_CR_SEND      = 0x20,  ///< Update TX buffer pointer and send data
+        Sn_CR_SEND_MAC  = 0x21,  ///< Send data with MAC address, so without ARP process
+        Sn_CR_SEND_KEEP = 0x22,  ///< Send keep alive message
+        Sn_CR_RECV      = 0x40,  ///< Update RX buffer pointer and receive data
     };
 
     /** Socket Interrupt register values */
     enum
     {
-        Sn_IR_CON = 0x01,      ///< CON Interrupt
-        Sn_IR_DISCON = 0x02,   ///< DISCON Interrupt
-        Sn_IR_RECV = 0x04,     ///< RECV Interrupt
+        Sn_IR_CON     = 0x01,  ///< CON Interrupt
+        Sn_IR_DISCON  = 0x02,  ///< DISCON Interrupt
+        Sn_IR_RECV    = 0x04,  ///< RECV Interrupt
         Sn_IR_TIMEOUT = 0x08,  ///< TIMEOUT Interrupt
-        Sn_IR_SENDOK = 0x10,   ///< SEND_OK Interrupt
+        Sn_IR_SENDOK  = 0x10,  ///< SEND_OK Interrupt
     };
 
     /** Socket Status Register values */
     enum
     {
-        SOCK_CLOSED = 0x00,      ///< Closed
-        SOCK_INIT = 0x13,        ///< Initiate state
-        SOCK_LISTEN = 0x14,      ///< Listen state
-        SOCK_SYNSENT = 0x15,     ///< Connection state
-        SOCK_SYNRECV = 0x16,     ///< Connection state
-        SOCK_ESTABLISHED = 0x17, ///< Success to connect
-        SOCK_FIN_WAIT = 0x18,    ///< Closing state
-        SOCK_CLOSING = 0x1A,     ///< Closing state
-        SOCK_TIME_WAIT = 0x1B,   ///< Closing state
-        SOCK_CLOSE_WAIT = 0x1C,  ///< Closing state
-        SOCK_LAST_ACK = 0x1D,    ///< Closing state
-        SOCK_UDP = 0x22,         ///< UDP socket
-        SOCK_MACRAW = 0x42,      ///< MAC raw mode socket
+        SOCK_CLOSED      = 0x00,  ///< Closed
+        SOCK_INIT        = 0x13,  ///< Initiate state
+        SOCK_LISTEN      = 0x14,  ///< Listen state
+        SOCK_SYNSENT     = 0x15,  ///< Connection state
+        SOCK_SYNRECV     = 0x16,  ///< Connection state
+        SOCK_ESTABLISHED = 0x17,  ///< Success to connect
+        SOCK_FIN_WAIT    = 0x18,  ///< Closing state
+        SOCK_CLOSING     = 0x1A,  ///< Closing state
+        SOCK_TIME_WAIT   = 0x1B,  ///< Closing state
+        SOCK_CLOSE_WAIT  = 0x1C,  ///< Closing state
+        SOCK_LAST_ACK    = 0x1D,  ///< Closing state
+        SOCK_UDP         = 0x22,  ///< UDP socket
+        SOCK_MACRAW      = 0x42,  ///< MAC raw mode socket
     };
 
-
     /* PHYCFGR register value */
     enum
     {
-        PHYCFGR_RST = ~(1 << 7), //< For PHY reset, must operate AND mask.
-        PHYCFGR_OPMD = (1 << 6), // Configre PHY with OPMDC value
-        PHYCFGR_OPMDC_ALLA = (7 << 3),
+        PHYCFGR_RST         = ~(1 << 7),  //< For PHY reset, must operate AND mask.
+        PHYCFGR_OPMD        = (1 << 6),   // Configre PHY with OPMDC value
+        PHYCFGR_OPMDC_ALLA  = (7 << 3),
         PHYCFGR_OPMDC_PDOWN = (6 << 3),
-        PHYCFGR_OPMDC_NA = (5 << 3),
+        PHYCFGR_OPMDC_NA    = (5 << 3),
         PHYCFGR_OPMDC_100FA = (4 << 3),
-        PHYCFGR_OPMDC_100F = (3 << 3),
-        PHYCFGR_OPMDC_100H = (2 << 3),
-        PHYCFGR_OPMDC_10F = (1 << 3),
-        PHYCFGR_OPMDC_10H = (0 << 3),
-        PHYCFGR_DPX_FULL = (1 << 2),
-        PHYCFGR_DPX_HALF = (0 << 2),
-        PHYCFGR_SPD_100 = (1 << 1),
-        PHYCFGR_SPD_10 = (0 << 1),
-        PHYCFGR_LNK_ON = (1 << 0),
-        PHYCFGR_LNK_OFF = (0 << 0),
+        PHYCFGR_OPMDC_100F  = (3 << 3),
+        PHYCFGR_OPMDC_100H  = (2 << 3),
+        PHYCFGR_OPMDC_10F   = (1 << 3),
+        PHYCFGR_OPMDC_10H   = (0 << 3),
+        PHYCFGR_DPX_FULL    = (1 << 2),
+        PHYCFGR_DPX_HALF    = (0 << 2),
+        PHYCFGR_SPD_100     = (1 << 1),
+        PHYCFGR_SPD_10      = (0 << 1),
+        PHYCFGR_LNK_ON      = (1 << 0),
+        PHYCFGR_LNK_OFF     = (0 << 0),
     };
 
     enum
     {
-        PHY_SPEED_10 = 0,     ///< Link Speed 10
-        PHY_SPEED_100 = 1,    ///< Link Speed 100
+        PHY_SPEED_10    = 0,  ///< Link Speed 10
+        PHY_SPEED_100   = 1,  ///< Link Speed 100
         PHY_DUPLEX_HALF = 0,  ///< Link Half-Duplex
         PHY_DUPLEX_FULL = 1,  ///< Link Full-Duplex
-        PHY_LINK_OFF = 0,     ///< Link Off
-        PHY_LINK_ON = 1,      ///< Link On
-        PHY_POWER_NORM = 0,   ///< PHY power normal mode
-        PHY_POWER_DOWN = 1,   ///< PHY power down mode
+        PHY_LINK_OFF    = 0,  ///< Link Off
+        PHY_LINK_ON     = 1,  ///< Link On
+        PHY_POWER_NORM  = 0,  ///< PHY power normal mode
+        PHY_POWER_DOWN  = 1,  ///< PHY power down mode
     };
 
-
     /**
         Set Mode Register
         @param (uint8_t)mr The value to be set.
@@ -764,4 +749,4 @@ class Wiznet5500
     }
 };
 
-#endif // W5500_H
+#endif  // W5500_H
diff --git a/tests/device/libraries/BSTest/src/BSArduino.h b/tests/device/libraries/BSTest/src/BSArduino.h
index 2fd4dc66e0..82e1b89826 100644
--- a/tests/device/libraries/BSTest/src/BSArduino.h
+++ b/tests/device/libraries/BSTest/src/BSArduino.h
@@ -7,29 +7,33 @@ namespace bs
 class ArduinoIOHelper
 {
 public:
-    ArduinoIOHelper(Stream& stream) : m_stream(stream)
+    ArduinoIOHelper(Stream& stream) :
+        m_stream(stream)
     {
     }
 
-    size_t printf(const char *format, ...)
+    size_t printf(const char* format, ...)
     {
         va_list arg;
         va_start(arg, format);
-        char temp[128];
-        char* buffer = temp;
-        size_t len = vsnprintf(temp, sizeof(temp), format, arg);
+        char   temp[128];
+        char*  buffer = temp;
+        size_t len    = vsnprintf(temp, sizeof(temp), format, arg);
         va_end(arg);
-        if (len > sizeof(temp) - 1) {
+        if (len > sizeof(temp) - 1)
+        {
             buffer = new char[len + 1];
-            if (!buffer) {
+            if (!buffer)
+            {
                 return 0;
             }
             va_start(arg, format);
             ets_vsnprintf(buffer, len + 1, format, arg);
             va_end(arg);
         }
-        len = m_stream.write((const uint8_t*) buffer, len);
-        if (buffer != temp) {
+        len = m_stream.write((const uint8_t*)buffer, len);
+        if (buffer != temp)
+        {
             delete[] buffer;
         }
         return len;
@@ -40,16 +44,20 @@ class ArduinoIOHelper
         size_t len = 0;
         // Can't use Stream::readBytesUntil here because it can't tell the
         // difference between timing out and receiving the terminator.
-        while (len < dest_size - 1) {
+        while (len < dest_size - 1)
+        {
             int c = m_stream.read();
-            if (c < 0) {
+            if (c < 0)
+            {
                 delay(1);
                 continue;
             }
-            if (c == '\r') {
+            if (c == '\r')
+            {
                 continue;
             }
-            if (c == '\n') {
+            if (c == '\n')
+            {
                 dest[len] = 0;
                 break;
             }
@@ -64,10 +72,11 @@ class ArduinoIOHelper
 
 typedef ArduinoIOHelper IOHelper;
 
-inline void fatal() {
+inline void fatal()
+{
     ESP.restart();
 }
 
-} // namespace bs
+}  // namespace bs
 
-#endif //BS_ARDUINO_H
+#endif  //BS_ARDUINO_H
diff --git a/tests/device/libraries/BSTest/src/BSArgs.h b/tests/device/libraries/BSTest/src/BSArgs.h
index 060bcdf18c..9c0971faa7 100644
--- a/tests/device/libraries/BSTest/src/BSArgs.h
+++ b/tests/device/libraries/BSTest/src/BSArgs.h
@@ -15,31 +15,32 @@ namespace bs
 {
 namespace protocol
 {
-
 #define SS_FLAG_ESCAPE 0x8
 
-typedef enum {
-    /* parsing the space between arguments */
-    SS_SPACE = 0x0,
-    /* parsing an argument which isn't quoted */
-    SS_ARG = 0x1,
-    /* parsing a quoted argument */
-    SS_QUOTED_ARG = 0x2,
-    /* parsing an escape sequence within unquoted argument */
-    SS_ARG_ESCAPED = SS_ARG | SS_FLAG_ESCAPE,
-    /* parsing an escape sequence within a quoted argument */
-    SS_QUOTED_ARG_ESCAPED = SS_QUOTED_ARG | SS_FLAG_ESCAPE,
-} split_state_t;
+    typedef enum
+    {
+        /* parsing the space between arguments */
+        SS_SPACE = 0x0,
+        /* parsing an argument which isn't quoted */
+        SS_ARG = 0x1,
+        /* parsing a quoted argument */
+        SS_QUOTED_ARG = 0x2,
+        /* parsing an escape sequence within unquoted argument */
+        SS_ARG_ESCAPED = SS_ARG | SS_FLAG_ESCAPE,
+        /* parsing an escape sequence within a quoted argument */
+        SS_QUOTED_ARG_ESCAPED = SS_QUOTED_ARG | SS_FLAG_ESCAPE,
+    } split_state_t;
 
 /* helper macro, called when done with an argument */
-#define END_ARG() do { \
-        char_out = 0;   \
-        argv[argc++] = next_arg_start;  \
-        state = SS_SPACE;   \
-    } while(0);
-
-
-/**
+#define END_ARG()                      \
+    do                                 \
+    {                                  \
+        char_out     = 0;              \
+        argv[argc++] = next_arg_start; \
+        state        = SS_SPACE;       \
+    } while (0);
+
+    /**
  * @brief Split command line into arguments in place
  *
  * - This function finds whitespace-separated arguments in the given input line.
@@ -63,89 +64,114 @@ typedef enum {
  * @param argv_size number of elements in argv_array (max. number of arguments will be argv_size - 1)
  * @return number of arguments found (argc)
  */
-inline size_t split_args(char *line, char **argv, size_t argv_size)
-{
-    const int QUOTE = '"';
-    const int ESCAPE = '\\';
-    const int SPACE = ' ';
-    split_state_t state = SS_SPACE;
-    size_t argc = 0;
-    char *next_arg_start = line;
-    char *out_ptr = line;
-    for (char *in_ptr = line; argc < argv_size - 1; ++in_ptr) {
-        int char_in = (unsigned char) *in_ptr;
-        if (char_in == 0) {
-            break;
-        }
-        int char_out = -1;
-
-        switch (state) {
-        case SS_SPACE:
-            if (char_in == SPACE) {
-                /* skip space */
-            } else if (char_in == QUOTE) {
-                next_arg_start = out_ptr;
-                state = SS_QUOTED_ARG;
-            } else if (char_in == ESCAPE) {
-                next_arg_start = out_ptr;
-                state = SS_ARG_ESCAPED;
-            } else {
-                next_arg_start = out_ptr;
-                state = SS_ARG;
-                char_out = char_in;
+    inline size_t split_args(char* line, char** argv, size_t argv_size)
+    {
+        const int     QUOTE          = '"';
+        const int     ESCAPE         = '\\';
+        const int     SPACE          = ' ';
+        split_state_t state          = SS_SPACE;
+        size_t        argc           = 0;
+        char*         next_arg_start = line;
+        char*         out_ptr        = line;
+        for (char* in_ptr = line; argc < argv_size - 1; ++in_ptr)
+        {
+            int char_in = (unsigned char)*in_ptr;
+            if (char_in == 0)
+            {
+                break;
             }
-            break;
-
-        case SS_QUOTED_ARG:
-            if (char_in == QUOTE) {
-                END_ARG();
-            } else if (char_in == ESCAPE) {
-                state = SS_QUOTED_ARG_ESCAPED;
-            } else {
-                char_out = char_in;
+            int char_out = -1;
+
+            switch (state)
+            {
+            case SS_SPACE:
+                if (char_in == SPACE)
+                {
+                    /* skip space */
+                }
+                else if (char_in == QUOTE)
+                {
+                    next_arg_start = out_ptr;
+                    state          = SS_QUOTED_ARG;
+                }
+                else if (char_in == ESCAPE)
+                {
+                    next_arg_start = out_ptr;
+                    state          = SS_ARG_ESCAPED;
+                }
+                else
+                {
+                    next_arg_start = out_ptr;
+                    state          = SS_ARG;
+                    char_out       = char_in;
+                }
+                break;
+
+            case SS_QUOTED_ARG:
+                if (char_in == QUOTE)
+                {
+                    END_ARG();
+                }
+                else if (char_in == ESCAPE)
+                {
+                    state = SS_QUOTED_ARG_ESCAPED;
+                }
+                else
+                {
+                    char_out = char_in;
+                }
+                break;
+
+            case SS_ARG_ESCAPED:
+            case SS_QUOTED_ARG_ESCAPED:
+                if (char_in == ESCAPE || char_in == QUOTE || char_in == SPACE)
+                {
+                    char_out = char_in;
+                }
+                else
+                {
+                    /* unrecognized escape character, skip */
+                }
+                state = (split_state_t)(state & (~SS_FLAG_ESCAPE));
+                break;
+
+            case SS_ARG:
+                if (char_in == SPACE)
+                {
+                    END_ARG();
+                }
+                else if (char_in == ESCAPE)
+                {
+                    state = SS_ARG_ESCAPED;
+                }
+                else
+                {
+                    char_out = char_in;
+                }
+                break;
             }
-            break;
-
-        case SS_ARG_ESCAPED:
-        case SS_QUOTED_ARG_ESCAPED:
-            if (char_in == ESCAPE || char_in == QUOTE || char_in == SPACE) {
-                char_out = char_in;
-            } else {
-                /* unrecognized escape character, skip */
-            }
-            state = (split_state_t) (state & (~SS_FLAG_ESCAPE));
-            break;
-
-        case SS_ARG:
-            if (char_in == SPACE) {
-                END_ARG();
-            } else if (char_in == ESCAPE) {
-                state = SS_ARG_ESCAPED;
-            } else {
-                char_out = char_in;
+            /* need to output anything? */
+            if (char_out >= 0)
+            {
+                *out_ptr = char_out;
+                ++out_ptr;
             }
-            break;
         }
-        /* need to output anything? */
-        if (char_out >= 0) {
-            *out_ptr = char_out;
-            ++out_ptr;
+        /* make sure the final argument is terminated */
+        *out_ptr = 0;
+        /* finalize the last argument */
+        if (state != SS_SPACE && argc < argv_size - 1)
+        {
+            argv[argc++] = next_arg_start;
         }
-    }
-    /* make sure the final argument is terminated */
-    *out_ptr = 0;
-    /* finalize the last argument */
-    if (state != SS_SPACE && argc < argv_size - 1) {
-        argv[argc++] = next_arg_start;
-    }
-    /* add a NULL at the end of argv */
-    argv[argc] = NULL;
+        /* add a NULL at the end of argv */
+        argv[argc] = NULL;
 
-    return argc;
-}
+        return argc;
+    }
 
-} // namespace bs
+}  // namespace protocol
 
-} // namespace protocol
+}  // namespace bs
 
-#endif //BS_ARGS_H
+#endif  //BS_ARGS_H
diff --git a/tests/device/libraries/BSTest/src/BSProtocol.h b/tests/device/libraries/BSTest/src/BSProtocol.h
index 05a874f956..7c4d064d9c 100644
--- a/tests/device/libraries/BSTest/src/BSProtocol.h
+++ b/tests/device/libraries/BSTest/src/BSProtocol.h
@@ -11,108 +11,117 @@ namespace bs
 {
 namespace protocol
 {
-template<typename IO>
-void output_test_start(IO& io, const char* file, size_t line, const char* name, const char* desc)
-{
-    io.printf(BS_LINE_PREFIX "start file=\"%s\" line=%d name=\"%s\" desc=\"%s\"\n", file, line, name, desc);
-}
-
-template<typename IO>
-void output_check_failure(IO& io, size_t line)
-{
-    io.printf(BS_LINE_PREFIX "check_failure line=%d\n", line);
-}
-
-template<typename IO>
-void output_test_end(IO& io, bool success, size_t checks, size_t failed_checks, size_t line=0)
-{
-    io.printf(BS_LINE_PREFIX "end line=%d result=%d checks=%d failed_checks=%d\n", line, success, checks, failed_checks);
-}
+    template <typename IO>
+    void output_test_start(IO& io, const char* file, size_t line, const char* name, const char* desc)
+    {
+        io.printf(BS_LINE_PREFIX "start file=\"%s\" line=%d name=\"%s\" desc=\"%s\"\n", file, line, name, desc);
+    }
 
-template<typename IO>
-void output_menu_begin(IO& io)
-{
-    io.printf(BS_LINE_PREFIX "menu_begin\n");
-}
+    template <typename IO>
+    void output_check_failure(IO& io, size_t line)
+    {
+        io.printf(BS_LINE_PREFIX "check_failure line=%d\n", line);
+    }
 
-template<typename IO>
-void output_menu_item(IO& io, int index, const char* name, const char* desc)
-{
-    io.printf(BS_LINE_PREFIX "item id=%d name=\"%s\" desc=\"%s\"\n", index, name, desc);
-}
+    template <typename IO>
+    void output_test_end(IO& io, bool success, size_t checks, size_t failed_checks, size_t line = 0)
+    {
+        io.printf(BS_LINE_PREFIX "end line=%d result=%d checks=%d failed_checks=%d\n", line, success, checks, failed_checks);
+    }
 
-template<typename IO>
-void output_menu_end(IO& io)
-{
-    io.printf(BS_LINE_PREFIX "menu_end\n");
-}
+    template <typename IO>
+    void output_menu_begin(IO& io)
+    {
+        io.printf(BS_LINE_PREFIX "menu_begin\n");
+    }
 
-template<typename IO>
-void output_setenv_result(IO& io, const char* key, const char* value)
-{
-    io.printf(BS_LINE_PREFIX "setenv key=\"%s\" value=\"%s\"\n", key, value);
-}
+    template <typename IO>
+    void output_menu_item(IO& io, int index, const char* name, const char* desc)
+    {
+        io.printf(BS_LINE_PREFIX "item id=%d name=\"%s\" desc=\"%s\"\n", index, name, desc);
+    }
 
-template<typename IO>
-void output_getenv_result(IO& io, const char* key, const char* value)
-{
-    (void) key;
-    io.printf(BS_LINE_PREFIX "getenv value=\"%s\"\n", value);
-}
+    template <typename IO>
+    void output_menu_end(IO& io)
+    {
+        io.printf(BS_LINE_PREFIX "menu_end\n");
+    }
 
-template<typename IO>
-void output_pretest_result(IO& io, bool res)
-{
-    io.printf(BS_LINE_PREFIX "pretest result=%d\n", res?1:0);
-}
+    template <typename IO>
+    void output_setenv_result(IO& io, const char* key, const char* value)
+    {
+        io.printf(BS_LINE_PREFIX "setenv key=\"%s\" value=\"%s\"\n", key, value);
+    }
 
-template<typename IO>
-bool input_handle(IO& io, char* line_buf, size_t line_buf_size, int& test_num)
-{
-    int cb_read = io.read_line(line_buf, line_buf_size);
-    if (cb_read == 0 || line_buf[0] == '\n') {
-        return false;
+    template <typename IO>
+    void output_getenv_result(IO& io, const char* key, const char* value)
+    {
+        (void)key;
+        io.printf(BS_LINE_PREFIX "getenv value=\"%s\"\n", value);
     }
-    char* argv[4];
-    size_t argc = split_args(line_buf, argv, sizeof(argv)/sizeof(argv[0]));
-    if (argc == 0) {
-        return false;
+
+    template <typename IO>
+    void output_pretest_result(IO& io, bool res)
+    {
+        io.printf(BS_LINE_PREFIX "pretest result=%d\n", res ? 1 : 0);
     }
-    if (strcmp(argv[0], "setenv") == 0) {
-        if (argc != 3) {
+
+    template <typename IO>
+    bool input_handle(IO& io, char* line_buf, size_t line_buf_size, int& test_num)
+    {
+        int cb_read = io.read_line(line_buf, line_buf_size);
+        if (cb_read == 0 || line_buf[0] == '\n')
+        {
             return false;
         }
-        setenv(argv[1], argv[2], 1);
-        output_setenv_result(io, argv[1], argv[2]);
-        test_num = -1;
-        return false;   /* we didn't get the test number yet, so return false */
-    }
-    if (strcmp(argv[0], "getenv") == 0) {
-        if (argc != 2) {
+        char*  argv[4];
+        size_t argc = split_args(line_buf, argv, sizeof(argv) / sizeof(argv[0]));
+        if (argc == 0)
+        {
             return false;
         }
-        const char* value = getenv(argv[1]);
-        output_getenv_result(io, argv[1], (value != NULL) ? value : "");
-        return false;
-    }
-    if (strcmp(argv[0], "pretest") == 0) {
-        if (argc != 1) {
+        if (strcmp(argv[0], "setenv") == 0)
+        {
+            if (argc != 3)
+            {
+                return false;
+            }
+            setenv(argv[1], argv[2], 1);
+            output_setenv_result(io, argv[1], argv[2]);
+            test_num = -1;
+            return false; /* we didn't get the test number yet, so return false */
+        }
+        if (strcmp(argv[0], "getenv") == 0)
+        {
+            if (argc != 2)
+            {
+                return false;
+            }
+            const char* value = getenv(argv[1]);
+            output_getenv_result(io, argv[1], (value != NULL) ? value : "");
             return false;
         }
-        bool res = ::pretest();
-        output_pretest_result(io, res);
-        return false;
-    }
-    /* not one of the commands, try to parse as test number */
-    char* endptr;
-    test_num = (int) strtol(argv[0], &endptr, 10);
-    if (endptr != argv[0] + strlen(argv[0])) {
-        return false;
+        if (strcmp(argv[0], "pretest") == 0)
+        {
+            if (argc != 1)
+            {
+                return false;
+            }
+            bool res = ::pretest();
+            output_pretest_result(io, res);
+            return false;
+        }
+        /* not one of the commands, try to parse as test number */
+        char* endptr;
+        test_num = (int)strtol(argv[0], &endptr, 10);
+        if (endptr != argv[0] + strlen(argv[0]))
+        {
+            return false;
+        }
+        return true;
     }
-    return true;
-}
 
-} // ::protocol
-} // ::bs
+}  // namespace protocol
+}  // namespace bs
 
-#endif //BS_PROTOCOL_H
+#endif  //BS_PROTOCOL_H
diff --git a/tests/device/libraries/BSTest/src/BSStdio.h b/tests/device/libraries/BSTest/src/BSStdio.h
index 4d1bfb56f0..892ecaa9d4 100644
--- a/tests/device/libraries/BSTest/src/BSStdio.h
+++ b/tests/device/libraries/BSTest/src/BSStdio.h
@@ -13,7 +13,7 @@ class StdIOHelper
     {
     }
 
-    size_t printf(const char *format, ...)
+    size_t printf(const char* format, ...)
     {
         va_list arg;
         va_start(arg, format);
@@ -25,11 +25,13 @@ class StdIOHelper
     size_t read_line(char* dest, size_t dest_size)
     {
         char* res = fgets(dest, dest_size, stdin);
-        if (res == NULL) {
+        if (res == NULL)
+        {
             return 0;
         }
         size_t len = strlen(dest);
-        if (dest[len - 1] == '\n') {
+        if (dest[len - 1] == '\n')
+        {
             dest[len - 1] = 0;
             len--;
         }
@@ -39,10 +41,11 @@ class StdIOHelper
 
 typedef StdIOHelper IOHelper;
 
-inline void fatal() {
+inline void fatal()
+{
     throw std::runtime_error("fatal error");
 }
 
-} // namespace bs
+}  // namespace bs
 
-#endif //BS_STDIO_H
+#endif  //BS_STDIO_H
diff --git a/tests/device/libraries/BSTest/src/BSTest.h b/tests/device/libraries/BSTest/src/BSTest.h
index 11b4ee9f6e..5acf7dc22c 100644
--- a/tests/device/libraries/BSTest/src/BSTest.h
+++ b/tests/device/libraries/BSTest/src/BSTest.h
@@ -20,15 +20,16 @@
 
 namespace bs
 {
-typedef void(*test_case_func_t)();
+typedef void (*test_case_func_t)();
 
 class TestCase
 {
 public:
-    TestCase(TestCase* prev, test_case_func_t func, const char* file, size_t line, const char* name, const char* desc)
-        : m_func(func), m_file(file), m_line(line), m_name(name), m_desc(desc)
+    TestCase(TestCase* prev, test_case_func_t func, const char* file, size_t line, const char* name, const char* desc) :
+        m_func(func), m_file(file), m_line(line), m_name(name), m_desc(desc)
     {
-        if (prev) {
+        if (prev)
+        {
             prev->m_next = this;
         }
     }
@@ -60,63 +61,69 @@ class TestCase
 
     const char* desc() const
     {
-        return (m_desc)?m_desc:"";
+        return (m_desc) ? m_desc : "";
     }
 
 protected:
-    TestCase* m_next = nullptr;
+    TestCase*        m_next = nullptr;
     test_case_func_t m_func;
-    const char* m_file;
-    size_t m_line;
-    const char* m_name;
-    const char* m_desc;
+    const char*      m_file;
+    size_t           m_line;
+    const char*      m_name;
+    const char*      m_desc;
 };
 
-struct Registry {
+struct Registry
+{
     void add(test_case_func_t func, const char* file, size_t line, const char* name, const char* desc)
     {
         TestCase* tc = new TestCase(m_last, func, file, line, name, desc);
-        if (!m_first) {
+        if (!m_first)
+        {
             m_first = tc;
         }
         m_last = tc;
     }
     TestCase* m_first = nullptr;
-    TestCase* m_last = nullptr;
+    TestCase* m_last  = nullptr;
 };
 
-struct Env {
-    std::function<void(void)> m_check_pass;
+struct Env
+{
+    std::function<void(void)>   m_check_pass;
     std::function<void(size_t)> m_check_fail;
     std::function<void(size_t)> m_fail;
-    Registry m_registry;
+    Registry                    m_registry;
 };
 
 extern Env g_env;
 
-template<typename IO>
+template <typename IO>
 class Runner
 {
     typedef Runner<IO> Tself;
+
 public:
-    Runner(IO& io) : m_io(io)
+    Runner(IO& io) :
+        m_io(io)
     {
         g_env.m_check_pass = std::bind(&Tself::check_pass, this);
         g_env.m_check_fail = std::bind(&Tself::check_fail, this, std::placeholders::_1);
-        g_env.m_fail = std::bind(&Tself::fail, this, std::placeholders::_1);
+        g_env.m_fail       = std::bind(&Tself::fail, this, std::placeholders::_1);
     }
 
     ~Runner()
     {
         g_env.m_check_pass = 0;
         g_env.m_check_fail = 0;
-        g_env.m_fail = 0;
+        g_env.m_fail       = 0;
     }
 
     void run()
     {
-        do {
-        } while(do_menu());
+        do
+        {
+        } while (do_menu());
     }
 
     void check_pass()
@@ -141,22 +148,28 @@ class Runner
     {
         protocol::output_menu_begin(m_io);
         int id = 1;
-        for (TestCase* tc = g_env.m_registry.m_first; tc; tc = tc->next(), ++id) {
+        for (TestCase* tc = g_env.m_registry.m_first; tc; tc = tc->next(), ++id)
+        {
             protocol::output_menu_item(m_io, id, tc->name(), tc->desc());
         }
         protocol::output_menu_end(m_io);
-        while(true) {
-            int id;
+        while (true)
+        {
+            int  id;
             char line_buf[BS_LINE_BUF_SIZE];
-            if (!protocol::input_handle(m_io, line_buf, sizeof(line_buf), id)) {
+            if (!protocol::input_handle(m_io, line_buf, sizeof(line_buf), id))
+            {
                 continue;
             }
-            if (id < 0) {
+            if (id < 0)
+            {
                 return true;
             }
             TestCase* tc = g_env.m_registry.m_first;
-            for (int i = 0; i != id - 1 && tc; ++i, tc = tc->next());
-            if (!tc) {
+            for (int i = 0; i != id - 1 && tc; ++i, tc = tc->next())
+                ;
+            if (!tc)
+            {
                 bs::fatal();
             }
             m_check_pass_count = 0;
@@ -169,7 +182,7 @@ class Runner
     }
 
 protected:
-    IO& m_io;
+    IO&    m_io;
     size_t m_check_pass_count;
     size_t m_check_fail_count;
 };
@@ -185,39 +198,58 @@ class AutoReg
 
 inline void check(bool condition, size_t line)
 {
-    if (!condition) {
+    if (!condition)
+    {
         g_env.m_check_fail(line);
-    } else {
+    }
+    else
+    {
         g_env.m_check_pass();
     }
 }
 
 inline void require(bool condition, size_t line)
 {
-    if (!condition) {
+    if (!condition)
+    {
         g_env.m_check_fail(line);
         g_env.m_fail(line);
-    } else {
+    }
+    else
+    {
         g_env.m_check_pass();
     }
 }
 
-} // ::bs
+}  // namespace bs
 
-#define BS_NAME_LINE2( name, line ) name##line
-#define BS_NAME_LINE( name, line ) BS_NAME_LINE2( name, line )
-#define BS_UNIQUE_NAME( name ) BS_NAME_LINE( name, __LINE__ )
+#define BS_NAME_LINE2(name, line) name##line
+#define BS_NAME_LINE(name, line) BS_NAME_LINE2(name, line)
+#define BS_UNIQUE_NAME(name) BS_NAME_LINE(name, __LINE__)
 
-#define TEST_CASE( ... ) \
-    static void BS_UNIQUE_NAME( TEST_FUNC__ )(); \
-    namespace{ bs::AutoReg BS_UNIQUE_NAME( test_autoreg__ )( &BS_UNIQUE_NAME( TEST_FUNC__ ), __FILE__, __LINE__, __VA_ARGS__ ); }\
-    static void BS_UNIQUE_NAME(  TEST_FUNC__ )()
+#define TEST_CASE(...)                                                                                             \
+    static void BS_UNIQUE_NAME(TEST_FUNC__)();                                                                     \
+    namespace                                                                                                      \
+    {                                                                                                              \
+        bs::AutoReg BS_UNIQUE_NAME(test_autoreg__)(&BS_UNIQUE_NAME(TEST_FUNC__), __FILE__, __LINE__, __VA_ARGS__); \
+    }                                                                                                              \
+    static void BS_UNIQUE_NAME(TEST_FUNC__)()
 
 #define CHECK(condition) bs::check((condition), __LINE__)
 #define REQUIRE(condition) bs::require((condition), __LINE__)
 #define FAIL() bs::g_env.m_fail(__LINE__)
 
-#define BS_ENV_DECLARE() namespace bs { Env g_env; }
-#define BS_RUN(...) do { bs::IOHelper helper = bs::IOHelper(__VA_ARGS__); bs::Runner<bs::IOHelper> runner(helper); runner.run(); } while(0);
+#define BS_ENV_DECLARE() \
+    namespace bs         \
+    {                    \
+        Env g_env;       \
+    }
+#define BS_RUN(...)                                                  \
+    do                                                               \
+    {                                                                \
+        bs::IOHelper             helper = bs::IOHelper(__VA_ARGS__); \
+        bs::Runner<bs::IOHelper> runner(helper);                     \
+        runner.run();                                                \
+    } while (0);
 
-#endif //BSTEST_H
+#endif  //BSTEST_H
diff --git a/tests/device/libraries/BSTest/test/test.cpp b/tests/device/libraries/BSTest/test/test.cpp
index 863373e0de..553f8013be 100644
--- a/tests/device/libraries/BSTest/test/test.cpp
+++ b/tests/device/libraries/BSTest/test/test.cpp
@@ -3,21 +3,23 @@
 
 BS_ENV_DECLARE();
 
-
 int main()
 {
-    while(true) {
-        try{
+    while (true)
+    {
+        try
+        {
             BS_RUN();
             return 0;
-        }catch(...) {
+        }
+        catch (...)
+        {
             printf("Exception\n\n");
         }
     }
     return 1;
 }
 
-
 TEST_CASE("this test runs successfully", "[bluesmoke]")
 {
     CHECK(1 + 1 == 2);
@@ -38,16 +40,13 @@ TEST_CASE("another test which fails and crashes", "[bluesmoke][fail]")
     REQUIRE(false);
 }
 
-
 TEST_CASE("third test which should be skipped", "[.]")
 {
     FAIL();
 }
 
-
 TEST_CASE("this test also runs successfully", "[bluesmoke]")
 {
-
 }
 
 TEST_CASE("environment variables can be set and read from python", "[bluesmoke]")
@@ -57,4 +56,3 @@ TEST_CASE("environment variables can be set and read from python", "[bluesmoke]"
     CHECK(strcmp(res, "42") == 0);
     setenv("VAR_FROM_TEST", "24", 1);
 }
-
diff --git a/tests/device/test_libc/libm_string.c b/tests/device/test_libc/libm_string.c
index 17f29098cd..5ee879c11a 100644
--- a/tests/device/test_libc/libm_string.c
+++ b/tests/device/test_libc/libm_string.c
@@ -3,8 +3,6 @@
 #include <stdlib.h>
 #include <errno.h>
 
-
-
 #define memcmp memcmp_P
 #define memcpy memcpy_P
 #define memmem memmem_P
@@ -18,416 +16,408 @@
 #define strcmp strcmp_P
 #define strncmp strncmp_P
 
-
-_CONST char *it = "<UNSET>";	/* Routine name for message routines. */
-static int  errors = 0;
+_CONST char* it     = "<UNSET>"; /* Routine name for message routines. */
+static int   errors = 0;
 
 /* Complain if condition is not true.  */
 #define check(thing) checkit(thing, __LINE__)
 
 static void
-_DEFUN(checkit,(ok,l),
-       int ok _AND
-       int l )
+_DEFUN(checkit, (ok, l),
+       int ok _AND int l)
 
 {
-//  newfunc(it);
-//  line(l);
-  
-  if (!ok)
-  {
-    printf("string.c:%d %s\n", l, it);
-    ++errors;
-  }
-}
-
+    //  newfunc(it);
+    //  line(l);
 
+    if (!ok)
+    {
+        printf("string.c:%d %s\n", l, it);
+        ++errors;
+    }
+}
 
 /* Complain if first two args don't strcmp as equal.  */
-#define equal(a, b)  funcqual(a,b,__LINE__);
+#define equal(a, b) funcqual(a, b, __LINE__);
 
 static void
-_DEFUN(funcqual,(a,b,l),
-       char *a _AND
-       char *b _AND
-       int l)
+_DEFUN(funcqual, (a, b, l),
+       char* a _AND char* b _AND int l)
 {
-//  newfunc(it);
-  
-//  line(l);
-  if (a == NULL && b == NULL) return;
-  if (strcmp(a,b)) {
-      printf("string.c:%d (%s)\n", l, it);  
+    //  newfunc(it);
+
+    //  line(l);
+    if (a == NULL && b == NULL)
+        return;
+    if (strcmp(a, b))
+    {
+        printf("string.c:%d (%s)\n", l, it);
     }
 }
 
-
-
 static char one[50];
 static char two[50];
 
-
 void libm_test_string()
 {
-  /* Test strcmp first because we use it to test other things.  */
-  it = "strcmp";
-  check(strcmp("", "") == 0); /* Trivial case. */
-  check(strcmp("a", "a") == 0); /* Identity. */
-  check(strcmp("abc", "abc") == 0); /* Multicharacter. */
-  check(strcmp("abc", "abcd") < 0); /* Length mismatches. */
-  check(strcmp("abcd", "abc") > 0);
-  check(strcmp("abcd", "abce") < 0);	/* Honest miscompares. */
-  check(strcmp("abce", "abcd") > 0);
-  check(strcmp("a\103", "a") > 0); /* Tricky if char signed. */
-  check(strcmp("a\103", "a\003") > 0);
-
-  /* Test strcpy next because we need it to set up other tests.  */
-  it = "strcpy";
-  check(strcpy(one, "abcd") == one);	/* Returned value. */
-  equal(one, "abcd");	/* Basic test. */
-
-  (void) strcpy(one, "x");
-  equal(one, "x");		/* Writeover. */
-  equal(one+2, "cd");	/* Wrote too much? */
-
-  (void) strcpy(two, "hi there");
-  (void) strcpy(one, two);
-  equal(one, "hi there");	/* Basic test encore. */
-  equal(two, "hi there");	/* Stomped on source? */
-
-  (void) strcpy(one, "");
-  equal(one, "");		/* Boundary condition. */
-
-  /* strcat.  */
-  it = "strcat";
-  (void) strcpy(one, "ijk");
-  check(strcat(one, "lmn") == one); /* Returned value. */
-  equal(one, "ijklmn");	/* Basic test. */
-
-  (void) strcpy(one, "x");
-  (void) strcat(one, "yz");
-  equal(one, "xyz");		/* Writeover. */
-  equal(one+4, "mn");	/* Wrote too much? */
-
-  (void) strcpy(one, "gh");
-  (void) strcpy(two, "ef");
-  (void) strcat(one, two);
-  equal(one, "ghef");	/* Basic test encore. */
-  equal(two, "ef");		/* Stomped on source? */
-
-  (void) strcpy(one, "");
-  (void) strcat(one, "");
-  equal(one, "");		/* Boundary conditions. */
-  (void) strcpy(one, "ab");
-  (void) strcat(one, "");
-  equal(one, "ab");
-  (void) strcpy(one, "");
-  (void) strcat(one, "cd");
-  equal(one, "cd");
-
-  /* strncat - first test it as strcat, with big counts,
+    /* Test strcmp first because we use it to test other things.  */
+    it = "strcmp";
+    check(strcmp("", "") == 0);       /* Trivial case. */
+    check(strcmp("a", "a") == 0);     /* Identity. */
+    check(strcmp("abc", "abc") == 0); /* Multicharacter. */
+    check(strcmp("abc", "abcd") < 0); /* Length mismatches. */
+    check(strcmp("abcd", "abc") > 0);
+    check(strcmp("abcd", "abce") < 0); /* Honest miscompares. */
+    check(strcmp("abce", "abcd") > 0);
+    check(strcmp("a\103", "a") > 0); /* Tricky if char signed. */
+    check(strcmp("a\103", "a\003") > 0);
+
+    /* Test strcpy next because we need it to set up other tests.  */
+    it = "strcpy";
+    check(strcpy(one, "abcd") == one); /* Returned value. */
+    equal(one, "abcd");                /* Basic test. */
+
+    (void)strcpy(one, "x");
+    equal(one, "x");      /* Writeover. */
+    equal(one + 2, "cd"); /* Wrote too much? */
+
+    (void)strcpy(two, "hi there");
+    (void)strcpy(one, two);
+    equal(one, "hi there"); /* Basic test encore. */
+    equal(two, "hi there"); /* Stomped on source? */
+
+    (void)strcpy(one, "");
+    equal(one, ""); /* Boundary condition. */
+
+    /* strcat.  */
+    it = "strcat";
+    (void)strcpy(one, "ijk");
+    check(strcat(one, "lmn") == one); /* Returned value. */
+    equal(one, "ijklmn");             /* Basic test. */
+
+    (void)strcpy(one, "x");
+    (void)strcat(one, "yz");
+    equal(one, "xyz");    /* Writeover. */
+    equal(one + 4, "mn"); /* Wrote too much? */
+
+    (void)strcpy(one, "gh");
+    (void)strcpy(two, "ef");
+    (void)strcat(one, two);
+    equal(one, "ghef"); /* Basic test encore. */
+    equal(two, "ef");   /* Stomped on source? */
+
+    (void)strcpy(one, "");
+    (void)strcat(one, "");
+    equal(one, ""); /* Boundary conditions. */
+    (void)strcpy(one, "ab");
+    (void)strcat(one, "");
+    equal(one, "ab");
+    (void)strcpy(one, "");
+    (void)strcat(one, "cd");
+    equal(one, "cd");
+
+    /* strncat - first test it as strcat, with big counts,
      then test the count mechanism.  */
-  it = "strncat";
-  (void) strcpy(one, "ijk");
-  check(strncat(one, "lmn", 99) == one); /* Returned value. */
-  equal(one, "ijklmn");	/* Basic test. */
-
-  (void) strcpy(one, "x");
-  (void) strncat(one, "yz", 99);
-  equal(one, "xyz");		/* Writeover. */
-  equal(one+4, "mn");	/* Wrote too much? */
-
-  (void) strcpy(one, "gh");
-  (void) strcpy(two, "ef");
-  (void) strncat(one, two, 99);
-  equal(one, "ghef");	/* Basic test encore. */
-  equal(two, "ef");		/* Stomped on source? */
-
-  (void) strcpy(one, "");
-  (void) strncat(one, "", 99);
-  equal(one, "");		/* Boundary conditions. */
-  (void) strcpy(one, "ab");
-  (void) strncat(one, "", 99);
-  equal(one, "ab");
-  (void) strcpy(one, "");
-  (void) strncat(one, "cd", 99);
-  equal(one, "cd");
-
-  (void) strcpy(one, "ab");
-  (void) strncat(one, "cdef", 2);
-  equal(one, "abcd");	/* Count-limited. */
-
-  (void) strncat(one, "gh", 0);
-  equal(one, "abcd");	/* Zero count. */
-
-  (void) strncat(one, "gh", 2);
-  equal(one, "abcdgh");	/* Count _AND length equal. */
-  it = "strncmp";
-  /* strncmp - first test as strcmp with big counts";*/
-  check(strncmp("", "", 99) == 0); /* Trivial case. */
-  check(strncmp("a", "a", 99) == 0);	/* Identity. */
-  check(strncmp("abc", "abc", 99) == 0); /* Multicharacter. */
-  check(strncmp("abc", "abcd", 99) < 0); /* Length unequal. */
-  check(strncmp("abcd", "abc",99) > 0);
-  check(strncmp("abcd", "abce", 99) < 0); /* Honestly unequal. */
-  check(strncmp("abce", "abcd",99)>0);
-  check(strncmp("abce", "abcd", 3) == 0); /* Count limited. */
-  check(strncmp("abce", "abc", 3) == 0); /* Count == length. */
-  check(strncmp("abcd", "abce", 4) < 0); /* Nudging limit. */
-  check(strncmp("abc", "def", 0) == 0); /* Zero count. */
-
-  /* strncpy - testing is a bit different because of odd semantics.  */
-  it = "strncpy";
-  check(strncpy(one, "abc", 4) == one); /* Returned value. */
-  equal(one, "abc");		/* Did the copy go right? */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) strncpy(one, "xyz", 2);
-  equal(one, "xycdefgh");	/* Copy cut by count. */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) strncpy(one, "xyz", 3); /* Copy cut just before NUL. */
-  equal(one, "xyzdefgh");
-
-  (void) strcpy(one, "abcdefgh");
-  (void) strncpy(one, "xyz", 4); /* Copy just includes NUL. */
-  equal(one, "xyz");
-  equal(one+4, "efgh");	/* Wrote too much? */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) strncpy(one, "xyz", 5); /* Copy includes padding. */
-  equal(one, "xyz");
-  equal(one+4, "");
-  equal(one+5, "fgh");
-
-  (void) strcpy(one, "abc");
-  (void) strncpy(one, "xyz", 0); /* Zero-length copy. */
-  equal(one, "abc");	
-
-  (void) strncpy(one, "", 2);	/* Zero-length source. */
-  equal(one, "");
-  equal(one+1, "");	
-  equal(one+2, "c");
-
-  (void) strcpy(one, "hi there");
-  (void) strncpy(two, one, 9);
-  equal(two, "hi there");	/* Just paranoia. */
-  equal(one, "hi there");	/* Stomped on source? */
-
-  /* strlen.  */
-  it = "strlen";
-  check(strlen("") == 0);	/* Empty. */
-  check(strlen("a") == 1);	/* Single char. */
-  check(strlen("abcd") == 4); /* Multiple chars. */
-
-  /* strchr.  */
-  it = "strchr";
-  check(strchr("abcd", 'z') == NULL); /* Not found. */
-  (void) strcpy(one, "abcd");
-  check(strchr(one, 'c') == one+2); /* Basic test. */
-  check(strchr(one, 'd') == one+3); /* End of string. */
-  check(strchr(one, 'a') == one); /* Beginning. */
-  check(strchr(one, '\0') == one+4);	/* Finding NUL. */
-  (void) strcpy(one, "ababa");
-  check(strchr(one, 'b') == one+1); /* Finding first. */
-  (void) strcpy(one, "");
-  check(strchr(one, 'b') == NULL); /* Empty string. */
-  check(strchr(one, '\0') == one); /* NUL in empty string. */
-
-  /* index - just like strchr.  */
-  it = "index";
-  check(index("abcd", 'z') == NULL);	/* Not found. */
-  (void) strcpy(one, "abcd");
-  check(index(one, 'c') == one+2); /* Basic test. */
-  check(index(one, 'd') == one+3); /* End of string. */
-  check(index(one, 'a') == one); /* Beginning. */
-  check(index(one, '\0') == one+4); /* Finding NUL. */
-  (void) strcpy(one, "ababa");
-  check(index(one, 'b') == one+1); /* Finding first. */
-  (void) strcpy(one, "");
-  check(index(one, 'b') == NULL); /* Empty string. */
-  check(index(one, '\0') == one); /* NUL in empty string. */
-
-  /* strrchr.  */
-  it = "strrchr";
-  check(strrchr("abcd", 'z') == NULL); /* Not found. */
-  (void) strcpy(one, "abcd");
-  check(strrchr(one, 'c') == one+2);	/* Basic test. */
-  check(strrchr(one, 'd') == one+3);	/* End of string. */
-  check(strrchr(one, 'a') == one); /* Beginning. */
-  check(strrchr(one, '\0') == one+4); /* Finding NUL. */
-  (void) strcpy(one, "ababa");
-  check(strrchr(one, 'b') == one+3);	/* Finding last. */
-  (void) strcpy(one, "");
-  check(strrchr(one, 'b') == NULL); /* Empty string. */
-  check(strrchr(one, '\0') == one); /* NUL in empty string. */
-
-  /* rindex - just like strrchr.  */
-  it = "rindex";
-  check(rindex("abcd", 'z') == NULL); /* Not found. */
-  (void) strcpy(one, "abcd");
-  check(rindex(one, 'c') == one+2); /* Basic test. */
-  check(rindex(one, 'd') == one+3); /* End of string. */
-  check(rindex(one, 'a') == one); /* Beginning. */
-  check(rindex(one, '\0') == one+4);	/* Finding NUL. */
-  (void) strcpy(one, "ababa");
-  check(rindex(one, 'b') == one+3); /* Finding last. */
-  (void) strcpy(one, "");
-  check(rindex(one, 'b') == NULL); /* Empty string. */
-  check(rindex(one, '\0') == one); /* NUL in empty string. */
-
-  /* strpbrk - somewhat like strchr.  */
-  it = "strpbrk";
-  check(strpbrk("abcd", "z") == NULL); /* Not found. */
-  (void) strcpy(one, "abcd");
-  check(strpbrk(one, "c") == one+2);	/* Basic test. */
-  check(strpbrk(one, "d") == one+3);	/* End of string. */
-  check(strpbrk(one, "a") == one); /* Beginning. */
-  check(strpbrk(one, "") == NULL); /* Empty search list. */
-  check(strpbrk(one, "cb") == one+1); /* Multiple search. */
-  (void) strcpy(one, "abcabdea");
-  check(strpbrk(one, "b") == one+1);	/* Finding first. */
-  check(strpbrk(one, "cb") == one+1); /* With multiple search. */
-  check(strpbrk(one, "db") == one+1); /* Another variant. */
-  (void) strcpy(one, "");
-  check(strpbrk(one, "bc") == NULL); /* Empty string. */
-  check(strpbrk(one, "") == NULL); /* Both strings empty. */
-
-  /* strstr - somewhat like strchr.  */
-  it = "strstr";
-  check(strstr("z", "abcd") == NULL); /* Not found. */
-  check(strstr("abx", "abcd") == NULL); /* Dead end. */
-  (void) strcpy(one, "abcd");
-  check(strstr(one,"c") == one+2); /* Basic test. */
-  check(strstr(one, "bc") == one+1);	/* Multichar. */
-  check(strstr(one,"d") == one+3); /* End of string. */
-  check(strstr(one,"cd") == one+2);	/* Tail of string. */
-  check(strstr(one,"abc") == one); /* Beginning. */
-  check(strstr(one,"abcd") == one);	/* Exact match. */
-  check(strstr(one,"de") == NULL);	/* Past end. */
-  check(strstr(one,"") == one); /* Finding empty. */
-  (void) strcpy(one, "ababa");
-  check(strstr(one,"ba") == one+1); /* Finding first. */
-  (void) strcpy(one, "");
-  check(strstr(one, "b") == NULL); /* Empty string. */
-  check(strstr(one,"") == one); /* Empty in empty string. */
-  (void) strcpy(one, "bcbca");
-  check(strstr(one,"bca") == one+2); /* False start. */
-  (void) strcpy(one, "bbbcabbca");
-  check(strstr(one,"bbca") == one+1); /* With overlap. */
-
-  /* strspn.  */
-  it = "strspn";
-  check(strspn("abcba", "abc") == 5); /* Whole string. */
-  check(strspn("abcba", "ab") == 2);	/* Partial. */
-  check(strspn("abc", "qx") == 0); /* None. */
-  check(strspn("", "ab") == 0); /* Null string. */
-  check(strspn("abc", "") == 0); /* Null search list. */
-
-  /* strcspn.  */
-  it = "strcspn";
-  check(strcspn("abcba", "qx") == 5); /* Whole string. */
-  check(strcspn("abcba", "cx") == 2); /* Partial. */
-  check(strcspn("abc", "abc") == 0);	/* None. */
-  check(strcspn("", "ab") == 0); /* Null string. */
-  check(strcspn("abc", "") == 3); /* Null search list. */
-
-  /* strtok - the hard one.  */
-  it = "strtok";
-  (void) strcpy(one, "first, second, third");
-  equal(strtok(one, ", "), "first");	/* Basic test. */
-  equal(one, "first");
-  equal(strtok((char *)NULL, ", "), "second");
-  equal(strtok((char *)NULL, ", "), "third");
-  check(strtok((char *)NULL, ", ") == NULL);
-  (void) strcpy(one, ", first, ");
-  equal(strtok(one, ", "), "first");	/* Extra delims, 1 tok. */
-  check(strtok((char *)NULL, ", ") == NULL);
-  (void) strcpy(one, "1a, 1b; 2a, 2b");
-  equal(strtok(one, ", "), "1a"); /* Changing delim lists. */
-  equal(strtok((char *)NULL, "; "), "1b");
-  equal(strtok((char *)NULL, ", "), "2a");
-  (void) strcpy(two, "x-y");
-  equal(strtok(two, "-"), "x"); /* New string before done. */
-  equal(strtok((char *)NULL, "-"), "y");
-  check(strtok((char *)NULL, "-") == NULL);
-  (void) strcpy(one, "a,b, c,, ,d");
-  equal(strtok(one, ", "), "a"); /* Different separators. */
-  equal(strtok((char *)NULL, ", "), "b");
-  equal(strtok((char *)NULL, " ,"), "c"); /* Permute list too. */
-  equal(strtok((char *)NULL, " ,"), "d");
-  check(strtok((char *)NULL, ", ") == NULL);
-  check(strtok((char *)NULL, ", ") == NULL); /* Persistence. */
-  (void) strcpy(one, ", ");
-  check(strtok(one, ", ") == NULL);	/* No tokens. */
-  (void) strcpy(one, "");
-  check(strtok(one, ", ") == NULL);	/* Empty string. */
-  (void) strcpy(one, "abc");
-  equal(strtok(one, ", "), "abc"); /* No delimiters. */
-  check(strtok((char *)NULL, ", ") == NULL);
-  (void) strcpy(one, "abc");
-  equal(strtok(one, ""), "abc"); /* Empty delimiter list. */
-  check(strtok((char *)NULL, "") == NULL);
-  (void) strcpy(one, "abcdefgh");
-  (void) strcpy(one, "a,b,c");
-  equal(strtok(one, ","), "a"); /* Basics again... */
-  equal(strtok((char *)NULL, ","), "b");
-  equal(strtok((char *)NULL, ","), "c");
-  check(strtok((char *)NULL, ",") == NULL);
-  equal(one+6, "gh");	/* Stomped past end? */
-  equal(one, "a");		/* Stomped old tokens? */
-  equal(one+2, "b");
-  equal(one+4, "c");
-
-  /* memcmp.  */
-  it = "memcmp";
-  check(memcmp("a", "a", 1) == 0); /* Identity. */
-  check(memcmp("abc", "abc", 3) == 0); /* Multicharacter. */
-  check(memcmp("abcd", "abce", 4) < 0); /* Honestly unequal. */
-  check(memcmp("abce", "abcd",4));
-  check(memcmp("alph", "beta", 4) < 0);
-  check(memcmp("abce", "abcd", 3) == 0); /* Count limited. */
-  check(memcmp("abc", "def", 0) == 0); /* Zero count. */
-
-  /* memcmp should test strings as unsigned */
-  one[0] = 0xfe;
-  two[0] = 0x03;
-  check(memcmp(one, two,1) > 0);
-  
-  
-  /* memchr.  */
-  it = "memchr";
-  check(memchr("abcd", 'z', 4) == NULL); /* Not found. */
-  (void) strcpy(one, "abcd");
-  check(memchr(one, 'c', 4) == one+2); /* Basic test. */
-  check(memchr(one, 'd', 4) == one+3); /* End of string. */
-  check(memchr(one, 'a', 4) == one);	/* Beginning. */
-  check(memchr(one, '\0', 5) == one+4); /* Finding NUL. */
-  (void) strcpy(one, "ababa");
-  check(memchr(one, 'b', 5) == one+1); /* Finding first. */
-  check(memchr(one, 'b', 0) == NULL); /* Zero count. */
-  check(memchr(one, 'a', 1) == one);	/* Singleton case. */
-  (void) strcpy(one, "a\203b");
-  check(memchr(one, 0203, 3) == one+1); /* Unsignedness. */
-
-  /* memcpy - need not work for overlap.  */
-  it = "memcpy";
-  check(memcpy(one, "abc", 4) == one); /* Returned value. */
-  equal(one, "abc");		/* Did the copy go right? */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) memcpy(one+1, "xyz", 2);
-  equal(one, "axydefgh");	/* Basic test. */
-
-  (void) strcpy(one, "abc");
-  (void) memcpy(one, "xyz", 0);
-  equal(one, "abc");		/* Zero-length copy. */
-
-  (void) strcpy(one, "hi there");
-  (void) strcpy(two, "foo");
-  (void) memcpy(two, one, 9);
-  equal(two, "hi there");	/* Just paranoia. */
-  equal(one, "hi there");	/* Stomped on source? */
+    it = "strncat";
+    (void)strcpy(one, "ijk");
+    check(strncat(one, "lmn", 99) == one); /* Returned value. */
+    equal(one, "ijklmn");                  /* Basic test. */
+
+    (void)strcpy(one, "x");
+    (void)strncat(one, "yz", 99);
+    equal(one, "xyz");    /* Writeover. */
+    equal(one + 4, "mn"); /* Wrote too much? */
+
+    (void)strcpy(one, "gh");
+    (void)strcpy(two, "ef");
+    (void)strncat(one, two, 99);
+    equal(one, "ghef"); /* Basic test encore. */
+    equal(two, "ef");   /* Stomped on source? */
+
+    (void)strcpy(one, "");
+    (void)strncat(one, "", 99);
+    equal(one, ""); /* Boundary conditions. */
+    (void)strcpy(one, "ab");
+    (void)strncat(one, "", 99);
+    equal(one, "ab");
+    (void)strcpy(one, "");
+    (void)strncat(one, "cd", 99);
+    equal(one, "cd");
+
+    (void)strcpy(one, "ab");
+    (void)strncat(one, "cdef", 2);
+    equal(one, "abcd"); /* Count-limited. */
+
+    (void)strncat(one, "gh", 0);
+    equal(one, "abcd"); /* Zero count. */
+
+    (void)strncat(one, "gh", 2);
+    equal(one, "abcdgh"); /* Count _AND length equal. */
+    it = "strncmp";
+    /* strncmp - first test as strcmp with big counts";*/
+    check(strncmp("", "", 99) == 0);       /* Trivial case. */
+    check(strncmp("a", "a", 99) == 0);     /* Identity. */
+    check(strncmp("abc", "abc", 99) == 0); /* Multicharacter. */
+    check(strncmp("abc", "abcd", 99) < 0); /* Length unequal. */
+    check(strncmp("abcd", "abc", 99) > 0);
+    check(strncmp("abcd", "abce", 99) < 0); /* Honestly unequal. */
+    check(strncmp("abce", "abcd", 99) > 0);
+    check(strncmp("abce", "abcd", 3) == 0); /* Count limited. */
+    check(strncmp("abce", "abc", 3) == 0);  /* Count == length. */
+    check(strncmp("abcd", "abce", 4) < 0);  /* Nudging limit. */
+    check(strncmp("abc", "def", 0) == 0);   /* Zero count. */
+
+    /* strncpy - testing is a bit different because of odd semantics.  */
+    it = "strncpy";
+    check(strncpy(one, "abc", 4) == one); /* Returned value. */
+    equal(one, "abc");                    /* Did the copy go right? */
+
+    (void)strcpy(one, "abcdefgh");
+    (void)strncpy(one, "xyz", 2);
+    equal(one, "xycdefgh"); /* Copy cut by count. */
+
+    (void)strcpy(one, "abcdefgh");
+    (void)strncpy(one, "xyz", 3); /* Copy cut just before NUL. */
+    equal(one, "xyzdefgh");
+
+    (void)strcpy(one, "abcdefgh");
+    (void)strncpy(one, "xyz", 4); /* Copy just includes NUL. */
+    equal(one, "xyz");
+    equal(one + 4, "efgh"); /* Wrote too much? */
+
+    (void)strcpy(one, "abcdefgh");
+    (void)strncpy(one, "xyz", 5); /* Copy includes padding. */
+    equal(one, "xyz");
+    equal(one + 4, "");
+    equal(one + 5, "fgh");
+
+    (void)strcpy(one, "abc");
+    (void)strncpy(one, "xyz", 0); /* Zero-length copy. */
+    equal(one, "abc");
+
+    (void)strncpy(one, "", 2); /* Zero-length source. */
+    equal(one, "");
+    equal(one + 1, "");
+    equal(one + 2, "c");
+
+    (void)strcpy(one, "hi there");
+    (void)strncpy(two, one, 9);
+    equal(two, "hi there"); /* Just paranoia. */
+    equal(one, "hi there"); /* Stomped on source? */
+
+    /* strlen.  */
+    it = "strlen";
+    check(strlen("") == 0);     /* Empty. */
+    check(strlen("a") == 1);    /* Single char. */
+    check(strlen("abcd") == 4); /* Multiple chars. */
+
+    /* strchr.  */
+    it = "strchr";
+    check(strchr("abcd", 'z') == NULL); /* Not found. */
+    (void)strcpy(one, "abcd");
+    check(strchr(one, 'c') == one + 2);  /* Basic test. */
+    check(strchr(one, 'd') == one + 3);  /* End of string. */
+    check(strchr(one, 'a') == one);      /* Beginning. */
+    check(strchr(one, '\0') == one + 4); /* Finding NUL. */
+    (void)strcpy(one, "ababa");
+    check(strchr(one, 'b') == one + 1); /* Finding first. */
+    (void)strcpy(one, "");
+    check(strchr(one, 'b') == NULL); /* Empty string. */
+    check(strchr(one, '\0') == one); /* NUL in empty string. */
+
+    /* index - just like strchr.  */
+    it = "index";
+    check(index("abcd", 'z') == NULL); /* Not found. */
+    (void)strcpy(one, "abcd");
+    check(index(one, 'c') == one + 2);  /* Basic test. */
+    check(index(one, 'd') == one + 3);  /* End of string. */
+    check(index(one, 'a') == one);      /* Beginning. */
+    check(index(one, '\0') == one + 4); /* Finding NUL. */
+    (void)strcpy(one, "ababa");
+    check(index(one, 'b') == one + 1); /* Finding first. */
+    (void)strcpy(one, "");
+    check(index(one, 'b') == NULL); /* Empty string. */
+    check(index(one, '\0') == one); /* NUL in empty string. */
+
+    /* strrchr.  */
+    it = "strrchr";
+    check(strrchr("abcd", 'z') == NULL); /* Not found. */
+    (void)strcpy(one, "abcd");
+    check(strrchr(one, 'c') == one + 2);  /* Basic test. */
+    check(strrchr(one, 'd') == one + 3);  /* End of string. */
+    check(strrchr(one, 'a') == one);      /* Beginning. */
+    check(strrchr(one, '\0') == one + 4); /* Finding NUL. */
+    (void)strcpy(one, "ababa");
+    check(strrchr(one, 'b') == one + 3); /* Finding last. */
+    (void)strcpy(one, "");
+    check(strrchr(one, 'b') == NULL); /* Empty string. */
+    check(strrchr(one, '\0') == one); /* NUL in empty string. */
+
+    /* rindex - just like strrchr.  */
+    it = "rindex";
+    check(rindex("abcd", 'z') == NULL); /* Not found. */
+    (void)strcpy(one, "abcd");
+    check(rindex(one, 'c') == one + 2);  /* Basic test. */
+    check(rindex(one, 'd') == one + 3);  /* End of string. */
+    check(rindex(one, 'a') == one);      /* Beginning. */
+    check(rindex(one, '\0') == one + 4); /* Finding NUL. */
+    (void)strcpy(one, "ababa");
+    check(rindex(one, 'b') == one + 3); /* Finding last. */
+    (void)strcpy(one, "");
+    check(rindex(one, 'b') == NULL); /* Empty string. */
+    check(rindex(one, '\0') == one); /* NUL in empty string. */
+
+    /* strpbrk - somewhat like strchr.  */
+    it = "strpbrk";
+    check(strpbrk("abcd", "z") == NULL); /* Not found. */
+    (void)strcpy(one, "abcd");
+    check(strpbrk(one, "c") == one + 2);  /* Basic test. */
+    check(strpbrk(one, "d") == one + 3);  /* End of string. */
+    check(strpbrk(one, "a") == one);      /* Beginning. */
+    check(strpbrk(one, "") == NULL);      /* Empty search list. */
+    check(strpbrk(one, "cb") == one + 1); /* Multiple search. */
+    (void)strcpy(one, "abcabdea");
+    check(strpbrk(one, "b") == one + 1);  /* Finding first. */
+    check(strpbrk(one, "cb") == one + 1); /* With multiple search. */
+    check(strpbrk(one, "db") == one + 1); /* Another variant. */
+    (void)strcpy(one, "");
+    check(strpbrk(one, "bc") == NULL); /* Empty string. */
+    check(strpbrk(one, "") == NULL);   /* Both strings empty. */
+
+    /* strstr - somewhat like strchr.  */
+    it = "strstr";
+    check(strstr("z", "abcd") == NULL);   /* Not found. */
+    check(strstr("abx", "abcd") == NULL); /* Dead end. */
+    (void)strcpy(one, "abcd");
+    check(strstr(one, "c") == one + 2);  /* Basic test. */
+    check(strstr(one, "bc") == one + 1); /* Multichar. */
+    check(strstr(one, "d") == one + 3);  /* End of string. */
+    check(strstr(one, "cd") == one + 2); /* Tail of string. */
+    check(strstr(one, "abc") == one);    /* Beginning. */
+    check(strstr(one, "abcd") == one);   /* Exact match. */
+    check(strstr(one, "de") == NULL);    /* Past end. */
+    check(strstr(one, "") == one);       /* Finding empty. */
+    (void)strcpy(one, "ababa");
+    check(strstr(one, "ba") == one + 1); /* Finding first. */
+    (void)strcpy(one, "");
+    check(strstr(one, "b") == NULL); /* Empty string. */
+    check(strstr(one, "") == one);   /* Empty in empty string. */
+    (void)strcpy(one, "bcbca");
+    check(strstr(one, "bca") == one + 2); /* False start. */
+    (void)strcpy(one, "bbbcabbca");
+    check(strstr(one, "bbca") == one + 1); /* With overlap. */
+
+    /* strspn.  */
+    it = "strspn";
+    check(strspn("abcba", "abc") == 5); /* Whole string. */
+    check(strspn("abcba", "ab") == 2);  /* Partial. */
+    check(strspn("abc", "qx") == 0);    /* None. */
+    check(strspn("", "ab") == 0);       /* Null string. */
+    check(strspn("abc", "") == 0);      /* Null search list. */
+
+    /* strcspn.  */
+    it = "strcspn";
+    check(strcspn("abcba", "qx") == 5); /* Whole string. */
+    check(strcspn("abcba", "cx") == 2); /* Partial. */
+    check(strcspn("abc", "abc") == 0);  /* None. */
+    check(strcspn("", "ab") == 0);      /* Null string. */
+    check(strcspn("abc", "") == 3);     /* Null search list. */
+
+    /* strtok - the hard one.  */
+    it = "strtok";
+    (void)strcpy(one, "first, second, third");
+    equal(strtok(one, ", "), "first"); /* Basic test. */
+    equal(one, "first");
+    equal(strtok((char*)NULL, ", "), "second");
+    equal(strtok((char*)NULL, ", "), "third");
+    check(strtok((char*)NULL, ", ") == NULL);
+    (void)strcpy(one, ", first, ");
+    equal(strtok(one, ", "), "first"); /* Extra delims, 1 tok. */
+    check(strtok((char*)NULL, ", ") == NULL);
+    (void)strcpy(one, "1a, 1b; 2a, 2b");
+    equal(strtok(one, ", "), "1a"); /* Changing delim lists. */
+    equal(strtok((char*)NULL, "; "), "1b");
+    equal(strtok((char*)NULL, ", "), "2a");
+    (void)strcpy(two, "x-y");
+    equal(strtok(two, "-"), "x"); /* New string before done. */
+    equal(strtok((char*)NULL, "-"), "y");
+    check(strtok((char*)NULL, "-") == NULL);
+    (void)strcpy(one, "a,b, c,, ,d");
+    equal(strtok(one, ", "), "a"); /* Different separators. */
+    equal(strtok((char*)NULL, ", "), "b");
+    equal(strtok((char*)NULL, " ,"), "c"); /* Permute list too. */
+    equal(strtok((char*)NULL, " ,"), "d");
+    check(strtok((char*)NULL, ", ") == NULL);
+    check(strtok((char*)NULL, ", ") == NULL); /* Persistence. */
+    (void)strcpy(one, ", ");
+    check(strtok(one, ", ") == NULL); /* No tokens. */
+    (void)strcpy(one, "");
+    check(strtok(one, ", ") == NULL); /* Empty string. */
+    (void)strcpy(one, "abc");
+    equal(strtok(one, ", "), "abc"); /* No delimiters. */
+    check(strtok((char*)NULL, ", ") == NULL);
+    (void)strcpy(one, "abc");
+    equal(strtok(one, ""), "abc"); /* Empty delimiter list. */
+    check(strtok((char*)NULL, "") == NULL);
+    (void)strcpy(one, "abcdefgh");
+    (void)strcpy(one, "a,b,c");
+    equal(strtok(one, ","), "a"); /* Basics again... */
+    equal(strtok((char*)NULL, ","), "b");
+    equal(strtok((char*)NULL, ","), "c");
+    check(strtok((char*)NULL, ",") == NULL);
+    equal(one + 6, "gh"); /* Stomped past end? */
+    equal(one, "a");      /* Stomped old tokens? */
+    equal(one + 2, "b");
+    equal(one + 4, "c");
+
+    /* memcmp.  */
+    it = "memcmp";
+    check(memcmp("a", "a", 1) == 0);      /* Identity. */
+    check(memcmp("abc", "abc", 3) == 0);  /* Multicharacter. */
+    check(memcmp("abcd", "abce", 4) < 0); /* Honestly unequal. */
+    check(memcmp("abce", "abcd", 4));
+    check(memcmp("alph", "beta", 4) < 0);
+    check(memcmp("abce", "abcd", 3) == 0); /* Count limited. */
+    check(memcmp("abc", "def", 0) == 0);   /* Zero count. */
+
+    /* memcmp should test strings as unsigned */
+    one[0] = 0xfe;
+    two[0] = 0x03;
+    check(memcmp(one, two, 1) > 0);
+
+    /* memchr.  */
+    it = "memchr";
+    check(memchr("abcd", 'z', 4) == NULL); /* Not found. */
+    (void)strcpy(one, "abcd");
+    check(memchr(one, 'c', 4) == one + 2);  /* Basic test. */
+    check(memchr(one, 'd', 4) == one + 3);  /* End of string. */
+    check(memchr(one, 'a', 4) == one);      /* Beginning. */
+    check(memchr(one, '\0', 5) == one + 4); /* Finding NUL. */
+    (void)strcpy(one, "ababa");
+    check(memchr(one, 'b', 5) == one + 1); /* Finding first. */
+    check(memchr(one, 'b', 0) == NULL);    /* Zero count. */
+    check(memchr(one, 'a', 1) == one);     /* Singleton case. */
+    (void)strcpy(one, "a\203b");
+    check(memchr(one, 0203, 3) == one + 1); /* Unsignedness. */
+
+    /* memcpy - need not work for overlap.  */
+    it = "memcpy";
+    check(memcpy(one, "abc", 4) == one); /* Returned value. */
+    equal(one, "abc");                   /* Did the copy go right? */
+
+    (void)strcpy(one, "abcdefgh");
+    (void)memcpy(one + 1, "xyz", 2);
+    equal(one, "axydefgh"); /* Basic test. */
+
+    (void)strcpy(one, "abc");
+    (void)memcpy(one, "xyz", 0);
+    equal(one, "abc"); /* Zero-length copy. */
+
+    (void)strcpy(one, "hi there");
+    (void)strcpy(two, "foo");
+    (void)memcpy(two, one, 9);
+    equal(two, "hi there"); /* Just paranoia. */
+    equal(one, "hi there"); /* Stomped on source? */
 #if 0
   /* memmove - must work on overlap.  */
   it = "memmove";
@@ -499,68 +489,69 @@ void libm_test_string()
   check(memccpy(two, one, 'x', 1) == two+1); /* Singleton. */
   equal(two, "xbcdlebee");
 #endif
-  /* memset.  */
-  it = "memset";
-  (void) strcpy(one, "abcdefgh");
-  check(memset(one+1, 'x', 3) == one+1); /* Return value. */
-  equal(one, "axxxefgh");	/* Basic test. */
+    /* memset.  */
+    it = "memset";
+    (void)strcpy(one, "abcdefgh");
+    check(memset(one + 1, 'x', 3) == one + 1); /* Return value. */
+    equal(one, "axxxefgh");                    /* Basic test. */
 
-  (void) memset(one+2, 'y', 0);
-  equal(one, "axxxefgh");	/* Zero-length set. */
+    (void)memset(one + 2, 'y', 0);
+    equal(one, "axxxefgh"); /* Zero-length set. */
 
-  (void) memset(one+5, 0, 1);
-  equal(one, "axxxe");	/* Zero fill. */
-  equal(one+6, "gh");	/* _AND the leftover. */
+    (void)memset(one + 5, 0, 1);
+    equal(one, "axxxe");  /* Zero fill. */
+    equal(one + 6, "gh"); /* _AND the leftover. */
 
-  (void) memset(one+2, 010045, 1);
-  equal(one, "ax\045xe");	/* Unsigned char convert. */
+    (void)memset(one + 2, 010045, 1);
+    equal(one, "ax\045xe"); /* Unsigned char convert. */
 
-  /* bcopy - much like memcpy.
+    /* bcopy - much like memcpy.
      Berklix manual is silent about overlap, so don't test it.  */
-  it = "bcopy";
-  (void) bcopy("abc", one, 4);
-  equal(one, "abc");		/* Simple copy. */
-
-  (void) strcpy(one, "abcdefgh");
-  (void) bcopy("xyz", one+1, 2);
-  equal(one, "axydefgh");	/* Basic test. */
-
-  (void) strcpy(one, "abc");
-  (void) bcopy("xyz", one, 0);
-  equal(one, "abc");		/* Zero-length copy. */
-
-  (void) strcpy(one, "hi there");
-  (void) strcpy(two, "foo");
-  (void) bcopy(one, two, 9);
-  equal(two, "hi there");	/* Just paranoia. */
-  equal(one, "hi there");	/* Stomped on source? */
-
-  /* bzero.  */
-  it = "bzero";
-  (void) strcpy(one, "abcdef");
-  bzero(one+2, 2);
-  equal(one, "ab");		/* Basic test. */
-  equal(one+3, "");
-  equal(one+4, "ef");
-
-  (void) strcpy(one, "abcdef");
-  bzero(one+2, 0);
-  equal(one, "abcdef");	/* Zero-length copy. */
-
-  /* bcmp - somewhat like memcmp.  */
-  it = "bcmp";
-  check(bcmp("a", "a", 1) == 0); /* Identity. */
-  check(bcmp("abc", "abc", 3) == 0);	/* Multicharacter. */
-  check(bcmp("abcd", "abce", 4) != 0); /* Honestly unequal. */
-  check(bcmp("abce", "abcd",4));
-  check(bcmp("alph", "beta", 4) != 0);
-  check(bcmp("abce", "abcd", 3) == 0); /* Count limited. */
-  check(bcmp("abc", "def", 0) == 0);	/* Zero count. */
-
-  if (errors) abort();
-  printf("ok\n");
-
-#if 0  /* strerror - VERY system-dependent.  */
+    it = "bcopy";
+    (void)bcopy("abc", one, 4);
+    equal(one, "abc"); /* Simple copy. */
+
+    (void)strcpy(one, "abcdefgh");
+    (void)bcopy("xyz", one + 1, 2);
+    equal(one, "axydefgh"); /* Basic test. */
+
+    (void)strcpy(one, "abc");
+    (void)bcopy("xyz", one, 0);
+    equal(one, "abc"); /* Zero-length copy. */
+
+    (void)strcpy(one, "hi there");
+    (void)strcpy(two, "foo");
+    (void)bcopy(one, two, 9);
+    equal(two, "hi there"); /* Just paranoia. */
+    equal(one, "hi there"); /* Stomped on source? */
+
+    /* bzero.  */
+    it = "bzero";
+    (void)strcpy(one, "abcdef");
+    bzero(one + 2, 2);
+    equal(one, "ab"); /* Basic test. */
+    equal(one + 3, "");
+    equal(one + 4, "ef");
+
+    (void)strcpy(one, "abcdef");
+    bzero(one + 2, 0);
+    equal(one, "abcdef"); /* Zero-length copy. */
+
+    /* bcmp - somewhat like memcmp.  */
+    it = "bcmp";
+    check(bcmp("a", "a", 1) == 0);       /* Identity. */
+    check(bcmp("abc", "abc", 3) == 0);   /* Multicharacter. */
+    check(bcmp("abcd", "abce", 4) != 0); /* Honestly unequal. */
+    check(bcmp("abce", "abcd", 4));
+    check(bcmp("alph", "beta", 4) != 0);
+    check(bcmp("abce", "abcd", 3) == 0); /* Count limited. */
+    check(bcmp("abc", "def", 0) == 0);   /* Zero count. */
+
+    if (errors)
+        abort();
+    printf("ok\n");
+
+#if 0 /* strerror - VERY system-dependent.  */
 {
   extern CONST unsigned int _sys_nerr;
   extern CONST char *CONST _sys_errlist[];
@@ -572,4 +563,3 @@ void libm_test_string()
 }
 #endif
 }
-
diff --git a/tests/device/test_libc/memcpy-1.c b/tests/device/test_libc/memcpy-1.c
index 2485af0923..a7fb9e9169 100644
--- a/tests/device/test_libc/memcpy-1.c
+++ b/tests/device/test_libc/memcpy-1.c
@@ -31,7 +31,6 @@
 #include <stdio.h>
 #include <stdarg.h>
 
-
 #define memcmp memcmp_P
 #define memcpy memcpy_P
 #define memmem memmem_P
@@ -70,105 +69,105 @@
 static int errors = 0;
 
 static void
-print_error (char const* msg, ...)
-{   
-  errors++;
-  if (errors == TOO_MANY_ERRORS)
+print_error(char const* msg, ...)
+{
+    errors++;
+    if (errors == TOO_MANY_ERRORS)
     {
-      fprintf (stderr, "Too many errors.\n");
+        fprintf(stderr, "Too many errors.\n");
     }
-  else if (errors < TOO_MANY_ERRORS)
+    else if (errors < TOO_MANY_ERRORS)
     {
-      va_list ap;
-      va_start (ap, msg);
-      vfprintf (stderr, msg, ap);
-      va_end (ap);
+        va_list ap;
+        va_start(ap, msg);
+        vfprintf(stderr, msg, ap);
+        va_end(ap);
     }
-  else
+    else
     {
-      /* Further errors omitted.  */
+        /* Further errors omitted.  */
     }
 }
 
 extern int rand_seed;
-void memcpy_main(void)
+void       memcpy_main(void)
 {
-  /* Allocate buffers to read and write from.  */
-  char src[BUFF_SIZE], dest[BUFF_SIZE], backup_src[BUFF_SIZE];
-
-  /* Fill the source buffer with non-null values, reproducible random data. */
-  srand (rand_seed);
-  int i, j;
-  unsigned sa;
-  unsigned da;
-  unsigned n;
-  for (i = 0; i < BUFF_SIZE; i++)
+    /* Allocate buffers to read and write from.  */
+    char src[BUFF_SIZE], dest[BUFF_SIZE], backup_src[BUFF_SIZE];
+
+    /* Fill the source buffer with non-null values, reproducible random data. */
+    srand(rand_seed);
+    int      i, j;
+    unsigned sa;
+    unsigned da;
+    unsigned n;
+    for (i = 0; i < BUFF_SIZE; i++)
     {
-      src[i] = (char)rand () | 1;
-      backup_src[i] = src[i];
+        src[i]        = (char)rand() | 1;
+        backup_src[i] = src[i];
     }
 
-  /* Make calls to memcpy with block sizes ranging between 1 and
+    /* Make calls to memcpy with block sizes ranging between 1 and
      MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
-  for (sa = 0; sa <= MAX_OFFSET; sa++)
-    for (da = 0; da <= MAX_OFFSET; da++)
-      for (n = 1; n <= MAX_BLOCK_SIZE; n++)
-        {
-          //printf (".");
-          /* Zero dest so we can check it properly after the copying.  */
-          for (j = 0; j < BUFF_SIZE; j++)
-            dest[j] = 0;
-          
-          void *ret = memcpy (dest + START_COPY + da, src + sa, n);
-          
-          /* Check return value.  */
-          if (ret != (dest + START_COPY + da))
-            print_error ("\nFailed: wrong return value in memcpy of %u bytes "
-                         "with src_align %u and dst_align %u. "
-                         "Return value and dest should be the same"
-                         "(ret is %p, dest is %p)\n",
-                         n, sa, da, ret, dest + START_COPY + da);
-          
-          /* Check that content of the destination buffer
+    for (sa = 0; sa <= MAX_OFFSET; sa++)
+        for (da = 0; da <= MAX_OFFSET; da++)
+            for (n = 1; n <= MAX_BLOCK_SIZE; n++)
+            {
+                //printf (".");
+                /* Zero dest so we can check it properly after the copying.  */
+                for (j = 0; j < BUFF_SIZE; j++)
+                    dest[j] = 0;
+
+                void* ret = memcpy(dest + START_COPY + da, src + sa, n);
+
+                /* Check return value.  */
+                if (ret != (dest + START_COPY + da))
+                    print_error("\nFailed: wrong return value in memcpy of %u bytes "
+                                "with src_align %u and dst_align %u. "
+                                "Return value and dest should be the same"
+                                "(ret is %p, dest is %p)\n",
+                                n, sa, da, ret, dest + START_COPY + da);
+
+                /* Check that content of the destination buffer
              is the same as the source buffer, and
              memory outside destination buffer is not modified.  */
-          for (j = 0; j < BUFF_SIZE; j++)
-            if ((unsigned)j < START_COPY + da)
-              {
-                if (dest[j] != 0)
-                  print_error ("\nFailed: after memcpy of %u bytes "
-                               "with src_align %u and dst_align %u, "
-                               "byte %u before the start of dest is not 0.\n",
-                               n, sa, da, START_COPY - j);
-              }
-            else if ((unsigned)j < START_COPY + da + n)
-              {
-                i = j - START_COPY - da;
-                if (dest[j] != (src + sa)[i])
-                  print_error ("\nFailed: after memcpy of %u bytes "
-                               "with src_align %u and dst_align %u, "
-                               "byte %u in dest and src are not the same.\n",
-                               n, sa, da, i);
-              }
-            else if (dest[j] != 0)
-              {
-                print_error ("\nFailed: after memcpy of %u bytes "
-                             "with src_align %u and dst_align %u, "
-                             "byte %u after the end of dest is not 0.\n",
-                             n, sa, da, j - START_COPY - da - n);
-              }
-
-          /* Check src is not modified.  */
-          for (j = 0; j < BUFF_SIZE; j++)
-            if (src[i] != backup_src[i])
-              print_error ("\nFailed: after memcpy of %u bytes "
-                           "with src_align %u and dst_align %u, "
-                           "byte %u of src is modified.\n",
-                           n, sa, da, j);
-        }
-
-  if (errors != 0)
-    abort ();
-
-  printf("ok\n");
+                for (j = 0; j < BUFF_SIZE; j++)
+                    if ((unsigned)j < START_COPY + da)
+                    {
+                        if (dest[j] != 0)
+                            print_error("\nFailed: after memcpy of %u bytes "
+                                        "with src_align %u and dst_align %u, "
+                                        "byte %u before the start of dest is not 0.\n",
+                                        n, sa, da, START_COPY - j);
+                    }
+                    else if ((unsigned)j < START_COPY + da + n)
+                    {
+                        i = j - START_COPY - da;
+                        if (dest[j] != (src + sa)[i])
+                            print_error("\nFailed: after memcpy of %u bytes "
+                                        "with src_align %u and dst_align %u, "
+                                        "byte %u in dest and src are not the same.\n",
+                                        n, sa, da, i);
+                    }
+                    else if (dest[j] != 0)
+                    {
+                        print_error("\nFailed: after memcpy of %u bytes "
+                                    "with src_align %u and dst_align %u, "
+                                    "byte %u after the end of dest is not 0.\n",
+                                    n, sa, da, j - START_COPY - da - n);
+                    }
+
+                /* Check src is not modified.  */
+                for (j = 0; j < BUFF_SIZE; j++)
+                    if (src[i] != backup_src[i])
+                        print_error("\nFailed: after memcpy of %u bytes "
+                                    "with src_align %u and dst_align %u, "
+                                    "byte %u of src is modified.\n",
+                                    n, sa, da, j);
+            }
+
+    if (errors != 0)
+        abort();
+
+    printf("ok\n");
 }
diff --git a/tests/device/test_libc/memmove1.c b/tests/device/test_libc/memmove1.c
index f64feae759..6fd2ceabef 100644
--- a/tests/device/test_libc/memmove1.c
+++ b/tests/device/test_libc/memmove1.c
@@ -55,140 +55,135 @@
 #define TOO_MANY_ERRORS 11
 int errors = 0;
 
-#define DEBUGP					\
- if (errors == TOO_MANY_ERRORS)			\
-   printf ("Further errors omitted\n");		\
- else if (errors < TOO_MANY_ERRORS)		\
-   printf
+#define DEBUGP                              \
+    if (errors == TOO_MANY_ERRORS)          \
+        printf("Further errors omitted\n"); \
+    else if (errors < TOO_MANY_ERRORS)      \
+    printf
 
 /* A safe target-independent memmove.  */
 
-void
-mymemmove (unsigned char *dest, unsigned char *src, size_t n)
+void mymemmove(unsigned char* dest, unsigned char* src, size_t n)
 {
-  if ((src <= dest && src + n <= dest)
-      || src >= dest)
-    while (n-- > 0)
-      *dest++ = *src++;
-  else
+    if ((src <= dest && src + n <= dest)
+        || src >= dest)
+        while (n-- > 0)
+            *dest++ = *src++;
+    else
     {
-      dest += n;
-      src += n;
-      while (n-- > 0)
-	*--dest = *--src;
+        dest += n;
+        src += n;
+        while (n-- > 0)
+            *--dest = *--src;
     }
 }
 
 /* It's either the noinline attribute or forcing the test framework to
    pass -fno-builtin-memmove.  */
-void
-xmemmove (unsigned char *dest, unsigned char *src, size_t n)
-     __attribute__ ((__noinline__));
+void xmemmove(unsigned char* dest, unsigned char* src, size_t n)
+    __attribute__((__noinline__));
 
-void
-xmemmove (unsigned char *dest, unsigned char *src, size_t n)
+void xmemmove(unsigned char* dest, unsigned char* src, size_t n)
 {
-  void *retp;
-  retp = memmove (dest, src, n);
+    void* retp;
+    retp = memmove(dest, src, n);
 
-  if (retp != dest)
+    if (retp != dest)
     {
-      errors++;
-      DEBUGP ("memmove of n bytes returned %p instead of dest=%p\n",
-	      retp, dest);
+        errors++;
+        DEBUGP("memmove of n bytes returned %p instead of dest=%p\n",
+               retp, dest);
     }
 }
 
-
 /* Fill the array with something we can associate with a position, but
    not exactly the same as the position index.  */
 
-void
-fill (unsigned char dest[MAX*3])
+void fill(unsigned char dest[MAX * 3])
 {
-  size_t i;
-  for (i = 0; i < MAX*3; i++)
-    dest[i] = (10 + i) % MAX;
+    size_t i;
+    for (i = 0; i < MAX * 3; i++)
+        dest[i] = (10 + i) % MAX;
 }
 
 void memmove_main(void)
 {
-  size_t i;
-  int errors = 0;
+    size_t i;
+    int    errors = 0;
 
-  /* Leave some room before and after the area tested, so we can detect
+    /* Leave some room before and after the area tested, so we can detect
      overwrites of up to N bytes, N being the amount tested.  If you
      want to test using valgrind, make these malloced instead.  */
-  unsigned char from_test[MAX*3];
-  unsigned char to_test[MAX*3];
-  unsigned char from_known[MAX*3];
-  unsigned char to_known[MAX*3];
+    unsigned char from_test[MAX * 3];
+    unsigned char to_test[MAX * 3];
+    unsigned char from_known[MAX * 3];
+    unsigned char to_known[MAX * 3];
 
-  /* Non-overlap.  */
-  for (i = 0; i < MAX; i++)
+    /* Non-overlap.  */
+    for (i = 0; i < MAX; i++)
     {
-      /* Do the memmove first before setting the known array, so we know
+        /* Do the memmove first before setting the known array, so we know
          it didn't change any of the known array.  */
-      fill (from_test);
-      fill (to_test);
-      xmemmove (to_test + MAX, 1 + from_test + MAX, i);
-
-      fill (from_known);
-      fill (to_known);
-      mymemmove (to_known + MAX, 1 + from_known + MAX, i);
-
-      if (memcmp (to_known, to_test, sizeof (to_known)) != 0)
-	{
-	  errors++;
-	  DEBUGP ("memmove failed non-overlap test for %d bytes\n", i);
-	}
+        fill(from_test);
+        fill(to_test);
+        xmemmove(to_test + MAX, 1 + from_test + MAX, i);
+
+        fill(from_known);
+        fill(to_known);
+        mymemmove(to_known + MAX, 1 + from_known + MAX, i);
+
+        if (memcmp(to_known, to_test, sizeof(to_known)) != 0)
+        {
+            errors++;
+            DEBUGP("memmove failed non-overlap test for %d bytes\n", i);
+        }
     }
 
-  /* Overlap-from-before.  */
-  for (i = 0; i < MAX; i++)
+    /* Overlap-from-before.  */
+    for (i = 0; i < MAX; i++)
     {
-      size_t j;
-      for (j = 0; j < i; j++)
-	{
-	  fill (to_test);
-	  xmemmove (to_test + MAX * 2 - i, to_test + MAX * 2 - i - j, i);
-
-	  fill (to_known);
-	  mymemmove (to_known + MAX * 2 - i, to_known + MAX * 2 - i - j, i);
-
-	  if (memcmp (to_known, to_test, sizeof (to_known)) != 0)
-	    {
-	      errors++;
-	      DEBUGP ("memmove failed for %d bytes,"
-		      " with src %d bytes before dest\n",
-		      i, j);
-	    }
-	}
+        size_t j;
+        for (j = 0; j < i; j++)
+        {
+            fill(to_test);
+            xmemmove(to_test + MAX * 2 - i, to_test + MAX * 2 - i - j, i);
+
+            fill(to_known);
+            mymemmove(to_known + MAX * 2 - i, to_known + MAX * 2 - i - j, i);
+
+            if (memcmp(to_known, to_test, sizeof(to_known)) != 0)
+            {
+                errors++;
+                DEBUGP("memmove failed for %d bytes,"
+                       " with src %d bytes before dest\n",
+                       i, j);
+            }
+        }
     }
 
-  /* Overlap-from-after.  */
-  for (i = 0; i < MAX; i++)
+    /* Overlap-from-after.  */
+    for (i = 0; i < MAX; i++)
     {
-      size_t j;
-      for (j = 0; j < i; j++)
-	{
-	  fill (to_test);
-	  xmemmove (to_test + MAX, to_test + MAX + j, i);
-
-	  fill (to_known);
-	  mymemmove (to_known + MAX, to_known + MAX + j, i);
-
-	  if (memcmp (to_known, to_test, sizeof (to_known)) != 0)
-	    {
-	      errors++;
-	      DEBUGP ("memmove failed when moving %d bytes,"
-		      " with src %d bytes after dest\n",
-		      i, j);
-	    }
-	}
+        size_t j;
+        for (j = 0; j < i; j++)
+        {
+            fill(to_test);
+            xmemmove(to_test + MAX, to_test + MAX + j, i);
+
+            fill(to_known);
+            mymemmove(to_known + MAX, to_known + MAX + j, i);
+
+            if (memcmp(to_known, to_test, sizeof(to_known)) != 0)
+            {
+                errors++;
+                DEBUGP("memmove failed when moving %d bytes,"
+                       " with src %d bytes after dest\n",
+                       i, j);
+            }
+        }
     }
 
-  if (errors != 0)
-    abort ();
-  printf("ok\n");
+    if (errors != 0)
+        abort();
+    printf("ok\n");
 }
diff --git a/tests/device/test_libc/strcmp-1.c b/tests/device/test_libc/strcmp-1.c
index 7c1883a085..d51e14b46c 100644
--- a/tests/device/test_libc/strcmp-1.c
+++ b/tests/device/test_libc/strcmp-1.c
@@ -46,7 +46,6 @@
 
 #define BUFF_SIZE 256
 
-
 /* The macro LONG_TEST controls whether a short or a more comprehensive test
    of strcmp should be performed.  */
 #ifdef LONG_TEST
@@ -106,186 +105,184 @@
 #error "Buffer overrun: MAX_OFFSET + MAX_BLOCK_SIZE + MAX_DIFF + MAX_LEN + MAX_ZEROS >= BUFF_SIZE."
 #endif
 
-
 #define TOO_MANY_ERRORS 11
 static int errors = 0;
 
-const char *testname = "strcmp";
+const char* testname = "strcmp";
 
 static void
-print_error (char const* msg, ...)
+print_error(char const* msg, ...)
 {
-  errors++;
-  if (errors == TOO_MANY_ERRORS)
+    errors++;
+    if (errors == TOO_MANY_ERRORS)
     {
-      fprintf (stderr, "Too many errors.\n");
+        fprintf(stderr, "Too many errors.\n");
     }
-  else if (errors < TOO_MANY_ERRORS)
+    else if (errors < TOO_MANY_ERRORS)
     {
-      va_list ap;
-      va_start (ap, msg);
-      vfprintf (stderr, msg, ap);
-      va_end (ap);
+        va_list ap;
+        va_start(ap, msg);
+        vfprintf(stderr, msg, ap);
+        va_end(ap);
     }
-  else
+    else
     {
-      /* Further errors omitted.  */
+        /* Further errors omitted.  */
     }
 }
 
-
 extern int rand_seed;
-void strcmp_main(void)
+void       strcmp_main(void)
 {
-  /* Allocate buffers to read and write from.  */
-  char src[BUFF_SIZE], dest[BUFF_SIZE];
-
-  /* Fill the source buffer with non-null values, reproducible random data. */
-  srand (rand_seed);
-  int i, j, zeros;
-  unsigned sa;
-  unsigned da;
-  unsigned n, m, len;
-  char *p;
-  int ret;
-
-  /* Make calls to strcmp with block sizes ranging between 1 and
+    /* Allocate buffers to read and write from.  */
+    char src[BUFF_SIZE], dest[BUFF_SIZE];
+
+    /* Fill the source buffer with non-null values, reproducible random data. */
+    srand(rand_seed);
+    int      i, j, zeros;
+    unsigned sa;
+    unsigned da;
+    unsigned n, m, len;
+    char*    p;
+    int      ret;
+
+    /* Make calls to strcmp with block sizes ranging between 1 and
      MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
-  for (sa = 0; sa <= MAX_OFFSET; sa++)
-    for (da = 0; da <= MAX_OFFSET; da++)
-      for (n = 1; n <= MAX_BLOCK_SIZE; n++)
-	{
-	for (m = 1;  m < n + MAX_DIFF; m++)
-	  for (len = 0; len < MAX_LEN; len++)
-	    for  (zeros = 1; zeros < MAX_ZEROS; zeros++)
-	    {
-	      if (n - m > MAX_DIFF)
-		continue;
-	      /* Make a copy of the source.  */
-	      for (i = 0; i < BUFF_SIZE; i++)
-		{
-		  src[i] = 'A' + (i % 26);
-		  dest[i] = src[i];
-		}
-   delay(0);
-	      memcpy (dest + da, src + sa, n);
-
-	      /* Make src 0-terminated.  */
-	      p = src + sa + n - 1;
-	      for (i = 0; i < zeros; i++)
-		{
-		  *p++ = '\0';
-		}
-
-	      /* Modify dest.  */
-	      p = dest + da + m - 1;
-	      for (j = 0; j < (int)len; j++)
-		*p++ = 'x';
-	      /* Make dest 0-terminated.  */
-	      *p = '\0';
-
-	      ret = strcmp (src + sa, dest + da);
-
-	      /* Check return value.  */
-	      if (n == m)
-		{
-		  if (len == 0)
-		    {
-		      if (ret != 0)
-			{
-			print_error ("\nFailed: after %s of %u bytes "
-				     "with src_align %u and dst_align %u, "
-				     "dest after %d bytes is modified for %d bytes, "
-				     "return value is %d, expected 0.\n",
-				     testname, n, sa, da, m, len, ret);
-			}
-		    }
-		  else
-		    {
-		      if (ret >= 0)
-			print_error ("\nFailed: after %s of %u bytes "
-				     "with src_align %u and dst_align %u, "
-				     "dest after %d bytes is modified for %d bytes, "
-				     "return value is %d, expected negative.\n",
-				     testname, n, sa, da, m, len, ret);
-		    }
-		}
-	      else if (m > n)
-		{
-		  if (ret >= 0)
-		    {
-		      print_error ("\nFailed: after %s of %u bytes "
-				   "with src_align %u and dst_align %u, "
-				   "dest after %d bytes is modified for %d bytes, "
-				   "return value is %d, expected negative.\n",
-				   testname, n, sa, da, m, len, ret);
-		    }
-		}
-	      else  /* m < n */
-		{
-		  if (len == 0)
-		    {
-		      if (ret <= 0)
-			print_error ("\nFailed: after %s of %u bytes "
-				     "with src_align %u and dst_align %u, "
-				     "dest after %d bytes is modified for %d bytes, "
-				     "return value is %d, expected positive.\n",
-				     testname, n, sa, da, m, len, ret);
-		    }
-		  else
-		    {
-		      if (ret >= 0)
-			print_error ("\nFailed: after %s of %u bytes "
-				     "with src_align %u and dst_align %u, "
-				     "dest after %d bytes is modified for %d bytes, "
-				     "return value is %d, expected negative.\n",
-				     testname, n, sa, da, m, len, ret);
-		    }
-		}
-	    }
-	}
-
-  /* Check some corner cases.  */
-  src[1] = 'A';
-  dest[1] = 'A';
-  src[2] = 'B';
-  dest[2] = 'B';
-  src[3] = 'C';
-  dest[3] = 'C';
-  src[4] = '\0';
-  dest[4] = '\0';
-
-  src[0] = 0xc1;
-  dest[0] = 0x41;
-  ret = strcmp (src, dest);
-  if (ret <= 0)
-    print_error ("\nFailed: expected positive, return %d\n", ret);
-
-  src[0] = 0x01;
-  dest[0] = 0x82;
-  ret = strcmp (src, dest);
-  if (ret >= 0)
-    print_error ("\nFailed: expected negative, return %d\n", ret);
-
-  dest[0] = src[0] = 'D';
-  src[3] = 0xc1;
-  dest[3] = 0x41;
-  ret = strcmp (src, dest);
-  if (ret <= 0)
-    print_error ("\nFailed: expected positive, return %d\n", ret);
-
-  src[3] = 0x01;
-  dest[3] = 0x82;
-  ret = strcmp (src, dest);
-  if (ret >= 0)
-    print_error ("\nFailed: expected negative, return %d\n", ret);
-
-  //printf ("\n");
-  if (errors != 0)
+    for (sa = 0; sa <= MAX_OFFSET; sa++)
+        for (da = 0; da <= MAX_OFFSET; da++)
+            for (n = 1; n <= MAX_BLOCK_SIZE; n++)
+            {
+                for (m = 1; m < n + MAX_DIFF; m++)
+                    for (len = 0; len < MAX_LEN; len++)
+                        for (zeros = 1; zeros < MAX_ZEROS; zeros++)
+                        {
+                            if (n - m > MAX_DIFF)
+                                continue;
+                            /* Make a copy of the source.  */
+                            for (i = 0; i < BUFF_SIZE; i++)
+                            {
+                                src[i]  = 'A' + (i % 26);
+                                dest[i] = src[i];
+                            }
+                            delay(0);
+                            memcpy(dest + da, src + sa, n);
+
+                            /* Make src 0-terminated.  */
+                            p = src + sa + n - 1;
+                            for (i = 0; i < zeros; i++)
+                            {
+                                *p++ = '\0';
+                            }
+
+                            /* Modify dest.  */
+                            p = dest + da + m - 1;
+                            for (j = 0; j < (int)len; j++)
+                                *p++ = 'x';
+                            /* Make dest 0-terminated.  */
+                            *p = '\0';
+
+                            ret = strcmp(src + sa, dest + da);
+
+                            /* Check return value.  */
+                            if (n == m)
+                            {
+                                if (len == 0)
+                                {
+                                    if (ret != 0)
+                                    {
+                                        print_error("\nFailed: after %s of %u bytes "
+                                                    "with src_align %u and dst_align %u, "
+                                                    "dest after %d bytes is modified for %d bytes, "
+                                                    "return value is %d, expected 0.\n",
+                                                    testname, n, sa, da, m, len, ret);
+                                    }
+                                }
+                                else
+                                {
+                                    if (ret >= 0)
+                                        print_error("\nFailed: after %s of %u bytes "
+                                                    "with src_align %u and dst_align %u, "
+                                                    "dest after %d bytes is modified for %d bytes, "
+                                                    "return value is %d, expected negative.\n",
+                                                    testname, n, sa, da, m, len, ret);
+                                }
+                            }
+                            else if (m > n)
+                            {
+                                if (ret >= 0)
+                                {
+                                    print_error("\nFailed: after %s of %u bytes "
+                                                "with src_align %u and dst_align %u, "
+                                                "dest after %d bytes is modified for %d bytes, "
+                                                "return value is %d, expected negative.\n",
+                                                testname, n, sa, da, m, len, ret);
+                                }
+                            }
+                            else /* m < n */
+                            {
+                                if (len == 0)
+                                {
+                                    if (ret <= 0)
+                                        print_error("\nFailed: after %s of %u bytes "
+                                                    "with src_align %u and dst_align %u, "
+                                                    "dest after %d bytes is modified for %d bytes, "
+                                                    "return value is %d, expected positive.\n",
+                                                    testname, n, sa, da, m, len, ret);
+                                }
+                                else
+                                {
+                                    if (ret >= 0)
+                                        print_error("\nFailed: after %s of %u bytes "
+                                                    "with src_align %u and dst_align %u, "
+                                                    "dest after %d bytes is modified for %d bytes, "
+                                                    "return value is %d, expected negative.\n",
+                                                    testname, n, sa, da, m, len, ret);
+                                }
+                            }
+                        }
+            }
+
+    /* Check some corner cases.  */
+    src[1]  = 'A';
+    dest[1] = 'A';
+    src[2]  = 'B';
+    dest[2] = 'B';
+    src[3]  = 'C';
+    dest[3] = 'C';
+    src[4]  = '\0';
+    dest[4] = '\0';
+
+    src[0]  = 0xc1;
+    dest[0] = 0x41;
+    ret     = strcmp(src, dest);
+    if (ret <= 0)
+        print_error("\nFailed: expected positive, return %d\n", ret);
+
+    src[0]  = 0x01;
+    dest[0] = 0x82;
+    ret     = strcmp(src, dest);
+    if (ret >= 0)
+        print_error("\nFailed: expected negative, return %d\n", ret);
+
+    dest[0] = src[0] = 'D';
+    src[3]           = 0xc1;
+    dest[3]          = 0x41;
+    ret              = strcmp(src, dest);
+    if (ret <= 0)
+        print_error("\nFailed: expected positive, return %d\n", ret);
+
+    src[3]  = 0x01;
+    dest[3] = 0x82;
+    ret     = strcmp(src, dest);
+    if (ret >= 0)
+        print_error("\nFailed: expected negative, return %d\n", ret);
+
+    //printf ("\n");
+    if (errors != 0)
     {
-      printf ("ERROR. FAILED.\n");
-      abort ();
+        printf("ERROR. FAILED.\n");
+        abort();
     }
-  //exit (0);
-  printf("ok\n");
+    //exit (0);
+    printf("ok\n");
 }
diff --git a/tests/device/test_libc/tstring.c b/tests/device/test_libc/tstring.c
index 7e806b1027..8d1f242f5e 100644
--- a/tests/device/test_libc/tstring.c
+++ b/tests/device/test_libc/tstring.c
@@ -26,336 +26,271 @@
 
 #define MAX_2 (2 * MAX_1 + MAX_1 / 10)
 
-void eprintf (int line, char *result, char *expected, int size)
+void eprintf(int line, char* result, char* expected, int size)
 {
-  if (size != 0)
-    printf ("Failure at line %d, result is <%.*s>, should be <%s> of size %d\n",
-             line, size, result, expected, size);
-  else
-    printf ("Failure at line %d, result is <%s>, should be <%s>\n",
-             line, result, expected);
+    if (size != 0)
+        printf("Failure at line %d, result is <%.*s>, should be <%s> of size %d\n",
+               line, size, result, expected, size);
+    else
+        printf("Failure at line %d, result is <%s>, should be <%s>\n",
+               line, result, expected);
 }
 
-void mycopy (char *target, char *source, int size)
+void mycopy(char* target, char* source, int size)
 {
-  int i;
+    int i;
 
-  for (i = 0; i < size; ++i)
+    for (i = 0; i < size; ++i)
     {
-      target[i] = source[i];
+        target[i] = source[i];
     }
 }
 
-void myset (char *target, char ch, int size)
+void myset(char* target, char ch, int size)
 {
-  int i;
-  
-  for (i = 0; i < size; ++i)
+    int i;
+
+    for (i = 0; i < size; ++i)
     {
-      target[i] = ch;
+        target[i] = ch;
     }
 }
 
 void tstring_main(void)
 {
-  char target[MAX_1] = "A";
-  char first_char;
-  char second_char;
-  char array[] = "abcdefghijklmnopqrstuvwxz";
-  char array2[] = "0123456789!@#$%^&*(";
-  char buffer2[MAX_1];
-  char buffer3[MAX_1];
-  char buffer4[MAX_1];
-  char buffer5[MAX_2];
-  char buffer6[MAX_2];
-  char buffer7[MAX_2];
-  char expected[MAX_1];
-  char *tmp1, *tmp2, *tmp3, *tmp4, *tmp5, *tmp6, *tmp7;
-  int i, j, k, x, z, align_test_iterations;
-  z = 0;
-  
-  int test_failed = 0;
-
-  tmp1 = target;
-  tmp2 = buffer2;
-  tmp3 = buffer3;
-  tmp4 = buffer4;
-  tmp5 = buffer5;
-  tmp6 = buffer6;
-  tmp7 = buffer7;
-
-  tmp2[0] = 'Z';
-  tmp2[1] = '\0';
-
-  if (memset (target, 'X', 0) != target ||
-      memcpy (target, "Y", 0) != target ||
-      memmove (target, "K", 0) != target ||
-      strncpy (tmp2, "4", 0) != tmp2 ||
-      strncat (tmp2, "123", 0) != tmp2 ||
-      strcat (target, "") != target)
+    char  target[MAX_1] = "A";
+    char  first_char;
+    char  second_char;
+    char  array[]  = "abcdefghijklmnopqrstuvwxz";
+    char  array2[] = "0123456789!@#$%^&*(";
+    char  buffer2[MAX_1];
+    char  buffer3[MAX_1];
+    char  buffer4[MAX_1];
+    char  buffer5[MAX_2];
+    char  buffer6[MAX_2];
+    char  buffer7[MAX_2];
+    char  expected[MAX_1];
+    char *tmp1, *tmp2, *tmp3, *tmp4, *tmp5, *tmp6, *tmp7;
+    int   i, j, k, x, z, align_test_iterations;
+    z = 0;
+
+    int test_failed = 0;
+
+    tmp1 = target;
+    tmp2 = buffer2;
+    tmp3 = buffer3;
+    tmp4 = buffer4;
+    tmp5 = buffer5;
+    tmp6 = buffer6;
+    tmp7 = buffer7;
+
+    tmp2[0] = 'Z';
+    tmp2[1] = '\0';
+
+    if (memset(target, 'X', 0) != target || memcpy(target, "Y", 0) != target || memmove(target, "K", 0) != target || strncpy(tmp2, "4", 0) != tmp2 || strncat(tmp2, "123", 0) != tmp2 || strcat(target, "") != target)
     {
-      eprintf (__LINE__, target, "A", 0);
-      test_failed = 1;
+        eprintf(__LINE__, target, "A", 0);
+        test_failed = 1;
     }
 
-  if (strcmp (target, "A") || strlen(target) != 1 || memchr (target, 'A', 0) != NULL
-      || memcmp (target, "J", 0) || strncmp (target, "A", 1) || strncmp (target, "J", 0) ||
-      tmp2[0] != 'Z' || tmp2[1] != '\0')
+    if (strcmp(target, "A") || strlen(target) != 1 || memchr(target, 'A', 0) != NULL
+        || memcmp(target, "J", 0) || strncmp(target, "A", 1) || strncmp(target, "J", 0) || tmp2[0] != 'Z' || tmp2[1] != '\0')
     {
-      eprintf (__LINE__, target, "A", 0);
-      test_failed = 1;
+        eprintf(__LINE__, target, "A", 0);
+        test_failed = 1;
     }
 
-  tmp2[2] = 'A';
-  if (strcpy (target, "") != target ||
-      strncpy (tmp2, "", 4) != tmp2 ||
-      strcat (target, "") != target)
+    tmp2[2] = 'A';
+    if (strcpy(target, "") != target || strncpy(tmp2, "", 4) != tmp2 || strcat(target, "") != target)
     {
-      eprintf (__LINE__, target, "", 0);
-      test_failed = 1;
+        eprintf(__LINE__, target, "", 0);
+        test_failed = 1;
     }
 
-  if (target[0] != '\0' || strncmp (target, "", 1) ||
-      memcmp (tmp2, "\0\0\0\0", 4))
+    if (target[0] != '\0' || strncmp(target, "", 1) || memcmp(tmp2, "\0\0\0\0", 4))
     {
-      eprintf (__LINE__, target, "", 0);
-      test_failed = 1;
+        eprintf(__LINE__, target, "", 0);
+        test_failed = 1;
     }
 
-  tmp2[2] = 'A';
-  if (strncat (tmp2, "1", 3) != tmp2 ||
-      memcmp (tmp2, "1\0A", 3))
+    tmp2[2] = 'A';
+    if (strncat(tmp2, "1", 3) != tmp2 || memcmp(tmp2, "1\0A", 3))
     {
-      eprintf (__LINE__, tmp2, "1\0A", 3);
-      test_failed = 1;
+        eprintf(__LINE__, tmp2, "1\0A", 3);
+        test_failed = 1;
     }
 
-  if (strcpy (tmp3, target) != tmp3 ||
-      strcat (tmp3, "X") != tmp3 ||
-      strncpy (tmp2, "X", 2) != tmp2 ||
-      memset (target, tmp2[0], 1) != target)
+    if (strcpy(tmp3, target) != tmp3 || strcat(tmp3, "X") != tmp3 || strncpy(tmp2, "X", 2) != tmp2 || memset(target, tmp2[0], 1) != target)
     {
-      eprintf (__LINE__, target, "X", 0);
-      test_failed = 1;
+        eprintf(__LINE__, target, "X", 0);
+        test_failed = 1;
     }
 
-  if (strcmp (target, "X") || strlen (target) != 1 ||
-      memchr (target, 'X', 2) != target ||
-      strchr (target, 'X') != target ||
-      memchr (target, 'Y', 2) != NULL ||
-      strchr (target, 'Y') != NULL ||
-      strcmp (tmp3, target) ||
-      strncmp (tmp3, target, 2) ||
-      memcmp (target, "K", 0) ||
-      strncmp (target, tmp3, 3))
+    if (strcmp(target, "X") || strlen(target) != 1 || memchr(target, 'X', 2) != target || strchr(target, 'X') != target || memchr(target, 'Y', 2) != NULL || strchr(target, 'Y') != NULL || strcmp(tmp3, target) || strncmp(tmp3, target, 2) || memcmp(target, "K", 0) || strncmp(target, tmp3, 3))
     {
-      eprintf (__LINE__, target, "X", 0);
-      test_failed = 1;
+        eprintf(__LINE__, target, "X", 0);
+        test_failed = 1;
     }
 
-  if (strcpy (tmp3, "Y") != tmp3 ||
-      strcat (tmp3, "Y") != tmp3 ||
-      memset (target, 'Y', 2) != target)
+    if (strcpy(tmp3, "Y") != tmp3 || strcat(tmp3, "Y") != tmp3 || memset(target, 'Y', 2) != target)
     {
-      eprintf (__LINE__, target, "Y", 0);
-      test_failed = 1;
+        eprintf(__LINE__, target, "Y", 0);
+        test_failed = 1;
     }
 
-  target[2] = '\0';
-  if (memcmp (target, "YY", 2) || strcmp (target, "YY") ||
-      strlen (target) != 2 || memchr (target, 'Y', 2) != target ||
-      strcmp (tmp3, target) ||
-      strncmp (target, tmp3, 3) ||
-      strncmp (target, tmp3, 4) ||
-      strncmp (target, tmp3, 2) ||
-      strchr (target, 'Y') != target)
+    target[2] = '\0';
+    if (memcmp(target, "YY", 2) || strcmp(target, "YY") || strlen(target) != 2 || memchr(target, 'Y', 2) != target || strcmp(tmp3, target) || strncmp(target, tmp3, 3) || strncmp(target, tmp3, 4) || strncmp(target, tmp3, 2) || strchr(target, 'Y') != target)
     {
-      eprintf (__LINE__, target, "YY", 2);
-      test_failed = 1;
+        eprintf(__LINE__, target, "YY", 2);
+        test_failed = 1;
     }
 
-  strcpy (target, "WW");
-  if (memcmp (target, "WW", 2) || strcmp (target, "WW") ||
-      strlen (target) != 2 || memchr (target, 'W', 2) != target ||
-      strchr (target, 'W') != target)
+    strcpy(target, "WW");
+    if (memcmp(target, "WW", 2) || strcmp(target, "WW") || strlen(target) != 2 || memchr(target, 'W', 2) != target || strchr(target, 'W') != target)
     {
-      eprintf (__LINE__, target, "WW", 2);
-      test_failed = 1;
+        eprintf(__LINE__, target, "WW", 2);
+        test_failed = 1;
     }
 
-  if (strncpy (target, "XX", 16) != target ||
-      memcmp (target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16))
+    if (strncpy(target, "XX", 16) != target || memcmp(target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16))
     {
-      eprintf (__LINE__, target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16);
-      test_failed = 1;
+        eprintf(__LINE__, target, "XX\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16);
+        test_failed = 1;
     }
 
-  if (strcpy (tmp3, "ZZ") != tmp3 ||
-      strcat (tmp3, "Z") != tmp3 ||
-      memcpy (tmp4, "Z", 2) != tmp4 ||
-      strcat (tmp4, "ZZ") != tmp4 ||
-      memset (target, 'Z', 3) != target)
+    if (strcpy(tmp3, "ZZ") != tmp3 || strcat(tmp3, "Z") != tmp3 || memcpy(tmp4, "Z", 2) != tmp4 || strcat(tmp4, "ZZ") != tmp4 || memset(target, 'Z', 3) != target)
     {
-      eprintf (__LINE__, target, "ZZZ", 3);
-      test_failed = 1;
+        eprintf(__LINE__, target, "ZZZ", 3);
+        test_failed = 1;
     }
 
-  target[3] = '\0';
-  tmp5[0] = '\0';
-  strncat (tmp5, "123", 2);
-  if (memcmp (target, "ZZZ", 3) || strcmp (target, "ZZZ") ||
-      strcmp (tmp3, target) || strcmp (tmp4, target) ||
-      strncmp (target, "ZZZ", 4) || strncmp (target, "ZZY", 3) <= 0 ||
-      strncmp ("ZZY", target, 4) >= 0 ||
-      memcmp (tmp5, "12", 3) ||
-      strlen (target) != 3)
+    target[3] = '\0';
+    tmp5[0]   = '\0';
+    strncat(tmp5, "123", 2);
+    if (memcmp(target, "ZZZ", 3) || strcmp(target, "ZZZ") || strcmp(tmp3, target) || strcmp(tmp4, target) || strncmp(target, "ZZZ", 4) || strncmp(target, "ZZY", 3) <= 0 || strncmp("ZZY", target, 4) >= 0 || memcmp(tmp5, "12", 3) || strlen(target) != 3)
     {
-      eprintf (__LINE__, target, "ZZZ", 3);
-      test_failed = 1;
+        eprintf(__LINE__, target, "ZZZ", 3);
+        test_failed = 1;
     }
 
-  target[2] = 'K';
-  if (memcmp (target, "ZZZ", 2) || strcmp (target, "ZZZ") >= 0 ||
-      memcmp (target, "ZZZ", 3) >= 0 || strlen (target) != 3 ||
-      memchr (target, 'K', 3) != target + 2 ||
-      strncmp (target, "ZZZ", 2) || strncmp (target, "ZZZ", 4) >= 0 ||
-      strchr (target, 'K') != target + 2)
+    target[2] = 'K';
+    if (memcmp(target, "ZZZ", 2) || strcmp(target, "ZZZ") >= 0 || memcmp(target, "ZZZ", 3) >= 0 || strlen(target) != 3 || memchr(target, 'K', 3) != target + 2 || strncmp(target, "ZZZ", 2) || strncmp(target, "ZZZ", 4) >= 0 || strchr(target, 'K') != target + 2)
     {
-      eprintf (__LINE__, target, "ZZK", 3);
-      test_failed = 1;
+        eprintf(__LINE__, target, "ZZK", 3);
+        test_failed = 1;
     }
-  
-  strcpy (target, "AAA");
-  if (memcmp (target, "AAA", 3) || strcmp (target, "AAA") ||
-      strncmp (target, "AAA", 3) ||
-      strlen (target) != 3)
+
+    strcpy(target, "AAA");
+    if (memcmp(target, "AAA", 3) || strcmp(target, "AAA") || strncmp(target, "AAA", 3) || strlen(target) != 3)
     {
-      eprintf (__LINE__, target, "AAA", 3);
-      test_failed = 1;
+        eprintf(__LINE__, target, "AAA", 3);
+        test_failed = 1;
     }
-  
-  j = 5;
-  while (j < MAX_1)
+
+    j = 5;
+    while (j < MAX_1)
     {
-      for (i = j-1; i <= j+1; ++i)
+        for (i = j - 1; i <= j + 1; ++i)
         {
-	  /* don't bother checking unaligned data in the larger
+            /* don't bother checking unaligned data in the larger
 	     sizes since it will waste time without performing additional testing */
-	  if ((size_t)i <= 16 * sizeof(long))
-	    {
-	      align_test_iterations = 2*sizeof(long);
-              if ((size_t)i <= 2 * sizeof(long) + 1)
-                z = 2;
-	      else
-	        z = 2 * sizeof(long);
+            if ((size_t)i <= 16 * sizeof(long))
+            {
+                align_test_iterations = 2 * sizeof(long);
+                if ((size_t)i <= 2 * sizeof(long) + 1)
+                    z = 2;
+                else
+                    z = 2 * sizeof(long);
             }
-	  else
+            else
             {
-	      align_test_iterations = 1;
+                align_test_iterations = 1;
             }
 
-	  for (x = 0; x < align_test_iterations; ++x)
-	    {
-	      tmp1 = target + x;
-	      tmp2 = buffer2 + x;
-	      tmp3 = buffer3 + x;
-	      tmp4 = buffer4 + x;
-	      tmp5 = buffer5 + x;
-	      tmp6 = buffer6 + x;
-
-	      first_char = array[i % (sizeof(array) - 1)];
-	      second_char = array2[i % (sizeof(array2) - 1)];
-	      memset (tmp1, first_char, i);
-	      mycopy (tmp2, tmp1, i);
-	      myset (tmp2 + z, second_char, i - z - 1);
-	      if (memcpy (tmp1 + z, tmp2 + z, i - z - 1) != tmp1 + z)
-		{
-		  printf ("error at line %d\n", __LINE__);
-		  test_failed = 1;
-		}
-
-	      tmp1[i] = '\0';
-	      tmp2[i] = '\0';
-	      if (strcpy (expected, tmp2) != expected)
-		{
-		  printf ("error at line %d\n", __LINE__);
-		  test_failed = 1;
-		}
-	      tmp2[i-z] = first_char + 1;
-	      if (memmove (tmp2 + z + 1, tmp2 + z, i - z - 1) != tmp2 + z + 1 ||
-		  memset (tmp3, first_char, i) != tmp3)
-		{
-		  printf ("error at line %d\n", __LINE__);
-		  test_failed = 1;
-		}
-
-	      myset (tmp4, first_char, i);
-	      tmp5[0] = '\0';
-	      if (strncpy (tmp5, tmp1, i+1) != tmp5 ||
-		  strcat (tmp5, tmp1) != tmp5)
-		{
-		  printf ("error at line %d\n", __LINE__);
-		  test_failed = 1;
-		}
-	      mycopy (tmp6, tmp1, i);
-	      mycopy (tmp6 + i, tmp1, i + 1);
-
-	      tmp7[2*i+z] = second_char;
-              strcpy (tmp7, tmp1);
-         
-	      (void)strchr (tmp1, second_char);
- 
-	      if (memcmp (tmp1, expected, i) || strcmp (tmp1, expected) ||
-		  strncmp (tmp1, expected, i) ||
-                  strncmp (tmp1, expected, i+1) ||
-		  strcmp (tmp1, tmp2) >= 0 || memcmp (tmp1, tmp2, i) >= 0 ||
-		  strncmp (tmp1, tmp2, i+1) >= 0 ||
-		  (int)strlen (tmp1) != i || memchr (tmp1, first_char, i) != tmp1 ||
-		  strchr (tmp1, first_char) != tmp1 ||
-		  memchr (tmp1, second_char, i) != tmp1 + z ||
-		  strchr (tmp1, second_char) != tmp1 + z ||
-		  strcmp (tmp5, tmp6) ||
-		  strncat (tmp7, tmp1, i+2) != tmp7 ||
-		  strcmp (tmp7, tmp6) ||
-		  tmp7[2*i+z] != second_char)
-		{
-		  eprintf (__LINE__, tmp1, expected, 0);
-		  printf ("x is %d\n",x);
-		  printf ("i is %d\n", i);
-		  printf ("tmp1 is <%p>\n", tmp1);
-		  printf ("tmp5 is <%p> <%s>\n", tmp5, tmp5);
-		  printf ("tmp6 is <%p> <%s>\n", tmp6, tmp6);
-		  test_failed = 1;
-		}
-
-	      for (k = 1; k <= align_test_iterations && k <= i; ++k)
-		{
-		  if (memcmp (tmp3, tmp4, i - k + 1) != 0 ||
-		      strncmp (tmp3, tmp4, i - k + 1) != 0)
-		    {
-		      printf ("Failure at line %d, comparing %.*s with %.*s\n",
-			      __LINE__, i, tmp3, i, tmp4);
-		      test_failed = 1;
-		    }
-		  tmp4[i-k] = first_char + 1;
-		  if (memcmp (tmp3, tmp4, i) >= 0 ||
-		      strncmp (tmp3, tmp4, i) >= 0 ||
-		      memcmp (tmp4, tmp3, i) <= 0 ||
-		      strncmp (tmp4, tmp3, i) <= 0)
-		    {
-		      printf ("Failure at line %d, comparing %.*s with %.*s\n",
-			      __LINE__, i, tmp3, i, tmp4);
-		      test_failed = 1;
-		    }
-		  tmp4[i-k] = first_char;
-		}
-	    }              
+            for (x = 0; x < align_test_iterations; ++x)
+            {
+                tmp1 = target + x;
+                tmp2 = buffer2 + x;
+                tmp3 = buffer3 + x;
+                tmp4 = buffer4 + x;
+                tmp5 = buffer5 + x;
+                tmp6 = buffer6 + x;
+
+                first_char  = array[i % (sizeof(array) - 1)];
+                second_char = array2[i % (sizeof(array2) - 1)];
+                memset(tmp1, first_char, i);
+                mycopy(tmp2, tmp1, i);
+                myset(tmp2 + z, second_char, i - z - 1);
+                if (memcpy(tmp1 + z, tmp2 + z, i - z - 1) != tmp1 + z)
+                {
+                    printf("error at line %d\n", __LINE__);
+                    test_failed = 1;
+                }
+
+                tmp1[i] = '\0';
+                tmp2[i] = '\0';
+                if (strcpy(expected, tmp2) != expected)
+                {
+                    printf("error at line %d\n", __LINE__);
+                    test_failed = 1;
+                }
+                tmp2[i - z] = first_char + 1;
+                if (memmove(tmp2 + z + 1, tmp2 + z, i - z - 1) != tmp2 + z + 1 || memset(tmp3, first_char, i) != tmp3)
+                {
+                    printf("error at line %d\n", __LINE__);
+                    test_failed = 1;
+                }
+
+                myset(tmp4, first_char, i);
+                tmp5[0] = '\0';
+                if (strncpy(tmp5, tmp1, i + 1) != tmp5 || strcat(tmp5, tmp1) != tmp5)
+                {
+                    printf("error at line %d\n", __LINE__);
+                    test_failed = 1;
+                }
+                mycopy(tmp6, tmp1, i);
+                mycopy(tmp6 + i, tmp1, i + 1);
+
+                tmp7[2 * i + z] = second_char;
+                strcpy(tmp7, tmp1);
+
+                (void)strchr(tmp1, second_char);
+
+                if (memcmp(tmp1, expected, i) || strcmp(tmp1, expected) || strncmp(tmp1, expected, i) || strncmp(tmp1, expected, i + 1) || strcmp(tmp1, tmp2) >= 0 || memcmp(tmp1, tmp2, i) >= 0 || strncmp(tmp1, tmp2, i + 1) >= 0 || (int)strlen(tmp1) != i || memchr(tmp1, first_char, i) != tmp1 || strchr(tmp1, first_char) != tmp1 || memchr(tmp1, second_char, i) != tmp1 + z || strchr(tmp1, second_char) != tmp1 + z || strcmp(tmp5, tmp6) || strncat(tmp7, tmp1, i + 2) != tmp7 || strcmp(tmp7, tmp6) || tmp7[2 * i + z] != second_char)
+                {
+                    eprintf(__LINE__, tmp1, expected, 0);
+                    printf("x is %d\n", x);
+                    printf("i is %d\n", i);
+                    printf("tmp1 is <%p>\n", tmp1);
+                    printf("tmp5 is <%p> <%s>\n", tmp5, tmp5);
+                    printf("tmp6 is <%p> <%s>\n", tmp6, tmp6);
+                    test_failed = 1;
+                }
+
+                for (k = 1; k <= align_test_iterations && k <= i; ++k)
+                {
+                    if (memcmp(tmp3, tmp4, i - k + 1) != 0 || strncmp(tmp3, tmp4, i - k + 1) != 0)
+                    {
+                        printf("Failure at line %d, comparing %.*s with %.*s\n",
+                               __LINE__, i, tmp3, i, tmp4);
+                        test_failed = 1;
+                    }
+                    tmp4[i - k] = first_char + 1;
+                    if (memcmp(tmp3, tmp4, i) >= 0 || strncmp(tmp3, tmp4, i) >= 0 || memcmp(tmp4, tmp3, i) <= 0 || strncmp(tmp4, tmp3, i) <= 0)
+                    {
+                        printf("Failure at line %d, comparing %.*s with %.*s\n",
+                               __LINE__, i, tmp3, i, tmp4);
+                        test_failed = 1;
+                    }
+                    tmp4[i - k] = first_char;
+                }
+            }
         }
-      j = ((2 * j) >> 2) << 2;
+        j = ((2 * j) >> 2) << 2;
     }
 
-  if (test_failed)
-    abort();
+    if (test_failed)
+        abort();
 
-  printf("ok\n"); 
+    printf("ok\n");
 }
diff --git a/tests/host/common/Arduino.cpp b/tests/host/common/Arduino.cpp
index 1c651e7e1f..b67d2d429e 100644
--- a/tests/host/common/Arduino.cpp
+++ b/tests/host/common/Arduino.cpp
@@ -41,7 +41,6 @@ extern "C" unsigned long micros()
     return ((time.tv_sec - gtod0.tv_sec) * 1000000) + time.tv_usec - gtod0.tv_usec;
 }
 
-
 extern "C" void yield()
 {
     run_scheduled_recurrent_functions();
@@ -58,7 +57,7 @@ extern "C" bool can_yield()
     return true;
 }
 
-extern "C" void optimistic_yield (uint32_t interval_us)
+extern "C" void optimistic_yield(uint32_t interval_us)
 {
     (void)interval_us;
 }
@@ -75,21 +74,24 @@ extern "C" void esp_yield()
 {
 }
 
-extern "C" void esp_delay (unsigned long ms)
+extern "C" void esp_delay(unsigned long ms)
 {
     usleep(ms * 1000);
 }
 
-bool esp_try_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms) {
+bool esp_try_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms)
+{
     uint32_t expired = millis() - start_ms;
-    if (expired >= timeout_ms) {
+    if (expired >= timeout_ms)
+    {
         return true;
     }
     esp_delay(std::min((timeout_ms - expired), intvl_ms));
     return false;
 }
 
-extern "C" void __panic_func(const char* file, int line, const char* func) {
+extern "C" void __panic_func(const char* file, int line, const char* func)
+{
     (void)file;
     (void)line;
     (void)func;
@@ -107,7 +109,7 @@ extern "C" void delayMicroseconds(unsigned int us)
 }
 
 #include "cont.h"
-cont_t* g_pcont = NULL;
+cont_t*         g_pcont = NULL;
 extern "C" void cont_suspend(cont_t*)
 {
 }
diff --git a/tests/host/common/ArduinoCatch.cpp b/tests/host/common/ArduinoCatch.cpp
index 6a1e3cca23..c0e835495d 100644
--- a/tests/host/common/ArduinoCatch.cpp
+++ b/tests/host/common/ArduinoCatch.cpp
@@ -17,4 +17,3 @@
 #include <catch.hpp>
 #include <sys/time.h>
 #include "Arduino.h"
-
diff --git a/tests/host/common/ArduinoMain.cpp b/tests/host/common/ArduinoMain.cpp
index ddda929d46..7a759011cf 100644
--- a/tests/host/common/ArduinoMain.cpp
+++ b/tests/host/common/ArduinoMain.cpp
@@ -30,7 +30,7 @@
 */
 
 #include <Arduino.h>
-#include <user_interface.h> // wifi_get_ip_info()
+#include <user_interface.h>  // wifi_get_ip_info()
 
 #include <signal.h>
 #include <unistd.h>
@@ -41,280 +41,281 @@
 
 #define MOCK_PORT_SHIFTER 9000
 
-bool user_exit = false;
-bool run_once = false;
-const char* host_interface = nullptr;
-size_t spiffs_kb = 1024;
-size_t littlefs_kb = 1024;
-bool ignore_sigint = false;
-bool restore_tty = false;
-bool mockdebug = false;
-int mock_port_shifter = MOCK_PORT_SHIFTER;
-const char* fspath = nullptr;
+bool        user_exit         = false;
+bool        run_once          = false;
+const char* host_interface    = nullptr;
+size_t      spiffs_kb         = 1024;
+size_t      littlefs_kb       = 1024;
+bool        ignore_sigint     = false;
+bool        restore_tty       = false;
+bool        mockdebug         = false;
+int         mock_port_shifter = MOCK_PORT_SHIFTER;
+const char* fspath            = nullptr;
 
 #define STDIN STDIN_FILENO
 
 static struct termios initial_settings;
 
-int mockverbose (const char* fmt, ...)
+int mockverbose(const char* fmt, ...)
 {
-	va_list ap;
-	va_start(ap, fmt);
-	if (mockdebug)
-		return fprintf(stderr, MOCK) + vfprintf(stderr, fmt, ap);
-	return 0;
+    va_list ap;
+    va_start(ap, fmt);
+    if (mockdebug)
+        return fprintf(stderr, MOCK) + vfprintf(stderr, fmt, ap);
+    return 0;
 }
 
 static int mock_start_uart(void)
 {
-	struct termios settings;
-
-	if (!isatty(STDIN))
-	{
-		perror("setting tty in raw mode: isatty(STDIN)");
-		return -1;
-	}
-	if (tcgetattr(STDIN, &initial_settings) < 0)
-	{
-		perror("setting tty in raw mode: tcgetattr(STDIN)");
-		return -1;
-	}
-	settings = initial_settings;
-	settings.c_lflag &= ~(ignore_sigint ? ISIG : 0);
-	settings.c_lflag &= ~(ECHO	| ICANON);
-	settings.c_iflag &= ~(ICRNL | INLCR | ISTRIP | IXON);
-	settings.c_oflag |=	(ONLCR);
-	settings.c_cc[VMIN]	= 0;
-	settings.c_cc[VTIME] = 0;
-	if (tcsetattr(STDIN, TCSANOW, &settings) < 0)
-	{
-		perror("setting tty in raw mode: tcsetattr(STDIN)");
-		return -1;
-	}
-	restore_tty = true;
-	return 0;
+    struct termios settings;
+
+    if (!isatty(STDIN))
+    {
+        perror("setting tty in raw mode: isatty(STDIN)");
+        return -1;
+    }
+    if (tcgetattr(STDIN, &initial_settings) < 0)
+    {
+        perror("setting tty in raw mode: tcgetattr(STDIN)");
+        return -1;
+    }
+    settings = initial_settings;
+    settings.c_lflag &= ~(ignore_sigint ? ISIG : 0);
+    settings.c_lflag &= ~(ECHO | ICANON);
+    settings.c_iflag &= ~(ICRNL | INLCR | ISTRIP | IXON);
+    settings.c_oflag |= (ONLCR);
+    settings.c_cc[VMIN]  = 0;
+    settings.c_cc[VTIME] = 0;
+    if (tcsetattr(STDIN, TCSANOW, &settings) < 0)
+    {
+        perror("setting tty in raw mode: tcsetattr(STDIN)");
+        return -1;
+    }
+    restore_tty = true;
+    return 0;
 }
 
 static int mock_stop_uart(void)
 {
-	if (!restore_tty) return 0;
-	if (!isatty(STDIN)) {
-		perror("restoring tty: isatty(STDIN)");
-		return -1;
-	}
-	if (tcsetattr(STDIN, TCSANOW, &initial_settings) < 0)
-	{
-		perror("restoring tty: tcsetattr(STDIN)");
-		return -1;
-	}
-	printf("\e[?25h"); // show cursor
-	return (0);
+    if (!restore_tty)
+        return 0;
+    if (!isatty(STDIN))
+    {
+        perror("restoring tty: isatty(STDIN)");
+        return -1;
+    }
+    if (tcsetattr(STDIN, TCSANOW, &initial_settings) < 0)
+    {
+        perror("restoring tty: tcsetattr(STDIN)");
+        return -1;
+    }
+    printf("\e[?25h");  // show cursor
+    return (0);
 }
 
 static uint8_t mock_read_uart(void)
 {
-	uint8_t ch = 0;
-	return (read(STDIN, &ch, 1) == 1) ? ch : 0;
+    uint8_t ch = 0;
+    return (read(STDIN, &ch, 1) == 1) ? ch : 0;
 }
 
-void help (const char* argv0, int exitcode)
+void help(const char* argv0, int exitcode)
 {
-	printf(
-		"%s - compiled with esp8266/arduino emulator\n"
-		"options:\n"
-		"\t-h\n"
-		"\tnetwork:\n"
-		"\t-i <interface> - use this interface for IP address\n"
-		"\t-l             - bind tcp/udp servers to interface only (not 0.0.0.0)\n"
-		"\t-s             - port shifter (default: %d, when root: 0)\n"
+    printf(
+        "%s - compiled with esp8266/arduino emulator\n"
+        "options:\n"
+        "\t-h\n"
+        "\tnetwork:\n"
+        "\t-i <interface> - use this interface for IP address\n"
+        "\t-l             - bind tcp/udp servers to interface only (not 0.0.0.0)\n"
+        "\t-s             - port shifter (default: %d, when root: 0)\n"
         "\tterminal:\n"
-		"\t-b             - blocking tty/mocked-uart (default: not blocking tty)\n"
-		"\t-T             - show timestamp on output\n"
-		"\tFS:\n"
-		"\t-P             - path for fs-persistent files (default: %s-)\n"
-		"\t-S             - spiffs size in KBytes (default: %zd)\n"
-		"\t-L             - littlefs size in KBytes (default: %zd)\n"
-		"\t                 (spiffs, littlefs: negative value will force mismatched size)\n"
+        "\t-b             - blocking tty/mocked-uart (default: not blocking tty)\n"
+        "\t-T             - show timestamp on output\n"
+        "\tFS:\n"
+        "\t-P             - path for fs-persistent files (default: %s-)\n"
+        "\t-S             - spiffs size in KBytes (default: %zd)\n"
+        "\t-L             - littlefs size in KBytes (default: %zd)\n"
+        "\t                 (spiffs, littlefs: negative value will force mismatched size)\n"
         "\tgeneral:\n"
-		"\t-c             - ignore CTRL-C (send it via Serial)\n"
-		"\t-f             - no throttle (possibly 100%%CPU)\n"
-		"\t-1             - run loop once then exit (for host testing)\n"
-		"\t-v             - verbose\n"
-		, argv0, MOCK_PORT_SHIFTER, argv0, spiffs_kb, littlefs_kb);
-	exit(exitcode);
+        "\t-c             - ignore CTRL-C (send it via Serial)\n"
+        "\t-f             - no throttle (possibly 100%%CPU)\n"
+        "\t-1             - run loop once then exit (for host testing)\n"
+        "\t-v             - verbose\n",
+        argv0, MOCK_PORT_SHIFTER, argv0, spiffs_kb, littlefs_kb);
+    exit(exitcode);
 }
 
-static struct option options[] =
-{
-	{ "help",           no_argument,        NULL, 'h' },
-	{ "fast",           no_argument,        NULL, 'f' },
-	{ "local",          no_argument,        NULL, 'l' },
-	{ "sigint",         no_argument,        NULL, 'c' },
-	{ "blockinguart",   no_argument,        NULL, 'b' },
-	{ "verbose",        no_argument,        NULL, 'v' },
-	{ "timestamp",      no_argument,        NULL, 'T' },
-	{ "interface",      required_argument,  NULL, 'i' },
-	{ "fspath",         required_argument,  NULL, 'P' },
-	{ "spiffskb",       required_argument,  NULL, 'S' },
-	{ "littlefskb",     required_argument,  NULL, 'L' },
-	{ "portshifter",    required_argument,  NULL, 's' },
-	{ "once",           no_argument,        NULL, '1' },
+static struct option options[] = {
+    { "help", no_argument, NULL, 'h' },
+    { "fast", no_argument, NULL, 'f' },
+    { "local", no_argument, NULL, 'l' },
+    { "sigint", no_argument, NULL, 'c' },
+    { "blockinguart", no_argument, NULL, 'b' },
+    { "verbose", no_argument, NULL, 'v' },
+    { "timestamp", no_argument, NULL, 'T' },
+    { "interface", required_argument, NULL, 'i' },
+    { "fspath", required_argument, NULL, 'P' },
+    { "spiffskb", required_argument, NULL, 'S' },
+    { "littlefskb", required_argument, NULL, 'L' },
+    { "portshifter", required_argument, NULL, 's' },
+    { "once", no_argument, NULL, '1' },
 };
 
-void cleanup ()
+void cleanup()
 {
-	mock_stop_spiffs();
-	mock_stop_littlefs();
-	mock_stop_uart();
+    mock_stop_spiffs();
+    mock_stop_littlefs();
+    mock_stop_uart();
 }
 
-void make_fs_filename (String& name, const char* fspath, const char* argv0)
+void make_fs_filename(String& name, const char* fspath, const char* argv0)
 {
-	name.clear();
-	if (fspath)
-	{
-		int lastSlash = -1;
-		for (int i = 0; argv0[i]; i++)
-			if (argv0[i] == '/')
-				lastSlash = i;
-		name = fspath;
-		name += '/';
-		name += &argv0[lastSlash + 1];
-	}
-	else
-		name = argv0;
+    name.clear();
+    if (fspath)
+    {
+        int lastSlash = -1;
+        for (int i = 0; argv0[i]; i++)
+            if (argv0[i] == '/')
+                lastSlash = i;
+        name = fspath;
+        name += '/';
+        name += &argv0[lastSlash + 1];
+    }
+    else
+        name = argv0;
 }
 
-void control_c (int sig)
+void control_c(int sig)
 {
-	(void)sig;
-
-	if (user_exit)
-	{
-		fprintf(stderr, MOCK "stuck, killing\n");
-		cleanup();
-		exit(1);
-	}
-	user_exit = true;
+    (void)sig;
+
+    if (user_exit)
+    {
+        fprintf(stderr, MOCK "stuck, killing\n");
+        cleanup();
+        exit(1);
+    }
+    user_exit = true;
 }
 
-int main (int argc, char* const argv [])
+int main(int argc, char* const argv[])
 {
-	bool fast = false;
-	blocking_uart = false; // global
-
-	signal(SIGINT, control_c);
-	signal(SIGTERM, control_c);
-	if (geteuid() == 0)
-		mock_port_shifter = 0;
-	else
-		mock_port_shifter = MOCK_PORT_SHIFTER;
-
-	for (;;)
-	{
-		int n = getopt_long(argc, argv, "hlcfbvTi:S:s:L:P:1", options, NULL);
-		if (n < 0)
-			break;
-		switch (n)
-		{
-		case 'h':
-			help(argv[0], EXIT_SUCCESS);
-			break;
-		case 'i':
-			host_interface = optarg;
-			break;
-		case 'l':
-			global_ipv4_netfmt = NO_GLOBAL_BINDING;
-			break;
-		case 's':
-			mock_port_shifter = atoi(optarg);
-			break;
-		case 'c':
-			ignore_sigint = true;
-			break;
-		case 'f':
-			fast = true;
-			break;
-		case 'S':
-			spiffs_kb = atoi(optarg);
-			break;
-		case 'L':
-			littlefs_kb = atoi(optarg);
-			break;
-		case 'P':
-			fspath = optarg;
-			break;
-		case 'b':
-			blocking_uart = true;
-			break;
-		case 'v':
-			mockdebug = true;
-			break;
-		case 'T':
-			serial_timestamp = true;
-			break;
-		case '1':
-			run_once = true;
-			break;
-		default:
-			help(argv[0], EXIT_FAILURE);
-		}
-	}
-
-	mockverbose("server port shifter: %d\n", mock_port_shifter);
-
-	if (spiffs_kb)
-	{
-		String name;
-		make_fs_filename(name, fspath, argv[0]);
-		name += "-spiffs";
-		name += String(spiffs_kb > 0? spiffs_kb: -spiffs_kb, DEC);
-		name += "KB";
-		mock_start_spiffs(name, spiffs_kb);
-	}
-
-	if (littlefs_kb)
-	{
-		String name;
-		make_fs_filename(name, fspath, argv[0]);
-		name += "-littlefs";
-		name += String(littlefs_kb > 0? littlefs_kb: -littlefs_kb, DEC);
-		name += "KB";
-		mock_start_littlefs(name, littlefs_kb);
-	}
-
-	// setup global global_ipv4_netfmt
-	wifi_get_ip_info(0, nullptr);
-
-	if (!blocking_uart)
-	{
-		// set stdin to non blocking mode
-		mock_start_uart();
-	}
-
-	// install exit handler in case Esp.restart() is called
-	atexit(cleanup);
-
-	// first call to millis(): now is millis() and micros() beginning
-	millis();
-
-	setup();
-	while (!user_exit)
-	{
-		uint8_t data = mock_read_uart();
-
-		if (data)
-			uart_new_data(UART0, data);
-		if (!fast)
-			usleep(1000); // not 100% cpu, ~1000 loops per second
-		loop();
-		loop_end();
-		check_incoming_udp();
-
-		if (run_once)
-			user_exit = true;
-	}
-	cleanup();
-
-	return 0;
+    bool fast     = false;
+    blocking_uart = false;  // global
+
+    signal(SIGINT, control_c);
+    signal(SIGTERM, control_c);
+    if (geteuid() == 0)
+        mock_port_shifter = 0;
+    else
+        mock_port_shifter = MOCK_PORT_SHIFTER;
+
+    for (;;)
+    {
+        int n = getopt_long(argc, argv, "hlcfbvTi:S:s:L:P:1", options, NULL);
+        if (n < 0)
+            break;
+        switch (n)
+        {
+        case 'h':
+            help(argv[0], EXIT_SUCCESS);
+            break;
+        case 'i':
+            host_interface = optarg;
+            break;
+        case 'l':
+            global_ipv4_netfmt = NO_GLOBAL_BINDING;
+            break;
+        case 's':
+            mock_port_shifter = atoi(optarg);
+            break;
+        case 'c':
+            ignore_sigint = true;
+            break;
+        case 'f':
+            fast = true;
+            break;
+        case 'S':
+            spiffs_kb = atoi(optarg);
+            break;
+        case 'L':
+            littlefs_kb = atoi(optarg);
+            break;
+        case 'P':
+            fspath = optarg;
+            break;
+        case 'b':
+            blocking_uart = true;
+            break;
+        case 'v':
+            mockdebug = true;
+            break;
+        case 'T':
+            serial_timestamp = true;
+            break;
+        case '1':
+            run_once = true;
+            break;
+        default:
+            help(argv[0], EXIT_FAILURE);
+        }
+    }
+
+    mockverbose("server port shifter: %d\n", mock_port_shifter);
+
+    if (spiffs_kb)
+    {
+        String name;
+        make_fs_filename(name, fspath, argv[0]);
+        name += "-spiffs";
+        name += String(spiffs_kb > 0 ? spiffs_kb : -spiffs_kb, DEC);
+        name += "KB";
+        mock_start_spiffs(name, spiffs_kb);
+    }
+
+    if (littlefs_kb)
+    {
+        String name;
+        make_fs_filename(name, fspath, argv[0]);
+        name += "-littlefs";
+        name += String(littlefs_kb > 0 ? littlefs_kb : -littlefs_kb, DEC);
+        name += "KB";
+        mock_start_littlefs(name, littlefs_kb);
+    }
+
+    // setup global global_ipv4_netfmt
+    wifi_get_ip_info(0, nullptr);
+
+    if (!blocking_uart)
+    {
+        // set stdin to non blocking mode
+        mock_start_uart();
+    }
+
+    // install exit handler in case Esp.restart() is called
+    atexit(cleanup);
+
+    // first call to millis(): now is millis() and micros() beginning
+    millis();
+
+    setup();
+    while (!user_exit)
+    {
+        uint8_t data = mock_read_uart();
+
+        if (data)
+            uart_new_data(UART0, data);
+        if (!fast)
+            usleep(1000);  // not 100% cpu, ~1000 loops per second
+        loop();
+        loop_end();
+        check_incoming_udp();
+
+        if (run_once)
+            user_exit = true;
+    }
+    cleanup();
+
+    return 0;
 }
diff --git a/tests/host/common/ClientContextSocket.cpp b/tests/host/common/ClientContextSocket.cpp
index 2d1d7c6e83..4586969ca2 100644
--- a/tests/host/common/ClientContextSocket.cpp
+++ b/tests/host/common/ClientContextSocket.cpp
@@ -39,168 +39,167 @@
 #include <fcntl.h>
 #include <errno.h>
 
-int mockSockSetup (int sock)
+int mockSockSetup(int sock)
 {
-	if (fcntl(sock, F_SETFL, O_NONBLOCK) == -1)
-	{
-		perror("socket fcntl(O_NONBLOCK)");
-		close(sock);
-		return -1;
-	}
+    if (fcntl(sock, F_SETFL, O_NONBLOCK) == -1)
+    {
+        perror("socket fcntl(O_NONBLOCK)");
+        close(sock);
+        return -1;
+    }
 
 #ifndef MSG_NOSIGNAL
-	int i = 1;
-	if (setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof i) == -1)
-	{
-		perror("sockopt(SO_NOSIGPIPE)(macOS)");
-		close(sock);
-		return -1;
-	}
+    int i = 1;
+    if (setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof i) == -1)
+    {
+        perror("sockopt(SO_NOSIGPIPE)(macOS)");
+        close(sock);
+        return -1;
+    }
 #endif
 
-	return sock;
+    return sock;
 }
 
-int mockConnect (uint32_t ipv4, int& sock, int port)
+int mockConnect(uint32_t ipv4, int& sock, int port)
 {
-	struct sockaddr_in server;
-	if ((sock = ::socket(AF_INET, SOCK_STREAM, 0)) == -1)
-	{
-		perror(MOCK "ClientContext:connect: ::socket()");
-		return 0;
-	}
-	server.sin_family = AF_INET;
-	server.sin_port = htons(port);
-	memcpy(&server.sin_addr, &ipv4, 4);
-	if (::connect(sock, (struct sockaddr*)&server, sizeof(server)) == -1)
-	{
-		perror(MOCK "ClientContext::connect: ::connect()");
-		return 0;
-	}
-
-	return mockSockSetup(sock) == -1? 0: 1;
+    struct sockaddr_in server;
+    if ((sock = ::socket(AF_INET, SOCK_STREAM, 0)) == -1)
+    {
+        perror(MOCK "ClientContext:connect: ::socket()");
+        return 0;
+    }
+    server.sin_family = AF_INET;
+    server.sin_port   = htons(port);
+    memcpy(&server.sin_addr, &ipv4, 4);
+    if (::connect(sock, (struct sockaddr*)&server, sizeof(server)) == -1)
+    {
+        perror(MOCK "ClientContext::connect: ::connect()");
+        return 0;
+    }
+
+    return mockSockSetup(sock) == -1 ? 0 : 1;
 }
 
-ssize_t mockFillInBuf (int sock, char* ccinbuf, size_t& ccinbufsize)
+ssize_t mockFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize)
 {
-	size_t maxread = CCBUFSIZE - ccinbufsize;
-	ssize_t ret = ::read(sock, ccinbuf + ccinbufsize, maxread);
-
-	if (ret == 0)
-	{
-		// connection closed
-		// nothing is read
-		return 0;
-	}
-
-	if (ret == -1)
-	{
-		if (errno != EAGAIN)
-		{
-			fprintf(stderr, MOCK "ClientContext::(read/peek fd=%i): filling buffer for %zd bytes: %s\n", sock, maxread, strerror(errno));
+    size_t  maxread = CCBUFSIZE - ccinbufsize;
+    ssize_t ret     = ::read(sock, ccinbuf + ccinbufsize, maxread);
+
+    if (ret == 0)
+    {
+        // connection closed
+        // nothing is read
+        return 0;
+    }
+
+    if (ret == -1)
+    {
+        if (errno != EAGAIN)
+        {
+            fprintf(stderr, MOCK "ClientContext::(read/peek fd=%i): filling buffer for %zd bytes: %s\n", sock, maxread, strerror(errno));
             // error
-			return -1;
-		}
-		ret = 0;
-	}
+            return -1;
+        }
+        ret = 0;
+    }
 
-	ccinbufsize += ret;
-	return ret;
+    ccinbufsize += ret;
+    return ret;
 }
 
-ssize_t mockPeekBytes (int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+ssize_t mockPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
 {
     // usersize==0: peekAvailable()
 
-	if (usersize > CCBUFSIZE)
-		mockverbose("CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
-
-	struct pollfd p;
-	size_t retsize = 0;
-	do
-	{
-		if (usersize && usersize <= ccinbufsize)
-		{
-			// data already buffered
-			retsize = usersize;
-			break;
-		}
-		
-		// check incoming data data
-		if (mockFillInBuf(sock, ccinbuf, ccinbufsize) < 0)
-		{
-			return -1;
-	    }
+    if (usersize > CCBUFSIZE)
+        mockverbose("CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
+
+    struct pollfd p;
+    size_t        retsize = 0;
+    do
+    {
+        if (usersize && usersize <= ccinbufsize)
+        {
+            // data already buffered
+            retsize = usersize;
+            break;
+        }
+
+        // check incoming data data
+        if (mockFillInBuf(sock, ccinbuf, ccinbufsize) < 0)
+        {
+            return -1;
+        }
 
         if (usersize == 0 && ccinbufsize)
             // peekAvailable
             return ccinbufsize;
 
-		if (usersize <= ccinbufsize)
-		{
-			// data just received
-			retsize = usersize;
-			break;
-		}
-		
-		// wait for more data until timeout
-		p.fd = sock;
-		p.events = POLLIN;
-	} while (poll(&p, 1, timeout_ms) == 1);
-	
+        if (usersize <= ccinbufsize)
+        {
+            // data just received
+            retsize = usersize;
+            break;
+        }
+
+        // wait for more data until timeout
+        p.fd     = sock;
+        p.events = POLLIN;
+    } while (poll(&p, 1, timeout_ms) == 1);
+
     if (dst)
     {
         memcpy(dst, ccinbuf, retsize);
     }
 
-	return retsize;
+    return retsize;
 }
 
-ssize_t mockRead (int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+ssize_t mockRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
 {
-	ssize_t copied = mockPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
-	if (copied < 0)
-		return -1;
-	// swallow (XXX use a circular buffer)
-	memmove(ccinbuf, ccinbuf + copied, ccinbufsize - copied);
-	ccinbufsize -= copied;
-	return copied;
+    ssize_t copied = mockPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
+    if (copied < 0)
+        return -1;
+    // swallow (XXX use a circular buffer)
+    memmove(ccinbuf, ccinbuf + copied, ccinbufsize - copied);
+    ccinbufsize -= copied;
+    return copied;
 }
-	
-ssize_t mockWrite (int sock, const uint8_t* data, size_t size, int timeout_ms)
+
+ssize_t mockWrite(int sock, const uint8_t* data, size_t size, int timeout_ms)
 {
-	size_t sent = 0;
-	while (sent < size)
-	{
-
-		struct pollfd p;
-		p.fd = sock;
-		p.events = POLLOUT;
-		int ret = poll(&p, 1, timeout_ms);
-		if (ret == -1)
-		{
-			fprintf(stderr, MOCK "ClientContext::write(%d): %s\n", sock, strerror(errno));
-			return -1;
-		}
-		if (ret)
-		{
+    size_t sent = 0;
+    while (sent < size)
+    {
+        struct pollfd p;
+        p.fd     = sock;
+        p.events = POLLOUT;
+        int ret  = poll(&p, 1, timeout_ms);
+        if (ret == -1)
+        {
+            fprintf(stderr, MOCK "ClientContext::write(%d): %s\n", sock, strerror(errno));
+            return -1;
+        }
+        if (ret)
+        {
 #ifndef MSG_NOSIGNAL
-			ret = ::write(sock, data + sent, size - sent);
+            ret = ::write(sock, data + sent, size - sent);
 #else
-			ret = ::send(sock, data + sent, size - sent, MSG_NOSIGNAL);
+            ret = ::send(sock, data + sent, size - sent, MSG_NOSIGNAL);
 #endif
-			if (ret == -1)
-			{
-				fprintf(stderr, MOCK "ClientContext::write/send(%d): %s\n", sock, strerror(errno));
-				return -1;
-			}
-			sent += ret;
-			if (sent < size)
-				fprintf(stderr, MOCK "ClientContext::write: sent %d bytes (%zd / %zd)\n", ret, sent, size);
-		}
-	}
+            if (ret == -1)
+            {
+                fprintf(stderr, MOCK "ClientContext::write/send(%d): %s\n", sock, strerror(errno));
+                return -1;
+            }
+            sent += ret;
+            if (sent < size)
+                fprintf(stderr, MOCK "ClientContext::write: sent %d bytes (%zd / %zd)\n", ret, sent, size);
+        }
+    }
 #ifdef DEBUG_ESP_WIFI
     mockverbose(MOCK "ClientContext::write: total sent %zd bytes\n", sent);
 #endif
-	return sent;
+    return sent;
 }
diff --git a/tests/host/common/EEPROM.h b/tests/host/common/EEPROM.h
index a1e47546de..dce99c7efd 100644
--- a/tests/host/common/EEPROM.h
+++ b/tests/host/common/EEPROM.h
@@ -32,46 +32,47 @@
 #ifndef EEPROM_MOCK
 #define EEPROM_MOCK
 
-class EEPROMClass {
+class EEPROMClass
+{
 public:
-  EEPROMClass(uint32_t sector);
-  EEPROMClass(void);
-  ~EEPROMClass();
+    EEPROMClass(uint32_t sector);
+    EEPROMClass(void);
+    ~EEPROMClass();
 
-  void begin(size_t size);
-  uint8_t read(int address);
-  void write(int address, uint8_t val);
-  bool commit();
-  void end();
+    void    begin(size_t size);
+    uint8_t read(int address);
+    void    write(int address, uint8_t val);
+    bool    commit();
+    void    end();
 
-  template<typename T> 
-  T& get(int const address, T& t)
-  {
-    if (address < 0 || address + sizeof(T) > _size)
-      return t;
-    for (size_t i = 0; i < sizeof(T); i++)
-        ((uint8_t*)&t)[i] = read(i);
-    return t;
-  }
+    template <typename T>
+    T& get(int const address, T& t)
+    {
+        if (address < 0 || address + sizeof(T) > _size)
+            return t;
+        for (size_t i = 0; i < sizeof(T); i++)
+            ((uint8_t*)&t)[i] = read(i);
+        return t;
+    }
 
-  template<typename T> 
-  const T& put(int const address, const T& t)
-  {
-    if (address < 0 || address + sizeof(T) > _size)
-      return t;
-    for (size_t i = 0; i < sizeof(T); i++)
-        write(i, ((uint8_t*)&t)[i]);
-    return t;
-  }
+    template <typename T>
+    const T& put(int const address, const T& t)
+    {
+        if (address < 0 || address + sizeof(T) > _size)
+            return t;
+        for (size_t i = 0; i < sizeof(T); i++)
+            write(i, ((uint8_t*)&t)[i]);
+        return t;
+    }
 
-  size_t length() { return _size; }
+    size_t length() { return _size; }
 
-  //uint8_t& operator[](int const address) { return read(address); }
-  uint8_t operator[] (int address) { return read(address); }
+    //uint8_t& operator[](int const address) { return read(address); }
+    uint8_t operator[](int address) { return read(address); }
 
 protected:
-  size_t _size = 0;
-  int _fd = -1;
+    size_t _size = 0;
+    int    _fd   = -1;
 };
 
 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_EEPROM)
diff --git a/tests/host/common/HostWiring.cpp b/tests/host/common/HostWiring.cpp
index 765d4297b6..638457762e 100644
--- a/tests/host/common/HostWiring.cpp
+++ b/tests/host/common/HostWiring.cpp
@@ -37,49 +37,67 @@
 #define VERBOSE(x...) mockverbose(x)
 #endif
 
-void pinMode (uint8_t pin, uint8_t mode)
+void pinMode(uint8_t pin, uint8_t mode)
 {
-	#define xxx(mode) case mode: m=STRHELPER(mode); break
-	const char* m;
-	switch (mode)
-	{
-	case INPUT: m="INPUT"; break;
-	case OUTPUT: m="OUTPUT"; break;
-	case INPUT_PULLUP: m="INPUT_PULLUP"; break;
-	case OUTPUT_OPEN_DRAIN: m="OUTPUT_OPEN_DRAIN"; break;
-	case INPUT_PULLDOWN_16: m="INPUT_PULLDOWN_16"; break;
-	case WAKEUP_PULLUP: m="WAKEUP_PULLUP"; break;
-	case WAKEUP_PULLDOWN: m="WAKEUP_PULLDOWN"; break;
-	default: m="(special)";
-	}
-	VERBOSE("gpio%d: mode='%s'\n", pin, m);
+#define xxx(mode)            \
+    case mode:               \
+        m = STRHELPER(mode); \
+        break
+    const char* m;
+    switch (mode)
+    {
+    case INPUT:
+        m = "INPUT";
+        break;
+    case OUTPUT:
+        m = "OUTPUT";
+        break;
+    case INPUT_PULLUP:
+        m = "INPUT_PULLUP";
+        break;
+    case OUTPUT_OPEN_DRAIN:
+        m = "OUTPUT_OPEN_DRAIN";
+        break;
+    case INPUT_PULLDOWN_16:
+        m = "INPUT_PULLDOWN_16";
+        break;
+    case WAKEUP_PULLUP:
+        m = "WAKEUP_PULLUP";
+        break;
+    case WAKEUP_PULLDOWN:
+        m = "WAKEUP_PULLDOWN";
+        break;
+    default:
+        m = "(special)";
+    }
+    VERBOSE("gpio%d: mode='%s'\n", pin, m);
 }
 
 void digitalWrite(uint8_t pin, uint8_t val)
 {
-	VERBOSE("digitalWrite(pin=%d val=%d)\n", pin, val);
+    VERBOSE("digitalWrite(pin=%d val=%d)\n", pin, val);
 }
 
 void analogWrite(uint8_t pin, int val)
 {
-	VERBOSE("analogWrite(pin=%d, val=%d\n", pin, val);
+    VERBOSE("analogWrite(pin=%d, val=%d\n", pin, val);
 }
 
 int analogRead(uint8_t pin)
 {
-	(void)pin;
-	return 512;
+    (void)pin;
+    return 512;
 }
 
 void analogWriteRange(uint32_t range)
 {
-	VERBOSE("analogWriteRange(range=%d)\n", range);
+    VERBOSE("analogWriteRange(range=%d)\n", range);
 }
 
 int digitalRead(uint8_t pin)
 {
-	VERBOSE("digitalRead(%d)\n", pin);
+    VERBOSE("digitalRead(%d)\n", pin);
 
-	// pin 0 is most likely a low active input
-	return pin ? 0 : 1;
+    // pin 0 is most likely a low active input
+    return pin ? 0 : 1;
 }
diff --git a/tests/host/common/MockEEPROM.cpp b/tests/host/common/MockEEPROM.cpp
index 6357c73dd2..f9a7ca2db5 100644
--- a/tests/host/common/MockEEPROM.cpp
+++ b/tests/host/common/MockEEPROM.cpp
@@ -42,52 +42,52 @@
 
 #define EEPROM_FILE_NAME "eeprom"
 
-EEPROMClass::EEPROMClass ()
+EEPROMClass::EEPROMClass()
 {
 }
 
-EEPROMClass::~EEPROMClass ()
+EEPROMClass::~EEPROMClass()
 {
-	if (_fd >= 0)
-		close(_fd);
+    if (_fd >= 0)
+        close(_fd);
 }
 
 void EEPROMClass::begin(size_t size)
 {
-	_size = size;
-	if (   (_fd = open(EEPROM_FILE_NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1
-	    || ftruncate(_fd, size) == -1)
-	{
-		fprintf(stderr, MOCK "EEPROM: cannot open/create '%s' for r/w: %s\n\r", EEPROM_FILE_NAME, strerror(errno));
-		_fd = -1;
-	}
+    _size = size;
+    if ((_fd = open(EEPROM_FILE_NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1
+        || ftruncate(_fd, size) == -1)
+    {
+        fprintf(stderr, MOCK "EEPROM: cannot open/create '%s' for r/w: %s\n\r", EEPROM_FILE_NAME, strerror(errno));
+        _fd = -1;
+    }
 }
 
 void EEPROMClass::end()
 {
-	if (_fd != -1)
-		close(_fd);
+    if (_fd != -1)
+        close(_fd);
 }
 
 bool EEPROMClass::commit()
 {
-	return true;
+    return true;
 }
 
-uint8_t EEPROMClass::read (int x)
+uint8_t EEPROMClass::read(int x)
 {
-	char c = 0;
-	if (pread(_fd, &c, 1, x) != 1)
-		fprintf(stderr, MOCK "eeprom: %s\n\r", strerror(errno));
-	return c;
+    char c = 0;
+    if (pread(_fd, &c, 1, x) != 1)
+        fprintf(stderr, MOCK "eeprom: %s\n\r", strerror(errno));
+    return c;
 }
 
-void EEPROMClass::write (int x, uint8_t c)
+void EEPROMClass::write(int x, uint8_t c)
 {
-	if (x > (int)_size)
-		fprintf(stderr, MOCK "### eeprom beyond\r\n");
-	else if (pwrite(_fd, &c, 1, x) != 1)
-		fprintf(stderr, MOCK "eeprom: %s\n\r", strerror(errno));
+    if (x > (int)_size)
+        fprintf(stderr, MOCK "### eeprom beyond\r\n");
+    else if (pwrite(_fd, &c, 1, x) != 1)
+        fprintf(stderr, MOCK "eeprom: %s\n\r", strerror(errno));
 }
 
 #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_EEPROM)
diff --git a/tests/host/common/MockEsp.cpp b/tests/host/common/MockEsp.cpp
index d11a39e940..6db348af55 100644
--- a/tests/host/common/MockEsp.cpp
+++ b/tests/host/common/MockEsp.cpp
@@ -36,195 +36,210 @@
 
 #include <stdlib.h>
 
-unsigned long long operator"" _kHz(unsigned long long x) {
+unsigned long long operator"" _kHz(unsigned long long x)
+{
     return x * 1000;
 }
 
-unsigned long long operator"" _MHz(unsigned long long x) {
+unsigned long long operator"" _MHz(unsigned long long x)
+{
     return x * 1000 * 1000;
 }
 
-unsigned long long operator"" _GHz(unsigned long long x) {
+unsigned long long operator"" _GHz(unsigned long long x)
+{
     return x * 1000 * 1000 * 1000;
 }
 
-unsigned long long operator"" _kBit(unsigned long long x) {
+unsigned long long operator"" _kBit(unsigned long long x)
+{
     return x * 1024;
 }
 
-unsigned long long operator"" _MBit(unsigned long long x) {
+unsigned long long operator"" _MBit(unsigned long long x)
+{
     return x * 1024 * 1024;
 }
 
-unsigned long long operator"" _GBit(unsigned long long x) {
+unsigned long long operator"" _GBit(unsigned long long x)
+{
     return x * 1024 * 1024 * 1024;
 }
 
-unsigned long long operator"" _kB(unsigned long long x) {
+unsigned long long operator"" _kB(unsigned long long x)
+{
     return x * 1024;
 }
 
-unsigned long long operator"" _MB(unsigned long long x) {
+unsigned long long operator"" _MB(unsigned long long x)
+{
     return x * 1024 * 1024;
 }
 
-unsigned long long operator"" _GB(unsigned long long x) {
+unsigned long long operator"" _GB(unsigned long long x)
+{
     return x * 1024 * 1024 * 1024;
 }
 
 uint32_t _SPIFFS_start;
 
-void eboot_command_write (struct eboot_command* cmd)
+void eboot_command_write(struct eboot_command* cmd)
 {
-	(void)cmd;
+    (void)cmd;
 }
 
 EspClass ESP;
 
-void EspClass::restart ()
+void EspClass::restart()
 {
-	mockverbose("Esp.restart(): exiting\n");
-	exit(EXIT_SUCCESS);
+    mockverbose("Esp.restart(): exiting\n");
+    exit(EXIT_SUCCESS);
 }
 
 uint32_t EspClass::getChipId()
 {
-	return 0xee1337;
+    return 0xee1337;
 }
 
 bool EspClass::checkFlashConfig(bool needsEquals)
 {
-	(void) needsEquals;
-	return true;
+    (void)needsEquals;
+    return true;
 }
 
 uint32_t EspClass::getSketchSize()
 {
-	return 400000;
+    return 400000;
 }
 
 uint32_t EspClass::getFreeHeap()
 {
-	return 30000;
+    return 30000;
 }
 
 uint32_t EspClass::getMaxFreeBlockSize()
 {
-	return 20000;
+    return 20000;
 }
 
 String EspClass::getResetReason()
 {
-  return "Power on";
+    return "Power on";
 }
 
 uint32_t EspClass::getFreeSketchSpace()
 {
-  return 4 * 1024 * 1024;
+    return 4 * 1024 * 1024;
 }
 
-const char *EspClass::getSdkVersion()
+const char* EspClass::getSdkVersion()
 {
-  return "2.5.0";
+    return "2.5.0";
 }
 
 uint32_t EspClass::getFlashChipSpeed()
 {
-  return 40;
+    return 40;
 }
 
-void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag) {
-  uint32_t hf = 10 * 1024;
-  float hm = 1 * 1024;
+void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag)
+{
+    uint32_t hf = 10 * 1024;
+    float    hm = 1 * 1024;
 
-  if (hfree) *hfree = hf;
-  if (hmax) *hmax = hm;
-  if (hfrag) *hfrag = 100 - (sqrt(hm) * 100) / hf;
+    if (hfree)
+        *hfree = hf;
+    if (hmax)
+        *hmax = hm;
+    if (hfrag)
+        *hfrag = 100 - (sqrt(hm) * 100) / hf;
 }
 
 bool EspClass::flashEraseSector(uint32_t sector)
 {
-	(void) sector;
-	return true;
+    (void)sector;
+    return true;
 }
 
 FlashMode_t EspClass::getFlashChipMode()
 {
-	return FM_DOUT;
+    return FM_DOUT;
 }
 
 FlashMode_t EspClass::magicFlashChipMode(uint8_t byte)
 {
-	(void) byte;
-	return FM_DOUT;
+    (void)byte;
+    return FM_DOUT;
 }
 
-bool EspClass::flashWrite(uint32_t offset, const uint32_t *data, size_t size)
+bool EspClass::flashWrite(uint32_t offset, const uint32_t* data, size_t size)
 {
-	(void)offset;
-	(void)data;
-	(void)size;
-	return true;
+    (void)offset;
+    (void)data;
+    (void)size;
+    return true;
 }
 
-bool EspClass::flashWrite(uint32_t offset, const uint8_t *data, size_t size)
+bool EspClass::flashWrite(uint32_t offset, const uint8_t* data, size_t size)
 {
-	(void)offset;
-	(void)data;
-	(void)size;
-	return true;
+    (void)offset;
+    (void)data;
+    (void)size;
+    return true;
 }
 
-bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size)
+bool EspClass::flashRead(uint32_t offset, uint32_t* data, size_t size)
 {
-	(void)offset;
-	(void)data;
-	(void)size;
-	return true;
+    (void)offset;
+    (void)data;
+    (void)size;
+    return true;
 }
 
-bool EspClass::flashRead(uint32_t offset, uint8_t *data, size_t size)
+bool EspClass::flashRead(uint32_t offset, uint8_t* data, size_t size)
 {
-	(void)offset;
-	(void)data;
-	(void)size;
-	return true;
+    (void)offset;
+    (void)data;
+    (void)size;
+    return true;
 }
 
-uint32_t EspClass::magicFlashChipSize(uint8_t byte) {
-    switch(byte & 0x0F) {
-        case 0x0: // 4 Mbit (512KB)
-            return (512_kB);
-        case 0x1: // 2 MBit (256KB)
-            return (256_kB);
-        case 0x2: // 8 MBit (1MB)
-            return (1_MB);
-        case 0x3: // 16 MBit (2MB)
-            return (2_MB);
-        case 0x4: // 32 MBit (4MB)
-            return (4_MB);
-        case 0x8: // 64 MBit (8MB)
-            return (8_MB);
-        case 0x9: // 128 MBit (16MB)
-            return (16_MB);
-        default: // fail?
-            return 0;
+uint32_t EspClass::magicFlashChipSize(uint8_t byte)
+{
+    switch (byte & 0x0F)
+    {
+    case 0x0:  // 4 Mbit (512KB)
+        return (512_kB);
+    case 0x1:  // 2 MBit (256KB)
+        return (256_kB);
+    case 0x2:  // 8 MBit (1MB)
+        return (1_MB);
+    case 0x3:  // 16 MBit (2MB)
+        return (2_MB);
+    case 0x4:  // 32 MBit (4MB)
+        return (4_MB);
+    case 0x8:  // 64 MBit (8MB)
+        return (8_MB);
+    case 0x9:  // 128 MBit (16MB)
+        return (16_MB);
+    default:  // fail?
+        return 0;
     }
 }
 
 uint32_t EspClass::getFlashChipRealSize(void)
 {
-	return magicFlashChipSize(4);
+    return magicFlashChipSize(4);
 }
 
 uint32_t EspClass::getFlashChipSize(void)
 {
-	return magicFlashChipSize(4);
+    return magicFlashChipSize(4);
 }
 
-String EspClass::getFullVersion ()
+String EspClass::getFullVersion()
 {
-	return "emulation-on-host";
+    return "emulation-on-host";
 }
 
 uint32_t EspClass::getFreeContStack()
diff --git a/tests/host/common/MockSPI.cpp b/tests/host/common/MockSPI.cpp
index 251cad914a..629970f436 100644
--- a/tests/host/common/MockSPI.cpp
+++ b/tests/host/common/MockSPI.cpp
@@ -35,13 +35,13 @@
 SPIClass SPI;
 #endif
 
-SPIClass::SPIClass ()
+SPIClass::SPIClass()
 {
 }
 
 uint8_t SPIClass::transfer(uint8_t data)
 {
-	return data;
+    return data;
 }
 
 void SPIClass::begin()
@@ -54,10 +54,10 @@ void SPIClass::end()
 
 void SPIClass::setFrequency(uint32_t freq)
 {
-	(void)freq;
+    (void)freq;
 }
 
 void SPIClass::setHwCs(bool use)
 {
-	(void)use;
+    (void)use;
 }
diff --git a/tests/host/common/MockTools.cpp b/tests/host/common/MockTools.cpp
index 5eb7969de7..c1fbb2ae16 100644
--- a/tests/host/common/MockTools.cpp
+++ b/tests/host/common/MockTools.cpp
@@ -34,47 +34,45 @@
 
 extern "C"
 {
+    uint32_t lwip_htonl(uint32_t hostlong) { return htonl(hostlong); }
+    uint16_t lwip_htons(uint16_t hostshort) { return htons(hostshort); }
+    uint32_t lwip_ntohl(uint32_t netlong) { return ntohl(netlong); }
+    uint16_t lwip_ntohs(uint16_t netshort) { return ntohs(netshort); }
 
-uint32_t lwip_htonl (uint32_t hostlong)  { return htonl(hostlong);  }
-uint16_t lwip_htons (uint16_t hostshort) { return htons(hostshort); }
-uint32_t lwip_ntohl (uint32_t netlong)   { return ntohl(netlong);   }
-uint16_t lwip_ntohs (uint16_t netshort)  { return ntohs(netshort);  }
+    char*  ets_strcpy(char* d, const char* s) { return strcpy(d, s); }
+    char*  ets_strncpy(char* d, const char* s, size_t n) { return strncpy(d, s, n); }
+    size_t ets_strlen(const char* s) { return strlen(s); }
 
-char* ets_strcpy (char* d, const char* s) { return strcpy(d, s); }
-char* ets_strncpy (char* d, const char* s, size_t n) { return strncpy(d, s, n); }
-size_t ets_strlen (const char* s) { return strlen(s); }
-
-int ets_printf (const char* fmt, ...)
-{
+    int ets_printf(const char* fmt, ...)
+    {
         va_list ap;
         va_start(ap, fmt);
-	int len = vprintf(fmt, ap);
-	va_end(ap);
-	return len;
-}
-
-void stack_thunk_add_ref() { }
-void stack_thunk_del_ref() { }
-void stack_thunk_repaint() { }
-
-uint32_t stack_thunk_get_refcnt() { return 0; }
-uint32_t stack_thunk_get_stack_top() { return 0; }
-uint32_t stack_thunk_get_stack_bot() { return 0; }
-uint32_t stack_thunk_get_cont_sp() { return 0; }
-uint32_t stack_thunk_get_max_usage() { return 0; }
-void stack_thunk_dump_stack() { }
+        int len = vprintf(fmt, ap);
+        va_end(ap);
+        return len;
+    }
+
+    void stack_thunk_add_ref() { }
+    void stack_thunk_del_ref() { }
+    void stack_thunk_repaint() { }
+
+    uint32_t stack_thunk_get_refcnt() { return 0; }
+    uint32_t stack_thunk_get_stack_top() { return 0; }
+    uint32_t stack_thunk_get_stack_bot() { return 0; }
+    uint32_t stack_thunk_get_cont_sp() { return 0; }
+    uint32_t stack_thunk_get_max_usage() { return 0; }
+    void     stack_thunk_dump_stack() { }
 
 // Thunking macro
 #define make_stack_thunk(fcnToThunk)
-
 };
 
 void configTime(int timezone, int daylightOffset_sec,
-                           const char* server1, const char* server2, const char* server3)
+                const char* server1, const char* server2, const char* server3)
 {
-	(void)server1;
-	(void)server2;
-	(void)server3;
+    (void)server1;
+    (void)server2;
+    (void)server3;
 
-	mockverbose("configTime: TODO (tz=%dH offset=%dS) (time will be host's)\n", timezone, daylightOffset_sec);
+    mockverbose("configTime: TODO (tz=%dH offset=%dS) (time will be host's)\n", timezone, daylightOffset_sec);
 }
diff --git a/tests/host/common/MockUART.cpp b/tests/host/common/MockUART.cpp
index dc6514ae40..12e4599c75 100644
--- a/tests/host/common/MockUART.cpp
+++ b/tests/host/common/MockUART.cpp
@@ -28,475 +28,476 @@
  is responsible for feeding the RX FIFO new data by calling uart_new_data().
  */
 
-#include <unistd.h> // write
-#include <sys/time.h> // gettimeofday
-#include <time.h> // localtime
+#include <unistd.h>    // write
+#include <sys/time.h>  // gettimeofday
+#include <time.h>      // localtime
 
 #include "Arduino.h"
 #include "uart.h"
 
 //#define UART_DISCARD_NEWEST
 
-extern "C" {
-
-bool blocking_uart = true; // system default
-
-static int s_uart_debug_nr = UART1;
-
-static uart_t *UART[2] = { NULL, NULL };
-
-struct uart_rx_buffer_
+extern "C"
 {
-	size_t size;
-	size_t rpos;
-	size_t wpos;
-	uint8_t * buffer;
-};
+    bool blocking_uart = true;  // system default
 
-struct uart_
-{
-	int uart_nr;
-	int baud_rate;
-	bool rx_enabled;
-	bool tx_enabled;
-	bool rx_overrun;
-	struct uart_rx_buffer_ * rx_buffer;
-};
+    static int s_uart_debug_nr = UART1;
 
-bool serial_timestamp = false;
+    static uart_t* UART[2] = { NULL, NULL };
 
-// write one byte to the emulated UART
-static void
-uart_do_write_char(const int uart_nr, char c)
-{
-	static bool w = false;
-
-	if (uart_nr >= UART0 && uart_nr <= UART1)
-	{
-		if (serial_timestamp && (c == '\n' || c == '\r'))
-		{
-			if (w)
-			{
-				FILE* out = uart_nr == UART0? stdout: stderr;
-				timeval tv;
-				gettimeofday(&tv, nullptr);
-				const tm* tm = localtime(&tv.tv_sec);
-				fprintf(out, "\r\n%d:%02d:%02d.%06d: ", tm->tm_hour, tm->tm_min, tm->tm_sec, (int)tv.tv_usec);
-				fflush(out);
-				w = false;
-			}
-		}
-		else
-		{
+    struct uart_rx_buffer_
+    {
+        size_t   size;
+        size_t   rpos;
+        size_t   wpos;
+        uint8_t* buffer;
+    };
+
+    struct uart_
+    {
+        int                     uart_nr;
+        int                     baud_rate;
+        bool                    rx_enabled;
+        bool                    tx_enabled;
+        bool                    rx_overrun;
+        struct uart_rx_buffer_* rx_buffer;
+    };
+
+    bool serial_timestamp = false;
+
+    // write one byte to the emulated UART
+    static void
+    uart_do_write_char(const int uart_nr, char c)
+    {
+        static bool w = false;
+
+        if (uart_nr >= UART0 && uart_nr <= UART1)
+        {
+            if (serial_timestamp && (c == '\n' || c == '\r'))
+            {
+                if (w)
+                {
+                    FILE*   out = uart_nr == UART0 ? stdout : stderr;
+                    timeval tv;
+                    gettimeofday(&tv, nullptr);
+                    const tm* tm = localtime(&tv.tv_sec);
+                    fprintf(out, "\r\n%d:%02d:%02d.%06d: ", tm->tm_hour, tm->tm_min, tm->tm_sec, (int)tv.tv_usec);
+                    fflush(out);
+                    w = false;
+                }
+            }
+            else
+            {
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunused-result"
-			write(uart_nr + 1, &c, 1);
+                write(uart_nr + 1, &c, 1);
 #pragma GCC diagnostic pop
-			w = true;
-		}
-	}
-}
+                w = true;
+            }
+        }
+    }
 
-// write a new byte into the RX FIFO buffer
-static void
-uart_handle_data(uart_t* uart, uint8_t data)
-{
-	struct uart_rx_buffer_ *rx_buffer = uart->rx_buffer;
+    // write a new byte into the RX FIFO buffer
+    static void
+    uart_handle_data(uart_t* uart, uint8_t data)
+    {
+        struct uart_rx_buffer_* rx_buffer = uart->rx_buffer;
 
-	size_t nextPos = (rx_buffer->wpos + 1) % rx_buffer->size;
-	if(nextPos == rx_buffer->rpos)
-	{
-		uart->rx_overrun = true;
+        size_t nextPos = (rx_buffer->wpos + 1) % rx_buffer->size;
+        if (nextPos == rx_buffer->rpos)
+        {
+            uart->rx_overrun = true;
 #ifdef UART_DISCARD_NEWEST
-		return;
+            return;
 #else
-		if (++rx_buffer->rpos == rx_buffer->size)
-			rx_buffer->rpos = 0;
+            if (++rx_buffer->rpos == rx_buffer->size)
+                rx_buffer->rpos = 0;
 #endif
-	}
-	rx_buffer->buffer[rx_buffer->wpos] = data;
-	rx_buffer->wpos = nextPos;
-}
-
-// insert a new byte into the RX FIFO nuffer
-void
-uart_new_data(const int uart_nr, uint8_t data)
-{
-	uart_t* uart = UART[uart_nr];
+        }
+        rx_buffer->buffer[rx_buffer->wpos] = data;
+        rx_buffer->wpos                    = nextPos;
+    }
 
-	if(uart == NULL || !uart->rx_enabled) {
-		return;
-	}
+    // insert a new byte into the RX FIFO nuffer
+    void
+    uart_new_data(const int uart_nr, uint8_t data)
+    {
+        uart_t* uart = UART[uart_nr];
 
-	uart_handle_data(uart, data);
-}
+        if (uart == NULL || !uart->rx_enabled)
+        {
+            return;
+        }
 
-static size_t
-uart_rx_available_unsafe(const struct uart_rx_buffer_ * rx_buffer)
-{
-	size_t ret = rx_buffer->wpos - rx_buffer->rpos;
+        uart_handle_data(uart, data);
+    }
 
-	if(rx_buffer->wpos < rx_buffer->rpos)
-		ret = (rx_buffer->wpos + rx_buffer->size) - rx_buffer->rpos;
+    static size_t
+    uart_rx_available_unsafe(const struct uart_rx_buffer_* rx_buffer)
+    {
+        size_t ret = rx_buffer->wpos - rx_buffer->rpos;
 
-	return ret;
-}
+        if (rx_buffer->wpos < rx_buffer->rpos)
+            ret = (rx_buffer->wpos + rx_buffer->size) - rx_buffer->rpos;
 
-// taking data straight from fifo, only needed in uart_resize_rx_buffer()
-static int
-uart_read_char_unsafe(uart_t* uart)
-{
-	if (uart_rx_available_unsafe(uart->rx_buffer))
-	{
-		// take oldest sw data
-		int ret = uart->rx_buffer->buffer[uart->rx_buffer->rpos];
-		uart->rx_buffer->rpos = (uart->rx_buffer->rpos + 1) % uart->rx_buffer->size;
-		return ret;
-	}
-	// unavailable
-	return -1;
-}
+        return ret;
+    }
 
-/**********************************************************/
-/************ UART API FUNCTIONS **************************/
-/**********************************************************/
+    // taking data straight from fifo, only needed in uart_resize_rx_buffer()
+    static int
+    uart_read_char_unsafe(uart_t* uart)
+    {
+        if (uart_rx_available_unsafe(uart->rx_buffer))
+        {
+            // take oldest sw data
+            int ret               = uart->rx_buffer->buffer[uart->rx_buffer->rpos];
+            uart->rx_buffer->rpos = (uart->rx_buffer->rpos + 1) % uart->rx_buffer->size;
+            return ret;
+        }
+        // unavailable
+        return -1;
+    }
 
-size_t
-uart_rx_available(uart_t* uart)
-{
-	if(uart == NULL || !uart->rx_enabled)
-		return 0;
+    /**********************************************************/
+    /************ UART API FUNCTIONS **************************/
+    /**********************************************************/
 
-	return uart_rx_available_unsafe(uart->rx_buffer);
-}
+    size_t
+    uart_rx_available(uart_t* uart)
+    {
+        if (uart == NULL || !uart->rx_enabled)
+            return 0;
 
-int
-uart_peek_char(uart_t* uart)
-{
-	if(uart == NULL || !uart->rx_enabled)
-		return -1;
+        return uart_rx_available_unsafe(uart->rx_buffer);
+    }
 
-	if (!uart_rx_available_unsafe(uart->rx_buffer))
-		return -1;
+    int
+    uart_peek_char(uart_t* uart)
+    {
+        if (uart == NULL || !uart->rx_enabled)
+            return -1;
 
-	return uart->rx_buffer->buffer[uart->rx_buffer->rpos];
-}
+        if (!uart_rx_available_unsafe(uart->rx_buffer))
+            return -1;
 
-int
-uart_read_char(uart_t* uart)
-{
-	uint8_t ret;
-	return uart_read(uart, (char*)&ret, 1) ? ret : -1;
-}
+        return uart->rx_buffer->buffer[uart->rx_buffer->rpos];
+    }
 
-size_t
-uart_read(uart_t* uart, char* userbuffer, size_t usersize)
-{
-	if(uart == NULL || !uart->rx_enabled)
-		return 0;
-
-    if (!blocking_uart)
-    {
-        char c;
-        if (read(0, &c, 1) == 1)
-            uart_new_data(0, c);
-    }
-
-	size_t ret = 0;
-	while (ret < usersize && uart_rx_available_unsafe(uart->rx_buffer))
-	{
-		// pour sw buffer to user's buffer
-		// get largest linear length from sw buffer
-		size_t chunk = uart->rx_buffer->rpos < uart->rx_buffer->wpos ?
-		               uart->rx_buffer->wpos - uart->rx_buffer->rpos :
-		               uart->rx_buffer->size - uart->rx_buffer->rpos;
-		if (ret + chunk > usersize)
-			chunk = usersize - ret;
-		memcpy(userbuffer + ret, uart->rx_buffer->buffer + uart->rx_buffer->rpos, chunk);
-		uart->rx_buffer->rpos = (uart->rx_buffer->rpos + chunk) % uart->rx_buffer->size;
-		ret += chunk;
-	}
-	return ret;
-}
+    int
+    uart_read_char(uart_t* uart)
+    {
+        uint8_t ret;
+        return uart_read(uart, (char*)&ret, 1) ? ret : -1;
+    }
 
-size_t
-uart_resize_rx_buffer(uart_t* uart, size_t new_size)
-{
-	if(uart == NULL || !uart->rx_enabled)
-		return 0;
-
-	if(uart->rx_buffer->size == new_size)
-		return uart->rx_buffer->size;
-
-	uint8_t * new_buf = (uint8_t*)malloc(new_size);
-	if(!new_buf)
-		return uart->rx_buffer->size;
-
-	size_t new_wpos = 0;
-	// if uart_rx_available_unsafe() returns non-0, uart_read_char_unsafe() can't return -1
-	while(uart_rx_available_unsafe(uart->rx_buffer) && new_wpos < new_size)
-		new_buf[new_wpos++] = uart_read_char_unsafe(uart);
-	if (new_wpos == new_size)
-		new_wpos = 0;
-
-	uint8_t * old_buf = uart->rx_buffer->buffer;
-	uart->rx_buffer->rpos = 0;
-	uart->rx_buffer->wpos = new_wpos;
-	uart->rx_buffer->size = new_size;
-	uart->rx_buffer->buffer = new_buf;
-	free(old_buf);
-	return uart->rx_buffer->size;
-}
+    size_t
+    uart_read(uart_t* uart, char* userbuffer, size_t usersize)
+    {
+        if (uart == NULL || !uart->rx_enabled)
+            return 0;
+
+        if (!blocking_uart)
+        {
+            char c;
+            if (read(0, &c, 1) == 1)
+                uart_new_data(0, c);
+        }
+
+        size_t ret = 0;
+        while (ret < usersize && uart_rx_available_unsafe(uart->rx_buffer))
+        {
+            // pour sw buffer to user's buffer
+            // get largest linear length from sw buffer
+            size_t chunk = uart->rx_buffer->rpos < uart->rx_buffer->wpos ? uart->rx_buffer->wpos - uart->rx_buffer->rpos : uart->rx_buffer->size - uart->rx_buffer->rpos;
+            if (ret + chunk > usersize)
+                chunk = usersize - ret;
+            memcpy(userbuffer + ret, uart->rx_buffer->buffer + uart->rx_buffer->rpos, chunk);
+            uart->rx_buffer->rpos = (uart->rx_buffer->rpos + chunk) % uart->rx_buffer->size;
+            ret += chunk;
+        }
+        return ret;
+    }
 
-size_t
-uart_get_rx_buffer_size(uart_t* uart)
-{
-	return uart && uart->rx_enabled ? uart->rx_buffer->size : 0;
-}
+    size_t
+    uart_resize_rx_buffer(uart_t* uart, size_t new_size)
+    {
+        if (uart == NULL || !uart->rx_enabled)
+            return 0;
+
+        if (uart->rx_buffer->size == new_size)
+            return uart->rx_buffer->size;
+
+        uint8_t* new_buf = (uint8_t*)malloc(new_size);
+        if (!new_buf)
+            return uart->rx_buffer->size;
+
+        size_t new_wpos = 0;
+        // if uart_rx_available_unsafe() returns non-0, uart_read_char_unsafe() can't return -1
+        while (uart_rx_available_unsafe(uart->rx_buffer) && new_wpos < new_size)
+            new_buf[new_wpos++] = uart_read_char_unsafe(uart);
+        if (new_wpos == new_size)
+            new_wpos = 0;
+
+        uint8_t* old_buf        = uart->rx_buffer->buffer;
+        uart->rx_buffer->rpos   = 0;
+        uart->rx_buffer->wpos   = new_wpos;
+        uart->rx_buffer->size   = new_size;
+        uart->rx_buffer->buffer = new_buf;
+        free(old_buf);
+        return uart->rx_buffer->size;
+    }
 
-size_t
-uart_write_char(uart_t* uart, char c)
-{
-	if(uart == NULL || !uart->tx_enabled)
-		return 0;
+    size_t
+    uart_get_rx_buffer_size(uart_t* uart)
+    {
+        return uart && uart->rx_enabled ? uart->rx_buffer->size : 0;
+    }
 
-	uart_do_write_char(uart->uart_nr, c);
+    size_t
+    uart_write_char(uart_t* uart, char c)
+    {
+        if (uart == NULL || !uart->tx_enabled)
+            return 0;
 
-	return 1;
-}
+        uart_do_write_char(uart->uart_nr, c);
 
-size_t
-uart_write(uart_t* uart, const char* buf, size_t size)
-{
-	if(uart == NULL || !uart->tx_enabled)
-		return 0;
+        return 1;
+    }
 
-	size_t ret = size;
-	const int uart_nr = uart->uart_nr;
-	while (size--)
-		uart_do_write_char(uart_nr, *buf++);
+    size_t
+    uart_write(uart_t* uart, const char* buf, size_t size)
+    {
+        if (uart == NULL || !uart->tx_enabled)
+            return 0;
 
-	return ret;
-}
+        size_t    ret     = size;
+        const int uart_nr = uart->uart_nr;
+        while (size--)
+            uart_do_write_char(uart_nr, *buf++);
 
-size_t
-uart_tx_free(uart_t* uart)
-{
-	if(uart == NULL || !uart->tx_enabled)
-		return 0;
+        return ret;
+    }
 
-	return UART_TX_FIFO_SIZE;
-}
+    size_t
+    uart_tx_free(uart_t* uart)
+    {
+        if (uart == NULL || !uart->tx_enabled)
+            return 0;
 
-void
-uart_wait_tx_empty(uart_t* uart)
-{
-	(void) uart;
-}
+        return UART_TX_FIFO_SIZE;
+    }
 
-void
-uart_flush(uart_t* uart)
-{
-	if(uart == NULL)
-		return;
-
-	if(uart->rx_enabled)
-	{
-		uart->rx_buffer->rpos = 0;
-		uart->rx_buffer->wpos = 0;
-	}
-}
+    void
+    uart_wait_tx_empty(uart_t* uart)
+    {
+        (void)uart;
+    }
 
-void
-uart_set_baudrate(uart_t* uart, int baud_rate)
-{
-	if(uart == NULL)
-		return;
+    void
+    uart_flush(uart_t* uart)
+    {
+        if (uart == NULL)
+            return;
+
+        if (uart->rx_enabled)
+        {
+            uart->rx_buffer->rpos = 0;
+            uart->rx_buffer->wpos = 0;
+        }
+    }
 
-	uart->baud_rate = baud_rate;
-}
+    void
+    uart_set_baudrate(uart_t* uart, int baud_rate)
+    {
+        if (uart == NULL)
+            return;
 
-int
-uart_get_baudrate(uart_t* uart)
-{
-	if(uart == NULL)
-		return 0;
+        uart->baud_rate = baud_rate;
+    }
 
-	return uart->baud_rate;
-}
+    int
+    uart_get_baudrate(uart_t* uart)
+    {
+        if (uart == NULL)
+            return 0;
 
-uint8_t
-uart_get_bit_length(const int uart_nr)
-{
-	uint8_t width = ((uart_nr % 16) >> 2) + 5;
-	uint8_t parity = (uart_nr >> 5) + 1;
-	uint8_t stop = uart_nr % 4;
-	return (width + parity + stop + 1);
-}
+        return uart->baud_rate;
+    }
 
-uart_t*
-uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, size_t rx_size, bool invert)
-{
-	(void) config;
-	(void) tx_pin;
-	(void) invert;
-	uart_t* uart = (uart_t*) malloc(sizeof(uart_t));
-	if(uart == NULL)
-		return NULL;
-
-	uart->uart_nr = uart_nr;
-	uart->rx_overrun = false;
-
-	switch(uart->uart_nr)
-	{
-	case UART0:
-		uart->rx_enabled = (mode != UART_TX_ONLY);
-		uart->tx_enabled = (mode != UART_RX_ONLY);
-		if(uart->rx_enabled)
-		{
-			struct uart_rx_buffer_ * rx_buffer = (struct uart_rx_buffer_ *)malloc(sizeof(struct uart_rx_buffer_));
-			if(rx_buffer == NULL)
-			{
-				free(uart);
-				return NULL;
-			}
-			rx_buffer->size = rx_size;//var this
-			rx_buffer->rpos = 0;
-			rx_buffer->wpos = 0;
-			rx_buffer->buffer = (uint8_t *)malloc(rx_buffer->size);
-			if(rx_buffer->buffer == NULL)
-			{
-				free(rx_buffer);
-				free(uart);
-				return NULL;
-			}
-			uart->rx_buffer = rx_buffer;
-		}
-		break;
-
-	case UART1:
-		// Note: uart_interrupt_handler does not support RX on UART 1.
-		uart->rx_enabled = false;
-		uart->tx_enabled = (mode != UART_RX_ONLY);
-		break;
-
-	case UART_NO:
-	default:
-		// big fail!
-		free(uart);
-		return NULL;
-	}
-
-	uart_set_baudrate(uart, baudrate);
-
-	UART[uart_nr] = uart;
-
-	return uart;
-}
+    uint8_t
+    uart_get_bit_length(const int uart_nr)
+    {
+        uint8_t width  = ((uart_nr % 16) >> 2) + 5;
+        uint8_t parity = (uart_nr >> 5) + 1;
+        uint8_t stop   = uart_nr % 4;
+        return (width + parity + stop + 1);
+    }
 
-void
-uart_uninit(uart_t* uart)
-{
-	if(uart == NULL)
-		return;
-
-	if(uart->rx_enabled) {
-		free(uart->rx_buffer->buffer);
-		free(uart->rx_buffer);
-	}
-	free(uart);
-}
+    uart_t*
+    uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, size_t rx_size, bool invert)
+    {
+        (void)config;
+        (void)tx_pin;
+        (void)invert;
+        uart_t* uart = (uart_t*)malloc(sizeof(uart_t));
+        if (uart == NULL)
+            return NULL;
+
+        uart->uart_nr    = uart_nr;
+        uart->rx_overrun = false;
+
+        switch (uart->uart_nr)
+        {
+        case UART0:
+            uart->rx_enabled = (mode != UART_TX_ONLY);
+            uart->tx_enabled = (mode != UART_RX_ONLY);
+            if (uart->rx_enabled)
+            {
+                struct uart_rx_buffer_* rx_buffer = (struct uart_rx_buffer_*)malloc(sizeof(struct uart_rx_buffer_));
+                if (rx_buffer == NULL)
+                {
+                    free(uart);
+                    return NULL;
+                }
+                rx_buffer->size   = rx_size;  //var this
+                rx_buffer->rpos   = 0;
+                rx_buffer->wpos   = 0;
+                rx_buffer->buffer = (uint8_t*)malloc(rx_buffer->size);
+                if (rx_buffer->buffer == NULL)
+                {
+                    free(rx_buffer);
+                    free(uart);
+                    return NULL;
+                }
+                uart->rx_buffer = rx_buffer;
+            }
+            break;
+
+        case UART1:
+            // Note: uart_interrupt_handler does not support RX on UART 1.
+            uart->rx_enabled = false;
+            uart->tx_enabled = (mode != UART_RX_ONLY);
+            break;
+
+        case UART_NO:
+        default:
+            // big fail!
+            free(uart);
+            return NULL;
+        }
+
+        uart_set_baudrate(uart, baudrate);
+
+        UART[uart_nr] = uart;
+
+        return uart;
+    }
 
-bool
-uart_swap(uart_t* uart, int tx_pin)
-{
-	(void) uart;
-	(void) tx_pin;
-	return true;
-}
+    void
+    uart_uninit(uart_t* uart)
+    {
+        if (uart == NULL)
+            return;
+
+        if (uart->rx_enabled)
+        {
+            free(uart->rx_buffer->buffer);
+            free(uart->rx_buffer);
+        }
+        free(uart);
+    }
 
-bool
-uart_set_tx(uart_t* uart, int tx_pin)
-{
-	(void) uart;
-	(void) tx_pin;
-	return true;
-}
+    bool
+    uart_swap(uart_t* uart, int tx_pin)
+    {
+        (void)uart;
+        (void)tx_pin;
+        return true;
+    }
 
-bool
-uart_set_pins(uart_t* uart, int tx, int rx)
-{
-	(void) uart;
-	(void) tx;
-	(void) rx;
-	return true;
-}
+    bool
+    uart_set_tx(uart_t* uart, int tx_pin)
+    {
+        (void)uart;
+        (void)tx_pin;
+        return true;
+    }
 
-bool
-uart_tx_enabled(uart_t* uart)
-{
-	if(uart == NULL)
-		return false;
+    bool
+    uart_set_pins(uart_t* uart, int tx, int rx)
+    {
+        (void)uart;
+        (void)tx;
+        (void)rx;
+        return true;
+    }
 
-	return uart->tx_enabled;
-}
+    bool
+    uart_tx_enabled(uart_t* uart)
+    {
+        if (uart == NULL)
+            return false;
 
-bool
-uart_rx_enabled(uart_t* uart)
-{
-	if(uart == NULL)
-		return false;
+        return uart->tx_enabled;
+    }
 
-	return uart->rx_enabled;
-}
+    bool
+    uart_rx_enabled(uart_t* uart)
+    {
+        if (uart == NULL)
+            return false;
 
-bool
-uart_has_overrun(uart_t* uart)
-{
-	if(uart == NULL || !uart->rx_overrun)
-		return false;
+        return uart->rx_enabled;
+    }
 
-	// clear flag
-	uart->rx_overrun = false;
-	return true;
-}
+    bool
+    uart_has_overrun(uart_t* uart)
+    {
+        if (uart == NULL || !uart->rx_overrun)
+            return false;
 
-bool
-uart_has_rx_error(uart_t* uart)
-{
-	(void) uart;
-	return false;
-}
+        // clear flag
+        uart->rx_overrun = false;
+        return true;
+    }
 
-void
-uart_set_debug(int uart_nr)
-{
-	(void)uart_nr;
-}
+    bool
+    uart_has_rx_error(uart_t* uart)
+    {
+        (void)uart;
+        return false;
+    }
 
-int
-uart_get_debug()
-{
-	return s_uart_debug_nr;
-}
+    void
+    uart_set_debug(int uart_nr)
+    {
+        (void)uart_nr;
+    }
 
-void
-uart_start_detect_baudrate(int uart_nr)
-{
-	(void) uart_nr;
-}
+    int
+    uart_get_debug()
+    {
+        return s_uart_debug_nr;
+    }
 
-int
-uart_detect_baudrate(int uart_nr)
-{
-	(void) uart_nr;
-	return 115200;
-}
+    void
+    uart_start_detect_baudrate(int uart_nr)
+    {
+        (void)uart_nr;
+    }
 
+    int
+    uart_detect_baudrate(int uart_nr)
+    {
+        (void)uart_nr;
+        return 115200;
+    }
 };
 
-
-size_t uart_peek_available (uart_t* uart) { return 0; }
-const char* uart_peek_buffer (uart_t* uart) { return nullptr; }
-void uart_peek_consume (uart_t* uart, size_t consume) { (void)uart; (void)consume; }
-
+size_t      uart_peek_available(uart_t* uart) { return 0; }
+const char* uart_peek_buffer(uart_t* uart) { return nullptr; }
+void        uart_peek_consume(uart_t* uart, size_t consume)
+{
+    (void)uart;
+    (void)consume;
+}
diff --git a/tests/host/common/MockWiFiServer.cpp b/tests/host/common/MockWiFiServer.cpp
index dba66362d3..f199a2b588 100644
--- a/tests/host/common/MockWiFiServer.cpp
+++ b/tests/host/common/MockWiFiServer.cpp
@@ -44,32 +44,31 @@ extern "C" const ip_addr_t ip_addr_any = IPADDR4_INIT(IPADDR_ANY);
 
 // lwIP API side of WiFiServer
 
-WiFiServer::WiFiServer (const IPAddress& addr, uint16_t port)
+WiFiServer::WiFiServer(const IPAddress& addr, uint16_t port)
 {
-	(void)addr;
-	_port = port;
+    (void)addr;
+    _port = port;
 }
 
-WiFiServer::WiFiServer (uint16_t port)
+WiFiServer::WiFiServer(uint16_t port)
 {
-	_port = port;
+    _port = port;
 }
 
-WiFiClient WiFiServer::available (uint8_t* status)
+WiFiClient WiFiServer::available(uint8_t* status)
 {
-	(void)status;
-	return accept();
+    (void)status;
+    return accept();
 }
 
-WiFiClient WiFiServer::accept ()
+WiFiClient WiFiServer::accept()
 {
-	if (hasClient())
-		return WiFiClient(new ClientContext(serverAccept(pcb2int(_listen_pcb))));
-	return WiFiClient();
+    if (hasClient())
+        return WiFiClient(new ClientContext(serverAccept(pcb2int(_listen_pcb))));
+    return WiFiClient();
 }
 
 // static declaration
 
 #include <include/UdpContext.h>
 uint32_t UdpContext::staticMCastAddr = 0;
-
diff --git a/tests/host/common/MockWiFiServerSocket.cpp b/tests/host/common/MockWiFiServerSocket.cpp
index 9ab344bf50..c5e1e6b662 100644
--- a/tests/host/common/MockWiFiServerSocket.cpp
+++ b/tests/host/common/MockWiFiServerSocket.cpp
@@ -44,26 +44,26 @@
 
 // host socket internal side of WiFiServer
 
-int serverAccept (int srvsock)
+int serverAccept(int srvsock)
 {
-	int clisock;
-	socklen_t n;
-	struct sockaddr_in client;
-	n = sizeof(client);
-	if ((clisock = accept(srvsock, (struct sockaddr*)&client, &n)) == -1)
-	{
-		perror(MOCK "accept()");
-		exit(EXIT_FAILURE);
-	}
-	return mockSockSetup(clisock);
+    int                clisock;
+    socklen_t          n;
+    struct sockaddr_in client;
+    n = sizeof(client);
+    if ((clisock = accept(srvsock, (struct sockaddr*)&client, &n)) == -1)
+    {
+        perror(MOCK "accept()");
+        exit(EXIT_FAILURE);
+    }
+    return mockSockSetup(clisock);
 }
 
-void WiFiServer::begin (uint16_t port)
+void WiFiServer::begin(uint16_t port)
 {
     return begin(port, !0);
 }
 
-void WiFiServer::begin (uint16_t port, uint8_t backlog)
+void WiFiServer::begin(uint16_t port, uint8_t backlog)
 {
     if (!backlog)
         return;
@@ -71,75 +71,74 @@ void WiFiServer::begin (uint16_t port, uint8_t backlog)
     return begin();
 }
 
-void WiFiServer::begin ()
+void WiFiServer::begin()
 {
-	int sock;
-	int mockport;
-	struct sockaddr_in server;
-
-	mockport = _port;
-	if (mockport < 1024 && mock_port_shifter)
-	{
-		mockport += mock_port_shifter;
-		fprintf(stderr, MOCK "=====> WiFiServer port: %d shifted to %d (use option -s) <=====\n", _port, mockport);
-	}
-	else
-		fprintf(stderr, MOCK "=====> WiFiServer port: %d <=====\n", mockport);
-
-	if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1)
-	{
-		perror(MOCK "socket()");
-		exit(EXIT_FAILURE);
-	}
-
-	int optval = 1;
-	if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)) == -1)
-	{
-		perror(MOCK "reuseport");
-		exit(EXIT_FAILURE);
-	}
-
-	server.sin_family = AF_INET;
-	server.sin_port = htons(mockport);
-	server.sin_addr.s_addr = htonl(global_source_address);
-	if (bind(sock, (struct sockaddr*)&server, sizeof(server)) == -1)
-	{
-		perror(MOCK "bind()");
-		exit(EXIT_FAILURE);
-	}
-
-	if (listen(sock, 1) == -1)
-	{
-		perror(MOCK "listen()");
-		exit(EXIT_FAILURE);
-	}
-
-
-	// store int into pointer
-	_listen_pcb = int2pcb(sock);
+    int                sock;
+    int                mockport;
+    struct sockaddr_in server;
+
+    mockport = _port;
+    if (mockport < 1024 && mock_port_shifter)
+    {
+        mockport += mock_port_shifter;
+        fprintf(stderr, MOCK "=====> WiFiServer port: %d shifted to %d (use option -s) <=====\n", _port, mockport);
+    }
+    else
+        fprintf(stderr, MOCK "=====> WiFiServer port: %d <=====\n", mockport);
+
+    if ((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1)
+    {
+        perror(MOCK "socket()");
+        exit(EXIT_FAILURE);
+    }
+
+    int optval = 1;
+    if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)) == -1)
+    {
+        perror(MOCK "reuseport");
+        exit(EXIT_FAILURE);
+    }
+
+    server.sin_family      = AF_INET;
+    server.sin_port        = htons(mockport);
+    server.sin_addr.s_addr = htonl(global_source_address);
+    if (bind(sock, (struct sockaddr*)&server, sizeof(server)) == -1)
+    {
+        perror(MOCK "bind()");
+        exit(EXIT_FAILURE);
+    }
+
+    if (listen(sock, 1) == -1)
+    {
+        perror(MOCK "listen()");
+        exit(EXIT_FAILURE);
+    }
+
+    // store int into pointer
+    _listen_pcb = int2pcb(sock);
 }
 
-bool WiFiServer::hasClient ()
+bool WiFiServer::hasClient()
 {
-	struct pollfd p;
-	p.fd = pcb2int(_listen_pcb);
-	p.events = POLLIN;
-	return poll(&p, 1, 0) && p.revents == POLLIN;
+    struct pollfd p;
+    p.fd     = pcb2int(_listen_pcb);
+    p.events = POLLIN;
+    return poll(&p, 1, 0) && p.revents == POLLIN;
 }
 
-void WiFiServer::close ()
+void WiFiServer::close()
 {
-	if (pcb2int(_listen_pcb) >= 0)
-		::close(pcb2int(_listen_pcb));
-	_listen_pcb = int2pcb(-1);
+    if (pcb2int(_listen_pcb) >= 0)
+        ::close(pcb2int(_listen_pcb));
+    _listen_pcb = int2pcb(-1);
 }
 
-void WiFiServer::stop ()
+void WiFiServer::stop()
 {
     close();
 }
 
-size_t WiFiServer::hasClientData ()
+size_t WiFiServer::hasClientData()
 {
     // Trivial Mocking:
     // There is no waiting list of clients in this trivial mocking code,
@@ -149,7 +148,7 @@ size_t WiFiServer::hasClientData ()
     return 0;
 }
 
-bool WiFiServer::hasMaxPendingClients ()
+bool WiFiServer::hasMaxPendingClients()
 {
     // Mocking code does not consider the waiting client list,
     // so it will return ::hasClient() here meaning:
diff --git a/tests/host/common/MocklwIP.cpp b/tests/host/common/MocklwIP.cpp
index 1e19f20fc7..0b5dfa502b 100644
--- a/tests/host/common/MocklwIP.cpp
+++ b/tests/host/common/MocklwIP.cpp
@@ -7,58 +7,56 @@ esp8266::AddressListImplementation::AddressList addrList;
 
 extern "C"
 {
-
-extern netif netif0;
-
-netif* netif_list = &netif0;
-
-err_t dhcp_renew(struct netif *netif)
-{
-	(void)netif;
-	return ERR_OK;
-}
-
-void sntp_setserver(u8_t, const ip_addr_t)
-{
-}
-
-const ip_addr_t* sntp_getserver(u8_t)
-{
-    return IP_ADDR_ANY;
-}
-
-err_t etharp_request(struct netif *netif, const ip4_addr_t *ipaddr)
-{
-    (void)netif;
-    (void)ipaddr;
-    return ERR_OK;
-}
-
-err_t igmp_start(struct netif* netif)
-{
-    (void)netif;
-    return ERR_OK;
-}
-
-err_t igmp_joingroup_netif(struct netif *netif, const ip4_addr_t *groupaddr)
-{
-    (void)netif;
-    (void)groupaddr;
-    return ERR_OK;
-}
-
-err_t igmp_leavegroup_netif(struct netif *netif, const ip4_addr_t *groupaddr)
-{
-    (void)netif;
-    (void)groupaddr;
-    return ERR_OK;
-}
-
-struct netif* netif_get_by_index(u8_t idx)
-{
-    (void)idx;
-    return &netif0;
-}
-
-
-} // extern "C"
+    extern netif netif0;
+
+    netif* netif_list = &netif0;
+
+    err_t dhcp_renew(struct netif* netif)
+    {
+        (void)netif;
+        return ERR_OK;
+    }
+
+    void sntp_setserver(u8_t, const ip_addr_t)
+    {
+    }
+
+    const ip_addr_t* sntp_getserver(u8_t)
+    {
+        return IP_ADDR_ANY;
+    }
+
+    err_t etharp_request(struct netif* netif, const ip4_addr_t* ipaddr)
+    {
+        (void)netif;
+        (void)ipaddr;
+        return ERR_OK;
+    }
+
+    err_t igmp_start(struct netif* netif)
+    {
+        (void)netif;
+        return ERR_OK;
+    }
+
+    err_t igmp_joingroup_netif(struct netif* netif, const ip4_addr_t* groupaddr)
+    {
+        (void)netif;
+        (void)groupaddr;
+        return ERR_OK;
+    }
+
+    err_t igmp_leavegroup_netif(struct netif* netif, const ip4_addr_t* groupaddr)
+    {
+        (void)netif;
+        (void)groupaddr;
+        return ERR_OK;
+    }
+
+    struct netif* netif_get_by_index(u8_t idx)
+    {
+        (void)idx;
+        return &netif0;
+    }
+
+}  // extern "C"
diff --git a/tests/host/common/UdpContextSocket.cpp b/tests/host/common/UdpContextSocket.cpp
index 4212bb0ee4..161821a294 100644
--- a/tests/host/common/UdpContextSocket.cpp
+++ b/tests/host/common/UdpContextSocket.cpp
@@ -39,176 +39,175 @@
 #include <assert.h>
 #include <net/if.h>
 
-int mockUDPSocket ()
+int mockUDPSocket()
 {
-	int s;
-	if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1 || fcntl(s, F_SETFL, O_NONBLOCK) == -1)
-	{
-		fprintf(stderr, MOCK "UDP socket: %s", strerror(errno));
-		exit(EXIT_FAILURE);
-	}
-	return s;
+    int s;
+    if ((s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1 || fcntl(s, F_SETFL, O_NONBLOCK) == -1)
+    {
+        fprintf(stderr, MOCK "UDP socket: %s", strerror(errno));
+        exit(EXIT_FAILURE);
+    }
+    return s;
 }
 
-bool mockUDPListen (int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
+bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
 {
-	int optval;
-	int mockport;
-
-	mockport = port;
-	if (mockport < 1024 && mock_port_shifter)
-	{
-		mockport += mock_port_shifter;
-		fprintf(stderr, MOCK "=====> UdpServer port: %d shifted to %d (use option -s) <=====\n", port, mockport);
-	}
-	else
-		fprintf(stderr, MOCK "=====> UdpServer port: %d <=====\n", mockport);
-
-	optval = 1;
-	if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)) == -1)
-		fprintf(stderr, MOCK "SO_REUSEPORT failed\n");
-	optval = 1;
-	if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) == -1)
-		fprintf(stderr, MOCK "SO_REUSEADDR failed\n");
-
-	struct sockaddr_in servaddr;
-	memset(&servaddr, 0, sizeof(servaddr));
-
-	// Filling server information
-	servaddr.sin_family = AF_INET;
-	(void) dstaddr;
-	//servaddr.sin_addr.s_addr = htonl(global_source_address);
-	servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
-	servaddr.sin_port = htons(mockport);
-
-	// Bind the socket with the server address
-	if (bind(sock, (const struct sockaddr *)&servaddr, sizeof(servaddr)) < 0)
-	{
-		fprintf(stderr, MOCK "UDP bind on port %d failed: %s\n", mockport, strerror(errno));
-		return false;
-	}
-	else
-		mockverbose("UDP server on port %d (sock=%d)\n", mockport, sock);
-
-	if (!mcast)
-		mcast = inet_addr("224.0.0.1"); // all hosts group
-	if (mcast)
-	{
-		// https://web.cs.wpi.edu/~claypool/courses/4514-B99/samples/multicast.c
-		// https://stackoverflow.com/questions/12681097/c-choose-interface-for-udp-multicast-socket
-
-		struct ip_mreq mreq;
-		mreq.imr_multiaddr.s_addr = mcast;
-		//mreq.imr_interface.s_addr = htonl(global_source_address);
-		mreq.imr_interface.s_addr = htonl(INADDR_ANY);
-
-		if (host_interface)
-		{
+    int optval;
+    int mockport;
+
+    mockport = port;
+    if (mockport < 1024 && mock_port_shifter)
+    {
+        mockport += mock_port_shifter;
+        fprintf(stderr, MOCK "=====> UdpServer port: %d shifted to %d (use option -s) <=====\n", port, mockport);
+    }
+    else
+        fprintf(stderr, MOCK "=====> UdpServer port: %d <=====\n", mockport);
+
+    optval = 1;
+    if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)) == -1)
+        fprintf(stderr, MOCK "SO_REUSEPORT failed\n");
+    optval = 1;
+    if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) == -1)
+        fprintf(stderr, MOCK "SO_REUSEADDR failed\n");
+
+    struct sockaddr_in servaddr;
+    memset(&servaddr, 0, sizeof(servaddr));
+
+    // Filling server information
+    servaddr.sin_family = AF_INET;
+    (void)dstaddr;
+    //servaddr.sin_addr.s_addr = htonl(global_source_address);
+    servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
+    servaddr.sin_port        = htons(mockport);
+
+    // Bind the socket with the server address
+    if (bind(sock, (const struct sockaddr*)&servaddr, sizeof(servaddr)) < 0)
+    {
+        fprintf(stderr, MOCK "UDP bind on port %d failed: %s\n", mockport, strerror(errno));
+        return false;
+    }
+    else
+        mockverbose("UDP server on port %d (sock=%d)\n", mockport, sock);
+
+    if (!mcast)
+        mcast = inet_addr("224.0.0.1");  // all hosts group
+    if (mcast)
+    {
+        // https://web.cs.wpi.edu/~claypool/courses/4514-B99/samples/multicast.c
+        // https://stackoverflow.com/questions/12681097/c-choose-interface-for-udp-multicast-socket
+
+        struct ip_mreq mreq;
+        mreq.imr_multiaddr.s_addr = mcast;
+        //mreq.imr_interface.s_addr = htonl(global_source_address);
+        mreq.imr_interface.s_addr = htonl(INADDR_ANY);
+
+        if (host_interface)
+        {
 #if __APPLE__
-			int idx = if_nametoindex(host_interface);
-			if (setsockopt(sock, IPPROTO_TCP, IP_BOUND_IF, &idx, sizeof(idx)) == -1)
+            int idx = if_nametoindex(host_interface);
+            if (setsockopt(sock, IPPROTO_TCP, IP_BOUND_IF, &idx, sizeof(idx)) == -1)
 #else
-			if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, host_interface, strlen(host_interface)) == -1)
+            if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, host_interface, strlen(host_interface)) == -1)
 #endif
-				fprintf(stderr, MOCK "UDP multicast: can't setup bind/output on interface %s: %s\n", host_interface, strerror(errno));
-			if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, &mreq.imr_interface, sizeof(struct in_addr)) == -1)
-				fprintf(stderr, MOCK "UDP multicast: can't setup bind/input on interface %s: %s\n", host_interface, strerror(errno));
-		}
-
-		if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0)
-		{
-			fprintf(stderr, MOCK "can't join multicast group addr %08x\n", (int)mcast);
-			return false;
-		}
-		else
-			mockverbose("joined multicast group addr %08lx\n", (long)ntohl(mcast));
-	}
-
-	return true;
+                fprintf(stderr, MOCK "UDP multicast: can't setup bind/output on interface %s: %s\n", host_interface, strerror(errno));
+            if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, &mreq.imr_interface, sizeof(struct in_addr)) == -1)
+                fprintf(stderr, MOCK "UDP multicast: can't setup bind/input on interface %s: %s\n", host_interface, strerror(errno));
+        }
+
+        if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0)
+        {
+            fprintf(stderr, MOCK "can't join multicast group addr %08x\n", (int)mcast);
+            return false;
+        }
+        else
+            mockverbose("joined multicast group addr %08lx\n", (long)ntohl(mcast));
+    }
+
+    return true;
 }
 
-
-size_t mockUDPFillInBuf (int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port)
+size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port)
 {
-	struct sockaddr_storage addrbuf;
-	socklen_t addrbufsize = std::min((socklen_t)sizeof(addrbuf), (socklen_t)16);
-
-	size_t maxread = CCBUFSIZE - ccinbufsize;
-	ssize_t ret = ::recvfrom(sock, ccinbuf + ccinbufsize, maxread, 0/*flags*/, (sockaddr*)&addrbuf, &addrbufsize);
-	if (ret == -1)
-	{
-		if (errno != EAGAIN)
-			fprintf(stderr, MOCK "UDPContext::(read/peek): filling buffer for %zd bytes: %s\n", maxread, strerror(errno));
-		ret = 0;
-	}
-
-	if (ret > 0)
-	{
-		port = ntohs(((sockaddr_in*)&addrbuf)->sin_port);
-		if (addrbuf.ss_family == AF_INET)
-			memcpy(&addr[0], &(((sockaddr_in*)&addrbuf)->sin_addr.s_addr), addrsize = 4);
-		else
-		{
-			fprintf(stderr, MOCK "TODO UDP+IPv6\n");
-			exit(EXIT_FAILURE);
-		}
-	}
-
-	return ccinbufsize += ret;
+    struct sockaddr_storage addrbuf;
+    socklen_t               addrbufsize = std::min((socklen_t)sizeof(addrbuf), (socklen_t)16);
+
+    size_t  maxread = CCBUFSIZE - ccinbufsize;
+    ssize_t ret     = ::recvfrom(sock, ccinbuf + ccinbufsize, maxread, 0 /*flags*/, (sockaddr*)&addrbuf, &addrbufsize);
+    if (ret == -1)
+    {
+        if (errno != EAGAIN)
+            fprintf(stderr, MOCK "UDPContext::(read/peek): filling buffer for %zd bytes: %s\n", maxread, strerror(errno));
+        ret = 0;
+    }
+
+    if (ret > 0)
+    {
+        port = ntohs(((sockaddr_in*)&addrbuf)->sin_port);
+        if (addrbuf.ss_family == AF_INET)
+            memcpy(&addr[0], &(((sockaddr_in*)&addrbuf)->sin_addr.s_addr), addrsize = 4);
+        else
+        {
+            fprintf(stderr, MOCK "TODO UDP+IPv6\n");
+            exit(EXIT_FAILURE);
+        }
+    }
+
+    return ccinbufsize += ret;
 }
 
-size_t mockUDPPeekBytes (int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
 {
-	(void) sock;
-	(void) timeout_ms;  
-	if (usersize > CCBUFSIZE)
-		fprintf(stderr, MOCK "CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
-
-	size_t retsize = 0;
-	if (ccinbufsize)
-	{
-		// data already buffered
-		retsize = usersize;
-		if (retsize > ccinbufsize)
-			retsize = ccinbufsize;
-	}
-	memcpy(dst, ccinbuf, retsize);
-	return retsize;
+    (void)sock;
+    (void)timeout_ms;
+    if (usersize > CCBUFSIZE)
+        fprintf(stderr, MOCK "CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
+
+    size_t retsize = 0;
+    if (ccinbufsize)
+    {
+        // data already buffered
+        retsize = usersize;
+        if (retsize > ccinbufsize)
+            retsize = ccinbufsize;
+    }
+    memcpy(dst, ccinbuf, retsize);
+    return retsize;
 }
 
-void mockUDPSwallow (size_t copied, char* ccinbuf, size_t& ccinbufsize)
+void mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize)
 {
-	// poor man buffer
-	memmove(ccinbuf, ccinbuf + copied, ccinbufsize - copied);
-	ccinbufsize -= copied;
+    // poor man buffer
+    memmove(ccinbuf, ccinbuf + copied, ccinbufsize - copied);
+    ccinbufsize -= copied;
 }
 
-size_t mockUDPRead (int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
 {
-	size_t copied = mockUDPPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
-	mockUDPSwallow(copied, ccinbuf, ccinbufsize);
-	return copied;
+    size_t copied = mockUDPPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
+    mockUDPSwallow(copied, ccinbuf, ccinbufsize);
+    return copied;
 }
 
-size_t mockUDPWrite (int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port)
+size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port)
 {
-	(void) timeout_ms;
-	// Filling server information
-	struct sockaddr_in peer;
-	peer.sin_family = AF_INET;
-	peer.sin_addr.s_addr = ipv4; //XXFIXME should use lwip_htonl?
-	peer.sin_port = htons(port);
-	int ret = ::sendto(sock, data, size, 0/*flags*/, (const sockaddr*)&peer, sizeof(peer));
-	if (ret == -1)
-	{
-		fprintf(stderr, MOCK "UDPContext::write: write(%d): %s\n", sock, strerror(errno));
-		return 0;
-	}
-	if (ret != (int)size)
-	{
-		fprintf(stderr, MOCK "UDPContext::write: short write (%d < %zd) (TODO)\n", ret, size);
-		exit(EXIT_FAILURE);
-	}
-
-	return ret;
+    (void)timeout_ms;
+    // Filling server information
+    struct sockaddr_in peer;
+    peer.sin_family      = AF_INET;
+    peer.sin_addr.s_addr = ipv4;  //XXFIXME should use lwip_htonl?
+    peer.sin_port        = htons(port);
+    int ret              = ::sendto(sock, data, size, 0 /*flags*/, (const sockaddr*)&peer, sizeof(peer));
+    if (ret == -1)
+    {
+        fprintf(stderr, MOCK "UDPContext::write: write(%d): %s\n", sock, strerror(errno));
+        return 0;
+    }
+    if (ret != (int)size)
+    {
+        fprintf(stderr, MOCK "UDPContext::write: short write (%d < %zd) (TODO)\n", ret, size);
+        exit(EXIT_FAILURE);
+    }
+
+    return ret;
 }
diff --git a/tests/host/common/WMath.cpp b/tests/host/common/WMath.cpp
index 4fdf07fa2e..99b83a31f0 100644
--- a/tests/host/common/WMath.cpp
+++ b/tests/host/common/WMath.cpp
@@ -23,40 +23,50 @@
  $Id$
  */
 
-extern "C" {
+extern "C"
+{
 #include <stdlib.h>
 #include <stdint.h>
 }
 
-void randomSeed(unsigned long seed) {
-    if(seed != 0) {
+void randomSeed(unsigned long seed)
+{
+    if (seed != 0)
+    {
         srand(seed);
     }
 }
 
-long random(long howbig) {
-    if(howbig == 0) {
+long random(long howbig)
+{
+    if (howbig == 0)
+    {
         return 0;
     }
     return (rand()) % howbig;
 }
 
-long random(long howsmall, long howbig) {
-    if(howsmall >= howbig) {
+long random(long howsmall, long howbig)
+{
+    if (howsmall >= howbig)
+    {
         return howsmall;
     }
     long diff = howbig - howsmall;
     return random(diff) + howsmall;
 }
 
-long map(long x, long in_min, long in_max, long out_min, long out_max) {
+long map(long x, long in_min, long in_max, long out_min, long out_max)
+{
     return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
 }
 
-uint16_t makeWord(unsigned int w) {
+uint16_t makeWord(unsigned int w)
+{
     return w;
 }
 
-uint16_t makeWord(unsigned char h, unsigned char l) {
+uint16_t makeWord(unsigned char h, unsigned char l)
+{
     return (h << 8) | l;
 }
diff --git a/tests/host/common/c_types.h b/tests/host/common/c_types.h
index a4c784c7fb..249c423682 100644
--- a/tests/host/common/c_types.h
+++ b/tests/host/common/c_types.h
@@ -36,45 +36,46 @@
 #include <stdarg.h>
 #include <sys/cdefs.h>
 
-typedef signed char         sint8_t;
-typedef signed short        sint16_t;
-typedef signed long         sint32_t;
-typedef signed long long    sint64_t;
+typedef signed char      sint8_t;
+typedef signed short     sint16_t;
+typedef signed long      sint32_t;
+typedef signed long long sint64_t;
 // CONFLICT typedef unsigned long long  u_int64_t;
-typedef float               real32_t;
-typedef double              real64_t;
+typedef float  real32_t;
+typedef double real64_t;
 
 // CONFLICT typedef unsigned char       uint8;
-typedef unsigned char       u8;
-typedef signed char         sint8;
-typedef signed char         int8;
-typedef signed char         s8;
-typedef unsigned short      uint16;
-typedef unsigned short      u16;
-typedef signed short        sint16;
-typedef signed short        s16;
+typedef unsigned char  u8;
+typedef signed char    sint8;
+typedef signed char    int8;
+typedef signed char    s8;
+typedef unsigned short uint16;
+typedef unsigned short u16;
+typedef signed short   sint16;
+typedef signed short   s16;
 // CONFLICT typedef unsigned int        uint32;
-typedef unsigned int        u_int;
-typedef unsigned int        u32;
-typedef signed int          sint32;
-typedef signed int          s32;
-typedef int                 int32;
-typedef signed long long    sint64;
-typedef unsigned long long  uint64;
-typedef unsigned long long  u64;
-typedef float               real32;
-typedef double              real64;
+typedef unsigned int       u_int;
+typedef unsigned int       u32;
+typedef signed int         sint32;
+typedef signed int         s32;
+typedef int                int32;
+typedef signed long long   sint64;
+typedef unsigned long long uint64;
+typedef unsigned long long u64;
+typedef float              real32;
+typedef double             real64;
 
-#define __le16      u16
+#define __le16 u16
 
-#define LOCAL       static
+#define LOCAL static
 
 #ifndef NULL
-#define NULL (void *)0
+#define NULL (void*)0
 #endif /* NULL */
 
 /* probably should not put STATUS here */
-typedef enum {
+typedef enum
+{
     OK = 0,
     FAIL,
     PENDING,
@@ -82,10 +83,10 @@ typedef enum {
     CANCEL,
 } STATUS;
 
-#define BIT(nr)                 (1UL << (nr))
+#define BIT(nr) (1UL << (nr))
 
-#define REG_SET_BIT(_r, _b)  (*(volatile uint32_t*)(_r) |= (_b))
-#define REG_CLR_BIT(_r, _b)  (*(volatile uint32_t*)(_r) &= ~(_b))
+#define REG_SET_BIT(_r, _b) (*(volatile uint32_t*)(_r) |= (_b))
+#define REG_CLR_BIT(_r, _b) (*(volatile uint32_t*)(_r) &= ~(_b))
 
 #define DMEM_ATTR __attribute__((section(".bss")))
 #define SHMEM_ATTR
@@ -93,9 +94,9 @@ typedef enum {
 #ifdef ICACHE_FLASH
 #define __ICACHE_STRINGIZE_NX(A) #A
 #define __ICACHE_STRINGIZE(A) __ICACHE_STRINGIZE_NX(A)
-#define ICACHE_FLASH_ATTR   __attribute__((section("\".irom0.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
-#define IRAM_ATTR     __attribute__((section("\".iram.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
-#define ICACHE_RODATA_ATTR  __attribute__((section("\".irom.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
+#define ICACHE_FLASH_ATTR __attribute__((section("\".irom0.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
+#define IRAM_ATTR __attribute__((section("\".iram.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
+#define ICACHE_RODATA_ATTR __attribute__((section("\".irom.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
 #else
 #define ICACHE_FLASH_ATTR
 #define IRAM_ATTR
@@ -108,10 +109,9 @@ typedef enum {
 #define STORE_ATTR __attribute__((aligned(4)))
 
 #ifndef __cplusplus
-#define BOOL            bool
-#define TRUE            true
-#define FALSE           false
-
+#define BOOL bool
+#define TRUE true
+#define FALSE false
 
 #endif /* !__cplusplus */
 
diff --git a/tests/host/common/include/ClientContext.h b/tests/host/common/include/ClientContext.h
index bd9c9b80a5..b3c32211e2 100644
--- a/tests/host/common/include/ClientContext.h
+++ b/tests/host/common/include/ClientContext.h
@@ -26,7 +26,7 @@ class WiFiClient;
 
 #include <assert.h>
 
-bool getDefaultPrivateGlobalSyncValue ();
+bool getDefaultPrivateGlobalSyncValue();
 
 typedef void (*discard_cb_t)(void*, ClientContext*);
 
@@ -39,19 +39,19 @@ class ClientContext
     {
         (void)pcb;
     }
-    
-    ClientContext (int sock) :
+
+    ClientContext(int sock) :
         _discard_cb(nullptr), _discard_cb_arg(nullptr), _refcnt(0), _next(nullptr),
         _sync(::getDefaultPrivateGlobalSyncValue()), _sock(sock)
     {
     }
-    
+
     err_t abort()
     {
         if (_sock >= 0)
         {
             ::close(_sock);
-	    mockverbose("socket %d closed\n", _sock);
+            mockverbose("socket %d closed\n", _sock);
         }
         _sock = -1;
         return ERR_ABRT;
@@ -88,11 +88,12 @@ class ClientContext
     void unref()
     {
         DEBUGV(":ur %d\r\n", _refcnt);
-        if(--_refcnt == 0) {
+        if (--_refcnt == 0)
+        {
             discard_received();
             close();
             if (_discard_cb)
-                 _discard_cb(_discard_cb_arg, this);
+                _discard_cb(_discard_cb_arg, this);
             DEBUGV(":del\r\n");
             delete this;
         }
@@ -172,10 +173,10 @@ class ClientContext
     int read()
     {
         char c;
-        return read(&c, 1)? (unsigned char)c: -1;
+        return read(&c, 1) ? (unsigned char)c : -1;
     }
 
-    size_t read (char* dst, size_t size)
+    size_t read(char* dst, size_t size)
     {
         ssize_t ret = mockRead(_sock, dst, size, 0, _inbuf, _inbufsize);
         if (ret < 0)
@@ -189,10 +190,10 @@ class ClientContext
     int peek()
     {
         char c;
-        return peekBytes(&c, 1)? c: -1;
+        return peekBytes(&c, 1) ? c : -1;
     }
 
-    size_t peekBytes(char *dst, size_t size)
+    size_t peekBytes(char* dst, size_t size)
     {
         ssize_t ret = mockPeekBytes(_sock, dst, size, _timeout_ms, _inbuf, _inbufsize);
         if (ret < 0)
@@ -216,60 +217,60 @@ class ClientContext
 
     uint8_t state()
     {
-	(void)getSize(); // read on socket to force detect closed peer
-        return _sock >= 0? ESTABLISHED: CLOSED;
+        (void)getSize();  // read on socket to force detect closed peer
+        return _sock >= 0 ? ESTABLISHED : CLOSED;
     }
 
     size_t write(const char* data, size_t size)
     {
-	ssize_t ret = mockWrite(_sock, (const uint8_t*)data, size, _timeout_ms);
-	if (ret < 0)
-	{
-	    abort();
-	    return 0;
-	}
-	return ret;
+        ssize_t ret = mockWrite(_sock, (const uint8_t*)data, size, _timeout_ms);
+        if (ret < 0)
+        {
+            abort();
+            return 0;
+        }
+        return ret;
     }
 
-    void keepAlive (uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC, uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC, uint8_t count = TCP_DEFAULT_KEEPALIVE_COUNT)
+    void keepAlive(uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC, uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC, uint8_t count = TCP_DEFAULT_KEEPALIVE_COUNT)
     {
-        (void) idle_sec;
-        (void) intv_sec;
-        (void) count;
+        (void)idle_sec;
+        (void)intv_sec;
+        (void)count;
         mockverbose("TODO ClientContext::keepAlive()\n");
     }
 
-    bool isKeepAliveEnabled () const
+    bool isKeepAliveEnabled() const
     {
         mockverbose("TODO ClientContext::isKeepAliveEnabled()\n");
         return false;
     }
 
-    uint16_t getKeepAliveIdle () const
+    uint16_t getKeepAliveIdle() const
     {
         mockverbose("TODO ClientContext::getKeepAliveIdle()\n");
         return 0;
     }
 
-    uint16_t getKeepAliveInterval () const
+    uint16_t getKeepAliveInterval() const
     {
         mockverbose("TODO ClientContext::getKeepAliveInternal()\n");
         return 0;
     }
 
-    uint8_t getKeepAliveCount () const
+    uint8_t getKeepAliveCount() const
     {
         mockverbose("TODO ClientContext::getKeepAliveCount()\n");
         return 0;
     }
 
-    bool getSync () const
+    bool getSync() const
     {
         mockverbose("TODO ClientContext::getSync()\n");
         return _sync;
     }
 
-    void setSync (bool sync)
+    void setSync(bool sync)
     {
         mockverbose("TODO ClientContext::setSync()\n");
         _sync = sync;
@@ -277,13 +278,13 @@ class ClientContext
 
     // return a pointer to available data buffer (size = peekAvailable())
     // semantic forbids any kind of read() before calling peekConsume()
-    const char* peekBuffer ()
+    const char* peekBuffer()
     {
         return _inbuf;
     }
 
     // return number of byte accessible by peekBuffer()
-    size_t peekAvailable ()
+    size_t peekAvailable()
     {
         ssize_t ret = mockPeekBytes(_sock, nullptr, 0, 0, _inbuf, _inbufsize);
         if (ret < 0)
@@ -295,7 +296,7 @@ class ClientContext
     }
 
     // consume bytes after use (see peekBuffer)
-    void peekConsume (size_t consume)
+    void peekConsume(size_t consume)
     {
         assert(consume <= _inbufsize);
         memmove(_inbuf, _inbuf + consume, _inbufsize - consume);
@@ -303,22 +304,21 @@ class ClientContext
     }
 
 private:
+    discard_cb_t _discard_cb     = nullptr;
+    void*        _discard_cb_arg = nullptr;
 
-    discard_cb_t _discard_cb = nullptr;
-    void* _discard_cb_arg = nullptr;
-
-    int8_t _refcnt;
+    int8_t         _refcnt;
     ClientContext* _next;
-    
+
     bool _sync;
-    
+
     // MOCK
-    
-    int _sock = -1;
+
+    int _sock       = -1;
     int _timeout_ms = 5000;
 
-    char _inbuf [CCBUFSIZE];
+    char   _inbuf[CCBUFSIZE];
     size_t _inbufsize = 0;
 };
 
-#endif //CLIENTCONTEXT_H
+#endif  //CLIENTCONTEXT_H
diff --git a/tests/host/common/include/UdpContext.h b/tests/host/common/include/UdpContext.h
index bf104bc40f..0e3942b2db 100644
--- a/tests/host/common/include/UdpContext.h
+++ b/tests/host/common/include/UdpContext.h
@@ -37,10 +37,10 @@ extern netif netif0;
 class UdpContext
 {
 public:
-
     typedef std::function<void(void)> rxhandler_t;
 
-    UdpContext(): _on_rx(nullptr), _refcnt(0)
+    UdpContext() :
+        _on_rx(nullptr), _refcnt(0)
     {
         _sock = mockUDPSocket();
     }
@@ -64,7 +64,7 @@ class UdpContext
 
     bool connect(const ip_addr_t* addr, uint16_t port)
     {
-        _dst = *addr;
+        _dst     = *addr;
         _dstport = port;
         return true;
     }
@@ -156,13 +156,13 @@ class UdpContext
     IPAddress getDestAddress()
     {
         mockverbose("TODO: implement UDP getDestAddress\n");
-        return 0; //ip_hdr* iphdr = GET_IP_HDR(_rx_buf);
+        return 0;  //ip_hdr* iphdr = GET_IP_HDR(_rx_buf);
     }
 
     uint16_t getLocalPort()
     {
         mockverbose("TODO: implement UDP getLocalPort\n");
-        return 0; //
+        return 0;  //
     }
 
     bool next()
@@ -191,7 +191,7 @@ class UdpContext
     int peek()
     {
         char c;
-        return mockUDPPeekBytes(_sock, &c, 1, _timeout_ms, _inbuf, _inbufsize) ? : -1;
+        return mockUDPPeekBytes(_sock, &c, 1, _timeout_ms, _inbuf, _inbufsize) ?: -1;
     }
 
     void flush()
@@ -217,10 +217,10 @@ class UdpContext
 
     err_t trySend(ip_addr_t* addr = 0, uint16_t port = 0, bool keepBuffer = true)
     {
-        uint32_t dst = addr ? addr->addr : _dst.addr;
-        uint16_t dstport = port ? : _dstport;
-        size_t wrt = mockUDPWrite(_sock, (const uint8_t*)_outbuf, _outbufsize, _timeout_ms, dst, dstport);
-        err_t ret = _outbufsize ? ERR_OK : ERR_ABRT;
+        uint32_t dst     = addr ? addr->addr : _dst.addr;
+        uint16_t dstport = port ?: _dstport;
+        size_t   wrt     = mockUDPWrite(_sock, (const uint8_t*)_outbuf, _outbufsize, _timeout_ms, dst, dstport);
+        err_t    ret     = _outbufsize ? ERR_OK : ERR_ABRT;
         if (!keepBuffer || wrt == _outbufsize)
             cancelBuffer();
         return ret;
@@ -239,7 +239,7 @@ class UdpContext
     bool sendTimeout(ip_addr_t* addr, uint16_t port,
                      esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
     {
-        err_t err;
+        err_t                                 err;
         esp8266::polledTimeout::oneShotFastMs timeout(timeoutMs);
         while (((err = trySend(addr, port)) != ERR_OK) && !timeout)
             delay(0);
@@ -250,15 +250,14 @@ class UdpContext
 
     void mock_cb(void)
     {
-        if (_on_rx) _on_rx();
+        if (_on_rx)
+            _on_rx();
     }
 
 public:
-
     static uint32_t staticMCastAddr;
 
 private:
-
     void translate_addr()
     {
         if (addrsize == 4)
@@ -273,16 +272,16 @@ class UdpContext
             mockverbose("TODO unhandled udp address of size %d\n", (int)addrsize);
     }
 
-    int _sock = -1;
+    int         _sock = -1;
     rxhandler_t _on_rx;
-    int _refcnt = 0;
+    int         _refcnt = 0;
 
     ip_addr_t _dst;
-    uint16_t _dstport;
+    uint16_t  _dstport;
 
-    char _inbuf [CCBUFSIZE];
+    char   _inbuf[CCBUFSIZE];
     size_t _inbufsize = 0;
-    char _outbuf [CCBUFSIZE];
+    char   _outbuf[CCBUFSIZE];
     size_t _outbufsize = 0;
 
     int _timeout_ms = 0;
@@ -291,11 +290,11 @@ class UdpContext
     uint8_t addr[16];
 };
 
-extern "C" inline err_t igmp_joingroup(const ip4_addr_t *ifaddr, const ip4_addr_t *groupaddr)
+extern "C" inline err_t igmp_joingroup(const ip4_addr_t* ifaddr, const ip4_addr_t* groupaddr)
 {
     (void)ifaddr;
     UdpContext::staticMCastAddr = groupaddr->addr;
     return ERR_OK;
 }
 
-#endif//UDPCONTEXT_H
+#endif  //UDPCONTEXT_H
diff --git a/tests/host/common/littlefs_mock.cpp b/tests/host/common/littlefs_mock.cpp
index 0d99e82b1e..5110ebbf7b 100644
--- a/tests/host/common/littlefs_mock.cpp
+++ b/tests/host/common/littlefs_mock.cpp
@@ -16,7 +16,6 @@
  all copies or substantial portions of the Software.
 */
 
-
 #include "littlefs_mock.h"
 #include "spiffs_mock.h"
 #include "spiffs/spiffs.h"
@@ -73,18 +72,18 @@ LittleFSMock::~LittleFSMock()
     LittleFS = FS(FSImplPtr(nullptr));
 }
 
-void LittleFSMock::load ()
+void LittleFSMock::load()
 {
     if (!m_fs.size() || !m_storage.length())
         return;
-    
+
     int fs = ::open(m_storage.c_str(), O_RDONLY);
     if (fs == -1)
     {
         fprintf(stderr, "LittleFS: loading '%s': %s\n", m_storage.c_str(), strerror(errno));
         return;
     }
-    
+
     off_t flen = lseek(fs, 0, SEEK_END);
     if (flen == (off_t)-1)
     {
@@ -92,7 +91,7 @@ void LittleFSMock::load ()
         return;
     }
     lseek(fs, 0, SEEK_SET);
-    
+
     if (flen != (off_t)m_fs.size())
     {
         fprintf(stderr, "LittleFS: size of '%s': %d does not match requested size %zd\n", m_storage.c_str(), (int)flen, m_fs.size());
@@ -113,7 +112,7 @@ void LittleFSMock::load ()
     ::close(fs);
 }
 
-void LittleFSMock::save ()
+void LittleFSMock::save()
 {
     if (!m_fs.size() || !m_storage.length())
         return;
diff --git a/tests/host/common/littlefs_mock.h b/tests/host/common/littlefs_mock.h
index 0905fa9322..53f4a5a5f7 100644
--- a/tests/host/common/littlefs_mock.h
+++ b/tests/host/common/littlefs_mock.h
@@ -27,19 +27,20 @@
 
 #define DEFAULT_LITTLEFS_FILE_NAME "littlefs.bin"
 
-class LittleFSMock {
+class LittleFSMock
+{
 public:
     LittleFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString);
     void reset();
     ~LittleFSMock();
-    
+
 protected:
-    void load ();
-    void save ();
+    void load();
+    void save();
 
     std::vector<uint8_t> m_fs;
-    String m_storage;
-    bool m_overwrite;
+    String               m_storage;
+    bool                 m_overwrite;
 };
 
 #define LITTLEFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage) LittleFSMock littlefs_mock(size_kb * 1024, block_kb * 1024, page_b, storage)
diff --git a/tests/host/common/md5.c b/tests/host/common/md5.c
index 4b58f261f3..863ac80026 100644
--- a/tests/host/common/md5.c
+++ b/tests/host/common/md5.c
@@ -39,16 +39,15 @@
 #define EXP_FUNC extern
 #define STDCALL
 
-#define MD5_SIZE    16 
+#define MD5_SIZE 16
 
-typedef struct 
+typedef struct
 {
-  uint32_t state[4];        /* state (ABCD) */
-  uint32_t count[2];        /* number of bits, modulo 2^64 (lsb first) */
-  uint8_t buffer[64];       /* input buffer */
+    uint32_t state[4];   /* state (ABCD) */
+    uint32_t count[2];   /* number of bits, modulo 2^64 (lsb first) */
+    uint8_t  buffer[64]; /* input buffer */
 } MD5_CTX;
 
-
 /* Constants for MD5Transform routine.
  */
 #define S11 7
@@ -70,11 +69,10 @@ typedef struct
 
 /* ----- static functions ----- */
 static void MD5Transform(uint32_t state[4], const uint8_t block[64]);
-static void Encode(uint8_t *output, uint32_t *input, uint32_t len);
-static void Decode(uint32_t *output, const uint8_t *input, uint32_t len);
+static void Encode(uint8_t* output, uint32_t* input, uint32_t len);
+static void Decode(uint32_t* output, const uint8_t* input, uint32_t len);
 
-static const uint8_t PADDING[64] = 
-{
+static const uint8_t PADDING[64] = {
     0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
@@ -88,35 +86,39 @@ static const uint8_t PADDING[64] =
 #define I(x, y, z) ((y) ^ ((x) | (~z)))
 
 /* ROTATE_LEFT rotates x left n bits.  */
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
+#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
 
 /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
    Rotation is separate from addition to prevent recomputation.  */
-#define FF(a, b, c, d, x, s, ac) { \
-    (a) += F ((b), (c), (d)) + (x) + (uint32_t)(ac); \
-    (a) = ROTATE_LEFT ((a), (s)); \
-    (a) += (b); \
-  }
-#define GG(a, b, c, d, x, s, ac) { \
-    (a) += G ((b), (c), (d)) + (x) + (uint32_t)(ac); \
-    (a) = ROTATE_LEFT ((a), (s)); \
-    (a) += (b); \
-  }
-#define HH(a, b, c, d, x, s, ac) { \
-    (a) += H ((b), (c), (d)) + (x) + (uint32_t)(ac); \
-    (a) = ROTATE_LEFT ((a), (s)); \
-    (a) += (b); \
-  }
-#define II(a, b, c, d, x, s, ac) { \
-    (a) += I ((b), (c), (d)) + (x) + (uint32_t)(ac); \
-    (a) = ROTATE_LEFT ((a), (s)); \
-    (a) += (b); \
-  }
+#define FF(a, b, c, d, x, s, ac)                        \
+    {                                                   \
+        (a) += F((b), (c), (d)) + (x) + (uint32_t)(ac); \
+        (a) = ROTATE_LEFT((a), (s));                    \
+        (a) += (b);                                     \
+    }
+#define GG(a, b, c, d, x, s, ac)                        \
+    {                                                   \
+        (a) += G((b), (c), (d)) + (x) + (uint32_t)(ac); \
+        (a) = ROTATE_LEFT((a), (s));                    \
+        (a) += (b);                                     \
+    }
+#define HH(a, b, c, d, x, s, ac)                        \
+    {                                                   \
+        (a) += H((b), (c), (d)) + (x) + (uint32_t)(ac); \
+        (a) = ROTATE_LEFT((a), (s));                    \
+        (a) += (b);                                     \
+    }
+#define II(a, b, c, d, x, s, ac)                        \
+    {                                                   \
+        (a) += I((b), (c), (d)) + (x) + (uint32_t)(ac); \
+        (a) = ROTATE_LEFT((a), (s));                    \
+        (a) += (b);                                     \
+    }
 
 /**
  * MD5 initialization - begins an MD5 operation, writing a new ctx.
  */
-EXP_FUNC void STDCALL MD5Init(MD5_CTX *ctx)
+EXP_FUNC void STDCALL MD5Init(MD5_CTX* ctx)
 {
     ctx->count[0] = ctx->count[1] = 0;
 
@@ -131,10 +133,10 @@ EXP_FUNC void STDCALL MD5Init(MD5_CTX *ctx)
 /**
  * Accepts an array of octets as the next portion of the message.
  */
-EXP_FUNC void STDCALL MD5Update(MD5_CTX *ctx, const uint8_t * msg, int len)
+EXP_FUNC void STDCALL MD5Update(MD5_CTX* ctx, const uint8_t* msg, int len)
 {
     uint32_t x;
-    int i, partLen;
+    int      i, partLen;
 
     /* Compute number of bytes mod 64 */
     x = (uint32_t)((ctx->count[0] >> 3) & 0x3F);
@@ -147,7 +149,7 @@ EXP_FUNC void STDCALL MD5Update(MD5_CTX *ctx, const uint8_t * msg, int len)
     partLen = 64 - x;
 
     /* Transform as many times as possible.  */
-    if (len >= partLen) 
+    if (len >= partLen)
     {
         memcpy(&ctx->buffer[x], msg, partLen);
         MD5Transform(ctx->state, ctx->buffer);
@@ -161,15 +163,15 @@ EXP_FUNC void STDCALL MD5Update(MD5_CTX *ctx, const uint8_t * msg, int len)
         i = 0;
 
     /* Buffer remaining input */
-    memcpy(&ctx->buffer[x], &msg[i], len-i);
+    memcpy(&ctx->buffer[x], &msg[i], len - i);
 }
 
 /**
  * Return the 128-bit message digest into the user's array
  */
-EXP_FUNC void STDCALL MD5Final(uint8_t *digest, MD5_CTX *ctx)
+EXP_FUNC void STDCALL MD5Final(uint8_t* digest, MD5_CTX* ctx)
 {
-    uint8_t bits[8];
+    uint8_t  bits[8];
     uint32_t x, padLen;
 
     /* Save number of bits */
@@ -177,7 +179,7 @@ EXP_FUNC void STDCALL MD5Final(uint8_t *digest, MD5_CTX *ctx)
 
     /* Pad out to 56 mod 64.
      */
-    x = (uint32_t)((ctx->count[0] >> 3) & 0x3f);
+    x      = (uint32_t)((ctx->count[0] >> 3) & 0x3f);
     padLen = (x < 56) ? (56 - x) : (120 - x);
     MD5Update(ctx, PADDING, padLen);
 
@@ -193,82 +195,82 @@ EXP_FUNC void STDCALL MD5Final(uint8_t *digest, MD5_CTX *ctx)
  */
 static void MD5Transform(uint32_t state[4], const uint8_t block[64])
 {
-    uint32_t a = state[0], b = state[1], c = state[2], 
+    uint32_t a = state[0], b = state[1], c = state[2],
              d = state[3], x[MD5_SIZE];
 
     Decode(x, block, 64);
 
     /* Round 1 */
-    FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
-    FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
-    FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
-    FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
-    FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
-    FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
-    FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
-    FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
-    FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
-    FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
-    FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
-    FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
-    FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
-    FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
-    FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
-    FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
+    FF(a, b, c, d, x[0], S11, 0xd76aa478);  /* 1 */
+    FF(d, a, b, c, x[1], S12, 0xe8c7b756);  /* 2 */
+    FF(c, d, a, b, x[2], S13, 0x242070db);  /* 3 */
+    FF(b, c, d, a, x[3], S14, 0xc1bdceee);  /* 4 */
+    FF(a, b, c, d, x[4], S11, 0xf57c0faf);  /* 5 */
+    FF(d, a, b, c, x[5], S12, 0x4787c62a);  /* 6 */
+    FF(c, d, a, b, x[6], S13, 0xa8304613);  /* 7 */
+    FF(b, c, d, a, x[7], S14, 0xfd469501);  /* 8 */
+    FF(a, b, c, d, x[8], S11, 0x698098d8);  /* 9 */
+    FF(d, a, b, c, x[9], S12, 0x8b44f7af);  /* 10 */
+    FF(c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
+    FF(b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
+    FF(a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
+    FF(d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
+    FF(c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
+    FF(b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
 
     /* Round 2 */
-    GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
-    GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
-    GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
-    GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
-    GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
-    GG (d, a, b, c, x[10], S22,  0x2441453); /* 22 */
-    GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
-    GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
-    GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
-    GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
-    GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
-    GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
-    GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
-    GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
-    GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
-    GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
+    GG(a, b, c, d, x[1], S21, 0xf61e2562);  /* 17 */
+    GG(d, a, b, c, x[6], S22, 0xc040b340);  /* 18 */
+    GG(c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
+    GG(b, c, d, a, x[0], S24, 0xe9b6c7aa);  /* 20 */
+    GG(a, b, c, d, x[5], S21, 0xd62f105d);  /* 21 */
+    GG(d, a, b, c, x[10], S22, 0x2441453);  /* 22 */
+    GG(c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
+    GG(b, c, d, a, x[4], S24, 0xe7d3fbc8);  /* 24 */
+    GG(a, b, c, d, x[9], S21, 0x21e1cde6);  /* 25 */
+    GG(d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
+    GG(c, d, a, b, x[3], S23, 0xf4d50d87);  /* 27 */
+    GG(b, c, d, a, x[8], S24, 0x455a14ed);  /* 28 */
+    GG(a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
+    GG(d, a, b, c, x[2], S22, 0xfcefa3f8);  /* 30 */
+    GG(c, d, a, b, x[7], S23, 0x676f02d9);  /* 31 */
+    GG(b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
 
     /* Round 3 */
-    HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
-    HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
-    HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
-    HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
-    HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
-    HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
-    HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
-    HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
-    HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
-    HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
-    HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
-    HH (b, c, d, a, x[ 6], S34,  0x4881d05); /* 44 */
-    HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
-    HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
-    HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
-    HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
+    HH(a, b, c, d, x[5], S31, 0xfffa3942);  /* 33 */
+    HH(d, a, b, c, x[8], S32, 0x8771f681);  /* 34 */
+    HH(c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
+    HH(b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
+    HH(a, b, c, d, x[1], S31, 0xa4beea44);  /* 37 */
+    HH(d, a, b, c, x[4], S32, 0x4bdecfa9);  /* 38 */
+    HH(c, d, a, b, x[7], S33, 0xf6bb4b60);  /* 39 */
+    HH(b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
+    HH(a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
+    HH(d, a, b, c, x[0], S32, 0xeaa127fa);  /* 42 */
+    HH(c, d, a, b, x[3], S33, 0xd4ef3085);  /* 43 */
+    HH(b, c, d, a, x[6], S34, 0x4881d05);   /* 44 */
+    HH(a, b, c, d, x[9], S31, 0xd9d4d039);  /* 45 */
+    HH(d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
+    HH(c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
+    HH(b, c, d, a, x[2], S34, 0xc4ac5665);  /* 48 */
 
     /* Round 4 */
-    II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
-    II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
-    II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
-    II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
-    II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
-    II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
-    II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
-    II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
-    II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
-    II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
-    II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
-    II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
-    II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
-    II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
-    II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
-    II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
+    II(a, b, c, d, x[0], S41, 0xf4292244);  /* 49 */
+    II(d, a, b, c, x[7], S42, 0x432aff97);  /* 50 */
+    II(c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
+    II(b, c, d, a, x[5], S44, 0xfc93a039);  /* 52 */
+    II(a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
+    II(d, a, b, c, x[3], S42, 0x8f0ccc92);  /* 54 */
+    II(c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
+    II(b, c, d, a, x[1], S44, 0x85845dd1);  /* 56 */
+    II(a, b, c, d, x[8], S41, 0x6fa87e4f);  /* 57 */
+    II(d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
+    II(c, d, a, b, x[6], S43, 0xa3014314);  /* 59 */
+    II(b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
+    II(a, b, c, d, x[4], S41, 0xf7537e82);  /* 61 */
+    II(d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
+    II(c, d, a, b, x[2], S43, 0x2ad7d2bb);  /* 63 */
+    II(b, c, d, a, x[9], S44, 0xeb86d391);  /* 64 */
 
     state[0] += a;
     state[1] += b;
@@ -280,16 +282,16 @@ static void MD5Transform(uint32_t state[4], const uint8_t block[64])
  * Encodes input (uint32_t) into output (uint8_t). Assumes len is
  *   a multiple of 4.
  */
-static void Encode(uint8_t *output, uint32_t *input, uint32_t len)
+static void Encode(uint8_t* output, uint32_t* input, uint32_t len)
 {
     uint32_t i, j;
 
-    for (i = 0, j = 0; j < len; i++, j += 4) 
+    for (i = 0, j = 0; j < len; i++, j += 4)
     {
-        output[j] = (uint8_t)(input[i] & 0xff);
-        output[j+1] = (uint8_t)((input[i] >> 8) & 0xff);
-        output[j+2] = (uint8_t)((input[i] >> 16) & 0xff);
-        output[j+3] = (uint8_t)((input[i] >> 24) & 0xff);
+        output[j]     = (uint8_t)(input[i] & 0xff);
+        output[j + 1] = (uint8_t)((input[i] >> 8) & 0xff);
+        output[j + 2] = (uint8_t)((input[i] >> 16) & 0xff);
+        output[j + 3] = (uint8_t)((input[i] >> 24) & 0xff);
     }
 }
 
@@ -297,11 +299,10 @@ static void Encode(uint8_t *output, uint32_t *input, uint32_t len)
  *  Decodes input (uint8_t) into output (uint32_t). Assumes len is
  *   a multiple of 4.
  */
-static void Decode(uint32_t *output, const uint8_t *input, uint32_t len)
+static void Decode(uint32_t* output, const uint8_t* input, uint32_t len)
 {
     uint32_t i, j;
 
     for (i = 0, j = 0; j < len; i++, j += 4)
-        output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j+1]) << 8) |
-            (((uint32_t)input[j+2]) << 16) | (((uint32_t)input[j+3]) << 24);
+        output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j + 1]) << 8) | (((uint32_t)input[j + 2]) << 16) | (((uint32_t)input[j + 3]) << 24);
 }
diff --git a/tests/host/common/mock.h b/tests/host/common/mock.h
index 56919ee60a..d11714df0e 100644
--- a/tests/host/common/mock.h
+++ b/tests/host/common/mock.h
@@ -30,7 +30,7 @@
 */
 
 #define CORE_MOCK 1
-#define MOCK "(mock) " // TODO: provide common logging API instead of adding this string everywhere?
+#define MOCK "(mock) "  // TODO: provide common logging API instead of adding this string everywhere?
 
 //
 
@@ -57,15 +57,15 @@
 #include <stddef.h>
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
-// TODO: #include <stdlib_noniso.h> ?
-char* itoa (int val, char *s, int radix);
-char* ltoa (long val, char *s, int radix);
+    // TODO: #include <stdlib_noniso.h> ?
+    char* itoa(int val, char* s, int radix);
+    char* ltoa(long val, char* s, int radix);
 
-
-size_t strlcat(char *dst, const char *src, size_t size);
-size_t strlcpy(char *dst, const char *src, size_t size);
+    size_t strlcat(char* dst, const char* src, size_t size);
+    size_t strlcpy(char* dst, const char* src, size_t size);
 
 #ifdef __cplusplus
 }
@@ -74,7 +74,7 @@ size_t strlcpy(char *dst, const char *src, size_t size);
 // exotic typedefs used in the sdk
 
 #include <stdint.h>
-typedef uint8_t uint8;
+typedef uint8_t  uint8;
 typedef uint32_t uint32;
 
 //
@@ -97,26 +97,30 @@ uint32_t esp_get_cycle_count();
 //
 
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 #include <osapi.h>
-int ets_printf (const char* fmt, ...) __attribute__ ((format (printf, 1, 2)));
+    int ets_printf(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
 #define os_printf_plus printf
 #define ets_vsnprintf vsnprintf
-inline void ets_putc (char c) { putchar(c); }
+    inline void ets_putc(char c)
+    {
+        putchar(c);
+    }
 
-int mockverbose (const char* fmt, ...) __attribute__ ((format (printf, 1, 2)));
+    int mockverbose(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
 
-extern const char* host_interface; // cmdline parameter
-extern bool serial_timestamp;
-extern int mock_port_shifter;
-extern bool blocking_uart;
-extern uint32_t global_source_address; // 0 = INADDR_ANY by default
+    extern const char* host_interface;  // cmdline parameter
+    extern bool        serial_timestamp;
+    extern int         mock_port_shifter;
+    extern bool        blocking_uart;
+    extern uint32_t    global_source_address;  // 0 = INADDR_ANY by default
 
 #define NO_GLOBAL_BINDING 0xffffffff
-extern uint32_t global_ipv4_netfmt; // selected interface addresse to bind to
+    extern uint32_t global_ipv4_netfmt;  // selected interface addresse to bind to
 
-void loop_end();
+    void loop_end();
 
 #ifdef __cplusplus
 }
@@ -132,41 +136,42 @@ void loop_end();
 
 // uart
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
-void uart_new_data(const int uart_nr, uint8_t data);
+    void uart_new_data(const int uart_nr, uint8_t data);
 #ifdef __cplusplus
 }
 #endif
 
 // tcp
-int    mockSockSetup  (int sock);
-int    mockConnect    (uint32_t addr, int& sock, int port);
-ssize_t mockFillInBuf (int sock, char* ccinbuf, size_t& ccinbufsize);
-ssize_t mockPeekBytes (int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
-ssize_t mockRead      (int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
-ssize_t mockWrite     (int sock, const uint8_t* data, size_t size, int timeout_ms);
-int serverAccept (int sock);
+int     mockSockSetup(int sock);
+int     mockConnect(uint32_t addr, int& sock, int port);
+ssize_t mockFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize);
+ssize_t mockPeekBytes(int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
+ssize_t mockRead(int sock, char* dst, size_t size, int timeout_ms, char* buf, size_t& bufsize);
+ssize_t mockWrite(int sock, const uint8_t* data, size_t size, int timeout_ms);
+int     serverAccept(int sock);
 
 // udp
-void check_incoming_udp ();
-int mockUDPSocket ();
-bool mockUDPListen (int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast = 0);
-size_t mockUDPFillInBuf (int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port);
-size_t mockUDPPeekBytes (int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
-size_t mockUDPRead (int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
-size_t mockUDPWrite (int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port);
-void mockUDPSwallow (size_t copied, char* ccinbuf, size_t& ccinbufsize);
+void   check_incoming_udp();
+int    mockUDPSocket();
+bool   mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast = 0);
+size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port);
+size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
+size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
+size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port);
+void   mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize);
 
 class UdpContext;
-void register_udp (int sock, UdpContext* udp = nullptr);
+void register_udp(int sock, UdpContext* udp = nullptr);
 
 //
 
-void mock_start_spiffs (const String& fname, size_t size_kb, size_t block_kb = 8, size_t page_b = 512);
-void mock_stop_spiffs ();
-void mock_start_littlefs (const String& fname, size_t size_kb, size_t block_kb = 8, size_t page_b = 512);
-void mock_stop_littlefs ();
+void mock_start_spiffs(const String& fname, size_t size_kb, size_t block_kb = 8, size_t page_b = 512);
+void mock_stop_spiffs();
+void mock_start_littlefs(const String& fname, size_t size_kb, size_t block_kb = 8, size_t page_b = 512);
+void mock_stop_littlefs();
 
 //
 
@@ -174,4 +179,4 @@ void mock_stop_littlefs ();
 
 //
 
-#endif // __cplusplus
+#endif  // __cplusplus
diff --git a/tests/host/common/noniso.c b/tests/host/common/noniso.c
index 869a4b7f8e..e1ed3f1b67 100644
--- a/tests/host/common/noniso.c
+++ b/tests/host/common/noniso.c
@@ -13,7 +13,6 @@
  all copies or substantial portions of the Software.
 */
 
-
 #include <stdlib.h>
 #include <string.h>
 #include <stdbool.h>
@@ -21,61 +20,69 @@
 #include <math.h>
 #include "stdlib_noniso.h"
 
-
-void reverse(char* begin, char* end) {
-    char *is = begin;
-    char *ie = end - 1;
-    while(is < ie) {
+void reverse(char* begin, char* end)
+{
+    char* is = begin;
+    char* ie = end - 1;
+    while (is < ie)
+    {
         char tmp = *ie;
-        *ie = *is;
-        *is = tmp;
+        *ie      = *is;
+        *is      = tmp;
         ++is;
         --ie;
     }
 }
 
-char* utoa(unsigned value, char* result, int base) {
-    if(base < 2 || base > 16) {
+char* utoa(unsigned value, char* result, int base)
+{
+    if (base < 2 || base > 16)
+    {
         *result = 0;
         return result;
     }
 
-    char* out = result;
+    char*    out      = result;
     unsigned quotient = value;
 
-    do {
+    do
+    {
         const unsigned tmp = quotient / base;
-        *out = "0123456789abcdef"[quotient - (tmp * base)];
+        *out               = "0123456789abcdef"[quotient - (tmp * base)];
         ++out;
         quotient = tmp;
-    } while(quotient);
+    } while (quotient);
 
     reverse(result, out);
     *out = 0;
     return result;
 }
 
-char* itoa(int value, char* result, int base) {
-    if(base < 2 || base > 16) {
+char* itoa(int value, char* result, int base)
+{
+    if (base < 2 || base > 16)
+    {
         *result = 0;
         return result;
     }
-    if (base != 10) {
-	return utoa((unsigned)value, result, base);
-   }
+    if (base != 10)
+    {
+        return utoa((unsigned)value, result, base);
+    }
 
-    char* out = result;
-    int quotient = abs(value);
+    char* out      = result;
+    int   quotient = abs(value);
 
-    do {
+    do
+    {
         const int tmp = quotient / base;
-        *out = "0123456789abcdef"[quotient - (tmp * base)];
+        *out          = "0123456789abcdef"[quotient - (tmp * base)];
         ++out;
         quotient = tmp;
-    } while(quotient);
+    } while (quotient);
 
     // Apply negative sign
-    if(value < 0)
+    if (value < 0)
         *out++ = '-';
 
     reverse(result, out);
@@ -83,17 +90,19 @@ char* itoa(int value, char* result, int base) {
     return result;
 }
 
-int atoi(const char* s) {
-    return (int) atol(s);
+int atoi(const char* s)
+{
+    return (int)atol(s);
 }
 
-long atol(const char* s) {
-    char * tmp;
+long atol(const char* s)
+{
+    char* tmp;
     return strtol(s, &tmp, 10);
 }
 
-double atof(const char* s) {
-    char * tmp;
+double atof(const char* s)
+{
+    char* tmp;
     return strtod(s, &tmp);
 }
-
diff --git a/tests/host/common/pins_arduino.h b/tests/host/common/pins_arduino.h
index ad051ed24a..c3a66453b7 100644
--- a/tests/host/common/pins_arduino.h
+++ b/tests/host/common/pins_arduino.h
@@ -15,5 +15,4 @@
 #ifndef pins_arduino_h
 #define pins_arduino_h
 
-
 #endif /* pins_arduino_h */
diff --git a/tests/host/common/queue.h b/tests/host/common/queue.h
index af637ca030..6d7e015045 100644
--- a/tests/host/common/queue.h
+++ b/tests/host/common/queue.h
@@ -35,9 +35,9 @@
  */
 
 #ifndef _SYS_QUEUE_H_
-#define	_SYS_QUEUE_H_
+#define _SYS_QUEUE_H_
 
-#include <machine/ansi.h>	/* for __offsetof */
+#include <machine/ansi.h> /* for __offsetof */
 
 /*
  * This file defines four types of data structures: singly-linked lists,
@@ -106,322 +106,382 @@
 /*
  * Singly-linked List declarations.
  */
-#define	SLIST_HEAD(name, type)						\
-struct name {								\
-	struct type *slh_first;	/* first element */			\
-}
+#define SLIST_HEAD(name, type)                      \
+    struct name                                     \
+    {                                               \
+        struct type* slh_first; /* first element */ \
+    }
+
+#define SLIST_HEAD_INITIALIZER(head) \
+    {                                \
+        NULL                         \
+    }
+
+#define SLIST_ENTRY(type)                         \
+    struct                                        \
+    {                                             \
+        struct type* sle_next; /* next element */ \
+    }
 
-#define	SLIST_HEAD_INITIALIZER(head)					\
-	{ NULL }
- 
-#define	SLIST_ENTRY(type)						\
-struct {								\
-	struct type *sle_next;	/* next element */			\
-}
- 
 /*
  * Singly-linked List functions.
  */
-#define	SLIST_EMPTY(head)	((head)->slh_first == NULL)
-
-#define	SLIST_FIRST(head)	((head)->slh_first)
-
-#define	SLIST_FOREACH(var, head, field)					\
-	for ((var) = SLIST_FIRST((head));				\
-	    (var);							\
-	    (var) = SLIST_NEXT((var), field))
-
-#define	SLIST_INIT(head) do {						\
-	SLIST_FIRST((head)) = NULL;					\
-} while (0)
-
-#define	SLIST_INSERT_AFTER(slistelm, elm, field) do {			\
-	SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field);	\
-	SLIST_NEXT((slistelm), field) = (elm);				\
-} while (0)
-
-#define	SLIST_INSERT_HEAD(head, elm, field) do {			\
-	SLIST_NEXT((elm), field) = SLIST_FIRST((head));			\
-	SLIST_FIRST((head)) = (elm);					\
-} while (0)
-
-#define	SLIST_NEXT(elm, field)	((elm)->field.sle_next)
-
-#define	SLIST_REMOVE(head, elm, type, field) do {			\
-	if (SLIST_FIRST((head)) == (elm)) {				\
-		SLIST_REMOVE_HEAD((head), field);			\
-	}								\
-	else {								\
-		struct type *curelm = SLIST_FIRST((head));		\
-		while (SLIST_NEXT(curelm, field) != (elm))		\
-			curelm = SLIST_NEXT(curelm, field);		\
-		SLIST_NEXT(curelm, field) =				\
-		    SLIST_NEXT(SLIST_NEXT(curelm, field), field);	\
-	}								\
-} while (0)
-
-#define	SLIST_REMOVE_HEAD(head, field) do {				\
-	SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field);	\
-} while (0)
+#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
+
+#define SLIST_FIRST(head) ((head)->slh_first)
+
+#define SLIST_FOREACH(var, head, field) \
+    for ((var) = SLIST_FIRST((head));   \
+         (var);                         \
+         (var) = SLIST_NEXT((var), field))
+
+#define SLIST_INIT(head)            \
+    do                              \
+    {                               \
+        SLIST_FIRST((head)) = NULL; \
+    } while (0)
+
+#define SLIST_INSERT_AFTER(slistelm, elm, field)                       \
+    do                                                                 \
+    {                                                                  \
+        SLIST_NEXT((elm), field)      = SLIST_NEXT((slistelm), field); \
+        SLIST_NEXT((slistelm), field) = (elm);                         \
+    } while (0)
+
+#define SLIST_INSERT_HEAD(head, elm, field)             \
+    do                                                  \
+    {                                                   \
+        SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
+        SLIST_FIRST((head))      = (elm);               \
+    } while (0)
+
+#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
+
+#define SLIST_REMOVE(head, elm, type, field)                                          \
+    do                                                                                \
+    {                                                                                 \
+        if (SLIST_FIRST((head)) == (elm))                                             \
+        {                                                                             \
+            SLIST_REMOVE_HEAD((head), field);                                         \
+        }                                                                             \
+        else                                                                          \
+        {                                                                             \
+            struct type* curelm = SLIST_FIRST((head));                                \
+            while (SLIST_NEXT(curelm, field) != (elm))                                \
+                curelm = SLIST_NEXT(curelm, field);                                   \
+            SLIST_NEXT(curelm, field) = SLIST_NEXT(SLIST_NEXT(curelm, field), field); \
+        }                                                                             \
+    } while (0)
+
+#define SLIST_REMOVE_HEAD(head, field)                                \
+    do                                                                \
+    {                                                                 \
+        SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
+    } while (0)
 
 /*
  * Singly-linked Tail queue declarations.
  */
-#define	STAILQ_HEAD(name, type)						\
-struct name {								\
-	struct type *stqh_first;/* first element */			\
-	struct type **stqh_last;/* addr of last next element */		\
-}
-
-#define	STAILQ_HEAD_INITIALIZER(head)					\
-	{ NULL, &(head).stqh_first }
-
-#define	STAILQ_ENTRY(type)						\
-struct {								\
-	struct type *stqe_next;	/* next element */			\
-}
+#define STAILQ_HEAD(name, type)                                   \
+    struct name                                                   \
+    {                                                             \
+        struct type*  stqh_first; /* first element */             \
+        struct type** stqh_last;  /* addr of last next element */ \
+    }
+
+#define STAILQ_HEAD_INITIALIZER(head) \
+    {                                 \
+        NULL, &(head).stqh_first      \
+    }
+
+#define STAILQ_ENTRY(type)                         \
+    struct                                         \
+    {                                              \
+        struct type* stqe_next; /* next element */ \
+    }
 
 /*
  * Singly-linked Tail queue functions.
  */
-#define	STAILQ_CONCAT(head1, head2) do {				\
-	if (!STAILQ_EMPTY((head2))) {					\
-		*(head1)->stqh_last = (head2)->stqh_first;		\
-		(head1)->stqh_last = (head2)->stqh_last;		\
-		STAILQ_INIT((head2));					\
-	}								\
-} while (0)
-
-#define	STAILQ_EMPTY(head)	((head)->stqh_first == NULL)
-
-#define	STAILQ_FIRST(head)	((head)->stqh_first)
-
-#define	STAILQ_FOREACH(var, head, field)				\
-	for((var) = STAILQ_FIRST((head));				\
-	   (var);							\
-	   (var) = STAILQ_NEXT((var), field))
-
-#define	STAILQ_INIT(head) do {						\
-	STAILQ_FIRST((head)) = NULL;					\
-	(head)->stqh_last = &STAILQ_FIRST((head));			\
-} while (0)
-
-#define	STAILQ_INSERT_AFTER(head, tqelm, elm, field) do {		\
-	if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
-		(head)->stqh_last = &STAILQ_NEXT((elm), field);		\
-	STAILQ_NEXT((tqelm), field) = (elm);				\
-} while (0)
-
-#define	STAILQ_INSERT_HEAD(head, elm, field) do {			\
-	if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL)	\
-		(head)->stqh_last = &STAILQ_NEXT((elm), field);		\
-	STAILQ_FIRST((head)) = (elm);					\
-} while (0)
-
-#define	STAILQ_INSERT_TAIL(head, elm, field) do {			\
-	STAILQ_NEXT((elm), field) = NULL;				\
-	*(head)->stqh_last = (elm);					\
-	(head)->stqh_last = &STAILQ_NEXT((elm), field);			\
-} while (0)
-
-#define	STAILQ_LAST(head, type, field)					\
-	(STAILQ_EMPTY((head)) ?						\
-		NULL :							\
-	        ((struct type *)					\
-		((char *)((head)->stqh_last) - __offsetof(struct type, field))))
-
-#define	STAILQ_NEXT(elm, field)	((elm)->field.stqe_next)
-
-#define	STAILQ_REMOVE(head, elm, type, field) do {			\
-	if (STAILQ_FIRST((head)) == (elm)) {				\
-		STAILQ_REMOVE_HEAD((head), field);			\
-	}								\
-	else {								\
-		struct type *curelm = STAILQ_FIRST((head));		\
-		while (STAILQ_NEXT(curelm, field) != (elm))		\
-			curelm = STAILQ_NEXT(curelm, field);		\
-		if ((STAILQ_NEXT(curelm, field) =			\
-		     STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL)\
-			(head)->stqh_last = &STAILQ_NEXT((curelm), field);\
-	}								\
-} while (0)
-
-#define	STAILQ_REMOVE_HEAD(head, field) do {				\
-	if ((STAILQ_FIRST((head)) =					\
-	     STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL)		\
-		(head)->stqh_last = &STAILQ_FIRST((head));		\
-} while (0)
-
-#define	STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do {			\
-	if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL)	\
-		(head)->stqh_last = &STAILQ_FIRST((head));		\
-} while (0)
+#define STAILQ_CONCAT(head1, head2)                    \
+    do                                                 \
+    {                                                  \
+        if (!STAILQ_EMPTY((head2)))                    \
+        {                                              \
+            *(head1)->stqh_last = (head2)->stqh_first; \
+            (head1)->stqh_last  = (head2)->stqh_last;  \
+            STAILQ_INIT((head2));                      \
+        }                                              \
+    } while (0)
+
+#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
+
+#define STAILQ_FIRST(head) ((head)->stqh_first)
+
+#define STAILQ_FOREACH(var, head, field) \
+    for ((var) = STAILQ_FIRST((head));   \
+         (var);                          \
+         (var) = STAILQ_NEXT((var), field))
+
+#define STAILQ_INIT(head)                             \
+    do                                                \
+    {                                                 \
+        STAILQ_FIRST((head)) = NULL;                  \
+        (head)->stqh_last    = &STAILQ_FIRST((head)); \
+    } while (0)
+
+#define STAILQ_INSERT_AFTER(head, tqelm, elm, field)                           \
+    do                                                                         \
+    {                                                                          \
+        if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL) \
+            (head)->stqh_last = &STAILQ_NEXT((elm), field);                    \
+        STAILQ_NEXT((tqelm), field) = (elm);                                   \
+    } while (0)
+
+#define STAILQ_INSERT_HEAD(head, elm, field)                            \
+    do                                                                  \
+    {                                                                   \
+        if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
+            (head)->stqh_last = &STAILQ_NEXT((elm), field);             \
+        STAILQ_FIRST((head)) = (elm);                                   \
+    } while (0)
+
+#define STAILQ_INSERT_TAIL(head, elm, field)                    \
+    do                                                          \
+    {                                                           \
+        STAILQ_NEXT((elm), field) = NULL;                       \
+        *(head)->stqh_last        = (elm);                      \
+        (head)->stqh_last         = &STAILQ_NEXT((elm), field); \
+    } while (0)
+
+#define STAILQ_LAST(head, type, field) \
+    (STAILQ_EMPTY((head)) ? NULL : ((struct type*)((char*)((head)->stqh_last) - __offsetof(struct type, field))))
+
+#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
+
+#define STAILQ_REMOVE(head, elm, type, field)                                                          \
+    do                                                                                                 \
+    {                                                                                                  \
+        if (STAILQ_FIRST((head)) == (elm))                                                             \
+        {                                                                                              \
+            STAILQ_REMOVE_HEAD((head), field);                                                         \
+        }                                                                                              \
+        else                                                                                           \
+        {                                                                                              \
+            struct type* curelm = STAILQ_FIRST((head));                                                \
+            while (STAILQ_NEXT(curelm, field) != (elm))                                                \
+                curelm = STAILQ_NEXT(curelm, field);                                                   \
+            if ((STAILQ_NEXT(curelm, field) = STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL) \
+                (head)->stqh_last = &STAILQ_NEXT((curelm), field);                                     \
+        }                                                                                              \
+    } while (0)
+
+#define STAILQ_REMOVE_HEAD(head, field)                                                \
+    do                                                                                 \
+    {                                                                                  \
+        if ((STAILQ_FIRST((head)) = STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
+            (head)->stqh_last = &STAILQ_FIRST((head));                                 \
+    } while (0)
+
+#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field)                      \
+    do                                                                  \
+    {                                                                   \
+        if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \
+            (head)->stqh_last = &STAILQ_FIRST((head));                  \
+    } while (0)
 
 /*
  * List declarations.
  */
-#define	LIST_HEAD(name, type)						\
-struct name {								\
-	struct type *lh_first;	/* first element */			\
-}
-
-#define	LIST_HEAD_INITIALIZER(head)					\
-	{ NULL }
-
-#define	LIST_ENTRY(type)						\
-struct {								\
-	struct type *le_next;	/* next element */			\
-	struct type **le_prev;	/* address of previous next element */	\
-}
+#define LIST_HEAD(name, type)                      \
+    struct name                                    \
+    {                                              \
+        struct type* lh_first; /* first element */ \
+    }
+
+#define LIST_HEAD_INITIALIZER(head) \
+    {                               \
+        NULL                        \
+    }
+
+#define LIST_ENTRY(type)                                              \
+    struct                                                            \
+    {                                                                 \
+        struct type*  le_next; /* next element */                     \
+        struct type** le_prev; /* address of previous next element */ \
+    }
 
 /*
  * List functions.
  */
 
-#define	LIST_EMPTY(head)	((head)->lh_first == NULL)
-
-#define	LIST_FIRST(head)	((head)->lh_first)
-
-#define	LIST_FOREACH(var, head, field)					\
-	for ((var) = LIST_FIRST((head));				\
-	    (var);							\
-	    (var) = LIST_NEXT((var), field))
-
-#define	LIST_INIT(head) do {						\
-	LIST_FIRST((head)) = NULL;					\
-} while (0)
-
-#define	LIST_INSERT_AFTER(listelm, elm, field) do {			\
-	if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
-		LIST_NEXT((listelm), field)->field.le_prev =		\
-		    &LIST_NEXT((elm), field);				\
-	LIST_NEXT((listelm), field) = (elm);				\
-	(elm)->field.le_prev = &LIST_NEXT((listelm), field);		\
-} while (0)
-
-#define	LIST_INSERT_BEFORE(listelm, elm, field) do {			\
-	(elm)->field.le_prev = (listelm)->field.le_prev;		\
-	LIST_NEXT((elm), field) = (listelm);				\
-	*(listelm)->field.le_prev = (elm);				\
-	(listelm)->field.le_prev = &LIST_NEXT((elm), field);		\
-} while (0)
-
-#define	LIST_INSERT_HEAD(head, elm, field) do {				\
-	if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL)	\
-		LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
-	LIST_FIRST((head)) = (elm);					\
-	(elm)->field.le_prev = &LIST_FIRST((head));			\
-} while (0)
-
-#define	LIST_NEXT(elm, field)	((elm)->field.le_next)
-
-#define	LIST_REMOVE(elm, field) do {					\
-	if (LIST_NEXT((elm), field) != NULL)				\
-		LIST_NEXT((elm), field)->field.le_prev = 		\
-		    (elm)->field.le_prev;				\
-	*(elm)->field.le_prev = LIST_NEXT((elm), field);		\
-} while (0)
+#define LIST_EMPTY(head) ((head)->lh_first == NULL)
+
+#define LIST_FIRST(head) ((head)->lh_first)
+
+#define LIST_FOREACH(var, head, field) \
+    for ((var) = LIST_FIRST((head));   \
+         (var);                        \
+         (var) = LIST_NEXT((var), field))
+
+#define LIST_INIT(head)            \
+    do                             \
+    {                              \
+        LIST_FIRST((head)) = NULL; \
+    } while (0)
+
+#define LIST_INSERT_AFTER(listelm, elm, field)                                     \
+    do                                                                             \
+    {                                                                              \
+        if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)       \
+            LIST_NEXT((listelm), field)->field.le_prev = &LIST_NEXT((elm), field); \
+        LIST_NEXT((listelm), field) = (elm);                                       \
+        (elm)->field.le_prev        = &LIST_NEXT((listelm), field);                \
+    } while (0)
+
+#define LIST_INSERT_BEFORE(listelm, elm, field)               \
+    do                                                        \
+    {                                                         \
+        (elm)->field.le_prev      = (listelm)->field.le_prev; \
+        LIST_NEXT((elm), field)   = (listelm);                \
+        *(listelm)->field.le_prev = (elm);                    \
+        (listelm)->field.le_prev  = &LIST_NEXT((elm), field); \
+    } while (0)
+
+#define LIST_INSERT_HEAD(head, elm, field)                                \
+    do                                                                    \
+    {                                                                     \
+        if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL)       \
+            LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field); \
+        LIST_FIRST((head))   = (elm);                                     \
+        (elm)->field.le_prev = &LIST_FIRST((head));                       \
+    } while (0)
+
+#define LIST_NEXT(elm, field) ((elm)->field.le_next)
+
+#define LIST_REMOVE(elm, field)                                            \
+    do                                                                     \
+    {                                                                      \
+        if (LIST_NEXT((elm), field) != NULL)                               \
+            LIST_NEXT((elm), field)->field.le_prev = (elm)->field.le_prev; \
+        *(elm)->field.le_prev = LIST_NEXT((elm), field);                   \
+    } while (0)
 
 /*
  * Tail queue declarations.
  */
-#define	TAILQ_HEAD(name, type)						\
-struct name {								\
-	struct type *tqh_first;	/* first element */			\
-	struct type **tqh_last;	/* addr of last next element */		\
-}
-
-#define	TAILQ_HEAD_INITIALIZER(head)					\
-	{ NULL, &(head).tqh_first }
-
-#define	TAILQ_ENTRY(type)						\
-struct {								\
-	struct type *tqe_next;	/* next element */			\
-	struct type **tqe_prev;	/* address of previous next element */	\
-}
+#define TAILQ_HEAD(name, type)                                   \
+    struct name                                                  \
+    {                                                            \
+        struct type*  tqh_first; /* first element */             \
+        struct type** tqh_last;  /* addr of last next element */ \
+    }
+
+#define TAILQ_HEAD_INITIALIZER(head) \
+    {                                \
+        NULL, &(head).tqh_first      \
+    }
+
+#define TAILQ_ENTRY(type)                                              \
+    struct                                                             \
+    {                                                                  \
+        struct type*  tqe_next; /* next element */                     \
+        struct type** tqe_prev; /* address of previous next element */ \
+    }
 
 /*
  * Tail queue functions.
  */
-#define	TAILQ_CONCAT(head1, head2, field) do {				\
-	if (!TAILQ_EMPTY(head2)) {					\
-		*(head1)->tqh_last = (head2)->tqh_first;		\
-		(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last;	\
-		(head1)->tqh_last = (head2)->tqh_last;			\
-		TAILQ_INIT((head2));					\
-	}								\
-} while (0)
-
-#define	TAILQ_EMPTY(head)	((head)->tqh_first == NULL)
-
-#define	TAILQ_FIRST(head)	((head)->tqh_first)
-
-#define	TAILQ_FOREACH(var, head, field)					\
-	for ((var) = TAILQ_FIRST((head));				\
-	    (var);							\
-	    (var) = TAILQ_NEXT((var), field))
-
-#define	TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
-	for ((var) = TAILQ_LAST((head), headname);			\
-	    (var);							\
-	    (var) = TAILQ_PREV((var), headname, field))
-
-#define	TAILQ_INIT(head) do {						\
-	TAILQ_FIRST((head)) = NULL;					\
-	(head)->tqh_last = &TAILQ_FIRST((head));			\
-} while (0)
-
-#define	TAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
-	if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
-		TAILQ_NEXT((elm), field)->field.tqe_prev = 		\
-		    &TAILQ_NEXT((elm), field);				\
-	else								\
-		(head)->tqh_last = &TAILQ_NEXT((elm), field);		\
-	TAILQ_NEXT((listelm), field) = (elm);				\
-	(elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field);		\
-} while (0)
-
-#define	TAILQ_INSERT_BEFORE(listelm, elm, field) do {			\
-	(elm)->field.tqe_prev = (listelm)->field.tqe_prev;		\
-	TAILQ_NEXT((elm), field) = (listelm);				\
-	*(listelm)->field.tqe_prev = (elm);				\
-	(listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field);		\
-} while (0)
-
-#define	TAILQ_INSERT_HEAD(head, elm, field) do {			\
-	if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL)	\
-		TAILQ_FIRST((head))->field.tqe_prev =			\
-		    &TAILQ_NEXT((elm), field);				\
-	else								\
-		(head)->tqh_last = &TAILQ_NEXT((elm), field);		\
-	TAILQ_FIRST((head)) = (elm);					\
-	(elm)->field.tqe_prev = &TAILQ_FIRST((head));			\
-} while (0)
-
-#define	TAILQ_INSERT_TAIL(head, elm, field) do {			\
-	TAILQ_NEXT((elm), field) = NULL;				\
-	(elm)->field.tqe_prev = (head)->tqh_last;			\
-	*(head)->tqh_last = (elm);					\
-	(head)->tqh_last = &TAILQ_NEXT((elm), field);			\
-} while (0)
-
-#define	TAILQ_LAST(head, headname)					\
-	(*(((struct headname *)((head)->tqh_last))->tqh_last))
-
-#define	TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
-
-#define	TAILQ_PREV(elm, headname, field)				\
-	(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
-
-#define	TAILQ_REMOVE(head, elm, field) do {				\
-	if ((TAILQ_NEXT((elm), field)) != NULL)				\
-		TAILQ_NEXT((elm), field)->field.tqe_prev = 		\
-		    (elm)->field.tqe_prev;				\
-	else								\
-		(head)->tqh_last = (elm)->field.tqe_prev;		\
-	*(elm)->field.tqe_prev = TAILQ_NEXT((elm), field);		\
-} while (0)
-
+#define TAILQ_CONCAT(head1, head2, field)                            \
+    do                                                               \
+    {                                                                \
+        if (!TAILQ_EMPTY(head2))                                     \
+        {                                                            \
+            *(head1)->tqh_last                 = (head2)->tqh_first; \
+            (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last;  \
+            (head1)->tqh_last                  = (head2)->tqh_last;  \
+            TAILQ_INIT((head2));                                     \
+        }                                                            \
+    } while (0)
+
+#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
+
+#define TAILQ_FIRST(head) ((head)->tqh_first)
+
+#define TAILQ_FOREACH(var, head, field) \
+    for ((var) = TAILQ_FIRST((head));   \
+         (var);                         \
+         (var) = TAILQ_NEXT((var), field))
+
+#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
+    for ((var) = TAILQ_LAST((head), headname);            \
+         (var);                                           \
+         (var) = TAILQ_PREV((var), headname, field))
+
+#define TAILQ_INIT(head)                            \
+    do                                              \
+    {                                               \
+        TAILQ_FIRST((head)) = NULL;                 \
+        (head)->tqh_last    = &TAILQ_FIRST((head)); \
+    } while (0)
+
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field)                             \
+    do                                                                            \
+    {                                                                             \
+        if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)    \
+            TAILQ_NEXT((elm), field)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
+        else                                                                      \
+            (head)->tqh_last = &TAILQ_NEXT((elm), field);                         \
+        TAILQ_NEXT((listelm), field) = (elm);                                     \
+        (elm)->field.tqe_prev        = &TAILQ_NEXT((listelm), field);             \
+    } while (0)
+
+#define TAILQ_INSERT_BEFORE(listelm, elm, field)                \
+    do                                                          \
+    {                                                           \
+        (elm)->field.tqe_prev      = (listelm)->field.tqe_prev; \
+        TAILQ_NEXT((elm), field)   = (listelm);                 \
+        *(listelm)->field.tqe_prev = (elm);                     \
+        (listelm)->field.tqe_prev  = &TAILQ_NEXT((elm), field); \
+    } while (0)
+
+#define TAILQ_INSERT_HEAD(head, elm, field)                                  \
+    do                                                                       \
+    {                                                                        \
+        if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL)        \
+            TAILQ_FIRST((head))->field.tqe_prev = &TAILQ_NEXT((elm), field); \
+        else                                                                 \
+            (head)->tqh_last = &TAILQ_NEXT((elm), field);                    \
+        TAILQ_FIRST((head))   = (elm);                                       \
+        (elm)->field.tqe_prev = &TAILQ_FIRST((head));                        \
+    } while (0)
+
+#define TAILQ_INSERT_TAIL(head, elm, field)                   \
+    do                                                        \
+    {                                                         \
+        TAILQ_NEXT((elm), field) = NULL;                      \
+        (elm)->field.tqe_prev    = (head)->tqh_last;          \
+        *(head)->tqh_last        = (elm);                     \
+        (head)->tqh_last         = &TAILQ_NEXT((elm), field); \
+    } while (0)
+
+#define TAILQ_LAST(head, headname) \
+    (*(((struct headname*)((head)->tqh_last))->tqh_last))
+
+#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+
+#define TAILQ_PREV(elm, headname, field) \
+    (*(((struct headname*)((elm)->field.tqe_prev))->tqh_last))
+
+#define TAILQ_REMOVE(head, elm, field)                                        \
+    do                                                                        \
+    {                                                                         \
+        if ((TAILQ_NEXT((elm), field)) != NULL)                               \
+            TAILQ_NEXT((elm), field)->field.tqe_prev = (elm)->field.tqe_prev; \
+        else                                                                  \
+            (head)->tqh_last = (elm)->field.tqe_prev;                         \
+        *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field);                    \
+    } while (0)
 
 #ifdef _KERNEL
 
@@ -430,39 +490,40 @@ struct {								\
  * They bogusly assumes that all queue heads look alike.
  */
 
-struct quehead {
-	struct quehead *qh_link;
-	struct quehead *qh_rlink;
+struct quehead
+{
+    struct quehead* qh_link;
+    struct quehead* qh_rlink;
 };
 
-#ifdef	__GNUC__
+#ifdef __GNUC__
 
 static __inline void
-insque(void *a, void *b)
+insque(void* a, void* b)
 {
-	struct quehead *element = (struct quehead *)a,
-		 *head = (struct quehead *)b;
+    struct quehead *element = (struct quehead*)a,
+                   *head    = (struct quehead*)b;
 
-	element->qh_link = head->qh_link;
-	element->qh_rlink = head;
-	head->qh_link = element;
-	element->qh_link->qh_rlink = element;
+    element->qh_link           = head->qh_link;
+    element->qh_rlink          = head;
+    head->qh_link              = element;
+    element->qh_link->qh_rlink = element;
 }
 
 static __inline void
-remque(void *a)
+remque(void* a)
 {
-	struct quehead *element = (struct quehead *)a;
+    struct quehead* element = (struct quehead*)a;
 
-	element->qh_link->qh_rlink = element->qh_rlink;
-	element->qh_rlink->qh_link = element->qh_link;
-	element->qh_rlink = 0;
+    element->qh_link->qh_rlink = element->qh_rlink;
+    element->qh_rlink->qh_link = element->qh_link;
+    element->qh_rlink          = 0;
 }
 
 #else /* !__GNUC__ */
 
-void	insque(void *a, void *b);
-void	remque(void *a);
+void insque(void* a, void* b);
+void remque(void* a);
 
 #endif /* __GNUC__ */
 
diff --git a/tests/host/common/spiffs_mock.cpp b/tests/host/common/spiffs_mock.cpp
index c7f9f53aba..c54cab3053 100644
--- a/tests/host/common/spiffs_mock.cpp
+++ b/tests/host/common/spiffs_mock.cpp
@@ -13,7 +13,6 @@
  all copies or substantial portions of the Software.
 */
 
-
 #include "spiffs_mock.h"
 #include "spiffs/spiffs.h"
 #include "debug.h"
@@ -72,18 +71,18 @@ SpiffsMock::~SpiffsMock()
     SPIFFS = FS(FSImplPtr(nullptr));
 }
 
-void SpiffsMock::load ()
+void SpiffsMock::load()
 {
     if (!m_fs.size() || !m_storage.length())
         return;
-    
+
     int fs = ::open(m_storage.c_str(), O_RDONLY);
     if (fs == -1)
     {
         fprintf(stderr, "SPIFFS: loading '%s': %s\n", m_storage.c_str(), strerror(errno));
         return;
     }
-    
+
     off_t flen = lseek(fs, 0, SEEK_END);
     if (flen == (off_t)-1)
     {
@@ -91,7 +90,7 @@ void SpiffsMock::load ()
         return;
     }
     lseek(fs, 0, SEEK_SET);
-    
+
     if (flen != (off_t)m_fs.size())
     {
         fprintf(stderr, "SPIFFS: size of '%s': %d does not match requested size %zd\n", m_storage.c_str(), (int)flen, m_fs.size());
@@ -112,7 +111,7 @@ void SpiffsMock::load ()
     ::close(fs);
 }
 
-void SpiffsMock::save ()
+void SpiffsMock::save()
 {
     if (!m_fs.size() || !m_storage.length())
         return;
@@ -132,4 +131,3 @@ void SpiffsMock::save ()
 }
 
 #pragma GCC diagnostic pop
-
diff --git a/tests/host/common/spiffs_mock.h b/tests/host/common/spiffs_mock.h
index 4c265964f5..18217a7ac5 100644
--- a/tests/host/common/spiffs_mock.h
+++ b/tests/host/common/spiffs_mock.h
@@ -24,19 +24,20 @@
 
 #define DEFAULT_SPIFFS_FILE_NAME "spiffs.bin"
 
-class SpiffsMock {
+class SpiffsMock
+{
 public:
     SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString);
     void reset();
     ~SpiffsMock();
-    
+
 protected:
-    void load ();
-    void save ();
+    void load();
+    void save();
 
     std::vector<uint8_t> m_fs;
-    String m_storage;
-    bool m_overwrite;
+    String               m_storage;
+    bool                 m_overwrite;
 };
 
 #define SPIFFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage) SpiffsMock spiffs_mock(size_kb * 1024, block_kb * 1024, page_b, storage)
diff --git a/tests/host/common/user_interface.cpp b/tests/host/common/user_interface.cpp
index 4e03d77786..3b7f1226b5 100644
--- a/tests/host/common/user_interface.cpp
+++ b/tests/host/common/user_interface.cpp
@@ -43,7 +43,7 @@
 
 #include <LwipDhcpServer.h>
 
-bool DhcpServer::set_dhcps_lease(struct dhcps_lease *please)
+bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
 {
     (void)please;
     return false;
@@ -62,22 +62,22 @@ bool DhcpServer::set_dhcps_offer_option(uint8 level, void* optarg)
     return false;
 }
 
-void DhcpServer::end ()
+void DhcpServer::end()
 {
 }
 
-bool DhcpServer::begin (struct ip_info *info)
+bool DhcpServer::begin(struct ip_info* info)
 {
     (void)info;
     return false;
 }
 
-DhcpServer::DhcpServer (netif* netif)
+DhcpServer::DhcpServer(netif* netif)
 {
     (void)netif;
 }
 
-DhcpServer::~DhcpServer ()
+DhcpServer::~DhcpServer()
 {
     end();
 }
@@ -86,7 +86,6 @@ DhcpServer dhcpSoftAP(nullptr);
 
 extern "C"
 {
-
 #include <user_interface.h>
 #include <lwip/netif.h>
 
@@ -120,14 +119,14 @@ extern "C"
         return 1;
     }
 
-    bool wifi_station_get_config(struct station_config *config)
+    bool wifi_station_get_config(struct station_config* config)
     {
         strcpy((char*)config->ssid, "emulated-ssid");
         strcpy((char*)config->password, "emulated-ssid-password");
         config->bssid_set = 0;
         for (int i = 0; i < 6; i++)
             config->bssid[i] = i;
-        config->threshold.rssi = 1;
+        config->threshold.rssi     = 1;
         config->threshold.authmode = AUTH_WPA_PSK;
 #ifdef NONOSDK3V0
         config->open_and_wep_mode_disable = true;
@@ -158,21 +157,21 @@ extern "C"
         (void)type;
     }
 
-    uint32_t global_ipv4_netfmt = 0; // global binding
+    uint32_t global_ipv4_netfmt = 0;  // global binding
 
-    netif netif0;
+    netif    netif0;
     uint32_t global_source_address = INADDR_ANY;
 
-    bool wifi_get_ip_info(uint8 if_index, struct ip_info *info)
+    bool wifi_get_ip_info(uint8 if_index, struct ip_info* info)
     {
         // emulate wifi_get_ip_info()
         // ignore if_index
         // use global option -i (host_interface) to select bound interface/address
 
-        struct ifaddrs * ifAddrStruct = NULL, * ifa = NULL;
-        uint32_t ipv4 = lwip_htonl(0x7f000001);
-        uint32_t mask = lwip_htonl(0xff000000);
-        global_source_address = INADDR_ANY; // =0
+        struct ifaddrs *ifAddrStruct = NULL, *ifa = NULL;
+        uint32_t        ipv4  = lwip_htonl(0x7f000001);
+        uint32_t        mask  = lwip_htonl(0xff000000);
+        global_source_address = INADDR_ANY;  // =0
 
         if (getifaddrs(&ifAddrStruct) != 0)
         {
@@ -187,10 +186,10 @@ extern "C"
         {
             mockverbose("host: interface: %s", ifa->ifa_name);
             if (ifa->ifa_addr
-                    && ifa->ifa_addr->sa_family == AF_INET // ip_info is IPv4 only
-               )
+                && ifa->ifa_addr->sa_family == AF_INET  // ip_info is IPv4 only
+            )
             {
-                auto test_ipv4 = lwip_ntohl(*(uint32_t*) & ((struct sockaddr_in*)ifa->ifa_addr)->sin_addr);
+                auto test_ipv4 = lwip_ntohl(*(uint32_t*)&((struct sockaddr_in*)ifa->ifa_addr)->sin_addr);
                 mockverbose(" IPV4 (0x%08lx)", test_ipv4);
                 if ((test_ipv4 & 0xff000000) == 0x7f000000)
                     // 127./8
@@ -200,8 +199,8 @@ extern "C"
                     if (!host_interface || (host_interface && strcmp(ifa->ifa_name, host_interface) == 0))
                     {
                         // use the first non-local interface, or, if specified, the one selected by user on cmdline
-                        ipv4 = *(uint32_t*) & ((struct sockaddr_in*)ifa->ifa_addr)->sin_addr;
-                        mask = *(uint32_t*) & ((struct sockaddr_in*)ifa->ifa_netmask)->sin_addr;
+                        ipv4 = *(uint32_t*)&((struct sockaddr_in*)ifa->ifa_addr)->sin_addr;
+                        mask = *(uint32_t*)&((struct sockaddr_in*)ifa->ifa_netmask)->sin_addr;
                         mockverbose(" (selected)\n");
                         if (host_interface)
                             global_source_address = ntohl(ipv4);
@@ -224,15 +223,15 @@ extern "C"
 
         if (info)
         {
-            info->ip.addr = ipv4;
+            info->ip.addr      = ipv4;
             info->netmask.addr = mask;
-            info->gw.addr = ipv4;
+            info->gw.addr      = ipv4;
 
             netif0.ip_addr.addr = ipv4;
             netif0.netmask.addr = mask;
-            netif0.gw.addr = ipv4;
-            netif0.flags = NETIF_FLAG_IGMP | NETIF_FLAG_UP | NETIF_FLAG_LINK_UP;
-            netif0.next = nullptr;
+            netif0.gw.addr      = ipv4;
+            netif0.flags        = NETIF_FLAG_IGMP | NETIF_FLAG_UP | NETIF_FLAG_LINK_UP;
+            netif0.next         = nullptr;
         }
 
         return true;
@@ -243,7 +242,7 @@ extern "C"
         return 1;
     }
 
-    bool wifi_get_macaddr(uint8 if_index, uint8 *macaddr)
+    bool wifi_get_macaddr(uint8 if_index, uint8* macaddr)
     {
         (void)if_index;
         macaddr[0] = 0xde;
@@ -267,7 +266,7 @@ extern "C"
         return MIN_SLEEP_T;
     }
 
-#endif // nonos-sdk-pre-3
+#endif  // nonos-sdk-pre-3
 
     sleep_type_t wifi_get_sleep_type(void)
     {
@@ -281,13 +280,13 @@ extern "C"
     }
 
     wifi_event_handler_cb_t wifi_event_handler_cb_emu = nullptr;
-    void wifi_set_event_handler_cb(wifi_event_handler_cb_t cb)
+    void                    wifi_set_event_handler_cb(wifi_event_handler_cb_t cb)
     {
         wifi_event_handler_cb_emu = cb;
         mockverbose("TODO: wifi_set_event_handler_cb set\n");
     }
 
-    bool wifi_set_ip_info(uint8 if_index, struct ip_info *info)
+    bool wifi_set_ip_info(uint8 if_index, struct ip_info* info)
     {
         (void)if_index;
         (void)info;
@@ -352,12 +351,12 @@ extern "C"
         return true;
     }
 
-    bool wifi_station_get_config_default(struct station_config *config)
+    bool wifi_station_get_config_default(struct station_config* config)
     {
         return wifi_station_get_config(config);
     }
 
-    char wifi_station_get_hostname_str [128];
+    char        wifi_station_get_hostname_str[128];
     const char* wifi_station_get_hostname(void)
     {
         return strcpy(wifi_station_get_hostname_str, "esposix");
@@ -378,19 +377,19 @@ extern "C"
         return set != 0;
     }
 
-    bool wifi_station_set_config(struct station_config *config)
+    bool wifi_station_set_config(struct station_config* config)
     {
         (void)config;
         return true;
     }
 
-    bool wifi_station_set_config_current(struct station_config *config)
+    bool wifi_station_set_config_current(struct station_config* config)
     {
         (void)config;
         return true;
     }
 
-    bool wifi_station_set_hostname(const char *name)
+    bool wifi_station_set_hostname(const char* name)
     {
         (void)name;
         return true;
@@ -422,20 +421,20 @@ extern "C"
         return true;
     }
 
-    bool wifi_softap_get_config(struct softap_config *config)
+    bool wifi_softap_get_config(struct softap_config* config)
     {
         strcpy((char*)config->ssid, "apssid");
         strcpy((char*)config->password, "appasswd");
-        config->ssid_len = strlen("appasswd");
-        config->channel = 1;
-        config->authmode = AUTH_WPA2_PSK;
-        config->ssid_hidden = 0;
-        config->max_connection = 4;
+        config->ssid_len        = strlen("appasswd");
+        config->channel         = 1;
+        config->authmode        = AUTH_WPA2_PSK;
+        config->ssid_hidden     = 0;
+        config->max_connection  = 4;
         config->beacon_interval = 100;
         return true;
     }
 
-    bool wifi_softap_get_config_default(struct softap_config *config)
+    bool wifi_softap_get_config_default(struct softap_config* config)
     {
         return wifi_softap_get_config(config);
     }
@@ -445,19 +444,19 @@ extern "C"
         return 2;
     }
 
-    bool wifi_softap_set_config(struct softap_config *config)
+    bool wifi_softap_set_config(struct softap_config* config)
     {
         (void)config;
         return true;
     }
 
-    bool wifi_softap_set_config_current(struct softap_config *config)
+    bool wifi_softap_set_config_current(struct softap_config* config)
     {
         (void)config;
         return true;
     }
 
-    bool wifi_softap_set_dhcps_lease(struct dhcps_lease *please)
+    bool wifi_softap_set_dhcps_lease(struct dhcps_lease* please)
     {
         (void)please;
         return true;
@@ -476,7 +475,7 @@ extern "C"
         return true;
     }
 
-    bool wifi_station_scan(struct scan_config *config, scan_done_cb_t cb)
+    bool wifi_station_scan(struct scan_config* config, scan_done_cb_t cb)
     {
         (void)config;
         cb(nullptr, FAIL);
@@ -498,7 +497,7 @@ extern "C"
         (void)intr;
     }
 
-    void dns_setserver(u8_t numdns, ip_addr_t *dnsserver)
+    void dns_setserver(u8_t numdns, ip_addr_t* dnsserver)
     {
         (void)numdns;
         (void)dnsserver;
@@ -511,7 +510,6 @@ extern "C"
         return addr;
     }
 
-
 #include <smartconfig.h>
     bool smartconfig_start(sc_callback_t cb, ...)
     {
@@ -530,4 +528,4 @@ extern "C"
         return NONE_SLEEP_T;
     }
 
-} // extern "C"
+}  // extern "C"
diff --git a/tests/host/core/test_PolledTimeout.cpp b/tests/host/core/test_PolledTimeout.cpp
index 37b31d8544..b03a2af624 100644
--- a/tests/host/core/test_PolledTimeout.cpp
+++ b/tests/host/core/test_PolledTimeout.cpp
@@ -2,245 +2,240 @@
 #include "PolledTimeout.h"
 
 #define mockverbose printf
-#include "common/MockEsp.cpp" // getCycleCount
+#include "common/MockEsp.cpp"  // getCycleCount
 
 //This won't work for
-template<typename argT>
+template <typename argT>
 inline bool
 fuzzycomp(argT a, argT b)
 {
-  const argT epsilon = 10;
-  return (std::max(a,b) - std::min(a,b) <= epsilon);
+    const argT epsilon = 10;
+    return (std::max(a, b) - std::min(a, b) <= epsilon);
 }
 
 TEST_CASE("OneShot Timeout 500000000ns (0.5s)", "[polledTimeout]")
 {
-  using esp8266::polledTimeout::oneShotFastNs;
-  using timeType = oneShotFastNs::timeType;
-  timeType before, after, delta;
+    using esp8266::polledTimeout::oneShotFastNs;
+    using timeType = oneShotFastNs::timeType;
+    timeType before, after, delta;
 
-  Serial.println("OneShot Timeout 500000000ns (0.5s)");
+    Serial.println("OneShot Timeout 500000000ns (0.5s)");
 
-  oneShotFastNs timeout(500000000);
-  before = micros();
-  while(!timeout.expired())
-    yield();
-  after = micros();
+    oneShotFastNs timeout(500000000);
+    before = micros();
+    while (!timeout.expired())
+        yield();
+    after = micros();
 
-  delta = after - before;
-  Serial.printf("delta = %u\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %u\n", delta);
 
-  REQUIRE(fuzzycomp(delta/1000, (timeType)500));
+    REQUIRE(fuzzycomp(delta / 1000, (timeType)500));
 
+    Serial.print("reset\n");
 
-  Serial.print("reset\n");
+    timeout.reset();
+    before = micros();
+    while (!timeout)
+        yield();
+    after = micros();
 
-  timeout.reset();
-  before = micros();
-  while(!timeout)
-    yield();
-  after = micros();
+    delta = after - before;
+    Serial.printf("delta = %u\n", delta);
 
-  delta = after - before;
-  Serial.printf("delta = %u\n", delta);
-
-  REQUIRE(fuzzycomp(delta/1000, (timeType)500));
+    REQUIRE(fuzzycomp(delta / 1000, (timeType)500));
 }
 
 TEST_CASE("OneShot Timeout 3000000us", "[polledTimeout]")
 {
-  using esp8266::polledTimeout::oneShotFastUs;
-  using timeType = oneShotFastUs::timeType;
-  timeType before, after, delta;
-
-  Serial.println("OneShot Timeout 3000000us");
+    using esp8266::polledTimeout::oneShotFastUs;
+    using timeType = oneShotFastUs::timeType;
+    timeType before, after, delta;
 
-  oneShotFastUs timeout(3000000);
-  before = micros();
-  while(!timeout.expired())
-    yield();
-  after = micros();
+    Serial.println("OneShot Timeout 3000000us");
 
-  delta = after - before;
-  Serial.printf("delta = %u\n", delta);
+    oneShotFastUs timeout(3000000);
+    before = micros();
+    while (!timeout.expired())
+        yield();
+    after = micros();
 
-  REQUIRE(fuzzycomp(delta/1000, (timeType)3000));
+    delta = after - before;
+    Serial.printf("delta = %u\n", delta);
 
+    REQUIRE(fuzzycomp(delta / 1000, (timeType)3000));
 
-  Serial.print("reset\n");
+    Serial.print("reset\n");
 
-  timeout.reset();
-  before = micros();
-  while(!timeout)
-    yield();
-  after = micros();
+    timeout.reset();
+    before = micros();
+    while (!timeout)
+        yield();
+    after = micros();
 
-  delta = after - before;
-  Serial.printf("delta = %u\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %u\n", delta);
 
-  REQUIRE(fuzzycomp(delta/1000, (timeType)3000));
+    REQUIRE(fuzzycomp(delta / 1000, (timeType)3000));
 }
 
 TEST_CASE("OneShot Timeout 3000ms", "[polledTimeout]")
 {
-  using esp8266::polledTimeout::oneShotMs;
-  using timeType = oneShotMs::timeType;
-  timeType before, after, delta;
+    using esp8266::polledTimeout::oneShotMs;
+    using timeType = oneShotMs::timeType;
+    timeType before, after, delta;
 
-  Serial.println("OneShot Timeout 3000ms");
+    Serial.println("OneShot Timeout 3000ms");
 
-  oneShotMs timeout(3000);
-  before = millis();
-  while(!timeout.expired())
-    yield();
-  after = millis();
+    oneShotMs timeout(3000);
+    before = millis();
+    while (!timeout.expired())
+        yield();
+    after = millis();
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  REQUIRE(fuzzycomp(delta, (timeType)3000));
+    REQUIRE(fuzzycomp(delta, (timeType)3000));
 
+    Serial.print("reset\n");
 
-  Serial.print("reset\n");
+    timeout.reset();
+    before = millis();
+    while (!timeout)
+        yield();
+    after = millis();
 
-  timeout.reset();
-  before = millis();
-  while(!timeout)
-    yield();
-  after = millis();
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
-
-  REQUIRE(fuzzycomp(delta, (timeType)3000));
+    REQUIRE(fuzzycomp(delta, (timeType)3000));
 }
 
 TEST_CASE("OneShot Timeout 3000ms reset to 1000ms", "[polledTimeout]")
 {
-  using esp8266::polledTimeout::oneShotMs;
-  using timeType = oneShotMs::timeType;
-  timeType before, after, delta;
-
-  Serial.println("OneShot Timeout 3000ms");
+    using esp8266::polledTimeout::oneShotMs;
+    using timeType = oneShotMs::timeType;
+    timeType before, after, delta;
 
-  oneShotMs timeout(3000);
-  before = millis();
-  while(!timeout.expired())
-    yield();
-  after = millis();
+    Serial.println("OneShot Timeout 3000ms");
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
+    oneShotMs timeout(3000);
+    before = millis();
+    while (!timeout.expired())
+        yield();
+    after = millis();
 
-  REQUIRE(fuzzycomp(delta, (timeType)3000));
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
+    REQUIRE(fuzzycomp(delta, (timeType)3000));
 
-  Serial.print("reset\n");
+    Serial.print("reset\n");
 
-  timeout.reset(1000);
-  before = millis();
-  while(!timeout)
-    yield();
-  after = millis();
+    timeout.reset(1000);
+    before = millis();
+    while (!timeout)
+        yield();
+    after = millis();
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  REQUIRE(fuzzycomp(delta, (timeType)1000));
+    REQUIRE(fuzzycomp(delta, (timeType)1000));
 }
 
 TEST_CASE("Periodic Timeout 1T 3000ms", "[polledTimeout]")
 {
-  using esp8266::polledTimeout::periodicMs;
-  using timeType = periodicMs::timeType;
-  timeType before, after, delta;
+    using esp8266::polledTimeout::periodicMs;
+    using timeType = periodicMs::timeType;
+    timeType before, after, delta;
 
-  Serial.println("Periodic Timeout 1T 3000ms");
+    Serial.println("Periodic Timeout 1T 3000ms");
 
-  periodicMs timeout(3000);
-  before = millis();
-  while(!timeout)
-    yield();
-  after = millis();
+    periodicMs timeout(3000);
+    before = millis();
+    while (!timeout)
+        yield();
+    after = millis();
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  REQUIRE(fuzzycomp(delta, (timeType)3000));
+    REQUIRE(fuzzycomp(delta, (timeType)3000));
 
-  Serial.print("no reset needed\n");
+    Serial.print("no reset needed\n");
 
-  before = millis();
-  while(!timeout)
-    yield();
-  after = millis();
+    before = millis();
+    while (!timeout)
+        yield();
+    after = millis();
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  REQUIRE(fuzzycomp(delta, (timeType)3000));
+    REQUIRE(fuzzycomp(delta, (timeType)3000));
 }
 
 TEST_CASE("Periodic Timeout 10T 1000ms", "[polledTimeout]")
 {
-  using esp8266::polledTimeout::periodicMs;
-  using timeType = periodicMs::timeType;
-  timeType before, after, delta;
+    using esp8266::polledTimeout::periodicMs;
+    using timeType = periodicMs::timeType;
+    timeType before, after, delta;
 
-  Serial.println("Periodic 10T Timeout 1000ms");
+    Serial.println("Periodic 10T Timeout 1000ms");
 
-  int counter = 10;
+    int counter = 10;
 
-  periodicMs timeout(1000);
-  before = millis();
-  while(1)
-  {
-    if(timeout)
+    periodicMs timeout(1000);
+    before = millis();
+    while (1)
     {
-      Serial.print("*");
-      if(!--counter)
-        break;
-      yield();
+        if (timeout)
+        {
+            Serial.print("*");
+            if (!--counter)
+                break;
+            yield();
+        }
     }
-  }
-  after = millis();
+    after = millis();
 
-  delta = after - before;
-  Serial.printf("\ndelta = %lu\n", delta);
-  REQUIRE(fuzzycomp(delta, (timeType)10000));
+    delta = after - before;
+    Serial.printf("\ndelta = %lu\n", delta);
+    REQUIRE(fuzzycomp(delta, (timeType)10000));
 }
 
 TEST_CASE("OneShot Timeout 3000ms reset to 1000ms custom yield", "[polledTimeout]")
 {
-  using YieldOrSkipPolicy = esp8266::polledTimeout::YieldPolicy::YieldOrSkip;
-  using oneShotMsYield = esp8266::polledTimeout::timeoutTemplate<false, YieldOrSkipPolicy>;
-  using timeType = oneShotMsYield::timeType;
-  timeType before, after, delta;
+    using YieldOrSkipPolicy = esp8266::polledTimeout::YieldPolicy::YieldOrSkip;
+    using oneShotMsYield    = esp8266::polledTimeout::timeoutTemplate<false, YieldOrSkipPolicy>;
+    using timeType          = oneShotMsYield::timeType;
+    timeType before, after, delta;
 
-  Serial.println("OneShot Timeout 3000ms");
+    Serial.println("OneShot Timeout 3000ms");
 
+    oneShotMsYield timeout(3000);
+    before = millis();
+    while (!timeout.expired())
+        ;
+    after = millis();
 
-  oneShotMsYield timeout(3000);
-  before = millis();
-  while(!timeout.expired());
-  after = millis();
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
+    REQUIRE(fuzzycomp(delta, (timeType)3000));
 
-  REQUIRE(fuzzycomp(delta, (timeType)3000));
+    Serial.print("reset\n");
 
+    timeout.reset(1000);
+    before = millis();
+    while (!timeout)
+        ;
+    after = millis();
 
-  Serial.print("reset\n");
+    delta = after - before;
+    Serial.printf("delta = %lu\n", delta);
 
-  timeout.reset(1000);
-  before = millis();
-  while(!timeout);
-  after = millis();
-
-  delta = after - before;
-  Serial.printf("delta = %lu\n", delta);
-
-  REQUIRE(fuzzycomp(delta, (timeType)1000));
+    REQUIRE(fuzzycomp(delta, (timeType)1000));
 }
-
diff --git a/tests/host/core/test_md5builder.cpp b/tests/host/core/test_md5builder.cpp
index 0041c2eb72..ec59569918 100644
--- a/tests/host/core/test_md5builder.cpp
+++ b/tests/host/core/test_md5builder.cpp
@@ -32,29 +32,31 @@ TEST_CASE("MD5Builder::add works as expected", "[core][MD5Builder]")
     REQUIRE(builder.toString() == "9edb67f2b22c604fab13e2fd1d6056d7");
 }
 
-
 TEST_CASE("MD5Builder::addHexString works as expected", "[core][MD5Builder]")
 {
-    WHEN("A char array is parsed"){
-      MD5Builder builder;
-      builder.begin();
-      const char * myPayload = "1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696F6e73";
-      builder.addHexString(myPayload);
-      builder.calculate();
-      REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
+    WHEN("A char array is parsed")
+    {
+        MD5Builder builder;
+        builder.begin();
+        const char* myPayload = "1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696F6e73";
+        builder.addHexString(myPayload);
+        builder.calculate();
+        REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
     }
 
-    WHEN("A Arduino String is parsed"){
-      MD5Builder builder;
-      builder.begin();
-      builder.addHexString(String("1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696f6e73"));
-      builder.calculate();
-      REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
+    WHEN("A Arduino String is parsed")
+    {
+        MD5Builder builder;
+        builder.begin();
+        builder.addHexString(String("1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696f6e73"));
+        builder.calculate();
+        REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
     }
 }
 
-TEST_CASE("MD5Builder::addStream works", "[core][MD5Builder]"){
-    MD5Builder builder;
+TEST_CASE("MD5Builder::addStream works", "[core][MD5Builder]")
+{
+    MD5Builder  builder;
     const char* str = "MD5Builder::addStream_works_longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong";
     {
         StreamString stream;
diff --git a/tests/host/core/test_pgmspace.cpp b/tests/host/core/test_pgmspace.cpp
index f44221c2b4..fd89dbe6db 100644
--- a/tests/host/core/test_pgmspace.cpp
+++ b/tests/host/core/test_pgmspace.cpp
@@ -19,15 +19,16 @@
 
 TEST_CASE("strstr_P works as strstr", "[core][pgmspace]")
 {
-    auto t = [](const char* h, const char* n) {
+    auto t = [](const char* h, const char* n)
+    {
         const char* strstr_P_result = strstr_P(h, n);
-        const char* strstr_result = strstr(h, n);
+        const char* strstr_result   = strstr(h, n);
         REQUIRE(strstr_P_result == strstr_result);
     };
 
     // Test case data is from avr-libc, original copyright (c) 2007  Dmitry Xmelkov
     // See avr-libc/tests/simulate/pmstring/strstr_P.c
-    t ("", "");
+    t("", "");
     t("12345", "");
     t("ababac", "abac");
     t("", "a");
diff --git a/tests/host/core/test_string.cpp b/tests/host/core/test_string.cpp
index cd844545d0..b0f4012aef 100644
--- a/tests/host/core/test_string.cpp
+++ b/tests/host/core/test_string.cpp
@@ -43,8 +43,8 @@ TEST_CASE("String::trim", "[core][String]")
 TEST_CASE("String::replace", "[core][String]")
 {
     String str;
-    str = "The quick brown fox jumped over the lazy dog.";
-    String find = "fox";
+    str            = "The quick brown fox jumped over the lazy dog.";
+    String find    = "fox";
     String replace = "vulpes vulpes";
     str.replace(find, replace);
     REQUIRE(str == "The quick brown vulpes vulpes jumped over the lazy dog.");
@@ -52,10 +52,10 @@ TEST_CASE("String::replace", "[core][String]")
 
 TEST_CASE("String(value, base)", "[core][String]")
 {
-    String strbase2(9999,2);
-    String strbase8(9999,8);
-    String strbase10(9999,10);
-    String strbase16(9999,16);
+    String strbase2(9999, 2);
+    String strbase8(9999, 8);
+    String strbase10(9999, 10);
+    String strbase16(9999, 16);
     REQUIRE(strbase2 == "10011100001111");
     REQUIRE(strbase8 == "23417");
     REQUIRE(strbase10 == "9999");
@@ -64,7 +64,7 @@ TEST_CASE("String(value, base)", "[core][String]")
     String strnegf(-2.123, 3);
     REQUIRE(strnegi == "-9999");
     REQUIRE(strnegf == "-2.123");
-    String strbase16l((long)999999,16);
+    String strbase16l((long)999999, 16);
     REQUIRE(strbase16l == "f423f");
 }
 
@@ -83,8 +83,8 @@ TEST_CASE("String constructors", "[core][String]")
     String s1("abcd");
     String s2(s1);
     REQUIRE(s1 == s2);
-    String *s3 = new String("manos");
-    s2 = *s3;
+    String* s3 = new String("manos");
+    s2         = *s3;
     delete s3;
     REQUIRE(s2 == "manos");
     s3 = new String("thisismuchlongerthantheother");
@@ -97,8 +97,8 @@ TEST_CASE("String constructors", "[core][String]")
     REQUIRE(ssh == "3.14159_abcd");
     String flash = (F("hello from flash"));
     REQUIRE(flash == "hello from flash");
-    const char textarray[6] = {'h', 'e', 'l', 'l', 'o', 0};
-    String hello(textarray);
+    const char textarray[6] = { 'h', 'e', 'l', 'l', 'o', 0 };
+    String     hello(textarray);
     REQUIRE(hello == "hello");
     String hello2;
     hello2 = textarray;
@@ -156,19 +156,19 @@ TEST_CASE("String concantenation", "[core][String]")
     REQUIRE(str == "-100");
     // Non-zero-terminated array concatenation
     const char buff[] = "abcdefg";
-    String n;
-    n = "1234567890"; // Make it a SSO string, fill with non-0 data
-    n = "1"; // Overwrite [1] with 0, but leave old junk in SSO space still
+    String     n;
+    n = "1234567890";  // Make it a SSO string, fill with non-0 data
+    n = "1";           // Overwrite [1] with 0, but leave old junk in SSO space still
     n.concat(buff, 3);
-    REQUIRE(n == "1abc"); // Ensure the trailing 0 is always present even w/this funky concat
-    for (int i=0; i<20; i++)
-        n.concat(buff, 1); // Add 20 'a's to go from SSO to normal string
+    REQUIRE(n == "1abc");  // Ensure the trailing 0 is always present even w/this funky concat
+    for (int i = 0; i < 20; i++)
+        n.concat(buff, 1);  // Add 20 'a's to go from SSO to normal string
     REQUIRE(n == "1abcaaaaaaaaaaaaaaaaaaaa");
     n = "";
-    for (int i=0; i<=5; i++)
+    for (int i = 0; i <= 5; i++)
         n.concat(buff, i);
     REQUIRE(n == "aababcabcdabcde");
-    n.concat(buff, 0); // And check no add'n
+    n.concat(buff, 0);  // And check no add'n
     REQUIRE(n == "aababcabcdabcde");
 }
 
@@ -211,7 +211,7 @@ TEST_CASE("String byte access", "[core][String]")
 TEST_CASE("String conversion", "[core][String]")
 {
     String s = "12345";
-    long l = s.toInt();
+    long   l = s.toInt();
     REQUIRE(l == 12345);
     s = "2147483647";
     l = s.toInt();
@@ -222,9 +222,9 @@ TEST_CASE("String conversion", "[core][String]")
     s = "-2147483648";
     l = s.toInt();
     REQUIRE(l == INT_MIN);
-    s = "3.14159";
+    s       = "3.14159";
     float f = s.toFloat();
-    REQUIRE( fabs(f - 3.14159) < 0.0001 );
+    REQUIRE(fabs(f - 3.14159) < 0.0001);
 }
 
 TEST_CASE("String case", "[core][String]")
@@ -246,7 +246,7 @@ TEST_CASE("String nulls", "[core][String]")
     s.trim();
     s.toUpperCase();
     s.toLowerCase();
-    s.remove(1,1);
+    s.remove(1, 1);
     s.remove(10);
     s.replace("taco", "burrito");
     s.replace('a', 'b');
@@ -268,7 +268,7 @@ TEST_CASE("String nulls", "[core][String]")
     REQUIRE(s == "");
     REQUIRE(s.length() == 0);
     s.setCharAt(1, 't');
-    REQUIRE(s.startsWith("abc",0) == false);
+    REQUIRE(s.startsWith("abc", 0) == false);
     REQUIRE(s.startsWith("def") == false);
     REQUIRE(s.equalsConstantTime("def") == false);
     REQUIRE(s.equalsConstantTime("") == true);
@@ -299,125 +299,128 @@ TEST_CASE("String sizes near 8b", "[core][String]")
     String s15("12345678901234");
     String s16("123456789012345");
     String s17("1234567890123456");
-    REQUIRE(!strcmp(s7.c_str(),"123456"));
-    REQUIRE(!strcmp(s8.c_str(),"1234567"));
-    REQUIRE(!strcmp(s9.c_str(),"12345678"));
-    REQUIRE(!strcmp(s15.c_str(),"12345678901234"));
-    REQUIRE(!strcmp(s16.c_str(),"123456789012345"));
-    REQUIRE(!strcmp(s17.c_str(),"1234567890123456"));
+    REQUIRE(!strcmp(s7.c_str(), "123456"));
+    REQUIRE(!strcmp(s8.c_str(), "1234567"));
+    REQUIRE(!strcmp(s9.c_str(), "12345678"));
+    REQUIRE(!strcmp(s15.c_str(), "12345678901234"));
+    REQUIRE(!strcmp(s16.c_str(), "123456789012345"));
+    REQUIRE(!strcmp(s17.c_str(), "1234567890123456"));
     s7 += '_';
     s8 += '_';
     s9 += '_';
     s15 += '_';
     s16 += '_';
     s17 += '_';
-    REQUIRE(!strcmp(s7.c_str(),"123456_"));
-    REQUIRE(!strcmp(s8.c_str(),"1234567_"));
-    REQUIRE(!strcmp(s9.c_str(),"12345678_"));
-    REQUIRE(!strcmp(s15.c_str(),"12345678901234_"));
-    REQUIRE(!strcmp(s16.c_str(),"123456789012345_"));
-    REQUIRE(!strcmp(s17.c_str(),"1234567890123456_"));
+    REQUIRE(!strcmp(s7.c_str(), "123456_"));
+    REQUIRE(!strcmp(s8.c_str(), "1234567_"));
+    REQUIRE(!strcmp(s9.c_str(), "12345678_"));
+    REQUIRE(!strcmp(s15.c_str(), "12345678901234_"));
+    REQUIRE(!strcmp(s16.c_str(), "123456789012345_"));
+    REQUIRE(!strcmp(s17.c_str(), "1234567890123456_"));
 }
 
 TEST_CASE("String SSO works", "[core][String]")
 {
-  // This test assumes that SSO_SIZE==8, if that changes the test must as well
-  String s;
-  s += "0";
-  REQUIRE(s == "0");
-  REQUIRE(s.length() == 1);
-  const char *savesso = s.c_str();
-  s += 1;
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "01");
-  REQUIRE(s.length() == 2);
-  s += "2";
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "012");
-  REQUIRE(s.length() == 3);
-  s += 3;
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "0123");
-  REQUIRE(s.length() == 4);
-  s += "4";
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "01234");
-  REQUIRE(s.length() == 5);
-  s += "5";
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "012345");
-  REQUIRE(s.length() == 6);
-  s += "6";
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "0123456");
-  REQUIRE(s.length() == 7);
-  s += "7";
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "01234567");
-  REQUIRE(s.length() == 8);
-  s += "8";
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "012345678");
-  REQUIRE(s.length() == 9);
-  s += "9";
-  REQUIRE(s.c_str() == savesso);
-  REQUIRE(s == "0123456789");
-  REQUIRE(s.length() == 10);
-  if (sizeof(savesso) == 4) {
-    s += "a";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789a");
-    REQUIRE(s.length() == 11);
-    s += "b";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789ab");
-    REQUIRE(s.length() == 12);
-    s += "c";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abc");
-    REQUIRE(s.length() == 13);
-  } else {
-  s += "a";
+    // This test assumes that SSO_SIZE==8, if that changes the test must as well
+    String s;
+    s += "0";
+    REQUIRE(s == "0");
+    REQUIRE(s.length() == 1);
+    const char* savesso = s.c_str();
+    s += 1;
+    REQUIRE(s.c_str() == savesso);
+    REQUIRE(s == "01");
+    REQUIRE(s.length() == 2);
+    s += "2";
+    REQUIRE(s.c_str() == savesso);
+    REQUIRE(s == "012");
+    REQUIRE(s.length() == 3);
+    s += 3;
+    REQUIRE(s.c_str() == savesso);
+    REQUIRE(s == "0123");
+    REQUIRE(s.length() == 4);
+    s += "4";
+    REQUIRE(s.c_str() == savesso);
+    REQUIRE(s == "01234");
+    REQUIRE(s.length() == 5);
+    s += "5";
+    REQUIRE(s.c_str() == savesso);
+    REQUIRE(s == "012345");
+    REQUIRE(s.length() == 6);
+    s += "6";
     REQUIRE(s.c_str() == savesso);
-    REQUIRE(s == "0123456789a");
-    REQUIRE(s.length() == 11);
-    s += "bcde";
+    REQUIRE(s == "0123456");
+    REQUIRE(s.length() == 7);
+    s += "7";
     REQUIRE(s.c_str() == savesso);
-    REQUIRE(s == "0123456789abcde");
-    REQUIRE(s.length() == 15);
-    s += "fghi";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abcdefghi");
-    REQUIRE(s.length() == 19);
-    s += "j";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abcdefghij");
-    REQUIRE(s.length() == 20);
-    s += "k";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abcdefghijk");
-    REQUIRE(s.length() == 21);
-    s += "l";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abcdefghijkl");
-    REQUIRE(s.length() == 22);
-    s += "m";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abcdefghijklm");
-    REQUIRE(s.length() == 23);
-    s += "nopq";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abcdefghijklmnopq");
-    REQUIRE(s.length() == 27);
-    s += "rstu";
-    REQUIRE(s.c_str() != savesso);
-    REQUIRE(s == "0123456789abcdefghijklmnopqrstu");
-    REQUIRE(s.length() == 31);
-  }
-  s = "0123456789abcde";
-  s = s.substring(s.indexOf('a'));
-  REQUIRE(s == "abcde");
-  REQUIRE(s.length() == 5);
+    REQUIRE(s == "01234567");
+    REQUIRE(s.length() == 8);
+    s += "8";
+    REQUIRE(s.c_str() == savesso);
+    REQUIRE(s == "012345678");
+    REQUIRE(s.length() == 9);
+    s += "9";
+    REQUIRE(s.c_str() == savesso);
+    REQUIRE(s == "0123456789");
+    REQUIRE(s.length() == 10);
+    if (sizeof(savesso) == 4)
+    {
+        s += "a";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789a");
+        REQUIRE(s.length() == 11);
+        s += "b";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789ab");
+        REQUIRE(s.length() == 12);
+        s += "c";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abc");
+        REQUIRE(s.length() == 13);
+    }
+    else
+    {
+        s += "a";
+        REQUIRE(s.c_str() == savesso);
+        REQUIRE(s == "0123456789a");
+        REQUIRE(s.length() == 11);
+        s += "bcde";
+        REQUIRE(s.c_str() == savesso);
+        REQUIRE(s == "0123456789abcde");
+        REQUIRE(s.length() == 15);
+        s += "fghi";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abcdefghi");
+        REQUIRE(s.length() == 19);
+        s += "j";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abcdefghij");
+        REQUIRE(s.length() == 20);
+        s += "k";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abcdefghijk");
+        REQUIRE(s.length() == 21);
+        s += "l";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abcdefghijkl");
+        REQUIRE(s.length() == 22);
+        s += "m";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abcdefghijklm");
+        REQUIRE(s.length() == 23);
+        s += "nopq";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abcdefghijklmnopq");
+        REQUIRE(s.length() == 27);
+        s += "rstu";
+        REQUIRE(s.c_str() != savesso);
+        REQUIRE(s == "0123456789abcdefghijklmnopqrstu");
+        REQUIRE(s.length() == 31);
+    }
+    s = "0123456789abcde";
+    s = s.substring(s.indexOf('a'));
+    REQUIRE(s == "abcde");
+    REQUIRE(s.length() == 5);
 }
 
 #include <new>
@@ -426,70 +429,67 @@ void repl(const String& key, const String& val, String& s, boolean useURLencode)
     s.replace(key, val);
 }
 
-
 TEST_CASE("String SSO handles junk in memory", "[core][String]")
 {
-  // We fill the SSO space with garbage then construct an object in it and check consistency
-  // This is NOT how you want to use Strings outside of this testing!
-  unsigned char space[64];
-  String *s = (String*)space;
-  memset(space, 0xff, 64);
-  new(s) String;
-  REQUIRE(*s == "");
-  s->~String();
-
-  // Tests from #5883
-  bool useURLencode = false;
-  const char euro[4] = {(char)0xe2, (char)0x82, (char)0xac, 0}; // Unicode euro symbol
-  const char yen[3]   = {(char)0xc2, (char)0xa5, 0}; // Unicode yen symbol
-
-  memset(space, 0xff, 64);
-  new(s) String("%ssid%");
-  repl(("%ssid%"), "MikroTik", *s, useURLencode);
-  REQUIRE(*s == "MikroTik");
-  s->~String();
-
-  memset(space, 0xff, 64);
-  new(s) String("{E}");
-  repl(("{E}"), euro, *s, useURLencode);
-  REQUIRE(*s == "€");
-  s->~String();
-  memset(space, 0xff, 64);
-  new(s) String("&euro;");
-  repl(("&euro;"), euro, *s, useURLencode);
-  REQUIRE(*s == "€");
-  s->~String();
-  memset(space, 0xff, 64);
-  new(s) String("{Y}");
-  repl(("{Y}"), yen, *s, useURLencode);
-  REQUIRE(*s == "¥");
-  s->~String();
-  memset(space, 0xff, 64);
-  new(s) String("&yen;");
-  repl(("&yen;"), yen, *s, useURLencode);
-  REQUIRE(*s == "¥");
-  s->~String();
-
-  memset(space, 0xff, 64);
-  new(s) String("%sysname%");
-  repl(("%sysname%"), "CO2_defect", *s, useURLencode);
-  REQUIRE(*s == "CO2_defect");
-  s->~String();
+    // We fill the SSO space with garbage then construct an object in it and check consistency
+    // This is NOT how you want to use Strings outside of this testing!
+    unsigned char space[64];
+    String*       s = (String*)space;
+    memset(space, 0xff, 64);
+    new (s) String;
+    REQUIRE(*s == "");
+    s->~String();
+
+    // Tests from #5883
+    bool       useURLencode = false;
+    const char euro[4]      = { (char)0xe2, (char)0x82, (char)0xac, 0 };  // Unicode euro symbol
+    const char yen[3]       = { (char)0xc2, (char)0xa5, 0 };              // Unicode yen symbol
+
+    memset(space, 0xff, 64);
+    new (s) String("%ssid%");
+    repl(("%ssid%"), "MikroTik", *s, useURLencode);
+    REQUIRE(*s == "MikroTik");
+    s->~String();
+
+    memset(space, 0xff, 64);
+    new (s) String("{E}");
+    repl(("{E}"), euro, *s, useURLencode);
+    REQUIRE(*s == "€");
+    s->~String();
+    memset(space, 0xff, 64);
+    new (s) String("&euro;");
+    repl(("&euro;"), euro, *s, useURLencode);
+    REQUIRE(*s == "€");
+    s->~String();
+    memset(space, 0xff, 64);
+    new (s) String("{Y}");
+    repl(("{Y}"), yen, *s, useURLencode);
+    REQUIRE(*s == "¥");
+    s->~String();
+    memset(space, 0xff, 64);
+    new (s) String("&yen;");
+    repl(("&yen;"), yen, *s, useURLencode);
+    REQUIRE(*s == "¥");
+    s->~String();
+
+    memset(space, 0xff, 64);
+    new (s) String("%sysname%");
+    repl(("%sysname%"), "CO2_defect", *s, useURLencode);
+    REQUIRE(*s == "CO2_defect");
+    s->~String();
 }
 
-
 TEST_CASE("Issue #5949 - Overlapping src/dest in replace", "[core][String]")
 {
-  String blah = "blah";
-  blah.replace("xx", "y");
-  REQUIRE(blah == "blah");
-  blah.replace("x", "yy");
-  REQUIRE(blah == "blah");
-  blah.replace(blah, blah);
-  REQUIRE(blah == "blah");
+    String blah = "blah";
+    blah.replace("xx", "y");
+    REQUIRE(blah == "blah");
+    blah.replace("x", "yy");
+    REQUIRE(blah == "blah");
+    blah.replace(blah, blah);
+    REQUIRE(blah == "blah");
 }
 
-
 TEST_CASE("Issue #2736 - StreamString SSO fix", "[core][StreamString]")
 {
     StreamString s;
@@ -502,102 +502,104 @@ TEST_CASE("Issue #2736 - StreamString SSO fix", "[core][StreamString]")
 
 TEST_CASE("Strings with NULs", "[core][String]")
 {
-  // The following should never be done in a real app! This is only to inject 0s in the middle of a string.
-  // Fits in SSO...
-  String str("01234567");
-  REQUIRE(str.length() == 8);
-  char *ptr = (char *)str.c_str();
-  ptr[3] = 0;
-  String str2;
-  str2 = str;
-  REQUIRE(str2.length() == 8);
-  // Needs a buffer pointer
-  str = "0123456789012345678901234567890123456789";
-  ptr = (char *)str.c_str();
-  ptr[3] = 0;
-  str2 = str;
-  REQUIRE(str2.length() == 40);
-  String str3("a");
-  ptr = (char *)str3.c_str();
-  *ptr = 0;
-  REQUIRE(str3.length() == 1);
-  str3 += str3;
-  REQUIRE(str3.length() == 2);
-  str3 += str3;
-  REQUIRE(str3.length() == 4);
-  str3 += str3;
-  REQUIRE(str3.length() == 8);
-  str3 += str3;
-  REQUIRE(str3.length() == 16);
-  str3 += str3;
-  REQUIRE(str3.length() == 32);
-  str3 += str3;
-  REQUIRE(str3.length() == 64);
-  static char zeros[64] = {0};
-  const char *p = str3.c_str();
-  REQUIRE(!memcmp(p, zeros, 64));
+    // The following should never be done in a real app! This is only to inject 0s in the middle of a string.
+    // Fits in SSO...
+    String str("01234567");
+    REQUIRE(str.length() == 8);
+    char* ptr = (char*)str.c_str();
+    ptr[3]    = 0;
+    String str2;
+    str2 = str;
+    REQUIRE(str2.length() == 8);
+    // Needs a buffer pointer
+    str    = "0123456789012345678901234567890123456789";
+    ptr    = (char*)str.c_str();
+    ptr[3] = 0;
+    str2   = str;
+    REQUIRE(str2.length() == 40);
+    String str3("a");
+    ptr  = (char*)str3.c_str();
+    *ptr = 0;
+    REQUIRE(str3.length() == 1);
+    str3 += str3;
+    REQUIRE(str3.length() == 2);
+    str3 += str3;
+    REQUIRE(str3.length() == 4);
+    str3 += str3;
+    REQUIRE(str3.length() == 8);
+    str3 += str3;
+    REQUIRE(str3.length() == 16);
+    str3 += str3;
+    REQUIRE(str3.length() == 32);
+    str3 += str3;
+    REQUIRE(str3.length() == 64);
+    static char zeros[64] = { 0 };
+    const char* p         = str3.c_str();
+    REQUIRE(!memcmp(p, zeros, 64));
 }
 
 TEST_CASE("Replace and string expansion", "[core][String]")
 {
-  String s, l;
-  // Make these large enough to span SSO and non SSO
-  String whole = "#123456789012345678901234567890";
-  const char *res = "abcde123456789012345678901234567890";
-  for (size_t i=1; i < whole.length(); i++) {
-    s = whole.substring(0, i);
-    l = s;
-    l.replace("#", "abcde");
-    char buff[64];
-    strcpy(buff, res);
-    buff[5 + i-1] = 0;
-    REQUIRE(!strcmp(l.c_str(), buff));
-    REQUIRE(l.length() == strlen(buff));
-  }
+    String s, l;
+    // Make these large enough to span SSO and non SSO
+    String      whole = "#123456789012345678901234567890";
+    const char* res   = "abcde123456789012345678901234567890";
+    for (size_t i = 1; i < whole.length(); i++)
+    {
+        s = whole.substring(0, i);
+        l = s;
+        l.replace("#", "abcde");
+        char buff[64];
+        strcpy(buff, res);
+        buff[5 + i - 1] = 0;
+        REQUIRE(!strcmp(l.c_str(), buff));
+        REQUIRE(l.length() == strlen(buff));
+    }
 }
 
 TEST_CASE("String chaining", "[core][String]")
 {
-  const char* chunks[] {
-    "~12345",
-    "67890",
-    "qwertyuiopasdfghjkl",
-    "zxcvbnm"
-  };
-
-  String all;
-  for (auto* chunk : chunks) {
-      all += chunk;
-  }
-
-  // make sure we can chain a combination of things to form a String
-  REQUIRE((String(chunks[0]) + String(chunks[1]) + String(chunks[2]) + String(chunks[3])) == all);
-  REQUIRE((chunks[0] + String(chunks[1]) + F(chunks[2]) + chunks[3]) == all);
-  REQUIRE((String(chunks[0]) + F(chunks[1]) + F(chunks[2]) + String(chunks[3])) == all);
-  REQUIRE(('~' + String(&chunks[0][0] + 1) + chunks[1] + String(chunks[2]) + F(chunks[3])) == all);
-  REQUIRE((String(chunks[0]) + '6' + (&chunks[1][0] + 1) + String(chunks[2]) + F(chunks[3])) == all);
-
-  // these are still invalid (and also cannot compile at all):
-  // - `F(...)` + `F(...)`
-  // - `F(...)` + `const char*`
-  // - `const char*` + `F(...)`
-  // we need `String()` as either rhs or lhs
-
-  // ensure chaining reuses the buffer
-  // (internal details...)
-  {
-    String tmp(chunks[3]);
-    tmp.reserve(2 * all.length());
-    auto* ptr = tmp.c_str();
-    String result("~1" + String(&chunks[0][0] + 2) + F(chunks[1]) + chunks[2] + std::move(tmp));
-    REQUIRE(result == all);
-    REQUIRE(static_cast<const void*>(result.c_str()) == static_cast<const void*>(ptr));
-  }
+    const char* chunks[] {
+        "~12345",
+        "67890",
+        "qwertyuiopasdfghjkl",
+        "zxcvbnm"
+    };
+
+    String all;
+    for (auto* chunk : chunks)
+    {
+        all += chunk;
+    }
+
+    // make sure we can chain a combination of things to form a String
+    REQUIRE((String(chunks[0]) + String(chunks[1]) + String(chunks[2]) + String(chunks[3])) == all);
+    REQUIRE((chunks[0] + String(chunks[1]) + F(chunks[2]) + chunks[3]) == all);
+    REQUIRE((String(chunks[0]) + F(chunks[1]) + F(chunks[2]) + String(chunks[3])) == all);
+    REQUIRE(('~' + String(&chunks[0][0] + 1) + chunks[1] + String(chunks[2]) + F(chunks[3])) == all);
+    REQUIRE((String(chunks[0]) + '6' + (&chunks[1][0] + 1) + String(chunks[2]) + F(chunks[3])) == all);
+
+    // these are still invalid (and also cannot compile at all):
+    // - `F(...)` + `F(...)`
+    // - `F(...)` + `const char*`
+    // - `const char*` + `F(...)`
+    // we need `String()` as either rhs or lhs
+
+    // ensure chaining reuses the buffer
+    // (internal details...)
+    {
+        String tmp(chunks[3]);
+        tmp.reserve(2 * all.length());
+        auto*  ptr = tmp.c_str();
+        String result("~1" + String(&chunks[0][0] + 2) + F(chunks[1]) + chunks[2] + std::move(tmp));
+        REQUIRE(result == all);
+        REQUIRE(static_cast<const void*>(result.c_str()) == static_cast<const void*>(ptr));
+    }
 }
 
 TEST_CASE("String concat OOB #8198", "[core][String]")
 {
-    char *p = (char*)malloc(16);
+    char* p = (char*)malloc(16);
     memset(p, 'x', 16);
     String s = "abcd";
     s.concat(p, 16);
diff --git a/tests/host/fs/test_fs.cpp b/tests/host/fs/test_fs.cpp
index fb73a6a271..7ad58e403b 100644
--- a/tests/host/fs/test_fs.cpp
+++ b/tests/host/fs/test_fs.cpp
@@ -24,8 +24,8 @@
 #include "../../../libraries/SDFS/src/SDFS.h"
 #include "../../../libraries/SD/src/SD.h"
 
-
-namespace spiffs_test {
+namespace spiffs_test
+{
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 
@@ -47,9 +47,9 @@ namespace spiffs_test {
 TEST_CASE("SPIFFS checks the config object passed in", "[fs]")
 {
     SPIFFS_MOCK_DECLARE(64, 8, 512, "");
-    FSConfig f;
-    SPIFFSConfig s;
-    SDFSConfig d;
+    FSConfig       f;
+    SPIFFSConfig   s;
+    SDFSConfig     d;
     LittleFSConfig l;
 
     REQUIRE_FALSE(SPIFFS.setConfig(f));
@@ -59,10 +59,10 @@ TEST_CASE("SPIFFS checks the config object passed in", "[fs]")
 }
 #pragma GCC diagnostic pop
 
-};
-
+};  // namespace spiffs_test
 
-namespace littlefs_test {
+namespace littlefs_test
+{
 #define FSTYPE LittleFS
 #define TESTPRE "LittleFS - "
 #define TESTPAT "[lfs]"
@@ -82,9 +82,9 @@ namespace littlefs_test {
 TEST_CASE("LittleFS checks the config object passed in", "[fs]")
 {
     LITTLEFS_MOCK_DECLARE(64, 8, 512, "");
-    FSConfig f;
-    SPIFFSConfig s;
-    SDFSConfig d;
+    FSConfig       f;
+    SPIFFSConfig   s;
+    SDFSConfig     d;
     LittleFSConfig l;
 
     REQUIRE_FALSE(LittleFS.setConfig(f));
@@ -93,17 +93,18 @@ TEST_CASE("LittleFS checks the config object passed in", "[fs]")
     REQUIRE(LittleFS.setConfig(l));
 }
 
-};
+};  // namespace littlefs_test
 
-namespace sdfs_test {
+namespace sdfs_test
+{
 #define FSTYPE SDFS
 #define TESTPRE "SDFS - "
 #define TESTPAT "[sdfs]"
 // SDFS supports long paths (MAXPATH)
-#define TOOLONGFILENAME "/" \
-	"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
-	"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
-	"12345678901234567890123456789012345678901234567890123456"
+#define TOOLONGFILENAME "/"                                                                                                    \
+                        "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
+                        "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
+                        "12345678901234567890123456789012345678901234567890123456"
 #define FS_MOCK_DECLARE SDFS_MOCK_DECLARE
 #define FS_MOCK_RESET SDFS_MOCK_RESET
 #define FS_HAS_DIRS
@@ -118,9 +119,9 @@ namespace sdfs_test {
 TEST_CASE("SDFS checks the config object passed in", "[fs]")
 {
     SDFS_MOCK_DECLARE(64, 8, 512, "");
-    FSConfig f;
-    SPIFFSConfig s;
-    SDFSConfig d;
+    FSConfig       f;
+    SPIFFSConfig   s;
+    SDFSConfig     d;
     LittleFSConfig l;
 
     REQUIRE_FALSE(SDFS.setConfig(f));
@@ -142,7 +143,7 @@ TEST_CASE("SD.h FILE_WRITE macro is append", "[fs]")
     f.write(65);
     f.write("bbcc");
     f.write("theend", 6);
-    char block[3]={'x','y','z'};
+    char block[3] = { 'x', 'y', 'z' };
     f.write(block, 3);
     uint32_t bigone = 0x40404040;
     f.write((const uint8_t*)&bigone, 4);
@@ -155,11 +156,11 @@ TEST_CASE("SD.h FILE_WRITE macro is append", "[fs]")
     File g = SD.open("/file2.txt", FILE_WRITE);
     g.write(0);
     g.close();
-    g = SD.open("/file2.txt", FILE_READ);
+    g         = SD.open("/file2.txt", FILE_READ);
     uint8_t u = 0x66;
     g.read(&u, 1);
     g.close();
     REQUIRE(u == 0);
 }
 
-};
+};  // namespace sdfs_test
diff --git a/tests/host/sys/pgmspace.h b/tests/host/sys/pgmspace.h
index ecc4558351..321626542a 100644
--- a/tests/host/sys/pgmspace.h
+++ b/tests/host/sys/pgmspace.h
@@ -15,11 +15,11 @@
 #endif
 
 #ifndef PGM_P
-#define PGM_P const char *
+#define PGM_P const char*
 #endif
 
 #ifndef PGM_VOID_P
-#define PGM_VOID_P const void *
+#define PGM_VOID_P const void*
 #endif
 
 #ifndef PSTR
@@ -27,37 +27,37 @@
 #endif
 
 #ifdef __cplusplus
-    #define pgm_read_byte(addr)             (*reinterpret_cast<const uint8_t*>(addr))
-    #define pgm_read_word(addr)             (*reinterpret_cast<const uint16_t*>(addr))
-    #define pgm_read_dword(addr)            (*reinterpret_cast<const uint32_t*>(addr))
-    #define pgm_read_float(addr)            (*reinterpret_cast<const float*>(addr))
-    #define pgm_read_ptr(addr)              (*reinterpret_cast<const void* const *>(addr))
+#define pgm_read_byte(addr) (*reinterpret_cast<const uint8_t*>(addr))
+#define pgm_read_word(addr) (*reinterpret_cast<const uint16_t*>(addr))
+#define pgm_read_dword(addr) (*reinterpret_cast<const uint32_t*>(addr))
+#define pgm_read_float(addr) (*reinterpret_cast<const float*>(addr))
+#define pgm_read_ptr(addr) (*reinterpret_cast<const void* const*>(addr))
 #else
-    #define pgm_read_byte(addr)             (*(const uint8_t*)(addr))
-    #define pgm_read_word(addr)             (*(const uint16_t*)(addr))
-    #define pgm_read_dword(addr)            (*(const uint32_t*)(addr))
-    #define pgm_read_float(addr)            (*(const float)(addr))
-    #define pgm_read_ptr(addr)              (*(const void* const *)(addr))
+#define pgm_read_byte(addr) (*(const uint8_t*)(addr))
+#define pgm_read_word(addr) (*(const uint16_t*)(addr))
+#define pgm_read_dword(addr) (*(const uint32_t*)(addr))
+#define pgm_read_float(addr) (*(const float)(addr))
+#define pgm_read_ptr(addr) (*(const void* const*)(addr))
 #endif
 
-#define pgm_read_byte_near(addr)        pgm_read_byte(addr)
-#define pgm_read_word_near(addr)        pgm_read_word(addr)
-#define pgm_read_dword_near(addr)       pgm_read_dword(addr)
-#define pgm_read_float_near(addr)       pgm_read_float(addr)
-#define pgm_read_ptr_near(addr)         pgm_read_ptr(addr)
-#define pgm_read_byte_far(addr)         pgm_read_byte(addr)
-#define pgm_read_word_far(addr)         pgm_read_word(addr)
-#define pgm_read_dword_far(addr)        pgm_read_dword(addr)
-#define pgm_read_float_far(addr)        pgm_read_float(addr)
-#define pgm_read_ptr_far(addr)          pgm_read_ptr(addr)
+#define pgm_read_byte_near(addr) pgm_read_byte(addr)
+#define pgm_read_word_near(addr) pgm_read_word(addr)
+#define pgm_read_dword_near(addr) pgm_read_dword(addr)
+#define pgm_read_float_near(addr) pgm_read_float(addr)
+#define pgm_read_ptr_near(addr) pgm_read_ptr(addr)
+#define pgm_read_byte_far(addr) pgm_read_byte(addr)
+#define pgm_read_word_far(addr) pgm_read_word(addr)
+#define pgm_read_dword_far(addr) pgm_read_dword(addr)
+#define pgm_read_float_far(addr) pgm_read_float(addr)
+#define pgm_read_ptr_far(addr) pgm_read_ptr(addr)
 
 // Wrapper inlines for _P functions
 #include <stdio.h>
 #include <string.h>
-inline const char *strstr_P(const char *haystack, const char *needle) { return strstr(haystack, needle); }
-inline char *strcpy_P(char *dest, const char *src) { return strcpy(dest, src); }
-inline size_t strlen_P(const char *s) { return strlen(s); }
-inline int vsnprintf_P(char *str, size_t size, const char *format, va_list ap) { return vsnprintf(str, size, format, ap); }
+inline const char* strstr_P(const char* haystack, const char* needle) { return strstr(haystack, needle); }
+inline char*       strcpy_P(char* dest, const char* src) { return strcpy(dest, src); }
+inline size_t      strlen_P(const char* s) { return strlen(s); }
+inline int         vsnprintf_P(char* str, size_t size, const char* format, va_list ap) { return vsnprintf(str, size, format, ap); }
 
 #define memcpy_P memcpy
 #define memmove_P memmove

From a4bdd62bad13dc50df14f0533f0351893e1080b1 Mon Sep 17 00:00:00 2001
From: David Gauchard <gauchard@laas.fr>
Date: Thu, 20 Jan 2022 14:17:23 +0100
Subject: [PATCH 13/15] sync script, sync submodule

---
 libraries/SoftwareSerial |  2 +-
 tests/restyle.sh         | 10 +++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/libraries/SoftwareSerial b/libraries/SoftwareSerial
index bd2f6ce6a7..eb4b29074b 160000
--- a/libraries/SoftwareSerial
+++ b/libraries/SoftwareSerial
@@ -1 +1 @@
-Subproject commit bd2f6ce6a78d0c31b6978bcffb3c8379a5e4e2e4
+Subproject commit eb4b29074b75eacac3585bf84b5495b8f80a92cf
diff --git a/tests/restyle.sh b/tests/restyle.sh
index 3f49bb07d7..03401b0e36 100755
--- a/tests/restyle.sh
+++ b/tests/restyle.sh
@@ -18,18 +18,22 @@ makeClangConf()
 
     cat << EOF > .clang-format
 BasedOnStyle: WebKit
+SortIncludes: false
 AlignTrailingComments: true
-BreakBeforeBraces: Allman
 ColumnLimit: 0
 KeepEmptyLinesAtTheStartOfBlocks: false
+SpaceBeforeInheritanceColon: false
 SpacesBeforeTrailingComments: 2
 AlignTrailingComments: true
-SortIncludes: false
-BreakConstructorInitializers: AfterColon
 AlignConsecutiveAssignments: Consecutive
 AlignConsecutiveBitFields: Consecutive
 AlignConsecutiveDeclarations: Consecutive
 AlignAfterOpenBracket: Align
+BreakConstructorInitializers: AfterColon
+BreakBeforeBinaryOperators: All
+BreakBeforeConceptDeclarations: true
+FixNamespaceComments: true
+NamespaceIndentation: Inner
 BreakBeforeBraces: ${BreakBeforeBraces}
 IndentWidth: ${IndentWidth}
 IndentCaseLabels: ${IndentCaseLabels}

From 69a23d8e487b99bf44192f18f0aca09e95c78cdc Mon Sep 17 00:00:00 2001
From: David Gauchard <gauchard@laas.fr>
Date: Thu, 20 Jan 2022 14:24:48 +0100
Subject: [PATCH 14/15] missing change

---
 libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
index 16c7397abe..d66509adb5 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
@@ -1604,9 +1604,9 @@ namespace MDNSImplementation
                                 (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                                                                                              // Weight
                                 (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                                                                                         // Port
                                 (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostname, false, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(hostDomain, p_rSendParameter)))  // Host, eg. esp8266.local
-                             // Cache available for domain
-                                             : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
-                                (_write16((sizeof(uint16_t /*Prio*/) +                                                        // RDLength
+                                                                                                                                                                                              // Cache available for domain
+                                             : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&                                                                  // Valid offset
+                                (_write16((sizeof(uint16_t /*Prio*/) +                                                                                                                        // RDLength
                                            sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + 2),
                                           p_rSendParameter))
                                 &&                                                                                          // Length of 'C0xx'

From 694d93517d186aa248b6575ebc2d5a729e9c4d13 Mon Sep 17 00:00:00 2001
From: David Gauchard <gauchard@laas.fr>
Date: Thu, 20 Jan 2022 15:35:17 +0100
Subject: [PATCH 15/15] updates: ternary formats, line length limited to 100

---
 cores/esp8266/LwipDhcpServer-NonOS.cpp        |    5 +-
 cores/esp8266/LwipDhcpServer.cpp              |  108 +-
 cores/esp8266/LwipDhcpServer.h                |   13 +-
 cores/esp8266/LwipIntf.cpp                    |   29 +-
 cores/esp8266/LwipIntf.h                      |   17 +-
 cores/esp8266/LwipIntfCB.cpp                  |   12 +-
 cores/esp8266/LwipIntfDev.h                   |  100 +-
 cores/esp8266/StreamSend.cpp                  |   27 +-
 cores/esp8266/StreamString.h                  |  100 +-
 cores/esp8266/core_esp8266_si2c.cpp           |  193 +-
 cores/esp8266/debug.h                         |   36 +-
 .../ArduinoOTA/examples/BasicOTA/BasicOTA.ino |    8 +-
 .../ArduinoOTA/examples/OTALeds/OTALeds.ino   |    4 +-
 .../CaptivePortalAdvanced.ino                 |   26 +-
 .../CaptivePortalAdvanced/handleHttp.ino      |   86 +-
 .../examples/eeprom_clear/eeprom_clear.ino    |    3 +-
 .../BasicHttpsClient/BasicHttpsClient.ino     |    3 +-
 .../DigestAuthorization.ino                   |   17 +-
 .../PostHttpClient/PostHttpClient.ino         |    2 +-
 .../ReuseConnectionV2/ReuseConnectionV2.ino   |    7 +-
 .../StreamHttpClient/StreamHttpClient.ino     |    5 +-
 .../StreamHttpsClient/StreamHttpsClient.ino   |    3 +-
 .../SecureBearSSLUpdater.ino                  |    3 +-
 .../SecureWebUpdater/SecureWebUpdater.ino     |    7 +-
 .../examples/WebUpdater/WebUpdater.ino        |    3 +-
 .../LLMNR_Web_Server/LLMNR_Web_Server.ino     |   12 +-
 .../examples/ESP_NBNST/ESP_NBNST.ino          |    4 +-
 .../AdvancedWebServer/AdvancedWebServer.ino   |   13 +-
 .../examples/FSBrowser/FSBrowser.ino          |   32 +-
 .../ESP8266WebServer/examples/Graph/Graph.ino |   14 +-
 .../examples/HelloServer/HelloServer.ino      |   44 +-
 .../HelloServerBearSSL/HelloServerBearSSL.ino |    3 +-
 .../HttpAdvancedAuth/HttpAdvancedAuth.ino     |   14 +-
 .../HttpHashCredAuth/HttpHashCredAuth.ino     |   68 +-
 .../examples/PathArgServer/PathArgServer.ino  |    8 +-
 .../examples/PostServer/PostServer.ino        |    4 +-
 .../ServerSentEvents/ServerSentEvents.ino     |   80 +-
 .../SimpleAuthentication.ino                  |   25 +-
 .../examples/WebServer/WebServer.ino          |   31 +-
 .../examples/WebUpdate/WebUpdate.ino          |   63 +-
 .../BearSSL_CertStore/BearSSL_CertStore.ino   |    6 +-
 .../BearSSL_Server/BearSSL_Server.ino         |    2 +
 .../BearSSL_ServerClientCert.ino              |    9 +-
 .../BearSSL_Sessions/BearSSL_Sessions.ino     |    3 +-
 .../BearSSL_Validation/BearSSL_Validation.ino |   13 +-
 .../examples/HTTPSRequest/HTTPSRequest.ino    |    6 +-
 libraries/ESP8266WiFi/examples/IPv6/IPv6.ino  |   16 +-
 .../examples/NTPClient/NTPClient.ino          |   10 +-
 .../examples/PagerServer/PagerServer.ino      |    5 +-
 .../RangeExtender-NAPT/RangeExtender-NAPT.ino |   18 +-
 .../examples/StaticLease/StaticLease.ino      |   13 +-
 libraries/ESP8266WiFi/examples/Udp/Udp.ino    |   10 +-
 .../WiFiAccessPoint/WiFiAccessPoint.ino       |    8 +-
 .../WiFiClientBasic/WiFiClientBasic.ino       |    2 +-
 .../examples/WiFiEcho/WiFiEcho.ino            |    8 +-
 .../examples/WiFiEvents/WiFiEvents.ino        |    4 +-
 .../WiFiManualWebServer.ino                   |    3 +-
 .../examples/WiFiScan/WiFiScan.ino            |   11 +-
 .../examples/WiFiShutdown/WiFiShutdown.ino    |   17 +-
 .../WiFiTelnetToSerial/WiFiTelnetToSerial.ino |   20 +-
 .../examples/HelloEspnow/HelloEspnow.ino      |  422 +++--
 .../examples/HelloMesh/HelloMesh.ino          |  176 +-
 .../examples/HelloTcpIp/HelloTcpIp.ino        |  170 +-
 .../examples/httpUpdate/httpUpdate.ino        |   17 +-
 .../httpUpdateLittleFS/httpUpdateLittleFS.ino |    3 +-
 .../httpUpdateSecure/httpUpdateSecure.ino     |   11 +-
 .../httpUpdateSigned/httpUpdateSigned.ino     |    3 +-
 .../LEAmDNS/mDNS_Clock/mDNS_Clock.ino         |   19 +-
 .../mDNS_ServiceMonitor.ino                   |   39 +-
 .../OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino   |    6 +-
 .../mDNS_Web_Server/mDNS_Web_Server.ino       |    7 +-
 libraries/ESP8266mDNS/src/ESP8266mDNS.h       |   12 +-
 libraries/ESP8266mDNS/src/LEAmDNS.cpp         |  948 +++++-----
 libraries/ESP8266mDNS/src/LEAmDNS.h           |  708 ++++---
 libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp | 1628 ++++++++++-------
 libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp |  306 ++--
 libraries/ESP8266mDNS/src/LEAmDNS_Priv.h      |   49 +-
 libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp | 1302 +++++++------
 .../ESP8266mDNS/src/LEAmDNS_Transfer.cpp      | 1600 +++++++++-------
 libraries/Hash/examples/sha1/sha1.ino         |    4 +-
 .../LittleFS_Timestamp/LittleFS_Timestamp.ino |   15 +-
 .../LittleFS/examples/SpeedTest/SpeedTest.ino |   29 +-
 .../Netdump/examples/Netdump/Netdump.ino      |   91 +-
 libraries/Netdump/src/Netdump.cpp             |   36 +-
 libraries/Netdump/src/Netdump.h               |    2 +-
 libraries/Netdump/src/NetdumpIP.cpp           |   10 +-
 libraries/Netdump/src/NetdumpIP.h             |   60 +-
 libraries/Netdump/src/NetdumpPacket.cpp       |   51 +-
 libraries/Netdump/src/NetdumpPacket.h         |  215 +--
 libraries/Netdump/src/PacketType.cpp          |    4 +-
 libraries/Netdump/src/PacketType.h            |   13 +-
 libraries/SD/examples/DumpFile/DumpFile.ino   |    3 +-
 libraries/SD/examples/listfiles/listfiles.ino |    8 +-
 .../SPISlave_Master/SPISlave_Master.ino       |   16 +-
 .../SPISlave_SafeMaster.ino                   |   17 +-
 .../examples/SPISlave_Test/SPISlave_Test.ino  |   20 +-
 .../examples/drawCircle/drawCircle.ino        |   13 +-
 .../examples/drawLines/drawLines.ino          |   11 +-
 .../examples/drawNumber/drawNumber.ino        |   26 +-
 .../examples/drawRectangle/drawRectangle.ino  |    3 +-
 .../examples/paint/paint.ino                  |   10 +-
 .../examples/shapes/shapes.ino                |    4 +-
 .../examples/text/text.ino                    |    6 +-
 .../examples/tftbmp/tftbmp.ino                |    3 +-
 .../examples/tftbmp2/tftbmp2.ino              |    6 +-
 .../examples/TickerBasic/TickerBasic.ino      |    3 +-
 .../TickerFunctional/TickerFunctional.ino     |   26 +-
 .../TickerParameter/TickerParameter.ino       |   19 +-
 libraries/Wire/Wire.cpp                       |   42 +-
 .../slave_receiver/slave_receiver.ino         |    3 +-
 .../examples/slave_sender/slave_sender.ino    |    3 +-
 .../BlinkPolledTimeout/BlinkPolledTimeout.ino |   31 +-
 .../BlinkWithoutDelay/BlinkWithoutDelay.ino   |    4 +-
 .../examples/CallBackList/CallBackGeneric.ino |   35 +-
 .../CallSDKFunctions/CallSDKFunctions.ino     |    4 +-
 .../examples/CheckFlashCRC/CheckFlashCRC.ino  |    3 +-
 .../CheckFlashConfig/CheckFlashConfig.ino     |   13 +-
 .../examples/ConfigFile/ConfigFile.ino        |    3 +-
 .../FadePolledTimeout/FadePolledTimeout.ino   |    2 +-
 .../examples/HeapMetric/HeapMetric.ino        |    6 +-
 .../examples/HelloCrypto/HelloCrypto.ino      |   59 +-
 .../examples/HwdtStackDump/HwdtStackDump.ino  |    9 +-
 .../examples/HwdtStackDump/ProcessKey.ino     |   20 +-
 .../esp8266/examples/I2SInput/I2SInput.ino    |    3 +-
 .../examples/IramReserve/IramReserve.ino      |    6 +-
 .../examples/IramReserve/ProcessKey.ino       |   20 +-
 .../examples/LowPowerDemo/LowPowerDemo.ino    |  103 +-
 libraries/esp8266/examples/MMU48K/MMU48K.ino  |   41 +-
 .../examples/NTP-TZ-DST/NTP-TZ-DST.ino        |   25 +-
 .../examples/RTCUserMemory/RTCUserMemory.ino  |    5 +-
 .../SerialDetectBaudrate.ino                  |    6 +-
 .../examples/SerialStress/SerialStress.ino    |   27 +-
 .../examples/StreamString/StreamString.ino    |   11 +-
 .../examples/TestEspApi/TestEspApi.ino        |   83 +-
 .../examples/UartDownload/UartDownload.ino    |   14 +-
 .../examples/interactive/interactive.ino      |   35 +-
 .../esp8266/examples/irammem/irammem.ino      |  138 +-
 .../examples/virtualmem/virtualmem.ino        |    6 +-
 .../lwIP_PPP/examples/PPPServer/PPPServer.ino |   33 +-
 libraries/lwIP_PPP/src/PPPServer.cpp          |   23 +-
 libraries/lwIP_PPP/src/PPPServer.h            |   10 +-
 .../lwIP_enc28j60/src/utility/enc28j60.cpp    |   69 +-
 .../lwIP_enc28j60/src/utility/enc28j60.h      |    5 +-
 libraries/lwIP_w5100/src/utility/w5100.cpp    |    6 +-
 libraries/lwIP_w5100/src/utility/w5100.h      |  128 +-
 .../examples/TCPClient/TCPClient.ino          |    4 +-
 libraries/lwIP_w5500/src/utility/w5500.cpp    |    9 +-
 libraries/lwIP_w5500/src/utility/w5500.h      |  189 +-
 tests/device/libraries/BSTest/src/BSArduino.h |   12 +-
 tests/device/libraries/BSTest/src/BSArgs.h    |   61 +-
 .../device/libraries/BSTest/src/BSProtocol.h  |   32 +-
 tests/device/libraries/BSTest/src/BSStdio.h   |   11 +-
 tests/device/libraries/BSTest/src/BSTest.h    |   96 +-
 tests/device/libraries/BSTest/test/test.cpp   |    9 +-
 tests/device/test_libc/libm_string.c          |   12 +-
 tests/device/test_libc/memcpy-1.c             |   11 +-
 tests/device/test_libc/memmove1.c             |   23 +-
 tests/device/test_libc/strcmp-1.c             |    9 +-
 tests/device/test_libc/tstring.c              |   72 +-
 tests/host/common/Arduino.cpp                 |   50 +-
 tests/host/common/ArduinoCatch.cpp            |    4 +-
 tests/host/common/ArduinoMain.cpp             |   43 +-
 tests/host/common/ClientContextSocket.cpp     |   16 +-
 tests/host/common/ClientContextTools.cpp      |    3 +-
 tests/host/common/EEPROM.h                    |    8 +-
 tests/host/common/HostWiring.cpp              |   21 +-
 tests/host/common/MockEEPROM.cpp              |   15 +-
 tests/host/common/MockEsp.cpp                 |  140 +-
 tests/host/common/MockSPI.cpp                 |   37 +-
 tests/host/common/MockTools.cpp               |    7 +-
 tests/host/common/MockUART.cpp                |  121 +-
 tests/host/common/MockWiFiServer.cpp          |    5 +-
 tests/host/common/MockWiFiServerSocket.cpp    |   16 +-
 tests/host/common/MocklwIP.cpp                |    9 +-
 tests/host/common/UdpContextSocket.cpp        |   46 +-
 tests/host/common/WMath.cpp                   |   18 +-
 tests/host/common/c_types.h                   |   12 +-
 tests/host/common/include/ClientContext.h     |   41 +-
 tests/host/common/include/UdpContext.h        |   75 +-
 tests/host/common/littlefs_mock.cpp           |   16 +-
 tests/host/common/littlefs_mock.h             |   10 +-
 tests/host/common/md5.c                       |   71 +-
 tests/host/common/mock.h                      |   26 +-
 tests/host/common/noniso.c                    |    9 +-
 tests/host/common/pins_arduino.h              |    4 +-
 tests/host/common/queue.h                     |  504 +++--
 tests/host/common/sdfs_mock.h                 |   18 +-
 tests/host/common/spiffs_mock.cpp             |   13 +-
 tests/host/common/spiffs_mock.h               |   10 +-
 tests/host/common/user_interface.cpp          |  177 +-
 tests/host/core/test_PolledTimeout.cpp        |    6 +-
 tests/host/core/test_md5builder.cpp           |    9 +-
 tests/host/core/test_string.cpp               |   33 +-
 tests/host/fs/test_fs.cpp                     |   14 +-
 tests/host/sys/pgmspace.h                     |   14 +-
 tests/restyle.sh                              |    8 +-
 196 files changed, 6460 insertions(+), 6319 deletions(-)

diff --git a/cores/esp8266/LwipDhcpServer-NonOS.cpp b/cores/esp8266/LwipDhcpServer-NonOS.cpp
index aee22b6d5c..29f125427f 100644
--- a/cores/esp8266/LwipDhcpServer-NonOS.cpp
+++ b/cores/esp8266/LwipDhcpServer-NonOS.cpp
@@ -55,9 +55,6 @@ extern "C"
 #endif
     }
 
-    void dhcps_stop()
-    {
-        dhcpSoftAP.end();
-    }
+    void dhcps_stop() { dhcpSoftAP.end(); }
 
 }  // extern "C"
diff --git a/cores/esp8266/LwipDhcpServer.cpp b/cores/esp8266/LwipDhcpServer.cpp
index fd25edbc50..8d0eefb9ef 100644
--- a/cores/esp8266/LwipDhcpServer.cpp
+++ b/cores/esp8266/LwipDhcpServer.cpp
@@ -109,7 +109,7 @@ struct dhcps_pool
     dhcps_state_t    state;
 };
 
-#define DHCPS_LEASE_TIMER dhcps_lease_time  //0x05A0
+#define DHCPS_LEASE_TIMER dhcps_lease_time  // 0x05A0
 #define DHCPS_MAX_LEASE 0x64
 #define BOOTP_BROADCAST 0x8000
 
@@ -161,16 +161,17 @@ const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__;
 #endif
 
 #if DHCPS_DEBUG
-#define LWIP_IS_OK(what, err) (                                     \
-    {                                                               \
-        int ret = 1, errval = (err);                                \
-        if (errval != ERR_OK)                                       \
-        {                                                           \
-            os_printf("DHCPS ERROR: %s (lwip:%d)\n", what, errval); \
-            ret = 0;                                                \
-        }                                                           \
-        ret;                                                        \
-    })
+#define LWIP_IS_OK(what, err)                                                                      \
+    (                                                                                              \
+        {                                                                                          \
+            int ret = 1, errval = (err);                                                           \
+            if (errval != ERR_OK)                                                                  \
+            {                                                                                      \
+                os_printf("DHCPS ERROR: %s (lwip:%d)\n", what, errval);                            \
+                ret = 0;                                                                           \
+            }                                                                                      \
+            ret;                                                                                   \
+        })
 #else
 #define LWIP_IS_OK(what, err) ((err) == ERR_OK)
 #endif
@@ -181,15 +182,14 @@ int fw_has_started_softap_dhcps = 0;
 
 ////////////////////////////////////////////////////////////////////////////////////
 
-DhcpServer::DhcpServer(netif* netif) :
-    _netif(netif)
+DhcpServer::DhcpServer(netif* netif) : _netif(netif)
 {
     pcb_dhcps        = nullptr;
     dns_address.addr = 0;
     plist            = nullptr;
     offer            = 0xFF;
     renew            = false;
-    dhcps_lease_time = DHCPS_LEASE_TIME_DEF;  //minute
+    dhcps_lease_time = DHCPS_LEASE_TIME_DEF;  // minute
 
     if (netif->num == SOFTAP_IF && fw_has_started_softap_dhcps == 1)
     {
@@ -385,13 +385,13 @@ uint8_t* DhcpServer::add_msg_type(uint8_t* optptr, uint8_t type)
 ///////////////////////////////////////////////////////////////////////////////////
 uint8_t* DhcpServer::add_offer_options(uint8_t* optptr)
 {
-    //struct ipv4_addr ipadd;
-    //ipadd.addr = server_address.addr;
+    // struct ipv4_addr ipadd;
+    // ipadd.addr = server_address.addr;
 #define ipadd (_netif->ip_addr)
 
-    //struct ip_info if_ip;
-    //bzero(&if_ip, sizeof(struct ip_info));
-    //wifi_get_ip_info(SOFTAP_IF, &if_ip);
+    // struct ip_info if_ip;
+    // bzero(&if_ip, sizeof(struct ip_info));
+    // wifi_get_ip_info(SOFTAP_IF, &if_ip);
 #define if_ip (*_netif)
 
     *optptr++ = DHCP_OPTION_SUBNET_MASK;
@@ -691,7 +691,8 @@ void DhcpServer::send_ack(struct dhcps_msg* m)
 #endif
         return;
     }
-    if (!LWIP_IS_OK("dhcps send ack", udp_sendto(pcb_dhcps, p, &broadcast_dhcps, DHCPS_CLIENT_PORT)))
+    if (!LWIP_IS_OK("dhcps send ack",
+                    udp_sendto(pcb_dhcps, p, &broadcast_dhcps, DHCPS_CLIENT_PORT)))
     {
 #if DHCPS_DEBUG
         os_printf("dhcps: send_ack>>udp_sendto\n");
@@ -736,12 +737,12 @@ uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
 #endif
         switch ((sint16_t)*optptr)
         {
-        case DHCP_OPTION_MSG_TYPE:  //53
+        case DHCP_OPTION_MSG_TYPE:  // 53
             type = *(optptr + 2);
             break;
 
-        case DHCP_OPTION_REQ_IPADDR:  //50
-            //os_printf("dhcps:0x%08x,0x%08x\n",client.addr,*(uint32*)(optptr+2));
+        case DHCP_OPTION_REQ_IPADDR:  // 50
+            // os_printf("dhcps:0x%08x,0x%08x\n",client.addr,*(uint32*)(optptr+2));
             if (memcmp((char*)&client.addr, (char*)optptr + 2, 4) == 0)
             {
 #if DHCPS_DEBUG
@@ -774,14 +775,14 @@ uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
 
     switch (type)
     {
-    case DHCPDISCOVER:  //1
+    case DHCPDISCOVER:  // 1
         s.state = DHCPS_STATE_OFFER;
 #if DHCPS_DEBUG
         os_printf("dhcps: DHCPD_STATE_OFFER\n");
 #endif
         break;
 
-    case DHCPREQUEST:  //3
+    case DHCPREQUEST:  // 3
         if (!(s.state == DHCPS_STATE_ACK || s.state == DHCPS_STATE_NAK))
         {
             if (renew == true)
@@ -798,14 +799,14 @@ uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
         }
         break;
 
-    case DHCPDECLINE:  //4
+    case DHCPDECLINE:  // 4
         s.state = DHCPS_STATE_IDLE;
 #if DHCPS_DEBUG
         os_printf("dhcps: DHCPD_STATE_IDLE\n");
 #endif
         break;
 
-    case DHCPRELEASE:  //7
+    case DHCPRELEASE:  // 7
         s.state = DHCPS_STATE_RELEASE;
 #if DHCPS_DEBUG
         os_printf("dhcps: DHCPD_STATE_IDLE\n");
@@ -821,10 +822,7 @@ uint8_t DhcpServer::parse_options(uint8_t* optptr, sint16_t len)
 ///////////////////////////////////////////////////////////////////////////////////
 sint16_t DhcpServer::parse_msg(struct dhcps_msg* m, u16_t len)
 {
-    if (memcmp((char*)m->options,
-               &magic_cookie,
-               sizeof(magic_cookie))
-        == 0)
+    if (memcmp((char*)m->options, &magic_cookie, sizeof(magic_cookie)) == 0)
     {
         struct ipv4_addr ip;
         memcpy(&ip.addr, m->ciaddr, sizeof(ip.addr));
@@ -855,21 +853,15 @@ sint16_t DhcpServer::parse_msg(struct dhcps_msg* m, u16_t len)
 */
 ///////////////////////////////////////////////////////////////////////////////////
 
-void DhcpServer::S_handle_dhcp(void*            arg,
-                               struct udp_pcb*  pcb,
-                               struct pbuf*     p,
-                               const ip_addr_t* addr,
-                               uint16_t         port)
+void DhcpServer::S_handle_dhcp(void* arg, struct udp_pcb* pcb, struct pbuf* p,
+                               const ip_addr_t* addr, uint16_t port)
 {
     DhcpServer* instance = reinterpret_cast<DhcpServer*>(arg);
     instance->handle_dhcp(pcb, p, addr, port);
 }
 
-void DhcpServer::handle_dhcp(
-    struct udp_pcb*  pcb,
-    struct pbuf*     p,
-    const ip_addr_t* addr,
-    uint16_t         port)
+void DhcpServer::handle_dhcp(struct udp_pcb* pcb, struct pbuf* p, const ip_addr_t* addr,
+                             uint16_t port)
 {
     (void)pcb;
     (void)addr;
@@ -931,13 +923,13 @@ void DhcpServer::handle_dhcp(
 
     switch (parse_msg(pmsg_dhcps, tlen - 240))
     {
-    case DHCPS_STATE_OFFER:  //1
+    case DHCPS_STATE_OFFER:  // 1
 #if DHCPS_DEBUG
         os_printf("dhcps: handle_dhcp-> DHCPD_STATE_OFFER\n");
 #endif
         send_offer(pmsg_dhcps);
         break;
-    case DHCPS_STATE_ACK:  //3
+    case DHCPS_STATE_ACK:  // 3
 #if DHCPS_DEBUG
         os_printf("dhcps: handle_dhcp-> DHCPD_STATE_ACK\n");
 #endif
@@ -947,7 +939,7 @@ void DhcpServer::handle_dhcp(
             wifi_softap_set_station_info(pmsg_dhcps->chaddr, &client_address);
         }
         break;
-    case DHCPS_STATE_NAK:  //4
+    case DHCPS_STATE_NAK:  // 4
 #if DHCPS_DEBUG
         os_printf("dhcps: handle_dhcp-> DHCPD_STATE_NAK\n");
 #endif
@@ -1037,7 +1029,7 @@ bool DhcpServer::begin(struct ip_info* info)
     broadcast_dhcps = _netif->ip_addr;
     ip_2_ip4(&broadcast_dhcps)->addr &= ip_2_ip4(&_netif->netmask)->addr;
     ip_2_ip4(&broadcast_dhcps)->addr |= ~ip_2_ip4(&_netif->netmask)->addr;
-    //XXXFIXMEIPV6 broadcast address?
+    // XXXFIXMEIPV6 broadcast address?
 
     server_address = info->ip;
     init_dhcps_lease(server_address.addr);
@@ -1045,7 +1037,8 @@ bool DhcpServer::begin(struct ip_info* info)
     udp_bind(pcb_dhcps, IP_ADDR_ANY, DHCPS_SERVER_PORT);
     udp_recv(pcb_dhcps, S_handle_dhcp, this);
 #if DHCPS_DEBUG
-    os_printf("dhcps:dhcps_start->udp_recv function Set a receive callback handle_dhcp for UDP_PCB pcb_dhcps\n");
+    os_printf("dhcps:dhcps_start->udp_recv function Set a receive callback handle_dhcp for UDP_PCB "
+              "pcb_dhcps\n");
 #endif
 
     if (_netif->num == SOFTAP_IF)
@@ -1057,10 +1050,7 @@ bool DhcpServer::begin(struct ip_info* info)
     return true;
 }
 
-DhcpServer::~DhcpServer()
-{
-    end();
-}
+DhcpServer::~DhcpServer() { end(); }
 
 void DhcpServer::end()
 {
@@ -1073,7 +1063,7 @@ void DhcpServer::end()
     udp_remove(pcb_dhcps);
     pcb_dhcps = nullptr;
 
-    //udp_remove(pcb_dhcps);
+    // udp_remove(pcb_dhcps);
     list_node*         pnode      = nullptr;
     list_node*         pback_node = nullptr;
     struct dhcps_pool* dhcp_node  = nullptr;
@@ -1087,7 +1077,7 @@ void DhcpServer::end()
         pnode      = pback_node->pnext;
         node_remove_from_list(&plist, pback_node);
         dhcp_node = (struct dhcps_pool*)pback_node->pnode;
-        //dhcps_client_leave(dhcp_node->mac,&dhcp_node->ip,true); // force to delete
+        // dhcps_client_leave(dhcp_node->mac,&dhcp_node->ip,true); // force to delete
         if (_netif->num == SOFTAP_IF)
         {
             wifi_softap_set_station_info(dhcp_node->mac, &ip_zero);
@@ -1099,10 +1089,7 @@ void DhcpServer::end()
     }
 }
 
-bool DhcpServer::isRunning()
-{
-    return !!_netif->state;
-}
+bool DhcpServer::isRunning() { return !!_netif->state; }
 
 /******************************************************************************
     FunctionName : set_dhcps_lease
@@ -1147,8 +1134,7 @@ bool DhcpServer::set_dhcps_lease(struct dhcps_lease* please)
 
         /*config ip information must be in the same segment as the local ip*/
         softap_ip >>= 8;
-        if ((start_ip >> 8 != softap_ip)
-            || (end_ip >> 8 != softap_ip))
+        if ((start_ip >> 8 != softap_ip) || (end_ip >> 8 != softap_ip))
         {
             return false;
         }
@@ -1288,7 +1274,7 @@ void DhcpServer::dhcps_coarse_tmr(void)
 bool DhcpServer::set_dhcps_offer_option(uint8 level, void* optarg)
 {
     bool offer_flag = true;
-    //uint8 option = 0;
+    // uint8 option = 0;
     if (optarg == nullptr && !isRunning())
     {
         return false;
@@ -1444,7 +1430,7 @@ uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
     for (pback_node = plist; pback_node != nullptr; pback_node = pback_node->pnext)
     {
         pdhcps_pool = (struct dhcps_pool*)pback_node->pnode;
-        //os_printf("mac:"MACSTR"bssid:"MACSTR"\r\n",MAC2STR(pdhcps_pool->mac),MAC2STR(bssid));
+        // os_printf("mac:"MACSTR"bssid:"MACSTR"\r\n",MAC2STR(pdhcps_pool->mac),MAC2STR(bssid));
         if (memcmp(pdhcps_pool->mac, bssid, sizeof(pdhcps_pool->mac)) == 0)
         {
             pmac_node = pback_node;
@@ -1493,7 +1479,7 @@ uint32 DhcpServer::dhcps_client_update(u8* bssid, struct ipv4_addr* ip)
             {
                 return IPADDR_ANY;
             }
-            //start_ip = htonl((ntohl(start_ip) + 1));
+            // start_ip = htonl((ntohl(start_ip) + 1));
             flag = true;
         }
     }
diff --git a/cores/esp8266/LwipDhcpServer.h b/cores/esp8266/LwipDhcpServer.h
index 821c3a68bd..d5eb6410ef 100644
--- a/cores/esp8266/LwipDhcpServer.h
+++ b/cores/esp8266/LwipDhcpServer.h
@@ -83,16 +83,9 @@ class DhcpServer
     void        send_ack(struct dhcps_msg* m);
     uint8_t     parse_options(uint8_t* optptr, sint16_t len);
     sint16_t    parse_msg(struct dhcps_msg* m, u16_t len);
-    static void S_handle_dhcp(void*            arg,
-                              struct udp_pcb*  pcb,
-                              struct pbuf*     p,
-                              const ip_addr_t* addr,
-                              uint16_t         port);
-    void        handle_dhcp(
-               struct udp_pcb*  pcb,
-               struct pbuf*     p,
-               const ip_addr_t* addr,
-               uint16_t         port);
+    static void S_handle_dhcp(void* arg, struct udp_pcb* pcb, struct pbuf* p, const ip_addr_t* addr,
+                              uint16_t port);
+    void   handle_dhcp(struct udp_pcb* pcb, struct pbuf* p, const ip_addr_t* addr, uint16_t port);
     void   kill_oldest_dhcps_pool(void);
     void   dhcps_coarse_tmr(void);  // CURRENTLY NOT CALLED
     void   dhcps_client_leave(u8* bssid, struct ipv4_addr* ip, bool force);
diff --git a/cores/esp8266/LwipIntf.cpp b/cores/esp8266/LwipIntf.cpp
index b4ae7e06e9..e03d4870e6 100644
--- a/cores/esp8266/LwipIntf.cpp
+++ b/cores/esp8266/LwipIntf.cpp
@@ -25,20 +25,25 @@ extern "C"
 //
 // result stored into gateway/netmask/dns1
 
-bool LwipIntf::ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3,
-                                IPAddress& gateway, IPAddress& netmask, IPAddress& dns1)
+bool LwipIntf::ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1,
+                                const IPAddress& arg2, const IPAddress& arg3, IPAddress& gateway,
+                                IPAddress& netmask, IPAddress& dns1)
 {
-    //To allow compatibility, check first octet of 3rd arg. If 255, interpret as ESP order, otherwise Arduino order.
+    // To allow compatibility, check first octet of 3rd arg. If 255, interpret as ESP order,
+    // otherwise Arduino order.
     gateway = arg1;
     netmask = arg2;
     dns1    = arg3;
 
     if (netmask[0] != 255)
     {
-        //octet is not 255 => interpret as Arduino order
+        // octet is not 255 => interpret as Arduino order
         gateway = arg2;
-        netmask = arg3[0] == 0 ? IPAddress(255, 255, 255, 0) : arg3;  //arg order is arduino and 4th arg not given => assign it arduino default
-        dns1    = arg1;
+        netmask
+            = arg3[0] == 0 ?
+                  IPAddress(255, 255, 255, 0) :
+                  arg3;  // arg order is arduino and 4th arg not given => assign it arduino default
+        dns1 = arg1;
     }
 
     // check whether all is IPv4 (or gateway not set)
@@ -47,7 +52,7 @@ bool LwipIntf::ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1
         return false;
     }
 
-    //ip and gateway must be in the same netmask
+    // ip and gateway must be in the same netmask
     if (gateway.isSet() && (local_ip.v4() & netmask.v4()) != (gateway.v4() & netmask.v4()))
     {
         return false;
@@ -60,19 +65,13 @@ bool LwipIntf::ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1
     Get ESP8266 station DHCP hostname
     @return hostname
 */
-String LwipIntf::hostname(void)
-{
-    return wifi_station_get_hostname();
-}
+String LwipIntf::hostname(void) { return wifi_station_get_hostname(); }
 
 /**
     Get ESP8266 station DHCP hostname
     @return hostname
 */
-const char* LwipIntf::getHostname(void)
-{
-    return wifi_station_get_hostname();
-}
+const char* LwipIntf::getHostname(void) { return wifi_station_get_hostname(); }
 
 /**
     Set ESP8266 station DHCP hostname
diff --git a/cores/esp8266/LwipIntf.h b/cores/esp8266/LwipIntf.h
index 386906b0a1..d284bddfcc 100644
--- a/cores/esp8266/LwipIntf.h
+++ b/cores/esp8266/LwipIntf.h
@@ -23,20 +23,15 @@ class LwipIntf
     // arg3     | dns1       netmask
     //
     // result stored into gateway/netmask/dns1
-    static bool ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3,
-                                 IPAddress& gateway, IPAddress& netmask, IPAddress& dns1);
+    static bool ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1,
+                                 const IPAddress& arg2, const IPAddress& arg3, IPAddress& gateway,
+                                 IPAddress& netmask, IPAddress& dns1);
 
     String hostname();
-    bool   hostname(const String& aHostname)
-    {
-        return hostname(aHostname.c_str());
-    }
-    bool hostname(const char* aHostname);
+    bool   hostname(const String& aHostname) { return hostname(aHostname.c_str()); }
+    bool   hostname(const char* aHostname);
     // ESP32 API compatibility
-    bool setHostname(const char* aHostName)
-    {
-        return hostname(aHostName);
-    }
+    bool        setHostname(const char* aHostName) { return hostname(aHostName); }
     const char* getHostname();
 
 protected:
diff --git a/cores/esp8266/LwipIntfCB.cpp b/cores/esp8266/LwipIntfCB.cpp
index b79c6323fb..f829723bad 100644
--- a/cores/esp8266/LwipIntfCB.cpp
+++ b/cores/esp8266/LwipIntfCB.cpp
@@ -33,10 +33,10 @@ bool LwipIntf::stateChangeSysCB(LwipIntf::CBType&& cb)
 
 bool LwipIntf::stateUpCB(LwipIntf::CBType&& cb)
 {
-    return stateChangeSysCB([cb](netif* nif)
-                            {
-                                if (netif_is_up(nif))
-                                    schedule_function([cb, nif]()
-                                                      { cb(nif); });
-                            });
+    return stateChangeSysCB(
+        [cb](netif* nif)
+        {
+            if (netif_is_up(nif))
+                schedule_function([cb, nif]() { cb(nif); });
+        });
 }
diff --git a/cores/esp8266/LwipIntfDev.h b/cores/esp8266/LwipIntfDev.h
index 2f9987029f..f3a2006b65 100644
--- a/cores/esp8266/LwipIntfDev.h
+++ b/cores/esp8266/LwipIntfDev.h
@@ -25,50 +25,31 @@
 #define DEFAULT_MTU 1500
 #endif
 
-template <class RawDev>
-class LwipIntfDev: public LwipIntf, public RawDev
+template <class RawDev> class LwipIntfDev: public LwipIntf, public RawDev
 {
 public:
     LwipIntfDev(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1) :
-        RawDev(cs, spi, intr),
-        _mtu(DEFAULT_MTU),
-        _intrPin(intr),
-        _started(false),
-        _default(false)
+        RawDev(cs, spi, intr), _mtu(DEFAULT_MTU), _intrPin(intr), _started(false), _default(false)
     {
         memset(&_netif, 0, sizeof(_netif));
     }
 
-    boolean config(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3 = IPADDR_NONE, const IPAddress& dns2 = IPADDR_NONE);
+    boolean config(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2,
+                   const IPAddress& arg3 = IPADDR_NONE, const IPAddress& dns2 = IPADDR_NONE);
 
     // default mac-address is inferred from esp8266's STA interface
     boolean begin(const uint8_t* macAddress = nullptr, const uint16_t mtu = DEFAULT_MTU);
 
-    const netif* getNetIf() const
-    {
-        return &_netif;
-    }
+    const netif* getNetIf() const { return &_netif; }
 
-    IPAddress localIP() const
-    {
-        return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.ip_addr)));
-    }
-    IPAddress subnetMask() const
-    {
-        return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.netmask)));
-    }
-    IPAddress gatewayIP() const
-    {
-        return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.gw)));
-    }
+    IPAddress localIP() const { return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.ip_addr))); }
+    IPAddress subnetMask() const { return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.netmask))); }
+    IPAddress gatewayIP() const { return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.gw))); }
 
     void setDefault();
 
     // true if interface has a valid IPv4 address
-    bool connected()
-    {
-        return !!ip4_addr_get_u32(ip_2_ip4(&_netif.ip_addr));
-    }
+    bool connected() { return !!ip4_addr_get_u32(ip_2_ip4(&_netif.ip_addr)); }
 
     // ESP8266WiFi API compatibility
 
@@ -97,7 +78,9 @@ class LwipIntfDev: public LwipIntf, public RawDev
 };
 
 template <class RawDev>
-boolean LwipIntfDev<RawDev>::config(const IPAddress& localIP, const IPAddress& gateway, const IPAddress& netmask, const IPAddress& dns1, const IPAddress& dns2)
+boolean LwipIntfDev<RawDev>::config(const IPAddress& localIP, const IPAddress& gateway,
+                                    const IPAddress& netmask, const IPAddress& dns1,
+                                    const IPAddress& dns2)
 {
     if (_started)
     {
@@ -160,7 +143,7 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
 #endif
         _macAddress[3] += _netif.num;  // alter base mac address
         _macAddress[0] &= 0xfe;        // set as locally administered, unicast, per
-        _macAddress[0] |= 0x02;        // https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local
+        _macAddress[0] |= 0x02;  // https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local
     }
 
     if (!RawDev::begin(_macAddress))
@@ -179,7 +162,8 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
     ip_addr_copy(netmask, _netif.netmask);
     ip_addr_copy(gw, _netif.gw);
 
-    if (!netif_add(&_netif, ip_2_ip4(&ip_addr), ip_2_ip4(&netmask), ip_2_ip4(&gw), this, netif_init_s, ethernet_input))
+    if (!netif_add(&_netif, ip_2_ip4(&ip_addr), ip_2_ip4(&netmask), ip_2_ip4(&gw), this,
+                   netif_init_s, ethernet_input))
     {
         return false;
     }
@@ -208,21 +192,24 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
     {
         if (RawDev::interruptIsPossible())
         {
-            //attachInterrupt(_intrPin, [&]() { this->handlePackets(); }, FALLING);
+            // attachInterrupt(_intrPin, [&]() { this->handlePackets(); }, FALLING);
         }
         else
         {
-            ::printf((PGM_P)F("lwIP_Intf: Interrupt not implemented yet, enabling transparent polling\r\n"));
+            ::printf((PGM_P)F(
+                "lwIP_Intf: Interrupt not implemented yet, enabling transparent polling\r\n"));
             _intrPin = -1;
         }
     }
 
-    if (_intrPin < 0 && !schedule_recurrent_function_us([&]()
-                                                        {
-                                                            this->handlePackets();
-                                                            return true;
-                                                        },
-                                                        100))
+    if (_intrPin < 0
+        && !schedule_recurrent_function_us(
+            [&]()
+            {
+                this->handlePackets();
+                return true;
+            },
+            100))
     {
         netif_remove(&_netif);
         return false;
@@ -231,14 +218,12 @@ boolean LwipIntfDev<RawDev>::begin(const uint8_t* macAddress, const uint16_t mtu
     return true;
 }
 
-template <class RawDev>
-wl_status_t LwipIntfDev<RawDev>::status()
+template <class RawDev> wl_status_t LwipIntfDev<RawDev>::status()
 {
     return _started ? (connected() ? WL_CONNECTED : WL_DISCONNECTED) : WL_NO_SHIELD;
 }
 
-template <class RawDev>
-err_t LwipIntfDev<RawDev>::linkoutput_s(netif* netif, struct pbuf* pbuf)
+template <class RawDev> err_t LwipIntfDev<RawDev>::linkoutput_s(netif* netif, struct pbuf* pbuf)
 {
     LwipIntfDev* ths = (LwipIntfDev*)netif->state;
 
@@ -252,36 +237,31 @@ err_t LwipIntfDev<RawDev>::linkoutput_s(netif* netif, struct pbuf* pbuf)
 #if PHY_HAS_CAPTURE
     if (phy_capture)
     {
-        phy_capture(ths->_netif.num, (const char*)pbuf->payload, pbuf->len, /*out*/ 1, /*success*/ len == pbuf->len);
+        phy_capture(ths->_netif.num, (const char*)pbuf->payload, pbuf->len, /*out*/ 1,
+                    /*success*/ len == pbuf->len);
     }
 #endif
 
     return len == pbuf->len ? ERR_OK : ERR_MEM;
 }
 
-template <class RawDev>
-err_t LwipIntfDev<RawDev>::netif_init_s(struct netif* netif)
+template <class RawDev> err_t LwipIntfDev<RawDev>::netif_init_s(struct netif* netif)
 {
     return ((LwipIntfDev*)netif->state)->netif_init();
 }
 
-template <class RawDev>
-void LwipIntfDev<RawDev>::netif_status_callback_s(struct netif* netif)
+template <class RawDev> void LwipIntfDev<RawDev>::netif_status_callback_s(struct netif* netif)
 {
     ((LwipIntfDev*)netif->state)->netif_status_callback();
 }
 
-template <class RawDev>
-err_t LwipIntfDev<RawDev>::netif_init()
+template <class RawDev> err_t LwipIntfDev<RawDev>::netif_init()
 {
     _netif.name[0]      = 'e';
     _netif.name[1]      = '0' + _netif.num;
     _netif.mtu          = _mtu;
     _netif.chksum_flags = NETIF_CHECKSUM_ENABLE_ALL;
-    _netif.flags        = NETIF_FLAG_ETHARP
-        | NETIF_FLAG_IGMP
-        | NETIF_FLAG_BROADCAST
-        | NETIF_FLAG_LINK_UP;
+    _netif.flags = NETIF_FLAG_ETHARP | NETIF_FLAG_IGMP | NETIF_FLAG_BROADCAST | NETIF_FLAG_LINK_UP;
 
     // lwIP's doc: This function typically first resolves the hardware
     // address, then sends the packet.  For ethernet physical layer, this is
@@ -297,8 +277,7 @@ err_t LwipIntfDev<RawDev>::netif_init()
     return ERR_OK;
 }
 
-template <class RawDev>
-void LwipIntfDev<RawDev>::netif_status_callback()
+template <class RawDev> void LwipIntfDev<RawDev>::netif_status_callback()
 {
     if (connected())
     {
@@ -317,8 +296,7 @@ void LwipIntfDev<RawDev>::netif_status_callback()
     }
 }
 
-template <class RawDev>
-err_t LwipIntfDev<RawDev>::handlePackets()
+template <class RawDev> err_t LwipIntfDev<RawDev>::handlePackets()
 {
     int pkt = 0;
     while (1)
@@ -370,7 +348,8 @@ err_t LwipIntfDev<RawDev>::handlePackets()
 #if PHY_HAS_CAPTURE
         if (phy_capture)
         {
-            phy_capture(_netif.num, (const char*)pbuf->payload, tot_len, /*out*/ 0, /*success*/ err == ERR_OK);
+            phy_capture(_netif.num, (const char*)pbuf->payload, tot_len, /*out*/ 0,
+                        /*success*/ err == ERR_OK);
         }
 #endif
 
@@ -383,8 +362,7 @@ err_t LwipIntfDev<RawDev>::handlePackets()
     }
 }
 
-template <class RawDev>
-void LwipIntfDev<RawDev>::setDefault()
+template <class RawDev> void LwipIntfDev<RawDev>::setDefault()
 {
     _default = true;
     if (connected())
diff --git a/cores/esp8266/StreamSend.cpp b/cores/esp8266/StreamSend.cpp
index fb92b48cd8..250aca7759 100644
--- a/cores/esp8266/StreamSend.cpp
+++ b/cores/esp8266/StreamSend.cpp
@@ -22,9 +22,7 @@
 #include <Arduino.h>
 #include <StreamDev.h>
 
-size_t Stream::sendGeneric(Print*                                                to,
-                           const ssize_t                                         len,
-                           const int                                             readUntilChar,
+size_t Stream::sendGeneric(Print* to, const ssize_t len, const int readUntilChar,
                            const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
 {
     setReport(Report::Success);
@@ -56,10 +54,14 @@ size_t Stream::sendGeneric(Print*
     return SendGenericRegular(to, len, timeoutMs);
 }
 
-size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int readUntilChar, const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
+size_t
+Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int readUntilChar,
+                              const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
 {
     // "neverExpires (default, impossible)" is translated to default timeout
-    esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
+    esp8266::polledTimeout::oneShotFastMs timedOut(
+        timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() :
+                                                                           timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
     const size_t maxLen  = std::max((ssize_t)0, len);
     size_t       written = 0;
@@ -143,13 +145,17 @@ size_t Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int rea
     return written;
 }
 
-size_t Stream::SendGenericRegularUntil(Print* to, const ssize_t len, const int readUntilChar, const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
+size_t
+Stream::SendGenericRegularUntil(Print* to, const ssize_t len, const int readUntilChar,
+                                const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
 {
     // regular Stream API
     // no other choice than reading byte by byte
 
     // "neverExpires (default, impossible)" is translated to default timeout
-    esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
+    esp8266::polledTimeout::oneShotFastMs timedOut(
+        timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() :
+                                                                           timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
     const size_t maxLen  = std::max((ssize_t)0, len);
     size_t       written = 0;
@@ -219,13 +225,16 @@ size_t Stream::SendGenericRegularUntil(Print* to, const ssize_t len, const int r
     return written;
 }
 
-size_t Stream::SendGenericRegular(Print* to, const ssize_t len, const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
+size_t Stream::SendGenericRegular(Print* to, const ssize_t len,
+                                  const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
 {
     // regular Stream API
     // use an intermediary buffer
 
     // "neverExpires (default, impossible)" is translated to default timeout
-    esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() : timeoutMs);
+    esp8266::polledTimeout::oneShotFastMs timedOut(
+        timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout() :
+                                                                           timeoutMs);
     // len==-1 => maxLen=0 <=> until starvation
     const size_t maxLen  = std::max((ssize_t)0, len);
     size_t       written = 0;
diff --git a/cores/esp8266/StreamString.h b/cores/esp8266/StreamString.h
index b1665135f9..8a68a70a56 100644
--- a/cores/esp8266/StreamString.h
+++ b/cores/esp8266/StreamString.h
@@ -35,25 +35,13 @@
 class S2Stream: public Stream
 {
 public:
-    S2Stream(String& string, int peekPointer = -1) :
-        string(&string), peekPointer(peekPointer)
-    {
-    }
+    S2Stream(String& string, int peekPointer = -1) : string(&string), peekPointer(peekPointer) { }
 
-    S2Stream(String* string, int peekPointer = -1) :
-        string(string), peekPointer(peekPointer)
-    {
-    }
+    S2Stream(String* string, int peekPointer = -1) : string(string), peekPointer(peekPointer) { }
 
-    virtual int available() override
-    {
-        return string->length();
-    }
+    virtual int available() override { return string->length(); }
 
-    virtual int availableForWrite() override
-    {
-        return std::numeric_limits<int16_t>::max();
-    }
+    virtual int availableForWrite() override { return std::numeric_limits<int16_t>::max(); }
 
     virtual int read() override
     {
@@ -77,10 +65,7 @@ class S2Stream: public Stream
         return -1;
     }
 
-    virtual size_t write(uint8_t data) override
-    {
-        return string->concat((char)data);
-    }
+    virtual size_t write(uint8_t data) override { return string->concat((char)data); }
 
     virtual int read(uint8_t* buffer, size_t len) override
     {
@@ -132,22 +117,13 @@ class S2Stream: public Stream
         // nothing to do
     }
 
-    virtual bool inputCanTimeout() override
-    {
-        return false;
-    }
+    virtual bool inputCanTimeout() override { return false; }
 
-    virtual bool outputCanTimeout() override
-    {
-        return false;
-    }
+    virtual bool outputCanTimeout() override { return false; }
 
     //// Stream's peekBufferAPI
 
-    virtual bool hasPeekBufferAPI() const override
-    {
-        return true;
-    }
+    virtual bool hasPeekBufferAPI() const override { return true; }
 
     virtual size_t peekAvailable()
     {
@@ -192,18 +168,12 @@ class S2Stream: public Stream
 
     // calling setConsume() will consume bytes as the stream is read
     // (enabled by default)
-    void setConsume()
-    {
-        peekPointer = -1;
-    }
+    void setConsume() { peekPointer = -1; }
 
     // Reading this stream will mark the string as read without consuming
     // (not enabled by default)
     // Calling resetPointer() resets the read state and allows rereading.
-    void resetPointer(int pointer = 0)
-    {
-        peekPointer = pointer;
-    }
+    void resetPointer(int pointer = 0) { peekPointer = pointer; }
 
 protected:
     String* string;
@@ -224,38 +194,38 @@ class StreamString: public String, public S2Stream
     }
 
 public:
-    StreamString(StreamString&& bro) :
-        String(bro), S2Stream(this) { }
-    StreamString(const StreamString& bro) :
-        String(bro), S2Stream(this) { }
+    StreamString(StreamString&& bro) : String(bro), S2Stream(this) { }
+    StreamString(const StreamString& bro) : String(bro), S2Stream(this) { }
 
     // duplicate String constructors and operator=:
 
-    StreamString(const char* text = nullptr) :
-        String(text), S2Stream(this) { }
-    StreamString(const String& string) :
-        String(string), S2Stream(this) { }
-    StreamString(const __FlashStringHelper* str) :
-        String(str), S2Stream(this) { }
-    StreamString(String&& string) :
-        String(string), S2Stream(this) { }
-
-    explicit StreamString(char c) :
-        String(c), S2Stream(this) { }
+    StreamString(const char* text = nullptr) : String(text), S2Stream(this) { }
+    StreamString(const String& string) : String(string), S2Stream(this) { }
+    StreamString(const __FlashStringHelper* str) : String(str), S2Stream(this) { }
+    StreamString(String&& string) : String(string), S2Stream(this) { }
+
+    explicit StreamString(char c) : String(c), S2Stream(this) { }
     explicit StreamString(unsigned char c, unsigned char base = 10) :
-        String(c, base), S2Stream(this) { }
-    explicit StreamString(int i, unsigned char base = 10) :
-        String(i, base), S2Stream(this) { }
-    explicit StreamString(unsigned int i, unsigned char base = 10) :
-        String(i, base), S2Stream(this) { }
-    explicit StreamString(long l, unsigned char base = 10) :
-        String(l, base), S2Stream(this) { }
+        String(c, base), S2Stream(this)
+    {
+    }
+    explicit StreamString(int i, unsigned char base = 10) : String(i, base), S2Stream(this) { }
+    explicit StreamString(unsigned int i, unsigned char base = 10) : String(i, base), S2Stream(this)
+    {
+    }
+    explicit StreamString(long l, unsigned char base = 10) : String(l, base), S2Stream(this) { }
     explicit StreamString(unsigned long l, unsigned char base = 10) :
-        String(l, base), S2Stream(this) { }
+        String(l, base), S2Stream(this)
+    {
+    }
     explicit StreamString(float f, unsigned char decimalPlaces = 2) :
-        String(f, decimalPlaces), S2Stream(this) { }
+        String(f, decimalPlaces), S2Stream(this)
+    {
+    }
     explicit StreamString(double d, unsigned char decimalPlaces = 2) :
-        String(d, decimalPlaces), S2Stream(this) { }
+        String(d, decimalPlaces), S2Stream(this)
+    {
+    }
 
     StreamString& operator=(const StreamString& rhs)
     {
diff --git a/cores/esp8266/core_esp8266_si2c.cpp b/cores/esp8266/core_esp8266_si2c.cpp
index 3672f7a4e2..a6849c1aff 100644
--- a/cores/esp8266/core_esp8266_si2c.cpp
+++ b/cores/esp8266/core_esp8266_si2c.cpp
@@ -56,7 +56,8 @@ static inline __attribute__((always_inline)) bool SCL_READ(const int twi_scl)
     return (GPI & (1 << twi_scl)) != 0;
 }
 
-// Implement as a class to reduce code size by allowing access to many global variables with a single base pointer
+// Implement as a class to reduce code size by allowing access to many global variables with a
+// single base pointer
 class Twi
 {
 private:
@@ -67,32 +68,13 @@ class Twi
     unsigned char twi_addr              = 0;
     uint32_t      twi_clockStretchLimit = 0;
 
-    // These are int-wide, even though they could all fit in a byte, to reduce code size and avoid any potential
-    // issues about RmW on packed bytes.  The int-wide variations of asm instructions are smaller than the equivalent
-    // byte-wide ones, and since these emums are used everywhere, the difference adds up fast.  There is only a single
-    // instance of the class, though, so the extra 12 bytes of RAM used here saves a lot more IRAM.
-    volatile enum { TWIPM_UNKNOWN = 0,
-                    TWIPM_IDLE,
-                    TWIPM_ADDRESSED,
-                    TWIPM_WAIT } twip_mode
-        = TWIPM_IDLE;
-    volatile enum { TWIP_UNKNOWN = 0,
-                    TWIP_IDLE,
-                    TWIP_START,
-                    TWIP_SEND_ACK,
-                    TWIP_WAIT_ACK,
-                    TWIP_WAIT_STOP,
-                    TWIP_SLA_W,
-                    TWIP_SLA_R,
-                    TWIP_REP_START,
-                    TWIP_READ,
-                    TWIP_STOP,
-                    TWIP_REC_ACK,
-                    TWIP_READ_ACK,
-                    TWIP_RWAIT_ACK,
-                    TWIP_WRITE,
-                    TWIP_BUS_ERR } twip_state
-        = TWIP_IDLE;
+    // These are int-wide, even though they could all fit in a byte, to reduce code size and avoid
+    // any potential issues about RmW on packed bytes.  The int-wide variations of asm instructions
+    // are smaller than the equivalent byte-wide ones, and since these emums are used everywhere,
+    // the difference adds up fast.  There is only a single instance of the class, though, so the
+    // extra 12 bytes of RAM used here saves a lot more IRAM.
+    volatile enum { TWIPM_UNKNOWN = 0, TWIPM_IDLE, TWIPM_ADDRESSED, TWIPM_WAIT} twip_mode = TWIPM_IDLE;
+    volatile enum { TWIP_UNKNOWN = 0, TWIP_IDLE, TWIP_START, TWIP_SEND_ACK, TWIP_WAIT_ACK, TWIP_WAIT_STOP, TWIP_SLA_W, TWIP_SLA_R, TWIP_REP_START, TWIP_READ, TWIP_STOP, TWIP_REC_ACK, TWIP_READ_ACK, TWIP_RWAIT_ACK, TWIP_WRITE, TWIP_BUS_ERR } twip_state = TWIP_IDLE;
     volatile int twip_status = TW_NO_INFO;
     volatile int bitCount    = 0;
 
@@ -101,13 +83,8 @@ class Twi
     volatile int     twi_ack_rec    = 0;
     volatile int     twi_timeout_ms = 10;
 
-    volatile enum { TWI_READY = 0,
-                    TWI_MRX,
-                    TWI_MTX,
-                    TWI_SRX,
-                    TWI_STX } twi_state
-        = TWI_READY;
-    volatile uint8_t twi_error = 0xFF;
+    volatile enum { TWI_READY = 0, TWI_MRX, TWI_MTX, TWI_SRX, TWI_STX } twi_state = TWI_READY;
+    volatile uint8_t twi_error                                                    = 0xFF;
 
     uint8_t      twi_txBuffer[TWI_BUFFER_LENGTH];
     volatile int twi_txBufferIndex  = 0;
@@ -158,7 +135,8 @@ class Twi
     {
         esp8266::polledTimeout::oneShotFastUs  timeout(twi_clockStretchLimit);
         esp8266::polledTimeout::periodicFastUs yieldTimeout(5000);
-        while (!timeout && !SCL_READ(twi_scl))  // outer loop is stretch duration up to stretch limit
+        while (!timeout
+               && !SCL_READ(twi_scl))  // outer loop is stretch duration up to stretch limit
         {
             if (yieldTimeout)  // inner loop yields every 5ms
             {
@@ -175,8 +153,10 @@ class Twi
     void           setClockStretchLimit(uint32_t limit);
     void           init(unsigned char sda, unsigned char scl);
     void           setAddress(uint8_t address);
-    unsigned char  writeTo(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop);
-    unsigned char  readFrom(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop);
+    unsigned char  writeTo(unsigned char address, unsigned char* buf, unsigned int len,
+                           unsigned char sendStop);
+    unsigned char  readFrom(unsigned char address, unsigned char* buf, unsigned int len,
+                            unsigned char sendStop);
     uint8_t        status();
     uint8_t        transmit(const uint8_t* data, uint8_t length);
     void           attachSlaveRxEvent(void (*function)(uint8_t*, size_t));
@@ -207,8 +187,9 @@ void Twi::setClock(unsigned int freq)
     {
         freq = 400000;
     }
-    twi_dcount = (500000000 / freq);                    // half-cycle period in ns
-    twi_dcount = (1000 * (twi_dcount - 1120)) / 62500;  // (half cycle - overhead) / busywait loop time
+    twi_dcount = (500000000 / freq);  // half-cycle period in ns
+    twi_dcount
+        = (1000 * (twi_dcount - 1120)) / 62500;  // (half cycle - overhead) / busywait loop time
 
 #else
 
@@ -216,16 +197,14 @@ void Twi::setClock(unsigned int freq)
     {
         freq = 800000;
     }
-    twi_dcount = (500000000 / freq);                   // half-cycle period in ns
-    twi_dcount = (1000 * (twi_dcount - 560)) / 31250;  // (half cycle - overhead) / busywait loop time
+    twi_dcount = (500000000 / freq);  // half-cycle period in ns
+    twi_dcount
+        = (1000 * (twi_dcount - 560)) / 31250;  // (half cycle - overhead) / busywait loop time
 
 #endif
 }
 
-void Twi::setClockStretchLimit(uint32_t limit)
-{
-    twi_clockStretchLimit = limit;
-}
+void Twi::setClockStretchLimit(uint32_t limit) { twi_clockStretchLimit = limit; }
 
 void Twi::init(unsigned char sda, unsigned char scl)
 {
@@ -264,7 +243,8 @@ void IRAM_ATTR Twi::busywait(unsigned int v)
     unsigned int i;
     for (i = 0; i < v; i++)  // loop time is 5 machine cycles: 31.25ns @ 160MHz, 62.5ns @ 80MHz
     {
-        __asm__ __volatile__("nop");  // minimum element to keep GCC from optimizing this function out.
+        __asm__ __volatile__(
+            "nop");  // minimum element to keep GCC from optimizing this function out.
     }
 }
 
@@ -280,7 +260,8 @@ bool Twi::write_start(void)
     // A high-to-low transition on the SDA line while the SCL is high defines a START condition.
     SDA_LOW(twi_sda);
     busywait(twi_dcount);
-    // An additional delay between the SCL line high-to-low transition and setting up the SDA line to prevent a STOP condition execute.
+    // An additional delay between the SCL line high-to-low transition and setting up the SDA line
+    // to prevent a STOP condition execute.
     SCL_LOW(twi_scl);
     busywait(twi_dcount);
     return true;
@@ -338,7 +319,7 @@ bool Twi::write_byte(unsigned char byte)
         write_bit(byte & 0x80);
         byte <<= 1;
     }
-    return !read_bit();  //NACK/ACK
+    return !read_bit();  // NACK/ACK
 }
 
 unsigned char Twi::read_byte(bool nack)
@@ -353,12 +334,13 @@ unsigned char Twi::read_byte(bool nack)
     return byte;
 }
 
-unsigned char Twi::writeTo(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop)
+unsigned char Twi::writeTo(unsigned char address, unsigned char* buf, unsigned int len,
+                           unsigned char sendStop)
 {
     unsigned int i;
     if (!write_start())
     {
-        return 4;  //line busy
+        return 4;  // line busy
     }
     if (!write_byte(((address << 1) | 0) & 0xFF))
     {
@@ -366,7 +348,7 @@ unsigned char Twi::writeTo(unsigned char address, unsigned char* buf, unsigned i
         {
             write_stop();
         }
-        return 2;  //received NACK on transmit of address
+        return 2;  // received NACK on transmit of address
     }
     for (i = 0; i < len; i++)
     {
@@ -376,7 +358,7 @@ unsigned char Twi::writeTo(unsigned char address, unsigned char* buf, unsigned i
             {
                 write_stop();
             }
-            return 3;  //received NACK on transmit of data
+            return 3;  // received NACK on transmit of data
         }
     }
     if (sendStop)
@@ -398,12 +380,13 @@ unsigned char Twi::writeTo(unsigned char address, unsigned char* buf, unsigned i
     return 0;
 }
 
-unsigned char Twi::readFrom(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop)
+unsigned char Twi::readFrom(unsigned char address, unsigned char* buf, unsigned int len,
+                            unsigned char sendStop)
 {
     unsigned int i;
     if (!write_start())
     {
-        return 4;  //line busy
+        return 4;  // line busy
     }
     if (!write_byte(((address << 1) | 1) & 0xFF))
     {
@@ -411,7 +394,7 @@ unsigned char Twi::readFrom(unsigned char address, unsigned char* buf, unsigned
         {
             write_stop();
         }
-        return 2;  //received NACK on transmit of address
+        return 2;  // received NACK on transmit of address
     }
     for (i = 0; i < (len - 1); i++)
     {
@@ -450,21 +433,25 @@ uint8_t Twi::status()
     WAIT_CLOCK_STRETCH();  // wait for a slow slave to finish
     if (!SCL_READ(twi_scl))
     {
-        return I2C_SCL_HELD_LOW;  // SCL held low by another device, no procedure available to recover
+        return I2C_SCL_HELD_LOW;  // SCL held low by another device, no procedure available to
+                                  // recover
     }
 
     int clockCount = 20;
-    while (!SDA_READ(twi_sda) && clockCount-- > 0)  // if SDA low, read the bits slaves have to sent to a max
+    while (!SDA_READ(twi_sda)
+           && clockCount-- > 0)  // if SDA low, read the bits slaves have to sent to a max
     {
         read_bit();
         if (!SCL_READ(twi_scl))
         {
-            return I2C_SCL_HELD_LOW_AFTER_READ;  // I2C bus error. SCL held low beyond slave clock stretch time
+            return I2C_SCL_HELD_LOW_AFTER_READ;  // I2C bus error. SCL held low beyond slave clock
+                                                 // stretch time
         }
     }
     if (!SDA_READ(twi_sda))
     {
-        return I2C_SDA_HELD_LOW;  // I2C bus error. SDA line held low by slave/another_master after n bits.
+        return I2C_SDA_HELD_LOW;  // I2C bus error. SDA line held low by slave/another_master after
+                                  // n bits.
     }
 
     return I2C_OK;
@@ -496,31 +483,26 @@ uint8_t Twi::transmit(const uint8_t* data, uint8_t length)
     return 0;
 }
 
-void Twi::attachSlaveRxEvent(void (*function)(uint8_t*, size_t))
-{
-    twi_onSlaveReceive = function;
-}
+void Twi::attachSlaveRxEvent(void (*function)(uint8_t*, size_t)) { twi_onSlaveReceive = function; }
 
-void Twi::attachSlaveTxEvent(void (*function)(void))
-{
-    twi_onSlaveTransmit = function;
-}
+void Twi::attachSlaveTxEvent(void (*function)(void)) { twi_onSlaveTransmit = function; }
 
-// DO NOT INLINE, inlining reply() in combination with compiler optimizations causes function breakup into
-// parts and the IRAM_ATTR isn't propagated correctly to all parts, which of course causes crashes.
+// DO NOT INLINE, inlining reply() in combination with compiler optimizations causes function
+// breakup into parts and the IRAM_ATTR isn't propagated correctly to all parts, which of course
+// causes crashes.
 // TODO: test with gcc 9.x and if it still fails, disable optimization with -fdisable-ipa-fnsplit
 void IRAM_ATTR Twi::reply(uint8_t ack)
 {
     // transmit master read ready signal, with or without ack
     if (ack)
     {
-        //TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT) | _BV(TWEA);
+        // TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT) | _BV(TWEA);
         SCL_HIGH(twi.twi_scl);  // _BV(TWINT)
         twi_ack = 1;            // _BV(TWEA)
     }
     else
     {
-        //TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT);
+        // TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWINT);
         SCL_HIGH(twi.twi_scl);  // _BV(TWINT)
         twi_ack = 0;            // ~_BV(TWEA)
     }
@@ -529,7 +511,7 @@ void IRAM_ATTR Twi::reply(uint8_t ack)
 void IRAM_ATTR Twi::releaseBus(void)
 {
     // release bus
-    //TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT);
+    // TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT);
     SCL_HIGH(twi.twi_scl);  // _BV(TWINT)
     twi_ack = 1;            // _BV(TWEA)
     SDA_HIGH(twi.twi_sda);
@@ -576,7 +558,7 @@ void IRAM_ATTR Twi::onTwipEvent(uint8_t status)
             twi_rxBuffer[twi_rxBufferIndex] = '\0';
         }
         // callback to user-defined callback over event task to allow for non-RAM-residing code
-        //twi_rxBufferLock = true; // This may be necessary
+        // twi_rxBufferLock = true; // This may be necessary
         ets_post(EVENTTASK_QUEUE_PRIO, TWI_SIG_RX, twi_rxBufferIndex);
 
         // since we submit rx buffer to "wire" library, we can reset it
@@ -918,7 +900,9 @@ void IRAM_ATTR Twi::onSdaChange(void)
                 ets_timer_arm_new(&twi.timer, twi.twi_timeout_ms, false, true);  // Once, ms
             }
         }
-        else IFSTATE(S2M(TWIP_START) | S2M(TWIP_REP_START) | S2M(TWIP_SEND_ACK) | S2M(TWIP_WAIT_ACK) | S2M(TWIP_SLA_R) | S2M(TWIP_REC_ACK) | S2M(TWIP_READ_ACK) | S2M(TWIP_RWAIT_ACK) | S2M(TWIP_WRITE))
+        else IFSTATE(S2M(TWIP_START) | S2M(TWIP_REP_START) | S2M(TWIP_SEND_ACK) | S2M(TWIP_WAIT_ACK)
+                     | S2M(TWIP_SLA_R) | S2M(TWIP_REC_ACK) | S2M(TWIP_READ_ACK)
+                     | S2M(TWIP_RWAIT_ACK) | S2M(TWIP_WRITE))
         {
             // START or STOP
             SDA_HIGH(twi.twi_sda);  // Should not be necessary
@@ -990,68 +974,37 @@ void IRAM_ATTR Twi::onSdaChange(void)
 // C wrappers for the object, since API is exposed only as C
 extern "C"
 {
-    void twi_init(unsigned char sda, unsigned char scl)
-    {
-        return twi.init(sda, scl);
-    }
+    void twi_init(unsigned char sda, unsigned char scl) { return twi.init(sda, scl); }
 
-    void twi_setAddress(uint8_t a)
-    {
-        return twi.setAddress(a);
-    }
+    void twi_setAddress(uint8_t a) { return twi.setAddress(a); }
 
-    void twi_setClock(unsigned int freq)
-    {
-        twi.setClock(freq);
-    }
+    void twi_setClock(unsigned int freq) { twi.setClock(freq); }
 
-    void twi_setClockStretchLimit(uint32_t limit)
-    {
-        twi.setClockStretchLimit(limit);
-    }
+    void twi_setClockStretchLimit(uint32_t limit) { twi.setClockStretchLimit(limit); }
 
-    uint8_t twi_writeTo(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop)
+    uint8_t twi_writeTo(unsigned char address, unsigned char* buf, unsigned int len,
+                        unsigned char sendStop)
     {
         return twi.writeTo(address, buf, len, sendStop);
     }
 
-    uint8_t twi_readFrom(unsigned char address, unsigned char* buf, unsigned int len, unsigned char sendStop)
+    uint8_t twi_readFrom(unsigned char address, unsigned char* buf, unsigned int len,
+                         unsigned char sendStop)
     {
         return twi.readFrom(address, buf, len, sendStop);
     }
 
-    uint8_t twi_status()
-    {
-        return twi.status();
-    }
+    uint8_t twi_status() { return twi.status(); }
 
-    uint8_t twi_transmit(const uint8_t* buf, uint8_t len)
-    {
-        return twi.transmit(buf, len);
-    }
+    uint8_t twi_transmit(const uint8_t* buf, uint8_t len) { return twi.transmit(buf, len); }
 
-    void twi_attachSlaveRxEvent(void (*cb)(uint8_t*, size_t))
-    {
-        twi.attachSlaveRxEvent(cb);
-    }
+    void twi_attachSlaveRxEvent(void (*cb)(uint8_t*, size_t)) { twi.attachSlaveRxEvent(cb); }
 
-    void twi_attachSlaveTxEvent(void (*cb)(void))
-    {
-        twi.attachSlaveTxEvent(cb);
-    }
+    void twi_attachSlaveTxEvent(void (*cb)(void)) { twi.attachSlaveTxEvent(cb); }
 
-    void twi_reply(uint8_t r)
-    {
-        twi.reply(r);
-    }
+    void twi_reply(uint8_t r) { twi.reply(r); }
 
-    void twi_releaseBus(void)
-    {
-        twi.releaseBus();
-    }
+    void twi_releaseBus(void) { twi.releaseBus(); }
 
-    void twi_enableSlaveMode(void)
-    {
-        twi.enableSlave();
-    }
+    void twi_enableSlaveMode(void) { twi.enableSlave(); }
 };
diff --git a/cores/esp8266/debug.h b/cores/esp8266/debug.h
index 025687a5af..c6ea8230ef 100644
--- a/cores/esp8266/debug.h
+++ b/cores/esp8266/debug.h
@@ -9,10 +9,10 @@
 #endif
 
 #ifndef DEBUGV
-#define DEBUGV(...) \
-    do              \
-    {               \
-        (void)0;    \
+#define DEBUGV(...)                                                                                \
+    do                                                                                             \
+    {                                                                                              \
+        (void)0;                                                                                   \
     } while (0)
 #endif
 
@@ -33,21 +33,21 @@ extern "C"
 
 #ifdef DEBUG_ESP_CORE
     extern void __iamslow(const char* what);
-#define IAMSLOW()                                  \
-    do                                             \
-    {                                              \
-        static bool once = false;                  \
-        if (!once)                                 \
-        {                                          \
-            once = true;                           \
-            __iamslow((PGM_P)FPSTR(__FUNCTION__)); \
-        }                                          \
+#define IAMSLOW()                                                                                  \
+    do                                                                                             \
+    {                                                                                              \
+        static bool once = false;                                                                  \
+        if (!once)                                                                                 \
+        {                                                                                          \
+            once = true;                                                                           \
+            __iamslow((PGM_P)FPSTR(__FUNCTION__));                                                 \
+        }                                                                                          \
     } while (0)
 #else
-#define IAMSLOW() \
-    do            \
-    {             \
-        (void)0;  \
+#define IAMSLOW()                                                                                  \
+    do                                                                                             \
+    {                                                                                              \
+        (void)0;                                                                                   \
     } while (0)
 #endif
 
@@ -55,4 +55,4 @@ extern "C"
 }
 #endif
 
-#endif  //ARD_DEBUG_H
+#endif  // ARD_DEBUG_H
diff --git a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
index e1caa3d909..4a61302392 100644
--- a/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
+++ b/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino
@@ -46,9 +46,7 @@ void setup() {
     // NOTE: if updating FS this would be the place to unmount FS using FS.end()
     Serial.println("Start updating " + type);
   });
-  ArduinoOTA.onEnd([]() {
-    Serial.println("\nEnd");
-  });
+  ArduinoOTA.onEnd([]() { Serial.println("\nEnd"); });
   ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
     Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
   });
@@ -72,6 +70,4 @@ void setup() {
   Serial.println(WiFi.localIP());
 }
 
-void loop() {
-  ArduinoOTA.handle();
-}
+void loop() { ArduinoOTA.handle(); }
diff --git a/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino b/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
index 7c01e2e7cb..9bc6f74b22 100644
--- a/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
+++ b/libraries/ArduinoOTA/examples/OTALeds/OTALeds.ino
@@ -69,6 +69,4 @@ void setup() {
   Serial.println("Ready");
 }
 
-void loop() {
-  ArduinoOTA.handle();
-}
+void loop() { ArduinoOTA.handle(); }
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
index 21abb08a4e..88bb95852c 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino
@@ -7,14 +7,20 @@
 
 /*
    This example serves a "hello world" on a WLAN and a SoftAP at the same time.
-   The SoftAP allow you to configure WLAN parameters at run time. They are not setup in the sketch but saved on EEPROM.
+   The SoftAP allow you to configure WLAN parameters at run time. They are not setup in the sketch
+   but saved on EEPROM.
 
-   Connect your computer or cell phone to wifi network ESP_ap with password 12345678. A popup may appear and it allow you to go to WLAN config. If it does not then navigate to http://192.168.4.1/wifi and config it there.
-   Then wait for the module to connect to your wifi and take note of the WLAN IP it got. Then you can disconnect from ESP_ap and return to your regular WLAN.
+   Connect your computer or cell phone to wifi network ESP_ap with password 12345678. A popup may
+   appear and it allow you to go to WLAN config. If it does not then navigate to
+   http://192.168.4.1/wifi and config it there. Then wait for the module to connect to your wifi and
+   take note of the WLAN IP it got. Then you can disconnect from ESP_ap and return to your regular
+   WLAN.
 
-   Now the ESP8266 is in your network. You can reach it through http://192.168.x.x/ (the IP you took note of) or maybe at http://esp8266.local too.
+   Now the ESP8266 is in your network. You can reach it through http://192.168.x.x/ (the IP you took
+   note of) or maybe at http://esp8266.local too.
 
-   This is a captive portal because through the softAP it will redirect any http request to http://192.168.4.1/
+   This is a captive portal because through the softAP it will redirect any http request to
+   http://192.168.4.1/
 */
 
 /* Set these to your desired softAP credentials. They are not configurable at runtime */
@@ -73,8 +79,10 @@ void setup() {
   server.on("/", handleRoot);
   server.on("/wifi", handleWifi);
   server.on("/wifisave", handleWifiSave);
-  server.on("/generate_204", handleRoot);  //Android captive portal. Maybe not needed. Might be handled by notFound handler.
-  server.on("/fwlink", handleRoot);        //Microsoft captive portal. Maybe not needed. Might be handled by notFound handler.
+  server.on("/generate_204", handleRoot);  // Android captive portal. Maybe not needed. Might be
+                                           // handled by notFound handler.
+  server.on("/fwlink", handleRoot);  // Microsoft captive portal. Maybe not needed. Might be handled
+                                     // by notFound handler.
   server.onNotFound(handleNotFound);
   server.begin();  // Web server start
   Serial.println("HTTP server started");
@@ -134,8 +142,8 @@ void loop() {
     }
   }
   // Do work:
-  //DNS
+  // DNS
   dnsServer.processNextRequest();
-  //HTTP
+  // HTTP
   server.handleClient();
 }
diff --git a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
index 5b88ae272a..8cdf427411 100644
--- a/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
+++ b/libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino
@@ -8,29 +8,29 @@ void handleRoot() {
   server.sendHeader("Expires", "-1");
 
   String Page;
-  Page += F(
-      "<!DOCTYPE html><html lang='en'><head>"
-      "<meta name='viewport' content='width=device-width'>"
-      "<title>CaptivePortal</title></head><body>"
-      "<h1>HELLO WORLD!!</h1>");
+  Page += F("<!DOCTYPE html><html lang='en'><head>"
+            "<meta name='viewport' content='width=device-width'>"
+            "<title>CaptivePortal</title></head><body>"
+            "<h1>HELLO WORLD!!</h1>");
   if (server.client().localIP() == apIP) {
     Page += String(F("<p>You are connected through the soft AP: ")) + softAP_ssid + F("</p>");
   } else {
     Page += String(F("<p>You are connected through the wifi network: ")) + ssid + F("</p>");
   }
-  Page += F(
-      "<p>You may want to <a href='/wifi'>config the wifi connection</a>.</p>"
-      "</body></html>");
+  Page += F("<p>You may want to <a href='/wifi'>config the wifi connection</a>.</p>"
+            "</body></html>");
 
   server.send(200, "text/html", Page);
 }
 
-/** Redirect to captive portal if we got a request for another domain. Return true in that case so the page handler do not try to handle the request again. */
+/** Redirect to captive portal if we got a request for another domain. Return true in that case so
+ * the page handler do not try to handle the request again. */
 boolean captivePortal() {
   if (!isIp(server.hostHeader()) && server.hostHeader() != (String(myHostname) + ".local")) {
     Serial.println("Request redirected to captive portal");
     server.sendHeader("Location", String("http://") + toStringIp(server.client().localIP()), true);
-    server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to close the socket ourselves.
+    server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have
+                                         // to close the socket ourselves.
     server.client().stop();              // Stop is needed because we sent no content length
     return true;
   }
@@ -44,51 +44,54 @@ void handleWifi() {
   server.sendHeader("Expires", "-1");
 
   String Page;
-  Page += F(
-      "<!DOCTYPE html><html lang='en'><head>"
-      "<meta name='viewport' content='width=device-width'>"
-      "<title>CaptivePortal</title></head><body>"
-      "<h1>Wifi config</h1>");
+  Page += F("<!DOCTYPE html><html lang='en'><head>"
+            "<meta name='viewport' content='width=device-width'>"
+            "<title>CaptivePortal</title></head><body>"
+            "<h1>Wifi config</h1>");
   if (server.client().localIP() == apIP) {
     Page += String(F("<p>You are connected through the soft AP: ")) + softAP_ssid + F("</p>");
   } else {
     Page += String(F("<p>You are connected through the wifi network: ")) + ssid + F("</p>");
   }
-  Page += String(F(
+  Page += String(F("\r\n<br />"
+                   "<table><tr><th align='left'>SoftAP config</th></tr>"
+                   "<tr><td>SSID "))
+          + String(softAP_ssid)
+          + F("</td></tr>"
+              "<tr><td>IP ")
+          + toStringIp(WiFi.softAPIP())
+          + F("</td></tr>"
+              "</table>"
               "\r\n<br />"
-              "<table><tr><th align='left'>SoftAP config</th></tr>"
-              "<tr><td>SSID "))
-      + String(softAP_ssid) + F("</td></tr>"
-                                "<tr><td>IP ")
-      + toStringIp(WiFi.softAPIP()) + F("</td></tr>"
-                                        "</table>"
-                                        "\r\n<br />"
-                                        "<table><tr><th align='left'>WLAN config</th></tr>"
-                                        "<tr><td>SSID ")
-      + String(ssid) + F("</td></tr>"
-                         "<tr><td>IP ")
-      + toStringIp(WiFi.localIP()) + F("</td></tr>"
-                                       "</table>"
-                                       "\r\n<br />"
-                                       "<table><tr><th align='left'>WLAN list (refresh if any missing)</th></tr>");
+              "<table><tr><th align='left'>WLAN config</th></tr>"
+              "<tr><td>SSID ")
+          + String(ssid)
+          + F("</td></tr>"
+              "<tr><td>IP ")
+          + toStringIp(WiFi.localIP())
+          + F("</td></tr>"
+              "</table>"
+              "\r\n<br />"
+              "<table><tr><th align='left'>WLAN list (refresh if any missing)</th></tr>");
   Serial.println("scan start");
   int n = WiFi.scanNetworks();
   Serial.println("scan done");
   if (n > 0) {
     for (int i = 0; i < n; i++) {
-      Page += String(F("\r\n<tr><td>SSID ")) + WiFi.SSID(i) + ((WiFi.encryptionType(i) == ENC_TYPE_NONE) ? F(" ") : F(" *")) + F(" (") + WiFi.RSSI(i) + F(")</td></tr>");
+      Page += String(F("\r\n<tr><td>SSID ")) + WiFi.SSID(i)
+              + ((WiFi.encryptionType(i) == ENC_TYPE_NONE) ? F(" ") : F(" *")) + F(" (")
+              + WiFi.RSSI(i) + F(")</td></tr>");
     }
   } else {
     Page += F("<tr><td>No WLAN found</td></tr>");
   }
-  Page += F(
-      "</table>"
-      "\r\n<br /><form method='POST' action='wifisave'><h4>Connect to network:</h4>"
-      "<input type='text' placeholder='network' name='n'/>"
-      "<br /><input type='password' placeholder='password' name='p'/>"
-      "<br /><input type='submit' value='Connect/Disconnect'/></form>"
-      "<p>You may want to <a href='/'>return to the home page</a>.</p>"
-      "</body></html>");
+  Page += F("</table>"
+            "\r\n<br /><form method='POST' action='wifisave'><h4>Connect to network:</h4>"
+            "<input type='text' placeholder='network' name='n'/>"
+            "<br /><input type='password' placeholder='password' name='p'/>"
+            "<br /><input type='submit' value='Connect/Disconnect'/></form>"
+            "<p>You may want to <a href='/'>return to the home page</a>.</p>"
+            "</body></html>");
   server.send(200, "text/html", Page);
   server.client().stop();  // Stop is needed because we sent no content length
 }
@@ -102,7 +105,8 @@ void handleWifiSave() {
   server.sendHeader("Cache-Control", "no-cache, no-store, must-revalidate");
   server.sendHeader("Pragma", "no-cache");
   server.sendHeader("Expires", "-1");
-  server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to close the socket ourselves.
+  server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to
+                                       // close the socket ourselves.
   server.client().stop();              // Stop is needed because we sent no content length
   saveCredentials();
   connect = strlen(ssid) > 0;  // Request WLAN connect with new credentials if there is a SSID
diff --git a/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino b/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino
index bb7d887c57..81377757b0 100644
--- a/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino
+++ b/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino
@@ -21,5 +21,4 @@ void setup() {
   EEPROM.end();
 }
 
-void loop() {
-}
+void loop() { }
diff --git a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
index 4a3618962d..9f5fa91887 100644
--- a/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/BasicHttpsClient/BasicHttpsClient.ino
@@ -14,7 +14,8 @@
 
 #include <WiFiClientSecureBearSSL.h>
 // Fingerprint for demo URL, expires on June 2, 2021, needs to be updated well before this date
-const uint8_t fingerprint[20] = { 0x40, 0xaf, 0x00, 0x6b, 0xec, 0x90, 0x22, 0x41, 0x8e, 0xa3, 0xad, 0xfa, 0x1a, 0xe8, 0x25, 0x41, 0x1d, 0x1a, 0x54, 0xb3 };
+const uint8_t fingerprint[20] = { 0x40, 0xaf, 0x00, 0x6b, 0xec, 0x90, 0x22, 0x41, 0x8e, 0xa3,
+                                  0xad, 0xfa, 0x1a, 0xe8, 0x25, 0x41, 0x1d, 0x1a, 0x54, 0xb3 };
 
 ESP8266WiFiMulti WiFiMulti;
 
diff --git a/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino b/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
index 8786bd09a5..5a655320d0 100644
--- a/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
+++ b/libraries/ESP8266HTTPClient/examples/DigestAuthorization/DigestAuthorization.ino
@@ -30,7 +30,8 @@ String exractParam(String& authReq, const String& param, const char delimit) {
   if (_begin == -1) {
     return "";
   }
-  return authReq.substring(_begin + param.length(), authReq.indexOf(delimit, _begin + param.length()));
+  return authReq.substring(_begin + param.length(),
+                           authReq.indexOf(delimit, _begin + param.length()));
 }
 
 String getCNonce(const int len) {
@@ -46,7 +47,8 @@ String getCNonce(const int len) {
   return s;
 }
 
-String getDigestAuth(String& authReq, const String& username, const String& password, const String& method, const String& uri, unsigned int counter) {
+String getDigestAuth(String& authReq, const String& username, const String& password,
+                     const String& method, const String& uri, unsigned int counter) {
   // extracting required parameters for RFC 2069 simpler Digest
   String realm  = exractParam(authReq, "realm=\"", '"');
   String nonce  = exractParam(authReq, "nonce=\"", '"');
@@ -72,7 +74,10 @@ String getDigestAuth(String& authReq, const String& username, const String& pass
   md5.calculate();
   String response = md5.toString();
 
-  String authorization = "Digest username=\"" + username + "\", realm=\"" + realm + "\", nonce=\"" + nonce + "\", uri=\"" + uri + "\", algorithm=\"MD5\", qop=auth, nc=" + String(nc) + ", cnonce=\"" + cNonce + "\", response=\"" + response + "\"";
+  String authorization = "Digest username=\"" + username + "\", realm=\"" + realm + "\", nonce=\""
+                         + nonce + "\", uri=\"" + uri
+                         + "\", algorithm=\"MD5\", qop=auth, nc=" + String(nc) + ", cnonce=\""
+                         + cNonce + "\", response=\"" + response + "\"";
   Serial.println(authorization);
 
   return authorization;
@@ -98,7 +103,8 @@ void setup() {
 
 void loop() {
   WiFiClient client;
-  HTTPClient http;  //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
+  HTTPClient http;  // must be declared after WiFiClient for correct destruction order, because used
+                    // by http.begin(client,...)
 
   Serial.print("[HTTP] begin...\n");
 
@@ -116,7 +122,8 @@ void loop() {
     String authReq = http.header("WWW-Authenticate");
     Serial.println(authReq);
 
-    String authorization = getDigestAuth(authReq, String(username), String(password), "GET", String(uri), 1);
+    String authorization
+        = getDigestAuth(authReq, String(username), String(password), "GET", String(uri), 1);
 
     http.end();
     http.begin(client, String(server) + String(uri));
diff --git a/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino b/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
index 04648a56eb..317ba12aff 100644
--- a/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/PostHttpClient/PostHttpClient.ino
@@ -49,7 +49,7 @@ void loop() {
 
     Serial.print("[HTTP] begin...\n");
     // configure traged server and url
-    http.begin(client, "http://" SERVER_IP "/postplain/");  //HTTP
+    http.begin(client, "http://" SERVER_IP "/postplain/");  // HTTP
     http.addHeader("Content-Type", "application/json");
 
     Serial.print("[HTTP] POST...\n");
diff --git a/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino b/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
index 2f0961f645..94f710180b 100644
--- a/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
+++ b/libraries/ESP8266HTTPClient/examples/ReuseConnectionV2/ReuseConnectionV2.ino
@@ -3,7 +3,8 @@
 
     Created on: 22.11.2015
 
-   This example reuses the http connection and also restores the connection if the connection is lost
+   This example reuses the http connection and also restores the connection if the connection is
+   lost
 */
 
 #include <ESP8266WiFi.h>
@@ -42,7 +43,7 @@ void setup() {
   http.setReuse(true);
 
   http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html");
-  //http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
+  // http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
 }
 
 int pass = 0;
@@ -65,7 +66,7 @@ void loop() {
       // Something went wrong with the connection, try to reconnect
       http.end();
       http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html");
-      //http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
+      // http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
     }
 
     if (pass == 10) {
diff --git a/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino b/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
index 397639b504..19fed7b8fe 100644
--- a/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/StreamHttpClient/StreamHttpClient.ino
@@ -36,13 +36,14 @@ void loop() {
   // wait for WiFi connection
   if ((WiFiMulti.run() == WL_CONNECTED)) {
     WiFiClient client;
-    HTTPClient http;  //must be declared after WiFiClient for correct destruction order, because used by http.begin(client,...)
+    HTTPClient http;  // must be declared after WiFiClient for correct destruction order, because
+                      // used by http.begin(client,...)
 
     Serial.print("[HTTP] begin...\n");
 
     // configure server and url
     http.begin(client, "http://jigsaw.w3.org/HTTP/connection.html");
-    //http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
+    // http.begin(client, "jigsaw.w3.org", 80, "/HTTP/connection.html");
 
     Serial.print("[HTTP] GET...\n");
     // start connection and send HTTP header
diff --git a/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino b/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
index cb280a3d27..b89d084abe 100644
--- a/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
+++ b/libraries/ESP8266HTTPClient/examples/StreamHttpsClient/StreamHttpsClient.ino
@@ -47,7 +47,8 @@ void loop() {
     Serial.print("[HTTPS] begin...\n");
 
     // configure server and url
-    const uint8_t fingerprint[20] = { 0x15, 0x77, 0xdc, 0x04, 0x7c, 0x00, 0xf8, 0x70, 0x09, 0x34, 0x24, 0xf4, 0xd3, 0xa1, 0x7a, 0x6c, 0x1e, 0xa3, 0xe0, 0x2a };
+    const uint8_t fingerprint[20] = { 0x15, 0x77, 0xdc, 0x04, 0x7c, 0x00, 0xf8, 0x70, 0x09, 0x34,
+                                      0x24, 0xf4, 0xd3, 0xa1, 0x7a, 0x6c, 0x1e, 0xa3, 0xe0, 0x2a };
 
     client->setFingerprint(fingerprint);
 
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino
index d30e8b342d..930988de06 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/SecureBearSSLUpdater/SecureBearSSLUpdater.ino
@@ -103,7 +103,8 @@ void setup() {
 
   MDNS.begin(host);
 
-  httpServer.getServer().setRSACert(new BearSSL::X509List(serverCert), new BearSSL::PrivateKey(serverKey));
+  httpServer.getServer().setRSACert(new BearSSL::X509List(serverCert),
+                                    new BearSSL::PrivateKey(serverKey));
   httpUpdater.setup(&httpServer, update_path, update_username, update_password);
   httpServer.begin();
 
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
index 0270fa9723..a718c5565d 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater/SecureWebUpdater.ino
@@ -1,5 +1,6 @@
 /*
-  To upload through terminal you can use: curl -u admin:admin -F "image=@firmware.bin" esp8266-webupdate.local/firmware
+  To upload through terminal you can use: curl -u admin:admin -F "image=@firmware.bin"
+  esp8266-webupdate.local/firmware
 */
 
 #include <ESP8266WiFi.h>
@@ -41,7 +42,9 @@ void setup(void) {
   httpServer.begin();
 
   MDNS.addService("http", "tcp", 80);
-  Serial.printf("HTTPUpdateServer ready! Open http://%s.local%s in your browser and login with username '%s' and password '%s'\n", host, update_path, update_username, update_password);
+  Serial.printf("HTTPUpdateServer ready! Open http://%s.local%s in your browser and login with "
+                "username '%s' and password '%s'\n",
+                host, update_path, update_username, update_password);
 }
 
 void loop(void) {
diff --git a/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino b/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
index f7644aa683..e3a7725793 100644
--- a/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
+++ b/libraries/ESP8266HTTPUpdateServer/examples/WebUpdater/WebUpdater.ino
@@ -1,5 +1,6 @@
 /*
-  To upload through terminal you can use: curl -F "image=@firmware.bin" esp8266-webupdate.local/update
+  To upload through terminal you can use: curl -F "image=@firmware.bin"
+  esp8266-webupdate.local/update
 */
 
 #include <ESP8266WiFi.h>
diff --git a/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino b/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
index c29a76fe98..6c01afa458 100644
--- a/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
+++ b/libraries/ESP8266LLMNR/examples/LLMNR_Web_Server/LLMNR_Web_Server.ino
@@ -70,13 +70,9 @@ const char* password = STAPSK;
 
 ESP8266WebServer web_server(80);
 
-void handle_http_not_found() {
-  web_server.send(404, "text/plain", "Not Found");
-}
+void handle_http_not_found() { web_server.send(404, "text/plain", "Not Found"); }
 
-void handle_http_root() {
-  web_server.send(200, "text/plain", "It works!");
-}
+void handle_http_root() { web_server.send(200, "text/plain", "It works!"); }
 
 void setup(void) {
   Serial.begin(115200);
@@ -107,6 +103,4 @@ void setup(void) {
   Serial.println("HTTP server started");
 }
 
-void loop(void) {
-  web_server.handleClient();
-}
+void loop(void) { web_server.handleClient(); }
diff --git a/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino b/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
index 22c8986fbf..d93adf89b6 100644
--- a/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
+++ b/libraries/ESP8266NetBIOS/examples/ESP_NBNST/ESP_NBNST.ino
@@ -46,6 +46,4 @@ void setup() {
   NBNS.begin("ESP");
 }
 
-void loop() {
-  wwwserver.handleClient();
-}
+void loop() { wwwserver.handleClient(); }
diff --git a/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino b/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
index 52dc26494a..289dfee8b6 100644
--- a/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
+++ b/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino
@@ -97,13 +97,16 @@ void drawGraph() {
   String out;
   out.reserve(2600);
   char temp[70];
-  out += "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"400\" height=\"150\">\n";
-  out += "<rect width=\"400\" height=\"150\" fill=\"rgb(250, 230, 210)\" stroke-width=\"1\" stroke=\"rgb(0, 0, 0)\" />\n";
+  out += "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"400\" "
+         "height=\"150\">\n";
+  out += "<rect width=\"400\" height=\"150\" fill=\"rgb(250, 230, 210)\" stroke-width=\"1\" "
+         "stroke=\"rgb(0, 0, 0)\" />\n";
   out += "<g stroke=\"black\">\n";
   int y = rand() % 130;
   for (int x = 10; x < 390; x += 10) {
     int y2 = rand() % 130;
-    sprintf(temp, "<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" stroke-width=\"1\" />\n", x, 140 - y, x + 10, 140 - y2);
+    sprintf(temp, "<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" stroke-width=\"1\" />\n", x,
+            140 - y, x + 10, 140 - y2);
     out += temp;
     y = y2;
   }
@@ -138,9 +141,7 @@ void setup(void) {
 
   server.on("/", handleRoot);
   server.on("/test.svg", drawGraph);
-  server.on("/inline", []() {
-    server.send(200, "text/plain", "this works as well");
-  });
+  server.on("/inline", []() { server.send(200, "text/plain", "this works as well"); });
   server.onNotFound(handleNotFound);
   server.begin();
   Serial.println("HTTP server started");
diff --git a/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino b/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
index c29c5bd162..6a4e4ffb40 100644
--- a/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
+++ b/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
@@ -92,17 +92,11 @@ static const char FILE_NOT_FOUND[] PROGMEM = "FileNotFound";
 ////////////////////////////////
 // Utils to return HTTP codes, and determine content-type
 
-void replyOK() {
-  server.send(200, FPSTR(TEXT_PLAIN), "");
-}
+void replyOK() { server.send(200, FPSTR(TEXT_PLAIN), ""); }
 
-void replyOKWithMsg(String msg) {
-  server.send(200, FPSTR(TEXT_PLAIN), msg);
-}
+void replyOKWithMsg(String msg) { server.send(200, FPSTR(TEXT_PLAIN), msg); }
 
-void replyNotFound(String msg) {
-  server.send(404, FPSTR(TEXT_PLAIN), msg);
-}
+void replyNotFound(String msg) { server.send(404, FPSTR(TEXT_PLAIN), msg); }
 
 void replyBadRequest(String msg) {
   DBG_OUTPUT_PORT.println(msg);
@@ -116,8 +110,8 @@ void replyServerError(String msg) {
 
 #ifdef USE_SPIFFS
 /*
-   Checks filename for character combinations that are not supported by FSBrowser (alhtough valid on SPIFFS).
-   Returns an empty String if supported, or detail of error(s) if unsupported
+   Checks filename for character combinations that are not supported by FSBrowser (alhtough valid on
+   SPIFFS). Returns an empty String if supported, or detail of error(s) if unsupported
 */
 String checkForUnsupportedPath(String filename) {
   String error = String();
@@ -379,9 +373,9 @@ void handleFileCreate() {
    If it's a file, delete it.
    If it's a folder, delete all nested contents first then the folder itself
 
-   IMPORTANT NOTE: using recursion is generally not recommended on embedded devices and can lead to crashes (stack overflow errors).
-   This use is just for demonstration purpose, and FSBrowser might crash in case of deeply nested filesystems.
-   Please don't do this on a production system.
+   IMPORTANT NOTE: using recursion is generally not recommended on embedded devices and can lead to
+   crashes (stack overflow errors). This use is just for demonstration purpose, and FSBrowser might
+   crash in case of deeply nested filesystems. Please don't do this on a production system.
 */
 void deleteRecursive(String path) {
   File file  = fileSystem->open(path, "r");
@@ -513,9 +507,8 @@ void handleNotFound() {
 
 /*
    This specific handler returns the index.htm (or a gzipped version) from the /edit folder.
-   If the file is not present but the flag INCLUDE_FALLBACK_INDEX_HTM has been set, falls back to the version
-   embedded in the program code.
-   Otherwise, fails with a 404 page with debug information
+   If the file is not present but the flag INCLUDE_FALLBACK_INDEX_HTM has been set, falls back to
+   the version embedded in the program code. Otherwise, fails with a 404 page with debug information
 */
 void handleGetEdit() {
   if (handleFileRead(F("/edit/index.htm"))) {
@@ -550,8 +543,9 @@ void setup(void) {
   Dir dir = fileSystem->openDir("");
   DBG_OUTPUT_PORT.println(F("List of files at root of filesystem:"));
   while (dir.next()) {
-    String error    = checkForUnsupportedPath(dir.fileName());
-    String fileInfo = dir.fileName() + (dir.isDirectory() ? " [DIR]" : String(" (") + dir.fileSize() + "b)");
+    String error = checkForUnsupportedPath(dir.fileName());
+    String fileInfo
+        = dir.fileName() + (dir.isDirectory() ? " [DIR]" : String(" (") + dir.fileSize() + "b)");
     DBG_OUTPUT_PORT.println(error + fileInfo);
     if (error.length() > 0) {
       unsupportedFiles += error + fileInfo + '\n';
diff --git a/libraries/ESP8266WebServer/examples/Graph/Graph.ino b/libraries/ESP8266WebServer/examples/Graph/Graph.ino
index 6d2bf41f1a..0b162775b1 100644
--- a/libraries/ESP8266WebServer/examples/Graph/Graph.ino
+++ b/libraries/ESP8266WebServer/examples/Graph/Graph.ino
@@ -78,17 +78,11 @@ static const char FILE_NOT_FOUND[] PROGMEM = "FileNotFound";
 ////////////////////////////////
 // Utils to return HTTP codes
 
-void replyOK() {
-  server.send(200, FPSTR(TEXT_PLAIN), "");
-}
+void replyOK() { server.send(200, FPSTR(TEXT_PLAIN), ""); }
 
-void replyOKWithMsg(String msg) {
-  server.send(200, FPSTR(TEXT_PLAIN), msg);
-}
+void replyOKWithMsg(String msg) { server.send(200, FPSTR(TEXT_PLAIN), msg); }
 
-void replyNotFound(String msg) {
-  server.send(404, FPSTR(TEXT_PLAIN), msg);
-}
+void replyNotFound(String msg) { server.send(404, FPSTR(TEXT_PLAIN), msg); }
 
 void replyBadRequest(String msg) {
   DBG_OUTPUT_PORT.println(msg);
@@ -216,7 +210,7 @@ void setup(void) {
   ////////////////////////////////
   // WEB SERVER INIT
 
-  //get heap status, analog input value and all GPIO statuses in one json call
+  // get heap status, analog input value and all GPIO statuses in one json call
   server.on("/espData", HTTP_GET, []() {
     String json;
     json.reserve(88);
diff --git a/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino b/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
index 61e79ebaf8..de0e44351e 100644
--- a/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
+++ b/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino
@@ -63,18 +63,15 @@ void setup(void) {
 
   server.on("/", handleRoot);
 
-  server.on("/inline", []() {
-    server.send(200, "text/plain", "this works as well");
-  });
+  server.on("/inline", []() { server.send(200, "text/plain", "this works as well"); });
 
   server.on("/gif", []() {
-    static const uint8_t gif[] PROGMEM = {
-      0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x10, 0x00, 0x10, 0x00, 0x80, 0x01,
-      0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00,
-      0x10, 0x00, 0x10, 0x00, 0x00, 0x02, 0x19, 0x8c, 0x8f, 0xa9, 0xcb, 0x9d,
-      0x00, 0x5f, 0x74, 0xb4, 0x56, 0xb0, 0xb0, 0xd2, 0xf2, 0x35, 0x1e, 0x4c,
-      0x0c, 0x24, 0x5a, 0xe6, 0x89, 0xa6, 0x4d, 0x01, 0x00, 0x3b
-    };
+    static const uint8_t gif[] PROGMEM
+        = { 0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x10, 0x00, 0x10, 0x00, 0x80, 0x01,
+            0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00,
+            0x10, 0x00, 0x10, 0x00, 0x00, 0x02, 0x19, 0x8c, 0x8f, 0xa9, 0xcb, 0x9d,
+            0x00, 0x5f, 0x74, 0xb4, 0x56, 0xb0, 0xb0, 0xd2, 0xf2, 0x35, 0x1e, 0x4c,
+            0x0c, 0x24, 0x5a, 0xe6, 0x89, 0xa6, 0x4d, 0x01, 0x00, 0x3b };
     char gif_colored[sizeof(gif)];
     memcpy_P(gif_colored, gif, sizeof(gif));
     // Set the background to a random set of colors
@@ -89,25 +86,29 @@ void setup(void) {
   /////////////////////////////////////////////////////////
   // Hook examples
 
-  server.addHook([](const String& method, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction contentType) {
+  server.addHook([](const String& method, const String& url, WiFiClient* client,
+                    ESP8266WebServer::ContentTypeFunction contentType) {
     (void)method;       // GET, PUT, ...
     (void)url;          // example: /root/myfile.html
     (void)client;       // the webserver tcp client connection
     (void)contentType;  // contentType(".html") => "text/html"
     Serial.printf("A useless web hook has passed\n");
-    Serial.printf("(this hook is in 0x%08x area (401x=IRAM 402x=FLASH))\n", esp_get_program_counter());
+    Serial.printf("(this hook is in 0x%08x area (401x=IRAM 402x=FLASH))\n",
+                  esp_get_program_counter());
     return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
   });
 
-  server.addHook([](const String&, const String& url, WiFiClient*, ESP8266WebServer::ContentTypeFunction) {
-    if (url.startsWith("/fail")) {
-      Serial.printf("An always failing web hook has been triggered\n");
-      return ESP8266WebServer::CLIENT_MUST_STOP;
-    }
-    return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
-  });
+  server.addHook(
+      [](const String&, const String& url, WiFiClient*, ESP8266WebServer::ContentTypeFunction) {
+        if (url.startsWith("/fail")) {
+          Serial.printf("An always failing web hook has been triggered\n");
+          return ESP8266WebServer::CLIENT_MUST_STOP;
+        }
+        return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
+      });
 
-  server.addHook([](const String&, const String& url, WiFiClient* client, ESP8266WebServer::ContentTypeFunction) {
+  server.addHook([](const String&, const String& url, WiFiClient* client,
+                    ESP8266WebServer::ContentTypeFunction) {
     if (url.startsWith("/dump")) {
       Serial.printf("The dumper web hook is on the run\n");
 
@@ -137,7 +138,8 @@ void setup(void) {
       // check the client connection: it should not immediately be closed
       // (make another '/dump' one to close the first)
       Serial.printf("\nTelling server to forget this connection\n");
-      static WiFiClient forgetme = *client;  // stop previous one if present and transfer client refcounter
+      static WiFiClient forgetme
+          = *client;  // stop previous one if present and transfer client refcounter
       return ESP8266WebServer::CLIENT_IS_GIVEN;
     }
     return ESP8266WebServer::CLIENT_REQUEST_CAN_CONTINUE;
diff --git a/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino b/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino
index 85f06bbf82..1d8d64b178 100644
--- a/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino
+++ b/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino
@@ -130,7 +130,8 @@ void setup(void) {
     Serial.println("MDNS responder started");
   }
 
-  server.getServer().setRSACert(new BearSSL::X509List(serverCert), new BearSSL::PrivateKey(serverKey));
+  server.getServer().setRSACert(new BearSSL::X509List(serverCert),
+                                new BearSSL::PrivateKey(serverKey));
 
   // Cache SSL sessions to accelerate the TLS handshake.
   server.getServer().setCache(&serverCache);
diff --git a/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino b/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
index 7b5b8cf831..0518cc6f16 100644
--- a/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpAdvancedAuth/HttpAdvancedAuth.ino
@@ -39,13 +39,13 @@ void setup() {
 
   server.on("/", []() {
     if (!server.authenticate(www_username, www_password))
-    //Basic Auth Method with Custom realm and Failure Response
-    //return server.requestAuthentication(BASIC_AUTH, www_realm, authFailResponse);
-    //Digest Auth Method with realm="Login Required" and empty Failure Response
-    //return server.requestAuthentication(DIGEST_AUTH);
-    //Digest Auth Method with Custom realm and empty Failure Response
-    //return server.requestAuthentication(DIGEST_AUTH, www_realm);
-    //Digest Auth Method with Custom realm and Failure Response
+    // Basic Auth Method with Custom realm and Failure Response
+    // return server.requestAuthentication(BASIC_AUTH, www_realm, authFailResponse);
+    // Digest Auth Method with realm="Login Required" and empty Failure Response
+    // return server.requestAuthentication(DIGEST_AUTH);
+    // Digest Auth Method with Custom realm and empty Failure Response
+    // return server.requestAuthentication(DIGEST_AUTH, www_realm);
+    // Digest Auth Method with Custom realm and Failure Response
     {
       return server.requestAuthentication(DIGEST_AUTH, www_realm, authFailResponse);
     }
diff --git a/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino b/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
index f71e4deb67..57cb0c63cc 100644
--- a/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
+++ b/libraries/ESP8266WebServer/examples/HttpHashCredAuth/HttpHashCredAuth.ino
@@ -7,7 +7,8 @@
   1. Creating a secure web server using ESP8266ESP8266WebServerSecure
   2. Use of HTTP authentication on this secure server
   3. A simple web interface to allow an authenticated user to change Credentials
-  4. Persisting those credentials through a reboot of the ESP by saving them to LittleFS without storing them as plain text
+  4. Persisting those credentials through a reboot of the ESP by saving them to LittleFS without
+  storing them as plain text
 */
 
 #include <FS.h>
@@ -15,7 +16,8 @@
 #include <ESP8266WiFi.h>
 #include <ESP8266WebServerSecure.h>
 
-//Unfortunately it is not possible to have persistent WiFi credentials stored as anything but plain text. Obfuscation would be the only feasible barrier.
+// Unfortunately it is not possible to have persistent WiFi credentials stored as anything but plain
+// text. Obfuscation would be the only feasible barrier.
 #ifndef STASSID
 #define STASSID "your-ssid"
 #define STAPSK "your-password"
@@ -24,12 +26,14 @@
 const char* ssid    = STASSID;
 const char* wifi_pw = STAPSK;
 
-const String file_credentials = R"(/credentials.txt)";  // LittleFS file name for the saved credentials
-const String change_creds     = "changecreds";          // Address for a credential change
+const String file_credentials
+    = R"(/credentials.txt)";                // LittleFS file name for the saved credentials
+const String change_creds = "changecreds";  // Address for a credential change
 
-//The ESP8266WebServerSecure requires an encryption certificate and matching key.
-//These can generated with the bash script available in the ESP8266 Arduino repository.
-//These values can be used for testing but are available publicly so should not be used in production.
+// The ESP8266WebServerSecure requires an encryption certificate and matching key.
+// These can generated with the bash script available in the ESP8266 Arduino repository.
+// These values can be used for testing but are available publicly so should not be used in
+// production.
 static const char serverCert[] PROGMEM = R"EOF(
 -----BEGIN CERTIFICATE-----
 MIIDSzCCAjMCCQD2ahcfZAwXxDANBgkqhkiG9w0BAQsFADCBiTELMAkGA1UEBhMC
@@ -84,7 +88,7 @@ gz5JWYhbD6c38khSzJb0pNXCo3EuYAVa36kDM96k1BtWuhRS10Q1VXk=
 
 ESP8266WebServerSecure server(443);
 
-//These are temporary credentials that will only be used if none are found saved in LittleFS.
+// These are temporary credentials that will only be used if none are found saved in LittleFS.
 String       login                 = "admin";
 const String realm                 = "global";
 String       H1                    = "";
@@ -93,16 +97,17 @@ String       authentication_failed = "User authentication has failed.";
 void setup() {
   Serial.begin(115200);
 
-  //Initialize LittleFS to save credentials
+  // Initialize LittleFS to save credentials
   if (!LittleFS.begin()) {
     Serial.println("LittleFS initialization error, programmer flash configured?");
     ESP.restart();
   }
 
-  //Attempt to load credentials. If the file does not yet exist, they will be set to the default values above
+  // Attempt to load credentials. If the file does not yet exist, they will be set to the default
+  // values above
   loadcredentials();
 
-  //Initialize wifi
+  // Initialize wifi
   WiFi.mode(WIFI_STA);
   WiFi.begin(ssid, wifi_pw);
   if (WiFi.waitForConnectResult() != WL_CONNECTED) {
@@ -111,9 +116,12 @@ void setup() {
     ESP.restart();
   }
 
-  server.getServer().setRSACert(new BearSSL::X509List(serverCert), new BearSSL::PrivateKey(serverKey));
-  server.on("/", showcredentialpage);                     //for this simple example, just show a simple page for changing credentials at the root
-  server.on("/" + change_creds, handlecredentialchange);  //handles submission of credentials from the client
+  server.getServer().setRSACert(new BearSSL::X509List(serverCert),
+                                new BearSSL::PrivateKey(serverKey));
+  server.on("/", showcredentialpage);  // for this simple example, just show a simple page for
+                                       // changing credentials at the root
+  server.on("/" + change_creds,
+            handlecredentialchange);  // handles submission of credentials from the client
   server.onNotFound(redirect);
   server.begin();
 
@@ -127,19 +135,21 @@ void loop() {
   server.handleClient();
 }
 
-//This function redirects home
+// This function redirects home
 void redirect() {
   String url = "https://" + WiFi.localIP().toString();
   Serial.println("Redirect called. Redirecting to " + url);
   server.sendHeader("Location", url, true);
   Serial.println("Header sent.");
-  server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to close the socket ourselves.
+  server.send(302, "text/plain", "");  // Empty content inhibits Content-length header so we have to
+                                       // close the socket ourselves.
   Serial.println("Empty page sent.");
   server.client().stop();  // Stop is needed because we sent no content length
   Serial.println("Client stopped.");
 }
 
-//This function checks whether the current session has been authenticated. If not, a request for credentials is sent.
+// This function checks whether the current session has been authenticated. If not, a request for
+// credentials is sent.
 bool session_authenticated() {
   Serial.println("Checking authentication.");
   if (server.authenticateDigest(login, H1)) {
@@ -153,7 +163,7 @@ bool session_authenticated() {
   }
 }
 
-//This function sends a simple webpage for changing login credentials to the client
+// This function sends a simple webpage for changing login credentials to the client
 void showcredentialpage() {
   Serial.println("Show credential page called.");
   if (!session_authenticated()) {
@@ -188,15 +198,15 @@ void showcredentialpage() {
   server.send(200, "text/html", page);
 }
 
-//Saves credentials to LittleFS
+// Saves credentials to LittleFS
 void savecredentials(String new_login, String new_password) {
-  //Set global variables to new values
+  // Set global variables to new values
   login = new_login;
   H1    = ESP8266WebServer::credentialHash(new_login, realm, new_password);
 
-  //Save new values to LittleFS for loading on next reboot
+  // Save new values to LittleFS for loading on next reboot
   Serial.println("Saving credentials.");
-  File f = LittleFS.open(file_credentials, "w");  //open as a brand new file, discard old contents
+  File f = LittleFS.open(file_credentials, "w");  // open as a brand new file, discard old contents
   if (f) {
     Serial.println("Modifying credentials in file system.");
     f.println(login);
@@ -208,18 +218,18 @@ void savecredentials(String new_login, String new_password) {
   Serial.println("Credentials saved.");
 }
 
-//loads credentials from LittleFS
+// loads credentials from LittleFS
 void loadcredentials() {
   Serial.println("Searching for credentials.");
   File f;
   f = LittleFS.open(file_credentials, "r");
   if (f) {
     Serial.println("Loading credentials from file system.");
-    String mod     = f.readString();                           //read the file to a String
-    int    index_1 = mod.indexOf('\n', 0);                     //locate the first line break
-    int    index_2 = mod.indexOf('\n', index_1 + 1);           //locate the second line break
-    login          = mod.substring(0, index_1 - 1);            //get the first line (excluding the line break)
-    H1             = mod.substring(index_1 + 1, index_2 - 1);  //get the second line (excluding the line break)
+    String mod     = f.readString();                  // read the file to a String
+    int    index_1 = mod.indexOf('\n', 0);            // locate the first line break
+    int    index_2 = mod.indexOf('\n', index_1 + 1);  // locate the second line break
+    login = mod.substring(0, index_1 - 1);         // get the first line (excluding the line break)
+    H1 = mod.substring(index_1 + 1, index_2 - 1);  // get the second line (excluding the line break)
     f.close();
   } else {
     String default_login    = "admin";
@@ -232,7 +242,7 @@ void loadcredentials() {
   }
 }
 
-//This function handles a credential change from a client.
+// This function handles a credential change from a client.
 void handlecredentialchange() {
   Serial.println("Handle credential change called.");
   if (!session_authenticated()) {
diff --git a/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino b/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
index 4ac9b35e52..baaee5b936 100644
--- a/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
+++ b/libraries/ESP8266WebServer/examples/PathArgServer/PathArgServer.ino
@@ -37,9 +37,7 @@ void setup(void) {
     Serial.println("MDNS responder started");
   }
 
-  server.on(F("/"), []() {
-    server.send(200, "text/plain", "hello from esp8266!");
-  });
+  server.on(F("/"), []() { server.send(200, "text/plain", "hello from esp8266!"); });
 
   server.on(UriBraces("/users/{}"), []() {
     String user = server.pathArg(0);
@@ -56,6 +54,4 @@ void setup(void) {
   Serial.println("HTTP server started");
 }
 
-void loop(void) {
-  server.handleClient();
-}
+void loop(void) { server.handleClient(); }
diff --git a/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino b/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
index d61675d23f..f9b1ad3693 100644
--- a/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
+++ b/libraries/ESP8266WebServer/examples/PostServer/PostServer.ino
@@ -121,6 +121,4 @@ void setup(void) {
   Serial.println("HTTP server started");
 }
 
-void loop(void) {
-  server.handleClient();
-}
+void loop(void) { server.handleClient(); }
diff --git a/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino b/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
index b94789ba7b..1356219b10 100644
--- a/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
+++ b/libraries/ESP8266WebServer/examples/ServerSentEvents/ServerSentEvents.ino
@@ -3,19 +3,20 @@
   1. set SSID, password and ports, compile and run program
      you should see (random) updates of sensors A and B
 
-  2. on the client(s), register it for the event bus using a REST API call: curl -sS "http://<your ESP IP>:<your port>/rest/events/subscribe"
-     on both server and client, you should now see that your client is registered
-     the server sends back the location of the event bus (channel) to the client:
-      subscription for client IP <your client's IP address>: event bus location: http://<your ESP IP>:<your port>/rest/events/<channel>
+  2. on the client(s), register it for the event bus using a REST API call: curl -sS "http://<your
+  ESP IP>:<your port>/rest/events/subscribe" on both server and client, you should now see that your
+  client is registered the server sends back the location of the event bus (channel) to the client:
+      subscription for client IP <your client's IP address>: event bus location: http://<your ESP
+  IP>:<your port>/rest/events/<channel>
 
-     you will also see that the sensors are ready to broadcast state changes, but the client is not yet listening:
-      SSEBroadcastState - client <your client IP>> registered but not listening
+     you will also see that the sensors are ready to broadcast state changes, but the client is not
+  yet listening: SSEBroadcastState - client <your client IP>> registered but not listening
 
-  3. on the client(s), start listening for events with: curl -sS "http://<your ESP IP>:<your port>/rest/events/<channel>"
-     if all is well, the following is being displayed on the ESP console
+  3. on the client(s), start listening for events with: curl -sS "http://<your ESP IP>:<your
+  port>/rest/events/<channel>" if all is well, the following is being displayed on the ESP console
       SSEHandler - registered client with IP <your client IP address> is listening...
-      broadcast status change to client IP <your client IP>> for sensor[A|B] with new state <some number>>
-     every minute you will see on the ESP: SSEKeepAlive - client is still connected
+      broadcast status change to client IP <your client IP>> for sensor[A|B] with new state <some
+  number>> every minute you will see on the ESP: SSEKeepAlive - client is still connected
 
      on the client, you should see the SSE messages coming in:
       event: event
@@ -26,9 +27,10 @@
       data: { "TYPE":"STATE", "sensorA": {"state" : 17664, "prevState": 49362} }
 
   4. on the client, stop listening by hitting control-C
-    on the ESP, after maximum one minute, the following message is displayed: SSEKeepAlive - client no longer connected, remove subscription
-    if you start listening again after the time expired, the "/rest/events" handle becomes stale and "Handle not found" is returned
-    you can also try to start listening again before the KeepAliver timer expires or simply register your client again
+    on the ESP, after maximum one minute, the following message is displayed: SSEKeepAlive - client
+  no longer connected, remove subscription if you start listening again after the time expired, the
+  "/rest/events" handle becomes stale and "Handle not found" is returned you can also try to start
+  listening again before the KeepAliver timer expires or simply register your client again
 */
 
 extern "C" {
@@ -51,7 +53,8 @@ const unsigned int port     = 80;
 
 ESP8266WebServer server(port);
 
-#define SSE_MAX_CHANNELS 8  // in this simplified example, only eight SSE clients subscription allowed
+#define SSE_MAX_CHANNELS                                                                           \
+  8  // in this simplified example, only eight SSE clients subscription allowed
 struct SSESubscription {
   IPAddress  clientIP;
   WiFiClient client;
@@ -89,9 +92,12 @@ void SSEKeepAlive() {
     }
     if (subscription[i].client.connected()) {
       Serial.printf_P(PSTR("SSEKeepAlive - client is still listening on channel %d\n"), i);
-      subscription[i].client.println(F("event: event\ndata: { \"TYPE\":\"KEEP-ALIVE\" }\n"));  // Extra newline required by SSE standard
+      subscription[i].client.println(
+          F("event: event\ndata: { \"TYPE\":\"KEEP-ALIVE\" }\n"));  // Extra newline required by SSE
+                                                                    // standard
     } else {
-      Serial.printf_P(PSTR("SSEKeepAlive - client not listening on channel %d, remove subscription\n"), i);
+      Serial.printf_P(
+          PSTR("SSEKeepAlive - client not listening on channel %d, remove subscription\n"), i);
       subscription[i].keepAliveTimer.detach();
       subscription[i].client.flush();
       subscription[i].client.stop();
@@ -107,15 +113,19 @@ void SSEHandler(uint8_t channel) {
   WiFiClient       client = server.client();
   SSESubscription& s      = subscription[channel];
   if (s.clientIP != client.remoteIP()) {  // IP addresses don't match, reject this client
-    Serial.printf_P(PSTR("SSEHandler - unregistered client with IP %s tries to listen\n"), server.client().remoteIP().toString().c_str());
+    Serial.printf_P(PSTR("SSEHandler - unregistered client with IP %s tries to listen\n"),
+                    server.client().remoteIP().toString().c_str());
     return handleNotFound();
   }
   client.setNoDelay(true);
   client.setSync(true);
-  Serial.printf_P(PSTR("SSEHandler - registered client with IP %s is listening\n"), IPAddress(s.clientIP).toString().c_str());
+  Serial.printf_P(PSTR("SSEHandler - registered client with IP %s is listening\n"),
+                  IPAddress(s.clientIP).toString().c_str());
   s.client = client;                                // capture SSE server client connection
   server.setContentLength(CONTENT_LENGTH_UNKNOWN);  // the payload can go on forever
-  server.sendContent_P(PSTR("HTTP/1.1 200 OK\nContent-Type: text/event-stream;\nConnection: keep-alive\nCache-Control: no-cache\nAccess-Control-Allow-Origin: *\n\n"));
+  server.sendContent_P(
+      PSTR("HTTP/1.1 200 OK\nContent-Type: text/event-stream;\nConnection: "
+           "keep-alive\nCache-Control: no-cache\nAccess-Control-Allow-Origin: *\n\n"));
   s.keepAliveTimer.attach_scheduled(30.0, SSEKeepAlive);  // Refresh time every 30s for demo
 }
 
@@ -133,27 +143,34 @@ void handleAll() {
   handleNotFound();
 };
 
-void SSEBroadcastState(const char* sensorName, unsigned short prevSensorValue, unsigned short sensorValue) {
+void SSEBroadcastState(const char* sensorName, unsigned short prevSensorValue,
+                       unsigned short sensorValue) {
   for (uint8_t i = 0; i < SSE_MAX_CHANNELS; i++) {
     if (!(subscription[i].clientIP)) {
       continue;
     }
     String IPaddrstr = IPAddress(subscription[i].clientIP).toString();
     if (subscription[i].client.connected()) {
-      Serial.printf_P(PSTR("broadcast status change to client IP %s on channel %d for %s with new state %d\n"),
-                      IPaddrstr.c_str(), i, sensorName, sensorValue);
-      subscription[i].client.printf_P(PSTR("event: event\ndata: {\"TYPE\":\"STATE\", \"%s\":{\"state\":%d, \"prevState\":%d}}\n\n"),
+      Serial.printf_P(
+          PSTR("broadcast status change to client IP %s on channel %d for %s with new state %d\n"),
+          IPaddrstr.c_str(), i, sensorName, sensorValue);
+      subscription[i].client.printf_P(PSTR("event: event\ndata: {\"TYPE\":\"STATE\", "
+                                           "\"%s\":{\"state\":%d, \"prevState\":%d}}\n\n"),
                                       sensorName, sensorValue, prevSensorValue);
     } else {
-      Serial.printf_P(PSTR("SSEBroadcastState - client %s registered on channel %d but not listening\n"), IPaddrstr.c_str(), i);
+      Serial.printf_P(
+          PSTR("SSEBroadcastState - client %s registered on channel %d but not listening\n"),
+          IPaddrstr.c_str(), i);
     }
   }
 }
 
 // Simulate sensors
 void updateSensor(sensorType& sensor) {
-  unsigned short newVal = (unsigned short)RANDOM_REG32;  // (not so good) random value for the sensor
-  Serial.printf_P(PSTR("update sensor %s - previous state: %d, new state: %d\n"), sensor.name, sensor.value, newVal);
+  unsigned short newVal
+      = (unsigned short)RANDOM_REG32;  // (not so good) random value for the sensor
+  Serial.printf_P(PSTR("update sensor %s - previous state: %d, new state: %d\n"), sensor.name,
+                  sensor.value, newVal);
   if (sensor.value != newVal) {
     SSEBroadcastState(sensor.name, sensor.value, newVal);  // only broadcast if state is different
   }
@@ -182,9 +199,11 @@ void handleSubscribe() {
     }
   subscription[channel] = { clientIP, server.client(), Ticker() };
   SSEurl += channel;
-  Serial.printf_P(PSTR("Allocated channel %d, on uri %s\n"), channel, SSEurl.substring(offset).c_str());
-  //server.on(SSEurl.substring(offset), std::bind(SSEHandler, &(subscription[channel])));
-  Serial.printf_P(PSTR("subscription for client IP %s: event bus location: %s\n"), clientIP.toString().c_str(), SSEurl.c_str());
+  Serial.printf_P(PSTR("Allocated channel %d, on uri %s\n"), channel,
+                  SSEurl.substring(offset).c_str());
+  // server.on(SSEurl.substring(offset), std::bind(SSEHandler, &(subscription[channel])));
+  Serial.printf_P(PSTR("subscription for client IP %s: event bus location: %s\n"),
+                  clientIP.toString().c_str(), SSEurl.c_str());
   server.send_P(200, "text/plain", SSEurl.c_str());
 }
 
@@ -204,7 +223,8 @@ void setup(void) {
     delay(500);
     Serial.print(".");
   }
-  Serial.printf_P(PSTR("\nConnected to %s with IP address: %s\n"), ssid, WiFi.localIP().toString().c_str());
+  Serial.printf_P(PSTR("\nConnected to %s with IP address: %s\n"), ssid,
+                  WiFi.localIP().toString().c_str());
   if (MDNS.begin("esp8266")) {
     Serial.println("MDNS responder started");
   }
diff --git a/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino b/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
index 731b8105ce..0a9756b2ac 100644
--- a/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
+++ b/libraries/ESP8266WebServer/examples/SimpleAuthentication/SimpleAuthentication.ino
@@ -12,7 +12,7 @@ const char* password = STAPSK;
 
 ESP8266WebServer server(80);
 
-//Check if header is present and correct
+// Check if header is present and correct
 bool is_authenticated() {
   Serial.println("Enter is_authenticated");
   if (server.hasHeader("Cookie")) {
@@ -28,7 +28,7 @@ bool is_authenticated() {
   return false;
 }
 
-//login page, also called for disconnect
+// login page, also called for disconnect
 void handleLogin() {
   String msg;
   if (server.hasHeader("Cookie")) {
@@ -56,7 +56,8 @@ void handleLogin() {
     msg = "Wrong username/password! try again.";
     Serial.println("Log in Failed");
   }
-  String content = "<html><body><form action='/login' method='POST'>To log in, please use : admin/admin<br>";
+  String content
+      = "<html><body><form action='/login' method='POST'>To log in, please use : admin/admin<br>";
   content += "User:<input type='text' name='USERNAME' placeholder='user name'><br>";
   content += "Password:<input type='password' name='PASSWORD' placeholder='password'><br>";
   content += "<input type='submit' name='SUBMIT' value='Submit'></form>" + msg + "<br>";
@@ -64,7 +65,7 @@ void handleLogin() {
   server.send(200, "text/html", content);
 }
 
-//root page can be accessed only if authentication is ok
+// root page can be accessed only if authentication is ok
 void handleRoot() {
   Serial.println("Enter handleRoot");
   String header;
@@ -78,11 +79,12 @@ void handleRoot() {
   if (server.hasHeader("User-Agent")) {
     content += "the user agent used is : " + server.header("User-Agent") + "<br><br>";
   }
-  content += "You can access this page until you <a href=\"/login?DISCONNECT=YES\">disconnect</a></body></html>";
+  content += "You can access this page until you <a "
+             "href=\"/login?DISCONNECT=YES\">disconnect</a></body></html>";
   server.send(200, "text/html", content);
 }
 
-//no need authentication
+// no need authentication
 void handleNotFound() {
   String message = "File Not Found\n\n";
   message += "URI: ";
@@ -117,17 +119,14 @@ void setup(void) {
 
   server.on("/", handleRoot);
   server.on("/login", handleLogin);
-  server.on("/inline", []() {
-    server.send(200, "text/plain", "this works without need of authentication");
-  });
+  server.on("/inline",
+            []() { server.send(200, "text/plain", "this works without need of authentication"); });
 
   server.onNotFound(handleNotFound);
-  //ask server to track these headers
+  // ask server to track these headers
   server.collectHeaders("User-Agent", "Cookie");
   server.begin();
   Serial.println("HTTP server started");
 }
 
-void loop(void) {
-  server.handleClient();
-}
+void loop(void) { server.handleClient(); }
diff --git a/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino b/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
index 889c646877..4edee4060f 100644
--- a/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
+++ b/libraries/ESP8266WebServer/examples/WebServer/WebServer.ino
@@ -35,7 +35,8 @@ ESP8266WebServer server(80);
 // ===== Simple functions used to answer simple GET requests =====
 
 // This function is called when the WebServer was requested without giving a filename.
-// This will redirect to the file index.htm when it is existing otherwise to the built-in $upload.htm page
+// This will redirect to the file index.htm when it is existing otherwise to the built-in
+// $upload.htm page
 void handleRedirect() {
   TRACE("Redirect...");
   String url = "/index.htm";
@@ -48,8 +49,8 @@ void handleRedirect() {
   server.send(302);
 }  // handleRedirect()
 
-// This function is called when the WebServer was requested to list all existing files in the filesystem.
-// a JSON array with file information is returned.
+// This function is called when the WebServer was requested to list all existing files in the
+// filesystem. a JSON array with file information is returned.
 void handleListFiles() {
   Dir    dir = LittleFS.openDir("/");
   String result;
@@ -91,16 +92,16 @@ void handleSysInfo() {
 
 // ===== Request Handler class used to answer more complex requests =====
 
-// The FileServerHandler is registered to the web server to support DELETE and UPLOAD of files into the filesystem.
+// The FileServerHandler is registered to the web server to support DELETE and UPLOAD of files into
+// the filesystem.
 class FileServerHandler: public RequestHandler {
   public:
   // @brief Construct a new File Server Handler object
   // @param fs The file system to be used.
-  // @param path Path to the root folder in the file system that is used for serving static data down and upload.
+  // @param path Path to the root folder in the file system that is used for serving static data
+  // down and upload.
   // @param cache_header Cache Header to be used in replies.
-  FileServerHandler() {
-    TRACE("FileServerHandler is registered\n");
-  }
+  FileServerHandler() { TRACE("FileServerHandler is registered\n"); }
 
   // @brief check incoming request. Can handle POST for uploads and DELETE.
   // @param requestMethod method of the http request line.
@@ -115,7 +116,8 @@ class FileServerHandler: public RequestHandler {
     return (uri == "/");
   }  // canUpload()
 
-  bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, const String& requestUri) override {
+  bool handle(ESP8266WebServer& server, HTTPMethod requestMethod,
+              const String& requestUri) override {
     // ensure that filename starts with '/'
     String fName = requestUri;
     if (!fName.startsWith("/")) {
@@ -136,7 +138,8 @@ class FileServerHandler: public RequestHandler {
   }  // handle()
 
   // uploading process
-  void upload(ESP8266WebServer UNUSED& server, const String UNUSED& _requestUri, HTTPUpload& upload) override {
+  void upload(ESP8266WebServer UNUSED& server, const String UNUSED& _requestUri,
+              HTTPUpload& upload) override {
     // ensure that filename starts with '/'
     String fName = upload.filename;
     if (!fName.startsWith("/")) {
@@ -210,9 +213,7 @@ void setup(void) {
   TRACE("Register service handlers...\n");
 
   // serve a built-in htm page
-  server.on("/$upload.htm", []() {
-    server.send(200, "text/html", FPSTR(uploadContent));
-  });
+  server.on("/$upload.htm", []() { server.send(200, "text/html", FPSTR(uploadContent)); });
 
   // register a redirect handler when only domain name is given.
   server.on("/", HTTP_GET, handleRedirect);
@@ -244,8 +245,6 @@ void setup(void) {
 }  // setup
 
 // run the server...
-void loop(void) {
-  server.handleClient();
-}  // loop()
+void loop(void) { server.handleClient(); }  // loop()
 
 // end.
diff --git a/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino b/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
index 06a40aa5d4..1210d7fed5 100644
--- a/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
+++ b/libraries/ESP8266WebServer/examples/WebUpdate/WebUpdate.ino
@@ -1,5 +1,6 @@
 /*
-  To upload through terminal you can use: curl -F "image=@firmware.bin" esp8266-webupdate.local/update
+  To upload through terminal you can use: curl -F "image=@firmware.bin"
+  esp8266-webupdate.local/update
 */
 
 #include <ESP8266WiFi.h>
@@ -17,7 +18,9 @@ const char* ssid     = STASSID;
 const char* password = STAPSK;
 
 ESP8266WebServer server(80);
-const char*      serverIndex = "<form method='POST' action='/update' enctype='multipart/form-data'><input type='file' name='update'><input type='submit' value='Update'></form>";
+const char*      serverIndex
+    = "<form method='POST' action='/update' enctype='multipart/form-data'><input type='file' "
+      "name='update'><input type='submit' value='Update'></form>";
 
 void setup(void) {
   Serial.begin(115200);
@@ -32,32 +35,36 @@ void setup(void) {
       server.send(200, "text/html", serverIndex);
     });
     server.on(
-        "/update", HTTP_POST, []() {
-      server.sendHeader("Connection", "close");
-      server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
-      ESP.restart(); }, []() {
-      HTTPUpload& upload = server.upload();
-      if (upload.status == UPLOAD_FILE_START) {
-        Serial.setDebugOutput(true);
-        WiFiUDP::stopAll();
-        Serial.printf("Update: %s\n", upload.filename.c_str());
-        uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
-        if (!Update.begin(maxSketchSpace)) { //start with max available size
-          Update.printError(Serial);
-        }
-      } else if (upload.status == UPLOAD_FILE_WRITE) {
-        if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
-          Update.printError(Serial);
-        }
-      } else if (upload.status == UPLOAD_FILE_END) {
-        if (Update.end(true)) { //true to set the size to the current progress
-          Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
-        } else {
-          Update.printError(Serial);
-        }
-        Serial.setDebugOutput(false);
-      }
-      yield(); });
+        "/update", HTTP_POST,
+        []() {
+          server.sendHeader("Connection", "close");
+          server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
+          ESP.restart();
+        },
+        []() {
+          HTTPUpload& upload = server.upload();
+          if (upload.status == UPLOAD_FILE_START) {
+            Serial.setDebugOutput(true);
+            WiFiUDP::stopAll();
+            Serial.printf("Update: %s\n", upload.filename.c_str());
+            uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
+            if (!Update.begin(maxSketchSpace)) {  // start with max available size
+              Update.printError(Serial);
+            }
+          } else if (upload.status == UPLOAD_FILE_WRITE) {
+            if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
+              Update.printError(Serial);
+            }
+          } else if (upload.status == UPLOAD_FILE_END) {
+            if (Update.end(true)) {  // true to set the size to the current progress
+              Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
+            } else {
+              Update.printError(Serial);
+            }
+            Serial.setDebugOutput(false);
+          }
+          yield();
+        });
     server.begin();
     MDNS.addService("http", "tcp", 80);
 
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
index 6d9b8b3161..bf84aabc59 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_CertStore/BearSSL_CertStore.ino
@@ -71,7 +71,8 @@ void setClock() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump URL
-void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port,
+              const char* path) {
   if (!path) {
     path = "/";
   }
@@ -141,7 +142,8 @@ void setup() {
   int numCerts = certStore.initCertStore(LittleFS, PSTR("/certs.idx"), PSTR("/certs.ar"));
   Serial.printf("Number of CA certs read: %d\n", numCerts);
   if (numCerts == 0) {
-    Serial.printf("No certs found. Did you run certs-from-mozilla.py and upload the LittleFS directory before running?\n");
+    Serial.printf("No certs found. Did you run certs-from-mozilla.py and upload the LittleFS "
+                  "directory before running?\n");
     return;  // Can't connect to anything w/o certs!
   }
 
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
index 101a598a01..546fc263a6 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino
@@ -139,10 +139,12 @@ GBEnkz4KpKv7TkHoW+j7F5EMcLcSrUIpyw==
 #endif
 
 #define CACHE_SIZE 5  // Number of sessions to cache.
+
 // Caching SSL sessions shortens the length of the SSL handshake.
 // You can see the performance improvement by looking at the
 // Network tab of the developer tools of your browser.
 #define USE_CACHE  // Enable SSL session caching.
+
 //#define DYNAMIC_CACHE // Whether to dynamically allocate the cache.
 
 #if defined(USE_CACHE) && defined(DYNAMIC_CACHE)
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino b/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
index c6005f162e..e88d3d2672 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_ServerClientCert/BearSSL_ServerClientCert.ino
@@ -30,7 +30,8 @@
      self-signed CA or any other CA you'd like)
        openssl genrsa -out server_key.pem 2048
        openssl req -out server_req.csr -key server_key.pem -new -config server.conf
-       openssl x509 -req -in server_req.csr -out server_cer.pem -sha256 -CAcreateserial -days 4000 -CA ca_cer.pem -CAkey ca_key.pem
+       openssl x509 -req -in server_req.csr -out server_cer.pem -sha256 -CAcreateserial -days 4000
+  -CA ca_cer.pem -CAkey ca_key.pem
 
      KEEP server_key.pem SECURE, IT IS YOUR SERVER'S PRIVATE KEY.
      THIS WILL BE STORED IN THE SERVER ALONE. CLIENTS DO NOT NEED IT!
@@ -42,7 +43,8 @@
      private CA above)
        openssl genrsa -out client1_key.pem 2048
        openssl req -out client1_req.csr -key client1_key.pem -new -config client.conf
-       openssl x509 -req -in client1_req.csr -out client1_cer.pem -sha256 -CAcreateserial -days 4000 -CA ca_cer.pem -CAkey ca_key.pem
+       openssl x509 -req -in client1_req.csr -out client1_cer.pem -sha256 -CAcreateserial -days 4000
+  -CA ca_cer.pem -CAkey ca_key.pem
 
      Every client should have its own unique certificate generated and
      a copy of that specific client's private key.
@@ -57,7 +59,8 @@
   If you don't specify the client cert and key on the WGET command
   line, you will not get connected.
 
-  ex: wget --quiet --O - --no-check-certificate --certificate=client1_cer.pem --private-key=client1_key.pem https://esp.ip.add.ress/
+  ex: wget --quiet --O - --no-check-certificate --certificate=client1_cer.pem
+  --private-key=client1_key.pem https://esp.ip.add.ress/
 
   This example is released into the public domain.
 */
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino b/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
index 7e64df10a2..2fc3a2b38e 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Sessions/BearSSL_Sessions.ino
@@ -52,7 +52,8 @@ void setup() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump HTTP response
-void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port,
+              const char* path) {
   if (!path) {
     path = "/";
   }
diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino b/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
index 757cedd6d8..4828d44c3f 100644
--- a/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
+++ b/libraries/ESP8266WiFi/examples/BearSSL_Validation/BearSSL_Validation.ino
@@ -39,7 +39,8 @@ void setClock() {
 }
 
 // Try and connect using a WiFiClientBearSSL to specified host:port and dump HTTP response
-void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port, const char* path) {
+void fetchURL(BearSSL::WiFiClientSecure* client, const char* host, const uint16_t port,
+              const char* path) {
   if (!path) {
     path = "/";
   }
@@ -183,14 +184,18 @@ may make sense
   client.setCiphersLessSecure();
   now = millis();
   fetchURL(&client, gitlab_host, gitlab_port, path);
-  uint32_t              delta2       = millis() - now;
-  std::vector<uint16_t> myCustomList = { BR_TLS_RSA_WITH_AES_256_CBC_SHA256, BR_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, BR_TLS_RSA_WITH_3DES_EDE_CBC_SHA };
+  uint32_t              delta2 = millis() - now;
+  std::vector<uint16_t> myCustomList
+      = { BR_TLS_RSA_WITH_AES_256_CBC_SHA256, BR_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
+          BR_TLS_RSA_WITH_3DES_EDE_CBC_SHA };
   client.setInsecure();
   client.setCiphers(myCustomList);
   now = millis();
   fetchURL(&client, gitlab_host, gitlab_port, path);
   uint32_t delta3 = millis() - now;
-  Serial.printf("Using more secure: %dms\nUsing less secure ciphers: %dms\nUsing custom cipher list: %dms\n", delta, delta2, delta3);
+  Serial.printf(
+      "Using more secure: %dms\nUsing less secure ciphers: %dms\nUsing custom cipher list: %dms\n",
+      delta, delta2, delta3);
 }
 
 void setup() {
diff --git a/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino b/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
index 9eb3c3150e..4eaf735544 100644
--- a/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
+++ b/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino
@@ -74,7 +74,8 @@ void setup() {
   Serial.print("Requesting URL: ");
   Serial.println(url);
 
-  client.print(String("GET ") + url + " HTTP/1.1\r\n" + "Host: " + github_host + "\r\n" + "User-Agent: BuildFailureDetectorESP8266\r\n" + "Connection: close\r\n\r\n");
+  client.print(String("GET ") + url + " HTTP/1.1\r\n" + "Host: " + github_host + "\r\n"
+               + "User-Agent: BuildFailureDetectorESP8266\r\n" + "Connection: close\r\n\r\n");
 
   Serial.println("Request sent");
   while (client.connected()) {
@@ -97,5 +98,4 @@ void setup() {
   Serial.println("Closing connection");
 }
 
-void loop() {
-}
+void loop() { }
diff --git a/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino b/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
index e3f15fcd82..31f5c0eeb9 100644
--- a/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
+++ b/libraries/ESP8266WiFi/examples/IPv6/IPv6.ino
@@ -8,8 +8,8 @@
   dns0=10.43.1.254
   Try me at these addresses:
   (with 'telnet <addr> or 'nc -u <addr> 23')
-  IF='st'(0) IPv6=0 local=0 hostname='ipv6test' addr= 10.43.1.244 / mask:255.255.255.0 / gw:10.43.1.254
-  IF='st'(0) IPv6=1 local=1 hostname='ipv6test' addr= fe80::1afe:34ff:fed1:cec7
+  IF='st'(0) IPv6=0 local=0 hostname='ipv6test' addr= 10.43.1.244 / mask:255.255.255.0 /
+  gw:10.43.1.254 IF='st'(0) IPv6=1 local=1 hostname='ipv6test' addr= fe80::1afe:34ff:fed1:cec7
   IF='st'(0) IPV6=1 local=0 hostname='ipv6test' addr= 2xxx:xxxx:xxxx:xxxx:1afe:34ff:fed1:cec7
   resolving www.google.com: 216.58.205.100
   resolving ipv6.google.com: 2a00:1450:4002:808::200e
@@ -79,17 +79,11 @@ void status(Print& out) {
   out.println(F("Try me at these addresses:"));
   out.println(F("(with 'telnet <addr> or 'nc -u <addr> 23')"));
   for (auto a : addrList) {
-    out.printf("IF='%s' IPv6=%d local=%d hostname='%s' addr= %s",
-               a.ifname().c_str(),
-               a.isV6(),
-               a.isLocal(),
-               a.ifhostname(),
-               a.toString().c_str());
+    out.printf("IF='%s' IPv6=%d local=%d hostname='%s' addr= %s", a.ifname().c_str(), a.isV6(),
+               a.isLocal(), a.ifhostname(), a.toString().c_str());
 
     if (a.isLegacy()) {
-      out.printf(" / mask:%s / gw:%s",
-                 a.netmask().toString().c_str(),
-                 a.gw().toString().c_str());
+      out.printf(" / mask:%s / gw:%s", a.netmask().toString().c_str(), a.gw().toString().c_str());
     }
 
     out.println();
diff --git a/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino b/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
index 24018681e6..fa20f8ca6d 100644
--- a/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
+++ b/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino
@@ -33,13 +33,13 @@ unsigned int localPort = 2390;  // local port to listen for UDP packets
 
 /* Don't hardwire the IP address or we won't get the benefits of the pool.
     Lookup the IP address for the host name instead */
-//IPAddress timeServer(129, 6, 15, 28); // time.nist.gov NTP server
+// IPAddress timeServer(129, 6, 15, 28); // time.nist.gov NTP server
 IPAddress   timeServerIP;  // time.nist.gov NTP server address
 const char* ntpServerName = "time.nist.gov";
 
 const int NTP_PACKET_SIZE = 48;  // NTP time stamp is in the first 48 bytes of the message
 
-byte packetBuffer[NTP_PACKET_SIZE];  //buffer to hold incoming and outgoing packets
+byte packetBuffer[NTP_PACKET_SIZE];  // buffer to hold incoming and outgoing packets
 
 // A UDP instance to let us send and receive packets over UDP
 WiFiUDP udp;
@@ -72,7 +72,7 @@ void setup() {
 }
 
 void loop() {
-  //get a random server from the pool
+  // get a random server from the pool
   WiFi.hostByName(ntpServerName, timeServerIP);
 
   sendNTPpacket(timeServerIP);  // send an NTP packet to a time server
@@ -88,7 +88,7 @@ void loop() {
     // We've received a packet, read the data from it
     udp.read(packetBuffer, NTP_PACKET_SIZE);  // read the packet into the buffer
 
-    //the timestamp starts at byte 40 of the received packet and is four bytes,
+    // the timestamp starts at byte 40 of the received packet and is four bytes,
     // or two words, long. First, esxtract the two words:
 
     unsigned long highWord = word(packetBuffer[40], packetBuffer[41]);
@@ -147,7 +147,7 @@ void sendNTPpacket(IPAddress& address) {
 
   // all NTP fields have been given values, now
   // you can send a packet requesting a timestamp:
-  udp.beginPacket(address, 123);  //NTP requests are to port 123
+  udp.beginPacket(address, 123);  // NTP requests are to port 123
   udp.write(packetBuffer, NTP_PACKET_SIZE);
   udp.endPacket();
 }
diff --git a/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino b/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
index d055921cdf..429eb69191 100644
--- a/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
+++ b/libraries/ESP8266WiFi/examples/PagerServer/PagerServer.ino
@@ -58,8 +58,9 @@ void setup() {
 }
 
 void loop() {
-  WiFiClient client = server.available();     // returns first client which has data to read or a 'false' client
-  if (client) {                               // client is true only if it is connected and has data to read
+  WiFiClient client
+      = server.available();  // returns first client which has data to read or a 'false' client
+  if (client) {              // client is true only if it is connected and has data to read
     String s = client.readStringUntil('\n');  // read the message incoming from one of the clients
     s.trim();                                 // trim eventual \r
     Serial.println(s);                        // print the message to Serial Monitor
diff --git a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
index bb761a026a..86c50a636a 100644
--- a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
+++ b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino
@@ -30,7 +30,7 @@ void dump(int netif_idx, const char* data, size_t len, int out, int success) {
   // optional filter example: if (netDump_is_ARP(data))
   {
     netDump(Serial, data, len);
-    //netDumpHex(Serial, data, len);
+    // netDumpHex(Serial, data, len);
   }
 }
 #endif
@@ -51,19 +51,15 @@ void setup() {
     Serial.print('.');
     delay(500);
   }
-  Serial.printf("\nSTA: %s (dns: %s / %s)\n",
-                WiFi.localIP().toString().c_str(),
-                WiFi.dnsIP(0).toString().c_str(),
-                WiFi.dnsIP(1).toString().c_str());
+  Serial.printf("\nSTA: %s (dns: %s / %s)\n", WiFi.localIP().toString().c_str(),
+                WiFi.dnsIP(0).toString().c_str(), WiFi.dnsIP(1).toString().c_str());
 
   // give DNS servers to AP side
   dhcpSoftAP.dhcps_set_dns(0, WiFi.dnsIP(0));
   dhcpSoftAP.dhcps_set_dns(1, WiFi.dnsIP(1));
 
   WiFi.softAPConfig(  // enable AP, with android-compatible google domain
-      IPAddress(172, 217, 28, 254),
-      IPAddress(172, 217, 28, 254),
-      IPAddress(255, 255, 255, 0));
+      IPAddress(172, 217, 28, 254), IPAddress(172, 217, 28, 254), IPAddress(255, 255, 255, 0));
   WiFi.softAP(STASSID "extender", STAPSK);
   Serial.printf("AP: %s\n", WiFi.softAPIP().toString().c_str());
 
@@ -74,7 +70,8 @@ void setup() {
     ret = ip_napt_enable_no(SOFTAP_IF, 1);
     Serial.printf("ip_napt_enable_no(SOFTAP_IF): ret=%d (OK=%d)\n", (int)ret, (int)ERR_OK);
     if (ret == ERR_OK) {
-      Serial.printf("WiFi Network '%s' with same password is now NATed behind '%s'\n", STASSID "extender", STASSID);
+      Serial.printf("WiFi Network '%s' with same password is now NATed behind '%s'\n",
+                    STASSID "extender", STASSID);
     }
   }
   Serial.printf("Heap after napt init: %d\n", ESP.getFreeHeap());
@@ -92,5 +89,4 @@ void setup() {
 
 #endif
 
-void loop() {
-}
+void loop() { }
diff --git a/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino b/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
index e1de8fe630..42dd215751 100644
--- a/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
+++ b/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino
@@ -57,12 +57,14 @@ void setup() {
   Serial.println();
   Serial.println("Configuring access point...");
 
-  /* Disable the WiFi persistence to avoid any re-configuration that may erase static lease when starting softAP */
+  /* Disable the WiFi persistence to avoid any re-configuration that may erase static lease when
+   * starting softAP */
   WiFi.persistent(false);
 
   WiFi.mode(WIFI_AP);
   /* Configure AP with IP = 192.168.0.1 / Gateway = 192.168.0.1 / Subnet = 255.255.255.0
-     if you specify the ESP8266's IP-address with 192.168.0.1, the function softAPConfig() sets the DHCP-range as 192.168.0.100 - 192.168.0.200
+     if you specify the ESP8266's IP-address with 192.168.0.1, the function softAPConfig() sets the
+     DHCP-range as 192.168.0.100 - 192.168.0.200
   */
   WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
   /* Setup your static leases.
@@ -73,7 +75,8 @@ void setup() {
      first call to wifi_softap_add_dhcps_lease() will setup first IP address of the range
      second call to wifi_softap_add_dhcps_lease() will setup second IP address of the range
      ...
-     any client not listed will use next IP address available from the range (here 192.168.0.102 and more)
+     any client not listed will use next IP address available from the range (here 192.168.0.102 and
+     more)
   */
   dhcpSoftAP.add_dhcps_lease(mac_CAM);  // always 192.168.0.100
   dhcpSoftAP.add_dhcps_lease(mac_PC);   // always 192.168.0.101
@@ -87,6 +90,4 @@ void setup() {
   Serial.println("HTTP server started");
 }
 
-void loop() {
-  server.handleClient();
-}
+void loop() { server.handleClient(); }
diff --git a/libraries/ESP8266WiFi/examples/Udp/Udp.ino b/libraries/ESP8266WiFi/examples/Udp/Udp.ino
index 0954603e6d..672e067c18 100644
--- a/libraries/ESP8266WiFi/examples/Udp/Udp.ino
+++ b/libraries/ESP8266WiFi/examples/Udp/Udp.ino
@@ -25,7 +25,7 @@
 unsigned int localPort = 8888;  // local port to listen on
 
 // buffers for receiving and sending data
-char packetBuffer[UDP_TX_PACKET_MAX_SIZE + 1];  //buffer to hold incoming packet,
+char packetBuffer[UDP_TX_PACKET_MAX_SIZE + 1];  // buffer to hold incoming packet,
 char ReplyBuffer[] = "acknowledged\r\n";        // a string to send back
 
 WiFiUDP Udp;
@@ -49,10 +49,8 @@ void loop() {
   int packetSize = Udp.parsePacket();
   if (packetSize) {
     Serial.printf("Received packet of size %d from %s:%d\n    (to %s:%d, free heap = %d B)\n",
-                  packetSize,
-                  Udp.remoteIP().toString().c_str(), Udp.remotePort(),
-                  Udp.destinationIP().toString().c_str(), Udp.localPort(),
-                  ESP.getFreeHeap());
+                  packetSize, Udp.remoteIP().toString().c_str(), Udp.remotePort(),
+                  Udp.destinationIP().toString().c_str(), Udp.localPort(), ESP.getFreeHeap());
 
     // read the packet into packetBufffer
     int n           = Udp.read(packetBuffer, UDP_TX_PACKET_MAX_SIZE);
@@ -70,5 +68,5 @@ void loop() {
 /*
   test (shell/netcat):
   --------------------
-	  nc -u 192.168.esp.address 8888
+          nc -u 192.168.esp.address 8888
 */
diff --git a/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino b/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
index 11d79620e5..f31830af11 100644
--- a/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino
@@ -48,9 +48,7 @@ ESP8266WebServer server(80);
 /* Just a little test message.  Go to http://192.168.4.1 in a web browser
    connected to this access point to see it.
 */
-void handleRoot() {
-  server.send(200, "text/html", "<h1>You are connected</h1>");
-}
+void handleRoot() { server.send(200, "text/html", "<h1>You are connected</h1>"); }
 
 void setup() {
   delay(1000);
@@ -68,6 +66,4 @@ void setup() {
   Serial.println("HTTP server started");
 }
 
-void loop() {
-  server.handleClient();
-}
+void loop() { server.handleClient(); }
diff --git a/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino b/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
index 515f770cca..7ffdb3d033 100644
--- a/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino
@@ -63,7 +63,7 @@ void loop() {
   // This will send the request to the server
   client.println("hello from ESP8266");
 
-  //read back one line from server
+  // read back one line from server
   Serial.println("receiving from remote server");
   String line = client.readStringUntil('\r');
   Serial.println(line);
diff --git a/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino b/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
index 2b5ad66bc8..2206e04362 100644
--- a/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiEcho/WiFiEcho.ino
@@ -72,7 +72,7 @@ void loop() {
     Serial.printf("\n");
   }
 
-  //check if there are any new clients
+  // check if there are any new clients
   if (server.hasClient()) {
     client = server.accept();
     Serial.println("New client");
@@ -101,7 +101,8 @@ void loop() {
         break;
       case '4':
         t = 4;
-        Serial.printf("direct access (sendAll - close peer to stop, then press 1, 2 or 3 before restarting peer)\n");
+        Serial.printf("direct access (sendAll - close peer to stop, then press 1, 2 or 3 before "
+                      "restarting peer)\n");
         break;
     }
     tot = cnt = 0;
@@ -129,7 +130,8 @@ void loop() {
       size_t  tcp_got  = client.read(buf, maxTo);
       size_t  tcp_sent = client.write(buf, tcp_got);
       if (tcp_sent != maxTo) {
-        Serial.printf("len mismatch: available:%zd tcp-read:%zd serial-write:%zd\n", maxTo, tcp_got, tcp_sent);
+        Serial.printf("len mismatch: available:%zd tcp-read:%zd serial-write:%zd\n", maxTo, tcp_got,
+                      tcp_sent);
       }
       tot += tcp_sent;
       cnt++;
diff --git a/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino b/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
index 9c094c1013..161bd01d8f 100644
--- a/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiEvents/WiFiEvents.ino
@@ -98,7 +98,7 @@ void loop() {
 
 String macToString(const unsigned char* mac) {
   char buf[20];
-  snprintf(buf, sizeof(buf), "%02x:%02x:%02x:%02x:%02x:%02x",
-           mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+  snprintf(buf, sizeof(buf), "%02x:%02x:%02x:%02x:%02x:%02x", mac[0], mac[1], mac[2], mac[3],
+           mac[4], mac[5]);
   return String(buf);
 }
diff --git a/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino b/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
index a585092bdd..cf826046a1 100644
--- a/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino
@@ -91,7 +91,8 @@ void loop() {
   // Send the response to the client
   // it is OK for multiple small client.print/write,
   // because nagle algorithm will group them into one single packet
-  client.print(F("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>\r\nGPIO is now "));
+  client.print(F("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE "
+                 "HTML>\r\n<html>\r\nGPIO is now "));
   client.print((val) ? F("high") : F("low"));
   client.print(F("<br><br>Click <a href='http://"));
   client.print(WiFi.localIP());
diff --git a/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino b/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
index 30542af4e0..344c02f696 100644
--- a/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino
@@ -40,14 +40,9 @@ void loop() {
     for (int8_t i = 0; i < scanResult; i++) {
       WiFi.getNetworkInfo(i, ssid, encryptionType, rssi, bssid, channel, hidden);
 
-      Serial.printf(PSTR("  %02d: [CH %02d] [%02X:%02X:%02X:%02X:%02X:%02X] %ddBm %c %c %s\n"),
-                    i,
-                    channel,
-                    bssid[0], bssid[1], bssid[2],
-                    bssid[3], bssid[4], bssid[5],
-                    rssi,
-                    (encryptionType == ENC_TYPE_NONE) ? ' ' : '*',
-                    hidden ? 'H' : 'V',
+      Serial.printf(PSTR("  %02d: [CH %02d] [%02X:%02X:%02X:%02X:%02X:%02X] %ddBm %c %c %s\n"), i,
+                    channel, bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5], rssi,
+                    (encryptionType == ENC_TYPE_NONE) ? ' ' : '*', hidden ? 'H' : 'V',
                     ssid.c_str());
       yield();
     }
diff --git a/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino b/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
index f246f98d68..c48e360f92 100644
--- a/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiShutdown/WiFiShutdown.ino
@@ -26,26 +26,26 @@ const char* password = STAPSK;
 
 void setup() {
   Serial.begin(74880);
-  //Serial.setDebugOutput(true);  // If you need debug output
+  // Serial.setDebugOutput(true);  // If you need debug output
   Serial.println("Trying to resume WiFi connection...");
 
-  // May be necessary after deepSleep. Otherwise you may get "error: pll_cal exceeds 2ms!!!" when trying to connect
+  // May be necessary after deepSleep. Otherwise you may get "error: pll_cal exceeds 2ms!!!" when
+  // trying to connect
   delay(1);
 
   // ---
   // Here you can do whatever you need to do that doesn't need a WiFi connection.
   // ---
 
-  ESP.rtcUserMemoryRead(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t*>(&state), sizeof(state));
+  ESP.rtcUserMemoryRead(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t*>(&state),
+                        sizeof(state));
   unsigned long start = millis();
 
-  if (!WiFi.resumeFromShutdown(state)
-      || (WiFi.waitForConnectResult(10000) != WL_CONNECTED)) {
+  if (!WiFi.resumeFromShutdown(state) || (WiFi.waitForConnectResult(10000) != WL_CONNECTED)) {
     Serial.println("Cannot resume WiFi connection, connecting via begin...");
     WiFi.persistent(false);
 
-    if (!WiFi.mode(WIFI_STA)
-        || !WiFi.begin(ssid, password)
+    if (!WiFi.mode(WIFI_STA) || !WiFi.begin(ssid, password)
         || (WiFi.waitForConnectResult(10000) != WL_CONNECTED)) {
       WiFi.mode(WIFI_OFF);
       Serial.println("Cannot connect!");
@@ -64,7 +64,8 @@ void setup() {
   // ---
 
   WiFi.shutdown(state);
-  ESP.rtcUserMemoryWrite(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t*>(&state), sizeof(state));
+  ESP.rtcUserMemoryWrite(RTC_USER_DATA_SLOT_WIFI_STATE, reinterpret_cast<uint32_t*>(&state),
+                         sizeof(state));
 
   // ---
   // Here you can do whatever you need to do that doesn't need a WiFi connection anymore.
diff --git a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
index 9dafae4cf4..97d160e309 100644
--- a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
+++ b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino
@@ -66,7 +66,7 @@ SoftwareSerial* logger = nullptr;
 
 #define STACK_PROTECTOR 512  // bytes
 
-//how many clients should be able to telnet to this ESP8266
+// how many clients should be able to telnet to this ESP8266
 #define MAX_SRV_CLIENTS 2
 const char* ssid     = STASSID;
 const char* password = STAPSK;
@@ -113,7 +113,7 @@ void setup() {
   logger->print("connected, address=");
   logger->println(WiFi.localIP());
 
-  //start server
+  // start server
   server.begin();
   server.setNoDelay(true);
 
@@ -123,9 +123,9 @@ void setup() {
 }
 
 void loop() {
-  //check if there are any new clients
+  // check if there are any new clients
   if (server.hasClient()) {
-    //find free/disconnected spot
+    // find free/disconnected spot
     int i;
     for (i = 0; i < MAX_SRV_CLIENTS; i++)
       if (!serverClients[i]) {  // equivalent to !serverClients[i].connected()
@@ -135,7 +135,7 @@ void loop() {
         break;
       }
 
-    //no free/disconnected spot so reject
+    // no free/disconnected spot so reject
     if (i == MAX_SRV_CLIENTS) {
       server.accept().println("busy");
       // hints: server.accept() is a WiFiClient with short-term scope
@@ -146,7 +146,7 @@ void loop() {
     }
   }
 
-  //check TCP clients for data
+  // check TCP clients for data
 #if 1
   // Incredibly, this code is faster than the buffered one below - #4620 is needed
   // loopback/3000000baud average 348KB/s
@@ -165,7 +165,8 @@ void loop() {
       size_t  tcp_got     = serverClients[i].read(buf, maxToSerial);
       size_t  serial_sent = Serial.write(buf, tcp_got);
       if (serial_sent != maxToSerial) {
-        logger->printf("len mismatch: available:%zd tcp-read:%zd serial-write:%zd\n", maxToSerial, tcp_got, serial_sent);
+        logger->printf("len mismatch: available:%zd tcp-read:%zd serial-write:%zd\n", maxToSerial,
+                       tcp_got, serial_sent);
       }
     }
 #endif
@@ -188,7 +189,7 @@ void loop() {
       }
     }
 
-  //check UART for data
+  // check UART for data
   size_t len = std::min(Serial.available(), maxToTcp);
   len        = std::min(len, (size_t)STACK_PROTECTOR);
   if (len) {
@@ -202,7 +203,8 @@ void loop() {
       if (serverClients[i].availableForWrite() >= serial_got) {
         size_t tcp_sent = serverClients[i].write(sbuf, serial_got);
         if (tcp_sent != len) {
-          logger->printf("len mismatch: available:%zd serial-read:%zd tcp-write:%zd\n", len, serial_got, tcp_sent);
+          logger->printf("len mismatch: available:%zd serial-read:%zd tcp-write:%zd\n", len,
+                         serial_got, tcp_sent);
         }
       }
   }
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino b/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
index 34f21be030..80ae6ad429 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloEspnow/HelloEspnow.ino
@@ -1,4 +1,7 @@
-#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
+#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO:
+                                               // Should be used for new code until the
+                                               // compatibility code is removed with release 3.0.0
+                                               // of the Arduino core.
 
 #include <ESP8266WiFi.h>
 #include <EspnowMeshBackend.h>
@@ -10,32 +13,50 @@ namespace TypeCast = MeshTypeConversionFunctions;
 
 /**
    NOTE: Although we could define the strings below as normal String variables,
-   here we are using PROGMEM combined with the FPSTR() macro (and also just the F() macro further down in the file).
-   The reason is that this approach will place the strings in flash memory which will help save RAM during program execution.
-   Reading strings from flash will be slower than reading them from RAM,
-   but this will be a negligible difference when printing them to Serial.
+   here we are using PROGMEM combined with the FPSTR() macro (and also just the F() macro further
+   down in the file). The reason is that this approach will place the strings in flash memory which
+   will help save RAM during program execution. Reading strings from flash will be slower than
+   reading them from RAM, but this will be a negligible difference when printing them to Serial.
 
    More on F(), FPSTR() and PROGMEM:
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char exampleMeshName[] PROGMEM     = "MeshNode_";                    // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
-constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
-
-// A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a default Kok set, but it can be replaced if desired.
-// All ESP-NOW keys below must match in an encrypted connection pair for encrypted communication to be possible.
-// Note that it is also possible to use Strings as key seeds instead of arrays.
-uint8_t espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting transmissions of encrypted connections.
-                                             0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11 };
-uint8_t espnowEncryptionKok[16]          = { 0x22, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting the encrypted connection key.
-                                    0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x33 };
-uint8_t espnowHashKey[16]                = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44,  // This is the secret key used for HMAC during encrypted connection requests.
-                              0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD };
+constexpr char exampleMeshName[] PROGMEM
+    = "MeshNode_";  // The name of the mesh network. Used as prefix for the node SSID and to find
+                    // other network nodes in the example networkFilter and broadcastFilter
+                    // functions below.
+constexpr char exampleWiFiPassword[] PROGMEM
+    = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min
+                                      // 8 and max 64 characters long, otherwise an AP which uses it
+                                      // will not be found during scans.
+
+// A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a
+// default Kok set, but it can be replaced if desired. All ESP-NOW keys below must match in an
+// encrypted connection pair for encrypted communication to be possible. Note that it is also
+// possible to use Strings as key seeds instead of arrays.
+uint8_t espnowEncryptedConnectionKey[16]
+    = { 0x33, 0x44, 0x33, 0x44, 0x33,
+        0x44, 0x33, 0x44,  // This is the key for encrypting transmissions of encrypted connections.
+        0x33, 0x44, 0x33, 0x44, 0x33,
+        0x44, 0x32, 0x11 };
+uint8_t espnowEncryptionKok[16]
+    = { 0x22, 0x44, 0x33, 0x44,
+        0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting the encrypted connection key.
+        0x33, 0x44, 0x33, 0x44,
+        0x33, 0x44, 0x32, 0x33 };
+uint8_t espnowHashKey[16] = {
+  0xEF, 0x44, 0x33, 0x0C, 0x33,
+  0x44, 0xFE, 0x44,  // This is the secret key used for HMAC during encrypted connection requests.
+  0x33, 0x44, 0x33, 0xB0, 0x33,
+  0x44, 0x32, 0xAD
+};
 
 unsigned int requestNumber  = 0;
 unsigned int responseNumber = 0;
 
-const char broadcastMetadataDelimiter = 23;  // 23 = End-of-Transmission-Block (ETB) control character in ASCII
+const char broadcastMetadataDelimiter
+    = 23;  // 23 = End-of-Transmission-Block (ETB) control character in ASCII
 
 String                 manageRequest(const String& request, MeshBackendBase& meshInstance);
 TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance);
@@ -43,31 +64,43 @@ void                   networkFilter(int numberOfNetworks, MeshBackendBase& mesh
 bool                   broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance);
 
 /* Create the mesh node object */
-EspnowMeshBackend espnowNode = EspnowMeshBackend(manageRequest, manageResponse, networkFilter, broadcastFilter, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
+EspnowMeshBackend espnowNode
+    = EspnowMeshBackend(manageRequest, manageResponse, networkFilter, broadcastFilter,
+                        FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey,
+                        FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
 
 /**
    Callback for when other nodes send you a request
 
    @param request The request string received from another node in the mesh
    @param meshInstance The MeshBackendBase instance that called the function.
-   @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
+   @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no
+   response should be sent.
 */
 String manageRequest(const String& request, MeshBackendBase& meshInstance) {
-  // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
-    String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
-    Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
-    (void)tcpIpInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast
+  // replaces dynamic_cast since RTTI is disabled)
+  if (EspnowMeshBackend* espnowInstance
+      = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+    String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ?
+                                       F(", Encrypted transmission") :
+                                       F(", Unencrypted transmission");
+    Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted
+                 + F("): "));
+  } else if (TcpIpMeshBackend* tcpIpInstance
+             = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+    (void)tcpIpInstance;  // This is useful to remove a "unused parameter" compiler warning. Does
+                          // nothing else.
     Serial.print(F("TCP/IP: "));
   } else {
     Serial.print(F("UNKNOWN!: "));
   }
 
   /* Print out received message */
-  // Only show first 100 characters because printing a large String takes a lot of time, which is a bad thing for a callback function.
-  // If you need to print the whole String it is better to store it and print it in the loop() later.
-  // Note that request.substring will not work as expected if the String contains null values as data.
+  // Only show first 100 characters because printing a large String takes a lot of time, which is a
+  // bad thing for a callback function. If you need to print the whole String it is better to store
+  // it and print it in the loop() later. Note that request.substring will not work as expected if
+  // the String contains null values as data.
   Serial.print(F("Request received: "));
 
   if (request.charAt(0) == 0) {
@@ -77,7 +110,9 @@ String manageRequest(const String& request, MeshBackendBase& meshInstance) {
   }
 
   /* return a string to send back */
-  return (String(F("Hello world response #")) + String(responseNumber++) + F(" from ") + meshInstance.getMeshName() + meshInstance.getNodeID() + F(" with AP MAC ") + WiFi.softAPmacAddress() + String('.'));
+  return (String(F("Hello world response #")) + String(responseNumber++) + F(" from ")
+          + meshInstance.getMeshName() + meshInstance.getNodeID() + F(" with AP MAC ")
+          + WiFi.softAPmacAddress() + String('.'));
 }
 
 /**
@@ -90,17 +125,24 @@ String manageRequest(const String& request, MeshBackendBase& meshInstance) {
 TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance) {
   TransmissionStatusType statusCode = TransmissionStatusType::TRANSMISSION_COMPLETE;
 
-  // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
-    String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
-    Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+  // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast
+  // replaces dynamic_cast since RTTI is disabled)
+  if (EspnowMeshBackend* espnowInstance
+      = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+    String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ?
+                                       F(", Encrypted transmission") :
+                                       F(", Unencrypted transmission");
+    Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted
+                 + F("): "));
+  } else if (TcpIpMeshBackend* tcpIpInstance
+             = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
     Serial.print(F("TCP/IP: "));
 
     // Getting the sent message like this will work as long as ONLY(!) TCP/IP is used.
-    // With TCP/IP the response will follow immediately after the request, so the stored message will not have changed.
-    // With ESP-NOW there is no guarantee when or if a response will show up, it can happen before or after the stored message is changed.
-    // So for ESP-NOW, adding unique identifiers in the response and request is required to associate a response with a request.
+    // With TCP/IP the response will follow immediately after the request, so the stored message
+    // will not have changed. With ESP-NOW there is no guarantee when or if a response will show up,
+    // it can happen before or after the stored message is changed. So for ESP-NOW, adding unique
+    // identifiers in the response and request is required to associate a response with a request.
     Serial.print(F("Request sent: "));
     Serial.println(tcpIpInstance->getCurrentMessage().substring(0, 100));
   } else {
@@ -108,9 +150,10 @@ TransmissionStatusType manageResponse(const String& response, MeshBackendBase& m
   }
 
   /* Print out received message */
-  // Only show first 100 characters because printing a large String takes a lot of time, which is a bad thing for a callback function.
-  // If you need to print the whole String it is better to store it and print it in the loop() later.
-  // Note that response.substring will not work as expected if the String contains null values as data.
+  // Only show first 100 characters because printing a large String takes a lot of time, which is a
+  // bad thing for a callback function. If you need to print the whole String it is better to store
+  // it and print it in the loop() later. Note that response.substring will not work as expected if
+  // the String contains null values as data.
   Serial.print(F("Response received: "));
   Serial.println(response.substring(0, 100));
 
@@ -131,12 +174,15 @@ void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
 
     /* Connect to any _suitable_ APs which contain meshInstance.getMeshName() */
     if (meshNameIndex >= 0) {
-      uint64_t targetNodeID = TypeCast::stringToUint64(currentSSID.substring(meshNameIndex + meshInstance.getMeshName().length()));
+      uint64_t targetNodeID = TypeCast::stringToUint64(
+          currentSSID.substring(meshNameIndex + meshInstance.getMeshName().length()));
 
       if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID())) {
-        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+        if (EspnowMeshBackend* espnowInstance
+            = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
           espnowInstance->connectionQueue().emplace_back(networkIndex);
-        } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+        } else if (TcpIpMeshBackend* tcpIpInstance
+                   = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
           tcpIpInstance->connectionQueue().emplace_back(networkIndex);
         } else {
           Serial.println(F("Invalid mesh backend!"));
@@ -147,20 +193,24 @@ void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
 }
 
 /**
-   Callback used to decide which broadcast messages to accept. Only called for the first transmission in each broadcast.
-   If true is returned from this callback, the first broadcast transmission is saved until the entire broadcast message has been received.
-   The complete broadcast message will then be sent to the requestHandler (manageRequest in this example).
-   If false is returned from this callback, the broadcast message is discarded.
-   Note that the BroadcastFilter may be called multiple times for messages that are discarded in this way, but is only called once for accepted messages.
-
-   @param firstTransmission The first transmission of the broadcast. Modifications to this String are passed on to the broadcast message.
+   Callback used to decide which broadcast messages to accept. Only called for the first
+   transmission in each broadcast. If true is returned from this callback, the first broadcast
+   transmission is saved until the entire broadcast message has been received. The complete
+   broadcast message will then be sent to the requestHandler (manageRequest in this example). If
+   false is returned from this callback, the broadcast message is discarded. Note that the
+   BroadcastFilter may be called multiple times for messages that are discarded in this way, but is
+   only called once for accepted messages.
+
+   @param firstTransmission The first transmission of the broadcast. Modifications to this String
+   are passed on to the broadcast message.
    @param meshInstance The EspnowMeshBackend instance that called the function.
 
    @return True if the broadcast should be accepted. False otherwise.
 */
 bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance) {
-  // This example broadcastFilter will accept a transmission if it contains the broadcastMetadataDelimiter
-  // and as metaData either no targetMeshName or a targetMeshName that matches the MeshName of meshInstance.
+  // This example broadcastFilter will accept a transmission if it contains the
+  // broadcastMetadataDelimiter and as metaData either no targetMeshName or a targetMeshName that
+  // matches the MeshName of meshInstance.
 
   int32_t metadataEndIndex = firstTransmission.indexOf(broadcastMetadataDelimiter);
 
@@ -174,8 +224,9 @@ bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance)
     return false;  // Broadcast is for another mesh network
   } else {
     // Remove metadata from message and mark as accepted broadcast.
-    // Note that when you modify firstTransmission it is best to avoid using substring or other String methods that rely on null values for String length determination.
-    // Otherwise your broadcasts cannot include null values in the message bytes.
+    // Note that when you modify firstTransmission it is best to avoid using substring or other
+    // String methods that rely on null values for String length determination. Otherwise your
+    // broadcasts cannot include null values in the message bytes.
     firstTransmission.remove(0, metadataEndIndex + 1);
     return true;
   }
@@ -183,19 +234,23 @@ bool broadcastFilter(String& firstTransmission, EspnowMeshBackend& meshInstance)
 
 /**
    Once passed to the setTransmissionOutcomesUpdateHook method of the ESP-NOW backend,
-   this function will be called after each update of the latestTransmissionOutcomes vector during attemptTransmission.
-   (which happens after each individual transmission has finished)
+   this function will be called after each update of the latestTransmissionOutcomes vector during
+   attemptTransmission. (which happens after each individual transmission has finished)
 
-   Example use cases is modifying getMessage() between transmissions, or aborting attemptTransmission before all nodes in the connectionQueue have been contacted.
+   Example use cases is modifying getMessage() between transmissions, or aborting
+   attemptTransmission before all nodes in the connectionQueue have been contacted.
 
    @param meshInstance The MeshBackendBase instance that called the function.
 
-   @return True if attemptTransmission should continue with the next entry in the connectionQueue. False if attemptTransmission should stop.
+   @return True if attemptTransmission should continue with the next entry in the connectionQueue.
+   False if attemptTransmission should stop.
 */
 bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
-  // Currently this is exactly the same as the default hook, but you can modify it to alter the behaviour of attemptTransmission.
+  // Currently this is exactly the same as the default hook, but you can modify it to alter the
+  // behaviour of attemptTransmission.
 
-  (void)meshInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  (void)meshInstance;  // This is useful to remove a "unused parameter" compiler warning. Does
+                       // nothing else.
 
   return true;
 }
@@ -203,8 +258,9 @@ bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
 /**
    Once passed to the setResponseTransmittedHook method of the ESP-NOW backend,
    this function will be called after each attempted ESP-NOW response transmission.
-   In case of a successful response transmission, this happens just before the response is removed from the waiting list.
-   Only the hook of the EspnowMeshBackend instance that is getEspnowRequestManager() will be called.
+   In case of a successful response transmission, this happens just before the response is removed
+   from the waiting list. Only the hook of the EspnowMeshBackend instance that is
+   getEspnowRequestManager() will be called.
 
    @param transmissionSuccessful True if the response was transmitted successfully. False otherwise.
    @param response The sent response.
@@ -212,13 +268,18 @@ bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
    @param responseIndex The index of the response in the waiting list.
    @param meshInstance The EspnowMeshBackend instance that called the function.
 
-   @return True if the response transmission process should continue with the next response in the waiting list.
-           False if the response transmission process should stop once processing of the just sent response is complete.
+   @return True if the response transmission process should continue with the next response in the
+   waiting list. False if the response transmission process should stop once processing of the just
+   sent response is complete.
 */
-bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String& response, const uint8_t* recipientMac, uint32_t responseIndex, EspnowMeshBackend& meshInstance) {
-  // Currently this is exactly the same as the default hook, but you can modify it to alter the behaviour of sendEspnowResponses.
-
-  (void)transmissionSuccessful;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String& response,
+                                    const uint8_t* recipientMac, uint32_t responseIndex,
+                                    EspnowMeshBackend& meshInstance) {
+  // Currently this is exactly the same as the default hook, but you can modify it to alter the
+  // behaviour of sendEspnowResponses.
+
+  (void)transmissionSuccessful;  // This is useful to remove a "unused parameter" compiler warning.
+                                 // Does nothing else.
   (void)response;
   (void)recipientMac;
   (void)responseIndex;
@@ -228,8 +289,10 @@ bool exampleResponseTransmittedHook(bool transmissionSuccessful, const String& r
 }
 
 void setup() {
-  // Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
-  // This will however delay node WiFi start-up by about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to connect to.
+  // Prevents the flash memory from being worn out, see:
+  // https://github.com/esp8266/Arduino/issues/1054 . This will however delay node WiFi start-up by
+  // about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to
+  // connect to.
   WiFi.persistent(false);
 
   Serial.begin(115200);
@@ -237,10 +300,12 @@ void setup() {
   Serial.println();
   Serial.println();
 
-  Serial.println(F("Note that this library can use static IP:s for the nodes with the TCP/IP backend to speed up connection times.\n"
-                   "Use the setStaticIP method to enable this.\n"
-                   "Ensure that nodes connecting to the same AP have distinct static IP:s.\n"
-                   "Also, remember to change the default mesh network password and ESP-NOW keys!\n\n"));
+  Serial.println(
+      F("Note that this library can use static IP:s for the nodes with the TCP/IP backend to speed "
+        "up connection times.\n"
+        "Use the setStaticIP method to enable this.\n"
+        "Ensure that nodes connecting to the same AP have distinct static IP:s.\n"
+        "Also, remember to change the default mesh network password and ESP-NOW keys!\n\n"));
 
   Serial.println(F("Setting up mesh node..."));
 
@@ -249,61 +314,81 @@ void setup() {
 
   // Note: This changes the Kok for all EspnowMeshBackend instances on this ESP8266.
   // Encrypted connections added before the Kok change will retain their old Kok.
-  // Both Kok and encrypted connection key must match in an encrypted connection pair for encrypted communication to be possible.
-  // Otherwise the transmissions will never reach the recipient, even though acks are received by the sender.
+  // Both Kok and encrypted connection key must match in an encrypted connection pair for encrypted
+  // communication to be possible. Otherwise the transmissions will never reach the recipient, even
+  // though acks are received by the sender.
   EspnowMeshBackend::setEspnowEncryptionKok(espnowEncryptionKok);
   espnowNode.setEspnowEncryptedConnectionKey(espnowEncryptedConnectionKey);
 
-  // Makes it possible to find the node through scans, makes it possible to recover from an encrypted connection where only the other node is encrypted, and also makes it possible to receive broadcast transmissions.
-  // Note that only one AP can be active at a time in total, and this will always be the one which was last activated.
-  // Thus the AP is shared by all backends.
+  // Makes it possible to find the node through scans, makes it possible to recover from an
+  // encrypted connection where only the other node is encrypted, and also makes it possible to
+  // receive broadcast transmissions. Note that only one AP can be active at a time in total, and
+  // this will always be the one which was last activated. Thus the AP is shared by all backends.
   espnowNode.activateAP();
 
-  // Storing our message in the EspnowMeshBackend instance is not required, but can be useful for organizing code, especially when using many EspnowMeshBackend instances.
-  // Note that calling the multi-recipient versions of espnowNode.attemptTransmission and espnowNode.attemptAutoEncryptingTransmission will replace the stored message with whatever message is transmitted.
-  // Also note that the maximum allowed number of ASCII characters in a ESP-NOW message is given by EspnowMeshBackend::getMaxMessageLength().
-  espnowNode.setMessage(String(F("Hello world request #")) + String(requestNumber) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.'));
+  // Storing our message in the EspnowMeshBackend instance is not required, but can be useful for
+  // organizing code, especially when using many EspnowMeshBackend instances. Note that calling the
+  // multi-recipient versions of espnowNode.attemptTransmission and
+  // espnowNode.attemptAutoEncryptingTransmission will replace the stored message with whatever
+  // message is transmitted. Also note that the maximum allowed number of ASCII characters in a
+  // ESP-NOW message is given by EspnowMeshBackend::getMaxMessageLength().
+  espnowNode.setMessage(String(F("Hello world request #")) + String(requestNumber) + F(" from ")
+                        + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.'));
 
   espnowNode.setTransmissionOutcomesUpdateHook(exampleTransmissionOutcomesUpdateHook);
   espnowNode.setResponseTransmittedHook(exampleResponseTransmittedHook);
 
-  // In addition to using encrypted ESP-NOW connections the framework can also send automatically encrypted messages (AEAD) over both encrypted and unencrypted connections.
-  // Using AEAD will only encrypt the message content, not the transmission metadata.
-  // The AEAD encryption does not require any pairing, and is thus faster for single messages than establishing a new encrypted connection before transfer.
-  // AEAD encryption also works with ESP-NOW broadcasts and supports an unlimited number of nodes, which is not true for encrypted connections.
-  // Encrypted ESP-NOW connections do however come with built in replay attack protection, which is not provided by the framework when using AEAD encryption,
-  // and allow EspnowProtocolInterpreter::aeadMetadataSize extra message bytes per transmission.
-  // Transmissions via encrypted connections are also slightly faster than via AEAD once a connection has been established.
+  // In addition to using encrypted ESP-NOW connections the framework can also send automatically
+  // encrypted messages (AEAD) over both encrypted and unencrypted connections. Using AEAD will only
+  // encrypt the message content, not the transmission metadata. The AEAD encryption does not
+  // require any pairing, and is thus faster for single messages than establishing a new encrypted
+  // connection before transfer. AEAD encryption also works with ESP-NOW broadcasts and supports an
+  // unlimited number of nodes, which is not true for encrypted connections. Encrypted ESP-NOW
+  // connections do however come with built in replay attack protection, which is not provided by
+  // the framework when using AEAD encryption, and allow EspnowProtocolInterpreter::aeadMetadataSize
+  // extra message bytes per transmission. Transmissions via encrypted connections are also slightly
+  // faster than via AEAD once a connection has been established.
   //
-  // Uncomment the lines below to use automatic AEAD encryption/decryption of messages sent/received.
-  // All nodes this node wishes to communicate with must then also use encrypted messages with the same getEspnowMessageEncryptionKey(), or messages will not be accepted.
-  // Note that using AEAD encrypted messages will reduce the number of message bytes that can be transmitted.
-  //espnowNode.setEspnowMessageEncryptionKey(F("ChangeThisKeySeed_TODO")); // The message encryption key should always be set manually. Otherwise a default key (all zeroes) is used.
-  //espnowNode.setUseEncryptedMessages(true);
+  // Uncomment the lines below to use automatic AEAD encryption/decryption of messages
+  // sent/received. All nodes this node wishes to communicate with must then also use encrypted
+  // messages with the same getEspnowMessageEncryptionKey(), or messages will not be accepted. Note
+  // that using AEAD encrypted messages will reduce the number of message bytes that can be
+  // transmitted.
+  // espnowNode.setEspnowMessageEncryptionKey(F("ChangeThisKeySeed_TODO")); // The message
+  // encryption key should always be set manually. Otherwise a default key (all zeroes) is used.
+  // espnowNode.setUseEncryptedMessages(true);
 }
 
 int32_t timeOfLastScan = -10000;
 void    loop() {
-  // The performEspnowMaintenance() method performs all the background operations for the EspnowMeshBackend.
-  // It is recommended to place it in the beginning of the loop(), unless there is a need to put it elsewhere.
-  // Among other things, the method cleans up old Espnow log entries (freeing up RAM) and sends the responses you provide to Espnow requests.
-  // Note that depending on the amount of responses to send and their length, this method can take tens or even hundreds of milliseconds to complete.
-  // More intense transmission activity and less frequent calls to performEspnowMaintenance will likely cause the method to take longer to complete, so plan accordingly.
-
-  //Should not be used inside responseHandler, requestHandler, networkFilter or broadcastFilter callbacks since performEspnowMaintenance() can alter the ESP-NOW state.
+  // The performEspnowMaintenance() method performs all the background operations for the
+  // EspnowMeshBackend. It is recommended to place it in the beginning of the loop(), unless there
+  // is a need to put it elsewhere. Among other things, the method cleans up old Espnow log entries
+  // (freeing up RAM) and sends the responses you provide to Espnow requests. Note that depending on
+  // the amount of responses to send and their length, this method can take tens or even hundreds of
+  // milliseconds to complete. More intense transmission activity and less frequent calls to
+  // performEspnowMaintenance will likely cause the method to take longer to complete, so plan
+  // accordingly.
+
+  // Should not be used inside responseHandler, requestHandler, networkFilter or broadcastFilter
+  // callbacks since performEspnowMaintenance() can alter the ESP-NOW state.
   EspnowMeshBackend::performEspnowMaintenance();
 
-  if (millis() - timeOfLastScan > 10000) {  // Give other nodes some time to connect between data transfers.
+  if (millis() - timeOfLastScan
+      > 10000) {  // Give other nodes some time to connect between data transfers.
     Serial.println(F("\nPerforming unencrypted ESP-NOW transmissions."));
 
     uint32_t startTime = millis();
     espnowNode.attemptTransmission(espnowNode.getMessage());
-    Serial.println(String(F("Scan and ")) + String(espnowNode.latestTransmissionOutcomes().size()) + F(" transmissions done in ") + String(millis() - startTime) + F(" ms."));
+    Serial.println(String(F("Scan and ")) + String(espnowNode.latestTransmissionOutcomes().size())
+                   + F(" transmissions done in ") + String(millis() - startTime) + F(" ms."));
 
     timeOfLastScan = millis();
 
-    // Wait for response. espnowDelay continuously calls performEspnowMaintenance() so we will respond to ESP-NOW request while waiting.
-    // Should not be used inside responseHandler, requestHandler, networkFilter or broadcastFilter callbacks since performEspnowMaintenance() can alter the ESP-NOW state.
+    // Wait for response. espnowDelay continuously calls performEspnowMaintenance() so we will
+    // respond to ESP-NOW request while waiting. Should not be used inside responseHandler,
+    // requestHandler, networkFilter or broadcastFilter callbacks since performEspnowMaintenance()
+    // can alter the ESP-NOW state.
     espnowDelay(100);
 
     // One way to check how attemptTransmission worked out
@@ -316,14 +401,18 @@ void    loop() {
       Serial.println(F("No mesh AP found."));
     } else {
       for (TransmissionOutcome& transmissionOutcome : espnowNode.latestTransmissionOutcomes()) {
-        if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED) {
+        if (transmissionOutcome.transmissionStatus()
+            == TransmissionStatusType::TRANSMISSION_FAILED) {
           Serial.println(String(F("Transmission failed to mesh AP ")) + transmissionOutcome.SSID());
-        } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED) {
+        } else if (transmissionOutcome.transmissionStatus()
+                   == TransmissionStatusType::CONNECTION_FAILED) {
           Serial.println(String(F("Connection failed to mesh AP ")) + transmissionOutcome.SSID());
-        } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE) {
+        } else if (transmissionOutcome.transmissionStatus()
+                   == TransmissionStatusType::TRANSMISSION_COMPLETE) {
           // No need to do anything, transmission was successful.
         } else {
-          Serial.println(String(F("Invalid transmission status for ")) + transmissionOutcome.SSID() + String('!'));
+          Serial.println(String(F("Invalid transmission status for ")) + transmissionOutcome.SSID()
+                         + String('!'));
           assert(F("Invalid transmission status returned from responseHandler!") && false);
         }
       }
@@ -332,21 +421,30 @@ void    loop() {
 
       startTime = millis();
 
-      // Remove espnowNode.getMeshName() from the broadcastMetadata below to broadcast to all ESP-NOW nodes regardless of MeshName.
-      // Note that data that comes before broadcastMetadataDelimiter should not contain any broadcastMetadataDelimiter characters,
+      // Remove espnowNode.getMeshName() from the broadcastMetadata below to broadcast to all
+      // ESP-NOW nodes regardless of MeshName. Note that data that comes before
+      // broadcastMetadataDelimiter should not contain any broadcastMetadataDelimiter characters,
       // otherwise the broadcastFilter function used in this example file will not work.
       String broadcastMetadata = espnowNode.getMeshName() + String(broadcastMetadataDelimiter);
-      String broadcastMessage  = String(F("Broadcast #")) + String(requestNumber) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
+      String broadcastMessage  = String(F("Broadcast #")) + String(requestNumber) + F(" from ")
+                                + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
       espnowNode.broadcast(broadcastMetadata + broadcastMessage);
-      Serial.println(String(F("Broadcast to all mesh nodes done in ")) + String(millis() - startTime) + F(" ms."));
-
-      espnowDelay(100);  // Wait for responses (broadcasts can receive an unlimited number of responses, other transmissions can only receive one response).
-
-      // If you have a data array containing null values it is possible to transmit the raw data by making the array into a multiString as shown below.
-      // You can use String::c_str() or String::begin() to retrieve the data array later.
-      // Note that certain String methods such as String::substring use null values to determine String length, which means they will not work as normal with multiStrings.
-      uint8_t dataArray[]   = { 0, '\'', 0, '\'', ' ', '(', 'n', 'u', 'l', 'l', ')', ' ', 'v', 'a', 'l', 'u', 'e' };
-      String  espnowMessage = TypeCast::uint8ArrayToMultiString(dataArray, sizeof dataArray) + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.');
+      Serial.println(String(F("Broadcast to all mesh nodes done in "))
+                     + String(millis() - startTime) + F(" ms."));
+
+      espnowDelay(100);  // Wait for responses (broadcasts can receive an unlimited number of
+                         // responses, other transmissions can only receive one response).
+
+      // If you have a data array containing null values it is possible to transmit the raw data by
+      // making the array into a multiString as shown below. You can use String::c_str() or
+      // String::begin() to retrieve the data array later. Note that certain String methods such as
+      // String::substring use null values to determine String length, which means they will not
+      // work as normal with multiStrings.
+      uint8_t dataArray[]
+          = { 0, '\'', 0, '\'', ' ', '(', 'n', 'u', 'l', 'l', ')', ' ', 'v', 'a', 'l', 'u', 'e' };
+      String espnowMessage = TypeCast::uint8ArrayToMultiString(dataArray, sizeof dataArray)
+                             + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID()
+                             + String('.');
       Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
       espnowNode.attemptTransmission(espnowMessage, false);
       espnowDelay(100);  // Wait for response.
@@ -355,29 +453,39 @@ void    loop() {
 
       uint8_t targetBSSID[6] { 0 };
 
-      // We can create encrypted connections to individual nodes so that all ESP-NOW communication with the node will be encrypted.
-      if (espnowNode.constConnectionQueue()[0].getBSSID(targetBSSID) && espnowNode.requestEncryptedConnection(targetBSSID) == EncryptedConnectionStatus::CONNECTION_ESTABLISHED) {
-        // The WiFi scan will detect the AP MAC, but this will automatically be converted to the encrypted STA MAC by the framework.
+      // We can create encrypted connections to individual nodes so that all ESP-NOW communication
+      // with the node will be encrypted.
+      if (espnowNode.constConnectionQueue()[0].getBSSID(targetBSSID)
+          && espnowNode.requestEncryptedConnection(targetBSSID)
+                 == EncryptedConnectionStatus::CONNECTION_ESTABLISHED) {
+        // The WiFi scan will detect the AP MAC, but this will automatically be converted to the
+        // encrypted STA MAC by the framework.
         String peerMac = TypeCast::macToString(targetBSSID);
 
-        Serial.println(String(F("Encrypted ESP-NOW connection with ")) + peerMac + F(" established!"));
+        Serial.println(String(F("Encrypted ESP-NOW connection with ")) + peerMac
+                       + F(" established!"));
 
         // Making a transmission now will cause messages to targetBSSID to be encrypted.
-        String espnowMessage = String(F("This message is encrypted only when received by node ")) + peerMac;
+        String espnowMessage
+            = String(F("This message is encrypted only when received by node ")) + peerMac;
         Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
         espnowNode.attemptTransmission(espnowMessage, false);
         espnowDelay(100);  // Wait for response.
 
         // A connection can be serialized and stored for later use.
-        // Note that this saves the current state only, so if encrypted communication between the nodes happen after this, the stored state is invalid.
-        String serializedEncryptedConnection = EspnowMeshBackend::serializeEncryptedConnection(targetBSSID);
+        // Note that this saves the current state only, so if encrypted communication between the
+        // nodes happen after this, the stored state is invalid.
+        String serializedEncryptedConnection
+            = EspnowMeshBackend::serializeEncryptedConnection(targetBSSID);
 
         Serial.println();
         // We can remove an encrypted connection like so.
         espnowNode.removeEncryptedConnection(targetBSSID);
 
-        // Note that the peer will still be encrypted, so although we can send unencrypted messages to the peer, we cannot read the encrypted responses it sends back.
-        espnowMessage = String(F("This message is no longer encrypted when received by node ")) + peerMac;
+        // Note that the peer will still be encrypted, so although we can send unencrypted messages
+        // to the peer, we cannot read the encrypted responses it sends back.
+        espnowMessage
+            = String(F("This message is no longer encrypted when received by node ")) + peerMac;
         Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
         espnowNode.attemptTransmission(espnowMessage, false);
         espnowDelay(100);  // Wait for response.
@@ -386,64 +494,80 @@ void    loop() {
         // Let's re-add our stored connection so we can communicate properly with targetBSSID again!
         espnowNode.addEncryptedConnection(serializedEncryptedConnection);
 
-        espnowMessage = String(F("This message is once again encrypted when received by node ")) + peerMac;
+        espnowMessage
+            = String(F("This message is once again encrypted when received by node ")) + peerMac;
         Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
         espnowNode.attemptTransmission(espnowMessage, false);
         espnowDelay(100);  // Wait for response.
 
         Serial.println();
         // If we want to remove the encrypted connection on both nodes, we can do it like this.
-        EncryptedConnectionRemovalOutcome removalOutcome = espnowNode.requestEncryptedConnectionRemoval(targetBSSID);
+        EncryptedConnectionRemovalOutcome removalOutcome
+            = espnowNode.requestEncryptedConnectionRemoval(targetBSSID);
         if (removalOutcome == EncryptedConnectionRemovalOutcome::REMOVAL_SUCCEEDED) {
           Serial.println(peerMac + F(" is no longer encrypted!"));
 
-          espnowMessage = String(F("This message is only received by node ")) + peerMac + F(". Transmitting in this way will not change the transmission state of the sender.");
+          espnowMessage = String(F("This message is only received by node ")) + peerMac
+                          + F(". Transmitting in this way will not change the transmission state "
+                              "of the sender.");
           Serial.println(String(F("Transmitting: ")) + espnowMessage);
           espnowNode.attemptTransmission(espnowMessage, EspnowNetworkInfo(targetBSSID));
           espnowDelay(100);  // Wait for response.
 
           Serial.println();
 
-          // Of course, we can also just create a temporary encrypted connection that will remove itself once its duration has passed.
-          if (espnowNode.requestTemporaryEncryptedConnection(targetBSSID, 1000) == EncryptedConnectionStatus::CONNECTION_ESTABLISHED) {
+          // Of course, we can also just create a temporary encrypted connection that will remove
+          // itself once its duration has passed.
+          if (espnowNode.requestTemporaryEncryptedConnection(targetBSSID, 1000)
+              == EncryptedConnectionStatus::CONNECTION_ESTABLISHED) {
             espnowDelay(42);
             uint32_t remainingDuration = 0;
             EspnowMeshBackend::getConnectionInfo(targetBSSID, &remainingDuration);
 
-            espnowMessage = String(F("Messages this node sends to ")) + peerMac + F(" will be encrypted for ") + String(remainingDuration) + F(" ms more.");
+            espnowMessage = String(F("Messages this node sends to ")) + peerMac
+                            + F(" will be encrypted for ") + String(remainingDuration)
+                            + F(" ms more.");
             Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
             espnowNode.attemptTransmission(espnowMessage, false);
 
             EspnowMeshBackend::getConnectionInfo(targetBSSID, &remainingDuration);
             espnowDelay(remainingDuration + 100);
 
-            espnowMessage = String(F("Due to encrypted connection expiration, this message is no longer encrypted when received by node ")) + peerMac;
+            espnowMessage = String(F("Due to encrypted connection expiration, this message is no "
+                                     "longer encrypted when received by node "))
+                            + peerMac;
             Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
             espnowNode.attemptTransmission(espnowMessage, false);
             espnowDelay(100);  // Wait for response.
           }
 
-          // Or if we prefer we can just let the library automatically create brief encrypted connections which are long enough to transmit an encrypted message.
-          // Note that encrypted responses will not be received, unless there already was an encrypted connection established with the peer before attemptAutoEncryptingTransmission was called.
-          // This can be remedied via the requestPermanentConnections argument, though it must be noted that the maximum number of encrypted connections supported at a time is 6.
+          // Or if we prefer we can just let the library automatically create brief encrypted
+          // connections which are long enough to transmit an encrypted message. Note that encrypted
+          // responses will not be received, unless there already was an encrypted connection
+          // established with the peer before attemptAutoEncryptingTransmission was called. This can
+          // be remedied via the requestPermanentConnections argument, though it must be noted that
+          // the maximum number of encrypted connections supported at a time is 6.
           espnowMessage = F("This message is always encrypted, regardless of receiver.");
           Serial.println(String(F("\nTransmitting: ")) + espnowMessage);
           espnowNode.attemptAutoEncryptingTransmission(espnowMessage);
           espnowDelay(100);  // Wait for response.
         } else {
-          Serial.println(String(F("Ooops! Encrypted connection removal failed. Status: ")) + String(static_cast<int>(removalOutcome)));
+          Serial.println(String(F("Ooops! Encrypted connection removal failed. Status: "))
+                         + String(static_cast<int>(removalOutcome)));
         }
 
-        // Finally, should you ever want to stop other parties from sending unencrypted messages to the node
-        // setAcceptsUnencryptedRequests(false);
-        // can be used for this. It applies to both encrypted connection requests and regular transmissions.
+        // Finally, should you ever want to stop other parties from sending unencrypted messages to
+        // the node setAcceptsUnencryptedRequests(false); can be used for this. It applies to both
+        // encrypted connection requests and regular transmissions.
 
-        Serial.println(F("\n##############################################################################################"));
+        Serial.println(F("\n#######################################################################"
+                         "#######################"));
       }
 
       // Our last request was sent to all nodes found, so time to create a new request.
-      espnowNode.setMessage(String(F("Hello world request #")) + String(++requestNumber) + F(" from ")
-                            + espnowNode.getMeshName() + espnowNode.getNodeID() + String('.'));
+      espnowNode.setMessage(String(F("Hello world request #")) + String(++requestNumber)
+                            + F(" from ") + espnowNode.getMeshName() + espnowNode.getNodeID()
+                            + String('.'));
     }
 
     Serial.println();
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino b/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
index 811b07f0ab..78bab243b2 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloMesh/HelloMesh.ino
@@ -1,14 +1,21 @@
 /**
-   This example makes every node broadcast their AP MAC to the rest of the network during the first 28 seconds, as long as the node thinks it has the highest AP MAC in the network.
-   Once 28 seconds have passed, the node that has the highest AP MAC will start broadcasting benchmark messages, which will allow you to see how many messages are lost at the other nodes.
-   If you have an onboard LED on your ESP8266 it is recommended that you change the useLED variable below to true.
-   That way you will get instant confirmation of the mesh communication without checking the Serial Monitor.
-
-   If you want to experiment with reducing error rates you can use the mesh method "void setBroadcastReceptionRedundancy(uint8_t redundancy);" (default 2) at the cost of more RAM.
-   Or "floodingMesh.getEspnowMeshBackend().setBroadcastTransmissionRedundancy(uint8_t redundancy)" (default 1) at the cost of longer transmission times.
+   This example makes every node broadcast their AP MAC to the rest of the network during the first
+   28 seconds, as long as the node thinks it has the highest AP MAC in the network. Once 28 seconds
+   have passed, the node that has the highest AP MAC will start broadcasting benchmark messages,
+   which will allow you to see how many messages are lost at the other nodes. If you have an onboard
+   LED on your ESP8266 it is recommended that you change the useLED variable below to true. That way
+   you will get instant confirmation of the mesh communication without checking the Serial Monitor.
+
+   If you want to experiment with reducing error rates you can use the mesh method "void
+   setBroadcastReceptionRedundancy(uint8_t redundancy);" (default 2) at the cost of more RAM. Or
+   "floodingMesh.getEspnowMeshBackend().setBroadcastTransmissionRedundancy(uint8_t redundancy)"
+   (default 1) at the cost of longer transmission times.
 */
 
-#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
+#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO:
+                                               // Should be used for new code until the
+                                               // compatibility code is removed with release 3.0.0
+                                               // of the Arduino core.
 
 #include <ESP8266WiFi.h>
 #include <TypeConversionFunctions.h>
@@ -19,30 +26,46 @@ namespace TypeCast = MeshTypeConversionFunctions;
 
 /**
    NOTE: Although we could define the strings below as normal String variables,
-   here we are using PROGMEM combined with the FPSTR() macro (and also just the F() macro further down in the file).
-   The reason is that this approach will place the strings in flash memory which will help save RAM during program execution.
-   Reading strings from flash will be slower than reading them from RAM,
-   but this will be a negligible difference when printing them to Serial.
+   here we are using PROGMEM combined with the FPSTR() macro (and also just the F() macro further
+   down in the file). The reason is that this approach will place the strings in flash memory which
+   will help save RAM during program execution. Reading strings from flash will be slower than
+   reading them from RAM, but this will be a negligible difference when printing them to Serial.
 
    More on F(), FPSTR() and PROGMEM:
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char exampleMeshName[] PROGMEM     = "MeshNode_";                    // The name of the mesh network. Used as prefix for the node SSID and to find other network nodes in the example networkFilter and broadcastFilter functions below.
-constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
-
-// A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a default Kok set, but it can be replaced if desired.
-// All ESP-NOW keys below must match in an encrypted connection pair for encrypted communication to be possible.
-// Note that it is also possible to use Strings as key seeds instead of arrays.
-uint8_t espnowEncryptedConnectionKey[16] = { 0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x33, 0x44,  // This is the key for encrypting transmissions of encrypted connections.
-                                             0x33, 0x44, 0x33, 0x44, 0x33, 0x44, 0x32, 0x11 };
-uint8_t espnowHashKey[16]                = { 0xEF, 0x44, 0x33, 0x0C, 0x33, 0x44, 0xFE, 0x44,  // This is the secret key used for HMAC during encrypted connection requests.
-                              0x33, 0x44, 0x33, 0xB0, 0x33, 0x44, 0x32, 0xAD };
+constexpr char exampleMeshName[] PROGMEM
+    = "MeshNode_";  // The name of the mesh network. Used as prefix for the node SSID and to find
+                    // other network nodes in the example networkFilter and broadcastFilter
+                    // functions below.
+constexpr char exampleWiFiPassword[] PROGMEM
+    = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min
+                                      // 8 and max 64 characters long, otherwise an AP which uses it
+                                      // will not be found during scans.
+
+// A custom encryption key is required when using encrypted ESP-NOW transmissions. There is always a
+// default Kok set, but it can be replaced if desired. All ESP-NOW keys below must match in an
+// encrypted connection pair for encrypted communication to be possible. Note that it is also
+// possible to use Strings as key seeds instead of arrays.
+uint8_t espnowEncryptedConnectionKey[16]
+    = { 0x33, 0x44, 0x33, 0x44, 0x33,
+        0x44, 0x33, 0x44,  // This is the key for encrypting transmissions of encrypted connections.
+        0x33, 0x44, 0x33, 0x44, 0x33,
+        0x44, 0x32, 0x11 };
+uint8_t espnowHashKey[16] = {
+  0xEF, 0x44, 0x33, 0x0C, 0x33,
+  0x44, 0xFE, 0x44,  // This is the secret key used for HMAC during encrypted connection requests.
+  0x33, 0x44, 0x33, 0xB0, 0x33,
+  0x44, 0x32, 0xAD
+};
 
 bool meshMessageHandler(String& message, FloodingMesh& meshInstance);
 
 /* Create the mesh node object */
-FloodingMesh floodingMesh = FloodingMesh(meshMessageHandler, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey, FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
+FloodingMesh floodingMesh = FloodingMesh(
+    meshMessageHandler, FPSTR(exampleWiFiPassword), espnowEncryptedConnectionKey, espnowHashKey,
+    FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
 
 bool   theOne = true;
 String theOneMac;
@@ -53,17 +76,18 @@ bool useLED = false;  // Change this to true if you wish the onboard LED to mark
    Callback for when a message is received from the mesh network.
 
    @param message The message String received from the mesh.
-                  Modifications to this String are passed on when the message is forwarded from this node to other nodes.
-                  However, the forwarded message will still use the same messageID.
-                  Thus it will not be sent to nodes that have already received this messageID.
-                  If you want to send a new message to the whole network, use a new broadcast from within the loop() instead.
+                  Modifications to this String are passed on when the message is forwarded from this
+   node to other nodes. However, the forwarded message will still use the same messageID. Thus it
+   will not be sent to nodes that have already received this messageID. If you want to send a new
+   message to the whole network, use a new broadcast from within the loop() instead.
    @param meshInstance The FloodingMesh instance that received the message.
    @return True if this node should forward the received message to other nodes. False otherwise.
 */
 bool meshMessageHandler(String& message, FloodingMesh& meshInstance) {
   int32_t delimiterIndex = message.indexOf(meshInstance.metadataDelimiter());
   if (delimiterIndex == 0) {
-    Serial.print(String(F("Message received from STA MAC ")) + meshInstance.getEspnowMeshBackend().getSenderMac() + F(": "));
+    Serial.print(String(F("Message received from STA MAC "))
+                 + meshInstance.getEspnowMeshBackend().getSenderMac() + F(": "));
     Serial.println(message.substring(2, 102));
 
     String potentialMac = message.substring(2, 14);
@@ -85,22 +109,27 @@ bool meshMessageHandler(String& message, FloodingMesh& meshInstance) {
     }
   } else if (delimiterIndex > 0) {
     if (meshInstance.getOriginMac() == theOneMac) {
-      uint32_t totalBroadcasts = strtoul(message.c_str(), nullptr, 0);  // strtoul stops reading input when an invalid character is discovered.
+      uint32_t totalBroadcasts
+          = strtoul(message.c_str(), nullptr,
+                    0);  // strtoul stops reading input when an invalid character is discovered.
 
       // Static variables are only initialized once.
       static uint32_t firstBroadcast = totalBroadcasts;
 
       if (totalBroadcasts - firstBroadcast >= 100) {  // Wait a little to avoid start-up glitches
-        static uint32_t missedBroadcasts        = 1;  // Starting at one to compensate for initial -1 below.
+        static uint32_t missedBroadcasts
+            = 1;  // Starting at one to compensate for initial -1 below.
         static uint32_t previousTotalBroadcasts = totalBroadcasts;
         static uint32_t totalReceivedBroadcasts = 0;
         totalReceivedBroadcasts++;
 
-        missedBroadcasts += totalBroadcasts - previousTotalBroadcasts - 1;  // We expect an increment by 1.
+        missedBroadcasts
+            += totalBroadcasts - previousTotalBroadcasts - 1;  // We expect an increment by 1.
         previousTotalBroadcasts = totalBroadcasts;
 
         if (totalReceivedBroadcasts % 50 == 0) {
-          Serial.println(String(F("missed/total: ")) + String(missedBroadcasts) + '/' + String(totalReceivedBroadcasts));
+          Serial.println(String(F("missed/total: ")) + String(missedBroadcasts) + '/'
+                         + String(totalReceivedBroadcasts));
         }
         if (totalReceivedBroadcasts % 500 == 0) {
           Serial.println(String(F("Benchmark message: ")) + message.substring(0, 100));
@@ -108,9 +137,11 @@ bool meshMessageHandler(String& message, FloodingMesh& meshInstance) {
       }
     }
   } else {
-    // Only show first 100 characters because printing a large String takes a lot of time, which is a bad thing for a callback function.
-    // If you need to print the whole String it is better to store it and print it in the loop() later.
-    Serial.print(String(F("Message with origin ")) + meshInstance.getOriginMac() + F(" received: "));
+    // Only show first 100 characters because printing a large String takes a lot of time, which is
+    // a bad thing for a callback function. If you need to print the whole String it is better to
+    // store it and print it in the loop() later.
+    Serial.print(String(F("Message with origin ")) + meshInstance.getOriginMac()
+                 + F(" received: "));
     Serial.println(message.substring(0, 100));
   }
 
@@ -118,8 +149,10 @@ bool meshMessageHandler(String& message, FloodingMesh& meshInstance) {
 }
 
 void setup() {
-  // Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
-  // This will however delay node WiFi start-up by about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to connect to.
+  // Prevents the flash memory from being worn out, see:
+  // https://github.com/esp8266/Arduino/issues/1054 . This will however delay node WiFi start-up by
+  // about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to
+  // connect to.
   WiFi.persistent(false);
 
   Serial.begin(115200);
@@ -127,9 +160,11 @@ void setup() {
   Serial.println();
   Serial.println();
 
-  Serial.println(F("If you have an onboard LED on your ESP8266 it is recommended that you change the useLED variable to true.\n"
-                   "That way you will get instant confirmation of the mesh communication.\n"
-                   "Also, remember to change the default mesh network password and ESP-NOW keys!\n"));
+  Serial.println(
+      F("If you have an onboard LED on your ESP8266 it is recommended that you change the useLED "
+        "variable to true.\n"
+        "That way you will get instant confirmation of the mesh communication.\n"
+        "Also, remember to change the default mesh network password and ESP-NOW keys!\n"));
 
   Serial.println(F("Setting up mesh node..."));
 
@@ -144,12 +179,15 @@ void setup() {
     digitalWrite(LED_BUILTIN, LOW);  // Turn LED on (LED_BUILTIN is active low)
   }
 
-  // Uncomment the lines below to use automatic AEAD encryption/decryption of messages sent/received via broadcast() and encryptedBroadcast().
-  // The main benefit of AEAD encryption is that it can be used with normal broadcasts (which are substantially faster than encryptedBroadcasts).
-  // The main drawbacks are that AEAD only encrypts the message data (not transmission metadata), transfers less data per message and lacks replay attack protection.
-  // When using AEAD, potential replay attacks must thus be handled manually.
-  //floodingMesh.getEspnowMeshBackend().setEspnowMessageEncryptionKey(F("ChangeThisKeySeed_TODO")); // The message encryption key should always be set manually. Otherwise a default key (all zeroes) is used.
-  //floodingMesh.getEspnowMeshBackend().setUseEncryptedMessages(true);
+  // Uncomment the lines below to use automatic AEAD encryption/decryption of messages sent/received
+  // via broadcast() and encryptedBroadcast(). The main benefit of AEAD encryption is that it can be
+  // used with normal broadcasts (which are substantially faster than encryptedBroadcasts). The main
+  // drawbacks are that AEAD only encrypts the message data (not transmission metadata), transfers
+  // less data per message and lacks replay attack protection. When using AEAD, potential replay
+  // attacks must thus be handled manually.
+  // floodingMesh.getEspnowMeshBackend().setEspnowMessageEncryptionKey(F("ChangeThisKeySeed_TODO"));
+  // // The message encryption key should always be set manually. Otherwise a default key (all
+  // zeroes) is used. floodingMesh.getEspnowMeshBackend().setUseEncryptedMessages(true);
 
   floodingMeshDelay(5000);  // Give some time for user to start the nodes
 }
@@ -160,35 +198,49 @@ void    loop() {
   static uint32_t benchmarkCount = 0;
   static uint32_t loopStart      = millis();
 
-  // The floodingMeshDelay() method performs all the background operations for the FloodingMesh (via FloodingMesh::performMeshMaintenance()).
-  // It is recommended to place one of these methods in the beginning of the loop(), unless there is a need to put them elsewhere.
-  // Among other things, the method cleans up old ESP-NOW log entries (freeing up RAM) and forwards received mesh messages.
-  // Note that depending on the amount of messages to forward and their length, this method can take tens or even hundreds of milliseconds to complete.
-  // More intense transmission activity and less frequent calls to performMeshMaintenance will likely cause the method to take longer to complete, so plan accordingly.
-  // The maintenance methods should not be used inside the meshMessageHandler callback, since they can alter the mesh node state. The framework will alert you during runtime if you make this mistake.
+  // The floodingMeshDelay() method performs all the background operations for the FloodingMesh (via
+  // FloodingMesh::performMeshMaintenance()). It is recommended to place one of these methods in the
+  // beginning of the loop(), unless there is a need to put them elsewhere. Among other things, the
+  // method cleans up old ESP-NOW log entries (freeing up RAM) and forwards received mesh messages.
+  // Note that depending on the amount of messages to forward and their length, this method can take
+  // tens or even hundreds of milliseconds to complete. More intense transmission activity and less
+  // frequent calls to performMeshMaintenance will likely cause the method to take longer to
+  // complete, so plan accordingly. The maintenance methods should not be used inside the
+  // meshMessageHandler callback, since they can alter the mesh node state. The framework will alert
+  // you during runtime if you make this mistake.
   floodingMeshDelay(1);
 
-  // If you wish to transmit only to a single node, try using one of the following methods (requires the node to be within range and know the MAC of the recipient):
-  // Unencrypted: TransmissionStatusType floodingMesh.getEspnowMeshBackend().attemptTransmission(message, EspnowNetworkInfo(recipientMac));
-  // Encrypted (slow): floodingMesh.getEspnowMeshBackend().attemptAutoEncryptingTransmission(message, EspnowNetworkInfo(recipientMac));
+  // If you wish to transmit only to a single node, try using one of the following methods (requires
+  // the node to be within range and know the MAC of the recipient): Unencrypted:
+  // TransmissionStatusType floodingMesh.getEspnowMeshBackend().attemptTransmission(message,
+  // EspnowNetworkInfo(recipientMac)); Encrypted (slow):
+  // floodingMesh.getEspnowMeshBackend().attemptAutoEncryptingTransmission(message,
+  // EspnowNetworkInfo(recipientMac));
 
   if (theOne) {
     if (millis() - timeOfLastProclamation > 10000) {
       uint32_t startTime = millis();
-      ledState           = ledState ^ bool(benchmarkCount);  // Make other nodes' LEDs alternate between on and off once benchmarking begins.
+      ledState = ledState ^ bool(benchmarkCount);  // Make other nodes' LEDs alternate between on
+                                                   // and off once benchmarking begins.
 
-      // Note: The maximum length of an unencrypted broadcast message is given by floodingMesh.maxUnencryptedMessageLength(). It is around 670 bytes by default.
-      floodingMesh.broadcast(String(floodingMesh.metadataDelimiter()) + String(ledState) + theOneMac + F(" is The One."));
-      Serial.println(String(F("Proclamation broadcast done in ")) + String(millis() - startTime) + F(" ms."));
+      // Note: The maximum length of an unencrypted broadcast message is given by
+      // floodingMesh.maxUnencryptedMessageLength(). It is around 670 bytes by default.
+      floodingMesh.broadcast(String(floodingMesh.metadataDelimiter()) + String(ledState) + theOneMac
+                             + F(" is The One."));
+      Serial.println(String(F("Proclamation broadcast done in ")) + String(millis() - startTime)
+                     + F(" ms."));
 
       timeOfLastProclamation = millis();
       floodingMeshDelay(20);
     }
 
-    if (millis() - loopStart > 23000) {  // Start benchmarking the mesh once three proclamations have been made
+    if (millis() - loopStart
+        > 23000) {  // Start benchmarking the mesh once three proclamations have been made
       uint32_t startTime = millis();
-      floodingMesh.broadcast(String(benchmarkCount++) + String(floodingMesh.metadataDelimiter()) + F(": Not a spoon in sight."));
-      Serial.println(String(F("Benchmark broadcast done in ")) + String(millis() - startTime) + F(" ms."));
+      floodingMesh.broadcast(String(benchmarkCount++) + String(floodingMesh.metadataDelimiter())
+                             + F(": Not a spoon in sight."));
+      Serial.println(String(F("Benchmark broadcast done in ")) + String(millis() - startTime)
+                     + F(" ms."));
       floodingMeshDelay(20);
     }
   }
diff --git a/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino b/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
index 8321b2a94c..2ca5514341 100644
--- a/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
+++ b/libraries/ESP8266WiFiMesh/examples/HelloTcpIp/HelloTcpIp.ino
@@ -1,4 +1,7 @@
-#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO: Should be used for new code until the compatibility code is removed with release 3.0.0 of the Arduino core.
+#define ESP8266WIFIMESH_DISABLE_COMPATIBILITY  // Excludes redundant compatibility code. TODO:
+                                               // Should be used for new code until the
+                                               // compatibility code is removed with release 3.0.0
+                                               // of the Arduino core.
 
 #include <ESP8266WiFi.h>
 #include <TcpIpMeshBackend.h>
@@ -10,17 +13,20 @@ namespace TypeCast = MeshTypeConversionFunctions;
 
 /**
    NOTE: Although we could define the strings below as normal String variables,
-   here we are using PROGMEM combined with the FPSTR() macro (and also just the F() macro further down in the file).
-   The reason is that this approach will place the strings in flash memory which will help save RAM during program execution.
-   Reading strings from flash will be slower than reading them from RAM,
-   but this will be a negligible difference when printing them to Serial.
+   here we are using PROGMEM combined with the FPSTR() macro (and also just the F() macro further
+   down in the file). The reason is that this approach will place the strings in flash memory which
+   will help save RAM during program execution. Reading strings from flash will be slower than
+   reading them from RAM, but this will be a negligible difference when printing them to Serial.
 
    More on F(), FPSTR() and PROGMEM:
    https://github.com/esp8266/Arduino/issues/1143
    https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html
 */
-constexpr char exampleMeshName[] PROGMEM     = "MeshNode_";
-constexpr char exampleWiFiPassword[] PROGMEM = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min 8 and max 64 characters long, otherwise an AP which uses it will not be found during scans.
+constexpr char exampleMeshName[] PROGMEM = "MeshNode_";
+constexpr char exampleWiFiPassword[] PROGMEM
+    = "ChangeThisWiFiPassword_TODO";  // Note: " is an illegal character. The password has to be min
+                                      // 8 and max 64 characters long, otherwise an AP which uses it
+                                      // will not be found during scans.
 
 unsigned int requestNumber  = 0;
 unsigned int responseNumber = 0;
@@ -30,36 +36,49 @@ TransmissionStatusType manageResponse(const String& response, MeshBackendBase& m
 void                   networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance);
 
 /* Create the mesh node object */
-TcpIpMeshBackend tcpIpNode = TcpIpMeshBackend(manageRequest, manageResponse, networkFilter, FPSTR(exampleWiFiPassword), FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
+TcpIpMeshBackend tcpIpNode
+    = TcpIpMeshBackend(manageRequest, manageResponse, networkFilter, FPSTR(exampleWiFiPassword),
+                       FPSTR(exampleMeshName), TypeCast::uint64ToString(ESP.getChipId()), true);
 
 /**
    Callback for when other nodes send you a request
 
    @param request The request string received from another node in the mesh
    @param meshInstance The MeshBackendBase instance that called the function.
-   @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no response should be sent.
+   @return The string to send back to the other node. For ESP-NOW, return an empty string ("") if no
+   response should be sent.
 */
 String manageRequest(const String& request, MeshBackendBase& meshInstance) {
-  // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
-    String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
-    Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
-    (void)tcpIpInstance;  // This is useful to remove a "unused parameter" compiler warning. Does nothing else.
+  // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast
+  // replaces dynamic_cast since RTTI is disabled)
+  if (EspnowMeshBackend* espnowInstance
+      = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+    String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ?
+                                       F(", Encrypted transmission") :
+                                       F(", Unencrypted transmission");
+    Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted
+                 + F("): "));
+  } else if (TcpIpMeshBackend* tcpIpInstance
+             = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+    (void)tcpIpInstance;  // This is useful to remove a "unused parameter" compiler warning. Does
+                          // nothing else.
     Serial.print(F("TCP/IP: "));
   } else {
     Serial.print(F("UNKNOWN!: "));
   }
 
   /* Print out received message */
-  // Only show first 100 characters because printing a large String takes a lot of time, which is a bad thing for a callback function.
-  // If you need to print the whole String it is better to store it and print it in the loop() later.
-  // Note that request.substring will not work as expected if the String contains null values as data.
+  // Only show first 100 characters because printing a large String takes a lot of time, which is a
+  // bad thing for a callback function. If you need to print the whole String it is better to store
+  // it and print it in the loop() later. Note that request.substring will not work as expected if
+  // the String contains null values as data.
   Serial.print(F("Request received: "));
   Serial.println(request.substring(0, 100));
 
   /* return a string to send back */
-  return (String(F("Hello world response #")) + String(responseNumber++) + F(" from ") + meshInstance.getMeshName() + meshInstance.getNodeID() + F(" with AP MAC ") + WiFi.softAPmacAddress() + String('.'));
+  return (String(F("Hello world response #")) + String(responseNumber++) + F(" from ")
+          + meshInstance.getMeshName() + meshInstance.getNodeID() + F(" with AP MAC ")
+          + WiFi.softAPmacAddress() + String('.'));
 }
 
 /**
@@ -72,17 +91,24 @@ String manageRequest(const String& request, MeshBackendBase& meshInstance) {
 TransmissionStatusType manageResponse(const String& response, MeshBackendBase& meshInstance) {
   TransmissionStatusType statusCode = TransmissionStatusType::TRANSMISSION_COMPLETE;
 
-  // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast replaces dynamic_cast since RTTI is disabled)
-  if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
-    String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ? F(", Encrypted transmission") : F(", Unencrypted transmission");
-    Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted + F("): "));
-  } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+  // To get the actual class of the polymorphic meshInstance, do as follows (meshBackendCast
+  // replaces dynamic_cast since RTTI is disabled)
+  if (EspnowMeshBackend* espnowInstance
+      = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+    String transmissionEncrypted = espnowInstance->receivedEncryptedTransmission() ?
+                                       F(", Encrypted transmission") :
+                                       F(", Unencrypted transmission");
+    Serial.print(String(F("ESP-NOW (")) + espnowInstance->getSenderMac() + transmissionEncrypted
+                 + F("): "));
+  } else if (TcpIpMeshBackend* tcpIpInstance
+             = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
     Serial.print(F("TCP/IP: "));
 
     // Getting the sent message like this will work as long as ONLY(!) TCP/IP is used.
-    // With TCP/IP the response will follow immediately after the request, so the stored message will not have changed.
-    // With ESP-NOW there is no guarantee when or if a response will show up, it can happen before or after the stored message is changed.
-    // So for ESP-NOW, adding unique identifiers in the response and request is required to associate a response with a request.
+    // With TCP/IP the response will follow immediately after the request, so the stored message
+    // will not have changed. With ESP-NOW there is no guarantee when or if a response will show up,
+    // it can happen before or after the stored message is changed. So for ESP-NOW, adding unique
+    // identifiers in the response and request is required to associate a response with a request.
     Serial.print(F("Request sent: "));
     Serial.println(tcpIpInstance->getCurrentMessage().substring(0, 100));
   } else {
@@ -90,9 +116,10 @@ TransmissionStatusType manageResponse(const String& response, MeshBackendBase& m
   }
 
   /* Print out received message */
-  // Only show first 100 characters because printing a large String takes a lot of time, which is a bad thing for a callback function.
-  // If you need to print the whole String it is better to store it and print it in the loop() later.
-  // Note that response.substring will not work as expected if the String contains null values as data.
+  // Only show first 100 characters because printing a large String takes a lot of time, which is a
+  // bad thing for a callback function. If you need to print the whole String it is better to store
+  // it and print it in the loop() later. Note that response.substring will not work as expected if
+  // the String contains null values as data.
   Serial.print(F("Response received: "));
   Serial.println(response.substring(0, 100));
 
@@ -113,12 +140,15 @@ void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
 
     /* Connect to any _suitable_ APs which contain meshInstance.getMeshName() */
     if (meshNameIndex >= 0) {
-      uint64_t targetNodeID = TypeCast::stringToUint64(currentSSID.substring(meshNameIndex + meshInstance.getMeshName().length()));
+      uint64_t targetNodeID = TypeCast::stringToUint64(
+          currentSSID.substring(meshNameIndex + meshInstance.getMeshName().length()));
 
       if (targetNodeID < TypeCast::stringToUint64(meshInstance.getNodeID())) {
-        if (EspnowMeshBackend* espnowInstance = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
+        if (EspnowMeshBackend* espnowInstance
+            = TypeCast::meshBackendCast<EspnowMeshBackend*>(&meshInstance)) {
           espnowInstance->connectionQueue().emplace_back(networkIndex);
-        } else if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+        } else if (TcpIpMeshBackend* tcpIpInstance
+                   = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
           tcpIpInstance->connectionQueue().emplace_back(networkIndex);
         } else {
           Serial.println(F("Invalid mesh backend!"));
@@ -130,23 +160,28 @@ void networkFilter(int numberOfNetworks, MeshBackendBase& meshInstance) {
 
 /**
    Once passed to the setTransmissionOutcomesUpdateHook method of the TCP/IP backend,
-   this function will be called after each update of the latestTransmissionOutcomes vector during attemptTransmission.
-   (which happens after each individual transmission has finished)
+   this function will be called after each update of the latestTransmissionOutcomes vector during
+   attemptTransmission. (which happens after each individual transmission has finished)
 
-   Example use cases is modifying getMessage() between transmissions, or aborting attemptTransmission before all nodes in the connectionQueue have been contacted.
+   Example use cases is modifying getMessage() between transmissions, or aborting
+   attemptTransmission before all nodes in the connectionQueue have been contacted.
 
    @param meshInstance The MeshBackendBase instance that called the function.
 
-   @return True if attemptTransmission should continue with the next entry in the connectionQueue. False if attemptTransmission should stop.
+   @return True if attemptTransmission should continue with the next entry in the connectionQueue.
+   False if attemptTransmission should stop.
 */
 bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
   // The default hook only returns true and does nothing else.
 
-  if (TcpIpMeshBackend* tcpIpInstance = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
-    if (tcpIpInstance->latestTransmissionOutcomes().back().transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE) {
+  if (TcpIpMeshBackend* tcpIpInstance
+      = TypeCast::meshBackendCast<TcpIpMeshBackend*>(&meshInstance)) {
+    if (tcpIpInstance->latestTransmissionOutcomes().back().transmissionStatus()
+        == TransmissionStatusType::TRANSMISSION_COMPLETE) {
       // Our last request got a response, so time to create a new request.
-      meshInstance.setMessage(String(F("Hello world request #")) + String(++requestNumber) + F(" from ")
-                              + meshInstance.getMeshName() + meshInstance.getNodeID() + String('.'));
+      meshInstance.setMessage(String(F("Hello world request #")) + String(++requestNumber)
+                              + F(" from ") + meshInstance.getMeshName() + meshInstance.getNodeID()
+                              + String('.'));
     }
   } else {
     Serial.println(F("Invalid mesh backend!"));
@@ -156,8 +191,10 @@ bool exampleTransmissionOutcomesUpdateHook(MeshBackendBase& meshInstance) {
 }
 
 void setup() {
-  // Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
-  // This will however delay node WiFi start-up by about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to connect to.
+  // Prevents the flash memory from being worn out, see:
+  // https://github.com/esp8266/Arduino/issues/1054 . This will however delay node WiFi start-up by
+  // about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to
+  // connect to.
   WiFi.persistent(false);
 
   Serial.begin(115200);
@@ -165,31 +202,40 @@ void setup() {
   Serial.println();
   Serial.println();
 
-  Serial.println(F("Note that this library can use static IP:s for the nodes to speed up connection times.\n"
-                   "Use the setStaticIP method as shown in this example to enable this.\n"
-                   "Ensure that nodes connecting to the same AP have distinct static IP:s.\n"
-                   "Also, remember to change the default mesh network password!\n\n"));
+  Serial.println(
+      F("Note that this library can use static IP:s for the nodes to speed up connection times.\n"
+        "Use the setStaticIP method as shown in this example to enable this.\n"
+        "Ensure that nodes connecting to the same AP have distinct static IP:s.\n"
+        "Also, remember to change the default mesh network password!\n\n"));
 
   Serial.println(F("Setting up mesh node..."));
 
   /* Initialise the mesh node */
   tcpIpNode.begin();
-  tcpIpNode.activateAP();                             // Each AP requires a separate server port.
-  tcpIpNode.setStaticIP(IPAddress(192, 168, 4, 22));  // Activate static IP mode to speed up connection times.
+  tcpIpNode.activateAP();  // Each AP requires a separate server port.
+  tcpIpNode.setStaticIP(
+      IPAddress(192, 168, 4, 22));  // Activate static IP mode to speed up connection times.
 
-  // Storing our message in the TcpIpMeshBackend instance is not required, but can be useful for organizing code, especially when using many TcpIpMeshBackend instances.
-  // Note that calling the multi-recipient tcpIpNode.attemptTransmission will replace the stored message with whatever message is transmitted.
-  tcpIpNode.setMessage(String(F("Hello world request #")) + String(requestNumber) + F(" from ") + tcpIpNode.getMeshName() + tcpIpNode.getNodeID() + String('.'));
+  // Storing our message in the TcpIpMeshBackend instance is not required, but can be useful for
+  // organizing code, especially when using many TcpIpMeshBackend instances. Note that calling the
+  // multi-recipient tcpIpNode.attemptTransmission will replace the stored message with whatever
+  // message is transmitted.
+  tcpIpNode.setMessage(String(F("Hello world request #")) + String(requestNumber) + F(" from ")
+                       + tcpIpNode.getMeshName() + tcpIpNode.getNodeID() + String('.'));
 
   tcpIpNode.setTransmissionOutcomesUpdateHook(exampleTransmissionOutcomesUpdateHook);
 }
 
 int32_t timeOfLastScan = -10000;
 void    loop() {
-  if (millis() - timeOfLastScan > 3000                                           // Give other nodes some time to connect between data transfers.
-      || (WiFi.status() != WL_CONNECTED && millis() - timeOfLastScan > 2000)) {  // Scan for networks with two second intervals when not already connected.
-
-    // attemptTransmission(message, scan, scanAllWiFiChannels, concludingDisconnect, initialDisconnect = false)
+  if (millis() - timeOfLastScan
+          > 3000  // Give other nodes some time to connect between data transfers.
+      || (WiFi.status() != WL_CONNECTED
+          && millis() - timeOfLastScan > 2000)) {  // Scan for networks with two second intervals
+                                                   // when not already connected.
+
+    // attemptTransmission(message, scan, scanAllWiFiChannels, concludingDisconnect,
+    // initialDisconnect = false)
     tcpIpNode.attemptTransmission(tcpIpNode.getMessage(), true, false, false);
     timeOfLastScan = millis();
 
@@ -203,14 +249,18 @@ void    loop() {
       Serial.println(F("No mesh AP found."));
     } else {
       for (TransmissionOutcome& transmissionOutcome : tcpIpNode.latestTransmissionOutcomes()) {
-        if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_FAILED) {
+        if (transmissionOutcome.transmissionStatus()
+            == TransmissionStatusType::TRANSMISSION_FAILED) {
           Serial.println(String(F("Transmission failed to mesh AP ")) + transmissionOutcome.SSID());
-        } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::CONNECTION_FAILED) {
+        } else if (transmissionOutcome.transmissionStatus()
+                   == TransmissionStatusType::CONNECTION_FAILED) {
           Serial.println(String(F("Connection failed to mesh AP ")) + transmissionOutcome.SSID());
-        } else if (transmissionOutcome.transmissionStatus() == TransmissionStatusType::TRANSMISSION_COMPLETE) {
+        } else if (transmissionOutcome.transmissionStatus()
+                   == TransmissionStatusType::TRANSMISSION_COMPLETE) {
           // No need to do anything, transmission was successful.
         } else {
-          Serial.println(String(F("Invalid transmission status for ")) + transmissionOutcome.SSID() + String('!'));
+          Serial.println(String(F("Invalid transmission status for ")) + transmissionOutcome.SSID()
+                         + String('!'));
           assert(F("Invalid transmission status returned from responseHandler!") && false);
         }
       }
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino b/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
index 419330d227..b2e5376f4e 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdate/httpUpdate.ino
@@ -38,21 +38,15 @@ void setup() {
   WiFiMulti.addAP(APSSID, APPSK);
 }
 
-void update_started() {
-  Serial.println("CALLBACK:  HTTP update process started");
-}
+void update_started() { Serial.println("CALLBACK:  HTTP update process started"); }
 
-void update_finished() {
-  Serial.println("CALLBACK:  HTTP update process finished");
-}
+void update_finished() { Serial.println("CALLBACK:  HTTP update process finished"); }
 
 void update_progress(int cur, int total) {
   Serial.printf("CALLBACK:  HTTP update process at %d of %d bytes...\n", cur, total);
 }
 
-void update_error(int err) {
-  Serial.printf("CALLBACK:  HTTP update fatal error code %d\n", err);
-}
+void update_error(int err) { Serial.printf("CALLBACK:  HTTP update fatal error code %d\n", err); }
 
 void loop() {
   // wait for WiFi connection
@@ -75,11 +69,12 @@ void loop() {
 
     t_httpUpdate_return ret = ESPhttpUpdate.update(client, "http://server/file.bin");
     // Or:
-    //t_httpUpdate_return ret = ESPhttpUpdate.update(client, "server", 80, "file.bin");
+    // t_httpUpdate_return ret = ESPhttpUpdate.update(client, "server", 80, "file.bin");
 
     switch (ret) {
       case HTTP_UPDATE_FAILED:
-        Serial.printf("HTTP_UPDATE_FAILD Error (%d): %s\n", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
+        Serial.printf("HTTP_UPDATE_FAILD Error (%d): %s\n", ESPhttpUpdate.getLastError(),
+                      ESPhttpUpdate.getLastErrorString().c_str());
         break;
 
       case HTTP_UPDATE_NO_UPDATES:
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
index 784eea2828..2e61e0735e 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateLittleFS/httpUpdateLittleFS.ino
@@ -60,7 +60,8 @@ void loop() {
 
       switch (ret) {
         case HTTP_UPDATE_FAILED:
-          Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
+          Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s", ESPhttpUpdate.getLastError(),
+                        ESPhttpUpdate.getLastErrorString().c_str());
           break;
 
         case HTTP_UPDATE_NO_UPDATES:
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
index 928d360716..2b06b54980 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateSecure/httpUpdateSecure.ino
@@ -72,7 +72,8 @@ void setup() {
   Serial.print(F("Number of CA certs read: "));
   Serial.println(numCerts);
   if (numCerts == 0) {
-    Serial.println(F("No certs found. Did you run certs-from-mozill.py and upload the LittleFS directory before running?"));
+    Serial.println(F("No certs found. Did you run certs-from-mozill.py and upload the LittleFS "
+                     "directory before running?"));
     return;  // Can't connect to anything w/o certs!
   }
 }
@@ -83,7 +84,8 @@ void loop() {
     setClock();
 
     BearSSL::WiFiClientSecure client;
-    bool                      mfln = client.probeMaxFragmentLength("server", 443, 1024);  // server must be the same as in ESPhttpUpdate.update()
+    bool                      mfln = client.probeMaxFragmentLength(
+        "server", 443, 1024);  // server must be the same as in ESPhttpUpdate.update()
     Serial.printf("MFLN supported: %s\n", mfln ? "yes" : "no");
     if (mfln) {
       client.setBufferSizes(1024, 1024);
@@ -100,11 +102,12 @@ void loop() {
 
     t_httpUpdate_return ret = ESPhttpUpdate.update(client, "https://server/file.bin");
     // Or:
-    //t_httpUpdate_return ret = ESPhttpUpdate.update(client, "server", 443, "file.bin");
+    // t_httpUpdate_return ret = ESPhttpUpdate.update(client, "server", 443, "file.bin");
 
     switch (ret) {
       case HTTP_UPDATE_FAILED:
-        Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s\n", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
+        Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s\n", ESPhttpUpdate.getLastError(),
+                      ESPhttpUpdate.getLastErrorString().c_str());
         break;
 
       case HTTP_UPDATE_NO_UPDATES:
diff --git a/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino b/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
index 9b4adcfb5c..2ba0b483fa 100644
--- a/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
+++ b/libraries/ESP8266httpUpdate/examples/httpUpdateSigned/httpUpdateSigned.ino
@@ -97,7 +97,8 @@ void loop() {
 
     switch (ret) {
       case HTTP_UPDATE_FAILED:
-        Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s\n", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
+        Serial.printf("HTTP_UPDATE_FAILED Error (%d): %s\n", ESPhttpUpdate.getLastError(),
+                      ESPhttpUpdate.getLastErrorString().c_str());
         break;
 
       case HTTP_UPDATE_NO_UPDATES:
diff --git a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
index de76d53816..d6cd3f9bd1 100644
--- a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
+++ b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock/mDNS_Clock.ino
@@ -56,9 +56,10 @@
 const char* ssid     = STASSID;
 const char* password = STAPSK;
 
-char*                       pcHostDomain         = 0;      // Negotiated host domain
-bool                        bHostDomainConfirmed = false;  // Flags the confirmation of the host domain
-MDNSResponder::hMDNSService hMDNSService         = 0;      // The handle of the clock service in the MDNS responder
+char* pcHostDomain         = 0;      // Negotiated host domain
+bool  bHostDomainConfirmed = false;  // Flags the confirmation of the host domain
+MDNSResponder::hMDNSService hMDNSService
+    = 0;  // The handle of the clock service in the MDNS responder
 
 // HTTP server at port 'SERVICE_PORT' will respond to HTTP requests
 ESP8266WebServer server(SERVICE_PORT);
@@ -83,10 +84,12 @@ const char* getTimeString(void) {
    Set time via NTP
 */
 void setClock(void) {
-  configTime((TIMEZONE_OFFSET * 3600), (DST_OFFSET * 3600), "pool.ntp.org", "time.nist.gov", "time.windows.com");
+  configTime((TIMEZONE_OFFSET * 3600), (DST_OFFSET * 3600), "pool.ntp.org", "time.nist.gov",
+             "time.windows.com");
 
   Serial.print("Waiting for NTP time sync: ");
-  time_t now = time(nullptr);   // Secs since 01.01.1970 (when uninitialized starts with (8 * 3600 = 28800)
+  time_t now
+      = time(nullptr);  // Secs since 01.01.1970 (when uninitialized starts with (8 * 3600 = 28800)
   while (now < 8 * 3600 * 2) {  // Wait for realistic value
     delay(500);
     Serial.print(".");
@@ -137,7 +140,8 @@ void MDNSDynamicServiceTxtCallback(const MDNSResponder::hMDNSService p_hService)
 */
 void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
   Serial.println("MDNSProbeResultCallback");
-  Serial.printf("MDNSProbeResultCallback: Host domain '%s.local' is %s\n", p_pcDomainName.c_str(), (p_bProbeResult ? "free" : "already USED!"));
+  Serial.printf("MDNSProbeResultCallback: Host domain '%s.local' is %s\n", p_pcDomainName.c_str(),
+                (p_bProbeResult ? "free" : "already USED!"));
   if (true == p_bProbeResult) {
     // Set station hostname
     setStationHostname(pcHostDomain);
@@ -147,7 +151,8 @@ void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
       bHostDomainConfirmed = true;
 
       if (!hMDNSService) {
-        // Add a 'clock.tcp' service to port 'SERVICE_PORT', using the host domain as instance domain
+        // Add a 'clock.tcp' service to port 'SERVICE_PORT', using the host domain as instance
+        // domain
         hMDNSService = MDNS.addService(0, "espclk", "tcp", SERVICE_PORT);
         if (hMDNSService) {
           // Add a simple static MDNS service TXT item
diff --git a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
index 0da915d45d..14c418013b 100644
--- a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
+++ b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor/mDNS_ServiceMonitor.ino
@@ -14,9 +14,9 @@
   is already used in the local network, another host domain is negotiated. Keep an
   eye to the serial output to learn the final host domain for the HTTP service.
   The service itself is is announced as 'host domain'._http._tcp.local.
-  The HTTP server delivers a short greeting and the current  list of other 'HTTP' services (not updated).
-  The web server code is taken nearly 1:1 from the 'mDNS_Web_Server.ino' example.
-  Point your browser to 'host domain'.local to see this web page.
+  The HTTP server delivers a short greeting and the current  list of other 'HTTP' services (not
+  updated). The web server code is taken nearly 1:1 from the 'mDNS_Web_Server.ino' example. Point
+  your browser to 'host domain'.local to see this web page.
 
   Instructions:
   - Update WiFi SSID and password as necessary.
@@ -48,10 +48,12 @@
 const char* ssid     = STASSID;
 const char* password = STAPSK;
 
-char*                            pcHostDomain         = 0;      // Negotiated host domain
-bool                             bHostDomainConfirmed = false;  // Flags the confirmation of the host domain
-MDNSResponder::hMDNSService      hMDNSService         = 0;      // The handle of the http service in the MDNS responder
-MDNSResponder::hMDNSServiceQuery hMDNSServiceQuery    = 0;      // The handle of the 'http.tcp' service query in the MDNS responder
+char* pcHostDomain         = 0;      // Negotiated host domain
+bool  bHostDomainConfirmed = false;  // Flags the confirmation of the host domain
+MDNSResponder::hMDNSService hMDNSService
+    = 0;  // The handle of the http service in the MDNS responder
+MDNSResponder::hMDNSServiceQuery hMDNSServiceQuery
+    = 0;  // The handle of the 'http.tcp' service query in the MDNS responder
 
 const String cstrNoHTTPServices = "Currently no 'http.tcp' services in the local network!<br/>";
 String       strHTTPServices    = cstrNoHTTPServices;
@@ -74,14 +76,16 @@ bool setStationHostname(const char* p_pcHostname) {
    MDNSServiceQueryCallback
 */
 
-void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSResponder::AnswerType answerType, bool p_bSetContent) {
+void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo,
+                              MDNSResponder::AnswerType answerType, bool p_bSetContent) {
   String answerInfo;
   switch (answerType) {
     case MDNSResponder::AnswerType::ServiceDomain:
       answerInfo = "ServiceDomain " + String(serviceInfo.serviceDomain());
       break;
     case MDNSResponder::AnswerType::HostDomainAndPort:
-      answerInfo = "HostDomainAndPort " + String(serviceInfo.hostDomain()) + ":" + String(serviceInfo.hostPort());
+      answerInfo = "HostDomainAndPort " + String(serviceInfo.hostDomain()) + ":"
+                   + String(serviceInfo.hostPort());
       break;
     case MDNSResponder::AnswerType::IP4Address:
       answerInfo = "IP4Address ";
@@ -106,11 +110,11 @@ void MDNSServiceQueryCallback(MDNSResponder::MDNSServiceInfo serviceInfo, MDNSRe
    Probe result callback for Services
 */
 
-void serviceProbeResult(String                            p_pcServiceName,
-                        const MDNSResponder::hMDNSService p_hMDNSService,
-                        bool                              p_bProbeResult) {
+void serviceProbeResult(String p_pcServiceName, const MDNSResponder::hMDNSService p_hMDNSService,
+                        bool p_bProbeResult) {
   (void)p_hMDNSService;
-  Serial.printf("MDNSServiceProbeResultCallback: Service %s probe %s\n", p_pcServiceName.c_str(), (p_bProbeResult ? "succeeded." : "failed!"));
+  Serial.printf("MDNSServiceProbeResultCallback: Service %s probe %s\n", p_pcServiceName.c_str(),
+                (p_bProbeResult ? "succeeded." : "failed!"));
 }
 
 /*
@@ -125,7 +129,8 @@ void serviceProbeResult(String                            p_pcServiceName,
 */
 
 void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
-  Serial.printf("MDNSHostProbeResultCallback: Host domain '%s.local' is %s\n", p_pcDomainName.c_str(), (p_bProbeResult ? "free" : "already USED!"));
+  Serial.printf("MDNSHostProbeResultCallback: Host domain '%s.local' is %s\n",
+                p_pcDomainName.c_str(), (p_bProbeResult ? "free" : "already USED!"));
 
   if (true == p_bProbeResult) {
     // Set station hostname
@@ -152,9 +157,11 @@ void hostProbeResult(String p_pcDomainName, bool p_bProbeResult) {
         if (!hMDNSServiceQuery) {
           hMDNSServiceQuery = MDNS.installServiceQuery("http", "tcp", MDNSServiceQueryCallback);
           if (hMDNSServiceQuery) {
-            Serial.printf("MDNSProbeResultCallback: Service query for 'http.tcp' services installed.\n");
+            Serial.printf(
+                "MDNSProbeResultCallback: Service query for 'http.tcp' services installed.\n");
           } else {
-            Serial.printf("MDNSProbeResultCallback: FAILED to install service query for 'http.tcp' services!\n");
+            Serial.printf("MDNSProbeResultCallback: FAILED to install service query for 'http.tcp' "
+                          "services!\n");
           }
         }
       }
diff --git a/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino b/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
index 290fef2938..0bd58c4ec1 100644
--- a/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
+++ b/libraries/ESP8266mDNS/examples/OTA-mDNS-LittleFS/OTA-mDNS-LittleFS.ino
@@ -157,7 +157,7 @@ void setup() {
 
   // Print hostname.
   Serial.println("Hostname: " + hostname);
-  //Serial.println(WiFi.hostname());
+  // Serial.println(WiFi.hostname());
 
   // Initialize file system.
   if (!LittleFS.begin()) {
@@ -192,7 +192,7 @@ void setup() {
     Serial.println(WiFi.SSID());
 
     // ... Uncomment this for debugging output.
-    //WiFi.printDiag(Serial);
+    // WiFi.printDiag(Serial);
   } else {
     // ... Begin with sdk config.
     WiFi.begin();
@@ -204,7 +204,7 @@ void setup() {
   unsigned long startTime = millis();
   while (WiFi.status() != WL_CONNECTED && millis() - startTime < 10000) {
     Serial.write('.');
-    //Serial.print(WiFi.status());
+    // Serial.print(WiFi.status());
     delay(500);
   }
   Serial.println();
diff --git a/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino b/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
index ea3cbbd699..ccc745d62a 100644
--- a/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
+++ b/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino
@@ -105,9 +105,10 @@ void loop(void) {
 
   String s;
   if (req == "/") {
-    IPAddress ip    = WiFi.localIP();
-    String    ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);
-    s               = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>Hello from ESP8266 at ";
+    IPAddress ip = WiFi.localIP();
+    String ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]);
+    s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>Hello from "
+        "ESP8266 at ";
     s += ipStr;
     s += "</html>\r\n\r\n";
     Serial.println("Sending 200");
diff --git a/libraries/ESP8266mDNS/src/ESP8266mDNS.h b/libraries/ESP8266mDNS/src/ESP8266mDNS.h
index 3b6ccc6449..840577b6d2 100644
--- a/libraries/ESP8266mDNS/src/ESP8266mDNS.h
+++ b/libraries/ESP8266mDNS/src/ESP8266mDNS.h
@@ -3,15 +3,19 @@
     This file is part of the esp8266 core for Arduino environment.
 
     mDNS implementation, that supports many mDNS features like:
-    - Presenting a DNS-SD service to interested observers, eg. a http server by presenting _http._tcp service
-    - Support for multi-level compressed names in input; in output only a very simple one-leven full-name compression is implemented
+    - Presenting a DNS-SD service to interested observers, eg. a http server by presenting
+   _http._tcp service
+    - Support for multi-level compressed names in input; in output only a very simple one-leven
+   full-name compression is implemented
     - Probing host and service domains for uniqueness in the local network
-    - Tiebreaking while probing is supported in a very minimalistic way (the 'higher' IP address wins the tiebreak)
+    - Tiebreaking while probing is supported in a very minimalistic way (the 'higher' IP address
+   wins the tiebreak)
     - Announcing available services after successful probing
     - Using fixed service TXT items or
     - Using dynamic service TXT items for presented services (via callback)
     - Remove services (and un-announcing them to the observers by sending goodbye-messages)
-    - Static queries for DNS-SD services (creating a fixed answer set after a certain timeout period)
+    - Static queries for DNS-SD services (creating a fixed answer set after a certain timeout
+   period)
     - Dynamic queries for DNS-SD services with cached and updated answers and user notifications
     - Support for multi-homed client host domains
 
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.cpp b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
index 56e0568edc..c400c63c09 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.cpp
@@ -49,24 +49,21 @@ namespace MDNSImplementation
 #endif
 
     /**
-    INTERFACE
-*/
+        INTERFACE
+    */
 
     /**
-    MDNSResponder::MDNSResponder
-*/
+        MDNSResponder::MDNSResponder
+    */
     MDNSResponder::MDNSResponder(void) :
-        m_pServices(0),
-        m_pUDPContext(0),
-        m_pcHostname(0),
-        m_pServiceQueries(0),
+        m_pServices(0), m_pUDPContext(0), m_pcHostname(0), m_pServiceQueries(0),
         m_fnServiceTxtCallback(0)
     {
     }
 
     /*
-    MDNSResponder::~MDNSResponder
-*/
+        MDNSResponder::~MDNSResponder
+    */
     MDNSResponder::~MDNSResponder(void)
     {
         _resetProbeStatus(false);
@@ -77,15 +74,16 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::begin
+        MDNSResponder::begin
 
-    Set the host domain (for probing) and install WiFi event handlers for
-    IP assignment and disconnection management. In both cases, the MDNS responder
-    is restarted (reset and restart probe status)
-    Finally the responder is (re)started
+        Set the host domain (for probing) and install WiFi event handlers for
+        IP assignment and disconnection management. In both cases, the MDNS responder
+        is restarted (reset and restart probe status)
+        Finally the responder is (re)started
 
-*/
-    bool MDNSResponder::begin(const char* p_pcHostname, const IPAddress& /*p_IPAddress*/, uint32_t /*p_u32TTL*/)
+    */
+    bool MDNSResponder::begin(const char* p_pcHostname, const IPAddress& /*p_IPAddress*/,
+                              uint32_t /*p_u32TTL*/)
     {
         bool bResult = false;
 
@@ -98,24 +96,26 @@ namespace MDNSImplementation
             [this](netif* intf)
             {
                 (void)intf;
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] new Interface '%c%c' is UP! restarting\n"), intf->name[0], intf->name[1]));
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                    PSTR("[MDNSResponder] new Interface '%c%c' is UP! restarting\n"), intf->name[0],
+                    intf->name[1]));
                 _restart();
             });
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] begin: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] begin: FAILED for '%s'!\n"),
+                                  (p_pcHostname ?: "-"));
+        });
 
         return bResult;
     }
 
     /*
-    MDNSResponder::close
+        MDNSResponder::close
 
-    Ends the MDNS responder.
-    Announced services are unannounced (by multicasting a goodbye message)
+        Ends the MDNS responder.
+        Announced services are unannounced (by multicasting a goodbye message)
 
-*/
+    */
     bool MDNSResponder::close(void)
     {
         bool bResult = false;
@@ -133,32 +133,30 @@ namespace MDNSImplementation
         }
         else
         {
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] close: Ignoring call to close!\n")););
+            DEBUG_EX_INFO(
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] close: Ignoring call to close!\n")););
         }
         return bResult;
     }
 
     /*
-    MDNSResponder::end
+        MDNSResponder::end
 
-    Ends the MDNS responder.
-    for compatibility with esp32
+        Ends the MDNS responder.
+        for compatibility with esp32
 
-*/
+    */
 
-    bool MDNSResponder::end(void)
-    {
-        return close();
-    }
+    bool MDNSResponder::end(void) { return close(); }
 
     /*
-    MDNSResponder::setHostname
+        MDNSResponder::setHostname
 
-    Replaces the current hostname and restarts probing.
-    For services without own instance name (when the host name was used a instance
-    name), the instance names are replaced also (and the probing is restarted).
+        Replaces the current hostname and restarts probing.
+        For services without own instance name (when the host name was used a instance
+        name), the instance names are replaced also (and the probing is restarted).
 
-*/
+    */
     bool MDNSResponder::setHostname(const char* p_pcHostname)
     {
         bool bResult = false;
@@ -169,7 +167,8 @@ namespace MDNSImplementation
 
             // Replace 'auto-set' service names
             bResult = true;
-            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService));
+                 pService                 = pService->m_pNext)
             {
                 if (pService->m_bAutoName)
                 {
@@ -178,33 +177,33 @@ namespace MDNSImplementation
                 }
             }
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setHostname: FAILED for '%s'!\n"), (p_pcHostname ?: "-"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setHostname: FAILED for '%s'!\n"),
+                                  (p_pcHostname ?: "-"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::setHostname (LEGACY)
-*/
+        MDNSResponder::setHostname (LEGACY)
+    */
     bool MDNSResponder::setHostname(const String& p_strHostname)
     {
         return setHostname(p_strHostname.c_str());
     }
 
     /*
-    SERVICES
-*/
+        SERVICES
+    */
 
     /*
-    MDNSResponder::addService
+        MDNSResponder::addService
 
-    Add service; using hostname if no name is explicitly provided for the service
-    The usual '_' underline, which is prepended to service and protocol, eg. _http,
-    may be given. If not, it is added automatically.
+        Add service; using hostname if no name is explicitly provided for the service
+        The usual '_' underline, which is prepended to service and protocol, eg. _http,
+        may be given. If not, it is added automatically.
 
-*/
+    */
     MDNSResponder::hMDNSService MDNSResponder::addService(const char* p_pcName,
                                                           const char* p_pcService,
                                                           const char* p_pcProtocol,
@@ -215,91 +214,100 @@ namespace MDNSImplementation
         if (((!p_pcName) ||  // NO name OR
              (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcName)))
             &&  // Fitting name
-            (p_pcService) && (MDNS_SERVICE_NAME_LENGTH >= os_strlen(p_pcService)) && (p_pcProtocol) && ((MDNS_SERVICE_PROTOCOL_LENGTH - 1) != os_strlen(p_pcProtocol)) && (p_u16Port))
+            (p_pcService) && (MDNS_SERVICE_NAME_LENGTH >= os_strlen(p_pcService)) && (p_pcProtocol)
+            && ((MDNS_SERVICE_PROTOCOL_LENGTH - 1) != os_strlen(p_pcProtocol)) && (p_u16Port))
         {
-            if (!_findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol))  // Not already used
+            if (!_findService((p_pcName ?: m_pcHostname), p_pcService,
+                              p_pcProtocol))  // Not already used
             {
-                if (0 != (hResult = (hMDNSService)_allocService(p_pcName, p_pcService, p_pcProtocol, p_u16Port)))
+                if (0
+                    != (hResult = (hMDNSService)_allocService(p_pcName, p_pcService, p_pcProtocol,
+                                                              p_u16Port)))
                 {
                     // Start probing
-                    ((stcMDNSService*)hResult)->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart;
+                    ((stcMDNSService*)hResult)->m_ProbeInformation.m_ProbingStatus
+                        = ProbingStatus_ReadyToStart;
                 }
             }
         }  // else: bad arguments
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: %s to add '%s.%s.%s'!\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcName ?: "-"), p_pcService, p_pcProtocol););
-        DEBUG_EX_ERR(if (!hResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: FAILED to add '%s.%s.%s'!\n"), (p_pcName ?: "-"), p_pcService, p_pcProtocol);
-                     });
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] addService: %s to add '%s.%s.%s'!\n"),
+            (hResult ? "Succeeded" : "FAILED"), (p_pcName ?: "-"), p_pcService, p_pcProtocol););
+        DEBUG_EX_ERR(if (!hResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addService: FAILED to add '%s.%s.%s'!\n"),
+                                  (p_pcName ?: "-"), p_pcService, p_pcProtocol);
+        });
         return hResult;
     }
 
     /*
-    MDNSResponder::removeService
+        MDNSResponder::removeService
 
-    Unanounce a service (by sending a goodbye message) and remove it
-    from the MDNS responder
+        Unanounce a service (by sending a goodbye message) and remove it
+        from the MDNS responder
 
-*/
+    */
     bool MDNSResponder::removeService(const MDNSResponder::hMDNSService p_hService)
     {
         stcMDNSService* pService = 0;
-        bool            bResult  = (((pService = _findService(p_hService))) && (_announceService(*pService, false)) && (_releaseService(pService)));
+        bool            bResult  = (((pService = _findService(p_hService)))
+                        && (_announceService(*pService, false)) && (_releaseService(pService)));
         DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeService: FAILED!\n"));
-                     });
+                     { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeService: FAILED!\n")); });
         return bResult;
     }
 
     /*
-    MDNSResponder::removeService
-*/
-    bool MDNSResponder::removeService(const char* p_pcName,
-                                      const char* p_pcService,
+        MDNSResponder::removeService
+    */
+    bool MDNSResponder::removeService(const char* p_pcName, const char* p_pcService,
                                       const char* p_pcProtocol)
     {
-        return removeService((hMDNSService)_findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol));
+        return removeService(
+            (hMDNSService)_findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol));
     }
 
     /*
-    MDNSResponder::addService (LEGACY)
-*/
-    bool MDNSResponder::addService(const String& p_strService,
-                                   const String& p_strProtocol,
-                                   uint16_t      p_u16Port)
+        MDNSResponder::addService (LEGACY)
+    */
+    bool MDNSResponder::addService(const String& p_strService, const String& p_strProtocol,
+                                   uint16_t p_u16Port)
     {
-        return (0 != addService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str(), p_u16Port));
+        return (
+            0 != addService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str(), p_u16Port));
     }
 
     /*
-    MDNSResponder::setServiceName
-*/
+        MDNSResponder::setServiceName
+    */
     bool MDNSResponder::setServiceName(const MDNSResponder::hMDNSService p_hService,
                                        const char*                       p_pcInstanceName)
     {
         stcMDNSService* pService = 0;
-        bool            bResult  = (((!p_pcInstanceName) || (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcInstanceName))) && ((pService = _findService(p_hService))) && (pService->setName(p_pcInstanceName)) && ((pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart)));
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setServiceName: FAILED for '%s'!\n"), (p_pcInstanceName ?: "-"));
-                     });
+        bool            bResult
+            = (((!p_pcInstanceName) || (MDNS_DOMAIN_LABEL_MAXLENGTH >= os_strlen(p_pcInstanceName)))
+               && ((pService = _findService(p_hService))) && (pService->setName(p_pcInstanceName))
+               && ((pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_ReadyToStart)));
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setServiceName: FAILED for '%s'!\n"),
+                                  (p_pcInstanceName ?: "-"));
+        });
         return bResult;
     }
 
     /*
-    SERVICE TXT
-*/
+        SERVICE TXT
+    */
 
     /*
-    MDNSResponder::addServiceTxt
+        MDNSResponder::addServiceTxt
 
-    Add a static service TXT item ('Key'='Value') to a service.
+        Add a static service TXT item ('Key'='Value') to a service.
 
-*/
-    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                         const char*                       p_pcKey,
-                                                         const char*                       p_pcValue)
+    */
+    MDNSResponder::hMDNSTxt
+    MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService, const char* p_pcKey,
+                                 const char* p_pcValue)
     {
         hMDNSTxt        hTxt     = 0;
         stcMDNSService* pService = _findService(p_hService);
@@ -307,21 +315,21 @@ namespace MDNSImplementation
         {
             hTxt = (hMDNSTxt)_addServiceTxt(pService, p_pcKey, p_pcValue, false);
         }
-        DEBUG_EX_ERR(if (!hTxt)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
-                     });
+        DEBUG_EX_ERR(if (!hTxt) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addServiceTxt: FAILED for '%s=%s'!\n"),
+                                  (p_pcKey ?: "-"), (p_pcValue ?: "-"));
+        });
         return hTxt;
     }
 
     /*
-    MDNSResponder::addServiceTxt (uint32_t)
+        MDNSResponder::addServiceTxt (uint32_t)
 
-    Formats: http://www.cplusplus.com/reference/cstdio/printf/
-*/
-    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                         const char*                       p_pcKey,
-                                                         uint32_t                          p_u32Value)
+        Formats: http://www.cplusplus.com/reference/cstdio/printf/
+    */
+    MDNSResponder::hMDNSTxt
+    MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService, const char* p_pcKey,
+                                 uint32_t p_u32Value)
     {
         char acBuffer[32];
         *acBuffer = 0;
@@ -331,11 +339,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::addServiceTxt (uint16_t)
-*/
-    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                         const char*                       p_pcKey,
-                                                         uint16_t                          p_u16Value)
+        MDNSResponder::addServiceTxt (uint16_t)
+    */
+    MDNSResponder::hMDNSTxt
+    MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService, const char* p_pcKey,
+                                 uint16_t p_u16Value)
     {
         char acBuffer[16];
         *acBuffer = 0;
@@ -345,11 +353,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::addServiceTxt (uint8_t)
-*/
-    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                         const char*                       p_pcKey,
-                                                         uint8_t                           p_u8Value)
+        MDNSResponder::addServiceTxt (uint8_t)
+    */
+    MDNSResponder::hMDNSTxt
+    MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService, const char* p_pcKey,
+                                 uint8_t p_u8Value)
     {
         char acBuffer[8];
         *acBuffer = 0;
@@ -359,11 +367,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::addServiceTxt (int32_t)
-*/
-    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                         const char*                       p_pcKey,
-                                                         int32_t                           p_i32Value)
+        MDNSResponder::addServiceTxt (int32_t)
+    */
+    MDNSResponder::hMDNSTxt
+    MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService, const char* p_pcKey,
+                                 int32_t p_i32Value)
     {
         char acBuffer[32];
         *acBuffer = 0;
@@ -373,11 +381,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::addServiceTxt (int16_t)
-*/
-    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                         const char*                       p_pcKey,
-                                                         int16_t                           p_i16Value)
+        MDNSResponder::addServiceTxt (int16_t)
+    */
+    MDNSResponder::hMDNSTxt
+    MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService, const char* p_pcKey,
+                                 int16_t p_i16Value)
     {
         char acBuffer[16];
         *acBuffer = 0;
@@ -387,11 +395,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::addServiceTxt (int8_t)
-*/
-    MDNSResponder::hMDNSTxt MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService,
-                                                         const char*                       p_pcKey,
-                                                         int8_t                            p_i8Value)
+        MDNSResponder::addServiceTxt (int8_t)
+    */
+    MDNSResponder::hMDNSTxt
+    MDNSResponder::addServiceTxt(const MDNSResponder::hMDNSService p_hService, const char* p_pcKey,
+                                 int8_t p_i8Value)
     {
         char acBuffer[8];
         *acBuffer = 0;
@@ -401,10 +409,10 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::removeServiceTxt
+        MDNSResponder::removeServiceTxt
 
-    Remove a static service TXT item from a service.
-*/
+        Remove a static service TXT item from a service.
+    */
     bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
                                          const MDNSResponder::hMDNSTxt     p_hTxt)
     {
@@ -419,16 +427,15 @@ namespace MDNSImplementation
                 bResult = _releaseServiceTxt(pService, pTxt);
             }
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::removeServiceTxt
-*/
+        MDNSResponder::removeServiceTxt
+    */
     bool MDNSResponder::removeServiceTxt(const MDNSResponder::hMDNSService p_hService,
                                          const char*                       p_pcKey)
     {
@@ -443,24 +450,23 @@ namespace MDNSImplementation
                 bResult = _releaseServiceTxt(pService, pTxt);
             }
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED for '%s'!\n"), (p_pcKey ?: "-"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceTxt: FAILED for '%s'!\n"),
+                                  (p_pcKey ?: "-"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::removeServiceTxt
-*/
-    bool MDNSResponder::removeServiceTxt(const char* p_pcName,
-                                         const char* p_pcService,
-                                         const char* p_pcProtocol,
-                                         const char* p_pcKey)
+        MDNSResponder::removeServiceTxt
+    */
+    bool MDNSResponder::removeServiceTxt(const char* p_pcName, const char* p_pcService,
+                                         const char* p_pcProtocol, const char* p_pcKey)
     {
         bool bResult = false;
 
-        stcMDNSService* pService = _findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol);
+        stcMDNSService* pService
+            = _findService((p_pcName ?: m_pcHostname), p_pcService, p_pcProtocol);
         if (pService)
         {
             stcMDNSServiceTxt* pTxt = _findServiceTxt(pService, p_pcKey);
@@ -473,35 +479,37 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::addServiceTxt (LEGACY)
-*/
-    bool MDNSResponder::addServiceTxt(const char* p_pcService,
-                                      const char* p_pcProtocol,
-                                      const char* p_pcKey,
-                                      const char* p_pcValue)
+        MDNSResponder::addServiceTxt (LEGACY)
+    */
+    bool MDNSResponder::addServiceTxt(const char* p_pcService, const char* p_pcProtocol,
+                                      const char* p_pcKey, const char* p_pcValue)
     {
-        return (0 != _addServiceTxt(_findService(m_pcHostname, p_pcService, p_pcProtocol), p_pcKey, p_pcValue, false));
+        return (0
+                != _addServiceTxt(_findService(m_pcHostname, p_pcService, p_pcProtocol), p_pcKey,
+                                  p_pcValue, false));
     }
 
     /*
-    MDNSResponder::addServiceTxt (LEGACY)
-*/
-    bool MDNSResponder::addServiceTxt(const String& p_strService,
-                                      const String& p_strProtocol,
-                                      const String& p_strKey,
-                                      const String& p_strValue)
+        MDNSResponder::addServiceTxt (LEGACY)
+    */
+    bool MDNSResponder::addServiceTxt(const String& p_strService, const String& p_strProtocol,
+                                      const String& p_strKey, const String& p_strValue)
     {
-        return (0 != _addServiceTxt(_findService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str()), p_strKey.c_str(), p_strValue.c_str(), false));
+        return (0
+                != _addServiceTxt(
+                    _findService(m_pcHostname, p_strService.c_str(), p_strProtocol.c_str()),
+                    p_strKey.c_str(), p_strValue.c_str(), false));
     }
 
     /*
-    MDNSResponder::setDynamicServiceTxtCallback (global)
+        MDNSResponder::setDynamicServiceTxtCallback (global)
 
-    Set a global callback for dynamic service TXT items. The callback is called, whenever
-    service TXT items are needed.
+        Set a global callback for dynamic service TXT items. The callback is called, whenever
+        service TXT items are needed.
 
-*/
-    bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
+    */
+    bool MDNSResponder::setDynamicServiceTxtCallback(
+        MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
     {
         m_fnServiceTxtCallback = p_fnCallback;
 
@@ -509,14 +517,15 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::setDynamicServiceTxtCallback (service specific)
+        MDNSResponder::setDynamicServiceTxtCallback (service specific)
 
-    Set a service specific callback for dynamic service TXT items. The callback is called, whenever
-    service TXT items are needed for the given service.
+        Set a service specific callback for dynamic service TXT items. The callback is called,
+       whenever service TXT items are needed for the given service.
 
-*/
-    bool MDNSResponder::setDynamicServiceTxtCallback(MDNSResponder::hMDNSService                      p_hService,
-                                                     MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
+    */
+    bool MDNSResponder::setDynamicServiceTxtCallback(
+        MDNSResponder::hMDNSService                      p_hService,
+        MDNSResponder::MDNSDynamicServiceTxtCallbackFunc p_fnCallback)
     {
         bool bResult = false;
 
@@ -527,21 +536,21 @@ namespace MDNSImplementation
 
             bResult = true;
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setDynamicServiceTxtCallback: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] setDynamicServiceTxtCallback: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::addDynamicServiceTxt
-*/
-    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                                const char*                 p_pcKey,
-                                                                const char*                 p_pcValue)
+        MDNSResponder::addDynamicServiceTxt
+    */
+    MDNSResponder::hMDNSTxt
+    MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService, const char* p_pcKey,
+                                        const char* p_pcValue)
     {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt (%s=%s)\n"), p_pcKey, p_pcValue););
+        // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt
+        // (%s=%s)\n"), p_pcKey, p_pcValue););
 
         hMDNSTxt hTxt = 0;
 
@@ -550,19 +559,20 @@ namespace MDNSImplementation
         {
             hTxt = _addServiceTxt(pService, p_pcKey, p_pcValue, true);
         }
-        DEBUG_EX_ERR(if (!hTxt)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] addDynamicServiceTxt: FAILED for '%s=%s'!\n"), (p_pcKey ?: "-"), (p_pcValue ?: "-"));
-                     });
+        DEBUG_EX_ERR(if (!hTxt) {
+            DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] addDynamicServiceTxt: FAILED for '%s=%s'!\n"),
+                (p_pcKey ?: "-"), (p_pcValue ?: "-"));
+        });
         return hTxt;
     }
 
     /*
-    MDNSResponder::addDynamicServiceTxt (uint32_t)
-*/
-    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                                const char*                 p_pcKey,
-                                                                uint32_t                    p_u32Value)
+        MDNSResponder::addDynamicServiceTxt (uint32_t)
+    */
+    MDNSResponder::hMDNSTxt
+    MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService, const char* p_pcKey,
+                                        uint32_t p_u32Value)
     {
         char acBuffer[32];
         *acBuffer = 0;
@@ -572,11 +582,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::addDynamicServiceTxt (uint16_t)
-*/
-    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                                const char*                 p_pcKey,
-                                                                uint16_t                    p_u16Value)
+        MDNSResponder::addDynamicServiceTxt (uint16_t)
+    */
+    MDNSResponder::hMDNSTxt
+    MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService, const char* p_pcKey,
+                                        uint16_t p_u16Value)
     {
         char acBuffer[16];
         *acBuffer = 0;
@@ -586,11 +596,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::addDynamicServiceTxt (uint8_t)
-*/
-    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                                const char*                 p_pcKey,
-                                                                uint8_t                     p_u8Value)
+        MDNSResponder::addDynamicServiceTxt (uint8_t)
+    */
+    MDNSResponder::hMDNSTxt
+    MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService, const char* p_pcKey,
+                                        uint8_t p_u8Value)
     {
         char acBuffer[8];
         *acBuffer = 0;
@@ -600,11 +610,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::addDynamicServiceTxt (int32_t)
-*/
-    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                                const char*                 p_pcKey,
-                                                                int32_t                     p_i32Value)
+        MDNSResponder::addDynamicServiceTxt (int32_t)
+    */
+    MDNSResponder::hMDNSTxt
+    MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService, const char* p_pcKey,
+                                        int32_t p_i32Value)
     {
         char acBuffer[32];
         *acBuffer = 0;
@@ -614,11 +624,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::addDynamicServiceTxt (int16_t)
-*/
-    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                                const char*                 p_pcKey,
-                                                                int16_t                     p_i16Value)
+        MDNSResponder::addDynamicServiceTxt (int16_t)
+    */
+    MDNSResponder::hMDNSTxt
+    MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService, const char* p_pcKey,
+                                        int16_t p_i16Value)
     {
         char acBuffer[16];
         *acBuffer = 0;
@@ -628,11 +638,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::addDynamicServiceTxt (int8_t)
-*/
-    MDNSResponder::hMDNSTxt MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService,
-                                                                const char*                 p_pcKey,
-                                                                int8_t                      p_i8Value)
+        MDNSResponder::addDynamicServiceTxt (int8_t)
+    */
+    MDNSResponder::hMDNSTxt
+    MDNSResponder::addDynamicServiceTxt(MDNSResponder::hMDNSService p_hService, const char* p_pcKey,
+                                        int8_t p_i8Value)
     {
         char acBuffer[8];
         *acBuffer = 0;
@@ -642,22 +652,22 @@ namespace MDNSImplementation
     }
 
     /**
-    STATIC SERVICE QUERY (LEGACY)
-*/
+        STATIC SERVICE QUERY (LEGACY)
+    */
 
     /*
-    MDNSResponder::queryService
+        MDNSResponder::queryService
 
-    Perform a (blocking) static service query.
-    The arrived answers can be queried by calling:
-    - answerHostname (or 'hostname')
-    - answerIP (or 'IP')
-    - answerPort (or 'port')
+        Perform a (blocking) static service query.
+        The arrived answers can be queried by calling:
+        - answerHostname (or 'hostname')
+        - answerIP (or 'IP')
+        - answerPort (or 'port')
 
-*/
-    uint32_t MDNSResponder::queryService(const char*    p_pcService,
-                                         const char*    p_pcProtocol,
-                                         const uint16_t p_u16Timeout /*= MDNS_QUERYSERVICES_WAIT_TIME*/)
+    */
+    uint32_t
+    MDNSResponder::queryService(const char* p_pcService, const char* p_pcProtocol,
+                                const uint16_t p_u16Timeout /*= MDNS_QUERYSERVICES_WAIT_TIME*/)
     {
         if (0 == m_pUDPContext)
         {
@@ -665,19 +675,26 @@ namespace MDNSImplementation
             return 0;
         }
 
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService '%s.%s'\n"), p_pcService, p_pcProtocol););
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService '%s.%s'\n"),
+                                            p_pcService, p_pcProtocol););
 
         uint32_t u32Result = 0;
 
         stcMDNSServiceQuery* pServiceQuery = 0;
-        if ((p_pcService) && (os_strlen(p_pcService)) && (p_pcProtocol) && (os_strlen(p_pcProtocol)) && (p_u16Timeout) && (_removeLegacyServiceQuery()) && ((pServiceQuery = _allocServiceQuery())) && (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
+        if ((p_pcService) && (os_strlen(p_pcService)) && (p_pcProtocol) && (os_strlen(p_pcProtocol))
+            && (p_u16Timeout) && (_removeLegacyServiceQuery())
+            && ((pServiceQuery = _allocServiceQuery()))
+            && (_buildDomainForService(p_pcService, p_pcProtocol,
+                                       pServiceQuery->m_ServiceTypeDomain)))
         {
             pServiceQuery->m_bLegacyQuery = true;
 
             if (_sendMDNSServiceQuery(*pServiceQuery))
             {
                 // Wait for answers to arrive
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: Waiting %u ms for answers...\n"), p_u16Timeout););
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                    PSTR("[MDNSResponder] queryService: Waiting %u ms for answers...\n"),
+                    p_u16Timeout););
                 delay(p_u16Timeout);
 
                 // All answers should have arrived by now -> stop adding new answers
@@ -691,40 +708,39 @@ namespace MDNSImplementation
         }
         else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] queryService: INVALID input data!\n")););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] queryService: INVALID input data!\n")););
         }
         return u32Result;
     }
 
     /*
-    MDNSResponder::removeQuery
+        MDNSResponder::removeQuery
 
-    Remove the last static service query (and all answers).
+        Remove the last static service query (and all answers).
 
-*/
-    bool MDNSResponder::removeQuery(void)
-    {
-        return _removeLegacyServiceQuery();
-    }
+    */
+    bool MDNSResponder::removeQuery(void) { return _removeLegacyServiceQuery(); }
 
     /*
-    MDNSResponder::queryService (LEGACY)
-*/
-    uint32_t MDNSResponder::queryService(const String& p_strService,
-                                         const String& p_strProtocol)
+        MDNSResponder::queryService (LEGACY)
+    */
+    uint32_t MDNSResponder::queryService(const String& p_strService, const String& p_strProtocol)
     {
         return queryService(p_strService.c_str(), p_strProtocol.c_str());
     }
 
     /*
-    MDNSResponder::answerHostname
-*/
+        MDNSResponder::answerHostname
+    */
     const char* MDNSResponder::answerHostname(const uint32_t p_u32AnswerIndex)
     {
         stcMDNSServiceQuery*            pServiceQuery = _findLegacyServiceQuery();
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
 
-        if ((pSQAnswer) && (pSQAnswer->m_HostDomain.m_u16NameLength) && (!pSQAnswer->m_pcHostDomain))
+        if ((pSQAnswer) && (pSQAnswer->m_HostDomain.m_u16NameLength)
+            && (!pSQAnswer->m_pcHostDomain))
         {
             char* pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
             if (pcHostDomain)
@@ -737,89 +753,97 @@ namespace MDNSImplementation
 
 #ifdef MDNS_IP4_SUPPORT
     /*
-    MDNSResponder::answerIP
-*/
+        MDNSResponder::answerIP
+    */
     IPAddress MDNSResponder::answerIP(const uint32_t p_u32AnswerIndex)
     {
-        const stcMDNSServiceQuery*                           pServiceQuery = _findLegacyServiceQuery();
-        const stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        const stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address   = (((pSQAnswer) && (pSQAnswer->m_pIP4Addresses)) ? pSQAnswer->IP4AddressAtIndex(0) : 0);
+        const stcMDNSServiceQuery*            pServiceQuery = _findLegacyServiceQuery();
+        const stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        const stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address
+            = (((pSQAnswer) && (pSQAnswer->m_pIP4Addresses)) ? pSQAnswer->IP4AddressAtIndex(0) : 0);
         return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
     }
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
     /*
-    MDNSResponder::answerIP6
-*/
+        MDNSResponder::answerIP6
+    */
     IPAddress MDNSResponder::answerIP6(const uint32_t p_u32AnswerIndex)
     {
-        const stcMDNSServiceQuery*                           pServiceQuery = _findLegacyServiceQuery();
-        const stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        const stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address   = (((pSQAnswer) && (pSQAnswer->m_pIP6Addresses)) ? pSQAnswer->IP6AddressAtIndex(0) : 0);
+        const stcMDNSServiceQuery*            pServiceQuery = _findLegacyServiceQuery();
+        const stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        const stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address
+            = (((pSQAnswer) && (pSQAnswer->m_pIP6Addresses)) ? pSQAnswer->IP6AddressAtIndex(0) : 0);
         return (pIP6Address ? pIP6Address->m_IPAddress : IP6Address());
     }
 #endif
 
     /*
-    MDNSResponder::answerPort
-*/
+        MDNSResponder::answerPort
+    */
     uint16_t MDNSResponder::answerPort(const uint32_t p_u32AnswerIndex)
     {
         const stcMDNSServiceQuery*            pServiceQuery = _findLegacyServiceQuery();
-        const stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        const stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
     }
 
     /*
-    MDNSResponder::hostname (LEGACY)
-*/
+        MDNSResponder::hostname (LEGACY)
+    */
     String MDNSResponder::hostname(const uint32_t p_u32AnswerIndex)
     {
         return String(answerHostname(p_u32AnswerIndex));
     }
 
     /*
-    MDNSResponder::IP (LEGACY)
-*/
+        MDNSResponder::IP (LEGACY)
+    */
     IPAddress MDNSResponder::IP(const uint32_t p_u32AnswerIndex)
     {
         return answerIP(p_u32AnswerIndex);
     }
 
     /*
-    MDNSResponder::port (LEGACY)
-*/
+        MDNSResponder::port (LEGACY)
+    */
     uint16_t MDNSResponder::port(const uint32_t p_u32AnswerIndex)
     {
         return answerPort(p_u32AnswerIndex);
     }
 
     /**
-    DYNAMIC SERVICE QUERY
-*/
+        DYNAMIC SERVICE QUERY
+    */
 
     /*
-    MDNSResponder::installServiceQuery
+        MDNSResponder::installServiceQuery
 
-    Add a dynamic service query and a corresponding callback to the MDNS responder.
-    The callback will be called for every answer update.
-    The answers can also be queried by calling:
-    - answerServiceDomain
-    - answerHostDomain
-    - answerIP4Address/answerIP6Address
-    - answerPort
-    - answerTxts
+        Add a dynamic service query and a corresponding callback to the MDNS responder.
+        The callback will be called for every answer update.
+        The answers can also be queried by calling:
+        - answerServiceDomain
+        - answerHostDomain
+        - answerIP4Address/answerIP6Address
+        - answerPort
+        - answerTxts
 
-*/
-    MDNSResponder::hMDNSServiceQuery MDNSResponder::installServiceQuery(const char*                                 p_pcService,
-                                                                        const char*                                 p_pcProtocol,
-                                                                        MDNSResponder::MDNSServiceQueryCallbackFunc p_fnCallback)
+    */
+    MDNSResponder::hMDNSServiceQuery
+    MDNSResponder::installServiceQuery(const char* p_pcService, const char* p_pcProtocol,
+                                       MDNSResponder::MDNSServiceQueryCallbackFunc p_fnCallback)
     {
         hMDNSServiceQuery hResult = 0;
 
         stcMDNSServiceQuery* pServiceQuery = 0;
-        if ((p_pcService) && (os_strlen(p_pcService)) && (p_pcProtocol) && (os_strlen(p_pcProtocol)) && (p_fnCallback) && ((pServiceQuery = _allocServiceQuery())) && (_buildDomainForService(p_pcService, p_pcProtocol, pServiceQuery->m_ServiceTypeDomain)))
+        if ((p_pcService) && (os_strlen(p_pcService)) && (p_pcProtocol) && (os_strlen(p_pcProtocol))
+            && (p_fnCallback) && ((pServiceQuery = _allocServiceQuery()))
+            && (_buildDomainForService(p_pcService, p_pcProtocol,
+                                       pServiceQuery->m_ServiceTypeDomain)))
         {
             pServiceQuery->m_fnCallback   = p_fnCallback;
             pServiceQuery->m_bLegacyQuery = false;
@@ -836,41 +860,45 @@ namespace MDNSImplementation
                 _removeServiceQuery(pServiceQuery);
             }
         }
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: %s for '%s.%s'!\n\n"), (hResult ? "Succeeded" : "FAILED"), (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
-        DEBUG_EX_ERR(if (!hResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] installServiceQuery: FAILED for '%s.%s'!\n\n"), (p_pcService ?: "-"), (p_pcProtocol ?: "-"));
-                     });
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] installServiceQuery: %s for '%s.%s'!\n\n"),
+            (hResult ? "Succeeded" : "FAILED"), (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
+        DEBUG_EX_ERR(if (!hResult) {
+            DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] installServiceQuery: FAILED for '%s.%s'!\n\n"),
+                (p_pcService ?: "-"), (p_pcProtocol ?: "-"));
+        });
         return hResult;
     }
 
     /*
-    MDNSResponder::removeServiceQuery
+        MDNSResponder::removeServiceQuery
 
-    Remove a dynamic service query (and all collected answers) from the MDNS responder
+        Remove a dynamic service query (and all collected answers) from the MDNS responder
 
-*/
+    */
     bool MDNSResponder::removeServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
     {
         stcMDNSServiceQuery* pServiceQuery = 0;
-        bool                 bResult       = (((pServiceQuery = _findServiceQuery(p_hServiceQuery))) && (_removeServiceQuery(pServiceQuery)));
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceQuery: FAILED!\n"));
-                     });
+        bool                 bResult       = (((pServiceQuery = _findServiceQuery(p_hServiceQuery)))
+                        && (_removeServiceQuery(pServiceQuery)));
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] removeServiceQuery: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::answerCount
-*/
+        MDNSResponder::answerCount
+    */
     uint32_t MDNSResponder::answerCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
     {
         stcMDNSServiceQuery* pServiceQuery = _findServiceQuery(p_hServiceQuery);
         return (pServiceQuery ? pServiceQuery->answerCount() : 0);
     }
 
-    std::vector<MDNSResponder::MDNSServiceInfo> MDNSResponder::answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
+    std::vector<MDNSResponder::MDNSServiceInfo>
+    MDNSResponder::answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
     {
         std::vector<MDNSResponder::MDNSServiceInfo> tempVector;
         for (uint32_t i = 0; i < answerCount(p_hServiceQuery); i++)
@@ -881,21 +909,25 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::answerServiceDomain
+        MDNSResponder::answerServiceDomain
 
-    Returns the domain for the given service.
-    If not already existing, the string is allocated, filled and attached to the answer.
+        Returns the domain for the given service.
+        If not already existing, the string is allocated, filled and attached to the answer.
 
-*/
-    const char* MDNSResponder::answerServiceDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                                   const uint32_t                         p_u32AnswerIndex)
+    */
+    const char*
+    MDNSResponder::answerServiceDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                       const uint32_t                         p_u32AnswerIndex)
     {
         stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         // Fill m_pcServiceDomain (if not already done)
-        if ((pSQAnswer) && (pSQAnswer->m_ServiceDomain.m_u16NameLength) && (!pSQAnswer->m_pcServiceDomain))
+        if ((pSQAnswer) && (pSQAnswer->m_ServiceDomain.m_u16NameLength)
+            && (!pSQAnswer->m_pcServiceDomain))
         {
-            pSQAnswer->m_pcServiceDomain = pSQAnswer->allocServiceDomain(pSQAnswer->m_ServiceDomain.c_strLength());
+            pSQAnswer->m_pcServiceDomain
+                = pSQAnswer->allocServiceDomain(pSQAnswer->m_ServiceDomain.c_strLength());
             if (pSQAnswer->m_pcServiceDomain)
             {
                 pSQAnswer->m_ServiceDomain.c_str(pSQAnswer->m_pcServiceDomain);
@@ -905,32 +937,38 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::hasAnswerHostDomain
-*/
+        MDNSResponder::hasAnswerHostDomain
+    */
     bool MDNSResponder::hasAnswerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
                                             const uint32_t                         p_u32AnswerIndex)
     {
         stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return ((pSQAnswer)
+                && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
     }
 
     /*
-    MDNSResponder::answerHostDomain
+        MDNSResponder::answerHostDomain
 
-    Returns the host domain for the given service.
-    If not already existing, the string is allocated, filled and attached to the answer.
+        Returns the host domain for the given service.
+        If not already existing, the string is allocated, filled and attached to the answer.
 
-*/
-    const char* MDNSResponder::answerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                                const uint32_t                         p_u32AnswerIndex)
+    */
+    const char*
+    MDNSResponder::answerHostDomain(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                    const uint32_t                         p_u32AnswerIndex)
     {
         stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         // Fill m_pcHostDomain (if not already done)
-        if ((pSQAnswer) && (pSQAnswer->m_HostDomain.m_u16NameLength) && (!pSQAnswer->m_pcHostDomain))
+        if ((pSQAnswer) && (pSQAnswer->m_HostDomain.m_u16NameLength)
+            && (!pSQAnswer->m_pcHostDomain))
         {
-            pSQAnswer->m_pcHostDomain = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
+            pSQAnswer->m_pcHostDomain
+                = pSQAnswer->allocHostDomain(pSQAnswer->m_HostDomain.c_strLength());
             if (pSQAnswer->m_pcHostDomain)
             {
                 pSQAnswer->m_HostDomain.c_str(pSQAnswer->m_pcHostDomain);
@@ -941,123 +979,141 @@ namespace MDNSImplementation
 
 #ifdef MDNS_IP4_SUPPORT
     /*
-    MDNSResponder::hasAnswerIP4Address
-*/
+        MDNSResponder::hasAnswerIP4Address
+    */
     bool MDNSResponder::hasAnswerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
                                             const uint32_t                         p_u32AnswerIndex)
     {
         stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_IP4Address));
     }
 
     /*
-    MDNSResponder::answerIP4AddressCount
-*/
-    uint32_t MDNSResponder::answerIP4AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                                  const uint32_t                         p_u32AnswerIndex)
+        MDNSResponder::answerIP4AddressCount
+    */
+    uint32_t
+    MDNSResponder::answerIP4AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                         const uint32_t                         p_u32AnswerIndex)
     {
         stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return (pSQAnswer ? pSQAnswer->IP4AddressCount() : 0);
     }
 
     /*
-    MDNSResponder::answerIP4Address
-*/
-    IPAddress MDNSResponder::answerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                              const uint32_t                         p_u32AnswerIndex,
-                                              const uint32_t                         p_u32AddressIndex)
+        MDNSResponder::answerIP4Address
+    */
+    IPAddress
+    MDNSResponder::answerIP4Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                    const uint32_t                         p_u32AnswerIndex,
+                                    const uint32_t                         p_u32AddressIndex)
     {
-        stcMDNSServiceQuery*                           pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address   = (pSQAnswer ? pSQAnswer->IP4AddressAtIndex(p_u32AddressIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address
+            = (pSQAnswer ? pSQAnswer->IP4AddressAtIndex(p_u32AddressIndex) : 0);
         return (pIP4Address ? pIP4Address->m_IPAddress : IPAddress());
     }
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
     /*
-    MDNSResponder::hasAnswerIP6Address
-*/
+        MDNSResponder::hasAnswerIP6Address
+    */
     bool MDNSResponder::hasAnswerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
                                             const uint32_t                         p_u32AnswerIndex)
     {
         stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostIP6Address));
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return ((pSQAnswer)
+                && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostIP6Address));
     }
 
     /*
-    MDNSResponder::answerIP6AddressCount
-*/
-    uint32_t MDNSResponder::answerIP6AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                                  const uint32_t                         p_u32AnswerIndex)
+        MDNSResponder::answerIP6AddressCount
+    */
+    uint32_t
+    MDNSResponder::answerIP6AddressCount(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                         const uint32_t                         p_u32AnswerIndex)
     {
         stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return (pSQAnswer ? pSQAnswer->IP6AddressCount() : 0);
     }
 
     /*
-    MDNSResponder::answerIP6Address
-*/
-    IPAddress MDNSResponder::answerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
-                                              const uint32_t                         p_u32AnswerIndex,
-                                              const uint32_t                         p_u32AddressIndex)
+        MDNSResponder::answerIP6Address
+    */
+    IPAddress
+    MDNSResponder::answerIP6Address(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
+                                    const uint32_t                         p_u32AnswerIndex,
+                                    const uint32_t                         p_u32AddressIndex)
     {
-        stcMDNSServiceQuery*                           pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer*                pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address   = (pSQAnswer ? pSQAnswer->IP6AddressAtIndex(p_u32AddressIndex) : 0);
+        stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address
+            = (pSQAnswer ? pSQAnswer->IP6AddressAtIndex(p_u32AddressIndex) : 0);
         return (pIP6Address ? pIP6Address->m_IPAddress : IPAddress());
     }
 #endif
 
     /*
-    MDNSResponder::hasAnswerPort
-*/
+        MDNSResponder::hasAnswerPort
+    */
     bool MDNSResponder::hasAnswerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
                                       const uint32_t                         p_u32AnswerIndex)
     {
         stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
-        return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        return ((pSQAnswer)
+                && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_HostDomainAndPort));
     }
 
     /*
-    MDNSResponder::answerPort
-*/
+        MDNSResponder::answerPort
+    */
     uint16_t MDNSResponder::answerPort(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
                                        const uint32_t                         p_u32AnswerIndex)
     {
         stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return (pSQAnswer ? pSQAnswer->m_u16Port : 0);
     }
 
     /*
-    MDNSResponder::hasAnswerTxts
-*/
+        MDNSResponder::hasAnswerTxts
+    */
     bool MDNSResponder::hasAnswerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
                                       const uint32_t                         p_u32AnswerIndex)
     {
         stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         return ((pSQAnswer) && (pSQAnswer->m_u32ContentFlags & ServiceQueryAnswerType_Txts));
     }
 
     /*
-    MDNSResponder::answerTxts
+        MDNSResponder::answerTxts
 
-    Returns all TXT items for the given service as a ';'-separated string.
-    If not already existing; the string is allocated, filled and attached to the answer.
+        Returns all TXT items for the given service as a ';'-separated string.
+        If not already existing; the string is allocated, filled and attached to the answer.
 
-*/
+    */
     const char* MDNSResponder::answerTxts(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery,
                                           const uint32_t                         p_u32AnswerIndex)
     {
         stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         // Fill m_pcTxts (if not already done)
         if ((pSQAnswer) && (pSQAnswer->m_Txts.m_pTxts) && (!pSQAnswer->m_pcTxts))
         {
@@ -1071,19 +1127,20 @@ namespace MDNSImplementation
     }
 
     /*
-    PROBING
-*/
+        PROBING
+    */
 
     /*
-    MDNSResponder::setProbeResultCallback
+        MDNSResponder::setProbeResultCallback
 
-    Set a global callback for probe results. The callback is called, when probing
-    for the host domain (or a service domain, without specific probe result callback)
-    fails or succeeds.
-    In the case of failure, the domain name should be changed via 'setHostname' or 'setServiceName'.
-    When succeeded, the host or service domain will be announced by the MDNS responder.
+        Set a global callback for probe results. The callback is called, when probing
+        for the host domain (or a service domain, without specific probe result callback)
+        fails or succeeds.
+        In the case of failure, the domain name should be changed via 'setHostname' or
+       'setServiceName'. When succeeded, the host or service domain will be announced by the MDNS
+       responder.
 
-*/
+    */
     bool MDNSResponder::setHostProbeResultCallback(MDNSResponder::MDNSHostProbeFn p_fnCallback)
     {
         m_HostProbeInformation.m_fnHostProbeResultCallback = p_fnCallback;
@@ -1094,21 +1151,23 @@ namespace MDNSImplementation
     bool MDNSResponder::setHostProbeResultCallback(MDNSHostProbeFn1 pfn)
     {
         using namespace std::placeholders;
-        return setHostProbeResultCallback([this, pfn](const char* p_pcDomainName, bool p_bProbeResult)
-                                          { pfn(*this, p_pcDomainName, p_bProbeResult); });
+        return setHostProbeResultCallback(
+            [this, pfn](const char* p_pcDomainName, bool p_bProbeResult)
+            { pfn(*this, p_pcDomainName, p_bProbeResult); });
     }
 
     /*
-    MDNSResponder::setServiceProbeResultCallback
+        MDNSResponder::setServiceProbeResultCallback
 
-    Set a service specific callback for probe results. The callback is called, when probing
-    for the service domain fails or succeeds.
-    In the case of failure, the service name should be changed via 'setServiceName'.
-    When succeeded, the service domain will be announced by the MDNS responder.
+        Set a service specific callback for probe results. The callback is called, when probing
+        for the service domain fails or succeeds.
+        In the case of failure, the service name should be changed via 'setServiceName'.
+        When succeeded, the service domain will be announced by the MDNS responder.
 
-*/
-    bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
-                                                      MDNSResponder::MDNSServiceProbeFn p_fnCallback)
+    */
+    bool
+    MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService p_hService,
+                                                 MDNSResponder::MDNSServiceProbeFn p_fnCallback)
     {
         bool bResult = false;
 
@@ -1122,64 +1181,62 @@ namespace MDNSImplementation
         return bResult;
     }
 
-    bool MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService  p_hService,
-                                                      MDNSResponder::MDNSServiceProbeFn1 p_fnCallback)
+    bool
+    MDNSResponder::setServiceProbeResultCallback(const MDNSResponder::hMDNSService  p_hService,
+                                                 MDNSResponder::MDNSServiceProbeFn1 p_fnCallback)
     {
         using namespace std::placeholders;
-        return setServiceProbeResultCallback(p_hService, [this, p_fnCallback](const char* p_pcServiceName, const hMDNSService p_hMDNSService, bool p_bProbeResult)
-                                             { p_fnCallback(*this, p_pcServiceName, p_hMDNSService, p_bProbeResult); });
+        return setServiceProbeResultCallback(
+            p_hService, [this, p_fnCallback](const char*        p_pcServiceName,
+                                             const hMDNSService p_hMDNSService, bool p_bProbeResult)
+            { p_fnCallback(*this, p_pcServiceName, p_hMDNSService, p_bProbeResult); });
     }
 
     /*
-    MISC
-*/
+        MISC
+    */
 
     /*
-    MDNSResponder::notifyAPChange
+        MDNSResponder::notifyAPChange
 
-    Should be called, whenever the AP for the MDNS responder changes.
-    A bit of this is caught by the event callbacks installed in the constructor.
+        Should be called, whenever the AP for the MDNS responder changes.
+        A bit of this is caught by the event callbacks installed in the constructor.
 
-*/
-    bool MDNSResponder::notifyAPChange(void)
-    {
-        return _restart();
-    }
+    */
+    bool MDNSResponder::notifyAPChange(void) { return _restart(); }
 
     /*
-    MDNSResponder::update
+        MDNSResponder::update
 
-    Should be called in every 'loop'.
+        Should be called in every 'loop'.
 
-*/
-    bool MDNSResponder::update(void)
-    {
-        return _process(true);
-    }
+    */
+    bool MDNSResponder::update(void) { return _process(true); }
 
     /*
-    MDNSResponder::announce
+        MDNSResponder::announce
 
-    Should be called, if the 'configuration' changes. Mainly this will be changes in the TXT items...
-*/
-    bool MDNSResponder::announce(void)
-    {
-        return (_announce(true, true));
-    }
+        Should be called, if the 'configuration' changes. Mainly this will be changes in the TXT
+       items...
+    */
+    bool MDNSResponder::announce(void) { return (_announce(true, true)); }
 
     /*
-    MDNSResponder::enableArduino
+        MDNSResponder::enableArduino
 
-    Enable the OTA update service.
+        Enable the OTA update service.
 
-*/
+    */
     MDNSResponder::hMDNSService MDNSResponder::enableArduino(uint16_t p_u16Port,
                                                              bool     p_bAuthUpload /*= false*/)
     {
         hMDNSService hService = addService(0, "arduino", "tcp", p_u16Port);
         if (hService)
         {
-            if ((!addServiceTxt(hService, "tcp_check", "no")) || (!addServiceTxt(hService, "ssh_upload", "no")) || (!addServiceTxt(hService, "board", STRINGIZE_VALUE_OF(ARDUINO_BOARD))) || (!addServiceTxt(hService, "auth_upload", (p_bAuthUpload) ? "yes" : "no")))
+            if ((!addServiceTxt(hService, "tcp_check", "no"))
+                || (!addServiceTxt(hService, "ssh_upload", "no"))
+                || (!addServiceTxt(hService, "board", STRINGIZE_VALUE_OF(ARDUINO_BOARD)))
+                || (!addServiceTxt(hService, "auth_upload", (p_bAuthUpload) ? "yes" : "no")))
             {
                 removeService(hService);
                 hService = 0;
@@ -1190,13 +1247,13 @@ namespace MDNSImplementation
 
     /*
 
-    MULTICAST GROUPS
+        MULTICAST GROUPS
 
-*/
+    */
 
     /*
-    MDNSResponder::_joinMulticastGroups
-*/
+        MDNSResponder::_joinMulticastGroups
+    */
     bool MDNSResponder::_joinMulticastGroups(void)
     {
         bool bResult = false;
@@ -1210,12 +1267,14 @@ namespace MDNSImplementation
                 ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT;
                 if (!(pNetIf->flags & NETIF_FLAG_IGMP))
                 {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: Setting flag: flags & NETIF_FLAG_IGMP\n")););
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR(
+                        "[MDNSResponder] _createHost: Setting flag: flags & NETIF_FLAG_IGMP\n")););
                     pNetIf->flags |= NETIF_FLAG_IGMP;
 
                     if (ERR_OK != igmp_start(pNetIf))
                     {
-                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_start FAILED!\n")););
+                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                            PSTR("[MDNSResponder] _createHost: igmp_start FAILED!\n")););
                     }
                 }
 
@@ -1225,15 +1284,24 @@ namespace MDNSImplementation
                 }
                 else
                 {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: igmp_joingroup_netif(" NETIFID_STR ": %s) FAILED!\n"),
-                                                       NETIFID_VAL(pNetIf), IPAddress(multicast_addr_V4).toString().c_str()););
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _createHost: igmp_joingroup_netif(" NETIFID_STR
+                             ": %s) FAILED!\n"),
+                        NETIFID_VAL(pNetIf), IPAddress(multicast_addr_V4).toString().c_str()););
                 }
 #endif
 
 #ifdef MDNS_IPV6_SUPPORT
                 ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
-                bResult                     = ((bResult) && (ERR_OK == mld6_joingroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6))));
-                DEBUG_EX_ERR_IF(!bResult, DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _createHost: mld6_joingroup_netif (" NETIFID_STR ") FAILED!\n"), NETIFID_VAL(pNetIf)));
+                bResult
+                    = ((bResult)
+                       && (ERR_OK == mld6_joingroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6))));
+                DEBUG_EX_ERR_IF(
+                    !bResult,
+                    DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _createHost: mld6_joingroup_netif (" NETIFID_STR
+                             ") FAILED!\n"),
+                        NETIFID_VAL(pNetIf)));
 #endif
             }
         }
@@ -1241,8 +1309,8 @@ namespace MDNSImplementation
     }
 
     /*
-    clsLEAmDNS2_Host::_leaveMulticastGroups
-*/
+        clsLEAmDNS2_Host::_leaveMulticastGroups
+    */
     bool MDNSResponder::_leaveMulticastGroups()
     {
         bool bResult = false;
@@ -1263,7 +1331,9 @@ namespace MDNSImplementation
 #endif
 #ifdef MDNS_IPV6_SUPPORT
                 ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT;
-                if (ERR_OK != mld6_leavegroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6) /*&(multicast_addr_V6.u_addr.ip6)*/))
+                if (ERR_OK
+                    != mld6_leavegroup_netif(
+                        pNetIf, ip_2_ip6(&multicast_addr_V6) /*&(multicast_addr_V6.u_addr.ip6)*/))
                 {
                     DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n")););
                 }
@@ -1273,6 +1343,6 @@ namespace MDNSImplementation
         return bResult;
     }
 
-}  //namespace MDNSImplementation
+}  // namespace MDNSImplementation
 
-}  //namespace esp8266
+}  // namespace esp8266
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.h b/libraries/ESP8266mDNS/src/LEAmDNS.h
index 3983b98cac..0b02f69bc8 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS.h
@@ -11,15 +11,19 @@
     A lot of the additions were basically taken from Erik Ekman's lwIP mdns app code.
 
     Supported mDNS features (in some cases somewhat limited):
-    - Presenting a DNS-SD service to interested observers, eg. a http server by presenting _http._tcp service
-    - Support for multi-level compressed names in input; in output only a very simple one-leven full-name compression is implemented
+    - Presenting a DNS-SD service to interested observers, eg. a http server by presenting
+   _http._tcp service
+    - Support for multi-level compressed names in input; in output only a very simple one-leven
+   full-name compression is implemented
     - Probing host and service domains for uniqueness in the local network
-    - Tiebreaking while probing is supported in a very minimalistic way (the 'higher' IP address wins the tiebreak)
+    - Tiebreaking while probing is supported in a very minimalistic way (the 'higher' IP address
+   wins the tiebreak)
     - Announcing available services after successful probing
     - Using fixed service TXT items or
     - Using dynamic service TXT items for presented services (via callback)
     - Remove services (and un-announcing them to the observers by sending goodbye-messages)
-    - Static queries for DNS-SD services (creating a fixed answer set after a certain timeout period)
+    - Static queries for DNS-SD services (creating a fixed answer set after a certain timeout
+   period)
     - Dynamic queries for DNS-SD services with cached and updated answers and user notifications
 
 
@@ -30,19 +34,23 @@
 
     For presenting services:
     In 'setup()':
-      Install a callback for the probing of host (and service) domains via 'MDNS.setProbeResultCallback(probeResultCallback, &userData);'
-      Register DNS-SD services with 'MDNSResponder::hMDNSService hService = MDNS.addService("MyESP", "http", "tcp", 5000);'
-      (Install additional callbacks for the probing of these service domains via 'MDNS.setServiceProbeResultCallback(hService, probeResultCallback, &userData);')
-      Add service TXT items with 'MDNS.addServiceTxt(hService, "c#", "1");' or by installing a service TXT callback
-      using 'MDNS.setDynamicServiceTxtCallback(dynamicServiceTxtCallback, &userData);' or service specific
-      'MDNS.setDynamicServiceTxtCallback(hService, dynamicServiceTxtCallback, &userData);'
+      Install a callback for the probing of host (and service) domains via
+   'MDNS.setProbeResultCallback(probeResultCallback, &userData);' Register DNS-SD services with
+   'MDNSResponder::hMDNSService hService = MDNS.addService("MyESP", "http", "tcp", 5000);' (Install
+   additional callbacks for the probing of these service domains via
+   'MDNS.setServiceProbeResultCallback(hService, probeResultCallback, &userData);') Add service TXT
+   items with 'MDNS.addServiceTxt(hService, "c#", "1");' or by installing a service TXT callback
+      using 'MDNS.setDynamicServiceTxtCallback(dynamicServiceTxtCallback, &userData);' or service
+   specific 'MDNS.setDynamicServiceTxtCallback(hService, dynamicServiceTxtCallback, &userData);'
       Call MDNS.begin("MyHostname");
 
-    In 'probeResultCallback(MDNSResponder* p_MDNSResponder, const char* p_pcDomain, MDNSResponder:hMDNSService p_hService, bool p_bProbeResult, void* p_pUserdata)':
-      Check the probe result and update the host or service domain name if the probe failed
+    In 'probeResultCallback(MDNSResponder* p_MDNSResponder, const char* p_pcDomain,
+   MDNSResponder:hMDNSService p_hService, bool p_bProbeResult, void* p_pUserdata)': Check the probe
+   result and update the host or service domain name if the probe failed
 
-    In 'dynamicServiceTxtCallback(MDNSResponder* p_MDNSResponder, const hMDNSService p_hService, void* p_pUserdata)':
-      Add dynamic TXT items by calling 'MDNS.addDynamicServiceTxt(p_hService, "c#", "1");'
+    In 'dynamicServiceTxtCallback(MDNSResponder* p_MDNSResponder, const hMDNSService p_hService,
+   void* p_pUserdata)': Add dynamic TXT items by calling 'MDNS.addDynamicServiceTxt(p_hService,
+   "c#", "1");'
 
     In loop():
       Call 'MDNS.update();'
@@ -51,15 +59,17 @@
     For querying services:
     Static:
       Call 'uint32_t u32AnswerCount = MDNS.queryService("http", "tcp");'
-      Iterate answers by: 'for (uint32_t u=0; u<u32AnswerCount; ++u) { const char* pHostname = MDNS.answerHostname(u); }'
-      You should call MDNS.removeQuery() sometimes later (when the answers are not needed anymore)
+      Iterate answers by: 'for (uint32_t u=0; u<u32AnswerCount; ++u) { const char* pHostname =
+   MDNS.answerHostname(u); }' You should call MDNS.removeQuery() sometimes later (when the answers
+   are not needed anymore)
 
     Dynamic:
-      Install a dynamic query by calling 'DNSResponder::hMDNSServiceQuery hServiceQuery = MDNS.installServiceQuery("http", "tcp", serviceQueryCallback, &userData);'
-      The callback 'serviceQueryCallback(MDNSResponder* p_MDNSResponder, const hMDNSServiceQuery p_hServiceQuery, uint32_t p_u32AnswerIndex,
-                                         enuServiceQueryAnswerType p_ServiceQueryAnswerType, bool p_bSetContent, void* p_pUserdata)'
-      is called for any change in the answer set.
-      Call 'MDNS.removeServiceQuery(hServiceQuery);' when the answers are not needed anymore
+      Install a dynamic query by calling 'DNSResponder::hMDNSServiceQuery hServiceQuery =
+   MDNS.installServiceQuery("http", "tcp", serviceQueryCallback, &userData);' The callback
+   'serviceQueryCallback(MDNSResponder* p_MDNSResponder, const hMDNSServiceQuery p_hServiceQuery,
+   uint32_t p_u32AnswerIndex, enuServiceQueryAnswerType p_ServiceQueryAnswerType, bool
+   p_bSetContent, void* p_pUserdata)' is called for any change in the answer set. Call
+   'MDNS.removeServiceQuery(hServiceQuery);' when the answers are not needed anymore
 
 
     Reference:
@@ -69,9 +79,9 @@
     PTR (0x0C, srv name):   eg. _http._tcp.local PTR OP TTL MyESP._http._tcp.local
     PTR (0x0C, srv type):   eg. _services._dns-sd._udp.local PTR OP TTL _http._tcp.local
     PTR (0x0C, IP4):        eg. 012.789.456.123.in-addr.arpa PTR OP TTL esp8266.local
-    PTR (0x0C, IP6):        eg. 90.0.0.0.0.0.0.0.0.0.0.0.78.56.34.12.ip6.arpa PTR OP TTL esp8266.local
-    SRV (0x21):             eg. MyESP._http._tcp.local SRV OP TTL PRIORITY WEIGHT PORT esp8266.local
-    TXT (0x10):             eg. MyESP._http._tcp.local TXT OP TTL c#=1
+    PTR (0x0C, IP6):        eg. 90.0.0.0.0.0.0.0.0.0.0.0.78.56.34.12.ip6.arpa PTR OP TTL
+   esp8266.local SRV (0x21):             eg. MyESP._http._tcp.local SRV OP TTL PRIORITY WEIGHT PORT
+   esp8266.local TXT (0x10):             eg. MyESP._http._tcp.local TXT OP TTL c#=1
 
     Some NOT used message types:
     OPT (0x29):             eDNS
@@ -120,7 +130,7 @@ namespace esp8266
 */
 namespace MDNSImplementation
 {
-//this should be defined at build time
+// this should be defined at build time
 #ifndef ARDUINO_BOARD
 #define ARDUINO_BOARD "generic"
 #endif
@@ -167,8 +177,8 @@ namespace MDNSImplementation
 #define MDNS_UDPCONTEXT_TIMEOUT 50
 
     /**
-    MDNSResponder
-*/
+        MDNSResponder
+    */
     class MDNSResponder
     {
     public:
@@ -181,8 +191,10 @@ namespace MDNSImplementation
         // Later call MDNS::update() in every 'loop' to run the process loop
         // (probing, announcing, responding, ...)
         // if interfaceAddress is not specified, default interface is STA, or AP when STA is not set
-        bool begin(const char* p_pcHostname, const IPAddress& p_IPAddress = INADDR_ANY, uint32_t p_u32TTL = 120 /*ignored*/);
-        bool begin(const String& p_strHostname, const IPAddress& p_IPAddress = INADDR_ANY, uint32_t p_u32TTL = 120 /*ignored*/)
+        bool begin(const char* p_pcHostname, const IPAddress& p_IPAddress = INADDR_ANY,
+                   uint32_t p_u32TTL = 120 /*ignored*/);
+        bool begin(const String& p_strHostname, const IPAddress& p_IPAddress = INADDR_ANY,
+                   uint32_t p_u32TTL = 120 /*ignored*/)
         {
             return begin(p_strHostname.c_str(), p_IPAddress, p_u32TTL);
         }
@@ -198,103 +210,75 @@ namespace MDNSImplementation
         // for compatibility...
         bool setHostname(const String& p_strHostname);
 
-        bool isRunning(void)
-        {
-            return (m_pUDPContext != 0);
-        }
+        bool isRunning(void) { return (m_pUDPContext != 0); }
 
         /**
-        hMDNSService (opaque handle to access the service)
-    */
+            hMDNSService (opaque handle to access the service)
+        */
         typedef const void* hMDNSService;
 
-        // Add a new service to the MDNS responder. If no name (instance name) is given (p_pcName = 0)
-        // the current hostname is used. If the hostname is changed later, the instance names for
+        // Add a new service to the MDNS responder. If no name (instance name) is given (p_pcName =
+        // 0) the current hostname is used. If the hostname is changed later, the instance names for
         // these 'auto-named' services are changed to the new name also (and probing is restarted).
         // The usual '_' before p_pcService (eg. http) and protocol (eg. tcp) may be given.
-        hMDNSService addService(const char* p_pcName,
-                                const char* p_pcService,
-                                const char* p_pcProtocol,
-                                uint16_t    p_u16Port);
+        hMDNSService addService(const char* p_pcName, const char* p_pcService,
+                                const char* p_pcProtocol, uint16_t p_u16Port);
         // Removes a service from the MDNS responder
         bool removeService(const hMDNSService p_hService);
-        bool removeService(const char* p_pcInstanceName,
-                           const char* p_pcServiceName,
+        bool removeService(const char* p_pcInstanceName, const char* p_pcServiceName,
                            const char* p_pcProtocol);
         // for compatibility...
-        bool addService(const String& p_strServiceName,
-                        const String& p_strProtocol,
-                        uint16_t      p_u16Port);
+        bool addService(const String& p_strServiceName, const String& p_strProtocol,
+                        uint16_t p_u16Port);
 
         // Change the services instance name (and restart probing).
-        bool setServiceName(const hMDNSService p_hService,
-                            const char*        p_pcInstanceName);
-        //for compatibility
-        //Warning: this has the side effect of changing the hostname.
-        //TODO: implement instancename different from hostname
-        void setInstanceName(const char* p_pcHostname)
-        {
-            setHostname(p_pcHostname);
-        }
+        bool setServiceName(const hMDNSService p_hService, const char* p_pcInstanceName);
+        // for compatibility
+        // Warning: this has the side effect of changing the hostname.
+        // TODO: implement instancename different from hostname
+        void setInstanceName(const char* p_pcHostname) { setHostname(p_pcHostname); }
         // for esp32 compatibility
-        void setInstanceName(const String& s_pcHostname)
-        {
-            setInstanceName(s_pcHostname.c_str());
-        }
+        void setInstanceName(const String& s_pcHostname) { setInstanceName(s_pcHostname.c_str()); }
 
         /**
-        hMDNSTxt (opaque handle to access the TXT items)
-    */
+            hMDNSTxt (opaque handle to access the TXT items)
+        */
         typedef void* hMDNSTxt;
 
         // Add a (static) MDNS TXT item ('key' = 'value') to the service
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                               const char*        p_pcKey,
-                               const char*        p_pcValue);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                               const char*        p_pcKey,
-                               uint32_t           p_u32Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                               const char*        p_pcKey,
-                               uint16_t           p_u16Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                               const char*        p_pcKey,
-                               uint8_t            p_u8Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                               const char*        p_pcKey,
-                               int32_t            p_i32Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                               const char*        p_pcKey,
-                               int16_t            p_i16Value);
-        hMDNSTxt addServiceTxt(const hMDNSService p_hService,
-                               const char*        p_pcKey,
-                               int8_t             p_i8Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService, const char* p_pcKey,
+                               const char* p_pcValue);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService, const char* p_pcKey,
+                               uint32_t p_u32Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService, const char* p_pcKey,
+                               uint16_t p_u16Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService, const char* p_pcKey,
+                               uint8_t p_u8Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService, const char* p_pcKey,
+                               int32_t p_i32Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService, const char* p_pcKey,
+                               int16_t p_i16Value);
+        hMDNSTxt addServiceTxt(const hMDNSService p_hService, const char* p_pcKey,
+                               int8_t p_i8Value);
 
         // Remove an existing (static) MDNS TXT item from the service
-        bool removeServiceTxt(const hMDNSService p_hService,
-                              const hMDNSTxt     p_hTxt);
-        bool removeServiceTxt(const hMDNSService p_hService,
-                              const char*        p_pcKey);
-        bool removeServiceTxt(const char* p_pcinstanceName,
-                              const char* p_pcServiceName,
-                              const char* p_pcProtocol,
-                              const char* p_pcKey);
+        bool removeServiceTxt(const hMDNSService p_hService, const hMDNSTxt p_hTxt);
+        bool removeServiceTxt(const hMDNSService p_hService, const char* p_pcKey);
+        bool removeServiceTxt(const char* p_pcinstanceName, const char* p_pcServiceName,
+                              const char* p_pcProtocol, const char* p_pcKey);
         // for compatibility...
-        bool addServiceTxt(const char* p_pcService,
-                           const char* p_pcProtocol,
-                           const char* p_pcKey,
+        bool addServiceTxt(const char* p_pcService, const char* p_pcProtocol, const char* p_pcKey,
                            const char* p_pcValue);
-        bool addServiceTxt(const String& p_strService,
-                           const String& p_strProtocol,
-                           const String& p_strKey,
-                           const String& p_strValue);
+        bool addServiceTxt(const String& p_strService, const String& p_strProtocol,
+                           const String& p_strKey, const String& p_strValue);
 
         /**
-        MDNSDynamicServiceTxtCallbackFn
-        Callback function for dynamic MDNS TXT items
-    */
+            MDNSDynamicServiceTxtCallbackFn
+            Callback function for dynamic MDNS TXT items
+        */
 
-        typedef std::function<void(const hMDNSService p_hService)> MDNSDynamicServiceTxtCallbackFunc;
+        typedef std::function<void(const hMDNSService p_hService)>
+            MDNSDynamicServiceTxtCallbackFunc;
 
         // Set a global callback for dynamic MDNS TXT items. The callback function is called
         // every time, a TXT item is needed for one of the installed services.
@@ -307,40 +291,31 @@ namespace MDNSImplementation
         // Add a (dynamic) MDNS TXT item ('key' = 'value') to the service
         // Dynamic TXT items are removed right after one-time use. So they need to be added
         // every time the value s needed (via callback).
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                      const char*  p_pcKey,
-                                      const char*  p_pcValue);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                      const char*  p_pcKey,
-                                      uint32_t     p_u32Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                      const char*  p_pcKey,
-                                      uint16_t     p_u16Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                      const char*  p_pcKey,
-                                      uint8_t      p_u8Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                      const char*  p_pcKey,
-                                      int32_t      p_i32Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                      const char*  p_pcKey,
-                                      int16_t      p_i16Value);
-        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService,
-                                      const char*  p_pcKey,
-                                      int8_t       p_i8Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService, const char* p_pcKey,
+                                      const char* p_pcValue);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService, const char* p_pcKey,
+                                      uint32_t p_u32Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService, const char* p_pcKey,
+                                      uint16_t p_u16Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService, const char* p_pcKey,
+                                      uint8_t p_u8Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService, const char* p_pcKey,
+                                      int32_t p_i32Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService, const char* p_pcKey,
+                                      int16_t p_i16Value);
+        hMDNSTxt addDynamicServiceTxt(hMDNSService p_hService, const char* p_pcKey,
+                                      int8_t p_i8Value);
 
         // Perform a (static) service query. The function returns after p_u16Timeout milliseconds
         // The answers (the number of received answers is returned) can be retrieved by calling
         // - answerHostname (or hostname)
         // - answerIP (or IP)
         // - answerPort (or port)
-        uint32_t queryService(const char*    p_pcService,
-                              const char*    p_pcProtocol,
+        uint32_t queryService(const char* p_pcService, const char* p_pcProtocol,
                               const uint16_t p_u16Timeout = MDNS_QUERYSERVICES_WAIT_TIME);
         bool     removeQuery(void);
         // for compatibility...
-        uint32_t queryService(const String& p_strService,
-                              const String& p_strProtocol);
+        uint32_t queryService(const String& p_strService, const String& p_strProtocol);
 
         const char* answerHostname(const uint32_t p_u32AnswerIndex);
         IPAddress   answerIP(const uint32_t p_u32AnswerIndex);
@@ -351,13 +326,13 @@ namespace MDNSImplementation
         uint16_t  port(const uint32_t p_u32AnswerIndex);
 
         /**
-        hMDNSServiceQuery (opaque handle to access dynamic service queries)
-    */
+            hMDNSServiceQuery (opaque handle to access dynamic service queries)
+        */
         typedef const void* hMDNSServiceQuery;
 
         /**
-        enuServiceQueryAnswerType
-    */
+            enuServiceQueryAnswerType
+        */
         typedef enum _enuServiceQueryAnswerType
         {
             ServiceQueryAnswerType_ServiceDomain     = (1 << 0),  // Service instance name
@@ -386,14 +361,15 @@ namespace MDNSImplementation
         };
 
         /**
-        MDNSServiceQueryCallbackFn
-        Callback function for received answers for dynamic service queries
-    */
+            MDNSServiceQueryCallbackFn
+            Callback function for received answers for dynamic service queries
+        */
         struct MDNSServiceInfo;  // forward declaration
-        typedef std::function<void(const MDNSServiceInfo& mdnsServiceInfo,
-                                   AnswerType             answerType,    // flag for the updated answer item
-                                   bool                   p_bSetContent  // true: Answer component set, false: component deleted
-                                   )>
+        typedef std::function<void(
+            const MDNSServiceInfo& mdnsServiceInfo,
+            AnswerType             answerType,  // flag for the updated answer item
+            bool p_bSetContent  // true: Answer component set, false: component deleted
+            )>
             MDNSServiceQueryCallbackFunc;
 
         // Install a dynamic service query. For every received answer (part) the given callback
@@ -407,14 +383,14 @@ namespace MDNSImplementation
         // - hasAnswerIP6Address/answerIP6Address
         // - hasAnswerPort/answerPort
         // - hasAnswerTxts/answerTxts
-        hMDNSServiceQuery installServiceQuery(const char*                  p_pcService,
-                                              const char*                  p_pcProtocol,
+        hMDNSServiceQuery installServiceQuery(const char* p_pcService, const char* p_pcProtocol,
                                               MDNSServiceQueryCallbackFunc p_fnCallback);
         // Remove a dynamic service query
         bool removeServiceQuery(hMDNSServiceQuery p_hServiceQuery);
 
-        uint32_t                                    answerCount(const hMDNSServiceQuery p_hServiceQuery);
-        std::vector<MDNSResponder::MDNSServiceInfo> answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery);
+        uint32_t answerCount(const hMDNSServiceQuery p_hServiceQuery);
+        std::vector<MDNSResponder::MDNSServiceInfo>
+        answerInfo(const MDNSResponder::hMDNSServiceQuery p_hServiceQuery);
 
         const char* answerServiceDomain(const hMDNSServiceQuery p_hServiceQuery,
                                         const uint32_t          p_u32AnswerIndex);
@@ -451,27 +427,22 @@ namespace MDNSImplementation
                                const uint32_t          p_u32AnswerIndex);
 
         /**
-        MDNSProbeResultCallbackFn
-        Callback function for (host and service domain) probe results
-    */
-        typedef std::function<void(const char* p_pcDomainName,
-                                   bool        p_bProbeResult)>
+            MDNSProbeResultCallbackFn
+            Callback function for (host and service domain) probe results
+        */
+        typedef std::function<void(const char* p_pcDomainName, bool p_bProbeResult)>
             MDNSHostProbeFn;
 
-        typedef std::function<void(MDNSResponder& resp,
-                                   const char*    p_pcDomainName,
-                                   bool           p_bProbeResult)>
+        typedef std::function<void(MDNSResponder& resp, const char* p_pcDomainName,
+                                   bool p_bProbeResult)>
             MDNSHostProbeFn1;
 
-        typedef std::function<void(const char*        p_pcServiceName,
-                                   const hMDNSService p_hMDNSService,
-                                   bool               p_bProbeResult)>
+        typedef std::function<void(const char* p_pcServiceName, const hMDNSService p_hMDNSService,
+                                   bool p_bProbeResult)>
             MDNSServiceProbeFn;
 
-        typedef std::function<void(MDNSResponder&     resp,
-                                   const char*        p_pcServiceName,
-                                   const hMDNSService p_hMDNSService,
-                                   bool               p_bProbeResult)>
+        typedef std::function<void(MDNSResponder& resp, const char* p_pcServiceName,
+                                   const hMDNSService p_hMDNSService, bool p_bProbeResult)>
             MDNSServiceProbeFn1;
 
         // Set a global callback function for host and service probe results
@@ -499,32 +470,27 @@ namespace MDNSImplementation
         bool announce(void);
 
         // Enable OTA update
-        hMDNSService enableArduino(uint16_t p_u16Port,
-                                   bool     p_bAuthUpload = false);
+        hMDNSService enableArduino(uint16_t p_u16Port, bool p_bAuthUpload = false);
 
         // Domain name helper
-        static bool indexDomain(char*&      p_rpcDomain,
-                                const char* p_pcDivider       = "-",
+        static bool indexDomain(char*& p_rpcDomain, const char* p_pcDivider = "-",
                                 const char* p_pcDefaultDomain = 0);
 
         /** STRUCTS **/
 
     public:
         /**
-        MDNSServiceInfo, used in application callbacks
-    */
+            MDNSServiceInfo, used in application callbacks
+        */
         struct MDNSServiceInfo
         {
-            MDNSServiceInfo(MDNSResponder& p_pM, MDNSResponder::hMDNSServiceQuery p_hS, uint32_t p_u32A) :
+            MDNSServiceInfo(MDNSResponder& p_pM, MDNSResponder::hMDNSServiceQuery p_hS,
+                            uint32_t p_u32A) :
                 p_pMDNSResponder(p_pM),
-                p_hServiceQuery(p_hS),
-                p_u32AnswerIndex(p_u32A) {};
+                p_hServiceQuery(p_hS), p_u32AnswerIndex(p_u32A) {};
             struct CompareKey
             {
-                bool operator()(char const* a, char const* b) const
-                {
-                    return strcmp(a, b) < 0;
-                }
+                bool operator()(char const* a, char const* b) const { return strcmp(a, b) < 0; }
             };
             using KeyValueMap = std::map<const char*, const char*, CompareKey>;
 
@@ -545,7 +511,9 @@ namespace MDNSImplementation
             }
             const char* hostDomain()
             {
-                return (hostDomainAvailable()) ? p_pMDNSResponder.answerHostDomain(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
+                return (hostDomainAvailable()) ?
+                           p_pMDNSResponder.answerHostDomain(p_hServiceQuery, p_u32AnswerIndex) :
+                           nullptr;
             };
             bool hostPortAvailable()
             {
@@ -553,7 +521,9 @@ namespace MDNSImplementation
             }
             uint16_t hostPort()
             {
-                return (hostPortAvailable()) ? p_pMDNSResponder.answerPort(p_hServiceQuery, p_u32AnswerIndex) : 0;
+                return (hostPortAvailable()) ?
+                           p_pMDNSResponder.answerPort(p_hServiceQuery, p_u32AnswerIndex) :
+                           0;
             };
             bool IP4AddressAvailable()
             {
@@ -564,10 +534,12 @@ namespace MDNSImplementation
                 std::vector<IPAddress> internalIP;
                 if (IP4AddressAvailable())
                 {
-                    uint16_t cntIP4Adress = p_pMDNSResponder.answerIP4AddressCount(p_hServiceQuery, p_u32AnswerIndex);
+                    uint16_t cntIP4Adress
+                        = p_pMDNSResponder.answerIP4AddressCount(p_hServiceQuery, p_u32AnswerIndex);
                     for (uint32_t u2 = 0; u2 < cntIP4Adress; ++u2)
                     {
-                        internalIP.emplace_back(p_pMDNSResponder.answerIP4Address(p_hServiceQuery, p_u32AnswerIndex, u2));
+                        internalIP.emplace_back(p_pMDNSResponder.answerIP4Address(
+                            p_hServiceQuery, p_u32AnswerIndex, u2));
                     }
                 }
                 return internalIP;
@@ -578,15 +550,20 @@ namespace MDNSImplementation
             }
             const char* strKeyValue()
             {
-                return (txtAvailable()) ? p_pMDNSResponder.answerTxts(p_hServiceQuery, p_u32AnswerIndex) : nullptr;
+                return (txtAvailable()) ?
+                           p_pMDNSResponder.answerTxts(p_hServiceQuery, p_u32AnswerIndex) :
+                           nullptr;
             };
             const KeyValueMap& keyValues()
             {
                 if (txtAvailable() && keyValueMap.size() == 0)
                 {
-                    for (auto kv = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); kv != nullptr; kv = kv->m_pNext)
+                    for (auto kv
+                         = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex);
+                         kv != nullptr; kv = kv->m_pNext)
                     {
-                        keyValueMap.emplace(std::pair<const char*, const char*>(kv->m_pcKey, kv->m_pcValue));
+                        keyValueMap.emplace(
+                            std::pair<const char*, const char*>(kv->m_pcKey, kv->m_pcValue));
                     }
                 }
                 return keyValueMap;
@@ -595,7 +572,9 @@ namespace MDNSImplementation
             {
                 char* result = nullptr;
 
-                for (stcMDNSServiceTxt* pTxt = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex); pTxt; pTxt = pTxt->m_pNext)
+                for (stcMDNSServiceTxt* pTxt
+                     = p_pMDNSResponder._answerKeyValue(p_hServiceQuery, p_u32AnswerIndex);
+                     pTxt; pTxt = pTxt->m_pNext)
                 {
                     if ((key) && (0 == strcmp(pTxt->m_pcKey, key)))
                     {
@@ -609,8 +588,8 @@ namespace MDNSImplementation
 
     protected:
         /**
-        stcMDNSServiceTxt
-    */
+            stcMDNSServiceTxt
+        */
         struct stcMDNSServiceTxt
         {
             stcMDNSServiceTxt* m_pNext;
@@ -618,9 +597,8 @@ namespace MDNSImplementation
             char*              m_pcValue;
             bool               m_bTemp;
 
-            stcMDNSServiceTxt(const char* p_pcKey   = 0,
-                              const char* p_pcValue = 0,
-                              bool        p_bTemp   = false);
+            stcMDNSServiceTxt(const char* p_pcKey = 0, const char* p_pcValue = 0,
+                              bool p_bTemp = false);
             stcMDNSServiceTxt(const stcMDNSServiceTxt& p_Other);
             ~stcMDNSServiceTxt(void);
 
@@ -628,20 +606,16 @@ namespace MDNSImplementation
             bool               clear(void);
 
             char* allocKey(size_t p_stLength);
-            bool  setKey(const char* p_pcKey,
-                         size_t      p_stLength);
+            bool  setKey(const char* p_pcKey, size_t p_stLength);
             bool  setKey(const char* p_pcKey);
             bool  releaseKey(void);
 
             char* allocValue(size_t p_stLength);
-            bool  setValue(const char* p_pcValue,
-                           size_t      p_stLength);
+            bool  setValue(const char* p_pcValue, size_t p_stLength);
             bool  setValue(const char* p_pcValue);
             bool  releaseValue(void);
 
-            bool set(const char* p_pcKey,
-                     const char* p_pcValue,
-                     bool        p_bTemp = false);
+            bool set(const char* p_pcKey, const char* p_pcValue, bool p_bTemp = false);
 
             bool update(const char* p_pcValue);
 
@@ -649,8 +623,8 @@ namespace MDNSImplementation
         };
 
         /**
-        stcMDNSTxts
-    */
+            stcMDNSTxts
+        */
         struct stcMDNSServiceTxts
         {
             stcMDNSServiceTxt* m_pTxts;
@@ -686,8 +660,8 @@ namespace MDNSImplementation
         };
 
         /**
-        enuContentFlags
-    */
+            enuContentFlags
+        */
         typedef enum _enuContentFlags
         {
             // Host
@@ -703,8 +677,8 @@ namespace MDNSImplementation
         } enuContentFlags;
 
         /**
-        stcMDNS_MsgHeader
-    */
+            stcMDNS_MsgHeader
+        */
         struct stcMDNS_MsgHeader
         {
             uint16_t      m_u16ID;         // Identifier
@@ -721,23 +695,16 @@ namespace MDNSImplementation
             uint16_t      m_u16NSCount;    // Authority Record count
             uint16_t      m_u16ARCount;    // Additional Record count
 
-            stcMDNS_MsgHeader(uint16_t      p_u16ID      = 0,
-                              bool          p_bQR        = false,
-                              unsigned char p_ucOpcode   = 0,
-                              bool          p_bAA        = false,
-                              bool          p_bTC        = false,
-                              bool          p_bRD        = false,
-                              bool          p_bRA        = false,
-                              unsigned char p_ucRCode    = 0,
-                              uint16_t      p_u16QDCount = 0,
-                              uint16_t      p_u16ANCount = 0,
-                              uint16_t      p_u16NSCount = 0,
-                              uint16_t      p_u16ARCount = 0);
+            stcMDNS_MsgHeader(uint16_t p_u16ID = 0, bool p_bQR = false,
+                              unsigned char p_ucOpcode = 0, bool p_bAA = false, bool p_bTC = false,
+                              bool p_bRD = false, bool p_bRA = false, unsigned char p_ucRCode = 0,
+                              uint16_t p_u16QDCount = 0, uint16_t p_u16ANCount = 0,
+                              uint16_t p_u16NSCount = 0, uint16_t p_u16ARCount = 0);
         };
 
         /**
-        stcMDNS_RRDomain
-    */
+            stcMDNS_RRDomain
+        */
         struct stcMDNS_RRDomain
         {
             char     m_acName[MDNS_DOMAIN_MAXLENGTH];  // Encoded domain name
@@ -750,8 +717,7 @@ namespace MDNSImplementation
 
             bool clear(void);
 
-            bool addLabel(const char* p_pcLabel,
-                          bool        p_bPrependUnderline = false);
+            bool addLabel(const char* p_pcLabel, bool p_bPrependUnderline = false);
 
             bool compare(const stcMDNS_RRDomain& p_Other) const;
             bool operator==(const stcMDNS_RRDomain& p_Other) const;
@@ -763,8 +729,8 @@ namespace MDNSImplementation
         };
 
         /**
-        stcMDNS_RRAttributes
-    */
+            stcMDNS_RRAttributes
+        */
         struct stcMDNS_RRAttributes
         {
             uint16_t m_u16Type;   // Type
@@ -778,8 +744,8 @@ namespace MDNSImplementation
         };
 
         /**
-        stcMDNS_RRHeader
-    */
+            stcMDNS_RRHeader
+        */
         struct stcMDNS_RRHeader
         {
             stcMDNS_RRDomain     m_Domain;
@@ -794,8 +760,8 @@ namespace MDNSImplementation
         };
 
         /**
-        stcMDNS_RRQuestion
-    */
+            stcMDNS_RRQuestion
+        */
         struct stcMDNS_RRQuestion
         {
             stcMDNS_RRQuestion* m_pNext;
@@ -806,8 +772,8 @@ namespace MDNSImplementation
         };
 
         /**
-        enuAnswerType
-    */
+            enuAnswerType
+        */
         typedef enum _enuAnswerType
         {
             AnswerType_A,
@@ -819,8 +785,8 @@ namespace MDNSImplementation
         } enuAnswerType;
 
         /**
-        stcMDNS_RRAnswer
-    */
+            stcMDNS_RRAnswer
+        */
         struct stcMDNS_RRAnswer
         {
             stcMDNS_RRAnswer*   m_pNext;
@@ -836,21 +802,19 @@ namespace MDNSImplementation
             bool clear(void);
 
         protected:
-            stcMDNS_RRAnswer(enuAnswerType           p_AnswerType,
-                             const stcMDNS_RRHeader& p_Header,
-                             uint32_t                p_u32TTL);
+            stcMDNS_RRAnswer(enuAnswerType p_AnswerType, const stcMDNS_RRHeader& p_Header,
+                             uint32_t p_u32TTL);
         };
 
 #ifdef MDNS_IP4_SUPPORT
         /**
-        stcMDNS_RRAnswerA
-    */
+            stcMDNS_RRAnswerA
+        */
         struct stcMDNS_RRAnswerA: public stcMDNS_RRAnswer
         {
             IPAddress m_IPAddress;
 
-            stcMDNS_RRAnswerA(const stcMDNS_RRHeader& p_Header,
-                              uint32_t                p_u32TTL);
+            stcMDNS_RRAnswerA(const stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL);
             ~stcMDNS_RRAnswerA(void);
 
             bool clear(void);
@@ -858,28 +822,26 @@ namespace MDNSImplementation
 #endif
 
         /**
-        stcMDNS_RRAnswerPTR
-    */
+            stcMDNS_RRAnswerPTR
+        */
         struct stcMDNS_RRAnswerPTR: public stcMDNS_RRAnswer
         {
             stcMDNS_RRDomain m_PTRDomain;
 
-            stcMDNS_RRAnswerPTR(const stcMDNS_RRHeader& p_Header,
-                                uint32_t                p_u32TTL);
+            stcMDNS_RRAnswerPTR(const stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL);
             ~stcMDNS_RRAnswerPTR(void);
 
             bool clear(void);
         };
 
         /**
-        stcMDNS_RRAnswerTXT
-    */
+            stcMDNS_RRAnswerTXT
+        */
         struct stcMDNS_RRAnswerTXT: public stcMDNS_RRAnswer
         {
             stcMDNSServiceTxts m_Txts;
 
-            stcMDNS_RRAnswerTXT(const stcMDNS_RRHeader& p_Header,
-                                uint32_t                p_u32TTL);
+            stcMDNS_RRAnswerTXT(const stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL);
             ~stcMDNS_RRAnswerTXT(void);
 
             bool clear(void);
@@ -887,14 +849,13 @@ namespace MDNSImplementation
 
 #ifdef MDNS_IP6_SUPPORT
         /**
-        stcMDNS_RRAnswerAAAA
-    */
+            stcMDNS_RRAnswerAAAA
+        */
         struct stcMDNS_RRAnswerAAAA: public stcMDNS_RRAnswer
         {
-            //TODO: IP6Address          m_IPAddress;
+            // TODO: IP6Address          m_IPAddress;
 
-            stcMDNS_RRAnswerAAAA(const stcMDNS_RRHeader& p_Header,
-                                 uint32_t                p_u32TTL);
+            stcMDNS_RRAnswerAAAA(const stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL);
             ~stcMDNS_RRAnswerAAAA(void);
 
             bool clear(void);
@@ -902,8 +863,8 @@ namespace MDNSImplementation
 #endif
 
         /**
-        stcMDNS_RRAnswerSRV
-    */
+            stcMDNS_RRAnswerSRV
+        */
         struct stcMDNS_RRAnswerSRV: public stcMDNS_RRAnswer
         {
             uint16_t         m_u16Priority;
@@ -911,31 +872,29 @@ namespace MDNSImplementation
             uint16_t         m_u16Port;
             stcMDNS_RRDomain m_SRVDomain;
 
-            stcMDNS_RRAnswerSRV(const stcMDNS_RRHeader& p_Header,
-                                uint32_t                p_u32TTL);
+            stcMDNS_RRAnswerSRV(const stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL);
             ~stcMDNS_RRAnswerSRV(void);
 
             bool clear(void);
         };
 
         /**
-        stcMDNS_RRAnswerGeneric
-    */
+            stcMDNS_RRAnswerGeneric
+        */
         struct stcMDNS_RRAnswerGeneric: public stcMDNS_RRAnswer
         {
             uint16_t m_u16RDLength;  // Length of variable answer
             uint8_t* m_pu8RDData;    // Offset of start of variable answer in packet
 
-            stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
-                                    uint32_t                p_u32TTL);
+            stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL);
             ~stcMDNS_RRAnswerGeneric(void);
 
             bool clear(void);
         };
 
         /**
-        enuProbingStatus
-    */
+            enuProbingStatus
+        */
         typedef enum _enuProbingStatus
         {
             ProbingStatus_WaitingForData,
@@ -945,14 +904,15 @@ namespace MDNSImplementation
         } enuProbingStatus;
 
         /**
-        stcProbeInformation
-    */
+            stcProbeInformation
+        */
         struct stcProbeInformation
         {
             enuProbingStatus                  m_ProbingStatus;
             uint8_t                           m_u8SentCount;  // Used for probes and announcements
             esp8266::polledTimeout::oneShotMs m_Timeout;      // Used for probes and announcements
-            //clsMDNSTimeFlag                   m_TimeFlag;     // Used for probes and announcements
+            // clsMDNSTimeFlag                   m_TimeFlag;     // Used for probes and
+            // announcements
             bool               m_bConflict;
             bool               m_bTiebreakNeeded;
             MDNSHostProbeFn    m_fnHostProbeResultCallback;
@@ -964,23 +924,22 @@ namespace MDNSImplementation
         };
 
         /**
-        stcMDNSService
-    */
+            stcMDNSService
+        */
         struct stcMDNSService
         {
-            stcMDNSService*                   m_pNext;
-            char*                             m_pcName;
-            bool                              m_bAutoName;  // Name was set automatically to hostname (if no name was supplied)
-            char*                             m_pcService;
-            char*                             m_pcProtocol;
+            stcMDNSService* m_pNext;
+            char*           m_pcName;
+            bool  m_bAutoName;  // Name was set automatically to hostname (if no name was supplied)
+            char* m_pcService;
+            char* m_pcProtocol;
             uint16_t                          m_u16Port;
             uint8_t                           m_u8ReplyMask;
             stcMDNSServiceTxts                m_Txts;
             MDNSDynamicServiceTxtCallbackFunc m_fnTxtCallback;
             stcProbeInformation               m_ProbeInformation;
 
-            stcMDNSService(const char* p_pcName     = 0,
-                           const char* p_pcService  = 0,
+            stcMDNSService(const char* p_pcName = 0, const char* p_pcService = 0,
                            const char* p_pcProtocol = 0);
             ~stcMDNSService(void);
 
@@ -995,27 +954,27 @@ namespace MDNSImplementation
         };
 
         /**
-        stcMDNSServiceQuery
-    */
+            stcMDNSServiceQuery
+        */
         struct stcMDNSServiceQuery
         {
             /**
-            stcAnswer
-        */
+                stcAnswer
+            */
             struct stcAnswer
             {
                 /**
-                stcTTL
-            */
+                    stcTTL
+                */
                 struct stcTTL
                 {
                     /**
-                    timeoutLevel_t
-                */
+                        timeoutLevel_t
+                    */
                     typedef uint8_t timeoutLevel_t;
                     /**
-                    TIMEOUTLEVELs
-                */
+                        TIMEOUTLEVELs
+                    */
                     const timeoutLevel_t TIMEOUTLEVEL_UNSET    = 0;
                     const timeoutLevel_t TIMEOUTLEVEL_BASE     = 80;
                     const timeoutLevel_t TIMEOUTLEVEL_INTERVAL = 5;
@@ -1040,51 +999,53 @@ namespace MDNSImplementation
                 };
 #ifdef MDNS_IP4_SUPPORT
                 /**
-                stcIP4Address
-            */
+                    stcIP4Address
+                */
                 struct stcIP4Address
                 {
                     stcIP4Address* m_pNext;
                     IPAddress      m_IPAddress;
                     stcTTL         m_TTL;
 
-                    stcIP4Address(IPAddress p_IPAddress,
-                                  uint32_t  p_u32TTL = 0);
+                    stcIP4Address(IPAddress p_IPAddress, uint32_t p_u32TTL = 0);
                 };
 #endif
 #ifdef MDNS_IP6_SUPPORT
                 /**
-                stcIP6Address
-            */
+                    stcIP6Address
+                */
                 struct stcIP6Address
                 {
                     stcIP6Address* m_pNext;
                     IP6Address     m_IPAddress;
                     stcTTL         m_TTL;
 
-                    stcIP6Address(IPAddress p_IPAddress,
-                                  uint32_t  p_u32TTL = 0);
+                    stcIP6Address(IPAddress p_IPAddress, uint32_t p_u32TTL = 0);
                 };
 #endif
 
                 stcAnswer* m_pNext;
-                // The service domain is the first 'answer' (from PTR answer, using service and protocol) to be set
-                // Defines the key for additional answer, like host domain, etc.
-                stcMDNS_RRDomain   m_ServiceDomain;  // 1. level answer (PTR), eg. MyESP._http._tcp.local
-                char*              m_pcServiceDomain;
-                stcTTL             m_TTLServiceDomain;
-                stcMDNS_RRDomain   m_HostDomain;  // 2. level answer (SRV, using service domain), eg. esp8266.local
-                char*              m_pcHostDomain;
-                uint16_t           m_u16Port;  // 2. level answer (SRV, using service domain), eg. 5000
-                stcTTL             m_TTLHostDomainAndPort;
+                // The service domain is the first 'answer' (from PTR answer, using service and
+                // protocol) to be set Defines the key for additional answer, like host domain, etc.
+                stcMDNS_RRDomain
+                       m_ServiceDomain;  // 1. level answer (PTR), eg. MyESP._http._tcp.local
+                char*  m_pcServiceDomain;
+                stcTTL m_TTLServiceDomain;
+                stcMDNS_RRDomain
+                    m_HostDomain;  // 2. level answer (SRV, using service domain), eg. esp8266.local
+                char*    m_pcHostDomain;
+                uint16_t m_u16Port;  // 2. level answer (SRV, using service domain), eg. 5000
+                stcTTL   m_TTLHostDomainAndPort;
                 stcMDNSServiceTxts m_Txts;  // 2. level answer (TXT, using service domain), eg. c#=1
                 char*              m_pcTxts;
                 stcTTL             m_TTLTxts;
 #ifdef MDNS_IP4_SUPPORT
-                stcIP4Address* m_pIP4Addresses;  // 3. level answer (A, using host domain), eg. 123.456.789.012
+                stcIP4Address*
+                    m_pIP4Addresses;  // 3. level answer (A, using host domain), eg. 123.456.789.012
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                stcIP6Address* m_pIP6Addresses;  // 3. level answer (AAAA, using host domain), eg. 1234::09
+                stcIP6Address*
+                    m_pIP6Addresses;  // 3. level answer (AAAA, using host domain), eg. 1234::09
 #endif
                 uint32_t m_u32ContentFlags;
 
@@ -1151,37 +1112,36 @@ namespace MDNSImplementation
         };
 
         /**
-        stcMDNSSendParameter
-    */
+            stcMDNSSendParameter
+        */
         struct stcMDNSSendParameter
         {
         protected:
             /**
-            stcDomainCacheItem
-        */
+                stcDomainCacheItem
+            */
             struct stcDomainCacheItem
             {
                 stcDomainCacheItem* m_pNext;
-                const void*         m_pHostnameOrService;  // Opaque id for host or service domain (pointer)
-                bool                m_bAdditionalData;     // Opaque flag for special info (service domain included)
-                uint16_t            m_u16Offset;           // Offset in UDP output buffer
+                const void* m_pHostnameOrService;  // Opaque id for host or service domain (pointer)
+                bool m_bAdditionalData;  // Opaque flag for special info (service domain included)
+                uint16_t m_u16Offset;    // Offset in UDP output buffer
 
-                stcDomainCacheItem(const void* p_pHostnameOrService,
-                                   bool        p_bAdditionalData,
-                                   uint32_t    p_u16Offset);
+                stcDomainCacheItem(const void* p_pHostnameOrService, bool p_bAdditionalData,
+                                   uint32_t p_u16Offset);
             };
 
         public:
-            uint16_t            m_u16ID;              // Query ID (used only in lagacy queries)
-            stcMDNS_RRQuestion* m_pQuestions;         // A list of queries
-            uint8_t             m_u8HostReplyMask;    // Flags for reply components/answers
-            bool                m_bLegacyQuery;       // Flag: Legacy query
-            bool                m_bResponse;          // Flag: Response to a query
-            bool                m_bAuthorative;       // Flag: Authoritative (owner) response
-            bool                m_bCacheFlush;        // Flag: Clients should flush their caches
-            bool                m_bUnicast;           // Flag: Unicast response
-            bool                m_bUnannounce;        // Flag: Unannounce service
-            uint16_t            m_u16Offset;          // Current offset in UDP write buffer (mainly for domain cache)
+            uint16_t            m_u16ID;            // Query ID (used only in lagacy queries)
+            stcMDNS_RRQuestion* m_pQuestions;       // A list of queries
+            uint8_t             m_u8HostReplyMask;  // Flags for reply components/answers
+            bool                m_bLegacyQuery;     // Flag: Legacy query
+            bool                m_bResponse;        // Flag: Response to a query
+            bool                m_bAuthorative;     // Flag: Authoritative (owner) response
+            bool                m_bCacheFlush;      // Flag: Clients should flush their caches
+            bool                m_bUnicast;         // Flag: Unicast response
+            bool                m_bUnannounce;      // Flag: Unannounce service
+            uint16_t m_u16Offset;  // Current offset in UDP write buffer (mainly for domain cache)
             stcDomainCacheItem* m_pDomainCacheItems;  // Cached host and service domains
 
             stcMDNSSendParameter(void);
@@ -1192,9 +1152,8 @@ namespace MDNSImplementation
 
             bool shiftOffset(uint16_t p_u16Shift);
 
-            bool     addDomainCacheItem(const void* p_pHostnameOrService,
-                                        bool        p_bAdditionalData,
-                                        uint16_t    p_u16Offset);
+            bool     addDomainCacheItem(const void* p_pHostnameOrService, bool p_bAdditionalData,
+                                        uint16_t p_u16Offset);
             uint16_t findCachedDomainOffset(const void* p_pHostnameOrService,
                                             bool        p_bAdditionalData) const;
         };
@@ -1240,10 +1199,8 @@ namespace MDNSImplementation
         bool _cancelProbingForService(stcMDNSService& p_rService);
 
         /* ANNOUNCE */
-        bool _announce(bool p_bAnnounce,
-                       bool p_bIncludeServices);
-        bool _announceService(stcMDNSService& p_rService,
-                              bool            p_bAnnounce = true);
+        bool _announce(bool p_bAnnounce, bool p_bIncludeServices);
+        bool _announceService(stcMDNSService& p_rService, bool p_bAnnounce = true);
 
         /* SERVICE QUERY CACHE */
         bool _hasServiceQueriesWaitingForAnswers(void) const;
@@ -1253,11 +1210,9 @@ namespace MDNSImplementation
         /* SENDING */
         bool _sendMDNSMessage(stcMDNSSendParameter& p_SendParameter);
         bool _sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter);
-        bool _prepareMDNSMessage(stcMDNSSendParameter& p_SendParameter,
-                                 IPAddress             p_IPAddress);
+        bool _prepareMDNSMessage(stcMDNSSendParameter& p_SendParameter, IPAddress p_IPAddress);
         bool _sendMDNSServiceQuery(const stcMDNSServiceQuery& p_ServiceQuery);
-        bool _sendMDNSQuery(const stcMDNS_RRDomain&         p_QueryDomain,
-                            uint16_t                        p_u16QueryType,
+        bool _sendMDNSQuery(const stcMDNS_RRDomain& p_QueryDomain, uint16_t p_u16QueryType,
                             stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers = 0);
 
         uint8_t _replyMaskForHost(const stcMDNS_RRHeader& p_RRHeader,
@@ -1270,37 +1225,28 @@ namespace MDNSImplementation
         bool _readRRQuestion(stcMDNS_RRQuestion& p_rQuestion);
         bool _readRRAnswer(stcMDNS_RRAnswer*& p_rpAnswer);
 #ifdef MDNS_IP4_SUPPORT
-        bool _readRRAnswerA(stcMDNS_RRAnswerA& p_rRRAnswerA,
-                            uint16_t           p_u16RDLength);
+        bool _readRRAnswerA(stcMDNS_RRAnswerA& p_rRRAnswerA, uint16_t p_u16RDLength);
 #endif
-        bool _readRRAnswerPTR(stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
-                              uint16_t             p_u16RDLength);
-        bool _readRRAnswerTXT(stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
-                              uint16_t             p_u16RDLength);
+        bool _readRRAnswerPTR(stcMDNS_RRAnswerPTR& p_rRRAnswerPTR, uint16_t p_u16RDLength);
+        bool _readRRAnswerTXT(stcMDNS_RRAnswerTXT& p_rRRAnswerTXT, uint16_t p_u16RDLength);
 #ifdef MDNS_IP6_SUPPORT
-        bool _readRRAnswerAAAA(stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA,
-                               uint16_t              p_u16RDLength);
+        bool _readRRAnswerAAAA(stcMDNS_RRAnswerAAAA& p_rRRAnswerAAAA, uint16_t p_u16RDLength);
 #endif
-        bool _readRRAnswerSRV(stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
-                              uint16_t             p_u16RDLength);
+        bool _readRRAnswerSRV(stcMDNS_RRAnswerSRV& p_rRRAnswerSRV, uint16_t p_u16RDLength);
         bool _readRRAnswerGeneric(stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
                                   uint16_t                 p_u16RDLength);
 
         bool _readRRHeader(stcMDNS_RRHeader& p_rHeader);
         bool _readRRDomain(stcMDNS_RRDomain& p_rRRDomain);
-        bool _readRRDomain_Loop(stcMDNS_RRDomain& p_rRRDomain,
-                                uint8_t           p_u8Depth);
+        bool _readRRDomain_Loop(stcMDNS_RRDomain& p_rRRDomain, uint8_t p_u8Depth);
         bool _readRRAttributes(stcMDNS_RRAttributes& p_rAttributes);
 
         /* DOMAIN NAMES */
-        bool _buildDomainForHost(const char*       p_pcHostname,
-                                 stcMDNS_RRDomain& p_rHostDomain) const;
+        bool _buildDomainForHost(const char* p_pcHostname, stcMDNS_RRDomain& p_rHostDomain) const;
         bool _buildDomainForDNSSD(stcMDNS_RRDomain& p_rDNSSDDomain) const;
-        bool _buildDomainForService(const stcMDNSService& p_Service,
-                                    bool                  p_bIncludeName,
-                                    stcMDNS_RRDomain&     p_rServiceDomain) const;
-        bool _buildDomainForService(const char*       p_pcService,
-                                    const char*       p_pcProtocol,
+        bool _buildDomainForService(const stcMDNSService& p_Service, bool p_bIncludeName,
+                                    stcMDNS_RRDomain& p_rServiceDomain) const;
+        bool _buildDomainForService(const char* p_pcService, const char* p_pcProtocol,
                                     stcMDNS_RRDomain& p_rServiceDomain) const;
 #ifdef MDNS_IP4_SUPPORT
         bool _buildDomainForReverseIP4(IPAddress         p_IP4Address,
@@ -1312,33 +1258,27 @@ namespace MDNSImplementation
 #endif
 
         /* UDP */
-        bool _udpReadBuffer(unsigned char* p_pBuffer,
-                            size_t         p_stLength);
+        bool _udpReadBuffer(unsigned char* p_pBuffer, size_t p_stLength);
         bool _udpRead8(uint8_t& p_ru8Value);
         bool _udpRead16(uint16_t& p_ru16Value);
         bool _udpRead32(uint32_t& p_ru32Value);
 
-        bool _udpAppendBuffer(const unsigned char* p_pcBuffer,
-                              size_t               p_stLength);
+        bool _udpAppendBuffer(const unsigned char* p_pcBuffer, size_t p_stLength);
         bool _udpAppend8(uint8_t p_u8Value);
         bool _udpAppend16(uint16_t p_u16Value);
         bool _udpAppend32(uint32_t p_u32Value);
 
 #if not defined ESP_8266_MDNS_INCLUDE || defined DEBUG_ESP_MDNS_RESPONDER
         bool _udpDump(bool p_bMovePointer = false);
-        bool _udpDump(unsigned p_uOffset,
-                      unsigned p_uLength);
+        bool _udpDump(unsigned p_uOffset, unsigned p_uLength);
 #endif
 
         /* READ/WRITE MDNS STRUCTS */
         bool _readMDNSMsgHeader(stcMDNS_MsgHeader& p_rMsgHeader);
 
-        bool _write8(uint8_t               p_u8Value,
-                     stcMDNSSendParameter& p_rSendParameter);
-        bool _write16(uint16_t              p_u16Value,
-                      stcMDNSSendParameter& p_rSendParameter);
-        bool _write32(uint32_t              p_u32Value,
-                      stcMDNSSendParameter& p_rSendParameter);
+        bool _write8(uint8_t p_u8Value, stcMDNSSendParameter& p_rSendParameter);
+        bool _write16(uint16_t p_u16Value, stcMDNSSendParameter& p_rSendParameter);
+        bool _write32(uint32_t p_u32Value, stcMDNSSendParameter& p_rSendParameter);
 
         bool _writeMDNSMsgHeader(const stcMDNS_MsgHeader& p_MsgHeader,
                                  stcMDNSSendParameter&    p_rSendParameter);
@@ -1346,11 +1286,9 @@ namespace MDNSImplementation
                                     stcMDNSSendParameter&       p_rSendParameter);
         bool _writeMDNSRRDomain(const stcMDNS_RRDomain& p_Domain,
                                 stcMDNSSendParameter&   p_rSendParameter);
-        bool _writeMDNSHostDomain(const char*           m_pcHostname,
-                                  bool                  p_bPrependRDLength,
+        bool _writeMDNSHostDomain(const char* m_pcHostname, bool p_bPrependRDLength,
                                   stcMDNSSendParameter& p_rSendParameter);
-        bool _writeMDNSServiceDomain(const stcMDNSService& p_Service,
-                                     bool                  p_bIncludeName,
+        bool _writeMDNSServiceDomain(const stcMDNSService& p_Service, bool p_bIncludeName,
                                      bool                  p_bPrependRDLength,
                                      stcMDNSSendParameter& p_rSendParameter);
 
@@ -1358,8 +1296,7 @@ namespace MDNSImplementation
                                 stcMDNSSendParameter& p_rSendParameter);
 
 #ifdef MDNS_IP4_SUPPORT
-        bool _writeMDNSAnswer_A(IPAddress             p_IPAddress,
-                                stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_A(IPAddress p_IPAddress, stcMDNSSendParameter& p_rSendParameter);
         bool _writeMDNSAnswer_PTR_IP4(IPAddress             p_IPAddress,
                                       stcMDNSSendParameter& p_rSendParameter);
 #endif
@@ -1370,8 +1307,7 @@ namespace MDNSImplementation
         bool _writeMDNSAnswer_TXT(stcMDNSService&       p_rService,
                                   stcMDNSSendParameter& p_rSendParameter);
 #ifdef MDNS_IP6_SUPPORT
-        bool _writeMDNSAnswer_AAAA(IPAddress             p_IPAddress,
-                                   stcMDNSSendParameter& p_rSendParameter);
+        bool _writeMDNSAnswer_AAAA(IPAddress p_IPAddress, stcMDNSSendParameter& p_rSendParameter);
         bool _writeMDNSAnswer_PTR_IP6(IPAddress             p_IPAddress,
                                       stcMDNSSendParameter& p_rSendParameter);
 #endif
@@ -1391,57 +1327,45 @@ namespace MDNSImplementation
         stcMDNSServiceQuery* _findServiceQuery(hMDNSServiceQuery p_hServiceQuery);
         stcMDNSServiceQuery* _findLegacyServiceQuery(void);
         bool                 _releaseServiceQueries(void);
-        stcMDNSServiceQuery* _findNextServiceQueryByServiceType(const stcMDNS_RRDomain&    p_ServiceDomain,
-                                                                const stcMDNSServiceQuery* p_pPrevServiceQuery);
+        stcMDNSServiceQuery*
+        _findNextServiceQueryByServiceType(const stcMDNS_RRDomain&    p_ServiceDomain,
+                                           const stcMDNSServiceQuery* p_pPrevServiceQuery);
 
         /* HOSTNAME */
         bool _setHostname(const char* p_pcHostname);
         bool _releaseHostname(void);
 
         /* SERVICE */
-        stcMDNSService* _allocService(const char* p_pcName,
-                                      const char* p_pcService,
-                                      const char* p_pcProtocol,
-                                      uint16_t    p_u16Port);
+        stcMDNSService* _allocService(const char* p_pcName, const char* p_pcService,
+                                      const char* p_pcProtocol, uint16_t p_u16Port);
         bool            _releaseService(stcMDNSService* p_pService);
         bool            _releaseServices(void);
 
-        stcMDNSService* _findService(const char* p_pcName,
-                                     const char* p_pcService,
+        stcMDNSService* _findService(const char* p_pcName, const char* p_pcService,
                                      const char* p_pcProtocol);
         stcMDNSService* _findService(const hMDNSService p_hService);
 
         size_t _countServices(void) const;
 
         /* SERVICE TXT */
-        stcMDNSServiceTxt* _allocServiceTxt(stcMDNSService* p_pService,
-                                            const char*     p_pcKey,
-                                            const char*     p_pcValue,
-                                            bool            p_bTemp);
-        bool               _releaseServiceTxt(stcMDNSService*    p_pService,
-                                              stcMDNSServiceTxt* p_pTxt);
-        stcMDNSServiceTxt* _updateServiceTxt(stcMDNSService*    p_pService,
-                                             stcMDNSServiceTxt* p_pTxt,
-                                             const char*        p_pcValue,
-                                             bool               p_bTemp);
-
-        stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
-                                           const char*     p_pcKey);
-        stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService,
-                                           const hMDNSTxt  p_hTxt);
-
-        stcMDNSServiceTxt* _addServiceTxt(stcMDNSService* p_pService,
-                                          const char*     p_pcKey,
-                                          const char*     p_pcValue,
-                                          bool            p_bTemp);
+        stcMDNSServiceTxt* _allocServiceTxt(stcMDNSService* p_pService, const char* p_pcKey,
+                                            const char* p_pcValue, bool p_bTemp);
+        bool _releaseServiceTxt(stcMDNSService* p_pService, stcMDNSServiceTxt* p_pTxt);
+        stcMDNSServiceTxt* _updateServiceTxt(stcMDNSService* p_pService, stcMDNSServiceTxt* p_pTxt,
+                                             const char* p_pcValue, bool p_bTemp);
+
+        stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService, const char* p_pcKey);
+        stcMDNSServiceTxt* _findServiceTxt(stcMDNSService* p_pService, const hMDNSTxt p_hTxt);
+
+        stcMDNSServiceTxt* _addServiceTxt(stcMDNSService* p_pService, const char* p_pcKey,
+                                          const char* p_pcValue, bool p_bTemp);
 
         stcMDNSServiceTxt* _answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
                                            const uint32_t          p_u32AnswerIndex);
 
         bool                     _collectServiceTxts(stcMDNSService& p_rService);
         bool                     _releaseTempServiceTxts(stcMDNSService& p_rService);
-        const stcMDNSServiceTxt* _serviceTxts(const char* p_pcName,
-                                              const char* p_pcService,
+        const stcMDNSServiceTxt* _serviceTxts(const char* p_pcName, const char* p_pcService,
                                               const char* p_pcProtocol);
 
         /* MISC */
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
index 7abc5a2309..b1cc05faaf 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp
@@ -50,21 +50,21 @@ namespace esp8266
 namespace MDNSImplementation
 {
     /**
-    CONTROL
-*/
+        CONTROL
+    */
 
     /**
-    MAINTENANCE
-*/
+        MAINTENANCE
+    */
 
     /*
-    MDNSResponder::_process
+        MDNSResponder::_process
 
-    Run the MDNS process.
-    Is called, every time the UDPContext receives data AND
-    should be called in every 'loop' by calling 'MDNS::update()'.
+        Run the MDNS process.
+        Is called, every time the UDPContext receives data AND
+        should be called in every 'loop' by calling 'MDNS::update()'.
 
-*/
+    */
     bool MDNSResponder::_process(bool p_bUserContext)
     {
         bool bResult = true;
@@ -74,22 +74,24 @@ namespace MDNSImplementation
             if ((m_pUDPContext) &&        // UDPContext available AND
                 (m_pUDPContext->next()))  // has content
             {
-                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _update: Calling _parseMessage\n")););
+                // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _update: Calling
+                // _parseMessage\n")););
                 bResult = _parseMessage();
-                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parsePacket %s\n"), (bResult ? "succeeded" : "FAILED")););
+                // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parsePacket %s\n"),
+                // (bResult ? "succeeded" : "FAILED")););
             }
         }
         else
         {
-            bResult = _updateProbeStatus() &&  // Probing
-                _checkServiceQueryCache();     // Service query cache check
+            bResult = _updateProbeStatus() &&     // Probing
+                      _checkServiceQueryCache();  // Service query cache check
         }
         return bResult;
     }
 
     /*
-    MDNSResponder::_restart
-*/
+        MDNSResponder::_restart
+    */
     bool MDNSResponder::_restart(void)
     {
         return ((_resetProbeStatus(true /*restart*/)) &&  // Stop and restart probing
@@ -97,21 +99,24 @@ namespace MDNSImplementation
     }
 
     /**
-    RECEIVING
-*/
+        RECEIVING
+    */
 
     /*
-    MDNSResponder::_parseMessage
-*/
+        MDNSResponder::_parseMessage
+    */
     bool MDNSResponder::_parseMessage(void)
     {
         DEBUG_EX_INFO(
-            unsigned long ulStartTime  = millis();
-            unsigned      uStartMemory = ESP.getFreeHeap();
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage (Time: %lu ms, heap: %u bytes, from %s(%u), to %s(%u))\n"), ulStartTime, uStartMemory,
-                                  IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), m_pUDPContext->getRemotePort(),
-                                  IPAddress(m_pUDPContext->getDestAddress()).toString().c_str(), m_pUDPContext->getLocalPort()););
-        //DEBUG_EX_INFO(_udpDump(););
+            unsigned long ulStartTime = millis(); unsigned uStartMemory = ESP.getFreeHeap();
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage (Time: %lu ms, heap: %u "
+                                       "bytes, from %s(%u), to %s(%u))\n"),
+                                  ulStartTime, uStartMemory,
+                                  IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(),
+                                  m_pUDPContext->getRemotePort(),
+                                  IPAddress(m_pUDPContext->getDestAddress()).toString().c_str(),
+                                  m_pUDPContext->getLocalPort()););
+        // DEBUG_EX_INFO(_udpDump(););
 
         bool bResult = false;
 
@@ -122,49 +127,62 @@ namespace MDNSImplementation
             {
                 if (header.m_1bQR)  // Received a response -> answers to a query
                 {
-                    //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading answers: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
+                    // DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage:
+                    // Reading answers: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID,
+                    // header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount,
+                    // header.m_u16ARCount););
                     bResult = _parseResponse(header);
                 }
                 else  // Received a query (Questions)
                 {
-                    //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Reading query: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount););
+                    // DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage:
+                    // Reading query: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), header.m_u16ID,
+                    // header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount,
+                    // header.m_u16ARCount););
                     bResult = _parseQuery(header);
                 }
             }
             else
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Received UNEXPECTED opcode:%u. Ignoring message!\n"), header.m_4bOpcode););
+                DEBUG_EX_ERR(
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Received UNEXPECTED "
+                                               "opcode:%u. Ignoring message!\n"),
+                                          header.m_4bOpcode););
                 m_pUDPContext->flush();
             }
         }
         else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: FAILED to read header\n")););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] _parseMessage: FAILED to read header\n")););
             m_pUDPContext->flush();
         }
-        DEBUG_EX_INFO(
-            unsigned uFreeHeap = ESP.getFreeHeap();
-            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseMessage: Done (%s after %lu ms, ate %i bytes, remaining %u)\n\n"), (bResult ? "Succeeded" : "FAILED"), (millis() - ulStartTime), (uStartMemory - uFreeHeap), uFreeHeap););
+        DEBUG_EX_INFO(unsigned uFreeHeap = ESP.getFreeHeap(); DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] _parseMessage: Done (%s after %lu ms, ate %i bytes, remaining "
+                 "%u)\n\n"),
+            (bResult ? "Succeeded" : "FAILED"), (millis() - ulStartTime),
+            (uStartMemory - uFreeHeap), uFreeHeap););
         return bResult;
     }
 
     /*
-    MDNSResponder::_parseQuery
+        MDNSResponder::_parseQuery
 
-    Queries are of interest in two cases:
-    1. allow for tiebreaking while probing in the case of a race condition between two instances probing for
-      the same name at the same time
-    2. provide answers to questions for our host domain or any presented service
+        Queries are of interest in two cases:
+        1. allow for tiebreaking while probing in the case of a race condition between two instances
+       probing for the same name at the same time
+        2. provide answers to questions for our host domain or any presented service
 
-    When reading the questions, a set of (planned) responses is created, eg. a reverse PTR question for the host domain
-    gets an A (IP address) response, a PTR question for the _services._dns-sd domain gets a PTR (type) response for any
-    registered service, ...
+        When reading the questions, a set of (planned) responses is created, eg. a reverse PTR
+       question for the host domain gets an A (IP address) response, a PTR question for the
+       _services._dns-sd domain gets a PTR (type) response for any registered service, ...
 
-    As any mDNS responder should be able to handle 'legacy' queries (from DNS clients), this case is handled here also.
-    Legacy queries have got only one (unicast) question and are directed to the local DNS port (not the multicast port).
+        As any mDNS responder should be able to handle 'legacy' queries (from DNS clients), this
+       case is handled here also. Legacy queries have got only one (unicast) question and are
+       directed to the local DNS port (not the multicast port).
 
-    1.
-*/
+        1.
+    */
     bool MDNSResponder::_parseQuery(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
     {
         bool bResult = true;
@@ -177,25 +195,31 @@ namespace MDNSImplementation
             if ((bResult = _readRRQuestion(questionRR)))
             {
                 // Define host replies, BUT only answer queries after probing is done
-                u8HostOrServiceReplies = sendParameter.m_u8HostReplyMask |= (((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus))
-                                                                                 ? _replyMaskForHost(questionRR.m_Header, 0)
-                                                                                 : 0);
-                DEBUG_EX_INFO(if (u8HostOrServiceReplies)
-                              {
-                                  DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Host reply needed 0x%X\n"), u8HostOrServiceReplies);
-                              });
+                u8HostOrServiceReplies = sendParameter.m_u8HostReplyMask
+                    |= (((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus)) ?
+                            _replyMaskForHost(questionRR.m_Header, 0) :
+                            0);
+                DEBUG_EX_INFO(if (u8HostOrServiceReplies) {
+                    DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _parseQuery: Host reply needed 0x%X\n"),
+                        u8HostOrServiceReplies);
+                });
 
                 // Check tiebreak need for host domain
                 if (ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus)
                 {
                     bool bFullNameMatch = false;
-                    if ((_replyMaskForHost(questionRR.m_Header, &bFullNameMatch)) && (bFullNameMatch))
+                    if ((_replyMaskForHost(questionRR.m_Header, &bFullNameMatch))
+                        && (bFullNameMatch))
                     {
-                        // We're in 'probing' state and someone is asking for our host domain: this might be
-                        // a race-condition: Two host with the same domain names try simutanously to probe their domains
-                        // See: RFC 6762, 8.2 (Tiebraking)
-                        // However, we're using a max. reduced approach for tiebreaking here: The higher IP-address wins!
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for host domain detected while probing.\n")););
+                        // We're in 'probing' state and someone is asking for our host domain: this
+                        // might be a race-condition: Two host with the same domain names try
+                        // simutanously to probe their domains See: RFC 6762, 8.2 (Tiebraking)
+                        // However, we're using a max. reduced approach for tiebreaking here: The
+                        // higher IP-address wins!
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                            PSTR("[MDNSResponder] _parseQuery: Possible race-condition for host "
+                                 "domain detected while probing.\n")););
 
                         m_HostProbeInformation.m_bTiebreakNeeded = true;
                     }
@@ -205,26 +229,39 @@ namespace MDNSImplementation
                 for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
                 {
                     // Define service replies, BUT only answer queries after probing is done
-                    uint8_t u8ReplyMaskForQuestion = (((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus))
-                                                          ? _replyMaskForService(questionRR.m_Header, *pService, 0)
-                                                          : 0);
+                    uint8_t u8ReplyMaskForQuestion
+                        = (((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus)) ?
+                               _replyMaskForService(questionRR.m_Header, *pService, 0) :
+                               0);
                     u8HostOrServiceReplies |= (pService->m_u8ReplyMask |= u8ReplyMaskForQuestion);
-                    DEBUG_EX_INFO(if (u8ReplyMaskForQuestion)
-                                  {
-                                      DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service reply needed for (%s.%s.%s): 0x%X (%s)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, u8ReplyMaskForQuestion, IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str());
-                                  });
+                    DEBUG_EX_INFO(
+                        if (u8ReplyMaskForQuestion)
+                        {
+                            DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _parseQuery: Service reply needed for "
+                                     "(%s.%s.%s): 0x%X (%s)\n"),
+                                (pService->m_pcName ?: m_pcHostname), pService->m_pcService,
+                                pService->m_pcProtocol, u8ReplyMaskForQuestion,
+                                IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str());
+                        });
 
                     // Check tiebreak need for service domain
                     if (ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus)
                     {
                         bool bFullNameMatch = false;
-                        if ((_replyMaskForService(questionRR.m_Header, *pService, &bFullNameMatch)) && (bFullNameMatch))
+                        if ((_replyMaskForService(questionRR.m_Header, *pService, &bFullNameMatch))
+                            && (bFullNameMatch))
                         {
-                            // We're in 'probing' state and someone is asking for this service domain: this might be
-                            // a race-condition: Two services with the same domain names try simutanously to probe their domains
-                            // See: RFC 6762, 8.2 (Tiebraking)
-                            // However, we're using a max. reduced approach for tiebreaking here: The 'higher' SRV host wins!
-                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Possible race-condition for service domain %s.%s.%s detected while probing.\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                            // We're in 'probing' state and someone is asking for this service
+                            // domain: this might be a race-condition: Two services with the same
+                            // domain names try simutanously to probe their domains See: RFC
+                            // 6762, 8.2 (Tiebraking) However, we're using a max. reduced approach
+                            // for tiebreaking here: The 'higher' SRV host wins!
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _parseQuery: Possible race-condition for "
+                                     "service domain %s.%s.%s detected while probing.\n"),
+                                (pService->m_pcName ?: m_pcHostname), pService->m_pcService,
+                                pService->m_pcProtocol););
 
                             pService->m_ProbeInformation.m_bTiebreakNeeded = true;
                         }
@@ -232,47 +269,70 @@ namespace MDNSImplementation
                 }
 
                 // Handle unicast and legacy specialities
-                // If only one question asks for unicast reply, the whole reply packet is send unicast
-                if (((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) ||  // Unicast (maybe legacy) query OR
+                // If only one question asks for unicast reply, the whole reply packet is send
+                // unicast
+                if (((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort())
+                     ||  // Unicast (maybe legacy) query OR
                      (questionRR.m_bUnicast))
                     &&  // Expressivly unicast query
                     (!sendParameter.m_bUnicast))
                 {
                     sendParameter.m_bUnicast    = true;
                     sendParameter.m_bCacheFlush = false;
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Unicast response for %s!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
-
-                    if ((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) &&  // Unicast (maybe legacy) query AND
-                        (1 == p_MsgHeader.m_u16QDCount) &&                      // Only one question AND
-                        ((sendParameter.m_u8HostReplyMask) ||                   //  Host replies OR
-                         (u8HostOrServiceReplies)))                             //  Host or service replies available
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _parseQuery: Unicast response for %s!\n"),
+                        IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
+
+                    if ((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort())
+                        &&                                     // Unicast (maybe legacy) query AND
+                        (1 == p_MsgHeader.m_u16QDCount) &&     // Only one question AND
+                        ((sendParameter.m_u8HostReplyMask) ||  //  Host replies OR
+                         (u8HostOrServiceReplies)))            //  Host or service replies available
                     {
                         // We're a match for this legacy query, BUT
                         // make sure, that the query comes from a local host
                         ip_info IPInfo_Local;
                         ip_info IPInfo_Remote;
-                        if (((IPInfo_Remote.ip.addr = m_pUDPContext->getRemoteAddress())) && (((wifi_get_ip_info(SOFTAP_IF, &IPInfo_Local)) && (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask))) ||  // Remote IP in SOFTAP's subnet OR
-                                                                                              ((wifi_get_ip_info(STATION_IF, &IPInfo_Local)) && (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip, &IPInfo_Local.netmask)))))  // Remote IP in STATION's subnet
+                        if (((IPInfo_Remote.ip.addr = m_pUDPContext->getRemoteAddress()))
+                            && (((wifi_get_ip_info(SOFTAP_IF, &IPInfo_Local))
+                                 && (ip4_addr_netcmp(&IPInfo_Remote.ip, &IPInfo_Local.ip,
+                                                     &IPInfo_Local.netmask)))
+                                ||  // Remote IP in SOFTAP's subnet OR
+                                ((wifi_get_ip_info(STATION_IF, &IPInfo_Local))
+                                 && (ip4_addr_netcmp(
+                                     &IPInfo_Remote.ip, &IPInfo_Local.ip,
+                                     &IPInfo_Local.netmask)))))  // Remote IP in STATION's subnet
                         {
-                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from local host %s, id %u!\n"), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), p_MsgHeader.m_u16ID););
+                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _parseQuery: Legacy query from local host "
+                                     "%s, id %u!\n"),
+                                IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(),
+                                p_MsgHeader.m_u16ID););
 
                             sendParameter.m_u16ID        = p_MsgHeader.m_u16ID;
                             sendParameter.m_bLegacyQuery = true;
                             sendParameter.m_pQuestions   = new stcMDNS_RRQuestion;
                             if ((bResult = (0 != sendParameter.m_pQuestions)))
                             {
-                                sendParameter.m_pQuestions->m_Header.m_Domain                = questionRR.m_Header.m_Domain;
-                                sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type  = questionRR.m_Header.m_Attributes.m_u16Type;
-                                sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = questionRR.m_Header.m_Attributes.m_u16Class;
+                                sendParameter.m_pQuestions->m_Header.m_Domain
+                                    = questionRR.m_Header.m_Domain;
+                                sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type
+                                    = questionRR.m_Header.m_Attributes.m_u16Type;
+                                sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class
+                                    = questionRR.m_Header.m_Attributes.m_u16Class;
                             }
                             else
                             {
-                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to add legacy question!\n")););
+                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                                    PSTR("[MDNSResponder] _parseQuery: FAILED to add legacy "
+                                         "question!\n")););
                             }
                         }
                         else
                         {
-                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy query from NON-LOCAL host!\n")););
+                            DEBUG_EX_RX(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Legacy "
+                                                           "query from NON-LOCAL host!\n")););
                             bResult = false;
                         }
                     }
@@ -280,44 +340,61 @@ namespace MDNSImplementation
             }
             else
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read question!\n")););
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                    PSTR("[MDNSResponder] _parseQuery: FAILED to read question!\n")););
             }
         }  // for questions
 
-        //DEBUG_EX_INFO(if (u8HostOrServiceReplies) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Reply needed: %u (%s: %s->%s)\n"), u8HostOrServiceReplies, clsTimeSyncer::timestr(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), IPAddress(m_pUDPContext->getDestAddress()).toString().c_str()); } );
+        // DEBUG_EX_INFO(if (u8HostOrServiceReplies) { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder]
+        // _parseQuery: Reply needed: %u (%s: %s->%s)\n"), u8HostOrServiceReplies,
+        // clsTimeSyncer::timestr(),
+        // IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(),
+        // IPAddress(m_pUDPContext->getDestAddress()).toString().c_str()); } );
 
         // Handle known answers
-        uint32_t u32Answers = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
-        DEBUG_EX_INFO(if ((u8HostOrServiceReplies) && (u32Answers))
-                      {
-                          DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Known answers(%u):\n"), u32Answers);
-                      });
+        uint32_t u32Answers
+            = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
+        DEBUG_EX_INFO(if ((u8HostOrServiceReplies) && (u32Answers)) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Known answers(%u):\n"),
+                                  u32Answers);
+        });
 
         for (uint32_t an = 0; ((bResult) && (an < u32Answers)); ++an)
         {
             stcMDNS_RRAnswer* pKnownRRAnswer = 0;
             if (((bResult = _readRRAnswer(pKnownRRAnswer))) && (pKnownRRAnswer))
             {
-                if ((DNS_RRTYPE_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Type) &&  // No ANY type answer
-                    (DNS_RRCLASS_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Class))  // No ANY class answer
+                if ((DNS_RRTYPE_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Type)
+                    &&  // No ANY type answer
+                    (DNS_RRCLASS_ANY
+                     != pKnownRRAnswer->m_Header.m_Attributes.m_u16Class))  // No ANY class answer
                 {
-                    // Find match between planned answer (sendParameter.m_u8HostReplyMask) and this 'known answer'
-                    uint8_t u8HostMatchMask = (sendParameter.m_u8HostReplyMask & _replyMaskForHost(pKnownRRAnswer->m_Header));
-                    if ((u8HostMatchMask) &&                                // The RR in the known answer matches an RR we are planning to send, AND
-                        ((MDNS_HOST_TTL / 2) <= pKnownRRAnswer->m_u32TTL))  // The TTL of the known answer is longer than half of the new host TTL (120s)
+                    // Find match between planned answer (sendParameter.m_u8HostReplyMask) and this
+                    // 'known answer'
+                    uint8_t u8HostMatchMask = (sendParameter.m_u8HostReplyMask
+                                               & _replyMaskForHost(pKnownRRAnswer->m_Header));
+                    if ((u8HostMatchMask)
+                        &&  // The RR in the known answer matches an RR we are planning to send, AND
+                        ((MDNS_HOST_TTL / 2)
+                         <= pKnownRRAnswer->m_u32TTL))  // The TTL of the known answer is longer
+                                                        // than half of the new host TTL (120s)
                     {
                         // Compare contents
                         if (AnswerType_PTR == pKnownRRAnswer->answerType())
                         {
                             stcMDNS_RRDomain hostDomain;
-                            if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain == hostDomain))
+                            if ((_buildDomainForHost(m_pcHostname, hostDomain))
+                                && (((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain
+                                    == hostDomain))
                             {
                                 // Host domain match
 #ifdef MDNS_IP4_SUPPORT
                                 if (u8HostMatchMask & ContentFlag_PTR_IP4)
                                 {
                                     // IP4 PTR was asked for, but is already known -> skipping
-                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 PTR already known... skipping!\n")););
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                        PSTR("[MDNSResponder] _parseQuery: IP4 PTR already "
+                                             "known... skipping!\n")););
                                     sendParameter.m_u8HostReplyMask &= ~ContentFlag_PTR_IP4;
                                 }
 #endif
@@ -325,7 +402,9 @@ namespace MDNSImplementation
                                 if (u8HostMatchMask & ContentFlag_PTR_IP6)
                                 {
                                     // IP6 PTR was asked for, but is already known -> skipping
-                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 PTR already known... skipping!\n")););
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                        PSTR("[MDNSResponder] _parseQuery: IP6 PTR already "
+                                             "known... skipping!\n")););
                                     sendParameter.m_u8HostReplyMask &= ~ContentFlag_PTR_IP6;
                                 }
 #endif
@@ -335,9 +414,13 @@ namespace MDNSImplementation
                         {
                             // IP4 address was asked for
 #ifdef MDNS_IP4_SUPPORT
-                            if ((AnswerType_A == pKnownRRAnswer->answerType()) && (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == m_pUDPContext->getInputNetif()->ip_addr))
+                            if ((AnswerType_A == pKnownRRAnswer->answerType())
+                                && (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress
+                                    == m_pUDPContext->getInputNetif()->ip_addr))
                             {
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP4 address already known... skipping!\n")););
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                    PSTR("[MDNSResponder] _parseQuery: IP4 address already "
+                                         "known... skipping!\n")););
                                 sendParameter.m_u8HostReplyMask &= ~ContentFlag_A;
                             }  // else: RData NOT IP4 length !!
 #endif
@@ -346,9 +429,13 @@ namespace MDNSImplementation
                         {
                             // IP6 address was asked for
 #ifdef MDNS_IP6_SUPPORT
-                            if ((AnswerType_AAAA == pAnswerRR->answerType()) && (((stcMDNS_RRAnswerAAAA*)pAnswerRR)->m_IPAddress == _getResponseMulticastInterface()))
+                            if ((AnswerType_AAAA == pAnswerRR->answerType())
+                                && (((stcMDNS_RRAnswerAAAA*)pAnswerRR)->m_IPAddress
+                                    == _getResponseMulticastInterface()))
                             {
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: IP6 address already known... skipping!\n")););
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                    PSTR("[MDNSResponder] _parseQuery: IP6 address already "
+                                         "known... skipping!\n")););
                                 sendParameter.m_u8HostReplyMask &= ~ContentFlag_AAAA;
                             }  // else: RData NOT IP6 length !!
 #endif
@@ -360,32 +447,45 @@ namespace MDNSImplementation
                     if (m_HostProbeInformation.m_bTiebreakNeeded)
                     {
                         stcMDNS_RRDomain hostDomain;
-                        if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (pKnownRRAnswer->m_Header.m_Domain == hostDomain))
+                        if ((_buildDomainForHost(m_pcHostname, hostDomain))
+                            && (pKnownRRAnswer->m_Header.m_Domain == hostDomain))
                         {
                             // Host domain match
 #ifdef MDNS_IP4_SUPPORT
                             if (AnswerType_A == pKnownRRAnswer->answerType())
                             {
                                 IPAddress localIPAddress(m_pUDPContext->getInputNetif()->ip_addr);
-                                if (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress == localIPAddress)
+                                if (((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress
+                                    == localIPAddress)
                                 {
-                                    // SAME IP address -> We've received an old message from ourselves (same IP)
-                                    DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (was an old message)!\n")););
+                                    // SAME IP address -> We've received an old message from
+                                    // ourselves (same IP)
+                                    DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(
+                                        PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (was "
+                                             "an old message)!\n")););
                                     m_HostProbeInformation.m_bTiebreakNeeded = false;
                                 }
                                 else
                                 {
-                                    if ((uint32_t)(((stcMDNS_RRAnswerA*)pKnownRRAnswer)->m_IPAddress) > (uint32_t)localIPAddress)  // The OTHER IP is 'higher' -> LOST
+                                    if ((uint32_t)(((stcMDNS_RRAnswerA*)pKnownRRAnswer)
+                                                       ->m_IPAddress)
+                                        > (uint32_t)
+                                            localIPAddress)  // The OTHER IP is 'higher' -> LOST
                                     {
                                         // LOST tiebreak
-                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) LOST (lower)!\n")););
+                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(
+                                            PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) LOST "
+                                                 "(lower)!\n")););
                                         _cancelProbingForHost();
                                         m_HostProbeInformation.m_bTiebreakNeeded = false;
                                     }
                                     else  // WON tiebreak
                                     {
-                                        //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
-                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON (higher IP)!\n")););
+                                        // TiebreakState = TiebreakState_Won;    // We received an
+                                        // 'old' message from ourselves -> Just ignore
+                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(
+                                            PSTR("[MDNSResponder] _parseQuery: Tiebreak (IP4) WON "
+                                                 "(higher IP)!\n")););
                                         m_HostProbeInformation.m_bTiebreakNeeded = false;
                                     }
                                 }
@@ -401,47 +501,83 @@ namespace MDNSImplementation
                     }  // Host tiebreak possibility
 
                     // Check service answers
-                    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+                    for (stcMDNSService* pService = m_pServices; pService;
+                         pService                 = pService->m_pNext)
                     {
-                        uint8_t u8ServiceMatchMask = (pService->m_u8ReplyMask & _replyMaskForService(pKnownRRAnswer->m_Header, *pService));
-
-                        if ((u8ServiceMatchMask) &&                                // The RR in the known answer matches an RR we are planning to send, AND
-                            ((MDNS_SERVICE_TTL / 2) <= pKnownRRAnswer->m_u32TTL))  // The TTL of the known answer is longer than half of the new service TTL (4500s)
+                        uint8_t u8ServiceMatchMask
+                            = (pService->m_u8ReplyMask
+                               & _replyMaskForService(pKnownRRAnswer->m_Header, *pService));
+
+                        if ((u8ServiceMatchMask) &&  // The RR in the known answer matches an RR we
+                                                     // are planning to send, AND
+                            ((MDNS_SERVICE_TTL / 2)
+                             <= pKnownRRAnswer
+                                    ->m_u32TTL))  // The TTL of the known answer is longer than half
+                                                  // of the new service TTL (4500s)
                         {
                             if (AnswerType_PTR == pKnownRRAnswer->answerType())
                             {
                                 stcMDNS_RRDomain serviceDomain;
-                                if ((u8ServiceMatchMask & ContentFlag_PTR_TYPE) && (_buildDomainForService(*pService, false, serviceDomain)) && (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
+                                if ((u8ServiceMatchMask & ContentFlag_PTR_TYPE)
+                                    && (_buildDomainForService(*pService, false, serviceDomain))
+                                    && (serviceDomain
+                                        == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
                                 {
-                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service type PTR already known... skipping!\n")););
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                        PSTR("[MDNSResponder] _parseQuery: Service type PTR "
+                                             "already known... skipping!\n")););
                                     pService->m_u8ReplyMask &= ~ContentFlag_PTR_TYPE;
                                 }
-                                if ((u8ServiceMatchMask & ContentFlag_PTR_NAME) && (_buildDomainForService(*pService, true, serviceDomain)) && (serviceDomain == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
+                                if ((u8ServiceMatchMask & ContentFlag_PTR_NAME)
+                                    && (_buildDomainForService(*pService, true, serviceDomain))
+                                    && (serviceDomain
+                                        == ((stcMDNS_RRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain))
                                 {
-                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service name PTR already known... skipping!\n")););
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                        PSTR("[MDNSResponder] _parseQuery: Service name PTR "
+                                             "already known... skipping!\n")););
                                     pService->m_u8ReplyMask &= ~ContentFlag_PTR_NAME;
                                 }
                             }
                             else if (u8ServiceMatchMask & ContentFlag_SRV)
                             {
-                                DEBUG_EX_ERR(if (AnswerType_SRV != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (SRV)!\n")););
+                                DEBUG_EX_ERR(if (AnswerType_SRV != pKnownRRAnswer->answerType())
+                                                 DEBUG_OUTPUT.printf_P(
+                                                     PSTR("[MDNSResponder] _parseQuery: ERROR! "
+                                                          "INVALID answer type (SRV)!\n")););
                                 stcMDNS_RRDomain hostDomain;
-                                if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))  // Host domain match
+                                if ((_buildDomainForHost(m_pcHostname, hostDomain))
+                                    && (hostDomain
+                                        == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)
+                                               ->m_SRVDomain))  // Host domain match
                                 {
-                                    if ((MDNS_SRV_PRIORITY == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Priority) && (MDNS_SRV_WEIGHT == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Weight) && (pService->m_u16Port == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Port))
+                                    if ((MDNS_SRV_PRIORITY
+                                         == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Priority)
+                                        && (MDNS_SRV_WEIGHT
+                                            == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Weight)
+                                        && (pService->m_u16Port
+                                            == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_u16Port))
                                     {
-                                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service SRV answer already known... skipping!\n")););
+                                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                            PSTR("[MDNSResponder] _parseQuery: Service SRV answer "
+                                                 "already known... skipping!\n")););
                                         pService->m_u8ReplyMask &= ~ContentFlag_SRV;
                                     }  // else: Small differences -> send update message
                                 }
                             }
                             else if (u8ServiceMatchMask & ContentFlag_TXT)
                             {
-                                DEBUG_EX_ERR(if (AnswerType_TXT != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: ERROR! INVALID answer type (TXT)!\n")););
+                                DEBUG_EX_ERR(if (AnswerType_TXT != pKnownRRAnswer->answerType())
+                                                 DEBUG_OUTPUT.printf_P(
+                                                     PSTR("[MDNSResponder] _parseQuery: ERROR! "
+                                                          "INVALID answer type (TXT)!\n")););
                                 _collectServiceTxts(*pService);
-                                if (pService->m_Txts == ((stcMDNS_RRAnswerTXT*)pKnownRRAnswer)->m_Txts)
+                                if (pService->m_Txts
+                                    == ((stcMDNS_RRAnswerTXT*)pKnownRRAnswer)->m_Txts)
                                 {
-                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Service TXT answer already known... skipping!\n")););
+                                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                        PSTR("[MDNSResponder] _parseQuery: Service TXT answer "
+                                             "already known... skipping!\n")););
                                     pService->m_u8ReplyMask &= ~ContentFlag_TXT;
                                 }
                                 _releaseTempServiceTxts(*pService);
@@ -453,31 +589,43 @@ namespace MDNSImplementation
                         if (pService->m_ProbeInformation.m_bTiebreakNeeded)
                         {
                             stcMDNS_RRDomain serviceDomain;
-                            if ((_buildDomainForService(*pService, true, serviceDomain)) && (pKnownRRAnswer->m_Header.m_Domain == serviceDomain))
+                            if ((_buildDomainForService(*pService, true, serviceDomain))
+                                && (pKnownRRAnswer->m_Header.m_Domain == serviceDomain))
                             {
                                 // Service domain match
                                 if (AnswerType_SRV == pKnownRRAnswer->answerType())
                                 {
                                     stcMDNS_RRDomain hostDomain;
-                                    if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (hostDomain == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain))  // Host domain match
+                                    if ((_buildDomainForHost(m_pcHostname, hostDomain))
+                                        && (hostDomain
+                                            == ((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)
+                                                   ->m_SRVDomain))  // Host domain match
                                     {
                                         // We've received an old message from ourselves (same SRV)
-                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (was an old message)!\n")););
+                                        DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(
+                                            PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won "
+                                                 "(was an old message)!\n")););
                                         pService->m_ProbeInformation.m_bTiebreakNeeded = false;
                                     }
                                     else
                                     {
-                                        if (((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain > hostDomain)  // The OTHER domain is 'higher' -> LOST
+                                        if (((stcMDNS_RRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain
+                                            > hostDomain)  // The OTHER domain is 'higher' -> LOST
                                         {
                                             // LOST tiebreak
-                                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) LOST (lower)!\n")););
+                                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(
+                                                PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) "
+                                                     "LOST (lower)!\n")););
                                             _cancelProbingForService(*pService);
                                             pService->m_ProbeInformation.m_bTiebreakNeeded = false;
                                         }
                                         else  // WON tiebreak
                                         {
-                                            //TiebreakState = TiebreakState_Won;    // We received an 'old' message from ourselves -> Just ignore
-                                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) won (higher)!\n")););
+                                            // TiebreakState = TiebreakState_Won;    // We received
+                                            // an 'old' message from ourselves -> Just ignore
+                                            DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(
+                                                PSTR("[MDNSResponder] _parseQuery: Tiebreak (SRV) "
+                                                     "won (higher)!\n")););
                                             pService->m_ProbeInformation.m_bTiebreakNeeded = false;
                                         }
                                     }
@@ -489,7 +637,8 @@ namespace MDNSImplementation
             }
             else
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED to read known answer!\n")););
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                    PSTR("[MDNSResponder] _parseQuery: FAILED to read known answer!\n")););
             }
 
             if (pKnownRRAnswer)
@@ -510,22 +659,23 @@ namespace MDNSImplementation
 
             if (u8ReplyNeeded)
             {
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Sending answer(0x%X)...\n"), u8ReplyNeeded););
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                    PSTR("[MDNSResponder] _parseQuery: Sending answer(0x%X)...\n"),
+                    u8ReplyNeeded););
 
                 sendParameter.m_bResponse    = true;
                 sendParameter.m_bAuthorative = true;
 
                 bResult = _sendMDNSMessage(sendParameter);
             }
-            DEBUG_EX_INFO(
-                else
-                {
-                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: No reply needed\n"));
-                });
+            DEBUG_EX_INFO(else {
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: No reply needed\n"));
+            });
         }
         else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Something FAILED!\n")););
+            DEBUG_EX_ERR(
+                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: Something FAILED!\n")););
             m_pUDPContext->flush();
         }
 
@@ -533,55 +683,58 @@ namespace MDNSImplementation
         // Check and reset tiebreak-states
         if (m_HostProbeInformation.m_bTiebreakNeeded)
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for host domain!\n")););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for host domain!\n")););
             m_HostProbeInformation.m_bTiebreakNeeded = false;
         }
         for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
         {
             if (pService->m_ProbeInformation.m_bTiebreakNeeded)
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED tiebreak-need for service domain (%s.%s.%s)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                DEBUG_EX_ERR(
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: UNSOLVED "
+                                               "tiebreak-need for service domain (%s.%s.%s)\n"),
+                                          (pService->m_pcName ?: m_pcHostname),
+                                          pService->m_pcService, pService->m_pcProtocol););
                 pService->m_ProbeInformation.m_bTiebreakNeeded = false;
             }
         }
         DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED!\n"));
-                     });
+                     { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseQuery: FAILED!\n")); });
         return bResult;
     }
 
     /*
-    MDNSResponder::_parseResponse
-
-    Responses are of interest in two cases:
-    1. find domain name conflicts while probing
-    2. get answers to service queries
-
-    In both cases any included questions are ignored
-
-    1. If any answer has a domain name similar to one of the domain names we're planning to use (and are probing for),
-      then we've got a 'probing conflict'. The conflict has to be solved on our side of the conflict (eg. by
-      setting a new hostname and restart probing). The callback 'm_fnProbeResultCallback' is called with
-      'p_bProbeResult=false' in this case.
-
-    2. Service queries like '_http._tcp.local' will (if available) produce PTR, SRV, TXT and A/AAAA answers.
-      All stored answers are pivoted by the service instance name (from the PTR record). Other answer parts,
-      like host domain or IP address are than attached to this element.
-      Any answer part carries a TTL, this is also stored (incl. the reception time); if the TTL is '0' the
-      answer (part) is withdrawn by the sender and should be removed from any cache. RFC 6762, 10.1 proposes to
-      set the caches TTL-value to 1 second in such a case and to delete the item only, if no update has
-      has taken place in this second.
-      Answer parts may arrive in 'unsorted' order, so they are grouped into three levels:
-      Level 1: PRT - names the service instance (and is used as pivot), voids all other parts if is withdrawn or outdates
-      Level 2: SRV - links the instance name to a host domain and port, voids A/AAAA parts if is withdrawn or outdates
-               TXT - links the instance name to services TXTs
-      Level 3: A/AAAA - links the host domain to an IP address
-*/
+        MDNSResponder::_parseResponse
+
+        Responses are of interest in two cases:
+        1. find domain name conflicts while probing
+        2. get answers to service queries
+
+        In both cases any included questions are ignored
+
+        1. If any answer has a domain name similar to one of the domain names we're planning to use
+       (and are probing for), then we've got a 'probing conflict'. The conflict has to be solved on
+       our side of the conflict (eg. by setting a new hostname and restart probing). The callback
+       'm_fnProbeResultCallback' is called with 'p_bProbeResult=false' in this case.
+
+        2. Service queries like '_http._tcp.local' will (if available) produce PTR, SRV, TXT and
+       A/AAAA answers. All stored answers are pivoted by the service instance name (from the PTR
+       record). Other answer parts, like host domain or IP address are than attached to this
+       element. Any answer part carries a TTL, this is also stored (incl. the reception time); if
+       the TTL is '0' the answer (part) is withdrawn by the sender and should be removed from any
+       cache. RFC 6762, 10.1 proposes to set the caches TTL-value to 1 second in such a case and to
+       delete the item only, if no update has has taken place in this second. Answer parts may
+       arrive in 'unsorted' order, so they are grouped into three levels: Level 1: PRT - names the
+       service instance (and is used as pivot), voids all other parts if is withdrawn or outdates
+          Level 2: SRV - links the instance name to a host domain and port, voids A/AAAA parts if is
+       withdrawn or outdates TXT - links the instance name to services TXTs Level 3: A/AAAA - links
+       the host domain to an IP address
+    */
     bool MDNSResponder::_parseResponse(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader)
     {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse\n")););
-        //DEBUG_EX_INFO(_udpDump(););
+        // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse\n")););
+        // DEBUG_EX_INFO(_udpDump(););
 
         bool bResult = false;
 
@@ -589,9 +742,9 @@ namespace MDNSImplementation
         if ((_hasServiceQueriesWaitingForAnswers()) ||  // Waiting for query answers OR
             (_hasProbesWaitingForAnswers()))            // Probe responses
         {
-            DEBUG_EX_INFO(
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response\n"));
-                //_udpDump();
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] _parseResponse: Received a response\n"));
+                          //_udpDump();
             );
 
             bResult = true;
@@ -600,26 +753,31 @@ namespace MDNSImplementation
             stcMDNS_RRQuestion dummyRRQ;
             for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd)
             {
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a response containing a question... ignoring!\n")););
+                DEBUG_EX_INFO(
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received a "
+                                               "response containing a question... ignoring!\n")););
                 bResult = _readRRQuestion(dummyRRQ);
             }  // for queries
 
             //
             // Read and collect answers
-            stcMDNS_RRAnswer* pCollectedRRAnswers  = 0;
-            uint32_t          u32NumberOfAnswerRRs = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
+            stcMDNS_RRAnswer* pCollectedRRAnswers = 0;
+            uint32_t          u32NumberOfAnswerRRs
+                = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
             for (uint32_t an = 0; ((bResult) && (an < u32NumberOfAnswerRRs)); ++an)
             {
                 stcMDNS_RRAnswer* pRRAnswer = 0;
                 if (((bResult = _readRRAnswer(pRRAnswer))) && (pRRAnswer))
                 {
-                    //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: ADDING answer!\n")););
+                    // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse:
+                    // ADDING answer!\n")););
                     pRRAnswer->m_pNext  = pCollectedRRAnswers;
                     pCollectedRRAnswers = pRRAnswer;
                 }
                 else
                 {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answer!\n")););
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _parseResponse: FAILED to read answer!\n")););
                     if (pRRAnswer)
                     {
                         delete pRRAnswer;
@@ -637,14 +795,16 @@ namespace MDNSImplementation
             }
             else  // Some failure while reading answers
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED to read answers!\n")););
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                    PSTR("[MDNSResponder] _parseResponse: FAILED to read answers!\n")););
                 m_pUDPContext->flush();
             }
 
             // Delete collected answers
             while (pCollectedRRAnswers)
             {
-                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: DELETING answer!\n")););
+                // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse:
+                // DELETING answer!\n")););
                 stcMDNS_RRAnswer* pNextAnswer = pCollectedRRAnswers->m_pNext;
                 delete pCollectedRRAnswers;
                 pCollectedRRAnswers = pNextAnswer;
@@ -653,56 +813,51 @@ namespace MDNSImplementation
         else  // Received an unexpected response -> ignore
         {
             /*  DEBUG_EX_INFO(
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received an unexpected response... ignoring!\nDUMP:\n"));
-                bool    bDumpResult = true;
-                for (uint16_t qd=0; ((bDumpResult) && (qd<p_MsgHeader.m_u16QDCount)); ++qd) {
-                    stcMDNS_RRQuestion  questionRR;
-                    bDumpResult = _readRRQuestion(questionRR);
-                    esp_suspend();
-                }   // for questions
-                // Handle known answers
-                uint32_t    u32Answers = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount);
-                for (uint32_t an=0; ((bDumpResult) && (an<u32Answers)); ++an) {
-                    stcMDNS_RRAnswer*   pRRAnswer = 0;
-                    bDumpResult = _readRRAnswer(pRRAnswer);
-                    if (pRRAnswer) {
-                        delete pRRAnswer;
-                        pRRAnswer = 0;
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: Received an
+               unexpected response... ignoring!\nDUMP:\n")); bool    bDumpResult = true; for
+               (uint16_t qd=0; ((bDumpResult) && (qd<p_MsgHeader.m_u16QDCount)); ++qd) {
+                        stcMDNS_RRQuestion  questionRR;
+                        bDumpResult = _readRRQuestion(questionRR);
+                        esp_suspend();
+                    }   // for questions
+                    // Handle known answers
+                    uint32_t    u32Answers = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount +
+               p_MsgHeader.m_u16ARCount); for (uint32_t an=0; ((bDumpResult) && (an<u32Answers));
+               ++an) { stcMDNS_RRAnswer*   pRRAnswer = 0; bDumpResult = _readRRAnswer(pRRAnswer); if
+               (pRRAnswer) { delete pRRAnswer; pRRAnswer = 0;
+                        }
+                        esp_suspend();
                     }
-                    esp_suspend();
-                }
-            );*/
+                );*/
             m_pUDPContext->flush();
             bResult = true;
         }
         DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED!\n"));
-                     });
+                     { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _parseResponse: FAILED!\n")); });
         return bResult;
     }
 
     /*
-    MDNSResponder::_processAnswers
-    Host:
-    A (0x01):               eg. esp8266.local A OP TTL 123.456.789.012
-    AAAA (01Cx):            eg. esp8266.local AAAA OP TTL 1234:5678::90
-    PTR (0x0C, IP4):        eg. 012.789.456.123.in-addr.arpa PTR OP TTL esp8266.local
-    PTR (0x0C, IP6):        eg. 90.0.0.0.0.0.0.0.0.0.0.0.78.56.34.12.ip6.arpa PTR OP TTL esp8266.local
-    Service:
-    PTR (0x0C, srv name):   eg. _http._tcp.local PTR OP TTL MyESP._http._tcp.local
-    PTR (0x0C, srv type):   eg. _services._dns-sd._udp.local PTR OP TTL _http._tcp.local
-    SRV (0x21):             eg. MyESP._http._tcp.local SRV OP TTL PRIORITY WEIGHT PORT esp8266.local
-    TXT (0x10):             eg. MyESP._http._tcp.local TXT OP TTL c#=1
-
-*/
+        MDNSResponder::_processAnswers
+        Host:
+        A (0x01):               eg. esp8266.local A OP TTL 123.456.789.012
+        AAAA (01Cx):            eg. esp8266.local AAAA OP TTL 1234:5678::90
+        PTR (0x0C, IP4):        eg. 012.789.456.123.in-addr.arpa PTR OP TTL esp8266.local
+        PTR (0x0C, IP6):        eg. 90.0.0.0.0.0.0.0.0.0.0.0.78.56.34.12.ip6.arpa PTR OP TTL
+       esp8266.local Service: PTR (0x0C, srv name):   eg. _http._tcp.local PTR OP TTL
+       MyESP._http._tcp.local PTR (0x0C, srv type):   eg. _services._dns-sd._udp.local PTR OP TTL
+       _http._tcp.local SRV (0x21):             eg. MyESP._http._tcp.local SRV OP TTL PRIORITY
+       WEIGHT PORT esp8266.local TXT (0x10):             eg. MyESP._http._tcp.local TXT OP TTL c#=1
+
+    */
     bool MDNSResponder::_processAnswers(const MDNSResponder::stcMDNS_RRAnswer* p_pAnswers)
     {
         bool bResult = false;
 
         if (p_pAnswers)
         {
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Processing answers...\n")););
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] _processAnswers: Processing answers...\n")););
             bResult = true;
 
             // Answers may arrive in an unexpected order. So we loop our answers as long, as we
@@ -719,14 +874,20 @@ namespace MDNSImplementation
                     if (AnswerType_PTR == pRRAnswer->answerType())
                     {
                         // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
-                        bResult = _processPTRAnswer((stcMDNS_RRAnswerPTR*)pRRAnswer, bFoundNewKeyAnswer);  // May 'enable' new SRV or TXT answers to be linked to queries
+                        bResult = _processPTRAnswer(
+                            (stcMDNS_RRAnswerPTR*)pRRAnswer,
+                            bFoundNewKeyAnswer);  // May 'enable' new SRV or TXT answers to be
+                                                  // linked to queries
                     }
                     // 2. level answers
                     // SRV -> host domain and port
                     else if (AnswerType_SRV == pRRAnswer->answerType())
                     {
                         // eg. MyESP_http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local
-                        bResult = _processSRVAnswer((stcMDNS_RRAnswerSRV*)pRRAnswer, bFoundNewKeyAnswer);  // May 'enable' new A/AAAA answers to be linked to queries
+                        bResult = _processSRVAnswer(
+                            (stcMDNS_RRAnswerSRV*)pRRAnswer,
+                            bFoundNewKeyAnswer);  // May 'enable' new A/AAAA answers to be linked to
+                                                  // queries
                     }
                     // TXT -> Txts
                     else if (AnswerType_TXT == pRRAnswer->answerType())
@@ -754,24 +915,39 @@ namespace MDNSImplementation
 
                     // Finally check for probing conflicts
                     // Host domain
-                    if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) && ((AnswerType_A == pRRAnswer->answerType()) || (AnswerType_AAAA == pRRAnswer->answerType())))
+                    if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus)
+                        && ((AnswerType_A == pRRAnswer->answerType())
+                            || (AnswerType_AAAA == pRRAnswer->answerType())))
                     {
                         stcMDNS_RRDomain hostDomain;
-                        if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (pRRAnswer->m_Header.m_Domain == hostDomain))
+                        if ((_buildDomainForHost(m_pcHostname, hostDomain))
+                            && (pRRAnswer->m_Header.m_Domain == hostDomain))
                         {
-                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.local\n"), m_pcHostname););
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found "
+                                     "with: %s.local\n"),
+                                m_pcHostname););
                             _cancelProbingForHost();
                         }
                     }
                     // Service domains
-                    for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
+                    for (stcMDNSService* pService = m_pServices; pService;
+                         pService                 = pService->m_pNext)
                     {
-                        if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) && ((AnswerType_TXT == pRRAnswer->answerType()) || (AnswerType_SRV == pRRAnswer->answerType())))
+                        if ((ProbingStatus_InProgress
+                             == pService->m_ProbeInformation.m_ProbingStatus)
+                            && ((AnswerType_TXT == pRRAnswer->answerType())
+                                || (AnswerType_SRV == pRRAnswer->answerType())))
                         {
                             stcMDNS_RRDomain serviceDomain;
-                            if ((_buildDomainForService(*pService, true, serviceDomain)) && (pRRAnswer->m_Header.m_Domain == serviceDomain))
+                            if ((_buildDomainForService(*pService, true, serviceDomain))
+                                && (pRRAnswer->m_Header.m_Domain == serviceDomain))
                             {
-                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found with: %s.%s.%s\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                    PSTR("[MDNSResponder] _processAnswers: Probing CONFLICT found "
+                                         "with: %s.%s.%s\n"),
+                                    (pService->m_pcName ?: m_pcHostname), pService->m_pcService,
+                                    pService->m_pcProtocol););
                                 _cancelProbingForService(*pService);
                             }
                         }
@@ -781,55 +957,63 @@ namespace MDNSImplementation
                 }                                    // while (answers)
             } while ((bFoundNewKeyAnswer) && (bResult));
         }  // else: No answers provided
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAnswers: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_processPTRAnswer
-*/
+        MDNSResponder::_processPTRAnswer
+    */
     bool MDNSResponder::_processPTRAnswer(const MDNSResponder::stcMDNS_RRAnswerPTR* p_pPTRAnswer,
-                                          bool&                                     p_rbFoundNewKeyAnswer)
+                                          bool& p_rbFoundNewKeyAnswer)
     {
         bool bResult = false;
 
         if ((bResult = (0 != p_pPTRAnswer)))
         {
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Processing PTR answers...\n")););
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] _processPTRAnswer: Processing PTR answers...\n")););
             // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local
             // Check pending service queries for eg. '_http._tcp'
 
-            stcMDNSServiceQuery* pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, 0);
+            stcMDNSServiceQuery* pServiceQuery
+                = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, 0);
             while (pServiceQuery)
             {
                 if (pServiceQuery->m_bAwaitingAnswers)
                 {
                     // Find answer for service domain (eg. MyESP._http._tcp.local)
-                    stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pPTRAnswer->m_PTRDomain);
+                    stcMDNSServiceQuery::stcAnswer* pSQAnswer
+                        = pServiceQuery->findAnswerForServiceDomain(p_pPTRAnswer->m_PTRDomain);
                     if (pSQAnswer)  // existing answer
                     {
                         if (p_pPTRAnswer->m_u32TTL)  // Received update message
                         {
-                            pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL);  // Update TTL tag
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: Updated TTL(%d) for "), (int)p_pPTRAnswer->m_u32TTL);
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR("\n")););
+                            pSQAnswer->m_TTLServiceDomain.set(
+                                p_pPTRAnswer->m_u32TTL);  // Update TTL tag
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _processPTRAnswer: Updated TTL(%d) for "),
+                                (int)p_pPTRAnswer->m_u32TTL);
+                                          _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                          DEBUG_OUTPUT.printf_P(PSTR("\n")););
                         }
                         else  // received goodbye-message
                         {
-                            pSQAnswer->m_TTLServiceDomain.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: 'Goodbye' received for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR("\n")););
+                            pSQAnswer->m_TTLServiceDomain
+                                .prepareDeletion();  // Prepare answer deletion according to RFC
+                                                     // 6762, 10.1
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _processPTRAnswer: 'Goodbye' received for "));
+                                          _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                          DEBUG_OUTPUT.printf_P(PSTR("\n")););
                         }
                     }
-                    else if ((p_pPTRAnswer->m_u32TTL) &&                          // Not just a goodbye-message
-                             ((pSQAnswer = new stcMDNSServiceQuery::stcAnswer)))  // Not yet included -> add answer
+                    else if ((p_pPTRAnswer->m_u32TTL) &&  // Not just a goodbye-message
+                             ((pSQAnswer
+                               = new stcMDNSServiceQuery::stcAnswer)))  // Not yet included -> add
+                                                                        // answer
                     {
                         pSQAnswer->m_ServiceDomain = p_pPTRAnswer->m_PTRDomain;
                         pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_ServiceDomain;
@@ -840,26 +1024,30 @@ namespace MDNSImplementation
                         p_rbFoundNewKeyAnswer = true;
                         if (pServiceQuery->m_fnCallback)
                         {
-                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                            pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain), true);
+                            MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery,
+                                                        pServiceQuery->indexOfAnswer(pSQAnswer));
+                            pServiceQuery->m_fnCallback(
+                                serviceInfo,
+                                static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain),
+                                true);
                         }
                     }
                 }
-                pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain, pServiceQuery);
+                pServiceQuery = _findNextServiceQueryByServiceType(p_pPTRAnswer->m_Header.m_Domain,
+                                                                   pServiceQuery);
             }
         }  // else: No p_pPTRAnswer
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processPTRAnswer: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_processSRVAnswer
-*/
+        MDNSResponder::_processSRVAnswer
+    */
     bool MDNSResponder::_processSRVAnswer(const MDNSResponder::stcMDNS_RRAnswerSRV* p_pSRVAnswer,
-                                          bool&                                     p_rbFoundNewKeyAnswer)
+                                          bool& p_rbFoundNewKeyAnswer)
     {
         bool bResult = false;
 
@@ -870,54 +1058,67 @@ namespace MDNSImplementation
             stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
             while (pServiceQuery)
             {
-                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pSRVAnswer->m_Header.m_Domain);
-                if (pSQAnswer)  // Answer for this service domain (eg. MyESP._http._tcp.local) available
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer
+                    = pServiceQuery->findAnswerForServiceDomain(p_pSRVAnswer->m_Header.m_Domain);
+                if (pSQAnswer)  // Answer for this service domain (eg. MyESP._http._tcp.local)
+                                // available
                 {
                     if (p_pSRVAnswer->m_u32TTL)  // First or update message (TTL != 0)
                     {
-                        pSQAnswer->m_TTLHostDomainAndPort.set(p_pSRVAnswer->m_u32TTL);  // Update TTL tag
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: Updated TTL(%d) for "), (int)p_pSRVAnswer->m_u32TTL);
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")););
+                        pSQAnswer->m_TTLHostDomainAndPort.set(
+                            p_pSRVAnswer->m_u32TTL);  // Update TTL tag
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                            PSTR("[MDNSResponder] _processSRVAnswer: Updated TTL(%d) for "),
+                            (int)p_pSRVAnswer->m_u32TTL);
+                                      _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                      DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")););
                         // Host domain & Port
-                        if ((pSQAnswer->m_HostDomain != p_pSRVAnswer->m_SRVDomain) || (pSQAnswer->m_u16Port != p_pSRVAnswer->m_u16Port))
+                        if ((pSQAnswer->m_HostDomain != p_pSRVAnswer->m_SRVDomain)
+                            || (pSQAnswer->m_u16Port != p_pSRVAnswer->m_u16Port))
                         {
                             pSQAnswer->m_HostDomain = p_pSRVAnswer->m_SRVDomain;
                             pSQAnswer->releaseHostDomain();
                             pSQAnswer->m_u16Port = p_pSRVAnswer->m_u16Port;
-                            pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_HostDomainAndPort;
+                            pSQAnswer->m_u32ContentFlags
+                                |= ServiceQueryAnswerType_HostDomainAndPort;
 
                             p_rbFoundNewKeyAnswer = true;
                             if (pServiceQuery->m_fnCallback)
                             {
-                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_HostDomainAndPort), true);
+                                MDNSServiceInfo serviceInfo(
+                                    *this, (hMDNSServiceQuery)pServiceQuery,
+                                    pServiceQuery->indexOfAnswer(pSQAnswer));
+                                pServiceQuery->m_fnCallback(
+                                    serviceInfo,
+                                    static_cast<AnswerType>(
+                                        ServiceQueryAnswerType_HostDomainAndPort),
+                                    true);
                             }
                         }
                     }
                     else  // Goodby message
                     {
-                        pSQAnswer->m_TTLHostDomainAndPort.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: 'Goodbye' received for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")););
+                        pSQAnswer->m_TTLHostDomainAndPort
+                            .prepareDeletion();  // Prepare answer deletion according to RFC
+                                                 // 6762, 10.1
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                            PSTR("[MDNSResponder] _processSRVAnswer: 'Goodbye' received for "));
+                                      _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                      DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")););
                     }
                 }
                 pServiceQuery = pServiceQuery->m_pNext;
             }  // while(service query)
         }      // else: No p_pSRVAnswer
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processSRVAnswer: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_processTXTAnswer
-*/
+        MDNSResponder::_processTXTAnswer
+    */
     bool MDNSResponder::_processTXTAnswer(const MDNSResponder::stcMDNS_RRAnswerTXT* p_pTXTAnswer)
     {
         bool bResult = false;
@@ -929,16 +1130,19 @@ namespace MDNSImplementation
             stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
             while (pServiceQuery)
             {
-                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForServiceDomain(p_pTXTAnswer->m_Header.m_Domain);
-                if (pSQAnswer)  // Answer for this service domain (eg. MyESP._http._tcp.local) available
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer
+                    = pServiceQuery->findAnswerForServiceDomain(p_pTXTAnswer->m_Header.m_Domain);
+                if (pSQAnswer)  // Answer for this service domain (eg. MyESP._http._tcp.local)
+                                // available
                 {
                     if (p_pTXTAnswer->m_u32TTL)  // First or update message
                     {
                         pSQAnswer->m_TTLTxts.set(p_pTXTAnswer->m_u32TTL);  // Update TTL tag
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: Updated TTL(%d) for "), (int)p_pTXTAnswer->m_u32TTL);
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")););
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                            PSTR("[MDNSResponder] _processTXTAnswer: Updated TTL(%d) for "),
+                            (int)p_pTXTAnswer->m_u32TTL);
+                                      _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                      DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")););
                         if (!pSQAnswer->m_Txts.compare(p_pTXTAnswer->m_Txts))
                         {
                             pSQAnswer->m_Txts = p_pTXTAnswer->m_Txts;
@@ -947,34 +1151,38 @@ namespace MDNSImplementation
 
                             if (pServiceQuery->m_fnCallback)
                             {
-                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), true);
+                                MDNSServiceInfo serviceInfo(
+                                    *this, (hMDNSServiceQuery)pServiceQuery,
+                                    pServiceQuery->indexOfAnswer(pSQAnswer));
+                                pServiceQuery->m_fnCallback(
+                                    serviceInfo,
+                                    static_cast<AnswerType>(ServiceQueryAnswerType_Txts), true);
                             }
                         }
                     }
                     else  // Goodby message
                     {
-                        pSQAnswer->m_TTLTxts.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                        DEBUG_EX_INFO(
-                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: 'Goodbye' received for "));
-                            _printRRDomain(pSQAnswer->m_ServiceDomain);
-                            DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")););
+                        pSQAnswer->m_TTLTxts.prepareDeletion();  // Prepare answer deletion
+                                                                 // according to RFC 6762, 10.1
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                            PSTR("[MDNSResponder] _processTXTAnswer: 'Goodbye' received for "));
+                                      _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                      DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")););
                     }
                 }
                 pServiceQuery = pServiceQuery->m_pNext;
             }  // while(service query)
         }      // else: No p_pTXTAnswer
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processTXTAnswer: FAILED!\n"));
+        });
         return bResult;
     }
 
 #ifdef MDNS_IP4_SUPPORT
     /*
-    MDNSResponder::_processAAnswer
-*/
+        MDNSResponder::_processAAnswer
+    */
     bool MDNSResponder::_processAAnswer(const MDNSResponder::stcMDNS_RRAnswerA* p_pAAnswer)
     {
         bool bResult = false;
@@ -986,48 +1194,66 @@ namespace MDNSImplementation
             stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
             while (pServiceQuery)
             {
-                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAnswer->m_Header.m_Domain);
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer
+                    = pServiceQuery->findAnswerForHostDomain(p_pAAnswer->m_Header.m_Domain);
                 if (pSQAnswer)  // Answer for this host domain (eg. esp8266.local) available
                 {
-                    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address = pSQAnswer->findIP4Address(p_pAAnswer->m_IPAddress);
+                    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address
+                        = pSQAnswer->findIP4Address(p_pAAnswer->m_IPAddress);
                     if (pIP4Address)
                     {
                         // Already known IP4 address
                         if (p_pAAnswer->m_u32TTL)  // Valid TTL -> Update answers TTL
                         {
                             pIP4Address->m_TTL.set(p_pAAnswer->m_u32TTL);
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%d) for "), (int)p_pAAnswer->m_u32TTL);
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" IP4Address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str()););
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%d) for "),
+                                (int)p_pAAnswer->m_u32TTL);
+                                          _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                          DEBUG_OUTPUT.printf_P(
+                                              PSTR(" IP4Address (%s)\n"),
+                                              pIP4Address->m_IPAddress.toString().c_str()););
                         }
                         else  // 'Goodbye' message for known IP4 address
                         {
-                            pIP4Address->m_TTL.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), pIP4Address->m_IPAddress.toString().c_str()););
+                            pIP4Address->m_TTL.prepareDeletion();  // Prepare answer deletion
+                                                                   // according to RFC 6762, 10.1
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
+                                          _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                          DEBUG_OUTPUT.printf_P(
+                                              PSTR(" IP4 address (%s)\n"),
+                                              pIP4Address->m_IPAddress.toString().c_str()););
                         }
                     }
                     else
                     {
-                        // Until now unknown IP4 address -> Add (if the message isn't just a 'Goodbye' note)
+                        // Until now unknown IP4 address -> Add (if the message isn't just a
+                        // 'Goodbye' note)
                         if (p_pAAnswer->m_u32TTL)  // NOT just a 'Goodbye' message
                         {
-                            pIP4Address = new stcMDNSServiceQuery::stcAnswer::stcIP4Address(p_pAAnswer->m_IPAddress, p_pAAnswer->m_u32TTL);
+                            pIP4Address = new stcMDNSServiceQuery::stcAnswer::stcIP4Address(
+                                p_pAAnswer->m_IPAddress, p_pAAnswer->m_u32TTL);
                             if ((pIP4Address) && (pSQAnswer->addIP4Address(pIP4Address)))
                             {
                                 pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
                                 if (pServiceQuery->m_fnCallback)
                                 {
-                                    MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                    pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), true);
+                                    MDNSServiceInfo serviceInfo(
+                                        *this, (hMDNSServiceQuery)pServiceQuery,
+                                        pServiceQuery->indexOfAnswer(pSQAnswer));
+                                    pServiceQuery->m_fnCallback(
+                                        serviceInfo,
+                                        static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address),
+                                        true);
                                 }
                             }
                             else
                             {
-                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP4 address (%s)!\n"), p_pAAnswer->m_IPAddress.toString().c_str()););
+                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                                    PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP4 "
+                                         "address (%s)!\n"),
+                                    p_pAAnswer->m_IPAddress.toString().c_str()););
                             }
                         }
                     }
@@ -1035,18 +1261,17 @@ namespace MDNSImplementation
                 pServiceQuery = pServiceQuery->m_pNext;
             }  // while(service query)
         }      // else: No p_pAAnswer
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED!\n"));
+        });
         return bResult;
     }
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
     /*
-    MDNSResponder::_processAAAAAnswer
-*/
+        MDNSResponder::_processAAAAAnswer
+    */
     bool MDNSResponder::_processAAAAAnswer(const MDNSResponder::stcMDNS_RRAnswerAAAA* p_pAAAAAnswer)
     {
         bool bResult = false;
@@ -1058,48 +1283,65 @@ namespace MDNSImplementation
             stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
             while (pServiceQuery)
             {
-                stcMDNSServiceQuery::stcAnswer* pSQAnswer = pServiceQuery->findAnswerForHostDomain(p_pAAAAAnswer->m_Header.m_Domain);
+                stcMDNSServiceQuery::stcAnswer* pSQAnswer
+                    = pServiceQuery->findAnswerForHostDomain(p_pAAAAAnswer->m_Header.m_Domain);
                 if (pSQAnswer)  // Answer for this host domain (eg. esp8266.local) available
                 {
-                    stcIP6Address* pIP6Address = pSQAnswer->findIP6Address(p_pAAAAAnswer->m_IPAddress);
+                    stcIP6Address* pIP6Address
+                        = pSQAnswer->findIP6Address(p_pAAAAAnswer->m_IPAddress);
                     if (pIP6Address)
                     {
                         // Already known IP6 address
                         if (p_pAAAAAnswer->m_u32TTL)  // Valid TTL -> Update answers TTL
                         {
                             pIP6Address->m_TTL.set(p_pAAAAAnswer->m_u32TTL);
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%lu) for "), p_pAAAAAnswer->m_u32TTL);
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str()););
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _processAAnswer: Updated TTL(%lu) for "),
+                                p_pAAAAAnswer->m_u32TTL);
+                                          _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                          DEBUG_OUTPUT.printf_P(
+                                              PSTR(" IP6 address (%s)\n"),
+                                              pIP6Address->m_IPAddress.toString().c_str()););
                         }
                         else  // 'Goodbye' message for known IP6 address
                         {
-                            pIP6Address->m_TTL.prepareDeletion();  // Prepare answer deletion according to RFC 6762, 10.1
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), pIP6Address->m_IPAddress.toString().c_str()););
+                            pIP6Address->m_TTL.prepareDeletion();  // Prepare answer deletion
+                                                                   // according to RFC 6762, 10.1
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _processAAnswer: 'Goodbye' received for "));
+                                          _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                          DEBUG_OUTPUT.printf_P(
+                                              PSTR(" IP6 address (%s)\n"),
+                                              pIP6Address->m_IPAddress.toString().c_str()););
                         }
                     }
                     else
                     {
-                        // Until now unknown IP6 address -> Add (if the message isn't just a 'Goodbye' note)
+                        // Until now unknown IP6 address -> Add (if the message isn't just a
+                        // 'Goodbye' note)
                         if (p_pAAAAAnswer->m_u32TTL)  // NOT just a 'Goodbye' message
                         {
-                            pIP6Address = new stcIP6Address(p_pAAAAAnswer->m_IPAddress, p_pAAAAAnswer->m_u32TTL);
+                            pIP6Address = new stcIP6Address(p_pAAAAAnswer->m_IPAddress,
+                                                            p_pAAAAAnswer->m_u32TTL);
                             if ((pIP6Address) && (pSQAnswer->addIP6Address(pIP6Address)))
                             {
                                 pSQAnswer->m_u32ContentFlags |= ServiceQueryAnswerType_IP6Address;
 
                                 if (pServiceQuery->m_fnCallback)
                                 {
-                                    pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, true, pServiceQuery->m_pUserdata);
+                                    pServiceQuery->m_fnCallback(
+                                        this, (hMDNSServiceQuery)pServiceQuery,
+                                        pServiceQuery->indexOfAnswer(pSQAnswer),
+                                        ServiceQueryAnswerType_IP6Address, true,
+                                        pServiceQuery->m_pUserdata);
                                 }
                             }
                             else
                             {
-                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP6 address (%s)!\n"), p_pAAAAAnswer->m_IPAddress.toString().c_str()););
+                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                                    PSTR("[MDNSResponder] _processAAnswer: FAILED to add IP6 "
+                                         "address (%s)!\n"),
+                                    p_pAAAAAnswer->m_IPAddress.toString().c_str()););
                             }
                         }
                     }
@@ -1113,21 +1355,22 @@ namespace MDNSImplementation
 #endif
 
     /*
-    PROBING
-*/
+        PROBING
+    */
 
     /*
-    MDNSResponder::_updateProbeStatus
-
-    Manages the (outgoing) probing process.
-    - If probing has not been started yet (ProbingStatus_NotStarted), the initial delay (see RFC 6762) is determined and
-     the process is started
-    - After timeout (of initial or subsequential delay) a probe message is send out for three times. If the message has
-     already been sent out three times, the probing has been successful and is finished.
-
-    Conflict management is handled in '_parseResponse ff.'
-    Tiebraking is handled in 'parseQuery ff.'
-*/
+        MDNSResponder::_updateProbeStatus
+
+        Manages the (outgoing) probing process.
+        - If probing has not been started yet (ProbingStatus_NotStarted), the initial delay (see RFC
+       6762) is determined and the process is started
+        - After timeout (of initial or subsequential delay) a probe message is send out for three
+       times. If the message has already been sent out three times, the probing has been successful
+       and is finished.
+
+        Conflict management is handled in '_parseResponse ff.'
+        Tiebraking is handled in 'parseQuery ff.'
+    */
     bool MDNSResponder::_updateProbeStatus(void)
     {
         bool bResult = true;
@@ -1136,27 +1379,31 @@ namespace MDNSImplementation
         // Probe host domain
         if (ProbingStatus_ReadyToStart == m_HostProbeInformation.m_ProbingStatus)
         {
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Starting host probing...\n")););
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] _updateProbeStatus: Starting host probing...\n")););
 
             // First probe delay SHOULD be random 0-250 ms
             m_HostProbeInformation.m_Timeout.reset(rand() % MDNS_PROBE_DELAY);
             m_HostProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
         }
-        else if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing AND
-                 (m_HostProbeInformation.m_Timeout.expired()))                            // Time for next probe
+        else if ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus)
+                 &&                                             // Probing AND
+                 (m_HostProbeInformation.m_Timeout.expired()))  // Time for next probe
         {
             if (MDNS_PROBE_COUNT > m_HostProbeInformation.m_u8SentCount)  // Send next probe
             {
                 if ((bResult = _sendHostProbe()))
                 {
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Did sent host probe\n\n")););
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _updateProbeStatus: Did sent host probe\n\n")););
                     m_HostProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);
                     ++m_HostProbeInformation.m_u8SentCount;
                 }
             }
             else  // Probing finished
             {
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host probing.\n")););
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                    PSTR("[MDNSResponder] _updateProbeStatus: Done host probing.\n")););
                 m_HostProbeInformation.m_ProbingStatus = ProbingStatus_Done;
                 m_HostProbeInformation.m_Timeout.resetToNeverExpires();
                 if (m_HostProbeInformation.m_fnHostProbeResultCallback)
@@ -1167,10 +1414,12 @@ namespace MDNSImplementation
                 // Prepare to announce host
                 m_HostProbeInformation.m_u8SentCount = 0;
                 m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared host announcing.\n\n")););
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                    PSTR("[MDNSResponder] _updateProbeStatus: Prepared host announcing.\n\n")););
             }
         }  // else: Probing already finished OR waiting for next time slot
-        else if ((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus) && (m_HostProbeInformation.m_Timeout.expired()))
+        else if ((ProbingStatus_Done == m_HostProbeInformation.m_ProbingStatus)
+                 && (m_HostProbeInformation.m_Timeout.expired()))
         {
             if ((bResult = _announce(true, false)))  // Don't announce services here
             {
@@ -1179,53 +1428,71 @@ namespace MDNSImplementation
                 if (MDNS_ANNOUNCE_COUNT > m_HostProbeInformation.m_u8SentCount)
                 {
                     m_HostProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing host (%d).\n\n"), m_HostProbeInformation.m_u8SentCount););
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _updateProbeStatus: Announcing host (%d).\n\n"),
+                        m_HostProbeInformation.m_u8SentCount););
                 }
                 else
                 {
                     m_HostProbeInformation.m_Timeout.resetToNeverExpires();
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done host announcing.\n\n")););
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _updateProbeStatus: Done host announcing.\n\n")););
                 }
             }
         }
 
         //
         // Probe services
-        for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+        for (stcMDNSService* pService = m_pServices; ((bResult) && (pService));
+             pService                 = pService->m_pNext)
         {
-            if (ProbingStatus_ReadyToStart == pService->m_ProbeInformation.m_ProbingStatus)  // Ready to get started
+            if (ProbingStatus_ReadyToStart
+                == pService->m_ProbeInformation.m_ProbingStatus)  // Ready to get started
             {
-                pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);  // More or equal than first probe for host domain
+                pService->m_ProbeInformation.m_Timeout.reset(
+                    MDNS_PROBE_DELAY);  // More or equal than first probe for host domain
                 pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_InProgress;
             }
-            else if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing AND
-                     (pService->m_ProbeInformation.m_Timeout.expired()))                            // Time for next probe
+            else if ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus)
+                     &&                                                   // Probing AND
+                     (pService->m_ProbeInformation.m_Timeout.expired()))  // Time for next probe
             {
-                if (MDNS_PROBE_COUNT > pService->m_ProbeInformation.m_u8SentCount)  // Send next probe
+                if (MDNS_PROBE_COUNT
+                    > pService->m_ProbeInformation.m_u8SentCount)  // Send next probe
                 {
                     if ((bResult = _sendServiceProbe(*pService)))
                     {
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Did sent service probe (%u)\n\n"), (pService->m_ProbeInformation.m_u8SentCount + 1)););
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                            PSTR("[MDNSResponder] _updateProbeStatus: Did sent service probe "
+                                 "(%u)\n\n"),
+                            (pService->m_ProbeInformation.m_u8SentCount + 1)););
                         pService->m_ProbeInformation.m_Timeout.reset(MDNS_PROBE_DELAY);
                         ++pService->m_ProbeInformation.m_u8SentCount;
                     }
                 }
                 else  // Probing finished
                 {
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service probing %s.%s.%s\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: "
+                                                             "Done service probing %s.%s.%s\n\n"),
+                                                        (pService->m_pcName ?: m_pcHostname),
+                                                        pService->m_pcService,
+                                                        pService->m_pcProtocol););
                     pService->m_ProbeInformation.m_ProbingStatus = ProbingStatus_Done;
                     pService->m_ProbeInformation.m_Timeout.resetToNeverExpires();
                     if (pService->m_ProbeInformation.m_fnServiceProbeResultCallback)
                     {
-                        pService->m_ProbeInformation.m_fnServiceProbeResultCallback(pService->m_pcName, pService, true);
+                        pService->m_ProbeInformation.m_fnServiceProbeResultCallback(
+                            pService->m_pcName, pService, true);
                     }
                     // Prepare to announce service
                     pService->m_ProbeInformation.m_u8SentCount = 0;
                     pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Prepared service announcing.\n\n")););
+                    DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR(
+                        "[MDNSResponder] _updateProbeStatus: Prepared service announcing.\n\n")););
                 }
             }  // else: Probing already finished OR waiting for next time slot
-            else if ((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus) && (pService->m_ProbeInformation.m_Timeout.expired()))
+            else if ((ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus)
+                     && (pService->m_ProbeInformation.m_Timeout.expired()))
             {
                 if ((bResult = _announceService(*pService)))  // Announce service
                 {
@@ -1234,74 +1501,87 @@ namespace MDNSImplementation
                     if (MDNS_ANNOUNCE_COUNT > pService->m_ProbeInformation.m_u8SentCount)
                     {
                         pService->m_ProbeInformation.m_Timeout.reset(MDNS_ANNOUNCE_DELAY);
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Announcing service %s.%s.%s (%d)\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_ProbeInformation.m_u8SentCount););
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                            PSTR("[MDNSResponder] _updateProbeStatus: Announcing service %s.%s.%s "
+                                 "(%d)\n\n"),
+                            (pService->m_pcName ?: m_pcHostname), pService->m_pcService,
+                            pService->m_pcProtocol, pService->m_ProbeInformation.m_u8SentCount););
                     }
                     else
                     {
                         pService->m_ProbeInformation.m_Timeout.resetToNeverExpires();
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done service announcing for %s.%s.%s\n\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol););
+                        DEBUG_EX_INFO(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: Done "
+                                                       "service announcing for %s.%s.%s\n\n"),
+                                                  (pService->m_pcName ?: m_pcHostname),
+                                                  pService->m_pcService, pService->m_pcProtocol););
                     }
                 }
             }
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: FAILED!\n\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _updateProbeStatus: FAILED!\n\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_resetProbeStatus
+        MDNSResponder::_resetProbeStatus
 
-    Resets the probe status.
-    If 'p_bRestart' is set, the status is set to ProbingStatus_NotStarted. Consequently,
-    when running 'updateProbeStatus' (which is done in every '_update' loop), the probing
-    process is restarted.
-*/
+        Resets the probe status.
+        If 'p_bRestart' is set, the status is set to ProbingStatus_NotStarted. Consequently,
+        when running 'updateProbeStatus' (which is done in every '_update' loop), the probing
+        process is restarted.
+    */
     bool MDNSResponder::_resetProbeStatus(bool p_bRestart /*= true*/)
     {
         m_HostProbeInformation.clear(false);
-        m_HostProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
+        m_HostProbeInformation.m_ProbingStatus
+            = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
 
         for (stcMDNSService* pService = m_pServices; pService; pService = pService->m_pNext)
         {
             pService->m_ProbeInformation.clear(false);
-            pService->m_ProbeInformation.m_ProbingStatus = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
+            pService->m_ProbeInformation.m_ProbingStatus
+                = (p_bRestart ? ProbingStatus_ReadyToStart : ProbingStatus_Done);
         }
         return true;
     }
 
     /*
-    MDNSResponder::_hasProbesWaitingForAnswers
-*/
+        MDNSResponder::_hasProbesWaitingForAnswers
+    */
     bool MDNSResponder::_hasProbesWaitingForAnswers(void) const
     {
-        bool bResult = ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing
-                        (0 < m_HostProbeInformation.m_u8SentCount));                             // And really probing
+        bool bResult
+            = ((ProbingStatus_InProgress == m_HostProbeInformation.m_ProbingStatus) &&  // Probing
+               (0 < m_HostProbeInformation.m_u8SentCount));  // And really probing
 
-        for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
+        for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService));
+             pService                 = pService->m_pNext)
         {
-            bResult = ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus) &&  // Probing
-                       (0 < pService->m_ProbeInformation.m_u8SentCount));                             // And really probing
+            bResult = ((ProbingStatus_InProgress == pService->m_ProbeInformation.m_ProbingStatus)
+                       &&                                                  // Probing
+                       (0 < pService->m_ProbeInformation.m_u8SentCount));  // And really probing
         }
         return bResult;
     }
 
     /*
-    MDNSResponder::_sendHostProbe
+        MDNSResponder::_sendHostProbe
 
-    Asks (probes) in the local network for the planned host domain
-    - (eg. esp8266.local)
+        Asks (probes) in the local network for the planned host domain
+        - (eg. esp8266.local)
 
-    To allow 'tiebreaking' (see '_parseQuery'), the answers for these questions are delivered in
-    the 'knwon answers' section of the query.
-    Host domain:
-    - A/AAAA (eg. esp8266.esp -> 192.168.2.120)
-*/
+        To allow 'tiebreaking' (see '_parseQuery'), the answers for these questions are delivered in
+        the 'knwon answers' section of the query.
+        Host domain:
+        - A/AAAA (eg. esp8266.esp -> 192.168.2.120)
+    */
     bool MDNSResponder::_sendHostProbe(void)
     {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe (%s, %lu)\n"), m_pcHostname, millis()););
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe (%s, %lu)\n"),
+                                            m_pcHostname, millis()););
 
         bool bResult = true;
 
@@ -1310,11 +1590,14 @@ namespace MDNSImplementation
         sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
 
         sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
-        if (((bResult = (0 != sendParameter.m_pQuestions))) && ((bResult = _buildDomainForHost(m_pcHostname, sendParameter.m_pQuestions->m_Header.m_Domain))))
+        if (((bResult = (0 != sendParameter.m_pQuestions)))
+            && ((bResult = _buildDomainForHost(m_pcHostname,
+                                               sendParameter.m_pQuestions->m_Header.m_Domain))))
         {
-            //sendParameter.m_pQuestions->m_bUnicast = true;
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type  = DNS_RRTYPE_ANY;
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
+            // sendParameter.m_pQuestions->m_bUnicast = true;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class
+                = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
 
             // Add known answers
 #ifdef MDNS_IP4_SUPPORT
@@ -1326,7 +1609,8 @@ namespace MDNSImplementation
         }
         else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED to create host question!\n")););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] _sendHostProbe: FAILED to create host question!\n")););
             if (sendParameter.m_pQuestions)
             {
                 delete sendParameter.m_pQuestions;
@@ -1334,27 +1618,29 @@ namespace MDNSImplementation
             }
         }
         DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED!\n"));
-                     });
+                     { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendHostProbe: FAILED!\n")); });
         return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
 
     /*
-    MDNSResponder::_sendServiceProbe
-
-    Asks (probes) in the local network for the planned service instance domain
-    - (eg. MyESP._http._tcp.local).
-
-    To allow 'tiebreaking' (see '_parseQuery'), the answers for these questions are delivered in
-    the 'knwon answers' section of the query.
-    Service domain:
-    - SRV (eg. MyESP._http._tcp.local -> 5000 esp8266.local)
-    - PTR NAME (eg. _http._tcp.local -> MyESP._http._tcp.local) (TODO: Check if needed, maybe TXT is better)
-*/
+        MDNSResponder::_sendServiceProbe
+
+        Asks (probes) in the local network for the planned service instance domain
+        - (eg. MyESP._http._tcp.local).
+
+        To allow 'tiebreaking' (see '_parseQuery'), the answers for these questions are delivered in
+        the 'knwon answers' section of the query.
+        Service domain:
+        - SRV (eg. MyESP._http._tcp.local -> 5000 esp8266.local)
+        - PTR NAME (eg. _http._tcp.local -> MyESP._http._tcp.local) (TODO: Check if needed, maybe
+       TXT is better)
+    */
     bool MDNSResponder::_sendServiceProbe(stcMDNSService& p_rService)
     {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe (%s.%s.%s, %lu)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, millis()););
+        DEBUG_EX_INFO(
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe (%s.%s.%s, %lu)\n"),
+                                  (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService,
+                                  p_rService.m_pcProtocol, millis()););
 
         bool bResult = true;
 
@@ -1363,34 +1649,38 @@ namespace MDNSImplementation
         sendParameter.m_bCacheFlush = false;  // RFC 6762 10.2
 
         sendParameter.m_pQuestions = new stcMDNS_RRQuestion;
-        if (((bResult = (0 != sendParameter.m_pQuestions))) && ((bResult = _buildDomainForService(p_rService, true, sendParameter.m_pQuestions->m_Header.m_Domain))))
+        if (((bResult = (0 != sendParameter.m_pQuestions)))
+            && ((bResult = _buildDomainForService(p_rService, true,
+                                                  sendParameter.m_pQuestions->m_Header.m_Domain))))
         {
-            sendParameter.m_pQuestions->m_bUnicast                       = true;
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type  = DNS_RRTYPE_ANY;
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
+            sendParameter.m_pQuestions->m_bUnicast                      = true;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY;
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class
+                = (0x8000 | DNS_RRCLASS_IN);  // Unicast & INternet
 
             // Add known answers
-            p_rService.m_u8ReplyMask = (ContentFlag_SRV | ContentFlag_PTR_NAME);  // Add SRV and PTR NAME answers
+            p_rService.m_u8ReplyMask
+                = (ContentFlag_SRV | ContentFlag_PTR_NAME);  // Add SRV and PTR NAME answers
         }
         else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED to create service question!\n")););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] _sendServiceProbe: FAILED to create service question!\n")););
             if (sendParameter.m_pQuestions)
             {
                 delete sendParameter.m_pQuestions;
                 sendParameter.m_pQuestions = 0;
             }
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendServiceProbe: FAILED!\n"));
+        });
         return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
 
     /*
-    MDNSResponder::_cancelProbingForHost
-*/
+        MDNSResponder::_cancelProbingForHost
+    */
     bool MDNSResponder::_cancelProbingForHost(void)
     {
         bool bResult = false;
@@ -1404,7 +1694,8 @@ namespace MDNSImplementation
             bResult = true;
         }
 
-        for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService)); pService = pService->m_pNext)
+        for (stcMDNSService* pService = m_pServices; ((!bResult) && (pService));
+             pService                 = pService->m_pNext)
         {
             bResult = _cancelProbingForService(*pService);
         }
@@ -1412,8 +1703,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_cancelProbingForService
-*/
+        MDNSResponder::_cancelProbingForService
+    */
     bool MDNSResponder::_cancelProbingForService(stcMDNSService& p_rService)
     {
         bool bResult = false;
@@ -1422,35 +1713,35 @@ namespace MDNSImplementation
         // Send notification
         if (p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback)
         {
-            p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback(p_rService.m_pcName, &p_rService, false);
+            p_rService.m_ProbeInformation.m_fnServiceProbeResultCallback(p_rService.m_pcName,
+                                                                         &p_rService, false);
             bResult = true;
         }
         return bResult;
     }
 
     /**
-    ANNOUNCING
-*/
+        ANNOUNCING
+    */
 
     /*
-    MDNSResponder::_announce
-
-    Announces the host domain:
-    - A/AAAA (eg. esp8266.local -> 192.168.2.120)
-    - PTR (eg. 192.168.2.120.in-addr.arpa -> esp8266.local)
-
-    and all presented services:
-    - PTR_TYPE (_services._dns-sd._udp.local -> _http._tcp.local)
-    - PTR_NAME (eg. _http._tcp.local -> MyESP8266._http._tcp.local)
-    - SRV (eg. MyESP8266._http._tcp.local -> 5000 esp8266.local)
-    - TXT (eg. MyESP8266._http._tcp.local -> c#=1)
-
-    Goodbye (Un-Announcing) for the host domain and all services is also handled here.
-    Goodbye messages are created by setting the TTL for the answer to 0, this happens
-    inside the '_writeXXXAnswer' procs via 'sendParameter.m_bUnannounce = true'
-*/
-    bool MDNSResponder::_announce(bool p_bAnnounce,
-                                  bool p_bIncludeServices)
+        MDNSResponder::_announce
+
+        Announces the host domain:
+        - A/AAAA (eg. esp8266.local -> 192.168.2.120)
+        - PTR (eg. 192.168.2.120.in-addr.arpa -> esp8266.local)
+
+        and all presented services:
+        - PTR_TYPE (_services._dns-sd._udp.local -> _http._tcp.local)
+        - PTR_NAME (eg. _http._tcp.local -> MyESP8266._http._tcp.local)
+        - SRV (eg. MyESP8266._http._tcp.local -> 5000 esp8266.local)
+        - TXT (eg. MyESP8266._http._tcp.local -> c#=1)
+
+        Goodbye (Un-Announcing) for the host domain and all services is also handled here.
+        Goodbye messages are created by setting the TTL for the answer to 0, this happens
+        inside the '_writeXXXAnswer' procs via 'sendParameter.m_bUnannounce = true'
+    */
+    bool MDNSResponder::_announce(bool p_bAnnounce, bool p_bIncludeServices)
     {
         bool bResult = false;
 
@@ -1459,9 +1750,11 @@ namespace MDNSImplementation
         {
             bResult = true;
 
-            sendParameter.m_bResponse    = true;  // Announces are 'Unsolicited authoritative responses'
+            sendParameter.m_bResponse
+                = true;  // Announces are 'Unsolicited authoritative responses'
             sendParameter.m_bAuthorative = true;
-            sendParameter.m_bUnannounce  = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
+            sendParameter.m_bUnannounce = !p_bAnnounce;  // When unannouncing, the TTL is set to '0'
+                                                         // while creating the answers
 
             // Announce host
             sendParameter.m_u8HostReplyMask = 0;
@@ -1474,72 +1767,84 @@ namespace MDNSImplementation
             sendParameter.m_u8HostReplyMask |= ContentFlag_PTR_IP6;  // PTR_IP6 answer
 #endif
 
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing host %s (content 0x%X)\n"), m_pcHostname, sendParameter.m_u8HostReplyMask););
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] _announce: Announcing host %s (content 0x%X)\n"),
+                m_pcHostname, sendParameter.m_u8HostReplyMask););
 
             if (p_bIncludeServices)
             {
                 // Announce services (service type, name, SRV (location) and TXTs)
-                for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+                for (stcMDNSService* pService = m_pServices; ((bResult) && (pService));
+                     pService                 = pService->m_pNext)
                 {
                     if (ProbingStatus_Done == pService->m_ProbeInformation.m_ProbingStatus)
                     {
-                        pService->m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
-
-                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: Announcing service %s.%s.%s (content %u)\n"), (pService->m_pcName ?: m_pcHostname), pService->m_pcService, pService->m_pcProtocol, pService->m_u8ReplyMask););
+                        pService->m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME
+                                                   | ContentFlag_SRV | ContentFlag_TXT);
+
+                        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                            PSTR("[MDNSResponder] _announce: Announcing service %s.%s.%s (content "
+                                 "%u)\n"),
+                            (pService->m_pcName ?: m_pcHostname), pService->m_pcService,
+                            pService->m_pcProtocol, pService->m_u8ReplyMask););
                     }
                 }
             }
         }
         DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: FAILED!\n"));
-                     });
+                     { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announce: FAILED!\n")); });
         return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
 
     /*
-    MDNSResponder::_announceService
-*/
-    bool MDNSResponder::_announceService(stcMDNSService& p_rService,
-                                         bool            p_bAnnounce /*= true*/)
+        MDNSResponder::_announceService
+    */
+    bool MDNSResponder::_announceService(stcMDNSService& p_rService, bool p_bAnnounce /*= true*/)
     {
         bool bResult = false;
 
         stcMDNSSendParameter sendParameter;
         if (ProbingStatus_Done == p_rService.m_ProbeInformation.m_ProbingStatus)
         {
-            sendParameter.m_bResponse    = true;  // Announces are 'Unsolicited authoritative responses'
+            sendParameter.m_bResponse
+                = true;  // Announces are 'Unsolicited authoritative responses'
             sendParameter.m_bAuthorative = true;
-            sendParameter.m_bUnannounce  = !p_bAnnounce;  // When unannouncing, the TTL is set to '0' while creating the answers
+            sendParameter.m_bUnannounce = !p_bAnnounce;  // When unannouncing, the TTL is set to '0'
+                                                         // while creating the answers
 
             // DON'T announce host
             sendParameter.m_u8HostReplyMask = 0;
 
             // Announce services (service type, name, SRV (location) and TXTs)
-            p_rService.m_u8ReplyMask = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
-            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: Announcing service %s.%s.%s (content 0x%X)\n"), (p_rService.m_pcName ?: m_pcHostname), p_rService.m_pcService, p_rService.m_pcProtocol, p_rService.m_u8ReplyMask););
+            p_rService.m_u8ReplyMask
+                = (ContentFlag_PTR_TYPE | ContentFlag_PTR_NAME | ContentFlag_SRV | ContentFlag_TXT);
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: Announcing "
+                                                     "service %s.%s.%s (content 0x%X)\n"),
+                                                (p_rService.m_pcName ?: m_pcHostname),
+                                                p_rService.m_pcService, p_rService.m_pcProtocol,
+                                                p_rService.m_u8ReplyMask););
 
             bResult = true;
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _announceService: FAILED!\n"));
+        });
         return ((bResult) && (_sendMDNSMessage(sendParameter)));
     }
 
     /**
-    SERVICE QUERY CACHE
-*/
+        SERVICE QUERY CACHE
+    */
 
     /*
-    MDNSResponder::_hasServiceQueriesWaitingForAnswers
-*/
+        MDNSResponder::_hasServiceQueriesWaitingForAnswers
+    */
     bool MDNSResponder::_hasServiceQueriesWaitingForAnswers(void) const
     {
         bool bOpenQueries = false;
 
-        for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; pServiceQuery; pServiceQuery = pServiceQuery->m_pNext)
+        for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; pServiceQuery;
+             pServiceQuery                      = pServiceQuery->m_pNext)
         {
             if (pServiceQuery->m_bAwaitingAnswers)
             {
@@ -1551,36 +1856,41 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_checkServiceQueryCache
+        MDNSResponder::_checkServiceQueryCache
 
-    For any 'living' service query (m_bAwaitingAnswers == true) all available answers (their components)
-    are checked for topicality based on the stored reception time and the answers TTL.
-    When the components TTL is outlasted by more than 80%, a new question is generated, to get updated information.
-    When no update arrived (in time), the component is removed from the answer (cache).
+        For any 'living' service query (m_bAwaitingAnswers == true) all available answers (their
+       components) are checked for topicality based on the stored reception time and the answers
+       TTL. When the components TTL is outlasted by more than 80%, a new question is generated, to
+       get updated information. When no update arrived (in time), the component is removed from the
+       answer (cache).
 
-*/
+    */
     bool MDNSResponder::_checkServiceQueryCache(void)
     {
         bool bResult = true;
 
-        DEBUG_EX_INFO(
-            bool printedInfo = false;);
-        for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; ((bResult) && (pServiceQuery)); pServiceQuery = pServiceQuery->m_pNext)
+        DEBUG_EX_INFO(bool printedInfo = false;);
+        for (stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries; ((bResult) && (pServiceQuery));
+             pServiceQuery                      = pServiceQuery->m_pNext)
         {
             //
             // Resend dynamic service queries, if not already done often enough
-            if ((!pServiceQuery->m_bLegacyQuery) && (MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount) && (pServiceQuery->m_ResendTimeout.expired()))
+            if ((!pServiceQuery->m_bLegacyQuery)
+                && (MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount)
+                && (pServiceQuery->m_ResendTimeout.expired()))
             {
                 if ((bResult = _sendMDNSServiceQuery(*pServiceQuery)))
                 {
                     ++pServiceQuery->m_u8SentCount;
-                    pServiceQuery->m_ResendTimeout.reset((MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount)
-                                                             ? (MDNS_DYNAMIC_QUERY_RESEND_DELAY * (pServiceQuery->m_u8SentCount - 1))
-                                                             : esp8266::polledTimeout::oneShotMs::neverExpires);
+                    pServiceQuery->m_ResendTimeout.reset(
+                        (MDNS_DYNAMIC_QUERY_RESEND_COUNT > pServiceQuery->m_u8SentCount) ?
+                            (MDNS_DYNAMIC_QUERY_RESEND_DELAY * (pServiceQuery->m_u8SentCount - 1)) :
+                            esp8266::polledTimeout::oneShotMs::neverExpires);
                 }
-                DEBUG_EX_INFO(
-                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: %s to resend service query!"), (bResult ? "Succeeded" : "FAILED"));
-                    printedInfo = true;);
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                    PSTR("[MDNSResponder] _checkServiceQueryCache: %s to resend service query!"),
+                    (bResult ? "Succeeded" : "FAILED"));
+                              printedInfo = true;);
             }
 
             //
@@ -1597,9 +1907,12 @@ namespace MDNSImplementation
                     {
                         if (!pSQAnswer->m_TTLServiceDomain.finalTimeoutLevel())
                         {
-                            bResult = ((_sendMDNSServiceQuery(*pServiceQuery)) && (pSQAnswer->m_TTLServiceDomain.restart()));
+                            bResult = ((_sendMDNSServiceQuery(*pServiceQuery))
+                                       && (pSQAnswer->m_TTLServiceDomain.restart()));
                             DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: PTR update scheduled for "));
+                                DEBUG_OUTPUT.printf_P(
+                                    PSTR("[MDNSResponder] _checkServiceQueryCache: PTR update "
+                                         "scheduled for "));
                                 _printRRDomain(pSQAnswer->m_ServiceDomain);
                                 DEBUG_OUTPUT.printf_P(PSTR(" %s\n"), (bResult ? "OK" : "FAILURE"));
                                 printedInfo = true;);
@@ -1609,14 +1922,19 @@ namespace MDNSImplementation
                             // Timed out! -> Delete
                             if (pServiceQuery->m_fnCallback)
                             {
-                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain), false);
+                                MDNSServiceInfo serviceInfo(
+                                    *this, (hMDNSServiceQuery)pServiceQuery,
+                                    pServiceQuery->indexOfAnswer(pSQAnswer));
+                                pServiceQuery->m_fnCallback(
+                                    serviceInfo,
+                                    static_cast<AnswerType>(ServiceQueryAnswerType_ServiceDomain),
+                                    false);
                             }
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove PTR answer for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                                printedInfo = true;);
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove PTR "
+                                     "answer for "));
+                                          _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                          DEBUG_OUTPUT.printf_P(PSTR("\n")); printedInfo = true;);
 
                             bResult   = pServiceQuery->removeAnswer(pSQAnswer);
                             pSQAnswer = 0;
@@ -1630,28 +1948,33 @@ namespace MDNSImplementation
                     {
                         if (!pSQAnswer->m_TTLHostDomainAndPort.finalTimeoutLevel())
                         {
-                            bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_SRV)) && (pSQAnswer->m_TTLHostDomainAndPort.restart()));
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: SRV update scheduled for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" host domain and port %s\n"), (bResult ? "OK" : "FAILURE"));
-                                printedInfo = true;);
+                            bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_SRV))
+                                       && (pSQAnswer->m_TTLHostDomainAndPort.restart()));
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _checkServiceQueryCache: SRV update "
+                                     "scheduled for "));
+                                          _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                          DEBUG_OUTPUT.printf_P(PSTR(" host domain and port %s\n"),
+                                                                (bResult ? "OK" : "FAILURE"));
+                                          printedInfo = true;);
                         }
                         else
                         {
                             // Timed out! -> Delete
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove SRV answer for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
-                                printedInfo = true;);
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove SRV "
+                                     "answer for "));
+                                          _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                          DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n"));
+                                          printedInfo = true;);
                             // Delete
                             pSQAnswer->m_HostDomain.clear();
                             pSQAnswer->releaseHostDomain();
                             pSQAnswer->m_u16Port = 0;
                             pSQAnswer->m_TTLHostDomainAndPort.set(0);
                             uint32_t u32ContentFlags = ServiceQueryAnswerType_HostDomainAndPort;
-                            // As the host domain is the base for the IP4- and IP6Address, remove these too
+                            // As the host domain is the base for the IP4- and IP6Address, remove
+                            // these too
 #ifdef MDNS_IP4_SUPPORT
                             pSQAnswer->releaseIP4Addresses();
                             u32ContentFlags |= ServiceQueryAnswerType_IP4Address;
@@ -1665,8 +1988,11 @@ namespace MDNSImplementation
                             pSQAnswer->m_u32ContentFlags &= ~u32ContentFlags;
                             if (pServiceQuery->m_fnCallback)
                             {
-                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(u32ContentFlags), false);
+                                MDNSServiceInfo serviceInfo(
+                                    *this, (hMDNSServiceQuery)pServiceQuery,
+                                    pServiceQuery->indexOfAnswer(pSQAnswer));
+                                pServiceQuery->m_fnCallback(
+                                    serviceInfo, static_cast<AnswerType>(u32ContentFlags), false);
                             }
                         }
                     }  // HostDomainAndPort flagged
@@ -1676,21 +2002,25 @@ namespace MDNSImplementation
                     {
                         if (!pSQAnswer->m_TTLTxts.finalTimeoutLevel())
                         {
-                            bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_TXT)) && (pSQAnswer->m_TTLTxts.restart()));
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: TXT update scheduled for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" TXTs %s\n"), (bResult ? "OK" : "FAILURE"));
-                                printedInfo = true;);
+                            bResult = ((_sendMDNSQuery(pSQAnswer->m_ServiceDomain, DNS_RRTYPE_TXT))
+                                       && (pSQAnswer->m_TTLTxts.restart()));
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _checkServiceQueryCache: TXT update "
+                                     "scheduled for "));
+                                          _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                          DEBUG_OUTPUT.printf_P(PSTR(" TXTs %s\n"),
+                                                                (bResult ? "OK" : "FAILURE"));
+                                          printedInfo = true;);
                         }
                         else
                         {
                             // Timed out! -> Delete
-                            DEBUG_EX_INFO(
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove TXT answer for "));
-                                _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
-                                printedInfo = true;);
+                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove TXT "
+                                     "answer for "));
+                                          _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                          DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n"));
+                                          printedInfo = true;);
                             // Delete
                             pSQAnswer->m_Txts.clear();
                             pSQAnswer->m_TTLTxts.set(0);
@@ -1700,8 +2030,12 @@ namespace MDNSImplementation
 
                             if (pServiceQuery->m_fnCallback)
                             {
-                                MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_Txts), false);
+                                MDNSServiceInfo serviceInfo(
+                                    *this, (hMDNSServiceQuery)pServiceQuery,
+                                    pServiceQuery->indexOfAnswer(pSQAnswer));
+                                pServiceQuery->m_fnCallback(
+                                    serviceInfo,
+                                    static_cast<AnswerType>(ServiceQueryAnswerType_Txts), false);
                             }
                         }
                     }  // TXTs flagged
@@ -1709,46 +2043,63 @@ namespace MDNSImplementation
                     // 3. level answers
 #ifdef MDNS_IP4_SUPPORT
                     // IP4Address (from A)
-                    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address       = pSQAnswer->m_pIP4Addresses;
-                    bool                                           bAUpdateQuerySent = false;
+                    stcMDNSServiceQuery::stcAnswer::stcIP4Address* pIP4Address
+                        = pSQAnswer->m_pIP4Addresses;
+                    bool bAUpdateQuerySent = false;
                     while ((pIP4Address) && (bResult))
                     {
-                        stcMDNSServiceQuery::stcAnswer::stcIP4Address* pNextIP4Address = pIP4Address->m_pNext;  // Get 'next' early, as 'current' may be deleted at the end...
+                        stcMDNSServiceQuery::stcAnswer::stcIP4Address* pNextIP4Address
+                            = pIP4Address->m_pNext;  // Get 'next' early, as 'current' may be
+                                                     // deleted at the end...
 
                         if (pIP4Address->m_TTL.flagged())
                         {
                             if (!pIP4Address->m_TTL.finalTimeoutLevel())  // Needs update
                             {
-                                if ((bAUpdateQuerySent) || ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_A))))
+                                if ((bAUpdateQuerySent)
+                                    || ((bResult
+                                         = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_A))))
                                 {
                                     pIP4Address->m_TTL.restart();
                                     bAUpdateQuerySent = true;
 
                                     DEBUG_EX_INFO(
-                                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP4 update scheduled for "));
+                                        DEBUG_OUTPUT.printf_P(
+                                            PSTR("[MDNSResponder] _checkServiceQueryCache: IP4 "
+                                                 "update scheduled for "));
                                         _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                        DEBUG_OUTPUT.printf_P(PSTR(" IP4 address (%s)\n"), (pIP4Address->m_IPAddress.toString().c_str()));
+                                        DEBUG_OUTPUT.printf_P(
+                                            PSTR(" IP4 address (%s)\n"),
+                                            (pIP4Address->m_IPAddress.toString().c_str()));
                                         printedInfo = true;);
                                 }
                             }
                             else
                             {
                                 // Timed out! -> Delete
-                                DEBUG_EX_INFO(
-                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove IP4 answer for "));
-                                    _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                    DEBUG_OUTPUT.printf_P(PSTR(" IP4 address\n"));
-                                    printedInfo = true;);
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                    PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove IP4 "
+                                         "answer for "));
+                                              _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                              DEBUG_OUTPUT.printf_P(PSTR(" IP4 address\n"));
+                                              printedInfo = true;);
                                 pSQAnswer->removeIP4Address(pIP4Address);
-                                if (!pSQAnswer->m_pIP4Addresses)  // NO IP4 address left -> remove content flag
+                                if (!pSQAnswer->m_pIP4Addresses)  // NO IP4 address left -> remove
+                                                                  // content flag
                                 {
-                                    pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP4Address;
+                                    pSQAnswer->m_u32ContentFlags
+                                        &= ~ServiceQueryAnswerType_IP4Address;
                                 }
                                 // Notify client
                                 if (pServiceQuery->m_fnCallback)
                                 {
-                                    MDNSServiceInfo serviceInfo(*this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer));
-                                    pServiceQuery->m_fnCallback(serviceInfo, static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address), false);
+                                    MDNSServiceInfo serviceInfo(
+                                        *this, (hMDNSServiceQuery)pServiceQuery,
+                                        pServiceQuery->indexOfAnswer(pSQAnswer));
+                                    pServiceQuery->m_fnCallback(
+                                        serviceInfo,
+                                        static_cast<AnswerType>(ServiceQueryAnswerType_IP4Address),
+                                        false);
                                 }
                             }
                         }  // IP4 flagged
@@ -1758,45 +2109,61 @@ namespace MDNSImplementation
 #endif
 #ifdef MDNS_IP6_SUPPORT
                     // IP6Address (from AAAA)
-                    stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address          = pSQAnswer->m_pIP6Addresses;
-                    bool                                           bAAAAUpdateQuerySent = false;
+                    stcMDNSServiceQuery::stcAnswer::stcIP6Address* pIP6Address
+                        = pSQAnswer->m_pIP6Addresses;
+                    bool bAAAAUpdateQuerySent = false;
                     while ((pIP6Address) && (bResult))
                     {
-                        stcMDNSServiceQuery::stcAnswer::stcIP6Address* pNextIP6Address = pIP6Address->m_pNext;  // Get 'next' early, as 'current' may be deleted at the end...
+                        stcMDNSServiceQuery::stcAnswer::stcIP6Address* pNextIP6Address
+                            = pIP6Address->m_pNext;  // Get 'next' early, as 'current' may be
+                                                     // deleted at the end...
 
                         if (pIP6Address->m_TTL.flagged())
                         {
                             if (!pIP6Address->m_TTL.finalTimeoutLevel())  // Needs update
                             {
-                                if ((bAAAAUpdateQuerySent) || ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain, DNS_RRTYPE_AAAA))))
+                                if ((bAAAAUpdateQuerySent)
+                                    || ((bResult = _sendMDNSQuery(pSQAnswer->m_HostDomain,
+                                                                  DNS_RRTYPE_AAAA))))
                                 {
                                     pIP6Address->m_TTL.restart();
                                     bAAAAUpdateQuerySent = true;
 
                                     DEBUG_EX_INFO(
-                                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: IP6 update scheduled for "));
+                                        DEBUG_OUTPUT.printf_P(
+                                            PSTR("[MDNSResponder] _checkServiceQueryCache: IP6 "
+                                                 "update scheduled for "));
                                         _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                        DEBUG_OUTPUT.printf_P(PSTR(" IP6 address (%s)\n"), (pIP6Address->m_IPAddress.toString().c_str()));
+                                        DEBUG_OUTPUT.printf_P(
+                                            PSTR(" IP6 address (%s)\n"),
+                                            (pIP6Address->m_IPAddress.toString().c_str()));
                                         printedInfo = true;);
                                 }
                             }
                             else
                             {
                                 // Timed out! -> Delete
-                                DEBUG_EX_INFO(
-                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove answer for "));
-                                    _printRRDomain(pSQAnswer->m_ServiceDomain);
-                                    DEBUG_OUTPUT.printf_P(PSTR(" IP6Address\n"));
-                                    printedInfo = true;);
+                                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                                    PSTR("[MDNSResponder] _checkServiceQueryCache: Will remove "
+                                         "answer for "));
+                                              _printRRDomain(pSQAnswer->m_ServiceDomain);
+                                              DEBUG_OUTPUT.printf_P(PSTR(" IP6Address\n"));
+                                              printedInfo = true;);
                                 pSQAnswer->removeIP6Address(pIP6Address);
-                                if (!pSQAnswer->m_pIP6Addresses)  // NO IP6 address left -> remove content flag
+                                if (!pSQAnswer->m_pIP6Addresses)  // NO IP6 address left -> remove
+                                                                  // content flag
                                 {
-                                    pSQAnswer->m_u32ContentFlags &= ~ServiceQueryAnswerType_IP6Address;
+                                    pSQAnswer->m_u32ContentFlags
+                                        &= ~ServiceQueryAnswerType_IP6Address;
                                 }
                                 // Notify client
                                 if (pServiceQuery->m_fnCallback)
                                 {
-                                    pServiceQuery->m_fnCallback(this, (hMDNSServiceQuery)pServiceQuery, pServiceQuery->indexOfAnswer(pSQAnswer), ServiceQueryAnswerType_IP6Address, false, pServiceQuery->m_pUserdata);
+                                    pServiceQuery->m_fnCallback(
+                                        this, (hMDNSServiceQuery)pServiceQuery,
+                                        pServiceQuery->indexOfAnswer(pSQAnswer),
+                                        ServiceQueryAnswerType_IP6Address, false,
+                                        pServiceQuery->m_pUserdata);
                                 }
                             }
                         }  // IP6 flagged
@@ -1808,38 +2175,37 @@ namespace MDNSImplementation
                 }
             }
         }
-        DEBUG_EX_INFO(
-            if (printedInfo)
-            {
-                DEBUG_OUTPUT.printf_P(PSTR("\n"));
-            });
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: FAILED!\n"));
-                     });
+        DEBUG_EX_INFO(if (printedInfo) { DEBUG_OUTPUT.printf_P(PSTR("\n")); });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _checkServiceQueryCache: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_replyMaskForHost
+        MDNSResponder::_replyMaskForHost
 
-    Determines the relevant host answers for the given question.
-    - A question for the hostname (eg. esp8266.local) will result in an A/AAAA (eg. 192.168.2.129) reply.
-    - A question for the reverse IP address (eg. 192-168.2.120.inarpa.arpa) will result in an PTR_IP4 (eg. esp8266.local) reply.
+        Determines the relevant host answers for the given question.
+        - A question for the hostname (eg. esp8266.local) will result in an A/AAAA (eg.
+       192.168.2.129) reply.
+        - A question for the reverse IP address (eg. 192-168.2.120.inarpa.arpa) will result in an
+       PTR_IP4 (eg. esp8266.local) reply.
 
-    In addition, a full name match (question domain == host domain) is marked.
-*/
+        In addition, a full name match (question domain == host domain) is marked.
+    */
     uint8_t MDNSResponder::_replyMaskForHost(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
-                                             bool*                                  p_pbFullNameMatch /*= 0*/) const
+                                             bool* p_pbFullNameMatch /*= 0*/) const
     {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost\n")););
+        // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost\n")););
 
         uint8_t u8ReplyMask = 0;
         (p_pbFullNameMatch ? * p_pbFullNameMatch = false : 0);
 
-        if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) || (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
+        if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class)
+            || (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
         {
-            if ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+            if ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type)
+                || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
             {
                 // PTR request
 #ifdef MDNS_IP4_SUPPORT
@@ -1848,7 +2214,8 @@ namespace MDNSImplementation
                 {
                     if (netif_is_up(pNetIf))
                     {
-                        if ((_buildDomainForReverseIP4(pNetIf->ip_addr, reverseIP4Domain)) && (p_RRHeader.m_Domain == reverseIP4Domain))
+                        if ((_buildDomainForReverseIP4(pNetIf->ip_addr, reverseIP4Domain))
+                            && (p_RRHeader.m_Domain == reverseIP4Domain))
                         {
                             // Reverse domain match
                             u8ReplyMask |= ContentFlag_PTR_IP4;
@@ -1862,19 +2229,22 @@ namespace MDNSImplementation
             }  // Address qeuest
 
             stcMDNS_RRDomain hostDomain;
-            if ((_buildDomainForHost(m_pcHostname, hostDomain)) && (p_RRHeader.m_Domain == hostDomain))  // Host domain match
+            if ((_buildDomainForHost(m_pcHostname, hostDomain))
+                && (p_RRHeader.m_Domain == hostDomain))  // Host domain match
             {
                 (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
 
 #ifdef MDNS_IP4_SUPPORT
-                if ((DNS_RRTYPE_A == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                if ((DNS_RRTYPE_A == p_RRHeader.m_Attributes.m_u16Type)
+                    || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
                 {
                     // IP4 address request
                     u8ReplyMask |= ContentFlag_A;
                 }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                if ((DNS_RRTYPE_AAAA == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                if ((DNS_RRTYPE_AAAA == p_RRHeader.m_Attributes.m_u16Type)
+                    || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
                 {
                     // IP6 address request
                     u8ReplyMask |= ContentFlag_AAAA;
@@ -1884,63 +2254,77 @@ namespace MDNSImplementation
         }
         else
         {
-            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
+            // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: INVALID
+            // RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
         }
-        DEBUG_EX_INFO(if (u8ReplyMask)
-                      {
-                          DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: 0x%X\n"), u8ReplyMask);
-                      });
+        DEBUG_EX_INFO(if (u8ReplyMask) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForHost: 0x%X\n"), u8ReplyMask);
+        });
         return u8ReplyMask;
     }
 
     /*
-    MDNSResponder::_replyMaskForService
-
-    Determines the relevant service answers for the given question
-    - A PTR dns-sd service enum question (_services.dns-sd._udp.local) will result into an PTR_TYPE (eg. _http._tcp.local) answer
-    - A PTR service type question (eg. _http._tcp.local) will result into an PTR_NAME (eg. MyESP._http._tcp.local) answer
-    - A PTR service name question (eg. MyESP._http._tcp.local) will result into an PTR_NAME (eg. MyESP._http._tcp.local) answer
-    - A SRV service name question (eg. MyESP._http._tcp.local) will result into an SRV (eg. 5000 MyESP.local) answer
-    - A TXT service name question (eg. MyESP._http._tcp.local) will result into an TXT (eg. c#=1) answer
-
-    In addition, a full name match (question domain == service instance domain) is marked.
-*/
+        MDNSResponder::_replyMaskForService
+
+        Determines the relevant service answers for the given question
+        - A PTR dns-sd service enum question (_services.dns-sd._udp.local) will result into an
+       PTR_TYPE (eg. _http._tcp.local) answer
+        - A PTR service type question (eg. _http._tcp.local) will result into an PTR_NAME (eg.
+       MyESP._http._tcp.local) answer
+        - A PTR service name question (eg. MyESP._http._tcp.local) will result into an PTR_NAME (eg.
+       MyESP._http._tcp.local) answer
+        - A SRV service name question (eg. MyESP._http._tcp.local) will result into an SRV (eg. 5000
+       MyESP.local) answer
+        - A TXT service name question (eg. MyESP._http._tcp.local) will result into an TXT (eg.
+       c#=1) answer
+
+        In addition, a full name match (question domain == service instance domain) is marked.
+    */
     uint8_t MDNSResponder::_replyMaskForService(const MDNSResponder::stcMDNS_RRHeader& p_RRHeader,
                                                 const MDNSResponder::stcMDNSService&   p_Service,
-                                                bool*                                  p_pbFullNameMatch /*= 0*/) const
+                                                bool* p_pbFullNameMatch /*= 0*/) const
     {
         uint8_t u8ReplyMask = 0;
         (p_pbFullNameMatch ? * p_pbFullNameMatch = false : 0);
 
-        if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class) || (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
+        if ((DNS_RRCLASS_IN == p_RRHeader.m_Attributes.m_u16Class)
+            || (DNS_RRCLASS_ANY == p_RRHeader.m_Attributes.m_u16Class))
         {
             stcMDNS_RRDomain DNSSDDomain;
             if ((_buildDomainForDNSSD(DNSSDDomain)) &&  // _services._dns-sd._udp.local
-                (p_RRHeader.m_Domain == DNSSDDomain) && ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
+                (p_RRHeader.m_Domain == DNSSDDomain)
+                && ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type)
+                    || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
             {
                 // Common service info requested
                 u8ReplyMask |= ContentFlag_PTR_TYPE;
             }
 
             stcMDNS_RRDomain serviceDomain;
-            if ((_buildDomainForService(p_Service, false, serviceDomain)) &&  // eg. _http._tcp.local
-                (p_RRHeader.m_Domain == serviceDomain) && ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
+            if ((_buildDomainForService(p_Service, false, serviceDomain))
+                &&  // eg. _http._tcp.local
+                (p_RRHeader.m_Domain == serviceDomain)
+                && ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type)
+                    || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)))
             {
                 // Special service info requested
                 u8ReplyMask |= ContentFlag_PTR_NAME;
             }
 
-            if ((_buildDomainForService(p_Service, true, serviceDomain)) &&  // eg. MyESP._http._tcp.local
+            if ((_buildDomainForService(p_Service, true, serviceDomain))
+                &&  // eg. MyESP._http._tcp.local
                 (p_RRHeader.m_Domain == serviceDomain))
             {
                 (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0));
 
-                if ((DNS_RRTYPE_SRV == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                if ((DNS_RRTYPE_SRV == p_RRHeader.m_Attributes.m_u16Type)
+                    || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
                 {
                     // Instance info SRV requested
                     u8ReplyMask |= ContentFlag_SRV;
                 }
-                if ((DNS_RRTYPE_TXT == p_RRHeader.m_Attributes.m_u16Type) || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
+                if ((DNS_RRTYPE_TXT == p_RRHeader.m_Attributes.m_u16Type)
+                    || (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))
                 {
                     // Instance info TXT requested
                     u8ReplyMask |= ContentFlag_TXT;
@@ -1949,12 +2333,14 @@ namespace MDNSImplementation
         }
         else
         {
-            //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
+            // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService:
+            // INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class););
         }
-        DEBUG_EX_INFO(if (u8ReplyMask)
-                      {
-                          DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService(%s.%s.%s): 0x%X\n"), p_Service.m_pcName, p_Service.m_pcService, p_Service.m_pcProtocol, u8ReplyMask);
-                      });
+        DEBUG_EX_INFO(if (u8ReplyMask) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _replyMaskForService(%s.%s.%s): 0x%X\n"),
+                                  p_Service.m_pcName, p_Service.m_pcService, p_Service.m_pcProtocol,
+                                  u8ReplyMask);
+        });
         return u8ReplyMask;
     }
 
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
index 7aa16df0c0..07c3b27dd8 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Helpers.cpp
@@ -37,21 +37,21 @@ namespace esp8266
 namespace MDNSImplementation
 {
     /**
-    HELPERS
-*/
+        HELPERS
+    */
 
     /*
-    MDNSResponder::indexDomain (static)
+        MDNSResponder::indexDomain (static)
 
-    Updates the given domain 'p_rpcHostname' by appending a delimiter and an index number.
+        Updates the given domain 'p_rpcHostname' by appending a delimiter and an index number.
 
-    If the given domain already hasa numeric index (after the given delimiter), this index
-    incremented. If not, the delimiter and index '2' is added.
+        If the given domain already hasa numeric index (after the given delimiter), this index
+        incremented. If not, the delimiter and index '2' is added.
 
-    If 'p_rpcHostname' is empty (==0), the given default name 'p_pcDefaultHostname' is used,
-    if no default is given, 'esp8266' is used.
+        If 'p_rpcHostname' is empty (==0), the given default name 'p_pcDefaultHostname' is used,
+        if no default is given, 'esp8266' is used.
 
-*/
+    */
     /*static*/ bool MDNSResponder::indexDomain(char*&      p_rpcDomain,
                                                const char* p_pcDivider /*= "-"*/,
                                                const char* p_pcDefaultDomain /*= 0*/)
@@ -68,15 +68,18 @@ namespace MDNSImplementation
             {
                 char*         pEnd    = 0;
                 unsigned long ulIndex = strtoul((pFoundDivider + strlen(pcDivider)), &pEnd, 10);
-                if ((ulIndex) && ((pEnd - p_rpcDomain) == (ptrdiff_t)strlen(p_rpcDomain)) && (!*pEnd))  // Valid (old) index found
+                if ((ulIndex) && ((pEnd - p_rpcDomain) == (ptrdiff_t)strlen(p_rpcDomain))
+                    && (!*pEnd))  // Valid (old) index found
                 {
                     char acIndexBuffer[16];
                     sprintf(acIndexBuffer, "%lu", (++ulIndex));
-                    size_t stLength     = ((pFoundDivider - p_rpcDomain + strlen(pcDivider)) + strlen(acIndexBuffer) + 1);
+                    size_t stLength     = ((pFoundDivider - p_rpcDomain + strlen(pcDivider))
+                                       + strlen(acIndexBuffer) + 1);
                     char*  pNewHostname = new char[stLength];
                     if (pNewHostname)
                     {
-                        memcpy(pNewHostname, p_rpcDomain, (pFoundDivider - p_rpcDomain + strlen(pcDivider)));
+                        memcpy(pNewHostname, p_rpcDomain,
+                               (pFoundDivider - p_rpcDomain + strlen(pcDivider)));
                         pNewHostname[pFoundDivider - p_rpcDomain + strlen(pcDivider)] = 0;
                         strcat(pNewHostname, acIndexBuffer);
 
@@ -87,7 +90,8 @@ namespace MDNSImplementation
                     }
                     else
                     {
-                        DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
+                        DEBUG_EX_ERR(DEBUG_OUTPUT.println(
+                            F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
                     }
                 }
                 else
@@ -96,10 +100,12 @@ namespace MDNSImplementation
                 }
             }
 
-            if (!pFoundDivider)  // not yet extended (or failed to increment extension) -> start indexing
+            if (!pFoundDivider)  // not yet extended (or failed to increment extension) -> start
+                                 // indexing
             {
-                size_t stLength     = strlen(p_rpcDomain) + (strlen(pcDivider) + 1 + 1);  // Name + Divider + '2' + '\0'
-                char*  pNewHostname = new char[stLength];
+                size_t stLength = strlen(p_rpcDomain)
+                                  + (strlen(pcDivider) + 1 + 1);  // Name + Divider + '2' + '\0'
+                char* pNewHostname = new char[stLength];
                 if (pNewHostname)
                 {
                     sprintf(pNewHostname, "%s%s2", p_rpcDomain, pcDivider);
@@ -111,7 +117,8 @@ namespace MDNSImplementation
                 }
                 else
                 {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.println(
+                        F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
                 }
             }
         }
@@ -129,34 +136,38 @@ namespace MDNSImplementation
             }
             else
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.println(F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
+                DEBUG_EX_ERR(DEBUG_OUTPUT.println(
+                    F("[MDNSResponder] indexDomain: FAILED to alloc new hostname!")););
             }
         }
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] indexDomain: %s\n"), p_rpcDomain););
+        DEBUG_EX_INFO(
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] indexDomain: %s\n"), p_rpcDomain););
         return bResult;
     }
 
     /*
-    UDP CONTEXT
-*/
+        UDP CONTEXT
+    */
 
     bool MDNSResponder::_callProcess(void)
     {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf("[MDNSResponder] _callProcess (%lu, triggered by: %s)\n", millis(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
+        DEBUG_EX_INFO(
+            DEBUG_OUTPUT.printf("[MDNSResponder] _callProcess (%lu, triggered by: %s)\n", millis(),
+                                IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()););
 
         return _process(false);
     }
 
     /*
-    MDNSResponder::_allocUDPContext
+        MDNSResponder::_allocUDPContext
 
-    (Re-)Creates the one-and-only UDP context for the MDNS responder.
-    The context is added to the 'multicast'-group and listens to the MDNS port (5353).
-    The travel-distance for multicast messages is set to 1 (local, via MDNS_MULTICAST_TTL).
-    Messages are received via the MDNSResponder '_update' function. CAUTION: This function
-    is called from the WiFi stack side of the ESP stack system.
+        (Re-)Creates the one-and-only UDP context for the MDNS responder.
+        The context is added to the 'multicast'-group and listens to the MDNS port (5353).
+        The travel-distance for multicast messages is set to 1 (local, via MDNS_MULTICAST_TTL).
+        Messages are received via the MDNSResponder '_update' function. CAUTION: This function
+        is called from the WiFi stack side of the ESP stack system.
 
-*/
+    */
     bool MDNSResponder::_allocUDPContext(void)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.println("[MDNSResponder] _allocUDPContext"););
@@ -181,8 +192,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_releaseUDPContext
-*/
+        MDNSResponder::_releaseUDPContext
+    */
     bool MDNSResponder::_releaseUDPContext(void)
     {
         if (m_pUDPContext)
@@ -195,12 +206,12 @@ namespace MDNSImplementation
     }
 
     /*
-    SERVICE QUERY
-*/
+        SERVICE QUERY
+    */
 
     /*
-    MDNSResponder::_allocServiceQuery
-*/
+        MDNSResponder::_allocServiceQuery
+    */
     MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_allocServiceQuery(void)
     {
         stcMDNSServiceQuery* pServiceQuery = new stcMDNSServiceQuery;
@@ -214,8 +225,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_removeServiceQuery
-*/
+        MDNSResponder::_removeServiceQuery
+    */
     bool MDNSResponder::_removeServiceQuery(MDNSResponder::stcMDNSServiceQuery* p_pServiceQuery)
     {
         bool bResult = false;
@@ -243,7 +254,8 @@ namespace MDNSImplementation
                 }
                 else
                 {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.println("[MDNSResponder] _releaseServiceQuery: INVALID service query!"););
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.println(
+                        "[MDNSResponder] _releaseServiceQuery: INVALID service query!"););
                 }
             }
         }
@@ -251,8 +263,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_removeLegacyServiceQuery
-*/
+        MDNSResponder::_removeLegacyServiceQuery
+    */
     bool MDNSResponder::_removeLegacyServiceQuery(void)
     {
         stcMDNSServiceQuery* pLegacyServiceQuery = _findLegacyServiceQuery();
@@ -260,12 +272,13 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_findServiceQuery
+        MDNSResponder::_findServiceQuery
 
-    'Convert' hMDNSServiceQuery to stcMDNSServiceQuery* (ensure existence)
+        'Convert' hMDNSServiceQuery to stcMDNSServiceQuery* (ensure existence)
 
-*/
-    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
+    */
+    MDNSResponder::stcMDNSServiceQuery*
+    MDNSResponder::_findServiceQuery(MDNSResponder::hMDNSServiceQuery p_hServiceQuery)
     {
         stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
         while (pServiceQuery)
@@ -280,8 +293,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_findLegacyServiceQuery
-*/
+        MDNSResponder::_findLegacyServiceQuery
+    */
     MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findLegacyServiceQuery(void)
     {
         stcMDNSServiceQuery* pServiceQuery = m_pServiceQueries;
@@ -297,8 +310,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_releaseServiceQueries
-*/
+        MDNSResponder::_releaseServiceQueries
+    */
     bool MDNSResponder::_releaseServiceQueries(void)
     {
         while (m_pServiceQueries)
@@ -311,14 +324,15 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_findNextServiceQueryByServiceType
-*/
-    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findNextServiceQueryByServiceType(const stcMDNS_RRDomain&    p_ServiceTypeDomain,
-                                                                                          const stcMDNSServiceQuery* p_pPrevServiceQuery)
+        MDNSResponder::_findNextServiceQueryByServiceType
+    */
+    MDNSResponder::stcMDNSServiceQuery* MDNSResponder::_findNextServiceQueryByServiceType(
+        const stcMDNS_RRDomain& p_ServiceTypeDomain, const stcMDNSServiceQuery* p_pPrevServiceQuery)
     {
         stcMDNSServiceQuery* pMatchingServiceQuery = 0;
 
-        stcMDNSServiceQuery* pServiceQuery = (p_pPrevServiceQuery ? p_pPrevServiceQuery->m_pNext : m_pServiceQueries);
+        stcMDNSServiceQuery* pServiceQuery
+            = (p_pPrevServiceQuery ? p_pPrevServiceQuery->m_pNext : m_pServiceQueries);
         while (pServiceQuery)
         {
             if (p_ServiceTypeDomain == pServiceQuery->m_ServiceTypeDomain)
@@ -332,22 +346,25 @@ namespace MDNSImplementation
     }
 
     /*
-    HOSTNAME
-*/
+        HOSTNAME
+    */
 
     /*
-    MDNSResponder::_setHostname
-*/
+        MDNSResponder::_setHostname
+    */
     bool MDNSResponder::_setHostname(const char* p_pcHostname)
     {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _allocHostname (%s)\n"), p_pcHostname););
+        // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _allocHostname (%s)\n"),
+        // p_pcHostname););
 
         bool bResult = false;
 
         _releaseHostname();
 
         size_t stLength = 0;
-        if ((p_pcHostname) && (MDNS_DOMAIN_LABEL_MAXLENGTH >= (stLength = strlen(p_pcHostname))))  // char max size for a single label
+        if ((p_pcHostname)
+            && (MDNS_DOMAIN_LABEL_MAXLENGTH
+                >= (stLength = strlen(p_pcHostname))))  // char max size for a single label
         {
             // Copy in hostname characters as lowercase
             if ((bResult = (0 != (m_pcHostname = new char[stLength + 1]))))
@@ -356,7 +373,8 @@ namespace MDNSImplementation
                 size_t i = 0;
                 for (; i < stLength; ++i)
                 {
-                    m_pcHostname[i] = (isupper(p_pcHostname[i]) ? tolower(p_pcHostname[i]) : p_pcHostname[i]);
+                    m_pcHostname[i]
+                        = (isupper(p_pcHostname[i]) ? tolower(p_pcHostname[i]) : p_pcHostname[i]);
                 }
                 m_pcHostname[i] = 0;
 #else
@@ -368,8 +386,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_releaseHostname
-*/
+        MDNSResponder::_releaseHostname
+    */
     bool MDNSResponder::_releaseHostname(void)
     {
         if (m_pcHostname)
@@ -381,19 +399,24 @@ namespace MDNSImplementation
     }
 
     /*
-    SERVICE
-*/
+        SERVICE
+    */
 
     /*
-    MDNSResponder::_allocService
-*/
+        MDNSResponder::_allocService
+    */
     MDNSResponder::stcMDNSService* MDNSResponder::_allocService(const char* p_pcName,
                                                                 const char* p_pcService,
                                                                 const char* p_pcProtocol,
                                                                 uint16_t    p_u16Port)
     {
         stcMDNSService* pService = 0;
-        if (((!p_pcName) || (MDNS_DOMAIN_LABEL_MAXLENGTH >= strlen(p_pcName))) && (p_pcService) && (MDNS_SERVICE_NAME_LENGTH >= strlen(p_pcService)) && (p_pcProtocol) && (MDNS_SERVICE_PROTOCOL_LENGTH >= strlen(p_pcProtocol)) && (p_u16Port) && (0 != (pService = new stcMDNSService)) && (pService->setName(p_pcName ?: m_pcHostname)) && (pService->setService(p_pcService)) && (pService->setProtocol(p_pcProtocol)))
+        if (((!p_pcName) || (MDNS_DOMAIN_LABEL_MAXLENGTH >= strlen(p_pcName))) && (p_pcService)
+            && (MDNS_SERVICE_NAME_LENGTH >= strlen(p_pcService)) && (p_pcProtocol)
+            && (MDNS_SERVICE_PROTOCOL_LENGTH >= strlen(p_pcProtocol)) && (p_u16Port)
+            && (0 != (pService = new stcMDNSService))
+            && (pService->setName(p_pcName ?: m_pcHostname)) && (pService->setService(p_pcService))
+            && (pService->setProtocol(p_pcProtocol)))
         {
             pService->m_bAutoName = (0 == p_pcName);
             pService->m_u16Port   = p_u16Port;
@@ -406,8 +429,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_releaseService
-*/
+        MDNSResponder::_releaseService
+    */
     bool MDNSResponder::_releaseService(MDNSResponder::stcMDNSService* p_pService)
     {
         bool bResult = false;
@@ -435,7 +458,8 @@ namespace MDNSImplementation
                 }
                 else
                 {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.println("[MDNSResponder] _releaseService: INVALID service!"););
+                    DEBUG_EX_ERR(
+                        DEBUG_OUTPUT.println("[MDNSResponder] _releaseService: INVALID service!"););
                 }
             }
         }
@@ -443,8 +467,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_releaseServices
-*/
+        MDNSResponder::_releaseServices
+    */
     bool MDNSResponder::_releaseServices(void)
     {
         stcMDNSService* pService = m_pServices;
@@ -457,8 +481,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_findService
-*/
+        MDNSResponder::_findService
+    */
     MDNSResponder::stcMDNSService* MDNSResponder::_findService(const char* p_pcName,
                                                                const char* p_pcService,
                                                                const char* p_pcProtocol)
@@ -466,7 +490,9 @@ namespace MDNSImplementation
         stcMDNSService* pService = m_pServices;
         while (pService)
         {
-            if ((0 == strcmp(pService->m_pcName, p_pcName)) && (0 == strcmp(pService->m_pcService, p_pcService)) && (0 == strcmp(pService->m_pcProtocol, p_pcProtocol)))
+            if ((0 == strcmp(pService->m_pcName, p_pcName))
+                && (0 == strcmp(pService->m_pcService, p_pcService))
+                && (0 == strcmp(pService->m_pcProtocol, p_pcProtocol)))
             {
                 break;
             }
@@ -476,9 +502,10 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_findService
-*/
-    MDNSResponder::stcMDNSService* MDNSResponder::_findService(const MDNSResponder::hMDNSService p_hService)
+        MDNSResponder::_findService
+    */
+    MDNSResponder::stcMDNSService*
+    MDNSResponder::_findService(const MDNSResponder::hMDNSService p_hService)
     {
         stcMDNSService* pService = m_pServices;
         while (pService)
@@ -493,22 +520,22 @@ namespace MDNSImplementation
     }
 
     /*
-    SERVICE TXT
-*/
+        SERVICE TXT
+    */
 
     /*
-    MDNSResponder::_allocServiceTxt
-*/
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_allocServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                                                      const char*                    p_pcKey,
-                                                                      const char*                    p_pcValue,
-                                                                      bool                           p_bTemp)
+        MDNSResponder::_allocServiceTxt
+    */
+    MDNSResponder::stcMDNSServiceTxt*
+    MDNSResponder::_allocServiceTxt(MDNSResponder::stcMDNSService* p_pService, const char* p_pcKey,
+                                    const char* p_pcValue, bool p_bTemp)
     {
         stcMDNSServiceTxt* pTxt = 0;
 
-        if ((p_pService) && (p_pcKey) && (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() + 1 +      // Length byte
-                                                                        (p_pcKey ? strlen(p_pcKey) : 0) + 1 +  // '='
-                                                                        (p_pcValue ? strlen(p_pcValue) : 0))))
+        if ((p_pService) && (p_pcKey)
+            && (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() + 1 +      // Length byte
+                                              (p_pcKey ? strlen(p_pcKey) : 0) + 1 +  // '='
+                                              (p_pcValue ? strlen(p_pcValue) : 0))))
         {
             pTxt = new stcMDNSServiceTxt;
             if (pTxt)
@@ -541,8 +568,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_releaseServiceTxt
-*/
+        MDNSResponder::_releaseServiceTxt
+    */
     bool MDNSResponder::_releaseServiceTxt(MDNSResponder::stcMDNSService*    p_pService,
                                            MDNSResponder::stcMDNSServiceTxt* p_pTxt)
     {
@@ -550,14 +577,17 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_updateServiceTxt
-*/
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_updateServiceTxt(MDNSResponder::stcMDNSService*    p_pService,
-                                                                       MDNSResponder::stcMDNSServiceTxt* p_pTxt,
-                                                                       const char*                       p_pcValue,
-                                                                       bool                              p_bTemp)
+        MDNSResponder::_updateServiceTxt
+    */
+    MDNSResponder::stcMDNSServiceTxt*
+    MDNSResponder::_updateServiceTxt(MDNSResponder::stcMDNSService*    p_pService,
+                                     MDNSResponder::stcMDNSServiceTxt* p_pTxt,
+                                     const char* p_pcValue, bool p_bTemp)
     {
-        if ((p_pService) && (p_pTxt) && (MDNS_SERVICE_TXT_MAXLENGTH > (p_pService->m_Txts.length() - (p_pTxt->m_pcValue ? strlen(p_pTxt->m_pcValue) : 0) + (p_pcValue ? strlen(p_pcValue) : 0))))
+        if ((p_pService) && (p_pTxt)
+            && (MDNS_SERVICE_TXT_MAXLENGTH
+                > (p_pService->m_Txts.length() - (p_pTxt->m_pcValue ? strlen(p_pTxt->m_pcValue) : 0)
+                   + (p_pcValue ? strlen(p_pcValue) : 0))))
         {
             p_pTxt->update(p_pcValue);
             p_pTxt->m_bTemp = p_bTemp;
@@ -566,30 +596,30 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_findServiceTxt
-*/
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                                                     const char*                    p_pcKey)
+        MDNSResponder::_findServiceTxt
+    */
+    MDNSResponder::stcMDNSServiceTxt*
+    MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService, const char* p_pcKey)
     {
         return (p_pService ? p_pService->m_Txts.find(p_pcKey) : 0);
     }
 
     /*
-    MDNSResponder::_findServiceTxt
-*/
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                                                     const hMDNSTxt                 p_hTxt)
+        MDNSResponder::_findServiceTxt
+    */
+    MDNSResponder::stcMDNSServiceTxt*
+    MDNSResponder::_findServiceTxt(MDNSResponder::stcMDNSService* p_pService, const hMDNSTxt p_hTxt)
     {
-        return (((p_pService) && (p_hTxt)) ? p_pService->m_Txts.find((stcMDNSServiceTxt*)p_hTxt) : 0);
+        return (((p_pService) && (p_hTxt)) ? p_pService->m_Txts.find((stcMDNSServiceTxt*)p_hTxt) :
+                                             0);
     }
 
     /*
-    MDNSResponder::_addServiceTxt
-*/
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_addServiceTxt(MDNSResponder::stcMDNSService* p_pService,
-                                                                    const char*                    p_pcKey,
-                                                                    const char*                    p_pcValue,
-                                                                    bool                           p_bTemp)
+        MDNSResponder::_addServiceTxt
+    */
+    MDNSResponder::stcMDNSServiceTxt*
+    MDNSResponder::_addServiceTxt(MDNSResponder::stcMDNSService* p_pService, const char* p_pcKey,
+                                  const char* p_pcValue, bool p_bTemp)
     {
         stcMDNSServiceTxt* pResult = 0;
 
@@ -608,18 +638,20 @@ namespace MDNSImplementation
         return pResult;
     }
 
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::_answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
-                                                                     const uint32_t          p_u32AnswerIndex)
+    MDNSResponder::stcMDNSServiceTxt*
+    MDNSResponder::_answerKeyValue(const hMDNSServiceQuery p_hServiceQuery,
+                                   const uint32_t          p_u32AnswerIndex)
     {
         stcMDNSServiceQuery*            pServiceQuery = _findServiceQuery(p_hServiceQuery);
-        stcMDNSServiceQuery::stcAnswer* pSQAnswer     = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
+        stcMDNSServiceQuery::stcAnswer* pSQAnswer
+            = (pServiceQuery ? pServiceQuery->answerAtIndex(p_u32AnswerIndex) : 0);
         // Fill m_pcTxts (if not already done)
         return (pSQAnswer) ? pSQAnswer->m_Txts.m_pTxts : 0;
     }
 
     /*
-    MDNSResponder::_collectServiceTxts
-*/
+        MDNSResponder::_collectServiceTxts
+    */
     bool MDNSResponder::_collectServiceTxts(MDNSResponder::stcMDNSService& p_rService)
     {
         // Call Dynamic service callbacks
@@ -635,24 +667,24 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_releaseTempServiceTxts
-*/
+        MDNSResponder::_releaseTempServiceTxts
+    */
     bool MDNSResponder::_releaseTempServiceTxts(MDNSResponder::stcMDNSService& p_rService)
     {
         return (p_rService.m_Txts.removeTempTxts());
     }
 
     /*
-    MISC
-*/
+        MISC
+    */
 
 #ifdef DEBUG_ESP_MDNS_RESPONDER
     /*
-    MDNSResponder::_printRRDomain
-*/
+        MDNSResponder::_printRRDomain
+    */
     bool MDNSResponder::_printRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_RRDomain) const
     {
-        //DEBUG_OUTPUT.printf_P(PSTR("Domain: "));
+        // DEBUG_OUTPUT.printf_P(PSTR("Domain: "));
 
         const char* pCursor  = p_RRDomain.m_acName;
         uint8_t     u8Length = *pCursor++;
@@ -675,24 +707,29 @@ namespace MDNSImplementation
         {
             DEBUG_OUTPUT.printf_P(PSTR("-empty-"));
         }
-        //DEBUG_OUTPUT.printf_P(PSTR("\n"));
+        // DEBUG_OUTPUT.printf_P(PSTR("\n"));
 
         return true;
     }
 
     /*
-    MDNSResponder::_printRRAnswer
-*/
+        MDNSResponder::_printRRAnswer
+    */
     bool MDNSResponder::_printRRAnswer(const MDNSResponder::stcMDNS_RRAnswer& p_RRAnswer) const
     {
         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] RRAnswer: "));
         _printRRDomain(p_RRAnswer.m_Header.m_Domain);
-        DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, "), p_RRAnswer.m_Header.m_Attributes.m_u16Type, p_RRAnswer.m_Header.m_Attributes.m_u16Class, p_RRAnswer.m_u32TTL);
-        switch (p_RRAnswer.m_Header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
+        DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, "),
+                              p_RRAnswer.m_Header.m_Attributes.m_u16Type,
+                              p_RRAnswer.m_Header.m_Attributes.m_u16Class, p_RRAnswer.m_u32TTL);
+        switch (p_RRAnswer.m_Header.m_Attributes.m_u16Type
+                & (~0x8000))  // Topmost bit might carry 'cache flush' flag
         {
 #ifdef MDNS_IP4_SUPPORT
         case DNS_RRTYPE_A:
-            DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((const stcMDNS_RRAnswerA*)&p_RRAnswer)->m_IPAddress.toString().c_str());
+            DEBUG_OUTPUT.printf_P(
+                PSTR("A IP:%s"),
+                ((const stcMDNS_RRAnswerA*)&p_RRAnswer)->m_IPAddress.toString().c_str());
             break;
 #endif
         case DNS_RRTYPE_PTR:
@@ -713,11 +750,14 @@ namespace MDNSImplementation
         }
 #ifdef MDNS_IP6_SUPPORT
         case DNS_RRTYPE_AAAA:
-            DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
+            DEBUG_OUTPUT.printf_P(
+                PSTR("AAAA IP:%s"),
+                ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
             break;
 #endif
         case DNS_RRTYPE_SRV:
-            DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_u16Port);
+            DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "),
+                                  ((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_u16Port);
             _printRRDomain(((const stcMDNS_RRAnswerSRV*)&p_RRAnswer)->m_SRVDomain);
             break;
         default:
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h b/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
index f57e48f0c5..7b7345e62b 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h
@@ -46,8 +46,9 @@ namespace MDNSImplementation
 #endif
 
 //
-// If ENABLE_ESP_MDNS_RESPONDER_PASSIV_MODE is defined, the mDNS responder ignores a successful probing
-// This allows to drive the responder in a environment, where 'update()' isn't called in the loop
+// If ENABLE_ESP_MDNS_RESPONDER_PASSIV_MODE is defined, the mDNS responder ignores a successful
+// probing This allows to drive the responder in a environment, where 'update()' isn't called in the
+// loop
 //#define ENABLE_ESP_MDNS_RESPONDER_PASSIV_MODE
 
 // Enable/disable debug trace macros
@@ -86,35 +87,34 @@ namespace MDNSImplementation
 #define DEBUG_OUTPUT Serial
 #endif
 #else
-#define DEBUG_EX_INFO(A) \
-    do                   \
-    {                    \
-        (void)0;         \
+#define DEBUG_EX_INFO(A)                                                                           \
+    do                                                                                             \
+    {                                                                                              \
+        (void)0;                                                                                   \
     } while (0)
-#define DEBUG_EX_ERR(A) \
-    do                  \
-    {                   \
-        (void)0;        \
+#define DEBUG_EX_ERR(A)                                                                            \
+    do                                                                                             \
+    {                                                                                              \
+        (void)0;                                                                                   \
     } while (0)
-#define DEBUG_EX_TX(A) \
-    do                 \
-    {                  \
-        (void)0;       \
+#define DEBUG_EX_TX(A)                                                                             \
+    do                                                                                             \
+    {                                                                                              \
+        (void)0;                                                                                   \
     } while (0)
-#define DEBUG_EX_RX(A) \
-    do                 \
-    {                  \
-        (void)0;       \
+#define DEBUG_EX_RX(A)                                                                             \
+    do                                                                                             \
+    {                                                                                              \
+        (void)0;                                                                                   \
     } while (0)
 #endif
 
 /*  already defined in lwIP ('lwip/prot/dns.h')
     #ifdef MDNS_IP4_SUPPORT
-    #define DNS_MQUERY_IPV4_GROUP_INIT     (IPAddress(224, 0, 0, 251))              // ip_addr_t v4group = DNS_MQUERY_IPV4_GROUP_INIT
-    #endif
-    #ifdef MDNS_IP6_SUPPORT
-    #define DNS_MQUERY_IPV6_GROUP_INIT     IPADDR6_INIT_HOST(0xFF020000,0,0,0xFB)   // ip_addr_t v6group = DNS_MQUERY_IPV6_GROUP_INIT
-    #endif*/
+    #define DNS_MQUERY_IPV4_GROUP_INIT     (IPAddress(224, 0, 0, 251))              // ip_addr_t
+   v4group = DNS_MQUERY_IPV4_GROUP_INIT #endif #ifdef MDNS_IP6_SUPPORT #define
+   DNS_MQUERY_IPV6_GROUP_INIT     IPADDR6_INIT_HOST(0xFF020000,0,0,0xFB)   // ip_addr_t v6group =
+   DNS_MQUERY_IPV6_GROUP_INIT #endif*/
 //#define MDNS_MULTICAST_PORT               5353
 
 /*
@@ -153,7 +153,8 @@ namespace MDNSImplementation
 /*
     Delay between and number of probes for host and service domains
     Delay between and number of announces for host and service domains
-    Delay between and number of service queries; the delay is multiplied by the resent number in '_checkServiceQueryCache'
+    Delay between and number of service queries; the delay is multiplied by the resent number in
+   '_checkServiceQueryCache'
 */
 #define MDNS_PROBE_DELAY 250
 #define MDNS_PROBE_COUNT 3
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
index d569223f2f..b0499abde6 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Structs.cpp
@@ -34,58 +34,53 @@ namespace esp8266
 namespace MDNSImplementation
 {
     /**
-    STRUCTS
-*/
+        STRUCTS
+    */
 
     /**
-    MDNSResponder::stcMDNSServiceTxt
+        MDNSResponder::stcMDNSServiceTxt
 
-    One MDNS TXT item.
-    m_pcValue may be '\0'.
-    Objects can be chained together (list, m_pNext).
-    A 'm_bTemp' flag differentiates between static and dynamic items.
-    Output as byte array 'c#=1' is supported.
-*/
+        One MDNS TXT item.
+        m_pcValue may be '\0'.
+        Objects can be chained together (list, m_pNext).
+        A 'm_bTemp' flag differentiates between static and dynamic items.
+        Output as byte array 'c#=1' is supported.
+    */
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt constructor
-*/
+        MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt constructor
+    */
     MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const char* p_pcKey /*= 0*/,
                                                         const char* p_pcValue /*= 0*/,
                                                         bool        p_bTemp /*= false*/) :
         m_pNext(0),
-        m_pcKey(0),
-        m_pcValue(0),
-        m_bTemp(p_bTemp)
+        m_pcKey(0), m_pcValue(0), m_bTemp(p_bTemp)
     {
         setKey(p_pcKey);
         setValue(p_pcValue);
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt copy-constructor
-*/
-    MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(const MDNSResponder::stcMDNSServiceTxt& p_Other) :
+        MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt copy-constructor
+    */
+    MDNSResponder::stcMDNSServiceTxt::stcMDNSServiceTxt(
+        const MDNSResponder::stcMDNSServiceTxt& p_Other) :
         m_pNext(0),
-        m_pcKey(0),
-        m_pcValue(0),
-        m_bTemp(false)
+        m_pcKey(0), m_pcValue(0), m_bTemp(false)
     {
         operator=(p_Other);
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt destructor
-*/
-    MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt(void)
-    {
-        clear();
-    }
+        MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt destructor
+    */
+    MDNSResponder::stcMDNSServiceTxt::~stcMDNSServiceTxt(void) { clear(); }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::operator=
-*/
-    MDNSResponder::stcMDNSServiceTxt& MDNSResponder::stcMDNSServiceTxt::operator=(const MDNSResponder::stcMDNSServiceTxt& p_Other)
+        MDNSResponder::stcMDNSServiceTxt::operator=
+    */
+    MDNSResponder::stcMDNSServiceTxt&
+    MDNSResponder::stcMDNSServiceTxt::operator=(const MDNSResponder::stcMDNSServiceTxt& p_Other)
     {
         if (&p_Other != this)
         {
@@ -96,8 +91,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::clear
-*/
+        MDNSResponder::stcMDNSServiceTxt::clear
+    */
     bool MDNSResponder::stcMDNSServiceTxt::clear(void)
     {
         releaseKey();
@@ -106,8 +101,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::allocKey
-*/
+        MDNSResponder::stcMDNSServiceTxt::allocKey
+    */
     char* MDNSResponder::stcMDNSServiceTxt::allocKey(size_t p_stLength)
     {
         releaseKey();
@@ -119,10 +114,9 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::setKey
-*/
-    bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey,
-                                                  size_t      p_stLength)
+        MDNSResponder::stcMDNSServiceTxt::setKey
+    */
+    bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey, size_t p_stLength)
     {
         bool bResult = false;
 
@@ -140,16 +134,16 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::setKey
-*/
+        MDNSResponder::stcMDNSServiceTxt::setKey
+    */
     bool MDNSResponder::stcMDNSServiceTxt::setKey(const char* p_pcKey)
     {
         return setKey(p_pcKey, (p_pcKey ? strlen(p_pcKey) : 0));
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::releaseKey
-*/
+        MDNSResponder::stcMDNSServiceTxt::releaseKey
+    */
     bool MDNSResponder::stcMDNSServiceTxt::releaseKey(void)
     {
         if (m_pcKey)
@@ -161,8 +155,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::allocValue
-*/
+        MDNSResponder::stcMDNSServiceTxt::allocValue
+    */
     char* MDNSResponder::stcMDNSServiceTxt::allocValue(size_t p_stLength)
     {
         releaseValue();
@@ -174,10 +168,9 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::setValue
-*/
-    bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue,
-                                                    size_t      p_stLength)
+        MDNSResponder::stcMDNSServiceTxt::setValue
+    */
+    bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue, size_t p_stLength)
     {
         bool bResult = false;
 
@@ -199,16 +192,16 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::setValue
-*/
+        MDNSResponder::stcMDNSServiceTxt::setValue
+    */
     bool MDNSResponder::stcMDNSServiceTxt::setValue(const char* p_pcValue)
     {
         return setValue(p_pcValue, (p_pcValue ? strlen(p_pcValue) : 0));
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::releaseValue
-*/
+        MDNSResponder::stcMDNSServiceTxt::releaseValue
+    */
     bool MDNSResponder::stcMDNSServiceTxt::releaseValue(void)
     {
         if (m_pcValue)
@@ -220,29 +213,28 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::set
-*/
-    bool MDNSResponder::stcMDNSServiceTxt::set(const char* p_pcKey,
-                                               const char* p_pcValue,
-                                               bool        p_bTemp /*= false*/)
+        MDNSResponder::stcMDNSServiceTxt::set
+    */
+    bool MDNSResponder::stcMDNSServiceTxt::set(const char* p_pcKey, const char* p_pcValue,
+                                               bool p_bTemp /*= false*/)
     {
         m_bTemp = p_bTemp;
         return ((setKey(p_pcKey)) && (setValue(p_pcValue)));
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::update
-*/
+        MDNSResponder::stcMDNSServiceTxt::update
+    */
     bool MDNSResponder::stcMDNSServiceTxt::update(const char* p_pcValue)
     {
         return setValue(p_pcValue);
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxt::length
+        MDNSResponder::stcMDNSServiceTxt::length
 
-    length of eg. 'c#=1' without any closing '\0'
-*/
+        length of eg. 'c#=1' without any closing '\0'
+    */
     size_t MDNSResponder::stcMDNSServiceTxt::length(void) const
     {
         size_t stLength = 0;
@@ -256,28 +248,26 @@ namespace MDNSImplementation
     }
 
     /**
-    MDNSResponder::stcMDNSServiceTxts
+        MDNSResponder::stcMDNSServiceTxts
 
-    A list of zero or more MDNS TXT items.
-    Dynamic TXT items can be removed by 'removeTempTxts'.
-    A TXT item can be looke up by its 'key' member.
-    Export as ';'-separated byte array is supported.
-    Export as 'length byte coded' byte array is supported.
-    Comparison ((all A TXT items in B and equal) AND (all B TXT items in A and equal)) is supported.
+        A list of zero or more MDNS TXT items.
+        Dynamic TXT items can be removed by 'removeTempTxts'.
+        A TXT item can be looke up by its 'key' member.
+        Export as ';'-separated byte array is supported.
+        Export as 'length byte coded' byte array is supported.
+        Comparison ((all A TXT items in B and equal) AND (all B TXT items in A and equal)) is
+       supported.
 
-*/
+    */
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts constructor
-*/
-    MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(void) :
-        m_pTxts(0)
-    {
-    }
+        MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts constructor
+    */
+    MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(void) : m_pTxts(0) { }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts copy-constructor
-*/
+        MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts copy-constructor
+    */
     MDNSResponder::stcMDNSServiceTxts::stcMDNSServiceTxts(const stcMDNSServiceTxts& p_Other) :
         m_pTxts(0)
     {
@@ -285,23 +275,22 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts destructor
-*/
-    MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts(void)
-    {
-        clear();
-    }
+        MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts destructor
+    */
+    MDNSResponder::stcMDNSServiceTxts::~stcMDNSServiceTxts(void) { clear(); }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::operator=
-*/
-    MDNSResponder::stcMDNSServiceTxts& MDNSResponder::stcMDNSServiceTxts::operator=(const stcMDNSServiceTxts& p_Other)
+        MDNSResponder::stcMDNSServiceTxts::operator=
+    */
+    MDNSResponder::stcMDNSServiceTxts&
+    MDNSResponder::stcMDNSServiceTxts::operator=(const stcMDNSServiceTxts& p_Other)
     {
         if (this != &p_Other)
         {
             clear();
 
-            for (stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; pOtherTxt; pOtherTxt = pOtherTxt->m_pNext)
+            for (stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; pOtherTxt;
+                 pOtherTxt                    = pOtherTxt->m_pNext)
             {
                 add(new stcMDNSServiceTxt(*pOtherTxt));
             }
@@ -310,8 +299,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::clear
-*/
+        MDNSResponder::stcMDNSServiceTxts::clear
+    */
     bool MDNSResponder::stcMDNSServiceTxts::clear(void)
     {
         while (m_pTxts)
@@ -324,8 +313,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::add
-*/
+        MDNSResponder::stcMDNSServiceTxts::add
+    */
     bool MDNSResponder::stcMDNSServiceTxts::add(MDNSResponder::stcMDNSServiceTxt* p_pTxt)
     {
         bool bResult = false;
@@ -340,8 +329,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::remove
-*/
+        MDNSResponder::stcMDNSServiceTxts::remove
+    */
     bool MDNSResponder::stcMDNSServiceTxts::remove(stcMDNSServiceTxt* p_pTxt)
     {
         bool bResult = false;
@@ -370,8 +359,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::removeTempTxts
-*/
+        MDNSResponder::stcMDNSServiceTxts::removeTempTxts
+    */
     bool MDNSResponder::stcMDNSServiceTxts::removeTempTxts(void)
     {
         bool bResult = true;
@@ -390,8 +379,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::find
-*/
+        MDNSResponder::stcMDNSServiceTxts::find
+    */
     MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey)
     {
         stcMDNSServiceTxt* pResult = 0;
@@ -408,9 +397,10 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::find
-*/
-    const MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey) const
+        MDNSResponder::stcMDNSServiceTxts::find
+    */
+    const MDNSResponder::stcMDNSServiceTxt*
+    MDNSResponder::stcMDNSServiceTxts::find(const char* p_pcKey) const
     {
         const stcMDNSServiceTxt* pResult = 0;
 
@@ -426,9 +416,10 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::find
-*/
-    MDNSResponder::stcMDNSServiceTxt* MDNSResponder::stcMDNSServiceTxts::find(const stcMDNSServiceTxt* p_pTxt)
+        MDNSResponder::stcMDNSServiceTxts::find
+    */
+    MDNSResponder::stcMDNSServiceTxt*
+    MDNSResponder::stcMDNSServiceTxts::find(const stcMDNSServiceTxt* p_pTxt)
     {
         stcMDNSServiceTxt* pResult = 0;
 
@@ -444,8 +435,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::length
-*/
+        MDNSResponder::stcMDNSServiceTxts::length
+    */
     uint16_t MDNSResponder::stcMDNSServiceTxts::length(void) const
     {
         uint16_t u16Length = 0;
@@ -461,18 +452,15 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::c_strLength
+        MDNSResponder::stcMDNSServiceTxts::c_strLength
 
-    (incl. closing '\0'). Length bytes place is used for delimiting ';' and closing '\0'
-*/
-    size_t MDNSResponder::stcMDNSServiceTxts::c_strLength(void) const
-    {
-        return length();
-    }
+        (incl. closing '\0'). Length bytes place is used for delimiting ';' and closing '\0'
+    */
+    size_t MDNSResponder::stcMDNSServiceTxts::c_strLength(void) const { return length(); }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::c_str
-*/
+        MDNSResponder::stcMDNSServiceTxts::c_str
+    */
     bool MDNSResponder::stcMDNSServiceTxts::c_str(char* p_pcBuffer)
     {
         bool bResult = false;
@@ -509,18 +497,15 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::bufferLength
+        MDNSResponder::stcMDNSServiceTxts::bufferLength
 
-    (incl. closing '\0').
-*/
-    size_t MDNSResponder::stcMDNSServiceTxts::bufferLength(void) const
-    {
-        return (length() + 1);
-    }
+        (incl. closing '\0').
+    */
+    size_t MDNSResponder::stcMDNSServiceTxts::bufferLength(void) const { return (length() + 1); }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::toBuffer
-*/
+        MDNSResponder::stcMDNSServiceTxts::toBuffer
+    */
     bool MDNSResponder::stcMDNSServiceTxts::buffer(char* p_pcBuffer)
     {
         bool bResult = false;
@@ -552,103 +537,97 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::compare
-*/
-    bool MDNSResponder::stcMDNSServiceTxts::compare(const MDNSResponder::stcMDNSServiceTxts& p_Other) const
+        MDNSResponder::stcMDNSServiceTxts::compare
+    */
+    bool MDNSResponder::stcMDNSServiceTxts::compare(
+        const MDNSResponder::stcMDNSServiceTxts& p_Other) const
     {
         bool bResult = false;
 
         if ((bResult = (length() == p_Other.length())))
         {
             // Compare A->B
-            for (const stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
+            for (const stcMDNSServiceTxt* pTxt = m_pTxts; ((bResult) && (pTxt));
+                 pTxt                          = pTxt->m_pNext)
             {
                 const stcMDNSServiceTxt* pOtherTxt = p_Other.find(pTxt->m_pcKey);
-                bResult                            = ((pOtherTxt) && (pTxt->m_pcValue) && (pOtherTxt->m_pcValue) && (strlen(pTxt->m_pcValue) == strlen(pOtherTxt->m_pcValue)) && (0 == strcmp(pTxt->m_pcValue, pOtherTxt->m_pcValue)));
+                bResult = ((pOtherTxt) && (pTxt->m_pcValue) && (pOtherTxt->m_pcValue)
+                           && (strlen(pTxt->m_pcValue) == strlen(pOtherTxt->m_pcValue))
+                           && (0 == strcmp(pTxt->m_pcValue, pOtherTxt->m_pcValue)));
             }
             // Compare B->A
-            for (const stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; ((bResult) && (pOtherTxt)); pOtherTxt = pOtherTxt->m_pNext)
+            for (const stcMDNSServiceTxt* pOtherTxt = p_Other.m_pTxts; ((bResult) && (pOtherTxt));
+                 pOtherTxt                          = pOtherTxt->m_pNext)
             {
                 const stcMDNSServiceTxt* pTxt = find(pOtherTxt->m_pcKey);
-                bResult                       = ((pTxt) && (pOtherTxt->m_pcValue) && (pTxt->m_pcValue) && (strlen(pOtherTxt->m_pcValue) == strlen(pTxt->m_pcValue)) && (0 == strcmp(pOtherTxt->m_pcValue, pTxt->m_pcValue)));
+                bResult = ((pTxt) && (pOtherTxt->m_pcValue) && (pTxt->m_pcValue)
+                           && (strlen(pOtherTxt->m_pcValue) == strlen(pTxt->m_pcValue))
+                           && (0 == strcmp(pOtherTxt->m_pcValue, pTxt->m_pcValue)));
             }
         }
         return bResult;
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::operator==
-*/
+        MDNSResponder::stcMDNSServiceTxts::operator==
+    */
     bool MDNSResponder::stcMDNSServiceTxts::operator==(const stcMDNSServiceTxts& p_Other) const
     {
         return compare(p_Other);
     }
 
     /*
-    MDNSResponder::stcMDNSServiceTxts::operator!=
-*/
+        MDNSResponder::stcMDNSServiceTxts::operator!=
+    */
     bool MDNSResponder::stcMDNSServiceTxts::operator!=(const stcMDNSServiceTxts& p_Other) const
     {
         return !compare(p_Other);
     }
 
     /**
-    MDNSResponder::stcMDNS_MsgHeader
+        MDNSResponder::stcMDNS_MsgHeader
 
-    A MDNS message header.
+        A MDNS message header.
 
-*/
+    */
 
     /*
-    MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader
-*/
-    MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader(uint16_t      p_u16ID /*= 0*/,
-                                                        bool          p_bQR /*= false*/,
-                                                        unsigned char p_ucOpcode /*= 0*/,
-                                                        bool          p_bAA /*= false*/,
-                                                        bool          p_bTC /*= false*/,
-                                                        bool          p_bRD /*= false*/,
-                                                        bool          p_bRA /*= false*/,
-                                                        unsigned char p_ucRCode /*= 0*/,
-                                                        uint16_t      p_u16QDCount /*= 0*/,
-                                                        uint16_t      p_u16ANCount /*= 0*/,
-                                                        uint16_t      p_u16NSCount /*= 0*/,
-                                                        uint16_t      p_u16ARCount /*= 0*/) :
+        MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader
+    */
+    MDNSResponder::stcMDNS_MsgHeader::stcMDNS_MsgHeader(
+        uint16_t p_u16ID /*= 0*/, bool p_bQR /*= false*/, unsigned char p_ucOpcode /*= 0*/,
+        bool p_bAA /*= false*/, bool p_bTC /*= false*/, bool p_bRD /*= false*/,
+        bool p_bRA /*= false*/, unsigned char p_ucRCode /*= 0*/, uint16_t p_u16QDCount /*= 0*/,
+        uint16_t p_u16ANCount /*= 0*/, uint16_t p_u16NSCount /*= 0*/,
+        uint16_t p_u16ARCount /*= 0*/) :
         m_u16ID(p_u16ID),
         m_1bQR(p_bQR), m_4bOpcode(p_ucOpcode), m_1bAA(p_bAA), m_1bTC(p_bTC), m_1bRD(p_bRD),
-        m_1bRA(p_bRA), m_3bZ(0), m_4bRCode(p_ucRCode),
-        m_u16QDCount(p_u16QDCount),
-        m_u16ANCount(p_u16ANCount),
-        m_u16NSCount(p_u16NSCount),
-        m_u16ARCount(p_u16ARCount)
+        m_1bRA(p_bRA), m_3bZ(0), m_4bRCode(p_ucRCode), m_u16QDCount(p_u16QDCount),
+        m_u16ANCount(p_u16ANCount), m_u16NSCount(p_u16NSCount), m_u16ARCount(p_u16ARCount)
     {
     }
 
     /**
-    MDNSResponder::stcMDNS_RRDomain
+        MDNSResponder::stcMDNS_RRDomain
 
-    A MDNS domain object.
-    The labels of the domain are stored (DNS-like encoded) in 'm_acName':
-    [length byte]varlength label[length byte]varlength label[0]
-    'm_u16NameLength' stores the used length of 'm_acName'.
-    Dynamic label addition is supported.
-    Comparison is supported.
-    Export as byte array 'esp8266.local' is supported.
+        A MDNS domain object.
+        The labels of the domain are stored (DNS-like encoded) in 'm_acName':
+        [length byte]varlength label[length byte]varlength label[0]
+        'm_u16NameLength' stores the used length of 'm_acName'.
+        Dynamic label addition is supported.
+        Comparison is supported.
+        Export as byte array 'esp8266.local' is supported.
 
-*/
+    */
 
     /*
-    MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain constructor
-*/
-    MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(void) :
-        m_u16NameLength(0)
-    {
-        clear();
-    }
+        MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain constructor
+    */
+    MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(void) : m_u16NameLength(0) { clear(); }
 
     /*
-    MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain copy-constructor
-*/
+        MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain copy-constructor
+    */
     MDNSResponder::stcMDNS_RRDomain::stcMDNS_RRDomain(const stcMDNS_RRDomain& p_Other) :
         m_u16NameLength(0)
     {
@@ -656,9 +635,10 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNS_RRDomain::operator =
-*/
-    MDNSResponder::stcMDNS_RRDomain& MDNSResponder::stcMDNS_RRDomain::operator=(const stcMDNS_RRDomain& p_Other)
+        MDNSResponder::stcMDNS_RRDomain::operator =
+    */
+    MDNSResponder::stcMDNS_RRDomain&
+    MDNSResponder::stcMDNS_RRDomain::operator=(const stcMDNS_RRDomain& p_Other)
     {
         if (&p_Other != this)
         {
@@ -669,8 +649,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNS_RRDomain::clear
-*/
+        MDNSResponder::stcMDNS_RRDomain::clear
+    */
     bool MDNSResponder::stcMDNS_RRDomain::clear(void)
     {
         memset(m_acName, 0, sizeof(m_acName));
@@ -679,17 +659,16 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNS_RRDomain::addLabel
-*/
+        MDNSResponder::stcMDNS_RRDomain::addLabel
+    */
     bool MDNSResponder::stcMDNS_RRDomain::addLabel(const char* p_pcLabel,
                                                    bool        p_bPrependUnderline /*= false*/)
     {
         bool bResult = false;
 
-        size_t stLength = (p_pcLabel
-                               ? (strlen(p_pcLabel) + (p_bPrependUnderline ? 1 : 0))
-                               : 0);
-        if ((MDNS_DOMAIN_LABEL_MAXLENGTH >= stLength) && (MDNS_DOMAIN_MAXLENGTH >= (m_u16NameLength + (1 + stLength))))
+        size_t stLength = (p_pcLabel ? (strlen(p_pcLabel) + (p_bPrependUnderline ? 1 : 0)) : 0);
+        if ((MDNS_DOMAIN_LABEL_MAXLENGTH >= stLength)
+            && (MDNS_DOMAIN_MAXLENGTH >= (m_u16NameLength + (1 + stLength))))
         {
             // Length byte
             m_acName[m_u16NameLength] = (unsigned char)stLength;  // Might be 0!
@@ -712,8 +691,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNS_RRDomain::compare
-*/
+        MDNSResponder::stcMDNS_RRDomain::compare
+    */
     bool MDNSResponder::stcMDNS_RRDomain::compare(const stcMDNS_RRDomain& p_Other) const
     {
         bool bResult = false;
@@ -722,8 +701,9 @@ namespace MDNSImplementation
         {
             const char* pT = m_acName;
             const char* pO = p_Other.m_acName;
-            while ((pT) && (pO) && (*((unsigned char*)pT) == *((unsigned char*)pO)) &&  // Same length AND
-                   (0 == strncasecmp((pT + 1), (pO + 1), *((unsigned char*)pT))))       // Same content
+            while ((pT) && (pO) && (*((unsigned char*)pT) == *((unsigned char*)pO))
+                   &&  // Same length AND
+                   (0 == strncasecmp((pT + 1), (pO + 1), *((unsigned char*)pT))))  // Same content
             {
                 if (*((unsigned char*)pT))  // Not 0
                 {
@@ -741,24 +721,24 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNS_RRDomain::operator ==
-*/
+        MDNSResponder::stcMDNS_RRDomain::operator ==
+    */
     bool MDNSResponder::stcMDNS_RRDomain::operator==(const stcMDNS_RRDomain& p_Other) const
     {
         return compare(p_Other);
     }
 
     /*
-    MDNSResponder::stcMDNS_RRDomain::operator !=
-*/
+        MDNSResponder::stcMDNS_RRDomain::operator !=
+    */
     bool MDNSResponder::stcMDNS_RRDomain::operator!=(const stcMDNS_RRDomain& p_Other) const
     {
         return !compare(p_Other);
     }
 
     /*
-    MDNSResponder::stcMDNS_RRDomain::operator >
-*/
+        MDNSResponder::stcMDNS_RRDomain::operator >
+    */
     bool MDNSResponder::stcMDNS_RRDomain::operator>(const stcMDNS_RRDomain& p_Other) const
     {
         // TODO: Check, if this is a good idea...
@@ -766,8 +746,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNS_RRDomain::c_strLength
-*/
+        MDNSResponder::stcMDNS_RRDomain::c_strLength
+    */
     size_t MDNSResponder::stcMDNS_RRDomain::c_strLength(void) const
     {
         size_t stLength = 0;
@@ -782,8 +762,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNS_RRDomain::c_str
-*/
+        MDNSResponder::stcMDNS_RRDomain::c_str
+    */
     bool MDNSResponder::stcMDNS_RRDomain::c_str(char* p_pcBuffer)
     {
         bool bResult = false;
@@ -805,34 +785,36 @@ namespace MDNSImplementation
     }
 
     /**
-    MDNSResponder::stcMDNS_RRAttributes
+        MDNSResponder::stcMDNS_RRAttributes
 
-    A MDNS attributes object.
+        A MDNS attributes object.
 
-*/
+    */
 
     /*
-    MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes constructor
-*/
-    MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(uint16_t p_u16Type /*= 0*/,
-                                                              uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/) :
+        MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes constructor
+    */
+    MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(
+        uint16_t p_u16Type /*= 0*/, uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/) :
         m_u16Type(p_u16Type),
         m_u16Class(p_u16Class)
     {
     }
 
     /*
-    MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes copy-constructor
-*/
-    MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
+        MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes copy-constructor
+    */
+    MDNSResponder::stcMDNS_RRAttributes::stcMDNS_RRAttributes(
+        const MDNSResponder::stcMDNS_RRAttributes& p_Other)
     {
         operator=(p_Other);
     }
 
     /*
-    MDNSResponder::stcMDNS_RRAttributes::operator =
-*/
-    MDNSResponder::stcMDNS_RRAttributes& MDNSResponder::stcMDNS_RRAttributes::operator=(const MDNSResponder::stcMDNS_RRAttributes& p_Other)
+        MDNSResponder::stcMDNS_RRAttributes::operator =
+    */
+    MDNSResponder::stcMDNS_RRAttributes& MDNSResponder::stcMDNS_RRAttributes::operator=(
+        const MDNSResponder::stcMDNS_RRAttributes& p_Other)
     {
         if (&p_Other != this)
         {
@@ -843,31 +825,30 @@ namespace MDNSImplementation
     }
 
     /**
-    MDNSResponder::stcMDNS_RRHeader
+        MDNSResponder::stcMDNS_RRHeader
 
-    A MDNS record header (domain and attributes) object.
+        A MDNS record header (domain and attributes) object.
 
-*/
+    */
 
     /*
-    MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader constructor
-*/
-    MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(void)
-    {
-    }
+        MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader constructor
+    */
+    MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(void) { }
 
     /*
-    MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader copy-constructor
-*/
+        MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader copy-constructor
+    */
     MDNSResponder::stcMDNS_RRHeader::stcMDNS_RRHeader(const stcMDNS_RRHeader& p_Other)
     {
         operator=(p_Other);
     }
 
     /*
-    MDNSResponder::stcMDNS_RRHeader::operator =
-*/
-    MDNSResponder::stcMDNS_RRHeader& MDNSResponder::stcMDNS_RRHeader::operator=(const MDNSResponder::stcMDNS_RRHeader& p_Other)
+        MDNSResponder::stcMDNS_RRHeader::operator =
+    */
+    MDNSResponder::stcMDNS_RRHeader&
+    MDNSResponder::stcMDNS_RRHeader::operator=(const MDNSResponder::stcMDNS_RRHeader& p_Other)
     {
         if (&p_Other != this)
         {
@@ -878,8 +859,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNS_RRHeader::clear
-*/
+        MDNSResponder::stcMDNS_RRHeader::clear
+    */
     bool MDNSResponder::stcMDNS_RRHeader::clear(void)
     {
         m_Domain.clear();
@@ -887,39 +868,33 @@ namespace MDNSImplementation
     }
 
     /**
-    MDNSResponder::stcMDNS_RRQuestion
+        MDNSResponder::stcMDNS_RRQuestion
 
-    A MDNS question record object (header + question flags)
+        A MDNS question record object (header + question flags)
 
-*/
+    */
 
     /*
-    MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion constructor
-*/
-    MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion(void) :
-        m_pNext(0),
-        m_bUnicast(false)
-    {
-    }
+        MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion constructor
+    */
+    MDNSResponder::stcMDNS_RRQuestion::stcMDNS_RRQuestion(void) : m_pNext(0), m_bUnicast(false) { }
 
     /**
-    MDNSResponder::stcMDNS_RRAnswer
+        MDNSResponder::stcMDNS_RRAnswer
 
-    A MDNS answer record object (header + answer content).
-    This is a 'virtual' base class for all other MDNS answer classes.
+        A MDNS answer record object (header + answer content).
+        This is a 'virtual' base class for all other MDNS answer classes.
 
-*/
+    */
 
     /*
-    MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer constructor
-*/
-    MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer(enuAnswerType                          p_AnswerType,
-                                                      const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                      uint32_t                               p_u32TTL) :
+        MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer constructor
+    */
+    MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer(
+        enuAnswerType p_AnswerType, const MDNSResponder::stcMDNS_RRHeader& p_Header,
+        uint32_t p_u32TTL) :
         m_pNext(0),
-        m_AnswerType(p_AnswerType),
-        m_Header(p_Header),
-        m_u32TTL(p_u32TTL)
+        m_AnswerType(p_AnswerType), m_Header(p_Header), m_u32TTL(p_u32TTL)
     {
         // Extract 'cache flush'-bit
         m_bCacheFlush = (m_Header.m_Attributes.m_u16Class & 0x8000);
@@ -927,23 +902,21 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer destructor
-*/
-    MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer(void)
-    {
-    }
+        MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer destructor
+    */
+    MDNSResponder::stcMDNS_RRAnswer::~stcMDNS_RRAnswer(void) { }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswer::answerType
-*/
+        MDNSResponder::stcMDNS_RRAnswer::answerType
+    */
     MDNSResponder::enuAnswerType MDNSResponder::stcMDNS_RRAnswer::answerType(void) const
     {
         return m_AnswerType;
     }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswer::clear
-*/
+        MDNSResponder::stcMDNS_RRAnswer::clear
+    */
     bool MDNSResponder::stcMDNS_RRAnswer::clear(void)
     {
         m_pNext = 0;
@@ -952,35 +925,32 @@ namespace MDNSImplementation
     }
 
     /**
-    MDNSResponder::stcMDNS_RRAnswerA
+        MDNSResponder::stcMDNS_RRAnswerA
 
-    A MDNS A answer object.
-    Extends the base class by an IP4 address member.
+        A MDNS A answer object.
+        Extends the base class by an IP4 address member.
 
-*/
+    */
 
 #ifdef MDNS_IP4_SUPPORT
     /*
-    MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA constructor
-*/
-    MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                        uint32_t                               p_u32TTL) :
+        MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA constructor
+    */
+    MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA(
+        const MDNSResponder::stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL) :
         stcMDNS_RRAnswer(AnswerType_A, p_Header, p_u32TTL),
         m_IPAddress(0, 0, 0, 0)
     {
     }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA destructor
-*/
-    MDNSResponder::stcMDNS_RRAnswerA::~stcMDNS_RRAnswerA(void)
-    {
-        clear();
-    }
+        MDNSResponder::stcMDNS_RRAnswerA::stcMDNS_RRAnswerA destructor
+    */
+    MDNSResponder::stcMDNS_RRAnswerA::~stcMDNS_RRAnswerA(void) { clear(); }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerA::clear
-*/
+        MDNSResponder::stcMDNS_RRAnswerA::clear
+    */
     bool MDNSResponder::stcMDNS_RRAnswerA::clear(void)
     {
         m_IPAddress = IPAddress(0, 0, 0, 0);
@@ -989,33 +959,30 @@ namespace MDNSImplementation
 #endif
 
     /**
-    MDNSResponder::stcMDNS_RRAnswerPTR
+        MDNSResponder::stcMDNS_RRAnswerPTR
 
-    A MDNS PTR answer object.
-    Extends the base class by a MDNS domain member.
+        A MDNS PTR answer object.
+        Extends the base class by a MDNS domain member.
 
-*/
+    */
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR constructor
-*/
-    MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                            uint32_t                               p_u32TTL) :
+        MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR constructor
+    */
+    MDNSResponder::stcMDNS_RRAnswerPTR::stcMDNS_RRAnswerPTR(
+        const MDNSResponder::stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL) :
         stcMDNS_RRAnswer(AnswerType_PTR, p_Header, p_u32TTL)
     {
     }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR destructor
-*/
-    MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR(void)
-    {
-        clear();
-    }
+        MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR destructor
+    */
+    MDNSResponder::stcMDNS_RRAnswerPTR::~stcMDNS_RRAnswerPTR(void) { clear(); }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerPTR::clear
-*/
+        MDNSResponder::stcMDNS_RRAnswerPTR::clear
+    */
     bool MDNSResponder::stcMDNS_RRAnswerPTR::clear(void)
     {
         m_PTRDomain.clear();
@@ -1023,33 +990,30 @@ namespace MDNSImplementation
     }
 
     /**
-    MDNSResponder::stcMDNS_RRAnswerTXT
+        MDNSResponder::stcMDNS_RRAnswerTXT
 
-    A MDNS TXT answer object.
-    Extends the base class by a MDNS TXT items list member.
+        A MDNS TXT answer object.
+        Extends the base class by a MDNS TXT items list member.
 
-*/
+    */
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT constructor
-*/
-    MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                            uint32_t                               p_u32TTL) :
+        MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT constructor
+    */
+    MDNSResponder::stcMDNS_RRAnswerTXT::stcMDNS_RRAnswerTXT(
+        const MDNSResponder::stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL) :
         stcMDNS_RRAnswer(AnswerType_TXT, p_Header, p_u32TTL)
     {
     }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT destructor
-*/
-    MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT(void)
-    {
-        clear();
-    }
+        MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT destructor
+    */
+    MDNSResponder::stcMDNS_RRAnswerTXT::~stcMDNS_RRAnswerTXT(void) { clear(); }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerTXT::clear
-*/
+        MDNSResponder::stcMDNS_RRAnswerTXT::clear
+    */
     bool MDNSResponder::stcMDNS_RRAnswerTXT::clear(void)
     {
         m_Txts.clear();
@@ -1057,71 +1021,60 @@ namespace MDNSImplementation
     }
 
     /**
-    MDNSResponder::stcMDNS_RRAnswerAAAA
+        MDNSResponder::stcMDNS_RRAnswerAAAA
 
-    A MDNS AAAA answer object.
-    (Should) extend the base class by an IP6 address member.
+        A MDNS AAAA answer object.
+        (Should) extend the base class by an IP6 address member.
 
-*/
+    */
 
 #ifdef MDNS_IP6_SUPPORT
     /*
-    MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA constructor
-*/
-    MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                              uint32_t                               p_u32TTL) :
+        MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA constructor
+    */
+    MDNSResponder::stcMDNS_RRAnswerAAAA::stcMDNS_RRAnswerAAAA(
+        const MDNSResponder::stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL) :
         stcMDNS_RRAnswer(AnswerType_AAAA, p_Header, p_u32TTL)
     {
     }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA destructor
-*/
-    MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA(void)
-    {
-        clear();
-    }
+        MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA destructor
+    */
+    MDNSResponder::stcMDNS_RRAnswerAAAA::~stcMDNS_RRAnswerAAAA(void) { clear(); }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerAAAA::clear
-*/
-    bool MDNSResponder::stcMDNS_RRAnswerAAAA::clear(void)
-    {
-        return true;
-    }
+        MDNSResponder::stcMDNS_RRAnswerAAAA::clear
+    */
+    bool MDNSResponder::stcMDNS_RRAnswerAAAA::clear(void) { return true; }
 #endif
 
     /**
-    MDNSResponder::stcMDNS_RRAnswerSRV
+        MDNSResponder::stcMDNS_RRAnswerSRV
 
-    A MDNS SRV answer object.
-    Extends the base class by a port member.
+        A MDNS SRV answer object.
+        Extends the base class by a port member.
 
-*/
+    */
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV constructor
-*/
-    MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV(const MDNSResponder::stcMDNS_RRHeader& p_Header,
-                                                            uint32_t                               p_u32TTL) :
+        MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV constructor
+    */
+    MDNSResponder::stcMDNS_RRAnswerSRV::stcMDNS_RRAnswerSRV(
+        const MDNSResponder::stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL) :
         stcMDNS_RRAnswer(AnswerType_SRV, p_Header, p_u32TTL),
-        m_u16Priority(0),
-        m_u16Weight(0),
-        m_u16Port(0)
+        m_u16Priority(0), m_u16Weight(0), m_u16Port(0)
     {
     }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV destructor
-*/
-    MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV(void)
-    {
-        clear();
-    }
+        MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV destructor
+    */
+    MDNSResponder::stcMDNS_RRAnswerSRV::~stcMDNS_RRAnswerSRV(void) { clear(); }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerSRV::clear
-*/
+        MDNSResponder::stcMDNS_RRAnswerSRV::clear
+    */
     bool MDNSResponder::stcMDNS_RRAnswerSRV::clear(void)
     {
         m_u16Priority = 0;
@@ -1132,35 +1085,31 @@ namespace MDNSImplementation
     }
 
     /**
-    MDNSResponder::stcMDNS_RRAnswerGeneric
+        MDNSResponder::stcMDNS_RRAnswerGeneric
 
-    An unknown (generic) MDNS answer object.
-    Extends the base class by a RDATA buffer member.
+        An unknown (generic) MDNS answer object.
+        Extends the base class by a RDATA buffer member.
 
-*/
+    */
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric constructor
-*/
-    MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric(const stcMDNS_RRHeader& p_Header,
-                                                                    uint32_t                p_u32TTL) :
+        MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric constructor
+    */
+    MDNSResponder::stcMDNS_RRAnswerGeneric::stcMDNS_RRAnswerGeneric(
+        const stcMDNS_RRHeader& p_Header, uint32_t p_u32TTL) :
         stcMDNS_RRAnswer(AnswerType_Generic, p_Header, p_u32TTL),
-        m_u16RDLength(0),
-        m_pu8RDData(0)
+        m_u16RDLength(0), m_pu8RDData(0)
     {
     }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric destructor
-*/
-    MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric(void)
-    {
-        clear();
-    }
+        MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric destructor
+    */
+    MDNSResponder::stcMDNS_RRAnswerGeneric::~stcMDNS_RRAnswerGeneric(void) { clear(); }
 
     /*
-    MDNSResponder::stcMDNS_RRAnswerGeneric::clear
-*/
+        MDNSResponder::stcMDNS_RRAnswerGeneric::clear
+    */
     bool MDNSResponder::stcMDNS_RRAnswerGeneric::clear(void)
     {
         if (m_pu8RDData)
@@ -1174,29 +1123,25 @@ namespace MDNSImplementation
     }
 
     /**
-    MDNSResponder::stcProbeInformation
+        MDNSResponder::stcProbeInformation
 
-    Probing status information for a host or service domain
+        Probing status information for a host or service domain
 
-*/
+    */
 
     /*
-    MDNSResponder::stcProbeInformation::stcProbeInformation constructor
-*/
+        MDNSResponder::stcProbeInformation::stcProbeInformation constructor
+    */
     MDNSResponder::stcProbeInformation::stcProbeInformation(void) :
-        m_ProbingStatus(ProbingStatus_WaitingForData),
-        m_u8SentCount(0),
-        m_Timeout(esp8266::polledTimeout::oneShotMs::neverExpires),
-        m_bConflict(false),
-        m_bTiebreakNeeded(false),
-        m_fnHostProbeResultCallback(0),
-        m_fnServiceProbeResultCallback(0)
+        m_ProbingStatus(ProbingStatus_WaitingForData), m_u8SentCount(0),
+        m_Timeout(esp8266::polledTimeout::oneShotMs::neverExpires), m_bConflict(false),
+        m_bTiebreakNeeded(false), m_fnHostProbeResultCallback(0), m_fnServiceProbeResultCallback(0)
     {
     }
 
     /*
-    MDNSResponder::stcProbeInformation::clear
-*/
+        MDNSResponder::stcProbeInformation::clear
+    */
     bool MDNSResponder::stcProbeInformation::clear(bool p_bClearUserdata /*= false*/)
     {
         m_ProbingStatus = ProbingStatus_WaitingForData;
@@ -1213,30 +1158,25 @@ namespace MDNSImplementation
     }
 
     /**
-    MDNSResponder::stcMDNSService
-
-    A MDNS service object (to be announced by the MDNS responder)
-    The service instance may be '\0'; in this case the hostname is used
-    and the flag m_bAutoName is set. If the hostname changes, all 'auto-
-    named' services are renamed also.
-    m_u8Replymask is used while preparing a response to a MDNS query. It is
-    reset in '_sendMDNSMessage' afterwards.
-*/
+        MDNSResponder::stcMDNSService
+
+        A MDNS service object (to be announced by the MDNS responder)
+        The service instance may be '\0'; in this case the hostname is used
+        and the flag m_bAutoName is set. If the hostname changes, all 'auto-
+        named' services are renamed also.
+        m_u8Replymask is used while preparing a response to a MDNS query. It is
+        reset in '_sendMDNSMessage' afterwards.
+    */
 
     /*
-    MDNSResponder::stcMDNSService::stcMDNSService constructor
-*/
+        MDNSResponder::stcMDNSService::stcMDNSService constructor
+    */
     MDNSResponder::stcMDNSService::stcMDNSService(const char* p_pcName /*= 0*/,
                                                   const char* p_pcService /*= 0*/,
                                                   const char* p_pcProtocol /*= 0*/) :
         m_pNext(0),
-        m_pcName(0),
-        m_bAutoName(false),
-        m_pcService(0),
-        m_pcProtocol(0),
-        m_u16Port(0),
-        m_u8ReplyMask(0),
-        m_fnTxtCallback(0)
+        m_pcName(0), m_bAutoName(false), m_pcService(0), m_pcProtocol(0), m_u16Port(0),
+        m_u8ReplyMask(0), m_fnTxtCallback(0)
     {
         setName(p_pcName);
         setService(p_pcService);
@@ -1244,8 +1184,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSService::~stcMDNSService destructor
-*/
+        MDNSResponder::stcMDNSService::~stcMDNSService destructor
+    */
     MDNSResponder::stcMDNSService::~stcMDNSService(void)
     {
         releaseName();
@@ -1254,8 +1194,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSService::setName
-*/
+        MDNSResponder::stcMDNSService::setName
+    */
     bool MDNSResponder::stcMDNSService::setName(const char* p_pcName)
     {
         bool bResult = false;
@@ -1278,8 +1218,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSService::releaseName
-*/
+        MDNSResponder::stcMDNSService::releaseName
+    */
     bool MDNSResponder::stcMDNSService::releaseName(void)
     {
         if (m_pcName)
@@ -1291,8 +1231,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSService::setService
-*/
+        MDNSResponder::stcMDNSService::setService
+    */
     bool MDNSResponder::stcMDNSService::setService(const char* p_pcService)
     {
         bool bResult = false;
@@ -1315,8 +1255,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSService::releaseService
-*/
+        MDNSResponder::stcMDNSService::releaseService
+    */
     bool MDNSResponder::stcMDNSService::releaseService(void)
     {
         if (m_pcService)
@@ -1328,8 +1268,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSService::setProtocol
-*/
+        MDNSResponder::stcMDNSService::setProtocol
+    */
     bool MDNSResponder::stcMDNSService::setProtocol(const char* p_pcProtocol)
     {
         bool bResult = false;
@@ -1352,8 +1292,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSService::releaseProtocol
-*/
+        MDNSResponder::stcMDNSService::releaseProtocol
+    */
     bool MDNSResponder::stcMDNSService::releaseProtocol(void)
     {
         if (m_pcProtocol)
@@ -1365,109 +1305,108 @@ namespace MDNSImplementation
     }
 
     /**
-    MDNSResponder::stcMDNSServiceQuery
+        MDNSResponder::stcMDNSServiceQuery
 
-    A MDNS service query object.
-    Service queries may be static or dynamic.
-    As the static service query is processed in the blocking function 'queryService',
-    only one static service service may exist. The processing of the answers is done
-    on the WiFi-stack side of the ESP stack structure (via 'UDPContext.onRx(_update)').
+        A MDNS service query object.
+        Service queries may be static or dynamic.
+        As the static service query is processed in the blocking function 'queryService',
+        only one static service service may exist. The processing of the answers is done
+        on the WiFi-stack side of the ESP stack structure (via 'UDPContext.onRx(_update)').
 
-*/
+    */
 
     /**
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer
-
-    One answer for a service query.
-    Every answer must contain
-    - a service instance entry (pivot),
-    and may contain
-    - a host domain,
-    - a port
-    - an IP4 address
-    (- an IP6 address)
-    - a MDNS TXTs
-    The existence of a component is flagged in 'm_u32ContentFlags'.
-    For every answer component a TTL value is maintained.
-    Answer objects can be connected to a linked list.
-
-    For the host domain, service domain and TXTs components, a char array
-    representation can be retrieved (which is created on demand).
-
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer
+
+        One answer for a service query.
+        Every answer must contain
+        - a service instance entry (pivot),
+        and may contain
+        - a host domain,
+        - a port
+        - an IP4 address
+        (- an IP6 address)
+        - a MDNS TXTs
+        The existence of a component is flagged in 'm_u32ContentFlags'.
+        For every answer component a TTL value is maintained.
+        Answer objects can be connected to a linked list.
+
+        For the host domain, service domain and TXTs components, a char array
+        representation can be retrieved (which is created on demand).
+
+    */
 
     /**
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL
 
-    The TTL (Time-To-Live) for an specific answer content.
-    The 80% and outdated states are calculated based on the current time (millis)
-    and the 'set' time (also millis).
-    If the answer is scheduled for an update, the corresponding flag should be set.
+        The TTL (Time-To-Live) for an specific answer content.
+        The 80% and outdated states are calculated based on the current time (millis)
+        and the 'set' time (also millis).
+        If the answer is scheduled for an update, the corresponding flag should be set.
 
-    /
+        /
 
-    / *
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL constructor
-    /
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL(uint32_t p_u32TTL / *= 0* /)
-    :   m_bUpdateScheduled(false) {
+        / *
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL constructor
+        /
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL(uint32_t p_u32TTL / *= 0* /)
+        :   m_bUpdateScheduled(false) {
 
-    set(p_u32TTL * 1000);
-    }
+        set(p_u32TTL * 1000);
+        }
 
-    / *
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set
-    /
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set(uint32_t p_u32TTL) {
+        / *
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set
+        /
+        bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set(uint32_t p_u32TTL) {
 
-    m_TTLTimeFlag.restart(p_u32TTL * 1000);
-    m_bUpdateScheduled = false;
+        m_TTLTimeFlag.restart(p_u32TTL * 1000);
+        m_bUpdateScheduled = false;
 
-    return true;
-    }
+        return true;
+        }
 
-    / *
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::has80Percent
-    /
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::has80Percent(void) const {
+        / *
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::has80Percent
+        /
+        bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::has80Percent(void) const {
 
-    return ((m_TTLTimeFlag.getTimeout()) &&
-            (!m_bUpdateScheduled) &&
-            (m_TTLTimeFlag.hypotheticalTimeout((m_TTLTimeFlag.getTimeout() * 800) / 1000)));
-    }
+        return ((m_TTLTimeFlag.getTimeout()) &&
+                (!m_bUpdateScheduled) &&
+                (m_TTLTimeFlag.hypotheticalTimeout((m_TTLTimeFlag.getTimeout() * 800) / 1000)));
+        }
 
-    / *
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::isOutdated
-    /
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::isOutdated(void) const {
+        / *
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::isOutdated
+        /
+        bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::isOutdated(void) const {
 
-    return ((m_TTLTimeFlag.getTimeout()) &&
-            (m_TTLTimeFlag.flagged()));
-    }*/
+        return ((m_TTLTimeFlag.getTimeout()) &&
+                (m_TTLTimeFlag.flagged()));
+        }*/
 
     /**
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL
 
-    The TTL (Time-To-Live) for an specific answer content.
-    The 80% and outdated states are calculated based on the current time (millis)
-    and the 'set' time (also millis).
-    If the answer is scheduled for an update, the corresponding flag should be set.
+        The TTL (Time-To-Live) for an specific answer content.
+        The 80% and outdated states are calculated based on the current time (millis)
+        and the 'set' time (also millis).
+        If the answer is scheduled for an update, the corresponding flag should be set.
 
-*/
+    */
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL constructor
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL constructor
+    */
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::stcTTL(void) :
-        m_u32TTL(0),
-        m_TTLTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
+        m_u32TTL(0), m_TTLTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
         m_timeoutLevel(TIMEOUTLEVEL_UNSET)
     {
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set
+    */
     bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::set(uint32_t p_u32TTL)
     {
         m_u32TTL = p_u32TTL;
@@ -1485,16 +1424,16 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::flagged
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::flagged
+    */
     bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::flagged(void)
     {
         return ((m_u32TTL) && (TIMEOUTLEVEL_UNSET != m_timeoutLevel) && (m_TTLTimeout.expired()));
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::restart
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::restart
+    */
     bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::restart(void)
     {
         bool bResult = true;
@@ -1515,8 +1454,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::prepareDeletion
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::prepareDeletion
+    */
     bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::prepareDeletion(void)
     {
         m_timeoutLevel = TIMEOUTLEVEL_FINAL;
@@ -1526,17 +1465,18 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel
+    */
     bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::finalTimeoutLevel(void) const
     {
         return (TIMEOUTLEVEL_FINAL == m_timeoutLevel);
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout
-*/
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::timeType MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout(void) const
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout
+    */
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeoutBase::timeType
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcTTL::timeout(void) const
     {
         if (TIMEOUTLEVEL_BASE == m_timeoutLevel)  // 80%
         {
@@ -1552,15 +1492,15 @@ namespace MDNSImplementation
 
 #ifdef MDNS_IP4_SUPPORT
     /**
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address
 
-*/
+    */
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address constructor
-*/
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address(IPAddress p_IPAddress,
-                                                                                uint32_t  p_u32TTL /*= 0*/) :
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address constructor
+    */
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address::stcIP4Address(
+        IPAddress p_IPAddress, uint32_t p_u32TTL /*= 0*/) :
         m_pNext(0),
         m_IPAddress(p_IPAddress)
     {
@@ -1569,18 +1509,14 @@ namespace MDNSImplementation
 #endif
 
     /**
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer
+    */
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer constructor
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer constructor
+    */
     MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcAnswer(void) :
-        m_pNext(0),
-        m_pcServiceDomain(0),
-        m_pcHostDomain(0),
-        m_u16Port(0),
-        m_pcTxts(0),
+        m_pNext(0), m_pcServiceDomain(0), m_pcHostDomain(0), m_u16Port(0), m_pcTxts(0),
 #ifdef MDNS_IP4_SUPPORT
         m_pIP4Addresses(0),
 #endif
@@ -1592,16 +1528,13 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer destructor
-*/
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer(void)
-    {
-        clear();
-    }
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer destructor
+    */
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::~stcAnswer(void) { clear(); }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear
+    */
     bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::clear(void)
     {
         return ((releaseTxts()) &&
@@ -1616,11 +1549,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocServiceDomain
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocServiceDomain
 
-    Alloc memory for the char array representation of the service domain.
+        Alloc memory for the char array representation of the service domain.
 
-*/
+    */
     char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocServiceDomain(size_t p_stLength)
     {
         releaseServiceDomain();
@@ -1632,8 +1565,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseServiceDomain
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseServiceDomain
+    */
     bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseServiceDomain(void)
     {
         if (m_pcServiceDomain)
@@ -1645,11 +1578,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocHostDomain
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocHostDomain
 
-    Alloc memory for the char array representation of the host domain.
+        Alloc memory for the char array representation of the host domain.
 
-*/
+    */
     char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocHostDomain(size_t p_stLength)
     {
         releaseHostDomain();
@@ -1661,8 +1594,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseHostDomain
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseHostDomain
+    */
     bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseHostDomain(void)
     {
         if (m_pcHostDomain)
@@ -1674,11 +1607,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocTxts
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocTxts
 
-    Alloc memory for the char array representation of the TXT items.
+        Alloc memory for the char array representation of the TXT items.
 
-*/
+    */
     char* MDNSResponder::stcMDNSServiceQuery::stcAnswer::allocTxts(size_t p_stLength)
     {
         releaseTxts();
@@ -1690,8 +1623,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseTxts
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseTxts
+    */
     bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseTxts(void)
     {
         if (m_pcTxts)
@@ -1704,8 +1637,8 @@ namespace MDNSImplementation
 
 #ifdef MDNS_IP4_SUPPORT
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP4Addresses
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP4Addresses
+    */
     bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP4Addresses(void)
     {
         while (m_pIP4Addresses)
@@ -1718,9 +1651,10 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address
-*/
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address
+    */
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP4Address(
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
     {
         bool bResult = false;
 
@@ -1734,9 +1668,10 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address
-*/
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address
+    */
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP4Address(
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* p_pIP4Address)
     {
         bool bResult = false;
 
@@ -1764,17 +1699,20 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address (const)
-*/
-    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress) const
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address (const)
+    */
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address*
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(
+        const IPAddress& p_IPAddress) const
     {
         return (stcIP4Address*)(((const stcAnswer*)this)->findIP4Address(p_IPAddress));
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address
-*/
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress)
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address
+    */
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address*
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress)
     {
         stcIP4Address* pIP4Address = m_pIP4Addresses;
         while (pIP4Address)
@@ -1789,8 +1727,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount
+    */
     uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount(void) const
     {
         uint32_t u32Count = 0;
@@ -1805,24 +1743,28 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex
-*/
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index)
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex
+    */
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address*
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index)
     {
         return (stcIP4Address*)(((const stcAnswer*)this)->IP4AddressAtIndex(p_u32Index));
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex (const)
-*/
-    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index) const
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex (const)
+    */
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address*
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressAtIndex(uint32_t p_u32Index) const
     {
         const stcIP4Address* pIP4Address = 0;
 
         if (((uint32_t)(-1) != p_u32Index) && (m_pIP4Addresses))
         {
             uint32_t u32Index;
-            for (pIP4Address = m_pIP4Addresses, u32Index = 0; ((pIP4Address) && (u32Index < p_u32Index)); pIP4Address = pIP4Address->m_pNext, ++u32Index)
+            for (pIP4Address = m_pIP4Addresses, u32Index = 0;
+                 ((pIP4Address) && (u32Index < p_u32Index));
+                 pIP4Address = pIP4Address->m_pNext, ++u32Index)
                 ;
         }
         return pIP4Address;
@@ -1831,8 +1773,8 @@ namespace MDNSImplementation
 
 #ifdef MDNS_IP6_SUPPORT
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP6Addresses
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP6Addresses
+    */
     bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::releaseIP6Addresses(void)
     {
         while (m_pIP6Addresses)
@@ -1845,9 +1787,10 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address
-*/
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address
+    */
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::addIP6Address(
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
     {
         bool bResult = false;
 
@@ -1861,9 +1804,10 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address
-*/
-    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address(MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address
+    */
+    bool MDNSResponder::stcMDNSServiceQuery::stcAnswer::removeIP6Address(
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* p_pIP6Address)
     {
         bool bResult = false;
 
@@ -1891,17 +1835,20 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address
-*/
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IP6Address& p_IPAddress)
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address
+    */
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address*
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IP6Address& p_IPAddress)
     {
         return (stcIP6Address*)(((const stcAnswer*)this)->findIP6Address(p_IPAddress));
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address (const)
-*/
-    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(const IPAddress& p_IPAddress) const
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address (const)
+    */
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address*
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP6Address(
+        const IPAddress& p_IPAddress) const
     {
         const stcIP6Address* pIP6Address = m_pIP6Addresses;
         while (pIP6Address)
@@ -1916,8 +1863,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount
+    */
     uint32_t MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressCount(void) const
     {
         uint32_t u32Count = 0;
@@ -1932,24 +1879,28 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex (const)
-*/
-    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index) const
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex (const)
+    */
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address*
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index) const
     {
         return (stcIP6Address*)(((const stcAnswer*)this)->IP6AddressAtIndex(p_u32Index));
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex
-*/
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address* MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index)
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex
+    */
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP6Address*
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP6AddressAtIndex(uint32_t p_u32Index)
     {
         stcIP6Address* pIP6Address = 0;
 
         if (((uint32_t)(-1) != p_u32Index) && (m_pIP6Addresses))
         {
             uint32_t u32Index;
-            for (pIP6Address = m_pIP6Addresses, u32Index = 0; ((pIP6Address) && (u32Index < p_u32Index)); pIP6Address = pIP6Address->m_pNext, ++u32Index)
+            for (pIP6Address = m_pIP6Addresses, u32Index = 0;
+                 ((pIP6Address) && (u32Index < p_u32Index));
+                 pIP6Address = pIP6Address->m_pNext, ++u32Index)
                 ;
         }
         return pIP6Address;
@@ -1957,48 +1908,41 @@ namespace MDNSImplementation
 #endif
 
     /**
-    MDNSResponder::stcMDNSServiceQuery
-
-    A service query object.
-    A static query is flagged via 'm_bLegacyQuery'; while the function 'queryService'
-    is waiting for answers, the internal flag 'm_bAwaitingAnswers' is set. When the
-    timeout is reached, the flag is removed. These two flags are only used for static
-    service queries.
-    All answers to the service query are stored in 'm_pAnswers' list.
-    Individual answers may be addressed by index (in the list of answers).
-    Every time a answer component is added (or changes) in a dynamic service query,
-    the callback 'm_fnCallback' is called.
-    The answer list may be searched by service and host domain.
-
-    Service query object may be connected to a linked list.
-*/
+        MDNSResponder::stcMDNSServiceQuery
+
+        A service query object.
+        A static query is flagged via 'm_bLegacyQuery'; while the function 'queryService'
+        is waiting for answers, the internal flag 'm_bAwaitingAnswers' is set. When the
+        timeout is reached, the flag is removed. These two flags are only used for static
+        service queries.
+        All answers to the service query are stored in 'm_pAnswers' list.
+        Individual answers may be addressed by index (in the list of answers).
+        Every time a answer component is added (or changes) in a dynamic service query,
+        the callback 'm_fnCallback' is called.
+        The answer list may be searched by service and host domain.
+
+        Service query object may be connected to a linked list.
+    */
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery constructor
-*/
+        MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery constructor
+    */
     MDNSResponder::stcMDNSServiceQuery::stcMDNSServiceQuery(void) :
-        m_pNext(0),
-        m_fnCallback(0),
-        m_bLegacyQuery(false),
-        m_u8SentCount(0),
-        m_ResendTimeout(esp8266::polledTimeout::oneShotMs::neverExpires),
-        m_bAwaitingAnswers(true),
+        m_pNext(0), m_fnCallback(0), m_bLegacyQuery(false), m_u8SentCount(0),
+        m_ResendTimeout(esp8266::polledTimeout::oneShotMs::neverExpires), m_bAwaitingAnswers(true),
         m_pAnswers(0)
     {
         clear();
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery destructor
-*/
-    MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery(void)
-    {
-        clear();
-    }
+        MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery destructor
+    */
+    MDNSResponder::stcMDNSServiceQuery::~stcMDNSServiceQuery(void) { clear(); }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::clear
-*/
+        MDNSResponder::stcMDNSServiceQuery::clear
+    */
     bool MDNSResponder::stcMDNSServiceQuery::clear(void)
     {
         m_fnCallback   = 0;
@@ -2016,8 +1960,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::answerCount
-*/
+        MDNSResponder::stcMDNSServiceQuery::answerCount
+    */
     uint32_t MDNSResponder::stcMDNSServiceQuery::answerCount(void) const
     {
         uint32_t u32Count = 0;
@@ -2032,33 +1976,37 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::answerAtIndex
-*/
-    const MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index) const
+        MDNSResponder::stcMDNSServiceQuery::answerAtIndex
+    */
+    const MDNSResponder::stcMDNSServiceQuery::stcAnswer*
+    MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index) const
     {
         const stcAnswer* pAnswer = 0;
 
         if (((uint32_t)(-1) != p_u32Index) && (m_pAnswers))
         {
             uint32_t u32Index;
-            for (pAnswer = m_pAnswers, u32Index = 0; ((pAnswer) && (u32Index < p_u32Index)); pAnswer = pAnswer->m_pNext, ++u32Index)
+            for (pAnswer = m_pAnswers, u32Index = 0; ((pAnswer) && (u32Index < p_u32Index));
+                 pAnswer = pAnswer->m_pNext, ++u32Index)
                 ;
         }
         return pAnswer;
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::answerAtIndex
-*/
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index)
+        MDNSResponder::stcMDNSServiceQuery::answerAtIndex
+    */
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer*
+    MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index)
     {
         return (stcAnswer*)(((const stcMDNSServiceQuery*)this)->answerAtIndex(p_u32Index));
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::indexOfAnswer
-*/
-    uint32_t MDNSResponder::stcMDNSServiceQuery::indexOfAnswer(const MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer) const
+        MDNSResponder::stcMDNSServiceQuery::indexOfAnswer
+    */
+    uint32_t MDNSResponder::stcMDNSServiceQuery::indexOfAnswer(
+        const MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer) const
     {
         uint32_t u32Index = 0;
 
@@ -2073,9 +2021,10 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::addAnswer
-*/
-    bool MDNSResponder::stcMDNSServiceQuery::addAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
+        MDNSResponder::stcMDNSServiceQuery::addAnswer
+    */
+    bool MDNSResponder::stcMDNSServiceQuery::addAnswer(
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
     {
         bool bResult = false;
 
@@ -2089,9 +2038,10 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::removeAnswer
-*/
-    bool MDNSResponder::stcMDNSServiceQuery::removeAnswer(MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
+        MDNSResponder::stcMDNSServiceQuery::removeAnswer
+    */
+    bool MDNSResponder::stcMDNSServiceQuery::removeAnswer(
+        MDNSResponder::stcMDNSServiceQuery::stcAnswer* p_pAnswer)
     {
         bool bResult = false;
 
@@ -2119,9 +2069,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::findAnswerForServiceDomain
-*/
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForServiceDomain(const MDNSResponder::stcMDNS_RRDomain& p_ServiceDomain)
+        MDNSResponder::stcMDNSServiceQuery::findAnswerForServiceDomain
+    */
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer*
+    MDNSResponder::stcMDNSServiceQuery::findAnswerForServiceDomain(
+        const MDNSResponder::stcMDNS_RRDomain& p_ServiceDomain)
     {
         stcAnswer* pAnswer = m_pAnswers;
         while (pAnswer)
@@ -2136,9 +2088,11 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSServiceQuery::findAnswerForHostDomain
-*/
-    MDNSResponder::stcMDNSServiceQuery::stcAnswer* MDNSResponder::stcMDNSServiceQuery::findAnswerForHostDomain(const MDNSResponder::stcMDNS_RRDomain& p_HostDomain)
+        MDNSResponder::stcMDNSServiceQuery::findAnswerForHostDomain
+    */
+    MDNSResponder::stcMDNSServiceQuery::stcAnswer*
+    MDNSResponder::stcMDNSServiceQuery::findAnswerForHostDomain(
+        const MDNSResponder::stcMDNS_RRDomain& p_HostDomain)
     {
         stcAnswer* pAnswer = m_pAnswers;
         while (pAnswer)
@@ -2153,60 +2107,54 @@ namespace MDNSImplementation
     }
 
     /**
-    MDNSResponder::stcMDNSSendParameter
+        MDNSResponder::stcMDNSSendParameter
 
-    A 'collection' of properties and flags for one MDNS query or response.
-    Mainly managed by the 'Control' functions.
-    The current offset in the UPD output buffer is tracked to be able to do
-    a simple host or service domain compression.
+        A 'collection' of properties and flags for one MDNS query or response.
+        Mainly managed by the 'Control' functions.
+        The current offset in the UPD output buffer is tracked to be able to do
+        a simple host or service domain compression.
 
-*/
+    */
 
     /**
-    MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem
+        MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem
 
-    A cached host or service domain, incl. the offset in the UDP output buffer.
+        A cached host or service domain, incl. the offset in the UDP output buffer.
 
-*/
+    */
 
     /*
-    MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem constructor
-*/
-    MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem(const void* p_pHostnameOrService,
-                                                                                bool        p_bAdditionalData,
-                                                                                uint32_t    p_u16Offset) :
+        MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem constructor
+    */
+    MDNSResponder::stcMDNSSendParameter::stcDomainCacheItem::stcDomainCacheItem(
+        const void* p_pHostnameOrService, bool p_bAdditionalData, uint32_t p_u16Offset) :
         m_pNext(0),
-        m_pHostnameOrService(p_pHostnameOrService),
-        m_bAdditionalData(p_bAdditionalData),
+        m_pHostnameOrService(p_pHostnameOrService), m_bAdditionalData(p_bAdditionalData),
         m_u16Offset(p_u16Offset)
     {
     }
 
     /**
-    MDNSResponder::stcMDNSSendParameter
-*/
+        MDNSResponder::stcMDNSSendParameter
+    */
 
     /*
-    MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter constructor
-*/
+        MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter constructor
+    */
     MDNSResponder::stcMDNSSendParameter::stcMDNSSendParameter(void) :
-        m_pQuestions(0),
-        m_pDomainCacheItems(0)
+        m_pQuestions(0), m_pDomainCacheItems(0)
     {
         clear();
     }
 
     /*
-    MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter destructor
-*/
-    MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter(void)
-    {
-        clear();
-    }
+        MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter destructor
+    */
+    MDNSResponder::stcMDNSSendParameter::~stcMDNSSendParameter(void) { clear(); }
 
     /*
-    MDNSResponder::stcMDNSSendParameter::clear
-*/
+        MDNSResponder::stcMDNSSendParameter::clear
+    */
     bool MDNSResponder::stcMDNSSendParameter::clear(void)
     {
         m_u16ID           = 0;
@@ -2232,8 +2180,8 @@ namespace MDNSImplementation
         ;
     }
     /*
-    MDNSResponder::stcMDNSSendParameter::clear cached names
-*/
+        MDNSResponder::stcMDNSSendParameter::clear cached names
+    */
     bool MDNSResponder::stcMDNSSendParameter::clearCachedNames(void)
     {
         m_u16Offset = 0;
@@ -2250,8 +2198,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSSendParameter::shiftOffset
-*/
+        MDNSResponder::stcMDNSSendParameter::shiftOffset
+    */
     bool MDNSResponder::stcMDNSSendParameter::shiftOffset(uint16_t p_u16Shift)
     {
         m_u16Offset += p_u16Shift;
@@ -2259,8 +2207,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSSendParameter::addDomainCacheItem
-*/
+        MDNSResponder::stcMDNSSendParameter::addDomainCacheItem
+    */
     bool MDNSResponder::stcMDNSSendParameter::addDomainCacheItem(const void* p_pHostnameOrService,
                                                                  bool        p_bAdditionalData,
                                                                  uint16_t    p_u16Offset)
@@ -2268,7 +2216,9 @@ namespace MDNSImplementation
         bool bResult = false;
 
         stcDomainCacheItem* pNewItem = 0;
-        if ((p_pHostnameOrService) && (p_u16Offset) && ((pNewItem = new stcDomainCacheItem(p_pHostnameOrService, p_bAdditionalData, p_u16Offset))))
+        if ((p_pHostnameOrService) && (p_u16Offset)
+            && ((pNewItem
+                 = new stcDomainCacheItem(p_pHostnameOrService, p_bAdditionalData, p_u16Offset))))
         {
             pNewItem->m_pNext = m_pDomainCacheItems;
             bResult           = ((m_pDomainCacheItems = pNewItem));
@@ -2277,16 +2227,18 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset
-*/
-    uint16_t MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset(const void* p_pHostnameOrService,
-                                                                         bool        p_bAdditionalData) const
+        MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset
+    */
+    uint16_t
+    MDNSResponder::stcMDNSSendParameter::findCachedDomainOffset(const void* p_pHostnameOrService,
+                                                                bool        p_bAdditionalData) const
     {
         const stcDomainCacheItem* pCacheItem = m_pDomainCacheItems;
 
         for (; pCacheItem; pCacheItem = pCacheItem->m_pNext)
         {
-            if ((pCacheItem->m_pHostnameOrService == p_pHostnameOrService) && (pCacheItem->m_bAdditionalData == p_bAdditionalData))  // Found cache item
+            if ((pCacheItem->m_pHostnameOrService == p_pHostnameOrService)
+                && (pCacheItem->m_bAdditionalData == p_bAdditionalData))  // Found cache item
             {
                 break;
             }
diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
index d66509adb5..e755222a7f 100644
--- a/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
+++ b/libraries/ESP8266mDNS/src/LEAmDNS_Transfer.cpp
@@ -39,13 +39,13 @@ namespace esp8266
 namespace MDNSImplementation
 {
     /**
-    CONST STRINGS
-*/
+        CONST STRINGS
+    */
     static const char* scpcLocal    = "local";
     static const char* scpcServices = "services";
     static const char* scpcDNSSD    = "dns-sd";
     static const char* scpcUDP      = "udp";
-    //static const char*                    scpcTCP                 = "tcp";
+    // static const char*                    scpcTCP                 = "tcp";
 
 #ifdef MDNS_IP4_SUPPORT
     static const char* scpcReverseIP4Domain = "in-addr";
@@ -56,35 +56,39 @@ namespace MDNSImplementation
     static const char* scpcReverseTopDomain = "arpa";
 
     /**
-    TRANSFER
-*/
+        TRANSFER
+    */
 
     /**
-    SENDING
-*/
+        SENDING
+    */
 
     /*
-    MDNSResponder::_sendMDNSMessage
+        MDNSResponder::_sendMDNSMessage
 
-    Unicast responses are prepared and sent directly to the querier.
-    Multicast responses or queries are transferred to _sendMDNSMessage_Multicast
+        Unicast responses are prepared and sent directly to the querier.
+        Multicast responses or queries are transferred to _sendMDNSMessage_Multicast
 
-    Any reply flags in installed services are removed at the end!
+        Any reply flags in installed services are removed at the end!
 
-*/
+    */
     bool MDNSResponder::_sendMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         bool bResult = true;
 
-        if (p_rSendParameter.m_bResponse && p_rSendParameter.m_bUnicast)  // Unicast response  -> Send to querier
+        if (p_rSendParameter.m_bResponse
+            && p_rSendParameter.m_bUnicast)  // Unicast response  -> Send to querier
         {
-            DEBUG_EX_ERR(if (!m_pUDPContext->getRemoteAddress())
-                         {
-                             DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: MISSING remote address for response!\n"));
-                         });
+            DEBUG_EX_ERR(if (!m_pUDPContext->getRemoteAddress()) {
+                DEBUG_OUTPUT.printf_P(PSTR(
+                    "[MDNSResponder] _sendMDNSMessage: MISSING remote address for response!\n"));
+            });
             IPAddress ipRemote;
             ipRemote = m_pUDPContext->getRemoteAddress();
-            bResult  = ((_prepareMDNSMessage(p_rSendParameter, m_pUDPContext->getInputNetif()->ip_addr)) && (m_pUDPContext->sendTimeout(ipRemote, m_pUDPContext->getRemotePort(), MDNS_UDPCONTEXT_TIMEOUT)));
+            bResult
+                = ((_prepareMDNSMessage(p_rSendParameter, m_pUDPContext->getInputNetif()->ip_addr))
+                   && (m_pUDPContext->sendTimeout(ipRemote, m_pUDPContext->getRemotePort(),
+                                                  MDNS_UDPCONTEXT_TIMEOUT)));
         }
         else  // Multicast response
         {
@@ -97,20 +101,20 @@ namespace MDNSImplementation
             pService->m_u8ReplyMask = 0;
         }
 
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_sendMDNSMessage_Multicast
+        MDNSResponder::_sendMDNSMessage_Multicast
 
-    Fills the UDP output buffer (via _prepareMDNSMessage) and sends the buffer
-    via the selected WiFi interface (Station or AP)
-*/
-    bool MDNSResponder::_sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+        Fills the UDP output buffer (via _prepareMDNSMessage) and sends the buffer
+        via the selected WiFi interface (Station or AP)
+    */
+    bool
+    MDNSResponder::_sendMDNSMessage_Multicast(MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         bool bResult = false;
 
@@ -119,7 +123,7 @@ namespace MDNSImplementation
             if (netif_is_up(pNetIf))
             {
                 IPAddress fromIPAddress;
-                //fromIPAddress = _getResponseMulticastInterface();
+                // fromIPAddress = _getResponseMulticastInterface();
                 fromIPAddress = pNetIf->ip_addr;
                 m_pUDPContext->setMulticastInterface(fromIPAddress);
 
@@ -127,48 +131,53 @@ namespace MDNSImplementation
                 IPAddress toMulticastAddress(DNS_MQUERY_IPV4_GROUP_INIT);
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                //TODO: set multicast address
+                // TODO: set multicast address
                 IPAddress toMulticastAddress(DNS_MQUERY_IPV6_GROUP_INIT);
 #endif
-                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: Will send to '%s'.\n"), toMulticastAddress.toString().c_str()););
-                bResult = ((_prepareMDNSMessage(p_rSendParameter, fromIPAddress)) && (m_pUDPContext->sendTimeout(toMulticastAddress, DNS_MQUERY_PORT, MDNS_UDPCONTEXT_TIMEOUT)));
-
-                DEBUG_EX_ERR(if (!bResult)
-                             {
-                                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: FAILED!\n"));
-                             });
+                DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(
+                    PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: Will send to '%s'.\n"),
+                    toMulticastAddress.toString().c_str()););
+                bResult = ((_prepareMDNSMessage(p_rSendParameter, fromIPAddress))
+                           && (m_pUDPContext->sendTimeout(toMulticastAddress, DNS_MQUERY_PORT,
+                                                          MDNS_UDPCONTEXT_TIMEOUT)));
+
+                DEBUG_EX_ERR(if (!bResult) {
+                    DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _sendMDNSMessage_Multicast: FAILED!\n"));
+                });
             }
         }
         return bResult;
     }
 
     /*
-    MDNSResponder::_prepareMDNSMessage
+        MDNSResponder::_prepareMDNSMessage
 
-    The MDNS message is composed in a two-step process.
-    In the first loop 'only' the header information (mainly number of answers) are collected,
-    while in the seconds loop, the header and all queries and answers are written to the UDP
-    output buffer.
+        The MDNS message is composed in a two-step process.
+        In the first loop 'only' the header information (mainly number of answers) are collected,
+        while in the seconds loop, the header and all queries and answers are written to the UDP
+        output buffer.
 
-*/
+    */
     bool MDNSResponder::_prepareMDNSMessage(MDNSResponder::stcMDNSSendParameter& p_rSendParameter,
                                             IPAddress                            p_IPAddress)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage\n")););
         bool bResult = true;
-        p_rSendParameter.clearCachedNames();  // Need to remove cached names, p_SendParameter might have been used before on other interface
+        p_rSendParameter.clearCachedNames();  // Need to remove cached names, p_SendParameter might
+                                              // have been used before on other interface
 
         // Prepare header; count answers
-        stcMDNS_MsgHeader msgHeader(p_rSendParameter.m_u16ID, p_rSendParameter.m_bResponse, 0, p_rSendParameter.m_bAuthorative);
+        stcMDNS_MsgHeader msgHeader(p_rSendParameter.m_u16ID, p_rSendParameter.m_bResponse, 0,
+                                    p_rSendParameter.m_bAuthorative);
         // If this is a response, the answers are anwers,
         // else this is a query or probe and the answers go into auth section
-        uint16_t& ru16Answers = (p_rSendParameter.m_bResponse
-                                     ? msgHeader.m_u16ANCount
-                                     : msgHeader.m_u16NSCount);
+        uint16_t& ru16Answers
+            = (p_rSendParameter.m_bResponse ? msgHeader.m_u16ANCount : msgHeader.m_u16NSCount);
 
         /**
-        enuSequence
-    */
+            enuSequence
+        */
         enum enuSequence
         {
             Sequence_Count = 0,
@@ -176,98 +185,117 @@ namespace MDNSImplementation
         };
 
         // Two step sequence: 'Count' and 'Send'
-        for (uint32_t sequence = Sequence_Count; ((bResult) && (sequence <= Sequence_Send)); ++sequence)
+        for (uint32_t sequence = Sequence_Count; ((bResult) && (sequence <= Sequence_Send));
+             ++sequence)
         {
             DEBUG_EX_INFO(
                 if (Sequence_Send == sequence)
                 {
-                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
-                                          (unsigned)msgHeader.m_u16ID,
-                                          (unsigned)msgHeader.m_1bQR, (unsigned)msgHeader.m_4bOpcode, (unsigned)msgHeader.m_1bAA, (unsigned)msgHeader.m_1bTC, (unsigned)msgHeader.m_1bRD,
-                                          (unsigned)msgHeader.m_1bRA, (unsigned)msgHeader.m_4bRCode,
-                                          (unsigned)msgHeader.m_u16QDCount,
-                                          (unsigned)msgHeader.m_u16ANCount,
-                                          (unsigned)msgHeader.m_u16NSCount,
-                                          (unsigned)msgHeader.m_u16ARCount);
+                    DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _prepareMDNSMessage: ID:%u QR:%u OP:%u AA:%u TC:%u "
+                             "RD:%u "
+                             "RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
+                        (unsigned)msgHeader.m_u16ID, (unsigned)msgHeader.m_1bQR,
+                        (unsigned)msgHeader.m_4bOpcode, (unsigned)msgHeader.m_1bAA,
+                        (unsigned)msgHeader.m_1bTC, (unsigned)msgHeader.m_1bRD,
+                        (unsigned)msgHeader.m_1bRA, (unsigned)msgHeader.m_4bRCode,
+                        (unsigned)msgHeader.m_u16QDCount, (unsigned)msgHeader.m_u16ANCount,
+                        (unsigned)msgHeader.m_u16NSCount, (unsigned)msgHeader.m_u16ARCount);
                 });
             // Count/send
             // Header
-            bResult = ((Sequence_Count == sequence)
-                           ? true
-                           : _writeMDNSMsgHeader(msgHeader, p_rSendParameter));
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSMsgHeader FAILED!\n")););
+            bResult
+                = ((Sequence_Count == sequence) ? true :
+                                                  _writeMDNSMsgHeader(msgHeader, p_rSendParameter));
+            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSMsgHeader FAILED!\n")););
             // Questions
-            for (stcMDNS_RRQuestion* pQuestion = p_rSendParameter.m_pQuestions; ((bResult) && (pQuestion)); pQuestion = pQuestion->m_pNext)
+            for (stcMDNS_RRQuestion* pQuestion         = p_rSendParameter.m_pQuestions;
+                 ((bResult) && (pQuestion)); pQuestion = pQuestion->m_pNext)
             {
-                ((Sequence_Count == sequence)
-                     ? ++msgHeader.m_u16QDCount
-                     : (bResult = _writeMDNSQuestion(*pQuestion, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSQuestion FAILED!\n")););
+                ((Sequence_Count == sequence) ?
+                     ++msgHeader.m_u16QDCount :
+                     (bResult = _writeMDNSQuestion(*pQuestion, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+                    PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSQuestion FAILED!\n")););
             }
 
             // Answers and authoritative answers
 #ifdef MDNS_IP4_SUPPORT
             if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_A))
             {
-                ((Sequence_Count == sequence)
-                     ? ++ru16Answers
-                     : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(A) FAILED!\n")););
+                ((Sequence_Count == sequence) ?
+                     ++ru16Answers :
+                     (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+                    PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(A) FAILED!\n")););
             }
             if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP4))
             {
-                ((Sequence_Count == sequence)
-                     ? ++ru16Answers
-                     : (bResult = _writeMDNSAnswer_PTR_IP4(p_IPAddress, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP4 FAILED!\n")););
+                ((Sequence_Count == sequence) ?
+                     ++ru16Answers :
+                     (bResult = _writeMDNSAnswer_PTR_IP4(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR(
+                    "[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP4 FAILED!\n")););
             }
 #endif
 #ifdef MDNS_IP6_SUPPORT
             if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA))
             {
-                ((Sequence_Count == sequence)
-                     ? ++ru16Answers
-                     : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(A) FAILED!\n")););
+                ((Sequence_Count == sequence) ?
+                     ++ru16Answers :
+                     (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR(
+                    "[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(A) FAILED!\n")););
             }
             if ((bResult) && (p_rSendParameter.m_u8HostReplyMask & ContentFlag_PTR_IP6))
             {
-                ((Sequence_Count == sequence)
-                     ? ++ru16Answers
-                     : (bResult = _writeMDNSAnswer_PTR_IP6(p_IPAddress, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP6 FAILED!\n")););
+                ((Sequence_Count == sequence) ?
+                     ++ru16Answers :
+                     (bResult = _writeMDNSAnswer_PTR_IP6(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR(
+                    "[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_IP6 FAILED!\n")););
             }
 #endif
 
-            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService));
+                 pService                 = pService->m_pNext)
             {
                 if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_TYPE))
                 {
-                    ((Sequence_Count == sequence)
-                         ? ++ru16Answers
-                         : (bResult = _writeMDNSAnswer_PTR_TYPE(*pService, p_rSendParameter)));
-                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_TYPE FAILED!\n")););
+                    ((Sequence_Count == sequence) ?
+                         ++ru16Answers :
+                         (bResult = _writeMDNSAnswer_PTR_TYPE(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_TYPE "
+                             "FAILED!\n")););
                 }
                 if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME))
                 {
-                    ((Sequence_Count == sequence)
-                         ? ++ru16Answers
-                         : (bResult = _writeMDNSAnswer_PTR_NAME(*pService, p_rSendParameter)));
-                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_NAME FAILED!\n")););
+                    ((Sequence_Count == sequence) ?
+                         ++ru16Answers :
+                         (bResult = _writeMDNSAnswer_PTR_NAME(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_PTR_NAME "
+                             "FAILED!\n")););
                 }
                 if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_SRV))
                 {
-                    ((Sequence_Count == sequence)
-                         ? ++ru16Answers
-                         : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
-                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(A) FAILED!\n")););
+                    ((Sequence_Count == sequence) ?
+                         ++ru16Answers :
+                         (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(A) "
+                             "FAILED!\n")););
                 }
                 if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_TXT))
                 {
-                    ((Sequence_Count == sequence)
-                         ? ++ru16Answers
-                         : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
-                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(A) FAILED!\n")););
+                    ((Sequence_Count == sequence) ?
+                         ++ru16Answers :
+                         (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(A) "
+                             "FAILED!\n")););
                 }
             }  // for services
 
@@ -278,35 +306,50 @@ namespace MDNSImplementation
 #ifdef MDNS_IP6_SUPPORT
             bool bNeedsAdditionalAnswerAAAA = false;
 #endif
-            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService)); pService = pService->m_pNext)
+            for (stcMDNSService* pService = m_pServices; ((bResult) && (pService));
+                 pService                 = pService->m_pNext)
             {
-                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) &&  // If PTR_NAME is requested, AND
-                    (!(pService->m_u8ReplyMask & ContentFlag_SRV)))                   // NOT SRV -> add SRV as additional answer
+                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME)
+                    &&  // If PTR_NAME is requested, AND
+                    (!(pService->m_u8ReplyMask
+                       & ContentFlag_SRV)))  // NOT SRV -> add SRV as additional answer
                 {
-                    ((Sequence_Count == sequence)
-                         ? ++msgHeader.m_u16ARCount
-                         : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
-                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(B) FAILED!\n")););
+                    ((Sequence_Count == sequence) ?
+                         ++msgHeader.m_u16ARCount :
+                         (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_SRV(B) "
+                             "FAILED!\n")););
                 }
-                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME) &&  // If PTR_NAME is requested, AND
-                    (!(pService->m_u8ReplyMask & ContentFlag_TXT)))                   // NOT TXT -> add TXT as additional answer
+                if ((bResult) && (pService->m_u8ReplyMask & ContentFlag_PTR_NAME)
+                    &&  // If PTR_NAME is requested, AND
+                    (!(pService->m_u8ReplyMask
+                       & ContentFlag_TXT)))  // NOT TXT -> add TXT as additional answer
                 {
-                    ((Sequence_Count == sequence)
-                         ? ++msgHeader.m_u16ARCount
-                         : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
-                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(B) FAILED!\n")););
+                    ((Sequence_Count == sequence) ?
+                         ++msgHeader.m_u16ARCount :
+                         (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter)));
+                    DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_TXT(B) "
+                             "FAILED!\n")););
                 }
-                if ((pService->m_u8ReplyMask & (ContentFlag_PTR_NAME | ContentFlag_SRV)) ||     // If service instance name or SRV OR
-                    (p_rSendParameter.m_u8HostReplyMask & (ContentFlag_A | ContentFlag_AAAA)))  // any host IP address is requested
+                if ((pService->m_u8ReplyMask & (ContentFlag_PTR_NAME | ContentFlag_SRV))
+                    ||  // If service instance name or SRV OR
+                    (p_rSendParameter.m_u8HostReplyMask
+                     & (ContentFlag_A | ContentFlag_AAAA)))  // any host IP address is requested
                 {
 #ifdef MDNS_IP4_SUPPORT
-                    if ((bResult) && (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_A)))  // Add IP4 address
+                    if ((bResult)
+                        && (!(p_rSendParameter.m_u8HostReplyMask
+                              & ContentFlag_A)))  // Add IP4 address
                     {
                         bNeedsAdditionalAnswerA = true;
                     }
 #endif
 #ifdef MDNS_IP6_SUPPORT
-                    if ((bResult) && (!(p_rSendParameter.m_u8HostReplyMask & ContentFlag_AAAA)))  // Add IP6 address
+                    if ((bResult)
+                        && (!(p_rSendParameter.m_u8HostReplyMask
+                              & ContentFlag_AAAA)))  // Add IP6 address
                     {
                         bNeedsAdditionalAnswerAAAA = true;
                     }
@@ -318,48 +361,53 @@ namespace MDNSImplementation
 #ifdef MDNS_IP4_SUPPORT
             if ((bResult) && (bNeedsAdditionalAnswerA))
             {
-                ((Sequence_Count == sequence)
-                     ? ++msgHeader.m_u16ARCount
-                     : (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(B) FAILED!\n")););
+                ((Sequence_Count == sequence) ?
+                     ++msgHeader.m_u16ARCount :
+                     (bResult = _writeMDNSAnswer_A(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+                    PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_A(B) FAILED!\n")););
             }
 #endif
 #ifdef MDNS_IP6_SUPPORT
             // Answer AAAA needed?
             if ((bResult) && (bNeedsAdditionalAnswerAAAA))
             {
-                ((Sequence_Count == sequence)
-                     ? ++msgHeader.m_u16ARCount
-                     : (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
-                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(B) FAILED!\n")););
+                ((Sequence_Count == sequence) ?
+                     ++msgHeader.m_u16ARCount :
+                     (bResult = _writeMDNSAnswer_AAAA(p_IPAddress, p_rSendParameter)));
+                DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR(
+                    "[MDNSResponder] _prepareMDNSMessage: _writeMDNSAnswer_AAAA(B) FAILED!\n")););
             }
 #endif
-            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: Loop %i FAILED!\n"), sequence););
+            DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] _prepareMDNSMessage: Loop %i FAILED!\n"), sequence););
         }  // for sequence
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _prepareMDNSMessage: FAILED!\n")););
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] _prepareMDNSMessage: FAILED!\n")););
         return bResult;
     }
 
     /*
-    MDNSResponder::_sendMDNSServiceQuery
+        MDNSResponder::_sendMDNSServiceQuery
 
-    Creates and sends a PTR query for the given service domain.
+        Creates and sends a PTR query for the given service domain.
 
-*/
-    bool MDNSResponder::_sendMDNSServiceQuery(const MDNSResponder::stcMDNSServiceQuery& p_ServiceQuery)
+    */
+    bool
+    MDNSResponder::_sendMDNSServiceQuery(const MDNSResponder::stcMDNSServiceQuery& p_ServiceQuery)
     {
         return _sendMDNSQuery(p_ServiceQuery.m_ServiceTypeDomain, DNS_RRTYPE_PTR);
     }
 
     /*
-    MDNSResponder::_sendMDNSQuery
+        MDNSResponder::_sendMDNSQuery
 
-    Creates and sends a query for the given domain and query type.
+        Creates and sends a query for the given domain and query type.
 
-*/
+    */
     bool MDNSResponder::_sendMDNSQuery(const MDNSResponder::stcMDNS_RRDomain& p_QueryDomain,
                                        uint16_t                               p_u16QueryType,
-                                       stcMDNSServiceQuery::stcAnswer*        p_pKnownAnswers /*= 0*/)
+                                       stcMDNSServiceQuery::stcAnswer* p_pKnownAnswers /*= 0*/)
     {
         bool bResult = false;
 
@@ -369,32 +417,35 @@ namespace MDNSImplementation
             sendParameter.m_pQuestions->m_Header.m_Domain = p_QueryDomain;
 
             sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Type = p_u16QueryType;
-            // It seems, that some mDNS implementations don't support 'unicast response' questions...
-            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class = (/*0x8000 |*/ DNS_RRCLASS_IN);  // /*Unicast &*/ INternet
+            // It seems, that some mDNS implementations don't support 'unicast response'
+            // questions...
+            sendParameter.m_pQuestions->m_Header.m_Attributes.m_u16Class
+                = (/*0x8000 |*/ DNS_RRCLASS_IN);  // /*Unicast &*/ INternet
 
             // TODO: Add known answer to the query
             (void)p_pKnownAnswers;
 
             bResult = _sendMDNSMessage(sendParameter);
         }  // else: FAILED to alloc question
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _sendMDNSQuery: FAILED to alloc question!\n")););
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] _sendMDNSQuery: FAILED to alloc question!\n")););
         return bResult;
     }
 
     /**
-    HELPERS
-*/
+        HELPERS
+    */
 
     /**
-    RESOURCE RECORDS
-*/
+        RESOURCE RECORDS
+    */
 
     /*
-    MDNSResponder::_readRRQuestion
+        MDNSResponder::_readRRQuestion
 
-    Reads a question (eg. MyESP._http._tcp.local ANY IN) from the UPD input buffer.
+        Reads a question (eg. MyESP._http._tcp.local ANY IN) from the UPD input buffer.
 
-*/
+    */
     bool MDNSResponder::_readRRQuestion(MDNSResponder::stcMDNS_RRQuestion& p_rRRQuestion)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion\n")););
@@ -407,32 +458,33 @@ namespace MDNSImplementation
             p_rRRQuestion.m_bUnicast = (p_rRRQuestion.m_Header.m_Attributes.m_u16Class & 0x8000);
             p_rRRQuestion.m_Header.m_Attributes.m_u16Class &= (~0x8000);
 
-            DEBUG_EX_INFO(
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion "));
-                _printRRDomain(p_rRRQuestion.m_Header.m_Domain);
-                DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X %s\n"), (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Type, (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Class, (p_rRRQuestion.m_bUnicast ? "Unicast" : "Multicast")););
+            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion "));
+                          _printRRDomain(p_rRRQuestion.m_Header.m_Domain); DEBUG_OUTPUT.printf_P(
+                              PSTR(" Type:0x%04X Class:0x%04X %s\n"),
+                              (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Type,
+                              (unsigned)p_rRRQuestion.m_Header.m_Attributes.m_u16Class,
+                              (p_rRRQuestion.m_bUnicast ? "Unicast" : "Multicast")););
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRQuestion: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_readRRAnswer
+        MDNSResponder::_readRRAnswer
 
-    Reads an answer (eg. _http._tcp.local PTR OP TTL MyESP._http._tcp.local)
-    from the UDP input buffer.
-    After reading the domain and type info, the further processing of the answer
-    is transferred the answer specific reading functions.
-    Unknown answer types are processed by the generic answer reader (to remove them
-    from the input buffer).
+        Reads an answer (eg. _http._tcp.local PTR OP TTL MyESP._http._tcp.local)
+        from the UDP input buffer.
+        After reading the domain and type info, the further processing of the answer
+        is transferred the answer specific reading functions.
+        Unknown answer types are processed by the generic answer reader (to remove them
+        from the input buffer).
 
-*/
+    */
     bool MDNSResponder::_readRRAnswer(MDNSResponder::stcMDNS_RRAnswer*& p_rpRRAnswer)
     {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer\n")););
+        // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer\n")););
 
         bool bResult = false;
 
@@ -442,12 +494,15 @@ namespace MDNSImplementation
         if ((_readRRHeader(header)) && (_udpRead32(u32TTL)) && (_udpRead16(u16RDLength)))
         {
             /*  DEBUG_EX_INFO(
-                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: Reading 0x%04X answer (class:0x%04X, TTL:%u, RDLength:%u) for "), header.m_Attributes.m_u16Type, header.m_Attributes.m_u16Class, u32TTL, u16RDLength);
-                _printRRDomain(header.m_Domain);
-                DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                );*/
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: Reading 0x%04X answer
+               (class:0x%04X, TTL:%u, RDLength:%u) for "), header.m_Attributes.m_u16Type,
+               header.m_Attributes.m_u16Class, u32TTL, u16RDLength);
+                    _printRRDomain(header.m_Domain);
+                    DEBUG_OUTPUT.printf_P(PSTR("\n"));
+                    );*/
 
-            switch (header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
+            switch (header.m_Attributes.m_u16Type
+                    & (~0x8000))  // Topmost bit might carry 'cache flush' flag
             {
 #ifdef MDNS_IP4_SUPPORT
             case DNS_RRTYPE_A:
@@ -466,7 +521,7 @@ namespace MDNSImplementation
 #ifdef MDNS_IP6_SUPPORT
             case DNS_RRTYPE_AAAA:
                 p_rpRRAnswer = new stcMDNS_RRAnswerAAAA(header, u32TTL);
-                bResult      = _readRRAnswerAAAA(*(stcMDNS_RRAnswerAAAA*&)p_rpRRAnswer, u16RDLength);
+                bResult = _readRRAnswerAAAA(*(stcMDNS_RRAnswerAAAA*&)p_rpRRAnswer, u16RDLength);
                 break;
 #endif
             case DNS_RRTYPE_SRV:
@@ -475,7 +530,8 @@ namespace MDNSImplementation
                 break;
             default:
                 p_rpRRAnswer = new stcMDNS_RRAnswerGeneric(header, u32TTL);
-                bResult      = _readRRAnswerGeneric(*(stcMDNS_RRAnswerGeneric*&)p_rpRRAnswer, u16RDLength);
+                bResult
+                    = _readRRAnswerGeneric(*(stcMDNS_RRAnswerGeneric*&)p_rpRRAnswer, u16RDLength);
                 break;
             }
             DEBUG_EX_INFO(
@@ -483,12 +539,18 @@ namespace MDNSImplementation
                 {
                     DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: "));
                     _printRRDomain(p_rpRRAnswer->m_Header.m_Domain);
-                    DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, RDLength:%u "), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type, p_rpRRAnswer->m_Header.m_Attributes.m_u16Class, p_rpRRAnswer->m_u32TTL, u16RDLength);
-                    switch (header.m_Attributes.m_u16Type & (~0x8000))  // Topmost bit might carry 'cache flush' flag
+                    DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, RDLength:%u "),
+                                          p_rpRRAnswer->m_Header.m_Attributes.m_u16Type,
+                                          p_rpRRAnswer->m_Header.m_Attributes.m_u16Class,
+                                          p_rpRRAnswer->m_u32TTL, u16RDLength);
+                    switch (header.m_Attributes.m_u16Type
+                            & (~0x8000))  // Topmost bit might carry 'cache flush' flag
                     {
 #ifdef MDNS_IP4_SUPPORT
                     case DNS_RRTYPE_A:
-                        DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
+                        DEBUG_OUTPUT.printf_P(
+                            PSTR("A IP:%s"),
+                            ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
                         break;
 #endif
                     case DNS_RRTYPE_PTR:
@@ -497,8 +559,9 @@ namespace MDNSImplementation
                         break;
                     case DNS_RRTYPE_TXT:
                     {
-                        size_t stTxtLength = ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_strLength();
-                        char*  pTxts       = new char[stTxtLength];
+                        size_t stTxtLength
+                            = ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_strLength();
+                        char* pTxts = new char[stTxtLength];
                         if (pTxts)
                         {
                             ((stcMDNS_RRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_str(pTxts);
@@ -509,11 +572,14 @@ namespace MDNSImplementation
                     }
 #ifdef MDNS_IP6_SUPPORT
                     case DNS_RRTYPE_AAAA:
-                        DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
+                        DEBUG_OUTPUT.printf_P(
+                            PSTR("AAAA IP:%s"),
+                            ((stcMDNS_RRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str());
                         break;
 #endif
                     case DNS_RRTYPE_SRV:
-                        DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_u16Port);
+                        DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "),
+                                              ((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_u16Port);
                         _printRRDomain(((stcMDNS_RRAnswerSRV*&)p_rpRRAnswer)->m_SRVDomain);
                         break;
                     default:
@@ -523,47 +589,55 @@ namespace MDNSImplementation
                     DEBUG_OUTPUT.printf_P(PSTR("\n"));
                 } else
                 {
-                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED to read specific answer of type 0x%04X!\n"), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type);
+                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED to read "
+                                               "specific answer of type 0x%04X!\n"),
+                                          p_rpRRAnswer->m_Header.m_Attributes.m_u16Type);
                 });  // DEBUG_EX_INFO
         }
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED!\n")););
+        DEBUG_EX_ERR(if (!bResult)
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswer: FAILED!\n")););
         return bResult;
     }
 
 #ifdef MDNS_IP4_SUPPORT
     /*
-    MDNSResponder::_readRRAnswerA
-*/
+        MDNSResponder::_readRRAnswerA
+    */
     bool MDNSResponder::_readRRAnswerA(MDNSResponder::stcMDNS_RRAnswerA& p_rRRAnswerA,
                                        uint16_t                          p_u16RDLength)
     {
         uint32_t u32IP4Address;
-        bool     bResult = ((MDNS_IP4_SIZE == p_u16RDLength) && (_udpReadBuffer((unsigned char*)&u32IP4Address, MDNS_IP4_SIZE)) && ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IP4Address))));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerA: FAILED!\n")););
+        bool     bResult = ((MDNS_IP4_SIZE == p_u16RDLength)
+                        && (_udpReadBuffer((unsigned char*)&u32IP4Address, MDNS_IP4_SIZE))
+                        && ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IP4Address))));
+        DEBUG_EX_ERR(if (!bResult)
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerA: FAILED!\n")););
         return bResult;
     }
 #endif
 
     /*
-    MDNSResponder::_readRRAnswerPTR
-*/
+        MDNSResponder::_readRRAnswerPTR
+    */
     bool MDNSResponder::_readRRAnswerPTR(MDNSResponder::stcMDNS_RRAnswerPTR& p_rRRAnswerPTR,
                                          uint16_t                            p_u16RDLength)
     {
         bool bResult = ((p_u16RDLength) && (_readRRDomain(p_rRRAnswerPTR.m_PTRDomain)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerPTR: FAILED!\n")););
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] _readRRAnswerPTR: FAILED!\n")););
         return bResult;
     }
 
     /*
-    MDNSResponder::_readRRAnswerTXT
+        MDNSResponder::_readRRAnswerTXT
 
-    Read TXT items from a buffer like 4c#=15ff=20
-*/
+        Read TXT items from a buffer like 4c#=15ff=20
+    */
     bool MDNSResponder::_readRRAnswerTXT(MDNSResponder::stcMDNS_RRAnswerTXT& p_rRRAnswerTXT,
                                          uint16_t                            p_u16RDLength)
     {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: RDLength:%u\n"), p_u16RDLength););
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: RDLength:%u\n"),
+                                            p_u16RDLength););
         bool bResult = true;
 
         p_rRRAnswerTXT.clear();
@@ -588,27 +662,40 @@ namespace MDNSImplementation
                         if (ucLength)
                         {
                             DEBUG_EX_INFO(
-                                static char sacBuffer[64]; *sacBuffer                                              = 0;
-                                uint8_t     u8MaxLength                                                            = ((ucLength > (sizeof(sacBuffer) - 1)) ? (sizeof(sacBuffer) - 1) : ucLength);
-                                os_strncpy(sacBuffer, (const char*)pucCursor, u8MaxLength); sacBuffer[u8MaxLength] = 0;
-                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: Item(%u): %s\n"), ucLength, sacBuffer););
-
-                            unsigned char* pucEqualSign = (unsigned char*)os_strchr((const char*)pucCursor, '=');  // Position of the '=' sign
-                            unsigned char  ucKeyLength;
+                                static char sacBuffer[64]; *sacBuffer = 0;
+                                uint8_t     u8MaxLength
+                                = ((ucLength > (sizeof(sacBuffer) - 1)) ? (sizeof(sacBuffer) - 1) :
+                                                                          ucLength);
+                                os_strncpy(sacBuffer, (const char*)pucCursor, u8MaxLength);
+                                sacBuffer[u8MaxLength] = 0; DEBUG_OUTPUT.printf_P(
+                                    PSTR("[MDNSResponder] _readRRAnswerTXT: Item(%u): %s\n"),
+                                    ucLength, sacBuffer););
+
+                            unsigned char* pucEqualSign = (unsigned char*)os_strchr(
+                                (const char*)pucCursor, '=');  // Position of the '=' sign
+                            unsigned char ucKeyLength;
                             if ((pucEqualSign) && ((ucKeyLength = (pucEqualSign - pucCursor))))
                             {
-                                unsigned char ucValueLength = (ucLength - (pucEqualSign - pucCursor + 1));
-                                bResult                     = (((pTxt = new stcMDNSServiceTxt)) && (pTxt->setKey((const char*)pucCursor, ucKeyLength)) && (pTxt->setValue((const char*)(pucEqualSign + 1), ucValueLength)));
+                                unsigned char ucValueLength
+                                    = (ucLength - (pucEqualSign - pucCursor + 1));
+                                bResult = (((pTxt = new stcMDNSServiceTxt))
+                                           && (pTxt->setKey((const char*)pucCursor, ucKeyLength))
+                                           && (pTxt->setValue((const char*)(pucEqualSign + 1),
+                                                              ucValueLength)));
                             }
                             else
                             {
-                                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: INVALID TXT format (No '=')!\n")););
+                                DEBUG_EX_ERR(
+                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: "
+                                                               "INVALID TXT format (No '=')!\n")););
                             }
                             pucCursor += ucLength;
                         }
                         else  // no/zero length TXT
                         {
-                            DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: TXT answer contains no items.\n")););
+                            DEBUG_EX_INFO(
+                                DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: TXT "
+                                                           "answer contains no items.\n")););
                             bResult = true;
                         }
 
@@ -623,9 +710,10 @@ namespace MDNSImplementation
                             if (!bResult)
                             {
                                 DEBUG_EX_ERR(
-                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT item!\n"));
-                                    DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
-                                    _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
+                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: "
+                                                               "FAILED to read TXT item!\n"));
+                                    DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n")); _udpDump(
+                                        (m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
                                     DEBUG_OUTPUT.printf_P(PSTR("\n")););
                             }
                             if (pTxt)
@@ -637,31 +725,35 @@ namespace MDNSImplementation
                         }
                     }  // while
 
-                    DEBUG_EX_ERR(
-                        if (!bResult)  // Some failure
-                        {
-                            DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
-                            _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength);
-                            DEBUG_OUTPUT.printf_P(PSTR("\n"));
-                        });
+                    DEBUG_EX_ERR(if (!bResult)  // Some failure
+                                 {
+                                     DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n"));
+                                     _udpDump((m_pUDPContext->tell() - p_u16RDLength),
+                                              p_u16RDLength);
+                                     DEBUG_OUTPUT.printf_P(PSTR("\n"));
+                                 });
                 }
                 else
                 {
-                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT content!\n")););
+                    DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                        PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to read TXT content!\n")););
                 }
                 // Clean up
                 delete[] pucBuffer;
             }
             else
             {
-                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED to alloc buffer for TXT content!\n")););
+                DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED "
+                                                        "to alloc buffer for TXT content!\n")););
             }
         }
         else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: WARNING! No content!\n")););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] _readRRAnswerTXT: WARNING! No content!\n")););
         }
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED!\n")););
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] _readRRAnswerTXT: FAILED!\n")););
         return bResult;
     }
 
@@ -676,72 +768,86 @@ namespace MDNSImplementation
 #endif
 
     /*
-    MDNSResponder::_readRRAnswerSRV
-*/
+        MDNSResponder::_readRRAnswerSRV
+    */
     bool MDNSResponder::_readRRAnswerSRV(MDNSResponder::stcMDNS_RRAnswerSRV& p_rRRAnswerSRV,
                                          uint16_t                            p_u16RDLength)
     {
-        bool bResult = (((3 * sizeof(uint16_t)) < p_u16RDLength) && (_udpRead16(p_rRRAnswerSRV.m_u16Priority)) && (_udpRead16(p_rRRAnswerSRV.m_u16Weight)) && (_udpRead16(p_rRRAnswerSRV.m_u16Port)) && (_readRRDomain(p_rRRAnswerSRV.m_SRVDomain)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerSRV: FAILED!\n")););
+        bool bResult
+            = (((3 * sizeof(uint16_t)) < p_u16RDLength)
+               && (_udpRead16(p_rRRAnswerSRV.m_u16Priority))
+               && (_udpRead16(p_rRRAnswerSRV.m_u16Weight)) && (_udpRead16(p_rRRAnswerSRV.m_u16Port))
+               && (_readRRDomain(p_rRRAnswerSRV.m_SRVDomain)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] _readRRAnswerSRV: FAILED!\n")););
         return bResult;
     }
 
     /*
-    MDNSResponder::_readRRAnswerGeneric
-*/
-    bool MDNSResponder::_readRRAnswerGeneric(MDNSResponder::stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
-                                             uint16_t                                p_u16RDLength)
+        MDNSResponder::_readRRAnswerGeneric
+    */
+    bool
+    MDNSResponder::_readRRAnswerGeneric(MDNSResponder::stcMDNS_RRAnswerGeneric& p_rRRAnswerGeneric,
+                                        uint16_t                                p_u16RDLength)
     {
         bool bResult = (0 == p_u16RDLength);
 
         p_rRRAnswerGeneric.clear();
-        if (((p_rRRAnswerGeneric.m_u16RDLength = p_u16RDLength)) && ((p_rRRAnswerGeneric.m_pu8RDData = new unsigned char[p_rRRAnswerGeneric.m_u16RDLength])))
+        if (((p_rRRAnswerGeneric.m_u16RDLength = p_u16RDLength))
+            && ((p_rRRAnswerGeneric.m_pu8RDData
+                 = new unsigned char[p_rRRAnswerGeneric.m_u16RDLength])))
         {
-            bResult = _udpReadBuffer(p_rRRAnswerGeneric.m_pu8RDData, p_rRRAnswerGeneric.m_u16RDLength);
+            bResult
+                = _udpReadBuffer(p_rRRAnswerGeneric.m_pu8RDData, p_rRRAnswerGeneric.m_u16RDLength);
         }
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAnswerGeneric: FAILED!\n")););
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] _readRRAnswerGeneric: FAILED!\n")););
         return bResult;
     }
 
     /*
-    MDNSResponder::_readRRHeader
-*/
+        MDNSResponder::_readRRHeader
+    */
     bool MDNSResponder::_readRRHeader(MDNSResponder::stcMDNS_RRHeader& p_rRRHeader)
     {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader\n")););
+        // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader\n")););
 
-        bool bResult = ((_readRRDomain(p_rRRHeader.m_Domain)) && (_readRRAttributes(p_rRRHeader.m_Attributes)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader: FAILED!\n")););
+        bool bResult = ((_readRRDomain(p_rRRHeader.m_Domain))
+                        && (_readRRAttributes(p_rRRHeader.m_Attributes)));
+        DEBUG_EX_ERR(if (!bResult)
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRHeader: FAILED!\n")););
         return bResult;
     }
 
     /*
-    MDNSResponder::_readRRDomain
+        MDNSResponder::_readRRDomain
 
-    Reads a (maybe multilevel compressed) domain from the UDP input buffer.
+        Reads a (maybe multilevel compressed) domain from the UDP input buffer.
 
-*/
+    */
     bool MDNSResponder::_readRRDomain(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain)
     {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain\n")););
+        // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain\n")););
 
         bool bResult = ((p_rRRDomain.clear()) && (_readRRDomain_Loop(p_rRRDomain, 0)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain: FAILED!\n")););
+        DEBUG_EX_ERR(if (!bResult)
+                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain: FAILED!\n")););
         return bResult;
     }
 
     /*
-    MDNSResponder::_readRRDomain_Loop
+        MDNSResponder::_readRRDomain_Loop
 
-    Reads a domain from the UDP input buffer. For every compression level, the functions
-    calls itself recursively. To avoid endless recursion because of malformed MDNS records,
-    the maximum recursion depth is set by MDNS_DOMAIN_MAX_REDIRCTION.
+        Reads a domain from the UDP input buffer. For every compression level, the functions
+        calls itself recursively. To avoid endless recursion because of malformed MDNS records,
+        the maximum recursion depth is set by MDNS_DOMAIN_MAX_REDIRCTION.
 
-*/
+    */
     bool MDNSResponder::_readRRDomain_Loop(MDNSResponder::stcMDNS_RRDomain& p_rRRDomain,
                                            uint8_t                          p_u8Depth)
     {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u)\n"), p_u8Depth););
+        // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u)\n"),
+        // p_u8Depth););
 
         bool bResult = false;
 
@@ -752,36 +858,50 @@ namespace MDNSImplementation
             uint8_t u8Len = 0;
             do
             {
-                //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Offset:%u p0:%02x\n"), p_u8Depth, m_pUDPContext->tell(), m_pUDPContext->peek()););
+                // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u):
+                // Offset:%u p0:%02x\n"), p_u8Depth, m_pUDPContext->tell(),
+                // m_pUDPContext->peek()););
                 _udpRead8(u8Len);
 
                 if (u8Len & MDNS_DOMAIN_COMPRESS_MARK)
                 {
                     // Compressed label(s)
-                    uint16_t u16Offset = ((u8Len & ~MDNS_DOMAIN_COMPRESS_MARK) << 8);  // Implicit BE to LE conversion!
+                    uint16_t u16Offset = ((u8Len & ~MDNS_DOMAIN_COMPRESS_MARK)
+                                          << 8);  // Implicit BE to LE conversion!
                     _udpRead8(u8Len);
                     u16Offset |= u8Len;
 
                     if (m_pUDPContext->isValidOffset(u16Offset))
                     {
-                        size_t stCurrentPosition = m_pUDPContext->tell();  // Prepare return from recursion
+                        size_t stCurrentPosition
+                            = m_pUDPContext->tell();  // Prepare return from recursion
 
-                        //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Redirecting from %u to %u!\n"), p_u8Depth, stCurrentPosition, u16Offset););
+                        // DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder]
+                        // _readRRDomain_Loop(%u): Redirecting from %u to %u!\n"), p_u8Depth,
+                        // stCurrentPosition, u16Offset););
                         m_pUDPContext->seek(u16Offset);
                         if (_readRRDomain_Loop(p_rRRDomain, p_u8Depth + 1))  // Do recursion
                         {
-                            //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Succeeded to read redirected label! Returning to %u\n"), p_u8Depth, stCurrentPosition););
+                            // DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder]
+                            // _readRRDomain_Loop(%u): Succeeded to read redirected label! Returning
+                            // to %u\n"), p_u8Depth, stCurrentPosition););
                             m_pUDPContext->seek(stCurrentPosition);  // Restore after recursion
                         }
                         else
                         {
-                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): FAILED to read redirected label!\n"), p_u8Depth););
+                            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                                PSTR("[MDNSResponder] _readRRDomain_Loop(%u): FAILED to read "
+                                     "redirected label!\n"),
+                                p_u8Depth););
                             bResult = false;
                         }
                     }
                     else
                     {
-                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): INVALID offset in redirection!\n"), p_u8Depth););
+                        DEBUG_EX_ERR(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): "
+                                                       "INVALID offset in redirection!\n"),
+                                                  p_u8Depth););
                         bResult = false;
                     }
                     break;
@@ -796,21 +916,33 @@ namespace MDNSImplementation
                         ++(p_rRRDomain.m_u16NameLength);
                         if (u8Len)  // Add name
                         {
-                            if ((bResult = _udpReadBuffer((unsigned char*)&(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]), u8Len)))
+                            if ((bResult = _udpReadBuffer(
+                                     (unsigned char*)&(
+                                         p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]),
+                                     u8Len)))
                             {
                                 /*  DEBUG_EX_INFO(
-                                    p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength + u8Len] = 0;  // Closing '\0' for printing
-                                    DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): Domain label (%u): %s\n"), p_u8Depth, (unsigned)(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength - 1]), &(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]));
-                                    );*/
+                                        p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength + u8Len] =
+                                   0;  // Closing '\0' for printing
+                                        DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder]
+                                   _readRRDomain_Loop(%u): Domain label (%u): %s\n"), p_u8Depth,
+                                   (unsigned)(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength -
+                                   1]), &(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]));
+                                        );*/
 
                                 p_rRRDomain.m_u16NameLength += u8Len;
                             }
                         }
-                        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(2) offset:%u p0:%x\n"), m_pUDPContext->tell(), m_pUDPContext->peek()););
+                        // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder]
+                        // _readRRDomain_Loop(2) offset:%u p0:%x\n"), m_pUDPContext->tell(),
+                        // m_pUDPContext->peek()););
                     }
                     else
                     {
-                        DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Domain name too long (%u + %u)!\n"), p_u8Depth, p_rRRDomain.m_u16NameLength, u8Len););
+                        DEBUG_EX_ERR(
+                            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): "
+                                                       "ERROR! Domain name too long (%u + %u)!\n"),
+                                                  p_u8Depth, p_rRRDomain.m_u16NameLength, u8Len););
                         bResult = false;
                         break;
                     }
@@ -819,101 +951,123 @@ namespace MDNSImplementation
         }
         else
         {
-            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Too many redirections!\n"), p_u8Depth););
+            DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(
+                PSTR("[MDNSResponder] _readRRDomain_Loop(%u): ERROR! Too many redirections!\n"),
+                p_u8Depth););
         }
         return bResult;
     }
 
     /*
-    MDNSResponder::_readRRAttributes
-*/
+        MDNSResponder::_readRRAttributes
+    */
     bool MDNSResponder::_readRRAttributes(MDNSResponder::stcMDNS_RRAttributes& p_rRRAttributes)
     {
-        //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes\n")););
+        // DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes\n")););
 
-        bool bResult = ((_udpRead16(p_rRRAttributes.m_u16Type)) && (_udpRead16(p_rRRAttributes.m_u16Class)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readRRAttributes: FAILED!\n")););
+        bool bResult
+            = ((_udpRead16(p_rRRAttributes.m_u16Type)) && (_udpRead16(p_rRRAttributes.m_u16Class)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] _readRRAttributes: FAILED!\n")););
         return bResult;
     }
 
     /*
-    DOMAIN NAMES
-*/
+        DOMAIN NAMES
+    */
 
     /*
-    MDNSResponder::_buildDomainForHost
+        MDNSResponder::_buildDomainForHost
 
-    Builds a MDNS host domain (eg. esp8266.local) for the given hostname.
+        Builds a MDNS host domain (eg. esp8266.local) for the given hostname.
 
-*/
+    */
     bool MDNSResponder::_buildDomainForHost(const char*                      p_pcHostname,
                                             MDNSResponder::stcMDNS_RRDomain& p_rHostDomain) const
     {
         p_rHostDomain.clear();
-        bool bResult = ((p_pcHostname) && (*p_pcHostname) && (p_rHostDomain.addLabel(p_pcHostname)) && (p_rHostDomain.addLabel(scpcLocal)) && (p_rHostDomain.addLabel(0)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForHost: FAILED!\n")););
+        bool bResult = ((p_pcHostname) && (*p_pcHostname) && (p_rHostDomain.addLabel(p_pcHostname))
+                        && (p_rHostDomain.addLabel(scpcLocal)) && (p_rHostDomain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] _buildDomainForHost: FAILED!\n")););
         return bResult;
     }
 
     /*
-    MDNSResponder::_buildDomainForDNSSD
+        MDNSResponder::_buildDomainForDNSSD
 
-    Builds the '_services._dns-sd._udp.local' domain.
-    Used while detecting generic service enum question (DNS-SD) and answering these questions.
+        Builds the '_services._dns-sd._udp.local' domain.
+        Used while detecting generic service enum question (DNS-SD) and answering these questions.
 
-*/
+    */
     bool MDNSResponder::_buildDomainForDNSSD(MDNSResponder::stcMDNS_RRDomain& p_rDNSSDDomain) const
     {
         p_rDNSSDDomain.clear();
-        bool bResult = ((p_rDNSSDDomain.addLabel(scpcServices, true)) && (p_rDNSSDDomain.addLabel(scpcDNSSD, true)) && (p_rDNSSDDomain.addLabel(scpcUDP, true)) && (p_rDNSSDDomain.addLabel(scpcLocal)) && (p_rDNSSDDomain.addLabel(0)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForDNSSD: FAILED!\n")););
+        bool bResult = ((p_rDNSSDDomain.addLabel(scpcServices, true))
+                        && (p_rDNSSDDomain.addLabel(scpcDNSSD, true))
+                        && (p_rDNSSDDomain.addLabel(scpcUDP, true))
+                        && (p_rDNSSDDomain.addLabel(scpcLocal)) && (p_rDNSSDDomain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] _buildDomainForDNSSD: FAILED!\n")););
         return bResult;
     }
 
     /*
-    MDNSResponder::_buildDomainForService
+        MDNSResponder::_buildDomainForService
 
-    Builds the domain for the given service (eg. _http._tcp.local or
-    MyESP._http._tcp.local (if p_bIncludeName is set)).
+        Builds the domain for the given service (eg. _http._tcp.local or
+        MyESP._http._tcp.local (if p_bIncludeName is set)).
 
-*/
-    bool MDNSResponder::_buildDomainForService(const MDNSResponder::stcMDNSService& p_Service,
-                                               bool                                 p_bIncludeName,
-                                               MDNSResponder::stcMDNS_RRDomain&     p_rServiceDomain) const
+    */
+    bool
+    MDNSResponder::_buildDomainForService(const MDNSResponder::stcMDNSService& p_Service,
+                                          bool                                 p_bIncludeName,
+                                          MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
     {
         p_rServiceDomain.clear();
-        bool bResult = (((!p_bIncludeName) || (p_rServiceDomain.addLabel(p_Service.m_pcName))) && (p_rServiceDomain.addLabel(p_Service.m_pcService, true)) && (p_rServiceDomain.addLabel(p_Service.m_pcProtocol, true)) && (p_rServiceDomain.addLabel(scpcLocal)) && (p_rServiceDomain.addLabel(0)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED!\n")););
+        bool bResult
+            = (((!p_bIncludeName) || (p_rServiceDomain.addLabel(p_Service.m_pcName)))
+               && (p_rServiceDomain.addLabel(p_Service.m_pcService, true))
+               && (p_rServiceDomain.addLabel(p_Service.m_pcProtocol, true))
+               && (p_rServiceDomain.addLabel(scpcLocal)) && (p_rServiceDomain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] _buildDomainForService: FAILED!\n")););
         return bResult;
     }
 
     /*
-    MDNSResponder::_buildDomainForService
+        MDNSResponder::_buildDomainForService
 
-    Builds the domain for the given service properties (eg. _http._tcp.local).
-    The usual prepended '_' are added, if missing in the input strings.
+        Builds the domain for the given service properties (eg. _http._tcp.local).
+        The usual prepended '_' are added, if missing in the input strings.
 
-*/
-    bool MDNSResponder::_buildDomainForService(const char*                      p_pcService,
-                                               const char*                      p_pcProtocol,
-                                               MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
+    */
+    bool
+    MDNSResponder::_buildDomainForService(const char* p_pcService, const char* p_pcProtocol,
+                                          MDNSResponder::stcMDNS_RRDomain& p_rServiceDomain) const
     {
         p_rServiceDomain.clear();
-        bool bResult = ((p_pcService) && (p_pcProtocol) && (p_rServiceDomain.addLabel(p_pcService, ('_' != *p_pcService))) && (p_rServiceDomain.addLabel(p_pcProtocol, ('_' != *p_pcProtocol))) && (p_rServiceDomain.addLabel(scpcLocal)) && (p_rServiceDomain.addLabel(0)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForService: FAILED for (%s.%s)!\n"), (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
+        bool bResult
+            = ((p_pcService) && (p_pcProtocol)
+               && (p_rServiceDomain.addLabel(p_pcService, ('_' != *p_pcService)))
+               && (p_rServiceDomain.addLabel(p_pcProtocol, ('_' != *p_pcProtocol)))
+               && (p_rServiceDomain.addLabel(scpcLocal)) && (p_rServiceDomain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] _buildDomainForService: FAILED for (%s.%s)!\n"),
+            (p_pcService ?: "-"), (p_pcProtocol ?: "-")););
         return bResult;
     }
 
 #ifdef MDNS_IP4_SUPPORT
     /*
-    MDNSResponder::_buildDomainForReverseIP4
+        MDNSResponder::_buildDomainForReverseIP4
 
-    The IP4 address is stringized by printing the four address bytes into a char buffer in reverse order
-    and adding 'in-addr.arpa' (eg. 012.789.456.123.in-addr.arpa).
-    Used while detecting reverse IP4 questions and answering these
-*/
-    bool MDNSResponder::_buildDomainForReverseIP4(IPAddress                        p_IP4Address,
-                                                  MDNSResponder::stcMDNS_RRDomain& p_rReverseIP4Domain) const
+        The IP4 address is stringized by printing the four address bytes into a char buffer in
+       reverse order and adding 'in-addr.arpa' (eg. 012.789.456.123.in-addr.arpa). Used while
+       detecting reverse IP4 questions and answering these
+    */
+    bool MDNSResponder::_buildDomainForReverseIP4(
+        IPAddress p_IP4Address, MDNSResponder::stcMDNS_RRDomain& p_rReverseIP4Domain) const
     {
         bool bResult = true;
 
@@ -925,20 +1079,23 @@ namespace MDNSImplementation
             itoa(p_IP4Address[i - 1], acBuffer, 10);
             bResult = p_rReverseIP4Domain.addLabel(acBuffer);
         }
-        bResult = ((bResult) && (p_rReverseIP4Domain.addLabel(scpcReverseIP4Domain)) && (p_rReverseIP4Domain.addLabel(scpcReverseTopDomain)) && (p_rReverseIP4Domain.addLabel(0)));
-        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _buildDomainForReverseIP4: FAILED!\n")););
+        bResult = ((bResult) && (p_rReverseIP4Domain.addLabel(scpcReverseIP4Domain))
+                   && (p_rReverseIP4Domain.addLabel(scpcReverseTopDomain))
+                   && (p_rReverseIP4Domain.addLabel(0)));
+        DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(
+            PSTR("[MDNSResponder] _buildDomainForReverseIP4: FAILED!\n")););
         return bResult;
     }
 #endif
 
 #ifdef MDNS_IP6_SUPPORT
     /*
-    MDNSResponder::_buildDomainForReverseIP6
+        MDNSResponder::_buildDomainForReverseIP6
 
-    Used while detecting reverse IP6 questions and answering these
-*/
-    bool MDNSResponder::_buildDomainForReverseIP6(IPAddress                        p_IP4Address,
-                                                  MDNSResponder::stcMDNS_RRDomain& p_rReverseIP6Domain) const
+        Used while detecting reverse IP6 questions and answering these
+    */
+    bool MDNSResponder::_buildDomainForReverseIP6(
+        IPAddress p_IP4Address, MDNSResponder::stcMDNS_RRDomain& p_rReverseIP6Domain) const
     {
         // TODO: Implement
         return false;
@@ -946,34 +1103,33 @@ namespace MDNSImplementation
 #endif
 
     /*
-    UDP
-*/
+        UDP
+    */
 
     /*
-    MDNSResponder::_udpReadBuffer
-*/
-    bool MDNSResponder::_udpReadBuffer(unsigned char* p_pBuffer,
-                                       size_t         p_stLength)
+        MDNSResponder::_udpReadBuffer
+    */
+    bool MDNSResponder::_udpReadBuffer(unsigned char* p_pBuffer, size_t p_stLength)
     {
-        bool bResult = ((m_pUDPContext) && (true /*m_pUDPContext->getSize() > p_stLength*/) && (p_pBuffer) && (p_stLength) && ((p_stLength == m_pUDPContext->read((char*)p_pBuffer, p_stLength))));
+        bool bResult = ((m_pUDPContext) && (true /*m_pUDPContext->getSize() > p_stLength*/)
+                        && (p_pBuffer) && (p_stLength)
+                        && ((p_stLength == m_pUDPContext->read((char*)p_pBuffer, p_stLength))));
         DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpReadBuffer: FAILED!\n"));
-                     });
+                     { DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpReadBuffer: FAILED!\n")); });
         return bResult;
     }
 
     /*
-    MDNSResponder::_udpRead8
-*/
+        MDNSResponder::_udpRead8
+    */
     bool MDNSResponder::_udpRead8(uint8_t& p_ru8Value)
     {
         return _udpReadBuffer((unsigned char*)&p_ru8Value, sizeof(p_ru8Value));
     }
 
     /*
-    MDNSResponder::_udpRead16
-*/
+        MDNSResponder::_udpRead16
+    */
     bool MDNSResponder::_udpRead16(uint16_t& p_ru16Value)
     {
         bool bResult = false;
@@ -987,8 +1143,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_udpRead32
-*/
+        MDNSResponder::_udpRead32
+    */
     bool MDNSResponder::_udpRead32(uint32_t& p_ru32Value)
     {
         bool bResult = false;
@@ -1002,30 +1158,30 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_udpAppendBuffer
-*/
-    bool MDNSResponder::_udpAppendBuffer(const unsigned char* p_pcBuffer,
-                                         size_t               p_stLength)
+        MDNSResponder::_udpAppendBuffer
+    */
+    bool MDNSResponder::_udpAppendBuffer(const unsigned char* p_pcBuffer, size_t p_stLength)
     {
-        bool bResult = ((m_pUDPContext) && (p_pcBuffer) && (p_stLength) && (p_stLength == m_pUDPContext->append((const char*)p_pcBuffer, p_stLength)));
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpAppendBuffer: FAILED!\n"));
-                     });
+        bool bResult
+            = ((m_pUDPContext) && (p_pcBuffer) && (p_stLength)
+               && (p_stLength == m_pUDPContext->append((const char*)p_pcBuffer, p_stLength)));
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _udpAppendBuffer: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_udpAppend8
-*/
+        MDNSResponder::_udpAppend8
+    */
     bool MDNSResponder::_udpAppend8(uint8_t p_u8Value)
     {
         return (_udpAppendBuffer((unsigned char*)&p_u8Value, sizeof(p_u8Value)));
     }
 
     /*
-    MDNSResponder::_udpAppend16
-*/
+        MDNSResponder::_udpAppend16
+    */
     bool MDNSResponder::_udpAppend16(uint16_t p_u16Value)
     {
         p_u16Value = lwip_htons(p_u16Value);
@@ -1033,8 +1189,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_udpAppend32
-*/
+        MDNSResponder::_udpAppend32
+    */
     bool MDNSResponder::_udpAppend32(uint32_t p_u32Value)
     {
         p_u32Value = lwip_htonl(p_u32Value);
@@ -1043,8 +1199,8 @@ namespace MDNSImplementation
 
 #ifdef DEBUG_ESP_MDNS_RESPONDER
     /*
-    MDNSResponder::_udpDump
-*/
+        MDNSResponder::_udpDump
+    */
     bool MDNSResponder::_udpDump(bool p_bMovePointer /*= false*/)
     {
         const uint8_t cu8BytesPerLine = 16;
@@ -1056,9 +1212,12 @@ namespace MDNSImplementation
 
         while (_udpRead8(u8Byte))
         {
-            DEBUG_OUTPUT.printf_P(PSTR("%02x %s"), u8Byte, ((++u32Counter % cu8BytesPerLine) ? "" : "\n"));
+            DEBUG_OUTPUT.printf_P(PSTR("%02x %s"), u8Byte,
+                                  ((++u32Counter % cu8BytesPerLine) ? "" : "\n"));
         }
-        DEBUG_OUTPUT.printf_P(PSTR("%sDone: %u bytes\n"), (((u32Counter) && (u32Counter % cu8BytesPerLine)) ? "\n" : ""), u32Counter);
+        DEBUG_OUTPUT.printf_P(PSTR("%sDone: %u bytes\n"),
+                              (((u32Counter) && (u32Counter % cu8BytesPerLine)) ? "\n" : ""),
+                              u32Counter);
 
         if (!p_bMovePointer)  // Restore
         {
@@ -1068,10 +1227,9 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_udpDump
-*/
-    bool MDNSResponder::_udpDump(unsigned p_uOffset,
-                                 unsigned p_uLength)
+        MDNSResponder::_udpDump
+    */
+    bool MDNSResponder::_udpDump(unsigned p_uOffset, unsigned p_uLength)
     {
         if ((m_pUDPContext) && (m_pUDPContext->isValidOffset(p_uOffset)))
         {
@@ -1091,60 +1249,64 @@ namespace MDNSImplementation
 #endif
 
     /**
-    READ/WRITE MDNS STRUCTS
-*/
+        READ/WRITE MDNS STRUCTS
+    */
 
     /*
-    MDNSResponder::_readMDNSMsgHeader
+        MDNSResponder::_readMDNSMsgHeader
 
-    Read a MDNS header from the UDP input buffer.
-     |   8    |   8    |   8    |   8    |
-    00|   Identifier    |  Flags & Codes  |
-    01| Question count  |  Answer count   |
-    02| NS answer count | Ad answer count |
+        Read a MDNS header from the UDP input buffer.
+         |   8    |   8    |   8    |   8    |
+        00|   Identifier    |  Flags & Codes  |
+        01| Question count  |  Answer count   |
+        02| NS answer count | Ad answer count |
 
-    All 16-bit and 32-bit elements need to be translated form network coding to host coding (done in _udpRead16 and _udpRead32)
-    In addition, bitfield memory order is undefined in C standard (GCC doesn't order them in the coded direction...), so they
-    need some mapping here
-*/
+        All 16-bit and 32-bit elements need to be translated form network coding to host coding
+       (done in _udpRead16 and _udpRead32) In addition, bitfield memory order is undefined in C
+       standard (GCC doesn't order them in the coded direction...), so they need some mapping here
+    */
     bool MDNSResponder::_readMDNSMsgHeader(MDNSResponder::stcMDNS_MsgHeader& p_rMsgHeader)
     {
         bool bResult = false;
 
         uint8_t u8B1;
         uint8_t u8B2;
-        if ((_udpRead16(p_rMsgHeader.m_u16ID)) && (_udpRead8(u8B1)) && (_udpRead8(u8B2)) && (_udpRead16(p_rMsgHeader.m_u16QDCount)) && (_udpRead16(p_rMsgHeader.m_u16ANCount)) && (_udpRead16(p_rMsgHeader.m_u16NSCount)) && (_udpRead16(p_rMsgHeader.m_u16ARCount)))
+        if ((_udpRead16(p_rMsgHeader.m_u16ID)) && (_udpRead8(u8B1)) && (_udpRead8(u8B2))
+            && (_udpRead16(p_rMsgHeader.m_u16QDCount)) && (_udpRead16(p_rMsgHeader.m_u16ANCount))
+            && (_udpRead16(p_rMsgHeader.m_u16NSCount)) && (_udpRead16(p_rMsgHeader.m_u16ARCount)))
         {
-            p_rMsgHeader.m_1bQR     = (u8B1 & 0x80);  // Query/Respond flag
-            p_rMsgHeader.m_4bOpcode = (u8B1 & 0x78);  // Operation code (0: Standard query, others ignored)
-            p_rMsgHeader.m_1bAA     = (u8B1 & 0x04);  // Authoritative answer
-            p_rMsgHeader.m_1bTC     = (u8B1 & 0x02);  // Truncation flag
-            p_rMsgHeader.m_1bRD     = (u8B1 & 0x01);  // Recursion desired
+            p_rMsgHeader.m_1bQR = (u8B1 & 0x80);  // Query/Respond flag
+            p_rMsgHeader.m_4bOpcode
+                = (u8B1 & 0x78);  // Operation code (0: Standard query, others ignored)
+            p_rMsgHeader.m_1bAA = (u8B1 & 0x04);  // Authoritative answer
+            p_rMsgHeader.m_1bTC = (u8B1 & 0x02);  // Truncation flag
+            p_rMsgHeader.m_1bRD = (u8B1 & 0x01);  // Recursion desired
 
             p_rMsgHeader.m_1bRA    = (u8B2 & 0x80);  // Recursion available
             p_rMsgHeader.m_3bZ     = (u8B2 & 0x70);  // Zero
             p_rMsgHeader.m_4bRCode = (u8B2 & 0x0F);  // Response code
 
-            /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
-                (unsigned)p_rMsgHeader.m_u16ID,
-                (unsigned)p_rMsgHeader.m_1bQR, (unsigned)p_rMsgHeader.m_4bOpcode, (unsigned)p_rMsgHeader.m_1bAA, (unsigned)p_rMsgHeader.m_1bTC, (unsigned)p_rMsgHeader.m_1bRD,
-                (unsigned)p_rMsgHeader.m_1bRA, (unsigned)p_rMsgHeader.m_4bRCode,
-                (unsigned)p_rMsgHeader.m_u16QDCount,
-                (unsigned)p_rMsgHeader.m_u16ANCount,
-                (unsigned)p_rMsgHeader.m_u16NSCount,
-                (unsigned)p_rMsgHeader.m_u16ARCount););*/
+            /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: ID:%u
+               QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
+                    (unsigned)p_rMsgHeader.m_u16ID,
+                    (unsigned)p_rMsgHeader.m_1bQR, (unsigned)p_rMsgHeader.m_4bOpcode,
+               (unsigned)p_rMsgHeader.m_1bAA, (unsigned)p_rMsgHeader.m_1bTC,
+               (unsigned)p_rMsgHeader.m_1bRD, (unsigned)p_rMsgHeader.m_1bRA,
+               (unsigned)p_rMsgHeader.m_4bRCode, (unsigned)p_rMsgHeader.m_u16QDCount,
+                    (unsigned)p_rMsgHeader.m_u16ANCount,
+                    (unsigned)p_rMsgHeader.m_u16NSCount,
+                    (unsigned)p_rMsgHeader.m_u16ARCount););*/
             bResult = true;
         }
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _readMDNSMsgHeader: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_write8
-*/
+        MDNSResponder::_write8
+    */
     bool MDNSResponder::_write8(uint8_t                              p_u8Value,
                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
@@ -1152,8 +1314,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_write16
-*/
+        MDNSResponder::_write16
+    */
     bool MDNSResponder::_write16(uint16_t                             p_u16Value,
                                  MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
@@ -1161,8 +1323,8 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_write32
-*/
+        MDNSResponder::_write32
+    */
     bool MDNSResponder::_write32(uint32_t                             p_u32Value,
                                  MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
@@ -1170,308 +1332,369 @@ namespace MDNSImplementation
     }
 
     /*
-    MDNSResponder::_writeMDNSMsgHeader
+        MDNSResponder::_writeMDNSMsgHeader
 
-    Write MDNS header to the UDP output buffer.
+        Write MDNS header to the UDP output buffer.
 
-    All 16-bit and 32-bit elements need to be translated form host coding to network coding (done in _udpAppend16 and _udpAppend32)
-    In addition, bitfield memory order is undefined in C standard (GCC doesn't order them in the coded direction...), so they
-    need some mapping here
-*/
+        All 16-bit and 32-bit elements need to be translated form host coding to network coding
+       (done in _udpAppend16 and _udpAppend32) In addition, bitfield memory order is undefined in C
+       standard (GCC doesn't order them in the coded direction...), so they need some mapping here
+    */
     bool MDNSResponder::_writeMDNSMsgHeader(const MDNSResponder::stcMDNS_MsgHeader& p_MsgHeader,
-                                            MDNSResponder::stcMDNSSendParameter&    p_rSendParameter)
+                                            MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
-        /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
-            (unsigned)p_MsgHeader.m_u16ID,
-            (unsigned)p_MsgHeader.m_1bQR, (unsigned)p_MsgHeader.m_4bOpcode, (unsigned)p_MsgHeader.m_1bAA, (unsigned)p_MsgHeader.m_1bTC, (unsigned)p_MsgHeader.m_1bRD,
-            (unsigned)p_MsgHeader.m_1bRA, (unsigned)p_MsgHeader.m_4bRCode,
-            (unsigned)p_MsgHeader.m_u16QDCount,
-            (unsigned)p_MsgHeader.m_u16ANCount,
-            (unsigned)p_MsgHeader.m_u16NSCount,
-            (unsigned)p_MsgHeader.m_u16ARCount););*/
-
-        uint8_t u8B1((p_MsgHeader.m_1bQR << 7) | (p_MsgHeader.m_4bOpcode << 3) | (p_MsgHeader.m_1bAA << 2) | (p_MsgHeader.m_1bTC << 1) | (p_MsgHeader.m_1bRD));
-        uint8_t u8B2((p_MsgHeader.m_1bRA << 7) | (p_MsgHeader.m_3bZ << 4) | (p_MsgHeader.m_4bRCode));
-        bool    bResult = ((_write16(p_MsgHeader.m_u16ID, p_rSendParameter)) && (_write8(u8B1, p_rSendParameter)) && (_write8(u8B2, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter)) && (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter)));
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: FAILED!\n"));
-                     });
+        /*  DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: ID:%u
+           QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"),
+                (unsigned)p_MsgHeader.m_u16ID,
+                (unsigned)p_MsgHeader.m_1bQR, (unsigned)p_MsgHeader.m_4bOpcode,
+           (unsigned)p_MsgHeader.m_1bAA, (unsigned)p_MsgHeader.m_1bTC, (unsigned)p_MsgHeader.m_1bRD,
+                (unsigned)p_MsgHeader.m_1bRA, (unsigned)p_MsgHeader.m_4bRCode,
+                (unsigned)p_MsgHeader.m_u16QDCount,
+                (unsigned)p_MsgHeader.m_u16ANCount,
+                (unsigned)p_MsgHeader.m_u16NSCount,
+                (unsigned)p_MsgHeader.m_u16ARCount););*/
+
+        uint8_t u8B1((p_MsgHeader.m_1bQR << 7) | (p_MsgHeader.m_4bOpcode << 3)
+                     | (p_MsgHeader.m_1bAA << 2) | (p_MsgHeader.m_1bTC << 1)
+                     | (p_MsgHeader.m_1bRD));
+        uint8_t u8B2((p_MsgHeader.m_1bRA << 7) | (p_MsgHeader.m_3bZ << 4)
+                     | (p_MsgHeader.m_4bRCode));
+        bool    bResult = ((_write16(p_MsgHeader.m_u16ID, p_rSendParameter))
+                        && (_write8(u8B1, p_rSendParameter)) && (_write8(u8B2, p_rSendParameter))
+                        && (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter))
+                        && (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter))
+                        && (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter))
+                        && (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter)));
+
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSMsgHeader: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_writeRRAttributes
-*/
-    bool MDNSResponder::_writeMDNSRRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Attributes,
-                                               MDNSResponder::stcMDNSSendParameter&       p_rSendParameter)
+        MDNSResponder::_writeRRAttributes
+    */
+    bool
+    MDNSResponder::_writeMDNSRRAttributes(const MDNSResponder::stcMDNS_RRAttributes& p_Attributes,
+                                          MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
-        bool bResult = ((_write16(p_Attributes.m_u16Type, p_rSendParameter)) && (_write16(p_Attributes.m_u16Class, p_rSendParameter)));
+        bool bResult = ((_write16(p_Attributes.m_u16Type, p_rSendParameter))
+                        && (_write16(p_Attributes.m_u16Class, p_rSendParameter)));
 
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRAttributes: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRAttributes: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_writeMDNSRRDomain
-*/
+        MDNSResponder::_writeMDNSRRDomain
+    */
     bool MDNSResponder::_writeMDNSRRDomain(const MDNSResponder::stcMDNS_RRDomain& p_Domain,
                                            MDNSResponder::stcMDNSSendParameter&   p_rSendParameter)
     {
-        bool bResult = ((_udpAppendBuffer((const unsigned char*)p_Domain.m_acName, p_Domain.m_u16NameLength)) && (p_rSendParameter.shiftOffset(p_Domain.m_u16NameLength)));
+        bool bResult
+            = ((_udpAppendBuffer((const unsigned char*)p_Domain.m_acName, p_Domain.m_u16NameLength))
+               && (p_rSendParameter.shiftOffset(p_Domain.m_u16NameLength)));
 
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRDomain: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSRRDomain: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_writeMDNSHostDomain
+        MDNSResponder::_writeMDNSHostDomain
 
-    Write a host domain to the UDP output buffer.
-    If the domain record is part of the answer, the records length is
-    prepended (p_bPrependRDLength is set).
+        Write a host domain to the UDP output buffer.
+        If the domain record is part of the answer, the records length is
+        prepended (p_bPrependRDLength is set).
 
-    A very simple form of name compression is applied here:
-    If the domain is written to the UDP output buffer, the write offset is stored
-    together with a domain id (the pointer) in a p_rSendParameter substructure (cache).
-    If the same domain (pointer) should be written to the UDP output later again,
-    the old offset is retrieved from the cache, marked as a compressed domain offset
-    and written to the output buffer.
+        A very simple form of name compression is applied here:
+        If the domain is written to the UDP output buffer, the write offset is stored
+        together with a domain id (the pointer) in a p_rSendParameter substructure (cache).
+        If the same domain (pointer) should be written to the UDP output later again,
+        the old offset is retrieved from the cache, marked as a compressed domain offset
+        and written to the output buffer.
 
-*/
-    bool MDNSResponder::_writeMDNSHostDomain(const char*                          p_pcHostname,
-                                             bool                                 p_bPrependRDLength,
+    */
+    bool MDNSResponder::_writeMDNSHostDomain(const char* p_pcHostname, bool p_bPrependRDLength,
                                              MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
-        uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostname, false);
+        uint16_t u16CachedDomainOffset
+            = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostname, false);
 
         stcMDNS_RRDomain hostDomain;
-        bool             bResult = (u16CachedDomainOffset
-                            // Found cached domain -> mark as compressed domain
-                                        ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
-                               ((!p_bPrependRDLength) || (_write16(2, p_rSendParameter))) &&                                 // Length of 'Cxxx'
-                               (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&    // Compression mark (and offset)
-                               (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
-                            // No cached domain -> add this domain to cache and write full domain name
-                                        : ((_buildDomainForHost(p_pcHostname, hostDomain)) &&                                      // eg. esp8266.local
-                               ((!p_bPrependRDLength) || (_write16(hostDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
-                               (p_rSendParameter.addDomainCacheItem((const void*)p_pcHostname, false, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(hostDomain, p_rSendParameter))));
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSHostDomain: FAILED!\n"));
-                     });
+        bool             bResult
+            = (u16CachedDomainOffset
+                   // Found cached domain -> mark as compressed domain
+                   ?
+                   ((MDNS_DOMAIN_COMPRESS_MARK
+                     > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK))
+                    &&  // Valid offset
+                    ((!p_bPrependRDLength) || (_write16(2, p_rSendParameter)))
+                    &&  // Length of 'Cxxx'
+                    (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK),
+                             p_rSendParameter))
+                    &&  // Compression mark (and offset)
+                    (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
+                   // No cached domain -> add this domain to cache and write full domain name
+                   :
+                   ((_buildDomainForHost(p_pcHostname, hostDomain)) &&  // eg. esp8266.local
+                    ((!p_bPrependRDLength)
+                     || (_write16(hostDomain.m_u16NameLength, p_rSendParameter)))
+                    &&  // RDLength (if needed)
+                    (p_rSendParameter.addDomainCacheItem((const void*)p_pcHostname, false,
+                                                         p_rSendParameter.m_u16Offset))
+                    && (_writeMDNSRRDomain(hostDomain, p_rSendParameter))));
+
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSHostDomain: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_writeMDNSServiceDomain
+        MDNSResponder::_writeMDNSServiceDomain
 
-    Write a service domain to the UDP output buffer.
-    If the domain record is part of the answer, the records length is
-    prepended (p_bPrependRDLength is set).
+        Write a service domain to the UDP output buffer.
+        If the domain record is part of the answer, the records length is
+        prepended (p_bPrependRDLength is set).
 
-    A very simple form of name compression is applied here: see '_writeMDNSHostDomain'
-    The cache differentiates of course between service domains which includes
-    the instance name (p_bIncludeName is set) and thoose who don't.
+        A very simple form of name compression is applied here: see '_writeMDNSHostDomain'
+        The cache differentiates of course between service domains which includes
+        the instance name (p_bIncludeName is set) and thoose who don't.
 
-*/
-    bool MDNSResponder::_writeMDNSServiceDomain(const MDNSResponder::stcMDNSService& p_Service,
-                                                bool                                 p_bIncludeName,
-                                                bool                                 p_bPrependRDLength,
-                                                MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+    */
+    bool
+    MDNSResponder::_writeMDNSServiceDomain(const MDNSResponder::stcMDNSService& p_Service,
+                                           bool p_bIncludeName, bool p_bPrependRDLength,
+                                           MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV'
-        uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName);
+        uint16_t u16CachedDomainOffset
+            = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName);
 
         stcMDNS_RRDomain serviceDomain;
-        bool             bResult = (u16CachedDomainOffset
-                            // Found cached domain -> mark as compressed domain
-                                        ? ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&  // Valid offset
-                               ((!p_bPrependRDLength) || (_write16(2, p_rSendParameter))) &&                                 // Length of 'Cxxx'
-                               (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&    // Compression mark (and offset)
-                               (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
-                            // No cached domain -> add this domain to cache and write full domain name
-                                        : ((_buildDomainForService(p_Service, p_bIncludeName, serviceDomain)) &&                      // eg. MyESP._http._tcp.local
-                               ((!p_bPrependRDLength) || (_write16(serviceDomain.m_u16NameLength, p_rSendParameter))) &&  // RDLength (if needed)
-                               (p_rSendParameter.addDomainCacheItem((const void*)&p_Service, p_bIncludeName, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(serviceDomain, p_rSendParameter))));
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSServiceDomain: FAILED!\n"));
-                     });
+        bool             bResult
+            = (u16CachedDomainOffset
+                   // Found cached domain -> mark as compressed domain
+                   ?
+                   ((MDNS_DOMAIN_COMPRESS_MARK
+                     > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK))
+                    &&  // Valid offset
+                    ((!p_bPrependRDLength) || (_write16(2, p_rSendParameter)))
+                    &&  // Length of 'Cxxx'
+                    (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK),
+                             p_rSendParameter))
+                    &&  // Compression mark (and offset)
+                    (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter)))
+                   // No cached domain -> add this domain to cache and write full domain name
+                   :
+                   ((_buildDomainForService(p_Service, p_bIncludeName, serviceDomain))
+                    &&  // eg. MyESP._http._tcp.local
+                    ((!p_bPrependRDLength)
+                     || (_write16(serviceDomain.m_u16NameLength, p_rSendParameter)))
+                    &&  // RDLength (if needed)
+                    (p_rSendParameter.addDomainCacheItem((const void*)&p_Service, p_bIncludeName,
+                                                         p_rSendParameter.m_u16Offset))
+                    && (_writeMDNSRRDomain(serviceDomain, p_rSendParameter))));
+
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSServiceDomain: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_writeMDNSQuestion
+        MDNSResponder::_writeMDNSQuestion
 
-    Write a MDNS question to the UDP output buffer
+        Write a MDNS question to the UDP output buffer
 
-    QNAME  (host/service domain, eg. esp8266.local)
-    QTYPE  (16bit, eg. ANY)
-    QCLASS (16bit, eg. IN)
+        QNAME  (host/service domain, eg. esp8266.local)
+        QTYPE  (16bit, eg. ANY)
+        QCLASS (16bit, eg. IN)
 
-*/
+    */
     bool MDNSResponder::_writeMDNSQuestion(MDNSResponder::stcMDNS_RRQuestion&   p_Question,
                                            MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion\n")););
 
-        bool bResult = ((_writeMDNSRRDomain(p_Question.m_Header.m_Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(p_Question.m_Header.m_Attributes, p_rSendParameter)));
+        bool bResult
+            = ((_writeMDNSRRDomain(p_Question.m_Header.m_Domain, p_rSendParameter))
+               && (_writeMDNSRRAttributes(p_Question.m_Header.m_Attributes, p_rSendParameter)));
 
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSQuestion: FAILED!\n"));
+        });
         return bResult;
     }
 
 #ifdef MDNS_IP4_SUPPORT
     /*
-    MDNSResponder::_writeMDNSAnswer_A
+        MDNSResponder::_writeMDNSAnswer_A
 
-    Write a MDNS A answer to the UDP output buffer.
+        Write a MDNS A answer to the UDP output buffer.
 
-    NAME     (var, host/service domain, eg. esp8266.local
-    TYPE     (16bit, eg. A)
-    CLASS    (16bit, eg. IN)
-    TTL      (32bit, eg. 120)
-    RDLENGTH (16bit, eg 4)
-    RDATA    (var, eg. 123.456.789.012)
+        NAME     (var, host/service domain, eg. esp8266.local
+        TYPE     (16bit, eg. A)
+        CLASS    (16bit, eg. IN)
+        TTL      (32bit, eg. 120)
+        RDLENGTH (16bit, eg 4)
+        RDATA    (var, eg. 123.456.789.012)
 
-    eg. esp8266.local A 0x8001 120 4 123.456.789.012
-    Ref: http://www.zytrax.com/books/dns/ch8/a.html
-*/
+        eg. esp8266.local A 0x8001 120 4 123.456.789.012
+        Ref: http://www.zytrax.com/books/dns/ch8/a.html
+    */
     bool MDNSResponder::_writeMDNSAnswer_A(IPAddress                            p_IPAddress,
                                            MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A (%s)\n"), p_IPAddress.toString().c_str()););
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A (%s)\n"),
+                                            p_IPAddress.toString().c_str()););
 
         stcMDNS_RRAttributes attributes(DNS_RRTYPE_A,
-                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
-        const unsigned char  aucIPAddress[MDNS_IP4_SIZE] = { p_IPAddress[0], p_IPAddress[1], p_IPAddress[2], p_IPAddress[3] };
-        bool                 bResult                     = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
-                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                       // TTL
-                        (_write16(MDNS_IP4_SIZE, p_rSendParameter)) &&                                                                              // RDLength
-                        (_udpAppendBuffer(aucIPAddress, MDNS_IP4_SIZE)) &&                                                                          // RData
-                        (p_rSendParameter.shiftOffset(MDNS_IP4_SIZE)));
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A: FAILED!\n"));
-                     });
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0)
+                                         | DNS_RRCLASS_IN));  // Cache flush? & INternet
+        const unsigned char  aucIPAddress[MDNS_IP4_SIZE]
+            = { p_IPAddress[0], p_IPAddress[1], p_IPAddress[2], p_IPAddress[3] };
+        bool bResult
+            = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter))
+               && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+               (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter))
+               &&                                                  // TTL
+               (_write16(MDNS_IP4_SIZE, p_rSendParameter)) &&      // RDLength
+               (_udpAppendBuffer(aucIPAddress, MDNS_IP4_SIZE)) &&  // RData
+               (p_rSendParameter.shiftOffset(MDNS_IP4_SIZE)));
+
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_A: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_writeMDNSAnswer_PTR_IP4
+        MDNSResponder::_writeMDNSAnswer_PTR_IP4
 
-    Write a MDNS reverse IP4 PTR answer to the UDP output buffer.
-    See: '_writeMDNSAnswer_A'
+        Write a MDNS reverse IP4 PTR answer to the UDP output buffer.
+        See: '_writeMDNSAnswer_A'
 
-    eg. 012.789.456.123.in-addr.arpa PTR 0x8001 120 15 esp8266.local
-    Used while answering reverse IP4 questions
-*/
-    bool MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress                            p_IPAddress,
-                                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+        eg. 012.789.456.123.in-addr.arpa PTR 0x8001 120 15 esp8266.local
+        Used while answering reverse IP4 questions
+    */
+    bool
+    MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress                            p_IPAddress,
+                                            MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
-        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4 (%s)\n"), p_IPAddress.toString().c_str()););
+        DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4 (%s)\n"),
+                                            p_IPAddress.toString().c_str()););
 
         stcMDNS_RRDomain     reverseIP4Domain;
         stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
-                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0)
+                                         | DNS_RRCLASS_IN));  // Cache flush? & INternet
         stcMDNS_RRDomain     hostDomain;
-        bool                 bResult = ((_buildDomainForReverseIP4(p_IPAddress, reverseIP4Domain)) &&                                                          // 012.789.456.123.in-addr.arpa
-                        (_writeMDNSRRDomain(reverseIP4Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
-                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                  // TTL
-                        (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                                                         // RDLength & RData (host domain, eg. esp8266.local)
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4: FAILED!\n"));
-                     });
+        bool                 bResult
+            = ((_buildDomainForReverseIP4(p_IPAddress, reverseIP4Domain))
+               &&  // 012.789.456.123.in-addr.arpa
+               (_writeMDNSRRDomain(reverseIP4Domain, p_rSendParameter))
+               && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+               (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter))
+               &&  // TTL
+               (_writeMDNSHostDomain(
+                   m_pcHostname, true,
+                   p_rSendParameter)));  // RDLength & RData (host domain, eg. esp8266.local)
+
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP4: FAILED!\n"));
+        });
         return bResult;
     }
 #endif
 
     /*
-    MDNSResponder::_writeMDNSAnswer_PTR_TYPE
+        MDNSResponder::_writeMDNSAnswer_PTR_TYPE
 
-    Write a MDNS PTR answer to the UDP output buffer.
-    See: '_writeMDNSAnswer_A'
+        Write a MDNS PTR answer to the UDP output buffer.
+        See: '_writeMDNSAnswer_A'
 
-    PTR all-services -> service type
-    eg. _services._dns-sd._udp.local PTR 0x8001 5400 xx _http._tcp.local
-    http://www.zytrax.com/books/dns/ch8/ptr.html
-*/
-    bool MDNSResponder::_writeMDNSAnswer_PTR_TYPE(MDNSResponder::stcMDNSService&       p_rService,
-                                                  MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+        PTR all-services -> service type
+        eg. _services._dns-sd._udp.local PTR 0x8001 5400 xx _http._tcp.local
+        http://www.zytrax.com/books/dns/ch8/ptr.html
+    */
+    bool
+    MDNSResponder::_writeMDNSAnswer_PTR_TYPE(MDNSResponder::stcMDNSService&       p_rService,
+                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE\n")););
 
         stcMDNS_RRDomain     dnssdDomain;
         stcMDNS_RRDomain     serviceDomain;
-        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);                                                                                  // No cache flush! only INternet
-        bool                 bResult = ((_buildDomainForDNSSD(dnssdDomain)) &&                                                                            // _services._dns-sd._udp.local
-                        (_writeMDNSRRDomain(dnssdDomain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
-                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&                          // TTL
-                        (_writeMDNSServiceDomain(p_rService, false, true, p_rSendParameter)));                                            // RDLength & RData (service domain, eg. _http._tcp.local)
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE: FAILED!\n"));
-                     });
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
+                                        DNS_RRCLASS_IN);  // No cache flush! only INternet
+        bool                 bResult
+            = ((_buildDomainForDNSSD(dnssdDomain)) &&  // _services._dns-sd._udp.local
+               (_writeMDNSRRDomain(dnssdDomain, p_rSendParameter))
+               && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+               (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter))
+               &&  // TTL
+               (_writeMDNSServiceDomain(
+                   p_rService, false, true,
+                   p_rSendParameter)));  // RDLength & RData (service domain, eg. _http._tcp.local)
+
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_TYPE: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_writeMDNSAnswer_PTR_NAME
+        MDNSResponder::_writeMDNSAnswer_PTR_NAME
 
-    Write a MDNS PTR answer to the UDP output buffer.
-    See: '_writeMDNSAnswer_A'
+        Write a MDNS PTR answer to the UDP output buffer.
+        See: '_writeMDNSAnswer_A'
 
-    PTR service type -> service name
-    eg. _http.tcp.local PTR 0x8001 120 xx myESP._http._tcp.local
-    http://www.zytrax.com/books/dns/ch8/ptr.html
-*/
-    bool MDNSResponder::_writeMDNSAnswer_PTR_NAME(MDNSResponder::stcMDNSService&       p_rService,
-                                                  MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+        PTR service type -> service name
+        eg. _http.tcp.local PTR 0x8001 120 xx myESP._http._tcp.local
+        http://www.zytrax.com/books/dns/ch8/ptr.html
+    */
+    bool
+    MDNSResponder::_writeMDNSAnswer_PTR_NAME(MDNSResponder::stcMDNSService&       p_rService,
+                                             MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME\n")););
 
-        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN);                                                          // No cache flush! only INternet
-        bool                 bResult = ((_writeMDNSServiceDomain(p_rService, false, false, p_rSendParameter)) &&                  // _http._tcp.local
-                        (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
-                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
-                        (_writeMDNSServiceDomain(p_rService, true, true, p_rSendParameter)));                     // RDLength & RData (service domain, eg. MyESP._http._tcp.local)
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME: FAILED!\n"));
-                     });
+        stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
+                                        DNS_RRCLASS_IN);  // No cache flush! only INternet
+        bool                 bResult
+            = ((_writeMDNSServiceDomain(p_rService, false, false, p_rSendParameter))
+               &&                                                         // _http._tcp.local
+               (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+               (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter))
+               &&  // TTL
+               (_writeMDNSServiceDomain(p_rService, true, true,
+                                        p_rSendParameter)));  // RDLength & RData (service domain,
+                                                              // eg. MyESP._http._tcp.local)
+
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_NAME: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_writeMDNSAnswer_TXT
+        MDNSResponder::_writeMDNSAnswer_TXT
 
-    Write a MDNS TXT answer to the UDP output buffer.
-    See: '_writeMDNSAnswer_A'
+        Write a MDNS TXT answer to the UDP output buffer.
+        See: '_writeMDNSAnswer_A'
 
-    The TXT items in the RDATA block are 'length byte encoded': [len]vardata
+        The TXT items in the RDATA block are 'length byte encoded': [len]vardata
 
-    eg. myESP._http._tcp.local TXT 0x8001 120 4 c#=1
-    http://www.zytrax.com/books/dns/ch8/txt.html
-*/
+        eg. myESP._http._tcp.local TXT 0x8001 120 4 c#=1
+        http://www.zytrax.com/books/dns/ch8/txt.html
+    */
     bool MDNSResponder::_writeMDNSAnswer_TXT(MDNSResponder::stcMDNSService&       p_rService,
                                              MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
@@ -1480,146 +1703,185 @@ namespace MDNSImplementation
         bool bResult = false;
 
         stcMDNS_RRAttributes attributes(DNS_RRTYPE_TXT,
-                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
-
-        if ((_collectServiceTxts(p_rService)) && (_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&  // MyESP._http._tcp.local
-            (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                                     // TYPE & CLASS
-            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&                      // TTL
-            (_write16(p_rService.m_Txts.length(), p_rSendParameter)))                                                     // RDLength
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0)
+                                         | DNS_RRCLASS_IN));  // Cache flush? & INternet
+
+        if ((_collectServiceTxts(p_rService))
+            && (_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter))
+            &&                                                         // MyESP._http._tcp.local
+            (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+            (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter))
+            &&                                                         // TTL
+            (_write16(p_rService.m_Txts.length(), p_rSendParameter)))  // RDLength
         {
             bResult = true;
             // RData    Txts
-            for (stcMDNSServiceTxt* pTxt = p_rService.m_Txts.m_pTxts; ((bResult) && (pTxt)); pTxt = pTxt->m_pNext)
+            for (stcMDNSServiceTxt* pTxt = p_rService.m_Txts.m_pTxts; ((bResult) && (pTxt));
+                 pTxt                    = pTxt->m_pNext)
             {
                 unsigned char ucLengthByte = pTxt->length();
-                bResult                    = ((_udpAppendBuffer((unsigned char*)&ucLengthByte, sizeof(ucLengthByte))) &&                                                                                                  // Length
-                           (p_rSendParameter.shiftOffset(sizeof(ucLengthByte))) && ((size_t)os_strlen(pTxt->m_pcKey) == m_pUDPContext->append(pTxt->m_pcKey, os_strlen(pTxt->m_pcKey))) &&             // Key
-                           (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcKey))) && (1 == m_pUDPContext->append("=", 1)) &&                                                                 // =
-                           (p_rSendParameter.shiftOffset(1)) && ((!pTxt->m_pcValue) || (((size_t)os_strlen(pTxt->m_pcValue) == m_pUDPContext->append(pTxt->m_pcValue, os_strlen(pTxt->m_pcValue))) &&  // Value
-                                                                                        (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcValue))))));
-
-                DEBUG_EX_ERR(if (!bResult)
-                             {
-                                 DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED to write %sTxt %s=%s!\n"), (pTxt->m_bTemp ? "temp. " : ""), (pTxt->m_pcKey ?: "?"), (pTxt->m_pcValue ?: "?"));
-                             });
+                bResult = ((_udpAppendBuffer((unsigned char*)&ucLengthByte, sizeof(ucLengthByte)))
+                           &&  // Length
+                           (p_rSendParameter.shiftOffset(sizeof(ucLengthByte)))
+                           && ((size_t)os_strlen(pTxt->m_pcKey)
+                               == m_pUDPContext->append(pTxt->m_pcKey, os_strlen(pTxt->m_pcKey)))
+                           &&  // Key
+                           (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcKey)))
+                           && (1 == m_pUDPContext->append("=", 1)) &&  // =
+                           (p_rSendParameter.shiftOffset(1))
+                           && ((!pTxt->m_pcValue)
+                               || (((size_t)os_strlen(pTxt->m_pcValue)
+                                    == m_pUDPContext->append(pTxt->m_pcValue,
+                                                             os_strlen(pTxt->m_pcValue)))
+                                   &&  // Value
+                                   (p_rSendParameter.shiftOffset(
+                                       (size_t)os_strlen(pTxt->m_pcValue))))));
+
+                DEBUG_EX_ERR(if (!bResult) {
+                    DEBUG_OUTPUT.printf_P(
+                        PSTR(
+                            "[MDNSResponder] _writeMDNSAnswer_TXT: FAILED to write %sTxt %s=%s!\n"),
+                        (pTxt->m_bTemp ? "temp. " : ""), (pTxt->m_pcKey ?: "?"),
+                        (pTxt->m_pcValue ?: "?"));
+                });
             }
         }
         _releaseTempServiceTxts(p_rService);
 
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED!\n"));
-                     });
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_TXT: FAILED!\n"));
+        });
         return bResult;
     }
 
 #ifdef MDNS_IP6_SUPPORT
     /*
-    MDNSResponder::_writeMDNSAnswer_AAAA
+        MDNSResponder::_writeMDNSAnswer_AAAA
 
-    Write a MDNS AAAA answer to the UDP output buffer.
-    See: '_writeMDNSAnswer_A'
+        Write a MDNS AAAA answer to the UDP output buffer.
+        See: '_writeMDNSAnswer_A'
 
-    eg. esp8266.local AAAA 0x8001 120 16 xxxx::xx
-    http://www.zytrax.com/books/dns/ch8/aaaa.html
-*/
+        eg. esp8266.local AAAA 0x8001 120 16 xxxx::xx
+        http://www.zytrax.com/books/dns/ch8/aaaa.html
+    */
     bool MDNSResponder::_writeMDNSAnswer_AAAA(IPAddress                            p_IPAddress,
                                               MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA\n")););
 
         stcMDNS_RRAttributes attributes(DNS_RRTYPE_AAAA,
-                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));                          // Cache flush? & INternet
-        bool                 bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) &&                            // esp8266.local
-                        (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                   // TYPE & CLASS
-                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&       // TTL
-                        (_write16(MDNS_IP6_SIZE, p_rSendParameter)) &&                                              // RDLength
-                        (false /*TODO: IP6 version of: _udpAppendBuffer((uint32_t)p_IPAddress, MDNS_IP4_SIZE)*/));  // RData
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA: FAILED!\n"));
-                     });
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0)
+                                         | DNS_RRCLASS_IN));  // Cache flush? & INternet
+        bool    bResult = ((_writeMDNSHostDomain(m_pcHostname, false, p_rSendParameter)) && // esp8266.local
+                       (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&            // TYPE & CLASS
+                       (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&    // TTL
+                       (_write16(MDNS_IP6_SIZE, p_rSendParameter)) &&                       // RDLength
+                       (false /*TODO: IP6 version of: _udpAppendBuffer((uint32_t)p_IPAddress, MDNS_IP4_SIZE)*/));   // RData
+
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_AAAA: FAILED!\n"));
+        });
         return bResult;
     }
 
     /*
-    MDNSResponder::_writeMDNSAnswer_PTR_IP6
+        MDNSResponder::_writeMDNSAnswer_PTR_IP6
 
-    Write a MDNS reverse IP6 PTR answer to the UDP output buffer.
-    See: '_writeMDNSAnswer_A'
+        Write a MDNS reverse IP6 PTR answer to the UDP output buffer.
+        See: '_writeMDNSAnswer_A'
 
-    eg. xxxx::xx.in6.arpa PTR 0x8001 120 15 esp8266.local
-    Used while answering reverse IP6 questions
-*/
-    bool MDNSResponder::_writeMDNSAnswer_PTR_IP6(IPAddress                            p_IPAddress,
-                                                 MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
+        eg. xxxx::xx.in6.arpa PTR 0x8001 120 15 esp8266.local
+        Used while answering reverse IP6 questions
+    */
+    bool
+    MDNSResponder::_writeMDNSAnswer_PTR_IP6(IPAddress                            p_IPAddress,
+                                            MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6\n")););
 
         stcMDNS_RRDomain     reverseIP6Domain;
         stcMDNS_RRAttributes attributes(DNS_RRTYPE_PTR,
-                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));                                                     // Cache flush? & INternet
-        bool                 bResult = ((_buildDomainForReverseIP6(p_IPAddress, reverseIP6Domain)) &&                                                          // xxxx::xx.ip6.arpa
-                        (_writeMDNSRRDomain(reverseIP6Domain, p_rSendParameter)) && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
-                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter)) &&                                  // TTL
-                        (_writeMDNSHostDomain(m_pcHostname, true, p_rSendParameter)));                                                         // RDLength & RData (host domain, eg. esp8266.local)
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6: FAILED!\n"));
-                     });
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0)
+                                         | DNS_RRCLASS_IN));  // Cache flush? & INternet
+        bool                 bResult
+            = ((_buildDomainForReverseIP6(p_IPAddress, reverseIP6Domain)) &&  // xxxx::xx.ip6.arpa
+               (_writeMDNSRRDomain(reverseIP6Domain, p_rSendParameter))
+               && (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+               (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_HOST_TTL), p_rSendParameter))
+               &&  // TTL
+               (_writeMDNSHostDomain(
+                   m_pcHostname, true,
+                   p_rSendParameter)));  // RDLength & RData (host domain, eg. esp8266.local)
+
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_PTR_IP6: FAILED!\n"));
+        });
         return bResult;
     }
 #endif
 
     /*
-    MDNSResponder::_writeMDNSAnswer_SRV
+        MDNSResponder::_writeMDNSAnswer_SRV
 
-    eg. MyESP._http.tcp.local SRV 0x8001 120 0 0 60068 esp8266.local
-    http://www.zytrax.com/books/dns/ch8/srv.html ???? Include instance name ????
-*/
+        eg. MyESP._http.tcp.local SRV 0x8001 120 0 0 60068 esp8266.local
+        http://www.zytrax.com/books/dns/ch8/srv.html ???? Include instance name ????
+    */
     bool MDNSResponder::_writeMDNSAnswer_SRV(MDNSResponder::stcMDNSService&       p_rService,
                                              MDNSResponder::stcMDNSSendParameter& p_rSendParameter)
     {
         DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV\n")););
 
-        uint16_t u16CachedDomainOffset = (p_rSendParameter.m_bLegacyQuery
-                                              ? 0
-                                              : p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostname, false));
+        uint16_t u16CachedDomainOffset
+            = (p_rSendParameter.m_bLegacyQuery ?
+                   0 :
+                   p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostname, false));
 
         stcMDNS_RRAttributes attributes(DNS_RRTYPE_SRV,
-                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN));  // Cache flush? & INternet
+                                        ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0)
+                                         | DNS_RRCLASS_IN));  // Cache flush? & INternet
         stcMDNS_RRDomain     hostDomain;
-        bool                 bResult = ((_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter)) &&                   // MyESP._http._tcp.local
-                        (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&                                 // TYPE & CLASS
-                        (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter)) &&  // TTL
-                        (!u16CachedDomainOffset
-                             // No cache for domain name (or no compression allowed)
-                                             ? ((_buildDomainForHost(m_pcHostname, hostDomain)) && (_write16((sizeof(uint16_t /*Prio*/) +  // RDLength
-                                                                                              sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + hostDomain.m_u16NameLength),
-                                                                                             p_rSendParameter))
-                                &&                                                                                                                                                            // Domain length
-                                (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&                                                                                                            // Priority
-                                (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                                                                                              // Weight
-                                (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                                                                                         // Port
-                                (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostname, false, p_rSendParameter.m_u16Offset)) && (_writeMDNSRRDomain(hostDomain, p_rSendParameter)))  // Host, eg. esp8266.local
-                                                                                                                                                                                              // Cache available for domain
-                                             : ((MDNS_DOMAIN_COMPRESS_MARK > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK)) &&                                                                  // Valid offset
-                                (_write16((sizeof(uint16_t /*Prio*/) +                                                                                                                        // RDLength
-                                           sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + 2),
-                                          p_rSendParameter))
-                                &&                                                                                          // Length of 'C0xx'
-                                (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&                                          // Priority
-                                (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&                                            // Weight
-                                (_write16(p_rService.m_u16Port, p_rSendParameter)) &&                                       // Port
-                                (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK), p_rSendParameter)) &&  // Compression mark (and offset)
-                                (_write8((uint8_t)u16CachedDomainOffset, p_rSendParameter)))));                             // Offset
-
-        DEBUG_EX_ERR(if (!bResult)
-                     {
-                         DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV: FAILED!\n"));
-                     });
+        bool                 bResult
+            = ((_writeMDNSServiceDomain(p_rService, true, false, p_rSendParameter))
+               &&                                                         // MyESP._http._tcp.local
+               (_writeMDNSRRAttributes(attributes, p_rSendParameter)) &&  // TYPE & CLASS
+               (_write32((p_rSendParameter.m_bUnannounce ? 0 : MDNS_SERVICE_TTL), p_rSendParameter))
+               &&  // TTL
+               (!u16CachedDomainOffset
+                    // No cache for domain name (or no compression allowed)
+                    ?
+                    ((_buildDomainForHost(m_pcHostname, hostDomain))
+                     && (_write16((sizeof(uint16_t /*Prio*/) +  // RDLength
+                                   sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/)
+                                   + hostDomain.m_u16NameLength),
+                                  p_rSendParameter))
+                     &&                                                     // Domain length
+                     (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&     // Priority
+                     (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&       // Weight
+                     (_write16(p_rService.m_u16Port, p_rSendParameter)) &&  // Port
+                     (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostname, false,
+                                                          p_rSendParameter.m_u16Offset))
+                     && (_writeMDNSRRDomain(hostDomain,
+                                            p_rSendParameter)))  // Host, eg. esp8266.local
+                    // Cache available for domain
+                    :
+                    ((MDNS_DOMAIN_COMPRESS_MARK
+                      > ((u16CachedDomainOffset >> 8) & ~MDNS_DOMAIN_COMPRESS_MARK))
+                     &&                                      // Valid offset
+                     (_write16((sizeof(uint16_t /*Prio*/) +  // RDLength
+                                sizeof(uint16_t /*Weight*/) + sizeof(uint16_t /*Port*/) + 2),
+                               p_rSendParameter))
+                     &&                                                     // Length of 'C0xx'
+                     (_write16(MDNS_SRV_PRIORITY, p_rSendParameter)) &&     // Priority
+                     (_write16(MDNS_SRV_WEIGHT, p_rSendParameter)) &&       // Weight
+                     (_write16(p_rService.m_u16Port, p_rSendParameter)) &&  // Port
+                     (_write8(((u16CachedDomainOffset >> 8) | MDNS_DOMAIN_COMPRESS_MARK),
+                              p_rSendParameter))
+                     &&  // Compression mark (and offset)
+                     (_write8((uint8_t)u16CachedDomainOffset, p_rSendParameter)))));  // Offset
+
+        DEBUG_EX_ERR(if (!bResult) {
+            DEBUG_OUTPUT.printf_P(PSTR("[MDNSResponder] _writeMDNSAnswer_SRV: FAILED!\n"));
+        });
         return bResult;
     }
 
diff --git a/libraries/Hash/examples/sha1/sha1.ino b/libraries/Hash/examples/sha1/sha1.ino
index 945c385e6e..39beac03e2 100644
--- a/libraries/Hash/examples/sha1/sha1.ino
+++ b/libraries/Hash/examples/sha1/sha1.ino
@@ -4,9 +4,7 @@
 #include <Arduino.h>
 #include <Hash.h>
 
-void setup() {
-  Serial.begin(115200);
-}
+void setup() { Serial.begin(115200); }
 
 void loop() {
   // usage as String
diff --git a/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino b/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
index 628c7490ee..b78893103d 100644
--- a/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
+++ b/libraries/LittleFS/examples/LittleFS_Timestamp/LittleFS_Timestamp.ino
@@ -33,9 +33,13 @@ void listDir(const char* dirname) {
     time_t lw = file.getLastWrite();
     file.close();
     struct tm* tmstruct = localtime(&cr);
-    Serial.printf("    CREATION: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
+    Serial.printf("    CREATION: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900,
+                  (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min,
+                  tmstruct->tm_sec);
     tmstruct = localtime(&lw);
-    Serial.printf("  LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
+    Serial.printf("  LAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900,
+                  (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min,
+                  tmstruct->tm_sec);
   }
 }
 
@@ -124,12 +128,15 @@ void setup() {
   Serial.println("IP address: ");
   Serial.println(WiFi.localIP());
   Serial.println("Contacting Time Server");
-  configTime(3600 * timezone, daysavetime * 3600, "time.nist.gov", "0.pool.ntp.org", "1.pool.ntp.org");
+  configTime(3600 * timezone, daysavetime * 3600, "time.nist.gov", "0.pool.ntp.org",
+             "1.pool.ntp.org");
   struct tm tmstruct;
   delay(2000);
   tmstruct.tm_year = 0;
   getLocalTime(&tmstruct, 5000);
-  Serial.printf("\nNow is : %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct.tm_year) + 1900, (tmstruct.tm_mon) + 1, tmstruct.tm_mday, tmstruct.tm_hour, tmstruct.tm_min, tmstruct.tm_sec);
+  Serial.printf("\nNow is : %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct.tm_year) + 1900,
+                (tmstruct.tm_mon) + 1, tmstruct.tm_mday, tmstruct.tm_hour, tmstruct.tm_min,
+                tmstruct.tm_sec);
   Serial.println("");
   Serial.println("Formatting LittleFS filesystem");
   LittleFS.format();
diff --git a/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino b/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
index 47963b177f..0d0425de68 100644
--- a/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
+++ b/libraries/LittleFS/examples/SpeedTest/SpeedTest.ino
@@ -62,7 +62,8 @@ void DoTest(FS* fs) {
   }
   f.close();
   unsigned long stop = millis();
-  Serial.printf("==> Time to write %dKB in 256b chunks = %lu milliseconds\n", TESTSIZEKB, stop - start);
+  Serial.printf("==> Time to write %dKB in 256b chunks = %lu milliseconds\n", TESTSIZEKB,
+                stop - start);
 
   f = fs->open("/testwrite.bin", "r");
   Serial.printf("==> Created file size = %zu\n", f.size());
@@ -78,9 +79,11 @@ void DoTest(FS* fs) {
   }
   f.close();
   stop = millis();
-  Serial.printf("==> Time to read %dKB sequentially in 256b chunks = %lu milliseconds = %s\n", TESTSIZEKB, stop - start, rate(start, stop, TESTSIZEKB * 1024));
+  Serial.printf("==> Time to read %dKB sequentially in 256b chunks = %lu milliseconds = %s\n",
+                TESTSIZEKB, stop - start, rate(start, stop, TESTSIZEKB * 1024));
 
-  Serial.printf("Reading %dKB file MISALIGNED in flash and RAM sequentially in 256b chunks\n", TESTSIZEKB);
+  Serial.printf("Reading %dKB file MISALIGNED in flash and RAM sequentially in 256b chunks\n",
+                TESTSIZEKB);
   start = millis();
   f     = fs->open("/testwrite.bin", "r");
   f.read();
@@ -91,7 +94,9 @@ void DoTest(FS* fs) {
   }
   f.close();
   stop = millis();
-  Serial.printf("==> Time to read %dKB sequentially MISALIGNED in flash and RAM in 256b chunks = %lu milliseconds = %s\n", TESTSIZEKB, stop - start, rate(start, stop, TESTSIZEKB * 1024));
+  Serial.printf("==> Time to read %dKB sequentially MISALIGNED in flash and RAM in 256b chunks = "
+                "%lu milliseconds = %s\n",
+                TESTSIZEKB, stop - start, rate(start, stop, TESTSIZEKB * 1024));
 
   Serial.printf("Reading %dKB file in reverse by 256b chunks\n", TESTSIZEKB);
   start = millis();
@@ -110,7 +115,8 @@ void DoTest(FS* fs) {
   }
   f.close();
   stop = millis();
-  Serial.printf("==> Time to read %dKB in reverse in 256b chunks = %lu milliseconds = %s\n", TESTSIZEKB, stop - start, rate(start, stop, TESTSIZEKB * 1024));
+  Serial.printf("==> Time to read %dKB in reverse in 256b chunks = %lu milliseconds = %s\n",
+                TESTSIZEKB, stop - start, rate(start, stop, TESTSIZEKB * 1024));
 
   Serial.printf("Writing 64K file in 1-byte chunks\n");
   start = millis();
@@ -120,7 +126,8 @@ void DoTest(FS* fs) {
   }
   f.close();
   stop = millis();
-  Serial.printf("==> Time to write 64KB in 1b chunks = %lu milliseconds = %s\n", stop - start, rate(start, stop, 65536));
+  Serial.printf("==> Time to write 64KB in 1b chunks = %lu milliseconds = %s\n", stop - start,
+                rate(start, stop, 65536));
 
   Serial.printf("Reading 64K file in 1-byte chunks\n");
   start = millis();
@@ -131,7 +138,8 @@ void DoTest(FS* fs) {
   }
   f.close();
   stop = millis();
-  Serial.printf("==> Time to read 64KB in 1b chunks = %lu milliseconds = %s\n", stop - start, rate(start, stop, 65536));
+  Serial.printf("==> Time to read 64KB in 1b chunks = %lu milliseconds = %s\n", stop - start,
+                rate(start, stop, 65536));
 
   start         = millis();
   auto dest     = fs->open("/test1bw.bin", "w");
@@ -139,7 +147,8 @@ void DoTest(FS* fs) {
   auto copysize = f.sendAll(dest);
   dest.close();
   stop = millis();
-  Serial.printf("==> Time to copy %d = %zd bytes = %lu milliseconds = %s\n", f.size(), copysize, stop - start, rate(start, stop, f.size()));
+  Serial.printf("==> Time to copy %d = %zd bytes = %lu milliseconds = %s\n", f.size(), copysize,
+                stop - start, rate(start, stop, f.size()));
   f.close();
 }
 
@@ -151,6 +160,4 @@ void setup() {
   Serial.println("done");
 }
 
-void loop() {
-  delay(10000);
-}
+void loop() { delay(10000); }
diff --git a/libraries/Netdump/examples/Netdump/Netdump.ino b/libraries/Netdump/examples/Netdump/Netdump.ino
index 6d7975616f..5317a6768d 100644
--- a/libraries/Netdump/examples/Netdump/Netdump.ino
+++ b/libraries/Netdump/examples/Netdump/Netdump.ino
@@ -20,7 +20,7 @@ const char* password = STAPSK;
 
 Netdump nd;
 
-//FS* filesystem = &SPIFFS;
+// FS* filesystem = &SPIFFS;
 FS* filesystem = &LittleFS;
 
 ESP8266WebServer webServer(80);    // Used for sending commands
@@ -29,29 +29,20 @@ File             tracefile;
 
 std::map<PacketType, int> packetCount;
 
-enum class SerialOption : uint8_t {
-  AllFull,
-  LocalNone,
-  HTTPChar
-};
+enum class SerialOption : uint8_t { AllFull, LocalNone, HTTPChar };
 
 void startSerial(SerialOption option) {
   switch (option) {
-    case SerialOption::AllFull:  //All Packets, show packet summary.
+    case SerialOption::AllFull:  // All Packets, show packet summary.
       nd.printDump(Serial, Packet::PacketDetail::FULL);
       break;
 
     case SerialOption::LocalNone:  // Only local IP traffic, full details
       nd.printDump(Serial, Packet::PacketDetail::NONE,
-                   [](Packet n) {
-                     return (n.hasIP(WiFi.localIP()));
-                   });
+                   [](Packet n) { return (n.hasIP(WiFi.localIP())); });
       break;
     case SerialOption::HTTPChar:  // Only HTTP traffic, show packet content as chars
-      nd.printDump(Serial, Packet::PacketDetail::CHAR,
-                   [](Packet n) {
-                     return (n.isHTTP());
-                   });
+      nd.printDump(Serial, Packet::PacketDetail::CHAR, [](Packet n) { return (n.isHTTP()); });
       break;
     default:
       Serial.printf("No valid SerialOption provided\r\n");
@@ -89,35 +80,33 @@ void setup(void) {
 
   filesystem->begin();
 
-  webServer.on("/list",
-               []() {
-                 Dir    dir = filesystem->openDir("/");
-                 String d   = "<h1>File list</h1>";
-                 while (dir.next()) {
-                   d.concat("<li>" + dir.fileName() + "</li>");
-                 }
-                 webServer.send(200, "text.html", d);
-               });
-
-  webServer.on("/req",
-               []() {
-                 static int rq = 0;
-                 String     a  = "<h1>You are connected, Number of requests = " + String(rq++) + "</h1>";
-                 webServer.send(200, "text/html", a);
-               });
-
-  webServer.on("/reset",
-               []() {
-                 nd.reset();
-                 tracefile.close();
-                 tcpServer.close();
-                 webServer.send(200, "text.html", "<h1>Netdump session reset</h1>");
-               });
+  webServer.on("/list", []() {
+    Dir    dir = filesystem->openDir("/");
+    String d   = "<h1>File list</h1>";
+    while (dir.next()) {
+      d.concat("<li>" + dir.fileName() + "</li>");
+    }
+    webServer.send(200, "text.html", d);
+  });
+
+  webServer.on("/req", []() {
+    static int rq = 0;
+    String     a  = "<h1>You are connected, Number of requests = " + String(rq++) + "</h1>";
+    webServer.send(200, "text/html", a);
+  });
+
+  webServer.on("/reset", []() {
+    nd.reset();
+    tracefile.close();
+    tcpServer.close();
+    webServer.send(200, "text.html", "<h1>Netdump session reset</h1>");
+  });
 
   webServer.serveStatic("/", *filesystem, "/");
   webServer.begin();
 
-  startSerial(SerialOption::AllFull);  // Serial output examples, use enum SerialOption for selection
+  startSerial(
+      SerialOption::AllFull);  // Serial output examples, use enum SerialOption for selection
 
   //  startTcpDump();     // tcpdump option
   //  startTracefile();  // output to SPIFFS or LittleFS
@@ -127,18 +116,18 @@ void setup(void) {
     nd.setCallback(
      [](Packet p)
      {
-  	  Serial.printf("PKT : %s : ",p.sourceIP().toString().c_str());
-  	  for ( auto pp : p.allPacketTypes())
-  		  {
-  		     Serial.printf("%s ",pp.toString().c_str());
-  			 packetCount[pp]++;
-  		  }
-  	  Serial.printf("\r\n CNT ");
-  	  for (auto pc : packetCount)
-  		  {
-  		  	  Serial.printf("%s %d ", pc.first.toString().c_str(),pc.second);
-  		  }
-  	  Serial.printf("\r\n");
+          Serial.printf("PKT : %s : ",p.sourceIP().toString().c_str());
+          for ( auto pp : p.allPacketTypes())
+                  {
+                     Serial.printf("%s ",pp.toString().c_str());
+                         packetCount[pp]++;
+                  }
+          Serial.printf("\r\n CNT ");
+          for (auto pc : packetCount)
+                  {
+                          Serial.printf("%s %d ", pc.first.toString().c_str(),pc.second);
+                  }
+          Serial.printf("\r\n");
      }
     );
   */
diff --git a/libraries/Netdump/src/Netdump.cpp b/libraries/Netdump/src/Netdump.cpp
index 6af00c4f20..07a77598f2 100644
--- a/libraries/Netdump/src/Netdump.cpp
+++ b/libraries/Netdump/src/Netdump.cpp
@@ -43,10 +43,7 @@ Netdump::~Netdump()
     }
 };
 
-void Netdump::setCallback(const Callback nc)
-{
-    netDumpCallback = nc;
-}
+void Netdump::setCallback(const Callback nc) { netDumpCallback = nc; }
 
 void Netdump::setCallback(const Callback nc, const Filter nf)
 {
@@ -54,30 +51,20 @@ void Netdump::setCallback(const Callback nc, const Filter nf)
     netDumpCallback = nc;
 }
 
-void Netdump::setFilter(const Filter nf)
-{
-    netDumpFilter = nf;
-}
+void Netdump::setFilter(const Filter nf) { netDumpFilter = nf; }
 
-void Netdump::reset()
-{
-    setCallback(nullptr, nullptr);
-}
+void Netdump::reset() { setCallback(nullptr, nullptr); }
 
 void Netdump::printDump(Print& out, Packet::PacketDetail ndd, const Filter nf)
 {
     out.printf_P(PSTR("netDump starting\r\n"));
-    setCallback([&out, ndd, this](const Packet& ndp)
-                { printDumpProcess(out, ndd, ndp); },
-                nf);
+    setCallback([&out, ndd, this](const Packet& ndp) { printDumpProcess(out, ndd, ndp); }, nf);
 }
 
 void Netdump::fileDump(File& outfile, const Filter nf)
 {
     writePcapHeader(outfile);
-    setCallback([&outfile, this](const Packet& ndp)
-                { fileDumpProcess(outfile, ndp); },
-                nf);
+    setCallback([&outfile, this](const Packet& ndp) { fileDumpProcess(outfile, ndp); }, nf);
 }
 bool Netdump::tcpDump(WiFiServer& tcpDumpServer, const Filter nf)
 {
@@ -92,8 +79,7 @@ bool Netdump::tcpDump(WiFiServer& tcpDumpServer, const Filter nf)
     }
     bufferIndex = 0;
 
-    schedule_function([&tcpDumpServer, this, nf]()
-                      { tcpDumpLoop(tcpDumpServer, nf); });
+    schedule_function([&tcpDumpServer, this, nf]() { tcpDumpLoop(tcpDumpServer, nf); });
     return true;
 }
 
@@ -101,7 +87,8 @@ void Netdump::capture(int netif_idx, const char* data, size_t len, int out, int
 {
     if (lwipCallback.execute(netif_idx, data, len, out, success) == 0)
     {
-        phy_capture = nullptr;  // No active callback/netdump instances, will be set again by new object.
+        phy_capture
+            = nullptr;  // No active callback/netdump instances, will be set again by new object.
     }
 }
 
@@ -191,9 +178,7 @@ void Netdump::tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf)
         bufferIndex = 0;
         writePcapHeader(tcpDumpClient);
 
-        setCallback([this](const Packet& ndp)
-                    { tcpDumpProcess(ndp); },
-                    nf);
+        setCallback([this](const Packet& ndp) { tcpDumpProcess(ndp); }, nf);
     }
     if (!tcpDumpClient || !tcpDumpClient.connected())
     {
@@ -207,8 +192,7 @@ void Netdump::tcpDumpLoop(WiFiServer& tcpDumpServer, const Filter nf)
 
     if (tcpDumpServer.status() != CLOSED)
     {
-        schedule_function([&tcpDumpServer, this, nf]()
-                          { tcpDumpLoop(tcpDumpServer, nf); });
+        schedule_function([&tcpDumpServer, this, nf]() { tcpDumpLoop(tcpDumpServer, nf); });
     }
 }
 
diff --git a/libraries/Netdump/src/Netdump.h b/libraries/Netdump/src/Netdump.h
index 28360864a7..e9f23425f5 100644
--- a/libraries/Netdump/src/Netdump.h
+++ b/libraries/Netdump/src/Netdump.h
@@ -57,7 +57,7 @@ class Netdump
     Callback netDumpCallback = nullptr;
     Filter   netDumpFilter   = nullptr;
 
-    static void                                 capture(int netif_idx, const char* data, size_t len, int out, int success);
+    static void capture(int netif_idx, const char* data, size_t len, int out, int success);
     static CallBackList<LwipCallback>           lwipCallback;
     CallBackList<LwipCallback>::CallBackHandler lwipHandler;
 
diff --git a/libraries/Netdump/src/NetdumpIP.cpp b/libraries/Netdump/src/NetdumpIP.cpp
index 2f2676cbba..f814687515 100644
--- a/libraries/Netdump/src/NetdumpIP.cpp
+++ b/libraries/Netdump/src/NetdumpIP.cpp
@@ -23,11 +23,10 @@
 
 namespace NetCapture
 {
-NetdumpIP::NetdumpIP()
-{
-}
+NetdumpIP::NetdumpIP() { }
 
-NetdumpIP::NetdumpIP(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet)
+NetdumpIP::NetdumpIP(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet,
+                     uint8_t fourth_octet)
 {
     setV4();
     (*this)[0] = first_octet;
@@ -205,7 +204,8 @@ bool NetdumpIP::fromString6(const char* address)
     {
         for (int i = dots - doubledots - 1; i >= 0; i--)
         {
-            reinterpret_cast<uint16_t*>(rawip)[8 - dots + doubledots + i] = reinterpret_cast<uint16_t*>(rawip)[doubledots + i];
+            reinterpret_cast<uint16_t*>(rawip)[8 - dots + doubledots + i]
+                = reinterpret_cast<uint16_t*>(rawip)[doubledots + i];
         }
         for (int i = doubledots; i < 8 - dots + doubledots; i++)
         {
diff --git a/libraries/Netdump/src/NetdumpIP.h b/libraries/Netdump/src/NetdumpIP.h
index 41b1677869..5be98ae701 100644
--- a/libraries/Netdump/src/NetdumpIP.h
+++ b/libraries/Netdump/src/NetdumpIP.h
@@ -25,10 +25,7 @@ class NetdumpIP
     NetdumpIP(const IPAddress& ip);
     NetdumpIP(const String& ip);
 
-    uint8_t& operator[](int index)
-    {
-        return rawip[index];
-    }
+    uint8_t& operator[](int index) { return rawip[index]; }
 
     bool fromString(const char* address);
 
@@ -45,34 +42,13 @@ class NetdumpIP
 
     uint8_t rawip[16] = { 0 };
 
-    void setV4()
-    {
-        ipv = IPversion::IPV4;
-    };
-    void setV6()
-    {
-        ipv = IPversion::IPV6;
-    };
-    void setUnset()
-    {
-        ipv = IPversion::UNSET;
-    };
-    bool isV4() const
-    {
-        return (ipv == IPversion::IPV4);
-    };
-    bool isV6() const
-    {
-        return (ipv == IPversion::IPV6);
-    };
-    bool isUnset() const
-    {
-        return (ipv == IPversion::UNSET);
-    };
-    bool isSet() const
-    {
-        return (ipv != IPversion::UNSET);
-    };
+    void setV4() { ipv = IPversion::IPV4; };
+    void setV6() { ipv = IPversion::IPV6; };
+    void setUnset() { ipv = IPversion::UNSET; };
+    bool isV4() const { return (ipv == IPversion::IPV4); };
+    bool isV6() const { return (ipv == IPversion::IPV6); };
+    bool isUnset() const { return (ipv == IPversion::UNSET); };
+    bool isSet() const { return (ipv != IPversion::UNSET); };
 
     bool compareRaw(IPversion v, const uint8_t* a, const uint8_t* b) const;
     bool compareIP(const IPAddress& ip) const;
@@ -84,22 +60,10 @@ class NetdumpIP
     size_t printTo(Print& p);
 
 public:
-    bool operator==(const IPAddress& addr) const
-    {
-        return compareIP(addr);
-    };
-    bool operator!=(const IPAddress& addr)
-    {
-        return compareIP(addr);
-    };
-    bool operator==(const NetdumpIP& addr)
-    {
-        return compareIP(addr);
-    };
-    bool operator!=(const NetdumpIP& addr)
-    {
-        return !compareIP(addr);
-    };
+    bool operator==(const IPAddress& addr) const { return compareIP(addr); };
+    bool operator!=(const IPAddress& addr) { return compareIP(addr); };
+    bool operator==(const NetdumpIP& addr) { return compareIP(addr); };
+    bool operator!=(const NetdumpIP& addr) { return !compareIP(addr); };
 };
 
 }  // namespace NetCapture
diff --git a/libraries/Netdump/src/NetdumpPacket.cpp b/libraries/Netdump/src/NetdumpPacket.cpp
index e3243cc887..443c36c439 100644
--- a/libraries/Netdump/src/NetdumpPacket.cpp
+++ b/libraries/Netdump/src/NetdumpPacket.cpp
@@ -24,7 +24,8 @@
 
 namespace NetCapture
 {
-void Packet::printDetail(Print& out, const String& indent, const char* data, size_t size, PacketDetail pd) const
+void Packet::printDetail(Print& out, const String& indent, const char* data, size_t size,
+                         PacketDetail pd) const
 {
     if (pd == PacketDetail::NONE)
     {
@@ -138,15 +139,9 @@ void Packet::setPacketTypes()
     }
 }
 
-const PacketType Packet::packetType() const
-{
-    return thisPacketType;
-}
+const PacketType Packet::packetType() const { return thisPacketType; }
 
-const std::vector<PacketType>& Packet::allPacketTypes() const
-{
-    return thisAllPacketTypes;
-}
+const std::vector<PacketType>& Packet::allPacketTypes() const { return thisAllPacketTypes; }
 
 void Packet::MACtoString(int dataIdx, StreamString& sstr) const
 {
@@ -165,7 +160,8 @@ void Packet::ARPtoString(PacketDetail netdumpDetail, StreamString& sstr) const
     switch (getARPType())
     {
     case 1:
-        sstr.printf_P(PSTR("who has %s tell %s"), getIP(ETH_HDR_LEN + 24).toString().c_str(), getIP(ETH_HDR_LEN + 14).toString().c_str());
+        sstr.printf_P(PSTR("who has %s tell %s"), getIP(ETH_HDR_LEN + 24).toString().c_str(),
+                      getIP(ETH_HDR_LEN + 14).toString().c_str());
         break;
     case 2:
         sstr.printf_P(PSTR("%s is at "), getIP(ETH_HDR_LEN + 14).toString().c_str());
@@ -173,7 +169,8 @@ void Packet::ARPtoString(PacketDetail netdumpDetail, StreamString& sstr) const
         break;
     }
     sstr.printf("\r\n");
-    printDetail(sstr, PSTR("           D "), &data[ETH_HDR_LEN], packetLength - ETH_HDR_LEN, netdumpDetail);
+    printDetail(sstr, PSTR("           D "), &data[ETH_HDR_LEN], packetLength - ETH_HDR_LEN,
+                netdumpDetail);
 }
 
 void Packet::DNStoString(PacketDetail netdumpDetail, StreamString& sstr) const
@@ -198,8 +195,10 @@ void Packet::DNStoString(PacketDetail netdumpDetail, StreamString& sstr) const
         sstr.printf_P(PSTR("DR=%d "), t);
     }
     sstr.printf_P(PSTR("\r\n"));
-    printDetail(sstr, PSTR("           H "), &data[ETH_HDR_LEN + getIpHdrLen()], getUdpHdrLen(), netdumpDetail);
-    printDetail(sstr, PSTR("           D "), &data[ETH_HDR_LEN + getIpHdrLen() + getUdpHdrLen()], getUdpLen(), netdumpDetail);
+    printDetail(sstr, PSTR("           H "), &data[ETH_HDR_LEN + getIpHdrLen()], getUdpHdrLen(),
+                netdumpDetail);
+    printDetail(sstr, PSTR("           D "), &data[ETH_HDR_LEN + getIpHdrLen() + getUdpHdrLen()],
+                getUdpLen(), netdumpDetail);
 }
 
 void Packet::UDPtoString(PacketDetail netdumpDetail, StreamString& sstr) const
@@ -207,8 +206,10 @@ void Packet::UDPtoString(PacketDetail netdumpDetail, StreamString& sstr) const
     sstr.printf_P(PSTR("%s>%s "), sourceIP().toString().c_str(), destIP().toString().c_str());
     sstr.printf_P(PSTR("%d:%d"), getSrcPort(), getDstPort());
     sstr.printf_P(PSTR("\r\n"));
-    printDetail(sstr, PSTR("           H "), &data[ETH_HDR_LEN + getIpHdrLen()], getUdpHdrLen(), netdumpDetail);
-    printDetail(sstr, PSTR("           D "), &data[ETH_HDR_LEN + getIpHdrLen() + getUdpHdrLen()], getUdpLen(), netdumpDetail);
+    printDetail(sstr, PSTR("           H "), &data[ETH_HDR_LEN + getIpHdrLen()], getUdpHdrLen(),
+                netdumpDetail);
+    printDetail(sstr, PSTR("           D "), &data[ETH_HDR_LEN + getIpHdrLen() + getUdpHdrLen()],
+                getUdpLen(), netdumpDetail);
 }
 
 void Packet::TCPtoString(PacketDetail netdumpDetail, StreamString& sstr) const
@@ -224,10 +225,13 @@ void Packet::TCPtoString(PacketDetail netdumpDetail, StreamString& sstr) const
             sstr.print(chars[i]);
         }
     sstr.print(']');
-    sstr.printf_P(PSTR(" len: %u seq: %u, ack: %u, wnd: %u "), getTcpLen(), getTcpSeq(), getTcpAck(), getTcpWindow());
+    sstr.printf_P(PSTR(" len: %u seq: %u, ack: %u, wnd: %u "), getTcpLen(), getTcpSeq(),
+                  getTcpAck(), getTcpWindow());
     sstr.printf_P(PSTR("\r\n"));
-    printDetail(sstr, PSTR("           H "), &data[ETH_HDR_LEN + getIpHdrLen()], getTcpHdrLen(), netdumpDetail);
-    printDetail(sstr, PSTR("           D "), &data[ETH_HDR_LEN + getIpHdrLen() + getTcpHdrLen()], getTcpLen(), netdumpDetail);
+    printDetail(sstr, PSTR("           H "), &data[ETH_HDR_LEN + getIpHdrLen()], getTcpHdrLen(),
+                netdumpDetail);
+    printDetail(sstr, PSTR("           D "), &data[ETH_HDR_LEN + getIpHdrLen() + getTcpHdrLen()],
+                getTcpLen(), netdumpDetail);
 }
 
 void Packet::ICMPtoString(PacketDetail, StreamString& sstr) const
@@ -321,7 +325,8 @@ void Packet::IPtoString(PacketDetail netdumpDetail, StreamString& sstr) const
     sstr.printf_P(PSTR("%s>%s "), sourceIP().toString().c_str(), destIP().toString().c_str());
     sstr.printf_P(PSTR("Unknown IP type : %d\r\n"), ipType());
     printDetail(sstr, PSTR("           H "), &data[ETH_HDR_LEN], getIpHdrLen(), netdumpDetail);
-    printDetail(sstr, PSTR("           D "), &data[ETH_HDR_LEN + getIpHdrLen()], getIpTotalLen() - getIpHdrLen(), netdumpDetail);
+    printDetail(sstr, PSTR("           D "), &data[ETH_HDR_LEN + getIpHdrLen()],
+                getIpTotalLen() - getIpHdrLen(), netdumpDetail);
 }
 
 void Packet::UKNWtoString(PacketDetail, StreamString& sstr) const
@@ -333,17 +338,15 @@ void Packet::UKNWtoString(PacketDetail, StreamString& sstr) const
     sstr.printf_P(PSTR("\r\n"));
 }
 
-const String Packet::toString() const
-{
-    return toString(PacketDetail::NONE);
-}
+const String Packet::toString() const { return toString(PacketDetail::NONE); }
 
 const String Packet::toString(PacketDetail netdumpDetail) const
 {
     StreamString sstr;
     sstr.reserve(128);
 
-    sstr.printf_P(PSTR("%d %3s %-4s "), netif_idx, out ? "out" : "in ", packetType().toString().c_str());
+    sstr.printf_P(PSTR("%d %3s %-4s "), netif_idx, out ? "out" : "in ",
+                  packetType().toString().c_str());
 
     if (netdumpDetail == PacketDetail::RAW)
     {
diff --git a/libraries/Netdump/src/NetdumpPacket.h b/libraries/Netdump/src/NetdumpPacket.h
index 1c11f4ee84..1b0ad1eb22 100644
--- a/libraries/Netdump/src/NetdumpPacket.h
+++ b/libraries/Netdump/src/NetdumpPacket.h
@@ -50,185 +50,78 @@ class Packet
         RAW
     };
 
-    const char* rawData() const
-    {
-        return data;
-    }
-    int getInOut() const
-    {
-        return out;
-    }
-    time_t getTime() const
-    {
-        return packetTime;
-    }
-    uint32_t getPacketSize() const
-    {
-        return packetLength;
-    }
-    uint16_t ntoh16(uint16_t idx) const
-    {
-        return data[idx + 1] | (((uint16_t)data[idx]) << 8);
-    };
-    uint32_t ntoh32(uint16_t idx) const
+    const char* rawData() const { return data; }
+    int         getInOut() const { return out; }
+    time_t      getTime() const { return packetTime; }
+    uint32_t    getPacketSize() const { return packetLength; }
+    uint16_t    ntoh16(uint16_t idx) const { return data[idx + 1] | (((uint16_t)data[idx]) << 8); };
+    uint32_t    ntoh32(uint16_t idx) const
     {
         return ntoh16(idx + 2) | (((uint32_t)ntoh16(idx)) << 16);
     };
-    uint8_t byteData(uint16_t idx) const
-    {
-        return data[idx];
-    }
-    const char* byteIdx(uint16_t idx) const
-    {
-        return &data[idx];
-    };
-    uint16_t ethType() const
-    {
-        return ntoh16(12);
-    };
-    uint8_t ipType() const
+    uint8_t     byteData(uint16_t idx) const { return data[idx]; }
+    const char* byteIdx(uint16_t idx) const { return &data[idx]; };
+    uint16_t    ethType() const { return ntoh16(12); };
+    uint8_t     ipType() const
     {
         return isIP() ? isIPv4() ? data[ETH_HDR_LEN + 9] : data[ETH_HDR_LEN + 6] : 0;
     };
     uint16_t getIpHdrLen() const
     {
-        return isIPv4() ? (((unsigned char)data[ETH_HDR_LEN]) & 0x0f) << 2 : 40;  // IPv6 is fixed length
+        return isIPv4() ? (((unsigned char)data[ETH_HDR_LEN]) & 0x0f) << 2 :
+                          40;  // IPv6 is fixed length
     }
     uint16_t getIpTotalLen() const
     {
         return isIP() ? isIPv4() ? ntoh16(ETH_HDR_LEN + 2) : (packetLength - ETH_HDR_LEN) : 0;
     }
-    uint32_t getTcpSeq() const
-    {
-        return isTCP() ? ntoh32(ETH_HDR_LEN + getIpHdrLen() + 4) : 0;
-    }
-    uint32_t getTcpAck() const
-    {
-        return isTCP() ? ntoh32(ETH_HDR_LEN + getIpHdrLen() + 8) : 0;
-    }
-    uint16_t getTcpFlags() const
-    {
-        return isTCP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 12) : 0;
-    }
-    uint16_t getTcpWindow() const
-    {
-        return isTCP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 14) : 0;
-    }
-    uint8_t getTcpHdrLen() const
+    uint32_t getTcpSeq() const { return isTCP() ? ntoh32(ETH_HDR_LEN + getIpHdrLen() + 4) : 0; }
+    uint32_t getTcpAck() const { return isTCP() ? ntoh32(ETH_HDR_LEN + getIpHdrLen() + 8) : 0; }
+    uint16_t getTcpFlags() const { return isTCP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 12) : 0; }
+    uint16_t getTcpWindow() const { return isTCP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 14) : 0; }
+    uint8_t  getTcpHdrLen() const
     {
         return isTCP() ? (data[ETH_HDR_LEN + getIpHdrLen() + 12] >> 4) * 4 : 0;
-    };  //Header len is in multiple of 4 bytes
+    };  // Header len is in multiple of 4 bytes
     uint16_t getTcpLen() const
     {
         return isTCP() ? getIpTotalLen() - getIpHdrLen() - getTcpHdrLen() : 0;
     };
 
-    uint8_t getIcmpType() const
-    {
-        return isICMP() ? data[ETH_HDR_LEN + getIpHdrLen() + 0] : 0;
-    }
-    uint8_t getIgmpType() const
-    {
-        return isIGMP() ? data[ETH_HDR_LEN + getIpHdrLen() + 0] : 0;
-    }
-    uint8_t getARPType() const
-    {
-        return isARP() ? data[ETH_HDR_LEN + 7] : 0;
-    }
-    bool is_ARP_who() const
-    {
-        return (getARPType() == 1);
-    }
-    bool is_ARP_is() const
-    {
-        return (getARPType() == 2);
-    }
-
-    uint8_t getUdpHdrLen() const
-    {
-        return isUDP() ? 8 : 0;
-    };
-    uint16_t getUdpLen() const
-    {
-        return isUDP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 4) : 0;
-    };
-    bool isARP() const
-    {
-        return (ethType() == 0x0806);
-    };
-    bool isIPv4() const
-    {
-        return (ethType() == 0x0800);
-    };
-    bool isIPv6() const
-    {
-        return (ethType() == 0x86dd);
-    };
-    bool isIP() const
-    {
-        return (isIPv4() || isIPv6());
-    };
-    bool isICMP() const
-    {
-        return (isIP() && ((ipType() == 1) || (ipType() == 58)));
-    };
-    bool isIGMP() const
-    {
-        return (isIP() && (ipType() == 2));
-    };
-    bool isTCP() const
-    {
-        return (isIP() && (ipType() == 6));
-    };
-    bool isUDP() const
-    {
-        return (isIP() && ipType() == 17);
-    };
-    bool isMDNS() const
-    {
-        return (isUDP() && hasPort(5353));
-    };
-    bool isDNS() const
-    {
-        return (isUDP() && hasPort(53));
-    };
-    bool isSSDP() const
-    {
-        return (isUDP() && hasPort(1900));
-    };
-    bool isDHCP() const
+    uint8_t getIcmpType() const { return isICMP() ? data[ETH_HDR_LEN + getIpHdrLen() + 0] : 0; }
+    uint8_t getIgmpType() const { return isIGMP() ? data[ETH_HDR_LEN + getIpHdrLen() + 0] : 0; }
+    uint8_t getARPType() const { return isARP() ? data[ETH_HDR_LEN + 7] : 0; }
+    bool    is_ARP_who() const { return (getARPType() == 1); }
+    bool    is_ARP_is() const { return (getARPType() == 2); }
+
+    uint8_t  getUdpHdrLen() const { return isUDP() ? 8 : 0; };
+    uint16_t getUdpLen() const { return isUDP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 4) : 0; };
+    bool     isARP() const { return (ethType() == 0x0806); };
+    bool     isIPv4() const { return (ethType() == 0x0800); };
+    bool     isIPv6() const { return (ethType() == 0x86dd); };
+    bool     isIP() const { return (isIPv4() || isIPv6()); };
+    bool     isICMP() const { return (isIP() && ((ipType() == 1) || (ipType() == 58))); };
+    bool     isIGMP() const { return (isIP() && (ipType() == 2)); };
+    bool     isTCP() const { return (isIP() && (ipType() == 6)); };
+    bool     isUDP() const { return (isIP() && ipType() == 17); };
+    bool     isMDNS() const { return (isUDP() && hasPort(5353)); };
+    bool     isDNS() const { return (isUDP() && hasPort(53)); };
+    bool     isSSDP() const { return (isUDP() && hasPort(1900)); };
+    bool     isDHCP() const
     {
         return (isUDP() && ((hasPort(546) || hasPort(547) || hasPort(67) || hasPort(68))));
     };
-    bool isWSDD() const
-    {
-        return (isUDP() && hasPort(3702));
-    };
-    bool isHTTP() const
-    {
-        return (isTCP() && hasPort(80));
-    };
-    bool isOTA() const
-    {
-        return (isUDP() && hasPort(8266));
-    }
-    bool isNETBIOS() const
-    {
-        return (isUDP() && (hasPort(137) || hasPort(138) || hasPort(139)));
-    }
-    bool isSMB() const
-    {
-        return (isUDP() && hasPort(445));
-    }
+    bool isWSDD() const { return (isUDP() && hasPort(3702)); };
+    bool isHTTP() const { return (isTCP() && hasPort(80)); };
+    bool isOTA() const { return (isUDP() && hasPort(8266)); }
+    bool isNETBIOS() const { return (isUDP() && (hasPort(137) || hasPort(138) || hasPort(139))); }
+    bool isSMB() const { return (isUDP() && hasPort(445)); }
     NetdumpIP getIP(uint16_t idx) const
     {
         return NetdumpIP(data[idx], data[idx + 1], data[idx + 2], data[idx + 3]);
     };
 
-    NetdumpIP getIP6(uint16_t idx) const
-    {
-        return NetdumpIP((const uint8_t*)&data[idx], false);
-    };
+    NetdumpIP getIP6(uint16_t idx) const { return NetdumpIP((const uint8_t*)&data[idx], false); };
     NetdumpIP sourceIP() const
     {
         NetdumpIP ip;
@@ -243,10 +136,7 @@ class Packet
         return ip;
     };
 
-    bool hasIP(NetdumpIP ip) const
-    {
-        return (isIP() && ((ip == sourceIP()) || (ip == destIP())));
-    }
+    bool hasIP(NetdumpIP ip) const { return (isIP() && ((ip == sourceIP()) || (ip == destIP()))); }
 
     NetdumpIP destIP() const
     {
@@ -261,22 +151,17 @@ class Packet
         }
         return ip;
     };
-    uint16_t getSrcPort() const
-    {
-        return isIP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 0) : 0;
-    }
-    uint16_t getDstPort() const
-    {
-        return isIP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 2) : 0;
-    }
-    bool hasPort(uint16_t p) const
+    uint16_t getSrcPort() const { return isIP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 0) : 0; }
+    uint16_t getDstPort() const { return isIP() ? ntoh16(ETH_HDR_LEN + getIpHdrLen() + 2) : 0; }
+    bool     hasPort(uint16_t p) const
     {
         return (isIP() && ((getSrcPort() == p) || (getDstPort() == p)));
     }
 
     const String toString() const;
     const String toString(PacketDetail netdumpDetail) const;
-    void         printDetail(Print& out, const String& indent, const char* data, size_t size, PacketDetail pd) const;
+    void         printDetail(Print& out, const String& indent, const char* data, size_t size,
+                             PacketDetail pd) const;
 
     const PacketType               packetType() const;
     const std::vector<PacketType>& allPacketTypes() const;
diff --git a/libraries/Netdump/src/PacketType.cpp b/libraries/Netdump/src/PacketType.cpp
index b2d6f84e75..1eb458376b 100644
--- a/libraries/Netdump/src/PacketType.cpp
+++ b/libraries/Netdump/src/PacketType.cpp
@@ -9,9 +9,7 @@
 
 namespace NetCapture
 {
-PacketType::PacketType()
-{
-}
+PacketType::PacketType() { }
 
 String PacketType::toString() const
 {
diff --git a/libraries/Netdump/src/PacketType.h b/libraries/Netdump/src/PacketType.h
index 28d96ae7bc..cff6a84813 100644
--- a/libraries/Netdump/src/PacketType.h
+++ b/libraries/Netdump/src/PacketType.h
@@ -37,17 +37,10 @@ class PacketType
     };
 
     PacketType();
-    PacketType(PType pt) :
-        ptype(pt) {};
+    PacketType(PType pt) : ptype(pt) {};
 
-    operator PType() const
-    {
-        return ptype;
-    };
-    bool operator==(const PacketType& p)
-    {
-        return ptype == p.ptype;
-    };
+         operator PType() const { return ptype; };
+    bool operator==(const PacketType& p) { return ptype == p.ptype; };
 
     String toString() const;
 
diff --git a/libraries/SD/examples/DumpFile/DumpFile.ino b/libraries/SD/examples/DumpFile/DumpFile.ino
index 038cfc1c01..865d0bf5f7 100644
--- a/libraries/SD/examples/DumpFile/DumpFile.ino
+++ b/libraries/SD/examples/DumpFile/DumpFile.ino
@@ -56,5 +56,4 @@ void setup() {
   }
 }
 
-void loop() {
-}
+void loop() { }
diff --git a/libraries/SD/examples/listfiles/listfiles.ino b/libraries/SD/examples/listfiles/listfiles.ino
index 9ce85c26ae..06d31c0926 100644
--- a/libraries/SD/examples/listfiles/listfiles.ino
+++ b/libraries/SD/examples/listfiles/listfiles.ino
@@ -70,9 +70,13 @@ void printDirectory(File dir, int numTabs) {
       time_t     cr       = entry.getCreationTime();
       time_t     lw       = entry.getLastWrite();
       struct tm* tmstruct = localtime(&cr);
-      Serial.printf("\tCREATION: %d-%02d-%02d %02d:%02d:%02d", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
+      Serial.printf("\tCREATION: %d-%02d-%02d %02d:%02d:%02d", (tmstruct->tm_year) + 1900,
+                    (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min,
+                    tmstruct->tm_sec);
       tmstruct = localtime(&lw);
-      Serial.printf("\tLAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900, (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min, tmstruct->tm_sec);
+      Serial.printf("\tLAST WRITE: %d-%02d-%02d %02d:%02d:%02d\n", (tmstruct->tm_year) + 1900,
+                    (tmstruct->tm_mon) + 1, tmstruct->tm_mday, tmstruct->tm_hour, tmstruct->tm_min,
+                    tmstruct->tm_sec);
     }
     entry.close();
   }
diff --git a/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino b/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
index 93ea348cc6..7b4515d6e1 100644
--- a/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
+++ b/libraries/SPISlave/examples/SPISlave_Master/SPISlave_Master.ino
@@ -9,9 +9,9 @@
      12       D6      MISO  |   D12
      14       D5      SCK   |   D13
 
-    Note: If the ESP is booting at a moment when the SPI Master has the Select line HIGH (deselected)
-    the ESP8266 WILL FAIL to boot!
-    See SPISlave_SafeMaster example for possible workaround
+    Note: If the ESP is booting at a moment when the SPI Master has the Select line HIGH
+   (deselected) the ESP8266 WILL FAIL to boot! See SPISlave_SafeMaster example for possible
+   workaround
 
 */
 #include <SPI.h>
@@ -21,8 +21,7 @@ class ESPMaster {
   uint8_t _ss_pin;
 
   public:
-  ESPMaster(uint8_t pin) :
-      _ss_pin(pin) { }
+  ESPMaster(uint8_t pin) : _ss_pin(pin) { }
   void begin() {
     pinMode(_ss_pin, OUTPUT);
     digitalWrite(_ss_pin, HIGH);
@@ -31,7 +30,8 @@ class ESPMaster {
   uint32_t readStatus() {
     digitalWrite(_ss_pin, LOW);
     SPI.transfer(0x04);
-    uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
+    uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8)
+                       | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
     digitalWrite(_ss_pin, HIGH);
     return status;
   }
@@ -77,9 +77,7 @@ class ESPMaster {
     return String(data);
   }
 
-  void writeData(const char* data) {
-    writeData((uint8_t*)data, strlen(data));
-  }
+  void writeData(const char* data) { writeData((uint8_t*)data, strlen(data)); }
 };
 
 ESPMaster esp(SS);
diff --git a/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino b/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
index 0da735fc74..fbc250a414 100644
--- a/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
+++ b/libraries/SPISlave/examples/SPISlave_SafeMaster/SPISlave_SafeMaster.ino
@@ -9,10 +9,9 @@
      12       D6      MISO  |   D12
      14       D5      SCK   |   D13
 
-    Note: If the ESP is booting at a moment when the SPI Master has the Select line HIGH (deselected)
-    the ESP8266 WILL FAIL to boot!
-    This sketch tries to go around this issue by only pulsing the Slave Select line to reset the command
-    and keeping the line LOW all other time.
+    Note: If the ESP is booting at a moment when the SPI Master has the Select line HIGH
+   (deselected) the ESP8266 WILL FAIL to boot! This sketch tries to go around this issue by only
+   pulsing the Slave Select line to reset the command and keeping the line LOW all other time.
 
 */
 #include <SPI.h>
@@ -27,8 +26,7 @@ class ESPSafeMaster {
   }
 
   public:
-  ESPSafeMaster(uint8_t pin) :
-      _ss_pin(pin) { }
+  ESPSafeMaster(uint8_t pin) : _ss_pin(pin) { }
   void begin() {
     pinMode(_ss_pin, OUTPUT);
     _pulseSS();
@@ -37,7 +35,8 @@ class ESPSafeMaster {
   uint32_t readStatus() {
     _pulseSS();
     SPI.transfer(0x04);
-    uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8) | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
+    uint32_t status = (SPI.transfer(0) | ((uint32_t)(SPI.transfer(0)) << 8)
+                       | ((uint32_t)(SPI.transfer(0)) << 16) | ((uint32_t)(SPI.transfer(0)) << 24));
     _pulseSS();
     return status;
   }
@@ -83,9 +82,7 @@ class ESPSafeMaster {
     return String(data);
   }
 
-  void writeData(const char* data) {
-    writeData((uint8_t*)data, strlen(data));
-  }
+  void writeData(const char* data) { writeData((uint8_t*)data, strlen(data)); }
 };
 
 ESPSafeMaster esp(SS);
diff --git a/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino b/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
index 7ddfc92720..a04c295075 100644
--- a/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
+++ b/libraries/SPISlave/examples/SPISlave_Test/SPISlave_Test.ino
@@ -9,9 +9,9 @@
      12       D6      MISO  |   D12
      14       D5      SCK   |   D13
 
-    Note: If the ESP is booting at a moment when the SPI Master has the Select line HIGH (deselected)
-    the ESP8266 WILL FAIL to boot!
-    See SPISlave_SafeMaster example for possible workaround
+    Note: If the ESP is booting at a moment when the SPI Master has the Select line HIGH
+  (deselected) the ESP8266 WILL FAIL to boot! See SPISlave_SafeMaster example for possible
+  workaround
 
 */
 
@@ -41,22 +41,18 @@ void setup() {
 
   // The master has read out outgoing data buffer
   // that buffer can be set with SPISlave.setData
-  SPISlave.onDataSent([]() {
-    Serial.println("Answer Sent");
-  });
+  SPISlave.onDataSent([]() { Serial.println("Answer Sent"); });
 
   // status has been received from the master.
-  // The status register is a special register that bot the slave and the master can write to and read from.
-  // Can be used to exchange small data or status information
+  // The status register is a special register that bot the slave and the master can write to and
+  // read from. Can be used to exchange small data or status information
   SPISlave.onStatus([](uint32_t data) {
     Serial.printf("Status: %u\n", data);
-    SPISlave.setStatus(millis());  //set next status
+    SPISlave.setStatus(millis());  // set next status
   });
 
   // The master has read the status register
-  SPISlave.onStatusSent([]() {
-    Serial.println("Status Sent");
-  });
+  SPISlave.onStatusSent([]() { Serial.println("Status Sent"); });
 
   // Setup SPI Slave registers and pins
   SPISlave.begin();
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino b/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
index 29d7c48527..0cecffff62 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino
@@ -8,21 +8,20 @@
 #include <SPI.h>
 
 void setup() {
-  TFT_BL_ON;  //turn on the background light
+  TFT_BL_ON;  // turn on the background light
 
-  Tft.TFTinit();  //init TFT library
+  Tft.TFTinit();  // init TFT library
 
-  Tft.drawCircle(100, 100, 30, YELLOW);  //center: (100, 100), r = 30 ,color : YELLOW
+  Tft.drawCircle(100, 100, 30, YELLOW);  // center: (100, 100), r = 30 ,color : YELLOW
 
   Tft.drawCircle(100, 200, 40, CYAN);  // center: (100, 200), r = 10 ,color : CYAN
 
-  Tft.fillCircle(200, 100, 30, RED);  //center: (200, 100), r = 30 ,color : RED
+  Tft.fillCircle(200, 100, 30, RED);  // center: (200, 100), r = 30 ,color : RED
 
-  Tft.fillCircle(200, 200, 30, BLUE);  //center: (200, 200), r = 30 ,color : BLUE
+  Tft.fillCircle(200, 200, 30, BLUE);  // center: (200, 200), r = 30 ,color : BLUE
 }
 
-void loop() {
-}
+void loop() { }
 
 /*********************************************************************************************************
   END FILE
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino b/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
index b2b6d3c293..244862cd43 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino
@@ -9,19 +9,18 @@
 #include <SPI.h>
 void setup() {
   TFT_BL_ON;      // turn on the background light
-  Tft.TFTinit();  //init TFT library
+  Tft.TFTinit();  // init TFT library
 
-  Tft.drawLine(0, 0, 239, 319, RED);  //start: (0, 0) end: (239, 319), color : RED
+  Tft.drawLine(0, 0, 239, 319, RED);  // start: (0, 0) end: (239, 319), color : RED
 
   Tft.drawVerticalLine(60, 100, 100, GREEN);  // Draw a vertical line
   // start: (60, 100) length: 100 color: green
 
-  Tft.drawHorizontalLine(30, 60, 150, BLUE);  //Draw a horizontal line
-  //start: (30, 60), high: 150, color: blue
+  Tft.drawHorizontalLine(30, 60, 150, BLUE);  // Draw a horizontal line
+  // start: (30, 60), high: 150, color: blue
 }
 
-void loop() {
-}
+void loop() { }
 
 /*********************************************************************************************************
   END FILE
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino b/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
index be303b6988..009258dee3 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino
@@ -13,23 +13,31 @@ void setup() {
 
   Tft.TFTinit();  // init TFT library
 
-  Tft.drawNumber(1024, 0, 0, 1, RED);  // draw a integer: 1024, Location: (0, 0),  size: 1, color: RED
+  Tft.drawNumber(1024, 0, 0, 1,
+                 RED);  // draw a integer: 1024, Location: (0, 0),  size: 1, color: RED
 
-  Tft.drawNumber(1024, 0, 20, 2, BLUE);  // draw a integer: 1024, Location: (0, 20), size: 2, color: BLUE
+  Tft.drawNumber(1024, 0, 20, 2,
+                 BLUE);  // draw a integer: 1024, Location: (0, 20), size: 2, color: BLUE
 
-  Tft.drawNumber(1024, 0, 50, 3, GREEN);  // draw a integer: 1024, Location: (0, 50), size: 3, color: GREEN
+  Tft.drawNumber(1024, 0, 50, 3,
+                 GREEN);  // draw a integer: 1024, Location: (0, 50), size: 3, color: GREEN
 
-  Tft.drawNumber(1024, 0, 90, 4, BLUE);  // draw a integer: 1024, Location: (0, 90), size:4, color: BLUE
+  Tft.drawNumber(1024, 0, 90, 4,
+                 BLUE);  // draw a integer: 1024, Location: (0, 90), size:4, color: BLUE
 
-  Tft.drawFloat(1.2345, 0, 150, 4, YELLOW);  // draw a float number: 1.2345, Location: (0, 150), size: 4, color: YELLOW
+  Tft.drawFloat(1.2345, 0, 150, 4,
+                YELLOW);  // draw a float number: 1.2345, Location: (0, 150), size: 4, color: YELLOW
 
-  Tft.drawFloat(1.2345, 2, 0, 200, 4, BLUE);  // draw a float number: 1.2345: Location: (0, 200), size: 4, decimal: 2, color: BLUE
+  Tft.drawFloat(
+      1.2345, 2, 0, 200, 4,
+      BLUE);  // draw a float number: 1.2345: Location: (0, 200), size: 4, decimal: 2, color: BLUE
 
-  Tft.drawFloat(1.2345, 4, 0, 250, 4, RED);  // draw a float number: 1.2345 Location: (0, 250), size: 4, decimal: 4, color: RED
+  Tft.drawFloat(
+      1.2345, 4, 0, 250, 4,
+      RED);  // draw a float number: 1.2345 Location: (0, 250), size: 4, decimal: 4, color: RED
 }
 
-void loop() {
-}
+void loop() { }
 
 /*********************************************************************************************************
   END FILE
diff --git a/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino b/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
index fe61bae0af..ba3e227ea9 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino
@@ -16,8 +16,7 @@ void setup() {
   Tft.drawRectangle(100, 170, 120, 60, BLUE);
 }
 
-void loop() {
-}
+void loop() { }
 /*********************************************************************************************************
   END FILE
 *********************************************************************************************************/
\ No newline at end of file
diff --git a/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino b/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
index 41c5ed3306..020e7490d0 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino
@@ -5,19 +5,19 @@
 #include <SPI.h>
 
 int          ColorPaletteHigh = 30;
-int          color            = WHITE;  //Paint brush color
+int          color            = WHITE;  // Paint brush color
 unsigned int colors[8]        = { BLACK, RED, GREEN, BLUE, CYAN, YELLOW, WHITE, GRAY1 };
 
 // For better pressure precision, we need to know the resistance
 // between X+ and X- Use any multimeter to read it
 // The 2.8" TFT Touch shield has 300 ohms across the X plate
 
-TouchScreen ts = TouchScreen(XP, YP, XM, YM);  //init TouchScreen port pins
+TouchScreen ts = TouchScreen(XP, YP, XM, YM);  // init TouchScreen port pins
 
 void setup() {
-  Tft.TFTinit();  //init TFT library
+  Tft.TFTinit();  // init TFT library
   Serial.begin(115200);
-  //Draw the pallet
+  // Draw the pallet
   for (int i = 0; i < 8; i++) {
     Tft.fillRectangle(i * 30, 0, 30, ColorPaletteHigh, colors[i]);
   }
@@ -27,7 +27,7 @@ void loop() {
   // a point object holds x y and z coordinates.
   Point p = ts.getPoint();
 
-  //map the ADC value read to into pixel coordinates
+  // map the ADC value read to into pixel coordinates
 
   p.x = map(p.x, TS_MINX, TS_MAXX, 0, 240);
   p.y = map(p.y, TS_MINY, TS_MAXY, 0, 320);
diff --git a/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino b/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
index 185cd0c97a..5a1e960c9c 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino
@@ -10,8 +10,8 @@ void setup() {
 }
 
 void loop() {
-  for (int r = 0; r < 115; r = r + 2) {           //set r : 0--115
-    Tft.drawCircle(119, 160, r, random(0xFFFF));  //draw circle, center:(119, 160), color: random
+  for (int r = 0; r < 115; r = r + 2) {           // set r : 0--115
+    Tft.drawCircle(119, 160, r, random(0xFFFF));  // draw circle, center:(119, 160), color: random
   }
   delay(10);
 }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/text/text.ino b/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
index 2d27e11185..6dc49cc950 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/text/text.ino
@@ -23,8 +23,8 @@ void setup() {
 
   Tft.drawString("Hello", 0, 180, 3, CYAN);  // draw string: "hello", (0, 180), size: 3, color: CYAN
 
-  Tft.drawString("World!!", 60, 220, 4, WHITE);  // draw string: "world!!", (80, 230), size: 4, color: WHITE
+  Tft.drawString("World!!", 60, 220, 4,
+                 WHITE);  // draw string: "world!!", (80, 230), size: 4, color: WHITE
 }
 
-void loop() {
-}
+void loop() { }
diff --git a/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino b/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino
index ab66b5e182..e556aa8b08 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino
@@ -163,7 +163,8 @@ boolean bmpReadHeader(File f) {
   int bmp_width  = read32(f);
   int bmp_height = read32(f);
 
-  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) {  // if image is not 320x240, return false
+  if (bmp_width != __Gnbmp_width
+      || bmp_height != __Gnbmp_height) {  // if image is not 320x240, return false
     return false;
   }
 
diff --git a/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino b/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
index 70b2eef3fb..4f185999d0 100644
--- a/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
+++ b/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino
@@ -56,8 +56,7 @@ bool checkBMP(char* _name, char r_name[]) {
   }
 
   // if xxx.bmp or xxx.BMP
-  if (r_name[len - 4] == '.'
-      && (r_name[len - 3] == 'b' || (r_name[len - 3] == 'B'))
+  if (r_name[len - 4] == '.' && (r_name[len - 3] == 'b' || (r_name[len - 3] == 'B'))
       && (r_name[len - 2] == 'm' || (r_name[len - 2] == 'M'))
       && (r_name[len - 1] == 'p' || (r_name[len - 1] == 'P'))) {
     return true;
@@ -272,7 +271,8 @@ boolean bmpReadHeader(File f) {
   int bmp_width  = read32(f);
   int bmp_height = read32(f);
 
-  if (bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) {  // if image is not 320x240, return false
+  if (bmp_width != __Gnbmp_width
+      || bmp_height != __Gnbmp_height) {  // if image is not 320x240, return false
     return false;
   }
 
diff --git a/libraries/Ticker/examples/TickerBasic/TickerBasic.ino b/libraries/Ticker/examples/TickerBasic/TickerBasic.ino
index 2fabd98315..b49cf93a5c 100644
--- a/libraries/Ticker/examples/TickerBasic/TickerBasic.ino
+++ b/libraries/Ticker/examples/TickerBasic/TickerBasic.ino
@@ -41,5 +41,4 @@ void setup() {
   flipper.attach(0.3, flip);
 }
 
-void loop() {
-}
+void loop() { }
diff --git a/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino b/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
index b9d2db5bcd..41c8bb6d5a 100644
--- a/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
+++ b/libraries/Ticker/examples/TickerFunctional/TickerFunctional.ino
@@ -9,8 +9,7 @@
 
 class ExampleClass {
   public:
-  ExampleClass(int pin, int duration) :
-      _pin(pin), _duration(duration) {
+  ExampleClass(int pin, int duration) : _pin(pin), _duration(duration) {
     pinMode(_pin, OUTPUT);
     _myTicker.attach_ms(_duration, std::bind(&ExampleClass::classBlink, this));
   }
@@ -19,22 +18,14 @@ class ExampleClass {
   int    _pin, _duration;
   Ticker _myTicker;
 
-  void classBlink() {
-    digitalWrite(_pin, !digitalRead(_pin));
-  }
+  void classBlink() { digitalWrite(_pin, !digitalRead(_pin)); }
 };
 
-void staticBlink() {
-  digitalWrite(LED2, !digitalRead(LED2));
-}
+void staticBlink() { digitalWrite(LED2, !digitalRead(LED2)); }
 
-void scheduledBlink() {
-  digitalWrite(LED3, !digitalRead(LED2));
-}
+void scheduledBlink() { digitalWrite(LED3, !digitalRead(LED2)); }
 
-void parameterBlink(int p) {
-  digitalWrite(p, !digitalRead(p));
-}
+void parameterBlink(int p) { digitalWrite(p, !digitalRead(p)); }
 
 Ticker staticTicker;
 Ticker scheduledTicker;
@@ -54,10 +45,7 @@ void setup() {
   parameterTicker.attach_ms(100, std::bind(parameterBlink, LED4));
 
   pinMode(LED5, OUTPUT);
-  lambdaTicker.attach_ms(100, []() {
-    digitalWrite(LED5, !digitalRead(LED5));
-  });
+  lambdaTicker.attach_ms(100, []() { digitalWrite(LED5, !digitalRead(LED5)); });
 }
 
-void loop() {
-}
+void loop() { }
diff --git a/libraries/Ticker/examples/TickerParameter/TickerParameter.ino b/libraries/Ticker/examples/TickerParameter/TickerParameter.ino
index 8263c0bb56..6d4a129717 100644
--- a/libraries/Ticker/examples/TickerParameter/TickerParameter.ino
+++ b/libraries/Ticker/examples/TickerParameter/TickerParameter.ino
@@ -17,21 +17,13 @@ Ticker tickerSetLow;
 Ticker tickerSetHigh;
 Ticker tickerSetChar;
 
-void setPinLow() {
-  digitalWrite(LED_BUILTIN, 0);
-}
+void setPinLow() { digitalWrite(LED_BUILTIN, 0); }
 
-void setPinHigh() {
-  digitalWrite(LED_BUILTIN, 1);
-}
+void setPinHigh() { digitalWrite(LED_BUILTIN, 1); }
 
-void setPin(int state) {
-  digitalWrite(LED_BUILTIN, state);
-}
+void setPin(int state) { digitalWrite(LED_BUILTIN, state); }
 
-void setPinChar(char state) {
-  digitalWrite(LED_BUILTIN, state);
-}
+void setPinChar(char state) { digitalWrite(LED_BUILTIN, state); }
 
 void setup() {
   pinMode(LED_BUILTIN, OUTPUT);
@@ -46,5 +38,4 @@ void setup() {
   tickerSetChar.attach_ms(26, setPinChar, (char)1);
 }
 
-void loop() {
-}
+void loop() { }
diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp
index 82ae6b2521..44d07c8bb4 100644
--- a/libraries/Wire/Wire.cpp
+++ b/libraries/Wire/Wire.cpp
@@ -32,8 +32,8 @@ extern "C"
 #include "twi.h"
 #include "Wire.h"
 
-//Some boards don't have these pins available, and hence don't support Wire.
-//Check here for compile-time error.
+// Some boards don't have these pins available, and hence don't support Wire.
+// Check here for compile-time error.
 #if !defined(PIN_WIRE_SDA) || !defined(PIN_WIRE_SCL)
 #error Wire library is not supported on this board
 #endif
@@ -87,10 +87,7 @@ void TwoWire::pins(int sda, int scl)
     default_scl_pin = scl;
 }
 
-void TwoWire::begin(void)
-{
-    begin(default_sda_pin, default_scl_pin);
-}
+void TwoWire::begin(void) { begin(default_sda_pin, default_scl_pin); }
 
 void TwoWire::begin(uint8_t address)
 {
@@ -100,25 +97,13 @@ void TwoWire::begin(uint8_t address)
     begin();
 }
 
-uint8_t TwoWire::status()
-{
-    return twi_status();
-}
+uint8_t TwoWire::status() { return twi_status(); }
 
-void TwoWire::begin(int address)
-{
-    begin((uint8_t)address);
-}
+void TwoWire::begin(int address) { begin((uint8_t)address); }
 
-void TwoWire::setClock(uint32_t frequency)
-{
-    twi_setClock(frequency);
-}
+void TwoWire::setClock(uint32_t frequency) { twi_setClock(frequency); }
 
-void TwoWire::setClockStretchLimit(uint32_t limit)
-{
-    twi_setClockStretchLimit(limit);
-}
+void TwoWire::setClockStretchLimit(uint32_t limit) { twi_setClockStretchLimit(limit); }
 
 size_t TwoWire::requestFrom(uint8_t address, size_t size, bool sendStop)
 {
@@ -149,7 +134,8 @@ uint8_t TwoWire::requestFrom(int address, int quantity)
 
 uint8_t TwoWire::requestFrom(int address, int quantity, int sendStop)
 {
-    return requestFrom(static_cast<uint8_t>(address), static_cast<size_t>(quantity), static_cast<bool>(sendStop));
+    return requestFrom(static_cast<uint8_t>(address), static_cast<size_t>(quantity),
+                       static_cast<bool>(sendStop));
 }
 
 void TwoWire::beginTransmission(uint8_t address)
@@ -160,10 +146,7 @@ void TwoWire::beginTransmission(uint8_t address)
     txBufferLength = 0;
 }
 
-void TwoWire::beginTransmission(int address)
-{
-    beginTransmission((uint8_t)address);
-}
+void TwoWire::beginTransmission(int address) { beginTransmission((uint8_t)address); }
 
 uint8_t TwoWire::endTransmission(uint8_t sendStop)
 {
@@ -174,10 +157,7 @@ uint8_t TwoWire::endTransmission(uint8_t sendStop)
     return ret;
 }
 
-uint8_t TwoWire::endTransmission(void)
-{
-    return endTransmission(true);
-}
+uint8_t TwoWire::endTransmission(void) { return endTransmission(true); }
 
 size_t TwoWire::write(uint8_t data)
 {
diff --git a/libraries/Wire/examples/slave_receiver/slave_receiver.ino b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
index 0db1c5926f..04bbb06cec 100644
--- a/libraries/Wire/examples/slave_receiver/slave_receiver.ino
+++ b/libraries/Wire/examples/slave_receiver/slave_receiver.ino
@@ -23,8 +23,7 @@ void setup() {
   Wire.onReceive(receiveEvent);             // register event
 }
 
-void loop() {
-}
+void loop() { }
 
 // function that executes whenever data is received from master
 // this function is registered as an event, see setup()
diff --git a/libraries/Wire/examples/slave_sender/slave_sender.ino b/libraries/Wire/examples/slave_sender/slave_sender.ino
index 7937cac918..7a3815852a 100644
--- a/libraries/Wire/examples/slave_sender/slave_sender.ino
+++ b/libraries/Wire/examples/slave_sender/slave_sender.ino
@@ -20,8 +20,7 @@ void setup() {
   Wire.onRequest(requestEvent);             // register event
 }
 
-void loop() {
-}
+void loop() { }
 
 // function that executes whenever data is requested by master
 // this function is registered as an event, see setup()
diff --git a/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino b/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
index 66536a335d..ad690c2d7a 100644
--- a/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
+++ b/libraries/esp8266/examples/BlinkPolledTimeout/BlinkPolledTimeout.ino
@@ -36,17 +36,23 @@ void ledToggle() {
   digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));  // Change the state of the LED
 }
 
-esp8266::polledTimeout::periodicFastUs halfPeriod(500000);  //use fully qualified type and avoid importing all ::esp8266 namespace to the global namespace
+esp8266::polledTimeout::periodicFastUs
+    halfPeriod(500000);  // use fully qualified type and avoid importing all ::esp8266 namespace to
+                         // the global namespace
 
 // the setup function runs only once at start
 void setup() {
   Serial.begin(115200);
 
   Serial.println();
-  Serial.printf("periodic/oneShotMs::timeMax()     = %u ms\n", (uint32_t)esp8266::polledTimeout::periodicMs::timeMax());
-  Serial.printf("periodic/oneShotFastMs::timeMax() = %u ms\n", (uint32_t)esp8266::polledTimeout::periodicFastMs::timeMax());
-  Serial.printf("periodic/oneShotFastUs::timeMax() = %u us\n", (uint32_t)esp8266::polledTimeout::periodicFastUs::timeMax());
-  Serial.printf("periodic/oneShotFastNs::timeMax() = %u ns\n", (uint32_t)esp8266::polledTimeout::periodicFastNs::timeMax());
+  Serial.printf("periodic/oneShotMs::timeMax()     = %u ms\n",
+                (uint32_t)esp8266::polledTimeout::periodicMs::timeMax());
+  Serial.printf("periodic/oneShotFastMs::timeMax() = %u ms\n",
+                (uint32_t)esp8266::polledTimeout::periodicFastMs::timeMax());
+  Serial.printf("periodic/oneShotFastUs::timeMax() = %u us\n",
+                (uint32_t)esp8266::polledTimeout::periodicFastUs::timeMax());
+  Serial.printf("periodic/oneShotFastNs::timeMax() = %u ns\n",
+                (uint32_t)esp8266::polledTimeout::periodicFastNs::timeMax());
 
 #if 0  // 1 for debugging polledTimeout
   Serial.printf("periodic/oneShotMs::rangeCompensate     = %u\n", (uint32_t)esp8266::polledTimeout::periodicMs::rangeCompensate);
@@ -57,28 +63,29 @@ void setup() {
 
   pinMode(LED_BUILTIN, OUTPUT);  // Initialize the LED_BUILTIN pin as an output
 
-  using esp8266::polledTimeout::oneShotMs;  //import the type to the local namespace
+  using esp8266::polledTimeout::oneShotMs;  // import the type to the local namespace
 
-  //STEP1; turn the led ON
+  // STEP1; turn the led ON
   ledOn();
 
-  //STEP2: wait for ON timeout
+  // STEP2: wait for ON timeout
   oneShotMs timeoutOn(2000);
   while (!timeoutOn) {
     yield();
   }
 
-  //STEP3: turn the led OFF
+  // STEP3: turn the led OFF
   ledOff();
 
-  //STEP4: wait for OFF timeout to assure the led is kept off for this time before exiting setup
+  // STEP4: wait for OFF timeout to assure the led is kept off for this time before exiting setup
   oneShotMs timeoutOff(2000);
   while (!timeoutOff) {
     yield();
   }
 
-  //Done with STEPs, do other stuff
-  halfPeriod.reset();  //halfPeriod is global, so it gets inited on sketch start. Clear it here to make it ready for loop, where it's actually used.
+  // Done with STEPs, do other stuff
+  halfPeriod.reset();  // halfPeriod is global, so it gets inited on sketch start. Clear it here to
+                       // make it ready for loop, where it's actually used.
 }
 
 // the loop function runs over and over again forever
diff --git a/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino b/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
index 16dd33aa15..6e891cc8fd 100644
--- a/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
+++ b/libraries/esp8266/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino
@@ -15,9 +15,7 @@ int ledState = LOW;
 unsigned long previousMillis = 0;
 const long    interval       = 1000;
 
-void setup() {
-  pinMode(LED_BUILTIN, OUTPUT);
-}
+void setup() { pinMode(LED_BUILTIN, OUTPUT); }
 
 void loop() {
   unsigned long currentMillis = millis();
diff --git a/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino b/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
index 2ce228eff9..ba2eb9451b 100644
--- a/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
+++ b/libraries/esp8266/examples/CallBackList/CallBackGeneric.ino
@@ -13,32 +13,20 @@ class exampleClass {
 
   CallBackList<exCallBack> myHandlers;
 
-  exHandler setHandler(exCallBack cb) {
-    return myHandlers.add(cb);
-  }
+  exHandler setHandler(exCallBack cb) { return myHandlers.add(cb); }
 
-  void removeHandler(exHandler hnd) {
-    myHandlers.remove(hnd);
-  }
+  void removeHandler(exHandler hnd) { myHandlers.remove(hnd); }
 
-  void trigger(int t) {
-    myHandlers.execute(t);
-  }
+  void trigger(int t) { myHandlers.execute(t); }
 };
 
 exampleClass myExample;
 
-void cb1(int in) {
-  Serial.printf("Callback 1, in = %d\n", in);
-}
+void cb1(int in) { Serial.printf("Callback 1, in = %d\n", in); }
 
-void cb2(int in) {
-  Serial.printf("Callback 2, in = %d\n", in);
-}
+void cb2(int in) { Serial.printf("Callback 2, in = %d\n", in); }
 
-void cb3(int in, int s) {
-  Serial.printf("Callback 3, in = %d, s = %d\n", in, s);
-}
+void cb3(int in, int s) { Serial.printf("Callback 3, in = %d, s = %d\n", in, s); }
 
 Ticker                  tk, tk2, tk3;
 exampleClass::exHandler e1 = myExample.setHandler(cb1);
@@ -52,13 +40,8 @@ void setup() {
     Serial.printf("trigger %d\n", (uint32_t)millis());
     myExample.trigger(millis());
   });
-  tk2.once_ms(10000, []() {
-    myExample.removeHandler(e2);
-  });
-  tk3.once_ms(20000, []() {
-    e3.reset();
-  });
+  tk2.once_ms(10000, []() { myExample.removeHandler(e2); });
+  tk3.once_ms(20000, []() { e3.reset(); });
 }
 
-void loop() {
-}
+void loop() { }
diff --git a/libraries/esp8266/examples/CallSDKFunctions/CallSDKFunctions.ino b/libraries/esp8266/examples/CallSDKFunctions/CallSDKFunctions.ino
index 77285a31b5..af62f405b9 100644
--- a/libraries/esp8266/examples/CallSDKFunctions/CallSDKFunctions.ino
+++ b/libraries/esp8266/examples/CallSDKFunctions/CallSDKFunctions.ino
@@ -18,9 +18,7 @@ extern "C" {
 }
 #endif
 
-void setup() {
-  Serial.begin(115200);
-}
+void setup() { Serial.begin(115200); }
 
 void loop() {
   // Call Espressif SDK functionality - wrapped in ifdef so that it still
diff --git a/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino b/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
index cbd25c8bcb..62024b71a1 100644
--- a/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
+++ b/libraries/esp8266/examples/CheckFlashCRC/CheckFlashCRC.ino
@@ -40,5 +40,4 @@ void setup() {
   Serial.printf("CRC check: %s\n", ESP.checkFlashCRC() ? "OK" : "ERROR");
 }
 
-void loop() {
-}
+void loop() { }
diff --git a/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino b/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
index ce4919f14e..61fdd2f378 100644
--- a/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
+++ b/libraries/esp8266/examples/CheckFlashConfig/CheckFlashConfig.ino
@@ -5,9 +5,7 @@
 
 */
 
-void setup(void) {
-  Serial.begin(115200);
-}
+void setup(void) { Serial.begin(115200); }
 
 void loop() {
   uint32_t    realSize = ESP.getFlashChipRealSize();
@@ -19,10 +17,11 @@ void loop() {
 
   Serial.printf("Flash ide  size: %u bytes\n", ideSize);
   Serial.printf("Flash ide speed: %u Hz\n", ESP.getFlashChipSpeed());
-  Serial.printf("Flash ide mode:  %s\n", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT"
-                                              : ideMode == FM_DIO                        ? "DIO"
-                                              : ideMode == FM_DOUT                       ? "DOUT"
-                                                                                         : "UNKNOWN"));
+  Serial.printf("Flash ide mode:  %s\n", (ideMode == FM_QIO  ? "QIO" :
+                                          ideMode == FM_QOUT ? "QOUT" :
+                                          ideMode == FM_DIO  ? "DIO" :
+                                          ideMode == FM_DOUT ? "DOUT" :
+                                                               "UNKNOWN"));
 
   if (ideSize != realSize) {
     Serial.println("Flash Chip configuration wrong!\n");
diff --git a/libraries/esp8266/examples/ConfigFile/ConfigFile.ino b/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
index aec83fc8e4..2b25a00390 100644
--- a/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
+++ b/libraries/esp8266/examples/ConfigFile/ConfigFile.ino
@@ -80,5 +80,4 @@ void setup() {
   }
 }
 
-void loop() {
-}
+void loop() { }
diff --git a/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino b/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
index b2efbeb4c1..f614e59183 100644
--- a/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
+++ b/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino
@@ -42,7 +42,7 @@ void setup() {
   pinMode(LED_BUILTIN, OUTPUT);  // Initialize the LED_BUILTIN pin as an output
   analogWriteRange(1000);
 
-  using esp8266::polledTimeout::oneShotMs;  //import the type to the local namespace
+  using esp8266::polledTimeout::oneShotMs;  // import the type to the local namespace
 
   digitalWrite(LED_BUILTIN, LOW);  // Turn the LED on (Note that LOW is the voltage level
 
diff --git a/libraries/esp8266/examples/HeapMetric/HeapMetric.ino b/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
index 3ec3f0cf98..d2cdff916e 100644
--- a/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
+++ b/libraries/esp8266/examples/HeapMetric/HeapMetric.ino
@@ -63,7 +63,8 @@ void tryit(int blocksize) {
     for the blocks*sizeof(void*) allocation. Thus blocks may be off by one count.
     We now validate the estimate and adjust as needed.
   */
-  int rawMemoryEstimate = blocks * ((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7) + ((blocks * sizeof(void*) + UMM_OVERHEAD_ADJUST + 7) & ~7);
+  int rawMemoryEstimate = blocks * ((blocksize + UMM_OVERHEAD_ADJUST + 7) & ~7)
+                          + ((blocks * sizeof(void*) + UMM_OVERHEAD_ADJUST + 7) & ~7);
   if (rawMemoryMaxFreeBlockSize < rawMemoryEstimate) {
     --blocks;
   }
@@ -155,5 +156,4 @@ void setup() {
 #endif
 }
 
-void loop() {
-}
+void loop() { }
diff --git a/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino b/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
index 80544815a2..1be63d4174 100644
--- a/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
+++ b/libraries/esp8266/examples/HelloCrypto/HelloCrypto.ino
@@ -1,7 +1,9 @@
 /**
-   This example demonstrates the usage of the ESP8266 Crypto implementation, which aims to contain easy-to-use cryptographic functions.
-   Crypto is currently primarily a frontend for the cryptographic library BearSSL which is used by `BearSSL::WiFiClientSecure` and `BearSSL::WiFiServerSecure` in the ESP8266 Arduino Core.
-   Extensive documentation can be found in the Crypto source code files and on the [BearSSL homepage](https://www.bearssl.org).
+   This example demonstrates the usage of the ESP8266 Crypto implementation, which aims to contain
+   easy-to-use cryptographic functions. Crypto is currently primarily a frontend for the
+   cryptographic library BearSSL which is used by `BearSSL::WiFiClientSecure` and
+   `BearSSL::WiFiServerSecure` in the ESP8266 Arduino Core. Extensive documentation can be found in
+   the Crypto source code files and on the [BearSSL homepage](https://www.bearssl.org).
 */
 
 #include <ESP8266WiFi.h>
@@ -12,10 +14,10 @@ namespace TypeCast = experimental::TypeConversion;
 
 /**
    NOTE: Although we could define the strings below as normal String variables,
-   here we are using PROGMEM combined with the FPSTR() macro (and also just the F() macro further down in the file).
-   The reason is that this approach will place the strings in flash memory which will help save RAM during program execution.
-   Reading strings from flash will be slower than reading them from RAM,
-   but this will be a negligible difference when printing them to Serial.
+   here we are using PROGMEM combined with the FPSTR() macro (and also just the F() macro further
+   down in the file). The reason is that this approach will place the strings in flash memory which
+   will help save RAM during program execution. Reading strings from flash will be slower than
+   reading them from RAM, but this will be a negligible difference when printing them to Serial.
 
    More on F(), FPSTR() and PROGMEM:
    https://github.com/esp8266/Arduino/issues/1143
@@ -24,8 +26,10 @@ namespace TypeCast = experimental::TypeConversion;
 constexpr char masterKey[] PROGMEM = "w86vn@rpfA O+S";  // Use 8 random characters or more
 
 void setup() {
-  // Prevents the flash memory from being worn out, see: https://github.com/esp8266/Arduino/issues/1054 .
-  // This will however delay node WiFi start-up by about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to connect to.
+  // Prevents the flash memory from being worn out, see:
+  // https://github.com/esp8266/Arduino/issues/1054 . This will however delay node WiFi start-up by
+  // about 700 ms. The delay is 900 ms if we otherwise would have stored the WiFi network we want to
+  // connect to.
   WiFi.persistent(false);
 
   Serial.begin(115200);
@@ -35,7 +39,8 @@ void setup() {
 }
 
 void loop() {
-  // This serves only to demonstrate the library use. See the header file for a full list of functions.
+  // This serves only to demonstrate the library use. See the header file for a full list of
+  // functions.
 
   using namespace experimental::crypto;
 
@@ -52,19 +57,30 @@ void loop() {
   getNonceGenerator()(hkdfSalt, sizeof hkdfSalt);
 
   // Generate the key to use for HMAC and encryption
-  HKDF hkdfInstance(FPSTR(masterKey), (sizeof masterKey) - 1, hkdfSalt, sizeof hkdfSalt);  // (sizeof masterKey) - 1 removes the terminating null value of the c-string
+  HKDF hkdfInstance(FPSTR(masterKey), (sizeof masterKey) - 1, hkdfSalt,
+                    sizeof hkdfSalt);  // (sizeof masterKey) - 1 removes the terminating null value
+                                       // of the c-string
   hkdfInstance.produce(derivedKey, sizeof derivedKey);
 
   // Hash
   SHA256::hash(exampleData.c_str(), exampleData.length(), resultArray);
-  Serial.println(String(F("\nThis is the SHA256 hash of our example data, in HEX format:\n")) + TypeCast::uint8ArrayToHexString(resultArray, sizeof resultArray));
-  Serial.println(String(F("This is the SHA256 hash of our example data, in HEX format, using String output:\n")) + SHA256::hash(exampleData));
+  Serial.println(String(F("\nThis is the SHA256 hash of our example data, in HEX format:\n"))
+                 + TypeCast::uint8ArrayToHexString(resultArray, sizeof resultArray));
+  Serial.println(
+      String(
+          F("This is the SHA256 hash of our example data, in HEX format, using String output:\n"))
+      + SHA256::hash(exampleData));
 
   // HMAC
   // Note that HMAC output length is limited
-  SHA256::hmac(exampleData.c_str(), exampleData.length(), derivedKey, sizeof derivedKey, resultArray, sizeof resultArray);
-  Serial.println(String(F("\nThis is the SHA256 HMAC of our example data, in HEX format:\n")) + TypeCast::uint8ArrayToHexString(resultArray, sizeof resultArray));
-  Serial.println(String(F("This is the SHA256 HMAC of our example data, in HEX format, using String output:\n")) + SHA256::hmac(exampleData, derivedKey, sizeof derivedKey, SHA256::NATURAL_LENGTH));
+  SHA256::hmac(exampleData.c_str(), exampleData.length(), derivedKey, sizeof derivedKey,
+               resultArray, sizeof resultArray);
+  Serial.println(String(F("\nThis is the SHA256 HMAC of our example data, in HEX format:\n"))
+                 + TypeCast::uint8ArrayToHexString(resultArray, sizeof resultArray));
+  Serial.println(
+      String(
+          F("This is the SHA256 HMAC of our example data, in HEX format, using String output:\n"))
+      + SHA256::hmac(exampleData, derivedKey, sizeof derivedKey, SHA256::NATURAL_LENGTH));
 
   // Authenticated Encryption with Associated Data (AEAD)
   String  dataToEncrypt = F("This data is not encrypted.");
@@ -74,10 +90,14 @@ void loop() {
   Serial.println(String(F("\nThis is the data to encrypt: ")) + dataToEncrypt);
 
   // Note that the key must be ENCRYPTION_KEY_LENGTH long.
-  ChaCha20Poly1305::encrypt(dataToEncrypt.begin(), dataToEncrypt.length(), derivedKey, &encryptionCounter, sizeof encryptionCounter, resultingNonce, resultingTag);
+  ChaCha20Poly1305::encrypt(dataToEncrypt.begin(), dataToEncrypt.length(), derivedKey,
+                            &encryptionCounter, sizeof encryptionCounter, resultingNonce,
+                            resultingTag);
   Serial.println(String(F("Encrypted data: ")) + dataToEncrypt);
 
-  bool decryptionSucceeded = ChaCha20Poly1305::decrypt(dataToEncrypt.begin(), dataToEncrypt.length(), derivedKey, &encryptionCounter, sizeof encryptionCounter, resultingNonce, resultingTag);
+  bool decryptionSucceeded = ChaCha20Poly1305::decrypt(
+      dataToEncrypt.begin(), dataToEncrypt.length(), derivedKey, &encryptionCounter,
+      sizeof encryptionCounter, resultingNonce, resultingTag);
   encryptionCounter++;
 
   if (decryptionSucceeded) {
@@ -88,7 +108,8 @@ void loop() {
 
   Serial.println(dataToEncrypt);
 
-  Serial.println(F("\n##########################################################################################################\n"));
+  Serial.println(F("\n#############################################################################"
+                   "#############################\n"));
 
   delay(10000);
 }
diff --git a/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino b/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
index 62ff6498f3..6b36f8718f 100644
--- a/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
+++ b/libraries/esp8266/examples/HwdtStackDump/HwdtStackDump.ino
@@ -50,7 +50,8 @@ void setup(void) {
   WiFi.persistent(false);  // w/o this a flash write occurs at every boot
   WiFi.mode(WIFI_OFF);
   Serial.begin(115200);
-  delay(20);  // This delay helps when using the 'Modified Serial monitor' otherwise it is not needed.
+  delay(
+      20);  // This delay helps when using the 'Modified Serial monitor' otherwise it is not needed.
   Serial.println();
   Serial.println();
   Serial.println(F("The Hardware Watchdog Timer Demo is starting ..."));
@@ -77,9 +78,9 @@ void setup(void) {
   disable_extra4k_at_link_time();
 #endif
 
-  Serial.printf_P(PSTR("This example was built with%s an extra 4K of heap space (g_pcont == 0x%08lX)\r\n"),
-                  ((uintptr_t)0x3FFFC000 < (uintptr_t)g_pcont) ? "" : "out",
-                  (uintptr_t)g_pcont);
+  Serial.printf_P(
+      PSTR("This example was built with%s an extra 4K of heap space (g_pcont == 0x%08lX)\r\n"),
+      ((uintptr_t)0x3FFFC000 < (uintptr_t)g_pcont) ? "" : "out", (uintptr_t)g_pcont);
 #if defined(DEBUG_ESP_HWDT) || defined(DEBUG_ESP_HWDT_NOEXTRA4K)
   Serial.print(F("and with the HWDT"));
 #if defined(DEBUG_ESP_HWDT_NOEXTRA4K)
diff --git a/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino b/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
index 45e2d63da4..bed9954358 100644
--- a/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
+++ b/libraries/esp8266/examples/HwdtStackDump/ProcessKey.ino
@@ -32,7 +32,8 @@ void processKey(Print& out, int hotKey) {
                    "mov.n a5, %3\n\t"
                    "mov.n a6, %4\n\t"
                    :
-                   : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa)
+                   : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa),
+                     "r"(0xaaaaaaaa)
                    : "memory");
       // Could not find these in the stack dump, unless interrupts were enabled.
       {
@@ -62,7 +63,8 @@ void processKey(Print& out, int hotKey) {
       break;
     case 'w':
       out.println(F("Now calling: void crashMeIfYouCan(void)__attribute__((weak));"));
-      out.println(F("This function has a prototype but was missing when the sketch was linked. ..."));
+      out.println(
+          F("This function has a prototype but was missing when the sketch was linked. ..."));
       crashMeIfYouCan();
       break;
     case 'b':
@@ -90,8 +92,10 @@ void processKey(Print& out, int hotKey) {
       out.println(F("  s    - Software WDT"));
       out.println(F("  h    - Hardware WDT - looping with interrupts disabled"));
       out.println(F("  w    - Hardware WDT - calling a missing (weak) function."));
-      out.println(F("  0    - Hardware WDT - a hard coded compiler breakpoint from a compile time detected divide by zero"));
-      out.println(F("  b    - Hardware WDT - a forgotten hard coded 'break 1, 15;' and no GDB running."));
+      out.println(F("  0    - Hardware WDT - a hard coded compiler breakpoint from a compile time "
+                    "detected divide by zero"));
+      out.println(
+          F("  b    - Hardware WDT - a forgotten hard coded 'break 1, 15;' and no GDB running."));
       out.println(F("  z    - Divide by zero, exception(0);"));
       out.println(F("  p    - panic();"));
       out.println();
@@ -106,12 +110,8 @@ void processKey(Print& out, int hotKey) {
 
 // With the current toolchain 10.1, using this to divide by zero will *not* be
 // caught at compile time.
-int __attribute__((noinline)) divideA_B(int a, int b) {
-  return (a / b);
-}
+int __attribute__((noinline)) divideA_B(int a, int b) { return (a / b); }
 
 // With the current toolchain 10.1, using this to divide by zero *will* be
 // caught at compile time. And a hard coded breakpoint will be inserted.
-int divideA_B_bp(int a, int b) {
-  return (a / b);
-}
+int divideA_B_bp(int a, int b) { return (a / b); }
diff --git a/libraries/esp8266/examples/I2SInput/I2SInput.ino b/libraries/esp8266/examples/I2SInput/I2SInput.ino
index 6e2e11b07b..9c4aa50f37 100644
--- a/libraries/esp8266/examples/I2SInput/I2SInput.ino
+++ b/libraries/esp8266/examples/I2SInput/I2SInput.ino
@@ -50,6 +50,5 @@ void setup() {
   }
 }
 
-void loop() {
-  /* Nothing here */
+void loop() { /* Nothing here */
 }
diff --git a/libraries/esp8266/examples/IramReserve/IramReserve.ino b/libraries/esp8266/examples/IramReserve/IramReserve.ino
index e1ad8c6b74..11d1d17657 100644
--- a/libraries/esp8266/examples/IramReserve/IramReserve.ino
+++ b/libraries/esp8266/examples/IramReserve/IramReserve.ino
@@ -117,9 +117,9 @@ void setup() {
   WiFi.mode(WIFI_OFF);
   Serial.begin(115200);
   delay(10);
-  Serial.println("\r\n\r\nThis sketch requires Tools Option: 'MMU: 16KB cache + 48KB IRAM and 2nd Heap (shared)'");
+  Serial.println("\r\n\r\nThis sketch requires Tools Option: 'MMU: 16KB cache + 48KB IRAM and 2nd "
+                 "Heap (shared)'");
 }
 
-void loop(void) {
-}
+void loop(void) { }
 #endif
diff --git a/libraries/esp8266/examples/IramReserve/ProcessKey.ino b/libraries/esp8266/examples/IramReserve/ProcessKey.ino
index 45e2d63da4..bed9954358 100644
--- a/libraries/esp8266/examples/IramReserve/ProcessKey.ino
+++ b/libraries/esp8266/examples/IramReserve/ProcessKey.ino
@@ -32,7 +32,8 @@ void processKey(Print& out, int hotKey) {
                    "mov.n a5, %3\n\t"
                    "mov.n a6, %4\n\t"
                    :
-                   : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa)
+                   : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa),
+                     "r"(0xaaaaaaaa)
                    : "memory");
       // Could not find these in the stack dump, unless interrupts were enabled.
       {
@@ -62,7 +63,8 @@ void processKey(Print& out, int hotKey) {
       break;
     case 'w':
       out.println(F("Now calling: void crashMeIfYouCan(void)__attribute__((weak));"));
-      out.println(F("This function has a prototype but was missing when the sketch was linked. ..."));
+      out.println(
+          F("This function has a prototype but was missing when the sketch was linked. ..."));
       crashMeIfYouCan();
       break;
     case 'b':
@@ -90,8 +92,10 @@ void processKey(Print& out, int hotKey) {
       out.println(F("  s    - Software WDT"));
       out.println(F("  h    - Hardware WDT - looping with interrupts disabled"));
       out.println(F("  w    - Hardware WDT - calling a missing (weak) function."));
-      out.println(F("  0    - Hardware WDT - a hard coded compiler breakpoint from a compile time detected divide by zero"));
-      out.println(F("  b    - Hardware WDT - a forgotten hard coded 'break 1, 15;' and no GDB running."));
+      out.println(F("  0    - Hardware WDT - a hard coded compiler breakpoint from a compile time "
+                    "detected divide by zero"));
+      out.println(
+          F("  b    - Hardware WDT - a forgotten hard coded 'break 1, 15;' and no GDB running."));
       out.println(F("  z    - Divide by zero, exception(0);"));
       out.println(F("  p    - panic();"));
       out.println();
@@ -106,12 +110,8 @@ void processKey(Print& out, int hotKey) {
 
 // With the current toolchain 10.1, using this to divide by zero will *not* be
 // caught at compile time.
-int __attribute__((noinline)) divideA_B(int a, int b) {
-  return (a / b);
-}
+int __attribute__((noinline)) divideA_B(int a, int b) { return (a / b); }
 
 // With the current toolchain 10.1, using this to divide by zero *will* be
 // caught at compile time. And a hard coded breakpoint will be inserted.
-int divideA_B_bp(int a, int b) {
-  return (a / b);
-}
+int divideA_B_bp(int a, int b) { return (a / b); }
diff --git a/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino b/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
index fcaa98c725..da424fa545 100644
--- a/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
+++ b/libraries/esp8266/examples/LowPowerDemo/LowPowerDemo.ino
@@ -82,8 +82,9 @@ uint32_t    timeout = 30E3;  // 30 second timeout on the WiFi connection
 #define testPoint_LOW
 #endif
 
-// This structure is stored in RTC memory to save the WiFi state and reset count (number of Deep Sleeps),
-// and it reconnects twice as fast as the first connection; it's used several places in this demo
+// This structure is stored in RTC memory to save the WiFi state and reset count (number of Deep
+// Sleeps), and it reconnects twice as fast as the first connection; it's used several places in
+// this demo
 struct nv_s {
   WiFiState wss;  // core's WiFi save state
 
@@ -98,7 +99,7 @@ static nv_s* nv = (nv_s*)RTC_USER_MEM;  // user RTC RAM area
 
 uint32_t resetCount = 0;  // keeps track of the number of Deep Sleep tests / resets
 
-const uint32_t                     blinkDelay = 100;      // fast blink rate for the LED when waiting for the user
+const uint32_t blinkDelay = 100;  // fast blink rate for the LED when waiting for the user
 esp8266::polledTimeout::periodicMs blinkLED(blinkDelay);  // LED blink delay without delay()
 esp8266::polledTimeout::oneShotMs  altDelay(blinkDelay);  // tight loop to simulate user code
 esp8266::polledTimeout::oneShotMs  wifiTimeout(timeout);  // 30 second timeout on WiFi connection
@@ -106,14 +107,14 @@ esp8266::polledTimeout::oneShotMs  wifiTimeout(timeout);  // 30 second timeout o
 
 void wakeupCallback() {  // unlike ISRs, you can do a print() from a callback function
   testPoint_LOW;         // testPoint tracks latency from WAKE_UP_PIN LOW to testPoint LOW
-  printMillis();         // show time difference across sleep; millis is wrong as the CPU eventually stops
+  printMillis();  // show time difference across sleep; millis is wrong as the CPU eventually stops
   Serial.println(F("Woke from Light Sleep - this is the callback"));
 }
 
 void setup() {
 #ifdef TESTPOINT
   pinMode(testPointPin, OUTPUT);  // test point for Light Sleep and Deep Sleep tests
-  testPoint_LOW;                  // Deep Sleep reset doesn't clear GPIOs, testPoint LOW shows boot time
+  testPoint_LOW;  // Deep Sleep reset doesn't clear GPIOs, testPoint LOW shows boot time
 #endif
   pinMode(LED, OUTPUT);                // activity and status indicator
   digitalWrite(LED, LOW);              // turn on the LED
@@ -164,7 +165,7 @@ void loop() {
   } else if (resetCount == 4) {
     resetTests();
   }
-}  //end of loop()
+}  // end of loop()
 
 void runTest1() {
   Serial.println(F("\n1st test - running with WiFi unconfigured"));
@@ -182,12 +183,12 @@ void runTest2() {
     readVoltage();  // read internal VCC
     Serial.println(F("press the switch to continue"));
     waitPushbutton(true, 90); /* This is using a special feature: below 100 mS blink delay,
-         the LED blink delay is padding 100 mS time with 'program cycles' to fill the 100 mS.
-         At 90 mS delay, 90% of the blink time is delay(), and 10% is 'your program running'.
-         Below 90% you'll see a difference in the average amperage: less delay() = more amperage.
-         At 100 mS and above it's essentially all delay() time.  On an oscilloscope you'll see the
-         time between beacons at > 67 mA more often with less delay() percentage. You can change
-         the '90' mS to other values to see the effect it has on Automatic Modem Sleep. */
+        the LED blink delay is padding 100 mS time with 'program cycles' to fill the 100 mS.
+        At 90 mS delay, 90% of the blink time is delay(), and 10% is 'your program running'.
+        Below 90% you'll see a difference in the average amperage: less delay() = more amperage.
+        At 100 mS and above it's essentially all delay() time.  On an oscilloscope you'll see the
+        time between beacons at > 67 mA more often with less delay() percentage. You can change
+        the '90' mS to other values to see the effect it has on Automatic Modem Sleep. */
   } else {
     Serial.println(F("no WiFi connection, test skipped"));
   }
@@ -196,15 +197,17 @@ void runTest2() {
 void runTest3() {
   Serial.println(F("\n3rd test - Forced Modem Sleep"));
   WiFi.shutdown(nv->wss);  // shut the modem down and save the WiFi state for faster reconnection
-  //  WiFi.forceSleepBegin(delay_in_uS);  // alternate method of Forced Modem Sleep for an optional timed shutdown,
-  // with WiFi.forceSleepBegin(0xFFFFFFF); the modem sleeps until you wake it, with values <= 0xFFFFFFE it's timed
+  //  WiFi.forceSleepBegin(delay_in_uS);  // alternate method of Forced Modem Sleep for an optional
+  //  timed shutdown,
+  // with WiFi.forceSleepBegin(0xFFFFFFF); the modem sleeps until you wake it, with values <=
+  // 0xFFFFFFE it's timed
   //  delay(10);  // it doesn't always go to sleep unless you delay(10); yield() wasn't reliable
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
   waitPushbutton(true, 99); /* Using the same < 100 mS feature. If you drop the delay below 100, you
-      will see the effect of program time vs. delay() time on minimum amperage.  Above ~ 97 (97% of the
-      time in delay) there is little change in amperage, so you need to spend maximum time in delay()
-      to get minimum amperage.*/
+     will see the effect of program time vs. delay() time on minimum amperage.  Above ~ 97 (97% of
+     the time in delay) there is little change in amperage, so you need to spend maximum time in
+     delay() to get minimum amperage.*/
 }
 
 void runTest4() {
@@ -215,7 +218,7 @@ void runTest4() {
   // and WiFi reconnects after the forceSleepWake more quickly
   digitalWrite(LED, LOW);  // visual cue that we're reconnecting WiFi
   uint32_t wifiBegin = millis();
-  WiFi.forceSleepWake();                   // reconnect with previous STA mode and connection settings
+  WiFi.forceSleepWake();  // reconnect with previous STA mode and connection settings
   WiFi.setSleepMode(WIFI_LIGHT_SLEEP, 3);  // Automatic Light Sleep, DTIM listen interval = 3
   // at higher DTIM intervals you'll have a hard time establishing and maintaining a connection
   wifiTimeout.reset(timeout);
@@ -230,8 +233,8 @@ void runTest4() {
     readVoltage();  // read internal VCC
     Serial.println(F("long press of the switch to continue"));
     waitPushbutton(true, 350); /* Below 100 mS delay it only goes into 'Automatic Modem Sleep',
-        and below ~ 350 mS delay() the 'Automatic Light Sleep' is less frequent.  Above 500 mS
-        delay() doesn't make significant improvement in power savings. */
+       and below ~ 350 mS delay() the 'Automatic Light Sleep' is less frequent.  Above 500 mS
+       delay() doesn't make significant improvement in power savings. */
   } else {
     Serial.println(F("no WiFi connection, test skipped"));
   }
@@ -249,14 +252,15 @@ void runTest5() {
   extern os_timer_t* timer_list;
   timer_list = nullptr;  // stop (but don't disable) the 4 OS timers
   wifi_fpm_set_sleep_type(LIGHT_SLEEP_T);
-  gpio_pin_wakeup_enable(GPIO_ID_PIN(WAKE_UP_PIN), GPIO_PIN_INTR_LOLEVEL);  // GPIO wakeup (optional)
+  gpio_pin_wakeup_enable(GPIO_ID_PIN(WAKE_UP_PIN),
+                         GPIO_PIN_INTR_LOLEVEL);  // GPIO wakeup (optional)
   // only LOLEVEL or HILEVEL interrupts work, no edge, that's an SDK or CPU limitation
   wifi_fpm_set_wakeup_cb(wakeupCallback);  // set wakeup callback
-  // the callback is optional, but without it the modem will wake in 10 seconds then delay(10 seconds)
-  // with the callback the sleep time is only 10 seconds total, no extra delay() afterward
+  // the callback is optional, but without it the modem will wake in 10 seconds then delay(10
+  // seconds) with the callback the sleep time is only 10 seconds total, no extra delay() afterward
   wifi_fpm_open();
-  wifi_fpm_do_sleep(10E6);        // Sleep range = 10000 ~ 268,435,454 uS (0xFFFFFFE, 2^28-1)
-  delay(10e3 + 1);                // delay needs to be 1 mS longer than sleep or it only goes into Modem Sleep
+  wifi_fpm_do_sleep(10E6);  // Sleep range = 10000 ~ 268,435,454 uS (0xFFFFFFE, 2^28-1)
+  delay(10e3 + 1);  // delay needs to be 1 mS longer than sleep or it only goes into Modem Sleep
   Serial.println(F("Woke up!"));  // the interrupt callback hits before this is executed
 }
 
@@ -274,8 +278,9 @@ void runTest6() {
   // only LOLEVEL or HILEVEL interrupts work, no edge, that's an SDK or CPU limitation
   wifi_fpm_set_wakeup_cb(wakeupCallback);  // Set wakeup callback (optional)
   wifi_fpm_open();
-  wifi_fpm_do_sleep(0xFFFFFFF);   // only 0xFFFFFFF, any other value and it won't disconnect the RTC timer
-  delay(10);                      // it goes to sleep during this delay() and waits for an interrupt
+  wifi_fpm_do_sleep(
+      0xFFFFFFF);  // only 0xFFFFFFF, any other value and it won't disconnect the RTC timer
+  delay(10);       // it goes to sleep during this delay() and waits for an interrupt
   Serial.println(F("Woke up!"));  // the interrupt callback hits before this is executed*/
 }
 
@@ -290,11 +295,11 @@ void runTest7() {
   delay(50);                          // debounce time for the switch, pushbutton released
   waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
   digitalWrite(LED, LOW);             // turn the LED on, at least briefly
-  //WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep,
+  // WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep,
   // and no extended RFCAL as it goes into Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  printMillis();                         // show time difference across sleep
-  testPoint_HIGH;                        // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  printMillis();   // show time difference across sleep
+  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
   ESP.deepSleep(10E6, WAKE_RF_DEFAULT);  // good night!  D0 fires a reset in 10 seconds...
   // if you do ESP.deepSleep(0, mode); it needs a RESET to come out of sleep (RTC is disconnected)
   // maximum timed Deep Sleep interval ~ 3 to 4 hours depending on the RTC timer, see the README
@@ -304,41 +309,44 @@ void runTest7() {
 }
 
 void runTest8() {
-  Serial.println(F("\n8th test - in RF_DEFAULT, Deep Sleep for 10 seconds, reset and wake with RFCAL"));
+  Serial.println(
+      F("\n8th test - in RF_DEFAULT, Deep Sleep for 10 seconds, reset and wake with RFCAL"));
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
   waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
-  //WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep,
+  // WiFi.shutdown(nv->wss);  // Forced Modem Sleep for a more Instant Deep Sleep,
   // and no extended RFCAL as it goes into Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush();                                  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH;                                  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  Serial.flush();  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
   ESP.deepSleep(10E6, WAKE_RFCAL);                 // good night!  D0 fires a reset in 10 seconds...
   Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
 void runTest9() {
-  Serial.println(F("\n9th test - in RFCAL, Deep Sleep Instant for 10 seconds, reset and wake with NO_RFCAL"));
+  Serial.println(
+      F("\n9th test - in RFCAL, Deep Sleep Instant for 10 seconds, reset and wake with NO_RFCAL"));
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
   waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
   WiFi.shutdown(nv->wss);             // Forced Modem Sleep for a more Instant Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush();                                  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH;                                  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  Serial.flush();  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
   ESP.deepSleepInstant(10E6, WAKE_NO_RFCAL);       // good night!  D0 fires a reset in 10 seconds...
   Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
 
 void runTest10() {
-  Serial.println(F("\n10th test - in NO_RFCAL, Deep Sleep Instant for 10 seconds, reset and wake with RF_DISABLED"));
+  Serial.println(F("\n10th test - in NO_RFCAL, Deep Sleep Instant for 10 seconds, reset and wake "
+                   "with RF_DISABLED"));
   readVoltage();  // read internal VCC
   Serial.println(F("press the switch to continue"));
   waitPushbutton(false, blinkDelay);  // set true if you want to see Automatic Modem Sleep
-  //WiFi.forceSleepBegin();  // Forced Modem Sleep for a more Instant Deep Sleep
+  // WiFi.forceSleepBegin();  // Forced Modem Sleep for a more Instant Deep Sleep
   Serial.println(F("going into Deep Sleep now..."));
-  Serial.flush();                                  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
-  testPoint_HIGH;                                  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
+  Serial.flush();  // needs a delay(10) or Serial.flush() else it doesn't print the whole message
+  testPoint_HIGH;  // testPoint set HIGH to track Deep Sleep period, cleared at startup()
   ESP.deepSleepInstant(10E6, WAKE_RF_DISABLED);    // good night!  D0 fires a reset in 10 seconds...
   Serial.println(F("What... I'm not asleep?!?"));  // it will never get here
 }
@@ -346,7 +354,8 @@ void runTest10() {
 void resetTests() {
   readVoltage();  // read internal VCC
   Serial.println(F("\nTests completed, in RF_DISABLED, press the switch to do an ESP.restart()"));
-  memset(&nv->wss, 0, sizeof(nv->wss) * 2);  // wipe saved WiFi states, comment this if you want to keep them
+  memset(&nv->wss, 0,
+         sizeof(nv->wss) * 2);  // wipe saved WiFi states, comment this if you want to keep them
   waitPushbutton(false, 1000);
   ESP.restart();
 }
@@ -361,7 +370,7 @@ void waitPushbutton(bool usesDelay, unsigned int delayTime) {  // loop until the
       }
       yield();  // this would be a good place for ArduinoOTA.handle();
     }
-  } else {                                   // long delay() for the 3 modes that need it, but it misses quick switch presses
+  } else {  // long delay() for the 3 modes that need it, but it misses quick switch presses
     while (digitalRead(WAKE_UP_PIN)) {       // wait for a pushbutton press
       digitalWrite(LED, !digitalRead(LED));  // toggle the activity LED
       delay(delayTime);                      // another good place for ArduinoOTA.handle();
@@ -397,12 +406,14 @@ void updateRTCcrc() {  // updates the reset count CRC
 void initWiFi() {
   digitalWrite(LED, LOW);         // give a visual indication that we're alive but busy with WiFi
   uint32_t wifiBegin = millis();  // how long does it take to connect
-  if ((crc32((uint8_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss)) && !WiFi.shutdownValidCRC(nv->wss))) {
+  if ((crc32((uint8_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss))
+       && !WiFi.shutdownValidCRC(nv->wss))) {
     // if good copy of wss, overwrite invalid (primary) copy
     memcpy((uint32_t*)&nv->wss, (uint32_t*)&nv->rtcData.rstCount + 1, sizeof(nv->wss));
   }
-  if (WiFi.shutdownValidCRC(nv->wss)) {                                                  // if we have a valid WiFi saved state
-    memcpy((uint32_t*)&nv->rtcData.rstCount + 1, (uint32_t*)&nv->wss, sizeof(nv->wss));  // save a copy of it
+  if (WiFi.shutdownValidCRC(nv->wss)) {  // if we have a valid WiFi saved state
+    memcpy((uint32_t*)&nv->rtcData.rstCount + 1, (uint32_t*)&nv->wss,
+           sizeof(nv->wss));  // save a copy of it
     Serial.println(F("resuming WiFi"));
   }
   if (!(WiFi.resumeFromShutdown(nv->wss))) {  // couldn't resume, or no valid saved WiFi state yet
diff --git a/libraries/esp8266/examples/MMU48K/MMU48K.ino b/libraries/esp8266/examples/MMU48K/MMU48K.ino
index 6faeb15363..74b2b47650 100644
--- a/libraries/esp8266/examples/MMU48K/MMU48K.ino
+++ b/libraries/esp8266/examples/MMU48K/MMU48K.ino
@@ -54,8 +54,7 @@ bool isValid(uint32_t* probe) {
   uint32_t saveData = *probe;
   for (size_t i = 0; i < 32; i++) {
     *probe = BIT(i);
-    asm volatile("" ::
-                     : "memory");
+    asm volatile("" ::: "memory");
     uint32_t val = *probe;
     if (val != BIT(i)) {
       ets_uart_printf("  Read 0x%08X != Wrote 0x%08X\n", val, (uint32_t)BIT(i));
@@ -108,7 +107,8 @@ void print_mmu_status(Print& oStream) {
 #ifdef MMU_IRAM_SIZE
   oStream.printf_P(PSTR("  IRAM Size:               %u"), MMU_IRAM_SIZE);
   oStream.println();
-  const uint32_t iram_free = MMU_IRAM_SIZE - (uint32_t)((uintptr_t)_text_end - (uintptr_t)XCHAL_INSTRAM1_VADDR);
+  const uint32_t iram_free
+      = MMU_IRAM_SIZE - (uint32_t)((uintptr_t)_text_end - (uintptr_t)XCHAL_INSTRAM1_VADDR);
   oStream.printf_P(PSTR("  IRAM free:               %u"), iram_free);
   oStream.println();
 #endif
@@ -177,23 +177,31 @@ void processKey(Print& out, int hotKey) {
       uint32_t tmp;
       out.printf_P(PSTR("Test how much time is added by exception handling"));
       out.println();
-      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char*)0x40200003, &tmp), tmp);
+      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."),
+                   timed_byte_read((char*)0x40200003, &tmp), tmp);
       out.println();
-      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char*)0x40200003, &tmp), tmp);
+      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."),
+                   timed_byte_read((char*)0x40200003, &tmp), tmp);
       out.println();
-      out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char*)0x40108000, &tmp), tmp);
+      out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."),
+                   timed_byte_read((char*)0x40108000, &tmp), tmp);
       out.println();
-      out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char*)((uintptr_t)&read_var + 1), &tmp), tmp);
+      out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."),
+                   timed_byte_read((char*)((uintptr_t)&read_var + 1), &tmp), tmp);
       out.println();
       out.printf_P(PSTR("Test how much time is used by the inline function method"));
       out.println();
-      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)0x40200003, &tmp), tmp);
+      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."),
+                   timed_byte_read2((char*)0x40200003, &tmp), tmp);
       out.println();
-      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)0x40200003, &tmp), tmp);
+      out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."),
+                   timed_byte_read2((char*)0x40200003, &tmp), tmp);
       out.println();
-      out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)0x40108000, &tmp), tmp);
+      out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."),
+                   timed_byte_read2((char*)0x40108000, &tmp), tmp);
       out.println();
-      out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char*)((uintptr_t)&read_var + 1), &tmp), tmp);
+      out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."),
+                   timed_byte_read2((char*)((uintptr_t)&read_var + 1), &tmp), tmp);
       out.println();
       out.println();
       break;
@@ -215,7 +223,8 @@ void processKey(Print& out, int hotKey) {
       out.printf_P(PSTR("Read Byte, 0x%02X at %p"), probe_c[0], probe_c);
       xt_rsil(0);
       out.println();
-      out.printf_P(PSTR("With Non32-bit access enabled, access range check is only done when 'Tools->Debug Level: CORE ...' is set."));
+      out.printf_P(PSTR("With Non32-bit access enabled, access range check is only done when "
+                        "'Tools->Debug Level: CORE ...' is set."));
       out.println();
       break;
     case 'b':
@@ -315,10 +324,6 @@ void serialClientLoop(void) {
   }
 }
 
-void loop() {
-  serialClientLoop();
-}
+void loop() { serialClientLoop(); }
 
-int __attribute__((noinline)) divideA_B(int a, int b) {
-  return (a / b);
-}
+int __attribute__((noinline)) divideA_B(int a, int b) { return (a / b); }
diff --git a/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino b/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
index ce72d96f74..c43bb0fccc 100644
--- a/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
+++ b/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino
@@ -69,7 +69,7 @@ static bool                               time_machine_run_once = false;
 // OPTIONAL: change SNTP startup delay
 // a weak function is already defined and returns 0 (RFC violation)
 // it can be redefined:
-//uint32_t sntp_startup_delay_MS_rfc_not_less_than_60000 ()
+// uint32_t sntp_startup_delay_MS_rfc_not_less_than_60000 ()
 //{
 //    //info_sntp_startup_delay_MS_rfc_not_less_than_60000_has_been_called = true;
 //    return 60000; // 60s (or lwIP's original default: (random() % 5000))
@@ -78,14 +78,14 @@ static bool                               time_machine_run_once = false;
 // OPTIONAL: change SNTP update delay
 // a weak function is already defined and returns 1 hour
 // it can be redefined:
-//uint32_t sntp_update_delay_MS_rfc_not_less_than_15000 ()
+// uint32_t sntp_update_delay_MS_rfc_not_less_than_15000 ()
 //{
 //    //info_sntp_update_delay_MS_rfc_not_less_than_15000_has_been_called = true;
 //    return 15000; // 15s
 //}
 
-#define PTM(w)              \
-  Serial.print(" " #w "="); \
+#define PTM(w)                                                                                     \
+  Serial.print(" " #w "=");                                                                        \
   Serial.print(tm->tm_##w);
 
 void printTm(const char* what, const tm* tm) {
@@ -156,8 +156,7 @@ void showTime() {
       } else {
         Serial.printf("%s ", sntp.toString().c_str());
       }
-      Serial.printf("- IPv6: %s - Reachability: %o\n",
-                    sntp.isV6() ? "Yes" : "No",
+      Serial.printf("- IPv6: %s - Reachability: %o\n", sntp.isV6() ? "Yes" : "No",
                     sntp_getreachability(i));
     }
   }
@@ -173,11 +172,10 @@ void showTime() {
     gettimeofday(&tv, nullptr);
     if (tv.tv_sec != prevtv.tv_sec) {
       Serial.printf("time(): %u   gettimeofday(): %u.%06u  seconds are unchanged\n",
-                    (uint32_t)prevtime,
-                    (uint32_t)prevtv.tv_sec, (uint32_t)prevtv.tv_usec);
+                    (uint32_t)prevtime, (uint32_t)prevtv.tv_sec, (uint32_t)prevtv.tv_usec);
       Serial.printf("time(): %u   gettimeofday(): %u.%06u  <-- seconds have changed\n",
-                    (uint32_t)(prevtime = time(nullptr)),
-                    (uint32_t)tv.tv_sec, (uint32_t)tv.tv_usec);
+                    (uint32_t)(prevtime = time(nullptr)), (uint32_t)tv.tv_sec,
+                    (uint32_t)tv.tv_usec);
       break;
     }
     prevtv = tv;
@@ -216,8 +214,7 @@ void time_is_set(bool from_sntp /* <= this parameter is optional */) {
   if (time_machine_running) {
     now          = time(nullptr);
     const tm* tm = localtime(&now);
-    Serial.printf(": future=%3ddays: DST=%s - ",
-                  time_machine_days,
+    Serial.printf(": future=%3ddays: DST=%s - ", time_machine_days,
                   tm->tm_isdst ? "true " : "false");
     Serial.print(ctime(&now));
     gettimeofday(&tv, nullptr);
@@ -265,10 +262,10 @@ void setup() {
 
   // Former configTime is still valid, here is the call for 7 hours to the west
   // with an enabled 30mn DST
-  //configTime(7 * 3600, 3600 / 2, "pool.ntp.org");
+  // configTime(7 * 3600, 3600 / 2, "pool.ntp.org");
 
   // OPTIONAL: disable obtaining SNTP servers from DHCP
-  //sntp_servermode_dhcp(0); // 0: disable obtaining SNTP servers from DHCP (enabled by default)
+  // sntp_servermode_dhcp(0); // 0: disable obtaining SNTP servers from DHCP (enabled by default)
 
   // Give now a chance to the settimeofday callback,
   // because it is *always* deferred to the next yield()/loop()-call.
diff --git a/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino b/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
index 405105b7b8..4d25920f17 100644
--- a/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
+++ b/libraries/esp8266/examples/RTCUserMemory/RTCUserMemory.ino
@@ -67,8 +67,7 @@ void setup() {
   ESP.deepSleep(5e6);
 }
 
-void loop() {
-}
+void loop() { }
 
 uint32_t calculateCRC32(const uint8_t* data, size_t length) {
   uint32_t crc = 0xffffffff;
@@ -88,7 +87,7 @@ uint32_t calculateCRC32(const uint8_t* data, size_t length) {
   return crc;
 }
 
-//prints all rtcData, including the leading crc32
+// prints all rtcData, including the leading crc32
 void printMemory() {
   char     buf[3];
   uint8_t* ptr = (uint8_t*)&rtcData;
diff --git a/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino b/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
index 2b1cd01129..5401e352ef 100644
--- a/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
+++ b/libraries/esp8266/examples/SerialDetectBaudrate/SerialDetectBaudrate.ino
@@ -10,7 +10,8 @@ void setup() {
   unsigned long detectedBaudrate = Serial.detectBaudrate(TIMEOUT);
 
   if (detectedBaudrate) {
-    Serial.printf("\nDetected baudrate is %lu, switching to that baudrate now...\n", detectedBaudrate);
+    Serial.printf("\nDetected baudrate is %lu, switching to that baudrate now...\n",
+                  detectedBaudrate);
 
     // Wait for printf to finish
     while (Serial.availableForWrite() != UART_TX_FIFO_SIZE) {
@@ -20,7 +21,8 @@ void setup() {
     // Clear Tx buffer to avoid extra characters being printed
     Serial.flush();
 
-    // After this, any writing to Serial will print gibberish on the serial monitor if the baudrate doesn't match
+    // After this, any writing to Serial will print gibberish on the serial monitor if the baudrate
+    // doesn't match
     Serial.begin(detectedBaudrate);
   } else {
     Serial.println("\nNothing detected");
diff --git a/libraries/esp8266/examples/SerialStress/SerialStress.ino b/libraries/esp8266/examples/SerialStress/SerialStress.ino
index 4e34da7201..5adc94d950 100644
--- a/libraries/esp8266/examples/SerialStress/SerialStress.ino
+++ b/libraries/esp8266/examples/SerialStress/SerialStress.ino
@@ -19,7 +19,7 @@
 #define FAKE_INCREASED_AVAILABLE 100  // test readBytes's timeout
 
 #define TIMEOUT 5000
-#define DEBUG(x...)  //x
+#define DEBUG(x...)  // x
 
 uint8_t buf[BUFFER_SIZE];
 uint8_t temp[BUFFER_SIZE];
@@ -37,18 +37,23 @@ static uint64_t timeout;
 Stream* logger;
 
 void error(const char* what) {
-  logger->printf("\nerror: %s after %ld minutes\nread idx:  %d\nwrite idx: %d\ntotal:     %ld\nlast read: %d\nmaxavail:  %d\n",
-                 what, (long)((millis() - start_ms) / 60000), in_idx, out_idx, (long)in_total, (int)local_receive_size, maxavail);
+  logger->printf("\nerror: %s after %ld minutes\nread idx:  %d\nwrite idx: %d\ntotal:     "
+                 "%ld\nlast read: %d\nmaxavail:  %d\n",
+                 what, (long)((millis() - start_ms) / 60000), in_idx, out_idx, (long)in_total,
+                 (int)local_receive_size, maxavail);
   if (Serial.hasOverrun()) {
     logger->printf("overrun!\n");
   }
-  logger->printf("should be (size=%d idx=%d..%d):\n    ", BUFFER_SIZE, in_idx, in_idx + local_receive_size - 1);
+  logger->printf("should be (size=%d idx=%d..%d):\n    ", BUFFER_SIZE, in_idx,
+                 in_idx + local_receive_size - 1);
   for (size_t i = in_idx; i < in_idx + local_receive_size; i++) {
-    logger->printf("%02x(%c) ", buf[i], (unsigned char)((buf[i] > 31 && buf[i] < 128) ? buf[i] : '.'));
+    logger->printf("%02x(%c) ", buf[i],
+                   (unsigned char)((buf[i] > 31 && buf[i] < 128) ? buf[i] : '.'));
   }
   logger->print("\n\nis: ");
   for (size_t i = 0; i < local_receive_size; i++) {
-    logger->printf("%02x(%c) ", temp[i], (unsigned char)((temp[i] > 31 && temp[i] < 128) ? temp[i] : '.'));
+    logger->printf("%02x(%c) ", temp[i],
+                   (unsigned char)((temp[i] > 31 && temp[i] < 128) ? temp[i] : '.'));
   }
   logger->println("\n\n");
 
@@ -75,8 +80,8 @@ void setup() {
 
   int baud = Serial.baudRate();
   logger->printf(ESP.getFullVersion().c_str());
-  logger->printf("\n\nBAUD: %d - CoreRxBuffer: %d bytes - TestBuffer: %d bytes\n",
-                 baud, SERIAL_SIZE_RX, BUFFER_SIZE);
+  logger->printf("\n\nBAUD: %d - CoreRxBuffer: %d bytes - TestBuffer: %d bytes\n", baud,
+                 SERIAL_SIZE_RX, BUFFER_SIZE);
 
   size_for_1sec = baud / 10;  // 8n1=10baudFor8bits
   logger->printf("led changes state every %zd bytes (= 1 second)\n", size_for_1sec);
@@ -108,13 +113,15 @@ void loop() {
     maxlen = BUFFER_SIZE - out_idx;
   }
   // check if not cycling more than buffer size relatively to input
-  size_t in_out = out_idx == in_idx ? BUFFER_SIZE : (in_idx + BUFFER_SIZE - out_idx - 1) % BUFFER_SIZE;
+  size_t in_out
+      = out_idx == in_idx ? BUFFER_SIZE : (in_idx + BUFFER_SIZE - out_idx - 1) % BUFFER_SIZE;
   if (maxlen > in_out) {
     maxlen = in_out;
   }
   DEBUG(logger->printf("(aw%i/w%i", Serial.availableForWrite(), maxlen));
   size_t local_written_size = Serial.write(buf + out_idx, maxlen);
-  DEBUG(logger->printf(":w%i/aw%i/ar%i)\n", local_written_size, Serial.availableForWrite(), Serial.available()));
+  DEBUG(logger->printf(":w%i/aw%i/ar%i)\n", local_written_size, Serial.availableForWrite(),
+                       Serial.available()));
   if (local_written_size > maxlen) {
     error("bad write");
   }
diff --git a/libraries/esp8266/examples/StreamString/StreamString.ino b/libraries/esp8266/examples/StreamString/StreamString.ino
index d4571a0bfb..3f3dc1af6a 100644
--- a/libraries/esp8266/examples/StreamString/StreamString.ino
+++ b/libraries/esp8266/examples/StreamString/StreamString.ino
@@ -4,9 +4,7 @@
 #include <StreamDev.h>
 #include <StreamString.h>
 
-void loop() {
-  delay(1000);
-}
+void loop() { delay(1000); }
 
 void checksketch(const char* what, const char* res1, const char* res2) {
   if (strcmp(res1, res2) == 0) {
@@ -162,7 +160,8 @@ void testStreamString() {
     if (heap != 0) {
       check("heap is occupied by String/StreamString(progmem)", heapStr.c_str(), heapStr.c_str());
     } else {
-      check("ERROR: heap should be occupied by String/StreamString(progmem)", heapStr.c_str(), "-1");
+      check("ERROR: heap should be occupied by String/StreamString(progmem)", heapStr.c_str(),
+            "-1");
     }
   }
 
@@ -180,8 +179,8 @@ void setup() {
 
   testStreamString();
 
-  Serial.printf("sizeof: String:%d Stream:%d StreamString:%d SStream:%d\n",
-                (int)sizeof(String), (int)sizeof(Stream), (int)sizeof(StreamString), (int)sizeof(S2Stream));
+  Serial.printf("sizeof: String:%d Stream:%d StreamString:%d SStream:%d\n", (int)sizeof(String),
+                (int)sizeof(Stream), (int)sizeof(StreamString), (int)sizeof(S2Stream));
 }
 
 #endif
diff --git a/libraries/esp8266/examples/TestEspApi/TestEspApi.ino b/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
index dd7727f9b7..f688fdad09 100644
--- a/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
+++ b/libraries/esp8266/examples/TestEspApi/TestEspApi.ino
@@ -28,58 +28,31 @@ Stream& ehConsolePort(Serial);
 // UNLESS: You swap the TX pin using the alternate pinout.
 const uint8_t LED_PIN = 1;
 
-const char* const RST_REASONS[] = {
-  "REASON_DEFAULT_RST",
-  "REASON_WDT_RST",
-  "REASON_EXCEPTION_RST",
-  "REASON_SOFT_WDT_RST",
-  "REASON_SOFT_RESTART",
-  "REASON_DEEP_SLEEP_AWAKE",
-  "REASON_EXT_SYS_RST"
-};
+const char* const RST_REASONS[]
+    = { "REASON_DEFAULT_RST",  "REASON_WDT_RST",      "REASON_EXCEPTION_RST",
+        "REASON_SOFT_WDT_RST", "REASON_SOFT_RESTART", "REASON_DEEP_SLEEP_AWAKE",
+        "REASON_EXT_SYS_RST" };
 
-const char* const FLASH_SIZE_MAP_NAMES[] = {
-  "FLASH_SIZE_4M_MAP_256_256",
-  "FLASH_SIZE_2M",
-  "FLASH_SIZE_8M_MAP_512_512",
-  "FLASH_SIZE_16M_MAP_512_512",
-  "FLASH_SIZE_32M_MAP_512_512",
-  "FLASH_SIZE_16M_MAP_1024_1024",
-  "FLASH_SIZE_32M_MAP_1024_1024"
-};
+const char* const FLASH_SIZE_MAP_NAMES[]
+    = { "FLASH_SIZE_4M_MAP_256_256",   "FLASH_SIZE_2M",
+        "FLASH_SIZE_8M_MAP_512_512",   "FLASH_SIZE_16M_MAP_512_512",
+        "FLASH_SIZE_32M_MAP_512_512",  "FLASH_SIZE_16M_MAP_1024_1024",
+        "FLASH_SIZE_32M_MAP_1024_1024" };
 
-const char* const OP_MODE_NAMES[] {
-  "NULL_MODE",
-  "STATION_MODE",
-  "SOFTAP_MODE",
-  "STATIONAP_MODE"
-};
+const char* const OP_MODE_NAMES[] { "NULL_MODE", "STATION_MODE", "SOFTAP_MODE", "STATIONAP_MODE" };
 
-const char* const AUTH_MODE_NAMES[] {
-  "AUTH_OPEN",
-  "AUTH_WEP",
-  "AUTH_WPA_PSK",
-  "AUTH_WPA2_PSK",
-  "AUTH_WPA_WPA2_PSK",
-  "AUTH_MAX"
-};
+const char* const AUTH_MODE_NAMES[] { "AUTH_OPEN",     "AUTH_WEP",          "AUTH_WPA_PSK",
+                                      "AUTH_WPA2_PSK", "AUTH_WPA_WPA2_PSK", "AUTH_MAX" };
 
-const char* const PHY_MODE_NAMES[] {
-  "",
-  "PHY_MODE_11B",
-  "PHY_MODE_11G",
-  "PHY_MODE_11N"
-};
+const char* const PHY_MODE_NAMES[] { "", "PHY_MODE_11B", "PHY_MODE_11G", "PHY_MODE_11N" };
 
-const char* const EVENT_NAMES[] {
-  "EVENT_STAMODE_CONNECTED",
-  "EVENT_STAMODE_DISCONNECTED",
-  "EVENT_STAMODE_AUTHMODE_CHANGE",
-  "EVENT_STAMODE_GOT_IP",
-  "EVENT_SOFTAPMODE_STACONNECTED",
-  "EVENT_SOFTAPMODE_STADISCONNECTED",
-  "EVENT_MAX"
-};
+const char* const EVENT_NAMES[] { "EVENT_STAMODE_CONNECTED",
+                                  "EVENT_STAMODE_DISCONNECTED",
+                                  "EVENT_STAMODE_AUTHMODE_CHANGE",
+                                  "EVENT_STAMODE_GOT_IP",
+                                  "EVENT_SOFTAPMODE_STACONNECTED",
+                                  "EVENT_SOFTAPMODE_STADISCONNECTED",
+                                  "EVENT_MAX" };
 
 const char* const EVENT_REASONS[] {
   "",
@@ -108,10 +81,7 @@ const char* const EVENT_REASONS[] {
   "REASON_CIPHER_SUITE_REJECTED",
 };
 
-const char* const EVENT_REASONS_200[] {
-  "REASON_BEACON_TIMEOUT",
-  "REASON_NO_AP_FOUND"
-};
+const char* const EVENT_REASONS_200[] { "REASON_BEACON_TIMEOUT", "REASON_NO_AP_FOUND" };
 
 void wifi_event_handler_cb(System_Event_t* event) {
   ehConsolePort.print(EVENT_NAMES[event->event]);
@@ -129,7 +99,8 @@ void wifi_event_handler_cb(System_Event_t* event) {
     case EVENT_SOFTAPMODE_STACONNECTED:
     case EVENT_SOFTAPMODE_STADISCONNECTED: {
       char mac[32] = { 0 };
-      snprintf(mac, 32, MACSTR ", aid: %d", MAC2STR(event->event_info.sta_connected.mac), event->event_info.sta_connected.aid);
+      snprintf(mac, 32, MACSTR ", aid: %d", MAC2STR(event->event_info.sta_connected.mac),
+               event->event_info.sta_connected.aid);
 
       ehConsolePort.print(mac);
     } break;
@@ -201,7 +172,8 @@ void print_system_info(Stream& consolePort) {
   consolePort.println(system_get_userbin_addr(), HEX);
 
   consolePort.print(F("system_get_boot_mode(): "));
-  consolePort.println(system_get_boot_mode() == 0 ? F("SYS_BOOT_ENHANCE_MODE") : F("SYS_BOOT_NORMAL_MODE"));
+  consolePort.println(system_get_boot_mode() == 0 ? F("SYS_BOOT_ENHANCE_MODE") :
+                                                    F("SYS_BOOT_NORMAL_MODE"));
 
   consolePort.print(F("system_get_cpu_freq(): "));
   consolePort.println(system_get_cpu_freq());
@@ -219,8 +191,9 @@ void print_wifi_general(Stream& consolePort) {
 }
 
 void secure_softap_config(softap_config* config, const char* ssid, const char* password) {
-  size_t ssidLen     = strlen(ssid) < sizeof(config->ssid) ? strlen(ssid) : sizeof(config->ssid);
-  size_t passwordLen = strlen(password) < sizeof(config->password) ? strlen(password) : sizeof(config->password);
+  size_t ssidLen = strlen(ssid) < sizeof(config->ssid) ? strlen(ssid) : sizeof(config->ssid);
+  size_t passwordLen
+      = strlen(password) < sizeof(config->password) ? strlen(password) : sizeof(config->password);
 
   memset(config->ssid, 0, sizeof(config->ssid));
   memcpy(config->ssid, ssid, ssidLen);
diff --git a/libraries/esp8266/examples/UartDownload/UartDownload.ino b/libraries/esp8266/examples/UartDownload/UartDownload.ino
index 6d86441998..cba42b5d69 100644
--- a/libraries/esp8266/examples/UartDownload/UartDownload.ino
+++ b/libraries/esp8266/examples/UartDownload/UartDownload.ino
@@ -110,13 +110,13 @@ void setup() {
   // stub, then both devices shift their UART speeds to the command line value.
   Serial.begin(115200);
 
-  Serial.println(F(
-      "\r\n\r\n"
-      "Boot UART Download Demo - initialization started.\r\n"
-      "\r\n"
-      "For a quick test to see the UART Download work,\r\n"
-      "stop your serial terminal APP and run:\r\n"
-      "  esptool.py --chip esp8266 --before no_reset --after soft_reset flash_id\r\n"));
+  Serial.println(
+      F("\r\n\r\n"
+        "Boot UART Download Demo - initialization started.\r\n"
+        "\r\n"
+        "For a quick test to see the UART Download work,\r\n"
+        "stop your serial terminal APP and run:\r\n"
+        "  esptool.py --chip esp8266 --before no_reset --after soft_reset flash_id\r\n"));
 
   // ...
 }
diff --git a/libraries/esp8266/examples/interactive/interactive.ino b/libraries/esp8266/examples/interactive/interactive.ino
index 1206dba83d..c1b2dde100 100644
--- a/libraries/esp8266/examples/interactive/interactive.ino
+++ b/libraries/esp8266/examples/interactive/interactive.ino
@@ -35,15 +35,14 @@ void setup() {
   }
   Serial.println();
   Serial.println(WiFi.localIP());
-  Serial.print(
-      "WL_IDLE_STATUS      = 0\n"
-      "WL_NO_SSID_AVAIL    = 1\n"
-      "WL_SCAN_COMPLETED   = 2\n"
-      "WL_CONNECTED        = 3\n"
-      "WL_CONNECT_FAILED   = 4\n"
-      "WL_CONNECTION_LOST  = 5\n"
-      "WL_WRONG_PASSWORD   = 6\n"
-      "WL_DISCONNECTED     = 7\n");
+  Serial.print("WL_IDLE_STATUS      = 0\n"
+               "WL_NO_SSID_AVAIL    = 1\n"
+               "WL_SCAN_COMPLETED   = 2\n"
+               "WL_CONNECTED        = 3\n"
+               "WL_CONNECT_FAILED   = 4\n"
+               "WL_CONNECTION_LOST  = 5\n"
+               "WL_WRONG_PASSWORD   = 6\n"
+               "WL_DISCONNECTED     = 7\n");
 }
 
 void WiFiOn() {
@@ -62,17 +61,17 @@ void WiFiOff() {
 }
 
 void loop() {
-#define TEST(name, var, varinit, func)   \
-  static decltype(func) var = (varinit); \
-  if ((var) != (func)) {                 \
-    var = (func);                        \
-    Serial.printf("**** %s: ", name);    \
-    Serial.println(var);                 \
+#define TEST(name, var, varinit, func)                                                             \
+  static decltype(func) var = (varinit);                                                           \
+  if ((var) != (func)) {                                                                           \
+    var = (func);                                                                                  \
+    Serial.printf("**** %s: ", name);                                                              \
+    Serial.println(var);                                                                           \
   }
 
-#define DO(x...)         \
-  Serial.println(F(#x)); \
-  x;                     \
+#define DO(x...)                                                                                   \
+  Serial.println(F(#x));                                                                           \
+  x;                                                                                               \
   break
 
   TEST("Free Heap", freeHeap, 0, ESP.getFreeHeap());
diff --git a/libraries/esp8266/examples/irammem/irammem.ino b/libraries/esp8266/examples/irammem/irammem.ino
index ea9597bee8..8972580abc 100644
--- a/libraries/esp8266/examples/irammem/irammem.ino
+++ b/libraries/esp8266/examples/irammem/irammem.ino
@@ -67,10 +67,8 @@ __attribute__((noinline)) void aliasTestO3(uint16_t* x) {
 // Evaluate if optomizer may have changed 32-bit access to 8-bit.
 // 8-bit access will take longer as it will be processed thought
 // the exception handler. For this case the -O0 version will appear faster.
-#pragma GCC optimize("O0")
-__attribute__((noinline)) IRAM_ATTR
-    uint32_t
-    timedRead_Reference(uint8_t* res) {
+#pragma GCC                                  optimize("O0")
+__attribute__((noinline)) IRAM_ATTR uint32_t timedRead_Reference(uint8_t* res) {
   // This test case was verified with GCC 10.3
   // There is a code case that can result in 32-bit wide IRAM load from memory
   // being optimized down to an 8-bit memory access. In this test case we need
@@ -83,28 +81,22 @@ __attribute__((noinline)) IRAM_ATTR
   *res             = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
-#pragma GCC optimize("Os")
-__attribute__((noinline)) IRAM_ATTR
-    uint32_t
-    timedRead_Os(uint8_t* res) {
+#pragma GCC                                  optimize("Os")
+__attribute__((noinline)) IRAM_ATTR uint32_t timedRead_Os(uint8_t* res) {
   const uint8_t* x = (const uint8_t*)0x40100003ul;
   uint32_t       b = ESP.getCycleCount();
   *res             = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
-#pragma GCC optimize("O2")
-__attribute__((noinline)) IRAM_ATTR
-    uint32_t
-    timedRead_O2(uint8_t* res) {
+#pragma GCC                                  optimize("O2")
+__attribute__((noinline)) IRAM_ATTR uint32_t timedRead_O2(uint8_t* res) {
   const uint8_t* x = (const uint8_t*)0x40100003ul;
   uint32_t       b = ESP.getCycleCount();
   *res             = mmu_get_uint8(x);
   return ESP.getCycleCount() - b;
 }
-#pragma GCC optimize("O3")
-__attribute__((noinline)) IRAM_ATTR
-    uint32_t
-    timedRead_O3(uint8_t* res) {
+#pragma GCC                                  optimize("O3")
+__attribute__((noinline)) IRAM_ATTR uint32_t timedRead_O3(uint8_t* res) {
   const uint8_t* x = (const uint8_t*)0x40100003ul;
   uint32_t       b = ESP.getCycleCount();
   *res             = mmu_get_uint8(x);
@@ -116,7 +108,8 @@ bool test4_32bit_loads() {
   bool     result = true;
   uint8_t  res;
   uint32_t cycle_count_ref, cycle_count;
-  Serial.printf("\r\nFor mmu_get_uint8, verify that 32-bit wide IRAM access is preserved across different optimizations:\r\n");
+  Serial.printf("\r\nFor mmu_get_uint8, verify that 32-bit wide IRAM access is preserved across "
+                "different optimizations:\r\n");
   cycle_count_ref = timedRead_Reference(&res);
   /*
     If the optimizer (for options -Os, -O2, and -O3) replaces the 32-bit wide
@@ -360,21 +353,34 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
   bool     success = true;
   int      sres, verify_sres;
 
-  Serial.printf("\r\nPerformance numbers for 16 bit access - using inline macros or exception handling for IRAM.\r\n");
+  Serial.printf("\r\nPerformance numbers for 16 bit access - using inline macros or exception "
+                "handling for IRAM.\r\n");
   ;
   t = cyclesToWrite_nKx16(nK, (uint16_t*)mem);
-  Serial.printf("DRAM Memory Write:         %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
+  Serial.printf(
+      "DRAM Memory Write:         %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK,
+      t / (nK * 1024));
   t = cyclesToRead_nKx16(nK, (uint16_t*)mem, &verify_res);
-  Serial.printf("DRAM Memory Read:          %7d cycles for %dK by uint16, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), verify_res);
+  Serial.printf("DRAM Memory Read:          %7d cycles for %dK by uint16, %3d AVG cycles/transfer "
+                "(sum %08x)\r\n",
+                t, nK, t / (nK * 1024), verify_res);
   t = cyclesToWrite_nKxs16(nK, (int16_t*)mem);
-  Serial.printf("DRAM Memory Write:         %7d cycles for %dK by  int16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
+  Serial.printf(
+      "DRAM Memory Write:         %7d cycles for %dK by  int16, %3d AVG cycles/transfer\r\n", t, nK,
+      t / (nK * 1024));
   t = cyclesToRead_nKxs16(nK, (int16_t*)mem, &verify_sres);
-  Serial.printf("DRAM Memory Read:          %7d cycles for %dK by  int16, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), verify_sres);
+  Serial.printf("DRAM Memory Read:          %7d cycles for %dK by  int16, %3d AVG cycles/transfer "
+                "(sum %08x)\r\n",
+                t, nK, t / (nK * 1024), verify_sres);
 
   t = cyclesToWrite_nKx16_viaInline(nK, (uint16_t*)imem);
-  Serial.printf("IRAM Memory Write Inline:  %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
+  Serial.printf(
+      "IRAM Memory Write Inline:  %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK,
+      t / (nK * 1024));
   t = cyclesToRead_nKx16_viaInline(nK, (uint16_t*)imem, &res);
-  Serial.printf("IRAM Memory Read Inline:   %7d cycles for %dK by uint16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res);
+  Serial.printf("IRAM Memory Read Inline:   %7d cycles for %dK by uint16, %3d AVG cycles/transfer "
+                "(sum %08x) ",
+                t, nK, t / (nK * 1024), res);
   if (res == verify_res) {
     Serial.printf("- passed\r\n");
   } else {
@@ -383,9 +389,13 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
   }
 
   t = cyclesToWrite_nKxs16_viaInline(nK, (int16_t*)imem);
-  Serial.printf("IRAM Memory Write Inline:  %7d cycles for %dK by  int16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
+  Serial.printf(
+      "IRAM Memory Write Inline:  %7d cycles for %dK by  int16, %3d AVG cycles/transfer\r\n", t, nK,
+      t / (nK * 1024));
   t = cyclesToRead_nKxs16_viaInline(nK, (int16_t*)imem, &sres);
-  Serial.printf("IRAM Memory Read Inline:   %7d cycles for %dK by  int16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), sres);
+  Serial.printf("IRAM Memory Read Inline:   %7d cycles for %dK by  int16, %3d AVG cycles/transfer "
+                "(sum %08x) ",
+                t, nK, t / (nK * 1024), sres);
   if (sres == verify_sres) {
     Serial.printf("- passed\r\n");
   } else {
@@ -394,9 +404,13 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
   }
 
   t = cyclesToWrite_nKx16(nK, (uint16_t*)imem);
-  Serial.printf("IRAM Memory Write:         %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
+  Serial.printf(
+      "IRAM Memory Write:         %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK,
+      t / (nK * 1024));
   t = cyclesToRead_nKx16(nK, (uint16_t*)imem, &res);
-  Serial.printf("IRAM Memory Read:          %7d cycles for %dK by uint16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res);
+  Serial.printf("IRAM Memory Read:          %7d cycles for %dK by uint16, %3d AVG cycles/transfer "
+                "(sum %08x) ",
+                t, nK, t / (nK * 1024), res);
   if (res == verify_res) {
     Serial.printf("- passed\r\n");
   } else {
@@ -404,9 +418,13 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
     success = false;
   }
   t = cyclesToWrite_nKxs16(nK, (int16_t*)imem);
-  Serial.printf("IRAM Memory Write:         %7d cycles for %dK by  int16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
+  Serial.printf(
+      "IRAM Memory Write:         %7d cycles for %dK by  int16, %3d AVG cycles/transfer\r\n", t, nK,
+      t / (nK * 1024));
   t = cyclesToRead_nKxs16(nK, (int16_t*)imem, &sres);
-  Serial.printf("IRAM Memory Read:          %7d cycles for %dK by  int16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), sres);
+  Serial.printf("IRAM Memory Read:          %7d cycles for %dK by  int16, %3d AVG cycles/transfer "
+                "(sum %08x) ",
+                t, nK, t / (nK * 1024), sres);
   if (sres == verify_sres) {
     Serial.printf("- passed\r\n");
   } else {
@@ -414,17 +432,26 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
     success = false;
   }
 
-  Serial.printf("\r\nPerformance numbers for 8 bit access - using inline macros or exception handling for IRAM access.\r\n");
+  Serial.printf("\r\nPerformance numbers for 8 bit access - using inline macros or exception "
+                "handling for IRAM access.\r\n");
   ;
   t = cyclesToWrite_nKx8(nK, (uint8_t*)mem);
-  Serial.printf("DRAM Memory Write:         %7d cycles for %dK by  uint8, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
+  Serial.printf(
+      "DRAM Memory Write:         %7d cycles for %dK by  uint8, %3d AVG cycles/transfer\r\n", t, nK,
+      t / (nK * 1024));
   t = cyclesToRead_nKx8(nK, (uint8_t*)mem, &verify_res);
-  Serial.printf("DRAM Memory Read:          %7d cycles for %dK by  uint8, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), verify_res);
+  Serial.printf("DRAM Memory Read:          %7d cycles for %dK by  uint8, %3d AVG cycles/transfer "
+                "(sum %08x)\r\n",
+                t, nK, t / (nK * 1024), verify_res);
 
   t = cyclesToWrite_nKx8_viaInline(nK, (uint8_t*)imem);
-  Serial.printf("IRAM Memory Write Inline:  %7d cycles for %dK by  uint8, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
+  Serial.printf(
+      "IRAM Memory Write Inline:  %7d cycles for %dK by  uint8, %3d AVG cycles/transfer\r\n", t, nK,
+      t / (nK * 1024));
   t = cyclesToRead_nKx8_viaInline(nK, (uint8_t*)imem, &res);
-  Serial.printf("IRAM Memory Read Inline:   %7d cycles for %dK by  uint8, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res);
+  Serial.printf("IRAM Memory Read Inline:   %7d cycles for %dK by  uint8, %3d AVG cycles/transfer "
+                "(sum %08x) ",
+                t, nK, t / (nK * 1024), res);
   if (res == verify_res) {
     Serial.printf("- passed\r\n");
   } else {
@@ -433,9 +460,13 @@ bool perfTest_nK(int nK, uint32_t* mem, uint32_t* imem) {
   }
 
   t = cyclesToWrite_nKx8(nK, (uint8_t*)imem);
-  Serial.printf("IRAM Memory Write:         %7d cycles for %dK by  uint8, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
+  Serial.printf(
+      "IRAM Memory Write:         %7d cycles for %dK by  uint8, %3d AVG cycles/transfer\r\n", t, nK,
+      t / (nK * 1024));
   t = cyclesToRead_nKx8(nK, (uint8_t*)imem, &res);
-  Serial.printf("IRAM Memory Read:          %7d cycles for %dK by  uint8, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res);
+  Serial.printf("IRAM Memory Read:          %7d cycles for %dK by  uint8, %3d AVG cycles/transfer "
+                "(sum %08x) ",
+                t, nK, t / (nK * 1024), res);
   if (res == verify_res) {
     Serial.printf("- passed\r\n");
   } else {
@@ -455,11 +486,12 @@ void setup() {
   delay(20);
   Serial.printf_P(PSTR("\n\nSetup ...\r\n"));
 #ifndef UMM_HEAP_IRAM
-  Serial.printf("\r\n"
-                "This example needs IRAM Heap support enabled.\r\n"
-                "  eg. Arduino IDE 'Tools->MMU:\"16KB cache + 48KB IRAM and 2nd Heap (shared)\"'\r\n"
-                "This build has IRAM Heap support disabled.\r\n"
-                "In this situation, all IRAM requests are satisfied with DRAM.\r\n\r\n");
+  Serial.printf(
+      "\r\n"
+      "This example needs IRAM Heap support enabled.\r\n"
+      "  eg. Arduino IDE 'Tools->MMU:\"16KB cache + 48KB IRAM and 2nd Heap (shared)\"'\r\n"
+      "This build has IRAM Heap support disabled.\r\n"
+      "In this situation, all IRAM requests are satisfied with DRAM.\r\n\r\n");
 #endif
 
   // Compiling with Secondary Heap option does not change malloc to use the
@@ -501,17 +533,26 @@ void setup() {
   uint32_t res;
   uint32_t t;
   int      nK = 1;
-  Serial.printf("\r\nPerformance numbers for 32 bit access - no exception handler or inline macros needed.\r\n");
+  Serial.printf("\r\nPerformance numbers for 32 bit access - no exception handler or inline macros "
+                "needed.\r\n");
   ;
   t = cyclesToWrite_nKx32(nK, mem);
-  Serial.printf("DRAM Memory Write:         %7d cycles for %dK by uint32, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
+  Serial.printf(
+      "DRAM Memory Write:         %7d cycles for %dK by uint32, %3d AVG cycles/transfer\r\n", t, nK,
+      t / (nK * 1024));
   t = cyclesToRead_nKx32(nK, mem, &res);
-  Serial.printf("DRAM Memory Read:          %7d cycles for %dK by uint32, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), res);
+  Serial.printf("DRAM Memory Read:          %7d cycles for %dK by uint32, %3d AVG cycles/transfer "
+                "(sum %08x)\r\n",
+                t, nK, t / (nK * 1024), res);
 
   t = cyclesToWrite_nKx32(nK, imem);
-  Serial.printf("IRAM Memory Write:         %7d cycles for %dK by uint32, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024));
+  Serial.printf(
+      "IRAM Memory Write:         %7d cycles for %dK by uint32, %3d AVG cycles/transfer\r\n", t, nK,
+      t / (nK * 1024));
   t = cyclesToRead_nKx32(nK, imem, &res);
-  Serial.printf("IRAM Memory Read:          %7d cycles for %dK by uint32, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), res);
+  Serial.printf("IRAM Memory Read:          %7d cycles for %dK by uint32, %3d AVG cycles/transfer "
+                "(sum %08x)\r\n",
+                t, nK, t / (nK * 1024), res);
   Serial.println();
 
   if (perfTest_nK(1, mem, imem) && testPunning() && test4_32bit_loads()) {
@@ -594,8 +635,7 @@ void setup() {
     uint32_t hmax;
     uint8_t  hfrag;
     ESP.getHeapStats(&hfree, &hmax, &hfrag);
-    ETS_PRINTF("ESP.getHeapStats(free: %u, max: %u, frag: %u)\n",
-               hfree, hmax, hfrag);
+    ETS_PRINTF("ESP.getHeapStats(free: %u, max: %u, frag: %u)\n", hfree, hmax, hfrag);
     if (free_iram > UMM_OVERHEAD_ADJUST) {
       void* all = malloc(free_iram - UMM_OVERHEAD_ADJUST);
       ETS_PRINTF("%p = malloc(%u)\n", all, free_iram);
diff --git a/libraries/esp8266/examples/virtualmem/virtualmem.ino b/libraries/esp8266/examples/virtualmem/virtualmem.ino
index c5374d245c..f397fb347c 100644
--- a/libraries/esp8266/examples/virtualmem/virtualmem.ino
+++ b/libraries/esp8266/examples/virtualmem/virtualmem.ino
@@ -72,7 +72,8 @@ void setup() {
   ESP.setExternalHeap();
   uint32_t* vm = (uint32_t*)malloc(1024 * sizeof(uint32_t));
   Serial.printf("External buffer: Address %p, free %d\n", vm, ESP.getFreeHeap());
-  // Make sure we go back to the internal heap for other allocations.  Don't forget to ESP.resetHeap()!
+  // Make sure we go back to the internal heap for other allocations.  Don't forget to
+  // ESP.resetHeap()!
   ESP.resetHeap();
 
   uint32_t res;
@@ -132,5 +133,4 @@ void setup() {
   ESP.resetHeap();
 }
 
-void loop() {
-}
+void loop() { }
diff --git a/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino b/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
index fc265a2136..58b8b6d115 100644
--- a/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
+++ b/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino
@@ -7,8 +7,8 @@
 // this example is subject for changes once everything is stabilized
 
 // testing on linux:
-// sudo /usr/sbin/pppd /dev/ttyUSB1 38400 noipdefault nocrtscts local defaultroute noauth nodetach debug dump
-// sudo /usr/sbin/pppd /dev/ttyUSB1 38400 noipdefault nocrtscts local defaultroute noauth
+// sudo /usr/sbin/pppd /dev/ttyUSB1 38400 noipdefault nocrtscts local defaultroute noauth nodetach
+// debug dump sudo /usr/sbin/pppd /dev/ttyUSB1 38400 noipdefault nocrtscts local defaultroute noauth
 
 // proxy arp is needed but we don't have it
 // http://lwip.100.n7.nabble.com/PPP-proxy-arp-support-tp33286p33345.html
@@ -42,8 +42,7 @@ HardwareSerial& logger = Serial;
 PPPServer       ppp(&ppplink);
 
 void PPPConnectedCallback(netif* nif) {
-  logger.printf("ppp: ip=%s/mask=%s/gw=%s\n",
-                IPAddress(&nif->ip_addr).toString().c_str(),
+  logger.printf("ppp: ip=%s/mask=%s/gw=%s\n", IPAddress(&nif->ip_addr).toString().c_str(),
                 IPAddress(&nif->netmask).toString().c_str(),
                 IPAddress(&nif->gw).toString().c_str());
 
@@ -59,9 +58,12 @@ void PPPConnectedCallback(netif* nif) {
 
     // could not make this work yet,
     // but packets are arriving on ppp client (= linux host)
-    logger.printf("redirect22=%d\n", ip_portmap_add(IP_PROTO_TCP, ip_2_ip4(&nif->ip_addr)->addr, 22, ip_2_ip4(&nif->gw)->addr, 22));
-    logger.printf("redirect80=%d\n", ip_portmap_add(IP_PROTO_TCP, ip_2_ip4(&nif->ip_addr)->addr, 80, ip_2_ip4(&nif->gw)->addr, 80));
-    logger.printf("redirect443=%d\n", ip_portmap_add(IP_PROTO_TCP, ip_2_ip4(&nif->ip_addr)->addr, 443, ip_2_ip4(&nif->gw)->addr, 443));
+    logger.printf("redirect22=%d\n", ip_portmap_add(IP_PROTO_TCP, ip_2_ip4(&nif->ip_addr)->addr, 22,
+                                                    ip_2_ip4(&nif->gw)->addr, 22));
+    logger.printf("redirect80=%d\n", ip_portmap_add(IP_PROTO_TCP, ip_2_ip4(&nif->ip_addr)->addr, 80,
+                                                    ip_2_ip4(&nif->gw)->addr, 80));
+    logger.printf("redirect443=%d\n", ip_portmap_add(IP_PROTO_TCP, ip_2_ip4(&nif->ip_addr)->addr,
+                                                     443, ip_2_ip4(&nif->gw)->addr, 443));
   }
   logger.printf("Heap after napt init: %d\n", ESP.getFreeHeap());
   if (ret != ERR_OK) {
@@ -79,18 +81,20 @@ void setup() {
     logger.print('.');
     delay(500);
   }
-  logger.printf("\nSTA: %s (dns: %s / %s)\n",
-                WiFi.localIP().toString().c_str(),
-                WiFi.dnsIP(0).toString().c_str(),
-                WiFi.dnsIP(1).toString().c_str());
+  logger.printf("\nSTA: %s (dns: %s / %s)\n", WiFi.localIP().toString().c_str(),
+                WiFi.dnsIP(0).toString().c_str(), WiFi.dnsIP(1).toString().c_str());
 
   ppplink.begin(PPPLINKBAUD);
   ppplink.enableIntTx(true);
   logger.println();
   logger.printf("\n\nhey, trying to be a PPP server here\n\n");
   logger.printf("Now try this on your linux host:\n\n");
-  logger.printf("connect a serial<->usb module (e.g. to /dev/ttyUSB1) and link it to the ESP (esprx=%d esptx=%d), then run:\n\n", RX, TX);
-  logger.printf("sudo /usr/sbin/pppd /dev/ttyUSB1 %d noipdefault nocrtscts local defaultroute noauth nodetach debug dump\n\n", PPPLINKBAUD);
+  logger.printf("connect a serial<->usb module (e.g. to /dev/ttyUSB1) and link it to the ESP "
+                "(esprx=%d esptx=%d), then run:\n\n",
+                RX, TX);
+  logger.printf("sudo /usr/sbin/pppd /dev/ttyUSB1 %d noipdefault nocrtscts local defaultroute "
+                "noauth nodetach debug dump\n\n",
+                PPPLINKBAUD);
 
   ppp.ifUpCb(PPPConnectedCallback);
   bool ret = ppp.begin(WiFi.localIP());
@@ -106,5 +110,4 @@ void setup() {
 
 #endif
 
-void loop() {
-}
+void loop() { }
diff --git a/libraries/lwIP_PPP/src/PPPServer.cpp b/libraries/lwIP_PPP/src/PPPServer.cpp
index 31c406b830..e474a442ab 100644
--- a/libraries/lwIP_PPP/src/PPPServer.cpp
+++ b/libraries/lwIP_PPP/src/PPPServer.cpp
@@ -2,8 +2,8 @@
 // This is still beta / a work in progress
 
 // testing on linux:
-// sudo /usr/sbin/pppd /dev/ttyUSB1 38400 noipdefault nocrtscts local defaultroute noauth nodetach debug dump
-// sudo /usr/sbin/pppd /dev/ttyUSB1 38400 noipdefault nocrtscts local defaultroute noauth
+// sudo /usr/sbin/pppd /dev/ttyUSB1 38400 noipdefault nocrtscts local defaultroute noauth nodetach
+// debug dump sudo /usr/sbin/pppd /dev/ttyUSB1 38400 noipdefault nocrtscts local defaultroute noauth
 
 // proxy arp is needed but we don't have it
 // http://lwip.100.n7.nabble.com/PPP-proxy-arp-support-tp33286p33345.html
@@ -16,10 +16,7 @@
 
 #include "PPPServer.h"
 
-PPPServer::PPPServer(Stream* sio) :
-    _sio(sio), _cb(netif_status_cb_s), _enabled(false)
-{
-}
+PPPServer::PPPServer(Stream* sio) : _sio(sio), _cb(netif_status_cb_s), _enabled(false) { }
 
 bool PPPServer::handlePackets()
 {
@@ -166,21 +163,19 @@ bool PPPServer::begin(const IPAddress& ourAddress, const IPAddress& peer)
     ppp_set_ipcp_ouraddr(_ppp, ip_2_ip4((const ip_addr_t*)ourAddress));
     ppp_set_ipcp_hisaddr(_ppp, ip_2_ip4((const ip_addr_t*)peer));
 
-    //ip4_addr_t addr;
-    //IP4_ADDR(&addr, 10,0,1,254);
-    //ppp_set_ipcp_dnsaddr(_ppp, 0, &addr);
+    // ip4_addr_t addr;
+    // IP4_ADDR(&addr, 10,0,1,254);
+    // ppp_set_ipcp_dnsaddr(_ppp, 0, &addr);
 
-    //ppp_set_auth(_ppp, PPPAUTHTYPE_ANY, "login", "password");
-    //ppp_set_auth_required(_ppp, 1);
+    // ppp_set_auth(_ppp, PPPAUTHTYPE_ANY, "login", "password");
+    // ppp_set_auth_required(_ppp, 1);
 
     ppp_set_silent(_ppp, 1);
     ppp_listen(_ppp);
     netif_set_status_callback(&_netif, _cb);
 
     _enabled = true;
-    if (!schedule_recurrent_function_us([&]()
-                                        { return this->handlePackets(); },
-                                        1000))
+    if (!schedule_recurrent_function_us([&]() { return this->handlePackets(); }, 1000))
     {
         netif_remove(&_netif);
         return false;
diff --git a/libraries/lwIP_PPP/src/PPPServer.h b/libraries/lwIP_PPP/src/PPPServer.h
index 260ebfe2d8..ecb8d70421 100644
--- a/libraries/lwIP_PPP/src/PPPServer.h
+++ b/libraries/lwIP_PPP/src/PPPServer.h
@@ -44,14 +44,8 @@ class PPPServer
     bool begin(const IPAddress& ourAddress, const IPAddress& peer = IPAddress(172, 31, 255, 254));
     void stop();
 
-    void ifUpCb(void (*cb)(netif*))
-    {
-        _cb = cb;
-    }
-    const ip_addr_t* getPeerAddress() const
-    {
-        return &_netif.gw;
-    }
+    void             ifUpCb(void (*cb)(netif*)) { _cb = cb; }
+    const ip_addr_t* getPeerAddress() const { return &_netif.gw; }
 
 protected:
     static constexpr size_t _bufsize = 128;
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
index 224fe742b8..7bcd5150c8 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp
@@ -56,10 +56,10 @@ void serial_printf(const char* fmt, ...)
 #if DEBUG
 #define PRINTF(...) printf(__VA_ARGS__)
 #else
-#define PRINTF(...) \
-    do              \
-    {               \
-        (void)0;    \
+#define PRINTF(...)                                                                                \
+    do                                                                                             \
+    {                                                                                              \
+        (void)0;                                                                                   \
     } while (0)
 #endif
 
@@ -148,8 +148,7 @@ void serial_printf(const char* fmt, ...)
 // The ENC28J60 SPI Interface supports clock speeds up to 20 MHz
 static const SPISettings spiSettings(20000000, MSBFIRST, SPI_MODE0);
 
-ENC28J60::ENC28J60(int8_t cs, SPIClass& spi, int8_t intr) :
-    _bank(ERXTX_BANK), _cs(cs), _spi(spi)
+ENC28J60::ENC28J60(int8_t cs, SPIClass& spi, int8_t intr) : _bank(ERXTX_BANK), _cs(cs), _spi(spi)
 {
     (void)intr;
 }
@@ -167,8 +166,7 @@ void ENC28J60::enc28j60_arch_spi_deselect(void)
 }
 
 /*---------------------------------------------------------------------------*/
-uint8_t
-ENC28J60::is_mac_mii_reg(uint8_t reg)
+uint8_t ENC28J60::is_mac_mii_reg(uint8_t reg)
 {
     /* MAC or MII register (otherwise, ETH register)? */
     switch (_bank)
@@ -184,8 +182,7 @@ ENC28J60::is_mac_mii_reg(uint8_t reg)
     }
 }
 /*---------------------------------------------------------------------------*/
-uint8_t
-ENC28J60::readreg(uint8_t reg)
+uint8_t ENC28J60::readreg(uint8_t reg)
 {
     uint8_t r;
     enc28j60_arch_spi_select();
@@ -257,10 +254,7 @@ void ENC28J60::writedata(const uint8_t* data, int datalen)
     enc28j60_arch_spi_deselect();
 }
 /*---------------------------------------------------------------------------*/
-void ENC28J60::writedatabyte(uint8_t byte)
-{
-    writedata(&byte, 1);
-}
+void ENC28J60::writedatabyte(uint8_t byte) { writedata(&byte, 1); }
 /*---------------------------------------------------------------------------*/
 int ENC28J60::readdata(uint8_t* buf, int len)
 {
@@ -276,8 +270,7 @@ int ENC28J60::readdata(uint8_t* buf, int len)
     return i;
 }
 /*---------------------------------------------------------------------------*/
-uint8_t
-ENC28J60::readdatabyte(void)
+uint8_t ENC28J60::readdatabyte(void)
 {
     uint8_t r;
     readdata(&r, 1);
@@ -296,8 +289,7 @@ void ENC28J60::softreset(void)
 
 /*---------------------------------------------------------------------------*/
 //#if DEBUG
-uint8_t
-ENC28J60::readrev(void)
+uint8_t ENC28J60::readrev(void)
 {
     uint8_t rev;
     setregbank(MAADRX_BANK);
@@ -521,8 +513,7 @@ bool ENC28J60::reset(void)
     return true;
 }
 /*---------------------------------------------------------------------------*/
-boolean
-ENC28J60::begin(const uint8_t* address)
+boolean ENC28J60::begin(const uint8_t* address)
 {
     _localMac = address;
 
@@ -536,8 +527,7 @@ ENC28J60::begin(const uint8_t* address)
 
 /*---------------------------------------------------------------------------*/
 
-uint16_t
-ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen)
+uint16_t ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen)
 {
     uint16_t dataend;
 
@@ -604,35 +594,31 @@ ENC28J60::sendFrame(const uint8_t* data, uint16_t datalen)
         writereg(ERDPTH, erdpt >> 8);
         PRINTF("enc28j60: tx err: %d: %02x:%02x:%02x:%02x:%02x:%02x\n"
                "                  tsv: %02x%02x%02x%02x%02x%02x%02x\n",
-               datalen,
-               0xff & data[0], 0xff & data[1], 0xff & data[2],
-               0xff & data[3], 0xff & data[4], 0xff & data[5],
-               tsv[6], tsv[5], tsv[4], tsv[3], tsv[2], tsv[1], tsv[0]);
+               datalen, 0xff & data[0], 0xff & data[1], 0xff & data[2], 0xff & data[3],
+               0xff & data[4], 0xff & data[5], tsv[6], tsv[5], tsv[4], tsv[3], tsv[2], tsv[1],
+               tsv[0]);
     }
     else
     {
-        PRINTF("enc28j60: tx: %d: %02x:%02x:%02x:%02x:%02x:%02x\n", datalen,
-               0xff & data[0], 0xff & data[1], 0xff & data[2],
-               0xff & data[3], 0xff & data[4], 0xff & data[5]);
+        PRINTF("enc28j60: tx: %d: %02x:%02x:%02x:%02x:%02x:%02x\n", datalen, 0xff & data[0],
+               0xff & data[1], 0xff & data[2], 0xff & data[3], 0xff & data[4], 0xff & data[5]);
     }
 #endif
 
-    //sent_packets++;
-    //PRINTF("enc28j60: sent_packets %d\n", sent_packets);
+    // sent_packets++;
+    // PRINTF("enc28j60: sent_packets %d\n", sent_packets);
     return datalen;
 }
 
 /*---------------------------------------------------------------------------*/
 
-uint16_t
-ENC28J60::readFrame(uint8_t* buffer, uint16_t bufsize)
+uint16_t ENC28J60::readFrame(uint8_t* buffer, uint16_t bufsize)
 {
     readFrameSize();
     return readFrameData(buffer, bufsize);
 }
 
-uint16_t
-ENC28J60::readFrameSize()
+uint16_t ENC28J60::readFrameSize()
 {
     uint8_t n;
 
@@ -680,8 +666,7 @@ void ENC28J60::discardFrame(uint16_t framesize)
     (void)readFrameData(nullptr, 0);
 }
 
-uint16_t
-ENC28J60::readFrameData(uint8_t* buffer, uint16_t framesize)
+uint16_t ENC28J60::readFrameData(uint8_t* buffer, uint16_t framesize)
 {
     if (framesize < _len)
     {
@@ -723,12 +708,12 @@ ENC28J60::readFrameData(uint8_t* buffer, uint16_t framesize)
         PRINTF("enc28j60: rx err: flushed %d\n", _len);
         return 0;
     }
-    PRINTF("enc28j60: rx: %d: %02x:%02x:%02x:%02x:%02x:%02x\n", _len,
-           0xff & buffer[0], 0xff & buffer[1], 0xff & buffer[2],
-           0xff & buffer[3], 0xff & buffer[4], 0xff & buffer[5]);
+    PRINTF("enc28j60: rx: %d: %02x:%02x:%02x:%02x:%02x:%02x\n", _len, 0xff & buffer[0],
+           0xff & buffer[1], 0xff & buffer[2], 0xff & buffer[3], 0xff & buffer[4],
+           0xff & buffer[5]);
 
-    //received_packets++;
-    //PRINTF("enc28j60: received_packets %d\n", received_packets);
+    // received_packets++;
+    // PRINTF("enc28j60: received_packets %d\n", received_packets);
 
     return _len;
 }
diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.h b/libraries/lwIP_enc28j60/src/utility/enc28j60.h
index 07f71f96ff..ebebbceac4 100644
--- a/libraries/lwIP_enc28j60/src/utility/enc28j60.h
+++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.h
@@ -80,10 +80,7 @@ class ENC28J60
     virtual uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
 
 protected:
-    static constexpr bool interruptIsPossible()
-    {
-        return false;
-    }
+    static constexpr bool interruptIsPossible() { return false; }
 
     /**
         Read an Ethernet frame size
diff --git a/libraries/lwIP_w5100/src/utility/w5100.cpp b/libraries/lwIP_w5100/src/utility/w5100.cpp
index 70e3197afb..327acb33e8 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.cpp
+++ b/libraries/lwIP_w5100/src/utility/w5100.cpp
@@ -203,11 +203,7 @@ void Wiznet5100::wizchip_sw_reset()
     setSHAR(_mac_address);
 }
 
-Wiznet5100::Wiznet5100(int8_t cs, SPIClass& spi, int8_t intr) :
-    _spi(spi), _cs(cs)
-{
-    (void)intr;
-}
+Wiznet5100::Wiznet5100(int8_t cs, SPIClass& spi, int8_t intr) : _spi(spi), _cs(cs) { (void)intr; }
 
 boolean Wiznet5100::begin(const uint8_t* mac_address)
 {
diff --git a/libraries/lwIP_w5100/src/utility/w5100.h b/libraries/lwIP_w5100/src/utility/w5100.h
index ebe11d210f..0f03ecbd39 100644
--- a/libraries/lwIP_w5100/src/utility/w5100.h
+++ b/libraries/lwIP_w5100/src/utility/w5100.h
@@ -80,10 +80,7 @@ class Wiznet5100
     uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
 
 protected:
-    static constexpr bool interruptIsPossible()
-    {
-        return false;
-    }
+    static constexpr bool interruptIsPossible() { return false; }
 
     /**
         Read an Ethernet frame size
@@ -110,14 +107,18 @@ class Wiznet5100
     uint16_t readFrameData(uint8_t* frame, uint16_t framesize);
 
 private:
-    static const uint16_t TxBufferAddress = 0x4000;                    /* Internal Tx buffer address of the iinchip */
-    static const uint16_t RxBufferAddress = 0x6000;                    /* Internal Rx buffer address of the iinchip */
-    static const uint8_t  TxBufferSize    = 0x3;                       /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
-    static const uint8_t  RxBufferSize    = 0x3;                       /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
-    static const uint16_t TxBufferLength  = (1 << TxBufferSize) << 10; /* Length of Tx buffer in bytes */
-    static const uint16_t RxBufferLength  = (1 << RxBufferSize) << 10; /* Length of Rx buffer in bytes */
-    static const uint16_t TxBufferMask    = TxBufferLength - 1;
-    static const uint16_t RxBufferMask    = RxBufferLength - 1;
+    static const uint16_t TxBufferAddress = 0x4000; /* Internal Tx buffer address of the iinchip */
+    static const uint16_t RxBufferAddress = 0x6000; /* Internal Rx buffer address of the iinchip */
+    static const uint8_t  TxBufferSize
+        = 0x3; /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
+    static const uint8_t RxBufferSize
+        = 0x3; /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */
+    static const uint16_t TxBufferLength = (1 << TxBufferSize)
+                                           << 10; /* Length of Tx buffer in bytes */
+    static const uint16_t RxBufferLength = (1 << RxBufferSize)
+                                           << 10; /* Length of Rx buffer in bytes */
+    static const uint16_t TxBufferMask = TxBufferLength - 1;
+    static const uint16_t RxBufferMask = RxBufferLength - 1;
 
     SPIClass& _spi;
     int8_t    _cs;
@@ -125,23 +126,17 @@ class Wiznet5100
 
     /**
         Default function to select chip.
-        @note This function help not to access wrong address. If you do not describe this function or register any functions,
-        null function is called.
+        @note This function help not to access wrong address. If you do not describe this function
+       or register any functions, null function is called.
     */
-    inline void wizchip_cs_select()
-    {
-        digitalWrite(_cs, LOW);
-    }
+    inline void wizchip_cs_select() { digitalWrite(_cs, LOW); }
 
     /**
         Default function to deselect chip.
-        @note This function help not to access wrong address. If you do not describe this function or register any functions,
-        null function is called.
+        @note This function help not to access wrong address. If you do not describe this function
+       or register any functions, null function is called.
     */
-    inline void wizchip_cs_deselect()
-    {
-        digitalWrite(_cs, HIGH);
-    }
+    inline void wizchip_cs_deselect() { digitalWrite(_cs, HIGH); }
 
     /**
         Read a 1 byte value from a register.
@@ -198,9 +193,9 @@ class Wiznet5100
         It copies data to internal TX memory
 
         @details This function reads the Tx write pointer register and after that,
-        it copies the <i>wizdata(pointer buffer)</i> of the length of <i>len(variable)</i> bytes to internal TX memory
-        and updates the Tx write pointer register.
-        This function is being called by send() and sendto() function also.
+        it copies the <i>wizdata(pointer buffer)</i> of the length of <i>len(variable)</i> bytes to
+       internal TX memory and updates the Tx write pointer register. This function is being called
+       by send() and sendto() function also.
 
         @param wizdata Pointer buffer to write data
         @param len Data length
@@ -224,7 +219,8 @@ class Wiznet5100
 
     /**
         It discard the received data in RX memory.
-        @details It discards the data of the length of <i>len(variable)</i> bytes in internal RX memory.
+        @details It discards the data of the length of <i>len(variable)</i> bytes in internal RX
+       memory.
         @param len Data length
     */
     void wizchip_recv_ignore(uint16_t len);
@@ -347,100 +343,72 @@ class Wiznet5100
         @param (uint8_t)mr The value to be set.
         @sa getMR()
     */
-    inline void setMR(uint8_t mode)
-    {
-        wizchip_write(MR, mode);
-    }
+    inline void setMR(uint8_t mode) { wizchip_write(MR, mode); }
 
     /**
         Get Mode Register
         @return uint8_t. The value of Mode register.
         @sa setMR()
     */
-    inline uint8_t getMR()
-    {
-        return wizchip_read(MR);
-    }
+    inline uint8_t getMR() { return wizchip_read(MR); }
 
     /**
         Set local MAC address
-        @param (uint8_t*)shar Pointer variable to set local MAC address. It should be allocated 6 bytes.
+        @param (uint8_t*)shar Pointer variable to set local MAC address. It should be allocated 6
+       bytes.
         @sa getSHAR()
     */
-    inline void setSHAR(const uint8_t* macaddr)
-    {
-        wizchip_write_buf(SHAR, macaddr, 6);
-    }
+    inline void setSHAR(const uint8_t* macaddr) { wizchip_write_buf(SHAR, macaddr, 6); }
 
     /**
         Get local MAC address
-        @param (uint8_t*)shar Pointer variable to get local MAC address. It should be allocated 6 bytes.
+        @param (uint8_t*)shar Pointer variable to get local MAC address. It should be allocated 6
+       bytes.
         @sa setSHAR()
     */
-    inline void getSHAR(uint8_t* macaddr)
-    {
-        wizchip_read_buf(SHAR, macaddr, 6);
-    }
+    inline void getSHAR(uint8_t* macaddr) { wizchip_read_buf(SHAR, macaddr, 6); }
 
     /**
         Get @ref Sn_TX_WR register
         @param (uint16_t)txwr Value to set @ref Sn_TX_WR
         @sa GetSn_TX_WR()
     */
-    inline uint16_t getSn_TX_WR()
-    {
-        return wizchip_read_word(Sn_TX_WR);
-    }
+    inline uint16_t getSn_TX_WR() { return wizchip_read_word(Sn_TX_WR); }
 
     /**
         Set @ref Sn_TX_WR register
         @param (uint16_t)txwr Value to set @ref Sn_TX_WR
         @sa GetSn_TX_WR()
     */
-    inline void setSn_TX_WR(uint16_t txwr)
-    {
-        wizchip_write_word(Sn_TX_WR, txwr);
-    }
+    inline void setSn_TX_WR(uint16_t txwr) { wizchip_write_word(Sn_TX_WR, txwr); }
 
     /**
         Get @ref Sn_RX_RD register
         @regurn uint16_t. Value of @ref Sn_RX_RD.
         @sa setSn_RX_RD()
     */
-    inline uint16_t getSn_RX_RD()
-    {
-        return wizchip_read_word(Sn_RX_RD);
-    }
+    inline uint16_t getSn_RX_RD() { return wizchip_read_word(Sn_RX_RD); }
 
     /**
         Set @ref Sn_RX_RD register
         @param (uint16_t)rxrd Value to set @ref Sn_RX_RD
         @sa getSn_RX_RD()
     */
-    inline void setSn_RX_RD(uint16_t rxrd)
-    {
-        wizchip_write_word(Sn_RX_RD, rxrd);
-    }
+    inline void setSn_RX_RD(uint16_t rxrd) { wizchip_write_word(Sn_RX_RD, rxrd); }
 
     /**
         Set @ref Sn_MR register
         @param (uint8_t)mr Value to set @ref Sn_MR
         @sa getSn_MR()
     */
-    inline void setSn_MR(uint8_t mr)
-    {
-        wizchip_write(Sn_MR, mr);
-    }
+    inline void setSn_MR(uint8_t mr) { wizchip_write(Sn_MR, mr); }
 
     /**
         Get @ref Sn_MR register
         @return uint8_t. Value of @ref Sn_MR.
         @sa setSn_MR()
     */
-    inline uint8_t getSn_MR()
-    {
-        return wizchip_read(Sn_MR);
-    }
+    inline uint8_t getSn_MR() { return wizchip_read(Sn_MR); }
 
     /**
         Set @ref Sn_CR register, then wait for the command to execute
@@ -454,39 +422,27 @@ class Wiznet5100
         @return uint8_t. Value of @ref Sn_CR.
         @sa setSn_CR()
     */
-    inline uint8_t getSn_CR()
-    {
-        return wizchip_read(Sn_CR);
-    }
+    inline uint8_t getSn_CR() { return wizchip_read(Sn_CR); }
 
     /**
         Get @ref Sn_SR register
         @return uint8_t. Value of @ref Sn_SR.
     */
-    inline uint8_t getSn_SR()
-    {
-        return wizchip_read(Sn_SR);
-    }
+    inline uint8_t getSn_SR() { return wizchip_read(Sn_SR); }
 
     /**
         Get @ref Sn_IR register
         @return uint8_t. Value of @ref Sn_IR.
         @sa setSn_IR()
     */
-    inline uint8_t getSn_IR()
-    {
-        return wizchip_read(Sn_IR);
-    }
+    inline uint8_t getSn_IR() { return wizchip_read(Sn_IR); }
 
     /**
         Set @ref Sn_IR register
         @param (uint8_t)ir Value to set @ref Sn_IR
         @sa getSn_IR()
     */
-    inline void setSn_IR(uint8_t ir)
-    {
-        wizchip_write(Sn_IR, ir);
-    }
+    inline void setSn_IR(uint8_t ir) { wizchip_write(Sn_IR, ir); }
 };
 
 #endif  // W5100_H
diff --git a/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino b/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino
index 1cd0ef9137..879be82b77 100644
--- a/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino
+++ b/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino
@@ -5,8 +5,8 @@
 
 #include <SPI.h>
 #include <W5500lwIP.h>
-//or #include <W5100lwIP.h>
-//or #include <ENC28J60lwIP.h>
+// or #include <W5100lwIP.h>
+// or #include <ENC28J60lwIP.h>
 
 #include <WiFiClient.h>  // WiFiClient (-> TCPClient)
 
diff --git a/libraries/lwIP_w5500/src/utility/w5500.cpp b/libraries/lwIP_w5500/src/utility/w5500.cpp
index cc4a1e245d..5852652864 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.cpp
+++ b/libraries/lwIP_w5500/src/utility/w5500.cpp
@@ -97,7 +97,8 @@ void Wiznet5500::wizchip_write_word(uint8_t block, uint16_t address, uint16_t wo
     wizchip_write(block, address + 1, (uint8_t)word);
 }
 
-void Wiznet5500::wizchip_write_buf(uint8_t block, uint16_t address, const uint8_t* pBuf, uint16_t len)
+void Wiznet5500::wizchip_write_buf(uint8_t block, uint16_t address, const uint8_t* pBuf,
+                                   uint16_t len)
 {
     uint16_t i;
 
@@ -277,11 +278,7 @@ int8_t Wiznet5500::wizphy_setphypmode(uint8_t pmode)
     return -1;
 }
 
-Wiznet5500::Wiznet5500(int8_t cs, SPIClass& spi, int8_t intr) :
-    _spi(spi), _cs(cs)
-{
-    (void)intr;
-}
+Wiznet5500::Wiznet5500(int8_t cs, SPIClass& spi, int8_t intr) : _spi(spi), _cs(cs) { (void)intr; }
 
 boolean Wiznet5500::begin(const uint8_t* mac_address)
 {
diff --git a/libraries/lwIP_w5500/src/utility/w5500.h b/libraries/lwIP_w5500/src/utility/w5500.h
index 181e38848a..0a9e16c7ee 100644
--- a/libraries/lwIP_w5500/src/utility/w5500.h
+++ b/libraries/lwIP_w5500/src/utility/w5500.h
@@ -80,10 +80,7 @@ class Wiznet5500
     uint16_t readFrame(uint8_t* buffer, uint16_t bufsize);
 
 protected:
-    static constexpr bool interruptIsPossible()
-    {
-        return false;
-    }
+    static constexpr bool interruptIsPossible() { return false; }
 
     /**
         Read an Ethernet frame size
@@ -134,43 +131,31 @@ class Wiznet5500
 
     /**
         Default function to select chip.
-        @note This function help not to access wrong address. If you do not describe this function or register any functions,
-        null function is called.
+        @note This function help not to access wrong address. If you do not describe this function
+       or register any functions, null function is called.
     */
-    inline void wizchip_cs_select()
-    {
-        digitalWrite(_cs, LOW);
-    }
+    inline void wizchip_cs_select() { digitalWrite(_cs, LOW); }
 
     /**
         Default function to deselect chip.
-        @note This function help not to access wrong address. If you do not describe this function or register any functions,
-        null function is called.
+        @note This function help not to access wrong address. If you do not describe this function
+       or register any functions, null function is called.
     */
-    inline void wizchip_cs_deselect()
-    {
-        digitalWrite(_cs, HIGH);
-    }
+    inline void wizchip_cs_deselect() { digitalWrite(_cs, HIGH); }
 
     /**
         Default function to read in SPI interface.
-        @note This function help not to access wrong address. If you do not describe this function or register any functions,
-        null function is called.
+        @note This function help not to access wrong address. If you do not describe this function
+       or register any functions, null function is called.
     */
-    inline uint8_t wizchip_spi_read_byte()
-    {
-        return _spi.transfer(0);
-    }
+    inline uint8_t wizchip_spi_read_byte() { return _spi.transfer(0); }
 
     /**
         Default function to write in SPI interface.
-        @note This function help not to access wrong address. If you do not describe this function or register any functions,
-        null function is called.
+        @note This function help not to access wrong address. If you do not describe this function
+       or register any functions, null function is called.
     */
-    inline void wizchip_spi_write_byte(uint8_t wb)
-    {
-        _spi.transfer(wb);
-    }
+    inline void wizchip_spi_write_byte(uint8_t wb) { _spi.transfer(wb); }
 
     /**
         Read a 1 byte value from a register.
@@ -251,7 +236,8 @@ class Wiznet5500
     void wizphy_reset();
 
     /**
-        set the power mode of phy inside WIZCHIP. Refer to @ref PHYCFGR in W5500, @ref PHYSTATUS in W5200
+        set the power mode of phy inside WIZCHIP. Refer to @ref PHYCFGR in W5500, @ref PHYSTATUS in
+       W5200
         @param pmode Settig value of power down mode.
     */
     int8_t wizphy_setphypmode(uint8_t pmode);
@@ -260,9 +246,9 @@ class Wiznet5500
         It copies data to internal TX memory
 
         @details This function reads the Tx write pointer register and after that,
-        it copies the <i>wizdata(pointer buffer)</i> of the length of <i>len(variable)</i> bytes to internal TX memory
-        and updates the Tx write pointer register.
-        This function is being called by send() and sendto() function also.
+        it copies the <i>wizdata(pointer buffer)</i> of the length of <i>len(variable)</i> bytes to
+       internal TX memory and updates the Tx write pointer register. This function is being called
+       by send() and sendto() function also.
 
         @param wizdata Pointer buffer to write data
         @param len Data length
@@ -286,7 +272,8 @@ class Wiznet5500
 
     /**
         It discard the received data in RX memory.
-        @details It discards the data of the length of <i>len(variable)</i> bytes in internal RX memory.
+        @details It discards the data of the length of <i>len(variable)</i> bytes in internal RX
+       memory.
         @param len Data length
     */
     void wizchip_recv_ignore(uint16_t len);
@@ -460,24 +447,19 @@ class Wiznet5500
         @param (uint8_t)mr The value to be set.
         @sa getMR()
     */
-    inline void setMR(uint8_t mode)
-    {
-        wizchip_write(BlockSelectCReg, MR, mode);
-    }
+    inline void setMR(uint8_t mode) { wizchip_write(BlockSelectCReg, MR, mode); }
 
     /**
         Get Mode Register
         @return uint8_t. The value of Mode register.
         @sa setMR()
     */
-    inline uint8_t getMR()
-    {
-        return wizchip_read(BlockSelectCReg, MR);
-    }
+    inline uint8_t getMR() { return wizchip_read(BlockSelectCReg, MR); }
 
     /**
         Set local MAC address
-        @param (uint8_t*)shar Pointer variable to set local MAC address. It should be allocated 6 bytes.
+        @param (uint8_t*)shar Pointer variable to set local MAC address. It should be allocated 6
+       bytes.
         @sa getSHAR()
     */
     inline void setSHAR(const uint8_t* macaddr)
@@ -487,102 +469,73 @@ class Wiznet5500
 
     /**
         Get local MAC address
-        @param (uint8_t*)shar Pointer variable to get local MAC address. It should be allocated 6 bytes.
+        @param (uint8_t*)shar Pointer variable to get local MAC address. It should be allocated 6
+       bytes.
         @sa setSHAR()
     */
-    inline void getSHAR(uint8_t* macaddr)
-    {
-        wizchip_read_buf(BlockSelectCReg, SHAR, macaddr, 6);
-    }
+    inline void getSHAR(uint8_t* macaddr) { wizchip_read_buf(BlockSelectCReg, SHAR, macaddr, 6); }
 
     /**
         Set @ref IR register
         @param (uint8_t)ir Value to set @ref IR register.
         @sa getIR()
     */
-    inline void setIR(uint8_t ir)
-    {
-        wizchip_write(BlockSelectCReg, IR, (ir & 0xF0));
-    }
+    inline void setIR(uint8_t ir) { wizchip_write(BlockSelectCReg, IR, (ir & 0xF0)); }
 
     /**
         Get @ref IR register
         @return uint8_t. Value of @ref IR register.
         @sa setIR()
     */
-    inline uint8_t getIR()
-    {
-        return wizchip_read(BlockSelectCReg, IR) & 0xF0;
-    }
+    inline uint8_t getIR() { return wizchip_read(BlockSelectCReg, IR) & 0xF0; }
 
     /**
         Set @ref _IMR_ register
         @param (uint8_t)imr Value to set @ref _IMR_ register.
         @sa getIMR()
     */
-    inline void setIMR(uint8_t imr)
-    {
-        wizchip_write(BlockSelectCReg, _IMR_, imr);
-    }
+    inline void setIMR(uint8_t imr) { wizchip_write(BlockSelectCReg, _IMR_, imr); }
 
     /**
         Get @ref _IMR_ register
         @return uint8_t. Value of @ref _IMR_ register.
         @sa setIMR()
     */
-    inline uint8_t getIMR()
-    {
-        return wizchip_read(BlockSelectCReg, _IMR_);
-    }
+    inline uint8_t getIMR() { return wizchip_read(BlockSelectCReg, _IMR_); }
 
     /**
         Set @ref PHYCFGR register
         @param (uint8_t)phycfgr Value to set @ref PHYCFGR register.
         @sa getPHYCFGR()
     */
-    inline void setPHYCFGR(uint8_t phycfgr)
-    {
-        wizchip_write(BlockSelectCReg, PHYCFGR, phycfgr);
-    }
+    inline void setPHYCFGR(uint8_t phycfgr) { wizchip_write(BlockSelectCReg, PHYCFGR, phycfgr); }
 
     /**
         Get @ref PHYCFGR register
         @return uint8_t. Value of @ref PHYCFGR register.
         @sa setPHYCFGR()
     */
-    inline uint8_t getPHYCFGR()
-    {
-        return wizchip_read(BlockSelectCReg, PHYCFGR);
-    }
+    inline uint8_t getPHYCFGR() { return wizchip_read(BlockSelectCReg, PHYCFGR); }
 
     /**
         Get @ref VERSIONR register
         @return uint8_t. Value of @ref VERSIONR register.
     */
-    inline uint8_t getVERSIONR()
-    {
-        return wizchip_read(BlockSelectCReg, VERSIONR);
-    }
+    inline uint8_t getVERSIONR() { return wizchip_read(BlockSelectCReg, VERSIONR); }
 
     /**
         Set @ref Sn_MR register
         @param (uint8_t)mr Value to set @ref Sn_MR
         @sa getSn_MR()
     */
-    inline void setSn_MR(uint8_t mr)
-    {
-        wizchip_write(BlockSelectSReg, Sn_MR, mr);
-    }
+    inline void setSn_MR(uint8_t mr) { wizchip_write(BlockSelectSReg, Sn_MR, mr); }
 
     /**
         Get @ref Sn_MR register
         @return uint8_t. Value of @ref Sn_MR.
         @sa setSn_MR()
     */
-    inline uint8_t getSn_MR()
-    {
-        return wizchip_read(BlockSelectSReg, Sn_MR);
-    }
+    inline uint8_t getSn_MR() { return wizchip_read(BlockSelectSReg, Sn_MR); }
 
     /**
         Set @ref Sn_CR register, then wait for the command to execute
@@ -596,59 +549,41 @@ class Wiznet5500
         @return uint8_t. Value of @ref Sn_CR.
         @sa setSn_CR()
     */
-    inline uint8_t getSn_CR()
-    {
-        return wizchip_read(BlockSelectSReg, Sn_CR);
-    }
+    inline uint8_t getSn_CR() { return wizchip_read(BlockSelectSReg, Sn_CR); }
 
     /**
         Set @ref Sn_IR register
         @param (uint8_t)ir Value to set @ref Sn_IR
         @sa getSn_IR()
     */
-    inline void setSn_IR(uint8_t ir)
-    {
-        wizchip_write(BlockSelectSReg, Sn_IR, (ir & 0x1F));
-    }
+    inline void setSn_IR(uint8_t ir) { wizchip_write(BlockSelectSReg, Sn_IR, (ir & 0x1F)); }
 
     /**
         Get @ref Sn_IR register
         @return uint8_t. Value of @ref Sn_IR.
         @sa setSn_IR()
     */
-    inline uint8_t getSn_IR()
-    {
-        return (wizchip_read(BlockSelectSReg, Sn_IR) & 0x1F);
-    }
+    inline uint8_t getSn_IR() { return (wizchip_read(BlockSelectSReg, Sn_IR) & 0x1F); }
 
     /**
         Set @ref Sn_IMR register
         @param (uint8_t)imr Value to set @ref Sn_IMR
         @sa getSn_IMR()
     */
-    inline void setSn_IMR(uint8_t imr)
-    {
-        wizchip_write(BlockSelectSReg, Sn_IMR, (imr & 0x1F));
-    }
+    inline void setSn_IMR(uint8_t imr) { wizchip_write(BlockSelectSReg, Sn_IMR, (imr & 0x1F)); }
 
     /**
         Get @ref Sn_IMR register
         @return uint8_t. Value of @ref Sn_IMR.
         @sa setSn_IMR()
     */
-    inline uint8_t getSn_IMR()
-    {
-        return (wizchip_read(BlockSelectSReg, Sn_IMR) & 0x1F);
-    }
+    inline uint8_t getSn_IMR() { return (wizchip_read(BlockSelectSReg, Sn_IMR) & 0x1F); }
 
     /**
         Get @ref Sn_SR register
         @return uint8_t. Value of @ref Sn_SR.
     */
-    inline uint8_t getSn_SR()
-    {
-        return wizchip_read(BlockSelectSReg, Sn_SR);
-    }
+    inline uint8_t getSn_SR() { return wizchip_read(BlockSelectSReg, Sn_SR); }
 
     /**
         Set @ref Sn_RXBUF_SIZE register
@@ -665,10 +600,7 @@ class Wiznet5500
         @return uint8_t. Value of @ref Sn_RXBUF_SIZE.
         @sa setSn_RXBUF_SIZE()
     */
-    inline uint8_t getSn_RXBUF_SIZE()
-    {
-        return wizchip_read(BlockSelectSReg, Sn_RXBUF_SIZE);
-    }
+    inline uint8_t getSn_RXBUF_SIZE() { return wizchip_read(BlockSelectSReg, Sn_RXBUF_SIZE); }
 
     /**
         Set @ref Sn_TXBUF_SIZE register
@@ -685,68 +617,47 @@ class Wiznet5500
         @return uint8_t. Value of @ref Sn_TXBUF_SIZE.
         @sa setSn_TXBUF_SIZE()
     */
-    inline uint8_t getSn_TXBUF_SIZE()
-    {
-        return wizchip_read(BlockSelectSReg, Sn_TXBUF_SIZE);
-    }
+    inline uint8_t getSn_TXBUF_SIZE() { return wizchip_read(BlockSelectSReg, Sn_TXBUF_SIZE); }
 
     /**
         Get @ref Sn_TX_RD register
         @return uint16_t. Value of @ref Sn_TX_RD.
     */
-    inline uint16_t getSn_TX_RD()
-    {
-        return wizchip_read_word(BlockSelectSReg, Sn_TX_RD);
-    }
+    inline uint16_t getSn_TX_RD() { return wizchip_read_word(BlockSelectSReg, Sn_TX_RD); }
 
     /**
         Set @ref Sn_TX_WR register
         @param (uint16_t)txwr Value to set @ref Sn_TX_WR
         @sa GetSn_TX_WR()
     */
-    inline void setSn_TX_WR(uint16_t txwr)
-    {
-        wizchip_write_word(BlockSelectSReg, Sn_TX_WR, txwr);
-    }
+    inline void setSn_TX_WR(uint16_t txwr) { wizchip_write_word(BlockSelectSReg, Sn_TX_WR, txwr); }
 
     /**
         Get @ref Sn_TX_WR register
         @return uint16_t. Value of @ref Sn_TX_WR.
         @sa setSn_TX_WR()
     */
-    inline uint16_t getSn_TX_WR()
-    {
-        return wizchip_read_word(BlockSelectSReg, Sn_TX_WR);
-    }
+    inline uint16_t getSn_TX_WR() { return wizchip_read_word(BlockSelectSReg, Sn_TX_WR); }
 
     /**
         Set @ref Sn_RX_RD register
         @param (uint16_t)rxrd Value to set @ref Sn_RX_RD
         @sa getSn_RX_RD()
     */
-    inline void setSn_RX_RD(uint16_t rxrd)
-    {
-        wizchip_write_word(BlockSelectSReg, Sn_RX_RD, rxrd);
-    }
+    inline void setSn_RX_RD(uint16_t rxrd) { wizchip_write_word(BlockSelectSReg, Sn_RX_RD, rxrd); }
 
     /**
         Get @ref Sn_RX_RD register
         @return uint16_t. Value of @ref Sn_RX_RD.
         @sa setSn_RX_RD()
     */
-    inline uint16_t getSn_RX_RD()
-    {
-        return wizchip_read_word(BlockSelectSReg, Sn_RX_RD);
-    }
+    inline uint16_t getSn_RX_RD() { return wizchip_read_word(BlockSelectSReg, Sn_RX_RD); }
 
     /**
         Get @ref Sn_RX_WR register
         @return uint16_t. Value of @ref Sn_RX_WR.
     */
-    inline uint16_t getSn_RX_WR()
-    {
-        return wizchip_read_word(BlockSelectSReg, Sn_RX_WR);
-    }
+    inline uint16_t getSn_RX_WR() { return wizchip_read_word(BlockSelectSReg, Sn_RX_WR); }
 };
 
 #endif  // W5500_H
diff --git a/tests/device/libraries/BSTest/src/BSArduino.h b/tests/device/libraries/BSTest/src/BSArduino.h
index 82e1b89826..d2b9df3566 100644
--- a/tests/device/libraries/BSTest/src/BSArduino.h
+++ b/tests/device/libraries/BSTest/src/BSArduino.h
@@ -7,10 +7,7 @@ namespace bs
 class ArduinoIOHelper
 {
 public:
-    ArduinoIOHelper(Stream& stream) :
-        m_stream(stream)
-    {
-    }
+    ArduinoIOHelper(Stream& stream) : m_stream(stream) { }
 
     size_t printf(const char* format, ...)
     {
@@ -72,11 +69,8 @@ class ArduinoIOHelper
 
 typedef ArduinoIOHelper IOHelper;
 
-inline void fatal()
-{
-    ESP.restart();
-}
+inline void fatal() { ESP.restart(); }
 
 }  // namespace bs
 
-#endif  //BS_ARDUINO_H
+#endif  // BS_ARDUINO_H
diff --git a/tests/device/libraries/BSTest/src/BSArgs.h b/tests/device/libraries/BSTest/src/BSArgs.h
index 9c0971faa7..fd999be040 100644
--- a/tests/device/libraries/BSTest/src/BSArgs.h
+++ b/tests/device/libraries/BSTest/src/BSArgs.h
@@ -32,38 +32,39 @@ namespace protocol
     } split_state_t;
 
 /* helper macro, called when done with an argument */
-#define END_ARG()                      \
-    do                                 \
-    {                                  \
-        char_out     = 0;              \
-        argv[argc++] = next_arg_start; \
-        state        = SS_SPACE;       \
+#define END_ARG()                                                                                  \
+    do                                                                                             \
+    {                                                                                              \
+        char_out     = 0;                                                                          \
+        argv[argc++] = next_arg_start;                                                             \
+        state        = SS_SPACE;                                                                   \
     } while (0);
 
     /**
- * @brief Split command line into arguments in place
- *
- * - This function finds whitespace-separated arguments in the given input line.
- *
- *     'abc def 1 20 .3' -> [ 'abc', 'def', '1', '20', '.3' ]
- *
- * - Argument which include spaces may be surrounded with quotes. In this case
- *   spaces are preserved and quotes are stripped.
- *
- *     'abc "123 456" def' -> [ 'abc', '123 456', 'def' ]
- *
- * - Escape sequences may be used to produce backslash, double quote, and space:
- *
- *     'a\ b\\c\"' -> [ 'a b\c"' ]
- *
- * Pointers to at most argv_size - 1 arguments are returned in argv array.
- * The pointer after the last one (i.e. argv[argc]) is set to NULL.
- *
- * @param line pointer to buffer to parse; it is modified in place
- * @param argv array where the pointers to arguments are written
- * @param argv_size number of elements in argv_array (max. number of arguments will be argv_size - 1)
- * @return number of arguments found (argc)
- */
+     * @brief Split command line into arguments in place
+     *
+     * - This function finds whitespace-separated arguments in the given input line.
+     *
+     *     'abc def 1 20 .3' -> [ 'abc', 'def', '1', '20', '.3' ]
+     *
+     * - Argument which include spaces may be surrounded with quotes. In this case
+     *   spaces are preserved and quotes are stripped.
+     *
+     *     'abc "123 456" def' -> [ 'abc', '123 456', 'def' ]
+     *
+     * - Escape sequences may be used to produce backslash, double quote, and space:
+     *
+     *     'a\ b\\c\"' -> [ 'a b\c"' ]
+     *
+     * Pointers to at most argv_size - 1 arguments are returned in argv array.
+     * The pointer after the last one (i.e. argv[argc]) is set to NULL.
+     *
+     * @param line pointer to buffer to parse; it is modified in place
+     * @param argv array where the pointers to arguments are written
+     * @param argv_size number of elements in argv_array (max. number of arguments will be argv_size
+     * - 1)
+     * @return number of arguments found (argc)
+     */
     inline size_t split_args(char* line, char** argv, size_t argv_size)
     {
         const int     QUOTE          = '"';
@@ -174,4 +175,4 @@ namespace protocol
 
 }  // namespace bs
 
-#endif  //BS_ARGS_H
+#endif  // BS_ARGS_H
diff --git a/tests/device/libraries/BSTest/src/BSProtocol.h b/tests/device/libraries/BSTest/src/BSProtocol.h
index 7c4d064d9c..64775e846e 100644
--- a/tests/device/libraries/BSTest/src/BSProtocol.h
+++ b/tests/device/libraries/BSTest/src/BSProtocol.h
@@ -12,13 +12,14 @@ namespace bs
 namespace protocol
 {
     template <typename IO>
-    void output_test_start(IO& io, const char* file, size_t line, const char* name, const char* desc)
+    void output_test_start(IO& io, const char* file, size_t line, const char* name,
+                           const char* desc)
     {
-        io.printf(BS_LINE_PREFIX "start file=\"%s\" line=%d name=\"%s\" desc=\"%s\"\n", file, line, name, desc);
+        io.printf(BS_LINE_PREFIX "start file=\"%s\" line=%d name=\"%s\" desc=\"%s\"\n", file, line,
+                  name, desc);
     }
 
-    template <typename IO>
-    void output_check_failure(IO& io, size_t line)
+    template <typename IO> void output_check_failure(IO& io, size_t line)
     {
         io.printf(BS_LINE_PREFIX "check_failure line=%d\n", line);
     }
@@ -26,11 +27,11 @@ namespace protocol
     template <typename IO>
     void output_test_end(IO& io, bool success, size_t checks, size_t failed_checks, size_t line = 0)
     {
-        io.printf(BS_LINE_PREFIX "end line=%d result=%d checks=%d failed_checks=%d\n", line, success, checks, failed_checks);
+        io.printf(BS_LINE_PREFIX "end line=%d result=%d checks=%d failed_checks=%d\n", line,
+                  success, checks, failed_checks);
     }
 
-    template <typename IO>
-    void output_menu_begin(IO& io)
+    template <typename IO> void output_menu_begin(IO& io)
     {
         io.printf(BS_LINE_PREFIX "menu_begin\n");
     }
@@ -41,27 +42,20 @@ namespace protocol
         io.printf(BS_LINE_PREFIX "item id=%d name=\"%s\" desc=\"%s\"\n", index, name, desc);
     }
 
-    template <typename IO>
-    void output_menu_end(IO& io)
-    {
-        io.printf(BS_LINE_PREFIX "menu_end\n");
-    }
+    template <typename IO> void output_menu_end(IO& io) { io.printf(BS_LINE_PREFIX "menu_end\n"); }
 
-    template <typename IO>
-    void output_setenv_result(IO& io, const char* key, const char* value)
+    template <typename IO> void output_setenv_result(IO& io, const char* key, const char* value)
     {
         io.printf(BS_LINE_PREFIX "setenv key=\"%s\" value=\"%s\"\n", key, value);
     }
 
-    template <typename IO>
-    void output_getenv_result(IO& io, const char* key, const char* value)
+    template <typename IO> void output_getenv_result(IO& io, const char* key, const char* value)
     {
         (void)key;
         io.printf(BS_LINE_PREFIX "getenv value=\"%s\"\n", value);
     }
 
-    template <typename IO>
-    void output_pretest_result(IO& io, bool res)
+    template <typename IO> void output_pretest_result(IO& io, bool res)
     {
         io.printf(BS_LINE_PREFIX "pretest result=%d\n", res ? 1 : 0);
     }
@@ -124,4 +118,4 @@ namespace protocol
 }  // namespace protocol
 }  // namespace bs
 
-#endif  //BS_PROTOCOL_H
+#endif  // BS_PROTOCOL_H
diff --git a/tests/device/libraries/BSTest/src/BSStdio.h b/tests/device/libraries/BSTest/src/BSStdio.h
index 892ecaa9d4..37feff5fd6 100644
--- a/tests/device/libraries/BSTest/src/BSStdio.h
+++ b/tests/device/libraries/BSTest/src/BSStdio.h
@@ -9,9 +9,7 @@ namespace bs
 class StdIOHelper
 {
 public:
-    StdIOHelper()
-    {
-    }
+    StdIOHelper() { }
 
     size_t printf(const char* format, ...)
     {
@@ -41,11 +39,8 @@ class StdIOHelper
 
 typedef StdIOHelper IOHelper;
 
-inline void fatal()
-{
-    throw std::runtime_error("fatal error");
-}
+inline void fatal() { throw std::runtime_error("fatal error"); }
 
 }  // namespace bs
 
-#endif  //BS_STDIO_H
+#endif  // BS_STDIO_H
diff --git a/tests/device/libraries/BSTest/src/BSTest.h b/tests/device/libraries/BSTest/src/BSTest.h
index 5acf7dc22c..c93a398b3e 100644
--- a/tests/device/libraries/BSTest/src/BSTest.h
+++ b/tests/device/libraries/BSTest/src/BSTest.h
@@ -25,8 +25,10 @@ typedef void (*test_case_func_t)();
 class TestCase
 {
 public:
-    TestCase(TestCase* prev, test_case_func_t func, const char* file, size_t line, const char* name, const char* desc) :
-        m_func(func), m_file(file), m_line(line), m_name(name), m_desc(desc)
+    TestCase(TestCase* prev, test_case_func_t func, const char* file, size_t line, const char* name,
+             const char* desc) :
+        m_func(func),
+        m_file(file), m_line(line), m_name(name), m_desc(desc)
     {
         if (prev)
         {
@@ -34,35 +36,17 @@ class TestCase
         }
     }
 
-    void run() const
-    {
-        (*m_func)();
-    }
+    void run() const { (*m_func)(); }
 
-    TestCase* next() const
-    {
-        return m_next;
-    }
+    TestCase* next() const { return m_next; }
 
-    const char* file() const
-    {
-        return m_file;
-    }
+    const char* file() const { return m_file; }
 
-    size_t line() const
-    {
-        return m_line;
-    }
+    size_t line() const { return m_line; }
 
-    const char* name() const
-    {
-        return m_name;
-    }
+    const char* name() const { return m_name; }
 
-    const char* desc() const
-    {
-        return (m_desc) ? m_desc : "";
-    }
+    const char* desc() const { return (m_desc) ? m_desc : ""; }
 
 protected:
     TestCase*        m_next = nullptr;
@@ -75,7 +59,8 @@ class TestCase
 
 struct Registry
 {
-    void add(test_case_func_t func, const char* file, size_t line, const char* name, const char* desc)
+    void add(test_case_func_t func, const char* file, size_t line, const char* name,
+             const char* desc)
     {
         TestCase* tc = new TestCase(m_last, func, file, line, name, desc);
         if (!m_first)
@@ -98,14 +83,12 @@ struct Env
 
 extern Env g_env;
 
-template <typename IO>
-class Runner
+template <typename IO> class Runner
 {
     typedef Runner<IO> Tself;
 
 public:
-    Runner(IO& io) :
-        m_io(io)
+    Runner(IO& io) : m_io(io)
     {
         g_env.m_check_pass = std::bind(&Tself::check_pass, this);
         g_env.m_check_fail = std::bind(&Tself::check_fail, this, std::placeholders::_1);
@@ -126,10 +109,7 @@ class Runner
         } while (do_menu());
     }
 
-    void check_pass()
-    {
-        ++m_check_pass_count;
-    }
+    void check_pass() { ++m_check_pass_count; }
 
     void check_fail(size_t line)
     {
@@ -139,7 +119,8 @@ class Runner
 
     void fail(size_t line)
     {
-        protocol::output_test_end(m_io, false, m_check_pass_count + m_check_fail_count, m_check_fail_count, line);
+        protocol::output_test_end(m_io, false, m_check_pass_count + m_check_fail_count,
+                                  m_check_fail_count, line);
         bs::fatal();
     }
 
@@ -177,7 +158,8 @@ class Runner
             protocol::output_test_start(m_io, tc->file(), tc->line(), tc->name(), tc->desc());
             tc->run();
             bool success = m_check_fail_count == 0;
-            protocol::output_test_end(m_io, success, m_check_pass_count + m_check_fail_count, m_check_fail_count);
+            protocol::output_test_end(m_io, success, m_check_pass_count + m_check_fail_count,
+                                      m_check_fail_count);
         }
     }
 
@@ -190,7 +172,8 @@ class Runner
 class AutoReg
 {
 public:
-    AutoReg(test_case_func_t func, const char* file, size_t line, const char* name, const char* desc = nullptr)
+    AutoReg(test_case_func_t func, const char* file, size_t line, const char* name,
+            const char* desc = nullptr)
     {
         g_env.m_registry.add(func, file, line, name, desc);
     }
@@ -227,29 +210,30 @@ inline void require(bool condition, size_t line)
 #define BS_NAME_LINE(name, line) BS_NAME_LINE2(name, line)
 #define BS_UNIQUE_NAME(name) BS_NAME_LINE(name, __LINE__)
 
-#define TEST_CASE(...)                                                                                             \
-    static void BS_UNIQUE_NAME(TEST_FUNC__)();                                                                     \
-    namespace                                                                                                      \
-    {                                                                                                              \
-        bs::AutoReg BS_UNIQUE_NAME(test_autoreg__)(&BS_UNIQUE_NAME(TEST_FUNC__), __FILE__, __LINE__, __VA_ARGS__); \
-    }                                                                                                              \
+#define TEST_CASE(...)                                                                             \
+    static void BS_UNIQUE_NAME(TEST_FUNC__)();                                                     \
+    namespace                                                                                      \
+    {                                                                                              \
+        bs::AutoReg BS_UNIQUE_NAME(test_autoreg__)(&BS_UNIQUE_NAME(TEST_FUNC__), __FILE__,         \
+                                                   __LINE__, __VA_ARGS__);                         \
+    }                                                                                              \
     static void BS_UNIQUE_NAME(TEST_FUNC__)()
 
 #define CHECK(condition) bs::check((condition), __LINE__)
 #define REQUIRE(condition) bs::require((condition), __LINE__)
 #define FAIL() bs::g_env.m_fail(__LINE__)
 
-#define BS_ENV_DECLARE() \
-    namespace bs         \
-    {                    \
-        Env g_env;       \
-    }
-#define BS_RUN(...)                                                  \
-    do                                                               \
-    {                                                                \
-        bs::IOHelper             helper = bs::IOHelper(__VA_ARGS__); \
-        bs::Runner<bs::IOHelper> runner(helper);                     \
-        runner.run();                                                \
+#define BS_ENV_DECLARE()                                                                           \
+    namespace bs                                                                                   \
+    {                                                                                              \
+        Env g_env;                                                                                 \
+    }
+#define BS_RUN(...)                                                                                \
+    do                                                                                             \
+    {                                                                                              \
+        bs::IOHelper             helper = bs::IOHelper(__VA_ARGS__);                               \
+        bs::Runner<bs::IOHelper> runner(helper);                                                   \
+        runner.run();                                                                              \
     } while (0);
 
-#endif  //BSTEST_H
+#endif  // BSTEST_H
diff --git a/tests/device/libraries/BSTest/test/test.cpp b/tests/device/libraries/BSTest/test/test.cpp
index 553f8013be..fc344d474d 100644
--- a/tests/device/libraries/BSTest/test/test.cpp
+++ b/tests/device/libraries/BSTest/test/test.cpp
@@ -40,14 +40,9 @@ TEST_CASE("another test which fails and crashes", "[bluesmoke][fail]")
     REQUIRE(false);
 }
 
-TEST_CASE("third test which should be skipped", "[.]")
-{
-    FAIL();
-}
+TEST_CASE("third test which should be skipped", "[.]") { FAIL(); }
 
-TEST_CASE("this test also runs successfully", "[bluesmoke]")
-{
-}
+TEST_CASE("this test also runs successfully", "[bluesmoke]") { }
 
 TEST_CASE("environment variables can be set and read from python", "[bluesmoke]")
 {
diff --git a/tests/device/test_libc/libm_string.c b/tests/device/test_libc/libm_string.c
index 5ee879c11a..9a19da58a4 100644
--- a/tests/device/test_libc/libm_string.c
+++ b/tests/device/test_libc/libm_string.c
@@ -22,9 +22,7 @@ static int   errors = 0;
 /* Complain if condition is not true.  */
 #define check(thing) checkit(thing, __LINE__)
 
-static void
-_DEFUN(checkit, (ok, l),
-       int ok _AND int l)
+static void _DEFUN(checkit, (ok, l), int ok _AND int l)
 
 {
     //  newfunc(it);
@@ -40,9 +38,7 @@ _DEFUN(checkit, (ok, l),
 /* Complain if first two args don't strcmp as equal.  */
 #define equal(a, b) funcqual(a, b, __LINE__);
 
-static void
-_DEFUN(funcqual, (a, b, l),
-       char* a _AND char* b _AND int l)
+static void _DEFUN(funcqual, (a, b, l), char* a _AND char* b _AND int l)
 {
     //  newfunc(it);
 
@@ -117,7 +113,7 @@ void libm_test_string()
     equal(one, "cd");
 
     /* strncat - first test it as strcat, with big counts,
-     then test the count mechanism.  */
+       then test the count mechanism.  */
     it = "strncat";
     (void)strcpy(one, "ijk");
     check(strncat(one, "lmn", 99) == one); /* Returned value. */
@@ -506,7 +502,7 @@ void libm_test_string()
     equal(one, "ax\045xe"); /* Unsigned char convert. */
 
     /* bcopy - much like memcpy.
-     Berklix manual is silent about overlap, so don't test it.  */
+       Berklix manual is silent about overlap, so don't test it.  */
     it = "bcopy";
     (void)bcopy("abc", one, 4);
     equal(one, "abc"); /* Simple copy. */
diff --git a/tests/device/test_libc/memcpy-1.c b/tests/device/test_libc/memcpy-1.c
index a7fb9e9169..02c536ed98 100644
--- a/tests/device/test_libc/memcpy-1.c
+++ b/tests/device/test_libc/memcpy-1.c
@@ -68,8 +68,7 @@
 #define TOO_MANY_ERRORS 11
 static int errors = 0;
 
-static void
-print_error(char const* msg, ...)
+static void print_error(char const* msg, ...)
 {
     errors++;
     if (errors == TOO_MANY_ERRORS)
@@ -108,12 +107,12 @@ void       memcpy_main(void)
     }
 
     /* Make calls to memcpy with block sizes ranging between 1 and
-     MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
+       MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
     for (sa = 0; sa <= MAX_OFFSET; sa++)
         for (da = 0; da <= MAX_OFFSET; da++)
             for (n = 1; n <= MAX_BLOCK_SIZE; n++)
             {
-                //printf (".");
+                // printf (".");
                 /* Zero dest so we can check it properly after the copying.  */
                 for (j = 0; j < BUFF_SIZE; j++)
                     dest[j] = 0;
@@ -129,8 +128,8 @@ void       memcpy_main(void)
                                 n, sa, da, ret, dest + START_COPY + da);
 
                 /* Check that content of the destination buffer
-             is the same as the source buffer, and
-             memory outside destination buffer is not modified.  */
+                   is the same as the source buffer, and
+                   memory outside destination buffer is not modified.  */
                 for (j = 0; j < BUFF_SIZE; j++)
                     if ((unsigned)j < START_COPY + da)
                     {
diff --git a/tests/device/test_libc/memmove1.c b/tests/device/test_libc/memmove1.c
index 6fd2ceabef..8a6403ee94 100644
--- a/tests/device/test_libc/memmove1.c
+++ b/tests/device/test_libc/memmove1.c
@@ -55,18 +55,17 @@
 #define TOO_MANY_ERRORS 11
 int errors = 0;
 
-#define DEBUGP                              \
-    if (errors == TOO_MANY_ERRORS)          \
-        printf("Further errors omitted\n"); \
-    else if (errors < TOO_MANY_ERRORS)      \
+#define DEBUGP                                                                                     \
+    if (errors == TOO_MANY_ERRORS)                                                                 \
+        printf("Further errors omitted\n");                                                        \
+    else if (errors < TOO_MANY_ERRORS)                                                             \
     printf
 
 /* A safe target-independent memmove.  */
 
 void mymemmove(unsigned char* dest, unsigned char* src, size_t n)
 {
-    if ((src <= dest && src + n <= dest)
-        || src >= dest)
+    if ((src <= dest && src + n <= dest) || src >= dest)
         while (n-- > 0)
             *dest++ = *src++;
     else
@@ -80,8 +79,7 @@ void mymemmove(unsigned char* dest, unsigned char* src, size_t n)
 
 /* It's either the noinline attribute or forcing the test framework to
    pass -fno-builtin-memmove.  */
-void xmemmove(unsigned char* dest, unsigned char* src, size_t n)
-    __attribute__((__noinline__));
+void xmemmove(unsigned char* dest, unsigned char* src, size_t n) __attribute__((__noinline__));
 
 void xmemmove(unsigned char* dest, unsigned char* src, size_t n)
 {
@@ -91,8 +89,7 @@ void xmemmove(unsigned char* dest, unsigned char* src, size_t n)
     if (retp != dest)
     {
         errors++;
-        DEBUGP("memmove of n bytes returned %p instead of dest=%p\n",
-               retp, dest);
+        DEBUGP("memmove of n bytes returned %p instead of dest=%p\n", retp, dest);
     }
 }
 
@@ -112,8 +109,8 @@ void memmove_main(void)
     int    errors = 0;
 
     /* Leave some room before and after the area tested, so we can detect
-     overwrites of up to N bytes, N being the amount tested.  If you
-     want to test using valgrind, make these malloced instead.  */
+       overwrites of up to N bytes, N being the amount tested.  If you
+       want to test using valgrind, make these malloced instead.  */
     unsigned char from_test[MAX * 3];
     unsigned char to_test[MAX * 3];
     unsigned char from_known[MAX * 3];
@@ -123,7 +120,7 @@ void memmove_main(void)
     for (i = 0; i < MAX; i++)
     {
         /* Do the memmove first before setting the known array, so we know
-         it didn't change any of the known array.  */
+           it didn't change any of the known array.  */
         fill(from_test);
         fill(to_test);
         xmemmove(to_test + MAX, 1 + from_test + MAX, i);
diff --git a/tests/device/test_libc/strcmp-1.c b/tests/device/test_libc/strcmp-1.c
index d51e14b46c..e8663b9ba9 100644
--- a/tests/device/test_libc/strcmp-1.c
+++ b/tests/device/test_libc/strcmp-1.c
@@ -110,8 +110,7 @@ static int errors = 0;
 
 const char* testname = "strcmp";
 
-static void
-print_error(char const* msg, ...)
+static void print_error(char const* msg, ...)
 {
     errors++;
     if (errors == TOO_MANY_ERRORS)
@@ -147,7 +146,7 @@ void       strcmp_main(void)
     int      ret;
 
     /* Make calls to strcmp with block sizes ranging between 1 and
-     MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
+       MAX_BLOCK_SIZE bytes, aligned and misaligned source and destination.  */
     for (sa = 0; sa <= MAX_OFFSET; sa++)
         for (da = 0; da <= MAX_OFFSET; da++)
             for (n = 1; n <= MAX_BLOCK_SIZE; n++)
@@ -277,12 +276,12 @@ void       strcmp_main(void)
     if (ret >= 0)
         print_error("\nFailed: expected negative, return %d\n", ret);
 
-    //printf ("\n");
+    // printf ("\n");
     if (errors != 0)
     {
         printf("ERROR. FAILED.\n");
         abort();
     }
-    //exit (0);
+    // exit (0);
     printf("ok\n");
 }
diff --git a/tests/device/test_libc/tstring.c b/tests/device/test_libc/tstring.c
index 8d1f242f5e..7d508d4c6e 100644
--- a/tests/device/test_libc/tstring.c
+++ b/tests/device/test_libc/tstring.c
@@ -29,11 +29,10 @@
 void eprintf(int line, char* result, char* expected, int size)
 {
     if (size != 0)
-        printf("Failure at line %d, result is <%.*s>, should be <%s> of size %d\n",
-               line, size, result, expected, size);
+        printf("Failure at line %d, result is <%.*s>, should be <%s> of size %d\n", line, size,
+               result, expected, size);
     else
-        printf("Failure at line %d, result is <%s>, should be <%s>\n",
-               line, result, expected);
+        printf("Failure at line %d, result is <%s>, should be <%s>\n", line, result, expected);
 }
 
 void mycopy(char* target, char* source, int size)
@@ -87,21 +86,25 @@ void tstring_main(void)
     tmp2[0] = 'Z';
     tmp2[1] = '\0';
 
-    if (memset(target, 'X', 0) != target || memcpy(target, "Y", 0) != target || memmove(target, "K", 0) != target || strncpy(tmp2, "4", 0) != tmp2 || strncat(tmp2, "123", 0) != tmp2 || strcat(target, "") != target)
+    if (memset(target, 'X', 0) != target || memcpy(target, "Y", 0) != target
+        || memmove(target, "K", 0) != target || strncpy(tmp2, "4", 0) != tmp2
+        || strncat(tmp2, "123", 0) != tmp2 || strcat(target, "") != target)
     {
         eprintf(__LINE__, target, "A", 0);
         test_failed = 1;
     }
 
     if (strcmp(target, "A") || strlen(target) != 1 || memchr(target, 'A', 0) != NULL
-        || memcmp(target, "J", 0) || strncmp(target, "A", 1) || strncmp(target, "J", 0) || tmp2[0] != 'Z' || tmp2[1] != '\0')
+        || memcmp(target, "J", 0) || strncmp(target, "A", 1) || strncmp(target, "J", 0)
+        || tmp2[0] != 'Z' || tmp2[1] != '\0')
     {
         eprintf(__LINE__, target, "A", 0);
         test_failed = 1;
     }
 
     tmp2[2] = 'A';
-    if (strcpy(target, "") != target || strncpy(tmp2, "", 4) != tmp2 || strcat(target, "") != target)
+    if (strcpy(target, "") != target || strncpy(tmp2, "", 4) != tmp2
+        || strcat(target, "") != target)
     {
         eprintf(__LINE__, target, "", 0);
         test_failed = 1;
@@ -120,13 +123,17 @@ void tstring_main(void)
         test_failed = 1;
     }
 
-    if (strcpy(tmp3, target) != tmp3 || strcat(tmp3, "X") != tmp3 || strncpy(tmp2, "X", 2) != tmp2 || memset(target, tmp2[0], 1) != target)
+    if (strcpy(tmp3, target) != tmp3 || strcat(tmp3, "X") != tmp3 || strncpy(tmp2, "X", 2) != tmp2
+        || memset(target, tmp2[0], 1) != target)
     {
         eprintf(__LINE__, target, "X", 0);
         test_failed = 1;
     }
 
-    if (strcmp(target, "X") || strlen(target) != 1 || memchr(target, 'X', 2) != target || strchr(target, 'X') != target || memchr(target, 'Y', 2) != NULL || strchr(target, 'Y') != NULL || strcmp(tmp3, target) || strncmp(tmp3, target, 2) || memcmp(target, "K", 0) || strncmp(target, tmp3, 3))
+    if (strcmp(target, "X") || strlen(target) != 1 || memchr(target, 'X', 2) != target
+        || strchr(target, 'X') != target || memchr(target, 'Y', 2) != NULL
+        || strchr(target, 'Y') != NULL || strcmp(tmp3, target) || strncmp(tmp3, target, 2)
+        || memcmp(target, "K", 0) || strncmp(target, tmp3, 3))
     {
         eprintf(__LINE__, target, "X", 0);
         test_failed = 1;
@@ -139,14 +146,17 @@ void tstring_main(void)
     }
 
     target[2] = '\0';
-    if (memcmp(target, "YY", 2) || strcmp(target, "YY") || strlen(target) != 2 || memchr(target, 'Y', 2) != target || strcmp(tmp3, target) || strncmp(target, tmp3, 3) || strncmp(target, tmp3, 4) || strncmp(target, tmp3, 2) || strchr(target, 'Y') != target)
+    if (memcmp(target, "YY", 2) || strcmp(target, "YY") || strlen(target) != 2
+        || memchr(target, 'Y', 2) != target || strcmp(tmp3, target) || strncmp(target, tmp3, 3)
+        || strncmp(target, tmp3, 4) || strncmp(target, tmp3, 2) || strchr(target, 'Y') != target)
     {
         eprintf(__LINE__, target, "YY", 2);
         test_failed = 1;
     }
 
     strcpy(target, "WW");
-    if (memcmp(target, "WW", 2) || strcmp(target, "WW") || strlen(target) != 2 || memchr(target, 'W', 2) != target || strchr(target, 'W') != target)
+    if (memcmp(target, "WW", 2) || strcmp(target, "WW") || strlen(target) != 2
+        || memchr(target, 'W', 2) != target || strchr(target, 'W') != target)
     {
         eprintf(__LINE__, target, "WW", 2);
         test_failed = 1;
@@ -158,7 +168,8 @@ void tstring_main(void)
         test_failed = 1;
     }
 
-    if (strcpy(tmp3, "ZZ") != tmp3 || strcat(tmp3, "Z") != tmp3 || memcpy(tmp4, "Z", 2) != tmp4 || strcat(tmp4, "ZZ") != tmp4 || memset(target, 'Z', 3) != target)
+    if (strcpy(tmp3, "ZZ") != tmp3 || strcat(tmp3, "Z") != tmp3 || memcpy(tmp4, "Z", 2) != tmp4
+        || strcat(tmp4, "ZZ") != tmp4 || memset(target, 'Z', 3) != target)
     {
         eprintf(__LINE__, target, "ZZZ", 3);
         test_failed = 1;
@@ -167,21 +178,26 @@ void tstring_main(void)
     target[3] = '\0';
     tmp5[0]   = '\0';
     strncat(tmp5, "123", 2);
-    if (memcmp(target, "ZZZ", 3) || strcmp(target, "ZZZ") || strcmp(tmp3, target) || strcmp(tmp4, target) || strncmp(target, "ZZZ", 4) || strncmp(target, "ZZY", 3) <= 0 || strncmp("ZZY", target, 4) >= 0 || memcmp(tmp5, "12", 3) || strlen(target) != 3)
+    if (memcmp(target, "ZZZ", 3) || strcmp(target, "ZZZ") || strcmp(tmp3, target)
+        || strcmp(tmp4, target) || strncmp(target, "ZZZ", 4) || strncmp(target, "ZZY", 3) <= 0
+        || strncmp("ZZY", target, 4) >= 0 || memcmp(tmp5, "12", 3) || strlen(target) != 3)
     {
         eprintf(__LINE__, target, "ZZZ", 3);
         test_failed = 1;
     }
 
     target[2] = 'K';
-    if (memcmp(target, "ZZZ", 2) || strcmp(target, "ZZZ") >= 0 || memcmp(target, "ZZZ", 3) >= 0 || strlen(target) != 3 || memchr(target, 'K', 3) != target + 2 || strncmp(target, "ZZZ", 2) || strncmp(target, "ZZZ", 4) >= 0 || strchr(target, 'K') != target + 2)
+    if (memcmp(target, "ZZZ", 2) || strcmp(target, "ZZZ") >= 0 || memcmp(target, "ZZZ", 3) >= 0
+        || strlen(target) != 3 || memchr(target, 'K', 3) != target + 2 || strncmp(target, "ZZZ", 2)
+        || strncmp(target, "ZZZ", 4) >= 0 || strchr(target, 'K') != target + 2)
     {
         eprintf(__LINE__, target, "ZZK", 3);
         test_failed = 1;
     }
 
     strcpy(target, "AAA");
-    if (memcmp(target, "AAA", 3) || strcmp(target, "AAA") || strncmp(target, "AAA", 3) || strlen(target) != 3)
+    if (memcmp(target, "AAA", 3) || strcmp(target, "AAA") || strncmp(target, "AAA", 3)
+        || strlen(target) != 3)
     {
         eprintf(__LINE__, target, "AAA", 3);
         test_failed = 1;
@@ -193,7 +209,7 @@ void tstring_main(void)
         for (i = j - 1; i <= j + 1; ++i)
         {
             /* don't bother checking unaligned data in the larger
-	     sizes since it will waste time without performing additional testing */
+               sizes since it will waste time without performing additional testing */
             if ((size_t)i <= 16 * sizeof(long))
             {
                 align_test_iterations = 2 * sizeof(long);
@@ -235,7 +251,8 @@ void tstring_main(void)
                     test_failed = 1;
                 }
                 tmp2[i - z] = first_char + 1;
-                if (memmove(tmp2 + z + 1, tmp2 + z, i - z - 1) != tmp2 + z + 1 || memset(tmp3, first_char, i) != tmp3)
+                if (memmove(tmp2 + z + 1, tmp2 + z, i - z - 1) != tmp2 + z + 1
+                    || memset(tmp3, first_char, i) != tmp3)
                 {
                     printf("error at line %d\n", __LINE__);
                     test_failed = 1;
@@ -256,7 +273,15 @@ void tstring_main(void)
 
                 (void)strchr(tmp1, second_char);
 
-                if (memcmp(tmp1, expected, i) || strcmp(tmp1, expected) || strncmp(tmp1, expected, i) || strncmp(tmp1, expected, i + 1) || strcmp(tmp1, tmp2) >= 0 || memcmp(tmp1, tmp2, i) >= 0 || strncmp(tmp1, tmp2, i + 1) >= 0 || (int)strlen(tmp1) != i || memchr(tmp1, first_char, i) != tmp1 || strchr(tmp1, first_char) != tmp1 || memchr(tmp1, second_char, i) != tmp1 + z || strchr(tmp1, second_char) != tmp1 + z || strcmp(tmp5, tmp6) || strncat(tmp7, tmp1, i + 2) != tmp7 || strcmp(tmp7, tmp6) || tmp7[2 * i + z] != second_char)
+                if (memcmp(tmp1, expected, i) || strcmp(tmp1, expected)
+                    || strncmp(tmp1, expected, i) || strncmp(tmp1, expected, i + 1)
+                    || strcmp(tmp1, tmp2) >= 0 || memcmp(tmp1, tmp2, i) >= 0
+                    || strncmp(tmp1, tmp2, i + 1) >= 0 || (int)strlen(tmp1) != i
+                    || memchr(tmp1, first_char, i) != tmp1 || strchr(tmp1, first_char) != tmp1
+                    || memchr(tmp1, second_char, i) != tmp1 + z
+                    || strchr(tmp1, second_char) != tmp1 + z || strcmp(tmp5, tmp6)
+                    || strncat(tmp7, tmp1, i + 2) != tmp7 || strcmp(tmp7, tmp6)
+                    || tmp7[2 * i + z] != second_char)
                 {
                     eprintf(__LINE__, tmp1, expected, 0);
                     printf("x is %d\n", x);
@@ -271,15 +296,16 @@ void tstring_main(void)
                 {
                     if (memcmp(tmp3, tmp4, i - k + 1) != 0 || strncmp(tmp3, tmp4, i - k + 1) != 0)
                     {
-                        printf("Failure at line %d, comparing %.*s with %.*s\n",
-                               __LINE__, i, tmp3, i, tmp4);
+                        printf("Failure at line %d, comparing %.*s with %.*s\n", __LINE__, i, tmp3,
+                               i, tmp4);
                         test_failed = 1;
                     }
                     tmp4[i - k] = first_char + 1;
-                    if (memcmp(tmp3, tmp4, i) >= 0 || strncmp(tmp3, tmp4, i) >= 0 || memcmp(tmp4, tmp3, i) <= 0 || strncmp(tmp4, tmp3, i) <= 0)
+                    if (memcmp(tmp3, tmp4, i) >= 0 || strncmp(tmp3, tmp4, i) >= 0
+                        || memcmp(tmp4, tmp3, i) <= 0 || strncmp(tmp4, tmp3, i) <= 0)
                     {
-                        printf("Failure at line %d, comparing %.*s with %.*s\n",
-                               __LINE__, i, tmp3, i, tmp4);
+                        printf("Failure at line %d, comparing %.*s with %.*s\n", __LINE__, i, tmp3,
+                               i, tmp4);
                         test_failed = 1;
                     }
                     tmp4[i - k] = first_char;
diff --git a/tests/host/common/Arduino.cpp b/tests/host/common/Arduino.cpp
index b67d2d429e..ba9fea1dd4 100644
--- a/tests/host/common/Arduino.cpp
+++ b/tests/host/common/Arduino.cpp
@@ -1,14 +1,14 @@
 /*
  Arduino.cpp - Mocks for common Arduino APIs
  Copyright © 2016 Ivan Grokhotkov
- 
+
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:
- 
+
  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.
 */
@@ -41,10 +41,7 @@ extern "C" unsigned long micros()
     return ((time.tv_sec - gtod0.tv_sec) * 1000000) + time.tv_usec - gtod0.tv_usec;
 }
 
-extern "C" void yield()
-{
-    run_scheduled_recurrent_functions();
-}
+extern "C" void yield() { run_scheduled_recurrent_functions(); }
 
 extern "C" void loop_end()
 {
@@ -52,32 +49,17 @@ extern "C" void loop_end()
     run_scheduled_recurrent_functions();
 }
 
-extern "C" bool can_yield()
-{
-    return true;
-}
+extern "C" bool can_yield() { return true; }
 
-extern "C" void optimistic_yield(uint32_t interval_us)
-{
-    (void)interval_us;
-}
+extern "C" void optimistic_yield(uint32_t interval_us) { (void)interval_us; }
 
-extern "C" void esp_suspend()
-{
-}
+extern "C" void esp_suspend() { }
 
-extern "C" void esp_schedule()
-{
-}
+extern "C" void esp_schedule() { }
 
-extern "C" void esp_yield()
-{
-}
+extern "C" void esp_yield() { }
 
-extern "C" void esp_delay(unsigned long ms)
-{
-    usleep(ms * 1000);
-}
+extern "C" void esp_delay(unsigned long ms) { usleep(ms * 1000); }
 
 bool esp_try_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms)
 {
@@ -98,18 +80,10 @@ extern "C" void __panic_func(const char* file, int line, const char* func)
     abort();
 }
 
-extern "C" void delay(unsigned long ms)
-{
-    esp_delay(ms);
-}
+extern "C" void delay(unsigned long ms) { esp_delay(ms); }
 
-extern "C" void delayMicroseconds(unsigned int us)
-{
-    usleep(us);
-}
+extern "C" void delayMicroseconds(unsigned int us) { usleep(us); }
 
 #include "cont.h"
 cont_t*         g_pcont = NULL;
-extern "C" void cont_suspend(cont_t*)
-{
-}
+extern "C" void cont_suspend(cont_t*) { }
diff --git a/tests/host/common/ArduinoCatch.cpp b/tests/host/common/ArduinoCatch.cpp
index c0e835495d..2a3404a931 100644
--- a/tests/host/common/ArduinoCatch.cpp
+++ b/tests/host/common/ArduinoCatch.cpp
@@ -1,14 +1,14 @@
 /*
  Arduino.cpp - Mocks for common Arduino APIs
  Copyright © 2016 Ivan Grokhotkov
- 
+
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:
- 
+
  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.
 */
diff --git a/tests/host/common/ArduinoMain.cpp b/tests/host/common/ArduinoMain.cpp
index 7a759011cf..80e0a0c85b 100644
--- a/tests/host/common/ArduinoMain.cpp
+++ b/tests/host/common/ArduinoMain.cpp
@@ -121,28 +121,27 @@ static uint8_t mock_read_uart(void)
 
 void help(const char* argv0, int exitcode)
 {
-    printf(
-        "%s - compiled with esp8266/arduino emulator\n"
-        "options:\n"
-        "\t-h\n"
-        "\tnetwork:\n"
-        "\t-i <interface> - use this interface for IP address\n"
-        "\t-l             - bind tcp/udp servers to interface only (not 0.0.0.0)\n"
-        "\t-s             - port shifter (default: %d, when root: 0)\n"
-        "\tterminal:\n"
-        "\t-b             - blocking tty/mocked-uart (default: not blocking tty)\n"
-        "\t-T             - show timestamp on output\n"
-        "\tFS:\n"
-        "\t-P             - path for fs-persistent files (default: %s-)\n"
-        "\t-S             - spiffs size in KBytes (default: %zd)\n"
-        "\t-L             - littlefs size in KBytes (default: %zd)\n"
-        "\t                 (spiffs, littlefs: negative value will force mismatched size)\n"
-        "\tgeneral:\n"
-        "\t-c             - ignore CTRL-C (send it via Serial)\n"
-        "\t-f             - no throttle (possibly 100%%CPU)\n"
-        "\t-1             - run loop once then exit (for host testing)\n"
-        "\t-v             - verbose\n",
-        argv0, MOCK_PORT_SHIFTER, argv0, spiffs_kb, littlefs_kb);
+    printf("%s - compiled with esp8266/arduino emulator\n"
+           "options:\n"
+           "\t-h\n"
+           "\tnetwork:\n"
+           "\t-i <interface> - use this interface for IP address\n"
+           "\t-l             - bind tcp/udp servers to interface only (not 0.0.0.0)\n"
+           "\t-s             - port shifter (default: %d, when root: 0)\n"
+           "\tterminal:\n"
+           "\t-b             - blocking tty/mocked-uart (default: not blocking tty)\n"
+           "\t-T             - show timestamp on output\n"
+           "\tFS:\n"
+           "\t-P             - path for fs-persistent files (default: %s-)\n"
+           "\t-S             - spiffs size in KBytes (default: %zd)\n"
+           "\t-L             - littlefs size in KBytes (default: %zd)\n"
+           "\t                 (spiffs, littlefs: negative value will force mismatched size)\n"
+           "\tgeneral:\n"
+           "\t-c             - ignore CTRL-C (send it via Serial)\n"
+           "\t-f             - no throttle (possibly 100%%CPU)\n"
+           "\t-1             - run loop once then exit (for host testing)\n"
+           "\t-v             - verbose\n",
+           argv0, MOCK_PORT_SHIFTER, argv0, spiffs_kb, littlefs_kb);
     exit(exitcode);
 }
 
diff --git a/tests/host/common/ClientContextSocket.cpp b/tests/host/common/ClientContextSocket.cpp
index 4586969ca2..a0bc7610d8 100644
--- a/tests/host/common/ClientContextSocket.cpp
+++ b/tests/host/common/ClientContextSocket.cpp
@@ -97,7 +97,9 @@ ssize_t mockFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize)
     {
         if (errno != EAGAIN)
         {
-            fprintf(stderr, MOCK "ClientContext::(read/peek fd=%i): filling buffer for %zd bytes: %s\n", sock, maxread, strerror(errno));
+            fprintf(stderr,
+                    MOCK "ClientContext::(read/peek fd=%i): filling buffer for %zd bytes: %s\n",
+                    sock, maxread, strerror(errno));
             // error
             return -1;
         }
@@ -108,12 +110,14 @@ ssize_t mockFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize)
     return ret;
 }
 
-ssize_t mockPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+ssize_t mockPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf,
+                      size_t& ccinbufsize)
 {
     // usersize==0: peekAvailable()
 
     if (usersize > CCBUFSIZE)
-        mockverbose("CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
+        mockverbose("CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE,
+                    usersize - CCBUFSIZE, usersize);
 
     struct pollfd p;
     size_t        retsize = 0;
@@ -156,7 +160,8 @@ ssize_t mockPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char
     return retsize;
 }
 
-ssize_t mockRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+ssize_t mockRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf,
+                 size_t& ccinbufsize)
 {
     ssize_t copied = mockPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
     if (copied < 0)
@@ -195,7 +200,8 @@ ssize_t mockWrite(int sock, const uint8_t* data, size_t size, int timeout_ms)
             }
             sent += ret;
             if (sent < size)
-                fprintf(stderr, MOCK "ClientContext::write: sent %d bytes (%zd / %zd)\n", ret, sent, size);
+                fprintf(stderr, MOCK "ClientContext::write: sent %d bytes (%zd / %zd)\n", ret, sent,
+                        size);
         }
     }
 #ifdef DEBUG_ESP_WIFI
diff --git a/tests/host/common/ClientContextTools.cpp b/tests/host/common/ClientContextTools.cpp
index 4e2abc31b4..cf9987fea0 100644
--- a/tests/host/common/ClientContextTools.cpp
+++ b/tests/host/common/ClientContextTools.cpp
@@ -37,7 +37,8 @@
 
 #include <netdb.h>  // gethostbyname
 
-err_t dns_gethostbyname(const char* hostname, ip_addr_t* addr, dns_found_callback found, void* callback_arg)
+err_t dns_gethostbyname(const char* hostname, ip_addr_t* addr, dns_found_callback found,
+                        void* callback_arg)
 {
     (void)callback_arg;
     (void)found;
diff --git a/tests/host/common/EEPROM.h b/tests/host/common/EEPROM.h
index dce99c7efd..a146c14475 100644
--- a/tests/host/common/EEPROM.h
+++ b/tests/host/common/EEPROM.h
@@ -45,8 +45,7 @@ class EEPROMClass
     bool    commit();
     void    end();
 
-    template <typename T>
-    T& get(int const address, T& t)
+    template <typename T> T& get(int const address, T& t)
     {
         if (address < 0 || address + sizeof(T) > _size)
             return t;
@@ -55,8 +54,7 @@ class EEPROMClass
         return t;
     }
 
-    template <typename T>
-    const T& put(int const address, const T& t)
+    template <typename T> const T& put(int const address, const T& t)
     {
         if (address < 0 || address + sizeof(T) > _size)
             return t;
@@ -67,7 +65,7 @@ class EEPROMClass
 
     size_t length() { return _size; }
 
-    //uint8_t& operator[](int const address) { return read(address); }
+    // uint8_t& operator[](int const address) { return read(address); }
     uint8_t operator[](int address) { return read(address); }
 
 protected:
diff --git a/tests/host/common/HostWiring.cpp b/tests/host/common/HostWiring.cpp
index 638457762e..dc93fd2f85 100644
--- a/tests/host/common/HostWiring.cpp
+++ b/tests/host/common/HostWiring.cpp
@@ -39,9 +39,9 @@
 
 void pinMode(uint8_t pin, uint8_t mode)
 {
-#define xxx(mode)            \
-    case mode:               \
-        m = STRHELPER(mode); \
+#define xxx(mode)                                                                                  \
+    case mode:                                                                                     \
+        m = STRHELPER(mode);                                                                       \
         break
     const char* m;
     switch (mode)
@@ -73,15 +73,9 @@ void pinMode(uint8_t pin, uint8_t mode)
     VERBOSE("gpio%d: mode='%s'\n", pin, m);
 }
 
-void digitalWrite(uint8_t pin, uint8_t val)
-{
-    VERBOSE("digitalWrite(pin=%d val=%d)\n", pin, val);
-}
+void digitalWrite(uint8_t pin, uint8_t val) { VERBOSE("digitalWrite(pin=%d val=%d)\n", pin, val); }
 
-void analogWrite(uint8_t pin, int val)
-{
-    VERBOSE("analogWrite(pin=%d, val=%d\n", pin, val);
-}
+void analogWrite(uint8_t pin, int val) { VERBOSE("analogWrite(pin=%d, val=%d\n", pin, val); }
 
 int analogRead(uint8_t pin)
 {
@@ -89,10 +83,7 @@ int analogRead(uint8_t pin)
     return 512;
 }
 
-void analogWriteRange(uint32_t range)
-{
-    VERBOSE("analogWriteRange(range=%d)\n", range);
-}
+void analogWriteRange(uint32_t range) { VERBOSE("analogWriteRange(range=%d)\n", range); }
 
 int digitalRead(uint8_t pin)
 {
diff --git a/tests/host/common/MockEEPROM.cpp b/tests/host/common/MockEEPROM.cpp
index f9a7ca2db5..34eda86d39 100644
--- a/tests/host/common/MockEEPROM.cpp
+++ b/tests/host/common/MockEEPROM.cpp
@@ -42,9 +42,7 @@
 
 #define EEPROM_FILE_NAME "eeprom"
 
-EEPROMClass::EEPROMClass()
-{
-}
+EEPROMClass::EEPROMClass() { }
 
 EEPROMClass::~EEPROMClass()
 {
@@ -55,10 +53,12 @@ EEPROMClass::~EEPROMClass()
 void EEPROMClass::begin(size_t size)
 {
     _size = size;
-    if ((_fd = open(EEPROM_FILE_NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1
+    if ((_fd = open(EEPROM_FILE_NAME, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))
+            == -1
         || ftruncate(_fd, size) == -1)
     {
-        fprintf(stderr, MOCK "EEPROM: cannot open/create '%s' for r/w: %s\n\r", EEPROM_FILE_NAME, strerror(errno));
+        fprintf(stderr, MOCK "EEPROM: cannot open/create '%s' for r/w: %s\n\r", EEPROM_FILE_NAME,
+                strerror(errno));
         _fd = -1;
     }
 }
@@ -69,10 +69,7 @@ void EEPROMClass::end()
         close(_fd);
 }
 
-bool EEPROMClass::commit()
-{
-    return true;
-}
+bool EEPROMClass::commit() { return true; }
 
 uint8_t EEPROMClass::read(int x)
 {
diff --git a/tests/host/common/MockEsp.cpp b/tests/host/common/MockEsp.cpp
index 6db348af55..42a70d7096 100644
--- a/tests/host/common/MockEsp.cpp
+++ b/tests/host/common/MockEsp.cpp
@@ -36,57 +36,27 @@
 
 #include <stdlib.h>
 
-unsigned long long operator"" _kHz(unsigned long long x)
-{
-    return x * 1000;
-}
+unsigned long long operator"" _kHz(unsigned long long x) { return x * 1000; }
 
-unsigned long long operator"" _MHz(unsigned long long x)
-{
-    return x * 1000 * 1000;
-}
+unsigned long long operator"" _MHz(unsigned long long x) { return x * 1000 * 1000; }
 
-unsigned long long operator"" _GHz(unsigned long long x)
-{
-    return x * 1000 * 1000 * 1000;
-}
+unsigned long long operator"" _GHz(unsigned long long x) { return x * 1000 * 1000 * 1000; }
 
-unsigned long long operator"" _kBit(unsigned long long x)
-{
-    return x * 1024;
-}
+unsigned long long operator"" _kBit(unsigned long long x) { return x * 1024; }
 
-unsigned long long operator"" _MBit(unsigned long long x)
-{
-    return x * 1024 * 1024;
-}
+unsigned long long operator"" _MBit(unsigned long long x) { return x * 1024 * 1024; }
 
-unsigned long long operator"" _GBit(unsigned long long x)
-{
-    return x * 1024 * 1024 * 1024;
-}
+unsigned long long operator"" _GBit(unsigned long long x) { return x * 1024 * 1024 * 1024; }
 
-unsigned long long operator"" _kB(unsigned long long x)
-{
-    return x * 1024;
-}
+unsigned long long operator"" _kB(unsigned long long x) { return x * 1024; }
 
-unsigned long long operator"" _MB(unsigned long long x)
-{
-    return x * 1024 * 1024;
-}
+unsigned long long operator"" _MB(unsigned long long x) { return x * 1024 * 1024; }
 
-unsigned long long operator"" _GB(unsigned long long x)
-{
-    return x * 1024 * 1024 * 1024;
-}
+unsigned long long operator"" _GB(unsigned long long x) { return x * 1024 * 1024 * 1024; }
 
 uint32_t _SPIFFS_start;
 
-void eboot_command_write(struct eboot_command* cmd)
-{
-    (void)cmd;
-}
+void eboot_command_write(struct eboot_command* cmd) { (void)cmd; }
 
 EspClass ESP;
 
@@ -96,10 +66,7 @@ void EspClass::restart()
     exit(EXIT_SUCCESS);
 }
 
-uint32_t EspClass::getChipId()
-{
-    return 0xee1337;
-}
+uint32_t EspClass::getChipId() { return 0xee1337; }
 
 bool EspClass::checkFlashConfig(bool needsEquals)
 {
@@ -107,40 +74,19 @@ bool EspClass::checkFlashConfig(bool needsEquals)
     return true;
 }
 
-uint32_t EspClass::getSketchSize()
-{
-    return 400000;
-}
+uint32_t EspClass::getSketchSize() { return 400000; }
 
-uint32_t EspClass::getFreeHeap()
-{
-    return 30000;
-}
+uint32_t EspClass::getFreeHeap() { return 30000; }
 
-uint32_t EspClass::getMaxFreeBlockSize()
-{
-    return 20000;
-}
+uint32_t EspClass::getMaxFreeBlockSize() { return 20000; }
 
-String EspClass::getResetReason()
-{
-    return "Power on";
-}
+String EspClass::getResetReason() { return "Power on"; }
 
-uint32_t EspClass::getFreeSketchSpace()
-{
-    return 4 * 1024 * 1024;
-}
+uint32_t EspClass::getFreeSketchSpace() { return 4 * 1024 * 1024; }
 
-const char* EspClass::getSdkVersion()
-{
-    return "2.5.0";
-}
+const char* EspClass::getSdkVersion() { return "2.5.0"; }
 
-uint32_t EspClass::getFlashChipSpeed()
-{
-    return 40;
-}
+uint32_t EspClass::getFlashChipSpeed() { return 40; }
 
 void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag)
 {
@@ -161,10 +107,7 @@ bool EspClass::flashEraseSector(uint32_t sector)
     return true;
 }
 
-FlashMode_t EspClass::getFlashChipMode()
-{
-    return FM_DOUT;
-}
+FlashMode_t EspClass::getFlashChipMode() { return FM_DOUT; }
 
 FlashMode_t EspClass::magicFlashChipMode(uint8_t byte)
 {
@@ -227,34 +170,17 @@ uint32_t EspClass::magicFlashChipSize(uint8_t byte)
     }
 }
 
-uint32_t EspClass::getFlashChipRealSize(void)
-{
-    return magicFlashChipSize(4);
-}
+uint32_t EspClass::getFlashChipRealSize(void) { return magicFlashChipSize(4); }
 
-uint32_t EspClass::getFlashChipSize(void)
-{
-    return magicFlashChipSize(4);
-}
+uint32_t EspClass::getFlashChipSize(void) { return magicFlashChipSize(4); }
 
-String EspClass::getFullVersion()
-{
-    return "emulation-on-host";
-}
+String EspClass::getFullVersion() { return "emulation-on-host"; }
 
-uint32_t EspClass::getFreeContStack()
-{
-    return 4000;
-}
+uint32_t EspClass::getFreeContStack() { return 4000; }
 
-void EspClass::resetFreeContStack()
-{
-}
+void EspClass::resetFreeContStack() { }
 
-uint32_t EspClass::getCycleCount()
-{
-    return esp_get_cycle_count();
-}
+uint32_t EspClass::getCycleCount() { return esp_get_cycle_count(); }
 
 uint32_t esp_get_cycle_count()
 {
@@ -263,18 +189,10 @@ uint32_t esp_get_cycle_count()
     return (((uint64_t)t.tv_sec) * 1000000 + t.tv_usec) * (F_CPU / 1000000);
 }
 
-void EspClass::setDramHeap()
-{
-}
+void EspClass::setDramHeap() { }
 
-void EspClass::setIramHeap()
-{
-}
+void EspClass::setIramHeap() { }
 
-void EspClass::setExternalHeap()
-{
-}
+void EspClass::setExternalHeap() { }
 
-void EspClass::resetHeap()
-{
-}
+void EspClass::resetHeap() { }
diff --git a/tests/host/common/MockSPI.cpp b/tests/host/common/MockSPI.cpp
index 629970f436..ba6e5d4368 100644
--- a/tests/host/common/MockSPI.cpp
+++ b/tests/host/common/MockSPI.cpp
@@ -35,29 +35,14 @@
 SPIClass SPI;
 #endif
 
-SPIClass::SPIClass()
-{
-}
-
-uint8_t SPIClass::transfer(uint8_t data)
-{
-    return data;
-}
-
-void SPIClass::begin()
-{
-}
-
-void SPIClass::end()
-{
-}
-
-void SPIClass::setFrequency(uint32_t freq)
-{
-    (void)freq;
-}
-
-void SPIClass::setHwCs(bool use)
-{
-    (void)use;
-}
+SPIClass::SPIClass() { }
+
+uint8_t SPIClass::transfer(uint8_t data) { return data; }
+
+void SPIClass::begin() { }
+
+void SPIClass::end() { }
+
+void SPIClass::setFrequency(uint32_t freq) { (void)freq; }
+
+void SPIClass::setHwCs(bool use) { (void)use; }
diff --git a/tests/host/common/MockTools.cpp b/tests/host/common/MockTools.cpp
index c1fbb2ae16..3a1847c802 100644
--- a/tests/host/common/MockTools.cpp
+++ b/tests/host/common/MockTools.cpp
@@ -67,12 +67,13 @@ extern "C"
 #define make_stack_thunk(fcnToThunk)
 };
 
-void configTime(int timezone, int daylightOffset_sec,
-                const char* server1, const char* server2, const char* server3)
+void configTime(int timezone, int daylightOffset_sec, const char* server1, const char* server2,
+                const char* server3)
 {
     (void)server1;
     (void)server2;
     (void)server3;
 
-    mockverbose("configTime: TODO (tz=%dH offset=%dS) (time will be host's)\n", timezone, daylightOffset_sec);
+    mockverbose("configTime: TODO (tz=%dH offset=%dS) (time will be host's)\n", timezone,
+                daylightOffset_sec);
 }
diff --git a/tests/host/common/MockUART.cpp b/tests/host/common/MockUART.cpp
index 12e4599c75..72d5a54d73 100644
--- a/tests/host/common/MockUART.cpp
+++ b/tests/host/common/MockUART.cpp
@@ -66,8 +66,7 @@ extern "C"
     bool serial_timestamp = false;
 
     // write one byte to the emulated UART
-    static void
-    uart_do_write_char(const int uart_nr, char c)
+    static void uart_do_write_char(const int uart_nr, char c)
     {
         static bool w = false;
 
@@ -81,7 +80,8 @@ extern "C"
                     timeval tv;
                     gettimeofday(&tv, nullptr);
                     const tm* tm = localtime(&tv.tv_sec);
-                    fprintf(out, "\r\n%d:%02d:%02d.%06d: ", tm->tm_hour, tm->tm_min, tm->tm_sec, (int)tv.tv_usec);
+                    fprintf(out, "\r\n%d:%02d:%02d.%06d: ", tm->tm_hour, tm->tm_min, tm->tm_sec,
+                            (int)tv.tv_usec);
                     fflush(out);
                     w = false;
                 }
@@ -98,8 +98,7 @@ extern "C"
     }
 
     // write a new byte into the RX FIFO buffer
-    static void
-    uart_handle_data(uart_t* uart, uint8_t data)
+    static void uart_handle_data(uart_t* uart, uint8_t data)
     {
         struct uart_rx_buffer_* rx_buffer = uart->rx_buffer;
 
@@ -119,8 +118,7 @@ extern "C"
     }
 
     // insert a new byte into the RX FIFO nuffer
-    void
-    uart_new_data(const int uart_nr, uint8_t data)
+    void uart_new_data(const int uart_nr, uint8_t data)
     {
         uart_t* uart = UART[uart_nr];
 
@@ -132,8 +130,7 @@ extern "C"
         uart_handle_data(uart, data);
     }
 
-    static size_t
-    uart_rx_available_unsafe(const struct uart_rx_buffer_* rx_buffer)
+    static size_t uart_rx_available_unsafe(const struct uart_rx_buffer_* rx_buffer)
     {
         size_t ret = rx_buffer->wpos - rx_buffer->rpos;
 
@@ -144,8 +141,7 @@ extern "C"
     }
 
     // taking data straight from fifo, only needed in uart_resize_rx_buffer()
-    static int
-    uart_read_char_unsafe(uart_t* uart)
+    static int uart_read_char_unsafe(uart_t* uart)
     {
         if (uart_rx_available_unsafe(uart->rx_buffer))
         {
@@ -162,8 +158,7 @@ extern "C"
     /************ UART API FUNCTIONS **************************/
     /**********************************************************/
 
-    size_t
-    uart_rx_available(uart_t* uart)
+    size_t uart_rx_available(uart_t* uart)
     {
         if (uart == NULL || !uart->rx_enabled)
             return 0;
@@ -171,8 +166,7 @@ extern "C"
         return uart_rx_available_unsafe(uart->rx_buffer);
     }
 
-    int
-    uart_peek_char(uart_t* uart)
+    int uart_peek_char(uart_t* uart)
     {
         if (uart == NULL || !uart->rx_enabled)
             return -1;
@@ -183,15 +177,13 @@ extern "C"
         return uart->rx_buffer->buffer[uart->rx_buffer->rpos];
     }
 
-    int
-    uart_read_char(uart_t* uart)
+    int uart_read_char(uart_t* uart)
     {
         uint8_t ret;
         return uart_read(uart, (char*)&ret, 1) ? ret : -1;
     }
 
-    size_t
-    uart_read(uart_t* uart, char* userbuffer, size_t usersize)
+    size_t uart_read(uart_t* uart, char* userbuffer, size_t usersize)
     {
         if (uart == NULL || !uart->rx_enabled)
             return 0;
@@ -208,7 +200,9 @@ extern "C"
         {
             // pour sw buffer to user's buffer
             // get largest linear length from sw buffer
-            size_t chunk = uart->rx_buffer->rpos < uart->rx_buffer->wpos ? uart->rx_buffer->wpos - uart->rx_buffer->rpos : uart->rx_buffer->size - uart->rx_buffer->rpos;
+            size_t chunk = uart->rx_buffer->rpos < uart->rx_buffer->wpos ?
+                               uart->rx_buffer->wpos - uart->rx_buffer->rpos :
+                               uart->rx_buffer->size - uart->rx_buffer->rpos;
             if (ret + chunk > usersize)
                 chunk = usersize - ret;
             memcpy(userbuffer + ret, uart->rx_buffer->buffer + uart->rx_buffer->rpos, chunk);
@@ -218,8 +212,7 @@ extern "C"
         return ret;
     }
 
-    size_t
-    uart_resize_rx_buffer(uart_t* uart, size_t new_size)
+    size_t uart_resize_rx_buffer(uart_t* uart, size_t new_size)
     {
         if (uart == NULL || !uart->rx_enabled)
             return 0;
@@ -247,14 +240,12 @@ extern "C"
         return uart->rx_buffer->size;
     }
 
-    size_t
-    uart_get_rx_buffer_size(uart_t* uart)
+    size_t uart_get_rx_buffer_size(uart_t* uart)
     {
         return uart && uart->rx_enabled ? uart->rx_buffer->size : 0;
     }
 
-    size_t
-    uart_write_char(uart_t* uart, char c)
+    size_t uart_write_char(uart_t* uart, char c)
     {
         if (uart == NULL || !uart->tx_enabled)
             return 0;
@@ -264,8 +255,7 @@ extern "C"
         return 1;
     }
 
-    size_t
-    uart_write(uart_t* uart, const char* buf, size_t size)
+    size_t uart_write(uart_t* uart, const char* buf, size_t size)
     {
         if (uart == NULL || !uart->tx_enabled)
             return 0;
@@ -278,8 +268,7 @@ extern "C"
         return ret;
     }
 
-    size_t
-    uart_tx_free(uart_t* uart)
+    size_t uart_tx_free(uart_t* uart)
     {
         if (uart == NULL || !uart->tx_enabled)
             return 0;
@@ -287,14 +276,9 @@ extern "C"
         return UART_TX_FIFO_SIZE;
     }
 
-    void
-    uart_wait_tx_empty(uart_t* uart)
-    {
-        (void)uart;
-    }
+    void uart_wait_tx_empty(uart_t* uart) { (void)uart; }
 
-    void
-    uart_flush(uart_t* uart)
+    void uart_flush(uart_t* uart)
     {
         if (uart == NULL)
             return;
@@ -306,8 +290,7 @@ extern "C"
         }
     }
 
-    void
-    uart_set_baudrate(uart_t* uart, int baud_rate)
+    void uart_set_baudrate(uart_t* uart, int baud_rate)
     {
         if (uart == NULL)
             return;
@@ -315,8 +298,7 @@ extern "C"
         uart->baud_rate = baud_rate;
     }
 
-    int
-    uart_get_baudrate(uart_t* uart)
+    int uart_get_baudrate(uart_t* uart)
     {
         if (uart == NULL)
             return 0;
@@ -324,8 +306,7 @@ extern "C"
         return uart->baud_rate;
     }
 
-    uint8_t
-    uart_get_bit_length(const int uart_nr)
+    uint8_t uart_get_bit_length(const int uart_nr)
     {
         uint8_t width  = ((uart_nr % 16) >> 2) + 5;
         uint8_t parity = (uart_nr >> 5) + 1;
@@ -333,8 +314,8 @@ extern "C"
         return (width + parity + stop + 1);
     }
 
-    uart_t*
-    uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, size_t rx_size, bool invert)
+    uart_t* uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, size_t rx_size,
+                      bool invert)
     {
         (void)config;
         (void)tx_pin;
@@ -353,13 +334,14 @@ extern "C"
             uart->tx_enabled = (mode != UART_RX_ONLY);
             if (uart->rx_enabled)
             {
-                struct uart_rx_buffer_* rx_buffer = (struct uart_rx_buffer_*)malloc(sizeof(struct uart_rx_buffer_));
+                struct uart_rx_buffer_* rx_buffer
+                    = (struct uart_rx_buffer_*)malloc(sizeof(struct uart_rx_buffer_));
                 if (rx_buffer == NULL)
                 {
                     free(uart);
                     return NULL;
                 }
-                rx_buffer->size   = rx_size;  //var this
+                rx_buffer->size   = rx_size;  // var this
                 rx_buffer->rpos   = 0;
                 rx_buffer->wpos   = 0;
                 rx_buffer->buffer = (uint8_t*)malloc(rx_buffer->size);
@@ -393,8 +375,7 @@ extern "C"
         return uart;
     }
 
-    void
-    uart_uninit(uart_t* uart)
+    void uart_uninit(uart_t* uart)
     {
         if (uart == NULL)
             return;
@@ -407,24 +388,21 @@ extern "C"
         free(uart);
     }
 
-    bool
-    uart_swap(uart_t* uart, int tx_pin)
+    bool uart_swap(uart_t* uart, int tx_pin)
     {
         (void)uart;
         (void)tx_pin;
         return true;
     }
 
-    bool
-    uart_set_tx(uart_t* uart, int tx_pin)
+    bool uart_set_tx(uart_t* uart, int tx_pin)
     {
         (void)uart;
         (void)tx_pin;
         return true;
     }
 
-    bool
-    uart_set_pins(uart_t* uart, int tx, int rx)
+    bool uart_set_pins(uart_t* uart, int tx, int rx)
     {
         (void)uart;
         (void)tx;
@@ -432,8 +410,7 @@ extern "C"
         return true;
     }
 
-    bool
-    uart_tx_enabled(uart_t* uart)
+    bool uart_tx_enabled(uart_t* uart)
     {
         if (uart == NULL)
             return false;
@@ -441,8 +418,7 @@ extern "C"
         return uart->tx_enabled;
     }
 
-    bool
-    uart_rx_enabled(uart_t* uart)
+    bool uart_rx_enabled(uart_t* uart)
     {
         if (uart == NULL)
             return false;
@@ -450,8 +426,7 @@ extern "C"
         return uart->rx_enabled;
     }
 
-    bool
-    uart_has_overrun(uart_t* uart)
+    bool uart_has_overrun(uart_t* uart)
     {
         if (uart == NULL || !uart->rx_overrun)
             return false;
@@ -461,33 +436,19 @@ extern "C"
         return true;
     }
 
-    bool
-    uart_has_rx_error(uart_t* uart)
+    bool uart_has_rx_error(uart_t* uart)
     {
         (void)uart;
         return false;
     }
 
-    void
-    uart_set_debug(int uart_nr)
-    {
-        (void)uart_nr;
-    }
+    void uart_set_debug(int uart_nr) { (void)uart_nr; }
 
-    int
-    uart_get_debug()
-    {
-        return s_uart_debug_nr;
-    }
+    int uart_get_debug() { return s_uart_debug_nr; }
 
-    void
-    uart_start_detect_baudrate(int uart_nr)
-    {
-        (void)uart_nr;
-    }
+    void uart_start_detect_baudrate(int uart_nr) { (void)uart_nr; }
 
-    int
-    uart_detect_baudrate(int uart_nr)
+    int uart_detect_baudrate(int uart_nr)
     {
         (void)uart_nr;
         return 115200;
diff --git a/tests/host/common/MockWiFiServer.cpp b/tests/host/common/MockWiFiServer.cpp
index f199a2b588..6e26e8d146 100644
--- a/tests/host/common/MockWiFiServer.cpp
+++ b/tests/host/common/MockWiFiServer.cpp
@@ -50,10 +50,7 @@ WiFiServer::WiFiServer(const IPAddress& addr, uint16_t port)
     _port = port;
 }
 
-WiFiServer::WiFiServer(uint16_t port)
-{
-    _port = port;
-}
+WiFiServer::WiFiServer(uint16_t port) { _port = port; }
 
 WiFiClient WiFiServer::available(uint8_t* status)
 {
diff --git a/tests/host/common/MockWiFiServerSocket.cpp b/tests/host/common/MockWiFiServerSocket.cpp
index c5e1e6b662..f23c79b20e 100644
--- a/tests/host/common/MockWiFiServerSocket.cpp
+++ b/tests/host/common/MockWiFiServerSocket.cpp
@@ -58,10 +58,7 @@ int serverAccept(int srvsock)
     return mockSockSetup(clisock);
 }
 
-void WiFiServer::begin(uint16_t port)
-{
-    return begin(port, !0);
-}
+void WiFiServer::begin(uint16_t port) { return begin(port, !0); }
 
 void WiFiServer::begin(uint16_t port, uint8_t backlog)
 {
@@ -81,7 +78,8 @@ void WiFiServer::begin()
     if (mockport < 1024 && mock_port_shifter)
     {
         mockport += mock_port_shifter;
-        fprintf(stderr, MOCK "=====> WiFiServer port: %d shifted to %d (use option -s) <=====\n", _port, mockport);
+        fprintf(stderr, MOCK "=====> WiFiServer port: %d shifted to %d (use option -s) <=====\n",
+                _port, mockport);
     }
     else
         fprintf(stderr, MOCK "=====> WiFiServer port: %d <=====\n", mockport);
@@ -133,10 +131,7 @@ void WiFiServer::close()
     _listen_pcb = int2pcb(-1);
 }
 
-void WiFiServer::stop()
-{
-    close();
-}
+void WiFiServer::stop() { close(); }
 
 size_t WiFiServer::hasClientData()
 {
@@ -144,7 +139,8 @@ size_t WiFiServer::hasClientData()
     // There is no waiting list of clients in this trivial mocking code,
     // so the code has to act as if the tcp backlog list is full,
     // and nothing is known about potential further clients.
-    // It could be implemented by accepting new clients and store their data until the current one is closed.
+    // It could be implemented by accepting new clients and store their data until the current one
+    // is closed.
     return 0;
 }
 
diff --git a/tests/host/common/MocklwIP.cpp b/tests/host/common/MocklwIP.cpp
index 0b5dfa502b..cec1bfae4d 100644
--- a/tests/host/common/MocklwIP.cpp
+++ b/tests/host/common/MocklwIP.cpp
@@ -17,14 +17,9 @@ extern "C"
         return ERR_OK;
     }
 
-    void sntp_setserver(u8_t, const ip_addr_t)
-    {
-    }
+    void sntp_setserver(u8_t, const ip_addr_t) { }
 
-    const ip_addr_t* sntp_getserver(u8_t)
-    {
-        return IP_ADDR_ANY;
-    }
+    const ip_addr_t* sntp_getserver(u8_t) { return IP_ADDR_ANY; }
 
     err_t etharp_request(struct netif* netif, const ip4_addr_t* ipaddr)
     {
diff --git a/tests/host/common/UdpContextSocket.cpp b/tests/host/common/UdpContextSocket.cpp
index 161821a294..c598460180 100644
--- a/tests/host/common/UdpContextSocket.cpp
+++ b/tests/host/common/UdpContextSocket.cpp
@@ -59,7 +59,8 @@ bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
     if (mockport < 1024 && mock_port_shifter)
     {
         mockport += mock_port_shifter;
-        fprintf(stderr, MOCK "=====> UdpServer port: %d shifted to %d (use option -s) <=====\n", port, mockport);
+        fprintf(stderr, MOCK "=====> UdpServer port: %d shifted to %d (use option -s) <=====\n",
+                port, mockport);
     }
     else
         fprintf(stderr, MOCK "=====> UdpServer port: %d <=====\n", mockport);
@@ -77,7 +78,7 @@ bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
     // Filling server information
     servaddr.sin_family = AF_INET;
     (void)dstaddr;
-    //servaddr.sin_addr.s_addr = htonl(global_source_address);
+    // servaddr.sin_addr.s_addr = htonl(global_source_address);
     servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
     servaddr.sin_port        = htons(mockport);
 
@@ -99,7 +100,7 @@ bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
 
         struct ip_mreq mreq;
         mreq.imr_multiaddr.s_addr = mcast;
-        //mreq.imr_interface.s_addr = htonl(global_source_address);
+        // mreq.imr_interface.s_addr = htonl(global_source_address);
         mreq.imr_interface.s_addr = htonl(INADDR_ANY);
 
         if (host_interface)
@@ -108,11 +109,17 @@ bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
             int idx = if_nametoindex(host_interface);
             if (setsockopt(sock, IPPROTO_TCP, IP_BOUND_IF, &idx, sizeof(idx)) == -1)
 #else
-            if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, host_interface, strlen(host_interface)) == -1)
+            if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, host_interface,
+                           strlen(host_interface))
+                == -1)
 #endif
-                fprintf(stderr, MOCK "UDP multicast: can't setup bind/output on interface %s: %s\n", host_interface, strerror(errno));
-            if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, &mreq.imr_interface, sizeof(struct in_addr)) == -1)
-                fprintf(stderr, MOCK "UDP multicast: can't setup bind/input on interface %s: %s\n", host_interface, strerror(errno));
+                fprintf(stderr, MOCK "UDP multicast: can't setup bind/output on interface %s: %s\n",
+                        host_interface, strerror(errno));
+            if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_IF, &mreq.imr_interface,
+                           sizeof(struct in_addr))
+                == -1)
+                fprintf(stderr, MOCK "UDP multicast: can't setup bind/input on interface %s: %s\n",
+                        host_interface, strerror(errno));
         }
 
         if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0)
@@ -127,17 +134,20 @@ bool mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast)
     return true;
 }
 
-size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port)
+size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize,
+                        uint8_t addr[16], uint16_t& port)
 {
     struct sockaddr_storage addrbuf;
     socklen_t               addrbufsize = std::min((socklen_t)sizeof(addrbuf), (socklen_t)16);
 
     size_t  maxread = CCBUFSIZE - ccinbufsize;
-    ssize_t ret     = ::recvfrom(sock, ccinbuf + ccinbufsize, maxread, 0 /*flags*/, (sockaddr*)&addrbuf, &addrbufsize);
+    ssize_t ret = ::recvfrom(sock, ccinbuf + ccinbufsize, maxread, 0 /*flags*/, (sockaddr*)&addrbuf,
+                             &addrbufsize);
     if (ret == -1)
     {
         if (errno != EAGAIN)
-            fprintf(stderr, MOCK "UDPContext::(read/peek): filling buffer for %zd bytes: %s\n", maxread, strerror(errno));
+            fprintf(stderr, MOCK "UDPContext::(read/peek): filling buffer for %zd bytes: %s\n",
+                    maxread, strerror(errno));
         ret = 0;
     }
 
@@ -156,12 +166,14 @@ size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& a
     return ccinbufsize += ret;
 }
 
-size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf,
+                        size_t& ccinbufsize)
 {
     (void)sock;
     (void)timeout_ms;
     if (usersize > CCBUFSIZE)
-        fprintf(stderr, MOCK "CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE, usersize - CCBUFSIZE, usersize);
+        fprintf(stderr, MOCK "CCBUFSIZE(%d) should be increased by %zd bytes (-> %zd)\n", CCBUFSIZE,
+                usersize - CCBUFSIZE, usersize);
 
     size_t retsize = 0;
     if (ccinbufsize)
@@ -182,22 +194,24 @@ void mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize)
     ccinbufsize -= copied;
 }
 
-size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize)
+size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf,
+                   size_t& ccinbufsize)
 {
     size_t copied = mockUDPPeekBytes(sock, dst, size, timeout_ms, ccinbuf, ccinbufsize);
     mockUDPSwallow(copied, ccinbuf, ccinbufsize);
     return copied;
 }
 
-size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port)
+size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4,
+                    uint16_t port)
 {
     (void)timeout_ms;
     // Filling server information
     struct sockaddr_in peer;
     peer.sin_family      = AF_INET;
-    peer.sin_addr.s_addr = ipv4;  //XXFIXME should use lwip_htonl?
+    peer.sin_addr.s_addr = ipv4;  // XXFIXME should use lwip_htonl?
     peer.sin_port        = htons(port);
-    int ret              = ::sendto(sock, data, size, 0 /*flags*/, (const sockaddr*)&peer, sizeof(peer));
+    int ret = ::sendto(sock, data, size, 0 /*flags*/, (const sockaddr*)&peer, sizeof(peer));
     if (ret == -1)
     {
         fprintf(stderr, MOCK "UDPContext::write: write(%d): %s\n", sock, strerror(errno));
diff --git a/tests/host/common/WMath.cpp b/tests/host/common/WMath.cpp
index 99b83a31f0..10e17b04a1 100644
--- a/tests/host/common/WMath.cpp
+++ b/tests/host/common/WMath.cpp
@@ -4,22 +4,22 @@
  Part of the Wiring project - http://wiring.org.co
  Copyright (c) 2004-06 Hernando Barragan
  Modified 13 August 2006, David A. Mellis for Arduino - http://www.arduino.cc/
- 
+
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.
- 
+
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.
- 
+
  You should have received a copy of the GNU Lesser General
  Public License along with this library; if not, write to the
  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  Boston, MA  02111-1307  USA
- 
+
  $Id$
  */
 
@@ -61,12 +61,6 @@ long map(long x, long in_min, long in_max, long out_min, long out_max)
     return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
 }
 
-uint16_t makeWord(unsigned int w)
-{
-    return w;
-}
+uint16_t makeWord(unsigned int w) { return w; }
 
-uint16_t makeWord(unsigned char h, unsigned char l)
-{
-    return (h << 8) | l;
-}
+uint16_t makeWord(unsigned char h, unsigned char l) { return (h << 8) | l; }
diff --git a/tests/host/common/c_types.h b/tests/host/common/c_types.h
index 249c423682..9ba8968aeb 100644
--- a/tests/host/common/c_types.h
+++ b/tests/host/common/c_types.h
@@ -94,9 +94,15 @@ typedef enum
 #ifdef ICACHE_FLASH
 #define __ICACHE_STRINGIZE_NX(A) #A
 #define __ICACHE_STRINGIZE(A) __ICACHE_STRINGIZE_NX(A)
-#define ICACHE_FLASH_ATTR __attribute__((section("\".irom0.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
-#define IRAM_ATTR __attribute__((section("\".iram.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
-#define ICACHE_RODATA_ATTR __attribute__((section("\".irom.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
+#define ICACHE_FLASH_ATTR                                                                          \
+    __attribute__((section("\".irom0.text." __FILE__ "." __ICACHE_STRINGIZE(                       \
+        __LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
+#define IRAM_ATTR                                                                                  \
+    __attribute__((section("\".iram.text." __FILE__ "." __ICACHE_STRINGIZE(                        \
+        __LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
+#define ICACHE_RODATA_ATTR                                                                         \
+    __attribute__((section("\".irom.text." __FILE__ "." __ICACHE_STRINGIZE(                        \
+        __LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
 #else
 #define ICACHE_FLASH_ATTR
 #define IRAM_ATTR
diff --git a/tests/host/common/include/ClientContext.h b/tests/host/common/include/ClientContext.h
index b3c32211e2..4f10bb93ce 100644
--- a/tests/host/common/include/ClientContext.h
+++ b/tests/host/common/include/ClientContext.h
@@ -63,15 +63,9 @@ class ClientContext
         return ERR_OK;
     }
 
-    ~ClientContext()
-    {
-        abort();
-    }
+    ~ClientContext() { abort(); }
 
-    ClientContext* next() const
-    {
-        return _next;
-    }
+    ClientContext* next() const { return _next; }
 
     ClientContext* next(ClientContext* new_next)
     {
@@ -110,10 +104,7 @@ class ClientContext
         return 512;
     }
 
-    void setNoDelay(bool nodelay)
-    {
-        mockverbose("TODO setNoDelay(%d)\n", (int)nodelay);
-    }
+    void setNoDelay(bool nodelay) { mockverbose("TODO setNoDelay(%d)\n", (int)nodelay); }
 
     bool getNoDelay() const
     {
@@ -121,15 +112,9 @@ class ClientContext
         return false;
     }
 
-    void setTimeout(int timeout_ms)
-    {
-        _timeout_ms = timeout_ms;
-    }
+    void setTimeout(int timeout_ms) { _timeout_ms = timeout_ms; }
 
-    int getTimeout() const
-    {
-        return _timeout_ms;
-    }
+    int getTimeout() const { return _timeout_ms; }
 
     uint32_t getRemoteAddress() const
     {
@@ -204,10 +189,7 @@ class ClientContext
         return ret;
     }
 
-    void discard_received()
-    {
-        mockverbose("TODO: ClientContext::discard_received()\n");
-    }
+    void discard_received() { mockverbose("TODO: ClientContext::discard_received()\n"); }
 
     bool wait_until_acked(int max_wait_ms = WIFICLIENT_MAX_FLUSH_WAIT_MS)
     {
@@ -232,7 +214,9 @@ class ClientContext
         return ret;
     }
 
-    void keepAlive(uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC, uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC, uint8_t count = TCP_DEFAULT_KEEPALIVE_COUNT)
+    void keepAlive(uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC,
+                   uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC,
+                   uint8_t  count    = TCP_DEFAULT_KEEPALIVE_COUNT)
     {
         (void)idle_sec;
         (void)intv_sec;
@@ -278,10 +262,7 @@ class ClientContext
 
     // return a pointer to available data buffer (size = peekAvailable())
     // semantic forbids any kind of read() before calling peekConsume()
-    const char* peekBuffer()
-    {
-        return _inbuf;
-    }
+    const char* peekBuffer() { return _inbuf; }
 
     // return number of byte accessible by peekBuffer()
     size_t peekAvailable()
@@ -321,4 +302,4 @@ class ClientContext
     size_t _inbufsize = 0;
 };
 
-#endif  //CLIENTCONTEXT_H
+#endif  // CLIENTCONTEXT_H
diff --git a/tests/host/common/include/UdpContext.h b/tests/host/common/include/UdpContext.h
index 0e3942b2db..b32c67b761 100644
--- a/tests/host/common/include/UdpContext.h
+++ b/tests/host/common/include/UdpContext.h
@@ -39,20 +39,11 @@ class UdpContext
 public:
     typedef std::function<void(void)> rxhandler_t;
 
-    UdpContext() :
-        _on_rx(nullptr), _refcnt(0)
-    {
-        _sock = mockUDPSocket();
-    }
+    UdpContext() : _on_rx(nullptr), _refcnt(0) { _sock = mockUDPSocket(); }
 
-    ~UdpContext()
-    {
-    }
+    ~UdpContext() { }
 
-    void ref()
-    {
-        ++_refcnt;
-    }
+    void ref() { ++_refcnt; }
 
     void unref()
     {
@@ -103,30 +94,18 @@ class UdpContext
     void setMulticastTTL(int ttl)
     {
         (void)ttl;
-        //mockverbose("TODO: UdpContext::setMulticastTTL\n");
+        // mockverbose("TODO: UdpContext::setMulticastTTL\n");
     }
 
-    netif* getInputNetif() const
-    {
-        return &netif0;
-    }
+    netif* getInputNetif() const { return &netif0; }
 
     // warning: handler is called from tcp stack context
     // esp_yield and non-reentrant functions which depend on it will fail
-    void onRx(rxhandler_t handler)
-    {
-        _on_rx = handler;
-    }
+    void onRx(rxhandler_t handler) { _on_rx = handler; }
 
-    size_t getSize()
-    {
-        return _inbufsize;
-    }
+    size_t getSize() { return _inbufsize; }
 
-    size_t tell() const
-    {
-        return 0;
-    }
+    size_t tell() const { return 0; }
 
     void seek(const size_t pos)
     {
@@ -138,25 +117,16 @@ class UdpContext
         mockUDPSwallow(pos, _inbuf, _inbufsize);
     }
 
-    bool isValidOffset(const size_t pos) const
-    {
-        return pos <= _inbufsize;
-    }
+    bool isValidOffset(const size_t pos) const { return pos <= _inbufsize; }
 
-    IPAddress getRemoteAddress()
-    {
-        return _dst.addr;
-    }
+    IPAddress getRemoteAddress() { return _dst.addr; }
 
-    uint16_t getRemotePort()
-    {
-        return _dstport;
-    }
+    uint16_t getRemotePort() { return _dstport; }
 
     IPAddress getDestAddress()
     {
         mockverbose("TODO: implement UDP getDestAddress\n");
-        return 0;  //ip_hdr* iphdr = GET_IP_HDR(_rx_buf);
+        return 0;  // ip_hdr* iphdr = GET_IP_HDR(_rx_buf);
     }
 
     uint16_t getLocalPort()
@@ -196,8 +166,8 @@ class UdpContext
 
     void flush()
     {
-        //mockverbose("UdpContext::flush() does not follow arduino's flush concept\n");
-        //exit(EXIT_FAILURE);
+        // mockverbose("UdpContext::flush() does not follow arduino's flush concept\n");
+        // exit(EXIT_FAILURE);
         // would be:
         _inbufsize = 0;
     }
@@ -206,7 +176,8 @@ class UdpContext
     {
         if (size + _outbufsize > sizeof _outbuf)
         {
-            mockverbose("UdpContext::append: increase CCBUFSIZE (%d -> %zd)\n", CCBUFSIZE, (size + _outbufsize));
+            mockverbose("UdpContext::append: increase CCBUFSIZE (%d -> %zd)\n", CCBUFSIZE,
+                        (size + _outbufsize));
             exit(EXIT_FAILURE);
         }
 
@@ -219,17 +190,15 @@ class UdpContext
     {
         uint32_t dst     = addr ? addr->addr : _dst.addr;
         uint16_t dstport = port ?: _dstport;
-        size_t   wrt     = mockUDPWrite(_sock, (const uint8_t*)_outbuf, _outbufsize, _timeout_ms, dst, dstport);
-        err_t    ret     = _outbufsize ? ERR_OK : ERR_ABRT;
+        size_t   wrt
+            = mockUDPWrite(_sock, (const uint8_t*)_outbuf, _outbufsize, _timeout_ms, dst, dstport);
+        err_t ret = _outbufsize ? ERR_OK : ERR_ABRT;
         if (!keepBuffer || wrt == _outbufsize)
             cancelBuffer();
         return ret;
     }
 
-    void cancelBuffer()
-    {
-        _outbufsize = 0;
-    }
+    void cancelBuffer() { _outbufsize = 0; }
 
     bool send(ip_addr_t* addr = 0, uint16_t port = 0)
     {
@@ -266,7 +235,7 @@ class UdpContext
             memcpy(&ipv4, addr, 4);
             ip4_addr_set_u32(&ip_2_ip4(_dst), ipv4);
             // ^ this is a workaround for "type-punned pointer" with "*(uint32*)addr"
-            //ip4_addr_set_u32(&ip_2_ip4(_dst), *(uint32_t*)addr);
+            // ip4_addr_set_u32(&ip_2_ip4(_dst), *(uint32_t*)addr);
         }
         else
             mockverbose("TODO unhandled udp address of size %d\n", (int)addrsize);
@@ -297,4 +266,4 @@ extern "C" inline err_t igmp_joingroup(const ip4_addr_t* ifaddr, const ip4_addr_
     return ERR_OK;
 }
 
-#endif  //UDPCONTEXT_H
+#endif  // UDPCONTEXT_H
diff --git a/tests/host/common/littlefs_mock.cpp b/tests/host/common/littlefs_mock.cpp
index 5110ebbf7b..2d061d9b81 100644
--- a/tests/host/common/littlefs_mock.cpp
+++ b/tests/host/common/littlefs_mock.cpp
@@ -56,7 +56,8 @@ LittleFSMock::LittleFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, con
 
 void LittleFSMock::reset()
 {
-    LittleFS = FS(FSImplPtr(new littlefs_impl::LittleFSImpl(0, s_phys_size, s_phys_page, s_phys_block, 5)));
+    LittleFS = FS(
+        FSImplPtr(new littlefs_impl::LittleFSImpl(0, s_phys_size, s_phys_page, s_phys_block, 5)));
     load();
 }
 
@@ -87,27 +88,32 @@ void LittleFSMock::load()
     off_t flen = lseek(fs, 0, SEEK_END);
     if (flen == (off_t)-1)
     {
-        fprintf(stderr, "LittleFS: checking size of '%s': %s\n", m_storage.c_str(), strerror(errno));
+        fprintf(stderr, "LittleFS: checking size of '%s': %s\n", m_storage.c_str(),
+                strerror(errno));
         return;
     }
     lseek(fs, 0, SEEK_SET);
 
     if (flen != (off_t)m_fs.size())
     {
-        fprintf(stderr, "LittleFS: size of '%s': %d does not match requested size %zd\n", m_storage.c_str(), (int)flen, m_fs.size());
+        fprintf(stderr, "LittleFS: size of '%s': %d does not match requested size %zd\n",
+                m_storage.c_str(), (int)flen, m_fs.size());
         if (!m_overwrite && flen > 0)
         {
             fprintf(stderr, "LittleFS: aborting at user request\n");
             exit(1);
         }
-        fprintf(stderr, "LittleFS: continuing without loading at user request, '%s' will be overwritten\n", m_storage.c_str());
+        fprintf(stderr,
+                "LittleFS: continuing without loading at user request, '%s' will be overwritten\n",
+                m_storage.c_str());
     }
     else
     {
         fprintf(stderr, "LittleFS: loading %zi bytes from '%s'\n", m_fs.size(), m_storage.c_str());
         ssize_t r = ::read(fs, m_fs.data(), m_fs.size());
         if (r != (ssize_t)m_fs.size())
-            fprintf(stderr, "LittleFS: reading %zi bytes: returned %zd: %s\n", m_fs.size(), r, strerror(errno));
+            fprintf(stderr, "LittleFS: reading %zi bytes: returned %zd: %s\n", m_fs.size(), r,
+                    strerror(errno));
     }
     ::close(fs);
 }
diff --git a/tests/host/common/littlefs_mock.h b/tests/host/common/littlefs_mock.h
index 53f4a5a5f7..4bc405d8f1 100644
--- a/tests/host/common/littlefs_mock.h
+++ b/tests/host/common/littlefs_mock.h
@@ -4,14 +4,14 @@
 
  Based on spiffs_mock:
  Copyright © 2016 Ivan Grokhotkov
- 
+
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:
- 
+
  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.
 */
@@ -30,7 +30,8 @@
 class LittleFSMock
 {
 public:
-    LittleFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString);
+    LittleFSMock(ssize_t fs_size, size_t fs_block, size_t fs_page,
+                 const String& storage = emptyString);
     void reset();
     ~LittleFSMock();
 
@@ -43,7 +44,8 @@ class LittleFSMock
     bool                 m_overwrite;
 };
 
-#define LITTLEFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage) LittleFSMock littlefs_mock(size_kb * 1024, block_kb * 1024, page_b, storage)
+#define LITTLEFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage)                                  \
+    LittleFSMock littlefs_mock(size_kb * 1024, block_kb * 1024, page_b, storage)
 #define LITTLEFS_MOCK_RESET() littlefs_mock.reset()
 
 #endif /* littlefs_mock_hpp */
diff --git a/tests/host/common/md5.c b/tests/host/common/md5.c
index 863ac80026..b41c49afae 100644
--- a/tests/host/common/md5.c
+++ b/tests/host/common/md5.c
@@ -1,18 +1,18 @@
 /*
  * Copyright (c) 2007, Cameron Rich
- * 
+ *
  * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without 
+ *
+ * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
  *
- * * Redistributions of source code must retain the above copyright notice, 
+ * * Redistributions of source code must retain the above copyright notice,
  *   this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice, 
- *   this list of conditions and the following disclaimer in the documentation 
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
  *   and/or other materials provided with the distribution.
- * * Neither the name of the axTLS project nor the names of its contributors 
- *   may be used to endorse or promote products derived from this software 
+ * * Neither the name of the axTLS project nor the names of its contributors
+ *   may be used to endorse or promote products derived from this software
  *   without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@@ -72,11 +72,10 @@ static void MD5Transform(uint32_t state[4], const uint8_t block[64]);
 static void Encode(uint8_t* output, uint32_t* input, uint32_t len);
 static void Decode(uint32_t* output, const uint8_t* input, uint32_t len);
 
-static const uint8_t PADDING[64] = {
-    0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
+static const uint8_t PADDING[64]
+    = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 
 /* F, G, H and I are basic MD5 functions.
  */
@@ -90,29 +89,29 @@ static const uint8_t PADDING[64] = {
 
 /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
    Rotation is separate from addition to prevent recomputation.  */
-#define FF(a, b, c, d, x, s, ac)                        \
-    {                                                   \
-        (a) += F((b), (c), (d)) + (x) + (uint32_t)(ac); \
-        (a) = ROTATE_LEFT((a), (s));                    \
-        (a) += (b);                                     \
+#define FF(a, b, c, d, x, s, ac)                                                                   \
+    {                                                                                              \
+        (a) += F((b), (c), (d)) + (x) + (uint32_t)(ac);                                            \
+        (a) = ROTATE_LEFT((a), (s));                                                               \
+        (a) += (b);                                                                                \
     }
-#define GG(a, b, c, d, x, s, ac)                        \
-    {                                                   \
-        (a) += G((b), (c), (d)) + (x) + (uint32_t)(ac); \
-        (a) = ROTATE_LEFT((a), (s));                    \
-        (a) += (b);                                     \
+#define GG(a, b, c, d, x, s, ac)                                                                   \
+    {                                                                                              \
+        (a) += G((b), (c), (d)) + (x) + (uint32_t)(ac);                                            \
+        (a) = ROTATE_LEFT((a), (s));                                                               \
+        (a) += (b);                                                                                \
     }
-#define HH(a, b, c, d, x, s, ac)                        \
-    {                                                   \
-        (a) += H((b), (c), (d)) + (x) + (uint32_t)(ac); \
-        (a) = ROTATE_LEFT((a), (s));                    \
-        (a) += (b);                                     \
+#define HH(a, b, c, d, x, s, ac)                                                                   \
+    {                                                                                              \
+        (a) += H((b), (c), (d)) + (x) + (uint32_t)(ac);                                            \
+        (a) = ROTATE_LEFT((a), (s));                                                               \
+        (a) += (b);                                                                                \
     }
-#define II(a, b, c, d, x, s, ac)                        \
-    {                                                   \
-        (a) += I((b), (c), (d)) + (x) + (uint32_t)(ac); \
-        (a) = ROTATE_LEFT((a), (s));                    \
-        (a) += (b);                                     \
+#define II(a, b, c, d, x, s, ac)                                                                   \
+    {                                                                                              \
+        (a) += I((b), (c), (d)) + (x) + (uint32_t)(ac);                                            \
+        (a) = ROTATE_LEFT((a), (s));                                                               \
+        (a) += (b);                                                                                \
     }
 
 /**
@@ -195,8 +194,7 @@ EXP_FUNC void STDCALL MD5Final(uint8_t* digest, MD5_CTX* ctx)
  */
 static void MD5Transform(uint32_t state[4], const uint8_t block[64])
 {
-    uint32_t a = state[0], b = state[1], c = state[2],
-             d = state[3], x[MD5_SIZE];
+    uint32_t a = state[0], b = state[1], c = state[2], d = state[3], x[MD5_SIZE];
 
     Decode(x, block, 64);
 
@@ -304,5 +302,6 @@ static void Decode(uint32_t* output, const uint8_t* input, uint32_t len)
     uint32_t i, j;
 
     for (i = 0, j = 0; j < len; i++, j += 4)
-        output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j + 1]) << 8) | (((uint32_t)input[j + 2]) << 16) | (((uint32_t)input[j + 3]) << 24);
+        output[i] = ((uint32_t)input[j]) | (((uint32_t)input[j + 1]) << 8)
+                    | (((uint32_t)input[j + 2]) << 16) | (((uint32_t)input[j + 3]) << 24);
 }
diff --git a/tests/host/common/mock.h b/tests/host/common/mock.h
index d11714df0e..df43fc998b 100644
--- a/tests/host/common/mock.h
+++ b/tests/host/common/mock.h
@@ -30,7 +30,8 @@
 */
 
 #define CORE_MOCK 1
-#define MOCK "(mock) "  // TODO: provide common logging API instead of adding this string everywhere?
+#define MOCK                                                                                       \
+    "(mock) "  // TODO: provide common logging API instead of adding this string everywhere?
 
 //
 
@@ -104,10 +105,7 @@ extern "C"
     int ets_printf(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
 #define os_printf_plus printf
 #define ets_vsnprintf vsnprintf
-    inline void ets_putc(char c)
-    {
-        putchar(c);
-    }
+    inline void ets_putc(char c) { putchar(c); }
 
     int mockverbose(const char* fmt, ...) __attribute__((format(printf, 1, 2)));
 
@@ -157,10 +155,14 @@ int     serverAccept(int sock);
 void   check_incoming_udp();
 int    mockUDPSocket();
 bool   mockUDPListen(int sock, uint32_t dstaddr, uint16_t port, uint32_t mcast = 0);
-size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize, uint8_t addr[16], uint16_t& port);
-size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
-size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf, size_t& ccinbufsize);
-size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4, uint16_t port);
+size_t mockUDPFillInBuf(int sock, char* ccinbuf, size_t& ccinbufsize, uint8_t& addrsize,
+                        uint8_t addr[16], uint16_t& port);
+size_t mockUDPPeekBytes(int sock, char* dst, size_t usersize, int timeout_ms, char* ccinbuf,
+                        size_t& ccinbufsize);
+size_t mockUDPRead(int sock, char* dst, size_t size, int timeout_ms, char* ccinbuf,
+                   size_t& ccinbufsize);
+size_t mockUDPWrite(int sock, const uint8_t* data, size_t size, int timeout_ms, uint32_t ipv4,
+                    uint16_t port);
 void   mockUDPSwallow(size_t copied, char* ccinbuf, size_t& ccinbufsize);
 
 class UdpContext;
@@ -168,9 +170,11 @@ void register_udp(int sock, UdpContext* udp = nullptr);
 
 //
 
-void mock_start_spiffs(const String& fname, size_t size_kb, size_t block_kb = 8, size_t page_b = 512);
+void mock_start_spiffs(const String& fname, size_t size_kb, size_t block_kb = 8,
+                       size_t page_b = 512);
 void mock_stop_spiffs();
-void mock_start_littlefs(const String& fname, size_t size_kb, size_t block_kb = 8, size_t page_b = 512);
+void mock_start_littlefs(const String& fname, size_t size_kb, size_t block_kb = 8,
+                         size_t page_b = 512);
 void mock_stop_littlefs();
 
 //
diff --git a/tests/host/common/noniso.c b/tests/host/common/noniso.c
index e1ed3f1b67..31d239dc45 100644
--- a/tests/host/common/noniso.c
+++ b/tests/host/common/noniso.c
@@ -1,14 +1,14 @@
 /*
  noniso.cpp - replacements for non-ISO functions used by Arduino core
  Copyright © 2016 Ivan Grokhotkov
- 
+
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:
- 
+
  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.
 */
@@ -90,10 +90,7 @@ char* itoa(int value, char* result, int base)
     return result;
 }
 
-int atoi(const char* s)
-{
-    return (int)atol(s);
-}
+int atoi(const char* s) { return (int)atol(s); }
 
 long atol(const char* s)
 {
diff --git a/tests/host/common/pins_arduino.h b/tests/host/common/pins_arduino.h
index c3a66453b7..5674fc61c8 100644
--- a/tests/host/common/pins_arduino.h
+++ b/tests/host/common/pins_arduino.h
@@ -1,14 +1,14 @@
 /*
  pins_arduino.h
  Copyright © 2016 Ivan Grokhotkov
- 
+
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:
- 
+
  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.
  */
diff --git a/tests/host/common/queue.h b/tests/host/common/queue.h
index 6d7e015045..0bd32e50d8 100644
--- a/tests/host/common/queue.h
+++ b/tests/host/common/queue.h
@@ -106,21 +106,21 @@
 /*
  * Singly-linked List declarations.
  */
-#define SLIST_HEAD(name, type)                      \
-    struct name                                     \
-    {                                               \
-        struct type* slh_first; /* first element */ \
+#define SLIST_HEAD(name, type)                                                                     \
+    struct name                                                                                    \
+    {                                                                                              \
+        struct type* slh_first; /* first element */                                                \
     }
 
-#define SLIST_HEAD_INITIALIZER(head) \
-    {                                \
-        NULL                         \
+#define SLIST_HEAD_INITIALIZER(head)                                                               \
+    {                                                                                              \
+        NULL                                                                                       \
     }
 
-#define SLIST_ENTRY(type)                         \
-    struct                                        \
-    {                                             \
-        struct type* sle_next; /* next element */ \
+#define SLIST_ENTRY(type)                                                                          \
+    struct                                                                                         \
+    {                                                                                              \
+        struct type* sle_next; /* next element */                                                  \
     }
 
 /*
@@ -130,185 +130,184 @@
 
 #define SLIST_FIRST(head) ((head)->slh_first)
 
-#define SLIST_FOREACH(var, head, field) \
-    for ((var) = SLIST_FIRST((head));   \
-         (var);                         \
-         (var) = SLIST_NEXT((var), field))
+#define SLIST_FOREACH(var, head, field)                                                            \
+    for ((var) = SLIST_FIRST((head)); (var); (var) = SLIST_NEXT((var), field))
 
-#define SLIST_INIT(head)            \
-    do                              \
-    {                               \
-        SLIST_FIRST((head)) = NULL; \
+#define SLIST_INIT(head)                                                                           \
+    do                                                                                             \
+    {                                                                                              \
+        SLIST_FIRST((head)) = NULL;                                                                \
     } while (0)
 
-#define SLIST_INSERT_AFTER(slistelm, elm, field)                       \
-    do                                                                 \
-    {                                                                  \
-        SLIST_NEXT((elm), field)      = SLIST_NEXT((slistelm), field); \
-        SLIST_NEXT((slistelm), field) = (elm);                         \
+#define SLIST_INSERT_AFTER(slistelm, elm, field)                                                   \
+    do                                                                                             \
+    {                                                                                              \
+        SLIST_NEXT((elm), field)      = SLIST_NEXT((slistelm), field);                             \
+        SLIST_NEXT((slistelm), field) = (elm);                                                     \
     } while (0)
 
-#define SLIST_INSERT_HEAD(head, elm, field)             \
-    do                                                  \
-    {                                                   \
-        SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
-        SLIST_FIRST((head))      = (elm);               \
+#define SLIST_INSERT_HEAD(head, elm, field)                                                        \
+    do                                                                                             \
+    {                                                                                              \
+        SLIST_NEXT((elm), field) = SLIST_FIRST((head));                                            \
+        SLIST_FIRST((head))      = (elm);                                                          \
     } while (0)
 
 #define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
 
-#define SLIST_REMOVE(head, elm, type, field)                                          \
-    do                                                                                \
-    {                                                                                 \
-        if (SLIST_FIRST((head)) == (elm))                                             \
-        {                                                                             \
-            SLIST_REMOVE_HEAD((head), field);                                         \
-        }                                                                             \
-        else                                                                          \
-        {                                                                             \
-            struct type* curelm = SLIST_FIRST((head));                                \
-            while (SLIST_NEXT(curelm, field) != (elm))                                \
-                curelm = SLIST_NEXT(curelm, field);                                   \
-            SLIST_NEXT(curelm, field) = SLIST_NEXT(SLIST_NEXT(curelm, field), field); \
-        }                                                                             \
+#define SLIST_REMOVE(head, elm, type, field)                                                       \
+    do                                                                                             \
+    {                                                                                              \
+        if (SLIST_FIRST((head)) == (elm))                                                          \
+        {                                                                                          \
+            SLIST_REMOVE_HEAD((head), field);                                                      \
+        }                                                                                          \
+        else                                                                                       \
+        {                                                                                          \
+            struct type* curelm = SLIST_FIRST((head));                                             \
+            while (SLIST_NEXT(curelm, field) != (elm))                                             \
+                curelm = SLIST_NEXT(curelm, field);                                                \
+            SLIST_NEXT(curelm, field) = SLIST_NEXT(SLIST_NEXT(curelm, field), field);              \
+        }                                                                                          \
     } while (0)
 
-#define SLIST_REMOVE_HEAD(head, field)                                \
-    do                                                                \
-    {                                                                 \
-        SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
+#define SLIST_REMOVE_HEAD(head, field)                                                             \
+    do                                                                                             \
+    {                                                                                              \
+        SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field);                              \
     } while (0)
 
 /*
  * Singly-linked Tail queue declarations.
  */
-#define STAILQ_HEAD(name, type)                                   \
-    struct name                                                   \
-    {                                                             \
-        struct type*  stqh_first; /* first element */             \
-        struct type** stqh_last;  /* addr of last next element */ \
+#define STAILQ_HEAD(name, type)                                                                    \
+    struct name                                                                                    \
+    {                                                                                              \
+        struct type*  stqh_first; /* first element */                                              \
+        struct type** stqh_last;  /* addr of last next element */                                  \
     }
 
-#define STAILQ_HEAD_INITIALIZER(head) \
-    {                                 \
-        NULL, &(head).stqh_first      \
+#define STAILQ_HEAD_INITIALIZER(head)                                                              \
+    {                                                                                              \
+        NULL, &(head).stqh_first                                                                   \
     }
 
-#define STAILQ_ENTRY(type)                         \
-    struct                                         \
-    {                                              \
-        struct type* stqe_next; /* next element */ \
+#define STAILQ_ENTRY(type)                                                                         \
+    struct                                                                                         \
+    {                                                                                              \
+        struct type* stqe_next; /* next element */                                                 \
     }
 
 /*
  * Singly-linked Tail queue functions.
  */
-#define STAILQ_CONCAT(head1, head2)                    \
-    do                                                 \
-    {                                                  \
-        if (!STAILQ_EMPTY((head2)))                    \
-        {                                              \
-            *(head1)->stqh_last = (head2)->stqh_first; \
-            (head1)->stqh_last  = (head2)->stqh_last;  \
-            STAILQ_INIT((head2));                      \
-        }                                              \
+#define STAILQ_CONCAT(head1, head2)                                                                \
+    do                                                                                             \
+    {                                                                                              \
+        if (!STAILQ_EMPTY((head2)))                                                                \
+        {                                                                                          \
+            *(head1)->stqh_last = (head2)->stqh_first;                                             \
+            (head1)->stqh_last  = (head2)->stqh_last;                                              \
+            STAILQ_INIT((head2));                                                                  \
+        }                                                                                          \
     } while (0)
 
 #define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
 
 #define STAILQ_FIRST(head) ((head)->stqh_first)
 
-#define STAILQ_FOREACH(var, head, field) \
-    for ((var) = STAILQ_FIRST((head));   \
-         (var);                          \
-         (var) = STAILQ_NEXT((var), field))
+#define STAILQ_FOREACH(var, head, field)                                                           \
+    for ((var) = STAILQ_FIRST((head)); (var); (var) = STAILQ_NEXT((var), field))
 
-#define STAILQ_INIT(head)                             \
-    do                                                \
-    {                                                 \
-        STAILQ_FIRST((head)) = NULL;                  \
-        (head)->stqh_last    = &STAILQ_FIRST((head)); \
+#define STAILQ_INIT(head)                                                                          \
+    do                                                                                             \
+    {                                                                                              \
+        STAILQ_FIRST((head)) = NULL;                                                               \
+        (head)->stqh_last    = &STAILQ_FIRST((head));                                              \
     } while (0)
 
-#define STAILQ_INSERT_AFTER(head, tqelm, elm, field)                           \
-    do                                                                         \
-    {                                                                          \
-        if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL) \
-            (head)->stqh_last = &STAILQ_NEXT((elm), field);                    \
-        STAILQ_NEXT((tqelm), field) = (elm);                                   \
+#define STAILQ_INSERT_AFTER(head, tqelm, elm, field)                                               \
+    do                                                                                             \
+    {                                                                                              \
+        if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)                     \
+            (head)->stqh_last = &STAILQ_NEXT((elm), field);                                        \
+        STAILQ_NEXT((tqelm), field) = (elm);                                                       \
     } while (0)
 
-#define STAILQ_INSERT_HEAD(head, elm, field)                            \
-    do                                                                  \
-    {                                                                   \
-        if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
-            (head)->stqh_last = &STAILQ_NEXT((elm), field);             \
-        STAILQ_FIRST((head)) = (elm);                                   \
+#define STAILQ_INSERT_HEAD(head, elm, field)                                                       \
+    do                                                                                             \
+    {                                                                                              \
+        if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL)                            \
+            (head)->stqh_last = &STAILQ_NEXT((elm), field);                                        \
+        STAILQ_FIRST((head)) = (elm);                                                              \
     } while (0)
 
-#define STAILQ_INSERT_TAIL(head, elm, field)                    \
-    do                                                          \
-    {                                                           \
-        STAILQ_NEXT((elm), field) = NULL;                       \
-        *(head)->stqh_last        = (elm);                      \
-        (head)->stqh_last         = &STAILQ_NEXT((elm), field); \
+#define STAILQ_INSERT_TAIL(head, elm, field)                                                       \
+    do                                                                                             \
+    {                                                                                              \
+        STAILQ_NEXT((elm), field) = NULL;                                                          \
+        *(head)->stqh_last        = (elm);                                                         \
+        (head)->stqh_last         = &STAILQ_NEXT((elm), field);                                    \
     } while (0)
 
-#define STAILQ_LAST(head, type, field) \
-    (STAILQ_EMPTY((head)) ? NULL : ((struct type*)((char*)((head)->stqh_last) - __offsetof(struct type, field))))
+#define STAILQ_LAST(head, type, field)                                                             \
+    (STAILQ_EMPTY((head)) ?                                                                        \
+         NULL :                                                                                    \
+         ((struct type*)((char*)((head)->stqh_last) - __offsetof(struct type, field))))
 
 #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
 
-#define STAILQ_REMOVE(head, elm, type, field)                                                          \
-    do                                                                                                 \
-    {                                                                                                  \
-        if (STAILQ_FIRST((head)) == (elm))                                                             \
-        {                                                                                              \
-            STAILQ_REMOVE_HEAD((head), field);                                                         \
-        }                                                                                              \
-        else                                                                                           \
-        {                                                                                              \
-            struct type* curelm = STAILQ_FIRST((head));                                                \
-            while (STAILQ_NEXT(curelm, field) != (elm))                                                \
-                curelm = STAILQ_NEXT(curelm, field);                                                   \
-            if ((STAILQ_NEXT(curelm, field) = STAILQ_NEXT(STAILQ_NEXT(curelm, field), field)) == NULL) \
-                (head)->stqh_last = &STAILQ_NEXT((curelm), field);                                     \
-        }                                                                                              \
+#define STAILQ_REMOVE(head, elm, type, field)                                                      \
+    do                                                                                             \
+    {                                                                                              \
+        if (STAILQ_FIRST((head)) == (elm))                                                         \
+        {                                                                                          \
+            STAILQ_REMOVE_HEAD((head), field);                                                     \
+        }                                                                                          \
+        else                                                                                       \
+        {                                                                                          \
+            struct type* curelm = STAILQ_FIRST((head));                                            \
+            while (STAILQ_NEXT(curelm, field) != (elm))                                            \
+                curelm = STAILQ_NEXT(curelm, field);                                               \
+            if ((STAILQ_NEXT(curelm, field) = STAILQ_NEXT(STAILQ_NEXT(curelm, field), field))      \
+                == NULL)                                                                           \
+                (head)->stqh_last = &STAILQ_NEXT((curelm), field);                                 \
+        }                                                                                          \
     } while (0)
 
-#define STAILQ_REMOVE_HEAD(head, field)                                                \
-    do                                                                                 \
-    {                                                                                  \
-        if ((STAILQ_FIRST((head)) = STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
-            (head)->stqh_last = &STAILQ_FIRST((head));                                 \
+#define STAILQ_REMOVE_HEAD(head, field)                                                            \
+    do                                                                                             \
+    {                                                                                              \
+        if ((STAILQ_FIRST((head)) = STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL)             \
+            (head)->stqh_last = &STAILQ_FIRST((head));                                             \
     } while (0)
 
-#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field)                      \
-    do                                                                  \
-    {                                                                   \
-        if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \
-            (head)->stqh_last = &STAILQ_FIRST((head));                  \
+#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field)                                                 \
+    do                                                                                             \
+    {                                                                                              \
+        if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL)                            \
+            (head)->stqh_last = &STAILQ_FIRST((head));                                             \
     } while (0)
 
 /*
  * List declarations.
  */
-#define LIST_HEAD(name, type)                      \
-    struct name                                    \
-    {                                              \
-        struct type* lh_first; /* first element */ \
+#define LIST_HEAD(name, type)                                                                      \
+    struct name                                                                                    \
+    {                                                                                              \
+        struct type* lh_first; /* first element */                                                 \
     }
 
-#define LIST_HEAD_INITIALIZER(head) \
-    {                               \
-        NULL                        \
+#define LIST_HEAD_INITIALIZER(head)                                                                \
+    {                                                                                              \
+        NULL                                                                                       \
     }
 
-#define LIST_ENTRY(type)                                              \
-    struct                                                            \
-    {                                                                 \
-        struct type*  le_next; /* next element */                     \
-        struct type** le_prev; /* address of previous next element */ \
+#define LIST_ENTRY(type)                                                                           \
+    struct                                                                                         \
+    {                                                                                              \
+        struct type*  le_next; /* next element */                                                  \
+        struct type** le_prev; /* address of previous next element */                              \
     }
 
 /*
@@ -319,168 +318,160 @@
 
 #define LIST_FIRST(head) ((head)->lh_first)
 
-#define LIST_FOREACH(var, head, field) \
-    for ((var) = LIST_FIRST((head));   \
-         (var);                        \
-         (var) = LIST_NEXT((var), field))
+#define LIST_FOREACH(var, head, field)                                                             \
+    for ((var) = LIST_FIRST((head)); (var); (var) = LIST_NEXT((var), field))
 
-#define LIST_INIT(head)            \
-    do                             \
-    {                              \
-        LIST_FIRST((head)) = NULL; \
+#define LIST_INIT(head)                                                                            \
+    do                                                                                             \
+    {                                                                                              \
+        LIST_FIRST((head)) = NULL;                                                                 \
     } while (0)
 
-#define LIST_INSERT_AFTER(listelm, elm, field)                                     \
-    do                                                                             \
-    {                                                                              \
-        if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)       \
-            LIST_NEXT((listelm), field)->field.le_prev = &LIST_NEXT((elm), field); \
-        LIST_NEXT((listelm), field) = (elm);                                       \
-        (elm)->field.le_prev        = &LIST_NEXT((listelm), field);                \
+#define LIST_INSERT_AFTER(listelm, elm, field)                                                     \
+    do                                                                                             \
+    {                                                                                              \
+        if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)                       \
+            LIST_NEXT((listelm), field)->field.le_prev = &LIST_NEXT((elm), field);                 \
+        LIST_NEXT((listelm), field) = (elm);                                                       \
+        (elm)->field.le_prev        = &LIST_NEXT((listelm), field);                                \
     } while (0)
 
-#define LIST_INSERT_BEFORE(listelm, elm, field)               \
-    do                                                        \
-    {                                                         \
-        (elm)->field.le_prev      = (listelm)->field.le_prev; \
-        LIST_NEXT((elm), field)   = (listelm);                \
-        *(listelm)->field.le_prev = (elm);                    \
-        (listelm)->field.le_prev  = &LIST_NEXT((elm), field); \
+#define LIST_INSERT_BEFORE(listelm, elm, field)                                                    \
+    do                                                                                             \
+    {                                                                                              \
+        (elm)->field.le_prev      = (listelm)->field.le_prev;                                      \
+        LIST_NEXT((elm), field)   = (listelm);                                                     \
+        *(listelm)->field.le_prev = (elm);                                                         \
+        (listelm)->field.le_prev  = &LIST_NEXT((elm), field);                                      \
     } while (0)
 
-#define LIST_INSERT_HEAD(head, elm, field)                                \
-    do                                                                    \
-    {                                                                     \
-        if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL)       \
-            LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field); \
-        LIST_FIRST((head))   = (elm);                                     \
-        (elm)->field.le_prev = &LIST_FIRST((head));                       \
+#define LIST_INSERT_HEAD(head, elm, field)                                                         \
+    do                                                                                             \
+    {                                                                                              \
+        if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL)                                \
+            LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);                          \
+        LIST_FIRST((head))   = (elm);                                                              \
+        (elm)->field.le_prev = &LIST_FIRST((head));                                                \
     } while (0)
 
 #define LIST_NEXT(elm, field) ((elm)->field.le_next)
 
-#define LIST_REMOVE(elm, field)                                            \
-    do                                                                     \
-    {                                                                      \
-        if (LIST_NEXT((elm), field) != NULL)                               \
-            LIST_NEXT((elm), field)->field.le_prev = (elm)->field.le_prev; \
-        *(elm)->field.le_prev = LIST_NEXT((elm), field);                   \
+#define LIST_REMOVE(elm, field)                                                                    \
+    do                                                                                             \
+    {                                                                                              \
+        if (LIST_NEXT((elm), field) != NULL)                                                       \
+            LIST_NEXT((elm), field)->field.le_prev = (elm)->field.le_prev;                         \
+        *(elm)->field.le_prev = LIST_NEXT((elm), field);                                           \
     } while (0)
 
 /*
  * Tail queue declarations.
  */
-#define TAILQ_HEAD(name, type)                                   \
-    struct name                                                  \
-    {                                                            \
-        struct type*  tqh_first; /* first element */             \
-        struct type** tqh_last;  /* addr of last next element */ \
+#define TAILQ_HEAD(name, type)                                                                     \
+    struct name                                                                                    \
+    {                                                                                              \
+        struct type*  tqh_first; /* first element */                                               \
+        struct type** tqh_last;  /* addr of last next element */                                   \
     }
 
-#define TAILQ_HEAD_INITIALIZER(head) \
-    {                                \
-        NULL, &(head).tqh_first      \
+#define TAILQ_HEAD_INITIALIZER(head)                                                               \
+    {                                                                                              \
+        NULL, &(head).tqh_first                                                                    \
     }
 
-#define TAILQ_ENTRY(type)                                              \
-    struct                                                             \
-    {                                                                  \
-        struct type*  tqe_next; /* next element */                     \
-        struct type** tqe_prev; /* address of previous next element */ \
+#define TAILQ_ENTRY(type)                                                                          \
+    struct                                                                                         \
+    {                                                                                              \
+        struct type*  tqe_next; /* next element */                                                 \
+        struct type** tqe_prev; /* address of previous next element */                             \
     }
 
 /*
  * Tail queue functions.
  */
-#define TAILQ_CONCAT(head1, head2, field)                            \
-    do                                                               \
-    {                                                                \
-        if (!TAILQ_EMPTY(head2))                                     \
-        {                                                            \
-            *(head1)->tqh_last                 = (head2)->tqh_first; \
-            (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last;  \
-            (head1)->tqh_last                  = (head2)->tqh_last;  \
-            TAILQ_INIT((head2));                                     \
-        }                                                            \
+#define TAILQ_CONCAT(head1, head2, field)                                                          \
+    do                                                                                             \
+    {                                                                                              \
+        if (!TAILQ_EMPTY(head2))                                                                   \
+        {                                                                                          \
+            *(head1)->tqh_last                 = (head2)->tqh_first;                               \
+            (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last;                                \
+            (head1)->tqh_last                  = (head2)->tqh_last;                                \
+            TAILQ_INIT((head2));                                                                   \
+        }                                                                                          \
     } while (0)
 
 #define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
 
 #define TAILQ_FIRST(head) ((head)->tqh_first)
 
-#define TAILQ_FOREACH(var, head, field) \
-    for ((var) = TAILQ_FIRST((head));   \
-         (var);                         \
-         (var) = TAILQ_NEXT((var), field))
-
-#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
-    for ((var) = TAILQ_LAST((head), headname);            \
-         (var);                                           \
-         (var) = TAILQ_PREV((var), headname, field))
-
-#define TAILQ_INIT(head)                            \
-    do                                              \
-    {                                               \
-        TAILQ_FIRST((head)) = NULL;                 \
-        (head)->tqh_last    = &TAILQ_FIRST((head)); \
+#define TAILQ_FOREACH(var, head, field)                                                            \
+    for ((var) = TAILQ_FIRST((head)); (var); (var) = TAILQ_NEXT((var), field))
+
+#define TAILQ_FOREACH_REVERSE(var, head, headname, field)                                          \
+    for ((var) = TAILQ_LAST((head), headname); (var); (var) = TAILQ_PREV((var), headname, field))
+
+#define TAILQ_INIT(head)                                                                           \
+    do                                                                                             \
+    {                                                                                              \
+        TAILQ_FIRST((head)) = NULL;                                                                \
+        (head)->tqh_last    = &TAILQ_FIRST((head));                                                \
     } while (0)
 
-#define TAILQ_INSERT_AFTER(head, listelm, elm, field)                             \
-    do                                                                            \
-    {                                                                             \
-        if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)    \
-            TAILQ_NEXT((elm), field)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
-        else                                                                      \
-            (head)->tqh_last = &TAILQ_NEXT((elm), field);                         \
-        TAILQ_NEXT((listelm), field) = (elm);                                     \
-        (elm)->field.tqe_prev        = &TAILQ_NEXT((listelm), field);             \
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field)                                              \
+    do                                                                                             \
+    {                                                                                              \
+        if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)                     \
+            TAILQ_NEXT((elm), field)->field.tqe_prev = &TAILQ_NEXT((elm), field);                  \
+        else                                                                                       \
+            (head)->tqh_last = &TAILQ_NEXT((elm), field);                                          \
+        TAILQ_NEXT((listelm), field) = (elm);                                                      \
+        (elm)->field.tqe_prev        = &TAILQ_NEXT((listelm), field);                              \
     } while (0)
 
-#define TAILQ_INSERT_BEFORE(listelm, elm, field)                \
-    do                                                          \
-    {                                                           \
-        (elm)->field.tqe_prev      = (listelm)->field.tqe_prev; \
-        TAILQ_NEXT((elm), field)   = (listelm);                 \
-        *(listelm)->field.tqe_prev = (elm);                     \
-        (listelm)->field.tqe_prev  = &TAILQ_NEXT((elm), field); \
+#define TAILQ_INSERT_BEFORE(listelm, elm, field)                                                   \
+    do                                                                                             \
+    {                                                                                              \
+        (elm)->field.tqe_prev      = (listelm)->field.tqe_prev;                                    \
+        TAILQ_NEXT((elm), field)   = (listelm);                                                    \
+        *(listelm)->field.tqe_prev = (elm);                                                        \
+        (listelm)->field.tqe_prev  = &TAILQ_NEXT((elm), field);                                    \
     } while (0)
 
-#define TAILQ_INSERT_HEAD(head, elm, field)                                  \
-    do                                                                       \
-    {                                                                        \
-        if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL)        \
-            TAILQ_FIRST((head))->field.tqe_prev = &TAILQ_NEXT((elm), field); \
-        else                                                                 \
-            (head)->tqh_last = &TAILQ_NEXT((elm), field);                    \
-        TAILQ_FIRST((head))   = (elm);                                       \
-        (elm)->field.tqe_prev = &TAILQ_FIRST((head));                        \
+#define TAILQ_INSERT_HEAD(head, elm, field)                                                        \
+    do                                                                                             \
+    {                                                                                              \
+        if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL)                              \
+            TAILQ_FIRST((head))->field.tqe_prev = &TAILQ_NEXT((elm), field);                       \
+        else                                                                                       \
+            (head)->tqh_last = &TAILQ_NEXT((elm), field);                                          \
+        TAILQ_FIRST((head))   = (elm);                                                             \
+        (elm)->field.tqe_prev = &TAILQ_FIRST((head));                                              \
     } while (0)
 
-#define TAILQ_INSERT_TAIL(head, elm, field)                   \
-    do                                                        \
-    {                                                         \
-        TAILQ_NEXT((elm), field) = NULL;                      \
-        (elm)->field.tqe_prev    = (head)->tqh_last;          \
-        *(head)->tqh_last        = (elm);                     \
-        (head)->tqh_last         = &TAILQ_NEXT((elm), field); \
+#define TAILQ_INSERT_TAIL(head, elm, field)                                                        \
+    do                                                                                             \
+    {                                                                                              \
+        TAILQ_NEXT((elm), field) = NULL;                                                           \
+        (elm)->field.tqe_prev    = (head)->tqh_last;                                               \
+        *(head)->tqh_last        = (elm);                                                          \
+        (head)->tqh_last         = &TAILQ_NEXT((elm), field);                                      \
     } while (0)
 
-#define TAILQ_LAST(head, headname) \
-    (*(((struct headname*)((head)->tqh_last))->tqh_last))
+#define TAILQ_LAST(head, headname) (*(((struct headname*)((head)->tqh_last))->tqh_last))
 
 #define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
 
-#define TAILQ_PREV(elm, headname, field) \
-    (*(((struct headname*)((elm)->field.tqe_prev))->tqh_last))
-
-#define TAILQ_REMOVE(head, elm, field)                                        \
-    do                                                                        \
-    {                                                                         \
-        if ((TAILQ_NEXT((elm), field)) != NULL)                               \
-            TAILQ_NEXT((elm), field)->field.tqe_prev = (elm)->field.tqe_prev; \
-        else                                                                  \
-            (head)->tqh_last = (elm)->field.tqe_prev;                         \
-        *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field);                    \
+#define TAILQ_PREV(elm, headname, field) (*(((struct headname*)((elm)->field.tqe_prev))->tqh_last))
+
+#define TAILQ_REMOVE(head, elm, field)                                                             \
+    do                                                                                             \
+    {                                                                                              \
+        if ((TAILQ_NEXT((elm), field)) != NULL)                                                    \
+            TAILQ_NEXT((elm), field)->field.tqe_prev = (elm)->field.tqe_prev;                      \
+        else                                                                                       \
+            (head)->tqh_last = (elm)->field.tqe_prev;                                              \
+        *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field);                                         \
     } while (0)
 
 #ifdef _KERNEL
@@ -498,11 +489,9 @@ struct quehead
 
 #ifdef __GNUC__
 
-static __inline void
-insque(void* a, void* b)
+static __inline void insque(void* a, void* b)
 {
-    struct quehead *element = (struct quehead*)a,
-                   *head    = (struct quehead*)b;
+    struct quehead *element = (struct quehead*)a, *head = (struct quehead*)b;
 
     element->qh_link           = head->qh_link;
     element->qh_rlink          = head;
@@ -510,8 +499,7 @@ insque(void* a, void* b)
     element->qh_link->qh_rlink = element;
 }
 
-static __inline void
-remque(void* a)
+static __inline void remque(void* a)
 {
     struct quehead* element = (struct quehead*)a;
 
diff --git a/tests/host/common/sdfs_mock.h b/tests/host/common/sdfs_mock.h
index d628c953f2..fd33b2f9c3 100644
--- a/tests/host/common/sdfs_mock.h
+++ b/tests/host/common/sdfs_mock.h
@@ -38,15 +38,15 @@ class SDFSMock
 extern uint64_t _sdCardSizeB;
 extern uint8_t* _sdCard;
 
-#define SDFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage)             \
-    SDFS.end();                                                           \
-    SDFSMock sdfs_mock(size_kb * 1024, block_kb * 1024, page_b, storage); \
-    free(_sdCard);                                                        \
-    _sdCardSizeB = size_kb ? 16 * 1024 * 1024 : 0;                        \
-    if (_sdCardSizeB)                                                     \
-        _sdCard = (uint8_t*)calloc(_sdCardSizeB, 1);                      \
-    else                                                                  \
-        _sdCard = nullptr;                                                \
+#define SDFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage)                                      \
+    SDFS.end();                                                                                    \
+    SDFSMock sdfs_mock(size_kb * 1024, block_kb * 1024, page_b, storage);                          \
+    free(_sdCard);                                                                                 \
+    _sdCardSizeB = size_kb ? 16 * 1024 * 1024 : 0;                                                 \
+    if (_sdCardSizeB)                                                                              \
+        _sdCard = (uint8_t*)calloc(_sdCardSizeB, 1);                                               \
+    else                                                                                           \
+        _sdCard = nullptr;                                                                         \
     SDFS.setConfig(SDFSConfig().setAutoFormat(true));
 #define SDFS_MOCK_RESET() sdfs_mock.reset()
 
diff --git a/tests/host/common/spiffs_mock.cpp b/tests/host/common/spiffs_mock.cpp
index c54cab3053..6406dc9a7d 100644
--- a/tests/host/common/spiffs_mock.cpp
+++ b/tests/host/common/spiffs_mock.cpp
@@ -55,7 +55,8 @@ SpiffsMock::SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const S
 
 void SpiffsMock::reset()
 {
-    SPIFFS = FS(FSImplPtr(new spiffs_impl::SPIFFSImpl(0, s_phys_size, s_phys_page, s_phys_block, 5)));
+    SPIFFS
+        = FS(FSImplPtr(new spiffs_impl::SPIFFSImpl(0, s_phys_size, s_phys_page, s_phys_block, 5)));
     load();
 }
 
@@ -93,20 +94,24 @@ void SpiffsMock::load()
 
     if (flen != (off_t)m_fs.size())
     {
-        fprintf(stderr, "SPIFFS: size of '%s': %d does not match requested size %zd\n", m_storage.c_str(), (int)flen, m_fs.size());
+        fprintf(stderr, "SPIFFS: size of '%s': %d does not match requested size %zd\n",
+                m_storage.c_str(), (int)flen, m_fs.size());
         if (!m_overwrite && flen > 0)
         {
             fprintf(stderr, "SPIFFS: aborting at user request\n");
             exit(1);
         }
-        fprintf(stderr, "SPIFFS: continuing without loading at user request, '%s' will be overwritten\n", m_storage.c_str());
+        fprintf(stderr,
+                "SPIFFS: continuing without loading at user request, '%s' will be overwritten\n",
+                m_storage.c_str());
     }
     else
     {
         fprintf(stderr, "SPIFFS: loading %zi bytes from '%s'\n", m_fs.size(), m_storage.c_str());
         ssize_t r = ::read(fs, m_fs.data(), m_fs.size());
         if (r != (ssize_t)m_fs.size())
-            fprintf(stderr, "SPIFFS: reading %zi bytes: returned %zd: %s\n", m_fs.size(), r, strerror(errno));
+            fprintf(stderr, "SPIFFS: reading %zi bytes: returned %zd: %s\n", m_fs.size(), r,
+                    strerror(errno));
     }
     ::close(fs);
 }
diff --git a/tests/host/common/spiffs_mock.h b/tests/host/common/spiffs_mock.h
index 18217a7ac5..a6227582c9 100644
--- a/tests/host/common/spiffs_mock.h
+++ b/tests/host/common/spiffs_mock.h
@@ -1,14 +1,14 @@
 /*
  spiffs_mock.h - SPIFFS HAL mock for host side testing
  Copyright © 2016 Ivan Grokhotkov
- 
+
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:
- 
+
  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.
 */
@@ -27,7 +27,8 @@
 class SpiffsMock
 {
 public:
-    SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page, const String& storage = emptyString);
+    SpiffsMock(ssize_t fs_size, size_t fs_block, size_t fs_page,
+               const String& storage = emptyString);
     void reset();
     ~SpiffsMock();
 
@@ -40,7 +41,8 @@ class SpiffsMock
     bool                 m_overwrite;
 };
 
-#define SPIFFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage) SpiffsMock spiffs_mock(size_kb * 1024, block_kb * 1024, page_b, storage)
+#define SPIFFS_MOCK_DECLARE(size_kb, block_kb, page_b, storage)                                    \
+    SpiffsMock spiffs_mock(size_kb * 1024, block_kb * 1024, page_b, storage)
 #define SPIFFS_MOCK_RESET() spiffs_mock.reset()
 
 #endif /* spiffs_mock_hpp */
diff --git a/tests/host/common/user_interface.cpp b/tests/host/common/user_interface.cpp
index 3b7f1226b5..951a4a8d85 100644
--- a/tests/host/common/user_interface.cpp
+++ b/tests/host/common/user_interface.cpp
@@ -62,9 +62,7 @@ bool DhcpServer::set_dhcps_offer_option(uint8 level, void* optarg)
     return false;
 }
 
-void DhcpServer::end()
-{
-}
+void DhcpServer::end() { }
 
 bool DhcpServer::begin(struct ip_info* info)
 {
@@ -72,15 +70,9 @@ bool DhcpServer::begin(struct ip_info* info)
     return false;
 }
 
-DhcpServer::DhcpServer(netif* netif)
-{
-    (void)netif;
-}
+DhcpServer::DhcpServer(netif* netif) { (void)netif; }
 
-DhcpServer::~DhcpServer()
-{
-    end();
-}
+DhcpServer::~DhcpServer() { end(); }
 
 DhcpServer dhcpSoftAP(nullptr);
 
@@ -89,35 +81,17 @@ extern "C"
 #include <user_interface.h>
 #include <lwip/netif.h>
 
-    uint8 wifi_get_opmode(void)
-    {
-        return STATION_MODE;
-    }
+    uint8 wifi_get_opmode(void) { return STATION_MODE; }
 
-    phy_mode_t wifi_get_phy_mode(void)
-    {
-        return PHY_MODE_11N;
-    }
+    phy_mode_t wifi_get_phy_mode(void) { return PHY_MODE_11N; }
 
-    uint8 wifi_get_channel(void)
-    {
-        return 1;
-    }
+    uint8 wifi_get_channel(void) { return 1; }
 
-    uint8 wifi_station_get_current_ap_id(void)
-    {
-        return 0;
-    }
+    uint8 wifi_station_get_current_ap_id(void) { return 0; }
 
-    station_status_t wifi_station_get_connect_status(void)
-    {
-        return STATION_GOT_IP;
-    }
+    station_status_t wifi_station_get_connect_status(void) { return STATION_GOT_IP; }
 
-    uint8 wifi_station_get_auto_connect(void)
-    {
-        return 1;
-    }
+    uint8 wifi_station_get_auto_connect(void) { return 1; }
 
     bool wifi_station_get_config(struct station_config* config)
     {
@@ -134,9 +108,7 @@ extern "C"
         return true;
     }
 
-    void wifi_fpm_close(void)
-    {
-    }
+    void wifi_fpm_close(void) { }
 
     sint8 wifi_fpm_do_sleep(uint32 sleep_time_in_us)
     {
@@ -144,18 +116,11 @@ extern "C"
         return 1;
     }
 
-    void wifi_fpm_do_wakeup(void)
-    {
-    }
+    void wifi_fpm_do_wakeup(void) { }
 
-    void wifi_fpm_open(void)
-    {
-    }
+    void wifi_fpm_open(void) { }
 
-    void wifi_fpm_set_sleep_type(sleep_type_t type)
-    {
-        (void)type;
-    }
+    void wifi_fpm_set_sleep_type(sleep_type_t type) { (void)type; }
 
     uint32_t global_ipv4_netfmt = 0;  // global binding
 
@@ -185,20 +150,22 @@ extern "C"
         for (ifa = ifAddrStruct; ifa != NULL; ifa = ifa->ifa_next)
         {
             mockverbose("host: interface: %s", ifa->ifa_name);
-            if (ifa->ifa_addr
-                && ifa->ifa_addr->sa_family == AF_INET  // ip_info is IPv4 only
+            if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET  // ip_info is IPv4 only
             )
             {
-                auto test_ipv4 = lwip_ntohl(*(uint32_t*)&((struct sockaddr_in*)ifa->ifa_addr)->sin_addr);
+                auto test_ipv4
+                    = lwip_ntohl(*(uint32_t*)&((struct sockaddr_in*)ifa->ifa_addr)->sin_addr);
                 mockverbose(" IPV4 (0x%08lx)", test_ipv4);
                 if ((test_ipv4 & 0xff000000) == 0x7f000000)
                     // 127./8
                     mockverbose(" (local, ignored)");
                 else
                 {
-                    if (!host_interface || (host_interface && strcmp(ifa->ifa_name, host_interface) == 0))
+                    if (!host_interface
+                        || (host_interface && strcmp(ifa->ifa_name, host_interface) == 0))
                     {
-                        // use the first non-local interface, or, if specified, the one selected by user on cmdline
+                        // use the first non-local interface, or, if specified, the one selected by
+                        // user on cmdline
                         ipv4 = *(uint32_t*)&((struct sockaddr_in*)ifa->ifa_addr)->sin_addr;
                         mask = *(uint32_t*)&((struct sockaddr_in*)ifa->ifa_netmask)->sin_addr;
                         mockverbose(" (selected)\n");
@@ -215,7 +182,7 @@ extern "C"
             freeifaddrs(ifAddrStruct);
 
         (void)if_index;
-        //if (if_index != STATION_IF)
+        // if (if_index != STATION_IF)
         //	fprintf(stderr, "we are not AP");
 
         if (global_ipv4_netfmt == NO_GLOBAL_BINDING)
@@ -237,10 +204,7 @@ extern "C"
         return true;
     }
 
-    uint8 wifi_get_listen_interval(void)
-    {
-        return 1;
-    }
+    uint8 wifi_get_listen_interval(void) { return 1; }
 
     bool wifi_get_macaddr(uint8 if_index, uint8* macaddr)
     {
@@ -254,24 +218,15 @@ extern "C"
         return true;
     }
 
-    uint8 wifi_get_opmode_default(void)
-    {
-        return STATION_MODE;
-    }
+    uint8 wifi_get_opmode_default(void) { return STATION_MODE; }
 
 #ifdef NONOSDK3V0
 
-    sleep_level_t wifi_get_sleep_level(void)
-    {
-        return MIN_SLEEP_T;
-    }
+    sleep_level_t wifi_get_sleep_level(void) { return MIN_SLEEP_T; }
 
 #endif  // nonos-sdk-pre-3
 
-    sleep_type_t wifi_get_sleep_type(void)
-    {
-        return NONE_SLEEP_T;
-    }
+    sleep_type_t wifi_get_sleep_type(void) { return NONE_SLEEP_T; }
 
     bool wifi_set_channel(uint8 channel)
     {
@@ -331,25 +286,13 @@ extern "C"
         return true;
     }
 
-    bool wifi_station_connect(void)
-    {
-        return true;
-    }
+    bool wifi_station_connect(void) { return true; }
 
-    bool wifi_station_dhcpc_start(void)
-    {
-        return true;
-    }
+    bool wifi_station_dhcpc_start(void) { return true; }
 
-    bool wifi_station_dhcpc_stop(void)
-    {
-        return true;
-    }
+    bool wifi_station_dhcpc_stop(void) { return true; }
 
-    bool wifi_station_disconnect(void)
-    {
-        return true;
-    }
+    bool wifi_station_disconnect(void) { return true; }
 
     bool wifi_station_get_config_default(struct station_config* config)
     {
@@ -362,20 +305,11 @@ extern "C"
         return strcpy(wifi_station_get_hostname_str, "esposix");
     }
 
-    bool wifi_station_get_reconnect_policy()
-    {
-        return true;
-    }
+    bool wifi_station_get_reconnect_policy() { return true; }
 
-    sint8 wifi_station_get_rssi(void)
-    {
-        return 5;
-    }
+    sint8 wifi_station_get_rssi(void) { return 5; }
 
-    bool wifi_station_set_auto_connect(uint8 set)
-    {
-        return set != 0;
-    }
+    bool wifi_station_set_auto_connect(uint8 set) { return set != 0; }
 
     bool wifi_station_set_config(struct station_config* config)
     {
@@ -401,25 +335,13 @@ extern "C"
         return true;
     }
 
-    void system_phy_set_max_tpw(uint8 max_tpw)
-    {
-        (void)max_tpw;
-    }
+    void system_phy_set_max_tpw(uint8 max_tpw) { (void)max_tpw; }
 
-    bool wifi_softap_dhcps_start(void)
-    {
-        return true;
-    }
+    bool wifi_softap_dhcps_start(void) { return true; }
 
-    enum dhcp_status wifi_softap_dhcps_status(void)
-    {
-        return DHCP_STARTED;
-    }
+    enum dhcp_status wifi_softap_dhcps_status(void) { return DHCP_STARTED; }
 
-    bool wifi_softap_dhcps_stop(void)
-    {
-        return true;
-    }
+    bool wifi_softap_dhcps_stop(void) { return true; }
 
     bool wifi_softap_get_config(struct softap_config* config)
     {
@@ -439,10 +361,7 @@ extern "C"
         return wifi_softap_get_config(config);
     }
 
-    uint8 wifi_softap_get_station_num(void)
-    {
-        return 2;
-    }
+    uint8 wifi_softap_get_station_num(void) { return 2; }
 
     bool wifi_softap_set_config(struct softap_config* config)
     {
@@ -487,15 +406,9 @@ extern "C"
     ///////////////////////////////////////
     // not user_interface
 
-    void ets_isr_mask(int intr)
-    {
-        (void)intr;
-    }
+    void ets_isr_mask(int intr) { (void)intr; }
 
-    void ets_isr_unmask(int intr)
-    {
-        (void)intr;
-    }
+    void ets_isr_unmask(int intr) { (void)intr; }
 
     void dns_setserver(u8_t numdns, ip_addr_t* dnsserver)
     {
@@ -513,19 +426,13 @@ extern "C"
 #include <smartconfig.h>
     bool smartconfig_start(sc_callback_t cb, ...)
     {
-        //XXXFIXME ... -> ptr
+        // XXXFIXME ... -> ptr
         cb(SC_STATUS_LINK, NULL);
         return true;
     }
 
-    bool smartconfig_stop(void)
-    {
-        return true;
-    }
+    bool smartconfig_stop(void) { return true; }
 
-    sleep_type_t wifi_fpm_get_sleep_type(void)
-    {
-        return NONE_SLEEP_T;
-    }
+    sleep_type_t wifi_fpm_get_sleep_type(void) { return NONE_SLEEP_T; }
 
 }  // extern "C"
diff --git a/tests/host/core/test_PolledTimeout.cpp b/tests/host/core/test_PolledTimeout.cpp
index b03a2af624..f37eaa26ef 100644
--- a/tests/host/core/test_PolledTimeout.cpp
+++ b/tests/host/core/test_PolledTimeout.cpp
@@ -4,10 +4,8 @@
 #define mockverbose printf
 #include "common/MockEsp.cpp"  // getCycleCount
 
-//This won't work for
-template <typename argT>
-inline bool
-fuzzycomp(argT a, argT b)
+// This won't work for
+template <typename argT> inline bool fuzzycomp(argT a, argT b)
 {
     const argT epsilon = 10;
     return (std::max(a, b) - std::min(a, b) <= epsilon);
diff --git a/tests/host/core/test_md5builder.cpp b/tests/host/core/test_md5builder.cpp
index ec59569918..b0a521cb8e 100644
--- a/tests/host/core/test_md5builder.cpp
+++ b/tests/host/core/test_md5builder.cpp
@@ -38,7 +38,8 @@ TEST_CASE("MD5Builder::addHexString works as expected", "[core][MD5Builder]")
     {
         MD5Builder builder;
         builder.begin();
-        const char* myPayload = "1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696F6e73";
+        const char* myPayload = "1234567890abcdeffedcba98765432106469676974616c7369676e617475726561"
+                                "70706c69636174696F6e73";
         builder.addHexString(myPayload);
         builder.calculate();
         REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
@@ -48,7 +49,8 @@ TEST_CASE("MD5Builder::addHexString works as expected", "[core][MD5Builder]")
     {
         MD5Builder builder;
         builder.begin();
-        builder.addHexString(String("1234567890abcdeffedcba98765432106469676974616c7369676e61747572656170706c69636174696f6e73"));
+        builder.addHexString(String("1234567890abcdeffedcba98765432106469676974616c7369676e61747572"
+                                    "656170706c69636174696f6e73"));
         builder.calculate();
         REQUIRE(builder.toString() == "47b937a6f9f12a4c389fa5854e023efb");
     }
@@ -57,7 +59,8 @@ TEST_CASE("MD5Builder::addHexString works as expected", "[core][MD5Builder]")
 TEST_CASE("MD5Builder::addStream works", "[core][MD5Builder]")
 {
     MD5Builder  builder;
-    const char* str = "MD5Builder::addStream_works_longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong";
+    const char* str = "MD5Builder::addStream_works_"
+                      "longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong";
     {
         StreamString stream;
         stream.print(str);
diff --git a/tests/host/core/test_string.cpp b/tests/host/core/test_string.cpp
index b0f4012aef..25de913108 100644
--- a/tests/host/core/test_string.cpp
+++ b/tests/host/core/test_string.cpp
@@ -135,13 +135,21 @@ TEST_CASE("String concantenation", "[core][String]")
     str += LLONG_MIN;
     REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01-9223372036854775808");
     str += String(LLONG_MIN, 10);
-    REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01-9223372036854775808-9223372036854775808");
+    REQUIRE(str
+            == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01-9223372036854775808-"
+               "9223372036854775808");
     str += LLONG_MAX;
-    REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01-9223372036854775808-92233720368547758089223372036854775807");
+    REQUIRE(str
+            == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01-9223372036854775808-"
+               "92233720368547758089223372036854775807");
     str += ULLONG_MAX;
-    REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01-9223372036854775808-9223372036854775808922337203685477580718446744073709551615");
+    REQUIRE(str
+            == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01-9223372036854775808-"
+               "9223372036854775808922337203685477580718446744073709551615");
     str += String(ULLONG_MAX, 16);
-    REQUIRE(str == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01-9223372036854775808-9223372036854775808922337203685477580718446744073709551615ffffffffffffffff");
+    REQUIRE(str
+            == "abcdeabcde9872147483647-2147483648691969-123321-1.011.01-9223372036854775808-"
+               "9223372036854775808922337203685477580718446744073709551615ffffffffffffffff");
     str = "clean";
     REQUIRE(str.concat(str) == true);
     REQUIRE(str == "cleanclean");
@@ -502,8 +510,8 @@ TEST_CASE("Issue #2736 - StreamString SSO fix", "[core][StreamString]")
 
 TEST_CASE("Strings with NULs", "[core][String]")
 {
-    // The following should never be done in a real app! This is only to inject 0s in the middle of a string.
-    // Fits in SSO...
+    // The following should never be done in a real app! This is only to inject 0s in the middle of
+    // a string. Fits in SSO...
     String str("01234567");
     REQUIRE(str.length() == 8);
     char* ptr = (char*)str.c_str();
@@ -559,12 +567,7 @@ TEST_CASE("Replace and string expansion", "[core][String]")
 
 TEST_CASE("String chaining", "[core][String]")
 {
-    const char* chunks[] {
-        "~12345",
-        "67890",
-        "qwertyuiopasdfghjkl",
-        "zxcvbnm"
-    };
+    const char* chunks[] { "~12345", "67890", "qwertyuiopasdfghjkl", "zxcvbnm" };
 
     String all;
     for (auto* chunk : chunks)
@@ -576,8 +579,10 @@ TEST_CASE("String chaining", "[core][String]")
     REQUIRE((String(chunks[0]) + String(chunks[1]) + String(chunks[2]) + String(chunks[3])) == all);
     REQUIRE((chunks[0] + String(chunks[1]) + F(chunks[2]) + chunks[3]) == all);
     REQUIRE((String(chunks[0]) + F(chunks[1]) + F(chunks[2]) + String(chunks[3])) == all);
-    REQUIRE(('~' + String(&chunks[0][0] + 1) + chunks[1] + String(chunks[2]) + F(chunks[3])) == all);
-    REQUIRE((String(chunks[0]) + '6' + (&chunks[1][0] + 1) + String(chunks[2]) + F(chunks[3])) == all);
+    REQUIRE(('~' + String(&chunks[0][0] + 1) + chunks[1] + String(chunks[2]) + F(chunks[3]))
+            == all);
+    REQUIRE((String(chunks[0]) + '6' + (&chunks[1][0] + 1) + String(chunks[2]) + F(chunks[3]))
+            == all);
 
     // these are still invalid (and also cannot compile at all):
     // - `F(...)` + `F(...)`
diff --git a/tests/host/fs/test_fs.cpp b/tests/host/fs/test_fs.cpp
index 7ad58e403b..900521b47e 100644
--- a/tests/host/fs/test_fs.cpp
+++ b/tests/host/fs/test_fs.cpp
@@ -66,7 +66,8 @@ namespace littlefs_test
 #define FSTYPE LittleFS
 #define TESTPRE "LittleFS - "
 #define TESTPAT "[lfs]"
-// LittleFS routines strip leading slashes before doing anything, so up to 31 char names are allowable
+// LittleFS routines strip leading slashes before doing anything, so up to 31 char names are
+// allowable
 #define TOOLONGFILENAME "/12345678901234567890123456789012"
 #define FS_MOCK_DECLARE LITTLEFS_MOCK_DECLARE
 #define FS_MOCK_RESET LITTLEFS_MOCK_RESET
@@ -101,10 +102,13 @@ namespace sdfs_test
 #define TESTPRE "SDFS - "
 #define TESTPAT "[sdfs]"
 // SDFS supports long paths (MAXPATH)
-#define TOOLONGFILENAME "/"                                                                                                    \
-                        "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
-                        "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" \
-                        "12345678901234567890123456789012345678901234567890123456"
+#define TOOLONGFILENAME                                                                            \
+    "/"                                                                                            \
+    "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012" \
+    "34567890"                                                                                     \
+    "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012" \
+    "34567890"                                                                                     \
+    "12345678901234567890123456789012345678901234567890123456"
 #define FS_MOCK_DECLARE SDFS_MOCK_DECLARE
 #define FS_MOCK_RESET SDFS_MOCK_RESET
 #define FS_HAS_DIRS
diff --git a/tests/host/sys/pgmspace.h b/tests/host/sys/pgmspace.h
index 321626542a..e48a945fe5 100644
--- a/tests/host/sys/pgmspace.h
+++ b/tests/host/sys/pgmspace.h
@@ -54,10 +54,16 @@
 // Wrapper inlines for _P functions
 #include <stdio.h>
 #include <string.h>
-inline const char* strstr_P(const char* haystack, const char* needle) { return strstr(haystack, needle); }
-inline char*       strcpy_P(char* dest, const char* src) { return strcpy(dest, src); }
-inline size_t      strlen_P(const char* s) { return strlen(s); }
-inline int         vsnprintf_P(char* str, size_t size, const char* format, va_list ap) { return vsnprintf(str, size, format, ap); }
+inline const char* strstr_P(const char* haystack, const char* needle)
+{
+    return strstr(haystack, needle);
+}
+inline char*  strcpy_P(char* dest, const char* src) { return strcpy(dest, src); }
+inline size_t strlen_P(const char* s) { return strlen(s); }
+inline int    vsnprintf_P(char* str, size_t size, const char* format, va_list ap)
+{
+    return vsnprintf(str, size, format, ap);
+}
 
 #define memcpy_P memcpy
 #define memmove_P memmove
diff --git a/tests/restyle.sh b/tests/restyle.sh
index 03401b0e36..d5afbe504e 100755
--- a/tests/restyle.sh
+++ b/tests/restyle.sh
@@ -20,7 +20,7 @@ makeClangConf()
 BasedOnStyle: WebKit
 SortIncludes: false
 AlignTrailingComments: true
-ColumnLimit: 0
+ColumnLimit: 100
 KeepEmptyLinesAtTheStartOfBlocks: false
 SpaceBeforeInheritanceColon: false
 SpacesBeforeTrailingComments: 2
@@ -29,8 +29,10 @@ AlignConsecutiveAssignments: Consecutive
 AlignConsecutiveBitFields: Consecutive
 AlignConsecutiveDeclarations: Consecutive
 AlignAfterOpenBracket: Align
+AlignOperands: Align
 BreakConstructorInitializers: AfterColon
 BreakBeforeBinaryOperators: All
+BreakBeforeTernaryOperators: false
 BreakBeforeConceptDeclarations: true
 FixNamespaceComments: true
 NamespaceIndentation: Inner
@@ -83,3 +85,7 @@ for d in libraries; do
     echo "-------- examples in $d:"
     find $d -name "*.ino" -exec clang-format-12 -i {} \;
 done
+
+#########################################
+
+rm -f .clang-format