Synergy Software Package User's Manual

RTOS-integrated BLE Interface Framework example. Implementation of RL78G1D BLE Driver. It implements the following interfaces: More...

Modules

 BLE Alert Notification Profile Interface Framework on RL78G1D
 RTOS-integrated BLE Alert Notification Profile Framework example. Implementation of RL78G1D BLE Alert Notification Profile Interface Driver. It implements the following interfaces:
 
 BLE Blood Pressure Profile Interface Framework on RL78G1D
 RTOS-integrated BLE Blood Pressure Profile Framework example. Implementation of RL78G1D BLE Blood Pressure Profile Interface Driver. It implements the following interfaces:
 
 BLE Find Me Profile Interface Framework on RL78G1D
 RTOS-integrated BLE Find Me Profile Framework example. Implementation of RL78G1D BLE Find Me Profile Interface Driver. It implements the following interfaces:
 
 BLE HID Over GATT Profile Interface Framework on RL78G1D
 RTOS-integrated BLE HID Over GATT Profile Framework example. Implementation of RL78G1D BLE HID Over GATT Profile Interface Driver. It implements the following interfaces:
 
 BLE Heart Rate Profile Interface Framework on RL78G1D
 RTOS-integrated BLE Heart Rate Profile Framework example. Implementation of RL78G1D BLE Heart Rate Profile Interface Driver. It implements the following interfaces:
 
 BLE Health Thermometer Profile Interface Framework on RL78G1D
 RTOS-integrated BLE Health Thermometer Profile Framework example. Implementation of RL78G1D BLE Health Thermometer Profile Interface Driver. It implements the following interfaces:
 
 BLE On-Board Profile Framework Interface on RL78G1D
 RTOS-integrated BLE On-Board Profile Framework example. Implementation of RL78G1D BLE On-Board Profile Interface Driver. It implements the following interfaces:
 
 BLE Phone Alert Status Profile Interface Framework on RL78G1D
 RTOS-integrated BLE Phone Alert Status Profile Framework example. Implementation of RL78G1D BLE Phone Alert Status Profile Interface Driver. It implements the following interfaces:
 
 BLE Proximity Profile Interface Framework on RL78G1D
 RTOS-integrated BLE Proximity Profile Framework example. Implementation of RL78G1D BLE Proximity Profile Interface Driver. It implements the following interfaces:
 
 BLE Scan Parameters Service Profile Interface Framework on RL78G1D
 RTOS-integrated BLE Scan Parameters Service Profile Framework example. Implementation of RL78G1D BLE Scan Parameters Service Profile Interface Driver. It implements the following interfaces:
 
 BLE Time Information Profile Interface Framework on RL78G1D
 RTOS-integrated BLE Time Information Profile Framework example. Implementation of RL78G1D BLE Time Information Profile Interface Driver. It implements the following interfaces:
 

Functions

ssp_err_t ble_rl78g1d_open (sf_ble_ctrl_t *const p_ctrl, sf_ble_cfg_t const *const p_cfg, sf_ble_rl78g1d_driver_t *p_driver_data)
 Initializes RL78G1D Module as per user configuration, updates the control structure with instance specific information. More...
 
uint8_t sf_rble_exit_status (void)
 Returns status whether RL78G1D driver thread should exit or continue. More...
 
void copy_driver_data (sf_ble_rl78g1d_driver_t *p_driver_data, sf_ble_cfg_t const *p_cfg, sf_ble_provisioning_t const *p_prov)
 Copies user provisioning information or configuration in driver buffer for later use. More...
 
ssp_err_t close_rl78g1d (sf_ble_ctrl_t *const p_ctrl)
 Un-Initialize BLE Module, stop RBLE Thread, release thread resources which are in use. More...
 
ssp_err_t rl78g1d_set_provision (sf_ble_provisioning_t const *p_prov)
 Configures the BLE Module as per user provided Provisioning configuration. More...
 
ssp_err_t rl78g1d_read_rssi (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, uint16_t *p_rssi)
 Read RSSI information of the connection handle passed. More...
 
ssp_err_t rl78g1d_start_scan (sf_ble_rl78g1d_driver_t *p_driver_data, sf_ble_scan_t *p_scan, uint8_t *p_cnt, sf_ble_scan_info_t *p_scan_info)
 Starts scanning of available BLE devices and returns the list of available BLE devices. More...
 
ssp_err_t rl78g1d_broadcast_enable (sf_ble_rl78g1d_driver_t *p_driver_data, sf_ble_adv_info_t const *p_adv_info)
 Enables the advertisement of BLE Module so that other devices can find it. More...
 
ssp_err_t rl78g1d_broadcast_disable (void)
 Disable advertisement of BLE Module so that it does not get discovered. More...
 
ssp_err_t rl78g1d_add_to_white_list (uint8_t const *p_bd_addr)
 Adds the BLE device address to white list so that it gets scanned by the Module. More...
 
ssp_err_t rl78g1d_del_from_white_list (uint8_t const *p_bd_addr)
 Deletes BLE device address from white list, so that it does not get discovered. More...
 
ssp_err_t rl78g1d_get_info (sf_ble_ctrl_t *const p_ctrl, sf_ble_chipset_info_t *p_chipset)
 Gets the BLE module information and put that information in user buffer. More...
 
ssp_err_t ble_rl78g1d_connect (sf_ble_ctrl_t *const p_ctrl, sf_ble_connection_t const *const p_conn, sf_ble_conn_handle_t *p_handle, sf_ble_rl78g1d_driver_t *p_driver_data)
 Connect to a remote BLE device using the information provided by user. More...
 
ssp_err_t rl78g1d_disconnect (sf_ble_conn_handle_t *p_handle)
 Initiates Disconnection procedure from remote BLE device. More...
 
ssp_err_t rl78g1d_set_tx_power (sf_ble_conn_handle_t *const p_handle, sf_ble_set_tx_pwr_info_t *p_tx_power_info)
 Sets the transmit power for the procedure specified by the connection handle. More...
 
ssp_err_t rl78g1d_bonding (sf_ble_rl78g1d_driver_t *p_driver_data, uint8_t const *p_bd_addr, sf_ble_bonding_start_t *p_bonding_start)
 Initiates bonding procedure with Remote BLE device with configuration provided by user. More...
 
ssp_err_t rl78g1d_start_encryption (sf_ble_sm_enc_info_t const *p_enc_info)
 Starts encryption over the BLE link using information received during Bonding procedure. More...
 
ssp_err_t rl78g1d_bonding_resp (sf_ble_conn_handle_t *p_handle, sf_ble_rl78g1d_driver_t *p_driver_data, sf_ble_bonding_response_t *p_bonding_resp)
 Responds to bonding request from remote device with the security information provided by user. More...
 
ssp_err_t rl78g1d_authorization (sf_ble_conn_handle_t *p_handle)
 Indicates that the specified remote device has been authorized by user. More...
 
void rl78g1d_gatt_event_callback (RBLE_GATT_EVENT *p_event)
 GATT Event callback. More...
 
ssp_err_t rl78g1d_enable_gatt (void)
 Enable the GATT in RBLE stack. More...
 
ssp_err_t rl78g1d_gatt_service_discovery (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, sf_ble_service_discovery_req_t const *const p_sf_ble_svc_dscv_req, sf_ble_service_discovery_rsp_t *const p_sf_ble_svc_dscv_rsp, uint32_t *const p_rsp_cnt)
 GATT Service discovery. More...
 
ssp_err_t rl78g1d_gatt_char_discovery (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, sf_ble_char_discovery_req_t const *const p_sf_ble_char_dscv_req, sf_ble_char_discovery_rsp_t *const p_sf_ble_char_dscv_rsp, uint32_t *const p_rsp_cnt)
 Perform characteristics discovery used by GATT client. More...
 
ssp_err_t rl78g1d_gatt_char_desc_discovery (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, uint16_t start_handle, uint16_t end_handle, sf_ble_char_desc_discovery_rsp_t *const p_sf_ble_chardesc_dscv_rsp, uint32_t *const p_rsp_cnt)
 Perform characteristics descriptor discovery used by GATT client. More...
 
ssp_err_t rl78g1d_gatt_char_read (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, sf_ble_char_read_req_t const *const p_char_read_req, sf_ble_char_read_rsp_t *const p_char_read_rsp)
 Perform read characteristic used by GATT client. More...
 
ssp_err_t rl78g1d_gatt_char_write (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, sf_ble_char_write_req_t const *const p_char_write_req)
 Perform write characteristic used by GATT client. More...
 
ssp_err_t rl78g1d_gatt_char_execute_write (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, sf_ble_execute_write_t execute_flag)
 Perform execute write on all pending write operations, used by GATT client. More...
 
ssp_err_t rl78g1d_gatt_char_write_local (sf_ble_ctrl_t *const p_ctrl, uint16_t char_handle, uint16_t data_length, uint8_t *const p_data)
 Perform local characteristic write used by GATT server. More...
 
ssp_err_t rl78g1d_gatt_send_notify (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, uint16_t char_handle)
 Send notification to GATT client, used by GATT server. More...
 
ssp_err_t rl78g1d_gatt_send_indicate (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, uint16_t char_handle)
 Send indication to GATT client, used by GATT server. More...
 
ssp_err_t rl78g1d_gatt_write_response (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, uint16_t handle, sf_ble_attribute_error_code_t error_code)
 Send response to write operation received by GATT client, used by GATT server. More...
 

Detailed Description

RTOS-integrated BLE Interface Framework example. Implementation of RL78G1D BLE Driver. It implements the following interfaces:

SF_BLE Framework Interface API on RL78G1D.

Function Documentation

◆ ble_rl78g1d_connect()

ssp_err_t ble_rl78g1d_connect ( sf_ble_ctrl_t *const  p_ctrl,
sf_ble_connection_t const *const  p_conn,
sf_ble_conn_handle_t p_handle,
sf_ble_rl78g1d_driver_t *  p_driver_data 
)

Connect to a remote BLE device using the information provided by user.

Parameters
[in]p_ctrlPointer to control structure which contains driver information
[in]p_connPointer to connection information
[out]p_handlePointer to connection handle
[in]p_driver_dataPointer to driver data where data is to be copied
Return values
SSP_SUCCESSConnect success
SSP_ERR_BLE_FAILEDFailed to connect
SSP_ERR_NOT_OPENDevice Not Opened
SSP_ERR_TIMEOUTBLE event timeout

◆ ble_rl78g1d_open()

ssp_err_t ble_rl78g1d_open ( sf_ble_ctrl_t *const  p_ctrl,
sf_ble_cfg_t const *const  p_cfg,
sf_ble_rl78g1d_driver_t *  p_driver_data 
)

Initializes RL78G1D Module as per user configuration, updates the control structure with instance specific information.

Parameters
[in,out]p_ctrlPointer to user-provided storage for the control block.
[in]p_cfgPointer to BLE configuration structure
[in]p_driver_dataPointer to driver data where data is to be copied
Return values
SSP_SUCCESSModule initialization successful
SSP_ERR_BLE_FAILEDFailed to initialize
SSP_ERR_ALREADY_OPENDevice is already open
SSP_ERR_IN_USEModule in use
SSP_ERR_TIMEOUTBLE event timeout
SSP_ERR_INTERNALGATT Initialization failure

Copying user configuration to driver buffer for later use

◆ close_rl78g1d()

ssp_err_t close_rl78g1d ( sf_ble_ctrl_t *const  p_ctrl)

Un-Initialize BLE Module, stop RBLE Thread, release thread resources which are in use.

Closes and Stops communication with RL78G1D BLE chip

Parameters
[in]p_ctrlPointer to control structure which contains driver related information
Return values
SSP_SUCCESSSuspend the driver functionality.
SSP_ERR_BLE_FAILEDClose failure

◆ copy_driver_data()

void copy_driver_data ( sf_ble_rl78g1d_driver_t *  p_driver_data,
sf_ble_cfg_t const *  p_cfg,
sf_ble_provisioning_t const *  p_prov 
)

Copies user provisioning information or configuration in driver buffer for later use.

Copies the value of BLE configuration and provisioning information into the driver buffer.

Parameters
[in]p_driver_dataPointer to driver data where data is to be copied
[in]p_cfgUser pointer configuration which is to be copied to driver buffer
[in]p_provPointer BLE provisioning data
Returns
None

◆ rl78g1d_add_to_white_list()

ssp_err_t rl78g1d_add_to_white_list ( uint8_t const *  p_bd_addr)

Adds the BLE device address to white list so that it gets scanned by the Module.

Bluetooth address of peer device is added to the whiteList of Module

Parameters
[in]p_bd_addrPointer to bluetooth address to be added to white list
Return values
SSP_SUCCESSWhitelist add success
SSP_ERR_BLE_FAILEDFailed to add in white list
SSP_ERR_TIMEOUTBLE event timeout

◆ rl78g1d_authorization()

ssp_err_t rl78g1d_authorization ( sf_ble_conn_handle_t p_handle)

Indicates that the specified remote device has been authorized by user.

Parameters
[in]p_handlePointer to BLE handle
Return values
SSP_SUCCESSAuthorization success
SSP_ERR_BLE_FAILEDAuthorization Failed

Pointer to BLE connection handle

◆ rl78g1d_bonding()

ssp_err_t rl78g1d_bonding ( sf_ble_rl78g1d_driver_t *  p_driver_data,
uint8_t const *  p_bd_addr,
sf_ble_bonding_start_t p_bonding_start 
)

Initiates bonding procedure with Remote BLE device with configuration provided by user.

Starts the bonding procedure with peer device

Parameters
[in]p_driver_dataPointer to private driver data structure
[in]p_bd_addrPointer to ble device address from which bonding is to be started
[in]p_bonding_startPointer to Bonding Start information structure
Return values
SSP_SUCCESSBonding start success
SSP_ERR_BLE_FAILEDBonding start failure
SSP_ERR_TIMEOUTBLE event timeout

◆ rl78g1d_bonding_resp()

ssp_err_t rl78g1d_bonding_resp ( sf_ble_conn_handle_t p_handle,
sf_ble_rl78g1d_driver_t *  p_driver_data,
sf_ble_bonding_response_t p_bonding_resp 
)

Responds to bonding request from remote device with the security information provided by user.

Parameters
[in]p_handlePointer to BLE handle
[in]p_driver_dataPointer to driver data which contains chip related information
[in]p_bonding_respBonding Response structure
Return values
SSP_SUCCESSBonding response success
SSP_ERR_BLE_FAILEDFailed getting bonding response
SSP_ERR_TIMEOUTBLE event timeout

Pointer to BLE connection handle

◆ rl78g1d_broadcast_disable()

ssp_err_t rl78g1d_broadcast_disable ( void  )

Disable advertisement of BLE Module so that it does not get discovered.

Disable advertisement of BLE Module.

Return values
SSP_SUCCESSStop the broadcast of device successfully
SSP_ERR_BLE_FAILEDFailed to broadcast disable
SSP_ERR_TIMEOUTBLE event timeout

◆ rl78g1d_broadcast_enable()

ssp_err_t rl78g1d_broadcast_enable ( sf_ble_rl78g1d_driver_t *  p_driver_data,
sf_ble_adv_info_t const *  p_adv_info 
)

Enables the advertisement of BLE Module so that other devices can find it.

Starts advertisement of BLE Module.

Parameters
[in]p_driver_dataDriver data which contains chip related information
[in]p_adv_infoPointer to user supplied broadcast configuration
Return values
SSP_SUCCESSStart the broadcast of device successfully
SSP_ERR_BLE_FAILEDFailed to broadcast enable
SSP_ERR_TIMEOUTBLE event timeout
SSP_ERR_INVALID_MODEInvalid arguments/parameters

Advertisement Data length

Advertisement Data

◆ rl78g1d_del_from_white_list()

ssp_err_t rl78g1d_del_from_white_list ( uint8_t const *  p_bd_addr)

Deletes BLE device address from white list, so that it does not get discovered.

Bluetooth address of peer device is deleted from the whiteList of Module

Parameters
[in]p_bd_addrPointer to BLE address to be removed from white list
Return values
SSP_SUCCESSWhitelist delete success
SSP_ERR_BLE_FAILEDFailed to delete from white list
SSP_ERR_TIMEOUTBLE event timeout

◆ rl78g1d_disconnect()

ssp_err_t rl78g1d_disconnect ( sf_ble_conn_handle_t p_handle)

Initiates Disconnection procedure from remote BLE device.

BLE device is disconnected from the peer device

Parameters
[in]p_handlePointer to BLE handle
Return values
SSP_SUCCESSDisconnect success
SSP_ERR_BLE_FAILEDDisconnect failed
SSP_ERR_TIMEOUTBLE event timeout

Pointer to BLE connection handle

◆ rl78g1d_enable_gatt()

ssp_err_t rl78g1d_enable_gatt ( void  )

Enable the GATT in RBLE stack.

Return values
SSP_SUCCESSEnable the gatt successfully
SSP_ERR_INTERNALFailed to enable the gatt

Create semaphore for rble operation complete

◆ rl78g1d_gatt_char_desc_discovery()

ssp_err_t rl78g1d_gatt_char_desc_discovery ( sf_ble_ctrl_t *const  p_ctrl,
sf_ble_conn_handle_t p_handle,
uint16_t  start_handle,
uint16_t  end_handle,
sf_ble_char_desc_discovery_rsp_t *const  p_sf_ble_chardesc_dscv_rsp,
uint32_t *const  p_rsp_cnt 
)

Perform characteristics descriptor discovery used by GATT client.

Perform Characteristic descriptor discovery of remote BLE device and pass all discovered characteristics descriptor to user

Parameters
[in]p_ctrlPointer to control structure
[in]p_handlepointer to Connection handle
[in]start_handleStart handle from set of handle ranges to be used in discovery
[in]end_handleEnd handle from set of handle ranges to be used in discovery
[out]p_sf_ble_chardesc_dscv_rspPointer to characteristics descriptor discovery response
[in,out]p_rsp_cntInput Size specifying maximum number of characteristics descriptor discovery results which can be stored in response, output specifying number of characteristics descriptor discovery results stored in response
Return values
SSP_SUCCESSCharacteristics descriptor discovery successful
SSP_ERR_BLE_FAILEDCharacteristics descriptor discovery failed

Pointer to BLE connection handle

Connection handle

API call

Wait for discovery to complete

Update response count

◆ rl78g1d_gatt_char_discovery()

ssp_err_t rl78g1d_gatt_char_discovery ( sf_ble_ctrl_t *const  p_ctrl,
sf_ble_conn_handle_t p_handle,
sf_ble_char_discovery_req_t const *const  p_sf_ble_char_dscv_req,
sf_ble_char_discovery_rsp_t *const  p_sf_ble_char_dscv_rsp,
uint32_t *const  p_rsp_cnt 
)

Perform characteristics discovery used by GATT client.

Perform Characteristic discovery of remote BLE device and pass all discovered characteristics to user

Parameters
[in]p_ctrlPointer to control structure
[in]p_handlePointer to Connection handle
[in]p_sf_ble_char_dscv_reqPointer to characteristics discovery request
[out]p_sf_ble_char_dscv_rspPointer to characteristics discovery response
[in,out]p_rsp_cntInput Size specifying maximum number of characteristics discovery results which can be stored in response, output specifying number of characteristics discovery results stored in response
Return values
SSP_SUCCESSCharacteristics discovery successful
SSP_ERR_BLE_FAILEDCharacteristics discovery failed
SSP_ERR_NOT_OPENDevice Not Opened

Pointer to BLE connection handle

Connection handle

API call

Wait for discovery to complete

Update response count

◆ rl78g1d_gatt_char_execute_write()

ssp_err_t rl78g1d_gatt_char_execute_write ( sf_ble_ctrl_t *const  p_ctrl,
sf_ble_conn_handle_t p_handle,
sf_ble_execute_write_t  execute_flag 
)

Perform execute write on all pending write operations, used by GATT client.

This API writes any characteristics handle which are pending in previous write

Parameters
[in]p_ctrlPointer to control structure
[in]p_handlepointer to Connection handle
[in]execute_flagFlag specifying whether to execute or cancel pending writes
Return values
SSP_SUCCESSExecute write successful
SSP_ERR_BLE_FAILEDExecute write failed

Pointer to BLE connection handle

Connection handle

API Call

Wait for execute write to complete

◆ rl78g1d_gatt_char_read()

ssp_err_t rl78g1d_gatt_char_read ( sf_ble_ctrl_t *const  p_ctrl,
sf_ble_conn_handle_t p_handle,
sf_ble_char_read_req_t const *const  p_char_read_req,
sf_ble_char_read_rsp_t *const  p_char_read_rsp 
)

Perform read characteristic used by GATT client.

GATT client reads the characteristics value of specific characteristics handle of the connected peer device

Parameters
[in]p_ctrlPointer to control structure
[in]p_handlepointer to Connection handle
[in]p_char_read_reqPointer to characteristic read request
[out]p_char_read_rspPointer to characteristic read response
Return values
SSP_SUCCESSCharacteristic read successful
SSP_ERR_BLE_FAILEDCharacteristic read failed

Characteristic handle

Characteristic handle size

Characteristic handle count

Characteristic UUID length

Characteristic UUID

Characteristic UUID length

Characteristic UUID

Characteristic UUID count

Characteristic value offset

Characteristic handle

Characteristic handle size

Characteristic handle count

Characteristic descriptor handle

Characteristic descriptor handle size

Characteristic descriptor handle count

Characteristic descriptor value offset

Characteristic descriptor handle

Characteristic descriptor handle size

Characteristic descriptor handle count

◆ rl78g1d_gatt_char_write()

ssp_err_t rl78g1d_gatt_char_write ( sf_ble_ctrl_t *const  p_ctrl,
sf_ble_conn_handle_t p_handle,
sf_ble_char_write_req_t const *const  p_char_write_req 
)

Perform write characteristic used by GATT client.

Write GATT characteristics data in characteristics handle of remote BLE device

Parameters
[in]p_ctrlPointer to control structure
[in]p_handlepointer to Connection handle
[in]p_char_write_reqPointer to characteristic write request
Return values
SSP_SUCCESSCharacteristic write successful
SSP_ERR_BLE_FAILEDCharacteristic write failed

◆ rl78g1d_gatt_char_write_local()

ssp_err_t rl78g1d_gatt_char_write_local ( sf_ble_ctrl_t *const  p_ctrl,
uint16_t  char_handle,
uint16_t  data_length,
uint8_t *const  p_data 
)

Perform local characteristic write used by GATT server.

Update local GATT database with user provided data.

Parameters
[in]p_ctrlPointer to control structure
[in]char_handleCharacteristic handle
[in]data_lengthLength of data to write
[in]p_dataPointer to data
Return values
SSP_SUCCESSLocal characteristic write successful
SSP_ERR_BLE_FAILEDLocal characteristic write failed

Characteristic value handle

Characteristic value length

Characteristic value

API Call

Wait for local write to complete

◆ rl78g1d_gatt_event_callback()

void rl78g1d_gatt_event_callback ( RBLE_GATT_EVENT p_event)

GATT Event callback.

Parameters
[in]p_eventEvent details
Return values
None

All Primary service discovery with 16 bit UUID complete

All Primary service discovery with 128 bit UUID complete

Primary service discovery by UUID complete

Included service discovery complete

All characteristics discovery with 16 bit UUID complete

All characteristics discovery with 128 bit UUID complete

Characteristics discovery by UUID (16 bit) complete

Characteristics discovery by UUID (128 bit) complete

Switch case is broken into different functions in order to reduce the cyclomatic complexity (<=10) of the function

◆ rl78g1d_gatt_send_indicate()

ssp_err_t rl78g1d_gatt_send_indicate ( sf_ble_ctrl_t *const  p_ctrl,
sf_ble_conn_handle_t p_handle,
uint16_t  char_handle 
)

Send indication to GATT client, used by GATT server.

Send the data of CCCD indication to remote GATT client.

Parameters
[in]p_ctrlPointer to control structure
[in]p_handlePointer to Connection handle
[in]char_handleCharacteristic handle whose value will be indicated
Return values
SSP_SUCCESSSend Indication successful
SSP_ERR_BLE_FAILEDSend Indication failed

Connection handle

Characteristic handle

API Call

Wait for indication send to complete

◆ rl78g1d_gatt_send_notify()

ssp_err_t rl78g1d_gatt_send_notify ( sf_ble_ctrl_t *const  p_ctrl,
sf_ble_conn_handle_t p_handle,
uint16_t  char_handle 
)

Send notification to GATT client, used by GATT server.

Send the data of CCCD notification to remote GATT client.

Parameters
[in]p_ctrlPointer to control structure
[in]p_handlepointer to Connection handle
[in]char_handleCharacteristic handle whose value will be notified
Return values
SSP_SUCCESSSend notification successful
SSP_ERR_BLE_FAILEDSend notification failed

Pointer to BLE connection handle

Connection handle

Characteristic handle

API Call

◆ rl78g1d_gatt_service_discovery()

ssp_err_t rl78g1d_gatt_service_discovery ( sf_ble_ctrl_t *const  p_ctrl,
sf_ble_conn_handle_t p_handle,
sf_ble_service_discovery_req_t const *const  p_sf_ble_svc_dscv_req,
sf_ble_service_discovery_rsp_t *const  p_sf_ble_svc_dscv_rsp,
uint32_t *const  p_rsp_cnt 
)

GATT Service discovery.

Perform GATT service discovery of remote BLE device and pass all discovered Services to user

Parameters
[in]p_ctrlPointer to control structure
[in]p_handlepointer to Connection handle
[in]p_sf_ble_svc_dscv_reqPointer to service discovery request
[out]p_sf_ble_svc_dscv_rspPointer to service discovery response
[in]p_rsp_cntInput Size specifying maximum number of service discovery results which can be stored in response, output specifying number of service discovery results stored in response
Return values
SSP_SUCCESSService discovery successful
SSP_ERR_BLE_FAILEDService discovery failed
SSP_ERR_NOT_OPENDevice Not Opened

Pointer to BLE connection handle

Connection handle

API call

Wait for discovery to complete

Update response count

◆ rl78g1d_gatt_write_response()

ssp_err_t rl78g1d_gatt_write_response ( sf_ble_ctrl_t *const  p_ctrl,
sf_ble_conn_handle_t p_handle,
uint16_t  handle,
sf_ble_attribute_error_code_t  error_code 
)

Send response to write operation received by GATT client, used by GATT server.

Parameters
[in]p_ctrlPointer to control structure
[in]p_handlePointer to Connection handle
[in]handleCharacteristic handle used for write operation
[in]error_codeCharacteristic write operation error code to be sent in response
Return values
SSP_SUCCESSSend write response successful
SSP_ERR_BLE_FAILEDSend write response failed

Pointer to BLE connection handle

Connection handle

Characteristic handle

API Call

◆ rl78g1d_get_info()

ssp_err_t rl78g1d_get_info ( sf_ble_ctrl_t *const  p_ctrl,
sf_ble_chipset_info_t p_chipset 
)

Gets the BLE module information and put that information in user buffer.

Reads information from RL78G1D device and updates user buffer

Parameters
[in]p_ctrlPointer to control structure which contains driver information
[in]p_chipsetPointer to user buffer which will be filled with BLE information
Return values
SSP_SUCCESSSuccessfully get the BLE information
SSP_ERR_BLE_FAILEDFailed to get information from chipset
SSP_ERR_TIMEOUTBLE event timeout

◆ rl78g1d_read_rssi()

ssp_err_t rl78g1d_read_rssi ( sf_ble_ctrl_t *const  p_ctrl,
sf_ble_conn_handle_t p_handle,
uint16_t *  p_rssi 
)

Read RSSI information of the connection handle passed.

Reads the RSSI information of BLE module for the connection handle passed

Parameters
[in]p_ctrlPointer to control structure which contains driver information
[in]p_handlePointer to BLE handle
[in]p_rssiPointer to user buffer in which rssi is read
Return values
SSP_SUCCESSSuccessfully read rssi
SSP_ERR_BLE_FAILEDFailed to read rssi value
SSP_ERR_TIMEOUTBLE event timeout

Pointer to BLE connection handle

◆ rl78g1d_set_provision()

ssp_err_t rl78g1d_set_provision ( sf_ble_provisioning_t const *  p_prov)

Configures the BLE Module as per user provided Provisioning configuration.

Sets bonding and security modes as provisioned.

Parameters
[in]p_provPointer to user provisioning information
Return values
SSP_SUCCESSSuccessfully provisioned the device.
SSP_ERR_BLE_FAILEDFailed to set provision
SSP_ERR_TIMEOUTBLE event timeout
SSP_ERR_UNSUPPORTEDUnsupported feature

Bonding mode

Variable to store temporary Bonding mode

◆ rl78g1d_set_tx_power()

ssp_err_t rl78g1d_set_tx_power ( sf_ble_conn_handle_t *const  p_handle,
sf_ble_set_tx_pwr_info_t p_tx_power_info 
)

Sets the transmit power for the procedure specified by the connection handle.

Parameters
[in]p_handlePointer to BLE handle
[in]p_tx_power_infoPointer to TX power information
Return values
SSP_SUCCESSTX power set successfully
SSP_ERR_BLE_FAILEDTX power set failed
SSP_ERR_TIMEOUTBLE event timeout
SSP_ERR_INVALID_ARGUMENTInvalid transmit power level parameter not supported by device

Pointer to BLE connection handle

◆ rl78g1d_start_encryption()

ssp_err_t rl78g1d_start_encryption ( sf_ble_sm_enc_info_t const *  p_enc_info)

Starts encryption over the BLE link using information received during Bonding procedure.

Parameters
[in]p_enc_infoBLE Start Encryption information
Return values
SSP_SUCCESSSuccessfully when encryption start over the BLE link
SSP_ERR_BLE_FAILEDFailed to start encryption
SSP_ERR_TIMEOUTBLE event timeout

◆ rl78g1d_start_scan()

ssp_err_t rl78g1d_start_scan ( sf_ble_rl78g1d_driver_t *  p_driver_data,
sf_ble_scan_t p_scan,
uint8_t *  p_cnt,
sf_ble_scan_info_t p_scan_info 
)

Starts scanning of available BLE devices and returns the list of available BLE devices.

Starts Scanning of BLE devices either in Passive or Active mode with user provided scan configuration

Parameters
[in]p_driver_dataPointer to driver data where data is to be copied
[in,out]p_scanPointer to user supplied scan buffer
[in,out]p_cntPointer to count variable which is to be updated with number of BLE devices scanned
[in]p_scan_infoPointer to scan information structure
Return values
SSP_SUCCESSSuccessful scan of available BLE devices
SSP_ERR_BLE_FAILEDFailed to scan
SSP_ERR_TIMEOUTBLE event timeout
SSP_ERR_INVALID_MODEInvalid arguments/parameters

In order to start observation or to start passive scan go for observation procedure. Passive scan is only supported through observation procedure

◆ sf_rble_exit_status()

uint8_t sf_rble_exit_status ( void  )

Returns status whether RL78G1D driver thread should exit or continue.

Return values
SF_BLE_TRUERBLE Thread should exit
SF_BLE_FALSERBLE Thread should continue execution