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 IHciCallback.idl
30 *
31 * @brief Defines the HCI callback function, including the initialization result and data received from the controller.
32 *
33 * @since 3.2
34 * @version 1.0
35 */
36
37package ohos.hdi.bluetooth.hci.v1_0;
38
39import ohos.hdi.bluetooth.hci.v1_0.HciTypes;
40
41/**
42 * @brief Defines the HCI callback function, including the initialization result and data received from the controller.
43 *
44 * @since 3.2
45 */
46[callback] interface IHciCallback {
47    /**
48     * @brief HCI initialization callback function.
49     *
50     * @param status Indicates the HCI initialization result. For details, see {@link BtStatus}.
51     * @return Returns <b>0</b> if the initialization result is returned successfully; returns a negative value otherwise.
52     *
53     * @since 3.2
54     * @version 1.0
55     */
56    OnInited([in] enum BtStatus status);
57
58    /**
59     * @brief Receives data packets sent by the controller..
60     *
61     * @param type Indicates the HCI packet type. For details, see {@link BtType}.
62     * @param data Indicates the HCI data packets received from the Controller.
63     * @return Returns <b>0</b> if the data is received successfully; returns a negative value otherwise.
64     *
65     * @since 3.2
66     * @version 1.0
67     */
68    OnReceivedHciPacket([in] enum BtType type, [in] unsigned char[] data);
69}
70