Commit 3a5d2c00f3d33b51fb7b2e8615b8a8f561da6ff6

Authored by Miguel Angel Reina Ortega
1 parent 147a1768

Creation of Group resource missing in f_generateLocalResource

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>
Showing 1 changed file with 22 additions and 13 deletions
... ... @@ -2774,21 +2774,30 @@ module OneM2M_Functions {
2774 2774 }
2775 2775 }
2776 2776  
2777   - } else if(p_resourceType == int23 and ispresent(p_resource)) { //Subscription
2778   - if(ischosen(p_resource.subscription)){
2779   - v_myResource.subscription := valueof(p_resource.subscription);
2780   - v_myResource.subscription.resourceID := "sub" & int2str(v_resourceIndex);
2781   - if(not(ispresent(p_resource.subscription.resourceName))) {
2782   - v_myResource.subscription.resourceName := "subscription" & int2str(v_resourceIndex);
  2777 + } else if(p_resourceType == int9 and ispresent(p_resource)) { //Group
  2778 + if(ischosen(p_resource.group_)){
  2779 + v_myResource.group_ := valueof(p_resource.group_);
  2780 + v_myResource.group_.resourceID := "grp" & int2str(v_resourceIndex);
  2781 + if(not(ispresent(p_resource.group_.resourceName))) {
  2782 + v_myResource.group_.resourceName := "group" & int2str(v_resourceIndex);
2783 2783 }
2784   - v_myResource.subscription.resourceType := p_resourceType;
2785   - v_myResource.subscription.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource);
2786   - v_myResource.subscription.creationTime := fx_generateTimestamp();
2787   - v_myResource.subscription.lastModifiedTime := v_myResource.subscription.creationTime;
2788   - if(not(ispresent(p_resource.subscription.expirationTime))) {
2789   - v_myResource.subscription.expirationTime := "20301231T012345";
  2784 + v_myResource.group_.resourceType := p_resourceType;
  2785 + v_myResource.group_.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource);
  2786 + v_myResource.group_.creationTime := fx_generateTimestamp();
  2787 + v_myResource.group_.lastModifiedTime := v_myResource.group_.creationTime;
  2788 + if(not(ispresent(p_resource.group_.expirationTime))) {
  2789 + v_myResource.group_.expirationTime := "20301231T012345";
2790 2790 }
2791   - }
  2791 + if(not(ispresent(p_resource.group_.memberType))) {
  2792 + v_myResource.group_.memberType := int0;
  2793 + }
  2794 + if(not(ispresent(p_resource.group_.consistencyStrategy))) {
  2795 + v_myResource.group_.consistencyStrategy := int1;
  2796 + }
  2797 + if(v_myResource.group_.memberType != int0) {
  2798 + v_myResource.group_.memberTypeValidated := true;//Set initially to TRUE
  2799 + }
  2800 + }
2792 2801 } else if(p_resourceType == int15 and ispresent(p_resource)) { //PollingChannel
2793 2802 if(ischosen(p_resource.pollingChannel)){
2794 2803 v_myResource.pollingChannel := valueof(p_resource.pollingChannel);
... ...