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 <bluetooth_internal.h>
25 #include "camanagerleinterface.h"
27 #include "camessagehandler.h"
28 #include "caleserver.h"
29 #include "cagattservice.h"
32 #define TAG "OIC_CA_MANAGER_TZ_LE"
34 void CASetLENetworkMonitorCallbacks(CAAdapterStateChangedCB adapterStateCB,
35 CAConnectionStateChangedCB connStateCB)
39 OIC_LOG(DEBUG, TAG, "CASetLENetworkMonitorCallbacks");
42 CAResult_t CAManagerLEStartAdvertising()
44 OIC_LOG(DEBUG, TAG, "CAManagerLEStartAdvertising");
46 CAResult_t res = CALEStartAdvertise();
47 if (CA_STATUS_OK != res)
49 OIC_LOG_V(ERROR, TAG, "Failed to start le advertising [%d]", res);
55 CAResult_t CAManagerLEStopAdvertising()
57 OIC_LOG(DEBUG, TAG, "CAManagerLEStopAdvertising");
59 CAResult_t res = CALEStopAdvertise();
60 if (CA_STATUS_OK != res)
62 OIC_LOG_V(ERROR, TAG, "Failed to stop le advertising [%d]", res);
68 CAResult_t CASetLEClientAutoConnectionDeviceInfo(const char * address)
70 OIC_LOG(DEBUG, TAG, "CASetLEClientAutoConnectionDeviceInfo");
72 return CA_NOT_SUPPORTED;
75 CAResult_t CAUnsetLEClientAutoConnectionDeviceInfo(const char * address)
77 OIC_LOG(DEBUG, TAG, "CAUnsetLEClientAutoConnectionDeviceInfo");
79 return CA_NOT_SUPPORTED;
81 #if defined(__TIZEN__) && defined(LE_ADAPTER) && defined(BLE_CUSTOM_ADVERTISE)
82 CAResult_t CAManagerLEServerSetAdvertisementData(const char *data, int length)
85 CAResult_t res = CAsetServerAdvertisementData(data, length);
87 if (CA_STATUS_OK != res)
89 OIC_LOG_V(ERROR, TAG, "Failed to stop le CAManagerLEServerSetAdvertisementData [%d]", res);
94 CAResult_t CAManagerLEServerSetScanResponseData(const char *data, int length)
97 CAResult_t res = CAsetServerSanResponseData(data, length);
99 if (CA_STATUS_OK != res)
101 OIC_LOG_V(ERROR, TAG, "Failed to stop le CAsetServerSanResponseData [%d]", res);