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

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

Implements the Weave Device Control profile for a Weave device.

Summary

Inheritance

Inherits from:
  nl::Weave::Profiles::DeviceControl::DeviceControlServer
  nl::Weave::Profiles::DeviceControl::DeviceControlDelegate

Public functions

Init()
IsPairedToAccount() const override
virtual bool
Called to determine if the device is currently paired to an account.
IsResetAllowed(uint16_t resetFlags) override
virtual bool
Check if resetting the specified configuration is allowed.
OnConnectionMonitorTimeout(uint64_t peerNodeId, IPAddress peerAddr) override
void
OnFailSafeArmed(void) override
virtual WEAVE_ERROR
Indicate that the device configuration fail safe has been armed.
OnFailSafeDisarmed(void) override
virtual WEAVE_ERROR
Indicate that the device configuration fail safe has been disarmed.
OnPlatformEvent(const WeaveDeviceEvent *event)
void
OnRemotePassiveRendezvousDone(void) override
virtual void
Indicates that the Remote Passive Rendezvous process has finished.
OnRemotePassiveRendezvousStarted(void) override
virtual void
Indicates that the Remote Passive Rendezvous process has started.
OnResetConfig(uint16_t resetFlags) override
virtual WEAVE_ERROR
Reset all or part of the device configuration.
OnSystemTestStarted(uint32_t profileId, uint32_t testId) override
virtual WEAVE_ERROR
Start the specified system test.
OnSystemTestStopped(void) override
virtual WEAVE_ERROR
Stop the system test in progress.
ShouldCloseConBeforeResetConfig(uint16_t resetFlags) override
virtual bool
Determine whether a server connection, if present, should be closed prior to a configuration reset.
WillCloseRemotePassiveRendezvous(void) override
virtual void
Prepare to stop Remote Passive Rendezvous.
WillStartRemotePassiveRendezvous(void) override
virtual WEAVE_ERROR
Prepare for a Remote Passive Rendezvous.

Protected functions

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

Public functions

Init

WEAVE_ERROR Init()

IsPairedToAccount

virtual bool IsPairedToAccount() const override

Called to determine if the device is currently paired to an account.

IsResetAllowed

virtual bool IsResetAllowed(
  uint16_t resetFlags
) override

Check if resetting the specified configuration is allowed.

Details
Parameters
[in] resetFlags
The flags specifying which configuration to reset.
Return Values
TRUE
if resetting the configuration is allowed.
FALSE
if resetting the configuration is not allowed.

OnConnectionMonitorTimeout

void OnConnectionMonitorTimeout(
  uint64_t peerNodeId,
  IPAddress peerAddr
) override

OnFailSafeArmed

virtual WEAVE_ERROR OnFailSafeArmed(
  void
) override

Indicate that the device configuration fail safe has been armed.

This function is called when the server device configuration fail safe has been armed in response to a request from the client. The fail safe automatically resets the device configuration to a known state should the configuration process fail to complete successfully.

Details
Return Values
WEAVE_NO_ERROR
On success.
other
Other Weave or platform-specific error codes indicating that an error occurred preventing the fail safe from arming.

OnFailSafeDisarmed

virtual WEAVE_ERROR OnFailSafeDisarmed(
  void
) override

Indicate that the device configuration fail safe has been disarmed.

This function is called when the server device configuration fail safe has been disarmed in response to a request from the client. The client will disarm the fail safe after configuration has completed.

Details
Return Values
WEAVE_NO_ERROR
On success.
other
Other Weave or platform-specific error codes indicating that an error occurred preventing the fail safe from disarming.

OnPlatformEvent

void OnPlatformEvent(
  const WeaveDeviceEvent *event
)

OnRemotePassiveRendezvousDone

virtual void OnRemotePassiveRendezvousDone(
  void
) override

Indicates that the Remote Passive Rendezvous process has finished.

OnRemotePassiveRendezvousStarted

virtual void OnRemotePassiveRendezvousStarted(
  void
) override

Indicates that the Remote Passive Rendezvous process has started.

OnResetConfig

virtual WEAVE_ERROR OnResetConfig(
  uint16_t resetFlags
) override

Reset all or part of the device configuration.

This function's implementation is expected to reset any combination of network, Weave fabric, or service configurations to a known state, according to the reset flags.

Details
Parameters
[in] resetFlags
The flags specifying which configuration to reset.
Return Values
WEAVE_NO_ERROR
On success.
other
Other Weave or platform-specific error codes indicating that an error occurred preventing the device from resetting its configuration.

OnSystemTestStarted

virtual WEAVE_ERROR OnSystemTestStarted(
  uint32_t profileId,
  uint32_t testId
) override

Start the specified system test.

Details
Parameters
[in] profileId
The ID of the profile of the requested test.
[in] testId
The ID of the requested test.
Return Values
WEAVE_NO_ERROR
On success.
other
Other Weave or platform-specific error codes indicating that an error occurred preventing the starting of the system test.

OnSystemTestStopped

virtual WEAVE_ERROR OnSystemTestStopped(
  void
) override

Stop the system test in progress.

Details
Return Values
WEAVE_NO_ERROR
On success.
other
Other Weave or platform-specific error codes indicating that an error occurred preventing the stopping of the system test.

ShouldCloseConBeforeResetConfig

virtual bool ShouldCloseConBeforeResetConfig(
  uint16_t resetFlags
) override

Determine whether a server connection, if present, should be closed prior to a configuration reset.

This function is used to query the delegate for the desired behavior when processing a configuration reset request. If a server connection is currently active, a TRUE response to this method will cause that connection to be closed prior to the configuration reset being triggered via the OnResetConfig method.

Details
Parameters
[in] resetFlags
The flags specifying which configuration to reset.
Return Values
true
if the connection needs to be closed.
false
if the connection does not need to be closed.

WillCloseRemotePassiveRendezvous

virtual void WillCloseRemotePassiveRendezvous(
  void
) override

Prepare to stop Remote Passive Rendezvous.

See also:
WillStartRemotePassiveRendezvous(void)

WillStartRemotePassiveRendezvous

virtual WEAVE_ERROR WillStartRemotePassiveRendezvous(
  void
) override

Prepare for a Remote Passive Rendezvous.

For example, make the 15.4/Thread network joinable.

Details
Return Values
WEAVE_NO_ERROR
On success.
other
Other Weave or platform-specific error codes indicating that an error occurred while preparing to start Remote Passive Rendezvous.

Protected functions

DeviceControlServer

 DeviceControlServer()=default

DeviceControlServer

 DeviceControlServer(
  const DeviceControlServer &
)=delete

DeviceControlServer

 DeviceControlServer(
  const DeviceControlServer &&
)=delete

operator=

DeviceControlServer & operator=(
  const DeviceControlServer &
)=delete

~DeviceControlServer

 ~DeviceControlServer()=default