From: jihwan.seo Date: Tue, 27 Sep 2016 05:47:04 +0000 (+0900) Subject: [IOT-1332] update to disable connection state changed CB for IP adapter X-Git-Tag: 1.3.0~947 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=36ca30b0f4123d38f5112a8d2ede3a3d2e0d9022;p=platform%2Fupstream%2Fiotivity.git [IOT-1332] update to disable connection state changed CB for IP adapter Since IP adapter(UDP) is the Connectionless Protocol, it doesn't need. Change-Id: I649ab5b1c789e49a283be6d2c77af618ba11c8b6 Signed-off-by: jihwan.seo Reviewed-on: https://gerrit.iotivity.org/gerrit/12257 Tested-by: jenkins-iotivity Reviewed-by: Jaehong Jo Reviewed-by: Hyuna Jo Reviewed-by: Phil Coval Reviewed-by: Ashok Babu Channa --- diff --git a/resource/csdk/connectivity/src/cainterfacecontroller.c b/resource/csdk/connectivity/src/cainterfacecontroller.c index 8d3c6cd92..311549e4c 100644 --- a/resource/csdk/connectivity/src/cainterfacecontroller.c +++ b/resource/csdk/connectivity/src/cainterfacecontroller.c @@ -134,12 +134,20 @@ static CAResult_t AddNetworkStateChangedCallback(CAAdapterStateChangedCB adapter { OIC_LOG(DEBUG, TAG, "Add NetworkStateChanged Callback"); - if (!adapterCB || !connCB) + if (!adapterCB) { - OIC_LOG(ERROR, TAG, "parameter is null"); + OIC_LOG(ERROR, TAG, "adapterCB is null"); return CA_STATUS_INVALID_PARAM; } +#if defined(TCP_ADAPTER) || defined(EDR_ADAPTER) || defined(LE_ADAPTER) + if (!connCB) + { + OIC_LOG(ERROR, TAG, "connCB is null"); + return CA_STATUS_INVALID_PARAM; + } +#endif + CANetworkCallback_t* callback = NULL; LL_FOREACH(g_networkChangeCallbackList, callback) { @@ -158,7 +166,10 @@ static CAResult_t AddNetworkStateChangedCallback(CAAdapterStateChangedCB adapter } callback->adapter = adapterCB; +#if defined(TCP_ADAPTER) || defined(EDR_ADAPTER) || defined(LE_ADAPTER) + // Since IP adapter(UDP) is the Connectionless Protocol, it doesn't need. callback->conn = connCB; +#endif LL_APPEND(g_networkChangeCallbackList, callback); return CA_STATUS_OK; }