diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 57089edf4aa467192ec6b25164167188ac4c09a1..c6db8f39977b20d4d2b23b1d4d2d11f3b81ec920 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -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 /**