Commit 83602d0da73c3df58d05ef9e26c5a398d142fb8c

Authored by Miguel Angel Reina Ortega
1 parent 267ceff9

Improvement on f_getYear and f_getMonth functions

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>
... ... @@ -3459,7 +3459,7 @@ module OneM2M_Functions {
3459 3459 * @param p_timestamp Given timestamp
3460 3460 * @return Year
3461 3461 */
3462   - function f_getYear(charstring p_timestamp) runs on Tester return charstring {
  3462 + function f_getYear(charstring p_timestamp) runs on Tester return integer {
3463 3463  
3464 3464 var charstring v_year := "";
3465 3465 var integer i;
... ... @@ -3467,7 +3467,7 @@ module OneM2M_Functions {
3467 3467 for(i := 0; i <= 3; i := i+1){
3468 3468 v_year := v_year & p_timestamp[i];
3469 3469 }
3470   - return v_year;
  3470 + return str2int(v_year);
3471 3471  
3472 3472 } // end f_getYear
3473 3473  
... ... @@ -3476,7 +3476,7 @@ module OneM2M_Functions {
3476 3476 * @param p_timestamp Given timestamp
3477 3477 * @return Year
3478 3478 */
3479   - function f_getMonth(charstring p_timestamp) runs on Tester return charstring {
  3479 + function f_getMonth(charstring p_timestamp) runs on Tester return integer {
3480 3480  
3481 3481 var charstring v_month := "";
3482 3482 var integer i;
... ... @@ -3486,7 +3486,7 @@ module OneM2M_Functions {
3486 3486 v_month := v_month & p_timestamp[i];
3487 3487 }
3488 3488 }
3489   - return v_month;
  3489 + return str2int(v_month);
3490 3490  
3491 3491 } // end f_getYear
3492 3492  
... ...
... ... @@ -5844,7 +5844,7 @@ module OneM2M_PermutationFunctions {
5844 5844 // Preamble
5845 5845 v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1);
5846 5846 v_currentTime := fx_generateTimestamp();
5847   - v_accessControlRule.accessControlContexts_list := {{{"* * * * " & f_getMonth(v_currentTime) & " *"}, omit, omit}};
  5847 + v_accessControlRule.accessControlContexts_list := {{{"* * * * " & int2str(f_getMonth(v_currentTime)) & " *"}, omit, omit}};
5848 5848 v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule};
5849 5849 vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
5850 5850  
... ... @@ -5892,7 +5892,7 @@ module OneM2M_PermutationFunctions {
5892 5892 function f_CSE_SEC_ACP_006(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{
5893 5893 // Local variables
5894 5894 var MsgIn v_response;
5895   - var charstring v_month;
  5895 + var integer v_month;
5896 5896 var charstring v_currentTime;
5897 5897 var integer v_aeIndex := -1;
5898 5898 var RequestPrimitive v_createRequest;
... ... @@ -5909,12 +5909,12 @@ module OneM2M_PermutationFunctions {
5909 5909 v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1);
5910 5910 v_currentTime := fx_generateTimestamp();
5911 5911 v_month := f_getMonth(v_currentTime);
5912   - if(v_month =="12") {
5913   - v_month := "1";
  5912 + if(v_month == 12) {
  5913 + v_month := 1;
5914 5914 } else {
5915   - v_month := int2char(char2int(v_month) + 1);
  5915 + v_month := v_month + 1;
5916 5916 }
5917   - v_accessControlRule.accessControlContexts_list := {{{"* * * * " & v_month & " *"}, omit, omit}};
  5917 + v_accessControlRule.accessControlContexts_list := {{{"* * * * " & int2str(v_month) & " *"}, omit, omit}};
5918 5918 v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule};
5919 5919 vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
5920 5920  
... ...