2024-12-10 16:56:32 +01:00

39 lines
891 B
C++

#include "Messages.h"
#pragma region IMessage
unsigned char *IMessage::Serialize() { return nullptr; }
bool IMessage::SendMsg(IMessage msg, unsigned char bufferSize) {
return SendMsg(msg.Serialize(), bufferSize);
}
bool IMessage::SendMsg(unsigned char *buffer, unsigned char bufferSize) {
// SendBuffer(buffer, bufferSize);
return false;
}
#pragma endregion
#pragma region Investigate
InvestigateMsg::InvestigateMsg(unsigned char thingId) {
this->networkId = 0;
this->thingId = thingId;
}
unsigned char *InvestigateMsg::Serialize() {
unsigned char *buffer = IMessage::buffer;
buffer[0] = InvestigateMsg::id;
buffer[1] = this->networkId;
buffer[2] = this->thingId;
return buffer;
}
bool InvestigateMsg::Send(unsigned char thingId) {
InvestigateMsg msg = InvestigateMsg(thingId);
return SendMsg(msg, InvestigateMsg::length);
}
// Investiaget
#pragma endregion