1 #include "protocols/host_server/MsgHostRequest.h"
3 namespace remote
{ namespace protocols
{ namespace host_server
{
5 MsgHostRequest::MsgHostRequest(MsgMoteAddresses
& addresses
, MsgPayload
& message
)
6 : addresses(&addresses
),
11 MsgHostRequest::MsgHostRequest(uint8_t*& buffer
, uint32_t& buflen
)
13 buffer
=this->read(buffer
,buflen
);
17 MsgHostRequest::~MsgHostRequest()
21 delete this->addresses
;
26 uint32_t MsgHostRequest::getLength()
28 return addresses
->getLength() + message
->getLength();
31 uint8_t* MsgHostRequest::write(uint8_t* buffer
, uint32_t& buflen
)
33 buffer
= addresses
->write(buffer
,buflen
);
34 buffer
= message
->write(buffer
,buflen
);
38 uint8_t* MsgHostRequest::read(uint8_t* buffer
, uint32_t& buflen
)
40 addresses
= new MsgMoteAddresses(buffer
,buflen
);
41 message
= new MsgPayload(buffer
,buflen
);
45 void MsgHostRequest::print(FILE* s
)
49 MsgMoteAddresses
& MsgHostRequest::getMoteAddresses()
54 MsgPayload
& MsgHostRequest::getMessage()