nl::Weave::DeviceLayer::Internal::DeviceControlServer

#include <src/adaptations/device-layer/include/Weave/DeviceLayer/internal/DeviceControlServer.h>

为 Weave 设备实现 Weave 设备控制配置文件。

摘要

继承

继承自:
  nl::Weave::Profiles::DeviceControl::DeviceControlServer
  nl::Weave::Profiles::DeviceControl::DeviceControlDelegate

公共函数

Init()
IsPairedToAccount() const override
virtual bool
已进行调用以确定设备当前是否与某个账户配对。
IsResetAllowed(uint16_t resetFlags) override
virtual bool
检查是否允许重置指定的配置。
OnConnectionMonitorTimeout(uint64_t peerNodeId, IPAddress peerAddr) override
void
OnFailSafeArmed(void) override
virtual WEAVE_ERROR
表示设备配置防故障已开启。
OnFailSafeDisarmed(void) override
virtual WEAVE_ERROR
表示设备配置防故障报警器已关闭。
OnPlatformEvent(const WeaveDeviceEvent *event)
void
OnRemotePassiveRendezvousDone(void) override
virtual void
表示远程被动 Rendezvous 流程已完成。
OnRemotePassiveRendezvousStarted(void) override
virtual void
表示远程被动 Rendezvous 进程已启动。
OnResetConfig(uint16_t resetFlags) override
virtual WEAVE_ERROR
重置全部或部分设备配置。
OnSystemTestStarted(uint32_t profileId, uint32_t testId) override
virtual WEAVE_ERROR
启动指定的系统测试。
OnSystemTestStopped(void) override
virtual WEAVE_ERROR
停止正在进行的系统测试。
ShouldCloseConBeforeResetConfig(uint16_t resetFlags) override
virtual bool
确定在重置配置之前是否应关闭服务器连接(如果存在)。
WillCloseRemotePassiveRendezvous(void) override
virtual void
准备阻止 Remote Passive Rendezvous。
WillStartRemotePassiveRendezvous(void) override
virtual WEAVE_ERROR
为远程被动 Rendezvous 做准备。

受保护的函数

DeviceControlServer()=default
DeviceControlServer(const DeviceControlServer &)=delete
DeviceControlServer(const DeviceControlServer &&)=delete
operator=(const DeviceControlServer &)=delete
~DeviceControlServer()=default

公共函数

Init

WEAVE_ERROR Init()

IsPairedToAccount

virtual bool IsPairedToAccount() const override

已进行调用以确定设备当前是否与某个账户配对。

IsResetAllowed

virtual bool IsResetAllowed(
  uint16_t resetFlags
) override

检查是否允许重置指定的配置。

具体说明
参数
[in] resetFlags
指定要重置的配置的标志。
返回值
TRUE
如果允许重置配置,则会发生该错误。
FALSE
则不允许重置配置。

OnConnectionMonitorTimeout

void OnConnectionMonitorTimeout(
  uint64_t peerNodeId,
  IPAddress peerAddr
) override

OnFailSafeArmed

virtual WEAVE_ERROR OnFailSafeArmed(
  void
) override

表示设备配置防故障已开启。

当服务器设备配置故障安全已开启以响应来自客户端的请求时,系统会调用此函数。如果配置过程未能成功完成,故障安全保护功能会自动将设备配置重置为已知状态。

具体说明
返回值
WEAVE_NO_ERROR
成功时。
other
其他 Weave 或平台特定的错误代码,用于指示发生了错误,无法启用故障安全。

OnFailSafeDisarmed

virtual WEAVE_ERROR OnFailSafeDisarmed(
  void
) override

表示设备配置防故障报警器已关闭。

当服务器设备配置故障安全因响应来自客户端的请求而关闭报警器时,系统会调用此函数。配置完成后,客户端将关闭故障安全警报。

具体说明
返回值
WEAVE_NO_ERROR
成功时。
other
其他 Weave 或平台特定的错误代码,用于指明发生了错误,无法使防故障安全报警器关闭。

OnPlatformEvent

void OnPlatformEvent(
  const WeaveDeviceEvent *event
)

OnRemotePassiveRendezvousDone

virtual void OnRemotePassiveRendezvousDone(
  void
) override

表示远程被动 Rendezvous 流程已完成。

OnRemotePassiveRendezvousStarted

virtual void OnRemotePassiveRendezvousStarted(
  void
) override

表示远程被动 Rendezvous 进程已启动。

OnResetConfig

virtual WEAVE_ERROR OnResetConfig(
  uint16_t resetFlags
) override

重置全部或部分设备配置。

此函数的实现应根据重置标志将网络、Weave 结构或服务配置的任意组合重置为已知状态。

具体说明
参数
[in] resetFlags
指定要重置的配置的标志。
返回值
WEAVE_NO_ERROR
成功时。
other
其他 Weave 或平台特定错误代码,表示发生了错误,导致设备无法重置其配置。

OnSystemTestStarted

virtual WEAVE_ERROR OnSystemTestStarted(
  uint32_t profileId,
  uint32_t testId
) override

启动指定的系统测试。

具体说明
参数
[in] profileId
所请求测试的个人资料 ID。
[in] testId
所请求的测试的 ID。
返回值
WEAVE_NO_ERROR
成功时。
other
其他 Weave 或平台特定错误代码,表示发生了错误,导致系统测试无法启动。

OnSystemTestStopped

virtual WEAVE_ERROR OnSystemTestStopped(
  void
) override

停止正在进行的系统测试。

具体说明
返回值
WEAVE_NO_ERROR
成功时。
other
其他 Weave 或平台特定错误代码,表示发生了错误,导致系统测试无法停止。

ShouldCloseConBeforeResetConfig

virtual bool ShouldCloseConBeforeResetConfig(
  uint16_t resetFlags
) override

确定在重置配置之前是否应关闭服务器连接(如果存在)。

此函数用于在处理配置重置请求时查询委托是否符合预期行为。如果服务器连接当前处于活动状态,对此方法的 TRUE 响应将会导致该连接在通过 OnResetConfig 方法触发配置重置之前关闭。

具体说明
参数
[in] resetFlags
指定要重置的配置的标志。
返回值
true
如果需要关闭连接。
false
如果不需要关闭连接。

WillCloseRemotePassiveRendezvous

virtual void WillCloseRemotePassiveRendezvous(
  void
) override

准备阻止 Remote Passive Rendezvous。

另请参阅
WillStartRemotePassiveRendezvous(void)

WillStartRemotePassiveRendezvous

virtual WEAVE_ERROR WillStartRemotePassiveRendezvous(
  void
) override

为远程被动 Rendezvous 做准备。

例如,使 15.4/Thread 网络可联接。

具体说明
返回值
WEAVE_NO_ERROR
成功时。
other
其他 Weave 或平台特定的错误代码,用于指明在准备启动 Remote Passive Rendezvous 时发生错误。

受保护的函数

DeviceControlServer

 DeviceControlServer()=default

DeviceControlServer

 DeviceControlServer(
  const DeviceControlServer &
)=delete

DeviceControlServer

 DeviceControlServer(
  const DeviceControlServer &&
)=delete

运算符=

DeviceControlServer & operator=(
  const DeviceControlServer &
)=delete

~DeviceControlServer

 ~DeviceControlServer()=default