IoT::Devices

class GNSSSensor

File Information

Library: IoT/Devices
Package: Devices
Header: IoT/Devices/GNSSSensor.h

Description

The interface for GNSS/GPS receivers.

Implementations of this class should also support the following (optional) properties for configuration:

  • positionChangedPeriod (int): the minimum time interval in milliseconds between firings of the positionUpdate event.
  • positionChangedDelta (int): the minimum distance (in meters) the receiver must move before the positionUpdate event is fired again.
  • positionTimeout (int): Timeout in milliseconds after which the positionLost event is fired if no valid position has been received from the GNSS receiver.

Inheritance

Direct Base Classes: Device

All Base Classes: Device

Member Summary

Member Functions: altitude, course, hdop, magneticVariation, position, positionAvailable, speed

Inherited Functions: getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp

Constructors

GNSSSensor

GNSSSensor();

Creates the GNSSSensor.

Destructor

~GNSSSensor virtual

~GNSSSensor();

Destroys the GNSSSensor.

Member Functions

altitude virtual

virtual double altitude() const = 0;

Returns the current altitude above sea level in meters. Returns -9999 if no altitude is available.

course virtual

virtual double course() const = 0;

Returns the current course in degrees [0, 360).

hdop virtual

virtual double hdop() const = 0;

Returns the Horizontal Dilution Of Precision (HDOP) in meters, or -9999 if no HDOP value is available.

magneticVariation virtual

virtual double magneticVariation() const = 0;

Returns the current magnetic variation in degrees [0, 360). Returns -1 if no magnetic variation is available.

position virtual

virtual LatLon position() const = 0;

Returns the last obtained position.

If no position is available, latitude and longitude will both be 0. To disambiguate with a real position, also check positionAvailable().

positionAvailable virtual

virtual bool positionAvailable() const = 0;

Returns true if a valid position is available.

speed virtual

virtual double speed() const = 0;

Returns the current speed in nautical knots. If no speed is available, returns -1.

Variables

positionLost

Poco::BasicEvent < void > positionLost;

Fired when the GNSS receiver no longer provides position updates or has otherwise indicated that it is no longer able to determine the position.

positionUpdate

Poco::BasicEvent < const PositionUpdate > positionUpdate;

Fired when a position update (e.g., a valid NMEA 0183 RMC message) has been received from the receiver.

Actual behavior of this event (e.g., minimum interval between fires) are implementation specific and can be configured via properties.

Securely control IoT edge devices from anywhere   Connect a Device