Fixed build/deploy script on updating temp file. Added unsubsribe to signout method
authorAndriy Gudz <a.gudz@samsung.com>
Tue, 16 May 2017 12:51:10 +0000 (15:51 +0300)
committerAndriy Gudz <a.gudz@samsung.com>
Wed, 17 May 2017 07:04:04 +0000 (10:04 +0300)
device_core/iotivity_lib/src/iotivity.cpp
device_core/scripts/build.sh
device_core/scripts/deploy.sh

index b2fa4ce..ffd2a7d 100644 (file)
@@ -265,6 +265,8 @@ void IoTivity::signOut()
         return;
     }
 
+    unsubscribeNotifications();
+
     /*if (params->subscribed)
     {
         OCPlatform::unsubscribePresence(params->presenceHandle);
index cdc2a3a..9d64e16 100755 (executable)
@@ -5,16 +5,24 @@ SCRIPT_DIR=${SCRIPT_PATH%/*}
 ROOT_DIR=${SCRIPT_DIR}/..
 DEVICE_TEMP=${SCRIPT_DIR}/.device
 
+if [ ! -e "$DEVICE_TEMP" ] ; then
+       DEVICE_PREV=1
+else
+       DEVICE_PREV=`cat $DEVICE_TEMP`
+fi
+
 if [ -z "$1" ]; then
-       if [ ! -e "$DEVICE_TEMP" ] ; then
-           DEVICE=1
-       else
-               DEVICE=`cat $DEVICE_TEMP`
-       fi      
+       DEVICE=$DEVICE_PREV
 else
+       # Clean incremental build after changing $DEVICE
+       if [ $1 -ne $DEVICE_PREV ]; then
+               rm -r ${SCRIPT_DIR}/../build-gbs
+       fi
        DEVICE=$1
 fi
 
+echo "$DEVICE" > $DEVICE_TEMP
+
 GREEN='\033[0;32m'
 NC='\033[0m'
 
@@ -51,7 +59,6 @@ esac
 
 for ARG in $*
 do
-    echo $ARG
     if [ "DEBUG" = $ARG ];then
         DEBUG_ON=1
         echo 'DEBUG ON'
index 0cb8fd0..f148bc0 100755 (executable)
@@ -14,6 +14,8 @@ else
        DEVICE=$1
 fi
 
+echo "$DEVICE" > $DEVICE_TEMP
+
 GREEN='\033[0;32m'
 NC='\033[0m'