Skip to content
Snippets Groups Projects
Commit 68b449ae authored by Pramod Kulkarni's avatar Pramod Kulkarni
Browse files

Calling function f_getResourceIndex from the default a_cse_cf02_cse1

parent f220808e
No related branches found
No related tags found
No related merge requests found
...@@ -2048,6 +2048,7 @@ module OneM2M_Functions { ...@@ -2048,6 +2048,7 @@ module OneM2M_Functions {
var integer vc_localResourceIndex := -1; var integer vc_localResourceIndex := -1;
var MsgIn v_request; var MsgIn v_request;
var ResponsePrimitive v_response; var ResponsePrimitive v_response;
var integer v_localResourceIndex := -1;
[] mccPortIn.receive(mw_request(mw_create())) -> value v_request { [] mccPortIn.receive(mw_request(mw_create())) -> value v_request {
log(__SCOPE__&": WARNING: Unexpected CREATE message received"); log(__SCOPE__&": WARNING: Unexpected CREATE message received");
...@@ -2067,11 +2068,21 @@ module OneM2M_Functions { ...@@ -2067,11 +2068,21 @@ module OneM2M_Functions {
tc_ac.stop; tc_ac.stop;
log(__SCOPE__&": WARNING: Unexpected RETRIEVE message received"); log(__SCOPE__&": WARNING: Unexpected RETRIEVE message received");
v_localResourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
if(v_localResourceIndex == -1)
{
log(__SCOPE__&": ERROR: Resource Index not valid");
v_response := valueof(m_responsePrimitive(int4004,v_request.primitive.requestPrimitive.requestIdentifier));
v_response.from_ := PX_CSE1_ID;
v_response.to_ := v_request.primitive.requestPrimitive.from_;
mccPortIn.send(m_response(v_response));
} else {
v_response := valueof(m_responsePrimitive(int2000,v_request.primitive.requestPrimitive.requestIdentifier)); v_response := valueof(m_responsePrimitive(int2000,v_request.primitive.requestPrimitive.requestIdentifier));
v_response.from_ := PX_CSE1_ID; v_response.from_ := PX_CSE1_ID;
v_response.to_ := v_request.primitive.requestPrimitive.from_; v_response.to_ := v_request.primitive.requestPrimitive.from_;
v_response.primitiveContent := vc_localResourcesList[vc_cSEBaseIndex].resource; v_response.primitiveContent := vc_localResourcesList[vc_cSEBaseIndex].resource;
mccPortIn.send(m_response(v_response)); mccPortIn.send(m_response(v_response));
}
tc_ac.start; tc_ac.start;
repeat; repeat;
} }
...@@ -2079,11 +2090,21 @@ module OneM2M_Functions { ...@@ -2079,11 +2090,21 @@ module OneM2M_Functions {
tc_ac.stop; tc_ac.stop;
log(__SCOPE__&": WARNING: Unexpected UPDATE message received"); log(__SCOPE__&": WARNING: Unexpected UPDATE message received");
v_localResourceIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
if(v_localResourceIndex == -1)
{
log(__SCOPE__&": ERROR: Resource Index not valid");
v_response := valueof(m_responsePrimitive(int4004,v_request.primitive.requestPrimitive.requestIdentifier));
v_response.from_ := PX_CSE1_ID;
v_response.to_ := v_request.primitive.requestPrimitive.from_;
mccPortIn.send(m_response(v_response));
} else {
v_response := valueof(m_responsePrimitive(int2004,v_request.primitive.requestPrimitive.requestIdentifier)); v_response := valueof(m_responsePrimitive(int2004,v_request.primitive.requestPrimitive.requestIdentifier));
v_response.from_ := PX_CSE1_ID; v_response.from_ := PX_CSE1_ID;
v_response.to_ := v_request.primitive.requestPrimitive.from_; v_response.to_ := v_request.primitive.requestPrimitive.from_;
v_response.primitiveContent := vc_localResourcesList[vc_localRemoteCseIndex].resource; v_response.primitiveContent := vc_localResourcesList[vc_localRemoteCseIndex].resource;
mccPortIn.send(m_response(v_response)); mccPortIn.send(m_response(v_response));
}
tc_ac.start; tc_ac.start;
repeat; repeat;
} }
...@@ -2153,7 +2174,7 @@ module OneM2M_Functions { ...@@ -2153,7 +2174,7 @@ module OneM2M_Functions {
tc_ac.stop; tc_ac.stop;
v_rp := v_request.primitive.requestPrimitive; v_rp := v_request.primitive.requestPrimitive;
v_parentIndex := f_getResourceIndex(v_rp.to_, v_rp.primitiveContent); v_parentIndex := f_getResourceIndex(v_rp.to_);
v_modifiedResource := f_ae_generateLocalResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType); v_modifiedResource := f_ae_generateLocalResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType);
v_resourceIndex := f_setLocalResource(v_modifiedResource, int2, v_parentIndex); v_resourceIndex := f_setLocalResource(v_modifiedResource, int2, v_parentIndex);
if(v_resourceIndex != -1) { if(v_resourceIndex != -1) {
...@@ -2204,7 +2225,7 @@ module OneM2M_Functions { ...@@ -2204,7 +2225,7 @@ module OneM2M_Functions {
tc_ac.stop; tc_ac.stop;
v_rp := v_request.primitive.requestPrimitive; v_rp := v_request.primitive.requestPrimitive;
v_parentIndex := f_getResourceIndex(v_rp.to_, v_rp.primitiveContent); v_parentIndex := f_getResourceIndex(v_rp.to_);
v_modifiedResource := f_ae_generateLocalResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType); v_modifiedResource := f_ae_generateLocalResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType);
v_resourceIndex := f_setLocalResource(v_modifiedResource, int2, v_parentIndex); v_resourceIndex := f_setLocalResource(v_modifiedResource, int2, v_parentIndex);
if(v_resourceIndex != -1) { if(v_resourceIndex != -1) {
...@@ -2328,7 +2349,7 @@ module OneM2M_Functions { ...@@ -2328,7 +2349,7 @@ module OneM2M_Functions {
[] mcaPort.receive(mw_request(mw_create)) -> value v_request { [] mcaPort.receive(mw_request(mw_create)) -> value v_request {
v_rp := v_request.primitive.requestPrimitive; v_rp := v_request.primitive.requestPrimitive;
v_parentIndex := f_getResourceIndex(v_rp.to_, v_rp.primitiveContent); v_parentIndex := f_getResourceIndex(v_rp.to_);
v_modifiedResource := f_ae_generateLocalResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType); v_modifiedResource := f_ae_generateLocalResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType);
v_resourceIndex := f_setLocalResource(v_modifiedResource, v_rp.resourceType, v_parentIndex); v_resourceIndex := f_setLocalResource(v_modifiedResource, v_rp.resourceType, v_parentIndex);
if(v_resourceIndex != -1) { if(v_resourceIndex != -1) {
...@@ -2766,7 +2787,7 @@ module OneM2M_Functions { ...@@ -2766,7 +2787,7 @@ module OneM2M_Functions {
if (f_isHierarchical(p_receivedURI)) { if (f_isHierarchical(p_receivedURI)) {
v_resourceName := f_resourceIdCleaner(p_receivedURI); //f_getResourceName(p_contentResource); v_resourceName := f_resourceIdCleaner(p_receivedURI);
for(i:=0; i < lengthof(vc_resourcesList); i := i+1){ for(i:=0; i < lengthof(vc_resourcesList); i := i+1){
if(match(f_getResourceName(vc_localResourcesList[i].resource), v_resourceName)){ if(match(f_getResourceName(vc_localResourcesList[i].resource), v_resourceName)){
...@@ -2776,7 +2797,7 @@ module OneM2M_Functions { ...@@ -2776,7 +2797,7 @@ module OneM2M_Functions {
} }
} else { } else {
v_resourceID := f_resourceIdCleaner(v_resourceID); v_resourceID := f_resourceIdCleaner(p_receivedURI);
for(i:=0; i < lengthof(vc_resourcesList); i := i+1){ for(i:=0; i < lengthof(vc_resourcesList); i := i+1){
if(match(f_getResourceId(vc_localResourcesList[i].resource), v_resourceID)){ if(match(f_getResourceId(vc_localResourcesList[i].resource), v_resourceID)){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment