nRF5 SDK for Mesh v3.2.0  08c60f6

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.
 
#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.

msc_pb_remote_client_init
Initializing the Remote Provisioning Client
Remote Provisioning Client state diagram

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_evtRemote provisioning event pointer.

Definition at line 116 of file pb_remote_client.h.

Enumeration Type Documentation

◆ pb_remote_event_type_t

Remote provisioning client event types.

Enumerator
PB_REMOTE_EVENT_SCAN_STARTED 

The remote has started scanning.

PB_REMOTE_EVENT_SCAN_CANCELED 

The remote has cancelled the scanning.

PB_REMOTE_EVENT_CANNOT_START_SCANNING 

The remote could not start the scanning procedure.

PB_REMOTE_EVENT_CANNOT_CANCEL_SCANNING 

The remote could not cancel the scanning procedure.

PB_REMOTE_EVENT_LINK_CLOSED 

The remote link was closed.

PB_REMOTE_EVENT_LINK_NOT_ACTIVE 

The remote got a link close command for an inactive link.

PB_REMOTE_EVENT_LINK_ALREADY_OPEN 

Link is already active.

PB_REMOTE_EVENT_CANNOT_OPEN_LINK 

The remote could not open link.

PB_REMOTE_EVENT_CANNOT_CLOSE_LINK 

The remote could not close the link.

PB_REMOTE_EVENT_INVALID_UNPROV_DEVICE_ID 

The unprovisioned device ID was not recognized by the server.

PB_REMOTE_EVENT_TX_FAILED 

The session failed because of no response from the remote.

PB_REMOTE_EVENT_REMOTE_UUID 

Received a remote UUID from the server.

Definition at line 65 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 121 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_clientClient context structure pointer.
[in]element_indexElement index to bind the remote client model.
[in]event_cbEvent callback function.
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_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_clientClient 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_clientClient model context pointer.
Return values
NRF_SUCCESSSuccessfully started the scanning procedure.
NRF_ERROR_NULLNull pointer supplied to function.
NRF_ERROR_INVALID_ADDRThe destination address was not a valid unicast address.
NRF_ERROR_INVALID_STATEThe 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_clientClient model context pointer.
Return values
NRF_SUCCESSSuccessfully canceled the scanning procedure.
NRF_ERROR_NULLNull pointer supplied to function.
NRF_ERROR_INVALID_ADDRThe destination address was not a valid unicast address.
NRF_ERROR_INVALID_STATEThe Client was not in a valid state to process this request.