Commissioning Module

nRF5 SDK v15.0.0

Commissioning module. More...

Data Structures

struct commissioning_timer_t
Structure for creating timers in the Commissioning module. More...
struct commissioning_evt_t
Structure of events passed by the Commissioning module to the parent layer. More...
struct commissioning_init_params_t
Structure for initialization parameters of the Commissioning module. More...

Typedefs

typedef void(* commissioning_timeout_handler_t )(void)
Commissioning module event handler type.
typedef void(* commissioning_evt_handler_t )( commissioning_evt_t *p_commissioning_evt)
Commissioning module event handler type.

Enumerations

enum joining_mode_timer_ctrl_cmd_t {
JOINING_MODE_TIMER_START = 0x01,
JOINING_MODE_TIMER_STOP_RESET = 0x02
}
Joining mode timer control commands.

Functions

struct __attribute__ ((__packed__)) __attribute__((aligned))
Structure for storing all settings necessary for commissioning.
void commissioning_ble_evt_handler (const ble_evt_t *p_ble_evt)
Function for handling BLE events. More...
uint32_t commissioning_init ( commissioning_init_params_t *p_init_param, uint8_t *p_poweron_state)
Function for initializing the Commissioning module. More...
void commissioning_node_mode_change (uint8_t new_mode)
Function for advancing the node to a new mode. More...
void commissioning_gap_params_get ( ipv6_medium_ble_gap_params_t **pp_node_gap_params)
Function for getting the address of GAP parameters for the active mode. More...
void commissioning_adv_params_get ( ipv6_medium_ble_adv_params_t **pp_node_adv_params)
Function for getting the address of advertising parameters for the active mode. More...
void commissioning_settings_clear (void)
Function for clearing all node settings from the persistent storage. More...
void commissioning_joining_mode_timer_ctrl ( joining_mode_timer_ctrl_cmd_t joining_mode_timer_ctrl_cmd)
Function for controlling the joining mode timer from the parent layer(s). More...
void commissioning_time_tick ( iot_timer_time_in_ms_t wall_clock_value)
Commissioning time tick used for measuring delays and time between events. More...

Variables

commissioning_settings_t

Detailed Description

Commissioning module.

Enables commissioning of the node by managing transitions between the Config, Joining, and Identity modes. In Config mode the node can be configured with the settings required to join the network in Joining mode. The Identity mode can be requested to make the node easily recognizable for the user. The settings managed by the module are stored in persistent storage.

Macro Definition Documentation

#define COMMISSIONING_EVT_CONFIG_MODE_ENTER   0x01

Indicates that the medium entered mode for commissioning configuration.

#define COMMISSIONING_EVT_IDENTITY_MODE_ENTER   0x03

Indicates that identity mode was requested.

#define COMMISSIONING_EVT_IDENTITY_MODE_EXIT   0x04

Indicates that the node should stop using any features associated with the Identity mode.

#define COMMISSIONING_EVT_JOINING_MODE_ENTER   0x02

Indicates that the medium exited mode for commissioning configuration.

#define COMMISSIONING_TICK_INTERVAL_SEC   1

Interval between periodic callbacks to the Commissioning module.

#define NODE_MODE_CONFIG   0x02

Node mode: configuration.

#define NODE_MODE_IDENTITY   0x03

Node mode: conspicuous for the user.

#define NODE_MODE_JOINING   0x01

Node mode: joining the network.

#define NODE_MODE_NONE   0x00

Node mode: before initialization.

Function Documentation

void commissioning_adv_params_get ( ipv6_medium_ble_adv_params_t ** pp_node_adv_params )

Function for getting the address of advertising parameters for the active mode.

Parameters
[out] pp_node_adv_params Address of advertising parameters for the active mode.
void commissioning_ble_evt_handler ( const ble_evt_t * p_ble_evt )

Function for handling BLE events.

This function must be called from the BLE stack event dispatcher to handle BLE events that are relevant for the Commissioning module.

Parameters
[in] p_ble_evt BLE stack event.
void commissioning_gap_params_get ( ipv6_medium_ble_gap_params_t ** pp_node_gap_params )

Function for getting the address of GAP parameters for the active mode.

Parameters
[out] pp_node_gap_params Address of GAP parameters for the active mode.
uint32_t commissioning_init ( commissioning_init_params_t * p_init_param ,
uint8_t * p_poweron_state
)

Function for initializing the Commissioning module.

Initializes the Node Configuration Service module to create the GATT database. Loads previously stored node settings from the persistent storage and if the settings are valid, sets up the node to start in the right mode.

Parameters
[in] p_init_param Pointer to the initialization parameters.
[out] p_poweron_state Pointer to the value of the mode that should be started.
Return values
NRF_SUCCESS If initialization was successful. Otherwise, a propagated error code is returned.
void commissioning_joining_mode_timer_ctrl ( joining_mode_timer_ctrl_cmd_t joining_mode_timer_ctrl_cmd )

Function for controlling the joining mode timer from the parent layer(s).

If the Joining mode timer reaches zero, the node must enter the state-on-failure, as set by the user. This function allows the application designer to control the Joining mode timer from the application layer.

void commissioning_node_mode_change ( uint8_t new_mode )

Function for advancing the node to a new mode.

Stops and starts app timers appropriate for the mode requested. Propagates the mode change event to the parent layer.

Parameters
[in] new_mode New mode to start.
void commissioning_settings_clear ( void )

Function for clearing all node settings from the persistent storage.

Calls the appropriate persistent storage interface function to clear all commissioning-related settings from the persistent storage.

void commissioning_time_tick ( iot_timer_time_in_ms_t wall_clock_value )

Commissioning time tick used for measuring delays and time between events.

Parameters
[in] wall_clock_value Wall clock value from the IoT Timer module.