nl:: 編織:: TLV
適用於使用 Weave TLV 格式編碼的資料定義。
總結
簡易的結構化資料 (TLV) 是適用於一般結構化資料的通用編碼方法。它能使用多種常用的 JSON 序列化格式共用許多屬性,同時對線的壓縮效果更大。
列舉 |
|
---|---|
@71
|
列舉 |
@73
|
列舉 |
@74{
|
列舉 |
@75
|
列舉 |
TLVCommonProfiles{
|
列舉 |
TLVElementType
|
列舉 |
TLVFieldSize
|
列舉 |
TLVTagControl
|
列舉 |
TLVTagFields
|
列舉 |
TLVType
|
列舉 可識別 TLV 元素的類型列舉。 |
變數 |
|
---|---|
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,系統會傳回 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:: |
提供統一的讀取/寫入介面,可用於編輯/新增 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
TLVCommonProfile
TLVCommonProfiles
屬性 | |
---|---|
kProfileIdNotSpecified
|
用於指出變數或成員中沒有設定檔 ID。 這與 WeaveProfiles.h 中定義的 kWeaveProfile_NotSpecified 相同。 |
TLVElementType (TLVElementType)
TLVElementType
TLVFieldSize
TLVFieldSize
TLVTagControl
TLVTagControl
TLVTagFields
TLVTagFields
變數
KWeaveTLVCopyChunkSize
const size_t kWeaveTLVCopyChunkSize = 16
將 TLV 元素從讀取器物件複製到寫入器中。
CopyElement() 方法對新的 TLV 元素進行編碼,其類型和值取自 TLVreader 物件。呼叫這個方法時,所提供的讀取器物件應位於來源 TLV 元素中。新編碼元素的類型和內容會與輸入容器相同,但代碼會設為指定的引數。如果提供的元素是 TLV 容器 (結構、陣列或路徑),系統會複製容器的完整內容。
詳細資料 | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
參數 |
|
||||||||||||||||||
傳回值 |
|
sTagSizes
const uint8_t sTagSizes[] = { 0, 1, 2, 4, 2, 4, 6, 8 }
函式
通用廣告代碼
uint64_t CommonTag( uint32_t tagNum )
內容標記
uint64_t ContextTag( uint8_t tagNum )
GetTLVFieldSize
TLVFieldSize GetTLVFieldSize( uint8_t type )
背景資訊標記
bool IsContextTag( uint64_t tag )
如果提供的標記是內容專屬的標記,則傳回 true。
是設定檔標記
bool IsProfileTag( uint64_t tag )
如果提供的代碼為 true,系統會傳回 true,也就是設定檔專屬的代碼。
特殊標記
bool IsSpecialTag( uint64_t tag )
是有效的 LV 類型
bool IsValidTLVType( uint8_t type )
設定檔編號來源標記
uint32_t ProfileIdFromTag( uint64_t tag )
設定檔編號標籤
uint16_t ProfileNumFromTag( uint64_t tag )
設定檔標記
uint64_t ProfileTag( uint32_t profileId, uint32_t tagNum )
從設定檔 ID 和標記編號產生特定設定檔 TLV 標記的 API 表示法。
詳細資料 | |||||
---|---|---|---|---|---|
參數 |
|
||||
傳回 |
64 位元整數,代表代碼。
|
設定檔標記
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 )
代碼編號來源
uint32_t TagNumFromTag( uint64_t tag )
傳回 TLV 代碼中的代碼編號。
詳細資料 | |||
---|---|---|---|
參數 |
|
||
傳回 |
相關聯的標記編號。
|
IsProfileTag() 和 IsContextTag()