diff --git a/src/MessageType.h b/src/MessageType.h index 935d3c8..6e34c3a 100644 --- a/src/MessageType.h +++ b/src/MessageType.h @@ -6,8 +6,7 @@ namespace aprs { class MessageType { public: - enum Value : uint8_t - { + enum Value : uint8_t { PositionWithoutTimestamp, // = and ! // PositionWithTimestamp, // @ and / // Status, // > @@ -56,12 +55,15 @@ class MessageType { // cppcheck-suppress noExplicitConstructor constexpr MessageType(Value aType) : _value(aType) { } + constexpr bool operator==(MessageType a) const { return _value == a._value; } + constexpr bool operator!=(MessageType a) const { return _value != a._value; } + explicit operator bool() const { return _value != Error; }