blob: 9fea6cdba133bbb461dd97a8b4baee39166f81da [file] [log] [blame]
// 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.
@available(added=7)
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`.
type Position = struct {
latitude float64; // In WGS84 datum
longitude float64; // In WGS84 datum
extras PositionExtras;
};
/// 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.
type PositionExtras = table {
1: accuracy_meters float64;
2: altitude_meters float64; // 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() -> (struct {
position Position;
}) error fuchsia.location.Error;
};