nl::Weave::TLV::Debug

此命名空间包含用于调试和日志记录 Weave TLV 的类型和接口。

摘要

类型定义符

DumpWriter)(const char *aFormat,...) typedef
void(*

函数

DecodeTagControl(const TLVTagControl aTagControl)
const char *
使用描述性字符串解码 TLV 代码控件。
DecodeType(const TLVType aType)
const char *
使用描述性字符串解码 TLV 类型。
Dump(const TLVReader & aReader, DumpWriter aWriter)
使用指定写入器,以人类可读的形式转储指定读取器中的 TLV 数据。
DumpHandler(DumpWriter aWriter, const char *aIndent, const TLVReader & aReader, size_t aDepth)
void
使用 aWriter 以人类可读的形式转储 aReader 引用的 TLV 元素。
DumpHandler(const TLVReader & aReader, size_t aDepth, void *aContext)
以人类可读的形式记录指定读取器中的 TLV 数据。
DumpIterator(DumpWriter aWriter, const TLVReader & aReader)
将指定读取器中的 TLV 数据以人类可读的形式记录到指定写入器。

结构体

nl::Weave::TLV::Debug::DumpContext

类型定义符

DumpWriter

void(* DumpWriter)(const char *aFormat,...)

函数

DecodeTagControl

const char * DecodeTagControl(
  const TLVTagControl aTagControl
)

使用描述性字符串解码 TLV 代码控件。

具体说明
参数
[in] aTagControl
要解码以及为其返回描述性字符串的 TLV 标记控件。
返回值
一个指针,指向以 NULL 结尾的字符串,用于描述指定代码控制成功时的情况;否则为 NULL。

DecodeType

const char * DecodeType(
  const TLVType aType
)

使用描述性字符串解码 TLV 类型。

具体说明
参数
[in] aType
要解码以及为其返回描述性字符串的 TLV 类型。
返回值
一个指针,指向在成功时用于描述指定类型的字符串,以 NULL 结尾;否则为 NULL。

转储

WEAVE_ERROR Dump(
  const TLVReader & aReader,
  DumpWriter aWriter
)

使用指定写入器,以人类可读的形式转储指定读取器中的 TLV 数据。

具体说明
参数
[in] aReader
TLV 读取器的只读引用,其中包含要记录的 TLV 数据。
[in] aWriter
用于记录 TLV 读取器的 TLV 数据的转储写入器。
返回值
WEAVE_NO_ERROR
成功时。

DumpHandler

void DumpHandler(
  DumpWriter aWriter,
  const char *aIndent,
  const TLVReader & aReader,
  size_t aDepth
)

使用 aWriter 以人类可读的形式转储 aReader 引用的 TLV 元素。

具体说明
参数
[in] aWriter
用于记录 TLV 数据的写入器。
[in] aIndent
用于将当前深度记录到 TLV 数据的缩进。
[in] aReader
TLV 读取器的只读引用,其中包含要记录的 TLV 数据。
[in] aDepth
TLV 数据的当前深度。

DumpHandler

WEAVE_ERROR DumpHandler(
  const TLVReader & aReader,
  size_t aDepth,
  void *aContext
)

以人类可读的形式记录指定读取器中的 TLV 数据。

具体说明
参数
[in] aReader
TLV 读取器的只读引用,其中包含要记录的 TLV 数据。
[in] aDepth
TLV 数据的当前深度。
[in,out] aContext
指向特定于处理程序的上下文的指针。
返回值
WEAVE_NO_ERROR
成功时。
WEAVE_ERROR_INVALID_ARGUMENT
如果 aContext 为 NULL 或者 aContext->mWriter 为 NULL。

DumpIterator

WEAVE_ERROR DumpIterator(
  DumpWriter aWriter,
  const TLVReader & aReader
)

将指定读取器中的 TLV 数据以人类可读的形式记录到指定写入器。

具体说明
参数
[in] aWriter
用于记录 TLV 数据的写入器。
[in] aReader
TLV 读取器的只读引用,其中包含要记录的 TLV 数据。
返回值
WEAVE_NO_ERROR
无条件。