![]() |
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... | |
Framework API structure. Implementations will use the following API.
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| [in] | p_advt_info | Pointer to advertisement information structure |
| ssp_err_t(* sf_ble_api_t::advertisementStop) (sf_ble_ctrl_t *const p_ctrl) |
Stop the device from being discoverable.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| [in] | p_handle | Pointer to connection handle. |
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| [in] | p_handle | Pointer to connection handle |
| [in] | p_bd_addr | Pointer to BLE address |
| [in] | p_bonding_resp | Pointer to Bonding address |
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| [in] | p_handle | Pointer to connection handle. |
| [in] | p_bd_addr | Pointer to BLE address |
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| [in] | p_conn | Pointer to connection information |
| [out] | p_handle | Pointer to connection handle |
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| [in] | p_handle | Pointer to connection handle |
| 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
| [in] | p_ctrl | Pointer to control structure |
| [in] | p_svc_attr | List of Services to add |
| [in] | svc_attr_len | No of elements in services list |
| [in] | p_char_attr | List of Characteristics to add |
| [in] | char_attr_len | No of elements in Characteristics list |
| 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.
| [in] | p_ctrl | Pointer to control structure |
| [in] | p_handle | Connection handle |
| [in] | start_handle | Start handle from set of handle ranges to be used in discovery |
| [in] | end_handle | End handle from set of handle ranges to be used in discovery |
| [out] | p_sf_ble_chardesc_dscv_rsp | Pointer to characteristics descriptor discovery response |
| [in,out] | p_rsp_cnt | Input 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 |
| 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.
| [in] | p_ctrl | Pointer to control structure |
| [in] | p_handle | Connection handle |
| [in] | p_sf_ble_char_dscv_req | Pointer to characteristics discovery request |
| [out] | p_sf_ble_char_dscv_rsp | Pointer to characteristics discovery response |
| [in,out] | p_rsp_cnt | Input Size specifying maximum number of characteristics discovery results which can be stored in response, output specifying number of characteristics discovery results stored in response |
| 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.
| [in] | p_ctrl | Pointer to control structure |
| [in] | p_handle | Connection handle |
| [in] | execute_flag | Flag specifying whether to execute or cancel pending writes |
| 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.
| [in] | p_ctrl | Pointer to control structure |
| [in] | p_handle | Connection handle |
| [in] | p_char_read_req | Pointer to characteristic read request |
| [out] | p_char_read_rsp | Pointer to characteristic read response |
| 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.
| [in] | p_ctrl | Pointer to control structure |
| [in] | p_handle | Connection handle |
| [in] | p_char_write_req | Pointer to characteristic write request |
| 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.
| [in] | p_ctrl | Pointer to control structure |
| [in] | char_handle | Characteristic handle |
| [in] | data_length | Length of data to write |
| [in] | p_data | Pointer to data |
| 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.
| [in] | p_ctrl | Pointer to control structure |
| [in] | p_handle | Connection handle |
| [in] | char_handle | Characteristic handle whose value will be indicated |
| 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.
| [in] | p_ctrl | Pointer to control structure |
| [in] | p_handle | Connection handle |
| [in] | char_handle | Characteristic handle whose value will be notified |
| 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.
| [in] | p_ctrl | Pointer to control structure |
| [in] | p_handle | Connection handle |
| [in] | p_sf_ble_svc_dscv_req | Pointer to service discovery request |
| [out] | p_sf_ble_svc_dscv_rsp | Pointer to service discovery response |
| [in,out] | p_rsp_cnt | Input Size specifying maximum number of service discovery results which can be stored in response, output specifying number of service discovery results stored in response |
| 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.
| [in] | p_ctrl | Pointer to control structure |
| [in] | p_handle | Connection handle |
| [in] | handle | Characteristic handle used for write operation |
| [in] | error_code | Characteristic write operation error code to be sent in response |
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| [in] | p_handle | Pointer to connection handle |
| [out] | p_ble_info | Pointer to module information |
| ssp_err_t(* sf_ble_api_t::listen) (sf_ble_ctrl_t *const p_ctrl) |
Listen for connection request from remote device.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| 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.
| [in,out] | p_ctrl | Pointer to user-provided storage for the control block. |
| [in] | p_cfg | Pointer to BLE configuration structure. |
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| [out] | p_ble_provisioning | current provisioning information |
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| [in] | p_ble_provisioning | Pointer to BLE provisioning structure |
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| [out] | p_scan | Pointer to scan information structure |
| [in,out] | p_cnt | Pointer to number of BLE devices scanned |
| [in] | p_scan_info | Pointer to scan information structure |
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| [in] | p_handle | Pointer 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_info | Pointer to TX power information |
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| [in] | p_enc_info | information for starting encryption |
| ssp_err_t(* sf_ble_api_t::versionGet) (ssp_version_t *const p_version) |
Gets version and stores it in provided pointer p_version.
| [out] | p_version | pointer to memory location to return version number |
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| [in] | p_bd_addr | Pointer to BLE address |
| 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.
| [in] | p_ctrl | Pointer to the control block for the BLE module. |
| [in] | p_bd_addr | Pointer to BLE address |