diff --git a/firmware/application/apps/ui_recon.cpp b/firmware/application/apps/ui_recon.cpp index 89de63565..9109becde 100644 --- a/firmware/application/apps/ui_recon.cpp +++ b/firmware/application/apps/ui_recon.cpp @@ -26,12 +26,12 @@ #include "file.hpp" // Id's for messages between ReconThread and ReconView -#define MSG_RECON_PAUSE 9999 // for handle_retune to know that recon thread triggered a pause. f is not important with that message -#define MSG_RECON_SET_MODULATION 10000 // for handle_retune to know that recon thread triggered a modulation change. f is the index of the modulation -#define MSG_RECON_SET_BANDWIDTH 20000 // for handle_retune to know that recon thread triggered a bandwidth change. f is the new bandwidth value index for current modulation -#define MSG_RECON_SET_STEP 30000 // for handle_retune to know that recon thread triggered a bandwidth change. f is the new bandwidth value index for current modulation +#define MSG_RECON_PAUSE 9999 // for handle_retune to know that recon thread triggered a pause. f is not important with that message +#define MSG_RECON_SET_MODULATION 10000 // for handle_retune to know that recon thread triggered a modulation change. f is the index of the modulation +#define MSG_RECON_SET_BANDWIDTH 20000 // for handle_retune to know that recon thread triggered a bandwidth change. f is the new bandwidth value index for current modulation +#define MSG_RECON_SET_STEP 30000 // for handle_retune to know that recon thread triggered a bandwidth change. f is the new bandwidth value index for current modulation #define MSG_RECON_SET_RECEIVER_BANDWIDTH 40000 // for handle_retune to know that recon thread triggered a receiver bandwidth change. f is the new bandwidth in hz -#define MSG_RECON_SET_RECEIVER_SAMPLERATE 50000 // for handle_retune to know that recon thread triggered a receiver samplerate change. f is the new samplerate in hz/s +#define MSG_RECON_SET_RECEIVER_SAMPLERATE 50000 // for handle_retune to know that recon thread triggered a receiver samplerate change. f is the new samplerate in hz/s using namespace portapack; diff --git a/firmware/application/freqman.cpp b/firmware/application/freqman.cpp index 37c1020d7..9762d62d2 100644 --- a/firmware/application/freqman.cpp +++ b/firmware/application/freqman.cpp @@ -58,6 +58,7 @@ options_t freqman_entry_steps = { { "12.5KHz(NFM)" , 12500 }, { "15KHz (HFM)" , 15000 }, { "25KHz (N1)" , 25000 }, + { "30KHz (OIRT)" , 30000 }, { "50KHz (FM1)" , 50000 }, { "100KHz (FM2)" , 100000 }, { "250KHz (N2)" , 250000 }, @@ -74,6 +75,7 @@ options_t freqman_entry_steps_short = { { "12.5KHz" , 12500 }, { "15KHz" , 15000 }, { "25KHz" , 25000 }, + { "30KHz" , 30000 }, { "50KHz" , 50000 }, { "100KHz" , 100000 }, { "250KHz" , 250000 }, @@ -99,91 +101,6 @@ std::vector get_freqman_files() { bool load_freqman_file(std::string& file_stem, freqman_db &db) { return load_freqman_file_ex( file_stem , db , true , true , true ); - /* File freqman_file; - size_t length, n = 0, file_position = 0; - char * pos; - char * line_start; - char * line_end; - std::string description; - rf::Frequency frequency_a, frequency_b; - char file_data[257]; - freqman_entry_type type; - - db.clear(); - - auto result = freqman_file.open("FREQMAN/" + file_stem + ".TXT"); - if (result.is_valid()) - return false; - - while (1) { - // Read a 256 bytes block from file - freqman_file.seek(file_position); - - memset(file_data, 0, 257); - auto read_size = freqman_file.read(file_data, 256); - if (read_size.is_error()) - return false; // Read error - - file_position += 256; - - // Reset line_start to beginning of buffer - line_start = file_data; - - if (!strstr(file_data, "f=") && !strstr(file_data, "a=")) - break; - - // Look for complete lines in buffer - while ((line_end = strstr(line_start, "\x0A"))) { - // Read frequency - pos = strstr(line_start, "f="); - frequency_b = 0; - type = SINGLE; - if (pos) { - pos += 2; - frequency_a = strtoll(pos, nullptr, 10); - } else { - // ...or range - pos = strstr(line_start, "a="); - if (pos) { - pos += 2; - frequency_a = strtoll(pos, nullptr, 10); - type = RANGE; - pos = strstr(line_start, "b="); - if (pos) { - pos += 2; - frequency_b = strtoll(pos, nullptr, 10); - } else - frequency_b = 0; - } else - frequency_a = 0; - } - - // Read description until , or LF - pos = strstr(line_start, "d="); - if (pos) { - pos += 2; - length = std::min(strcspn(pos, ",\x0A"), (size_t)FREQMAN_DESC_MAX_LEN); - description = string(pos, length); - } else - description = "-"; - - db.push_back({ frequency_a, frequency_b, description, type , -1 , -1 , -1 , -1 }); - n++; - - if (n >= FREQMAN_MAX_PER_FILE) return true; - - line_start = line_end + 1; - if (line_start - file_data >= 256) break; -} - -if (read_size.value() != 256) - break; // End of file - - // Restart at beginning of last incomplete line - file_position -= (file_data + 256 - line_start); - } -return true; -*/ } bool load_freqman_file_ex(std::string& file_stem, freqman_db& db, bool load_freqs , bool load_ranges , bool load_hamradios ) { diff --git a/sdcard/FREQMAN/FM_JAPAN_BAND.TXT b/sdcard/FREQMAN/FM_JAPAN_BAND.TXT new file mode 100644 index 000000000..8057be16a --- /dev/null +++ b/sdcard/FREQMAN/FM_JAPAN_BAND.TXT @@ -0,0 +1 @@ +a=76000000,b=90000000,m=WFM,bw=16k,s=50KHz,d=WFM Japan diff --git a/sdcard/FREQMAN/FM_OIRT_BAND.TXT b/sdcard/FREQMAN/FM_OIRT_BAND.TXT new file mode 100644 index 000000000..bfc42c345 --- /dev/null +++ b/sdcard/FREQMAN/FM_OIRT_BAND.TXT @@ -0,0 +1 @@ +a=65800000,b=74000000,m=WFM,bw=16k,s=30KHz,d=WFM OIRT diff --git a/sdcard/FREQMAN/FM_STANDARD_BAND.TXT b/sdcard/FREQMAN/FM_STANDARD_BAND.TXT new file mode 100644 index 000000000..683693d1d --- /dev/null +++ b/sdcard/FREQMAN/FM_STANDARD_BAND.TXT @@ -0,0 +1 @@ +a=87500000,b=108000000,m=WFM,bw=16k,s=50KHz,d=WFM Standard diff --git a/sdcard/FREQMAN/RECON.TXT b/sdcard/FREQMAN/RECON.TXT new file mode 100644 index 000000000..601a376ec --- /dev/null +++ b/sdcard/FREQMAN/RECON.TXT @@ -0,0 +1,22 @@ +a=150000,b=285000,m=AM,bw=DSB,s=5KHz,d=Longwave broadcast band|BCB (EU) +a=525000,b=1605000,m=AM,bw=DSB,s=5KHz,d=AM broadcast band|BCB (EU & J) +a=530000,b=1710000,m=AM,bw=DSB,s=5KHz,d=AM broadcast band|BCB (US) +a=1800000,b=29700000,m=WFM,bw=16k,d=Amateur_radio|Amateur +a=26900000,b=27400000,m=WFM,bw=16k,d=Citizens_band_radio|Citizens band +a=28000000,b=30000000,m=WFM,bw=16k,d=Amateur_radio|Amateur +a=29000000,b=54000000,m=WFM,bw=16k,d=Land mobile +a=50000000,b=54000000,m=WFM,bw=16k,d=Amateur_radio|Amateur +a=65000000,b=85000000,m=WFM,bw=16k,d=Land mobile (EU) +a=108000000,b=136000000,m=WFM,bw=16k,d=Aircraft +a=120000000,b=160000000,m=WFM,bw=16k,s=50KHz,d=Land mobile (EU) +a=132000000,b=174000000,m=WFM,bw=16k,s=50KHz,d=Land mobile +a=142000000,b=170000000,m=WFM,bw=16k,s=50KHz,d=Land mobile (J) +a=144000000,b=148000000,m=WFM,bw=16k,s=50KHz,d=Amateur_radio|Amateur +a=216000000,b=222000000,m=WFM,bw=16k,s=50KHz,d=Land mobile +a=222000000,b=225000000,m=WFM,bw=16k,s=50KHz,d=Amateur_radio|Amateur +a=335000000,b=384000000,m=WFM,bw=16k,s=50KHz,d=Land mobile (J) +a=406000000,b=512000000,m=WFM,bw=16k,s=50KHz,d=Land mobile +a=450000000,b=470000000,m=WFM,bw=16k,s=50KHz,d=Land mobile (J) +a=430000000,b=450000000,m=WFM,bw=16k,s=50KHz,d=Amateur_radio|Amateur +a=806000000,b=947000000,m=WFM,bw=16k,s=50KHz,d=Land mobile +a=1200000000,b=1600000000,m=WFM,bw=16k,s=50KHz,d=Amateur|Land mobile|GPS