This module implements the remote provisioning server (PB-remote server) model.
More...
|
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...
|
|
This module implements the remote provisioning server (PB-remote server) model.
For conceptual information, see Remote provisioning (PB-remote).
Initializing the Remote Provisioning Server
Remote Provisioning Server state diagram
◆ PB_REMOTE_SERVER_MODEL_ID
#define PB_REMOTE_SERVER_MODEL_ID (0x0004) |
◆ PB_REMOTE_SERVER_UUID_LIST_SIZE
#define PB_REMOTE_SERVER_UUID_LIST_SIZE (3) |
◆ 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 71 of file pb_remote_server.h.
◆ pb_remote_server_init()
Initializes the remote provisioning server model.
- Note
- This function is expected to be called once for a remote server.
- Parameters
-
[in,out] | p_server | Remote server context structure pointer. |
[in] | element_index | Element index to bind the remote server model. |
- Return values
-
NRF_SUCCESS | Successfully initialized the model. |
NRF_ERROR_NULL | NULL pointer supplied to function. |
NRF_ERROR_NO_MEM | No more memory available to allocate model. |
NRF_ERROR_FORBIDDEN | Multiple model instances per element is not allowed. |
NRF_ERROR_NOT_FOUND | Invalid element index. |
NRF_ERROR_INVALID_STATE | Model was already initialized. |
◆ pb_remote_server_enable()
Enables the remote provisioning server.
- Parameters
-
[in,out] | p_server | Remote server context pointer. |
- Return values
-
NRF_SUCCESS | Successfull enabled remote server. |
NRF_ERROR_NULL | NULL pointer in function arguments. |
NRF_ERROR_INVALID_STATE | A remote server may only enabled in the PB_REMOTE_SERVER_STATE_DISABLED state. |
◆ pb_remote_server_disable()
Disables the remote provisioning server.
- Parameters
-
[in,out] | p_server | Remote server context pointer. |
- Return values
-
◆ 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_server | Remote server context pointer. |
[in] | state | Enable or disable the return to scanning mode. |
- Return values
-
NRF_SUCCESS | Successfully set return to scan state. |
NRF_ERROR_NULL | NULL 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_server | Remote server context pointer. |
[in,out] | p_prov_bearer | Provisioning bearer pointer. |
- Return values
-
NRF_SUCCESS | Successfully set provisioning bearer. |
NRF_ERROR_NULL | One or more parameters were NULL |