![]() |
BSB Developer Docs
|
Represents connection parameters between bsb and remote. More...
#include "ble_device_base.h"Go to the source code of this file.
Data Structures | |
| struct | BleConnectionTimings |
| Connection timings. More... | |
| struct | BleConnectionDataLength |
| Connection data length. More... | |
| union | BlePhy |
| Ble PHY representation. More... | |
Typedefs | |
| typedef void(* | BleConnectionUpdateParametersDoneCallback) (void *ctx) |
| Type definition for callback to be triggered when connection parameters updated. | |
| typedef struct BleConnectionContext | BleConnectionContext |
| Opaque BleConnectionContext type declaration. | |
Functions | |
| BleConnectionContext * | ble_connection_alloc (BleDeviceAddressType type, const uint8_t *const peer_address) |
| Creates connection instance. | |
| void | ble_connection_free (BleConnectionContext *instance) |
| Free connection instance when disconnect happened. | |
| BleDeviceBase * | ble_connection_get_peer (BleConnectionContext *instance) |
| Get pointer to connected remote peer instance for future use. | |
| const BleConnectionTimings * | ble_connection_get_timings (BleConnectionContext *instance) |
| Getter for accessing BleConnectionTimings from the connection. | |
| void | ble_connection_set_timings (BleConnectionContext *instance, const BleConnectionTimings *const timings) |
| Set connection timing data from outside. | |
| const BleConnectionDataLength * | ble_connection_get_data_length (BleConnectionContext *instance) |
| Getter for accessing BleConnectionDataLength from the connection. | |
| void | ble_connection_set_data_length (BleConnectionContext *instance, const BleConnectionDataLength *const data_length) |
| Set data length from outside. | |
| const BlePhy * | ble_connection_get_tx_phy (BleConnectionContext *instance) |
| Get Tx PHY info from the connection. | |
| const BlePhy * | ble_connection_get_rx_phy (BleConnectionContext *instance) |
| Get Rx PHY info from the connection. | |
| void | ble_connection_set_phy (BleConnectionContext *instance, const uint8_t tx_phy, const uint8_t rx_phy) |
| Set both Rx and Tx PHY infos to the connection. | |
| void | ble_connection_start_update_parameters (BleConnectionContext *instance, FuriEventLoop *event_loop, BleConnectionUpdateParametersDoneCallback done_cb, void *ctx) |
| Start process of updating connection parameters. | |
Represents connection parameters between bsb and remote.
| typedef void(* BleConnectionUpdateParametersDoneCallback) (void *ctx) |
Type definition for callback to be triggered when connection parameters updated.
| [in] | ctx | context for callback call |
| BleConnectionContext * ble_connection_alloc | ( | BleDeviceAddressType | type, |
| const uint8_t *const | peer_address ) |
Creates connection instance.
New connection instance is created by ble_device.h everytime when nwp sends a connection event
| [in] | type | remote device address type |
| [in] | peer_address | remote device address |
| void ble_connection_free | ( | BleConnectionContext * | instance | ) |
Free connection instance when disconnect happened.
| [in] | instance | to connection to be deleted |
| const BleConnectionDataLength * ble_connection_get_data_length | ( | BleConnectionContext * | instance | ) |
Getter for accessing BleConnectionDataLength from the connection.
| [in] | instance | to connection |
| BleDeviceBase * ble_connection_get_peer | ( | BleConnectionContext * | instance | ) |
Get pointer to connected remote peer instance for future use.
| [in] | instance | to connection containing information about remote peer |
| const BlePhy * ble_connection_get_rx_phy | ( | BleConnectionContext * | instance | ) |
Get Rx PHY info from the connection.
| [in] | instance | to connection |
| const BleConnectionTimings * ble_connection_get_timings | ( | BleConnectionContext * | instance | ) |
Getter for accessing BleConnectionTimings from the connection.
| [in] | instance | to connection |
| const BlePhy * ble_connection_get_tx_phy | ( | BleConnectionContext * | instance | ) |
Get Tx PHY info from the connection.
| [in] | instance | to connection |
| void ble_connection_set_data_length | ( | BleConnectionContext * | instance, |
| const BleConnectionDataLength *const | data_length ) |
Set data length from outside.
| [in] | instance | to connection |
| [in] | data_length | struct filled with data to set into the connection |
| void ble_connection_set_phy | ( | BleConnectionContext * | instance, |
| const uint8_t | tx_phy, | ||
| const uint8_t | rx_phy ) |
Set both Rx and Tx PHY infos to the connection.
| [in] | instance | to connection |
| [in] | tx_phy | value of Tx PHY |
| [in] | rx_phy | value of Rx PHY |
| void ble_connection_set_timings | ( | BleConnectionContext * | instance, |
| const BleConnectionTimings *const | timings ) |
Set connection timing data from outside.
| [in] | instance | to connection |
| [in] | timings | struct filled with data to set into the connection |
| void ble_connection_start_update_parameters | ( | BleConnectionContext * | instance, |
| FuriEventLoop * | event_loop, | ||
| BleConnectionUpdateParametersDoneCallback | done_cb, | ||
| void * | ctx ) |
Start process of updating connection parameters.
This starts a series of request/responses to the remote device in order to finalize connection parameters. When all operations are completed a done callback will be called
| [in] | instance | to connection |
| [in] | event_loop | instance, through which processing is done |
| [in] | done_cb | callback which will be triggered once all parameters will be agreed |
| [in] | ctx | callback context |