RoboidControl-cpp/Messages/ModelUrlMsg.h

41 lines
1.2 KiB
C++

#pragma once
#include "IMessage.h"
#include "Thing.h"
namespace RoboidControl {
/// @brief Message for communicating the URL for a model of the thing
class ModelUrlMsg : public IMessage {
public:
/// @brief The message ID
static const unsigned char id = 0x90;
/// @brief The length of the message without the URL string itself
static const unsigned char length = 4;
/// @brief The network ID of the thing
unsigned char networkId;
/// @brief The ID of the thing
unsigned char thingId;
/// @brief The length of the url string, excluding the null terminator
unsigned char urlLength;
/// @brief The url of the model, not terminated by a null character
const char* url;
/// @brief Create a new message for sending
/// @param networkId The network ID of the thing
/// @param thing The thing for which to send the mode URL
ModelUrlMsg(unsigned char networkId, Thing* thing);
/// @copydoc RoboidControl::IMessage::IMessage(char*)
ModelUrlMsg(const char* buffer);
/// @brief Destructor for the message
virtual ~ModelUrlMsg();
/// @copydoc RoboidControl::IMessage::Serialize
virtual unsigned char Serialize(char* buffer) override;
};
} // namespace RoboidControl