blob: c639d55c11a5a697bc512bed2b9431c4e725f79a [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000-2017 Ericsson Telecom AB
//
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// which accompanies this distribution, and is available at
// http://www.eclipse.org/legal/epl-v10.html
///////////////////////////////////////////////////////////////////////////////
// File: IOT_LGen_Steps.ttcn
// Description:
// Rev: R1A
// Prodnr: LPA 108 661
// Updated: 2017-09-01
// Contact: http://ttcn.ericsson.se
///////////////////////////////////////////////////////////////////////////////
module IOT_LGen_Steps {
import from JSON_Types all;
import from IOT_LGen_Definitions all;
import from EPTF_COAP_LGen_Definitions all;
import from EPTF_COAP_LGen_Functions all;
import from EPTF_MQTT_LGen_Functions all;
import from EPTF_LwM2M_LGen_Functions all;
import from EPTF_LwM2M_Object_Definitions all;
import from EPTF_LwM2M_Object_Functions all;
import from LightweightM2M_Types all;
import from EPTF_HTTP_Functions all;
import from EPTF_HTTP_Transport_Functions all;
import from EPTF_CLL_Common_Definitions all;
import from EPTF_CLL_Variable_Definitions all;
import from EPTF_CLL_Variable_Functions all;
import from EPTF_CLL_LGenBase_Definitions all;
import from EPTF_CLL_LGenBase_StepFunctions all;
import from EPTF_CLL_LGenBase_ConfigFunctions all;
import from EPTF_CLL_ExecCtrlClient_Functions all;
// Generic
const charstring c_IOT_stepName_tcFinished_withVerdict := "IOT App: tcFinished_withVerdict";
const charstring c_IOT_stepName_print_stringParam := "IOT App: print_stringParam";
const charstring c_IOT_stepName_genRndValue_varParams := "IOT App: genRndValue_varParams";
// COAP
const charstring c_IOT_stepName_COAP_setLocalAddress_byVars := "IOT App COAP: setLocalAddress_byVars";
// MQTT
const charstring c_IOT_stepName_MQTT_setLocalAddress_byVars := "IOT App MQTT: setLocalAddress_byVars";
const charstring c_IOT_stepName_MQTT_setClientId_stringParam := "IOT App MQTT: setClientId_stringParam";
// LwM2M
const charstring c_IOT_stepName_LwM2M_setClientNameInRegister := "IOT App LwM2M: setClientNameInRegister";
const charstring c_IOT_stepName_LwM2M_setClientNameInRegister_stringVar := "IOT App LwM2M: setClientNameInRegister_stringVar";
// HTTP
const charstring c_IOT_stepName_HTTP_initEntityContext := "IOT App HTTP: initEntityContext";
const charstring c_IOT_stepName_HTTP_openConnection_byVars := "IOT App HTTP: openConnection_byVars";
const charstring c_IOT_stepName_HTTP_closeConnection := "IOT App HTTP: closeConnection";
const charstring c_IOT_stepName_HTTP_setMethod_stringParam := "IOT App HTTP: setMethod_stringParam";
const charstring c_IOT_stepName_HTTP_setUri_stringParam := "IOT App HTTP: setUri_stringParam";
const charstring c_IOT_stepName_HTTP_addToUri_stringParam := "IOT App HTTP: addToUri_stringParam";
const charstring c_IOT_stepName_HTTP_addToUri_byVars := "IOT App HTTP: addToUri_byVars";
const charstring c_IOT_stepName_HTTP_addHostHeader_byVars := "IOT App HTTP: addHostHeader_byVars";
// Leshan
const charstring c_IOT_stepName_Leshan_getClientFromResponse_intoVar := "IOT App Leshan: getClientFromResponse_intoVar";
// FSM_RegDereg
const charstring c_IOT_stepName_FSM_RegDereg_initResourceValues := "IOT Fsm LWM2M_RegDereg: initResourceValues";
// FSM SimDevice
const charstring c_IOT_stepName_FSM_SimDevice_createResources := "IOT Fsm LWM2M_SimDevice: createResources";
const charstring c_IOT_stepName_FSM_SimDevice_initResourceValues := "IOT Fsm LWM2M_SimDevice: initResourceValues";
const charstring c_IOT_stepName_FSM_SimDevice_initTransport_boolVar := "IOT Fsm LWM2M_SimDevice: initTransport_boolVar";
const charstring c_IOT_stepName_FSM_SimDevice_updateResourceValues := "IOT Fsm LWM2M_SimDevice: updateResourceValues";
const charstring c_IOT_stepName_FSM_SimDevice_handleExecute := "IOT Fsm LWM2M_SimDevice: handleExecute";
function f_IOT_LGen_declareSteps()
runs on IOT_LGen_CT
{
// COAP
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_COAP_setLocalAddress_byVars, refers(f_IOT_LGen_step_COAP_setLocalAddress_byVars)});
// MQTT
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_MQTT_setLocalAddress_byVars, refers(f_IOT_LGen_step_MQTT_setLocalAddress_byVars)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_MQTT_setClientId_stringParam, refers(f_IOT_LGen_step_MQTT_setClientId_stringParam)});
// LwM2M
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_FSM_RegDereg_initResourceValues, refers(f_IOT_LGen_step_FSM_RegDereg_initResourceValues)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_FSM_SimDevice_createResources, refers(f_IOT_LGen_step_FSM_SimDevice_createResources)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_FSM_SimDevice_initResourceValues, refers(f_IOT_LGen_step_FSM_SimDevice_initResourceValues)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_FSM_SimDevice_initTransport_boolVar, refers(f_IOT_LGen_step_FSM_SimDevice_initTransport_boolVar)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_FSM_SimDevice_updateResourceValues, refers(f_IOT_LGen_step_FSM_SimDevice_updateResourceValues)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_FSM_SimDevice_handleExecute, refers(f_IOT_LGen_step_FSM_SimDevice_handleExecute)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_LwM2M_setClientNameInRegister, refers(f_IOT_LGen_step_LwM2M_setClientNameInRegister)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_LwM2M_setClientNameInRegister_stringVar, refers(f_IOT_LGen_step_LwM2M_setClientNameInRegister_stringVar)});
// HTTP
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_HTTP_initEntityContext, refers(f_IOT_LGen_step_HTTP_initEntityContext)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_HTTP_openConnection_byVars, refers(f_IOT_LGen_step_HTTP_openConnection_byVars)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_HTTP_closeConnection, refers(f_IOT_LGen_step_HTTP_closeConnection)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_HTTP_setMethod_stringParam, refers(f_IOT_LGen_step_HTTP_setMethod_stringParam)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_HTTP_setUri_stringParam, refers(f_IOT_LGen_step_HTTP_setUri_stringParam)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_HTTP_addToUri_stringParam, refers(f_IOT_LGen_step_HTTP_addToUri_stringParam)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_HTTP_addToUri_byVars, refers(f_IOT_LGen_step_HTTP_addToUri_byVars)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_HTTP_addHostHeader_byVars, refers(f_IOT_LGen_step_HTTP_addHostHeader_byVars)});
// Leshan
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_Leshan_getClientFromResponse_intoVar, refers(f_IOT_LGen_step_Leshan_getClientFromResponse_intoVar)});
// Common
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_tcFinished_withVerdict, refers(f_IOT_LGen_step_tcFinished_withVerdict)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_print_stringParam, refers(f_IOT_LGen_step_print_stringParam)});
f_EPTF_LGenBase_declareStep(c_IOT_behaviorType, {c_IOT_stepName_genRndValue_varParams, refers(f_IOT_LGen_step_genRndValue_varParams)});
}
function f_IOT_LGen_getEntityIdxinEntityGroup(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
return integer
{
var integer vl_eGrpIdx := f_EPTF_LGenBase_getEGrpOfEntity(pl_ptr.eIdx);
var charstring vl_eGrpName := f_EPTF_LGenBase_entityGroupName(vl_eGrpIdx);
var integer vl_eRelIdxInEGrp :=
f_EPTF_ExecCtrlClient_getFirstEntityOffsetInEGrp(vl_eGrpName) +
f_EPTF_LGenBase_getERelIdx(pl_ptr.eIdx);
//action("========================");
//action("f_EPTF_ExecCtrlClient_getEntityGroupSize: ", f_EPTF_ExecCtrlClient_getEntityGroupSize(eGrpName));
//action("f_EPTF_ExecCtrlClient_getFirstEntityGlobalOffset: ", f_EPTF_ExecCtrlClient_getFirstEntityGlobalOffset(eGrpName));
//action("f_EPTF_ExecCtrlClient_getEntityGroupGlobalOffset: ", f_EPTF_ExecCtrlClient_getEntityGroupGlobalOffset(eGrpName));
//action("f_EPTF_ExecCtrlClient_getFirstEntityOffsetInEGrp: ", f_EPTF_ExecCtrlClient_getFirstEntityOffsetInEGrp(eGrpName));
//action("f_EPTF_LGenBase_getERelIdx(pl_ptr.eIdx): ", f_EPTF_LGenBase_getERelIdx(pl_ptr.eIdx));
//action("eIdx: ", pl_ptr.eIdx);
return vl_eRelIdxInEGrp;
}
// 1st param: localHost: charstring
// 2nd param: localPort: integer
// 3rd param: offset: integer
function f_IOT_LGen_step_COAP_setLocalAddress_byVars(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_COAP_Logging_DEBUG(log2str(%definitionId, pl_ptr));
if (not f_EPTF_COAP_setStepCtx(pl_ptr, v_COAP_ctx)) { return; }
var integer vl_eRelIdxInEGrp := f_IOT_LGen_getEntityIdxinEntityGroup(pl_ptr);
var EPTF_IntegerList vl_varIds := {};
f_EPTF_LGenBase_fsmVarIdListFromStep(pl_ptr, vl_varIds);
if (sizeof(vl_varIds)>=2)
{
var EPTF_Var_DirectContent vl_host, vl_port, vl_offset;
f_EPTF_Var_getContent(vl_varIds[0], vl_host);
f_EPTF_Var_getContent(vl_varIds[1], vl_port);
if (sizeof(vl_varIds)==3) { f_EPTF_Var_getContent(vl_varIds[2], vl_offset); }
else { vl_offset.intVal := vl_eRelIdxInEGrp; }
if (not ischosen(vl_host.charstringVal)) {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " first param is not charstring variable!"));
return;
}
if (not ischosen(vl_port.intVal)) {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " second param is not integer variable!"));
return;
}
if (not ischosen(vl_offset.intVal)) {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " third param is not integer variable!"));
return;
}
var integer vl_localPort := vl_port.intVal + vl_offset.intVal;
f_EPTF_COAP_Logging_VERBOSE(log2str(%definitionId, " calculated local port ",vl_localPort));
if (vl_localPort < 65535)
{
f_EPTF_COAP_transportEndpointDB_add(
{
socket := {
hostName := vl_host.charstringVal,
portNumber := vl_localPort
},
proto := { udp := {} }
},
v_COAP_EntityCtxDB.data[v_COAP_ctx.eCtxIdx].localAddressIdx
);
}
else {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " calculated local port ",vl_localPort," would be larger than 65536! step aborted."));
}
}
else {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " at least two variables are needed as params!"));
}
}
// 1st param: localHost: charstring
// 2nd param: localPort: integer
// 3rd param: offset: integer
function f_IOT_LGen_step_MQTT_setLocalAddress_byVars(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_MQTT_Logging_DEBUG(log2str(%definitionId, pl_ptr));
if (not f_EPTF_MQTT_setStepCtx(pl_ptr, v_MQTT_ctx)) { return; }
var integer vl_eRelIdxInEGrp := f_IOT_LGen_getEntityIdxinEntityGroup(pl_ptr);
var EPTF_IntegerList vl_varIds := {};
f_EPTF_LGenBase_fsmVarIdListFromStep(pl_ptr, vl_varIds);
if (sizeof(vl_varIds)>=2)
{
var EPTF_Var_DirectContent vl_host, vl_port, vl_offset;
f_EPTF_Var_getContent(vl_varIds[0], vl_host);
f_EPTF_Var_getContent(vl_varIds[1], vl_port);
if (sizeof(vl_varIds)==3) { f_EPTF_Var_getContent(vl_varIds[2], vl_offset); }
else { vl_offset.intVal := vl_eRelIdxInEGrp; }
if (not ischosen(vl_host.charstringVal)) {
f_EPTF_MQTT_Logging_WARNING(log2str(%definitionId, " first param is not charstring variable!"));
return;
}
if (not ischosen(vl_port.intVal)) {
f_EPTF_MQTT_Logging_WARNING(log2str(%definitionId, " second param is not integer variable!"));
return;
}
if (not ischosen(vl_offset.intVal)) {
f_EPTF_MQTT_Logging_WARNING(log2str(%definitionId, " third param is not integer variable!"));
return;
}
var integer vl_localPort := vl_port.intVal + vl_offset.intVal;
f_EPTF_MQTT_Logging_VERBOSE(log2str(%definitionId, " calculated local port ",vl_localPort));
if (vl_localPort < 65535)
{
f_EPTF_MQTT_addressDB_add(
{
hostName := vl_host.charstringVal,
portNumber := vl_localPort
},
v_MQTT_sessionDB.data[v_MQTT_ctx.sessionIdx].localAddrIdx
);
}
else {
f_EPTF_MQTT_Logging_WARNING(log2str(%definitionId, " calculated local port ",vl_localPort," would be larger than 65536! step aborted."));
}
}
else {
f_EPTF_MQTT_Logging_WARNING(log2str(%definitionId, " at least two variables are needed as params!"));
}
}
function f_IOT_LGen_step_MQTT_setClientId_stringParam(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_MQTT_Logging_DEBUG(log2str(%definitionId));
if (not f_EPTF_MQTT_setStepCtx(pl_ptr, v_MQTT_ctx)) { return; }
var charstring vl_clientId := f_EPTF_LGenBase_charstringValOfStep(pl_ptr);
var integer vl_eRelIdxInEGrp := f_IOT_LGen_getEntityIdxinEntityGroup(pl_ptr);
v_MQTT_sessionDB.data[v_MQTT_ctx.sessionIdx].clientId := vl_clientId & int2str(vl_eRelIdxInEGrp);
}
function f_IOT_LGen_step_LwM2M_setClientNameInRegister(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_LwM2M_Logging_DEBUG(log2str(%definitionId));
var integer vl_eRelIdxInEGrp := f_IOT_LGen_getEntityIdxinEntityGroup(pl_ptr);
v_LwM2M_msgToSend.pdu.Register.endpointClientName := "eantwuhDev_" & int2str(vl_eRelIdxInEGrp);
}
function f_IOT_LGen_step_LwM2M_setClientNameInRegister_stringVar(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_LwM2M_Logging_DEBUG(log2str(%definitionId));
var EPTF_IntegerList vl_varIds := {};
f_EPTF_LGenBase_fsmVarIdListFromStep(pl_ptr, vl_varIds);
if (sizeof(vl_varIds)==1)
{
var EPTF_Var_DirectContent vl_endpoint;
f_EPTF_Var_getContent(vl_varIds[0], vl_endpoint);
if (not ischosen(vl_endpoint.charstringVal)) {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " first param is not charstring variable!"));
return;
}
var integer vl_eRelIdxInEGrp := f_IOT_LGen_getEntityIdxinEntityGroup(pl_ptr);
v_LwM2M_msgToSend.pdu.Register.endpointClientName := vl_endpoint.charstringVal & int2str(vl_eRelIdxInEGrp);
}
else {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " one variable (useDTLS) is needed as parameter!"));
}
}
function f_IOT_LGen_step_HTTP_initEntityContext(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_HTTP_setEntityContext(
pl_eIdx := pl_ptr.eIdx,
pl_method := "GET", pl_uri := "",
pl_version_major := 1, pl_version_minor := 1,
pl_headerlines := {{"Connection","Keep-Alive"}},
pl_connId := -1, //v_HTTP_portGroupConnectionHandle,
pl_authDetails := -,
pl_body := { charVal := "" });
}
// 1st param: localHost: charstring
// 2nd param: localPort: integer
// 3rd param: remoteHost: charstring
// 4th param: remotePort: integer
function f_IOT_LGen_step_HTTP_openConnection_byVars(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_COAP_Logging_DEBUG(log2str(%definitionId, pl_ptr));
var integer vl_eRelIdxInEGrp := f_IOT_LGen_getEntityIdxinEntityGroup(pl_ptr);
var EPTF_IntegerList vl_varIds := {};
f_EPTF_LGenBase_fsmVarIdListFromStep(pl_ptr, vl_varIds);
if (sizeof(vl_varIds)==4)
{
var EPTF_Var_DirectContent vl_localHost, vl_localPort, vl_remoteHost, vl_remotePort;
f_EPTF_Var_getContent(vl_varIds[0], vl_localHost);
f_EPTF_Var_getContent(vl_varIds[1], vl_localPort);
f_EPTF_Var_getContent(vl_varIds[2], vl_remoteHost);
f_EPTF_Var_getContent(vl_varIds[3], vl_remotePort);
if (not ischosen(vl_localHost.charstringVal)) {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " first param is not charstring variable!"));
return;
}
if (not ischosen(vl_localPort.intVal)) {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " second param is not integer variable!"));
return;
}
if (not ischosen(vl_remoteHost.charstringVal)) {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " third param is not charstring variable!"));
return;
}
if (not ischosen(vl_remotePort.intVal)) {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " fourth param is not integer variable!"));
return;
}
var integer vl_clientPort := vl_localPort.intVal + vl_eRelIdxInEGrp;
f_EPTF_COAP_Logging_VERBOSE(log2str(%definitionId, " calculated local port ", vl_clientPort));
if (vl_clientPort < 65535)
{
var integer vl_portGroupId := f_EPTF_HTTP_LocalTransport_newPort({
name := "httpPort_"&int2str(vl_eRelIdxInEGrp),
localHostInformation := { vl_localHost.charstringVal, vl_clientPort},
remoteHostInformation := { vl_remoteHost.charstringVal, vl_remotePort.intVal},
instantConnOpen := true,
instantConnClose := false,
useSSL := false,
userFunctions := omit
});
f_EPTF_HTTP_setEntityContextConnectionId(pl_ptr.eIdx, vl_portGroupId);
}
else {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " calculated local port ",vl_clientPort," would be larger than 65536! step aborted."));
}
}
else {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " exactly 4 variables are needed as params!"));
}
}
function f_IOT_LGen_step_HTTP_closeConnection(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_COAP_Logging_DEBUG(log2str(%definitionId, pl_ptr));
var integer vl_portGroupId := f_EPTF_HTTP_getEntityContextConnectionId(pl_ptr.eIdx);
f_EPTF_HTTP_LocalTransport_deletePort(vl_portGroupId);
}
function f_IOT_LGen_step_HTTP_setUri_stringParam(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
var charstring vl_param := f_EPTF_LGenBase_charstringValOfStep(pl_ptr);
f_EPTF_HTTP_setEntityContextURI(pl_ptr.eIdx, vl_param);
}
function f_IOT_LGen_step_HTTP_addToUri_stringParam(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
var charstring vl_param := f_EPTF_LGenBase_charstringValOfStep(pl_ptr);
var charstring vl_uri := f_EPTF_HTTP_getEntityContextURI(pl_ptr.eIdx);
f_EPTF_HTTP_setEntityContextURI(pl_ptr.eIdx, vl_uri & vl_param);
}
function f_IOT_LGen_step_HTTP_addToUri_byVars(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
var EPTF_IntegerList vl_varIds := {};
f_EPTF_LGenBase_fsmVarIdListFromStep(pl_ptr, vl_varIds);
var EPTF_Var_DirectContent vl_var;
var charstring vl_vars := ""
for (var integer i:=0; i<sizeof(vl_varIds); i:=i+1) {
f_EPTF_Var_getContent(vl_varIds[i], vl_var);
if (ischosen(vl_var.charstringVal)) {
vl_vars := vl_vars & vl_var.charstringVal;
}
// Could handle charstring list as well
}
var charstring vl_uri := f_EPTF_HTTP_getEntityContextURI(pl_ptr.eIdx);
f_EPTF_HTTP_setEntityContextURI(pl_ptr.eIdx, vl_uri & vl_vars);
}
function f_IOT_LGen_step_HTTP_setMethod_stringParam(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
var charstring vl_param := f_EPTF_LGenBase_charstringValOfStep(pl_ptr);
f_EPTF_HTTP_setEntityContextMethod(pl_ptr.eIdx, vl_param);
}
// 1st param: remoteHost: charstring
// 2nd param: remotePort: integer
function f_IOT_LGen_step_HTTP_addHostHeader_byVars(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
//f_EPTF_HTTP_setEntityContextMethod(pl_ptr.eIdx, vl_param);
var EPTF_IntegerList vl_varIds := {};
f_EPTF_LGenBase_fsmVarIdListFromStep(pl_ptr, vl_varIds);
if (sizeof(vl_varIds)==2)
{
var EPTF_Var_DirectContent vl_host, vl_port;
f_EPTF_Var_getContent(vl_varIds[0], vl_host);
f_EPTF_Var_getContent(vl_varIds[1], vl_port);
if (not ischosen(vl_host.charstringVal)) {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " first param is not charstring variable!"));
return;
}
if (not ischosen(vl_port.intVal)) {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " second param is not integer variable!"));
return;
}
f_EPTF_HTTP_setEntityContextAddCustomHeader(pl_ptr.eIdx,
"Host",
vl_host.charstringVal & ":" & int2str(vl_port.intVal)
)
}
else {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " two variables are needed as params!"));
}
}
function f_IOT_LGen_step_Leshan_getClientFromResponse_intoVar(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
var EPTF_IntegerList vl_varIds := {};
f_EPTF_LGenBase_fsmVarIdListFromStep(pl_ptr, vl_varIds);
if (sizeof(vl_varIds)!=1) {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " one variable is needed!"));
return;
}
//action("HTTP resp: ", v_EPTF_HTTP_incomingMessage,"\n");
var JSON_PDU vl_json := dec_JSON(char2oct(v_EPTF_HTTP_incomingMessage.response.body));
//action("JSON resp:" , vl_json,"\n");
var EPTF_CharstringList vl_clients := {};
// Let's fetch the first
if (ischosen(vl_json.json_array) and sizeof(vl_json.json_array)>0) {
if (ischosen(vl_json.json_array[0].json_object)) {
for (var integer valIdx :=0; valIdx<sizeof(vl_json.json_array[0].json_object); valIdx:=valIdx+1) {
if (vl_json.json_array[0].json_object[valIdx].json_name == "endpoint") {
vl_clients[sizeof(vl_clients)] := unichar2char(vl_json.json_array[0].json_object[valIdx].json_value.json_string);
break;
}
}
}
}
/*
if (ischosen(vl_json.json_array)) {
for (var integer objIdx:=0; objIdx<sizeof(vl_json.json_array); objIdx:=objIdx+1) {
if (ischosen(vl_json.json_array[objIdx].json_object)) {
for (var integer valIdx :=0; valIdx<sizeof(vl_json.json_array[objIdx].json_object); valIdx:=valIdx+1) {
if (vl_json.json_array[objIdx].json_object[valIdx].json_name == "endpoint") {
vl_clients[sizeof(vl_clients)] := vl_json.json_array[objIdx].json_object[valIdx].json_value.json_string;
break;
}
}
}
}
}
*/
/*
JSON resp:=
{
json_array :=
{
{
json_object :=
{
{ json_name := "endpoint", json_value := { json_string := "client_0" } },
{ json_name := "registrationId", json_value := { json_string := "V18qVv4RL8" } },
{ json_name := "registrationDate", json_value := { json_string := "2017-02-01T14:20:39+01:00" } },
{ json_name := "lastUpdate", json_value := { json_string := "2017-02-01T14:20:39+01:00" } },
{ json_name := "address", json_value := { json_string := "127.0.0.1:30000" } },
{ json_name := "lwM2mVersion", json_value := { json_string := "1.0" } },
{ json_name := "lifetime", json_value := { json_number := 30 } },
{ json_name := "bindingMode", json_value := { json_string := "U" } },
{ json_name := "rootPath", json_value := { json_string := "/" } },
{ json_name := "objectLinks", json_value := {
json_array := {
{ json_object := {
{ json_name := "url", json_value := { json_string := "/3/0" } },
{ json_name := "attributes", json_value := { json_object := { } } }
} } }
}
},
{ json_name := "secure", json_value := { json_false := { } } },
{ json_name := "additionalRegistrationAttributes", json_value := { json_object := { } } }
}
}
}
}
*/
//action("clients: ", vl_clients,"\n");
if (sizeof(vl_clients)>0)
{
// Selecting and loading the last one:
//action("selected client: ", vl_clients[sizeof(vl_clients)-1],"\n");
f_EPTF_Var_setContent(vl_varIds[0], { charstringVal := vl_clients[0]});
}
}
function f_IOT_LGen_step_tcFinished_withVerdict(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
var charstring vl_reason := "";
var verdicttype vl_verdict := pass;
var charstring vl_behavior := "behavior ["&f_EPTF_LGenBase_bIdx2Str(pl_ptr.reportedEvent.event.bIdx)&"]";
var charstring vl_event := "event ["&
f_EPTF_LGenBase_iIdx2Str(
pl_ptr.reportedEvent.event.bIdx,
pl_ptr.reportedEvent.event.iIdx,
f_EPTF_LGenBase_getFsmIndexByCtxIdx(pl_ptr.eIdx, pl_ptr.refContext.fCtxIdx)
)&"]";
f_EPTF_LGenBase_verdictOfStep(pl_ptr, vl_verdict, vl_reason);
var charstring vl_state := "state ["&f_EPTF_LGenBase_getFsmStateNameByStepArgs(pl_ptr)&"]";
f_EPTF_LGenBase_step_cancelAllTimers(pl_ptr);
f_COAP_step_cleanUp(pl_ptr);
f_MQTT_step_cleanUp(pl_ptr);
f_LwM2M_step_cleanupDevice(pl_ptr);
if (vl_verdict == pass)
{
action("=> pass");
f_EPTF_LGenBase_step_trafficSuccess(pl_ptr);
}
else if (vl_verdict == fail)
{
action(vl_state); action(vl_behavior); action(vl_event);
action("=> fail");
f_EPTF_LGenBase_step_trafficFailed(pl_ptr);
}
else if (vl_verdict == inconc)
{
action(vl_state); action(vl_behavior); action(vl_event);
action("=> inconc");
f_EPTF_LGenBase_step_trafficTimeout(pl_ptr);
}
else if (vl_verdict == error)
{
action(vl_state); action(vl_behavior); action(vl_event);
action("=> error");
f_EPTF_LGenBase_step_trafficError(pl_ptr);
}
}
function f_IOT_LGen_step_print_stringParam(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_MQTT_Logging_DEBUG(log2str(%definitionId));
var charstring vl_toPrint := f_EPTF_LGenBase_charstringValOfStep(pl_ptr);
action(vl_toPrint);
}
function f_IOT_LGen_step_FSM_RegDereg_initResourceValues(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_LwM2M_Logging_DEBUG(log2str(%definitionId));
f_EPTF_LwM2M_setStepCtx(pl_ptr, v_LwM2M_ctx);
if (v_LwM2M_ctx.deviceIdx >= 0)
{
f_LwM2M_ObjectDB_setResourceValue(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := c_LwM2M_Device_obj_id, p_objInstId := 0, p_resourceId := c_LwM2M_Device_Manufacturer,
p_value := { strValue := "TitanSim" }
);
}
}
function f_IOT_LGen_step_FSM_SimDevice_createResources(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
}
function f_IOT_LGen_step_FSM_SimDevice_initTransport_boolVar(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_COAP_Logging_DEBUG(log2str(%definitionId));
if (not f_EPTF_COAP_setStepCtx(pl_ptr, v_COAP_ctx)) { return; }
var EPTF_IntegerList vl_varIds := {};
f_EPTF_LGenBase_fsmVarIdListFromStep(pl_ptr, vl_varIds);
if (sizeof(vl_varIds)==1)
{
var EPTF_Var_DirectContent vl_dtlsOn;
f_EPTF_Var_getContent(vl_varIds[0], vl_dtlsOn);
if (not ischosen(vl_dtlsOn.boolVal)) {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " first param is not boolean variable!"));
return;
}
// If we have to use DTLS
if (vl_dtlsOn.boolVal == true)
{
// We need to adjust the local and remote protocol to dtls
if (v_COAP_FsmCtxDB.data[v_COAP_ctx.fsmCtxIdx].remoteAddressIdx >= 0)
{
v_COAP_transportEndpointDB.data[v_COAP_EntityCtxDB.data[v_COAP_ctx.eCtxIdx].localAddressIdx].proto :=
{ dtls := { udp := {} }};
v_COAP_transportEndpointDB.data[v_COAP_FsmCtxDB.data[v_COAP_ctx.fsmCtxIdx].remoteAddressIdx].proto :=
{ dtls := { udp := {} }};
}
// We also need to initialize the DTLS connection:
// - we need to set the identity and the keys first into the fsmCtx
// we will use the tsp_EPTF_COAP_LGen_psks module par as a base and add the entity index inside the group to create the identity
if (sizeof(tsp_EPTF_COAP_LGen_psks) >= 1)
{
var integer vl_eRelIdxInEGrp := f_IOT_LGen_getEntityIdxinEntityGroup(pl_ptr);
v_COAP_FsmCtxDB.data[v_COAP_ctx.fsmCtxIdx].psk.identity := tsp_EPTF_COAP_LGen_psks[0].identity & int2str(vl_eRelIdxInEGrp);
v_COAP_FsmCtxDB.data[v_COAP_ctx.fsmCtxIdx].psk.key := tsp_EPTF_COAP_LGen_psks[0].key;
f_COAP_step_startDTLS(pl_ptr);
}
else {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " we want to use the first item in tsp_EPTF_COAP_LGen_psks to generate the identity and key!"));
}
}
// If we use plain UDP
else
{
f_COAP_step_startListening(pl_ptr);
}
}
else {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " one variable (useDTLS) is needed as parameter!"));
}
}
function f_IOT_LGen_step_FSM_SimDevice_initResourceValues(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_LwM2M_Logging_DEBUG(log2str(%definitionId));
f_EPTF_LwM2M_setStepCtx(pl_ptr, v_LwM2M_ctx);
if (v_LwM2M_ctx.deviceIdx >= 0)
{
var LwM2M_Resource v_res;
// Manufacturer
f_LwM2M_ObjectDB_setResourceValue(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := c_LwM2M_Device_obj_id, p_objInstId := 0, p_resourceId := c_LwM2M_Device_Manufacturer,
p_value := { strValue := "RIoT" }
);
// Latitude
f_LwM2M_ObjectDB_getResource(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 6, p_objInstId := 0, p_resourceId := 0,
p_resource := v_res
);
v_res.dataSample := {
samplesName := "Latitude",
samplesPointer := -1,
valuePointer := -1
}
f_LwM2M_Resource_setNextDataSample(v_res, v_IOT_LGen_DataSamples_DB);
f_LwM2M_ObjectDB_setResource(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 6, p_objInstId := 0, p_resourceId := 0,
p_resource := v_res
);
/* f_LwM2M_ObjectDB_setResourceValue(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 6, p_objInstId := 0, p_resourceId := 0,
p_value := { floatValue := 47.475096 }
);*/
//Longitude
f_LwM2M_ObjectDB_getResource(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 6, p_objInstId := 0, p_resourceId := 1,
p_resource := v_res
);
v_res.dataSample := {
samplesName := "Longitude",
samplesPointer := -1,
valuePointer := -1
}
f_LwM2M_Resource_setNextDataSample(v_res, v_IOT_LGen_DataSamples_DB);
f_LwM2M_ObjectDB_setResource(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 6, p_objInstId := 0, p_resourceId := 1,
p_resource := v_res
);
/*f_LwM2M_ObjectDB_setResourceValue(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 6, p_objInstId := 0, p_resourceId := 1,
p_value := { floatValue := 19.057871 }
);*/
// Altitude
f_LwM2M_ObjectDB_setResourceValue(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 6, p_objInstId := 0, p_resourceId := 2,
p_value := { floatValue := 12.0 }
);
// Temperature
f_LwM2M_ObjectDB_setResourceValue(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 3303, p_objInstId := 0, p_resourceId := 5700,
p_value := { floatValue := 34.35 }
);
// Dropped
f_LwM2M_ObjectDB_setResourceValue(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 3400, p_objInstId := 0, p_resourceId := 1,
p_value := { boolValue := false }
);
}
}
function f_IOT_LGen_step_FSM_SimDevice_updateResourceValues(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_LwM2M_Logging_DEBUG(log2str(%definitionId));
f_EPTF_LwM2M_setStepCtx(pl_ptr, v_LwM2M_ctx);
var LwM2M_Resource v_res;
//////////////////
// Dropped
if(
f_LwM2M_ObjectDB_getResource(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 3400, p_objInstId := 0, p_resourceId := 1,
p_resource := v_res
)
){
var boolean droppableChanged := false;
if (v_res.val.boolValue) {
v_res.val.boolValue := false;
droppableChanged := true;
action("Drop cleared")
}
else {
var float v_rnd := rnd();
if (v_rnd>=0.5) {
v_res.val.boolValue := true;
droppableChanged := true;
action("Dropped: ",v_rnd);
}
}
if (droppableChanged)
{
f_LwM2M_ObjectDB_setResource(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 3400, p_objInstId := 0, p_resourceId := 1,
p_resource := v_res
);
f_EPTF_LwM2M_sendNotificationForResource(pl_ptr, v_res);
}
}
//////////////////
// Temperature
if (
f_LwM2M_ObjectDB_getResource(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 3303, p_objInstId := 0, p_resourceId := 5700,
p_resource := v_res //{ floatValue := int2float(vl_randomVal) }
)
){
v_res.val.floatValue := int2float(32 - 10 +1)*rnd() + 10.0;
f_LwM2M_ObjectDB_setResource(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 3303, p_objInstId := 0, p_resourceId := 5700,
p_resource := v_res
);
f_EPTF_LwM2M_sendNotificationForResource(pl_ptr, v_res);
}
//////////////////
// Latitude
if (
f_LwM2M_ObjectDB_getResource(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 6, p_objInstId := 0, p_resourceId := 0,
p_resource := v_res
)
){
f_LwM2M_Resource_setNextDataSample(v_res, v_IOT_LGen_DataSamples_DB);
f_LwM2M_ObjectDB_setResource(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 6, p_objInstId := 0, p_resourceId := 0,
p_resource := v_res
);
f_EPTF_LwM2M_sendNotificationForResource(pl_ptr, v_res);
}
//////////////////
// Longitude
if (
f_LwM2M_ObjectDB_getResource(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 6, p_objInstId := 0, p_resourceId := 1,
p_resource := v_res
)
){
f_LwM2M_Resource_setNextDataSample(v_res, v_IOT_LGen_DataSamples_DB);
f_LwM2M_ObjectDB_setResource(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 6, p_objInstId := 0, p_resourceId := 1,
p_resource := v_res
);
f_EPTF_LwM2M_sendNotificationForResource(pl_ptr, v_res);
}
}
function f_IOT_LGen_step_FSM_SimDevice_handleExecute(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_LwM2M_Logging_DEBUG(log2str(%definitionId));
f_EPTF_LwM2M_setStepCtx(pl_ptr, v_LwM2M_ctx);
if (ischosen(v_LwM2M_msgToProcess.pdu.Execute) and v_LwM2M_ctx.deviceIdx >= 0)
{
var LwM2M_Resource v_res;
var boolean vl_found := false;
if (f_LwM2M_ObjectPath_isResource(v_LwM2M_msgToProcess.pdu.Execute.path))
{
f_EPTF_LwM2M_Logging_DEBUG(log2str(%definitionId, " Looking up resource"));
vl_found := f_LwM2M_ObjectDB_getResource(
v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
v_LwM2M_msgToProcess.pdu.Execute.path.objectId,
v_LwM2M_msgToProcess.pdu.Execute.path.objectInstanceId,
v_LwM2M_msgToProcess.pdu.Execute.path.resourceId,
v_res
);
f_EPTF_LwM2M_Logging_DEBUG(log2str(%definitionId, " resource found: ", v_res));
action("executed: ", v_res);
v_LwM2M_msgToSend.eIdx := v_LwM2M_ctx.eIdx;
v_LwM2M_msgToSend.fsmIdx := v_LwM2M_ctx.fsmIdx;
v_LwM2M_msgToSend.pdu :=
{
Response := {
location := {},
code := 204,
contentFormat := omit,
resources := {}
}
}
vf_EPTF_LwM2M_Transport_send.apply(v_LwM2M_msgToSend);
/*
// Execute on Reset of DropDetector
if (v_res.objId == 3400 and v_res.objInstId == 2)
{
f_LwM2M_ObjectDB_getResource(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 3400, p_objInstId := 0, p_resourceId := 1,
p_resource := v_res
);
v_res.val.boolValue := false;
if (ispresent(v_res.observe)) { v_res.observe.observe := v_res.observe.observe + 1 }
f_LwM2M_ObjectDB_setResource(
p_db := v_LwM2M_DeviceDB.data[v_LwM2M_ctx.deviceIdx].objects,
p_objId := 3400, p_objInstId := 0, p_resourceId := 1,
p_resource := v_res
);
f_EPTF_LwM2M_sendNotificationForResource(pl_ptr, v_res);
}
*/
}
else { f_EPTF_LwM2M_Logging_DEBUG(log2str(%definitionId, " Only resource can be executed, ignoring request")); }
}
else { f_EPTF_LwM2M_Logging_DEBUG(log2str(%definitionId, " not execute pdu, or no device available, returning")); }
}
// 1st param: min value (in): integer
// 2nd param: max value (in): integer
// 3rd param: rnd value (out): integer
function f_IOT_LGen_step_genRndValue_varParams(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_EPTF_COAP_Logging_DEBUG(log2str(%definitionId, pl_ptr));
var EPTF_IntegerList vl_varIds := {};
f_EPTF_LGenBase_fsmVarIdListFromStep(pl_ptr, vl_varIds);
if (sizeof(vl_varIds)==3)
{
var EPTF_Var_DirectContent vl_min, vl_max, vl_rnd;
f_EPTF_Var_getContent(vl_varIds[0], vl_min);
f_EPTF_Var_getContent(vl_varIds[1], vl_max);
f_EPTF_Var_getContent(vl_varIds[2], vl_rnd);
if (not ischosen(vl_min.intVal)) {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " first param is not integer variable!"));
return;
}
if (not ischosen(vl_max.intVal)) {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " second param is not integer variable!"));
return;
}
var integer vl_randomVal := float2int(int2float(vl_max.intVal - vl_min.intVal +1)*rnd()) + vl_min.intVal;
f_EPTF_COAP_Logging_VERBOSE(log2str(%definitionId, " calculated random value ",vl_randomVal));
f_EPTF_Var_setContent(vl_varIds[2], { intVal := vl_randomVal });
}
else {
f_EPTF_COAP_Logging_WARNING(log2str(%definitionId, " at least three variables are needed as params!"));
}
}
/*
// Deprecated
function f_IOT_App_step_tcFinished(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
f_COAP_step_cleanUp(pl_ptr);
f_LwM2M_step_cleanupDevice(pl_ptr);
if(pl_ptr.refContext.fRefArgs[0]==c_FSM_pass)
{
action("=> pass");
f_EPTF_LGenBase_step_trafficSuccess(pl_ptr);
}
else if(pl_ptr.refContext.fRefArgs[0]==c_FSM_fail)
{
action("=> fail");
f_EPTF_LGenBase_step_trafficFailed(pl_ptr);
}
else//c_FSM_timeout
{
action("=> timeout");
f_EPTF_LGenBase_step_trafficTimeout(pl_ptr);
}
}
function f_IOT_App_step_setLocalAddress(in EPTF_LGenBase_TestStepArgs pl_ptr)
runs on IOT_LGen_CT
{
if (not f_EPTF_COAP_setStepCtx(pl_ptr, v_COAP_ctx)) { return; }
if (v_COAP_EntityCtxDB.data[v_COAP_ctx.eCtxIdx].localAddressIdx == -1)
{
var integer vl_localPort := -1;
if (sizeof(pl_ptr.refContext.fRefArgs)>0)
{
vl_localPort := pl_ptr.refContext.fRefArgs[0];
}
else
{
vl_localPort := tsp_localPort+v_COAP_ctx.eIdx+1;
}
if (vl_localPort < 65535)
{
f_EPTF_COAP_addressDB_add({tsp_remoteHost, vl_localPort}, v_COAP_EntityCtxDB.data[v_COAP_ctx.eCtxIdx].localAddressIdx);
}
else
{
v_COAP_EntityCtxDB.data[v_COAP_ctx.eCtxIdx].localAddressIdx := v_IOT_LGen_localAddressIdx;
}
}
}
*/
}