1 /* ****************************************************************
3 * Copyright 2016 Samsung Electronics All Rights Reserved.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 ******************************************************************/
21 #include <bluetooth.h>
22 #include <bluetooth_type.h>
23 #include "camanagerleinterface.h"
25 #include "camessagehandler.h"
26 #include "caleserver.h"
27 #include "cagattservice.h"
30 #define TAG "OIC_CA_MANAGER_TZ_LE"
32 void CASetLENetworkMonitorCallbacks(CAAdapterStateChangedCB adapterStateCB,
33 CAConnectionStateChangedCB connStateCB)
37 OIC_LOG(DEBUG, TAG, "CASetLENetworkMonitorCallbacks");
40 CAResult_t CAManagerLEStartAdvertising()
42 OIC_LOG(DEBUG, TAG, "CAManagerLEStartAdvertising");
44 CAResult_t res = CALEStartAdvertise();
45 if (CA_STATUS_OK != res)
47 OIC_LOG_V(ERROR, TAG, "Failed to start le advertising [%d]", res);
53 CAResult_t CAManagerLEStopAdvertising()
55 OIC_LOG(DEBUG, TAG, "CAManagerLEStopAdvertising");
57 CAResult_t res = CALEStopAdvertise();
58 if (CA_STATUS_OK != res)
60 OIC_LOG_V(ERROR, TAG, "Failed to stop le advertising [%d]", res);
66 CAResult_t CASetLEClientAutoConnectionDeviceInfo(const char * address)
68 OIC_LOG(DEBUG, TAG, "CASetLEClientAutoConnectionDeviceInfo");
70 return CA_NOT_SUPPORTED;
73 CAResult_t CAUnsetLEClientAutoConnectionDeviceInfo(const char * address)
75 OIC_LOG(DEBUG, TAG, "CAUnsetLEClientAutoConnectionDeviceInfo");
77 return CA_NOT_SUPPORTED;
79 #if defined(__TIZEN__) && defined(LE_ADAPTER) && defined(BLE_CUSTOM_ADVERTISE)
80 CAResult_t CAManagerLEServerSetAdvertisementData(const char *data, int length)
83 CAResult_t res = CAsetServerAdvertisementData(data, length);
85 if (CA_STATUS_OK != res)
87 OIC_LOG_V(ERROR, TAG, "Failed to stop le CAManagerLEServerSetAdvertisementData [%d]", res);
92 void CAManagerLEServerSetAdvertisementDataGetter(CAAdvertisementDataGetterCB getter)
94 return CAsetServerAdvertisementDataGetter(getter);
97 void CAManagerLEServerSetAutoAdvertisement(bool autoAdvertisement)
99 return CAsetServerAutoAdvertisement(autoAdvertisement);
102 CAResult_t CAManagerLEServerSetScanResponseData(const char *data, int length)
105 CAResult_t res = CAsetServerScanResponseData(data, length);
107 if (CA_STATUS_OK != res)
109 OIC_LOG_V(ERROR, TAG, "Failed to stop le CAsetServerSanResponseData [%d]", res);