Naturaldocs api documentation added

Signed-off-by: eantwuh <antal.wu-hen-chang@ericsson.com>
diff --git a/IOT_App_Definitions.ttcn b/IOT_App_Definitions.ttcn
index ae26345..df25dac 100644
--- a/IOT_App_Definitions.ttcn
+++ b/IOT_App_Definitions.ttcn
@@ -14,18 +14,158 @@
 //  Updated:            2017-09-01
 //  Contact:            http://ttcn.ericsson.se
 ///////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//  Module: IOT_App_Definitions
+// 
+//  Purpose:
+//    This module contains the definitions for RIoT's main component
+//
+//  Detailed comments:
+//    RIoT is a load generator built on top of the TitanSim load generator framework. It is
+//    capable of simulating devices using some IoT protocols (CoAP, LwM2M, MQTT, HTTP). RIoT
+//    (and the TitanSim framework) was created to support non-functional tests, where load generation
+//    is required like performance, stability, scalability.
+//
+//  Module depends on:
+//    - <EPTF_CLL_Base_Definitions>
+//    - <EPTF_CLL_DsRestAPI_Definitions>
+// 
+//  Module Parameters:
+//    tsp_EPTF_DsRestAPI_HTTPServer_RemoteAddress - <tsp_EPTF_DsRestAPI_HTTPServer_RemoteAddress> - *charstring* - the IP address of the REST API server
+//    tsp_EPTF_DsRestAPI_HTTPServer_RemotePort - <tsp_EPTF_DsRestAPI_HTTPServer_RemotePort> - *charstring* - the port number of the REST API server
+//    tsp_EPTF_DsRestAPI_HTTPServer_directory - <tsp_EPTF_DsRestAPI_HTTPServer_directory> - *charstring* - the path of REST API HTTP server directory
+//    tsp_EPTF_DsRestAPI_customizableApp_directory - <tsp_EPTF_DsRestAPI_customizableApp_directory> - *charstring* - the path of the REST API customizableApp directory
+//    tsp_EPTF_DsRestAPI_API_directory - <tsp_EPTF_DsRestAPI_API_directory> - *charstring* - the path of DsRestAPI API directory
+//
+//  Configuration:
+//    - <tsp_EPTF_ExecCtrl_LGenPool_Declarators>
+//    - <tsp_EPTF_ExecCtrl_EntityGroup2LGenPool_List>
+//    - <tsp_LGenBase_EntityGrpDeclarators>
+//    - <tsp_EPTF_ExecCtrl_Scenario2EntityGroupList>
+//    - <tsp_LGenBase_TcMgmt_ScenarioDeclarators3>
+//    - <tsp_LGenBase_TcMgmt_tcTypeDeclarators2>
+//    - <tsp_IOT_LGen_FSMs>
+//
+//  Component Diagram:
+//   (see IOT_App_Definitions.components.jpg)
+//
+//  Related Types:
+//    - <IOT_App_CT>
+//    - <IOT_LGen_CT>
+//    - <EPTF_ExecCtrl_CT>
+///////////////////////////////////////////////////////////////
 module IOT_App_Definitions
 {
   import from EPTF_CLL_Base_Definitions all;
   import from EPTF_CLL_DsRestAPI_Definitions all;
   
+ /*****************************************************************
+  @startuml IOT_App_Definitions.components.jpg
+  package "RIoT" {
+    class IOT_App_CT {
+      TC()
+    }
+    class EPTF_ExecCtrl_CT {
+      f_IOT_App_startExecCtrl()
+      f_IOT_LGen_create()
+    }
+    class IOT_LGen_CT {
+      f_IOT_LGen_behavior()
+    }
+    IOT_App_CT "1" <-> "*" IOT_LGen_CT
+    IOT_App_CT "1" <-> "1" EPTF_ExecCtrl_CT
+    EPTF_ExecCtrl_CT "1" <-> "*" IOT_LGen_CT
+  }
+  package "GUI" {
+  }
+  RIoT <-> GUI
+  @enduml
+  ******************************************************************/
+  
+  ///////////////////////////////////////////////////////////
+  //  Module parameter: tsp_EPTF_DsRestAPI_HTTPServer_RemoteAddress
+  // 
+  //  Purpose:
+  //    IP address of the REST API server
+  //
+  //  Type:
+  //     *charstring*
+  //
+  //  Default value:
+  //     *"127.0.0.1"*
+  ///////////////////////////////////////////////////////////
   modulepar charstring 	tsp_EPTF_DsRestAPI_HTTPServer_RemoteAddress := "127.0.0.1";
+
+  ///////////////////////////////////////////////////////////
+  //  Module parameter: tsp_EPTF_DsRestAPI_HTTPServer_RemotePort
+  // 
+  //  Purpose:
+  //    Port number of the REST API server
+  //
+  //  Type:
+  //     *integer*
+  //
+  //  Default value:
+  //     *4040*
+  ///////////////////////////////////////////////////////////
   modulepar integer 	tsp_EPTF_DsRestAPI_HTTPServer_RemotePort := 4040;
+
+  ///////////////////////////////////////////////////////////
+  //  Module parameter: tsp_EPTF_DsRestAPI_HTTPServer_directory
+  // 
+  //  Purpose:
+  //    Path of REST API HTTP server directory
+  //
+  //  Type:
+  //     *charstring*
+  //
+  //  Default value:
+  //     *"./WebGUI/WebGUI_link/"*
+  ///////////////////////////////////////////////////////////
   modulepar charstring	tsp_EPTF_DsRestAPI_HTTPServer_directory := "./WebGUI/WebGUI_link/";
 
+  ///////////////////////////////////////////////////////////
+  //  Module parameter: tsp_EPTF_DsRestAPI_customizableApp_directory
+  // 
+  //  Purpose:
+  //    Path of the REST API customizableApp directory
+  //
+  //  Type:
+  //     *charstring*
+  //
+  //  Default value:
+  //     *"./WebGUI/GUICustomization_link"*
+  ///////////////////////////////////////////////////////////
   modulepar charstring 	tsp_EPTF_DsRestAPI_customizableApp_directory := "./WebGUI/GUICustomization_link";
+
+  ///////////////////////////////////////////////////////////
+  //  Module parameter: tsp_EPTF_DsRestAPI_API_directory
+  // 
+  //  Purpose:
+  //    Path of DsRestAPI API directory
+  //
+  //  Type:
+  //     *charstring*
+  //
+  //  Default value:
+  //     *"./WebGUI/Js_link"*
+  ///////////////////////////////////////////////////////////
   modulepar charstring 	tsp_EPTF_DsRestAPI_API_directory := "./WebGUI/Js_link";  
 
+  ///////////////////////////////////////////////////////////
+  // Type: IOT_App_CT
+  //
+  // Purpose:
+  //   RIoT application's main component providing a REST API to the environment
+  //
+  // Extensions:
+  //  - <EPTF_Base_CT>
+  //  - <EPTF_DsRestAPI_CT>
+  //
+  // Related Functions:
+  //   - <TC> () - The main test case function, entry point of the application
+  ///////////////////////////////////////////////////////////
   type component IOT_App_CT extends EPTF_Base_CT, EPTF_DsRestAPI_CT
   {
     var boolean v_ready := false; 
diff --git a/IOT_App_Functions.ttcn b/IOT_App_Functions.ttcn
index e6c00b0..07a4ff3 100644
--- a/IOT_App_Functions.ttcn
+++ b/IOT_App_Functions.ttcn
@@ -14,6 +14,30 @@
 //  Updated:            2017-09-01
 //  Contact:            http://ttcn.ericsson.se
 ///////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//  Module: IOT_App_Functions
+// 
+//  Purpose:
+//    This module contains the functions of RIoT's main component
+//
+//  See also:
+//    <IOT_App_Definitions>
+//
+//  Module depends on:
+//    - <IOT_LGen_Definitions>
+//    - <IOT_LGen_Functions>
+//    - <EPTF_CLL_Base_Functions>
+//    - <EPTF_CLL_ExecCtrl_Definitions>
+//    - <EPTF_CLL_ExecCtrl_Functions>
+//    - <EPTF_CLL_DsRestAPI_Functions>
+//    - <EPTF_CLL_DataSource_Definitions>
+//    - <EPTF_CLL_DataSource_Functions>
+// 
+//  Module Parameters:
+//    tsp_nrOfLGens - <tsp_nrOfLGens> - *integer* - the number of <IOT_LGen_CT> instances to be createed during start up
+//    tsp_LGname_prefix - <tsp_LGname_prefix> - *charstring* - name prefix used for the created <IOT_LGen_CT> instances
+///////////////////////////////////////////////////////////////
 module IOT_App_Functions 
 {
   import from IOT_App_Definitions all;
@@ -30,10 +54,18 @@
   modulepar integer     tsp_nrOfLGens := 0;
   modulepar charstring  tsp_LGname_prefix := "IOT_LGen";
 
+  ///////////////////////////////////////////////////////////
+  //  Testcase: TC
+  //
+  //  Purpose:
+  //    The main entry point of the RIoT application
+  //
+  //  Related Types:
+  //    <IOT_App_CT>
+  ///////////////////////////////////////////////////////////
   testcase TC() runs on IOT_App_CT
   {
     log(%definitionId,": Creating UI");
-    //f_EPTF_UIHandler_init_CT("IOT_App", false);
     f_EPTF_DsRestAPI_init_CT("IOT_App");
 
     log(%definitionId,": Creating ExecCtrl");
@@ -62,8 +94,6 @@
       [v_ready] T_alt.timeout{}
     }
 
-    //action(" ExecCtrl ready, starting reading GUI.xml");
-    //f_EPTF_UIHandler_createGUIFromFile("gui.xml");
     var integer vl_Ret := f_EPTF_DsRestAPI_start(
       tsp_EPTF_DsRestAPI_HTTPServer_RemoteAddress, 
       tsp_EPTF_DsRestAPI_HTTPServer_RemotePort, 
@@ -72,26 +102,28 @@
       tsp_EPTF_DsRestAPI_API_directory
     );
     
-    /*
-    timer t;
-    t.start(tsp_testDuration);
-
-    log(%definitionId,": IOT_App: entering main EH...")
-    alt
-    {
-      [] t.timeout
-        {
-          log(%definitionId,": IOT_App: main EH: timeout...")
-        }
-    } // alt
-
-    f_EPTF_Base_cleanup_CT();
-    log(%definitionId,": finished")
-    */
-
-	f_EPTF_Base_wait4Shutdown();
+    f_EPTF_Base_wait4Shutdown();
   }
 
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_App_startExecCtrl
+  //
+  //  Purpose:
+  //    Starting up the Execution Control component that will orchestrate
+  //    the load generator <IOT_LGen_CT>,<EPTF_ExecCtrlClient_CT> component instances
+  //
+  //  Parameters:
+  //    pl_selfName - *in charstring* - name of the execution control components instance
+  //    pl_nrOfClients - *in integer* - number of <EPTF_ExecCtrlClient_CT> load generator components to wait for
+  //    pl_datasource - *in* <EPTF_DataSource_CT> - data source server
+  //
+  //  Related Types:
+  //    <EPTF_ExecCtrl_CT>
+  //
+  //  Related functions:
+  //    - <f_EPTF_ExecCtrl_loadConfig>
+  //    - <f_EPTF_ExecCtrl_init_CT>
+  ///////////////////////////////////////////////////////////
   function f_IOT_App_startExecCtrl(
     in charstring pl_selfName, 
     in integer pl_nrOfClients,
@@ -112,6 +144,24 @@
     f_EPTF_Base_wait4Shutdown();
   }
 
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_create
+  //
+  //  Purpose:
+  //    Starting up a load generator <IOT_LGen_CT> component instances
+  //
+  //  Parameters:
+  //    pl_hostname - *in charstring* - name of the host, where the load generator instance will be created
+  //    pl_componentName - *in charstring* - the name of the load generator component instance
+  //
+  //  Related Types:
+  //    <IOT_LGen_CT>
+  //    <EPTF_ExecCtrlClient_CT>
+  //    <EPTF_ExecCtrl_CT>
+  //
+  //  Related functions:
+  //    - <f_IOT_LGen_behavior>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_create
   (
     in charstring pl_hostname,
diff --git a/IOT_LGen_Definitions.ttcn b/IOT_LGen_Definitions.ttcn
index f84cea5..62e8bb4 100644
--- a/IOT_LGen_Definitions.ttcn
+++ b/IOT_LGen_Definitions.ttcn
@@ -14,6 +14,47 @@
 //  Updated:            2017-09-01
 //  Contact:            http://ttcn.ericsson.se
 ///////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//  Module: IOT_LGen_Definitions
+// 
+//  Purpose:
+//    This module contains the definitions for RIoT's load generator component
+//
+//  Detailed comments:
+//    RIoT is a load generator built on top of the TitanSim load generator framework. It is
+//    capable of simulating devices using some IoT protocols (CoAP, LwM2M, MQTT, HTTP). RIoT
+//    (and the TitanSim framework) was created to support non-functional tests, where load generation
+//    is required like performance, stability, scalability.
+//
+//  Events, TestSteps:
+//    <IOT_LGen_Steps>
+// 
+//  Module Parameters:
+//    tsp_IOT_LGen_FSMs - <EPTF_LGenBase_FsmTableDeclaratorList> - FSM declarations that can be instantiated for the traffic cases
+//
+//  Module depends on:
+//    - <EPTF_MQTT_LGen_Definitions>
+//    - <EPTF_MQTT_LocalTransport_Definitions>
+//    - <EPTF_COAP_LGen_Definitions>
+//    - <EPTF_COAP_LocalTransport_Definitions>
+//    - <EPTF_LwM2M_LGen_Definitions>
+//    - <EPTF_LwM2M_CoapApplibTransport_Definitions>
+//    - <EPTF_LwM2M_Object_Definitions>
+//    - <EPTF_HTTP_Definitions>
+//    - <EPTF_HTTP_Transport_Definitions>
+//    - <EPTF_CLL_LGenBase_Definitions>
+//    - <EPTF_CLL_LGenBase_ConfigDefinitions>
+//    - <EPTF_CLL_ExecCtrl_Definitions>
+//
+//  Component Diagram:
+//   (see IOT_App_Definitions.components.jpg)
+//
+//  Related Types:
+//    - <IOT_App_CT>
+//    - <IOT_LGen_CT>
+//    - <EPTF_ExecCtrl_CT>
+///////////////////////////////////////////////////////////////
 module IOT_LGen_Definitions
 {
   import from EPTF_MQTT_LGen_Definitions all;
@@ -29,12 +70,34 @@
   import from EPTF_CLL_LGenBase_ConfigDefinitions all;
   import from EPTF_CLL_ExecCtrl_Definitions all;
   import from InfluxDB_Definitions all;
-  
+
+  ///////////////////////////////////////////////////////////
+  //  Module parameter: tsp_IOT_LGen_FSMs
+  // 
+  //  Purpose:
+  //    FSM declarations that can be instantiated for the traffic cases
+  //
+  //  Type:
+  //     <EPTF_LGenBase_FsmTableDeclaratorList>
+  ///////////////////////////////////////////////////////////
   modulepar EPTF_LGenBase_FsmTableDeclaratorList tsp_IOT_LGen_FSMs := {}
 
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_entityType
+  //
+  //  Purpose:
+  //    Constant for the simulated IoT entity type
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_entityType := "IOT_Entity";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_behaviorType
+  //
+  //  Purpose:
+  //    Constant for the simulated IoT behavior type
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_behaviorType := "IOT_Behavior";
-  
+
   const integer c_IOT_LGen_Logging_WARNING := 0;
   const integer c_IOT_LGen_Logging_DEBUG := 1;
   const integer c_IOT_LGen_Logging_DEBUGV := 2;
@@ -45,6 +108,52 @@
   const integer c_FSM_fail := 2;
   const integer c_FSM_timeout := 3;
 
+  ///////////////////////////////////////////////////////////
+  // Type: IOT_LGen_CT
+  //
+  // Purpose:
+  //   IoT load generator component
+  //
+  // Class:
+  //   (see EPTF_COAP_LGen_Definitions.EPTF_COAP_LGen_CT.jpg)
+  //
+  // Extensions:
+  //  - <EPTF_LGenBase_CT>
+  //  - <EPTF_ExecCtrlClient_CT>
+  //  - <EPTF_MQTT_LGen_CT>
+  //  - <EPTF_MQTT_LocalTransport_CT>
+  //  - <EPTF_COAP_LGen_CT>
+  //  - <EPTF_COAP_LocalTransport_CT>
+  //  - <EPTF_LwM2M_LGen_CT>
+  //  - <EPTF_LwM2M_CoapApplibTransport_CT>
+  //  - <EPTF_HTTP_LGen_CT>
+  //  - <EPTF_HTTP_LocalTransport_CT>
+  //  - <InfluxDB_CT>
+  //
+  // Variables:
+  //   v_IOT_LGen_name  - *charstring* - name of the current load generator instance
+  //   v_IOT_LGen_idx  - *integer* - unique index of the current load generator instance
+  //   v_IOT_bIdx - *integer* - id of the IOT behavior defined by RIoT
+  //   v_IOT_LGen_loggingMaskId - *integer* - id for RioT logging functions
+  // 
+  // Instance databases:
+  //   v_IOT_LGen_DataSamples_DB - <LwM2M_DataSamples_DB> - Storing data samples for LwM2M smart objects
+  //
+  //  Events, TestSteps:
+  //    <IOT_LGen_Steps>
+  //
+  // Related Functions:
+  //   - <f_IOT_LGen_init> (in *charstring* pl_selfName, in *integer* p_idx, in <EPTF_ExecCtrl_CT> pl_ExecCtrlRef)
+  //   - <f_IOT_LGen_initSamples> (in *charstring* p_selfName)
+  //   - <f_IOT_LGen_behavior> (in *charstring* pl_selfName, in *integer* p_idx, in <EPTF_ExecCtrl_CT> pl_ExecCtrlRef)
+  //   - <f_IOT_LGen_Logging_VERBOSE> (in @lazy *charstring* pl_message)
+  //   - <f_IOT_LGen_Logging_DEBUG> (in @lazy *charstring* pl_message)
+  //   - <f_IOT_LGen_Logging_WARNING> (in @lazy *charstring* pl_message)
+  //   - <f_IOT_LGen_Logging_ERROR> (in @lazy *charstring* pl_message)
+  //   - <f_IOT_COAP_LocalTransport_send> (in <EPTF_COAP_PDU> pl_msg)
+  //   - <f_IOT_COAP_LGen_receiveMessage> (in <EPTF_COAP_PDU> pl_message)
+  //   - <f_EPTF_COAP_PDU_to_Influx> ()
+  ///////////////////////////////////////////////////////////
   type component IOT_LGen_CT 
   extends EPTF_LGenBase_CT, EPTF_ExecCtrlClient_CT, 
   		EPTF_MQTT_LGen_CT, EPTF_MQTT_LocalTransport_CT,
@@ -58,11 +167,6 @@
     
     var integer v_IOT_bIdx;
     var integer v_IOT_LGen_loggingMaskId;
-
-    var integer v_IOT_LGen_localAddressIdx;
-    var integer v_IOT_LGen_remoteAddressIdx;
-    
-    var integer v_HTTP_portGroupConnectionHandle := -1;
     
     var LwM2M_DataSamples_DB v_IOT_LGen_DataSamples_DB := c_LwM2M_DataSamples_DB_init;
   }
diff --git a/IOT_LGen_Functions.ttcn b/IOT_LGen_Functions.ttcn
index 02ae4d2..0afe7f2 100644
--- a/IOT_LGen_Functions.ttcn
+++ b/IOT_LGen_Functions.ttcn
@@ -14,6 +14,45 @@
 //  Updated:            2017-09-01
 //  Contact:            http://ttcn.ericsson.se
 ///////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//  Module: IOT_LGen_Functions
+// 
+//  Purpose:
+//    This module contains the functions of RIoT's load generator component
+//
+//  See also:
+//    <IOT_LGen_Definitions>
+//
+//  Module depends on:
+//    - <IOT_LGen_Definitions>
+//    - <IOT_LGen_Steps>
+//    - <EPTF_MQTT_LGen_Definitions>
+//    - <EPTF_MQTT_LGen_Functions>
+//    - <EPTF_MQTT_LocalTransport_Functions>
+//    - <EPTF_COAP_LGen_Definitions>
+//    - <EPTF_COAP_LGen_Functions>
+//    - <EPTF_COAP_Transport_Definitions>
+//    - <EPTF_COAP_LocalTransport_Functions>
+//    - <EPTF_LwM2M_LGen_Definitions>
+//    - <EPTF_LwM2M_LGen_Functions>
+//    - <EPTF_LwM2M_CoapApplibTransport_Functions>
+//    - <EPTF_LwM2M_Object_Definitions>
+//    - <EPTF_LwM2M_Object_Functions>
+//    - <EPTF_HTTP_Definitions>
+//    - <EPTF_HTTP_Functions>
+//    - <EPTF_HTTP_Transport_Functions>
+//    - <EPTF_CLL_Common_Definitions>
+//    - <EPTF_CLL_Base_Functions>
+//    - <EPTF_CLL_ExecCtrl_Definitions>
+//    - <EPTF_CLL_ExecCtrlClient_Functions>
+//    - <EPTF_CLL_LGenBase_Functions>
+//    - <EPTF_CLL_LGenBase_ConfigFunctions>
+//    - <EPTF_CLL_Logging_Definitions>
+//    - <EPTF_CLL_Logging_Functions>
+//    - <InfluxDB_Definitions>
+//    - <InfluxDB_Functions>
+///////////////////////////////////////////////////////////////
 module IOT_LGen_Functions
 {
   import from IOT_LGen_Definitions all;
@@ -47,6 +86,20 @@
   import from InfluxDB_Definitions all;
   //import from InfluxDB_Functions all;
 
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_behavior
+  //
+  //  Purpose:
+  //    The main service function of the <IOT_LGen_CT> component type
+  //    After initialization, this is that function that is continuously running
+  //    until the RIoT application exits
+  //
+  //  Parameters:
+  //    pl_name - *in* *charstring* - the name for the component instance
+  //
+  //  Related Type:
+  //    <IOT_LGen_CT>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_behavior(in charstring pl_selfName, in integer p_idx, in EPTF_ExecCtrl_CT pl_ExecCtrlRef)
   runs on IOT_LGen_CT
   {
@@ -56,31 +109,46 @@
     f_EPTF_ExecCtrlClient_init_CT(pl_selfName, pl_ExecCtrlRef);   // Only after library init(s)
 
     f_EPTF_Base_wait4Shutdown();
-    
+
     f_LwM2M_DataSamples_DB_cleanUp(v_IOT_LGen_DataSamples_DB);
-    
+
     f_EPTF_Base_cleanup_CT();
   }
-    
+
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_init
+  //
+  //  Purpose:
+  //    The main init function of the <IOT_LGen_CT> component type
+  //    It initializes the integrated application libraries and defines
+  //    its own <c_IOT_behaviorType> and test steps <f_IOT_LGen_declareSteps>
+  //    The sample database of the smart objects are also filled in here by calling <f_IOT_LGen_initSamples>
+  //
+  //  Parameters:
+  //    pl_name - *in* *charstring* - the name for the component instance
+  //
+  //  Related Type:
+  //    <IOT_LGen_CT>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_init(in charstring pl_selfName, in integer p_idx, in EPTF_ExecCtrl_CT pl_ExecCtrlRef)
   runs on IOT_LGen_CT 
   {
     v_IOT_LGen_name := pl_selfName;
     v_IOT_LGen_idx := p_idx;
-    
+
     f_EPTF_Logging_init_CT(pl_selfName);
-    
+
     v_IOT_LGen_loggingMaskId := 
       f_EPTF_Logging_registerComponentMasks(
         "IOT_LGen", 
         {"WARNING", "DEBUG", "DEBUGV" ,"ERROR" },
         EPTF_Logging_CLL);    
-    
+
     f_EPTF_LGenBase_init(pl_selfName, 0, "IoT_Entity#");
-    
+
     v_InfluxDB_ctx.localPort := tsp_InfluxDB_client_basePort + p_idx;
     //f_InfluxDB_init();
-    
+
     f_IOT_LGen_initSamples(pl_selfName);
 
     //////////////////////
@@ -94,13 +162,13 @@
     vf_EPTF_COAP_Transport_receiveEvent := refers(f_EPTF_COAP_LGen_receiveEvent);
     vf_EPTF_COAP_Transport_apiRequest := refers(f_EPTF_COAP_LocalTransport_transportApiRequest);
     vf_EPTF_COAP_Transport_apiResponse := refers(f_EPTF_COAP_LGen_transportApiResponse);
-    
+
     //////////////////////
     // LWM2M applib init
-    
+
     f_EPTF_LwM2M_LGen_init(pl_selfName);
     f_EPTF_LwM2M_CoapApplibTransport_init(pl_selfName);
-    
+
     vf_COAP_msgReceived := refers(f_EPTF_LwM2M_CoapApplibTransport_messageReceived);
     vf_COAP_eventIndication := refers(f_EPTF_LwM2M_CoapApplibTransport_eventIndication);
     vf_EPTF_LwM2M_Transport_send := refers(f_EPTF_LwM2M_CoapApplibTransport_send);
@@ -109,7 +177,7 @@
 
     //////////////////////
     // HTTP applib init
-    
+
     f_EPTF_HTTP_init("HTTP", 0, "Demo Entity#");
 
     f_EPTF_HTTP_LocalTransport_init_CT("HTTP", 
@@ -124,7 +192,7 @@
   	f_EPTF_HTTP_setConnectionHalfCloseFunction(refers(f_EPTF_HTTP_LocalTransport_connectionHalfClose));
   	f_EPTF_HTTP_setClosePortOfUserFunction(refers(f_EPTF_HTTP_LocalTransport_closePortOfUser));
   	f_EPTF_HTTP_setFreePortOfUserFunction(refers(f_EPTF_HTTP_LocalTransport_freePortOfUser));
-  	
+
     //////////////////////
     // MQTT applib init
 
@@ -139,7 +207,7 @@
 
     //////////////////////
     // CLL config
-    
+
     v_IOT_bIdx := f_EPTF_LGenBase_declareBehaviorType(c_IOT_behaviorType, -1, null, null, null);    
     f_EPTF_LGenBase_declareEntityType(
       c_IOT_entityType, 
@@ -157,7 +225,19 @@
     // FSMs
     f_EPTF_LGenBase_declareFSMTables(tsp_IOT_LGen_FSMs);
   }
-  
+
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_Logging_VERBOSE
+  //
+  //  Purpose:
+  //    Logging functions for the VERBOSE log level
+  //
+  //  Parameters:
+  //    pl_message - *in* *charstring* - string to be logged
+  //
+  //  Related Types:
+  //    <IOT_LGen_CT>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_Logging_VERBOSE(in @lazy charstring pl_message)
   runs on IOT_LGen_CT
   {
@@ -166,6 +246,18 @@
 	}
   }
 
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_Logging_DEBUG
+  //
+  //  Purpose:
+  //    Logging functions for the DEBUG log level
+  //
+  //  Parameters:
+  //    pl_message - *in* *charstring* - string to be logged
+  //
+  //  Related Types:
+  //    <IOT_LGen_CT>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_Logging_DEBUG(in @lazy charstring pl_message)
   runs on IOT_LGen_CT
   {
@@ -174,6 +266,18 @@
 	}
   }
 
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_Logging_WARNING
+  //
+  //  Purpose:
+  //    Logging functions for the WARNING log level
+  //
+  //  Parameters:
+  //    pl_message - *in* *charstring* - string to be logged
+  //
+  //  Related Types:
+  //    <IOT_LGen_CT>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_Logging_WARNING(in @lazy charstring pl_message)
   runs on IOT_LGen_CT
   {
@@ -182,6 +286,18 @@
 	}
   }
 
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_Logging_ERROR
+  //
+  //  Purpose:
+  //    Logging functions for the ERROR log level
+  //
+  //  Parameters:
+  //    pl_message - *in* *charstring* - string to be logged
+  //
+  //  Related Types:
+  //    <IOT_LGen_CT>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_Logging_ERROR(in @lazy charstring pl_message)
   runs on IOT_LGen_CT
   {
@@ -190,6 +306,19 @@
 	}
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_COAP_LocalTransport_send
+  //
+  //  Purpose:
+  //    Wrapper of <f_IOT_COAP_LocalTransport_send>, used for
+  //    catching outgoing COAP messages.
+  //
+  //  Parameters:
+  //    pl_msg - *in* <EPTF_COAP_PDU> - outgoing message
+  //
+  //  Related Types:
+  //    <IOT_LGen_CT>
+  ///////////////////////////////////////////////////////////
   function f_IOT_COAP_LocalTransport_send(in EPTF_COAP_PDU pl_msg)
   runs on IOT_LGen_CT
   {
@@ -206,7 +335,19 @@
     */
   }
 
-  
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_COAP_LGen_receiveMessage
+  //
+  //  Purpose:
+  //    Wrapper of <f_EPTF_COAP_LGen_receiveMessage>, used for
+  //    catching and incoming COAP messages.
+  //
+  //  Parameters:
+  //    pl_message - *in* <EPTF_COAP_PDU> - incoming message
+  //
+  //  Related Types:
+  //    <IOT_LGen_CT>
+  ///////////////////////////////////////////////////////////  
   function f_IOT_COAP_LGen_receiveMessage(in EPTF_COAP_PDU pl_message)
   runs on IOT_LGen_CT
   {
@@ -270,6 +411,19 @@
   }
   */
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_initSamples
+  //
+  //  Purpose:
+  //    Initializes the *v_IOT_LGen_DataSamples_DB* database by loading
+  //    a set of data samples
+  //
+  //  Parameters:
+  //    p_selfName - *in charstring* - load generator instance's name
+  //
+  //  Related Types:
+  //    <IOT_LGen_CT>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_initSamples(in charstring p_selfName)
   runs on IOT_LGen_CT
   {
diff --git a/IOT_LGen_Steps.ttcn b/IOT_LGen_Steps.ttcn
index c639d55..71d9dd6 100644
--- a/IOT_LGen_Steps.ttcn
+++ b/IOT_LGen_Steps.ttcn
@@ -14,6 +14,89 @@
 //  Updated:            2017-09-01
 //  Contact:            http://ttcn.ericsson.se
 ///////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (c) 2000-2017 Ericsson Telecom AB
+//
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// which accompanies this distribution, and is available at
+// http://www.eclipse.org/legal/epl-v10.html
+///////////////////////////////////////////////////////////////////////////////
+//  File:               IOT_LGen_Functions.ttcn
+//  Description:
+//  Rev:                R1A
+//  Prodnr:             LPA 108 661
+//  Updated:            2017-09-01
+//  Contact:            http://ttcn.ericsson.se
+///////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+//  Module: IOT_LGen_Steps
+// 
+//  Purpose:
+//    This module contains test step functions for RIoT's load generator component
+//
+//  See also:
+//    <IOT_LGen_Definitions>
+//
+//  Module depends on:
+//    - <IOT_LGen_Definitions>
+//    - <EPTF_MQTT_LGen_Functions>
+//    - <EPTF_COAP_LGen_Definitions>
+//    - <EPTF_COAP_LGen_Functions>
+//    - <EPTF_LwM2M_LGen_Functions>
+//    - <EPTF_LwM2M_Object_Definitions>
+//    - <EPTF_LwM2M_Object_Functions>
+//    - <EPTF_HTTP_Functions>
+//    - <EPTF_HTTP_Transport_Functions>
+//    - <EPTF_CLL_Common_Definitions>
+//    - <EPTF_CLL_ExecCtrlClient_Functions>
+//    - <EPTF_CLL_LGenBase_Definitions>
+//    - <EPTF_CLL_LGenBase_StepFunctions>
+//    - <EPTF_CLL_LGenBase_ConfigFunctions>
+//    - <EPTF_CLL_Variable_Definitions>
+//    - <EPTF_CLL_Variable_Functions>
+//
+//  Test Steps [Generic]:
+//    testcase finished - <f_IOT_LGen_step_tcFinished_withVerdict>, <c_IOT_stepName_tcFinished_withVerdict>
+//    print - <f_IOT_LGen_step_print_stringParam>, <c_IOT_stepName_print_stringParam>
+//    RND generator - <f_IOT_LGen_step_genRndValue_varParams>, <c_IOT_stepName_genRndValue_varParams>
+//
+//  Test Steps [COAP]:
+//    set local address - <f_IOT_LGen_step_COAP_setLocalAddress_byVars>, <c_IOT_stepName_COAP_setLocalAddress_byVars>
+//
+//  Test Steps [LwM2M]:
+//    set client name - <f_IOT_LGen_step_LwM2M_setClientNameInRegister>, <c_IOT_stepName_LwM2M_setClientNameInRegister>
+//                      <f_IOT_LGen_step_LwM2M_setClientNameInRegister_stringVar>, <c_IOT_stepName_LwM2M_setClientNameInRegister_stringVar>
+//
+//  Test Steps [MQTT]:
+//    set local address - <f_IOT_LGen_step_MQTT_setLocalAddress_byVars>, <c_IOT_stepName_MQTT_setLocalAddress_byVars>
+//                        <f_IOT_LGen_step_MQTT_setClientId_stringParam>, <c_IOT_stepName_MQTT_setClientId_stringParam>
+//
+//  Test Steps [HTTP]:
+//    init entity context - <f_IOT_LGen_step_HTTP_initEntityContext>, <c_IOT_stepName_HTTP_initEntityContext>
+//    open connection - <f_IOT_LGen_step_HTTP_openConnection_byVars>, <c_IOT_stepName_HTTP_openConnection_byVars>
+//    close connection - <f_IOT_LGen_step_HTTP_closeConnection>, <c_IOT_stepName_HTTP_closeConnection>
+//    set HTTP method - <f_IOT_LGen_step_HTTP_setMethod_stringParam>, <c_IOT_stepName_HTTP_setMethod_stringParam>
+//    set HTTP URI - <f_IOT_LGen_step_HTTP_setUri_stringParam>, <c_IOT_stepName_HTTP_addToUri_stringParam>
+//                   <f_IOT_LGen_step_HTTP_addToUri_byVars>, <c_IOT_stepName_HTTP_addToUri_byVars>
+//    add HTTP Host header - <f_IOT_LGen_step_HTTP_addHostHeader_byVars>, <c_IOT_stepName_HTTP_addHostHeader_byVars>
+//
+//  Test Steps [Leshan]:
+//    get client name - <f_IOT_LGen_step_Leshan_getClientFromResponse_intoVar>, <c_IOT_stepName_Leshan_getClientFromResponse_intoVar>
+//
+//  Test Steps [RegDereg FSM]:
+//    init resource values - <f_IOT_LGen_step_FSM_RegDereg_initResourceValues>, <c_IOT_stepName_FSM_RegDereg_initResourceValues>
+//
+//  Test Steps [SimDev FSM]:
+//    create resources - <f_IOT_LGen_step_FSM_SimDevice_createResources>, <c_IOT_stepName_FSM_SimDevice_createResources>
+//    init resource values - <f_IOT_LGen_step_FSM_SimDevice_initResourceValues>, <c_IOT_stepName_FSM_SimDevice_initResourceValues>
+//    init transport - <f_IOT_LGen_step_FSM_SimDevice_initTransport_boolVar>, <c_IOT_stepName_FSM_SimDevice_initTransport_boolVar>
+//    update resource values - <f_IOT_LGen_step_FSM_SimDevice_updateResourceValues>, <c_IOT_stepName_FSM_SimDevice_updateResourceValues>
+//    handle EXECUTE - <f_IOT_LGen_step_FSM_SimDevice_handleExecute>, <c_IOT_stepName_FSM_SimDevice_handleExecute>
+///////////////////////////////////////////////////////////////
 module IOT_LGen_Steps {
 
   import from JSON_Types all;
@@ -36,38 +119,300 @@
   import from EPTF_CLL_LGenBase_ConfigFunctions all;
   import from EPTF_CLL_ExecCtrlClient_Functions all;
 
+  //////////////////////
   // Generic
-    const charstring c_IOT_stepName_tcFinished_withVerdict := "IOT App: tcFinished_withVerdict";
-    const charstring c_IOT_stepName_print_stringParam := "IOT App: print_stringParam";
-    const charstring c_IOT_stepName_genRndValue_varParams := "IOT App: genRndValue_varParams";
+  //////////////////////
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_tcFinished_withVerdict
+  //
+  //  Purpose:
+  //    Charstring constant for the RIoT test case finished test step
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_tcFinished_withVerdict>
+  ///////////////////////////////////////////////////////////
+  const charstring c_IOT_stepName_tcFinished_withVerdict := "IOT App: tcFinished_withVerdict";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_print_stringParam
+  //
+  //  Purpose:
+  //    Charstring constant for the RIoT print string test step
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_print_stringParam>
+  ///////////////////////////////////////////////////////////
+  const charstring c_IOT_stepName_print_stringParam := "IOT App: print_stringParam";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_genRndValue_varParams
+  //
+  //  Purpose:
+  //    Charstring constant for the RIoT random number generator test step
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_genRndValue_varParams>
+  ///////////////////////////////////////////////////////////
+  const charstring c_IOT_stepName_genRndValue_varParams := "IOT App: genRndValue_varParams";
+
+  //////////////////////
   // COAP
+  //////////////////////
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_COAP_setLocalAddress_byVars
+  //
+  //  Purpose:
+  //    Charstring constant for setting the COAP local address test step
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_COAP_setLocalAddress_byVars>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_COAP_setLocalAddress_byVars := "IOT App COAP: setLocalAddress_byVars";
+
+  //////////////////////
   // MQTT
+  //////////////////////
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_MQTT_setLocalAddress_byVars
+  //
+  //  Purpose:
+  //    Charstring constant for setting the MQTT local address test step
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_MQTT_setLocalAddress_byVars>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_MQTT_setLocalAddress_byVars := "IOT App MQTT: setLocalAddress_byVars";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_MQTT_setClientId_stringParam
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that sets the MQTT client id
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_MQTT_setClientId_stringParam>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_MQTT_setClientId_stringParam := "IOT App MQTT: setClientId_stringParam";
+
+  //////////////////////
   // LwM2M
+  //////////////////////
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_LwM2M_setClientNameInRegister
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that sets the LwM2M endpoint name in the Register message
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_LwM2M_setClientNameInRegister>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_LwM2M_setClientNameInRegister := "IOT App LwM2M: setClientNameInRegister";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_LwM2M_setClientNameInRegister_stringVar
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that sets the LwM2M endpoint name in the Register message
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_LwM2M_setClientNameInRegister_stringVar>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_LwM2M_setClientNameInRegister_stringVar := "IOT App LwM2M: setClientNameInRegister_stringVar";
+
+  //////////////////////
   // HTTP
-  const charstring c_IOT_stepName_HTTP_initEntityContext := "IOT App HTTP: initEntityContext";  
+  //////////////////////
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_HTTP_initEntityContext
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that initializes the HTTP entity context
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_HTTP_initEntityContext>
+  ///////////////////////////////////////////////////////////
+  const charstring c_IOT_stepName_HTTP_initEntityContext := "IOT App HTTP: initEntityContext";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_HTTP_openConnection_byVars
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that opens an HTTP connection
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_HTTP_openConnection_byVars>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_HTTP_openConnection_byVars := "IOT App HTTP: openConnection_byVars";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_HTTP_closeConnection
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that closes the opened HTTP connection
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_HTTP_closeConnection>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_HTTP_closeConnection := "IOT App HTTP: closeConnection";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_HTTP_setMethod_stringParam
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that sets the HTTP method for the HTTP message to be sent
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_HTTP_setMethod_stringParam>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_HTTP_setMethod_stringParam := "IOT App HTTP: setMethod_stringParam";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_HTTP_setUri_stringParam
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that sets the HTTP request URI for the HTTP message to be sent
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_HTTP_setUri_stringParam>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_HTTP_setUri_stringParam := "IOT App HTTP: setUri_stringParam";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_HTTP_addToUri_stringParam
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that concatenates a string to the HTTP request URI for the HTTP message to be sent
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_HTTP_addToUri_stringParam>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_HTTP_addToUri_stringParam := "IOT App HTTP: addToUri_stringParam";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_HTTP_addToUri_byVars
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that concatenates a string to the HTTP request URI for the HTTP message to be sent
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_HTTP_addToUri_byVars>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_HTTP_addToUri_byVars := "IOT App HTTP: addToUri_byVars";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_HTTP_addHostHeader_byVars
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that adds a Host header to the HTTP message to be sent
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_HTTP_addHostHeader_byVars>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_HTTP_addHostHeader_byVars := "IOT App HTTP: addHostHeader_byVars";
+
+  //////////////////////
   // Leshan
+  //////////////////////
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_Leshan_getClientFromResponse_intoVar
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that loads the client name into a variable from an HTTP response
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_Leshan_getClientFromResponse_intoVar>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_Leshan_getClientFromResponse_intoVar := "IOT App Leshan: getClientFromResponse_intoVar";
+
+  //////////////////////
   //  FSM_RegDereg
+  //////////////////////
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_FSM_RegDereg_initResourceValues
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that inits the resources of the RegDereg FSM
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_FSM_RegDereg_initResourceValues>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_FSM_RegDereg_initResourceValues := "IOT Fsm LWM2M_RegDereg: initResourceValues";
+
+  //////////////////////
   // FSM SimDevice
+  //////////////////////
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_FSM_SimDevice_createResources
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that creates the resources of the SimDevice FSM
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_FSM_SimDevice_createResources>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_FSM_SimDevice_createResources := "IOT Fsm LWM2M_SimDevice: createResources";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_FSM_SimDevice_initResourceValues
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that inits the resources of the SimDevice FSM
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_FSM_SimDevice_initResourceValues>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_FSM_SimDevice_initResourceValues := "IOT Fsm LWM2M_SimDevice: initResourceValues";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_FSM_SimDevice_initTransport_boolVar
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that inits the transport (UDP, or DTLS-PSK) for the SimDev FSM's LwM2M protocol
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_FSM_SimDevice_initTransport_boolVar>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_FSM_SimDevice_initTransport_boolVar := "IOT Fsm LWM2M_SimDevice: initTransport_boolVar";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_FSM_SimDevice_updateResourceValues
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that updates the resource values of the SimDevice FSM
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_FSM_SimDevice_updateResourceValues>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_FSM_SimDevice_updateResourceValues := "IOT Fsm LWM2M_SimDevice: updateResourceValues";
+
+  ///////////////////////////////////////////////////////////
+  //  const: c_IOT_stepName_FSM_SimDevice_handleExecute
+  //
+  //  Purpose:
+  //    Charstring constant for the test step that handles LwM2M EXECUTE requests on the SimDevice FSM
+  //
+  //  Related Function:
+  //    - <f_IOT_LGen_step_FSM_SimDevice_handleExecute>
+  ///////////////////////////////////////////////////////////
   const charstring c_IOT_stepName_FSM_SimDevice_handleExecute := "IOT Fsm LWM2M_SimDevice: handleExecute";
 
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_declareSteps
+  //
+  //  Purpose:
+  //    Function to declare all the RIoT application related test steps
+  //
+  //  Related Types:
+  //    <IOT_LGen_CT>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_declareSteps()
   runs on IOT_LGen_CT
   {
@@ -99,9 +444,18 @@
     // Common
     f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_tcFinished_withVerdict, refers(f_IOT_LGen_step_tcFinished_withVerdict)});
     f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_print_stringParam, refers(f_IOT_LGen_step_print_stringParam)});
-	f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_genRndValue_varParams, refers(f_IOT_LGen_step_genRndValue_varParams)});
+    f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_genRndValue_varParams, refers(f_IOT_LGen_step_genRndValue_varParams)});
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_getEntityIdxinEntityGroup
+  //
+  //  Purpose:
+  //    Calculates the index of the entity inside its entity group
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step parameters
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_getEntityIdxinEntityGroup(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   return integer
@@ -124,12 +478,30 @@
     return vl_eRelIdxInEGrp;
   }
   
-  // 1st param: localHost: charstring
-  // 2nd param: localPort: integer
-  // 3rd param: offset: integer
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_COAP_setLocalAddress_byVars
+  //
+  //  Purpose:
+  //    Test step to set the local address in the COAP entity context <COAP_EntityCtx>. Parameters are required.
+  //    The function will take the base port number from the parameters and adds the entity's offset
+  //    inside its entity group (or in case the 3rd parameter is present, then the value found there)
+  //    to get its assigned port number.
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.varNames[0] - *charstring variable* - local host
+  //    contextArgs.varNames[1] - *integer variable* - local port
+  //    contextArgs.varNames[2] - *integer variable* - offset [optional]
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_COAP_setLocalAddress_byVars>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_COAP_setLocalAddress_byVars(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
+    // 1st param: localHost: charstring
+    // 2nd param: localPort: integer
+    // 3rd param: offset: integer
     f_EPTF_COAP_Logging_DEBUG(log2str(%definitionId, pl_ptr));
 
     if (not f_EPTF_COAP_setStepCtx(pl_ptr, v_COAP_ctx)) { return; }
@@ -185,12 +557,30 @@
     }
   }
   
-  // 1st param: localHost: charstring
-  // 2nd param: localPort: integer
-  // 3rd param: offset: integer
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_MQTT_setLocalAddress_byVars
+  //
+  //  Purpose:
+  //    Test step to set the local address in the MQTT entity context. Parameters are required.
+  //    The function will take the base port number from the parameters and adds the entity's offset
+  //    inside its entity group (or in case the 3rd parameter is present, then the value found there)
+  //    to get its assigned port number.
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.varNames[0] - *charstring variable* - local host
+  //    contextArgs.varNames[1] - *integer variable* - local port
+  //    contextArgs.varNames[2] - *integer variable* - offset [optional]
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_MQTT_setLocalAddress_byVars>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_MQTT_setLocalAddress_byVars(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
+    // 1st param: localHost: charstring
+    // 2nd param: localPort: integer
+    // 3rd param: offset: integer
     f_EPTF_MQTT_Logging_DEBUG(log2str(%definitionId, pl_ptr));
     
     if (not f_EPTF_MQTT_setStepCtx(pl_ptr, v_MQTT_ctx)) { return; }
@@ -242,7 +632,22 @@
       f_EPTF_MQTT_Logging_WARNING(log2str(%definitionId, " at least two variables are needed as params!"));
     }
   }
-  
+
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_MQTT_setClientId_stringParam
+  //
+  //  Purpose:
+  //    Test step to set the client id the MQTT entity context. Parameters are required.
+  //    The function will take the entity's offset inside its entity group and concatenate it
+  //    to the string parameter of the test step
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.charstringVal - *charstring* - base client id
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_MQTT_setClientId_stringParam>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_MQTT_setClientId_stringParam(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -257,6 +662,24 @@
     v_MQTT_sessionDB.data[v_MQTT_ctx.sessionIdx].clientId := vl_clientId & int2str(vl_eRelIdxInEGrp);
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_LwM2M_setClientNameInRegister
+  //
+  //  Purpose:
+  //    Test step to set the endpoint client name in the LWM2M Register message
+  //    that must be previously loaded into *v_LwM2M_msgToSend*. The test step
+  //    currently hard codes the base name to "eantwuhDev_" and concatenates the entity's index
+  //    inside its entity group
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_LwM2M_setClientNameInRegister>
+  //
+  //  Related test steps:
+  //    - <f_COAP_step_loadTemplate_byStringId>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_LwM2M_setClientNameInRegister(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -267,6 +690,25 @@
     v_LwM2M_msgToSend.pdu.Register.endpointClientName := "eantwuhDev_" & int2str(vl_eRelIdxInEGrp);
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_LwM2M_setClientNameInRegister_stringVar
+  //
+  //  Purpose:
+  //    Test step to set the endpoint client name in the LWM2M Register message
+  //    that must be previously loaded into *v_LwM2M_msgToSend*. The test step
+  //    expects the base name to be passed as a string parameter and concatenates the entity's index
+  //    inside its entity group
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.varNames[0] - *charstring variable* - base name
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_LwM2M_setClientNameInRegister_stringVar>
+  //
+  //  Related test steps:
+  //    - <f_COAP_step_loadTemplate_byStringId>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_LwM2M_setClientNameInRegister_stringVar(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -289,10 +731,23 @@
       v_LwM2M_msgToSend.pdu.Register.endpointClientName := vl_endpoint.charstringVal & int2str(vl_eRelIdxInEGrp);
     }
     else {
-      f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " one variable (useDTLS) is needed as parameter!"));
+      f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " one variable (base name) is needed as parameter!"));
     }
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_HTTP_initEntityContext
+  //
+  //  Purpose:
+  //    Test step to initialize the HTTP entity context by calling
+  //    <f_EPTF_HTTP_setEntityContext>.
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_HTTP_initEntityContext>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_HTTP_initEntityContext(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -304,15 +759,31 @@
       pl_connId := -1, //v_HTTP_portGroupConnectionHandle,
       pl_authDetails := -,    
       pl_body := { charVal := "" });
-  }  
+  }
 
-  // 1st param: localHost: charstring
-  // 2nd param: localPort: integer
-  // 3rd param: remoteHost: charstring
-  // 4th param: remotePort: integer
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_HTTP_openConnection_byVars
+  //
+  //  Purpose:
+  //    Test step to open a TCP connection for HTTP. Requires parameters
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.varNames[0] - *charstring variable* - local host
+  //    contextArgs.varNames[1] - *integer variable* - local port
+  //    contextArgs.varNames[2] - *charstring variable* - remote host
+  //    contextArgs.varNames[3] - *integer variable* - remote port
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_HTTP_openConnection_byVars>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_HTTP_openConnection_byVars(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
+    // 1st param: localHost: charstring
+    // 2nd param: localPort: integer
+    // 3rd param: remoteHost: charstring
+    // 4th param: remotePort: integer
     f_EPTF_COAP_Logging_DEBUG(log2str(%definitionId, pl_ptr));
     
     var integer vl_eRelIdxInEGrp := f_IOT_LGen_getEntityIdxinEntityGroup(pl_ptr);
@@ -371,7 +842,18 @@
     }
   }
   
-  
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_HTTP_closeConnection
+  //
+  //  Purpose:
+  //    Test step to close an already opened TCP connection for HTTP
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_HTTP_closeConnection>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_HTTP_closeConnection(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -382,6 +864,20 @@
     f_EPTF_HTTP_LocalTransport_deletePort(vl_portGroupId);
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_HTTP_setUri_stringParam
+  //
+  //  Purpose:
+  //    Test step to set a string - specified as a parameter - to the HTTP request URI
+  //    of the message to be sent
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.charstringVal - *charstring* - URI to be set
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_HTTP_setUri_stringParam>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_HTTP_setUri_stringParam(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -389,6 +885,20 @@
     f_EPTF_HTTP_setEntityContextURI(pl_ptr.eIdx, vl_param);
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_HTTP_addToUri_stringParam
+  //
+  //  Purpose:
+  //    Test step to add a string - specified as a parameter - to the HTTP request URI
+  //    of the message to be sent
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.charstringVal - *charstring* - URI part to be concatenated
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_HTTP_addToUri_stringParam>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_HTTP_addToUri_stringParam(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -397,6 +907,20 @@
     f_EPTF_HTTP_setEntityContextURI(pl_ptr.eIdx, vl_uri & vl_param);
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_HTTP_addToUri_byVars
+  //
+  //  Purpose:
+  //    Test step to add a string - specified as variadic parameter - to the HTTP request URI
+  //    of the message to be sent
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.varNames[*] - *charstring variable* - string to be added
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_HTTP_addToUri_stringParam>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_HTTP_addToUri_byVars(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   { 
@@ -418,6 +942,20 @@
     f_EPTF_HTTP_setEntityContextURI(pl_ptr.eIdx, vl_uri & vl_vars);
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_HTTP_setMethod_stringParam
+  //
+  //  Purpose:
+  //    Test step to set the method - specified as a string parameter - of the 
+  //    HTTP request to be sent
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.charstringVal - *charstring* - method to be set
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_HTTP_setMethod_stringParam>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_HTTP_setMethod_stringParam(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -425,11 +963,26 @@
     f_EPTF_HTTP_setEntityContextMethod(pl_ptr.eIdx, vl_param);
   }
   
-  // 1st param: remoteHost: charstring
-  // 2nd param: remotePort: integer
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_HTTP_addHostHeader_byVars
+  //
+  //  Purpose:
+  //    Test step to add a Host header to the HTTP messager to be sent. Requires parameters.
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.varNames[0] - *charstring variable* - host name
+  //    contextArgs.varNames[1] - *integer variable* - port name
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_HTTP_addHostHeader_byVars>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_HTTP_addHostHeader_byVars(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
+    // 1st param: remoteHost: charstring
+    // 2nd param: remotePort: integer
+
     //f_EPTF_HTTP_setEntityContextMethod(pl_ptr.eIdx, vl_param);
     
     var EPTF_IntegerList vl_varIds := {};
@@ -461,6 +1014,20 @@
     }
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_Leshan_getClientFromResponse_intoVar
+  //
+  //  Purpose:
+  //    Test step to fetch the client name of an HTTP response sent by Leshan
+  //    into a variable
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.varNames[0] - *charstring variable* - client name will be loaded here
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_Leshan_getClientFromResponse_intoVar>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_Leshan_getClientFromResponse_intoVar(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -546,6 +1113,19 @@
     }
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_tcFinished_withVerdict
+  //
+  //  Purpose:
+  //    Test step to set the final verdict reported by the FSM using a verdict variable as parameter.
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.verdict - *verdicttype* - verdict to be reported
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_tcFinished_withVerdict>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_tcFinished_withVerdict(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -593,17 +1173,42 @@
       f_EPTF_LGenBase_step_trafficError(pl_ptr);
     }
   }
-  
+ 
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_print_stringParam
+  //
+  //  Purpose:
+  //    Test step to print a string parameter as a TTCN-3 action() statement
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.charstringVal - *charstring* - the string to be printed
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_print_stringParam>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_print_stringParam(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
     f_EPTF_MQTT_Logging_DEBUG(log2str(%definitionId));
     
-	var charstring vl_toPrint := f_EPTF_LGenBase_charstringValOfStep(pl_ptr);
+    var charstring vl_toPrint := f_EPTF_LGenBase_charstringValOfStep(pl_ptr);
 	
     action(vl_toPrint);
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_FSM_RegDereg_initResourceValues
+  //
+  //  Purpose:
+  //    Test step to init resources of the RegDereg FSM
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_FSM_RegDereg_initResourceValues>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_FSM_RegDereg_initResourceValues(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -620,11 +1225,37 @@
     }
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_FSM_SimDevice_createResources
+  //
+  //  Purpose:
+  //    Test step to create resources of the SimDevice FSM
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_FSM_SimDevice_createResources>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_FSM_SimDevice_createResources(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_FSM_SimDevice_initTransport_boolVar
+  //
+  //  Purpose:
+  //    Test step to initialize the COAP transport (either UDP, or DTLS-PSK)
+  //    of the SimDevice FSM. Requires parameter.
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.varNames[0] - *boolean variable* - will use DTLS-PSK when true, UDP otherwise
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_FSM_SimDevice_initTransport_boolVar>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_FSM_SimDevice_initTransport_boolVar(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -681,6 +1312,18 @@
     }
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_FSM_SimDevice_initResourceValues
+  //
+  //  Purpose:
+  //    Test step to init the resource values of the SimDevice FSM
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_FSM_SimDevice_initResourceValues>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_FSM_SimDevice_initResourceValues(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -767,6 +1410,18 @@
     }
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_FSM_SimDevice_updateResourceValues
+  //
+  //  Purpose:
+  //    Test step to update the resource values of the SimDevice FSM
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_FSM_SimDevice_updateResourceValues>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_FSM_SimDevice_updateResourceValues(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -869,6 +1524,19 @@
     }
   }
   
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_FSM_SimDevice_handleExecute
+  //
+  //  Purpose:
+  //    Test step to handle incoming LwM2M EXECUTE request in
+  //    the SimDevice FSM
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_FSM_SimDevice_handleExecute>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_FSM_SimDevice_handleExecute(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
@@ -905,41 +1573,35 @@
 	      }
 	    }  	    
 	    vf_EPTF_LwM2M_Transport_send.apply(v_LwM2M_msgToSend);
-	    
-	    /*
-	    // Execute on Reset of DropDetector
-	    if (v_res.objId == 3400 and v_res.objInstId == 2)
-	    {
-	      f_LwM2M_ObjectDB_getResource(
-            p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects, 
-            p_objId := 3400, p_objInstId := 0, p_resourceId := 1,
-            p_resource := v_res
-          );
-      
-          v_res.val.boolValue := false;
-          if (ispresent(v_res.observe)) { v_res.observe.observe := v_res.observe.observe + 1 }
-      
-          f_LwM2M_ObjectDB_setResource(
-            p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects, 
-            p_objId := 3400, p_objInstId := 0, p_resourceId := 1,
-            p_resource := v_res
-          );
-      
-          f_EPTF_LwM2M_sendNotificationForResource(pl_ptr, v_res);
-	    }
-		*/
 	  }
 	  else { f_EPTF_LwM2M_Logging_DEBUG(log2str(%definitionId, " Only resource can be executed, ignoring request")); }
 	}
 	else { f_EPTF_LwM2M_Logging_DEBUG(log2str(%definitionId, " not execute pdu, or no device available, returning")); }
   }
   
-  // 1st param: min value (in): integer
-  // 2nd param: max value (in): integer
-  // 3rd param: rnd value (out): integer
+  ///////////////////////////////////////////////////////////
+  //  Function: f_IOT_LGen_step_genRndValue_varParams
+  //
+  //  Purpose:
+  //    Test step to generate a random number and load it into an integer variable.
+  //    The generated random number will be between two integers provided as parameters
+  //    to set the limits for RNG.
+  //
+  //  Parameters:
+  //    pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+  //    contextArgs.varNames[0] - *in integer variable* - min value
+  //    contextArgs.varNames[1] - *in integer variable* - max value
+  //    contextArgs.varNames[2] - *out integer variable* - generated value
+  //
+  //  Related Constants:
+  //    - <c_IOT_stepName_FSM_SimDevice_genRndValue_varParams>
+  ///////////////////////////////////////////////////////////
   function f_IOT_LGen_step_genRndValue_varParams(in EPTF_LGenBase_TestStepArgs pl_ptr)
   runs on IOT_LGen_CT
   {
+    // 1st param: min value (in): integer
+    // 2nd param: max value (in): integer
+    // 3rd param: rnd value (out): integer
     f_EPTF_COAP_Logging_DEBUG(log2str(%definitionId, pl_ptr));
     
     var EPTF_IntegerList vl_varIds := {};
@@ -970,60 +1632,6 @@
       f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " at least three variables are needed as params!"));
     }
   }
-  
-  /*
-  // Deprecated
-  
-  function f_IOT_App_step_tcFinished(in EPTF_LGenBase_TestStepArgs pl_ptr)
-  runs on IOT_LGen_CT
-  {
-    f_COAP_step_cleanUp(pl_ptr);      
-    f_LwM2M_step_cleanupDevice(pl_ptr);
-
-    if(pl_ptr.refContext.fRefArgs[0]==c_FSM_pass)
-    {
-      action("=> pass");
-      f_EPTF_LGenBase_step_trafficSuccess(pl_ptr);
-    }
-    else if(pl_ptr.refContext.fRefArgs[0]==c_FSM_fail)
-    {
-      action("=> fail");
-      f_EPTF_LGenBase_step_trafficFailed(pl_ptr);
-    }
-    else//c_FSM_timeout
-    {
-      action("=> timeout");
-      f_EPTF_LGenBase_step_trafficTimeout(pl_ptr);
-    }
-  }
-
-  function f_IOT_App_step_setLocalAddress(in EPTF_LGenBase_TestStepArgs pl_ptr)
-  runs on IOT_LGen_CT
-  {
-    if (not f_EPTF_COAP_setStepCtx(pl_ptr, v_COAP_ctx)) { return; }
-
-    if (v_COAP_EntityCtxDB.data[v_COAP_ctx.eCtxIdx].localAddressIdx == -1)
-    {
-      var integer vl_localPort := -1;
-
-      if (sizeof(pl_ptr.refContext.fRefArgs)>0)
-      {
-        vl_localPort := pl_ptr.refContext.fRefArgs[0];
-      }
-      else
-      {
-        vl_localPort := tsp_localPort+v_COAP_ctx.eIdx+1;
-      }
-
-      if (vl_localPort < 65535)
-      {
-        f_EPTF_COAP_addressDB_add({tsp_remoteHost, vl_localPort}, v_COAP_EntityCtxDB.data[v_COAP_ctx.eCtxIdx].localAddressIdx);
-      }
-      else
-      {
-        v_COAP_EntityCtxDB.data[v_COAP_ctx.eCtxIdx].localAddressIdx := v_IOT_LGen_localAddressIdx;
-      }
-    }
-  }
-  */
 }
+
+  //    contextArgs.varNames[0] - *in variable* - min value