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 #ifndef GEOFENCE_DEFINITION_H 17 #define GEOFENCE_DEFINITION_H 18 #include "beacon_fence.h" 19 20 namespace OHOS { 21 namespace Location { 22 enum GeofenceTransitionEvent { 23 GEOFENCE_TRANSITION_INIT = -1, 24 GEOFENCE_TRANSITION_EVENT_ENTER = 1, 25 GEOFENCE_TRANSITION_EVENT_EXIT = 2, 26 GEOFENCE_TRANSITION_EVENT_DWELL = 4, 27 }; 28 29 enum CoordinateSystemType { 30 WGS84 = 1, 31 GCJ02, 32 }; 33 34 enum GnssGeofenceOperateResult { 35 GNSS_GEOFENCE_OPERATION_SUCCESS = 0, 36 GNSS_GEOFENCE_OPERATION_ERROR_UNKNOWN = -1, 37 GNSS_GEOFENCE_OPERATION_ERROR_TOO_MANY_GEOFENCES = -2, 38 GNSS_GEOFENCE_OPERATION_ERROR_GEOFENCE_ID_EXISTS = -3, 39 GNSS_GEOFENCE_OPERATION_ERROR_PARAMS_INVALID = -4, 40 GNSS_GEOFENCE_OPERATION_ERROR_GEOFENCE_ID_UNKNOWN = -5, 41 GNSS_GEOFENCE_OPERATION_ERROR_NOT_SUPPORTED = -6, 42 GNSS_GEOFENCE_OPERATION_ERROR_OPERATE_FAILED = -7, 43 }; 44 45 enum GnssGeofenceOperateType { 46 GNSS_GEOFENCE_OPT_TYPE_ADD = 1, 47 GNSS_GEOFENCE_OPT_TYPE_DELETE = 2, 48 }; 49 50 typedef struct { 51 int fenceId; 52 GeofenceTransitionEvent event; 53 std::shared_ptr<BeaconFence> beaconFence; 54 } GeofenceTransition; 55 } // namespace Location 56 } // namespace OHOS 57 #endif // GEOFENCE_DEFINITION_H 58