1
0
Fork 0

in UUID namespace, define for length of a UUID

This commit is contained in:
Kevin Matz 2021-08-13 10:05:32 -04:00
parent 2ebc026af7
commit e54bd78929
3 changed files with 7 additions and 7 deletions

View File

@ -33,7 +33,7 @@ namespace RLP {
*/
size_t rlp_header::streamSize() const
{
return CID_LENGTH;
return UUID_LENGTH;
}
@ -43,9 +43,9 @@ size_t rlp_header::streamSize() const
*/
void rlp_header::iStream(PDU::Stream stream)
{
uint8_t * buffer = new uint8_t[CID_LENGTH];
stream->read(buffer, CID_LENGTH);
if (stream->gcount() != CID_LENGTH)
uint8_t * buffer = new uint8_t[UUID_LENGTH];
stream->read(buffer, UUID_LENGTH);
if (stream->gcount() != UUID_LENGTH)
stream->setstate(std::ios_base::failbit);
cid = UUID::uuid(buffer);
delete[] buffer;
@ -58,7 +58,7 @@ void rlp_header::iStream(PDU::Stream stream)
*/
void rlp_header::oStream(PDU::Stream stream) const
{
stream->write(cid.bytes(), CID_LENGTH);
stream->write(cid.bytes(), UUID_LENGTH);
}

View File

@ -31,8 +31,6 @@
namespace ACN {
namespace RLP {
#define CID_LENGTH 16
/**
* @brief 2.6.1.2.2. Header Field in Root Layer PDUs
*

View File

@ -27,6 +27,8 @@
#include <cstring>
#include <string>
#define UUID_LENGTH 16
// RFC4122 A Universally Unique IDentifier (UUID) URN Namespace
namespace UUID {