Commit 69c006ea authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega

Merge branch 'Release1' into 'master'

Improvement on f_getYear and f_getMonth functions
Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>

See merge request !55
parents c170c6e4 83602d0d
......@@ -4298,7 +4298,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;
......@@ -4306,7 +4306,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
......@@ -4315,7 +4315,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;
......@@ -4325,7 +4325,7 @@ module OneM2M_Functions {
v_month := v_month & p_timestamp[i];
}
}
return v_month;
return str2int(v_month);
} // end f_getYear
......
......@@ -6691,7 +6691,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
......@@ -6739,7 +6739,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;
......@@ -6756,12 +6756,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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment