Commit 69c006ea569b5bda1b894dbff3211695ad092ce2

Authored by Miguel Angel Reina Ortega
2 parents c170c6e4 83602d0d

Merge branch 'Release1' into 'master'

Improvement on f_getYear and f_getMonth functions

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>

See merge request !55
... ... @@ -4298,7 +4298,7 @@ module OneM2M_Functions {
4298 4298 * @param p_timestamp Given timestamp
4299 4299 * @return Year
4300 4300 */
4301   - function f_getYear(charstring p_timestamp) runs on Tester return charstring {
  4301 + function f_getYear(charstring p_timestamp) runs on Tester return integer {
4302 4302  
4303 4303 var charstring v_year := "";
4304 4304 var integer i;
... ... @@ -4306,7 +4306,7 @@ module OneM2M_Functions {
4306 4306 for(i := 0; i <= 3; i := i+1){
4307 4307 v_year := v_year & p_timestamp[i];
4308 4308 }
4309   - return v_year;
  4309 + return str2int(v_year);
4310 4310  
4311 4311 } // end f_getYear
4312 4312  
... ... @@ -4315,7 +4315,7 @@ module OneM2M_Functions {
4315 4315 * @param p_timestamp Given timestamp
4316 4316 * @return Year
4317 4317 */
4318   - function f_getMonth(charstring p_timestamp) runs on Tester return charstring {
  4318 + function f_getMonth(charstring p_timestamp) runs on Tester return integer {
4319 4319  
4320 4320 var charstring v_month := "";
4321 4321 var integer i;
... ... @@ -4325,7 +4325,7 @@ module OneM2M_Functions {
4325 4325 v_month := v_month & p_timestamp[i];
4326 4326 }
4327 4327 }
4328   - return v_month;
  4328 + return str2int(v_month);
4329 4329  
4330 4330 } // end f_getYear
4331 4331  
... ...
... ... @@ -6691,7 +6691,7 @@ module OneM2M_PermutationFunctions {
6691 6691 // Preamble
6692 6692 v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1);
6693 6693 v_currentTime := fx_generateTimestamp();
6694   - v_accessControlRule.accessControlContexts_list := {{{"* * * * " & f_getMonth(v_currentTime) & " *"}, omit, omit}};
  6694 + v_accessControlRule.accessControlContexts_list := {{{"* * * * " & int2str(f_getMonth(v_currentTime)) & " *"}, omit, omit}};
6695 6695 v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule};
6696 6696 vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
6697 6697  
... ... @@ -6739,7 +6739,7 @@ module OneM2M_PermutationFunctions {
6739 6739 function f_CSE_SEC_ACP_006(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{
6740 6740 // Local variables
6741 6741 var MsgIn v_response;
6742   - var charstring v_month;
  6742 + var integer v_month;
6743 6743 var charstring v_currentTime;
6744 6744 var integer v_aeIndex := -1;
6745 6745 var RequestPrimitive v_createRequest;
... ... @@ -6756,12 +6756,12 @@ module OneM2M_PermutationFunctions {
6756 6756 v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1);
6757 6757 v_currentTime := fx_generateTimestamp();
6758 6758 v_month := f_getMonth(v_currentTime);
6759   - if(v_month =="12") {
6760   - v_month := "1";
  6759 + if(v_month == 12) {
  6760 + v_month := 1;
6761 6761 } else {
6762   - v_month := int2char(char2int(v_month) + 1);
  6762 + v_month := v_month + 1;
6763 6763 }
6764   - v_accessControlRule.accessControlContexts_list := {{{"* * * * " & v_month & " *"}, omit, omit}};
  6764 + v_accessControlRule.accessControlContexts_list := {{{"* * * * " & int2str(v_month) & " *"}, omit, omit}};
6765 6765 v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule};
6766 6766 vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource
6767 6767  
... ...