nl:: Weave:: TLV
處理以 Weave TLV 格式編碼的資料的定義。
摘要
Weave TLV 是簡易結構化資料的通用編碼方法。它與常用的 JSON 序列化格式共用許多屬性,同時讓線路更為精簡。
列舉 |
|
---|---|
@71
|
列舉 |
@73
|
列舉 |
@74{
|
列舉 |
@75
|
列舉 |
TLVCommonProfiles{
|
列舉 |
TLVElementType
|
列舉 |
TLVFieldSize
|
列舉 |
TLVTagControl
|
列舉 |
TLVTagFields
|
列舉 |
TLVType
|
列舉 識別 TLV 元素類型的列舉。 |
Variables |
|
---|---|
kWeaveTLVCopyChunkSize = 16
|
const size_t
將讀取器物件的 TLV 元素複製到寫入者。
|
sTagSizes = { 0, 1, 2, 4, 2, 4, 6, 8 }[]
|
const uint8_t
|
函式 |
|
---|---|
CommonTag(uint32_t tagNum)
|
uint64_t
產生常見設定檔 TLV 標記的 API 表示法。
|
ContextTag(uint8_t tagNum)
|
uint64_t
產生情境專屬 TLV 標記的 API 表示法。
|
GetTLVFieldSize(uint8_t type)
|
TLVFieldSize
|
IsContextTag(uint64_t tag)
|
bool
如果提供的標記是內容專屬的標記,則傳回 true。
|
IsProfileTag(uint64_t tag)
|
bool
傳回的代碼的 true 是設定檔專屬標記。
|
IsSpecialTag(uint64_t tag)
|
bool
|
IsValidTLVType(uint8_t type)
|
bool
如果指定的 TLV 類型有效,則傳回 true。
|
ProfileIdFromTag(uint64_t tag)
|
uint32_t
從 TLV 標記傳回個人資料 ID。
|
ProfileNumFromTag(uint64_t tag)
|
uint16_t
從 TLV 標記傳回設定檔編號。
|
ProfileTag(uint32_t profileId, uint32_t tagNum)
|
uint64_t
根據設定檔 ID 和標記編號產生設定檔專用 TLV 標記的 API 表示法。
|
ProfileTag(uint16_t vendorId, uint16_t profileNum, uint32_t tagNum)
|
uint64_t
根據供應商 ID、設定檔編號和代碼編號產生設定檔專用 TLV 標記的 API 表示法。
|
TLVFieldSizeToBytes(TLVFieldSize fieldSize)
|
uint8_t
|
TLVTypeHasLength(uint8_t type)
|
bool
如果指定的 TLV 類型表示有相關聯的長度欄位,則傳回 true。
|
TLVTypeHasValue(uint8_t type)
|
bool
如果指定的 TLV 類型暗示有相關聯的值欄位,則傳回 true。
|
TLVTypeIsContainer(uint8_t type)
|
bool
如果指定的 TLV 類型是容器,則傳回 true。
|
TLVTypeIsString(uint8_t type)
|
bool
如果指定的 TLV 類型為 UTF8 或位元組字串,則傳回 true。
|
TagNumFromTag(uint64_t tag)
|
uint32_t
傳回 TLV 標記中的標記編號。
|
VendorIdFromTag(uint64_t tag)
|
uint16_t
從 TLV 標記傳回供應商 ID。
|
類別 |
|
---|---|
nl:: |
|
nl:: |
|
nl:: |
針對以 Weave TLV 格式編碼的資料提供記憶體效率剖析器。 |
nl:: |
提供統一的 Reader/Writer 介面,方便在 TLV 編碼中編輯/新增/刪除元素。 |
nl:: |
提供記憶體高效編碼器,以便以 Weave TLV 格式寫入資料。 |
nl:: |
WeaveCircularTLVBuffer 可為 nl::Weave::TLV::TLVWriter 和 nl::Weave::TLVTLVReader 提供循環儲存。 |
命名空間 |
|
---|---|
nl:: |
這個命名空間包含用於偵錯與記錄 Weave TLV 的類型和介面。 |
nl:: |
這個命名空間包括用於管理及使用 Weave TLV 的類型和公用程式介面。 |
列舉
@71
@71
@73
@73
75 歲
@75
TLVCommonProfiles
TLVCommonProfiles
屬性 | |
---|---|
kProfileIdNotSpecified
|
用來表示變數或成員中沒有設定檔 ID。 基本上這與 WeaveProfiles.h 中定義的 kWeaveProfile_NotSpecified 區別 |
TLVElementType
TLVElementType
TLVFieldSize
TLVFieldSize
TLVTagControl
TLVTagControl
TLVTagFields
TLVTagFields
Variables
kWeaveTLVCopyChunkSize
const size_t kWeaveTLVCopyChunkSize = 16
將讀取器物件的 TLV 元素複製到寫入者。
CopyElement() 方法會將類型與值從 TLVReader 物件取得的新 TLV 元素編碼。呼叫方法時,提供的讀取器物件應置於來源 TLV 元素上。新編碼元素的類型和內容會與輸入容器相同,但標記會設為指定的引數。如果提供的元素是 TLV 容器 (結構、陣列或路徑),系統會複製容器的所有內容。
詳細說明 | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||||||||
傳回值 |
|
sTagSizes
const uint8_t sTagSizes[] = { 0, 1, 2, 4, 2, 4, 6, 8 }
函式
CommonTag
uint64_t CommonTag( uint32_t tagNum )
ContextTag
uint64_t ContextTag( uint8_t tagNum )
GetTLVFieldSize
TLVFieldSize GetTLVFieldSize( uint8_t type )
IsContextTag
bool IsContextTag( uint64_t tag )
如果提供的標記是內容專屬的標記,則傳回 true。
IsProfileTag
bool IsProfileTag( uint64_t tag )
傳回的代碼的 true 是設定檔專屬標記。
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 )
根據設定檔 ID 和標記編號產生設定檔專用 TLV 標記的 API 表示法。
詳細說明 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回 |
代表標記的 64 位元整數。
|
ProfileTag
uint64_t ProfileTag( uint16_t vendorId, uint16_t profileNum, uint32_t tagNum )
根據供應商 ID、設定檔編號和代碼編號產生設定檔專用 TLV 標記的 API 表示法。
詳細說明 | |||||||
---|---|---|---|---|---|---|---|
參數 |
|
||||||
傳回 |
代表標記的 64 位元整數。
|
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 )
傳回 TLV 標記中的標記編號。
詳細說明 | |||
---|---|---|---|
參數 |
|
||
傳回 |
相關的代碼編號。
|
IsProfileTag() 和 IsContextTag()