IOT-1877 : start presence issue 61/118861/2 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/common/20170314.173157 accepted/tizen/ivi/20170314.224217 accepted/tizen/mobile/20170314.224141 accepted/tizen/tv/20170314.224144 accepted/tizen/unified/20170315.014656 accepted/tizen/wearable/20170314.224157 submit/tizen/20170314.094744
authorChaJiWon <jw_wonny.cha@samsung.com>
Thu, 2 Mar 2017 12:06:00 +0000 (21:06 +0900)
committerJooSeok Park <jooseok.park@samsung.com>
Tue, 14 Mar 2017 09:44:54 +0000 (02:44 -0700)
When called OCStartPresence() second, OCStartPresence() returns error.
Fixed presenceState variable to OC_PRESENCE_UNINITIALIZED.

Change-Id: I089c826f4105eb3aaf835a8feda4c10b848ebd5d
Signed-off-by: ChaJiWon <jw_wonny.cha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17623
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Way Vadhanasin <wayvad@microsoft.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit 2f11e9592a7374ce28082a523b0c367a6d31baee)
Reviewed-on: https://gerrit.iotivity.org/gerrit/17775

resource/csdk/stack/src/ocstack.c

index 66ac3bf..277cd6e 100644 (file)
@@ -2278,6 +2278,7 @@ OCStackResult OCStop()
     // Ensure that the TTL associated with ANY and ALL presence notifications originating from
     // here send with the code "OC_STACK_PRESENCE_STOPPED" result.
     presenceResource.presenceTTL = 0;
+    presenceState = OC_PRESENCE_UNINITIALIZED;
 #endif // WITH_PRESENCE
 
 #ifdef ROUTING_GATEWAY