Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreantwuh2018-05-15 04:59:18 -0400
committereantwuh2018-05-15 04:59:18 -0400
commit217ff8dbe96f6e7e1acdaab6fe680cbff4a032a9 (patch)
tree42792c9d282fc03185781da36acbbf2c0d94f27e
parent9258b423a95369925bb4510eb49bdbf1b216d49c (diff)
downloadtitan.ApplicationLibraries.CoAP-217ff8dbe96f6e7e1acdaab6fe680cbff4a032a9.tar.gz
titan.ApplicationLibraries.CoAP-217ff8dbe96f6e7e1acdaab6fe680cbff4a032a9.tar.xz
titan.ApplicationLibraries.CoAP-217ff8dbe96f6e7e1acdaab6fe680cbff4a032a9.zip
Naturaldocs API documentation added
Signed-off-by: eantwuh <antal.wu-hen-chang@ericsson.com>
-rw-r--r--src/EPTF_COAP_LGen_Definitions.ttcn1950
-rw-r--r--src/EPTF_COAP_LGen_Functions.ttcn1855
-rw-r--r--src/EPTF_COAP_LocalTransport_Definitions.ttcn334
-rw-r--r--src/EPTF_COAP_LocalTransport_Functions.ttcn503
-rw-r--r--src/EPTF_COAP_Transport_Definitions.ttcn221
-rw-r--r--test/EPTF_COAP_Tests.ttcn646
6 files changed, 5086 insertions, 423 deletions
diff --git a/src/EPTF_COAP_LGen_Definitions.ttcn b/src/EPTF_COAP_LGen_Definitions.ttcn
index 1b53bae..055eaf1 100644
--- a/src/EPTF_COAP_LGen_Definitions.ttcn
+++ b/src/EPTF_COAP_LGen_Definitions.ttcn
@@ -14,6 +14,79 @@
// Updated: 2017-09-01
// Contact: http://ttcn.ericsson.se
///////////////////////////////////////////////////////////////////////////////
+
+
+///////////////////////////////////////////////////////////
+// Module: EPTF_COAP_LGen_Definitions
+//
+// Purpose:
+// This module contains the definitions for the COAP load generator component
+//
+// Module depends on:
+// - <EPTF_COAP_Transport_Definitions>
+// - <EPTF_CLL_LGenBase_Definitions>
+// - <EPTF_CLL_Logging_Definitions>
+// - <EPTF_CLL_FBQ_Definitions>
+// - <Socket_API_Definitions>
+// - <CoAP_Types>
+//
+// Module Parameters:
+// tsp_EPTF_COAP_LGen_debug - <tsp_EPTF_COAP_LGen_debug> - *boolean* - Enabled/disable debug logging
+// tsp_EPTF_COAP_LGen_debugVerbose - <tsp_EPTF_COAP_LGen_debugVerbose> - *boolean* - Enabled/disable verbose debug logging
+// tsp_EPTF_COAP_LGen_templates - <tsp_EPTF_COAP_LGen_templates> - <CoAP_Template_List> - COAP template definitions for sending
+// tsp_EPTF_COAP_LGen_psks - <tsp_EPTF_COAP_LGen_psks> - <COAP_PSK_Params_List> - List of Pre-shared keys (PSK)
+// tsp_EPTF_COAP_maxToken - <tsp_EPTF_COAP_maxToken> - *integer* - Maximum value used for token generation
+// tsp_EPTF_COAP_NON_LIFETIME - <tsp_EPTF_COAP_NON_LIFETIME> - *float* - Maximum lifetime of a NON transaction in seconds
+// tsp_EPTF_COAP_EXCHANGE_LIFETIME - <tsp_EPTF_COAP_EXCHANGE_LIFETIME> - *float* - Maximum lifetime of a COAP transaction in seconds
+//
+// Events:
+// COAP Empty message - <c_COAP_eventIdx_EMPTY>, <c_COAP_eventName_EMPTY>
+// COAP GET request - <c_COAP_eventIdx_GET>, <c_COAP_eventIdx_GET>
+// COAP POST request - <c_COAP_eventIdx_POST>, <c_COAP_eventName_POST>
+// COAP PUT request - <c_COAP_eventIdx_PUT>, <c_COAP_eventName_PUT>
+// COAP DELETE request - <c_COAP_eventIdx_DELETE>, <c_COAP_eventName_DELETE>
+// COAP OBSERVE request - <c_COAP_eventIdx_OBSERVE>, <c_COAP_eventName_OBSERVE>
+// COAP 1xx response - <c_COAP_eventIdx_1xx>, <c_COAP_eventName_1xx>
+// COAP 2xx response- <c_COAP_eventIdx_2xx>, <c_COAP_eventName_2xx>
+// COAP 3xx response - <c_COAP_eventIdx_3xx>, <c_COAP_eventName_3xx>
+// COAP 4xx response - <c_COAP_eventIdx_4xx>, <c_COAP_eventName_4xx>
+// COAP 5xx response - <c_COAP_eventIdx_5xx>, <c_COAP_eventName_5xx>
+// COAP 6xx response - <c_COAP_eventIdx_6xx>, <c_COAP_eventName_6xx>
+// COAP 3xxto6xx response - <c_COAP_eventIdx_3xxto6xx>, <c_COAP_eventName_3xxto6xx>
+// COAP transport succesful response - <c_COAP_eventIdx_transportSucc>, <c_COAP_eventName_transportSucc>
+// COAP transport failure response - <c_COAP_eventIdx_transportFail>, <c_COAP_eventName_transportFail>
+// COAP transaction reset indication - <c_COAP_eventIdx_trRST>, <c_COAP_eventName_trRST>
+// COAP transaction timed out indication - <c_COAP_eventIdx_trTimeout>, <c_COAP_eventName_trTimeout>
+// COAP observation canceled indication - <c_COAP_eventIdx_observeCanceled>, <c_COAP_eventName_observeCanceled>
+// COAP resource not observed any more indication - <c_COAP_eventIdx_resourceNotObservedIndication>, <c_COAP_eventName_resourceNotObservedIndication>
+// COAP DTLS connection closed indication - <c_COAP_eventIdx_dtlsConnectionClosed>, <c_COAP_eventName_dtlsConnectionClosed>
+//
+// TestSteps:
+// COAP init - <f_COAP_step_init>, <c_COAP_stepIdx_init>, <c_COAP_stepName_init>
+// COAP cleanUp - <f_COAP_step_cleanUp>, <c_COAP_stepIdx_init>, <c_COAP_stepIdx_init>
+// COAP set local address - <f_COAP_step_setLocalAddress>, <c_COAP_stepIdx_setLocalAddress>, <c_COAP_stepName_setLocalAddress>
+// COAP set remote address - <f_COAP_step_setRemoteAddress_byIntIdx>, <c_COAP_stepIdx_setRemoteAddress_byIntIdx>, <c_COAP_stepName_setRemoteAddress_byIntIdx>
+// <f_COAP_step_setRemoteAddress_byVars>, <c_COAP_stepIdx_setRemoteAddress_byVars>, <c_COAP_stepName_setRemoteAddress_byVars>
+// COAP send - <f_COAP_step_send>, <c_COAP_stepIdx_send>, <c_COAP_stepName_send>
+// COAP load template - <f_COAP_step_loadTemplate_byIntIdx>, <c_COAP_stepIdx_loadTemplate_byIntIdx>, <c_COAP_stepName_loadTemplate_byIntIdx>
+// <f_COAP_step_loadTemplate_byStringId>, <c_COAP_stepIdx_loadTemplate_byStringId>, <c_COAP_stepName_loadTemplate_byStringId>
+// COAP handle request - <f_COAP_step_handleRequest>, <c_COAP_stepIdx_handleRequest>, <c_COAP_stepName_handleRequest>
+// COAP send response - <f_COAP_step_sendResponse>, <c_COAP_stepIdx_sendResponse>, <c_COAP_stepName_sendResponse>
+// COAP send accept - <f_COAP_step_sendAccept>, <c_COAP_stepIdx_sendAccept>, <c_COAP_stepName_sendAccept>
+// COAP start listening - <f_COAP_step_startListening>, <c_COAP_stepIdx_startListening>, <c_COAP_stepName_startListening>
+// COAP report COAP event for entity enable/disable - <f_COAP_step_reportCoapEventForEntity>, <c_COAP_stepIdx_reportCoapEventForEntity>, <c_COAP_stepName_reportCoapEventForEntity>
+// COAP send notification - <f_COAP_step_sendNotification_byIntIdx>, <c_COAP_stepIdx_sendNotification_byIntIdx>, <c_COAP_stepName_sendNotification_byIntIdx>
+// <f_COAP_step_sendNotification_byStringId>, <c_COAP_stepIdx_sendNotification_byStringId>, <c_COAP_stepName_sendNotification_byStringId>
+// COAP remove resource observations - <f_COAP_step_removeResourceObservations_byIntIdx>, <c_COAP_stepIdx_removeResourceObservations_byIntIdx>, <c_COAP_stepName_removeResourceObservations_byIntIdx>
+// <f_COAP_step_removeResourceObservations_byStringId>, <c_COAP_stepIdx_removeResourceObservations_byStringId>, <c_COAP_stepName_removeResourceObservations_byStringId>
+// COAP start DTLS - <f_COAP_step_startDTLS>, <c_COAP_stepIdx_startDTLS>, <c_COAP_stepName_startDTLS>
+// <f_COAP_step_startDTLS_byVarIds>, <c_COAP_stepIdx_startDTLS_byVarIds>, <c_COAP_stepName_startDTLS_byVarIds>
+// <f_COAP_step_startDTLS_byIntIdx>, <c_COAP_stepIdx_startDTLS_byIntIdx>, <c_COAP_stepName_startDTLS_byIntIdx>
+//
+// Class Diagram:
+// (see EPTF_COAP_LGen_Definitions.classes.jpg)
+//
+///////////////////////////////////////////////////////////////
module EPTF_COAP_LGen_Definitions
{
import from EPTF_COAP_Transport_Definitions all;
@@ -23,22 +96,413 @@ module EPTF_COAP_LGen_Definitions
import from Socket_API_Definitions all;
import from CoAP_Types all;
+ ///////////////////////////////////////////////////////////
+ // Module parameter: tsp_EPTF_COAP_LGen_debug
+ //
+ // Purpose:
+ // Enabled/disable debug logging
+ //
+ // Type:
+ // *boolean*
+ //
+ // Default value:
+ // *false*
+ ///////////////////////////////////////////////////////////
modulepar boolean tsp_EPTF_COAP_LGen_debug := false;
+
+ ///////////////////////////////////////////////////////////
+ // Module parameter: tsp_EPTF_COAP_LGen_debugVerbose
+ //
+ // Purpose:
+ // Enabled/disable verbose debug logging
+ //
+ // Type:
+ // *boolean*
+ //
+ // Default value:
+ // *false*
+ ///////////////////////////////////////////////////////////
modulepar boolean tsp_EPTF_COAP_LGen_debugVerbose := false;
+
modulepar integer tsp_EPTF_COAP_LGen_maxBindableCtx := -1;
- modulepar CoAP_Template_List tsp_EPTF_COAP_LGen_templates := {};
+ ///////////////////////////////////////////////////////////
+ // Module parameter: tsp_EPTF_COAP_LGen_templates
+ //
+ // Purpose:
+ // List of Pre-shared keys (PSK)
+ //
+ // Type:
+ // <CoAP_Template_List>
+ //
+ // Default value:
+ // Empty list: {}
+ ///////////////////////////////////////////////////////////
+ modulepar CoAP_Template_List tsp_EPTF_COAP_LGen_templates := {};
+
+ ///////////////////////////////////////////////////////////
+ // Module parameter: tsp_EPTF_COAP_LGen_psks
+ //
+ // Purpose:
+ // COAP template definitions for sending
+ //
+ // Type:
+ // <COAP_PSK_Params_List>
+ //
+ // Default value:
+ // Empty list: {}
+ ///////////////////////////////////////////////////////////
modulepar COAP_PSK_Params_List tsp_EPTF_COAP_LGen_psks := {};
+ ///////////////////////////////////////////////////////////
+ // Module parameter: tsp_EPTF_COAP_maxToken
+ //
+ // Purpose:
+ // Maximum value used for token generation
+ //
+ // Type:
+ // *integer*
+ //
+ // Default value:
+ // *65535*
+ ///////////////////////////////////////////////////////////
+ modulepar integer tsp_EPTF_COAP_maxToken := 65535;
+
+ ///////////////////////////////////////////////////////////
+ // Module parameter: tsp_EPTF_COAP_NON_LIFETIME
+ //
+ // Purpose:
+ // Maximum lifetime of a NON transaction in seconds
+ //
+ // Type:
+ // *float*
+ //
+ // Default value:
+ // *145.0*
+ ///////////////////////////////////////////////////////////
+ modulepar float tsp_EPTF_COAP_NON_LIFETIME := 145.0;
+
+ ///////////////////////////////////////////////////////////
+ // Module parameter: tsp_EPTF_COAP_EXCHANGE_LIFETIME
+ //
+ // Purpose:
+ // Maximum lifetime of a COAP transaction in seconds
+ //
+ // Type:
+ // *float*
+ //
+ // Default value:
+ // *247.0*
+ ///////////////////////////////////////////////////////////
+ modulepar float tsp_EPTF_COAP_EXCHANGE_LIFETIME := 247.0;
+
const integer c_COAP_LGen_Logging_WARNING := 0;
const integer c_COAP_LGen_Logging_DEBUG := 1;
const integer c_COAP_LGen_Logging_DEBUGV := 2;
const integer c_COAP_LGen_Logging_ERROR := 3;
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_behaviorType
+ //
+ // Purpose:
+ // Constant for COAP behaviour name
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_behaviorType := "COAP Behavior";
type record of integer COAP_ObservedResourceIdx_List;
+
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.classes.jpg
+
+ class EPTF_COAP_LGen_CT {
+ boolean v_COAP_initialized
+ integer v_COAP_bIdx
+ integer v_COAP_loggingMaskId
+ COAP_EntityCtx_DB v_COAP_EntityCtxDB
+ COAP_FsmCtx_DB v_COAP_FsmCtxDB
+ COAP_TransportEndpointDB v_COAP_transportEndpointDB
+ COAP_Transaction_DB v_COAP_trDB
+ COAP_RR_DB v_COAP_rrDB
+ COAP_Template_DB v_COAP_templateDB
+ COAP_Observation_DB v_COAP_observationDB
+ COAP_ObservedResource_DB v_COAP_observedResourceDB
+ COAP_StepCtx v_COAP_ctx := c_COAP_StepCtx_empty;
+ COAP_TransportEndpoint v_COAP_transportEndpoint := c_COAP_TransportEndpoint_empty;
+ EPTF_COAP_PDU v_COAP_msgToProcess;
+ EPTF_COAP_PDU v_COAP_msgToSend;
+ fcb_EPTF_COAP_messageReceived vf_COAP_msgReceived
+ fcb_EPTF_COAP_eventIndication vf_COAP_eventIndication
+ f_EPTF_COAP_LGen_init(in charstring pl_name)
+ f_COAP_cleanUp()
+ f_COAP_eCtxBind(in integer pl_eIdx)
+ f_COAP_eCtxUnbind(in integer pl_eIdx)
+ f_COAP_eCtxReset(in integer pl_eIdx)
+ f_EPTF_COAP_LGen_receiveMessage(in EPTF_COAP_PDU pl_message)
+ f_EPTF_COAP_LGen_receiveEvent(in ASP_Event p_event)
+ f_EPTF_COAP_LGen_transportApiResponse(in EPTF_COAP_Transport_Response pl_rsp)
+ f_EPTF_COAP_stack_fromApp(inout EPTF_COAP_PDU p_msg, in COAP_StepCtx p_ctx)
+ f_EPTF_COAP_stack_fromEnv(inout EPTF_COAP_PDU p_msg)
+ f_EPTF_COAP_declareEvents()
+ f_EPTF_COAP_declareSteps()
+ f_EPTF_COAP_setStepCtx(in EPTF_LGenBase_TestStepArgs pl_ptr, inout COAP_StepCtx p_ctx)
+ f_EPTF_COAP_setCtx(in integer p_eIdx, in integer p_fsmIdx, inout COAP_StepCtx p_ctx)
+ f_EPTF_COAP_isFsmInitialized(in integer pl_eIdx, in integer pl_fsmIdx, inout integer pl_fsmCtxIdx)
+ f_EPTF_COAP_dispatchEventsForCode(in Code pl_code, in integer pl_eIdx, in integer pl_fsmCtx, in EPTF_IntegerList pl_reportedArgs)
+ f_EPTF_COAP_dispatchEvent(in integer pl_eventIdx, in integer pl_eIdx, in integer pl_fsmCtx, in EPTF_IntegerList pl_reportedArgs)
+ }
+ EPTF_COAP_LGen_CT "1" --> "1\n.v_COAP_EntityCtxDB" COAP_EntityCtx_DB
+ EPTF_COAP_LGen_CT "1" --> "1\n.v_COAP_FsmCtxDB" COAP_FsmCtx_DB
+ EPTF_COAP_LGen_CT "1" --> "1\n.v_COAP_transportEndpointDB" COAP_TransportEndpointDB
+ EPTF_COAP_LGen_CT "1" --> "1\n.v_COAP_trDB" COAP_Transaction_DB
+ EPTF_COAP_LGen_CT "1" --> "1\n.v_COAP_rrDB" COAP_RR_DB
+ EPTF_COAP_LGen_CT "1" --> "1\n.v_COAP_templateDB" COAP_Template_DB
+ EPTF_COAP_LGen_CT "1" --> "1\n.v_COAP_observationDB" COAP_Observation_DB
+ EPTF_COAP_LGen_CT "1" --> "1\n.v_COAP_observedResourceDB" COAP_ObservedResource_DB
+
+ class COAP_EntityCtx {
+ integer eIdx
+ integer localAddressIdx
+ integer nextMID
+ integer nextToken
+ boolean reportCoapEvent
+ COAP_ObservedResourceIdx_List observedResourceIndices
+ f_EPTF_COAP_getNextMID(in COAP_StepCtx p_ctx)
+ f_EPTF_COAP_getNextToken(in COAP_StepCtx p_ctx)
+ f_EPTF_COAP_EntityCtx_addObservation(in integer p_eCtxIdx, in EPTF_COAP_PDU p_msg)
+ f_EPTF_COAP_EntityCtx_removeObservation(in integer pl_eCtxIdx, in integer p_obsResIdx, in boolean p_lastObserver)
+ f_EPTF_COAP_EntityCtx_removeObservedResource(in integer pl_eCtxIdx, in integer p_obsResIdx)
+ f_EPTF_COAP_EntityCtx_cleanUp(in integer p_eCtxIdx)
+ }
+ COAP_EntityCtx "*" --> "1\n.localAddressIdx" COAP_TransportEndpoint
+ COAP_EntityCtx "1\n.eCtxIdx" --> "*\n.observedResourceIndices[]" COAP_ObservedResource
+
+ class COAP_EntityCtx_DB {
+ EPTF_FreeBusyQueue queue
+ COAP_EntityCtx_List data
+ integer hashRef
+ f_EPTF_COAP_EntityCtxDB_init()
+ f_EPTF_COAP_EntityCtxDB_cleanUp()
+
+ }
+ COAP_EntityCtx_DB "1" --> "*\n.data[]" COAP_EntityCtx
+
+ class COAP_FsmCtx {
+ integer eIdx
+ integer remoteAddressIdx
+ COAP_PSK_Params psk optional
+ integer rrIdx
+ }
+ COAP_FsmCtx "*" --> "1\n.remoteAddressIdx" COAP_TransportEndpoint
+ COAP_FsmCtx "1\n.fsmCtxIdx" <--> "1\n.rrIdx" COAP_RR
+
+ class COAP_FsmCtx_DB {
+ EPTF_FreeBusyQueue queue,
+ COAP_FsmCtx_List data,
+ integer hashRef
+ f_EPTF_COAP_FsmCtxDB_init()
+ f_EPTF_COAP_FsmCtxDB_cleanUp()
+ }
+ COAP_FsmCtx_DB "1" --> "*\n.data[]" COAP_FsmCtx
+
+ class COAP_Transaction {
+ integer mid
+ integer eIdx
+ integer addrIdx
+ integer rrIdx
+ integer obsIdx
+ integer retransmitTimer
+ float retransmitTimerValue
+ integer lifetimeTimer
+ EPTF_COAP_PDU cache optional
+ COAP_Transaction_State state
+ COAP_Transaction_Direction direction
+ f_EPTF_COAP_tr_fromRR(inout EPTF_COAP_PDU p_msg, in integer p_trIdx)
+ f_EPTF_COAP_tr_fromEnv(inout EPTF_COAP_PDU p_msg, in integer p_trIdx)
+ f_EPTF_COAP_tr_cancel(in integer p_trIdx)
+ f_EPTF_COAP_tr_lifetime(in EPTF_ScheduledAction pl_action, in integer pl_eventIndex)
+ f_EPTF_COAP_tr_retransmit(in EPTF_ScheduledAction pl_action, in integer pl_eventIndex)
+ f_EPTF_COAP_tr_startT_retransmit(in integer pl_trIdx)
+ f_EPTF_COAP_tr_cancelT_retransmit(in integer pl_trIdx)
+ f_EPTF_COAP_tr_startT_lifetime(in integer pl_trIdx, in float pl_time)
+ f_EPTF_COAP_tr_cancelT_lifetime(in integer pl_trIdx)
+ f_EPTF_COAP_tr_send(inout EPTF_COAP_PDU p_msg, in integer p_trIdx)
+ f_EPTF_COAP_tr_remove(in integer p_trIdx)
+ f_EPTF_COAP_tr_setState(in integer p_trIdx, in COAP_Transaction_State p_nextState)
+ }
+ COAP_Transaction "1\n.trIdx" <--> "1\n.rrIdx" COAP_RR
+ COAP_Transaction "*" --> "1\n.addrIdx" COAP_TransportEndpoint
+ COAP_Transaction "1\n.trIdx" <--> "0..1\n.obsIdx" COAP_Observation_Server
+
+ class COAP_Transaction_DB {
+ EPTF_FreeBusyQueue queue
+ COAP_Transaction_List data
+ integer hashRefOutgoing
+ integer hashRefIncoming
+ f_EPTF_COAP_trDB_init()
+ f_EPTF_COAP_trDB_add(in COAP_Transaction p_tr)
+ f_EPTF_COAP_trDB_lookUp(in Socket p_sock, in integer p_mid, COAP_Transaction_Direction p_dir)
+ f_EPTF_COAP_trDB_get(in integer p_idx, inout COAP_Transaction p_tr)
+ f_EPTF_COAP_trDB_remove(in integer p_idx)
+ f_EPTF_COAP_trDB_cleanUp()
+ }
+ COAP_Transaction_DB "1" --> "*\n.data[]" COAP_Transaction
+
+ class COAP_RR {
+ integer eIdx
+ integer fsmIdx
+ integer fsmCtxIdx
+ integer addrIdx
+ octetstring token
+ integer trIdx
+ Socket remoteAddress optional
+ ProtoTuple remoteProtocol optional
+ EPTF_COAP_PDU request optional
+ EPTF_COAP_PDU response optional
+ COAP_RR_State state
+ f_EPTF_COAP_rr_handleMsg(inout EPTF_COAP_PDU p_msg, in integer p_rrIdx)
+ f_EPTF_COAP_rr_reset(in integer p_rrIdx)
+ f_EPTF_COAP_rr_timeout(in integer p_rrIdx)
+ f_EPTF_COAP_rr_cancel(in integer p_rrIdx)
+ f_EPTF_COAP_rr_remove(in integer p_rrIdx)
+ f_EPTF_COAP_rr_setState(in integer p_rrIdx, in COAP_RR_State p_nextState)
+ }
+ COAP_RR "*" --> "1\n.addrIdx" COAP_TransportEndpoint
+
+ class COAP_RR_DB {
+ EPTF_FreeBusyQueue queue
+ COAP_RR_List data
+ integer hashRef
+ f_EPTF_COAP_rrDB_init()
+ f_EPTF_COAP_rrDB_add(in COAP_RR p_rr)
+ f_EPTF_COAP_rrDB_lookUp(in Socket p_sock, in octetstring p_token)
+ f_EPTF_COAP_rrDB_get(in integer p_idx, inout COAP_RR p_rr)
+ f_EPTF_COAP_rrDB_remove(in integer p_idx)
+ f_EPTF_COAP_rrDB_cleanUp()
+ f_EPTF_COAP_rrDB_tokenHash(in Socket p_sock, in octetstring p_token)
+ }
+ COAP_RR_DB "1" --> "*\n.data[]" COAP_RR
+
+ class COAP_TransportEndpoint {
+ Socket socket,
+ ProtoTuple proto
+ }
+
+ class COAP_TransportEndpointDB {
+ EPTF_FreeBusyQueue queue
+ COAP_TransportEndpoint_List data
+ integer hashRef
+ f_EPTF_COAP_transportEndpointDB_init()
+ f_EPTF_COAP_transportEndpointDB_add(in COAP_TransportEndpoint p_te, inout integer p_idx)
+ f_EPTF_COAP_transportEndpointDB_get(inout COAP_TransportEndpoint p_te, in integer p_idx)
+ f_EPTF_COAP_transportEndpointDB_lookUp(in COAP_TransportEndpoint p_te)
+ f_EPTF_COAP_transportEndpointDB_Socket2String(Socket p_sock)
+ f_EPTF_COAP_transportEndpointDB_cleanUp()
+ }
+ COAP_TransportEndpointDB "1" --> "*\n.data[]" COAP_TransportEndpoint
+
+ class COAP_ObservedResource {
+ charstring localAddress
+ integer localPort
+ charstring resourceId
+ UriPath_List uriPath
+ ObservationServerIdx_List observationServersIndices, // FIXME: Can be slow to update in case of larger nums
+ integer eCtxIdx
+ f_EPTF_COAP_ObservedResource_addObserver(in integer p_obsResIdx, in EPTF_COAP_PDU p_msg)
+ f_EPTF_COAP_ObservedResource_removeObserver(in integer p_obsResIdx, in integer p_obsIdx)
+ f_EPTF_COAP_ObservedResource_sendNotification(in integer p_obsResIdx, inout EPTF_COAP_PDU p_msg)
+ f_EPTF_COAP_ObservedResource_cleanUp(in integer p_obsResIdx)
+ }
+ COAP_ObservedResource "1\n.observedResourceIdx" <--> "1\n.observationServersIndices[]" COAP_Observation_Server
+
+ class COAP_ObservedResource_DB {
+ EPTF_FreeBusyQueue queue,
+ COAP_ObservedResource_List data,
+ integer hashRef
+ f_EPTF_COAP_observedResourceDB_init()
+ f_EPTF_COAP_observedResourceDB_add(in COAP_ObservedResource p_or)
+ f_EPTF_COAP_observedResourceDB_lookUp(in charstring p_localAddr, in integer p_localPort, in charstring p_resourceId)
+ f_EPTF_COAP_observedResourceDB_get(in integer p_idx, inout COAP_ObservedResource p_or)
+ f_EPTF_COAP_observedResourceDB_remove(in integer p_idx)
+ f_EPTF_COAP_observedResourceDB_cleanUp()
+ f_EPTF_COAP_observedResourceDB_tokenHash(in charstring p_localAddr, in integer p_localPort, in charstring p_resourceId)
+ }
+ COAP_ObservedResource_DB "1" --> "*\n.data[]" COAP_ObservedResource
+
+ class COAP_Observation_Server {
+ charstring remoteAddress,
+ integer remotePort,
+ ProtoTuple protocol,
+ charstring resourceId,
+ octetstring token,
+ integer seqNum,
+ boolean confirmable,
+ integer observedResourceIdx,
+ integer trIdx
+ f_EPTF_COAP_ObservationServer_sendNotification(in integer p_obsIdx, inout EPTF_COAP_PDU p_msg)
+ f_EPTF_COAP_ObservationServer_cancelReceivedFromEnv(in integer p_obsIdx)
+ }
+
+ class COAP_Observation_DB {
+ EPTF_FreeBusyQueue queue,
+ COAP_Observation_Server_List data,
+ integer hashRef
+ f_EPTF_COAP_observationDB_init()
+ f_EPTF_COAP_observationDB_add(in COAP_Observation_Server p_os)
+ f_EPTF_COAP_observationDB_lookUp(in charstring p_remoteAddr, in integer p_remotePort, in charstring p_resId)
+ f_EPTF_COAP_observationDB_get(in integer p_idx, inout COAP_Observation_Server p_os)
+ f_EPTF_COAP_observationDB_remove(in integer p_idx)
+ f_EPTF_COAP_observationDB_cleanUp()
+ f_EPTF_COAP_observationDB_tokenHash(in charstring p_remoteAddr, in integer p_remotePort, in charstring p_resId)
+ }
+ COAP_Observation_DB "1" --> "*\n.data[]" COAP_Observation_Server
+
+ @enduml
+ ******************************************************************/
+
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.COAP_EntityCtx.jpg
+ class COAP_EntityCtx {
+ integer eIdx
+ integer localAddressIdx
+ integer nextMID
+ integer nextToken
+ boolean reportCoapEvent
+ COAP_ObservedResourceIdx_List observedResourceIndices
+ f_EPTF_COAP_getNextMID(in COAP_StepCtx p_ctx)
+ f_EPTF_COAP_getNextToken(in COAP_StepCtx p_ctx)
+ f_EPTF_COAP_EntityCtx_addObservation(in integer p_eCtxIdx, in EPTF_COAP_PDU p_msg)
+ f_EPTF_COAP_EntityCtx_removeObservation(in integer pl_eCtxIdx, in integer p_obsResIdx, in boolean p_lastObserver)
+ f_EPTF_COAP_EntityCtx_removeObservedResource(in integer pl_eCtxIdx, in integer p_obsResIdx)
+ f_EPTF_COAP_EntityCtx_cleanUp(in integer p_eCtxIdx)
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_EntityCtx
+ //
+ // Purpose:
+ // A COAP entity is a simulated COAP device, this structures stores data for one simulated device.
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.COAP_EntityCtx.jpg)
+ //
+ // Elements:
+ // eIdx - *integer* - pointer to the entity itself
+ // localAddressIdx - *integer* - pointer to the local address in *v_COAP_transportEndpointDB*
+ // nextMID - *integer* - used for MID generation
+ // nextToken - *integer* - used for token generation
+ // reportCoapEvent - *boolean* - COAP events (e.g. COAP GET, COAP 200 will be reported for this entity), should be false when using LwM2M applib
+ // observedResourceIndices - <COAP_ObservedResourceIdx_List> - pointers to all observed resources in *v_COAP_observedResourceDB*
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_getNextMID> (in <COAP_StepCtx> p_ctx)
+ // - <f_EPTF_COAP_getNextToken> (in <COAP_StepCtx> p_ctx)
+ // - <f_EPTF_COAP_EntityCtx_addObservation> (in *integer* p_eCtxIdx, in <EPTF_COAP_PDU> p_msg)
+ // - <f_EPTF_COAP_EntityCtx_removeObservation> (in *integer* pl_eCtxIdx, in *integer* p_obsResIdx, in *boolean* p_lastObserver)
+ // - <f_EPTF_COAP_EntityCtx_removeObservedResource> (in *integer* pl_eCtxIdx, in *integer* p_obsResIdx)
+ // - <f_EPTF_COAP_EntityCtx_cleanUp> (in *integer* p_eCtxIdx)
+ ///////////////////////////////////////////////////////////
type record COAP_EntityCtx
{
integer eIdx,
@@ -59,8 +523,43 @@ module EPTF_COAP_LGen_Definitions
observedResourceIndices := {}
}
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_EntityCtx_List
+ //
+ // Purpose:
+ // List of <COAP_EntityCtx>
+ ///////////////////////////////////////////////////////////
type record of COAP_EntityCtx COAP_EntityCtx_List;
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.COAP_EntityCtx_DB.jpg
+ class COAP_EntityCtx_DB {
+ EPTF_FreeBusyQueue queue
+ COAP_EntityCtx_List data
+ integer hashRef
+ f_EPTF_COAP_EntityCtxDB_init()
+ f_EPTF_COAP_EntityCtxDB_cleanUp()
+
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_EntityCtx_DB
+ //
+ // Purpose:
+ // Storing COAP entity contexts
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.COAP_EntityCtx_DB.jpg)
+ //
+ // Elements:
+ // queue - <EPTF_FreeBusyQueue> - FBQ for the stored elements
+ // data - <COAP_EntityCtx_List> - elements
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_EntityCtxDB_init> ()
+ // - <f_EPTF_COAP_EntityCtxDB_cleanUp> ()
+ ///////////////////////////////////////////////////////////
type record COAP_EntityCtx_DB
{
EPTF_FreeBusyQueue queue,
@@ -68,6 +567,31 @@ module EPTF_COAP_LGen_Definitions
integer hashRef
}
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.COAP_FsmCtx.jpg
+ class COAP_FsmCtx {
+ integer eIdx
+ integer remoteAddressIdx
+ COAP_PSK_Params psk optional
+ integer rrIdx
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_FsmCtx
+ //
+ // Purpose:
+ // Storing COAP data for each FSM
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.COAP_FsmCtx.jpg)
+ //
+ // Elements:
+ // eIdx - *integer* - pointer to the entity itself
+ // remoteAddressIdx - *integer* - pointer to the remote address <COAP_TransportEndpoint> in *v_COAP_transportEndpointDB*
+ // psk - <COAP_PSK_Params> - Pre-shared key information for DTLS PSK
+ // rrIdx - *integer* - pointer to the request-response state machine <COAP_RR> in *v_COAP_rrDB*
+ ///////////////////////////////////////////////////////////
type record COAP_FsmCtx
{
integer eIdx,
@@ -75,13 +599,29 @@ module EPTF_COAP_LGen_Definitions
COAP_PSK_Params psk optional,
integer rrIdx
}
-
+
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_PSK_Params
+ //
+ // Purpose:
+ // Storing COAP data for each FSM
+ //
+ // Elements:
+ // identity - *charstring* - PSK identity
+ // key - *charstring* - PSK key
+ ///////////////////////////////////////////////////////////
type record COAP_PSK_Params
{
charstring identity,
charstring key
}
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_PSK_Params_List
+ //
+ // Purpose:
+ // List of <COAP_PSK_Params>
+ ///////////////////////////////////////////////////////////
type record of COAP_PSK_Params COAP_PSK_Params_List;
const COAP_FsmCtx c_COAP_FsmCtx_init :=
@@ -90,10 +630,44 @@ module EPTF_COAP_LGen_Definitions
remoteAddressIdx := -1,
psk := omit,
rrIdx := -1
- }
-
+ }
+
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_FsmCtx_List
+ //
+ // Purpose:
+ // List of <COAP_FsmCtx>
+ ///////////////////////////////////////////////////////////
type record of COAP_FsmCtx COAP_FsmCtx_List;
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.COAP_FsmCtx_DB.jpg
+ class COAP_FsmCtx_DB {
+ EPTF_FreeBusyQueue queue,
+ COAP_FsmCtx_List data,
+ integer hashRef
+ f_EPTF_COAP_FsmCtxDB_init()
+ f_EPTF_COAP_FsmCtxDB_cleanUp()
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_FsmCtx_DB
+ //
+ // Purpose:
+ // Storing COAP FSM contexts
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.COAP_FsmCtx_DB.jpg)
+ //
+ // Elements:
+ // queue - <EPTF_FreeBusyQueue> - FBQ for the stored elements
+ // data - <COAP_EntityCtx_List> - elements
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_FsmCtxDB_init> ()
+ // - <f_EPTF_COAP_FsmCtxDB_cleanUp> ()
+ ///////////////////////////////////////////////////////////
type record COAP_FsmCtx_DB
{
EPTF_FreeBusyQueue queue,
@@ -101,6 +675,18 @@ module EPTF_COAP_LGen_Definitions
integer hashRef
}
+ ///////////////////////////////////////////////////////////
+ // Enum: COAP_Transaction_State
+ //
+ // Purpose:
+ // States of a <COAP_Transaction> state machine
+ //
+ // Elements:
+ // - CLOSED
+ // - RELIABLE_TX
+ // - ACK_PENDING
+ // - REMOVING
+ ///////////////////////////////////////////////////////////
type enumerated COAP_Transaction_State
{
CLOSED,
@@ -109,12 +695,89 @@ module EPTF_COAP_LGen_Definitions
REMOVING
}
+ ///////////////////////////////////////////////////////////
+ // Enum: COAP_Transaction_Direction
+ //
+ // Purpose:
+ // Direction of a <COAP_Transaction>: either INCOMING or OUTGOING
+ //
+ // Elements:
+ // - OUTGOING
+ // - INCOMING
+ ///////////////////////////////////////////////////////////
type enumerated COAP_Transaction_Direction
{
OUTGOING,
INCOMING
}
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.COAP_Transaction.jpg
+ class COAP_Transaction {
+ integer mid
+ integer eIdx
+ integer addrIdx
+ integer rrIdx
+ integer obsIdx
+ integer retransmitTimer
+ float retransmitTimerValue
+ integer lifetimeTimer
+ EPTF_COAP_PDU cache optional
+ COAP_Transaction_State state
+ COAP_Transaction_Direction direction
+ f_EPTF_COAP_tr_fromRR(inout EPTF_COAP_PDU p_msg, in integer p_trIdx)
+ f_EPTF_COAP_tr_fromEnv(inout EPTF_COAP_PDU p_msg, in integer p_trIdx)
+ f_EPTF_COAP_tr_cancel(in integer p_trIdx)
+ f_EPTF_COAP_tr_lifetime(in EPTF_ScheduledAction pl_action, in integer pl_eventIndex)
+ f_EPTF_COAP_tr_retransmit(in EPTF_ScheduledAction pl_action, in integer pl_eventIndex)
+ f_EPTF_COAP_tr_startT_retransmit(in integer pl_trIdx)
+ f_EPTF_COAP_tr_cancelT_retransmit(in integer pl_trIdx)
+ f_EPTF_COAP_tr_startT_lifetime(in integer pl_trIdx, in float pl_time)
+ f_EPTF_COAP_tr_cancelT_lifetime(in integer pl_trIdx)
+ f_EPTF_COAP_tr_send(inout EPTF_COAP_PDU p_msg, in integer p_trIdx)
+ f_EPTF_COAP_tr_remove(in integer p_trIdx)
+ f_EPTF_COAP_tr_setState(in integer p_trIdx, in COAP_Transaction_State p_nextState)
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_Transaction
+ //
+ // Purpose:
+ // Implements a COAP transaction in a state machine
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.COAP_Transaction.jpg)
+ //
+ // Elements:
+ // mid - *integer* - message id of the transaction
+ // eIdx - *integer* - entity index
+ // addrIdx - *integer* - remote address of <COAP_TransportEndpoint>
+ // rrIdx - *integer* - index of the parent <COAP_RR>
+ // obsIdx - *integer* - index of <COAP_Observation_Server>
+ // retransmitTimer - *integer* - timer id of T_retransmit
+ // retransmitTimerValue - *integer* - initial timer value of T_retransmit
+ // cache - <EPTF_COAP_PDU> - cache for retransmission
+ // state - <COAP_Transaction_State> - state of the transaction FSM
+ // direction - <COAP_Transaction_Direction> - direction of the transaction FSM
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_tr_fromRR> (inout <EPTF_COAP_PDU> p_msg, in integer p_trIdx)
+ // - <f_EPTF_COAP_tr_fromEnv> (inout <EPTF_COAP_PDU> p_msg, in integer p_trIdx)
+ // - <f_EPTF_COAP_tr_cancel> (in *integer* p_trIdx)
+ // - <f_EPTF_COAP_tr_lifetime> (in <EPTF_ScheduledAction> pl_action, in *integer* pl_eventIndex)
+ // - <f_EPTF_COAP_tr_retransmit> (in EPTF_ScheduledAction pl_action, in *integer* pl_eventIndex)
+ // - <f_EPTF_COAP_tr_startT_retransmit> (in *integer* pl_trIdx)
+ // - <f_EPTF_COAP_tr_cancelT_retransmit> (in *integer* pl_trIdx)
+ // - <f_EPTF_COAP_tr_startT_lifetime> (in *integer* pl_trIdx, in *float* pl_time)
+ // - <f_EPTF_COAP_tr_cancelT_lifetime> (in *integer* pl_trIdx)
+ // - <f_EPTF_COAP_tr_send> (inout <EPTF_COAP_PDU> p_msg, in *integer* p_trIdx)
+ // - <f_EPTF_COAP_tr_remove> (in *integer* p_trIdx)
+ // - <f_EPTF_COAP_tr_setState> (in *integer* p_trIdx, in <COAP_Transaction_State> p_nextState)
+ //
+ // FSM Diagram:
+ // (see EPTF_COAP_LGen_Functions.COAP_Transaction.jpg)
+ ///////////////////////////////////////////////////////////
type record COAP_Transaction
{
integer mid,
@@ -145,8 +808,51 @@ module EPTF_COAP_LGen_Definitions
direction := OUTGOING
}
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_Transaction_List
+ //
+ // Purpose:
+ // List of <COAP_Transaction>
+ ///////////////////////////////////////////////////////////
type record of COAP_Transaction COAP_Transaction_List;
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.COAP_Transaction_DB.jpg
+ class COAP_Transaction_DB {
+ EPTF_FreeBusyQueue queue
+ COAP_Transaction_List data
+ integer hashRefOutgoing
+ integer hashRefIncoming
+ f_EPTF_COAP_trDB_init()
+ f_EPTF_COAP_trDB_add(in COAP_Transaction p_tr)
+ f_EPTF_COAP_trDB_lookUp(in Socket p_sock, in integer p_mid, COAP_Transaction_Direction p_dir)
+ f_EPTF_COAP_trDB_get(in integer p_idx, inout COAP_Transaction p_tr)
+ f_EPTF_COAP_trDB_remove(in integer p_idx)
+ f_EPTF_COAP_trDB_cleanUp()
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_Transaction_DB
+ //
+ // Purpose:
+ // Storing <COAP_Transaction> instances
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.COAP_Transaction_DB.jpg)
+ //
+ // Elements:
+ // queue - <EPTF_FreeBusyQueue> - FBQ for the stored elements
+ // data - <COAP_Transaction_List> - elements
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_trDB_init> ()
+ // - <f_EPTF_COAP_trDB_add> (in <COAP_Transaction> p_tr)
+ // - <f_EPTF_COAP_trDB_lookUp> (in <Socket> p_sock, in *integer* p_mid, <COAP_Transaction_Direction> p_dir)
+ // - <f_EPTF_COAP_trDB_get> (in *integer* p_idx, inout <COAP_Transaction> p_tr)
+ // - <f_EPTF_COAP_trDB_remove> (in *integer* p_idx)
+ // - <f_EPTF_COAP_trDB_cleanUp> ()
+ ///////////////////////////////////////////////////////////
type record COAP_Transaction_DB
{
EPTF_FreeBusyQueue queue,
@@ -155,6 +861,17 @@ module EPTF_COAP_LGen_Definitions
integer hashRefIncoming
}
+ ///////////////////////////////////////////////////////////
+ // Enum: COAP_RR_Client_State
+ //
+ // Purpose:
+ // Pssoible clientstates of a <COAP_RR>
+ //
+ // Elements:
+ // - IDLE
+ // - WAITING
+ // - REMOVING
+ ///////////////////////////////////////////////////////////
type enumerated COAP_RR_Client_State
{
IDLE,
@@ -162,6 +879,18 @@ module EPTF_COAP_LGen_Definitions
REMOVING
}
+ ///////////////////////////////////////////////////////////
+ // Enum: COAP_RR_Server_State
+ //
+ // Purpose:
+ // Pssoible clientstates of a <COAP_RR>
+ //
+ // Elements:
+ // - IDLE
+ // - SEPARATE
+ // - SERVING
+ // - REMOVING
+ ///////////////////////////////////////////////////////////
type enumerated COAP_RR_Server_State
{
IDLE,
@@ -170,12 +899,81 @@ module EPTF_COAP_LGen_Definitions
REMOVING
}
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_RR_State
+ //
+ // Purpose:
+ // A <COAP_RR> can be either a client or a server request response
+ //
+ // Elements:
+ // client - <COAP_RR_Client_State> - client states
+ // server - <COAP_RR_Server_State> - server states
+ ///////////////////////////////////////////////////////////
type union COAP_RR_State
{
COAP_RR_Client_State client,
COAP_RR_Server_State server
}
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.COAP_RR.jpg
+ class COAP_RR {
+ integer eIdx
+ integer fsmIdx
+ integer fsmCtxIdx
+ integer addrIdx
+ octetstring token
+ integer trIdx
+ Socket remoteAddress optional
+ ProtoTuple remoteProtocol optional
+ EPTF_COAP_PDU request optional
+ EPTF_COAP_PDU response optional
+ COAP_RR_State state
+ f_EPTF_COAP_rr_handleMsg(inout EPTF_COAP_PDU p_msg, in integer p_rrIdx)
+ f_EPTF_COAP_rr_reset(in integer p_rrIdx)
+ f_EPTF_COAP_rr_timeout(in integer p_rrIdx)
+ f_EPTF_COAP_rr_cancel(in integer p_rrIdx)
+ f_EPTF_COAP_rr_remove(in integer p_rrIdx)
+ f_EPTF_COAP_rr_setState(in integer p_rrIdx, in COAP_RR_State p_nextState)
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_RR
+ //
+ // Purpose:
+ // Models a COAP request-response state machine
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.COAP_RR.jpg)
+ //
+ // Elements:
+ // eIdx - *integer* - entity index
+ // fsmIdx - *integer* - fsm index
+ // fsmCtxIdx - *integer* - index of the COAP FSM context in <COAP_FsmCtx> *v_COAP_FsmCtxDB*
+ // addrIdx - *integer* - index of the remote address <COAP_TransportEndpoint> in *v_COAP_transportEndpointDB*
+ // token - *octetstring* - token identifier of the request reponse
+ // trIdx - *integer* - index of the currently active transaction <COAP_Transaction> in *v_COAP_trDB*
+ // remoteAddress - <Socket> - remote address of the request response
+ // remoteProtocol - <ProtoTuple> - used protocol (ie UDP or DTLS)
+ // request - <EPTF_COAP_PDU> - The request that initiated this request-reponse
+ // response - <EPTF_COAP_PDU> - The response that answered this request-reponse
+ // state - <COAP_RR_State> - current state of the request-response FSM
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_rr_handleMsg> (inout <EPTF_COAP_PDU> p_msg, in *integer* p_rrIdx)
+ // - <f_EPTF_COAP_rr_reset> (in *integer* p_rrIdx)
+ // - <f_EPTF_COAP_rr_timeout> (in *integer* p_rrIdx)
+ // - <f_EPTF_COAP_rr_cancel> (in *integer* p_rrIdx)
+ // - <f_EPTF_COAP_rr_remove> (in *integer* p_rrIdx)
+ // - <f_EPTF_COAP_rr_setState> (in *integer* p_rrIdx, in <COAP_RR_State> p_nextState)
+ //
+ // FSM Diagram of client request-response:
+ // (see EPTF_COAP_LGen_Functions.COAP_RR_Client.jpg)
+ //
+ // FSM Diagram of server request-response:
+ // (see EPTF_COAP_LGen_Functions.COAP_RR_Server.jpg)
+ ///////////////////////////////////////////////////////////
type record COAP_RR
{
integer eIdx,
@@ -206,8 +1004,52 @@ module EPTF_COAP_LGen_Definitions
state := { client := IDLE }
}
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_RR_List
+ //
+ // Purpose:
+ // List of <COAP_RR>
+ ///////////////////////////////////////////////////////////
type record of COAP_RR COAP_RR_List;
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.COAP_RR_DB.jpg
+ class COAP_RR_DB {
+ EPTF_FreeBusyQueue queue
+ COAP_RR_List data
+ integer hashRef
+ f_EPTF_COAP_rrDB_init()
+ f_EPTF_COAP_rrDB_add(in COAP_RR p_rr)
+ f_EPTF_COAP_rrDB_lookUp(in Socket p_sock, in octetstring p_token)
+ f_EPTF_COAP_rrDB_get(in integer p_idx, inout COAP_RR p_rr)
+ f_EPTF_COAP_rrDB_remove(in integer p_idx)
+ f_EPTF_COAP_rrDB_cleanUp()
+ f_EPTF_COAP_rrDB_tokenHash(in Socket p_sock, in octetstring p_token)
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_RR_DB
+ //
+ // Purpose:
+ // Storing <COAP_RR> instances
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.COAP_RR_DB.jpg)
+ //
+ // Elements:
+ // queue - <EPTF_FreeBusyQueue> - FBQ for the stored elements
+ // data - <COAP_RR_List> - elements
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_rrDB_init> ()
+ // - <f_EPTF_COAP_rrDB_add> (in <COAP_RR> p_rr)
+ // - <f_EPTF_COAP_rrDB_lookUp> (in <Socket> p_sock, in *octetstring* p_token)
+ // - <f_EPTF_COAP_rrDB_get> (in *integer* p_idx, inout <COAP_RR> p_rr)
+ // - <f_EPTF_COAP_rrDB_remove> (in *integer* p_idx)
+ // - <f_EPTF_COAP_rrDB_cleanUp> ()
+ // - <f_EPTF_COAP_rrDB_tokenHash> (in <Socket> p_sock, in *octetstring* p_token)
+ ///////////////////////////////////////////////////////////
type record COAP_RR_DB
{
EPTF_FreeBusyQueue queue,
@@ -215,20 +1057,65 @@ module EPTF_COAP_LGen_Definitions
integer hashRef
}
+ ///////////////////////////////////////////////////////////
+ // Type: CoAP_Template
+ //
+ // Purpose:
+ // Grouping a <CoAP_ReqResp> with an id
+ //
+ // Elements:
+ // id - *charstring* - identifier
+ // msg - <CoAP_ReqResp> - COAP PDU
+ ///////////////////////////////////////////////////////////
type record CoAP_Template
{
charstring id,
CoAP_ReqResp msg
}
+ ///////////////////////////////////////////////////////////
+ // Type: CoAP_Template_List
+ //
+ // Purpose:
+ // List of <CoAP_Template>
+ ///////////////////////////////////////////////////////////
type record of CoAP_Template CoAP_Template_List;
+
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_Template_DB
+ //
+ // Purpose:
+ // Storing <CoAP_Template> instances
+ //
+ // Elements:
+ // data - <CoAP_Template_List> - elements
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_templateDB_init> ()
+ // - <f_EPTF_COAP_templateDB_add> (in <CoAP_Template> p_template)
+ // - <f_EPTF_COAP_templateDB_lookUp> (in *charstring* p_id)
+ // - <f_EPTF_COAP_templateDB_get> (in *integer* p_idx, inout <CoAP_ReqResp> p_pdu)
+ // - <f_EPTF_COAP_templateDB_cleanUp> ()
+ ///////////////////////////////////////////////////////////
type record COAP_Template_DB
{
CoAP_Template_List data,
integer hashRef
}
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_StepCtx
+ //
+ // Purpose:
+ // Stores the most important pointers
+ //
+ // Elements:
+ // eIdx - *integer* - entity index
+ // fsmIdx - *integer* - fsm index
+ // eCtxIdx - *integer* - entity context index <COAP_EntityCtx>
+ // fsmCtxIdx - *integer* - fsm contextg index <COAP_FsmCtx>
+ ///////////////////////////////////////////////////////////
type record COAP_StepCtx
{
integer eIdx,
@@ -244,7 +1131,28 @@ module EPTF_COAP_LGen_Definitions
eCtxIdx := -1,
fsmCtxIdx := -1
}
-
+
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.COAP_TransportEndpoint.jpg
+ class COAP_TransportEndpoint {
+ Socket socket,
+ ProtoTuple proto
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_TransportEndpoint
+ //
+ // Purpose:
+ // Stores the transport related parameters for a COAP endpoint
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.COAP_TransportEndpoint.jpg)
+ //
+ // Elements:
+ // socket - <Socket> - socket parameters (ie hostname + port number)
+ // proto - <ProtoTuple> - transport protocol (ie UDP or DTLS)
+ ///////////////////////////////////////////////////////////
type record COAP_TransportEndpoint
{
Socket socket,
@@ -260,18 +1168,111 @@ module EPTF_COAP_LGen_Definitions
proto := { udp := {} }
}
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_TransportEndpoint_List
+ //
+ // Purpose:
+ // List of <COAP_TransportEndpoint>
+ ///////////////////////////////////////////////////////////
type record of COAP_TransportEndpoint COAP_TransportEndpoint_List;
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.COAP_TransportEndpointDB.jpg
+ class COAP_TransportEndpointDB {
+ EPTF_FreeBusyQueue queue
+ COAP_TransportEndpoint_List data
+ integer hashRef
+ f_EPTF_COAP_transportEndpointDB_init()
+ f_EPTF_COAP_transportEndpointDB_add(in COAP_TransportEndpoint p_te, inout integer p_idx)
+ f_EPTF_COAP_transportEndpointDB_get(inout COAP_TransportEndpoint p_te, in integer p_idx)
+ f_EPTF_COAP_transportEndpointDB_lookUp(in COAP_TransportEndpoint p_te)
+ f_EPTF_COAP_transportEndpointDB_Socket2String(Socket p_sock)
+ f_EPTF_COAP_transportEndpointDB_cleanUp()
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_TransportEndpointDB
+ //
+ // Purpose:
+ // Storing <COAP_TransportEndpoint> instances
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.COAP_TransportEndpointDB.jpg)
+ //
+ // Elements:
+ // data - <COAP_TransportEndpoint_List> - elements
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_transportEndpointDB_init> ()
+ // - <f_EPTF_COAP_transportEndpointDB_add> (in <COAP_TransportEndpoint> p_te, inout *integer* p_idx)
+ // - <f_EPTF_COAP_transportEndpointDB_get> (inout <COAP_TransportEndpoint> p_te, in *integer* p_idx)
+ // - <f_EPTF_COAP_transportEndpointDB_lookUp> (in <COAP_TransportEndpoint> p_te)
+ // - <f_EPTF_COAP_transportEndpointDB_Socket2String> (<Socket> p_sock)
+ // - <f_EPTF_COAP_transportEndpointDB_cleanUp> ()
+ ///////////////////////////////////////////////////////////
type record COAP_TransportEndpointDB
{
EPTF_FreeBusyQueue queue,
COAP_TransportEndpoint_List data,
integer hashRef
}
-
+
+ ///////////////////////////////////////////////////////////
+ // Type: ObservationServerIdx_List
+ //
+ // Purpose:
+ // List of *integer*
+ ///////////////////////////////////////////////////////////
type record of integer ObservationServerIdx_List;
+
+ ///////////////////////////////////////////////////////////
+ // Type: UriPath_List
+ //
+ // Purpose:
+ // List of *universal charstring*
+ ///////////////////////////////////////////////////////////
type record of universal charstring UriPath_List;
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.COAP_ObservedResource.jpg
+ class COAP_ObservedResource {
+ charstring localAddress
+ integer localPort
+ charstring resourceId
+ UriPath_List uriPath
+ ObservationServerIdx_List observationServersIndices, // FIXME: Can be slow to update in case of larger nums
+ integer eCtxIdx
+ f_EPTF_COAP_ObservedResource_addObserver(in integer p_obsResIdx, in EPTF_COAP_PDU p_msg)
+ f_EPTF_COAP_ObservedResource_removeObserver(in integer p_obsResIdx, in integer p_obsIdx)
+ f_EPTF_COAP_ObservedResource_sendNotification(in integer p_obsResIdx, inout EPTF_COAP_PDU p_msg)
+ f_EPTF_COAP_ObservedResource_cleanUp(in integer p_obsResIdx)
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_ObservedResource
+ //
+ // Purpose:
+ // Represents an observed resource
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.COAP_ObservedResource.jpg)
+ //
+ // Elements:
+ // localAddress - *charstring* - local host of the resource
+ // localPort - *integer* - local port of the resource
+ // resourceId - *charstring* - path to the resource (eg "/3303/1/13", "/home/myResource")
+ // uriPath - <UriPath_List> - tokenized path to the resource (eg /"3303"/"1"/"13", /"home"/"myResource")
+ // observationServersIndices - <ObservationServerIdx_List> - Pointing to the observation servers <COAP_Observation_Server>
+ // eCtxIdx - *integer* - entity context index pointing to <COAP_EntityCtx>
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_ObservedResource_addObserver> (in *integer* p_obsResIdx, in <EPTF_COAP_PDU> p_msg)
+ // - <f_EPTF_COAP_ObservedResource_removeObserver> (in *integer* p_obsResIdx, in *integer* p_obsIdx)
+ // - <f_EPTF_COAP_ObservedResource_sendNotification> (in *integer* p_obsResIdx, inout <EPTF_COAP_PDU> p_msg)
+ // - <f_EPTF_COAP_ObservedResource_cleanUp> (in *integer* p_obsResIdx)
+ ///////////////////////////////////////////////////////////
type record COAP_ObservedResource
{
charstring localAddress,
@@ -292,15 +1293,99 @@ module EPTF_COAP_LGen_Definitions
eCtxIdx := -1
}
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_ObservedResource_List
+ //
+ // Purpose:
+ // List of <COAP_ObservedResource>
+ ///////////////////////////////////////////////////////////
type record of COAP_ObservedResource COAP_ObservedResource_List;
-
+
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.COAP_ObservedResource_DB.jpg
+ class COAP_ObservedResource_DB {
+ EPTF_FreeBusyQueue queue,
+ COAP_ObservedResource_List data,
+ integer hashRef
+ f_EPTF_COAP_observedResourceDB_init()
+ f_EPTF_COAP_observedResourceDB_add(in COAP_ObservedResource p_or)
+ f_EPTF_COAP_observedResourceDB_lookUp(in charstring p_localAddr, in integer p_localPort, in charstring p_resourceId)
+ f_EPTF_COAP_observedResourceDB_get(in integer p_idx, inout COAP_ObservedResource p_or)
+ f_EPTF_COAP_observedResourceDB_remove(in integer p_idx)
+ f_EPTF_COAP_observedResourceDB_cleanUp()
+ f_EPTF_COAP_observedResourceDB_tokenHash(in charstring p_localAddr, in integer p_localPort, in charstring p_resourceId)
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_ObservedResource_DB
+ //
+ // Purpose:
+ // Storing <COAP_ObservedResource> instances
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.COAP_ObservedResource_DB.jpg)
+ //
+ // Elements:
+ // data - <COAP_ObservedResource_List> - elements
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_observedResourceDB_init> ()
+ // - <f_EPTF_COAP_observedResourceDB_add> (in <COAP_ObservedResource> p_or)
+ // - <f_EPTF_COAP_observedResourceDB_lookUp> (in *charstring* p_localAddr, in *integer* p_localPort, in *charstring* p_resourceId)
+ // - <f_EPTF_COAP_observedResourceDB_get> (in *integer* p_idx, inout <COAP_ObservedResource> p_or)
+ // - <f_EPTF_COAP_observedResourceDB_remove> (in *integer* p_idx)
+ // - <f_EPTF_COAP_observedResourceDB_cleanUp> ()
+ // - <f_EPTF_COAP_observedResourceDB_tokenHash> (in *charstring* p_localAddr, in *integer* p_localPort, in *charstring* p_resourceId)
+ ///////////////////////////////////////////////////////////
type record COAP_ObservedResource_DB
{
EPTF_FreeBusyQueue queue,
COAP_ObservedResource_List data,
integer hashRef
}
-
+
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.COAP_Observation_Server.jpg
+ class COAP_Observation_Server {
+ charstring remoteAddress,
+ integer remotePort,
+ ProtoTuple protocol,
+ charstring resourceId,
+ octetstring token,
+ integer seqNum,
+ boolean confirmable,
+ integer observedResourceIdx,
+ integer trIdx
+ f_EPTF_COAP_ObservationServer_sendNotification(in integer p_obsIdx, inout EPTF_COAP_PDU p_msg)
+ f_EPTF_COAP_ObservationServer_cancelReceivedFromEnv(in integer p_obsIdx)
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_Observation_Server
+ //
+ // Purpose:
+ // Represents an observation relationship between an observed resource and an observer
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.COAP_Observation_Server.jpg)
+ //
+ // Elements:
+ // remoteAddress - *charstring* - address of the observer
+ // remotePort - *integer* - remote port of the observer
+ // protocol - <ProtoTuple> - the used transport protocol
+ // resourceId - *charstring* - id of the observed resource
+ // token - *octetstring* - token of the observation
+ // seqNum - *integer* - sequence number used for the notification
+ // confirmable - *boolean* - if true the notification should be send as a CON (default: false)
+ // observedResourceIdx - *integer* - pointer to the <COAP_ObservedResource>
+ // trIdx - *integer* - pointer to the notifications <COAP_Transaction>
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_ObservationServer_sendNotification> (in *integer* p_obsIdx, inout <EPTF_COAP_PDU> p_msg)
+ // - <f_EPTF_COAP_ObservationServer_cancelReceivedFromEnv> (in *integer* p_obsIdx)
+ ///////////////////////////////////////////////////////////
type record COAP_Observation_Server
{
charstring remoteAddress,
@@ -329,8 +1414,51 @@ module EPTF_COAP_LGen_Definitions
trIdx := -1
}
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_Observation_Server_List
+ //
+ // Purpose:
+ // List of <COAP_Observation_Server>
+ ///////////////////////////////////////////////////////////
type record of COAP_Observation_Server COAP_Observation_Server_List;
-
+
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.COAP_Observation_DB.jpg
+ class COAP_Observation_DB {
+ EPTF_FreeBusyQueue queue,
+ COAP_Observation_Server_List data,
+ integer hashRef
+ f_EPTF_COAP_observationDB_init()
+ f_EPTF_COAP_observationDB_add(in COAP_Observation_Server p_os)
+ f_EPTF_COAP_observationDB_lookUp(in charstring p_remoteAddr, in integer p_remotePort, in charstring p_resId)
+ f_EPTF_COAP_observationDB_get(in integer p_idx, inout COAP_Observation_Server p_os)
+ f_EPTF_COAP_observationDB_remove(in integer p_idx)
+ f_EPTF_COAP_observationDB_cleanUp()
+ f_EPTF_COAP_observationDB_tokenHash(in charstring p_remoteAddr, in integer p_remotePort, in charstring p_resId)
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: COAP_Observation_DB
+ //
+ // Purpose:
+ // Storing <COAP_Observation_Server> instances
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.COAP_Observation_DB.jpg)
+ //
+ // Elements:
+ // data - <COAP_Observation_Server_List> - elements
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_observationDB_init> ()
+ // - <f_EPTF_COAP_observationDB_add> (in <COAP_Observation_Server> p_os)
+ // - <f_EPTF_COAP_observationDB_lookUp> (in *charstring* p_remoteAddr, in *integer* p_remotePort, in *charstring* p_resId)
+ // - <f_EPTF_COAP_observationDB_get> (in *integer* p_idx, inout <COAP_Observation_Server> p_os)
+ // - <f_EPTF_COAP_observationDB_remove> (in *integer* p_idx)
+ // - <f_EPTF_COAP_observationDB_cleanUp> ()
+ // - <f_EPTF_COAP_observationDB_tokenHash> (in *charstring* p_remoteAddr, in *integer* p_remotePort, in *charstring* p_resId)
+ ///////////////////////////////////////////////////////////
type record COAP_Observation_DB
{
EPTF_FreeBusyQueue queue,
@@ -338,20 +1466,161 @@ module EPTF_COAP_LGen_Definitions
integer hashRef
}
+ ///////////////////////////////////////////////////////////
+ // Type: fcb_EPTF_COAP_messageReceived
+ //
+ // Purpose:
+ // Call-back function type for reporting received COAP messages
+ //
+ // Elements:
+ // pl_message - *in* <EPTF_COAP_PDU> - received COAP message
+ // p_duplicate - *in* <EPTF_COAP_PDU> - flag, when true, indicates a duplicate message
+ ///////////////////////////////////////////////////////////
type function fcb_EPTF_COAP_messageReceived(in EPTF_COAP_PDU pl_message, in boolean p_duplicate) runs on self;
+
+ ///////////////////////////////////////////////////////////
+ // Type: fcb_EPTF_COAP_eventIndication
+ //
+ // Purpose:
+ // Call-back function type for reporting received COAP events
+ //
+ // Elements:
+ // pl_event - *in* <EPTF_COAP_EventDescriptor> - received COAP event
+ ///////////////////////////////////////////////////////////
type function fcb_EPTF_COAP_eventIndication(in EPTF_COAP_EventDescriptor pl_event) runs on self;
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_EventDescriptor
+ //
+ // Purpose:
+ // Describes a COAP event that can be reported to the COAP applib user
+ //
+ // Elements:
+ // resourceNotObserved - <EPTF_COAP_ResourceNotObserved_Event> - event that indicates that a resource is not observed any more
+ ///////////////////////////////////////////////////////////
type union EPTF_COAP_EventDescriptor
{
EPTF_COAP_ResourceNotObserved_Event resourceNotObserved
}
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_ResourceNotObserved_Event
+ //
+ // Purpose:
+ // Describes an event which indicates that a particular resource is not observed by any one anymore
+ //
+ // Elements:
+ // eIdx - *integer* - entity index
+ // uriPath - <UriPath_List> - the URI of the resource
+ ///////////////////////////////////////////////////////////
type record EPTF_COAP_ResourceNotObserved_Event
{
integer eIdx,
UriPath_List uriPath
}
-
+
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Definitions.EPTF_COAP_LGen_CT.jpg
+ class EPTF_COAP_LGen_CT {
+ boolean v_COAP_initialized
+ integer v_COAP_bIdx
+ integer v_COAP_loggingMaskId
+ COAP_EntityCtx_DB v_COAP_EntityCtxDB
+ COAP_FsmCtx_DB v_COAP_FsmCtxDB
+ COAP_TransportEndpointDB v_COAP_transportEndpointDB
+ COAP_Transaction_DB v_COAP_trDB
+ COAP_RR_DB v_COAP_rrDB
+ COAP_Template_DB v_COAP_templateDB
+ COAP_Observation_DB v_COAP_observationDB
+ COAP_ObservedResource_DB v_COAP_observedResourceDB
+ COAP_StepCtx v_COAP_ctx := c_COAP_StepCtx_empty;
+ COAP_TransportEndpoint v_COAP_transportEndpoint := c_COAP_TransportEndpoint_empty;
+ EPTF_COAP_PDU v_COAP_msgToProcess;
+ EPTF_COAP_PDU v_COAP_msgToSend;
+ fcb_EPTF_COAP_messageReceived vf_COAP_msgReceived
+ fcb_EPTF_COAP_eventIndication vf_COAP_eventIndication
+ f_EPTF_COAP_LGen_init(in charstring pl_name)
+ f_COAP_cleanUp()
+ f_COAP_eCtxBind(in integer pl_eIdx)
+ f_COAP_eCtxUnbind(in integer pl_eIdx)
+ f_COAP_eCtxReset(in integer pl_eIdx)
+ f_EPTF_COAP_LGen_receiveMessage(in EPTF_COAP_PDU pl_message)
+ f_EPTF_COAP_LGen_receiveEvent(in ASP_Event p_event)
+ f_EPTF_COAP_LGen_transportApiResponse(in EPTF_COAP_Transport_Response pl_rsp)
+ f_EPTF_COAP_stack_fromApp(inout EPTF_COAP_PDU p_msg, in COAP_StepCtx p_ctx)
+ f_EPTF_COAP_stack_fromEnv(inout EPTF_COAP_PDU p_msg)
+ f_EPTF_COAP_declareEvents()
+ f_EPTF_COAP_declareSteps()
+ f_EPTF_COAP_setStepCtx(in EPTF_LGenBase_TestStepArgs pl_ptr, inout COAP_StepCtx p_ctx)
+ f_EPTF_COAP_setCtx(in integer p_eIdx, in integer p_fsmIdx, inout COAP_StepCtx p_ctx)
+ f_EPTF_COAP_isFsmInitialized(in integer pl_eIdx, in integer pl_fsmIdx, inout integer pl_fsmCtxIdx)
+ f_EPTF_COAP_dispatchEventsForCode(in Code pl_code, in integer pl_eIdx, in integer pl_fsmCtx, in EPTF_IntegerList pl_reportedArgs)
+ f_EPTF_COAP_dispatchEvent(in integer pl_eventIdx, in integer pl_eIdx, in integer pl_fsmCtx, in EPTF_IntegerList pl_reportedArgs)
+ }
+ @enduml
+ *****************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_LGen_CT
+ //
+ // Purpose:
+ // COAP load generator component
+ //
+ // Class:
+ // (see EPTF_COAP_LGen_Definitions.EPTF_COAP_LGen_CT.jpg)
+ //
+ // Extensions:
+ // - <EPTF_LGenBase_CT>
+ // - <EPTF_COAP_Transport_User_CT>
+ // - <EPTF_Logging_CT>
+ //
+ // Ports:
+ // -
+ //
+ // Timers:
+ // -
+ //
+ // Variables:
+ // v_COAP_initialized - *boolean* - Flag to indicate that if init function was already called
+ // v_COAP_bIdx - *integer* - Name of the NAS_EPS LGen component
+ // v_COAP_loggingMaskId - *integer* - logging mask id <COAP_EntityCtx>
+ //
+ // v_COAP_ctx - <COAP_StepCtx> - collection of the most important pointers
+ // v_COAP_transportEndpoint - <COAP_TransportEndpoint> - variable for a transport endpoint
+ //
+ // v_COAP_msgToProcess - <EPTF_COAP_PDU> - message to process
+ // v_COAP_msgToSend - <EPTF_COAP_PDU> - message to send
+ //
+ // vf_COAP_msgReceived - <fcb_EPTF_COAP_messageReceived> - Function hook for reporting received messages
+ // vf_COAP_eventIndication - <fcb_EPTF_COAP_eventIndication> - Function hook for reporting events
+ //
+ // Instance databases:
+ // v_COAP_FsmCtxDB - <COAP_FsmCtx_DB> - FSM context database <COAP_FsmCtx>
+ // v_COAP_transportEndpointDB - <COAP_TransportEndpointDB> - transport endpoint database <COAP_TransportEndpoint>
+ // v_COAP_trDB - <COAP_Transaction_DB> - transaction database <COAP_Transaction>
+ // v_COAP_rrDB - <COAP_RR_DB> - erequest-response database <COAP_RR>
+ // v_COAP_templateDB - <COAP_Template_DB> - template database <COAP_Template>
+ // v_COAP_observationDB - <COAP_Observation_DB> - observation server database <COAP_Observation_Server>
+ // v_COAP_observedResourceDB - <COAP_ObservedResource_DB> - observed resource database <COAP_ObservedResource>
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_LGen_init> (in *charstring* pl_name)
+ // - <f_COAP_cleanUp> ()
+ // - <f_COAP_eCtxBind> (in *integer* pl_eIdx)
+ // - <f_COAP_eCtxUnbind> (in *integer* pl_eIdx)
+ // - <f_COAP_eCtxReset> (in *integer* pl_eIdx)
+ // - <f_EPTF_COAP_LGen_receiveMessage> (in <EPTF_COAP_PDU> pl_message)
+ // - <f_EPTF_COAP_LGen_receiveEvent> (in <ASP_Event> p_event)
+ // - <f_EPTF_COAP_LGen_transportApiResponse> (in <EPTF_COAP_Transport_Response> pl_rsp)
+ // - <f_EPTF_COAP_stack_fromApp> (inout <EPTF_COAP_PDU> p_msg, in <COAP_StepCtx> p_ctx)
+ // - <f_EPTF_COAP_stack_fromEnv> (inout <EPTF_COAP_PDU> p_msg)
+ // - <f_EPTF_COAP_declareEvents> ()
+ // - <f_EPTF_COAP_declareSteps> ()
+ // - <f_EPTF_COAP_setStepCtx> (in <EPTF_LGenBase_TestStepArgs> pl_ptr, inout <COAP_StepCtx> p_ctx)
+ // - <f_EPTF_COAP_setCtx> (in *integer* p_eIdx, in *integer* p_fsmIdx, inout <COAP_StepCtx> p_ctx)
+ // - <f_EPTF_COAP_isFsmInitialized> (in *integer* pl_eIdx, in *integer* pl_fsmIdx, inout *integer* pl_fsmCtxIdx)
+ // - <f_EPTF_COAP_dispatchEventsForCode> (in <Code> pl_code, in *integer* pl_eIdx, in *integer* pl_fsmCtx, in <EPTF_IntegerList> pl_reportedArgs)
+ // - <f_EPTF_COAP_dispatchEvent> (in *integer* pl_eventIdx, in *integer* pl_eIdx, in *integer* pl_fsmCtx, in <EPTF_IntegerList> pl_reportedArgs)
+ ///////////////////////////////////////////////////////////
type component EPTF_COAP_LGen_CT extends EPTF_COAP_Transport_User_CT, EPTF_LGenBase_CT, EPTF_Logging_CT
{
var boolean v_COAP_initialized := false;
@@ -383,133 +1652,774 @@ module EPTF_COAP_LGen_Definitions
// Events
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_EMPTY
+ //
+ // Purpose:
+ // Integer constant for the COAP EMPTY message event
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_EMPTY := 0;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_EMPTY
+ //
+ // Purpose:
+ // Charstring constant for the COAP EMPTY message event
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_EMPTY := "COAP req: EMPTY";
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_GET
+ //
+ // Purpose:
+ // Integer constant for the COAP GET request event
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_GET := 1;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_GET
+ //
+ // Purpose:
+ // Charstring constant for the COAP GET request event
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_GET := "COAP req: GET";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_POST
+ //
+ // Purpose:
+ // Integer constant for the COAP POST request event
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_POST := 2;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_POST
+ //
+ // Purpose:
+ // Charstring constant for the COAP POST request event
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_POST := "COAP req: POST";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_PUT
+ //
+ // Purpose:
+ // Integer constant for the COAP PUT request event
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_PUT := 3;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_PUT
+ //
+ // Purpose:
+ // Charstring constant for the COAP PUT request event
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_PUT := "COAP req: PUT";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_DELETE
+ //
+ // Purpose:
+ // Integer constant for the COAP DELETE request event
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_DELETE := 4;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_DELETE
+ //
+ // Purpose:
+ // Charstring constant for the COAP DELETE request event
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_DELETE := "COAP req: DELETE";
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_OBSERVE
+ //
+ // Purpose:
+ // Integer constant for the COAP OBSERVE request event
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_OBSERVE := 5;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_OBSERVE
+ //
+ // Purpose:
+ // Charstring constant for the COAP OBSERVE request event
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_OBSERVE := "COAP req: OBSERVE";
template charstring c_COAP_eventName(in integer p_code) := "COAP rsp: "&int2str(p_code);
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_1xx
+ //
+ // Purpose:
+ // Integer constant for the COAP 1xx reponse event
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_1xx := 700;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_1xx
+ //
+ // Purpose:
+ // Charstring constant for the COAP 1xx response event
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_1xx := "COAP rsp: 1xx";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_2xx
+ //
+ // Purpose:
+ // Integer constant for the COAP 2xx reponse event
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_2xx := 701;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_2xx
+ //
+ // Purpose:
+ // Charstring constant for the COAP 2xx response event
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_2xx := "COAP rsp: 2xx";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_3xx
+ //
+ // Purpose:
+ // Integer constant for the COAP 3xx reponse event
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_3xx := 702;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_3xx
+ //
+ // Purpose:
+ // Charstring constant for the COAP 3xx response event
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_3xx := "COAP rsp: 3xx";
- const integer c_COAP_eventIdx_4xx := 703;
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_4xx
+ //
+ // Purpose:
+ // Integer constant for the COAP 4xx response event
+ ///////////////////////////////////////////////////////////
+ const integer c_COAP_eventIdx_4xx := 703;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_4xx
+ //
+ // Purpose:
+ // Charstring constant for the COAP 4xx response event
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_4xx := "COAP rsp: 4xx";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_5xx
+ //
+ // Purpose:
+ // Integer constant for the COAP 5xx response event
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_5xx := 704;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_5xx
+ //
+ // Purpose:
+ // Charstring constant for the COAP 5xx response event
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_5xx := "COAP rsp: 5xx";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_6xx
+ //
+ // Purpose:
+ // Integer constant for the COAP 6xx response event
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_6xx := 705;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_6xx
+ //
+ // Purpose:
+ // Charstring constant for the COAP 6xx response event
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_6xx := "COAP rsp: 6xx";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_3xxto6xx
+ //
+ // Purpose:
+ // Integer constant for the COAP 3xx to 6xx response event
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_3xxto6xx := 706;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_3xxto6xx
+ //
+ // Purpose:
+ // Charstring constant for the COAP 3xx to 6xx response event
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_3xxto6xx := "COAP rsp: 3xxto6xx";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_transportSucc
+ //
+ // Purpose:
+ // Integer constant for the COAP transport succesful indication
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_transportSucc := 707;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_transportSucc
+ //
+ // Purpose:
+ // Charstring constant for the COAP transport succesful indication
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_transportSucc := "COAP transport: succ rsp";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_transportFail
+ //
+ // Purpose:
+ // Integer constant for the COAP transport failure indication
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_transportFail := 708;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_transportFail
+ //
+ // Purpose:
+ // Charstring constant for the COAP transport failure indication
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_transportFail := "COAP transport: fail rsp";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_trRST
+ //
+ // Purpose:
+ // Integer constant for the COAP transaction reset indication
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_trRST := 709;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_trRST
+ //
+ // Purpose:
+ // Charstring constant for the COAP transaction reset indication
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_trRST := "COAP transaction: reset";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_trTimeout
+ //
+ // Purpose:
+ // Integer constant for the COAP transaction timeout indication
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_trTimeout := 710;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_trTimeout
+ //
+ // Purpose:
+ // Charstring constant for the COAP transaction timeout indication
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_trTimeout := "COAP transaction: timeout";
-
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_observeCanceled
+ //
+ // Purpose:
+ // Integer constant for the COAP observation canceled indication
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_observeCanceled := 711;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_observeCanceled
+ //
+ // Purpose:
+ // Charstring constant for the COAP observation canceled indication
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_observeCanceled := "COAP observe: canceled";
-
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_resourceNotObservedIndication
+ //
+ // Purpose:
+ // Integer constant for the indication which is sent when there are no observers for a resource
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_resourceNotObservedIndication := 712;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_resourceNotObservedIndication
+ //
+ // Purpose:
+ // Charstring constant for the indication which is sent when there are no observers for a resource
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_resourceNotObservedIndication := "COAP observe: resource not observed";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventIdx_dtlsConnectionClosed
+ //
+ // Purpose:
+ // Integer constant for the COAP transport DTLS connection closed indication
+ ///////////////////////////////////////////////////////////
const integer c_COAP_eventIdx_dtlsConnectionClosed := 713;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_eventName_dtlsConnectionClosed
+ //
+ // Purpose:
+ // Charstring constant for the COAP transport DTLS connection closed indication
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_eventName_dtlsConnectionClosed := "COAP transport: DTLS connection closed";
// Steps
-
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_init
+ //
+ // Purpose:
+ // Integer constant for the COAP init test step
+ //
+ // Related Function:
+ // - <f_COAP_step_init>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_init := 0;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_init
+ //
+ // Purpose:
+ // Charstring constant for the COAP init test step
+ //
+ // Related Function:
+ // - <f_COAP_step_init>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_init := "COAP Applib: init";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_cleanUp
+ //
+ // Purpose:
+ // Integer constant for the COAP cleanUp test step
+ //
+ // Related Function:
+ // - <f_COAP_step_cleanUp>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_cleanUp := 1;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_cleanUp
+ //
+ // Purpose:
+ // Charstring constant for the COAP cleanUp test step
+ //
+ // Related Function:
+ // - <f_COAP_step_cleanUp>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_cleanUp := "COAP Applib: cleanUp";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_setLocalAddress
+ //
+ // Purpose:
+ // Integer constant for the COAP setLocalAddress test step
+ //
+ // Related Function:
+ // - <f_COAP_step_setLocalAddress>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_setLocalAddress := 2;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_setLocalAddress
+ //
+ // Purpose:
+ // Charstring constant for the COAP setLocalAddress test step
+ //
+ // Related Function:
+ // - <f_COAP_step_setLocalAddress>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_setLocalAddress := "COAP Applib: setLocalAddress";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_setRemoteAddress_byIntIdx
+ //
+ // Purpose:
+ // Integer constant for the COAP setRemoteAddress test step
+ //
+ // Related Function:
+ // - <f_COAP_step_setRemoteAddress_byIntIdx>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_setRemoteAddress_byIntIdx := 3;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_setRemoteAddress_byIntIdx
+ //
+ // Purpose:
+ // Charstring constant for the COAP setRemoteAddress test step
+ //
+ // Related Function:
+ // - <f_COAP_step_setRemoteAddress_byIntIdx>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_setRemoteAddress_byIntIdx := "COAP Applib: setRemoteAddress_byIntIdx";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_send
+ //
+ // Purpose:
+ // Integer constant for the COAP send test step
+ //
+ // Related Function:
+ // - <f_COAP_step_send>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_send := 4;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_send
+ //
+ // Purpose:
+ // Charstring constant for the COAP send test step
+ //
+ // Related Function:
+ // - <f_COAP_step_send>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_send := "COAP Applib: send";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_loadTemplate_byIntIdx
+ //
+ // Purpose:
+ // Integer constant for the COAP loadTemplate test step
+ //
+ // Related Function:
+ // - <f_COAP_step_loadTemplate_byIntIdx>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_loadTemplate_byIntIdx := 5;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_loadTemplate_byIntIdx
+ //
+ // Purpose:
+ // Charstring constant for the COAP loadTemplate step
+ //
+ // Related Function:
+ // - <f_COAP_step_loadTemplate_byIntIdx>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_loadTemplate_byIntIdx := "COAP Applib: loadTemplate_byIntIdx";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_handleRequest
+ //
+ // Purpose:
+ // Integer constant for the COAP handleRequest test step
+ //
+ // Related Function:
+ // - <f_COAP_step_handleRequest>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_handleRequest := 6;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_handleRequest
+ //
+ // Purpose:
+ // Charstring constant for the COAP handleRequest step
+ //
+ // Related Function:
+ // - <f_COAP_step_handleRequest>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_handleRequest := "COAP Applib: handleRequest";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_sendResponse
+ //
+ // Purpose:
+ // Integer constant for the COAP sendResponse test step
+ //
+ // Related Function:
+ // - <f_COAP_step_sendResponse>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_sendResponse := 7;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_sendResponse
+ //
+ // Purpose:
+ // Charstring constant for the COAP sendResponse step
+ //
+ // Related Function:
+ // - <f_COAP_step_sendResponse>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_sendResponse := "COAP Applib: sendResponse";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_sendAccept
+ //
+ // Purpose:
+ // Integer constant for the COAP sendAccept test step
+ //
+ // Related Function:
+ // - <f_COAP_step_sendAccept>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_sendAccept := 8;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_sendAccept
+ //
+ // Purpose:
+ // Charstring constant for the COAP sendAccept step
+ //
+ // Related Function:
+ // - <f_COAP_step_sendAccept>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_sendAccept := "COAP Applib: sendAccept";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_startListening
+ //
+ // Purpose:
+ // Integer constant for the COAP startListening test step
+ //
+ // Related Function:
+ // - <f_COAP_step_startListening>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_startListening := 9;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_startListening
+ //
+ // Purpose:
+ // Charstring constant for the COAP startListening step
+ //
+ // Related Function:
+ // - <f_COAP_step_startListening>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_startListening := "COAP Applib: startListening";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_reportCoapEventForEntity
+ //
+ // Purpose:
+ // Integer constant for the COAP reportCoapEventForEntity test step
+ //
+ // Related Function:
+ // - <f_COAP_step_reportCoapEventForEntity>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_reportCoapEventForEntity := 10;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_reportCoapEventForEntity
+ //
+ // Purpose:
+ // Charstring constant for the COAP reportCoapEventForEntity step
+ //
+ // Related Function:
+ // - <f_COAP_step_reportCoapEventForEntity>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_reportCoapEventForEntity := "COAP Applib: reportCoapEventForEntity";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_loadTemplate_byStringId
+ //
+ // Purpose:
+ // Integer constant for the COAP loadTemplate test step
+ //
+ // Related Function:
+ // - <f_COAP_step_loadTemplate_byStringId>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_loadTemplate_byStringId := 11;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_loadTemplate_byStringId
+ //
+ // Purpose:
+ // Charstring constant for the COAP loadTemplate step
+ //
+ // Related Function:
+ // - <f_COAP_step_loadTemplate_byStringId>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_loadTemplate_byStringId := "COAP Applib: loadTemplate_byStringId";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_setRemoteAddress_byVars
+ //
+ // Purpose:
+ // Integer constant for the COAP setRemoteAddress test step
+ //
+ // Related Function:
+ // - <f_COAP_step_setRemoteAddress_byVars>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_setRemoteAddress_byVars := 12;
- const charstring c_COAP_stepName_setRemoteAddress_byVars := "COAP Applib: setRemoteAddress_byVars";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_setRemoteAddress_byVars
+ //
+ // Purpose:
+ // Charstring constant for the COAP setRemoteAddress step
+ //
+ // Related Function:
+ // - <f_COAP_step_setRemoteAddress_byVars>
+ ///////////////////////////////////////////////////////////
+ const charstring c_COAP_stepName_setRemoteAddress_byVars := "COAP Applib: setRemoteAddress_byVars";
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_sendNotification_byIntIdx
+ //
+ // Purpose:
+ // Integer constant for the COAP sendNotification test step
+ //
+ // Related Function:
+ // - <f_COAP_step_sendNotification_byIntIdx>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_sendNotification_byIntIdx := 13;
- const charstring c_COAP_stepName_sendNotification_byIntIdx := "COAP Applib: sendNotification_byIntIdx";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_sendNotification_byIntIdx
+ //
+ // Purpose:
+ // Charstring constant for the COAP sendNotification step
+ //
+ // Related Function:
+ // - <f_COAP_step_sendNotification_byIntIdx>
+ ///////////////////////////////////////////////////////////
+ const charstring c_COAP_stepName_sendNotification_byIntIdx := "COAP Applib: sendNotification_byIntIdx";
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_sendNotification_byStringId
+ //
+ // Purpose:
+ // Integer constant for the COAP sendNotification test step
+ //
+ // Related Function:
+ // - <f_COAP_step_sendNotification_byStringId>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_sendNotification_byStringId := 14;
- const charstring c_COAP_stepName_sendNotification_byStringId := "COAP Applib: sendNotification_byStringId";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_sendNotification_byStringId
+ //
+ // Purpose:
+ // Charstring constant for the COAP sendNotification step
+ //
+ // Related Function:
+ // - <f_COAP_step_sendNotification_byStringId>
+ ///////////////////////////////////////////////////////////
+ const charstring c_COAP_stepName_sendNotification_byStringId := "COAP Applib: sendNotification_byStringId";
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_removeResourceObservations_byIntIdx
+ //
+ // Purpose:
+ // Integer constant for the COAP removeResourceObservations test step
+ //
+ // Related Function:
+ // - <f_COAP_step_removeResourceObservations_byIntIdx>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_removeResourceObservations_byIntIdx := 15;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_removeResourceObservations_byIntIdx
+ //
+ // Purpose:
+ // Charstring constant for the COAP removeResourceObservations step
+ //
+ // Related Function:
+ // - <f_COAP_step_removeResourceObservations_byIntIdx>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_removeResourceObservations_byIntIdx := "COAP Applib: removeResourceObservations_byIntIdx";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_removeResourceObservations_byStringId
+ //
+ // Purpose:
+ // Integer constant for the COAP removeResourceObservations test step
+ //
+ // Related Function:
+ // - <f_COAP_step_removeResourceObservations_byStringId>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_removeResourceObservations_byStringId := 16;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_removeResourceObservations_byStringId
+ //
+ // Purpose:
+ // Charstring constant for the COAP removeResourceObservations step
+ //
+ // Related Function:
+ // - <f_COAP_step_removeResourceObservations_byStringId>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_removeResourceObservations_byStringId := "COAP Applib: removeResourceObservations_byStringId";
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_startDTLS
+ //
+ // Purpose:
+ // Integer constant for the COAP startDTLS test step
+ //
+ // Related Function:
+ // - <f_COAP_step_startDTLS>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_startDTLS := 17;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_startDTLS
+ //
+ // Purpose:
+ // Charstring constant for the COAP startDTLS step
+ //
+ // Related Function:
+ // - <f_COAP_step_startDTLS>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_startDTLS := "COAP Applib: startDTLS";
- const integer c_COAP_stepIdx_startDTLS_byVarIds := 18;
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_startDTLS_byVarIds
+ //
+ // Purpose:
+ // Integer constant for the COAP startDTLS test step
+ //
+ // Related Function:
+ // - <f_COAP_step_startDTLS_byVarIds>
+ ///////////////////////////////////////////////////////////
+ const integer c_COAP_stepIdx_startDTLS_byVarIds := 18;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_startDTLS_byVarIds
+ //
+ // Purpose:
+ // Charstring constant for the COAP startDTLS step
+ //
+ // Related Function:
+ // - <f_COAP_step_startDTLS_byVarIds>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_startDTLS_byVarIds := "COAP Applib: startDTLS_byVarIds";
-
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepIdx_startDTLS_byIntIdx
+ //
+ // Purpose:
+ // Integer constant for the COAP startDTLS test step
+ //
+ // Related Function:
+ // - <f_COAP_step_startDTLS_byIntIdx>
+ ///////////////////////////////////////////////////////////
const integer c_COAP_stepIdx_startDTLS_byIntIdx := 19;
+
+ ///////////////////////////////////////////////////////////
+ // const: c_COAP_stepName_startDTLS_byIntIdx
+ //
+ // Purpose:
+ // Charstring constant for the COAP startDTLS step
+ //
+ // Related Function:
+ // - <f_COAP_step_startDTLS_byIntIdx>
+ ///////////////////////////////////////////////////////////
const charstring c_COAP_stepName_startDTLS_byIntIdx := "COAP Applib: startDTLS_byIntIdx";
// Step parameters:
const integer c_COAP_stepParam_true := 1;
const integer c_COAP_stepParam_false := 0;
-
}
diff --git a/src/EPTF_COAP_LGen_Functions.ttcn b/src/EPTF_COAP_LGen_Functions.ttcn
index aa8843f..09a15c9 100644
--- a/src/EPTF_COAP_LGen_Functions.ttcn
+++ b/src/EPTF_COAP_LGen_Functions.ttcn
@@ -14,6 +14,16 @@
// Updated: 2017-09-01
// Contact: http://ttcn.ericsson.se
///////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+// Module: EPTF_COAP_LGen_Functions
+//
+// Purpose:
+// This module contains the functions of the COAP load generator component
+//
+// See also:
+// <EPTF_COAP_LGen_Definitions>
+///////////////////////////////////////////////////////////////
module EPTF_COAP_LGen_Functions
{
import from EPTF_COAP_LGen_Definitions all;
@@ -37,10 +47,18 @@ module EPTF_COAP_LGen_Functions
import from CoAP_Types all;
import from IPL4asp_Types all;
- modulepar integer tsp_EPTF_COAP_maxToken := 65535;
- modulepar float tsp_EPTF_COAP_NON_LIFETIME := 145.0;
- modulepar float tsp_EPTF_COAP_EXCHANGE_LIFETIME := 247.0;
-
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LGen_init
+ //
+ // Purpose:
+ // The main initialization function for the <EPTF_COAP_LGen_CT> component type
+ //
+ // Parameters:
+ // pl_name - *in* *charstring* - the name for the component instance
+ //
+ // Related Type:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LGen_init(in charstring pl_name)
runs on EPTF_COAP_LGen_CT
{
@@ -83,6 +101,15 @@ module EPTF_COAP_LGen_Functions
v_COAP_initialized := true;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LGen_initLogging
+ //
+ // Purpose:
+ // Initializing CLL's logging feature on the <EPTF_COAP_LGen_CT> component type
+ //
+ // Related Type:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LGen_initLogging()
runs on EPTF_COAP_LGen_CT
{
@@ -109,6 +136,15 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_cleanUp
+ //
+ // Purpose:
+ // The main clean up function for the <EPTF_COAP_LGen_CT> component type
+ //
+ // Related Type:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_COAP_cleanUp()
runs on EPTF_COAP_LGen_CT
{
@@ -126,6 +162,22 @@ module EPTF_COAP_LGen_Functions
v_COAP_initialized := false;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_eCtxBind
+ //
+ // Purpose:
+ // This function is called by the CLL for each entity instance created on a particular instace of <EPTF_COAP_LGen_CT>
+ // The function will allocate and initialize an instance of <COAP_EntityCtx> in *v_COAP_EntityCtxDB* <COAP_EntityCtx_DB>
+ //
+ // Parameters:
+ // pl_eIdx - *in* *integer* - the index of the entity instance on this load generator component instance
+ //
+ // Returns:
+ // <EPTF_IntegerList> - The list will contain the index of the <COAP_EntityCtx> instance in the *v_COAP_EntityCtxDB*
+ //
+ // Related Type:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_COAP_eCtxBind(in integer pl_eIdx)
runs on EPTF_COAP_LGen_CT
return EPTF_IntegerList
@@ -141,6 +193,18 @@ module EPTF_COAP_LGen_Functions
return {vl_eCtxIdx};
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_eCtxUnbind
+ //
+ // Purpose:
+ // The reverse operation of <f_COAP_eCtxBind>. Cleans up resources reserved during <f_COAP_eCtxBind>. Called by the CLL.
+ //
+ // Parameters:
+ // pl_eIdx - *in* *integer* - the index of the entity instance on this load generator component instance
+ //
+ // Related Type:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_COAP_eCtxUnbind(in integer pl_eIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -151,6 +215,18 @@ module EPTF_COAP_LGen_Functions
f_EPTF_FBQ_moveFromBusyToFreeTail(vl_eCtxIdx, v_COAP_EntityCtxDB.queue);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_eCtxReset
+ //
+ // Purpose:
+ // The resources reserved during <f_COAP_eCtxBind> are reinitalized (reset). Called by the CLL.
+ //
+ // Parameters:
+ // pl_eIdx - *in* *integer* - the index of the entity instance on this load generator component instance
+ //
+ // Related Type:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_COAP_eCtxReset(in integer pl_eIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -159,6 +235,15 @@ module EPTF_COAP_LGen_Functions
v_COAP_EntityCtxDB.data[vl_eCtxIdx] := c_COAP_EntityCtx_init;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_EntityCtxDB_init
+ //
+ // Purpose:
+ // Initializes the *v_COAP_EntityCtxDB* <COAP_EntityCtx_DB> database
+ //
+ // Related Type:
+ // <COAP_EntityCtx_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_EntityCtxDB_init()
runs on EPTF_COAP_LGen_CT
{
@@ -167,6 +252,15 @@ module EPTF_COAP_LGen_Functions
v_COAP_EntityCtxDB.hashRef := f_EPTF_str2int_HashMap_New("EPTF_COAP_EnityCtxDB_Hash");
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_EntityCtxDB_cleanUp
+ //
+ // Purpose:
+ // Cleans up the reserved resources of the *v_COAP_EntityCtxDB* <COAP_EntityCtx_DB> database
+ //
+ // Related Type:
+ // <COAP_EntityCtx_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_EntityCtxDB_cleanUp()
runs on EPTF_COAP_LGen_CT
{
@@ -175,6 +269,15 @@ module EPTF_COAP_LGen_Functions
f_EPTF_str2int_HashMap_Delete("EPTF_COAP_EnityCtxDB_Hash");
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_FsmCtxDB_init
+ //
+ // Purpose:
+ // Initializes the *v_COAP_FsmCtxDB* <COAP_FsmCtx_DB> database
+ //
+ // Related Type:
+ // <COAP_FsmCtx_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_FsmCtxDB_init()
runs on EPTF_COAP_LGen_CT
{
@@ -183,6 +286,15 @@ module EPTF_COAP_LGen_Functions
v_COAP_FsmCtxDB.hashRef := f_EPTF_str2int_HashMap_New("EPTF_COAP_FsmCtxDB_Hash");
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_FsmCtxDB_cleanUp
+ //
+ // Purpose:
+ // Cleans up the reserved resources of the *v_COAP_FsmCtxDB* <COAP_FsmCtx_DB> database
+ //
+ // Related Type:
+ // <COAP_FsmCtx_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_FsmCtxDB_cleanUp()
runs on EPTF_COAP_LGen_CT
{
@@ -191,6 +303,15 @@ module EPTF_COAP_LGen_Functions
f_EPTF_str2int_HashMap_Delete("EPTF_COAP_FsmCtxDB_Hash");
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_transportEndpointDB_init
+ //
+ // Purpose:
+ // Initializes the *v_COAP_transportEndpointDB* <COAP_TransportEndpointDB> database
+ //
+ // Related Type:
+ // <COAP_TransportEndpointDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_transportEndpointDB_init()
runs on EPTF_COAP_LGen_CT
{
@@ -199,6 +320,15 @@ module EPTF_COAP_LGen_Functions
v_COAP_transportEndpointDB.hashRef := f_EPTF_str2int_HashMap_New("EPTF_COAP_addressDB_Hash");
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_transportEndpointDB_cleanUp
+ //
+ // Purpose:
+ // Cleans up the reserved resources of the *v_COAP_transportEndpointDB* <COAP_TransportEndpointDB> database
+ //
+ // Related Type:
+ // <COAP_TransportEndpointDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_transportEndpointDB_cleanUp()
runs on EPTF_COAP_LGen_CT
{
@@ -207,6 +337,21 @@ module EPTF_COAP_LGen_Functions
f_EPTF_str2int_HashMap_Delete("EPTF_COAP_addressDB_Hash");
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_transportEndpointDB_add
+ //
+ // Purpose:
+ // Adds a new element to the *v_COAP_transportEndpointDB* <COAP_TransportEndpointDB> database
+ //
+ // Parameters:
+ // p_te - *in* <COAP_TransportEndpoint> - the element to be added
+ //
+ // Returns:
+ // p_idx - *out* *integer* - the index of the added element in the database
+ //
+ // Related Type:
+ // <COAP_TransportEndpointDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_transportEndpointDB_add(in COAP_TransportEndpoint p_te, inout integer p_idx)
runs on EPTF_COAP_LGen_CT
{
@@ -222,6 +367,21 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_transportEndpointDB_get
+ //
+ // Purpose:
+ // Retrieves an element from the *v_COAP_transportEndpointDB* <COAP_TransportEndpointDB> database
+ //
+ // Parameters:
+ // p_idx - *in* *integer* - the index of the element to retrieved
+ //
+ // Returns:
+ // p_te - *inout* <COAP_TransportEndpoint> - the retrieved element
+ //
+ // Related Type:
+ // <COAP_TransportEndpointDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_transportEndpointDB_get(inout COAP_TransportEndpoint p_te, in integer p_idx)
runs on EPTF_COAP_LGen_CT
{
@@ -231,6 +391,22 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_transportEndpointDB_lookUp
+ //
+ // Purpose:
+ // Gets the index of an <COAP_TransportEndpoint> element in *v_COAP_transportEndpointDB* <COAP_TransportEndpointDB> database
+ // based on its socket member field
+ //
+ // Parameters:
+ // p_te - *in* <COAP_TransportEndpoint> - the retrieved element
+ //
+ // Returns:
+ // *integer* - the index of the element, or -1 if not found
+ //
+ // Related Type:
+ // <COAP_TransportEndpointDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_transportEndpointDB_lookUp(in COAP_TransportEndpoint p_te)
runs on EPTF_COAP_LGen_CT
return integer
@@ -240,12 +416,36 @@ module EPTF_COAP_LGen_Functions
return vl_idx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_transportEndpointDB_Socket2String
+ //
+ // Purpose:
+ // Hash function for lookups used by the *v_COAP_transportEndpointDB* <COAP_TransportEndpointDB> database
+ //
+ // Parameters:
+ // p_sock - *in* <Socket> - the address (of a <COAP_TransportEndpoint>)
+ //
+ // Returns:
+ // *charstring* - string hash unique for the <Socket> parameter
+ //
+ // Related Type:
+ // <COAP_TransportEndpointDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_transportEndpointDB_Socket2String(Socket p_sock)
return charstring
{
return p_sock.hostName&":"&int2str(p_sock.portNumber);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_rrDB_init
+ //
+ // Purpose:
+ // Initializes the *v_COAP_rrDB* <COAP_RR_DB> database
+ //
+ // Related Type:
+ // <COAP_RR_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_rrDB_init()
runs on EPTF_COAP_LGen_CT
{
@@ -254,6 +454,21 @@ module EPTF_COAP_LGen_Functions
v_COAP_rrDB.hashRef := f_EPTF_str2int_HashMap_New("v_COAP_rrDB");
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_rrDB_add
+ //
+ // Purpose:
+ // Adds a new element to the *v_COAP_rrDB* <COAP_RR_DB> database
+ //
+ // Parameters:
+ // p_rr - *in* <COAP_RR> - the element to be added
+ //
+ // Returns:
+ // *integer* - the index of the added element in the database
+ //
+ // Related Type:
+ // <COAP_RR_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_rrDB_add(in COAP_RR p_rr)
runs on EPTF_COAP_LGen_CT
return integer
@@ -270,6 +485,23 @@ module EPTF_COAP_LGen_Functions
return v_idx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_rrDB_lookUp
+ //
+ // Purpose:
+ // Gets the index of an <COAP_RR> element in *v_COAP_rrDB* <COAP_RR_DB> database
+ //
+ // Parameters:
+ // p_rr - *in* <Socket> - the socket (IP) address
+ // p_token - *in* *octetstring* - the token value
+ //
+ //
+ // Returns:
+ // *integer* - the index of the added element in the database, or -1 if not found
+ //
+ // Related Type:
+ // <COAP_RR_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_rrDB_lookUp(in Socket p_sock, in octetstring p_token)
runs on EPTF_COAP_LGen_CT
return integer
@@ -279,6 +511,21 @@ module EPTF_COAP_LGen_Functions
return vl_idx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_rrDB_get
+ //
+ // Purpose:
+ // Retrieves an element from the *v_COAP_rrDB* <COAP_RR> database
+ //
+ // Parameters:
+ // p_idx - *in* *integer* - the index of the element to be retrieved
+ //
+ // Returns:
+ // p_rr - *inout* <COAP_RR> - the retrieved element
+ //
+ // Related Type:
+ // <COAP_RR_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_rrDB_get(in integer p_idx, inout COAP_RR p_rr)
runs on EPTF_COAP_LGen_CT
{
@@ -288,6 +535,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_rrDB_remove
+ //
+ // Purpose:
+ // Removes an element from the *v_COAP_rrDB* <COAP_RR> database and frees up its reserved resources
+ //
+ // Parameters:
+ // p_idx - *in* *integer* - the index of the element to be removed
+ //
+ // Related Type:
+ // <COAP_RR_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_rrDB_remove(in integer p_idx)
runs on EPTF_COAP_LGen_CT
{
@@ -297,6 +556,15 @@ module EPTF_COAP_LGen_Functions
f_EPTF_FBQ_moveFromBusyToFreeTail(p_idx, v_COAP_rrDB.queue);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_rrDB_cleanUp
+ //
+ // Purpose:
+ // Cleans up the reserved resources of the *v_COAP_rrDB* <COAP_RR_DB> database
+ //
+ // Related Type:
+ // <COAP_RR_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_rrDB_cleanUp()
runs on EPTF_COAP_LGen_CT
{
@@ -305,12 +573,37 @@ module EPTF_COAP_LGen_Functions
f_EPTF_str2int_HashMap_Delete("v_COAP_rrDB");
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_rrDB_tokenHash
+ //
+ // Purpose:
+ // Hash function for lookups used by the *v_COAP_rrDB* <COAP_RR_DB> database
+ //
+ // Parameters:
+ // p_sock - *in* <Socket> - the address (of a <COAP_TransportEndpoint>)
+ // p_token - *in* *octetstring* - the token value
+ //
+ // Returns:
+ // *charstring* - string hash unique for a <COAP_RR> element
+ //
+ // Related Type:
+ // <COAP_RR_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_rrDB_tokenHash(in Socket p_sock, in octetstring p_token)
return charstring
{
return oct2str(p_token)&":"&p_sock.hostName&":"&int2str(p_sock.portNumber);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_observationDB_init
+ //
+ // Purpose:
+ // Initializes the *v_COAP_observationDB* <COAP_Observation_DB> database
+ //
+ // Related Type:
+ // <COAP_Observation_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_observationDB_init()
runs on EPTF_COAP_LGen_CT
{
@@ -319,6 +612,21 @@ module EPTF_COAP_LGen_Functions
v_COAP_observationDB.hashRef := f_EPTF_str2int_HashMap_New("v_COAP_observationDB");
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_observationDB_add
+ //
+ // Purpose:
+ // Adds a new element to the *v_COAP_observationDB* <COAP_Observation_DB> database
+ //
+ // Parameters:
+ // p_os - *in* <COAP_Observation_Server> - the element to be added
+ //
+ // Returns:
+ // *integer* - the index of the added element in the database
+ //
+ // Related Type:
+ // <COAP_Observation_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_observationDB_add(in COAP_Observation_Server p_os)
runs on EPTF_COAP_LGen_CT
return integer
@@ -335,7 +643,25 @@ module EPTF_COAP_LGen_Functions
return v_idx;
}
-
+
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_observationDB_lookUp
+ //
+ // Purpose:
+ // Gets the index of an <COAP_Observation_Server> element in *v_COAP_observationDB* <COAP_Observation_DB> database
+ //
+ // Parameters:
+ // p_remoteAddr - *in* *charstring* - the address (host) of the observer
+ // p_remotePort - *in* *integer* - the port of the observer
+ // p_resId - *in* *charstring* - the id of the observed resource
+ //
+ //
+ // Returns:
+ // *integer* - the index of the added element in the database, or -1 if not found
+ //
+ // Related Type:
+ // <COAP_Observation_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_observationDB_lookUp(in charstring p_remoteAddr, in integer p_remotePort, in charstring p_resId)
runs on EPTF_COAP_LGen_CT
return integer
@@ -348,6 +674,21 @@ module EPTF_COAP_LGen_Functions
return vl_idx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_observationDB_get
+ //
+ // Purpose:
+ // Retrieves an element from the *v_COAP_observationDB* <COAP_Observation_DB> database
+ //
+ // Parameters:
+ // p_idx - *in* *integer* - the index of the element to be retrieved
+ //
+ // Returns:
+ // p_os - *inout* <COAP_Observation_Server> - the retrieved element
+ //
+ // Related Type:
+ // <COAP_Observation_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_observationDB_get(in integer p_idx, inout COAP_Observation_Server p_os)
runs on EPTF_COAP_LGen_CT
{
@@ -357,6 +698,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_observationDB_remove
+ //
+ // Purpose:
+ // Removes an element from the *v_COAP_observationDB* <COAP_Observation_DB> database and frees up its reserved resources
+ //
+ // Parameters:
+ // p_idx - *in* *integer* - the index of the element to be removed
+ //
+ // Related Type:
+ // <COAP_Observation_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_observationDB_remove(in integer p_idx)
runs on EPTF_COAP_LGen_CT
{
@@ -373,6 +726,15 @@ module EPTF_COAP_LGen_Functions
f_EPTF_FBQ_moveFromBusyToFreeTail(p_idx, v_COAP_observationDB.queue);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_observationDB_cleanUp
+ //
+ // Purpose:
+ // Cleans up the reserved resources of the *v_COAP_observationDB* <COAP_Observation_DB> database
+ //
+ // Related Type:
+ // <COAP_Observation_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_observationDB_cleanUp()
runs on EPTF_COAP_LGen_CT
{
@@ -381,12 +743,38 @@ module EPTF_COAP_LGen_Functions
f_EPTF_str2int_HashMap_Delete("v_COAP_observationDB");
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_observationDB_tokenHash
+ //
+ // Purpose:
+ // Hash function for lookups used by the *v_COAP_rrDB* <COAP_RR_DB> database
+ //
+ // Parameters:
+ // p_remoteAddr - *in* *charstring* - the address (host) of the observer
+ // p_remotePort - *in* *integer* - the port of the observer
+ // p_resId - *in* *charstring* - the id of the observed resource
+ //
+ // Returns:
+ // *charstring* - string hash unique of a <COAP_Observation_Server> element
+ //
+ // Related Type:
+ // <COAP_RR_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_observationDB_tokenHash(in charstring p_remoteAddr, in integer p_remotePort, in charstring p_resId)
return charstring
{
return p_remoteAddr&":"&int2str(p_remotePort)&p_resId;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_trDB_init
+ //
+ // Purpose:
+ // Initializes the *v_COAP_trDB* <COAP_Transaction_DB> database
+ //
+ // Related Type:
+ // <COAP_Transaction_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_trDB_init()
runs on EPTF_COAP_LGen_CT
{
@@ -396,6 +784,21 @@ module EPTF_COAP_LGen_Functions
v_COAP_trDB.hashRefIncoming := f_EPTF_str2int_HashMap_New("v_COAP_incTrDB");
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_trDB_add
+ //
+ // Purpose:
+ // Adds a new element to the *v_COAP_trDB* <COAP_Transaction_DB> database
+ //
+ // Parameters:
+ // p_tr - *in* <COAP_Transaction> - the element to be added
+ //
+ // Returns:
+ // *integer* - the index of the added element in the database
+ //
+ // Related Type:
+ // <COAP_Transaction_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_trDB_add(in COAP_Transaction p_tr)
runs on EPTF_COAP_LGen_CT
return integer
@@ -418,6 +821,24 @@ module EPTF_COAP_LGen_Functions
return v_idx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_trDB_lookUp
+ //
+ // Purpose:
+ // Gets the index of an <COAP_Transaction> element in *v_COAP_trDB* <COAP_Transaction_DB> database
+ //
+ // Parameters:
+ // p_sock - *in* <Socket> - the local address of a <COAP_Transaction>
+ // p_mid - *in* *integer* - the message id of the <COAP_Transaction>
+ // p_dir - *in* <COAP_Transaction_Direction> - the direction of the <COAP_Transaction>
+ //
+ //
+ // Returns:
+ // *integer* - the index of the added element in the database, or -1 if not found
+ //
+ // Related Type:
+ // <COAP_Transaction_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_trDB_lookUp(in Socket p_sock, in integer p_mid, COAP_Transaction_Direction p_dir)
runs on EPTF_COAP_LGen_CT
return integer
@@ -436,6 +857,21 @@ module EPTF_COAP_LGen_Functions
return vl_idx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_trDB_get
+ //
+ // Purpose:
+ // Retrieves an element from the *v_COAP_trDB* <COAP_Transaction_DB> database
+ //
+ // Parameters:
+ // p_idx - *in* *integer* - the index of the element to be retrieved
+ //
+ // Returns:
+ // p_os - *inout* <COAP_Transaction> - the retrieved element
+ //
+ // Related Type:
+ // <COAP_Transaction_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_trDB_get(in integer p_idx, inout COAP_Transaction p_tr)
runs on EPTF_COAP_LGen_CT
{
@@ -445,6 +881,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_trDB_remove
+ //
+ // Purpose:
+ // Removes an element from the *v_COAP_trDB* <COAP_Transaction_DB> database and frees up its reserved resources
+ //
+ // Parameters:
+ // p_idx - *in* *integer* - the index of the element to be removed
+ //
+ // Related Type:
+ // <COAP_Transaction_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_trDB_remove(in integer p_idx)
runs on EPTF_COAP_LGen_CT
{
@@ -461,6 +909,15 @@ module EPTF_COAP_LGen_Functions
f_EPTF_FBQ_moveFromBusyToFreeTail(p_idx, v_COAP_trDB.queue);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_trDB_cleanUp
+ //
+ // Purpose:
+ // Cleans up the reserved resources of the *v_COAP_trDB* <COAP_Transaction_DB> database
+ //
+ // Related Type:
+ // <COAP_Transaction_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_trDB_cleanUp()
runs on EPTF_COAP_LGen_CT
{
@@ -470,12 +927,37 @@ module EPTF_COAP_LGen_Functions
f_EPTF_str2int_HashMap_Delete("v_COAP_incTrDB");
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_trDB_midHash
+ //
+ // Purpose:
+ // Hash function for lookups used by the *v_COAP_trDB* <COAP_Transaction_DB> database
+ //
+ // Parameters:
+ // p_sock - *in* <Socket> - the local address of a <COAP_Transaction>
+ // p_mid - *in* *integer* - the message id of the <COAP_Transaction>
+ //
+ // Returns:
+ // *charstring* - string hash unique of a <COAP_Transaction> element
+ //
+ // Related Type:
+ // <COAP_Transaction_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_trDB_midHash(in Socket p_sock, in integer p_mid)
return charstring
{
return int2str(p_mid)&":"&p_sock.hostName&":"&int2str(p_sock.portNumber);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_observedResourceDB_init
+ //
+ // Purpose:
+ // Initializes the *v_COAP_observedResourceDB* <COAP_ObservedResource_DB> database
+ //
+ // Related Type:
+ // <COAP_ObservedResource_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_observedResourceDB_init()
runs on EPTF_COAP_LGen_CT
{
@@ -484,6 +966,21 @@ module EPTF_COAP_LGen_Functions
v_COAP_observedResourceDB.hashRef := f_EPTF_str2int_HashMap_New("EPTF_COAP_observedResourceDB_Hash");
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_observedResourceDB_add
+ //
+ // Purpose:
+ // Adds a new element to the *v_COAP_observedResourceDB* <COAP_ObservedResource_DB> database
+ //
+ // Parameters:
+ // p_or - *in* <COAP_ObservedResource> - the element to be added
+ //
+ // Returns:
+ // *integer* - the index of the added element in the database
+ //
+ // Related Type:
+ // <COAP_ObservedResource_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_observedResourceDB_add(in COAP_ObservedResource p_or)
runs on EPTF_COAP_LGen_CT
return integer
@@ -510,6 +1007,24 @@ module EPTF_COAP_LGen_Functions
return v_idx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_observedResourceDB_lookUp
+ //
+ // Purpose:
+ // Gets the index of an <COAP_ObservedResource> element in *v_COAP_observedResourceDB* <COAP_ObservedResource_DB> database
+ //
+ // Parameters:
+ // p_localAddr - *in* *charstring* - the local address of a <COAP_ObservedResource>
+ // p_localPort - *in* *integer* - the local port of the <COAP_ObservedResource>
+ // p_resourceId - *in* *charstring* - the resource id of the <COAP_ObservedResource>
+ //
+ //
+ // Returns:
+ // *integer* - the index of the added element in the database, or -1 if not found
+ //
+ // Related Type:
+ // <COAP_ObservedResource_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_observedResourceDB_lookUp(in charstring p_localAddr, in integer p_localPort, in charstring p_resourceId)
runs on EPTF_COAP_LGen_CT
return integer
@@ -527,6 +1042,21 @@ module EPTF_COAP_LGen_Functions
return vl_idx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_observedResourceDB_get
+ //
+ // Purpose:
+ // Retrieves an element from the *v_COAP_observedResourceDB* <COAP_ObservedResource_DB> database
+ //
+ // Parameters:
+ // p_idx - *in* *integer* - the index of the element to be retrieved
+ //
+ // Returns:
+ // p_or - *inout* <COAP_ObservedResource> - the retrieved element
+ //
+ // Related Type:
+ // <COAP_ObservedResource_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_observedResourceDB_get(in integer p_idx, inout COAP_ObservedResource p_or)
runs on EPTF_COAP_LGen_CT
{
@@ -536,6 +1066,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_observedResourceDB_remove
+ //
+ // Purpose:
+ // Removes an element from the *v_COAP_observedResourceDB* <COAP_ObservedResource_DB> database and frees up its reserved resources
+ //
+ // Parameters:
+ // p_idx - *in* *integer* - the index of the element to be removed
+ //
+ // Related Type:
+ // <COAP_ObservedResource_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_observedResourceDB_remove(in integer p_idx)
runs on EPTF_COAP_LGen_CT
{
@@ -552,6 +1094,15 @@ module EPTF_COAP_LGen_Functions
f_EPTF_FBQ_moveFromBusyToFreeTail(p_idx, v_COAP_observedResourceDB.queue);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_observedResourceDB_cleanUp
+ //
+ // Purpose:
+ // Cleans up the reserved resources of the *v_COAP_observedResourceDB* <COAP_ObservedResource_DB> database
+ //
+ // Related Type:
+ // <COAP_ObservedResource_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_observedResourceDB_cleanUp()
runs on EPTF_COAP_LGen_CT
{
@@ -566,6 +1117,15 @@ module EPTF_COAP_LGen_Functions
return p_localAddr&":"&int2str(p_localPort)&p_resourceId;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_templateDB_init
+ //
+ // Purpose:
+ // Initializes the *v_COAP_templateDB* <COAP_Template_DB> database by adding the templates given in <tsp_EPTF_COAP_LGen_templates>
+ //
+ // Related Type:
+ // <COAP_Template_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_templateDB_init()
runs on EPTF_COAP_LGen_CT
{
@@ -577,6 +1137,21 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_templateDB_add
+ //
+ // Purpose:
+ // Adds a new element to the *v_COAP_templateDB* <COAP_Template_DB> database
+ //
+ // Parameters:
+ // p_template - *in* <CoAP_Template> - the element to be added
+ //
+ // Returns:
+ // *integer* - the index of the added element in the database
+ //
+ // Related Type:
+ // <COAP_Template_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_templateDB_add(in CoAP_Template p_template)
runs on EPTF_COAP_LGen_CT
return integer
@@ -596,6 +1171,21 @@ module EPTF_COAP_LGen_Functions
return v_idx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_templateDB_lookUp
+ //
+ // Purpose:
+ // Gets the index of an <CoAP_Template> element in *v_COAP_templateDB* <COAP_Template_DB> database
+ //
+ // Parameters:
+ // p_id - *in* *charstring* - the id of the <CoAP_Template>
+ //
+ // Returns:
+ // *integer* - the index of the added element in the database, or -1 if not found
+ //
+ // Related Type:
+ // <COAP_Template_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_templateDB_lookUp(in charstring p_id)
runs on EPTF_COAP_LGen_CT
return integer
@@ -609,6 +1199,21 @@ module EPTF_COAP_LGen_Functions
return vl_idx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_templateDB_get
+ //
+ // Purpose:
+ // Retrieves an element from the *v_COAP_templateDB* <COAP_Template_DB> database
+ //
+ // Parameters:
+ // p_idx - *in* *integer* - the index of the element to be retrieved
+ //
+ // Returns:
+ // p_or - *inout* <CoAP_ReqResp> - the retrieved element
+ //
+ // Related Type:
+ // <COAP_Template_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_templateDB_get(in integer p_idx, inout CoAP_ReqResp p_pdu)
runs on EPTF_COAP_LGen_CT
{
@@ -619,6 +1224,15 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_templateDB_cleanUp
+ //
+ // Purpose:
+ // Cleans up the reserved resources of the *v_COAP_templateDB* <COAP_Template_DB> database
+ //
+ // Related Type:
+ // <COAP_Template_DB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_templateDB_cleanUp()
runs on EPTF_COAP_LGen_CT
{
@@ -626,6 +1240,21 @@ module EPTF_COAP_LGen_Functions
f_EPTF_str2int_HashMap_Delete("EPTF_COAP_templateDB_Hash");
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_getNextMID
+ //
+ // Purpose:
+ // Generate the next unused message id for an entity
+ //
+ // Parameters:
+ // p_ctx - *in* <COAP_StepCtx> - pointers for the instances related to a particular simulated entity
+ //
+ // Returns:
+ // *integer* - the generated message id
+ //
+ // Related Type:
+ // <COAP_EntityCtx>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_getNextMID(in COAP_StepCtx p_ctx)
runs on EPTF_COAP_LGen_CT
return integer
@@ -641,6 +1270,21 @@ module EPTF_COAP_LGen_Functions
return v_COAP_EntityCtxDB.data[p_ctx.eCtxIdx].nextMID;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_getNextToken
+ //
+ // Purpose:
+ // Generate the next unused token for an entity
+ //
+ // Parameters:
+ // p_ctx - *in* <COAP_StepCtx> - pointers for the instances related to a particular simulated entity
+ //
+ // Returns:
+ // *octetstring* - the generated token identifier
+ //
+ // Related Type:
+ // <COAP_EntityCtx>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_getNextToken(in COAP_StepCtx p_ctx)
runs on EPTF_COAP_LGen_CT
return octetstring
@@ -656,6 +1300,22 @@ module EPTF_COAP_LGen_Functions
return int2oct(v_COAP_EntityCtxDB.data[p_ctx.eCtxIdx].nextToken, 4);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LGen_receiveMessage
+ //
+ // Purpose:
+ // The transport layer implementation <EPTF_COAP_Transport_Provider_CT> can report received <EPTF_COAP_PDU> message
+ // to the load generator layer <EPTF_COAP_Transport_User_CT> extended by <EPTF_COAP_LGen_CT> using this function.
+ //
+ // Parameters:
+ // pl_message - *in* <EPTF_COAP_PDU> - received message
+ //
+ // Related Types:
+ // - <EPTF_COAP_LGen_CT>
+ // - <fcb_EPTF_COAP_Transport_receiveMessage>
+ // - <EPTF_COAP_Transport_Provider_CT>
+ // - <EPTF_COAP_Transport_User_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LGen_receiveMessage(in EPTF_COAP_PDU pl_message)
runs on EPTF_COAP_LGen_CT
{
@@ -671,12 +1331,44 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LGen_receiveEvent
+ //
+ // Purpose:
+ // The transport layer implementation <EPTF_COAP_Transport_Provider_CT> can report received <ASP_Event> events
+ // to the load generator layer <EPTF_COAP_Transport_User_CT> extended by <EPTF_COAP_LGen_CT> using this function.
+ //
+ // Parameters:
+ // pl_message - *in* <ASP_Event> - received event
+ //
+ // Related Types:
+ // - <EPTF_COAP_LGen_CT>
+ // - <fcb_EPTF_COAP_Transport_receiveEvent>
+ // - <EPTF_COAP_Transport_Provider_CT>
+ // - <EPTF_COAP_Transport_User_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LGen_receiveEvent(in ASP_Event p_event)
runs on EPTF_COAP_LGen_CT
{
f_EPTF_COAP_Logging_VERBOSE(log2str(%definitionId, " ", p_event));
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LGen_transportApiResponse
+ //
+ // Purpose:
+ // The transport layer implementation <EPTF_COAP_Transport_Provider_CT> can report received <EPTF_COAP_Transport_Response> responses
+ // to the load generator layer <EPTF_COAP_Transport_User_CT> extended by <EPTF_COAP_LGen_CT> using this function.
+ //
+ // Parameters:
+ // pl_rsp - *in* <EPTF_COAP_Transport_Response> - received transport api response
+ //
+ // Related Types:
+ // - <EPTF_COAP_LGen_CT>
+ // - <fcb_EPTF_COAP_Transport_apiResponse>
+ // - <EPTF_COAP_Transport_Provider_CT>
+ // - <EPTF_COAP_Transport_User_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LGen_transportApiResponse(in EPTF_COAP_Transport_Response pl_rsp)
runs on EPTF_COAP_LGen_CT
{
@@ -699,6 +1391,20 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_stack_fromApp
+ //
+ // Purpose:
+ // This is the main entry point for the COAP stack realization of the <EPTF_COAP_LGen_CT>
+ // component that handles messages received from the application layer (e.g. FSMs)
+ //
+ // Parameters:
+ // p_msg - *inout* <EPTF_COAP_PDU> - message that enters into the stack (will be modified by the stack)
+ // p_ctx - *in* <COAP_StepCtx> - pointers for the instances related to a particular simulated entity
+ //
+ // Related Types:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_stack_fromApp(inout EPTF_COAP_PDU p_msg, in COAP_StepCtx p_ctx)
runs on EPTF_COAP_LGen_CT
{
@@ -730,6 +1436,22 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_stack_fromEnv
+ //
+ // Purpose:
+ // This is the main entry point for the COAP stack realization of the <EPTF_COAP_LGen_CT>
+ // component that handles messages received from the environment layer (e.g. transport layer)
+ //
+ // Parameters:
+ // p_msg - *inout* <EPTF_COAP_PDU> - message that enters into the stack (will be modified by the stack)
+ //
+ // Returns:
+ // *boolean* - true, if the *p_msg* message was a duplicate, false if it was not
+ //
+ // Related Types:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_stack_fromEnv(inout EPTF_COAP_PDU p_msg)
runs on EPTF_COAP_LGen_CT
return boolean
@@ -779,6 +1501,47 @@ module EPTF_COAP_LGen_Functions
}
}
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Functions.COAP_RR_Server.jpg
+ [*] --> IDLE
+ IDLE --> SERVING: appIn: request CON
+ IDLE --> SEPARATE: appIn: request NON
+ SERVING --> REMOVING: appIn: response
+ SERVING --> REMOVING: appIn: empty ACK
+ SEPARATE --> REMOVING: appIn: response
+ REMOVING --> [*]
+ @enduml
+ ******************************************************************/
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Functions.COAP_RR_Client.jpg
+ [*] --> IDLE
+ IDLE --> WAITING: appIn: request
+ WAITING --> REMOVING: appIn: cancel
+ WAITING --> REMOVING: trIn: timeout
+ WAITING --> REMOVING: trIn: reset
+ WAITING --> REMOVING: trIn: response
+ REMOVING --> [*]
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_rr_handleMsg
+ //
+ // Purpose:
+ // This function implements a COAP request-response state machine
+ //
+ // Parameters:
+ // p_msg - *inout* <EPTF_COAP_PDU> - message that enters into the stack (will be modified by the stack)
+ // p_rrIdx - *in* *integer* - index of the <COAP_RR> in the <COAP_RR_DB> that will handle the message
+ //
+ // Related Types:
+ // <COAP_RR>
+ //
+ // FSM Diagram of client request-response:
+ // (see EPTF_COAP_LGen_Functions.COAP_RR_Client.jpg)
+ //
+ // FSM Diagram of server request-response:
+ // (see EPTF_COAP_LGen_Functions.COAP_RR_Server.jpg)
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_rr_handleMsg(inout EPTF_COAP_PDU p_msg, in integer p_rrIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1077,6 +1840,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_rr_reset
+ //
+ // Purpose:
+ // This function handles the *reset* event of a <COAP_RR> state machine
+ //
+ // Parameters:
+ // p_rrIdx - *in* *integer* - index of the <COAP_RR> in the <COAP_RR_DB> that will handle the message
+ //
+ // Related Types:
+ // <COAP_RR>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_rr_reset(in integer p_rrIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1107,6 +1882,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_rr_timeout
+ //
+ // Purpose:
+ // This function handles the *timeout* event of a <COAP_RR> state machine
+ //
+ // Parameters:
+ // p_rrIdx - *in* *integer* - index of the <COAP_RR> in the <COAP_RR_DB> that will handle the message
+ //
+ // Related Types:
+ // <COAP_RR>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_rr_timeout(in integer p_rrIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1137,6 +1924,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_rr_cancel
+ //
+ // Purpose:
+ // This function handles the *cancel* event of a <COAP_RR> state machine
+ //
+ // Parameters:
+ // p_rrIdx - *in* *integer* - index of the <COAP_RR> in the <COAP_RR_DB> that will handle the message
+ //
+ // Related Types:
+ // <COAP_RR>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_rr_cancel(in integer p_rrIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1170,6 +1969,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_rr_remove
+ //
+ // Purpose:
+ // This function handles the removal and clean up of a <COAP_RR> state machine instance from the DB
+ //
+ // Parameters:
+ // p_rrIdx - *in* *integer* - index of the <COAP_RR> in the <COAP_RR_DB>
+ //
+ // Related Types:
+ // <COAP_RR>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_rr_remove(in integer p_rrIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1205,6 +2016,19 @@ module EPTF_COAP_LGen_Functions
f_EPTF_COAP_rrDB_remove(p_rrIdx);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_rr_setState
+ //
+ // Purpose:
+ // This function sets the current state of a <COAP_RR> state machine instance
+ //
+ // Parameters:
+ // p_rrIdx - *in* *integer* - index of the <COAP_RR> in the <COAP_RR_DB> that will handle the message
+ // p_nextState - *in* <COAP_RR_State> - next state of the state machine
+ //
+ // Related Types:
+ // <COAP_RR>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_rr_setState(in integer p_rrIdx, in COAP_RR_State p_nextState)
runs on EPTF_COAP_LGen_CT
{
@@ -1214,6 +2038,42 @@ module EPTF_COAP_LGen_Functions
f_EPTF_COAP_Logging_VERBOSE(log2str("rr [", v_COAP_rrDB.data[p_rrIdx].token,"] next state: ", v_COAP_rrDB.data[p_rrIdx].state));
}
+ /*****************************************************************
+ @startuml EPTF_COAP_LGen_Functions.COAP_Transaction.jpg
+ [*] --> CLOSED
+ CLOSED --> CLOSED: envIn: NON
+ CLOSED --> CLOSED: rrIn: NON
+ CLOSED --> CLOSED: envIn: RST
+ CLOSED --> REMOVING: T_lifetime
+ CLOSED --> REMOVING: rrIn: ACK
+ CLOSED --> RELIABLE_TX: rrIn: CON
+ RELIABLE_TX --> CLOSED: envIn: ACK
+ RELIABLE_TX --> CLOSED: envIn: RST
+ RELIABLE_TX --> CLOSED: rrIn: CANCEL
+ RELIABLE_TX --> RELIABLE_TX: T_retransmit
+ RELIABLE_TX --> REMOVING: T_lifetime
+ ACK_PENDING --> CLOSED: rrIn: ACK
+ ACK_PENDING --> CLOSED: rrIn: RST
+ ACK_PENDING --> REMOVING: T_lifetime
+ REMOVING --> [*]
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_tr_fromRR
+ //
+ // Purpose:
+ // This function implements a COAP request-response state machine by handling the incoming message from a <COAP_RR>
+ //
+ // Parameters:
+ // p_msg - *inout* <EPTF_COAP_PDU> - message that enters into the transaction (will be modified by the stack)
+ // p_trIdx - *in* *integer* - index of the <COAP_Transaction> instance in the <COAP_Transaction_DB> that will handle the message
+ //
+ // Related Types:
+ // <COAP_Transaction>
+ //
+ // FSM Diagram of a COAP transaction:
+ // (see EPTF_COAP_LGen_Functions.COAP_Transaction.jpg)
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_tr_fromRR(inout EPTF_COAP_PDU p_msg, in integer p_trIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1294,6 +2154,22 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_tr_fromEnv
+ //
+ // Purpose:
+ // This function implements a COAP request-response state machine by handling the incoming message from a <COAP_RR>
+ //
+ // Parameters:
+ // p_msg - *inout* <EPTF_COAP_PDU> - message that enters into the transaction (will be modified by the stack)
+ // p_trIdx - *in* *integer* - index of the <COAP_Transaction> instance in the <COAP_Transaction_DB> that will handle the message
+ //
+ // Related Types:
+ // <COAP_Transaction>
+ //
+ // FSM Diagram of a COAP transaction:
+ // (see EPTF_COAP_LGen_Functions.COAP_Transaction.jpg)
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_tr_fromEnv(inout EPTF_COAP_PDU p_msg, in integer p_trIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1432,6 +2308,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_tr_cancel
+ //
+ // Purpose:
+ // This function handles the *cancel* event of a <COAP_Transaction> state machine instance
+ //
+ // Parameters:
+ // p_trIdx - *in* *integer* - index of the <COAP_Transaction> in the <COAP_Transaction_DB> that will handle the event
+ //
+ // Related Types:
+ // <COAP_Transaction>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_tr_cancel(in integer p_trIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1450,6 +2338,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_tr_lifetime
+ //
+ // Purpose:
+ // This function handles the *T_lifetime* timer's timeout event of a <COAP_Transaction> state machine instance
+ //
+ // Parameters:
+ // pl_action - *in* <EPTF_ScheduledAction> - contains the index of the <COAP_Transaction> in the <COAP_Transaction_DB> that will handle the event
+ //
+ // Related Types:
+ // <COAP_Transaction>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_tr_lifetime(in EPTF_ScheduledAction pl_action, in integer pl_eventIndex)
runs on EPTF_COAP_LGen_CT
return boolean
@@ -1475,6 +2375,18 @@ module EPTF_COAP_LGen_Functions
return true;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_tr_retransmit
+ //
+ // Purpose:
+ // This function handles the *T_retransmit* timer's timeout event of a <COAP_Transaction> state machine instance
+ //
+ // Parameters:
+ // pl_action - *in* <EPTF_ScheduledAction> - contains the index of the <COAP_Transaction> in the <COAP_Transaction_DB> that will handle the event
+ //
+ // Related Types:
+ // <COAP_Transaction>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_tr_retransmit(in EPTF_ScheduledAction pl_action, in integer pl_eventIndex)
runs on EPTF_COAP_LGen_CT
return boolean
@@ -1498,6 +2410,18 @@ module EPTF_COAP_LGen_Functions
return true;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_tr_startT_retransmit
+ //
+ // Purpose:
+ // This function starts the *T_retransmit* timer of a particular <COAP_Transaction> instance
+ //
+ // Parameters:
+ // p_trIdx - *in* *integer* - index of the <COAP_Transaction> in the <COAP_Transaction_DB> that will start the timer
+ //
+ // Related Types:
+ // <COAP_Transaction>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_tr_startT_retransmit(in integer pl_trIdx)
runs on EPTF_COAP_LGen_CT
return boolean
@@ -1521,6 +2445,18 @@ module EPTF_COAP_LGen_Functions
return retval;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_tr_cancelT_retransmit
+ //
+ // Purpose:
+ // This function cancels the *T_retransmit* timer of a particular <COAP_Transaction> instance
+ //
+ // Parameters:
+ // p_trIdx - *in* *integer* - index of the <COAP_Transaction> in the <COAP_Transaction_DB> that will cancel the timer
+ //
+ // Related Types:
+ // <COAP_Transaction>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_tr_cancelT_retransmit(in integer pl_trIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1534,6 +2470,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_tr_startT_lifetime
+ //
+ // Purpose:
+ // This function starts the *T_lifetime* timer of a particular <COAP_Transaction> instance
+ //
+ // Parameters:
+ // p_trIdx - *in* *integer* - index of the <COAP_Transaction> in the <COAP_Transaction_DB> that will start the timer
+ //
+ // Related Types:
+ // <COAP_Transaction>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_tr_startT_lifetime(in integer pl_trIdx, in float pl_time)
runs on EPTF_COAP_LGen_CT
return boolean
@@ -1553,6 +2501,18 @@ module EPTF_COAP_LGen_Functions
return retval;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_tr_cancelT_lifetime
+ //
+ // Purpose:
+ // This function cancels the *T_lifetime* timer of a particular <COAP_Transaction> instance
+ //
+ // Parameters:
+ // p_trIdx - *in* *integer* - index of the <COAP_Transaction> in the <COAP_Transaction_DB> that will cancel the timer
+ //
+ // Related Types:
+ // <COAP_Transaction>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_tr_cancelT_lifetime(in integer pl_trIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1566,6 +2526,20 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_tr_send
+ //
+ // Purpose:
+ // This function is used to send out a message from an instance of a <COAP_Transaction> using the registered
+ // function <fcb_EPTF_COAP_Transport_sendMessage> of the underlying transport layer instance.
+ //
+ // Parameters:
+ // p_msg - *intout* <EPTF_COAP_PDU> - the message to be sent
+ // p_trIdx - *in* *integer* - index of the <COAP_Transaction> in the <COAP_Transaction_DB> that will cancel the timer
+ //
+ // Related Types:
+ // <COAP_Transaction>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_tr_send(inout EPTF_COAP_PDU p_msg, in integer p_trIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1575,6 +2549,18 @@ module EPTF_COAP_LGen_Functions
vf_EPTF_COAP_Transport_send.apply(p_msg);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_tr_remove
+ //
+ // Purpose:
+ // This function handles the removal and clean up of a <COAP_Transaction> state machine instance from the DB
+ //
+ // Parameters:
+ // p_trIdx - *in* *integer* - index of the <COAP_Transaction> in the <COAP_Transaction_DB>
+ //
+ // Related Types:
+ // <COAP_Transaction>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_tr_remove(in integer p_trIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1595,6 +2581,19 @@ module EPTF_COAP_LGen_Functions
f_EPTF_COAP_trDB_remove(p_trIdx);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_tr_setState
+ //
+ // Purpose:
+ // This function sets the current state of a <COAP_Transaction> state machine instance
+ //
+ // Parameters:
+ // p_trIdx - *in* *integer* - index of the <COAP_Transaction> in the <COAP_Transaction_DB> that will handle the message
+ // p_nextState - *in* <COAP_Transaction_State> - next state of the state machine
+ //
+ // Related Types:
+ // <COAP_Transaction>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_tr_setState(in integer p_trIdx, in COAP_Transaction_State p_nextState)
runs on EPTF_COAP_LGen_CT
{
@@ -1604,6 +2603,18 @@ module EPTF_COAP_LGen_Functions
f_EPTF_COAP_Logging_VERBOSE(log2str("tr [", v_COAP_trDB.data[p_trIdx].mid,"] next state: ", v_COAP_trDB.data[p_trIdx].state));
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_Logging_VERBOSE
+ //
+ // Purpose:
+ // Logging functions for the VERBOSE log level
+ //
+ // Parameters:
+ // pl_message - *in* *charstring* - string to be logged
+ //
+ // Related Types:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_Logging_VERBOSE(in @lazy charstring pl_message)
runs on EPTF_COAP_LGen_CT
{
@@ -1612,6 +2623,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_Logging_DEBUG
+ //
+ // Purpose:
+ // Logging functions for the DEBUG log level
+ //
+ // Parameters:
+ // pl_message - *in* *charstring* - string to be logged
+ //
+ // Related Types:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_Logging_DEBUG(in @lazy charstring pl_message)
runs on EPTF_COAP_LGen_CT
{
@@ -1620,6 +2643,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_Logging_WARNING
+ //
+ // Purpose:
+ // Logging functions for the WARNING log level
+ //
+ // Parameters:
+ // pl_message - *in* *charstring* - string to be logged
+ //
+ // Related Types:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_Logging_WARNING(in @lazy charstring pl_message)
runs on EPTF_COAP_LGen_CT
{
@@ -1628,6 +2663,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_Logging_ERROR
+ //
+ // Purpose:
+ // Logging functions for the ERROR log level
+ //
+ // Parameters:
+ // pl_message - *in* *charstring* - string to be logged
+ //
+ // Related Types:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_Logging_ERROR(in @lazy charstring pl_message)
runs on EPTF_COAP_LGen_CT
{
@@ -1636,6 +2683,19 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_EntityCtx_addObservation
+ //
+ // Purpose:
+ // Adds a new observation to the simulated device
+ //
+ // Parameters:
+ // p_eCtxIdx - *in* *integer* - index of the <COAP_EntityCtx> instance in <COAP_EntityCtx_DB>
+ // p_msg - *in* <EPTF_COAP_PDU> - The incoming OBSERVE request
+ //
+ // Related Types:
+ // <COAP_EntityCtx>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_EntityCtx_addObservation(in integer p_eCtxIdx, in EPTF_COAP_PDU p_msg)
runs on EPTF_COAP_LGen_CT
{
@@ -1668,7 +2728,21 @@ module EPTF_COAP_LGen_Functions
// Let's add the observer to the observed resource
f_EPTF_COAP_ObservedResource_addObserver(v_observedResourceIdx, p_msg);
}
-
+
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_EntityCtx_removeObservation
+ //
+ // Purpose:
+ // Removes an existing observation from the simulated device
+ //
+ // Parameters:
+ // p_eCtxIdx - *in* *integer* - index of the <COAP_EntityCtx> instance in <COAP_EntityCtx_DB>
+ // p_obsResIdx - *in* *integer* - The index of the <COAP_ObservedResource> instance in the <COAP_ObservedResource_DB>
+ // p_lastObserver - *in* *boolean* - True if this was the last observer for an observed resource (ie observed resource is not observed any more)
+ //
+ // Related Types:
+ // <COAP_EntityCtx>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_EntityCtx_removeObservation(in integer pl_eCtxIdx, in integer p_obsResIdx, in boolean p_lastObserver)
runs on EPTF_COAP_LGen_CT
{
@@ -1714,6 +2788,19 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_EntityCtx_removeObservedResource
+ //
+ // Purpose:
+ // Removes an observed resource entry from the simulated device
+ //
+ // Parameters:
+ // p_eCtxIdx - *in* *integer* - index of the <COAP_EntityCtx> instance in <COAP_EntityCtx_DB>
+ // p_obsResIdx - *in* *integer* - The index of the <COAP_ObservedResource> instance in the <COAP_ObservedResource_DB>
+ //
+ // Related Types:
+ // <COAP_EntityCtx>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_EntityCtx_removeObservedResource(in integer pl_eCtxIdx, in integer p_obsResIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1735,6 +2822,19 @@ module EPTF_COAP_LGen_Functions
f_EPTF_COAP_observedResourceDB_remove(p_obsResIdx);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_EntityCtx_cleanUp
+ //
+ // Purpose:
+ // Cleans up the <COAP_EntityCtx> instance of a simulated device by deleting related instances
+ //
+ // Parameters:
+ // p_eCtxIdx - *in* *integer* - index of the <COAP_EntityCtx> instance in <COAP_EntityCtx_DB>
+ // p_obsResIdx - *in* *integer* - The index of the <COAP_ObservedResource> instance in the <COAP_ObservedResource_DB>
+ //
+ // Related Types:
+ // <COAP_EntityCtx>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_EntityCtx_cleanUp(in integer p_eCtxIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1747,6 +2847,19 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_ObservedResource_addObserver
+ //
+ // Purpose:
+ // Adds an <COAP_Observation_Server> instance to the <COAP_ObservedResource> instance based on the OBSERVE message
+ //
+ // Parameters:
+ // p_obsResIdx - *in* *integer* - The index of the <COAP_ObservedResource> instance in the <COAP_ObservedResource_DB>
+ // p_msg - *in* <EPTF_COAP_PDU> - The OBSERVE message that the observer sent to observe a resource
+ //
+ // Related Types:
+ // <COAP_ObservedResource>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_ObservedResource_addObserver(in integer p_obsResIdx, in EPTF_COAP_PDU p_msg)
runs on EPTF_COAP_LGen_CT
{
@@ -1779,6 +2892,19 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_ObservedResource_removeObserver
+ //
+ // Purpose:
+ // Removes an <COAP_Observation_Server> instance from the <COAP_ObservedResource> instance that canceled its observation
+ //
+ // Parameters:
+ // p_obsResIdx - *in* *integer* - The index of the <COAP_ObservedResource> instance in the <COAP_ObservedResource_DB>
+ // p_obsIdx - *in* *integer* - The index of the <COAP_Observation_Server> instance in the <COAP_Observation_DB>
+ //
+ // Related Types:
+ // <COAP_ObservedResource>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_ObservedResource_removeObserver(in integer p_obsResIdx, in integer p_obsIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1806,6 +2932,19 @@ module EPTF_COAP_LGen_Functions
f_EPTF_COAP_EntityCtx_removeObservation(v_COAP_observedResourceDB.data[p_obsResIdx].eCtxIdx, p_obsResIdx, vl_lastObserver);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_ObservedResource_sendNotification
+ //
+ // Purpose:
+ // Sends notificiations to all observers, who are observing a particular resource <COAP_ObservedResource>
+ //
+ // Parameters:
+ // p_obsResIdx - *in* *integer* - The index of the <COAP_ObservedResource> instance in the <COAP_ObservedResource_DB>
+ // p_msg - *inout* <EPTF_COAP_PDU> - The NOTIFICATION message that will be sent to the observers
+ //
+ // Related Types:
+ // <COAP_ObservedResource>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_ObservedResource_sendNotification(in integer p_obsResIdx, inout EPTF_COAP_PDU p_msg)
runs on EPTF_COAP_LGen_CT
{
@@ -1818,6 +2957,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_ObservedResource_cleanUp
+ //
+ // Purpose:
+ // Cleans up the <COAP_ObservedResource> instance
+ //
+ // Parameters:
+ // p_obsResIdx - *in* *integer* - The index of the <COAP_ObservedResource> instance in the <COAP_ObservedResource_DB>
+ //
+ // Related Types:
+ // <COAP_ObservedResource>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_ObservedResource_cleanUp(in integer p_obsResIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1831,6 +2982,19 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_ObservationServer_sendNotification
+ //
+ // Purpose:
+ // Sends a notification for a particular observer of an observation relationship
+ //
+ // Parameters:
+ // p_obsIdx - *in* *integer* - The index of the <COAP_Observation_Server> instance in the <COAP_Observation_DB>
+ // p_msg - *inout* <EPTF_COAP_PDU> - The NOTIFICATION message that will be sent to the observer
+ //
+ // Related Types:
+ // <COAP_Observation_Server>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_ObservationServer_sendNotification(in integer p_obsIdx, inout EPTF_COAP_PDU p_msg)
runs on EPTF_COAP_LGen_CT
{
@@ -1891,6 +3055,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_ObservationServer_cancelReceivedFromEnv
+ //
+ // Purpose:
+ // When an observation is canceled this can be called function to remove the corresponding <COAP_Observation_Server> instance
+ //
+ // Parameters:
+ // p_obsIdx - *in* *integer* - The index of the <COAP_Observation_Server> instance in the <COAP_Observation_DB>
+ //
+ // Related Types:
+ // <COAP_Observation_Server>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_ObservationServer_cancelReceivedFromEnv(in integer p_obsIdx)
runs on EPTF_COAP_LGen_CT
{
@@ -1901,6 +3077,15 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_declareEvents
+ //
+ // Purpose:
+ // Declares the FSM events to the CLL framework implemented by <EPTF_COAP_LGen_CT>
+ //
+ // Related Types:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_declareEvents()
runs on EPTF_COAP_LGen_CT
{
@@ -1944,6 +3129,15 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_declareSteps
+ //
+ // Purpose:
+ // Declares the FSM steps to the CLL framework implemented by <EPTF_COAP_LGen_CT>
+ //
+ // Related Types:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_declareSteps()
runs on EPTF_COAP_LGen_CT
{
@@ -1975,6 +3169,19 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_init
+ //
+ // Purpose:
+ // Test Step to dynamically allocate and initialize the COAP FSM context for the caller FSM. Prerequisite to call any other COAP test step.
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_init>
+ // - <c_COAP_stepName_init>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_init(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
@@ -1997,6 +3204,19 @@ module EPTF_COAP_LGen_Functions
v_COAP_FsmCtxDB.data[vl_newFsmCtxIdx].eIdx := vl_eIdx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_cleanUp
+ //
+ // Purpose:
+ // Test Step to free up the COAP FSM context for the caller FSM. Frees up all allocated instances that were used by this FSM instance.
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_cleanUp>
+ // - <c_COAP_stepName_cleanUp>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_cleanUp(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
@@ -2026,6 +3246,20 @@ module EPTF_COAP_LGen_Functions
f_EPTF_LGenBase_setAppDataItemOfFsmCtx(vl_eIdx, vl_fsmIdx, v_COAP_bIdx, c_COAP_AppData_fsmCtxIdx, -1);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_setLocalAddress
+ //
+ // Purpose:
+ // Test step to set the local address in the entity context. Integer parameter required.
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ // pl_ptr.refContext.fRefArgs[0] - *integer* - Index of the endpoint to use as local address
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_setLocalAddress>
+ // - <c_COAP_stepName_setLocalAddress>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_setLocalAddress(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
@@ -2036,6 +3270,20 @@ module EPTF_COAP_LGen_Functions
f_EPTF_COAP_getIntValue(pl_ptr.refContext.fRefArgs, 0, v_COAP_EntityCtxDB.data[v_COAP_ctx.eCtxIdx].localAddressIdx);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_setRemoteAddress_byIntIdx
+ //
+ // Purpose:
+ // Test step to set the remote address in the FSM context <COAP_FsmCtx>. Integer parameter required.
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ // pl_ptr.refContext.fRefArgs[0] - *integer* - Index of the endpoint to use as remote address
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_setRemoteAddress_byIntIdx>
+ // - <c_COAP_stepName_setRemoteAddress_byIntIdx>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_setRemoteAddress_byIntIdx(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
@@ -2046,6 +3294,24 @@ module EPTF_COAP_LGen_Functions
f_EPTF_COAP_getIntValue(pl_ptr.refContext.fRefArgs, 0, v_COAP_FsmCtxDB.data[v_COAP_ctx.fsmCtxIdx].remoteAddressIdx);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_loadTemplate_byIntIdx
+ //
+ // Purpose:
+ // Test step to load a <CoAP_Template> from <tsp_EPTF_COAP_LGen_templates> into *v_COAP_msgToSend*
+ // (which can be sent using the send test step). Integer parameter required.
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ // pl_ptr.refContext.fRefArgs[0] - *integer* - Index of the template to load into *v_COAP_msgToSend*
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_loadTemplate_byIntIdx>
+ // - <c_COAP_stepName_loadTemplate_byIntIdx>
+ //
+ // Related Steps:
+ // <f_COAP_step_send>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_loadTemplate_byIntIdx(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
@@ -2059,6 +3325,24 @@ module EPTF_COAP_LGen_Functions
f_EPTF_COAP_templateDB_get(vl_templateIdx, v_COAP_msgToSend.pdu);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_loadTemplate_byStringId
+ //
+ // Purpose:
+ // Test step to load a <CoAP_Template> from <tsp_EPTF_COAP_LGen_templates> into *v_COAP_msgToSend*
+ // (which can be sent using the send test step). String parameter required.
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ // contextArgs.charstringVal - *charstring* - ID the template to load into *v_COAP_msgToSend*
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_loadTemplate_byStringId>
+ // - <c_COAP_stepName_loadTemplate_byStringId>
+ //
+ // Related Steps:
+ // <f_COAP_step_send>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_loadTemplate_byStringId(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
@@ -2079,6 +3363,28 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_send
+ //
+ // Purpose:
+ // Test step to send out a COAP message from *v_COAP_msgToSend*.
+ // The message will be processed by the Applib's COAP stack
+ // The step expects the localAddress and the remoteAddress to be configured
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_send>
+ // - <c_COAP_stepName_send>
+ //
+ // Related Steps:
+ // - <f_COAP_step_loadTemplate_byIntIdx>
+ // - <f_COAP_step_loadTemplate_byStringId>
+ //
+ // Related functions:
+ // <f_EPTF_COAP_stack_fromApp>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_send(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
@@ -2104,6 +3410,20 @@ module EPTF_COAP_LGen_Functions
f_EPTF_SchedulerComp_refreshSnapshotTime();
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_handleRequest
+ //
+ // Purpose:
+ // The test step can be called from an FSM to handle a reported COAP request.
+ // The test step will bind the current request to the caller FSM.
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_handleRequest>
+ // - <c_COAP_stepName_handleRequest>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_handleRequest(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
@@ -2135,16 +3455,40 @@ module EPTF_COAP_LGen_Functions
f_EPTF_COAP_rr_handleMsg(v_COAP_msgToProcess, vl_rrIdx);
}
- // Matches the msg_Type of response to the incoming request and the current state
- // That is:
- // - req.NON -> rsp.NON
- // - req.CON && state.SERVING -> rsp.ACK
- // - req.CON && state.SEPARATE -> rsp.CON
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_sendResponse
+ //
+ // Purpose:
+ // The test step expects an ongoing request bound to the FSM by <f_COAP_step_handleRequest>
+ // and a response message loaded into *v_COAP_msgToSend* by <f_COAP_step_loadTemplate_byIntIdx>
+ // The test step will take the template and process it in the applib's stack that will fill in
+ // the necessary id (e.g. mid, token) and will match the message type to the request the following way:
+ // - req.NON -> rsp.NON
+ // - req.CON && state.SERVING -> rsp.ACK
+ // - req.CON && state.SEPARATE -> rsp.CON
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_sendResponse>
+ // - <c_COAP_stepName_sendResponse>
+ //
+ // Related Steps:
+ // - <f_COAP_step_handleRequest>
+ // - <f_COAP_step_loadTemplate_byIntIdx>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_sendResponse(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
f_EPTF_COAP_Logging_DEBUG(log2str(%definitionId));
+ // Matches the msg_Type of response to the incoming request and the current state
+ // That is:
+ // - req.NON -> rsp.NON
+ // - req.CON && state.SERVING -> rsp.ACK
+ // - req.CON && state.SEPARATE -> rsp.CON
+
if (not f_EPTF_COAP_setStepCtx(pl_ptr, v_COAP_ctx)) { return; }
// We need an ongoing RR!
@@ -2192,6 +3536,25 @@ module EPTF_COAP_LGen_Functions
f_EPTF_SchedulerComp_refreshSnapshotTime();
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_sendAccept
+ //
+ // Purpose:
+ // The test step expects an ongoing request bound to the FSM by <f_COAP_step_handleRequest>
+ // The test step will send an accept (eg. ACK to a CON) without the body thus indicating to
+ // the client, that the request is accepted, but time is needed to produce the content. This
+ // accept will make the client cease its request retranmissions
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_sendAccept>
+ // - <c_COAP_stepName_sendAccept>
+ //
+ // Related Steps:
+ // - <f_COAP_step_handleRequest>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_sendAccept(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
@@ -2231,6 +3594,28 @@ module EPTF_COAP_LGen_Functions
f_EPTF_SchedulerComp_refreshSnapshotTime();
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_startListening
+ //
+ // Purpose:
+ // The test step expects that a transport endpoint is set in the entity context: <COAP_EntityCtx> as a local address
+ // The step will initiate allocating the local address using the transport layer and eventually
+ // it will report back if it was successful or it failed
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_startListening>
+ // - <c_COAP_stepName_startListening>
+ //
+ // Related Events:
+ // - <c_COAP_eventIdx_transportSucc>
+ // - <c_COAP_eventIdx_transportFail>
+ //
+ // Related Steps:
+ // - <f_COAP_step_setLocalAddress>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_startListening(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
@@ -2246,25 +3631,48 @@ module EPTF_COAP_LGen_Functions
vf_EPTF_COAP_Transport_apiRequest.apply(vl_req);
}
-
+
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_startDTLS
+ //
+ // Purpose:
+ // The test step expects that a transport endpoint is set in the entity context as a local address
+ // and a remote address is set in the FSM context.
+ // The step will use PSK for authentication in case the PSK identity and key is set in the FSM context: <COAP_FsmCtx>
+ // The step will initiate creating a DTLS connection and
+ // it will report back if it was successful or it failed
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_startDTLS>
+ // - <c_COAP_stepName_startDTLS>
+ //
+ // Related Events:
+ // - <c_COAP_eventIdx_transportSucc>
+ // - <c_COAP_eventName_transportSucc>
+ // - <c_COAP_eventIdx_transportFail>
+ // - <c_COAP_eventName_transportFail>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_startDTLS(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
if (not f_EPTF_COAP_setStepCtx(pl_ptr, v_COAP_ctx)) { return; }
-
+
var EPTF_COAP_Transport_Request vl_req := c_EPTF_COAP_Transport_Request_init;
vl_req.eIdx := v_COAP_ctx.eIdx;
vl_req.fsmIdx := v_COAP_ctx.fsmIdx;
f_EPTF_COAP_transportEndpointDB_get(v_COAP_transportEndpoint, v_COAP_EntityCtxDB.data[v_COAP_ctx.eCtxIdx].localAddressIdx);
vl_req.params.startDTLS.localAddress := v_COAP_transportEndpoint.socket;
-
+
f_EPTF_COAP_transportEndpointDB_get(v_COAP_transportEndpoint, v_COAP_FsmCtxDB.data[v_COAP_ctx.fsmCtxIdx].remoteAddressIdx);
vl_req.params.startDTLS.remoteAddress := v_COAP_transportEndpoint.socket;
-
+
vl_req.params.startDTLS.pskIdentity := omit;
vl_req.params.startDTLS.pskKey := omit;
-
+
if (ispresent(v_COAP_FsmCtxDB.data[v_COAP_ctx.fsmCtxIdx].psk))
{
vl_req.params.startDTLS.pskIdentity := v_COAP_FsmCtxDB.data[v_COAP_ctx.fsmCtxIdx].psk.identity;
@@ -2274,12 +3682,39 @@ module EPTF_COAP_LGen_Functions
vf_EPTF_COAP_Transport_apiRequest.apply(vl_req);
}
- // 1st param: psk id: charstring
- // 2nd param: psk key: charstring
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_startDTLS_byVarIds
+ //
+ // Purpose:
+ // The test step expects that a transport endpoint is set in the entity context as a local address
+ // and a remote address is set in the FSM context.
+ // The step will use PSK for authentication. The PSK identity and key will be taken from the steps parameters
+ // and loaded into the FSM context: <COAP_FsmCtx>
+ // The step will initiate creating a DTLS connection and
+ // it will report back if it was successful or it failed
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ // contextArgs.varNames[0] - *charstring variable* - PSK identity
+ // contextArgs.varNames[1] - *charstring variable* - PSK key
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_startDTLS_byVarIds>
+ // - <c_COAP_stepName_startDTLS_byVarIds>
+ //
+ // Related Events:
+ // - <c_COAP_eventIdx_transportSucc>
+ // - <c_COAP_eventName_transportSucc>
+ // - <c_COAP_eventIdx_transportFail>
+ // - <c_COAP_eventName_transportFail>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_startDTLS_byVarIds(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
if (not f_EPTF_COAP_setStepCtx(pl_ptr, v_COAP_ctx)) { return; }
+
+ // 1st param: psk id: charstring
+ // 2nd param: psk key: charstring
var EPTF_IntegerList vl_varIds := {};
f_EPTF_LGenBase_fsmVarIdListFromStep(pl_ptr, vl_varIds);
@@ -2324,11 +3759,37 @@ module EPTF_COAP_LGen_Functions
vf_EPTF_COAP_Transport_apiRequest.apply(vl_req);
}
- // idx param: psk idx in tsp_EPTF_COAP_LGen_psks
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_startDTLS_byIntIdx
+ //
+ // Purpose:
+ // The test step expects that a transport endpoint is set in the entity context as a local address
+ // and a remote address is set in the FSM context.
+ // The step will use PSK for authentication. The PSK identity and key will be taken from the step's parameters
+ // and loaded into the FSM context: <COAP_FsmCtx>
+ // The step will initiate creating a DTLS connection and
+ // it will report back if it was successful or it failed
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ // pl_ptr.refContext.fRefArgs[0] - *charstring variable* - integer idx of the PSK parameters in <tsp_EPTF_COAP_LGen_psks>
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_startDTLS_byIntIdx>
+ // - <c_COAP_stepName_startDTLS_byIntIdx>
+ //
+ // Related Events:
+ // - <c_COAP_eventIdx_transportSucc>
+ // - <c_COAP_eventName_transportSucc>
+ // - <c_COAP_eventIdx_transportFail>
+ // - <c_COAP_eventName_transportFail>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_startDTLS_byIntIdx(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
if (not f_EPTF_COAP_setStepCtx(pl_ptr, v_COAP_ctx)) { return; }
+
+ // idx param: psk idx in tsp_EPTF_COAP_LGen_psks
var integer vl_pskIdx;
if (f_EPTF_COAP_getIntValue(pl_ptr.refContext.fRefArgs, 0, vl_pskIdx))
@@ -2357,8 +3818,21 @@ module EPTF_COAP_LGen_Functions
else { f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " an integer is needed as param!")); }
}
- // 1st param: remoteHost: charstring
- // 2nd param: remotePort: integer
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_setRemoteAddress_byVars
+ //
+ // Purpose:
+ // Test step to set the remote address by variable parameters in the FSM context <COAP_FsmCtx>.
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ // contextArgs.varNames[0] - *charstring variable* - remoteHost
+ // contextArgs.varNames[1] - *integer variable* - remotePort
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_setRemoteAddress_byVars>
+ // - <c_COAP_stepName_setRemoteAddress_byVars>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_setRemoteAddress_byVars(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
@@ -2366,6 +3840,9 @@ module EPTF_COAP_LGen_Functions
if (not f_EPTF_COAP_setStepCtx(pl_ptr, v_COAP_ctx)) { return; }
+ // 1st param: remoteHost: charstring
+ // 2nd param: remotePort: integer
+
var EPTF_IntegerList vl_varIds := {};
f_EPTF_LGenBase_fsmVarIdListFromStep(pl_ptr, vl_varIds);
@@ -2398,6 +3875,21 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_reportCoapEventForEntity
+ //
+ // Purpose:
+ // The test step will turn on/off the COAP event reporting for the entity in the entity context <COAP_EntityCtx>
+ // It is recommended to turn the reporting off, when the COAP applib is used as a transport for the LWM2M applib
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ // pl_ptr.refContext.fRefArgs[0] - 0: false, 1: true
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_reportCoapEventForEntity>
+ // - <c_COAP_stepName_reportCoapEventForEntity>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_reportCoapEventForEntity(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
@@ -2416,14 +3908,29 @@ module EPTF_COAP_LGen_Functions
}
}
}
-
- // 1st param: integer, the index of the resource of the given entity
+
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_sendNotification_byIntIdx
+ //
+ // Purpose:
+ // The test step send notifications to the observers of the observed resource pointed by the idx parameter
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ // pl_ptr.refContext.fRefArgs[0] - *integer* - observed resource idx in the entity context <COAP_EntityCtx>
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_sendNotification_byIntIdx>
+ // - <c_COAP_stepName_sendNotification_byIntIdx>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_sendNotification_byIntIdx(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
f_EPTF_COAP_Logging_DEBUG(log2str(%definitionId));
if (not f_EPTF_COAP_setStepCtx(pl_ptr, v_COAP_ctx)) { return; }
+
+ // 1st param: integer, the index of the resource of the given entity
var integer vl_observedResourceIdx_Idx := -1;
if (f_EPTF_COAP_getIntValue(pl_ptr.refContext.fRefArgs, 0, vl_observedResourceIdx_Idx))
@@ -2437,14 +3944,29 @@ module EPTF_COAP_LGen_Functions
}
else { f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " an integer is needed as param!")); }
}
-
- // 1st param: charstring, the URI of the observed resource
+
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_sendNotification_byStringId
+ //
+ // Purpose:
+ // The test step send notifications to the observers of the observed resource identified by the string uri given as parameter
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ // contextArgs.charstringValue - *charstring* - observed resource uri
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_sendNotification_byStringId>
+ // - <c_COAP_stepName_sendNotification_byStringId>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_sendNotification_byStringId(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
f_EPTF_COAP_Logging_DEBUG(log2str(%definitionId));
if (not f_EPTF_COAP_setStepCtx(pl_ptr, v_COAP_ctx)) { return; }
+
+ // 1st param: charstring, the URI of the observed resource
var charstring vl_observedResourceId := f_EPTF_LGenBase_charstringValOfStep(pl_ptr);
@@ -2463,6 +3985,19 @@ module EPTF_COAP_LGen_Functions
else { f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " it was not possible to fetch the referred observedResourceIdx")); }
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_sendNotification_internal
+ //
+ // Purpose:
+ // This function sends notifications to the observers of the observed resource identified by the string uri given as parameter
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ // contextArgs.charstringValue - *charstring* - observed resource uri
+ //
+ // Related Types:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_sendNotification_internal(in EPTF_LGenBase_TestStepArgs pl_ptr, in charstring p_observedResourceId)
runs on EPTF_COAP_LGen_CT
{
@@ -2484,14 +4019,29 @@ module EPTF_COAP_LGen_Functions
}
else { f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " it was not possible to fetch the referred observedResourceIdx")); }
}
-
- // 1st param: integer, the index of the resource of the given entity
+
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_removeResourceObservations_byIntIdx
+ //
+ // Purpose:
+ // The test step removes the observers of the observed resource pointed by the idx parameter
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ // pl_ptr.refContext.fRefArgs[0] - *integer* - observed resource idx in the entity context <COAP_EntityCtx>
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_removeResourceObservations_byIntIdx>
+ // - <c_COAP_stepName_removeResourceObservations_byIntIdx>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_removeResourceObservations_byIntIdx(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
f_EPTF_COAP_Logging_DEBUG(log2str(%definitionId));
if (not f_EPTF_COAP_setStepCtx(pl_ptr, v_COAP_ctx)) { return; }
+
+ // 1st param: integer, the index of the resource of the given entity
var integer vl_observedResourceIdx_Idx := -1;
if (f_EPTF_COAP_getIntValue(pl_ptr.refContext.fRefArgs, 0, vl_observedResourceIdx_Idx))
@@ -2505,14 +4055,29 @@ module EPTF_COAP_LGen_Functions
}
else { f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " an integer is needed as param!")); }
}
-
- // 1st param: charstring, the URI of the observed resource
+
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_step_removeResourceObservations_byStringId
+ //
+ // Purpose:
+ // The test step removes the observers of the observed resource identified by the string uri given as parameter
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ // contextArgs.charstringValue - *charstring* - observed resource uri
+ //
+ // Related Constants:
+ // - <c_COAP_stepIdx_removeResourceObservations_byStringId>
+ // - <c_COAP_stepName_removeResourceObservations_byStringId>
+ ///////////////////////////////////////////////////////////
function f_COAP_step_removeResourceObservations_byStringId(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on EPTF_COAP_LGen_CT
{
f_EPTF_COAP_Logging_DEBUG(log2str(%definitionId));
if (not f_EPTF_COAP_setStepCtx(pl_ptr, v_COAP_ctx)) { return; }
+
+ // 1st param: charstring, the URI of the observed resource
var charstring vl_observedResourceId := f_EPTF_LGenBase_charstringValOfStep(pl_ptr);
@@ -2531,6 +4096,21 @@ module EPTF_COAP_LGen_Functions
else { f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " it was not possible to fetch the referred observedResourceIdx")); }
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_setStepCtx
+ //
+ // Purpose:
+ // This sets the instance pointers of <COAP_StepCtx> to the related instances of a simulated device (entity)
+ // calculated from the test step args <EPTF_LGenBase_TestStepArgs>
+ //
+ // Parameters:
+ // pl_ptr - *in* <EPTF_LGenBase_TestStepArgs> - test step args
+ // p_ctx - <COAP_StepCtx> - step context with pointers to the related instances
+ //
+ // Related Types:
+ // - <COAP_EntityCtx>
+ // - <COAP_StepCtx>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_setStepCtx(in EPTF_LGenBase_TestStepArgs pl_ptr, inout COAP_StepCtx p_ctx)
runs on EPTF_COAP_LGen_CT
return boolean
@@ -2549,6 +4129,24 @@ module EPTF_COAP_LGen_Functions
return true;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_setCtx
+ //
+ // Purpose:
+ // This sets the instance pointers of <COAP_StepCtx> to the related instances of a simulated device (entity)
+ // calculated from the test step args <EPTF_LGenBase_TestStepArgs>
+ //
+ // Parameters:
+ // p_eIdx - *in* *integer* - entity index
+ // p_fsmIdx - *in* *integer* - fsm instace index
+ //
+ // Returns:
+ // p_ctx - <COAP_StepCtx> - step context with pointers to the related instances
+ //
+ // Related Types:
+ // - <COAP_EntityCtx>
+ // - <COAP_StepCtx>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_setCtx(in integer p_eIdx, in integer p_fsmIdx, inout COAP_StepCtx p_ctx)
runs on EPTF_COAP_LGen_CT
return boolean
@@ -2567,6 +4165,22 @@ module EPTF_COAP_LGen_Functions
return true;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_isFsmInitialized
+ //
+ // Purpose:
+ // Checks if the <COAP_FsmCtx> instace was created for an FSM instance and returns with a pointer to it
+ //
+ // Parameters:
+ // p_eIdx - *in* *integer* - entity index
+ // p_fsmIdx - *in* *integer* - fsm instace index
+ //
+ // Returns:
+ // pl_fsmCtxIdx - *inout* *integer* - index of the <COAP_FsmCtx> instance in the <COAP_FsmCtx_DB>
+ //
+ // Related Types:
+ // <COAP_FsmCtx>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_isFsmInitialized(in integer pl_eIdx, in integer pl_fsmIdx, inout integer pl_fsmCtxIdx)
runs on EPTF_COAP_LGen_CT
return boolean
@@ -2583,6 +4197,20 @@ module EPTF_COAP_LGen_Functions
return -1 < pl_fsmCtxIdx and sizeof(v_COAP_FsmCtxDB.data) > pl_fsmCtxIdx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_getIntValue
+ //
+ // Purpose:
+ // Retreives an element of an <EPTF_IntegerList> if it exists
+ //
+ // Parameters:
+ // pl_intList - *in* <EPTF_IntegerList> - list of integers
+ // pl_number - *in* *integer* - index of the integer to be retrieved
+ //
+ // Returns:
+ // pl_value - *inout* *integer* - value of the retrieved integer
+ // *boolean* - true if the element existed in the integer list
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_getIntValue(
in EPTF_IntegerList pl_intList,
in integer pl_number,
@@ -2597,12 +4225,39 @@ module EPTF_COAP_LGen_Functions
return false;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_CodeToEventIdx
+ //
+ // Purpose:
+ // Converts the <Code> ot a COAP PDU to an integer number
+ //
+ // Parameters:
+ // p_code - *in* <Code> - code of a COAP PDU
+ //
+ // Returns:
+ // *integer* - the returned id
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_CodeToEventIdx(in Code p_code)
return integer
{
return p_code.class*100+p_code.detail;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_isCoapReportEnabledForEntity
+ //
+ // Purpose:
+ // Checks if the COAP event reporting is enabled for a particular entity
+ //
+ // Parameters:
+ // pl_eIdx - *in* *integer* - the index of the entity
+ //
+ // Returns:
+ // *boolean* - *true* if COAP event reporting is enabled, *false* otherwise
+ //
+ // Related Types:
+ // <COAP_EntityCtx>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_isCoapReportEnabledForEntity(in integer pl_eIdx)
runs on EPTF_COAP_LGen_CT
return boolean
@@ -2612,6 +4267,20 @@ module EPTF_COAP_LGen_Functions
return v_COAP_EntityCtxDB.data[v_COAP_ctx.eCtxIdx].reportCoapEvent;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_dispatchEventForObserve_ifExists
+ //
+ // Purpose:
+ // Dispatches the <c_COAP_eventIdx_OBSERVE> event to an entity/fsm if the COAP message has an OBSERVE option
+ //
+ // Parameters:
+ // p_pdu - *in* <CoAP_ReqResp> - the COAP PDU
+ // pl_eIdx - *in* *integer* - the index of the entity
+ // pl_fsmCtx - *in* *integer* - the index of FSM
+ //
+ // Related Types:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_dispatchEventForObserve_ifExists(in CoAP_ReqResp p_pdu, in integer pl_eIdx, in integer pl_fsmCtx)
runs on EPTF_COAP_LGen_CT
{
@@ -2626,6 +4295,21 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_dispatchEventsForCode
+ //
+ // Purpose:
+ // Dispatches events to an entity/fsm based on the COAP PDU's code
+ //
+ // Parameters:
+ // pl_code - *in* <Code> - the COAP PDU's code
+ // pl_eIdx - *in* *integer* - the index of the entity
+ // pl_fsmCtx - *in* *integer* - the index of FSM
+ // pl_reportedArgs - *in* <EPTF_IntegerList> - additional arguments to be reported to the entity/FSM
+ //
+ // Related Types:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_dispatchEventsForCode(in Code pl_code, in integer pl_eIdx, in integer pl_fsmCtx, in EPTF_IntegerList pl_reportedArgs)
runs on EPTF_COAP_LGen_CT
{
@@ -2661,6 +4345,21 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_dispatchEvent
+ //
+ // Purpose:
+ // Wrapper for CLL's <f_EPTF_LGenBase_postEvent> to handle multi level event (generic, entity, FSM) reporting
+ //
+ // Parameters:
+ // pl_eventIdx - *in* *integer* - index of the vent to be reported
+ // pl_eIdx - *in* *integer* - the index of the entity, in case it's -1 the reported event will be *generic* level
+ // pl_fsmCtx - *in* *integer* - the index of FSM, , in case it's -1 the reported event will be *entity* level
+ // pl_reportedArgs - *in* <EPTF_IntegerList> - additional arguments to be reported to the entity/FSM
+ //
+ // Related Types:
+ // <EPTF_COAP_LGen_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_dispatchEvent(in integer pl_eventIdx, in integer pl_eIdx, in integer pl_fsmCtx, in EPTF_IntegerList pl_reportedArgs)
runs on EPTF_COAP_LGen_CT
{
@@ -2712,6 +4411,18 @@ module EPTF_COAP_LGen_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_isEmpty
+ //
+ // Purpose:
+ // Checks if the COAP PDU is empty
+ //
+ // Parameters:
+ // p_pdu - *in* <CoAP_ReqResp> - COAP PDU to be checked
+ //
+ // Returns:
+ // *boolean* - true in case the COAP PDU is empty
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_isEmpty(in CoAP_ReqResp p_pdu)
return boolean
{
@@ -2722,6 +4433,18 @@ module EPTF_COAP_LGen_Functions
return false;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_isRequest
+ //
+ // Purpose:
+ // Checks if the COAP PDU is a request
+ //
+ // Parameters:
+ // p_pdu - *in* <CoAP_ReqResp> - COAP PDU to be checked
+ //
+ // Returns:
+ // *boolean* - true in case the COAP PDU is a request
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_isRequest(in CoAP_ReqResp p_pdu)
return boolean
{
@@ -2732,6 +4455,18 @@ module EPTF_COAP_LGen_Functions
return false;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_isResponse
+ //
+ // Purpose:
+ // Checks if the COAP PDU is a response
+ //
+ // Parameters:
+ // p_pdu - *in* <CoAP_ReqResp> - COAP PDU to be checked
+ //
+ // Returns:
+ // *boolean* - true in case the COAP PDU is a response
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_isResponse(in CoAP_ReqResp p_pdu)
return boolean
{
@@ -2741,6 +4476,18 @@ module EPTF_COAP_LGen_Functions
return false;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_hasObserve
+ //
+ // Purpose:
+ // Checks if the COAP PDU has an OBSERVE option
+ //
+ // Parameters:
+ // p_pdu - *in* <CoAP_ReqResp> - COAP PDU to be checked
+ //
+ // Returns:
+ // *boolean* - true in case the COAP PDU has an OBSERVE option
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_hasObserve(in CoAP_ReqResp p_pdu)
return integer
{
@@ -2750,8 +4497,20 @@ module EPTF_COAP_LGen_Functions
}
}
return -1;
- }
+ }
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_isReset
+ //
+ // Purpose:
+ // Checks if the COAP PDU is a RST
+ //
+ // Parameters:
+ // p_pdu - *in* <CoAP_ReqResp> - COAP PDU to be checked
+ //
+ // Returns:
+ // *boolean* - true in case the COAP PDU is a RST
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_isReset(in CoAP_ReqResp p_pdu)
return boolean
{
@@ -2761,6 +4520,18 @@ module EPTF_COAP_LGen_Functions
return false;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_uriPathToString
+ //
+ // Purpose:
+ // Converts the uri path of the COAP PDU into one string using "/" as delimiter
+ //
+ // Parameters:
+ // p_pdu - *in* <CoAP_ReqResp> - COAP PDU
+ //
+ // Returns:
+ // *charstring* - uri path of the COAP PDU in one string using "/" as delimiter
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_uriPathToString(in CoAP_ReqResp p_pdu)
return charstring
{
@@ -2774,6 +4545,18 @@ module EPTF_COAP_LGen_Functions
return v_ret;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_fetchUriPath
+ //
+ // Purpose:
+ // Fetches the uri path of the COAP PDU
+ //
+ // Parameters:
+ // p_pdu - *in* <CoAP_ReqResp> - COAP PDU
+ //
+ // Returns:
+ // *charstring* - uri path of the COAP PDU in one string using "/" as delimiter
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_fetchUriPath(in CoAP_ReqResp p_pdu)
return UriPath_List
{
@@ -2786,7 +4569,17 @@ module EPTF_COAP_LGen_Functions
}
return v_ret;
}
-
+
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_addOption
+ //
+ // Purpose:
+ // Adds <CoAP_Options> options to a the COAP PDU
+ //
+ // Parameters:
+ // p_pdu - *inout* <CoAP_ReqResp> - COAP PDU
+ // p_option - *in* <CoAP_Options> - COAP options to be added
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_addOption(inout CoAP_ReqResp p_coap, in CoAP_Options p_option)
{
if (not ispresent(p_coap.options)) { p_coap.options := {} }
diff --git a/src/EPTF_COAP_LocalTransport_Definitions.ttcn b/src/EPTF_COAP_LocalTransport_Definitions.ttcn
index 1e32084..c421c45 100644
--- a/src/EPTF_COAP_LocalTransport_Definitions.ttcn
+++ b/src/EPTF_COAP_LocalTransport_Definitions.ttcn
@@ -14,6 +14,30 @@
// Updated: 2017-09-01
// Contact: http://ttcn.ericsson.se
///////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+// Module: EPTF_COAP_LocalTransport_Definitions
+//
+// Purpose:
+// This module contains the definitions for the COAP load generator component
+//
+// Module depends on:
+// - <EPTF_COAP_Transport_Definitions>
+// - <EPTF_CLL_Base_Definitions>
+// - <EPTF_CLL_Logging_Definitions>
+// - <EPTF_CLL_FBQ_Definitions>
+// - <EPTF_CLL_TransportIPL4_Definitions>
+// - <EPTF_CLL_RBTScheduler_Definitions>
+// - <IPL4asp_Types>
+//
+// Module Parameters:
+// tsp_EPTF_COAP_LocalTransport_debug - <tsp_EPTF_COAP_LGen_debug> - *boolean* - Enabled/disable debug logging
+// tsp_EPTF_COAP_LocalTransport_debugVerbose - <tsp_EPTF_COAP_LGen_debugVerbose> - *boolean* - Enable/disable verbose debug logging
+//
+// Class Diagram:
+// (see EPTF_COAP_LocalTransport_Definitions.classes.jpg)
+//
+///////////////////////////////////////////////////////////////
module EPTF_COAP_LocalTransport_Definitions
{
import from EPTF_COAP_Transport_Definitions all;
@@ -34,20 +58,195 @@ module EPTF_COAP_LocalTransport_Definitions
const integer c_COAP_LocalTransport_Logging_DEBUGV := 2;
const integer c_COAP_LocalTransport_Logging_ERROR := 3;
- type component EPTF_COAP_LocalTransport_CT extends EPTF_COAP_Transport_Provider_CT, EPTF_Base_CT, EPTF_Logging_CT, EPTF_TransportIPL4_CT, EPTF_Scheduler_CT
+ /*****************************************************************
+ @startuml EPTF_COAP_LocalTransport_Definitions.classes.jpg
+
+ class EPTF_COAP_LocalTransport_CT {
+ boolean v_EPTF_COAP_LocalTransport_initialized
+ integer v_EPTF_COAP_LocalTransport_loggingMaskId
+ SocketEntry v_COAP_LocalTransport_currentSocket
+ SocketDB v_COAP_LocalTransport_localSocketDB
+ EPTF_COAP_Transport_Statistics v_EPTF_COAP_Transport_stats
+ f_EPTF_COAP_LocalTransport_init()
+ f_EPTF_COAP_LocalTransport_initLogging()
+ f_EPTF_COAP_LocalTransport_cleanup()
+ f_EPTF_COAP_IPL4asp_getMsgLen(in octetstring stream, inout ro_integer args)
+ f_EPTF_COAP_IPL4asp_handleEvent(...)
+ f_EPTF_COAP_IPL4asp_handleMessage(...)
+ f_EPTF_COAP_LocalTransport_send(in EPTF_COAP_PDU pl_msg)
+ f_EPTF_COAP_LocalTransport_transportApiRequest(EPTF_COAP_Transport_Request pl_req)
+ f_EPTF_COAP_LocalTransport_startSocket(in Socket p_sock, in ProtoTuple p_proto, in integer p_eIdx, inout integer p_idx)
+ f_EPTF_COAP_LocalTransport_startDTLS(in EPTF_COAP_Transport_dtlsConnect p_params, in integer p_eIdx, inout integer p_idx)
+ f_EPTF_COAP_LocalTransport_IPL4_sendTo(...)
+ f_EPTF_COAP_LocalTransport_IPL4_send(in integer pl_connId,in ProtoTuple pl_proto,in octetstring pl_msg)
+ }
+ EPTF_COAP_LocalTransport_CT "1" --> "1\n.v_COAP_LocalTransport_localSocketDB" SocketDB
+ EPTF_COAP_LocalTransport_CT "1" --> "0..1\n.v_COAP_LocalTransport_currentSocket" SocketEntry
+ EPTF_COAP_LocalTransport_CT "1" --> "1\n.v_EPTF_COAP_Transport_stats" EPTF_COAP_Transport_Statistics
+
+ class SocketEntry {
+ Socket addr
+ DTLSConnection dtls
+ ProtoTuple proto
+ ConnectionId connId
+ SocketState state
+ integer eIdx
+ f_EPTF_COAP_SocketEntry_hash(in SocketEntry p_entry)
+ f_EPTF_COAP_Socket_hash(Socket p_sock)
+ }
+ SocketEntry "1" --> "0..1\n.dtls" DTLSConnection
+
+ class SocketDB {
+ EPTF_FreeBusyQueue queue
+ SocketEntry_List data
+ integer hashRef
+ integer connId2eIdx_hashRef
+ f_EPTF_COAP_LocalTransport_socketDB_init()
+ f_EPTF_COAP_LocalTransport_socketDB_cleanUp()
+ f_EPTF_COAP_LocalTransport_socketDB_add(in SocketEntry p_entry)
+ f_EPTF_COAP_LocalTransport_socketDB_lookUp_localAddr(in Socket p_localAddr)
+ f_EPTF_COAP_LocalTransport_socketDB_lookUp_dtlsConnection(in Socket p_local, in Socket p_remote)
+ f_EPTF_COAP_LocalTransport_socketDB_lookUp_connId(in integer p_connId)
+ f_EPTF_COAP_LocalTransport_socketDB_get(in integer p_idx, inout SocketEntry p_sock)
+ f_EPTF_COAP_LocalTransport_socketDB_remove(in integer p_idx)
+ }
+ SocketDB "1" --> "*\n.data" SocketEntry
+
+ class DTLSConnection {
+ Socket remoteAddr
+ charstring pskIndetity
+ charstring pskKey
+ f_EPTF_COAP_DTLSConnection_hash(in Socket p_local, in Socket p_remote)
+ }
+
+ class EPTF_COAP_Transport_Statistics {
+ integer nofOpenConnections
+ integer nofTransportWarnings
+ float nofReceivedMessages
+ float nofSentMessages
+ float nofReceivedBytes
+ float nofSentBytes
+ }
+ @enduml
+ ******************************************************************/
+ /*****************************************************************
+ @startuml EPTF_COAP_LocalTransport_Definitions.EPTF_COAP_LocalTransport_CT.jpg
+ class EPTF_COAP_LocalTransport_CT {
+ boolean v_EPTF_COAP_LocalTransport_initialized
+ integer v_EPTF_COAP_LocalTransport_loggingMaskId
+ SocketEntry v_COAP_LocalTransport_currentSocket
+ SocketDB v_COAP_LocalTransport_localSocketDB
+ EPTF_COAP_Transport_Statistics v_EPTF_COAP_Transport_stats
+ f_EPTF_COAP_LocalTransport_init()
+ f_EPTF_COAP_LocalTransport_initLogging()
+ f_EPTF_COAP_LocalTransport_cleanup()
+ f_EPTF_COAP_IPL4asp_getMsgLen(in octetstring stream, inout ro_integer args)
+ f_EPTF_COAP_IPL4asp_handleEvent(...)
+ f_EPTF_COAP_IPL4asp_handleMessage(...)
+ f_EPTF_COAP_LocalTransport_send(in EPTF_COAP_PDU pl_msg)
+ f_EPTF_COAP_LocalTransport_transportApiRequest(EPTF_COAP_Transport_Request pl_req)
+ f_EPTF_COAP_LocalTransport_startSocket(in Socket p_sock, in ProtoTuple p_proto, in integer p_eIdx, inout integer p_idx)
+ f_EPTF_COAP_LocalTransport_startDTLS(in EPTF_COAP_Transport_dtlsConnect p_params, in integer p_eIdx, inout integer p_idx)
+ f_EPTF_COAP_LocalTransport_IPL4_sendTo(...)
+ f_EPTF_COAP_LocalTransport_IPL4_send(in integer pl_connId,in ProtoTuple pl_proto,in octetstring pl_msg)
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_LGen_CT
+ //
+ // Purpose:
+ // COAP local transport component
+ //
+ // Class:
+ // (see EPTF_COAP_LocalTransport_Definitions.EPTF_COAP_LocalTransport_CT.jpg)
+ //
+ // Extensions:
+ // - <EPTF_COAP_Transport_Provider_CT>
+ // - <EPTF_TransportIPL4_CT>
+ // - <EPTF_Base_CT>
+ // - <EPTF_Logging_CT>
+ // - <EPTF_Scheduler_CT>
+ //
+ // Ports:
+ // -
+ //
+ // Timers:
+ // -
+ //
+ // Variables:
+ // v_EPTF_COAP_LocalTransport_initialized - *boolean* - Flag to indicate if the init function was already called
+ // v_EPTF_COAP_LocalTransport_loggingMaskId - *integer* - logging mask id
+ // v_EPTF_COAP_Transport_stats - <EPTF_COAP_Transport_Statistics> - Counters for transport statistics
+ //
+ // Instance databases:
+ // v_COAP_LocalTransport_localSocketDB - <SocketDB> - Storing the managed transport endpoints
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_LocalTransport_init> ()
+ // - <f_EPTF_COAP_LocalTransport_initLogging> ()
+ // - <f_EPTF_COAP_LocalTransport_cleanup> ()
+ // - <f_EPTF_COAP_IPL4asp_getMsgLen> (in *octetstring* stream, inout <ro_integer> args)
+ // - <f_EPTF_COAP_IPL4asp_handleEvent> (...)
+ // - <f_EPTF_COAP_IPL4asp_handleMessage> (...)
+ // - <f_EPTF_COAP_LocalTransport_send> (in <EPTF_COAP_PDU> pl_msg)
+ // - <f_EPTF_COAP_LocalTransport_transportApiRequest> (<EPTF_COAP_Transport_Request> pl_req)
+ // - <f_EPTF_COAP_LocalTransport_startSocket> (in <Socket> p_sock, in <ProtoTuple> p_proto, in *integer* p_eIdx, inout *integer* p_idx)
+ // - <f_EPTF_COAP_LocalTransport_startDTLS> (in <EPTF_COAP_Transport_dtlsConnect> p_params, in *integer* p_eIdx, inout *integer* p_idx)
+ // - <f_EPTF_COAP_LocalTransport_IPL4_sendTo> (...)
+ // - <f_EPTF_COAP_LocalTransport_IPL4_send> (in *integer* pl_connId,in <ProtoTuple> pl_proto, in *octetstring* pl_msg)
+ ///////////////////////////////////////////////////////////
+ type component EPTF_COAP_LocalTransport_CT
+ extends EPTF_COAP_Transport_Provider_CT, EPTF_Base_CT,
+ EPTF_Logging_CT, EPTF_TransportIPL4_CT, EPTF_Scheduler_CT
{
- var boolean v_EPTF_COAP_LocalTransport_initialized := false;
- var integer v_EPTF_COAP_LocalTransport_loggingMaskId;
+ var boolean v_EPTF_COAP_LocalTransport_initialized := false;
+ var integer v_EPTF_COAP_LocalTransport_loggingMaskId;
- var SocketEntry v_COAP_LocalTransport_currentSocket;
+ var SocketEntry v_COAP_LocalTransport_currentSocket;
// database:
- var SocketDB v_COAP_LocalTransport_localSocketDB;
+ var SocketDB v_COAP_LocalTransport_localSocketDB;
// statistics:
var EPTF_COAP_Transport_Statistics v_EPTF_COAP_Transport_stats;
}
-
+
+ /*****************************************************************
+ @startuml EPTF_COAP_LocalTransport_Definitions.SocketEntry.jpg
+ class SocketEntry {
+ Socket addr
+ DTLSConnection dtls
+ ProtoTuple proto
+ ConnectionId connId
+ SocketState state
+ integer eId
+ f_EPTF_COAP_SocketEntry_hash(in SocketEntry p_entry)
+ f_EPTF_COAP_Socket_hash(Socket p_sock)
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: SocketEntry
+ //
+ // Purpose:
+ // Storing the transport related data of a COAP transport endpoint
+ //
+ // Class:
+ // (see EPTF_COAP_LocalTransport_Definitions.SocketEntry.jpg)
+ //
+ // Elements:
+ // addr - <Socket> - local address and local port
+ // dtls - <DTLSConnection> - in case DTLS (PSK) is used, the remote address and port with keys are stored here
+ // proto - <ProtoTuple> - transport protocol description
+ // connId - <ConnectionId> - connection id from the IPL4 transport layer
+ // state - <SocketState> - state of the socket
+ // eIdx - <integer> - the index of the entity (COAP device) who owns this socket
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_SocketEntry_hash> (in <SocketEntry> p_entry)
+ // - <f_EPTF_COAP_Socket_hash> (<Socket> p_sock)
+ ///////////////////////////////////////////////////////////
type record SocketEntry
{
Socket addr,
@@ -57,7 +256,19 @@ module EPTF_COAP_LocalTransport_Definitions
SocketState state,
integer eIdx
}
-
+
+ ///////////////////////////////////////////////////////////
+ // Enum: SocketState
+ //
+ // Purpose:
+ // States of a <SocketEntry>
+ //
+ // Elements:
+ // - UNUSED
+ // - CLOSED
+ // - OPENED
+ // - TEMPORARY_UNAVAILABLE
+ ///////////////////////////////////////////////////////////
type enumerated SocketState
{
UNUSED,
@@ -79,8 +290,57 @@ module EPTF_COAP_LocalTransport_Definitions
eIdx := -1
}
+ ///////////////////////////////////////////////////////////
+ // Type: SocketEntry_List
+ //
+ // Purpose:
+ // List of <SocketEntry>
+ ///////////////////////////////////////////////////////////
type record of SocketEntry SocketEntry_List;
+ /*****************************************************************
+ @startuml EPTF_COAP_LocalTransport_Definitions.SocketDB.jpg
+ class SocketDB {
+ EPTF_FreeBusyQueue queue
+ SocketEntry_List data
+ integer hashRef
+ integer connId2eIdx_hashRef
+ f_EPTF_COAP_LocalTransport_socketDB_init()
+ f_EPTF_COAP_LocalTransport_socketDB_cleanUp()
+ f_EPTF_COAP_LocalTransport_socketDB_add(in SocketEntry p_entry)
+ f_EPTF_COAP_LocalTransport_socketDB_lookUp_localAddr(in Socket p_localAddr)
+ f_EPTF_COAP_LocalTransport_socketDB_lookUp_dtlsConnection(in Socket p_local, in Socket p_remote)
+ f_EPTF_COAP_LocalTransport_socketDB_lookUp_connId(in integer p_connId)
+ f_EPTF_COAP_LocalTransport_socketDB_get(in integer p_idx, inout SocketEntry p_sock)
+ f_EPTF_COAP_LocalTransport_socketDB_remove(in integer p_idx)
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: SocketDB
+ //
+ // Purpose:
+ // Storing <SocketEntry> instances
+ //
+ // Class:
+ // (see EPTF_COAP_LocalTransport_Definitions.SocketDB.jpg)
+ //
+ // Elements:
+ // queue - <EPTF_FreeBusyQueue> - FBQ for the stored elements
+ // data - <COAP_Transaction_List> - elements
+ // hashRef - *integer* - hash id of the hash map
+ // connId2eIdx_hashRef - *integer* - hash id of the int2int hash map where key: connId -> value: eIdx
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_LocalTransport_socketDB_init> ()
+ // - <f_EPTF_COAP_LocalTransport_socketDB_cleanUp> ()
+ // - <f_EPTF_COAP_LocalTransport_socketDB_add> (in <SocketEntry> p_entry)
+ // - <f_EPTF_COAP_LocalTransport_socketDB_lookUp_localAddr> (in <Socket> p_localAddr)
+ // - <f_EPTF_COAP_LocalTransport_socketDB_lookUp_dtlsConnection> (in <Socket> p_local, in <Socket> p_remote)
+ // - <f_EPTF_COAP_LocalTransport_socketDB_lookUp_connId> (in *integer* p_connId)
+ // - <f_EPTF_COAP_LocalTransport_socketDB_get> (in *integer* p_idx, inout <SocketEntry> p_sock)
+ // - <f_EPTF_COAP_LocalTransport_socketDB_remove> (in *integer* p_idx)
+ ///////////////////////////////////////////////////////////
type record SocketDB
{
EPTF_FreeBusyQueue queue,
@@ -90,7 +350,34 @@ module EPTF_COAP_LocalTransport_Definitions
}
const charstring c_EPTF_COAP_LocalTransport_SocketDB := "EPTF_COAP_LocalTransport_SocketDB";
const charstring c_EPTF_COAP_LocalTransport_SocketDB_connId2eIdx_hashRef := "EPTF_COAP_LocalTransport_SocketDB_connId2eIdx_hashRef";
-
+
+ /*****************************************************************
+ @startuml EPTF_COAP_LocalTransport_Definitions.DTLSConnection.jpg
+ class DTLSConnection {
+ Socket remoteAddr
+ charstring pskIndetity
+ charstring pskKey
+ f_EPTF_COAP_DTLSConnection_hash(in Socket p_local, in Socket p_remote)
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: DTLSConnection
+ //
+ // Purpose:
+ // Storing the DTLS transport related data of a COAP transport endpoint
+ //
+ // Class:
+ // (see EPTF_COAP_LocalTransport_Definitions.DTLSConnection.jpg)
+ //
+ // Elements:
+ // remoteAddr - <Socket> - remote address and remote port of the DTLS connection
+ // pskIndetity - *charstring* - identity used for PSK authnetication
+ // pskKey - *charstring* - key used for PSK authnetication
+ //
+ // Related Functions:
+ // - <f_EPTF_COAP_DTLSConnection_hash> (in <Socket> p_local, in <Socket> p_remote)
+ ///////////////////////////////////////////////////////////
type record DTLSConnection
{
Socket remoteAddr,
@@ -104,7 +391,36 @@ module EPTF_COAP_LocalTransport_Definitions
pskIndetity := omit,
pskKey := omit
}
-
+
+ /*****************************************************************
+ @startuml EPTF_COAP_LocalTransport_Definitions.EPTF_COAP_Transport_Statistics.jpg
+ class EPTF_COAP_Transport_Statistics {
+ integer nofOpenConnections
+ integer nofTransportWarnings
+ float nofReceivedMessages
+ float nofSentMessages
+ float nofReceivedBytes
+ float nofSentBytes
+ }
+ @enduml
+ ******************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_Transport_Statistics
+ //
+ // Purpose:
+ // Storing counters for transport related statistics
+ //
+ // Class:
+ // (see EPTF_COAP_LocalTransport_Definitions.EPTF_COAP_Transport_Statistics.jpg)
+ //
+ // Elements:
+ // nofOpenConnections - *integer* - number of open connection
+ // nofTransportWarnings - *integer* - number of transport warnings issued so far during the execution
+ // nofReceivedMessages - *float* - number of received messages
+ // nofSentMessages - *float* - number of sent messages
+ // nofReceivedBytes - *float* - number of received bytes
+ // nofSentBytes - *float* - number of sent bytes
+ ///////////////////////////////////////////////////////////
type record EPTF_COAP_Transport_Statistics
{
integer nofOpenConnections,
diff --git a/src/EPTF_COAP_LocalTransport_Functions.ttcn b/src/EPTF_COAP_LocalTransport_Functions.ttcn
index c5b8576..85c23af 100644
--- a/src/EPTF_COAP_LocalTransport_Functions.ttcn
+++ b/src/EPTF_COAP_LocalTransport_Functions.ttcn
@@ -14,6 +14,16 @@
// Updated: 2017-09-01
// Contact: http://ttcn.ericsson.se
///////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+// Module: EPTF_COAP_LocalTransport_Functions
+//
+// Purpose:
+// This module contains the functions of the COAP local transport component
+//
+// See also:
+// <EPTF_COAP_LocalTransport_Definitions>
+///////////////////////////////////////////////////////////////
module EPTF_COAP_LocalTransport_Functions
{
import from IPL4asp_Types all;
@@ -34,6 +44,15 @@ module EPTF_COAP_LocalTransport_Functions
import from CoAP_Types all;
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_init
+ //
+ // Purpose:
+ // The main initialization function of the <EPTF_COAP_LocalTransport_CT> component type
+ //
+ // Related Type:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_init()
runs on EPTF_COAP_LocalTransport_CT
{
@@ -58,6 +77,15 @@ module EPTF_COAP_LocalTransport_Functions
v_EPTF_COAP_LocalTransport_initialized := true;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_initLogging
+ //
+ // Purpose:
+ // Initializing CLL's logging feature on the <EPTF_COAP_LocalTransport_CT> component type
+ //
+ // Related Type:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_initLogging()
runs on EPTF_COAP_LocalTransport_CT
{
@@ -84,6 +112,15 @@ module EPTF_COAP_LocalTransport_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_cleanup
+ //
+ // Purpose:
+ // The main clean up function for the <EPTF_COAP_LocalTransport_CT> component type
+ //
+ // Related Type:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_cleanup()
runs on EPTF_COAP_LocalTransport_CT
{
@@ -97,6 +134,24 @@ module EPTF_COAP_LocalTransport_Functions
v_EPTF_COAP_LocalTransport_initialized := false;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_IPL4asp_getMsgLen
+ //
+ // Purpose:
+ // Framing function to be regisitered into the IPL4 transport layer <EPTF_CLL_TransportIPL4_Functions>.
+ // It is used to determine the length of a (partially) received PDU so that the transport layer knows,
+ // how much more must be received before attempting to decode it.
+ //
+ // Parameters:
+ // stream - *in* *octetstring* - the content received so far
+ // args - *inout* <ro_integer> - various parameters
+ //
+ // Returns:
+ // *integer* - The expected length of the next PDU
+ //
+ // Related Type:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_IPL4asp_getMsgLen
(
in octetstring stream,
@@ -107,6 +162,23 @@ module EPTF_COAP_LocalTransport_Functions
return lengthof(stream);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_IPL4asp_handleEvent
+ //
+ // Purpose:
+ // Handler function to be regisitered into the IPL4 transport layer <EPTF_CLL_TransportIPL4_Functions>.
+ // It is used to receieve transport events from the underlying IPL4 transport layer.
+ // The function currently handles the connection closed event and forwards every event to the load generator
+ // layer's handler function.
+ //
+ // Parameters:
+ // pl_transportType - *in* <EPTF_Transport_TransportType> - transport type
+ // pl_connId - *in* <ConnectionId> - the connection id the event is received on
+ // pl_event - *in* <PortEvent> - the event descriptor
+ //
+ // Related Type:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_IPL4asp_handleEvent(
in EPTF_Transport_TransportType pl_transportType,
in ConnectionId pl_connId,
@@ -114,13 +186,13 @@ module EPTF_COAP_LocalTransport_Functions
runs on EPTF_COAP_LocalTransport_CT
{
f_COAP_Transport_Logging_VERBOSE(log2str(": incoming event: ", pl_event));
-
+
if (tsp_EPTF_COAP_LocalTransport_debug) { action("COAP transport event: \n", pl_event); }
-
+
if (vf_EPTF_COAP_Transport_receiveEvent != null) {
vf_EPTF_COAP_Transport_receiveEvent.apply(pl_event);
}
-
+
if (ischosen(pl_event.connClosed))
{
var integer vl_sockIdx := f_EPTF_COAP_LocalTransport_socketDB_lookUp_connId(pl_event.connClosed.connId);
@@ -136,6 +208,29 @@ module EPTF_COAP_LocalTransport_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_IPL4asp_handleMessage
+ //
+ // Purpose:
+ // Handler function to be regisitered into the IPL4 transport layer <EPTF_CLL_TransportIPL4_Functions>.
+ // It is used to receieve COAP messages from the underlying IPL4 transport layer.
+ // The function looks up the entity that owns the particular connection and forwards the message and the
+ // entity information to the load generator layer
+ //
+ // Parameters:
+ // pl_transportType - *in* <EPTF_Transport_TransportType> - transport type
+ // pl_connId - *in* <ConnectionId> - the connection id the event is received on
+ // pl_remHost - *in* <HostName> - remote host name
+ // pl_remPort - *in* <PortNumber> - remote port number
+ // pl_locHost - *in* <HostName> - local host name
+ // pl_locPort - *in* <PortNumber> - local port number
+ // pl_proto - *in* <ProtoTuple> - transport protocol descriptor
+ // pl_userData - *in* *integer* - user data registered to the socket
+ // pl_msg - *in* *octetstring* - incoming message
+ //
+ // Related Type:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_IPL4asp_handleMessage(
in EPTF_Transport_TransportType pl_transportType,
in ConnectionId pl_connId,
@@ -149,7 +244,7 @@ module EPTF_COAP_LocalTransport_Functions
runs on EPTF_COAP_LocalTransport_CT
{
f_COAP_Transport_Logging_VERBOSE(log2str(%definitionId, " ", pl_msg));
-
+
var CoAP_Message vl_COAP_MSG;
var EPTF_COAP_PDU vl_EPTF_COAP_PDU;
@@ -193,11 +288,24 @@ module EPTF_COAP_LocalTransport_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_send
+ //
+ // Purpose:
+ // Function to send out a <EPTF_COAP_PDU> message using the local transport. It automatically
+ // looks up the corresponding <Socket> or creates it on the fly if it doesn't exist yet
+ //
+ // Parameters:
+ // pl_msg - *in* <EPTF_COAP_PDU> - message to be sent
+ //
+ // Related Type:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_send(in EPTF_COAP_PDU pl_msg)
runs on EPTF_COAP_LocalTransport_CT
{
f_COAP_Transport_Logging_VERBOSE(log2str(%definitionId, " ", pl_msg));
-
+
if (ischosen(pl_msg.transportParams.proto.udp))
{
var integer vl_sockIdx := f_EPTF_COAP_LocalTransport_socketDB_lookUp_localAddr(pl_msg.transportParams.localAddress);
@@ -229,7 +337,7 @@ module EPTF_COAP_LocalTransport_Functions
else if (ischosen(pl_msg.transportParams.proto.dtls))
{
var integer vl_dtlsIdx := f_EPTF_COAP_LocalTransport_socketDB_lookUp_dtlsConnection(pl_msg.transportParams.localAddress, pl_msg.transportParams.remoteAddress);
-
+
if (vl_dtlsIdx < 0)
{
if (not f_EPTF_COAP_LocalTransport_startDTLS(
@@ -273,11 +381,23 @@ module EPTF_COAP_LocalTransport_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_transportApiRequest
+ //
+ // Purpose:
+ // Function to handle incoming transport API requests
+ //
+ // Parameters:
+ // pl_req - *in* <EPTF_COAP_Transport_Request> - transport API request
+ //
+ // Related Type:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_transportApiRequest(EPTF_COAP_Transport_Request pl_req)
runs on EPTF_COAP_LocalTransport_CT
{
f_COAP_Transport_Logging_VERBOSE(log2str(%definitionId, " ", pl_req));
-
+
if (ischosen(pl_req.params.startListening))
{
var EPTF_COAP_Transport_Response vl_rsp := c_EPTF_COAP_Transport_Response_init;
@@ -306,7 +426,7 @@ module EPTF_COAP_LocalTransport_Functions
var EPTF_COAP_Transport_Response vl_rsp := c_EPTF_COAP_Transport_Response_init;
vl_rsp.eIdx := pl_req.eIdx;
vl_rsp.fsmIdx := pl_req.fsmIdx;
-
+
var integer vl_connIdx := f_EPTF_COAP_LocalTransport_socketDB_lookUp_dtlsConnection(
pl_req.params.startDTLS.localAddress,
pl_req.params.startDTLS.remoteAddress
@@ -328,7 +448,29 @@ module EPTF_COAP_LocalTransport_Functions
}
}
- function f_EPTF_COAP_LocalTransport_startSocket(in Socket p_sock, in ProtoTuple p_proto, in integer p_eIdx, inout integer p_idx)
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_startSocket
+ //
+ // Purpose:
+ // Internal (private) function to create and initialize a <Socket>
+ //
+ // Parameters:
+ // p_sock - *in* <Socket> - local host andm port of the socket
+ // p_proto - *in* <ProtoTuple> - transport protocol descriptor of the socket
+ // p_eIdx - *in* *integer* - entity index that owns the socket
+ //
+ // Returns:
+ // p_idx - *inout* *integer* - index of the <SocketEntry> in the <SocketDB>
+ //
+ // Related Type:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
+ function f_EPTF_COAP_LocalTransport_startSocket(
+ in Socket p_sock,
+ in ProtoTuple p_proto,
+ in integer p_eIdx,
+ inout integer p_idx
+ )
runs on EPTF_COAP_LocalTransport_CT
return boolean
{
@@ -345,7 +487,7 @@ module EPTF_COAP_LocalTransport_Functions
pl_automaticBuffering := false,
pl_options := {}
);
-
+
if (f_EPTF_COAP_IPL4asp_handleResult(vl_result)) // Everything went OK
{
vl_socketEntry.addr := p_sock;
@@ -362,6 +504,22 @@ module EPTF_COAP_LocalTransport_Functions
return true;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_startDTLS
+ //
+ // Purpose:
+ // Internal (private) function to create and initialize a DTLS connection
+ //
+ // Parameters:
+ // p_params - *in* <EPTF_COAP_Transport_dtlsConnect> - DTLS parameters
+ // p_eIdx - *in* *integer* - entity index that owns the socket
+ //
+ // Returns:
+ // p_idx - *inout* *integer* - index of the <SocketEntry> in the <SocketDB>
+ //
+ // Related Type:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_startDTLS(
in EPTF_COAP_Transport_dtlsConnect p_params,
in integer p_eIdx,
@@ -371,7 +529,7 @@ module EPTF_COAP_LocalTransport_Functions
{
var Result vl_result;
var OptionList v_options := {};
-
+
if (ispresent(p_params.pskIdentity) and ispresent(p_params.pskKey))
{
v_options[sizeof(v_options)] :=
@@ -385,7 +543,7 @@ module EPTF_COAP_LocalTransport_Functions
}
log("ipl4 options: ", v_options);
-
+
f_EPTF_Transport_connect(
pl_transportType := IPL4,
pl_proto := { dtls := { udp := {} } },
@@ -398,12 +556,12 @@ module EPTF_COAP_LocalTransport_Functions
pl_automaticBuffering := true,
pl_options := v_options
);
-
+
if (f_EPTF_COAP_IPL4asp_handleResult(vl_result)) // Everything went OK
{
v_COAP_LocalTransport_currentSocket := c_SocketEntry_init;
v_COAP_LocalTransport_currentSocket.dtls := c_DTLSConnection_init;
-
+
v_COAP_LocalTransport_currentSocket.addr := p_params.localAddress;
v_COAP_LocalTransport_currentSocket.dtls.remoteAddr := p_params.remoteAddress;
if (ispresent(p_params.pskIdentity) and ispresent(p_params.pskKey))
@@ -424,6 +582,15 @@ module EPTF_COAP_LocalTransport_Functions
return true;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_IPL4_sendTo
+ //
+ // Purpose:
+ // Internal (private) wrapper function of the <f_EPTF_Transport_sendTo> function
+ //
+ // Related Type:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_IPL4_sendTo(
in integer pl_connId,
in charstring pl_remName,
@@ -433,7 +600,7 @@ module EPTF_COAP_LocalTransport_Functions
runs on EPTF_COAP_LocalTransport_CT
{
var Result v_res;
-
+
f_EPTF_Transport_sendTo(
pl_transportType := IPL4,
pl_connId := pl_connId,
@@ -453,6 +620,15 @@ module EPTF_COAP_LocalTransport_Functions
v_EPTF_COAP_Transport_stats.nofSentBytes := v_EPTF_COAP_Transport_stats.nofSentBytes + int2float(lengthof(pl_msg));
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_IPL4_send
+ //
+ // Purpose:
+ // Internal (private) wrapper function of the <f_EPTF_Transport_send> function
+ //
+ // Related Type:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_IPL4_send(
in integer pl_connId,
in ProtoTuple pl_proto,
@@ -460,7 +636,7 @@ module EPTF_COAP_LocalTransport_Functions
runs on EPTF_COAP_LocalTransport_CT
{
var Result v_res;
-
+
f_EPTF_Transport_send(
pl_transportType := IPL4,
pl_connId := pl_connId,
@@ -478,6 +654,15 @@ module EPTF_COAP_LocalTransport_Functions
v_EPTF_COAP_Transport_stats.nofSentBytes := v_EPTF_COAP_Transport_stats.nofSentBytes + int2float(lengthof(pl_msg));
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_socketDB_init
+ //
+ // Purpose:
+ // Initializes the *v_COAP_LocalTransport_localSocketDB* <SocketDB> database
+ //
+ // Related Type:
+ // <SocketDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_socketDB_init()
runs on EPTF_COAP_LocalTransport_CT
{
@@ -487,6 +672,15 @@ module EPTF_COAP_LocalTransport_Functions
v_COAP_LocalTransport_localSocketDB.connId2eIdx_hashRef := f_EPTF_int2int_HashMap_New(c_EPTF_COAP_LocalTransport_SocketDB_connId2eIdx_hashRef);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_socketDB_cleanUp
+ //
+ // Purpose:
+ // Cleans up the reserved resources of the *v_COAP_LocalTransport_localSocketDB* <SocketDB> database
+ //
+ // Related Type:
+ // <SocketDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_socketDB_cleanUp()
runs on EPTF_COAP_LocalTransport_CT
{
@@ -496,6 +690,21 @@ module EPTF_COAP_LocalTransport_Functions
f_EPTF_int2int_HashMap_Delete(c_EPTF_COAP_LocalTransport_SocketDB_connId2eIdx_hashRef);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_socketDB_add
+ //
+ // Purpose:
+ // Adds a new element to the *v_COAP_LocalTransport_localSocketDB* <SocketDB> database
+ //
+ // Parameters:
+ // p_entry - *in* <SocketEntry> - the element to be added
+ //
+ // Returns:
+ // *integer* - the index of the added element in the database
+ //
+ // Related Type:
+ // <SocketDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_socketDB_add(in SocketEntry p_entry)
runs on EPTF_COAP_LocalTransport_CT
return integer
@@ -525,7 +734,7 @@ module EPTF_COAP_LocalTransport_Functions
{
f_EPTF_str2int_HashMap_Insert(v_COAP_LocalTransport_localSocketDB.hashRef, f_EPTF_COAP_Socket_hash(p_entry.addr), v_idx);
}
-
+
f_EPTF_int2int_HashMap_Insert(v_COAP_LocalTransport_localSocketDB.connId2eIdx_hashRef, p_entry.connId, v_idx);
v_COAP_LocalTransport_localSocketDB.data[v_idx] := p_entry;
@@ -534,6 +743,22 @@ module EPTF_COAP_LocalTransport_Functions
return v_idx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_socketDB_lookUp_localAddr
+ //
+ // Purpose:
+ // Gets the index of an <SocketEntry> element in *v_COAP_LocalTransport_localSocketDB* <SocketDB> database
+ // based on its local address
+ //
+ // Parameters:
+ // p_localAddr - *in* <Socket> - the local address
+ //
+ // Returns:
+ // *integer* - the index of the element, or -1 if not found
+ //
+ // Related Type:
+ // <SocketDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_socketDB_lookUp_localAddr(in Socket p_localAddr)
runs on EPTF_COAP_LocalTransport_CT
return integer
@@ -543,6 +768,22 @@ module EPTF_COAP_LocalTransport_Functions
return vl_idx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_socketDB_lookUp_dtlsConnection
+ //
+ // Purpose:
+ // Gets the index of an <SocketEntry> element in *v_COAP_LocalTransport_localSocketDB* <SocketDB> database
+ // based on its DTLS connection's local address
+ //
+ // Parameters:
+ // p_localAddr - *in* <Socket> - the local address
+ //
+ // Returns:
+ // *integer* - the index of the element, or -1 if not found
+ //
+ // Related Type:
+ // <SocketDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_socketDB_lookUp_dtlsConnection(in Socket p_local, in Socket p_remote)
runs on EPTF_COAP_LocalTransport_CT
return integer
@@ -552,6 +793,22 @@ module EPTF_COAP_LocalTransport_Functions
return vl_idx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_socketDB_lookUp_connId
+ //
+ // Purpose:
+ // Gets the index of an <SocketEntry> element in *v_COAP_LocalTransport_localSocketDB* <SocketDB> database
+ // based on its connection id
+ //
+ // Parameters:
+ // p_connId - *in* *integer* - the connection id
+ //
+ // Returns:
+ // *integer* - the index of the element, or -1 if not found
+ //
+ // Related Type:
+ // <SocketDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_socketDB_lookUp_connId(in integer p_connId)
runs on EPTF_COAP_LocalTransport_CT
return integer
@@ -561,6 +818,21 @@ module EPTF_COAP_LocalTransport_Functions
return vl_idx;
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_socketDB_get
+ //
+ // Purpose:
+ // Retrieves an element from the *v_COAP_LocalTransport_localSocketDB* <SocketDB> database
+ //
+ // Parameters:
+ // p_idx - *in* *integer* - the index of the element to retrieved
+ //
+ // Returns:
+ // p_sock - *inout* <SocketEntry> - the retrieved element
+ //
+ // Related Type:
+ // <SocketDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_socketDB_get(in integer p_idx, inout SocketEntry p_sock)
runs on EPTF_COAP_LocalTransport_CT
{
@@ -570,13 +842,25 @@ module EPTF_COAP_LocalTransport_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_LocalTransport_socketDB_remove
+ //
+ // Purpose:
+ // Removes an element from the *v_COAP_LocalTransport_localSocketDB* <SocketDB> database and frees up its reserved resources
+ //
+ // Parameters:
+ // p_idx - *in* *integer* - the index of the element to be removed
+ //
+ // Related Type:
+ // <SocketDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_LocalTransport_socketDB_remove(in integer p_idx)
runs on EPTF_COAP_LocalTransport_CT
{
if (p_idx < sizeof(v_COAP_LocalTransport_localSocketDB.data) and p_idx >= 0)
{
f_COAP_Transport_Logging_DEBUG(log2str(": "," removing socket ", p_idx, " ", v_COAP_LocalTransport_localSocketDB.data[p_idx]));
-
+
f_EPTF_int2int_HashMap_Erase(
v_COAP_LocalTransport_localSocketDB.connId2eIdx_hashRef,
v_COAP_LocalTransport_localSocketDB.data[p_idx].connId
@@ -585,12 +869,27 @@ module EPTF_COAP_LocalTransport_Functions
v_COAP_LocalTransport_localSocketDB.hashRef,
f_EPTF_COAP_SocketEntry_hash(v_COAP_LocalTransport_localSocketDB.data[p_idx])
);
-
+
v_COAP_LocalTransport_localSocketDB.data[p_idx] := c_SocketEntry_init;
f_EPTF_FBQ_moveFromBusyToFreeTail(p_idx, v_COAP_LocalTransport_localSocketDB.queue);
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_SocketEntry_hash
+ //
+ // Purpose:
+ // Hash function for lookups used by the *v_COAP_LocalTransport_localSocketDB* <SocketDB> database
+ //
+ // Parameters:
+ // p_entry - *in* <SocketEntry> - the socket entry to get a hash of
+ //
+ // Returns:
+ // *charstring* - string hash unique of a <SocketEntry> element
+ //
+ // Related Type:
+ // <SocketDB>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_SocketEntry_hash(in SocketEntry p_entry)
return charstring
{
@@ -602,91 +901,61 @@ module EPTF_COAP_LocalTransport_Functions
return f_EPTF_COAP_Socket_hash(p_entry.addr);
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_Socket_hash
+ //
+ // Purpose:
+ // Hash function for lookups used by the *v_COAP_LocalTransport_localSocketDB* <SocketDB> database
+ //
+ // Parameters:
+ // p_sock - *in* <Socket> - the socket to get a hash of
+ //
+ // Returns:
+ // *charstring* - string hash unique of a <Socket> element
+ //
+ // Related Type:
+ // <SocketDB>, <Socket>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_Socket_hash(Socket p_sock)
return charstring
{
return p_sock.hostName&":"&int2str(p_sock.portNumber);
}
-
+
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_DTLSConnection_hash
+ //
+ // Purpose:
+ // Hash function for lookups used by the *v_COAP_LocalTransport_localSocketDB* <SocketDB> database
+ //
+ // Parameters:
+ // p_local - *in* <Socket> - the local socket of the DTLS connection
+ // p_remote - *in* <Socket> - the remote socket of the DTLS connection
+ //
+ // Returns:
+ // *charstring* - string hash unique of a <DTLSConnection> element
+ //
+ // Related Type:
+ // <SocketDB>, <DTLSConnection>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_DTLSConnection_hash(in Socket p_local, in Socket p_remote)
return charstring
{
return f_EPTF_COAP_Socket_hash(p_local)&"-"&f_EPTF_COAP_Socket_hash(p_remote);
}
-
- /*
- function f_EPTF_COAP_LocalTransport_dtlsConnectionDB_init()
- runs on EPTF_COAP_LocalTransport_CT
- {
- f_EPTF_FBQ_initFreeBusyQueue(v_COAP_LocalTransport_dtlsConnectionDB.queue);
- v_COAP_LocalTransport_dtlsConnectionDB.data := {};
- v_COAP_LocalTransport_dtlsConnectionDB.hashRef := f_EPTF_str2int_HashMap_New(c_EPTF_COAP_LocalTransport_DTLSConnectionDB);
- }
-
- function f_EPTF_COAP_LocalTransport_dtlsConnectionDB_cleanUp()
- runs on EPTF_COAP_LocalTransport_CT
- {
- f_EPTF_FBQ_initFreeBusyQueue(v_COAP_LocalTransport_dtlsConnectionDB.queue);
- v_COAP_LocalTransport_dtlsConnectionDB.data := {};
- f_EPTF_str2int_HashMap_Delete(c_EPTF_COAP_LocalTransport_DTLSConnectionDB);
- }
-
- function f_EPTF_COAP_LocalTransport_dtlsConnectionDB_add(in DTLSConnection p_dtlsConn)
- runs on EPTF_COAP_LocalTransport_CT
- return integer
- {
- var integer v_idx := f_EPTF_COAP_LocalTransport_dtlsConnectionDB_lookUp(p_dtlsConn.localAddr, p_dtlsConn.remoteAddr);
-
- if (v_idx == -1)
- {
- v_idx := f_EPTF_FBQ_getOrCreateFreeSlot(v_COAP_LocalTransport_dtlsConnectionDB.queue);
- f_EPTF_FBQ_moveFromFreeHeadToBusyTail(v_COAP_LocalTransport_dtlsConnectionDB.queue);
-
- f_COAP_Transport_Logging_DEBUG(log2str(": "," adding DTLS connection ", v_idx, " ", p_dtlsConn));
-
- f_EPTF_str2int_HashMap_Insert(v_COAP_LocalTransport_dtlsConnectionDB.hashRef, f_EPTF_COAP_DTLSConnection_hash(p_dtlsConn.localAddr, p_dtlsConn.remoteAddr), v_idx);
-
- v_COAP_LocalTransport_dtlsConnectionDB.data[v_idx] := p_dtlsConn;
- }
-
- return v_idx;
- }
-
- function f_EPTF_COAP_LocalTransport_dtlsConnectionDB_lookUp(in Socket p_local, in Socket p_remote)
- runs on EPTF_COAP_LocalTransport_CT
- return integer
- {
- var integer vl_idx := -1;
- f_EPTF_str2int_HashMap_Find(v_COAP_LocalTransport_dtlsConnectionDB.hashRef, f_EPTF_COAP_DTLSConnection_hash(p_local,p_remote), vl_idx);
- return vl_idx;
- }
-
- function f_EPTF_COAP_LocalTransport_dtlsConnectionDB_get(in integer p_idx, inout DTLSConnection p_dtlsConn)
- runs on EPTF_COAP_LocalTransport_CT
- {
- if (p_idx < sizeof(v_COAP_LocalTransport_dtlsConnectionDB.data))
- {
- p_dtlsConn := v_COAP_LocalTransport_dtlsConnectionDB.data[p_idx];
- }
- }
-
- function f_EPTF_COAP_LocalTransport_dtlsConnectionDB_remove(in integer p_idx)
- runs on EPTF_COAP_LocalTransport_CT
- {
- f_EPTF_str2int_HashMap_Erase(
- v_COAP_LocalTransport_dtlsConnectionDB.hashRef,
- f_EPTF_COAP_DTLSConnection_hash(
- v_COAP_LocalTransport_dtlsConnectionDB.data[p_idx].localAddr,
- v_COAP_LocalTransport_dtlsConnectionDB.data[p_idx].remoteAddr
- )
- );
-
- v_COAP_LocalTransport_dtlsConnectionDB.data[p_idx] := c_DTLSConnection_init;
- f_EPTF_FBQ_moveFromBusyToFreeTail(p_idx, v_COAP_LocalTransport_dtlsConnectionDB.queue);
- }
- */
-
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_Transport_Logging_VERBOSE
+ //
+ // Purpose:
+ // Logging functions for the VERBOSE log level
+ //
+ // Parameters:
+ // pl_message - *in* *charstring* - string to be logged
+ //
+ // Related Types:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_COAP_Transport_Logging_VERBOSE(in @lazy charstring pl_message)
runs on EPTF_COAP_LocalTransport_CT
{
@@ -695,6 +964,18 @@ module EPTF_COAP_LocalTransport_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_Transport_Logging_DEBUG
+ //
+ // Purpose:
+ // Logging functions for the DEBUG log level
+ //
+ // Parameters:
+ // pl_message - *in* *charstring* - string to be logged
+ //
+ // Related Types:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_COAP_Transport_Logging_DEBUG(in @lazy charstring pl_message)
runs on EPTF_COAP_LocalTransport_CT
{
@@ -703,6 +984,18 @@ module EPTF_COAP_LocalTransport_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_Transport_Logging_WARNING
+ //
+ // Purpose:
+ // Logging functions for the WARNING log level
+ //
+ // Parameters:
+ // pl_message - *in* *charstring* - string to be logged
+ //
+ // Related Types:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_COAP_Transport_Logging_WARNING(in @lazy charstring pl_message)
runs on EPTF_COAP_LocalTransport_CT
{
@@ -711,6 +1004,18 @@ module EPTF_COAP_LocalTransport_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_COAP_Transport_Logging_ERROR
+ //
+ // Purpose:
+ // Logging functions for the ERROR log level
+ //
+ // Parameters:
+ // pl_message - *in* *charstring* - string to be logged
+ //
+ // Related Types:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_COAP_Transport_Logging_ERROR(in @lazy charstring pl_message)
runs on EPTF_COAP_LocalTransport_CT
{
@@ -719,6 +1024,18 @@ module EPTF_COAP_LocalTransport_Functions
}
}
+ ///////////////////////////////////////////////////////////
+ // Function: f_EPTF_COAP_IPL4asp_handleResult
+ //
+ // Purpose:
+ // Inernal (private) function to handle the results of the underlying IPL4 transport layer
+ //
+ // Parameters:
+ // p_res - *inout* *Result* - result of an IPL4 transport operation
+ //
+ // Related Types:
+ // <EPTF_COAP_LocalTransport_CT>
+ ///////////////////////////////////////////////////////////
function f_EPTF_COAP_IPL4asp_handleResult(inout Result p_res)
runs on EPTF_COAP_LocalTransport_CT
return boolean
diff --git a/src/EPTF_COAP_Transport_Definitions.ttcn b/src/EPTF_COAP_Transport_Definitions.ttcn
index 5e7dbd2..6d3ceb6 100644
--- a/src/EPTF_COAP_Transport_Definitions.ttcn
+++ b/src/EPTF_COAP_Transport_Definitions.ttcn
@@ -14,25 +14,128 @@
// Updated: 2017-09-01
// Contact: http://ttcn.ericsson.se
///////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+// Module: EPTF_COAP_Transport_Definitions
+//
+// Purpose:
+// This module contains the generic transport definitions of the COAP load generator
+//
+// Component Diagram:
+// (see EPTF_COAP_Transport_Definitions.components.jpg)
+//
+// See also:
+// - <EPTF_COAP_LGen_Definitions>
+// - <EPTF_COAP_Transport_User_CT>
+// - <EPTF_COAP_Transport_Provider_CT>
+///////////////////////////////////////////////////////////////
+/*****************************************************************
+ @startuml EPTF_COAP_Transport_Definitions.components.jpg
+ package "EPTF_COAP_Transport_Definitions" {
+ class EPTF_COAP_Transport_User_CT {
+ fcb_EPTF_COAP_Transport_sendMessage vf_EPTF_COAP_Transport_send
+ fcb_EPTF_COAP_Transport_apiRequest vf_EPTF_COAP_Transport_apiRequest
+ }
+ class EPTF_COAP_Transport_Provider_CT {
+ fcb_EPTF_COAP_Transport_receiveMessage vf_EPTF_COAP_Transport_receiveMessage
+ fcb_EPTF_COAP_Transport_receiveEvent fcb_EPTF_COAP_Transport_receiveEvent
+ fcb_EPTF_COAP_Transport_apiResponse vf_EPTF_COAP_Transport_apiResponse
+ }
+ EPTF_COAP_Transport_Provider_CT <-> EPTF_COAP_Transport_User_CT
+ }
+ @enduml
+******************************************************************/
module EPTF_COAP_Transport_Definitions
{
import from CoAP_Types all;
import from IPL4asp_Types all;
+ ///////////////////////////////////////////////////////////
+ // Type: fcb_EPTF_COAP_Transport_receiveMessage
+ //
+ // Purpose:
+ // Call-back function type for reporting received <EPTF_COAP_PDU> COAP message
+ //
+ // Elements:
+ // pl_message - *in* <EPTF_COAP_PDU> - received COAP message
+ ///////////////////////////////////////////////////////////
type function fcb_EPTF_COAP_Transport_receiveMessage(in EPTF_COAP_PDU pl_message) runs on self;
+
+ ///////////////////////////////////////////////////////////
+ // Type: fcb_EPTF_COAP_Transport_receiveEvent
+ //
+ // Purpose:
+ // Call-back function type for reporting received <ASP_Event> COAP event
+ //
+ // Elements:
+ // p_event - *in* <ASP_Event> - received COAP event
+ ///////////////////////////////////////////////////////////
type function fcb_EPTF_COAP_Transport_receiveEvent(in ASP_Event p_event) runs on self;
+
+ ///////////////////////////////////////////////////////////
+ // Type: fcb_EPTF_COAP_Transport_sendMessage
+ //
+ // Purpose:
+ // Call-back function type for sending a <EPTF_COAP_PDU> COAP message
+ //
+ // Elements:
+ // pl_msg - *in* <EPTF_COAP_PDU> - COAP message to be sent
+ ///////////////////////////////////////////////////////////
type function fcb_EPTF_COAP_Transport_sendMessage(in EPTF_COAP_PDU pl_msg) runs on self;
+
+ ///////////////////////////////////////////////////////////
+ // Type: fcb_EPTF_COAP_Transport_apiRequest
+ //
+ // Purpose:
+ // Call-back function type for sending a <EPTF_COAP_Transport_Request> COAP transport request
+ //
+ // Elements:
+ // pl_req - *in* <EPTF_COAP_Transport_Request> - COAP transport request to be sent
+ ///////////////////////////////////////////////////////////
type function fcb_EPTF_COAP_Transport_apiRequest(in EPTF_COAP_Transport_Request pl_req) runs on self;
+
+ ///////////////////////////////////////////////////////////
+ // Type: fcb_EPTF_COAP_Transport_apiResponse
+ //
+ // Purpose:
+ // Call-back function type for reporting a <EPTF_COAP_Transport_Response> COAP transport response
+ //
+ // Elements:
+ // pl_rsp - *in* <EPTF_COAP_Transport_Response> - COAP transport response to be reported
+ ///////////////////////////////////////////////////////////
type function fcb_EPTF_COAP_Transport_apiResponse(in EPTF_COAP_Transport_Response pl_rsp) runs on self;
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_PDU
+ //
+ // Purpose:
+ // Encapsulates a COAP PDU with the corresponding entity (and FSM) indices and transport information
+ //
+ // Elements:
+ // pdu - <CoAP_ReqResp> - COAP PDU
+ // transportParams - <EPTF_COAP_TransportParameters> - transport protocol information
+ // eIdx - *integer* - entity index
+ // fsmIdx - *integer* - fsm index
+ ///////////////////////////////////////////////////////////
type record EPTF_COAP_PDU
{
CoAP_ReqResp pdu,
EPTF_COAP_TransportParameters transportParams,
integer eIdx,
- integer fsmIdx
+ integer fsmIdx
}
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_TransportParameters
+ //
+ // Purpose:
+ // Encapsulates COAP transport protocol information
+ //
+ // Elements:
+ // localAddress - <Socket> - local address and local port
+ // remoteAddress - <Socket> - remote address and remote port
+ // proto - <ProtoTuple> - transport protocol description
+ ///////////////////////////////////////////////////////////
type record EPTF_COAP_TransportParameters
{
Socket localAddress,
@@ -40,6 +143,20 @@ module EPTF_COAP_Transport_Definitions
ProtoTuple proto
}
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_Transport_Request
+ //
+ // Purpose:
+ // API exposed for requesting transport operation from the <EPTF_COAP_Transport_Provider_CT>
+ //
+ // Elements:
+ // eIdx - *integer* - entity index
+ // fsmIdx - *integer* - fsm index
+ // params - <EPTF_COAP_Transport_RequestParams> - details of the transport request
+ //
+ // Related Types:
+ // <fcb_EPTF_COAP_Transport_apiRequest>
+ ///////////////////////////////////////////////////////////
type record EPTF_COAP_Transport_Request
{
integer eIdx,
@@ -54,18 +171,50 @@ module EPTF_COAP_Transport_Definitions
params := omit
}
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_Transport_RequestParams
+ //
+ // Purpose:
+ // A union encapsulating various transport requests
+ //
+ // Elements:
+ // startListening - <EPTF_COAP_Transport_startListening> - request for initializing a listening socket
+ // startDTLS - <EPTF_COAP_Transport_dtlsConnect> - request for starting DTLS
+ ///////////////////////////////////////////////////////////
type union EPTF_COAP_Transport_RequestParams
{
EPTF_COAP_Transport_startListening startListening,
EPTF_COAP_Transport_dtlsConnect startDTLS
}
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_Transport_startListening
+ //
+ // Purpose:
+ // Transport request for initializing a listening socket
+ //
+ // Elements:
+ // localAddress - <Socket> - local address and local port
+ // protocol - <ProtoTuple> - transport protocol description
+ ///////////////////////////////////////////////////////////
type record EPTF_COAP_Transport_startListening
{
Socket localAddress,
ProtoTuple protocol
}
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_Transport_dtlsConnect
+ //
+ // Purpose:
+ // Transport request for starting DTLS
+ //
+ // Elements:
+ // localAddress - <Socket> - local address and local port
+ // remoteAddress - <Socket> - remote address and remote port
+ // pskIdentity - *charstring* *optional* - identity for PSK authentication
+ // pskKey - *charstring* *optional* - key for PSK authentication
+ ///////////////////////////////////////////////////////////
type record EPTF_COAP_Transport_dtlsConnect
{
Socket localAddress,
@@ -74,6 +223,21 @@ module EPTF_COAP_Transport_Definitions
charstring pskKey optional
}
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_Transport_Response
+ //
+ // Purpose:
+ // API for responding to transport operations to the <EPTF_COAP_Transport_User_CT>
+ //
+ // Elements:
+ // succ - *boolean* - indicates if the requested operation was performed succesfully
+ // eIdx - *integer* - entity index
+ // fsmIdx - *integer* - fsm index
+ // params - <EPTF_COAP_Transport_Response> - details of the transport response
+ //
+ // Related Types:
+ // <fcb_EPTF_COAP_Transport_apiResponse>
+ ///////////////////////////////////////////////////////////
type record EPTF_COAP_Transport_Response
{
boolean succ,
@@ -90,6 +254,17 @@ module EPTF_COAP_Transport_Definitions
params := omit
}
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_Transport_ResponseParams
+ //
+ // Purpose:
+ // A union encapsulating various transport responses
+ //
+ // Elements:
+ // listening - *boolean* - indicates if the request operation was creating a listning socket
+ // transportError - *charstring* - indicates that some transport error occured, the string contains the description
+ // dtlsConnectionClosed - *boolean* - indicates that a DTLS connection was closed or interrupted
+ ///////////////////////////////////////////////////////////
type union EPTF_COAP_Transport_ResponseParams
{
boolean listening,
@@ -97,6 +272,29 @@ module EPTF_COAP_Transport_Definitions
boolean dtlsConnectionClosed
}
+ /*****************************************************************
+ @startuml EPTF_COAP_Transport_Definitions.EPTF_COAP_Transport_Provider_CT.jpg
+ class EPTF_COAP_Transport_Provider_CT {
+ fcb_EPTF_COAP_Transport_receiveMessage vf_EPTF_COAP_Transport_receiveMessage
+ fcb_EPTF_COAP_Transport_receiveEvent fcb_EPTF_COAP_Transport_receiveEvent
+ fcb_EPTF_COAP_Transport_apiResponse vf_EPTF_COAP_Transport_apiResponse
+ }
+ @enduml
+ *****************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_Transport_Provider_CT
+ //
+ // Purpose:
+ // Base component type for a COAP transport realization
+ //
+ // Class:
+ // (see EPTF_COAP_Transport_Definitions.EPTF_COAP_Transport_Provider_CT.jpg)
+ //
+ // Variables:
+ // vf_EPTF_COAP_Transport_receiveMessage - <fcb_EPTF_COAP_Transport_receiveMessage> - Function hook for reporting received messages
+ // vf_EPTF_COAP_Transport_receiveEvent - <fcb_EPTF_COAP_Transport_receiveEvent> - Function hook for reporting received events
+ // vf_EPTF_COAP_Transport_apiResponse - <fcb_EPTF_COAP_Transport_apiResponse> - Function hook for reporting transport API responses
+ ///////////////////////////////////////////////////////////
type component EPTF_COAP_Transport_Provider_CT
{
var fcb_EPTF_COAP_Transport_receiveMessage vf_EPTF_COAP_Transport_receiveMessage := null;
@@ -104,6 +302,27 @@ module EPTF_COAP_Transport_Definitions
var fcb_EPTF_COAP_Transport_apiResponse vf_EPTF_COAP_Transport_apiResponse := null;
}
+ /*****************************************************************
+ @startuml EPTF_COAP_Transport_Definitions.EPTF_COAP_Transport_User_CT.jpg
+ class EPTF_COAP_Transport_User_CT {
+ fcb_EPTF_COAP_Transport_sendMessage vf_EPTF_COAP_Transport_send
+ fcb_EPTF_COAP_Transport_apiRequest vf_EPTF_COAP_Transport_apiRequest
+ }
+ @enduml
+ *****************************************************************/
+ ///////////////////////////////////////////////////////////
+ // Type: EPTF_COAP_Transport_User_CT
+ //
+ // Purpose:
+ // Base component type for a COAP transport user realization
+ //
+ // Class:
+ // (see EPTF_COAP_Transport_Definitions.EPTF_COAP_Transport_User_CT.jpg)
+ //
+ // Variables:
+ // vf_EPTF_COAP_Transport_send - <fcb_EPTF_COAP_Transport_sendMessage> - Function hook for reporting received messages
+ // vf_EPTF_COAP_Transport_apiRequest - <fcb_EPTF_COAP_Transport_apiRequest> - Function hook for reporting received events
+ ///////////////////////////////////////////////////////////
type component EPTF_COAP_Transport_User_CT
{
var fcb_EPTF_COAP_Transport_sendMessage vf_EPTF_COAP_Transport_send := null;
diff --git a/test/EPTF_COAP_Tests.ttcn b/test/EPTF_COAP_Tests.ttcn
index 4b98263..5f0683a 100644
--- a/test/EPTF_COAP_Tests.ttcn
+++ b/test/EPTF_COAP_Tests.ttcn
@@ -14,6 +14,21 @@
// Updated: 2017-09-01
// Contact: http://ttcn.ericsson.se
///////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////
+// Module: EPTF_COAP_Tests
+//
+// Purpose:
+// This module contains the component tests for the EPTF COAP Applib
+//
+// Module Parameters:
+// tsp_SUT_localHost - *charstring* - Hostname of the tested COAP entity
+// tsp_SUT_localPort - *integer* - Port number of the tested COAP entity
+// tsp_SUT_remoteHost - *charstring* - Hostname of the tester component
+// tsp_SUT_remotePort - *integer* - Port number of the tester component
+//
+///////////////////////////////////////////////////////////////
+
module EPTF_COAP_Tests
{
import from EPTF_MBT_LGen_Definitions all;
@@ -412,16 +427,18 @@ module EPTF_COAP_Tests
const integer c_t_NotFound := 3;
- /*****************************************************************
- *
- * Testcase:
- * tc_send_NON
- *
- * Description:
- * Testcase for sending out a NON request
- *
- * Call flow:
- * @startuml
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_send_NON
+ //
+ // Purpose:
+ // Testcase for sending out a NON request
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_send_NON.jpg)
+ ///////////////////////////////////////////////////////////
+ /*****************************************************************
+ * @startuml EPTF_COAP_Tests.tc_send_NON.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_setRemoteAddress_byIntIdx(c_remoteAddr)
@@ -454,16 +471,19 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_send_NON_recv_NON
+ //
+ // Purpose:
+ // Testcase for sending out a NON request and receiving a NON answer.
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_send_NON_recv_NON.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_send_NON_recv_NON
- *
- * Description:
- * Testcase for sending out a NON request and receiving a NON answer.
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_send_NON_recv_NON.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_setRemoteAddress_byIntIdx(c_remoteAddr)
@@ -500,16 +520,19 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_send_CON
+ //
+ // Purpose:
+ // Testcase for sending out a CON request
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_send_CON.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_send_CON
- *
- * Description:
- * Testcase for sending out a CON request
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_send_CON.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_setRemoteAddress_byIntIdx(c_remoteAddr)
@@ -542,17 +565,20 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_retransmit_CON
+ //
+ // Purpose:
+ // Testcase for checking that the applib will retransmit the CON request
+ // in case there is now response.
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_retransmit_CON.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_retransmit_CON
- *
- * Description:
- * Testcase for checking that the applib will retransmit the CON request
- * in case there is now response.
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_retransmit_CON.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_setRemoteAddress_byIntIdx(c_remoteAddr)
@@ -593,17 +619,20 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_timeout_CON
+ //
+ // Purpose:
+ // Testcase for checking that the applib will retransmit the CON request
+ // in case there is now response and eventually it will report a transaction timeout.
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_timeout_CON.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_timeout_CON
- *
- * Description:
- * Testcase for checking that the applib will retransmit the CON request
- * in case there is now response and eventually it will report a transaction timeout.
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_timeout_CON.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_setRemoteAddress_byIntIdx(c_remoteAddr)
@@ -643,17 +672,20 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_send_CON_recv_ACK
+ //
+ // Purpose:
+ // Testcase for checking that the applib will succesfully handle an ACK
+ // in response to a CON request.
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_send_CON_recv_ACK.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_send_CON_recv_ACK
- *
- * Description:
- * Testcase for checking that the applib will succesfully handle an ACK
- * in response to a CON request.
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_send_CON_recv_ACK.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_setRemoteAddress_byIntIdx(c_remoteAddr)
@@ -690,17 +722,20 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_send_CON_retransmit_CON_recv_ACK
+ //
+ // Purpose:
+ // Testcase for checking that the applib will succesfully handle an ACK
+ // in response to a CON request even if there were some retransmissions.
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_send_CON_retransmit_CON_recv_ACK.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_send_CON_retransmit_CON_recv_ACK
- *
- * Description:
- * Testcase for checking that the applib will succesfully handle an ACK
- * in response to a CON request even if there were some retransmissions.
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_send_CON_retransmit_CON_recv_ACK.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_setRemoteAddress_byIntIdx(c_remoteAddr)
@@ -747,17 +782,20 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_send_CON_recv_emptyACK_recv_NON
+ //
+ // Purpose:
+ // Testcase for checking that the applib will succesfully handle an empty ACK
+ // in response to a CON request. And finally the payload will be received in a NON
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_send_CON_recv_emptyACK_recv_NON.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_send_CON_recv_emptyACK_recv_NON
- *
- * Description:
- * Testcase for checking that the applib will succesfully handle an empty ACK
- * in response to a CON request. And finally the payload will be received in a NON
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_send_CON_recv_emptyACK_recv_NON.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_setRemoteAddress_byIntIdx(c_remoteAddr)
@@ -798,18 +836,21 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_send_CON_recv_emptyACK_recv_CON
+ //
+ // Purpose:
+ // Testcase for checking that the applib will succesfully handle an empty ACK
+ // in response to a CON request. And finally the payload will be received in a CON
+ // which must be acknowledged with an empty ACK.
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_send_CON_recv_emptyACK_recv_CON.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_send_CON_recv_emptyACK_recv_CON
- *
- * Description:
- * Testcase for checking that the applib will succesfully handle an empty ACK
- * in response to a CON request. And finally the payload will be received in a CON
- * which must be acknowledged with an empty ACK.
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_send_CON_recv_emptyACK_recv_CON.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_setRemoteAddress_byIntIdx(c_remoteAddr)
@@ -854,17 +895,20 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_call_startListening
+ //
+ // Purpose:
+ // Testcase for checking that the applib can open a listening socket
+ // to be able to receive incoming COAP messages
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_call_startListening.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_call_startListening
- *
- * Description:
- * Testcase for checking that the applib can open a listening socket
- * to be able to receive incoming COAP messages
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_call_startListening.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -889,16 +933,19 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_NON
+ //
+ // Purpose:
+ // Testcase for checking that the applib can receive a NON request
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_NON.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_NON
- *
- * Description:
- * Testcase for checking that the applib can receive a NON request
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_NON.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -930,6 +977,17 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_NON_send_NON
+ //
+ // Purpose:
+ // Testcase for checking that the applib can receive a NON request
+ // and the answer will be sent out as a NON response
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_NON_send_NON.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
*
* Testcase:
@@ -940,7 +998,7 @@ module EPTF_COAP_Tests
* and the answer will be sent out as a NON response
*
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_NON_send_NON.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -982,17 +1040,20 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_NON_recv_Duplicate_send_NON
+ //
+ // Purpose:
+ // Testcase for checking that after receiving a NON request, the applib
+ // filters out the duplicates
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_NON_recv_Duplicate_send_NON.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_NON_recv_Duplicate_send_NON
- *
- * Description:
- * Testcase for checking that after receiving a NON request, the applib
- * filters out the duplicates
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_NON_recv_Duplicate_send_NON.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1039,17 +1100,20 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_NON_send_NON_recv_Duplicate
+ //
+ // Purpose:
+ // Testcase for checking that after receiving a NON request, the applib
+ // filters out the duplicates even after it has sent an answer.
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_NON_send_NON_recv_Duplicate.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_NON_send_NON_recv_Duplicate
- *
- * Description:
- * Testcase for checking that after receiving a NON request, the applib
- * filters out the duplicates even after it has sent an answer.
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_NON_send_NON_recv_Duplicate.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1097,18 +1161,20 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_NON_send_NON_wait_lifetime_recv_no_duplicate
+ //
+ // Purpose:
+ // Testcase for checking that after handling a NON request, the applib
+ // won't filter out the duplicates after the coap transaction exxchange lifetime timer
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_NON_send_NON_wait_lifetime_recv_no_duplicate.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_NON_send_NON_wait_lifetime_recv_no_duplicate
- *
- * Description:
- * Testcase for checking that after handling a NON request, the applib
- * won't filter out the duplicates after the coap transaction exxchange lifetime timer
- * expired.
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_NON_send_NON_wait_lifetime_recv_no_duplicate.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1158,16 +1224,19 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_CON
+ //
+ // Purpose:
+ // Testcase for checking that a CON reqest can be received
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_CON.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_CON
- *
- * Description:
- * Testcase for checking that a CON reqest can be received
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_CON.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1199,16 +1268,19 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_CON_send_ACK
+ //
+ // Purpose:
+ // Testcase for checking that a CON request is answered with an ACK
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_CON_send_ACK.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_CON_send_ACK
- *
- * Description:
- * Testcase for checking that a CON request is answered with an ACK
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_CON_send_ACK.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1247,19 +1319,22 @@ module EPTF_COAP_Tests
f_handleVerdict(f_IFW_CoapPeer_check(peer, tr_Content(ACKNOWLEDGEMENT)));
f_COAP_Tests_end();
- }
+ }
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_CON_recv_Duplicate_send_ACK
+ //
+ // Purpose:
+ // Testcase for checking that after a CON request is received
+ // duplicates are filtered out.
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_CON_recv_Duplicate_send_ACK.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_CON_recv_Duplicate_send_ACK
- *
- * Description:
- * Testcase for checking that after a CON request is received
- * duplicates are filtered out.
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_CON_recv_Duplicate_send_ACK.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1304,18 +1379,21 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_CON_send_ACK_recv_Duplicate_retransmit_ACK
+ //
+ // Purpose:
+ // Testcase for checking that after a CON request is received and answered
+ // the CON-GET duplicates are automatically answered with the retransmission of
+ // the ACK answer.
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_CON_send_ACK_recv_Duplicate_retransmit_ACK.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_CON_send_ACK_recv_Duplicate_retransmit_ACK
- *
- * Description:
- * Testcase for checking that after a CON request is received and answered
- * the CON-GET duplicates are automatically answered with the retransmission of
- * the ACK answer.
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_CON_send_ACK_recv_Duplicate_retransmit_ACK.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1362,18 +1440,21 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
-
+
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_CON_send_emptyACK
+ //
+ // Purpose:
+ // Testcase for checking that a CON request can be answered with an
+ // empty ACK
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_CON_send_emptyACK.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_CON_send_emptyACK
- *
- * Description:
- * Testcase for checking that a CON request can be answered with an
- * empty ACK
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_CON_send_emptyACK.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1420,18 +1501,21 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
-
+
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_CON_send_emptyACK_send_CON_recv_ACK
+ //
+ // Purpose:
+ // Testcase for checking that a CON request can be answered with an
+ // empty ACK, then the payload can be sent in a new CON transaction.
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_CON_send_emptyACK_send_CON_recv_ACK.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_CON_send_emptyACK_send_CON_recv_ACK
- *
- * Description:
- * Testcase for checking that a CON request can be answered with an
- * empty ACK, then the payload can be sent in a new CON transaction.
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_CON_send_emptyACK_send_CON_recv_ACK.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1481,19 +1565,22 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
-
+
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_CON_OBS_send_ACK_200OK
+ //
+ // Purpose:
+ // Testcase for checking that a a request with the Observe option
+ // is reported as an OBSERVE request and can be answered with a 2xx
+ // postivie response
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_CON_OBS_send_ACK_200OK.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_CON_OBS_send_ACK_200OK
- *
- * Description:
- * Testcase for checking that a a request with the Observe option
- * is reported as an OBSERVE request and can be answered with a 2xx
- * postivie response
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_CON_OBS_send_ACK_200OK.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1535,19 +1622,22 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
-
+
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_CON_OBS_send_ACK_404NotFound
+ //
+ // Purpose:
+ // Testcase for checking that a a request with the Observe option
+ // is reported as an OBSERVE request and can be answered with a 4xx
+ // negative response
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_CON_OBS_send_ACK_404NotFound.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_CON_OBS_send_ACK_404NotFound
- *
- * Description:
- * Testcase for checking that a a request with the Observe option
- * is reported as an OBSERVE request and can be answered with a 4xx
- * negative response
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_CON_OBS_send_ACK_404NotFound.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1589,19 +1679,22 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
-
+
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_CON_OBS_send_emptyACK_send_CON_200OK_recv_ACK
+ //
+ // Purpose:
+ // Testcase for checking that a a request with the Observe option
+ // is reported as an OBSERVE request and can be answered with an empty
+ // ACK and then with a positive response eventually.
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_CON_OBS_send_emptyACK_send_CON_200OK_recv_ACK.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_CON_OBS_send_emptyACK_send_CON_200OK_recv_ACK
- *
- * Description:
- * Testcase for checking that a a request with the Observe option
- * is reported as an OBSERVE request and can be answered with an empty
- * ACK and then with a positive response eventually.
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_CON_OBS_send_emptyACK_send_CON_200OK_recv_ACK.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1654,18 +1747,21 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
-
+
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_CON_OBS_send_ACK_200OK_send_Notification
+ //
+ // Purpose:
+ // Testcase for checking that after accepting an OBSERVE request
+ // it is possible to send out notifications
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_CON_OBS_send_ACK_200OK_send_Notification.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_CON_OBS_send_ACK_200OK_send_Notification
- *
- * Description:
- * Testcase for checking that after accepting an OBSERVE request
- * it is possible to send out notifications
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_CON_OBS_send_ACK_200OK_send_Notification.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1716,19 +1812,22 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
-
+
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_CON_OBS_send_ACK_200OK_send_Notification_withTwoObservers
+ //
+ // Purpose:
+ // Testcase for checking that it is possible to accept observe requests
+ // for the same resource from two separate clients and then sending notifications
+ // for both.
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_CON_OBS_send_ACK_200OK_send_Notification_withTwoObservers.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_CON_OBS_send_ACK_200OK_send_Notification_withTwoObservers
- *
- * Description:
- * Testcase for checking that it is possible to accept observe requests
- * for the same resource from two separate clients and then sending notifications
- * for both.
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_CON_OBS_send_ACK_200OK_send_Notification_withTwoObservers.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1807,19 +1906,22 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
-
+
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_CON_OBS_send_ACK_200OK_send_Notification_recv_RST
+ //
+ // Purpose:
+ // Testcase for checking that after accepting an OBSERVE request
+ // it is possible to send out notifications and the client can unsubscribe
+ // eventually with a RST message to the notification
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_CON_OBS_send_ACK_200OK_send_Notification_recv_RST.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_CON_OBS_send_ACK_200OK_send_Notification_recv_RST
- *
- * Description:
- * Testcase for checking that after accepting an OBSERVE request
- * it is possible to send out notifications and the client can unsubscribe
- * eventually with a RST message to the notification
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_CON_OBS_send_ACK_200OK_send_Notification_recv_RST.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1878,18 +1980,21 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
-
+
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_CON_OBS_send_ACK_200OK_send_Notification_withTwoObservers_recv_RST
+ //
+ // Purpose:
+ // Testcase for checking that the applib can handle more than 1 observers
+ // and these can unsubscribe as well.
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_CON_OBS_send_ACK_200OK_send_Notification_withTwoObservers_recv_RST.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_CON_OBS_send_ACK_200OK_send_Notification_withTwoObservers_recv_RST
- *
- * Description:
- * Testcase for checking that the applib can handle more than 1 observers
- * and these can unsubscribe as well.
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_CON_OBS_send_ACK_200OK_send_Notification_withTwoObservers_recv_RST.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()
@@ -1993,19 +2098,22 @@ module EPTF_COAP_Tests
f_COAP_Tests_end();
}
-
+
+ ///////////////////////////////////////////////////////////
+ //
+ // Testcase: tc_recv_CON_OBS_send_ACK_200OK_send_Notification_recv_Obs1
+ //
+ // Purpose:
+ // Testcase for checking that after accepting an OBSERVE request
+ // it is possible to send out notifications and the client can unsubscribe
+ // eventually with am an Observe:1 option request using the resource uri path
+ //
+ // Action:
+ // (see EPTF_COAP_Tests.tc_recv_CON_OBS_send_ACK_200OK_send_Notification_recv_Obs1.jpg)
+ ///////////////////////////////////////////////////////////
/*****************************************************************
- *
- * Testcase:
- * tc_recv_CON_OBS_send_ACK_200OK_send_Notification_recv_Obs1
- *
- * Description:
- * Testcase for checking that after accepting an OBSERVE request
- * it is possible to send out notifications and the client can unsubscribe
- * eventually with am an Observe:1 option request using the resource uri path
- *
* Call flow:
- * @startuml
+ * @startuml EPTF_COAP_Tests.tc_recv_CON_OBS_send_ACK_200OK_send_Notification_recv_Obs1.jpg
* FSM -> Applib: c_COAP_stepName_init()
* FSM -> Applib: c_COAP_stepName_setLocalAddress(c_localAddr)
* FSM -> Applib: c_COAP_stepName_startListening()

Back to the top