![]() |
BSB Developer Docs
|
Common logic for remote and bsb devices. More...
#include <furi.h>Go to the source code of this file.
Macros | |
| #define | BLE_DEVICE_ADDRESS_LEN (6) |
| Device address length. | |
Typedefs | |
| typedef struct BleDeviceBase | BleDeviceBase |
| Opaque BleDeviceBase type declaration. | |
Enumerations | |
| enum | BleDeviceRole { BleDeviceRoleUnknown , BleDeviceRoleRemote , BleDeviceRoleCentral , BleDeviceRoleCount } |
| Enumeration of device roles. More... | |
| enum | BleDeviceAddressType { BleDeviceAddressTypeUnknown , BleDeviceAddressTypeOrigin , BleDeviceAddressTypeResolvable , BleDeviceAddressTypeCount } |
| Enumeration of device address types. More... | |
| enum | BleDeviceFeatures { BleDeviceFeaturesLEEncryption = 0 , BleDeviceFeaturesConnectionParametersRequestProcedure = 1 , BleDeviceFeaturesExtendedRejectIndication = 2 , BleDeviceFeaturesPeripheralInitiatedFeaturesExchange = 3 , BleDeviceFeaturesLEPing = 4 , BleDeviceFeaturesLEDataPacketLengthExtension = 5 , BleDeviceFeaturesLLPrivacy = 6 , BleDeviceFeaturesExtendedScanningFilterPolicies = 7 , BleDeviceFeaturesLE2MPhy = 8 , BleDeviceFeaturesStableModulationIndexTransmitter = 9 , BleDeviceFeaturesStableModulationIndexReceiver = 10 , BleDeviceFeaturesLECodedPhy = 11 , BleDeviceFeaturesLEExtendedAdvertising = 12 , BleDeviceFeaturesLEPeriodicAdvertising = 13 , BleDeviceFeaturesChannelSelectionAlgorithm2 = 14 , BleDeviceFeaturesLEPowerClass1 = 15 } |
| Features bits enumeration from ble spec. More... | |
Functions | |
| BleDeviceBase * | ble_device_base_alloc (BleDeviceRole role) |
| Create base device instance with desired role. | |
| void | ble_device_base_free (BleDeviceBase *instance) |
| Free base device instance. | |
| const uint8_t * | ble_device_base_get_address (BleDeviceBase *instance, BleDeviceAddressType type) |
| Get address of desired type from device. | |
| void | ble_device_base_set_address (BleDeviceBase *instance, BleDeviceAddressType type, const uint8_t *const addr) |
| Set address and type. | |
| void | ble_device_base_format_address (BleDeviceBase *instance, BleDeviceAddressType type, FuriString *output) |
| Converts address to string. | |
| void | ble_device_base_set_features (BleDeviceBase *instance, const uint8_t *features) |
| Store device features received from nwp internally. | |
| bool | ble_device_base_is_feature_supported (BleDeviceBase *instance, BleDeviceFeatures feature) |
| Checks if mentioned feature is supported by device or not. | |
Common logic for remote and bsb devices.
| enum BleDeviceAddressType |
Enumeration of device address types.
Currently only origin is used because this enum added for future logic implementation
| enum BleDeviceFeatures |
Features bits enumeration from ble spec.
In spec there is much more feature bits, but they are not used in case of this device, so this enum is limited
| enum BleDeviceRole |
Enumeration of device roles.
This roles match with devices roles in ble spec Currently BSB is a remote and phone is a central
| BleDeviceBase * ble_device_base_alloc | ( | BleDeviceRole | role | ) |
Create base device instance with desired role.
| [in] | role | of a new device |
| void ble_device_base_format_address | ( | BleDeviceBase * | instance, |
| BleDeviceAddressType | type, | ||
| FuriString * | output ) |
Converts address to string.
| [in] | instance | of base device |
| [in] | type | address type |
| [out] | output | pointer to string where result will be placed |
| void ble_device_base_free | ( | BleDeviceBase * | instance | ) |
Free base device instance.
| [in] | instance | of base device |
| const uint8_t * ble_device_base_get_address | ( | BleDeviceBase * | instance, |
| BleDeviceAddressType | type ) |
Get address of desired type from device.
If device does not have address it will return array of zeros
| [in] | instance | of base device |
| [in] | type | desired address type |
| bool ble_device_base_is_feature_supported | ( | BleDeviceBase * | instance, |
| BleDeviceFeatures | feature ) |
Checks if mentioned feature is supported by device or not.
| [in] | instance | of base device |
| [in] | feature | to be tested |
| void ble_device_base_set_address | ( | BleDeviceBase * | instance, |
| BleDeviceAddressType | type, | ||
| const uint8_t *const | addr ) |
Set address and type.
| [in] | instance | of base device |
| [in] | type | address type |
| [in] | addr | array with address bytes must be of BLE_DEVICE_ADDRESS_LEN |
| void ble_device_base_set_features | ( | BleDeviceBase * | instance, |
| const uint8_t * | features ) |
Store device features received from nwp internally.
| [in] | instance | of base device |
| [in] | features | array received from nwp during connection establishing |