38namespace etsi_its_rtcmem_ts_msgs {
42#include <etsi_its_msgs_utils/impl/asn1_primitives/asn1_primitives_getters.h>
52 return header.protocol_version;
62 return header.message_id;
72 return header.station_id;
91 inline ItsPduHeader
getHeader(
const RTCMEM& rtcmem) {
152 return msg_cnt.value;
232 return rtcm.time_stamp_is_present;
253 return rtcm.time_stamp;
293 return rtcm.anchor_point_is_present;
314 return rtcm.anchor_point;
334 return rtcm.rtcm_header_is_present;
355 return rtcm.rtcm_header;
425 return msgs.array.size();
455 inline RTCMmessage
getRTCMmessage(
const RTCMmessageList& msgs,
const std::size_t index) {
456 if (index >= msgs.array.size()) {
457 throw std::out_of_range(
"RTCMmessageList index out of range.");
459 return msgs.array[index];
469 inline RTCMmessage
getRTCMmessage(
const RTCMcorrections& rtcm,
const std::size_t index) {
480 inline RTCMmessage
getRTCMmessage(
const RTCMEM& rtcmem,
const std::size_t index) {
501 return msg.value.size();
511 return header.status;
541 return header.offset_set;
552 throwIfOutOfRange(bit_index,
static_cast<uint8_t
>(0),
static_cast<uint8_t
>(GNSSstatus::SIZE_BITS - 1),
"GNSSstatus bit index");
554 if (status.value.empty()) {
558 const uint8_t mask =
static_cast<uint8_t
>(1u << bit_index);
559 return (status.value[0] & mask) != 0;
629 return getGNSSstatusBit(status, GNSSstatus::BIT_INDEX_LOCAL_CORRECTIONS_PRESENT);
639 return getGNSSstatusBit(status, GNSSstatus::BIT_INDEX_NETWORK_CORRECTIONS_PRESENT);
649 return offset.ant_offset_x.value;
659 return offset.ant_offset_y.value;
669 return offset.ant_offset_z.value;
679 return static_cast<double>(longitude.value) * 1e-7;
689 return static_cast<double>(latitude.value) * 1e-7;
699 return static_cast<double>(elevation.value) * 1e-1;
709 return heading.value;
719 return pos.utc_time_is_present;
740 return pos.lon.value;
760 return pos.lat.value;
780 return pos.elevation_is_present;
791 return pos.elevation;
811 return pos.heading_is_present;
820 inline HeadingDSRC
getHeading(
const FullPositionVector& pos) {
831 inline bool hasSpeed(
const FullPositionVector& pos) {
832 return pos.speed_is_present;
841 inline TransmissionAndSpeed
getSpeed(
const FullPositionVector& pos) {
853 return pos.pos_accuracy_is_present;
864 return pos.pos_accuracy;
874 return pos.time_confidence_is_present;
885 return pos.time_confidence;
895 return time_confidence.value;
905 return pos.pos_confidence_is_present;
916 return pos.pos_confidence;
926 return pos.speed_confidence_is_present;
937 return pos.speed_confidence;
947 return speed.transmisson;
987 return accuracy.semi_major;
1007 return accuracy.semi_minor;
1027 return accuracy.orientation;
1047 return confidence.pos;
1067 return confidence.elevation;
1087 return confidence.heading;
1107 return confidence.speed;
1127 return confidence.throttle;
1147 return date_time.year_is_present;
1156 inline DYear
getYear(
const DDateTime& date_time) {
1158 return date_time.year;
1168 return getYear(date_time).value;
1178 return date_time.month_is_present;
1189 return date_time.month;
1208 inline bool hasDay(
const DDateTime& date_time) {
1209 return date_time.day_is_present;
1218 inline DDay
getDay(
const DDateTime& date_time) {
1220 return date_time.day;
1230 return getDay(date_time).value;
1240 return date_time.hour_is_present;
1249 inline DHour
getHour(
const DDateTime& date_time) {
1251 return date_time.hour;
1261 return getHour(date_time).value;
1271 return date_time.minute_is_present;
1282 return date_time.minute;
1302 return date_time.second_is_present;
1313 return date_time.second;
1323 return static_cast<double>(
getSecond(date_time).value) * 1e-3;
1333 return date_time.offset_is_present;
1344 return date_time.offset;
Sanity-check functions etc.
int16_t getOffsetValue(const DDateTime &date_time)
Get the DOffset value from a DDateTime object.
bool hasHour(const DDateTime &date_time)
Check whether hour is present in a DDateTime object.
bool getIsHealthyFlag(const GNSSstatus &status)
Get the healthy flag from a GNSSstatus object.
double getSecondValue(const DDateTime &date_time)
Get the DSecond value from a DDateTime object.
ItsPduHeader getHeader(const RTCMEM &rtcmem)
Get the ItsPduHeader from a RTCMEM object.
PositionConfidenceSet getPositionConfidence(const FullPositionVector &pos)
Get the PositionConfidenceSet object from a FullPositionVector object.
StationID getStationID(const ItsPduHeader &header)
Get the StationID object from an ItsPduHeader object.
uint8_t getPositionConfidenceValue(const PositionConfidenceSet &confidence)
Get the PositionConfidence value from a PositionConfidenceSet object.
bool hasDay(const DDateTime &date_time)
Check whether day is present in a DDateTime object.
ThrottleConfidence getThrottleConfidence(const SpeedandHeadingandThrottleConfidence &confidence)
Get the ThrottleConfidence object from a SpeedandHeadingandThrottleConfidence object.
bool getAPDOPofUnder5Flag(const GNSSstatus &status)
Get the aPDOPofUnder5 flag from a GNSSstatus object.
std::vector< uint8_t > getRTCMmessageValue(const RTCMmessage &msg)
Get the raw bytes from a RTCMmessage object.
std::vector< RTCMmessage > getRTCMmessages(const RTCMmessageList &msgs)
Get the RTCM messages from a RTCMmessageList object.
uint16_t getYearValue(const DDateTime &date_time)
Get the DYear value from a DDateTime object.
double getElevation(const Elevation &elevation)
Get the elevation value from an Elevation object.
int16_t getAntennaOffsetZValue(const AntennaOffsetSet &offset)
Get the antenna offset in z direction.
bool getGNSSstatusBit(const GNSSstatus &status, const uint8_t bit_index)
Get a GNSSstatus bit by index.
void throwIfNotPresent(const bool is_present, const std::string val_desc)
Throws an exception if the given value is not present.
DMonth getMonth(const DDateTime &date_time)
Get the DMonth object from a DDateTime object.
uint8_t getSemiMajorAxisAccuracyValue(const PositionalAccuracy &accuracy)
Get the semi-major axis accuracy value from a PositionalAccuracy object.
Elevation getElevationObject(const FullPositionVector &pos)
Get the Elevation object from a FullPositionVector object.
HeadingDSRC getHeading(const FullPositionVector &pos)
Get the HeadingDSRC object from a FullPositionVector object.
uint8_t getMinuteValue(const DDateTime &date_time)
Get the DMinute value from a DDateTime object.
SemiMajorAxisAccuracy getSemiMajorAxisAccuracy(const PositionalAccuracy &accuracy)
Get the semi-major axis accuracy object from a PositionalAccuracy object.
MinuteOfTheYear getMinuteOfTheYear(const RTCMcorrections &rtcm)
Get the MinuteOfTheYear object from a RTCMcorrections object.
uint8_t getTransmissionStateValue(const TransmissionAndSpeed &speed)
Get the transmission state value from a TransmissionAndSpeed object.
uint8_t getElevationConfidenceValue(const PositionConfidenceSet &confidence)
Get the ElevationConfidence value from a PositionConfidenceSet object.
TimeConfidence getTimeConfidence(const FullPositionVector &pos)
Get the TimeConfidence object from a FullPositionVector object.
DMinute getMinute(const DDateTime &date_time)
Get the DMinute object from a DDateTime object.
SpeedConfidenceDSRC getSpeedConfidenceDSRC(const SpeedandHeadingandThrottleConfidence &confidence)
Get the SpeedConfidenceDSRC object from a SpeedandHeadingandThrottleConfidence object.
uint32_t getMinuteOfTheYearValue(const RTCMcorrections &rtcm)
Get the MinuteOfTheYear value from a RTCMcorrections object.
RTCMcorrections getRTCMcorrections(const RTCMEM &rtcmem)
Get the RTCMcorrections container from a RTCMEM object.
SpeedandHeadingandThrottleConfidence getSpeedConfidence(const FullPositionVector &pos)
Get the SpeedandHeadingandThrottleConfidence object from a FullPositionVector object.
bool getBaseStationTypeFlag(const GNSSstatus &status)
Get the base station type flag from a GNSSstatus object.
uint8_t getMsgCount(const MsgCount &msg_cnt)
Get the MsgCount value from a MsgCount object.
FullPositionVector getAnchorPoint(const RTCMcorrections &rtcm)
Get the anchor point from a RTCMcorrections object.
uint16_t getHeadingValue(const HeadingDSRC &heading)
Get the heading value from a HeadingDSRC object.
bool hasOffset(const DDateTime &date_time)
Check whether offset is present in a DDateTime object.
DDateTime getUTCTime(const FullPositionVector &pos)
Get the utcTime object from a FullPositionVector object.
uint8_t getMonthValue(const DDateTime &date_time)
Get the DMonth value from a DDateTime object.
bool hasSecond(const DDateTime &date_time)
Check whether second is present in a DDateTime object.
bool hasSpeed(const FullPositionVector &pos)
Check whether speed is present in a FullPositionVector object.
SemiMinorAxisAccuracy getSemiMinorAxisAccuracy(const PositionalAccuracy &accuracy)
Get the semi-minor axis accuracy object from a PositionalAccuracy object.
int16_t getAntennaOffsetYValue(const AntennaOffsetSet &offset)
Get the antenna offset in y direction.
Velocity getVelocity(const TransmissionAndSpeed &speed)
Get the Velocity object from a TransmissionAndSpeed object.
bool getIsMonitoredFlag(const GNSSstatus &status)
Get the monitored flag from a GNSSstatus object.
PositionalAccuracy getPositionalAccuracy(const FullPositionVector &pos)
Get the PositionalAccuracy object from a FullPositionVector object.
double getLatitude(const Latitude &latitude)
Get the latitude value from a Latitude object.
std::size_t getRTCMmessageSize(const RTCMmessage &msg)
Get the size of a RTCMmessage object in bytes.
GNSSstatus getGNSSstatus(const RTCMheader &header)
Get the GNSSstatus object from a RTCMheader object.
bool getLocalCorrectionsPresentFlag(const GNSSstatus &status)
Get the localCorrectionsPresent flag from a GNSSstatus object.
bool hasAnchorPoint(const RTCMcorrections &rtcm)
Check whether an anchor point is present in a RTCMcorrections object.
int32_t getLongitudeValue(const FullPositionVector &pos)
Get the raw longitude value from a FullPositionVector object.
uint8_t getTimeConfidenceValue(const TimeConfidence &time_confidence)
Get the TimeConfidence value from a TimeConfidence object.
bool hasMinute(const DDateTime &date_time)
Check whether minute is present in a DDateTime object.
bool hasMonth(const DDateTime &date_time)
Check whether month is present in a DDateTime object.
DYear getYear(const DDateTime &date_time)
Get the DYear object from a DDateTime object.
uint16_t getVelocityValue(const TransmissionAndSpeed &speed)
Get the Velocity value from a TransmissionAndSpeed object.
bool hasSpeedConfidence(const FullPositionVector &pos)
Check whether speed confidence is present in a FullPositionVector object.
uint8_t getSemiMinorAxisAccuracyValue(const PositionalAccuracy &accuracy)
Get the semi-minor axis accuracy value from a PositionalAccuracy object.
uint8_t getRTCMRevisionValue(const RTCMRevision &rev)
Get the RTCMRevision value from a RTCMRevision object.
RTCMmessageList getRTCMmessageList(const RTCMcorrections &rtcm)
Get the RTCMmessageList from a RTCMcorrections object.
DSecond getSecond(const DDateTime &date_time)
Get the DSecond object from a DDateTime object.
bool getInViewOfUnder5Flag(const GNSSstatus &status)
Get the inViewOfUnder5 flag from a GNSSstatus object.
DDay getDay(const DDateTime &date_time)
Get the DDay object from a DDateTime object.
uint8_t getProtocolVersion(const ItsPduHeader &header)
Get the protocol version from an ItsPduHeader object.
uint32_t getStationIDValue(const ItsPduHeader &header)
Get the StationID value from an ItsPduHeader object.
bool hasElevation(const FullPositionVector &pos)
Check whether elevation is present in a FullPositionVector object.
uint16_t getSemiMajorAxisOrientationValue(const PositionalAccuracy &accuracy)
Get the semi-major axis orientation value from a PositionalAccuracy object.
HeadingConfidenceDSRC getHeadingConfidence(const SpeedandHeadingandThrottleConfidence &confidence)
Get the HeadingConfidenceDSRC object from a SpeedandHeadingandThrottleConfidence object.
std::vector< bool > getBitString(const std::vector< uint8_t > &buffer, const int bits_unused)
Get a Bit String in form of bool vector.
RTCMheader getRTCMHeader(const RTCMcorrections &rtcm)
Get the RTCMheader from a RTCMcorrections object.
void throwIfOutOfRange(const T1 &val, const T2 &min, const T2 &max, const std::string val_desc)
Throws an exception if a given value is out of a defined range.
bool getNetworkCorrectionsPresentFlag(const GNSSstatus &status)
Get the networkCorrectionsPresent flag from a GNSSstatus object.
bool hasUTCTime(const FullPositionVector &pos)
Get the utcTime presence flag from a FullPositionVector object.
uint8_t getMessageID(const ItsPduHeader &header)
Get the message ID from an ItsPduHeader object.
uint8_t getDayValue(const DDateTime &date_time)
Get the DDay value from a DDateTime object.
int16_t getAntennaOffsetXValue(const AntennaOffsetSet &offset)
Get the antenna offset in x direction.
bool getUnavailableFlag(const GNSSstatus &status)
Get the unavailable flag from a GNSSstatus object.
RTCMRevision getRTCMRevision(const RTCMcorrections &rtcm)
Get the RTCMRevision object.
bool hasPositionalAccuracy(const FullPositionVector &pos)
Check whether positional accuracy is present in a FullPositionVector object.
double getLongitude(const Longitude &longitude)
Get the longitude value from a Longitude object.
bool hasYear(const DDateTime &date_time)
Check whether year is present in a DDateTime object.
bool hasHeading(const FullPositionVector &pos)
Check whether heading is present in a FullPositionVector object.
bool hasTimeConfidence(const FullPositionVector &pos)
Check whether time confidence is present in a FullPositionVector object.
uint8_t getHeadingConfidenceValue(const SpeedandHeadingandThrottleConfidence &confidence)
Get the HeadingConfidenceDSRC value from a SpeedandHeadingandThrottleConfidence object.
SemiMajorAxisOrientation getSemiMajorAxisOrientation(const PositionalAccuracy &accuracy)
Get the semi-major axis orientation object from a PositionalAccuracy object.
bool hasMinuteOfTheYear(const RTCMcorrections &rtcm)
Check whether a MinuteOfTheYear is present in a RTCMcorrections object.
uint8_t getThrottleConfidenceValue(const SpeedandHeadingandThrottleConfidence &confidence)
Get the ThrottleConfidence value from a SpeedandHeadingandThrottleConfidence object.
TransmissionAndSpeed getSpeed(const FullPositionVector &pos)
Get the TransmissionAndSpeed object from a FullPositionVector object.
AntennaOffsetSet getAntennaOffsetSet(const RTCMheader &header)
Get the AntennaOffsetSet from a RTCMheader object.
DOffset getOffset(const DDateTime &date_time)
Get the DOffset object from a DDateTime object.
std::vector< bool > getGNSSstatusBits(const RTCMheader &header)
Get the GNSSstatus as a bool vector from a RTCMheader object.
ElevationConfidence getElevationConfidence(const PositionConfidenceSet &confidence)
Get the ElevationConfidence object from a PositionConfidenceSet object.
uint8_t getSpeedConfidenceValue(const SpeedandHeadingandThrottleConfidence &confidence)
Get the SpeedConfidenceDSRC value from a SpeedandHeadingandThrottleConfidence object.
RTCMmessage getRTCMmessage(const RTCMmessageList &msgs, const std::size_t index)
Get a RTCMmessage from a RTCMmessageList object by index.
uint8_t getHourValue(const DDateTime &date_time)
Get the DHour value from a DDateTime object.
DHour getHour(const DDateTime &date_time)
Get the DHour object from a DDateTime object.
std::size_t getRTCMmessageCount(const RTCMmessageList &msgs)
Get the number of RTCM messages from a RTCMmessageList object.
bool hasPositionConfidence(const FullPositionVector &pos)
Check whether position confidence is present in a FullPositionVector object.
bool hasRTCMHeader(const RTCMcorrections &rtcm)
Check whether a RTCMheader is present in a RTCMcorrections object.
int32_t getLatitudeValue(const FullPositionVector &pos)
Get the raw latitude value from a FullPositionVector object.
TransmissionState getTransmissionState(const TransmissionAndSpeed &speed)
Get the transmission state object from a TransmissionAndSpeed object.