-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New_EU_presets #9038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
New_EU_presets #9038
Changes from all commits
b4a20c1
b1a0633
d6b58c7
6d5b632
d8bfab5
dcf476c
8fa1c4a
94aa0fb
3921945
44a2fda
8b22774
ab601fa
9536221
e624b8f
52664f9
e1ea21f
9162a6f
72b350c
c4087d9
4693296
ef959cc
0748de7
2a25a15
4a70f79
b87e88f
7255a02
ebb70c4
879daab
f64e69c
be0223e
b09dbf8
8910650
07e8fbf
d0a611b
7a3ed22
dd7efd3
0d2f3a5
d8f5d6f
30e9907
d1e639a
42548b7
fe01a40
8bc35ac
694f4c9
76e9293
96a55f5
34e39ae
93ebbfc
3b824c6
329b302
47f8f40
20dcd7b
d619cf3
2083d3d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,12 +10,21 @@ struct RegionInfo { | |
| meshtastic_Config_LoRaConfig_RegionCode code; | ||
| float freqStart; | ||
| float freqEnd; | ||
| float dutyCycle; | ||
| float spacing; | ||
| float dutyCycle; // modified by getEffectiveDutyCycle | ||
| float spacing; // gaps between radio channels | ||
| float padding; // padding at each side of the "operating channel" | ||
| uint8_t powerLimit; // Or zero for not set | ||
| bool audioPermitted; | ||
| bool freqSwitching; | ||
| bool wideLora; | ||
| bool licensedOnly; // Only allow in HAM mode | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is unused for now, but lays the ground work for the hambands |
||
| int8_t textThrottle; // text broadcast throttle - signed to allow future changes | ||
| int8_t positionThrottle; // position broadcast throttle - signed to allow future changes | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is used for the PositionModule.cpp changes - current check is just for non-zero. |
||
| int8_t telemetryThrottle; // telemetry broadcast throttle - signed to allow future changes | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is used for all the other telemetry changes - current check is just for non-zero. |
||
| uint8_t overrideSlot; // default frequency slot if not using channel hashing | ||
| meshtastic_Config_LoRaConfig_ModemPreset defaultPreset; | ||
| // static list of available presets | ||
| const meshtastic_Config_LoRaConfig_ModemPreset *availablePresets; | ||
| const char *name; // EU433 etc | ||
| }; | ||
|
|
||
|
|
@@ -24,6 +33,20 @@ extern const RegionInfo *myRegion; | |
|
|
||
| extern void initRegion(); | ||
|
|
||
| /** | ||
| * Get the effective duty cycle for the current region based on device role. | ||
| * For EU_866, returns 10% for fixed devices (ROUTER, ROUTER_LATE) and 2.5% for mobile devices. | ||
| * For other regions, returns the standard duty cycle. | ||
| */ | ||
| extern float getEffectiveDutyCycle(); | ||
|
|
||
| extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_STD[]; | ||
| extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_EU_868[]; | ||
| extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_LITE[]; | ||
| extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_NARROW[]; | ||
| // extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_HAM[]; | ||
| extern meshtastic_Config_LoRaConfig_ModemPreset PRESETS_UNDEF[]; | ||
|
|
||
| static inline float bwCodeToKHz(uint16_t bwCode) | ||
| { | ||
| if (bwCode == 31) | ||
|
|
@@ -102,6 +125,26 @@ static inline void modemPresetToParams(meshtastic_Config_LoRaConfig_ModemPreset | |
| cr = 8; | ||
| sf = 12; | ||
| break; | ||
| case meshtastic_Config_LoRaConfig_ModemPreset_LITE_FAST: | ||
| bwKHz = 125; | ||
| cr = 5; | ||
| sf = 9; | ||
| break; | ||
| case meshtastic_Config_LoRaConfig_ModemPreset_LITE_SLOW: | ||
| bwKHz = 125; | ||
| cr = 5; | ||
| sf = 10; | ||
| break; | ||
| case meshtastic_Config_LoRaConfig_ModemPreset_NARROW_FAST: | ||
| bwKHz = 62.5f; | ||
| cr = 6; | ||
| sf = 7; | ||
| break; | ||
| case meshtastic_Config_LoRaConfig_ModemPreset_NARROW_SLOW: | ||
| bwKHz = 62.5f; | ||
| cr = 6; | ||
| sf = 8; | ||
| break; | ||
| default: // LONG_FAST (or illegal) | ||
| bwKHz = wideLora ? 812.5f : 250.0f; | ||
| cr = 5; | ||
|
|
@@ -117,4 +160,4 @@ static inline float modemPresetToBwKHz(meshtastic_Config_LoRaConfig_ModemPreset | |
| uint8_t cr = 0; | ||
| modemPresetToParams(preset, wideLora, bwKHz, sf, cr); | ||
| return bwKHz; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1292,7 +1292,7 @@ void NodeDB::loadFromDisk() | |
| // Coerce LoRa config fields derived from presets while bootstrapping. | ||
| // Some clients/UI components display bandwidth/spread_factor directly from config even in preset mode. | ||
| if (config.has_lora && config.lora.use_preset) { | ||
| RadioInterface::bootstrapLoRaConfigFromPreset(config.lora); | ||
| RadioInterface::validateModemConfig(config.lora); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is a rewrite of @thebentern checks, but using the tools we developed for this PR. |
||
| } | ||
|
|
||
| if (backupSecurity.private_key.size > 0) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@caveman99 this is the method we're using to centralise the frequency slots within the allowed bands.