Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.

Commit

Permalink
Fix BLE name prefixes --nobuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Feb 19, 2024
1 parent c2fe7d8 commit 99f20e4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/ble_profile/extra_profiles/hid_profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,17 @@ static void ble_profile_hid_get_config(GapConfig* config, FuriHalBleProfileParam

// Set advertise name
memset(config->adv_name, 0, sizeof(config->adv_name));
FuriString* name = furi_string_alloc_set(furi_hal_version_get_ble_local_device_name_ptr());

const char* clicker_str = "Control";
if(hid_profile_params && hid_profile_params->device_name_prefix) {
clicker_str = hid_profile_params->device_name_prefix;
}
furi_string_replace_str(name, "Flipper", clicker_str);
// We don't have Flipper in BLE name, use printf instead of replace
FuriString* name = furi_string_alloc_printf(
"%c%s %s",
furi_hal_version_get_ble_local_device_name_ptr()[0],
clicker_str,
furi_hal_version_get_ble_local_device_name_ptr() + 1);
if(furi_string_size(name) >= sizeof(config->adv_name)) {
furi_string_left(name, sizeof(config->adv_name) - 1);
}
Expand Down

0 comments on commit 99f20e4

Please sign in to comment.