RA Flexible Software Package Documentation  Release v5.2.0

 
BLE Interface

Functions

ble_status_t R_BLE_Open (void)
 Open the BLE protocol stack. More...
 
ble_status_t R_BLE_Close (void)
 Close the BLE protocol stack. More...
 
ble_status_t R_BLE_Execute (void)
 Execute the BLE task. More...
 
uint32_t R_BLE_IsTaskFree (void)
 Check the BLE task queue is free or not. More...
 
ble_status_t R_BLE_SetEvent (ble_event_cb_t cb)
 Set event. More...
 
uint32_t R_BLE_GetVersion (void)
 Get the BLE FIT module version. More...
 
uint32_t R_BLE_GetLibType (void)
 Get the type of BLE protocol stack library. More...
 

Detailed Description

Interface for Bluetooth Low Energy (BLE) functions.

Summary

The BLE interface for the Bluetooth Low Energy (BLE) peripheral provides BLE functionality.

Modules

 GAP
 
 ISO
 
 GATT_COMMON
 
 GATT_SERVER
 
 GATT_CLIENT
 
 L2CAP
 
 VS
 

Macros

#define BLE_VERSION_MAJOR
 
#define BLE_VERSION_MINOR
 
#define BLE_LIB_EXTENDED
 
#define BLE_LIB_BALANCE
 
#define BLE_LIB_COMPACT
 

Typedefs

typedef void(* ble_event_cb_t) (void)
 ble_event_cb_t is the callback function type for R_BLE_SetEvent(). More...
 

Macro Definition Documentation

◆ BLE_VERSION_MAJOR

#define BLE_VERSION_MAJOR

BLE Module Major Version.

◆ BLE_VERSION_MINOR

#define BLE_VERSION_MINOR

BLE Module Minor Version.

◆ BLE_LIB_EXTENDED

#define BLE_LIB_EXTENDED

BLE Protocol Stack Library Extended type.

◆ BLE_LIB_BALANCE

#define BLE_LIB_BALANCE

BLE Protocol Stack Library Balance type.

◆ BLE_LIB_COMPACT

#define BLE_LIB_COMPACT

BLE Protocol Stack Library Compacy type.

Typedef Documentation

◆ ble_event_cb_t

ble_event_cb_t

ble_event_cb_t is the callback function type for R_BLE_SetEvent().

Returns
none

Function Documentation

◆ R_BLE_Open()

ble_status_t R_BLE_Open ( void  )

Open the BLE protocol stack.

This function should be called once before using the BLE protocol stack.

Return values
BLE_SUCCESS(0x0000)Success

◆ R_BLE_Close()

ble_status_t R_BLE_Close ( void  )

Close the BLE protocol stack.

This function should be called once to close the BLE protocol stack.

Return values
BLE_SUCCESS(0x0000)Success

◆ R_BLE_Execute()

ble_status_t R_BLE_Execute ( void  )

Execute the BLE task.

This handles all the task queued in the BLE protocol stack internal task queue and return. This function should be called repeatedly in the main loop.

Return values
BLE_SUCCESS(0x0000)Success

◆ R_BLE_IsTaskFree()

uint32_t R_BLE_IsTaskFree ( void  )

Check the BLE task queue is free or not.

This function returns the BLE task queue free status. When this function returns 0x0, call R_BLE_Execute() to execute the BLE task.

Return values
0x0BLE task queue is not free
0x1BLE task queue is free

◆ R_BLE_SetEvent()

ble_status_t R_BLE_SetEvent ( ble_event_cb_t  cb)

Set event.

This function add an event in the BLE protocol stack internal queue. The event is handled in R_BLE_Execute just like Bluetooth event. This function is intended to be called in hardware interrupt context. Even if calling this function with the same cb before the cb is invoked, only one event is registered. The maximum number of the events can be registered at a time is eight.

Parameters
cbThe callback for the event.
Return values
BLE_SUCCESS(0x0000)Success
BLE_ERR_ALREADY_IN_PROGRESS(0x000A)The event already registered with the callback.
BLE_ERR_CONTEXT_FULL(0x000B)No free slot for the event.

◆ R_BLE_GetVersion()

uint32_t R_BLE_GetVersion ( void  )

Get the BLE FIT module version.

This function returns the BLE FIT module version.
The major version(BLE_VERSION_MAJOR) is contained in the two most significant bytes, and the minor version(BLE_VERSION_MINOR) occupies the remaining two bytes.

Return values
BLE_VERSION_MAJOR | BLE_VERSION_MINOR

◆ R_BLE_GetLibType()

uint32_t R_BLE_GetLibType ( void  )

Get the type of BLE protocol stack library.

This function returns the type of BLE protocol stack library.

Return values
BLE_LIB_EXTENDED(0x00)Extended
BLE_LIB_BALANCE(0x01)Balance
BLE_LIB_COMPACT(0x02)Compact