Simple Geolocalization and Course Transmission Protocol (SGCTP)
|
#include <sgctp/data.hpp>
Public Types | |
enum | ESourceType { SOURCE_UNDEFINED = 0, SOURCE_GPS = 1, SOURCE_AIS = 2, SOURCE_ADSB = 3, SOURCE_FLARM = 4 } |
Data source types. More... | |
Public Member Functions | |
CData () | |
~CData () | |
void | reset (bool _bDataFree=true) |
Reset (undefine) all data. More... | |
void | setID (const char *_pcID) |
Set the ID string (max. 127 characters) More... | |
uint16_t | setData (const unsigned char *_pucData, uint16_t _ui16tDataSize) |
Set the data (max. 32767 symbols) More... | |
void | setTime (double _fdEpoch) |
Set the time, in seconds (UTC) More... | |
void | setLatitude (double _fdLatitude) |
Set the latitude, in degrees. More... | |
void | setLongitude (double _fdLongitude) |
Set the longitude, in degrees. More... | |
void | setElevation (double _fdElevation) |
Set the elevation, in meters. More... | |
void | setBearing (double _fdBearing) |
Set the bearing, in degrees. More... | |
void | setGndSpeed (double _fdGndSpeed) |
Set the ground speed, in meters per second. More... | |
void | setVrtSpeed (double _fdVrtSpeed) |
Set the vertical speed, in meters per second. More... | |
void | setBearingDt (double _fdBearingDt) |
Set the bearing variation over time (rate of turn), in degrees per second. More... | |
void | setGndSpeedDt (double _fdGndSpeedDt) |
Set the ground speed variation over time (acceleration), in meters per second^2. More... | |
void | setVrtSpeedDt (double _fdVrtSpeedDt) |
Set the vertical speed variation over time (acceleration), in meters per second^2. More... | |
void | setHeading (double _fdHeading) |
Set the heading, in degrees. More... | |
void | setAppSpeed (double _fdApparentSpeed) |
Set the apparent speed, in meters per second. More... | |
void | setSourceType (ESourceType _eSourceType) |
Set the source type. More... | |
void | setLatitudeError (double _fdLatitudeError) |
Set the latitude error, in meters. More... | |
void | setLongitudeError (double _fdLongitudeError) |
Set the longitude error, in meters. More... | |
void | setElevationError (double _fdElevationError) |
Set the elevation error, in meters. More... | |
void | setBearingError (double _fdBearingError) |
Set the bearing error, in degrees. More... | |
void | setGndSpeedError (double _fdGndSpeedError) |
Set the ground speed error, in meters per second. More... | |
void | setVrtSpeedError (double _fdVrtSpeedError) |
Set the vertical speed error, in meters per second. More... | |
void | setBearingDtError (double _fdBearingDtError) |
Set the bearing variation over time (rate of turn) error, in degrees per second. More... | |
void | setGndSpeedDtError (double _fdGndSpeedDtError) |
Set the ground speed variation over time (acceleration) error, in meters per second^2. More... | |
void | setVrtSpeedDtError (double _fdVrtSpeedDtError) |
Set the vertical speed variation over time (acceleration) error, in meters per second^2. More... | |
void | setHeadingError (double _fdHeadingError) |
Set the heading error, in degrees. More... | |
void | setAppSpeedError (double _fdApparentSpeedError) |
Set the apparent speed error, in meters per second. More... | |
const char * | getID () const |
Return the ID string. More... | |
void | getData (unsigned char *_pucData, uint16_t *_pui16tDataSize) const |
Return the data (max. 32767 symbols) More... | |
const unsigned char * | getData () const |
Return the data. More... | |
const uint16_t | getDataSize () const |
Return the data size. More... | |
double | getTime () const |
Return the time (inclusing sub-second decimals), in seconds from 00:00:00 (UTC) More... | |
double | getLatitude () const |
Return the latitude, in degrees. More... | |
double | getLongitude () const |
Return the longitude, in degrees. More... | |
double | getElevation () const |
Return the elevation, in meters. More... | |
double | getBearing () const |
Return the bearing, in degrees. More... | |
double | getGndSpeed () const |
Return the ground speed, in meters per second. More... | |
double | getVrtSpeed () const |
Return the vertical speed, in meters per second. More... | |
double | getBearingDt () const |
Return the bearing variation over time (rate of turn), in degrees per second. More... | |
double | getGndSpeedDt () const |
Return the ground speed variation over time (acceleration), in meters per second^2. More... | |
double | getVrtSpeedDt () const |
Return the vertical speed variation over time (acceleration), in meters per second^2. More... | |
double | getHeading () const |
Return the heading, in degrees. More... | |
double | getAppSpeed () const |
Return the apparent speed, in meters per second. More... | |
ESourceType | getSourceType () const |
Return the source type. More... | |
double | getLatitudeError () const |
Return the latitude error, in meters. More... | |
double | getLongitudeError () const |
Return the longitude error, in meters. More... | |
double | getElevationError () const |
Return the elevation error, in meters. More... | |
double | getBearingError () const |
Return the bearing error, in degrees. More... | |
double | getGndSpeedError () const |
Return the ground speed error, in meters per second. More... | |
double | getVrtSpeedError () const |
Return the vertical speed error, in meters per second. More... | |
double | getBearingDtError () const |
Return the bearing variation over time (rate of turn) error, in degrees per second. More... | |
double | getGndSpeedDtError () const |
Return the ground speed variation over time (acceleration) error, in meters per second^2. More... | |
double | getVrtSpeedDtError () const |
Return the vertical speed variation over time (acceleration) error, in meters per second^2. More... | |
double | getHeadingError () const |
Return the heading error, in degrees. More... | |
double | getAppSpeedError () const |
Return the apparent speed error, in meters per second. More... | |
void | freeData () |
Clear (free) the data container. More... | |
void | copy (const CData &_roData) |
Copy the entire content from another data object. More... | |
bool | sync (const CData &_roData) |
Synchronize the (defined) content from another data object. More... | |
Static Public Member Functions | |
static bool | isDefined (double _fdValue) |
Return whether the given value is defined. More... | |
static bool | isValid (double _fdValue) |
Return whether the given value is valid (does not overflow) More... | |
static string | stringSourceType (int _iSourceType) |
Return the human-readable string corresponding to the given source type. More... | |
static double | epoch () |
Return the current (sub-second) UNIX epoch. More... | |
static double | toEpoch (double _fdTime, double _fdEpochReference=0) |
Return the UNIX epoch (including sub-second decimals) corresponding to the given SGCTP time (relative to the given epoch) More... | |
static void | toIso8601 (char *_pcIso8601, double _fdEpoch) |
Return the ISO-8601 date/time string corresponding to the given UNIX epoch. More... | |
static double | fromIso8601 (const char *_pcIso8601) |
Return the UNIX epoch corresponding to the given ISO-8601 date/time string. More... | |
Static Public Attributes | |
static const double | UNDEFINED_VALUE = NAN |
Undefined value. More... | |
static const double | OVERFLOW_VALUE = INFINITY |
Overflow value. More... | |
static const uint8_t | MAX_ID_LENGTH = 127 |
Maximum ID length. More... | |
static const uint8_t | MAX_ID_SIZE = 128 |
Maximum ID size. More... | |
static const uint16_t | MAX_DATA_SIZE = 32767 |
Maximum data size. More... | |
Private Member Functions | |
uint16_t | allocData (uint16_t _ui16tDataSize) |
Allocate the memory for the data container (max. 32767 symbols) More... | |
Private Attributes | |
char | pcID [MAX_ID_SIZE] |
ID string (max. 127 characters) More... | |
unsigned char * | pucData |
Data (max. 32767 symbols) More... | |
uint16_t | ui16tDataSize |
Data size. More... | |
uint32_t | ui32tTime |
Time. More... | |
uint32_t | ui32tLatitude |
Latitude. More... | |
uint32_t | ui32tLongitude |
Longitude. More... | |
uint32_t | ui32tElevation |
Elevation. More... | |
uint32_t | ui32tBearing |
Bearing. More... | |
uint32_t | ui32tGndSpeed |
Ground speed. More... | |
uint32_t | ui32tVrtSpeed |
Vertical speed. More... | |
uint32_t | ui32tBearingDt |
Bearing variation over time (rate of turn) More... | |
uint32_t | ui32tGndSpeedDt |
Ground speed variation over time (acceleration) More... | |
uint32_t | ui32tVrtSpeedDt |
Vertical speed variation over time (acceleration) More... | |
uint32_t | ui32tHeading |
Heading. More... | |
uint32_t | ui32tAppSpeed |
Apparent speed. More... | |
uint32_t | ui32tSourceType |
Source type. More... | |
uint32_t | ui32tLatitudeError |
Latitude error. More... | |
uint32_t | ui32tLongitudeError |
Longitude error. More... | |
uint32_t | ui32tElevationError |
Elevation error. More... | |
uint32_t | ui32tBearingError |
Bearing error. More... | |
uint32_t | ui32tGndSpeedError |
Ground speed error. More... | |
uint32_t | ui32tVrtSpeedError |
Vertical speed error. More... | |
uint32_t | ui32tBearingDtError |
Bearing variation over time (rate of turn) error. More... | |
uint32_t | ui32tGndSpeedDtError |
Ground speed variation over time (acceleration) error. More... | |
uint32_t | ui32tVrtSpeedDtError |
Vertical speed variation over time (acceleration) error. More... | |
uint32_t | ui32tHeadingError |
Heading error. More... | |
uint32_t | ui32tAppSpeedError |
Apparent speed error. More... | |
Static Private Attributes | |
static const uint32_t | UNDEFINED_UINT32 = 0x80000000 |
Internal (integer) undefined value. More... | |
static const uint32_t | OVERFLOW_UINT32 = 0x7FFFFFFF |
Internal (integer) positive overflow value. More... | |
Friends | |
class | CPayload |
SGCTP data container.
This class encapsulates geolocalization and motion data (in integer/no- precision-loss format). It provides the necessary setters/getters to convert all geolocalization and motion data from/to their SI-standardized form. See the PROTOCOL document to see the meaning of each data field.
|
inlinestatic |
|
inlinestatic |
|
static |
Return the human-readable string corresponding to the given source type.
[in] | _iSourceType | Source type (code) |
|
static |
|
static |
Return the UNIX epoch (including sub-second decimals) corresponding to the given SGCTP time (relative to the given epoch)
[in] | _fdTime | SGCTP time (REMINDER: does NOT contain date information) |
[in] | _fdEpochReference | Reference UNIX epoch/data (to obtain date information) |
|
static |
|
static |
void CData::reset | ( | bool | _bDataFree = true | ) |
void CData::setID | ( | const char * | _pcID | ) |
uint16_t CData::setData | ( | const unsigned char * | _pucData, |
uint16_t | _ui16tDataSize | ||
) |
void CData::setTime | ( | double | _fdEpoch | ) |
void CData::setLatitude | ( | double | _fdLatitude | ) |
void CData::setLongitude | ( | double | _fdLongitude | ) |
void CData::setElevation | ( | double | _fdElevation | ) |
void CData::setBearing | ( | double | _fdBearing | ) |
void CData::setGndSpeed | ( | double | _fdGndSpeed | ) |
void CData::setVrtSpeed | ( | double | _fdVrtSpeed | ) |
void CData::setBearingDt | ( | double | _fdBearingDt | ) |
void CData::setGndSpeedDt | ( | double | _fdGndSpeedDt | ) |
void CData::setVrtSpeedDt | ( | double | _fdVrtSpeedDt | ) |
void CData::setHeading | ( | double | _fdHeading | ) |
void CData::setAppSpeed | ( | double | _fdApparentSpeed | ) |
|
inline |
void CData::setLatitudeError | ( | double | _fdLatitudeError | ) |
void CData::setLongitudeError | ( | double | _fdLongitudeError | ) |
void CData::setElevationError | ( | double | _fdElevationError | ) |
void CData::setBearingError | ( | double | _fdBearingError | ) |
void CData::setGndSpeedError | ( | double | _fdGndSpeedError | ) |
void CData::setVrtSpeedError | ( | double | _fdVrtSpeedError | ) |
void CData::setBearingDtError | ( | double | _fdBearingDtError | ) |
void CData::setGndSpeedDtError | ( | double | _fdGndSpeedDtError | ) |
void CData::setVrtSpeedDtError | ( | double | _fdVrtSpeedDtError | ) |
void CData::setHeadingError | ( | double | _fdHeadingError | ) |
void CData::setAppSpeedError | ( | double | _fdApparentSpeedError | ) |
|
inline |
void CData::getData | ( | unsigned char * | _pucData, |
uint16_t * | _pui16tDataSize | ||
) | const |
|
inline |
|
inline |
double CData::getTime | ( | ) | const |
double CData::getLatitude | ( | ) | const |
double CData::getLongitude | ( | ) | const |
double CData::getElevation | ( | ) | const |
double CData::getBearing | ( | ) | const |
double CData::getGndSpeed | ( | ) | const |
double CData::getVrtSpeed | ( | ) | const |
double CData::getBearingDt | ( | ) | const |
double CData::getGndSpeedDt | ( | ) | const |
double CData::getVrtSpeedDt | ( | ) | const |
double CData::getHeading | ( | ) | const |
double CData::getAppSpeed | ( | ) | const |
|
inline |
double CData::getLatitudeError | ( | ) | const |
double CData::getLongitudeError | ( | ) | const |
double CData::getElevationError | ( | ) | const |
double CData::getBearingError | ( | ) | const |
double CData::getGndSpeedError | ( | ) | const |
double CData::getVrtSpeedError | ( | ) | const |
double CData::getBearingDtError | ( | ) | const |
double CData::getGndSpeedDtError | ( | ) | const |
double CData::getVrtSpeedDtError | ( | ) | const |
double CData::getHeadingError | ( | ) | const |
double CData::getAppSpeedError | ( | ) | const |
|
private |
void CData::copy | ( | const CData & | _roData | ) |
bool CData::sync | ( | const CData & | _roData | ) |
|
staticprivate |
|
staticprivate |
|
static |
|
static |
|
static |
|
static |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |