This module implements the remote provisioning client (PB-Remote client) model. More...
Data Structures | |
| struct | pb_remote_event_remote_uuid_t |
| Remote UUID event data. More... | |
| struct | pb_remote_event_t |
| Remote provisioning event structure. More... | |
| struct | pb_remote_client_t |
| Remote Provisioning Client context structure. More... | |
Macros | |
| #define | PB_REMOTE_CLIENT_MODEL_ID (0x8004) |
| Remote client model ID. More... | |
| #define | PB_REMOTE_CLIENT_ACKED_TRANSACTION_TIMEOUT (SEC_TO_US(60)) |
| Acknowledged message transaction timeout. | |
Typedefs | |
| typedef void(* | pb_remote_client_event_cb_t) (const pb_remote_event_t *p_evt) |
| Remote provisioning client event handler callback function. More... | |
Enumerations | |
| enum | pb_remote_event_type_t { PB_REMOTE_EVENT_SCAN_STARTED, PB_REMOTE_EVENT_SCAN_CANCELED, PB_REMOTE_EVENT_CANNOT_START_SCANNING, PB_REMOTE_EVENT_CANNOT_CANCEL_SCANNING, PB_REMOTE_EVENT_LINK_CLOSED, PB_REMOTE_EVENT_LINK_NOT_ACTIVE, PB_REMOTE_EVENT_LINK_ALREADY_OPEN, PB_REMOTE_EVENT_CANNOT_OPEN_LINK, PB_REMOTE_EVENT_CANNOT_CLOSE_LINK, PB_REMOTE_EVENT_INVALID_UNPROV_DEVICE_ID, PB_REMOTE_EVENT_TX_FAILED, PB_REMOTE_EVENT_REMOTE_UUID } |
| Remote provisioning client event types. More... | |
| enum | pb_remote_client_state_t { PB_REMOTE_CLIENT_STATE_NONE, PB_REMOTE_CLIENT_STATE_IDLE, PB_REMOTE_CLIENT_STATE_LINK_ESTABLISHED, PB_REMOTE_CLIENT_STATE_WAIT_ACK_LINK, PB_REMOTE_CLIENT_STATE_WAIT_ACK_TRANSFER, PB_REMOTE_CLIENT_STATE_WAIT_ACK_SCAN } |
| Remote Provisioning Client states. More... | |
Functions | |
| uint32_t | pb_remote_client_init (pb_remote_client_t *p_client, uint16_t element_index, pb_remote_client_event_cb_t event_cb) |
| Initializes the Remote provisioning client model. More... | |
| prov_bearer_t * | pb_remote_client_bearer_interface_get (pb_remote_client_t *p_client) |
| Gets the remote Remote provisioning client's bearer interface. More... | |
| uint32_t | pb_remote_client_remote_scan_start (pb_remote_client_t *p_client) |
| Initiates the remote scanning procedure. More... | |
| uint32_t | pb_remote_client_remote_scan_cancel (pb_remote_client_t *p_client) |
| Cancels the remote scanning procedure. More... | |
Detailed Description
This module implements the remote provisioning client (PB-Remote client) model.
For conceptual information, see Remote provisioning (PB-remote).
Macro Definition Documentation
◆ PB_REMOTE_CLIENT_MODEL_ID
| #define PB_REMOTE_CLIENT_MODEL_ID (0x8004) |
Remote client model ID.
Definition at line 60 of file pb_remote_client.h.
Typedef Documentation
◆ pb_remote_client_event_cb_t
| typedef void(* pb_remote_client_event_cb_t) (const pb_remote_event_t *p_evt) |
Remote provisioning client event handler callback function.
- Parameters
-
[in] p_evt Remote provisioning event pointer.
Definition at line 119 of file pb_remote_client.h.
Enumeration Type Documentation
◆ pb_remote_event_type_t
Remote provisioning client event types.
Definition at line 68 of file pb_remote_client.h.
◆ pb_remote_client_state_t
Remote Provisioning Client states.
| Enumerator | |
|---|---|
| PB_REMOTE_CLIENT_STATE_NONE | Uninitialized state. |
| PB_REMOTE_CLIENT_STATE_IDLE | Initialized and idle state. |
| PB_REMOTE_CLIENT_STATE_LINK_ESTABLISHED | Remote provisioning link is established. |
Definition at line 124 of file pb_remote_client.h.
Function Documentation
◆ pb_remote_client_init()
| uint32_t pb_remote_client_init | ( | pb_remote_client_t * | p_client, |
| uint16_t | element_index, | ||
| pb_remote_client_event_cb_t | event_cb | ||
| ) |
Initializes the Remote provisioning client model.
- Parameters
-
[in,out] p_client Client context structure pointer. [in] element_index Element index to bind the remote client model. [in] event_cb Event callback function.
- 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_client_bearer_interface_get()
| prov_bearer_t* pb_remote_client_bearer_interface_get | ( | pb_remote_client_t * | p_client | ) |
Gets the remote Remote provisioning client's bearer interface.
This function is inteded to be used with the nrf_mesh_prov_bearer_add() API.
- Parameters
-
[in,out] p_client Client context structure pointer
- Returns
- a generic bearer context structure pointer.
◆ pb_remote_client_remote_scan_start()
| uint32_t pb_remote_client_remote_scan_start | ( | pb_remote_client_t * | p_client | ) |
Initiates the remote scanning procedure.
- Note
- It is assumed that the client's publish address is set to the server's address and vice versa.
- Parameters
-
[in,out] p_client Client model context pointer.
- Return values
-
NRF_SUCCESS Successfully started the scanning procedure. NRF_ERROR_NULL Null pointer supplied to function. NRF_ERROR_INVALID_ADDR The destination address was not a valid unicast address. NRF_ERROR_INVALID_STATE The Client was not in a valid state to process this request.
◆ pb_remote_client_remote_scan_cancel()
| uint32_t pb_remote_client_remote_scan_cancel | ( | pb_remote_client_t * | p_client | ) |
Cancels the remote scanning procedure.
- Note
- It is assumed that the client's publish address is set to the server's address and vice versa.
- Parameters
-
[in,out] p_client Client model context pointer.
- Return values
-
NRF_SUCCESS Successfully canceled the scanning procedure. NRF_ERROR_NULL Null pointer supplied to function. NRF_ERROR_INVALID_ADDR The destination address was not a valid unicast address. NRF_ERROR_INVALID_STATE The Client was not in a valid state to process this request.