nl:: Weave:: Profiles:: ReferencedTLVData
#include <src/lib/profiles/common/WeaveMessage.h>
Similarly, we need to be able to represent a big old blob of TLV data.
Summary
Inheritance
Inherits from: nl::Weave::Profiles::RetainedPacketBuffer
Constructors and Destructors |
|
---|---|
ReferencedTLVData(void)
-------------- definitions for TLV data --------------
|
Public types |
|
---|---|
TLVWriteCallback)(TLV::TLVWriter &aWriter, void *aAppState)
|
typedefvoid(*
|
Public attributes |
|
---|---|
theData
|
uint8_t *
|
theLength
|
uint16_t
|
theMaxLength
|
uint16_t
|
Public functions |
|
---|---|
free(void)
|
void
Free a ReferencedTLVData object, which is to say, undefine it.
|
init(System::PacketBuffer *aBuffer)
|
Initialize the ReferencedTLVData object given a PacketBuffer.
|
init(MessageIterator & i)
|
Initialize a ReferencedTLVData object given a MessageIterator.
|
init(uint16_t aLength, uint16_t aMaxLength, uint8_t *aByteString)
|
Initialize a ReferencedTLVObject given a byte string.
|
init(TLVWriteCallback aWriteCallback, void *anAppState)
|
Initialize a RefererencedTLVData object given a callback function.
|
isEmpty(void)
|
bool
Check if a ReferencedTLVData object has anything in it.
|
isFree(void)
|
bool
Check if a ReferencedTLVData object is "free", i.e.
|
operator==(const ReferencedTLVData &) const
|
bool
Check a ReferencedTLVData object against another for equality.
|
pack(System::PacketBuffer *buff)
|
Pack a ReferencedTLVData object directly into a PacketBuffer.
|
pack(MessageIterator & i, uint32_t maxLen)
|
|
packedLength(void)
|
uint16_t
Return the data length assuming that the object has been packed into a buffer.
|
Public static functions |
|
---|---|
parse(System::PacketBuffer *buff, ReferencedTLVData & aTarget)
|
Parse a ReferencedTLVData object from a supplied PacketBuffer.
|
parse(MessageIterator & i, ReferencedTLVData & aTarget)
|
Parse a ReferencedTLVData object from a supplied MessageIterator.
|
Public types
TLVWriteCallback
void(* TLVWriteCallback)(TLV::TLVWriter &aWriter, void *aAppState)
Public attributes
theData
uint8_t * theData
theLength
uint16_t theLength
theMaxLength
uint16_t theMaxLength
Public functions
ReferencedTLVData
ReferencedTLVData( void )
init
WEAVE_ERROR init( System::PacketBuffer *aBuffer )
Initialize the ReferencedTLVData object given a PacketBuffer.
Initialize a ReferencedTLVData object given a buffer full of TLV. This assumes that the buffer ONLY contains TLV.
Details | |||
---|---|---|---|
Parameters |
|
||
Return Values |
|
init
WEAVE_ERROR init( MessageIterator & i )
Initialize a ReferencedTLVData object given a MessageIterator.
Initialize a ReferencedTLVData object given a MessageIterator. In this case, the TLV is that last portion of the buffer and we pass in a message iterator that's pointing to it.
Details | |||
---|---|---|---|
Parameters |
|
||
Return Values |
|
init
WEAVE_ERROR init( uint16_t aLength, uint16_t aMaxLength, uint8_t *aByteString )
Initialize a ReferencedTLVObject given a byte string.
Initialize ReferencedTLVData object with a byte string containing TLV. This initializer is the one we use if there's no PacketrBuffer because we're creating one of these to pack and send.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
init
WEAVE_ERROR init( TLVWriteCallback aWriteCallback, void *anAppState )
Initialize a RefererencedTLVData object given a callback function.
Initialize a ReferencedTLVData object. Instead of explicitly supplying the data, this version provides function, the write callback, and a reference object, which will be passed to it, along with a TLVWriter object, when the referenced data is supposed to be packed and sent. The signature of that callback is:
typedef void (*TLVWriteCallback)(TLV::TLVWriter &aWriter, void *aAppState);
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
isEmpty
bool isEmpty( void )
Check if a ReferencedTLVData object has anything in it.
There are two possible ways such an object could "have" something. Either it could have 0 length OR it could have no write callback.
Details | |
---|---|
Returns |
true if the data set has 0 length or there's no write callback in hand, false otherwise.
|
isFree
bool isFree( void )
Check if a ReferencedTLVData object is "free", i.e.
undefined.
Details | |
---|---|
Returns |
true if the object is undefined, false otherwise.
|
operator==
bool operator==( const ReferencedTLVData & ) const
Check a ReferencedTLVData object against another for equality.
Note that this only really makes sense in the case of two objects that have actual data in them backed by a buffer or string.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
pack
WEAVE_ERROR pack( System::PacketBuffer *buff )
Pack a ReferencedTLVData object directly into a PacketBuffer.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
a WEAVE_ERROR reflecting the success of the underlying pack call.
|
pack
WEAVE_ERROR pack( MessageIterator & i, uint32_t maxLen )
packedLength
uint16_t packedLength( void )
Return the data length assuming that the object has been packed into a buffer.
Details | |
---|---|
Returns |
the integer length of the packed data.
|
Public static functions
parse
WEAVE_ERROR parse( System::PacketBuffer *buff, ReferencedTLVData & aTarget )
Parse a ReferencedTLVData object from a supplied PacketBuffer.
Parse a ReferencedTLVData object out of an inet buffer (assuming it just contains TLV).
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
a WEAVE_ERROR reflecting the success of the underlying parse call.
|
parse
WEAVE_ERROR parse( MessageIterator & i, ReferencedTLVData & aTarget )
Parse a ReferencedTLVData object from a supplied MessageIterator.
Parse a ReferenceTLVData object from a MessageIterator object assumed to be pointing at the TLV portion of a message.
Note that no actual "parsing" is done here since the TLV is left in the buffer and not manipulated at all. This method mainly just sets up the ReferencedTLVData structure for later use.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|