1 /*
2 * Copyright (C) 2025 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 #ifndef LOG_TAG
16 #define LOG_TAG "bt_cj_hid_host_ffi"
17 #endif
18
19 #include "bluetooth_hid_host_ffi.h"
20
21 #include "bluetooth_hid_host_impl.h"
22
23 using namespace OHOS::FFI;
24
25 namespace OHOS {
26 namespace Bluetooth {
27 extern "C" {
FfiBluetoothHidHostGetConnectedDevices(int32_t * errCode)28 CArrString FfiBluetoothHidHostGetConnectedDevices(int32_t* errCode)
29 {
30 return BluetoothHidHostImpl::GetConnectionDevices(errCode);
31 }
32
FfiBluetoothHidHostGetConnectionState(char * device,int32_t * errCode)33 int32_t FfiBluetoothHidHostGetConnectionState(char* device, int32_t* errCode)
34 {
35 return BluetoothHidHostImpl::GetConnectionState(device, errCode);
36 }
37
FfiBluetoothHidHostOn(int32_t type,int64_t id,int32_t * errCode)38 void FfiBluetoothHidHostOn(int32_t type, int64_t id, int32_t* errCode)
39 {
40 BluetoothHidHostImpl::On(type, id, errCode);
41 }
42 }
43 } // namespace Bluetooth
44 } // namespace OHOS