| // Copyright 2020 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| /// Protocols and types related to positions. |
| library fuchsia.location.position; |
| |
| using fuchsia.location; |
| |
| /// Describes a position on Earth. |
| /// |
| /// A fully-specified position includes latitude and longitude, |
| /// as well a radius of accuracy of the current position in |
| /// the horizontal plane, and the current altitude. |
| /// |
| /// Note that only the latitude and longitude are guaranteed |
| /// to be present. The remaining fields, if present, are contained |
| /// within `extras`. |
| struct Position { |
| float64 latitude; // In WGS84 datum |
| float64 longitude; // In WGS84 datum |
| PositionExtras extras; |
| }; |
| |
| /// Extra information about a position on Earth. |
| /// |
| /// The radius of accuracy may incorporate any sources of |
| /// uncertainty available to the positioning system. This may include, |
| /// for example, radio propagation models, triangulation error, and |
| /// motion compensation. |
| /// |
| /// Note that all extras are optional. |
| table PositionExtras { |
| 1: float64 accuracy_meters; |
| 2: float64 altitude_meters; // Above WGS84 ellipsoid |
| }; |
| |
| /// Provides access to position data for emergency purposes. Implementations |
| /// of this service are expected to be subject to different power and privacy |
| /// controls than more general location services. |
| [Discoverable] |
| protocol EmergencyProvider { |
| /// Returns the current position, if available. |
| GetCurrent() -> (Position position) error fuchsia.location.Error; |
| }; |