RA Flexible Software Package Documentation  Release v5.2.0

 
BLE Mesh Network Bearer (rm_ble_mesh_bearer)

Functions

fsp_err_t RM_BLE_MESH_BEARER_Open (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_cfg_t const *const p_cfg)
 
fsp_err_t RM_BLE_MESH_BEARER_Close (rm_ble_mesh_bearer_ctrl_t *const p_ctrl)
 
fsp_err_t RM_BLE_MESH_BEARER_RegisterInterface (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_type_t brr_type, rm_ble_mesh_bearer_ntf_callback_result_t(*p_callback)(rm_ble_mesh_bearer_ntf_callback_args_t *p_args))
 
fsp_err_t RM_BLE_MESH_BEARER_RegisterBeaconHandler (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_beacon_type_t bcon_type, void(*p_handler)(rm_ble_mesh_bearer_beacon_callback_args_t *p_args))
 
fsp_err_t RM_BLE_MESH_BEARER_AddBearer (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_type_t brr_type, rm_ble_mesh_bearer_info_t const *const p_brr_info, rm_ble_mesh_bearer_handle_t *const p_brr_handle)
 
fsp_err_t RM_BLE_MESH_BEARER_RemoveBearer (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_type_t brr_type, rm_ble_mesh_bearer_handle_t const *const p_brr_handle)
 
fsp_err_t RM_BLE_MESH_BEARER_ObserveBeacon (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t bcon_type, uint8_t enable)
 
fsp_err_t RM_BLE_MESH_BEARER_BcastUnprovisionedBeacon (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t type, uint8_t const *const p_dev_uuid, uint16_t oob_info, rm_ble_mesh_buffer_t const *const p_uri)
 
fsp_err_t RM_BLE_MESH_BEARER_BroadcastBeacon (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t type, uint8_t const *const p_packet, uint16_t length)
 
fsp_err_t RM_BLE_MESH_BEARER_StartProxyAdv (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t type, uint8_t const *const p_data, uint16_t datalen)
 
fsp_err_t RM_BLE_MESH_BEARER_SendPdu (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, rm_ble_mesh_bearer_handle_t const *const p_brr_handle, rm_ble_mesh_bearer_type_t brr_type, rm_ble_mesh_buffer_t const *const p_buffer)
 
fsp_err_t RM_BLE_MESH_BEARER_GetPacketRssi (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t *p_rssi_value)
 
fsp_err_t RM_BLE_MESH_BEARER_Sleep (rm_ble_mesh_bearer_ctrl_t *const p_ctrl)
 
fsp_err_t RM_BLE_MESH_BEARER_Wakeup (rm_ble_mesh_bearer_ctrl_t *const p_ctrl, uint8_t mode)
 

Detailed Description

Overview

Target Devices

The BLE Mesh Network Bearer module supports the following devices.

Configuration

Build Time Configurations for rm_ble_mesh_bearer

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

ConfigurationOptionsDefaultDescription

Configurations for Networking > BLE Mesh Network modules > BLE Mesh Bearer (rm_ble_mesh_bearer)

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

ConfigurationOptionsDefaultDescription
General
NameName Must Be a Valid C Symbolg_rm_ble_mesh_bearer0 Module name.
Channel NumberInvalid Channel Number0 Select channel corresponding to the channel number of the hardware.

Data Structures

struct  rm_ble_mesh_bearer_instance_ctrl_t
 

Data Structure Documentation

◆ rm_ble_mesh_bearer_instance_ctrl_t

struct rm_ble_mesh_bearer_instance_ctrl_t

RM_BLE_MESH_BEARER private control block. DO NOT MODIFY. Initialization occurs when RM_BLE_MESH_BEARER_Open() is called.

Function Documentation

◆ RM_BLE_MESH_BEARER_Open()

fsp_err_t RM_BLE_MESH_BEARER_Open ( rm_ble_mesh_bearer_ctrl_t *const  p_ctrl,
rm_ble_mesh_bearer_cfg_t const *const  p_cfg 
)

Open bearer middleware.

Implements rm_ble_mesh_bearer_api_t::open.

Example:

/* Open the module. */
err = RM_BLE_MESH_BEARER_Open(&g_ble_mesh_bearer0_ctrl, &g_ble_mesh_bearer0_cfg);
Return values
FSP_SUCCESSModule opened successfully.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_ALREADY_OPENModel is already open.

◆ RM_BLE_MESH_BEARER_Close()

fsp_err_t RM_BLE_MESH_BEARER_Close ( rm_ble_mesh_bearer_ctrl_t *const  p_ctrl)

Close bearer middleware. Implements rm_ble_mesh_bearer_api_t::close.

Example:

/* Open the module. */
err = RM_BLE_MESH_BEARER_Close(&g_ble_mesh_bearer0_ctrl);
Return values
FSP_SUCCESSModule successfully closed.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_INVALID_STATELower layer is invalid state.

◆ RM_BLE_MESH_BEARER_RegisterInterface()

fsp_err_t RM_BLE_MESH_BEARER_RegisterInterface ( rm_ble_mesh_bearer_ctrl_t *const  p_ctrl,
rm_ble_mesh_bearer_type_t  brr_type,
rm_ble_mesh_bearer_ntf_callback_result_t(*)(rm_ble_mesh_bearer_ntf_callback_args_t *p_args)  p_callback 
)

Register interface with Bearer Layer. This routine registers interface with the Bearer Layer. Bearer Layer supports single Application, hence this rouine shall be called once.

Implements rm_ble_mesh_bearer_api_t::registerInterface.

Example:

/* Register Bearer interface. */
err = RM_BLE_MESH_BEARER_RegisterInterface(&g_ble_mesh_bearer0_ctrl, brr_type, rm_ble_mesh_bearer_ntf_callback);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_INVALID_ARGUMENTInput parameter is invalid.

◆ RM_BLE_MESH_BEARER_RegisterBeaconHandler()

fsp_err_t RM_BLE_MESH_BEARER_RegisterBeaconHandler ( rm_ble_mesh_bearer_ctrl_t *const  p_ctrl,
rm_ble_mesh_bearer_beacon_type_t  bcon_type,
void(*)(rm_ble_mesh_bearer_beacon_callback_args_t *p_args)  p_handler 
)

Register beacon interface with Bearer Layer. This routine registers interface with the Bearer Layer to process Beacons. Bearer Layer supports single Application, hence this rouine shall be called once.

Implements rm_ble_mesh_bearer_api_t::registerBeaconHandler.

Example:

/* Register beacon handler. */
err = RM_BLE_MESH_BEARER_RegisterBeaconHandler(&g_ble_mesh_bearer0_ctrl,
rm_ble_mesh_bearer_beacon_callback);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_BEARER_AddBearer()

fsp_err_t RM_BLE_MESH_BEARER_AddBearer ( rm_ble_mesh_bearer_ctrl_t *const  p_ctrl,
rm_ble_mesh_bearer_type_t  brr_type,
rm_ble_mesh_bearer_info_t const *const  p_brr_info,
rm_ble_mesh_bearer_handle_t *const  p_brr_handle 
)

Add a bearer to Bearer Layer. This routine adds a bearer that is setup by the application for use by the Mesh Stack. Bearer Layer supports single Application, hence this rouine shall be called once.

Implements rm_ble_mesh_bearer_api_t::addBearer.

Example:

/* Add Bearer. */
err = RM_BLE_MESH_BEARER_AddBearer(&g_ble_mesh_bearer0_ctrl, RM_BLE_MESH_BEARER_TYPE_BCON, &brr_info, &brr_handle);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_brr_info and p_brr_handle are NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_BEARER_RemoveBearer()

fsp_err_t RM_BLE_MESH_BEARER_RemoveBearer ( rm_ble_mesh_bearer_ctrl_t *const  p_ctrl,
rm_ble_mesh_bearer_type_t  brr_type,
rm_ble_mesh_bearer_handle_t const *const  p_brr_handle 
)

Remove a bearer from Bearer Layer. This routine removes a bearer from the Mesh Stack. Bearer Layer supports single Application, hence this rouine shall be called once.

Implements rm_ble_mesh_bearer_api_t::removeBearer.

Example:

/* Remove Bearer. */
err = RM_BLE_MESH_BEARER_RemoveBearer(&g_ble_mesh_bearer0_ctrl, RM_BLE_MESH_BEARER_TYPE_BCON, &brr_handle);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_brr_handle is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_BEARER_ObserveBeacon()

fsp_err_t RM_BLE_MESH_BEARER_ObserveBeacon ( rm_ble_mesh_bearer_ctrl_t *const  p_ctrl,
uint8_t  bcon_type,
uint8_t  enable 
)

Observe on/off for the beacon type. This routine sends enables/disables the observation procedure for the given beacon type.

Implements rm_ble_mesh_bearer_api_t::observeBeacon.

Example:

/* Observe beacon. */
err = RM_BLE_MESH_BEARER_ObserveBeacon(&g_ble_mesh_bearer0_ctrl, bcon_type, enable);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_BEARER_BcastUnprovisionedBeacon()

fsp_err_t RM_BLE_MESH_BEARER_BcastUnprovisionedBeacon ( rm_ble_mesh_bearer_ctrl_t *const  p_ctrl,
uint8_t  type,
uint8_t const *const  p_dev_uuid,
uint16_t  oob_info,
rm_ble_mesh_buffer_t const *const  p_uri 
)

API to send unprovisioned device beacon. This routine sends Unprovisioned Device Beacon.

Implements rm_ble_mesh_bearer_api_t::bcastUnprovisionedBeacon.

Example:

/* Broadcast unprovisioned beacon. */
err = RM_BLE_MESH_BEARER_BcastUnprovisionedBeacon(&g_ble_mesh_bearer0_ctrl, type, &dev_uuid, oob_info, &uri);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_dev_uuid and p_uri are NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_BEARER_BroadcastBeacon()

fsp_err_t RM_BLE_MESH_BEARER_BroadcastBeacon ( rm_ble_mesh_bearer_ctrl_t *const  p_ctrl,
uint8_t  type,
uint8_t const *const  p_packet,
uint16_t  length 
)

API to broadcast a beacon. This routine sends the beacon of given type on Adv and GATT bearers.

Implements rm_ble_mesh_bearer_api_t::broadcastBeacon.

Example:

/* Broadcast beacon. */
err = RM_BLE_MESH_BEARER_BroadcastBeacon(&g_ble_mesh_bearer0_ctrl, type, &packet, length);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_packet is NULL.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_INVALID_STATELower layer is invalid state.

◆ RM_BLE_MESH_BEARER_StartProxyAdv()

fsp_err_t RM_BLE_MESH_BEARER_StartProxyAdv ( rm_ble_mesh_bearer_ctrl_t *const  p_ctrl,
uint8_t  type,
uint8_t const *const  p_data,
uint16_t  datalen 
)

API to send proxy device ADV. This routine sends Proxy Device ADV.

Implements rm_ble_mesh_bearer_api_t::startProxyAdv.

Example:

/* Start proxy advertising. */
err = RM_BLE_MESH_BEARER_StartProxyAdv(&g_ble_mesh_bearer0_ctrl, type, &data, length);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_data is NULL.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_INVALID_STATELower layer is invalid state.

◆ RM_BLE_MESH_BEARER_SendPdu()

fsp_err_t RM_BLE_MESH_BEARER_SendPdu ( rm_ble_mesh_bearer_ctrl_t *const  p_ctrl,
rm_ble_mesh_bearer_handle_t const *const  p_brr_handle,
rm_ble_mesh_bearer_type_t  brr_type,
rm_ble_mesh_buffer_t const *const  p_buffer 
)

Send a bearer PDU. This routine sends a PDU from the Mesh stack to over the bearer indicated by the bearer handle.

Implements rm_ble_mesh_bearer_api_t::sendPdu.

Example:

/* Send common Bearer PDUs. */
err = RM_BLE_MESH_BEARER_SendPdu(&g_ble_mesh_bearer0_ctrl, &brr_handle, RM_BLE_MESH_BEARER_TYPE_BCON, &buffer);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_brr_handle and p_buffer are NULL.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_INVALID_ARGUMENTInput parameter is invalid.

◆ RM_BLE_MESH_BEARER_GetPacketRssi()

fsp_err_t RM_BLE_MESH_BEARER_GetPacketRssi ( rm_ble_mesh_bearer_ctrl_t *const  p_ctrl,
uint8_t *  p_rssi_value 
)

Get the RSSI of current received packet being processed. This routine returns the RSSI value of the received packet in its context when called from the Mesh stack.

Implements rm_ble_mesh_bearer_api_t::getPacketRssi.

Example:

/* Get the RSSI of current received packet being processed. */
err = RM_BLE_MESH_BEARER_GetPacketRssi(&g_ble_mesh_bearer0_ctrl, &rssi_value);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_rssi_value is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_BEARER_Sleep()

fsp_err_t RM_BLE_MESH_BEARER_Sleep ( rm_ble_mesh_bearer_ctrl_t *const  p_ctrl)

Put the bearer to sleep. This routine requests the underlying bearer interface to sleep. Default bearer interface is that of advertising bearer.

Implements rm_ble_mesh_bearer_api_t::sleep.

Example:

/* Put the bearer to sleep. */
err = RM_BLE_MESH_BEARER_Sleep(&g_ble_mesh_bearer0_ctrl);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_BLE_MESH_BEARER_Wakeup()

fsp_err_t RM_BLE_MESH_BEARER_Wakeup ( rm_ble_mesh_bearer_ctrl_t *const  p_ctrl,
uint8_t  mode 
)

Wakeup the bearer. This routine requests the underlying bearer interface to wakeup. Default bearer interface is that of advertising bearer.

Implements rm_ble_mesh_bearer_api_t::wakeup.

Example:

/* Wakeup the bearer. */
err = RM_BLE_MESH_BEARER_Wakeup(&g_ble_mesh_bearer0_ctrl, mode);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_NOT_OPENModule is not open.