RA Flexible Software Package Documentation  Release v5.2.0

 
BLE Mesh Network Bearer Platform (rm_mesh_bearer_platform)

Functions

fsp_err_t RM_MESH_BEARER_PLATFORM_Open (rm_mesh_bearer_platform_ctrl_t *const p_ctrl, rm_mesh_bearer_platform_cfg_t const *const p_cfg)
 
fsp_err_t RM_MESH_BEARER_PLATFORM_Close (rm_mesh_bearer_platform_ctrl_t *const p_ctrl)
 
fsp_err_t RM_MESH_BEARER_PLATFORM_Setup (rm_mesh_bearer_platform_ctrl_t *const p_ctrl)
 
fsp_err_t RM_MESH_BEARER_PLATFORM_CallbackSet (rm_mesh_bearer_platform_ctrl_t *const p_ctrl, rm_mesh_bearer_platform_gatt_iface_cb_t callback)
 
fsp_err_t RM_MESH_BEARER_PLATFORM_SetGattMode (rm_mesh_bearer_platform_ctrl_t *const p_ctrl, rm_mesh_bearer_platform_gatt_mode_t mode)
 
fsp_err_t RM_MESH_BEARER_PLATFORM_GetGattMode (rm_mesh_bearer_platform_ctrl_t *const p_ctrl, rm_mesh_bearer_platform_gatt_mode_t *p_mode)
 
fsp_err_t RM_MESH_BEARER_PLATFORM_SetScanResponseData (rm_mesh_bearer_platform_ctrl_t *const p_ctrl, uint8_t *p_data, uint8_t len)
 
fsp_err_t RM_MESH_BEARER_PLATFORM_ScanGattBearer (rm_mesh_bearer_platform_ctrl_t *const p_ctrl, rm_mesh_bearer_platform_state_t state, rm_mesh_bearer_platform_gatt_mode_t mode)
 
fsp_err_t RM_MESH_BEARER_PLATFORM_Connect (rm_mesh_bearer_platform_ctrl_t *const p_ctrl, uint8_t *p_remote_address, uint8_t address_type, rm_mesh_bearer_platform_gatt_mode_t mode)
 
fsp_err_t RM_MESH_BEARER_PLATFORM_DiscoverService (rm_mesh_bearer_platform_ctrl_t *const p_ctrl, uint16_t handle, rm_mesh_bearer_platform_gatt_mode_t mode)
 
fsp_err_t RM_MESH_BEARER_PLATFORM_ConfigureNotification (rm_mesh_bearer_platform_ctrl_t *const p_ctrl, uint16_t handle, rm_mesh_bearer_platform_state_t state, rm_mesh_bearer_platform_gatt_mode_t mode)
 
fsp_err_t RM_MESH_BEARER_PLATFORM_Disconnect (rm_mesh_bearer_platform_ctrl_t *const p_ctrl, uint16_t handle)
 

Detailed Description

Overview

Target Devices

The BLE Mesh Network Bearer Platform module supports the following devices.

Configuration

Build Time Configurations for rm_mesh_bearer_platform

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

ConfigurationOptionsDefaultDescription
Debug Public AddressMust be a valid device addressFF:FF:FF:50:90:74 Public Address of firmware initial value.
Debug Random AddressMust be a valid device addressFF:FF:FF:FF:FF:FF Random Address of firmware initial value.
Maximum number of connectionsValue must be an integer between 1 and 7, and lower than the value defined in ble module.7 Maximum number of connections.
Maximum connection data lengthValue must be an integer between 27 and 251, and lower than the value defined in ble module.251 Maximum connection data length.
Maximum advertising data lengthValue must be an integer between 31 and 1650, and lower than the value defined in ble module.1650 Maximum advertising data length.
Maximum advertising set numberValue must be an integer between 1 and 4, and lower than the value defined in ble module.4 Maximum advertising set number.
Maximum periodic sync set number.Value must be an integer between 1 and 2, and lower than the value defined in ble module.2 Maximum periodic sync set number.
Store Security Data
  • Disable
  • Enable
Disable Store Security Data in DataFlash.
Data Flash Block for Security DataValue must be an integer between 0 and 7, and lower than the value defined in ble module.0 Data Flash Block for Security Data Management.
Remote Device Bonding NumberValue must be an integer between 1 and 7, and lower than the value defined in ble module.7 Number of remote device bonding information.
Connection Event Start Notify
  • Disable
  • Enable
Disable Set Connection event start notify enable/disable.
Connection Event Close Notify
  • Disable
  • Enable
Disable Set Connection event close notify enable/disable.
Advertising Event Start Notify
  • Disable
  • Enable
Disable Set Advertising event start notify enable/disable.
Advertising Event Close Notify
  • Disable
  • Enable
Disable Set Advertising event close notify enable/disable.
Scanning Event Start Notify
  • Disable
  • Enable
Disable Set Scanning event start notify enable/disable.
Scanning Event Close Notify
  • Disable
  • Enable
Disable Set Scanning event close notify enable/disable.
Initiating Event Start Notify
  • Disable
  • Enable
Disable Set Initiating event start notify enable/disable.
Initiating Event Close Notify
  • Disable
  • Enable
Disable Set Initiating event close notify enable/disable.
RF Deep Sleep Start Notify
  • Disable
  • Enable
Disable Set RF_DEEP_SLEEP start notify enable/disable.
RF Deep Sleep Wakeup Notify
  • Disable
  • Enable
Disable Set RF_DEEP_SLEEP wakeup notify enable/disable.
Bluetooth dedicated clockValue must be an integer between 0 and 15, and lower than the value defined in ble module.6 Load capacitance adjustment.
DC-DC converter
  • Disable
  • Enable
Disable Set DC-DC converter for RF part.
Slow Clock Source
  • Use RF_LOCO
  • Use External 32.768kHz
Use RF_LOCO Set slow clock source for RF part.
MCU CLKOUT Port
  • P109
  • P205
P109 When MESH_BEARER_PLATFORM_CFG_RF_EXTERNAL_32K_ENABLE = 1, Set port of MCU CLKOUT.
MCU CLKOUT Frequency Output
  • MCU CLKOUT frequency 32.768kHz
  • MCU CLKOUT frequency 16.384kHz
MCU CLKOUT frequency 32.768kHz When MESH_BEARER_PLATFORM_CFG_RF_EXTERNAL_32K_ENABLE = 1, set frequency output from CLKOUT of MCU part.
Sleep Clock Accuracy(SCA)Value must be an integer between 0 and 500, and lower than the value defined in ble module.250 When MESH_BEARER_PLATFORM_CFG_RF_EXTERNAL_32K_ENABLE = 1, set Sleep Clock Accuracy(SCA) for RF slow clock.
Transmission Power Maximum Value
  • max +0dBm
  • max +4dBm
max +4dBm Set transmission power maximum value.
Transmission Power Default Value
  • High 0dBm(Transmission Power Maximum Value = +0dBm) / +4dBm(Transmission Power Maximum Value = +4dBm)
  • Mid 0dBm(Transmission Power Maximum Value = +0dBm) / 0dBm(Transmission Power Maximum Value = +4dBm)
  • Low -18dBm(Transmission Power Maximum Value = +0dBm) / -20dBm(Transmission Power Maximum Value = +4dBm)
High 0dBm(Transmission Power Maximum Value = +0dBm) / +4dBm(Transmission Power Maximum Value = +4dBm) Set default transmit power. Default transmit power is dependent on the configuration of Maximum transmission power(MESH_BEARER_PLATFORM_CFG_RF_MAX_TX_POW).
CLKOUT_RF Output
  • No output
  • 4MHz output
  • 2MHz output
  • 1MHz output
No output Set CLKOUT_RF output setting.
RF_DEEP_SLEEP Transition
  • Disable
  • Enable
Enable Set RF_DEEP_SLEEP transition.
MCU Main Clock FrequencyValue must be an integer between 1000 and 20000, and lower than the value defined in ble module.8000 Set MCU Main Clock Frequency (kHz). Set clock source according to your board environment. HOCO: don't care. / Main Clock: 1000 to 20000 kHz / PLL Circuit: 4000 to 12500 kHz
Code Flash(ROM) Device Data BlockValue must be an integer between -1 and 255, and lower than the value defined in ble module.255 Device specific data block on Code Flash (ROM).
Device Specific Data Flash BlockValue must be an integer between -1 and 7, and lower than the value defined in ble module.-1 Device specific data block on E2 Data Flash.
MTU Size ConfiguredValue must be an integer between 23 and 247, and lower than the value defined in ble module.247 MTU Size configured by GATT MTU exchange procedure.
Timer Slot Maximum NumberValue must be an integer between 1 and 10, and lower than the value defined in ble module.10 The maximum number of timer slot.

Configurations for Networking > BLE Mesh Network modules > BLE Mesh Bearer Platform (rm_mesh_bearer_platform)

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

ConfigurationOptionsDefaultDescription
General
NameName Must Be a Valid C Symbolg_rm_mesh_bearer_platform0 Module name.
Channel NumberInvalid Channel Number0 Select channel corresponding to the channel number of the hardware.
Device Address TypeInvalid Device Address Type0 Select device address type ( public : 0, random : 1).
GATT Server Callback NumberInvalid Callback Number1 Number of GATT server callback.
GATT Client Callback NumberInvalid Callback Number1 Number of GATT client callback.
Vender Specific CallbackName Must Be a Valid C Symbol.NULL Vendor specific callback function name.

Data Structures

struct  rm_mesh_bearer_platform_instance_ctrl_t
 
struct  rm_mesh_bearer_platform_extended_cfg_t
 

Typedefs

typedef void(* rm_mesh_bearer_platform_gatt_iface_cb_t) (uint8_t event_name, uint8_t event_param, uint16_t conn_hdl, st_ble_dev_addr_t *peer_addr)
 Callback function for GATT interface event. More...
 

Enumerations

enum  rm_mesh_bearer_platform_interface_event_t
 

Data Structure Documentation

◆ rm_mesh_bearer_platform_instance_ctrl_t

struct rm_mesh_bearer_platform_instance_ctrl_t

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

◆ rm_mesh_bearer_platform_extended_cfg_t

struct rm_mesh_bearer_platform_extended_cfg_t

Bearer port extension for renesas BLE stack.

Typedef Documentation

◆ rm_mesh_bearer_platform_gatt_iface_cb_t

typedef void(* rm_mesh_bearer_platform_gatt_iface_cb_t) (uint8_t event_name, uint8_t event_param, uint16_t conn_hdl, st_ble_dev_addr_t *peer_addr)

Callback function for GATT interface event.

Parameters
event_nameThe event defined by rm_mesh_bearer_platform_interface_event_t
event_paramThe mode of GATT connection rm_mesh_bearer_platform_gatt_mode_t
conn_hdlThe connection handle
peer_addrPointer to the connected device address

Enumeration Type Documentation

◆ rm_mesh_bearer_platform_interface_event_t

GATT Interface Events

Enumerator
RM_MESH_BEARER_PLATFORM_INTERFACE_EVENT_UP 

The event GATT Bearer BLE Link Layer connected

RM_MESH_BEARER_PLATFORM_INTERFACE_EVENT_DOWN 

The event GATT Bearer BLE Link Layer disconnected

RM_MESH_BEARER_PLATFORM_INTERFACE_EVENT_ENABLE 

The event GATT Bearer service enabled for communication

RM_MESH_BEARER_PLATFORM_INTERFACE_EVENT_DISABLE 

The event GATT Bearer service disabled for communication

RM_MESH_BEARER_PLATFORM_INTERFACE_EVENT_NOT_FOUND 

The event discovery process is not completed

RM_MESH_BEARER_PLATFORM_INTERFACE_EVENT_SCAN 

The event that connectable device having Mesh GATT Service is found

RM_MESH_BEARER_PLATFORM_INTERFACE_EVENT_CANCEL 

The Event GATT/BLE link layer connection creation is canceled

Function Documentation

◆ RM_MESH_BEARER_PLATFORM_Open()

fsp_err_t RM_MESH_BEARER_PLATFORM_Open ( rm_mesh_bearer_platform_ctrl_t *const  p_ctrl,
rm_mesh_bearer_platform_cfg_t const *const  p_cfg 
)

Open Bearer Platform middleware. Initialize underlying BLE Protocol Stack to use as a Mesh Bearer. API to initialize underlying BLE Protocol Stack to use as a Mesh Bearer. Completion of the initialization is notified by the callback function.

Implements rm_mesh_bearer_platform_api_t::open.

Example:

/* Open the module. */
err = RM_MESH_BEARER_PLATFORM_Open(&g_mesh_bearer_platform0_ctrl, &g_mesh_bearer_platform0_cfg);
Return values
FSP_SUCCESSModule opened successfully.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_ALREADY_OPENModule is already open.
FSP_ERR_INVALID_ARGUMENTInput parameter is invalid.

◆ RM_MESH_BEARER_PLATFORM_Close()

fsp_err_t RM_MESH_BEARER_PLATFORM_Close ( rm_mesh_bearer_platform_ctrl_t *const  p_ctrl)

Close Bearer Platform middleware. Terminate BLE stack.

Implements rm_mesh_bearer_platform_api_t::close.

Example:

/* Close the module. */
err = RM_MESH_BEARER_PLATFORM_Close(&g_mesh_bearer_platform0_ctrl);
Return values
FSP_SUCCESSModule opened successfully.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_MESH_BEARER_PLATFORM_Setup()

fsp_err_t RM_MESH_BEARER_PLATFORM_Setup ( rm_mesh_bearer_platform_ctrl_t *const  p_ctrl)

Register ADV bearer with Mesh stack and start scan. API to register ADV bearer with Mesh stack. After registering, this routine starts Scan.

Parameters
[in]p_ctrlrm_mesh_bearer_platform control block.
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_NOT_OPENModel is not open.

◆ RM_MESH_BEARER_PLATFORM_CallbackSet()

fsp_err_t RM_MESH_BEARER_PLATFORM_CallbackSet ( rm_mesh_bearer_platform_ctrl_t *const  p_ctrl,
rm_mesh_bearer_platform_gatt_iface_cb_t  callback 
)

Register callback function to receive GATT interface events. API to register callback function to receive GATT interface events.

Parameters
[in]p_ctrlrm_mesh_bearer_platform control block.
[in]callbackCallback function.
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_NOT_OPENModel is not open.

◆ RM_MESH_BEARER_PLATFORM_SetGattMode()

fsp_err_t RM_MESH_BEARER_PLATFORM_SetGattMode ( rm_mesh_bearer_platform_ctrl_t *const  p_ctrl,
rm_mesh_bearer_platform_gatt_mode_t  mode 
)

Set GATT Bearer mode.

Parameters
[in]p_ctrlrm_mesh_bearer_platform control block.
[in]modeGATT interface mode, either RM_MESH_BEARER_PLATFORM_GATT_MODE_PROVISION or RM_MESH_BEARER_PLATFORM_GATT_MODE_PROXY.
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_NOT_OPENModel is not open.

◆ RM_MESH_BEARER_PLATFORM_GetGattMode()

fsp_err_t RM_MESH_BEARER_PLATFORM_GetGattMode ( rm_mesh_bearer_platform_ctrl_t *const  p_ctrl,
rm_mesh_bearer_platform_gatt_mode_t p_mode 
)

Get current GATT Bearer mode.

Parameters
[in]p_ctrlrm_mesh_bearer_platform control block.
[in]p_modeGATT interface mode, either RM_MESH_BEARER_PLATFORM_GATT_MODE_PROVISION or RM_MESH_BEARER_PLATFORM_GATT_MODE_PROXY.
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_mode is NULL.
FSP_ERR_NOT_OPENModel is not open.

◆ RM_MESH_BEARER_PLATFORM_SetScanResponseData()

fsp_err_t RM_MESH_BEARER_PLATFORM_SetScanResponseData ( rm_mesh_bearer_platform_ctrl_t *const  p_ctrl,
uint8_t *  p_data,
uint8_t  len 
)

Set scan response data in connectable and scannable undirected advertising event. API to Set Scan Response Data in Connectable and scannable undirected Advertising event. Scan Response Data can be used for indicating additional information such as << Complete Local Name>>.

Implements rm_mesh_bearer_platform_api_t::setScanResponseData.

Example:

/* Set scan response data in connectable and scannable undirected advertising event.. */
err = RM_MESH_BEARER_PLATFORM_SetScanResponseData(&g_mesh_bearer_platform0_ctrl, &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.

◆ RM_MESH_BEARER_PLATFORM_ScanGattBearer()

fsp_err_t RM_MESH_BEARER_PLATFORM_ScanGattBearer ( rm_mesh_bearer_platform_ctrl_t *const  p_ctrl,
rm_mesh_bearer_platform_state_t  state,
rm_mesh_bearer_platform_gatt_mode_t  mode 
)

Manage reporting connectable device having Mesh GATT service. API to manage reporting connectable device having Mesh GATT service.

Parameters
[in]p_ctrlrm_mesh_bearer_platform control block.
[in]stateNotification configuration flag; enable if RM_MESH_BEARER_PLATFORM_STATE_ENABLE, or disable if RM_MESH_BEARER_PLATFORM_STATE_DISABLE.
[in]modeGATT interface mode, either RM_MESH_BEARER_PLATFORM_GATT_MODE_PROVISION or RM_MESH_BEARER_PLATFORM_GATT_MODE_PROXY.
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_NOT_OPENModel is not open.

◆ RM_MESH_BEARER_PLATFORM_Connect()

fsp_err_t RM_MESH_BEARER_PLATFORM_Connect ( rm_mesh_bearer_platform_ctrl_t *const  p_ctrl,
uint8_t *  p_remote_address,
uint8_t  address_type,
rm_mesh_bearer_platform_gatt_mode_t  mode 
)

Request to create connection. API to request to Create Connection. Completion of the establishing a connection is notified by RM_BLE_MESH_BEARER_IFACE_UP. After establishing a connection, RM_MESH_BEARER_PLATFORM_DiscoverService() is invoked automatically.

Implements rm_mesh_bearer_platform_api_t::connect.

Example:

/* Request to create connection. */
err = RM_MESH_BEARER_PLATFORM_Connect(&g_mesh_bearer_platform0_ctrl,
&remote_address,
bearer_address_type,
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_remote_address is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_MESH_BEARER_PLATFORM_DiscoverService()

fsp_err_t RM_MESH_BEARER_PLATFORM_DiscoverService ( rm_mesh_bearer_platform_ctrl_t *const  p_ctrl,
uint16_t  handle,
rm_mesh_bearer_platform_gatt_mode_t  mode 
)

Start service discovery for Mesh GATT service. API to start Service Discovery for Mesh GATT Service. If Mesh GATT Service specified by the "mode" argument, this routine enables Notification of the Mesh GATT Service by invoking RM_MESH_BEARER_PLATFORM_ConfigureNotification().

Implements rm_mesh_bearer_platform_api_t::discoverService.

Example:

/* Start service discovery for Mesh GATT service. */
err = RM_MESH_BEARER_PLATFORM_DiscoverService(&g_mesh_bearer_platform0_ctrl,
handle,
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_MESH_BEARER_PLATFORM_ConfigureNotification()

fsp_err_t RM_MESH_BEARER_PLATFORM_ConfigureNotification ( rm_mesh_bearer_platform_ctrl_t *const  p_ctrl,
uint16_t  handle,
rm_mesh_bearer_platform_state_t  state,
rm_mesh_bearer_platform_gatt_mode_t  mode 
)

Configure GATT notification of Mesh GATT service. API to configure GATT Notification of Mesh GATT Service.

Implements rm_mesh_bearer_platform_api_t::configureNotification.

Example:

/* Configure GATT notification of Mesh GATT service. */
err = RM_MESH_BEARER_PLATFORM_ConfigureNotification(&g_mesh_bearer_platform0_ctrl,
handle,
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_MESH_BEARER_PLATFORM_Disconnect()

fsp_err_t RM_MESH_BEARER_PLATFORM_Disconnect ( rm_mesh_bearer_platform_ctrl_t *const  p_ctrl,
uint16_t  handle 
)

Terminate Connection. API to terminate connection.

Implements rm_mesh_bearer_platform_api_t::disconnect.

Example:

/* Terminate Connection. */
err = RM_MESH_BEARER_PLATFORM_Disconnect(&g_mesh_bearer_platform0_ctrl, handle);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_NOT_OPENModule is not open.