From 3a5d2c00f3d33b51fb7b2e8615b8a8f561da6ff6 Mon Sep 17 00:00:00 2001 From: reinaortega <miguelangel.reinaortega@etsi.org> Date: Wed, 23 Jan 2019 15:07:06 +0100 Subject: [PATCH] Creation of Group resource missing in f_generateLocalResource Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org> --- LibOneM2M/OneM2M_Functions.ttcn | 35 +++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 3bdac11..a31f1b7 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -2774,21 +2774,30 @@ module OneM2M_Functions { } } - } else if(p_resourceType == int23 and ispresent(p_resource)) { //Subscription - if(ischosen(p_resource.subscription)){ - v_myResource.subscription := valueof(p_resource.subscription); - v_myResource.subscription.resourceID := "sub" & int2str(v_resourceIndex); - if(not(ispresent(p_resource.subscription.resourceName))) { - v_myResource.subscription.resourceName := "subscription" & int2str(v_resourceIndex); + } else if(p_resourceType == int9 and ispresent(p_resource)) { //Group + if(ischosen(p_resource.group_)){ + v_myResource.group_ := valueof(p_resource.group_); + v_myResource.group_.resourceID := "grp" & int2str(v_resourceIndex); + if(not(ispresent(p_resource.group_.resourceName))) { + v_myResource.group_.resourceName := "group" & int2str(v_resourceIndex); } - v_myResource.subscription.resourceType := p_resourceType; - v_myResource.subscription.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource); - v_myResource.subscription.creationTime := fx_generateTimestamp(); - v_myResource.subscription.lastModifiedTime := v_myResource.subscription.creationTime; - if(not(ispresent(p_resource.subscription.expirationTime))) { - v_myResource.subscription.expirationTime := "20301231T012345"; + v_myResource.group_.resourceType := p_resourceType; + v_myResource.group_.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource); + v_myResource.group_.creationTime := fx_generateTimestamp(); + v_myResource.group_.lastModifiedTime := v_myResource.group_.creationTime; + if(not(ispresent(p_resource.group_.expirationTime))) { + v_myResource.group_.expirationTime := "20301231T012345"; } - } + if(not(ispresent(p_resource.group_.memberType))) { + v_myResource.group_.memberType := int0; + } + if(not(ispresent(p_resource.group_.consistencyStrategy))) { + v_myResource.group_.consistencyStrategy := int1; + } + if(v_myResource.group_.memberType != int0) { + v_myResource.group_.memberTypeValidated := true;//Set initially to TRUE + } + } } else if(p_resourceType == int15 and ispresent(p_resource)) { //PollingChannel if(ischosen(p_resource.pollingChannel)){ v_myResource.pollingChannel := valueof(p_resource.pollingChannel); -- GitLab