BLE advertising improvements (#4151)

* Support longer advertised BLE UUID

* BLE: support manufacturer data

* Don't pair when GapPairingNone

* Add PR feedback

---------

Co-authored-by: hedger <hedger@users.noreply.github.com>
This commit is contained in:
Eric Betts
2025-04-01 11:37:40 -07:00
committed by GitHub
parent bd1e395b08
commit 5786066512
4 changed files with 58 additions and 11 deletions

View File

@@ -6,6 +6,7 @@
#include <services/battery_service.h>
#include <services/serial_service.h>
#include <furi.h>
#include <ble/core/ble_defs.h>
typedef struct {
FuriHalBleProfileBase base;
@@ -47,7 +48,11 @@ static void ble_profile_serial_stop(FuriHalBleProfileBase* profile) {
#define CONNECTION_INTERVAL_MAX (0x24)
static const GapConfig serial_template_config = {
.adv_service_uuid = 0x3080,
.adv_service =
{
.UUID_Type = UUID_TYPE_16,
.Service_UUID_16 = 0x3080,
},
.appearance_char = 0x8600,
.bonding_mode = true,
.pairing_method = GapPairingPinCodeShow,
@@ -71,7 +76,8 @@ static void
config->adv_name,
furi_hal_version_get_ble_local_device_name_ptr(),
FURI_HAL_VERSION_DEVICE_NAME_LENGTH);
config->adv_service_uuid |= furi_hal_version_get_hw_color();
config->adv_service.UUID_Type = UUID_TYPE_16;
config->adv_service.Service_UUID_16 |= furi_hal_version_get_hw_color();
}
static const FuriHalBleProfileTemplate profile_callbacks = {