give the No-Op message it's own class
This commit is contained in:
parent
be4064bb14
commit
b6e080f7b4
|
@ -79,20 +79,30 @@ struct MessageData
|
||||||
/**
|
/**
|
||||||
* @brief Initialize MessageData with the appropriate Label
|
* @brief Initialize MessageData with the appropriate Label
|
||||||
* @param l Label
|
* @param l Label
|
||||||
*
|
|
||||||
* While null messages (label = 0) are not present in the API spec., allow their IO,
|
|
||||||
* perhaps to act as a "ping/echo" to detect emulated devices.
|
|
||||||
*/
|
*/
|
||||||
MessageData(uint8_t l = 0) : label(l) {};
|
MessageData(uint8_t l) : label(l) {};
|
||||||
|
|
||||||
size_t streamSize() const override { return 0; };
|
|
||||||
void iStream(std::shared_ptr<bufferstream>) override {};
|
|
||||||
void oStream(std::shared_ptr<bufferstream>) const override{};
|
|
||||||
|
|
||||||
const uint8_t label; //!< Message ID label (OpCode)
|
const uint8_t label; //!< Message ID label (OpCode)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief No Op message (Label = 0, no data)
|
||||||
|
*
|
||||||
|
* While null messages (label = 0) are not present in the API spec., allow their IO,
|
||||||
|
* perhaps to act as a "ping/echo" to detect emulated devices.
|
||||||
|
*/
|
||||||
|
struct MsgNoop
|
||||||
|
: public MessageData
|
||||||
|
{
|
||||||
|
MsgNoop() : MessageData(0) {};
|
||||||
|
|
||||||
|
virtual size_t streamSize() const override { return 0; };
|
||||||
|
virtual void iStream(std::shared_ptr<bufferstream>) override {};
|
||||||
|
virtual void oStream(std::shared_ptr<bufferstream>) const override{};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 1. Reprogram Firmware Request (Label = 1, no data)
|
* @brief 1. Reprogram Firmware Request (Label = 1, no data)
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user