Browse Source

refactoring transport layer implementation

Strobel, Stefan | Friedrich Lütze GmbH 1 year ago
parent
commit
95de370e94

+ 1 - 1
.vscode/settings.json

@@ -3,5 +3,5 @@
         "sstream": "cpp",
         "sstream": "cpp",
         "regex": "cpp"
         "regex": "cpp"
     },
     },
-    "C_Cpp.default.defines": ["SHELLMATTA_AUTH", "SHELLMATTA_TRANSPORT_ENABLE"]
+    "C_Cpp.default.defines": ["SHELLMATTA_AUTH", "SHELLMATTA_TRANSPORT"]
 }
 }

+ 8 - 8
api/shellmatta.h

@@ -192,7 +192,7 @@ typedef struct shellmatta_cmd
     struct shellmatta_cmd   *next;      /**< pointer to next command or NULL        */
     struct shellmatta_cmd   *next;      /**< pointer to next command or NULL        */
 } shellmatta_cmd_t;
 } shellmatta_cmd_t;
 
 
-#ifdef SHELLMATTA_TRANSPORT_ENABLE
+#ifdef SHELLMATTA_TRANSPORT
 
 
 /**
 /**
  * @brief definition of shellmatta transport layer states
  * @brief definition of shellmatta transport layer states
@@ -252,9 +252,9 @@ typedef struct
     bool                            mandatory;          /**< is the transport layer enforced                */
     bool                            mandatory;          /**< is the transport layer enforced                */
     uint8_t                         sequenceH2S;        /**< sequence counter host to shellmatta            */
     uint8_t                         sequenceH2S;        /**< sequence counter host to shellmatta            */
     uint8_t                         sequenceS2H;        /**< sequenc counter shellmatta to host             */
     uint8_t                         sequenceS2H;        /**< sequenc counter shellmatta to host             */
-    uint32_t                        headerIndex;        /**< read indey of the header                       */
+    uint32_t                        headerIndex;        /**< read index of the header                       */
     uint32_t                        payloadIndex;       /**< read index of the payload                      */
     uint32_t                        payloadIndex;       /**< read index of the payload                      */
-    uint32_t                        crcIndex;           /**< read index of the checmsum                     */
+    uint32_t                        crcIndex;           /**< read index of the checksum                     */
     shellmatta_transport_packet_t   inPacket;           /**< buffer for the received packets                */
     shellmatta_transport_packet_t   inPacket;           /**< buffer for the received packets                */
     shellmatta_transport_packet_t   outPacket;          /**< buffer for the sent packets                    */
     shellmatta_transport_packet_t   outPacket;          /**< buffer for the sent packets                    */
     shellmatta_write_t              writeFct;           /**< shellmatta write function                      */
     shellmatta_write_t              writeFct;           /**< shellmatta write function                      */
@@ -316,7 +316,7 @@ typedef struct
     shellmatta_auth_check_t         checkFct;           /**< custom credential check function       */
     shellmatta_auth_check_t         checkFct;           /**< custom credential check function       */
     shellmatta_auth_log_t           logFct;             /**< auth log function                      */
     shellmatta_auth_log_t           logFct;             /**< auth log function                      */
 #endif
 #endif
-#ifdef SHELLMATTA_TRANSPORT_ENABLE
+#ifdef SHELLMATTA_TRANSPORT
     uint32_t                        transportBusyMark;  /**< transport processing position during 
     uint32_t                        transportBusyMark;  /**< transport processing position during 
                                                              busy cmd execution                     */
                                                              busy cmd execution                     */
     shellmatta_transport_layer_t    transportLayer;     /**< transport layer instance               */
     shellmatta_transport_layer_t    transportLayer;     /**< transport layer instance               */
@@ -326,7 +326,7 @@ typedef struct
 /**
 /**
  * @brief helper macro for the send function
  * @brief helper macro for the send function
  */
  */
-#ifdef SHELLMATTA_TRANSPORT_ENABLE
+#ifdef SHELLMATTA_TRANSPORT
 #define SHELLMATTA_WRITE(data, length)  inst->transportLayer.active == true ?                                                                   \
 #define SHELLMATTA_WRITE(data, length)  inst->transportLayer.active == true ?                                                                   \
                                         shellmatta_transport_write((shellmatta_transport_layer_t*)&inst->transportLayer, (data), (length)) :    \
                                         shellmatta_transport_write((shellmatta_transport_layer_t*)&inst->transportLayer, (data), (length)) :    \
                                         inst->write((data), (length))
                                         inst->write((data), (length))
@@ -382,16 +382,16 @@ shellmatta_retCode_t shellmatta_opt_long(   shellmatta_handle_t         handle,
                                             char                        **argument,
                                             char                        **argument,
                                             uint32_t                    *argLen);
                                             uint32_t                    *argLen);
 
 
-#ifdef SHELLMATTA_TRANSPORT_ENABLE
+#ifdef SHELLMATTA_TRANSPORT
 
 
 shellmatta_retCode_t shellmatta_transport_configure(shellmatta_handle_t         handle,
 shellmatta_retCode_t shellmatta_transport_configure(shellmatta_handle_t         handle,
                                                     bool                        mandatory,
                                                     bool                        mandatory,
                                                     bool                        disableAutoFlush,
                                                     bool                        disableAutoFlush,
                                                     shellmatta_transport_crc_t  customCrcFct);
                                                     shellmatta_transport_crc_t  customCrcFct);
 
 
-shellmatta_retCode_t shellmatta_transport_reset(shellmatta_handle_t     handle);
+shellmatta_retCode_t shellmatta_transport_reset(shellmatta_handle_t handle);
 
 
-shellmatta_retCode_t shellmatta_transport_flush(shellmatta_handle_t     handle);
+shellmatta_retCode_t shellmatta_transport_flush(shellmatta_handle_t handle);
 
 
 #endif
 #endif
 
 

+ 1 - 1
cfg/doxygen/doxyfile

@@ -2170,7 +2170,7 @@ INCLUDE_FILE_PATTERNS  =
 # recursively expanded use the := operator instead of the = operator.
 # recursively expanded use the := operator instead of the = operator.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
 
 
-PREDEFINED             =
+PREDEFINED             = SHELLMATTA_AUTHENTICATION SHELLMATTA_TRANSPORT
 
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
 # tag can be used to specify a list of macro names that should be expanded. The
 # tag can be used to specify a list of macro names that should be expanded. The

+ 1 - 0
doc/shellmatta.dox

@@ -42,6 +42,7 @@
     The Shellmatta comes with some features which can be opted in:
     The Shellmatta comes with some features which can be opted in:
 
 
     @subpage shellmatta_auth
     @subpage shellmatta_auth
+
     @subpage shellmatta_transport_layer
     @subpage shellmatta_transport_layer
 
 
 */
 */

+ 12 - 2
doc/shellmatta_transport_layer.dox

@@ -7,6 +7,10 @@
 
 
     The transport layer is optional and can be removed during compile time as
     The transport layer is optional and can be removed during compile time as
     well as deactivated during runtime.
     well as deactivated during runtime.
+
+    To enable it during compile time add the define ``SHELLMATTA_TRANSPORT``.
+
+
     The transport layer intends to be used in machine to machine interfaces.
     The transport layer intends to be used in machine to machine interfaces.
 
 
     @warning    As the transport layer is connectionless there is no way to
     @warning    As the transport layer is connectionless there is no way to
@@ -64,13 +68,12 @@
     | 0x84 | Respond to set address         | 16             | UUID of Shellmatta     |
     | 0x84 | Respond to set address         | 16             | UUID of Shellmatta     |
 
 
 
 
-
     @section shellmatta_transport_layer_sequence_counters Sequence counters
     @section shellmatta_transport_layer_sequence_counters Sequence counters
 
 
     The sequence counters are included in the header of every packet to enable
     The sequence counters are included in the header of every packet to enable
     the host to check for any dropped packets.
     the host to check for any dropped packets.
     This is a quite nasty workaround as the host has no chance to determine
     This is a quite nasty workaround as the host has no chance to determine
-    which packet has dropped - but better than nothing.
+    which packet has been dropped - but better than nothing.
 
 
     If no response is received from the shellmatta the sequence counters can be
     If no response is received from the shellmatta the sequence counters can be
     requested explicitly.
     requested explicitly.
@@ -84,14 +87,21 @@
 
 
     @section shellmatta_transport_layer_buffersize Buffer sizes
     @section shellmatta_transport_layer_buffersize Buffer sizes
 
 
+    @todo Not implemented yet
+
 
 
     @section shellmatta_transport_layer_addressing Addressing and Search
     @section shellmatta_transport_layer_addressing Addressing and Search
 
 
+    @todo Not implemented yet
+
 
 
     @section shellmatta_transport_layer_crc CRC calculation
     @section shellmatta_transport_layer_crc CRC calculation
 
 
+    @todo Not implemented yet
+
 
 
     @section shellmatta_transport_layer_control Controlling the transport layer
     @section shellmatta_transport_layer_control Controlling the transport layer
 
 
+    @todo Not implemented yet
 
 
 */
 */

+ 2 - 2
makefile

@@ -105,11 +105,11 @@ INTEGRATIONTEST_AUTH_COBJ   :=  $(patsubst %.c,$(INTEGRATIONTEST_AUTH_CPP_OBJ_DI
 
 
 CFLAGS                  := $(INCLUDES:%=-I%) -g -Wall -Werror -Wextra -pedantic
 CFLAGS                  := $(INCLUDES:%=-I%) -g -Wall -Werror -Wextra -pedantic
 CFLAGS                  += -DSHELLMATTA_HELP_ALIAS=\(char*\)\"?\"
 CFLAGS                  += -DSHELLMATTA_HELP_ALIAS=\(char*\)\"?\"
-CFLAGS_EXAMPLE          := $(CFLAGS) -DSHELLMATTA_AUTHENTICATION -DSHELLMATTA_TRANSPORT_ENABLE
+CFLAGS_EXAMPLE          := $(CFLAGS) -DSHELLMATTA_AUTHENTICATION -DSHELLMATTA_TRANSPORT
 TESTFLAGS               := $(CFLAGS) -fprofile-arcs -ftest-coverage
 TESTFLAGS               := $(CFLAGS) -fprofile-arcs -ftest-coverage
 TESTFLAGS_AUTH          := $(CFLAGS) -DSHELLMATTA_AUTHENTICATION -fprofile-arcs -ftest-coverage
 TESTFLAGS_AUTH          := $(CFLAGS) -DSHELLMATTA_AUTHENTICATION -fprofile-arcs -ftest-coverage
 TESTLFLAGS              := -fprofile-arcs -Wl,--allow-multiple-definition
 TESTLFLAGS              := -fprofile-arcs -Wl,--allow-multiple-definition
-TESTFLAGS_TRANSPORT     := $(TESTFLAGS) -DSHELLMATTA_TRANSPORT_ENABLE
+TESTFLAGS_TRANSPORT     := $(TESTFLAGS) -DSHELLMATTA_TRANSPORT
 TESTLFLAGS_TRANSPORT    := $(TESTLFLAGS)
 TESTLFLAGS_TRANSPORT    := $(TESTLFLAGS)
 DEPEND                  = -MT $@ -MF "$(@:%.o=%.d)" -MG -MM
 DEPEND                  = -MT $@ -MF "$(@:%.o=%.d)" -MG -MM
 
 

+ 17 - 10
python_driver/shellmatta_transport.py

@@ -36,7 +36,8 @@ class ShellmattaTransport():
                      sequence_h2s,
                      sequence_h2s,
                      sequence_s2h,
                      sequence_s2h,
                      payload=b'',
                      payload=b'',
-                     crc=0):
+                     crc=0,
+                     crc_fct=Crc32.calc):
             """ creates a shellmatta transport packet based on the passed data """
             """ creates a shellmatta transport packet based on the passed data """
 
 
             self.start_of_header    = start_of_header
             self.start_of_header    = start_of_header
@@ -49,6 +50,7 @@ class ShellmattaTransport():
             self.sequence_s2h       = sequence_s2h
             self.sequence_s2h       = sequence_s2h
             self.payload            = payload
             self.payload            = payload
             self.crc                = crc
             self.crc                = crc
+            self.crc_fct            = crc_fct
 
 
         @classmethod
         @classmethod
         def from_header_data(cls, header_data):
         def from_header_data(cls, header_data):
@@ -76,16 +78,20 @@ class ShellmattaTransport():
             self.payload += payload
             self.payload += payload
             self.payload_length = len(self.payload)
             self.payload_length = len(self.payload)
 
 
+        def calc_crc(self):
+            """ Calculates the crc checksum """
+
+            return self.crc_fct(bytes(self)[:-4])
+
         def secure(self):
         def secure(self):
             """ Calculates the crc checksum """
             """ Calculates the crc checksum """
 
 
-            self.crc = Crc32.calc(bytes(self)[:-4])
+            self.crc = self.calc_crc()
 
 
         def verify(self, crc):
         def verify(self, crc):
             """ Checks the packet agains the passed crc """
             """ Checks the packet agains the passed crc """
 
 
-            self.secure()
-            return crc == self.crc
+            return crc == self.calc_crc()
 
 
         def __bytes__(self):
         def __bytes__(self):
             """ Create binary representation of the packet """
             """ Create binary representation of the packet """
@@ -104,7 +110,7 @@ class ShellmattaTransport():
             raw_buffer += self.crc.to_bytes(4, 'big')
             raw_buffer += self.crc.to_bytes(4, 'big')
             return raw_buffer
             return raw_buffer
 
 
-    def __init__(self, com_obj, mandatory=False, custom_crc=None):
+    def __init__(self, com_obj, mandatory=False, custom_crc=Crc32.calc):
         self.com_obj = com_obj
         self.com_obj = com_obj
         self.mandatory = mandatory
         self.mandatory = mandatory
         self.custom_crc = custom_crc
         self.custom_crc = custom_crc
@@ -130,7 +136,8 @@ class ShellmattaTransport():
                                 destination,
                                 destination,
                                 self.sequence_counter_h2s,
                                 self.sequence_counter_h2s,
                                 self.sequence_counter_s2h,
                                 self.sequence_counter_s2h,
-                                data[:self.Packet.MAX_PAYLOAD_LENGTH])
+                                data[:self.Packet.MAX_PAYLOAD_LENGTH],
+                                crc_fct=self.custom_crc)
             self.sequence_counter_h2s += 1
             self.sequence_counter_h2s += 1
             packet.secure()
             packet.secure()
             self.com_obj.write(bytes(packet))
             self.com_obj.write(bytes(packet))
@@ -250,9 +257,9 @@ class ShellmattaTransport():
         self.received_packet = None
         self.received_packet = None
         self.received_buffer = b''
         self.received_buffer = b''
         # flush the buffer and send one cancel
         # flush the buffer and send one cancel
-        # self.com_obj.write(b'\x00' * (self.Packet.MAX_PAYLOAD_LENGTH + 12))
-        # self.write(b'\x03')
+        self.com_obj.write(b'\x00' * (self.Packet.MAX_PAYLOAD_LENGTH + 12))
+        self.write(b'\x03')
 
 
     def close(self):
     def close(self):
-        """Close port"""
-        self.reset()
+        """ Close port """
+        self.reset()

+ 4 - 8
python_driver/shellmatta_transport_serial.py

@@ -4,8 +4,6 @@ import time
 import serial
 import serial
 import argparse
 import argparse
 from shellmatta_transport import ShellmattaTransport
 from shellmatta_transport import ShellmattaTransport
-from robot.api import logger
-
 
 
 class ShellmattaSerial():
 class ShellmattaSerial():
     """ Helper class to communicate with a shellmatta enabled device """
     """ Helper class to communicate with a shellmatta enabled device """
@@ -17,9 +15,7 @@ class ShellmattaSerial():
         self.com = com_port
         self.com = com_port
         self.com_port = serial.Serial(com_port, baudrate=baudrate, timeout=timeout)
         self.com_port = serial.Serial(com_port, baudrate=baudrate, timeout=timeout)
 
 
-        self.transport = ShellmattaTransport(self.com_port,
-                                             transport_layer_mandatory,
-                                             None)
+        self.transport = ShellmattaTransport(self.com_port, transport_layer_mandatory)
 
 
     def send_command(self, command):
     def send_command(self, command):
         """ Send command and wait for the prompt in the response. """
         """ Send command and wait for the prompt in the response. """
@@ -71,14 +67,16 @@ class ShellmattaSerial():
         """ Clears all internal buffers, throwing away all data. """
         """ Clears all internal buffers, throwing away all data. """
         self.transport.reset()
         self.transport.reset()
         self.com_port.flush()
         self.com_port.flush()
-        # time.sleep(0.015)
+
         self.com_port.reset_input_buffer()
         self.com_port.reset_input_buffer()
         self.com_port.reset_output_buffer()
         self.com_port.reset_output_buffer()
 
 
     def close_serial(self):
     def close_serial(self):
+        """ Closes the serial port """
         self.com_port.close()
         self.com_port.close()
 
 
     def set_baudrate(self, baud):
     def set_baudrate(self, baud):
+        """ Set the baudrate of the serial port """
         self.com_port.baudrate = baud
         self.com_port.baudrate = baud
         self.com_port.close()
         self.com_port.close()
         time.sleep(0.5)
         time.sleep(0.5)
@@ -89,8 +87,6 @@ class ShellmattaSerial():
                                              False,
                                              False,
                                              None)
                                              None)
 
 
-        # self.com_port._reconfigure_port
-
 # start interactive mode if not used as a module
 # start interactive mode if not used as a module
 if __name__ == "__main__":
 if __name__ == "__main__":
 
 

+ 4 - 4
src/shellmatta.c

@@ -23,7 +23,7 @@
 #include "shellmatta_utils.h"
 #include "shellmatta_utils.h"
 #include "shellmatta_escape.h"
 #include "shellmatta_escape.h"
 #include "shellmatta_opt.h"
 #include "shellmatta_opt.h"
-#ifdef SHELLMATTA_TRANSPORT_ENABLE
+#ifdef SHELLMATTA_TRANSPORT
 #include "shellmatta_transport.h"
 #include "shellmatta_transport.h"
 #endif
 #endif
 #ifdef SHELLMATTA_AUTHENTICATION
 #ifdef SHELLMATTA_AUTHENTICATION
@@ -481,7 +481,7 @@ shellmatta_retCode_t shellmatta_doInit(
         inst->magic = SHELLMATTA_MAGIC;
         inst->magic = SHELLMATTA_MAGIC;
         *handle     = (shellmatta_handle_t)inst;
         *handle     = (shellmatta_handle_t)inst;
 
 
-#ifdef SHELLMATTA_TRANSPORT_ENABLE
+#ifdef SHELLMATTA_TRANSPORT
         /* init transport layer */
         /* init transport layer */
         inst->transportBusyMark = 0u;
         inst->transportBusyMark = 0u;
         shellmatta_transport_init(&inst->transportLayer, inst->write);
         shellmatta_transport_init(&inst->transportLayer, inst->write);
@@ -764,7 +764,7 @@ shellmatta_retCode_t shellmatta_processData(shellmatta_handle_t     handle,
 {
 {
     shellmatta_retCode_t    ret   = SHELLMATTA_OK;
     shellmatta_retCode_t    ret   = SHELLMATTA_OK;
     shellmatta_instance_t   *inst = (shellmatta_instance_t*)handle;
     shellmatta_instance_t   *inst = (shellmatta_instance_t*)handle;
-#ifdef SHELLMATTA_TRANSPORT_ENABLE
+#ifdef SHELLMATTA_TRANSPORT
     char                    *tmpData;
     char                    *tmpData;
     uint32_t                tmpSize = 0;
     uint32_t                tmpSize = 0;
     uint32_t                i;
     uint32_t                i;
@@ -775,7 +775,7 @@ shellmatta_retCode_t shellmatta_processData(shellmatta_handle_t     handle,
     if(     (NULL               != inst)
     if(     (NULL               != inst)
         &&  (SHELLMATTA_MAGIC   == inst->magic))
         &&  (SHELLMATTA_MAGIC   == inst->magic))
     {
     {
-#ifdef SHELLMATTA_TRANSPORT_ENABLE
+#ifdef SHELLMATTA_TRANSPORT
         for (i = inst->transportBusyMark; i < size; i ++)
         for (i = inst->transportBusyMark; i < size; i ++)
         {
         {
             ret = shellmatta_transport_process(&inst->transportLayer, data[i], &tmpData, &tmpSize);
             ret = shellmatta_transport_process(&inst->transportLayer, data[i], &tmpData, &tmpSize);

+ 1 - 1
src/shellmatta_transport.c

@@ -3,7 +3,7 @@
  * @brief   transport layer functions of shellmatta
  * @brief   transport layer functions of shellmatta
  * @author  Simon Fischer <fischer.simon.1991@gmail.com>
  * @author  Simon Fischer <fischer.simon.1991@gmail.com>
  */
  */
-#ifdef SHELLMATTA_TRANSPORT_ENABLE
+#ifdef SHELLMATTA_TRANSPORT
 #include "shellmatta_transport.h"
 #include "shellmatta_transport.h"
 #include "shellmatta.h"
 #include "shellmatta.h"
 #include "shellmatta_crc.h"
 #include "shellmatta_crc.h"

+ 1 - 1
src/shellmatta_utils.h

@@ -19,7 +19,7 @@
 #ifndef _SHELLMATTA_UTILS_H_
 #ifndef _SHELLMATTA_UTILS_H_
 #define _SHELLMATTA_UTILS_H_
 #define _SHELLMATTA_UTILS_H_
 
 
-#ifdef SHELLMATTA_TRANSPORT_ENABLE
+#ifdef SHELLMATTA_TRANSPORT
 #include "shellmatta_transport.h"
 #include "shellmatta_transport.h"
 #endif
 #endif
 #include "shellmatta.h"
 #include "shellmatta.h"

+ 13 - 15
test/integrationtest_transport/test_integration_transport.cpp

@@ -147,8 +147,8 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
             {
             {
                 char *dummyData =   (char*)"crc error\r\n\r\nshellmatta->";
                 char *dummyData =   (char*)"crc error\r\n\r\nshellmatta->";
 
 
-                CHECK( write_length == strlen(dummyData));
-                REQUIRE( strcmp(dummyData, write_data) == 0);
+                CHECK(write_length == strlen(dummyData));
+                REQUIRE(strcmp(dummyData, write_data) == 0);
             }
             }
         }
         }
 
 
@@ -167,8 +167,8 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
                                            "shellmatta->"
                                            "shellmatta->"
                                            "\xc8\xae\xc0\x56";
                                            "\xc8\xae\xc0\x56";
 
 
-                CHECK( write_length == 59u);
-                REQUIRE( memcmp(write_data, dummyData, 59) == 0);
+                CHECK(write_length == 59u);
+                REQUIRE(memcmp(write_data, dummyData, 59) == 0);
             }
             }
         }
         }
 
 
@@ -200,8 +200,8 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
                                            "shellmatta->"
                                            "shellmatta->"
                                            "\x00\xc9\x5d\x37";
                                            "\x00\xc9\x5d\x37";
 
 
-                CHECK( write_length == 406u);
-                REQUIRE( memcmp(write_data, dummyData, 406u) == 0);
+                CHECK(write_length == 406u);
+                REQUIRE(memcmp(write_data, dummyData, 406u) == 0);
             }
             }
         }
         }
 
 
@@ -233,8 +233,8 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
                                            "shellmatta->"
                                            "shellmatta->"
                                            "\x00\xc9\x5d\x37";
                                            "\x00\xc9\x5d\x37";
 
 
-                CHECK( write_length == 406u);
-                REQUIRE( memcmp(write_data, dummyData, 406u) == 0);
+                CHECK(write_length == 406u);
+                REQUIRE(memcmp(write_data, dummyData, 406u) == 0);
             }
             }
         }
         }
 
 
@@ -256,9 +256,8 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
                                            "doSomething argument - length: 20\r\n"
                                            "doSomething argument - length: 20\r\n"
                                            "shellmatta->";
                                            "shellmatta->";
 
 
-                CHECK( write_length == 106);
-                REQUIRE( memcmp(write_data, dummyData, 106) == 0);
-
+                CHECK(write_length == 106);
+                REQUIRE(memcmp(write_data, dummyData, 106) == 0);
             }
             }
         }
         }
 
 
@@ -273,7 +272,7 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
 
 
             THEN("The Shellmatta does not respond")
             THEN("The Shellmatta does not respond")
             {
             {
-                CHECK( write_length == 0u);
+                CHECK(write_length == 0u);
 
 
                 AND_WHEN("The flush method is called")
                 AND_WHEN("The flush method is called")
                 {
                 {
@@ -287,8 +286,8 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
                                                 "shellmatta->"
                                                 "shellmatta->"
                                                 "\xc8\xae\xc0\x56";
                                                 "\xc8\xae\xc0\x56";
 
 
-                        CHECK( write_length == 59u);
-                        REQUIRE( memcmp(write_data, dummyData, 59) == 0);
+                        CHECK(write_length == 59u);
+                        REQUIRE(memcmp(write_data, dummyData, 59) == 0);
                     }
                     }
                 }
                 }
             }
             }
@@ -439,4 +438,3 @@ SCENARIO("Integration test of Transport layer - reset transport layer", "[integr
         }
         }
     }
     }
 }
 }
-