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 HdiLpfenceWififence
18 * @{
19 *
20 * @brief Provides Wi-Fi fence APIs for the low-power fence service.
21 *
22 * You can use the APIs provided by this module to add or remove Wi-Fi fences, obtain Wi-Fi fence information of a device, and obtain the relationship between a device and a Wi-Fi fence.
23 * The Wi-Fi fence feature is used to determine whether a device is in a specific indoor location, for example, an area at home or a store in a shopping mall.
24 *
25 * @since 4.0
26 * @version 1.0
27 */
28
29/**
30 * @file IWififenceCallback.idl
31 *
32 * @brief Declares the callbacks for the Wi-Fi fence module.
33 *
34 * @since 4.0
35 * @version 1.0
36 */
37
38/**
39 * @brief Declares the path of the Wi-Fi fence module interface package.
40 *
41 * @since 4.0
42 */
43package ohos.hdi.location.lpfence.wififence.v1_0;
44
45/**
46 * @brief Imports data types of the Wi-Fi fence module.
47 *
48 * @since 4.0
49 */
50import ohos.hdi.location.lpfence.wififence.v1_0.WififenceTypes;
51
52/**
53 * @brief Defines the callback for the Wi-Fi fence module.
54 *
55 * Before enabling the Wi-Fi fence feature, you need to register this callback to report the Wi-Fi fence status when the relationship between a Wi-Fi fence and a device changes.
56 * For details, see {@link ICellfenceInterface}.
57 *
58 * @since 4.0
59 */
60[callback] interface IWififenceCallback {
61    /**
62     * @brief Called when the Wi-Fi fence status changes.
63     *
64     * This callback will be invoked to report the Wi-Fi fence status when the relationship between a device and a Wi-Fi fence changes.
65     *
66     * @param wififenceId Indicates the ID of the Wi-Fi fence.
67     * @param transition Indicates the Wi-Fi fence status. For details, see {@link WififenceTransition}.
68     * @param timestamp Indicates the timestamp.
69     *
70     * @return Returns <b>0</b> if the operation is successful.
71     * @return Returns a negative value if the operation fails.
72     *
73     * @since 4.0
74     */
75    OnWififenceChanged([in] int wififenceId,
76                       [in] int transition,
77                       [in] long timestamp);
78
79    /**
80     * @brief Called to return the Wi-Fi fence information.
81     *
82     *
83     *
84     * @param size Indicates the Wi-Fi fence information obtained. For details, see {@link WififenceSize}.
85     *
86     * @return Returns <b>0</b> if the callback is invoked successfully.
87     * @return Returns a negative value if the callback fails to be invoked.
88     *
89     * @since 4.0
90     */
91    OnGetWififenceSizeCb([in] struct WififenceSize size);
92
93    /**
94     * @brief Called when the low-power fence service is reset.
95     *
96     *
97     *
98     * @return Returns <b>0</b> if the callback is invoked successfully.
99     * @return Returns a negative value if the callback fails to be invoked.
100     *
101     * @since 4.0
102     */
103    OnWififenceReset();
104}
105/** @} */
106