nRF5 SDK for Mesh v3.2.0  08c60f6

Data Structures

struct  pb_remote_server_t
 Remote provisioning server context structure. More...
 

Macros

#define PB_REMOTE_SERVER_MODEL_ID   (0x0004)
 Remote provisioning server model identifier.
 
#define PB_REMOTE_SERVER_UUID_LIST_SIZE   (3)
 Size of the remote server UUID list.
 
#define PB_REMOTE_SERVER_ACKED_TRANSACTION_TIMEOUT   (SEC_TO_US(60))
 Acknowledged message transaction timeout.
 

Enumerations

enum  pb_remote_server_state_t {
  PB_REMOTE_SERVER_STATE_NONE, PB_REMOTE_SERVER_STATE_DISABLED, PB_REMOTE_SERVER_STATE_IDLE, PB_REMOTE_SERVER_STATE_SCANNING,
  PB_REMOTE_SERVER_STATE_SCANNING_FILTER, PB_REMOTE_SERVER_STATE_LINK_OPENING, PB_REMOTE_SERVER_STATE_LINK_CLOSING, PB_REMOTE_SERVER_STATE_LINK_ESTABLISHED,
  PB_REMOTE_SERVER_STATE_WAIT_ACK_LOCAL, PB_REMOTE_SERVER_STATE_WAIT_ACK_TRANSFER, PB_REMOTE_SERVER_STATE_WAIT_ACK_LINK_OPEN, PB_REMOTE_SERVER_STATE_WAIT_ACK_LINK_CLOSE,
  PB_REMOTE_SERVER_STATE_WAIT_ACK_SCAN_REPORT, PB_REMOTE_SERVER_STATE_WAIT_ACK_SCAN_REPORT_FILTER
}
 Remote Provisioning Server states. More...
 

Functions

uint32_t pb_remote_server_init (pb_remote_server_t *p_server, uint16_t element_index)
 Initializes the remote provisioning server model. More...
 
uint32_t pb_remote_server_enable (pb_remote_server_t *p_server)
 Enables the remote provisioning server. More...
 
uint32_t pb_remote_server_disable (pb_remote_server_t *p_server)
 Disables the remote provisioning server. More...
 
uint32_t pb_remote_server_return_to_scan_set (pb_remote_server_t *p_server, bool state)
 Sets the return to scan state. More...
 
uint32_t pb_remote_server_prov_bearer_set (pb_remote_server_t *p_server, prov_bearer_t *p_prov_bearer)
 Sets the provisioning bearer for the remote provisioning server. More...
 

Detailed Description

This module implements the remote provisioning server (PB-remote server) model.

msc_pb_remote_server_init
Initializing the Remote Provisioning Server
Remote Provisioning Server state diagram

Enumeration Type Documentation

◆ pb_remote_server_state_t

Remote Provisioning Server states.

Enumerator
PB_REMOTE_SERVER_STATE_NONE 

Uninitialized state.

PB_REMOTE_SERVER_STATE_DISABLED 

Disabled state.

PB_REMOTE_SERVER_STATE_IDLE 

Initialized and idle state.

PB_REMOTE_SERVER_STATE_SCANNING 

Scanning for unprovisioned devices.

PB_REMOTE_SERVER_STATE_SCANNING_FILTER 

Scanning with a UUID filter.

PB_REMOTE_SERVER_STATE_LINK_OPENING 

Waiting for local link to open.

PB_REMOTE_SERVER_STATE_LINK_CLOSING 

Waiting for local link to close.

PB_REMOTE_SERVER_STATE_LINK_ESTABLISHED 

Local link established.

PB_REMOTE_SERVER_STATE_WAIT_ACK_LOCAL 

Waiting for local acknowledgment.

PB_REMOTE_SERVER_STATE_WAIT_ACK_TRANSFER 

Waiting for remote acknowledgment of PDU/report.

PB_REMOTE_SERVER_STATE_WAIT_ACK_LINK_OPEN 

Waiting for remote acknowledgment of opened link.

PB_REMOTE_SERVER_STATE_WAIT_ACK_LINK_CLOSE 

Waiting for remote acknowledgment of closed link.

PB_REMOTE_SERVER_STATE_WAIT_ACK_SCAN_REPORT 

Waiting for remote acknowledgement of scan report.

PB_REMOTE_SERVER_STATE_WAIT_ACK_SCAN_REPORT_FILTER 

Waiting for remote acknowledgement of scan filter report.

Definition at line 69 of file pb_remote_server.h.

Function Documentation

◆ pb_remote_server_init()

uint32_t pb_remote_server_init ( pb_remote_server_t p_server,
uint16_t  element_index 
)

Initializes the remote provisioning server model.

Note
This function is expected to be called once for a remote server.
Parameters
[in,out]p_serverRemote server context structure pointer.
[in]element_indexElement index to bind the remote server model.
Return values
NRF_SUCCESSSuccessfully initialized the model.
NRF_ERROR_NULLNULL pointer supplied to function.
NRF_ERROR_NO_MEMNo more memory available to allocate model.
NRF_ERROR_FORBIDDENMultiple model instances per element is not allowed.
NRF_ERROR_NOT_FOUNDInvalid element index.
NRF_ERROR_INVALID_STATEModel was already initialized.

◆ pb_remote_server_enable()

uint32_t pb_remote_server_enable ( pb_remote_server_t p_server)

Enables the remote provisioning server.

Parameters
[in,out]p_serverRemote server context pointer.
Return values
NRF_SUCCESSSuccessfull enabled remote server.
NRF_ERROR_NULLNULL pointer in function arguments.
NRF_ERROR_INVALID_STATEA remote server may only enabled in the PB_REMOTE_SERVER_STATE_DISABLED state.

◆ pb_remote_server_disable()

uint32_t pb_remote_server_disable ( pb_remote_server_t p_server)

Disables the remote provisioning server.

Parameters
[in,out]p_serverRemote server context pointer.
Return values
NRF_SUCCESSSuccessfully disabled remote server.
NRF_ERROR_NULLNULL pointer in function arguments.
NRF_ERROR_INVALID_STATEA remote server may only disabled in the PB_REMOTE_SERVER_STATE_IDLE, PB_REMOTE_SERVER_STATE_SCANNING or PB_REMOTE_SERVER_STATE_SCANNING_FILTER states.

◆ pb_remote_server_return_to_scan_set()

uint32_t pb_remote_server_return_to_scan_set ( pb_remote_server_t p_server,
bool  state 
)

Sets the return to scan state.

Parameters
[in,out]p_serverRemote server context pointer.
[in]stateEnable or disable the return to scanning mode.
Return values
NRF_SUCCESSSuccessfully set return to scan state.
NRF_ERROR_NULLNULL pointer in function arguments.

◆ pb_remote_server_prov_bearer_set()

uint32_t pb_remote_server_prov_bearer_set ( pb_remote_server_t p_server,
prov_bearer_t *  p_prov_bearer 
)

Sets the provisioning bearer for the remote provisioning server.

Parameters
[in,out]p_serverRemote server context pointer.
[in,out]p_prov_bearerProvisioning bearer pointer.
Return values
NRF_SUCCESSSuccessfully set provisioning bearer.
NRF_ERROR_NULLOne or more parameters were NULL