diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 0bcd2770ce7f0aad0515df15410da0cb353faec7..67bfdafaf44ff4865c72798f77f972406514fcae 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -3459,7 +3459,7 @@ module OneM2M_Functions { * @param p_timestamp Given timestamp * @return Year */ - function f_getYear(charstring p_timestamp) runs on Tester return charstring { + function f_getYear(charstring p_timestamp) runs on Tester return integer { var charstring v_year := ""; var integer i; @@ -3467,7 +3467,7 @@ module OneM2M_Functions { for(i := 0; i <= 3; i := i+1){ v_year := v_year & p_timestamp[i]; } - return v_year; + return str2int(v_year); } // end f_getYear @@ -3476,7 +3476,7 @@ module OneM2M_Functions { * @param p_timestamp Given timestamp * @return Year */ - function f_getMonth(charstring p_timestamp) runs on Tester return charstring { + function f_getMonth(charstring p_timestamp) runs on Tester return integer { var charstring v_month := ""; var integer i; @@ -3486,7 +3486,7 @@ module OneM2M_Functions { v_month := v_month & p_timestamp[i]; } } - return v_month; + return str2int(v_month); } // end f_getYear diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn index 088debddf908a588581dd93eef6425eea7bf332b..b42f331bc1b6ff8a386ea1c3b5569b13b47a4c72 100644 --- a/OneM2M_PermutationFunctions.ttcn +++ b/OneM2M_PermutationFunctions.ttcn @@ -5844,7 +5844,7 @@ module OneM2M_PermutationFunctions { // Preamble v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); v_currentTime := fx_generateTimestamp(); - v_accessControlRule.accessControlContexts_list := {{{"* * * * " & f_getMonth(v_currentTime) & " *"}, omit, omit}}; + v_accessControlRule.accessControlContexts_list := {{{"* * * * " & int2str(f_getMonth(v_currentTime)) & " *"}, omit, omit}}; v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource @@ -5892,7 +5892,7 @@ module OneM2M_PermutationFunctions { function f_CSE_SEC_ACP_006(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ // Local variables var MsgIn v_response; - var charstring v_month; + var integer v_month; var charstring v_currentTime; var integer v_aeIndex := -1; var RequestPrimitive v_createRequest; @@ -5909,12 +5909,12 @@ module OneM2M_PermutationFunctions { v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); v_currentTime := fx_generateTimestamp(); v_month := f_getMonth(v_currentTime); - if(v_month =="12") { - v_month := "1"; + if(v_month == 12) { + v_month := 1; } else { - v_month := int2char(char2int(v_month) + 1); + v_month := v_month + 1; } - v_accessControlRule.accessControlContexts_list := {{{"* * * * " & v_month & " *"}, omit, omit}}; + v_accessControlRule.accessControlContexts_list := {{{"* * * * " & int2str(v_month) & " *"}, omit, omit}}; v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource