Commit bc85582c authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Config functions formatted properly


Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 8db55736
......@@ -28,9 +28,11 @@ module OneM2M_Functions {
function f_cf01Up(in boolean p_auxiliaryAe2Required := false) runs on AeSimu system CseSystem {
// Variables
var charstring v_binding;
var charstring v_binding_in;
var charstring v_host;
var charstring v_binding;
var charstring v_binding_in;
var charstring v_host;
//Initialization of component variables
vc_config := e_cf01;
vc_testSystemRole := e_ae;
......@@ -52,18 +54,19 @@ module OneM2M_Functions {
v_binding := "WSCK";
v_host := PX_TS_AE1.mcaPort.binding.wsBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE1.mcaPort.binding.wsBindingDesc.bindingDesc.remotePort);
}
if (ischosen(PX_TS_AE1.mcaPortIn.binding.httpBindingDesc)) {
v_binding_in := "HTTP";
} else if (ischosen(PX_TS_AE1.mcaPortIn.binding.coapBindingDesc)) {
v_binding_in := "COAP";
} else if (ischosen(PX_TS_AE1.mcaPortIn.binding.mqttBindingDesc)) {
v_binding_in := "MQTT";
} else {
v_binding_in := "WSCK";
}
if (ischosen(PX_TS_AE1.mcaPortIn.binding.httpBindingDesc)) {
v_binding_in := "HTTP";
} else if (ischosen(PX_TS_AE1.mcaPortIn.binding.coapBindingDesc)) {
v_binding_in := "COAP";
} else if (ischosen(PX_TS_AE1.mcaPortIn.binding.mqttBindingDesc)) {
v_binding_in := "MQTT";
} else {
v_binding_in := "WSCK";
}
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mca_port))] := { mcaPort, v_host, v_binding, c_serializationLabel[enum2int(PX_TS_AE1.mcaPort.serialization)] };
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mca_in_port))] := { mcaPortIn, v_host, v_binding_in, c_serializationLabel[enum2int(PX_TS_AE1.mcaPortIn.serialization)] };
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mca_in_port))] := { mcaPortIn, v_host, v_binding_in, c_serializationLabel[enum2int(PX_TS_AE1.mcaPortIn.serialization)] };
activate(a_default());
vc_aeSimu := activate(a_cse_cf01());
......@@ -88,7 +91,9 @@ module OneM2M_Functions {
// Variables
var charstring v_binding;
var charstring v_binding_in;
var charstring v_host;
var charstring v_host;
//Initialization of component variables
vc_config := e_cf01;
vc_testSystemRole := e_ae;
......@@ -97,31 +102,32 @@ module OneM2M_Functions {
map(self:mcaPortIn, system:mcaPortIn) param (PX_TS_AE2.mcaPortIn);
map(self:acPort, system:acPort);
if (ischosen(PX_TS_AE2.mcaPort.binding.httpBindingDesc)) {
v_binding := "HTTP";
v_host := PX_TS_AE2.mcaPort.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE2.mcaPort.binding.httpBindingDesc.bindingDesc.remotePort);
} else if (ischosen(PX_TS_AE2.mcaPort.binding.coapBindingDesc)) {
v_binding := "COAP";
v_host := PX_TS_AE2.mcaPort.binding.coapBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE2.mcaPort.binding.coapBindingDesc.bindingDesc.remotePort);
} else if (ischosen(PX_TS_AE2.mcaPort.binding.mqttBindingDesc)) {
v_binding := "MQTT";
v_host := PX_TS_AE2.mcaPort.binding.mqttBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE2.mcaPort.binding.mqttBindingDesc.bindingDesc.remotePort);
} else {
v_binding := "WSCK";
v_host := PX_TS_AE2.mcaPort.binding.wsBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE2.mcaPort.binding.wsBindingDesc.bindingDesc.remotePort);
}
if (ischosen(PX_TS_AE2.mcaPortIn.binding.httpBindingDesc)) {
v_binding_in := "HTTP";
} else if (ischosen(PX_TS_AE2.mcaPortIn.binding.coapBindingDesc)) {
v_binding_in := "COAP";
} else if (ischosen(PX_TS_AE2.mcaPortIn.binding.mqttBindingDesc)) {
v_binding_in := "MQTT";
} else {
v_binding_in := "WSCK";
}
if (ischosen(PX_TS_AE2.mcaPort.binding.httpBindingDesc)) {
v_binding := "HTTP";
v_host := PX_TS_AE2.mcaPort.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE2.mcaPort.binding.httpBindingDesc.bindingDesc.remotePort);
} else if (ischosen(PX_TS_AE2.mcaPort.binding.coapBindingDesc)) {
v_binding := "COAP";
v_host := PX_TS_AE2.mcaPort.binding.coapBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE2.mcaPort.binding.coapBindingDesc.bindingDesc.remotePort);
} else if (ischosen(PX_TS_AE2.mcaPort.binding.mqttBindingDesc)) {
v_binding := "MQTT";
v_host := PX_TS_AE2.mcaPort.binding.mqttBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE2.mcaPort.binding.mqttBindingDesc.bindingDesc.remotePort);
} else {
v_binding := "WSCK";
v_host := PX_TS_AE2.mcaPort.binding.wsBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE2.mcaPort.binding.wsBindingDesc.bindingDesc.remotePort);
}
if (ischosen(PX_TS_AE2.mcaPortIn.binding.httpBindingDesc)) {
v_binding_in := "HTTP";
} else if (ischosen(PX_TS_AE2.mcaPortIn.binding.coapBindingDesc)) {
v_binding_in := "COAP";
} else if (ischosen(PX_TS_AE2.mcaPortIn.binding.mqttBindingDesc)) {
v_binding_in := "MQTT";
} else {
v_binding_in := "WSCK";
}
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mca_port))] := { mcaPort, v_host, v_binding, c_serializationLabel[enum2int(PX_TS_AE2.mcaPort.serialization)] };
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mca_in_port))] := { mcaPortIn, v_host, v_binding_in, c_serializationLabel[enum2int(PX_TS_AE2.mcaPortIn.serialization)] };
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mca_port))] := { mcaPort, v_host, v_binding, c_serializationLabel[enum2int(PX_TS_AE2.mcaPort.serialization)] };
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mca_in_port))] := { mcaPortIn, v_host, v_binding_in, c_serializationLabel[enum2int(PX_TS_AE2.mcaPortIn.serialization)] };
//Initialze the IUT
......@@ -134,7 +140,9 @@ module OneM2M_Functions {
// Variables
var charstring v_binding;
var charstring v_host;
var charstring v_host;
//Initialization of component variables
vc_config := e_cf02;
vc_testSystemRole := e_ae;
vc_cse1 := CseSimu.create("CSE1") alive;
......@@ -142,26 +150,26 @@ module OneM2M_Functions {
// Map
map(self:mcaPort, system:mcaPort) param (PX_TS_AE1.mcaPort);
map(self:acPort, system:acPort);
if (ischosen(PX_TS_AE1.mcaPort.binding.httpBindingDesc)) {
v_binding := "HTTP";
v_host := PX_TS_AE1.mcaPort.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE1.mcaPort.binding.httpBindingDesc.bindingDesc.remotePort);
} else if (ischosen(PX_TS_AE1.mcaPort.binding.coapBindingDesc)) {
v_binding := "COAP";
v_host := PX_TS_AE1.mcaPort.binding.coapBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE1.mcaPort.binding.coapBindingDesc.bindingDesc.remotePort);
} else if (ischosen(PX_TS_AE1.mcaPort.binding.mqttBindingDesc)) {
v_binding := "MQTT";
v_host := PX_TS_AE1.mcaPort.binding.mqttBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE1.mcaPort.binding.mqttBindingDesc.bindingDesc.remotePort);
} else {
v_binding := "WSCK";
v_host := PX_TS_AE1.mcaPort.binding.wsBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE1.mcaPort.binding.wsBindingDesc.bindingDesc.remotePort);
}
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mca_port))] := { mcaPort, v_host, v_binding, c_serializationLabel[enum2int(PX_TS_AE1.mcaPort.serialization)] };
if(PX_UT_IMPLEMENTED) {
map(self:utPort, system:utPort) param (PX_TS_UT);
}
if (ischosen(PX_TS_AE1.mcaPort.binding.httpBindingDesc)) {
v_binding := "HTTP";
v_host := PX_TS_AE1.mcaPort.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE1.mcaPort.binding.httpBindingDesc.bindingDesc.remotePort);
} else if (ischosen(PX_TS_AE1.mcaPort.binding.coapBindingDesc)) {
v_binding := "COAP";
v_host := PX_TS_AE1.mcaPort.binding.coapBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE1.mcaPort.binding.coapBindingDesc.bindingDesc.remotePort);
} else if (ischosen(PX_TS_AE1.mcaPort.binding.mqttBindingDesc)) {
v_binding := "MQTT";
v_host := PX_TS_AE1.mcaPort.binding.mqttBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE1.mcaPort.binding.mqttBindingDesc.bindingDesc.remotePort);
} else {
v_binding := "WSCK";
v_host := PX_TS_AE1.mcaPort.binding.wsBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_AE1.mcaPort.binding.wsBindingDesc.bindingDesc.remotePort);
}
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mca_port))] := { mcaPort, v_host, v_binding, c_serializationLabel[enum2int(PX_TS_AE1.mcaPort.serialization)] };
activate(a_default());
vc_aeSimu := activate(a_cse_cf02_ae1());
vc_cse1.start(f_cf02UpCse1(p_cseType));
......@@ -179,10 +187,12 @@ module OneM2M_Functions {
function f_cf02UpCse1(in CseTypeID p_cseType := int2) runs on CseSimu system CseSystem {
// Variables
var charstring v_binding;
var charstring v_binding_in;
var charstring v_host;
var charstring v_binding;
var charstring v_binding_in;
var charstring v_host;
var PrimitiveContent v_cSEBaseResource;
//Initialization of component variables
vc_config := e_cf02;
vc_testSystemRole := e_cse;
vc_cseType := p_cseType;
......@@ -192,31 +202,32 @@ module OneM2M_Functions {
map(self:mccPortIn, system:mccPortIn) param (PX_TS_CSE1.mccPortIn);
map(self:acPort, system:acPort);
if (ischosen(PX_TS_CSE1.mccPort.binding.httpBindingDesc)) {
v_binding := "HTTP";
v_host := PX_TS_CSE1.mcaPort.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mccPort.binding.httpBindingDesc.bindingDesc.remotePort);
} else if (ischosen(PX_TS_CSE1.mccPort.binding.coapBindingDesc)) {
v_binding := "COAP";
v_host := PX_TS_CSE1.mcaPort.binding.coapBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mccPort.binding.coapBindingDesc.bindingDesc.remotePort);
} else if (ischosen(PX_TS_CSE1.mccPort.binding.mqttBindingDesc)) {
v_binding := "MQTT";
v_host := PX_TS_CSE1.mcaPort.binding.mqttBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mccPort.binding.mqttBindingDesc.bindingDesc.remotePort);
} else {
v_binding := "WSCK";
v_host := PX_TS_CSE1.mcaPort.binding.wsBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mccPort.binding.wsBindingDesc.bindingDesc.remotePort);
}
if (ischosen(PX_TS_CSE1.mccPortIn.binding.httpBindingDesc)) {
v_binding_in := "HTTP";
} else if (ischosen(PX_TS_CSE1.mccPortIn.binding.coapBindingDesc)) {
v_binding_in := "COAP";
} else if (ischosen(PX_TS_CSE1.mccPortIn.binding.mqttBindingDesc)) {
v_binding_in := "MQTT";
} else {
v_binding_in := "WSCK";
}
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mcc_port))] := { mccPort, v_host, v_binding, c_serializationLabel[enum2int(PX_TS_CSE1.mccPort.serialization)] };
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mcc_in_port))] := { mccPortIn, v_host, v_binding, c_serializationLabel[enum2int(PX_TS_CSE1.mccPortIn.serialization)] };
if (ischosen(PX_TS_CSE1.mccPort.binding.httpBindingDesc)) {
v_binding := "HTTP";
v_host := PX_TS_CSE1.mcaPort.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mccPort.binding.httpBindingDesc.bindingDesc.remotePort);
} else if (ischosen(PX_TS_CSE1.mccPort.binding.coapBindingDesc)) {
v_binding := "COAP";
v_host := PX_TS_CSE1.mcaPort.binding.coapBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mccPort.binding.coapBindingDesc.bindingDesc.remotePort);
} else if (ischosen(PX_TS_CSE1.mccPort.binding.mqttBindingDesc)) {
v_binding := "MQTT";
v_host := PX_TS_CSE1.mcaPort.binding.mqttBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mccPort.binding.mqttBindingDesc.bindingDesc.remotePort);
} else {
v_binding := "WSCK";
v_host := PX_TS_CSE1.mcaPort.binding.wsBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mccPort.binding.wsBindingDesc.bindingDesc.remotePort);
}
if (ischosen(PX_TS_CSE1.mccPortIn.binding.httpBindingDesc)) {
v_binding_in := "HTTP";
} else if (ischosen(PX_TS_CSE1.mccPortIn.binding.coapBindingDesc)) {
v_binding_in := "COAP";
} else if (ischosen(PX_TS_CSE1.mccPortIn.binding.mqttBindingDesc)) {
v_binding_in := "MQTT";
} else {
v_binding_in := "WSCK";
}
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mcc_port))] := { mccPort, v_host, v_binding, c_serializationLabel[enum2int(PX_TS_CSE1.mccPort.serialization)] };
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mcc_in_port))] := { mccPortIn, v_host, v_binding, c_serializationLabel[enum2int(PX_TS_CSE1.mccPortIn.serialization)] };
v_cSEBaseResource := f_generateLocalResource(-, -1, int5);
vc_cSEBaseIndex := f_setLocalResource(v_cSEBaseResource, int5, -1);
......@@ -344,9 +355,11 @@ module OneM2M_Functions {
function f_cf03Up(in CseTypeID p_cseType := int2) runs on CseSimu system AeSystem {
// Variables
var charstring v_binding;
var charstring v_binding;
var PrimitiveContent v_cSEBaseResource;
var charstring v_host;
var charstring v_host;
//Initialization of component variables
vc_config := e_cf03;
vc_testSystemRole := e_cse;
vc_cseType := p_cseType;
......@@ -360,17 +373,17 @@ module OneM2M_Functions {
map(self:acPort, system:acPort);
if (ischosen(PX_TS_CSE1.mcaPortIn.binding.httpBindingDesc)) {
v_binding := "HTTP";
v_host := PX_TS_CSE1.mcaPortIn.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mcaPortIn.binding.httpBindingDesc.bindingDesc.remotePort);
v_binding := "HTTP";
v_host := PX_TS_CSE1.mcaPortIn.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mcaPortIn.binding.httpBindingDesc.bindingDesc.remotePort);
} else if (ischosen(PX_TS_CSE1.mcaPortIn.binding.coapBindingDesc)) {
v_binding := "COAP";
v_host := PX_TS_CSE1.mcaPortIn.binding.coapBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mcaPortIn.binding.coapBindingDesc.bindingDesc.remotePort);
v_binding := "COAP";
v_host := PX_TS_CSE1.mcaPortIn.binding.coapBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mcaPortIn.binding.coapBindingDesc.bindingDesc.remotePort);
} else if (ischosen(PX_TS_CSE1.mcaPortIn.binding.mqttBindingDesc)) {
v_binding := "MQTT";
v_host := PX_TS_CSE1.mcaPortIn.binding.mqttBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mcaPortIn.binding.mqttBindingDesc.bindingDesc.remotePort);
v_binding := "MQTT";
v_host := PX_TS_CSE1.mcaPortIn.binding.mqttBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mcaPortIn.binding.mqttBindingDesc.bindingDesc.remotePort);
} else {
v_binding := "WSCK";
v_host := PX_TS_CSE1.mcaPortIn.binding.wsBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mcaPortIn.binding.wsBindingDesc.bindingDesc.remotePort);
v_binding := "WSCK";
v_host := PX_TS_CSE1.mcaPortIn.binding.wsBindingDesc.bindingDesc.sutAddress & ":" & int2str(PX_TS_CSE1.mcaPortIn.binding.wsBindingDesc.bindingDesc.remotePort);
}
vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mca_in_port))] := { mcaPortIn, v_host, v_binding, c_serializationLabel[enum2int(PX_TS_CSE1.mcaPortIn.serialization)] };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment