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/**
17 * @addtogroup HdiBluetoothLpBle
18 * @{
19 *
20 * @brief Provides APIs for the low power BLE service.
21 *
22 * @since 5.0
23 * @version 1.0
24 */
25
26/**
27 * @file IBleCallback.idl
28 *
29 * @brief Declares the callbacks for the low power BLE module.
30 *
31 * @since 5.0
32 * @version 1.0
33 */
34
35/**
36 * @brief Declares the path of the low power BLE module interface package.
37 *
38 * @since 5.0
39 */
40package ohos.hdi.bluetooth.lp_ble.v1_0;
41
42/**
43 * @brief Defines the message callback for the low power BLE module.
44 *
45 * @since 5.0
46 */
47import ohos.hdi.bluetooth.lp_ble.v1_0.IBleCallback;
48
49/**
50 * @brief Defines the device callback for the low power BLE module.
51 *
52 * @since 5.0
53 */
54import ohos.hdi.bluetooth.lp_ble.v1_0.IDeviceCallback;
55
56/**
57 * @brief Defines the wakeup message callback for the low power BLE module.
58 *
59 * @since 5.0
60 */
61import ohos.hdi.bluetooth.lp_ble.v1_0.IWakeupCallback;
62
63interface IBleInterface {
64    /**
65     * @brief Send Ble parameters to controller.
66     *
67     * @param buff Indicates data send to controller.
68     *
69     * @return Returns <b>0</b> if the operation is successful.
70     * @return Returns a negative value if the operation fails.
71     *
72     * @since 5.0
73     * @version 1.0
74     */
75    SetBleParameters([in] unsigned char[] buff);
76
77    /**
78     * @brief Registers Ble data report callback.
79     * Provide the callback routines to the hal.
80     * The cmd is used to determine whether to obtain messages or the device list.
81     *
82     * @param callbackObj Indicates the callback to register, which needs to be registered only once.
83     * @param cmd Indicates message or device list.
84     *
85     * @return Returns <b>0</b> if the operation is successful.
86     * @return Returns a negative value if the operation fails.
87     *
88     * @since 5.0
89     * @version 1.0
90     */
91    GetBleBroadCastMessage([in] IBleCallback callbackObj, [in] int cmd);
92
93    /**
94     * @brief Obtains Ble capability from controller.
95     *
96     * @return Returns ability.
97     *
98     * @since 5.0
99     * @version 1.0
100     */
101    GetBleCapability();
102
103    /**
104     * @brief Registers callback to notify hal controller has reset.
105     *
106     * @param callbackObj Indicates handle to the IDeviceCallback.
107     *
108     * @return Returns <b>0</b> if the operation is successful.
109     * @return Returns a negative value if the operation fails.
110     *
111     * @since 5.0
112     * @version 1.0
113     */
114    RegisterDeviceResetCallback([in] IDeviceCallback callbackObj);
115
116    /**
117     * @brief Registers callback to wakeup framework and send Message.
118     *
119     * @param callbackObj Indicates handle to the IWakeupCallback.
120     * @param cmd Indicates event.
121     *
122     * @return Returns <b>0</b> if the operation is successful.
123     * @return Returns a negative value if the operation fails.
124     *
125     * @since 5.0
126     * @version 1.0
127     */
128    RegisterWakeupCallback([in] IWakeupCallback callbackObj, [in] int cmd);
129
130    /*
131     * @brief Registers callback to report error code.
132     *
133     * @param callbackObj handle to the IBleCallback
134     * @return ret 0 on success, others on failure
135     *
136     * @since 5.0
137     * @version 1.0
138     */
139    RegisterErrorCodeCallback([in] IBleCallback callbackObj);
140}
141