in UUID namespace, define for length of a UUID
This commit is contained in:
parent
2ebc026af7
commit
e54bd78929
10
acn/rlp.cpp
10
acn/rlp.cpp
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -31,8 +31,6 @@
|
||||
namespace ACN {
|
||||
namespace RLP {
|
||||
|
||||
#define CID_LENGTH 16
|
||||
|
||||
/**
|
||||
* @brief 2.6.1.2.2. Header Field in Root Layer PDUs
|
||||
*
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
#define UUID_LENGTH 16
|
||||
|
||||
// RFC4122 A Universally Unique IDentifier (UUID) URN Namespace
|
||||
namespace UUID {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user