Announcement group fixes

Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 51e1cc57
......@@ -2686,7 +2686,7 @@ module OneM2M_Functions {
f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive);
f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
}
[] mccPortIn.receive(mw_request(?)) -> value vc_request {
[] mccPortIn.receive(mw_request(mw_update)) -> value vc_request {
setverdict(fail, __SCOPE__ & ":ERROR: Request received with unexpected parameters");
v_responsePrimitive := valueof(m_responsePrimitive(int4000,vc_request.primitive.requestPrimitive.requestIdentifier));
f_send(e_mccPortIn, m_response(v_responsePrimitive));
......@@ -2727,7 +2727,7 @@ module OneM2M_Functions {
f_processDeleteRequestPrimitive(v_request.primitive.requestPrimitive);
f_send(e_mccPortIn, m_response(vc_response.primitive.responsePrimitive));
}
[] mccPortIn.receive(mw_request(?)) -> value v_request {
[] mccPortIn.receive(mw_request(mw_delete())) -> value v_request {
setverdict(fail, __SCOPE__ & ":ERROR: Request received with unexpected parameters");
v_responsePrimitive := valueof(m_responsePrimitive(int4000,v_request.primitive.requestPrimitive.requestIdentifier));
f_send(e_mccPortIn, m_response(v_responsePrimitive));
......@@ -3510,6 +3510,12 @@ module OneM2M_Functions {
v_myResource.container.stateTag := 0;
v_myResource.container.currentNrOfInstances := 0;
v_myResource.container.currentByteSize := 0;
if(not(ispresent(p_resource.container.maxByteSize))) {
v_myResource.container.maxByteSize := 10000;
}
if(not(ispresent(p_resource.container.maxNrOfInstances))) {
v_myResource.container.maxNrOfInstances := 10;
}
}
} else if(p_resourceType == int4 and ispresent(p_resource)) { //ContentInstance
......@@ -3851,11 +3857,31 @@ module OneM2M_Functions {
if(ispresent(p_resource.accessControlPolicy.announcedAttribute)) {
vc_localResourcesList[p_localResourceIndex].resource.accessControlPolicy.announcedAttribute := p_resource.accessControlPolicy.announcedAttribute;
}
} else if(ischosen(vc_localResourcesList[p_localResourceIndex].resource.containerAnnc) and (ischosen(p_resource.containerAnnc))) {//ContainerAnnc
if(ispresent(p_resource.containerAnnc.expirationTime)) {
vc_localResourcesList[p_localResourceIndex].resource.containerAnnc.expirationTime := p_resource.containerAnnc.expirationTime;
}
if(ispresent(p_resource.containerAnnc.labels)) {
vc_localResourcesList[p_localResourceIndex].resource.containerAnnc.labels := p_resource.containerAnnc.labels;
}
if(ispresent(p_resource.containerAnnc.dynamicAuthorizationConsultationIDs)) {
vc_localResourcesList[p_localResourceIndex].resource.containerAnnc.dynamicAuthorizationConsultationIDs := p_resource.containerAnnc.dynamicAuthorizationConsultationIDs;
}
if(ispresent(p_resource.containerAnnc.maxNrOfInstances)) {
vc_localResourcesList[p_localResourceIndex].resource.containerAnnc.maxNrOfInstances := p_resource.containerAnnc.maxNrOfInstances;
}
if(ispresent(p_resource.containerAnnc.maxByteSize)) {
vc_localResourcesList[p_localResourceIndex].resource.containerAnnc.maxByteSize := p_resource.containerAnnc.maxByteSize;
}
if(ispresent(p_resource.containerAnnc.maxInstanceAge)) {
vc_localResourcesList[p_localResourceIndex].resource.containerAnnc.maxInstanceAge := p_resource.containerAnnc.maxInstanceAge;
}
}
} //End of function
/**
* @desc Creation of a resource using CseSimu
* @desc Creation of a resource using CseSimu. In case of announced resource, the original resource is created locally first.
* @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
......@@ -3872,13 +3898,19 @@ module OneM2M_Functions {
f_cse_activateDefaults_cse1();
//Create original resource locally if resource type is an announced variant
if(p_resourceType == int10002) {
if (p_resourceType == int10001) {
v_originalResourceIndex := f_generateAndSetLocalResource(m_primitiveContentAccessControlPolicy(m_contentCreateAcp), -, int1);
} else if(p_resourceType == int10002) {
v_originalResourceIndex := f_generateAndSetLocalResource(m_primitiveContentAe(m_contentCreateAe(omit, -, PX_TS_AE1.appId, omit)), -, int2);
p_requestPrimitive.primitiveContent := f_setLink(valueof(p_requestPrimitive.primitiveContent), f_getLocalResourceAddress(v_originalResourceIndex));
} else if (p_resourceType == int10003) {
v_originalResourceIndex := f_generateAndSetLocalResource(m_primitiveContentContainer(m_contentCreateContainer), -, int3);
p_requestPrimitive.primitiveContent := f_setLink(valueof(p_requestPrimitive.primitiveContent), f_getLocalResourceAddress(v_originalResourceIndex));
} else if (p_resourceType == int10009) {
v_originalResourceIndex := f_generateAndSetLocalResource(m_primitiveContentGroup(m_contentCreateGroup(1, {"NotInitialized"}, omit, -, -, -, -, -)), -, int9);
} else if (p_resourceType == int10029) {
v_originalResourceIndex := f_generateAndSetLocalResource(m_primitiveContentTimeSeries(m_contentCreateTimeSeries), -, int29);
}
p_requestPrimitive.primitiveContent := f_setLink(valueof(p_requestPrimitive.primitiveContent), f_getLocalResourceAddress(v_originalResourceIndex, -, e_spRelative));
p_requestPrimitive.primitiveContent := f_setExpirationTime(valueof(p_requestPrimitive.primitiveContent), vc_localResourcesList[v_originalResourceIndex].resource);
//TODO Add other resource types
......
This diff is collapsed.
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