13 enum class ID : uint16_t;
21 virtual ID id()
const = 0;
61 virtual std::ostream&
print(std::ostream& s)
const {
62 s <<
"Print method for message ID " << uint16_t(
id())
63 <<
" is not implemented" << std::endl;
Message(FirmwareVariant v)
Message constructor accepting a FirmwareVariant.
FirmwareVariant getFirmwareVariant() const
Queries the firmware variant the message works with.
std::ostream & operator<<(std::ostream &s, const msp::ID &id)
virtual ByteVectorUptr encode() const
Encode all data into a ByteVector.
FirmwareVariant
Enum of firmware variants.
std::unique_ptr< ByteVector > ByteVectorUptr
virtual ~Message()
Message destructor.
virtual bool decode(const ByteVector &)
Decode message contents from a ByteVector.
virtual std::ostream & print(std::ostream &s) const
void setFirmwareVariant(FirmwareVariant v)
Set the firmware the message should work with.
FirmwareVariant fw_variant