RA Flexible Software Package Documentation  Release v5.6.0

 
BLE Abstraction (rm_ble_abs)

Functions

fsp_err_t RM_BLE_ABS_Open (ble_abs_ctrl_t *const p_ctrl, ble_abs_cfg_t const *const p_cfg)
 
fsp_err_t RM_BLE_ABS_Close (ble_abs_ctrl_t *const p_ctrl)
 Close the BLE channel. Implements ble_abs_api_t::close. More...
 
fsp_err_t RM_BLE_ABS_Reset (ble_abs_ctrl_t *const p_ctrl, ble_event_cb_t init_callback)
 
fsp_err_t RM_BLE_ABS_StartLegacyAdvertising (ble_abs_ctrl_t *const p_ctrl, ble_abs_legacy_advertising_parameter_t const *const p_advertising_parameter)
 
fsp_err_t RM_BLE_ABS_StartExtendedAdvertising (ble_abs_ctrl_t *const p_ctrl, ble_abs_extend_advertising_parameter_t const *const p_advertising_parameter)
 
fsp_err_t RM_BLE_ABS_StartNonConnectableAdvertising (ble_abs_ctrl_t *const p_ctrl, ble_abs_non_connectable_advertising_parameter_t const *const p_advertising_parameter)
 
fsp_err_t RM_BLE_ABS_StartPeriodicAdvertising (ble_abs_ctrl_t *const p_ctrl, ble_abs_periodic_advertising_parameter_t const *const p_advertising_parameter)
 
fsp_err_t RM_BLE_ABS_StartScanning (ble_abs_ctrl_t *const p_ctrl, ble_abs_scan_parameter_t const *const p_scan_parameter)
 
fsp_err_t RM_BLE_ABS_CreateConnection (ble_abs_ctrl_t *const p_ctrl, ble_abs_connection_parameter_t const *const p_connection_parameter)
 
fsp_err_t RM_BLE_ABS_SetLocalPrivacy (ble_abs_ctrl_t *const p_ctrl, uint8_t const *const p_lc_irk, uint8_t privacy_mode)
 
fsp_err_t RM_BLE_ABS_StartAuthentication (ble_abs_ctrl_t *const p_ctrl, uint16_t connection_handle)
 
fsp_err_t RM_BLE_ABS_DeleteBondInformation (ble_abs_ctrl_t *const p_ctrl, ble_abs_bond_information_parameter_t const *const p_bond_information_parameter)
 
fsp_err_t RM_BLE_ABS_ImportKeyInformation (ble_abs_ctrl_t *const p_ctrl, ble_device_address_t *p_local_identity_address, uint8_t *p_local_irk, uint8_t *p_local_csrk)
 
fsp_err_t RM_BLE_ABS_ExportKeyInformation (ble_abs_ctrl_t *const p_ctrl, ble_device_address_t *p_local_identity_address, uint8_t *p_local_irk, uint8_t *p_local_csrk)
 

Detailed Description

Middleware for the Bluetooth peripheral on RA MCUs. This module implements the BLE ABS Interface.

Overview

This module provides BLE GAP functionality that complies with the Bluetooth Core Specification version 5.0 specified by the Bluetooth SIG. This module is configured via the QE for BLE. QE for BLE provides standard services defined by standardization organization and custom services defined by user. Bluetooth LE Profile API Document User's Manual describes the APIs for standard services.

Features

The Bluetooth Low Energy (BLE) Abstraction module supports the following features:

BLE Library Configuration

There are three types of BLE Protocol Stacks, and the functions provided are different depending on the type of BLE Protocol Stack you select.

BLE library feature Extended Balance Compact
GAP Role Central Peripheral Observer Broadcaster Central Peripheral Observer Broadcaster Peripheral Broadcaster
LE 2M PHY Yes Yes No
LE Coded PHY Yes Yes No
LE Advertising Extensions Yes No No
LE Channel Selection Algorithm #2 Yes Yes No
High Duty Cycle Non-Connectable Advertising Yes Yes Yes
LE Secure Connections Yes Yes Yes
Link Layer privacy Yes Yes Yes
Link Layer Extended Scanner Filter policies Yes Yes No
LE Data Packet Length Extension Yes Yes Yes
LE L2CAP Connection Oriented Channel Support Yes No No
Low Duty Cycle Directed Advertising Yes Yes Yes
LE Link Layer Topology Yes Yes No
LE Ping Yes Yes Yes
32-bit UUID Support in LE Yes Yes Yes

Target Devices

The BLE Abstraction module supports the following devices.

Configuration

Build Time Configurations for rm_ble_abs

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

ConfigurationOptionsDefaultDescription
Parameter Checking
  • Default (BSP)
  • Enable
  • Disable
Default (BSP) Specify whether to include code for API parameter checking. Valid settings include.
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 BLE_ABS_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 BLE_ABS_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 BLE_ABS_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(BLE_ABS_CFG_RF_DEF_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 Abstraction (rm_ble_abs)

This module can be added to the Stacks tab via New Stack > Networking > BLE Abstraction (rm_ble_abs).

ConfigurationOptionsDefaultDescription
General
NameName must be a valid C symbolg_ble_abs0 Module name.
Gap callbackName must be a valid C symbolgap_cb A user callback function must be provided if the BLE_ABS is configured to generate a GAP. If QE is used, set to NULL.
Vendor specific callbackName must be a valid C symbolvs_cb A user callback function must be provided if the BLE_ABS is configured to generate a Vendor Specific. If QE is used, set to NULL.
GATT server callback parameterName must be a valid C symbolgs_abs_gatts_cb_param Set GATT server callback parameter. If QE is used, set to NULL.
GATT server callback numberMust be a valid number2 The number of GATT Server callback functions.
GATT client callback parameterName must be a valid C symbolgs_abs_gattc_cb_param Set GATT client callback parameter. If QE is used, set to NULL.
GATT client callback numberMust be a valid number2 The number of GATT Server callback functions.
Security
Pairing parametersName must be a valid C symbolgs_abs_pairing_param Set pairing parameters.
IO capabilities of local device.
  • BLE_GAP_IOCAP_DISPLAY_ONLY
  • BLE_GAP_IOCAP_DISPLAY_YESNO
  • BLE_GAP_IOCAP_KEYBOARD_ONLY
  • BLE_GAP_IOCAP_NOINPUT_NOOUTPUT
  • BLE_GAP_IOCAP_KEYBOARD_DISPLAY
BLE_GAP_IOCAP_NOINPUT_NOOUTPUT Select IO capabilities of local device.
MITM protection policy.
  • BLE_GAP_SEC_MITM_BEST_EFFORT
  • BLE_GAP_SEC_MITM_STRICT
BLE_GAP_SEC_MITM_BEST_EFFORT Select MITM protection policy.
Determine whether to accept only Secure Connections or not.
  • BLE_GAP_SC_BEST_EFFORT
  • BLE_GAP_SC_STRICT
BLE_GAP_SC_BEST_EFFORT Select determine whether to accept only Secure Connections or not.
Type of keys to be distributed from local device.
  • BLE_GAP_KEY_DIST_ENCKEY
  • BLE_GAP_KEY_DIST_IDKEY
  • BLE_GAP_KEY_DIST_SIGNKEY
Select type of keys to be distributed from local device.
Type of keys which local device requests a remote device to distribute.
  • BLE_GAP_KEY_DIST_ENCKEY
  • BLE_GAP_KEY_DIST_IDKEY
  • BLE_GAP_KEY_DIST_SIGNKEY
Set type of keys which local device requests a remote device to distribute.
Maximum LTK size.Valid range is 7 - 1616 Set Maximum LTK size.
Interrupts
Callback provided when an ISR occursName must be a valid C symbolNULL Callback provided when BLE ABS ISR occurs

Clock Configuration

Note
System clock (ICLK): 8 MHz or more
Peripheral module clock A (PCLKA): 8MHz or more
The BLE Protocol Stack is optimized for ICLK and PCLKA frequencies of 32 MHz.
It is recommended that the clock be set so that the ICLK and PCLKA frequencies are 32MHz in order to get the best performance from the BLE.

Pin Configuration

This module does not use I/O pins.

Stack Size Configuration

Note
When you use BLE on RTOS environment, make sure that thread stack size must be 0x1000 or more which call R_BLE_Execute.

Usage Notes

Limitations

Developers should be aware of the following limitations when using the BLE_ABS:

Examples

BLE_ABS Basic Example

This is a basic example of minimal use of the BLE_ABS in an application.

#define BLE_ABS_EVENT_FLAG_STACK_ON (0x01 << 0)
#define BLE_ABS_EVENT_FLAG_CONN_IND (0x01 << 1)
#define BLE_ABS_EVENT_FLAG_ADV_ON (0x01 << 2)
#define BLE_ABS_EVENT_FLAG_ADV_OFF (0x01 << 3)
#define BLE_ABS_EVENT_FLAG_DISCONN_IND (0x01 << 4)
#define BLE_ABS_EVENT_FLAG_RSLV_LIST_CONF_COMP (0x01 << 5)
#define BLE_ABS_EXAMPLE_SHORTENED_LOCAL_NAME 'E', 'x', 'a', 'm', 'p', 'l', 'e'
#define BLE_ABS_EXAMPLE_COMPLETE_LOCAL_NAME 'T', 'E', 'S', 'T', '_', 'E', 'x', 'a', 'm', 'p', 'l', 'e'
#define BLE_ABS_EXAMPLE_SLOW_ADVERTISING_INTERVAL (0x00000640)
void ble_abs_peripheral_example (void)
{
fsp_err_t err = FSP_SUCCESS;
volatile uint32_t timeout = UINT16_MAX * UINT8_MAX * 8;
ble_device_address_t local_identity_address;
uint8_t local_irk[BLE_GAP_IRK_SIZE];
uint8_t local_csrk[BLE_GAP_CSRK_SIZE];
uint8_t * p_local_irk = NULL;
uint8_t privacy_mode = BLE_GAP_NET_PRIV_MODE;
uint8_t advertising_data[] =
{
/* Flags */
0x02,
0x01,
(0x1a),
/* Shortened Local Name */
0x08,
0x08,
BLE_ABS_EXAMPLE_SHORTENED_LOCAL_NAME,
};
/* Scan Response Data */
uint8_t scan_response_data[] =
{
/* Complete Local Name */
0x0D,
0x09,
BLE_ABS_EXAMPLE_COMPLETE_LOCAL_NAME,
};
ble_abs_legacy_advertising_parameter_t legacy_advertising_parameter =
{
.p_peer_address = NULL,
.slow_advertising_interval = BLE_ABS_EXAMPLE_SLOW_ADVERTISING_INTERVAL,
.slow_advertising_period = 0x0000,
.p_advertising_data = advertising_data,
.advertising_data_length = sizeof(advertising_data),
.p_scan_response_data = scan_response_data,
.scan_response_data_length = sizeof(scan_response_data),
.advertising_filter_policy = BLE_ABS_ADVERTISING_FILTER_ALLOW_ANY,
.advertising_channel_map = (BLE_GAP_ADV_CH_37 | BLE_GAP_ADV_CH_38 | BLE_GAP_ADV_CH_39),
.own_bluetooth_address_type = BLE_GAP_ADDR_PUBLIC,
.own_bluetooth_address = {0},
};
g_ble_event_flag = 0;
/* Open the module. */
err = RM_BLE_ABS_Open(&g_ble_abs0_ctrl, &g_ble_abs0_cfg);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
/* Wait BLE_GAP_EVENT_STACK_ON event is notified. */
while (!(BLE_ABS_EVENT_FLAG_STACK_ON & g_ble_event_flag) && (--timeout > 0U))
{
}
/* Set local privacy. */
err = RM_BLE_ABS_SetLocalPrivacy(&g_ble_abs0_ctrl, p_local_irk, privacy_mode);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
/* Wait BLE_GAP_EVENT_RSLV_LIST_CONF_COMP event is notified. */
while (!(BLE_ABS_EVENT_FLAG_RSLV_LIST_CONF_COMP & g_ble_event_flag) && (--timeout > 0U))
{
}
time_out_handle_error(timeout);
g_ble_event_flag = 0;
timeout = UINT16_MAX * UINT8_MAX * 8;
/* Start advertising. */
err = RM_BLE_ABS_StartLegacyAdvertising(&g_ble_abs0_ctrl, &legacy_advertising_parameter);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
while (!(BLE_ABS_EVENT_FLAG_CONN_IND & g_ble_event_flag) && (--timeout > 0U))
{
if (BLE_ABS_EVENT_FLAG_ADV_OFF & g_ble_event_flag)
{
/* Restart advertise, when stop advertising. */
err = RM_BLE_ABS_StartLegacyAdvertising(&g_ble_abs0_ctrl, &legacy_advertising_parameter);
if (FSP_SUCCESS == err)
{
g_ble_event_flag &= (uint16_t) ~BLE_ABS_EVENT_FLAG_ADV_OFF;
}
else if (FSP_ERR_INVALID_STATE == err)
{
/* BLE driver state is busy. */
;
}
else
{
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
}
}
else if ((timeout % BLE_ABS_RETRY_INTERVAL) == 0U)
{
/* Stop advertising after a certain amount of time */
R_BLE_GAP_StopAdv(g_advertising_handle);
}
else
{
;
}
}
time_out_handle_error(timeout);
/* Export local key information. */
err = RM_BLE_ABS_ExportKeyInformation(&g_ble_abs0_ctrl, &local_identity_address, local_irk, local_csrk);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
/* Clean up & Close BLE driver */
g_ble_event_flag = 0;
/* Close BLE driver */
err = RM_BLE_ABS_Close(&g_ble_abs0_ctrl);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
}
#define BLE_ABS_EVENT_FLAG_STACK_ON (0x01 << 0)
#define BLE_ABS_EVENT_FLAG_CONN_IND (0x01 << 1)
#define BLE_ABS_EVENT_FLAG_ADV_REPT_IND (0x01 << 2)
#define BLE_ABS_EVENT_FLAG_ADV_OFF (0x01 << 3)
#define BLE_ABS_EVENT_FLAG_PAIRING_COMP (0x01 << 4)
#define BLE_ABS_EVENT_FLAG_SCAN_TIMEOUT (0x01 << 5)
#define BLE_ABS_EVENT_FLAG_DELETE_BOND_COMP (0x01 << 6)
#define BLE_ABS_EXAMPLE_FAST_SCAN_INTERVAL (0x0060)
#define BLE_ABS_EXAMPLE_FAST_SCAN_WINDOW (0x0030)
#define BLE_ABS_EXAMPLE_SLOW_SCAN_INTERVAL (0x0800)
#define BLE_ABS_EXAMPLE_SLOW_SCAN_WINDOW (0x0012)
#define BLE_ABS_EXAMPLE_FAST_SCAN_PERIOD (0x0BB8)
#define BLE_ABS_EXAMPLE_SLOW_SCAN_PERIOD (0x0000)
#define BLE_ABS_EXAMPLE_CONNECTION_INTERVAL (0x0028)
#define BLE_ABS_EXAMPLE_SUPERVISION_TIMEOUT (0x0200)
#define BLE_ABS_EXAMPLE_DEVICE_ADDRESS 0x88, 0x88, 0x88, 0x88, 0x88, 0x88
#define BLE_ABS_EXAMPLE_IRK 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5
#define BLE_ABS_EXAMPLE_CSRK 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5
#define BLE_ABS_SCAN_FILTER_DATA_LENGTH (12)
/* Scan filter data (data type: Complete Local Name ) */
static uint8_t g_filter_data[] =
{
BLE_ABS_EXAMPLE_COMPLETE_LOCAL_NAME
};
/* Connection phy parameters */
ble_abs_connection_phy_parameter_t g_connection_phy_parameter =
{
.connection_interval = BLE_ABS_EXAMPLE_CONNECTION_INTERVAL, /* 50.0(ms) */
.supervision_timeout = BLE_ABS_EXAMPLE_SUPERVISION_TIMEOUT, /* 5,120(ms) */
.connection_slave_latency = 0x0000,
};
/* Connection device address */
ble_device_address_t g_connection_device_address;
/* Connection parameters */
ble_abs_connection_parameter_t g_connection_parameter =
{
.p_connection_phy_parameter_1M = &g_connection_phy_parameter,
.p_device_address = &g_connection_device_address,
.filter_parameter = BLE_GAP_INIT_FILT_USE_ADDR,
.connection_timeout = 0x05, /* 5(s) */
};
ble_abs_bond_information_parameter_t g_bond_information_parameter =
{
.local_bond_information = BLE_ABS_LOCAL_BOND_INFORMATION_ALL,
.remote_bond_information = BLE_ABS_REMOTE_BOND_INFORMATION_ALL,
.delete_non_volatile_area = BLE_ABS_DELETE_NON_VOLATILE_AREA_ENABLE,
.p_address = NULL,
.abs_delete_bond_callback = delete_bond_cb,
};
void ble_abs_central_example (void)
{
fsp_err_t err = FSP_SUCCESS;
volatile uint32_t timeout = UINT16_MAX * UINT8_MAX * 8;
g_connection_handle = BLE_GAP_INVALID_CONN_HDL;
ble_device_address_t local_identity_address =
{
.addr = {BLE_ABS_EXAMPLE_DEVICE_ADDRESS},
};
uint8_t local_irk[BLE_GAP_IRK_SIZE] = {BLE_ABS_EXAMPLE_IRK};
uint8_t local_csrk[BLE_GAP_CSRK_SIZE] = {BLE_ABS_EXAMPLE_CSRK};
static ble_abs_scan_phy_parameter_t scan_phy_parameter =
{
.fast_scan_interval = BLE_ABS_EXAMPLE_FAST_SCAN_INTERVAL, /* 60.0(ms) */
.fast_scan_window = BLE_ABS_EXAMPLE_FAST_SCAN_WINDOW, /* 30.0(ms) */
.slow_scan_interval = BLE_ABS_EXAMPLE_SLOW_SCAN_INTERVAL, /* 1,280.0(ms) */
.slow_scan_window = BLE_ABS_EXAMPLE_SLOW_SCAN_WINDOW, /* 11.25(ms) */
.scan_type = BLE_GAP_SCAN_ACTIVE
};
/* Scan parameters */
ble_abs_scan_parameter_t scan_parameter =
{
.p_phy_parameter_1M = &scan_phy_parameter,
.fast_scan_period = BLE_ABS_EXAMPLE_FAST_SCAN_PERIOD, /* 30,000(ms) */
.slow_scan_period = BLE_ABS_EXAMPLE_SLOW_SCAN_PERIOD,
.p_filter_data = g_filter_data,
.filter_data_length = (uint16_t) BLE_ABS_SCAN_FILTER_DATA_LENGTH,
.filter_ad_type = 0x09, /* Data type: Complete Local Name */
.device_scan_filter_policy = BLE_GAP_SCAN_ALLOW_ADV_ALL,
.filter_duplicate = BLE_GAP_SCAN_FILT_DUPLIC_ENABLE,
};
g_ble_event_flag = 0;
/* Open the module. */
err = RM_BLE_ABS_Open(&g_ble_abs0_ctrl, &g_ble_abs0_cfg);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
/* Connection parameters */
while (!(BLE_ABS_EVENT_FLAG_STACK_ON & g_ble_event_flag) && (--timeout > 0U))
{
}
/* Import local key information. */
err = RM_BLE_ABS_ImportKeyInformation(&g_ble_abs0_ctrl, &local_identity_address, local_irk, local_csrk);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
/* Start scanning. */
err = RM_BLE_ABS_StartScanning(&g_ble_abs0_ctrl, &scan_parameter);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
while ((BLE_ABS_EVENT_FLAG_ADV_REPT_IND & g_ble_event_flag) && (--timeout > 0U))
{
if ((BLE_ABS_EVENT_FLAG_SCAN_TIMEOUT & g_ble_event_flag) || (BLE_GAP_EVENT_SCAN_OFF & g_ble_event_flag))
{
g_ble_event_flag &= (uint16_t) ~BLE_ABS_EVENT_FLAG_ADV_OFF;
g_ble_event_flag &= (uint16_t) ~BLE_ABS_EVENT_FLAG_SCAN_TIMEOUT;
/* Start scanning. */
err = RM_BLE_ABS_StartScanning(&g_ble_abs0_ctrl, &scan_parameter);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
}
else if ((timeout % BLE_ABS_RETRY_INTERVAL) == 0U)
{
/* Stop scanning after a certain amount of time */
}
else
{
;
}
}
g_ble_event_flag = 0;
time_out_handle_error(timeout);
timeout = UINT16_MAX * UINT8_MAX * 8;
/* Create connection with remote device. */
err = RM_BLE_ABS_CreateConnection(&g_ble_abs0_ctrl, &g_connection_parameter);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
/* Wait BLE_GAP_EVENT_CONN_IND event is notified. */
while (!(BLE_ABS_EVENT_FLAG_CONN_IND & g_ble_event_flag) && (--timeout > 0U))
{
}
time_out_handle_error(timeout);
g_ble_event_flag = 0;
timeout = UINT16_MAX * UINT8_MAX * 8;
/* Start authentication with remote device. */
err = RM_BLE_ABS_StartAuthentication(&g_ble_abs0_ctrl, g_connection_handle);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
/* Wait BLE_GAP_EVENT_PAIRING_COMP event is notified. */
while (!(BLE_ABS_EVENT_FLAG_PAIRING_COMP & g_ble_event_flag) && (--timeout > 0U))
{
}
time_out_handle_error(timeout);
g_ble_event_flag = 0;
timeout = UINT16_MAX * UINT8_MAX * 8;
/* Delete bonding information. */
err = RM_BLE_ABS_DeleteBondInformation(&g_ble_abs0_ctrl, &g_bond_information_parameter);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
/* Wait delete_bond_cb application callback function is called. */
while (!(BLE_ABS_EVENT_FLAG_DELETE_BOND_COMP & g_ble_event_flag) && (--timeout > 0U))
{
}
time_out_handle_error(timeout);
/* Clean up & Close BLE driver */
g_ble_event_flag = 0;
err = RM_BLE_ABS_Close(&g_ble_abs0_ctrl);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
}
void delete_bond_cb (st_ble_dev_addr_t * p_addr) {
(void) p_addr;
g_ble_event_flag = g_ble_event_flag | BLE_ABS_EVENT_FLAG_DELETE_BOND_COMP;
}

Data Structures

struct  abs_advertising_parameter_t
 
struct  abs_scan_parameter_t
 
struct  ble_abs_instance_ctrl_t
 

Typedefs

typedef void(* ble_abs_timer_cb_t) (uint32_t timer_hdl)
 

Enumerations

enum  e_ble_timer_type_t
 

Data Structure Documentation

◆ abs_advertising_parameter_t

struct abs_advertising_parameter_t

advertising set parameters structure

Data Fields
union abs_advertising_parameter_t advertising_parameter Advertising parameters.
uint32_t advertising_status Advertising status.
ble_device_address_t remote_device_address Remote device address for direct advertising.

◆ abs_scan_parameter_t

struct abs_scan_parameter_t

scan parameters structure

Data Fields
ble_abs_scan_parameter_t scan_parameter Scan parameters.
ble_abs_scan_phy_parameter_t scan_phy_parameter_1M 1M phy parameters for scan.
ble_abs_scan_phy_parameter_t scan_phy_parameter_coded Coded phy parameters for scan. */.
uint32_t scan_status

◆ ble_abs_instance_ctrl_t

struct ble_abs_instance_ctrl_t

BLE ABS private control block. DO NOT MODIFY. Initialization occurs when RM_BLE_ABS_Open() is called.

Data Fields
uint32_t open Indicates whether the open() API has been successfully called.
void const * p_context Placeholder for user data. Passed to the user callback in ble_abs_callback_args_t.
ble_gap_application_callback_t abs_gap_callback GAP callback function.
ble_vendor_specific_application_callback_t abs_vendor_specific_callback Vendor specific callback function.
ble_abs_delete_bond_application_callback_t abs_delete_bond_callback Delete bond information callback function.
uint32_t connection_timer_handle Cancel a request for connection timer.
uint32_t advertising_timer_handle Advertising timer for legacy advertising.
uint32_t scan_timer_handle Scan interval timer.
abs_advertising_parameter_t advertising_sets[BLE_MAX_NO_OF_ADV_SETS_SUPPORTED] Advertising set information.
abs_scan_parameter_t abs_scan Scan information.
st_ble_dev_addr_t loc_bd_addr Local device address.
uint8_t privacy_mode Privacy mode.
uint32_t set_privacy_status Local privacy status.
ble_abs_timer_t timer[BLE_ABS_CFG_TIMER_NUMBER_OF_SLOT]
uint8_t local_irk[BLE_GAP_IRK_SIZE]
ble_abs_identity_address_info_t identity_address_info
uint32_t current_timeout_ms Current timeout.
uint32_t elapsed_timeout_ms Elapsed timeout.
ble_abs_cfg_t const * p_cfg Pointer to the BLE ABS configuration block.

Typedef Documentation

◆ ble_abs_timer_cb_t

typedef void(* ble_abs_timer_cb_t) (uint32_t timer_hdl)

The timer callback invoked when the timer expired.

Enumeration Type Documentation

◆ e_ble_timer_type_t

The timer type.

Enumerator
BLE_TIMER_ONE_SHOT 

One shot timer type

BLE_TIMER_PERIODIC 

Periodic timer type

Function Documentation

◆ RM_BLE_ABS_Open()

fsp_err_t RM_BLE_ABS_Open ( ble_abs_ctrl_t *const  p_ctrl,
ble_abs_cfg_t const *const  p_cfg 
)

Host stack is initialized with this function. Before using All the R_BLE APIs, it's necessary to call this function. A callback functions are registered with this function. In order to receive the GAP, GATT, Vendor specific event, it's necessary to register a callback function. The result of this API call is notified in BLE_GAP_EVENT_STACK_ON event. Implements ble_abs_api_t::open.

Example:

/* Open the module. */
err = RM_BLE_ABS_Open(&g_ble_abs0_ctrl, &g_ble_abs0_cfg);
Return values
FSP_SUCCESSChannel opened successfully.
FSP_ERR_ASSERTIONNull pointer presented.
FSP_ERR_ALREADY_OPENRequested channel is already open in a different configuration.
FSP_ERR_INVALID_ARGUMENTInvalid input parameter.
FSP_ERR_INVALID_MODEInvalid mode during open call

Host stack is initialized with this function. Before using All the R_BLE APIs, it's necessary to call this function. A callback functions are registered with this function. In order to receive the GAP, GATT, Vendor specific event, it's necessary to register a callback function. The result of this API call is notified in BLE_GAP_EVENT_STACK_ON event. Implements ble_abs_api_t::open.

Example:

/* Open the module. */
err = RM_BLE_ABS_Open(&g_ble_abs0_ctrl, &g_ble_abs0_cfg);
Return values
FSP_SUCCESSChannel opened successfully.
FSP_ERR_ASSERTIONNull pointer presented.
FSP_ERR_ALREADY_OPENRequested channel is already open in a different configuration.
FSP_ERR_INVALID_ARGUMENTInvalid input parameter.
FSP_ERR_INVALID_MODEInvalid mode during open call

Host stack is initialized with this function. Before using All the R_BLE APIs, it's necessary to call this function. A callback functions are registered with this function. In order to receive the GAP, GATT, Vendor specific event, it's necessary to register a callback function. The result of this API call is notified in BLE_GAP_EVENT_STACK_ON event. Implements ble_abs_api_t::open.

Example:

/* Open the module. */
err = RM_BLE_ABS_Open(&g_ble_abs0_ctrl, &g_ble_abs0_cfg);
Return values
FSP_SUCCESSChannel opened successfully.
FSP_ERR_ASSERTIONNull pointer presented.
FSP_ERR_INVALID_CHANNELThe channel number is invalid.
FSP_ERR_ALREADY_OPENRequested channel is already open in a different configuration.
FSP_ERR_INVALID_ARGUMENTInvalid input parameter.

◆ RM_BLE_ABS_Close()

fsp_err_t RM_BLE_ABS_Close ( ble_abs_ctrl_t *const  p_ctrl)

Close the BLE channel. Implements ble_abs_api_t::close.

Example:

/* Close BLE driver */
err = RM_BLE_ABS_Close(&g_ble_abs0_ctrl);
Return values
FSP_SUCCESSChannel closed successfully.
FSP_ERR_ASSERTIONNull pointer presented.
FSP_ERR_NOT_OPENControl block not open.

Example:

/* Close BLE driver */
err = RM_BLE_ABS_Close(&g_ble_abs0_ctrl);
Return values
FSP_SUCCESSChannel closed successfully.
FSP_ERR_ASSERTIONNull pointer presented.
FSP_ERR_NOT_OPENControl block not open.

Example:

/* Close BLE driver */
err = RM_BLE_ABS_Close(&g_ble_abs0_ctrl);
Return values
FSP_SUCCESSChannel closed successfully.
FSP_ERR_ASSERTIONNull pointer presented.
FSP_ERR_NOT_OPENControl block not open.

◆ RM_BLE_ABS_Reset()

fsp_err_t RM_BLE_ABS_Reset ( ble_abs_ctrl_t *const  p_ctrl,
ble_event_cb_t  init_callback 
)

This function is not implemented. To perform this function call R_BLE_Close followed by R_BLE_Open. Implements ble_abs_api_t::reset.

Return values
FSP_ERR_UNSUPPORTEDFunction is not supported

BLE is reset with this function. The process is carried out in the following order. R_BLE_Close() -> R_BLE_GAP_Terminate() -> R_BLE_Open() -> R_BLE_SetEvent(). The init_cb callback initializes the others (Host Stack, timer, etc...). Implements ble_abs_api_t::reset.

Return values
FSP_SUCCESSChannel closed successfully.
FSP_ERR_ASSERTIONNull pointer presented.
FSP_ERR_NOT_OPENControl block not open.

◆ RM_BLE_ABS_StartLegacyAdvertising()

fsp_err_t RM_BLE_ABS_StartLegacyAdvertising ( ble_abs_ctrl_t *const  p_ctrl,
ble_abs_legacy_advertising_parameter_t const *const  p_advertising_parameter 
)

Start Legacy Advertising after setting advertising parameters, advertising data and scan response data. The legacy advertising uses the advertising set whose advertising handle is 0. The advertising type is connectable and scannable(ADV_IND). The address type of local device is Public Identity Address or RPA(If the resolving list contains no matching entry, use the public address.). Scan request event(BLE_GAP_EVENT_SCAN_REQ_RECV) is not notified. Implements ble_abs_api_t::startLegacyAdvertising

Example:

/* Start advertising. */
err = RM_BLE_ABS_StartLegacyAdvertising(&g_ble_abs0_ctrl, &legacy_advertising_parameter);
Return values
FSP_SUCCESSOperation succeeded
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_STATEHost stack hasn't been initialized.
FSP_ERR_INVALID_POINTERp_advertising_parameter is specified as NULL.
FSP_ERR_INVALID_ARGUMENTThe advertising parameter is out of range.

Start Legacy Advertising after setting advertising parameters, advertising data and scan response data. The legacy advertising uses the advertising set whose advertising handle is 0. The advertising type is connectable and scannable(ADV_IND). The address type of local device is Public Identity Address or RPA(If the resolving list contains no matching entry, use the public address.). Scan request event(BLE_GAP_EVENT_SCAN_REQ_RECV) is not notified. Implements ble_abs_api_t::startLegacyAdvertising

Example:

/* Start advertising. */
err = RM_BLE_ABS_StartLegacyAdvertising(&g_ble_abs0_ctrl, &legacy_advertising_parameter);
Return values
FSP_SUCCESSOperation succeeded
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_STATEHost stack hasn't been initialized.
FSP_ERR_INVALID_POINTERp_advertising_parameter is specified as NULL.
FSP_ERR_INVALID_ARGUMENTThe advertising parameter is out of range.

Start Legacy Advertising after setting advertising parameters, advertising data and scan response data. The legacy advertising uses the advertising set whose advertising handle is 0. The advertising type is connectable and scannable(ADV_IND). The address type of local device is Public Identity Address or RPA(If the resolving list contains no matching entry, use the public address.). Scan request event(BLE_GAP_EVENT_SCAN_REQ_RECV) is not notified. Implements ble_abs_api_t::startLegacyAdvertising

Example:

/* Start advertising. */
err = RM_BLE_ABS_StartLegacyAdvertising(&g_ble_abs0_ctrl, &legacy_advertising_parameter);
Return values
FSP_SUCCESSOperation succeeded
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_STATEHost stack hasn't been initialized.
FSP_ERR_INVALID_POINTERp_advertising_parameter is specified as NULL.
FSP_ERR_INVALID_ARGUMENTThe advertising parameter is out of range.

◆ RM_BLE_ABS_StartExtendedAdvertising()

fsp_err_t RM_BLE_ABS_StartExtendedAdvertising ( ble_abs_ctrl_t *const  p_ctrl,
ble_abs_extend_advertising_parameter_t const *const  p_advertising_parameter 
)

Start Extended Advertising after setting advertising parameters, advertising data. The extended advertising uses the advertising set whose advertising handle is 1. The advertising type is connectable and non-scannable. The address type of local device is Public Identity Address or RPA(If the resolving list contains no matching entry, use the public address.). Scan request event(BLE_GAP_EVENT_SCAN_REQ_RECV) is not notified. Implements ble_abs_api_t::startExtendedAdvertising

Return values
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_POINTERp_advertising_parameter is specified as NULL.
FSP_ERR_UNSUPPORTEDSubordinate modules do not support this feature.

Start Extended Advertising after setting advertising parameters, advertising data. The extended advertising uses the advertising set whose advertising handle is 1. The advertising type is connectable and non-scannable. The address type of local device is Public Identity Address or RPA(If the resolving list contains no matching entry, use the public address.). Scan request event(BLE_GAP_EVENT_SCAN_REQ_RECV) is not notified. Implements ble_abs_api_t::startExtendedAdvertising

Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_POINTERp_advertising_parameter is specified as NULL.
FSP_ERR_INVALID_STATEHost stack hasn't been initialized.
FSP_ERR_INVALID_ARGUMENTThe advertising parameter is out of range.
FSP_ERR_UNSUPPORTEDSubordinate modules do not support this feature.

◆ RM_BLE_ABS_StartNonConnectableAdvertising()

fsp_err_t RM_BLE_ABS_StartNonConnectableAdvertising ( ble_abs_ctrl_t *const  p_ctrl,
ble_abs_non_connectable_advertising_parameter_t const *const  p_advertising_parameter 
)

Start Non-Connectable Advertising after setting advertising parameters, advertising data. The non-connectable advertising uses the advertising set whose advertising handle is 2. The advertising type is non-connectable and non-scannable. The address type of local device is Public Identity Address or RPA(If the resolving list contains no matching entry, use the public address.). Scan request event(BLE_GAP_EVENT_SCAN_REQ_RECV) is not notified. Secondary Advertising Max Skip is 0. Implements ble_abs_api_t::startNonConnectableAdvertising.

Return values
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_POINTERp_advertising_parameter is specified as NULL.
FSP_ERR_UNSUPPORTEDFeature not yet supported.

Start Non-Connectable Advertising after setting advertising parameters, advertising data. The non-connectable advertising uses the advertising set whose advertising handle is 2. The advertising type is non-connectable and non-scannable. The address type of local device is Public Identity Address or RPA(If the resolving list contains no matching entry, use the public address.). Scan request event(BLE_GAP_EVENT_SCAN_REQ_RECV) is not notified. Secondary Advertising Max Skip is 0. Implements ble_abs_api_t::startNonConnectableAdvertising.

Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_POINTERp_advertising_parameter is specified as NULL.
FSP_ERR_INVALID_STATEHost stack hasn't been initialized.
FSP_ERR_INVALID_ARGUMENTThe advertising parameter is out of range.

◆ RM_BLE_ABS_StartPeriodicAdvertising()

fsp_err_t RM_BLE_ABS_StartPeriodicAdvertising ( ble_abs_ctrl_t *const  p_ctrl,
ble_abs_periodic_advertising_parameter_t const *const  p_advertising_parameter 
)

Start Periodic Advertising after setting advertising parameters, periodic advertising parameters, advertising data and periodic advertising data. The periodic advertising uses the advertising set whose advertising handle is 3. The advertising type is non-connectable and non-scannable. The address type of local device is Public Identity Address or RPA(If the resolving list contains no matching entry, use the public address.). Scan request event(BLE_GAP_EVENT_SCAN_REQ_RECV) is not notified. Secondary Advertising Max Skip is 0. Implements ble_abs_api_t::startPeriodicAdvertising

Return values
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_POINTERp_advertising_parameter is specified as NULL.
FSP_ERR_UNSUPPORTEDSubordinate modules do not support this feature.

Start Periodic Advertising after setting advertising parameters, periodic advertising parameters, advertising data and periodic advertising data. The periodic advertising uses the advertising set whose advertising handle is 3. The advertising type is non-connectable and non-scannable. The address type of local device is Public Identity Address or RPA(If the resolving list contains no matching entry, use the public address.). Scan request event(BLE_GAP_EVENT_SCAN_REQ_RECV) is not notified. Secondary Advertising Max Skip is 0. Implements ble_abs_api_t::startPeriodicAdvertising

Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_POINTERp_advertising_parameter is specified as NULL.
FSP_ERR_INVALID_ARGUMENTThe advertising parameter is out of range.
FSP_ERR_UNSUPPORTEDThis feature is not supported in this configuration.

◆ RM_BLE_ABS_StartScanning()

fsp_err_t RM_BLE_ABS_StartScanning ( ble_abs_ctrl_t *const  p_ctrl,
ble_abs_scan_parameter_t const *const  p_scan_parameter 
)

Start scanning after setting scan parameters. The scanner address type is Public Identity Address. Fast scan is followed by slow scan. The end of fast scan or slow scan is notified with BLE_GAP_EVENT_SCAN_TO event. If fast_period is 0, only slow scan is carried out. If scan_period is 0, slow scan continues. Implements ble_abs_api_t::startScanning.

Example:

/* Start scanning. */
err = RM_BLE_ABS_StartScanning(&g_ble_abs0_ctrl, &scan_parameter);
Return values
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_POINTERp_scan_parameter is specified as NULL.
FSP_ERR_UNSUPPORTEDFunction is not supported

Start scanning after setting scan parameters. The scanner address type is Public Identity Address. Fast scan is followed by slow scan. The end of fast scan or slow scan is notified with BLE_GAP_EVENT_SCAN_TO event. If fast_period is 0, only slow scan is carried out. If scan_period is 0, slow scan continues. Implements ble_abs_api_t::startScanning.

Example:

/* Start scanning. */
err = RM_BLE_ABS_StartScanning(&g_ble_abs0_ctrl, &scan_parameter);
Return values
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_POINTERp_scan_parameter is specified as NULL.
FSP_ERR_UNSUPPORTEDFunction is not supported

Start scanning after setting scan parameters. The scanner address type is Public Identity Address. Fast scan is followed by slow scan. The end of fast scan or slow scan is notified with BLE_GAP_EVENT_SCAN_TO event. If fast_period is 0, only slow scan is carried out. If scan_period is 0, slow scan continues. Implements ble_abs_api_t::startScanning.

Example:

/* Start scanning. */
err = RM_BLE_ABS_StartScanning(&g_ble_abs0_ctrl, &scan_parameter);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_POINTERp_scan_parameter is specified as NULL.
FSP_ERR_INVALID_ARGUMENTThe scan parameter is out of range.
FSP_ERR_IN_USEThis API is called in scanning.
FSP_ERR_BLE_ABS_NOT_FOUNDUsable timer slot not found.
FSP_ERR_UNSUPPORTEDThis feature is not supported in this configuration.

◆ RM_BLE_ABS_CreateConnection()

fsp_err_t RM_BLE_ABS_CreateConnection ( ble_abs_ctrl_t *const  p_ctrl,
ble_abs_connection_parameter_t const *const  p_connection_parameter 
)

Request create connection. The initiator address type is Public Identity Address. The scan interval is 60ms and the scan window is 30ms in case of 1M PHY or 2M PHY. The scan interval is 180ms and the scan window is 90ms in case of coded PHY. The Minimum CE Length and the Maximum CE Length are 0xFFFF. When the request for a connection has been received by the Controller, BLE_GAP_EVENT_CREATE_CONN_COMP event is notified. When a link has beens established, BLE_GAP_EVENT_CONN_IND event is notified. Implements ble_abs_api_t::createConnection.

Example:

/* Create connection with remote device. */
err = RM_BLE_ABS_CreateConnection(&g_ble_abs0_ctrl, &g_connection_parameter);
Return values
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_POINTERp_connection_parameter is specified as NULL.
FSP_ERR_INVALID_ARGUMENTThe create connection parameter is out of range.
FSP_ERR_UNSUPPORTEDFunction is not supported

Request create connection. The initiator address type is Public Identity Address. The scan interval is 60ms and the scan window is 30ms in case of 1M PHY or 2M PHY. The scan interval is 180ms and the scan window is 90ms in case of coded PHY. The Minimum CE Length and the Maximum CE Length are 0xFFFF. When the request for a connection has been received by the Controller, BLE_GAP_EVENT_CREATE_CONN_COMP event is notified. When a link has beens established, BLE_GAP_EVENT_CONN_IND event is notified. Implements ble_abs_api_t::createConnection.

Example:

/* Create connection with remote device. */
err = RM_BLE_ABS_CreateConnection(&g_ble_abs0_ctrl, &g_connection_parameter);
Return values
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_POINTERp_connection_parameter is specified as NULL.
FSP_ERR_INVALID_ARGUMENTThe create connection parameter is out of range.
FSP_ERR_UNSUPPORTEDFunction is not supported

Request create connection. The initiator address type is Public Identity Address. The scan interval is 60ms and the scan window is 30ms in case of 1M PHY or 2M PHY. The scan interval is 180ms and the scan window is 90ms in case of coded PHY. The Minimum CE Length and the Maximum CE Length are 0xFFFF. When the request for a connection has been received by the Controller, BLE_GAP_EVENT_CREATE_CONN_COMP event is notified. When a link has beens established, BLE_GAP_EVENT_CONN_IND event is notified. Implements ble_abs_api_t::createConnection.

Example:

/* Create connection with remote device. */
err = RM_BLE_ABS_CreateConnection(&g_ble_abs0_ctrl, &g_connection_parameter);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_POINTERp_connection_parameter is specified as NULL.
FSP_ERR_INVALID_ARGUMENTThe create connection parameter is out of range.
FSP_ERR_IN_USEThis API is called while creating a link by previous API call.
FSP_ERR_BLE_ABS_NOT_FOUNDCouldn't find a valid timer.
FSP_ERR_UNSUPPORTEDThis feature is not supported in this configuration.

◆ RM_BLE_ABS_SetLocalPrivacy()

fsp_err_t RM_BLE_ABS_SetLocalPrivacy ( ble_abs_ctrl_t *const  p_ctrl,
uint8_t const *const  p_lc_irk,
uint8_t  privacy_mode 
)

Generate a IRK, add it to the resolving list, set privacy mode and enable RPA function. Register vendor specific callback function, if IRK is generated by this function. After configuring local device privacy, BLE_GAP_ADDR_RPA_ID_PUBLIC is specified as own device address in theadvertising/scan/create connection API. Implements ble_abs_api_t::setLocalPrivacy

Return values
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_ARGUMENTThe privacy_mode parameter is out of range.
FSP_ERR_UNSUPPORTEDFunction is not supported

Generate a IRK, add it to the resolving list, set privacy mode and enable RPA function. Register vendor specific callback function, if IRK is generated by this function. After configuring local device privacy, BLE_GAP_ADDR_RPA_ID_PUBLIC is specified as own device address in theadvertising/scan/create connection API. Implements ble_abs_api_t::setLocalPrivacy

Example:

/* Set local privacy. */
err = RM_BLE_ABS_SetLocalPrivacy(&g_ble_abs0_ctrl, p_local_irk, privacy_mode);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONp_instance_ctrl is specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_ARGUMENTThe privacy_mode parameter is out of range.

◆ RM_BLE_ABS_StartAuthentication()

fsp_err_t RM_BLE_ABS_StartAuthentication ( ble_abs_ctrl_t *const  p_ctrl,
uint16_t  connection_handle 
)

Start pairing or encryption. If pairing has been done, start encryption. The pairing parameters are configured by RM_BLE_ABS_Open() or R_BLE_GAP_SetPairingParams(). If the pairing parameters are configure by RM_BLE_ABS_Open(),

Example:

/* Start authentication with remote device. */
err = RM_BLE_ABS_StartAuthentication(&g_ble_abs0_ctrl, g_connection_handle);
Return values
FSP_ERR_ASSERTIONp_instance_ctrl or connection_handle are specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_UNSUPPORTEDFunction is not supported

Start pairing or encryption. If pairing has been done, start encryption. The pairing parameters are configured by RM_BLE_ABS_Open() or R_BLE_GAP_SetPairingParams(). If the pairing parameters are configure by RM_BLE_ABS_Open(),

Example:

/* Start authentication with remote device. */
err = RM_BLE_ABS_StartAuthentication(&g_ble_abs0_ctrl, g_connection_handle);
Return values
FSP_ERR_ASSERTIONp_instance_ctrl or connection_handle are specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_UNSUPPORTEDFunction is not supported

Start pairing or encryption. If pairing has been done, start encryption. The pairing parameters are configured by RM_BLE_ABS_Open() or R_BLE_GAP_SetPairingParams(). If the pairing parameters are configure by RM_BLE_ABS_Open(),

Example:

/* Start authentication with remote device. */
err = RM_BLE_ABS_StartAuthentication(&g_ble_abs0_ctrl, g_connection_handle);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONp_instance_ctrl or connection_handle are specified as NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_ARGUMENTThe connection handle parameter is out of range.

◆ RM_BLE_ABS_DeleteBondInformation()

fsp_err_t RM_BLE_ABS_DeleteBondInformation ( ble_abs_ctrl_t *const  p_ctrl,
ble_abs_bond_information_parameter_t const *const  p_bond_information_parameter 
)

Delete bonding information from BLE stack and storage. Implements ble_abs_api_t::deleteBondInformation.

Example:

/* Delete bonding information. */
err = RM_BLE_ABS_DeleteBondInformation(&g_ble_abs0_ctrl, &g_bond_information_parameter);
Return values
FSP_SUCCESSOperation was successful
FSP_ERR_ASSERTIONThe parameter p_instance_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_bond_information_parameter is NULL.
FSP_ERR_NOT_OPENControl block not open.

Delete bonding information from BLE stack and storage. Implements ble_abs_api_t::deleteBondInformation.

Example:

/* Delete bonding information. */
err = RM_BLE_ABS_DeleteBondInformation(&g_ble_abs0_ctrl, &g_bond_information_parameter);
Return values
FSP_SUCCESSOperation was successful
FSP_ERR_ASSERTIONThe parameter p_instance_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_bond_information_parameter is NULL.
FSP_ERR_NOT_OPENControl block not open.

Delete bonding information from BLE stack and storage. Implements ble_abs_api_t::deleteBondInformation.

Example:

/* Delete bonding information. */
err = RM_BLE_ABS_DeleteBondInformation(&g_ble_abs0_ctrl, &g_bond_information_parameter);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_instance_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_bond_information_parameter is NULL.
FSP_ERR_NOT_OPENControl block not open.

◆ RM_BLE_ABS_ImportKeyInformation()

fsp_err_t RM_BLE_ABS_ImportKeyInformation ( ble_abs_ctrl_t *const  p_ctrl,
ble_device_address_t p_local_identity_address,
uint8_t *  p_local_irk,
uint8_t *  p_local_csrk 
)

Import key information to BLE stack and storage. Implements ble_abs_api_t::importKeyInformation.

Example:

/* Import local key information. */
err = RM_BLE_ABS_ImportKeyInformation(&g_ble_abs0_ctrl, &local_identity_address, local_irk, local_csrk);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_instance_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_local_identity_address, p_local_irk or p_local_csrk is NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_INVALID_HW_CONDITIONFailure to access internal storage.
FSP_ERR_UNSUPPORTEDNot supported in this configuration.

◆ RM_BLE_ABS_ExportKeyInformation()

fsp_err_t RM_BLE_ABS_ExportKeyInformation ( ble_abs_ctrl_t *const  p_ctrl,
ble_device_address_t p_local_identity_address,
uint8_t *  p_local_irk,
uint8_t *  p_local_csrk 
)

Export key information to BLE stack and storage. Implements ble_abs_api_t::exportKeyInformation.

Example:

/* Export local key information. */
err = RM_BLE_ABS_ExportKeyInformation(&g_ble_abs0_ctrl, &local_identity_address, local_irk, local_csrk);
Return values
FSP_SUCCESSOperation succeeded.
FSP_ERR_ASSERTIONThe parameter p_instance_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_local_identity_address, p_local_irk or p_local_csrk is NULL.
FSP_ERR_NOT_OPENControl block not open.
FSP_ERR_BUFFER_EMPTYDynamic memory allocation failed.
FSP_ERR_OUT_OF_MEMORYFailure to access internal storage.
FSP_ERR_NOT_INITIALIZEDNot initialized internal storage.
FSP_ERR_UNSUPPORTEDNot supported in this configuration.