nl:: Weave:: TLV
Definitionen für die Arbeit mit Daten, die im Weave-Format TLV codiert sind
Zusammenfassung
Weave TLV ist eine allgemeine Codierungsmethode für einfache strukturierte Daten. Es hat viele Eigenschaften mit dem häufig verwendeten JSON-Serialisierungsformat, ist aber über die Leitung deutlich kompakter.
Aufzählungen |
|
---|---|
@71
|
enum |
@73
|
enum |
@74{
|
enum |
@75
|
enum |
TLVCommonProfiles{
|
enum |
TLVElementType
|
enum |
TLVFieldSize
|
enum |
TLVTagControl
|
enum |
TLVTagFields
|
enum |
TLVType
|
enum Eine Aufzählung, die den Typ eines TLV-Elements identifiziert. |
Variablen |
|
---|---|
kWeaveTLVCopyChunkSize = 16
|
const size_t
Kopiert ein TLV-Element aus einem Leseobjekt in den Writer.
|
sTagSizes = { 0, 1, 2, 4, 2, 4, 6, 8 }[]
|
const uint8_t
|
Funktionen |
|
---|---|
CommonTag(uint32_t tagNum)
|
uint64_t
Generiert die API-Darstellung eines gemeinsamen TLV-Profils-Tags.
|
ContextTag(uint8_t tagNum)
|
uint64_t
Erzeugt die API-Darstellung für ein kontextspezifisches TLV-Tag.
|
GetTLVFieldSize(uint8_t type)
|
TLVFieldSize
|
IsContextTag(uint64_t tag)
|
bool
Gibt "true" zurück, wenn das angegebene Tag ein kontextspezifisches Tag ist.
|
IsProfileTag(uint64_t tag)
|
bool
Gibt "true" für das angegebene Tag als profilspezifisches Tag zurück.
|
IsSpecialTag(uint64_t tag)
|
bool
|
IsValidTLVType(uint8_t type)
|
bool
Gibt „true“ zurück, wenn der angegebene TLV-Typ gültig ist.
|
ProfileIdFromTag(uint64_t tag)
|
uint32_t
Gibt die Profil-ID aus einem TLV-Tag zurück.
|
ProfileNumFromTag(uint64_t tag)
|
uint16_t
Gibt die Profilnummer aus einem TLV-Tag zurück.
|
ProfileTag(uint32_t profileId, uint32_t tagNum)
|
uint64_t
Generiert die API-Darstellung eines profilspezifischen TLV-Tags aus einer Profil-ID und einer Tag-Nummer.
|
ProfileTag(uint16_t vendorId, uint16_t profileNum, uint32_t tagNum)
|
uint64_t
Generiert die API-Darstellung eines profilspezifischen TLV-Tags aus einer Anbieter-ID, einer Profilnummer und einer Tag-Nummer.
|
TLVFieldSizeToBytes(TLVFieldSize fieldSize)
|
uint8_t
|
TLVTypeHasLength(uint8_t type)
|
bool
Gibt „true“ zurück, wenn der angegebene TLV-Typ das Vorhandensein eines zugehörigen Längenfelds impliziert.
|
TLVTypeHasValue(uint8_t type)
|
bool
Gibt „true“ zurück, wenn der angegebene TLV-Typ das Vorhandensein eines verknüpften Wertefelds impliziert.
|
TLVTypeIsContainer(uint8_t type)
|
bool
Gibt „true“ zurück, wenn der angegebene TLV-Typ ein Container ist.
|
TLVTypeIsString(uint8_t type)
|
bool
Gibt „true“ zurück, wenn der angegebene TLV-Typ ein UTF8- oder Bytestring ist.
|
TagNumFromTag(uint64_t tag)
|
uint32_t
Gibt die Tag-Nummer aus einem TLV-Tag zurück.
|
VendorIdFromTag(uint64_t tag)
|
uint16_t
Gibt die Anbieter-ID aus einem TLV-Tag zurück.
|
Kurse |
|
---|---|
nl:: |
|
nl:: |
|
nl:: |
Bietet einen speichereffizienten Parser für im Weave-TLV-Format codierte Daten. |
nl:: |
Bietet eine einheitliche Reader/Writer-Schnittstelle zum Bearbeiten, Hinzufügen und Löschen von Elementen in TLV-Codierung. |
nl:: |
Bietet einen speichereffizienten Encoder zum Schreiben von Daten im Weave-TLV-Format. |
nl:: |
WeaveCircularTLVBuffer bietet kreisförmigen Speicher für nl::Weave::TLV::TLVWriter und nl::Weave::TLVTLVReader. |
Namespaces |
|
---|---|
nl:: |
Dieser Namespace enthält Typen und Schnittstellen für die Fehlerbehebung und das Logging von Weave TLV. |
nl:: |
Dieser Namespace enthält Typen und Dienstprogrammschnittstellen für die Verwaltung und Arbeit mit Weave TLV. |
Aufzählungen
@71
@71
@73
@73
@74
@74
Attribute | |
---|---|
AnonymousTag
|
Ein Wert, der ein TLV-Element angibt, das kein Tag hat (d.h. anonymes Element. |
@75
@75
TLVCommonProfiles
TLVCommonProfiles
Attribute | |
---|---|
kProfileIdNotSpecified
|
Wird verwendet, um das Fehlen einer Profil-ID in einer Variablen oder einem Element anzugeben. Dies entspricht im Wesentlichen dem Wert kWeaveProfile_Not Specific, der in WeaveProfiles.h definiert ist. |
TLVElementType
TLVElementType
TLVFieldSize
TLVFieldSize
TLVTagControl
TLVTagControl
TLVTagFields
TLVTagFields
Variablen
kWeaveTLVCopyChunkSize
const size_t kWeaveTLVCopyChunkSize = 16
Kopiert ein TLV-Element aus einem Leseobjekt in den Writer.
Die CopyElement()-Methode codiert ein neues TLV-Element, dessen Typ und Wert aus einem TLVReader-Objekt stammen. Beim Aufruf der Methode wird erwartet, dass das bereitgestellte Reader-Objekt im TLV-Quellelement positioniert ist. Das neu codierte Element hat denselben Typ und denselben Inhalt wie der Eingabecontainer. Das Tag wird jedoch auf das angegebene Argument festgelegt. Wenn das bereitgestellte Element ein TLV-Container (Struktur, Array oder Pfad) ist, wird der gesamte Inhalt des Containers kopiert.
Details | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameter |
|
||||||||||||||||||
Rückgabewerte |
|
sTagSizes
const uint8_t sTagSizes[] = { 0, 1, 2, 4, 2, 4, 6, 8 }
Funktionen
CommonTag
uint64_t CommonTag( uint32_t tagNum )
Generiert die API-Darstellung eines gemeinsamen TLV-Profils-Tags.
Details | |||
---|---|---|---|
Parameter |
|
||
Rückgabe |
Eine 64-Bit-Ganzzahl, die das Tag darstellt.
|
ContextTag
uint64_t ContextTag( uint8_t tagNum )
Erzeugt die API-Darstellung für ein kontextspezifisches TLV-Tag.
Details | |||
---|---|---|---|
Parameter |
|
||
Rückgabe |
Eine 64-Bit-Ganzzahl, die das Tag darstellt.
|
GetTLVFieldSize
TLVFieldSize GetTLVFieldSize( uint8_t type )
IsContextTag
bool IsContextTag( uint64_t tag )
Gibt "true" zurück, wenn das angegebene Tag ein kontextspezifisches Tag ist.
IsProfileTag
bool IsProfileTag( uint64_t tag )
Gibt "true" für das angegebene Tag als profilspezifisches Tag zurück.
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 )
Generiert die API-Darstellung eines profilspezifischen TLV-Tags aus einer Profil-ID und einer Tag-Nummer.
Details | |||||
---|---|---|---|---|---|
Parameter |
|
||||
Rückgabe |
Eine 64-Bit-Ganzzahl, die das Tag darstellt.
|
ProfileTag
uint64_t ProfileTag( uint16_t vendorId, uint16_t profileNum, uint32_t tagNum )
Generiert die API-Darstellung eines profilspezifischen TLV-Tags aus einer Anbieter-ID, einer Profilnummer und einer Tag-Nummer.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameter |
|
||||||
Rückgabe |
Eine 64-Bit-Ganzzahl, die das Tag darstellt.
|
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 )
Gibt die Tag-Nummer aus einem TLV-Tag zurück.
Details | |||
---|---|---|---|
Parameter |
|
||
Rückgabe |
Die zugehörige Tag-Nummer.
|
IsProfileTag() und IsContextTag()