From 1c00709ea63b2dce9eef87d86e19fb3faa98cf14 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sun, 11 Sep 2022 15:03:44 +0300 Subject: [PATCH] fix custom name serial, bt mac, fix subghz starline --- documentation/CustomFlipperName.md | 3 ++- firmware/targets/f7/furi_hal/furi_hal.c | 2 +- firmware/targets/f7/furi_hal/furi_hal_version.c | 4 ++-- lib/subghz/protocols/star_line.c | 3 +++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/documentation/CustomFlipperName.md b/documentation/CustomFlipperName.md index 4b7889065..244c8acc9 100644 --- a/documentation/CustomFlipperName.md +++ b/documentation/CustomFlipperName.md @@ -8,9 +8,10 @@ 5. Run command with extra enviroment var before `./fbt` that variable should contain your custom name in alphanumeric characters - max length 8 chars `CUSTOM_FLIPPER_NAME=Name ./fbt COMPACT=1 DEBUG=0 updater_package` - where `Name` write your custom name 6. Copy `dist/f7-C/f7-update-local` folder to microSD `update/myfw/` and run `update` file on flipper from file manager app (Archive) -7. Flash from microSD card only, .dfu update from qFlipper will not work properly since name and serial number will be changed +7. Flash from microSD card only!!!! .dfu update from qFlipper will not work properly since name and serial number will be changed 8. Done, you will have custom name, serial number and bluetooth mac address +9. Also you can skip 5-7 and flash with `CUSTOM_FLIPPER_NAME=Name ./fbt COMPACT=1 DEBUG=0 FORCE=1 flash_usb_full` ## Troubleshooting diff --git a/firmware/targets/f7/furi_hal/furi_hal.c b/firmware/targets/f7/furi_hal/furi_hal.c index 662ada619..7ff8cd573 100644 --- a/firmware/targets/f7/furi_hal/furi_hal.c +++ b/firmware/targets/f7/furi_hal/furi_hal.c @@ -1,6 +1,6 @@ #include -#include #include +#include #include diff --git a/firmware/targets/f7/furi_hal/furi_hal_version.c b/firmware/targets/f7/furi_hal/furi_hal_version.c index 4f197eaed..500317cdc 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_version.c +++ b/firmware/targets/f7/furi_hal/furi_hal_version.c @@ -107,7 +107,7 @@ static void furi_hal_version_set_name(const char* name) { // BLE Mac address uint32_t udn = LL_FLASH_GetUDN(); if(version_get_custom_name(NULL) != NULL) { - udn = (uint32_t)*version_get_custom_name(NULL); + udn = *((uint32_t*)version_get_custom_name(NULL)); } uint32_t company_id = LL_FLASH_GetSTCompanyID(); @@ -318,7 +318,7 @@ size_t furi_hal_version_uid_size() { const uint8_t* furi_hal_version_uid() { if(version_get_custom_name(NULL) != NULL) { - return (const uint8_t*)((uint32_t)*version_get_custom_name(NULL)); + return (const uint8_t*)&(*((uint32_t*)version_get_custom_name(NULL))); } return (const uint8_t*)UID64_BASE; } diff --git a/lib/subghz/protocols/star_line.c b/lib/subghz/protocols/star_line.c index 44f157bd5..2d60ce37e 100644 --- a/lib/subghz/protocols/star_line.c +++ b/lib/subghz/protocols/star_line.c @@ -472,6 +472,9 @@ static uint8_t subghz_protocol_star_line_check_remote_controller_selector( uint32_t decrypt = 0; uint64_t man_normal_learning; int res = 0; + if(mfname == 0x0) { + mfname = ""; + } if(strcmp(mfname, "") == 0) { for