Skip to content

Commit

Permalink
Raw enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorcelli authored Dec 29, 2024
1 parent aa560a2 commit a948c37
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/modules/rf/rf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,7 @@ void rf_scan_copy_draw_signal(RfCodes received, int signals, bool ReadRAW) {
void rf_scan_copy() {
RfCodes received;
RCSwitch rcswitch = RCSwitch();
bool OnlyRAW = false;
const char* sz_range[] = {"300-348 MHz", "387-464 MHz", "779-928 MHz", "All ranges" };
int range_limits[][2] = {
{ 0, 23 }, // 300-348 MHz
Expand Down Expand Up @@ -1505,7 +1506,7 @@ void rf_scan_copy() {
#endif
}

if (rcswitch.available()) { // Decoded by the lib
if (rcswitch.available() && !OnlyRAW) { // Decoded by the lib
unsigned long value = rcswitch.getReceivedValue();
if (value) { // if there are a value decoded by RCSwitch, shows it first
found_freq = frequency;
Expand Down Expand Up @@ -1538,6 +1539,7 @@ void rf_scan_copy() {
}

if(rcswitch.RAWavailable() && ReadRAW){ // if no value were decoded, show raw data to be saved
delay(400); // wait for all the signal to be read
found_freq = frequency;
++signals;

Expand Down Expand Up @@ -1575,10 +1577,12 @@ void rf_scan_copy() {
options.push_back({ "Save Signal", [&]() { option = 2; } });
options.push_back({ "Reset Signal", [&]() { option = 3; } });
}
if(bruceConfig.rfModule==CC1101_SPI_MODULE) options.push_back({ "Range", [&]() { option = 1; } });
if(received.data!="")


if(ReadRAW) options.push_back({ "Stop RAW", [&]() { ReadRAW=false; } });
else options.push_back({ "Read RAW", [&]() { ReadRAW=true; } });
if(bruceConfig.devMode && !OnlyRAW) options.push_back({ "[D]Only RAW", [&]() { ReadRAW=true; OnlyRAW=true; } });
else if(bruceConfig.devMode && OnlyRAW) options.push_back({ "[D]RAW+Decode",[&]() { ReadRAW=true; OnlyRAW=false; } });
options.push_back({ "Close Menu", [&]() { option =-1; } });
options.push_back({ "Main Menu", [=]() { returnToMenu=true; } });

Expand Down

0 comments on commit a948c37

Please sign in to comment.