nl:: Weave:: TLV
Definitions for working with data encoded in Weave TLV format.
Summary
Weave TLV is a generalized encoding method for simple structured data. It shares many properties with the commonly used JSON serialization format while being considerably more compact over the wire.
Enumerations |
|
---|---|
@71
|
enum |
@73
|
enum |
@74{
|
enum |
@75
|
enum |
TLVCommonProfiles{
|
enum |
TLVElementType
|
enum |
TLVFieldSize
|
enum |
TLVTagControl
|
enum |
TLVTagFields
|
enum |
TLVType
|
enum An enumeration identifying the type of a TLV element. |
Variables |
|
---|---|
kWeaveTLVCopyChunkSize = 16
|
const size_t
Copies a TLV element from a reader object into the writer.
|
sTagSizes = { 0, 1, 2, 4, 2, 4, 6, 8 }[]
|
const uint8_t
|
Functions |
|
---|---|
CommonTag(uint32_t tagNum)
|
uint64_t
Generates the API representation of a common profile TLV tag.
|
ContextTag(uint8_t tagNum)
|
uint64_t
Generates the API representation for of context-specific TLV tag.
|
GetTLVFieldSize(uint8_t type)
|
TLVFieldSize
|
IsContextTag(uint64_t tag)
|
bool
Returns true if the supplied tag is a context-specific tag.
|
IsProfileTag(uint64_t tag)
|
bool
Returns true of the supplied tag is a profile-specific tag.
|
IsSpecialTag(uint64_t tag)
|
bool
|
IsValidTLVType(uint8_t type)
|
bool
Returns true if the specified TLV type is valid.
|
ProfileIdFromTag(uint64_t tag)
|
uint32_t
Returns the profile id from a TLV tag.
|
ProfileNumFromTag(uint64_t tag)
|
uint16_t
Returns the profile number from a TLV tag.
|
ProfileTag(uint32_t profileId, uint32_t tagNum)
|
uint64_t
Generates the API representation of a profile-specific TLV tag from a profile id and tag number.
|
ProfileTag(uint16_t vendorId, uint16_t profileNum, uint32_t tagNum)
|
uint64_t
Generates the API representation of a profile-specific TLV tag from a vendor id, profile number and tag number.
|
TLVFieldSizeToBytes(TLVFieldSize fieldSize)
|
uint8_t
|
TLVTypeHasLength(uint8_t type)
|
bool
Returns true if the specified TLV type implies the presence of an associated length field.
|
TLVTypeHasValue(uint8_t type)
|
bool
Returns true if the specified TLV type implies the presence of an associated value field.
|
TLVTypeIsContainer(uint8_t type)
|
bool
Returns true if the specified TLV type is a container.
|
TLVTypeIsString(uint8_t type)
|
bool
Returns true if the specified TLV type is a UTF8 or byte string.
|
TagNumFromTag(uint64_t tag)
|
uint32_t
Returns the tag number from a TLV tag.
|
VendorIdFromTag(uint64_t tag)
|
uint16_t
Returns the vendor id from a TLV tag.
|
Classes |
|
---|---|
nl:: |
|
nl:: |
|
nl:: |
Provides a memory efficient parser for data encoded in Weave TLV format. |
nl:: |
Provides a unified Reader/Writer interface for editing/adding/deleting elements in TLV encoding. |
nl:: |
Provides a memory efficient encoder for writing data in Weave TLV format. |
nl:: |
WeaveCircularTLVBuffer provides circular storage for the nl::Weave::TLV::TLVWriter and nl::Weave::TLVTLVReader. |
Namespaces |
|
---|---|
nl:: |
This namespace includes types and interfaces for debugging and logging Weave TLV. |
nl:: |
This namespace includes types and utility interfaces for managing and working with Weave TLV. |
Enumerations
@71
@71
@73
@73
@74
@74
Properties | |
---|---|
AnonymousTag
|
A value signifying a TLV element that has no tag (i.e. an anonymous element). |
@75
@75
TLVCommonProfiles
TLVCommonProfiles
Properties | |
---|---|
kProfileIdNotSpecified
|
Used to indicate the absence of a profile id in a variable or member. This is essentially the same as kWeaveProfile_NotSpecified defined in WeaveProfiles.h |
TLVElementType
TLVElementType
TLVFieldSize
TLVFieldSize
TLVTagControl
TLVTagControl
TLVTagFields
TLVTagFields
Variables
kWeaveTLVCopyChunkSize
const size_t kWeaveTLVCopyChunkSize = 16
Copies a TLV element from a reader object into the writer.
The CopyElement() method encodes a new TLV element whose type and value are taken from a TLVReader object. When the method is called, the supplied reader object is expected to be positioned on the source TLV element. The newly encoded element will have the same type and contents as the input container, however the tag will be set to the specified argument. If the supplied element is a TLV container (structure, array or path), the entire contents of the container will be copied.
Details | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||||||||||||
Return Values |
|
sTagSizes
const uint8_t sTagSizes[] = { 0, 1, 2, 4, 2, 4, 6, 8 }
Functions
CommonTag
uint64_t CommonTag( uint32_t tagNum )
Generates the API representation of a common profile TLV tag.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A 64-bit integer representing the tag.
|
ContextTag
uint64_t ContextTag( uint8_t tagNum )
Generates the API representation for of context-specific TLV tag.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A 64-bit integer representing the tag.
|
GetTLVFieldSize
TLVFieldSize GetTLVFieldSize( uint8_t type )
IsContextTag
bool IsContextTag( uint64_t tag )
Returns true if the supplied tag is a context-specific tag.
IsProfileTag
bool IsProfileTag( uint64_t tag )
Returns true of the supplied tag is a profile-specific tag.
IsSpecialTag
bool IsSpecialTag( uint64_t tag )
IsValidTLVType
bool IsValidTLVType( uint8_t type )
ProfileIdFromTag
uint32_t ProfileIdFromTag( uint64_t tag )
ProfileNumFromTag
uint16_t ProfileNumFromTag( uint64_t tag )
ProfileTag
uint64_t ProfileTag( uint32_t profileId, uint32_t tagNum )
Generates the API representation of a profile-specific TLV tag from a profile id and tag number.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
A 64-bit integer representing the tag.
|
ProfileTag
uint64_t ProfileTag( uint16_t vendorId, uint16_t profileNum, uint32_t tagNum )
Generates the API representation of a profile-specific TLV tag from a vendor id, profile number and tag number.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
A 64-bit integer representing the tag.
|
TLVFieldSizeToBytes
uint8_t TLVFieldSizeToBytes( TLVFieldSize fieldSize )
TLVTypeHasLength
bool TLVTypeHasLength( uint8_t type )
TLVTypeHasValue
bool TLVTypeHasValue( uint8_t type )
TLVTypeIsContainer
bool TLVTypeIsContainer( uint8_t type )
TLVTypeIsString
bool TLVTypeIsString( uint8_t type )
TagNumFromTag
uint32_t TagNumFromTag( uint64_t tag )
Returns the tag number from a TLV tag.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
The associated tag number.
|
IsProfileTag() and IsContextTag()