Merge fixes

+ thanks @Willy-JL !
This commit is contained in:
MX
2024-02-19 03:52:35 +03:00
parent 9fcf3795ee
commit 66c60e65aa
13 changed files with 89 additions and 331 deletions

View File

@@ -748,17 +748,15 @@ Function,+,ble_svc_serial_start,BleServiceSerial*,
Function,+,ble_svc_serial_stop,void,BleServiceSerial*
Function,+,ble_svc_serial_update_tx,_Bool,"BleServiceSerial*, uint8_t*, uint16_t"
Function,-,bsearch,void*,"const void*, const void*, size_t, size_t, __compar_fn_t"
Function,+,bt_disable_peer_key_update,void,Bt*
Function,-,bt_close_rpc_connection,void,Bt*
Function,+,bt_disconnect,void,Bt*
Function,+,bt_enable_peer_key_update,void,Bt*
Function,+,bt_forget_bonded_devices,void,Bt*
Function,+,bt_get_profile_adv_name,const char*,Bt*
Function,+,bt_get_profile_mac_address,const uint8_t*,Bt*
Function,+,bt_get_profile_pairing_method,GapPairing,Bt*
Function,+,bt_keys_storage_set_default_path,void,Bt*
Function,+,bt_keys_storage_set_storage_path,void,"Bt*, const char*"
Function,-,bt_open_rpc_connection,void,Bt*
Function,+,bt_profile_restore_default,_Bool,Bt*
Function,+,bt_profile_start,FuriHalBleProfileBase*,"Bt*, const FuriHalBleProfileTemplate*, FuriHalBleProfileParams"
Function,+,bt_remote_rssi,_Bool,"Bt*, uint8_t*"
Function,+,bt_set_status_changed_callback,void,"Bt*, BtStatusChangedCallback, void*"
Function,+,buffered_file_stream_alloc,Stream*,Storage*
Function,+,buffered_file_stream_close,_Bool,Stream*
@@ -1190,9 +1188,6 @@ Function,+,furi_get_tick,uint32_t,
Function,+,furi_hal_bt_change_app,FuriHalBleProfileBase*,"const FuriHalBleProfileTemplate*, FuriHalBleProfileParams, GapEventCallback, void*"
Function,+,furi_hal_bt_check_profile_type,_Bool,"FuriHalBleProfileBase*, const FuriHalBleProfileTemplate*"
Function,+,furi_hal_bt_clear_white_list,_Bool,
Function,+,furi_hal_bt_custom_adv_set,_Bool,"const uint8_t*, size_t"
Function,+,furi_hal_bt_custom_adv_start,_Bool,"uint16_t, uint16_t, uint8_t, const uint8_t[( 6 )], uint8_t"
Function,+,furi_hal_bt_custom_adv_stop,_Bool,
Function,+,furi_hal_bt_dump_state,void,FuriString*
Function,+,furi_hal_bt_ensure_c2_mode,_Bool,BleGlueC2Mode
Function,+,furi_hal_bt_extra_beacon_get_config,const GapExtraBeaconConfig*,
@@ -1202,17 +1197,15 @@ Function,+,furi_hal_bt_extra_beacon_set_config,_Bool,const GapExtraBeaconConfig*
Function,+,furi_hal_bt_extra_beacon_set_data,_Bool,"const uint8_t*, uint8_t"
Function,+,furi_hal_bt_extra_beacon_start,_Bool,
Function,+,furi_hal_bt_extra_beacon_stop,_Bool,
Function,-,furi_hal_bt_get_conn_rssi,uint32_t,uint8_t*
Function,+,furi_hal_bt_get_key_storage_buff,void,"uint8_t**, uint16_t*"
Function,+,furi_hal_bt_get_profile_adv_name,const char*,FuriHalBtProfile
Function,+,furi_hal_bt_get_profile_mac_addr,const uint8_t*,FuriHalBtProfile
Function,-,furi_hal_bt_get_profile_pairing_method,GapPairing,FuriHalBtProfile
Function,+,furi_hal_bt_get_radio_stack,FuriHalBtStack,
Function,+,furi_hal_bt_get_rssi,float,
Function,+,furi_hal_bt_get_transmitted_packets,uint32_t,
Function,+,furi_hal_bt_hid_consumer_key_press,_Bool,uint16_t
Function,-,furi_hal_bt_init,void,
Function,+,furi_hal_bt_is_active,_Bool,
Function,+,furi_hal_bt_is_alive,_Bool,
Function,+,furi_hal_bt_is_connected,_Bool,
Function,+,furi_hal_bt_is_gatt_gap_supported,_Bool,
Function,+,furi_hal_bt_is_testing_supported,_Bool,
Function,+,furi_hal_bt_lock_core2,void,
@@ -1221,9 +1214,6 @@ Function,+,furi_hal_bt_nvm_sram_sem_release,void,
Function,+,furi_hal_bt_reinit,void,
Function,+,furi_hal_bt_reverse_mac_addr,void,uint8_t[( 6 )]
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 + ( 8 + 1 ) ) + 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,
Function,+,furi_hal_bt_start_app,FuriHalBleProfileBase*,"const FuriHalBleProfileTemplate*, FuriHalBleProfileParams, GapEventCallback, void*"
Function,+,furi_hal_bt_start_packet_rx,void,"uint8_t, uint8_t"
@@ -1851,6 +1841,7 @@ Function,-,gap_extra_beacon_set_config,_Bool,const GapExtraBeaconConfig*
Function,-,gap_extra_beacon_set_data,_Bool,"const uint8_t*, uint8_t"
Function,-,gap_extra_beacon_start,_Bool,
Function,-,gap_extra_beacon_stop,_Bool,
Function,-,gap_get_remote_conn_rssi,uint32_t,int8_t*
Function,-,gap_get_state,GapState,
Function,-,gap_init,_Bool,"GapConfig*, GapEventCallback, void*"
Function,-,gap_start_advertising,void,
1 entry status name type params
748 Function + ble_svc_serial_stop void BleServiceSerial*
749 Function + ble_svc_serial_update_tx _Bool BleServiceSerial*, uint8_t*, uint16_t
750 Function - bsearch void* const void*, const void*, size_t, size_t, __compar_fn_t
751 Function + - bt_disable_peer_key_update bt_close_rpc_connection void Bt*
752 Function + bt_disconnect void Bt*
Function + bt_enable_peer_key_update void Bt*
753 Function + bt_forget_bonded_devices void Bt*
Function + bt_get_profile_adv_name const char* Bt*
Function + bt_get_profile_mac_address const uint8_t* Bt*
Function + bt_get_profile_pairing_method GapPairing Bt*
754 Function + bt_keys_storage_set_default_path void Bt*
755 Function + bt_keys_storage_set_storage_path void Bt*, const char*
756 Function - bt_open_rpc_connection void Bt*
757 Function + bt_profile_restore_default _Bool Bt*
758 Function + bt_profile_start FuriHalBleProfileBase* Bt*, const FuriHalBleProfileTemplate*, FuriHalBleProfileParams
759 Function + bt_remote_rssi _Bool Bt*, uint8_t*
760 Function + bt_set_status_changed_callback void Bt*, BtStatusChangedCallback, void*
761 Function + buffered_file_stream_alloc Stream* Storage*
762 Function + buffered_file_stream_close _Bool Stream*
1188 Function + furi_hal_bt_change_app FuriHalBleProfileBase* const FuriHalBleProfileTemplate*, FuriHalBleProfileParams, GapEventCallback, void*
1189 Function + furi_hal_bt_check_profile_type _Bool FuriHalBleProfileBase*, const FuriHalBleProfileTemplate*
1190 Function + furi_hal_bt_clear_white_list _Bool
Function + furi_hal_bt_custom_adv_set _Bool const uint8_t*, size_t
Function + furi_hal_bt_custom_adv_start _Bool uint16_t, uint16_t, uint8_t, const uint8_t[( 6 )], uint8_t
Function + furi_hal_bt_custom_adv_stop _Bool
1191 Function + furi_hal_bt_dump_state void FuriString*
1192 Function + furi_hal_bt_ensure_c2_mode _Bool BleGlueC2Mode
1193 Function + furi_hal_bt_extra_beacon_get_config const GapExtraBeaconConfig*
1197 Function + furi_hal_bt_extra_beacon_set_data _Bool const uint8_t*, uint8_t
1198 Function + furi_hal_bt_extra_beacon_start _Bool
1199 Function + furi_hal_bt_extra_beacon_stop _Bool
1200 Function - furi_hal_bt_get_conn_rssi uint32_t uint8_t*
1201 Function + furi_hal_bt_get_key_storage_buff void uint8_t**, uint16_t*
Function + furi_hal_bt_get_profile_adv_name const char* FuriHalBtProfile
Function + furi_hal_bt_get_profile_mac_addr const uint8_t* FuriHalBtProfile
Function - furi_hal_bt_get_profile_pairing_method GapPairing FuriHalBtProfile
1202 Function + furi_hal_bt_get_radio_stack FuriHalBtStack
1203 Function + furi_hal_bt_get_rssi float
1204 Function + furi_hal_bt_get_transmitted_packets uint32_t
Function + furi_hal_bt_hid_consumer_key_press _Bool uint16_t
1205 Function - furi_hal_bt_init void
1206 Function + furi_hal_bt_is_active _Bool
1207 Function + furi_hal_bt_is_alive _Bool
1208 Function + furi_hal_bt_is_connected _Bool
1209 Function + furi_hal_bt_is_gatt_gap_supported _Bool
1210 Function + furi_hal_bt_is_testing_supported _Bool
1211 Function + furi_hal_bt_lock_core2 void
1214 Function + furi_hal_bt_reinit void
1215 Function + furi_hal_bt_reverse_mac_addr void uint8_t[( 6 )]
1216 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 + ( 8 + 1 ) ) + 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
1217 Function + furi_hal_bt_start_advertising void
1218 Function + furi_hal_bt_start_app FuriHalBleProfileBase* const FuriHalBleProfileTemplate*, FuriHalBleProfileParams, GapEventCallback, void*
1219 Function + furi_hal_bt_start_packet_rx void uint8_t, uint8_t
1841 Function - gap_extra_beacon_set_data _Bool const uint8_t*, uint8_t
1842 Function - gap_extra_beacon_start _Bool
1843 Function - gap_extra_beacon_stop _Bool
1844 Function - gap_get_remote_conn_rssi uint32_t int8_t*
1845 Function - gap_get_state GapState
1846 Function - gap_init _Bool GapConfig*, GapEventCallback, void*
1847 Function - gap_start_advertising void

View File

@@ -63,7 +63,7 @@ void ble_gatt_characteristic_init(
char_data_descriptor->security_permissions,
char_data_descriptor->access_permissions,
char_data_descriptor->gatt_evt_mask,
MIN_ENCRY_KEY_SIZE,
GATT_MIN_READ_KEY_SIZE,
char_data_descriptor->is_variable,
&char_instance->descriptor_handle);
if(status) {

View File

@@ -372,35 +372,33 @@ static void gap_init_svc(Gap* gap) {
// Set default PHY
hci_le_set_default_phy(ALL_PHYS_PREFERENCE, TX_2M_PREFERRED, RX_2M_PREFERRED);
// Set I/O capability
bool bonding_mode = gap->config->bonding_mode;
uint8_t cfg_mitm_protection = CFG_MITM_PROTECTION;
uint8_t cfg_used_fixed_pin = CFG_USED_FIXED_PIN;
bool keypress_supported = false;
// New things below
uint8_t conf_mitm = CFG_MITM_PROTECTION;
uint8_t conf_used_fixed_pin = CFG_USED_FIXED_PIN;
bool conf_bonding = gap->config->bonding_mode;
if(gap->config->pairing_method == GapPairingPinCodeShow) {
aci_gap_set_io_capability(IO_CAP_DISPLAY_ONLY);
} else if(gap->config->pairing_method == GapPairingPinCodeVerifyYesNo) {
aci_gap_set_io_capability(IO_CAP_DISPLAY_YES_NO);
keypress_supported = true;
} else if(gap->config->pairing_method == GapPairingNone) {
// Just works pairing method (IOS accept it, it seems android and linux doesn't)
conf_mitm = 0;
conf_used_fixed_pin = 0;
conf_bonding = false;
// if just works isn't supported, we want the numeric comparaison method
// "Just works" pairing method (iOS accepts it, it seems Android and Linux don't)
bonding_mode = false;
cfg_mitm_protection = MITM_PROTECTION_NOT_REQUIRED;
cfg_used_fixed_pin = USE_FIXED_PIN_FOR_PAIRING_ALLOWED;
// If "just works" isn't supported, we want the numeric comparaison method
aci_gap_set_io_capability(IO_CAP_DISPLAY_YES_NO);
keypress_supported = true;
}
// Setup authentication
aci_gap_set_authentication_requirement(
conf_bonding,
conf_mitm,
bonding_mode,
cfg_mitm_protection,
CFG_SC_SUPPORT,
keypress_supported,
CFG_ENCRYPTION_KEY_SIZE_MIN,
CFG_ENCRYPTION_KEY_SIZE_MAX,
conf_used_fixed_pin, // 0x0 for no pin
cfg_used_fixed_pin,
0,
CFG_IDENTITY_ADDRESS);
// Configure whitelist
@@ -554,6 +552,17 @@ bool gap_init(GapConfig* config, GapEventCallback on_event_cb, void* context) {
return true;
}
// Get RSSI
uint32_t gap_get_remote_conn_rssi(int8_t* rssi) {
if(gap && gap->state == GapStateConnected) {
fetch_rssi();
*rssi = gap->conn_rssi;
if(gap->time_rssi_sample) return furi_get_tick() - gap->time_rssi_sample;
}
return 0;
}
GapState gap_get_state(void) {
GapState state;
if(gap) {

View File

@@ -73,7 +73,7 @@ typedef struct {
bool bonding_mode;
GapPairing pairing_method;
uint8_t mac_address[GAP_MAC_ADDR_SIZE];
char adv_name[FURI_HAL_BT_ADV_NAME_LENGTH];
char adv_name[FURI_HAL_VERSION_DEVICE_NAME_LENGTH];
GapConnectionParamsRequest conn_param;
} GapConfig;

View File

@@ -402,51 +402,6 @@ uint32_t furi_hal_bt_get_conn_rssi(uint8_t* rssi) {
return since;
}
// API for BLE beacon plugin
bool furi_hal_bt_custom_adv_set(const uint8_t* adv_data, size_t adv_len) {
tBleStatus status = aci_gap_additional_beacon_set_data(adv_len, adv_data);
if(status) {
FURI_LOG_E(TAG, "custom_adv_set failed %d", status);
return false;
} else {
FURI_LOG_D(TAG, "custom_adv_set success");
return true;
}
}
bool furi_hal_bt_custom_adv_start(
uint16_t min_interval,
uint16_t max_interval,
uint8_t mac_type,
const uint8_t mac_addr[GAP_MAC_ADDR_SIZE],
uint8_t power_amp_level) {
tBleStatus status = aci_gap_additional_beacon_start(
min_interval / 0.625, // Millis to gap time
max_interval / 0.625, // Millis to gap time
0b00000111, // All 3 channels
mac_type,
mac_addr,
power_amp_level);
if(status) {
FURI_LOG_E(TAG, "custom_adv_start failed %d", status);
return false;
} else {
FURI_LOG_D(TAG, "custom_adv_start success");
return true;
}
}
bool furi_hal_bt_custom_adv_stop() {
tBleStatus status = aci_gap_additional_beacon_stop();
if(status) {
FURI_LOG_E(TAG, "custom_adv_stop failed %d", status);
return false;
} else {
FURI_LOG_D(TAG, "custom_adv_stop success");
return true;
}
}
void furi_hal_bt_reverse_mac_addr(uint8_t mac_addr[GAP_MAC_ADDR_SIZE]) {
uint8_t tmp;
for(size_t i = 0; i < GAP_MAC_ADDR_SIZE / 2; i++) {
@@ -456,52 +411,6 @@ void furi_hal_bt_reverse_mac_addr(uint8_t mac_addr[GAP_MAC_ADDR_SIZE]) {
}
}
void furi_hal_bt_set_profile_adv_name(
FuriHalBtProfile profile,
const char name[FURI_HAL_BT_ADV_NAME_LENGTH]) {
furi_assert(profile < FuriHalBtProfileNumber);
furi_assert(name);
if(strlen(name) == 0) {
memset(&(profile_config[profile].config.adv_name[1]), 0, FURI_HAL_BT_ADV_NAME_LENGTH - 1);
} else {
profile_config[profile].config.adv_name[0] = AD_TYPE_COMPLETE_LOCAL_NAME;
strlcpy(
&(profile_config[profile].config.adv_name[1]),
name,
FURI_HAL_BT_ADV_NAME_LENGTH - 1 /* BLE symbol */);
}
}
const char* furi_hal_bt_get_profile_adv_name(FuriHalBtProfile profile) {
furi_assert(profile < FuriHalBtProfileNumber);
return &(profile_config[profile].config.adv_name[1]);
}
void furi_hal_bt_set_profile_mac_addr(
FuriHalBtProfile profile,
const uint8_t mac_addr[GAP_MAC_ADDR_SIZE]) {
furi_assert(profile < FuriHalBtProfileNumber);
furi_assert(mac_addr);
memcpy(profile_config[profile].config.mac_address, mac_addr, GAP_MAC_ADDR_SIZE);
}
const uint8_t* furi_hal_bt_get_profile_mac_addr(FuriHalBtProfile profile) {
furi_assert(profile < FuriHalBtProfileNumber);
return profile_config[profile].config.mac_address;
}
void furi_hal_bt_set_profile_pairing_method(FuriHalBtProfile profile, GapPairing pairing_method) {
furi_assert(profile < FuriHalBtProfileNumber);
profile_config[profile].config.pairing_method = pairing_method;
}
GapPairing furi_hal_bt_get_profile_pairing_method(FuriHalBtProfile profile) {
furi_assert(profile < FuriHalBtProfileNumber);
return profile_config[profile].config.pairing_method;
}
uint32_t furi_hal_bt_get_transmitted_packets() {
uint32_t packets = 0;
aci_hal_le_tx_test_packet_number(&packets);

View File

@@ -91,7 +91,14 @@ typedef struct {
static FuriHalVersion furi_hal_version = {0};
void furi_hal_version_set_name(const char* name) {
if(name != NULL) {
uint32_t udn = LL_FLASH_GetUDN();
if(name == NULL) {
name = version_get_custom_name(NULL);
if(name != NULL) {
udn = *((uint32_t*)name);
}
}
if(name != NULL && strlen(name)) {
strlcpy(furi_hal_version.name, name, FURI_HAL_VERSION_ARRAY_NAME_LENGTH);
snprintf(
furi_hal_version.device_name,
@@ -105,11 +112,6 @@ void furi_hal_version_set_name(const char* name) {
furi_hal_version.device_name[0] = AD_TYPE_COMPLETE_LOCAL_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));
}
uint32_t company_id = LL_FLASH_GetSTCompanyID();
// uint32_t device_id = LL_FLASH_GetDeviceID();
// Some flippers return 0x27 (flippers with chip revision 2003 6495) instead of 0x26 (flippers with chip revision 2001 6495)
@@ -137,11 +139,7 @@ static void furi_hal_version_load_otp_v0() {
furi_hal_version.board_body = otp->board_body;
furi_hal_version.board_connect = otp->board_connect;
if(version_get_custom_name(NULL) != NULL) {
furi_hal_version_set_name(version_get_custom_name(NULL));
} else {
furi_hal_version_set_name(otp->name);
}
furi_hal_version_set_name(otp->name);
}
static void furi_hal_version_load_otp_v1() {
@@ -155,11 +153,7 @@ static void furi_hal_version_load_otp_v1() {
furi_hal_version.board_color = otp->board_color;
furi_hal_version.board_region = otp->board_region;
if(version_get_custom_name(NULL) != NULL) {
furi_hal_version_set_name(version_get_custom_name(NULL));
} else {
furi_hal_version_set_name(otp->name);
}
furi_hal_version_set_name(otp->name);
}
static void furi_hal_version_load_otp_v2() {
@@ -179,11 +173,7 @@ static void furi_hal_version_load_otp_v2() {
if(otp->board_color != 0xFF) {
furi_hal_version.board_color = otp->board_color;
furi_hal_version.board_region = otp->board_region;
if(version_get_custom_name(NULL) != NULL) {
furi_hal_version_set_name(version_get_custom_name(NULL));
} else {
furi_hal_version_set_name(otp->name);
}
furi_hal_version_set_name(otp->name);
} else {
furi_hal_version.board_color = 0;
furi_hal_version.board_region = 0;

View File

@@ -18,12 +18,6 @@
#define FURI_HAL_BT_STACK_VERSION_MINOR (12)
#define FURI_HAL_BT_C2_START_TIMEOUT (1000)
#define FURI_HAL_BT_EMPTY_MAC_ADDR \
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
#define FURI_HAL_BT_DEFAULT_MAC_ADDR \
{ 0x6c, 0x7a, 0xd8, 0xac, 0x57, 0x72 }
#ifdef __cplusplus
extern "C" {
#endif
@@ -236,69 +230,13 @@ float furi_hal_bt_get_rssi();
*/
uint32_t furi_hal_bt_get_transmitted_packets();
// BadBT Stuff
/** Reverse a MAC address byte order in-place
* @param[in] mac mac address to reverse
*/
void furi_hal_bt_reverse_mac_addr(uint8_t mac_addr[GAP_MAC_ADDR_SIZE]);
/** Modify profile advertisement name and restart bluetooth
* @param[in] profile profile type
* @param[in] name new adv name
*/
void furi_hal_bt_set_profile_adv_name(
FuriHalBtProfile profile,
const char name[FURI_HAL_BT_ADV_NAME_LENGTH]);
const char* furi_hal_bt_get_profile_adv_name(FuriHalBtProfile profile);
/** Modify profile mac address and restart bluetooth
* @param[in] profile profile type
* @param[in] mac new mac address
*/
void furi_hal_bt_set_profile_mac_addr(
FuriHalBtProfile profile,
const uint8_t mac_addr[GAP_MAC_ADDR_SIZE]);
const uint8_t* furi_hal_bt_get_profile_mac_addr(FuriHalBtProfile profile);
uint32_t furi_hal_bt_get_conn_rssi(uint8_t* rssi);
// API for BLE Beacon plugin
/** Set custom advertisement packet data
* @param[in] adv_data pointer to advertisement data
* @param[in] adv_len length of advertisement data
*
* @return true on success
*/
bool furi_hal_bt_custom_adv_set(const uint8_t* adv_data, size_t adv_len);
/** Start custom advertisement beacon
* @param[in] min_interval minimum advertisement interval (20 - 10240 ms)
* @param[in] max_interval maximum advertisement interval (20 - 10240 ms)
* @param[in] mac_type type of mac address (0x00 public, 0x01 static random)
* @param[in] mac_addr pointer to mac address
* @param[in] power_amp_level amplifier level (output dBm) (0x00 - 0x1F)
*
* @return true on success
*/
bool furi_hal_bt_custom_adv_start(
uint16_t min_interval,
uint16_t max_interval,
uint8_t mac_type,
const uint8_t mac_addr[GAP_MAC_ADDR_SIZE],
uint8_t power_amp_level);
/** Stop custom advertisement beacon
*
* @return true on success
*/
bool furi_hal_bt_custom_adv_stop();
void furi_hal_bt_set_profile_pairing_method(FuriHalBtProfile profile, GapPairing pairing_method);
GapPairing furi_hal_bt_get_profile_pairing_method(FuriHalBtProfile profile);
bool furi_hal_bt_is_connected(void);
/** Check & switch C2 to given mode

View File

@@ -46,8 +46,6 @@ bool furi_hal_region_is_provisioned();
*
* 2 letter Region code according to iso 3166 standard
* There are 2 extra values that we use in special cases:
* RM, whats the reason you not doing a release?
* Waiting for my commits?
* - "00" - developer edition, unlocked
* - "WW" - world wide, region provisioned by default
* - "--" - no provisioned region

View File

@@ -16,10 +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 + "Flipper " + name */
#define FURI_HAL_VERSION_DEVICE_NAME_LENGTH (1 + 8 + FURI_HAL_VERSION_ARRAY_NAME_LENGTH)
// 18 characters + null terminator
#define FURI_HAL_BT_ADV_NAME_LENGTH (FURI_HAL_VERSION_DEVICE_NAME_LENGTH + 1)
#define FURI_HAL_BT_ADV_NAME_LENGTH (18 + 1) // 18 characters + null terminator
#define FURI_HAL_VERSION_DEVICE_NAME_LENGTH \
(1 + FURI_HAL_BT_ADV_NAME_LENGTH) // Used for custom BT name, BLE symbol + name
/** OTP Versions enum */
typedef enum {