Resolved build warning for linux
authorhyuna0213.jo <hyuna0213.jo@samsung.com>
Thu, 25 Aug 2016 04:00:23 +0000 (13:00 +0900)
committerJon A. Cruz <jon@joncruz.org>
Thu, 25 Aug 2016 22:07:18 +0000 (22:07 +0000)
fix build warning about incompatible pointer type.

Change-Id: Ia903a071440fcd347deecf9909e1ccde6c44ad10
Signed-off-by: hyuna0213.jo <hyuna0213.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10891
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Jaewook Jung <jw0213.jung@samsung.com>
Reviewed-by: Jon A. Cruz <jon@joncruz.org>
resource/csdk/connectivity/inc/cainterfacecontroller.h
resource/csdk/connectivity/src/cainterfacecontroller.c

index 803fe575d2f86e3840bfdd19ea0d5dfc38a53726..1fe36e9d9c05a0b6d82b20956b2e129cb79f945f 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "caadapterinterface.h"
 #include "cainterface.h"
+#include "cautilinterface.h"
 
 #ifndef SINGLE_THREAD
 #include "cathreadpool.h" /* for thread pool */
@@ -71,8 +72,8 @@ void CASetErrorHandleCallback(CAErrorHandleCallback errorCallback);
  * @param[in]   adapterCB       CAUtil callback to receive adapter status changes.
  * @param[in]   connCB          CAUtil callback to receive connection status changes.
  */
-void CASetNetworkMonitorCallbacks(CAAdapterChangeCallback adapterCB,
-                                  CAConnectionChangeCallback connCB);
+void CASetNetworkMonitorCallbacks(CAAdapterStateChangedCB adapterCB,
+                                  CAConnectionStateChangedCB connCB);
 
 /**
  * Starting different connectivity adapters based on the network selection.
index e4dea19f7c0b98d949ff03d8eeb9585cc9414bed..9b1729c5cefa95b6821078310c35c151625ce2d1 100644 (file)
@@ -55,9 +55,9 @@ static uint32_t g_numberOfAdapters = 0;
 
 static CANetworkPacketReceivedCallback g_networkPacketReceivedCallback = NULL;
 
-static CAAdapterChangeCallback g_adapterChangeCallback = NULL;
+static CAAdapterStateChangedCB g_adapterChangeCallback = NULL;
 
-static CAConnectionChangeCallback g_connChangeCallback = NULL;
+static CAConnectionStateChangedCB g_connChangeCallback = NULL;
 
 static CAErrorHandleCallback g_errorHandleCallback = NULL;
 
@@ -129,7 +129,14 @@ static void CAAdapterChangedCallback(CATransportAdapter_t adapter, CANetworkStat
     // Call the callback.
     if (g_adapterChangeCallback != NULL)
     {
-        g_adapterChangeCallback(adapter, status);
+        if (CA_INTERFACE_UP == status)
+        {
+            g_adapterChangeCallback(adapter, true);
+        }
+        else if (CA_INTERFACE_DOWN == status)
+        {
+            g_adapterChangeCallback(adapter, false);
+        }
     }
     OIC_LOG_V(DEBUG, TAG, "[%d]adapter status is changed to [%d]", adapter, status);
 }
@@ -200,8 +207,8 @@ void CASetPacketReceivedCallback(CANetworkPacketReceivedCallback callback)
     g_networkPacketReceivedCallback = callback;
 }
 
-void CASetNetworkMonitorCallbacks(CAAdapterChangeCallback adapterCB,
-                                  CAConnectionChangeCallback connCB)
+void CASetNetworkMonitorCallbacks(CAAdapterStateChangedCB adapterCB,
+                                  CAConnectionStateChangedCB connCB)
 {
     OIC_LOG(DEBUG, TAG, "Set network monitoring callback");