1/*
2 * Copyright (c) 2023 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 HdiLpfenceCellbatching
18 * @{
19 *
20 * @brief Provides APIs for recording base station trajectory data for low-power fence services.
21 *
22 * You can use the APIs to cache and flush the base station data received.
23 * The cell batching feature is used to determine the user's activity area based on the base station trajectory data received by the device, so as to further provide service information.
24 *
25 * @since 4.0
26 * @version 1.0
27 */
28
29/**
30 * @file ICellbatchingInterface.idl
31 *
32 * @brief Declares the APIs provided by the cell batching module. You can use the APIs to enable or disable the cell batching feature and obtain the base station trajectory data.
33 *
34 * @since 4.0
35 * @version 1.0
36 */
37
38/**
39 * @brief Declares the path of the cell batching interface package.
40 *
41 * @since 4.0
42 */
43package ohos.hdi.location.lpfence.cellbatching.v1_0;
44
45/**
46 * @brief Imports data types of the cell batching module.
47 *
48 * @since 4.0
49 */
50import ohos.hdi.location.lpfence.cellbatching.v1_0.CellbatchingTypes;
51
52/**
53 * @brief Imports callback definitions of the cell batching module.
54 *
55 * @since 4.0
56 */
57import ohos.hdi.location.lpfence.cellbatching.v1_0.ICellbatchingCallback;
58
59/**
60 * @brief Defines APIs for basic cell batching operations.
61 *
62 * You can use the APIs to register or unregister a callback, enable or disable the cell batching feature, and obtain the base station trajectory data.
63 */
64interface ICellbatchingInterface {
65    /**
66     * @brief Registers a callback.
67     *
68     * Before enabling the cell batching feature, you need to register a callback to report the base station trajectory data obtained by an app.
69     *
70     * @param callbackObj Indicates the callback to register, which needs to be registered only once. For details, see {@link ICellbatchingCallback}.
71     *
72     * @return Returns <b>0</b> if the operation is successful.
73     * @return Returns a negative value if the operation fails.
74     *
75     * @since 4.0
76     * @version 1.0
77     */
78    RegisterCellBatchingCallback([in] ICellbatchingCallback callbackObj);
79
80    /**
81     * @brief Unregisters a callback.
82     *
83     * When the cell batching feature is no longer required or the registered callback needs to be changed, you need to unregister the callback.
84     *
85     * @param callbackObj Indicates the callback to unregister, which needs to be unregistered only once. For details, see {@link ICellbatchingCallback}.
86     *
87     * @return Returns <b>0</b> if the operation is successful.
88     * @return Returns a negative value if the operation fails.
89     *
90     * @since 4.0
91     * @version 1.0
92     */
93    UnregisterCellBatchingCallback([in] ICellbatchingCallback callbackObj);
94
95    /**
96     * @brief Enables or disables the cell batching feature.
97     *
98     * After the cell batching feature is enabled, the device caches the base station data received. If the data received is the same as the data previously received, the device does not cache the data.
99     *
100     * @param req Indicates the parameters used for setting the cell batching feature. For details, see {@link CellbatchingRequest}.
101     *
102     * @return Returns <b>0</b> if the operation is successful.
103     * @return Returns a negative value if the operation fails.
104     *
105     * @since 4.0
106     * @version 1.0
107     */
108    CellbatchingSwitch([in] struct CellbatchingRequest req);
109
110    /**
111     * @brief Flushes the base station trajectory data.
112     *
113     * The amount of data flushed varies depending on the buffer size of the device and the amount of base station data received by the device. After the data is flushed, the cached base station data will be cleared.
114     *
115     * @return Returns <b>0</b> if the operation is successful.
116     * @return Returns a negative value if the operation fails.
117     *
118     * @since 4.0
119     * @version 1.0
120     */
121    FlushCellbatching();
122}
123/** @} */
124