mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-01 22:08:55 -07:00
Proper BT custom name length handling
This commit is contained in:
@@ -1124,7 +1124,7 @@ Function,+,furi_hal_bt_serial_start,void,
|
||||
Function,+,furi_hal_bt_serial_stop,void,
|
||||
Function,+,furi_hal_bt_serial_tx,_Bool,"uint8_t*, uint16_t"
|
||||
Function,+,furi_hal_bt_set_key_storage_change_callback,void,"BleGlueKeyStorageChangedCallback, void*"
|
||||
Function,+,furi_hal_bt_set_profile_adv_name,void,"FuriHalBtProfile, const char[( 1 + ( 8 + 1 ) ) + 9 - 1]"
|
||||
Function,+,furi_hal_bt_set_profile_adv_name,void,"FuriHalBtProfile, const char[( 18 + 1 )]"
|
||||
Function,+,furi_hal_bt_set_profile_mac_addr,void,"FuriHalBtProfile, const uint8_t[( 6 )]"
|
||||
Function,+,furi_hal_bt_set_profile_pairing_method,void,"FuriHalBtProfile, GapPairing"
|
||||
Function,+,furi_hal_bt_start_advertising,void,
|
||||
|
||||
|
@@ -477,7 +477,7 @@ bool furi_hal_bt_ensure_c2_mode(BleGlueC2Mode mode) {
|
||||
|
||||
void furi_hal_bt_set_profile_adv_name(
|
||||
FuriHalBtProfile profile,
|
||||
const char name[FURI_HAL_VERSION_DEVICE_NAME_LENGTH - 1]) {
|
||||
const char name[FURI_HAL_BT_ADV_NAME_LENGTH]) {
|
||||
furi_assert(profile < FuriHalBtProfileNumber);
|
||||
furi_assert(name);
|
||||
|
||||
@@ -491,7 +491,7 @@ void furi_hal_bt_set_profile_adv_name(
|
||||
memcpy(
|
||||
&(profile_config[profile].config.adv_name[1]),
|
||||
name,
|
||||
FURI_HAL_VERSION_DEVICE_NAME_LENGTH - 1);
|
||||
FURI_HAL_BT_ADV_NAME_LENGTH);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ bool furi_hal_bt_ensure_c2_mode(BleGlueC2Mode mode);
|
||||
*/
|
||||
void furi_hal_bt_set_profile_adv_name(
|
||||
FuriHalBtProfile profile,
|
||||
const char name[FURI_HAL_VERSION_DEVICE_NAME_LENGTH - 1]);
|
||||
const char name[FURI_HAL_BT_ADV_NAME_LENGTH]);
|
||||
|
||||
const char* furi_hal_bt_get_profile_adv_name(FuriHalBtProfile profile);
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ extern "C" {
|
||||
|
||||
#define FURI_HAL_VERSION_NAME_LENGTH 8
|
||||
#define FURI_HAL_VERSION_ARRAY_NAME_LENGTH (FURI_HAL_VERSION_NAME_LENGTH + 1)
|
||||
/** BLE symbol + name */
|
||||
#define FURI_HAL_BT_ADV_NAME_LENGTH (18 + 1) // 18 characters + null terminator
|
||||
#define FURI_HAL_VERSION_DEVICE_NAME_LENGTH \
|
||||
(1 + FURI_HAL_VERSION_ARRAY_NAME_LENGTH) + 9 // for bad kb custom name
|
||||
(1 + FURI_HAL_BT_ADV_NAME_LENGTH) // Used for custom BT name, BLE symbol + name
|
||||
|
||||
/** OTP Versions enum */
|
||||
typedef enum {
|
||||
|
||||
Reference in New Issue
Block a user