#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;
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;
}
return CA_STATUS_OK;
}
+CAResult_t CAStopEDRListeningServer()
+{
+ OIC_LOG(DEBUG, TAG, "CAStopEDRListeningServer");
+
+ return CA_STATUS_OK;
+}
+
CAResult_t CAStartEDRDiscoveryServer()
{
OIC_LOG(DEBUG, TAG, "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;
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;
CAResult_t CAGetEDRInterfaceInformation(CAEndpoint_t **info, uint32_t *size)
{
+ (void)info;
+ (void)size;
OIC_LOG(DEBUG, TAG, "CAGetEDRInterfaceInformation");
return CA_STATUS_OK;