1 #include <marnav/nmea/checksum.hpp>
2 #include "hex_digit.hpp"
6 checksum_error::checksum_error(uint8_t exp
, uint8_t act
)
10 snprintf(text_
, sizeof(text_
), "checksum error (actual:%02X, expected:%02X)", actual_
,
14 /// Returns the specified checksum as string.
16 /// @param[in] sum The checksum to render as string.
17 /// @return The checksum as string. This string is always two characters.
19 std::string
checksum_to_string(uint8_t sum
)
21 char buf
[3]{detail::hex_digit(sum
>> 4), detail::hex_digit(sum
), '\0'};