From 23b1b22ba0e068c217fedd3e95e50ad536a16667 Mon Sep 17 00:00:00 2001 From: "hyuna0213.jo" Date: Thu, 25 Aug 2016 13:00:23 +0900 Subject: [PATCH] Resolved build warning for linux fix build warning about incompatible pointer type. Change-Id: Ia903a071440fcd347deecf9909e1ccde6c44ad10 Signed-off-by: hyuna0213.jo Reviewed-on: https://gerrit.iotivity.org/gerrit/10891 Tested-by: jenkins-iotivity Reviewed-by: jihwan seo Reviewed-by: Jaewook Jung Reviewed-by: Jon A. Cruz --- .../connectivity/inc/cainterfacecontroller.h | 5 +++-- .../connectivity/src/cainterfacecontroller.c | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/resource/csdk/connectivity/inc/cainterfacecontroller.h b/resource/csdk/connectivity/inc/cainterfacecontroller.h index 803fe575d..1fe36e9d9 100644 --- a/resource/csdk/connectivity/inc/cainterfacecontroller.h +++ b/resource/csdk/connectivity/inc/cainterfacecontroller.h @@ -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. diff --git a/resource/csdk/connectivity/src/cainterfacecontroller.c b/resource/csdk/connectivity/src/cainterfacecontroller.c index e4dea19f7..9b1729c5c 100644 --- a/resource/csdk/connectivity/src/cainterfacecontroller.c +++ b/resource/csdk/connectivity/src/cainterfacecontroller.c @@ -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"); -- 2.34.1