This repository has been archived on 2019-06-21. You can view files and clone it, but cannot push or open issues or pull requests.
PixelHub/PixelHub-Client/src/Messages/ErrorMessage.cpp

20 lines
554 B
C++

#pragma once
#include "ErrorMessage.h"
#include "PixelMessage.h"
ErrorMessage::ErrorMessage() : PixelMessage()
{
}
ErrorMessage::ErrorMessage(byte* rawMessage) : PixelMessage(rawMessage)
{
// The position of the start of the message body
void* messageBodyStart = static_cast<void*>(rawMessage + PixelMessage::MESSAGE_HEADER_LENGTH);
ErrorCode = *(static_cast<unsigned int*>(messageBodyStart));
// NOTE: This might cause issues. This constructor probably won't be used
// anyway though
*Message = *(static_cast<char*>(messageBodyStart + 4));
}