Kaynağa Gözat

Merge branch 'feature/implement-transport-layer-multidrop' of shimatta/shellmatta into develop

shimatta 9 ay önce
ebeveyn
işleme
5f59e54056

+ 7 - 0
api/shellmatta.h

@@ -209,6 +209,9 @@ typedef enum
 /** @brief max length of a plain data payload */
 #define SHELLMATTA_TRANPORT_PAYLOAD_MAXLENGTH           ((uint8_t)(255))
 
+/** @brief size of the shellmatta transport uuid */
+#define SHELLMATTA_TRANPORT_UUID_LENGTH                 ((uint8_t)(16))
+
 /**
  * @brief shellmatta transport crc function definition for custom crcs
  * @param[in]   data        data to calculate the crc of
@@ -255,6 +258,9 @@ typedef struct
     uint32_t                        headerIndex;        /**< read index of the header                       */
     uint32_t                        payloadIndex;       /**< read index of the payload                      */
     uint32_t                        crcIndex;           /**< read index of the checksum                     */
+    uint8_t                         hostBufferSize;     /**< buffersize of the host                         */
+    uint8_t                         address;            /**< address of the shellmatta                      */
+    uint8_t                         uuid[SHELLMATTA_TRANPORT_UUID_LENGTH]; /**< uuid if the shellmatta      */
     shellmatta_transport_packet_t   inPacket;           /**< buffer for the received packets                */
     shellmatta_transport_packet_t   outPacket;          /**< buffer for the sent packets                    */
     shellmatta_write_t              writeFct;           /**< shellmatta write function                      */
@@ -387,6 +393,7 @@ shellmatta_retCode_t shellmatta_opt_long(   shellmatta_handle_t         handle,
 shellmatta_retCode_t shellmatta_transport_configure(shellmatta_handle_t         handle,
                                                     bool                        mandatory,
                                                     bool                        disableAutoFlush,
+                                                    uint8_t                     uuid[SHELLMATTA_TRANPORT_UUID_LENGTH],
                                                     shellmatta_transport_crc_t  customCrcFct);
 
 shellmatta_retCode_t shellmatta_transport_reset(shellmatta_handle_t handle);

+ 41 - 3
doc/shellmatta_transport_layer.dox

@@ -18,6 +18,11 @@
                 To check if all packets have been received by the shellmatta
                 the sequence counters included in any packet can be used.
 
+                The packet counter will be incremented on every packet which
+                is received with a valid CRC and address.
+                Unknown packets or packets with wrong payload lengths are
+                ignored - but the sequence counter will still be incremented.
+
     @section shellmatta_transport_layer_sequence Basic sequence
 
     @startuml
@@ -64,7 +69,7 @@
     | 0x82 | Respond max buffersize         | 1              | Shellmattas buffersize |
     | 0x03 | Search device by unique ID     | 32             | UUID Range 2x 16 byte  |
     | 0x83 | Respond to search              | 16             | UUID of Shellmatta     |
-    | 0x04 | Set address                    | 16             | UUID of Shellmatta     |
+    | 0x04 | Set address                    | 16 + 1         | UUID + new address     |
     | 0x84 | Respond to set address         | 16             | UUID of Shellmatta     |
 
 
@@ -87,12 +92,45 @@
 
     @section shellmatta_transport_layer_buffersize Buffer sizes
 
-    @todo Not implemented yet
+    The shellmatta always uses the maximum buffersize of
+    #SHELLMATTA_TRANPORT_PAYLOAD_MAXLENGTH.
+    If the host has a smaller receive buffer this can be set using the 0x02
+    packet.
+
+    A host should use this packet to request the shellmatta buffersize.
+    This can be changed in the future.
 
 
     @section shellmatta_transport_layer_addressing Addressing and Search
 
-    @todo Not implemented yet
+    The shellmatta comes with a primitive multidrop implementation to address
+    and find multiple shellmatta transport layer enabled devices on a bus.
+
+    Every command comes with a source and destination address.
+    0 is the broadcast address an received everytime.
+    1 is reserved for the MASTER/HOST. The Shellmatta will always send responses
+    to this address - no matter what the source of the telegram was.
+
+    The packet response is sent to the source from the request packet.
+
+    To assign a new address to a shellmatta transport layer enabled device
+    there is a possibility to search for devices on the bus.
+
+    Every shellmatta which enables this feature requires a 16 byte UUID to be
+    specified which is unique on the bus.
+    The Host can then search for shellmatta nodes using a range of UUIDs
+    using command 0x03.
+
+    Every shellmatta instance within this range will respond.
+    If more than one shellmatta is in the specified range this will lead to
+    collisions on the bus. When the host detects collisions it shall repeat
+    the search requests with different ranges until only one shellmatta
+    responds.
+
+    Once the host has found a single shellmatta in one range it can assign a
+    unique address using command 0x04.
+
+    The shellmatta can now be accessed using this address.
 
 
     @section shellmatta_transport_layer_crc CRC calculation

+ 128 - 28
src/shellmatta_transport.c

@@ -25,7 +25,6 @@
  * @note    The packetType, payloadLength and payload have to be preset!
  *
  * @param[in, out]  transportLayer  transport layer instance to work on
- * @param[in]       packetType      type of packet to send
  * @param[in]       packet          packet to send
  * @return          errorcode
  */
@@ -39,8 +38,8 @@ static shellmatta_retCode_t shellmatta_transport_send(shellmatta_transport_layer
     /** -# fill header */
     header->startOfHeader   = SHELLMATTA_TRANSPORT_START_OF_HEADER;
     header->protocolVersion = SHELLMATTA_TRANSPORT_PROTOCOL_VERSION;
-    header->source          = 0;
-    header->destination     = 0;
+    header->source          = transportLayer->address;
+    header->destination     = SHELLMATTA_TRANSPORT_MASTER_ADDRESS;
     header->sequenceH2S     = transportLayer->sequenceH2S;
     header->sequenceS2H     = ++transportLayer->sequenceS2H;
 
@@ -58,6 +57,49 @@ static shellmatta_retCode_t shellmatta_transport_send(shellmatta_transport_layer
                                     header->payloadLength);
 }
 
+/**
+ * @brief   check a search packet and return if our UUID is in the search range
+ * @param[in, out]  transportLayer  transport layer instance to work on
+ * @param[in]       packet          search packet
+ * @return          true - UUID in passed range
+ */
+static bool shellmatta_transport_search(shellmatta_transport_layer_t *transportLayer,
+                                                        shellmatta_transport_packet_t *packet)
+{
+    bool match = true;
+    bool sure = false;
+    uint32_t i;
+    uint8_t *uuid1;
+    uint8_t *uuid2;
+
+    uuid1 = (uint8_t *)&packet->payload[0u];
+    uuid2 = (uint8_t *)&packet->payload[SHELLMATTA_TRANPORT_UUID_LENGTH];
+
+    /** -# compare UUID with range */
+    for(i = 0u; i < (SHELLMATTA_TRANPORT_UUID_LENGTH - 1u); i ++)
+    {
+        /** -# stop match if we are outside of the range with the current digit */
+        if((transportLayer->uuid[i] < uuid1[i]) || (transportLayer->uuid[i] > uuid2[i]))
+        {
+            match = false;
+        }
+        /** -# stop comparison when we are definitely in the range (lower than the top limit and inside) */
+        else if(transportLayer->uuid[i] < uuid2[i])
+        {
+            sure = true;
+            break;
+        }
+    }
+
+    /** -# explicitly check lowest digit - this is not inclusive to the lower limit */
+    if((false == sure) && ((transportLayer->uuid[i] <= uuid1[i]) || (transportLayer->uuid[i] > uuid2[i])))
+    {
+        match = false;
+    }
+
+    return match;
+}
+
 /**
  * @brief           Initializes the transportLayerInst
  * @param[in, out]  transportLayer  transport layer instance to work on
@@ -69,6 +111,7 @@ shellmatta_retCode_t shellmatta_transport_init( shellmatta_transport_layer_t
 {
     /** -# clear instance and store write function */
     memset(transportLayer, 0u, sizeof(shellmatta_transport_layer_t));
+    transportLayer->hostBufferSize = SHELLMATTA_TRANPORT_PAYLOAD_MAXLENGTH;
     transportLayer->writeFct = writeFct;
 
     return SHELLMATTA_OK;
@@ -79,12 +122,14 @@ shellmatta_retCode_t shellmatta_transport_init( shellmatta_transport_layer_t
  * @param[in, out]  handle              shellmatta handle of the instance
  * @param[in]       mandatory           enforce using the transport layer
  * @param[in]       disableAutoFlush    enforce manual flushing of the output packet
+ * @param[in]       uuid                UUID for multidrop search (default NULL)
  * @param[in]       customCrcFct        use a custom crc generation (default NULL)
  * @return          errorcode
  */
 shellmatta_retCode_t shellmatta_transport_configure(shellmatta_handle_t         handle,
                                                     bool                        mandatory,
                                                     bool                        disableAutoFlush,
+                                                    uint8_t                     uuid[SHELLMATTA_TRANPORT_UUID_LENGTH],
                                                     shellmatta_transport_crc_t  customCrcFct)
 {
     shellmatta_retCode_t    ret     = SHELLMATTA_OK;
@@ -105,6 +150,11 @@ shellmatta_retCode_t shellmatta_transport_configure(shellmatta_handle_t
         {
             transportLayer->active = true;
         }
+
+        if(NULL != uuid)
+        {
+            (void)memcpy(transportLayer->uuid, uuid, SHELLMATTA_TRANPORT_UUID_LENGTH);
+        }
     }
     else
     {
@@ -173,7 +223,7 @@ shellmatta_retCode_t shellmatta_transport_process(shellmatta_transport_layer_t
     /** -# look for start of header */
     case SHELLMATTA_TRANSPORT_STATE_WAIT:
         /** -# if start of header is found, continue transport layer fsm */
-        if (SHELLMATTA_TRANSPORT_START_OF_HEADER == byte)
+        if(SHELLMATTA_TRANSPORT_START_OF_HEADER == byte)
         {
             memset(&transportLayer->inPacket, 0, sizeof(transportLayer->inPacket));
             transportLayer->headerIndex = 1u;
@@ -206,10 +256,16 @@ shellmatta_retCode_t shellmatta_transport_process(shellmatta_transport_layer_t
         rawPacket[transportLayer->headerIndex] = byte;
         transportLayer->headerIndex ++;
 
-        if (transportLayer->headerIndex == SHELLMATTA_TRANSPORT_LENGTH_HEADER)
+        if(transportLayer->headerIndex == SHELLMATTA_TRANSPORT_LENGTH_HEADER)
         {
-            //TODO check for errors in header data
-            if (0u != header->payloadLength)
+            /** -# check protocol version and addressing*/
+            if((SHELLMATTA_TRANSPORT_PROTOCOL_VERSION != header->protocolVersion) ||
+              ((SHELLMATTA_TRANSPORT_BROADCAST_ADDRESS != header->destination) &&
+              (transportLayer->address != header->destination)))
+            {
+                transportLayer->state = SHELLMATTA_TRANSPORT_STATE_WAIT;
+            }
+            else if(0u != header->payloadLength)
             {
                 transportLayer->state = SHELLMATTA_TRANSPORT_STATE_GET_PAYLOAD;
             }
@@ -261,36 +317,81 @@ shellmatta_retCode_t shellmatta_transport_process(shellmatta_transport_layer_t
                     *length = header->payloadLength;
                     ret = SHELLMATTA_OK;
                     break;
-                
+
                 case SHELLMATTA_TRANSPORT_PACKET_SEQ_CNT_REQUEST:
-                    /** -# send out packet with no payload */
-                    intPacket.header.packetType = SHELLMATTA_TRANSPORT_PACKET_SEQ_CNT_RESPOND;
-                    intPacket.header.payloadLength = 0u;
-                    (void)shellmatta_transport_send(transportLayer, (shellmatta_transport_packet_t *)&intPacket);
+                    if(transportLayer->inPacket.header.payloadLength == 0u)
+                    {
+                        /** -# send out packet with no payload */
+                        intPacket.header.packetType = SHELLMATTA_TRANSPORT_PACKET_SEQ_CNT_RESPOND;
+                        intPacket.header.payloadLength = 0u;
+                        (void)shellmatta_transport_send(transportLayer, (shellmatta_transport_packet_t *)&intPacket);
+                    }
                     break;
 
                 case SHELLMATTA_TRANSPORT_PACKET_SEQ_CNT_RESPOND:
                     /** -# ignore #SHELLMATTA_TRANSPORT_PACKET_SEQ_CNT_RESPOND - nothing to do */
                     break;
-                
+
                 case SHELLMATTA_TRANSPORT_PACKET_MAX_BUFFERSIZE_REQUEST:
-                    /** @todo implement */
+
+                    if(transportLayer->inPacket.header.payloadLength == 1u)
+                    {
+                        /** -# store the hosts buffersize */
+                        transportLayer->hostBufferSize = (uint8_t)transportLayer->inPacket.payload[0];
+
+                        /** -# respont with our own buffer size */
+                        intPacket.header.packetType = SHELLMATTA_TRANSPORT_PACKET_MAX_BUFFERSIZE_RESPOND;
+                        intPacket.header.payloadLength = 1u;
+                        intPacket.payload[0] = SHELLMATTA_TRANPORT_PAYLOAD_MAXLENGTH;
+                        (void)shellmatta_transport_send(transportLayer, (shellmatta_transport_packet_t *)&intPacket);
+                    }
                     break;
 
                 case SHELLMATTA_TRANSPORT_PACKET_MAX_BUFFERSIZE_RESPOND:
                     /** -# ignore #SHELLMATTA_TRANSPORT_PACKET_MAX_BUFFERSIZE_RESPOND - nothing to do */
                     break;
-                
+
                 case SHELLMATTA_TRANSPORT_PACKET_SEARCH_DEVICE_REQUEST:
-                    /** @todo implement */
+                    /** -# check if our own uuid is inside the passed range */
+                    if((transportLayer->inPacket.header.payloadLength == SHELLMATTA_TRANPORT_UUID_LENGTH * 2u) &&
+                       (true == shellmatta_transport_search(transportLayer, &transportLayer->inPacket)))
+                    {
+                        intPacket.header.packetType = SHELLMATTA_TRANSPORT_PACKET_SEARCH_DEVICE_RESPOND;
+                        intPacket.header.payloadLength = SHELLMATTA_TRANPORT_UUID_LENGTH;
+                        (void)memcpy(intPacket.payload, transportLayer->uuid, SHELLMATTA_TRANPORT_UUID_LENGTH);
+                        (void)shellmatta_transport_send(transportLayer, (shellmatta_transport_packet_t *)&intPacket);
+                    }
                     break;
-                
+
                 case SHELLMATTA_TRANSPORT_PACKET_SEARCH_DEVICE_RESPOND:
                     /** -# ignore #SHELLMATTA_TRANSPORT_PACKET_SEARCH_DEVICE_RESPOND - nothing to do */
                     break;
 
                 case SHELLMATTA_TRANSPORT_PACKET_SET_ADDRESS_REQUEST:
-                    /** @todo implement */
+
+                    /** -# use the passed address if the passed UUID matches our own */
+                    if((transportLayer->inPacket.header.payloadLength == SHELLMATTA_TRANPORT_UUID_LENGTH + 1u) &&
+                        0 == memcmp(transportLayer->uuid,
+                                   transportLayer->inPacket.payload,
+                                   SHELLMATTA_TRANPORT_UUID_LENGTH))
+                    {
+                        transportLayer->address = transportLayer->inPacket.payload[SHELLMATTA_TRANPORT_UUID_LENGTH];
+                        if(SHELLMATTA_TRANSPORT_MASTER_ADDRESS == transportLayer->address)
+                        {
+                            transportLayer->address = 0u;
+                        }
+                        else
+                        {
+                            /** -# respond to the address set command */
+                            intPacket.header.packetType = SHELLMATTA_TRANSPORT_PACKET_SET_ADDRESS_RESPOND;
+                            intPacket.header.payloadLength = SHELLMATTA_TRANPORT_UUID_LENGTH;
+                            (void)memcpy(intPacket.payload, transportLayer->uuid, SHELLMATTA_TRANPORT_UUID_LENGTH);
+                            (void)shellmatta_transport_send(transportLayer,
+                                                            (shellmatta_transport_packet_t *)&intPacket);
+                        }
+
+                    }
+                    
                     break;
 
                 case SHELLMATTA_TRANSPORT_PACKET_SET_ADDRESS_RESPOND:
@@ -298,8 +399,7 @@ shellmatta_retCode_t shellmatta_transport_process(shellmatta_transport_layer_t
                     break;
 
                 default:
-                    /** -# undo sequence counter increment on wrong packet type */
-                    transportLayer->sequenceH2S--;
+                    /** -# ignore unknown packets */
                     break;
                 }
             }
@@ -313,7 +413,7 @@ shellmatta_retCode_t shellmatta_transport_process(shellmatta_transport_layer_t
             transportLayer->state = SHELLMATTA_TRANSPORT_STATE_WAIT;
         }
         break;
-    
+
     default:
         break;
     }
@@ -323,13 +423,13 @@ shellmatta_retCode_t shellmatta_transport_process(shellmatta_transport_layer_t
 
 /**
  * @brief       Wrapper function for the write-function of shellmatta handle
- * 
+ *
  * This function is used to transmit data with the tranport layer protocol.\n
  * The input data is copied into a new array along with the header and crc32.\n
  * The resulting buffer is the forwarded to the original write function.\n
- * 
+ *
  * @note        If length of data exceeds #UINT8_MAX, data is sent in multiple packets.\n
- * 
+ *
  * @param[in, out]  transportLayer  transport layer instance to work on
  * @param[in]       data            pointer to input data to process
  * @param[in]       length          length of data to process
@@ -357,9 +457,9 @@ shellmatta_retCode_t shellmatta_transport_write(shellmatta_transport_layer_t *tr
 
         /* compute length of next payload split */
         restOfPayload = (outPayloadLength - processedLength);
-        if (restOfPayload > (SHELLMATTA_TRANPORT_PAYLOAD_MAXLENGTH - piledUpPayload))
+        if (restOfPayload > (transportLayer->hostBufferSize - piledUpPayload))
         {
-            splitLength = SHELLMATTA_TRANPORT_PAYLOAD_MAXLENGTH - piledUpPayload;
+            splitLength = transportLayer->hostBufferSize - piledUpPayload;
         }
         else
         {
@@ -370,7 +470,7 @@ shellmatta_retCode_t shellmatta_transport_write(shellmatta_transport_layer_t *tr
         header->payloadLength += splitLength;
         processedLength += splitLength;
 
-        if(header->payloadLength >= SHELLMATTA_TRANPORT_PAYLOAD_MAXLENGTH)
+        if(header->payloadLength >= transportLayer->hostBufferSize)
         {
             /** -# packet is full - send */
             header->packetType = SHELLMATTA_TRANSPORT_PACKET_DATA;
@@ -384,7 +484,7 @@ shellmatta_retCode_t shellmatta_transport_write(shellmatta_transport_layer_t *tr
 
 /**
  * @brief           Send out piled up payload
- * 
+ *
  * @param[in, out]  handle      shellmatta handle of the instance
  * @return          errorcode
  */

+ 4 - 0
src/shellmatta_transport.h

@@ -21,6 +21,10 @@
 #define SHELLMATTA_TRANSPORT_START_OF_HEADER    0x01u
 /** @brief currently supported protocol version */
 #define SHELLMATTA_TRANSPORT_PROTOCOL_VERSION   0x01u
+/** @brief broadcast address */
+#define SHELLMATTA_TRANSPORT_BROADCAST_ADDRESS  0u
+/** @brief master address */
+#define SHELLMATTA_TRANSPORT_MASTER_ADDRESS     1u
 
 /* header field length defines */
 /** @brief length of header */

+ 89 - 23
test/integrationtest_transport/test_integration_transport.cpp

@@ -161,11 +161,11 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
                                                 "\x7b\x49\xfa\x72", 34u);
             THEN("The shellmatta responds to the command")
             {
-                char *dummyData =   (char*)"\x01\x01\x00\x2f\x00\x00\x01\x01"
+                char *dummyData =   (char*)"\x01\x01\x00\x2f\x00\x01\x01\x01"
                                            "doSomething argument - length: 20"
                                            "\r\n"
                                            "shellmatta->"
-                                           "\xc8\xae\xc0\x56";
+                                           "\x4c\x9f\xd9\xa7";
 
                 CHECK(write_length == 59u);
                 REQUIRE(memcmp(write_data, dummyData, 59) == 0);
@@ -184,21 +184,21 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
                                                 "\xad\x33\x31\xcc", 26u);
             THEN("The shellmatta responds multiple telegrams")
             {
-                char *dummyData =   (char*)"\x01\x01\x00\xff\x00\x00\x01\x01"
+                char *dummyData =   (char*)"\x01\x01\x00\xff\x00\x01\x01\x01"
                                            "This is my very very very very large payload\r\n"
                                            "This is my very very very very large payload\r\n"
                                            "This is my very very very very large payload\r\n"
                                            "This is my very very very very large payload\r\n"
                                            "This is my very very very very large payload\r\n"
                                            "This is my very very very"
-                                           "\x0f\x90\xc0\xfd"
-                                           "\x01\x01\x00\x7f\x00\x00\x01\x02"
+                                           "\x00\x9c\x41\xe1"
+                                           "\x01\x01\x00\x7f\x00\x01\x01\x02"
                                            " very large payload\r\n"
                                            "This is my very very very very large payload\r\n"
                                            "This is my very very very very large payload\r\n"
                                            "\r\n"
                                            "shellmatta->"
-                                           "\x00\xc9\x5d\x37";
+                                           "\x39\x75\x0d\x6b";
 
                 CHECK(write_length == 406u);
                 REQUIRE(memcmp(write_data, dummyData, 406u) == 0);
@@ -217,21 +217,21 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
                                                 "\xad\x33\x31\xcc", 26u);
             THEN("The shellmatta responds multiple telegrams")
             {
-                char *dummyData =   (char*)"\x01\x01\x00\xff\x00\x00\x01\x01"
+                char *dummyData =   (char*)"\x01\x01\x00\xff\x00\x01\x01\x01"
                                            "This is my very very very very large payload\r\n"
                                            "This is my very very very very large payload\r\n"
                                            "This is my very very very very large payload\r\n"
                                            "This is my very very very very large payload\r\n"
                                            "This is my very very very very large payload\r\n"
                                            "This is my very very very"
-                                           "\x0f\x90\xc0\xfd"
-                                           "\x01\x01\x00\x7f\x00\x00\x01\x02"
+                                           "\x00\x9c\x41\xe1"
+                                           "\x01\x01\x00\x7f\x00\x01\x01\x02"
                                            " very large payload\r\n"
                                            "This is my very very very very large payload\r\n"
                                            "This is my very very very very large payload\r\n"
                                            "\r\n"
                                            "shellmatta->"
-                                           "\x00\xc9\x5d\x37";
+                                           "\x39\x75\x0d\x6b";
 
                 CHECK(write_length == 406u);
                 REQUIRE(memcmp(write_data, dummyData, 406u) == 0);
@@ -248,11 +248,11 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
             shellmatta_processData(handle, (char*)"doSomething argument\r\n", 22u);
             THEN("The shellmatta responds to the command")
             {
-                char *dummyData =   (char*)"\x01\x01\x00\x2f\x00\x00\x01\x01"
+                char *dummyData =   (char*)"\x01\x01\x00\x2f\x00\x01\x01\x01"
                                            "doSomething argument - length: 20"
                                            "\r\n"
                                            "shellmatta->"
-                                           "\xc8\xae\xc0\x56"
+                                           "\x4c\x9f\xd9\xa7"
                                            "doSomething argument - length: 20\r\n"
                                            "shellmatta->";
 
@@ -265,7 +265,7 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
         {
             /* check with valid payload - disable echo to reduce cluttering */
             shellmatta_configure(handle, SHELLMATTA_MODE_INSERT, false, '\r');
-            shellmatta_transport_configure(handle, false, true, NULL);
+            shellmatta_transport_configure(handle, false, true, NULL, NULL);
             shellmatta_processData(handle, (char*)"\x01\x01\x00\x16\x00\x00\x00\x00"
                                                 "doSomething argument\r\n"
                                                 "\x7b\x49\xfa\x72", 34u);
@@ -280,11 +280,11 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
                     THEN("The shellmatta returns the data")
                     {
 
-                        char *dummyData =   (char*)"\x01\x01\x00\x2f\x00\x00\x01\x01"
+                        char *dummyData =   (char*)"\x01\x01\x00\x2f\x00\x01\x01\x01"
                                                 "doSomething argument - length: 20"
                                                 "\r\n"
                                                 "shellmatta->"
-                                                "\xc8\xae\xc0\x56";
+                                                "\x4c\x9f\xd9\xa7";
 
                         CHECK(write_length == 59u);
                         REQUIRE(memcmp(write_data, dummyData, 59) == 0);
@@ -300,8 +300,8 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
                                                   "\xc4\xa3\x07\xe6", 12u);
             THEN("The valid Sequence counter is returned")
             {
-                char *dummyData =   (char*)"\x01\x01\x81\x00\x00\x00\x01\x01"
-                                           "\xb4\x0f\x12\xe9";
+                char *dummyData =   (char*)"\x01\x01\x81\x00\x00\x01\x01\x01"
+                                           "\xb5\xcd\x78\xde";
 
                 CHECK(write_length == 12);
                 REQUIRE(memcmp(write_data, dummyData, 12) == 0);
@@ -316,8 +316,8 @@ SCENARIO("Integration test of Transport layer", "[integration, transport]")
                                                       "\xc4\xa3\x07\xe6", 12u);
                 THEN("The next Sequence counter is returned")
                 {
-                    char *dummyData =   (char*)"\x01\x01\x81\x00\x00\x00\x02\x02"
-                                               "\x06\x2b\x10\x90";
+                    char *dummyData =   (char*)"\x01\x01\x81\x00\x00\x01\x02\x02"
+                                               "\x07\xe9\x7a\xa7";
 
                     CHECK(write_length == 12);
                     REQUIRE(memcmp(write_data, dummyData, 12) == 0);
@@ -353,7 +353,7 @@ SCENARIO("Integration test of Transport layer with mandatory transport layer", "
         write_length = 0u;
 
         WHEN("The tansport layer is set to mandatory") {
-            ret = shellmatta_transport_configure(handle, true, false, NULL);
+            ret = shellmatta_transport_configure(handle, true, false, NULL, NULL);
             CHECK(ret == SHELLMATTA_OK);
 
             AND_WHEN("manual mode is used after transport layer mode")
@@ -366,11 +366,11 @@ SCENARIO("Integration test of Transport layer with mandatory transport layer", "
                 shellmatta_processData(handle, (char*)"doSomething argument\r\n", 22u);
                 THEN("The shellmatta responds only to the first command - and waits for a new telegram to start")
                 {
-                    char *dummyData =   (char*)"\x01\x01\x00\x2f\x00\x00\x01\x01"
+                    char *dummyData =   (char*)"\x01\x01\x00\x2f\x00\x01\x01\x01"
                                             "doSomething argument - length: 20"
                                             "\r\n"
                                             "shellmatta->"
-                                            "\xc8\xae\xc0\x56";
+                                            "\x4c\x9f\xd9\xa7";
 
                     CHECK(write_length == 59);
                     CHECK(memcmp(write_data, dummyData, write_length) == 0);
@@ -407,7 +407,7 @@ SCENARIO("Integration test of Transport layer - reset transport layer", "[integr
         write_length = 0u;
 
         WHEN("The tansport layer is set to mandatory") {
-            ret = shellmatta_transport_configure(handle, true, false, NULL);
+            ret = shellmatta_transport_configure(handle, true, false, NULL, NULL);
             CHECK(ret == SHELLMATTA_OK);
 
             AND_WHEN("A partial telegram is passed")
@@ -438,3 +438,69 @@ SCENARIO("Integration test of Transport layer - reset transport layer", "[integr
         }
     }
 }
+
+SCENARIO("Integration test of Transport layer - addressing", "[integration, transport]")
+{
+    GIVEN("Shellmatta up and running with one command - transport layer with UUID")
+    {
+        shellmatta_instance_t inst;
+        shellmatta_handle_t handle;
+        shellmatta_retCode_t ret;
+        char buffer[1024];
+        char historyBuffer[1024];
+
+        shellmatta_doInit(  &inst,
+                            &handle,
+                            buffer,
+                            sizeof(buffer),
+                            historyBuffer,
+                            sizeof(historyBuffer),
+                            "shellmatta->",
+                            NULL,
+                            writeFct);
+        shellmatta_addCmd(handle, &doSomethingCmd);
+
+        ret = shellmatta_transport_configure(handle, true, false, (uint8_t *)"123456789012345", NULL);
+        CHECK(ret == SHELLMATTA_OK);
+
+        write_callCnt = 0u;
+        memset(write_data, 0, sizeof(write_data));
+        write_length = 0u;
+
+        WHEN("The shellmatta is searched using an invalid range") {
+            ret = shellmatta_transport_configure(handle, true, false, NULL, NULL);
+
+            /* check with valid payload - disable echo to reduce cluttering */
+            shellmatta_configure(handle, SHELLMATTA_MODE_INSERT, false, '\r');
+            shellmatta_processData(handle, (char*)"\x01\x01\x03\x20\x00\x00\x00\x00"
+                                                    "234567890123456\0"
+                                                    "345678901234567\0"
+                                                    "\x93\x0c\xc3\x04", 44u);
+
+            THEN("The shellmatta does not respond")
+            {
+                CHECK(write_length == 0);
+                CHECK(inst.transportLayer.sequenceH2S == 1);
+                REQUIRE(inst.transportLayer.state == SHELLMATTA_TRANSPORT_STATE_WAIT);
+            }
+        }
+
+        WHEN("The shellmatta is searched using a valid range") {
+            ret = shellmatta_transport_configure(handle, true, false, NULL, NULL);
+
+            /* check with valid payload - disable echo to reduce cluttering */
+            shellmatta_configure(handle, SHELLMATTA_MODE_INSERT, false, '\r');
+            shellmatta_processData(handle, (char*)"\x01\x01\x03\x20\x00\x00\x00\x00"
+                                                    "123456789012344\0"
+                                                    "345678901234567\0"
+                                                    "\x9b\x69\x59\x5f", 44u);
+
+            THEN("The shellmatta does not respond")
+            {
+                CHECK(write_length == 28);
+                CHECK(inst.transportLayer.sequenceH2S == 1);
+                REQUIRE(inst.transportLayer.state == SHELLMATTA_TRANSPORT_STATE_WAIT);
+            }
+        }
+    }
+}