/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @addtogroup HdiHci * @{ * * @brief Provides unified APIs for the HCI service. * * The Host can use the interface provided by the module to initialize the HCI(Host Controller Interface), * and exchange data with the Controller through the service. * * @since 3.2 */ /** * @file IHciInterface.idl * * @brief Defines the interfaces to initialize the HCI, send data to the Controller, * and disable the HCI interface. * * @since 3.2 * @version 1.0 */ package ohos.hdi.bluetooth.hci.v1_0; import ohos.hdi.bluetooth.hci.v1_0.IHciCallback; import ohos.hdi.bluetooth.hci.v1_0.HciTypes; /** * @brief Defines the interfaces to initialize the HCI, send data to the Controller, * and disable the HCI interface. * * @since 3.2 */ interface IHciInterface { /** * @brief Initialize the HCI and register the callback function. * * @param callbackObj Indicates the callback function. For details, see {@link IHciCallback}. * @return Returns 0 if the HCI is initialized successfully; returns a negative value otherwise. * * @since 3.2 * @version 1.0 */ Init([in] IHciCallback callbackObj); /** * @brief Sends data packets to the Controller. * * @param type Indicates the HCI packet type. For details, see {@link BtType}. * @param data Indicates the HCI data packets sent to the Controller. * @return Returns 0 if the HCI data packets is sent successfully; returns a negative value otherwise. * * @since 3.2 * @version 1.0 */ SendHciPacket([in] enum BtType type, [in] unsigned char[] data); /** * @brief Disable the HCI interface. * * @return Returns 0 if the HCI is disabled successfully; returns a negative value otherwise. * * @since 3.2 * @version 1.0 */ Close(); }