Imported Upstream version 1.1.0
[platform/upstream/iotivity.git] / resource / csdk / connectivity / src / bt_edr_adapter / linux / caedradapter.c
index 408c164..4863861 100644 (file)
@@ -25,7 +25,7 @@
 #include "caedradapter.h"
 #include "logger.h"
 
-#define TAG PCF("CA")
+#define TAG PCF("OIC_CA")
 
 static CANetworkPacketReceivedCallback g_edrReceivedCallback = NULL;
 static ca_thread_pool_t g_threadPoolHandle = NULL;
@@ -35,25 +35,29 @@ CAResult_t CAInitializeEDR(CARegisterConnectivityCallback registerCallback,
                            CANetworkChangeCallback networkStateChangeCallback,
                            CAErrorHandleCallback errorCallback, ca_thread_pool_t handle)
 {
+    (void)networkStateChangeCallback;
+    (void)errorCallback;
     OIC_LOG(DEBUG, TAG, "CAInitializeEDR");
 
     g_edrReceivedCallback = reqRespCallback;
     g_threadPoolHandle = handle;
 
     // register handlers
-    CAConnectivityHandler_t handler = {};
-
-    handler.startAdapter = CAStartEDR;
-    handler.startListenServer = CAStartEDRListeningServer;
-    handler.startDiscoveryServer = CAStartEDRDiscoveryServer;
-    handler.sendData = CASendEDRUnicastData;
-    handler.sendDataToAll = CASendEDRMulticastData;
-    handler.GetnetInfo = CAGetEDRInterfaceInformation;
-    handler.readData = CAReadEDRData;
-    handler.stopAdapter = CAStopEDR;
-    handler.terminate = CATerminateEDR;
-
-    registerCallback(handler, CA_ADAPTER_RFCOMM_BTEDR);
+    CAConnectivityHandler_t handler = {
+        .startAdapter = CAStartEDR,
+        .startListenServer = CAStartEDRListeningServer,
+        .stopListenServer = CAStopEDRListeningServer,
+        .startDiscoveryServer = CAStartEDRDiscoveryServer,
+        .sendData = CASendEDRUnicastData,
+        .sendDataToAll = CASendEDRMulticastData,
+        .GetnetInfo = CAGetEDRInterfaceInformation,
+        .readData = CAReadEDRData,
+        .stopAdapter = CAStopEDR,
+        .terminate = CATerminateEDR,
+        .cType = CA_ADAPTER_RFCOMM_BTEDR
+    };
+
+    registerCallback(handler);
 
     return CA_STATUS_OK;
 }
@@ -72,6 +76,13 @@ CAResult_t CAStartEDRListeningServer()
     return CA_STATUS_OK;
 }
 
+CAResult_t CAStopEDRListeningServer()
+{
+    OIC_LOG(DEBUG, TAG, "CAStopEDRListeningServer");
+
+    return CA_STATUS_OK;
+}
+
 CAResult_t CAStartEDRDiscoveryServer()
 {
     OIC_LOG(DEBUG, TAG, "CAStartEDRDiscoveryServer");
@@ -82,6 +93,9 @@ CAResult_t CAStartEDRDiscoveryServer()
 int32_t CASendEDRUnicastData(const CAEndpoint_t *endpoint, const void *data,
     uint32_t dataLen)
 {
+    (void)endpoint;
+    (void)data;
+    (void)dataLen;
     OIC_LOG(DEBUG, TAG, "CASendEDRUnicastData");
 
     return -1;
@@ -89,6 +103,9 @@ int32_t CASendEDRUnicastData(const CAEndpoint_t *endpoint, const void *data,
 
 int32_t CASendEDRMulticastData(const CAEndpoint_t *endpoint, const void *data, uint32_t dataLen)
 {
+    (void)endpoint;
+    (void)data;
+    (void)dataLen;
     OIC_LOG(DEBUG, TAG, "CASendEDRMulticastData");
 
     return -1;
@@ -96,6 +113,8 @@ int32_t CASendEDRMulticastData(const CAEndpoint_t *endpoint, const void *data, u
 
 CAResult_t CAGetEDRInterfaceInformation(CAEndpoint_t **info, uint32_t *size)
 {
+    (void)info;
+    (void)size;
     OIC_LOG(DEBUG, TAG, "CAGetEDRInterfaceInformation");
 
     return CA_STATUS_OK;