From 305c85a0a7a6090997a0b66a4aacfcbd1a9996be Mon Sep 17 00:00:00 2001
From: reinaortega <miguelangel.reinaortega@etsi.org>
Date: Thu, 26 Jul 2018 11:44:13 +0200
Subject: [PATCH] NOTIFY request to be caught in default + NOTIFY response
 status code changed to 2000

Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org>
---
 LibOneM2M/OneM2M_Functions.ttcn | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn
index 665afbf..9d2b322 100644
--- a/LibOneM2M/OneM2M_Functions.ttcn
+++ b/LibOneM2M/OneM2M_Functions.ttcn
@@ -1420,7 +1420,7 @@ module OneM2M_Functions {
 							setverdict(pass, __SCOPE__ & ":INFO: Notification received");
 							
 							//Send response in any case
-							v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
+							v_responsePrimitive := valueof(m_responseNotification(int2000, omit));
 							v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
 							mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
 							tc_ac.start;
@@ -1459,7 +1459,7 @@ module OneM2M_Functions {
 								setverdict(fail, __SCOPE__ & ":ERROR: Notification received but the content doesn't match");
 							}
 							//Send response in any case
-							v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
+							v_responsePrimitive := valueof(m_responseNotification(int2000, omit));
 							v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
 							mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
 						}
@@ -1503,7 +1503,7 @@ module OneM2M_Functions {
 								setverdict(fail, __SCOPE__ & ": Number of Notification in Aggregatednotification isn't right");
 							}
 							//Send response in any case
-							v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
+							v_responsePrimitive := valueof(m_responseNotification(int2000, omit));
 							v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
 							mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
 						}
@@ -1516,7 +1516,7 @@ module OneM2M_Functions {
 								setverdict(fail, __SCOPE__ & ":ERROR: Notification received but the content doesn't match");
 							}
 							//Send response in any case
-							v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
+							v_responsePrimitive := valueof(m_responseNotification(int2000, omit));
 							v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
 							mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
 							v_notificationsReceived := v_notificationsReceived + 1;
@@ -1551,7 +1551,7 @@ module OneM2M_Functions {
 					alt {
 						[] mcaPortIn.receive(mw_request(mw_notifyNotification(p_notification))) -> value vc_request {
 							tc_ac.stop;
-							v_responsePrimitive := valueof(m_responseNotification(int2001, omit));
+							v_responsePrimitive := valueof(m_responseNotification(int2000, omit));
 							v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
 							mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
 							if(not(match(vc_request.primitive.requestPrimitive.primitiveContent.notification.subscriptionDeletion, true))) {
@@ -2413,6 +2413,17 @@ module OneM2M_Functions {
 					tc_ac.start(10.0);
 					repeat;
 				}
+				[] mccPortIn.receive(mw_request(mw_notify)) -> value v_request {
+					tc_ac.stop;
+					log(__SCOPE__&": WARNING: Unexpected NOTIFY message received");
+
+					//Send response in any case
+					v_response := valueof(m_responseNotification(int2000, omit));
+					v_response.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier;
+					mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_response)));
+					tc_ac.start(10.0);
+					repeat;
+				}
 				[] mccPortIn.receive (mw_request(?)){
 					log(__SCOPE__&": WARNING: Unexpected message received");
 					repeat;
-- 
GitLab