25 explicit NotGSAException(
const std::string& context,
const std::string& details =
"") :
26 NmeaException(context,
"The sentence is not a GSA sentence", details) {}
54 GSA(std::string talkerId,
57 std::array<unsigned int, 12> satelliteIds,
61 std::optional<unsigned int> systemId = std::nullopt
67 GSA& operator=(
GSA&&) noexcept = default;
69 ~
GSA() override = default;
81 unsigned int getMode() const noexcept;
92 double getPdop() const noexcept;
94 double getHdop() const noexcept;
96 double getVdop() const noexcept;
100 std::optional<
unsigned int>
getSystemId() const noexcept;
118 bool operator==(const
GSA& other) const noexcept;
121 char selectionMode_{};
122 unsigned int mode_{};
123 std::array<unsigned int, 12> satelliteIds_{};
127 std::optional<unsigned int> systemId_{};
131 GSA(Message0183 baseMessage,
134 std::array<unsigned int, 12> satelliteIds,
138 std::optional<unsigned int> systemId
141 static std::unique_ptr<GSA> create(std::unique_ptr<Message0183> baseMessage);
142 static std::string composeRaw(
const std::string& talkerId,
145 std::array<unsigned int, 12> satelliteIds,
149 std::optional<unsigned int> systemId);
Defines a base class for NMEA messages, encapsulating common properties and behaviors.
Base exception class for all NMEA library errors.
Represents a parsed NMEA 0183 GSA (GNSS DOP and Active Satellites) sentence.
GSA & operator=(const GSA &)=default
bool hasSystemId() const noexcept
Return whether an optional system ID is present.
GSA(std::string talkerId, char selectionMode, unsigned int mode, std::array< unsigned int, 12 > satelliteIds, double pdop, double hdop, double vdop, std::optional< unsigned int > systemId=std::nullopt)
Construct a GSA message from individual field values.
unsigned int getSatelliteId(size_t index) const noexcept
Get one satellite ID by slot index.
double getVdop() const noexcept
Get VDOP value.
GSA(GSA &&) noexcept=default
std::unique_ptr< nmealib::Message > clone() const override
Create a polymorphic copy of this GSA message.
std::optional< unsigned int > getSystemId() const noexcept
Get optional GNSS system ID.
double getHdop() const noexcept
Get HDOP value.
double getPdop() const noexcept
Get PDOP value.
unsigned int getMode() const noexcept
Get fix dimension mode.
std::array< unsigned int, 12 > getSatelliteIds() const noexcept
Get all 12 satellite ID slots (0 for empty).
char getSelectionMode() const noexcept
Get selection mode indicator.
std::string getStringContent(bool verbose) const noexcept override
Return a human-readable string representation of this message.
Represents an NMEA 0183 sentence.
Registry for message type creators.
Factory for creating typed NMEA 0183 message objects from raw sentence strings.
Exception thrown when a sentence is not a valid GSA sentence.
NotGSAException(const std::string &context, const std::string &details="")
Construct a NotGSAException with context and optional details.