Synergy Software Package User's Manual

#include <sf_ble_api.h>

Data Fields

ssp_err_t(* open )(sf_ble_ctrl_t *const p_ctrl, const sf_ble_cfg_t *p_cfg)
 Initializes the interface for data transfers. More...
 
ssp_err_t(* close )(sf_ble_ctrl_t *const p_ctrl)
 De-initialize the interface and may put it in low power mode or power it off. Close the driver, disable the driver link, disable interrupt. More...
 
ssp_err_t(* infoGet )(sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, sf_ble_info_t *p_ble_info)
 Get BLE module information like chipset information and RSSI value. More...
 
ssp_err_t(* provisionGet )(sf_ble_ctrl_t *const p_ctrl, sf_ble_provisioning_t *p_ble_provisioning)
 Reads the current BLE Provisioning information. More...
 
ssp_err_t(* provisionSet )(sf_ble_ctrl_t *const p_ctrl, const sf_ble_provisioning_t *p_ble_provisioning)
 Provisions the BLE Driver and set bonding and security modes as provisioned. More...
 
ssp_err_t(* scan )(sf_ble_ctrl_t *const p_ctrl, sf_ble_scan_t *p_scan, uint8_t *p_cnt, sf_ble_scan_info_t *p_scan_info)
 Scans for available BLE devices and return the list to the caller. More...
 
ssp_err_t(* advertisementStart )(sf_ble_ctrl_t *const p_ctrl, sf_ble_adv_info_t *const p_advt_info)
 Make the device discoverable by broadcasting device information to remote devices. More...
 
ssp_err_t(* advertisementStop )(sf_ble_ctrl_t *const p_ctrl)
 Stop the device from being discoverable. More...
 
ssp_err_t(* whitelistAdd )(sf_ble_ctrl_t *const p_ctrl, const uint8_t *p_bd_addr)
 Add specified devices to whitelist. More...
 
ssp_err_t(* whitelistDel )(sf_ble_ctrl_t *const p_ctrl, const uint8_t *p_bd_addr)
 Remove specified devices from whitelist. More...
 
ssp_err_t(* bondingStart )(sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, const uint8_t *p_bd_addr, sf_ble_bonding_start_t *p_bonding_start)
 Initiate bonding process with remote BLE device and exchange security keys if enabled. More...
 
ssp_err_t(* bondingResponse )(sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, const uint8_t *p_bd_addr, sf_ble_bonding_response_t *p_bonding_resp)
 Respond to the bonding request from the remote BLE device. Send bonding response on reception of bonding indication. More...
 
ssp_err_t(* startEncryption )(sf_ble_ctrl_t *const p_ctrl, sf_ble_sm_enc_info_t const *p_enc_info)
 Start encryption over a connection. More...
 
ssp_err_t(* connect )(sf_ble_ctrl_t *const p_ctrl, sf_ble_connection_t const *const p_conn, sf_ble_conn_handle_t *p_handle)
 Connect to a remote BLE device. More...
 
ssp_err_t(* listen )(sf_ble_ctrl_t *const p_ctrl)
 Listen for connection request from remote device. More...
 
ssp_err_t(* authorization )(sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle)
 Indicates that the specified remote device has been authorized by user. More...
 
ssp_err_t(* disconnect )(sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle)
 Terminate connection with remote BLE device. More...
 
ssp_err_t(* setTxPower )(sf_ble_ctrl_t *const p_ctrl, 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(* gattAddCustomProfiles )(sf_ble_ctrl_t *const p_ctrl, sf_ble_svc_attribute_t *p_svc_attr, uint32_t svc_attr_len, sf_ble_char_attribute_t *p_char_attr, uint32_t char_attr_len)
 Add Custom Profile to GATT Database. More...
 
ssp_err_t(* gattServiceDiscovery )(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)
 Perform service discovery used by GATT client.Perform service discovery on remote GATT server and get results. More...
 
ssp_err_t(* gattCharDiscovery )(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 characteristics discovery on remote GATT server and get results. More...
 
ssp_err_t(* gattCharDescDiscovery )(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(* gattCharRead )(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.Read characteristic value from remote GATT server. More...
 
ssp_err_t(* gattCharWrite )(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 characteristic value on remote GATT server. More...
 
ssp_err_t(* gattCharExecuteWrite )(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.Execute or cancel all prepared writes of characteristics on remote GATT server. More...
 
ssp_err_t(* gattCharWriteLocal )(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.Writes local characteristic value on GATT server. More...
 
ssp_err_t(* gattSendNotify )(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(* gattSendIndicate )(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 indication to remote GATT client. More...
 
ssp_err_t(* gattWriteResponse )(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.Send response for write request received from remote GATT client. More...
 
ssp_err_t(* versionGet )(ssp_version_t *const p_version)
 Gets version and stores it in provided pointer p_version. More...
 

Detailed Description

Framework API structure. Implementations will use the following API.

Field Documentation

◆ advertisementStart

ssp_err_t(* sf_ble_api_t::advertisementStart) (sf_ble_ctrl_t *const p_ctrl, sf_ble_adv_info_t *const p_advt_info)

Make the device discoverable by broadcasting device information to remote devices.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.
[in]p_advt_infoPointer to advertisement information structure

◆ advertisementStop

ssp_err_t(* sf_ble_api_t::advertisementStop) (sf_ble_ctrl_t *const p_ctrl)

Stop the device from being discoverable.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.

◆ authorization

ssp_err_t(* sf_ble_api_t::authorization) (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle)

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

Parameters
[in]p_ctrlPointer to the control block for the BLE module.
[in]p_handlePointer to connection handle.

◆ bondingResponse

ssp_err_t(* sf_ble_api_t::bondingResponse) (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, const uint8_t *p_bd_addr, sf_ble_bonding_response_t *p_bonding_resp)

Respond to the bonding request from the remote BLE device. Send bonding response on reception of bonding indication.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.
[in]p_handlePointer to connection handle
[in]p_bd_addrPointer to BLE address
[in]p_bonding_respPointer to Bonding address

◆ bondingStart

ssp_err_t(* sf_ble_api_t::bondingStart) (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, const uint8_t *p_bd_addr, sf_ble_bonding_start_t *p_bonding_start)

Initiate bonding process with remote BLE device and exchange security keys if enabled.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.
[in]p_handlePointer to connection handle.
[in]p_bd_addrPointer to BLE address

◆ close

ssp_err_t(* sf_ble_api_t::close) (sf_ble_ctrl_t *const p_ctrl)

De-initialize the interface and may put it in low power mode or power it off. Close the driver, disable the driver link, disable interrupt.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.

◆ connect

ssp_err_t(* sf_ble_api_t::connect) (sf_ble_ctrl_t *const p_ctrl, sf_ble_connection_t const *const p_conn, sf_ble_conn_handle_t *p_handle)

Connect to a remote BLE device.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.
[in]p_connPointer to connection information
[out]p_handlePointer to connection handle

◆ disconnect

ssp_err_t(* sf_ble_api_t::disconnect) (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle)

Terminate connection with remote BLE device.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.
[in]p_handlePointer to connection handle

◆ gattAddCustomProfiles

ssp_err_t(* sf_ble_api_t::gattAddCustomProfiles) (sf_ble_ctrl_t *const p_ctrl, sf_ble_svc_attribute_t *p_svc_attr, uint32_t svc_attr_len, sf_ble_char_attribute_t *p_char_attr, uint32_t char_attr_len)

Add Custom Profile to GATT Database.

This function is called with list of service and characteristics which is to be added to GATT database. Services and characteristics which were previously added will be removed and newly passed services and characteristics will be added.

If services and characteristics were previously added and now those services and characteristics are to be removed and no new services and characteristics are to be added , then call this API with service and characteristics length as zero

Parameters
[in]p_ctrlPointer to control structure
[in]p_svc_attrList of Services to add
[in]svc_attr_lenNo of elements in services list
[in]p_char_attrList of Characteristics to add
[in]char_attr_lenNo of elements in Characteristics list

◆ gattCharDescDiscovery

ssp_err_t(* sf_ble_api_t::gattCharDescDiscovery) (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.

Parameters
[in]p_ctrlPointer to control structure
[in]p_handleConnection 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

◆ gattCharDiscovery

ssp_err_t(* sf_ble_api_t::gattCharDiscovery) (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 characteristics discovery on remote GATT server and get results.

Parameters
[in]p_ctrlPointer to control structure
[in]p_handleConnection 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

◆ gattCharExecuteWrite

ssp_err_t(* sf_ble_api_t::gattCharExecuteWrite) (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.Execute or cancel all prepared writes of characteristics on remote GATT server.

Parameters
[in]p_ctrlPointer to control structure
[in]p_handleConnection handle
[in]execute_flagFlag specifying whether to execute or cancel pending writes

◆ gattCharRead

ssp_err_t(* sf_ble_api_t::gattCharRead) (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.Read characteristic value from remote GATT server.

Parameters
[in]p_ctrlPointer to control structure
[in]p_handleConnection handle
[in]p_char_read_reqPointer to characteristic read request
[out]p_char_read_rspPointer to characteristic read response

◆ gattCharWrite

ssp_err_t(* sf_ble_api_t::gattCharWrite) (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 characteristic value on remote GATT server.

Parameters
[in]p_ctrlPointer to control structure
[in]p_handleConnection handle
[in]p_char_write_reqPointer to characteristic write request

◆ gattCharWriteLocal

ssp_err_t(* sf_ble_api_t::gattCharWriteLocal) (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.Writes local characteristic value on GATT server.

Parameters
[in]p_ctrlPointer to control structure
[in]char_handleCharacteristic handle
[in]data_lengthLength of data to write
[in]p_dataPointer to data

◆ gattSendIndicate

ssp_err_t(* sf_ble_api_t::gattSendIndicate) (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 indication to remote GATT client.

Parameters
[in]p_ctrlPointer to control structure
[in]p_handleConnection handle
[in]char_handleCharacteristic handle whose value will be indicated

◆ gattSendNotify

ssp_err_t(* sf_ble_api_t::gattSendNotify) (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.

Parameters
[in]p_ctrlPointer to control structure
[in]p_handleConnection handle
[in]char_handleCharacteristic handle whose value will be notified

◆ gattServiceDiscovery

ssp_err_t(* sf_ble_api_t::gattServiceDiscovery) (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)

Perform service discovery used by GATT client.Perform service discovery on remote GATT server and get results.

Parameters
[in]p_ctrlPointer to control structure
[in]p_handleConnection handle
[in]p_sf_ble_svc_dscv_reqPointer to service discovery request
[out]p_sf_ble_svc_dscv_rspPointer to service discovery response
[in,out]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

◆ gattWriteResponse

ssp_err_t(* sf_ble_api_t::gattWriteResponse) (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.Send response for write request received from remote GATT client.

Parameters
[in]p_ctrlPointer to control structure
[in]p_handleConnection handle
[in]handleCharacteristic handle used for write operation
[in]error_codeCharacteristic write operation error code to be sent in response

◆ infoGet

ssp_err_t(* sf_ble_api_t::infoGet) (sf_ble_ctrl_t *const p_ctrl, sf_ble_conn_handle_t *p_handle, sf_ble_info_t *p_ble_info)

Get BLE module information like chipset information and RSSI value.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.
[in]p_handlePointer to connection handle
[out]p_ble_infoPointer to module information

◆ listen

ssp_err_t(* sf_ble_api_t::listen) (sf_ble_ctrl_t *const p_ctrl)

Listen for connection request from remote device.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.

◆ open

ssp_err_t(* sf_ble_api_t::open) (sf_ble_ctrl_t *const p_ctrl, const sf_ble_cfg_t *p_cfg)

Initializes the interface for data transfers.

Initial driver configuration, enable the driver link, enable interrupts and make device ready for data transfer.

Parameters
[in,out]p_ctrlPointer to user-provided storage for the control block.
[in]p_cfgPointer to BLE configuration structure.

◆ provisionGet

ssp_err_t(* sf_ble_api_t::provisionGet) (sf_ble_ctrl_t *const p_ctrl, sf_ble_provisioning_t *p_ble_provisioning)

Reads the current BLE Provisioning information.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.
[out]p_ble_provisioningcurrent provisioning information

◆ provisionSet

ssp_err_t(* sf_ble_api_t::provisionSet) (sf_ble_ctrl_t *const p_ctrl, const sf_ble_provisioning_t *p_ble_provisioning)

Provisions the BLE Driver and set bonding and security modes as provisioned.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.
[in]p_ble_provisioningPointer to BLE provisioning structure

◆ scan

ssp_err_t(* sf_ble_api_t::scan) (sf_ble_ctrl_t *const p_ctrl, sf_ble_scan_t *p_scan, uint8_t *p_cnt, sf_ble_scan_info_t *p_scan_info)

Scans for available BLE devices and return the list to the caller.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.
[out]p_scanPointer to scan information structure
[in,out]p_cntPointer to number of BLE devices scanned
[in]p_scan_infoPointer to scan information structure

◆ setTxPower

ssp_err_t(* sf_ble_api_t::setTxPower) (sf_ble_ctrl_t *const p_ctrl, 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_ctrlPointer to the control block for the BLE module.
[in]p_handlePointer to connection handle. If transmit power is to be set before advertisement or connecting to remote device then pass connection handle as SF_BLE_TX_POWER_CONNECTION_HANDLE value else pass connection handle of remote device
[in]p_tx_power_infoPointer to TX power information

◆ startEncryption

ssp_err_t(* sf_ble_api_t::startEncryption) (sf_ble_ctrl_t *const p_ctrl, sf_ble_sm_enc_info_t const *p_enc_info)

Start encryption over a connection.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.
[in]p_enc_infoinformation for starting encryption

◆ versionGet

ssp_err_t(* sf_ble_api_t::versionGet) (ssp_version_t *const p_version)

Gets version and stores it in provided pointer p_version.

Parameters
[out]p_versionpointer to memory location to return version number

◆ whitelistAdd

ssp_err_t(* sf_ble_api_t::whitelistAdd) (sf_ble_ctrl_t *const p_ctrl, const uint8_t *p_bd_addr)

Add specified devices to whitelist.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.
[in]p_bd_addrPointer to BLE address

◆ whitelistDel

ssp_err_t(* sf_ble_api_t::whitelistDel) (sf_ble_ctrl_t *const p_ctrl, const uint8_t *p_bd_addr)

Remove specified devices from whitelist.

Parameters
[in]p_ctrlPointer to the control block for the BLE module.
[in]p_bd_addrPointer to BLE address

The documentation for this struct was generated from the following file: