5 extern const unsigned char target_name
[];
6 extern const uint8_t target_name_size
;
7 extern const char commit
[];
8 extern const char version
[];
10 extern const char *wifi_hostname
;
11 extern const char *wifi_ap_ssid
;
12 extern const char *wifi_ap_password
;
13 extern const char *wifi_ap_address
;
21 typedef struct _options
{
22 uint8_t _magic_
[8]; // this is the magic constant so the configurator can find this options block
23 uint16_t _version_
; // the version of this structure
24 uint8_t domain
; // depends on radio chip
26 uint8_t uid
[6]; // MY_UID derived from MY_BINDING_PHRASE
27 uint32_t flash_discriminator
; // Discriminator value used to determine if the device has been reflashed and therefore
28 // the SPIFSS settings are obsolete and the flashed settings should be used in preference
29 uint32_t fan_min_runtime
;
30 int32_t wifi_auto_on_interval
;
31 char home_wifi_ssid
[33];
32 char home_wifi_password
[65];
33 #if defined(TARGET_RX)
35 bool _unused1
:1; // invert_tx
36 bool lock_on_first_connection
:1;
37 bool _unused2
:1; // r9mm_mini_sbus
40 #if defined(TARGET_TX) || defined(UNIT_TEST)
41 uint32_t tlm_report_interval
;
43 bool unlock_higher_power
:1;
45 uint32_t uart_baud
; // only use for airport
47 } __attribute__((packed
)) firmware_options_t
;
49 // Layout is PRODUCTNAME DEVICENAME OPTIONS HARDWARE
50 constexpr size_t ELRSOPTS_PRODUCTNAME_SIZE
= 128;
51 constexpr size_t ELRSOPTS_DEVICENAME_SIZE
= 16;
52 constexpr size_t ELRSOPTS_OPTIONS_SIZE
= 512;
53 constexpr size_t ELRSOPTS_HARDWARE_SIZE
= 2048;
55 extern firmware_options_t firmwareOptions
;
56 extern bool options_init();
58 #if defined(UNIT_TEST)
59 extern char *product_name
;
60 extern char *device_name
;
62 extern char product_name
[];
63 extern char device_name
[];
64 extern uint32_t logo_image
;
65 extern String
& getOptions();
66 extern String
& getHardware();
67 extern void saveOptions();
69 #include "EspFlashStream.h"
70 bool options_HasStringInFlash(EspFlashStream
&strmFlash
);
71 void options_SetTrueDefaults();