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 HdiGeofence 18 * @{ 19 * 20 * @brief Provides unified APIs for the GNSS geofence service. 21 * 22 * A gnss service module can use the interfaces of this module to add fences, and delete fences, and monitor 23 * fence status changes. 24 * 25 * @since 3.2 26 */ 27 28/* 29 * @file GeofenceTypes.idl 30 * 31 * @brief Defines the data structure used by the geofence module. 32 * 33 * @since 3.2 34 * @version 1.0 35 */ 36 37package ohos.hdi.location.geofence.v1_0; 38 39/* 40 * @brief Defines the type of the geofence event to be listened on. 41 * 42 * @since 3.2 43 */ 44enum GeofenceEvent { 45 GEOFENCE_EVENT_UNCERTAIN = 1, 46 GEOFENCE_EVENT_ENTERED = 2, 47 GEOFENCE_EVENT_EXITED = 4, 48}; 49 50/* 51 * @brief Define the result and error code of the operation fence. 52 * 53 * @since 3.2 54 */ 55enum GeofenceOperateResult { 56 OPERATION_SUCCESS = 0, 57 OPERATION_ERROR_UNKNOWN = -100, 58 OPERATION_ERROR_TOO_MANY_GEOFENCES = -101, 59 OPERATION_ERROR_GEOFENCE_INDEX_EXISTS = -102, 60 OPERATION_ERROR_PARAMS_INVALID = -103, 61}; 62 63/* 64 * @brief Defines the action type of the operation fence. 65 * 66 * @since 3.2 67 */ 68enum GeofenceOperateType { 69 TYPE_ADD = 1, 70 TYPE_DELETE = 2, 71}; 72 73/* 74 * @brief Define geofence parameters. 75 * 76 * @since 3.2 77 */ 78struct GeofenceInfo { 79 int fenceIndex; 80 double latitude; 81 double longitude; 82 double radius; 83}; 84 85/* 86 * @brief Defines the GNSS positioning result structure. 87 * 88 * @since 3.2 89 */ 90struct LocationInfo { 91 double latitude; 92 double longitude; 93 double altitude; 94 float accuracy; 95 float speed; 96 double direction; 97 long timeStamp; 98 long timeSinceBoot; 99}; 100