From ff0ff2b71310a7144f946894366502edde46f0ee Mon Sep 17 00:00:00 2001 From: "vimala.v" Date: Thu, 9 Jul 2015 14:09:46 +0530 Subject: [PATCH] Resolved compilation issues of BLE adapter in Tizen and Arduino Change-Id: If9c4d1ade926733a3959808e9b3cfc6880e91cb3 Signed-off-by: vimala.v Reviewed-on: https://gerrit.iotivity.org/gerrit/1594 Tested-by: jenkins-iotivity Reviewed-by: Erich Keane --- .../connectivity/src/bt_le_adapter/caleadapter.c | 22 +++++++------- .../src/bt_le_adapter/tizen/cableclient.c | 14 ++++----- .../src/bt_le_adapter/tizen/cableserver.c | 12 ++++---- .../src/bt_le_adapter/tizen/cableutil.c | 34 +++++++++++----------- 4 files changed, 41 insertions(+), 41 deletions(-) diff --git a/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c b/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c index 37f14ba..4fc3299 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c @@ -1111,7 +1111,7 @@ CALEData_t *CACreateLEData(const CAEndpoint_t *remoteEndpoint, const void *data, void CAFreeLEData(CALEData_t *bleData) { - VERIFY_NON_NULL_VOID(bleData, NULL, "Param bleData is NULL"); + VERIFY_NON_NULL_VOID(bleData, CALEADAPTER_TAG, "Param bleData is NULL"); CAFreeEndpoint(bleData->remoteEndpoint); OICFree(bleData->data); @@ -1266,9 +1266,9 @@ CAResult_t CAInitializeLE(CARegisterConnectivityCallback registerCallback, OIC_LOG(DEBUG, CALEADAPTER_TAG, "IN"); //Input validation - VERIFY_NON_NULL(registerCallback, NULL, "RegisterConnectivity callback is null"); - VERIFY_NON_NULL(reqRespCallback, NULL, "PacketReceived Callback is null"); - VERIFY_NON_NULL(netCallback, NULL, "NetworkChange Callback is null"); + VERIFY_NON_NULL(registerCallback, CALEADAPTER_TAG, "RegisterConnectivity callback is null"); + VERIFY_NON_NULL(reqRespCallback, CALEADAPTER_TAG, "PacketReceived Callback is null"); + VERIFY_NON_NULL(netCallback, CALEADAPTER_TAG, "NetworkChange Callback is null"); CAResult_t result = CA_STATUS_OK; result = CAInitLEAdapterMutex(); @@ -1481,8 +1481,8 @@ int32_t CASendLEUnicastData(const CAEndpoint_t *endpoint, const void *data, uint OIC_LOG(DEBUG, CALEADAPTER_TAG, "IN"); //Input validation - VERIFY_NON_NULL_RET(endpoint, NULL, "Remote endpoint is null", -1); - VERIFY_NON_NULL_RET(data, NULL, "Data is null", -1); + VERIFY_NON_NULL_RET(endpoint, CALEADAPTER_TAG, "Remote endpoint is null", -1); + VERIFY_NON_NULL_RET(data, CALEADAPTER_TAG, "Data is null", -1); CAResult_t result = CA_STATUS_FAILED; @@ -1526,7 +1526,7 @@ int32_t CASendLEMulticastData(const CAEndpoint_t *endpoint, const void *data, ui OIC_LOG(DEBUG, CALEADAPTER_TAG, "IN"); //Input validation - VERIFY_NON_NULL_RET(data, NULL, "Data is null", -1); + VERIFY_NON_NULL_RET(data, CALEADAPTER_TAG, "Data is null", -1); if (0 >= dataLen) { @@ -1576,7 +1576,7 @@ CAResult_t CAGetLEInterfaceInformation(CAEndpoint_t **info, uint32_t *size) { OIC_LOG(DEBUG, CALEADAPTER_TAG, "IN"); - VERIFY_NON_NULL(info, NULL, "CALocalConnectivity info is null"); + VERIFY_NON_NULL(info, CALEADAPTER_TAG, "CALocalConnectivity info is null"); char *local_address = NULL; @@ -1659,7 +1659,7 @@ void CALEDeviceStateChangedCb( CAAdapterState_t adapter_state) { OIC_LOG(DEBUG, CALEADAPTER_TAG, "IN"); - VERIFY_NON_NULL_VOID(g_localBLEAddress, NULL, "g_localBLEAddress is null"); + VERIFY_NON_NULL_VOID(g_localBLEAddress, CALEADAPTER_TAG, "g_localBLEAddress is null"); CAEndpoint_t localEndpoint = {}; ca_mutex_lock(g_bleLocalAddressMutex); @@ -1700,7 +1700,7 @@ CAResult_t CALEAdapterClientSendData(const CAEndpoint_t *remoteEndpoint, { OIC_LOG(DEBUG, CALEADAPTER_TAG, "IN"); - VERIFY_NON_NULL(data, NULL, "Param data is NULL"); + VERIFY_NON_NULL(data, CALEADAPTER_TAG, "Param data is NULL"); #ifndef SINGLE_THREAD VERIFY_NON_NULL_RET(g_bleClientSendQueueHandle, CALEADAPTER_TAG, "g_bleClientSendQueueHandle is NULL", @@ -1736,7 +1736,7 @@ CAResult_t CALEAdapterServerSendData(const CAEndpoint_t *remoteEndpoint, { OIC_LOG(DEBUG, CALEADAPTER_TAG, "IN"); - VERIFY_NON_NULL(data, NULL, "Param data is NULL"); + VERIFY_NON_NULL(data, CALEADAPTER_TAG, "Param data is NULL"); #ifdef SINGLE_THREAD char header[CA_HEADER_LENGTH] = {0}; diff --git a/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableclient.c b/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableclient.c index be9cd39..9bb3e70 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableclient.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableclient.c @@ -1250,9 +1250,9 @@ CAResult_t CABleGattDiscoverCharacteristics(bt_gatt_attribute_h service, { OIC_LOG(DEBUG, TZ_BLE_CLIENT_TAG, "IN"); - VERIFY_NON_NULL_RET(service, NULL, "service is NULL", CA_STATUS_FAILED); + VERIFY_NON_NULL_RET(service, TZ_BLE_CLIENT_TAG, "service is NULL", CA_STATUS_FAILED); - VERIFY_NON_NULL_RET(remoteAddress, NULL, "remoteAddress is NULL", CA_STATUS_FAILED); + VERIFY_NON_NULL_RET(remoteAddress, TZ_BLE_CLIENT_TAG, "remoteAddress is NULL", CA_STATUS_FAILED); char *addr = OICStrdup(remoteAddress); VERIFY_NON_NULL_RET(addr, TZ_BLE_CLIENT_TAG, "Malloc failed", CA_STATUS_FAILED); @@ -1301,7 +1301,7 @@ CAResult_t CABleGattDiscoverDescriptor(bt_gatt_attribute_h service, const char * { OIC_LOG(DEBUG, TZ_BLE_CLIENT_TAG, "IN"); - VERIFY_NON_NULL_RET(service, NULL, "service is NULL", CA_STATUS_FAILED); + VERIFY_NON_NULL_RET(service, TZ_BLE_CLIENT_TAG, "service is NULL", CA_STATUS_FAILED); int ret = bt_gatt_discover_characteristic_descriptor(service, CABleGattDescriptorDiscoveredCb, NULL); @@ -1393,7 +1393,7 @@ CAResult_t CAUpdateCharacteristicsToGattServer(const char *remoteAddress, { OIC_LOG(DEBUG, TZ_BLE_CLIENT_TAG, "IN"); - VERIFY_NON_NULL(data, NULL, "data is NULL"); + VERIFY_NON_NULL(data, TZ_BLE_CLIENT_TAG, "data is NULL"); if (0 >= dataLen) { @@ -1408,7 +1408,7 @@ CAResult_t CAUpdateCharacteristicsToGattServer(const char *remoteAddress, ca_mutex_lock(g_bleServiceListMutex); if ( LE_UNICAST == type) { - VERIFY_NON_NULL(remoteAddress, NULL, "remoteAddress is NULL"); + VERIFY_NON_NULL(remoteAddress, TZ_BLE_CLIENT_TAG, "remoteAddress is NULL"); ret = CAGetBLEServiceInfo(g_bLEServiceList, remoteAddress, &bleServiceInfo); } @@ -1424,7 +1424,7 @@ CAResult_t CAUpdateCharacteristicsToGattServer(const char *remoteAddress, return CA_STATUS_FAILED; } - VERIFY_NON_NULL(bleServiceInfo, NULL, "bleServiceInfo is NULL"); + VERIFY_NON_NULL(bleServiceInfo, TZ_BLE_CLIENT_TAG, "bleServiceInfo is NULL"); OIC_LOG_V(DEBUG, TZ_BLE_CLIENT_TAG, "Updating the data of length [%d] to [%s] ", dataLen, bleServiceInfo->bdAddress); @@ -1455,7 +1455,7 @@ CAResult_t CAUpdateCharacteristicsToAllGattServers(const char *data, { OIC_LOG(DEBUG, TZ_BLE_CLIENT_TAG, "IN"); - VERIFY_NON_NULL(data, NULL, "data is NULL"); + VERIFY_NON_NULL(data, TZ_BLE_CLIENT_TAG, "data is NULL"); if (0 >= dataLen) { diff --git a/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableserver.c b/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableserver.c index 9bcb6dc..98e709c 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableserver.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableserver.c @@ -509,7 +509,7 @@ CAResult_t CAAddNewBleServiceInGattServer(const char *serviceUUID) { OIC_LOG(DEBUG, TZ_BLE_SERVER_TAG, "IN"); - VERIFY_NON_NULL(serviceUUID, NULL, "Param serviceUUID is NULL"); + VERIFY_NON_NULL(serviceUUID, TZ_BLE_SERVER_TAG, "Param serviceUUID is NULL"); OIC_LOG_V(DEBUG, TZ_BLE_SERVER_TAG, "service uuid %s", serviceUUID); @@ -547,7 +547,7 @@ CAResult_t CARemoveBleServiceFromGattServer(const char *svcPath) { OIC_LOG(DEBUG, TZ_BLE_SERVER_TAG, "IN"); - VERIFY_NON_NULL(svcPath, NULL, "Param svcPath is NULL"); + VERIFY_NON_NULL(svcPath, TZ_BLE_SERVER_TAG, "Param svcPath is NULL"); int ret = bt_gatt_remove_service(svcPath); @@ -623,7 +623,7 @@ CAResult_t CARegisterBleServicewithGattServer(const char *svcPath) { OIC_LOG(DEBUG, TZ_BLE_SERVER_TAG, "IN"); - VERIFY_NON_NULL(svcPath, NULL, "Param svcPath is NULL"); + VERIFY_NON_NULL(svcPath, TZ_BLE_SERVER_TAG, "Param svcPath is NULL"); OIC_LOG_V(DEBUG, TZ_BLE_SERVER_TAG, "svcPath:%s", svcPath); @@ -710,9 +710,9 @@ CAResult_t CAUpdateCharacteristicsToGattClient(const char* address, const char * { OIC_LOG(DEBUG, TZ_BLE_SERVER_TAG, "IN"); - VERIFY_NON_NULL(charValue, NULL, "Param charValue is NULL"); + VERIFY_NON_NULL(charValue, TZ_BLE_SERVER_TAG, "Param charValue is NULL"); - VERIFY_NON_NULL(address, NULL, "Param address is NULL"); + VERIFY_NON_NULL(address, TZ_BLE_SERVER_TAG, "Param address is NULL"); OIC_LOG_V(DEBUG, TZ_BLE_SERVER_TAG, "Client's Unicast address for sending data [%s]", address); @@ -759,7 +759,7 @@ CAResult_t CAUpdateCharacteristicsToAllGattClients(const char *charValue, uint32 { OIC_LOG(DEBUG, TZ_BLE_SERVER_TAG, "IN"); - VERIFY_NON_NULL(charValue, NULL, "Param charValue is NULL"); + VERIFY_NON_NULL(charValue, TZ_BLE_SERVER_TAG, "Param charValue is NULL"); ca_mutex_lock(g_bleCharacteristicMutex); diff --git a/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableutil.c b/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableutil.c index b03cf17..1f8da50 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableutil.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/tizen/cableutil.c @@ -70,9 +70,9 @@ CAResult_t CACreateBLEServiceInfo(const char *bdAddress, bt_gatt_attribute_h ser { OIC_LOG(DEBUG, TZ_BLE_CLIENT_UTIL_TAG, "IN"); - VERIFY_NON_NULL(bdAddress, NULL, "Param bdAddress is NULL"); - VERIFY_NON_NULL(service, NULL, "Param service is NULL"); - VERIFY_NON_NULL(bleServiceInfo, NULL, "Param bleServiceInfo is NULL"); + VERIFY_NON_NULL(bdAddress, TZ_BLE_CLIENT_UTIL_TAG, "Param bdAddress is NULL"); + VERIFY_NON_NULL(service, TZ_BLE_CLIENT_UTIL_TAG, "Param service is NULL"); + VERIFY_NON_NULL(bleServiceInfo, TZ_BLE_CLIENT_UTIL_TAG, "Param bleServiceInfo is NULL"); *bleServiceInfo = (BLEServiceInfo *) OICCalloc(1, sizeof(BLEServiceInfo)); if (NULL == *bleServiceInfo) @@ -114,8 +114,8 @@ CAResult_t CAAppendBLECharInfo( bt_gatt_attribute_h characteristic, CHAR_TYPE ty { OIC_LOG(DEBUG, TZ_BLE_CLIENT_UTIL_TAG, "IN"); - VERIFY_NON_NULL(characteristic, NULL, "Param characteristic is NULL"); - VERIFY_NON_NULL(bleServiceInfo, NULL, "Param bleServiceInfo is NULL"); + VERIFY_NON_NULL(characteristic, TZ_BLE_CLIENT_UTIL_TAG, "Param characteristic is NULL"); + VERIFY_NON_NULL(bleServiceInfo, TZ_BLE_CLIENT_UTIL_TAG, "Param bleServiceInfo is NULL"); if (BLE_GATT_READ_CHAR == type ) { @@ -151,8 +151,8 @@ CAResult_t CAAddBLEServiceInfoToList(BLEServiceList **serviceList, OIC_LOG(DEBUG, TZ_BLE_CLIENT_UTIL_TAG, "IN"); - VERIFY_NON_NULL(serviceList, NULL, "Param serviceList is NULL"); - VERIFY_NON_NULL(bleServiceInfo, NULL, "Param bleServiceInfo is NULL"); + VERIFY_NON_NULL(serviceList, TZ_BLE_CLIENT_UTIL_TAG, "Param serviceList is NULL"); + VERIFY_NON_NULL(bleServiceInfo, TZ_BLE_CLIENT_UTIL_TAG, "Param bleServiceInfo is NULL"); BLEServiceList *node = (BLEServiceList *) OICCalloc(1, sizeof(BLEServiceList)); if (NULL == node) @@ -191,9 +191,9 @@ CAResult_t CARemoveBLEServiceInfoToList(BLEServiceList **serviceList, OIC_LOG(DEBUG, TZ_BLE_CLIENT_UTIL_TAG, "IN"); - VERIFY_NON_NULL(serviceList, NULL, "Param serviceList is NULL"); - VERIFY_NON_NULL(*serviceList, NULL, "Param *serviceList is NULL"); - VERIFY_NON_NULL(bdAddress, NULL, "Param bdAddress is NULL"); + VERIFY_NON_NULL(serviceList, TZ_BLE_CLIENT_UTIL_TAG, "Param serviceList is NULL"); + VERIFY_NON_NULL(*serviceList, TZ_BLE_CLIENT_UTIL_TAG, "Param *serviceList is NULL"); + VERIFY_NON_NULL(bdAddress, TZ_BLE_CLIENT_UTIL_TAG, "Param bdAddress is NULL"); BLEServiceList *prev = NULL; BLEServiceList *cur = *serviceList; @@ -238,9 +238,9 @@ CAResult_t CAGetBLEServiceInfo(BLEServiceList *serviceList, const char *bdAddres OIC_LOG(DEBUG, TZ_BLE_CLIENT_UTIL_TAG, "IN"); - VERIFY_NON_NULL(serviceList, NULL, "Param serviceList is NULL"); - VERIFY_NON_NULL(bleServiceInfo, NULL, "Param bleServiceInfo is NULL"); - VERIFY_NON_NULL(bdAddress, NULL, "Param bdAddress is NULL"); + VERIFY_NON_NULL(serviceList, TZ_BLE_CLIENT_UTIL_TAG, "Param serviceList is NULL"); + VERIFY_NON_NULL(bleServiceInfo, TZ_BLE_CLIENT_UTIL_TAG, "Param bleServiceInfo is NULL"); + VERIFY_NON_NULL(bdAddress, TZ_BLE_CLIENT_UTIL_TAG, "Param bdAddress is NULL"); BLEServiceList *cur = serviceList; @@ -266,8 +266,8 @@ CAResult_t CAGetBLEServiceInfoByPosition(BLEServiceList *serviceList, int32_t po { OIC_LOG(DEBUG, TZ_BLE_CLIENT_UTIL_TAG, "IN"); - VERIFY_NON_NULL(serviceList, NULL, "Param serviceList is NULL"); - VERIFY_NON_NULL(bleServiceInfo, NULL, "Param bleServiceInfo is NULL"); + VERIFY_NON_NULL(serviceList, TZ_BLE_CLIENT_UTIL_TAG, "Param serviceList is NULL"); + VERIFY_NON_NULL(bleServiceInfo, TZ_BLE_CLIENT_UTIL_TAG, "Param bleServiceInfo is NULL"); if (0 > position) { @@ -327,7 +327,7 @@ CAResult_t CAVerifyOICServiceByUUID(const char* serviceUUID) { OIC_LOG(DEBUG, TZ_BLE_CLIENT_UTIL_TAG, "IN"); - VERIFY_NON_NULL(serviceUUID, NULL, "Param serviceHandle is NULL"); + VERIFY_NON_NULL(serviceUUID, TZ_BLE_CLIENT_UTIL_TAG, "Param serviceHandle is NULL"); if (strcasecmp(serviceUUID, OIC_BLE_SERVICE_ID) != 0) { @@ -342,7 +342,7 @@ CAResult_t CAVerifyOICServiceByServiceHandle(bt_gatt_attribute_h serviceHandle) { OIC_LOG(DEBUG, TZ_BLE_CLIENT_UTIL_TAG, "IN"); - VERIFY_NON_NULL(serviceHandle, NULL, "Param serviceHandle is NULL"); + VERIFY_NON_NULL(serviceHandle, TZ_BLE_CLIENT_UTIL_TAG, "Param serviceHandle is NULL"); char *uuid = NULL; int ret = bt_gatt_get_service_uuid(serviceHandle, &uuid); -- 2.7.4