nl::Weave::Profiles::DeviceDescription::DeviceDescriptionClient

#include <src/lib/profiles/device-description/DeviceDescription.h>

用于发出设备描述请求的客户端对象。

摘要

构造函数和析构函数

DeviceDescriptionClient(void)

公共类型

HandleIdentifyResponseFunct)(void *appState, uint64_t nodeId, const IPAddress &nodeAddr, const IdentifyResponseMessage &msg) typedef
void(*
此函数负责处理 IdentityResponse 消息。

公共属性

AppState
void *
应用定义的状态对象。
ExchangeMgr
[只读] 广告交易平台管理员对象
FabricState
[只读] Fabric 状态对象
OnIdentifyResponseReceived

公共函数

CancelExchange(void)
取消正在进行的 IdentificationRequest 交换以等待响应。
Init(WeaveExchangeManager *exchangeMgr)
初始化 Device Description 客户端状态。
SendIdentifyRequest(const IPAddress & nodeAddr, const IdentifyRequestMessage & msg)
向特定 IP 地址发送 IdentificationRequest 消息。
SendIdentifyRequest(const IdentifyRequestMessage & msg)
发送广播 IdentificationRequest 消息以发现 Weave 节点。
Shutdown(void)
关闭 Device Description Client。

公共类型

HandleIdentifyResponseFunct

void(* HandleIdentifyResponseFunct)(void *appState, uint64_t nodeId, const IPAddress &nodeAddr, const IdentifyResponseMessage &msg)

此函数负责处理 IdentityResponse 消息。

具体说明
参数
[in] appState
一个指针,指向创建 IdentityRequest 交换上下文时设置的应用定义状态。
[in] nodeId
消息来源的 Weave 节点 ID。
[in] nodeAddr
响应节点的 IP 地址。
[in] msg
对传入的 IdentificationResponse 消息的引用。

公共属性

AppState

void * AppState

应用定义的状态对象。

ExchangeMgr

WeaveExchangeManager * ExchangeMgr

[只读] 广告交易平台管理员对象

FabricState

const WeaveFabricState * FabricState

[只读] Fabric 状态对象

OnIdentifyResponseReceived

HandleIdentifyResponseFunct OnIdentifyResponseReceived

公共函数

CancelExchange

WEAVE_ERROR CancelExchange(
  void
)

取消正在进行的 IdentificationRequest 交换以等待响应。

具体说明
返回值
WEAVE_NO_ERROR

DeviceDescriptionClient

 DeviceDescriptionClient(
  void
)

Init

WEAVE_ERROR Init(
  WeaveExchangeManager *exchangeMgr
)

初始化 Device Description 客户端状态。

param[in] tradeMgr 指向 Weave Exchange Manager 的指针。

具体说明
返回值
WEAVE_ERROR_INCORRECT_STATE
当远程被动集合服务器已注册时。
WEAVE_NO_ERROR
成功时。

SendIdentifyRequest

WEAVE_ERROR SendIdentifyRequest(
  const IPAddress & nodeAddr,
  const IdentifyRequestMessage & msg
)

向特定 IP 地址发送 IdentificationRequest 消息。

具体说明
参数
[in] nodeAddr
对要查询的 Weave 节点的 IP 地址的引用。
[in] msg
对要发送的 IdentificationRequest 消息的引用。
返回值
WEAVE_ERROR_NO_MEMORY
分配数据包缓冲区的交换上下文失败。
WEAVE_NO_ERROR
成功时。
other
其他 Weave 或平台特定错误代码,表示发生错误,导致无法发送 IdentificationRequest。

SendIdentifyRequest

WEAVE_ERROR SendIdentifyRequest(
  const IdentifyRequestMessage & msg
)

发送广播 IdentificationRequest 消息以发现 Weave 节点。

具体说明
参数
[in] msg
对要发送的 IdentificationRequest 消息的引用。

关停

WEAVE_ERROR Shutdown(
  void
)

关闭 Device Description Client。

此函数会关闭所有活跃的交换上下文并重置指针。您可以通过再次调用 Init 方法来重复使用该对象。

具体说明
返回值
WEAVE_NO_ERROR