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

ACP created and associated to the notification recipient to allow subscription...

ACP created and associated to the notification recipient to allow subscription verification. Closing #21

Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 441ced69
......@@ -681,7 +681,10 @@ module OneM2M_Functions {
function f_cse_preamble_subscriptionVerification(inout integer p_ae2Index, inout template RequestPrimitive p_createRequestPrimitive,in ResourceType p_resourceType, in ResponseStatusCode p_responseStatusCode := int2000) runs on AeSimu {
if(p_resourceType == int23){
vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, {f_getAnnouncementTargetPoA("HTTP", PX_AE2_ADDRESS, "")}), -1)); // AE2 is registred
vc_ae2.start(f_cse_preamble_createAcpAux(-, int63));
vc_ae2.done;
vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, {f_getAnnouncementTargetPoA("HTTP", PX_AE2_ADDRESS, "")}), -1)); // AE2 is registred
vc_ae2.done;
f_checkComponentDoneAndGetVerdict(vc_ae2);
......@@ -871,6 +874,32 @@ module OneM2M_Functions {
}
/**
* @desc Creation of a resource
* @param p_resourceType Resource type of the resource to be created
* @param p_requestPrimitive CREATE request primitive for the resource to be created
* @param p_parentIndex Internal resource index which indicates the parent of the resource to be created
* @return Internal resource index of the created resource
* @verdict
*/
function f_cse_createResource_withAcpAux(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1) runs on AeSimu return integer {
var RequestPrimitive v_request;
var integer v_resourceIndex := -1;
//Activate defaults when running on a PTC
f_cse_activateDefaults_ae();
if(vc_acpAuxIndex != -1) {
p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[vc_acpAuxIndex].resource.accessControlPolicy.resourceID});
}
v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, p_parentIndex);
return v_resourceIndex;
}
/**
* @desc Message exchange for the update of an announced resource
* @param p_requestPrimitive UPDATE request primitive to be used
......
......@@ -1795,7 +1795,9 @@ module OneM2M_PermutationFunctions {
if(ispresent(p_parentRequestPrimitive)) {
if(match(int23, p_parentRequestPrimitive.resourceType)){
vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred
vc_ae2.start(f_cse_preamble_createAcpAux(-, int63));
vc_ae2.done;
vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred
vc_ae2.done;
v_ae2Index := f_getResource(vc_ae2);
p_parentRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)};
......@@ -1830,7 +1832,9 @@ module OneM2M_PermutationFunctions {
// Test Body
if(match(int23, p_requestPrimitive.resourceType)){
vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred
vc_ae2.start(f_cse_preamble_createAcpAux(-, int63));
vc_ae2.done;
vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred
vc_ae2.done;
v_ae2Index := f_getResource(vc_ae2);
p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)};
......@@ -1902,7 +1906,9 @@ module OneM2M_PermutationFunctions {
vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
if(match(int23, p_resourceType)){
vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM, "MyAe", v_poaList), -1)); // AE1 is registered
vc_ae1.start(f_cse_preamble_createAcpAux(-, int63));
vc_ae1.done;
vc_ae1.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM, "MyAe", v_poaList), -1)); // AE1 is registered
vc_ae1.done;
v_ae1Index := f_getResource(vc_ae1);
p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae1Index)};
......
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