1/* 2 * Copyright (c) 2022 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/** 17 * @addtogroup HdiHci 18 * @{ 19 * 20 * @brief Provides unified APIs for the HCI service. 21 * 22 * The Host can use the interface provided by the module to initialize the HCI(Host Controller Interface), 23 * and exchange data with the Controller through the service. 24 * 25 * @since 3.2 26 */ 27 28/** 29 * @file IHciInterface.idl 30 * 31 * @brief Defines the interfaces to initialize the HCI, send data to the Controller, 32 * and disable the HCI interface. 33 * 34 * @since 3.2 35 * @version 1.0 36 */ 37 38package ohos.hdi.bluetooth.hci.v1_0; 39 40import ohos.hdi.bluetooth.hci.v1_0.IHciCallback; 41import ohos.hdi.bluetooth.hci.v1_0.HciTypes; 42 43/** 44 * @brief Defines the interfaces to initialize the HCI, send data to the Controller, 45 * and disable the HCI interface. 46 * 47 * @since 3.2 48 */ 49interface IHciInterface { 50 /** 51 * @brief Initialize the HCI and register the callback function. 52 * 53 * @param callbackObj Indicates the callback function. For details, see {@link IHciCallback}. 54 * @return Returns <b>0</b> if the HCI is initialized successfully; returns a negative value otherwise. 55 * 56 * @since 3.2 57 * @version 1.0 58 */ 59 Init([in] IHciCallback callbackObj); 60 61 /** 62 * @brief Sends data packets to the Controller. 63 * 64 * @param type Indicates the HCI packet type. For details, see {@link BtType}. 65 * @param data Indicates the HCI data packets sent to the Controller. 66 * @return Returns <b>0</b> if the HCI data packets is sent successfully; returns a negative value otherwise. 67 * 68 * @since 3.2 69 * @version 1.0 70 */ 71 SendHciPacket([in] enum BtType type, [in] unsigned char[] data); 72 73 /** 74 * @brief Disable the HCI interface. 75 * 76 * @return Returns <b>0</b> if the HCI is disabled successfully; returns a negative value otherwise. 77 * 78 * @since 3.2 79 * @version 1.0 80 */ 81 Close(); 82} 83