nl::Weave::Profiles::NetworkProvisioning::NetworkProvisioningServer

#include <src/lib/profiles/network-provisioning/NetworkProvisioning.h>

Server class for implementing the Network Provisioning profile.

Summary

Inheritance

Inherits from: nl::Weave::WeaveServerBase
Direct Known Subclasses:
  nl::Weave::DeviceLayer::Internal::GenericNetworkProvisioningServerImpl< NetworkProvisioningServerImpl >
  nl::Weave::DeviceLayer::Internal::GenericNetworkProvisioningServerImpl< ImplClass >

Constructors and Destructors

NetworkProvisioningServer(void)

Protected attributes

mCurOp
mCurOpType
uint8_t
mDelegate
mLastOpResult
struct nl::Weave::Profiles::NetworkProvisioning::NetworkProvisioningServer::@217

Public attributes

StatusCode
uint16_t
StatusProfileId
uint32_t
SysError

Public functions

Init(WeaveExchangeManager *exchangeMgr)
Initialize the Network Provisioning Server state and register to receive Network Provisioning messages.
SendAddNetworkComplete(uint32_t networkId)
virtual WEAVE_ERROR
Send an Add Network Complete message if the network was successfully added.
SendGetNetworksComplete(uint8_t resultCount, PacketBuffer *resultsTLV)
virtual WEAVE_ERROR
Send a Get Networks Complete message containing the previously scanned networks.
SendGetWirelessRegulatoryConfigComplete(PacketBuffer *resultsTLV)
virtual WEAVE_ERROR
Send a GetWirelessRegulatoryConfigComplete message to the peer.
SendNetworkScanComplete(uint8_t resultCount, PacketBuffer *scanResultsTLV)
virtual WEAVE_ERROR
Send a Network Scan Complete response message containing the results of the scan.
SendStatusReport(uint32_t statusProfileId, uint16_t statusCode, WEAVE_ERROR sysError)
virtual WEAVE_ERROR
Send a status report response to a request.
SendSuccessResponse(void)
virtual WEAVE_ERROR
Send a success response to a Network Provisioning request.
SetDelegate(NetworkProvisioningDelegate *delegate)
void
Set the delegate to process Network Provisioning Server events.
Shutdown(void)
Shutdown the Network Provisioning Server.

Protected attributes

mCurOp

ExchangeContext * mCurOp

mCurOpType

uint8_t mCurOpType

mDelegate

NetworkProvisioningDelegate * mDelegate

mLastOpResult

struct nl::Weave::Profiles::NetworkProvisioning::NetworkProvisioningServer::@217 mLastOpResult

Public attributes

StatusCode

uint16_t StatusCode

StatusProfileId

uint32_t StatusProfileId

SysError

WEAVE_ERROR SysError

Public functions

Init

WEAVE_ERROR Init(
  WeaveExchangeManager *exchangeMgr
)

Initialize the Network Provisioning Server state and register to receive Network Provisioning messages.

Details
Parameters
[in] exchangeMgr
A pointer to the system Weave Exchange Manager.
Return Values
WEAVE_ERROR_TOO_MANY_UNSOLICITED_MESSAGE_HANDLERS
If too many message handlers have already been registered.
WEAVE_NO_ERROR
On success.

NetworkProvisioningServer

 NetworkProvisioningServer(
  void
)

SendAddNetworkComplete

virtual WEAVE_ERROR SendAddNetworkComplete(
  uint32_t networkId
)

Send an Add Network Complete message if the network was successfully added.

Details
Parameters
[in] networkId
The ID of the added network.
Return Values
WEAVE_ERROR_INCORRECT_STATE
If the Network Provisioning Server is not initialized correctly.
WEAVE_ERROR_NO_MEMORY
On failure to allocate an PacketBuffer.
WEAVE_NO_ERROR
On success.
other
Other Weave or platform-specific error codes indicating that an error occurred preventing the device from sending the Add Network Complete message.

SendGetNetworksComplete

virtual WEAVE_ERROR SendGetNetworksComplete(
  uint8_t resultCount,
  PacketBuffer *resultsTLV
)

Send a Get Networks Complete message containing the previously scanned networks.

Details
Parameters
[in] resultCount
The number of scan results.
[in] scanResultsTLV
The scan results.
Return Values
WEAVE_ERROR_INCORRECT_STATE
If the Network Provisioning Server is not initialized correctly.
WEAVE_ERROR_BUFFER_TOO_SMALL
If the results buffer is not large enough.
WEAVE_NO_ERROR
On success.
other
Other Weave or platform-specific error codes indicating that an error occurred preventing the device from sending the Get Networks Complete message.

SendGetWirelessRegulatoryConfigComplete

virtual WEAVE_ERROR SendGetWirelessRegulatoryConfigComplete(
  PacketBuffer *resultsTLV
)

Send a GetWirelessRegulatoryConfigComplete message to the peer.

Details
Parameters
[in] resultsTLV
A packet buffer containing the wireless regulatory configuration information to be returned.
Return Values
WEAVE_ERROR_INCORRECT_STATE
If the Network Provisioning Server is not initialized correctly.
WEAVE_ERROR_NO_MEMORY
On failure to allocate an PacketBuffer.
WEAVE_NO_ERROR
On success.
other
Other Weave or platform-specific error codes indicating that an error occurred preventing the device from sending the Add Network Complete message.

SendNetworkScanComplete

virtual WEAVE_ERROR SendNetworkScanComplete(
  uint8_t resultCount,
  PacketBuffer *scanResultsTLV
)

Send a Network Scan Complete response message containing the results of the scan.

Details
Parameters
[in] resultCount
The number of scan results.
[in] scanResultsTLV
The scan results.
Return Values
WEAVE_ERROR_INCORRECT_STATE
If the Network Provisioning Server is not initialized correctly.
WEAVE_ERROR_BUFFER_TOO_SMALL
If the results buffer is not large enough.
WEAVE_NO_ERROR
On success.
other
Other Weave or platform-specific error codes indicating that an error occurred preventing the device from sending the Scan Complete response.

SendStatusReport

virtual WEAVE_ERROR SendStatusReport(
  uint32_t statusProfileId,
  uint16_t statusCode,
  WEAVE_ERROR sysError
)

Send a status report response to a request.

Details
Parameters
[in] statusProfileId
The Weave profile ID this status report pertains to.
[in] statusCode
The status code to be included in this response.
[in] sysError
The system error code to be included in this response.
Return Values
WEAVE_ERROR_INCORRECT_STATE
If there is no request being processed.
WEAVE_NO_ERROR
On success.
other
Other Weave or platform-specific error codes indicating that an error occurred preventing the device from sending the status report.

SendSuccessResponse

virtual WEAVE_ERROR SendSuccessResponse(
  void
)

Send a success response to a Network Provisioning request.

Details
Return Values
WEAVE_ERROR_INCORRECT_STATE
If there is no request being processed.
WEAVE_NO_ERROR
On success.
other
Other Weave or platform-specific error codes indicating that an error occurred preventing the device from sending the success response.

SetDelegate

void SetDelegate(
  NetworkProvisioningDelegate *delegate
)

Set the delegate to process Network Provisioning Server events.

Details
Parameters
[in] delegate
A pointer to the Network Provisioning Delegate.

Shutdown

WEAVE_ERROR Shutdown(
  void
)

Shutdown the Network Provisioning Server.

Details
Return Values
WEAVE_NO_ERROR
On success.