iotivity 0.9.0
[platform/upstream/iotivity.git] / resource / csdk / connectivity / src / bt_edr_adapter / linux / caedradapter.c
1 /******************************************************************
2  *
3  * Copyright 2014 Samsung Electronics All Rights Reserved.
4  *
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ******************************************************************/
20
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <string.h>
24
25 #include "caedradapter.h"
26 #include "logger.h"
27
28 #define TAG PCF("CA")
29
30 static CANetworkPacketReceivedCallback gEDRReceivedCallback = NULL;
31
32 CAResult_t CAInitializeEDR(CARegisterConnectivityCallback registerCallback,
33         CANetworkPacketReceivedCallback reqRespCallback, CANetworkChangeCallback netCallback)
34 {
35     OIC_LOG_V(DEBUG, TAG, "CAInitializeEDR");
36
37     gEDRReceivedCallback = reqRespCallback;
38
39     // register handlers
40     CAConnectivityHandler_t handler;
41     memset(&handler, 0, sizeof(CAConnectivityHandler_t));
42
43     handler.startAdapter = CAStartEDR;
44     handler.startListenServer = CAStartEDRListeningServer;
45     handler.startDiscoverServer = CAStartEDRDiscoveryServer;
46     handler.sendData = CASendEDRUnicastData;
47     handler.sendDataToAll = CASendEDRMulticastData;
48     handler.startNotifyServer = CAStartEDRNotifyServer;
49     handler.sendNotification = CASendEDRNotification;
50     handler.GetnetInfo = CAGetEDRInterfaceInformation;
51     handler.readData = CAReadEDRData;
52     handler.stopAdapter = CAStopEDR;
53     handler.terminate = CATerminateEDR;
54
55     registerCallback(handler, CA_EDR);
56
57     return CA_STATUS_OK;
58 }
59
60 CAResult_t CAStartEDR()
61 {
62     OIC_LOG_V(DEBUG, TAG, "CAStartEDR");
63
64     return CA_STATUS_OK;
65 }
66
67 CAResult_t CAStartEDRListeningServer()
68 {
69     OIC_LOG_V(DEBUG, TAG, "CAStartEDRListeningServer");
70
71     return CA_STATUS_OK;
72 }
73
74 CAResult_t CAStartEDRDiscoveryServer()
75 {
76     OIC_LOG_V(DEBUG, TAG, "CAStartEDRDiscoveryServer");
77
78     return CA_STATUS_OK;
79 }
80
81 uint32_t CASendEDRUnicastData(const CARemoteEndpoint_t* endpoint, void* data, uint32_t dataLen)
82 {
83     OIC_LOG_V(DEBUG, TAG, "CASendEDRUnicastData");
84
85     return 0;
86 }
87
88 uint32_t CASendEDRMulticastData(void* data, uint32_t dataLen)
89 {
90     OIC_LOG_V(DEBUG, TAG, "CASendEDRMulticastData");
91
92     return 0;
93 }
94
95 CAResult_t CAStartEDRNotifyServer()
96 {
97     OIC_LOG_V(DEBUG, TAG, "CAStartEDRNotifyServer");
98
99     return CA_STATUS_OK;
100 }
101
102 uint32_t CASendEDRNotification(const CARemoteEndpoint_t* endpoint, void* data, uint32_t dataLen)
103 {
104     OIC_LOG_V(DEBUG, TAG, "CASendEDRNotification");
105
106     return 0;
107 }
108
109 CAResult_t CAGetEDRInterfaceInformation(CALocalConnectivityt_t** info, uint32_t* size)
110 {
111     OIC_LOG_V(DEBUG, TAG, "CAGetEDRInterfaceInformation");
112
113     return CA_STATUS_OK;
114 }
115
116 CAResult_t CAReadEDRData()
117 {
118     OIC_LOG_V(DEBUG, TAG, "Read EDR Data");
119
120     return CA_STATUS_OK;
121 }
122
123 CAResult_t CAStopEDR()
124 {
125     OIC_LOG_V(DEBUG, TAG, "CAStopEDR");
126
127     return CA_STATUS_OK;
128 }
129
130 void CATerminateEDR()
131 {
132     OIC_LOG_V(DEBUG, TAG, "CATerminateEDR");
133 }