RA Flexible Software Package Documentation  Release v5.2.0

 
BLE Mesh Network Interface

Detailed Description

Interface for BLE Mesh Network functions.

Summary

The BLE Mesh Network interface for the BLE Mesh Network (BLE MESH NETWORK) peripheral provides BLE Mesh Network functionality.

Data Structures

struct  rm_ble_mesh_network_header_t
 
struct  rm_ble_mesh_network_seq_number_state_t
 
struct  rm_ble_mesh_network_route_info_t
 
struct  rm_ble_mesh_network_proxy_address_list_t
 
struct  rm_ble_mesh_network_callback_args_t
 
struct  rm_ble_mesh_network_cfg_t
 
struct  rm_ble_mesh_network_api_t
 
struct  rm_ble_mesh_network_instance_t
 

Macros

#define RM_BLE_MESH_NETWORK_UNASSIGNED_ADDRESS
 
#define RM_BLE_MESH_NETWORK_PRIMARY_SUBNET
 
#define RM_BLE_MESH_NETWORK_INVALID_SUBNET_HANDLE
 
#define RM_BLE_MESH_NETWORK_INVALID_APPKEY_HANDLE
 
#define RM_BLE_MESH_NETWORK_INVALID_NID
 

Typedefs

typedef uint16_t rm_ble_mesh_network_address_t
 
typedef uint16_t rm_ble_mesh_network_subnet_handle_t
 
typedef uint16_t rm_ble_mesh_network_appkey_handle_t
 
typedef uint16_t rm_ble_mesh_network_proxy_address_t
 
typedef uint8_t rm_ble_mesh_network_interface_handle_t
 
typedef void rm_ble_mesh_network_ctrl_t
 

Enumerations

enum  rm_ble_mesh_network_old_packet_treatment_t
 
enum  rm_ble_mesh_network_rx_state_event_t
 
enum  rm_ble_mesh_network_tx_state_event_t
 
enum  rm_ble_mesh_network_address_type_t
 
enum  rm_ble_mesh_proxy_filter_type_t
 
enum  rm_ble_mesh_proxy_config_opcode_t
 
enum  rm_ble_mesh_network_gatt_proxy_state_t
 
enum  rm_ble_mesh_network_gatt_proxy_adv_mode_t
 
enum  rm_ble_mesh_network_event_t
 

Data Structure Documentation

◆ rm_ble_mesh_network_header_t

struct rm_ble_mesh_network_header_t

Network Header Type

Data Fields
uint8_t ivi

Least significant bit of IV Index - 1 bit

uint8_t nid

Value derived from the NetKey used to identify the Encrytion Key and Privacy Key used to secure this PDU - 7 bits

uint8_t new_key

Indicates use of a new NetKey to which the network is being updated to.

uint8_t ctl

Network Control - 1 bit

uint8_t ttl

Time To Live - 7 bits

rm_ble_mesh_network_address_t src_addr

16 Bit Source Address

rm_ble_mesh_network_address_t dst_addr

16 Bit Destination Address

uint32_t seq_num

24 bit sequence number - currently filled only in reception path

◆ rm_ble_mesh_network_seq_number_state_t

struct rm_ble_mesh_network_seq_number_state_t

Current Sequence Number and Block State

Data Fields
uint32_t seq_num

Current Sequence Number

uint32_t block_seq_num_max

Block Sequence number - maximum available

◆ rm_ble_mesh_network_route_info_t

struct rm_ble_mesh_network_route_info_t

Network configuration information

Data Fields
rm_ble_mesh_network_interface_handle_t * interface_handle

Pointer to list of address to be added/deleted

rm_ble_mesh_network_subnet_handle_t subnet_handle

Count of addresses present in the provided list

◆ rm_ble_mesh_network_proxy_address_list_t

struct rm_ble_mesh_network_proxy_address_list_t

Proxy Server's filter List

Data Fields
rm_ble_mesh_network_proxy_address_t * address

Pointer to list of address to be added/deleted

uint16_t count

Count of addresses present in the provided list

◆ rm_ble_mesh_network_callback_args_t

struct rm_ble_mesh_network_callback_args_t

BLE Mesh Network callback parameter definition

Data Fields
rm_ble_mesh_network_event_t event Event code.
rm_ble_mesh_network_header_t * p_header Network header type.
rm_ble_mesh_network_subnet_handle_t subnet_handle Subnet handle.
rm_ble_mesh_network_interface_handle_t * p_network_interface Network interface handle.
rm_ble_mesh_buffer_t event_data Event data.
void const * p_context Context provided to user during callback.

◆ rm_ble_mesh_network_cfg_t

struct rm_ble_mesh_network_cfg_t

BLE MESH NETWORK configuration parameters.

Data Fields

uint32_t channel
 Select a channel corresponding to the channel number of the hardware. More...
 
rm_ble_mesh_bearer_instance_t const * p_mesh_bearer_instance
 Instance structure of BLE Mesh Bearer.
 
rm_ble_mesh_provision_instance_t const * p_mesh_provision_instance
 Instance structure of BLE Mesh Provision.
 
void(* p_callback )(rm_ble_mesh_network_callback_args_t *p_args)
 Callback function.
 
void const * p_context
 Placeholder for user data. Passed to the user callback in ble_abs_callback_args_t.
 
void const * p_extend
 Placeholder for user extension.
 

Field Documentation

◆ channel

uint32_t rm_ble_mesh_network_cfg_t::channel

Select a channel corresponding to the channel number of the hardware.

the parameters for initialization.

◆ rm_ble_mesh_network_api_t

struct rm_ble_mesh_network_api_t

BLE MESH NETWORK functions implemented at the HAL layer will follow this API.

Data Fields

fsp_err_t(* open )(rm_ble_mesh_network_ctrl_t *const p_ctrl, rm_ble_mesh_network_cfg_t const *const p_cfg)
 
fsp_err_t(* close )(rm_ble_mesh_network_ctrl_t *const p_ctrl)
 
fsp_err_t(* broadcastSecureBeacon )(rm_ble_mesh_network_ctrl_t *const p_ctrl, rm_ble_mesh_network_subnet_handle_t subnet_handle)
 
fsp_err_t(* 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(* 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(* 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(* 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(* 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(* 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(* stopProxyServerAdv )(rm_ble_mesh_network_ctrl_t *const p_ctrl)
 
fsp_err_t(* allocateSeqNumber )(rm_ble_mesh_network_ctrl_t *const p_ctrl, uint32_t *const p_seq_num)
 
fsp_err_t(* 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(* 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(* resetNetCache )(rm_ble_mesh_network_ctrl_t *const p_ctrl)
 

Field Documentation

◆ open

fsp_err_t(* rm_ble_mesh_network_api_t::open) (rm_ble_mesh_network_ctrl_t *const p_ctrl, rm_ble_mesh_network_cfg_t const *const p_cfg)

Register Interface with Network Layer.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_cfgPointer to pin configuration structure.

◆ close

fsp_err_t(* rm_ble_mesh_network_api_t::close) (rm_ble_mesh_network_ctrl_t *const p_ctrl)

Unregister Interface with Network Layer.

Parameters
[in]p_ctrlPointer to control structure.

◆ broadcastSecureBeacon

fsp_err_t(* rm_ble_mesh_network_api_t::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.

Parameters
[in]p_ctrlPointer to control structure.
[in]subnet_handleSubnet handle of the network to be broadcasted.

◆ sendPduOnInterface

fsp_err_t(* rm_ble_mesh_network_api_t::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.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_route_infoPointer to network configuration information.
[in]p_headerPointer to network Header.
[in]p_bufferPointer to Lower Transport Payload.

◆ getAddressType

fsp_err_t(* rm_ble_mesh_network_api_t::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.

Parameters
[in]p_ctrlPointer to control structure.
[in]addrInput network address.
[in]p_typeOne of the following address type RM_BLE_MESH_NETWORK_ADDRESS_TYPE_INVALID RM_BLE_MESH_NETWORK_ADDRESS_TYPE_UNICAST RM_BLE_MESH_NETWORK_ADDRESS_TYPE_GROUP

◆ fetchProxyState

fsp_err_t(* rm_ble_mesh_network_api_t::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.

Parameters
[in]p_ctrlPointer to control structure.
[out]p_proxy_stateReturns the current state of the proxy.

◆ setProxyFilter

fsp_err_t(* rm_ble_mesh_network_api_t::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.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_route_infoPointer to network configuration information.
[in]typeType of the proxy filter to be set. Either RM_BLE_MESH_NETWORK_PROXY_FILTER_TYPE_WHITELIST or RM_BLE_MESH_NETWORK_PROXY_FILTER_TYPE_BLACKLIST

◆ configProxyFilter

fsp_err_t(* rm_ble_mesh_network_api_t::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.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_route_infoPointer to network configuration information.
[in]opcodeOperation to be performed. Either RM_BLE_MESH_NETWORK_PROXY_CONFIG_OPECODE_ADD_TO_FILTER or RM_BLE_MESH_NETWORK_PROXY_CONFIG_OPECODE_REM_FROM_FILTER
[in]p_addr_listPointer to list of address to be added/deleted. And count of addresses present in the provided List.

◆ startProxyServerAdv

fsp_err_t(* rm_ble_mesh_network_api_t::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.

Parameters
[in]p_ctrlPointer to control structure.
[in]subnet_handleSubnet handle which the proxy server is part of network.
[in]proxy_adv_modeMode of proxy advertisements. This could be of two types RM_BLE_MESH_NETWORK_GATT_PROXY_ADV_MODE_NET_ID or RM_BLE_MESH_NETWORK_GATT_PROXY_ADV_MODE_NODE_ID

◆ stopProxyServerAdv

fsp_err_t(* rm_ble_mesh_network_api_t::stopProxyServerAdv) (rm_ble_mesh_network_ctrl_t *const p_ctrl)

Stop connectable advertisements for a proxy server.

Parameters
[in]p_ctrlPointer to control structure.

◆ allocateSeqNumber

fsp_err_t(* rm_ble_mesh_network_api_t::allocateSeqNumber) (rm_ble_mesh_network_ctrl_t *const p_ctrl, uint32_t *const p_seq_num)

To allocate sequence number.

Parameters
[in]p_ctrlPointer to control structure.
[out]p_seq_numLocation where sequence number to be filled.

◆ getSeqNumberState

fsp_err_t(* rm_ble_mesh_network_api_t::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.

Parameters
[in]p_ctrlPointer to control structure.
[out]p_seq_num_stateLocation where sequence number state to be filled.

◆ setSeqNumberState

fsp_err_t(* rm_ble_mesh_network_api_t::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.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_seq_num_stateLocation from where sequence number state to be taken.

◆ resetNetCache

fsp_err_t(* rm_ble_mesh_network_api_t::resetNetCache) (rm_ble_mesh_network_ctrl_t *const p_ctrl)

To reinitialize all Network Layer cache entries.

Parameters
[in]p_ctrlPointer to control structure.

◆ rm_ble_mesh_network_instance_t

struct rm_ble_mesh_network_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
rm_ble_mesh_network_ctrl_t * p_ctrl Pointer to the control structure for this instance.
rm_ble_mesh_network_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
rm_ble_mesh_network_api_t const * p_api Pointer to the API structure for this instance.

Macro Definition Documentation

◆ RM_BLE_MESH_NETWORK_UNASSIGNED_ADDRESS

#define RM_BLE_MESH_NETWORK_UNASSIGNED_ADDRESS

Unassigned Address.

◆ RM_BLE_MESH_NETWORK_PRIMARY_SUBNET

#define RM_BLE_MESH_NETWORK_PRIMARY_SUBNET

Primary Subnet - NetKey Index is 0x000

◆ RM_BLE_MESH_NETWORK_INVALID_SUBNET_HANDLE

#define RM_BLE_MESH_NETWORK_INVALID_SUBNET_HANDLE

Invalid Subnet Handle

◆ RM_BLE_MESH_NETWORK_INVALID_APPKEY_HANDLE

#define RM_BLE_MESH_NETWORK_INVALID_APPKEY_HANDLE

Invalid AppKey Handle

◆ RM_BLE_MESH_NETWORK_INVALID_NID

#define RM_BLE_MESH_NETWORK_INVALID_NID

Invalid NID Identifier. The NID is a 7-bit value that identifies the security material that is used to secure Network PDUs. Treating 0xFF as Invalid NID value.

Typedef Documentation

◆ rm_ble_mesh_network_address_t

Network Address Type

◆ rm_ble_mesh_network_subnet_handle_t

Subnet Handle

◆ rm_ble_mesh_network_appkey_handle_t

AppKey Handle

◆ rm_ble_mesh_network_proxy_address_t

Proxy Address

◆ rm_ble_mesh_network_interface_handle_t

Network Interface Handle

◆ rm_ble_mesh_network_ctrl_t

BLE MESH NETWORK control block. Allocate an instance specific control block to pass into the BLE MESH API calls.

Enumeration Type Documentation

◆ rm_ble_mesh_network_old_packet_treatment_t

Ignore network cache wrapping.

Enumerator
RM_BLE_MESH_NETWORK_OLD_PACKET_TREATMENT_DROPPED 

Old packets will be dropped.

RM_BLE_MESH_NETWORK_OLD_PACKET_TREATMENT_PROCESSED 

Ignores cache wrapping. Old packets will be processed.

◆ rm_ble_mesh_network_rx_state_event_t

Whether to enable the RX callback event or not.

Enumerator
RM_BLE_MESH_NETWORK_RX_STATE_EVENT_DISABLE 

RX state callback disable.

RM_BLE_MESH_NETWORK_RX_STATE_EVENT_ENABLE 

RX state callback enable.

◆ rm_ble_mesh_network_tx_state_event_t

Whether to enable the TX callback event or not.

Enumerator
RM_BLE_MESH_NETWORK_TX_STATE_EVENT_DISABLE 

TX state callback disable.

RM_BLE_MESH_NETWORK_TX_STATE_EVENT_ENABLE 

TX state callback enable.

◆ rm_ble_mesh_network_address_type_t

Address Type

Enumerator
RM_BLE_MESH_NETWORK_ADDRESS_TYPE_INVALID 

Invalid address type

RM_BLE_MESH_NETWORK_ADDRESS_TYPE_UNICAST 

Unicast address type

RM_BLE_MESH_NETWORK_ADDRESS_TYPE_VIRTUAL 

Virtual address type

RM_BLE_MESH_NETWORK_ADDRESS_TYPE_GROUP 

Group address type

◆ rm_ble_mesh_proxy_filter_type_t

Data structures for filter type and address list

Enumerator
RM_BLE_MESH_NETWORK_PROXY_FILTER_TYPE_WHITELIST 

GATT Proxy Filter Types - Whitelist

RM_BLE_MESH_NETWORK_PROXY_FILTER_TYPE_BLACKLIST 

GATT Proxy Filter Type - Blacklist

◆ rm_ble_mesh_proxy_config_opcode_t

GATT Proxy Configuration Opcodes

Enumerator
RM_BLE_MESH_NETWORK_PROXY_CONFIG_OPECODE_SET_FILTER 

GATT Proxy Configuration - Set Filter Opcode

RM_BLE_MESH_NETWORK_PROXY_CONFIG_OPECODE_ADD_TO_FILTER 

GATT Proxy Configuration - Add to Filter Opcode

RM_BLE_MESH_NETWORK_PROXY_CONFIG_OPECODE_REM_FROM_FILTER 

GATT Proxy Configuration - Remove From Filter Opcode

RM_BLE_MESH_NETWORK_PROXY_CONFIG_OPECODE_FILTER_STATUS 

GATT Proxy Configuration - Filter Status Opcode

◆ rm_ble_mesh_network_gatt_proxy_state_t

GATT Proxy States.

Proxy Callback Proxy Iface Error Code
NULL Down MS_PROXY_NULL
NULL Up MS_PROXY_NULL
!NULL Down MS_PROXY_READY
!NULL UP MS_PROXY_CONNECTED
Enumerator
RM_BLE_MESH_NETWORK_GATT_PROXY_STATE_NULL 

GATT Proxy State - Invalid/Not Initialized

RM_BLE_MESH_NEgTWORK_GATT_PROXY_STATE_READY 

GATT Proxy State - Ready/Initialized

RM_BLE_MESH_NETWORK_GATT_PROXY_STATE_CONNECTED 

GATT Proxy State - Connected

◆ rm_ble_mesh_network_gatt_proxy_adv_mode_t

GATT Proxy ADV Modes

Enumerator
RM_BLE_MESH_NETWORK_GATT_PROXY_ADV_MODE_NET_ID 

Network ID Type

RM_BLE_MESH_NETWORK_GATT_PROXY_ADV_MODE_NODE_ID 

Node Identity Type

◆ rm_ble_mesh_network_event_t

GATT Proxy Events

Enumerator
RM_BLE_MESH_NETWORK_EVENT_PROXY_UP 

GATT Proxy Event - Interface Up

RM_BLE_MESH_NETWORK_EVENT_PROXY_DOWN 

GATT Proxy Event - Interface Down

RM_BLE_MESH_NETWORK_EVENT_PROXY_STATUS 

GATT Proxy Event - Status

RM_BLE_MESH_NETWORK_EVENT_RECIEVE 

GATT Proxy Event - Receive

RM_BLE_MESH_NETWORK_EVENT_TX_QUEUE_EMPTY 

GATT Proxy Event - TX queue empty