mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-24 01:28:11 -07:00
Fix BT HID profile name setting
This commit is contained in:
@@ -206,12 +206,12 @@ bool furi_hal_bt_start_app(FuriHalBtProfile profile, GapEventCallback event_cb,
|
|||||||
if(profile == FuriHalBtProfileSerial) {
|
if(profile == FuriHalBtProfileSerial) {
|
||||||
// Set mac address
|
// Set mac address
|
||||||
memcpy(
|
memcpy(
|
||||||
profile_config[profile].config.mac_address,
|
config->mac_address,
|
||||||
furi_hal_version_get_ble_mac(),
|
furi_hal_version_get_ble_mac(),
|
||||||
sizeof(profile_config[profile].config.mac_address));
|
sizeof(config->mac_address));
|
||||||
// Set advertise name
|
// Set advertise name
|
||||||
strlcpy(
|
strlcpy(
|
||||||
profile_config[profile].config.adv_name,
|
config->adv_name,
|
||||||
furi_hal_version_get_ble_local_device_name_ptr(),
|
furi_hal_version_get_ble_local_device_name_ptr(),
|
||||||
FURI_HAL_VERSION_DEVICE_NAME_LENGTH);
|
FURI_HAL_VERSION_DEVICE_NAME_LENGTH);
|
||||||
|
|
||||||
@@ -223,13 +223,12 @@ bool furi_hal_bt_start_app(FuriHalBtProfile profile, GapEventCallback event_cb,
|
|||||||
config->mac_address[2]++;
|
config->mac_address[2]++;
|
||||||
}
|
}
|
||||||
// Change name Flipper -> Control
|
// Change name Flipper -> Control
|
||||||
if(strlen(&config->adv_name[1]) == 0) {
|
snprintf(
|
||||||
snprintf(
|
config->adv_name,
|
||||||
&config->adv_name[1],
|
strlen("Control ") + FURI_HAL_VERSION_DEVICE_NAME_LENGTH,
|
||||||
strlen("Control ") + FURI_HAL_VERSION_DEVICE_NAME_LENGTH,
|
"%cControl %s",
|
||||||
"Control %s",
|
*furi_hal_version_get_ble_local_device_name_ptr(),
|
||||||
furi_hal_version_get_ble_local_device_name_ptr());
|
furi_hal_version_get_ble_local_device_name_ptr() + 1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(!gap_init(config, event_cb, context)) {
|
if(!gap_init(config, event_cb, context)) {
|
||||||
gap_thread_stop();
|
gap_thread_stop();
|
||||||
|
|||||||
Reference in New Issue
Block a user