diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 86bc310da8b3decbc477669610dd848c25a7cece..9ceec5c7f2febaca0cb924a7fa96e5e1beec84b1 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -1393,6 +1393,41 @@ module OneM2M_Functions { //mcaPort.send(m_response(v_responsePrimitive)); // TODO have to be deleted } //end f_subscriptionVerificationHandler + + /** + * @desc Default handling message exchange for the notification procedure + * @verdict + */ + function f_cse_notifyProcedure_defaultHandler() runs on AeSimu { + // Local variables + var ResponsePrimitive v_responsePrimitive; + + //Activate defaults when running on a PTC + f_cse_activateDefaults_ae(); + + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { + tc_ac.stop; + + setverdict(pass, __SCOPE__ & ":INFO: Notification received"); + + //Send response in any case + v_responsePrimitive := valueof(m_responseNotification(int2001, omit)); + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + mcaPortIn.send(m_response(v_responsePrimitive)); + tc_ac.start; + repeat; + } + [] mcaPortIn.receive{ + tc_ac.stop; + setverdict(inconc, __SCOPE__ & ":ERROR: unexpected message received"); + tc_ac.start; + repeat; + } + } + + } //end f_cse_notifyProcedure_defaultHandler /** * @desc Handling message exchange for the notification procedure diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn index 49bb2a438a1890aa89c0acdad6a6a4f68df3ba3f..61cbe47367d77919cbbdd932856e5b52a17729c6 100644 --- a/OneM2M_PermutationFunctions.ttcn +++ b/OneM2M_PermutationFunctions.ttcn @@ -4982,9 +4982,17 @@ module OneM2M_PermutationFunctions { v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitiveChildResource, p_childResourceType); + v_childResourceIndex := f_cse_createResource(p_childResourceType, p_createRequestPrimitiveChildResource, v_resourceIndex); + if((p_resourceType == int23) or (p_childResourceType == int23)) { + vc_ae2.start(f_cse_notifyProcedure_defaultHandler()); + } + f_cse_deleteResource(v_resourceIndex); + + f_checkAeSimuStatus(); // Test Body mcaPort.send(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex))));