1c5e268c6Sopenharmony_ci/* 2c5e268c6Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 3c5e268c6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4c5e268c6Sopenharmony_ci * you may not use this file except in compliance with the License. 5c5e268c6Sopenharmony_ci * You may obtain a copy of the License at 6c5e268c6Sopenharmony_ci * 7c5e268c6Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8c5e268c6Sopenharmony_ci * 9c5e268c6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10c5e268c6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11c5e268c6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12c5e268c6Sopenharmony_ci * See the License for the specific language governing permissions and 13c5e268c6Sopenharmony_ci * limitations under the License. 14c5e268c6Sopenharmony_ci */ 15c5e268c6Sopenharmony_ci 16c5e268c6Sopenharmony_ci /** 17c5e268c6Sopenharmony_ci * @addtogroup HdiLpfenceWififence 18c5e268c6Sopenharmony_ci * @{ 19c5e268c6Sopenharmony_ci * 20c5e268c6Sopenharmony_ci * @brief Provides Wi-Fi fence APIs for the low-power fence service. 21c5e268c6Sopenharmony_ci * 22c5e268c6Sopenharmony_ci * 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. 23c5e268c6Sopenharmony_ci * 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. 24c5e268c6Sopenharmony_ci * 25c5e268c6Sopenharmony_ci * @since 4.0 26c5e268c6Sopenharmony_ci * @version 1.0 27c5e268c6Sopenharmony_ci */ 28c5e268c6Sopenharmony_ci 29c5e268c6Sopenharmony_ci/** 30c5e268c6Sopenharmony_ci * @file IWififenceCallback.idl 31c5e268c6Sopenharmony_ci * 32c5e268c6Sopenharmony_ci * @brief Declares the callbacks for the Wi-Fi fence module. 33c5e268c6Sopenharmony_ci * 34c5e268c6Sopenharmony_ci * @since 4.0 35c5e268c6Sopenharmony_ci * @version 1.0 36c5e268c6Sopenharmony_ci */ 37c5e268c6Sopenharmony_ci 38c5e268c6Sopenharmony_ci/** 39c5e268c6Sopenharmony_ci * @brief Declares the path of the Wi-Fi fence module interface package. 40c5e268c6Sopenharmony_ci * 41c5e268c6Sopenharmony_ci * @since 4.0 42c5e268c6Sopenharmony_ci */ 43c5e268c6Sopenharmony_cipackage ohos.hdi.location.lpfence.wififence.v1_0; 44c5e268c6Sopenharmony_ci 45c5e268c6Sopenharmony_ci/** 46c5e268c6Sopenharmony_ci * @brief Imports data types of the Wi-Fi fence module. 47c5e268c6Sopenharmony_ci * 48c5e268c6Sopenharmony_ci * @since 4.0 49c5e268c6Sopenharmony_ci */ 50c5e268c6Sopenharmony_ciimport ohos.hdi.location.lpfence.wififence.v1_0.WififenceTypes; 51c5e268c6Sopenharmony_ci 52c5e268c6Sopenharmony_ci/** 53c5e268c6Sopenharmony_ci * @brief Defines the callback for the Wi-Fi fence module. 54c5e268c6Sopenharmony_ci * 55c5e268c6Sopenharmony_ci * 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. 56c5e268c6Sopenharmony_ci * For details, see {@link ICellfenceInterface}. 57c5e268c6Sopenharmony_ci * 58c5e268c6Sopenharmony_ci * @since 4.0 59c5e268c6Sopenharmony_ci */ 60c5e268c6Sopenharmony_ci[callback] interface IWififenceCallback { 61c5e268c6Sopenharmony_ci /** 62c5e268c6Sopenharmony_ci * @brief Called when the Wi-Fi fence status changes. 63c5e268c6Sopenharmony_ci * 64c5e268c6Sopenharmony_ci * This callback will be invoked to report the Wi-Fi fence status when the relationship between a device and a Wi-Fi fence changes. 65c5e268c6Sopenharmony_ci * 66c5e268c6Sopenharmony_ci * @param wififenceId Indicates the ID of the Wi-Fi fence. 67c5e268c6Sopenharmony_ci * @param transition Indicates the Wi-Fi fence status. For details, see {@link WififenceTransition}. 68c5e268c6Sopenharmony_ci * @param timestamp Indicates the timestamp. 69c5e268c6Sopenharmony_ci * 70c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 71c5e268c6Sopenharmony_ci * @return Returns a negative value if the operation fails. 72c5e268c6Sopenharmony_ci * 73c5e268c6Sopenharmony_ci * @since 4.0 74c5e268c6Sopenharmony_ci */ 75c5e268c6Sopenharmony_ci OnWififenceChanged([in] int wififenceId, 76c5e268c6Sopenharmony_ci [in] int transition, 77c5e268c6Sopenharmony_ci [in] long timestamp); 78c5e268c6Sopenharmony_ci 79c5e268c6Sopenharmony_ci /** 80c5e268c6Sopenharmony_ci * @brief Called to return the Wi-Fi fence information. 81c5e268c6Sopenharmony_ci * 82c5e268c6Sopenharmony_ci * 83c5e268c6Sopenharmony_ci * 84c5e268c6Sopenharmony_ci * @param size Indicates the Wi-Fi fence information obtained. For details, see {@link WififenceSize}. 85c5e268c6Sopenharmony_ci * 86c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the callback is invoked successfully. 87c5e268c6Sopenharmony_ci * @return Returns a negative value if the callback fails to be invoked. 88c5e268c6Sopenharmony_ci * 89c5e268c6Sopenharmony_ci * @since 4.0 90c5e268c6Sopenharmony_ci */ 91c5e268c6Sopenharmony_ci OnGetWififenceSizeCb([in] struct WififenceSize size); 92c5e268c6Sopenharmony_ci 93c5e268c6Sopenharmony_ci /** 94c5e268c6Sopenharmony_ci * @brief Called when the low-power fence service is reset. 95c5e268c6Sopenharmony_ci * 96c5e268c6Sopenharmony_ci * 97c5e268c6Sopenharmony_ci * 98c5e268c6Sopenharmony_ci * @return Returns <b>0</b> if the callback is invoked successfully. 99c5e268c6Sopenharmony_ci * @return Returns a negative value if the callback fails to be invoked. 100c5e268c6Sopenharmony_ci * 101c5e268c6Sopenharmony_ci * @since 4.0 102c5e268c6Sopenharmony_ci */ 103c5e268c6Sopenharmony_ci OnWififenceReset(); 104c5e268c6Sopenharmony_ci} 105c5e268c6Sopenharmony_ci/** @} */ 106