37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
#include "Messages.h"
|
|
|
|
namespace RoboidControl {
|
|
|
|
/// @brief Message providing generic information about a Thing
|
|
class ThingMsg : public IMessage {
|
|
public:
|
|
/// @brief The message ID
|
|
static const unsigned char id = 0x80;
|
|
/// @brief The length of the message
|
|
static const unsigned char length = 5;
|
|
/// @brief The network ID of the thing
|
|
unsigned char networkId;
|
|
/// @brief The ID of the thing
|
|
unsigned char thingId;
|
|
/// @brief The Thing.Type of the thing
|
|
unsigned char thingType;
|
|
/// @brief The parent of the thing in the hierarachy. This is null for root Things
|
|
unsigned char parentId;
|
|
|
|
/// @brief Create a message for sending
|
|
/// @param networkId The network ID of the thing</param>
|
|
/// @param thing The thing
|
|
ThingMsg(unsigned char networkId, Thing* thing);
|
|
// ThingMsg(unsigned char networkId, unsigned char thingId,
|
|
// unsigned char thingType, unsigned char parentId);
|
|
|
|
/// @copydoc RoboidControl::IMessage::IMessage(char*)
|
|
ThingMsg(const char* buffer);
|
|
/// @brief Destructor for the message
|
|
virtual ~ThingMsg();
|
|
|
|
/// @copydoc RoboidControl::IMessage::Serialize
|
|
virtual unsigned char Serialize(char* buffer) override;
|
|
};
|
|
|
|
} // namespace RoboidControl
|