1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License")
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "bluetooth_access_ffi.h"
17 #include "bluetooth_access_impl.h"
18 #include "bluetooth_log.h"
19 
20 using namespace OHOS::FFI;
21 
22 namespace OHOS {
23 namespace CJSystemapi {
24 namespace CJBluetoothAccess {
25 
26 extern "C" {
FfiBluetoothAccEnableBluetooth(int32_t* errCode)27 void FfiBluetoothAccEnableBluetooth(int32_t* errCode)
28 {
29     return AccessImpl::EnableBluetooth(errCode);
30 }
31 
FfiBluetoothAccDisableBluetooth(int32_t* errCode)32 void FfiBluetoothAccDisableBluetooth(int32_t* errCode)
33 {
34     return AccessImpl::DisableBluetooth(errCode);
35 }
36 
FfiBluetoothAccGetState(int32_t* errCode)37 int32_t FfiBluetoothAccGetState(int32_t* errCode)
38 {
39     return AccessImpl::GetState(errCode);
40 }
41 
FfiBluetoothAccOn(int32_t callbackType, void (*callback)(), int32_t* errCode)42 void FfiBluetoothAccOn(int32_t callbackType, void (*callback)(), int32_t* errCode)
43 {
44     return AccessImpl::RegisterAccessObserver(callbackType, callback, errCode);
45 }
46 }
47 } // namespace BluetoothAccess
48 } // namespace CJSystemapi
49 } // namespace OHOS