GPSNet
Public Member Functions | Public Attributes | List of all members
GPSReport Struct Reference

Records all the relevant details of a GPS position report, plus some utility functions for operating on them. More...

#include <GPSNet.h>

Public Member Functions

 GPSReport ()
 
boolean hasId (uint8_t *id)
 
boolean isIdenticalTo (GPSReport *that)
 
boolean isCloseTo (GPSReport *that, uint32_t latlongError=100, uint32_t altitudeError=10)
 
boolean isLaterThan (GPSReport *that)
 
void print ()
 

Public Attributes

uint8_t magic
 Magic number and version of this report format == GPSNET_MAGIC_VERSION_1.
 
uint8_t id [GPSNET_REPORT_ID_LEN]
 Unique ID of the node originating the report.
 
uint32_t date
 Current date as an integer (yymmdd)
 
uint32_t time
 Current time as an integer (hhmmss)
 
int32_t latitude
 Current latitude in 100000ths of a degree.
 
int32_t longitude
 Current longitude in 100000ths of a degree.
 
int16_t altitude
 Current altitude in m.
 
uint16_t speed
 Current speed in knot.
 
uint16_t course
 Current course in degrees.
 
uint8_t flags
 GPSnet internal flags (not used at present)
 
uint8_t status
 External application specific status flags.
 
uint8_t hops
 Num of radio hops from originator, 0 at originator.
 

Detailed Description

Records all the relevant details of a GPS position report, plus some utility functions for operating on them.

The id member contains the node ID of the node that originated this report. Node IDs are expected to be unique across the network.

Examples:
gpsnet.ino.

Constructor & Destructor Documentation

GPSReport::GPSReport ( )

Contructor. Clears all members to 0.

References altitude, course, date, flags, hops, latitude, longitude, magic, speed, status, and time.

Member Function Documentation

boolean GPSReport::hasId ( uint8_t *  id)

Tests whether the report has a a given node ID Returns true if there is an exact match over all octets of the ID

Parameters
[in]idPointer to array of GPSNET_REPORT_ID_LEN octets of identifier
Returns
true if there is an exact match

Referenced by isIdenticalTo().

boolean GPSReport::isCloseTo ( GPSReport that,
uint32_t  latlongError = 100,
uint32_t  altitudeError = 10 
)

Tests whether 2 GPSReports are geographically close to each other, with specified margins. param[in] that Pointer to the other report to test against param[in] latlongError Allowable angular difference in latitude or longitude, in 1/100000ths of a degree (1.1112m at the equator). param[in] altitudeError Allowable error in metres

Returns
true if the latitudes, longitudes and altitudes of the 2 positions are within the specified margins of each other.
Examples:
gpsnet.ino.

References altitude, latitude, and longitude.

boolean GPSReport::isIdenticalTo ( GPSReport that)

Tests whether 2 GPSReports are identical in all respects

Parameters
[in]thatPointer to the other report to test against
Returns
true if all members match exactly

References altitude, course, date, flags, hasId(), hops, id, latitude, longitude, speed, status, and time.

boolean GPSReport::isLaterThan ( GPSReport that)

Tests whether the timestamp (date and time) of the other rport is later than this one

Parameters
[in]thatPointer to the other report to test against
Returns
true if the time or date is later

References date, and time.

Referenced by GPSNet::newReport().

void GPSReport::print ( )

Print details of the report to the Serial port

Examples:
gpsnet.ino.

References altitude, course, date, flags, hops, latitude, longitude, speed, status, and time.


The documentation for this struct was generated from the following files: