Fix for f_cse_notifyProcedure_subscriptionVerificationHandler in case...

Fix for f_cse_notifyProcedure_subscriptionVerificationHandler in case notification request is not received
Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 44462b33
......@@ -1842,6 +1842,7 @@ module OneM2M_Functions {
function f_cse_notifyProcedure_subscriptionVerificationHandler(in ResponseStatusCode p_responseStatusCode := int2000) runs on AeSimu {
// Local variables
var ResponsePrimitive v_responsePrimitive;
var boolean v_notificationReceived := false;
var template Notification v_notificationRequest := mw_contentNotificationVerification;
//Activate defaults when running on a PTC
......@@ -1856,10 +1857,12 @@ module OneM2M_Functions {
alt {
[] mcaPortIn.receive(mw_request(mw_notifyNotification(v_notificationRequest))) -> value vc_request {
tc_ac.stop;
v_notificationReceived := true;
setverdict(pass, __SCOPE__ & ":INFO: Subscription Verification Notification received");
}
[] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request {
tc_ac.stop;
v_notificationReceived := true;
setverdict(inconc, __SCOPE__ & ":ERROR: Notification received but verificationRequest isn't set to TRUE");
}
[] tc_ac.timeout {
......@@ -1868,16 +1871,18 @@ module OneM2M_Functions {
}
}
//Sending response to the notification received
//Preparation of Notification response to be sent
v_responsePrimitive := valueof(m_responseNotification(p_responseStatusCode, omit));
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
if(getverdict != pass) {
v_responsePrimitive.responseStatusCode := int4000;
if(v_notificationReceived) {
//Sending response to the notification received
//Preparation of Notification response to be sent
v_responsePrimitive := valueof(m_responseNotification(p_responseStatusCode, omit));
v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
if(getverdict != pass) {
v_responsePrimitive.responseStatusCode := int4000;
}
f_send(e_mca_in_port, m_response(v_responsePrimitive));
}
f_send(e_mca_in_port, m_response(v_responsePrimitive));
} //end f_cse_notifyProcedure_subscriptionVerificationHandler
/**
......
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