RA Flexible Software Package Documentation  Release v5.2.0

 
BLE Mesh Network Network (rm_ble_mesh_network)

Functions

fsp_err_t RM_BLE_MESH_NETWORK_Open (rm_ble_mesh_network_ctrl_t *const p_ctrl, rm_ble_mesh_network_cfg_t const *const p_cfg)
 
fsp_err_t RM_BLE_MESH_NETWORK_Close (rm_ble_mesh_network_ctrl_t *const p_ctrl)
 
fsp_err_t RM_BLE_MESH_NETWORK_BroadcastSecureBeacon (rm_ble_mesh_network_ctrl_t *const p_ctrl, rm_ble_mesh_network_subnet_handle_t subnet_handle)
 
fsp_err_t RM_BLE_MESH_NETWORK_SendPduOnInterface (rm_ble_mesh_network_ctrl_t *const p_ctrl, rm_ble_mesh_network_route_info_t const *const p_route_info, rm_ble_mesh_network_header_t const *const p_header, rm_ble_mesh_buffer_t const *const p_buffer)
 
fsp_err_t RM_BLE_MESH_NETWORK_GetAddressType (rm_ble_mesh_network_ctrl_t *const p_ctrl, rm_ble_mesh_network_address_t addr, rm_ble_mesh_network_address_type_t *const p_type)
 
fsp_err_t RM_BLE_MESH_NETWORK_FetchProxyState (rm_ble_mesh_network_ctrl_t *const p_ctrl, rm_ble_mesh_network_gatt_proxy_state_t *const p_proxy_state)
 
fsp_err_t RM_BLE_MESH_NETWORK_SetProxyFilter (rm_ble_mesh_network_ctrl_t *const p_ctrl, rm_ble_mesh_network_route_info_t const *const p_route_info, rm_ble_mesh_proxy_filter_type_t type)
 
fsp_err_t RM_BLE_MESH_NETWORK_ConfigProxyFilter (rm_ble_mesh_network_ctrl_t *const p_ctrl, rm_ble_mesh_network_route_info_t const *const p_route_info, rm_ble_mesh_proxy_config_opcode_t opcode, rm_ble_mesh_network_proxy_address_list_t *const p_addr_list)
 
fsp_err_t RM_BLE_MESH_NETWORK_StartProxyServerAdv (rm_ble_mesh_network_ctrl_t *const p_ctrl, rm_ble_mesh_network_subnet_handle_t subnet_handle, rm_ble_mesh_network_gatt_proxy_adv_mode_t proxy_adv_mode)
 
fsp_err_t RM_BLE_MESH_NETWORK_StopProxyServerAdv (rm_ble_mesh_network_ctrl_t *const p_ctrl)
 
fsp_err_t RM_BLE_MESH_NETWORK_AllocateSeqNumber (rm_ble_mesh_network_ctrl_t *const p_ctrl, uint32_t *const p_seq_num)
 
fsp_err_t RM_BLE_MESH_NETWORK_GetSeqNumberState (rm_ble_mesh_network_ctrl_t *const p_ctrl, rm_ble_mesh_network_seq_number_state_t *const p_seq_num_state)
 
fsp_err_t RM_BLE_MESH_NETWORK_SetSeqNumberState (rm_ble_mesh_network_ctrl_t *const p_ctrl, rm_ble_mesh_network_seq_number_state_t const *const p_seq_num_state)
 
fsp_err_t RM_BLE_MESH_NETWORK_ResetNetCache (rm_ble_mesh_network_ctrl_t *const p_ctrl)
 

Detailed Description

Overview

Target Devices

The BLE Mesh Network Network module supports the following devices.

Configuration

Build Time Configurations for rm_ble_mesh_network

The following build time configurations are defined in fsp_cfg/rm_ble_mesh_network_cfg.h:

ConfigurationOptionsDefaultDescription

Configurations for Networking > BLE Mesh Network modules > BLE Mesh Network (rm_ble_mesh_network)

This module can be added to the Stacks tab via New Stack > Networking > BLE Mesh Network modules > BLE Mesh Network (rm_ble_mesh_network).

ConfigurationOptionsDefaultDescription
General
NameName Must Be a Valid C Symbolg_rm_ble_mesh_network0 Module name.
Channel NumberInvalid Channel Number0 Select channel corresponding to the channel number of the hardware.
Ignore Netcache Wrapping
  • Processed
  • Dropped
Dropped Ignore netcache wrapping.
RX Callback Event Enable
  • Enabled
  • Disabled
Disabled Whether to enable the RX callback event or not.
TX Callback Event Enable
  • Enabled
  • Disabled
Disabled Whether to enable the TX callback event or not.
CallbackName Must Be a Valid C SymbolNULL Callback function name.

Data Structures

struct  rm_ble_mesh_network_instance_ctrl_t
 

Data Structure Documentation

◆ rm_ble_mesh_network_instance_ctrl_t

struct rm_ble_mesh_network_instance_ctrl_t

RM_BLE_MESH_NETWORK private control block. DO NOT MODIFY. Initialization occurs when RM_BLE_MESH_NETWORK_Open() is called.

Function Documentation

◆ RM_BLE_MESH_NETWORK_Open()

fsp_err_t RM_BLE_MESH_NETWORK_Open ( rm_ble_mesh_network_ctrl_t *const  p_ctrl,
rm_ble_mesh_network_cfg_t const *const  p_cfg 
)

Register Inerface with Network Layer. This routine registers interface with the Network Layer. Network Layer supports only one upper layer, hence this routine shall be called once.

Implements rm_ble_mesh_network_api_t::open.

Example:

/* Open the module. */
err = RM_BLE_MESH_NETWORK_Open(&g_ble_mesh_network0_ctrl, &g_ble_mesh_network0_cfg);
Return values
FSP_SUCCESSModule opened successfully.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_INVALID_STATELower layer is invalid state.
FSP_ERR_ALREADY_OPENModule is already open.

◆ RM_BLE_MESH_NETWORK_Close()

fsp_err_t RM_BLE_MESH_NETWORK_Close ( rm_ble_mesh_network_ctrl_t *const  p_ctrl)

Unregister Inerface with Network Layer. Implements rm_ble_mesh_network_api_t::close.

Example:

/* Close the module. */
err = RM_BLE_MESH_NETWORK_Close(&g_ble_mesh_network0_ctrl);
Return values
FSP_SUCCESSModule successfully closed.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_NETWORK_BroadcastSecureBeacon()

fsp_err_t RM_BLE_MESH_NETWORK_BroadcastSecureBeacon ( rm_ble_mesh_network_ctrl_t *const  p_ctrl,
rm_ble_mesh_network_subnet_handle_t  subnet_handle 
)

API to send Secure Network Beacon. This routine sends Secure Network Beacon for the given subnet handle.

Implements rm_ble_mesh_network_api_t::broadcastSecureBeacon.

Example:

/* Send secure network beacon. */
err = RM_BLE_MESH_NETWORK_BroadcastSecureBeacon(&g_ble_mesh_network0_ctrl, subnet_handle);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_INVALID_STATELower layer is invalid state.
FSP_ERR_NOT_FOUNDInput parameter is not found.

◆ RM_BLE_MESH_NETWORK_SendPduOnInterface()

fsp_err_t RM_BLE_MESH_NETWORK_SendPduOnInterface ( rm_ble_mesh_network_ctrl_t *const  p_ctrl,
rm_ble_mesh_network_route_info_t const *const  p_route_info,
rm_ble_mesh_network_header_t const *const  p_header,
rm_ble_mesh_buffer_t const *const  p_buffer 
)

Extension API to send Network PDUs on selected network interfaces. This routine sends NETWORK PDUs on all or selected Network Interfaces.

Implements rm_ble_mesh_network_api_t::sendPduOnInterface.

Example:

/* Send network PDUs on selected network interfaces. */
err = RM_BLE_MESH_NETWORK_SendPduOnInterface(&g_ble_mesh_network0_ctrl, &route_info, &header, &buffer);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_route_info, p_header and p_buffer are NULL.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_OUT_OF_MEMORYMemory allocation is failed.
FSP_ERR_OVERFLOWTX queue is full.
FSP_ERR_INVALID_ARGUMENTInput parameter is invalid.

◆ RM_BLE_MESH_NETWORK_GetAddressType()

fsp_err_t RM_BLE_MESH_NETWORK_GetAddressType ( rm_ble_mesh_network_ctrl_t *const  p_ctrl,
rm_ble_mesh_network_address_t  addr,
rm_ble_mesh_network_address_type_t *const  p_type 
)

To get address type. This routine is to get address type for a given address.

Implements rm_ble_mesh_network_api_t::getAddressType.

Example:

/* Get address type. */
err = RM_BLE_MESH_NETWORK_GetAddressType(&g_ble_mesh_network0_ctrl, addr, &type);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_type is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_NETWORK_FetchProxyState()

fsp_err_t RM_BLE_MESH_NETWORK_FetchProxyState ( rm_ble_mesh_network_ctrl_t *const  p_ctrl,
rm_ble_mesh_network_gatt_proxy_state_t *const  p_proxy_state 
)

Check if the proxy module is ready to handle proxy messages/events. This routine returns the current state of the Proxy. The valid states of proxy are:

  1. RM_BLE_MESH_NETWORK_GATT_PROXY_STATE_NULL - If no callback registered by Upper Layers
  2. RM_BLE_MESH_NEgTWORK_GATT_PROXY_STATE_READY - If callback registered and Proxy not connected
  3. RM_BLE_MESH_NETWORK_GATT_PROXY_STATE_CONNECTED - if callback registered and Proxy connected

Implements rm_ble_mesh_network_api_t::fetchProxyState.

Example:

/* Check if the proxy module is ready to handle proxy messages/events. */
err = RM_BLE_MESH_NETWORK_FetchProxyState(&g_ble_mesh_network0_ctrl, &proxy_state);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_proxy_state is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_NETWORK_SetProxyFilter()

fsp_err_t RM_BLE_MESH_NETWORK_SetProxyFilter ( rm_ble_mesh_network_ctrl_t *const  p_ctrl,
rm_ble_mesh_network_route_info_t const *const  p_route_info,
rm_ble_mesh_proxy_filter_type_t  type 
)

Set proxy server's filter type. This function is used by the Proxy Client to set the filter type on the Proxy Server.

Implements rm_ble_mesh_network_api_t::setProxyFilter.

Example:

/* Set proxy server's filter type. */
err = RM_BLE_MESH_NETWORK_SetProxyFilter(&g_ble_mesh_network0_ctrl, &route_info, filter_type);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_route_info is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_NETWORK_ConfigProxyFilter()

fsp_err_t RM_BLE_MESH_NETWORK_ConfigProxyFilter ( rm_ble_mesh_network_ctrl_t *const  p_ctrl,
rm_ble_mesh_network_route_info_t const *const  p_route_info,
rm_ble_mesh_proxy_config_opcode_t  opcode,
rm_ble_mesh_network_proxy_address_list_t *const  p_addr_list 
)

Add or Delete/Remove addresses to/from proxy filter list. This function is used by the Proxy Client to add/delete Addresses to/from the Proxy Server's filter List.

Implements rm_ble_mesh_network_api_t::configProxyFilter.

Example:

/* Add or delete/remove addresses to/from proxy filter list. */
err = RM_BLE_MESH_NETWORK_ConfigProxyFilter(&g_ble_mesh_network0_ctrl, &route_info, opcode, &addr_list);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_route_info and p_addr_list are NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_NETWORK_StartProxyServerAdv()

fsp_err_t RM_BLE_MESH_NETWORK_StartProxyServerAdv ( rm_ble_mesh_network_ctrl_t *const  p_ctrl,
rm_ble_mesh_network_subnet_handle_t  subnet_handle,
rm_ble_mesh_network_gatt_proxy_adv_mode_t  proxy_adv_mode 
)

Start connectable advertisements for a proxy server. This function is used by the Proxy Server to start Connectable Undirected Advertisements.

Implements rm_ble_mesh_network_api_t::startProxyServerAdv.

Example:

/* Start connectable advertisements for a proxy server. */
err = RM_BLE_MESH_NETWORK_StartProxyServerAdv(&g_ble_mesh_network0_ctrl, subnet_handle, proxy_adv_mode);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe internal parameter is NULL.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_OUT_OF_MEMORYMemory allocation is failed.
FSP_ERR_OVERFLOWTX queue is full.
FSP_ERR_INVALID_ARGUMENTInput parameter is invalid.

◆ RM_BLE_MESH_NETWORK_StopProxyServerAdv()

fsp_err_t RM_BLE_MESH_NETWORK_StopProxyServerAdv ( rm_ble_mesh_network_ctrl_t *const  p_ctrl)

Stop connectable advertisements for a proxy server. This function is used by the Proxy Server to stop Connectable Undirected Advertisements.

Implements rm_ble_mesh_network_api_t::stopProxyServerAdv.

Example:

/* Stop connectable advertisements for a proxy server. */
err = RM_BLE_MESH_NETWORK_StopProxyServerAdv(&g_ble_mesh_network0_ctrl);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_NETWORK_AllocateSeqNumber()

fsp_err_t RM_BLE_MESH_NETWORK_AllocateSeqNumber ( rm_ble_mesh_network_ctrl_t *const  p_ctrl,
uint32_t *const  p_seq_num 
)

To allocate sequence number. This function is used to allocate Sequence Number.

Implements rm_ble_mesh_network_api_t::allocateSeqNumber.

Example:

/* Allocate sequence number. */
err = RM_BLE_MESH_NETWORK_AllocateSeqNumber(&g_ble_mesh_network0_ctrl, &seq_num);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_seq_num is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_NETWORK_GetSeqNumberState()

fsp_err_t RM_BLE_MESH_NETWORK_GetSeqNumberState ( rm_ble_mesh_network_ctrl_t *const  p_ctrl,
rm_ble_mesh_network_seq_number_state_t *const  p_seq_num_state 
)

To get current sequence number state. This function is used to get current Sequence Number state.

Implements rm_ble_mesh_network_api_t::getSeqNumberState.

Example:

/* Get current sequence number state. */
err = RM_BLE_MESH_NETWORK_GetSeqNumberState(&g_ble_mesh_network0_ctrl, &seq_num_state);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_seq_num_state is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_NETWORK_SetSeqNumberState()

fsp_err_t RM_BLE_MESH_NETWORK_SetSeqNumberState ( rm_ble_mesh_network_ctrl_t *const  p_ctrl,
rm_ble_mesh_network_seq_number_state_t const *const  p_seq_num_state 
)

To set current sequence number state. This function is used to get current Sequence Number state, which acquiring lock. Used from persistent storage.

Implements rm_ble_mesh_network_api_t::setSeqNumberState.

Example:

/* Set current sequence number state. */
err = RM_BLE_MESH_NETWORK_SetSeqNumberState(&g_ble_mesh_network0_ctrl, &seq_num_state);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_seq_num_state is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_NETWORK_ResetNetCache()

fsp_err_t RM_BLE_MESH_NETWORK_ResetNetCache ( rm_ble_mesh_network_ctrl_t *const  p_ctrl)

To reinitialize all Network Layer cache entries. This routine clears and reinitializes all Network Cache Entries. This needs to be invoked by the upper layer when the Network moves to a newer IV Index (Normal State) and the Sequence numbers are reset.

Implements rm_ble_mesh_network_api_t::resetNetCache.

Example:

/* Reinitialize all Network Layer cache entries. */
err = RM_BLE_MESH_NETWORK_ResetNetCache(&g_ble_mesh_network0_ctrl);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_NOT_OPENModule is not open.