Fixed arduino server sending notifications after deregister.
authorMandeep Shetty <mandeep.shetty@intel.com>
Thu, 30 Jul 2015 22:53:47 +0000 (15:53 -0700)
committerErich Keane <erich.keane@intel.com>
Thu, 30 Jul 2015 23:33:59 +0000 (23:33 +0000)
This fixes IOT-627.
Arduino server continuted to send observe notifications even after
client deregisters. This happened because a bool variable tracking if
light was under observation was not set to false.

Change-Id: Ic1f00915632251a9be8772ca3cc4b71373dc3b18
Signed-off-by: Mandeep Shetty <mandeep.shetty@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2011
Reviewed-by: Omkar Hegde <omkar.m.hegde@intel.com>
Reviewed-by: Joseph Morrow <joseph.l.morrow@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/ocserver.cpp

index f0ffd46..52e42f2 100644 (file)
@@ -209,6 +209,7 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag, OCEntityHandle
         else if (OC_OBSERVE_DEREGISTER == entityHandlerRequest->obsInfo.action)
         {
             OC_LOG (INFO, TAG, PCF("Received OC_OBSERVE_DEREGISTER from client"));
+            gLightUnderObservation = 0;
         }
     }
     OCRepPayloadDestroy(payload);